fdabe1768e
User-Feedback 15.07.:
1) 'Von allein' heisst jetzt 'Skills' (id #eigenleben bleibt, Links halten).
2) Jeder Skill traegt aktiv/inaktiv - Quelle ist Hermes' EIGENE Wahrheit
(hermes_cli.banner.get_available_skills via Hermes-venv, dieselbe Logik
wie das eingebaute WebUI: Plattform/Voraussetzungen/Config). Bewusst NUR
die Datenquelle wiederverwendet, nicht deren UI - Skill-VERWALTUNG bleibt
im Hermes-GUI-Tab, alles andere waere Bloat/Doppelbau.
3) Auftragsbuch: fertige Queue-Karten sind aufklappbar und zeigen das
ERGEBNIS des Workers (kanban_complete-Summary, lazy via
GET /api/ideen/{id}/ergebnis) - 'Dinge werden getestet, ich sehe aber
das Ergebnis nicht' ist damit zu.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
27 lines
27 KiB
JavaScript
27 lines
27 KiB
JavaScript
import{c as I,a4 as X,u as _,b as q,r as c,j as e,a5 as Y,e as C,L as f,C as Q,N as U,a6 as ee,a7 as te,O as V,X as z,w as R,F,a8 as re,T as K,g as S,a9 as se,q as J}from"./index-ClYatDZT.js";import{L as ae}from"./lightbulb-ETwYqnI4.js";import{S as G}from"./send-D-g9GbnJ.js";/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ne=I("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const le=I("FileDiff",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const de=I("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ie=I("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]),oe={wartung:"Werkstatt",orchestrator:"Orchestrator",doku:"Doku",feature:"Feature"},ce={laeuft:{label:"wird eingespielt …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},rollback:{label:"Rollback läuft …",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10",spin:!0},eingespielt:{label:"eingespielt ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"},fehlgeschlagen:{label:"fehlgeschlagen",cls:"text-red-300 border-red-500/40 bg-red-500/10"},zurueckgerollt:{label:"zurückgerollt",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},kritisch:{label:"KRITISCH — Box prüfen",cls:"text-red-200 border-red-500/60 bg-red-500/20"},abgelehnt:{label:"abgelehnt",cls:"text-muted-foreground border-border/60 bg-background/30"}};function M(t){return t?new Date(t*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function we(){const{data:t,isLoading:s,refetch:d,isFetching:g}=X(),m=_(),{showAlert:h,showConfirm:u,dialogElement:j}=q(),[A,N]=c.useState({}),y=()=>m.invalidateQueries({queryKey:J.auftragsbuch});async function p(l,b,D,i){N(x=>({...x,[l]:!0}));try{await S(b,{method:"POST",body:JSON.stringify(D)}),i&&h("Erledigt",i),y()}catch(x){h("Das hat nicht geklappt",String((x==null?void 0:x.message)||x))}finally{N(x=>({...x,[l]:!1}))}}const k=(t==null?void 0:t.items)??[],w=(t==null?void 0:t.skill_kandidaten)??[],v=k.length===0&&w.length===0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Auftragsbuch"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Was die Box gebaut oder sich ausgedacht hat — du entscheidest. Annehmen spielt es mit Fangnetz ein (Health-Check, automatischer Rollback)."})]}),e.jsxs("button",{onClick:()=>d(),className:"flex h-9 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-3 text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[e.jsx(Y,{className:C("h-3.5 w-3.5",g&&"animate-spin")})," Aktualisieren"]})]}),t&&!t.available&&e.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Das Auftragsbuch lebt auf der Box (liest die Gitea-Branches dort). Im lokalen Dev-Modus ist hier nichts zu sehen."}),s&&e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[e.jsx(f,{className:"h-4 w-4 animate-spin"})," Vorschläge werden geladen …"]}),(t==null?void 0:t.available)&&v&&e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-5",children:[e.jsx(Q,{className:"h-5 w-5 shrink-0 text-emerald-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu entscheiden"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine offenen Vorschläge. Werkstatt, Orchestrator und Traum melden sich hier, sobald es etwas gibt."})]})]}),e.jsx(xe,{}),k.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(O,{icon:de,children:["Fertige Patches (",k.length,")"]}),k.map(l=>e.jsx(pe,{item:l,busy:A,onAct:p,showConfirm:u},`${l.repo??"mc2"}:${l.branch}`))]}),w.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(O,{icon:U,children:["Skill-Kandidaten aus dem Traum (",w.length,")"]}),w.map(l=>e.jsx(be,{k:l,busy:A,onAct:p,showConfirm:u},l.file))]}),j]})}function O({icon:t,children:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(t,{className:"h-3.5 w-3.5"})," ",s]})}const ue={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},he={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"};function xe(){var E,a;const{data:t,isLoading:s}=ee(),d=_(),{showAlert:g,dialogElement:m}=q(),[h,u]=c.useState(""),[j,A]=c.useState(!1),[N,y]=c.useState({}),[p,k]=c.useState(null),[w,v]=c.useState({}),l=(t==null?void 0:t.items)??[],b=()=>d.invalidateQueries({queryKey:J.ideen}),D=p!==null&&(((E=t==null?void 0:t.items.find(r=>r.id===p))==null?void 0:E.status)==="triage"||((a=t==null?void 0:t.items.find(r=>r.id===p))==null?void 0:a.status)==="running"),i=te(p??"",D);async function x(){const r=h.trim();if(!(r.length<3||j)){A(!0);try{const n=r.length>160?r.slice(0,157)+"…":r;await S("/api/ideen",{method:"POST",body:JSON.stringify({titel:n,notiz:r.length>160?r:""})}),u(""),b()}catch(n){g("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{A(!1)}}}async function B(r){y(n=>({...n,[r]:!0}));try{await S("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:r})}),b()}catch(n){g("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{y(n=>({...n,[r]:!1}))}}async function L(r){const n=(w[r]||"").trim();if(!(n.length<1||N["ans:"+r])){y(o=>({...o,["ans:"+r]:!0}));try{await S("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:r,antwort:n})}),v(o=>({...o,[r]:""})),b()}catch(o){g("Das hat nicht geklappt",String((o==null?void 0:o.message)||o))}finally{y(o=>({...o,["ans:"+r]:!1}))}}}return t&&!t.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs(O,{icon:ae,children:["Ideen-Queue",t?` — ${t.offen} offen`:""]}),e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:h,onChange:r=>u(r.target.value),onKeyDown:r=>{r.key==="Enter"&&x()},placeholder:"Neue Idee — einfach hinschreiben, die Box macht den Rest",className:"h-9 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:x,disabled:j||h.trim().length<3,className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-primary/40 bg-primary/10 px-3 text-[11px] font-bold uppercase tracking-wide text-primary transition-all hover:bg-primary/20 cursor-pointer disabled:opacity-50",children:[j?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(G,{className:"h-3.5 w-3.5"})," In die Queue"]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Eine Queue, alle Türen: hier, per Telegram oder im Gespräch mit Lucy. Die Box arbeitet Ideen selbst aus und baut — Code-Ergebnisse erscheinen als Karte unter „Fertige Patches“, nichts davon geht ohne deinen Klick live. Nur reine Doku-Bagatellen zieht die Box nachts selbst ein (mit Fangnetz und Meldung)."}),s&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(t==null?void 0:t.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),l.length>0&&e.jsx("ul",{className:"space-y-1.5",children:l.map(r=>{var H;const n=ue[r.status]??{label:r.status,cls:"text-muted-foreground border-border/60 bg-background/30"},o=p===r.id,P=r.status==="triage"||r.status==="running"||r.status==="done",W=r.status==="blocked",$=!!N["ans:"+r.id];return e.jsxs("li",{className:C("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",W?"border-red-500/30":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:C("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",n.cls),children:[n.spin&&e.jsx(f,{className:"h-3 w-3 animate-spin"}),n.label]}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:r.body||r.titel,children:r.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(V,{className:"h-3 w-3"}),M(r.erstellt)]}),(r.status==="done"||W)&&e.jsx("button",{disabled:!!N[r.id],onClick:()=>B(r.id),title:W?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:N[r.id]?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(z,{className:"h-3.5 w-3.5"})}),P&&e.jsx("button",{onClick:()=>k(o?null:r.id),title:r.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:o?e.jsx(R,{className:"h-3.5 w-3.5"}):e.jsx(F,{className:"h-3.5 w-3.5"})})]}),W&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(re,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:he[r.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",r.frage?e.jsx("span",{className:"text-foreground/90",children:r.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:w[r.id]||"",onChange:T=>v(Z=>({...Z,[r.id]:T.target.value})),onKeyDown:T=>{T.key==="Enter"&&L(r.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>L(r.id),disabled:$||(w[r.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[$?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(G,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),o&&P&&r.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:D&&i.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):i.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(H=i.data)!=null&&H.available&&i.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:i.data.lines.join(`
|
|
`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),o&&r.status==="done"&&e.jsx(ge,{id:r.id})]},r.id)})}),(t==null?void 0:t.available)&&!s&&l.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Queue ist leer — wirf der Box eine Idee zu."})]}),m]})}function ge({id:t}){const[s,d]=c.useState(null),[g,m]=c.useState(!1);c.useEffect(()=>{let u=!1;return S(`/api/ideen/${t}/ergebnis`).then(j=>{u||d(j)}).catch(()=>{u||m(!0)}),()=>{u=!0}},[t]);const h=s?s.summary||s.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(ne,{className:"h-3 w-3"})," Ergebnis des Workers"]}),g?e.jsx("p",{className:"text-[10px] text-red-400",children:"Ergebnis nicht ladbar"}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):h?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:h}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function me({item:t}){const s=t.status;if(!s)return null;const d=ce[s.state];return d?e.jsxs("span",{className:C("flex items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",d.cls),title:s.detail,children:[d.spin&&e.jsx(f,{className:"h-3 w-3 animate-spin"}),d.label]}):null}function pe({item:t,busy:s,onAct:d,showConfirm:g}){var B,L,E;const[m,h]=c.useState(!1),[u,j]=c.useState(null),[A,N]=c.useState(!1),[y,p]=c.useState(!1),[k,w]=c.useState(""),v=((B=t.status)==null?void 0:B.state)==="laeuft"||((L=t.status)==null?void 0:L.state)==="rollback",l=((E=t.status)==null?void 0:E.state)==="eingespielt",b=t.repo??"mc2",D=b==="lucy",i=`${b}:${t.branch}`;async function x(){const a=!m;if(h(a),a&&u===null){N(!0);try{const r=await S(`/api/auftragsbuch/diff?branch=${encodeURIComponent(t.branch)}&repo=${b}`);j(r.diff+(r.truncated?`
|
|
… (gekürzt)`:""))}catch(r){j(`(Diff nicht ladbar: ${(r==null?void 0:r.message)||r})`)}finally{N(!1)}}}return e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary",children:oe[t.kind]??t.kind}),D&&e.jsx("span",{className:"rounded-md border border-pink-500/40 bg-pink-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-pink-300",title:"Vorschlag fürs Lucy-Repo — Annehmen baut die App am PC neu und startet sie neu, wenn sie läuft.",children:"Lucy"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",title:t.branch,children:t.branch}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(V,{className:"h-3 w-3"}),M(t.ts)]}),e.jsx(me,{item:t})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.subject||"(ohne Titel)"}),t.body&&e.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground line-clamp-6",children:t.body}),t.empfehlung&&e.jsxs("p",{className:C("mt-1.5 flex items-start gap-1.5 rounded-lg border px-2 py-1 text-[11px]",t.empfehlung.empfehlung==="ANNEHMEN"&&"border-emerald-500/30 bg-emerald-500/5 text-emerald-300",t.empfehlung.empfehlung==="ABLEHNEN"&&"border-red-500/30 bg-red-500/5 text-red-300",t.empfehlung.empfehlung==="UNKLAR"&&"border-amber-500/30 bg-amber-500/5 text-amber-300"),title:`Nächtliches Kurz-Gutachten (${t.empfehlung.richter}) — eine Meinung, kein Muss. Die Entscheidung bleibt bei dir.`,children:[e.jsx(U,{className:"mt-0.5 h-3 w-3 shrink-0"}),e.jsxs("span",{children:[e.jsxs("b",{children:["Empfehlung: ",t.empfehlung.empfehlung==="ANNEHMEN"?"Annehmen":t.empfehlung.empfehlung==="ABLEHNEN"?"Ablehnen":"Unklar","."]})," ",t.empfehlung.satz]})]})]}),!v&&!l&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!t.verwaist&&e.jsxs("button",{disabled:!!s[i],onClick:()=>g("Vorschlag annehmen?",D?`'${t.branch}' wird im Lucy-Repo auf main gemergt, dann baut dein PC die App neu (dist) und startet Lucy neu, falls sie gerade läuft. Der PC muss dafür an sein. Schlägt Build oder Start fehl, dreht die Box den Merge automatisch zurück — die laufende Lucy bleibt die alte.`:`'${t.branch}' wird auf main gemergt und live eingespielt. Die Zentrale startet dabei kurz neu. Geht der Health-Check danach rot, rollt die Box automatisch zurück.${t.frontend_ohne_build?`
|
|
|
|
Achtung: Enthält Frontend-Quelltext ohne gebautes Bundle — die Oberfläche bleibt alt, bis am PC gebaut wird.`:""}`,()=>d(i,"/api/auftragsbuch/annehmen",{branch:t.branch,repo:b})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[s[i]?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"})," Annehmen"]}),e.jsxs("button",{disabled:!!s["ab:"+i],onClick:()=>p(a=>!a),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["ab:"+i]?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(z,{className:"h-3.5 w-3.5"})," Ablehnen"]})]})]}),y&&!v&&!l&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-red-500/25 bg-red-500/5 p-3",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Der Branch '",t.branch,"' wird auf Gitea gelöscht (die Arbeit bleibt in der Historie). Sag der Box kurz ",e.jsx("b",{children:"warum"})," — dann schlägt sie dir so etwas nicht wieder vor."]}),e.jsx("input",{value:k,onChange:a=>w(a.target.value),placeholder:"Grund (optional) — z. B. „gibt es schon“ oder „will ich nicht“",maxLength:400,className:"w-full rounded-lg border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{disabled:!!s["ab:"+i],onClick:()=>{p(!1),d("ab:"+i,"/api/auftragsbuch/ablehnen",{branch:t.branch,repo:b,grund:k.trim()})},className:"flex h-8 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(z,{className:"h-3.5 w-3.5"})," Wirklich ablehnen"]}),e.jsx("button",{onClick:()=>p(!1),className:"flex h-8 items-center rounded-lg border border-border/60 bg-background/40 px-3 text-[11px] font-semibold text-muted-foreground transition-all hover:text-foreground cursor-pointer",children:"Abbrechen"})]})]}),t.status&&(v||!l)&&t.status.detail&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t.status.detail}),t.verwaist&&e.jsxs("p",{className:"rounded-lg border border-red-500/30 bg-red-500/5 px-2 py-1.5 text-[11px] text-red-300/90",children:[e.jsx("b",{children:"Kaputt aufgesetzt:"})," Dieser Branch hat keinen gemeinsamen Ursprung mit main (der Werkstatt-Worker hat nicht richtig geklont) — Annehmen ist technisch unmöglich, deshalb fehlt der Knopf. Am besten ",e.jsx("b",{children:"ablehnen mit Grund"}),"; die Idee kann danach frisch in die Queue."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:[t.ahead," Commit",t.ahead===1?"":"s"]}),t.shortstat&&e.jsx("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:t.shortstat.trim()}),t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-red-300",title:"Kein gemeinsamer Vorfahre mit main — git kann diesen Branch niemals mergen.",children:[e.jsx(K,{className:"h-3 w-3"})," kein gemeinsamer Ursprung"]}),t.leer&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Der Diff gegen main ist leer — der Branch würde nichts verändern (Inhalt schon in main oder am Repo vorbei gearbeitet).",children:[e.jsx(K,{className:"h-3 w-3"})," Diff leer — bringt nichts"]}),t.behind>0&&!t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"main ist seit diesem Vorschlag weitergelaufen — bei Konflikten versucht die Annahme automatisch einen Rebase.",children:[e.jsx(K,{className:"h-3 w-3"})," ",t.behind," hinter main"]}),t.frontend_ohne_build&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Die Box kann kein Frontend bauen (kein Node) — nach dem Annehmen bleibt die Oberfläche alt, bis am PC gebaut wird.",children:[e.jsx(K,{className:"h-3 w-3"})," Frontend ohne Build"]})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[m?e.jsx(R,{className:"h-3.5 w-3.5"}):e.jsx(F,{className:"h-3.5 w-3.5"}),e.jsx(le,{className:"h-3.5 w-3.5"})," ",t.files.length," Datei",t.files.length===1?"":"en"," — Änderungen ansehen"]}),m&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.files.map(a=>e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[e.jsx("b",{className:C(a.status.startsWith("A")&&"text-emerald-400",a.status.startsWith("D")&&"text-red-400",a.status.startsWith("M")&&"text-sky-400"),children:a.status})," ",a.path]},a.path)),t.files_truncated&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"…"})]}),e.jsx("div",{className:"max-h-96 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3",children:A?e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Diff wird geladen …"}):e.jsx("pre",{className:"text-[10px] leading-relaxed text-foreground/80 whitespace-pre",children:(u??"").split(`
|
|
`).map((a,r)=>e.jsx("span",{className:C("block",a.startsWith("+")&&!a.startsWith("+++")&&"text-emerald-300/90 bg-emerald-500/5",a.startsWith("-")&&!a.startsWith("---")&&"text-red-300/90 bg-red-500/5",(a.startsWith("@@")||a.startsWith("diff "))&&"text-sky-300/90"),children:a||" "},r))})})]})]})]})}function be({k:t,busy:s,onAct:d,showConfirm:g}){const[m,h]=c.useState(!1);return e.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.04] p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-violet-500/30 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-violet-300",children:"Traum-Idee"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",children:t.file}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(V,{className:"h-3 w-3"}),M(t.mtime)]})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.title})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsxs("button",{disabled:!!s["sk:"+t.file],onClick:()=>g("Werkstatt beauftragen?",`Der Kandidat '${t.title}' geht als Auftrag an die Werkstatt (Orchestrator, propose-only). Das Ergebnis erscheint später als neuer Patch-Vorschlag hier im Auftragsbuch — nichts geht ungefragt live.`,()=>d("sk:"+t.file,"/api/auftragsbuch/skill/annehmen",{file:t.file},"Die Werkstatt arbeitet. Das Ergebnis taucht als neuer Vorschlag im Auftragsbuch auf (das kann einige Minuten dauern).")),className:"flex h-9 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[s["sk:"+t.file]?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ie,{className:"h-3.5 w-3.5"})," Beauftragen"]}),e.jsxs("button",{disabled:!!s["skab:"+t.file],onClick:()=>g("Kandidat verwerfen?",`'${t.title}' wandert ins Archiv des Wissens-Vaults (verworfen/). Der Traum schlägt ihn nicht erneut vor.`,()=>d("skab:"+t.file,"/api/auftragsbuch/skill/ablehnen",{file:t.file})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["skab:"+t.file]?e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(z,{className:"h-3.5 w-3.5"})," Verwerfen"]})]})]}),e.jsxs("button",{onClick:()=>h(u=>!u),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[m?e.jsx(R,{className:"h-3.5 w-3.5"}):e.jsx(F,{className:"h-3.5 w-3.5"}),e.jsx(se,{className:"h-3.5 w-3.5"})," Vorschlag lesen"]}),m&&e.jsx("pre",{className:"max-h-72 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3 text-[11px] leading-relaxed text-foreground/85 whitespace-pre-wrap",children:t.preview})]})}export{we as AuftragsbuchView};
|