agentix-cli 0.209.0 → 0.209.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/{App-BECRIPJ2.js → App-SWJJHYRX.js} +2 -2
  2. package/dist/{ChatApp-WBR7IQMG.js → ChatApp-CPUCPJLP.js} +2 -2
  3. package/dist/absorb-eval-WKLAV4ZX.js +2 -0
  4. package/dist/{adapter-CO4TVLNV.js → adapter-XXUKXA5L.js} +2 -2
  5. package/dist/{agent-ISULBG63.js → agent-3U23E65W.js} +2 -2
  6. package/dist/{board-dashboard-XUY4O2RU.js → board-dashboard-5BPWMIUP.js} +26 -26
  7. package/dist/{chunk-YYXE2HSO.js → chunk-2KLR4RWJ.js} +2 -2
  8. package/dist/{chunk-CT3OYNNI.js → chunk-2OW4DTHI.js} +2 -2
  9. package/dist/{chunk-ECN4ZCMT.js → chunk-3HT5A67F.js} +98 -98
  10. package/dist/chunk-3HT5A67F.js.map +1 -0
  11. package/dist/{chunk-I6FDSWP3.js → chunk-6WU5VEVY.js} +2 -2
  12. package/dist/{chunk-BSDOKMKX.js → chunk-7BCGVPF4.js} +2 -2
  13. package/dist/{chunk-JSCVOB4G.js → chunk-7IW25T4K.js} +2 -2
  14. package/dist/{chunk-I5DAFRWA.js → chunk-7X4BZ5VS.js} +3 -3
  15. package/dist/{chunk-6KSMSSPT.js → chunk-7YEXKWYP.js} +2 -2
  16. package/dist/{chunk-Y24J3MOQ.js → chunk-B3TH5GYM.js} +2 -2
  17. package/dist/{chunk-YBYF223R.js → chunk-BIK7QFDR.js} +2 -2
  18. package/dist/{chunk-DADIYSFN.js → chunk-CWZ4UN7R.js} +2 -2
  19. package/dist/{chunk-QLHEESVA.js → chunk-DAT6RZ5Q.js} +2 -2
  20. package/dist/{chunk-2HBEZV7L.js → chunk-DPG6VHPX.js} +2 -2
  21. package/dist/{chunk-UPNH6RAZ.js → chunk-IGSZ6IZ7.js} +2 -2
  22. package/dist/{chunk-ITUBW7TE.js → chunk-K7JD6Y4L.js} +2 -2
  23. package/dist/{chunk-DXXJL4TT.js → chunk-KSO2DLVR.js} +14 -14
  24. package/dist/chunk-KWWBDLE6.js +13 -0
  25. package/dist/chunk-KWWBDLE6.js.map +1 -0
  26. package/dist/chunk-LIY5CHUV.js +4 -0
  27. package/dist/chunk-LIY5CHUV.js.map +1 -0
  28. package/dist/{chunk-IYTCKPZI.js → chunk-LW6UWMN6.js} +2 -2
  29. package/dist/{chunk-XBON7H4I.js → chunk-MOA6SIUK.js} +2 -2
  30. package/dist/{chunk-7EEWOBIM.js → chunk-NBIOOD7J.js} +2 -2
  31. package/dist/{chunk-CPOTYJWY.js → chunk-ORBWUTVG.js} +2 -2
  32. package/dist/{chunk-ZWJ2SUM5.js → chunk-QZ5HG3G5.js} +2 -2
  33. package/dist/{chunk-TXGUBSM3.js → chunk-RAZKIONL.js} +2 -2
  34. package/dist/{chunk-WNBGBOBJ.js → chunk-RPRJT4EH.js} +2 -2
  35. package/dist/{chunk-HLKQGEIA.js → chunk-S6HKRVBX.js} +2 -2
  36. package/dist/{chunk-NBEWP5UP.js → chunk-SJMVSADX.js} +2 -2
  37. package/dist/{chunk-AI4JHUOZ.js → chunk-VIC4Q4HD.js} +2 -2
  38. package/dist/{chunk-SWZC5ZT3.js → chunk-VYZ4X65I.js} +2 -2
  39. package/dist/{chunk-2LJZHKTY.js → chunk-WMZ4TGMR.js} +2 -2
  40. package/dist/{chunk-43I75G74.js → chunk-XMPJV6WS.js} +2 -2
  41. package/dist/{chunk-Y3YQ3IOG.js → chunk-XWXQGOZR.js} +2 -2
  42. package/dist/{chunk-5A2GI4NQ.js → chunk-Y2GFVSLP.js} +250 -250
  43. package/dist/chunk-Y2GFVSLP.js.map +1 -0
  44. package/dist/{chunk-U6CU5MIQ.js → chunk-YFN5DE56.js} +3 -3
  45. package/dist/chunk-YFN5DE56.js.map +1 -0
  46. package/dist/cli.js +1 -1
  47. package/dist/client-NG226UN4.js +2 -0
  48. package/dist/{compaction-ZE2WYXHQ.js → compaction-COUQNMWL.js} +2 -2
  49. package/dist/{config-6BK3H63H.js → config-BFWKCNWV.js} +2 -2
  50. package/dist/config-mutate-Z3WK32EO.js +2 -0
  51. package/dist/config-mutator-TZRAR5GG.js +2 -0
  52. package/dist/{connect-OOPPXAOD.js → connect-AJKMRKXC.js} +2 -2
  53. package/dist/{contributions-VA2JWVXU.js → contributions-4HEMQ3JO.js} +2 -2
  54. package/dist/{daemon-api-QCBFGT7S.js → daemon-api-FGX3JS46.js} +2 -2
  55. package/dist/decision-approvals-NJS2ARAF.js +2 -0
  56. package/dist/doctor-RBPFWIQJ.js +2 -0
  57. package/dist/fact-proposals-Z7HJG7QJ.js +1 -1
  58. package/dist/{follow-up-tool-42BUNUGF.js → follow-up-tool-M6NPAVCR.js} +2 -2
  59. package/dist/hub-RNAZKK6J.js +2 -0
  60. package/dist/index.d.ts +33 -0
  61. package/dist/index.js +1 -1
  62. package/dist/index.js.map +1 -1
  63. package/dist/ledger-5GMBLR7W.js +1 -1
  64. package/dist/memory-extract-WTCX77UH.js +2 -0
  65. package/dist/{org-tool-TXWIFVG6.js → org-tool-WKGZVVTS.js} +2 -2
  66. package/dist/owner-decisions-D3MBTX4D.js +2 -0
  67. package/dist/{program-435UQJ3G.js → program-OBQZUXYI.js} +266 -264
  68. package/dist/{program-435UQJ3G.js.map → program-OBQZUXYI.js.map} +1 -1
  69. package/dist/{promote-D6CRK7QJ.js → promote-DMPFCAC3.js} +2 -2
  70. package/dist/push-bridge-T5HZZRA2.js +1 -1
  71. package/dist/query-KL7IAGDI.js +2 -0
  72. package/dist/{query-settings-N7BMIFMM.js → query-settings-ASNC2APT.js} +3 -3
  73. package/dist/registry-YOZ2J3I5.js +2 -0
  74. package/dist/{request-planner-UD23KDKU.js → request-planner-4GT4JGV2.js} +2 -2
  75. package/dist/resolve-AYTQGEP2.js +2 -0
  76. package/dist/{review-candidates-LKY3BRHH.js → review-candidates-FHXSOGXE.js} +2 -2
  77. package/dist/{rotation-memo-store-ZH6254YR.js → rotation-memo-store-DO3W5LXB.js} +2 -2
  78. package/dist/routing-73DPZ65Q.js +2 -0
  79. package/dist/schedule-tool-XTEBWOCZ.js +2 -0
  80. package/dist/scheduler-C7OK3NCA.js +2 -0
  81. package/dist/{seat-VFUCGC5H.js → seat-SMBKX2K7.js} +2 -2
  82. package/dist/{select-TF6NCI5P.js → select-NPU6TCWK.js} +2 -2
  83. package/dist/{set-enabled-XBXHGNAF.js → set-enabled-CB5HS7PG.js} +2 -2
  84. package/dist/{sprint-tool-6YBEN7NP.js → sprint-tool-J2354376.js} +2 -2
  85. package/dist/status-FK4ESDJS.js +2 -0
  86. package/dist/{tool-UK4I6GTF.js → tool-LW5PURCD.js} +2 -2
  87. package/dist/{tool-Q5AMUIPF.js → tool-NXBLFMPT.js} +2 -2
  88. package/dist/{tool-UM3EQGMA.js → tool-OAEBT36R.js} +2 -2
  89. package/dist/{tool-YX2TYZB7.js → tool-TVKMQB3M.js} +2 -2
  90. package/dist/wiki-XJZI4D7Z.js +2 -0
  91. package/dist/wiki-XJZI4D7Z.js.map +1 -0
  92. package/dist/wiki-enrich-M7C5UVI7.js +2 -0
  93. package/dist/wiki-enrich-M7C5UVI7.js.map +1 -0
  94. package/package.json +1 -1
  95. package/dist/absorb-eval-RJWKCNR5.js +0 -2
  96. package/dist/chunk-5A2GI4NQ.js.map +0 -1
  97. package/dist/chunk-ECN4ZCMT.js.map +0 -1
  98. package/dist/chunk-U6CU5MIQ.js.map +0 -1
  99. package/dist/client-LU6JWHHR.js +0 -2
  100. package/dist/config-mutate-6ZMNQOLS.js +0 -2
  101. package/dist/config-mutator-RS4ORSMF.js +0 -2
  102. package/dist/doctor-A47S3SH6.js +0 -2
  103. package/dist/hub-ZC6J5Y2Q.js +0 -2
  104. package/dist/memory-extract-QYSXPK22.js +0 -2
  105. package/dist/query-KI7HTDKX.js +0 -2
  106. package/dist/registry-NDJ4W62V.js +0 -2
  107. package/dist/resolve-LOYZUE2D.js +0 -2
  108. package/dist/routing-UAIHQHP2.js +0 -2
  109. package/dist/schedule-tool-B573TNKM.js +0 -2
  110. package/dist/scheduler-ORNTT5P6.js +0 -2
  111. package/dist/status-PVYFTNX2.js +0 -2
  112. package/dist/wiki-XN5G2V4I.js +0 -2
  113. package/dist/wiki-enrich-P2DHIVLD.js +0 -2
  114. /package/dist/{App-BECRIPJ2.js.map → App-SWJJHYRX.js.map} +0 -0
  115. /package/dist/{ChatApp-WBR7IQMG.js.map → ChatApp-CPUCPJLP.js.map} +0 -0
  116. /package/dist/{absorb-eval-RJWKCNR5.js.map → absorb-eval-WKLAV4ZX.js.map} +0 -0
  117. /package/dist/{adapter-CO4TVLNV.js.map → adapter-XXUKXA5L.js.map} +0 -0
  118. /package/dist/{agent-ISULBG63.js.map → agent-3U23E65W.js.map} +0 -0
  119. /package/dist/{board-dashboard-XUY4O2RU.js.map → board-dashboard-5BPWMIUP.js.map} +0 -0
  120. /package/dist/{chunk-YYXE2HSO.js.map → chunk-2KLR4RWJ.js.map} +0 -0
  121. /package/dist/{chunk-CT3OYNNI.js.map → chunk-2OW4DTHI.js.map} +0 -0
  122. /package/dist/{chunk-I6FDSWP3.js.map → chunk-6WU5VEVY.js.map} +0 -0
  123. /package/dist/{chunk-BSDOKMKX.js.map → chunk-7BCGVPF4.js.map} +0 -0
  124. /package/dist/{chunk-JSCVOB4G.js.map → chunk-7IW25T4K.js.map} +0 -0
  125. /package/dist/{chunk-I5DAFRWA.js.map → chunk-7X4BZ5VS.js.map} +0 -0
  126. /package/dist/{chunk-6KSMSSPT.js.map → chunk-7YEXKWYP.js.map} +0 -0
  127. /package/dist/{chunk-Y24J3MOQ.js.map → chunk-B3TH5GYM.js.map} +0 -0
  128. /package/dist/{chunk-YBYF223R.js.map → chunk-BIK7QFDR.js.map} +0 -0
  129. /package/dist/{chunk-DADIYSFN.js.map → chunk-CWZ4UN7R.js.map} +0 -0
  130. /package/dist/{chunk-QLHEESVA.js.map → chunk-DAT6RZ5Q.js.map} +0 -0
  131. /package/dist/{chunk-2HBEZV7L.js.map → chunk-DPG6VHPX.js.map} +0 -0
  132. /package/dist/{chunk-UPNH6RAZ.js.map → chunk-IGSZ6IZ7.js.map} +0 -0
  133. /package/dist/{chunk-ITUBW7TE.js.map → chunk-K7JD6Y4L.js.map} +0 -0
  134. /package/dist/{chunk-DXXJL4TT.js.map → chunk-KSO2DLVR.js.map} +0 -0
  135. /package/dist/{chunk-IYTCKPZI.js.map → chunk-LW6UWMN6.js.map} +0 -0
  136. /package/dist/{chunk-XBON7H4I.js.map → chunk-MOA6SIUK.js.map} +0 -0
  137. /package/dist/{chunk-7EEWOBIM.js.map → chunk-NBIOOD7J.js.map} +0 -0
  138. /package/dist/{chunk-CPOTYJWY.js.map → chunk-ORBWUTVG.js.map} +0 -0
  139. /package/dist/{chunk-ZWJ2SUM5.js.map → chunk-QZ5HG3G5.js.map} +0 -0
  140. /package/dist/{chunk-TXGUBSM3.js.map → chunk-RAZKIONL.js.map} +0 -0
  141. /package/dist/{chunk-WNBGBOBJ.js.map → chunk-RPRJT4EH.js.map} +0 -0
  142. /package/dist/{chunk-HLKQGEIA.js.map → chunk-S6HKRVBX.js.map} +0 -0
  143. /package/dist/{chunk-NBEWP5UP.js.map → chunk-SJMVSADX.js.map} +0 -0
  144. /package/dist/{chunk-AI4JHUOZ.js.map → chunk-VIC4Q4HD.js.map} +0 -0
  145. /package/dist/{chunk-SWZC5ZT3.js.map → chunk-VYZ4X65I.js.map} +0 -0
  146. /package/dist/{chunk-2LJZHKTY.js.map → chunk-WMZ4TGMR.js.map} +0 -0
  147. /package/dist/{chunk-43I75G74.js.map → chunk-XMPJV6WS.js.map} +0 -0
  148. /package/dist/{chunk-Y3YQ3IOG.js.map → chunk-XWXQGOZR.js.map} +0 -0
  149. /package/dist/{client-LU6JWHHR.js.map → client-NG226UN4.js.map} +0 -0
  150. /package/dist/{compaction-ZE2WYXHQ.js.map → compaction-COUQNMWL.js.map} +0 -0
  151. /package/dist/{config-6BK3H63H.js.map → config-BFWKCNWV.js.map} +0 -0
  152. /package/dist/{config-mutate-6ZMNQOLS.js.map → config-mutate-Z3WK32EO.js.map} +0 -0
  153. /package/dist/{config-mutator-RS4ORSMF.js.map → config-mutator-TZRAR5GG.js.map} +0 -0
  154. /package/dist/{connect-OOPPXAOD.js.map → connect-AJKMRKXC.js.map} +0 -0
  155. /package/dist/{contributions-VA2JWVXU.js.map → contributions-4HEMQ3JO.js.map} +0 -0
  156. /package/dist/{daemon-api-QCBFGT7S.js.map → daemon-api-FGX3JS46.js.map} +0 -0
  157. /package/dist/{doctor-A47S3SH6.js.map → decision-approvals-NJS2ARAF.js.map} +0 -0
  158. /package/dist/{hub-ZC6J5Y2Q.js.map → doctor-RBPFWIQJ.js.map} +0 -0
  159. /package/dist/{follow-up-tool-42BUNUGF.js.map → follow-up-tool-M6NPAVCR.js.map} +0 -0
  160. /package/dist/{memory-extract-QYSXPK22.js.map → hub-RNAZKK6J.js.map} +0 -0
  161. /package/dist/{promote-D6CRK7QJ.js.map → memory-extract-WTCX77UH.js.map} +0 -0
  162. /package/dist/{org-tool-TXWIFVG6.js.map → org-tool-WKGZVVTS.js.map} +0 -0
  163. /package/dist/{query-KI7HTDKX.js.map → owner-decisions-D3MBTX4D.js.map} +0 -0
  164. /package/dist/{registry-NDJ4W62V.js.map → promote-DMPFCAC3.js.map} +0 -0
  165. /package/dist/{resolve-LOYZUE2D.js.map → query-KL7IAGDI.js.map} +0 -0
  166. /package/dist/{query-settings-N7BMIFMM.js.map → query-settings-ASNC2APT.js.map} +0 -0
  167. /package/dist/{routing-UAIHQHP2.js.map → registry-YOZ2J3I5.js.map} +0 -0
  168. /package/dist/{request-planner-UD23KDKU.js.map → request-planner-4GT4JGV2.js.map} +0 -0
  169. /package/dist/{schedule-tool-B573TNKM.js.map → resolve-AYTQGEP2.js.map} +0 -0
  170. /package/dist/{review-candidates-LKY3BRHH.js.map → review-candidates-FHXSOGXE.js.map} +0 -0
  171. /package/dist/{rotation-memo-store-ZH6254YR.js.map → rotation-memo-store-DO3W5LXB.js.map} +0 -0
  172. /package/dist/{scheduler-ORNTT5P6.js.map → routing-73DPZ65Q.js.map} +0 -0
  173. /package/dist/{seat-VFUCGC5H.js.map → schedule-tool-XTEBWOCZ.js.map} +0 -0
  174. /package/dist/{status-PVYFTNX2.js.map → scheduler-C7OK3NCA.js.map} +0 -0
  175. /package/dist/{wiki-XN5G2V4I.js.map → seat-SMBKX2K7.js.map} +0 -0
  176. /package/dist/{select-TF6NCI5P.js.map → select-NPU6TCWK.js.map} +0 -0
  177. /package/dist/{set-enabled-XBXHGNAF.js.map → set-enabled-CB5HS7PG.js.map} +0 -0
  178. /package/dist/{sprint-tool-6YBEN7NP.js.map → sprint-tool-J2354376.js.map} +0 -0
  179. /package/dist/{wiki-enrich-P2DHIVLD.js.map → status-FK4ESDJS.js.map} +0 -0
  180. /package/dist/{tool-UK4I6GTF.js.map → tool-LW5PURCD.js.map} +0 -0
  181. /package/dist/{tool-Q5AMUIPF.js.map → tool-NXBLFMPT.js.map} +0 -0
  182. /package/dist/{tool-UM3EQGMA.js.map → tool-OAEBT36R.js.map} +0 -0
  183. /package/dist/{tool-YX2TYZB7.js.map → tool-TVKMQB3M.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import t from"chalk";import{spawn as S}from"child_process";import{resolve as j}from"path";var E=l=>l||j(process.cwd(),".agentx/wiki");function N(l){return async d=>{let{claudeCliEnv:e}=await import("./workspace-env-UOK5MMKD.js"),h=["-p","-","--output-format","json","--max-turns","1","--model",l,"--tools","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}',"--settings",'{"disableAllHooks":true}',"--setting-sources","","--no-session-persistence"],y=await new Promise(($,a)=>{let s=S("claude",h,{env:e(),stdio:["pipe","pipe","pipe"]}),p="",g="",i=setTimeout(()=>s.kill("SIGTERM"),24e4);s.stdout.on("data",r=>{p+=r}),s.stderr.on("data",r=>{g+=r}),s.on("error",r=>{clearTimeout(i),a(r)}),s.on("close",r=>{clearTimeout(i),r===0?$(p):a(new Error(`claude exited ${r}: ${g.trim().slice(0,200)}`))}),s.stdin.end(d)}),c=JSON.parse(y);if(c.is_error)throw new Error(`model error: ${String(c.result).slice(0,200)}`);return{text:String(c.result??""),costUsd:Number(c.total_cost_usd)||0}}}function I(l){l.command("enrich [entities...]").description("write a full overview, sourced typed facts and linked history on entity pages (person, organization, project, place, assets)").option("--dir <path>","wiki directory (default .agentx/wiki)").option("--types <list>","comma-separated entity types","person,organization,project,place,device,server,app,domain,account").option("--max <n>","most entities per run","10").option("--max-cost <usd>","stop before the next call once the run spent this much","1").option("--model <m>","model","sonnet").option("--force","redo entities whose sources did not change").option("--dry-run","show what would be written, write nothing").option("--create <title>","first create a page for a thing other pages only name, then enrich it (needs --as and --owner)").option("--as <type>","type of the page --create makes, e.g. organization").option("--owner <agent>","agent whose wiki gets the page --create makes").option("--json","print the run as JSON").action(async(d,e)=>{let{WikiHub:h}=await import("./hub-ZC6J5Y2Q.js"),{GraphCache:y}=await import("./graph-ZVKV3JBD.js"),{loadOntology:c}=await import("./load-Q3HCFXDT.js"),{loadRoster:$}=await import("./roster-BZGKG2ZA.js"),{ENRICH_TYPES:a,loadEnrichState:s,runEnrich:p,saveEnrichState:g}=await import("./enrich-MZMIQ3SV.js"),i=E(e.dir),r=e.types.split(",").map(o=>o.trim()).filter(Boolean),b=r.filter(o=>!a.includes(o));if(b.length){console.error(t.red(` not an entity type this job handles: ${b.join(", ")} (use ${a.join(", ")})`)),process.exitCode=1;return}let x=Number(e.max);if(!Number.isInteger(x)||x<1){console.error(t.red(" --max must be a whole number of entities, 1 or more")),process.exitCode=1;return}let w=Number(e.maxCost);if(!Number.isFinite(w)||w<=0){console.error(t.red(" --max-cost must be a positive number of dollars")),process.exitCode=1;return}let m=new h(i,()=>{});if(e.create){let{createEntityPage:o}=await import("./enrich-MZMIQ3SV.js");if(!e.as||!a.includes(e.as)||!e.owner){console.error(t.red(` --create needs --as <${a.join("|")}> and --owner <agent>`)),process.exitCode=1;return}if(m.syncedFrom(e.owner)){console.error(t.red(` ${e.owner}'s pages are copied from another node; pick an agent that runs here`)),process.exitCode=1;return}if(e.dryRun)console.log(t.dim(` --dry-run: would create "${e.create}" (${e.as}) in ${e.owner}'s wiki`));else{let f=o(m,e.create,e.as,e.owner,new Date().toISOString().slice(0,10));console.log(f?t.green(` created ${e.owner}/${f}`):t.dim(` ${e.owner} already has a page titled "${e.create}"`))}d=[...d,e.create],r.includes(e.as)||r.push(e.as)}let{ontology:v}=c(i),k=new y().get(m,v,$(i,m.listAgents([]),v.agent_names)),C=s(i),u=await p(m,k,N(e.model),{types:r,only:d,max:x,maxCostUsd:w,dryRun:!!e.dryRun,force:!!e.force,today:new Date().toISOString().slice(0,10),save:o=>g(i,o)},C);if(e.json){console.log(JSON.stringify(u,null,2));return}for(let o of u.outcomes){let f=o.status==="written"?t.green("\u2713"):o.status==="dry-run"?t.cyan("~"):t.yellow("\xB7");console.log(` ${f} ${o.title} ${t.dim(`${o.status} \xB7 ${o.page??"no page"} \xB7 overview ${o.overview?"yes":"no"} \xB7 ${o.statements} facts \xB7 ${o.links} links \xB7 $${o.costUsd.toFixed(3)}`)}`);for(let n of o.facts??[])console.log(t.dim(` fact: ${n.property} \u2192 ${n.value}${n.role?` (${n.role})`:""} \xB7 source ${n.source}`));for(let n of o.dropped.slice(0,6))console.log(t.dim(` dropped: ${n}`));o.preview&&console.log(t.dim(o.preview.split(`
1
+ import t from"chalk";import{spawn as S}from"child_process";import{resolve as j}from"path";var E=l=>l||j(process.cwd(),".agentx/wiki");function N(l){return async d=>{let{claudeCliEnv:e}=await import("./workspace-env-UOK5MMKD.js"),h=["-p","-","--output-format","json","--max-turns","1","--model",l,"--tools","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}',"--settings",'{"disableAllHooks":true}',"--setting-sources","","--no-session-persistence"],y=await new Promise(($,a)=>{let s=S("claude",h,{env:e(),stdio:["pipe","pipe","pipe"]}),p="",g="",i=setTimeout(()=>s.kill("SIGTERM"),24e4);s.stdout.on("data",r=>{p+=r}),s.stderr.on("data",r=>{g+=r}),s.on("error",r=>{clearTimeout(i),a(r)}),s.on("close",r=>{clearTimeout(i),r===0?$(p):a(new Error(`claude exited ${r}: ${g.trim().slice(0,200)}`))}),s.stdin.end(d)}),c=JSON.parse(y);if(c.is_error)throw new Error(`model error: ${String(c.result).slice(0,200)}`);return{text:String(c.result??""),costUsd:Number(c.total_cost_usd)||0}}}function I(l){l.command("enrich [entities...]").description("write a full overview, sourced typed facts and linked history on entity pages (person, organization, project, place, assets)").option("--dir <path>","wiki directory (default .agentx/wiki)").option("--types <list>","comma-separated entity types","person,organization,project,place,device,server,app,domain,account").option("--max <n>","most entities per run","10").option("--max-cost <usd>","stop before the next call once the run spent this much","1").option("--model <m>","model","sonnet").option("--force","redo entities whose sources did not change").option("--dry-run","show what would be written, write nothing").option("--create <title>","first create a page for a thing other pages only name, then enrich it (needs --as and --owner)").option("--as <type>","type of the page --create makes, e.g. organization").option("--owner <agent>","agent whose wiki gets the page --create makes").option("--json","print the run as JSON").action(async(d,e)=>{let{WikiHub:h}=await import("./hub-RNAZKK6J.js"),{GraphCache:y}=await import("./graph-ZVKV3JBD.js"),{loadOntology:c}=await import("./load-Q3HCFXDT.js"),{loadRoster:$}=await import("./roster-BZGKG2ZA.js"),{ENRICH_TYPES:a,loadEnrichState:s,runEnrich:p,saveEnrichState:g}=await import("./enrich-MZMIQ3SV.js"),i=E(e.dir),r=e.types.split(",").map(o=>o.trim()).filter(Boolean),b=r.filter(o=>!a.includes(o));if(b.length){console.error(t.red(` not an entity type this job handles: ${b.join(", ")} (use ${a.join(", ")})`)),process.exitCode=1;return}let x=Number(e.max);if(!Number.isInteger(x)||x<1){console.error(t.red(" --max must be a whole number of entities, 1 or more")),process.exitCode=1;return}let w=Number(e.maxCost);if(!Number.isFinite(w)||w<=0){console.error(t.red(" --max-cost must be a positive number of dollars")),process.exitCode=1;return}let m=new h(i,()=>{});if(e.create){let{createEntityPage:o}=await import("./enrich-MZMIQ3SV.js");if(!e.as||!a.includes(e.as)||!e.owner){console.error(t.red(` --create needs --as <${a.join("|")}> and --owner <agent>`)),process.exitCode=1;return}if(m.syncedFrom(e.owner)){console.error(t.red(` ${e.owner}'s pages are copied from another node; pick an agent that runs here`)),process.exitCode=1;return}if(e.dryRun)console.log(t.dim(` --dry-run: would create "${e.create}" (${e.as}) in ${e.owner}'s wiki`));else{let f=o(m,e.create,e.as,e.owner,new Date().toISOString().slice(0,10));console.log(f?t.green(` created ${e.owner}/${f}`):t.dim(` ${e.owner} already has a page titled "${e.create}"`))}d=[...d,e.create],r.includes(e.as)||r.push(e.as)}let{ontology:v}=c(i),k=new y().get(m,v,$(i,m.listAgents([]),v.agent_names)),C=s(i),u=await p(m,k,N(e.model),{types:r,only:d,max:x,maxCostUsd:w,dryRun:!!e.dryRun,force:!!e.force,today:new Date().toISOString().slice(0,10),save:o=>g(i,o)},C);if(e.json){console.log(JSON.stringify(u,null,2));return}for(let o of u.outcomes){let f=o.status==="written"?t.green("\u2713"):o.status==="dry-run"?t.cyan("~"):t.yellow("\xB7");console.log(` ${f} ${o.title} ${t.dim(`${o.status} \xB7 ${o.page??"no page"} \xB7 overview ${o.overview?"yes":"no"} \xB7 ${o.statements} facts \xB7 ${o.links} links \xB7 $${o.costUsd.toFixed(3)}`)}`);for(let n of o.facts??[])console.log(t.dim(` fact: ${n.property} \u2192 ${n.value}${n.role?` (${n.role})`:""} \xB7 source ${n.source}`));for(let n of o.dropped.slice(0,6))console.log(t.dim(` dropped: ${n}`));o.preview&&console.log(t.dim(o.preview.split(`
2
2
  `).slice(0,12).map(n=>` | ${n}`).join(`
3
3
  `)))}u.outcomes.length===0&&console.log(t.dim(" nothing to do: no entity of these types changed since the last run (--force redoes them)")),console.log(t.dim(` spent $${u.costUsd.toFixed(3)} of $${w}${u.capped?" \xB7 stopped at the cap":""}`))})}export{N as a,I as b};
4
- //# sourceMappingURL=chunk-YYXE2HSO.js.map
4
+ //# sourceMappingURL=chunk-2KLR4RWJ.js.map
@@ -1,5 +1,5 @@
1
- import{Ib as m,Sb as b}from"./chunk-U6CU5MIQ.js";b();function w(t){let e=typeof t.node=="string"?t.node:"",n=typeof t.token=="string"?t.token:"";if(!e||!n)try{let o=m(t.config);e||(e=o.dashboard?.daemonUrl||""),n||(n=o.dashboard?.token||"")}catch{}return e||(e="http://localhost:18800"),{baseUrl:e.replace(/\/+$/,""),token:n}}async function d(t,e,n){let o={Accept:"application/json"};t.token&&(o.Authorization=`Bearer ${t.token}`);let r=await fetch(`${t.baseUrl}${e}`,{headers:o,signal:n});if(!r.ok)throw new Error(`GET ${e} \u2192 HTTP ${r.status}`);return await r.json()}function R(t,e){return d(t,"/agents",e)}async function S(t,e){return(await d(t,"/api/processes",e)).processes??[]}function P(t,e){return d(t,"/crons",e)}async function h(t,e,n,o){let r={Accept:"application/json","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:o}),a=await s.text(),i;try{i=a?JSON.parse(a):{}}catch{i={raw:a}}if(!s.ok)throw new Error(i?.error||`POST ${e} \u2192 HTTP ${s.status}`);return i}function A(t,e,n="tui"){return h(t,"/api/processes/kill",{...e,reason:n})}function C(t,e,n,o){return h(t,"/task",{agent:e,message:n,context:o??{channel:"tui",chatId:"tui:operator"}})}async function $(t,e,n,o={}){let r={Accept:"text/event-stream","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}/task`,{method:"POST",headers:r,body:JSON.stringify({agent:e,message:n,stream:!0,context:{channel:o.channel??"chat-cli",chatId:o.chatId??"chat-cli:operator"}}),signal:o.signal});if(!s.ok||!s.body){let g=await s.text().catch(()=>"");throw new Error(`POST /task (stream) \u2192 HTTP ${s.status}${g?`: ${g.slice(0,200)}`:""}`)}let a=s.body.getReader(),i=new TextDecoder,u={content:""},c="";try{for(;;){let{done:g,value:p}=await a.read();if(g)break;c+=i.decode(p,{stream:!0});let l;for(;(l=c.indexOf(`
1
+ import{Ib as m,Sb as b}from"./chunk-YFN5DE56.js";b();function w(t){let e=typeof t.node=="string"?t.node:"",n=typeof t.token=="string"?t.token:"";if(!e||!n)try{let o=m(t.config);e||(e=o.dashboard?.daemonUrl||""),n||(n=o.dashboard?.token||"")}catch{}return e||(e="http://localhost:18800"),{baseUrl:e.replace(/\/+$/,""),token:n}}async function d(t,e,n){let o={Accept:"application/json"};t.token&&(o.Authorization=`Bearer ${t.token}`);let r=await fetch(`${t.baseUrl}${e}`,{headers:o,signal:n});if(!r.ok)throw new Error(`GET ${e} \u2192 HTTP ${r.status}`);return await r.json()}function R(t,e){return d(t,"/agents",e)}async function S(t,e){return(await d(t,"/api/processes",e)).processes??[]}function P(t,e){return d(t,"/crons",e)}async function h(t,e,n,o){let r={Accept:"application/json","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:o}),a=await s.text(),i;try{i=a?JSON.parse(a):{}}catch{i={raw:a}}if(!s.ok)throw new Error(i?.error||`POST ${e} \u2192 HTTP ${s.status}`);return i}function A(t,e,n="tui"){return h(t,"/api/processes/kill",{...e,reason:n})}function C(t,e,n,o){return h(t,"/task",{agent:e,message:n,context:o??{channel:"tui",chatId:"tui:operator"}})}async function $(t,e,n,o={}){let r={Accept:"text/event-stream","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}/task`,{method:"POST",headers:r,body:JSON.stringify({agent:e,message:n,stream:!0,context:{channel:o.channel??"chat-cli",chatId:o.chatId??"chat-cli:operator"}}),signal:o.signal});if(!s.ok||!s.body){let g=await s.text().catch(()=>"");throw new Error(`POST /task (stream) \u2192 HTTP ${s.status}${g?`: ${g.slice(0,200)}`:""}`)}let a=s.body.getReader(),i=new TextDecoder,u={content:""},c="";try{for(;;){let{done:g,value:p}=await a.read();if(g)break;c+=i.decode(p,{stream:!0});let l;for(;(l=c.indexOf(`
2
2
 
3
3
  `))>=0;){let k=c.slice(0,l);c=c.slice(l+2);let f=x(k);f&&T(f,o,u)}}}finally{try{a.releaseLock()}catch{}}return u}function T(t,e,n){let{event:o,data:r}=t;switch(o){case"text":r?.text&&(n.content+=r.text,e.onText?.(r.text));break;case"thinking":r?.text&&e.onThinking?.(r.text);break;case"tool":e.onTool?.(r);break;case"done":typeof r?.content=="string"&&(n.content=r.content),n.usage=r?.usage,n.duration=r?.duration;break;case"error":n.error=r?.error,n.errorKind=r?.errorKind;break}}function x(t){let e="message",n="";for(let r of t.split(`
4
4
  `))r.startsWith("event: ")?e=r.slice(7).trim():r.startsWith("data: ")&&(n=r.slice(6));if(!n)return null;let o;try{o=JSON.parse(n)}catch{o=n}return{event:e,data:o}}export{w as a,R as b,S as c,P as d,A as e,C as f,$ as g};
5
- //# sourceMappingURL=chunk-CT3OYNNI.js.map
5
+ //# sourceMappingURL=chunk-2OW4DTHI.js.map