agentix-cli 0.75.1 → 0.75.3
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 +21 -6
- package/dist/{agent-UOOL6R4V.js → agent-B46X7Y6V.js} +2 -2
- package/dist/{board-dashboard-CDBPGUU3.js → board-dashboard-7EZ2VOUK.js} +3 -3
- package/dist/{chunk-OEUII2QP.js → chunk-2HMI5PJG.js} +2 -2
- package/dist/{chunk-5B5J3WVW.js → chunk-55RM7V4N.js} +2 -2
- package/dist/{chunk-SKIDVXWG.js → chunk-663BLK67.js} +2 -2
- package/dist/{chunk-APYG4RB3.js → chunk-6CCJMHBA.js} +2 -2
- package/dist/{chunk-L3MEAKL7.js → chunk-CAVAMWI5.js} +2 -2
- package/dist/{chunk-BAPRRPNU.js → chunk-F2RIMHW5.js} +2 -2
- package/dist/{chunk-6HPJKD3X.js → chunk-KHEI4VNM.js} +13 -13
- package/dist/{chunk-6HPJKD3X.js.map → chunk-KHEI4VNM.js.map} +1 -1
- package/dist/{chunk-KEJOBB5E.js → chunk-NWL5KPBJ.js} +2 -2
- package/dist/{chunk-VCE2DBHB.js → chunk-NZZVUEWI.js} +4 -4
- package/dist/chunk-PBUJBWOF.js +152 -0
- package/dist/chunk-PBUJBWOF.js.map +1 -0
- package/dist/{chunk-WC4TPXD3.js → chunk-Q2FFZX7Y.js} +2 -2
- package/dist/{chunk-6O2MCBOD.js → chunk-QIN6PV4J.js} +11 -11
- package/dist/{chunk-ISBM2C3D.js → chunk-RGTHA2EI.js} +2 -2
- package/dist/{chunk-UBGQ7AOG.js → chunk-TS4JCBSP.js} +2 -2
- package/dist/{chunk-66VSATH3.js → chunk-UJ5JLS6Z.js} +2 -2
- package/dist/chunk-VJ7AFHJ6.js +7 -0
- package/dist/chunk-VJ7AFHJ6.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/doctor-6RUMFTIH.js +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/{program-6MNNHNMY.js → program-MVCIUWJ5.js} +2 -2
- package/dist/{promote-KSYTHPYB.js → promote-PMMUU4G2.js} +2 -2
- package/dist/{query-GRLLX7RG.js → query-CB6FV6JU.js} +2 -2
- package/dist/{registry-WJRF3D5H.js → registry-A2LPURNS.js} +2 -2
- package/dist/{request-planner-G2NJIXQY.js → request-planner-44WOTYCY.js} +2 -2
- package/dist/{review-candidates-F5QKVUQ4.js → review-candidates-BZLS37MN.js} +2 -2
- package/dist/{routing-XIDQWGKT.js → routing-CPLPRA2E.js} +2 -2
- package/dist/{seat-DNI7G7B2.js → seat-CBAZAYGY.js} +2 -2
- package/dist/{select-L45K2452.js → select-4CW3CXBU.js} +2 -2
- package/dist/wiki-4LKOLCP4.js +2 -0
- package/package.json +2 -2
- package/dist/chunk-DIHLL45I.js +0 -152
- package/dist/chunk-DIHLL45I.js.map +0 -1
- package/dist/chunk-GZAGG3ES.js +0 -7
- package/dist/chunk-GZAGG3ES.js.map +0 -1
- package/dist/doctor-MVV47YVK.js +0 -2
- package/dist/wiki-WWVSDXSX.js +0 -2
- /package/dist/{agent-UOOL6R4V.js.map → agent-B46X7Y6V.js.map} +0 -0
- /package/dist/{board-dashboard-CDBPGUU3.js.map → board-dashboard-7EZ2VOUK.js.map} +0 -0
- /package/dist/{chunk-OEUII2QP.js.map → chunk-2HMI5PJG.js.map} +0 -0
- /package/dist/{chunk-5B5J3WVW.js.map → chunk-55RM7V4N.js.map} +0 -0
- /package/dist/{chunk-SKIDVXWG.js.map → chunk-663BLK67.js.map} +0 -0
- /package/dist/{chunk-APYG4RB3.js.map → chunk-6CCJMHBA.js.map} +0 -0
- /package/dist/{chunk-L3MEAKL7.js.map → chunk-CAVAMWI5.js.map} +0 -0
- /package/dist/{chunk-BAPRRPNU.js.map → chunk-F2RIMHW5.js.map} +0 -0
- /package/dist/{chunk-KEJOBB5E.js.map → chunk-NWL5KPBJ.js.map} +0 -0
- /package/dist/{chunk-VCE2DBHB.js.map → chunk-NZZVUEWI.js.map} +0 -0
- /package/dist/{chunk-WC4TPXD3.js.map → chunk-Q2FFZX7Y.js.map} +0 -0
- /package/dist/{chunk-6O2MCBOD.js.map → chunk-QIN6PV4J.js.map} +0 -0
- /package/dist/{chunk-ISBM2C3D.js.map → chunk-RGTHA2EI.js.map} +0 -0
- /package/dist/{chunk-UBGQ7AOG.js.map → chunk-TS4JCBSP.js.map} +0 -0
- /package/dist/{chunk-66VSATH3.js.map → chunk-UJ5JLS6Z.js.map} +0 -0
- /package/dist/{doctor-MVV47YVK.js.map → doctor-6RUMFTIH.js.map} +0 -0
- /package/dist/{program-6MNNHNMY.js.map → program-MVCIUWJ5.js.map} +0 -0
- /package/dist/{promote-KSYTHPYB.js.map → promote-PMMUU4G2.js.map} +0 -0
- /package/dist/{query-GRLLX7RG.js.map → query-CB6FV6JU.js.map} +0 -0
- /package/dist/{registry-WJRF3D5H.js.map → registry-A2LPURNS.js.map} +0 -0
- /package/dist/{request-planner-G2NJIXQY.js.map → request-planner-44WOTYCY.js.map} +0 -0
- /package/dist/{review-candidates-F5QKVUQ4.js.map → review-candidates-BZLS37MN.js.map} +0 -0
- /package/dist/{routing-XIDQWGKT.js.map → routing-CPLPRA2E.js.map} +0 -0
- /package/dist/{seat-DNI7G7B2.js.map → seat-CBAZAYGY.js.map} +0 -0
- /package/dist/{select-L45K2452.js.map → select-4CW3CXBU.js.map} +0 -0
- /package/dist/{wiki-WWVSDXSX.js.map → wiki-4LKOLCP4.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-DP7RTNDM.js";import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{a as E}from"./chunk-
|
|
1
|
+
import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-DP7RTNDM.js";import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{a as E}from"./chunk-UJ5JLS6Z.js";import{b as L}from"./chunk-CECHWYJ2.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=""){return Z(r,s,t,o,i,c)}function Z(n,r,s,t,o,i=""){let c=r?`
|
|
2
2
|
## Worldview
|
|
3
3
|
|
|
4
4
|
${r}
|
|
@@ -240,4 +240,4 @@ ${g}`}var x="memory-promoter",oe=["project","reference","feedback"],K="_memory-p
|
|
|
240
240
|
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 u=[{role:"user",content:n}];s&&(u.push({role:"assistant",content:"(previous attempt; will retry with corrections)"}),u.push({role:"user",content:`Your previous response failed validation: ${s}
|
|
241
241
|
Re-emit the FULL corrected JSON object.`}));let g=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:u}),signal:i.signal});if(!g.ok){let a=await g.text().catch(()=>"");throw new Error(`anthropic API ${g.status}: ${a.slice(0,500)}`)}let l=await g.json(),e=(Array.isArray(l.content)?l.content:[]).filter(a=>a?.type==="text").map(a=>a.text).join(`
|
|
242
242
|
`).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,(...m)=>t(m.map(String).join(" "))),p=c.rebuildIndex(),u=z(r),g=[...ce(s),...n.extraCandidates??[]];if(i.candidates=de(g,p,u,{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 l=p.articles.map(m=>({title:m.title,path:m.path,type:m.type})),d=c.getWorldview()??"",e=n.budgetTokens??ue,a=i.clusters,h=D(x,a,l,d);for(;R(h)>e&&a.length>1;)a=a.slice(0,-1),h=D(x,a,l,d);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(m=>m.candidates),w=new Set(y.map(m=>m.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(m=>[m.stamp,m]));for(let m of f.articles){let A=c.readArticle(m.path);if(A&&!c.canWrite(A.meta,x)){i.errors.push(`write denied for "${m.path}" (owned by ${A.meta.owner??"?"})`);continue}let M=fe(m.promotedFrom,T),S={id:Y(o,m.path),createdAt:v,status:"pending",article:m,evidence:M,...A?{replaces:{lastUpdated:A.meta.lastUpdated,contentHash:V(A.content)}}:{}};I(r,S),i.proposed.push({id:S.id,path:m.path,title:m.title,type:m.type,stamps:m.promotedFrom,agents:M.agents,occurrences:M.occurrences});for(let X of m.promotedFrom)k.push({stamp:X,decision:"proposed",article:m.path,proposal:S.id,at:v})}for(let m of f.skipped)k.push({stamp:m.stamp,decision:"skipped",reason:m.reason,at:v}),i.skipped.push(m);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 u=s.now??Date.now(),g=new Date(u).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??g,lastUpdated:g,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 d=new Date(u).toISOString();C(n,c.promotedFrom.map(a=>({stamp:a,decision:"promoted",article:c.path,proposal:r,at:d}))),i.rebuildIndex();let e={...t,status:"approved",decidedBy:s.by??"operator",decidedAt:d};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};
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
243
|
+
//# sourceMappingURL=chunk-Q2FFZX7Y.js.map
|