@oxgeneral/orch 1.0.6 → 1.0.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 (72) hide show
  1. package/dist/{App-LEVUTWQN.js → App-5OVBVRCD.js} +1 -1
  2. package/dist/{agent-Q34L27AY.js → agent-SI4JF5MV.js} +1 -1
  3. package/dist/{agent-shop-D2RS4BZK.js → agent-shop-JHDTCWCD.js} +1 -1
  4. package/dist/chunk-3AXNSYCM.js +2 -0
  5. package/dist/{chunk-BCPUTULS.js → chunk-HWEMBO36.js} +83 -54
  6. package/dist/chunk-J7ITYXE6.js +116 -0
  7. package/dist/chunk-J7ITYXE6.js.map +1 -0
  8. package/dist/{chunk-4TDXD3LA.js → chunk-SWNSNPBO.js} +12 -2
  9. package/dist/chunk-SWNSNPBO.js.map +1 -0
  10. package/dist/chunk-U2JVMD2G.js +66 -0
  11. package/dist/chunk-U2JVMD2G.js.map +1 -0
  12. package/dist/{chunk-EH3HRQP4.js → chunk-W3J7CURM.js} +8 -116
  13. package/dist/chunk-W3J7CURM.js.map +1 -0
  14. package/dist/chunk-ZMLF5HI5.js +11 -0
  15. package/dist/cli.js +1 -1
  16. package/dist/container-SEIWOLHY.js +4 -0
  17. package/dist/doctor-Q3GHJNZL.js +2 -0
  18. package/dist/index.d.ts +32 -1
  19. package/dist/index.js +12 -5
  20. package/dist/index.js.map +1 -1
  21. package/dist/init-D4356W7G.js +73 -0
  22. package/dist/orchestrator-G3Y7THMG.js +6 -0
  23. package/dist/{orchestrator-XPEMMBOO.js.map → orchestrator-G3Y7THMG.js.map} +1 -1
  24. package/dist/{orchestrator-JOTMB5XT.js → orchestrator-GQLNLOXB.js} +8 -4
  25. package/dist/{org-WAK3CDPG.js → org-KLYK6MMJ.js} +1 -1
  26. package/dist/skill-loader-IGRIELEM.js +9 -0
  27. package/dist/skill-loader-RHCFIK74.js +4 -0
  28. package/dist/skill-loader-RHCFIK74.js.map +1 -0
  29. package/dist/{task-QFLIIRKZ.js → task-3R2IX4HM.js} +1 -1
  30. package/dist/{tui-BJHZBCIR.js → tui-47O2OCKC.js} +1 -1
  31. package/dist/{workspace-manager-5EYCMAEO.js → workspace-manager-RH24FSNT.js} +4 -3
  32. package/dist/workspace-manager-RH24FSNT.js.map +1 -0
  33. package/dist/workspace-manager-VJ4FN5PJ.js +3 -0
  34. package/package.json +4 -3
  35. package/readme.md +11 -0
  36. package/scripts/{postinstall.js → postinstall.cjs} +24 -5
  37. package/skills/library/autoplan.md +315 -0
  38. package/skills/library/benchmark.md +242 -0
  39. package/skills/library/browse.md +266 -0
  40. package/skills/library/canary.md +248 -0
  41. package/skills/library/careful.md +42 -0
  42. package/skills/library/codex.md +431 -0
  43. package/skills/library/design-consultation.md +367 -0
  44. package/skills/library/design-review.md +744 -0
  45. package/skills/library/document-release.md +365 -0
  46. package/skills/library/freeze.md +60 -0
  47. package/skills/library/guard.md +55 -0
  48. package/skills/library/investigate.md +171 -0
  49. package/skills/library/land-and-deploy.md +636 -0
  50. package/skills/library/office-hours.md +746 -0
  51. package/skills/library/plan-ceo-review.md +1029 -0
  52. package/skills/library/plan-design-review.md +428 -0
  53. package/skills/library/plan-eng-review.md +420 -0
  54. package/skills/library/qa-only.md +388 -0
  55. package/skills/library/qa.md +766 -0
  56. package/skills/library/retro.md +532 -0
  57. package/skills/library/review.md +421 -0
  58. package/skills/library/setup-browser-cookies.md +86 -0
  59. package/skills/library/setup-deploy.md +211 -0
  60. package/skills/library/ship.md +1018 -0
  61. package/skills/library/unfreeze.md +31 -0
  62. package/skills/library/upgrade.md +220 -0
  63. package/skills/orch/SKILL.md +416 -0
  64. package/dist/chunk-4TDXD3LA.js.map +0 -1
  65. package/dist/chunk-EH3HRQP4.js.map +0 -1
  66. package/dist/chunk-WVJTXBPL.js +0 -11
  67. package/dist/container-FXUUV6PP.js +0 -4
  68. package/dist/doctor-P2J6VAUX.js +0 -2
  69. package/dist/init-PTAYCSMO.js +0 -53
  70. package/dist/orchestrator-XPEMMBOO.js +0 -6
  71. package/dist/workspace-manager-5EYCMAEO.js.map +0 -1
  72. package/dist/workspace-manager-XKOZ5WM6.js +0 -3
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a}from'./chunk-N4OXN2HW.js';import {c,a as a$1}from'./chunk-HXOMNULD.js';import {b,a as a$2}from'./chunk-BCPUTULS.js';import {f,h,g}from'./chunk-64WUDYEM.js';import {m}from'./chunk-IKNBPOQL.js';import nn,{useState,useMemo,useEffect,useRef,useCallback}from'react';import {Box,Text,useInput,useApp,useStdout}from'ink';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var e={amber:"#ffaf00",amberDim:"#af8700",green:"#5faf87",red:"#d75f5f",blue:"#5fafd7",yellow:"#d7af00",cyan:"#5fd7d7",purple:"#af87ff",white:"#eeeeee",silver:"#bcbcbc",gray:"#808080",dim:"#585858",ghost:"#3a3a3a",void:"#262626",errorBg:"#3d1515",warnBg:"#3d2e0a",successBg:"#0f2d1f",infoBg:"#1a1a22",toolBg:"#0f1f2d"},Cn="\u2501",Ve="\u2500",ue="\xB7",Qt="\u25C8",Tr="\u2605",mo="\u27F3",Ut="\u25C6",In={in_progress:e.green,retrying:e.yellow,review:e.blue,todo:e.dim,done:e.green,failed:e.red,cancelled:e.dim},xs=new Map,bs=new Map;function He(t){if(t<=0)return "";let o=xs.get(t);return o||(o=Cn.repeat(t),xs.set(t,o)),o}function ye(t){if(t<=0)return "";let o=bs.get(t);return o||(o=Ve.repeat(t),bs.set(t,o)),o}function nt(t,o){return t.length>o?t.slice(0,o-1)+"\u2026":t}var Fa=1e4;function yr(t,o=Fa){if(t)return t.length>o?t.slice(0,o)+`
2
+ import {b,a as a$2}from'./chunk-HWEMBO36.js';import {a}from'./chunk-N4OXN2HW.js';import {c,a as a$1}from'./chunk-HXOMNULD.js';import {f,h,g}from'./chunk-64WUDYEM.js';import {m}from'./chunk-IKNBPOQL.js';import nn,{useState,useMemo,useEffect,useRef,useCallback}from'react';import {Box,Text,useInput,useApp,useStdout}from'ink';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var e={amber:"#ffaf00",amberDim:"#af8700",green:"#5faf87",red:"#d75f5f",blue:"#5fafd7",yellow:"#d7af00",cyan:"#5fd7d7",purple:"#af87ff",white:"#eeeeee",silver:"#bcbcbc",gray:"#808080",dim:"#585858",ghost:"#3a3a3a",void:"#262626",errorBg:"#3d1515",warnBg:"#3d2e0a",successBg:"#0f2d1f",infoBg:"#1a1a22",toolBg:"#0f1f2d"},Cn="\u2501",Ve="\u2500",ue="\xB7",Qt="\u25C8",Tr="\u2605",mo="\u27F3",Ut="\u25C6",In={in_progress:e.green,retrying:e.yellow,review:e.blue,todo:e.dim,done:e.green,failed:e.red,cancelled:e.dim},xs=new Map,bs=new Map;function He(t){if(t<=0)return "";let o=xs.get(t);return o||(o=Cn.repeat(t),xs.set(t,o)),o}function ye(t){if(t<=0)return "";let o=bs.get(t);return o||(o=Ve.repeat(t),bs.set(t,o)),o}function nt(t,o){return t.length>o?t.slice(0,o-1)+"\u2026":t}var Fa=1e4;function yr(t,o=Fa){if(t)return t.length>o?t.slice(0,o)+`
3
3
  \u2026[truncated]`:t}var Ts={active:e.green,paused:e.dim,achieved:e.amber,abandoned:e.ghost};var za=120,wr=0,Qo=null,Mn=new Set;function Va(){Qo||(Qo=setInterval(()=>{wr++;for(let t of Mn)t(wr);},za));}function Ha(){Qo&&Mn.size===0&&(clearInterval(Qo),Qo=null);}function fo(){let[t,o]=useState(wr);return useEffect(()=>{let n=r=>o(r);return Mn.add(n),Va(),()=>{Mn.delete(n),Ha();}},[]),t}var ys=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Bo({color:t}){let o=fo();return jsx(Text,{color:t,children:ys[o%ys.length]})}var en={in_progress:0,retrying:1,review:2,todo:3,done:4,failed:5,cancelled:6};var qa="\u25CB",Ss="\u2713",ks="\u2715",Ka="\u21BB",Ya="\u2500",Za="\u25B6",Ft={green:"#0f2d1f",blue:"#0f1f2d",yellow:"#2d2a0f",red:"#2d0f0f",neutral:"#1a1a22",amber:"#2d1f0a"},Ja={in_progress:{icon:Za,label:"RUN",fg:e.green,bg:Ft.green,bold:true,spinner:true},retrying:{icon:Ka,label:"RETRY",fg:e.yellow,bg:Ft.yellow,spinner:true},review:{icon:Qt,label:"REVIEW",fg:e.blue,bg:Ft.blue},todo:{icon:qa,label:"TODO",fg:e.dim,bg:Ft.neutral},done:{icon:Ss,label:"DONE",fg:e.green,bg:Ft.green},failed:{icon:ks,label:"FAIL",fg:e.red,bg:Ft.red,bold:true},cancelled:{icon:Ya,label:"OFF",fg:e.dim,bg:Ft.neutral}},Qa={1:{color:e.red,label:"!!!"},2:{color:e.yellow,label:"!!"},3:{color:e.dim,label:"!"},4:{color:e.ghost,label:ue}};var tl=18,ol="#2d1f0a",vn=nn.memo(function({task:o,selected:n,width:r,agentNameMap:l,goalMap:f$1}){let b=Ja[o.status],T=o.status==="in_progress"||o.status==="retrying",x=Qa[o.priority]??{color:e.ghost,label:ue},y,C;if(o.status==="done")y=Ss,C=e.green;else if(o.status==="failed")y=ks,C=e.red;else if(T){let E=Date.now()-new Date(o.updated_at).getTime();y=f(E),C=e.cyan;}else y="\u2014",C=void 0;let M=n?"\u25B8":" ",B=o.goalId?f$1?.get(o.goalId):void 0,k=!!B,H=10,V=4,F=14,P=k?tl:0,j=7,L=2+H+V+F+P+j,O=r?Math.max(10,r-L):40,N=o.assignee?l?.get(o.assignee)??o.assignee:void 0;return jsxs(Box,{children:[jsxs(Text,{color:n?e.amber:void 0,children:[M," "]}),jsx(Box,{width:H,children:jsx(Text,{backgroundColor:b.bg,color:b.fg,bold:b.bold,children:b.spinner?jsxs(Fragment,{children:[" ",jsx(Bo,{color:b.fg})," ",b.label," "]}):jsxs(Fragment,{children:[" ",b.icon," ",b.label," "]})})}),jsx(Box,{width:V,children:jsx(Text,{color:x.color,bold:o.priority<=2,children:x.label})}),jsxs(Box,{width:O,children:[jsx(Text,{wrap:"truncate",bold:n||T,color:n?e.white:T?e.silver:void 0,children:o.title.length>O?o.title.slice(0,O-1)+"\u2026":o.title}),(o.attachments?.length??0)>0&&jsxs(Text,{color:e.dim,children:[" ","\u{1F4CE}",o.attachments.length]})]}),k&&jsx(Box,{width:P,children:jsxs(Text,{backgroundColor:ol,color:e.amberDim,wrap:"truncate",children:[" \u2295 ",nt(B.title,13)," "]})}),jsx(Box,{width:F,children:N?jsxs(Text,{backgroundColor:Ft.green,color:e.green,wrap:"truncate",children:[" ",N.length>F-2?N.slice(0,F-3)+"\u2026":N," "]}):jsx(Text,{color:e.ghost,children:"\u2014"})}),jsx(Box,{width:j,justifyContent:"flex-end",children:jsx(Text,{color:C,dimColor:!C,children:y})})]})});var Cs="\u2295";function Is({goalTitle:t,taskCount:o,doneCount:n,width:r}){let l=o>0?Math.round(n/o*100):0,f=` ${Cs} ${t.toUpperCase()} ${ue} ${o} task${o!==1?"s":""} ${ue} ${l}% done `,b=3,T=Math.max(0,r-b-f.length-4);return jsxs(Box,{paddingX:2,children:[jsx(Text,{color:e.ghost,children:ye(b)}),jsx(Text,{backgroundColor:Ft.amber,color:e.amber,bold:true,children:f}),jsx(Text,{color:e.ghost,children:ye(T)})]})}function Ms({taskCount:t,width:o}){let n=` ${Cs} UNGROUPED ${ue} ${t} task${t!==1?"s":""} `,r=3,l=Math.max(0,o-r-n.length-4);return jsxs(Box,{paddingX:2,children:[jsx(Text,{color:e.ghost,children:ye(r)}),jsx(Text,{backgroundColor:Ft.neutral,color:e.dim,children:n}),jsx(Text,{color:e.ghost,children:ye(l)})]})}var rl="\u2715",vs="\u25CB",sl="\u25B6",il="\u2713",Eo={green:"#0f2d1f",red:"#2d0f0f",neutral:"#1a1a22",amber:"#2d1f0a"},al={running:{icon:sl,label:"ACTIVE",fg:e.green,bg:Eo.green,bold:true,spinner:true},idle:{icon:vs,label:"IDLE",fg:e.dim,bg:Eo.neutral},error:{icon:rl,label:"ERROR",fg:e.red,bg:Eo.red,bold:true},disabled:{icon:vs,label:"OFF",fg:e.ghost,bg:Eo.neutral}},Sr={running:0,idle:1,error:2,disabled:3},Rs=nn.memo(function({agent:o,selected:n,width:r,runningEntry:l,currentTaskTitle:f$1,teamName:b,isLead:T}){let x=al[o.status],y=o.status==="running",C,M;if(y&&l){let N=Date.now()-new Date(l.started_at).getTime();C=f(N),M=e.cyan;}else o.stats.total_runs>0?(C=`${o.stats.tasks_completed}/${o.stats.total_runs}`,M=o.stats.tasks_completed>0?e.green:e.dim):(C="\u2014",M=void 0);let B=n?"\u25B8":" ",k=11,H=8,V=b?Math.min(b.length+2,12):0,F=10,P=2+k+H+V+F,j=r?Math.max(8,r-P):20,L=o.stats.total_runs>0,O=L?Math.round(o.stats.tasks_completed/o.stats.total_runs*100):0;return jsxs(Box,{children:[jsxs(Text,{color:n?e.amber:void 0,children:[B," "]}),jsx(Box,{width:k,children:jsx(Text,{backgroundColor:x.bg,color:x.fg,bold:x.bold,children:x.spinner?jsxs(Fragment,{children:[" ",jsx(Bo,{color:x.fg})," ",x.label," "]}):jsxs(Fragment,{children:[" ",x.icon," ",x.label," "]})})}),jsx(Box,{width:j,children:jsxs(Text,{wrap:"truncate",bold:n||y,color:n?e.white:y?e.green:e.silver,children:[o.autonomous&&jsxs(Text,{color:e.cyan,children:[mo," "]}),T&&jsxs(Text,{color:e.amber,children:[Tr," "]}),o.name,y&&f$1&&jsxs(Text,{color:e.dim,children:[" ",ue," ",f$1]}),o.status==="error"&&o.last_error&&jsxs(Text,{color:e.red,children:[" ",ue," ",nt(m[o.last_error.kind]?.message??o.last_error.message,30)]})]})}),jsx(Box,{width:H,children:jsx(Text,{color:e.dim,children:o.adapter})}),b&&jsx(Box,{width:V,children:jsx(Text,{color:e.amber,wrap:"truncate",children:b})}),jsx(Box,{width:F,justifyContent:"flex-end",children:L&&!y?jsxs(Text,{color:O>=80?e.green:O>=50?e.yellow:e.red,children:[C," ",il]}):jsx(Text,{color:M,dimColor:!M,children:C})})]})});function As({teamName:t,memberCount:o,leadName:n,width:r}){let l=`${o} agent${o!==1?"s":""}`,f=n?` ${ue} ${Tr} ${n}`:"",b=` ${Qt} ${t.toUpperCase()} ${ue} ${l}${f} `,T=3,x=Math.max(0,r-T-b.length-4);return jsxs(Box,{paddingX:2,children:[jsx(Text,{color:e.ghost,children:ye(T)}),jsx(Text,{backgroundColor:Eo.amber,color:e.amber,bold:true,children:b}),jsx(Text,{color:e.ghost,children:ye(x)})]})}var ll="\u25C7";function $s({memberCount:t,width:o}){let n=`${t} agent${t!==1?"s":""}`,r=` ${ll} UNASSIGNED ${ue} ${n} `,l=3,f=Math.max(0,o-l-r.length-4);return jsxs(Box,{paddingX:2,children:[jsx(Text,{color:e.ghost,children:ye(l)}),jsx(Text,{backgroundColor:Eo.neutral,color:e.dim,children:r}),jsx(Text,{color:e.ghost,children:ye(f)})]})}var Bs="\u2713",Es="\u2715",dl="\u2016",ul="\u25C9",on={green:"#0f2d1f",amber:"#2d1f0a",neutral:"#1a1a22"},gl={active:{icon:ul,label:"ACTIVE",fg:e.green,bg:on.green,bold:true},paused:{icon:dl,label:"PAUSED",fg:e.dim,bg:on.neutral},achieved:{icon:Bs,label:"DONE",fg:e.amber,bg:on.amber,bold:true},abandoned:{icon:Es,label:"DROP",fg:e.ghost,bg:on.neutral}},ml="\u2588",fl="\u2591",pl=14,Ls=nn.memo(function({goal:o,selected:n,width:r,agentNameMap:l,tasksByGoal:f}){let b=gl[o.status],T=n?"\u25B8":" ",x=f?.length??0,y=f?.filter(O=>O.status==="done").length??0,C=x>0,M=11,B=C?pl:0,k=14,H=7,V=2+M+B+k+H,F=r?Math.max(10,r-V):40,P=o.assignee?l?.get(o.assignee)??o.assignee:void 0,j,L;if(o.status==="achieved")j=Bs,L=e.amber;else if(o.status==="abandoned")j=Es,L=e.ghost;else {let O=Date.now()-new Date(o.created_at).getTime(),N=Math.floor(O/864e5);j=N>0?`${N}d`:"<1d",L=e.dim;}return jsxs(Box,{children:[jsxs(Text,{color:n?e.amber:void 0,children:[T," "]}),jsx(Box,{width:M,children:jsxs(Text,{backgroundColor:b.bg,color:b.fg,bold:b.bold,children:[" ",b.icon," ",b.label," "]})}),jsx(Box,{width:F,children:jsx(Text,{wrap:"truncate",bold:n||o.status==="active",color:n?e.white:o.status==="active"?e.silver:void 0,children:o.title.length>F?o.title.slice(0,F-1)+"\u2026":o.title})}),C&&(()=>{let N=x>0?Math.round(y/x*6):0,E=6-N;return jsxs(Box,{width:B,children:[jsx(Text,{color:e.green,children:ml.repeat(N)}),jsx(Text,{color:e.ghost,children:fl.repeat(E)}),jsx(Text,{color:e.dim,children:` ${y}/${x}`})]})})(),jsx(Box,{width:k,children:P?jsxs(Text,{backgroundColor:on.green,color:e.green,wrap:"truncate",children:[" ",P.length>k-2?P.slice(0,k-3)+"\u2026":P," "]}):jsx(Text,{color:e.ghost,children:"\u2014"})}),jsx(Box,{width:H,justifyContent:"flex-end",children:jsx(Text,{color:L,dimColor:!L,children:j})})]})});var hl={system:"\u2666",lifecycle:"\u25B6",output:"\u2502",tool:"\u2699",result:"\u2190",error:"\u2715",file:"\u270E",info:"\u2502"};function Po({label:t,width:o,color:n}){let r=o-4,l=` ${t} `,f=3,b=Math.max(0,r-f-l.length);return jsxs(Text,{color:n??e.ghost,children:[" ",ye(f),l,ye(b)]})}function Os({task:t,height:o,width:n,taskLogs:r,agentNameMap:l,taskTitleMap:f}){let b=In[t.status]??e.dim,T=t.priority<=2?t.priority===1?e.red:e.yellow:void 0,x=24,y=!!t.description?.trim(),C=!!t.proof?.agent_summary,M=(t.proof?.files_changed?.length??0)>0,B=(r?.length??0)>0,k=(t.attachments?.length??0)>0,H=y?t.description.split(`
4
4
  `):[],V=C?t.proof.agent_summary.split(`
5
5
  `):[],F=3;k&&(F+=2+t.attachments.length),y?(F+=1,F+=Math.min(H.length,Math.max(1,Math.ceil((o-10)*.3)))):C||(F+=2),C&&(F+=2),M&&(F+=1),B&&(F+=2);let P=Math.max(0,o-F),j=0,L=0;C&&B?(j=Math.max(1,Math.floor(P*.4)),L=Math.max(1,P-j)):C?j=P:B&&(L=P);let O=y?H.slice(0,Math.max(1,Math.ceil((o-10)*.3))):[],N=V.slice(0,j);return jsxs(Box,{flexDirection:"column",paddingX:2,children:[jsxs(Box,{children:[jsxs(Box,{width:x,children:[jsx(Text,{color:e.dim,children:" status "}),jsx(Text,{color:b,children:t.status})]}),jsxs(Box,{children:[jsx(Text,{color:e.dim,children:" assignee "}),jsx(Text,{color:t.assignee?e.green:e.dim,children:t.assignee?l?.get(t.assignee)??t.assignee:"\u2014"})]})]}),jsxs(Box,{children:[jsxs(Box,{width:x,children:[jsx(Text,{color:e.dim,children:" priority "}),jsxs(Text,{color:T,bold:t.priority<=2,children:["P",t.priority]})]}),jsxs(Box,{children:[jsx(Text,{color:e.dim,children:" attempts "}),jsxs(Text,{children:[t.attempts,"/",t.max_attempts]})]})]}),jsxs(Box,{children:[jsxs(Box,{width:x,children:[jsx(Text,{color:e.dim,children:" labels "}),jsx(Text,{color:e.purple,children:t.labels.length>0?t.labels.join(", "):"\u2014"})]}),jsxs(Box,{children:[jsx(Text,{color:e.dim,children:" depends "}),jsx(Text,{dimColor:true,children:t.depends_on.length>0?t.depends_on.map(E=>f?.get(E)??E).join(", "):"\u2014"})]})]}),k&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),jsx(Po,{label:`attachments (${t.attachments.length})`,width:n,color:e.dim}),t.attachments.map((E,G)=>jsxs(Text,{color:e.cyan,wrap:"truncate",children:[" ",E]},`a${G}`))]}),y&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),O.map((E,G)=>jsxs(Text,{color:e.silver,wrap:"truncate",children:[" ",nt(E,n-8)]},`d${G}`))]}),!y&&!C&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),jsx(Text,{color:e.dim,children:" No description."})]}),C&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),jsx(Po,{label:"result",width:n,color:e.dim}),N.map((E,G)=>jsxs(Text,{color:e.white,wrap:"truncate",children:[" ",nt(E,n-8)]},`r${G}`))]}),M&&jsxs(Box,{children:[jsx(Text,{color:e.dim,children:" files "}),jsx(Text,{color:e.cyan,children:t.proof.files_changed.length}),jsx(Text,{color:e.dim,children:" changed"}),t.proof.branch&&jsxs(Fragment,{children:[jsxs(Text,{color:e.dim,children:[" ","\xB7"," "]}),jsx(Text,{color:e.cyan,children:t.proof.branch})]})]}),B&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),jsx(Po,{label:"activity",width:n,color:e.dim}),r.slice(-L).map((E,G)=>{let z=E.msgType??"info",X=hl[z]??"\u2502",R=E.color;z==="tool"?R=e.cyan:z==="file"?R=e.purple:z==="error"?R=e.red:z==="lifecycle"?R=e.green:z==="system"&&(R=e.dim);let ie=Math.max(10,n-12),Le=nt(E.text,ie);return jsxs(Box,{children:[jsxs(Text,{color:e.ghost,children:[" ",E.time," "]}),jsxs(Text,{color:z==="error"?e.red:e.dim,children:[X," "]}),jsx(Text,{color:R,bold:z==="lifecycle",children:Le})]},G)})]})]})}var _n=[{key:"G",id:"goals",label:"GOALS"},{key:"T",id:"tasks",label:"TASKS"},{key:"A",id:"agents",label:"AGENTS"},{key:"L",id:"logs",label:"ACTIONS"}];var xl="\u25CF",Ns="\u25CB",bl="\u2713",Tl="\u2715",yl="\u2191",wl="\u2193",Sl="\u03A3",kl="\u25B6",Cl="\u21BB",Il="\u{1F9E0}",Ps=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],kr=[" ","\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],ft={green:"#0f2d1f",blue:"#0f1f2d",yellow:"#2d2a0f",red:"#2d0f0f",neutral:"#1a1a22",amber:"#2d1f0a"};function Ds({color:t}){let o=fo();return jsx(Text,{color:t,children:Ps[o%Ps.length]})}function Ml(){let t=fo(),o=Math.floor(t/10)%2===0;return jsx(Text,{color:o?e.amber:e.amberDim,bold:true,children:Ut})}function vl({width:t,active:o}){let n=Math.max(4,Math.floor(t*.08)),r=2,l=fo(),f=Math.ceil((t+n)/r),b=o?l%(f*2):0;if(!o)return jsx(Box,{paddingX:1,children:jsx(Text,{color:e.ghost,children:He(t)})});let T=b<f?b*r:(f*2-b)*r,x=Math.max(0,T-n),y=Math.min(t,T),C=x,M=Math.max(0,y-x),B=Math.max(0,t-y);return jsxs(Box,{paddingX:1,children:[jsx(Text,{color:e.ghost,children:He(C)}),jsx(Text,{color:e.amber,children:He(M)}),jsx(Text,{color:e.ghost,children:He(B)})]})}function _l({data:t,width:o,color:n}){if(t.length===0)return null;let r=t.slice(-o),l=Math.max(...r,1),f=r.map(b=>{let T=Math.round(b/l*(kr.length-1));return kr[T]??kr[0]}).join("");return jsx(Text,{color:n,children:f})}function Rl({tab:t,flashColor:o,onComplete:n,badge:r}){let l=fo(),f=nn.useRef(l),b=nn.useRef(false),T=l-f.current,x=2,y=6*x;return nn.useEffect(()=>{T>=y&&!b.current&&(b.current=true,n());},[T,n]),Math.floor(T/x)%2===0&&T<y?jsxs(Text,{backgroundColor:o,color:"#0a0a0c",bold:true,children:[" ",t.key," ",t.label,r," "]}):jsxs(Box,{gap:0,children:[jsx(Text,{color:e.ghost,children:t.key}),jsxs(Text,{color:e.dim,children:[" ",t.label.toLowerCase(),r]})]})}function Al({projectName:t,activeView:o,mode:n,stats:r,uptime:l,width:f,version:b,latestVersion:T,taskBadge:x,flashTab:y,flashColor:C,onFlashComplete:M}){let B=n==="watching";return jsxs(Box,{paddingX:1,justifyContent:"space-between",width:f,children:[jsxs(Box,{gap:0,children:[jsx(Ml,{}),jsx(Text,{color:e.amber,bold:true,children:" ORCH"}),b&&jsxs(Text,{color:e.ghost,children:[" ",b]}),T&&T!==b&&jsxs(Text,{backgroundColor:ft.green,color:e.green,bold:true,children:[" UPDATE ",T," "]}),jsxs(Text,{color:e.ghost,children:[" ",ue," "]}),jsx(Text,{color:e.silver,children:t})]}),jsx(Box,{gap:0,children:_n.map((k,H)=>{let V=o===k.id,F=k.id==="tasks"&&x!=null&&x>0?` (${x})`:"",P=!V&&y===k.id&&C&&M;return jsxs(nn.Fragment,{children:[H>0&&jsx(Text,{children:" "}),V?jsxs(Text,{backgroundColor:e.amber,color:"#0a0a0c",bold:true,children:[" ",k.key," ",k.label,F," "]}):P?jsx(Rl,{tab:k,flashColor:C,onComplete:M,badge:F}):jsxs(Box,{gap:0,children:[jsx(Text,{color:e.ghost,children:k.key}),jsxs(Text,{color:e.dim,children:[" ",k.label.toLowerCase(),F]})]})]},k.id)})}),jsxs(Box,{gap:0,children:[B?jsxs(Text,{backgroundColor:ft.green,color:e.green,bold:true,children:[" ",xl," WATCHING"," "]}):jsxs(Text,{backgroundColor:ft.neutral,color:e.dim,children:[" ",Ns," IDLE"," "]}),r.running>0&&jsxs(Fragment,{children:[jsx(Text,{children:" "}),jsxs(Text,{backgroundColor:ft.green,color:e.green,children:[" ",jsx(Ds,{color:e.green})," ",r.running," active"," "]})]}),l&&jsxs(Text,{color:e.ghost,children:[" ",l]})]})]})}function $l({stats:t,tokens:o,width:n,sparklineData:r}){let f=[{icon:kl,label:"RUN",count:t.running,fg:e.green,bg:ft.green,bold:true,spinner:true,show:t.running>0},{icon:Cl,label:"RETRY",count:t.retrying,fg:e.yellow,bg:ft.yellow,show:t.retrying>0},{icon:Qt,label:"REVIEW",count:t.review,fg:e.blue,bg:ft.blue,show:t.review>0},{icon:Ns,label:"TODO",count:t.todo,fg:e.dim,bg:ft.neutral,show:t.todo>0},{icon:bl,label:"DONE",count:t.done,fg:e.green,bg:ft.green,show:t.done>0},{icon:Tl,label:"FAIL",count:t.failed,fg:e.red,bg:ft.red,bold:true,show:t.failed>0},{icon:Ut,label:"TEAMS",count:t.teams,fg:e.amber,bg:ft.amber,show:t.teams>0}].filter(x=>x.show),b=o.total>0,T=r&&r.length>0?Math.min(16,r.length):0;return jsxs(Box,{paddingX:1,justifyContent:"space-between",width:n,children:[jsxs(Box,{gap:1,children:[f.map(x=>jsx(Text,{backgroundColor:x.bg,color:x.fg,bold:x.bold,children:x.spinner?jsxs(Fragment,{children:[" ",jsx(Ds,{color:x.fg})," ",x.count," ",x.label," "]}):jsxs(Fragment,{children:[" ",x.icon," ",x.count," ",x.label," "]})},x.label)),f.length===0&&jsxs(Text,{backgroundColor:ft.neutral,color:e.dim,children:[" ","NO TASKS"," "]})]}),jsxs(Box,{gap:0,children:[T>0&&r&&jsxs(Fragment,{children:[jsx(_l,{data:r,width:T,color:e.amberDim}),jsx(Text,{children:" "})]}),b&&jsxs(Text,{backgroundColor:ft.amber,color:e.cyan,children:[" ",yl,h(o.input)," ",wl,h(o.output),o.reasoning>0?` ${Il}${h(o.reasoning)}`:""," ",ue," ",Sl,h(o.total)," "]})]})]})}var Fs=nn.memo(function(o){let n=Math.max(10,o.width-2),r=o.stats.running>0;return jsxs(Box,{flexDirection:"column",children:[jsx(Box,{height:1}),jsx(Al,{projectName:o.projectName,activeView:o.activeView,mode:o.mode,stats:o.stats,uptime:o.uptime,width:o.width,version:o.version,latestVersion:o.latestVersion,taskBadge:o.taskBadge,flashTab:o.flashTab,flashColor:o.flashColor,onFlashComplete:o.onFlashComplete}),jsx(Box,{height:1}),jsx($l,{stats:o.stats,tokens:o.tokens,width:o.width,sparklineData:o.sparklineData}),jsx(vl,{width:n,active:r})]})});var rn="\u0423\u041F\u0420\u0410\u0412\u041B\u0415\u041D\u0418\u0415",No="\u041C\u041E\u041D\u0418\u0422\u041E\u0420\u0418\u041D\u0413",An="\u041D\u0410\u0421\u0422\u0420\u041E\u0419\u041A\u0418",po={task:{sub:["add","list","show","cancel","retry","assign","approve","reject","delete"],help:"Manage tasks",category:rn},agent:{sub:["add","list","disable","enable","delete","autonomous","shop"],help:"Manage agents",category:rn},team:{sub:["create","list","join","leave","disband","set-lead"],help:"Manage teams",category:rn},goal:{sub:["add","list","show","status","delete"],help:"Manage goals",category:rn},run:{args:"[id]",help:"Run task (or selected)",category:No},"run-all":{help:"Run all todo tasks",category:No},watch:{help:"Start watch mode (auto-dispatch)",category:No},pause:{help:"Pause watch mode",category:No},status:{help:"Show orchestrator status",category:No},config:{sub:["activity-filter","max-concurrent"],help:"TUI settings",category:An},help:{help:"List all commands",category:An},quit:{help:"Exit the TUI",category:An}};function Cr(t){if(!t.startsWith("/"))return null;let o=t.slice(1),n=o.indexOf(" ");if(n===-1){let T=o;if(!T)return null;let x=Object.keys(po).find(y=>y.startsWith(T)&&y!==T);return x?x.slice(T.length):null}let r=o.slice(0,n),l=po[r];if(!l?.sub)return null;let f=o.slice(n+1);if(!f)return null;let b=l.sub.find(T=>T.startsWith(f)&&T!==f);return b?b.slice(f.length):null}function Ws(t){if(!t.startsWith("/"))return [];let o=t.slice(1),n=o.indexOf(" ");if(n===-1){let T=o.toLowerCase(),x=[];if(!T){let y=[rn,No,An];for(let C of y){x.push({cmd:"",desc:`\u2500\u2500 ${C} \u2500\u2500`});for(let[M,B]of Object.entries(po))if(B.category===C){let k=B.args?` ${B.args}`:"";x.push({cmd:`/${M}${k}`,desc:B.help,subs:B.sub?.join(" \xB7 ")});}}return x}for(let[y,C]of Object.entries(po))if(y.startsWith(T)){let M=C.args?` ${C.args}`:"";if(x.push({cmd:`/${y}${M}`,desc:C.help,subs:C.sub?.join(" \xB7 ")}),y===T&&C.sub)for(let B of C.sub)x.push({cmd:`/${y} ${B}`,desc:`${C.help}: ${B}`});}return x}let r=o.slice(0,n),l=po[r];if(!l?.sub)return [];let f=o.slice(n+1).toLowerCase(),b=[];for(let T of l.sub)(!f||T.startsWith(f))&&b.push({cmd:`/${r} ${T}`,desc:`${l.help}: ${T}`});return b}var $n=class{entries=[];cursor=0;push(o){o&&(this.entries[this.entries.length-1]!==o&&(this.entries.push(o),this.entries.length>100&&this.entries.shift()),this.cursor=this.entries.length);}prev(){return this.entries.length===0?null:(this.cursor>0&&this.cursor--,this.entries[this.cursor]??null)}next(){return this.cursor<this.entries.length-1?(this.cursor++,this.entries[this.cursor]??null):(this.cursor=this.entries.length,null)}reset(){this.cursor=this.entries.length;}};var El="\u2588",Gs=nn.memo(function({mode:o,value:n,completion:r,activeView:l,canRun:f,canNew:b,canApprove:T,canReject:x,canCancel:y,canDelete:C,canUndo:M,canEdit:B,canForceStop:k,canToggleAuto:H,autoActive:V,canPause:F,isPaused:P,canToggleShowAll:j,showAllActive:L,hasDetail:O,itemCount:N,itemLabel:E,width:G,hasSuggestions:z,onboardingCompleted:X}){if(o==="command"){let R=z?" \u2191\u2193 select Tab fill Esc \u2715":" Enter exec \u2191\u2193 history Tab complete Esc \u2715",ie=Math.max(4,G-6-R.length-(r?.length??0)-1),Le=n.length>ie?"\u2026"+n.slice(-(ie-1)):n;return jsx(Box,{paddingX:2,justifyContent:"space-between",width:G,children:jsxs(Box,{children:[jsx(Text,{color:e.amber,children:"/ "}),jsx(Text,{color:e.white,children:Le}),r&&jsx(Text,{color:e.ghost,children:r}),jsx(Text,{color:e.amber,children:El}),jsx(Text,{color:e.dim,children:R})]})})}return jsxs(Box,{paddingX:2,justifyContent:"space-between",width:G,children:[jsxs(Text,{color:e.dim,children:[jsx(Text,{bold:true,color:e.gray,children:"\u2191\u2193"})," ",jsx(Text,{bold:true,color:e.gray,children:"Tab"}),"/",jsx(Text,{bold:true,color:e.gray,children:"\u2190\u2192"})," ",jsx(Text,{bold:true,color:e.gray,children:"/"})," cmd",b&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"N"})," new"]}),f&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"R"})," run"]}),y&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.amber,children:"C"})," cancel"]}),T&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.green,children:"A"})," approve"]}),x&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.red,children:"X"})," reject"]}),B&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.cyan,children:"E"})," edit"]}),k&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.red,children:"S"})," stop"]}),F&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.amber,children:"P"}),P?" resume":" pause"]}),H&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.cyan,children:"U"}),V?" auto off":" auto on"]}),j&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"S"}),L?" collapse":" show all"]}),C&&!T&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"D"})," delete"]}),M&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.yellow,children:"Z"})," undo"]}),O&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"Esc"})," close"]}),!O&&(l==="tasks"||l==="agents"||l==="goals")&&jsxs(Fragment,{children:[" ",jsx(Text,{bold:true,color:e.gray,children:"Enter"})," detail"]})," ",jsx(Text,{bold:true,color:e.gray,children:"Q"})," quit"," ",jsx(Text,{bold:true,color:X===false?e.amber:e.gray,children:"?"}),jsx(Text,{color:X===false?e.amber:void 0,children:" help"})]}),N>0&&jsxs(Text,{color:e.dim,children:[N," ",E]})]})});var Bn="\u2588",Mr=process.platform==="darwin"?"\u2318":"Ctrl";function Pl(t,o){if(o<=0||t.length<=o)return [t];let n=[];for(let r=0;r<t.length;r+=o)n.push(t.slice(r,r+o));return n}function En(t,o){if(o<=0)return 0;let n=o-1;for(;n>0&&t[n-1]===" ";)n--;for(;n>0&&t[n-1]!==" ";)n--;return n}function Hs(t,o){if(o>=t.length)return t.length;let n=o;for(;n<t.length&&t[n]!==" ";)n++;for(;n<t.length&&t[n]===" ";)n++;return n}function js({title:t,steps:o,onComplete:n,onCancel:r,width:l,height:f,onPasteImage:b,footerExtra:T,onSuggestionSelected:x}){let [y,C]=useState(0),[M,B]=useState({}),[k,H]=useState(()=>{let A=o.find(S=>!S.skip?.({}));return A?.type==="text"&&A.defaultValue?A.defaultValue:""}),[V,F]=useState(()=>{let A=o.find(S=>!S.skip?.({}));return A?.type==="text"&&A.defaultValue?A.defaultValue.length:0}),[P,j]=useState(()=>{let A=o.find(S=>!S.skip?.({}));return A?.type==="textarea"&&A.defaultValue?A.defaultValue.split(`
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {j,o,l,q,d,h,m}from'./chunk-64WUDYEM.js';function T(y,n){let l$1=y.command("agent").description("Manage agents");l$1.command("add <name>").description("Add a new agent").requiredOption("--adapter <adapter>","Adapter type: claude, opencode, codex, cursor, shell").option("--role <role>","Agent role description").option("--command <cmd>","Shell command (for shell adapter)").option("--model <model>","Model name (for AI adapters)").option("--max-turns <n>","Max turns per run").option("--timeout <ms>","Timeout in ms").option("--approval-policy <policy>","suggest|auto|manual").option("--workspace-mode <mode>","shared|worktree|isolated").option("--skills <skills>","Comma-separated list of agent skills").option("-e, --edit","Open $EDITOR to write the role description").action(async(o$1,e)=>{let i=e.role;if(e.edit){let{openInEditor:t,agentToEditorContent:s,agentFromEditorContent:u}=await import('./editor-7IFRWVTL.js'),g=s({name:o$1,model:e.model,role:i}),d=await t(g),c=u(d);c.name&&(o$1=c.name),c.model&&(e.model=c.model),c.role&&(i=c.role);}let a=await n.agentService.create({name:o$1,adapter:e.adapter,role:i,command:e.command,model:e.model,max_turns:e.maxTurns?parseInt(e.maxTurns,10):void 0,timeout_ms:e.timeout?parseInt(e.timeout,10):void 0,approval_policy:e.approvalPolicy,workspace_mode:e.workspaceMode,skills:e.skills?e.skills.split(",").map(t=>t.trim()):void 0});n.context.json?console.log(JSON.stringify(a,null,2)):n.context.quiet?console.log(a.id):j(`Added agent ${o(a.name)} (${a.adapter}) \u2192 ${a.id}`);}),l$1.command("shop").description("Browse and install pre-built agent templates").option("--list","Print all templates (non-interactive)").action(async o$1=>{let{AGENT_SHOP_TEMPLATES:e}=await import('./agent-shop-D2RS4BZK.js');if(o$1.list||!process.stdout.isTTY){l(["Key","Name","Adapter","Model","Skills"],e.map(s=>[s.key,s.name,s.adapter,s.model.replace("claude-",""),s.skills.slice(0,2).join(", ")]));return}let{pickFromShop:i}=await import('./shop-picker-LE3SKFOX.js'),a=await i(e);if(!a){console.log(" Cancelled.");return}let t=await n.agentService.create({name:a.name,adapter:a.adapter,model:a.model,role:a.role,skills:a.skills,approval_policy:a.approval_policy});j(`Added agent ${o(t.name)} (${t.adapter}) \u2192 ${t.id}`);}),l$1.command("list").description("List all agents").action(async()=>{let o$1=await n.agentService.list();if(n.context.json){console.log(JSON.stringify(o$1,null,2));return}if(n.context.quiet){o$1.forEach(t=>console.log(t.id));return}if(o$1.length===0){console.log(`
2
+ import {j,o,l,q,d,h,m}from'./chunk-64WUDYEM.js';function T(y,n){let l$1=y.command("agent").description("Manage agents");l$1.command("add <name>").description("Add a new agent").requiredOption("--adapter <adapter>","Adapter type: claude, opencode, codex, cursor, shell").option("--role <role>","Agent role description").option("--command <cmd>","Shell command (for shell adapter)").option("--model <model>","Model name (for AI adapters)").option("--max-turns <n>","Max turns per run").option("--timeout <ms>","Timeout in ms").option("--approval-policy <policy>","suggest|auto|manual").option("--workspace-mode <mode>","shared|worktree|isolated").option("--skills <skills>","Comma-separated list of agent skills").option("-e, --edit","Open $EDITOR to write the role description").action(async(o$1,e)=>{let i=e.role;if(e.edit){let{openInEditor:t,agentToEditorContent:s,agentFromEditorContent:u}=await import('./editor-7IFRWVTL.js'),g=s({name:o$1,model:e.model,role:i}),d=await t(g),c=u(d);c.name&&(o$1=c.name),c.model&&(e.model=c.model),c.role&&(i=c.role);}let a=await n.agentService.create({name:o$1,adapter:e.adapter,role:i,command:e.command,model:e.model,max_turns:e.maxTurns?parseInt(e.maxTurns,10):void 0,timeout_ms:e.timeout?parseInt(e.timeout,10):void 0,approval_policy:e.approvalPolicy,workspace_mode:e.workspaceMode,skills:e.skills?e.skills.split(",").map(t=>t.trim()):void 0});n.context.json?console.log(JSON.stringify(a,null,2)):n.context.quiet?console.log(a.id):j(`Added agent ${o(a.name)} (${a.adapter}) \u2192 ${a.id}`);}),l$1.command("shop").description("Browse and install pre-built agent templates").option("--list","Print all templates (non-interactive)").action(async o$1=>{let{AGENT_SHOP_TEMPLATES:e}=await import('./agent-shop-JHDTCWCD.js');if(o$1.list||!process.stdout.isTTY){l(["Key","Name","Adapter","Model","Skills"],e.map(s=>[s.key,s.name,s.adapter,s.model.replace("claude-",""),s.skills.slice(0,2).join(", ")]));return}let{pickFromShop:i}=await import('./shop-picker-LE3SKFOX.js'),a=await i(e);if(!a){console.log(" Cancelled.");return}let t=await n.agentService.create({name:a.name,adapter:a.adapter,model:a.model,role:a.role,skills:a.skills,approval_policy:a.approval_policy});j(`Added agent ${o(t.name)} (${t.adapter}) \u2192 ${t.id}`);}),l$1.command("list").description("List all agents").action(async()=>{let o$1=await n.agentService.list();if(n.context.json){console.log(JSON.stringify(o$1,null,2));return}if(n.context.quiet){o$1.forEach(t=>console.log(t.id));return}if(o$1.length===0){console.log(`
3
3
  No agents. Add one: ${q("orch agent add <name> --adapter claude")}
4
4
  `);return}let e=["STATUS","AGENT","ADAPTER","TASK","TIME"],i=o$1.map(t=>[`${d(t.status)} ${t.status}`,o(t.name),t.adapter,t.current_task??q("\u2014"),q("\u2014")]);console.log(),l(e,i);let a=o$1.filter(t=>t.status==="running").length;console.log(`
5
5
  ${o$1.length} agents \xB7 ${a} running \xB7 ${h(o$1.reduce((t,s)=>t+(s.stats.tokens_used??0),0))} tokens total
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{a as AGENT_SHOP_TEMPLATES,b as getShopTemplateByKey}from'./chunk-BCPUTULS.js';
2
+ export{a as AGENT_SHOP_TEMPLATES,b as getShopTemplateByKey}from'./chunk-HWEMBO36.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import {k}from'./chunk-ZMLF5HI5.js';import {b}from'./chunk-IKNBPOQL.js';import t from'path';import {accessSync}from'fs';var l=".orchestry",j=/^[A-Za-z0-9._-]+$/,h=class{constructor(r){this.projectRoot=r;}get root(){return t.join(this.projectRoot,l)}get configPath(){return t.join(this.root,"config.yml")}get statePath(){return t.join(this.root,"state.json")}get lockPath(){return t.join(this.root,"orchestry.lock")}get tasksDir(){return t.join(this.root,"tasks")}get agentsDir(){return t.join(this.root,"agents")}get runsDir(){return t.join(this.root,"runs")}get templatesDir(){return t.join(this.root,"templates")}get logsDir(){return t.join(this.root,"logs")}get contextDir(){return t.join(this.root,"context")}contextPath(r){return t.join(this.contextDir,`${s(r)}.json`)}get messagesDir(){return t.join(this.root,"messages")}messagePath(r){return t.join(this.messagesDir,`${s(r)}.json`)}get goalsDir(){return t.join(this.root,"goals")}goalPath(r){return t.join(this.goalsDir,`${s(r)}.yml`)}get teamsDir(){return t.join(this.root,"teams")}get attachmentsDir(){return t.join(this.root,"attachments")}taskAttachmentsDir(r){return t.join(this.attachmentsDir,s(r))}teamPath(r){return t.join(this.teamsDir,`${s(r)}.yml`)}get gitignorePath(){return t.join(this.root,".gitignore")}get workspaceExcludePath(){return t.join(this.root,"workspace-exclude")}taskPath(r){return t.join(this.tasksDir,`${s(r)}.yml`)}agentPath(r){return t.join(this.agentsDir,`${s(r)}.yml`)}runPath(r){return t.join(this.runsDir,`${s(r)}.json`)}runEventsPath(r){return t.join(this.runsDir,`${s(r)}.jsonl`)}defaultTemplatePath(){return t.join(this.templatesDir,"default.md")}async isInitialized(){return k(this.root)}async requireInit(){if(!await this.isInitialized())throw new b}};function s(n){if(!j.test(n))throw new Error(`Invalid identifier: "${n}"`);return n}function f(n,r){let o=t.resolve(n),i=t.resolve(r);if(!o.startsWith(i+t.sep)&&o!==i)throw new Error(`Workspace path "${n}" is outside project root`)}var e=new Map;function P(n=process.cwd()){let r=t.resolve(n),o=e.get(r);if(o!==void 0)return o;let i=r,c=t.parse(i).root;for(;i!==c;){try{return accessSync(t.join(i,".orchestry")),e.set(r,i),i}catch{}i=t.dirname(i);}return e.set(r,r),r}export{l as a,h as b,s as c,f as d,P as e};
@@ -4,11 +4,11 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
4
4
  ## WORKFLOW
5
5
 
6
6
  1) READ the task description and identify the scope: new endpoint, service refactor, DB migration, etc.
7
- 2) EXPLORE the existing codebase with \`/code-explorer\` to understand project structure, conventions, and dependencies.
7
+ 2) EXPLORE the existing codebase to understand project structure, conventions, and dependencies.
8
8
  3) DESIGN the solution \u2014 define data models, API contracts, and error handling strategy. For non-trivial changes, outline the plan in a context message before coding.
9
- 4) IMPLEMENT using \`/feature-dev\` \u2014 write production code following the project's patterns (naming, folder structure, error classes).
9
+ 4) IMPLEMENT \u2014 write production code following the project's patterns (naming, folder structure, error classes).
10
10
  5) WRITE TESTS \u2014 add unit tests for new logic; ensure edge cases and error paths are covered.
11
- 6) SELF-REVIEW \u2014 re-read the diff, check for hardcoded secrets, missing input validation, and N+1 queries.
11
+ 6) SELF-REVIEW \u2014 use the review skill methodology to check your own diff for security issues, N+1 queries, and missing validation.
12
12
  7) MARK DONE \u2014 commit to your worktree branch and transition the task to review.
13
13
 
14
14
  ## RULES
@@ -23,12 +23,12 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
23
23
  ## WORKFLOW
24
24
 
25
25
  1) READ the task and identify the deliverable: new component, page, style fix, responsive layout, etc.
26
- 2) EXPLORE the component tree and design system with \`/code-explorer\` to find reusable primitives and naming conventions.
26
+ 2) EXPLORE the component tree and design system to find reusable primitives and naming conventions.
27
27
  3) PLAN the component hierarchy \u2014 props interface, state management, and data flow.
28
- 4) IMPLEMENT using \`/feature-dev\` \u2014 write components with proper TypeScript types, accessibility attributes, and responsive styles.
28
+ 4) IMPLEMENT \u2014 write components with proper TypeScript types, accessibility attributes, and responsive styles.
29
29
  5) STYLE \u2014 use the project's CSS approach (modules, Tailwind, styled-components) consistently. Check mobile, tablet, desktop breakpoints.
30
30
  6) TEST \u2014 add component tests for rendering, user interactions, and edge states (loading, empty, error).
31
- 7) REVIEW your diff visually if possible with \`/frontend-design\`, then transition to review.
31
+ 7) SELF-REVIEW \u2014 use the design-review skill to check accessibility, responsiveness, and visual consistency, then transition to review.
32
32
 
33
33
  ## RULES
34
34
 
@@ -39,14 +39,17 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
39
39
  - Never hardcode colors or spacing \u2014 use design tokens / theme variables.
40
40
  - Ensure keyboard navigation and ARIA labels for interactive elements.`,i=`QA engineer \u2014 writes tests, analyzes coverage, and ensures code quality across the project.
41
41
 
42
+ Uses the \`qa\` library skill for full QA methodology including browser testing, health scoring, bug triage, and fix loops. For report-only mode without auto-fixes, add \`qa-only\` skill instead.
43
+
42
44
  ## WORKFLOW
43
45
 
44
46
  1) READ the task \u2014 determine what needs testing: new feature, regression, coverage gap, flaky test.
45
- 2) ANALYZE existing coverage with \`/test-coverage\` to identify untested paths and weak spots.
47
+ 2) ANALYZE existing coverage to identify untested paths and weak spots.
46
48
  3) PLAN the test matrix \u2014 list scenarios, edge cases, error paths, and boundary values.
47
- 4) WRITE TESTS using \`/generate-tests\` \u2014 unit tests for logic, integration tests for services, e2e for critical flows.
48
- 5) RUN the test suite and verify all new tests pass. Fix flaky tests if discovered.
49
- 6) REPORT \u2014 summarize coverage delta and any risks found during testing. Set context for the team.
49
+ 4) EXECUTE QA \u2014 follow the qa skill's phased approach: orient, explore, document, triage, fix, verify.
50
+ 5) WRITE TESTS \u2014 unit tests for logic, integration tests for services, e2e for critical flows.
51
+ 6) RUN the test suite and verify all new tests pass. Fix flaky tests if discovered.
52
+ 7) REPORT \u2014 generate a QA report with health score, coverage delta, and risks.
50
53
 
51
54
  ## RULES
52
55
 
@@ -55,20 +58,21 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
55
58
  - Never test implementation details \u2014 test behavior and contracts.
56
59
  - Mock external dependencies at the boundary, not deep inside the code.
57
60
  - Coverage targets: aim for >80% line coverage on new code, >90% on critical paths.
58
- - Flag any untestable code as a design smell and suggest refactoring.`,o=`Senior code reviewer \u2014 performs thorough PR reviews focused on correctness, security, maintainability, and adherence to project standards.
61
+ - Flag any untestable code as a design smell and suggest refactoring.`,r=`Senior code reviewer \u2014 performs thorough PR reviews focused on correctness, security, maintainability, and adherence to project standards.
62
+
63
+ Uses the \`review\` library skill for structured two-pass review (Critical + Informational), auto-fix workflow, TODOS cross-reference, doc staleness checking, and adversarial review scaled by diff size.
59
64
 
60
65
  ## WORKFLOW
61
66
 
62
67
  1) READ the task and the diff \u2014 understand the intent of the change, not just the code.
63
- 2) EXPLORE context with \`/code-explorer\` \u2014 check how the changed code integrates with the rest of the system.
64
- 3) REVIEW systematically using \`/code-reviewer\`:
65
- a) Correctness \u2014 does the logic match the requirements? Are edge cases handled?
66
- b) Security \u2014 input validation, injection risks, auth checks, secret exposure.
67
- c) Performance \u2014 unnecessary allocations, missing indexes, O(n^2) where O(n) is possible.
68
- d) Maintainability \u2014 naming clarity, function length, single responsibility, test coverage.
69
- e) Conventions \u2014 project style, naming, import order, error handling patterns.
68
+ 2) EXPLORE context \u2014 check how the changed code integrates with the rest of the system.
69
+ 3) REVIEW \u2014 follow the review skill's multi-step methodology:
70
+ a) Scope drift detection \u2014 did they build what was requested?
71
+ b) Two-pass review: Critical issues first, then Informational.
72
+ c) Fix-First approach \u2014 auto-fix what you can, batch-ask the rest.
73
+ d) Adversarial review \u2014 auto-scaled by diff size (small/medium/large).
70
74
  4) WRITE FEEDBACK \u2014 be specific, cite line numbers, suggest concrete fixes. Distinguish blockers from nits.
71
- 5) DECIDE \u2014 approve, request changes, or flag for architect review if the design needs discussion.
75
+ 5) DECIDE \u2014 approve, request changes, or flag for architect review.
72
76
 
73
77
  ## RULES
74
78
 
@@ -77,16 +81,20 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
77
81
  - Never approve code with known security issues, even if the task is urgent.
78
82
  - Be respectful \u2014 critique code, not the author.
79
83
  - If the change is too large to review safely, request it be split.
80
- - Check that tests exist for new logic; flag untested paths.`,r=`Software architect and technical leader \u2014 makes system-level design decisions, defines architecture, and ensures technical coherence across the project.
84
+ - Check that tests exist for new logic; flag untested paths.`,o=`Software architect and technical leader \u2014 makes system-level design decisions, defines architecture, and ensures technical coherence across the project.
85
+
86
+ Uses \`plan-eng-review\` for structured engineering review of technical plans, and \`office-hours\` for YC-style product thinking before major decisions.
81
87
 
82
88
  ## WORKFLOW
83
89
 
84
90
  1) READ the task \u2014 understand the architectural question: new system, scaling challenge, tech debt, migration.
85
- 2) EXPLORE the full codebase with \`/code-explorer\` and \`/code-architect\` to map dependencies, layers, and boundaries.
86
- 3) ANALYZE trade-offs \u2014 document at least two alternative approaches with pros/cons for each.
87
- 4) DESIGN the solution \u2014 define component boundaries, data flow, API contracts, and failure modes.
88
- 5) DOCUMENT the decision \u2014 write an ADR (Architecture Decision Record) or design doc explaining the chosen approach and rejected alternatives.
89
- 6) COMMUNICATE \u2014 set context for the team explaining the architectural direction and constraints.
91
+ 2) EXPLORE the full codebase to map dependencies, layers, and boundaries.
92
+ 3) THINK \u2014 use the office-hours skill to challenge premises and explore alternatives before committing to a direction.
93
+ 4) ANALYZE trade-offs \u2014 document at least two alternative approaches with pros/cons for each.
94
+ 5) DESIGN the solution \u2014 define component boundaries, data flow, API contracts, and failure modes.
95
+ 6) REVIEW \u2014 use plan-eng-review to validate the technical plan against engineering standards.
96
+ 7) DOCUMENT the decision \u2014 write an ADR explaining the chosen approach and rejected alternatives.
97
+ 8) COMMUNICATE \u2014 set context for the team explaining the architectural direction and constraints.
90
98
 
91
99
  ## RULES
92
100
 
@@ -98,14 +106,18 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
98
106
  - Think in interfaces first, implementations second.
99
107
  - Flag technical debt explicitly; don't let it accumulate silently.`,s=`DevOps engineer \u2014 manages CI/CD pipelines, infrastructure, deployment automation, and cloud configuration.
100
108
 
109
+ Uses \`ship\` for automated deployment pipelines and \`canary\` for post-deploy monitoring. For production deployment verification, add \`land-and-deploy\` skill to the agent when needed.
110
+
101
111
  ## WORKFLOW
102
112
 
103
113
  1) READ the task \u2014 identify the scope: pipeline fix, infra provisioning, deployment config, monitoring setup.
104
- 2) EXPLORE current infrastructure and CI/CD config with \`/code-explorer\` to understand the existing setup.
105
- 3) DESIGN the change using \`/cloud-architect\` \u2014 plan the infrastructure or pipeline modification with rollback strategy.
114
+ 2) EXPLORE current infrastructure and CI/CD config to understand the existing setup.
115
+ 3) DESIGN the change \u2014 plan the infrastructure or pipeline modification with rollback strategy.
106
116
  4) IMPLEMENT \u2014 write IaC (Terraform, CloudFormation, Docker, K8s manifests) or pipeline configs (GitHub Actions, GitLab CI).
107
117
  5) VALIDATE \u2014 dry-run or plan the change; verify no destructive modifications to production resources.
108
- 6) DOCUMENT \u2014 update runbooks, env variable lists, and deployment docs.
118
+ 6) DEPLOY \u2014 use the ship skill for structured deployment with health checks.
119
+ 7) MONITOR \u2014 use canary skill for post-deploy verification.
120
+ 8) DOCUMENT \u2014 update runbooks, env variable lists, and deployment docs.
109
121
 
110
122
  ## RULES
111
123
 
@@ -117,15 +129,21 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
117
129
  - Prefer declarative config over imperative scripts.
118
130
  - Monitor cost implications of infrastructure changes.`,c=`Bug hunter \u2014 finds, reproduces, and diagnoses bugs through systematic investigation and proposes minimal fixes.
119
131
 
132
+ Uses the \`investigate\` library skill for structured debugging with root cause methodology, 3-strike hypothesis testing, scope lock, and 5-file blast radius check.
133
+
120
134
  ## WORKFLOW
121
135
 
122
- 1) READ the bug report or task description \u2014 extract symptoms, reproduction steps, and expected behavior.
123
- 2) EXPLORE the relevant code with \`/code-explorer\` \u2014 trace the execution path from input to the faulty output.
136
+ 1) READ the bug report \u2014 extract symptoms, reproduction steps, and expected behavior.
137
+ 2) INVESTIGATE \u2014 follow the investigate skill's phased approach:
138
+ a) Collect symptoms and trace the execution path.
139
+ b) Scope lock \u2014 freeze edits to the affected module.
140
+ c) Form hypotheses and test them (3-strike rule).
141
+ d) Implement minimal fix with regression test.
142
+ e) Verify with 5-file blast radius check.
124
143
  3) REPRODUCE \u2014 write a failing test that captures the bug before attempting any fix.
125
- 4) DIAGNOSE \u2014 identify the root cause, not just the symptom. Check for related occurrences of the same pattern.
126
- 5) FIX with \`/feature-dev\` \u2014 apply the minimal change that resolves the root cause. Avoid collateral refactoring.
127
- 6) VERIFY \u2014 confirm the failing test now passes and no existing tests regress.
128
- 7) REPORT \u2014 set context explaining the root cause, the fix, and any related areas that may have the same issue.
144
+ 4) FIX \u2014 apply the minimal change that resolves the root cause. Avoid collateral refactoring.
145
+ 5) VERIFY \u2014 confirm the failing test now passes and no existing tests regress.
146
+ 6) REPORT \u2014 structured debug report explaining root cause, fix, and related areas.
129
147
 
130
148
  ## RULES
131
149
 
@@ -136,10 +154,12 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
136
154
  - Never suppress errors to hide bugs \u2014 surface them properly.
137
155
  - If the bug is in a dependency, document the workaround and file upstream.`,d=`Technical writer \u2014 creates and maintains documentation, READMEs, API references, guides, and inline code comments.
138
156
 
157
+ Uses \`document-release\` for automated post-ship documentation updates, ensuring docs stay in sync with code changes.
158
+
139
159
  ## WORKFLOW
140
160
 
141
161
  1) READ the task \u2014 determine the documentation need: new feature docs, API reference, migration guide, README update.
142
- 2) EXPLORE the codebase with \`/code-explorer\` to understand the feature, its API surface, configuration options, and edge cases.
162
+ 2) EXPLORE the codebase to understand the feature, its API surface, configuration options, and edge cases.
143
163
  3) OUTLINE the document structure \u2014 headings, sections, and key points to cover.
144
164
  4) WRITE using clear, concise language:
145
165
  - Lead with the most important information (inverted pyramid).
@@ -157,17 +177,20 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
157
177
  - Code examples must be complete and runnable \u2014 no pseudo-code in docs.
158
178
  - Never document internal implementation details in user-facing docs.`,l=`Marketing strategist \u2014 develops positioning, messaging, copy, and campaign strategies using marketing psychology principles.
159
179
 
180
+ Uses \`office-hours\` for product reframing and premise challenge before crafting positioning.
181
+
160
182
  ## WORKFLOW
161
183
 
162
184
  1) READ the task \u2014 identify the marketing objective: positioning, landing page copy, campaign plan, competitor analysis.
163
- 2) RESEARCH the product and market using \`/marketing-psychology\` \u2014 understand the target audience, pain points, and competitive landscape.
164
- 3) STRATEGIZE \u2014 define messaging pillars, value propositions, and differentiation angles.
165
- 4) CREATE the deliverable:
185
+ 2) THINK \u2014 use office-hours to challenge assumptions and reframe the product from the customer's perspective.
186
+ 3) RESEARCH the product and market \u2014 understand the target audience, pain points, and competitive landscape.
187
+ 4) STRATEGIZE \u2014 define messaging pillars, value propositions, and differentiation angles.
188
+ 5) CREATE the deliverable:
166
189
  - Copy: headlines, body text, CTAs \u2014 with A/B variants.
167
190
  - Strategy: channel plan, funnel stages, KPIs.
168
191
  - Analysis: competitive matrix, SWOT, positioning map.
169
- 5) REVIEW \u2014 check for clarity, consistency, and alignment with brand voice.
170
- 6) DELIVER \u2014 commit artifacts and set context with rationale for the chosen approach.
192
+ 6) REVIEW \u2014 check for clarity, consistency, and alignment with brand voice.
193
+ 7) DELIVER \u2014 commit artifacts and set context with rationale for the chosen approach.
171
194
 
172
195
  ## RULES
173
196
 
@@ -181,7 +204,7 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
181
204
  ## WORKFLOW
182
205
 
183
206
  1) READ the task \u2014 understand the content goal: thought leadership, tutorial, announcement, social post.
184
- 2) RESEARCH the topic using \`/marketing-psychology\` \u2014 gather key points, statistics, and angles that resonate with the target audience.
207
+ 2) RESEARCH the topic \u2014 gather key points, statistics, and angles that resonate with the target audience.
185
208
  3) OUTLINE the content structure \u2014 hook, key sections, CTA. For long-form, plan 3-5 main sections.
186
209
  4) WRITE the first draft:
187
210
  - Hook the reader in the first two sentences.
@@ -202,10 +225,10 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
202
225
  ## WORKFLOW
203
226
 
204
227
  1) READ the task \u2014 identify the growth lever: onboarding funnel, activation rate, retention loop, referral mechanism.
205
- 2) ANALYZE current metrics using \`/product-manager-toolkit\` \u2014 map the funnel, identify drop-off points, and size opportunities.
228
+ 2) ANALYZE current metrics \u2014 map the funnel, identify drop-off points, and size opportunities.
206
229
  3) HYPOTHESIZE \u2014 formulate a testable hypothesis: "If we [change X], then [metric Y] will improve by [Z%] because [reason]."
207
230
  4) DESIGN the experiment \u2014 define the test, control group, success metric, sample size, and duration.
208
- 5) IMPLEMENT \u2014 build the experiment (feature flag, A/B test, new flow) using \`/feature-dev\` if code changes are needed.
231
+ 5) IMPLEMENT \u2014 build the experiment (feature flag, A/B test, new flow) if code changes are needed.
209
232
  6) REPORT \u2014 document the experiment design, expected impact, and measurement plan.
210
233
 
211
234
  ## RULES
@@ -217,11 +240,13 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
217
240
  - Never ship a "growth hack" that degrades user experience long-term.
218
241
  - Document results of every experiment, including failures \u2014 they are data.`,h=`Security auditor \u2014 performs security analysis, identifies vulnerabilities, and recommends hardening measures following OWASP and industry best practices.
219
242
 
243
+ Uses the \`review\` skill for structured code review with security focus, and \`careful\`/\`guard\` skills for safety guardrails on destructive operations.
244
+
220
245
  ## WORKFLOW
221
246
 
222
247
  1) READ the task \u2014 determine the audit scope: full codebase review, specific feature, dependency check, or incident response.
223
- 2) EXPLORE the attack surface with \`/code-explorer\` \u2014 map entry points (APIs, forms, file uploads), auth boundaries, and data flows.
224
- 3) AUDIT systematically using \`/code-reviewer\`:
248
+ 2) EXPLORE the attack surface \u2014 map entry points (APIs, forms, file uploads), auth boundaries, and data flows.
249
+ 3) AUDIT systematically:
225
250
  a) OWASP Top 10 \u2014 injection, broken auth, XSS, CSRF, insecure deserialization.
226
251
  b) Dependency vulnerabilities \u2014 outdated packages, known CVEs.
227
252
  c) Secrets \u2014 hardcoded credentials, API keys in code or config.
@@ -240,17 +265,19 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
240
265
  - Recommend defense-in-depth \u2014 never rely on a single security control.
241
266
  - Flag any plaintext secrets immediately as Critical, even in test code.`,m=`Performance engineer \u2014 profiles, benchmarks, and optimizes code for speed, memory efficiency, and scalability.
242
267
 
268
+ Uses the \`benchmark\` library skill for structured performance benchmarking with before/after metrics, regression detection, and reporting.
269
+
243
270
  ## WORKFLOW
244
271
 
245
272
  1) READ the task \u2014 identify the performance concern: slow endpoint, high memory usage, scaling bottleneck, build time.
246
- 2) MEASURE first with \`/code-explorer\` \u2014 profile the current state, establish baseline metrics (latency, throughput, memory, CPU).
273
+ 2) MEASURE first \u2014 use the benchmark skill to profile the current state, establish baseline metrics (latency, throughput, memory, CPU).
247
274
  3) ANALYZE \u2014 identify hotspots, bottlenecks, and inefficient patterns. Look for:
248
275
  - O(n^2) or worse algorithms where O(n log n) or O(n) is possible.
249
276
  - Unnecessary allocations, memory leaks, missing cleanup.
250
277
  - N+1 queries, missing indexes, unoptimized joins.
251
278
  - Blocking I/O on the main thread, missing parallelism.
252
- 4) OPTIMIZE using \`/feature-dev\` \u2014 apply targeted fixes. One optimization per commit for clear attribution.
253
- 5) BENCHMARK \u2014 measure the improvement against the baseline. Report absolute numbers and percentage change.
279
+ 4) OPTIMIZE \u2014 apply targeted fixes. One optimization per commit for clear attribution.
280
+ 5) BENCHMARK \u2014 use the benchmark skill to measure improvement against baseline. Report absolute numbers and percentage change.
254
281
  6) DOCUMENT \u2014 set context with before/after metrics and explain the optimization rationale.
255
282
 
256
283
  ## RULES
@@ -265,9 +292,9 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
265
292
  ## WORKFLOW
266
293
 
267
294
  1) READ the task \u2014 identify the data need: new pipeline, query optimization, schema migration, analytics report.
268
- 2) EXPLORE existing data models and pipelines with \`/code-explorer\` to understand the current data architecture.
295
+ 2) EXPLORE existing data models and pipelines to understand the current data architecture.
269
296
  3) DESIGN the data flow \u2014 source, transformation steps, destination, error handling, and idempotency strategy.
270
- 4) IMPLEMENT using \`/feature-dev\`:
297
+ 4) IMPLEMENT:
271
298
  - Schema changes with migrations (never modify in place).
272
299
  - ETL logic with proper error handling and retry.
273
300
  - Queries optimized for the target database engine.
@@ -283,12 +310,14 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
283
310
  - Log pipeline metrics: rows processed, duration, error count.
284
311
  - Never run DELETE or UPDATE without a WHERE clause and a backup plan.`,f=`Full-stack developer \u2014 works across the entire stack, from database and API to UI components and styling.
285
312
 
313
+ Uses \`review\` for self-review of diffs before transitioning, and \`design-review\` for frontend visual consistency checks.
314
+
286
315
  ## WORKFLOW
287
316
 
288
317
  1) READ the task \u2014 identify scope: does it span backend and frontend, or is it a vertical slice of a feature?
289
- 2) EXPLORE both backend and frontend code with \`/code-explorer\` to understand existing patterns and data flow end-to-end.
318
+ 2) EXPLORE both backend and frontend code to understand existing patterns and data flow end-to-end.
290
319
  3) PLAN the implementation \u2014 define the API contract first (request/response shapes), then plan UI components that consume it.
291
- 4) IMPLEMENT BACKEND using \`/feature-dev\`:
320
+ 4) IMPLEMENT BACKEND:
292
321
  - Data model, validation, service logic, API endpoint.
293
322
  - Error handling with proper HTTP status codes and messages.
294
323
  5) IMPLEMENT FRONTEND:
@@ -296,7 +325,7 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
296
325
  - Loading, error, and empty states.
297
326
  - Responsive layout and accessibility.
298
327
  6) TEST \u2014 backend unit/integration tests + frontend component tests. Verify the full data flow works end-to-end.
299
- 7) REVIEW your own diff holistically \u2014 check that API contracts match between frontend and backend.
328
+ 7) SELF-REVIEW \u2014 use the review skill to check your own diff holistically before transitioning.
300
329
 
301
330
  ## RULES
302
331
 
@@ -305,4 +334,4 @@ var n=`Backend engineer \u2014 builds APIs, services, database layers, and serve
305
334
  - Keep frontend and backend changes in the same branch for atomic features.
306
335
  - Follow each layer's conventions independently \u2014 backend patterns for backend, frontend patterns for frontend.
307
336
  - Handle every error state in the UI \u2014 users should never see a blank screen.
308
- - If a task is too large to deliver end-to-end, split it and communicate the dependency.`,y=[{key:"backend-dev",name:"Backend Developer",description:"APIs, databases, backend services",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:n},{key:"frontend-dev",name:"Frontend Developer",description:"React, UI components, CSS, responsive design",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer","frontend-design"],role:a},{key:"qa-engineer",name:"QA Engineer",description:"Test writing, coverage analysis, quality assurance",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["testing-suite:generate-tests","testing-suite:test-coverage","testing-suite:test-quality-analyzer"],role:i},{key:"code-reviewer",name:"Code Reviewer",description:"PR review, bug finding, code quality, security",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-reviewer","feature-dev:code-explorer"],role:o},{key:"architect",name:"Architect",description:"System design, architecture decisions, tech leadership",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-architect","feature-dev:code-explorer"],role:r},{key:"devops-engineer",name:"DevOps Engineer",description:"CI/CD, infrastructure, deployment, cloud",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["devops-automation:cloud-architect","feature-dev:code-explorer"],role:s},{key:"bug-hunter",name:"Bug Hunter",description:"Find bugs, reproduce issues, propose fixes",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:c},{key:"tech-writer",name:"Technical Writer",description:"Documentation, READMEs, API docs, guides",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:code-explorer","docx"],role:d},{key:"marketer",name:"Marketer",description:"Marketing strategy, positioning, copy, campaigns",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["marketing-psychology","product-manager-toolkit"],role:l},{key:"content-creator",name:"Content Creator",description:"Blog posts, articles, social media content",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["marketing-psychology"],role:p},{key:"growth-hacker",name:"Growth Hacker",description:"Growth experiments, analytics, user acquisition",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["product-manager-toolkit","feature-dev:feature-dev"],role:u},{key:"security-auditor",name:"Security Auditor",description:"Security scanning, vulnerability analysis, OWASP",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-reviewer","feature-dev:code-explorer"],role:h},{key:"performance-engineer",name:"Performance Engineer",description:"Optimization, profiling, benchmarks, load testing",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:m},{key:"data-engineer",name:"Data Engineer",description:"Data pipelines, ETL, analytics, SQL",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:g},{key:"fullstack-dev",name:"Full-Stack Developer",description:"End-to-end development, frontend and backend",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer","frontend-design"],role:f}];function v(e){return y.find(t=>t.key===e)}export{y as a,v as b};
337
+ - If a task is too large to deliver end-to-end, split it and communicate the dependency.`,y=[{key:"backend-dev",name:"Backend Developer",description:"APIs, databases, backend services",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["review","careful","feature-dev:feature-dev","feature-dev:code-explorer"],role:n},{key:"frontend-dev",name:"Frontend Developer",description:"React, UI components, CSS, responsive design",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["design-review","review","feature-dev:feature-dev","feature-dev:code-explorer"],role:a},{key:"qa-engineer",name:"QA Engineer",description:"Test writing, coverage analysis, quality assurance, browser testing",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["qa","testing-suite:generate-tests","testing-suite:test-coverage"],role:i},{key:"code-reviewer",name:"Code Reviewer",description:"PR review with auto-fix, adversarial review, security checks",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["review","careful","feature-dev:code-reviewer","feature-dev:code-explorer"],role:r},{key:"architect",name:"Architect",description:"System design, architecture decisions, tech leadership",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["plan-eng-review","office-hours","feature-dev:code-architect","feature-dev:code-explorer"],role:o},{key:"devops-engineer",name:"DevOps Engineer",description:"CI/CD, infrastructure, deployment, monitoring",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["ship","canary","devops-automation:cloud-architect"],role:s},{key:"bug-hunter",name:"Bug Hunter",description:"Systematic debugging, root cause analysis, minimal fixes",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["investigate","careful","feature-dev:feature-dev","feature-dev:code-explorer"],role:c},{key:"tech-writer",name:"Technical Writer",description:"Documentation, READMEs, API docs, release notes",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["document-release","review","feature-dev:code-explorer"],role:d},{key:"marketer",name:"Marketer",description:"Marketing strategy, positioning, copy, campaigns",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["office-hours"],role:l},{key:"content-creator",name:"Content Creator",description:"Blog posts, articles, social media content",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["office-hours"],role:p},{key:"growth-hacker",name:"Growth Hacker",description:"Growth experiments, analytics, user acquisition",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["office-hours","feature-dev:feature-dev"],role:u},{key:"security-auditor",name:"Security Auditor",description:"Security scanning, vulnerability analysis, OWASP, guardrails",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["review","careful","guard","feature-dev:code-reviewer"],role:h},{key:"performance-engineer",name:"Performance Engineer",description:"Optimization, profiling, benchmarks, load testing",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["benchmark","investigate","feature-dev:feature-dev","feature-dev:code-explorer"],role:m},{key:"data-engineer",name:"Data Engineer",description:"Data pipelines, ETL, analytics, SQL",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["careful","feature-dev:feature-dev","feature-dev:code-explorer"],role:g},{key:"fullstack-dev",name:"Full-Stack Developer",description:"End-to-end development, frontend and backend",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["review","design-review","feature-dev:feature-dev","feature-dev:code-explorer"],role:f}];function v(e){return y.find(t=>t.key===e)}export{y as a,v as b};
@@ -0,0 +1,116 @@
1
+ import { pathExists } from './chunk-W3J7CURM.js';
2
+ import { NotInitializedError } from './chunk-NLQAJ7TW.js';
3
+ import path from 'path';
4
+ import 'fs';
5
+
6
+ var ORCHESTRY_DIR = ".orchestry";
7
+ var ID_PATTERN = /^[A-Za-z0-9._-]+$/;
8
+ var Paths = class {
9
+ constructor(projectRoot) {
10
+ this.projectRoot = projectRoot;
11
+ }
12
+ /** Root .orchestry/ directory */
13
+ get root() {
14
+ return path.join(this.projectRoot, ORCHESTRY_DIR);
15
+ }
16
+ get configPath() {
17
+ return path.join(this.root, "config.yml");
18
+ }
19
+ get statePath() {
20
+ return path.join(this.root, "state.json");
21
+ }
22
+ get lockPath() {
23
+ return path.join(this.root, "orchestry.lock");
24
+ }
25
+ get tasksDir() {
26
+ return path.join(this.root, "tasks");
27
+ }
28
+ get agentsDir() {
29
+ return path.join(this.root, "agents");
30
+ }
31
+ get runsDir() {
32
+ return path.join(this.root, "runs");
33
+ }
34
+ get templatesDir() {
35
+ return path.join(this.root, "templates");
36
+ }
37
+ get logsDir() {
38
+ return path.join(this.root, "logs");
39
+ }
40
+ get contextDir() {
41
+ return path.join(this.root, "context");
42
+ }
43
+ contextPath(key) {
44
+ return path.join(this.contextDir, `${sanitizeId(key)}.json`);
45
+ }
46
+ get messagesDir() {
47
+ return path.join(this.root, "messages");
48
+ }
49
+ messagePath(id) {
50
+ return path.join(this.messagesDir, `${sanitizeId(id)}.json`);
51
+ }
52
+ get goalsDir() {
53
+ return path.join(this.root, "goals");
54
+ }
55
+ goalPath(id) {
56
+ return path.join(this.goalsDir, `${sanitizeId(id)}.yml`);
57
+ }
58
+ get teamsDir() {
59
+ return path.join(this.root, "teams");
60
+ }
61
+ get attachmentsDir() {
62
+ return path.join(this.root, "attachments");
63
+ }
64
+ taskAttachmentsDir(taskId) {
65
+ return path.join(this.attachmentsDir, sanitizeId(taskId));
66
+ }
67
+ teamPath(id) {
68
+ return path.join(this.teamsDir, `${sanitizeId(id)}.yml`);
69
+ }
70
+ get gitignorePath() {
71
+ return path.join(this.root, ".gitignore");
72
+ }
73
+ get workspaceExcludePath() {
74
+ return path.join(this.root, "workspace-exclude");
75
+ }
76
+ taskPath(id) {
77
+ return path.join(this.tasksDir, `${sanitizeId(id)}.yml`);
78
+ }
79
+ agentPath(id) {
80
+ return path.join(this.agentsDir, `${sanitizeId(id)}.yml`);
81
+ }
82
+ runPath(id) {
83
+ return path.join(this.runsDir, `${sanitizeId(id)}.json`);
84
+ }
85
+ runEventsPath(id) {
86
+ return path.join(this.runsDir, `${sanitizeId(id)}.jsonl`);
87
+ }
88
+ defaultTemplatePath() {
89
+ return path.join(this.templatesDir, "default.md");
90
+ }
91
+ async isInitialized() {
92
+ return pathExists(this.root);
93
+ }
94
+ async requireInit() {
95
+ if (!await this.isInitialized()) {
96
+ throw new NotInitializedError();
97
+ }
98
+ }
99
+ };
100
+ function sanitizeId(id) {
101
+ if (!ID_PATTERN.test(id)) {
102
+ throw new Error(`Invalid identifier: "${id}"`);
103
+ }
104
+ return id;
105
+ }
106
+ function validateWorkspacePath(workspacePath, projectRoot) {
107
+ const resolved = path.resolve(workspacePath);
108
+ const root = path.resolve(projectRoot);
109
+ if (!resolved.startsWith(root + path.sep) && resolved !== root) {
110
+ throw new Error(`Workspace path "${workspacePath}" is outside project root`);
111
+ }
112
+ }
113
+
114
+ export { Paths, sanitizeId, validateWorkspacePath };
115
+ //# sourceMappingURL=chunk-J7ITYXE6.js.map
116
+ //# sourceMappingURL=chunk-J7ITYXE6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/infrastructure/storage/paths.ts"],"names":[],"mappings":"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","file":"chunk-J7ITYXE6.js","sourcesContent":["/**\n * Path resolution for .orchestry/ directory.\n *\n * All path construction goes through this module.\n * Validates initialization state and sanitizes identifiers.\n */\n\nimport path from 'node:path';\nimport { accessSync } from 'node:fs';\nimport { NotInitializedError } from '../../domain/errors.js';\nimport { pathExists } from './fs-utils.js';\n\nexport const ORCHESTRY_DIR = '.orchestry';\nconst ID_PATTERN = /^[A-Za-z0-9._-]+$/;\n\nexport class Paths {\n constructor(private readonly projectRoot: string) {}\n\n /** Root .orchestry/ directory */\n get root(): string {\n return path.join(this.projectRoot, ORCHESTRY_DIR);\n }\n\n get configPath(): string {\n return path.join(this.root, 'config.yml');\n }\n\n get statePath(): string {\n return path.join(this.root, 'state.json');\n }\n\n get lockPath(): string {\n return path.join(this.root, 'orchestry.lock');\n }\n\n get tasksDir(): string {\n return path.join(this.root, 'tasks');\n }\n\n get agentsDir(): string {\n return path.join(this.root, 'agents');\n }\n\n get runsDir(): string {\n return path.join(this.root, 'runs');\n }\n\n get templatesDir(): string {\n return path.join(this.root, 'templates');\n }\n\n get logsDir(): string {\n return path.join(this.root, 'logs');\n }\n\n get contextDir(): string {\n return path.join(this.root, 'context');\n }\n\n contextPath(key: string): string {\n return path.join(this.contextDir, `${sanitizeId(key)}.json`);\n }\n\n get messagesDir(): string {\n return path.join(this.root, 'messages');\n }\n\n messagePath(id: string): string {\n return path.join(this.messagesDir, `${sanitizeId(id)}.json`);\n }\n\n get goalsDir(): string {\n return path.join(this.root, 'goals');\n }\n\n goalPath(id: string): string {\n return path.join(this.goalsDir, `${sanitizeId(id)}.yml`);\n }\n\n get teamsDir(): string {\n return path.join(this.root, 'teams');\n }\n\n get attachmentsDir(): string {\n return path.join(this.root, 'attachments');\n }\n\n taskAttachmentsDir(taskId: string): string {\n return path.join(this.attachmentsDir, sanitizeId(taskId));\n }\n\n teamPath(id: string): string {\n return path.join(this.teamsDir, `${sanitizeId(id)}.yml`);\n }\n\n get gitignorePath(): string {\n return path.join(this.root, '.gitignore');\n }\n\n get workspaceExcludePath(): string {\n return path.join(this.root, 'workspace-exclude');\n }\n\n taskPath(id: string): string {\n return path.join(this.tasksDir, `${sanitizeId(id)}.yml`);\n }\n\n agentPath(id: string): string {\n return path.join(this.agentsDir, `${sanitizeId(id)}.yml`);\n }\n\n runPath(id: string): string {\n return path.join(this.runsDir, `${sanitizeId(id)}.json`);\n }\n\n runEventsPath(id: string): string {\n return path.join(this.runsDir, `${sanitizeId(id)}.jsonl`);\n }\n\n defaultTemplatePath(): string {\n return path.join(this.templatesDir, 'default.md');\n }\n\n async isInitialized(): Promise<boolean> {\n return pathExists(this.root);\n }\n\n async requireInit(): Promise<void> {\n if (!(await this.isInitialized())) {\n throw new NotInitializedError();\n }\n }\n}\n\n/**\n * Validate an identifier for use in file paths.\n * Only allows [A-Za-z0-9._-] characters.\n * Rejects identifiers containing forbidden characters (path separators, etc.)\n * to prevent path traversal attacks.\n */\nexport function sanitizeId(id: string): string {\n if (!ID_PATTERN.test(id)) {\n throw new Error(`Invalid identifier: \"${id}\"`);\n }\n return id;\n}\n\n/**\n * Validate that a workspace path is within the project root.\n * Prevents path traversal attacks.\n */\nexport function validateWorkspacePath(workspacePath: string, projectRoot: string): void {\n const resolved = path.resolve(workspacePath);\n const root = path.resolve(projectRoot);\n\n if (!resolved.startsWith(root + path.sep) && resolved !== root) {\n throw new Error(`Workspace path \"${workspacePath}\" is outside project root`);\n }\n}\n\n/**\n * Module-level cache for findProjectRoot().\n * Key: resolved startDir, Value: found project root.\n * Avoids repeated accessSync() traversals on every CLI invocation.\n */\nconst projectRootCache = new Map<string, string>();\n\n/**\n * Resolve project root by walking up from cwd looking for .orchestry/.\n * Returns cwd if not found (for init command).\n *\n * Results are cached per startDir to avoid redundant filesystem traversals.\n */\nexport function findProjectRoot(startDir: string = process.cwd()): string {\n const resolvedStart = path.resolve(startDir);\n const cached = projectRootCache.get(resolvedStart);\n if (cached !== undefined) return cached;\n\n let dir = resolvedStart;\n const root = path.parse(dir).root;\n\n while (dir !== root) {\n try {\n accessSync(path.join(dir, '.orchestry'));\n projectRootCache.set(resolvedStart, dir);\n return dir;\n } catch {\n // Not found, go up\n }\n dir = path.dirname(dir);\n }\n\n // Not found — return resolved dir (for init command)\n projectRootCache.set(resolvedStart, resolvedStart);\n return resolvedStart;\n}\n\n/**\n * Clear the findProjectRoot cache.\n * Useful in tests or after `orch init` changes the project structure.\n */\nexport function clearProjectRootCache(): void {\n projectRootCache.clear();\n}\n"]}
@@ -1042,6 +1042,16 @@ Agent role: ${role}` : `Autonomous work cycle. Agent role: ${role}`;
1042
1042
  systemPrompt = await this.deps.templateEngine.render(systemTemplate, context);
1043
1043
  prompt = await this.deps.templateEngine.render(userTemplate, context);
1044
1044
  }
1045
+ if (this.deps.skillLoader && agent.config.skills?.length) {
1046
+ const skillBlock = await this.deps.skillLoader.loadSkills(agent.config.skills);
1047
+ if (skillBlock) {
1048
+ if (systemPrompt !== void 0) {
1049
+ systemPrompt = systemPrompt + "\n\n" + skillBlock;
1050
+ } else {
1051
+ prompt = prompt + "\n\n" + skillBlock;
1052
+ }
1053
+ }
1054
+ }
1045
1055
  const run = await this.deps.runService.create({
1046
1056
  taskId: task.id,
1047
1057
  agentId: agent.id,
@@ -1619,5 +1629,5 @@ function serializeEventData(data, maxLen) {
1619
1629
  }
1620
1630
 
1621
1631
  export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus };
1622
- //# sourceMappingURL=chunk-4TDXD3LA.js.map
1623
- //# sourceMappingURL=chunk-4TDXD3LA.js.map
1632
+ //# sourceMappingURL=chunk-SWNSNPBO.js.map
1633
+ //# sourceMappingURL=chunk-SWNSNPBO.js.map