agentix-cli 0.14.0 → 0.15.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 +64 -34
- package/dist/agent-LRSSVFDR.js +2 -0
- package/dist/board-dashboard-DAPHL6W2.js +4508 -0
- package/dist/board-dashboard-DAPHL6W2.js.map +1 -0
- package/dist/chunk-3XULOWYB.js +199 -0
- package/dist/chunk-3XULOWYB.js.map +1 -0
- package/dist/{chunk-ZRYBSI5G.js → chunk-7MBTMCKY.js} +2 -2
- package/dist/{chunk-XVYMZ4M7.js → chunk-AU37OREL.js} +5 -5
- package/dist/chunk-B4Q4X7D5.js +6 -0
- package/dist/chunk-B4Q4X7D5.js.map +1 -0
- package/dist/chunk-CXY2RYNI.js +11 -0
- package/dist/chunk-CXY2RYNI.js.map +1 -0
- package/dist/chunk-FIOB3MEX.js +2 -0
- package/dist/chunk-HLRVDCNH.js +5 -0
- package/dist/{chunk-NJR5WF5E.js.map → chunk-HLRVDCNH.js.map} +1 -1
- package/dist/chunk-IEVEMKAI.js +168 -0
- package/dist/chunk-IEVEMKAI.js.map +1 -0
- package/dist/{chunk-O72LPMBR.js → chunk-RB7265LO.js} +2 -2
- package/dist/chunk-RGUYBH77.js +7 -0
- package/dist/chunk-RGUYBH77.js.map +1 -0
- package/dist/chunk-WVNSWBCU.js +138 -0
- package/dist/chunk-WVNSWBCU.js.map +1 -0
- package/dist/cli.js +34 -24
- package/dist/cli.js.map +1 -1
- package/dist/{compaction-7I3E5QUO.js → compaction-JBZZ7I7Y.js} +4 -4
- package/dist/config-DCJYECL4.js +2 -0
- package/dist/config-mutator-6EJHSP3Y.js +2 -0
- package/dist/debug-3MEUO2P2.js +2 -0
- package/dist/{heal-OTGT5HHJ.js → heal-WKY5I4KB.js} +2 -2
- package/dist/index.d.ts +224 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/loader-PTCXLJEX.js +2 -0
- package/dist/memory-extract-AD7KMRPC.js +2 -0
- package/dist/{providers-G3WZ4RVJ.js → providers-VUIWO3ZK.js} +2 -2
- package/dist/registry-5ND7GLFJ.js +2 -0
- package/dist/scheduler-FCXOXCN5.js +2 -0
- package/dist/{subagent-WV7QKQ3L.js → subagent-2SJHSSJS.js} +2 -2
- package/dist/{usage-dashboard-M7AFIGMJ.js → usage-dashboard-QX3CF6KK.js} +8 -8
- package/dist/usage-dashboard-QX3CF6KK.js.map +1 -0
- package/dist/whatsapp-state-6D6FHHD2.js +2 -0
- package/dist/whatsapp-state-6D6FHHD2.js.map +1 -0
- package/dist/workspace-setup-ZWTT42XT.js +2 -0
- package/dist/workspace-setup-ZWTT42XT.js.map +1 -0
- package/package.json +2 -1
- package/dist/agent-DW3NYIIL.js +0 -2
- package/dist/board-dashboard-6TKE6NMV.js +0 -1435
- package/dist/board-dashboard-6TKE6NMV.js.map +0 -1
- package/dist/chunk-4YCH6IZV.js +0 -2
- package/dist/chunk-DYOBFJLX.js +0 -11
- package/dist/chunk-DYOBFJLX.js.map +0 -1
- package/dist/chunk-ITZEVXZ4.js +0 -2
- package/dist/chunk-ITZEVXZ4.js.map +0 -1
- package/dist/chunk-M33CB2H4.js +0 -6
- package/dist/chunk-M33CB2H4.js.map +0 -1
- package/dist/chunk-NJR5WF5E.js +0 -5
- package/dist/chunk-RB73FZXJ.js +0 -133
- package/dist/chunk-RB73FZXJ.js.map +0 -1
- package/dist/chunk-UPT2UMF6.js +0 -159
- package/dist/chunk-UPT2UMF6.js.map +0 -1
- package/dist/config-7QJ2QJIC.js +0 -2
- package/dist/config-mutator-GAEVGHDD.js +0 -2
- package/dist/debug-N3B5NVJU.js +0 -2
- package/dist/loader-YQE6XJBT.js +0 -2
- package/dist/memory-extract-RGPUPMKU.js +0 -2
- package/dist/registry-YVAG4EO5.js +0 -2
- package/dist/usage-dashboard-M7AFIGMJ.js.map +0 -1
- package/dist/workspace-setup-QQTCJY4B.js +0 -2
- /package/dist/{agent-DW3NYIIL.js.map → agent-LRSSVFDR.js.map} +0 -0
- /package/dist/{chunk-ZRYBSI5G.js.map → chunk-7MBTMCKY.js.map} +0 -0
- /package/dist/{chunk-XVYMZ4M7.js.map → chunk-AU37OREL.js.map} +0 -0
- /package/dist/{chunk-4YCH6IZV.js.map → chunk-FIOB3MEX.js.map} +0 -0
- /package/dist/{chunk-O72LPMBR.js.map → chunk-RB7265LO.js.map} +0 -0
- /package/dist/{compaction-7I3E5QUO.js.map → compaction-JBZZ7I7Y.js.map} +0 -0
- /package/dist/{config-7QJ2QJIC.js.map → config-DCJYECL4.js.map} +0 -0
- /package/dist/{config-mutator-GAEVGHDD.js.map → config-mutator-6EJHSP3Y.js.map} +0 -0
- /package/dist/{debug-N3B5NVJU.js.map → debug-3MEUO2P2.js.map} +0 -0
- /package/dist/{heal-OTGT5HHJ.js.map → heal-WKY5I4KB.js.map} +0 -0
- /package/dist/{loader-YQE6XJBT.js.map → loader-PTCXLJEX.js.map} +0 -0
- /package/dist/{memory-extract-RGPUPMKU.js.map → memory-extract-AD7KMRPC.js.map} +0 -0
- /package/dist/{providers-G3WZ4RVJ.js.map → providers-VUIWO3ZK.js.map} +0 -0
- /package/dist/{registry-YVAG4EO5.js.map → registry-5ND7GLFJ.js.map} +0 -0
- /package/dist/{workspace-setup-QQTCJY4B.js.map → scheduler-FCXOXCN5.js.map} +0 -0
- /package/dist/{subagent-WV7QKQ3L.js.map → subagent-2SJHSSJS.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-QOYAX2FT.js";import"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-QOYAX2FT.js";import"./chunk-FIOB3MEX.js";import{readFileSync as O,writeFileSync as k,existsSync as S,mkdirSync as E}from"fs";import{resolve as g}from"path";function f(t,o){let n=new Map;for(let r of t){if(r.role!=="agent")continue;let s=h(r.content);for(let a of s)n.set(a,(n.get(a)||0)+1)}let e=[...n.entries()].sort((r,s)=>s[1]-r[1]).slice(0,50).map(([r])=>r);return{lexicon:n,toolCalls:o||[],topKeywords:e,capturedAt:new Date().toISOString(),messageCount:t.length}}function y(t,o){let n=D(t,o),{distance:e,newTools:r,missingTools:s}=T(t,o),a=b(t,o),c=Math.min(1,n*.4+e*.3+a*.3),m=t.topKeywords.filter(l=>!o.lexicon.has(l)||(o.lexicon.get(l)||0)===0).slice(0,10);return{overallScore:Math.round(c*100)/100,lexiconDecay:Math.round(n*100)/100,toolShift:Math.round(e*100)/100,semanticDrift:Math.round(a*100)/100,lostWords:m,newTools:r,missingTools:s}}function D(t,o){if(t.topKeywords.length===0)return 0;let n=0;for(let e of t.topKeywords)o.lexicon.has(e)||n++;return n/t.topKeywords.length}function T(t,o){let n=new Set(t.toolCalls),e=new Set(o.toolCalls);if(n.size===0&&e.size===0)return{distance:0,newTools:[],missingTools:[]};let r=[...n].filter(u=>e.has(u)),s=new Set([...n,...e]),c=1-r.length/s.size,m=[...e].filter(u=>!n.has(u)),l=[...n].filter(u=>!e.has(u));return{distance:c,newTools:m,missingTools:l}}function b(t,o){if(t.topKeywords.length===0)return 0;let n=new Set(o.topKeywords),e=0;for(let r of t.topKeywords)n.has(r)&&e++;return 1-e/t.topKeywords.length}var w=".agentx/drift";function C(t,o,n=process.cwd()){let e=g(n,w);S(e)||E(e,{recursive:!0});let r={...o,lexicon:Object.fromEntries(o.lexicon)};k(g(e,`${t}.json`),JSON.stringify(r,null,2))}function M(t,o=process.cwd()){let n=g(o,w,`${t}.json`);if(!S(n))return null;try{let e=JSON.parse(O(n,"utf-8"));return{...e,lexicon:new Map(Object.entries(e.lexicon))}}catch{return null}}var I="claude-haiku-4-20250514";var R=1e4,A=6,v=8,K=`You are a conversation summarizer. Given a conversation history between a user and an AI agent, produce a concise summary that preserves:
|
|
2
2
|
|
|
3
3
|
1. Key decisions made and their reasoning
|
|
4
4
|
2. Important facts learned (names, IDs, paths, URLs, credentials shared)
|
|
@@ -17,12 +17,12 @@ Format as a structured summary:
|
|
|
17
17
|
Keep it under 500 words. Prioritize actionable information over conversational flow.
|
|
18
18
|
Do NOT include greetings, acknowledgments, or meta-commentary about the conversation.`;function U(t){return t.length<v?!1:t.reduce((n,e)=>n+e.content.length,0)>R}async function G(t,o,n){if(t.length<v)return{summary:"",compactedCount:0,keptCount:t.length,memoryFlushed:!1};let e=Math.max(0,t.length-A),r=t.slice(0,e),s=t.slice(e);if(r.length===0)return{summary:"",compactedCount:0,keptCount:s.length,memoryFlushed:!1};let a=f(r);C(o,a);let c=!1;if(n)try{await $(o,r,n),c=!0}catch{}let m=j(r),l=await z(m),{qualityScore:u,lostEntities:i}=P(m,l),p,F=[{role:"agent",content:l,timestamp:new Date().toISOString()}],x=f(F),d=M(o);return d&&(p=y(d,x)),{summary:l,compactedCount:r.length,keptCount:s.length,memoryFlushed:c,qualityScore:u,lostEntities:i.length>0?i:void 0,drift:p&&p.overallScore>.1?p:void 0}}function P(t,o){let n=B(t);if(n.length===0)return{qualityScore:100,lostEntities:[]};let e=o.toLowerCase(),r=[],s=[];for(let c of n)e.includes(c.toLowerCase())?r.push(c):s.push(c);return{qualityScore:Math.round(r.length/n.length*100),lostEntities:s}}function B(t){let o=[],n=new Set,e=i=>{let p=i.toLowerCase().trim();p.length<3||n.has(p)||(n.add(p),o.push(i.trim()))},r=t.match(/https?:\/\/[^\s<>)"]+/g)||[];for(let i of r)e(i.slice(0,80));let s=t.match(/(?:\/[\w.-]+){2,}/g)||[];for(let i of s)e(i);let a=t.match(/[#!]\d{2,}/g)||[];for(let i of a)e(i);let c=t.match(/[\w.-]+@[\w.-]+\.\w+/g)||[];for(let i of c)e(i);let m=t.match(/"([^"]{3,40})"/g)||[];for(let i of m)e(i.slice(1,-1));let l=t.match(/[A-Z][a-z]+(?:\s+[A-Z][a-z]+)+/g)||[];for(let i of l)e(i);let u=t.match(/[a-f0-9]{8,}/gi)||[];for(let i of u.slice(0,5))e(i);return o.slice(0,30)}function J(t,o){if(o.compactedCount===0)return t;let n=t.slice(-o.keptCount);return[{role:"agent",name:"system",content:`[Compacted conversation summary \u2014 ${o.compactedCount} earlier messages]
|
|
19
19
|
|
|
20
|
-
${o.summary}`,timestamp:new Date().toISOString()},...n]}async function $(t,o,n){let e=[],r=[];for(let a of o)a.role==="user"?e.push(`${a.name||"User"}: ${a.content}`):r.push(a.content);if(e.length===0||r.length===0)return;let{extractMemories:s}=await import("./memory-extract-
|
|
20
|
+
${o.summary}`,timestamp:new Date().toISOString()},...n]}async function $(t,o,n){let e=[],r=[];for(let a of o)a.role==="user"?e.push(`${a.name||"User"}: ${a.content}`):r.push(a.content);if(e.length===0||r.length===0)return;let{extractMemories:s}=await import("./memory-extract-AD7KMRPC.js");await s(t,e.join(`
|
|
21
21
|
`),r.join(`
|
|
22
22
|
`),{channel:"compaction",chatId:"flush",sender:"compaction"},n)}function j(t){return t.map(o=>{let n=o.timestamp.slice(11,16),e=o.role==="user"?o.name||"User":o.name||"Agent";return`[${n}] ${e}: ${o.content}`}).join(`
|
|
23
23
|
|
|
24
|
-
`)}async function z(t){let n=t.length>2e4?t.slice(-2e4):t;try{let{createProvider:e}=await import("./providers-
|
|
24
|
+
`)}async function z(t){let n=t.length>2e4?t.slice(-2e4):t;try{let{createProvider:e}=await import("./providers-VUIWO3ZK.js");return(await e("claude").generate([{role:"system",content:K},{role:"user",content:n}],{model:I,maxTokens:1024})).content.trim()}catch{let s=t.split(`
|
|
25
25
|
`).slice(-20);return`[Summary unavailable \u2014 keeping last ${s.length} lines]
|
|
26
26
|
${s.join(`
|
|
27
27
|
`)}`}}export{J as applyCompaction,G as compactSession,U as needsCompaction};
|
|
28
|
-
//# sourceMappingURL=compaction-
|
|
28
|
+
//# sourceMappingURL=compaction-JBZZ7I7Y.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-6MKAXEE5.js";import"./chunk-SFQUP3BP.js";import"./chunk-KXZMYLHQ.js";import"./chunk-M7HKBG3V.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=heal-
|
|
1
|
+
import{a}from"./chunk-6MKAXEE5.js";import"./chunk-SFQUP3BP.js";import"./chunk-KXZMYLHQ.js";import"./chunk-M7HKBG3V.js";import"./chunk-FIOB3MEX.js";export{a as HealEngine};
|
|
2
|
+
//# sourceMappingURL=heal-WKY5I4KB.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1311,6 +1311,11 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1311
1311
|
channel?: string | undefined;
|
|
1312
1312
|
intervalMinutes?: number | undefined;
|
|
1313
1313
|
}>>;
|
|
1314
|
+
/** Reachability via the external public API.
|
|
1315
|
+
* - "private" (default): this agent is daemon-internal + channel-bound only.
|
|
1316
|
+
* - "public": external apps can POST /api/public/agents/<id>/messages
|
|
1317
|
+
* with a scoped token (agent:<id> or agent:*). */
|
|
1318
|
+
access: z.ZodDefault<z.ZodEnum<["private", "public"]>>;
|
|
1314
1319
|
}, "strip", z.ZodTypeAny, {
|
|
1315
1320
|
name: string;
|
|
1316
1321
|
workspace: string;
|
|
@@ -1326,6 +1331,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1326
1331
|
channel: string;
|
|
1327
1332
|
intervalMinutes: number;
|
|
1328
1333
|
};
|
|
1334
|
+
access: "private" | "public";
|
|
1329
1335
|
provider?: string | undefined;
|
|
1330
1336
|
model?: string | undefined;
|
|
1331
1337
|
systemPrompt?: string | undefined;
|
|
@@ -1347,6 +1353,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1347
1353
|
channel?: string | undefined;
|
|
1348
1354
|
intervalMinutes?: number | undefined;
|
|
1349
1355
|
} | undefined;
|
|
1356
|
+
access?: "private" | "public" | undefined;
|
|
1350
1357
|
}>;
|
|
1351
1358
|
declare const cronJobSchema: z.ZodObject<{
|
|
1352
1359
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1480,6 +1487,11 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1480
1487
|
channel?: string | undefined;
|
|
1481
1488
|
intervalMinutes?: number | undefined;
|
|
1482
1489
|
}>>;
|
|
1490
|
+
/** Reachability via the external public API.
|
|
1491
|
+
* - "private" (default): this agent is daemon-internal + channel-bound only.
|
|
1492
|
+
* - "public": external apps can POST /api/public/agents/<id>/messages
|
|
1493
|
+
* with a scoped token (agent:<id> or agent:*). */
|
|
1494
|
+
access: z.ZodDefault<z.ZodEnum<["private", "public"]>>;
|
|
1483
1495
|
}, "strip", z.ZodTypeAny, {
|
|
1484
1496
|
name: string;
|
|
1485
1497
|
workspace: string;
|
|
@@ -1495,6 +1507,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1495
1507
|
channel: string;
|
|
1496
1508
|
intervalMinutes: number;
|
|
1497
1509
|
};
|
|
1510
|
+
access: "private" | "public";
|
|
1498
1511
|
provider?: string | undefined;
|
|
1499
1512
|
model?: string | undefined;
|
|
1500
1513
|
systemPrompt?: string | undefined;
|
|
@@ -1516,6 +1529,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1516
1529
|
channel?: string | undefined;
|
|
1517
1530
|
intervalMinutes?: number | undefined;
|
|
1518
1531
|
} | undefined;
|
|
1532
|
+
access?: "private" | "public" | undefined;
|
|
1519
1533
|
}>>>;
|
|
1520
1534
|
channels: z.ZodDefault<z.ZodObject<{
|
|
1521
1535
|
telegram: z.ZodDefault<z.ZodObject<{
|
|
@@ -1613,6 +1627,24 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1613
1627
|
token?: string | undefined;
|
|
1614
1628
|
agentBinding?: string | undefined;
|
|
1615
1629
|
}>>;
|
|
1630
|
+
slack: z.ZodDefault<z.ZodObject<{
|
|
1631
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1632
|
+
/** xoxb-... — bot user OAuth token from the Slack app's "OAuth & Permissions" tab. */
|
|
1633
|
+
botToken: z.ZodOptional<z.ZodString>;
|
|
1634
|
+
/** xapp-... — app-level token with connections:write scope (for Socket Mode). */
|
|
1635
|
+
appToken: z.ZodOptional<z.ZodString>;
|
|
1636
|
+
agentBinding: z.ZodOptional<z.ZodString>;
|
|
1637
|
+
}, "strip", z.ZodTypeAny, {
|
|
1638
|
+
enabled: boolean;
|
|
1639
|
+
agentBinding?: string | undefined;
|
|
1640
|
+
botToken?: string | undefined;
|
|
1641
|
+
appToken?: string | undefined;
|
|
1642
|
+
}, {
|
|
1643
|
+
enabled?: boolean | undefined;
|
|
1644
|
+
agentBinding?: string | undefined;
|
|
1645
|
+
botToken?: string | undefined;
|
|
1646
|
+
appToken?: string | undefined;
|
|
1647
|
+
}>>;
|
|
1616
1648
|
gitlab: z.ZodDefault<z.ZodObject<{
|
|
1617
1649
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1618
1650
|
webhookPort: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1733,6 +1765,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1733
1765
|
token?: string | undefined;
|
|
1734
1766
|
agentBinding?: string | undefined;
|
|
1735
1767
|
};
|
|
1768
|
+
slack: {
|
|
1769
|
+
enabled: boolean;
|
|
1770
|
+
agentBinding?: string | undefined;
|
|
1771
|
+
botToken?: string | undefined;
|
|
1772
|
+
appToken?: string | undefined;
|
|
1773
|
+
};
|
|
1736
1774
|
}, {
|
|
1737
1775
|
gitlab?: {
|
|
1738
1776
|
enabled?: boolean | undefined;
|
|
@@ -1779,6 +1817,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
1779
1817
|
token?: string | undefined;
|
|
1780
1818
|
agentBinding?: string | undefined;
|
|
1781
1819
|
} | undefined;
|
|
1820
|
+
slack?: {
|
|
1821
|
+
enabled?: boolean | undefined;
|
|
1822
|
+
agentBinding?: string | undefined;
|
|
1823
|
+
botToken?: string | undefined;
|
|
1824
|
+
appToken?: string | undefined;
|
|
1825
|
+
} | undefined;
|
|
1782
1826
|
}>>;
|
|
1783
1827
|
crons: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1784
1828
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -2362,15 +2406,21 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2362
2406
|
daemons: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2363
2407
|
name: z.ZodString;
|
|
2364
2408
|
url: z.ZodString;
|
|
2409
|
+
dashboardUrl: z.ZodOptional<z.ZodString>;
|
|
2365
2410
|
token: z.ZodOptional<z.ZodString>;
|
|
2411
|
+
dashboardToken: z.ZodOptional<z.ZodString>;
|
|
2366
2412
|
}, "strip", z.ZodTypeAny, {
|
|
2367
2413
|
name: string;
|
|
2368
2414
|
url: string;
|
|
2369
2415
|
token?: string | undefined;
|
|
2416
|
+
dashboardUrl?: string | undefined;
|
|
2417
|
+
dashboardToken?: string | undefined;
|
|
2370
2418
|
}, {
|
|
2371
2419
|
name: string;
|
|
2372
2420
|
url: string;
|
|
2373
2421
|
token?: string | undefined;
|
|
2422
|
+
dashboardUrl?: string | undefined;
|
|
2423
|
+
dashboardToken?: string | undefined;
|
|
2374
2424
|
}>, "many">>;
|
|
2375
2425
|
draftAgent: z.ZodOptional<z.ZodString>;
|
|
2376
2426
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2382,6 +2432,8 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2382
2432
|
name: string;
|
|
2383
2433
|
url: string;
|
|
2384
2434
|
token?: string | undefined;
|
|
2435
|
+
dashboardUrl?: string | undefined;
|
|
2436
|
+
dashboardToken?: string | undefined;
|
|
2385
2437
|
}[];
|
|
2386
2438
|
token?: string | undefined;
|
|
2387
2439
|
draftAgent?: string | undefined;
|
|
@@ -2395,9 +2447,36 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2395
2447
|
name: string;
|
|
2396
2448
|
url: string;
|
|
2397
2449
|
token?: string | undefined;
|
|
2450
|
+
dashboardUrl?: string | undefined;
|
|
2451
|
+
dashboardToken?: string | undefined;
|
|
2398
2452
|
}[] | undefined;
|
|
2399
2453
|
draftAgent?: string | undefined;
|
|
2400
2454
|
}>>;
|
|
2455
|
+
/** Registered inbound webhooks — an inventory the dashboard manages. Each
|
|
2456
|
+
* entry binds an (agent, source) pair to an optional signing secret. The
|
|
2457
|
+
* actual inbound URL is always POST /webhook/<agentId>/<source>. */
|
|
2458
|
+
webhooks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2459
|
+
id: z.ZodString;
|
|
2460
|
+
source: z.ZodEnum<["gitlab", "github", "sentry", "stripe", "discord", "slack", "custom"]>;
|
|
2461
|
+
agentId: z.ZodString;
|
|
2462
|
+
secretEnv: z.ZodOptional<z.ZodString>;
|
|
2463
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2464
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2465
|
+
}, "strip", z.ZodTypeAny, {
|
|
2466
|
+
enabled: boolean;
|
|
2467
|
+
id: string;
|
|
2468
|
+
source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
|
|
2469
|
+
agentId: string;
|
|
2470
|
+
description?: string | undefined;
|
|
2471
|
+
secretEnv?: string | undefined;
|
|
2472
|
+
}, {
|
|
2473
|
+
id: string;
|
|
2474
|
+
source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
|
|
2475
|
+
agentId: string;
|
|
2476
|
+
enabled?: boolean | undefined;
|
|
2477
|
+
description?: string | undefined;
|
|
2478
|
+
secretEnv?: string | undefined;
|
|
2479
|
+
}>, "many">>;
|
|
2401
2480
|
/** Session cache-reuse policy. `staleMinutes` controls how long a Claude
|
|
2402
2481
|
* session can idle before we rebuild the prompt from scratch (paying the
|
|
2403
2482
|
* full cache-create tax again). Longer is cheaper at Opus rates but means
|
|
@@ -2425,6 +2504,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2425
2504
|
channel: string;
|
|
2426
2505
|
intervalMinutes: number;
|
|
2427
2506
|
};
|
|
2507
|
+
access: "private" | "public";
|
|
2428
2508
|
provider?: string | undefined;
|
|
2429
2509
|
model?: string | undefined;
|
|
2430
2510
|
systemPrompt?: string | undefined;
|
|
@@ -2499,6 +2579,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2499
2579
|
token?: string | undefined;
|
|
2500
2580
|
agentBinding?: string | undefined;
|
|
2501
2581
|
};
|
|
2582
|
+
slack: {
|
|
2583
|
+
enabled: boolean;
|
|
2584
|
+
agentBinding?: string | undefined;
|
|
2585
|
+
botToken?: string | undefined;
|
|
2586
|
+
appToken?: string | undefined;
|
|
2587
|
+
};
|
|
2502
2588
|
};
|
|
2503
2589
|
crons: Record<string, {
|
|
2504
2590
|
enabled: boolean;
|
|
@@ -2587,10 +2673,20 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2587
2673
|
name: string;
|
|
2588
2674
|
url: string;
|
|
2589
2675
|
token?: string | undefined;
|
|
2676
|
+
dashboardUrl?: string | undefined;
|
|
2677
|
+
dashboardToken?: string | undefined;
|
|
2590
2678
|
}[];
|
|
2591
2679
|
token?: string | undefined;
|
|
2592
2680
|
draftAgent?: string | undefined;
|
|
2593
2681
|
};
|
|
2682
|
+
webhooks: {
|
|
2683
|
+
enabled: boolean;
|
|
2684
|
+
id: string;
|
|
2685
|
+
source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
|
|
2686
|
+
agentId: string;
|
|
2687
|
+
description?: string | undefined;
|
|
2688
|
+
secretEnv?: string | undefined;
|
|
2689
|
+
}[];
|
|
2594
2690
|
session: {
|
|
2595
2691
|
staleMinutes: number;
|
|
2596
2692
|
};
|
|
@@ -2661,6 +2757,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2661
2757
|
channel?: string | undefined;
|
|
2662
2758
|
intervalMinutes?: number | undefined;
|
|
2663
2759
|
} | undefined;
|
|
2760
|
+
access?: "private" | "public" | undefined;
|
|
2664
2761
|
}> | undefined;
|
|
2665
2762
|
mesh?: {
|
|
2666
2763
|
enabled?: boolean | undefined;
|
|
@@ -2726,6 +2823,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2726
2823
|
token?: string | undefined;
|
|
2727
2824
|
agentBinding?: string | undefined;
|
|
2728
2825
|
} | undefined;
|
|
2826
|
+
slack?: {
|
|
2827
|
+
enabled?: boolean | undefined;
|
|
2828
|
+
agentBinding?: string | undefined;
|
|
2829
|
+
botToken?: string | undefined;
|
|
2830
|
+
appToken?: string | undefined;
|
|
2831
|
+
} | undefined;
|
|
2729
2832
|
} | undefined;
|
|
2730
2833
|
crons?: Record<string, {
|
|
2731
2834
|
agent: string;
|
|
@@ -2857,9 +2960,19 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2857
2960
|
name: string;
|
|
2858
2961
|
url: string;
|
|
2859
2962
|
token?: string | undefined;
|
|
2963
|
+
dashboardUrl?: string | undefined;
|
|
2964
|
+
dashboardToken?: string | undefined;
|
|
2860
2965
|
}[] | undefined;
|
|
2861
2966
|
draftAgent?: string | undefined;
|
|
2862
2967
|
} | undefined;
|
|
2968
|
+
webhooks?: {
|
|
2969
|
+
id: string;
|
|
2970
|
+
source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
|
|
2971
|
+
agentId: string;
|
|
2972
|
+
enabled?: boolean | undefined;
|
|
2973
|
+
description?: string | undefined;
|
|
2974
|
+
secretEnv?: string | undefined;
|
|
2975
|
+
}[] | undefined;
|
|
2863
2976
|
session?: {
|
|
2864
2977
|
staleMinutes?: number | undefined;
|
|
2865
2978
|
} | undefined;
|
|
@@ -2974,6 +3087,12 @@ declare class AgentXDaemon {
|
|
|
2974
3087
|
* GET /events — streams daemon logs in real-time.
|
|
2975
3088
|
*/
|
|
2976
3089
|
private handleSSE;
|
|
3090
|
+
/**
|
|
3091
|
+
* Stream a single running task's live output as SSE.
|
|
3092
|
+
* Sends a `start` event with the existing buffer (so a late opener catches up),
|
|
3093
|
+
* then `chunk` events for every new delta, and `end` when the task finishes.
|
|
3094
|
+
*/
|
|
3095
|
+
private handleTaskStream;
|
|
2977
3096
|
private handleHttp;
|
|
2978
3097
|
/**
|
|
2979
3098
|
* OpenAI-compatible chat completions endpoint.
|
|
@@ -3245,7 +3364,7 @@ declare function executeOrchestrator(agent: AgentDef, task: AgentTask, apiKey?:
|
|
|
3245
3364
|
*/
|
|
3246
3365
|
declare function executeTask(agent: AgentDef, task: AgentTask, providers: Record<string, {
|
|
3247
3366
|
apiKey?: string;
|
|
3248
|
-
}>, onDelta?: StreamCallback, historyContext?: string, resumeSessionId?: string): Promise<AgentResponse>;
|
|
3367
|
+
}>, onDelta?: StreamCallback, historyContext?: string, resumeSessionId?: string, onEvent?: (event: any) => void): Promise<AgentResponse>;
|
|
3249
3368
|
|
|
3250
3369
|
type WikiAccess = "private" | "shared" | "public";
|
|
3251
3370
|
/**
|
|
@@ -3555,6 +3674,25 @@ interface RunningTask {
|
|
|
3555
3674
|
/** Wall-clock start. */
|
|
3556
3675
|
startedAt: Date;
|
|
3557
3676
|
}
|
|
3677
|
+
type TaskOutputSubscriber = (chunk: string) => void;
|
|
3678
|
+
/** Persisted record of a finished task, written to .agentx/task-history. */
|
|
3679
|
+
interface TaskRecord {
|
|
3680
|
+
id: string;
|
|
3681
|
+
agentId: string;
|
|
3682
|
+
channel: string;
|
|
3683
|
+
chatId?: string;
|
|
3684
|
+
sender?: string;
|
|
3685
|
+
message: string;
|
|
3686
|
+
startedAt: string;
|
|
3687
|
+
endedAt: string;
|
|
3688
|
+
durationMs: number;
|
|
3689
|
+
ok: boolean;
|
|
3690
|
+
error?: string;
|
|
3691
|
+
/** Final agent text (one-shot, may be empty if streaming captured it). */
|
|
3692
|
+
responseText: string;
|
|
3693
|
+
/** Terminal-style transcript captured from stream-json events. */
|
|
3694
|
+
transcript: string;
|
|
3695
|
+
}
|
|
3558
3696
|
declare class AgentRegistry {
|
|
3559
3697
|
private agents;
|
|
3560
3698
|
private config;
|
|
@@ -3569,6 +3707,12 @@ declare class AgentRegistry {
|
|
|
3569
3707
|
private messageQueue;
|
|
3570
3708
|
/** Active soul profile per agent+chat session: "agentId:channel:chatId" → profile name */
|
|
3571
3709
|
private activeSouls;
|
|
3710
|
+
/** Live output captured per running task id — drives the dashboard streaming modal. */
|
|
3711
|
+
private taskOutputs;
|
|
3712
|
+
/** Last completed task summary per agent — single-line blurb for the dashboard card. */
|
|
3713
|
+
private lastSummaries;
|
|
3714
|
+
/** 24-hour sparkline cache per agent — recomputed from disk at most once a minute. */
|
|
3715
|
+
private sparklineCache;
|
|
3572
3716
|
private log;
|
|
3573
3717
|
constructor(config: DaemonConfig, log?: (...args: unknown[]) => void);
|
|
3574
3718
|
/**
|
|
@@ -3625,7 +3769,57 @@ declare class AgentRegistry {
|
|
|
3625
3769
|
errors: number;
|
|
3626
3770
|
lastActive?: Date;
|
|
3627
3771
|
runningTasks: RunningTask[];
|
|
3772
|
+
lastSummary?: {
|
|
3773
|
+
text: string;
|
|
3774
|
+
at: string;
|
|
3775
|
+
ok: boolean;
|
|
3776
|
+
};
|
|
3777
|
+
hourlyTasks?: number[];
|
|
3628
3778
|
}>;
|
|
3779
|
+
/**
|
|
3780
|
+
* Write a finished task record to disk under .agentx/task-history/<agent>/<yyyy-mm-dd>/.
|
|
3781
|
+
* Side-effects only — call sites should treat failure as best-effort.
|
|
3782
|
+
*/
|
|
3783
|
+
private persistTaskRecord;
|
|
3784
|
+
/**
|
|
3785
|
+
* Compute a 24-hour hourly task-count sparkline for an agent from persisted
|
|
3786
|
+
* history. Returns an array of 24 numbers: buckets[0] = 23-24h ago,
|
|
3787
|
+
* buckets[23] = now-hour. Cached per-agent for 60s to keep snapshot load
|
|
3788
|
+
* reasonable when the dashboard polls every 2s.
|
|
3789
|
+
*/
|
|
3790
|
+
getHourlySparkline(agentId: string, hours?: number): number[];
|
|
3791
|
+
/**
|
|
3792
|
+
* Rebuild the in-memory lastSummaries cache from disk so dashboard cards
|
|
3793
|
+
* show the most recent "what did they do" line even right after a restart.
|
|
3794
|
+
* Called once on daemon startup — one file read per agent.
|
|
3795
|
+
*/
|
|
3796
|
+
hydrateLastSummariesFromDisk(): number;
|
|
3797
|
+
/**
|
|
3798
|
+
* Drop history folders older than retention window. Cheap startup-time
|
|
3799
|
+
* sweep — once a day is plenty, but doing it on every daemon boot is fine.
|
|
3800
|
+
*/
|
|
3801
|
+
pruneTaskHistory(retentionDays?: number): number;
|
|
3802
|
+
/**
|
|
3803
|
+
* Newest-first list of task records for one agent, capped at `limit`.
|
|
3804
|
+
* Walks at most the last few day folders so this is O(limit), not O(history).
|
|
3805
|
+
*/
|
|
3806
|
+
listTaskHistory(agentId: string, limit?: number): Array<Omit<TaskRecord, "transcript" | "responseText">>;
|
|
3807
|
+
/**
|
|
3808
|
+
* Look up one task's full record (transcript included) across the retention window.
|
|
3809
|
+
*/
|
|
3810
|
+
getTaskRecord(agentId: string, taskId: string): TaskRecord | null;
|
|
3811
|
+
private safe;
|
|
3812
|
+
/**
|
|
3813
|
+
* Subscribe to live output for a running task. Returns the buffer that has
|
|
3814
|
+
* accumulated so far plus an unsubscribe handle. If the task is unknown,
|
|
3815
|
+
* returns null. If the task already finished, the subscriber is given the
|
|
3816
|
+
* tail buffer and immediately ended.
|
|
3817
|
+
*/
|
|
3818
|
+
subscribeToTaskOutput(taskId: string, sub: TaskOutputSubscriber): {
|
|
3819
|
+
initial: string;
|
|
3820
|
+
done: boolean;
|
|
3821
|
+
unsubscribe: () => void;
|
|
3822
|
+
} | null;
|
|
3629
3823
|
/**
|
|
3630
3824
|
* Get token usage summary.
|
|
3631
3825
|
*/
|
|
@@ -4359,6 +4553,8 @@ declare class MessageRouter {
|
|
|
4359
4553
|
private readonly DEDUP_STORE_PATH;
|
|
4360
4554
|
private dedupDirtyCount;
|
|
4361
4555
|
private dedupSaveTimer?;
|
|
4556
|
+
/** Crash-safe inflight log (see InflightLog class above). */
|
|
4557
|
+
private inflight;
|
|
4362
4558
|
constructor(registry: AgentRegistry, config: DaemonConfig, hooks?: HookRegistry, log?: (...args: unknown[]) => void);
|
|
4363
4559
|
private loadDedupFromDisk;
|
|
4364
4560
|
private scheduleDedupSave;
|
|
@@ -4381,6 +4577,12 @@ declare class MessageRouter {
|
|
|
4381
4577
|
/** List registered channel names. */
|
|
4382
4578
|
getChannelNames(): string[];
|
|
4383
4579
|
startAll(): Promise<void>;
|
|
4580
|
+
/**
|
|
4581
|
+
* On startup, re-run any incoming message that was recorded as `start` but
|
|
4582
|
+
* never got a matching `done` in the inflight log. Those are tasks the
|
|
4583
|
+
* previous process committed to handling but crashed before completing.
|
|
4584
|
+
*/
|
|
4585
|
+
private replayInflight;
|
|
4384
4586
|
stopAll(): Promise<void>;
|
|
4385
4587
|
/**
|
|
4386
4588
|
* Returns true if this message id was processed within MESSAGE_ID_TTL_MS.
|
|
@@ -4388,6 +4590,9 @@ declare class MessageRouter {
|
|
|
4388
4590
|
*/
|
|
4389
4591
|
private isDuplicateMessage;
|
|
4390
4592
|
private handleMessage;
|
|
4593
|
+
/** The actual processing body — split out so handleMessage can wrap it in
|
|
4594
|
+
* the inflight try/finally without drowning the happy path in indentation. */
|
|
4595
|
+
private processResolvedMessage;
|
|
4391
4596
|
private static readonly MAX_BOT_CHAIN_DEPTH;
|
|
4392
4597
|
/**
|
|
4393
4598
|
* Bot-to-bot conversation chain.
|
|
@@ -4502,11 +4707,18 @@ declare class WhatsAppAdapter implements ChannelAdapter {
|
|
|
4502
4707
|
private generation;
|
|
4503
4708
|
private sentMessageIds;
|
|
4504
4709
|
private log;
|
|
4710
|
+
/** Fires whenever the underlying WhatsApp socket emits a new QR or clears it.
|
|
4711
|
+
* Passing null means the session is now connected. */
|
|
4712
|
+
private onQR?;
|
|
4713
|
+
/** Fires whenever the connection state changes (connecting / open / close). */
|
|
4714
|
+
private onStatus?;
|
|
4505
4715
|
constructor(config: {
|
|
4506
4716
|
sessionDir: string;
|
|
4507
4717
|
defaultAgent?: string;
|
|
4508
4718
|
allowFrom?: string[];
|
|
4509
4719
|
routes?: WhatsAppRoute[];
|
|
4720
|
+
onQR?: (qr: string | null) => void;
|
|
4721
|
+
onStatus?: (status: "connecting" | "open" | "close", detail?: string) => void;
|
|
4510
4722
|
}, log?: (...args: unknown[]) => void);
|
|
4511
4723
|
/**
|
|
4512
4724
|
* Resolve which agent handles a message based on routes.
|
|
@@ -4666,6 +4878,17 @@ declare const logger: {
|
|
|
4666
4878
|
|
|
4667
4879
|
declare function handleError(error: unknown): void;
|
|
4668
4880
|
|
|
4881
|
+
/**
|
|
4882
|
+
* Read the agentx-cli package.json so commands like --version work.
|
|
4883
|
+
*
|
|
4884
|
+
* Looks in three places, in order:
|
|
4885
|
+
* 1. A package.json beside the compiled entry (dist/cli.js → ../package.json),
|
|
4886
|
+
* which is how npm-installed usage finds it.
|
|
4887
|
+
* 2. A package.json in the CWD, which is what `pnpm dev` / `tsx src/cli.ts`
|
|
4888
|
+
* implicitly relies on.
|
|
4889
|
+
* 3. A safe fallback so the CLI never crashes on a truly bare environment
|
|
4890
|
+
* (e.g. a fresh user running `agentx setup` from an empty temp dir).
|
|
4891
|
+
*/
|
|
4669
4892
|
declare function getPackageInfo(): PackageJson;
|
|
4670
4893
|
|
|
4671
4894
|
export { A2AClient, A2AMesh, A2AServer, A2AServerConfig, ALL_TOOL_NAMES, AgentCard, AgentConfig, AgentContext, AgentDef, AgentProvider, AgentRegistry, AgentResponse, AgentTask, AgentXDaemon, AgentXRuntime, AnthropicMessage, AuthConfig, BLOCKING_EVENTS, ChannelAdapter, ClaudeCodeProvider, ClaudeProvider, ContentBlock, ContextBuilder, CronJobDef, CronJobState, CronRunResult, CronScheduler, DaemonConfig, EnhanceConfig, EnhanceEngine, EnhanceResult, GenerateOptions, GenerateResult, GenerateStreamEvent, GeneratedFile, GenerationMessage, GenerationResult, GitCommitResult, GitDiffFile, GitLogEntry, GitManager, GitStatus, HOOK_EVENTS, HealConfig, HealEngine, HealResult, HookContext, HookDefinition, HookEvent, HookHandler, HookRegistry, HookResult, IncomingMessage, Memory, MemoryEntry, MemoryHierarchy, MemoryStore, MeshPeer, MessageRouter, MiddlewareFn, ModelUsage, OUTPUT_CONFIGS, OUTPUT_TYPES, OutgoingMessage, OutputConfig, OutputType, PERMISSION_MODES, PROVIDER_CAPABILITIES, PermissionAction, PermissionConfig, PermissionManager, PermissionMode, PermissionRule, Pipeline, PipelineRequest, PipelineResponse, ProjectSchemas, ProviderCapabilities, ProviderName, ProviderOptions, RawGenerationResult, ReplEngine, ReplOptions, RuntimeConfig, Session, StepUsage, StreamEvent, Task, TaskArtifact, TaskMessage, TaskState, TaskStatusUpdate, TechStack, TelegramAdapter, ToolCallInput, ToolExecutor, ToolExecutorOptions, ToolResult, UsageSummary, UsageTracker, WhatsAppAdapter, WikiAccess, WikiArticle, WikiArticleMeta, WikiEntry, WikiIndex, WikiStore, agentConfigSchema$1 as agentConfigSchema, checkCapabilities, createAgentContext, createProvider, createSession, daemonConfigSchema, debug, detectSchemas, detectTechStack, ensureCredentials, executeClaudeCode, executeOrchestrator, executeSdk, executeTask, exportSession, formatSchemas, formatTechStack, formatToolsForSystemPrompt, gatherContext7Docs, generate, generateSkill, generateSkillMd, generateStream, getAnthropicTools, getCommand, getLegacyTools, getPackageInfo, globalHooks, globalPermissions, globalTracker, handleError, installSkillPackage, isCommand, isDebug, listInstalledSkills, listSessions, loadAuthConfig, loadDaemonConfig, loadHooks, loadLatestSession, loadLocalSkills, loadProjectInstructions, loadSession, logger, matchSkillsToTask, outputTypeDescriptions, parseCommand, parseSkillContent, parseSkillFile, permissionConfigSchema, permissionModeSchema, registerCommand, resolveAtImports, resolveOutputType, resolveToken, runModelSetup, saveAuthConfig, saveSession, setDebug, startMcpServer, validateWorkspaces };
|