@cluesmith/codev 2.0.12 → 2.0.13
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.
- package/dashboard/dist/assets/{index-UI3ATXbB.js → index-8O8nCk_X.js} +2 -2
- package/dashboard/dist/assets/{index-UI3ATXbB.js.map → index-8O8nCk_X.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +22 -2
- package/dist/commands/consult/index.js.map +1 -1
- package/package.json +1 -1
- package/skeleton/protocols/aspir/builder-prompt.md +75 -0
- package/skeleton/protocols/aspir/consult-types/impl-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/phase-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/plan-review.md +59 -0
- package/skeleton/protocols/aspir/consult-types/pr-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/spec-review.md +55 -0
- package/skeleton/protocols/aspir/prompts/implement.md +215 -0
- package/skeleton/protocols/aspir/prompts/plan.md +150 -0
- package/skeleton/protocols/aspir/prompts/review.md +259 -0
- package/skeleton/protocols/aspir/prompts/specify.md +139 -0
- package/skeleton/protocols/aspir/protocol.json +161 -0
- package/skeleton/protocols/aspir/protocol.md +94 -0
- package/skeleton/protocols/aspir/templates/plan.md +204 -0
- package/skeleton/protocols/aspir/templates/review.md +120 -0
- package/skeleton/protocols/aspir/templates/spec.md +182 -0
- package/skeleton/templates/AGENTS.md +1 -0
- package/skeleton/templates/CLAUDE.md +1 -0
|
@@ -126,10 +126,10 @@ void main() {
|
|
|
126
126
|
\x1B[90m[Uploading image...]\x1B[0m`);const{path:n}=await sf(j);return I.write("\r\x1B[2K"),I.paste(n),!0}}}catch{if(G)return I.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
|
|
127
127
|
`),!0}return!1}async function yg(I){var G;if(!await Cg(I))try{const W=await((G=navigator.clipboard)==null?void 0:G.readText());W&&I.paste(W)}catch{}}function bg(I,G){var O;const W=(O=I.clipboardData)==null?void 0:O.items;if(W){for(const J of Array.from(W))if(hf.includes(J.type)){const ae=J.getAsFile();if(!ae)continue;I.preventDefault(),G.write(`\r
|
|
128
128
|
\x1B[90m[Uploading image...]\x1B[0m`),sf(ae).then(({path:j})=>{G.write("\r\x1B[2K"),G.paste(j)}).catch(()=>{G.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
|
|
129
|
-
`)});return}}}function Jd({wsPath:I,onFileOpen:G,persistent:W}){const O=ye.useRef(null),J=ye.useRef(null),ae=ye.useRef(null),j=ye.useRef(null),n=ye.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=rf(`(max-width: ${ef}px)`);return ye.useEffect(()=>{if(!O.current)return;const d=new eg.Terminal({cursorBlink:!0,fontSize:13,lineHeight:1,fontFamily:'Menlo, Monaco, "Courier New", monospace',customGlyphs:!0,scrollback:5e4,theme:{background:"#1a1a1a",foreground:"#e0e0e0",cursor:"#ffffff"},allowProposedApi:!0});J.current=d;const _=new ig.FitAddon;j.current=_,d.loadAddon(_),d.open(O.current);const a=()=>{try{d.loadAddon(new ag.CanvasAddon)}catch{}};try{const M=new rg.WebglAddon;M.onContextLoss(()=>{M.dispose(),a()}),d.loadAddon(M)}catch{a()}const g=new dg((M,B)=>{M.preventDefault(),window.open(B,"_blank")});d.loadAddon(g);const b=I.split("/").pop();let y=null,c=null;if(G){c=new vg(d);const M=new _g(d,(B,T,H,Y)=>{G(B,T,H,Y)},b,c);y=d.registerLinkProvider(M)}const r=navigator.platform.toUpperCase().includes("MAC");d.attachCustomKeyEventHandler(M=>{if(M.type!=="keydown")return!0;if(M.key==="Enter"&&M.shiftKey)return M.preventDefault(),d.paste(`\\
|
|
129
|
+
`)});return}}}function Jd({wsPath:I,onFileOpen:G,persistent:W}){const O=ye.useRef(null),J=ye.useRef(null),ae=ye.useRef(null),j=ye.useRef(null),n=ye.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=rf(`(max-width: ${ef}px)`);return ye.useEffect(()=>{if(!O.current)return;const d=new eg.Terminal({cursorBlink:!0,fontSize:13,lineHeight:1,fontFamily:'Menlo, Monaco, "Courier New", monospace',customGlyphs:!0,scrollback:5e4,theme:{background:"#1a1a1a",foreground:"#e0e0e0",cursor:"#ffffff"},allowProposedApi:!0,linkHandler:{activate:(M,B)=>{window.open(B,"_blank","noopener")}}});J.current=d;const _=new ig.FitAddon;j.current=_,d.loadAddon(_),d.open(O.current);const a=()=>{try{d.loadAddon(new ag.CanvasAddon)}catch{}};try{const M=new rg.WebglAddon;M.onContextLoss(()=>{M.dispose(),a()}),d.loadAddon(M)}catch{a()}const g=new dg((M,B)=>{M.preventDefault(),window.open(B,"_blank")});d.loadAddon(g);const b=I.split("/").pop();let y=null,c=null;if(G){c=new vg(d);const M=new _g(d,(B,T,H,Y)=>{G(B,T,H,Y)},b,c);y=d.registerLinkProvider(M)}const r=navigator.platform.toUpperCase().includes("MAC");d.attachCustomKeyEventHandler(M=>{if(M.type!=="keydown")return!0;if(M.key==="Enter"&&M.shiftKey)return M.preventDefault(),d.paste(`\\
|
|
130
130
|
`),!1;if(!(r?M.metaKey:M.ctrlKey&&M.shiftKey))return!0;if(M.key==="c"||M.key==="C"){const T=d.getSelection();return T?(M.preventDefault(),navigator.clipboard.writeText(T).catch(()=>{}),!1):!0}return M.key==="v"||M.key==="V"?(M.preventDefault(),yg(d),!1):!0});const h=M=>bg(M,d);O.current.addEventListener("paste",h);const l=()=>{var Y,K,le;const M=(Y=O.current)==null?void 0:Y.getBoundingClientRect();if(!M||M.width===0||M.height===0)return;const B=(le=(K=d.buffer)==null?void 0:K.active)==null?void 0:le.baseY;if(!B){_.fit();return}const T=d.buffer.active.viewportY,H=T==null||T>=B;_.fit(),H?d.scrollToBottom():d.scrollToLine(T)};let o=null;const S=()=>{o&&clearTimeout(o),o=setTimeout(()=>{o=null,l()},150)};l();const x=setTimeout(S,300),w=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${I}`,m=new WebSocket(w);m.binaryType="arraybuffer",ae.current=m;let C="",L=!0,R=null;const E=M=>(M=M.replace(/\x1b\[[\?>][\d;]*c/g,""),M=M.replace(/\[[\?>][\d;]*c/g,""),M),D=()=>{if(L=!1,R=null,C){const M=E(C);M&&d.write(M,()=>{d.scrollToBottom()}),C=""}S(),setTimeout(()=>{m.readyState===WebSocket.OPEN&&da(m,"resize",{cols:d.cols,rows:d.rows}),d.scrollToBottom()},350)};m.onopen=()=>{da(m,"resize",{cols:d.cols,rows:d.rows})},m.onmessage=M=>{const B=new Uint8Array(M.data);if(B.length===0)return;const T=B[0],H=B.subarray(1);if(T===cf){const Y=new TextDecoder().decode(H);if(L)C+=Y,R||(R=setTimeout(D,500));else{const K=E(Y);K&&d.write(K)}}},m.onclose=()=>{d.write(`\r
|
|
131
131
|
\x1B[90m[Terminal disconnected]\x1B[0m\r
|
|
132
132
|
`)},m.onerror=()=>{d.write(`\r
|
|
133
133
|
\x1B[31m[WebSocket error]\x1B[0m\r
|
|
134
134
|
`)};const k=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);let q="",U=0;d.onData(M=>{var T,H,Y,K,le,ue;if(m.readyState!==WebSocket.OPEN)return;if(k){const $=Date.now();if(M===q&&$-U<150)return;q=M,U=$}if(L){const $=M.replace(/\x1b\[[\?>][\d;]*c/g,"").replace(/\x1b\[\d+;\d+R/g,"").replace(/\x1b\[\?[\d;]*\$y/g,"");if(!$)return;M=$}const B=n.current;if((B.ctrl||B.cmd)&&M.length===1){const $=M.charCodeAt(0);if(B.ctrl)$>=97&&$<=122?M=String.fromCharCode($-96):$>=65&&$<=90&&(M=String.fromCharCode($-64)),B.ctrl=!1,B.cmd=!1,(T=B.clearCallback)==null||T.call(B);else if(B.cmd){const z=M.toLowerCase();if(z==="v"){(H=navigator.clipboard)==null||H.readText().then(ee=>{ee&&d.paste(ee)}).catch(()=>{}),B.ctrl=!1,B.cmd=!1,(Y=B.clearCallback)==null||Y.call(B);return}if(z==="c"){const ee=d.getSelection();ee&&((K=navigator.clipboard)==null||K.writeText(ee).catch(()=>{})),B.ctrl=!1,B.cmd=!1,(le=B.clearCallback)==null||le.call(B);return}B.ctrl=!1,B.cmd=!1,(ue=B.clearCallback)==null||ue.call(B)}}wg(m,M)}),d.onResize(({cols:M,rows:B})=>{m.readyState===WebSocket.OPEN&&da(m,"resize",{cols:M,rows:B})});const P=new ResizeObserver(S);P.observe(O.current);const F=()=>{document.hidden||S()};return document.addEventListener("visibilitychange",F),()=>{var M;clearTimeout(x),o&&clearTimeout(o),R&&clearTimeout(R),c==null||c.dispose(),y==null||y.dispose(),(M=O.current)==null||M.removeEventListener("paste",h),P.disconnect(),document.removeEventListener("visibilitychange",F),m.close(),d.dispose(),J.current=null,ae.current=null,j.current=null}},[I]),Q.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",position:"relative"},children:[W===!1&&Q.jsx("div",{style:{backgroundColor:"#3a2a00",color:"#ffcc00",padding:"4px 12px",fontSize:"12px",flexShrink:0},children:"Session persistence unavailable — this terminal will not survive a restart"}),Q.jsx("div",{ref:O,className:"terminal-container",style:{width:"100%",flex:1,minHeight:0,overflow:"hidden",backgroundColor:"#1a1a1a"}}),Q.jsx(mg,{fitRef:j,wsRef:ae,xtermRef:J}),u&&Q.jsx(pg,{wsRef:ae,modifierRef:n})]})}function wg(I,G){const W=new TextEncoder().encode(G),O=new Uint8Array(1+W.length);O[0]=cf,O.set(W,1),I.send(O.buffer)}function da(I,G,W){const O=JSON.stringify({type:G,payload:W}),J=new TextEncoder().encode(O),ae=new Uint8Array(1+J.length);ae[0]=Sg,ae.set(J,1),I.send(ae.buffer)}const xg=5e3;function Lg(){const[I,G]=ye.useState(null),[W,O]=ye.useState(null),J=ye.useRef(!1),ae=ye.useCallback(async()=>{try{const n=await Fv();G(u=>u!==null&&JSON.stringify(u)===JSON.stringify(n)?u:n),O(null)}catch(n){O(n instanceof Error?n.message:"Failed to fetch overview")}},[]);ye.useEffect(()=>{if(typeof EventSource>"u")return;const n=jv(),u=new EventSource(n);return u.onmessage=d=>{try{JSON.parse(d.data).type==="overview-changed"&&!J.current&&(J.current=!0,ae().finally(()=>{J.current=!1}))}catch{}},u.onerror=()=>{},()=>u.close()},[ae]),ye.useEffect(()=>{ae();const n=setInterval(ae,xg);return()=>clearInterval(n)},[ae]);const j=ye.useCallback(async()=>{await $v(),await ae()},[ae]);return{data:I,error:W,refresh:j}}function Eg(I){if(I.blocked)return`Blocked: ${I.blocked}`;if(I.mode==="soft")return"running";if(!I.phase)return"starting";const G=I.planPhases;if(G.length===0)return I.phase;const W=G.findIndex(O=>O.id===I.phase);return W===-1?I.phase:`${I.phase} (${W+1}/${G.length})`}function zl(I){if(I<0)return"-";const G=Math.floor(I/6e4);if(G<60)return`${G}m`;const W=Math.floor(G/60),O=G%60;return W<24?`${W}h ${O}m`:`${Math.floor(W/24)}d ${W%24}h`}function Mg(I,G){if(!I)return"-";const W=Date.now()-new Date(I).getTime();if(W<0)return"-";const O=Math.max(0,W-G);return G===0?zl(W):`${zl(W)} wc / ${zl(O)} ag`}function Ag({builder:I,onOpen:G}){const W=I.issueNumber?`#${I.issueNumber}`:I.id,O=I.issueTitle||I.id,J=I.blocked!==null&&I.blocked!=="",ae=Math.min(100,Math.max(0,Math.round(I.progress??0)));return Q.jsxs("tr",{className:`builder-row${J?" builder-row--blocked":""}`,children:[Q.jsx("td",{className:"builder-col-id",children:W}),Q.jsx("td",{className:"builder-col-title",children:O}),Q.jsx("td",{className:"builder-col-state",children:Q.jsx("span",{className:J?"builder-state-blocked":"builder-state-active",children:Eg(I)})}),Q.jsxs("td",{className:"builder-col-progress",children:[Q.jsx("div",{className:"progress-bar",children:Q.jsx("div",{className:`progress-fill${J?" progress-fill--blocked":""}`,style:{width:`${ae}%`}})}),Q.jsxs("span",{className:"progress-pct",children:[ae,"%"]})]}),Q.jsx("td",{className:"builder-col-elapsed",children:Mg(I.startedAt,I.idleMs??0)}),Q.jsx("td",{className:"builder-col-actions",children:G&&Q.jsx("button",{className:"builder-row-open",onClick:()=>G(I),children:"Open"})})]})}function Rg(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m`;const O=Math.floor(W/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}function Dg(I,G){const W=[];for(const O of I)W.push({key:`pr-${O.number}`,issueOrPR:`#${O.number}`,title:O.title,kind:"PR review",kindClass:"attention-kind--pr",waitingSince:O.createdAt,url:O.url});for(const O of G){if(!O.blocked||!O.blockedSince||O.blocked==="PR review")continue;const J=O.issueNumber?`#${O.issueNumber}`:O.id;W.push({key:`gate-${O.id}`,issueOrPR:J,title:O.issueTitle||O.id,kind:O.blocked,kindClass:O.blocked==="spec review"?"attention-kind--spec":"attention-kind--plan",waitingSince:O.blockedSince})}return W.sort((O,J)=>new Date(O.waitingSince).getTime()-new Date(J.waitingSince).getTime()),W}function Tg({prs:I,builders:G}){const W=Dg(I,G);return W.length===0?Q.jsx("p",{className:"work-empty",children:"Nothing needs attention"}):Q.jsx("div",{className:"attention-rows",children:W.map(O=>{const J=Q.jsxs(Q.Fragment,{children:[Q.jsx("span",{className:"attention-row-id",children:O.issueOrPR}),Q.jsx("span",{className:"attention-row-title",children:O.title}),Q.jsx("span",{className:`attention-row-kind ${O.kindClass}`,children:O.kind}),Q.jsx("span",{className:"attention-row-age",children:Rg(O.waitingSince)})]});return O.url?Q.jsx("a",{className:"attention-row",href:O.url,target:"_blank",rel:"noopener noreferrer",children:J},O.key):Q.jsx("div",{className:"attention-row",children:J},O.key)})})}function Bg(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m`;const O=Math.floor(W/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}const Og={high:"priority-dot--high",medium:"priority-dot--med",low:"priority-dot--low"},kg={bug:"type-tag--bug",project:"type-tag--project"};function Ul({label:I,filePath:G,onRefresh:W}){return Q.jsx("button",{className:"backlog-artifact-link",onClick:async O=>{O.preventDefault(),O.stopPropagation(),await Pl(G),W==null||W()},children:I})}function Hg({items:I,onRefresh:G}){const W=I.filter(O=>!O.hasBuilder);return W.length===0?Q.jsx("p",{className:"work-empty",children:"No open issues"}):Q.jsx("div",{className:"backlog-rows",children:W.map(O=>Q.jsxs("div",{className:"backlog-row",children:[Q.jsxs("a",{className:"backlog-row-main",href:O.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:`backlog-priority-dot ${Og[O.priority]??"priority-dot--low"}`}),Q.jsxs("span",{className:"backlog-row-number",children:["#",O.number]}),Q.jsx("span",{className:`backlog-type-tag ${kg[O.type]??""}`,children:O.type}),Q.jsx("span",{className:"backlog-row-title",children:O.title}),Q.jsx("span",{className:"backlog-row-age",children:Bg(O.createdAt)})]}),(O.specPath||O.planPath||O.reviewPath)&&Q.jsxs("span",{className:"backlog-artifacts",children:[O.specPath&&Q.jsx(Ul,{label:"spec",filePath:O.specPath,onRefresh:G}),O.planPath&&Q.jsx(Ul,{label:"plan",filePath:O.planPath,onRefresh:G}),O.reviewPath&&Q.jsx(Ul,{label:"review",filePath:O.reviewPath,onRefresh:G})]})]},O.number))})}function Ng(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m ago`;const O=Math.floor(W/60);return O<24?`${O}h ago`:`${Math.floor(O/24)}d ago`}const zg={bug:"type-tag--bug",project:"type-tag--project"};function Ug({items:I}){return I.length===0?null:Q.jsx("div",{className:"recently-closed-rows",children:I.map(G=>Q.jsxs("a",{className:"recently-closed-row",href:G.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:"recently-closed-check",children:"✓"}),Q.jsxs("span",{className:"backlog-row-number",children:["#",G.number]}),Q.jsx("span",{className:`backlog-type-tag ${zg[G.type]??""}`,children:G.type}),Q.jsx("span",{className:"backlog-row-title",children:G.title}),Q.jsx("span",{className:"backlog-row-age",children:Ng(G.closedAt)})]},G.number))})}function Ig(I,G){const W=I.replace(/^\//,"");return G.staged.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"A",className:"git-staged"}:G.modified.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"M",className:"git-modified"}:G.untracked.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"?",className:"git-untracked"}:null}function uf({entry:I,expanded:G,gitStatus:W,onToggle:O,onOpen:J,depth:ae=0}){var d;const j=I.type==="directory",n=G.has(I.path),u=j?null:Ig(I.path,W);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{className:`file-node ${j?"directory":"file"}`,style:{paddingLeft:`${ae*16+8}px`},onClick:()=>j?O(I.path):J(I.path),role:"treeitem","aria-expanded":j?n:void 0,tabIndex:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),j?O(I.path):J(I.path))},children:[Q.jsx("span",{className:"file-icon",children:j?n?"📂":"📁":"📄"}),Q.jsx("span",{className:"file-name",children:I.name}),u&&Q.jsx("span",{className:`git-indicator ${u.className}`,children:u.indicator})]}),j&&n&&((d=I.children)==null?void 0:d.map(_=>Q.jsx(uf,{entry:_,expanded:G,gitStatus:W,onToggle:O,onOpen:J,depth:ae+1},_.path)))]})}function df(I,G=[]){for(const W of I)W.type==="file"&&G.push(W),W.children&&df(W.children,G);return G}function Pg({onRefresh:I}){const[G,W]=ye.useState([]),[O,J]=ye.useState(new Set),[ae,j]=ye.useState(null),[n,u]=ye.useState(!1),[d,_]=ye.useState({modified:[],staged:[],untracked:[]}),[a,g]=ye.useState([]),[b,y]=ye.useState(""),[c,r]=ye.useState(!1),h=ye.useRef(null),l=ye.useCallback(async()=>{try{const E=await Gv();W(E),j(null),u(!0)}catch(E){j(E.message)}},[]),o=ye.useCallback(async()=>{try{const E=await Xv();_(E)}catch(E){console.error("Failed to load git status:",E)}},[]),S=ye.useCallback(async()=>{try{const E=await Yv();g(E)}catch(E){console.error("Failed to load recent files:",E)}},[]);ye.useEffect(()=>{n||(l(),o(),S())},[n,l,o,S]),ye.useEffect(()=>{const E=setInterval(()=>{l(),o()},5e3);return()=>clearInterval(E)},[l,o]);const x=E=>{J(D=>{const k=new Set(D);return k.has(E)?k.delete(E):k.add(E),k})},v=async E=>{try{await Pl(E),I(),S()}catch(D){console.error("Failed to open file:",D)}},w=ye.useMemo(()=>df(G),[G]),m=ye.useMemo(()=>{if(!b.trim())return[];const E=b.toLowerCase();return w.filter(D=>D.name.toLowerCase().includes(E)||D.path.toLowerCase().includes(E)).slice(0,10)},[w,b]),C=E=>{y(E.target.value),r(!0)},L=E=>{E.key==="Escape"?(r(!1),y("")):E.key==="Enter"&&m.length>0&&(v(m[0].path),y(""),r(!1))},R=E=>{v(E),y(""),r(!1)};return ae?Q.jsxs("div",{className:"file-tree-error",children:["Error: ",ae]}):n?Q.jsxs("div",{className:"file-tree-container",children:[Q.jsxs("div",{className:"file-search",children:[Q.jsx("input",{ref:h,type:"text",className:"file-search-input",placeholder:"Search files...",value:b,onChange:C,onKeyDown:L,onFocus:()=>r(!0),onBlur:()=>setTimeout(()=>r(!1),200)}),c&&m.length>0&&Q.jsx("div",{className:"file-search-suggestions",children:m.map(E=>Q.jsxs("div",{className:"file-search-suggestion",onMouseDown:()=>R(E.path),children:[Q.jsx("span",{className:"suggestion-name",children:E.name}),Q.jsx("span",{className:"suggestion-path",children:E.path})]},E.path))})]}),a.length>0&&Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Recent"}),a.map(E=>Q.jsxs("div",{className:"file-node file recent-file",style:{paddingLeft:"8px"},onClick:()=>v(E.path),role:"treeitem",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),v(E.path))},children:[Q.jsx("span",{className:"file-icon",children:"🕐"}),Q.jsx("span",{className:"file-name",children:E.name}),Q.jsx("span",{className:"file-path-hint",children:E.relativePath})]},E.id))]}),Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Files"}),Q.jsx("div",{className:"file-tree",role:"tree","aria-label":"Project files",children:G.map(E=>Q.jsx(uf,{entry:E,expanded:O,gitStatus:d,onToggle:x,onOpen:v},E.path))})]})]}):Q.jsx("div",{className:"file-tree-loading",children:"Loading files..."})}const er=['Use `af spawn --task "description"` for quick one-off tasks that don\'t need a spec',"Run `af status` to see all active builders and their current phase",'Use `af send architect "message"` to notify the architect when you need guidance',"Run `af cleanup --project 0042` after merging a PR to clean up the worktree","Use `af spawn --soft -p 42` for flexible, protocol-guided work without strict porch orchestration","Run `af dash start` to launch the architect dashboard","Use `af spawn 42 --resume` to resume an existing builder worktree instead of recreating it","Use `af open file.ts` to open a file in the dashboard annotation viewer","Run `af tower start` to start the Tower server — there is no `restart` command, use stop then start","Check `af-config.json` at your project root to customize builder and architect commands","Run `porch pending` to see all gates waiting for your approval across all projects","Use `porch status 42` to see detailed phase status for a specific project","Run `porch next 42` to get the next tasks for a project","Use `porch done 42` to signal that the current phase work is complete","Gates like `spec-approval` and `plan-approval` require explicit human approval before advancing","Porch tracks state in `codev/projects/<id>/status.yaml` — never edit this file directly","Use `porch approve 42 spec-approval` to approve a gate (human only)","Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with automatic consultations","Use `consult -m gemini --type integration` for integration reviews with Gemini","Run `consult -m gemini --protocol spir --type spec` to get a Gemini review of your specification","Use `consult -m codex --protocol spir --type spec` for a focused specification review","Run `consult -m claude --protocol spir --type plan` to get feedback on your implementation plan","The `consult` CLI supports three models: `gemini`, `codex`, and `claude`",'Use `consult -m gemini --prompt "your question"` to ask Gemini a general question with codebase context','Say "cmap the PR" to run all three consultations in parallel in the background','Consultations are enabled by default in SPIR — say "without consultation" to skip them',"Commit specs and plans to `main` before spawning — builders branch from HEAD","Always add files explicitly with `git add file1 file2` — never use `git add .` or `git add -A`","Use SPIR for new features, TICK for amendments to existing specs, and BUGFIX for issue fixes","Each SPIR feature produces exactly three documents: spec, plan, and review","Specs define WHAT to build, plans define HOW — keep them as separate documents","Add YAML frontmatter with `approved` and `validated` fields to skip phases in porch","Run `codev doctor` to check that your environment is set up correctly","Use `--merge` (not squash) when merging PRs — individual commits document the development process","The TICK protocol modifies spec and plan in-place and creates a new review file","BUGFIX protocol uses GitHub Issues as source of truth — no spec/plan artifacts needed",'Run `tokei -e "node_modules" -e ".git" -e "dist" .` to measure codebase size',"Use `codev adopt` to set up Codev in an existing project","Click a builder card in the Work view to jump to its terminal tab","The file panel in Work view lets you browse project files without leaving the dashboard","Use the Refresh button to update builder status, PRs, and backlog data","The dashboard shows active builders, pending PRs, and backlog items in one view","Click the file panel toggle arrow to expand or collapse the file browser","The dashboard supports both desktop split-pane and mobile single-pane layouts","Tab indicators show builder status at a glance — active, waiting, or implementing","Use the `+ Shell` button to quickly open a new shell terminal tab","The SPIR protocol has four phases: Specify, Plan, Implement (IDE loop), and Review","Each implementation phase follows the IDE cycle: Implement, Defend (test), Evaluate","The EXPERIMENT protocol is for testing new approaches — use it for proof-of-concept work","The MAINTAIN protocol handles code hygiene and documentation sync","Run 3-way consultations at each SPIR checkpoint for spec, plan, and implementation reviews"];function Fg(I){const G=new Date(I.getFullYear(),0,0);return Math.floor((I.getTime()-G.getTime())/864e5)}function ff(I){const G=I.getFullYear(),W=String(I.getMonth()+1).padStart(2,"0"),O=String(I.getDate()).padStart(2,"0");return`tip-dismissed-${G}-${W}-${O}`}function jg(){try{return localStorage.getItem(ff(new Date))==="1"}catch{return!1}}function $g(){try{localStorage.setItem(ff(new Date),"1")}catch{}}function qg(I){return I.split("`").map((W,O)=>O%2===1?Q.jsx("code",{children:W},O):Q.jsx("span",{children:W},O))}function Wg(){const I=Fg(new Date)%er.length,[G,W]=ye.useState(I),[O,J]=ye.useState(jg);if(O||er.length===0)return null;const ae=()=>{W((G-1+er.length)%er.length)},j=()=>{W((G+1)%er.length)},n=()=>{$g(),J(!0)};return Q.jsxs("div",{className:"tip-banner",children:[Q.jsx("button",{className:"tip-banner-nav",onClick:ae,"aria-label":"Previous tip",children:"‹"}),Q.jsx("span",{className:"tip-banner-label",children:"Tip:"}),Q.jsx("span",{className:"tip-banner-text",children:qg(er[G])}),Q.jsx("button",{className:"tip-banner-nav",onClick:j,"aria-label":"Next tip",children:"›"}),Q.jsx("button",{className:"tip-banner-dismiss",onClick:n,"aria-label":"Dismiss tip",children:"×"})]})}function Gg({state:I,onRefresh:G,onSelectTab:W}){var _,a;const{data:O,error:J,refresh:ae}=Lg(),[j,n]=ye.useState(!1),u=ye.useCallback(async()=>{try{await qv(),G()}catch(g){console.error("Failed to create shell:",g)}},[G]),d=ye.useCallback(g=>{var y;const b=(y=I==null?void 0:I.builders)==null?void 0:y.find(c=>{var r,h,l,o;return g.issueNumber?((r=c.name)==null?void 0:r.includes(String(g.issueNumber)))||((h=c.id)==null?void 0:h.includes(String(g.issueNumber))):((l=c.id)==null?void 0:l.includes(g.id))||((o=c.name)==null?void 0:o.includes(g.id))});b&&(W==null||W(b.id))},[I==null?void 0:I.builders,W]);return I?Q.jsxs("div",{className:`work-view ${j?"file-panel-open":""}`,children:[Q.jsxs("div",{className:"work-content",children:[Q.jsxs("div",{className:"work-header",children:[Q.jsx("h2",{className:"work-title",children:"Work"}),Q.jsxs("div",{className:"work-actions",children:[Q.jsx("button",{className:"work-btn",onClick:u,children:"+ Shell"}),Q.jsx("button",{className:"work-btn work-btn-secondary",onClick:ae,children:"Refresh"})]})]}),J&&Q.jsxs("div",{className:"work-error",children:["Failed to load overview: ",J]}),Q.jsx(Wg,{}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Builders"}),O!=null&&O.builders&&O.builders.length>0?Q.jsxs("table",{className:"builder-table",children:[Q.jsx("thead",{children:Q.jsxs("tr",{children:[Q.jsx("th",{children:"Issue"}),Q.jsx("th",{children:"Title"}),Q.jsx("th",{children:"State"}),Q.jsx("th",{children:"Progress"}),Q.jsx("th",{children:"Elapsed"}),Q.jsx("th",{})]})}),Q.jsx("tbody",{children:O.builders.map(g=>Q.jsx(Ag,{builder:g,onOpen:d},g.id))})]}):Q.jsx("p",{className:"work-empty",children:"No active builders"})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Needs Attention"}),(_=O==null?void 0:O.errors)!=null&&_.prs?Q.jsx("p",{className:"work-unavailable",children:O.errors.prs}):Q.jsx(Tg,{prs:(O==null?void 0:O.pendingPRs)??[],builders:(O==null?void 0:O.builders)??[]})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Projects and Bugs"}),(a=O==null?void 0:O.errors)!=null&&a.issues?Q.jsx("p",{className:"work-unavailable",children:O.errors.issues}):Q.jsx(Hg,{items:(O==null?void 0:O.backlog)??[],onRefresh:G})]}),(O==null?void 0:O.recentlyClosed)&&O.recentlyClosed.length>0&&Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Recently Closed"}),Q.jsx(Ug,{items:O.recentlyClosed})]})]}),Q.jsxs("div",{className:`work-file-panel ${j?"expanded":"collapsed"}`,children:[Q.jsxs("div",{className:"work-file-panel-header",children:[Q.jsx("span",{className:"work-file-panel-toggle",onClick:()=>n(!j),children:j?"▼":"▲"}),Q.jsx("span",{className:"work-file-panel-label",onClick:()=>n(!j),children:"Files"}),!j&&Q.jsx("input",{className:"work-file-panel-search",type:"text",placeholder:"Search files...",onFocus:()=>n(!0)})]}),j&&Q.jsx("div",{className:"work-file-panel-content",children:Q.jsx(Pg,{onRefresh:G})})]})]}):Q.jsx("div",{className:"work-view",children:Q.jsx("p",{className:"work-loading",children:"Loading..."})})}function Xg({tabs:I,activeTabId:G,onSelectTab:W,onRefresh:O,children:J}){return Q.jsxs("div",{className:"mobile-layout",children:[Q.jsx(nf,{tabs:I,activeTabId:G,onSelectTab:W,onRefresh:O}),Q.jsx("div",{className:"mobile-content",children:J})]})}function Yg({tabId:I,initialLine:G}){let O=`${tf()}api/annotate/${I}/`;return G&&(O+=`?line=${G}`),Q.jsx("div",{className:"file-viewer",style:{width:"100%",height:"100%"},children:Q.jsx("iframe",{src:O,style:{width:"100%",height:"100%",border:"none"},title:"File Annotator"})})}function Vg(){const{state:I,refresh:G}=Vv(),{tabs:W,activeTab:O,activeTabId:J,selectTab:ae}=Qv(I),j=rf(`(max-width: ${ef}px)`),[n,u]=ye.useState(new Set),d=ye.useRef(new Map),_=ye.useCallback(async(h,l,o,S)=>{try{const x=await Pl(h,l,S);l&&l>0&&d.current.set(x.id,l),G()}catch(x){console.error("Failed to open file:",x)}},[G]);ye.useEffect(()=>{I!=null&&I.workspaceName?document.title=`${I.workspaceName} dashboard`:document.title="dashboard"},[I==null?void 0:I.workspaceName]);const[a]=ye.useState(()=>new URLSearchParams(window.location.search).get("fullscreen")==="1");ye.useEffect(()=>{if(!O)return;(O.type==="architect"||O.type==="builder"||O.type==="shell")&&u(l=>{if(l.has(O.id))return l;const o=new Set(l);return o.add(O.id),o})},[O==null?void 0:O.id,O==null?void 0:O.type]);const g=h=>{const l=Xd(h);return l?Q.jsx(Jd,{wsPath:l,onFileOpen:_,persistent:h.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},b=h=>{if(!h.annotationId||!I)return Q.jsx("div",{className:"no-terminal",children:"No file viewer"});if(!I.annotations.find(S=>S.id===h.annotationId))return Q.jsx("div",{className:"no-terminal",children:"Annotation not found"});const o=d.current.get(h.annotationId);return o!==void 0&&d.current.delete(h.annotationId),Q.jsx(Yg,{tabId:h.annotationId,initialLine:o??h.initialLine})},y=h=>{const l=W.filter(o=>h.includes(o.type)&&n.has(o.id));return Q.jsxs(Q.Fragment,{children:[l.map(o=>{const S=Xd(o);return Q.jsx("div",{className:"terminal-tab-pane",style:{display:J===o.id?void 0:"none"},children:S?Q.jsx(Jd,{wsPath:S,onFileOpen:_,persistent:o.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},o.id)}),Q.jsx("div",{style:{display:(O==null?void 0:O.type)==="work"?void 0:"none"},children:Q.jsx(Gg,{state:I,onRefresh:G,onSelectTab:ae})}),(O==null?void 0:O.type)==="file"&&b(O)]})};if(a)return O&&(O.type==="architect"||O.type==="builder"||O.type==="shell")?Q.jsx("div",{className:"fullscreen-terminal",children:g(O)}):Q.jsx("div",{className:"fullscreen-terminal"});if(j)return Q.jsx("div",{className:"mobile-wrapper",children:Q.jsx(Xg,{tabs:W,activeTabId:J,onSelectTab:ae,onRefresh:G,children:y(["architect","builder","shell"])})});const c=W.find(h=>h.type==="architect"),r=c?g(c):Q.jsx("div",{className:"no-architect",children:"No architect terminal"});return Q.jsxs("div",{className:"app",children:[Q.jsxs("header",{className:"app-header",children:[Q.jsx("h1",{className:"app-title",children:I!=null&&I.workspaceName?`${I.workspaceName} dashboard`:"dashboard"}),(I==null?void 0:I.version)&&Q.jsxs("span",{className:"header-version",children:["v",I.version]})]}),Q.jsx("div",{className:"app-body",children:Q.jsx(Zv,{left:r,right:Q.jsxs("div",{className:"right-panel",children:[Q.jsx(nf,{tabs:W.filter(h=>h.type!=="architect"),activeTabId:J,onSelectTab:ae,onRefresh:G}),Q.jsx("div",{className:"tab-content",role:"tabpanel",children:y(["builder","shell"])})]})})})]})}Uv.createRoot(document.getElementById("root")).render(Q.jsx(ye.StrictMode,{children:Q.jsx(Vg,{})}));
|
|
135
|
-
//# sourceMappingURL=index-
|
|
135
|
+
//# sourceMappingURL=index-8O8nCk_X.js.map
|