agentix-cli 0.126.2 → 0.127.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.
- package/dist/{App-BUYK4EGC.js → App-FF66N2KH.js} +2 -2
- package/dist/{ChatApp-ZS6EPDDK.js → ChatApp-HMHQZVVD.js} +2 -2
- package/dist/{absorb-eval-5Y5IZWW2.js → absorb-eval-ERKVVTGG.js} +2 -2
- package/dist/{agent-WJTYM5HR.js → agent-UAWDO3I2.js} +2 -2
- package/dist/{board-dashboard-DQR2OSV7.js → board-dashboard-Y2OECKDG.js} +303 -228
- package/dist/board-dashboard-Y2OECKDG.js.map +1 -0
- package/dist/{chunk-JUIL2EW3.js → chunk-3KYZOC7N.js} +2 -2
- package/dist/{chunk-JIXNSA67.js → chunk-4WZGZ2Z6.js} +2 -2
- package/dist/chunk-52SIHG45.js +4 -0
- package/dist/chunk-52SIHG45.js.map +1 -0
- package/dist/{chunk-FHBPKMCF.js → chunk-73WQ42PO.js} +2 -2
- package/dist/{chunk-6GLJIA25.js → chunk-CKYPQMUD.js} +2 -2
- package/dist/chunk-COWAAE54.js +128 -0
- package/dist/chunk-COWAAE54.js.map +1 -0
- package/dist/{chunk-ZQWWMAMJ.js → chunk-EHLTZ6IB.js} +2 -2
- package/dist/{chunk-Z7XXUYBB.js → chunk-EJT3F6QM.js} +33 -35
- package/dist/chunk-EJT3F6QM.js.map +1 -0
- package/dist/{chunk-LVV7JBHM.js → chunk-HNBW5Q47.js} +2 -2
- package/dist/{chunk-UUVFH7BO.js → chunk-HYRBBH6T.js} +98 -98
- package/dist/chunk-HYRBBH6T.js.map +1 -0
- package/dist/{chunk-CY6ABHF2.js → chunk-I4DGMFQG.js} +2 -2
- package/dist/{chunk-VXKNB4AW.js → chunk-LTH3AYXC.js} +2 -2
- package/dist/{chunk-O4XEQTEN.js → chunk-NUSROFTJ.js} +3 -3
- package/dist/chunk-NUSROFTJ.js.map +1 -0
- package/dist/chunk-O6FP3LPC.js +4 -0
- package/dist/chunk-O6FP3LPC.js.map +1 -0
- package/dist/{chunk-WMTGAVPW.js → chunk-PH43FUU7.js} +2 -2
- package/dist/{chunk-2W3X6H7Z.js → chunk-PLIT25TH.js} +2 -2
- package/dist/chunk-QUXMLLX5.js +2 -0
- package/dist/chunk-QUXMLLX5.js.map +1 -0
- package/dist/{chunk-D6SWAB5J.js → chunk-QWQOI4G4.js} +32 -32
- package/dist/chunk-QWQOI4G4.js.map +1 -0
- package/dist/{chunk-YNA5T43U.js → chunk-TJ4P4WW2.js} +2 -2
- package/dist/{chunk-2C3X6DVD.js → chunk-UJXS4MS3.js} +2 -2
- package/dist/{chunk-GUQDPA6R.js → chunk-VBJTGTF5.js} +2 -2
- package/dist/{chunk-FVG2BADS.js → chunk-XX5QKBX4.js} +2 -2
- package/dist/{chunk-QQYXYJOG.js → chunk-XYT6XY7G.js} +2 -2
- package/dist/{chunk-46JKX6CT.js → chunk-Y27RUOD2.js} +10 -10
- package/dist/chunk-Y27RUOD2.js.map +1 -0
- package/dist/{chunk-WUDVBPQV.js → chunk-YV22EOGL.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-PO5LDFS4.js → client-2VVRJ3UF.js} +2 -2
- package/dist/{config-L2RQ6EJX.js → config-YSKHOV44.js} +2 -2
- package/dist/config-mutate-47WZDZBO.js +2 -0
- package/dist/config-mutator-7DIEQUB5.js +2 -0
- package/dist/doctor-Q3QNZVLC.js +2 -0
- package/dist/{follow-up-tool-AIOLNUF7.js → follow-up-tool-GKZVG4L2.js} +2 -2
- package/dist/{follow-up-tool-AIOLNUF7.js.map → follow-up-tool-GKZVG4L2.js.map} +1 -1
- package/dist/hub-DNPINTIF.js +2 -0
- package/dist/index.d.ts +115 -50
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/notes-YLTNRMB5.js +2 -0
- package/dist/notes-settings-X63D5HPM.js +2 -0
- package/dist/{program-LGCT7FFJ.js → program-4QWUOJE3.js} +214 -214
- package/dist/program-4QWUOJE3.js.map +1 -0
- package/dist/{promote-MQYJMGGZ.js → promote-PETKX7KR.js} +2 -2
- package/dist/query-D44BUTH3.js +2 -0
- package/dist/registry-2XDO53AJ.js +2 -0
- package/dist/{request-planner-XYHM26CO.js → request-planner-A3WJNPXO.js} +2 -2
- package/dist/{review-candidates-XRBAMRBH.js → review-candidates-A6ID2RDX.js} +2 -2
- package/dist/routing-NPP3MEUW.js +2 -0
- package/dist/schedule-tool-ZECUQMQK.js +2 -0
- package/dist/scheduler-T6VLBM3U.js +2 -0
- package/dist/scheduler-T6VLBM3U.js.map +1 -0
- package/dist/{seat-LKBZ6SDS.js → seat-D3DBYTSC.js} +2 -2
- package/dist/seat-D3DBYTSC.js.map +1 -0
- package/dist/{select-BSC3TFMZ.js → select-RFY64RY7.js} +2 -2
- package/dist/{set-enabled-YWXWSKME.js → set-enabled-AU66DR5C.js} +2 -2
- package/dist/{tool-FZEC5FQX.js → tool-F3YA2ZZQ.js} +2 -2
- package/dist/{tool-FZEC5FQX.js.map → tool-F3YA2ZZQ.js.map} +1 -1
- package/dist/{tool-5JTCSRTW.js → tool-PCHIVR27.js} +2 -2
- package/dist/{tool-5JTCSRTW.js.map → tool-PCHIVR27.js.map} +1 -1
- package/dist/wiki-NI3ZPUZS.js +2 -0
- package/dist/wiki-NI3ZPUZS.js.map +1 -0
- package/package.json +1 -1
- package/dist/board-dashboard-DQR2OSV7.js.map +0 -1
- package/dist/chunk-46JKX6CT.js.map +0 -1
- package/dist/chunk-5DFUUYEA.js +0 -126
- package/dist/chunk-5DFUUYEA.js.map +0 -1
- package/dist/chunk-D6SWAB5J.js.map +0 -1
- package/dist/chunk-O4XEQTEN.js.map +0 -1
- package/dist/chunk-UUVFH7BO.js.map +0 -1
- package/dist/chunk-Z7XXUYBB.js.map +0 -1
- package/dist/config-mutator-44OAOZXM.js +0 -2
- package/dist/doctor-AU5TCOSG.js +0 -2
- package/dist/hub-53YQQCVA.js +0 -2
- package/dist/program-LGCT7FFJ.js.map +0 -1
- package/dist/query-DNJONEKC.js +0 -2
- package/dist/registry-5A3SLBVJ.js +0 -2
- package/dist/routing-OMIWZKNC.js +0 -2
- package/dist/schedule-tool-YRANRFHO.js +0 -2
- package/dist/scheduler-L4P4Z55R.js +0 -2
- package/dist/wiki-BT3H2WCD.js +0 -2
- /package/dist/{App-BUYK4EGC.js.map → App-FF66N2KH.js.map} +0 -0
- /package/dist/{ChatApp-ZS6EPDDK.js.map → ChatApp-HMHQZVVD.js.map} +0 -0
- /package/dist/{absorb-eval-5Y5IZWW2.js.map → absorb-eval-ERKVVTGG.js.map} +0 -0
- /package/dist/{agent-WJTYM5HR.js.map → agent-UAWDO3I2.js.map} +0 -0
- /package/dist/{chunk-JUIL2EW3.js.map → chunk-3KYZOC7N.js.map} +0 -0
- /package/dist/{chunk-JIXNSA67.js.map → chunk-4WZGZ2Z6.js.map} +0 -0
- /package/dist/{chunk-FHBPKMCF.js.map → chunk-73WQ42PO.js.map} +0 -0
- /package/dist/{chunk-6GLJIA25.js.map → chunk-CKYPQMUD.js.map} +0 -0
- /package/dist/{chunk-ZQWWMAMJ.js.map → chunk-EHLTZ6IB.js.map} +0 -0
- /package/dist/{chunk-LVV7JBHM.js.map → chunk-HNBW5Q47.js.map} +0 -0
- /package/dist/{chunk-CY6ABHF2.js.map → chunk-I4DGMFQG.js.map} +0 -0
- /package/dist/{chunk-VXKNB4AW.js.map → chunk-LTH3AYXC.js.map} +0 -0
- /package/dist/{chunk-WMTGAVPW.js.map → chunk-PH43FUU7.js.map} +0 -0
- /package/dist/{chunk-2W3X6H7Z.js.map → chunk-PLIT25TH.js.map} +0 -0
- /package/dist/{chunk-YNA5T43U.js.map → chunk-TJ4P4WW2.js.map} +0 -0
- /package/dist/{chunk-2C3X6DVD.js.map → chunk-UJXS4MS3.js.map} +0 -0
- /package/dist/{chunk-GUQDPA6R.js.map → chunk-VBJTGTF5.js.map} +0 -0
- /package/dist/{chunk-FVG2BADS.js.map → chunk-XX5QKBX4.js.map} +0 -0
- /package/dist/{chunk-QQYXYJOG.js.map → chunk-XYT6XY7G.js.map} +0 -0
- /package/dist/{chunk-WUDVBPQV.js.map → chunk-YV22EOGL.js.map} +0 -0
- /package/dist/{client-PO5LDFS4.js.map → client-2VVRJ3UF.js.map} +0 -0
- /package/dist/{config-L2RQ6EJX.js.map → config-YSKHOV44.js.map} +0 -0
- /package/dist/{config-mutator-44OAOZXM.js.map → config-mutate-47WZDZBO.js.map} +0 -0
- /package/dist/{doctor-AU5TCOSG.js.map → config-mutator-7DIEQUB5.js.map} +0 -0
- /package/dist/{hub-53YQQCVA.js.map → doctor-Q3QNZVLC.js.map} +0 -0
- /package/dist/{promote-MQYJMGGZ.js.map → hub-DNPINTIF.js.map} +0 -0
- /package/dist/{query-DNJONEKC.js.map → notes-YLTNRMB5.js.map} +0 -0
- /package/dist/{registry-5A3SLBVJ.js.map → notes-settings-X63D5HPM.js.map} +0 -0
- /package/dist/{routing-OMIWZKNC.js.map → promote-PETKX7KR.js.map} +0 -0
- /package/dist/{schedule-tool-YRANRFHO.js.map → query-D44BUTH3.js.map} +0 -0
- /package/dist/{scheduler-L4P4Z55R.js.map → registry-2XDO53AJ.js.map} +0 -0
- /package/dist/{request-planner-XYHM26CO.js.map → request-planner-A3WJNPXO.js.map} +0 -0
- /package/dist/{review-candidates-XRBAMRBH.js.map → review-candidates-A6ID2RDX.js.map} +0 -0
- /package/dist/{seat-LKBZ6SDS.js.map → routing-NPP3MEUW.js.map} +0 -0
- /package/dist/{wiki-BT3H2WCD.js.map → schedule-tool-ZECUQMQK.js.map} +0 -0
- /package/dist/{select-BSC3TFMZ.js.map → select-RFY64RY7.js.map} +0 -0
- /package/dist/{set-enabled-YWXWSKME.js.map → set-enabled-AU66DR5C.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-
|
|
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-2XDO53AJ.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-
|
|
126
|
+
//# sourceMappingURL=chunk-YV22EOGL.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-
|
|
2
|
+
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-4QWUOJE3.js"),{installCliSignalExit:i}=await import("./signal-exit-WL7G3EEZ.js");i();var e=await r();process.argv.slice(2).length===0?e.outputHelp():e.parse();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=client-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-73WQ42PO.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-2VVRJ3UF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ca as a,da as b,ea as c,fa as d,ga as e,ha as f,ia as g,ja as h,ka as i,la as j,ma as k,na as l,oa as m,pa as n,ra as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=config-
|
|
1
|
+
import{ca as a,da as b,ea as c,fa as d,ga as e,ha as f,ia as g,ja as h,ka as i,la as j,ma as k,na as l,oa as m,pa as n,ra as o}from"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";o();export{a as INTEGRATION_KINDS,j as approvalsConfigSchema,d as callsSchema,c as cameraBotSchema,k as daemonConfigSchema,b as eventSubscriptionSchema,l as expandEnvVars,m as loadDaemonConfig,h as membersConfigSchema,g as peopleConfigSchema,f as personSchema,i as requestStatusConfigSchema,e as requestsConfigSchema,n as validateWorkspaces};
|
|
2
|
+
//# sourceMappingURL=config-YSKHOV44.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-O6FP3LPC.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
|
|
2
|
+
//# sourceMappingURL=config-mutate-47WZDZBO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-PH43FUU7.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-7DIEQUB5.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-CKYPQMUD.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
|
|
2
|
+
//# sourceMappingURL=doctor-Q3QNZVLC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-I4DGMFQG.js";import"./chunk-RKPAVWXF.js";import{b as m}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-XYT6XY7G.js";import"./chunk-COWAAE54.js";import"./chunk-PH43FUU7.js";import"./chunk-52SIHG45.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function k(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(r=>`- ${String(r.at).slice(0,16).replace("T"," ")} ${r.step} ${r.status}${r.note?`: ${r.note}`:""}`)].filter(Boolean).join(`
|
|
2
2
|
`)}async function T(t,u){let r=u.fetch??fetch,$=u.daemonUrl.replace(/\/$/,""),a=(p(t.action)||"list").toLowerCase(),f=u.env??process.env,w=async i=>{let l=await r(`${$}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(a==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(c=>[`${c.tag}:`,...c.rows.map(s=>`- ${s.runId} "${s.title}" on ${s.step}: waiting on ${s.waitingOn} (since ${String(s.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
|
|
3
3
|
`)).join(`
|
|
4
4
|
`):"No follow-up workflows are running."}if(a==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),c=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!c.ok)return`Error: ${c.data?.error||`HTTP ${c.status}`}`;let s=c.data.matches??[];return s.length?["Saved workflows, best fit first (confidence 0-1):",...s.map(d=>`- ${d.workflowId} "${d.title}" (${d.confidence}${d.autoStart?", starts without asking":""}): ${d.steps.map(I=>I.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
|
|
5
5
|
`):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(a==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?k(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await r(`${$}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...m(f)},body:JSON.stringify({action:a,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(a==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return a==="done"?`Step recorded as done. ${n.run?k(n.run):""}`.trim():a==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
|
|
6
|
-
//# sourceMappingURL=follow-up-tool-
|
|
6
|
+
//# sourceMappingURL=follow-up-tool-GKZVG4L2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/workflows/follow-up-tool.ts"],"sourcesContent":["import { resolveScheduleCaller } from \"@/crons/schedule-tool\"\nimport { callerHeaders } from \"@/calls/service\"\n\n// --- Agent-facing `agentx_workflow` tool (#788) ---\n//\n// A request with several steps is run as a workflow, not by hand:\n// match saved workflows that fit the request in front of you\n// start start one (workflowId), or build one from the owner's words\n// (title + steps) and run it; tags say what it concerns\n// status one run: the step it is on and what it waits on\n// list every follow-up still going, grouped by tag\n// done the step you own is finished (evidence)\n// blocked your step cannot go on without the owner (reason)\n// propose ask the owner to keep a workflow as a reusable template\n// It talks to the daemon's /follow-up endpoints.\n\nexport interface WorkflowToolDeps {\n daemonUrl: string\n fetch?: typeof fetch\n env?: NodeJS.ProcessEnv\n}\n\nconst str = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\")\n\nfunction describe(run: any): string {\n const lines = [\n `Run ${run.runId} \"${run.title}\" [${run.status}] on step ${run.step}: waiting on ${run.waitingOn}.`,\n run.tags?.length ? `Tags: ${run.tags.join(\", \")}` : \"\",\n ...(run.steps ?? []).slice(-8).map((s: any) => `- ${String(s.at).slice(0, 16).replace(\"T\", \" \")} ${s.step} ${s.status}${s.note ? `: ${s.note}` : \"\"}`),\n ]\n return lines.filter(Boolean).join(\"\\n\")\n}\n\n/** Returns the text the agent sees. Every refusal is text, never a throw. */\nexport async function runWorkflowTool(args: Record<string, unknown>, deps: WorkflowToolDeps): Promise<string> {\n const doFetch = deps.fetch ?? fetch\n const base = deps.daemonUrl.replace(/\\/$/, \"\")\n const action = (str(args.action) || \"list\").toLowerCase()\n const env = deps.env ?? process.env\n const read = async (path: string) => {\n const res = await doFetch(`${base}${path}`, { signal: AbortSignal.timeout(10_000) })\n const data = await res.json().catch(() => ({})) as any\n return { ok: res.ok, status: res.status, data }\n }\n\n try {\n if (action === \"list\") {\n const r = await read(\"/follow-up\")\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n const groups = r.data.groups ?? []\n if (!groups.length) return \"No follow-up workflows are running.\"\n return groups.map((g: any) => [`${g.tag}:`, ...g.rows.map((row: any) => `- ${row.runId} \"${row.title}\" on ${row.step}: waiting on ${row.waitingOn} (since ${String(row.since).slice(0, 16).replace(\"T\", \" \")} UTC)`)].join(\"\\n\")).join(\"\\n\")\n }\n if (action === \"match\") {\n const q = str(args.request) || str(args.title)\n if (!q) return \"Error: match needs `request`: the owner's request in their words.\"\n const caller = resolveScheduleCaller(args, env)\n const r = await read(`/follow-up/match?q=${encodeURIComponent(q)}${caller ? `&agentId=${encodeURIComponent(caller.agentId)}` : \"\"}`)\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n const matches = r.data.matches ?? []\n if (!matches.length) return \"No saved workflow fits. If the request has several steps, build one: start with title and steps.\"\n return [\n \"Saved workflows, best fit first (confidence 0-1):\",\n ...matches.map((x: any) => `- ${x.workflowId} \"${x.title}\" (${x.confidence}${x.autoStart ? \", starts without asking\" : \"\"}): ${x.steps.map((s: any) => s.id).join(\" → \")}`),\n `Start one with {action:\"start\", workflowId:\"<id>\", title:\"…\", tags:[\"client:<name>\"]}. Run its steps through the workflow, not by hand.`,\n ].join(\"\\n\")\n }\n if (action === \"status\") {\n const runId = str(args.runId)\n if (!runId) return \"Error: status needs runId.\"\n const r = await read(`/follow-up/${encodeURIComponent(runId)}`)\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n return describe(r.data.run)\n }\n\n const caller = resolveScheduleCaller(args, env)\n if (!caller) return \"Error: couldn't tell which agent you are. Pass callerAgentId.\"\n const res = await doFetch(`${base}/follow-up`, {\n method: \"POST\",\n // The headers name this run: the daemon refuses a write that does\n // not come from a running turn of the agent.\n headers: { \"Content-Type\": \"application/json\", ...callerHeaders(env) },\n body: JSON.stringify({\n action, agentId: caller.agentId,\n workflowId: args.workflowId, title: args.title, description: args.description, tags: args.tags, inputs: args.inputs,\n steps: args.steps, edges: args.edges, approval: args.approval, autoStart: args.autoStart, requestId: args.requestId,\n runId: args.runId, step: args.step, evidence: args.evidence, note: args.note, reason: args.reason, fromRun: args.fromRun,\n }),\n signal: AbortSignal.timeout(20_000),\n })\n const data = await res.json().catch(() => ({})) as any\n if (!res.ok) return `Error: ${data?.error || `HTTP ${res.status}`}`\n if (action === \"start\") {\n const run = data.run\n return [\n `Started run ${run.runId} \"${run.title}\"${data.built ? \" (built from the steps you gave; propose it with fromRun to keep it)\" : \"\"}.`,\n data.awaitingApproval ? \"It waits for the owner's approval before the first step.\" : `It is on step ${run.step}: ${run.waitingOn}.`,\n \"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.\",\n ...(data.warning ? [`Note: ${data.warning}`] : []),\n ].join(\" \")\n }\n if (action === \"done\") return `Step recorded as done. ${data.run ? describe(data.run) : \"\"}`.trim()\n if (action === \"blocked\") return \"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.\"\n return `Saved ${data.workflowId} switched off, and asked the owner (card ${data.cardId}) whether to keep it as a reusable workflow.`\n } catch (e: any) {\n return `Error: couldn't reach the daemon (${e?.message ?? e}).`\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/workflows/follow-up-tool.ts"],"sourcesContent":["import { resolveScheduleCaller } from \"@/crons/schedule-tool\"\nimport { callerHeaders } from \"@/calls/service\"\n\n// --- Agent-facing `agentx_workflow` tool (#788) ---\n//\n// A request with several steps is run as a workflow, not by hand:\n// match saved workflows that fit the request in front of you\n// start start one (workflowId), or build one from the owner's words\n// (title + steps) and run it; tags say what it concerns\n// status one run: the step it is on and what it waits on\n// list every follow-up still going, grouped by tag\n// done the step you own is finished (evidence)\n// blocked your step cannot go on without the owner (reason)\n// propose ask the owner to keep a workflow as a reusable template\n// It talks to the daemon's /follow-up endpoints.\n\nexport interface WorkflowToolDeps {\n daemonUrl: string\n fetch?: typeof fetch\n env?: NodeJS.ProcessEnv\n}\n\nconst str = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\")\n\nfunction describe(run: any): string {\n const lines = [\n `Run ${run.runId} \"${run.title}\" [${run.status}] on step ${run.step}: waiting on ${run.waitingOn}.`,\n run.tags?.length ? `Tags: ${run.tags.join(\", \")}` : \"\",\n ...(run.steps ?? []).slice(-8).map((s: any) => `- ${String(s.at).slice(0, 16).replace(\"T\", \" \")} ${s.step} ${s.status}${s.note ? `: ${s.note}` : \"\"}`),\n ]\n return lines.filter(Boolean).join(\"\\n\")\n}\n\n/** Returns the text the agent sees. Every refusal is text, never a throw. */\nexport async function runWorkflowTool(args: Record<string, unknown>, deps: WorkflowToolDeps): Promise<string> {\n const doFetch = deps.fetch ?? fetch\n const base = deps.daemonUrl.replace(/\\/$/, \"\")\n const action = (str(args.action) || \"list\").toLowerCase()\n const env = deps.env ?? process.env\n const read = async (path: string) => {\n const res = await doFetch(`${base}${path}`, { signal: AbortSignal.timeout(10_000) })\n const data = await res.json().catch(() => ({})) as any\n return { ok: res.ok, status: res.status, data }\n }\n\n try {\n if (action === \"list\") {\n const r = await read(\"/follow-up\")\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n const groups = r.data.groups ?? []\n if (!groups.length) return \"No follow-up workflows are running.\"\n return groups.map((g: any) => [`${g.tag}:`, ...g.rows.map((row: any) => `- ${row.runId} \"${row.title}\" on ${row.step}: waiting on ${row.waitingOn} (since ${String(row.since).slice(0, 16).replace(\"T\", \" \")} UTC)`)].join(\"\\n\")).join(\"\\n\")\n }\n if (action === \"match\") {\n const q = str(args.request) || str(args.title)\n if (!q) return \"Error: match needs `request`: the owner's request in their words.\"\n const caller = resolveScheduleCaller(args, env)\n const r = await read(`/follow-up/match?q=${encodeURIComponent(q)}${caller ? `&agentId=${encodeURIComponent(caller.agentId)}` : \"\"}`)\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n const matches = r.data.matches ?? []\n if (!matches.length) return \"No saved workflow fits. If the request has several steps, build one: start with title and steps.\"\n return [\n \"Saved workflows, best fit first (confidence 0-1):\",\n ...matches.map((x: any) => `- ${x.workflowId} \"${x.title}\" (${x.confidence}${x.autoStart ? \", starts without asking\" : \"\"}): ${x.steps.map((s: any) => s.id).join(\" → \")}`),\n `Start one with {action:\"start\", workflowId:\"<id>\", title:\"…\", tags:[\"client:<name>\"]}. Run its steps through the workflow, not by hand.`,\n ].join(\"\\n\")\n }\n if (action === \"status\") {\n const runId = str(args.runId)\n if (!runId) return \"Error: status needs runId.\"\n const r = await read(`/follow-up/${encodeURIComponent(runId)}`)\n if (!r.ok) return `Error: ${r.data?.error || `HTTP ${r.status}`}`\n return describe(r.data.run)\n }\n\n const caller = resolveScheduleCaller(args, env)\n if (!caller) return \"Error: couldn't tell which agent you are. Pass callerAgentId.\"\n const res = await doFetch(`${base}/follow-up`, {\n method: \"POST\",\n // The headers name this run: the daemon refuses a write that does\n // not come from a running turn of the agent.\n headers: { \"Content-Type\": \"application/json\", ...callerHeaders(env) },\n body: JSON.stringify({\n action, agentId: caller.agentId,\n workflowId: args.workflowId, title: args.title, description: args.description, tags: args.tags, inputs: args.inputs,\n steps: args.steps, edges: args.edges, approval: args.approval, autoStart: args.autoStart, requestId: args.requestId,\n runId: args.runId, step: args.step, evidence: args.evidence, note: args.note, reason: args.reason, fromRun: args.fromRun,\n }),\n signal: AbortSignal.timeout(20_000),\n })\n const data = await res.json().catch(() => ({})) as any\n if (!res.ok) return `Error: ${data?.error || `HTTP ${res.status}`}`\n if (action === \"start\") {\n const run = data.run\n return [\n `Started run ${run.runId} \"${run.title}\"${data.built ? \" (built from the steps you gave; propose it with fromRun to keep it)\" : \"\"}.`,\n data.awaitingApproval ? \"It waits for the owner's approval before the first step.\" : `It is on step ${run.step}: ${run.waitingOn}.`,\n \"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.\",\n ...(data.warning ? [`Note: ${data.warning}`] : []),\n ].join(\" \")\n }\n if (action === \"done\") return `Step recorded as done. ${data.run ? describe(data.run) : \"\"}`.trim()\n if (action === \"blocked\") return \"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.\"\n return `Saved ${data.workflowId} switched off, and asked the owner (card ${data.cardId}) whether to keep it as a reusable workflow.`\n } catch (e: any) {\n return `Error: couldn't reach the daemon (${e?.message ?? e}).`\n }\n}\n"],"mappings":"4bAsBA,IAAMA,EAAOC,GAAgB,OAAOA,GAAM,SAAWA,EAAE,KAAK,EAAI,GAEhE,SAASC,EAASC,EAAkB,CAMlC,MALc,CACZ,OAAOA,EAAI,UAAUA,EAAI,WAAWA,EAAI,mBAAmBA,EAAI,oBAAoBA,EAAI,aACvFA,EAAI,MAAM,OAAS,SAASA,EAAI,KAAK,KAAK,IAAI,IAAM,GACpD,IAAIA,EAAI,OAAS,CAAC,GAAG,MAAM,EAAE,EAAE,IAAKC,GAAW,KAAK,OAAOA,EAAE,EAAE,EAAE,MAAM,EAAG,EAAE,EAAE,QAAQ,IAAK,GAAG,KAAKA,EAAE,QAAQA,EAAE,SAASA,EAAE,KAAO,KAAKA,EAAE,OAAS,IAAI,CACvJ,EACa,OAAO,OAAO,EAAE,KAAK;AAAA,CAAI,CACxC,CAGA,eAAsBC,EAAgBC,EAA+BC,EAAyC,CAC5G,IAAMC,EAAUD,EAAK,OAAS,MACxBE,EAAOF,EAAK,UAAU,QAAQ,MAAO,EAAE,EACvCG,GAAUV,EAAIM,EAAK,MAAM,GAAK,QAAQ,YAAY,EAClDK,EAAMJ,EAAK,KAAO,QAAQ,IAC1BK,EAAO,MAAOC,GAAiB,CACnC,IAAMC,EAAM,MAAMN,EAAQ,GAAGC,IAAOI,IAAQ,CAAE,OAAQ,YAAY,QAAQ,GAAM,CAAE,CAAC,EAC7EE,EAAO,MAAMD,EAAI,KAAK,EAAE,MAAM,KAAO,CAAC,EAAE,EAC9C,MAAO,CAAE,GAAIA,EAAI,GAAI,OAAQA,EAAI,OAAQ,KAAAC,CAAK,CAChD,EAEA,GAAI,CACF,GAAIL,IAAW,OAAQ,CACrB,IAAMM,EAAI,MAAMJ,EAAK,YAAY,EACjC,GAAI,CAACI,EAAE,GAAI,MAAO,UAAUA,EAAE,MAAM,OAAS,QAAQA,EAAE,WACvD,IAAMC,EAASD,EAAE,KAAK,QAAU,CAAC,EACjC,OAAKC,EAAO,OACLA,EAAO,IAAKC,GAAW,CAAC,GAAGA,EAAE,OAAQ,GAAGA,EAAE,KAAK,IAAKC,GAAa,KAAKA,EAAI,UAAUA,EAAI,aAAaA,EAAI,oBAAoBA,EAAI,oBAAoB,OAAOA,EAAI,KAAK,EAAE,MAAM,EAAG,EAAE,EAAE,QAAQ,IAAK,GAAG,QAAQ,CAAC,EAAE,KAAK;AAAA,CAAI,CAAC,EAAE,KAAK;AAAA,CAAI,EADhN,sCAG7B,GAAIT,IAAW,QAAS,CACtB,IAAMU,EAAIpB,EAAIM,EAAK,OAAO,GAAKN,EAAIM,EAAK,KAAK,EAC7C,GAAI,CAACc,EAAG,MAAO,oEACf,IAAMC,EAASC,EAAsBhB,EAAMK,CAAG,EACxCK,EAAI,MAAMJ,EAAK,sBAAsB,mBAAmBQ,CAAC,IAAIC,EAAS,YAAY,mBAAmBA,EAAO,OAAO,IAAM,IAAI,EACnI,GAAI,CAACL,EAAE,GAAI,MAAO,UAAUA,EAAE,MAAM,OAAS,QAAQA,EAAE,WACvD,IAAMO,EAAUP,EAAE,KAAK,SAAW,CAAC,EACnC,OAAKO,EAAQ,OACN,CACL,oDACA,GAAGA,EAAQ,IAAKC,GAAW,KAAKA,EAAE,eAAeA,EAAE,WAAWA,EAAE,aAAaA,EAAE,UAAY,0BAA4B,QAAQA,EAAE,MAAM,IAAKpB,GAAWA,EAAE,EAAE,EAAE,KAAK,UAAK,GAAG,EAC1K,8IACF,EAAE,KAAK;AAAA,CAAI,EALiB,mGAO9B,GAAIM,IAAW,SAAU,CACvB,IAAMe,EAAQzB,EAAIM,EAAK,KAAK,EAC5B,GAAI,CAACmB,EAAO,MAAO,6BACnB,IAAMT,EAAI,MAAMJ,EAAK,cAAc,mBAAmBa,CAAK,GAAG,EAC9D,OAAKT,EAAE,GACAd,EAASc,EAAE,KAAK,GAAG,EADR,UAAUA,EAAE,MAAM,OAAS,QAAQA,EAAE,WAIzD,IAAMK,EAASC,EAAsBhB,EAAMK,CAAG,EAC9C,GAAI,CAACU,EAAQ,MAAO,gEACpB,IAAMP,EAAM,MAAMN,EAAQ,GAAGC,cAAkB,CAC7C,OAAQ,OAGR,QAAS,CAAE,eAAgB,mBAAoB,GAAGiB,EAAcf,CAAG,CAAE,EACrE,KAAM,KAAK,UAAU,CACnB,OAAAD,EAAQ,QAASW,EAAO,QACxB,WAAYf,EAAK,WAAY,MAAOA,EAAK,MAAO,YAAaA,EAAK,YAAa,KAAMA,EAAK,KAAM,OAAQA,EAAK,OAC7G,MAAOA,EAAK,MAAO,MAAOA,EAAK,MAAO,SAAUA,EAAK,SAAU,UAAWA,EAAK,UAAW,UAAWA,EAAK,UAC1G,MAAOA,EAAK,MAAO,KAAMA,EAAK,KAAM,SAAUA,EAAK,SAAU,KAAMA,EAAK,KAAM,OAAQA,EAAK,OAAQ,QAASA,EAAK,OACnH,CAAC,EACD,OAAQ,YAAY,QAAQ,GAAM,CACpC,CAAC,EACKS,EAAO,MAAMD,EAAI,KAAK,EAAE,MAAM,KAAO,CAAC,EAAE,EAC9C,GAAI,CAACA,EAAI,GAAI,MAAO,UAAUC,GAAM,OAAS,QAAQD,EAAI,WACzD,GAAIJ,IAAW,QAAS,CACtB,IAAMP,EAAMY,EAAK,IACjB,MAAO,CACL,eAAeZ,EAAI,UAAUA,EAAI,SAASY,EAAK,MAAQ,uEAAyE,MAChIA,EAAK,iBAAmB,2DAA6D,iBAAiBZ,EAAI,SAASA,EAAI,aACvH,6IACA,GAAIY,EAAK,QAAU,CAAC,SAASA,EAAK,SAAS,EAAI,CAAC,CAClD,EAAE,KAAK,GAAG,EAEZ,OAAIL,IAAW,OAAe,0BAA0BK,EAAK,IAAMb,EAASa,EAAK,GAAG,EAAI,KAAK,KAAK,EAC9FL,IAAW,UAAkB,mGAC1B,SAASK,EAAK,sDAAsDA,EAAK,oDAClF,OAASY,EAAP,CACA,MAAO,qCAAqCA,GAAG,SAAWA,KAC5D,CACF","names":["str","v","describe","run","s","runWorkflowTool","args","deps","doFetch","base","action","env","read","path","res","data","r","groups","g","row","q","caller","resolveScheduleCaller","matches","x","runId","callerHeaders","e"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-TJ4P4WW2.js";import"./chunk-EHLTZ6IB.js";import"./chunk-3PGPN323.js";import"./chunk-LTH3AYXC.js";import"./chunk-WPNRDEHW.js";import"./chunk-3KYZOC7N.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
|
|
2
|
+
//# sourceMappingURL=hub-DNPINTIF.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4234,6 +4234,46 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4234
4234
|
fireToken?: string | undefined;
|
|
4235
4235
|
createdBy?: string | undefined;
|
|
4236
4236
|
}>>>;
|
|
4237
|
+
/** Notes agents leave for the wiki observe/sweep run (#825). */
|
|
4238
|
+
wikiNotes: z.ZodDefault<z.ZodEffects<z.ZodObject<{
|
|
4239
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
4240
|
+
/** Agent that runs the wiki observe/sweep schedule. Notes are addressed
|
|
4241
|
+
* to it and kept on its node. */
|
|
4242
|
+
inbox: z.ZodOptional<z.ZodString>;
|
|
4243
|
+
/** Schedule ids (keys of `crons`) that read the inbox when they start.
|
|
4244
|
+
* Each must run as the inbox agent. Empty: notes are kept but no run
|
|
4245
|
+
* reads them. */
|
|
4246
|
+
crons: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4247
|
+
/** Most notes one run is given. The rest wait for the next run. */
|
|
4248
|
+
maxNotesPerRun: z.ZodDefault<z.ZodNumber>;
|
|
4249
|
+
/** A note deferred this many times stops being offered (status
|
|
4250
|
+
* `expired`), so notes nobody can check do not crowd out new ones. */
|
|
4251
|
+
maxDeferrals: z.ZodDefault<z.ZodNumber>;
|
|
4252
|
+
}, "strip", z.ZodTypeAny, {
|
|
4253
|
+
enabled: boolean;
|
|
4254
|
+
crons: string[];
|
|
4255
|
+
maxNotesPerRun: number;
|
|
4256
|
+
maxDeferrals: number;
|
|
4257
|
+
inbox?: string | undefined;
|
|
4258
|
+
}, {
|
|
4259
|
+
enabled?: boolean | undefined;
|
|
4260
|
+
inbox?: string | undefined;
|
|
4261
|
+
crons?: string[] | undefined;
|
|
4262
|
+
maxNotesPerRun?: number | undefined;
|
|
4263
|
+
maxDeferrals?: number | undefined;
|
|
4264
|
+
}>, {
|
|
4265
|
+
enabled: boolean;
|
|
4266
|
+
crons: string[];
|
|
4267
|
+
maxNotesPerRun: number;
|
|
4268
|
+
maxDeferrals: number;
|
|
4269
|
+
inbox?: string | undefined;
|
|
4270
|
+
}, {
|
|
4271
|
+
enabled?: boolean | undefined;
|
|
4272
|
+
inbox?: string | undefined;
|
|
4273
|
+
crons?: string[] | undefined;
|
|
4274
|
+
maxNotesPerRun?: number | undefined;
|
|
4275
|
+
maxDeferrals?: number | undefined;
|
|
4276
|
+
}>>;
|
|
4237
4277
|
services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4238
4278
|
name: z.ZodString;
|
|
4239
4279
|
triggers: z.ZodArray<z.ZodObject<{
|
|
@@ -7600,6 +7640,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7600
7640
|
bind: string;
|
|
7601
7641
|
defaultAgent?: string | undefined;
|
|
7602
7642
|
};
|
|
7643
|
+
crons: Record<string, {
|
|
7644
|
+
enabled: boolean;
|
|
7645
|
+
agent: string;
|
|
7646
|
+
prompt: string;
|
|
7647
|
+
timeout: number;
|
|
7648
|
+
schedule: string;
|
|
7649
|
+
timezone: string;
|
|
7650
|
+
onError: ("notify" | "disable" | "log")[];
|
|
7651
|
+
model?: string | undefined;
|
|
7652
|
+
command?: string | undefined;
|
|
7653
|
+
notify?: {
|
|
7654
|
+
channel: string;
|
|
7655
|
+
chatId: string;
|
|
7656
|
+
accountId?: string | undefined;
|
|
7657
|
+
} | undefined;
|
|
7658
|
+
approval?: {
|
|
7659
|
+
action: "delete" | "create";
|
|
7660
|
+
requestedBy: string;
|
|
7661
|
+
requestedAt: string;
|
|
7662
|
+
} | undefined;
|
|
7663
|
+
maxOutputTokens?: number | undefined;
|
|
7664
|
+
autonomy?: "report" | "propose" | "act" | undefined;
|
|
7665
|
+
deliverResult?: boolean | undefined;
|
|
7666
|
+
fireToken?: string | undefined;
|
|
7667
|
+
createdBy?: string | undefined;
|
|
7668
|
+
}>;
|
|
7603
7669
|
graph: {
|
|
7604
7670
|
enabled: boolean;
|
|
7605
7671
|
baseDir: string;
|
|
@@ -7639,32 +7705,13 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7639
7705
|
defaultModel?: string | undefined;
|
|
7640
7706
|
baseUrl?: string | undefined;
|
|
7641
7707
|
}>;
|
|
7642
|
-
|
|
7708
|
+
wikiNotes: {
|
|
7643
7709
|
enabled: boolean;
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
onError: ("notify" | "disable" | "log")[];
|
|
7650
|
-
model?: string | undefined;
|
|
7651
|
-
command?: string | undefined;
|
|
7652
|
-
notify?: {
|
|
7653
|
-
channel: string;
|
|
7654
|
-
chatId: string;
|
|
7655
|
-
accountId?: string | undefined;
|
|
7656
|
-
} | undefined;
|
|
7657
|
-
approval?: {
|
|
7658
|
-
action: "delete" | "create";
|
|
7659
|
-
requestedBy: string;
|
|
7660
|
-
requestedAt: string;
|
|
7661
|
-
} | undefined;
|
|
7662
|
-
maxOutputTokens?: number | undefined;
|
|
7663
|
-
autonomy?: "report" | "propose" | "act" | undefined;
|
|
7664
|
-
deliverResult?: boolean | undefined;
|
|
7665
|
-
fireToken?: string | undefined;
|
|
7666
|
-
createdBy?: string | undefined;
|
|
7667
|
-
}>;
|
|
7710
|
+
crons: string[];
|
|
7711
|
+
maxNotesPerRun: number;
|
|
7712
|
+
maxDeferrals: number;
|
|
7713
|
+
inbox?: string | undefined;
|
|
7714
|
+
};
|
|
7668
7715
|
services: Record<string, {
|
|
7669
7716
|
agent: string;
|
|
7670
7717
|
name: string;
|
|
@@ -8525,6 +8572,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8525
8572
|
defaultTitle?: string | undefined;
|
|
8526
8573
|
} | undefined;
|
|
8527
8574
|
} | undefined;
|
|
8575
|
+
crons?: Record<string, {
|
|
8576
|
+
agent: string;
|
|
8577
|
+
schedule: string;
|
|
8578
|
+
model?: string | undefined;
|
|
8579
|
+
enabled?: boolean | undefined;
|
|
8580
|
+
command?: string | undefined;
|
|
8581
|
+
prompt?: string | undefined;
|
|
8582
|
+
timeout?: number | undefined;
|
|
8583
|
+
timezone?: string | undefined;
|
|
8584
|
+
notify?: {
|
|
8585
|
+
channel: string;
|
|
8586
|
+
chatId: string;
|
|
8587
|
+
accountId?: string | undefined;
|
|
8588
|
+
} | undefined;
|
|
8589
|
+
approval?: {
|
|
8590
|
+
action: "delete" | "create";
|
|
8591
|
+
requestedBy: string;
|
|
8592
|
+
requestedAt: string;
|
|
8593
|
+
} | undefined;
|
|
8594
|
+
maxOutputTokens?: number | undefined;
|
|
8595
|
+
autonomy?: "report" | "propose" | "act" | undefined;
|
|
8596
|
+
onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
|
|
8597
|
+
deliverResult?: boolean | undefined;
|
|
8598
|
+
fireToken?: string | undefined;
|
|
8599
|
+
createdBy?: string | undefined;
|
|
8600
|
+
}> | undefined;
|
|
8528
8601
|
graph?: {
|
|
8529
8602
|
enabled?: boolean | undefined;
|
|
8530
8603
|
draftAgent?: string | undefined;
|
|
@@ -8564,32 +8637,13 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8564
8637
|
defaultModel?: string | undefined;
|
|
8565
8638
|
baseUrl?: string | undefined;
|
|
8566
8639
|
}> | undefined;
|
|
8567
|
-
|
|
8568
|
-
agent: string;
|
|
8569
|
-
schedule: string;
|
|
8570
|
-
model?: string | undefined;
|
|
8640
|
+
wikiNotes?: {
|
|
8571
8641
|
enabled?: boolean | undefined;
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
channel: string;
|
|
8578
|
-
chatId: string;
|
|
8579
|
-
accountId?: string | undefined;
|
|
8580
|
-
} | undefined;
|
|
8581
|
-
approval?: {
|
|
8582
|
-
action: "delete" | "create";
|
|
8583
|
-
requestedBy: string;
|
|
8584
|
-
requestedAt: string;
|
|
8585
|
-
} | undefined;
|
|
8586
|
-
maxOutputTokens?: number | undefined;
|
|
8587
|
-
autonomy?: "report" | "propose" | "act" | undefined;
|
|
8588
|
-
onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
|
|
8589
|
-
deliverResult?: boolean | undefined;
|
|
8590
|
-
fireToken?: string | undefined;
|
|
8591
|
-
createdBy?: string | undefined;
|
|
8592
|
-
}> | undefined;
|
|
8642
|
+
inbox?: string | undefined;
|
|
8643
|
+
crons?: string[] | undefined;
|
|
8644
|
+
maxNotesPerRun?: number | undefined;
|
|
8645
|
+
maxDeferrals?: number | undefined;
|
|
8646
|
+
} | undefined;
|
|
8593
8647
|
services?: Record<string, {
|
|
8594
8648
|
agent: string;
|
|
8595
8649
|
name: string;
|
|
@@ -14466,6 +14520,8 @@ interface CronRunResult {
|
|
|
14466
14520
|
traceId?: string;
|
|
14467
14521
|
/** Native provider session the run resumed or started, when reported. */
|
|
14468
14522
|
sessionId?: string;
|
|
14523
|
+
/** Wiki notes (#825) the run was given as input, by note id. */
|
|
14524
|
+
wikiNotes?: string[];
|
|
14469
14525
|
/** Autonomy level the run was held to (absent = act). */
|
|
14470
14526
|
autonomy?: AutonomyLevel;
|
|
14471
14527
|
/** Tool calls the autonomy guard blocked — what the routine would have
|
|
@@ -14498,6 +14554,7 @@ declare class CronScheduler {
|
|
|
14498
14554
|
private running;
|
|
14499
14555
|
private notifyCallback?;
|
|
14500
14556
|
private deliverCallback?;
|
|
14557
|
+
private wikiNotes?;
|
|
14501
14558
|
private log;
|
|
14502
14559
|
constructor(config: DaemonConfig, registry: AgentRegistry, hooks?: HookRegistry, log?: (...args: unknown[]) => void);
|
|
14503
14560
|
/** Whether a job with this id exists. */
|
|
@@ -14579,6 +14636,14 @@ declare class CronScheduler {
|
|
|
14579
14636
|
private notifyDisabled;
|
|
14580
14637
|
private saveLastRuns;
|
|
14581
14638
|
private loadLastRuns;
|
|
14639
|
+
/**
|
|
14640
|
+
* The wiki notes inbox for a run of `job` (#825): open and deferred notes
|
|
14641
|
+
* agents left for the observe/sweep run, rendered as the block the run
|
|
14642
|
+
* reads first. Empty unless the job is listed under `wikiNotes.crons`
|
|
14643
|
+
* and runs as the inbox agent. Never throws: a broken inbox must not
|
|
14644
|
+
* stop the run.
|
|
14645
|
+
*/
|
|
14646
|
+
private wikiNotesInbox;
|
|
14582
14647
|
private logRun;
|
|
14583
14648
|
/**
|
|
14584
14649
|
* List all jobs and their status (including failure info).
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-
|
|
1
|
+
import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-HYRBBH6T.js";import"./chunk-NUSROFTJ.js";import"./chunk-GTJIKXDB.js";import"./chunk-4WZGZ2Z6.js";import"./chunk-BGG3ZSMW.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-EMGB23H5.js";import"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WEPON4FP.js";import"./chunk-AKLZ4YO2.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-YV22EOGL.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-XYT6XY7G.js";import"./chunk-VBJTGTF5.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import{ca as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-QWQOI4G4.js";import"./chunk-HNBW5Q47.js";import"./chunk-GLQLCBJS.js";import"./chunk-6W74CHNW.js";import{s as ut}from"./chunk-COWAAE54.js";import{a as L}from"./chunk-UG2OF2EI.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-PH43FUU7.js";import"./chunk-52SIHG45.js";import"./chunk-VWTBHLMX.js";import"./chunk-TJ4P4WW2.js";import{a as ht}from"./chunk-EHLTZ6IB.js";import"./chunk-3PGPN323.js";import"./chunk-UJXS4MS3.js";import"./chunk-56KNKUFF.js";import{f as gt,g as ft}from"./chunk-LTH3AYXC.js";import"./chunk-WPNRDEHW.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-XX5QKBX4.js";import{j as it,k as rt,l as at}from"./chunk-3KYZOC7N.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.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-2PJKGZWP.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{ma as tt,oa as st,pa as ot,ra as nt}from"./chunk-Y27RUOD2.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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).
|