agentix-cli 0.128.0 → 0.129.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-BOLQUKCN.js → App-G37JNRBW.js} +2 -2
- package/dist/{ChatApp-72HXQV24.js → ChatApp-NCKC7C3L.js} +2 -2
- package/dist/{absorb-eval-O3HA6XA5.js → absorb-eval-ZCWHWKAD.js} +2 -2
- package/dist/{agent-S2DXXALS.js → agent-LJ4SUQCC.js} +2 -2
- package/dist/{board-dashboard-ZKXXK5CG.js → board-dashboard-LZJT4YWV.js} +251 -235
- package/dist/board-dashboard-LZJT4YWV.js.map +1 -0
- package/dist/{chunk-C5MTLW7O.js → chunk-4FMZTM3W.js} +2 -2
- package/dist/{chunk-Z3W7D5RR.js → chunk-4O4GZBKZ.js} +2 -2
- package/dist/{chunk-TG6CT54D.js → chunk-4ZFLYY5P.js} +2 -2
- package/dist/chunk-A347YHEW.js +4 -0
- package/dist/chunk-A347YHEW.js.map +1 -0
- package/dist/{chunk-5DAEJF5S.js → chunk-AMW2R676.js} +2 -2
- package/dist/{chunk-O2BS6N3T.js → chunk-AOFTTIZZ.js} +2 -2
- package/dist/{chunk-TPNTFCSQ.js → chunk-ARSVKSC4.js} +2 -2
- package/dist/{chunk-P4XGM7ZM.js → chunk-BCUR2TJ7.js} +2 -2
- package/dist/{chunk-HKW56YZK.js → chunk-BWSB7NOX.js} +2 -2
- package/dist/{chunk-QACEFESP.js → chunk-CDLJOGVZ.js} +30 -30
- package/dist/chunk-CDLJOGVZ.js.map +1 -0
- package/dist/{chunk-2SV4RKRW.js → chunk-CPMQZ6Z7.js} +2 -2
- package/dist/{chunk-4V7SWL2S.js → chunk-DVR6PFCJ.js} +2 -2
- package/dist/chunk-EOLEKSN6.js +54 -0
- package/dist/chunk-EOLEKSN6.js.map +1 -0
- package/dist/{chunk-6GGGXCOY.js → chunk-I3RAUJCD.js} +2 -2
- package/dist/{chunk-FSW4FUMW.js → chunk-M7IJVOJA.js} +3 -3
- package/dist/{chunk-6W74CHNW.js → chunk-MEFPXHQJ.js} +13 -13
- package/dist/chunk-MEFPXHQJ.js.map +1 -0
- package/dist/{chunk-DN3RLR5Z.js → chunk-PVUNDNT3.js} +2 -2
- package/dist/{chunk-YWKLUQDC.js → chunk-R6UCPHUD.js} +2 -2
- package/dist/{chunk-QFZU5CEO.js → chunk-SCC7HBFZ.js} +2 -2
- package/dist/{chunk-ZLC4TSXF.js → chunk-VJRITDSQ.js} +2 -2
- package/dist/{chunk-FXBMFGOV.js → chunk-X5JTG52Q.js} +2 -2
- package/dist/{chunk-LDS4SZBU.js → chunk-XIA2ACKX.js} +2 -2
- package/dist/{chunk-D2WX3BET.js → chunk-XOQNDWVW.js} +2 -2
- package/dist/{chunk-QQFURUMS.js → chunk-XZN7QBRH.js} +2 -2
- package/dist/{chunk-EJT4MA3J.js → chunk-YHD4PHFX.js} +238 -238
- package/dist/chunk-YHD4PHFX.js.map +1 -0
- package/dist/{chunk-6KIUVVKX.js → chunk-Z5CBUZIW.js} +2 -2
- package/dist/{chunk-DQ2LNQ2D.js → chunk-ZF5U5KPB.js} +13 -13
- package/dist/chunk-ZF5U5KPB.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/{client-VBV7Q43P.js → client-A5OK3IFO.js} +2 -2
- package/dist/{config-52C3DJD2.js → config-DQ5SILHX.js} +2 -2
- package/dist/{config-mutate-DKQESY6F.js → config-mutate-62FCJ3S6.js} +2 -2
- package/dist/config-mutator-3ZL5YQSO.js +2 -0
- package/dist/{contributions-5OEZWYXI.js → contributions-L2YS4AH2.js} +2 -2
- package/dist/{doctor-VLRC4HW2.js → doctor-7TPSMMFA.js} +2 -2
- package/dist/{follow-up-tool-235LDEMP.js → follow-up-tool-FKWIRFPW.js} +2 -2
- package/dist/{hub-5QK7KYTZ.js → hub-EU5ECAJB.js} +2 -2
- package/dist/index.d.ts +79 -2
- package/dist/index.js +1 -1
- package/dist/note-reader-LPPIYYLT.js +8 -0
- package/dist/note-reader-LPPIYYLT.js.map +1 -0
- package/dist/{notes-YLTNRMB5.js → notes-2VC47RCK.js} +2 -2
- package/dist/{program-MVD57PKP.js → program-UTSXNAHM.js} +262 -262
- package/dist/program-UTSXNAHM.js.map +1 -0
- package/dist/{promote-UPPQ4BQE.js → promote-XBDWCHLU.js} +2 -2
- package/dist/{query-XQS5JN6E.js → query-UI6GQEL7.js} +2 -2
- package/dist/{registry-MOMTLJ6R.js → registry-JW6ETTBA.js} +2 -2
- package/dist/{request-planner-QGZJEAKY.js → request-planner-SEXYQN7D.js} +2 -2
- package/dist/{review-candidates-PAKF2JQF.js → review-candidates-PIJWPPHQ.js} +2 -2
- package/dist/{routing-JG3EV4O4.js → routing-2V3Y6ZR5.js} +2 -2
- package/dist/schedule-tool-KFZ27JTH.js +2 -0
- package/dist/{scheduler-LMPBAA34.js → scheduler-SVZKDKJV.js} +2 -2
- package/dist/{seat-JN3IVZ3G.js → seat-C6TMCJWI.js} +2 -2
- package/dist/{select-ZMMRFMNO.js → select-DP64KWO4.js} +2 -2
- package/dist/{set-enabled-7Y3TW6Z4.js → set-enabled-WCH6FU4N.js} +2 -2
- package/dist/{tool-S7QI6HRA.js → tool-TWQRBV4Y.js} +2 -2
- package/dist/{tool-OCYXCDOK.js → tool-WUK3ZOWG.js} +2 -2
- package/dist/wiki-4LAJ36XR.js +2 -0
- package/package.json +1 -1
- package/dist/board-dashboard-ZKXXK5CG.js.map +0 -1
- package/dist/chunk-52SIHG45.js +0 -4
- package/dist/chunk-52SIHG45.js.map +0 -1
- package/dist/chunk-6W74CHNW.js.map +0 -1
- package/dist/chunk-DQ2LNQ2D.js.map +0 -1
- package/dist/chunk-EJT4MA3J.js.map +0 -1
- package/dist/chunk-MRYA4J5F.js +0 -54
- package/dist/chunk-MRYA4J5F.js.map +0 -1
- package/dist/chunk-QACEFESP.js.map +0 -1
- package/dist/config-mutator-BF4D4QGN.js +0 -2
- package/dist/program-MVD57PKP.js.map +0 -1
- package/dist/schedule-tool-O7ZZ2A7X.js +0 -2
- package/dist/wiki-OCLFFZG6.js +0 -2
- /package/dist/{App-BOLQUKCN.js.map → App-G37JNRBW.js.map} +0 -0
- /package/dist/{ChatApp-72HXQV24.js.map → ChatApp-NCKC7C3L.js.map} +0 -0
- /package/dist/{absorb-eval-O3HA6XA5.js.map → absorb-eval-ZCWHWKAD.js.map} +0 -0
- /package/dist/{agent-S2DXXALS.js.map → agent-LJ4SUQCC.js.map} +0 -0
- /package/dist/{chunk-C5MTLW7O.js.map → chunk-4FMZTM3W.js.map} +0 -0
- /package/dist/{chunk-Z3W7D5RR.js.map → chunk-4O4GZBKZ.js.map} +0 -0
- /package/dist/{chunk-TG6CT54D.js.map → chunk-4ZFLYY5P.js.map} +0 -0
- /package/dist/{chunk-5DAEJF5S.js.map → chunk-AMW2R676.js.map} +0 -0
- /package/dist/{chunk-O2BS6N3T.js.map → chunk-AOFTTIZZ.js.map} +0 -0
- /package/dist/{chunk-TPNTFCSQ.js.map → chunk-ARSVKSC4.js.map} +0 -0
- /package/dist/{chunk-P4XGM7ZM.js.map → chunk-BCUR2TJ7.js.map} +0 -0
- /package/dist/{chunk-HKW56YZK.js.map → chunk-BWSB7NOX.js.map} +0 -0
- /package/dist/{chunk-2SV4RKRW.js.map → chunk-CPMQZ6Z7.js.map} +0 -0
- /package/dist/{chunk-4V7SWL2S.js.map → chunk-DVR6PFCJ.js.map} +0 -0
- /package/dist/{chunk-6GGGXCOY.js.map → chunk-I3RAUJCD.js.map} +0 -0
- /package/dist/{chunk-FSW4FUMW.js.map → chunk-M7IJVOJA.js.map} +0 -0
- /package/dist/{chunk-DN3RLR5Z.js.map → chunk-PVUNDNT3.js.map} +0 -0
- /package/dist/{chunk-YWKLUQDC.js.map → chunk-R6UCPHUD.js.map} +0 -0
- /package/dist/{chunk-QFZU5CEO.js.map → chunk-SCC7HBFZ.js.map} +0 -0
- /package/dist/{chunk-ZLC4TSXF.js.map → chunk-VJRITDSQ.js.map} +0 -0
- /package/dist/{chunk-FXBMFGOV.js.map → chunk-X5JTG52Q.js.map} +0 -0
- /package/dist/{chunk-LDS4SZBU.js.map → chunk-XIA2ACKX.js.map} +0 -0
- /package/dist/{chunk-D2WX3BET.js.map → chunk-XOQNDWVW.js.map} +0 -0
- /package/dist/{chunk-QQFURUMS.js.map → chunk-XZN7QBRH.js.map} +0 -0
- /package/dist/{chunk-6KIUVVKX.js.map → chunk-Z5CBUZIW.js.map} +0 -0
- /package/dist/{client-VBV7Q43P.js.map → client-A5OK3IFO.js.map} +0 -0
- /package/dist/{config-52C3DJD2.js.map → config-DQ5SILHX.js.map} +0 -0
- /package/dist/{config-mutate-DKQESY6F.js.map → config-mutate-62FCJ3S6.js.map} +0 -0
- /package/dist/{config-mutator-BF4D4QGN.js.map → config-mutator-3ZL5YQSO.js.map} +0 -0
- /package/dist/{contributions-5OEZWYXI.js.map → contributions-L2YS4AH2.js.map} +0 -0
- /package/dist/{doctor-VLRC4HW2.js.map → doctor-7TPSMMFA.js.map} +0 -0
- /package/dist/{follow-up-tool-235LDEMP.js.map → follow-up-tool-FKWIRFPW.js.map} +0 -0
- /package/dist/{hub-5QK7KYTZ.js.map → hub-EU5ECAJB.js.map} +0 -0
- /package/dist/{notes-YLTNRMB5.js.map → notes-2VC47RCK.js.map} +0 -0
- /package/dist/{promote-UPPQ4BQE.js.map → promote-XBDWCHLU.js.map} +0 -0
- /package/dist/{query-XQS5JN6E.js.map → query-UI6GQEL7.js.map} +0 -0
- /package/dist/{registry-MOMTLJ6R.js.map → registry-JW6ETTBA.js.map} +0 -0
- /package/dist/{request-planner-QGZJEAKY.js.map → request-planner-SEXYQN7D.js.map} +0 -0
- /package/dist/{review-candidates-PAKF2JQF.js.map → review-candidates-PIJWPPHQ.js.map} +0 -0
- /package/dist/{routing-JG3EV4O4.js.map → routing-2V3Y6ZR5.js.map} +0 -0
- /package/dist/{schedule-tool-O7ZZ2A7X.js.map → schedule-tool-KFZ27JTH.js.map} +0 -0
- /package/dist/{scheduler-LMPBAA34.js.map → scheduler-SVZKDKJV.js.map} +0 -0
- /package/dist/{seat-JN3IVZ3G.js.map → seat-C6TMCJWI.js.map} +0 -0
- /package/dist/{select-ZMMRFMNO.js.map → select-DP64KWO4.js.map} +0 -0
- /package/dist/{set-enabled-7Y3TW6Z4.js.map → set-enabled-WCH6FU4N.js.map} +0 -0
- /package/dist/{tool-S7QI6HRA.js.map → tool-TWQRBV4Y.js.map} +0 -0
- /package/dist/{tool-OCYXCDOK.js.map → tool-WUK3ZOWG.js.map} +0 -0
- /package/dist/{wiki-OCLFFZG6.js.map → wiki-4LAJ36XR.js.map} +0 -0
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-UTSXNAHM.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-XOQNDWVW.js";import"./chunk-EOLEKSN6.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-A5OK3IFO.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,qa as o,ra as p,sa as q,ua as r}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,qa as o,ra as p,sa as q,ua as r}from"./chunk-EOLEKSN6.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";r();export{a as INTEGRATION_KINDS,o as WIKI_CONTRIBUTE_JOB,p as WIKI_CONTRIBUTE_MERGE_JOB,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,q as withContributionJobs};
|
|
2
|
+
//# sourceMappingURL=config-DQ5SILHX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=config-mutate-
|
|
1
|
+
import{a,b}from"./chunk-ARSVKSC4.js";import"./chunk-EOLEKSN6.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-62FCJ3S6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-BWSB7NOX.js";import"./chunk-EOLEKSN6.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-3ZL5YQSO.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-X5JTG52Q.js";import"./chunk-PVUNDNT3.js";import{f as Q,k as V}from"./chunk-GLQLCBJS.js";import"./chunk-M7IJVOJA.js";import"./chunk-VD7IO653.js";import"./chunk-XIA2ACKX.js";import"./chunk-WPNRDEHW.js";import{c as O}from"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-R6UCPHUD.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import{b as X}from"./chunk-4VVHGR7H.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-EOLEKSN6.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
|
|
2
2
|
`),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
|
|
3
3
|
${k.join(`
|
|
4
4
|
`)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
|
|
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
|
|
|
54
54
|
`).replace(/\n{3,}/g,`
|
|
55
55
|
|
|
56
56
|
`).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
|
|
57
|
-
//# sourceMappingURL=contributions-
|
|
57
|
+
//# sourceMappingURL=contributions-L2YS4AH2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=doctor-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-SCC7HBFZ.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-EOLEKSN6.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-7TPSMMFA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-4ZFLYY5P.js";import"./chunk-RKPAVWXF.js";import{b as m}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-VJRITDSQ.js";import"./chunk-CPMQZ6Z7.js";import"./chunk-BWSB7NOX.js";import"./chunk-A347YHEW.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-EOLEKSN6.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-FKWIRFPW.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=hub-
|
|
1
|
+
import{a}from"./chunk-4O4GZBKZ.js";import"./chunk-BCUR2TJ7.js";import"./chunk-3PGPN323.js";import"./chunk-XIA2ACKX.js";import"./chunk-WPNRDEHW.js";import"./chunk-R6UCPHUD.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-EOLEKSN6.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-EU5ECAJB.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1589,7 +1589,8 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1589
1589
|
* contribution (#824): `agentx wiki contribute --all` reviews the
|
|
1590
1590
|
* agent's work since its last run and queues sourced patches for the
|
|
1591
1591
|
* daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
|
|
1592
|
-
* run; `model` overrides the wiki-wide model.
|
|
1592
|
+
* run; `model` overrides the wiki-wide model. `absorb` leaves the
|
|
1593
|
+
* agent out of the bulk absorb. */
|
|
1593
1594
|
wiki: z.ZodOptional<z.ZodObject<{
|
|
1594
1595
|
contribute: z.ZodDefault<z.ZodObject<{
|
|
1595
1596
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1607,6 +1608,17 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1607
1608
|
maxPatches?: number | undefined;
|
|
1608
1609
|
maxCostUsd?: number | undefined;
|
|
1609
1610
|
}>>;
|
|
1611
|
+
/** Whether `agentx wiki absorb` without `--agent` compiles this
|
|
1612
|
+
* agent's raw entries (#850). On by default. Off, the agent is skipped
|
|
1613
|
+
* and named; its raw entries are still captured, so absorb can resume
|
|
1614
|
+
* later with nothing lost. `--agent <id>` still runs it. */
|
|
1615
|
+
absorb: z.ZodDefault<z.ZodObject<{
|
|
1616
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1617
|
+
}, "strip", z.ZodTypeAny, {
|
|
1618
|
+
enabled: boolean;
|
|
1619
|
+
}, {
|
|
1620
|
+
enabled?: boolean | undefined;
|
|
1621
|
+
}>>;
|
|
1610
1622
|
}, "strip", z.ZodTypeAny, {
|
|
1611
1623
|
contribute: {
|
|
1612
1624
|
enabled: boolean;
|
|
@@ -1614,6 +1626,9 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1614
1626
|
model?: string | undefined;
|
|
1615
1627
|
maxCostUsd?: number | undefined;
|
|
1616
1628
|
};
|
|
1629
|
+
absorb: {
|
|
1630
|
+
enabled: boolean;
|
|
1631
|
+
};
|
|
1617
1632
|
}, {
|
|
1618
1633
|
contribute?: {
|
|
1619
1634
|
model?: string | undefined;
|
|
@@ -1621,6 +1636,9 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1621
1636
|
maxPatches?: number | undefined;
|
|
1622
1637
|
maxCostUsd?: number | undefined;
|
|
1623
1638
|
} | undefined;
|
|
1639
|
+
absorb?: {
|
|
1640
|
+
enabled?: boolean | undefined;
|
|
1641
|
+
} | undefined;
|
|
1624
1642
|
}>>;
|
|
1625
1643
|
permissionMode: z.ZodDefault<z.ZodString>;
|
|
1626
1644
|
/** How this agent's `claude` CLI is billed (claude-code tier). Default
|
|
@@ -1980,6 +1998,9 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1980
1998
|
model?: string | undefined;
|
|
1981
1999
|
maxCostUsd?: number | undefined;
|
|
1982
2000
|
};
|
|
2001
|
+
absorb: {
|
|
2002
|
+
enabled: boolean;
|
|
2003
|
+
};
|
|
1983
2004
|
} | undefined;
|
|
1984
2005
|
voice?: {
|
|
1985
2006
|
system?: string | Record<string, string> | undefined;
|
|
@@ -2028,6 +2049,9 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
2028
2049
|
maxPatches?: number | undefined;
|
|
2029
2050
|
maxCostUsd?: number | undefined;
|
|
2030
2051
|
} | undefined;
|
|
2052
|
+
absorb?: {
|
|
2053
|
+
enabled?: boolean | undefined;
|
|
2054
|
+
} | undefined;
|
|
2031
2055
|
} | undefined;
|
|
2032
2056
|
voice?: {
|
|
2033
2057
|
system?: string | Record<string, string> | undefined;
|
|
@@ -2503,7 +2527,8 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2503
2527
|
* contribution (#824): `agentx wiki contribute --all` reviews the
|
|
2504
2528
|
* agent's work since its last run and queues sourced patches for the
|
|
2505
2529
|
* daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
|
|
2506
|
-
* run; `model` overrides the wiki-wide model.
|
|
2530
|
+
* run; `model` overrides the wiki-wide model. `absorb` leaves the
|
|
2531
|
+
* agent out of the bulk absorb. */
|
|
2507
2532
|
wiki: z.ZodOptional<z.ZodObject<{
|
|
2508
2533
|
contribute: z.ZodDefault<z.ZodObject<{
|
|
2509
2534
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -2521,6 +2546,17 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2521
2546
|
maxPatches?: number | undefined;
|
|
2522
2547
|
maxCostUsd?: number | undefined;
|
|
2523
2548
|
}>>;
|
|
2549
|
+
/** Whether `agentx wiki absorb` without `--agent` compiles this
|
|
2550
|
+
* agent's raw entries (#850). On by default. Off, the agent is skipped
|
|
2551
|
+
* and named; its raw entries are still captured, so absorb can resume
|
|
2552
|
+
* later with nothing lost. `--agent <id>` still runs it. */
|
|
2553
|
+
absorb: z.ZodDefault<z.ZodObject<{
|
|
2554
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2555
|
+
}, "strip", z.ZodTypeAny, {
|
|
2556
|
+
enabled: boolean;
|
|
2557
|
+
}, {
|
|
2558
|
+
enabled?: boolean | undefined;
|
|
2559
|
+
}>>;
|
|
2524
2560
|
}, "strip", z.ZodTypeAny, {
|
|
2525
2561
|
contribute: {
|
|
2526
2562
|
enabled: boolean;
|
|
@@ -2528,6 +2564,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2528
2564
|
model?: string | undefined;
|
|
2529
2565
|
maxCostUsd?: number | undefined;
|
|
2530
2566
|
};
|
|
2567
|
+
absorb: {
|
|
2568
|
+
enabled: boolean;
|
|
2569
|
+
};
|
|
2531
2570
|
}, {
|
|
2532
2571
|
contribute?: {
|
|
2533
2572
|
model?: string | undefined;
|
|
@@ -2535,6 +2574,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2535
2574
|
maxPatches?: number | undefined;
|
|
2536
2575
|
maxCostUsd?: number | undefined;
|
|
2537
2576
|
} | undefined;
|
|
2577
|
+
absorb?: {
|
|
2578
|
+
enabled?: boolean | undefined;
|
|
2579
|
+
} | undefined;
|
|
2538
2580
|
}>>;
|
|
2539
2581
|
permissionMode: z.ZodDefault<z.ZodString>;
|
|
2540
2582
|
/** How this agent's `claude` CLI is billed (claude-code tier). Default
|
|
@@ -2894,6 +2936,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2894
2936
|
model?: string | undefined;
|
|
2895
2937
|
maxCostUsd?: number | undefined;
|
|
2896
2938
|
};
|
|
2939
|
+
absorb: {
|
|
2940
|
+
enabled: boolean;
|
|
2941
|
+
};
|
|
2897
2942
|
} | undefined;
|
|
2898
2943
|
voice?: {
|
|
2899
2944
|
system?: string | Record<string, string> | undefined;
|
|
@@ -2942,6 +2987,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2942
2987
|
maxPatches?: number | undefined;
|
|
2943
2988
|
maxCostUsd?: number | undefined;
|
|
2944
2989
|
} | undefined;
|
|
2990
|
+
absorb?: {
|
|
2991
|
+
enabled?: boolean | undefined;
|
|
2992
|
+
} | undefined;
|
|
2945
2993
|
} | undefined;
|
|
2946
2994
|
voice?: {
|
|
2947
2995
|
system?: string | Record<string, string> | undefined;
|
|
@@ -5546,18 +5594,25 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5546
5594
|
asyncWhenHuman: z.ZodDefault<z.ZodBoolean>;
|
|
5547
5595
|
/** A delegation with no answer after this long is reported as timed out. */
|
|
5548
5596
|
timeoutMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5597
|
+
/** A restart that stops the turn passing a delegation's answer on to
|
|
5598
|
+
* the person (#846): run that turn once more after the next start,
|
|
5599
|
+
* and if it fails again, tell the person and note the open request. */
|
|
5600
|
+
requeueRelayOnRestart: z.ZodDefault<z.ZodBoolean>;
|
|
5549
5601
|
}, "strip", z.ZodTypeAny, {
|
|
5550
5602
|
asyncWhenHuman: boolean;
|
|
5551
5603
|
timeoutMinutes: number;
|
|
5604
|
+
requeueRelayOnRestart: boolean;
|
|
5552
5605
|
}, {
|
|
5553
5606
|
asyncWhenHuman?: boolean | undefined;
|
|
5554
5607
|
timeoutMinutes?: number | undefined;
|
|
5608
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
5555
5609
|
}>>;
|
|
5556
5610
|
}, "strip", z.ZodTypeAny, {
|
|
5557
5611
|
enabled: boolean;
|
|
5558
5612
|
delegation: {
|
|
5559
5613
|
asyncWhenHuman: boolean;
|
|
5560
5614
|
timeoutMinutes: number;
|
|
5615
|
+
requeueRelayOnRestart: boolean;
|
|
5561
5616
|
};
|
|
5562
5617
|
peers: {
|
|
5563
5618
|
name: string;
|
|
@@ -5583,6 +5638,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5583
5638
|
delegation?: {
|
|
5584
5639
|
asyncWhenHuman?: boolean | undefined;
|
|
5585
5640
|
timeoutMinutes?: number | undefined;
|
|
5641
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
5586
5642
|
} | undefined;
|
|
5587
5643
|
peers?: {
|
|
5588
5644
|
name: string;
|
|
@@ -7495,6 +7551,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7495
7551
|
model?: string | undefined;
|
|
7496
7552
|
maxCostUsd?: number | undefined;
|
|
7497
7553
|
};
|
|
7554
|
+
absorb: {
|
|
7555
|
+
enabled: boolean;
|
|
7556
|
+
};
|
|
7498
7557
|
} | undefined;
|
|
7499
7558
|
voice?: {
|
|
7500
7559
|
system?: string | Record<string, string> | undefined;
|
|
@@ -7548,6 +7607,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7548
7607
|
delegation: {
|
|
7549
7608
|
asyncWhenHuman: boolean;
|
|
7550
7609
|
timeoutMinutes: number;
|
|
7610
|
+
requeueRelayOnRestart: boolean;
|
|
7551
7611
|
};
|
|
7552
7612
|
peers: {
|
|
7553
7613
|
name: string;
|
|
@@ -8333,6 +8393,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8333
8393
|
maxPatches?: number | undefined;
|
|
8334
8394
|
maxCostUsd?: number | undefined;
|
|
8335
8395
|
} | undefined;
|
|
8396
|
+
absorb?: {
|
|
8397
|
+
enabled?: boolean | undefined;
|
|
8398
|
+
} | undefined;
|
|
8336
8399
|
} | undefined;
|
|
8337
8400
|
voice?: {
|
|
8338
8401
|
system?: string | Record<string, string> | undefined;
|
|
@@ -8438,6 +8501,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8438
8501
|
delegation?: {
|
|
8439
8502
|
asyncWhenHuman?: boolean | undefined;
|
|
8440
8503
|
timeoutMinutes?: number | undefined;
|
|
8504
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
8441
8505
|
} | undefined;
|
|
8442
8506
|
peers?: {
|
|
8443
8507
|
name: string;
|
|
@@ -9871,6 +9935,8 @@ declare class AgentXDaemon {
|
|
|
9871
9935
|
private delegations;
|
|
9872
9936
|
/** Synchronous delegations in flight, to refuse cycles that could never finish. */
|
|
9873
9937
|
private syncWaits;
|
|
9938
|
+
/** Recent /send/agent answers, so a retry gets the same task id (#847). */
|
|
9939
|
+
private sendAgentDedupe;
|
|
9874
9940
|
/** Phone-app callback replies waiting for the dashboard to file them. */
|
|
9875
9941
|
private callbackReplies;
|
|
9876
9942
|
private hooks;
|
|
@@ -10720,6 +10786,12 @@ interface AgentTask {
|
|
|
10720
10786
|
/** Called with `runningTaskId` as soon as the run starts. Never fires for
|
|
10721
10787
|
* a message that was queued or dropped instead of run. */
|
|
10722
10788
|
onStart?: (runningTaskId: string) => void;
|
|
10789
|
+
/** Aborted when the HTTP caller waiting on this run has gone (timeout,
|
|
10790
|
+
* disconnect). A run still waiting for a busy agent's slot is then
|
|
10791
|
+
* dropped instead of started: nobody is left to read its answer, and a
|
|
10792
|
+
* retrying caller would otherwise have every attempt run once the slot
|
|
10793
|
+
* frees (#822). A run that already started is not affected. */
|
|
10794
|
+
callerSignal?: AbortSignal;
|
|
10723
10795
|
/** How to re-enter this run if a restart cuts it off (agents/resume).
|
|
10724
10796
|
* Absent: recorded as a direct run with this task's context. */
|
|
10725
10797
|
origin?: RunOrigin;
|
|
@@ -12507,6 +12579,8 @@ interface AgentMemoryOptions {
|
|
|
12507
12579
|
declare class AgentMemory {
|
|
12508
12580
|
readonly baseDir: string;
|
|
12509
12581
|
constructor(opts?: AgentMemoryOptions);
|
|
12582
|
+
/** The agent's note folder, without creating it. */
|
|
12583
|
+
dirOf(agentId: string): string;
|
|
12510
12584
|
private dirFor;
|
|
12511
12585
|
private fileFor;
|
|
12512
12586
|
private indexPath;
|
|
@@ -12877,6 +12951,9 @@ declare class AgentRegistry {
|
|
|
12877
12951
|
* it on the trace. Null means: run locally, the reason is logged and on
|
|
12878
12952
|
* the trace. */
|
|
12879
12953
|
private runCloudSession;
|
|
12954
|
+
/** The answer for a run whose HTTP caller left before it got a slot
|
|
12955
|
+
* (#822). Logged so the dropped request is visible on the node. */
|
|
12956
|
+
private callerGone;
|
|
12880
12957
|
/**
|
|
12881
12958
|
* Execute a task on an agent. Respects maxConcurrent limit.
|
|
12882
12959
|
*
|
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-YHD4PHFX.js";import"./chunk-4FMZTM3W.js";import"./chunk-GTJIKXDB.js";import"./chunk-Z5CBUZIW.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-DVR6PFCJ.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-VJRITDSQ.js";import"./chunk-I3RAUJCD.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-CDLJOGVZ.js";import"./chunk-AOFTTIZZ.js";import"./chunk-GLQLCBJS.js";import"./chunk-MEFPXHQJ.js";import{s as ut}from"./chunk-CPMQZ6Z7.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-BWSB7NOX.js";import"./chunk-A347YHEW.js";import"./chunk-VWTBHLMX.js";import"./chunk-4O4GZBKZ.js";import{a as ht}from"./chunk-BCUR2TJ7.js";import"./chunk-3PGPN323.js";import"./chunk-M7IJVOJA.js";import"./chunk-VD7IO653.js";import{f as gt,g as ft}from"./chunk-XIA2ACKX.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-XZN7QBRH.js";import{j as it,k as rt,l as at}from"./chunk-R6UCPHUD.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,ua as nt}from"./chunk-EOLEKSN6.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).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{existsSync as y,readdirSync as k,readFileSync as b,statSync as N}from"fs";import{resolve as $}from"path";var R=new Set(["memory.md"]);function D(n){let e={dir:n,notes:[],skipped:[]};if(!y(n))return e;for(let t of k(n).sort()){if(!t.endsWith(".md")||t.startsWith(".")||R.has(t.toLowerCase()))continue;let s=$(n,t),d;try{if(!N(s).isFile())continue;d=b(s,"utf-8")}catch(i){e.skipped.push({file:t,reason:`unreadable: ${i.message}`});continue}let o=S(d,t);o?e.notes.push(o):e.skipped.push({file:t,reason:"empty"})}return e.notes.sort((t,s)=>t.name.localeCompare(s.name)||t.file.localeCompare(s.file)),e}function S(n,e){let t=n.replace(/^/,"").replace(/\r\n/g,`
|
|
2
|
+
`),{fields:s,metadata:d,body:o}=A(t);if(!o.trim()&&Object.keys(s).length===0)return null;let i=p=>{let f=s[p]??d[p];return f&&f.trim()?f.trim():void 0},a=o.split(`
|
|
3
|
+
`).map(p=>p.replace(/^#+\s*/,"").trim()).find(Boolean)??"",r={name:i("name")??e.replace(/\.md$/,""),file:e,description:i("description")??a,body:o.trim(),missing:[],problems:[]},c=i("type");c&&(r.type=c);let g=i("updated")??i("created");g&&(r.updated=g);let l=i("source");l?r.source=l:r.missing.push("source");let u=i("checked"),m=u?w(u):void 0;return m?r.checked=m:(r.missing.push("checked"),u&&r.problems.push(`checked "${u}" is not a date (use YYYY-MM-DD)`)),r}function w(n){let e=n.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/);if(!e)return;let t=`${e[1]}-${e[2]}-${e[3]}`,s=Date.parse(`${t}T00:00:00Z`);return Number.isFinite(s)&&new Date(s).toISOString().slice(0,10)===t?t:void 0}function A(n){let e={},t={};if(!n.startsWith(`---
|
|
4
|
+
`))return{fields:e,metadata:t,body:n};let s=n.indexOf(`
|
|
5
|
+
---`,4);if(s<0)return{fields:e,metadata:t,body:n};let d=n.indexOf(`
|
|
6
|
+
`,s+4),o=d<0?"":n.slice(d+1),i;for(let a of n.slice(4,s).split(`
|
|
7
|
+
`)){let r=a.match(/^\s+([A-Za-z_][\w-]*):\s*(.*)$/);if(r){i==="metadata"&&(t[r[1]]=h(r[2]));continue}let c=a.match(/^([A-Za-z_][\w-]*):\s*(.*)$/);if(c){if(c[2].trim()===""){i=c[1];continue}i=void 0,e[c[1]]=h(c[2])}}return{fields:e,metadata:t,body:o}}function h(n){let e=n.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1).replace(/\\"/g,'"'):e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replace(/''/g,"'"):e}export{S as parseNote,D as readNotes};
|
|
8
|
+
//# sourceMappingURL=note-reader-LPPIYYLT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/wiki/note-reader.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from \"fs\"\nimport { resolve } from \"path\"\n\n// --- Reading an agent's notes (#850) ---\n//\n// An agent's notes are small markdown files with frontmatter, one fact or\n// one current state each. They live in one of two places:\n//\n// - the AgentX note store, `.agentx/agent-memory/<agent>/<type>_<name>.md`\n// (src/agents/agent-memory.ts), with `name`, `description`, `type`,\n// `created` and `updated`;\n// - a notes folder another tool keeps, such as the one a `claude-code`\n// agent writes outside AgentX: `<name>.md` with `name`, `description`\n// and `type`, sometimes with extra fields under a `metadata:` block.\n//\n// Both are read the same way. Two more fields say whether a note can be\n// trusted as written: `source` (where it was checked) and `checked` (the\n// date it was checked). They are read from the top level or from under\n// `metadata:`, never guessed from the prose. A note without them is still\n// returned, with `missing` naming what it lacks.\n//\n// Read only: nothing here writes a note.\n\nexport type NoteField = \"source\" | \"checked\"\n\nexport interface AgentNote {\n /** Frontmatter `name`, else the file name without `.md`. */\n name: string\n /** File name inside the notes folder. */\n file: string\n /** `user`, `feedback`, `project`, `reference`, or what the file says. */\n type?: string\n /** One line saying what the note holds. */\n description: string\n body: string\n /** Where the note's content was checked. */\n source?: string\n /** When it was checked, YYYY-MM-DD. */\n checked?: string\n /** When the note was last written, as the file says. */\n updated?: string\n /** `source` and `checked`, when absent or unreadable. */\n missing: NoteField[]\n /** Why a field present in the file could not be used. */\n problems: string[]\n}\n\nexport interface NotesRead {\n dir: string\n notes: AgentNote[]\n /** Files that are not notes, with the reason. */\n skipped: Array<{ file: string; reason: string }>\n}\n\n/** The index files tools keep next to the notes; not notes themselves. */\nconst INDEX_FILES = new Set([\"memory.md\"])\n\n/**\n * Every note in `dir`, sorted by name. Only `*.md` files directly in the\n * folder are read; sub-folders (such as `_versions/`) and the `MEMORY.md`\n * index are not notes. A folder that does not exist reads as empty.\n */\nexport function readNotes(dir: string): NotesRead {\n const out: NotesRead = { dir, notes: [], skipped: [] }\n if (!existsSync(dir)) return out\n for (const file of readdirSync(dir).sort()) {\n if (!file.endsWith(\".md\") || file.startsWith(\".\") || INDEX_FILES.has(file.toLowerCase())) continue\n const path = resolve(dir, file)\n let raw: string\n try {\n if (!statSync(path).isFile()) continue\n raw = readFileSync(path, \"utf-8\")\n } catch (err) {\n out.skipped.push({ file, reason: `unreadable: ${(err as Error).message}` })\n continue\n }\n const note = parseNote(raw, file)\n if (note) out.notes.push(note)\n else out.skipped.push({ file, reason: \"empty\" })\n }\n out.notes.sort((a, b) => a.name.localeCompare(b.name) || a.file.localeCompare(b.file))\n return out\n}\n\n/**\n * One note from its file content. A file without frontmatter is still a\n * note: its first line is its description, and it has no source or check\n * date. Returns null for an empty file.\n */\nexport function parseNote(raw: string, file: string): AgentNote | null {\n const text = raw.replace(/^/, \"\").replace(/\\r\\n/g, \"\\n\")\n const { fields, metadata, body } = splitFrontmatter(text)\n if (!body.trim() && Object.keys(fields).length === 0) return null\n\n const pick = (key: string): string | undefined => {\n const v = fields[key] ?? metadata[key]\n return v && v.trim() ? v.trim() : undefined\n }\n const firstLine = body.split(\"\\n\").map((l) => l.replace(/^#+\\s*/, \"\").trim()).find(Boolean) ?? \"\"\n const note: AgentNote = {\n name: pick(\"name\") ?? file.replace(/\\.md$/, \"\"),\n file,\n description: pick(\"description\") ?? firstLine,\n body: body.trim(),\n missing: [],\n problems: [],\n }\n const type = pick(\"type\")\n if (type) note.type = type\n const updated = pick(\"updated\") ?? pick(\"created\")\n if (updated) note.updated = updated\n\n const source = pick(\"source\")\n if (source) note.source = source\n else note.missing.push(\"source\")\n\n const checkedRaw = pick(\"checked\")\n const checked = checkedRaw ? checkDate(checkedRaw) : undefined\n if (checked) note.checked = checked\n else {\n note.missing.push(\"checked\")\n if (checkedRaw) note.problems.push(`checked \"${checkedRaw}\" is not a date (use YYYY-MM-DD)`)\n }\n return note\n}\n\n/** YYYY-MM-DD from a date or an ISO date and time; undefined otherwise. */\nfunction checkDate(v: string): string | undefined {\n const m = v.match(/^(\\d{4})-(\\d{2})-(\\d{2})(?:[T ][\\d:.]+(?:Z|[+-]\\d{2}:?\\d{2})?)?$/)\n if (!m) return undefined\n const day = `${m[1]}-${m[2]}-${m[3]}`\n const t = Date.parse(`${day}T00:00:00Z`)\n // Rejects 2026-02-30 and the like, which Date.parse rolls over.\n return Number.isFinite(t) && new Date(t).toISOString().slice(0, 10) === day ? day : undefined\n}\n\n/**\n * Top-level `key: value` lines, and the indented `key: value` lines of a\n * `metadata:` block. No other YAML: lists, nested blocks other than\n * `metadata:` and multi-line values are ignored, not misread.\n */\nfunction splitFrontmatter(text: string): { fields: Record<string, string>; metadata: Record<string, string>; body: string } {\n const fields: Record<string, string> = {}\n const metadata: Record<string, string> = {}\n if (!text.startsWith(\"---\\n\")) return { fields, metadata, body: text }\n const end = text.indexOf(\"\\n---\", 4)\n if (end < 0) return { fields, metadata, body: text }\n const after = text.indexOf(\"\\n\", end + 4)\n const body = after < 0 ? \"\" : text.slice(after + 1)\n\n let block: string | undefined\n for (const line of text.slice(4, end).split(\"\\n\")) {\n const nested = line.match(/^\\s+([A-Za-z_][\\w-]*):\\s*(.*)$/)\n if (nested) {\n if (block === \"metadata\") metadata[nested[1]] = unquote(nested[2])\n continue\n }\n const top = line.match(/^([A-Za-z_][\\w-]*):\\s*(.*)$/)\n if (!top) continue\n if (top[2].trim() === \"\") { block = top[1]; continue }\n block = undefined\n fields[top[1]] = unquote(top[2])\n }\n return { fields, metadata, body }\n}\n\nfunction unquote(v: string): string {\n const s = v.trim()\n if (s.length >= 2 && s.startsWith(\"\\\"\") && s.endsWith(\"\\\"\")) return s.slice(1, -1).replace(/\\\\\"/g, \"\\\"\")\n if (s.length >= 2 && s.startsWith(\"'\") && s.endsWith(\"'\")) return s.slice(1, -1).replace(/''/g, \"'\")\n return s\n}\n"],"mappings":"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","names":["existsSync","readdirSync","readFileSync","statSync","resolve","INDEX_FILES","readNotes","dir","out","file","path","raw","err","note","parseNote","a","b","text","fields","metadata","body","splitFrontmatter","pick","key","v","firstLine","l","type","updated","source","checkedRaw","checked","checkDate","m","day","t","end","after","block","line","nested","unquote","top","s"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=notes-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-A347YHEW.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_MAX_DEFERRALS,b as NOTE_LIMITS,a as NOTE_OUTCOMES,g as NoteStore,h as isWaiting,d as noteId,i as renderNotesInbox,e as today,f as validateNote};
|
|
2
|
+
//# sourceMappingURL=notes-2VC47RCK.js.map
|