agentix-cli 0.78.0 → 0.79.0

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 (111) hide show
  1. package/dist/{App-UNWLWLH5.js → App-NZQQXETO.js} +2 -2
  2. package/dist/{ChatApp-UBSOVFRK.js → ChatApp-CSVN3PRK.js} +2 -2
  3. package/dist/{agent-XWWWL5RV.js → agent-RTZDVG5B.js} +2 -2
  4. package/dist/{board-dashboard-ABEIELBC.js → board-dashboard-SI5GP3XR.js} +4 -4
  5. package/dist/{board-dashboard-ABEIELBC.js.map → board-dashboard-SI5GP3XR.js.map} +1 -1
  6. package/dist/{chunk-H4RCKWJA.js → chunk-2WRWBPDL.js} +2 -2
  7. package/dist/{chunk-SLQZ4AHG.js → chunk-2XSVV3M3.js} +2 -2
  8. package/dist/chunk-2YIWQ57T.js +22 -0
  9. package/dist/chunk-2YIWQ57T.js.map +1 -0
  10. package/dist/{chunk-U6XM4M5V.js → chunk-3AFZBXNX.js} +2 -2
  11. package/dist/{chunk-JVJYCR67.js → chunk-3OIFSKSR.js} +2 -2
  12. package/dist/{chunk-FWDWHZ6H.js → chunk-B5VRY4NI.js} +2 -2
  13. package/dist/{chunk-4EJ65BMF.js → chunk-DTKTEQPC.js} +194 -194
  14. package/dist/chunk-DTKTEQPC.js.map +1 -0
  15. package/dist/{chunk-2XICJMS6.js → chunk-EOBFJGTV.js} +30 -30
  16. package/dist/chunk-EOBFJGTV.js.map +1 -0
  17. package/dist/{chunk-4STRKIUA.js → chunk-IWQURDYO.js} +2 -2
  18. package/dist/{chunk-WEUF5WRR.js → chunk-IXWPA6WM.js} +2 -2
  19. package/dist/chunk-KH4PKJGD.js +15 -0
  20. package/dist/chunk-KH4PKJGD.js.map +1 -0
  21. package/dist/{chunk-53J2D2ZJ.js → chunk-N2A3KIVY.js} +2 -2
  22. package/dist/{chunk-NWP44FEW.js → chunk-P5KHF46N.js} +2 -2
  23. package/dist/{chunk-GTZDTKDW.js → chunk-PF5ZXMEG.js} +2 -2
  24. package/dist/{chunk-TVORP6BW.js → chunk-QAKL2D7O.js} +2 -2
  25. package/dist/{chunk-GX4U2ILS.js → chunk-QIMIARFO.js} +2 -2
  26. package/dist/{chunk-R7AS5M32.js → chunk-SYXAEWFN.js} +5 -5
  27. package/dist/{chunk-IMVW5ZSY.js → chunk-THZOPGSP.js} +2 -2
  28. package/dist/{chunk-KEPK7ZZ2.js → chunk-TQT4XDNN.js} +2 -2
  29. package/dist/{chunk-JQXP3JWF.js → chunk-VIUCCUJ4.js} +2 -2
  30. package/dist/{chunk-FSVUSXJB.js → chunk-YX5S4FHR.js} +17 -17
  31. package/dist/{chunk-FSVUSXJB.js.map → chunk-YX5S4FHR.js.map} +1 -1
  32. package/dist/{chunk-6HUDHMAC.js → chunk-ZBRZ5T2G.js} +2 -2
  33. package/dist/cli.js +1 -1
  34. package/dist/client-TZPRACLX.js +2 -0
  35. package/dist/{config-44LINWKG.js → config-OQVGSZWB.js} +2 -2
  36. package/dist/config-mutator-BA7YVYJY.js +2 -0
  37. package/dist/{doctor-OXR3VXX6.js → doctor-NHEB7IMW.js} +2 -2
  38. package/dist/{editor-chat-V24MXQIB.js → editor-chat-4MLCP5D2.js} +5 -3
  39. package/dist/editor-chat-4MLCP5D2.js.map +1 -0
  40. package/dist/index.d.ts +13 -3
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/program-N3AVBQMK.js +2 -0
  44. package/dist/{promote-72BY34SI.js → promote-O6Y2RG4K.js} +2 -2
  45. package/dist/{query-AJO3NOO6.js → query-J3XX5U3P.js} +2 -2
  46. package/dist/registry-DBLLSQ75.js +2 -0
  47. package/dist/{request-planner-Q74NYFRJ.js → request-planner-NP2XHSMV.js} +2 -2
  48. package/dist/{review-candidates-ZBBIPFJT.js → review-candidates-J3OBF4GM.js} +2 -2
  49. package/dist/{routing-7VU524EZ.js → routing-VTQBG767.js} +2 -2
  50. package/dist/schedule-tool-RQBVG3ZJ.js +2 -0
  51. package/dist/scheduler-BHXA74R6.js +2 -0
  52. package/dist/{seat-MKY332GD.js → seat-NBQOUDGU.js} +2 -2
  53. package/dist/{select-FZX63JK5.js → select-T5FEWTZA.js} +2 -2
  54. package/dist/{set-enabled-RNDSUIYU.js → set-enabled-2GHZXDEA.js} +2 -2
  55. package/dist/{tool-XBSFEGWW.js → tool-6WLJTCE5.js} +2 -2
  56. package/dist/web/workflow-editor.global.js +10 -10
  57. package/dist/web/workflow-editor.global.js.map +1 -1
  58. package/dist/wiki-ZB6KMJKX.js +2 -0
  59. package/package.json +1 -1
  60. package/dist/chunk-2XICJMS6.js.map +0 -1
  61. package/dist/chunk-4EJ65BMF.js.map +0 -1
  62. package/dist/chunk-DBXN7I2X.js +0 -15
  63. package/dist/chunk-DBXN7I2X.js.map +0 -1
  64. package/dist/chunk-LQJNRSCT.js +0 -21
  65. package/dist/chunk-LQJNRSCT.js.map +0 -1
  66. package/dist/client-OAAE3KM5.js +0 -2
  67. package/dist/config-mutator-P6QEABPU.js +0 -2
  68. package/dist/editor-chat-V24MXQIB.js.map +0 -1
  69. package/dist/program-X7ROPRQP.js +0 -2
  70. package/dist/registry-AFNYREN2.js +0 -2
  71. package/dist/schedule-tool-6RRXRW5K.js +0 -2
  72. package/dist/scheduler-WA4KTCCU.js +0 -2
  73. package/dist/wiki-ZOK6XGIX.js +0 -2
  74. /package/dist/{App-UNWLWLH5.js.map → App-NZQQXETO.js.map} +0 -0
  75. /package/dist/{ChatApp-UBSOVFRK.js.map → ChatApp-CSVN3PRK.js.map} +0 -0
  76. /package/dist/{agent-XWWWL5RV.js.map → agent-RTZDVG5B.js.map} +0 -0
  77. /package/dist/{chunk-H4RCKWJA.js.map → chunk-2WRWBPDL.js.map} +0 -0
  78. /package/dist/{chunk-SLQZ4AHG.js.map → chunk-2XSVV3M3.js.map} +0 -0
  79. /package/dist/{chunk-U6XM4M5V.js.map → chunk-3AFZBXNX.js.map} +0 -0
  80. /package/dist/{chunk-JVJYCR67.js.map → chunk-3OIFSKSR.js.map} +0 -0
  81. /package/dist/{chunk-FWDWHZ6H.js.map → chunk-B5VRY4NI.js.map} +0 -0
  82. /package/dist/{chunk-4STRKIUA.js.map → chunk-IWQURDYO.js.map} +0 -0
  83. /package/dist/{chunk-WEUF5WRR.js.map → chunk-IXWPA6WM.js.map} +0 -0
  84. /package/dist/{chunk-53J2D2ZJ.js.map → chunk-N2A3KIVY.js.map} +0 -0
  85. /package/dist/{chunk-NWP44FEW.js.map → chunk-P5KHF46N.js.map} +0 -0
  86. /package/dist/{chunk-GTZDTKDW.js.map → chunk-PF5ZXMEG.js.map} +0 -0
  87. /package/dist/{chunk-TVORP6BW.js.map → chunk-QAKL2D7O.js.map} +0 -0
  88. /package/dist/{chunk-GX4U2ILS.js.map → chunk-QIMIARFO.js.map} +0 -0
  89. /package/dist/{chunk-R7AS5M32.js.map → chunk-SYXAEWFN.js.map} +0 -0
  90. /package/dist/{chunk-IMVW5ZSY.js.map → chunk-THZOPGSP.js.map} +0 -0
  91. /package/dist/{chunk-KEPK7ZZ2.js.map → chunk-TQT4XDNN.js.map} +0 -0
  92. /package/dist/{chunk-JQXP3JWF.js.map → chunk-VIUCCUJ4.js.map} +0 -0
  93. /package/dist/{chunk-6HUDHMAC.js.map → chunk-ZBRZ5T2G.js.map} +0 -0
  94. /package/dist/{client-OAAE3KM5.js.map → client-TZPRACLX.js.map} +0 -0
  95. /package/dist/{config-44LINWKG.js.map → config-OQVGSZWB.js.map} +0 -0
  96. /package/dist/{config-mutator-P6QEABPU.js.map → config-mutator-BA7YVYJY.js.map} +0 -0
  97. /package/dist/{doctor-OXR3VXX6.js.map → doctor-NHEB7IMW.js.map} +0 -0
  98. /package/dist/{program-X7ROPRQP.js.map → program-N3AVBQMK.js.map} +0 -0
  99. /package/dist/{promote-72BY34SI.js.map → promote-O6Y2RG4K.js.map} +0 -0
  100. /package/dist/{query-AJO3NOO6.js.map → query-J3XX5U3P.js.map} +0 -0
  101. /package/dist/{registry-AFNYREN2.js.map → registry-DBLLSQ75.js.map} +0 -0
  102. /package/dist/{request-planner-Q74NYFRJ.js.map → request-planner-NP2XHSMV.js.map} +0 -0
  103. /package/dist/{review-candidates-ZBBIPFJT.js.map → review-candidates-J3OBF4GM.js.map} +0 -0
  104. /package/dist/{routing-7VU524EZ.js.map → routing-VTQBG767.js.map} +0 -0
  105. /package/dist/{schedule-tool-6RRXRW5K.js.map → schedule-tool-RQBVG3ZJ.js.map} +0 -0
  106. /package/dist/{scheduler-WA4KTCCU.js.map → scheduler-BHXA74R6.js.map} +0 -0
  107. /package/dist/{seat-MKY332GD.js.map → seat-NBQOUDGU.js.map} +0 -0
  108. /package/dist/{select-FZX63JK5.js.map → select-T5FEWTZA.js.map} +0 -0
  109. /package/dist/{set-enabled-RNDSUIYU.js.map → set-enabled-2GHZXDEA.js.map} +0 -0
  110. /package/dist/{tool-XBSFEGWW.js.map → tool-6WLJTCE5.js.map} +0 -0
  111. /package/dist/{wiki-ZOK6XGIX.js.map → wiki-ZB6KMJKX.js.map} +0 -0
@@ -48,7 +48,7 @@ The "modified" field is optional and can contain updated values to pass forward.
48
48
  ... (output truncated)`:i;return s.exitCode!==0?{tool_use_id:e.id,content:`Command exited with code ${s.exitCode}:
49
49
  ${c}`,is_error:!0}:{tool_use_id:e.id,content:c||"(no output)"}}async editFile(e){let t=String(e.input.path||""),o=e.input.edits,n=ge.resolve(this.cwd,t);if(!o||o.length===0)return{tool_use_id:e.id,content:"No edits provided.",is_error:!0};let s=await W.checkFileWrite(t);if(s==="deny")return{tool_use_id:e.id,content:`File write blocked by permissions: ${t}`,is_error:!0};if(s==="skip")return{tool_use_id:e.id,content:`File write skipped (plan mode): ${t}`};if(f.has("pre:file-write")){let a=await f.execute("pre:file-write",{event:"pre:file-write",file:n,cwd:this.cwd});if(a.blocked)return{tool_use_id:e.id,content:a.message||`File edit blocked by pre:file-write hook: ${t}`,is_error:!0}}let i=await re.readFile(n,"utf8"),c=[];for(let a of o)i.includes(a.old_text)?(i=i.replace(a.old_text,a.new_text),c.push(`Replaced: "${a.old_text.slice(0,40)}..."`)):c.push(`Not found: "${a.old_text.slice(0,40)}..."`);return this.options.dryRun||await re.writeFile(n,i,"utf8"),f.has("post:file-write")&&await f.execute("post:file-write",{event:"post:file-write",file:n,fileContent:i,cwd:this.cwd}),{tool_use_id:e.id,content:`Edited ${t}:
50
50
  ${c.join(`
51
- `)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-AFNYREN2.js"),c=i();if(!c)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(c).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:n*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
51
+ `)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-DBLLSQ75.js"),c=i();if(!c)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(c).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:n*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
52
52
 
53
53
  ${p.content}`}:{tool_use_id:e.id,content:`Sub-agent "${t}" failed: ${p.error}`,is_error:!0}}catch(s){return{tool_use_id:e.id,content:`Failed to spawn sub-agent: ${s.message}`,is_error:!0}}}async askUser(e){let t=String(e.input.question||""),o=e.input.options,n=t;return o?.length&&(n+=`
54
54
  Options: ${o.join(", ")}`),{tool_use_id:e.id,content:"Question sent to user.",followUp:n}}};async function Ae(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,cwd:s,maxIterations:i=20,enabledTools:c,interactive:a=!0,overwrite:p=!1,dryRun:l=!1,onProgress:d,abortSignal:u}=r,m=u?{...n,abortSignal:u}:n;if(!e.generateRaw)return dt(r);let I=new se(s,{interactive:a,overwrite:p,dryRun:l,acmeContext:r.acmeContext,abortSignal:u}),D=be(c);if(r.acmeContext)for(let g of at)D.push({name:g.name,description:g.description,input_schema:g.input_schema});let E=new Set;if(r.mcpTools?.length)for(let g of r.mcpTools)D.push({name:g.name,description:g.description,input_schema:g.input_schema}),E.add(g.name);let C=o.filter(g=>g.role!=="system").map(g=>({role:g.role,content:g.content})),B=[],G=0,F=0,A=0,O="",j,_=0;for(;_<i;){if(_++,u?.aborted)throw new Error("cancelled");d?.({type:"iteration_start",iteration:_}),b.step(_,`Agentic loop iteration (${D.length} tools available)`);let g,M=!!e.generateRawStream&&!!d;try{if(M){let T=null,U=null,v="";for await(let x of e.generateRawStream(C,t,D,m))x.type==="text_delta"?(v+=x.text,d?.({type:"text_delta",text:x.text})):x.type==="thinking_delta"?d?.({type:"thinking_delta",text:x.text}):x.type==="raw_result"?T=x.result:x.type==="error"&&(U=x.error);if(U&&!T)throw new Error(U);if(!T)throw new Error("generateRawStream returned no raw_result event");g=T,g._streamedText=v}else g=await e.generateRaw(C,t,D,m)}catch(T){if(T.message?.includes("not available"))return dt(r);throw T}G+=g.usage.input_tokens+g.usage.output_tokens,F+=g.usage.input_tokens,A+=g.usage.output_tokens;let P=g._streamedText;for(let T of g.content)T.type==="text"&&(O+=T.text,P===void 0&&d?.({type:"text_delta",text:T.text}));if(P!==void 0&&delete g._streamedText,g.stop_reason==="end_turn"||g.stop_reason==="max_tokens")break;if(g.stop_reason==="tool_use"){let T=g.content.filter(v=>v.type==="tool_use");if(T.length===0)break;C.push({role:"assistant",content:g.content});let U=[];for(let v of T){d?.({type:"tool_call",name:v.name,id:v.id,input:v.input}),b.step(_,`Tool call: ${v.name}`);let x;if(E.has(v.name)&&r.mcpDispatch){let h=await r.mcpDispatch(v.name,v.input);x={tool_use_id:v.id,content:h.content,is_error:h.isError}}else x=await I.execute({name:v.name,id:v.id,input:v.input});d?.({type:"tool_result",name:v.name,id:v.id,content:x.content.slice(0,200),is_error:x.is_error}),x.files?.length&&(B.push(...x.files),d?.({type:"files_created",files:x.files})),x.followUp&&(j=x.followUp),U.push({type:"tool_result",tool_use_id:x.tool_use_id,content:x.content,is_error:x.is_error})}if(C.push({role:"user",content:U}),j)break;continue}break}return d?.({type:"complete",iterations:_,totalTokens:G}),{files:B,content:O,followUp:j,tokensUsed:G,inputTokens:F||void 0,outputTokens:A||void 0,iterations:_}}async function dt(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,maxIterations:s=5}=r,c=[{role:"system",content:t+`
@@ -123,4 +123,4 @@ ${r.projectInstructions}`),r.memoryContext&&o.push(r.memoryContext),o.push(`# Ou
123
123
  Generate output appropriate for: ${e}. Use the \`create_files\` tool to output all files.`),o.join(`
124
124
 
125
125
  `)}export{qe as a,Vt as b,Yt as c,We as d,ze as e,Ve as f,Ye as g,Pe as h,ee as i,Re as j,le as k,te as l,Tt as m,oe as n,Mt as o,f as p,et as q,tt as r,Me as s,de as t,W as u,ne as v,it as w,Ee as x,$e as y,se as z,mt as A,Zn as B,er as C};
126
- //# sourceMappingURL=chunk-6HUDHMAC.js.map
126
+ //# sourceMappingURL=chunk-ZBRZ5T2G.js.map
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as n}from"./chunk-FSVUSXJB.js";import"./chunk-KEPK7ZZ2.js";import"./chunk-H4RCKWJA.js";import"./chunk-SLQZ4AHG.js";import"./chunk-Z3IP66SL.js";import"./chunk-O5U5NVLR.js";import"./chunk-RKPAVWXF.js";import"./chunk-SZDACK6O.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-4EJ65BMF.js";import"./chunk-2XICJMS6.js";import"./chunk-WEUF5WRR.js";import"./chunk-S2GAEH2F.js";import"./chunk-7XB2CVC3.js";import"./chunk-CL53UVOF.js";import"./chunk-ZVP6GB4G.js";import"./chunk-JVJYCR67.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-R7AS5M32.js";import"./chunk-LQJNRSCT.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import"./chunk-6HUDHMAC.js";import"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-4STRKIUA.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-FWDWHZ6H.js";import"./chunk-53J2D2ZJ.js";import"./chunk-VWTBHLMX.js";import"./chunk-NWP44FEW.js";import"./chunk-GTZDTKDW.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GX4U2ILS.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-U6XM4M5V.js";import"./chunk-JQXP3JWF.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import"./chunk-TVORP6BW.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-DBXN7I2X.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
2
+ import{a as n}from"./chunk-YX5S4FHR.js";import"./chunk-TQT4XDNN.js";import"./chunk-2WRWBPDL.js";import"./chunk-2XSVV3M3.js";import"./chunk-Z3IP66SL.js";import"./chunk-O5U5NVLR.js";import"./chunk-RKPAVWXF.js";import"./chunk-DTKTEQPC.js";import"./chunk-EOBFJGTV.js";import"./chunk-IXWPA6WM.js";import"./chunk-S2GAEH2F.js";import"./chunk-7XB2CVC3.js";import"./chunk-CL53UVOF.js";import"./chunk-ZVP6GB4G.js";import"./chunk-3OIFSKSR.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-SYXAEWFN.js";import"./chunk-2YIWQ57T.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import"./chunk-ZBRZ5T2G.js";import"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-IWQURDYO.js";import"./chunk-2AXFYDWF.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-B5VRY4NI.js";import"./chunk-N2A3KIVY.js";import"./chunk-VWTBHLMX.js";import"./chunk-P5KHF46N.js";import"./chunk-PF5ZXMEG.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-QIMIARFO.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-3AFZBXNX.js";import"./chunk-VIUCCUJ4.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import"./chunk-QAKL2D7O.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-KH4PKJGD.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
3
3
  //# sourceMappingURL=cli.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-TQT4XDNN.js";import"./chunk-KH4PKJGD.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
+ //# sourceMappingURL=client-TZPRACLX.js.map
@@ -1,2 +1,2 @@
1
- import{A as h,B as i,D as j,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"./chunk-DBXN7I2X.js";import"./chunk-QIJLFPWE.js";j();export{a as INTEGRATION_KINDS,e as approvalsConfigSchema,d as callsSchema,c as cameraBotSchema,f as daemonConfigSchema,b as eventSubscriptionSchema,g as expandEnvVars,h as loadDaemonConfig,i as validateWorkspaces};
2
- //# sourceMappingURL=config-44LINWKG.js.map
1
+ import{A as d,B as e,C as f,D as g,E as h,F as i,H as j,x as a,y as b,z as c}from"./chunk-KH4PKJGD.js";import"./chunk-QIJLFPWE.js";j();export{a as INTEGRATION_KINDS,e as approvalsConfigSchema,d as callsSchema,c as cameraBotSchema,f as daemonConfigSchema,b as eventSubscriptionSchema,g as expandEnvVars,h as loadDaemonConfig,i as validateWorkspaces};
2
+ //# sourceMappingURL=config-OQVGSZWB.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-N2A3KIVY.js";import"./chunk-KH4PKJGD.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-BA7YVYJY.js.map
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-H4RCKWJA.js";import"./chunk-S2GAEH2F.js";import"./chunk-DBXN7I2X.js";import"./chunk-QIJLFPWE.js";export{f as daemonVoiceCheck,b as doctor,e as nodeVersionSupported,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
2
- //# sourceMappingURL=doctor-OXR3VXX6.js.map
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-2WRWBPDL.js";import"./chunk-S2GAEH2F.js";import"./chunk-KH4PKJGD.js";import"./chunk-QIJLFPWE.js";export{f as daemonVoiceCheck,b as doctor,e as nodeVersionSupported,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
2
+ //# sourceMappingURL=doctor-NHEB7IMW.js.map
@@ -1,5 +1,5 @@
1
- import"./chunk-QIJLFPWE.js";function c(o){let s=o.store.list().map(t=>({id:t.id,title:t.title})),e=[];if(e.push(r),e.push(""),e.push(i),e.push(""),e.push("# Environment \u2014 only reference values that exist"),e.push(""),e.push("## Available agents (for `agent` nodes)"),o.availableAgents.length===0)e.push(" (none registered \u2014 the user must add an agent first for `agent` nodes to work)");else for(let t of o.availableAgents)e.push(` - \`${t.id}\`${t.description?` \u2014 ${t.description}`:""}`);if(e.push(""),e.push("## Assignees (for `userTask.assignTo`)"),e.push(" Any agent id above, or a plain string naming the person responsible."),e.push(""),e.push("## Available roles (for `userTask.assignTo`)"),e.push(""),e.push("## Available channels (for `action.*` and `trigger.channel`)"),e.push(` ${o.availableChannels.length?o.availableChannels.map(t=>`\`${t}\``).join(", "):"(none live on this node)"}`),e.push(""),e.push("## Existing workflows (for `subProcess.workflowId`)"),s.length===0)e.push(" (no other workflows defined)");else for(let t of s)e.push(` - \`${t.id}\` \u2014 ${t.title}`);e.push(""),o.currentWorkflow&&(e.push("# Current workflow on canvas"),e.push(""),e.push("The user is editing this workflow. Build on it \u2014 do NOT replace it unless they explicitly ask."),e.push(""),e.push("```json"),e.push(JSON.stringify(o.currentWorkflow,null,2)),e.push("```"),e.push("")),e.push("# Conversation"),e.push("");for(let t of o.messages){let a=t.role==="user"?"USER":"ASSISTANT";e.push(`${a}: ${t.content}`),e.push("")}return e.push(l),e.join(`
2
- `)}function u(o){let s=/```(?:json)?\s*\n([\s\S]*?)```/.exec(o),e=[];s&&e.push(s[1]);let t=o.match(/\{[\s\S]*\}/);t&&e.push(t[0]);for(let a of e)try{let n=JSON.parse(a);if(n&&typeof n=="object"&&"id"in n&&"nodes"in n)return n}catch{}return null}var r=`You are AgentX's workflow author. The user describes a business process in
1
+ import"./chunk-QIJLFPWE.js";function c(o){let s=o.store.list().map(t=>({id:t.id,title:t.title})),e=[];if(e.push(a),e.push(""),e.push(i),e.push(""),e.push("# Environment \u2014 only reference values that exist"),e.push(""),e.push("## Available agents (for `agent` nodes)"),o.availableAgents.length===0)e.push(" (none registered \u2014 the user must add an agent first for `agent` nodes to work)");else for(let t of o.availableAgents)e.push(` - \`${t.id}\`${t.description?` \u2014 ${t.description}`:""}`);if(e.push(""),e.push("## Assignees (for `userTask.assignTo`)"),e.push(" Any agent id above, or a plain string naming the person responsible."),e.push(""),e.push("## Available roles (for `userTask.assignTo`)"),e.push(""),e.push("## Available channels (for `action.*` and `trigger.channel`)"),e.push(` ${o.availableChannels.length?o.availableChannels.map(t=>`\`${t}\``).join(", "):"(none live on this node)"}`),e.push(""),e.push("## Existing workflows (for `subProcess.workflowId`)"),s.length===0)e.push(" (no other workflows defined)");else for(let t of s)e.push(` - \`${t.id}\` \u2014 ${t.title}`);e.push(""),o.currentWorkflow&&(e.push("# Current workflow on canvas"),e.push(""),e.push("The user is editing this workflow. Build on it \u2014 do NOT replace it unless they explicitly ask."),e.push(""),e.push("```json"),e.push(JSON.stringify(o.currentWorkflow,null,2)),e.push("```"),e.push("")),e.push("# Conversation"),e.push("");for(let t of o.messages){let r=t.role==="user"?"USER":"ASSISTANT";e.push(`${r}: ${t.content}`),e.push("")}return e.push(l),e.join(`
2
+ `)}function u(o){let s=/```(?:json)?\s*\n([\s\S]*?)```/.exec(o),e=[];s&&e.push(s[1]);let t=o.match(/\{[\s\S]*\}/);t&&e.push(t[0]);for(let r of e)try{let n=JSON.parse(r);if(n&&typeof n=="object"&&"id"in n&&"nodes"in n)return n}catch{}return null}var a=`You are AgentX's workflow author. The user describes a business process in
3
3
  plain language; you return a valid V2 workflow JSON that implements it.
4
4
 
5
5
  Read the node catalog below. Prefer the BPM primitives (userTask,
@@ -13,6 +13,8 @@ for simple message-in \u2192 reply-out automations.`,i=`# V2 Node catalog
13
13
  config: { "source": "whatsapp-message" | "telegram-message" | "slack-message" | "discord-message" | "gitlab-issue" | "gitlab-pipeline", "filter": { "chat"?: "*", "project"?: "acme/web", "labels"?: ["x"] } }
14
14
  - \`trigger.cron\` \u2014 scheduled. config: { "spec": "0 9 * * *", "timezone": "UTC" }
15
15
  - \`trigger.hook\` \u2014 subscribes to any on:* hook event. config: { "event": "on:gitlab-issue" }
16
+ - \`trigger.poll\` \u2014 runs a registered action every N seconds; one run per NEW item it prints (one JSON object per line). The item is the trigger payload.
17
+ config: { "actionId": "my-list-action", "everySeconds": 60, "key": "id", "filter"?: [ { "kind": "matches", "params": { "path": "text", "regex": "^@bot" } } ] }
16
18
  - \`trigger.manual\` \u2014 kicked off by CLI or API. config: {}
17
19
  - \`trigger.form\` \u2014 human fills a form to start. config: { "form": FormSchema, "startableBy": "role:public" }
18
20
 
@@ -134,4 +136,4 @@ Only reference agent ids, actor ids, role ids, and channel names that
134
136
  appear in the Environment section above. If the user asks for an agent
135
137
  that doesn't exist, tell them which agent to register first. Never
136
138
  invent workflowIds for subProcess that aren't in the existing list.`;export{c as buildWorkflowAuthorPrompt,u as extractWorkflowJson};
137
- //# sourceMappingURL=editor-chat-V24MXQIB.js.map
139
+ //# sourceMappingURL=editor-chat-4MLCP5D2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/workflows/editor-chat.ts"],"sourcesContent":["import type { Workflow } from \"./types\"\nimport type { WorkflowStore } from \"./store\"\n\n// --- Workflow-builder chat context ---\n//\n// Produces the plain-text prompt the authoring agent reads. Packs\n// *everything* the agent needs to generate a valid V2 workflow JSON on\n// its first try: node catalog with config examples, available agent\n// ids, actor + role ids, channel adapter names, the user's existing\n// workflow list (for subProcess targets), and — when the author is\n// editing — the current workflow JSON as a starting point.\n//\n// The output is deliberately text, not JSON. Agents (LLMs) produce\n// better structured output when the schema is described as prose +\n// examples rather than as raw JSON Schema. The explicit \"reply with a\n// ```json block```\" instruction at the tail is what the API endpoint\n// parses back.\n\nexport interface ChatMessage {\n role: \"user\" | \"assistant\"\n content: string\n}\n\nexport interface BuildContextArgs {\n messages: ChatMessage[]\n store: WorkflowStore\n /** Full list of agent ids + optional descriptions. */\n availableAgents: Array<{ id: string; description?: string; tags?: string[] }>\n /** Adapter names the daemon has live (telegram, whatsapp, gitlab, ...). */\n availableChannels: string[]\n /** The workflow the user is currently editing (if any). */\n currentWorkflow?: Workflow\n}\n\n/** Build the single-string prompt the agent executes. */\nexport function buildWorkflowAuthorPrompt(args: BuildContextArgs): string {\n const workflows = args.store.list().map((w) => ({ id: w.id, title: w.title }))\n\n const parts: string[] = []\n\n parts.push(SYSTEM_HEADER)\n parts.push(\"\")\n parts.push(NODE_CATALOG)\n parts.push(\"\")\n parts.push(\"# Environment — only reference values that exist\")\n parts.push(\"\")\n parts.push(`## Available agents (for \\`agent\\` nodes)`)\n if (args.availableAgents.length === 0) {\n parts.push(\" (none registered — the user must add an agent first for `agent` nodes to work)\")\n } else {\n for (const a of args.availableAgents) {\n parts.push(` - \\`${a.id}\\`${a.description ? ` — ${a.description}` : \"\"}`)\n }\n }\n parts.push(\"\")\n parts.push(\"## Assignees (for `userTask.assignTo`)\")\n parts.push(\" Any agent id above, or a plain string naming the person responsible.\")\n parts.push(\"\")\n parts.push(\"## Available roles (for `userTask.assignTo`)\")\n parts.push(\"\")\n parts.push(\"## Available channels (for `action.*` and `trigger.channel`)\")\n parts.push(` ${args.availableChannels.length ? args.availableChannels.map((c) => `\\`${c}\\``).join(\", \") : \"(none live on this node)\"}`)\n parts.push(\"\")\n parts.push(\"## Existing workflows (for `subProcess.workflowId`)\")\n if (workflows.length === 0) parts.push(\" (no other workflows defined)\")\n else for (const w of workflows) parts.push(` - \\`${w.id}\\` — ${w.title}`)\n parts.push(\"\")\n\n if (args.currentWorkflow) {\n parts.push(\"# Current workflow on canvas\")\n parts.push(\"\")\n parts.push(\"The user is editing this workflow. Build on it — do NOT replace it unless they explicitly ask.\")\n parts.push(\"\")\n parts.push(\"```json\")\n parts.push(JSON.stringify(args.currentWorkflow, null, 2))\n parts.push(\"```\")\n parts.push(\"\")\n }\n\n parts.push(\"# Conversation\")\n parts.push(\"\")\n for (const m of args.messages) {\n const tag = m.role === \"user\" ? \"USER\" : \"ASSISTANT\"\n parts.push(`${tag}: ${m.content}`)\n parts.push(\"\")\n }\n\n parts.push(RESPONSE_RULES)\n return parts.join(\"\\n\")\n}\n\n/** Try to extract a workflow-shaped JSON block from an agent reply. Returns\n * null if no JSON block is present OR the JSON doesn't have the minimum\n * workflow fields (id, nodes). The caller still runs full zod validation\n * before writing. */\nexport function extractWorkflowJson(reply: string): Record<string, unknown> | null {\n // Prefer fenced ```json blocks; fall back to the largest {...} block.\n const fenced = /```(?:json)?\\s*\\n([\\s\\S]*?)```/.exec(reply)\n const candidates: string[] = []\n if (fenced) candidates.push(fenced[1])\n const braceMatch = reply.match(/\\{[\\s\\S]*\\}/)\n if (braceMatch) candidates.push(braceMatch[0])\n\n for (const raw of candidates) {\n try {\n const parsed = JSON.parse(raw)\n if (parsed && typeof parsed === \"object\" && \"id\" in parsed && \"nodes\" in parsed) {\n return parsed as Record<string, unknown>\n }\n } catch { /* try next */ }\n }\n return null\n}\n\nconst SYSTEM_HEADER = `You are AgentX's workflow author. The user describes a business process in\nplain language; you return a valid V2 workflow JSON that implements it.\n\nRead the node catalog below. Prefer the BPM primitives (userTask,\nsubProcess, signal.emit/wait, timer.boundary, gateway.parallel, rule)\nwhen modelling processes with humans, deadlines, parallel streams, or\nnested activities. Prefer the bot primitives (agent, branch, action.*)\nfor simple message-in → reply-out automations.`\n\nconst NODE_CATALOG = `# V2 Node catalog\n\n## Triggers (exactly one per workflow)\n- \\`trigger.channel\\` — inbound channel event.\n config: { \"source\": \"whatsapp-message\" | \"telegram-message\" | \"slack-message\" | \"discord-message\" | \"gitlab-issue\" | \"gitlab-pipeline\", \"filter\": { \"chat\"?: \"*\", \"project\"?: \"acme/web\", \"labels\"?: [\"x\"] } }\n- \\`trigger.cron\\` — scheduled. config: { \"spec\": \"0 9 * * *\", \"timezone\": \"UTC\" }\n- \\`trigger.hook\\` — subscribes to any on:* hook event. config: { \"event\": \"on:gitlab-issue\" }\n- \\`trigger.poll\\` — runs a registered action every N seconds; one run per NEW item it prints (one JSON object per line). The item is the trigger payload.\n config: { \"actionId\": \"my-list-action\", \"everySeconds\": 60, \"key\": \"id\", \"filter\"?: [ { \"kind\": \"matches\", \"params\": { \"path\": \"text\", \"regex\": \"^@bot\" } } ] }\n- \\`trigger.manual\\` — kicked off by CLI or API. config: {}\n- \\`trigger.form\\` — human fills a form to start. config: { \"form\": FormSchema, \"startableBy\": \"role:public\" }\n\n## Compute\n- \\`agent\\` — run an agent with a templated prompt. Output: { reply, result (parsed RESULT: token), json?, durationMs }.\n config: { \"agentId\": \"<id>\", \"prompt\": \"Classify {{trigger.text}} — reply on one line: RESULT: a|b|c\", \"resultParser\": \"acme-result-token\" | \"json\", \"timeoutMinutes\": 2 }\n- \\`transform\\` — reshape upstream context.\n config: { \"path\": \"trigger.contact.phone\" } OR { \"template\": { \"key\": \"{{trigger.text}}\" } }\n\n## Control flow\n- \\`branch\\` — N-way switch (first match wins).\n config: { \"cases\": [{ \"when\": { \"kind\": \"equals\"|\"contains\"|\"matches\"|\"exists\", \"params\": { \"path\": \"classify.result\", \"value\": \"ok\" } }, \"to\": \"port1\" }], \"default\": \"fallbackPort\" }\n Wire with edges: { \"from\": \"branchId\", \"fromPort\": \"port1\", \"to\": \"nextNode\" }\n- \\`gateway.parallel\\` — fan-out (one → many) or join (many → one).\n config: { \"mode\": \"fanOut\" } — splits to every outgoing edge\n config: { \"mode\": \"join\" } — waits until every incoming edge arrives, then fires once\n- \\`rule\\` — DMN decision table, first matching row wins.\n config: {\n \"inputs\": [\"{{trigger.tier}}\", \"{{trigger.amount}}\"],\n \"rules\": [\n { \"when\": [\"gold\", \">100\"], \"to\": \"vip\", \"output\": { \"route\": \"vip\" } },\n { \"when\": [\"*\", \">50\"], \"to\": \"high\", \"output\": { \"route\": \"high\" } }\n ],\n \"default\": { \"to\": \"low\", \"output\": { \"route\": \"low\" } }\n }\n Cell syntax: \"*\" wildcard, exact \"value\", \">N\" \"<N\" \">=N\" \"<=N\", \"!=x\", \"/regex/\".\n- \\`checkpoint\\` — pause until a matching event.\n config: { \"name\": \"await-x\", \"waitFor\": { \"source\": \"manual\" }, \"resumeMatch\": {} }\n\n## BPM\n- \\`userTask\\` — assign a form to an actor or role; pauses until submission.\n config: {\n \"assignTo\": \"actor:alice\" | \"role:reviewers\",\n \"title\": \"Review expense {{trigger.values.amount}}\",\n \"description\": \"…\",\n \"dueIn\": \"P2D\" | \"PT2H\" | { \"minutes\": 60 },\n \"form\": FormSchema\n }\n Output: { submittedBy, submittedAt, values: { fieldKey: value }, action: \"primary\" | \"secondary\" }\n- \\`subProcess\\` — spawn a child workflow; parent pauses until child reaches end.\n config: {\n \"workflowId\": \"<other workflow id>\",\n \"inputMap\": { \"trigger\": { \"grantee\": \"{{trigger.values.name}}\" } } (or \"*\" for full inherit),\n \"awaitCompletion\": true\n }\n Output: { childRunId, status, output: <child's last bundle> }\n- \\`signal.emit\\` — publish an event. config: { \"name\": \"approved\", \"scope\": \"workflow\"|\"global\", \"payload\": {} }\n- \\`signal.wait\\` — pause until matching signal arrives. config: { \"name\": \"approved\", \"scope\": \"workflow\", \"match\": { \"grantId\": \"{{trigger.id}}\" } }\n- \\`timer.boundary\\` — pause for a duration. config: { \"after\": \"PT2H\" | \"P1D\" | 60 (minutes) }\n\n## Actions — side-effect sinks\n- \\`action.send\\` — post a message to any channel. config: { \"channel\": \"telegram\"|\"whatsapp\"|…, \"chatId\": \"{{trigger.chatId}}\", \"text\": \"Hi {{classify.reply}}\", \"accountId\"?: \"…\" }\n- \\`action.createIssue\\` — open a GitLab issue. config: { \"channel\": \"gitlab\", \"project\": \"acme/web\", \"title\": \"…\", \"description\": \"…\", \"labels\": [\"x\"], \"assignees\": [\"user\"] }\n- \\`action.setLabel\\` / \\`action.readLabel\\` / \\`action.react\\` / \\`action.editMessage\\` / \\`action.logTime\\` — self-explanatory; each maps 1:1 to a channel adapter method.\n- \\`action.callHTTP\\` — outbound HTTP. config: { \"method\": \"POST\"|\"GET\"|…, \"url\": \"https://…\", \"headers\": {}, \"body\": {}, \"timeoutMs\": 30000 }\n\n## Terminal\n- \\`end\\` — completes the run. config: { \"status\": \"completed\" | \"failed\" | \"canceled\" }\n\n## FormSchema (used by userTask + trigger.form)\n{\n \"title\": \"Review application\",\n \"description\": \"…\",\n \"fields\": [\n { \"key\": \"score\", \"label\": \"Score\", \"type\": \"number\", \"required\": true, \"validate\": { \"min\": 1, \"max\": 10 } },\n { \"key\": \"verdict\", \"label\": \"Verdict\", \"type\": \"select\", \"required\": true, \"options\": [\"approve\", \"reject\"] },\n { \"key\": \"notes\", \"label\": \"Notes\", \"type\": \"long-text\" }\n ],\n \"submitLabel\": \"Approve\",\n \"secondaryAction\": { \"key\": \"reject\", \"label\": \"Reject\" }\n}\nField types: text, long-text, number, boolean, date, select, multi-select, file.\nA form with a \\`secondaryAction\\` and no required-unfilled fields renders as one-tap Approve/Reject buttons in chat.\n\n## Templates\nEvery prompt + config value can reference \\`{{nodeId.path}}\\` against the run context. Examples:\n {{trigger.values.amount}} — field from the start form\n {{classify.result}} — parsed RESULT: token from an agent node\n {{review.values.score}} — submitted userTask field\n {{env.GITLAB_TOKEN}} — env var (must be listed in workflow.envAllow)\n\n## Edges\n[{ \"from\": \"nodeId\", \"to\": \"nodeId\" }, { \"from\": \"branchId\", \"fromPort\": \"case-label\", \"to\": \"nodeId\" }]\nEvery edge's from/to must reference an existing node. Branch + rule nodes MUST have outgoing edges whose fromPort matches a declared case/rule/default.\n\n## Workflow shell\n{\n \"id\": \"lower-kebab-id\",\n \"version\": 2,\n \"title\": \"Human readable\",\n \"description\": \"optional\",\n \"priority\": 0,\n \"fanOut\": false,\n \"envAllow\": [],\n \"maxChildDepth\": 5,\n \"retention\": { \"maxRuns\": 500, \"maxDays\": 90 },\n \"nodes\": [...],\n \"edges\": [...]\n}\n\n## Lint rules (all enforced on save)\n- exactly one trigger.* node\n- every edge references an existing node\n- every node is reachable from the trigger\n- at least one end/checkpoint/userTask/subProcess/signal.wait/timer.boundary is reachable\n- branch + rule outgoing fromPort values match declared cases (or default)\n- cycles are only allowed when the cycle crosses an agent/checkpoint/userTask/subProcess/signal.wait/timer.boundary`\n\nconst RESPONSE_RULES = `# Your reply\n\nRespond in ONE of two ways:\n\n1. **Clarification**: if the user's request is ambiguous, ask exactly ONE short follow-up question. No JSON.\n\n2. **Workflow**: if you have enough to produce a workflow, reply with:\n - 1–3 short lines explaining what you built\n - a \\`\\`\\`json code block containing the complete, valid V2 workflow\n - (no prose after the JSON block)\n\nOnly reference agent ids, actor ids, role ids, and channel names that\nappear in the Environment section above. If the user asks for an agent\nthat doesn't exist, tell them which agent to register first. Never\ninvent workflowIds for subProcess that aren't in the existing list.`"],"mappings":"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","names":["buildWorkflowAuthorPrompt","args","workflows","w","parts","SYSTEM_HEADER","NODE_CATALOG","a","c","m","tag","RESPONSE_RULES","extractWorkflowJson","reply","fenced","candidates","braceMatch","raw","parsed"]}
package/dist/index.d.ts CHANGED
@@ -5008,6 +5008,12 @@ declare const daemonConfigSchema: z.ZodObject<{
5008
5008
  * recording's length: refused by default, since the 2 MB cap alone
5009
5009
  * lets through ~40 minutes of low-bitrate audio. true accepts it. */
5010
5010
  allowUnmeasured: z.ZodDefault<z.ZodBoolean>;
5011
+ /** Longest answer said aloud, in characters. A longer one stops at
5012
+ * its last whole sentence inside this and says the rest is on
5013
+ * screen; the written answer is always shown whole. The minimum
5014
+ * keeps a cut answer over the 280 characters the Mac pill opens
5015
+ * at (AnswerView.isWorthShowing), so "on screen" stays true. */
5016
+ spokenMaxChars: z.ZodDefault<z.ZodNumber>;
5011
5017
  /** The on-device engine behind "local" and every fallback:
5012
5018
  * mlx-whisper (Python, all languages) or Parakeet (Core ML, 25
5013
5019
  * European languages, no Arabic; 483 MB downloaded on first use into
@@ -5056,6 +5062,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5056
5062
  locale: string;
5057
5063
  stt: "auto" | "local" | "elevenlabs";
5058
5064
  allowUnmeasured: boolean;
5065
+ spokenMaxChars: number;
5059
5066
  localStt: "mlx-whisper" | "parakeet";
5060
5067
  endOfTurn: "volume" | "vad";
5061
5068
  hotkeys: {
@@ -5077,6 +5084,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5077
5084
  listener?: string | undefined;
5078
5085
  stt?: "auto" | "local" | "elevenlabs" | undefined;
5079
5086
  allowUnmeasured?: boolean | undefined;
5087
+ spokenMaxChars?: number | undefined;
5080
5088
  localStt?: "mlx-whisper" | "parakeet" | undefined;
5081
5089
  endOfTurn?: "volume" | "vad" | undefined;
5082
5090
  hotkeys?: {
@@ -6491,6 +6499,7 @@ declare const daemonConfigSchema: z.ZodObject<{
6491
6499
  locale: string;
6492
6500
  stt: "auto" | "local" | "elevenlabs";
6493
6501
  allowUnmeasured: boolean;
6502
+ spokenMaxChars: number;
6494
6503
  localStt: "mlx-whisper" | "parakeet";
6495
6504
  endOfTurn: "volume" | "vad";
6496
6505
  hotkeys: {
@@ -7232,6 +7241,7 @@ declare const daemonConfigSchema: z.ZodObject<{
7232
7241
  listener?: string | undefined;
7233
7242
  stt?: "auto" | "local" | "elevenlabs" | undefined;
7234
7243
  allowUnmeasured?: boolean | undefined;
7244
+ spokenMaxChars?: number | undefined;
7235
7245
  localStt?: "mlx-whisper" | "parakeet" | undefined;
7236
7246
  endOfTurn?: "volume" | "vad" | undefined;
7237
7247
  hotkeys?: {
@@ -8424,6 +8434,7 @@ declare class AgentXDaemon {
8424
8434
  private cameraWatch?;
8425
8435
  private workflowDispatcher?;
8426
8436
  private workflowStore?;
8437
+ private workflowPolls?;
8427
8438
  private workflowRuns?;
8428
8439
  private wfHealth?;
8429
8440
  /** Shares the daemon's SQLite handle; absent when running without one. */
@@ -8675,9 +8686,8 @@ declare class AgentXDaemon {
8675
8686
  * `sources` in the response tells the editor where the entries came from
8676
8687
  * so it can show that metadata alongside. */
8677
8688
  private handleChannelChats;
8678
- /** Manual run endpoint used by `agentx workflow run <id>`. Only workflows
8679
- * whose trigger node is `trigger.manual` are runnable here — any other
8680
- * source expects a live event and shouldn't race with a manual kick. */
8689
+ /** Manual run endpoint used by `agentx workflow run <id>` — see
8690
+ * workflow-manual-run.ts. */
8681
8691
  private handleWorkflowManualRun;
8682
8692
  }
8683
8693
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-C245D4BZ.js";import{d as St,e as kt,f as vt,g as xt,ga as Tt,h as $t,ha as Mt,i as Ct,j as Pt,k as bt}from"./chunk-4EJ65BMF.js";import"./chunk-2XICJMS6.js";import"./chunk-WEUF5WRR.js";import"./chunk-S2GAEH2F.js";import"./chunk-7XB2CVC3.js";import"./chunk-CL53UVOF.js";import"./chunk-ZVP6GB4G.js";import"./chunk-JVJYCR67.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{T as yt,k as lt,l as ct,m as dt,n as mt,o as pt}from"./chunk-R7AS5M32.js";import"./chunk-LQJNRSCT.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-6HUDHMAC.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-4STRKIUA.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-FWDWHZ6H.js";import"./chunk-53J2D2ZJ.js";import"./chunk-VWTBHLMX.js";import"./chunk-NWP44FEW.js";import{a as ht}from"./chunk-GTZDTKDW.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GX4U2ILS.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-U6XM4M5V.js";import{f as gt,g as ft}from"./chunk-JQXP3JWF.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-TVORP6BW.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-5MUJZODV.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{A as st,B as ot,D as nt,y as tt}from"./chunk-DBXN7I2X.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{a as L}from"./chunk-C245D4BZ.js";import{d as St,e as kt,f as vt,g as xt,ga as Tt,h as $t,ha as Mt,i as Ct,j as Pt,k as bt}from"./chunk-DTKTEQPC.js";import"./chunk-EOBFJGTV.js";import"./chunk-IXWPA6WM.js";import"./chunk-S2GAEH2F.js";import"./chunk-7XB2CVC3.js";import"./chunk-CL53UVOF.js";import"./chunk-ZVP6GB4G.js";import"./chunk-3OIFSKSR.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{T as yt,k as lt,l as ct,m as dt,n as mt,o as pt}from"./chunk-SYXAEWFN.js";import"./chunk-2YIWQ57T.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-ZBRZ5T2G.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-IWQURDYO.js";import"./chunk-2AXFYDWF.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-B5VRY4NI.js";import"./chunk-N2A3KIVY.js";import"./chunk-VWTBHLMX.js";import"./chunk-P5KHF46N.js";import{a as ht}from"./chunk-PF5ZXMEG.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-QIMIARFO.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-3AFZBXNX.js";import{f as gt,g as ft}from"./chunk-VIUCCUJ4.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-QAKL2D7O.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-5MUJZODV.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{C as tt,E as st,F as ot,H as nt}from"./chunk-KH4PKJGD.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
2
2
  `)}
3
3
 
4
4
  ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).