agentix-cli 0.209.1 → 0.209.2
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-IIRTJERA.js → App-SWJJHYRX.js} +2 -2
- package/dist/{ChatApp-6KKF4LEH.js → ChatApp-CPUCPJLP.js} +2 -2
- package/dist/{absorb-eval-TUJ5NT6O.js → absorb-eval-WKLAV4ZX.js} +2 -2
- package/dist/{adapter-OEPJK3RA.js → adapter-XXUKXA5L.js} +2 -2
- package/dist/{agent-BOU3OKAD.js → agent-3U23E65W.js} +2 -2
- package/dist/{board-dashboard-FSQBTYYV.js → board-dashboard-5BPWMIUP.js} +4 -4
- package/dist/{chunk-3S7ZOYP7.js → chunk-2KLR4RWJ.js} +2 -2
- package/dist/{chunk-2YKGPMLS.js → chunk-2OW4DTHI.js} +2 -2
- package/dist/{chunk-LCVBPN2T.js → chunk-3HT5A67F.js} +98 -109
- package/dist/chunk-3HT5A67F.js.map +1 -0
- package/dist/{chunk-7PNHK54L.js → chunk-6WU5VEVY.js} +2 -2
- package/dist/{chunk-DBODYTBR.js → chunk-7BCGVPF4.js} +2 -2
- package/dist/{chunk-OCKOQ3M2.js → chunk-7X4BZ5VS.js} +3 -3
- package/dist/{chunk-76H4PAOZ.js → chunk-7YEXKWYP.js} +2 -2
- package/dist/{chunk-MM7CVLQ4.js → chunk-B3TH5GYM.js} +2 -2
- package/dist/{chunk-YOIZOUSY.js → chunk-BIK7QFDR.js} +2 -2
- package/dist/{chunk-SXCRQMNL.js → chunk-CWZ4UN7R.js} +2 -2
- package/dist/{chunk-PL5CJYNG.js → chunk-DAT6RZ5Q.js} +2 -2
- package/dist/{chunk-7YKVNEQ6.js → chunk-GMP2IB4E.js} +2 -2
- package/dist/{chunk-EKQND7TT.js → chunk-IGSZ6IZ7.js} +2 -2
- package/dist/{chunk-44CTJ3Q7.js → chunk-K7JD6Y4L.js} +2 -2
- package/dist/{chunk-KPYBNLA2.js → chunk-KSO2DLVR.js} +2 -2
- package/dist/chunk-KWWBDLE6.js +13 -0
- package/dist/chunk-KWWBDLE6.js.map +1 -0
- package/dist/chunk-LIY5CHUV.js +4 -0
- package/dist/chunk-LIY5CHUV.js.map +1 -0
- package/dist/{chunk-6WZV65AF.js → chunk-LW6UWMN6.js} +2 -2
- package/dist/{chunk-EDWOZ54V.js → chunk-MOA6SIUK.js} +2 -2
- package/dist/{chunk-TQSU3X3J.js → chunk-NBIOOD7J.js} +2 -2
- package/dist/{chunk-PB6WBFNR.js → chunk-ORBWUTVG.js} +2 -2
- package/dist/{chunk-D2FURI7U.js → chunk-QZ5HG3G5.js} +2 -2
- package/dist/{chunk-G72NZCOM.js → chunk-RAZKIONL.js} +2 -2
- package/dist/{chunk-UXOKTRDR.js → chunk-RPRJT4EH.js} +2 -2
- package/dist/{chunk-LS6COERI.js → chunk-S6HKRVBX.js} +2 -2
- package/dist/{chunk-ROLSAEXB.js → chunk-SJMVSADX.js} +2 -2
- package/dist/{chunk-R6O45GIS.js → chunk-VIC4Q4HD.js} +2 -2
- package/dist/{chunk-T2P6QX4W.js → chunk-VYZ4X65I.js} +2 -2
- package/dist/{chunk-ZLYZBZ6P.js → chunk-XMPJV6WS.js} +2 -2
- package/dist/{chunk-PLIG3TGT.js → chunk-XWXQGOZR.js} +2 -2
- package/dist/{chunk-YXJV4ACW.js → chunk-Y2GFVSLP.js} +6 -6
- package/dist/{chunk-KT4CZ7GY.js → chunk-YFN5DE56.js} +3 -3
- package/dist/{chunk-KT4CZ7GY.js.map → chunk-YFN5DE56.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client-NG226UN4.js +2 -0
- package/dist/{config-LLC2SVQY.js → config-BFWKCNWV.js} +2 -2
- package/dist/config-mutate-Z3WK32EO.js +2 -0
- package/dist/config-mutator-TZRAR5GG.js +2 -0
- package/dist/{contributions-PJ56BN7H.js → contributions-4HEMQ3JO.js} +2 -2
- package/dist/decision-approvals-NJS2ARAF.js +2 -0
- package/dist/{doctor-GUOMJIP2.js → doctor-RBPFWIQJ.js} +2 -2
- package/dist/{follow-up-tool-WJDVBIKK.js → follow-up-tool-M6NPAVCR.js} +2 -2
- package/dist/hub-RNAZKK6J.js +2 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{org-tool-DSNS2U6J.js → org-tool-WKGZVVTS.js} +2 -2
- package/dist/owner-decisions-D3MBTX4D.js +2 -0
- package/dist/{program-TFUYZJXY.js → program-OBQZUXYI.js} +266 -264
- package/dist/{program-TFUYZJXY.js.map → program-OBQZUXYI.js.map} +1 -1
- package/dist/{promote-JFNEREPV.js → promote-DMPFCAC3.js} +2 -2
- package/dist/push-bridge-T5HZZRA2.js +1 -1
- package/dist/{query-AZV6567L.js → query-KL7IAGDI.js} +2 -2
- package/dist/{query-settings-NVR6KLT6.js → query-settings-ASNC2APT.js} +2 -2
- package/dist/registry-YOZ2J3I5.js +2 -0
- package/dist/{request-planner-63YQLEPP.js → request-planner-4GT4JGV2.js} +2 -2
- package/dist/{review-candidates-MMCISAK2.js → review-candidates-FHXSOGXE.js} +2 -2
- package/dist/routing-73DPZ65Q.js +2 -0
- package/dist/schedule-tool-XTEBWOCZ.js +2 -0
- package/dist/scheduler-C7OK3NCA.js +2 -0
- package/dist/{seat-JXZWBSGZ.js → seat-SMBKX2K7.js} +2 -2
- package/dist/{select-FSV56KVJ.js → select-NPU6TCWK.js} +2 -2
- package/dist/self-HICJTWYO.js +2 -0
- package/dist/{set-enabled-53DEYHY3.js → set-enabled-CB5HS7PG.js} +2 -2
- package/dist/{sprint-tool-PYRQIJKM.js → sprint-tool-J2354376.js} +2 -2
- package/dist/{tool-O73Q2WWD.js → tool-LW5PURCD.js} +2 -2
- package/dist/{tool-YEH3GUG6.js → tool-NXBLFMPT.js} +2 -2
- package/dist/{tool-4N5XR4XV.js → tool-OAEBT36R.js} +2 -2
- package/dist/{tool-JKDVJJD4.js → tool-TVKMQB3M.js} +2 -2
- package/dist/wiki-XJZI4D7Z.js +2 -0
- package/dist/wiki-XJZI4D7Z.js.map +1 -0
- package/dist/wiki-enrich-M7C5UVI7.js +2 -0
- package/dist/wiki-enrich-M7C5UVI7.js.map +1 -0
- package/dist/workspace-setup-GTSXWYU4.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LCVBPN2T.js.map +0 -1
- package/dist/client-MAH6EO3E.js +0 -2
- package/dist/config-mutate-2AGZLP25.js +0 -2
- package/dist/config-mutator-REAOL7IJ.js +0 -2
- package/dist/hub-YOXHLMFE.js +0 -2
- package/dist/registry-FE6NJMV3.js +0 -2
- package/dist/routing-MLJJ3R3V.js +0 -2
- package/dist/schedule-tool-TVM4RJ35.js +0 -2
- package/dist/scheduler-S3KOAAFU.js +0 -2
- package/dist/self-CICDOU3F.js +0 -2
- package/dist/wiki-GP52MJ6Y.js +0 -2
- package/dist/wiki-enrich-M7YDGFIY.js +0 -2
- /package/dist/{App-IIRTJERA.js.map → App-SWJJHYRX.js.map} +0 -0
- /package/dist/{ChatApp-6KKF4LEH.js.map → ChatApp-CPUCPJLP.js.map} +0 -0
- /package/dist/{absorb-eval-TUJ5NT6O.js.map → absorb-eval-WKLAV4ZX.js.map} +0 -0
- /package/dist/{adapter-OEPJK3RA.js.map → adapter-XXUKXA5L.js.map} +0 -0
- /package/dist/{agent-BOU3OKAD.js.map → agent-3U23E65W.js.map} +0 -0
- /package/dist/{board-dashboard-FSQBTYYV.js.map → board-dashboard-5BPWMIUP.js.map} +0 -0
- /package/dist/{chunk-3S7ZOYP7.js.map → chunk-2KLR4RWJ.js.map} +0 -0
- /package/dist/{chunk-2YKGPMLS.js.map → chunk-2OW4DTHI.js.map} +0 -0
- /package/dist/{chunk-7PNHK54L.js.map → chunk-6WU5VEVY.js.map} +0 -0
- /package/dist/{chunk-DBODYTBR.js.map → chunk-7BCGVPF4.js.map} +0 -0
- /package/dist/{chunk-OCKOQ3M2.js.map → chunk-7X4BZ5VS.js.map} +0 -0
- /package/dist/{chunk-76H4PAOZ.js.map → chunk-7YEXKWYP.js.map} +0 -0
- /package/dist/{chunk-MM7CVLQ4.js.map → chunk-B3TH5GYM.js.map} +0 -0
- /package/dist/{chunk-YOIZOUSY.js.map → chunk-BIK7QFDR.js.map} +0 -0
- /package/dist/{chunk-SXCRQMNL.js.map → chunk-CWZ4UN7R.js.map} +0 -0
- /package/dist/{chunk-PL5CJYNG.js.map → chunk-DAT6RZ5Q.js.map} +0 -0
- /package/dist/{chunk-7YKVNEQ6.js.map → chunk-GMP2IB4E.js.map} +0 -0
- /package/dist/{chunk-EKQND7TT.js.map → chunk-IGSZ6IZ7.js.map} +0 -0
- /package/dist/{chunk-44CTJ3Q7.js.map → chunk-K7JD6Y4L.js.map} +0 -0
- /package/dist/{chunk-KPYBNLA2.js.map → chunk-KSO2DLVR.js.map} +0 -0
- /package/dist/{chunk-6WZV65AF.js.map → chunk-LW6UWMN6.js.map} +0 -0
- /package/dist/{chunk-EDWOZ54V.js.map → chunk-MOA6SIUK.js.map} +0 -0
- /package/dist/{chunk-TQSU3X3J.js.map → chunk-NBIOOD7J.js.map} +0 -0
- /package/dist/{chunk-PB6WBFNR.js.map → chunk-ORBWUTVG.js.map} +0 -0
- /package/dist/{chunk-D2FURI7U.js.map → chunk-QZ5HG3G5.js.map} +0 -0
- /package/dist/{chunk-G72NZCOM.js.map → chunk-RAZKIONL.js.map} +0 -0
- /package/dist/{chunk-UXOKTRDR.js.map → chunk-RPRJT4EH.js.map} +0 -0
- /package/dist/{chunk-LS6COERI.js.map → chunk-S6HKRVBX.js.map} +0 -0
- /package/dist/{chunk-ROLSAEXB.js.map → chunk-SJMVSADX.js.map} +0 -0
- /package/dist/{chunk-R6O45GIS.js.map → chunk-VIC4Q4HD.js.map} +0 -0
- /package/dist/{chunk-T2P6QX4W.js.map → chunk-VYZ4X65I.js.map} +0 -0
- /package/dist/{chunk-ZLYZBZ6P.js.map → chunk-XMPJV6WS.js.map} +0 -0
- /package/dist/{chunk-PLIG3TGT.js.map → chunk-XWXQGOZR.js.map} +0 -0
- /package/dist/{chunk-YXJV4ACW.js.map → chunk-Y2GFVSLP.js.map} +0 -0
- /package/dist/{client-MAH6EO3E.js.map → client-NG226UN4.js.map} +0 -0
- /package/dist/{config-LLC2SVQY.js.map → config-BFWKCNWV.js.map} +0 -0
- /package/dist/{config-mutate-2AGZLP25.js.map → config-mutate-Z3WK32EO.js.map} +0 -0
- /package/dist/{config-mutator-REAOL7IJ.js.map → config-mutator-TZRAR5GG.js.map} +0 -0
- /package/dist/{contributions-PJ56BN7H.js.map → contributions-4HEMQ3JO.js.map} +0 -0
- /package/dist/{doctor-GUOMJIP2.js.map → decision-approvals-NJS2ARAF.js.map} +0 -0
- /package/dist/{hub-YOXHLMFE.js.map → doctor-RBPFWIQJ.js.map} +0 -0
- /package/dist/{follow-up-tool-WJDVBIKK.js.map → follow-up-tool-M6NPAVCR.js.map} +0 -0
- /package/dist/{promote-JFNEREPV.js.map → hub-RNAZKK6J.js.map} +0 -0
- /package/dist/{org-tool-DSNS2U6J.js.map → org-tool-WKGZVVTS.js.map} +0 -0
- /package/dist/{query-AZV6567L.js.map → owner-decisions-D3MBTX4D.js.map} +0 -0
- /package/dist/{registry-FE6NJMV3.js.map → promote-DMPFCAC3.js.map} +0 -0
- /package/dist/{routing-MLJJ3R3V.js.map → query-KL7IAGDI.js.map} +0 -0
- /package/dist/{query-settings-NVR6KLT6.js.map → query-settings-ASNC2APT.js.map} +0 -0
- /package/dist/{schedule-tool-TVM4RJ35.js.map → registry-YOZ2J3I5.js.map} +0 -0
- /package/dist/{request-planner-63YQLEPP.js.map → request-planner-4GT4JGV2.js.map} +0 -0
- /package/dist/{review-candidates-MMCISAK2.js.map → review-candidates-FHXSOGXE.js.map} +0 -0
- /package/dist/{scheduler-S3KOAAFU.js.map → routing-73DPZ65Q.js.map} +0 -0
- /package/dist/{seat-JXZWBSGZ.js.map → schedule-tool-XTEBWOCZ.js.map} +0 -0
- /package/dist/{self-CICDOU3F.js.map → scheduler-C7OK3NCA.js.map} +0 -0
- /package/dist/{wiki-GP52MJ6Y.js.map → seat-SMBKX2K7.js.map} +0 -0
- /package/dist/{select-FSV56KVJ.js.map → select-NPU6TCWK.js.map} +0 -0
- /package/dist/{wiki-enrich-M7YDGFIY.js.map → self-HICJTWYO.js.map} +0 -0
- /package/dist/{set-enabled-53DEYHY3.js.map → set-enabled-CB5HS7PG.js.map} +0 -0
- /package/dist/{sprint-tool-PYRQIJKM.js.map → sprint-tool-J2354376.js.map} +0 -0
- /package/dist/{tool-O73Q2WWD.js.map → tool-LW5PURCD.js.map} +0 -0
- /package/dist/{tool-YEH3GUG6.js.map → tool-NXBLFMPT.js.map} +0 -0
- /package/dist/{tool-4N5XR4XV.js.map → tool-OAEBT36R.js.map} +0 -0
- /package/dist/{tool-JKDVJJD4.js.map → tool-TVKMQB3M.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"chalk";import{spawn as S}from"child_process";import{resolve as j}from"path";var E=l=>l||j(process.cwd(),".agentx/wiki");function N(l){return async d=>{let{claudeCliEnv:e}=await import("./workspace-env-UOK5MMKD.js"),h=["-p","-","--output-format","json","--max-turns","1","--model",l,"--tools","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}',"--settings",'{"disableAllHooks":true}',"--setting-sources","","--no-session-persistence"],y=await new Promise(($,a)=>{let s=S("claude",h,{env:e(),stdio:["pipe","pipe","pipe"]}),p="",g="",i=setTimeout(()=>s.kill("SIGTERM"),24e4);s.stdout.on("data",r=>{p+=r}),s.stderr.on("data",r=>{g+=r}),s.on("error",r=>{clearTimeout(i),a(r)}),s.on("close",r=>{clearTimeout(i),r===0?$(p):a(new Error(`claude exited ${r}: ${g.trim().slice(0,200)}`))}),s.stdin.end(d)}),c=JSON.parse(y);if(c.is_error)throw new Error(`model error: ${String(c.result).slice(0,200)}`);return{text:String(c.result??""),costUsd:Number(c.total_cost_usd)||0}}}function I(l){l.command("enrich [entities...]").description("write a full overview, sourced typed facts and linked history on entity pages (person, organization, project, place, assets)").option("--dir <path>","wiki directory (default .agentx/wiki)").option("--types <list>","comma-separated entity types","person,organization,project,place,device,server,app,domain,account").option("--max <n>","most entities per run","10").option("--max-cost <usd>","stop before the next call once the run spent this much","1").option("--model <m>","model","sonnet").option("--force","redo entities whose sources did not change").option("--dry-run","show what would be written, write nothing").option("--create <title>","first create a page for a thing other pages only name, then enrich it (needs --as and --owner)").option("--as <type>","type of the page --create makes, e.g. organization").option("--owner <agent>","agent whose wiki gets the page --create makes").option("--json","print the run as JSON").action(async(d,e)=>{let{WikiHub:h}=await import("./hub-
|
|
1
|
+
import t from"chalk";import{spawn as S}from"child_process";import{resolve as j}from"path";var E=l=>l||j(process.cwd(),".agentx/wiki");function N(l){return async d=>{let{claudeCliEnv:e}=await import("./workspace-env-UOK5MMKD.js"),h=["-p","-","--output-format","json","--max-turns","1","--model",l,"--tools","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}',"--settings",'{"disableAllHooks":true}',"--setting-sources","","--no-session-persistence"],y=await new Promise(($,a)=>{let s=S("claude",h,{env:e(),stdio:["pipe","pipe","pipe"]}),p="",g="",i=setTimeout(()=>s.kill("SIGTERM"),24e4);s.stdout.on("data",r=>{p+=r}),s.stderr.on("data",r=>{g+=r}),s.on("error",r=>{clearTimeout(i),a(r)}),s.on("close",r=>{clearTimeout(i),r===0?$(p):a(new Error(`claude exited ${r}: ${g.trim().slice(0,200)}`))}),s.stdin.end(d)}),c=JSON.parse(y);if(c.is_error)throw new Error(`model error: ${String(c.result).slice(0,200)}`);return{text:String(c.result??""),costUsd:Number(c.total_cost_usd)||0}}}function I(l){l.command("enrich [entities...]").description("write a full overview, sourced typed facts and linked history on entity pages (person, organization, project, place, assets)").option("--dir <path>","wiki directory (default .agentx/wiki)").option("--types <list>","comma-separated entity types","person,organization,project,place,device,server,app,domain,account").option("--max <n>","most entities per run","10").option("--max-cost <usd>","stop before the next call once the run spent this much","1").option("--model <m>","model","sonnet").option("--force","redo entities whose sources did not change").option("--dry-run","show what would be written, write nothing").option("--create <title>","first create a page for a thing other pages only name, then enrich it (needs --as and --owner)").option("--as <type>","type of the page --create makes, e.g. organization").option("--owner <agent>","agent whose wiki gets the page --create makes").option("--json","print the run as JSON").action(async(d,e)=>{let{WikiHub:h}=await import("./hub-RNAZKK6J.js"),{GraphCache:y}=await import("./graph-ZVKV3JBD.js"),{loadOntology:c}=await import("./load-Q3HCFXDT.js"),{loadRoster:$}=await import("./roster-BZGKG2ZA.js"),{ENRICH_TYPES:a,loadEnrichState:s,runEnrich:p,saveEnrichState:g}=await import("./enrich-MZMIQ3SV.js"),i=E(e.dir),r=e.types.split(",").map(o=>o.trim()).filter(Boolean),b=r.filter(o=>!a.includes(o));if(b.length){console.error(t.red(` not an entity type this job handles: ${b.join(", ")} (use ${a.join(", ")})`)),process.exitCode=1;return}let x=Number(e.max);if(!Number.isInteger(x)||x<1){console.error(t.red(" --max must be a whole number of entities, 1 or more")),process.exitCode=1;return}let w=Number(e.maxCost);if(!Number.isFinite(w)||w<=0){console.error(t.red(" --max-cost must be a positive number of dollars")),process.exitCode=1;return}let m=new h(i,()=>{});if(e.create){let{createEntityPage:o}=await import("./enrich-MZMIQ3SV.js");if(!e.as||!a.includes(e.as)||!e.owner){console.error(t.red(` --create needs --as <${a.join("|")}> and --owner <agent>`)),process.exitCode=1;return}if(m.syncedFrom(e.owner)){console.error(t.red(` ${e.owner}'s pages are copied from another node; pick an agent that runs here`)),process.exitCode=1;return}if(e.dryRun)console.log(t.dim(` --dry-run: would create "${e.create}" (${e.as}) in ${e.owner}'s wiki`));else{let f=o(m,e.create,e.as,e.owner,new Date().toISOString().slice(0,10));console.log(f?t.green(` created ${e.owner}/${f}`):t.dim(` ${e.owner} already has a page titled "${e.create}"`))}d=[...d,e.create],r.includes(e.as)||r.push(e.as)}let{ontology:v}=c(i),k=new y().get(m,v,$(i,m.listAgents([]),v.agent_names)),C=s(i),u=await p(m,k,N(e.model),{types:r,only:d,max:x,maxCostUsd:w,dryRun:!!e.dryRun,force:!!e.force,today:new Date().toISOString().slice(0,10),save:o=>g(i,o)},C);if(e.json){console.log(JSON.stringify(u,null,2));return}for(let o of u.outcomes){let f=o.status==="written"?t.green("\u2713"):o.status==="dry-run"?t.cyan("~"):t.yellow("\xB7");console.log(` ${f} ${o.title} ${t.dim(`${o.status} \xB7 ${o.page??"no page"} \xB7 overview ${o.overview?"yes":"no"} \xB7 ${o.statements} facts \xB7 ${o.links} links \xB7 $${o.costUsd.toFixed(3)}`)}`);for(let n of o.facts??[])console.log(t.dim(` fact: ${n.property} \u2192 ${n.value}${n.role?` (${n.role})`:""} \xB7 source ${n.source}`));for(let n of o.dropped.slice(0,6))console.log(t.dim(` dropped: ${n}`));o.preview&&console.log(t.dim(o.preview.split(`
|
|
2
2
|
`).slice(0,12).map(n=>` | ${n}`).join(`
|
|
3
3
|
`)))}u.outcomes.length===0&&console.log(t.dim(" nothing to do: no entity of these types changed since the last run (--force redoes them)")),console.log(t.dim(` spent $${u.costUsd.toFixed(3)} of $${w}${u.capped?" \xB7 stopped at the cap":""}`))})}export{N as a,I as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-2KLR4RWJ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Ib as m,Sb as b}from"./chunk-
|
|
1
|
+
import{Ib as m,Sb as b}from"./chunk-YFN5DE56.js";b();function w(t){let e=typeof t.node=="string"?t.node:"",n=typeof t.token=="string"?t.token:"";if(!e||!n)try{let o=m(t.config);e||(e=o.dashboard?.daemonUrl||""),n||(n=o.dashboard?.token||"")}catch{}return e||(e="http://localhost:18800"),{baseUrl:e.replace(/\/+$/,""),token:n}}async function d(t,e,n){let o={Accept:"application/json"};t.token&&(o.Authorization=`Bearer ${t.token}`);let r=await fetch(`${t.baseUrl}${e}`,{headers:o,signal:n});if(!r.ok)throw new Error(`GET ${e} \u2192 HTTP ${r.status}`);return await r.json()}function R(t,e){return d(t,"/agents",e)}async function S(t,e){return(await d(t,"/api/processes",e)).processes??[]}function P(t,e){return d(t,"/crons",e)}async function h(t,e,n,o){let r={Accept:"application/json","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:o}),a=await s.text(),i;try{i=a?JSON.parse(a):{}}catch{i={raw:a}}if(!s.ok)throw new Error(i?.error||`POST ${e} \u2192 HTTP ${s.status}`);return i}function A(t,e,n="tui"){return h(t,"/api/processes/kill",{...e,reason:n})}function C(t,e,n,o){return h(t,"/task",{agent:e,message:n,context:o??{channel:"tui",chatId:"tui:operator"}})}async function $(t,e,n,o={}){let r={Accept:"text/event-stream","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}/task`,{method:"POST",headers:r,body:JSON.stringify({agent:e,message:n,stream:!0,context:{channel:o.channel??"chat-cli",chatId:o.chatId??"chat-cli:operator"}}),signal:o.signal});if(!s.ok||!s.body){let g=await s.text().catch(()=>"");throw new Error(`POST /task (stream) \u2192 HTTP ${s.status}${g?`: ${g.slice(0,200)}`:""}`)}let a=s.body.getReader(),i=new TextDecoder,u={content:""},c="";try{for(;;){let{done:g,value:p}=await a.read();if(g)break;c+=i.decode(p,{stream:!0});let l;for(;(l=c.indexOf(`
|
|
2
2
|
|
|
3
3
|
`))>=0;){let k=c.slice(0,l);c=c.slice(l+2);let f=x(k);f&&T(f,o,u)}}}finally{try{a.releaseLock()}catch{}}return u}function T(t,e,n){let{event:o,data:r}=t;switch(o){case"text":r?.text&&(n.content+=r.text,e.onText?.(r.text));break;case"thinking":r?.text&&e.onThinking?.(r.text);break;case"tool":e.onTool?.(r);break;case"done":typeof r?.content=="string"&&(n.content=r.content),n.usage=r?.usage,n.duration=r?.duration;break;case"error":n.error=r?.error,n.errorKind=r?.errorKind;break}}function x(t){let e="message",n="";for(let r of t.split(`
|
|
4
4
|
`))r.startsWith("event: ")?e=r.slice(7).trim():r.startsWith("data: ")&&(n=r.slice(6));if(!n)return null;let o;try{o=JSON.parse(n)}catch{o=n}return{event:e,data:o}}export{w as a,R as b,S as c,P as d,A as e,C as f,$ as g};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-2OW4DTHI.js.map
|