agentix-cli 0.149.0 → 0.151.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/README.md +0 -1
- package/apps/mac-helper/Sources/AgentXHelper/AXTree.swift +14 -2
- package/dist/{App-2O2UUZGG.js → App-WAWZFD66.js} +2 -2
- package/dist/{ChatApp-YU4NF63L.js → ChatApp-TRJIS3O4.js} +2 -2
- package/dist/{absorb-eval-WHWOJYDX.js → absorb-eval-CFWLHUTB.js} +2 -2
- package/dist/{agent-NLCR6VBE.js → agent-6KCTPI7E.js} +2 -2
- package/dist/{board-dashboard-VPDXHHWC.js → board-dashboard-5V6RHW3E.js} +16 -16
- package/dist/{board-dashboard-VPDXHHWC.js.map → board-dashboard-5V6RHW3E.js.map} +1 -1
- package/dist/{chunk-GMMRBTLQ.js → chunk-2GJQDJBF.js} +2 -2
- package/dist/{chunk-AONY6U45.js → chunk-4GXJMHSA.js} +2 -2
- package/dist/{chunk-WGPMUWX7.js → chunk-5I7NJMK6.js} +3 -3
- package/dist/{chunk-XNS5OQ3U.js → chunk-6LFOX6Q5.js} +293 -283
- package/dist/chunk-6LFOX6Q5.js.map +1 -0
- package/dist/{chunk-ATCIRFH6.js → chunk-ALE354ZC.js} +2 -2
- package/dist/{chunk-GRI5HOPC.js → chunk-C5UTFHPB.js} +2 -2
- package/dist/{chunk-UZWF7PFH.js → chunk-CBML7UCP.js} +5 -5
- package/dist/{chunk-5QXRPYOY.js → chunk-CTQ25CUL.js} +2 -2
- package/dist/{chunk-JOHDOEZ4.js → chunk-DFGANY25.js} +2 -2
- package/dist/{chunk-EIY2HRAS.js → chunk-DJQIJF4R.js} +2 -2
- package/dist/{chunk-DWOERPBG.js → chunk-DWXCZRBJ.js} +2 -2
- package/dist/{chunk-5IHUZVPU.js → chunk-EJTKLVIW.js} +2 -2
- package/dist/{chunk-E7LPZAXP.js → chunk-ETBDN5WX.js} +2 -2
- package/dist/{chunk-6TJNWUMA.js → chunk-FGJNSYHM.js} +3 -3
- package/dist/{chunk-NW4N67TU.js → chunk-IMITYHBT.js} +2 -2
- package/dist/chunk-L6IW6HWE.js +64 -0
- package/dist/chunk-L6IW6HWE.js.map +1 -0
- package/dist/{chunk-IGA3T3ZT.js → chunk-LVS5ESTS.js} +2 -2
- package/dist/chunk-O7SYQXKS.js +181 -0
- package/dist/chunk-O7SYQXKS.js.map +1 -0
- package/dist/chunk-OSH2PEBH.js +2 -0
- package/dist/{chunk-JXF54PT7.js.map → chunk-OSH2PEBH.js.map} +1 -1
- package/dist/{chunk-QZ6VBDMX.js → chunk-PUSBK2OQ.js} +8 -8
- package/dist/chunk-PUSBK2OQ.js.map +1 -0
- package/dist/{chunk-OWMKQ4HZ.js → chunk-Q5NLNLD5.js} +2 -2
- package/dist/{chunk-S22IBRY6.js → chunk-RGJZV5RY.js} +2 -2
- package/dist/{chunk-NMYC5RW7.js → chunk-TZZBGWLX.js} +2 -2
- package/dist/{chunk-3HVRWULP.js → chunk-UALK4F3W.js} +2 -2
- package/dist/chunk-V3VWYIJ3.js +7 -0
- package/dist/chunk-V3VWYIJ3.js.map +1 -0
- package/dist/{chunk-6QFDFYI7.js → chunk-X3T2GCSI.js} +2 -2
- package/dist/chunk-X6C6U4GL.js +5 -0
- package/dist/chunk-X6C6U4GL.js.map +1 -0
- package/dist/{chunk-2MW32M2D.js → chunk-XD7HTMOP.js} +2 -2
- package/dist/{chunk-6YNRLI6I.js → chunk-XVJXXELY.js} +2 -2
- package/dist/{chunk-BZ6Y264Z.js → chunk-YGDJV4ZZ.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-A2N6ETK2.js → client-VT7GT3SK.js} +2 -2
- package/dist/{config-2QM2WTI2.js → config-NZS2UTHI.js} +2 -2
- package/dist/{config-mutate-UJS4F7BT.js → config-mutate-LINLC354.js} +2 -2
- package/dist/config-mutator-FUMSW5HD.js +2 -0
- package/dist/{contributions-43FWZOGF.js → contributions-67B3BYLV.js} +2 -2
- package/dist/doctor-FOKX4K2G.js +2 -0
- package/dist/{follow-up-tool-VB7K6HCL.js → follow-up-tool-JOIOYOON.js} +2 -2
- package/dist/{grants-2S33F2LV.js → grants-QXF7N6SS.js} +2 -2
- package/dist/{hub-JNNNUAZM.js → hub-QETWDYPD.js} +2 -2
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1 -1
- package/dist/{program-OTENO5DS.js → program-XFZBG3EI.js} +209 -209
- package/dist/program-XFZBG3EI.js.map +1 -0
- package/dist/{promote-VFYVWVTL.js → promote-WNYNTGKC.js} +2 -2
- package/dist/{query-RB2MU2HV.js → query-ZU2DDCEH.js} +2 -2
- package/dist/{query-settings-5B54WHCS.js → query-settings-BXRIJWWO.js} +2 -2
- package/dist/{registry-6OX7U6FV.js → registry-7BITIEQ2.js} +2 -2
- package/dist/{request-planner-TUHVEYSF.js → request-planner-DLQP2NV6.js} +2 -2
- package/dist/{review-candidates-FDYTGG2N.js → review-candidates-3BMHLIBW.js} +2 -2
- package/dist/{routing-U35SFPEI.js → routing-FVZCQJ6T.js} +2 -2
- package/dist/schedule-tool-TDVJHRQX.js +2 -0
- package/dist/{scheduler-H2QHWNQ2.js → scheduler-SYI5MZ3H.js} +2 -2
- package/dist/{seat-EB3KJMIE.js → seat-6JF7BYM7.js} +2 -2
- package/dist/{select-IU4IOVSO.js → select-JT4I3JOH.js} +2 -2
- package/dist/{set-enabled-64BSJ7LR.js → set-enabled-JRGFKA3S.js} +2 -2
- package/dist/{tool-B23ACEHV.js → tool-P6GVYNDO.js} +2 -2
- package/dist/{tool-W3CIQZJ7.js → tool-UDOUNWQT.js} +2 -2
- package/dist/{wiki-4KMRUD5C.js → wiki-MTZHDFHK.js} +2 -2
- package/dist/wiki-enrich-CHR4RCRE.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-A76PNG4E.js +0 -4
- package/dist/chunk-A76PNG4E.js.map +0 -1
- package/dist/chunk-JXF54PT7.js +0 -2
- package/dist/chunk-P34VSROA.js +0 -7
- package/dist/chunk-P34VSROA.js.map +0 -1
- package/dist/chunk-PXKIPU27.js +0 -64
- package/dist/chunk-PXKIPU27.js.map +0 -1
- package/dist/chunk-QZ6VBDMX.js.map +0 -1
- package/dist/chunk-XNS5OQ3U.js.map +0 -1
- package/dist/chunk-Z7GEW2SR.js +0 -174
- package/dist/chunk-Z7GEW2SR.js.map +0 -1
- package/dist/config-mutator-VWR3SMD3.js +0 -2
- package/dist/doctor-IN6MWP6I.js +0 -2
- package/dist/program-OTENO5DS.js.map +0 -1
- package/dist/schedule-tool-EPQKUYJX.js +0 -2
- package/dist/wiki-enrich-N4GLW2JX.js +0 -2
- /package/dist/{App-2O2UUZGG.js.map → App-WAWZFD66.js.map} +0 -0
- /package/dist/{ChatApp-YU4NF63L.js.map → ChatApp-TRJIS3O4.js.map} +0 -0
- /package/dist/{absorb-eval-WHWOJYDX.js.map → absorb-eval-CFWLHUTB.js.map} +0 -0
- /package/dist/{agent-NLCR6VBE.js.map → agent-6KCTPI7E.js.map} +0 -0
- /package/dist/{chunk-GMMRBTLQ.js.map → chunk-2GJQDJBF.js.map} +0 -0
- /package/dist/{chunk-AONY6U45.js.map → chunk-4GXJMHSA.js.map} +0 -0
- /package/dist/{chunk-WGPMUWX7.js.map → chunk-5I7NJMK6.js.map} +0 -0
- /package/dist/{chunk-ATCIRFH6.js.map → chunk-ALE354ZC.js.map} +0 -0
- /package/dist/{chunk-GRI5HOPC.js.map → chunk-C5UTFHPB.js.map} +0 -0
- /package/dist/{chunk-UZWF7PFH.js.map → chunk-CBML7UCP.js.map} +0 -0
- /package/dist/{chunk-5QXRPYOY.js.map → chunk-CTQ25CUL.js.map} +0 -0
- /package/dist/{chunk-JOHDOEZ4.js.map → chunk-DFGANY25.js.map} +0 -0
- /package/dist/{chunk-EIY2HRAS.js.map → chunk-DJQIJF4R.js.map} +0 -0
- /package/dist/{chunk-DWOERPBG.js.map → chunk-DWXCZRBJ.js.map} +0 -0
- /package/dist/{chunk-5IHUZVPU.js.map → chunk-EJTKLVIW.js.map} +0 -0
- /package/dist/{chunk-E7LPZAXP.js.map → chunk-ETBDN5WX.js.map} +0 -0
- /package/dist/{chunk-6TJNWUMA.js.map → chunk-FGJNSYHM.js.map} +0 -0
- /package/dist/{chunk-NW4N67TU.js.map → chunk-IMITYHBT.js.map} +0 -0
- /package/dist/{chunk-IGA3T3ZT.js.map → chunk-LVS5ESTS.js.map} +0 -0
- /package/dist/{chunk-OWMKQ4HZ.js.map → chunk-Q5NLNLD5.js.map} +0 -0
- /package/dist/{chunk-S22IBRY6.js.map → chunk-RGJZV5RY.js.map} +0 -0
- /package/dist/{chunk-NMYC5RW7.js.map → chunk-TZZBGWLX.js.map} +0 -0
- /package/dist/{chunk-3HVRWULP.js.map → chunk-UALK4F3W.js.map} +0 -0
- /package/dist/{chunk-6QFDFYI7.js.map → chunk-X3T2GCSI.js.map} +0 -0
- /package/dist/{chunk-2MW32M2D.js.map → chunk-XD7HTMOP.js.map} +0 -0
- /package/dist/{chunk-6YNRLI6I.js.map → chunk-XVJXXELY.js.map} +0 -0
- /package/dist/{chunk-BZ6Y264Z.js.map → chunk-YGDJV4ZZ.js.map} +0 -0
- /package/dist/{client-A2N6ETK2.js.map → client-VT7GT3SK.js.map} +0 -0
- /package/dist/{config-2QM2WTI2.js.map → config-NZS2UTHI.js.map} +0 -0
- /package/dist/{config-mutate-UJS4F7BT.js.map → config-mutate-LINLC354.js.map} +0 -0
- /package/dist/{config-mutator-VWR3SMD3.js.map → config-mutator-FUMSW5HD.js.map} +0 -0
- /package/dist/{contributions-43FWZOGF.js.map → contributions-67B3BYLV.js.map} +0 -0
- /package/dist/{doctor-IN6MWP6I.js.map → doctor-FOKX4K2G.js.map} +0 -0
- /package/dist/{follow-up-tool-VB7K6HCL.js.map → follow-up-tool-JOIOYOON.js.map} +0 -0
- /package/dist/{grants-2S33F2LV.js.map → grants-QXF7N6SS.js.map} +0 -0
- /package/dist/{hub-JNNNUAZM.js.map → hub-QETWDYPD.js.map} +0 -0
- /package/dist/{promote-VFYVWVTL.js.map → promote-WNYNTGKC.js.map} +0 -0
- /package/dist/{query-RB2MU2HV.js.map → query-ZU2DDCEH.js.map} +0 -0
- /package/dist/{query-settings-5B54WHCS.js.map → query-settings-BXRIJWWO.js.map} +0 -0
- /package/dist/{registry-6OX7U6FV.js.map → registry-7BITIEQ2.js.map} +0 -0
- /package/dist/{request-planner-TUHVEYSF.js.map → request-planner-DLQP2NV6.js.map} +0 -0
- /package/dist/{review-candidates-FDYTGG2N.js.map → review-candidates-3BMHLIBW.js.map} +0 -0
- /package/dist/{routing-U35SFPEI.js.map → routing-FVZCQJ6T.js.map} +0 -0
- /package/dist/{schedule-tool-EPQKUYJX.js.map → schedule-tool-TDVJHRQX.js.map} +0 -0
- /package/dist/{scheduler-H2QHWNQ2.js.map → scheduler-SYI5MZ3H.js.map} +0 -0
- /package/dist/{seat-EB3KJMIE.js.map → seat-6JF7BYM7.js.map} +0 -0
- /package/dist/{select-IU4IOVSO.js.map → select-JT4I3JOH.js.map} +0 -0
- /package/dist/{set-enabled-64BSJ7LR.js.map → set-enabled-JRGFKA3S.js.map} +0 -0
- /package/dist/{tool-B23ACEHV.js.map → tool-P6GVYNDO.js.map} +0 -0
- /package/dist/{tool-W3CIQZJ7.js.map → tool-UDOUNWQT.js.map} +0 -0
- /package/dist/{wiki-4KMRUD5C.js.map → wiki-MTZHDFHK.js.map} +0 -0
- /package/dist/{wiki-enrich-N4GLW2JX.js.map → wiki-enrich-CHR4RCRE.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y as l,z as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{y as l,z as T}from"./chunk-Q5NLNLD5.js";import{a,f as w}from"./chunk-72SZI2UW.js";T();w();var d="task-tier";function u(e){return{task:b(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:a("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function b(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2;function p(e){return e==="voice"||e==="desktop"||e==="opencode"}var f=60*60*1e3;function M(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function v(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let s=e.sessionIdleMs??0,r=e.cacheTtlMs??f;if(s<r)return n(`follow-up on a warm cache (idle ${Math.round(s/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"},timeoutMs:1500})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let o=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${o<(e.threshold??h)?"downgrade":"keep"} (${o.toFixed(2)})`,o);let i=e.threshold??h;return o>=i?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${i}) \u2192 ${e.cheapModel}`}}var A=["labeled","unlabeled","closed"];function y(e){let n=r=>({downgraded:!1,needsFlagship:null,reason:r});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);let t=e.eventActions??[];if(!t.length)return n("not started by a platform event");let o=e.triage?.actions??A,i=t.find(r=>!o.includes(r));if(i)return n(`"${i}" is not a triage action`);let s=M(e.tier,{cheapModels:e.triage?.models});if(!s)return n(`no triage model set for ${e.tier}`);if(e.isFollowUp){let r=e.sessionIdleMs??0,m=e.cacheTtlMs??f;if(r<m)return n(`follow-up on a warm cache (idle ${Math.round(r/1e3)}s) \u2014 keeping the session's model`)}return{model:s,downgraded:!0,needsFlagship:null,reason:`triage event (${t.join(", ")}) \u2192 ${s}`}}export{h as a,p as b,M as c,v as d,A as e,y as f};
|
|
2
|
+
//# sourceMappingURL=chunk-2GJQDJBF.js.map
|
|
@@ -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-ROH45HXN.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-ROH45HXN.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-QETWDYPD.js"),{GraphCache:y}=await import("./graph-ZVKV3JBD.js"),{loadOntology:c}=await import("./load-LQ2I2PQI.js"),{loadRoster:$}=await import("./roster-BZGKG2ZA.js"),{ENRICH_TYPES:a,loadEnrichState:s,runEnrich:p,saveEnrichState:g}=await import("./enrich-FPK3OW77.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-FPK3OW77.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-4GXJMHSA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"./chunk-IMLAPB7G.js";import{
|
|
1
|
+
import{a as k}from"./chunk-IMLAPB7G.js";import{j as y}from"./chunk-X6C6U4GL.js";import{b as X}from"./chunk-KP7KDLZ2.js";import{I as W,J as B,K as G,L as J,P as A,T as xe}from"./chunk-L6IW6HWE.js";import{existsSync as K,readFileSync as ve}from"node:fs";import{dirname as b,join as h}from"node:path";import{fileURLToPath as Ae}from"node:url";import{homedir as ke}from"node:os";var M="tn.acme.agentx.voice",st="AgentX Desktop.app",V="AgentX Helper.app";function at(e,t,n){return e!=="darwin"||t!=="arm64"||Number(n.split(".")[0])<23?"AgentX Desktop currently requires Apple Silicon and macOS 14 or newer.":null}function lt(e,t){if(t&&!Object.hasOwn(e,t))throw new Error(`Unknown agent: ${t}. Run agentx agent list.`);let n=t||Object.keys(e)[0];if(!n)throw new Error("No agents configured. Run agentx setup first.");return n}function L(e){return`'${e.replace(/'/g,"'\\''")}'`}var z="/usr/bin:/bin:/usr/sbin:/sbin";function ut(e,t){return t||[...new Set([...e?[b(e)]:[],...z.split(":")])].join(":")}function N(e){let t={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};return e.replace(/&(amp|lt|gt|quot|apos);/g,(n,r)=>t[r])}function ct(e){let t=e.match(/<key>PATH<\/key>\s*<string>([^<]*)<\/string>/);return t?N(t[1]):z}var pt=e=>/agentx\.voice.*\.plist$/.test(e);function dt(e,t){let n=null,r=[];for(let{file:o,plist:i}of[...t].sort((s,c)=>s.file<c.file?-1:1)){let s=i.match(/<key>Label<\/key>\s*<string>([^<]*)<\/string>/)?.[1],c=i.match(/<key>ProgramArguments<\/key>\s*<array>\s*<string>([^<]*)<\/string>/)?.[1];!s||!c||!N(c).endsWith("/Contents/MacOS/AgentXVoice")||(n?r.push({file:o,label:N(s)}):n={file:o,label:N(s)})}return{keep:n??{file:h(e,`${M}.plist`),label:M},remove:r}}function Z(e,t,n){for(let r of t.split(":"))if(r&&n(h(r,e)))return h(r,e);return null}function mt(e){let t=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),n={PATH:e.path,...e.agent?{AGENTX_VOICE_AGENT:e.agent}:{},AGENTX_DAEMON_URL:e.url,AGENTX_MAC_HELPER:e.helper,AGENTX_PASTE_COMMAND:`cd ${L(e.cwd)} && ${L(e.node)} ${L(e.cli)} paste`};return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
3
|
<plist version="1.0"><dict>
|
|
4
4
|
<key>Label</key><string>${t(e.label??M)}</string>
|
|
@@ -31,5 +31,5 @@ function run(argv) {
|
|
|
31
31
|
\u2026`:s?.text;return{...e,summary:f(e.text),textHtml:k(e.text),why:e.state==="waiting_owner"?e.question:e.state==="needs_attention"?e.attentionReason:null,ownerNoteHtml:e.ownerNote?k(e.ownerNote):null,lastAnswer:s?{agentId:s.agentId,at:s.at,html:k(c)}:null,loop:e.promise||e.dueAt!==null||e.closeWhen?{owedTo:e.owedTo,promise:e.promise,dueAt:e.dueAt,check:e.closeWhen?B(e.closeWhen):null,verifyState:e.verifyState,verifyDetail:e.verifyDetail}:null,stall:r&&i?{...q(e,{isAgent:r.isAgent,activeStepAgent:pe(n)}),why:i}:null,plan:o?{state:o.state,steps:n.steps(e.id).map(l=>({idx:l.idx,name:l.name,kind:l.kind,agentId:l.agentId,state:l.state,approval:l.needsApproval?l.approval:null,evidence:l.evidence,note:l.note,nudges:l.nudges}))}:null}}var H=3,Ye=30*24*36e5;function ge(e){return Ze(e,".agentx","native-mirror.json")}function ye(e){try{let t=JSON.parse(Ke(ge(e),"utf-8"));return{...t,items:t?.items&&typeof t.items=="object"?t.items:{}}}catch{return{items:{}}}}function fe(e,t){let n=ge(e);Je(me(n))||Xe(me(n),{recursive:!0});let r=`${n}.${process.pid}.tmp`;ze(r,JSON.stringify(t,null,2)+`
|
|
32
32
|
`),Ve(r,n)}var Qe=5*6e4;function yn(e,t,n=Date.now()){let r=ye(e),o=r.checkedAt?Date.parse(r.checkedAt):NaN;return!r.cards||!(n-o<=Qe)?!1:r.items[`card:${t}`]?.state!=="failed"}var j=24*36e5;function he(e,t,n){let r=e+t.dueAfterMinutes*6e4;return new Date(n!==void 0&&Number.isFinite(n)?Math.max(e,Math.min(r,n)):r)}function et(e,t,n,r){let o=Date.parse(e.expires),i=[f(e.ask,y.ask)];return e.choices?.length&&i.push(...e.choices.map((s,c)=>`${c+1}. ${s}`)),e.recommend&&i.push(`Recommended: ${f(e.recommend,y.recommend)}`),i.push(`Answer: ${n}`,`agentx: card=${e.id}`),{key:`card:${e.id}`,title:f(e.title,y.title),notes:i.join(`
|
|
33
33
|
`),due:he(r,t,o),priority:Number.isFinite(o)&&o-r<=j?"high":"none"}}function tt(e,t,n,r){let o=[f(e.question||e.text,y.ask),`Asked of ${e.agentId}.`,`Answer: ${n}`,`agentx: request=${e.id}`],i=e.dueAt??void 0;return{key:`request:${e.id}`,title:f(e.text,y.title),notes:o.join(`
|
|
34
|
-
`),due:he(r,t,i),priority:i!==void 0&&i-r<=j?"high":"none"}}async function hn(e){let{root:t,settings:n,tasks:r,log:o}=e,i=e.now??Date.now(),s=new Date(i).toISOString(),c={created:0,completed:0,dismissed:0,failed:0},l=ye(t);delete l.lastError;let d=a=>{l.lastError={at:s,message:a}},w=new Map;try{if(n.include.includes("card"))for(let a of e.cards())a.status==="pending"&&Date.parse(a.expires)>i&&w.set(`card:${a.id}`,et(a,n,e.answerUrl,i));if(n.include.includes("request"))for(let a of e.requests())a.state==="waiting_owner"&&w.set(`request:${a.id}`,tt(a,n,e.answerUrl,i))}catch(a){return o(`[mirror] could not read what is waiting: ${a?.message??a}`),d(String(a?.message??a)),fe(t,l),c}let U=!0,x=new Map,we=async a=>{if(!x.has(a))try{x.set(a,new Set((await r.listOpen(a)).map(u=>u.id)))}catch(u){o(`[mirror] could not read list "${a}": ${u?.message??u}`),d(String(u?.message??u)),x.set(a,null),U=!1}return x.get(a)};for(let[a,u]of Object.entries(l.items)){if(u.state!=="open"||!u.id)continue;let p=await we(u.list);if(p)if(w.has(a))p.has(u.id)||(l.items[a]={...u,state:"dismissed",at:s},c.dismissed++,o(`[mirror] ${a}: its task was ticked off or deleted; it stays on the Desk and is not mirrored again`));else{if(p.has(u.id))try{await r.complete(u.id)}catch(g){o(`[mirror] ${a}: could not complete its task: ${g?.message??g}`),d(String(g?.message??g));continue}l.items[a]={...u,state:"completed",at:s},c.completed++}}let E=null,S=[];for(let[a,u]of w){let p=l.items[a];if(p&&(p.state==="open"||p.state==="dismissed")||p?.state==="failed"&&p.failures>=H)continue;if(E===null)try{await r.ensureList(n.list),E=!0}catch(m){o(`[mirror] could not make list "${n.list}": ${m?.message??m}`),d(String(m?.message??m)),E=!1}let g=p?.state==="failed"?p.failures:0;try{let{id:m}=await r.add({list:n.list,title:u.title,notes:u.notes,due:u.due,priority:u.priority});l.items[a]={id:m,list:n.list,state:"open",at:s,failures:0},c.created++}catch(m){let v=String(m?.message??m),C=g+1;l.items[a]={list:n.list,state:"failed",at:s,failures:C,lastError:v},d(v),c.failed++,o(`[mirror] ${a}: could not add to Reminders (${C}/${H}): ${v}`),C===H&&S.push({title:u.title,message:v})}}let Se=l.failureToldAt?Date.parse(l.failureToldAt):NaN;if(S.length&&!(i-Se<j)){let a=S[0],u=S.length>1?` (and ${S.length-1} more)`:"";try{await e.notify("Could not add to Reminders",`${a.title}${u}: ${f(a.message,200)}. Still on the Desk.`),l.failureToldAt=s}catch(p){o(`[mirror] could not tell the owner: ${p?.message??p}`)}}U&&(l.checkedAt=s,l.cards=n.include.includes("card"));for(let[a,u]of Object.entries(l.items))u.state!=="open"&&!w.has(a)&&i-Date.parse(u.at)>Ye&&delete l.items[a];return fe(t,l),c}export{
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
`),due:he(r,t,i),priority:i!==void 0&&i-r<=j?"high":"none"}}async function hn(e){let{root:t,settings:n,tasks:r,log:o}=e,i=e.now??Date.now(),s=new Date(i).toISOString(),c={created:0,completed:0,dismissed:0,failed:0},l=ye(t);delete l.lastError;let d=a=>{l.lastError={at:s,message:a}},w=new Map;try{if(n.include.includes("card"))for(let a of e.cards())a.status==="pending"&&Date.parse(a.expires)>i&&w.set(`card:${a.id}`,et(a,n,e.answerUrl,i));if(n.include.includes("request"))for(let a of e.requests())a.state==="waiting_owner"&&w.set(`request:${a.id}`,tt(a,n,e.answerUrl,i))}catch(a){return o(`[mirror] could not read what is waiting: ${a?.message??a}`),d(String(a?.message??a)),fe(t,l),c}let U=!0,x=new Map,we=async a=>{if(!x.has(a))try{x.set(a,new Set((await r.listOpen(a)).map(u=>u.id)))}catch(u){o(`[mirror] could not read list "${a}": ${u?.message??u}`),d(String(u?.message??u)),x.set(a,null),U=!1}return x.get(a)};for(let[a,u]of Object.entries(l.items)){if(u.state!=="open"||!u.id)continue;let p=await we(u.list);if(p)if(w.has(a))p.has(u.id)||(l.items[a]={...u,state:"dismissed",at:s},c.dismissed++,o(`[mirror] ${a}: its task was ticked off or deleted; it stays on the Desk and is not mirrored again`));else{if(p.has(u.id))try{await r.complete(u.id)}catch(g){o(`[mirror] ${a}: could not complete its task: ${g?.message??g}`),d(String(g?.message??g));continue}l.items[a]={...u,state:"completed",at:s},c.completed++}}let E=null,S=[];for(let[a,u]of w){let p=l.items[a];if(p&&(p.state==="open"||p.state==="dismissed")||p?.state==="failed"&&p.failures>=H)continue;if(E===null)try{await r.ensureList(n.list),E=!0}catch(m){o(`[mirror] could not make list "${n.list}": ${m?.message??m}`),d(String(m?.message??m)),E=!1}let g=p?.state==="failed"?p.failures:0;try{let{id:m}=await r.add({list:n.list,title:u.title,notes:u.notes,due:u.due,priority:u.priority});l.items[a]={id:m,list:n.list,state:"open",at:s,failures:0},c.created++}catch(m){let v=String(m?.message??m),C=g+1;l.items[a]={list:n.list,state:"failed",at:s,failures:C,lastError:v},d(v),c.failed++,o(`[mirror] ${a}: could not add to Reminders (${C}/${H}): ${v}`),C===H&&S.push({title:u.title,message:v})}}let Se=l.failureToldAt?Date.parse(l.failureToldAt):NaN;if(S.length&&!(i-Se<j)){let a=S[0],u=S.length>1?` (and ${S.length-1} more)`:"";try{await e.notify("Could not add to Reminders",`${a.title}${u}: ${f(a.message,200)}. Still on the Desk.`),l.failureToldAt=s}catch(p){o(`[mirror] could not tell the owner: ${p?.message??p}`)}}U&&(l.checkedAt=s,l.cards=n.include.includes("card"));for(let[a,u]of Object.entries(l.items))u.state!=="open"&&!w.has(a)&&i-Date.parse(u.at)>Ye&&delete l.items[a];return fe(t,l),c}export{Qt as a,pe as b,q as c,en as d,tn as e,Ue as f,nn as g,rn as h,on as i,f as j,cn as k,st as l,V as m,at as n,lt as o,ut as p,ct as q,pt as r,dt as s,Z as t,mt as u,ft as v,be as w,Ne as x,Re as y,T as z,re as A,D as B,Fe as C,Jt as D,Xt as E,Kt as F,ye as G,yn as H,hn as I};
|
|
35
|
+
//# sourceMappingURL=chunk-5I7NJMK6.js.map
|