agentix-cli 0.140.0 → 0.141.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-RJRJLBCF.js → App-A6YSBIEL.js} +2 -2
- package/dist/{ChatApp-YTGLBN47.js → ChatApp-Q7UHDR5P.js} +2 -2
- package/dist/{absorb-eval-DZ6SCGT7.js → absorb-eval-WTKVCJXT.js} +2 -2
- package/dist/{agent-G32GSRUE.js → agent-FXOQO5L7.js} +2 -2
- package/dist/{board-dashboard-HOZVSYMJ.js → board-dashboard-6K34ZQB5.js} +4 -4
- package/dist/{chunk-EBYG3NS3.js → chunk-27UKZZTZ.js} +2 -2
- package/dist/{chunk-GPDVETDE.js → chunk-6DZSDM35.js} +2 -2
- package/dist/{chunk-FUGDD6UW.js → chunk-6MARQ33D.js} +2 -2
- package/dist/{chunk-4ZKXEUQP.js → chunk-COWWOA7H.js} +2 -2
- package/dist/{chunk-IOT5REOO.js → chunk-CV7ISZKU.js} +2 -2
- package/dist/chunk-HIEJXGYD.js +174 -0
- package/dist/chunk-HIEJXGYD.js.map +1 -0
- package/dist/{chunk-BGKIKZMZ.js → chunk-HPGMY6YB.js} +2 -2
- package/dist/chunk-HW5FTKTU.js +54 -0
- package/dist/{chunk-TF5356HW.js.map → chunk-HW5FTKTU.js.map} +1 -1
- package/dist/{chunk-2JQSWX7U.js → chunk-HYOXWAQP.js} +3 -3
- package/dist/chunk-HYOXWAQP.js.map +1 -0
- package/dist/{chunk-O6KRXVN7.js → chunk-I6P3BKWJ.js} +2 -2
- package/dist/{chunk-ZKNSNSV2.js → chunk-JLM6CXIH.js} +2 -2
- package/dist/{chunk-OCTWRSOI.js → chunk-LR4FYHWS.js} +2 -2
- package/dist/{chunk-2NTRAVHC.js → chunk-LYSCMFAM.js} +2 -2
- package/dist/{chunk-PILE2SH3.js → chunk-MSRFTAWH.js} +2 -2
- package/dist/{chunk-EVQQZNZY.js → chunk-MT5QTEUL.js} +2 -2
- package/dist/{chunk-P5G6EYBL.js → chunk-MWB33O72.js} +2 -2
- package/dist/{chunk-C5ABUPRU.js → chunk-NJHNV4QP.js} +2 -2
- package/dist/{chunk-YVRQ7KWB.js → chunk-OG44FK7T.js} +2 -2
- package/dist/{chunk-GG6K5ZL6.js → chunk-OW2AND54.js} +2 -2
- package/dist/{chunk-PPT2MXQY.js → chunk-T7LDVJMP.js} +3 -3
- package/dist/{chunk-Z46SZWMO.js → chunk-UJRJUSDY.js} +2 -2
- package/dist/{chunk-E47LEY5I.js → chunk-UVJUURNO.js} +2 -2
- package/dist/{chunk-QHXKELKQ.js → chunk-VJC372D6.js} +2 -2
- package/dist/{chunk-U72JN4YF.js → chunk-W4JLZJHU.js} +2 -2
- package/dist/{chunk-HYVRS3G3.js → chunk-X4ZARQET.js} +282 -272
- package/dist/chunk-X4ZARQET.js.map +1 -0
- package/dist/{chunk-QSQWVQLD.js → chunk-YDPXS6T4.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-B275LQZY.js → client-T5BDAOBA.js} +2 -2
- package/dist/config-PCTNYBE3.js +2 -0
- package/dist/{config-mutate-BYRF4RJT.js → config-mutate-2WZOX6Y6.js} +2 -2
- package/dist/config-mutator-M65NF7SF.js +2 -0
- package/dist/{contributions-SQVBSENQ.js → contributions-HVCHGNPO.js} +2 -2
- package/dist/{doctor-L6XMYZPY.js → doctor-NHEMFVQG.js} +2 -2
- package/dist/{follow-up-tool-C72BXO4B.js → follow-up-tool-7ENUC5TI.js} +2 -2
- package/dist/{hub-5OSJMIOO.js → hub-KTS6KFMG.js} +2 -2
- package/dist/index.d.ts +317 -0
- package/dist/index.js +1 -1
- package/dist/{program-QJKOF3OJ.js → program-F6FAZAMJ.js} +241 -236
- package/dist/program-F6FAZAMJ.js.map +1 -0
- package/dist/{promote-C65WVH5K.js → promote-CGF5G6PE.js} +2 -2
- package/dist/{query-3LO5OP6O.js → query-AJVLRTTT.js} +2 -2
- package/dist/{query-settings-TWT6XZNV.js → query-settings-GF3CRGHA.js} +2 -2
- package/dist/registry-LGXDCWCL.js +2 -0
- package/dist/{request-planner-D6XVDOJN.js → request-planner-4KQSVQHO.js} +2 -2
- package/dist/{review-candidates-6BQ25RIY.js → review-candidates-KC3AJDAL.js} +2 -2
- package/dist/{routing-KBNYAPTC.js → routing-5VGAZXNZ.js} +2 -2
- package/dist/schedule-tool-XETP3D45.js +2 -0
- package/dist/{scheduler-R6N7FT27.js → scheduler-UZNAC46U.js} +2 -2
- package/dist/{seat-5AF4CN52.js → seat-BTSSQDZX.js} +2 -2
- package/dist/{select-TJZXA74W.js → select-MYLQ3QGJ.js} +2 -2
- package/dist/{set-enabled-RQPZBVZP.js → set-enabled-QJ4GM624.js} +2 -2
- package/dist/{tool-2RJYOQE7.js → tool-HTPNTSCA.js} +2 -2
- package/dist/{tool-C7Z56DOT.js → tool-HZHMB5Q3.js} +2 -2
- package/dist/{wiki-3DX53GJ4.js → wiki-ZWFSQ5SL.js} +2 -2
- package/dist/wiki-enrich-HQCWHX6Z.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-2JQSWX7U.js.map +0 -1
- package/dist/chunk-GQOMV52Y.js +0 -160
- package/dist/chunk-GQOMV52Y.js.map +0 -1
- package/dist/chunk-HYVRS3G3.js.map +0 -1
- package/dist/chunk-TF5356HW.js +0 -54
- package/dist/config-PYDMLFAM.js +0 -2
- package/dist/config-mutator-LZSY6S4H.js +0 -2
- package/dist/program-QJKOF3OJ.js.map +0 -1
- package/dist/registry-YI7NLDAL.js +0 -2
- package/dist/schedule-tool-GDUREPVN.js +0 -2
- package/dist/wiki-enrich-KQNC45FM.js +0 -2
- /package/dist/{App-RJRJLBCF.js.map → App-A6YSBIEL.js.map} +0 -0
- /package/dist/{ChatApp-YTGLBN47.js.map → ChatApp-Q7UHDR5P.js.map} +0 -0
- /package/dist/{absorb-eval-DZ6SCGT7.js.map → absorb-eval-WTKVCJXT.js.map} +0 -0
- /package/dist/{agent-G32GSRUE.js.map → agent-FXOQO5L7.js.map} +0 -0
- /package/dist/{board-dashboard-HOZVSYMJ.js.map → board-dashboard-6K34ZQB5.js.map} +0 -0
- /package/dist/{chunk-EBYG3NS3.js.map → chunk-27UKZZTZ.js.map} +0 -0
- /package/dist/{chunk-GPDVETDE.js.map → chunk-6DZSDM35.js.map} +0 -0
- /package/dist/{chunk-FUGDD6UW.js.map → chunk-6MARQ33D.js.map} +0 -0
- /package/dist/{chunk-4ZKXEUQP.js.map → chunk-COWWOA7H.js.map} +0 -0
- /package/dist/{chunk-IOT5REOO.js.map → chunk-CV7ISZKU.js.map} +0 -0
- /package/dist/{chunk-BGKIKZMZ.js.map → chunk-HPGMY6YB.js.map} +0 -0
- /package/dist/{chunk-O6KRXVN7.js.map → chunk-I6P3BKWJ.js.map} +0 -0
- /package/dist/{chunk-ZKNSNSV2.js.map → chunk-JLM6CXIH.js.map} +0 -0
- /package/dist/{chunk-OCTWRSOI.js.map → chunk-LR4FYHWS.js.map} +0 -0
- /package/dist/{chunk-2NTRAVHC.js.map → chunk-LYSCMFAM.js.map} +0 -0
- /package/dist/{chunk-PILE2SH3.js.map → chunk-MSRFTAWH.js.map} +0 -0
- /package/dist/{chunk-EVQQZNZY.js.map → chunk-MT5QTEUL.js.map} +0 -0
- /package/dist/{chunk-P5G6EYBL.js.map → chunk-MWB33O72.js.map} +0 -0
- /package/dist/{chunk-C5ABUPRU.js.map → chunk-NJHNV4QP.js.map} +0 -0
- /package/dist/{chunk-YVRQ7KWB.js.map → chunk-OG44FK7T.js.map} +0 -0
- /package/dist/{chunk-GG6K5ZL6.js.map → chunk-OW2AND54.js.map} +0 -0
- /package/dist/{chunk-PPT2MXQY.js.map → chunk-T7LDVJMP.js.map} +0 -0
- /package/dist/{chunk-Z46SZWMO.js.map → chunk-UJRJUSDY.js.map} +0 -0
- /package/dist/{chunk-E47LEY5I.js.map → chunk-UVJUURNO.js.map} +0 -0
- /package/dist/{chunk-QHXKELKQ.js.map → chunk-VJC372D6.js.map} +0 -0
- /package/dist/{chunk-U72JN4YF.js.map → chunk-W4JLZJHU.js.map} +0 -0
- /package/dist/{chunk-QSQWVQLD.js.map → chunk-YDPXS6T4.js.map} +0 -0
- /package/dist/{client-B275LQZY.js.map → client-T5BDAOBA.js.map} +0 -0
- /package/dist/{config-PYDMLFAM.js.map → config-PCTNYBE3.js.map} +0 -0
- /package/dist/{config-mutate-BYRF4RJT.js.map → config-mutate-2WZOX6Y6.js.map} +0 -0
- /package/dist/{config-mutator-LZSY6S4H.js.map → config-mutator-M65NF7SF.js.map} +0 -0
- /package/dist/{contributions-SQVBSENQ.js.map → contributions-HVCHGNPO.js.map} +0 -0
- /package/dist/{doctor-L6XMYZPY.js.map → doctor-NHEMFVQG.js.map} +0 -0
- /package/dist/{follow-up-tool-C72BXO4B.js.map → follow-up-tool-7ENUC5TI.js.map} +0 -0
- /package/dist/{hub-5OSJMIOO.js.map → hub-KTS6KFMG.js.map} +0 -0
- /package/dist/{promote-C65WVH5K.js.map → promote-CGF5G6PE.js.map} +0 -0
- /package/dist/{query-3LO5OP6O.js.map → query-AJVLRTTT.js.map} +0 -0
- /package/dist/{query-settings-TWT6XZNV.js.map → query-settings-GF3CRGHA.js.map} +0 -0
- /package/dist/{registry-YI7NLDAL.js.map → registry-LGXDCWCL.js.map} +0 -0
- /package/dist/{request-planner-D6XVDOJN.js.map → request-planner-4KQSVQHO.js.map} +0 -0
- /package/dist/{review-candidates-6BQ25RIY.js.map → review-candidates-KC3AJDAL.js.map} +0 -0
- /package/dist/{routing-KBNYAPTC.js.map → routing-5VGAZXNZ.js.map} +0 -0
- /package/dist/{schedule-tool-GDUREPVN.js.map → schedule-tool-XETP3D45.js.map} +0 -0
- /package/dist/{scheduler-R6N7FT27.js.map → scheduler-UZNAC46U.js.map} +0 -0
- /package/dist/{seat-5AF4CN52.js.map → seat-BTSSQDZX.js.map} +0 -0
- /package/dist/{select-TJZXA74W.js.map → select-MYLQ3QGJ.js.map} +0 -0
- /package/dist/{set-enabled-RQPZBVZP.js.map → set-enabled-QJ4GM624.js.map} +0 -0
- /package/dist/{tool-2RJYOQE7.js.map → tool-HTPNTSCA.js.map} +0 -0
- /package/dist/{tool-C7Z56DOT.js.map → tool-HZHMB5Q3.js.map} +0 -0
- /package/dist/{wiki-3DX53GJ4.js.map → wiki-ZWFSQ5SL.js.map} +0 -0
- /package/dist/{wiki-enrich-KQNC45FM.js.map → wiki-enrich-HQCWHX6Z.js.map} +0 -0
|
@@ -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-
|
|
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-COWWOA7H.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-
|
|
252
|
+
//# sourceMappingURL=chunk-YDPXS6T4.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-
|
|
2
|
+
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-F6FAZAMJ.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=client-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-UVJUURNO.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
|
|
2
|
+
//# sourceMappingURL=client-T5BDAOBA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Aa as v,Ca as w,fa as a,ga as b,ha as c,ia as d,ja as e,ka as f,la as g,ma as h,na as i,oa as j,pa as k,qa as l,ra as m,sa as n,ta as o,ua as p,va as q,wa as r,xa as s,ya as t,za as u}from"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";w();export{a as INTEGRATION_KINDS,r as WIKI_CONTRIBUTE_JOB,s as WIKI_CONTRIBUTE_MERGE_JOB,u as WIKI_SUMMARIZE_JOB,m as approvalsConfigSchema,e as callsSchema,c as cameraBotSchema,n as daemonConfigSchema,b as eventSubscriptionSchema,o as expandEnvVars,d as isCronExpression,p as loadDaemonConfig,k as membersConfigSchema,j as peopleConfigSchema,i as personSchema,l as requestStatusConfigSchema,h as requestsConfigSchema,f as reviewGateConfigSchema,q as validateWorkspaces,g as watchersConfigSchema,t as withContributionJobs,v as withSummariesJob};
|
|
2
|
+
//# sourceMappingURL=config-PCTNYBE3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=config-mutate-
|
|
1
|
+
import{a,b}from"./chunk-MWB33O72.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
|
|
2
|
+
//# sourceMappingURL=config-mutate-2WZOX6Y6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-VJC372D6.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
|
|
2
|
+
//# sourceMappingURL=config-mutator-M65NF7SF.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-HPGMY6YB.js";import"./chunk-NJHNV4QP.js";import{f as Q,k as V}from"./chunk-QSKG754X.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-T7LDVJMP.js";import"./chunk-SKSYII3K.js";import"./chunk-UJRJUSDY.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-MSRFTAWH.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
|
|
2
2
|
`),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
|
|
3
3
|
${k.join(`
|
|
4
4
|
`)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
|
|
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
|
|
|
54
54
|
`).replace(/\n{3,}/g,`
|
|
55
55
|
|
|
56
56
|
`).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
|
|
57
|
-
//# sourceMappingURL=contributions-
|
|
57
|
+
//# sourceMappingURL=contributions-HVCHGNPO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=doctor-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-27UKZZTZ.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
|
|
2
|
+
//# sourceMappingURL=doctor-NHEMFVQG.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-JLM6CXIH.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-3W2BHUGM.js";import"./chunk-SHEUCITK.js";import"./chunk-OW2AND54.js";import"./chunk-6DZSDM35.js";import"./chunk-VJC372D6.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
|
|
2
2
|
`)}async function T(t,c){let s=c.fetch??fetch,m=c.daemonUrl.replace(/\/$/,""),r=(p(t.action)||"list").toLowerCase(),f=c.env??process.env,w=async i=>{let l=await s(`${m}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(r==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(d=>[`${d.tag}:`,...d.rows.map(a=>`- ${a.runId} "${a.title}" on ${a.step}: waiting on ${a.waitingOn} (since ${String(a.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
|
|
3
3
|
`)).join(`
|
|
4
4
|
`):"No follow-up workflows are running."}if(r==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),d=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!d.ok)return`Error: ${d.data?.error||`HTTP ${d.status}`}`;let a=d.data.matches??[];return a.length?["Saved workflows, best fit first (confidence 0-1):",...a.map(u=>`- ${u.workflowId} "${u.title}" (${u.confidence}${u.autoStart?", starts without asking":""}): ${u.steps.map(k=>k.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
|
|
5
5
|
`):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(r==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?$(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await s(`${m}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...I(f)},body:JSON.stringify({action:r,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun,status:t.status}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(r==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return r==="plan"?[`Plan recorded on run ${n.run?.runId??t.runId}:`,...(n.plan??[]).map(e=>`- ${e.id} ${e.title}`),'Report each step with {action:"step", runId, step:"<id>", status:"started"|"done"|"failed"}.'].join(`
|
|
6
6
|
`):r==="step"?`Step recorded. ${n.run?$(n.run):""}`.trim():r==="done"?`Step recorded as done. ${n.run?$(n.run):""}`.trim():r==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
|
|
7
|
-
//# sourceMappingURL=follow-up-tool-
|
|
7
|
+
//# sourceMappingURL=follow-up-tool-7ENUC5TI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=hub-
|
|
1
|
+
import{a}from"./chunk-W4JLZJHU.js";import"./chunk-COWWOA7H.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-UJRJUSDY.js";import"./chunk-WPNRDEHW.js";import"./chunk-MSRFTAWH.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
|
|
2
|
+
//# sourceMappingURL=hub-KTS6KFMG.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -5565,6 +5565,227 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5565
5565
|
composeTimeoutSeconds?: number | undefined;
|
|
5566
5566
|
} | undefined;
|
|
5567
5567
|
}>>;
|
|
5568
|
+
/** Quality gates for agent-written changes (#987). Each is off by default. */
|
|
5569
|
+
quality: z.ZodDefault<z.ZodObject<{
|
|
5570
|
+
/** Spec-first tests (#992): for an issue that names a pilot path and
|
|
5571
|
+
* goes to a Claude cloud session, a separate test agent writes tests
|
|
5572
|
+
* from the issue text only and pushes them to `spec-tests/issue-N` for
|
|
5573
|
+
* the coding session to merge. See src/agents/spec-tests.ts. */
|
|
5574
|
+
specTests: z.ZodDefault<z.ZodObject<{
|
|
5575
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5576
|
+
/** Path prefixes; an issue that names one of them is in the pilot. */
|
|
5577
|
+
paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5578
|
+
/** The test agent's name: the spec-test commit's author. Must not be
|
|
5579
|
+
* the coding agent's id. */
|
|
5580
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
5581
|
+
/** Model for the test agent. Unset: the `claude` CLI default. */
|
|
5582
|
+
model: z.ZodOptional<z.ZodString>;
|
|
5583
|
+
/** USD cap for one issue's test agent run; it stops when spent. */
|
|
5584
|
+
maxCostPerIssue: z.ZodDefault<z.ZodNumber>;
|
|
5585
|
+
/** Minutes cap for one issue's test agent run. */
|
|
5586
|
+
maxMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5587
|
+
}, "strip", z.ZodTypeAny, {
|
|
5588
|
+
enabled: boolean;
|
|
5589
|
+
agent: string;
|
|
5590
|
+
paths: string[];
|
|
5591
|
+
maxMinutes: number;
|
|
5592
|
+
maxCostPerIssue: number;
|
|
5593
|
+
model?: string | undefined;
|
|
5594
|
+
}, {
|
|
5595
|
+
model?: string | undefined;
|
|
5596
|
+
enabled?: boolean | undefined;
|
|
5597
|
+
agent?: string | undefined;
|
|
5598
|
+
paths?: string[] | undefined;
|
|
5599
|
+
maxMinutes?: number | undefined;
|
|
5600
|
+
maxCostPerIssue?: number | undefined;
|
|
5601
|
+
}>>;
|
|
5602
|
+
/** Canary soak (#993): `agentx daemon deploy` only ships a commit that
|
|
5603
|
+
* has run on this (local) daemon for soakMinutes without new trouble.
|
|
5604
|
+
* Judged from the boot log and task history (src/daemon/canary-soak). */
|
|
5605
|
+
canary: z.ZodDefault<z.ZodObject<{
|
|
5606
|
+
/** Deploy reads only this key from the raw file (no .env, no
|
|
5607
|
+
* validation), so only a literal `true` turns the gate on. */
|
|
5608
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5609
|
+
soakMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5610
|
+
thresholds: z.ZodDefault<z.ZodObject<{
|
|
5611
|
+
/** Clean restarts allowed during the soak (not counting the one
|
|
5612
|
+
* that started it). */
|
|
5613
|
+
maxRestarts: z.ZodDefault<z.ZodNumber>;
|
|
5614
|
+
/** Unclean stops (crash, kill) allowed during the soak. */
|
|
5615
|
+
maxCrashes: z.ZodDefault<z.ZodNumber>;
|
|
5616
|
+
/** Failed or timed-out tasks allowed during the soak (stopped ones
|
|
5617
|
+
* do not count). */
|
|
5618
|
+
maxFailedTasks: z.ZodDefault<z.ZodNumber>;
|
|
5619
|
+
/** Largest rise in the share of failed tasks vs the previous
|
|
5620
|
+
* release, as a fraction (0.1 = 10 percentage points). */
|
|
5621
|
+
maxErrorRateIncrease: z.ZodDefault<z.ZodNumber>;
|
|
5622
|
+
/** Fewer tasks than this during the soak skips the rate check. */
|
|
5623
|
+
minTasksForRate: z.ZodDefault<z.ZodNumber>;
|
|
5624
|
+
}, "strip", z.ZodTypeAny, {
|
|
5625
|
+
maxRestarts: number;
|
|
5626
|
+
maxCrashes: number;
|
|
5627
|
+
maxFailedTasks: number;
|
|
5628
|
+
maxErrorRateIncrease: number;
|
|
5629
|
+
minTasksForRate: number;
|
|
5630
|
+
}, {
|
|
5631
|
+
maxRestarts?: number | undefined;
|
|
5632
|
+
maxCrashes?: number | undefined;
|
|
5633
|
+
maxFailedTasks?: number | undefined;
|
|
5634
|
+
maxErrorRateIncrease?: number | undefined;
|
|
5635
|
+
minTasksForRate?: number | undefined;
|
|
5636
|
+
}>>;
|
|
5637
|
+
}, "strip", z.ZodTypeAny, {
|
|
5638
|
+
enabled: boolean;
|
|
5639
|
+
soakMinutes: number;
|
|
5640
|
+
thresholds: {
|
|
5641
|
+
maxRestarts: number;
|
|
5642
|
+
maxCrashes: number;
|
|
5643
|
+
maxFailedTasks: number;
|
|
5644
|
+
maxErrorRateIncrease: number;
|
|
5645
|
+
minTasksForRate: number;
|
|
5646
|
+
};
|
|
5647
|
+
}, {
|
|
5648
|
+
enabled?: boolean | undefined;
|
|
5649
|
+
soakMinutes?: number | undefined;
|
|
5650
|
+
thresholds?: {
|
|
5651
|
+
maxRestarts?: number | undefined;
|
|
5652
|
+
maxCrashes?: number | undefined;
|
|
5653
|
+
maxFailedTasks?: number | undefined;
|
|
5654
|
+
maxErrorRateIncrease?: number | undefined;
|
|
5655
|
+
minTasksForRate?: number | undefined;
|
|
5656
|
+
} | undefined;
|
|
5657
|
+
}>>;
|
|
5658
|
+
/** Pre-merge review gate (#990): a different agent, in a fresh
|
|
5659
|
+
* session, checks an agent's pull request against its linked issue
|
|
5660
|
+
* and posts the commit status `agentx/review` on the head commit. */
|
|
5661
|
+
reviewGate: z.ZodDefault<z.ZodObject<{
|
|
5662
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5663
|
+
mode: z.ZodDefault<z.ZodEnum<["advisory", "required"]>>;
|
|
5664
|
+
reviewer: z.ZodDefault<z.ZodObject<{
|
|
5665
|
+
/** The agent that reviews. Must not be the agent that wrote the PR. */
|
|
5666
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
5667
|
+
/** Model for the review. Unset: the reviewer agent's own model. Pick
|
|
5668
|
+
* one that differs from the author agent's model when you can. */
|
|
5669
|
+
model: z.ZodOptional<z.ZodString>;
|
|
5670
|
+
}, "strip", z.ZodTypeAny, {
|
|
5671
|
+
model?: string | undefined;
|
|
5672
|
+
agent?: string | undefined;
|
|
5673
|
+
}, {
|
|
5674
|
+
model?: string | undefined;
|
|
5675
|
+
agent?: string | undefined;
|
|
5676
|
+
}>>;
|
|
5677
|
+
/** Only PRs that change a file matching one of these globs are
|
|
5678
|
+
* reviewed (`*` within a folder, `**` across folders). Empty: all. */
|
|
5679
|
+
paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5680
|
+
/** Review cost above this many US dollars ends as `error`. 0: no limit. */
|
|
5681
|
+
maxCostPerReview: z.ZodDefault<z.ZodNumber>;
|
|
5682
|
+
/** Review time above this many minutes ends as `error`. */
|
|
5683
|
+
maxMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5684
|
+
/** Most reviewer runs one PR gets in 24 hours. Each failure comment can
|
|
5685
|
+
* bring a fix push and each push a review; past the limit the status
|
|
5686
|
+
* is `error` and a person takes over. 0: no limit. */
|
|
5687
|
+
maxReviewsPerPrPerDay: z.ZodDefault<z.ZodNumber>;
|
|
5688
|
+
/** How long to wait for other CI checks to finish before reviewing. */
|
|
5689
|
+
ciWaitMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5690
|
+
/** Diffs longer than this many kilobytes are cut, and the reviewer is
|
|
5691
|
+
* told the diff is incomplete. */
|
|
5692
|
+
maxDiffKb: z.ZodDefault<z.ZodNumber>;
|
|
5693
|
+
}, "strip", z.ZodTypeAny, {
|
|
5694
|
+
enabled: boolean;
|
|
5695
|
+
mode: "required" | "advisory";
|
|
5696
|
+
reviewer: {
|
|
5697
|
+
model?: string | undefined;
|
|
5698
|
+
agent?: string | undefined;
|
|
5699
|
+
};
|
|
5700
|
+
paths: string[];
|
|
5701
|
+
maxCostPerReview: number;
|
|
5702
|
+
maxMinutes: number;
|
|
5703
|
+
maxReviewsPerPrPerDay: number;
|
|
5704
|
+
ciWaitMinutes: number;
|
|
5705
|
+
maxDiffKb: number;
|
|
5706
|
+
}, {
|
|
5707
|
+
enabled?: boolean | undefined;
|
|
5708
|
+
mode?: "required" | "advisory" | undefined;
|
|
5709
|
+
reviewer?: {
|
|
5710
|
+
model?: string | undefined;
|
|
5711
|
+
agent?: string | undefined;
|
|
5712
|
+
} | undefined;
|
|
5713
|
+
paths?: string[] | undefined;
|
|
5714
|
+
maxCostPerReview?: number | undefined;
|
|
5715
|
+
maxMinutes?: number | undefined;
|
|
5716
|
+
maxReviewsPerPrPerDay?: number | undefined;
|
|
5717
|
+
ciWaitMinutes?: number | undefined;
|
|
5718
|
+
maxDiffKb?: number | undefined;
|
|
5719
|
+
}>>;
|
|
5720
|
+
}, "strip", z.ZodTypeAny, {
|
|
5721
|
+
specTests: {
|
|
5722
|
+
enabled: boolean;
|
|
5723
|
+
agent: string;
|
|
5724
|
+
paths: string[];
|
|
5725
|
+
maxMinutes: number;
|
|
5726
|
+
maxCostPerIssue: number;
|
|
5727
|
+
model?: string | undefined;
|
|
5728
|
+
};
|
|
5729
|
+
canary: {
|
|
5730
|
+
enabled: boolean;
|
|
5731
|
+
soakMinutes: number;
|
|
5732
|
+
thresholds: {
|
|
5733
|
+
maxRestarts: number;
|
|
5734
|
+
maxCrashes: number;
|
|
5735
|
+
maxFailedTasks: number;
|
|
5736
|
+
maxErrorRateIncrease: number;
|
|
5737
|
+
minTasksForRate: number;
|
|
5738
|
+
};
|
|
5739
|
+
};
|
|
5740
|
+
reviewGate: {
|
|
5741
|
+
enabled: boolean;
|
|
5742
|
+
mode: "required" | "advisory";
|
|
5743
|
+
reviewer: {
|
|
5744
|
+
model?: string | undefined;
|
|
5745
|
+
agent?: string | undefined;
|
|
5746
|
+
};
|
|
5747
|
+
paths: string[];
|
|
5748
|
+
maxCostPerReview: number;
|
|
5749
|
+
maxMinutes: number;
|
|
5750
|
+
maxReviewsPerPrPerDay: number;
|
|
5751
|
+
ciWaitMinutes: number;
|
|
5752
|
+
maxDiffKb: number;
|
|
5753
|
+
};
|
|
5754
|
+
}, {
|
|
5755
|
+
specTests?: {
|
|
5756
|
+
model?: string | undefined;
|
|
5757
|
+
enabled?: boolean | undefined;
|
|
5758
|
+
agent?: string | undefined;
|
|
5759
|
+
paths?: string[] | undefined;
|
|
5760
|
+
maxMinutes?: number | undefined;
|
|
5761
|
+
maxCostPerIssue?: number | undefined;
|
|
5762
|
+
} | undefined;
|
|
5763
|
+
canary?: {
|
|
5764
|
+
enabled?: boolean | undefined;
|
|
5765
|
+
soakMinutes?: number | undefined;
|
|
5766
|
+
thresholds?: {
|
|
5767
|
+
maxRestarts?: number | undefined;
|
|
5768
|
+
maxCrashes?: number | undefined;
|
|
5769
|
+
maxFailedTasks?: number | undefined;
|
|
5770
|
+
maxErrorRateIncrease?: number | undefined;
|
|
5771
|
+
minTasksForRate?: number | undefined;
|
|
5772
|
+
} | undefined;
|
|
5773
|
+
} | undefined;
|
|
5774
|
+
reviewGate?: {
|
|
5775
|
+
enabled?: boolean | undefined;
|
|
5776
|
+
mode?: "required" | "advisory" | undefined;
|
|
5777
|
+
reviewer?: {
|
|
5778
|
+
model?: string | undefined;
|
|
5779
|
+
agent?: string | undefined;
|
|
5780
|
+
} | undefined;
|
|
5781
|
+
paths?: string[] | undefined;
|
|
5782
|
+
maxCostPerReview?: number | undefined;
|
|
5783
|
+
maxMinutes?: number | undefined;
|
|
5784
|
+
maxReviewsPerPrPerDay?: number | undefined;
|
|
5785
|
+
ciWaitMinutes?: number | undefined;
|
|
5786
|
+
maxDiffKb?: number | undefined;
|
|
5787
|
+
} | undefined;
|
|
5788
|
+
}>>;
|
|
5568
5789
|
/** How a daemon stop treats runs still in flight. */
|
|
5569
5790
|
shutdown: z.ZodDefault<z.ZodObject<{
|
|
5570
5791
|
/** Wait this long for runs to finish before cutting them off (they are
|
|
@@ -8848,6 +9069,41 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
8848
9069
|
};
|
|
8849
9070
|
forwardTo?: string | undefined;
|
|
8850
9071
|
};
|
|
9072
|
+
quality: {
|
|
9073
|
+
specTests: {
|
|
9074
|
+
enabled: boolean;
|
|
9075
|
+
agent: string;
|
|
9076
|
+
paths: string[];
|
|
9077
|
+
maxMinutes: number;
|
|
9078
|
+
maxCostPerIssue: number;
|
|
9079
|
+
model?: string | undefined;
|
|
9080
|
+
};
|
|
9081
|
+
canary: {
|
|
9082
|
+
enabled: boolean;
|
|
9083
|
+
soakMinutes: number;
|
|
9084
|
+
thresholds: {
|
|
9085
|
+
maxRestarts: number;
|
|
9086
|
+
maxCrashes: number;
|
|
9087
|
+
maxFailedTasks: number;
|
|
9088
|
+
maxErrorRateIncrease: number;
|
|
9089
|
+
minTasksForRate: number;
|
|
9090
|
+
};
|
|
9091
|
+
};
|
|
9092
|
+
reviewGate: {
|
|
9093
|
+
enabled: boolean;
|
|
9094
|
+
mode: "required" | "advisory";
|
|
9095
|
+
reviewer: {
|
|
9096
|
+
model?: string | undefined;
|
|
9097
|
+
agent?: string | undefined;
|
|
9098
|
+
};
|
|
9099
|
+
paths: string[];
|
|
9100
|
+
maxCostPerReview: number;
|
|
9101
|
+
maxMinutes: number;
|
|
9102
|
+
maxReviewsPerPrPerDay: number;
|
|
9103
|
+
ciWaitMinutes: number;
|
|
9104
|
+
maxDiffKb: number;
|
|
9105
|
+
};
|
|
9106
|
+
};
|
|
8851
9107
|
shutdown: {
|
|
8852
9108
|
restart: {
|
|
8853
9109
|
windowWaitMinutes: number;
|
|
@@ -9902,6 +10158,41 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
9902
10158
|
composeTimeoutSeconds?: number | undefined;
|
|
9903
10159
|
} | undefined;
|
|
9904
10160
|
} | undefined;
|
|
10161
|
+
quality?: {
|
|
10162
|
+
specTests?: {
|
|
10163
|
+
model?: string | undefined;
|
|
10164
|
+
enabled?: boolean | undefined;
|
|
10165
|
+
agent?: string | undefined;
|
|
10166
|
+
paths?: string[] | undefined;
|
|
10167
|
+
maxMinutes?: number | undefined;
|
|
10168
|
+
maxCostPerIssue?: number | undefined;
|
|
10169
|
+
} | undefined;
|
|
10170
|
+
canary?: {
|
|
10171
|
+
enabled?: boolean | undefined;
|
|
10172
|
+
soakMinutes?: number | undefined;
|
|
10173
|
+
thresholds?: {
|
|
10174
|
+
maxRestarts?: number | undefined;
|
|
10175
|
+
maxCrashes?: number | undefined;
|
|
10176
|
+
maxFailedTasks?: number | undefined;
|
|
10177
|
+
maxErrorRateIncrease?: number | undefined;
|
|
10178
|
+
minTasksForRate?: number | undefined;
|
|
10179
|
+
} | undefined;
|
|
10180
|
+
} | undefined;
|
|
10181
|
+
reviewGate?: {
|
|
10182
|
+
enabled?: boolean | undefined;
|
|
10183
|
+
mode?: "required" | "advisory" | undefined;
|
|
10184
|
+
reviewer?: {
|
|
10185
|
+
model?: string | undefined;
|
|
10186
|
+
agent?: string | undefined;
|
|
10187
|
+
} | undefined;
|
|
10188
|
+
paths?: string[] | undefined;
|
|
10189
|
+
maxCostPerReview?: number | undefined;
|
|
10190
|
+
maxMinutes?: number | undefined;
|
|
10191
|
+
maxReviewsPerPrPerDay?: number | undefined;
|
|
10192
|
+
ciWaitMinutes?: number | undefined;
|
|
10193
|
+
maxDiffKb?: number | undefined;
|
|
10194
|
+
} | undefined;
|
|
10195
|
+
} | undefined;
|
|
9905
10196
|
shutdown?: {
|
|
9906
10197
|
restart?: {
|
|
9907
10198
|
allowBy?: string | undefined;
|
|
@@ -10862,6 +11153,10 @@ declare class AgentXDaemon {
|
|
|
10862
11153
|
private taskRunPrune?;
|
|
10863
11154
|
private webhooks;
|
|
10864
11155
|
private github?;
|
|
11156
|
+
/** Pre-merge review gate (#990). Built with the GitHub channel; does
|
|
11157
|
+
* nothing while quality.reviewGate.enabled is false. */
|
|
11158
|
+
private reviewGate?;
|
|
11159
|
+
private reviewLedger;
|
|
10865
11160
|
private webrtc?;
|
|
10866
11161
|
private botManager?;
|
|
10867
11162
|
/** Agents watching the phone camera (#325); needs channels.webrtc. */
|
|
@@ -10920,6 +11215,10 @@ declare class AgentXDaemon {
|
|
|
10920
11215
|
constructor(configPath?: string);
|
|
10921
11216
|
start(): Promise<void>;
|
|
10922
11217
|
stop(): Promise<void>;
|
|
11218
|
+
/** The review gate (#990): the reviewer runs as its own agent in a fresh
|
|
11219
|
+
* session keyed by the reviewed commit, so it never resumes the
|
|
11220
|
+
* author's conversation or an earlier review. */
|
|
11221
|
+
private buildReviewGate;
|
|
10923
11222
|
/** Deliver a notice to the owner through the channel router: the
|
|
10924
11223
|
* address it was given, else notifications.channel (push or ntfy). */
|
|
10925
11224
|
private ownerSender;
|
|
@@ -11756,6 +12055,13 @@ interface AgentTask {
|
|
|
11756
12055
|
* that pattern without requiring callers to invent unique
|
|
11757
12056
|
* chatIds. */
|
|
11758
12057
|
freshSession?: boolean;
|
|
12058
|
+
/** A run that must see only its own message (the review gate, #990).
|
|
12059
|
+
* The registry pushes nothing from the agent's other chats, its memory,
|
|
12060
|
+
* wiki, patterns or landscape; a claude-code run starts with no MCP
|
|
12061
|
+
* server, no built-in tool and Claude Code's auto-memory off; and the
|
|
12062
|
+
* run is held at autonomy `report`, so a tier or peer that cannot
|
|
12063
|
+
* enforce that refuses it instead of running it with its usual tools. */
|
|
12064
|
+
isolated?: boolean;
|
|
11759
12065
|
/** Transcript held by a client that owns the conversation (OpenCode).
|
|
11760
12066
|
* Seeds an empty AgentX session the same way a channel adapter's
|
|
11761
12067
|
* seedHistory does, so a new or rotated session starts with it. */
|
|
@@ -15136,6 +15442,8 @@ declare class AgentRegistry {
|
|
|
15136
15442
|
/** Claude cloud sessions this node launched (#622), by issue. Created on
|
|
15137
15443
|
* first use so a fleet with the setting off never touches the file. */
|
|
15138
15444
|
private cloudSessions?;
|
|
15445
|
+
/** Spec-test runs (#992), one per issue. Created on first use. */
|
|
15446
|
+
private specTests?;
|
|
15139
15447
|
/** The context each running task was started with, by RunningTask id.
|
|
15140
15448
|
* Kept apart from RunningTask because /agents serialises that, and a
|
|
15141
15449
|
* context can carry a whole conversation history. Read by A2A
|
|
@@ -15273,6 +15581,15 @@ declare class AgentRegistry {
|
|
|
15273
15581
|
* it on the trace. Null means: run locally, the reason is logged and on
|
|
15274
15582
|
* the trace. */
|
|
15275
15583
|
private runCloudSession;
|
|
15584
|
+
private specTestSettings;
|
|
15585
|
+
private specTestStore;
|
|
15586
|
+
/** The spec-test input for a new cloud session on an issue (#992), or
|
|
15587
|
+
* null when the test agent does not run (the reason is logged unless the
|
|
15588
|
+
* setting is off). Reads the whole issue with `gh`: the channel's task
|
|
15589
|
+
* text carries only its first 500 characters. */
|
|
15590
|
+
private planSpecTests;
|
|
15591
|
+
/** Runs the test agent in the background, beside the coding session. */
|
|
15592
|
+
private startSpecTests;
|
|
15276
15593
|
/** The answer for a run whose HTTP caller left before it got a slot
|
|
15277
15594
|
* (#822). Logged so the dropped request is visible on the node. */
|
|
15278
15595
|
private callerGone;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-
|
|
1
|
+
import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-X4ZARQET.js";import"./chunk-HYOXWAQP.js";import"./chunk-GTJIKXDB.js";import"./chunk-6MARQ33D.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-MRIVENBY.js";import"./chunk-UNIXYV3U.js";import"./chunk-AKWBDCMU.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-YDPXS6T4.js";import"./chunk-EMGB23H5.js";import"./chunk-JAML6222.js";import"./chunk-YMX3QCV7.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-Y4CYQV7G.js";import"./chunk-3W2BHUGM.js";import"./chunk-SHEUCITK.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import{m as lt,n as ct,na as yt,o as dt,p as mt,q as pt}from"./chunk-HIEJXGYD.js";import"./chunk-I6P3BKWJ.js";import"./chunk-QSKG754X.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-UG2OF2EI.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-LR4FYHWS.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-OW2AND54.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-6DZSDM35.js";import"./chunk-VJC372D6.js";import"./chunk-3UOTLMXD.js";import"./chunk-36AXN6ZB.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-W4JLZJHU.js";import{a as ht}from"./chunk-COWWOA7H.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-T7LDVJMP.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-UJRJUSDY.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-LYSCMFAM.js";import{j as it,k as rt,l as at}from"./chunk-MSRFTAWH.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-2PJKGZWP.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{Ca as nt,sa as tt,ua as st,va as ot}from"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
|
|
2
2
|
`)}
|
|
3
3
|
|
|
4
4
|
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
|