agentix-cli 0.70.0 → 0.70.1

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.
Files changed (120) hide show
  1. package/dist/{App-Z66ABY7H.js → App-LFQTOADB.js} +2 -2
  2. package/dist/{ChatApp-Z2LZ7IM3.js → ChatApp-RNMG2HWX.js} +2 -2
  3. package/dist/{agent-V223TG6H.js → agent-7IW6472I.js} +2 -2
  4. package/dist/{board-dashboard-HR3PQPFW.js → board-dashboard-MYWXVYU3.js} +4 -4
  5. package/dist/{board-dashboard-HR3PQPFW.js.map → board-dashboard-MYWXVYU3.js.map} +1 -1
  6. package/dist/{chunk-FBDIJEKL.js → chunk-2DWDXT7G.js} +9 -9
  7. package/dist/chunk-2DWDXT7G.js.map +1 -0
  8. package/dist/{chunk-P2RYUODK.js → chunk-3ZRFES25.js} +2 -2
  9. package/dist/{chunk-LHLNARRW.js → chunk-4HCQEGXO.js} +167 -167
  10. package/dist/chunk-4HCQEGXO.js.map +1 -0
  11. package/dist/{chunk-ML6CNRBK.js → chunk-4J4YVJFH.js} +2 -2
  12. package/dist/{chunk-ML6CNRBK.js.map → chunk-4J4YVJFH.js.map} +1 -1
  13. package/dist/{chunk-FSYA4GNU.js → chunk-5FD7HE2J.js} +2 -2
  14. package/dist/{chunk-FUR3T3IN.js → chunk-7334DGUO.js} +2 -2
  15. package/dist/{chunk-YBF2QVZ7.js → chunk-7PWXCN22.js} +2 -2
  16. package/dist/{chunk-OVX6NRMD.js → chunk-D3RJMC37.js} +2 -2
  17. package/dist/chunk-DXAWW7ZQ.js +49 -0
  18. package/dist/chunk-DXAWW7ZQ.js.map +1 -0
  19. package/dist/{chunk-3IY2YWXP.js → chunk-E6CYC4HQ.js} +2 -2
  20. package/dist/{chunk-YL223TEU.js → chunk-FEQ4W4XA.js} +2 -2
  21. package/dist/{chunk-6QDOUOKD.js → chunk-KTGPH77J.js} +2 -2
  22. package/dist/{chunk-KLHG5ZQH.js → chunk-KTNOY4LW.js} +2 -2
  23. package/dist/{chunk-SN5N2FPG.js → chunk-LKA5UUGT.js} +2 -2
  24. package/dist/{chunk-YK7GFEGO.js → chunk-MOUSATFW.js} +2 -2
  25. package/dist/{chunk-PHDS2HIN.js → chunk-MTPCD4NV.js} +226 -225
  26. package/dist/chunk-MTPCD4NV.js.map +1 -0
  27. package/dist/{chunk-3RC4LO2G.js → chunk-N4EIYNN4.js} +2 -2
  28. package/dist/{chunk-BBIWAJRX.js → chunk-O2QVQVOV.js} +2 -2
  29. package/dist/{chunk-W7SEPJFH.js → chunk-RKZGENSE.js} +2 -2
  30. package/dist/chunk-RN7G3D53.js +6 -0
  31. package/dist/chunk-RN7G3D53.js.map +1 -0
  32. package/dist/{chunk-TTVVXBCM.js → chunk-WPNRDEHW.js} +2 -2
  33. package/dist/{chunk-DTX4I5LQ.js → chunk-XXBW7CFN.js} +2 -2
  34. package/dist/{chunk-DTX4I5LQ.js.map → chunk-XXBW7CFN.js.map} +1 -1
  35. package/dist/{chunk-OPUPVGYP.js → chunk-YFROK44Z.js} +2 -2
  36. package/dist/cli.js +1 -1
  37. package/dist/cli.js.map +1 -1
  38. package/dist/client-IQIBHXVS.js +2 -0
  39. package/dist/{config-FZ4D4EAV.js → config-7AK5TI2D.js} +2 -2
  40. package/dist/config-mutator-EI5JNMY4.js +2 -0
  41. package/dist/doctor-CTWQODQG.js +2 -0
  42. package/dist/index.d.ts +51 -9
  43. package/dist/index.js +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/migrate-v2-W7RRFM24.js +4 -0
  46. package/dist/{migrate-v2-ZOIMGITH.js.map → migrate-v2-W7RRFM24.js.map} +1 -1
  47. package/dist/program-ZKGWGTPV.js +2 -0
  48. package/dist/promote-USGFU5NN.js +2 -0
  49. package/dist/query-NLSKOIWJ.js +2 -0
  50. package/dist/registry-T7SCVP55.js +2 -0
  51. package/dist/{request-planner-NMOAOZIM.js → request-planner-VOWMXWRI.js} +2 -2
  52. package/dist/{review-candidates-FLY6HZEN.js → review-candidates-F6RLNHS2.js} +2 -2
  53. package/dist/{routing-SMIZ77CT.js → routing-2LAWEIUG.js} +2 -2
  54. package/dist/schedule-tool-GOQFT2XQ.js +2 -0
  55. package/dist/scheduler-GJVRJQ7K.js +2 -0
  56. package/dist/{seat-F3S2HG5G.js → seat-4LLK2XBM.js} +2 -2
  57. package/dist/{select-5GC7CTPQ.js → select-NJHTHKEQ.js} +2 -2
  58. package/dist/{set-enabled-53ZPZ5GR.js → set-enabled-HPR6VJCG.js} +2 -2
  59. package/dist/{tool-FRTZS4TT.js → tool-XQMGKZP5.js} +2 -2
  60. package/dist/wiki-RQ5P4WWJ.js +2 -0
  61. package/package.json +1 -1
  62. package/dist/chunk-FBDIJEKL.js.map +0 -1
  63. package/dist/chunk-LHLNARRW.js.map +0 -1
  64. package/dist/chunk-PHDS2HIN.js.map +0 -1
  65. package/dist/chunk-TFVUOC2C.js +0 -2
  66. package/dist/chunk-TFVUOC2C.js.map +0 -1
  67. package/dist/chunk-TLDQWTSW.js +0 -49
  68. package/dist/chunk-TLDQWTSW.js.map +0 -1
  69. package/dist/chunk-WLMQ5JMX.js +0 -6
  70. package/dist/chunk-WLMQ5JMX.js.map +0 -1
  71. package/dist/client-GDTX6LFH.js +0 -2
  72. package/dist/config-mutator-ETG5V4C5.js +0 -2
  73. package/dist/doctor-JBIRBRLB.js +0 -2
  74. package/dist/graph-FJ53FDWK.js +0 -2
  75. package/dist/migrate-v2-ZOIMGITH.js +0 -4
  76. package/dist/program-UTELWTXC.js +0 -2
  77. package/dist/promote-B5AOKPQR.js +0 -2
  78. package/dist/query-QLJNQUUP.js +0 -2
  79. package/dist/registry-CTZFLXGB.js +0 -2
  80. package/dist/schedule-tool-NJFROYKY.js +0 -2
  81. package/dist/scheduler-5N4FC2FQ.js +0 -2
  82. package/dist/wiki-X76JUHXT.js +0 -2
  83. package/dist/wiki-X76JUHXT.js.map +0 -1
  84. /package/dist/{App-Z66ABY7H.js.map → App-LFQTOADB.js.map} +0 -0
  85. /package/dist/{ChatApp-Z2LZ7IM3.js.map → ChatApp-RNMG2HWX.js.map} +0 -0
  86. /package/dist/{agent-V223TG6H.js.map → agent-7IW6472I.js.map} +0 -0
  87. /package/dist/{chunk-P2RYUODK.js.map → chunk-3ZRFES25.js.map} +0 -0
  88. /package/dist/{chunk-FSYA4GNU.js.map → chunk-5FD7HE2J.js.map} +0 -0
  89. /package/dist/{chunk-FUR3T3IN.js.map → chunk-7334DGUO.js.map} +0 -0
  90. /package/dist/{chunk-YBF2QVZ7.js.map → chunk-7PWXCN22.js.map} +0 -0
  91. /package/dist/{chunk-OVX6NRMD.js.map → chunk-D3RJMC37.js.map} +0 -0
  92. /package/dist/{chunk-3IY2YWXP.js.map → chunk-E6CYC4HQ.js.map} +0 -0
  93. /package/dist/{chunk-YL223TEU.js.map → chunk-FEQ4W4XA.js.map} +0 -0
  94. /package/dist/{chunk-6QDOUOKD.js.map → chunk-KTGPH77J.js.map} +0 -0
  95. /package/dist/{chunk-KLHG5ZQH.js.map → chunk-KTNOY4LW.js.map} +0 -0
  96. /package/dist/{chunk-SN5N2FPG.js.map → chunk-LKA5UUGT.js.map} +0 -0
  97. /package/dist/{chunk-YK7GFEGO.js.map → chunk-MOUSATFW.js.map} +0 -0
  98. /package/dist/{chunk-3RC4LO2G.js.map → chunk-N4EIYNN4.js.map} +0 -0
  99. /package/dist/{chunk-BBIWAJRX.js.map → chunk-O2QVQVOV.js.map} +0 -0
  100. /package/dist/{chunk-W7SEPJFH.js.map → chunk-RKZGENSE.js.map} +0 -0
  101. /package/dist/{chunk-TTVVXBCM.js.map → chunk-WPNRDEHW.js.map} +0 -0
  102. /package/dist/{chunk-OPUPVGYP.js.map → chunk-YFROK44Z.js.map} +0 -0
  103. /package/dist/{client-GDTX6LFH.js.map → client-IQIBHXVS.js.map} +0 -0
  104. /package/dist/{config-FZ4D4EAV.js.map → config-7AK5TI2D.js.map} +0 -0
  105. /package/dist/{config-mutator-ETG5V4C5.js.map → config-mutator-EI5JNMY4.js.map} +0 -0
  106. /package/dist/{doctor-JBIRBRLB.js.map → doctor-CTWQODQG.js.map} +0 -0
  107. /package/dist/{graph-FJ53FDWK.js.map → program-ZKGWGTPV.js.map} +0 -0
  108. /package/dist/{program-UTELWTXC.js.map → promote-USGFU5NN.js.map} +0 -0
  109. /package/dist/{promote-B5AOKPQR.js.map → query-NLSKOIWJ.js.map} +0 -0
  110. /package/dist/{query-QLJNQUUP.js.map → registry-T7SCVP55.js.map} +0 -0
  111. /package/dist/{request-planner-NMOAOZIM.js.map → request-planner-VOWMXWRI.js.map} +0 -0
  112. /package/dist/{review-candidates-FLY6HZEN.js.map → review-candidates-F6RLNHS2.js.map} +0 -0
  113. /package/dist/{registry-CTZFLXGB.js.map → routing-2LAWEIUG.js.map} +0 -0
  114. /package/dist/{routing-SMIZ77CT.js.map → schedule-tool-GOQFT2XQ.js.map} +0 -0
  115. /package/dist/{schedule-tool-NJFROYKY.js.map → scheduler-GJVRJQ7K.js.map} +0 -0
  116. /package/dist/{scheduler-5N4FC2FQ.js.map → seat-4LLK2XBM.js.map} +0 -0
  117. /package/dist/{select-5GC7CTPQ.js.map → select-NJHTHKEQ.js.map} +0 -0
  118. /package/dist/{set-enabled-53ZPZ5GR.js.map → set-enabled-HPR6VJCG.js.map} +0 -0
  119. /package/dist/{tool-FRTZS4TT.js.map → tool-XQMGKZP5.js.map} +0 -0
  120. /package/dist/{seat-F3S2HG5G.js.map → wiki-RQ5P4WWJ.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{b as S,c as O}from"./chunk-YL223TEU.js";import{a as I,b as X}from"./chunk-FCPTN6NF.js";import{a as F,b as oe}from"./chunk-7I7IEX4S.js";import{d as M}from"./chunk-QIJLFPWE.js";import{execFile as Le}from"child_process";import{writeFileSync as ee,mkdirSync as w,existsSync as b,readFileSync as $e}from"fs";import{resolve as _}from"path";var ce=["off","shadow","authoritative"],ae={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"},de="INTENT_LEDGER_MODE";function B(n,e=process.env){let t=P(e[ae[n]]);if(t)return t;let i=P(e[de]);return i||"off"}function P(n){if(typeof n!="string")return null;let e=n.trim().toLowerCase();return ce.includes(e)?e:null}X();import ue from"better-sqlite3";import{existsSync as Pe,mkdirSync as le}from"fs";import{dirname as ge,resolve as me}from"path";var T=class{db;path;constructor(e={}){this.path=me(process.cwd(),e.path??".agentx/intent/ledger.sqlite"),le(ge(this.path),{recursive:!0}),this.db=new ue(this.path),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),fe(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 i=this.findEventBySourceId(e.source,e.sourceEventId);if(i)return i}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)
1
+ import{b as S,c as O}from"./chunk-FEQ4W4XA.js";import{a as I,b as X}from"./chunk-FCPTN6NF.js";import{a as F,b as oe}from"./chunk-7I7IEX4S.js";import{d as M}from"./chunk-QIJLFPWE.js";import{execFile as Le}from"child_process";import{writeFileSync as ee,mkdirSync as w,existsSync as b,readFileSync as $e}from"fs";import{resolve as _}from"path";var ce=["off","shadow","authoritative"],ae={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"},de="INTENT_LEDGER_MODE";function B(n,e=process.env){let t=P(e[ae[n]]);if(t)return t;let i=P(e[de]);return i||"off"}function P(n){if(typeof n!="string")return null;let e=n.trim().toLowerCase();return ce.includes(e)?e:null}X();import ue from"better-sqlite3";import{existsSync as Pe,mkdirSync as le}from"fs";import{dirname as ge,resolve as me}from"path";var T=class{db;path;constructor(e={}){this.path=me(process.cwd(),e.path??".agentx/intent/ledger.sqlite"),le(ge(this.path),{recursive:!0}),this.db=new ue(this.path),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),fe(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 i=this.findEventBySourceId(e.source,e.sourceEventId);if(i)return i}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 i=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 i?U(i):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?U(t):null}recordDecision(e){this.db.prepare(`INSERT INTO intent_decisions (event_id, decided_at, decided_by, agent_id, outcome, reason)
@@ -123,4 +123,4 @@ ${r.prompt}`,r.maxOutputTokens),agentId:r.agent,autonomy:r.autonomy,timeoutMinut
123
123
  `);return t.length<=e?t.join(`
124
124
  `):t.slice(-e).join(`
125
125
  `)}function Ce(n,e,t){return new Promise((i,r)=>{Le("/bin/sh",["-c",n],{timeout:e,maxBuffer:8*1024*1024,...t?{env:t}:{}},(s,c,o)=>{if(s&&s.killed){r(new Error(`command timed out after ${Math.round(e/1e3)}s`));return}i({stdout:String(c??""),stderr:String(o??""),code:s?typeof s.code=="number"?s.code:1:0})})})}export{T as a,G as b,it as c,De as d,rt as e,st as f,$ as g,Q as h,B as i,je as j,V as k,K as l,at as m,Ae as n,ne as o,ie as p,re as q,we as r,C as s};
126
- //# sourceMappingURL=chunk-OPUPVGYP.js.map
126
+ //# sourceMappingURL=chunk-YFROK44Z.js.map
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as n}from"./chunk-LHLNARRW.js";import"./chunk-OVX6NRMD.js";import"./chunk-KLHG5ZQH.js";import"./chunk-6QDOUOKD.js";import"./chunk-Z3IP66SL.js";import"./chunk-C4CDVE2E.js";import"./chunk-RKPAVWXF.js";import"./chunk-SZDACK6O.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-PHDS2HIN.js";import"./chunk-3IY2YWXP.js";import"./chunk-YBF2QVZ7.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-YK7GFEGO.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-FBDIJEKL.js";import"./chunk-W7SEPJFH.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import"./chunk-3RC4LO2G.js";import"./chunk-SFQUP3BP.js";import"./chunk-FSYA4GNU.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-VWTBHLMX.js";import"./chunk-SN5N2FPG.js";import"./chunk-ML6CNRBK.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-TLDQWTSW.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-QOYAX2FT.js";import"./chunk-WLMQ5JMX.js";import"./chunk-TTVVXBCM.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
2
+ import{a as n}from"./chunk-4HCQEGXO.js";import"./chunk-D3RJMC37.js";import"./chunk-KTNOY4LW.js";import"./chunk-KTGPH77J.js";import"./chunk-Z3IP66SL.js";import"./chunk-C4CDVE2E.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-MTPCD4NV.js";import"./chunk-E6CYC4HQ.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-7PWXCN22.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-MOUSATFW.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-2DWDXT7G.js";import"./chunk-RKZGENSE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-N4EIYNN4.js";import"./chunk-SFQUP3BP.js";import"./chunk-5FD7HE2J.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-YFROK44Z.js";import"./chunk-FEQ4W4XA.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-3ZRFES25.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-LKA5UUGT.js";import"./chunk-4J4YVJFH.js";import"./chunk-CECHWYJ2.js";import"./chunk-DXAWW7ZQ.js";import"./chunk-RN7G3D53.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import"./chunk-O2QVQVOV.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-XXBW7CFN.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
3
3
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/signal-exit.ts","../src/cli.ts"],"sourcesContent":["// --- Ctrl-C / SIGTERM for CLI commands ---\n//\n// Short commands should exit at once when stopped. Long-running ones (the\n// daemon above all) install their own handler to finish in-flight work first.\n// The CLI's quick exit used to be registered unconditionally, before the\n// daemon's, and Node runs listeners in registration order — so every stop\n// exited the process before the daemon's drain began and killed in-flight\n// agent tasks mid-turn (#103). Now the quick exit only fires when nobody\n// else handles the signal.\n\ntype SignalTarget = Pick<NodeJS.Process, \"on\" | \"listenerCount\" | \"exit\">\n\nexport const CLI_EXIT_SIGNALS = [\"SIGINT\", \"SIGTERM\"] as const\n\nexport function installCliSignalExit(proc: SignalTarget = process): void {\n for (const sig of CLI_EXIT_SIGNALS) {\n proc.on(sig, () => {\n // This listener is always one of them; anything more means a command\n // is handling the stop itself.\n if (proc.listenerCount(sig) <= 1) proc.exit(0)\n })\n }\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"@/program\"\nimport { installCliSignalExit } from \"@/utils/signal-exit\"\n\ninstallCliSignalExit()\n\nasync function main() {\n const program = await buildProgram()\n\n const args = process.argv.slice(2)\n if (args.length === 0) {\n program.outputHelp()\n return\n }\n\n program.parse()\n}\n\nmain()\n"],"mappings":";o0DAYO,IAAMA,EAAmB,CAAC,SAAU,SAAS,EAE7C,SAASC,EAAqBC,EAAqB,QAAe,CACvE,QAAWC,KAAOH,EAChBE,EAAK,GAAGC,EAAK,IAAM,CAGbD,EAAK,cAAcC,CAAG,GAAK,GAAGD,EAAK,KAAK,CAAC,CAC/C,CAAC,CAEL,CClBAE,EAAqB,EAErB,eAAeC,GAAO,CACpB,IAAMC,EAAU,MAAMC,EAAa,EAGnC,GADa,QAAQ,KAAK,MAAM,CAAC,EACxB,SAAW,EAAG,CACrBD,EAAQ,WAAW,EACnB,OAGFA,EAAQ,MAAM,CAChB,CAEAD,EAAK","names":["CLI_EXIT_SIGNALS","installCliSignalExit","proc","sig","installCliSignalExit","main","program","buildProgram"]}
1
+ {"version":3,"sources":["../src/utils/signal-exit.ts","../src/cli.ts"],"sourcesContent":["// --- Ctrl-C / SIGTERM for CLI commands ---\n//\n// Short commands should exit at once when stopped. Long-running ones (the\n// daemon above all) install their own handler to finish in-flight work first.\n// The CLI's quick exit used to be registered unconditionally, before the\n// daemon's, and Node runs listeners in registration order — so every stop\n// exited the process before the daemon's drain began and killed in-flight\n// agent tasks mid-turn (#103). Now the quick exit only fires when nobody\n// else handles the signal.\n\ntype SignalTarget = Pick<NodeJS.Process, \"on\" | \"listenerCount\" | \"exit\">\n\nexport const CLI_EXIT_SIGNALS = [\"SIGINT\", \"SIGTERM\"] as const\n\nexport function installCliSignalExit(proc: SignalTarget = process): void {\n for (const sig of CLI_EXIT_SIGNALS) {\n proc.on(sig, () => {\n // This listener is always one of them; anything more means a command\n // is handling the stop itself.\n if (proc.listenerCount(sig) <= 1) proc.exit(0)\n })\n }\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"@/program\"\nimport { installCliSignalExit } from \"@/utils/signal-exit\"\n\ninstallCliSignalExit()\n\nasync function main() {\n const program = await buildProgram()\n\n const args = process.argv.slice(2)\n if (args.length === 0) {\n program.outputHelp()\n return\n }\n\n program.parse()\n}\n\nmain()\n"],"mappings":";wyDAYO,IAAMA,EAAmB,CAAC,SAAU,SAAS,EAE7C,SAASC,EAAqBC,EAAqB,QAAe,CACvE,QAAWC,KAAOH,EAChBE,EAAK,GAAGC,EAAK,IAAM,CAGbD,EAAK,cAAcC,CAAG,GAAK,GAAGD,EAAK,KAAK,CAAC,CAC/C,CAAC,CAEL,CClBAE,EAAqB,EAErB,eAAeC,GAAO,CACpB,IAAMC,EAAU,MAAMC,EAAa,EAGnC,GADa,QAAQ,KAAK,MAAM,CAAC,EACxB,SAAW,EAAG,CACrBD,EAAQ,WAAW,EACnB,OAGFA,EAAQ,MAAM,CAChB,CAEAD,EAAK","names":["CLI_EXIT_SIGNALS","installCliSignalExit","proc","sig","installCliSignalExit","main","program","buildProgram"]}
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-D3RJMC37.js";import"./chunk-XXBW7CFN.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-IQIBHXVS.js.map
@@ -1,2 +1,2 @@
1
- import{r as a,s as b,t as c,u as d,v as e,w as f,x as g,z as h}from"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";h();export{a as INTEGRATION_KINDS,c as approvalsConfigSchema,d as daemonConfigSchema,b as eventSubscriptionSchema,e as expandEnvVars,f as loadDaemonConfig,g as validateWorkspaces};
2
- //# sourceMappingURL=config-FZ4D4EAV.js.map
1
+ import{r as a,s as b,t as c,u as d,v as e,w as f,x as g,z as h}from"./chunk-XXBW7CFN.js";import"./chunk-QIJLFPWE.js";h();export{a as INTEGRATION_KINDS,c as approvalsConfigSchema,d as daemonConfigSchema,b as eventSubscriptionSchema,e as expandEnvVars,f as loadDaemonConfig,g as validateWorkspaces};
2
+ //# sourceMappingURL=config-7AK5TI2D.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-FEQ4W4XA.js";import"./chunk-XXBW7CFN.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-EI5JNMY4.js.map
@@ -0,0 +1,2 @@
1
+ import{b as a,c as b,d as c,e as d,f as e}from"./chunk-KTNOY4LW.js";import"./chunk-BYJ3A55Y.js";import"./chunk-XXBW7CFN.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
2
+ //# sourceMappingURL=doctor-CTWQODQG.js.map
package/dist/index.d.ts CHANGED
@@ -4247,6 +4247,17 @@ declare const daemonConfigSchema: z.ZodObject<{
4247
4247
  pollSeconds?: number | undefined;
4248
4248
  lookbackHours?: number | undefined;
4249
4249
  }>>;
4250
+ /** `agentx demo`, read from the agentx.json in the folder it runs from. */
4251
+ demo: z.ZodDefault<z.ZodObject<{
4252
+ /** Seconds each startup step (node /health, dashboard /live, mesh
4253
+ * discovery) may take. Unset: AGENTX_DEMO_STARTUP_TIMEOUT, else 60 s
4254
+ * scaled up by the load average (src/commands/demo-startup.ts). */
4255
+ startupTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
4256
+ }, "strip", z.ZodTypeAny, {
4257
+ startupTimeoutSeconds?: number | undefined;
4258
+ }, {
4259
+ startupTimeoutSeconds?: number | undefined;
4260
+ }>>;
4250
4261
  /** The in-process event bus (src/events). `ringSize` bounds how many
4251
4262
  * recent events GET /events/recent can return. */
4252
4263
  events: z.ZodDefault<z.ZodObject<{
@@ -5887,6 +5898,9 @@ declare const daemonConfigSchema: z.ZodObject<{
5887
5898
  sweepIntervalSeconds?: number | undefined;
5888
5899
  }>>;
5889
5900
  }, "strip", z.ZodTypeAny, {
5901
+ demo: {
5902
+ startupTimeoutSeconds?: number | undefined;
5903
+ };
5890
5904
  agents: Record<string, {
5891
5905
  name: string;
5892
5906
  workspace: string;
@@ -6548,6 +6562,9 @@ declare const daemonConfigSchema: z.ZodObject<{
6548
6562
  bind?: string | undefined;
6549
6563
  defaultAgent?: string | undefined;
6550
6564
  };
6565
+ demo?: {
6566
+ startupTimeoutSeconds?: number | undefined;
6567
+ } | undefined;
6551
6568
  agents?: Record<string, {
6552
6569
  name: string;
6553
6570
  workspace: string;
@@ -7355,6 +7372,12 @@ declare class A2AMesh {
7355
7372
  * channelMeta — i.e., the globex/umbrella confusion incident on
7356
7373
  * 2026-04-29 issue #709. Shape matches AgentTask.context. */
7357
7374
  context?: Record<string, unknown>;
7375
+ /** The message being forwarded, so the receiver can post its answer
7376
+ * back through this node after a restart cut the forward off (#311). */
7377
+ replyVia?: {
7378
+ messageId?: string;
7379
+ accountId?: string;
7380
+ };
7358
7381
  }): Promise<string>;
7359
7382
  /**
7360
7383
  * Streaming variant of `sendTask`. POSTs to the peer's `/task` with
@@ -7433,6 +7456,8 @@ declare class A2AMesh {
7433
7456
  healthy: boolean;
7434
7457
  skills: AgentSkill[];
7435
7458
  channels: string[];
7459
+ /** The node's own name, from its agent card. */
7460
+ node?: string;
7436
7461
  lastCheck?: Date;
7437
7462
  }>;
7438
7463
  }
@@ -8216,7 +8241,21 @@ interface DirectOrigin {
8216
8241
  model?: string;
8217
8242
  autonomy?: string;
8218
8243
  }
8219
- type RunOrigin = RouterOrigin | DirectOrigin;
8244
+ interface MeshOrigin {
8245
+ kind: "mesh";
8246
+ /** Node that received the message and forwarded it; absent from older
8247
+ * senders, in which case any healthy peer hosting the channel is used. */
8248
+ node?: string;
8249
+ channel: string;
8250
+ chatId: string;
8251
+ /** Posts as this agent on the forwarding node, like a live reply. */
8252
+ agentId?: string;
8253
+ /** The incoming message id, so the answer threads like a live reply. */
8254
+ replyTo?: string;
8255
+ accountId?: string;
8256
+ context?: Record<string, unknown>;
8257
+ }
8258
+ type RunOrigin = RouterOrigin | MeshOrigin | DirectOrigin;
8220
8259
 
8221
8260
  interface FriendlyError {
8222
8261
  /** One-line, operator-facing message suitable for a dashboard card or chat reply. */
@@ -10031,14 +10070,6 @@ declare class GraphStore {
10031
10070
  }): Classification | null;
10032
10071
  /** Read the last N classifications, newest first. Cheap enough for the admin UI. */
10033
10072
  readRecentClassifications(limit?: number): Classification[];
10034
- /**
10035
- * The path the most recent classification in a conversation was filed
10036
- * under, or undefined. Used by tools running inside that conversation
10037
- * (`agentx_wiki_query`) to bias retrieval toward articles on the same
10038
- * branch. Bounded by age so a stale label from a day-old thread does not
10039
- * steer an unrelated question.
10040
- */
10041
- latestPathForChat(agentId: string, channel: string, chatId: string, maxAgeMs?: number): string[] | undefined;
10042
10073
  /**
10043
10074
  * Hash that represents "this kind of message" for snap-to-path caching.
10044
10075
  *
@@ -10249,6 +10280,9 @@ interface RunningTask {
10249
10280
  /** The step the run is in right now (classify, compact, agent, …). A run
10250
10281
  * that hangs shows here where it stopped. */
10251
10282
  step?: string;
10283
+ /** Intent-graph path this request was classified under, once known.
10284
+ * Classification runs alongside the turn, so it is absent until then. */
10285
+ intentPath?: string[];
10252
10286
  }
10253
10287
  type TaskOutputSubscriber = (chunk: string) => void;
10254
10288
  /** Persisted record of a finished task, written to .agentx/task-history. */
@@ -10566,6 +10600,14 @@ declare class AgentRegistry {
10566
10600
  } | null;
10567
10601
  /** True while `agentId` has a turn running on this chat. */
10568
10602
  isChatBusy(agentId: string, channel: string, chatId: string): boolean;
10603
+ /**
10604
+ * The intent path of the turn running right now for this conversation,
10605
+ * or undefined while it is not classified yet (or nothing is running).
10606
+ * Tools launched by that turn ask for it through GET /agents/:id/intent-path;
10607
+ * reading the classification log instead would hand them the previous
10608
+ * request's path, since this turn's classification may still be in flight.
10609
+ */
10610
+ runningIntentPath(agentId: string, channel: string, chatId: string): string[] | undefined;
10569
10611
  /**
10570
10612
  * Operator stop. Aborts the in-flight run for `taskId` (kills the
10571
10613
  * underlying claude subprocess via the AbortSignal threaded through
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-C245D4BZ.js";import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-PHDS2HIN.js";import"./chunk-3IY2YWXP.js";import"./chunk-YBF2QVZ7.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-YK7GFEGO.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{S as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-FBDIJEKL.js";import"./chunk-W7SEPJFH.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.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-3RC4LO2G.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-FSYA4GNU.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-VWTBHLMX.js";import"./chunk-SN5N2FPG.js";import{a as ht}from"./chunk-ML6CNRBK.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-TLDQWTSW.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-QOYAX2FT.js";import{a as gt,b as ft}from"./chunk-WLMQ5JMX.js";import"./chunk-TTVVXBCM.js";import{j as it,k as rt,l as at}from"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.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-5MUJZODV.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{u as tt,w as st,x as ot,z as nt}from"./chunk-DTX4I5LQ.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(`
1
+ import{a as L}from"./chunk-C245D4BZ.js";import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-MTPCD4NV.js";import"./chunk-E6CYC4HQ.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-7PWXCN22.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-MOUSATFW.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{S as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-2DWDXT7G.js";import"./chunk-RKZGENSE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.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-N4EIYNN4.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-5FD7HE2J.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-YFROK44Z.js";import"./chunk-FEQ4W4XA.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-3ZRFES25.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-LKA5UUGT.js";import{a as ht}from"./chunk-4J4YVJFH.js";import"./chunk-CECHWYJ2.js";import"./chunk-DXAWW7ZQ.js";import{f as gt,g as ft}from"./chunk-RN7G3D53.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-O2QVQVOV.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.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-5MUJZODV.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{u as tt,w as st,x as ot,z as nt}from"./chunk-XXBW7CFN.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).