@coralai/sps-cli 0.50.6 → 0.50.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/console-assets/assets/{index-C95GbuxW.js → index-CGiD8z0L.js} +1 -1
  2. package/dist/console-assets/index.html +1 -1
  3. package/dist/services/PipelineService.d.ts +1 -0
  4. package/dist/services/PipelineService.d.ts.map +1 -1
  5. package/dist/services/PipelineService.js +35 -0
  6. package/dist/services/PipelineService.js.map +1 -1
  7. package/dist/services/executors.d.ts +11 -0
  8. package/dist/services/executors.d.ts.map +1 -1
  9. package/dist/services/executors.js +117 -0
  10. package/dist/services/executors.js.map +1 -1
  11. package/package.json +1 -1
  12. package/dist/console/sse/eventBus.d.ts +0 -25
  13. package/dist/console/sse/eventBus.d.ts.map +0 -1
  14. package/dist/console/sse/eventBus.js +0 -32
  15. package/dist/console/sse/eventBus.js.map +0 -1
  16. package/dist/console-server/index.d.ts +0 -29
  17. package/dist/console-server/index.d.ts.map +0 -1
  18. package/dist/console-server/index.js +0 -180
  19. package/dist/console-server/index.js.map +0 -1
  20. package/dist/console-server/lib/cardReader.d.ts +0 -27
  21. package/dist/console-server/lib/cardReader.d.ts.map +0 -1
  22. package/dist/console-server/lib/cardReader.js +0 -201
  23. package/dist/console-server/lib/cardReader.js.map +0 -1
  24. package/dist/console-server/lib/lockFile.d.ts +0 -17
  25. package/dist/console-server/lib/lockFile.d.ts.map +0 -1
  26. package/dist/console-server/lib/lockFile.js +0 -61
  27. package/dist/console-server/lib/lockFile.js.map +0 -1
  28. package/dist/console-server/lib/portPicker.d.ts +0 -3
  29. package/dist/console-server/lib/portPicker.d.ts.map +0 -1
  30. package/dist/console-server/lib/portPicker.js +0 -25
  31. package/dist/console-server/lib/portPicker.js.map +0 -1
  32. package/dist/console-server/lib/spawnCli.d.ts +0 -31
  33. package/dist/console-server/lib/spawnCli.d.ts.map +0 -1
  34. package/dist/console-server/lib/spawnCli.js +0 -64
  35. package/dist/console-server/lib/spawnCli.js.map +0 -1
  36. package/dist/console-server/routes/cards.d.ts +0 -7
  37. package/dist/console-server/routes/cards.d.ts.map +0 -1
  38. package/dist/console-server/routes/cards.js +0 -185
  39. package/dist/console-server/routes/cards.js.map +0 -1
  40. package/dist/console-server/routes/chat.d.ts +0 -36
  41. package/dist/console-server/routes/chat.d.ts.map +0 -1
  42. package/dist/console-server/routes/chat.js +0 -458
  43. package/dist/console-server/routes/chat.js.map +0 -1
  44. package/dist/console-server/routes/logs.d.ts +0 -14
  45. package/dist/console-server/routes/logs.d.ts.map +0 -1
  46. package/dist/console-server/routes/logs.js +0 -283
  47. package/dist/console-server/routes/logs.js.map +0 -1
  48. package/dist/console-server/routes/pipeline.d.ts +0 -8
  49. package/dist/console-server/routes/pipeline.d.ts.map +0 -1
  50. package/dist/console-server/routes/pipeline.js +0 -96
  51. package/dist/console-server/routes/pipeline.js.map +0 -1
  52. package/dist/console-server/routes/projects.d.ts +0 -11
  53. package/dist/console-server/routes/projects.d.ts.map +0 -1
  54. package/dist/console-server/routes/projects.js +0 -583
  55. package/dist/console-server/routes/projects.js.map +0 -1
  56. package/dist/console-server/routes/skills.d.ts +0 -7
  57. package/dist/console-server/routes/skills.d.ts.map +0 -1
  58. package/dist/console-server/routes/skills.js +0 -267
  59. package/dist/console-server/routes/skills.js.map +0 -1
  60. package/dist/console-server/routes/system.d.ts +0 -7
  61. package/dist/console-server/routes/system.d.ts.map +0 -1
  62. package/dist/console-server/routes/system.js +0 -288
  63. package/dist/console-server/routes/system.js.map +0 -1
  64. package/dist/console-server/routes/workers.d.ts +0 -18
  65. package/dist/console-server/routes/workers.d.ts.map +0 -1
  66. package/dist/console-server/routes/workers.js +0 -351
  67. package/dist/console-server/routes/workers.js.map +0 -1
  68. package/dist/console-server/sse/eventBus.d.ts +0 -25
  69. package/dist/console-server/sse/eventBus.d.ts.map +0 -1
  70. package/dist/console-server/sse/eventBus.js +0 -32
  71. package/dist/console-server/sse/eventBus.js.map +0 -1
  72. package/dist/console-server/sse/projectStream.d.ts +0 -10
  73. package/dist/console-server/sse/projectStream.d.ts.map +0 -1
  74. package/dist/console-server/sse/projectStream.js +0 -86
  75. package/dist/console-server/sse/projectStream.js.map +0 -1
  76. package/dist/console-server/watchers/cardWatcher.d.ts +0 -17
  77. package/dist/console-server/watchers/cardWatcher.d.ts.map +0 -1
  78. package/dist/console-server/watchers/cardWatcher.js +0 -68
  79. package/dist/console-server/watchers/cardWatcher.js.map +0 -1
  80. package/dist/console-server/watchers/markerWatcher.d.ts +0 -7
  81. package/dist/console-server/watchers/markerWatcher.d.ts.map +0 -1
  82. package/dist/console-server/watchers/markerWatcher.js +0 -63
  83. package/dist/console-server/watchers/markerWatcher.js.map +0 -1
  84. package/dist/console-server/watchers/pipelinePoller.d.ts +0 -2
  85. package/dist/console-server/watchers/pipelinePoller.d.ts.map +0 -1
  86. package/dist/console-server/watchers/pipelinePoller.js +0 -52
  87. package/dist/console-server/watchers/pipelinePoller.js.map +0 -1
  88. package/dist/models/types.d.ts +0 -103
  89. package/dist/models/types.d.ts.map +0 -1
  90. package/dist/models/types.js +0 -17
  91. package/dist/models/types.js.map +0 -1
@@ -472,7 +472,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
472
472
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
473
473
  `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Vu(t),a=al(n);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Vu(t),a=al(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function nS(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new eS||null,prettyErrors:t}}function RO(e,t={}){const{lineCounter:n,prettyErrors:a}=nS(t),s=new ug(n==null?void 0:n.addNewLine),o=new cg(t),c=Array.from(o.compose(s.parse(e)));if(a&&n)for(const f of c)f.errors.forEach(Sf(e,n)),f.warnings.forEach(Sf(e,n));return c.length>0?c:Object.assign([],{empty:!0},o.streamInfo())}function iS(e,t={}){const{lineCounter:n,prettyErrors:a}=nS(t),s=new ug(n==null?void 0:n.addNewLine),o=new cg(t);let c=null;for(const f of o.compose(s.parse(e),!0,e.length))if(!c)c=f;else if(c.options.logLevel!=="silent"){c.errors.push(new es(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&n&&(c.errors.forEach(Sf(e,n)),c.warnings.forEach(Sf(e,n))),c}function MO(e,t,n){let a;typeof t=="function"?a=t:n===void 0&&t&&typeof t=="object"&&(n=t);const s=iS(e,n);if(!s)return null;if(s.warnings.forEach(o=>E1(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:a},n))}function jO(e,t,n){let a=null;if(typeof t=="function"||Array.isArray(t)?a=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return ms(e)&&!a?e.toString(n):new Hl(e,a,n).toString(n)}const i0=Object.freeze(Object.defineProperty({__proto__:null,Alias:Uf,CST:CO,Composer:cg,Document:Hl,Lexer:J1,LineCounter:eS,Pair:gn,Parser:ug,Scalar:Le,Schema:$1,YAMLError:lg,YAMLMap:ai,YAMLParseError:es,YAMLSeq:Sr,YAMLWarning:P1,isAlias:_r,isCollection:Mt,isDocument:ms,isMap:$l,isNode:jt,isPair:At,isScalar:vt,isSeq:Fl,parse:MO,parseAllDocuments:RO,parseDocument:iS,stringify:jO,visit:ps,visitAsync:Bf},Symbol.toStringTag,{value:"Module"}));function DO({projectName:e,file:t,onClose:n,onSaved:a}){const s=Tn(),{alert:o}=qn(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=dt({queryKey:["pipeline-file",e,t],queryFn:()=>s2(e,t)}),[g,x]=M.useState("structured"),[v,S]=M.useState(null),[w,_]=M.useState(null);M.useEffect(()=>{c&&v===null&&(S(c.content),_(c.etag),c.parseError&&x("yaml"))},[c,v]),M.useEffect(()=>{const R=q=>{q.key==="Escape"&&n()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n]);const N=Pn({mutationFn:()=>{if(v===null||w===null)throw new Error("no draft");return l2(e,t,v,w)},onSuccess:R=>{_(R.etag),s.invalidateQueries({queryKey:["pipeline-file",e,t]}),s.invalidateQueries({queryKey:["project-pipelines",e]}),a()},onError:R=>{const q=R.status;o({title:q===409?"文件已被其他地方修改":q===422?"YAML 语法错":"保存失败",body:R instanceof Error?R.message:String(R)})}}),j=v!==null&&c&&v!==c.content,{parsed:C,parseError:D}=M.useMemo(()=>{if(v===null)return{parsed:null,parseError:null};try{return{parsed:i0.parse(v)??{},parseError:null}}catch(R){return{parsed:null,parseError:R instanceof Error?R.message:String(R)}}},[v]),F=R=>{try{const q=i0.stringify(R,{lineWidth:0});S(q)}catch(q){o({title:"YAML 序列化失败",body:q instanceof Error?q.message:String(q)})}};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[m.jsx(Kv,{size:20,strokeWidth:2.5}),m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:"active"})]}),m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,w&&` · etag ${w}`]})]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&v!==null&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[m.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[m.jsxs("button",{type:"button",onClick:()=>x("structured"),"aria-pressed":g==="structured",disabled:!!D,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",D?"opacity-50 cursor-not-allowed":""].join(" "),title:D??void 0,children:[m.jsx(Kp,{size:11,strokeWidth:2.5}),"结构化"]}),m.jsxs("button",{type:"button",onClick:()=>x("yaml"),"aria-pressed":g==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(Kv,{size:11,strokeWidth:2.5}),"原始 YAML"]})]}),D&&m.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[m.jsx(qp,{size:12,strokeWidth:2.5}),"YAML parse: ",D]}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:"⚠ 这是当前激活的 pipeline,保存后下一轮 tick 生效"})]}),m.jsxs("div",{className:"flex-1 overflow-auto",children:[g==="structured"&&C&&m.jsx(LO,{parsed:C,onChange:F}),g==="yaml"&&m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:v,onChange:R=>S(R.target.value),spellCheck:!1,"aria-label":"pipeline YAML 编辑器"})]}),m.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:j?m.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:"● 未保存"}):N.isSuccess?m.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[m.jsx(Hp,{size:12,strokeWidth:2.5})," 已保存"]}):"无变化"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{S(null),y()},disabled:N.isPending,type:"button",children:"重新加载"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>N.mutate(),disabled:!j||N.isPending,type:"button","aria-label":"保存 pipeline",children:[N.isPending?m.jsx(en,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(zf,{size:13,strokeWidth:3}),"保存"]})]})]})]})]})})}function LO({parsed:e,onChange:t}){const n=e.stages??[],a=d=>{t({...e,stages:d})},s=()=>{a([...n,{name:`stage-${n.length+1}`,on_complete:"move_card Done"}])},o=d=>{a(n.filter((h,y)=>y!==d))},c=(d,h)=>{const y=[...n],g=d+h;g<0||g>=y.length||([y[d],y[g]]=[y[g],y[d]],a(y))},f=(d,h)=>{a(n.map((y,g)=>g===d?{...y,...h}:y))};return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("span",{className:"font-bold",children:"mode:"}),m.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:d=>t({...e,mode:d.target.value}),children:[m.jsx("option",{value:"project",children:"project"}),m.jsx("option",{value:"steps",children:"steps"})]})]}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"project = 事件驱动流水线(默认) · steps = 顺序脚本"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:["Stages (",n.length,")"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:s,"aria-label":"添加 stage",children:[m.jsx(Zi,{size:11,strokeWidth:3})," 添加 stage"]})]}),n.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没 stage。点"添加 stage"开始。'}):m.jsx("div",{className:"flex flex-col gap-3",children:n.map((d,h)=>m.jsx(IO,{stage:d,index:h,total:n.length,onChange:y=>f(h,y),onRemove:()=>o(h),onMoveUp:()=>c(h,-1),onMoveDown:()=>c(h,1)},h))})]})]})}function IO({stage:e,index:t,total:n,onChange:a,onRemove:s,onMoveUp:o,onMoveDown:c}){const f=e.on_fail??{};return m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&m.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===0,"aria-label":"上移",children:m.jsx(OC,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:c,disabled:t===n-1,"aria-label":"下移",children:m.jsx(Lf,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:s,"aria-label":"删除 stage",children:m.jsx(zl,{size:12,strokeWidth:3})})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(sr,{label:"name",hint:"stage 唯一名",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:d=>a({name:d.target.value}),placeholder:"develop"})}),m.jsx(sr,{label:"profile",hint:"skill 画像,可空",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:d=>a({profile:d.target.value||void 0}),placeholder:"fullstack"})}),m.jsx(sr,{label:"card_state",hint:"本 stage 期间卡片状态",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:d=>a({card_state:d.target.value||void 0}),placeholder:"Inprogress"})}),m.jsx(sr,{label:"timeout",hint:"可选,如 30m 2h",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:d=>a({timeout:d.target.value||void 0}),placeholder:"2h"})}),m.jsx(sr,{label:"trigger",hint:"触发条件,可空走默认",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:d=>a({trigger:d.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),m.jsx(sr,{label:"on_complete",hint:"成功后动作",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:d=>a({on_complete:d.target.value}),placeholder:"move_card Done"})})]}),m.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[m.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(sr,{label:"action",hint:"失败时动作,如 label NEEDS-FIX",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:d=>a({on_fail:{...f,action:d.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),m.jsx(sr,{label:"comment",hint:"写进卡片的注释",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:d=>a({on_fail:{...f,comment:d.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),m.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:d=>a({on_fail:{...f,halt:d.target.checked}})}),m.jsx("span",{className:"font-bold",children:"halt"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(失败后停流水线;去掉则继续下一张卡)"})]})]})]})}function sr({label:e,hint:t,children:n}){return m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&m.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function zO({onCancel:e,onCreate:t,hasActive:n,hasSample:a,isPending:s}){const[o,c]=M.useState(""),[f,d]=M.useState("blank");M.useEffect(()=>{const v=S=>{S.key==="Escape"&&e()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]);const h=o.trim(),y=h.endsWith(".yaml")?h:h?`${h}.yaml`:"",g=y&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(y),x=()=>{!g||s||t(y,f)};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsxs("header",{className:"flex items-start justify-between mb-4",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"新建 pipeline"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:v=>{v.preventDefault(),x()},className:"flex flex-col gap-4",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"文件名"}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"例如 ci",value:o,onChange:v=>c(v.target.value),autoFocus:!0}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["实际会保存为 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:y||"xxx.yaml"}),"。 只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。"]})]}),m.jsxs("fieldset",{className:"flex flex-col gap-2",children:[m.jsx("legend",{className:"text-sm font-bold mb-1",children:"初始内容"}),m.jsx(Sm,{value:"blank",current:f,label:"空白模板",desc:"最简 1 stage (develop → Done)",onSelect:d}),m.jsx(Sm,{value:"sample",current:f,label:"教学模板",desc:"从 sample.yaml.example 复制(带注释,讲解所有字段)",onSelect:d,disabled:!a,disabledReason:"sample.yaml.example 不存在"}),m.jsx(Sm,{value:"active",current:f,label:"复制当前活动的",desc:"从 project.yaml 复制(基于目前的配置改)",onSelect:d,disabled:!n,disabledReason:"project.yaml 不存在"})]}),m.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[m.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:s,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!g||s,"aria-label":"创建 pipeline",children:[s?m.jsx(en,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Zi,{size:13,strokeWidth:3}),"创建"]})]})]})]})})}function Sm({value:e,current:t,label:n,desc:a,onSelect:s,disabled:o,disabledReason:c}){const f=t===e;return m.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",o?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":f?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[m.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:f,disabled:o,onChange:()=>s(e),className:"mt-1 flex-shrink-0"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:n}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:o?c:a})]})]})}function BO(){var o;const{name:e=""}=qE(),t=wr(),[n,a]=M.useState("overview"),s=dt({queryKey:["project",e],queryFn:()=>JA(e),enabled:!!e});return m.jsxs("div",{className:"flex flex-col gap-5 max-w-4xl",children:[m.jsxs("header",{className:"flex items-center gap-3",children:[m.jsxs("button",{type:"button",onClick:()=>t("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":"返回项目列表",children:[m.jsx(WE,{size:14,strokeWidth:3}),"返回"]}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1",children:e}),m.jsx(ji,{to:`/board?project=${encodeURIComponent(e)}`,className:"nb-btn nb-btn-mint",children:"看板"})]}),m.jsxs("nav",{className:"flex gap-2 flex-wrap",children:[m.jsx(Xu,{current:n,value:"overview",onSelect:a,icon:KC,children:"概览"}),m.jsx(Xu,{current:n,value:"config",onSelect:a,icon:n1,children:"配置"}),m.jsx(Xu,{current:n,value:"pipelines",onSelect:a,icon:r1,children:"Pipelines"}),m.jsx(Xu,{current:n,value:"danger",onSelect:a,icon:zl,children:"危险操作"})]}),n==="overview"&&m.jsx(UO,{name:e,data:s.data,loading:s.isLoading}),n==="config"&&m.jsx($O,{name:e}),n==="pipelines"&&m.jsx(FO,{name:e}),n==="danger"&&m.jsx(PO,{name:e,repoDir:((o=s.data)==null?void 0:o.repoDir)??null})]})}function Xu({current:e,value:t,onSelect:n,icon:a,children:s}){const o=e===t;return m.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":o?"page":void 0,className:["nb-btn",o?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[m.jsx(a,{size:13,strokeWidth:2.5}),s]})}function UO({name:e,data:t,loading:n}){return n?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):t?m.jsx("div",{className:"nb-card",children:m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"仓库路径"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),m.jsx("dt",{className:"font-bold",children:"PM 后端"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),m.jsx("dt",{className:"font-bold",children:"Agent"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),m.jsx("dt",{className:"font-bold",children:"卡片"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.cards.total," 张 · ",t.cards.inprogress," 进行中 · ",t.cards.done," 完成"]}),m.jsx("dt",{className:"font-bold",children:"Worker"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.workers.total," 个(",t.workers.active," 活跃)"]}),m.jsx("dt",{className:"font-bold",children:"Pipeline"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),m.jsx("dt",{className:"font-bold",children:"最近活动"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["项目 ",e," 不存在或无法读取。"]})})}function $O({name:e}){const t=Tn(),{alert:n}=qn(),{data:a,isLoading:s,isError:o,error:c,refetch:f}=dt({queryKey:["project-conf",e],queryFn:()=>t2(e)}),[d,h]=M.useState(null),[y,g]=M.useState(null);M.useEffect(()=>{a&&d===null&&(h(a.content),g(a.etag))},[a,d]);const x=d!==null&&a!==void 0&&d!==a.content,v=Pn({mutationFn:()=>{if(d===null||y===null)throw new Error("no draft");return n2(e,d,y)},onSuccess:S=>{g(S.etag),t.invalidateQueries({queryKey:["project-conf",e]}),t.invalidateQueries({queryKey:["project",e]})},onError:S=>{const w=S.status;n({title:w===409?"配置已被其他地方修改":"保存失败",body:w===409?'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。':S instanceof Error?S.message:String(S)})}});return s?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):o?m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",c instanceof Error?c.message:String(c)]})}):m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:m.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),y&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",y]})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{h(null),f()},disabled:v.isPending,"aria-label":"重新加载",children:[m.jsx(hs,{size:13,strokeWidth:2.5}),"重新加载"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>v.mutate(),disabled:!x||v.isPending,"aria-label":"保存配置",children:[v.isPending?m.jsx(en,{size:13,strokeWidth:3,className:"animate-spin"}):v.isSuccess&&!x?m.jsx(kC,{size:13,strokeWidth:3}):m.jsx(zf,{size:13,strokeWidth:3}),"保存"]})]})]}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:d??"",onChange:S=>h(S.target.value),spellCheck:!1,"aria-label":"conf 文件编辑器"}),x&&m.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:"● 未保存的修改"})]})}function FO({name:e}){const t=Tn(),{confirm:n,alert:a}=qn(),{data:s,isLoading:o}=dt({queryKey:["project-pipelines",e],queryFn:()=>a2(e)}),[c,f]=M.useState(null),[d,h]=M.useState(!1),y=Pn({mutationFn:S=>r2(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"切换失败",body:S instanceof Error?S.message:String(S)})}}),g=Pn({mutationFn:S=>c2(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"删除失败",body:S instanceof Error?S.message:String(S)})}}),x=Pn({mutationFn:S=>o2(e,S.name,S.template),onSuccess:S=>{t.invalidateQueries({queryKey:["project-pipelines",e]}),h(!1),f(S.name)},onError:S=>{a({title:"创建失败",body:S instanceof Error?S.message:String(S)})}});if(o)return m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})});const v=[];s!=null&&s.active&&v.push({name:s.active,isActive:!0});for(const S of(s==null?void 0:s.available)??[])v.push({name:S.name,isActive:!1});return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:"Pipelines"}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(!0),disabled:x.isPending,"aria-label":"新建 pipeline",children:[m.jsx(Zi,{size:12,strokeWidth:3}),"新建 pipeline"]})]}),v.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没有 pipeline 文件。点"新建 pipeline"开始。'}):m.jsx("ul",{className:"flex flex-col gap-2",children:v.map(S=>m.jsxs("li",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsx(r1,{size:16,strokeWidth:2.5}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:S.name}),S.isActive&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"active"}),m.jsxs("div",{className:"flex gap-1",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(S.name),"aria-label":`编辑 ${S.name}`,children:[m.jsx(Gp,{size:11,strokeWidth:2.5}),"编辑"]}),!S.isActive&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`切换到 ${S.name}`,body:`当前 project.yaml 会被 ${S.name} 的内容覆盖。继续?`,confirm:"切换"})&&y.mutate(S.name)},disabled:y.isPending,"aria-label":`切换到 ${S.name}`,children:"切换"}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`删除 ${S.name}`,body:"这个 pipeline 文件会被永久删除。",confirm:"删除",danger:!0})&&g.mutate(S.name)},disabled:g.isPending,"aria-label":`删除 ${S.name}`,children:m.jsx(zl,{size:11,strokeWidth:2.5})})]})]})]},S.name))})]}),c&&m.jsx(DO,{projectName:e,file:c,onClose:()=>f(null),onSaved:()=>{t.invalidateQueries({queryKey:["project-pipelines",e]})}}),d&&m.jsx(zO,{hasActive:!!(s!=null&&s.active),hasSample:!0,isPending:x.isPending,onCancel:()=>h(!1),onCreate:(S,w)=>x.mutate({name:S,template:w})})]})}function PO({name:e,repoDir:t}){const n=wr(),a=Tn(),{alert:s}=qn(),[o,c]=M.useState(""),[f,d]=M.useState(!0),h=Pn({mutationFn:()=>i2(e,{includeClaudeDir:f}),onSuccess:y=>{a.invalidateQueries({queryKey:["projects"]});const g=y.claudeRemoved.filter(x=>x.ok).map(x=>x.path);s({title:"已删除",body:g.length>0?`项目已删除。同时清理了:
474
474
  ${g.join(`
475
- `)}`:"项目已删除。"}).then(()=>n("/projects"))},onError:y=>{s({title:"删除失败",body:y instanceof Error?y.message:String(y)})}});return m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:"删除项目"}),m.jsxs("p",{className:"text-sm mb-4",children:["这会清理 ",m.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),"(包括所有卡片、runtime、logs)。"]}),t&&m.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"mt-0.5"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"同时清理 repo 的 .claude/"}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"repo 本身不动,只清这个目录。"})]})]}),m.jsx("div",{className:"mb-4",children:m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsxs("span",{className:"text-sm font-bold",children:["输入项目名 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e})," 确认:"]}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:o,onChange:y=>c(y.target.value),placeholder:e})]})}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:o!==e||h.isPending,onClick:()=>h.mutate(),"aria-label":"永久删除项目",children:[h.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(zl,{size:14,strokeWidth:3}),"永久删除"]})]})}function fg(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return Bt(`/api/skills${t}`)}function qO(e){return Bt(`/api/skills/${encodeURIComponent(e)}`)}function HO(e,t){return Bt(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Zf(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function KO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/link`,{project:t})}function GO(e,t){return fetch(`/api/skills/${encodeURIComponent(e)}/link?project=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()})}function QO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/freeze`,{project:t})}function YO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/unfreeze`,{project:t})}function VO(){return Zf("/api/skills/sync")}function XO({project:e,isPending:t,onCancel:n,onCreate:a}){var j;const[s,o]=M.useState(""),[c,f]=M.useState(""),[d,h]=M.useState(new Set),[y,g]=M.useState(!0),x=dt({queryKey:["skills-all",e],queryFn:()=>fg(e)});M.useEffect(()=>{const C=D=>{D.key==="Escape"&&n()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[n]);const S=s.trim().length>0&&s.trim().length<=200&&!t,w=C=>{const D=new Set(d);D.has(C)?D.delete(C):D.add(C),h(D)},_=()=>{S&&a({title:s.trim(),description:c.trim(),skills:[...d],labels:y?["AI-PIPELINE"]:[]})},N=((j=x.data)==null?void 0:j.data)??[];return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:"新建卡片"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:C=>{C.preventDefault(),_()},className:"flex flex-col gap-4 overflow-auto",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"标题 *"}),m.jsx("input",{type:"text",className:"nb-input w-full",placeholder:"例如:接入 GitHub OAuth 登录",value:s,onChange:C=>o(C.target.value),maxLength:200,autoFocus:!0,required:!0}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"写简短明了的目标(<200 字符)"})]}),m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容",value:c,onChange:C=>f(C.target.value)}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。"})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"Skills"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。"}),x.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),x.isError&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["skill 列表加载失败,不影响创建:",x.error instanceof Error?x.error.message:String(x.error)]}),N.length>0&&m.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(C=>{const D=d.has(C.name);return m.jsx("button",{type:"button",onClick:()=>w(C.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",D?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":D,children:C.name},C.name)})}),d.size>0&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["已选 ",d.size," 个:",[...d].join(", ")]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"流水线"}),m.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[m.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:y,onChange:C=>g(C.target.checked)}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"加入流水线(`AI-PIPELINE` 标签)"}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:"打开后 pipeline 会识别这张卡并派 worker 跑。关闭则只是一个普通 todo,需要人工改标签才会被流水线拾起。"})]})]})]})]}),m.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:_,disabled:!S,type:"button","aria-label":"创建卡片",children:[t?m.jsx(en,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Zi,{size:13,strokeWidth:3}),"创建"]})]})]})})}function ZO(e){return Bt(`/api/projects/${encodeURIComponent(e)}/cards`)}function WO(e,t){return Bt(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function Kl(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.text();throw new Error(`${n.status} ${n.statusText}: ${a}`)}return n.json().catch(()=>({}))}function JO(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function eR(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function tR(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function nR(e,t){const n=typeof t=="string"?{title:t}:t;return Kl(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function iR(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}}async function aR(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}function rR(e){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function sR(e){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function lR(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function aS(e){const t=Tn();M.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,a=new EventSource(n),s=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["cards",d.project]}),d.card&&t.setQueryData(["card",d.project,d.seq],{...t.getQueryData(["card",d.project,d.seq])??{},...d.card}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},c=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return a.addEventListener("card.created",s),a.addEventListener("card.updated",s),a.addEventListener("card.moved",s),a.addEventListener("card.deleted",s),a.addEventListener("worker.updated",o),a.addEventListener("worker.added",o),a.addEventListener("worker.deleted",o),a.addEventListener("pipeline.status",c),a.addEventListener("pipeline.started",c),a.addEventListener("pipeline.stopped",c),()=>a.close()},[e,t])}const oR=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),cR=new Set(["frontend","backend","mobile","database","devops"]),uR=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),fR=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function dR(e){return oR.has(e)?"lang":cR.has(e)?"end":uR.has(e)?"persona":fR.has(e)?"workflow":"other"}const hR={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function rS({name:e}){const t=hR[dR(e)];return m.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function sS({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return m.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function mR({card:e,onClick:t,done:n,draggable:a}){const s=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return m.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:a,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",a?"active:cursor-grabbing":""].join(" "),children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),s&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),m.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&m.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>m.jsx(rS,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>m.jsx(sS,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&m.jsx(pR,{stats:e.checklist}),m.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[m.jsx("span",{children:gR(e.updatedAt??e.createdAt)}),e.branch&&m.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function pR({stats:e}){return m.jsxs("div",{className:"mb-2",children:[m.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[m.jsxs("span",{className:"font-bold",children:["检查清单 ",e.done,"/",e.total]}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),m.jsx("div",{className:"w-full h-1.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full overflow-hidden mb-1.5",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),m.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((t,n)=>m.jsxs("li",{className:`flex items-start gap-1 ${t.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{className:"flex-shrink-0 mt-0.5",children:t.done?"✓":"○"}),m.jsx("span",{className:"line-clamp-1",children:t.text})]},n)),e.items.length>3&&m.jsxs("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:["… 还有 ",e.items.length-3," 条"]})]})]})}function gR(e){if(!e)return"—";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:t.toLocaleDateString()}function bR({label:e,bg:t,cards:n,onCardClick:a,onDropCard:s}){const[o,c]=M.useState(!1);return m.jsxs("div",{className:["flex flex-col gap-2 p-3 rounded-2xl border-[3px] min-h-[340px]","transition-all",o?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!s||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",o||c(!0))},onDragLeave:()=>c(!1),onDrop:f=>{if(c(!1),!s)return;const d=f.dataTransfer.getData("application/x-sps-card-seq"),h=Number.parseInt(d,10);Number.isFinite(h)&&(f.preventDefault(),s(h))},children:[m.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 border-b-2 border-[var(--color-text)]",children:[m.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[n.length===0&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:"— 空 —"}),n.map(f=>m.jsx(mR,{card:f,onClick:()=>a(f),done:e==="Done",draggable:!!s},f.seq))]})]})}function mp(e,t){if(!e)return"";const n=e.split(`
475
+ `)}`:"项目已删除。"}).then(()=>n("/projects"))},onError:y=>{s({title:"删除失败",body:y instanceof Error?y.message:String(y)})}});return m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:"删除项目"}),m.jsxs("p",{className:"text-sm mb-4",children:["这会清理 ",m.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),"(包括所有卡片、runtime、logs)。"]}),t&&m.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"mt-0.5"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"同时清理 repo 的 .claude/"}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"repo 本身不动,只清这个目录。"})]})]}),m.jsx("div",{className:"mb-4",children:m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsxs("span",{className:"text-sm font-bold",children:["输入项目名 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e})," 确认:"]}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:o,onChange:y=>c(y.target.value),placeholder:e})]})}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:o!==e||h.isPending,onClick:()=>h.mutate(),"aria-label":"永久删除项目",children:[h.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(zl,{size:14,strokeWidth:3}),"永久删除"]})]})}function fg(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return Bt(`/api/skills${t}`)}function qO(e){return Bt(`/api/skills/${encodeURIComponent(e)}`)}function HO(e,t){return Bt(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Zf(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function KO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/link`,{project:t})}function GO(e,t){return fetch(`/api/skills/${encodeURIComponent(e)}/link?project=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()})}function QO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/freeze`,{project:t})}function YO(e,t){return Zf(`/api/skills/${encodeURIComponent(e)}/unfreeze`,{project:t})}function VO(){return Zf("/api/skills/sync")}function XO({project:e,isPending:t,onCancel:n,onCreate:a}){var j;const[s,o]=M.useState(""),[c,f]=M.useState(""),[d,h]=M.useState(new Set),[y,g]=M.useState(!0),x=dt({queryKey:["skills-all",e],queryFn:()=>fg(e)});M.useEffect(()=>{const C=D=>{D.key==="Escape"&&n()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[n]);const S=s.trim().length>0&&s.trim().length<=200&&!t,w=C=>{const D=new Set(d);D.has(C)?D.delete(C):D.add(C),h(D)},_=()=>{S&&a({title:s.trim(),description:c.trim(),skills:[...d],labels:y?["AI-PIPELINE"]:[]})},N=((j=x.data)==null?void 0:j.data)??[];return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:"新建卡片"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:C=>{C.preventDefault(),_()},className:"flex flex-col gap-4 overflow-auto",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"标题 *"}),m.jsx("input",{type:"text",className:"nb-input w-full",placeholder:"例如:接入 GitHub OAuth 登录",value:s,onChange:C=>o(C.target.value),maxLength:200,autoFocus:!0,required:!0}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"写简短明了的目标(<200 字符)"})]}),m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容",value:c,onChange:C=>f(C.target.value)}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。"})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"Skills"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。"}),x.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),x.isError&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["skill 列表加载失败,不影响创建:",x.error instanceof Error?x.error.message:String(x.error)]}),N.length>0&&m.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(C=>{const D=d.has(C.name);return m.jsx("button",{type:"button",onClick:()=>w(C.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",D?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":D,children:C.name},C.name)})}),d.size>0&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["已选 ",d.size," 个:",[...d].join(", ")]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"流水线"}),m.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[m.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:y,onChange:C=>g(C.target.checked)}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"加入流水线(`AI-PIPELINE` 标签)"}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:"打开后 pipeline 会识别这张卡并派 worker 跑。关闭则只是一个普通 todo,需要人工改标签才会被流水线拾起。"})]})]})]})]}),m.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:_,disabled:!S,type:"button","aria-label":"创建卡片",children:[t?m.jsx(en,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Zi,{size:13,strokeWidth:3}),"创建"]})]})]})})}function ZO(e){return Bt(`/api/projects/${encodeURIComponent(e)}/cards`)}function WO(e,t){return Bt(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function Kl(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.text();throw new Error(`${n.status} ${n.statusText}: ${a}`)}return n.json().catch(()=>({}))}function JO(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function eR(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function tR(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function nR(e,t){const n=typeof t=="string"?{title:t}:t;return Kl(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function iR(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}}async function aR(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}function rR(e){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function sR(e){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function lR(e,t){return Kl(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function aS(e){const t=Tn();M.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,a=new EventSource(n),s=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["cards",d.project]}),t.invalidateQueries({queryKey:["card",d.project,d.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},c=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return a.addEventListener("card.created",s),a.addEventListener("card.updated",s),a.addEventListener("card.moved",s),a.addEventListener("card.deleted",s),a.addEventListener("worker.updated",o),a.addEventListener("worker.added",o),a.addEventListener("worker.deleted",o),a.addEventListener("pipeline.status",c),a.addEventListener("pipeline.started",c),a.addEventListener("pipeline.stopped",c),()=>a.close()},[e,t])}const oR=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),cR=new Set(["frontend","backend","mobile","database","devops"]),uR=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),fR=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function dR(e){return oR.has(e)?"lang":cR.has(e)?"end":uR.has(e)?"persona":fR.has(e)?"workflow":"other"}const hR={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function rS({name:e}){const t=hR[dR(e)];return m.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function sS({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return m.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function mR({card:e,onClick:t,done:n,draggable:a}){const s=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return m.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:a,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",a?"active:cursor-grabbing":""].join(" "),children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),s&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),m.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&m.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>m.jsx(rS,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>m.jsx(sS,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&m.jsx(pR,{stats:e.checklist}),m.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[m.jsx("span",{children:gR(e.updatedAt??e.createdAt)}),e.branch&&m.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function pR({stats:e}){return m.jsxs("div",{className:"mb-2",children:[m.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[m.jsxs("span",{className:"font-bold",children:["检查清单 ",e.done,"/",e.total]}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),m.jsx("div",{className:"w-full h-1.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full overflow-hidden mb-1.5",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),m.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((t,n)=>m.jsxs("li",{className:`flex items-start gap-1 ${t.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{className:"flex-shrink-0 mt-0.5",children:t.done?"✓":"○"}),m.jsx("span",{className:"line-clamp-1",children:t.text})]},n)),e.items.length>3&&m.jsxs("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:["… 还有 ",e.items.length-3," 条"]})]})]})}function gR(e){if(!e)return"—";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:t.toLocaleDateString()}function bR({label:e,bg:t,cards:n,onCardClick:a,onDropCard:s}){const[o,c]=M.useState(!1);return m.jsxs("div",{className:["flex flex-col gap-2 p-3 rounded-2xl border-[3px] min-h-[340px]","transition-all",o?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!s||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",o||c(!0))},onDragLeave:()=>c(!1),onDrop:f=>{if(c(!1),!s)return;const d=f.dataTransfer.getData("application/x-sps-card-seq"),h=Number.parseInt(d,10);Number.isFinite(h)&&(f.preventDefault(),s(h))},children:[m.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 border-b-2 border-[var(--color-text)]",children:[m.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[n.length===0&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:"— 空 —"}),n.map(f=>m.jsx(mR,{card:f,onClick:()=>a(f),done:e==="Done",draggable:!!s},f.seq))]})]})}function mp(e,t){if(!e)return"";const n=e.split(`
476
476
  `),a=new RegExp(`^##\\s+${t}\\s*$`),s=n.findIndex(c=>a.test(c));if(s===-1)return"";let o=n.length;for(let c=s+1;c<n.length;c++)if(/^##\s+/.test(n[c]??"")){o=c;break}return n.slice(s+1,o).join(`
477
477
  `).trim()}function wm(e){return mp(e,"描述")}function yR({project:e,seq:t,onClose:n,onChanged:a}){var ae,W,K,oe,V,me,O,L,J;const s=Tn(),{confirm:o,alert:c}=qn(),{data:f,isLoading:d,isError:h,error:y,refetch:g}=dt({queryKey:["card",e,t],queryFn:()=>WO(e,t)}),[x,v]=M.useState(!1),[S,w]=M.useState(""),[_,N]=M.useState(""),[j,C]=M.useState(new Set),[D,F]=M.useState([]),[R,q]=M.useState(""),U=dt({queryKey:["skills-all",e],queryFn:()=>fg(e),enabled:x});M.useEffect(()=>{x&&f&&(w(f.title),N(wm(f.body)),C(new Set(f.skills)),F([...f.labels]))},[x,f]),M.useEffect(()=>{const k=ce=>{ce.key==="Escape"&&(x?v(!1):n())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n,x]);const Z=Pn({mutationFn:()=>{if(!f)throw new Error("no data");const k={},ce=S.trim();ce&&ce!==f.title&&(k.title=ce);const Ee=wm(f.body);_!==Ee&&(k.description=_);const xe=[...j].sort(),ze=[...f.skills].sort();return JSON.stringify(xe)!==JSON.stringify(ze)&&(k.skills=xe),JSON.stringify(D)!==JSON.stringify(f.labels)&&(k.labels=D),Object.keys(k).length===0?Promise.resolve({ok:!0,noop:!0}):aR(e,t,k)},onSuccess:()=>{s.invalidateQueries({queryKey:["card",e,t]}),s.invalidateQueries({queryKey:["cards",e]}),v(!1),a()},onError:k=>{c({title:"保存失败",body:k instanceof Error?k.message:String(k)})}}),A=M.useMemo(()=>{if(!x||!f)return!1;if(S.trim()!==f.title||_!==wm(f.body))return!0;const k=[...j].sort(),ce=[...f.skills].sort();return JSON.stringify(k)!==JSON.stringify(ce)||JSON.stringify(D)!==JSON.stringify(f.labels)},[x,f,S,_,j,D]),P=k=>{const ce=new Set(j);ce.has(k)?ce.delete(k):ce.add(k),C(ce)},G=()=>{const k=R.trim();if(k){if(D.includes(k)){q("");return}F([...D,k]),q("")}},le=k=>{F(D.filter(ce=>ce!==k))};return m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&m.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),x&&m.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:"⚠ 编辑中"})]}),x?m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:S,onChange:k=>w(k.target.value),maxLength:200,"aria-label":"卡片标题"}):m.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??"加载中…"})]}),m.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!x&&f&&m.jsxs("button",{onClick:()=>v(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":"编辑卡片",children:[m.jsx(Gp,{size:12,strokeWidth:2.5})," 编辑"]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(Er,{size:14,strokeWidth:3})})]})]}),d&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),h&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",y instanceof Error?y.message:String(y)]}),f&&m.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!x&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(ZC,{size:14}),m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),U.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),U.data&&U.data.data.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:U.data.data.map(k=>{const ce=j.has(k.name);return m.jsx("button",{type:"button",onClick:()=>P(k.name),"aria-pressed":ce,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ce?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:k.name},k.name)})})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[D.map(k=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[k,m.jsx("button",{type:"button",onClick:()=>le(k),className:"hover:text-[var(--color-crashed)]","aria-label":`删除 ${k}`,children:m.jsx(Er,{size:10,strokeWidth:3})})]},k)),m.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:"+ 添加 label",value:R,onChange:k=>q(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.nativeEvent.isComposing&&(k.preventDefault(),G())}}),R&&m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:G,"aria-label":"添加 label",children:m.jsx(Zi,{size:10,strokeWidth:3})})]}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖"})]})]}):m.jsxs(m.Fragment,{children:[f.skills.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(k=>m.jsx(rS,{name:k},k))})]}),f.labels.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(k=>m.jsx(sS,{label:k,kind:k==="NEEDS-FIX"?"warn":"default"},k))})]})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:_,onChange:k=>N(k.target.value),"aria-label":"卡片描述"}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:'只替换 "## 描述" 段的内容;检查清单和日志段不动。'})]}),(((me=f.checklist)==null?void 0:me.total)??0)>0&&m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsx("div",{className:"flex items-center justify-between mb-2",children:m.jsxs("span",{className:"font-bold text-sm",children:["检查清单 ",((O=f.checklist)==null?void 0:O.done)??0,"/",((L=f.checklist)==null?void 0:L.total)??0]})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((J=f.checklist)==null?void 0:J.items)??[]).map((k,ce)=>m.jsxs("li",{className:`flex items-start gap-2 ${k.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:k.done?"✓":"○"}),m.jsx("span",{children:k.text})]},ce))})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:mp(f.body,"描述")||"(空)"})]}),(((ae=f.checklist)==null?void 0:ae.total)??0)>0&&m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["检查清单 ",m.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((W=f.checklist)==null?void 0:W.done)??0,"/",((K=f.checklist)==null?void 0:K.total)??0]})]}),m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsx("div",{className:"flex items-center justify-end mb-2",children:m.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((oe=f.checklist)==null?void 0:oe.percent)??0}%`}})})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((V=f.checklist)==null?void 0:V.items)??[]).map((k,ce)=>m.jsxs("li",{className:`flex items-start gap-2 ${k.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:k.done?"✓":"○"}),m.jsx("span",{children:k.text})]},ce))})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"日志"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:mp(f.body,"日志")||"(空)"})]})]}),m.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:x?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{v(!1),g()},disabled:Z.isPending,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>Z.mutate(),disabled:!A||!S.trim()||Z.isPending,"aria-label":"保存卡片修改",children:[Z.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(zf,{size:14,strokeWidth:3}),"保存"]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:async()=>{try{await tR(e,t),a()}catch(k){c({title:"启动 worker 失败",body:k instanceof Error?k.message:String(k)})}},children:[m.jsx(Qp,{size:14,strokeWidth:3}),"启动 worker"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:`重置卡片 #${t}`,body:"卡片状态会回到初始,已做的 checklist 会清空。",confirm:"重置",danger:!0}))try{await JO(e,t),a(),n()}catch(ce){c({title:"重置失败",body:ce instanceof Error?ce.message:String(ce)})}},children:[m.jsx(If,{size:14,strokeWidth:2.5}),"重置卡片"]}),m.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:`删除卡片 #${t}`,body:`即将删除 "${f.title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?`,confirm:"继续",danger:!0})||!await o({title:"最终确认",body:`请再次确认删除卡片 #${t}。`,confirm:"确定删除",danger:!0})))try{await eR(e,t),a(),n()}catch(Ee){c({title:"删除失败",body:Ee instanceof Error?Ee.message:String(Ee)})}},"aria-label":"删除卡片",children:[m.jsx(zl,{size:14,strokeWidth:2.5}),"删除卡片"]})]})})]})]})})}function lS({current:e,onChange:t}){const[n,a]=M.useState(!1),s=M.useRef(null),{data:o}=dt({queryKey:["projects"],queryFn:Bl});return M.useEffect(()=>{const c=f=>{var d;(d=s.current)!=null&&d.contains(f.target)||a(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),m.jsxs("div",{className:"relative",ref:s,children:[m.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>a(c=>!c),children:[e,m.jsx(Lf,{size:14,strokeWidth:2.5})]}),n&&o&&m.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)] overflow-hidden",children:o.data.map(c=>m.jsxs("button",{type:"button",onClick:()=>{t(c.name),a(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold",c.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:c.name}),m.jsxs("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:[c.cards.total," cards"]})]},c.name))})]})}const xR=[{state:"Planning",label:"Planning",bg:"var(--color-accent-purple)"},{state:"Backlog",label:"Backlog",bg:"var(--color-bg-cream)"},{state:"Todo",label:"Todo",bg:"var(--color-accent-yellow)"},{state:"Inprogress",label:"Inprogress",bg:"var(--color-secondary)"},{state:"QA",label:"QA / Review",bg:"var(--color-accent-pink)"},{state:"Done",label:"Done",bg:"var(--color-accent-mint)"}],oS="sps-console:last-board-project";function vR(){if(typeof window>"u")return null;try{return localStorage.getItem(oS)}catch{return null}}function ER(e){if(!(typeof window>"u"))try{localStorage.setItem(oS,e)}catch{}}function SR(){var W,K,oe;const[e,t]=jf(),n=e.get("project"),[a,s]=M.useState(null),[o,c]=M.useState(""),[f,d]=M.useState(()=>new Set),[h,y]=M.useState(()=>new Set),{confirm:g,alert:x}=qn();aS(n);const v=dt({queryKey:["projects"],queryFn:Bl}),S=dt({queryKey:["cards",n],queryFn:()=>ZO(n??""),enabled:!!n}),w=Tn(),_=()=>{w.invalidateQueries({queryKey:["cards",n]}),w.invalidateQueries({queryKey:["projects"]}),w.invalidateQueries({queryKey:["pipeline-status",n]})},N=V=>{t({project:V})};M.useEffect(()=>{var me;if(n){ER(n);return}const V=vR();V&&((me=v.data)!=null&&me.data.some(O=>O.name===V))&&t({project:V},{replace:!0})},[n,v.data,t]);const j=Pn({mutationFn:()=>rR(n),onSuccess:()=>{_()},onError:V=>{x({title:"启动 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),C=Pn({mutationFn:()=>sR(n),onSuccess:()=>_(),onError:V=>{x({title:"停止 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),D=Pn({mutationFn:()=>lR(n,{all:!0}),onSuccess:()=>_(),onError:V=>{x({title:"重置失败",body:V instanceof Error?V.message:String(V)})}}),[F,R]=M.useState(!1),q=Pn({mutationFn:V=>nR(n,V),onSuccess:()=>{_(),R(!1)},onError:V=>{x({title:"新建卡片失败",body:V instanceof Error?V.message:String(V)})}}),U=Pn({mutationFn:({seq:V,state:me})=>iR(n,V,me),onMutate:async({seq:V,state:me})=>{await w.cancelQueries({queryKey:["cards",n]});const O=w.getQueryData(["cards",n]);return O&&w.setQueryData(["cards",n],{...O,data:O.data.map(L=>L.seq===V?{...L,state:me}:L)}),{prev:O}},onError:(V,me,O)=>{O!=null&&O.prev&&w.setQueryData(["cards",n],O.prev),x({title:"移动卡片失败",body:V instanceof Error?V.message:String(V)})},onSettled:()=>{w.invalidateQueries({queryKey:["cards",n]})}}),Z=((W=S.data)==null?void 0:W.data)??[],{allSkills:A,allLabels:P}=M.useMemo(()=>{const V=new Set,me=new Set;for(const O of Z){for(const L of O.skills)V.add(L);for(const L of O.labels)me.add(L)}return{allSkills:[...V].sort(),allLabels:[...me].sort()}},[Z]);if(!n)return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"看板"}),m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"选择一个项目 🎯"}),m.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:"看板按项目分。挑一个开始:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:(K=v.data)==null?void 0:K.data.map(V=>m.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>N(V.name),type:"button",children:V.name},V.name))})]})]});const G=Z.filter(V=>{if(o){const me=o.toLowerCase();if(!(V.title.toLowerCase().includes(me)||V.skills.some(L=>L.toLowerCase().includes(me))||V.labels.some(L=>L.toLowerCase().includes(me))))return!1}return!(f.size>0&&!V.skills.some(O=>f.has(O))||h.size>0&&!V.labels.some(O=>h.has(O)))}),le=(oe=v.data)==null?void 0:oe.data.find(V=>V.name===n),ae=(le==null?void 0:le.pipelineStatus)==="running";return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"看板 ✨"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:le?`${le.name} · ${le.cards.total} cards · ${le.workers.active} workers 活跃`:"加载中…"})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsx(lS,{current:n,onChange:N}),m.jsxs("button",{className:ae?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>ae?C.mutate():j.mutate(),disabled:j.isPending||C.isPending,type:"button","aria-label":ae?"停止 pipeline":"启动 pipeline",title:ae?"停止 pipeline":"启动 pipeline",children:[j.isPending||C.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):ae?m.jsx(i1,{size:14,strokeWidth:3}):m.jsx(Qp,{size:14,strokeWidth:3}),ae?"停止":"启动"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await g({title:"重置整个流水线",body:"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。",confirm:"重置全部",danger:!0})&&D.mutate()},disabled:D.isPending,children:[D.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(If,{size:14,strokeWidth:2.5}),"重置"]}),m.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>R(!0),disabled:q.isPending,children:[q.isPending?m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Zi,{size:14,strokeWidth:3}),"新卡片"]})]})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索标题 / skill / label…",value:o,onChange:V=>c(V.target.value),"aria-label":"搜索卡片"})]}),m.jsx(a0,{label:"skill",options:A,selected:f,onChange:d}),m.jsx(a0,{label:"label",options:P,selected:h,onChange:y}),(o||f.size>0||h.size>0)&&m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{c(""),d(new Set),y(new Set)},type:"button","aria-label":"清空筛选",children:[m.jsx(Er,{size:11,strokeWidth:3}),"清空"]}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[m.jsx(VC,{size:12}),G.length," / ",Z.length]})]}),S.isError&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("p",{className:"font-semibold",children:"加载卡片失败"}),m.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:S.error instanceof Error?S.error.message:String(S.error)})]}),!S.isError&&m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3",children:xR.map(V=>m.jsx(bR,{label:V.label,bg:V.bg,cards:G.filter(wR(V.state)),onCardClick:me=>s(me.seq),onDropCard:me=>U.mutate({seq:me,state:V.state})},V.state))}),a!==null&&m.jsx(yR,{project:n,seq:a,onClose:()=>s(null),onChanged:_}),F&&m.jsx(XO,{project:n,isPending:q.isPending,onCancel:()=>R(!1),onCreate:V=>q.mutate(V)})]})}function wR(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function a0({label:e,options:t,selected:n,onChange:a}){const[s,o]=M.useState(!1),c=M.useRef(null);M.useEffect(()=>{if(!s)return;const y=x=>{var v;(v=c.current)!=null&&v.contains(x.target)||o(!1)},g=x=>{x.key==="Escape"&&o(!1)};return window.addEventListener("click",y),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",y),window.removeEventListener("keydown",g)}},[s]);const f=y=>{const g=new Set(n);g.has(y)?g.delete(y):g.add(y),a(g)},d=t.length===0,h=n.size;return m.jsxs("div",{ref:c,className:"relative",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!d&&o(y=>!y),disabled:d,"aria-haspopup":"listbox","aria-expanded":s,"aria-label":`按 ${e} 筛选`,children:[e,h>0&&m.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:h}),m.jsx(Lf,{size:11,strokeWidth:3,className:["transition-transform",s?"rotate-180":""].join(" ")})]}),s&&m.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(y=>{const g=n.has(y);return m.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",g?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("input",{type:"checkbox",checked:g,onChange:()=>f(y),className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:y})]},y)}),h>0&&m.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>a(new Set),children:"清空选择"})]})]})}function _R(){return Bt("/api/workers/all")}function NR(e){return Bt(`/api/projects/${encodeURIComponent(e)}/workers`)}function kR(e,t){return Bt(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function cS(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function Rl(e,t){return cS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function dg(e,t,n){return cS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function TR(){const[e,t]=jf(),n=e.get("project");aS(n);const a=Tn(),[s,o]=M.useState(null),{data:c,isLoading:f,isError:d,error:h,refetch:y}=dt({queryKey:["workers",n],queryFn:()=>NR(n??""),enabled:!!n,refetchInterval:5e3});if(!n)return m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-accent-yellow)]",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["在 URL 上加 ",m.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"?project=xx"}),",或从",m.jsx(ji,{to:"/projects",className:"underline font-semibold",children:" 项目列表"})," 打开看板后跳转。"]})]});const g=(c==null?void 0:c.data)??[],x=g.filter(w=>w.state==="running").length,v=g.filter(w=>w.state==="stuck").length,S=g.filter(w=>w.state==="crashed").length;return m.jsxs("div",{className:"flex flex-col gap-4 max-w-6xl",children:[m.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[g.length," 个 slot · ",x," running · ",v," stuck · ",S," crashed"]})]}),m.jsxs("div",{className:"flex gap-3 items-center",children:[m.jsx(lS,{current:n,onChange:w=>t({project:w})}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",onClick:()=>y(),type:"button",children:[m.jsx(If,{size:14,strokeWidth:2.5})," 刷新"]})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{className:"font-semibold",children:["加载失败: ",h instanceof Error?h.message:String(h)]})}),!f&&g.length===0&&m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"当前没有 worker slot。启动一次 pipeline 就会出现。"})}),g.length>0&&m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx(Vr,{w:"70px",children:"Slot"}),m.jsx(Vr,{children:"Card"}),m.jsx(Vr,{w:"110px",children:"Status"}),m.jsx(Vr,{w:"90px",children:"Stage"}),m.jsx(Vr,{w:"90px",children:"PID"}),m.jsx(Vr,{w:"120px",children:"Runtime"}),m.jsx(Vr,{w:"260px",right:!0,children:"Action"})]})}),m.jsx("tbody",{children:g.map(w=>m.jsx(CR,{project:n,worker:w,onChange:()=>a.invalidateQueries({queryKey:["workers",n]}),onDetail:()=>o(w.slot)},w.slot))})]})}),s!==null&&m.jsx(AR,{project:n,slot:s,onClose:()=>o(null),onChange:()=>a.invalidateQueries({queryKey:["workers",n]})})]})}function Vr({children:e,w:t,right:n}){return m.jsx("th",{className:["px-4 py-3 text-left font-[family-name:var(--font-heading)] font-bold text-[12px] uppercase tracking-wider text-[var(--color-text-muted)]",n?"text-right":""].join(" "),style:t?{width:t}:void 0,children:e})}function CR({project:e,worker:t,onChange:n,onDetail:a}){const{confirm:s,alert:o}=qn(),c=t.state==="idle",f=t.state==="crashed"||t.state==="stuck";return m.jsxs("tr",{className:"border-b border-dashed border-[var(--color-border-light)] last:border-0 hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] font-bold",children:t.slot}),m.jsx("td",{className:"px-4 py-3",children:t.card?m.jsxs("span",{className:"font-semibold",children:[m.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full font-[family-name:var(--font-mono)] mr-2",children:["#",t.card.seq]}),t.card.title]}):m.jsx("em",{className:"text-[var(--color-text-subtle)]",children:"— 空闲 —"})}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(uS,{state:t.state})}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.stage||"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.pid??"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:fS(t.runtimeMs)}),m.jsxs("td",{className:"px-4 py-3 text-right space-x-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:a,type:"button","aria-label":`查看 worker-${t.slot} 详情`,children:[m.jsx(iA,{size:12,strokeWidth:2.5})," 详情"]}),f&&t.card&&m.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await s({title:`重启 worker-${t.slot}`,body:`先杀掉当前进程,然后重新 launch 到卡 #${t.card.seq}。`,confirm:"重启"})){try{await Rl(e,t.slot)}catch{}try{await dg(e,t.slot,t.card.seq),n()}catch(h){o({title:"重启失败",body:h instanceof Error?h.message:String(h)})}}},type:"button",children:[m.jsx(hs,{size:12,strokeWidth:2.5})," 重启"]}),!c&&m.jsxs(m.Fragment,{children:[m.jsxs(ji,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t.slot}`,className:"nb-btn",style:{display:"inline-flex",padding:"4px 10px",fontSize:11},children:[m.jsx(Yp,{size:12,strokeWidth:2.5})," log"]}),m.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await s({title:`终止 worker-${t.slot}`,body:"当前任务会被强制中断,未保存的工作可能丢失。",confirm:"终止",danger:!0})&&(await Rl(e,t.slot),n())},type:"button",children:[m.jsx(Vp,{size:12,strokeWidth:2.5})," 终止"]})]})]})]})}function AR({project:e,slot:t,onClose:n,onChange:a}){const{confirm:s,alert:o}=qn(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=dt({queryKey:["worker-detail",e,t],queryFn:()=>kR(e,t),refetchInterval:3e3});return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-3xl",children:[m.jsxs("header",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:["worker-",t]}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-0.5",children:e})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>y(),type:"button","aria-label":"刷新",children:[m.jsx(If,{size:12,strokeWidth:2.5})," 刷新"]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:"✕"})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:m.jsxs("dl",{className:"grid grid-cols-[130px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"状态"}),m.jsx("dd",{children:m.jsx(uS,{state:c.state})}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Card"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.card?`#${c.card.seq} · ${c.card.title}`:"—"}),m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:fS(c.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs text-[var(--color-text-muted)] break-all",children:c.markerPath}),m.jsx("dt",{className:"font-bold",children:"Marker 更新"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:c.markerUpdatedAt?`${new Date(c.markerUpdatedAt).toLocaleString()} (${OR(c.markerUpdatedAt)})`:"—"})]})}),m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["最近 ",c.recentLogs.length," 行日志"]}),c.recentLogs.length===0?m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:["没找到带 worker-",t," 标签的日志。去 Logs 页看全量。"]}):m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap break-words",children:c.recentLogs.map(g=>`${g.ts??""} [${g.level}] ${g.msg}`).join(`
478
478
  `)}),m.jsx(ji,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t}`,className:"inline-block mt-2 text-xs underline text-[var(--color-running)]",children:"查看完整 log →"})]}),m.jsxs("div",{className:"flex gap-2 justify-end border-t-2 border-dashed border-[var(--color-text)] pt-3",children:[(c.state==="crashed"||c.state==="stuck")&&c.card&&m.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{if(await s({title:`重启 worker-${t}`,body:`先杀掉当前进程,重新 launch 到卡 #${c.card.seq}。`,confirm:"重启"})){try{await Rl(e,t)}catch{}try{await dg(e,t,c.card.seq),a(),y()}catch(x){o({title:"重启失败",body:x instanceof Error?x.message:String(x)})}}},type:"button",children:[m.jsx(hs,{size:14,strokeWidth:2.5})," 重启"]}),c.state!=="idle"&&m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:async()=>{if(await s({title:`终止 worker-${t}`,body:"当前任务会被强制中断。",confirm:"终止",danger:!0}))try{await Rl(e,t),a(),y()}catch(x){o({title:"终止失败",body:x instanceof Error?x.message:String(x)})}},type:"button",children:[m.jsx(Vp,{size:14,strokeWidth:3})," 终止"]}),c.state==="running"&&m.jsx(en,{size:14,strokeWidth:3,className:"animate-spin self-center text-[var(--color-running)]"})]})]})]})})}function OR(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function uS({state:e}){const t={running:{bg:"var(--color-running-bg)",color:"var(--color-running)"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)"},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)"},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)"}},{bg:n,color:a}=t[e];return m.jsx("span",{className:"nb-status",style:{background:n,color:a},children:e})}function fS(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60,o=c=>c.toString().padStart(2,"0");return n>0?`${o(n)}:${o(a)}:${o(s)}`:`${o(a)}:${o(s)}`}function RR(){var f;const e=Tn(),[t,n]=M.useState(null),a=dt({queryKey:["workers-agg"],queryFn:_R,refetchInterval:5e3});M.useEffect(()=>{if(!a.data)return;const d=a.data.capacity.map(y=>y.project),h=[];for(const y of d){const g=new EventSource(`/stream/projects/${encodeURIComponent(y)}`),x=()=>{e.invalidateQueries({queryKey:["workers-agg"]})};g.addEventListener("worker.updated",x),g.addEventListener("worker.added",x),g.addEventListener("worker.deleted",x),g.addEventListener("card.updated",x),h.push(g)}return()=>{for(const y of h)y.close()}},[(f=a.data)==null?void 0:f.capacity.map(d=>d.project).join(","),e]);const s=M.useMemo(()=>{var h,y;return[...((h=a.data)==null?void 0:h.alerts)??[],...((y=a.data)==null?void 0:y.active)??[]]},[a.data]),o=t&&s.find(d=>d.project===t.project&&d.slot===t.slot),c=M.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const d={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const h of a.data.capacity)d.running+=h.running,d.starting+=h.starting,d.stuck+=h.stuck,d.crashed+=h.crashed,d.idle+=h.idle;return d},[a.data]);return m.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:["跨 ",c.projects," 项目 · ",c.running," 跑 · ",c.starting," 启动 ·"," ",m.jsxs("span",{className:"text-[var(--color-stuck)]",children:[c.stuck," 卡"]})," ·"," ",m.jsxs("span",{className:"text-[var(--color-crashed)]",children:[c.crashed," 崩"]})," · ",c.idle," 闲"]})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":"刷新",children:[a.isFetching?m.jsx(en,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(hs,{size:12,strokeWidth:2.5}),"刷新"]})]}),m.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[m.jsxs("div",{className:"flex flex-col gap-4 overflow-auto pr-2",children:[a.isLoading&&m.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"加载中…"}),a.isError&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",a.error instanceof Error?a.error.message:String(a.error)]})}),a.data&&m.jsxs(m.Fragment,{children:[m.jsx(MR,{alerts:a.data.alerts,selected:t,onSelect:(d,h)=>n({project:d,slot:h})}),m.jsx(jR,{active:a.data.active,selected:t,onSelect:(d,h)=>n({project:d,slot:h})}),m.jsx(DR,{capacity:a.data.capacity})]})]}),m.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:o?m.jsx(zR,{worker:o,onChange:()=>e.invalidateQueries({queryKey:["workers-agg"]})}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:m.jsxs("div",{children:[m.jsx(Df,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"点击左侧的 worker 查看详情"})]})})})]})]})}function MR({alerts:e,selected:t,onSelect:n}){return e.length===0?m.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[m.jsx(Hp,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),m.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:"全部 worker 健康"})]}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[m.jsx(zA,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),m.jsx("div",{className:"flex flex-col gap-2",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(hg,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[a.project,"/worker-",a.slot]}),a.card&&m.jsxs("span",{className:"truncate",children:["#",a.card.seq," ",a.card.title]}),m.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[m.jsx(BC,{size:10,strokeWidth:2.5}),mg(a.runtimeMs)]})]}),a.markerUpdatedAt&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:a.state==="crashed"?"PID 已死。":`marker 停 ${pg(a.markerUpdatedAt)}。`})]},`${a.project}-${a.slot}`)})})]})}function jR({active:e,selected:t,onSelect:n}){return e.length===0?m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"没有 worker 在运行。"})}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[m.jsx(Df,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsx(hg,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[a.project,"/worker-",a.slot]}),m.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${BR(a.runtimeMs)}`,children:mg(a.runtimeMs)})]}),a.card&&m.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",a.card.seq," · ",a.card.title]}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[a.stage&&m.jsxs("span",{children:["stage: ",a.stage]}),a.markerUpdatedAt&&m.jsxs("span",{className:"ml-auto",children:["marker ",pg(a.markerUpdatedAt)]})]}),a.lastLogLine&&m.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[m.jsx(Yp,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function DR({capacity:e}){return e.length===0?null:m.jsxs("section",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2",children:"Capacity"}),m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"项目"}),m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"占用"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"其它"}),m.jsx("th",{className:"px-3 py-2"})]})}),m.jsx("tbody",{children:e.map(t=>{const n=t.running+t.starting+t.stuck+t.crashed;return m.jsxs("tr",{className:"border-b border-dashed border-[var(--color-border-light)] last:border-0 hover:bg-[var(--color-accent-yellow)]",children:[m.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:t.project}),m.jsx("td",{className:"px-3 py-2",children:m.jsx(LR,{total:t.total,cap:t})}),m.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[m.jsx("span",{className:"text-[var(--color-running)] font-bold",children:t.running}),m.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",t.total]})]}),m.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[t.starting>0&&m.jsxs("span",{className:"mr-2",children:["starting ",t.starting]}),t.stuck>0&&m.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",t.stuck]}),t.crashed>0&&m.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",t.crashed]}),n===0&&m.jsx("span",{children:"idle"})]}),m.jsx("td",{className:"px-3 py-2 text-right",children:m.jsx(ji,{to:`/workers?project=${encodeURIComponent(t.project)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"详情 →"})})]},t.project)})})]})})]})}function LR({total:e,cap:t}){const n=[];for(let a=0;a<t.crashed;a++)n.push("crashed");for(let a=0;a<t.stuck;a++)n.push("stuck");for(let a=0;a<t.starting;a++)n.push("starting");for(let a=0;a<t.running;a++)n.push("running");for(let a=0;a<t.idle;a++)n.push("idle");return m.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((a,s)=>m.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:IR(a)},title:a},s)),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function IR(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function zR({worker:e,onChange:t}){const{confirm:n,alert:a}=qn(),s=e.state==="crashed"||e.state==="stuck";return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex items-center gap-2",children:[m.jsx(hg,{state:e.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:[e.project,"/worker-",e.slot]})]}),m.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[e.card?m.jsxs("div",{children:[m.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:"当前卡片"}),m.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",e.card.seq," · ",e.card.title]})]}):m.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:"slot 空闲,没有当前卡片。"}),m.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:mg(e.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Started"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:e.startedAt?new Date(e.startedAt).toLocaleString():"—"}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:e.markerUpdatedAt?pg(e.markerUpdatedAt):"—"})]}),e.lastLogLine&&m.jsxs("div",{children:[m.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[m.jsx(Yp,{size:10,strokeWidth:2.5}),"最近日志"]}),m.jsxs("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 whitespace-pre-wrap break-words",children:[e.lastLogLine.ts&&m.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[e.lastLogLine.ts,`
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
10
- <script type="module" crossorigin src="/assets/index-C95GbuxW.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-CGiD8z0L.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-BoeKHzoZ.css">
12
12
  </head>
13
13
  <body>
@@ -35,6 +35,7 @@ export interface ResetPipelineOpts {
35
35
  export interface PipelineExecutor {
36
36
  stop(project: string): Promise<void>;
37
37
  reset(project: string, opts: ResetPipelineOpts): Promise<void>;
38
+ recoverOrphans(project: string): Promise<number>;
38
39
  }
39
40
  export interface PipelineServiceDeps {
40
41
  readonly fs: FileSystem;
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineService.d.ts","sourceRoot":"","sources":["../../src/services/PipelineService.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC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
  this.deps.fs.mkdir(logsDir(project), { recursive: true });
38
38
  }
39
+ // v0.50.8:启动前先回收遗孤卡片 —— 上一轮被 stop/crash 的卡,slot 还 active 但
40
+ // tick 进程没了,MonitorEngine 会把它打 STALE-RUNTIME,下一轮又被 SKIP,最后
41
+ // 链式升级到 ACK-TIMEOUT / NEEDS-FIX,卡在 Inprogress 永远跑不起来。
42
+ // 这里一次性清 label + 移回 Todo,让下一个 tick 能重新 prepare 派发。
43
+ // executor 缺失时跳过(单元测试场景),线上容器总会注入。
44
+ if (this.deps.executor) {
45
+ try {
46
+ await this.deps.executor.recoverOrphans(project);
47
+ }
48
+ catch {
49
+ /* 回收失败不阻塞 start —— 坏情况也就退化到老行为 */
50
+ }
51
+ }
39
52
  const date = this.deps.clock.nowIso().slice(0, 10);
40
53
  const logPath = resolve(logsDir(project), `console-tick-${date}.log`);
41
54
  try {
@@ -44,6 +57,18 @@ export class PipelineService {
44
57
  logPath,
45
58
  });
46
59
  const pid = child.pid ?? null;
60
+ // v0.50.7:写 supervisor.pid 文件 —— ProjectService.isPipelineRunning 靠它判活。
61
+ // 历史上 sps tick 进程不自己写这个文件(v0.44 Console 引入时的设计缺陷,
62
+ // 从来没有生效过 pipeline running 检测)。Service 层一口气把 spawn + pid
63
+ // 登记都做了,对外原子。
64
+ if (pid !== null && pid > 0) {
65
+ try {
66
+ this.deps.fs.writeFileAtomic(supervisorPidFile(project), `${pid}\n`);
67
+ }
68
+ catch {
69
+ /* pid 文件写失败不阻塞启动,下一次 poll 会补偿 */
70
+ }
71
+ }
47
72
  this.deps.events.emit({
48
73
  type: 'pipeline.started',
49
74
  project,
@@ -74,6 +99,16 @@ export class PipelineService {
74
99
  details: { message: cause instanceof Error ? cause.message : String(cause) },
75
100
  }));
76
101
  }
102
+ // 清 supervisor.pid —— pipeline 已经停了,配对的文件也该清
103
+ try {
104
+ const pidPath = supervisorPidFile(project);
105
+ if (this.deps.fs.exists(pidPath)) {
106
+ this.deps.fs.unlink(pidPath);
107
+ }
108
+ }
109
+ catch {
110
+ /* best effort */
111
+ }
77
112
  this.deps.events.emit({
78
113
  type: 'pipeline.stopped',
79
114
  project,
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineService.js","sourceRoot":"","sources":["../../src/services/PipelineService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,EAAoB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AA8CnC,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,IAAyB;QAAzB,SAAI,GAAJ,IAAI,CAAqB;IAAG,CAAC;IAE1D,mCAAmC;IACnC,KAAK,CAAC,KAAK,CAAC,OAAe;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YAAE,OAAO,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,CAAC,IAAI,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AAS,eAAe,CAAC,IAAY;IACnC,OAAO,WAAW,CAAC,WAAW,EAAE,mBAAmB,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC;AACzE,CAAC"}
@@ -27,6 +27,17 @@ export declare class DefaultPipelineExecutor implements PipelineExecutor {
27
27
  constructor(spawner: ProcessSpawner);
28
28
  stop(project: string): Promise<void>;
29
29
  reset(project: string, opts: ResetPipelineOpts): Promise<void>;
30
+ /**
31
+ * v0.50.8:启动前回收遗孤卡片。
32
+ *
33
+ * 场景:上一轮 pipeline 被 stop(或 crash),state.json 里 slot 还显示 active,
34
+ * 卡片停在 Inprogress 带 STARTED-<stage>。下一轮 start 后 MonitorEngine 会打
35
+ * STALE-RUNTIME(SKIP_LABEL),卡片永远跑不起来。
36
+ *
37
+ * 这里一次性清理:移回首阶段 trigger state(通常 Todo)+ 清全部瞬态 labels +
38
+ * reset slot 为 idle + 清 leases。下一轮 tick 就能重新 prepare + 派发。
39
+ */
40
+ recoverOrphans(project: string): Promise<number>;
30
41
  }
31
42
  export declare class DefaultChatExecutor implements ChatExecutor {
32
43
  stopSession(sessionId: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"executors.d.ts","sourceRoot":"","sources":["../../src/services/executors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,qBAAa,qBAAsB,YAAW,cAAc;IACpD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CA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