agentix-cli 0.165.1 → 0.166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{App-NV2JJMHN.js → App-UOZT7MWS.js} +2 -2
- package/dist/{ChatApp-CIGDPS3A.js → ChatApp-N7REHHH3.js} +2 -2
- package/dist/{absorb-eval-VPAASHZG.js → absorb-eval-MT3ZDYBM.js} +2 -2
- package/dist/{agent-UFMIPTQZ.js → agent-SUAQ7EBM.js} +2 -2
- package/dist/{board-dashboard-NUEVGTM7.js → board-dashboard-4C77NLY5.js} +399 -305
- package/dist/board-dashboard-4C77NLY5.js.map +1 -0
- package/dist/{chunk-GJ4SQRAE.js → chunk-33KKV3YU.js} +2 -2
- package/dist/{chunk-A3GDFLFB.js → chunk-64POGFQZ.js} +2 -2
- package/dist/{chunk-V7R5AJVN.js → chunk-7FH2FEFA.js} +2 -2
- package/dist/{chunk-NCEYJFF5.js → chunk-7O43PB6O.js} +2 -2
- package/dist/{chunk-PSTEWKR3.js → chunk-7UIK4S6T.js} +2 -2
- package/dist/{chunk-EXJGRK2N.js → chunk-A2D3PNDA.js} +2 -2
- package/dist/{chunk-ILHTAVZZ.js → chunk-AE3U4GR6.js} +85 -85
- package/dist/chunk-AE3U4GR6.js.map +1 -0
- package/dist/{chunk-4SJ2VFVI.js → chunk-AFLZHY5Y.js} +2 -2
- package/dist/{chunk-CDPQQAK6.js → chunk-APPTSTL5.js} +2 -2
- package/dist/chunk-B6GVATMI.js +92 -0
- package/dist/chunk-B6GVATMI.js.map +1 -0
- package/dist/{chunk-KVSHZKAL.js → chunk-B7QHC7N4.js} +2 -2
- package/dist/chunk-BE64IJWM.js +11 -0
- package/dist/chunk-BE64IJWM.js.map +1 -0
- package/dist/{chunk-T5IGXFSW.js → chunk-BQXKTQCX.js} +2 -2
- package/dist/{chunk-AYK2MO3B.js → chunk-CTN4KYE6.js} +2 -2
- package/dist/{chunk-CRUNUMVO.js → chunk-G3T73GGF.js} +2 -2
- package/dist/{chunk-BC7VOHNH.js → chunk-IJZNM5PS.js} +2 -2
- package/dist/{chunk-S6ZZKRDB.js → chunk-JMZNI257.js} +2 -2
- package/dist/{chunk-CGE5EAWC.js → chunk-L7RPH3T7.js} +2 -2
- package/dist/{chunk-DAWJHJKD.js → chunk-LM3K7U6H.js} +2 -2
- package/dist/{chunk-ON7Y3JSP.js → chunk-LQTTLXZY.js} +3 -3
- package/dist/{chunk-Y6JSB5II.js → chunk-NHWYEIET.js} +2 -2
- package/dist/{chunk-QT63Q6C5.js → chunk-QGKNDGH5.js} +2 -2
- package/dist/{chunk-FK2TJZNJ.js → chunk-QLJ3OMPL.js} +2 -2
- package/dist/{chunk-73SESASJ.js → chunk-SXKC2LH7.js} +2 -2
- package/dist/{chunk-VL74KOR7.js → chunk-VJVXEVZ7.js} +18 -9
- package/dist/{chunk-VL74KOR7.js.map → chunk-VJVXEVZ7.js.map} +1 -1
- package/dist/{chunk-KTJ6234K.js → chunk-XJYGMCAV.js} +241 -241
- package/dist/chunk-XJYGMCAV.js.map +1 -0
- package/dist/{chunk-YUGYKMY6.js → chunk-XML72AUF.js} +2 -2
- package/dist/chunk-XQ2EFLQW.js +41 -0
- package/dist/chunk-XQ2EFLQW.js.map +1 -0
- package/dist/{chunk-6Y53LLIX.js → chunk-YKHK47G5.js} +2 -2
- package/dist/{chunk-RUB4HZEG.js → chunk-YQ25AGX6.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-D3CYQPUD.js → client-6ZHYSQU6.js} +2 -2
- package/dist/{config-OTO56OCX.js → config-WCEFYQL4.js} +2 -2
- package/dist/{config-mutate-5KKGQHC6.js → config-mutate-LW366SKL.js} +2 -2
- package/dist/config-mutator-NRHZ2XH3.js +2 -0
- package/dist/{contributions-SMSYSHPU.js → contributions-MUCJKT73.js} +2 -2
- package/dist/{doctor-5PFLKGNU.js → doctor-2N2MX5YP.js} +2 -2
- package/dist/{failure-candidates-HNENLQJC.js → failure-candidates-WGSFI7GR.js} +2 -2
- package/dist/{follow-up-tool-ME4DV7HT.js → follow-up-tool-W64LMQQN.js} +2 -2
- package/dist/{hub-WGUNZ2D5.js → hub-4ODFNGHL.js} +2 -2
- package/dist/index.d.ts +85 -38
- package/dist/index.js +1 -1
- package/dist/{program-GBPLSXFF.js → program-6YMRDLHO.js} +24 -24
- package/dist/{promote-TQ3OZ7EC.js → promote-OUSVJZ64.js} +2 -2
- package/dist/{query-M4VWXBHF.js → query-QVK5EN3P.js} +2 -2
- package/dist/{query-settings-Y4PWFLYK.js → query-settings-2TNLXEL5.js} +2 -2
- package/dist/{registry-GLNCV3KP.js → registry-BYIWNEFL.js} +2 -2
- package/dist/{request-planner-FE3C2QFQ.js → request-planner-7HEHLPA3.js} +2 -2
- package/dist/{review-candidates-R7QKVGMQ.js → review-candidates-NJNMSOCX.js} +2 -2
- package/dist/{routing-6J4OHUJS.js → routing-HCSXNUOY.js} +2 -2
- package/dist/schedule-tool-LJYBLCLV.js +2 -0
- package/dist/{scheduler-XDLJAWGC.js → scheduler-74MXJLQS.js} +2 -2
- package/dist/{seat-35AZG54F.js → seat-CAYDECW2.js} +2 -2
- package/dist/{select-6PC26YUI.js → select-QUVE6RN2.js} +2 -2
- package/dist/{set-enabled-UJOLDPZV.js → set-enabled-BWJN4IVG.js} +2 -2
- package/dist/token-tracker-XTHSSPLB.js +2 -0
- package/dist/tool-FZ4UXMON.js +8 -0
- package/dist/tool-FZ4UXMON.js.map +1 -0
- package/dist/{tool-QLIJQQ7W.js → tool-UC7OZWIB.js} +2 -2
- package/dist/traces-O4TIZ4SM.js +2 -0
- package/dist/{wiki-W7L5EJTZ.js → wiki-KNSPJT2O.js} +2 -2
- package/dist/wiki-enrich-RVRTAQQF.js +2 -0
- package/dist/{workflow-pilot-25NMZYUO.js → workflow-pilot-MKG6CJ6V.js} +2 -2
- package/package.json +1 -1
- package/dist/board-dashboard-NUEVGTM7.js.map +0 -1
- package/dist/chunk-AXDNFXYU.js +0 -41
- package/dist/chunk-AXDNFXYU.js.map +0 -1
- package/dist/chunk-ILHTAVZZ.js.map +0 -1
- package/dist/chunk-IVTO54EM.js +0 -90
- package/dist/chunk-IVTO54EM.js.map +0 -1
- package/dist/chunk-KTJ6234K.js.map +0 -1
- package/dist/chunk-XIRM45DH.js +0 -11
- package/dist/chunk-XIRM45DH.js.map +0 -1
- package/dist/config-mutator-XBUGJZER.js +0 -2
- package/dist/schedule-tool-FE3TWOGS.js +0 -2
- package/dist/token-tracker-B2UFOH46.js +0 -2
- package/dist/tool-LAMDUPTX.js +0 -6
- package/dist/tool-LAMDUPTX.js.map +0 -1
- package/dist/traces-G4HRLRA3.js +0 -2
- package/dist/wiki-enrich-3ZCL5TEC.js +0 -2
- /package/dist/{App-NV2JJMHN.js.map → App-UOZT7MWS.js.map} +0 -0
- /package/dist/{ChatApp-CIGDPS3A.js.map → ChatApp-N7REHHH3.js.map} +0 -0
- /package/dist/{absorb-eval-VPAASHZG.js.map → absorb-eval-MT3ZDYBM.js.map} +0 -0
- /package/dist/{agent-UFMIPTQZ.js.map → agent-SUAQ7EBM.js.map} +0 -0
- /package/dist/{chunk-GJ4SQRAE.js.map → chunk-33KKV3YU.js.map} +0 -0
- /package/dist/{chunk-A3GDFLFB.js.map → chunk-64POGFQZ.js.map} +0 -0
- /package/dist/{chunk-V7R5AJVN.js.map → chunk-7FH2FEFA.js.map} +0 -0
- /package/dist/{chunk-NCEYJFF5.js.map → chunk-7O43PB6O.js.map} +0 -0
- /package/dist/{chunk-PSTEWKR3.js.map → chunk-7UIK4S6T.js.map} +0 -0
- /package/dist/{chunk-EXJGRK2N.js.map → chunk-A2D3PNDA.js.map} +0 -0
- /package/dist/{chunk-4SJ2VFVI.js.map → chunk-AFLZHY5Y.js.map} +0 -0
- /package/dist/{chunk-CDPQQAK6.js.map → chunk-APPTSTL5.js.map} +0 -0
- /package/dist/{chunk-KVSHZKAL.js.map → chunk-B7QHC7N4.js.map} +0 -0
- /package/dist/{chunk-T5IGXFSW.js.map → chunk-BQXKTQCX.js.map} +0 -0
- /package/dist/{chunk-AYK2MO3B.js.map → chunk-CTN4KYE6.js.map} +0 -0
- /package/dist/{chunk-CRUNUMVO.js.map → chunk-G3T73GGF.js.map} +0 -0
- /package/dist/{chunk-BC7VOHNH.js.map → chunk-IJZNM5PS.js.map} +0 -0
- /package/dist/{chunk-S6ZZKRDB.js.map → chunk-JMZNI257.js.map} +0 -0
- /package/dist/{chunk-CGE5EAWC.js.map → chunk-L7RPH3T7.js.map} +0 -0
- /package/dist/{chunk-DAWJHJKD.js.map → chunk-LM3K7U6H.js.map} +0 -0
- /package/dist/{chunk-ON7Y3JSP.js.map → chunk-LQTTLXZY.js.map} +0 -0
- /package/dist/{chunk-Y6JSB5II.js.map → chunk-NHWYEIET.js.map} +0 -0
- /package/dist/{chunk-QT63Q6C5.js.map → chunk-QGKNDGH5.js.map} +0 -0
- /package/dist/{chunk-FK2TJZNJ.js.map → chunk-QLJ3OMPL.js.map} +0 -0
- /package/dist/{chunk-73SESASJ.js.map → chunk-SXKC2LH7.js.map} +0 -0
- /package/dist/{chunk-YUGYKMY6.js.map → chunk-XML72AUF.js.map} +0 -0
- /package/dist/{chunk-6Y53LLIX.js.map → chunk-YKHK47G5.js.map} +0 -0
- /package/dist/{chunk-RUB4HZEG.js.map → chunk-YQ25AGX6.js.map} +0 -0
- /package/dist/{client-D3CYQPUD.js.map → client-6ZHYSQU6.js.map} +0 -0
- /package/dist/{config-OTO56OCX.js.map → config-WCEFYQL4.js.map} +0 -0
- /package/dist/{config-mutate-5KKGQHC6.js.map → config-mutate-LW366SKL.js.map} +0 -0
- /package/dist/{config-mutator-XBUGJZER.js.map → config-mutator-NRHZ2XH3.js.map} +0 -0
- /package/dist/{contributions-SMSYSHPU.js.map → contributions-MUCJKT73.js.map} +0 -0
- /package/dist/{doctor-5PFLKGNU.js.map → doctor-2N2MX5YP.js.map} +0 -0
- /package/dist/{failure-candidates-HNENLQJC.js.map → failure-candidates-WGSFI7GR.js.map} +0 -0
- /package/dist/{follow-up-tool-ME4DV7HT.js.map → follow-up-tool-W64LMQQN.js.map} +0 -0
- /package/dist/{hub-WGUNZ2D5.js.map → hub-4ODFNGHL.js.map} +0 -0
- /package/dist/{program-GBPLSXFF.js.map → program-6YMRDLHO.js.map} +0 -0
- /package/dist/{promote-TQ3OZ7EC.js.map → promote-OUSVJZ64.js.map} +0 -0
- /package/dist/{query-M4VWXBHF.js.map → query-QVK5EN3P.js.map} +0 -0
- /package/dist/{query-settings-Y4PWFLYK.js.map → query-settings-2TNLXEL5.js.map} +0 -0
- /package/dist/{registry-GLNCV3KP.js.map → registry-BYIWNEFL.js.map} +0 -0
- /package/dist/{request-planner-FE3C2QFQ.js.map → request-planner-7HEHLPA3.js.map} +0 -0
- /package/dist/{review-candidates-R7QKVGMQ.js.map → review-candidates-NJNMSOCX.js.map} +0 -0
- /package/dist/{routing-6J4OHUJS.js.map → routing-HCSXNUOY.js.map} +0 -0
- /package/dist/{schedule-tool-FE3TWOGS.js.map → schedule-tool-LJYBLCLV.js.map} +0 -0
- /package/dist/{scheduler-XDLJAWGC.js.map → scheduler-74MXJLQS.js.map} +0 -0
- /package/dist/{seat-35AZG54F.js.map → seat-CAYDECW2.js.map} +0 -0
- /package/dist/{select-6PC26YUI.js.map → select-QUVE6RN2.js.map} +0 -0
- /package/dist/{set-enabled-UJOLDPZV.js.map → set-enabled-BWJN4IVG.js.map} +0 -0
- /package/dist/{token-tracker-B2UFOH46.js.map → token-tracker-XTHSSPLB.js.map} +0 -0
- /package/dist/{tool-QLIJQQ7W.js.map → tool-UC7OZWIB.js.map} +0 -0
- /package/dist/{traces-G4HRLRA3.js.map → traces-O4TIZ4SM.js.map} +0 -0
- /package/dist/{wiki-W7L5EJTZ.js.map → wiki-KNSPJT2O.js.map} +0 -0
- /package/dist/{wiki-enrich-3ZCL5TEC.js.map → wiki-enrich-RVRTAQQF.js.map} +0 -0
- /package/dist/{workflow-pilot-25NMZYUO.js.map → workflow-pilot-MKG6CJ6V.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as g}from"./chunk-
|
|
1
|
+
import{e as g}from"./chunk-LQTTLXZY.js";async function $(e,i,r,n,o={}){let a=o.retrieve??g,c=o.perEntry??2,s=o.maxArticles??8,f=o.queryChars??1500,h=new Map;for(let t of e){let l=[];try{l=await a(t.content.slice(0,f),i,r,{pool:n,maxCandidates:c,maxHops:1,maxArticles:c*2,stage:"absorb-covering"})}catch{}for(let u of l){let p=h.get(u.path);p?(p.hop=Math.min(p.hop,u.hop),p.entries.includes(t.id)||p.entries.push(t.id)):h.set(u.path,{...u,entries:[t.id]})}}return[...h.values()].sort((t,l)=>t.hop-l.hop||l.entries.length-t.entries.length||t.path.localeCompare(l.path)).slice(0,s)}function x(e){if(e.length===0)return"";let i=e.map(r=>{let n=`### ${r.meta.title} \u2014 ${r.meta.type||"untyped"} (${r.path})`,o=`Found for entries: ${r.entries.join(", ")}${r.hop>0?" (linked from a match)":""}`,a=r.meta.related?.length?`Related: ${r.meta.related.join(", ")}`:"";return[n,o,a,"",r.content].filter(c=>c!=="").join(`
|
|
2
2
|
`)}).join(`
|
|
3
3
|
|
|
4
4
|
---
|
|
@@ -14,4 +14,4 @@ These ${e.length} articles were found by searching the wiki for each entry below
|
|
|
14
14
|
|
|
15
15
|
${i}
|
|
16
16
|
`}var d=/\bhttps?:\/\/[^\s<>"'`)\]]+/gi,y=/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/g,w=/(?<![\w-])(?=[0-9a-f]*[0-9])(?=[0-9a-f]*[a-f])[0-9a-f]{7,40}(?![\w-])/gi,k=/(?<![\w.,:/-])\d+(?:[.,:\-/]\d+)*(?![\w])/g,C=/^\s*\d+[.)]\s/gm;function A(e){let i=[...e.matchAll(d)].map(s=>s[0].replace(/[.,;:!?'"]+$/,"")),r=[...e.matchAll(y)].map(s=>s[1].trim()),n=e.replace(d," ").replace(y," ").replace(C," "),o=[...n.matchAll(w)].map(s=>s[0].toLowerCase()),c=[...n.replace(w," ").matchAll(k)].map(s=>v(s[0]));return{commits:m(o),urls:m(i),wikilinks:m(r),numbers:m(c)}}function R(e,i){let r=A(e),n=A(i),o=i.toLowerCase(),a=[];for(let t of r.commits)!o.includes(t)&&!n.commits.some(l=>l.startsWith(t)||t.startsWith(l))&&a.push(`commit ${t}`);let c=t=>t.toLowerCase().replace(/\/+$/,""),s=new Set(n.urls.map(c));for(let t of r.urls)s.has(c(t))||a.push(`link ${t}`);let f=new Set(n.wikilinks.map(t=>t.toLowerCase()));for(let t of r.wikilinks)f.has(t.toLowerCase())||a.push(`link [[${t}]]`);let h=new Set(n.numbers);for(let t of r.numbers)h.has(t)||a.push(`number ${t}`);return a}function v(e){return/^\d{1,3}(,\d{3})+$/.test(e)?e.replace(/,/g,""):e}function m(e){return[...new Set(e)]}function L(e,i){if(i.some(n=>n.path===e.path))return e.path;let r=b(e.title);return r?i.find(n=>b(n.title)===r)?.path??e.path:e.path}function b(e){return(e||"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}export{$ as a,x as b,A as c,R as d,L as e};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-33KKV3YU.js.map
|
|
@@ -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-
|
|
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-4ODFNGHL.js"),{GraphCache:y}=await import("./graph-ZVKV3JBD.js"),{loadOntology:c}=await import("./load-LQ2I2PQI.js"),{loadRoster:$}=await import("./roster-BZGKG2ZA.js"),{ENRICH_TYPES:a,loadEnrichState:s,runEnrich:p,saveEnrichState:g}=await import("./enrich-FPK3OW77.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-FPK3OW77.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-
|
|
4
|
+
//# sourceMappingURL=chunk-64POGFQZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y as l,z as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{y as l,z as T}from"./chunk-QGKNDGH5.js";import{a,f as w}from"./chunk-72SZI2UW.js";T();w();var d="task-tier";function u(e){return{task:b(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:a("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function b(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2;function p(e){return e==="voice"||e==="desktop"||e==="opencode"}var f=60*60*1e3;function M(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function v(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let s=e.sessionIdleMs??0,r=e.cacheTtlMs??f;if(s<r)return n(`follow-up on a warm cache (idle ${Math.round(s/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"},timeoutMs:1500})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let o=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${o<(e.threshold??h)?"downgrade":"keep"} (${o.toFixed(2)})`,o);let i=e.threshold??h;return o>=i?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${i}) \u2192 ${e.cheapModel}`}}var A=["labeled","unlabeled","closed"];function y(e){let n=r=>({downgraded:!1,needsFlagship:null,reason:r});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);let t=e.eventActions??[];if(!t.length)return n("not started by a platform event");let o=e.triage?.actions??A,i=t.find(r=>!o.includes(r));if(i)return n(`"${i}" is not a triage action`);let s=M(e.tier,{cheapModels:e.triage?.models});if(!s)return n(`no triage model set for ${e.tier}`);if(e.isFollowUp){let r=e.sessionIdleMs??0,m=e.cacheTtlMs??f;if(r<m)return n(`follow-up on a warm cache (idle ${Math.round(r/1e3)}s) \u2014 keeping the session's model`)}return{model:s,downgraded:!0,needsFlagship:null,reason:`triage event (${t.join(", ")}) \u2192 ${s}`}}export{h as a,p as b,M as c,v as d,A as e,y as f};
|
|
2
|
+
//# sourceMappingURL=chunk-7FH2FEFA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-XML72AUF.js";import{resolve as n}from"path";import{existsSync as c,readdirSync as u,mkdirSync as l,readFileSync as p,writeFileSync as f,renameSync as S}from"fs";var m=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(e=n(process.cwd(),".agentx/wiki"),r=console.error.bind(console,"[wiki-hub]"),t="graph"){this.baseDir=e,this.agentsDir=n(e,"agents"),this.mode=t,this.log=r,l(this.agentsDir,{recursive:!0}),this.sharedStore=new h(e,r)}getMode(){return this.mode}getAgentWiki(e){let r=`${e}:${this.mode}`;if(this.agentStores.has(r))return this.agentStores.get(r);let t=n(this.agentsDir,e,this.mode),s=new h(t,this.log);return this.agentStores.set(r,s),s}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}sharedScope(e){return[...this.listAgentDirs().filter(t=>t!==e).map(t=>({id:t,store:this.getAgentWiki(t)})),{id:"shared",store:this.sharedStore,skip:t=>t.startsWith("agents/")}]}listAgentDirs(){return c(this.agentsDir)?u(this.agentsDir).filter(e=>!e.startsWith("_")&&!e.startsWith(".")&&c(n(this.agentsDir,e,this.mode))).sort():[]}listAgents(e=this.sharedStore.listEntries()){let r=new Set;for(let t of e)r.add(t.agentId);if(c(this.agentsDir))for(let t of u(this.agentsDir))!t.startsWith("_")&&!t.startsWith(".")&&r.add(t);return[...r].sort()}getAgentEntries(e){return this.sharedStore.listEntries({agentId:e})}getUnabsorbedEntries(e){return this.classifyEntries(e).pending}markProcessed(e,r,t){let s=new Set(t),g=this.readLedger(e),d=new Date().toISOString();for(let i of r)g.entries[i]={at:d,cited:s.has(i)};let o=this.ledgerPath(e);l(n(o,".."),{recursive:!0});let a=`${o}.tmp`;f(a,`${JSON.stringify(g,null,2)}
|
|
2
2
|
`),S(a,o)}summary(){let e=this.sharedStore.listEntries(),r=new Map;for(let t of e){let s=r.get(t.agentId);s?s.push(t):r.set(t.agentId,[t])}return this.listAgents(e).map(t=>{let{all:s,cited:g,read:d,pending:o,articles:a}=this.classifyEntries(t,r.get(t)??[]);return{agentId:t,totalEntries:s.length,totalArticles:a.length,cited:g.length,readNotCited:d.length,unabsorbed:o.length,articles:a}})}classifyEntries(e,r=this.getAgentEntries(e)){let t=this.getAgentWiki(e).rebuildIndex().articles,s=new Set;for(let i of t)if(i.sources)for(let y of i.sources)s.add(y);let g=this.readLedger(e).entries,d=[],o=[],a=[];for(let i of r)s.has(i.id)?d.push(i):g[i.id]?o.push(i):a.push(i);return{all:r,cited:d,read:o,pending:a,articles:t}}syncedFrom(e){let r=n(this.agentsDir,e,"_synced.json");if(!c(r))return null;try{return JSON.parse(p(r,"utf-8"))}catch(t){return this.log(`synced marker ${r} is not valid JSON: ${t.message}`),{node:"unknown",peerUrl:"",at:""}}}markSynced(e,r){let t=n(this.agentsDir,e,"_synced.json");l(n(t,".."),{recursive:!0});let s=`${t}.tmp`;f(s,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`),S(s,t)}ledgerPath(e){return n(this.agentsDir,e,"_absorbed.json")}readLedger(e){let r=this.ledgerPath(e);if(!c(r))return{entries:{}};try{return{entries:JSON.parse(p(r,"utf-8")).entries??{}}}catch(t){throw new Error(`absorb ledger ${r} is not valid JSON: ${t.message}`)}}};export{m as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-7O43PB6O.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as S,c as O}from"./chunk-
|
|
1
|
+
import{b as S,c as O}from"./chunk-G3T73GGF.js";import{h as B,j as J}from"./chunk-3UOTLMXD.js";import{a as I,b as P}from"./chunk-FCPTN6NF.js";import{a as X,b as le}from"./chunk-7I7IEX4S.js";import{d as F}from"./chunk-QIJLFPWE.js";import{execFile as ke}from"child_process";import{writeFileSync as ie,mkdirSync as x,existsSync as b,readFileSync as Ce}from"fs";import{resolve as v}from"path";var ge=["off","shadow","authoritative"],me={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"},he="INTENT_LEDGER_MODE";function G(i,e=process.env){let t=U(e[me[i]]);if(t)return t;let n=U(e[he]);return n||"off"}function U(i){if(typeof i!="string")return null;let e=i.trim().toLowerCase();return ge.includes(e)?e:null}P();import fe from"better-sqlite3";import{existsSync as Ge,mkdirSync as pe}from"fs";import{dirname as Ee,resolve as ve}from"path";var T=class{db;path;constructor(e={}){this.path=ve(process.cwd(),e.path??".agentx/intent/ledger.sqlite"),pe(Ee(this.path),{recursive:!0}),this.db=new fe(this.path),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),Ie(this.db)}close(){this.db.close()}schemaVersion(){return this.db.prepare("SELECT MAX(v) AS v FROM schema_version").get().v??0}recordEvent(e){if(e.sourceEventId!==null){let n=this.findEventBySourceId(e.source,e.sourceEventId);if(n)return n}let t={id:e.id??I(e.ts),ts:e.ts,source:e.source,sourceEventId:e.sourceEventId,project:e.project,subject:e.subject,intent:e.intent,rawJson:e.rawJson};return this.db.prepare(`INSERT INTO intent_events (id, ts, source, source_event_id, project, subject, intent, raw_json)
|
|
2
2
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(t.id,t.ts,t.source,t.sourceEventId,t.project,t.subject,t.intent,t.rawJson),t}findEventBySourceId(e,t){let n=this.db.prepare(`SELECT id, ts, source, source_event_id, project, subject, intent, raw_json
|
|
3
3
|
FROM intent_events WHERE source = ? AND source_event_id = ?`).get(e,t);return n?Y(n):null}getEventById(e){let t=this.db.prepare(`SELECT id, ts, source, source_event_id, project, subject, intent, raw_json
|
|
4
4
|
FROM intent_events WHERE id = ?`).get(e);return t?Y(t):null}recordDecision(e){this.db.prepare(`INSERT INTO intent_decisions (event_id, decided_at, decided_by, agent_id, outcome, reason)
|
|
@@ -125,4 +125,4 @@ ${oe(a.block,r.prompt)}`,r.maxOutputTokens),agentId:r.agent,autonomy:r.autonomy,
|
|
|
125
125
|
`);return t.length<=e?t.join(`
|
|
126
126
|
`):t.slice(-e).join(`
|
|
127
127
|
`)}function Pe(i,e,t){return new Promise((n,r)=>{ke("/bin/sh",["-c",i],{timeout:e,maxBuffer:8*1024*1024,...t?{env:t}:{}},(s,o,a)=>{if(s&&s.killed){r(new Error(`command timed out after ${Math.round(e/1e3)}s`));return}n({stdout:String(o??""),stderr:String(a??""),code:s?typeof s.code=="number"?s.code:1:0})})})}export{T as a,V as b,at as c,Le as d,ct as e,dt as f,L as g,ee as h,G as i,ze as j,z as k,Q as l,gt as m,Me as n,ae as o,ce as p,de as q,C as r,M as s};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-7UIK4S6T.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ne}from"./chunk-GTJIKXDB.js";import{C as dn,J as mn,k as O}from"./chunk-
|
|
1
|
+
import{a as Ne}from"./chunk-GTJIKXDB.js";import{C as dn,J as mn,k as O}from"./chunk-BQXKTQCX.js";import{a as w}from"./chunk-VUEQ4SL5.js";import{f as pn,i as gn,k as De,l as Ce,n as X,o as W,q as fn}from"./chunk-LQS27HSV.js";import{t as ln,u as cn}from"./chunk-SXKC2LH7.js";import{d as on,e as an}from"./chunk-AQASR6KR.js";import{b as un}from"./chunk-2VDO2HEK.js";import{a as tn,b as nn,d as rn,e as sn}from"./chunk-MNG2AMKZ.js";import{g as Jt,h as Yt,i as Zt,k as Qt,l as en}from"./chunk-APPTSTL5.js";import{a as Kt,c as Gt}from"./chunk-KP7KDLZ2.js";import{b as Ae,pa as Xt,ra as oe,sa as Ie,ua as Te}from"./chunk-XQ2EFLQW.js";import{q as zt}from"./chunk-7UIK4S6T.js";import{a as Bt,b as Ht}from"./chunk-G3T73GGF.js";import{ab as Ee,ba as Mt,ca as Ut,ea as Ft,fa as Wt,jb as qt,kb as jt,p as se,q as Ot,r as Pt,s as Ns,tb as Vt}from"./chunk-B6GVATMI.js";import{a as Re,h as Ls}from"./chunk-BRK6M6LA.js";import{j as _e,r as Os}from"./chunk-UEEB3UTU.js";import{existsSync as Ps,readdirSync as Ms,readFileSync as Us,statSync as Fs}from"fs";import{resolve as Ws}from"path";function hn(t,e,n=Date.now(),r=7){let s=r*864e5,o=new Map;for(let i of e){let a=o.get(i.workflowId);a?a.push(i):o.set(i.workflowId,[i])}return t.map(i=>{let a=o.get(i.id)??[],l=a.filter(f=>n-f.at<=s),d=a.filter(f=>n-f.at>s&&n-f.at<=s*2),c=l.filter(f=>f.status==="failed").length,u=a.filter(f=>f.status==="paused").length,p=a.length?Math.max(...a.map(f=>f.at)):null,g=a.length?d.length>0&&l.length===0?"dormant":l.length>0&&c*2>=l.length?"failing":l.length>0?"active":"quiet":"never";return{id:i.id,name:i.name||i.id,state:g,lastRunAt:p,recent:l.length,prior:d.length,failed:c,paused:u}}).sort((i,a)=>{let l={dormant:0,failing:1,active:2,quiet:3,never:4};return l[i.state]-l[a.state]||(a.lastRunAt??0)-(i.lastRunAt??0)})}var ie=new Map;function rc(t,e=1e3){if(!Ps(t))return[];let n=Ms(t).filter(o=>o.endsWith(".jsonl")).map(o=>{let i=Ws(t,o);return{path:i,mtime:Fs(i).mtimeMs}}).sort((o,i)=>i.mtime-o.mtime).slice(0,e),r=new Set(n.map(o=>o.path));for(let o of ie.keys())r.has(o)||ie.delete(o);let s=[];for(let{path:o,mtime:i}of n){let a=ie.get(o);if(a&&a.mtime===i){a.summary&&s.push(a.summary);continue}let l=qs(o,i);ie.set(o,{mtime:i,summary:l}),l&&s.push(l)}return s}function qs(t,e){try{let n=Us(t,"utf-8").split(`
|
|
2
2
|
`).filter(Boolean);if(!n.length)return null;let r=JSON.parse(n[0]),s=r.run?.workflowId;if(!s)return null;let o=r.run?.status??"unknown";for(let i=n.length-1;i>=0;i--){let a=JSON.parse(n[i]),l=a.status??a.run?.status;if(l){o=l;break}}return{workflowId:s,status:o,at:e}}catch{return null}}var js={failStreak:3,disabledDays:30,missedFires:2,graceMs:15*6e4},k={routines:200,summary:160,filters:6,filterValue:60,text:120},Vs=(t,e,n)=>{try{return zt(t,e,n)}catch{return null}},bn=864e5;function ac(t){let e=t.now??Date.now(),n={...js,...t.thresholds},r=t.nextFire??Vs,s=[];for(let a of t.crons){let l=t.cronRuns.get(a.id)??[],d=a.timezone||"UTC",c=l.map(g=>({at:Date.parse(g.startedAt),status:g.status})),u=l[0],p={id:`cron:${a.id}`,source:"cron",kind:"schedule",name:E(a.id,k.text),trigger:{schedule:E(a.schedule,k.text),timezone:d},agent:a.agent||null,enabled:a.enabled,state:a.enabled?"enabled":"disabled",nextRunAt:a.enabled?Le(a.nextRun)??Le(r(a.schedule,new Date(e),d)):null,lastRun:u?{at:u.startedAt,status:u.status,summary:Gs(u.status==="success"?void 0:u.errorSummary,k.summary)}:null,lastSuccessAt:l.find(g=>g.status==="success")?.startedAt??null,consecutiveFailures:yn(c),sampledRuns:l.length,flags:[],attention:null};p.flags=wn(p,c,a.schedule,d,null,e,n,r),s.push(kn(p))}let o=new Map(hn(t.workflows.map(a=>({id:a.id,name:a.title})),t.workflowRuns,e).map(a=>[a.id,a])),i=new Map;for(let a of t.workflowRuns){let l=i.get(a.workflowId);l?l.push(a):i.set(a.workflowId,[a])}for(let a of t.workflows){let l=a.nodes.find(T=>T.type.startsWith("trigger."));if(!l||l.type!=="trigger.cron"&&l.type!=="trigger.hook")continue;let d=l.config??{},c=a.state||"active",u=c==="active",p=(i.get(a.id)??[]).slice().sort((T,$e)=>$e.at-T.at),g=p.map(T=>({at:T.at,status:zs(T.status)})),f=g[0],m=l.type==="trigger.cron",b=typeof d.spec=="string"?d.spec:"",x=typeof d.timezone=="string"?d.timezone:"UTC",F={id:`workflow:${a.id}`,source:"workflow",kind:m?"schedule":"event",name:E(a.title||a.id,k.text),trigger:m?{schedule:E(b,k.text),timezone:x}:{event:E(typeof d.event=="string"?d.event:"",k.text),filters:Ks(d.filter,a)},agent:Xs(a),enabled:u,state:c,nextRunAt:m&&u&&b?Le(r(b,new Date(e),x)):null,lastRun:f?{at:new Date(f.at).toISOString(),status:f.status}:null,lastSuccessAt:(()=>{let T=g.find($e=>$e.status==="success");return T?new Date(T.at).toISOString():null})(),consecutiveFailures:yn(g),sampledRuns:p.length,flags:[],attention:null},re=Date.parse(a.updated||a.created||"");F.flags=m?wn(F,g,b,x,Number.isFinite(re)?re:null,e,n,r):Bs(F,o.get(a.id)?.state==="dormant",Number.isFinite(re)?re:null,e,n),s.push(kn(F))}return s.sort(Hs).slice(0,k.routines)}function yn(t){let e=0;for(let n of t)if(!(n.status==="running"||n.status==="paused"||n.status==="unknown"))if(n.status==="failed"||n.status==="timeout")e++;else break;return e}function wn(t,e,n,r,s,o,i,a){let l=[],d=e.length?e[0].at:null;if(!t.enabled){let p=xn(d,s,o,i);return p&&l.push(p),l}if(t.consecutiveFailures>=i.failStreak&&l.push({reason:"failing",detail:`${t.consecutiveFailures} failed attempts in a row`}),d===null)return l.push({reason:"never-ran",detail:"No persisted attempt"}),l;let c=new Date(d),u=null;for(let p=0;p<i.missedFires&&(u=a(n,c,r),!!u);p++)c=u;return u&&o>u.getTime()+i.graceMs&&l.push({reason:"overdue",detail:`No attempt since ${new Date(d).toISOString()}; ${i.missedFires} scheduled fires missed`}),l}function Bs(t,e,n,r,s){let o=[],i=t.lastRun?Date.parse(t.lastRun.at):null;if(!t.enabled){let a=xn(i,n,r,s);return a&&o.push(a),o}return t.consecutiveFailures>=s.failStreak&&o.push({reason:"failing",detail:`${t.consecutiveFailures} failed runs in a row`}),i===null?o.push({reason:"never-ran",detail:"No run recorded for this trigger"}):e&&o.push({reason:"dormant",detail:"Fired in the prior week, silent in the last one"}),o}function xn(t,e,n,r){let s=Math.max(t??0,e??0);return s&&n-s<r.disabledDays*bn?null:{reason:"disabled-long",detail:s?`Disabled; no activity for ${Math.floor((n-s)/bn)} days`:"Disabled and never ran"}}function kn(t){let e=new Set(t.flags.map(n=>n.reason));return t.attention=e.has("failing")?"critical":e.has("overdue")||e.has("dormant")||e.has("never-ran")?"warning":e.has("disabled-long")?"info":null,t}var Sn={critical:0,warning:1,info:2};function Hs(t,e){let n=t.attention?Sn[t.attention]:3,r=e.attention?Sn[e.attention]:3;return n-r||Number(e.enabled)-Number(t.enabled)||t.name.localeCompare(e.name)}function zs(t){switch(t){case"completed":case"ok":return"success";case"failed":return"failed";case"timeout":return"timeout";case"canceled":return"canceled";case"running":return"running";case"paused":return"paused";default:return"unknown"}}function Xs(t){if(t.ownerAgent)return E(t.ownerAgent,k.text);let e=t.nodes.find(n=>n.type==="agent"&&typeof n.config?.agentId=="string"&&n.config.agentId);return e?E(String(e.config.agentId),k.text):null}function Ks(t,e){let n=[],r=e?.project;if(r&&n.push(E(`project=${r}`,k.filterValue)),t&&typeof t=="object"&&!Array.isArray(t))for(let[s,o]of Object.entries(t)){let i=Array.isArray(o)?o.map(String):o==null?[]:[String(o)];i.length&&n.push(E(`${s}=${i.join(",")}`,k.filterValue))}return n.slice(0,k.filters)}function Le(t){if(!t)return null;let e=t instanceof Date?t:new Date(t);return Number.isFinite(e.getTime())?e.toISOString():null}function E(t,e){return t.length<=e?t:t.slice(0,e-3)+"..."}function Gs(t,e){return t===void 0?void 0:E(t,e)}import{mkdirSync as Js,readFileSync as Ys,renameSync as Zs,writeFileSync as Qs}from"fs";import{resolve as eo}from"path";function vn(t){return eo(Ce(t),"_state.json")}function v(t){try{let e=JSON.parse(Ys(vn(t),"utf-8"));return{snoozed:e&&typeof e.snoozed=="object"&&e.snoozed?e.snoozed:{},...typeof e?.lastDigest=="string"?{lastDigest:e.lastDigest}:{},...e?.popped&&typeof e.popped=="object"?{popped:e.popped}:{},...typeof e?.passAt=="string"?{passAt:e.passAt}:{},...Array.isArray(e?.wanted)?{wanted:e.wanted.filter(n=>typeof n=="string")}:{}}}catch{return{snoozed:{}}}}function K(t,e){Js(Ce(t),{recursive:!0});let n=vn(t),r=`${n}.${process.pid}.tmp`;Qs(r,JSON.stringify(e,null,2)+`
|
|
3
3
|
`),Zs(r,n)}function $n(t,e,n,r=Date.now()){let s=v(t),o={};for(let[i,a]of Object.entries(s.snoozed))Date.parse(a)>r&&(o[i]=a);o[e]=n.toISOString(),K(t,{...s,snoozed:o})}function pc(t,e){K(t,{...v(t),lastDigest:e})}function Oe(t,e,n,r=Date.now()){let s=v(t),o=new Set(n),i={};for(let[l,d]of Object.entries(s.popped??{}))o.has(l)&&(i[l]=d);i[e]=new Date(r).toISOString();let a=(s.wanted??[]).filter(l=>l!==e&&o.has(l));K(t,{...s,popped:i,wanted:a})}function Rn(t,e){let n=v(t);K(t,{...n,wanted:[...(n.wanted??[]).filter(r=>r!==e),e]})}function gc(t,e=Date.now()){K(t,{...v(t),popped:{},passAt:new Date(e).toISOString()})}import{existsSync as to,readFileSync as no}from"fs";Vt();Ls();function _n(t){let e=Bt(t),n={};if(to(e))try{n=qt(JSON.parse(no(e,"utf-8")))}catch{n={}}let r=Ee.safeParse(n?.requests);return r.success?r.data:Ee.parse(void 0)}async function wc(t,e={}){let n=(t.channels??[]).filter(r=>!Re.has(r.toLowerCase().split("@")[0]));return n.length?{success:!1,error:`unknown channel ${n.map(r=>`"${r}"`).join(", ")}: use ${[...Re].join(", ")}`}:Ht(r=>{let s=r.requests??={};for(let o of["enabled","channels","from","staleAfterHours","retentionDays","settleHandedBack"])t[o]!==void 0&&(s[o]=t[o]);if(t.plans){let o=s.plans??={};for(let i of["enabled","stallMinutes","maxNudges","approveKinds","disabledAgents","requireForWork","requireOverMinutes"])t.plans[i]!==void 0&&(o[i]=t.plans[i])}if(t.headlines?.enabled!==void 0&&((s.headlines??={}).enabled=t.headlines.enabled),t.catchPromises){let o=s.catchPromises??={};for(let i of["enabled","dailyCap"])t.catchPromises[i]!==void 0&&(o[i]=t.catchPromises[i])}if(t.checkers){let o=s.checkers??={};for(let i of["enabled","checkEveryMinutes"])t.checkers[i]!==void 0&&(o[i]=t.checkers[i])}},{configPath:e.configPath,reload:e.reload})}import{existsSync as G,readdirSync as bo,readFileSync as yo}from"fs";import{resolve as A}from"path";import{randomBytes as In}from"crypto";import{existsSync as so,mkdirSync as oo,readdirSync as io,readFileSync as ao,renameSync as Tn,unlinkSync as lo,writeFileSync as co}from"fs";import{resolve as Dn}from"path";function En(t){return[...t.account?["--account",t.account]:[],...t.store?["--store",t.store]:[]]}var ro=t=>t.trim().split(`
|
|
4
4
|
`).pop()?.slice(0,300)||"no output";async function An(t,e,n,r=Ne){let s=await r(t.bin,[...En(t),"send","text","--to",e,"--message",n,"--no-preview"],{timeoutMs:6e4});return s.code===0?{ok:!0}:{ok:!1,error:`wacli send failed: ${ro(s.stderr||s.stdout)}`}}async function xc(t,e,n,r,s=Ne){return(await s(t.bin,[...En(t),"--read-only","media","download","--chat",e,"--id",n,"--output",r],{timeoutMs:12e4})).code===0}var uo=2e3,po=t=>An(t.wacli,t.to,t.text);function Pe(t){return Dn(t,".agentx","whatsapp-triage","drafts")}var go=t=>/^[a-z0-9-]{8,64}$/.test(t),ae=(t,e)=>Dn(Pe(t),`${e}.json`);function Cn(t,e){oo(Pe(t),{recursive:!0});let n=ae(t,e.id),r=`${n}.${process.pid}.tmp`;co(r,JSON.stringify(e,null,2)+`
|
|
@@ -575,4 +575,4 @@ Document the arguments, commands, or files the skill expects. Example:
|
|
|
575
575
|
claude-code ${Lt(t)} --arg value
|
|
576
576
|
\`\`\`
|
|
577
577
|
`}Vt();var Is={maxPixels:12e5,timeoutMs:5e3,intervalMs:100,changeThreshold:.015,stableMs:400,regions:{},buffer:{enabled:!1,seconds:10,fps:2,region:"screen",maxPixels:3e5}};function Ts(t){return{...Is,...t??{},regions:{...t?.regions??{}},buffer:{...Is.buffer,...t?.buffer??{}}}}function pg(t){try{return Ts(jt(t).screen)}catch{return Ts(void 0)}}var ec=/^[a-z][\w-]*$/,Ds=["window","screen","menubar","notifications"];function ne(t,e,n,r){let s=Number(t);if(t===""||t===null||!Number.isFinite(s)||!n(s))throw new Error(`${e} must be ${r}`);return s}var ve=(t,e)=>ne(t,e,n=>Number.isInteger(n)&&n>0,"a whole number above 0");function Cs(t){let e=typeof t=="string"?t.split(",").map(Number):[t?.x,t?.y,t?.width,t?.height].map(Number);if(e.length!==4||!e.every(Number.isFinite)||e[2]<=0||e[3]<=0)throw new Error("a region is x,y,width,height in screen points, with width and height above 0");return{x:e[0],y:e[1],width:e[2],height:e[3]}}function gg(t,e){let n={...t??{}};if("maxPixels"in e&&(n.maxPixels=ve(e.maxPixels,"maxPixels")),"timeoutMs"in e&&(n.timeoutMs=ve(e.timeoutMs,"timeoutMs")),"intervalMs"in e&&(n.intervalMs=ve(e.intervalMs,"intervalMs")),"stableMs"in e&&(n.stableMs=ne(e.stableMs,"stableMs",s=>Number.isInteger(s)&&s>=0,"a whole number, 0 or more")),"changeThreshold"in e&&(n.changeThreshold=ne(e.changeThreshold,"changeThreshold",s=>s>=0&&s<=1,"between 0 and 1")),e.regions&&typeof e.regions=="object"){let s={...n.regions??{}};for(let[o,i]of Object.entries(e.regions)){if(!ec.test(o))throw new Error(`region name "${o}" must be lowercase letters, digits, - or _`);i===null?delete s[o]:s[o]=Cs(i)}n.regions=s}if(e.buffer&&typeof e.buffer=="object"){let s=e.buffer,o={...n.buffer??{}};"enabled"in s&&(o.enabled=!!s.enabled),"seconds"in s&&(o.seconds=ne(s.seconds,"buffer.seconds",i=>i>0&&i<=120,"above 0 and at most 120")),"fps"in s&&(o.fps=ne(s.fps,"buffer.fps",i=>i>0&&i<=10,"above 0 and at most 10")),"maxPixels"in s&&(o.maxPixels=ve(s.maxPixels,"buffer.maxPixels")),"region"in s&&(o.region=String(s.region).trim()),n.buffer=o}let r=n.buffer?.region;if(r!==void 0&&!Ds.includes(r)&&!n.regions?.[r])try{Cs(r)}catch{throw new Error(`buffer.region "${r}" is not a region \u2014 use ${[...Ds,...Object.keys(n.regions??{})].join(", ")}, or x,y,w,h`)}return n}export{hn as a,rc as b,pt as c,Xi as d,Ki as e,tu as f,nu as g,ru as h,iu as i,au as j,lu as k,Ir as l,Tr as m,cu as n,Dr as o,uu as p,gu as q,N as r,Cr as s,k as t,ac as u,Or as v,wu as w,xu as x,Mr as y,vu as z,Ur as A,$u as B,Z as C,Sa as D,Ru as E,_u as F,Wr as G,xc as H,po as I,Ac as J,Ln as K,v as L,pc as M,gc as N,Dc as O,ce as P,Cc as Q,_n as R,wc as S,P as T,Kc as U,jn as V,Vn as W,Co as X,No as Y,Yc as Z,Zc as _,Wo as $,nd as aa,jr as ba,Iu as ca,od as da,id as ea,Rr as fa,rt as ga,Wi as ha,ts as ia,op as ja,ip as ka,il as la,dp as ma,as as na,up as oa,pp as pa,yp as qa,bl as ra,wp as sa,ld as ta,cd as ua,dd as va,ud as wa,pd as xa,gd as ya,md as za,hd as Aa,Rd as Ba,Ke as Ca,_d as Da,Ed as Ea,J as Fa,Y as Ga,vl as Ha,Ap as Ia,Ip as Ja,Tp as Ka,Dp as La,xt as Ma,Cp as Na,Ye as Oa,Ze as Pa,he as Qa,pi as Ra,fi as Sa,Cd as Ta,et as Ua,tt as Va,mi as Wa,hi as Xa,fr as Ya,yr as Za,Nd as _a,wi as $a,Ld as ab,Ei as bb,Ti as cb,nt as db,Ci as eb,wr as fb,L as gb,ys as hb,ws as ib,ks as jb,$t as kb,Up as lb,Cl as mb,xs as nb,vs as ob,Gp as pb,Jp as qb,Kl as rb,Yp as sb,Rs as tb,be as ub,zd as vb,dt as wb,Qd as xb,tg as yb,ng as zb,rg as Ab,sg as Bb,og as Cb,ig as Db,ag as Eb,lg as Fb,cg as Gb,Is as Hb,Ts as Ib,pg as Jb,Ds as Kb,gg as Lb};
|
|
578
|
-
//# sourceMappingURL=chunk-
|
|
578
|
+
//# sourceMappingURL=chunk-A2D3PNDA.js.map
|