comisai 1.0.34 → 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 (448) hide show
  1. package/node_modules/@comis/agent/dist/background/auto-background-middleware.d.ts +11 -1
  2. package/node_modules/@comis/agent/dist/background/auto-background-middleware.js +30 -4
  3. package/node_modules/@comis/agent/dist/background/background-task-manager.d.ts +22 -2
  4. package/node_modules/@comis/agent/dist/background/background-task-manager.js +88 -40
  5. package/node_modules/@comis/agent/dist/background/background-task-persistence.js +34 -4
  6. package/node_modules/@comis/agent/dist/background/background-task-types.d.ts +59 -3
  7. package/node_modules/@comis/agent/dist/background/background-task-types.js +1 -1
  8. package/node_modules/@comis/agent/dist/background/completion-dispatcher.d.ts +130 -0
  9. package/node_modules/@comis/agent/dist/background/completion-dispatcher.js +215 -0
  10. package/node_modules/@comis/agent/dist/background/completion-formatter.d.ts +39 -0
  11. package/node_modules/@comis/agent/dist/background/completion-formatter.js +77 -0
  12. package/node_modules/@comis/agent/dist/background/completion-runner.d.ts +62 -0
  13. package/node_modules/@comis/agent/dist/background/completion-runner.js +234 -0
  14. package/node_modules/@comis/agent/dist/background/index.d.ts +10 -1
  15. package/node_modules/@comis/agent/dist/background/index.js +4 -0
  16. package/node_modules/@comis/agent/dist/background/session-resolver.d.ts +85 -0
  17. package/node_modules/@comis/agent/dist/background/session-resolver.js +78 -0
  18. package/node_modules/@comis/agent/dist/bootstrap/sections/messaging-sections.js +1 -0
  19. package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.js +3 -3
  20. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +30 -2
  21. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +51 -2
  22. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.d.ts +22 -0
  23. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.js +2 -2
  24. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.d.ts +1 -5
  25. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.js +2 -14
  26. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +43 -2
  27. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +17 -2
  28. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +32 -23
  29. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +145 -62
  30. package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.d.ts +6 -7
  31. package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.js +24 -25
  32. package/node_modules/@comis/agent/dist/budget/cost-tracker.d.ts +1 -1
  33. package/node_modules/@comis/agent/dist/context-engine/constants.d.ts +5 -5
  34. package/node_modules/@comis/agent/dist/context-engine/constants.js +12 -12
  35. package/node_modules/@comis/agent/dist/context-engine/context-engine.js +13 -4
  36. package/node_modules/@comis/agent/dist/context-engine/dag-annotator.d.ts +1 -2
  37. package/node_modules/@comis/agent/dist/context-engine/dag-annotator.js +1 -2
  38. package/node_modules/@comis/agent/dist/context-engine/llm-compaction.js +20 -16
  39. package/node_modules/@comis/agent/dist/context-engine/rehydration.js +6 -6
  40. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.d.ts +12 -12
  41. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.js +36 -22
  42. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.d.ts +10 -10
  43. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.js +14 -14
  44. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.d.ts +11 -13
  45. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.js +14 -15
  46. package/node_modules/@comis/agent/dist/context-engine/types-core.d.ts +15 -0
  47. package/node_modules/@comis/agent/dist/executor/cache-break-detection.d.ts +6 -6
  48. package/node_modules/@comis/agent/dist/executor/cache-break-detection.js +8 -8
  49. package/node_modules/@comis/agent/dist/executor/capability-index-context.d.ts +72 -0
  50. package/node_modules/@comis/agent/dist/executor/capability-index-context.js +329 -0
  51. package/node_modules/@comis/agent/dist/executor/drain-helper.d.ts +122 -0
  52. package/node_modules/@comis/agent/dist/executor/drain-helper.js +173 -0
  53. package/node_modules/@comis/agent/dist/executor/error-classifier.js +2 -2
  54. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.d.ts +16 -0
  55. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +46 -5
  56. package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +78 -4
  57. package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +150 -31
  58. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +7 -0
  59. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +26 -5
  60. package/node_modules/@comis/agent/dist/executor/executor-response-filter.d.ts +7 -6
  61. package/node_modules/@comis/agent/dist/executor/executor-response-filter.js +9 -42
  62. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.d.ts +18 -1
  63. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +20 -18
  64. package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.d.ts +2 -2
  65. package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.js +4 -4
  66. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.d.ts +11 -2
  67. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.js +16 -2
  68. package/node_modules/@comis/agent/dist/executor/phase-filter.d.ts +2 -2
  69. package/node_modules/@comis/agent/dist/executor/phase-filter.js +5 -7
  70. package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +21 -2
  71. package/node_modules/@comis/agent/dist/executor/pi-executor.js +96 -18
  72. package/node_modules/@comis/agent/dist/executor/post-batch-continuation.js +7 -7
  73. package/node_modules/@comis/agent/dist/executor/prompt-assembly.d.ts +9 -1
  74. package/node_modules/@comis/agent/dist/executor/prompt-assembly.js +15 -1
  75. package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.d.ts +1 -1
  76. package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +1 -1
  77. package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +18 -27
  78. package/node_modules/@comis/agent/dist/executor/tool-deferral.js +34 -43
  79. package/node_modules/@comis/agent/dist/index.d.ts +17 -0
  80. package/node_modules/@comis/agent/dist/index.js +32 -11
  81. package/node_modules/@comis/agent/dist/model/auth-provider.d.ts +25 -2
  82. package/node_modules/@comis/agent/dist/model/auth-provider.js +6 -0
  83. package/node_modules/@comis/agent/dist/model/compaction-model-resolver.d.ts +3 -3
  84. package/node_modules/@comis/agent/dist/model/compaction-model-resolver.js +3 -3
  85. package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +1 -1
  86. package/node_modules/@comis/agent/dist/model/model-scanner.js +1 -1
  87. package/node_modules/@comis/agent/dist/model/oauth-credential-store-file.d.ts +37 -0
  88. package/node_modules/@comis/agent/dist/model/oauth-credential-store-file.js +279 -0
  89. package/node_modules/@comis/agent/dist/model/oauth-credential-store-selector.d.ts +49 -0
  90. package/node_modules/@comis/agent/dist/model/oauth-credential-store-selector.js +50 -0
  91. package/node_modules/@comis/agent/dist/model/oauth-device-code.d.ts +57 -0
  92. package/node_modules/@comis/agent/dist/model/oauth-device-code.js +302 -0
  93. package/node_modules/@comis/agent/dist/model/oauth-env.d.ts +33 -0
  94. package/node_modules/@comis/agent/dist/model/oauth-env.js +38 -0
  95. package/node_modules/@comis/agent/dist/model/oauth-errors.d.ts +41 -0
  96. package/node_modules/@comis/agent/dist/model/oauth-errors.js +88 -0
  97. package/node_modules/@comis/agent/dist/model/oauth-identity.d.ts +53 -0
  98. package/node_modules/@comis/agent/dist/model/oauth-identity.js +141 -0
  99. package/node_modules/@comis/agent/dist/model/oauth-login-runner.d.ts +99 -0
  100. package/node_modules/@comis/agent/dist/model/oauth-login-runner.js +374 -0
  101. package/node_modules/@comis/agent/dist/model/oauth-tls-preflight.d.ts +58 -0
  102. package/node_modules/@comis/agent/dist/model/oauth-tls-preflight.js +82 -0
  103. package/node_modules/@comis/agent/dist/model/oauth-token-manager.d.ts +86 -16
  104. package/node_modules/@comis/agent/dist/model/oauth-token-manager.js +961 -66
  105. package/node_modules/@comis/agent/dist/model/operation-model-defaults.d.ts +9 -4
  106. package/node_modules/@comis/agent/dist/model/operation-model-defaults.js +36 -9
  107. package/node_modules/@comis/agent/dist/model/resolve-provider-api-key.d.ts +48 -0
  108. package/node_modules/@comis/agent/dist/model/resolve-provider-api-key.js +66 -0
  109. package/node_modules/@comis/agent/dist/provider/capabilities.d.ts +5 -5
  110. package/node_modules/@comis/agent/dist/provider/capabilities.js +10 -23
  111. package/node_modules/@comis/agent/dist/safety/tool-output-safety.js +3 -3
  112. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.d.ts +11 -1
  113. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.js +19 -22
  114. package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +17 -3
  115. package/node_modules/@comis/agent/dist/session/comis-session-manager.js +1 -1
  116. package/node_modules/@comis/agent/dist/spawn/narrative-caster.d.ts +10 -0
  117. package/node_modules/@comis/agent/dist/spawn/narrative-caster.js +5 -1
  118. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.d.ts +1 -1
  119. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +5 -5
  120. package/node_modules/@comis/agent/dist/workspace/data-env.d.ts +38 -0
  121. package/node_modules/@comis/agent/dist/workspace/data-env.js +56 -0
  122. package/node_modules/@comis/agent/dist/workspace/index.d.ts +1 -0
  123. package/node_modules/@comis/agent/dist/workspace/index.js +1 -0
  124. package/node_modules/@comis/agent/dist/workspace/templates.js +5 -1
  125. package/node_modules/@comis/agent/package.json +1 -1
  126. package/node_modules/@comis/channels/dist/email/email-adapter.js +6 -6
  127. package/node_modules/@comis/channels/dist/email/imap-lifecycle.js +7 -7
  128. package/node_modules/@comis/channels/dist/index.d.ts +1 -1
  129. package/node_modules/@comis/channels/dist/index.js +1 -1
  130. package/node_modules/@comis/channels/dist/shared/channel-manager.d.ts +9 -3
  131. package/node_modules/@comis/channels/dist/shared/deliver-to-channel.js +12 -10
  132. package/node_modules/@comis/channels/dist/shared/inbound-gate.d.ts +1 -1
  133. package/node_modules/@comis/channels/dist/shared/inbound-gate.js +22 -7
  134. package/node_modules/@comis/channels/dist/shared/inbound-pipeline.d.ts +10 -3
  135. package/node_modules/@comis/channels/dist/shared/inbound-route.d.ts +1 -1
  136. package/node_modules/@comis/channels/dist/shared/inbound-route.js +13 -2
  137. package/node_modules/@comis/channels/dist/shared/response-filter.d.ts +11 -24
  138. package/node_modules/@comis/channels/dist/shared/response-filter.js +25 -53
  139. package/node_modules/@comis/channels/dist/telegram/telegram-adapter.js +1 -1
  140. package/node_modules/@comis/channels/package.json +1 -1
  141. package/node_modules/@comis/cli/dist/cli.js +2 -0
  142. package/node_modules/@comis/cli/dist/commands/agent.d.ts +3 -3
  143. package/node_modules/@comis/cli/dist/commands/agent.js +46 -3
  144. package/node_modules/@comis/cli/dist/commands/auth.d.ts +37 -0
  145. package/node_modules/@comis/cli/dist/commands/auth.js +433 -0
  146. package/node_modules/@comis/cli/dist/commands/doctor.d.ts +4 -1
  147. package/node_modules/@comis/cli/dist/commands/doctor.js +20 -5
  148. package/node_modules/@comis/cli/dist/commands/providers.d.ts +1 -2
  149. package/node_modules/@comis/cli/dist/commands/providers.js +5 -6
  150. package/node_modules/@comis/cli/dist/doctor/checks/oauth-health.d.ts +39 -0
  151. package/node_modules/@comis/cli/dist/doctor/checks/oauth-health.js +399 -0
  152. package/node_modules/@comis/cli/dist/doctor/types.d.ts +19 -0
  153. package/node_modules/@comis/cli/dist/index.d.ts +1 -0
  154. package/node_modules/@comis/cli/dist/index.js +10 -4
  155. package/node_modules/@comis/cli/dist/output/relative-time.d.ts +23 -0
  156. package/node_modules/@comis/cli/dist/output/relative-time.js +36 -0
  157. package/node_modules/@comis/cli/dist/wizard/non-interactive.js +17 -8
  158. package/node_modules/@comis/cli/dist/wizard/steps/03-provider.js +2 -1
  159. package/node_modules/@comis/cli/dist/wizard/steps/04-credentials.js +223 -34
  160. package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +14 -0
  161. package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.js +3 -3
  162. package/node_modules/@comis/cli/dist/wizard/types.d.ts +7 -0
  163. package/node_modules/@comis/cli/package.json +1 -1
  164. package/node_modules/@comis/core/dist/bootstrap.d.ts +1 -1
  165. package/node_modules/@comis/core/dist/config/env-substitution.d.ts +66 -0
  166. package/node_modules/@comis/core/dist/config/env-substitution.js +115 -0
  167. package/node_modules/@comis/core/dist/config/field-metadata.js +2 -0
  168. package/node_modules/@comis/core/dist/config/immutable-keys.js +4 -1
  169. package/node_modules/@comis/core/dist/config/index.d.ts +7 -1
  170. package/node_modules/@comis/core/dist/config/index.js +4 -1
  171. package/node_modules/@comis/core/dist/config/loader.js +61 -0
  172. package/node_modules/@comis/core/dist/config/managed-sections.d.ts +3 -3
  173. package/node_modules/@comis/core/dist/config/managed-sections.js +10 -5
  174. package/node_modules/@comis/core/dist/config/schema-agent.d.ts +4 -792
  175. package/node_modules/@comis/core/dist/config/schema-agent.js +16 -1
  176. package/node_modules/@comis/core/dist/config/schema-approvals.d.ts +0 -14
  177. package/node_modules/@comis/core/dist/config/schema-auto-reply-engine.d.ts +0 -6
  178. package/node_modules/@comis/core/dist/config/schema-background-tasks.d.ts +1 -6
  179. package/node_modules/@comis/core/dist/config/schema-background-tasks.js +7 -0
  180. package/node_modules/@comis/core/dist/config/schema-browser.d.ts +0 -18
  181. package/node_modules/@comis/core/dist/config/schema-channel.d.ts +0 -158
  182. package/node_modules/@comis/core/dist/config/schema-coalescer.d.ts +0 -5
  183. package/node_modules/@comis/core/dist/config/schema-daemon.d.ts +0 -32
  184. package/node_modules/@comis/core/dist/config/schema-delivery.d.ts +1 -17
  185. package/node_modules/@comis/core/dist/config/schema-delivery.js +2 -0
  186. package/node_modules/@comis/core/dist/config/schema-documentation.d.ts +0 -12
  187. package/node_modules/@comis/core/dist/config/schema-embedding.d.ts +0 -20
  188. package/node_modules/@comis/core/dist/config/schema-envelope.d.ts +0 -15
  189. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +0 -37
  190. package/node_modules/@comis/core/dist/config/schema-gemini-cache.d.ts +0 -4
  191. package/node_modules/@comis/core/dist/config/schema-gemini-cache.js +0 -2
  192. package/node_modules/@comis/core/dist/config/schema-integrations.d.ts +0 -318
  193. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.d.ts +0 -18
  194. package/node_modules/@comis/core/dist/config/schema-memory-review.d.ts +0 -7
  195. package/node_modules/@comis/core/dist/config/schema-memory.d.ts +0 -16
  196. package/node_modules/@comis/core/dist/config/schema-messages.d.ts +0 -8
  197. package/node_modules/@comis/core/dist/config/schema-models.d.ts +0 -15
  198. package/node_modules/@comis/core/dist/config/schema-notification.d.ts +0 -5
  199. package/node_modules/@comis/core/dist/config/schema-oauth.d.ts +18 -0
  200. package/node_modules/@comis/core/dist/config/schema-oauth.js +19 -0
  201. package/node_modules/@comis/core/dist/config/schema-observability.d.ts +0 -38
  202. package/node_modules/@comis/core/dist/config/schema-output-retention.d.ts +34 -0
  203. package/node_modules/@comis/core/dist/config/schema-output-retention.js +48 -0
  204. package/node_modules/@comis/core/dist/config/schema-plugins.d.ts +0 -8
  205. package/node_modules/@comis/core/dist/config/schema-providers.d.ts +0 -64
  206. package/node_modules/@comis/core/dist/config/schema-queue.d.ts +0 -58
  207. package/node_modules/@comis/core/dist/config/schema-response-prefix.d.ts +0 -2
  208. package/node_modules/@comis/core/dist/config/schema-retry.d.ts +0 -6
  209. package/node_modules/@comis/core/dist/config/schema-scheduler.d.ts +0 -39
  210. package/node_modules/@comis/core/dist/config/schema-secrets.d.ts +0 -3
  211. package/node_modules/@comis/core/dist/config/schema-security.d.ts +0 -18
  212. package/node_modules/@comis/core/dist/config/schema-send-policy.d.ts +0 -13
  213. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.d.ts +0 -5
  214. package/node_modules/@comis/core/dist/config/schema-serializer.js +2 -0
  215. package/node_modules/@comis/core/dist/config/schema-skills.d.ts +0 -63
  216. package/node_modules/@comis/core/dist/config/schema-skills.js +3 -4
  217. package/node_modules/@comis/core/dist/config/schema-streaming.d.ts +0 -38
  218. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.d.ts +0 -3
  219. package/node_modules/@comis/core/dist/config/schema-tooling.d.ts +87 -0
  220. package/node_modules/@comis/core/dist/config/schema-tooling.js +152 -0
  221. package/node_modules/@comis/core/dist/config/schema-verbosity.d.ts +0 -12
  222. package/node_modules/@comis/core/dist/config/schema-webhooks.d.ts +0 -40
  223. package/node_modules/@comis/core/dist/config/schema.d.ts +50 -37
  224. package/node_modules/@comis/core/dist/config/schema.js +9 -0
  225. package/node_modules/@comis/core/dist/context/context.d.ts +0 -4
  226. package/node_modules/@comis/core/dist/domain/approval-request.d.ts +0 -17
  227. package/node_modules/@comis/core/dist/domain/background-task-origin.d.ts +29 -0
  228. package/node_modules/@comis/core/dist/domain/background-task-origin.js +39 -0
  229. package/node_modules/@comis/core/dist/domain/delivery-origin.d.ts +0 -5
  230. package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +0 -48
  231. package/node_modules/@comis/core/dist/domain/memory-entry.d.ts +0 -3
  232. package/node_modules/@comis/core/dist/domain/model-compat.d.ts +0 -4
  233. package/node_modules/@comis/core/dist/domain/normalized-message.d.ts +0 -15
  234. package/node_modules/@comis/core/dist/domain/provider-capabilities.d.ts +0 -6
  235. package/node_modules/@comis/core/dist/domain/rich-message.d.ts +0 -14
  236. package/node_modules/@comis/core/dist/domain/subagent-context-config.d.ts +0 -22
  237. package/node_modules/@comis/core/dist/domain/subagent-context-types.d.ts +0 -8
  238. package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +31 -0
  239. package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +76 -2
  240. package/node_modules/@comis/core/dist/exports/config.d.ts +2 -2
  241. package/node_modules/@comis/core/dist/exports/config.js +3 -1
  242. package/node_modules/@comis/core/dist/exports/domain.d.ts +2 -0
  243. package/node_modules/@comis/core/dist/exports/domain.js +1 -0
  244. package/node_modules/@comis/core/dist/exports/hooks.d.ts +1 -1
  245. package/node_modules/@comis/core/dist/exports/ports.d.ts +2 -2
  246. package/node_modules/@comis/core/dist/exports/ports.js +1 -1
  247. package/node_modules/@comis/core/dist/ports/channel-plugin.d.ts +0 -13
  248. package/node_modules/@comis/core/dist/ports/delivery-queue.d.ts +23 -0
  249. package/node_modules/@comis/core/dist/ports/delivery-queue.js +2 -0
  250. package/node_modules/@comis/core/dist/ports/index.d.ts +4 -0
  251. package/node_modules/@comis/core/dist/ports/index.js +5 -0
  252. package/node_modules/@comis/core/dist/ports/no-op-tool-capability.d.ts +30 -0
  253. package/node_modules/@comis/core/dist/ports/no-op-tool-capability.js +47 -0
  254. package/node_modules/@comis/core/dist/ports/oauth-credential-store.d.ts +64 -0
  255. package/node_modules/@comis/core/dist/ports/oauth-credential-store.js +37 -0
  256. package/node_modules/@comis/core/dist/ports/tool-capability.d.ts +165 -0
  257. package/node_modules/@comis/core/dist/ports/tool-capability.js +15 -0
  258. package/node_modules/@comis/core/dist/security/audit.d.ts +0 -11
  259. package/node_modules/@comis/core/dist/tool-metadata.d.ts +41 -1
  260. package/node_modules/@comis/core/dist/tool-metadata.js +1 -1
  261. package/node_modules/@comis/core/package.json +1 -1
  262. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/validate-skill.py +1 -1
  263. package/node_modules/@comis/daemon/dist/daemon-types.d.ts +23 -3
  264. package/node_modules/@comis/daemon/dist/daemon.js +168 -30
  265. package/node_modules/@comis/daemon/dist/index.d.ts +2 -0
  266. package/node_modules/@comis/daemon/dist/index.js +5 -0
  267. package/node_modules/@comis/daemon/dist/observability/channel-health-logger.js +3 -3
  268. package/node_modules/@comis/daemon/dist/observability/delivery-queue-logger.js +1 -1
  269. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.d.ts +22 -1
  270. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.js +84 -21
  271. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.d.ts +1 -1
  272. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.js +3 -3
  273. package/node_modules/@comis/daemon/dist/rpc/builtin-provider-guard.js +2 -2
  274. package/node_modules/@comis/daemon/dist/rpc/config-handlers.d.ts +9 -1
  275. package/node_modules/@comis/daemon/dist/rpc/config-handlers.js +104 -23
  276. package/node_modules/@comis/daemon/dist/rpc/credential-resolver.d.ts +30 -1
  277. package/node_modules/@comis/daemon/dist/rpc/credential-resolver.js +74 -11
  278. package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.d.ts +8 -0
  279. package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.js +22 -8
  280. package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +1 -1
  281. package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +2 -2
  282. package/node_modules/@comis/daemon/dist/rpc/provider-handlers.js +9 -12
  283. package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.d.ts +1 -0
  284. package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.js +27 -2
  285. package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.js +0 -1
  286. package/node_modules/@comis/daemon/dist/sub-agent-runner.d.ts +18 -0
  287. package/node_modules/@comis/daemon/dist/sub-agent-runner.js +41 -9
  288. package/node_modules/@comis/daemon/dist/wiring/index.d.ts +4 -0
  289. package/node_modules/@comis/daemon/dist/wiring/index.js +2 -0
  290. package/node_modules/@comis/daemon/dist/wiring/oauth-preflight.d.ts +21 -0
  291. package/node_modules/@comis/daemon/dist/wiring/oauth-preflight.js +134 -0
  292. package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +81 -2
  293. package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +164 -3
  294. package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.d.ts +58 -0
  295. package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.js +59 -0
  296. package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.d.ts +10 -3
  297. package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.js +13 -7
  298. package/node_modules/@comis/daemon/dist/wiring/setup-channels.d.ts +9 -2
  299. package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +35 -10
  300. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.d.ts +20 -5
  301. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +21 -16
  302. package/node_modules/@comis/daemon/dist/wiring/setup-delivery.d.ts +14 -5
  303. package/node_modules/@comis/daemon/dist/wiring/setup-delivery.js +65 -20
  304. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.d.ts +4 -6
  305. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +3 -5
  306. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.d.ts +20 -5
  307. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.js +11 -2
  308. package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.d.ts +89 -0
  309. package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.js +212 -0
  310. package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.js +4 -0
  311. package/node_modules/@comis/daemon/dist/wiring/setup-tools.d.ts +18 -4
  312. package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +29 -10
  313. package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.d.ts +75 -0
  314. package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.js +253 -0
  315. package/node_modules/@comis/daemon/package.json +1 -1
  316. package/node_modules/@comis/gateway/dist/index.d.ts +2 -0
  317. package/node_modules/@comis/gateway/dist/index.js +2 -0
  318. package/node_modules/@comis/gateway/dist/oauth/oauth-callback-route.d.ts +66 -0
  319. package/node_modules/@comis/gateway/dist/oauth/oauth-callback-route.js +212 -0
  320. package/node_modules/@comis/gateway/dist/server/hono-server.d.ts +14 -0
  321. package/node_modules/@comis/gateway/dist/server/hono-server.js +10 -0
  322. package/node_modules/@comis/gateway/dist/webhook/webhook-endpoint.d.ts +0 -4
  323. package/node_modules/@comis/gateway/package.json +1 -1
  324. package/node_modules/@comis/infra/dist/logging/log-fields.d.ts +23 -0
  325. package/node_modules/@comis/infra/package.json +1 -1
  326. package/node_modules/@comis/memory/dist/compaction.d.ts +3 -5
  327. package/node_modules/@comis/memory/dist/compaction.js +2 -3
  328. package/node_modules/@comis/memory/dist/delivery-queue-adapter.d.ts +2 -2
  329. package/node_modules/@comis/memory/dist/delivery-queue-adapter.js +49 -1
  330. package/node_modules/@comis/memory/dist/index.d.ts +2 -0
  331. package/node_modules/@comis/memory/dist/index.js +3 -0
  332. package/node_modules/@comis/memory/dist/memory-api.d.ts +1 -1
  333. package/node_modules/@comis/memory/dist/memory-api.js +1 -1
  334. package/node_modules/@comis/memory/dist/oauth-profile-schema.d.ts +17 -0
  335. package/node_modules/@comis/memory/dist/oauth-profile-schema.js +33 -0
  336. package/node_modules/@comis/memory/dist/oauth-profile-store-encrypted.d.ts +27 -0
  337. package/node_modules/@comis/memory/dist/oauth-profile-store-encrypted.js +144 -0
  338. package/node_modules/@comis/memory/dist/session-store.d.ts +1 -1
  339. package/node_modules/@comis/memory/dist/session-store.js +1 -1
  340. package/node_modules/@comis/memory/dist/sqlite-secret-store.d.ts +29 -3
  341. package/node_modules/@comis/memory/dist/sqlite-secret-store.js +11 -3
  342. package/node_modules/@comis/memory/package.json +1 -1
  343. package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +0 -42
  344. package/node_modules/@comis/scheduler/dist/execution/execution-lock.d.ts +13 -0
  345. package/node_modules/@comis/scheduler/dist/execution/execution-lock.js +1 -1
  346. package/node_modules/@comis/scheduler/dist/execution/index.d.ts +2 -0
  347. package/node_modules/@comis/scheduler/dist/execution/index.js +2 -0
  348. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.d.ts +29 -8
  349. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.js +20 -8
  350. package/node_modules/@comis/scheduler/dist/index.d.ts +2 -0
  351. package/node_modules/@comis/scheduler/dist/index.js +2 -0
  352. package/node_modules/@comis/scheduler/dist/system-events/system-event-types.d.ts +0 -3
  353. package/node_modules/@comis/scheduler/dist/tasks/task-types.d.ts +0 -17
  354. package/node_modules/@comis/scheduler/package.json +1 -1
  355. package/node_modules/@comis/shared/dist/index.d.ts +3 -0
  356. package/node_modules/@comis/shared/dist/index.js +4 -0
  357. package/node_modules/@comis/shared/dist/mcp-tool-name.d.ts +78 -0
  358. package/node_modules/@comis/shared/dist/mcp-tool-name.js +92 -0
  359. package/node_modules/@comis/shared/dist/silent-tokens.d.ts +38 -0
  360. package/node_modules/@comis/shared/dist/silent-tokens.js +51 -0
  361. package/node_modules/@comis/shared/dist/visible-delivery.d.ts +28 -0
  362. package/node_modules/@comis/shared/dist/visible-delivery.js +16 -0
  363. package/node_modules/@comis/shared/package.json +1 -1
  364. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.d.ts +2 -13
  365. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.js +3 -21
  366. package/node_modules/@comis/skills/dist/bridge/schema-validator.d.ts +38 -0
  367. package/node_modules/@comis/skills/dist/bridge/schema-validator.js +169 -0
  368. package/node_modules/@comis/skills/dist/bridge/tool-metadata-enforcement.js +12 -0
  369. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +133 -3
  370. package/node_modules/@comis/skills/dist/builtin/exec-diagnostics.d.ts +32 -0
  371. package/node_modules/@comis/skills/dist/builtin/exec-diagnostics.js +127 -0
  372. package/node_modules/@comis/skills/dist/builtin/exec-security.js +38 -0
  373. package/node_modules/@comis/skills/dist/builtin/exec-tool.d.ts +55 -9
  374. package/node_modules/@comis/skills/dist/builtin/exec-tool.js +392 -19
  375. package/node_modules/@comis/skills/dist/builtin/file-tools/grep-tool.js +6 -6
  376. package/node_modules/@comis/skills/dist/builtin/install-detour.d.ts +67 -0
  377. package/node_modules/@comis/skills/dist/builtin/install-detour.js +342 -0
  378. package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +5 -5
  379. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +7 -6
  380. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +40 -29
  381. package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.d.ts +4 -1
  382. package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.js +3 -3
  383. package/node_modules/@comis/skills/dist/builtin/platform/cron-tool.js +1 -1
  384. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +6 -6
  385. package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.d.ts +1 -1
  386. package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.js +9 -9
  387. package/node_modules/@comis/skills/dist/builtin/platform/message-tool.js +18 -0
  388. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.d.ts +18 -1
  389. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.js +18 -2
  390. package/node_modules/@comis/skills/dist/builtin/platform/models-manage-tool.js +3 -3
  391. package/node_modules/@comis/skills/dist/builtin/process-registry.d.ts +14 -0
  392. package/node_modules/@comis/skills/dist/builtin/process-tool.d.ts +24 -4
  393. package/node_modules/@comis/skills/dist/builtin/process-tool.js +25 -7
  394. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.d.ts +11 -0
  395. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.js +123 -1
  396. package/node_modules/@comis/skills/dist/builtin/sandbox/detect-provider.js +40 -15
  397. package/node_modules/@comis/skills/dist/index.d.ts +4 -1
  398. package/node_modules/@comis/skills/dist/index.js +3 -1
  399. package/node_modules/@comis/skills/dist/manifest/capability-parser.d.ts +44 -0
  400. package/node_modules/@comis/skills/dist/manifest/capability-parser.js +68 -0
  401. package/node_modules/@comis/skills/dist/manifest/schema.d.ts +44 -37
  402. package/node_modules/@comis/skills/dist/manifest/schema.js +35 -0
  403. package/node_modules/@comis/skills/dist/media/ssrf-fetcher.d.ts +7 -0
  404. package/node_modules/@comis/skills/dist/media/ssrf-fetcher.js +9 -2
  405. package/node_modules/@comis/skills/dist/registry/discovery.d.ts +8 -0
  406. package/node_modules/@comis/skills/dist/registry/discovery.js +10 -3
  407. package/node_modules/@comis/skills/dist/registry/skill-registry.d.ts +45 -1
  408. package/node_modules/@comis/skills/dist/registry/skill-registry.js +70 -7
  409. package/node_modules/@comis/skills/package.json +1 -1
  410. package/node_modules/@comis/web/dist/assets/{agent-detail-71BSbSfD.js → agent-detail-q8t1NB7w.js} +1 -1
  411. package/node_modules/@comis/web/dist/assets/{agent-editor-CTSDZhwT.js → agent-editor-B46io5gv.js} +1 -1
  412. package/node_modules/@comis/web/dist/assets/{agent-list-BEhni2ea.js → agent-list-DQ6g2Rcx.js} +1 -1
  413. package/node_modules/@comis/web/dist/assets/{billing-view-DVP1IvVs.js → billing-view-IWPR8LgF.js} +1 -1
  414. package/node_modules/@comis/web/dist/assets/{channel-detail-N_YK74xC.js → channel-detail-DlNNZuuC.js} +1 -1
  415. package/node_modules/@comis/web/dist/assets/{channel-list-DRk6ZJaF.js → channel-list-DhGwxiMc.js} +1 -1
  416. package/node_modules/@comis/web/dist/assets/{chat-console-Dm-GtSf9.js → chat-console-Nv6fM3Rc.js} +1 -1
  417. package/node_modules/@comis/web/dist/assets/{config-editor-CIferYX6.js → config-editor-BYKuJF76.js} +1 -1
  418. package/node_modules/@comis/web/dist/assets/{context-dag-browser-CL84rXXM.js → context-dag-browser-ClNEtzYE.js} +1 -1
  419. package/node_modules/@comis/web/dist/assets/{context-engine-B1HOTEZv.js → context-engine-BZJ6HChd.js} +1 -1
  420. package/node_modules/@comis/web/dist/assets/{delivery-view-Y6JKYVFw.js → delivery-view-Cb7I3vGu.js} +1 -1
  421. package/node_modules/@comis/web/dist/assets/{diagnostics-view-DWV1UQjz.js → diagnostics-view-9u9Lyu5a.js} +1 -1
  422. package/node_modules/@comis/web/dist/assets/{ic-chat-message-DfSERzzg.js → ic-chat-message-BFt3cVpx.js} +1 -1
  423. package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CXyhlJup.js → ic-connection-dot-y77LZ3Gu.js} +1 -1
  424. package/node_modules/@comis/web/dist/assets/{ic-tool-call-DNmwTjek.js → ic-tool-call-qt6w1NQl.js} +1 -1
  425. package/node_modules/@comis/web/dist/assets/{index-CBr0Tm9_.js → index-8Tg9oc-C.js} +2 -2
  426. package/node_modules/@comis/web/dist/assets/{mcp-management-BaH2-vox.js → mcp-management-69dtH_kY.js} +2 -2
  427. package/node_modules/@comis/web/dist/assets/{media-config-CZLshJoN.js → media-config-BdjLj5c1.js} +1 -1
  428. package/node_modules/@comis/web/dist/assets/{media-test-C9NUWgo_.js → media-test-DuPqrixi.js} +1 -1
  429. package/node_modules/@comis/web/dist/assets/{memory-inspector-D_fmTcRN.js → memory-inspector-B-Pepbq-.js} +1 -1
  430. package/node_modules/@comis/web/dist/assets/{message-center-BBFlNCZn.js → message-center-B7l0yNYY.js} +1 -1
  431. package/node_modules/@comis/web/dist/assets/{models-BytGLm99.js → models-JHFHuv5S.js} +1 -1
  432. package/node_modules/@comis/web/dist/assets/{observe-view-VXtHqaqq.js → observe-view-r8mqhy4O.js} +1 -1
  433. package/node_modules/@comis/web/dist/assets/{pipeline-builder-CfXczlfJ.js → pipeline-builder-XjkiZRcR.js} +1 -1
  434. package/node_modules/@comis/web/dist/assets/{pipeline-history-CPmXFnbe.js → pipeline-history-CZqJv_Hj.js} +1 -1
  435. package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-DcueTMs9.js → pipeline-history-detail-BEFGMoDy.js} +1 -1
  436. package/node_modules/@comis/web/dist/assets/{pipeline-list-B-xG5WZh.js → pipeline-list-B6q5LvO1.js} +1 -1
  437. package/node_modules/@comis/web/dist/assets/{pipeline-monitor-pnIOYaSY.js → pipeline-monitor-BNomXjVL.js} +1 -1
  438. package/node_modules/@comis/web/dist/assets/{scheduler-BtUIFHhA.js → scheduler-BJEjcGKA.js} +1 -1
  439. package/node_modules/@comis/web/dist/assets/{security-C8mWRq2y.js → security-2G1jhBfV.js} +1 -1
  440. package/node_modules/@comis/web/dist/assets/{session-detail-DgdkO5ka.js → session-detail-DmVPzFBR.js} +1 -1
  441. package/node_modules/@comis/web/dist/assets/{session-list-DcylcfTn.js → session-list-CsqMQoHs.js} +1 -1
  442. package/node_modules/@comis/web/dist/assets/{setup-wizard-BP5yjsuL.js → setup-wizard-CAdM-gSP.js} +1 -1
  443. package/node_modules/@comis/web/dist/assets/{skills-DXt1bX8Z.js → skills-2ODqKaWr.js} +1 -1
  444. package/node_modules/@comis/web/dist/assets/{subagents-C7YbUHXY.js → subagents-BFlwfTbD.js} +1 -1
  445. package/node_modules/@comis/web/dist/assets/{workspace-manager-DP6pW4wa.js → workspace-manager--CbOx_dI.js} +1 -1
  446. package/node_modules/@comis/web/dist/index.html +1 -1
  447. package/node_modules/@comis/web/package.json +1 -1
  448. package/package.json +25 -24
@@ -7,9 +7,7 @@ import { z } from "zod";
7
7
  * file (or even empty object) produces a valid AppConfig.
8
8
  */
9
9
  export declare const AppConfigSchema: z.ZodObject<{
10
- /** Tenant identifier for SaaS multi-tenancy */
11
10
  tenantId: z.ZodDefault<z.ZodString>;
12
- /** Global log level */
13
11
  logLevel: z.ZodDefault<z.ZodEnum<{
14
12
  error: "error";
15
13
  trace: "trace";
@@ -18,11 +16,8 @@ export declare const AppConfigSchema: z.ZodObject<{
18
16
  warn: "warn";
19
17
  fatal: "fatal";
20
18
  }>>;
21
- /** Base data directory for all persistent storage (default: ~/.comis) */
22
19
  dataDir: z.ZodDefault<z.ZodString>;
23
- /** SDK agent directory for persistent settings (default: ~/.pi/agent) */
24
20
  agentDir: z.ZodDefault<z.ZodString>;
25
- /** Multi-agent configuration map (agent ID -> per-agent config with optional skills) */
26
21
  agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
27
22
  name: z.ZodDefault<z.ZodString>;
28
23
  model: z.ZodDefault<z.ZodString>;
@@ -497,6 +492,7 @@ export declare const AppConfigSchema: z.ZodObject<{
497
492
  maxTotal: z.ZodDefault<z.ZodNumber>;
498
493
  maxBackgroundDurationMs: z.ZodDefault<z.ZodNumber>;
499
494
  excludeTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
495
+ maxBackgroundHops: z.ZodDefault<z.ZodNumber>;
500
496
  }, z.core.$strict>>;
501
497
  memoryReview: z.ZodOptional<z.ZodObject<{
502
498
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -507,8 +503,8 @@ export declare const AppConfigSchema: z.ZodObject<{
507
503
  dedupThreshold: z.ZodDefault<z.ZodNumber>;
508
504
  autoTags: z.ZodDefault<z.ZodArray<z.ZodString>>;
509
505
  }, z.core.$strict>>;
506
+ oauthProfiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
510
507
  }, z.core.$strict>>>;
511
- /** Channel adapter configuration */
512
508
  channels: z.ZodDefault<z.ZodObject<{
513
509
  telegram: z.ZodDefault<z.ZodObject<{
514
510
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1080,7 +1076,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1080
1076
  restartCooldownMs: z.ZodDefault<z.ZodNumber>;
1081
1077
  }, z.core.$strict>>;
1082
1078
  }, z.core.$strict>>;
1083
- /** Memory system configuration */
1084
1079
  memory: z.ZodDefault<z.ZodObject<{
1085
1080
  dbPath: z.ZodDefault<z.ZodString>;
1086
1081
  walMode: z.ZodDefault<z.ZodBoolean>;
@@ -1096,7 +1091,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1096
1091
  maxEntries: z.ZodDefault<z.ZodNumber>;
1097
1092
  }, z.core.$strict>>;
1098
1093
  }, z.core.$strict>>;
1099
- /** Security configuration */
1100
1094
  security: z.ZodDefault<z.ZodObject<{
1101
1095
  logRedaction: z.ZodDefault<z.ZodBoolean>;
1102
1096
  auditLog: z.ZodDefault<z.ZodBoolean>;
@@ -1166,7 +1160,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1166
1160
  dbPath: z.ZodDefault<z.ZodString>;
1167
1161
  }, z.core.$strict>>;
1168
1162
  }, z.core.$strict>>;
1169
- /** Multi-agent routing configuration */
1170
1163
  routing: z.ZodDefault<z.ZodObject<{
1171
1164
  defaultAgentId: z.ZodDefault<z.ZodString>;
1172
1165
  bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1177,7 +1170,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1177
1170
  agentId: z.ZodString;
1178
1171
  }, z.core.$strict>>>;
1179
1172
  }, z.core.$strict>>;
1180
- /** Daemon process configuration */
1181
1173
  daemon: z.ZodDefault<z.ZodObject<{
1182
1174
  watchdogIntervalMs: z.ZodDefault<z.ZodNumber>;
1183
1175
  shutdownTimeoutMs: z.ZodDefault<z.ZodNumber>;
@@ -1216,7 +1208,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1216
1208
  }, z.core.$strict>]>>;
1217
1209
  }, z.core.$strict>>;
1218
1210
  }, z.core.$strict>>;
1219
- /** Scheduler / proactive automation configuration */
1220
1211
  scheduler: z.ZodDefault<z.ZodObject<{
1221
1212
  cron: z.ZodDefault<z.ZodObject<{
1222
1213
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1256,7 +1247,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1256
1247
  storeDir: z.ZodDefault<z.ZodString>;
1257
1248
  }, z.core.$strict>>;
1258
1249
  }, z.core.$strict>>;
1259
- /** Gateway HTTPS server configuration */
1260
1250
  gateway: z.ZodDefault<z.ZodObject<{
1261
1251
  enabled: z.ZodDefault<z.ZodBoolean>;
1262
1252
  host: z.ZodDefault<z.ZodString>;
@@ -1299,7 +1289,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1299
1289
  windowMs: z.ZodDefault<z.ZodNumber>;
1300
1290
  }, z.core.$strict>>;
1301
1291
  }, z.core.$strict>>;
1302
- /** External integrations configuration */
1303
1292
  integrations: z.ZodDefault<z.ZodObject<{
1304
1293
  braveSearch: z.ZodDefault<z.ZodObject<{
1305
1294
  apiKey: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -1475,7 +1464,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1475
1464
  }, z.core.$strict>>>;
1476
1465
  }, z.core.$strict>>;
1477
1466
  }, z.core.$strict>>;
1478
- /** System monitoring configuration */
1479
1467
  monitoring: z.ZodDefault<z.ZodObject<{
1480
1468
  disk: z.ZodDefault<z.ZodObject<{
1481
1469
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1501,7 +1489,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1501
1489
  checkRemote: z.ZodDefault<z.ZodBoolean>;
1502
1490
  }, z.core.$strict>>;
1503
1491
  }, z.core.$strict>>;
1504
- /** Observability persistence configuration */
1505
1492
  observability: z.ZodDefault<z.ZodObject<{
1506
1493
  persistence: z.ZodDefault<z.ZodObject<{
1507
1494
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1509,7 +1496,12 @@ export declare const AppConfigSchema: z.ZodObject<{
1509
1496
  snapshotIntervalMs: z.ZodDefault<z.ZodNumber>;
1510
1497
  }, z.core.$strict>>;
1511
1498
  }, z.core.$strict>>;
1512
- /** Plugin system configuration */
1499
+ oauth: z.ZodDefault<z.ZodObject<{
1500
+ storage: z.ZodDefault<z.ZodEnum<{
1501
+ file: "file";
1502
+ encrypted: "encrypted";
1503
+ }>>;
1504
+ }, z.core.$strict>>;
1513
1505
  plugins: z.ZodDefault<z.ZodObject<{
1514
1506
  enabled: z.ZodDefault<z.ZodBoolean>;
1515
1507
  plugins: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1518,7 +1510,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1518
1510
  config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1519
1511
  }, z.core.$strict>>>;
1520
1512
  }, z.core.$strict>>;
1521
- /** Command queue configuration for session serialization and concurrency control */
1522
1513
  queue: z.ZodDefault<z.ZodObject<{
1523
1514
  enabled: z.ZodDefault<z.ZodBoolean>;
1524
1515
  maxConcurrentSessions: z.ZodDefault<z.ZodNumber>;
@@ -1584,7 +1575,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1584
1575
  }, z.core.$strict>>;
1585
1576
  priorityEnabled: z.ZodDefault<z.ZodBoolean>;
1586
1577
  }, z.core.$strict>>;
1587
- /** Block streaming and typing indicator configuration */
1588
1578
  streaming: z.ZodDefault<z.ZodObject<{
1589
1579
  enabled: z.ZodDefault<z.ZodBoolean>;
1590
1580
  defaultChunkMode: z.ZodDefault<z.ZodEnum<{
@@ -1698,7 +1688,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1698
1688
  }>>>;
1699
1689
  }, z.core.$strict>>>;
1700
1690
  }, z.core.$strict>>;
1701
- /** Auto-reply engine: controls whether the agent activates for inbound messages */
1702
1691
  autoReplyEngine: z.ZodDefault<z.ZodObject<{
1703
1692
  enabled: z.ZodDefault<z.ZodBoolean>;
1704
1693
  groupActivation: z.ZodDefault<z.ZodEnum<{
@@ -1711,7 +1700,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1711
1700
  maxHistoryInjections: z.ZodDefault<z.ZodNumber>;
1712
1701
  maxGroupHistoryMessages: z.ZodDefault<z.ZodNumber>;
1713
1702
  }, z.core.$strict>>;
1714
- /** Send policy: rules-based outbound message gating */
1715
1703
  sendPolicy: z.ZodDefault<z.ZodObject<{
1716
1704
  enabled: z.ZodDefault<z.ZodBoolean>;
1717
1705
  defaultAction: z.ZodDefault<z.ZodEnum<{
@@ -1729,7 +1717,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1729
1717
  description: z.ZodOptional<z.ZodString>;
1730
1718
  }, z.core.$strict>>>;
1731
1719
  }, z.core.$strict>>;
1732
- /** Embedding provider configuration (local GGUF, OpenAI, auto-selection) */
1733
1720
  embedding: z.ZodDefault<z.ZodObject<{
1734
1721
  enabled: z.ZodDefault<z.ZodBoolean>;
1735
1722
  provider: z.ZodDefault<z.ZodEnum<{
@@ -1766,7 +1753,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1766
1753
  }, z.core.$strict>>;
1767
1754
  autoReindex: z.ZodDefault<z.ZodBoolean>;
1768
1755
  }, z.core.$strict>>;
1769
- /** Message envelope: enriches inbound messages with provider, timestamp, and elapsed time for LLM context */
1770
1756
  envelope: z.ZodDefault<z.ZodObject<{
1771
1757
  timezoneMode: z.ZodDefault<z.ZodString>;
1772
1758
  timeFormat: z.ZodDefault<z.ZodEnum<{
@@ -1777,7 +1763,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1777
1763
  showProvider: z.ZodDefault<z.ZodBoolean>;
1778
1764
  elapsedMaxMs: z.ZodDefault<z.ZodNumber>;
1779
1765
  }, z.core.$strict>>;
1780
- /** Browser automation configuration (CDP, headless Chrome) */
1781
1766
  browser: z.ZodDefault<z.ZodObject<{
1782
1767
  enabled: z.ZodDefault<z.ZodBoolean>;
1783
1768
  chromePath: z.ZodOptional<z.ZodString>;
@@ -1799,7 +1784,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1799
1784
  downloadsDir: z.ZodOptional<z.ZodString>;
1800
1785
  downloadTimeoutMs: z.ZodDefault<z.ZodNumber>;
1801
1786
  }, z.core.$strict>>;
1802
- /** Model catalog and alias configuration */
1803
1787
  models: z.ZodDefault<z.ZodObject<{
1804
1788
  scanOnStartup: z.ZodDefault<z.ZodBoolean>;
1805
1789
  scanTimeoutMs: z.ZodDefault<z.ZodNumber>;
@@ -1811,7 +1795,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1811
1795
  defaultModel: z.ZodDefault<z.ZodString>;
1812
1796
  defaultProvider: z.ZodDefault<z.ZodString>;
1813
1797
  }, z.core.$strict>>;
1814
- /** LLM provider configuration (API keys via SecretManager, endpoints, retries) */
1815
1798
  providers: z.ZodDefault<z.ZodObject<{
1816
1799
  entries: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1817
1800
  type: z.ZodString;
@@ -1868,7 +1851,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1868
1851
  }, z.core.$strict>>>;
1869
1852
  }, z.core.$strict>>>;
1870
1853
  }, z.core.$strict>>;
1871
- /** Messaging UX configuration (splitting, typing indicators, receipts) */
1872
1854
  messages: z.ZodDefault<z.ZodObject<{
1873
1855
  maxOutboundLength: z.ZodDefault<z.ZodNumber>;
1874
1856
  splitLongMessages: z.ZodDefault<z.ZodBoolean>;
@@ -1879,7 +1861,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1879
1861
  readReceipts: z.ZodDefault<z.ZodBoolean>;
1880
1862
  maxSendsPerExecution: z.ZodDefault<z.ZodNumber>;
1881
1863
  }, z.core.$strict>>;
1882
- /** Action approval workflow configuration (rules-based gating) */
1883
1864
  approvals: z.ZodDefault<z.ZodObject<{
1884
1865
  enabled: z.ZodDefault<z.ZodBoolean>;
1885
1866
  defaultMode: z.ZodDefault<z.ZodEnum<{
@@ -1906,7 +1887,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1906
1887
  denialCacheTtlMs: z.ZodDefault<z.ZodNumber>;
1907
1888
  batchApprovalTtlMs: z.ZodDefault<z.ZodNumber>;
1908
1889
  }, z.core.$strict>>;
1909
- /** Webhook subsystem configuration (path-based routing, HMAC auth, mappings) */
1910
1890
  webhooks: z.ZodDefault<z.ZodObject<{
1911
1891
  enabled: z.ZodDefault<z.ZodBoolean>;
1912
1892
  path: z.ZodDefault<z.ZodString>;
@@ -1947,7 +1927,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1947
1927
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
1948
1928
  }, z.core.$strict>>>;
1949
1929
  }, z.core.$strict>>;
1950
- /** Lifecycle status reactions for agent processing phases */
1951
1930
  lifecycleReactions: z.ZodDefault<z.ZodObject<{
1952
1931
  enabled: z.ZodDefault<z.ZodBoolean>;
1953
1932
  emojiTier: z.ZodDefault<z.ZodEnum<{
@@ -1971,7 +1950,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1971
1950
  }>>;
1972
1951
  }, z.core.$strict>>>;
1973
1952
  }, z.core.$strict>>;
1974
- /** Response prefix/suffix template injected into agent replies */
1975
1953
  responsePrefix: z.ZodDefault<z.ZodObject<{
1976
1954
  template: z.ZodDefault<z.ZodString>;
1977
1955
  position: z.ZodDefault<z.ZodEnum<{
@@ -1979,7 +1957,6 @@ export declare const AppConfigSchema: z.ZodObject<{
1979
1957
  append: "append";
1980
1958
  }>>;
1981
1959
  }, z.core.$strict>>;
1982
- /** Crash-safe outbound delivery queue configuration */
1983
1960
  deliveryQueue: z.ZodDefault<z.ZodObject<{
1984
1961
  enabled: z.ZodDefault<z.ZodBoolean>;
1985
1962
  maxQueueDepth: z.ZodDefault<z.ZodNumber>;
@@ -1987,9 +1964,9 @@ export declare const AppConfigSchema: z.ZodObject<{
1987
1964
  defaultExpireMs: z.ZodDefault<z.ZodNumber>;
1988
1965
  drainOnStartup: z.ZodDefault<z.ZodBoolean>;
1989
1966
  drainBudgetMs: z.ZodDefault<z.ZodNumber>;
1967
+ drainIntervalMs: z.ZodDefault<z.ZodNumber>;
1990
1968
  pruneIntervalMs: z.ZodDefault<z.ZodNumber>;
1991
1969
  }, z.core.$strict>>;
1992
- /** Session mirroring persistence configuration */
1993
1970
  deliveryMirror: z.ZodDefault<z.ZodObject<{
1994
1971
  enabled: z.ZodDefault<z.ZodBoolean>;
1995
1972
  retentionMs: z.ZodDefault<z.ZodNumber>;
@@ -1997,7 +1974,13 @@ export declare const AppConfigSchema: z.ZodObject<{
1997
1974
  maxEntriesPerInjection: z.ZodDefault<z.ZodNumber>;
1998
1975
  maxCharsPerInjection: z.ZodDefault<z.ZodNumber>;
1999
1976
  }, z.core.$strict>>;
2000
- /** Inter-block delivery timing and pacing configuration */
1977
+ outputRetention: z.ZodDefault<z.ZodObject<{
1978
+ enabled: z.ZodDefault<z.ZodBoolean>;
1979
+ intervalMs: z.ZodDefault<z.ZodNumber>;
1980
+ classes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1981
+ retentionMs: z.ZodNumber;
1982
+ }, z.core.$strict>>>;
1983
+ }, z.core.$strict>>;
2001
1984
  deliveryTiming: z.ZodDefault<z.ZodObject<{
2002
1985
  mode: z.ZodDefault<z.ZodEnum<{
2003
1986
  custom: "custom";
@@ -2010,7 +1993,6 @@ export declare const AppConfigSchema: z.ZodObject<{
2010
1993
  jitterMs: z.ZodDefault<z.ZodNumber>;
2011
1994
  firstBlockDelayMs: z.ZodDefault<z.ZodNumber>;
2012
1995
  }, z.core.$strict>>;
2013
- /** Block coalescer: accumulates small streaming blocks before delivery */
2014
1996
  coalescer: z.ZodDefault<z.ZodObject<{
2015
1997
  minChars: z.ZodDefault<z.ZodNumber>;
2016
1998
  maxChars: z.ZodDefault<z.ZodNumber>;
@@ -2021,7 +2003,6 @@ export declare const AppConfigSchema: z.ZodObject<{
2021
2003
  }>>;
2022
2004
  adaptiveIdle: z.ZodDefault<z.ZodBoolean>;
2023
2005
  }, z.core.$strict>>;
2024
- /** Sender trust display: controls how sender identity is surfaced to the LLM */
2025
2006
  senderTrustDisplay: z.ZodDefault<z.ZodObject<{
2026
2007
  enabled: z.ZodDefault<z.ZodBoolean>;
2027
2008
  displayMode: z.ZodDefault<z.ZodEnum<{
@@ -2033,7 +2014,6 @@ export declare const AppConfigSchema: z.ZodObject<{
2033
2014
  hashSecretRef: z.ZodDefault<z.ZodString>;
2034
2015
  aliases: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2035
2016
  }, z.core.$strict>>;
2036
- /** Documentation links injected into system prompt */
2037
2017
  documentation: z.ZodDefault<z.ZodObject<{
2038
2018
  enabled: z.ZodDefault<z.ZodBoolean>;
2039
2019
  localDocsPath: z.ZodDefault<z.ZodString>;
@@ -2047,11 +2027,44 @@ export declare const AppConfigSchema: z.ZodObject<{
2047
2027
  url: z.ZodString;
2048
2028
  }, z.core.$strict>>>;
2049
2029
  }, z.core.$strict>>;
2050
- /** Telegram file reference guard: detects hallucinated file paths in responses */
2051
2030
  telegramFileRefGuard: z.ZodDefault<z.ZodObject<{
2052
2031
  enabled: z.ZodDefault<z.ZodBoolean>;
2053
2032
  additionalExtensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
2054
2033
  excludedExtensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
2055
2034
  }, z.core.$strict>>;
2035
+ tooling: z.ZodDefault<z.ZodObject<{
2036
+ capabilityClusters: z.ZodDefault<z.ZodObject<{
2037
+ clusters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
2038
+ label: z.ZodString;
2039
+ priority: z.ZodDefault<z.ZodNumber>;
2040
+ preferOverInstalls: z.ZodDefault<z.ZodBoolean>;
2041
+ }, z.core.$strict>>>;
2042
+ builtinAssignments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2043
+ }, z.core.$strict>>;
2044
+ mcp: z.ZodDefault<z.ZodObject<{
2045
+ capabilityHints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
2046
+ cluster: z.ZodString;
2047
+ description: z.ZodString;
2048
+ replacesPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
2049
+ }, z.core.$strict>>>;
2050
+ }, z.core.$strict>>;
2051
+ skills: z.ZodDefault<z.ZodObject<{
2052
+ capabilityHints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
2053
+ cluster: z.ZodString;
2054
+ description: z.ZodOptional<z.ZodString>;
2055
+ replacesPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
2056
+ }, z.core.$strict>>>;
2057
+ }, z.core.$strict>>;
2058
+ capabilityIndex: z.ZodDefault<z.ZodObject<{
2059
+ enabled: z.ZodDefault<z.ZodBoolean>;
2060
+ }, z.core.$strict>>;
2061
+ installDetours: z.ZodDefault<z.ZodObject<{
2062
+ mode: z.ZodDefault<z.ZodEnum<{
2063
+ observe: "observe";
2064
+ advise: "advise";
2065
+ "soft-stop": "soft-stop";
2066
+ }>>;
2067
+ }, z.core.$strict>>;
2068
+ }, z.core.$strict>>;
2056
2069
  }, z.core.$strict>;
2057
2070
  export type AppConfig = z.infer<typeof AppConfigSchema>;
@@ -8,6 +8,7 @@ import { ChannelConfigSchema } from "./schema-channel.js";
8
8
  import { CoalescerConfigSchema } from "./schema-coalescer.js";
9
9
  import { DaemonConfigSchema } from "./schema-daemon.js";
10
10
  import { DeliveryMirrorConfigSchema, DeliveryQueueConfigSchema, DeliveryTimingConfigSchema } from "./schema-delivery.js";
11
+ import { OutputRetentionConfigSchema } from "./schema-output-retention.js";
11
12
  import { DocumentationConfigSchema } from "./schema-documentation.js";
12
13
  import { EmbeddingConfigSchema } from "./schema-embedding.js";
13
14
  import { EnvelopeConfigSchema } from "./schema-envelope.js";
@@ -19,6 +20,7 @@ import { MessagesConfigSchema } from "./schema-messages.js";
19
20
  import { ModelsConfigSchema } from "./schema-models.js";
20
21
  import { MonitoringConfigSchema } from "./schema-observability.js";
21
22
  import { ObservabilityConfigSchema } from "./schema-observability.js";
23
+ import { OAuthConfigSchema } from "./schema-oauth.js";
22
24
  import { PluginsConfigSchema } from "./schema-plugins.js";
23
25
  import { ProvidersConfigSchema } from "./schema-providers.js";
24
26
  import { QueueConfigSchema } from "./schema-queue.js";
@@ -29,6 +31,7 @@ import { SenderTrustDisplayConfigSchema } from "./schema-sender-trust-display.js
29
31
  import { SendPolicyConfigSchema } from "./schema-send-policy.js";
30
32
  import { StreamingConfigSchema } from "./schema-streaming.js";
31
33
  import { TelegramFileRefGuardConfigSchema } from "./schema-telegram-file-guard.js";
34
+ import { ToolingConfigSchema } from "./schema-tooling.js";
32
35
  import { WebhooksConfigSchema } from "./schema-webhooks.js";
33
36
  /**
34
37
  * Root application configuration schema.
@@ -68,6 +71,8 @@ export const AppConfigSchema = z.strictObject({
68
71
  monitoring: MonitoringConfigSchema.default(() => MonitoringConfigSchema.parse({})),
69
72
  /** Observability persistence configuration */
70
73
  observability: ObservabilityConfigSchema.default(() => ObservabilityConfigSchema.parse({})),
74
+ /** OAuth credential storage configuration (storage backend selector) */
75
+ oauth: OAuthConfigSchema.default(() => OAuthConfigSchema.parse({})),
71
76
  /** Plugin system configuration */
72
77
  plugins: PluginsConfigSchema.default(() => PluginsConfigSchema.parse({})),
73
78
  /** Command queue configuration for session serialization and concurrency control */
@@ -102,6 +107,8 @@ export const AppConfigSchema = z.strictObject({
102
107
  deliveryQueue: DeliveryQueueConfigSchema.default(() => DeliveryQueueConfigSchema.parse({})),
103
108
  /** Session mirroring persistence configuration */
104
109
  deliveryMirror: DeliveryMirrorConfigSchema.default(() => DeliveryMirrorConfigSchema.parse({})),
110
+ /** Output retention housekeeper configuration (per-class retentionMs). */
111
+ outputRetention: OutputRetentionConfigSchema.default(() => OutputRetentionConfigSchema.parse({})),
105
112
  /** Inter-block delivery timing and pacing configuration */
106
113
  deliveryTiming: DeliveryTimingConfigSchema.default(() => DeliveryTimingConfigSchema.parse({})),
107
114
  /** Block coalescer: accumulates small streaming blocks before delivery */
@@ -112,6 +119,8 @@ export const AppConfigSchema = z.strictObject({
112
119
  documentation: DocumentationConfigSchema.default(() => DocumentationConfigSchema.parse({})),
113
120
  /** Telegram file reference guard: detects hallucinated file paths in responses */
114
121
  telegramFileRefGuard: TelegramFileRefGuardConfigSchema.default(() => TelegramFileRefGuardConfigSchema.parse({})),
122
+ /** Tool-first capability layer (v1.1) -- capability clusters, MCP/skill hints, install-detour mode. Operator-only. */
123
+ tooling: ToolingConfigSchema.default(() => ToolingConfigSchema.parse({})),
115
124
  }).superRefine((config, ctx) => {
116
125
  // Startup invariant: reject the reserved "default" provider name.
117
126
  // "default" collides with PerAgentConfigSchema.provider's schema default
@@ -36,11 +36,8 @@ export declare const RequestContextSchema: z.ZodObject<{
36
36
  user: "user";
37
37
  guest: "guest";
38
38
  }>>;
39
- /** Per-session random delimiter for external content wrapping */
40
39
  contentDelimiter: z.ZodOptional<z.ZodString>;
41
- /** Channel type for the originating request (e.g. "telegram", "discord"). Flows through AsyncLocalStorage for downstream delivery routing. */
42
40
  channelType: z.ZodOptional<z.ZodString>;
43
- /** Immutable origin context for delivery routing. Captured at channel adapter entry point. */
44
41
  deliveryOrigin: z.ZodOptional<z.ZodObject<{
45
42
  channelType: z.ZodString;
46
43
  channelId: z.ZodString;
@@ -48,7 +45,6 @@ export declare const RequestContextSchema: z.ZodObject<{
48
45
  threadId: z.ZodOptional<z.ZodString>;
49
46
  tenantId: z.ZodDefault<z.ZodString>;
50
47
  }, z.core.$strict>>;
51
- /** Resolved model string ("provider:modelId") set by parent executor for sub-agent inheritance via ALS. */
52
48
  resolvedModel: z.ZodOptional<z.ZodString>;
53
49
  }, z.core.$strict>;
54
50
  export type RequestContext = z.infer<typeof RequestContextSchema>;
@@ -17,27 +17,18 @@ import { z } from "zod";
17
17
  * informed approve/deny decision.
18
18
  */
19
19
  export declare const ApprovalRequestSchema: z.ZodObject<{
20
- /** Unique identifier for this approval request */
21
20
  requestId: z.ZodString;
22
- /** Name of the tool being invoked */
23
21
  toolName: z.ZodString;
24
- /** The classified action (e.g., "agents.delete") */
25
22
  action: z.ZodString;
26
- /** Tool parameters (sanitized, no secrets) */
27
23
  params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
28
- /** The agent that triggered the action */
29
24
  agentId: z.ZodString;
30
- /** Session context identifier */
31
25
  sessionKey: z.ZodString;
32
- /** Trust level of the requesting user */
33
26
  trustLevel: z.ZodEnum<{
34
27
  admin: "admin";
35
28
  user: "user";
36
29
  guest: "guest";
37
30
  }>;
38
- /** Timestamp when the request was created (epoch ms) */
39
31
  createdAt: z.ZodNumber;
40
- /** How long before auto-deny (ms) */
41
32
  timeoutMs: z.ZodNumber;
42
33
  }, z.core.$strict>;
43
34
  /** An approval request awaiting operator decision. */
@@ -48,15 +39,10 @@ export type ApprovalRequest = z.infer<typeof ApprovalRequestSchema>;
48
39
  * Created when an operator approves/denies or the request times out.
49
40
  */
50
41
  export declare const ApprovalResolutionSchema: z.ZodObject<{
51
- /** The request being resolved */
52
42
  requestId: z.ZodString;
53
- /** Whether the action was approved */
54
43
  approved: z.ZodBoolean;
55
- /** Who approved/denied (operator ID or "system:timeout") */
56
44
  approvedBy: z.ZodString;
57
- /** Optional reason for the decision */
58
45
  reason: z.ZodOptional<z.ZodString>;
59
- /** Timestamp when the resolution was made (epoch ms) */
60
46
  resolvedAt: z.ZodNumber;
61
47
  }, z.core.$strict>;
62
48
  /** The resolution outcome of an approval request. */
@@ -81,9 +67,7 @@ export declare const SerializedApprovalRequestSchema: z.ZodObject<{
81
67
  export type SerializedApprovalRequest = z.infer<typeof SerializedApprovalRequestSchema>;
82
68
  /** Schema for a serialized approval cache entry (for restart persistence of cached approvals). */
83
69
  export declare const SerializedApprovalCacheEntrySchema: z.ZodObject<{
84
- /** The cache key: "${sessionKey}::${action}" */
85
70
  cacheKey: z.ZodString;
86
- /** The cached approval resolution */
87
71
  resolution: z.ZodObject<{
88
72
  requestId: z.ZodString;
89
73
  approved: z.ZodBoolean;
@@ -91,7 +75,6 @@ export declare const SerializedApprovalCacheEntrySchema: z.ZodObject<{
91
75
  reason: z.ZodOptional<z.ZodString>;
92
76
  resolvedAt: z.ZodNumber;
93
77
  }, z.core.$strict>;
94
- /** Absolute expiry timestamp (epoch ms) */
95
78
  expiresAt: z.ZodNumber;
96
79
  }, z.core.$strict>;
97
80
  /** A serialized approval cache entry for persistence across restarts. */
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Background task origin: captures the originating session attribution
3
+ * (agent + session + channel + trace + hop count) at the moment a tool
4
+ * execution is promoted to a background task. Persisted on the task so
5
+ * completion can route a re-entry announcement back to the right session
6
+ * even after a daemon restart.
7
+ *
8
+ * Lives in @comis/core (not @comis/agent) so the event-bus payload type
9
+ * in core/src/event-bus/events-infra.ts can carry it without violating
10
+ * the inward-only dependency direction (AGENTS.md §1).
11
+ *
12
+ * @module
13
+ */
14
+ import { z } from "zod";
15
+ /**
16
+ * Origin context captured at promote() time. All string fields are
17
+ * non-empty so the runner can reconstruct a valid SessionKey via
18
+ * parseFormattedSessionKey() and dispatch executor.execute() to the
19
+ * correct session.
20
+ */
21
+ export declare const BackgroundTaskOriginSchema: z.ZodObject<{
22
+ agentId: z.ZodString;
23
+ sessionKey: z.ZodString;
24
+ channelType: z.ZodString;
25
+ channelId: z.ZodString;
26
+ traceId: z.ZodNullable<z.ZodString>;
27
+ backgroundHopCount: z.ZodDefault<z.ZodNumber>;
28
+ }, z.core.$strict>;
29
+ export type BackgroundTaskOrigin = z.infer<typeof BackgroundTaskOriginSchema>;
@@ -0,0 +1,39 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * Background task origin: captures the originating session attribution
4
+ * (agent + session + channel + trace + hop count) at the moment a tool
5
+ * execution is promoted to a background task. Persisted on the task so
6
+ * completion can route a re-entry announcement back to the right session
7
+ * even after a daemon restart.
8
+ *
9
+ * Lives in @comis/core (not @comis/agent) so the event-bus payload type
10
+ * in core/src/event-bus/events-infra.ts can carry it without violating
11
+ * the inward-only dependency direction (AGENTS.md §1).
12
+ *
13
+ * @module
14
+ */
15
+ import { z } from "zod";
16
+ /**
17
+ * Origin context captured at promote() time. All string fields are
18
+ * non-empty so the runner can reconstruct a valid SessionKey via
19
+ * parseFormattedSessionKey() and dispatch executor.execute() to the
20
+ * correct session.
21
+ */
22
+ export const BackgroundTaskOriginSchema = z.strictObject({
23
+ /** The agent that owned the tool call. */
24
+ agentId: z.string().min(1),
25
+ /** Formatted session key string (parseFormattedSessionKey-compatible). */
26
+ sessionKey: z.string().min(1),
27
+ /** Channel type the originating message arrived on (e.g., "telegram"). */
28
+ channelType: z.string().min(1),
29
+ /** Channel-specific identifier for the originating user/group. */
30
+ channelId: z.string().min(1),
31
+ /** Per-execution trace identifier; null when no trace was active. */
32
+ traceId: z.string().nullable(),
33
+ /** Recursion-bound counter. Captured at promote-time from the inbound
34
+ * NormalizedMessage's metadata.backgroundHopCount (defaults to 0 for
35
+ * top-level user messages). The completion runner increments this
36
+ * when constructing the outgoing synthetic message, and falls back to
37
+ * fallbackNotifyFn when (incomingHopCount + 1) >= maxBackgroundHops. */
38
+ backgroundHopCount: z.number().int().nonnegative().default(0),
39
+ });
@@ -11,15 +11,10 @@ import { z } from "zod";
11
11
  * to guarantee immutability after creation.
12
12
  */
13
13
  export declare const DeliveryOriginSchema: z.ZodObject<{
14
- /** Platform identifier (e.g., "telegram", "discord", "gateway") */
15
14
  channelType: z.ZodString;
16
- /** Channel or chat identifier within the platform */
17
15
  channelId: z.ZodString;
18
- /** Originating user identifier */
19
16
  userId: z.ZodString;
20
- /** Thread within the channel (platform-specific, e.g., Discord thread, Telegram topic) */
21
17
  threadId: z.ZodOptional<z.ZodString>;
22
- /** Multi-tenant isolation key */
23
18
  tenantId: z.ZodDefault<z.ZodString>;
24
19
  }, z.core.$strict>;
25
20
  export type DeliveryOrigin = Readonly<z.infer<typeof DeliveryOriginSchema>>;