agentix-cli 0.13.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.
Files changed (82) hide show
  1. package/README.md +65 -478
  2. package/dist/agent-LRSSVFDR.js +2 -0
  3. package/dist/board-dashboard-DAPHL6W2.js +4508 -0
  4. package/dist/board-dashboard-DAPHL6W2.js.map +1 -0
  5. package/dist/chunk-3XULOWYB.js +199 -0
  6. package/dist/chunk-3XULOWYB.js.map +1 -0
  7. package/dist/chunk-6U2XOQHU.js +7 -0
  8. package/dist/chunk-6U2XOQHU.js.map +1 -0
  9. package/dist/{chunk-ZRYBSI5G.js → chunk-7MBTMCKY.js} +2 -2
  10. package/dist/{chunk-D6EDMQRV.js → chunk-AU37OREL.js} +5 -5
  11. package/dist/chunk-B4Q4X7D5.js +6 -0
  12. package/dist/chunk-B4Q4X7D5.js.map +1 -0
  13. package/dist/chunk-CXY2RYNI.js +11 -0
  14. package/dist/chunk-CXY2RYNI.js.map +1 -0
  15. package/dist/chunk-FIOB3MEX.js +2 -0
  16. package/dist/chunk-HLRVDCNH.js +5 -0
  17. package/dist/chunk-HLRVDCNH.js.map +1 -0
  18. package/dist/chunk-IEVEMKAI.js +168 -0
  19. package/dist/chunk-IEVEMKAI.js.map +1 -0
  20. package/dist/chunk-RB7265LO.js +12 -0
  21. package/dist/chunk-RB7265LO.js.map +1 -0
  22. package/dist/chunk-RGUYBH77.js +7 -0
  23. package/dist/chunk-RGUYBH77.js.map +1 -0
  24. package/dist/chunk-WVNSWBCU.js +138 -0
  25. package/dist/chunk-WVNSWBCU.js.map +1 -0
  26. package/dist/cli.js +64 -48
  27. package/dist/cli.js.map +1 -1
  28. package/dist/{compaction-7I3E5QUO.js → compaction-JBZZ7I7Y.js} +4 -4
  29. package/dist/config-DCJYECL4.js +2 -0
  30. package/dist/config-mutator-6EJHSP3Y.js +2 -0
  31. package/dist/debug-3MEUO2P2.js +2 -0
  32. package/dist/{heal-OTGT5HHJ.js → heal-WKY5I4KB.js} +2 -2
  33. package/dist/index.d.ts +894 -70
  34. package/dist/index.js +11 -11
  35. package/dist/index.js.map +1 -1
  36. package/dist/loader-PTCXLJEX.js +2 -0
  37. package/dist/memory-extract-AD7KMRPC.js +2 -0
  38. package/dist/{providers-G3WZ4RVJ.js → providers-VUIWO3ZK.js} +2 -2
  39. package/dist/registry-5ND7GLFJ.js +2 -0
  40. package/dist/scheduler-FCXOXCN5.js +2 -0
  41. package/dist/scheduler-FCXOXCN5.js.map +1 -0
  42. package/dist/{subagent-WV7QKQ3L.js → subagent-2SJHSSJS.js} +2 -2
  43. package/dist/{usage-dashboard-2TJQBFSH.js → usage-dashboard-QX3CF6KK.js} +8 -8
  44. package/dist/usage-dashboard-QX3CF6KK.js.map +1 -0
  45. package/dist/whatsapp-state-6D6FHHD2.js +2 -0
  46. package/dist/whatsapp-state-6D6FHHD2.js.map +1 -0
  47. package/dist/workspace-setup-ZWTT42XT.js +2 -0
  48. package/dist/workspace-setup-ZWTT42XT.js.map +1 -0
  49. package/package.json +10 -1
  50. package/dist/agent-5KIMJI3F.js +0 -2
  51. package/dist/chunk-34UAFPK4.js +0 -10
  52. package/dist/chunk-34UAFPK4.js.map +0 -1
  53. package/dist/chunk-4YCH6IZV.js +0 -2
  54. package/dist/chunk-CJ45Y2IR.js +0 -12
  55. package/dist/chunk-CJ45Y2IR.js.map +0 -1
  56. package/dist/chunk-T25UEXVK.js +0 -126
  57. package/dist/chunk-T25UEXVK.js.map +0 -1
  58. package/dist/chunk-VH23CDHL.js +0 -157
  59. package/dist/chunk-VH23CDHL.js.map +0 -1
  60. package/dist/chunk-WJ6ZF6EZ.js +0 -6
  61. package/dist/chunk-WJ6ZF6EZ.js.map +0 -1
  62. package/dist/config-HAD5E4YX.js +0 -2
  63. package/dist/debug-N3B5NVJU.js +0 -2
  64. package/dist/loader-YQE6XJBT.js +0 -2
  65. package/dist/memory-extract-RGPUPMKU.js +0 -2
  66. package/dist/registry-CDWY7CLL.js +0 -2
  67. package/dist/usage-dashboard-2TJQBFSH.js.map +0 -1
  68. package/dist/workspace-setup-QQTCJY4B.js +0 -2
  69. /package/dist/{agent-5KIMJI3F.js.map → agent-LRSSVFDR.js.map} +0 -0
  70. /package/dist/{chunk-ZRYBSI5G.js.map → chunk-7MBTMCKY.js.map} +0 -0
  71. /package/dist/{chunk-D6EDMQRV.js.map → chunk-AU37OREL.js.map} +0 -0
  72. /package/dist/{chunk-4YCH6IZV.js.map → chunk-FIOB3MEX.js.map} +0 -0
  73. /package/dist/{compaction-7I3E5QUO.js.map → compaction-JBZZ7I7Y.js.map} +0 -0
  74. /package/dist/{config-HAD5E4YX.js.map → config-DCJYECL4.js.map} +0 -0
  75. /package/dist/{debug-N3B5NVJU.js.map → config-mutator-6EJHSP3Y.js.map} +0 -0
  76. /package/dist/{heal-OTGT5HHJ.js.map → debug-3MEUO2P2.js.map} +0 -0
  77. /package/dist/{loader-YQE6XJBT.js.map → heal-WKY5I4KB.js.map} +0 -0
  78. /package/dist/{memory-extract-RGPUPMKU.js.map → loader-PTCXLJEX.js.map} +0 -0
  79. /package/dist/{providers-G3WZ4RVJ.js.map → memory-extract-AD7KMRPC.js.map} +0 -0
  80. /package/dist/{registry-CDWY7CLL.js.map → providers-VUIWO3ZK.js.map} +0 -0
  81. /package/dist/{workspace-setup-QQTCJY4B.js.map → registry-5ND7GLFJ.js.map} +0 -0
  82. /package/dist/{subagent-WV7QKQ3L.js.map → subagent-2SJHSSJS.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -913,7 +913,7 @@ declare class PermissionManager {
913
913
  }
914
914
  declare const globalPermissions: PermissionManager;
915
915
 
916
- declare const HOOK_EVENTS: readonly ["pre:generate", "post:generate", "pre:file-write", "post:file-write", "pre:prompt", "post:response", "pre:command", "on:error", "pre:tool-call", "post:tool-call", "pre:channel-message", "post:channel-message", "pre:a2a-task", "pre:cron-run", "post:cron-run"];
916
+ declare const HOOK_EVENTS: readonly ["pre:generate", "post:generate", "pre:file-write", "post:file-write", "pre:prompt", "post:response", "pre:command", "on:error", "pre:tool-call", "post:tool-call", "pre:channel-message", "post:channel-message", "pre:a2a-task", "pre:cron-run", "post:cron-run", "on:gitlab-pipeline", "on:gitlab-issue"];
917
917
  type HookEvent = (typeof HOOK_EVENTS)[number];
918
918
  declare const BLOCKING_EVENTS: HookEvent[];
919
919
  declare const hookDefinitionSchema: z.ZodObject<{
@@ -1289,6 +1289,10 @@ declare const agentConfigSchema: z.ZodObject<{
1289
1289
  systemPrompt: z.ZodOptional<z.ZodString>;
1290
1290
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1291
1291
  maxConcurrent: z.ZodDefault<z.ZodNumber>;
1292
+ /** Hard wall-clock cap on a single Claude Code invocation. Exceeding the
1293
+ * cap sends SIGTERM (exit 143). Default 20 min — bump for devops/coder
1294
+ * agents that do long investigations or multi-file refactors. */
1295
+ maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
1292
1296
  permissionMode: z.ZodDefault<z.ZodString>;
1293
1297
  queueMode: z.ZodDefault<z.ZodEnum<["collect", "followup", "drop"]>>;
1294
1298
  heartbeat: z.ZodDefault<z.ZodObject<{
@@ -1307,12 +1311,18 @@ declare const agentConfigSchema: z.ZodObject<{
1307
1311
  channel?: string | undefined;
1308
1312
  intervalMinutes?: number | undefined;
1309
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"]>>;
1310
1319
  }, "strip", z.ZodTypeAny, {
1311
1320
  name: string;
1312
1321
  workspace: string;
1313
1322
  tier: "claude-code" | "sdk" | "orchestrator";
1314
1323
  mentions: string[];
1315
1324
  maxConcurrent: number;
1325
+ maxExecutionMinutes: number;
1316
1326
  permissionMode: string;
1317
1327
  queueMode: "collect" | "followup" | "drop";
1318
1328
  heartbeat: {
@@ -1321,6 +1331,7 @@ declare const agentConfigSchema: z.ZodObject<{
1321
1331
  channel: string;
1322
1332
  intervalMinutes: number;
1323
1333
  };
1334
+ access: "private" | "public";
1324
1335
  provider?: string | undefined;
1325
1336
  model?: string | undefined;
1326
1337
  systemPrompt?: string | undefined;
@@ -1333,6 +1344,7 @@ declare const agentConfigSchema: z.ZodObject<{
1333
1344
  systemPrompt?: string | undefined;
1334
1345
  mentions?: string[] | undefined;
1335
1346
  maxConcurrent?: number | undefined;
1347
+ maxExecutionMinutes?: number | undefined;
1336
1348
  permissionMode?: string | undefined;
1337
1349
  queueMode?: "collect" | "followup" | "drop" | undefined;
1338
1350
  heartbeat?: {
@@ -1341,6 +1353,7 @@ declare const agentConfigSchema: z.ZodObject<{
1341
1353
  channel?: string | undefined;
1342
1354
  intervalMinutes?: number | undefined;
1343
1355
  } | undefined;
1356
+ access?: "private" | "public" | undefined;
1344
1357
  }>;
1345
1358
  declare const cronJobSchema: z.ZodObject<{
1346
1359
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1350,7 +1363,11 @@ declare const cronJobSchema: z.ZodObject<{
1350
1363
  prompt: z.ZodString;
1351
1364
  timeout: z.ZodDefault<z.ZodNumber>;
1352
1365
  model: z.ZodOptional<z.ZodString>;
1353
- onError: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["log", "notify", "disable"]>, z.ZodArray<z.ZodEnum<["log", "notify", "disable"]>, "many">]>>, ("log" | "notify" | "disable")[], "log" | "notify" | "disable" | ("log" | "notify" | "disable")[] | undefined>;
1366
+ /** Soft cap on output length. Claude Code CLI has no hard flag for this,
1367
+ * but appending an instruction to the prompt is reliably honored. Use
1368
+ * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
1369
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1370
+ onError: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["log", "notify", "disable"]>, z.ZodArray<z.ZodEnum<["log", "notify", "disable"]>, "many">]>>, ("notify" | "log" | "disable")[], "notify" | "log" | "disable" | ("notify" | "log" | "disable")[] | undefined>;
1354
1371
  notify: z.ZodOptional<z.ZodObject<{
1355
1372
  channel: z.ZodString;
1356
1373
  chatId: z.ZodString;
@@ -1371,13 +1388,14 @@ declare const cronJobSchema: z.ZodObject<{
1371
1388
  timeout: number;
1372
1389
  schedule: string;
1373
1390
  timezone: string;
1374
- onError: ("log" | "notify" | "disable")[];
1391
+ onError: ("notify" | "log" | "disable")[];
1375
1392
  model?: string | undefined;
1376
1393
  notify?: {
1377
1394
  channel: string;
1378
1395
  chatId: string;
1379
1396
  accountId?: string | undefined;
1380
1397
  } | undefined;
1398
+ maxOutputTokens?: number | undefined;
1381
1399
  }, {
1382
1400
  agent: string;
1383
1401
  prompt: string;
@@ -1391,7 +1409,8 @@ declare const cronJobSchema: z.ZodObject<{
1391
1409
  chatId: string;
1392
1410
  accountId?: string | undefined;
1393
1411
  } | undefined;
1394
- onError?: "log" | "notify" | "disable" | ("log" | "notify" | "disable")[] | undefined;
1412
+ maxOutputTokens?: number | undefined;
1413
+ onError?: "notify" | "log" | "disable" | ("notify" | "log" | "disable")[] | undefined;
1395
1414
  }>;
1396
1415
  declare const meshPeerSchema: z.ZodObject<{
1397
1416
  url: z.ZodString;
@@ -1421,8 +1440,8 @@ declare const daemonConfigSchema: z.ZodObject<{
1421
1440
  }, {
1422
1441
  id: string;
1423
1442
  name: string;
1424
- defaultAgent?: string | undefined;
1425
1443
  bind?: string | undefined;
1444
+ defaultAgent?: string | undefined;
1426
1445
  }>;
1427
1446
  providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1428
1447
  apiKey: z.ZodOptional<z.ZodString>;
@@ -1446,6 +1465,10 @@ declare const daemonConfigSchema: z.ZodObject<{
1446
1465
  systemPrompt: z.ZodOptional<z.ZodString>;
1447
1466
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1448
1467
  maxConcurrent: z.ZodDefault<z.ZodNumber>;
1468
+ /** Hard wall-clock cap on a single Claude Code invocation. Exceeding the
1469
+ * cap sends SIGTERM (exit 143). Default 20 min — bump for devops/coder
1470
+ * agents that do long investigations or multi-file refactors. */
1471
+ maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
1449
1472
  permissionMode: z.ZodDefault<z.ZodString>;
1450
1473
  queueMode: z.ZodDefault<z.ZodEnum<["collect", "followup", "drop"]>>;
1451
1474
  heartbeat: z.ZodDefault<z.ZodObject<{
@@ -1464,12 +1487,18 @@ declare const daemonConfigSchema: z.ZodObject<{
1464
1487
  channel?: string | undefined;
1465
1488
  intervalMinutes?: number | undefined;
1466
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"]>>;
1467
1495
  }, "strip", z.ZodTypeAny, {
1468
1496
  name: string;
1469
1497
  workspace: string;
1470
1498
  tier: "claude-code" | "sdk" | "orchestrator";
1471
1499
  mentions: string[];
1472
1500
  maxConcurrent: number;
1501
+ maxExecutionMinutes: number;
1473
1502
  permissionMode: string;
1474
1503
  queueMode: "collect" | "followup" | "drop";
1475
1504
  heartbeat: {
@@ -1478,6 +1507,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1478
1507
  channel: string;
1479
1508
  intervalMinutes: number;
1480
1509
  };
1510
+ access: "private" | "public";
1481
1511
  provider?: string | undefined;
1482
1512
  model?: string | undefined;
1483
1513
  systemPrompt?: string | undefined;
@@ -1490,6 +1520,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1490
1520
  systemPrompt?: string | undefined;
1491
1521
  mentions?: string[] | undefined;
1492
1522
  maxConcurrent?: number | undefined;
1523
+ maxExecutionMinutes?: number | undefined;
1493
1524
  permissionMode?: string | undefined;
1494
1525
  queueMode?: "collect" | "followup" | "drop" | undefined;
1495
1526
  heartbeat?: {
@@ -1498,6 +1529,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1498
1529
  channel?: string | undefined;
1499
1530
  intervalMinutes?: number | undefined;
1500
1531
  } | undefined;
1532
+ access?: "private" | "public" | undefined;
1501
1533
  }>>>;
1502
1534
  channels: z.ZodDefault<z.ZodObject<{
1503
1535
  telegram: z.ZodDefault<z.ZodObject<{
@@ -1595,6 +1627,24 @@ declare const daemonConfigSchema: z.ZodObject<{
1595
1627
  token?: string | undefined;
1596
1628
  agentBinding?: string | undefined;
1597
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
+ }>>;
1598
1648
  gitlab: z.ZodDefault<z.ZodObject<{
1599
1649
  enabled: z.ZodDefault<z.ZodBoolean>;
1600
1650
  webhookPort: z.ZodDefault<z.ZodNumber>;
@@ -1616,16 +1666,23 @@ declare const daemonConfigSchema: z.ZodObject<{
1616
1666
  gitlabUsernames: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1617
1667
  keywords: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1618
1668
  token: z.ZodOptional<z.ZodString>;
1669
+ /** If set, the agent lives on a remote mesh peer (node id). Forces the
1670
+ * username→agent map to resolve to this mapping even when a local
1671
+ * agent's token resolves to the same GitLab user — prevents collisions
1672
+ * like two agents both claiming @devops-noqta. */
1673
+ node: z.ZodOptional<z.ZodString>;
1619
1674
  }, "strip", z.ZodTypeAny, {
1620
1675
  agentId: string;
1621
1676
  gitlabUsernames: string[];
1622
1677
  keywords: string[];
1623
1678
  token?: string | undefined;
1679
+ node?: string | undefined;
1624
1680
  }, {
1625
1681
  agentId: string;
1626
1682
  token?: string | undefined;
1627
1683
  gitlabUsernames?: string[] | undefined;
1628
1684
  keywords?: string[] | undefined;
1685
+ node?: string | undefined;
1629
1686
  }>, "many">>;
1630
1687
  }, "strip", z.ZodTypeAny, {
1631
1688
  enabled: boolean;
@@ -1640,6 +1697,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1640
1697
  gitlabUsernames: string[];
1641
1698
  keywords: string[];
1642
1699
  token?: string | undefined;
1700
+ node?: string | undefined;
1643
1701
  }[];
1644
1702
  token?: string | undefined;
1645
1703
  webhookSecret?: string | undefined;
@@ -1658,6 +1716,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1658
1716
  token?: string | undefined;
1659
1717
  gitlabUsernames?: string[] | undefined;
1660
1718
  keywords?: string[] | undefined;
1719
+ node?: string | undefined;
1661
1720
  }[] | undefined;
1662
1721
  }>>;
1663
1722
  }, "strip", z.ZodTypeAny, {
@@ -1674,6 +1733,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1674
1733
  gitlabUsernames: string[];
1675
1734
  keywords: string[];
1676
1735
  token?: string | undefined;
1736
+ node?: string | undefined;
1677
1737
  }[];
1678
1738
  token?: string | undefined;
1679
1739
  webhookSecret?: string | undefined;
@@ -1705,6 +1765,12 @@ declare const daemonConfigSchema: z.ZodObject<{
1705
1765
  token?: string | undefined;
1706
1766
  agentBinding?: string | undefined;
1707
1767
  };
1768
+ slack: {
1769
+ enabled: boolean;
1770
+ agentBinding?: string | undefined;
1771
+ botToken?: string | undefined;
1772
+ appToken?: string | undefined;
1773
+ };
1708
1774
  }, {
1709
1775
  gitlab?: {
1710
1776
  enabled?: boolean | undefined;
@@ -1721,6 +1787,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1721
1787
  token?: string | undefined;
1722
1788
  gitlabUsernames?: string[] | undefined;
1723
1789
  keywords?: string[] | undefined;
1790
+ node?: string | undefined;
1724
1791
  }[] | undefined;
1725
1792
  } | undefined;
1726
1793
  telegram?: {
@@ -1750,6 +1817,12 @@ declare const daemonConfigSchema: z.ZodObject<{
1750
1817
  token?: string | undefined;
1751
1818
  agentBinding?: string | undefined;
1752
1819
  } | undefined;
1820
+ slack?: {
1821
+ enabled?: boolean | undefined;
1822
+ agentBinding?: string | undefined;
1823
+ botToken?: string | undefined;
1824
+ appToken?: string | undefined;
1825
+ } | undefined;
1753
1826
  }>>;
1754
1827
  crons: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1755
1828
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1759,7 +1832,11 @@ declare const daemonConfigSchema: z.ZodObject<{
1759
1832
  prompt: z.ZodString;
1760
1833
  timeout: z.ZodDefault<z.ZodNumber>;
1761
1834
  model: z.ZodOptional<z.ZodString>;
1762
- onError: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["log", "notify", "disable"]>, z.ZodArray<z.ZodEnum<["log", "notify", "disable"]>, "many">]>>, ("log" | "notify" | "disable")[], "log" | "notify" | "disable" | ("log" | "notify" | "disable")[] | undefined>;
1835
+ /** Soft cap on output length. Claude Code CLI has no hard flag for this,
1836
+ * but appending an instruction to the prompt is reliably honored. Use
1837
+ * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
1838
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1839
+ onError: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodEnum<["log", "notify", "disable"]>, z.ZodArray<z.ZodEnum<["log", "notify", "disable"]>, "many">]>>, ("notify" | "log" | "disable")[], "notify" | "log" | "disable" | ("notify" | "log" | "disable")[] | undefined>;
1763
1840
  notify: z.ZodOptional<z.ZodObject<{
1764
1841
  channel: z.ZodString;
1765
1842
  chatId: z.ZodString;
@@ -1780,13 +1857,14 @@ declare const daemonConfigSchema: z.ZodObject<{
1780
1857
  timeout: number;
1781
1858
  schedule: string;
1782
1859
  timezone: string;
1783
- onError: ("log" | "notify" | "disable")[];
1860
+ onError: ("notify" | "log" | "disable")[];
1784
1861
  model?: string | undefined;
1785
1862
  notify?: {
1786
1863
  channel: string;
1787
1864
  chatId: string;
1788
1865
  accountId?: string | undefined;
1789
1866
  } | undefined;
1867
+ maxOutputTokens?: number | undefined;
1790
1868
  }, {
1791
1869
  agent: string;
1792
1870
  prompt: string;
@@ -1800,7 +1878,8 @@ declare const daemonConfigSchema: z.ZodObject<{
1800
1878
  chatId: string;
1801
1879
  accountId?: string | undefined;
1802
1880
  } | undefined;
1803
- onError?: "log" | "notify" | "disable" | ("log" | "notify" | "disable")[] | undefined;
1881
+ maxOutputTokens?: number | undefined;
1882
+ onError?: "notify" | "log" | "disable" | ("notify" | "log" | "disable")[] | undefined;
1804
1883
  }>>>;
1805
1884
  services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1806
1885
  name: z.ZodString;
@@ -2046,39 +2125,39 @@ declare const daemonConfigSchema: z.ZodObject<{
2046
2125
  start: z.ZodString;
2047
2126
  end: z.ZodString;
2048
2127
  }, "strip", z.ZodTypeAny, {
2049
- start: string;
2050
2128
  end: string;
2051
- }, {
2052
2129
  start: string;
2130
+ }, {
2053
2131
  end: string;
2132
+ start: string;
2054
2133
  }>>;
2055
2134
  }, "strip", z.ZodTypeAny, {
2135
+ end: string;
2056
2136
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
2057
2137
  start: string;
2058
- end: string;
2059
2138
  lunch?: {
2060
- start: string;
2061
2139
  end: string;
2140
+ start: string;
2062
2141
  } | undefined;
2063
2142
  }, {
2064
- start: string;
2065
2143
  end: string;
2144
+ start: string;
2066
2145
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
2067
2146
  lunch?: {
2068
- start: string;
2069
2147
  end: string;
2148
+ start: string;
2070
2149
  } | undefined;
2071
2150
  }>;
2072
2151
  utilizationTarget: z.ZodDefault<z.ZodNumber>;
2073
2152
  }, "strip", z.ZodTypeAny, {
2074
2153
  role: string;
2075
2154
  schedule: {
2155
+ end: string;
2076
2156
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
2077
2157
  start: string;
2078
- end: string;
2079
2158
  lunch?: {
2080
- start: string;
2081
2159
  end: string;
2160
+ start: string;
2082
2161
  } | undefined;
2083
2162
  };
2084
2163
  utilizationTarget: number;
@@ -2086,12 +2165,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2086
2165
  }, {
2087
2166
  role: string;
2088
2167
  schedule: {
2089
- start: string;
2090
2168
  end: string;
2169
+ start: string;
2091
2170
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
2092
2171
  lunch?: {
2093
- start: string;
2094
2172
  end: string;
2173
+ start: string;
2095
2174
  } | undefined;
2096
2175
  };
2097
2176
  reportsTo?: string | undefined;
@@ -2127,12 +2206,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2127
2206
  orgChart: Record<string, {
2128
2207
  role: string;
2129
2208
  schedule: {
2209
+ end: string;
2130
2210
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
2131
2211
  start: string;
2132
- end: string;
2133
2212
  lunch?: {
2134
- start: string;
2135
2213
  end: string;
2214
+ start: string;
2136
2215
  } | undefined;
2137
2216
  };
2138
2217
  utilizationTarget: number;
@@ -2168,12 +2247,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2168
2247
  orgChart?: Record<string, {
2169
2248
  role: string;
2170
2249
  schedule: {
2171
- start: string;
2172
2250
  end: string;
2251
+ start: string;
2173
2252
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
2174
2253
  lunch?: {
2175
- start: string;
2176
2254
  end: string;
2255
+ start: string;
2177
2256
  } | undefined;
2178
2257
  };
2179
2258
  reportsTo?: string | undefined;
@@ -2182,6 +2261,233 @@ declare const daemonConfigSchema: z.ZodObject<{
2182
2261
  workTickMinutes?: number | undefined;
2183
2262
  idleQueueThreshold?: number | undefined;
2184
2263
  }>>;
2264
+ boards: z.ZodDefault<z.ZodArray<z.ZodObject<{
2265
+ id: z.ZodString;
2266
+ name: z.ZodString;
2267
+ source: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2268
+ type: z.ZodLiteral<"gitlab">;
2269
+ projects: z.ZodArray<z.ZodString, "many">;
2270
+ }, "strip", z.ZodTypeAny, {
2271
+ type: "gitlab";
2272
+ projects: string[];
2273
+ }, {
2274
+ type: "gitlab";
2275
+ projects: string[];
2276
+ }>]>;
2277
+ primaryToolLabel: z.ZodOptional<z.ZodString>;
2278
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
2279
+ name: z.ZodString;
2280
+ color: z.ZodDefault<z.ZodString>;
2281
+ description: z.ZodOptional<z.ZodString>;
2282
+ }, "strip", z.ZodTypeAny, {
2283
+ name: string;
2284
+ color: string;
2285
+ description?: string | undefined;
2286
+ }, {
2287
+ name: string;
2288
+ description?: string | undefined;
2289
+ color?: string | undefined;
2290
+ }>, "many">>;
2291
+ columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
2292
+ id: z.ZodString;
2293
+ title: z.ZodString;
2294
+ kind: z.ZodDefault<z.ZodEnum<["open-backlog", "scoped-label", "closed", "label"]>>;
2295
+ mapsToLabel: z.ZodOptional<z.ZodString>;
2296
+ scopedLabel: z.ZodOptional<z.ZodString>;
2297
+ scopedPrefix: z.ZodDefault<z.ZodString>;
2298
+ accent: z.ZodOptional<z.ZodString>;
2299
+ }, "strip", z.ZodTypeAny, {
2300
+ id: string;
2301
+ title: string;
2302
+ kind: "open-backlog" | "scoped-label" | "closed" | "label";
2303
+ scopedPrefix: string;
2304
+ mapsToLabel?: string | undefined;
2305
+ scopedLabel?: string | undefined;
2306
+ accent?: string | undefined;
2307
+ }, {
2308
+ id: string;
2309
+ title: string;
2310
+ kind?: "open-backlog" | "scoped-label" | "closed" | "label" | undefined;
2311
+ mapsToLabel?: string | undefined;
2312
+ scopedLabel?: string | undefined;
2313
+ scopedPrefix?: string | undefined;
2314
+ accent?: string | undefined;
2315
+ }>, "many">>;
2316
+ timeRangeDays: z.ZodDefault<z.ZodNumber>;
2317
+ closedWindowDays: z.ZodDefault<z.ZodNumber>;
2318
+ reconciliation: z.ZodDefault<z.ZodObject<{
2319
+ enabled: z.ZodDefault<z.ZodBoolean>;
2320
+ staleDoingMinutes: z.ZodDefault<z.ZodNumber>;
2321
+ respectLunchBreak: z.ZodDefault<z.ZodBoolean>;
2322
+ respectSchedule: z.ZodDefault<z.ZodBoolean>;
2323
+ action: z.ZodDefault<z.ZodEnum<["badge", "notify"]>>;
2324
+ }, "strip", z.ZodTypeAny, {
2325
+ enabled: boolean;
2326
+ action: "badge" | "notify";
2327
+ staleDoingMinutes: number;
2328
+ respectLunchBreak: boolean;
2329
+ respectSchedule: boolean;
2330
+ }, {
2331
+ enabled?: boolean | undefined;
2332
+ action?: "badge" | "notify" | undefined;
2333
+ staleDoingMinutes?: number | undefined;
2334
+ respectLunchBreak?: boolean | undefined;
2335
+ respectSchedule?: boolean | undefined;
2336
+ }>>;
2337
+ }, "strip", z.ZodTypeAny, {
2338
+ id: string;
2339
+ name: string;
2340
+ source: {
2341
+ type: "gitlab";
2342
+ projects: string[];
2343
+ };
2344
+ labels: {
2345
+ name: string;
2346
+ color: string;
2347
+ description?: string | undefined;
2348
+ }[];
2349
+ columns: {
2350
+ id: string;
2351
+ title: string;
2352
+ kind: "open-backlog" | "scoped-label" | "closed" | "label";
2353
+ scopedPrefix: string;
2354
+ mapsToLabel?: string | undefined;
2355
+ scopedLabel?: string | undefined;
2356
+ accent?: string | undefined;
2357
+ }[];
2358
+ timeRangeDays: number;
2359
+ closedWindowDays: number;
2360
+ reconciliation: {
2361
+ enabled: boolean;
2362
+ action: "badge" | "notify";
2363
+ staleDoingMinutes: number;
2364
+ respectLunchBreak: boolean;
2365
+ respectSchedule: boolean;
2366
+ };
2367
+ primaryToolLabel?: string | undefined;
2368
+ }, {
2369
+ id: string;
2370
+ name: string;
2371
+ source: {
2372
+ type: "gitlab";
2373
+ projects: string[];
2374
+ };
2375
+ primaryToolLabel?: string | undefined;
2376
+ labels?: {
2377
+ name: string;
2378
+ description?: string | undefined;
2379
+ color?: string | undefined;
2380
+ }[] | undefined;
2381
+ columns?: {
2382
+ id: string;
2383
+ title: string;
2384
+ kind?: "open-backlog" | "scoped-label" | "closed" | "label" | undefined;
2385
+ mapsToLabel?: string | undefined;
2386
+ scopedLabel?: string | undefined;
2387
+ scopedPrefix?: string | undefined;
2388
+ accent?: string | undefined;
2389
+ }[] | undefined;
2390
+ timeRangeDays?: number | undefined;
2391
+ closedWindowDays?: number | undefined;
2392
+ reconciliation?: {
2393
+ enabled?: boolean | undefined;
2394
+ action?: "badge" | "notify" | undefined;
2395
+ staleDoingMinutes?: number | undefined;
2396
+ respectLunchBreak?: boolean | undefined;
2397
+ respectSchedule?: boolean | undefined;
2398
+ } | undefined;
2399
+ }>, "many">>;
2400
+ dashboard: z.ZodDefault<z.ZodObject<{
2401
+ enabled: z.ZodDefault<z.ZodBoolean>;
2402
+ port: z.ZodDefault<z.ZodNumber>;
2403
+ bind: z.ZodDefault<z.ZodString>;
2404
+ token: z.ZodOptional<z.ZodString>;
2405
+ daemonUrl: z.ZodDefault<z.ZodString>;
2406
+ daemons: z.ZodDefault<z.ZodArray<z.ZodObject<{
2407
+ name: z.ZodString;
2408
+ url: z.ZodString;
2409
+ dashboardUrl: z.ZodOptional<z.ZodString>;
2410
+ token: z.ZodOptional<z.ZodString>;
2411
+ dashboardToken: z.ZodOptional<z.ZodString>;
2412
+ }, "strip", z.ZodTypeAny, {
2413
+ name: string;
2414
+ url: string;
2415
+ token?: string | undefined;
2416
+ dashboardUrl?: string | undefined;
2417
+ dashboardToken?: string | undefined;
2418
+ }, {
2419
+ name: string;
2420
+ url: string;
2421
+ token?: string | undefined;
2422
+ dashboardUrl?: string | undefined;
2423
+ dashboardToken?: string | undefined;
2424
+ }>, "many">>;
2425
+ draftAgent: z.ZodOptional<z.ZodString>;
2426
+ }, "strip", z.ZodTypeAny, {
2427
+ enabled: boolean;
2428
+ port: number;
2429
+ bind: string;
2430
+ daemonUrl: string;
2431
+ daemons: {
2432
+ name: string;
2433
+ url: string;
2434
+ token?: string | undefined;
2435
+ dashboardUrl?: string | undefined;
2436
+ dashboardToken?: string | undefined;
2437
+ }[];
2438
+ token?: string | undefined;
2439
+ draftAgent?: string | undefined;
2440
+ }, {
2441
+ enabled?: boolean | undefined;
2442
+ token?: string | undefined;
2443
+ port?: number | undefined;
2444
+ bind?: string | undefined;
2445
+ daemonUrl?: string | undefined;
2446
+ daemons?: {
2447
+ name: string;
2448
+ url: string;
2449
+ token?: string | undefined;
2450
+ dashboardUrl?: string | undefined;
2451
+ dashboardToken?: string | undefined;
2452
+ }[] | undefined;
2453
+ draftAgent?: string | undefined;
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">>;
2480
+ /** Session cache-reuse policy. `staleMinutes` controls how long a Claude
2481
+ * session can idle before we rebuild the prompt from scratch (paying the
2482
+ * full cache-create tax again). Longer is cheaper at Opus rates but means
2483
+ * an agent may resume with mildly outdated context. */
2484
+ session: z.ZodDefault<z.ZodObject<{
2485
+ staleMinutes: z.ZodDefault<z.ZodNumber>;
2486
+ }, "strip", z.ZodTypeAny, {
2487
+ staleMinutes: number;
2488
+ }, {
2489
+ staleMinutes?: number | undefined;
2490
+ }>>;
2185
2491
  }, "strip", z.ZodTypeAny, {
2186
2492
  agents: Record<string, {
2187
2493
  name: string;
@@ -2189,6 +2495,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2189
2495
  tier: "claude-code" | "sdk" | "orchestrator";
2190
2496
  mentions: string[];
2191
2497
  maxConcurrent: number;
2498
+ maxExecutionMinutes: number;
2192
2499
  permissionMode: string;
2193
2500
  queueMode: "collect" | "followup" | "drop";
2194
2501
  heartbeat: {
@@ -2197,6 +2504,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2197
2504
  channel: string;
2198
2505
  intervalMinutes: number;
2199
2506
  };
2507
+ access: "private" | "public";
2200
2508
  provider?: string | undefined;
2201
2509
  model?: string | undefined;
2202
2510
  systemPrompt?: string | undefined;
@@ -2239,6 +2547,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2239
2547
  gitlabUsernames: string[];
2240
2548
  keywords: string[];
2241
2549
  token?: string | undefined;
2550
+ node?: string | undefined;
2242
2551
  }[];
2243
2552
  token?: string | undefined;
2244
2553
  webhookSecret?: string | undefined;
@@ -2270,6 +2579,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2270
2579
  token?: string | undefined;
2271
2580
  agentBinding?: string | undefined;
2272
2581
  };
2582
+ slack: {
2583
+ enabled: boolean;
2584
+ agentBinding?: string | undefined;
2585
+ botToken?: string | undefined;
2586
+ appToken?: string | undefined;
2587
+ };
2273
2588
  };
2274
2589
  crons: Record<string, {
2275
2590
  enabled: boolean;
@@ -2278,13 +2593,14 @@ declare const daemonConfigSchema: z.ZodObject<{
2278
2593
  timeout: number;
2279
2594
  schedule: string;
2280
2595
  timezone: string;
2281
- onError: ("log" | "notify" | "disable")[];
2596
+ onError: ("notify" | "log" | "disable")[];
2282
2597
  model?: string | undefined;
2283
2598
  notify?: {
2284
2599
  channel: string;
2285
2600
  chatId: string;
2286
2601
  accountId?: string | undefined;
2287
2602
  } | undefined;
2603
+ maxOutputTokens?: number | undefined;
2288
2604
  }>;
2289
2605
  services: Record<string, {
2290
2606
  agent: string;
@@ -2316,6 +2632,64 @@ declare const daemonConfigSchema: z.ZodObject<{
2316
2632
  accountId?: string | undefined;
2317
2633
  } | undefined;
2318
2634
  };
2635
+ boards: {
2636
+ id: string;
2637
+ name: string;
2638
+ source: {
2639
+ type: "gitlab";
2640
+ projects: string[];
2641
+ };
2642
+ labels: {
2643
+ name: string;
2644
+ color: string;
2645
+ description?: string | undefined;
2646
+ }[];
2647
+ columns: {
2648
+ id: string;
2649
+ title: string;
2650
+ kind: "open-backlog" | "scoped-label" | "closed" | "label";
2651
+ scopedPrefix: string;
2652
+ mapsToLabel?: string | undefined;
2653
+ scopedLabel?: string | undefined;
2654
+ accent?: string | undefined;
2655
+ }[];
2656
+ timeRangeDays: number;
2657
+ closedWindowDays: number;
2658
+ reconciliation: {
2659
+ enabled: boolean;
2660
+ action: "badge" | "notify";
2661
+ staleDoingMinutes: number;
2662
+ respectLunchBreak: boolean;
2663
+ respectSchedule: boolean;
2664
+ };
2665
+ primaryToolLabel?: string | undefined;
2666
+ }[];
2667
+ dashboard: {
2668
+ enabled: boolean;
2669
+ port: number;
2670
+ bind: string;
2671
+ daemonUrl: string;
2672
+ daemons: {
2673
+ name: string;
2674
+ url: string;
2675
+ token?: string | undefined;
2676
+ dashboardUrl?: string | undefined;
2677
+ dashboardToken?: string | undefined;
2678
+ }[];
2679
+ token?: string | undefined;
2680
+ draftAgent?: string | undefined;
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
+ }[];
2690
+ session: {
2691
+ staleMinutes: number;
2692
+ };
2319
2693
  business?: {
2320
2694
  enabled: boolean;
2321
2695
  timezone: string;
@@ -2344,12 +2718,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2344
2718
  orgChart: Record<string, {
2345
2719
  role: string;
2346
2720
  schedule: {
2721
+ end: string;
2347
2722
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
2348
2723
  start: string;
2349
- end: string;
2350
2724
  lunch?: {
2351
- start: string;
2352
2725
  end: string;
2726
+ start: string;
2353
2727
  } | undefined;
2354
2728
  };
2355
2729
  utilizationTarget: number;
@@ -2362,8 +2736,8 @@ declare const daemonConfigSchema: z.ZodObject<{
2362
2736
  node: {
2363
2737
  id: string;
2364
2738
  name: string;
2365
- defaultAgent?: string | undefined;
2366
2739
  bind?: string | undefined;
2740
+ defaultAgent?: string | undefined;
2367
2741
  };
2368
2742
  agents?: Record<string, {
2369
2743
  name: string;
@@ -2374,6 +2748,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2374
2748
  systemPrompt?: string | undefined;
2375
2749
  mentions?: string[] | undefined;
2376
2750
  maxConcurrent?: number | undefined;
2751
+ maxExecutionMinutes?: number | undefined;
2377
2752
  permissionMode?: string | undefined;
2378
2753
  queueMode?: "collect" | "followup" | "drop" | undefined;
2379
2754
  heartbeat?: {
@@ -2382,6 +2757,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2382
2757
  channel?: string | undefined;
2383
2758
  intervalMinutes?: number | undefined;
2384
2759
  } | undefined;
2760
+ access?: "private" | "public" | undefined;
2385
2761
  }> | undefined;
2386
2762
  mesh?: {
2387
2763
  enabled?: boolean | undefined;
@@ -2417,6 +2793,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2417
2793
  token?: string | undefined;
2418
2794
  gitlabUsernames?: string[] | undefined;
2419
2795
  keywords?: string[] | undefined;
2796
+ node?: string | undefined;
2420
2797
  }[] | undefined;
2421
2798
  } | undefined;
2422
2799
  telegram?: {
@@ -2446,6 +2823,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2446
2823
  token?: string | undefined;
2447
2824
  agentBinding?: string | undefined;
2448
2825
  } | undefined;
2826
+ slack?: {
2827
+ enabled?: boolean | undefined;
2828
+ agentBinding?: string | undefined;
2829
+ botToken?: string | undefined;
2830
+ appToken?: string | undefined;
2831
+ } | undefined;
2449
2832
  } | undefined;
2450
2833
  crons?: Record<string, {
2451
2834
  agent: string;
@@ -2460,7 +2843,8 @@ declare const daemonConfigSchema: z.ZodObject<{
2460
2843
  chatId: string;
2461
2844
  accountId?: string | undefined;
2462
2845
  } | undefined;
2463
- onError?: "log" | "notify" | "disable" | ("log" | "notify" | "disable")[] | undefined;
2846
+ maxOutputTokens?: number | undefined;
2847
+ onError?: "notify" | "log" | "disable" | ("notify" | "log" | "disable")[] | undefined;
2464
2848
  }> | undefined;
2465
2849
  services?: Record<string, {
2466
2850
  agent: string;
@@ -2520,12 +2904,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2520
2904
  orgChart?: Record<string, {
2521
2905
  role: string;
2522
2906
  schedule: {
2523
- start: string;
2524
2907
  end: string;
2908
+ start: string;
2525
2909
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
2526
2910
  lunch?: {
2527
- start: string;
2528
2911
  end: string;
2912
+ start: string;
2529
2913
  } | undefined;
2530
2914
  };
2531
2915
  reportsTo?: string | undefined;
@@ -2534,6 +2918,64 @@ declare const daemonConfigSchema: z.ZodObject<{
2534
2918
  workTickMinutes?: number | undefined;
2535
2919
  idleQueueThreshold?: number | undefined;
2536
2920
  } | undefined;
2921
+ boards?: {
2922
+ id: string;
2923
+ name: string;
2924
+ source: {
2925
+ type: "gitlab";
2926
+ projects: string[];
2927
+ };
2928
+ primaryToolLabel?: string | undefined;
2929
+ labels?: {
2930
+ name: string;
2931
+ description?: string | undefined;
2932
+ color?: string | undefined;
2933
+ }[] | undefined;
2934
+ columns?: {
2935
+ id: string;
2936
+ title: string;
2937
+ kind?: "open-backlog" | "scoped-label" | "closed" | "label" | undefined;
2938
+ mapsToLabel?: string | undefined;
2939
+ scopedLabel?: string | undefined;
2940
+ scopedPrefix?: string | undefined;
2941
+ accent?: string | undefined;
2942
+ }[] | undefined;
2943
+ timeRangeDays?: number | undefined;
2944
+ closedWindowDays?: number | undefined;
2945
+ reconciliation?: {
2946
+ enabled?: boolean | undefined;
2947
+ action?: "badge" | "notify" | undefined;
2948
+ staleDoingMinutes?: number | undefined;
2949
+ respectLunchBreak?: boolean | undefined;
2950
+ respectSchedule?: boolean | undefined;
2951
+ } | undefined;
2952
+ }[] | undefined;
2953
+ dashboard?: {
2954
+ enabled?: boolean | undefined;
2955
+ token?: string | undefined;
2956
+ port?: number | undefined;
2957
+ bind?: string | undefined;
2958
+ daemonUrl?: string | undefined;
2959
+ daemons?: {
2960
+ name: string;
2961
+ url: string;
2962
+ token?: string | undefined;
2963
+ dashboardUrl?: string | undefined;
2964
+ dashboardToken?: string | undefined;
2965
+ }[] | undefined;
2966
+ draftAgent?: string | undefined;
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;
2976
+ session?: {
2977
+ staleMinutes?: number | undefined;
2978
+ } | undefined;
2537
2979
  }>;
2538
2980
  type DaemonConfig = z.infer<typeof daemonConfigSchema>;
2539
2981
  type AgentDef = z.infer<typeof agentConfigSchema>;
@@ -2608,10 +3050,30 @@ declare class AgentXDaemon {
2608
3050
  private webhooks;
2609
3051
  private log;
2610
3052
  private sseClients;
3053
+ private configPath?;
3054
+ private configWatcher?;
3055
+ private reloadTimer?;
2611
3056
  constructor(configPath?: string);
2612
3057
  start(): Promise<void>;
2613
3058
  stop(): Promise<void>;
2614
3059
  private midnightTimer?;
3060
+ /**
3061
+ * Watch agentx.json for external edits (e.g. `agentx config set ...`) and
3062
+ * reload cron jobs + in-memory config. Channels / agents / mesh changes
3063
+ * still require a restart — we log a warning so the operator knows.
3064
+ */
3065
+ private startConfigWatcher;
3066
+ /**
3067
+ * Re-read agentx.json, diff against the in-memory config, apply what we
3068
+ * can hot-reload (crons, notify-destination, business metadata), and warn
3069
+ * about sections that require a daemon restart (channels, agents, mesh,
3070
+ * node.bind, providers).
3071
+ */
3072
+ reload(): Promise<{
3073
+ applied: string[];
3074
+ restartRequired: string[];
3075
+ error?: string;
3076
+ }>;
2615
3077
  private scheduleMidnightHook;
2616
3078
  private runDailyCostReport;
2617
3079
  private startChannels;
@@ -2625,6 +3087,12 @@ declare class AgentXDaemon {
2625
3087
  * GET /events — streams daemon logs in real-time.
2626
3088
  */
2627
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;
2628
3096
  private handleHttp;
2629
3097
  /**
2630
3098
  * OpenAI-compatible chat completions endpoint.
@@ -2641,9 +3109,24 @@ declare class AgentXDaemon {
2641
3109
  private json;
2642
3110
  }
2643
3111
 
2644
- interface DailyUsage {
2645
- date: string;
2646
- agents: Record<string, AgentUsage>;
3112
+ declare const CACHE_AWARE_PRICING: Record<string, {
3113
+ input: number;
3114
+ output: number;
3115
+ cacheRead: number;
3116
+ cacheCreate: number;
3117
+ }>;
3118
+ interface ChannelUsage {
3119
+ tasks: number;
3120
+ inputTokens: number;
3121
+ outputTokens: number;
3122
+ cacheReadTokens: number;
3123
+ cacheCreateTokens: number;
3124
+ tier2InputTokens: number;
3125
+ tier2OutputTokens: number;
3126
+ tier2CacheReadTokens: number;
3127
+ tier2CacheCreateTokens: number;
3128
+ totalDuration: number;
3129
+ errors: number;
2647
3130
  }
2648
3131
  interface AgentUsage {
2649
3132
  tasks: number;
@@ -2651,9 +3134,26 @@ interface AgentUsage {
2651
3134
  outputTokens: number;
2652
3135
  cacheReadTokens: number;
2653
3136
  cacheCreateTokens: number;
3137
+ /** Tokens from requests whose input crossed CONTEXT_TIER_THRESHOLD (billed at
3138
+ * TIER2_MULTIPLIER × normal rate). Kept separate from the tier1 buckets so
3139
+ * cost math stays honest when a session accumulates past 200K. */
3140
+ tier2InputTokens?: number;
3141
+ tier2OutputTokens?: number;
3142
+ tier2CacheReadTokens?: number;
3143
+ tier2CacheCreateTokens?: number;
2654
3144
  totalDuration: number;
2655
3145
  errors: number;
2656
3146
  model?: string;
3147
+ /** Per-channel breakdown so we can attribute cost to Telegram vs GitLab vs WhatsApp. */
3148
+ byChannel?: Record<string, ChannelUsage>;
3149
+ /** Unique session identifiers (channel:chatId) this agent participated in
3150
+ * today. Used to derive avg tasks/session. Capped at 500 entries to keep
3151
+ * the daily JSON small. */
3152
+ sessionKeys?: string[];
3153
+ }
3154
+ interface DailyUsage {
3155
+ date: string;
3156
+ agents: Record<string, AgentUsage>;
2657
3157
  }
2658
3158
  interface DailyReport {
2659
3159
  date: string;
@@ -2666,24 +3166,50 @@ interface DailyReport {
2666
3166
  topAgent: string;
2667
3167
  topCost: number;
2668
3168
  agentCosts: Record<string, number>;
3169
+ /** Per-agent avg tasks/session — high values suggest retry chains. */
3170
+ agentSessionStats: Record<string, {
3171
+ sessions: number;
3172
+ avgTasksPerSession: number;
3173
+ }>;
3174
+ /** Aggregate cost by channel across all agents. */
3175
+ byChannel: Record<string, number>;
3176
+ }
3177
+ /** Shape of a per-request usage report coming from the runtime. Keeps the
3178
+ * record() signature tidy and lets callers opt into tier2 accounting. */
3179
+ interface TaskUsage {
3180
+ inputTokens: number;
3181
+ outputTokens: number;
3182
+ cacheReadTokens: number;
3183
+ cacheCreateTokens: number;
2669
3184
  }
2670
3185
  declare class TokenTracker {
2671
3186
  private dir;
2672
3187
  private cache;
3188
+ private pricing;
2673
3189
  constructor(baseDir?: string);
3190
+ /** Returns the active pricing table (hardcoded defaults with any per-model
3191
+ * overrides merged in). Useful for UI / debugging. */
3192
+ getPricing(): typeof CACHE_AWARE_PRICING;
3193
+ /**
3194
+ * Calculate cost for a slice of usage. Accepts either a full AgentUsage or
3195
+ * a narrowed ChannelUsage — both expose the same token buckets we price on.
3196
+ * Tier2 tokens are billed at TIER2_MULTIPLIER × the normal rate.
3197
+ */
3198
+ static calculateCost(usage: AgentUsage | ChannelUsage, model?: string, pricingTable?: typeof CACHE_AWARE_PRICING): number;
2674
3199
  /**
2675
- * Calculate cost for an agent's usage with cache-aware pricing.
3200
+ * Instance-level cost calculation — uses the tracker's resolved pricing
3201
+ * table so any custom override file is honored. Prefer this over the
3202
+ * static variant when available.
2676
3203
  */
2677
- static calculateCost(usage: AgentUsage): number;
3204
+ cost(usage: AgentUsage | ChannelUsage, model?: string): number;
2678
3205
  /**
2679
3206
  * Record a task execution with real or estimated token counts.
3207
+ *
3208
+ * `channel` attributes the cost to a surface (telegram/gitlab/whatsapp/cron).
3209
+ * `sessionKey` is an opaque "this chat on this day" identifier — we use it
3210
+ * to count unique sessions so an avg-tasks-per-session metric falls out.
2680
3211
  */
2681
- record(agentId: string, duration: number, realUsage?: {
2682
- inputTokens: number;
2683
- outputTokens: number;
2684
- cacheReadTokens: number;
2685
- cacheCreateTokens: number;
2686
- }, messageLength?: number, responseLength?: number, error?: boolean, model?: string): void;
3212
+ record(agentId: string, duration: number, realUsage?: TaskUsage, messageLength?: number, responseLength?: number, error?: boolean, model?: string, channel?: string, sessionKey?: string): void;
2687
3213
  /**
2688
3214
  * Get today's usage summary.
2689
3215
  */
@@ -2693,11 +3219,13 @@ declare class TokenTracker {
2693
3219
  */
2694
3220
  getDate(date: string): DailyUsage | null;
2695
3221
  /**
2696
- * Generate a daily cost report for a given date.
3222
+ * Generate a daily cost report for a given date. Includes per-agent,
3223
+ * per-channel costs and session statistics.
2697
3224
  */
2698
3225
  generateDailyReport(date?: string): DailyReport | null;
2699
3226
  /**
2700
- * Append a daily report row to TOKEN_COSTS.md.
3227
+ * Append a daily report row to TOKEN_COSTS.md. Adds channel + session
3228
+ * breakdown inline for at-a-glance spend attribution.
2701
3229
  */
2702
3230
  appendToTokenCosts(report: DailyReport, filePath?: string): void;
2703
3231
  /**
@@ -2723,6 +3251,14 @@ declare class TokenTracker {
2723
3251
  avgDuration: number;
2724
3252
  cost: number;
2725
3253
  }>;
3254
+ byChannel: Record<string, {
3255
+ tasks: number;
3256
+ cost: number;
3257
+ }>;
3258
+ sessionStats: Record<string, {
3259
+ sessions: number;
3260
+ avgTasksPerSession: number;
3261
+ }>;
2726
3262
  };
2727
3263
  private filePath;
2728
3264
  private save;
@@ -2737,6 +3273,13 @@ interface AgentPeer {
2737
3273
  interface AgentTask {
2738
3274
  message: string;
2739
3275
  agentId: string;
3276
+ /** Per-invocation model override (e.g. cron model). Falls back to agent.model. */
3277
+ model?: string;
3278
+ /** Cacheable text delivered to Claude via --append-system-prompt. Typically
3279
+ * agent.systemPrompt + SOUL/IDENTITY/AGENTS.md. Passing stable content
3280
+ * here (instead of in the user-message body) keeps it inside Claude's
3281
+ * cached system prompt across session resumes. */
3282
+ systemPromptAppend?: string;
2740
3283
  context?: {
2741
3284
  channel?: string;
2742
3285
  sender?: string;
@@ -2784,6 +3327,12 @@ interface AgentResponse {
2784
3327
  duration?: number;
2785
3328
  claudeSessionId?: string;
2786
3329
  usage?: TokenUsage;
3330
+ /** The model Claude actually billed for (from the CLI's init event). When
3331
+ * absent, cost reporting should fall back to the model override / agent
3332
+ * config. Knowing the billed model is what makes cache-aware pricing
3333
+ * trustworthy — a task that ran sonnet but was logged as opus would
3334
+ * overstate cost by ~5×. */
3335
+ billedModel?: string;
2787
3336
  }
2788
3337
  /** Callback for streaming text deltas */
2789
3338
  type StreamCallback = (delta: string, fullText: string) => void;
@@ -2815,7 +3364,7 @@ declare function executeOrchestrator(agent: AgentDef, task: AgentTask, apiKey?:
2815
3364
  */
2816
3365
  declare function executeTask(agent: AgentDef, task: AgentTask, providers: Record<string, {
2817
3366
  apiKey?: string;
2818
- }>, onDelta?: StreamCallback, historyContext?: string, resumeSessionId?: string): Promise<AgentResponse>;
3367
+ }>, onDelta?: StreamCallback, historyContext?: string, resumeSessionId?: string, onEvent?: (event: any) => void): Promise<AgentResponse>;
2819
3368
 
2820
3369
  type WikiAccess = "private" | "shared" | "public";
2821
3370
  /**
@@ -3076,16 +3625,26 @@ declare class LandscapeBuilder {
3076
3625
  private config;
3077
3626
  private meshPeers;
3078
3627
  constructor(config: DaemonConfig);
3628
+ /** Fingerprint of the peer set that produced the current cache. A rebuild
3629
+ * is skipped when `refresh()` gets a topologically-identical set — this
3630
+ * is the common case on every mesh heartbeat and rebuilding would
3631
+ * needlessly invalidate every agent's cached prompt prefix. */
3632
+ private fingerprint;
3079
3633
  /**
3080
3634
  * Build landscape strings for all agents. Call at startup.
3081
3635
  */
3082
3636
  build(meshPeers?: MeshPeerInfo[]): void;
3637
+ /** Set-only signature of peers + their skill IDs. Health is excluded on
3638
+ * purpose — we don't want a flapping heartbeat to rebuild the cache. */
3639
+ private computeFingerprint;
3083
3640
  /**
3084
3641
  * Get the cached landscape string for a specific agent.
3085
3642
  */
3086
3643
  getForAgent(agentId: string): string | undefined;
3087
3644
  /**
3088
- * Rebuild after mesh topology changes.
3645
+ * Rebuild after mesh topology changes. Skipped when the peer set is
3646
+ * unchanged so a flapping health heartbeat doesn't invalidate every
3647
+ * agent's cached prompt prefix.
3089
3648
  */
3090
3649
  refresh(meshPeers: MeshPeerInfo[]): void;
3091
3650
  private renderForAgent;
@@ -3101,6 +3660,39 @@ declare class LandscapeBuilder {
3101
3660
  private extractCapability;
3102
3661
  }
3103
3662
 
3663
+ interface RunningTask {
3664
+ /** Unique id for this execution (timestamp-based). */
3665
+ id: string;
3666
+ /** First 200 chars of the user message, for display. */
3667
+ messagePreview: string;
3668
+ /** Origin channel (telegram, whatsapp, gitlab, api, cron, business, a2a, …). */
3669
+ channel: string;
3670
+ /** Group / chat / issue id from which the task arrived. */
3671
+ chatId?: string;
3672
+ /** Sender id/name (user, agent id, "cron:<id>", "mesh:<peer>", …). */
3673
+ sender?: string;
3674
+ /** Wall-clock start. */
3675
+ startedAt: Date;
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
+ }
3104
3696
  declare class AgentRegistry {
3105
3697
  private agents;
3106
3698
  private config;
@@ -3115,6 +3707,12 @@ declare class AgentRegistry {
3115
3707
  private messageQueue;
3116
3708
  /** Active soul profile per agent+chat session: "agentId:channel:chatId" → profile name */
3117
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;
3118
3716
  private log;
3119
3717
  constructor(config: DaemonConfig, log?: (...args: unknown[]) => void);
3120
3718
  /**
@@ -3128,8 +3726,17 @@ declare class AgentRegistry {
3128
3726
  /**
3129
3727
  * Find agent by mention pattern (e.g., "@my_bot" -> "my-agent").
3130
3728
  * Returns the agent with the longest (most specific) mention match.
3729
+ *
3730
+ * When `atMentionsOnly` is true, only `@`-prefixed mentions are considered.
3731
+ * This is used for messages originating from another bot (cross-daemon
3732
+ * Telegram cascades, for example) where we don't want bare-word matches
3733
+ * like "nadia" in prose or "devops-mtgl" quoted in a reply to trigger
3734
+ * agents spuriously. Intentional handoffs still work because agents
3735
+ * write explicit `@noqta_X_bot` handles.
3131
3736
  */
3132
- findByMention(text: string): string | undefined;
3737
+ findByMention(text: string, opts?: {
3738
+ atMentionsOnly?: boolean;
3739
+ }): string | undefined;
3133
3740
  /**
3134
3741
  * Find ALL agents mentioned in text (for bot-to-bot detection).
3135
3742
  */
@@ -3155,12 +3762,64 @@ declare class AgentRegistry {
3155
3762
  id: string;
3156
3763
  name: string;
3157
3764
  tier: string;
3765
+ model?: string;
3158
3766
  workspace: string;
3159
3767
  active: number;
3160
3768
  total: number;
3161
3769
  errors: number;
3162
3770
  lastActive?: Date;
3771
+ runningTasks: RunningTask[];
3772
+ lastSummary?: {
3773
+ text: string;
3774
+ at: string;
3775
+ ok: boolean;
3776
+ };
3777
+ hourlyTasks?: number[];
3163
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;
3164
3823
  /**
3165
3824
  * Get token usage summary.
3166
3825
  */
@@ -3184,6 +3843,14 @@ declare class AgentRegistry {
3184
3843
  avgDuration: number;
3185
3844
  cost: number;
3186
3845
  }>;
3846
+ byChannel: Record<string, {
3847
+ tasks: number;
3848
+ cost: number;
3849
+ }>;
3850
+ sessionStats: Record<string, {
3851
+ sessions: number;
3852
+ avgTasksPerSession: number;
3853
+ }>;
3187
3854
  };
3188
3855
  /**
3189
3856
  * Get today's usage.
@@ -3227,6 +3894,10 @@ interface IncomingMessage {
3227
3894
  id: string;
3228
3895
  name: string;
3229
3896
  username?: string;
3897
+ /** True when the origin is another bot account (Telegram `from.is_bot`).
3898
+ * Used by the router to apply strict @-mention-only routing — prevents
3899
+ * cross-daemon cascades from bare-word matches in bot replies. */
3900
+ isBot?: boolean;
3230
3901
  };
3231
3902
  group?: {
3232
3903
  id: string;
@@ -3243,6 +3914,7 @@ interface IncomingMessage {
3243
3914
  };
3244
3915
  raw?: unknown;
3245
3916
  resolvedAgent?: string;
3917
+ preferNode?: string;
3246
3918
  channelMeta?: ChannelMeta;
3247
3919
  }
3248
3920
  interface OutgoingMessage {
@@ -3359,39 +4031,39 @@ declare const orgEntrySchema: z.ZodObject<{
3359
4031
  start: z.ZodString;
3360
4032
  end: z.ZodString;
3361
4033
  }, "strip", z.ZodTypeAny, {
3362
- start: string;
3363
4034
  end: string;
3364
- }, {
3365
4035
  start: string;
4036
+ }, {
3366
4037
  end: string;
4038
+ start: string;
3367
4039
  }>>;
3368
4040
  }, "strip", z.ZodTypeAny, {
4041
+ end: string;
3369
4042
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
3370
4043
  start: string;
3371
- end: string;
3372
4044
  lunch?: {
3373
- start: string;
3374
4045
  end: string;
4046
+ start: string;
3375
4047
  } | undefined;
3376
4048
  }, {
3377
- start: string;
3378
4049
  end: string;
4050
+ start: string;
3379
4051
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
3380
4052
  lunch?: {
3381
- start: string;
3382
4053
  end: string;
4054
+ start: string;
3383
4055
  } | undefined;
3384
4056
  }>;
3385
4057
  utilizationTarget: z.ZodDefault<z.ZodNumber>;
3386
4058
  }, "strip", z.ZodTypeAny, {
3387
4059
  role: string;
3388
4060
  schedule: {
4061
+ end: string;
3389
4062
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
3390
4063
  start: string;
3391
- end: string;
3392
4064
  lunch?: {
3393
- start: string;
3394
4065
  end: string;
4066
+ start: string;
3395
4067
  } | undefined;
3396
4068
  };
3397
4069
  utilizationTarget: number;
@@ -3399,12 +4071,12 @@ declare const orgEntrySchema: z.ZodObject<{
3399
4071
  }, {
3400
4072
  role: string;
3401
4073
  schedule: {
3402
- start: string;
3403
4074
  end: string;
4075
+ start: string;
3404
4076
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
3405
4077
  lunch?: {
3406
- start: string;
3407
4078
  end: string;
4079
+ start: string;
3408
4080
  } | undefined;
3409
4081
  };
3410
4082
  reportsTo?: string | undefined;
@@ -3484,39 +4156,39 @@ declare const businessConfigSchema: z.ZodObject<{
3484
4156
  start: z.ZodString;
3485
4157
  end: z.ZodString;
3486
4158
  }, "strip", z.ZodTypeAny, {
3487
- start: string;
3488
4159
  end: string;
3489
- }, {
3490
4160
  start: string;
4161
+ }, {
3491
4162
  end: string;
4163
+ start: string;
3492
4164
  }>>;
3493
4165
  }, "strip", z.ZodTypeAny, {
4166
+ end: string;
3494
4167
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
3495
4168
  start: string;
3496
- end: string;
3497
4169
  lunch?: {
3498
- start: string;
3499
4170
  end: string;
4171
+ start: string;
3500
4172
  } | undefined;
3501
4173
  }, {
3502
- start: string;
3503
4174
  end: string;
4175
+ start: string;
3504
4176
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
3505
4177
  lunch?: {
3506
- start: string;
3507
4178
  end: string;
4179
+ start: string;
3508
4180
  } | undefined;
3509
4181
  }>;
3510
4182
  utilizationTarget: z.ZodDefault<z.ZodNumber>;
3511
4183
  }, "strip", z.ZodTypeAny, {
3512
4184
  role: string;
3513
4185
  schedule: {
4186
+ end: string;
3514
4187
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
3515
4188
  start: string;
3516
- end: string;
3517
4189
  lunch?: {
3518
- start: string;
3519
4190
  end: string;
4191
+ start: string;
3520
4192
  } | undefined;
3521
4193
  };
3522
4194
  utilizationTarget: number;
@@ -3524,12 +4196,12 @@ declare const businessConfigSchema: z.ZodObject<{
3524
4196
  }, {
3525
4197
  role: string;
3526
4198
  schedule: {
3527
- start: string;
3528
4199
  end: string;
4200
+ start: string;
3529
4201
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
3530
4202
  lunch?: {
3531
- start: string;
3532
4203
  end: string;
4204
+ start: string;
3533
4205
  } | undefined;
3534
4206
  };
3535
4207
  reportsTo?: string | undefined;
@@ -3567,12 +4239,12 @@ declare const businessConfigSchema: z.ZodObject<{
3567
4239
  orgChart: Record<string, {
3568
4240
  role: string;
3569
4241
  schedule: {
4242
+ end: string;
3570
4243
  days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
3571
4244
  start: string;
3572
- end: string;
3573
4245
  lunch?: {
3574
- start: string;
3575
4246
  end: string;
4247
+ start: string;
3576
4248
  } | undefined;
3577
4249
  };
3578
4250
  utilizationTarget: number;
@@ -3608,12 +4280,12 @@ declare const businessConfigSchema: z.ZodObject<{
3608
4280
  orgChart?: Record<string, {
3609
4281
  role: string;
3610
4282
  schedule: {
3611
- start: string;
3612
4283
  end: string;
4284
+ start: string;
3613
4285
  days?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | undefined;
3614
4286
  lunch?: {
3615
- start: string;
3616
4287
  end: string;
4288
+ start: string;
3617
4289
  } | undefined;
3618
4290
  };
3619
4291
  reportsTo?: string | undefined;
@@ -3665,6 +4337,28 @@ interface WorkItem {
3665
4337
  estimatedSeconds?: number;
3666
4338
  url?: string;
3667
4339
  priority?: number;
4340
+ /** Board stage derived from labels (kanban column id). */
4341
+ stage?: "triage" | "todo" | "doing" | "onhold" | "review" | "done";
4342
+ /** Raw labels from the source (GitLab). Empty array if source doesn't support labels. */
4343
+ labels?: string[];
4344
+ /** Label name+color when the source returns colored labels (GitLab with_labels_details). */
4345
+ labelDetails?: Array<{
4346
+ name: string;
4347
+ color: string;
4348
+ text_color?: string;
4349
+ }>;
4350
+ /** ISO timestamp of last update on the source. */
4351
+ updatedAt?: string;
4352
+ /** Open/closed state from the source. */
4353
+ state?: "opened" | "closed";
4354
+ /** Optional milestone title (GitLab: issue.milestone.title). */
4355
+ milestone?: string;
4356
+ /** GitLab assignees (0..n). `assignee` above is the agentId alias for assignees[0]. */
4357
+ assignees?: Array<{
4358
+ username: string;
4359
+ name?: string;
4360
+ avatarUrl?: string;
4361
+ }>;
3668
4362
  }
3669
4363
  interface WorkReport {
3670
4364
  status: "in-progress" | "done" | "blocked";
@@ -3672,11 +4366,61 @@ interface WorkReport {
3672
4366
  timeSeconds?: number;
3673
4367
  blocker?: string;
3674
4368
  }
4369
+ /** What a WorkSource can do beyond the minimal listOpen/claim/report triple. */
4370
+ interface WorkSourceCapabilities {
4371
+ /** Enumerate items beyond assignee filter — required for a board view. */
4372
+ listAll: boolean;
4373
+ /** Create new items (e.g. POST GitLab issue). */
4374
+ create: boolean;
4375
+ /** Arbitrary column transitions (label add/remove pair). */
4376
+ transition: boolean;
4377
+ /** Surfaces labels[] on returned items. */
4378
+ labels: boolean;
4379
+ /** Server-side text search. */
4380
+ search: boolean;
4381
+ }
4382
+ interface WorkCreateInput {
4383
+ title: string;
4384
+ description?: string;
4385
+ /** agentId */
4386
+ assignee?: string;
4387
+ /** Raw GitLab usernames — bypass agentId resolution for UI-driven creates. */
4388
+ assigneeUsernames?: string[];
4389
+ labels?: string[];
4390
+ /** Milestone title (resolved to id). */
4391
+ milestoneTitle?: string;
4392
+ /** For sources that span multiple projects (gitlab): "group/project". */
4393
+ projectHint?: string;
4394
+ }
4395
+ interface ListAllOpts {
4396
+ sinceDays?: number;
4397
+ labels?: string[];
4398
+ /** Exclude items carrying any of these labels (client-side filter). */
4399
+ notLabels?: string[];
4400
+ /** Exclude items whose labels carry this scoped prefix (e.g. "Status"). */
4401
+ withoutScopedPrefix?: string;
4402
+ search?: string;
4403
+ assignee?: string;
4404
+ /** GitLab issue state. Defaults to "opened" (boards hide closed issues). */
4405
+ state?: "opened" | "closed" | "all";
4406
+ /** Milestone filter (GitLab "milestone" query param). */
4407
+ milestone?: string;
4408
+ }
3675
4409
  interface WorkSource {
3676
4410
  type: string;
4411
+ capabilities: WorkSourceCapabilities;
3677
4412
  listOpen(agentId: string): Promise<WorkItem[]>;
3678
4413
  claim(agentId: string, itemId: string): Promise<void>;
3679
4414
  report(itemId: string, update: WorkReport): Promise<void>;
4415
+ /** Optional — gated by capabilities.listAll. */
4416
+ listAll?(opts: ListAllOpts): Promise<WorkItem[]>;
4417
+ /** Optional — gated by capabilities.create. */
4418
+ create?(input: WorkCreateInput): Promise<WorkItem>;
4419
+ /**
4420
+ * Optional — gated by capabilities.transition. Add `toLabel` and remove
4421
+ * `fromLabel` (if provided) from the item. Used by the kanban board on drag.
4422
+ */
4423
+ transition?(itemId: string, toLabel: string, fromLabel?: string): Promise<void>;
3680
4424
  }
3681
4425
 
3682
4426
  declare class Reporter {
@@ -3783,7 +4527,40 @@ declare class MessageRouter {
3783
4527
  private business?;
3784
4528
  private groupLog;
3785
4529
  private log;
4530
+ /**
4531
+ * Short-TTL cache of recently processed incoming message IDs, keyed by
4532
+ * `<channel>:<accountId>:<id>`. Prevents duplicate replies from:
4533
+ * - GitLab webhook retries (same object_attributes.id redelivered)
4534
+ * - WhatsApp Baileys double-emitting messages.upsert (notify + append)
4535
+ * - Telegram polling re-delivering an update after a long-poll hiccup
4536
+ * - A daemon crash-loop replaying messages the previous process had
4537
+ * already handled (fixed by persisting this map to disk — see below)
4538
+ *
4539
+ * The key INCLUDES accountId so two bots in the same Telegram group
4540
+ * (different accountId) both get to run their routing logic — the router's
4541
+ * downstream boundAccount check then picks the one bot that should actually
4542
+ * reply. Without accountId in the key, the second bot's legitimate view of
4543
+ * the same Telegram message_id would be wrongly suppressed.
4544
+ *
4545
+ * Persisted to .agentx/router/dedup.json so survival-across-restart is not
4546
+ * just a Telegram concern — the same universal LRU covers every channel.
4547
+ * Writes are debounced (every 20 new ids, or 5s, whichever first) and the
4548
+ * file is pruned to only live TTL entries before each write.
4549
+ */
4550
+ private recentMessageIds;
4551
+ private readonly MESSAGE_ID_TTL_MS;
4552
+ private readonly MESSAGE_ID_MAX_ENTRIES;
4553
+ private readonly DEDUP_STORE_PATH;
4554
+ private dedupDirtyCount;
4555
+ private dedupSaveTimer?;
4556
+ /** Crash-safe inflight log (see InflightLog class above). */
4557
+ private inflight;
3786
4558
  constructor(registry: AgentRegistry, config: DaemonConfig, hooks?: HookRegistry, log?: (...args: unknown[]) => void);
4559
+ private loadDedupFromDisk;
4560
+ private scheduleDedupSave;
4561
+ private flushDedupToDisk;
4562
+ /** Called by the daemon on graceful shutdown so no in-memory ids are lost. */
4563
+ flushPersistence(): void;
3787
4564
  setMesh(mesh: A2AMesh): void;
3788
4565
  setServiceMatcher(matcher: ServiceMatcher): void;
3789
4566
  setBusiness(business: BusinessLayer): void;
@@ -3800,8 +4577,22 @@ declare class MessageRouter {
3800
4577
  /** List registered channel names. */
3801
4578
  getChannelNames(): string[];
3802
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;
3803
4586
  stopAll(): Promise<void>;
4587
+ /**
4588
+ * Returns true if this message id was processed within MESSAGE_ID_TTL_MS.
4589
+ * Stamps the key when false. Size-bounded GC avoids unbounded growth.
4590
+ */
4591
+ private isDuplicateMessage;
3804
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;
3805
4596
  private static readonly MAX_BOT_CHAIN_DEPTH;
3806
4597
  /**
3807
4598
  * Bot-to-bot conversation chain.
@@ -3820,6 +4611,16 @@ declare class MessageRouter {
3820
4611
  * Searches peer agent cards for mention matches.
3821
4612
  */
3822
4613
  private handleViaMesh;
4614
+ /**
4615
+ * Route to a mesh peer by resolved agentId (not text matching).
4616
+ * Used when the channel adapter resolved the agent but it's not local.
4617
+ */
4618
+ private handleViaMeshByAgentId;
4619
+ /**
4620
+ * Route to a specific named mesh peer by agentId.
4621
+ * Used when preferNode is set on the incoming message.
4622
+ */
4623
+ private handleViaMeshByPeer;
3823
4624
  private getAccountForAgent;
3824
4625
  private resolveAgent;
3825
4626
  }
@@ -3831,7 +4632,7 @@ interface TelegramAccountConfig {
3831
4632
  declare class TelegramAdapter implements ChannelAdapter {
3832
4633
  readonly name = "telegram";
3833
4634
  private accounts;
3834
- private offsets;
4635
+ private offsetStore;
3835
4636
  private handler?;
3836
4637
  private polling;
3837
4638
  private log;
@@ -3906,11 +4707,18 @@ declare class WhatsAppAdapter implements ChannelAdapter {
3906
4707
  private generation;
3907
4708
  private sentMessageIds;
3908
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?;
3909
4715
  constructor(config: {
3910
4716
  sessionDir: string;
3911
4717
  defaultAgent?: string;
3912
4718
  allowFrom?: string[];
3913
4719
  routes?: WhatsAppRoute[];
4720
+ onQR?: (qr: string | null) => void;
4721
+ onStatus?: (status: "connecting" | "open" | "close", detail?: string) => void;
3914
4722
  }, log?: (...args: unknown[]) => void);
3915
4723
  /**
3916
4724
  * Resolve which agent handles a message based on routes.
@@ -3934,6 +4742,11 @@ interface CronJobState {
3934
4742
  prompt: string;
3935
4743
  timeout: number;
3936
4744
  model?: string;
4745
+ /** Soft output-length cap appended to the prompt at invocation time.
4746
+ * Claude Code CLI has no hard flag for this, so we instruct the model
4747
+ * via the prompt tail; reliably honored and keeps cache-hit intact
4748
+ * (hint text is per-job, not per-run). */
4749
+ maxOutputTokens?: number;
3937
4750
  onError: Array<"log" | "notify" | "disable">;
3938
4751
  lastRun?: Date;
3939
4752
  nextRun?: Date;
@@ -4065,6 +4878,17 @@ declare const logger: {
4065
4878
 
4066
4879
  declare function handleError(error: unknown): void;
4067
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
+ */
4068
4892
  declare function getPackageInfo(): PackageJson;
4069
4893
 
4070
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 };