agentix-cli 0.206.0 → 0.207.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.
Files changed (173) hide show
  1. package/dist/{App-JDW5V4HT.js → App-64NXDO3Q.js} +2 -2
  2. package/dist/{ChatApp-SNM2PORO.js → ChatApp-LZSQ4233.js} +2 -2
  3. package/dist/{absorb-eval-WDAV4AI2.js → absorb-eval-XG6QUTN6.js} +2 -2
  4. package/dist/{adapter-C47BTKT6.js → adapter-SDLSX2ZH.js} +2 -2
  5. package/dist/{agent-EVMKJXJO.js → agent-TYURILCF.js} +2 -2
  6. package/dist/{board-dashboard-EUWXJNDW.js → board-dashboard-MLNL4EZ7.js} +46 -31
  7. package/dist/board-dashboard-MLNL4EZ7.js.map +1 -0
  8. package/dist/{chunk-KRHVM26D.js → chunk-2GAMPUOB.js} +2 -2
  9. package/dist/{chunk-PQUK6XEW.js → chunk-2W23ZJCP.js} +2 -2
  10. package/dist/chunk-3AHYZLGE.js +115 -0
  11. package/dist/chunk-3AHYZLGE.js.map +1 -0
  12. package/dist/{chunk-QASIUKZJ.js → chunk-3ALELN73.js} +2 -2
  13. package/dist/{chunk-ERVJLPS4.js → chunk-3FUW6RXU.js} +2 -2
  14. package/dist/{chunk-DOO4MUTS.js → chunk-3MUWPMC2.js} +2 -2
  15. package/dist/{chunk-PQX2VJUA.js → chunk-5YJ5GQCJ.js} +45 -45
  16. package/dist/chunk-5YJ5GQCJ.js.map +1 -0
  17. package/dist/{chunk-5STGF4MI.js → chunk-6TZQZGRI.js} +94 -94
  18. package/dist/chunk-6TZQZGRI.js.map +1 -0
  19. package/dist/{chunk-DV42WUMD.js → chunk-7MRDQLOS.js} +2 -2
  20. package/dist/{chunk-PW3WG6JT.js → chunk-AECUZTRB.js} +2 -2
  21. package/dist/{chunk-JT5PIBCM.js → chunk-B34OLAAC.js} +36 -36
  22. package/dist/chunk-B34OLAAC.js.map +1 -0
  23. package/dist/{chunk-CZVCT5ZV.js → chunk-BBMGXNHU.js} +2 -2
  24. package/dist/{chunk-RXX4MYFL.js → chunk-CRSHJYZQ.js} +2 -2
  25. package/dist/{chunk-2VSK6FAR.js → chunk-DH7Z3HRC.js} +2 -2
  26. package/dist/{chunk-UGRMFQAG.js → chunk-EOQNFLFJ.js} +2 -2
  27. package/dist/{chunk-TH2W2545.js → chunk-GJOKXP5D.js} +2 -2
  28. package/dist/chunk-KEUW6YLL.js +2 -0
  29. package/dist/{chunk-VJ5HC63R.js.map → chunk-KEUW6YLL.js.map} +1 -1
  30. package/dist/{chunk-V5LRR5I5.js → chunk-LTLH2CHG.js} +20 -14
  31. package/dist/chunk-LTLH2CHG.js.map +1 -0
  32. package/dist/chunk-LY4G7PCW.js +2 -0
  33. package/dist/chunk-LY4G7PCW.js.map +1 -0
  34. package/dist/{chunk-EJFPXG6I.js → chunk-NKSQNQ5V.js} +61 -61
  35. package/dist/chunk-NKSQNQ5V.js.map +1 -0
  36. package/dist/{chunk-PTZNM2JU.js → chunk-PSLSU6HC.js} +2 -2
  37. package/dist/{chunk-2P3SHT5I.js → chunk-RHXBLKBW.js} +2 -2
  38. package/dist/{chunk-CXFVIDJV.js → chunk-RWZGW2GQ.js} +2 -2
  39. package/dist/{chunk-IU63JGY3.js → chunk-TYKEHZZA.js} +2 -2
  40. package/dist/{chunk-USFOOYPM.js → chunk-UF3D5LFH.js} +2 -2
  41. package/dist/{chunk-IDGEDPRJ.js → chunk-VIWN3CXS.js} +3 -3
  42. package/dist/chunk-VIWN3CXS.js.map +1 -0
  43. package/dist/{chunk-245IOYDJ.js → chunk-VKEL4XNO.js} +2 -2
  44. package/dist/{chunk-WJMYBRM5.js → chunk-XEMW37IV.js} +2 -2
  45. package/dist/{chunk-MF46BC7J.js → chunk-XGCSWSVD.js} +2 -2
  46. package/dist/{chunk-BED4R5CS.js → chunk-XL7UWG36.js} +6 -6
  47. package/dist/{chunk-BED4R5CS.js.map → chunk-XL7UWG36.js.map} +1 -1
  48. package/dist/{chunk-DUCYRNCT.js → chunk-YLKEUO6K.js} +20 -20
  49. package/dist/chunk-YLKEUO6K.js.map +1 -0
  50. package/dist/{chunk-3B5HSNOF.js → chunk-ZEJ2ZG6K.js} +335 -327
  51. package/dist/chunk-ZEJ2ZG6K.js.map +1 -0
  52. package/dist/{chunk-SKCOIP5R.js → chunk-ZJXJN6GM.js} +3 -3
  53. package/dist/{chunk-OLKYIKAZ.js → chunk-ZT32DUC7.js} +2 -2
  54. package/dist/cli.js +1 -1
  55. package/dist/{client-WN7YI7DE.js → client-HC5UIRHC.js} +2 -2
  56. package/dist/{config-QUXKGIZX.js → config-FUB5TUCM.js} +2 -2
  57. package/dist/config-mutate-5WSQJAJO.js +2 -0
  58. package/dist/{config-mutator-OLLQR3ZD.js → config-mutator-RALUVF77.js} +2 -2
  59. package/dist/{contributions-LL7B4BP3.js → contributions-SSQ2H2H6.js} +2 -2
  60. package/dist/doctor-FAC34AQ6.js +2 -0
  61. package/dist/{facts-ALJBF7IA.js → facts-XGZWX6CR.js} +2 -2
  62. package/dist/{follow-up-tool-I2HTKMP4.js → follow-up-tool-JCJSBAJF.js} +2 -2
  63. package/dist/{grants-2MNWGCSH.js → grants-TWDH3Z4K.js} +2 -2
  64. package/dist/hub-YAEE5GFW.js +2 -0
  65. package/dist/index.d.ts +146 -6
  66. package/dist/index.js +1 -1
  67. package/dist/{org-tool-JCGGJJU6.js → org-tool-YP256FUE.js} +2 -2
  68. package/dist/{program-NCFW4EEP.js → program-3I7GFFDP.js} +86 -86
  69. package/dist/{promote-NSPUPPHB.js → promote-NJWI2KUT.js} +2 -2
  70. package/dist/{query-VW63IHDI.js → query-O5EWN3YT.js} +2 -2
  71. package/dist/{query-settings-RS7DJI4H.js → query-settings-VKOJGJGC.js} +2 -2
  72. package/dist/registry-W77Q7ZGZ.js +2 -0
  73. package/dist/{request-planner-HZWQIRZO.js → request-planner-UY46HBKG.js} +2 -2
  74. package/dist/{review-candidates-2TXOUASP.js → review-candidates-A4BTJYML.js} +2 -2
  75. package/dist/rotation-memo-store-ZH6254YR.js +2 -0
  76. package/dist/rotation-memo-store-ZH6254YR.js.map +1 -0
  77. package/dist/{routing-ZV4VSZDV.js → routing-THT4U4KK.js} +2 -2
  78. package/dist/schedule-tool-FVBUHIDC.js +2 -0
  79. package/dist/{scheduler-SAID6RKQ.js → scheduler-MHTDA3ZS.js} +2 -2
  80. package/dist/{seat-XHBWBSTS.js → seat-NW3JTDGK.js} +2 -2
  81. package/dist/{select-QUCTTAH3.js → select-4DILJ2XW.js} +2 -2
  82. package/dist/{set-enabled-CGMXLFC6.js → set-enabled-DKQTH2PC.js} +2 -2
  83. package/dist/{sprint-tool-SWRYSX3Q.js → sprint-tool-43TSRPK4.js} +2 -2
  84. package/dist/{tool-MMH2JNP7.js → tool-7MI3GK2K.js} +2 -2
  85. package/dist/{tool-ELGOVIM5.js → tool-JYSRWVNB.js} +2 -2
  86. package/dist/{tool-6G63ZQW4.js → tool-NA7ZOWD5.js} +2 -2
  87. package/dist/{tool-DA25L4ND.js → tool-PQZ7NURW.js} +2 -2
  88. package/dist/{wiki-4ZL4QXA7.js → wiki-NR2KS3AT.js} +2 -2
  89. package/dist/wiki-enrich-EB2EOVDJ.js +2 -0
  90. package/dist/workspace-setup-GTSXWYU4.js +2 -0
  91. package/package.json +1 -1
  92. package/dist/board-dashboard-EUWXJNDW.js.map +0 -1
  93. package/dist/chunk-36X7D4JA.js +0 -2
  94. package/dist/chunk-36X7D4JA.js.map +0 -1
  95. package/dist/chunk-3B5HSNOF.js.map +0 -1
  96. package/dist/chunk-5STGF4MI.js.map +0 -1
  97. package/dist/chunk-DUCYRNCT.js.map +0 -1
  98. package/dist/chunk-EJFPXG6I.js.map +0 -1
  99. package/dist/chunk-IDGEDPRJ.js.map +0 -1
  100. package/dist/chunk-IFNXMUEG.js +0 -115
  101. package/dist/chunk-IFNXMUEG.js.map +0 -1
  102. package/dist/chunk-JT5PIBCM.js.map +0 -1
  103. package/dist/chunk-PQX2VJUA.js.map +0 -1
  104. package/dist/chunk-V5LRR5I5.js.map +0 -1
  105. package/dist/chunk-VJ5HC63R.js +0 -2
  106. package/dist/config-mutate-HJH24ITC.js +0 -2
  107. package/dist/doctor-X75KLAFA.js +0 -2
  108. package/dist/hub-7ASBN76I.js +0 -2
  109. package/dist/registry-6KREAROB.js +0 -2
  110. package/dist/rotation-memo-store-WMDI7NND.js +0 -2
  111. package/dist/rotation-memo-store-WMDI7NND.js.map +0 -1
  112. package/dist/schedule-tool-D357NLXS.js +0 -2
  113. package/dist/wiki-enrich-N5MUKDVW.js +0 -2
  114. package/dist/workspace-setup-QXFJRNSK.js +0 -2
  115. /package/dist/{App-JDW5V4HT.js.map → App-64NXDO3Q.js.map} +0 -0
  116. /package/dist/{ChatApp-SNM2PORO.js.map → ChatApp-LZSQ4233.js.map} +0 -0
  117. /package/dist/{absorb-eval-WDAV4AI2.js.map → absorb-eval-XG6QUTN6.js.map} +0 -0
  118. /package/dist/{adapter-C47BTKT6.js.map → adapter-SDLSX2ZH.js.map} +0 -0
  119. /package/dist/{agent-EVMKJXJO.js.map → agent-TYURILCF.js.map} +0 -0
  120. /package/dist/{chunk-KRHVM26D.js.map → chunk-2GAMPUOB.js.map} +0 -0
  121. /package/dist/{chunk-PQUK6XEW.js.map → chunk-2W23ZJCP.js.map} +0 -0
  122. /package/dist/{chunk-QASIUKZJ.js.map → chunk-3ALELN73.js.map} +0 -0
  123. /package/dist/{chunk-ERVJLPS4.js.map → chunk-3FUW6RXU.js.map} +0 -0
  124. /package/dist/{chunk-DOO4MUTS.js.map → chunk-3MUWPMC2.js.map} +0 -0
  125. /package/dist/{chunk-DV42WUMD.js.map → chunk-7MRDQLOS.js.map} +0 -0
  126. /package/dist/{chunk-PW3WG6JT.js.map → chunk-AECUZTRB.js.map} +0 -0
  127. /package/dist/{chunk-CZVCT5ZV.js.map → chunk-BBMGXNHU.js.map} +0 -0
  128. /package/dist/{chunk-RXX4MYFL.js.map → chunk-CRSHJYZQ.js.map} +0 -0
  129. /package/dist/{chunk-2VSK6FAR.js.map → chunk-DH7Z3HRC.js.map} +0 -0
  130. /package/dist/{chunk-UGRMFQAG.js.map → chunk-EOQNFLFJ.js.map} +0 -0
  131. /package/dist/{chunk-TH2W2545.js.map → chunk-GJOKXP5D.js.map} +0 -0
  132. /package/dist/{chunk-PTZNM2JU.js.map → chunk-PSLSU6HC.js.map} +0 -0
  133. /package/dist/{chunk-2P3SHT5I.js.map → chunk-RHXBLKBW.js.map} +0 -0
  134. /package/dist/{chunk-CXFVIDJV.js.map → chunk-RWZGW2GQ.js.map} +0 -0
  135. /package/dist/{chunk-IU63JGY3.js.map → chunk-TYKEHZZA.js.map} +0 -0
  136. /package/dist/{chunk-USFOOYPM.js.map → chunk-UF3D5LFH.js.map} +0 -0
  137. /package/dist/{chunk-245IOYDJ.js.map → chunk-VKEL4XNO.js.map} +0 -0
  138. /package/dist/{chunk-WJMYBRM5.js.map → chunk-XEMW37IV.js.map} +0 -0
  139. /package/dist/{chunk-MF46BC7J.js.map → chunk-XGCSWSVD.js.map} +0 -0
  140. /package/dist/{chunk-SKCOIP5R.js.map → chunk-ZJXJN6GM.js.map} +0 -0
  141. /package/dist/{chunk-OLKYIKAZ.js.map → chunk-ZT32DUC7.js.map} +0 -0
  142. /package/dist/{client-WN7YI7DE.js.map → client-HC5UIRHC.js.map} +0 -0
  143. /package/dist/{config-QUXKGIZX.js.map → config-FUB5TUCM.js.map} +0 -0
  144. /package/dist/{config-mutate-HJH24ITC.js.map → config-mutate-5WSQJAJO.js.map} +0 -0
  145. /package/dist/{config-mutator-OLLQR3ZD.js.map → config-mutator-RALUVF77.js.map} +0 -0
  146. /package/dist/{contributions-LL7B4BP3.js.map → contributions-SSQ2H2H6.js.map} +0 -0
  147. /package/dist/{doctor-X75KLAFA.js.map → doctor-FAC34AQ6.js.map} +0 -0
  148. /package/dist/{facts-ALJBF7IA.js.map → facts-XGZWX6CR.js.map} +0 -0
  149. /package/dist/{follow-up-tool-I2HTKMP4.js.map → follow-up-tool-JCJSBAJF.js.map} +0 -0
  150. /package/dist/{grants-2MNWGCSH.js.map → grants-TWDH3Z4K.js.map} +0 -0
  151. /package/dist/{hub-7ASBN76I.js.map → hub-YAEE5GFW.js.map} +0 -0
  152. /package/dist/{org-tool-JCGGJJU6.js.map → org-tool-YP256FUE.js.map} +0 -0
  153. /package/dist/{program-NCFW4EEP.js.map → program-3I7GFFDP.js.map} +0 -0
  154. /package/dist/{promote-NSPUPPHB.js.map → promote-NJWI2KUT.js.map} +0 -0
  155. /package/dist/{query-VW63IHDI.js.map → query-O5EWN3YT.js.map} +0 -0
  156. /package/dist/{query-settings-RS7DJI4H.js.map → query-settings-VKOJGJGC.js.map} +0 -0
  157. /package/dist/{registry-6KREAROB.js.map → registry-W77Q7ZGZ.js.map} +0 -0
  158. /package/dist/{request-planner-HZWQIRZO.js.map → request-planner-UY46HBKG.js.map} +0 -0
  159. /package/dist/{review-candidates-2TXOUASP.js.map → review-candidates-A4BTJYML.js.map} +0 -0
  160. /package/dist/{routing-ZV4VSZDV.js.map → routing-THT4U4KK.js.map} +0 -0
  161. /package/dist/{schedule-tool-D357NLXS.js.map → schedule-tool-FVBUHIDC.js.map} +0 -0
  162. /package/dist/{scheduler-SAID6RKQ.js.map → scheduler-MHTDA3ZS.js.map} +0 -0
  163. /package/dist/{seat-XHBWBSTS.js.map → seat-NW3JTDGK.js.map} +0 -0
  164. /package/dist/{select-QUCTTAH3.js.map → select-4DILJ2XW.js.map} +0 -0
  165. /package/dist/{set-enabled-CGMXLFC6.js.map → set-enabled-DKQTH2PC.js.map} +0 -0
  166. /package/dist/{sprint-tool-SWRYSX3Q.js.map → sprint-tool-43TSRPK4.js.map} +0 -0
  167. /package/dist/{tool-MMH2JNP7.js.map → tool-7MI3GK2K.js.map} +0 -0
  168. /package/dist/{tool-ELGOVIM5.js.map → tool-JYSRWVNB.js.map} +0 -0
  169. /package/dist/{tool-6G63ZQW4.js.map → tool-NA7ZOWD5.js.map} +0 -0
  170. /package/dist/{tool-DA25L4ND.js.map → tool-PQZ7NURW.js.map} +0 -0
  171. /package/dist/{wiki-4ZL4QXA7.js.map → wiki-NR2KS3AT.js.map} +0 -0
  172. /package/dist/{wiki-enrich-N5MUKDVW.js.map → wiki-enrich-EB2EOVDJ.js.map} +0 -0
  173. /package/dist/{workspace-setup-QXFJRNSK.js.map → workspace-setup-GTSXWYU4.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-7ASBN76I.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-YAEE5GFW.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-DV42WUMD.js.map
4
+ //# sourceMappingURL=chunk-7MRDQLOS.js.map
@@ -1,4 +1,4 @@
1
- import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-MEFPXHQJ.js";import{a as E}from"./chunk-CZVCT5ZV.js";import{b as L}from"./chunk-KEXBEUSU.js";import{createHash as ee}from"crypto";import{existsSync as H,readdirSync as te,readFileSync as re,writeFileSync as ne}from"fs";import{resolve as P}from"path";function be(n,r,s,t,o,i,c="",p="",m=""){return Z(r,s,t,o,i,c,p,m)}function Z(n,r,s,t,o,i="",c="",p=""){let m=r?`
1
+ import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-MEFPXHQJ.js";import{a as E}from"./chunk-BBMGXNHU.js";import{b as L}from"./chunk-KEXBEUSU.js";import{createHash as ee}from"crypto";import{existsSync as H,readdirSync as te,readFileSync as re,writeFileSync as ne}from"fs";import{resolve as P}from"path";function be(n,r,s,t,o,i,c="",p="",m=""){return Z(r,s,t,o,i,c,p,m)}function Z(n,r,s,t,o,i="",c="",p=""){let m=r?`
2
2
  ## Worldview
3
3
 
4
4
  ${r}
@@ -249,4 +249,4 @@ ${u}`}var x="memory-promoter",oe=["project","reference","feedback"],K="_memory-p
249
249
  Re-emit the FULL corrected JSON object \u2014 same structure, fixed issues, valid JSON only.`:n,y=await t(`${a}/task`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:r.viaAgent,message:h,freshSession:s===null,context:{channel:"api",chatId:r.chatId??"memory-promote"}}),signal:i.signal});if(!y.ok){let f=await y.text().catch(()=>"");throw new Error(`agent /task ${y.status}: ${f.slice(0,500)}`)}let w=await y.json();if(w.error)throw new Error(`agent reported error: ${w.error}`);let b=String(w.content??"").trim();if(!b)throw new Error("agent returned empty content");return b}if(!r.model)throw new Error("callPromotionLlm: viaAgent or model is required");let p=process.env.ANTHROPIC_API_KEY;if(!p)throw new Error("ANTHROPIC_API_KEY not set; use --via <agentId> instead");let m=[{role:"user",content:n}];s&&(m.push({role:"assistant",content:"(previous attempt; will retry with corrections)"}),m.push({role:"user",content:`Your previous response failed validation: ${s}
250
250
  Re-emit the FULL corrected JSON object.`}));let u=await t(me,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":p,"anthropic-version":ge},body:JSON.stringify({model:r.model,max_tokens:8e3,messages:m}),signal:i.signal});if(!u.ok){let a=await u.text().catch(()=>"");throw new Error(`anthropic API ${u.status}: ${a.slice(0,500)}`)}let d=await u.json(),e=(Array.isArray(d.content)?d.content:[]).filter(a=>a?.type==="text").map(a=>a.text).join(`
251
251
  `).trim();if(!e)throw new Error("anthropic API returned no text content");return e}finally{clearTimeout(c)}}async function Se(n={}){let r=n.wikiDir??P(process.cwd(),".agentx","wiki"),s=n.memoryRoot??P(process.cwd(),".agentx"),t=n.log??(()=>{}),o=n.now??Date.now(),i={candidates:[],clusters:[],proposed:[],skipped:[],gaps:[],warnings:[],errors:[],dryRun:!n.commit},c=new E(r,(...l)=>t(l.map(String).join(" "))),p=c.rebuildIndex(),m=z(r),u=[...ce(s),...n.extraCandidates??[]];if(i.candidates=de(u,p,m,{types:n.types,sinceMs:n.sinceMs,agentFilter:n.agentFilter,now:o,max:n.max}),i.candidates.length===0)return t("no unpromoted memories in window"),i;if(i.clusters=le(i.candidates),i.dryRun)return i;let d=p.articles.map(l=>({title:l.title,path:l.path,type:l.type})),g=c.getWorldview()??"",e=n.budgetTokens??ue,a=i.clusters,h=D(x,a,d,g);for(;R(h)>e&&a.length>1;)a=a.slice(0,-1),h=D(x,a,d,g);if(R(h)>e)return i.errors.push(`judge prompt (~${R(h)} tokens) exceeds the ${e}-token budget even with one cluster`),i;a.length<i.clusters.length&&i.warnings.push(`token budget: judged ${a.length} of ${i.clusters.length} clusters; the rest wait for the next run`);let y=a.flatMap(l=>l.candidates),w=new Set(y.map(l=>l.stamp)),b=n.chatId??`memory-promote-${new Date(o).toISOString().slice(0,10)}`,f=B(await G(h,{...n,chatId:b}),w);if("error"in f&&(t(`parse failed (${f.error}) \u2014 retrying with feedback`),f=B(await G(h,{...n,chatId:b},f.error),w)),"error"in f)return i.errors.push(`LLM response unusable after retry: ${f.error}`),i;i.warnings.push(...f.warnings),i.gaps=f.gaps;let v=new Date(o).toISOString(),k=[],T=new Map(y.map(l=>[l.stamp,l]));for(let l of f.articles){let A=c.readArticle(l.path);if(A&&!c.canWrite(A.meta,x)){i.errors.push(`write denied for "${l.path}" (owned by ${A.meta.owner??"?"})`);continue}let M=fe(l.promotedFrom,T),S={id:Y(o,l.path),createdAt:v,status:"pending",article:l,evidence:M,...A?{replaces:{lastUpdated:A.meta.lastUpdated,contentHash:V(A.content)}}:{}};I(r,S),i.proposed.push({id:S.id,path:l.path,title:l.title,type:l.type,stamps:l.promotedFrom,agents:M.agents,occurrences:M.occurrences});for(let X of l.promotedFrom)k.push({stamp:X,decision:"proposed",article:l.path,proposal:S.id,at:v})}for(let l of f.skipped)k.push({stamp:l.stamp,decision:"skipped",reason:l.reason,at:v}),i.skipped.push(l);return k.length&&C(r,k),i}var ue=6e4;function R(n){return Math.ceil(n.length/4)}function V(n){return ee("sha256").update(n).digest("hex").slice(0,16)}var he=600;function ye(n){return n.startsWith("review:")?"review":n.startsWith(j)?"failure":"memory"}function fe(n,r){let s=[];for(let t of n){let o=r.get(t);o&&s.push({stamp:t,kind:ye(t),agentId:o.agentId,type:o.memory.type,name:o.memory.name,description:o.memory.description,...o.occurrences?{occurrences:o.occurrences}:{},...o.sessions?.length?{sessions:o.sessions}:{},...o.tasks?.length?{tasks:o.tasks}:{},...o.failure?{failure:o.failure}:{},...o.memory.author?{author:o.memory.author}:{},...o.memory.taskId?{taskId:o.memory.taskId}:{},updatedAt:o.memory.updatedAt,excerpt:o.memory.body.slice(0,he)})}return{agents:[...new Set(s.map(t=>t.agentId))].sort(),occurrences:Math.max(1,...s.map(t=>t.occurrences??1)),sources:s}}function Ee(n,r,s={}){let t=O(n,r);if(!t)return{ok:!1,error:`no proposal "${r}"`};if(t.status!=="pending")return{ok:!1,error:`proposal "${r}" is already ${t.status}`};let o=s.log??(()=>{}),i=new E(n,(...a)=>o(a.map(String).join(" "))),{article:c}=t,p=i.readArticle(c.path);if(!s.force){if(p&&!t.replaces)return{ok:!1,error:`"${c.path}" was created after this proposal; review it, then approve with --force`};if(p&&t.replaces&&V(p.content)!==t.replaces.contentHash)return{ok:!1,error:`"${c.path}" changed since this proposal; review it, then approve with --force`}}let m=s.now??Date.now(),u=new Date(m).toISOString().slice(0,10);if(!i.writeArticle(c.path,{title:c.title,type:L(c.type)?c.type:void 0,related:c.related,tags:c.tags,owner:x,access:"public",created:p?.meta.created??u,lastUpdated:u,sources:ae(p?.meta.sources,c.promotedFrom)},c.content,x))return{ok:!1,error:`write denied for "${c.path}" (owned by ${p?.meta.owner??"?"})`};let g=new Date(m).toISOString();C(n,c.promotedFrom.map(a=>({stamp:a,decision:"promoted",article:c.path,proposal:r,at:g}))),i.rebuildIndex();let e={...t,status:"approved",decidedBy:s.by??"operator",decidedAt:g};return I(n,e),{ok:!0,proposal:e}}function Oe(n,r,s={}){let t=O(n,r);if(!t)return{ok:!1,error:`no proposal "${r}"`};if(t.status!=="pending")return{ok:!1,error:`proposal "${r}" is already ${t.status}`};let o=new Date(s.now??Date.now()).toISOString();C(n,t.article.promotedFrom.map(c=>({stamp:c,decision:"rejected",article:t.article.path,proposal:r,reason:s.reason,at:o})));let i={...t,status:"rejected",decidedBy:s.by??"operator",decidedAt:o,...s.reason?{reason:s.reason}:{}};return I(n,i),{ok:!0,proposal:i}}export{be as a,x as b,oe as c,K as d,q as e,ie as f,$ as g,ae as h,ce as i,z as j,C as k,le as l,B as m,de as n,G as o,Se as p,R as q,ye as r,fe as s,Ee as t,Oe as u};
252
- //# sourceMappingURL=chunk-PW3WG6JT.js.map
252
+ //# sourceMappingURL=chunk-AECUZTRB.js.map