comisai 1.0.36 → 1.0.37

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 (239) hide show
  1. package/node_modules/@comis/agent/dist/background/auto-background-middleware.js +9 -0
  2. package/node_modules/@comis/agent/dist/background/background-task-manager.d.ts +22 -2
  3. package/node_modules/@comis/agent/dist/background/background-task-manager.js +48 -41
  4. package/node_modules/@comis/agent/dist/background/background-task-persistence.js +28 -5
  5. package/node_modules/@comis/agent/dist/background/background-task-types.d.ts +49 -0
  6. package/node_modules/@comis/agent/dist/background/completion-dispatcher.d.ts +130 -0
  7. package/node_modules/@comis/agent/dist/background/completion-dispatcher.js +215 -0
  8. package/node_modules/@comis/agent/dist/background/completion-runner.d.ts +10 -1
  9. package/node_modules/@comis/agent/dist/background/completion-runner.js +98 -15
  10. package/node_modules/@comis/agent/dist/background/index.d.ts +6 -1
  11. package/node_modules/@comis/agent/dist/background/index.js +2 -0
  12. package/node_modules/@comis/agent/dist/background/session-resolver.d.ts +85 -0
  13. package/node_modules/@comis/agent/dist/background/session-resolver.js +78 -0
  14. package/node_modules/@comis/agent/dist/bootstrap/sections/messaging-sections.js +1 -0
  15. package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.js +3 -3
  16. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +30 -2
  17. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +51 -2
  18. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.d.ts +22 -0
  19. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.js +2 -2
  20. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.d.ts +1 -5
  21. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.js +2 -14
  22. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +26 -0
  23. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +3 -0
  24. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +9 -0
  25. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +73 -2
  26. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.d.ts +10 -10
  27. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.js +14 -14
  28. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.d.ts +11 -13
  29. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.js +14 -15
  30. package/node_modules/@comis/agent/dist/executor/capability-index-context.d.ts +72 -0
  31. package/node_modules/@comis/agent/dist/executor/capability-index-context.js +329 -0
  32. package/node_modules/@comis/agent/dist/executor/drain-helper.d.ts +122 -0
  33. package/node_modules/@comis/agent/dist/executor/drain-helper.js +173 -0
  34. package/node_modules/@comis/agent/dist/executor/error-classifier.js +2 -2
  35. package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +48 -4
  36. package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +134 -31
  37. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +7 -0
  38. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +25 -4
  39. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.d.ts +18 -1
  40. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +19 -16
  41. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.d.ts +11 -2
  42. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.js +16 -2
  43. package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +8 -2
  44. package/node_modules/@comis/agent/dist/executor/pi-executor.js +25 -12
  45. package/node_modules/@comis/agent/dist/executor/prompt-assembly.d.ts +9 -1
  46. package/node_modules/@comis/agent/dist/executor/prompt-assembly.js +15 -1
  47. package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +18 -27
  48. package/node_modules/@comis/agent/dist/executor/tool-deferral.js +29 -38
  49. package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +1 -1
  50. package/node_modules/@comis/agent/dist/model/model-scanner.js +1 -1
  51. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.d.ts +11 -1
  52. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.js +19 -22
  53. package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +16 -2
  54. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.d.ts +1 -1
  55. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +5 -5
  56. package/node_modules/@comis/agent/dist/workspace/data-env.d.ts +38 -0
  57. package/node_modules/@comis/agent/dist/workspace/data-env.js +56 -0
  58. package/node_modules/@comis/agent/dist/workspace/index.d.ts +1 -0
  59. package/node_modules/@comis/agent/dist/workspace/index.js +1 -0
  60. package/node_modules/@comis/agent/dist/workspace/templates.js +5 -1
  61. package/node_modules/@comis/agent/package.json +1 -1
  62. package/node_modules/@comis/channels/dist/index.d.ts +1 -1
  63. package/node_modules/@comis/channels/dist/index.js +1 -1
  64. package/node_modules/@comis/channels/dist/shared/channel-manager.d.ts +9 -3
  65. package/node_modules/@comis/channels/dist/shared/inbound-gate.d.ts +1 -1
  66. package/node_modules/@comis/channels/dist/shared/inbound-gate.js +22 -7
  67. package/node_modules/@comis/channels/dist/shared/inbound-pipeline.d.ts +10 -3
  68. package/node_modules/@comis/channels/dist/shared/inbound-route.d.ts +1 -1
  69. package/node_modules/@comis/channels/dist/shared/inbound-route.js +13 -2
  70. package/node_modules/@comis/channels/dist/shared/response-filter.d.ts +11 -24
  71. package/node_modules/@comis/channels/dist/shared/response-filter.js +25 -53
  72. package/node_modules/@comis/channels/package.json +1 -1
  73. package/node_modules/@comis/cli/dist/commands/providers.d.ts +1 -2
  74. package/node_modules/@comis/cli/dist/commands/providers.js +5 -6
  75. package/node_modules/@comis/cli/package.json +1 -1
  76. package/node_modules/@comis/core/dist/config/field-metadata.js +2 -0
  77. package/node_modules/@comis/core/dist/config/immutable-keys.js +4 -1
  78. package/node_modules/@comis/core/dist/config/index.d.ts +4 -0
  79. package/node_modules/@comis/core/dist/config/index.js +2 -0
  80. package/node_modules/@comis/core/dist/config/schema-agent.d.ts +0 -792
  81. package/node_modules/@comis/core/dist/config/schema-approvals.d.ts +0 -14
  82. package/node_modules/@comis/core/dist/config/schema-auto-reply-engine.d.ts +0 -6
  83. package/node_modules/@comis/core/dist/config/schema-background-tasks.d.ts +0 -12
  84. package/node_modules/@comis/core/dist/config/schema-browser.d.ts +0 -18
  85. package/node_modules/@comis/core/dist/config/schema-channel.d.ts +0 -158
  86. package/node_modules/@comis/core/dist/config/schema-coalescer.d.ts +0 -5
  87. package/node_modules/@comis/core/dist/config/schema-daemon.d.ts +0 -32
  88. package/node_modules/@comis/core/dist/config/schema-delivery.d.ts +0 -18
  89. package/node_modules/@comis/core/dist/config/schema-documentation.d.ts +0 -12
  90. package/node_modules/@comis/core/dist/config/schema-embedding.d.ts +0 -20
  91. package/node_modules/@comis/core/dist/config/schema-envelope.d.ts +0 -15
  92. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +0 -37
  93. package/node_modules/@comis/core/dist/config/schema-gemini-cache.d.ts +0 -2
  94. package/node_modules/@comis/core/dist/config/schema-integrations.d.ts +0 -318
  95. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.d.ts +0 -18
  96. package/node_modules/@comis/core/dist/config/schema-memory-review.d.ts +0 -7
  97. package/node_modules/@comis/core/dist/config/schema-memory.d.ts +0 -16
  98. package/node_modules/@comis/core/dist/config/schema-messages.d.ts +0 -8
  99. package/node_modules/@comis/core/dist/config/schema-models.d.ts +0 -15
  100. package/node_modules/@comis/core/dist/config/schema-notification.d.ts +0 -5
  101. package/node_modules/@comis/core/dist/config/schema-oauth.d.ts +0 -5
  102. package/node_modules/@comis/core/dist/config/schema-observability.d.ts +0 -38
  103. package/node_modules/@comis/core/dist/config/schema-output-retention.d.ts +34 -0
  104. package/node_modules/@comis/core/dist/config/schema-output-retention.js +48 -0
  105. package/node_modules/@comis/core/dist/config/schema-plugins.d.ts +0 -8
  106. package/node_modules/@comis/core/dist/config/schema-providers.d.ts +0 -64
  107. package/node_modules/@comis/core/dist/config/schema-queue.d.ts +0 -58
  108. package/node_modules/@comis/core/dist/config/schema-response-prefix.d.ts +0 -2
  109. package/node_modules/@comis/core/dist/config/schema-retry.d.ts +0 -6
  110. package/node_modules/@comis/core/dist/config/schema-scheduler.d.ts +0 -39
  111. package/node_modules/@comis/core/dist/config/schema-secrets.d.ts +0 -3
  112. package/node_modules/@comis/core/dist/config/schema-security.d.ts +0 -18
  113. package/node_modules/@comis/core/dist/config/schema-send-policy.d.ts +0 -13
  114. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.d.ts +0 -5
  115. package/node_modules/@comis/core/dist/config/schema-serializer.js +2 -0
  116. package/node_modules/@comis/core/dist/config/schema-skills.d.ts +0 -61
  117. package/node_modules/@comis/core/dist/config/schema-streaming.d.ts +0 -38
  118. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.d.ts +0 -3
  119. package/node_modules/@comis/core/dist/config/schema-tooling.d.ts +87 -0
  120. package/node_modules/@comis/core/dist/config/schema-tooling.js +152 -0
  121. package/node_modules/@comis/core/dist/config/schema-verbosity.d.ts +0 -12
  122. package/node_modules/@comis/core/dist/config/schema-webhooks.d.ts +0 -40
  123. package/node_modules/@comis/core/dist/config/schema.d.ts +41 -38
  124. package/node_modules/@comis/core/dist/config/schema.js +6 -0
  125. package/node_modules/@comis/core/dist/context/context.d.ts +0 -4
  126. package/node_modules/@comis/core/dist/domain/approval-request.d.ts +0 -17
  127. package/node_modules/@comis/core/dist/domain/background-task-origin.d.ts +0 -10
  128. package/node_modules/@comis/core/dist/domain/delivery-origin.d.ts +0 -5
  129. package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +0 -48
  130. package/node_modules/@comis/core/dist/domain/memory-entry.d.ts +0 -3
  131. package/node_modules/@comis/core/dist/domain/model-compat.d.ts +0 -4
  132. package/node_modules/@comis/core/dist/domain/normalized-message.d.ts +0 -15
  133. package/node_modules/@comis/core/dist/domain/provider-capabilities.d.ts +0 -6
  134. package/node_modules/@comis/core/dist/domain/rich-message.d.ts +0 -14
  135. package/node_modules/@comis/core/dist/domain/subagent-context-config.d.ts +0 -22
  136. package/node_modules/@comis/core/dist/domain/subagent-context-types.d.ts +0 -8
  137. package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +31 -0
  138. package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +5 -0
  139. package/node_modules/@comis/core/dist/exports/config.d.ts +2 -2
  140. package/node_modules/@comis/core/dist/exports/config.js +3 -1
  141. package/node_modules/@comis/core/dist/exports/hooks.d.ts +1 -1
  142. package/node_modules/@comis/core/dist/exports/ports.d.ts +2 -2
  143. package/node_modules/@comis/core/dist/exports/ports.js +1 -1
  144. package/node_modules/@comis/core/dist/ports/channel-plugin.d.ts +0 -13
  145. package/node_modules/@comis/core/dist/ports/index.d.ts +2 -0
  146. package/node_modules/@comis/core/dist/ports/index.js +4 -0
  147. package/node_modules/@comis/core/dist/ports/no-op-tool-capability.d.ts +30 -0
  148. package/node_modules/@comis/core/dist/ports/no-op-tool-capability.js +47 -0
  149. package/node_modules/@comis/core/dist/ports/tool-capability.d.ts +165 -0
  150. package/node_modules/@comis/core/dist/ports/tool-capability.js +15 -0
  151. package/node_modules/@comis/core/dist/security/audit.d.ts +0 -11
  152. package/node_modules/@comis/core/dist/tool-metadata.d.ts +21 -1
  153. package/node_modules/@comis/core/dist/tool-metadata.js +1 -1
  154. package/node_modules/@comis/core/package.json +1 -1
  155. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/validate-skill.py +1 -1
  156. package/node_modules/@comis/daemon/dist/daemon.js +89 -14
  157. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.d.ts +1 -1
  158. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.js +1 -1
  159. package/node_modules/@comis/daemon/dist/rpc/builtin-provider-guard.js +2 -2
  160. package/node_modules/@comis/daemon/dist/rpc/credential-resolver.js +1 -1
  161. package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +1 -1
  162. package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +2 -2
  163. package/node_modules/@comis/daemon/dist/sub-agent-runner.d.ts +18 -0
  164. package/node_modules/@comis/daemon/dist/sub-agent-runner.js +41 -9
  165. package/node_modules/@comis/daemon/dist/wiring/index.d.ts +2 -0
  166. package/node_modules/@comis/daemon/dist/wiring/index.js +1 -0
  167. package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +36 -2
  168. package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +45 -8
  169. package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.d.ts +28 -9
  170. package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.js +36 -9
  171. package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.js +2 -2
  172. package/node_modules/@comis/daemon/dist/wiring/setup-channels.d.ts +9 -2
  173. package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +15 -9
  174. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.d.ts +20 -5
  175. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +20 -15
  176. package/node_modules/@comis/daemon/dist/wiring/setup-delivery.js +14 -2
  177. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.d.ts +4 -6
  178. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +3 -5
  179. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.d.ts +20 -5
  180. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.js +11 -2
  181. package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.d.ts +89 -0
  182. package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.js +212 -0
  183. package/node_modules/@comis/daemon/dist/wiring/setup-tools.d.ts +18 -4
  184. package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +29 -10
  185. package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.d.ts +75 -0
  186. package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.js +253 -0
  187. package/node_modules/@comis/daemon/package.json +1 -1
  188. package/node_modules/@comis/gateway/dist/webhook/webhook-endpoint.d.ts +0 -4
  189. package/node_modules/@comis/gateway/package.json +1 -1
  190. package/node_modules/@comis/infra/package.json +1 -1
  191. package/node_modules/@comis/memory/package.json +1 -1
  192. package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +0 -42
  193. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.d.ts +29 -8
  194. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.js +19 -7
  195. package/node_modules/@comis/scheduler/dist/system-events/system-event-types.d.ts +0 -3
  196. package/node_modules/@comis/scheduler/dist/tasks/task-types.d.ts +0 -17
  197. package/node_modules/@comis/scheduler/package.json +1 -1
  198. package/node_modules/@comis/shared/dist/index.d.ts +3 -0
  199. package/node_modules/@comis/shared/dist/index.js +4 -0
  200. package/node_modules/@comis/shared/dist/mcp-tool-name.d.ts +78 -0
  201. package/node_modules/@comis/shared/dist/mcp-tool-name.js +92 -0
  202. package/node_modules/@comis/shared/dist/silent-tokens.d.ts +38 -0
  203. package/node_modules/@comis/shared/dist/silent-tokens.js +51 -0
  204. package/node_modules/@comis/shared/dist/visible-delivery.d.ts +28 -0
  205. package/node_modules/@comis/shared/dist/visible-delivery.js +16 -0
  206. package/node_modules/@comis/shared/package.json +1 -1
  207. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.d.ts +2 -13
  208. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.js +3 -21
  209. package/node_modules/@comis/skills/dist/bridge/tool-metadata-enforcement.js +1 -1
  210. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +4 -4
  211. package/node_modules/@comis/skills/dist/builtin/exec-tool.d.ts +55 -9
  212. package/node_modules/@comis/skills/dist/builtin/exec-tool.js +383 -19
  213. package/node_modules/@comis/skills/dist/builtin/install-detour.d.ts +67 -0
  214. package/node_modules/@comis/skills/dist/builtin/install-detour.js +342 -0
  215. package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +5 -5
  216. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +2 -2
  217. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +2 -2
  218. package/node_modules/@comis/skills/dist/builtin/platform/message-tool.js +18 -0
  219. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.d.ts +18 -1
  220. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.js +18 -2
  221. package/node_modules/@comis/skills/dist/builtin/platform/models-manage-tool.js +3 -3
  222. package/node_modules/@comis/skills/dist/builtin/process-registry.d.ts +14 -0
  223. package/node_modules/@comis/skills/dist/builtin/process-tool.d.ts +24 -4
  224. package/node_modules/@comis/skills/dist/builtin/process-tool.js +25 -7
  225. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.d.ts +1 -1
  226. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.js +9 -0
  227. package/node_modules/@comis/skills/dist/index.d.ts +4 -1
  228. package/node_modules/@comis/skills/dist/index.js +3 -1
  229. package/node_modules/@comis/skills/dist/manifest/capability-parser.d.ts +44 -0
  230. package/node_modules/@comis/skills/dist/manifest/capability-parser.js +68 -0
  231. package/node_modules/@comis/skills/dist/manifest/schema.d.ts +44 -37
  232. package/node_modules/@comis/skills/dist/manifest/schema.js +35 -0
  233. package/node_modules/@comis/skills/dist/registry/discovery.d.ts +8 -0
  234. package/node_modules/@comis/skills/dist/registry/discovery.js +10 -3
  235. package/node_modules/@comis/skills/dist/registry/skill-registry.d.ts +45 -1
  236. package/node_modules/@comis/skills/dist/registry/skill-registry.js +70 -7
  237. package/node_modules/@comis/skills/package.json +1 -1
  238. package/node_modules/@comis/web/package.json +1 -1
  239. package/package.json +21 -21
@@ -6,32 +6,20 @@ import { z } from "zod";
6
6
  * fallback model entries, auth profile rotation, and failover configuration.
7
7
  */
8
8
  export declare const BudgetConfigSchema: z.ZodObject<{
9
- /** Max tokens per single execution */
10
9
  perExecution: z.ZodDefault<z.ZodNumber>;
11
- /** Max tokens per hour (rolling window) */
12
10
  perHour: z.ZodDefault<z.ZodNumber>;
13
- /** Max tokens per day (rolling window) */
14
11
  perDay: z.ZodDefault<z.ZodNumber>;
15
12
  }, z.core.$strict>;
16
13
  export declare const CircuitBreakerConfigSchema: z.ZodObject<{
17
- /** Number of consecutive failures before opening circuit */
18
14
  failureThreshold: z.ZodDefault<z.ZodNumber>;
19
- /** Milliseconds to wait before attempting recovery */
20
15
  resetTimeoutMs: z.ZodDefault<z.ZodNumber>;
21
- /** Milliseconds for half-open probe timeout */
22
16
  halfOpenTimeoutMs: z.ZodDefault<z.ZodNumber>;
23
17
  }, z.core.$strict>;
24
18
  export declare const ToolRetryBreakerConfigSchema: z.ZodObject<{
25
- /** Enable tool retry circuit breaker. Default: true. */
26
19
  enabled: z.ZodDefault<z.ZodBoolean>;
27
- /** Max consecutive failures for same tool+args before blocking. Default: 3. */
28
20
  maxConsecutiveFailures: z.ZodDefault<z.ZodNumber>;
29
- /** Max total failures for a tool name (any args) before blocking all calls. Default: 5. */
30
21
  maxToolFailures: z.ZodDefault<z.ZodNumber>;
31
- /** Suggest alternative tools in block reason. Default: true. */
32
22
  suggestAlternatives: z.ZodDefault<z.ZodBoolean>;
33
- /** Max consecutive same-error-class failures (any args) before blocking. Default: 2.
34
- * Stricter than args-based because same error + different args = stronger stuck signal. */
35
23
  maxConsecutiveErrorPatterns: z.ZodDefault<z.ZodNumber>;
36
24
  }, z.core.$strict>;
37
25
  /**
@@ -52,9 +40,7 @@ export declare const ModelRoutesSchema: z.ZodDefault<z.ZodObject<{
52
40
  * Schema for a single fallback model entry (provider + modelId pair).
53
41
  */
54
42
  export declare const FallbackModelSchema: z.ZodObject<{
55
- /** LLM provider (e.g. "anthropic", "openai") */
56
43
  provider: z.ZodString;
57
- /** Model identifier at the provider */
58
44
  modelId: z.ZodString;
59
45
  }, z.core.$strict>;
60
46
  /**
@@ -64,9 +50,7 @@ export declare const FallbackModelSchema: z.ZodObject<{
64
50
  * multiple API keys per provider for rotation during rate limiting.
65
51
  */
66
52
  export declare const AuthProfileSchema: z.ZodObject<{
67
- /** Key name in SecretManager (e.g. "ANTHROPIC_API_KEY_2") */
68
53
  keyName: z.ZodString;
69
- /** Provider this key belongs to (e.g. "anthropic") */
70
54
  provider: z.ZodString;
71
55
  }, z.core.$strict>;
72
56
  /**
@@ -76,35 +60,22 @@ export declare const AuthProfileSchema: z.ZodObject<{
76
60
  * with exponential cooldowns, and model allowlisting.
77
61
  */
78
62
  export declare const ModelFailoverConfigSchema: z.ZodObject<{
79
- /** Ordered list of fallback models to try when primary fails */
80
63
  fallbackModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
81
- /** LLM provider (e.g. "anthropic", "openai") */
82
64
  provider: z.ZodString;
83
- /** Model identifier at the provider */
84
65
  modelId: z.ZodString;
85
66
  }, z.core.$strict>>>;
86
- /** Per-provider API key profiles for auth rotation */
87
67
  authProfiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
88
- /** Key name in SecretManager (e.g. "ANTHROPIC_API_KEY_2") */
89
68
  keyName: z.ZodString;
90
- /** Provider this key belongs to (e.g. "anthropic") */
91
69
  provider: z.ZodString;
92
70
  }, z.core.$strict>>>;
93
- /** Model allowlist (empty = allow all models) */
94
71
  allowedModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
95
- /** Maximum total attempts across all models/keys */
96
72
  maxAttempts: z.ZodDefault<z.ZodNumber>;
97
- /** Initial cooldown duration in milliseconds (1 min) */
98
73
  cooldownInitialMs: z.ZodDefault<z.ZodNumber>;
99
- /** Exponential cooldown multiplier */
100
74
  cooldownMultiplier: z.ZodDefault<z.ZodNumber>;
101
- /** Maximum cooldown duration in milliseconds (1 hr) */
102
75
  cooldownCapMs: z.ZodDefault<z.ZodNumber>;
103
76
  }, z.core.$strict>;
104
77
  export declare const PromptTimeoutConfigSchema: z.ZodObject<{
105
- /** Wall-clock timeout for primary prompt calls in milliseconds. Default: 180s. */
106
78
  promptTimeoutMs: z.ZodDefault<z.ZodNumber>;
107
- /** Wall-clock timeout for retry prompt calls in milliseconds. Default: 60s. */
108
79
  retryPromptTimeoutMs: z.ZodDefault<z.ZodNumber>;
109
80
  }, z.core.$strict>;
110
81
  /**
@@ -122,9 +93,7 @@ export type ModelOperationType = "interactive" | "cron" | "heartbeat" | "subagen
122
93
  * smart defaults. When timeout is unset, per-operation timeout defaults apply.
123
94
  */
124
95
  export declare const OperationModelEntrySchema: z.ZodObject<{
125
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
126
96
  model: z.ZodOptional<z.ZodString>;
127
- /** Timeout override in milliseconds for this operation type. */
128
97
  timeout: z.ZodOptional<z.ZodNumber>;
129
98
  }, z.core.$strict>;
130
99
  export type OperationModelEntry = z.infer<typeof OperationModelEntrySchema>;
@@ -140,39 +109,27 @@ export type OperationModelEntry = z.infer<typeof OperationModelEntrySchema>;
140
109
  */
141
110
  export declare const OperationModelsSchema: z.ZodDefault<z.ZodObject<{
142
111
  cron: z.ZodOptional<z.ZodObject<{
143
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
144
112
  model: z.ZodOptional<z.ZodString>;
145
- /** Timeout override in milliseconds for this operation type. */
146
113
  timeout: z.ZodOptional<z.ZodNumber>;
147
114
  }, z.core.$strict>>;
148
115
  heartbeat: z.ZodOptional<z.ZodObject<{
149
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
150
116
  model: z.ZodOptional<z.ZodString>;
151
- /** Timeout override in milliseconds for this operation type. */
152
117
  timeout: z.ZodOptional<z.ZodNumber>;
153
118
  }, z.core.$strict>>;
154
119
  subagent: z.ZodOptional<z.ZodObject<{
155
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
156
120
  model: z.ZodOptional<z.ZodString>;
157
- /** Timeout override in milliseconds for this operation type. */
158
121
  timeout: z.ZodOptional<z.ZodNumber>;
159
122
  }, z.core.$strict>>;
160
123
  compaction: z.ZodOptional<z.ZodObject<{
161
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
162
124
  model: z.ZodOptional<z.ZodString>;
163
- /** Timeout override in milliseconds for this operation type. */
164
125
  timeout: z.ZodOptional<z.ZodNumber>;
165
126
  }, z.core.$strict>>;
166
127
  taskExtraction: z.ZodOptional<z.ZodObject<{
167
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
168
128
  model: z.ZodOptional<z.ZodString>;
169
- /** Timeout override in milliseconds for this operation type. */
170
129
  timeout: z.ZodOptional<z.ZodNumber>;
171
130
  }, z.core.$strict>>;
172
131
  condensation: z.ZodOptional<z.ZodObject<{
173
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
174
132
  model: z.ZodOptional<z.ZodString>;
175
- /** Timeout override in milliseconds for this operation type. */
176
133
  timeout: z.ZodOptional<z.ZodNumber>;
177
134
  }, z.core.$strict>>;
178
135
  }, z.core.$strict>>;
@@ -196,18 +153,14 @@ export type OperationModels = z.infer<typeof OperationModelsSchema>;
196
153
  * All fields are optional -- omitted fields inherit from the parent policy.
197
154
  */
198
155
  export declare const ResetPolicyOverrideSchema: z.ZodObject<{
199
- /** Override reset mode for this session type */
200
156
  mode: z.ZodOptional<z.ZodEnum<{
201
157
  daily: "daily";
202
158
  idle: "idle";
203
159
  hybrid: "hybrid";
204
160
  none: "none";
205
161
  }>>;
206
- /** Override daily reset hour (0-23) */
207
162
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
208
- /** Override IANA timezone for daily reset */
209
163
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
210
- /** Override idle timeout in milliseconds */
211
164
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
212
165
  }, z.core.$strict>;
213
166
  /**
@@ -215,68 +168,49 @@ export declare const ResetPolicyOverrideSchema: z.ZodObject<{
215
168
  * Controls automatic session expiry via daily, idle, or hybrid modes.
216
169
  */
217
170
  export declare const SessionResetPolicySchema: z.ZodObject<{
218
- /** Reset mode: daily, idle, hybrid (first-to-expire), or none (disabled) */
219
171
  mode: z.ZodDefault<z.ZodEnum<{
220
172
  daily: "daily";
221
173
  idle: "idle";
222
174
  hybrid: "hybrid";
223
175
  none: "none";
224
176
  }>>;
225
- /** Hour of day for daily reset (0-23, default 4 = 4 AM) */
226
177
  dailyResetHour: z.ZodDefault<z.ZodNumber>;
227
- /** IANA timezone for daily reset (empty string = system local) */
228
178
  dailyResetTimezone: z.ZodDefault<z.ZodString>;
229
- /** Idle timeout in milliseconds (default 4 hours = 14_400_000) */
230
179
  idleTimeoutMs: z.ZodDefault<z.ZodNumber>;
231
- /** Sweep interval in milliseconds (how often to check sessions, default 5 min) */
232
180
  sweepIntervalMs: z.ZodDefault<z.ZodNumber>;
233
- /** Phrases that trigger immediate session reset when sent as a message */
234
181
  resetTriggers: z.ZodDefault<z.ZodArray<z.ZodString>>;
235
- /** Per-session-type overrides (dm, group, thread) */
236
182
  perType: z.ZodDefault<z.ZodObject<{
237
183
  dm: z.ZodOptional<z.ZodObject<{
238
- /** Override reset mode for this session type */
239
184
  mode: z.ZodOptional<z.ZodEnum<{
240
185
  daily: "daily";
241
186
  idle: "idle";
242
187
  hybrid: "hybrid";
243
188
  none: "none";
244
189
  }>>;
245
- /** Override daily reset hour (0-23) */
246
190
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
247
- /** Override IANA timezone for daily reset */
248
191
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
249
- /** Override idle timeout in milliseconds */
250
192
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
251
193
  }, z.core.$strict>>;
252
194
  group: z.ZodOptional<z.ZodObject<{
253
- /** Override reset mode for this session type */
254
195
  mode: z.ZodOptional<z.ZodEnum<{
255
196
  daily: "daily";
256
197
  idle: "idle";
257
198
  hybrid: "hybrid";
258
199
  none: "none";
259
200
  }>>;
260
- /** Override daily reset hour (0-23) */
261
201
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
262
- /** Override IANA timezone for daily reset */
263
202
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
264
- /** Override idle timeout in milliseconds */
265
203
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
266
204
  }, z.core.$strict>>;
267
205
  thread: z.ZodOptional<z.ZodObject<{
268
- /** Override reset mode for this session type */
269
206
  mode: z.ZodOptional<z.ZodEnum<{
270
207
  daily: "daily";
271
208
  idle: "idle";
272
209
  hybrid: "hybrid";
273
210
  none: "none";
274
211
  }>>;
275
- /** Override daily reset hour (0-23) */
276
212
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
277
- /** Override IANA timezone for daily reset */
278
213
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
279
- /** Override idle timeout in milliseconds */
280
214
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
281
215
  }, z.core.$strict>>;
282
216
  }, z.core.$strict>>;
@@ -291,16 +225,13 @@ export declare const SessionResetPolicySchema: z.ZodObject<{
291
225
  * - "per-account-channel-peer": includes bot account identifier in channel for multi-bot isolation
292
226
  */
293
227
  export declare const DmScopeConfigSchema: z.ZodObject<{
294
- /** DM scope mode controlling session isolation granularity */
295
228
  mode: z.ZodDefault<z.ZodEnum<{
296
229
  main: "main";
297
230
  "per-peer": "per-peer";
298
231
  "per-channel-peer": "per-channel-peer";
299
232
  "per-account-channel-peer": "per-account-channel-peer";
300
233
  }>>;
301
- /** Prepend agent:<agentId>: to session keys for multi-agent isolation */
302
234
  agentPrefix: z.ZodDefault<z.ZodBoolean>;
303
- /** Append :thread:<threadId> to session keys for forum/thread isolation */
304
235
  threadIsolation: z.ZodDefault<z.ZodBoolean>;
305
236
  }, z.core.$strict>;
306
237
  /**
@@ -310,23 +241,14 @@ export declare const DmScopeConfigSchema: z.ZodObject<{
310
241
  * Pruning operates on copies only -- persisted session data is never affected.
311
242
  */
312
243
  export declare const PruningConfigSchema: z.ZodObject<{
313
- /** Enable session pruning of oversized tool results */
314
244
  enabled: z.ZodDefault<z.ZodBoolean>;
315
- /** Character threshold above which tool results are soft-trimmed (head + tail with marker) */
316
245
  softTrimThresholdChars: z.ZodDefault<z.ZodNumber>;
317
- /** Character threshold above which tool results are hard-cleared (entire content replaced) */
318
246
  hardClearThresholdChars: z.ZodDefault<z.ZodNumber>;
319
- /** Number of characters to preserve at the start of a soft-trimmed result */
320
247
  preserveHeadChars: z.ZodDefault<z.ZodNumber>;
321
- /** Number of characters to preserve at the end of a soft-trimmed result */
322
248
  preserveTailChars: z.ZodDefault<z.ZodNumber>;
323
- /** Tools whose results are eligible for pruning (empty = all tools eligible) */
324
249
  pruneableTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
325
- /** Tools whose results are never pruned (takes precedence over pruneableTools) */
326
250
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
327
- /** Protect tool results containing image content blocks from pruning */
328
251
  protectImageBlocks: z.ZodDefault<z.ZodBoolean>;
329
- /** Number of recent messages (from end of array) exempt from pruning */
330
252
  preserveRecentCount: z.ZodDefault<z.ZodNumber>;
331
253
  }, z.core.$strict>;
332
254
  /**
@@ -337,23 +259,14 @@ export declare const PruningConfigSchema: z.ZodObject<{
337
259
  * using a cheaper model for memory extraction.
338
260
  */
339
261
  export declare const SessionCompactionConfigSchema: z.ZodObject<{
340
- /** Fraction of maxContextChars at which soft flush triggers (memory extraction only) */
341
262
  softThresholdRatio: z.ZodDefault<z.ZodNumber>;
342
- /** Fraction of maxContextChars at which hard compaction triggers (flush + trim) */
343
263
  hardThresholdRatio: z.ZodDefault<z.ZodNumber>;
344
- /** Model to use for memory extraction during flush (defaults to cheap model) */
345
264
  flushModel: z.ZodOptional<z.ZodString>;
346
- /** Max characters per summarization chunk. Default: 50_000. */
347
265
  chunkMaxChars: z.ZodDefault<z.ZodNumber>;
348
- /** Number of overlap messages between chunks. Default: 2. */
349
266
  chunkOverlapMessages: z.ZodDefault<z.ZodNumber>;
350
- /** Whether to merge chunk summaries via LLM. Default: true. */
351
267
  chunkMergeSummaries: z.ZodDefault<z.ZodBoolean>;
352
- /** Tokens reserved for summary during SDK auto-compaction. Default: 16384. */
353
268
  reserveTokens: z.ZodDefault<z.ZodNumber>;
354
- /** Tokens worth of recent messages to keep after SDK auto-compaction. Default: 32768. */
355
269
  keepRecentTokens: z.ZodDefault<z.ZodNumber>;
356
- /** AGENTS.md section names to re-inject after compaction. */
357
270
  postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
358
271
  }, z.core.$strict>;
359
272
  export type SessionResetPolicyConfig = z.infer<typeof SessionResetPolicySchema>;
@@ -382,99 +295,46 @@ export type SessionCompactionConfig = z.infer<typeof SessionCompactionConfigSche
382
295
  */
383
296
  /** Context engine configuration (per-agent). */
384
297
  export declare const ContextEngineConfigSchema: z.ZodObject<{
385
- /** Master toggle for the context engine pipeline (enabled by default). */
386
298
  enabled: z.ZodDefault<z.ZodBoolean>;
387
- /** Operating mode: "pipeline" for sequential layer composition, "dag" for graph-based context management. */
388
299
  version: z.ZodDefault<z.ZodEnum<{
389
300
  pipeline: "pipeline";
390
301
  dag: "dag";
391
302
  }>>;
392
- /** Number of recent assistant turns that retain thinking blocks (older turns get stripped). */
393
303
  thinkingKeepTurns: z.ZodDefault<z.ZodNumber>;
394
- /** Idle gap (ms) above which signed thinking state is treated as drifted and
395
- * scrubbed pre-send to avoid provider replay-rejection. Default 30 min —
396
- * below long-TTL caches and below the 74-min production incident gap. Also
397
- * triggers on model id / provider / api change (those checks are
398
- * unconditional regardless of this idle threshold). Range: 1 min .. 24 h. */
399
304
  replayDriftIdleMs: z.ZodDefault<z.ZodNumber>;
400
- /** Model for LLM compaction in "provider:modelId" format. Empty string
401
- * (the default) triggers runtime resolution against the agent's primary
402
- * provider via pi-ai catalog (fast-tier cost model). Avoids pinning a
403
- * hardcoded Anthropic literal that goes stale on pi-ai upgrades and
404
- * cross-routes background ops to Claude when primary is OpenRouter/Google/etc. */
405
305
  compactionModel: z.ZodDefault<z.ZodString>;
406
- /** Minimum age (in tool result positions) before content is eligible for dead content eviction. */
407
306
  evictionMinAge: z.ZodDefault<z.ZodNumber>;
408
- /** Number of recent user turns to keep in context (default 15). */
409
307
  historyTurns: z.ZodDefault<z.ZodNumber>;
410
- /** Per-agent or per-channel-type turn count overrides (e.g., { dm: 10, "trader-1": 30 }). */
411
308
  historyTurnOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
412
- /** Number of most recent tool uses that retain full content (older ones are masked). */
413
309
  observationKeepWindow: z.ZodDefault<z.ZodNumber>;
414
- /** Character threshold before observation masking activates (below this, masking is skipped). */
415
310
  observationTriggerChars: z.ZodDefault<z.ZodNumber>;
416
- /** Character threshold below which observation masking deactivates (hysteresis). */
417
311
  observationDeactivationChars: z.ZodDefault<z.ZodNumber>;
418
- /** Keep window for ephemeral-tier tools (web_search, brave_search, web_fetch, link_reader, fetch_url). Shorter than observationKeepWindow. Default: 10. */
419
312
  ephemeralKeepWindow: z.ZodDefault<z.ZodNumber>;
420
- /** Turns to wait before re-triggering LLM compaction after a successful compaction. */
421
313
  compactionCooldownTurns: z.ZodDefault<z.ZodNumber>;
422
- /** Number of user-turn cycles at the head of conversation to preserve during
423
- * LLM compaction for cache prefix stability. 0 = old behavior
424
- * (summarize everything, keep tail only). */
425
314
  compactionPrefixAnchorTurns: z.ZodDefault<z.ZodNumber>;
426
- /** Output escalation configuration: auto-retry with higher output budget on max_tokens truncation. */
427
315
  outputEscalation: z.ZodDefault<z.ZodObject<{
428
- /** Master toggle for output escalation. When false, max_tokens truncation is not retried. */
429
316
  enabled: z.ZodDefault<z.ZodBoolean>;
430
- /** Escalated max output tokens for the retry attempt. Must be between 4096 and 128000. */
431
317
  escalatedMaxTokens: z.ZodDefault<z.ZodNumber>;
432
318
  }, z.core.$strict>>;
433
- /** Number of most recent turns always included verbatim in DAG context. */
434
319
  freshTailTurns: z.ZodDefault<z.ZodNumber>;
435
- /** Context utilization fraction that triggers DAG compaction (0.1 to 0.95). */
436
320
  contextThreshold: z.ZodDefault<z.ZodNumber>;
437
- /** Minimum fan-out for leaf nodes in the DAG. */
438
321
  leafMinFanout: z.ZodDefault<z.ZodNumber>;
439
- /** Minimum fan-out for condensed (non-leaf) nodes in the DAG. */
440
322
  condensedMinFanout: z.ZodDefault<z.ZodNumber>;
441
- /** Hard minimum fan-out for condensed nodes (lowest allowed). */
442
323
  condensedMinFanoutHard: z.ZodDefault<z.ZodNumber>;
443
- /** Maximum depth for incremental DAG rebuilds (-1 = full rebuild). */
444
324
  incrementalMaxDepth: z.ZodDefault<z.ZodNumber>;
445
- /** Token budget for leaf node chunks in the DAG. */
446
325
  leafChunkTokens: z.ZodDefault<z.ZodNumber>;
447
- /** Target token size for leaf node summaries. */
448
326
  leafTargetTokens: z.ZodDefault<z.ZodNumber>;
449
- /** Target token size for condensed node summaries. */
450
327
  condensedTargetTokens: z.ZodDefault<z.ZodNumber>;
451
- /** Maximum tokens for expanded context retrieval. */
452
328
  maxExpandTokens: z.ZodDefault<z.ZodNumber>;
453
- /** Maximum recall operations per day per agent. */
454
329
  maxRecallsPerDay: z.ZodDefault<z.ZodNumber>;
455
- /** Timeout for recall operations in milliseconds. */
456
330
  recallTimeoutMs: z.ZodDefault<z.ZodNumber>;
457
- /** Token threshold above which a file is considered "large" for DAG processing. */
458
331
  largeFileTokenThreshold: z.ZodDefault<z.ZodNumber>;
459
- /** Number of most recent annotations retained in DAG mode (analogous to observationKeepWindow). */
460
332
  annotationKeepWindow: z.ZodDefault<z.ZodNumber>;
461
- /** Character threshold before annotation eviction activates in DAG mode. */
462
333
  annotationTriggerChars: z.ZodDefault<z.ZodNumber>;
463
- /** Optional model override for DAG summary generation in "provider:modelId" format. */
464
334
  summaryModel: z.ZodOptional<z.ZodString>;
465
- /** Optional provider override for DAG summary generation. */
466
335
  summaryProvider: z.ZodOptional<z.ZodString>;
467
- /** Post-batch continuation handler: when the LLM emits an empty final
468
- * turn after a successful tool batch, fire a directive followUp with
469
- * multi-shot retry. Replaces the legacy SEP one-shot completeness nudge
470
- * (whose enforcement role was superseded; SEP plan extraction + step
471
- * counting remain intact for observability). */
472
336
  postBatchContinuation: z.ZodDefault<z.ZodObject<{
473
- /** Master toggle. When false, handler returns
474
- * {recovered: false, outcome: "disabled"} without calling followUp. */
475
337
  enabled: z.ZodDefault<z.ZodBoolean>;
476
- /** Maximum directive followUp attempts before falling through to L3
477
- * synthesis. 0 = disabled. */
478
338
  maxRetries: z.ZodDefault<z.ZodNumber>;
479
339
  }, z.core.$strict>>;
480
340
  }, z.core.$strict>;
@@ -490,24 +350,16 @@ export type ContextEngineConfig = z.infer<typeof ContextEngineConfigSchema>;
490
350
  */
491
351
  /** Progressive context pruning configuration (per-agent). */
492
352
  export declare const ContextPruningConfigSchema: z.ZodObject<{
493
- /** Master toggle for progressive context pruning */
494
353
  enabled: z.ZodDefault<z.ZodBoolean>;
495
- /** Context ratio at which soft-trim begins (head+tail preservation) */
496
354
  softTrimRatio: z.ZodDefault<z.ZodNumber>;
497
- /** Context ratio at which hard-clear begins (full placeholder replacement) */
498
355
  hardClearRatio: z.ZodDefault<z.ZodNumber>;
499
- /** Number of recent assistant messages to protect from pruning */
500
356
  keepLastAssistants: z.ZodDefault<z.ZodNumber>;
501
- /** Minimum tool result size in characters eligible for soft-trim */
502
357
  minPrunableToolChars: z.ZodDefault<z.ZodNumber>;
503
- /** Tool names never pruned (strings in config, converted to RegExp patterns at runtime by consumer) */
504
358
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
505
359
  }, z.core.$strict>;
506
360
  /** Source gate configuration for HTTP response size and sanitization (per-agent). */
507
361
  export declare const SourceGateConfigSchema: z.ZodObject<{
508
- /** Default byte cap for HTTP responses (matches DEFAULT_SOURCE_PROFILES.web_fetch.maxResponseBytes) */
509
362
  maxResponseBytes: z.ZodDefault<z.ZodNumber>;
510
- /** Whether to strip hidden HTML before extraction */
511
363
  stripHiddenHtml: z.ZodDefault<z.ZodBoolean>;
512
364
  }, z.core.$strict>;
513
365
  export type ContextPruningConfig = z.infer<typeof ContextPruningConfigSchema>;
@@ -520,46 +372,29 @@ export type SourceGateConfig = z.infer<typeof SourceGateConfigSchema>;
520
372
  */
521
373
  /** Routing binding: maps channel/peer/guild patterns to a specific agent. */
522
374
  export declare const RoutingBindingSchema: z.ZodObject<{
523
- /** Channel type to match (e.g. "telegram", "discord") */
524
375
  channelType: z.ZodOptional<z.ZodString>;
525
- /** Channel identifier to match */
526
376
  channelId: z.ZodOptional<z.ZodString>;
527
- /** Peer (user) identifier to match */
528
377
  peerId: z.ZodOptional<z.ZodString>;
529
- /** Guild (server/group) identifier to match */
530
378
  guildId: z.ZodOptional<z.ZodString>;
531
- /** Agent ID to route to when this binding matches */
532
379
  agentId: z.ZodString;
533
380
  }, z.core.$strict>;
534
381
  /** Routing configuration for multi-agent dispatch. */
535
382
  export declare const RoutingConfigSchema: z.ZodObject<{
536
- /** Agent ID to use when no routing binding matches */
537
383
  defaultAgentId: z.ZodDefault<z.ZodString>;
538
- /** Ordered list of routing bindings (first match wins) */
539
384
  bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
540
- /** Channel type to match (e.g. "telegram", "discord") */
541
385
  channelType: z.ZodOptional<z.ZodString>;
542
- /** Channel identifier to match */
543
386
  channelId: z.ZodOptional<z.ZodString>;
544
- /** Peer (user) identifier to match */
545
387
  peerId: z.ZodOptional<z.ZodString>;
546
- /** Guild (server/group) identifier to match */
547
388
  guildId: z.ZodOptional<z.ZodString>;
548
- /** Agent ID to route to when this binding matches */
549
389
  agentId: z.ZodString;
550
390
  }, z.core.$strict>>>;
551
391
  }, z.core.$strict>;
552
392
  /** RAG (Retrieval-Augmented Generation) configuration for automatic memory retrieval before LLM calls. */
553
393
  export declare const RagConfigSchema: z.ZodObject<{
554
- /** Enable automatic memory retrieval before LLM calls */
555
394
  enabled: z.ZodDefault<z.ZodBoolean>;
556
- /** Maximum number of memory results to retrieve */
557
395
  maxResults: z.ZodDefault<z.ZodNumber>;
558
- /** Maximum characters of memory context to inject into system prompt */
559
396
  maxContextChars: z.ZodDefault<z.ZodNumber>;
560
- /** Minimum RRF score threshold (0-1) to include a memory result */
561
397
  minScore: z.ZodDefault<z.ZodNumber>;
562
- /** Trust levels to include in retrieval (external excluded by default for security) */
563
398
  includeTrustLevels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
564
399
  system: "system";
565
400
  learned: "learned";
@@ -569,146 +404,102 @@ export declare const RagConfigSchema: z.ZodObject<{
569
404
  export type RagConfig = z.infer<typeof RagConfigSchema>;
570
405
  /** Bootstrap configuration for workspace file injection into system prompts. */
571
406
  export declare const BootstrapConfigSchema: z.ZodObject<{
572
- /** Per-file character limit for workspace files injected into system prompt */
573
407
  maxChars: z.ZodDefault<z.ZodNumber>;
574
- /** System prompt verbosity mode: full (all sections), minimal (sub-agents), none (identity only) */
575
408
  promptMode: z.ZodDefault<z.ZodEnum<{
576
409
  minimal: "minimal";
577
410
  full: "full";
578
411
  none: "none";
579
412
  }>>;
580
- /** When true, USER.md is excluded from bootstrap context in group chat sessions (privacy). Default: true. */
581
413
  groupChatFiltering: z.ZodDefault<z.ZodBoolean>;
582
414
  }, z.core.$strict>;
583
415
  export type BootstrapConfig = z.infer<typeof BootstrapConfigSchema>;
584
416
  /** Per-agent concurrency limits (maxConcurrentRuns controls session serialization). */
585
417
  export declare const ConcurrencyConfigSchema: z.ZodObject<{
586
- /** Maximum concurrent agent runs for this agent (default: 4) */
587
418
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
588
- /** Maximum queued messages per session before overflow (default: 50) */
589
419
  maxQueuedPerSession: z.ZodDefault<z.ZodNumber>;
590
420
  }, z.core.$strict>;
591
421
  export type ConcurrencyConfig = z.infer<typeof ConcurrencyConfigSchema>;
592
422
  /** Target channel for a broadcast group delivery. */
593
423
  export declare const BroadcastTargetSchema: z.ZodObject<{
594
- /** Channel type (e.g., "telegram", "discord", "slack") */
595
424
  channelType: z.ZodString;
596
- /** Channel identifier within the platform */
597
425
  channelId: z.ZodString;
598
- /** Chat/conversation identifier within the channel */
599
426
  chatId: z.ZodString;
600
427
  }, z.core.$strict>;
601
428
  /** Broadcast group for simultaneous multi-channel message delivery. */
602
429
  export declare const BroadcastGroupSchema: z.ZodObject<{
603
- /** Unique group identifier (referenced in broadcast tool calls) */
604
430
  id: z.ZodString;
605
- /** Human-readable group name */
606
431
  name: z.ZodDefault<z.ZodString>;
607
- /** Channel targets for simultaneous delivery */
608
432
  targets: z.ZodDefault<z.ZodArray<z.ZodObject<{
609
- /** Channel type (e.g., "telegram", "discord", "slack") */
610
433
  channelType: z.ZodString;
611
- /** Channel identifier within the platform */
612
434
  channelId: z.ZodString;
613
- /** Chat/conversation identifier within the channel */
614
435
  chatId: z.ZodString;
615
436
  }, z.core.$strict>>>;
616
- /** Whether this broadcast group is active */
617
437
  enabled: z.ZodDefault<z.ZodBoolean>;
618
438
  }, z.core.$strict>;
619
439
  export type BroadcastTarget = z.infer<typeof BroadcastTargetSchema>;
620
440
  export type BroadcastGroup = z.infer<typeof BroadcastGroupSchema>;
621
441
  /** Elevated reply mode: routes messages to different models based on sender trust level. */
622
442
  export declare const ElevatedReplyConfigSchema: z.ZodObject<{
623
- /** Enable trust-based model/prompt routing */
624
443
  enabled: z.ZodDefault<z.ZodBoolean>;
625
- /** Map of trust level name to model route name (from modelRoutes) */
626
444
  trustModelRoutes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
627
- /** Map of trust level name to system prompt section override text */
628
445
  trustPromptOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
629
- /** Default trust level for unknown senders */
630
446
  defaultTrustLevel: z.ZodDefault<z.ZodString>;
631
- /** Per-sender trust level overrides (senderId -> trust level name) */
632
447
  senderTrustMap: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
633
448
  }, z.core.$strict>;
634
449
  export type ElevatedReplyConfig = z.infer<typeof ElevatedReplyConfigSchema>;
635
450
  /** Per-agent JSONL trace configuration (disabled by default). */
636
451
  export declare const TracingConfigSchema: z.ZodObject<{
637
- /** Enable per-LLM-call JSONL trace files */
638
452
  enabled: z.ZodDefault<z.ZodBoolean>;
639
- /** Output directory for JSONL trace files. Supports ~ expansion. Default: ~/.comis/traces */
640
453
  outputDir: z.ZodDefault<z.ZodString>;
641
454
  }, z.core.$strict>;
642
455
  export type TracingConfig = z.infer<typeof TracingConfigSchema>;
643
456
  /** SDK retry configuration: controls exponential backoff for transient errors (429, 5xx).
644
457
  * The SDK handles retry internally; this schema configures its behavior per-agent. */
645
458
  export declare const SdkRetryConfigSchema: z.ZodObject<{
646
- /** Enable SDK-native retry with exponential backoff */
647
459
  enabled: z.ZodDefault<z.ZodBoolean>;
648
- /** Maximum number of retry attempts for transient errors (5 retries = 6 total attempts) */
649
460
  maxRetries: z.ZodDefault<z.ZodNumber>;
650
- /** Base delay in milliseconds before first retry (4s base with exponential backoff: 4s, 8s, 16s, 32s, 60s capped) */
651
461
  baseDelayMs: z.ZodDefault<z.ZodNumber>;
652
- /** Maximum delay cap in milliseconds between retries */
653
462
  maxDelayMs: z.ZodDefault<z.ZodNumber>;
654
463
  }, z.core.$strict>;
655
464
  export type SdkRetryConfig = z.infer<typeof SdkRetryConfigSchema>;
656
465
  /** Context window guard configuration: percent-based warn/block thresholds. */
657
466
  export declare const ContextGuardConfigSchema: z.ZodObject<{
658
- /** Enable context window guard checks during execution */
659
467
  enabled: z.ZodDefault<z.ZodBoolean>;
660
- /** Warn when context usage reaches this percent (0-100). Default: 80. */
661
468
  warnPercent: z.ZodDefault<z.ZodNumber>;
662
- /** Block (abort) execution when context usage reaches this percent (0-100). Default: 95. */
663
469
  blockPercent: z.ZodDefault<z.ZodNumber>;
664
470
  }, z.core.$strict>;
665
471
  export type ContextGuardConfig = z.infer<typeof ContextGuardConfigSchema>;
666
472
  /** Tool lifecycle management: per-turn usage tracking and automatic demotion of unused tools. */
667
473
  export declare const ToolLifecycleConfigSchema: z.ZodObject<{
668
- /** Whether tool lifecycle management is enabled. When false, no usage tracking or demotion occurs. */
669
474
  enabled: z.ZodDefault<z.ZodBoolean>;
670
- /** Number of turns of non-use before a tool is demoted (schema-stripped). */
671
475
  demotionThreshold: z.ZodDefault<z.ZodNumber>;
672
476
  }, z.core.$strict>;
673
477
  export type ToolLifecycleConfig = z.infer<typeof ToolLifecycleConfigSchema>;
674
478
  /** Deferred tools configuration: operator control over tool deferral behavior per-agent. */
675
479
  export declare const DeferredToolsConfigSchema: z.ZodObject<{
676
- /** Deferral mode: "always" defers all non-core tools, "auto" uses rule+budget heuristics, "never" disables deferral. */
677
480
  mode: z.ZodDefault<z.ZodEnum<{
678
481
  never: "never";
679
482
  always: "always";
680
483
  auto: "auto";
681
484
  }>>;
682
- /** Tool names that must never be deferred (force-loaded into active context). Glob patterns NOT supported -- exact names only. */
683
485
  neverDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
684
- /** Tool names that must always be deferred (force-deferred regardless of rules). Glob patterns NOT supported -- exact names only. */
685
486
  alwaysDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
686
487
  }, z.core.$strict>;
687
488
  export type DeferredToolsConfig = z.infer<typeof DeferredToolsConfigSchema>;
688
489
  /** Silent Execution Planner (SEP) configuration: in-memory checklist system for multi-step task tracking. */
689
490
  export declare const SepConfigSchema: z.ZodObject<{
690
- /** Enable/disable SEP. Default: true. */
691
491
  enabled: z.ZodDefault<z.ZodBoolean>;
692
- /** Minimum estimated steps to activate planning (below this threshold, overhead isn't worth it). */
693
492
  minSteps: z.ZodDefault<z.ZodNumber>;
694
- /** Whether to inject a verification nudge when all steps complete. Default: true. */
695
493
  verificationNudge: z.ZodDefault<z.ZodBoolean>;
696
- /** Maximum plan steps to track (prevents runaway extraction on vague requests). */
697
494
  maxSteps: z.ZodDefault<z.ZodNumber>;
698
- /** Whether to include progress in user-visible response. Default: false. */
699
495
  userVisibleProgress: z.ZodDefault<z.ZodBoolean>;
700
496
  }, z.core.$strict>;
701
497
  export type SepConfig = z.infer<typeof SepConfigSchema>;
702
498
  export declare const AgentConfigSchema: z.ZodObject<{
703
- /** Display name for the agent */
704
499
  name: z.ZodDefault<z.ZodString>;
705
- /** LLM model identifier — "default" resolves via models.defaultModel (e.g. "claude-sonnet-4-5-20250929") */
706
500
  model: z.ZodDefault<z.ZodString>;
707
- /** LLM provider — "default" resolves via models.defaultProvider (e.g. "anthropic", "openai") */
708
501
  provider: z.ZodDefault<z.ZodString>;
709
- /** Maximum reasoning steps per execution */
710
502
  maxSteps: z.ZodDefault<z.ZodNumber>;
711
- /** SDK thinking level override (off/minimal/low/medium/high/xhigh). Optional -- only overrides when set. */
712
503
  thinkingLevel: z.ZodOptional<z.ZodEnum<{
713
504
  minimal: "minimal";
714
505
  off: "off";
@@ -717,231 +508,136 @@ export declare const AgentConfigSchema: z.ZodObject<{
717
508
  high: "high";
718
509
  xhigh: "xhigh";
719
510
  }>>;
720
- /** SDK max tokens override. Optional -- only overrides when set. */
721
511
  maxTokens: z.ZodOptional<z.ZodNumber>;
722
- /** SDK temperature override (0-2). Optional -- only overrides when set. */
723
512
  temperature: z.ZodOptional<z.ZodNumber>;
724
- /**
725
- * Prompt cache retention hint (none/short/long). Default: "long".
726
- *
727
- * Anthropic: Controls cache_control TTL marker injection.
728
- * - "none": no caching markers added
729
- * - "short": 5-minute ephemeral TTL (all Anthropic providers)
730
- * - "long": 1-hour TTL on api.anthropic.com; Bedrock and Vertex silently fall back to 5-minute TTL
731
- *
732
- * Gemini: This field is NOT used for Gemini explicit caching (CachedContent API).
733
- * Gemini cache TTL is controlled by geminiCache config and the GeminiCacheManager's
734
- * ttlSeconds parameter (default: 3600s). Active sessions get TTL refresh at 50% interval.
735
- * The cacheRetention value has no effect on Gemini providers.
736
- */
737
513
  cacheRetention: z.ZodDefault<z.ZodEnum<{
738
514
  none: "none";
739
515
  short: "short";
740
516
  long: "long";
741
517
  }>>;
742
- /** Per-model family cache retention overrides. Keys are model ID prefixes
743
- * (e.g., "claude-haiku", "claude-sonnet-4-6"). Longest-prefix-first matching.
744
- * Overrides the agent-level cacheRetention for matching models.
745
- * Set a model family to "none" to disable caching for debugging/testing. */
746
518
  cacheRetentionOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
747
519
  none: "none";
748
520
  short: "short";
749
521
  long: "long";
750
522
  }>>>;
751
- /** When true, use adaptive cache retention (cold-start "short" -> "long" after N turns).
752
- * When false, use static retention from cacheRetention field.
753
- * Default: true -- adaptive retention saves ~$4/MTok on cold-start Opus calls. */
754
523
  adaptiveCacheRetention: z.ZodDefault<z.ZodBoolean>;
755
- /** Cache breakpoint strategy. 'single' (default) minimizes KV page waste.
756
- * 'auto' resolves to 'single' for direct Anthropic and 'multi-zone' for Bedrock/Vertex.
757
- * 'multi-zone' places breakpoints across system, tools, and messages. */
758
524
  cacheBreakpointStrategy: z.ZodDefault<z.ZodEnum<{
759
525
  auto: "auto";
760
526
  "multi-zone": "multi-zone";
761
527
  single: "single";
762
528
  }>>;
763
- /** Advanced cache optimization options for interactive sessions. */
764
529
  advancedCacheOptimization: z.ZodDefault<z.ZodObject<{
765
530
  enableRecentZonePromotion: z.ZodDefault<z.ZodBoolean>;
766
531
  }, z.core.$strip>>;
767
- /** Gemini explicit cache configuration (CachedContent lifecycle). */
768
532
  geminiCache: z.ZodDefault<z.ZodObject<{
769
533
  enabled: z.ZodDefault<z.ZodBoolean>;
770
534
  maxActiveCaches: z.ZodDefault<z.ZodNumber>;
771
535
  }, z.core.$strict>>;
772
- /** When true, only content inside <final> blocks reaches users (streaming + non-streaming). Default: false. */
773
536
  enforceFinalTag: z.ZodDefault<z.ZodBoolean>;
774
- /** When true, enables fast/cheap model routing for simple requests. Default: false. */
775
537
  fastMode: z.ZodDefault<z.ZodBoolean>;
776
- /** When true, OpenAI store: true is injected for completions storage. Default: false (privacy). */
777
538
  storeCompletions: z.ZodDefault<z.ZodBoolean>;
778
- /** Maximum total characters for context window. Default: 100_000 (~25k tokens). */
779
539
  maxContextChars: z.ZodDefault<z.ZodNumber>;
780
- /** Maximum characters per tool result before truncation. Default: 50_000. */
781
540
  maxToolResultChars: z.ZodDefault<z.ZodNumber>;
782
- /** Minimum number of recent messages to always preserve during compaction. Default: 4. */
783
541
  preserveRecent: z.ZodDefault<z.ZodNumber>;
784
- /** Token budget limits */
785
542
  budgets: z.ZodDefault<z.ZodObject<{
786
- /** Max tokens per single execution */
787
543
  perExecution: z.ZodDefault<z.ZodNumber>;
788
- /** Max tokens per hour (rolling window) */
789
544
  perHour: z.ZodDefault<z.ZodNumber>;
790
- /** Max tokens per day (rolling window) */
791
545
  perDay: z.ZodDefault<z.ZodNumber>;
792
546
  }, z.core.$strict>>;
793
- /** Circuit breaker for provider failures */
794
547
  circuitBreaker: z.ZodDefault<z.ZodObject<{
795
- /** Number of consecutive failures before opening circuit */
796
548
  failureThreshold: z.ZodDefault<z.ZodNumber>;
797
- /** Milliseconds to wait before attempting recovery */
798
549
  resetTimeoutMs: z.ZodDefault<z.ZodNumber>;
799
- /** Milliseconds for half-open probe timeout */
800
550
  halfOpenTimeoutMs: z.ZodDefault<z.ZodNumber>;
801
551
  }, z.core.$strict>>;
802
- /** Tool retry circuit breaker for blocking repeatedly-failing tools. */
803
552
  toolRetryBreaker: z.ZodDefault<z.ZodObject<{
804
- /** Enable tool retry circuit breaker. Default: true. */
805
553
  enabled: z.ZodDefault<z.ZodBoolean>;
806
- /** Max consecutive failures for same tool+args before blocking. Default: 3. */
807
554
  maxConsecutiveFailures: z.ZodDefault<z.ZodNumber>;
808
- /** Max total failures for a tool name (any args) before blocking all calls. Default: 5. */
809
555
  maxToolFailures: z.ZodDefault<z.ZodNumber>;
810
- /** Suggest alternative tools in block reason. Default: true. */
811
556
  suggestAlternatives: z.ZodDefault<z.ZodBoolean>;
812
- /** Max consecutive same-error-class failures (any args) before blocking. Default: 2.
813
- * Stricter than args-based because same error + different args = stronger stuck signal. */
814
557
  maxConsecutiveErrorPatterns: z.ZodDefault<z.ZodNumber>;
815
558
  }, z.core.$strict>>;
816
- /** Workspace profile and settings */
817
559
  workspace: z.ZodDefault<z.ZodObject<{
818
560
  profile: z.ZodDefault<z.ZodEnum<{
819
561
  full: "full";
820
562
  specialist: "specialist";
821
563
  }>>;
822
564
  }, z.core.$strict>>;
823
- /** Path to agent workspace directory containing identity files */
824
565
  workspacePath: z.ZodOptional<z.ZodString>;
825
- /** Per-task model route overrides */
826
566
  modelRoutes: z.ZodDefault<z.ZodObject<{
827
567
  default: z.ZodOptional<z.ZodString>;
828
568
  }, z.core.$catchall<z.ZodString>>>;
829
- /** RAG (Retrieval-Augmented Generation) memory context settings */
830
569
  rag: z.ZodDefault<z.ZodObject<{
831
- /** Enable automatic memory retrieval before LLM calls */
832
570
  enabled: z.ZodDefault<z.ZodBoolean>;
833
- /** Maximum number of memory results to retrieve */
834
571
  maxResults: z.ZodDefault<z.ZodNumber>;
835
- /** Maximum characters of memory context to inject into system prompt */
836
572
  maxContextChars: z.ZodDefault<z.ZodNumber>;
837
- /** Minimum RRF score threshold (0-1) to include a memory result */
838
573
  minScore: z.ZodDefault<z.ZodNumber>;
839
- /** Trust levels to include in retrieval (external excluded by default for security) */
840
574
  includeTrustLevels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
841
575
  system: "system";
842
576
  learned: "learned";
843
577
  external: "external";
844
578
  }>>>;
845
579
  }, z.core.$strict>>;
846
- /** Bootstrap workspace file injection settings */
847
580
  bootstrap: z.ZodDefault<z.ZodObject<{
848
- /** Per-file character limit for workspace files injected into system prompt */
849
581
  maxChars: z.ZodDefault<z.ZodNumber>;
850
- /** System prompt verbosity mode: full (all sections), minimal (sub-agents), none (identity only) */
851
582
  promptMode: z.ZodDefault<z.ZodEnum<{
852
583
  minimal: "minimal";
853
584
  full: "full";
854
585
  none: "none";
855
586
  }>>;
856
- /** When true, USER.md is excluded from bootstrap context in group chat sessions (privacy). Default: true. */
857
587
  groupChatFiltering: z.ZodDefault<z.ZodBoolean>;
858
588
  }, z.core.$strict>>;
859
- /** Reaction frequency mode: minimal (1 per 5-10 exchanges) or extensive (react freely). Omit to disable reaction guidance. */
860
589
  reactionLevel: z.ZodOptional<z.ZodEnum<{
861
590
  minimal: "minimal";
862
591
  extensive: "extensive";
863
592
  }>>;
864
- /** Model failover and auth rotation settings */
865
593
  modelFailover: z.ZodDefault<z.ZodObject<{
866
- /** Ordered list of fallback models to try when primary fails */
867
594
  fallbackModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
868
- /** LLM provider (e.g. "anthropic", "openai") */
869
595
  provider: z.ZodString;
870
- /** Model identifier at the provider */
871
596
  modelId: z.ZodString;
872
597
  }, z.core.$strict>>>;
873
- /** Per-provider API key profiles for auth rotation */
874
598
  authProfiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
875
- /** Key name in SecretManager (e.g. "ANTHROPIC_API_KEY_2") */
876
599
  keyName: z.ZodString;
877
- /** Provider this key belongs to (e.g. "anthropic") */
878
600
  provider: z.ZodString;
879
601
  }, z.core.$strict>>>;
880
- /** Model allowlist (empty = allow all models) */
881
602
  allowedModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
882
- /** Maximum total attempts across all models/keys */
883
603
  maxAttempts: z.ZodDefault<z.ZodNumber>;
884
- /** Initial cooldown duration in milliseconds (1 min) */
885
604
  cooldownInitialMs: z.ZodDefault<z.ZodNumber>;
886
- /** Exponential cooldown multiplier */
887
605
  cooldownMultiplier: z.ZodDefault<z.ZodNumber>;
888
- /** Maximum cooldown duration in milliseconds (1 hr) */
889
606
  cooldownCapMs: z.ZodDefault<z.ZodNumber>;
890
607
  }, z.core.$strict>>;
891
- /** SDK retry configuration (exponential backoff for 429/5xx transient errors) */
892
608
  sdkRetry: z.ZodDefault<z.ZodObject<{
893
- /** Enable SDK-native retry with exponential backoff */
894
609
  enabled: z.ZodDefault<z.ZodBoolean>;
895
- /** Maximum number of retry attempts for transient errors (5 retries = 6 total attempts) */
896
610
  maxRetries: z.ZodDefault<z.ZodNumber>;
897
- /** Base delay in milliseconds before first retry (4s base with exponential backoff: 4s, 8s, 16s, 32s, 60s capped) */
898
611
  baseDelayMs: z.ZodDefault<z.ZodNumber>;
899
- /** Maximum delay cap in milliseconds between retries */
900
612
  maxDelayMs: z.ZodDefault<z.ZodNumber>;
901
613
  }, z.core.$strict>>;
902
- /** Prompt timeout configuration (wall-clock timeouts for LLM calls) */
903
614
  promptTimeout: z.ZodDefault<z.ZodObject<{
904
- /** Wall-clock timeout for primary prompt calls in milliseconds. Default: 180s. */
905
615
  promptTimeoutMs: z.ZodDefault<z.ZodNumber>;
906
- /** Wall-clock timeout for retry prompt calls in milliseconds. Default: 60s. */
907
616
  retryPromptTimeoutMs: z.ZodDefault<z.ZodNumber>;
908
617
  }, z.core.$strict>>;
909
- /** Per-operation model override configuration (model tiering). */
910
618
  operationModels: z.ZodDefault<z.ZodObject<{
911
619
  cron: z.ZodOptional<z.ZodObject<{
912
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
913
620
  model: z.ZodOptional<z.ZodString>;
914
- /** Timeout override in milliseconds for this operation type. */
915
621
  timeout: z.ZodOptional<z.ZodNumber>;
916
622
  }, z.core.$strict>>;
917
623
  heartbeat: z.ZodOptional<z.ZodObject<{
918
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
919
624
  model: z.ZodOptional<z.ZodString>;
920
- /** Timeout override in milliseconds for this operation type. */
921
625
  timeout: z.ZodOptional<z.ZodNumber>;
922
626
  }, z.core.$strict>>;
923
627
  subagent: z.ZodOptional<z.ZodObject<{
924
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
925
628
  model: z.ZodOptional<z.ZodString>;
926
- /** Timeout override in milliseconds for this operation type. */
927
629
  timeout: z.ZodOptional<z.ZodNumber>;
928
630
  }, z.core.$strict>>;
929
631
  compaction: z.ZodOptional<z.ZodObject<{
930
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
931
632
  model: z.ZodOptional<z.ZodString>;
932
- /** Timeout override in milliseconds for this operation type. */
933
633
  timeout: z.ZodOptional<z.ZodNumber>;
934
634
  }, z.core.$strict>>;
935
635
  taskExtraction: z.ZodOptional<z.ZodObject<{
936
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
937
636
  model: z.ZodOptional<z.ZodString>;
938
- /** Timeout override in milliseconds for this operation type. */
939
637
  timeout: z.ZodOptional<z.ZodNumber>;
940
638
  }, z.core.$strict>>;
941
639
  condensation: z.ZodOptional<z.ZodObject<{
942
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
943
640
  model: z.ZodOptional<z.ZodString>;
944
- /** Timeout override in milliseconds for this operation type. */
945
641
  timeout: z.ZodOptional<z.ZodNumber>;
946
642
  }, z.core.$strict>>;
947
643
  }, z.core.$strict>>;
@@ -951,75 +647,41 @@ export type RoutingBinding = z.infer<typeof RoutingBindingSchema>;
951
647
  export type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
952
648
  /** Per-agent cron configuration (enabled defaults to true). */
953
649
  export declare const PerAgentCronConfigSchema: z.ZodObject<{
954
- /** Enable cron job scheduling for this agent */
955
650
  enabled: z.ZodDefault<z.ZodBoolean>;
956
- /** Maximum concurrent cron job runs for this agent */
957
651
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
958
- /** Default timezone for cron expressions (empty = UTC) */
959
652
  defaultTimezone: z.ZodDefault<z.ZodString>;
960
- /** Maximum number of cron jobs allowed for this agent (0 = unlimited) */
961
653
  maxJobs: z.ZodDefault<z.ZodNumber>;
962
- /** Maximum consecutive errors before auto-suspending a cron job (0 = never suspend). Per-agent override. */
963
654
  maxConsecutiveErrors: z.ZodDefault<z.ZodNumber>;
964
655
  }, z.core.$strict>;
965
656
  /** Per-agent heartbeat delivery target (which channel to send heartbeat notifications to). */
966
657
  export declare const HeartbeatTargetSchema: z.ZodObject<{
967
- /** Channel type (e.g., "telegram", "discord") */
968
658
  channelType: z.ZodString;
969
- /** Channel identifier within the platform */
970
659
  channelId: z.ZodString;
971
- /** Chat/conversation identifier */
972
660
  chatId: z.ZodString;
973
- /** Whether this target is a DM conversation (for DM delivery policy) */
974
661
  isDm: z.ZodOptional<z.ZodBoolean>;
975
662
  }, z.core.$strict>;
976
663
  /** Per-agent heartbeat config: all fields optional (inherit from global scheduler.heartbeat). */
977
664
  export declare const PerAgentHeartbeatConfigSchema: z.ZodObject<{
978
- /** Override heartbeat enabled state for this agent */
979
665
  enabled: z.ZodOptional<z.ZodBoolean>;
980
- /** Override heartbeat interval in milliseconds */
981
666
  intervalMs: z.ZodOptional<z.ZodNumber>;
982
- /** Override show OK status */
983
667
  showOk: z.ZodOptional<z.ZodBoolean>;
984
- /** Override show alerts */
985
668
  showAlerts: z.ZodOptional<z.ZodBoolean>;
986
- /** Delivery target channel for this agent's heartbeat notifications */
987
669
  target: z.ZodOptional<z.ZodObject<{
988
- /** Channel type (e.g., "telegram", "discord") */
989
670
  channelType: z.ZodString;
990
- /** Channel identifier within the platform */
991
671
  channelId: z.ZodString;
992
- /** Chat/conversation identifier */
993
672
  chatId: z.ZodString;
994
- /** Whether this target is a DM conversation (for DM delivery policy) */
995
673
  isDm: z.ZodOptional<z.ZodBoolean>;
996
674
  }, z.core.$strict>>;
997
- /** Custom heartbeat prompt for this agent */
998
675
  prompt: z.ZodOptional<z.ZodString>;
999
- /** Session key for heartbeat conversation isolation */
1000
676
  session: z.ZodOptional<z.ZodString>;
1001
- /** Whether heartbeat alerts can be delivered to DM conversations (default: true) */
1002
677
  allowDm: z.ZodOptional<z.ZodBoolean>;
1003
- /** When true, heartbeat bootstrap context includes ONLY HEARTBEAT.md (cost optimization) */
1004
678
  lightContext: z.ZodOptional<z.ZodBoolean>;
1005
- /** Maximum characters for soft acknowledgment threshold (default applied in scheduler, not schema) */
1006
679
  ackMaxChars: z.ZodOptional<z.ZodNumber>;
1007
- /** Prefix to strip from LLM responses before delivery */
1008
680
  responsePrefix: z.ZodOptional<z.ZodString>;
1009
- /** Whether to suppress delivery of HEARTBEAT_OK-only responses from cron triggers (default applied in scheduler) */
1010
681
  skipHeartbeatOnlyDelivery: z.ZodOptional<z.ZodBoolean>;
1011
- /** Override consecutive failure threshold for alerting (per-agent) */
1012
682
  alertThreshold: z.ZodOptional<z.ZodNumber>;
1013
- /** Override alert cooldown period in ms (per-agent) */
1014
683
  alertCooldownMs: z.ZodOptional<z.ZodNumber>;
1015
- /** Override stuck detection timeout in ms (per-agent) */
1016
684
  staleMs: z.ZodOptional<z.ZodNumber>;
1017
- /** Per-agent heartbeat tool policy override -- matches AgentConfig.toolPolicy shape.
1018
- *
1019
- * Resolution order: heartbeat.toolPolicy > agentConfig.toolPolicy > passthrough.
1020
- * Opt-in: omitting this field preserves the agent's interactive tool set for
1021
- * heartbeat ticks. Use `{ profile: "heartbeat-minimal" }` for the conservative
1022
- * preset in `packages/skills/src/policy/tool-policy.ts`. */
1023
685
  toolPolicy: z.ZodOptional<z.ZodObject<{
1024
686
  profile: z.ZodDefault<z.ZodString>;
1025
687
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1030,66 +692,34 @@ export type HeartbeatTarget = z.infer<typeof HeartbeatTargetSchema>;
1030
692
  export type PerAgentHeartbeatConfig = z.infer<typeof PerAgentHeartbeatConfigSchema>;
1031
693
  /** Per-agent scheduler configuration (wraps cron and heartbeat settings). */
1032
694
  export declare const PerAgentSchedulerConfigSchema: z.ZodObject<{
1033
- /** Per-agent cron configuration */
1034
695
  cron: z.ZodDefault<z.ZodObject<{
1035
- /** Enable cron job scheduling for this agent */
1036
696
  enabled: z.ZodDefault<z.ZodBoolean>;
1037
- /** Maximum concurrent cron job runs for this agent */
1038
697
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
1039
- /** Default timezone for cron expressions (empty = UTC) */
1040
698
  defaultTimezone: z.ZodDefault<z.ZodString>;
1041
- /** Maximum number of cron jobs allowed for this agent (0 = unlimited) */
1042
699
  maxJobs: z.ZodDefault<z.ZodNumber>;
1043
- /** Maximum consecutive errors before auto-suspending a cron job (0 = never suspend). Per-agent override. */
1044
700
  maxConsecutiveErrors: z.ZodDefault<z.ZodNumber>;
1045
701
  }, z.core.$strict>>;
1046
- /** Per-agent heartbeat configuration (optional -- inherits from global scheduler.heartbeat) */
1047
702
  heartbeat: z.ZodOptional<z.ZodObject<{
1048
- /** Override heartbeat enabled state for this agent */
1049
703
  enabled: z.ZodOptional<z.ZodBoolean>;
1050
- /** Override heartbeat interval in milliseconds */
1051
704
  intervalMs: z.ZodOptional<z.ZodNumber>;
1052
- /** Override show OK status */
1053
705
  showOk: z.ZodOptional<z.ZodBoolean>;
1054
- /** Override show alerts */
1055
706
  showAlerts: z.ZodOptional<z.ZodBoolean>;
1056
- /** Delivery target channel for this agent's heartbeat notifications */
1057
707
  target: z.ZodOptional<z.ZodObject<{
1058
- /** Channel type (e.g., "telegram", "discord") */
1059
708
  channelType: z.ZodString;
1060
- /** Channel identifier within the platform */
1061
709
  channelId: z.ZodString;
1062
- /** Chat/conversation identifier */
1063
710
  chatId: z.ZodString;
1064
- /** Whether this target is a DM conversation (for DM delivery policy) */
1065
711
  isDm: z.ZodOptional<z.ZodBoolean>;
1066
712
  }, z.core.$strict>>;
1067
- /** Custom heartbeat prompt for this agent */
1068
713
  prompt: z.ZodOptional<z.ZodString>;
1069
- /** Session key for heartbeat conversation isolation */
1070
714
  session: z.ZodOptional<z.ZodString>;
1071
- /** Whether heartbeat alerts can be delivered to DM conversations (default: true) */
1072
715
  allowDm: z.ZodOptional<z.ZodBoolean>;
1073
- /** When true, heartbeat bootstrap context includes ONLY HEARTBEAT.md (cost optimization) */
1074
716
  lightContext: z.ZodOptional<z.ZodBoolean>;
1075
- /** Maximum characters for soft acknowledgment threshold (default applied in scheduler, not schema) */
1076
717
  ackMaxChars: z.ZodOptional<z.ZodNumber>;
1077
- /** Prefix to strip from LLM responses before delivery */
1078
718
  responsePrefix: z.ZodOptional<z.ZodString>;
1079
- /** Whether to suppress delivery of HEARTBEAT_OK-only responses from cron triggers (default applied in scheduler) */
1080
719
  skipHeartbeatOnlyDelivery: z.ZodOptional<z.ZodBoolean>;
1081
- /** Override consecutive failure threshold for alerting (per-agent) */
1082
720
  alertThreshold: z.ZodOptional<z.ZodNumber>;
1083
- /** Override alert cooldown period in ms (per-agent) */
1084
721
  alertCooldownMs: z.ZodOptional<z.ZodNumber>;
1085
- /** Override stuck detection timeout in ms (per-agent) */
1086
722
  staleMs: z.ZodOptional<z.ZodNumber>;
1087
- /** Per-agent heartbeat tool policy override -- matches AgentConfig.toolPolicy shape.
1088
- *
1089
- * Resolution order: heartbeat.toolPolicy > agentConfig.toolPolicy > passthrough.
1090
- * Opt-in: omitting this field preserves the agent's interactive tool set for
1091
- * heartbeat ticks. Use `{ profile: "heartbeat-minimal" }` for the conservative
1092
- * preset in `packages/skills/src/policy/tool-policy.ts`. */
1093
723
  toolPolicy: z.ZodOptional<z.ZodObject<{
1094
724
  profile: z.ZodDefault<z.ZodString>;
1095
725
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1143,32 +773,20 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1143
773
  maxToolResultChars: z.ZodDefault<z.ZodNumber>;
1144
774
  preserveRecent: z.ZodDefault<z.ZodNumber>;
1145
775
  budgets: z.ZodDefault<z.ZodObject<{
1146
- /** Max tokens per single execution */
1147
776
  perExecution: z.ZodDefault<z.ZodNumber>;
1148
- /** Max tokens per hour (rolling window) */
1149
777
  perHour: z.ZodDefault<z.ZodNumber>;
1150
- /** Max tokens per day (rolling window) */
1151
778
  perDay: z.ZodDefault<z.ZodNumber>;
1152
779
  }, z.core.$strict>>;
1153
780
  circuitBreaker: z.ZodDefault<z.ZodObject<{
1154
- /** Number of consecutive failures before opening circuit */
1155
781
  failureThreshold: z.ZodDefault<z.ZodNumber>;
1156
- /** Milliseconds to wait before attempting recovery */
1157
782
  resetTimeoutMs: z.ZodDefault<z.ZodNumber>;
1158
- /** Milliseconds for half-open probe timeout */
1159
783
  halfOpenTimeoutMs: z.ZodDefault<z.ZodNumber>;
1160
784
  }, z.core.$strict>>;
1161
785
  toolRetryBreaker: z.ZodDefault<z.ZodObject<{
1162
- /** Enable tool retry circuit breaker. Default: true. */
1163
786
  enabled: z.ZodDefault<z.ZodBoolean>;
1164
- /** Max consecutive failures for same tool+args before blocking. Default: 3. */
1165
787
  maxConsecutiveFailures: z.ZodDefault<z.ZodNumber>;
1166
- /** Max total failures for a tool name (any args) before blocking all calls. Default: 5. */
1167
788
  maxToolFailures: z.ZodDefault<z.ZodNumber>;
1168
- /** Suggest alternative tools in block reason. Default: true. */
1169
789
  suggestAlternatives: z.ZodDefault<z.ZodBoolean>;
1170
- /** Max consecutive same-error-class failures (any args) before blocking. Default: 2.
1171
- * Stricter than args-based because same error + different args = stronger stuck signal. */
1172
790
  maxConsecutiveErrorPatterns: z.ZodDefault<z.ZodNumber>;
1173
791
  }, z.core.$strict>>;
1174
792
  workspace: z.ZodDefault<z.ZodObject<{
@@ -1182,15 +800,10 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1182
800
  default: z.ZodOptional<z.ZodString>;
1183
801
  }, z.core.$catchall<z.ZodString>>>;
1184
802
  rag: z.ZodDefault<z.ZodObject<{
1185
- /** Enable automatic memory retrieval before LLM calls */
1186
803
  enabled: z.ZodDefault<z.ZodBoolean>;
1187
- /** Maximum number of memory results to retrieve */
1188
804
  maxResults: z.ZodDefault<z.ZodNumber>;
1189
- /** Maximum characters of memory context to inject into system prompt */
1190
805
  maxContextChars: z.ZodDefault<z.ZodNumber>;
1191
- /** Minimum RRF score threshold (0-1) to include a memory result */
1192
806
  minScore: z.ZodDefault<z.ZodNumber>;
1193
- /** Trust levels to include in retrieval (external excluded by default for security) */
1194
807
  includeTrustLevels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1195
808
  system: "system";
1196
809
  learned: "learned";
@@ -1198,15 +811,12 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1198
811
  }>>>;
1199
812
  }, z.core.$strict>>;
1200
813
  bootstrap: z.ZodDefault<z.ZodObject<{
1201
- /** Per-file character limit for workspace files injected into system prompt */
1202
814
  maxChars: z.ZodDefault<z.ZodNumber>;
1203
- /** System prompt verbosity mode: full (all sections), minimal (sub-agents), none (identity only) */
1204
815
  promptMode: z.ZodDefault<z.ZodEnum<{
1205
816
  minimal: "minimal";
1206
817
  full: "full";
1207
818
  none: "none";
1208
819
  }>>;
1209
- /** When true, USER.md is excluded from bootstrap context in group chat sessions (privacy). Default: true. */
1210
820
  groupChatFiltering: z.ZodDefault<z.ZodBoolean>;
1211
821
  }, z.core.$strict>>;
1212
822
  reactionLevel: z.ZodOptional<z.ZodEnum<{
@@ -1214,82 +824,53 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1214
824
  extensive: "extensive";
1215
825
  }>>;
1216
826
  modelFailover: z.ZodDefault<z.ZodObject<{
1217
- /** Ordered list of fallback models to try when primary fails */
1218
827
  fallbackModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
1219
- /** LLM provider (e.g. "anthropic", "openai") */
1220
828
  provider: z.ZodString;
1221
- /** Model identifier at the provider */
1222
829
  modelId: z.ZodString;
1223
830
  }, z.core.$strict>>>;
1224
- /** Per-provider API key profiles for auth rotation */
1225
831
  authProfiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
1226
- /** Key name in SecretManager (e.g. "ANTHROPIC_API_KEY_2") */
1227
832
  keyName: z.ZodString;
1228
- /** Provider this key belongs to (e.g. "anthropic") */
1229
833
  provider: z.ZodString;
1230
834
  }, z.core.$strict>>>;
1231
- /** Model allowlist (empty = allow all models) */
1232
835
  allowedModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
1233
- /** Maximum total attempts across all models/keys */
1234
836
  maxAttempts: z.ZodDefault<z.ZodNumber>;
1235
- /** Initial cooldown duration in milliseconds (1 min) */
1236
837
  cooldownInitialMs: z.ZodDefault<z.ZodNumber>;
1237
- /** Exponential cooldown multiplier */
1238
838
  cooldownMultiplier: z.ZodDefault<z.ZodNumber>;
1239
- /** Maximum cooldown duration in milliseconds (1 hr) */
1240
839
  cooldownCapMs: z.ZodDefault<z.ZodNumber>;
1241
840
  }, z.core.$strict>>;
1242
841
  sdkRetry: z.ZodDefault<z.ZodObject<{
1243
- /** Enable SDK-native retry with exponential backoff */
1244
842
  enabled: z.ZodDefault<z.ZodBoolean>;
1245
- /** Maximum number of retry attempts for transient errors (5 retries = 6 total attempts) */
1246
843
  maxRetries: z.ZodDefault<z.ZodNumber>;
1247
- /** Base delay in milliseconds before first retry (4s base with exponential backoff: 4s, 8s, 16s, 32s, 60s capped) */
1248
844
  baseDelayMs: z.ZodDefault<z.ZodNumber>;
1249
- /** Maximum delay cap in milliseconds between retries */
1250
845
  maxDelayMs: z.ZodDefault<z.ZodNumber>;
1251
846
  }, z.core.$strict>>;
1252
847
  promptTimeout: z.ZodDefault<z.ZodObject<{
1253
- /** Wall-clock timeout for primary prompt calls in milliseconds. Default: 180s. */
1254
848
  promptTimeoutMs: z.ZodDefault<z.ZodNumber>;
1255
- /** Wall-clock timeout for retry prompt calls in milliseconds. Default: 60s. */
1256
849
  retryPromptTimeoutMs: z.ZodDefault<z.ZodNumber>;
1257
850
  }, z.core.$strict>>;
1258
851
  operationModels: z.ZodDefault<z.ZodObject<{
1259
852
  cron: z.ZodOptional<z.ZodObject<{
1260
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1261
853
  model: z.ZodOptional<z.ZodString>;
1262
- /** Timeout override in milliseconds for this operation type. */
1263
854
  timeout: z.ZodOptional<z.ZodNumber>;
1264
855
  }, z.core.$strict>>;
1265
856
  heartbeat: z.ZodOptional<z.ZodObject<{
1266
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1267
857
  model: z.ZodOptional<z.ZodString>;
1268
- /** Timeout override in milliseconds for this operation type. */
1269
858
  timeout: z.ZodOptional<z.ZodNumber>;
1270
859
  }, z.core.$strict>>;
1271
860
  subagent: z.ZodOptional<z.ZodObject<{
1272
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1273
861
  model: z.ZodOptional<z.ZodString>;
1274
- /** Timeout override in milliseconds for this operation type. */
1275
862
  timeout: z.ZodOptional<z.ZodNumber>;
1276
863
  }, z.core.$strict>>;
1277
864
  compaction: z.ZodOptional<z.ZodObject<{
1278
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1279
865
  model: z.ZodOptional<z.ZodString>;
1280
- /** Timeout override in milliseconds for this operation type. */
1281
866
  timeout: z.ZodOptional<z.ZodNumber>;
1282
867
  }, z.core.$strict>>;
1283
868
  taskExtraction: z.ZodOptional<z.ZodObject<{
1284
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1285
869
  model: z.ZodOptional<z.ZodString>;
1286
- /** Timeout override in milliseconds for this operation type. */
1287
870
  timeout: z.ZodOptional<z.ZodNumber>;
1288
871
  }, z.core.$strict>>;
1289
872
  condensation: z.ZodOptional<z.ZodObject<{
1290
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1291
873
  model: z.ZodOptional<z.ZodString>;
1292
- /** Timeout override in milliseconds for this operation type. */
1293
874
  timeout: z.ZodOptional<z.ZodNumber>;
1294
875
  }, z.core.$strict>>;
1295
876
  }, z.core.$strict>>;
@@ -1349,66 +930,34 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1349
930
  watchDebounceMs: z.ZodDefault<z.ZodNumber>;
1350
931
  }, z.core.$strict>>;
1351
932
  scheduler: z.ZodOptional<z.ZodObject<{
1352
- /** Per-agent cron configuration */
1353
933
  cron: z.ZodDefault<z.ZodObject<{
1354
- /** Enable cron job scheduling for this agent */
1355
934
  enabled: z.ZodDefault<z.ZodBoolean>;
1356
- /** Maximum concurrent cron job runs for this agent */
1357
935
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
1358
- /** Default timezone for cron expressions (empty = UTC) */
1359
936
  defaultTimezone: z.ZodDefault<z.ZodString>;
1360
- /** Maximum number of cron jobs allowed for this agent (0 = unlimited) */
1361
937
  maxJobs: z.ZodDefault<z.ZodNumber>;
1362
- /** Maximum consecutive errors before auto-suspending a cron job (0 = never suspend). Per-agent override. */
1363
938
  maxConsecutiveErrors: z.ZodDefault<z.ZodNumber>;
1364
939
  }, z.core.$strict>>;
1365
- /** Per-agent heartbeat configuration (optional -- inherits from global scheduler.heartbeat) */
1366
940
  heartbeat: z.ZodOptional<z.ZodObject<{
1367
- /** Override heartbeat enabled state for this agent */
1368
941
  enabled: z.ZodOptional<z.ZodBoolean>;
1369
- /** Override heartbeat interval in milliseconds */
1370
942
  intervalMs: z.ZodOptional<z.ZodNumber>;
1371
- /** Override show OK status */
1372
943
  showOk: z.ZodOptional<z.ZodBoolean>;
1373
- /** Override show alerts */
1374
944
  showAlerts: z.ZodOptional<z.ZodBoolean>;
1375
- /** Delivery target channel for this agent's heartbeat notifications */
1376
945
  target: z.ZodOptional<z.ZodObject<{
1377
- /** Channel type (e.g., "telegram", "discord") */
1378
946
  channelType: z.ZodString;
1379
- /** Channel identifier within the platform */
1380
947
  channelId: z.ZodString;
1381
- /** Chat/conversation identifier */
1382
948
  chatId: z.ZodString;
1383
- /** Whether this target is a DM conversation (for DM delivery policy) */
1384
949
  isDm: z.ZodOptional<z.ZodBoolean>;
1385
950
  }, z.core.$strict>>;
1386
- /** Custom heartbeat prompt for this agent */
1387
951
  prompt: z.ZodOptional<z.ZodString>;
1388
- /** Session key for heartbeat conversation isolation */
1389
952
  session: z.ZodOptional<z.ZodString>;
1390
- /** Whether heartbeat alerts can be delivered to DM conversations (default: true) */
1391
953
  allowDm: z.ZodOptional<z.ZodBoolean>;
1392
- /** When true, heartbeat bootstrap context includes ONLY HEARTBEAT.md (cost optimization) */
1393
954
  lightContext: z.ZodOptional<z.ZodBoolean>;
1394
- /** Maximum characters for soft acknowledgment threshold (default applied in scheduler, not schema) */
1395
955
  ackMaxChars: z.ZodOptional<z.ZodNumber>;
1396
- /** Prefix to strip from LLM responses before delivery */
1397
956
  responsePrefix: z.ZodOptional<z.ZodString>;
1398
- /** Whether to suppress delivery of HEARTBEAT_OK-only responses from cron triggers (default applied in scheduler) */
1399
957
  skipHeartbeatOnlyDelivery: z.ZodOptional<z.ZodBoolean>;
1400
- /** Override consecutive failure threshold for alerting (per-agent) */
1401
958
  alertThreshold: z.ZodOptional<z.ZodNumber>;
1402
- /** Override alert cooldown period in ms (per-agent) */
1403
959
  alertCooldownMs: z.ZodOptional<z.ZodNumber>;
1404
- /** Override stuck detection timeout in ms (per-agent) */
1405
960
  staleMs: z.ZodOptional<z.ZodNumber>;
1406
- /** Per-agent heartbeat tool policy override -- matches AgentConfig.toolPolicy shape.
1407
- *
1408
- * Resolution order: heartbeat.toolPolicy > agentConfig.toolPolicy > passthrough.
1409
- * Opt-in: omitting this field preserves the agent's interactive tool set for
1410
- * heartbeat ticks. Use `{ profile: "heartbeat-minimal" }` for the conservative
1411
- * preset in `packages/skills/src/policy/tool-policy.ts`. */
1412
961
  toolPolicy: z.ZodOptional<z.ZodObject<{
1413
962
  profile: z.ZodDefault<z.ZodString>;
1414
963
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1418,311 +967,184 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1418
967
  }, z.core.$strict>>;
1419
968
  session: z.ZodOptional<z.ZodObject<{
1420
969
  resetPolicy: z.ZodOptional<z.ZodObject<{
1421
- /** Reset mode: daily, idle, hybrid (first-to-expire), or none (disabled) */
1422
970
  mode: z.ZodDefault<z.ZodEnum<{
1423
971
  daily: "daily";
1424
972
  idle: "idle";
1425
973
  hybrid: "hybrid";
1426
974
  none: "none";
1427
975
  }>>;
1428
- /** Hour of day for daily reset (0-23, default 4 = 4 AM) */
1429
976
  dailyResetHour: z.ZodDefault<z.ZodNumber>;
1430
- /** IANA timezone for daily reset (empty string = system local) */
1431
977
  dailyResetTimezone: z.ZodDefault<z.ZodString>;
1432
- /** Idle timeout in milliseconds (default 4 hours = 14_400_000) */
1433
978
  idleTimeoutMs: z.ZodDefault<z.ZodNumber>;
1434
- /** Sweep interval in milliseconds (how often to check sessions, default 5 min) */
1435
979
  sweepIntervalMs: z.ZodDefault<z.ZodNumber>;
1436
- /** Phrases that trigger immediate session reset when sent as a message */
1437
980
  resetTriggers: z.ZodDefault<z.ZodArray<z.ZodString>>;
1438
- /** Per-session-type overrides (dm, group, thread) */
1439
981
  perType: z.ZodDefault<z.ZodObject<{
1440
982
  dm: z.ZodOptional<z.ZodObject<{
1441
- /** Override reset mode for this session type */
1442
983
  mode: z.ZodOptional<z.ZodEnum<{
1443
984
  daily: "daily";
1444
985
  idle: "idle";
1445
986
  hybrid: "hybrid";
1446
987
  none: "none";
1447
988
  }>>;
1448
- /** Override daily reset hour (0-23) */
1449
989
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
1450
- /** Override IANA timezone for daily reset */
1451
990
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
1452
- /** Override idle timeout in milliseconds */
1453
991
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
1454
992
  }, z.core.$strict>>;
1455
993
  group: z.ZodOptional<z.ZodObject<{
1456
- /** Override reset mode for this session type */
1457
994
  mode: z.ZodOptional<z.ZodEnum<{
1458
995
  daily: "daily";
1459
996
  idle: "idle";
1460
997
  hybrid: "hybrid";
1461
998
  none: "none";
1462
999
  }>>;
1463
- /** Override daily reset hour (0-23) */
1464
1000
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
1465
- /** Override IANA timezone for daily reset */
1466
1001
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
1467
- /** Override idle timeout in milliseconds */
1468
1002
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
1469
1003
  }, z.core.$strict>>;
1470
1004
  thread: z.ZodOptional<z.ZodObject<{
1471
- /** Override reset mode for this session type */
1472
1005
  mode: z.ZodOptional<z.ZodEnum<{
1473
1006
  daily: "daily";
1474
1007
  idle: "idle";
1475
1008
  hybrid: "hybrid";
1476
1009
  none: "none";
1477
1010
  }>>;
1478
- /** Override daily reset hour (0-23) */
1479
1011
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
1480
- /** Override IANA timezone for daily reset */
1481
1012
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
1482
- /** Override idle timeout in milliseconds */
1483
1013
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
1484
1014
  }, z.core.$strict>>;
1485
1015
  }, z.core.$strict>>;
1486
1016
  }, z.core.$strict>>;
1487
1017
  dmScope: z.ZodOptional<z.ZodObject<{
1488
- /** DM scope mode controlling session isolation granularity */
1489
1018
  mode: z.ZodDefault<z.ZodEnum<{
1490
1019
  main: "main";
1491
1020
  "per-peer": "per-peer";
1492
1021
  "per-channel-peer": "per-channel-peer";
1493
1022
  "per-account-channel-peer": "per-account-channel-peer";
1494
1023
  }>>;
1495
- /** Prepend agent:<agentId>: to session keys for multi-agent isolation */
1496
1024
  agentPrefix: z.ZodDefault<z.ZodBoolean>;
1497
- /** Append :thread:<threadId> to session keys for forum/thread isolation */
1498
1025
  threadIsolation: z.ZodDefault<z.ZodBoolean>;
1499
1026
  }, z.core.$strict>>;
1500
1027
  pruning: z.ZodOptional<z.ZodObject<{
1501
- /** Enable session pruning of oversized tool results */
1502
1028
  enabled: z.ZodDefault<z.ZodBoolean>;
1503
- /** Character threshold above which tool results are soft-trimmed (head + tail with marker) */
1504
1029
  softTrimThresholdChars: z.ZodDefault<z.ZodNumber>;
1505
- /** Character threshold above which tool results are hard-cleared (entire content replaced) */
1506
1030
  hardClearThresholdChars: z.ZodDefault<z.ZodNumber>;
1507
- /** Number of characters to preserve at the start of a soft-trimmed result */
1508
1031
  preserveHeadChars: z.ZodDefault<z.ZodNumber>;
1509
- /** Number of characters to preserve at the end of a soft-trimmed result */
1510
1032
  preserveTailChars: z.ZodDefault<z.ZodNumber>;
1511
- /** Tools whose results are eligible for pruning (empty = all tools eligible) */
1512
1033
  pruneableTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
1513
- /** Tools whose results are never pruned (takes precedence over pruneableTools) */
1514
1034
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
1515
- /** Protect tool results containing image content blocks from pruning */
1516
1035
  protectImageBlocks: z.ZodDefault<z.ZodBoolean>;
1517
- /** Number of recent messages (from end of array) exempt from pruning */
1518
1036
  preserveRecentCount: z.ZodDefault<z.ZodNumber>;
1519
1037
  }, z.core.$strict>>;
1520
1038
  compaction: z.ZodOptional<z.ZodObject<{
1521
- /** Fraction of maxContextChars at which soft flush triggers (memory extraction only) */
1522
1039
  softThresholdRatio: z.ZodDefault<z.ZodNumber>;
1523
- /** Fraction of maxContextChars at which hard compaction triggers (flush + trim) */
1524
1040
  hardThresholdRatio: z.ZodDefault<z.ZodNumber>;
1525
- /** Model to use for memory extraction during flush (defaults to cheap model) */
1526
1041
  flushModel: z.ZodOptional<z.ZodString>;
1527
- /** Max characters per summarization chunk. Default: 50_000. */
1528
1042
  chunkMaxChars: z.ZodDefault<z.ZodNumber>;
1529
- /** Number of overlap messages between chunks. Default: 2. */
1530
1043
  chunkOverlapMessages: z.ZodDefault<z.ZodNumber>;
1531
- /** Whether to merge chunk summaries via LLM. Default: true. */
1532
1044
  chunkMergeSummaries: z.ZodDefault<z.ZodBoolean>;
1533
- /** Tokens reserved for summary during SDK auto-compaction. Default: 16384. */
1534
1045
  reserveTokens: z.ZodDefault<z.ZodNumber>;
1535
- /** Tokens worth of recent messages to keep after SDK auto-compaction. Default: 32768. */
1536
1046
  keepRecentTokens: z.ZodDefault<z.ZodNumber>;
1537
- /** AGENTS.md section names to re-inject after compaction. */
1538
1047
  postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
1539
1048
  }, z.core.$strict>>;
1540
1049
  }, z.core.$strict>>;
1541
1050
  concurrency: z.ZodDefault<z.ZodObject<{
1542
- /** Maximum concurrent agent runs for this agent (default: 4) */
1543
1051
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
1544
- /** Maximum queued messages per session before overflow (default: 50) */
1545
1052
  maxQueuedPerSession: z.ZodDefault<z.ZodNumber>;
1546
1053
  }, z.core.$strict>>;
1547
1054
  broadcastGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
1548
- /** Unique group identifier (referenced in broadcast tool calls) */
1549
1055
  id: z.ZodString;
1550
- /** Human-readable group name */
1551
1056
  name: z.ZodDefault<z.ZodString>;
1552
- /** Channel targets for simultaneous delivery */
1553
1057
  targets: z.ZodDefault<z.ZodArray<z.ZodObject<{
1554
- /** Channel type (e.g., "telegram", "discord", "slack") */
1555
1058
  channelType: z.ZodString;
1556
- /** Channel identifier within the platform */
1557
1059
  channelId: z.ZodString;
1558
- /** Chat/conversation identifier within the channel */
1559
1060
  chatId: z.ZodString;
1560
1061
  }, z.core.$strict>>>;
1561
- /** Whether this broadcast group is active */
1562
1062
  enabled: z.ZodDefault<z.ZodBoolean>;
1563
1063
  }, z.core.$strict>>>;
1564
1064
  elevatedReply: z.ZodDefault<z.ZodObject<{
1565
- /** Enable trust-based model/prompt routing */
1566
1065
  enabled: z.ZodDefault<z.ZodBoolean>;
1567
- /** Map of trust level name to model route name (from modelRoutes) */
1568
1066
  trustModelRoutes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1569
- /** Map of trust level name to system prompt section override text */
1570
1067
  trustPromptOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1571
- /** Default trust level for unknown senders */
1572
1068
  defaultTrustLevel: z.ZodDefault<z.ZodString>;
1573
- /** Per-sender trust level overrides (senderId -> trust level name) */
1574
1069
  senderTrustMap: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1575
1070
  }, z.core.$strict>>;
1576
1071
  tracing: z.ZodDefault<z.ZodObject<{
1577
- /** Enable per-LLM-call JSONL trace files */
1578
1072
  enabled: z.ZodDefault<z.ZodBoolean>;
1579
- /** Output directory for JSONL trace files. Supports ~ expansion. Default: ~/.comis/traces */
1580
1073
  outputDir: z.ZodDefault<z.ZodString>;
1581
1074
  }, z.core.$strict>>;
1582
1075
  secrets: z.ZodOptional<z.ZodObject<{
1583
1076
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
1584
1077
  }, z.core.$strict>>;
1585
1078
  contextGuard: z.ZodDefault<z.ZodObject<{
1586
- /** Enable context window guard checks during execution */
1587
1079
  enabled: z.ZodDefault<z.ZodBoolean>;
1588
- /** Warn when context usage reaches this percent (0-100). Default: 80. */
1589
1080
  warnPercent: z.ZodDefault<z.ZodNumber>;
1590
- /** Block (abort) execution when context usage reaches this percent (0-100). Default: 95. */
1591
1081
  blockPercent: z.ZodDefault<z.ZodNumber>;
1592
1082
  }, z.core.$strict>>;
1593
1083
  contextPruning: z.ZodOptional<z.ZodObject<{
1594
- /** Master toggle for progressive context pruning */
1595
1084
  enabled: z.ZodDefault<z.ZodBoolean>;
1596
- /** Context ratio at which soft-trim begins (head+tail preservation) */
1597
1085
  softTrimRatio: z.ZodDefault<z.ZodNumber>;
1598
- /** Context ratio at which hard-clear begins (full placeholder replacement) */
1599
1086
  hardClearRatio: z.ZodDefault<z.ZodNumber>;
1600
- /** Number of recent assistant messages to protect from pruning */
1601
1087
  keepLastAssistants: z.ZodDefault<z.ZodNumber>;
1602
- /** Minimum tool result size in characters eligible for soft-trim */
1603
1088
  minPrunableToolChars: z.ZodDefault<z.ZodNumber>;
1604
- /** Tool names never pruned (strings in config, converted to RegExp patterns at runtime by consumer) */
1605
1089
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
1606
1090
  }, z.core.$strict>>;
1607
1091
  contextEngine: z.ZodOptional<z.ZodObject<{
1608
- /** Master toggle for the context engine pipeline (enabled by default). */
1609
1092
  enabled: z.ZodDefault<z.ZodBoolean>;
1610
- /** Operating mode: "pipeline" for sequential layer composition, "dag" for graph-based context management. */
1611
1093
  version: z.ZodDefault<z.ZodEnum<{
1612
1094
  pipeline: "pipeline";
1613
1095
  dag: "dag";
1614
1096
  }>>;
1615
- /** Number of recent assistant turns that retain thinking blocks (older turns get stripped). */
1616
1097
  thinkingKeepTurns: z.ZodDefault<z.ZodNumber>;
1617
- /** Idle gap (ms) above which signed thinking state is treated as drifted and
1618
- * scrubbed pre-send to avoid provider replay-rejection. Default 30 min —
1619
- * below long-TTL caches and below the 74-min production incident gap. Also
1620
- * triggers on model id / provider / api change (those checks are
1621
- * unconditional regardless of this idle threshold). Range: 1 min .. 24 h. */
1622
1098
  replayDriftIdleMs: z.ZodDefault<z.ZodNumber>;
1623
- /** Model for LLM compaction in "provider:modelId" format. Empty string
1624
- * (the default) triggers runtime resolution against the agent's primary
1625
- * provider via pi-ai catalog (fast-tier cost model). Avoids pinning a
1626
- * hardcoded Anthropic literal that goes stale on pi-ai upgrades and
1627
- * cross-routes background ops to Claude when primary is OpenRouter/Google/etc. */
1628
1099
  compactionModel: z.ZodDefault<z.ZodString>;
1629
- /** Minimum age (in tool result positions) before content is eligible for dead content eviction. */
1630
1100
  evictionMinAge: z.ZodDefault<z.ZodNumber>;
1631
- /** Number of recent user turns to keep in context (default 15). */
1632
1101
  historyTurns: z.ZodDefault<z.ZodNumber>;
1633
- /** Per-agent or per-channel-type turn count overrides (e.g., { dm: 10, "trader-1": 30 }). */
1634
1102
  historyTurnOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1635
- /** Number of most recent tool uses that retain full content (older ones are masked). */
1636
1103
  observationKeepWindow: z.ZodDefault<z.ZodNumber>;
1637
- /** Character threshold before observation masking activates (below this, masking is skipped). */
1638
1104
  observationTriggerChars: z.ZodDefault<z.ZodNumber>;
1639
- /** Character threshold below which observation masking deactivates (hysteresis). */
1640
1105
  observationDeactivationChars: z.ZodDefault<z.ZodNumber>;
1641
- /** Keep window for ephemeral-tier tools (web_search, brave_search, web_fetch, link_reader, fetch_url). Shorter than observationKeepWindow. Default: 10. */
1642
1106
  ephemeralKeepWindow: z.ZodDefault<z.ZodNumber>;
1643
- /** Turns to wait before re-triggering LLM compaction after a successful compaction. */
1644
1107
  compactionCooldownTurns: z.ZodDefault<z.ZodNumber>;
1645
- /** Number of user-turn cycles at the head of conversation to preserve during
1646
- * LLM compaction for cache prefix stability. 0 = old behavior
1647
- * (summarize everything, keep tail only). */
1648
1108
  compactionPrefixAnchorTurns: z.ZodDefault<z.ZodNumber>;
1649
- /** Output escalation configuration: auto-retry with higher output budget on max_tokens truncation. */
1650
1109
  outputEscalation: z.ZodDefault<z.ZodObject<{
1651
- /** Master toggle for output escalation. When false, max_tokens truncation is not retried. */
1652
1110
  enabled: z.ZodDefault<z.ZodBoolean>;
1653
- /** Escalated max output tokens for the retry attempt. Must be between 4096 and 128000. */
1654
1111
  escalatedMaxTokens: z.ZodDefault<z.ZodNumber>;
1655
1112
  }, z.core.$strict>>;
1656
- /** Number of most recent turns always included verbatim in DAG context. */
1657
1113
  freshTailTurns: z.ZodDefault<z.ZodNumber>;
1658
- /** Context utilization fraction that triggers DAG compaction (0.1 to 0.95). */
1659
1114
  contextThreshold: z.ZodDefault<z.ZodNumber>;
1660
- /** Minimum fan-out for leaf nodes in the DAG. */
1661
1115
  leafMinFanout: z.ZodDefault<z.ZodNumber>;
1662
- /** Minimum fan-out for condensed (non-leaf) nodes in the DAG. */
1663
1116
  condensedMinFanout: z.ZodDefault<z.ZodNumber>;
1664
- /** Hard minimum fan-out for condensed nodes (lowest allowed). */
1665
1117
  condensedMinFanoutHard: z.ZodDefault<z.ZodNumber>;
1666
- /** Maximum depth for incremental DAG rebuilds (-1 = full rebuild). */
1667
1118
  incrementalMaxDepth: z.ZodDefault<z.ZodNumber>;
1668
- /** Token budget for leaf node chunks in the DAG. */
1669
1119
  leafChunkTokens: z.ZodDefault<z.ZodNumber>;
1670
- /** Target token size for leaf node summaries. */
1671
1120
  leafTargetTokens: z.ZodDefault<z.ZodNumber>;
1672
- /** Target token size for condensed node summaries. */
1673
1121
  condensedTargetTokens: z.ZodDefault<z.ZodNumber>;
1674
- /** Maximum tokens for expanded context retrieval. */
1675
1122
  maxExpandTokens: z.ZodDefault<z.ZodNumber>;
1676
- /** Maximum recall operations per day per agent. */
1677
1123
  maxRecallsPerDay: z.ZodDefault<z.ZodNumber>;
1678
- /** Timeout for recall operations in milliseconds. */
1679
1124
  recallTimeoutMs: z.ZodDefault<z.ZodNumber>;
1680
- /** Token threshold above which a file is considered "large" for DAG processing. */
1681
1125
  largeFileTokenThreshold: z.ZodDefault<z.ZodNumber>;
1682
- /** Number of most recent annotations retained in DAG mode (analogous to observationKeepWindow). */
1683
1126
  annotationKeepWindow: z.ZodDefault<z.ZodNumber>;
1684
- /** Character threshold before annotation eviction activates in DAG mode. */
1685
1127
  annotationTriggerChars: z.ZodDefault<z.ZodNumber>;
1686
- /** Optional model override for DAG summary generation in "provider:modelId" format. */
1687
1128
  summaryModel: z.ZodOptional<z.ZodString>;
1688
- /** Optional provider override for DAG summary generation. */
1689
1129
  summaryProvider: z.ZodOptional<z.ZodString>;
1690
- /** Post-batch continuation handler: when the LLM emits an empty final
1691
- * turn after a successful tool batch, fire a directive followUp with
1692
- * multi-shot retry. Replaces the legacy SEP one-shot completeness nudge
1693
- * (whose enforcement role was superseded; SEP plan extraction + step
1694
- * counting remain intact for observability). */
1695
1130
  postBatchContinuation: z.ZodDefault<z.ZodObject<{
1696
- /** Master toggle. When false, handler returns
1697
- * {recovered: false, outcome: "disabled"} without calling followUp. */
1698
1131
  enabled: z.ZodDefault<z.ZodBoolean>;
1699
- /** Maximum directive followUp attempts before falling through to L3
1700
- * synthesis. 0 = disabled. */
1701
1132
  maxRetries: z.ZodDefault<z.ZodNumber>;
1702
1133
  }, z.core.$strict>>;
1703
1134
  }, z.core.$strict>>;
1704
1135
  sourceGate: z.ZodOptional<z.ZodObject<{
1705
- /** Default byte cap for HTTP responses (matches DEFAULT_SOURCE_PROFILES.web_fetch.maxResponseBytes) */
1706
1136
  maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1707
- /** Whether to strip hidden HTML before extraction */
1708
1137
  stripHiddenHtml: z.ZodDefault<z.ZodBoolean>;
1709
1138
  }, z.core.$strict>>;
1710
1139
  toolLifecycle: z.ZodDefault<z.ZodObject<{
1711
- /** Whether tool lifecycle management is enabled. When false, no usage tracking or demotion occurs. */
1712
1140
  enabled: z.ZodDefault<z.ZodBoolean>;
1713
- /** Number of turns of non-use before a tool is demoted (schema-stripped). */
1714
1141
  demotionThreshold: z.ZodDefault<z.ZodNumber>;
1715
1142
  }, z.core.$strict>>;
1716
1143
  sep: z.ZodOptional<z.ZodObject<{
1717
- /** Enable/disable SEP. Default: true. */
1718
1144
  enabled: z.ZodDefault<z.ZodBoolean>;
1719
- /** Minimum estimated steps to activate planning (below this threshold, overhead isn't worth it). */
1720
1145
  minSteps: z.ZodDefault<z.ZodNumber>;
1721
- /** Whether to inject a verification nudge when all steps complete. Default: true. */
1722
1146
  verificationNudge: z.ZodDefault<z.ZodBoolean>;
1723
- /** Maximum plan steps to track (prevents runaway extraction on vague requests). */
1724
1147
  maxSteps: z.ZodDefault<z.ZodNumber>;
1725
- /** Whether to include progress in user-visible response. Default: false. */
1726
1148
  userVisibleProgress: z.ZodDefault<z.ZodBoolean>;
1727
1149
  }, z.core.$strict>>;
1728
1150
  notification: z.ZodOptional<z.ZodObject<{
@@ -1765,15 +1187,12 @@ export declare const PerAgentConfigSchema: z.ZodObject<{
1765
1187
  }, z.core.$strict>>>;
1766
1188
  }, z.core.$strict>>;
1767
1189
  deferredTools: z.ZodOptional<z.ZodObject<{
1768
- /** Deferral mode: "always" defers all non-core tools, "auto" uses rule+budget heuristics, "never" disables deferral. */
1769
1190
  mode: z.ZodDefault<z.ZodEnum<{
1770
1191
  never: "never";
1771
1192
  always: "always";
1772
1193
  auto: "auto";
1773
1194
  }>>;
1774
- /** Tool names that must never be deferred (force-loaded into active context). Glob patterns NOT supported -- exact names only. */
1775
1195
  neverDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
1776
- /** Tool names that must always be deferred (force-deferred regardless of rules). Glob patterns NOT supported -- exact names only. */
1777
1196
  alwaysDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
1778
1197
  }, z.core.$strict>>;
1779
1198
  backgroundTasks: z.ZodOptional<z.ZodObject<{
@@ -1842,32 +1261,20 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
1842
1261
  maxToolResultChars: z.ZodDefault<z.ZodNumber>;
1843
1262
  preserveRecent: z.ZodDefault<z.ZodNumber>;
1844
1263
  budgets: z.ZodDefault<z.ZodObject<{
1845
- /** Max tokens per single execution */
1846
1264
  perExecution: z.ZodDefault<z.ZodNumber>;
1847
- /** Max tokens per hour (rolling window) */
1848
1265
  perHour: z.ZodDefault<z.ZodNumber>;
1849
- /** Max tokens per day (rolling window) */
1850
1266
  perDay: z.ZodDefault<z.ZodNumber>;
1851
1267
  }, z.core.$strict>>;
1852
1268
  circuitBreaker: z.ZodDefault<z.ZodObject<{
1853
- /** Number of consecutive failures before opening circuit */
1854
1269
  failureThreshold: z.ZodDefault<z.ZodNumber>;
1855
- /** Milliseconds to wait before attempting recovery */
1856
1270
  resetTimeoutMs: z.ZodDefault<z.ZodNumber>;
1857
- /** Milliseconds for half-open probe timeout */
1858
1271
  halfOpenTimeoutMs: z.ZodDefault<z.ZodNumber>;
1859
1272
  }, z.core.$strict>>;
1860
1273
  toolRetryBreaker: z.ZodDefault<z.ZodObject<{
1861
- /** Enable tool retry circuit breaker. Default: true. */
1862
1274
  enabled: z.ZodDefault<z.ZodBoolean>;
1863
- /** Max consecutive failures for same tool+args before blocking. Default: 3. */
1864
1275
  maxConsecutiveFailures: z.ZodDefault<z.ZodNumber>;
1865
- /** Max total failures for a tool name (any args) before blocking all calls. Default: 5. */
1866
1276
  maxToolFailures: z.ZodDefault<z.ZodNumber>;
1867
- /** Suggest alternative tools in block reason. Default: true. */
1868
1277
  suggestAlternatives: z.ZodDefault<z.ZodBoolean>;
1869
- /** Max consecutive same-error-class failures (any args) before blocking. Default: 2.
1870
- * Stricter than args-based because same error + different args = stronger stuck signal. */
1871
1278
  maxConsecutiveErrorPatterns: z.ZodDefault<z.ZodNumber>;
1872
1279
  }, z.core.$strict>>;
1873
1280
  workspace: z.ZodDefault<z.ZodObject<{
@@ -1881,15 +1288,10 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
1881
1288
  default: z.ZodOptional<z.ZodString>;
1882
1289
  }, z.core.$catchall<z.ZodString>>>;
1883
1290
  rag: z.ZodDefault<z.ZodObject<{
1884
- /** Enable automatic memory retrieval before LLM calls */
1885
1291
  enabled: z.ZodDefault<z.ZodBoolean>;
1886
- /** Maximum number of memory results to retrieve */
1887
1292
  maxResults: z.ZodDefault<z.ZodNumber>;
1888
- /** Maximum characters of memory context to inject into system prompt */
1889
1293
  maxContextChars: z.ZodDefault<z.ZodNumber>;
1890
- /** Minimum RRF score threshold (0-1) to include a memory result */
1891
1294
  minScore: z.ZodDefault<z.ZodNumber>;
1892
- /** Trust levels to include in retrieval (external excluded by default for security) */
1893
1295
  includeTrustLevels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1894
1296
  system: "system";
1895
1297
  learned: "learned";
@@ -1897,15 +1299,12 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
1897
1299
  }>>>;
1898
1300
  }, z.core.$strict>>;
1899
1301
  bootstrap: z.ZodDefault<z.ZodObject<{
1900
- /** Per-file character limit for workspace files injected into system prompt */
1901
1302
  maxChars: z.ZodDefault<z.ZodNumber>;
1902
- /** System prompt verbosity mode: full (all sections), minimal (sub-agents), none (identity only) */
1903
1303
  promptMode: z.ZodDefault<z.ZodEnum<{
1904
1304
  minimal: "minimal";
1905
1305
  full: "full";
1906
1306
  none: "none";
1907
1307
  }>>;
1908
- /** When true, USER.md is excluded from bootstrap context in group chat sessions (privacy). Default: true. */
1909
1308
  groupChatFiltering: z.ZodDefault<z.ZodBoolean>;
1910
1309
  }, z.core.$strict>>;
1911
1310
  reactionLevel: z.ZodOptional<z.ZodEnum<{
@@ -1913,82 +1312,53 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
1913
1312
  extensive: "extensive";
1914
1313
  }>>;
1915
1314
  modelFailover: z.ZodDefault<z.ZodObject<{
1916
- /** Ordered list of fallback models to try when primary fails */
1917
1315
  fallbackModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
1918
- /** LLM provider (e.g. "anthropic", "openai") */
1919
1316
  provider: z.ZodString;
1920
- /** Model identifier at the provider */
1921
1317
  modelId: z.ZodString;
1922
1318
  }, z.core.$strict>>>;
1923
- /** Per-provider API key profiles for auth rotation */
1924
1319
  authProfiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
1925
- /** Key name in SecretManager (e.g. "ANTHROPIC_API_KEY_2") */
1926
1320
  keyName: z.ZodString;
1927
- /** Provider this key belongs to (e.g. "anthropic") */
1928
1321
  provider: z.ZodString;
1929
1322
  }, z.core.$strict>>>;
1930
- /** Model allowlist (empty = allow all models) */
1931
1323
  allowedModels: z.ZodDefault<z.ZodArray<z.ZodString>>;
1932
- /** Maximum total attempts across all models/keys */
1933
1324
  maxAttempts: z.ZodDefault<z.ZodNumber>;
1934
- /** Initial cooldown duration in milliseconds (1 min) */
1935
1325
  cooldownInitialMs: z.ZodDefault<z.ZodNumber>;
1936
- /** Exponential cooldown multiplier */
1937
1326
  cooldownMultiplier: z.ZodDefault<z.ZodNumber>;
1938
- /** Maximum cooldown duration in milliseconds (1 hr) */
1939
1327
  cooldownCapMs: z.ZodDefault<z.ZodNumber>;
1940
1328
  }, z.core.$strict>>;
1941
1329
  sdkRetry: z.ZodDefault<z.ZodObject<{
1942
- /** Enable SDK-native retry with exponential backoff */
1943
1330
  enabled: z.ZodDefault<z.ZodBoolean>;
1944
- /** Maximum number of retry attempts for transient errors (5 retries = 6 total attempts) */
1945
1331
  maxRetries: z.ZodDefault<z.ZodNumber>;
1946
- /** Base delay in milliseconds before first retry (4s base with exponential backoff: 4s, 8s, 16s, 32s, 60s capped) */
1947
1332
  baseDelayMs: z.ZodDefault<z.ZodNumber>;
1948
- /** Maximum delay cap in milliseconds between retries */
1949
1333
  maxDelayMs: z.ZodDefault<z.ZodNumber>;
1950
1334
  }, z.core.$strict>>;
1951
1335
  promptTimeout: z.ZodDefault<z.ZodObject<{
1952
- /** Wall-clock timeout for primary prompt calls in milliseconds. Default: 180s. */
1953
1336
  promptTimeoutMs: z.ZodDefault<z.ZodNumber>;
1954
- /** Wall-clock timeout for retry prompt calls in milliseconds. Default: 60s. */
1955
1337
  retryPromptTimeoutMs: z.ZodDefault<z.ZodNumber>;
1956
1338
  }, z.core.$strict>>;
1957
1339
  operationModels: z.ZodDefault<z.ZodObject<{
1958
1340
  cron: z.ZodOptional<z.ZodObject<{
1959
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1960
1341
  model: z.ZodOptional<z.ZodString>;
1961
- /** Timeout override in milliseconds for this operation type. */
1962
1342
  timeout: z.ZodOptional<z.ZodNumber>;
1963
1343
  }, z.core.$strict>>;
1964
1344
  heartbeat: z.ZodOptional<z.ZodObject<{
1965
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1966
1345
  model: z.ZodOptional<z.ZodString>;
1967
- /** Timeout override in milliseconds for this operation type. */
1968
1346
  timeout: z.ZodOptional<z.ZodNumber>;
1969
1347
  }, z.core.$strict>>;
1970
1348
  subagent: z.ZodOptional<z.ZodObject<{
1971
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1972
1349
  model: z.ZodOptional<z.ZodString>;
1973
- /** Timeout override in milliseconds for this operation type. */
1974
1350
  timeout: z.ZodOptional<z.ZodNumber>;
1975
1351
  }, z.core.$strict>>;
1976
1352
  compaction: z.ZodOptional<z.ZodObject<{
1977
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1978
1353
  model: z.ZodOptional<z.ZodString>;
1979
- /** Timeout override in milliseconds for this operation type. */
1980
1354
  timeout: z.ZodOptional<z.ZodNumber>;
1981
1355
  }, z.core.$strict>>;
1982
1356
  taskExtraction: z.ZodOptional<z.ZodObject<{
1983
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1984
1357
  model: z.ZodOptional<z.ZodString>;
1985
- /** Timeout override in milliseconds for this operation type. */
1986
1358
  timeout: z.ZodOptional<z.ZodNumber>;
1987
1359
  }, z.core.$strict>>;
1988
1360
  condensation: z.ZodOptional<z.ZodObject<{
1989
- /** Model override in "provider:modelId" format, or "primary" to use agent's primary model. */
1990
1361
  model: z.ZodOptional<z.ZodString>;
1991
- /** Timeout override in milliseconds for this operation type. */
1992
1362
  timeout: z.ZodOptional<z.ZodNumber>;
1993
1363
  }, z.core.$strict>>;
1994
1364
  }, z.core.$strict>>;
@@ -2048,66 +1418,34 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
2048
1418
  watchDebounceMs: z.ZodDefault<z.ZodNumber>;
2049
1419
  }, z.core.$strict>>;
2050
1420
  scheduler: z.ZodOptional<z.ZodObject<{
2051
- /** Per-agent cron configuration */
2052
1421
  cron: z.ZodDefault<z.ZodObject<{
2053
- /** Enable cron job scheduling for this agent */
2054
1422
  enabled: z.ZodDefault<z.ZodBoolean>;
2055
- /** Maximum concurrent cron job runs for this agent */
2056
1423
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
2057
- /** Default timezone for cron expressions (empty = UTC) */
2058
1424
  defaultTimezone: z.ZodDefault<z.ZodString>;
2059
- /** Maximum number of cron jobs allowed for this agent (0 = unlimited) */
2060
1425
  maxJobs: z.ZodDefault<z.ZodNumber>;
2061
- /** Maximum consecutive errors before auto-suspending a cron job (0 = never suspend). Per-agent override. */
2062
1426
  maxConsecutiveErrors: z.ZodDefault<z.ZodNumber>;
2063
1427
  }, z.core.$strict>>;
2064
- /** Per-agent heartbeat configuration (optional -- inherits from global scheduler.heartbeat) */
2065
1428
  heartbeat: z.ZodOptional<z.ZodObject<{
2066
- /** Override heartbeat enabled state for this agent */
2067
1429
  enabled: z.ZodOptional<z.ZodBoolean>;
2068
- /** Override heartbeat interval in milliseconds */
2069
1430
  intervalMs: z.ZodOptional<z.ZodNumber>;
2070
- /** Override show OK status */
2071
1431
  showOk: z.ZodOptional<z.ZodBoolean>;
2072
- /** Override show alerts */
2073
1432
  showAlerts: z.ZodOptional<z.ZodBoolean>;
2074
- /** Delivery target channel for this agent's heartbeat notifications */
2075
1433
  target: z.ZodOptional<z.ZodObject<{
2076
- /** Channel type (e.g., "telegram", "discord") */
2077
1434
  channelType: z.ZodString;
2078
- /** Channel identifier within the platform */
2079
1435
  channelId: z.ZodString;
2080
- /** Chat/conversation identifier */
2081
1436
  chatId: z.ZodString;
2082
- /** Whether this target is a DM conversation (for DM delivery policy) */
2083
1437
  isDm: z.ZodOptional<z.ZodBoolean>;
2084
1438
  }, z.core.$strict>>;
2085
- /** Custom heartbeat prompt for this agent */
2086
1439
  prompt: z.ZodOptional<z.ZodString>;
2087
- /** Session key for heartbeat conversation isolation */
2088
1440
  session: z.ZodOptional<z.ZodString>;
2089
- /** Whether heartbeat alerts can be delivered to DM conversations (default: true) */
2090
1441
  allowDm: z.ZodOptional<z.ZodBoolean>;
2091
- /** When true, heartbeat bootstrap context includes ONLY HEARTBEAT.md (cost optimization) */
2092
1442
  lightContext: z.ZodOptional<z.ZodBoolean>;
2093
- /** Maximum characters for soft acknowledgment threshold (default applied in scheduler, not schema) */
2094
1443
  ackMaxChars: z.ZodOptional<z.ZodNumber>;
2095
- /** Prefix to strip from LLM responses before delivery */
2096
1444
  responsePrefix: z.ZodOptional<z.ZodString>;
2097
- /** Whether to suppress delivery of HEARTBEAT_OK-only responses from cron triggers (default applied in scheduler) */
2098
1445
  skipHeartbeatOnlyDelivery: z.ZodOptional<z.ZodBoolean>;
2099
- /** Override consecutive failure threshold for alerting (per-agent) */
2100
1446
  alertThreshold: z.ZodOptional<z.ZodNumber>;
2101
- /** Override alert cooldown period in ms (per-agent) */
2102
1447
  alertCooldownMs: z.ZodOptional<z.ZodNumber>;
2103
- /** Override stuck detection timeout in ms (per-agent) */
2104
1448
  staleMs: z.ZodOptional<z.ZodNumber>;
2105
- /** Per-agent heartbeat tool policy override -- matches AgentConfig.toolPolicy shape.
2106
- *
2107
- * Resolution order: heartbeat.toolPolicy > agentConfig.toolPolicy > passthrough.
2108
- * Opt-in: omitting this field preserves the agent's interactive tool set for
2109
- * heartbeat ticks. Use `{ profile: "heartbeat-minimal" }` for the conservative
2110
- * preset in `packages/skills/src/policy/tool-policy.ts`. */
2111
1449
  toolPolicy: z.ZodOptional<z.ZodObject<{
2112
1450
  profile: z.ZodDefault<z.ZodString>;
2113
1451
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -2117,311 +1455,184 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
2117
1455
  }, z.core.$strict>>;
2118
1456
  session: z.ZodOptional<z.ZodObject<{
2119
1457
  resetPolicy: z.ZodOptional<z.ZodObject<{
2120
- /** Reset mode: daily, idle, hybrid (first-to-expire), or none (disabled) */
2121
1458
  mode: z.ZodDefault<z.ZodEnum<{
2122
1459
  daily: "daily";
2123
1460
  idle: "idle";
2124
1461
  hybrid: "hybrid";
2125
1462
  none: "none";
2126
1463
  }>>;
2127
- /** Hour of day for daily reset (0-23, default 4 = 4 AM) */
2128
1464
  dailyResetHour: z.ZodDefault<z.ZodNumber>;
2129
- /** IANA timezone for daily reset (empty string = system local) */
2130
1465
  dailyResetTimezone: z.ZodDefault<z.ZodString>;
2131
- /** Idle timeout in milliseconds (default 4 hours = 14_400_000) */
2132
1466
  idleTimeoutMs: z.ZodDefault<z.ZodNumber>;
2133
- /** Sweep interval in milliseconds (how often to check sessions, default 5 min) */
2134
1467
  sweepIntervalMs: z.ZodDefault<z.ZodNumber>;
2135
- /** Phrases that trigger immediate session reset when sent as a message */
2136
1468
  resetTriggers: z.ZodDefault<z.ZodArray<z.ZodString>>;
2137
- /** Per-session-type overrides (dm, group, thread) */
2138
1469
  perType: z.ZodDefault<z.ZodObject<{
2139
1470
  dm: z.ZodOptional<z.ZodObject<{
2140
- /** Override reset mode for this session type */
2141
1471
  mode: z.ZodOptional<z.ZodEnum<{
2142
1472
  daily: "daily";
2143
1473
  idle: "idle";
2144
1474
  hybrid: "hybrid";
2145
1475
  none: "none";
2146
1476
  }>>;
2147
- /** Override daily reset hour (0-23) */
2148
1477
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
2149
- /** Override IANA timezone for daily reset */
2150
1478
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
2151
- /** Override idle timeout in milliseconds */
2152
1479
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
2153
1480
  }, z.core.$strict>>;
2154
1481
  group: z.ZodOptional<z.ZodObject<{
2155
- /** Override reset mode for this session type */
2156
1482
  mode: z.ZodOptional<z.ZodEnum<{
2157
1483
  daily: "daily";
2158
1484
  idle: "idle";
2159
1485
  hybrid: "hybrid";
2160
1486
  none: "none";
2161
1487
  }>>;
2162
- /** Override daily reset hour (0-23) */
2163
1488
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
2164
- /** Override IANA timezone for daily reset */
2165
1489
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
2166
- /** Override idle timeout in milliseconds */
2167
1490
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
2168
1491
  }, z.core.$strict>>;
2169
1492
  thread: z.ZodOptional<z.ZodObject<{
2170
- /** Override reset mode for this session type */
2171
1493
  mode: z.ZodOptional<z.ZodEnum<{
2172
1494
  daily: "daily";
2173
1495
  idle: "idle";
2174
1496
  hybrid: "hybrid";
2175
1497
  none: "none";
2176
1498
  }>>;
2177
- /** Override daily reset hour (0-23) */
2178
1499
  dailyResetHour: z.ZodOptional<z.ZodNumber>;
2179
- /** Override IANA timezone for daily reset */
2180
1500
  dailyResetTimezone: z.ZodOptional<z.ZodString>;
2181
- /** Override idle timeout in milliseconds */
2182
1501
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
2183
1502
  }, z.core.$strict>>;
2184
1503
  }, z.core.$strict>>;
2185
1504
  }, z.core.$strict>>;
2186
1505
  dmScope: z.ZodOptional<z.ZodObject<{
2187
- /** DM scope mode controlling session isolation granularity */
2188
1506
  mode: z.ZodDefault<z.ZodEnum<{
2189
1507
  main: "main";
2190
1508
  "per-peer": "per-peer";
2191
1509
  "per-channel-peer": "per-channel-peer";
2192
1510
  "per-account-channel-peer": "per-account-channel-peer";
2193
1511
  }>>;
2194
- /** Prepend agent:<agentId>: to session keys for multi-agent isolation */
2195
1512
  agentPrefix: z.ZodDefault<z.ZodBoolean>;
2196
- /** Append :thread:<threadId> to session keys for forum/thread isolation */
2197
1513
  threadIsolation: z.ZodDefault<z.ZodBoolean>;
2198
1514
  }, z.core.$strict>>;
2199
1515
  pruning: z.ZodOptional<z.ZodObject<{
2200
- /** Enable session pruning of oversized tool results */
2201
1516
  enabled: z.ZodDefault<z.ZodBoolean>;
2202
- /** Character threshold above which tool results are soft-trimmed (head + tail with marker) */
2203
1517
  softTrimThresholdChars: z.ZodDefault<z.ZodNumber>;
2204
- /** Character threshold above which tool results are hard-cleared (entire content replaced) */
2205
1518
  hardClearThresholdChars: z.ZodDefault<z.ZodNumber>;
2206
- /** Number of characters to preserve at the start of a soft-trimmed result */
2207
1519
  preserveHeadChars: z.ZodDefault<z.ZodNumber>;
2208
- /** Number of characters to preserve at the end of a soft-trimmed result */
2209
1520
  preserveTailChars: z.ZodDefault<z.ZodNumber>;
2210
- /** Tools whose results are eligible for pruning (empty = all tools eligible) */
2211
1521
  pruneableTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
2212
- /** Tools whose results are never pruned (takes precedence over pruneableTools) */
2213
1522
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
2214
- /** Protect tool results containing image content blocks from pruning */
2215
1523
  protectImageBlocks: z.ZodDefault<z.ZodBoolean>;
2216
- /** Number of recent messages (from end of array) exempt from pruning */
2217
1524
  preserveRecentCount: z.ZodDefault<z.ZodNumber>;
2218
1525
  }, z.core.$strict>>;
2219
1526
  compaction: z.ZodOptional<z.ZodObject<{
2220
- /** Fraction of maxContextChars at which soft flush triggers (memory extraction only) */
2221
1527
  softThresholdRatio: z.ZodDefault<z.ZodNumber>;
2222
- /** Fraction of maxContextChars at which hard compaction triggers (flush + trim) */
2223
1528
  hardThresholdRatio: z.ZodDefault<z.ZodNumber>;
2224
- /** Model to use for memory extraction during flush (defaults to cheap model) */
2225
1529
  flushModel: z.ZodOptional<z.ZodString>;
2226
- /** Max characters per summarization chunk. Default: 50_000. */
2227
1530
  chunkMaxChars: z.ZodDefault<z.ZodNumber>;
2228
- /** Number of overlap messages between chunks. Default: 2. */
2229
1531
  chunkOverlapMessages: z.ZodDefault<z.ZodNumber>;
2230
- /** Whether to merge chunk summaries via LLM. Default: true. */
2231
1532
  chunkMergeSummaries: z.ZodDefault<z.ZodBoolean>;
2232
- /** Tokens reserved for summary during SDK auto-compaction. Default: 16384. */
2233
1533
  reserveTokens: z.ZodDefault<z.ZodNumber>;
2234
- /** Tokens worth of recent messages to keep after SDK auto-compaction. Default: 32768. */
2235
1534
  keepRecentTokens: z.ZodDefault<z.ZodNumber>;
2236
- /** AGENTS.md section names to re-inject after compaction. */
2237
1535
  postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
2238
1536
  }, z.core.$strict>>;
2239
1537
  }, z.core.$strict>>;
2240
1538
  concurrency: z.ZodDefault<z.ZodObject<{
2241
- /** Maximum concurrent agent runs for this agent (default: 4) */
2242
1539
  maxConcurrentRuns: z.ZodDefault<z.ZodNumber>;
2243
- /** Maximum queued messages per session before overflow (default: 50) */
2244
1540
  maxQueuedPerSession: z.ZodDefault<z.ZodNumber>;
2245
1541
  }, z.core.$strict>>;
2246
1542
  broadcastGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
2247
- /** Unique group identifier (referenced in broadcast tool calls) */
2248
1543
  id: z.ZodString;
2249
- /** Human-readable group name */
2250
1544
  name: z.ZodDefault<z.ZodString>;
2251
- /** Channel targets for simultaneous delivery */
2252
1545
  targets: z.ZodDefault<z.ZodArray<z.ZodObject<{
2253
- /** Channel type (e.g., "telegram", "discord", "slack") */
2254
1546
  channelType: z.ZodString;
2255
- /** Channel identifier within the platform */
2256
1547
  channelId: z.ZodString;
2257
- /** Chat/conversation identifier within the channel */
2258
1548
  chatId: z.ZodString;
2259
1549
  }, z.core.$strict>>>;
2260
- /** Whether this broadcast group is active */
2261
1550
  enabled: z.ZodDefault<z.ZodBoolean>;
2262
1551
  }, z.core.$strict>>>;
2263
1552
  elevatedReply: z.ZodDefault<z.ZodObject<{
2264
- /** Enable trust-based model/prompt routing */
2265
1553
  enabled: z.ZodDefault<z.ZodBoolean>;
2266
- /** Map of trust level name to model route name (from modelRoutes) */
2267
1554
  trustModelRoutes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2268
- /** Map of trust level name to system prompt section override text */
2269
1555
  trustPromptOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2270
- /** Default trust level for unknown senders */
2271
1556
  defaultTrustLevel: z.ZodDefault<z.ZodString>;
2272
- /** Per-sender trust level overrides (senderId -> trust level name) */
2273
1557
  senderTrustMap: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2274
1558
  }, z.core.$strict>>;
2275
1559
  tracing: z.ZodDefault<z.ZodObject<{
2276
- /** Enable per-LLM-call JSONL trace files */
2277
1560
  enabled: z.ZodDefault<z.ZodBoolean>;
2278
- /** Output directory for JSONL trace files. Supports ~ expansion. Default: ~/.comis/traces */
2279
1561
  outputDir: z.ZodDefault<z.ZodString>;
2280
1562
  }, z.core.$strict>>;
2281
1563
  secrets: z.ZodOptional<z.ZodObject<{
2282
1564
  allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
2283
1565
  }, z.core.$strict>>;
2284
1566
  contextGuard: z.ZodDefault<z.ZodObject<{
2285
- /** Enable context window guard checks during execution */
2286
1567
  enabled: z.ZodDefault<z.ZodBoolean>;
2287
- /** Warn when context usage reaches this percent (0-100). Default: 80. */
2288
1568
  warnPercent: z.ZodDefault<z.ZodNumber>;
2289
- /** Block (abort) execution when context usage reaches this percent (0-100). Default: 95. */
2290
1569
  blockPercent: z.ZodDefault<z.ZodNumber>;
2291
1570
  }, z.core.$strict>>;
2292
1571
  contextPruning: z.ZodOptional<z.ZodObject<{
2293
- /** Master toggle for progressive context pruning */
2294
1572
  enabled: z.ZodDefault<z.ZodBoolean>;
2295
- /** Context ratio at which soft-trim begins (head+tail preservation) */
2296
1573
  softTrimRatio: z.ZodDefault<z.ZodNumber>;
2297
- /** Context ratio at which hard-clear begins (full placeholder replacement) */
2298
1574
  hardClearRatio: z.ZodDefault<z.ZodNumber>;
2299
- /** Number of recent assistant messages to protect from pruning */
2300
1575
  keepLastAssistants: z.ZodDefault<z.ZodNumber>;
2301
- /** Minimum tool result size in characters eligible for soft-trim */
2302
1576
  minPrunableToolChars: z.ZodDefault<z.ZodNumber>;
2303
- /** Tool names never pruned (strings in config, converted to RegExp patterns at runtime by consumer) */
2304
1577
  protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
2305
1578
  }, z.core.$strict>>;
2306
1579
  contextEngine: z.ZodOptional<z.ZodObject<{
2307
- /** Master toggle for the context engine pipeline (enabled by default). */
2308
1580
  enabled: z.ZodDefault<z.ZodBoolean>;
2309
- /** Operating mode: "pipeline" for sequential layer composition, "dag" for graph-based context management. */
2310
1581
  version: z.ZodDefault<z.ZodEnum<{
2311
1582
  pipeline: "pipeline";
2312
1583
  dag: "dag";
2313
1584
  }>>;
2314
- /** Number of recent assistant turns that retain thinking blocks (older turns get stripped). */
2315
1585
  thinkingKeepTurns: z.ZodDefault<z.ZodNumber>;
2316
- /** Idle gap (ms) above which signed thinking state is treated as drifted and
2317
- * scrubbed pre-send to avoid provider replay-rejection. Default 30 min —
2318
- * below long-TTL caches and below the 74-min production incident gap. Also
2319
- * triggers on model id / provider / api change (those checks are
2320
- * unconditional regardless of this idle threshold). Range: 1 min .. 24 h. */
2321
1586
  replayDriftIdleMs: z.ZodDefault<z.ZodNumber>;
2322
- /** Model for LLM compaction in "provider:modelId" format. Empty string
2323
- * (the default) triggers runtime resolution against the agent's primary
2324
- * provider via pi-ai catalog (fast-tier cost model). Avoids pinning a
2325
- * hardcoded Anthropic literal that goes stale on pi-ai upgrades and
2326
- * cross-routes background ops to Claude when primary is OpenRouter/Google/etc. */
2327
1587
  compactionModel: z.ZodDefault<z.ZodString>;
2328
- /** Minimum age (in tool result positions) before content is eligible for dead content eviction. */
2329
1588
  evictionMinAge: z.ZodDefault<z.ZodNumber>;
2330
- /** Number of recent user turns to keep in context (default 15). */
2331
1589
  historyTurns: z.ZodDefault<z.ZodNumber>;
2332
- /** Per-agent or per-channel-type turn count overrides (e.g., { dm: 10, "trader-1": 30 }). */
2333
1590
  historyTurnOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2334
- /** Number of most recent tool uses that retain full content (older ones are masked). */
2335
1591
  observationKeepWindow: z.ZodDefault<z.ZodNumber>;
2336
- /** Character threshold before observation masking activates (below this, masking is skipped). */
2337
1592
  observationTriggerChars: z.ZodDefault<z.ZodNumber>;
2338
- /** Character threshold below which observation masking deactivates (hysteresis). */
2339
1593
  observationDeactivationChars: z.ZodDefault<z.ZodNumber>;
2340
- /** Keep window for ephemeral-tier tools (web_search, brave_search, web_fetch, link_reader, fetch_url). Shorter than observationKeepWindow. Default: 10. */
2341
1594
  ephemeralKeepWindow: z.ZodDefault<z.ZodNumber>;
2342
- /** Turns to wait before re-triggering LLM compaction after a successful compaction. */
2343
1595
  compactionCooldownTurns: z.ZodDefault<z.ZodNumber>;
2344
- /** Number of user-turn cycles at the head of conversation to preserve during
2345
- * LLM compaction for cache prefix stability. 0 = old behavior
2346
- * (summarize everything, keep tail only). */
2347
1596
  compactionPrefixAnchorTurns: z.ZodDefault<z.ZodNumber>;
2348
- /** Output escalation configuration: auto-retry with higher output budget on max_tokens truncation. */
2349
1597
  outputEscalation: z.ZodDefault<z.ZodObject<{
2350
- /** Master toggle for output escalation. When false, max_tokens truncation is not retried. */
2351
1598
  enabled: z.ZodDefault<z.ZodBoolean>;
2352
- /** Escalated max output tokens for the retry attempt. Must be between 4096 and 128000. */
2353
1599
  escalatedMaxTokens: z.ZodDefault<z.ZodNumber>;
2354
1600
  }, z.core.$strict>>;
2355
- /** Number of most recent turns always included verbatim in DAG context. */
2356
1601
  freshTailTurns: z.ZodDefault<z.ZodNumber>;
2357
- /** Context utilization fraction that triggers DAG compaction (0.1 to 0.95). */
2358
1602
  contextThreshold: z.ZodDefault<z.ZodNumber>;
2359
- /** Minimum fan-out for leaf nodes in the DAG. */
2360
1603
  leafMinFanout: z.ZodDefault<z.ZodNumber>;
2361
- /** Minimum fan-out for condensed (non-leaf) nodes in the DAG. */
2362
1604
  condensedMinFanout: z.ZodDefault<z.ZodNumber>;
2363
- /** Hard minimum fan-out for condensed nodes (lowest allowed). */
2364
1605
  condensedMinFanoutHard: z.ZodDefault<z.ZodNumber>;
2365
- /** Maximum depth for incremental DAG rebuilds (-1 = full rebuild). */
2366
1606
  incrementalMaxDepth: z.ZodDefault<z.ZodNumber>;
2367
- /** Token budget for leaf node chunks in the DAG. */
2368
1607
  leafChunkTokens: z.ZodDefault<z.ZodNumber>;
2369
- /** Target token size for leaf node summaries. */
2370
1608
  leafTargetTokens: z.ZodDefault<z.ZodNumber>;
2371
- /** Target token size for condensed node summaries. */
2372
1609
  condensedTargetTokens: z.ZodDefault<z.ZodNumber>;
2373
- /** Maximum tokens for expanded context retrieval. */
2374
1610
  maxExpandTokens: z.ZodDefault<z.ZodNumber>;
2375
- /** Maximum recall operations per day per agent. */
2376
1611
  maxRecallsPerDay: z.ZodDefault<z.ZodNumber>;
2377
- /** Timeout for recall operations in milliseconds. */
2378
1612
  recallTimeoutMs: z.ZodDefault<z.ZodNumber>;
2379
- /** Token threshold above which a file is considered "large" for DAG processing. */
2380
1613
  largeFileTokenThreshold: z.ZodDefault<z.ZodNumber>;
2381
- /** Number of most recent annotations retained in DAG mode (analogous to observationKeepWindow). */
2382
1614
  annotationKeepWindow: z.ZodDefault<z.ZodNumber>;
2383
- /** Character threshold before annotation eviction activates in DAG mode. */
2384
1615
  annotationTriggerChars: z.ZodDefault<z.ZodNumber>;
2385
- /** Optional model override for DAG summary generation in "provider:modelId" format. */
2386
1616
  summaryModel: z.ZodOptional<z.ZodString>;
2387
- /** Optional provider override for DAG summary generation. */
2388
1617
  summaryProvider: z.ZodOptional<z.ZodString>;
2389
- /** Post-batch continuation handler: when the LLM emits an empty final
2390
- * turn after a successful tool batch, fire a directive followUp with
2391
- * multi-shot retry. Replaces the legacy SEP one-shot completeness nudge
2392
- * (whose enforcement role was superseded; SEP plan extraction + step
2393
- * counting remain intact for observability). */
2394
1618
  postBatchContinuation: z.ZodDefault<z.ZodObject<{
2395
- /** Master toggle. When false, handler returns
2396
- * {recovered: false, outcome: "disabled"} without calling followUp. */
2397
1619
  enabled: z.ZodDefault<z.ZodBoolean>;
2398
- /** Maximum directive followUp attempts before falling through to L3
2399
- * synthesis. 0 = disabled. */
2400
1620
  maxRetries: z.ZodDefault<z.ZodNumber>;
2401
1621
  }, z.core.$strict>>;
2402
1622
  }, z.core.$strict>>;
2403
1623
  sourceGate: z.ZodOptional<z.ZodObject<{
2404
- /** Default byte cap for HTTP responses (matches DEFAULT_SOURCE_PROFILES.web_fetch.maxResponseBytes) */
2405
1624
  maxResponseBytes: z.ZodDefault<z.ZodNumber>;
2406
- /** Whether to strip hidden HTML before extraction */
2407
1625
  stripHiddenHtml: z.ZodDefault<z.ZodBoolean>;
2408
1626
  }, z.core.$strict>>;
2409
1627
  toolLifecycle: z.ZodDefault<z.ZodObject<{
2410
- /** Whether tool lifecycle management is enabled. When false, no usage tracking or demotion occurs. */
2411
1628
  enabled: z.ZodDefault<z.ZodBoolean>;
2412
- /** Number of turns of non-use before a tool is demoted (schema-stripped). */
2413
1629
  demotionThreshold: z.ZodDefault<z.ZodNumber>;
2414
1630
  }, z.core.$strict>>;
2415
1631
  sep: z.ZodOptional<z.ZodObject<{
2416
- /** Enable/disable SEP. Default: true. */
2417
1632
  enabled: z.ZodDefault<z.ZodBoolean>;
2418
- /** Minimum estimated steps to activate planning (below this threshold, overhead isn't worth it). */
2419
1633
  minSteps: z.ZodDefault<z.ZodNumber>;
2420
- /** Whether to inject a verification nudge when all steps complete. Default: true. */
2421
1634
  verificationNudge: z.ZodDefault<z.ZodBoolean>;
2422
- /** Maximum plan steps to track (prevents runaway extraction on vague requests). */
2423
1635
  maxSteps: z.ZodDefault<z.ZodNumber>;
2424
- /** Whether to include progress in user-visible response. Default: false. */
2425
1636
  userVisibleProgress: z.ZodDefault<z.ZodBoolean>;
2426
1637
  }, z.core.$strict>>;
2427
1638
  notification: z.ZodOptional<z.ZodObject<{
@@ -2464,15 +1675,12 @@ export declare const AgentsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
2464
1675
  }, z.core.$strict>>>;
2465
1676
  }, z.core.$strict>>;
2466
1677
  deferredTools: z.ZodOptional<z.ZodObject<{
2467
- /** Deferral mode: "always" defers all non-core tools, "auto" uses rule+budget heuristics, "never" disables deferral. */
2468
1678
  mode: z.ZodDefault<z.ZodEnum<{
2469
1679
  never: "never";
2470
1680
  always: "always";
2471
1681
  auto: "auto";
2472
1682
  }>>;
2473
- /** Tool names that must never be deferred (force-loaded into active context). Glob patterns NOT supported -- exact names only. */
2474
1683
  neverDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
2475
- /** Tool names that must always be deferred (force-deferred regardless of rules). Glob patterns NOT supported -- exact names only. */
2476
1684
  alwaysDefer: z.ZodDefault<z.ZodArray<z.ZodString>>;
2477
1685
  }, z.core.$strict>>;
2478
1686
  backgroundTasks: z.ZodOptional<z.ZodObject<{