agentix-cli 0.128.0 → 0.130.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-DWSHIDN6.js} +2 -2
- package/dist/{ChatApp-72HXQV24.js → ChatApp-CROSI7JM.js} +2 -2
- package/dist/{absorb-eval-O3HA6XA5.js → absorb-eval-MNGQ752C.js} +2 -2
- package/dist/{agent-S2DXXALS.js → agent-4AQOFPRD.js} +2 -2
- package/dist/{board-dashboard-ZKXXK5CG.js → board-dashboard-54A3XTV5.js} +256 -236
- package/dist/board-dashboard-54A3XTV5.js.map +1 -0
- package/dist/{chunk-ZLC4TSXF.js → chunk-242MPMJX.js} +2 -2
- package/dist/{chunk-6KIUVVKX.js → chunk-5KKXJZZ4.js} +2 -2
- package/dist/{chunk-5DAEJF5S.js → chunk-5VKFIBXY.js} +3 -3
- package/dist/{chunk-5DAEJF5S.js.map → chunk-5VKFIBXY.js.map} +1 -1
- package/dist/{chunk-DQ2LNQ2D.js → chunk-AERIU4AH.js} +13 -13
- package/dist/chunk-AERIU4AH.js.map +1 -0
- package/dist/{chunk-O2BS6N3T.js → chunk-HF4OXA5L.js} +2 -2
- package/dist/{chunk-YWKLUQDC.js → chunk-I4GT27UO.js} +2 -2
- package/dist/{chunk-FSW4FUMW.js → chunk-I4OQQRY2.js} +3 -3
- package/dist/{chunk-HKW56YZK.js → chunk-J4I5ZJ2V.js} +2 -2
- package/dist/chunk-JE5EJGGD.js +4 -0
- package/dist/chunk-JE5EJGGD.js.map +1 -0
- package/dist/chunk-KBJNJGBP.js +2 -0
- package/dist/chunk-KBJNJGBP.js.map +1 -0
- package/dist/{chunk-6GGGXCOY.js → chunk-LJWEJ6UZ.js} +23 -14
- package/dist/{chunk-6GGGXCOY.js.map → chunk-LJWEJ6UZ.js.map} +1 -1
- package/dist/{chunk-FXBMFGOV.js → chunk-LLLBH2HH.js} +2 -2
- package/dist/{chunk-6W74CHNW.js → chunk-MEFPXHQJ.js} +13 -13
- package/dist/chunk-MEFPXHQJ.js.map +1 -0
- package/dist/{chunk-TPNTFCSQ.js → chunk-MZJY26FW.js} +2 -2
- package/dist/{chunk-LDS4SZBU.js → chunk-N2YSVZML.js} +2 -2
- package/dist/{chunk-P4XGM7ZM.js → chunk-NR7WLMNI.js} +2 -2
- package/dist/{chunk-4V7SWL2S.js → chunk-Q5FEWCS5.js} +2 -2
- package/dist/{chunk-D2WX3BET.js → chunk-QPYN2UTV.js} +2 -2
- package/dist/{chunk-C5MTLW7O.js → chunk-QXZLYCEZ.js} +2 -2
- package/dist/{chunk-QFZU5CEO.js → chunk-RKB7FQJF.js} +2 -2
- package/dist/{chunk-Z3W7D5RR.js → chunk-TJDNS5G6.js} +2 -2
- package/dist/{chunk-DN3RLR5Z.js → chunk-TN5A7PLU.js} +2 -2
- package/dist/{chunk-TG6CT54D.js → chunk-U2EHJZAZ.js} +2 -2
- package/dist/{chunk-EJT4MA3J.js → chunk-UBA2QJCY.js} +238 -238
- package/dist/chunk-UBA2QJCY.js.map +1 -0
- package/dist/chunk-UUFJQMHE.js +54 -0
- package/dist/chunk-UUFJQMHE.js.map +1 -0
- package/dist/{chunk-QACEFESP.js → chunk-W2HEJKJR.js} +30 -30
- package/dist/chunk-W2HEJKJR.js.map +1 -0
- package/dist/{chunk-QQFURUMS.js → chunk-WX67I2KN.js} +2 -2
- package/dist/{chunk-2SV4RKRW.js → chunk-YHCPBMRH.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-VBV7Q43P.js → client-KGWYROLX.js} +2 -2
- package/dist/{config-52C3DJD2.js → config-FNTLKUGA.js} +2 -2
- package/dist/{config-mutate-DKQESY6F.js → config-mutate-7BLOYRZF.js} +2 -2
- package/dist/config-mutator-NCLHYPJ3.js +2 -0
- package/dist/{contributions-5OEZWYXI.js → contributions-DLUQEAGL.js} +2 -2
- package/dist/{doctor-VLRC4HW2.js → doctor-32YP26SJ.js} +2 -2
- package/dist/{follow-up-tool-235LDEMP.js → follow-up-tool-AQ7NYZZR.js} +2 -2
- package/dist/{hub-5QK7KYTZ.js → hub-Q3I4ALQ2.js} +2 -2
- package/dist/index.d.ts +91 -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-TMAGEDUS.js} +2 -2
- package/dist/notes-settings-WMOH2V75.js +2 -0
- package/dist/{program-MVD57PKP.js → program-FESSM5TY.js} +285 -262
- package/dist/program-FESSM5TY.js.map +1 -0
- package/dist/{promote-UPPQ4BQE.js → promote-R7FKN5SY.js} +2 -2
- package/dist/{query-XQS5JN6E.js → query-YTKTNXCQ.js} +2 -2
- package/dist/{registry-MOMTLJ6R.js → registry-7L4RUATA.js} +2 -2
- package/dist/{request-planner-QGZJEAKY.js → request-planner-LEUMSI2K.js} +2 -2
- package/dist/{review-candidates-PAKF2JQF.js → review-candidates-MOSGA4IS.js} +2 -2
- package/dist/{routing-JG3EV4O4.js → routing-FSJ42RZH.js} +2 -2
- package/dist/schedule-tool-4T2VZIDW.js +2 -0
- package/dist/{scheduler-LMPBAA34.js → scheduler-6AQDHQI4.js} +2 -2
- package/dist/{seat-JN3IVZ3G.js → seat-O37EQRHE.js} +2 -2
- package/dist/{select-ZMMRFMNO.js → select-XO2STSQN.js} +2 -2
- package/dist/{set-enabled-7Y3TW6Z4.js → set-enabled-ZNEPEFGF.js} +2 -2
- package/dist/{tool-S7QI6HRA.js → tool-6KMEAY4U.js} +2 -2
- package/dist/{tool-OCYXCDOK.js → tool-PH45YCO5.js} +2 -2
- package/dist/wiki-4HD4FZ4W.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/chunk-QUXMLLX5.js +0 -2
- package/dist/chunk-QUXMLLX5.js.map +0 -1
- package/dist/config-mutator-BF4D4QGN.js +0 -2
- package/dist/notes-settings-X63D5HPM.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-DWSHIDN6.js.map} +0 -0
- /package/dist/{ChatApp-72HXQV24.js.map → ChatApp-CROSI7JM.js.map} +0 -0
- /package/dist/{absorb-eval-O3HA6XA5.js.map → absorb-eval-MNGQ752C.js.map} +0 -0
- /package/dist/{agent-S2DXXALS.js.map → agent-4AQOFPRD.js.map} +0 -0
- /package/dist/{chunk-ZLC4TSXF.js.map → chunk-242MPMJX.js.map} +0 -0
- /package/dist/{chunk-6KIUVVKX.js.map → chunk-5KKXJZZ4.js.map} +0 -0
- /package/dist/{chunk-O2BS6N3T.js.map → chunk-HF4OXA5L.js.map} +0 -0
- /package/dist/{chunk-YWKLUQDC.js.map → chunk-I4GT27UO.js.map} +0 -0
- /package/dist/{chunk-FSW4FUMW.js.map → chunk-I4OQQRY2.js.map} +0 -0
- /package/dist/{chunk-HKW56YZK.js.map → chunk-J4I5ZJ2V.js.map} +0 -0
- /package/dist/{chunk-FXBMFGOV.js.map → chunk-LLLBH2HH.js.map} +0 -0
- /package/dist/{chunk-TPNTFCSQ.js.map → chunk-MZJY26FW.js.map} +0 -0
- /package/dist/{chunk-LDS4SZBU.js.map → chunk-N2YSVZML.js.map} +0 -0
- /package/dist/{chunk-P4XGM7ZM.js.map → chunk-NR7WLMNI.js.map} +0 -0
- /package/dist/{chunk-4V7SWL2S.js.map → chunk-Q5FEWCS5.js.map} +0 -0
- /package/dist/{chunk-D2WX3BET.js.map → chunk-QPYN2UTV.js.map} +0 -0
- /package/dist/{chunk-C5MTLW7O.js.map → chunk-QXZLYCEZ.js.map} +0 -0
- /package/dist/{chunk-QFZU5CEO.js.map → chunk-RKB7FQJF.js.map} +0 -0
- /package/dist/{chunk-Z3W7D5RR.js.map → chunk-TJDNS5G6.js.map} +0 -0
- /package/dist/{chunk-DN3RLR5Z.js.map → chunk-TN5A7PLU.js.map} +0 -0
- /package/dist/{chunk-TG6CT54D.js.map → chunk-U2EHJZAZ.js.map} +0 -0
- /package/dist/{chunk-QQFURUMS.js.map → chunk-WX67I2KN.js.map} +0 -0
- /package/dist/{chunk-2SV4RKRW.js.map → chunk-YHCPBMRH.js.map} +0 -0
- /package/dist/{client-VBV7Q43P.js.map → client-KGWYROLX.js.map} +0 -0
- /package/dist/{config-52C3DJD2.js.map → config-FNTLKUGA.js.map} +0 -0
- /package/dist/{config-mutate-DKQESY6F.js.map → config-mutate-7BLOYRZF.js.map} +0 -0
- /package/dist/{config-mutator-BF4D4QGN.js.map → config-mutator-NCLHYPJ3.js.map} +0 -0
- /package/dist/{contributions-5OEZWYXI.js.map → contributions-DLUQEAGL.js.map} +0 -0
- /package/dist/{doctor-VLRC4HW2.js.map → doctor-32YP26SJ.js.map} +0 -0
- /package/dist/{follow-up-tool-235LDEMP.js.map → follow-up-tool-AQ7NYZZR.js.map} +0 -0
- /package/dist/{hub-5QK7KYTZ.js.map → hub-Q3I4ALQ2.js.map} +0 -0
- /package/dist/{notes-YLTNRMB5.js.map → notes-TMAGEDUS.js.map} +0 -0
- /package/dist/{notes-settings-X63D5HPM.js.map → notes-settings-WMOH2V75.js.map} +0 -0
- /package/dist/{promote-UPPQ4BQE.js.map → promote-R7FKN5SY.js.map} +0 -0
- /package/dist/{query-XQS5JN6E.js.map → query-YTKTNXCQ.js.map} +0 -0
- /package/dist/{registry-MOMTLJ6R.js.map → registry-7L4RUATA.js.map} +0 -0
- /package/dist/{request-planner-QGZJEAKY.js.map → request-planner-LEUMSI2K.js.map} +0 -0
- /package/dist/{review-candidates-PAKF2JQF.js.map → review-candidates-MOSGA4IS.js.map} +0 -0
- /package/dist/{routing-JG3EV4O4.js.map → routing-FSJ42RZH.js.map} +0 -0
- /package/dist/{schedule-tool-O7ZZ2A7X.js.map → schedule-tool-4T2VZIDW.js.map} +0 -0
- /package/dist/{scheduler-LMPBAA34.js.map → scheduler-6AQDHQI4.js.map} +0 -0
- /package/dist/{seat-JN3IVZ3G.js.map → seat-O37EQRHE.js.map} +0 -0
- /package/dist/{select-ZMMRFMNO.js.map → select-XO2STSQN.js.map} +0 -0
- /package/dist/{set-enabled-7Y3TW6Z4.js.map → set-enabled-ZNEPEFGF.js.map} +0 -0
- /package/dist/{tool-S7QI6HRA.js.map → tool-6KMEAY4U.js.map} +0 -0
- /package/dist/{tool-OCYXCDOK.js.map → tool-PH45YCO5.js.map} +0 -0
- /package/dist/{wiki-OCLFFZG6.js.map → wiki-4HD4FZ4W.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-I4GT27UO.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-WX67I2KN.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as S,c as O}from"./chunk-
|
|
1
|
+
import{b as S,c as O}from"./chunk-J4I5ZJ2V.js";import{g as B,i as J}from"./chunk-JE5EJGGD.js";import{a as I,b as P}from"./chunk-FCPTN6NF.js";import{a as X,b as ue}from"./chunk-7I7IEX4S.js";import{d as F}from"./chunk-QIJLFPWE.js";import{execFile as Ae}from"child_process";import{writeFileSync as ie,mkdirSync as x,existsSync as b,readFileSync as ke}from"fs";import{resolve as v}from"path";var le=["off","shadow","authoritative"],ge={telegram:"INTENT_LEDGER_MODE_TELEGRAM",slack:"INTENT_LEDGER_MODE_SLACK",whatsapp:"INTENT_LEDGER_MODE_WHATSAPP",discord:"INTENT_LEDGER_MODE_DISCORD",gitlab:"INTENT_LEDGER_MODE_GITLAB",github:"INTENT_LEDGER_MODE_GITHUB",workflow:"INTENT_LEDGER_MODE_WORKFLOW",cron:"INTENT_LEDGER_MODE_CRON",mesh:"INTENT_LEDGER_MODE_MESH"},me="INTENT_LEDGER_MODE";function G(i,e=process.env){let t=U(e[ge[i]]);if(t)return t;let n=U(e[me]);return n||"off"}function U(i){if(typeof i!="string")return null;let e=i.trim().toLowerCase();return le.includes(e)?e:null}P();import he from"better-sqlite3";import{existsSync as Ue,mkdirSync as fe}from"fs";import{dirname as pe,resolve as Ee}from"path";var T=class{db;path;constructor(e={}){this.path=Ee(process.cwd(),e.path??".agentx/intent/ledger.sqlite"),fe(pe(this.path),{recursive:!0}),this.db=new he(this.path),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),ye(this.db)}close(){this.db.close()}schemaVersion(){return this.db.prepare("SELECT MAX(v) AS v FROM schema_version").get().v??0}recordEvent(e){if(e.sourceEventId!==null){let n=this.findEventBySourceId(e.source,e.sourceEventId);if(n)return n}let t={id:e.id??I(e.ts),ts:e.ts,source:e.source,sourceEventId:e.sourceEventId,project:e.project,subject:e.subject,intent:e.intent,rawJson:e.rawJson};return this.db.prepare(`INSERT INTO intent_events (id, ts, source, source_event_id, project, subject, intent, raw_json)
|
|
2
2
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(t.id,t.ts,t.source,t.sourceEventId,t.project,t.subject,t.intent,t.rawJson),t}findEventBySourceId(e,t){let n=this.db.prepare(`SELECT id, ts, source, source_event_id, project, subject, intent, raw_json
|
|
3
3
|
FROM intent_events WHERE source = ? AND source_event_id = ?`).get(e,t);return n?Y(n):null}getEventById(e){let t=this.db.prepare(`SELECT id, ts, source, source_event_id, project, subject, intent, raw_json
|
|
4
4
|
FROM intent_events WHERE id = ?`).get(e);return t?Y(t):null}recordDecision(e){this.db.prepare(`INSERT INTO intent_decisions (event_id, decided_at, decided_by, agent_id, outcome, reason)
|
|
@@ -125,4 +125,4 @@ ${se(o.block,r.prompt)}`,r.maxOutputTokens),agentId:r.agent,autonomy:r.autonomy,
|
|
|
125
125
|
`);return t.length<=e?t.join(`
|
|
126
126
|
`):t.slice(-e).join(`
|
|
127
127
|
`)}function Xe(i,e,t){return new Promise((n,r)=>{Ae("/bin/sh",["-c",i],{timeout:e,maxBuffer:8*1024*1024,...t?{env:t}:{}},(s,a,o)=>{if(s&&s.killed){r(new Error(`command timed out after ${Math.round(e/1e3)}s`));return}n({stdout:String(a??""),stderr:String(o??""),code:s?typeof s.code=="number"?s.code:1:0})})})}export{T as a,V as b,ot as c,we as d,at as e,ct as f,$ as g,ee as h,G as i,We as j,z as k,Q as l,lt as m,Ce as n,oe as o,ae as p,ce as q,C as r,M as s};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-YHCPBMRH.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-
|
|
2
|
+
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-FESSM5TY.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-QPYN2UTV.js";import"./chunk-UUFJQMHE.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-KGWYROLX.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-UUFJQMHE.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-FNTLKUGA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=config-mutate-
|
|
1
|
+
import{a,b}from"./chunk-MZJY26FW.js";import"./chunk-UUFJQMHE.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-7BLOYRZF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-J4I5ZJ2V.js";import"./chunk-UUFJQMHE.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-NCLHYPJ3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-LLLBH2HH.js";import"./chunk-TN5A7PLU.js";import{f as Q,k as V}from"./chunk-GLQLCBJS.js";import"./chunk-I4OQQRY2.js";import"./chunk-VD7IO653.js";import"./chunk-N2YSVZML.js";import"./chunk-WPNRDEHW.js";import{c as O}from"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-I4GT27UO.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-UUFJQMHE.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-DLUQEAGL.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-RKB7FQJF.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-UUFJQMHE.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-32YP26SJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-U2EHJZAZ.js";import"./chunk-RKPAVWXF.js";import{b as m}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-242MPMJX.js";import"./chunk-YHCPBMRH.js";import"./chunk-J4I5ZJ2V.js";import"./chunk-JE5EJGGD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UUFJQMHE.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-AQ7NYZZR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=hub-
|
|
1
|
+
import{a}from"./chunk-TJDNS5G6.js";import"./chunk-NR7WLMNI.js";import"./chunk-3PGPN323.js";import"./chunk-N2YSVZML.js";import"./chunk-WPNRDEHW.js";import"./chunk-I4GT27UO.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-UUFJQMHE.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-Q3I4ALQ2.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;
|
|
@@ -4410,6 +4458,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4410
4458
|
* Each must run as the inbox agent. Empty: notes are kept but no run
|
|
4411
4459
|
* reads them. */
|
|
4412
4460
|
crons: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4461
|
+
/** Agent whose `agentx wiki absorb` pass reads the inbox (#831). Absorb
|
|
4462
|
+
* is one model call with no tools: it gets the notes in its prompt,
|
|
4463
|
+
* answers each, and absorb applies the patches and records the
|
|
4464
|
+
* outcome. Unset: absorb reads no notes. Must run on this node, the
|
|
4465
|
+
* node that keeps the inbox. */
|
|
4466
|
+
absorbAgent: z.ZodOptional<z.ZodString>;
|
|
4413
4467
|
/** Most notes one run is given. The rest wait for the next run. */
|
|
4414
4468
|
maxNotesPerRun: z.ZodDefault<z.ZodNumber>;
|
|
4415
4469
|
/** A note deferred this many times stops being offered (status
|
|
@@ -4421,10 +4475,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4421
4475
|
maxNotesPerRun: number;
|
|
4422
4476
|
maxDeferrals: number;
|
|
4423
4477
|
inbox?: string | undefined;
|
|
4478
|
+
absorbAgent?: string | undefined;
|
|
4424
4479
|
}, {
|
|
4425
4480
|
enabled?: boolean | undefined;
|
|
4426
4481
|
inbox?: string | undefined;
|
|
4427
4482
|
crons?: string[] | undefined;
|
|
4483
|
+
absorbAgent?: string | undefined;
|
|
4428
4484
|
maxNotesPerRun?: number | undefined;
|
|
4429
4485
|
maxDeferrals?: number | undefined;
|
|
4430
4486
|
}>, {
|
|
@@ -4433,10 +4489,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4433
4489
|
maxNotesPerRun: number;
|
|
4434
4490
|
maxDeferrals: number;
|
|
4435
4491
|
inbox?: string | undefined;
|
|
4492
|
+
absorbAgent?: string | undefined;
|
|
4436
4493
|
}, {
|
|
4437
4494
|
enabled?: boolean | undefined;
|
|
4438
4495
|
inbox?: string | undefined;
|
|
4439
4496
|
crons?: string[] | undefined;
|
|
4497
|
+
absorbAgent?: string | undefined;
|
|
4440
4498
|
maxNotesPerRun?: number | undefined;
|
|
4441
4499
|
maxDeferrals?: number | undefined;
|
|
4442
4500
|
}>>;
|
|
@@ -5546,18 +5604,25 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5546
5604
|
asyncWhenHuman: z.ZodDefault<z.ZodBoolean>;
|
|
5547
5605
|
/** A delegation with no answer after this long is reported as timed out. */
|
|
5548
5606
|
timeoutMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5607
|
+
/** A restart that stops the turn passing a delegation's answer on to
|
|
5608
|
+
* the person (#846): run that turn once more after the next start,
|
|
5609
|
+
* and if it fails again, tell the person and note the open request. */
|
|
5610
|
+
requeueRelayOnRestart: z.ZodDefault<z.ZodBoolean>;
|
|
5549
5611
|
}, "strip", z.ZodTypeAny, {
|
|
5550
5612
|
asyncWhenHuman: boolean;
|
|
5551
5613
|
timeoutMinutes: number;
|
|
5614
|
+
requeueRelayOnRestart: boolean;
|
|
5552
5615
|
}, {
|
|
5553
5616
|
asyncWhenHuman?: boolean | undefined;
|
|
5554
5617
|
timeoutMinutes?: number | undefined;
|
|
5618
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
5555
5619
|
}>>;
|
|
5556
5620
|
}, "strip", z.ZodTypeAny, {
|
|
5557
5621
|
enabled: boolean;
|
|
5558
5622
|
delegation: {
|
|
5559
5623
|
asyncWhenHuman: boolean;
|
|
5560
5624
|
timeoutMinutes: number;
|
|
5625
|
+
requeueRelayOnRestart: boolean;
|
|
5561
5626
|
};
|
|
5562
5627
|
peers: {
|
|
5563
5628
|
name: string;
|
|
@@ -5583,6 +5648,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5583
5648
|
delegation?: {
|
|
5584
5649
|
asyncWhenHuman?: boolean | undefined;
|
|
5585
5650
|
timeoutMinutes?: number | undefined;
|
|
5651
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
5586
5652
|
} | undefined;
|
|
5587
5653
|
peers?: {
|
|
5588
5654
|
name: string;
|
|
@@ -7495,6 +7561,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7495
7561
|
model?: string | undefined;
|
|
7496
7562
|
maxCostUsd?: number | undefined;
|
|
7497
7563
|
};
|
|
7564
|
+
absorb: {
|
|
7565
|
+
enabled: boolean;
|
|
7566
|
+
};
|
|
7498
7567
|
} | undefined;
|
|
7499
7568
|
voice?: {
|
|
7500
7569
|
system?: string | Record<string, string> | undefined;
|
|
@@ -7548,6 +7617,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7548
7617
|
delegation: {
|
|
7549
7618
|
asyncWhenHuman: boolean;
|
|
7550
7619
|
timeoutMinutes: number;
|
|
7620
|
+
requeueRelayOnRestart: boolean;
|
|
7551
7621
|
};
|
|
7552
7622
|
peers: {
|
|
7553
7623
|
name: string;
|
|
@@ -7897,6 +7967,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7897
7967
|
maxNotesPerRun: number;
|
|
7898
7968
|
maxDeferrals: number;
|
|
7899
7969
|
inbox?: string | undefined;
|
|
7970
|
+
absorbAgent?: string | undefined;
|
|
7900
7971
|
};
|
|
7901
7972
|
services: Record<string, {
|
|
7902
7973
|
agent: string;
|
|
@@ -8333,6 +8404,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8333
8404
|
maxPatches?: number | undefined;
|
|
8334
8405
|
maxCostUsd?: number | undefined;
|
|
8335
8406
|
} | undefined;
|
|
8407
|
+
absorb?: {
|
|
8408
|
+
enabled?: boolean | undefined;
|
|
8409
|
+
} | undefined;
|
|
8336
8410
|
} | undefined;
|
|
8337
8411
|
voice?: {
|
|
8338
8412
|
system?: string | Record<string, string> | undefined;
|
|
@@ -8438,6 +8512,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8438
8512
|
delegation?: {
|
|
8439
8513
|
asyncWhenHuman?: boolean | undefined;
|
|
8440
8514
|
timeoutMinutes?: number | undefined;
|
|
8515
|
+
requeueRelayOnRestart?: boolean | undefined;
|
|
8441
8516
|
} | undefined;
|
|
8442
8517
|
peers?: {
|
|
8443
8518
|
name: string;
|
|
@@ -8847,6 +8922,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8847
8922
|
enabled?: boolean | undefined;
|
|
8848
8923
|
inbox?: string | undefined;
|
|
8849
8924
|
crons?: string[] | undefined;
|
|
8925
|
+
absorbAgent?: string | undefined;
|
|
8850
8926
|
maxNotesPerRun?: number | undefined;
|
|
8851
8927
|
maxDeferrals?: number | undefined;
|
|
8852
8928
|
} | undefined;
|
|
@@ -9871,6 +9947,8 @@ declare class AgentXDaemon {
|
|
|
9871
9947
|
private delegations;
|
|
9872
9948
|
/** Synchronous delegations in flight, to refuse cycles that could never finish. */
|
|
9873
9949
|
private syncWaits;
|
|
9950
|
+
/** Recent /send/agent answers, so a retry gets the same task id (#847). */
|
|
9951
|
+
private sendAgentDedupe;
|
|
9874
9952
|
/** Phone-app callback replies waiting for the dashboard to file them. */
|
|
9875
9953
|
private callbackReplies;
|
|
9876
9954
|
private hooks;
|
|
@@ -10720,6 +10798,12 @@ interface AgentTask {
|
|
|
10720
10798
|
/** Called with `runningTaskId` as soon as the run starts. Never fires for
|
|
10721
10799
|
* a message that was queued or dropped instead of run. */
|
|
10722
10800
|
onStart?: (runningTaskId: string) => void;
|
|
10801
|
+
/** Aborted when the HTTP caller waiting on this run has gone (timeout,
|
|
10802
|
+
* disconnect). A run still waiting for a busy agent's slot is then
|
|
10803
|
+
* dropped instead of started: nobody is left to read its answer, and a
|
|
10804
|
+
* retrying caller would otherwise have every attempt run once the slot
|
|
10805
|
+
* frees (#822). A run that already started is not affected. */
|
|
10806
|
+
callerSignal?: AbortSignal;
|
|
10723
10807
|
/** How to re-enter this run if a restart cuts it off (agents/resume).
|
|
10724
10808
|
* Absent: recorded as a direct run with this task's context. */
|
|
10725
10809
|
origin?: RunOrigin;
|
|
@@ -12507,6 +12591,8 @@ interface AgentMemoryOptions {
|
|
|
12507
12591
|
declare class AgentMemory {
|
|
12508
12592
|
readonly baseDir: string;
|
|
12509
12593
|
constructor(opts?: AgentMemoryOptions);
|
|
12594
|
+
/** The agent's note folder, without creating it. */
|
|
12595
|
+
dirOf(agentId: string): string;
|
|
12510
12596
|
private dirFor;
|
|
12511
12597
|
private fileFor;
|
|
12512
12598
|
private indexPath;
|
|
@@ -12877,6 +12963,9 @@ declare class AgentRegistry {
|
|
|
12877
12963
|
* it on the trace. Null means: run locally, the reason is logged and on
|
|
12878
12964
|
* the trace. */
|
|
12879
12965
|
private runCloudSession;
|
|
12966
|
+
/** The answer for a run whose HTTP caller left before it got a slot
|
|
12967
|
+
* (#822). Logged so the dropped request is visible on the node. */
|
|
12968
|
+
private callerGone;
|
|
12880
12969
|
/**
|
|
12881
12970
|
* Execute a task on an agent. Respects maxConcurrent limit.
|
|
12882
12971
|
*
|
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-UBA2QJCY.js";import"./chunk-QXZLYCEZ.js";import"./chunk-GTJIKXDB.js";import"./chunk-5KKXJZZ4.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-Q5FEWCS5.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-242MPMJX.js";import"./chunk-LJWEJ6UZ.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-W2HEJKJR.js";import"./chunk-HF4OXA5L.js";import"./chunk-GLQLCBJS.js";import"./chunk-MEFPXHQJ.js";import{s as ut}from"./chunk-YHCPBMRH.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-J4I5ZJ2V.js";import"./chunk-JE5EJGGD.js";import"./chunk-VWTBHLMX.js";import"./chunk-TJDNS5G6.js";import{a as ht}from"./chunk-NR7WLMNI.js";import"./chunk-3PGPN323.js";import"./chunk-I4OQQRY2.js";import"./chunk-VD7IO653.js";import{f as gt,g as ft}from"./chunk-N2YSVZML.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-WX67I2KN.js";import{j as it,k as rt,l as at}from"./chunk-I4GT27UO.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-UUFJQMHE.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-JE5EJGGD.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-TMAGEDUS.js.map
|