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
@@ -3,7 +3,7 @@
3
3
  * Handles model catalog query methods:
4
4
  * models.list -- List available models (optionally filtered by provider)
5
5
  * models.test -- Check provider configuration and catalog status
6
- * models.list_providers -- Live native pi-ai catalog provider list (Layer 1F)
6
+ * models.list_providers -- Live native pi-ai catalog provider list
7
7
  * All handlers are read-only -- no approval gate required.
8
8
  * @module
9
9
  */
@@ -4,7 +4,7 @@
4
4
  * Handles model catalog query methods:
5
5
  * models.list -- List available models (optionally filtered by provider)
6
6
  * models.test -- Check provider configuration and catalog status
7
- * models.list_providers -- Live native pi-ai catalog provider list (Layer 1F)
7
+ * models.list_providers -- Live native pi-ai catalog provider list
8
8
  * All handlers are read-only -- no approval gate required.
9
9
  * @module
10
10
  */
@@ -64,7 +64,7 @@ export function createModelHandlers(deps) {
64
64
  };
65
65
  },
66
66
  // -----------------------------------------------------------------------
67
- // List native pi-ai catalog providers (Layer 1F -- 260430-vwt)
67
+ // List native pi-ai catalog providers
68
68
  //
69
69
  // Live self-discovery for the agent: returns the de-duplicated, sorted
70
70
  // list of provider names from the pi-ai native catalog. Pairs with the
@@ -196,20 +196,17 @@ export function createProviderHandlers(deps) {
196
196
  throw new Error(`Provider already exists: ${providerId}`);
197
197
  }
198
198
  const config = params.config ?? {};
199
- // 260501-gyy: reject redundant catalog-shadowing entries before
200
- // promotion / probe / persist. A built-in provider with a catalog
201
- // (or absent) baseUrl is structurally redundant -- pi-ai's dynamic
202
- // catalog already provides its model list. Production trace
203
- // 2026-05-01 08:53 showed an LLM agent creating
204
- // providers.entries.openrouter with an invented model id, leading
205
- // to a downstream 404.
199
+ // Reject redundant catalog-shadowing entries before promotion / probe
200
+ // / persist. A built-in provider with a catalog (or absent) baseUrl is
201
+ // structurally redundant -- pi-ai's dynamic catalog already provides
202
+ // its model list.
206
203
  const guardResult = checkBuiltInProviderRedundancy(providerId, config);
207
204
  if (!guardResult.ok) {
208
205
  throw new Error(guardResult.reason);
209
206
  }
210
- // Layer 1C (260430-vwt): auto-promote type to native catalog name
211
- // when the providerId matches a pi-ai catalog entry AND the user has
212
- // not opted out via a custom baseUrl.
207
+ // Auto-promote type to native catalog name when the providerId
208
+ // matches a pi-ai catalog entry AND the user has not opted out via a
209
+ // custom baseUrl.
213
210
  const normalizedConfig = normalizeProviderEntry(providerId, config, deps.persistDeps?.logger);
214
211
  const parsedConfig = ProviderEntrySchema.parse(normalizedConfig);
215
212
  // Probe provider API key before committing config
@@ -260,8 +257,8 @@ export function createProviderHandlers(deps) {
260
257
  // Capture user-provided fields BEFORE merge -- persistToConfig does deepMerge internally,
261
258
  // so we only persist the user's partial patch (not the fully merged config).
262
259
  const userPatch = params.config ? structuredClone(params.config) : {};
263
- // Layer 1C (260430-vwt): on update, only auto-promote when the user
264
- // is actively changing the `type` field. If `type` is absent from
260
+ // On update, only auto-promote when the user is actively changing
261
+ // the `type` field. If `type` is absent from
265
262
  // the patch, the user is editing other fields and we must not
266
263
  // rewrite their existing type silently.
267
264
  let normalizedPatch = config;
@@ -185,6 +185,7 @@ export interface RpcDispatchDeps {
185
185
  globalHeartbeatConfig?: Record<string, unknown>;
186
186
  notificationService?: import("../notification/notification-service.js").NotificationService;
187
187
  imageHandlerDeps?: ImageHandlerDeps;
188
+ oauthCredentialStore?: import("@comis/core").OAuthCredentialStorePort;
188
189
  }
189
190
  /**
190
191
  * Classify an RPC error message for structured logging.
@@ -71,7 +71,17 @@ export function createRpcDispatch(deps) {
71
71
  ...createSessionHandlers(deps),
72
72
  ...createMessageHandlers(deps),
73
73
  ...createMediaHandlers(deps),
74
- ...createConfigHandlers(deps),
74
+ // Thread the daemon-level OAuth credential store into config.patch's
75
+ // credential guard so model/provider patches on OAuth-only providers
76
+ // (e.g. openai-codex) can resolve via Source C
77
+ // (agents.<id>.oauthProfiles -> ~/.comis/auth-profiles.json). Explicit
78
+ // pass-through mirrors the createAgentHandlers wiring below; do not
79
+ // simplify back to `...createConfigHandlers(deps)` (the structural-typing
80
+ // inheritance is fragile to future deps-shape narrowing).
81
+ ...createConfigHandlers({
82
+ ...deps,
83
+ oauthCredentialStore: deps.oauthCredentialStore,
84
+ }),
75
85
  ...createEnvHandlers(deps),
76
86
  ...createBrowserHandlers(deps),
77
87
  ...createSubagentHandlers(deps),
@@ -90,6 +100,14 @@ export function createRpcDispatch(deps) {
90
100
  ...deps,
91
101
  secretManager: deps.container?.secretManager,
92
102
  providerEntries: deps.container.config.providers.entries,
103
+ // Thread the daemon-level OAuth credential store into agents.update
104
+ // so the oauthProfiles existence check can run via has(). When unset
105
+ // (e.g. unwired test setups) the validation block in agent-handlers
106
+ // becomes a no-op.
107
+ oauthCredentialStore: deps.oauthCredentialStore,
108
+ // Resolves `provider: "default"` to `models.defaultProvider` in the
109
+ // credential check, mirroring `resolveAgentModel` runtime resolution.
110
+ modelsConfig: deps.container.config.models,
93
111
  persistDeps: {
94
112
  container: deps.container,
95
113
  configPaths: deps.configPaths,
@@ -135,7 +153,14 @@ export function createRpcDispatch(deps) {
135
153
  logger: deps.logger,
136
154
  },
137
155
  }),
138
- ...createMcpHandlers({ mcpClientManager: deps.mcpClientManager, logger: deps.logger }),
156
+ ...createMcpHandlers({
157
+ mcpClientManager: deps.mcpClientManager,
158
+ logger: deps.logger,
159
+ // Threaded for env-ref validation on mcp.connect. Same pattern as
160
+ // agent/provider handlers above. When undefined the validator becomes
161
+ // a no-op.
162
+ secretManager: deps.container?.secretManager,
163
+ }),
139
164
  ...createDaemonHandlers({ logLevelManager: deps.logLevelManager }),
140
165
  // Workspace file management handlers
141
166
  ...createWorkspaceHandlers({
@@ -25,6 +25,5 @@ export function emitDockerRestartPolicyWarn(logger, opts = {}) {
25
25
  logger.warn({
26
26
  hint: "Wizard 'Restart' actions, gateway.restart, gateway.env_set, and gateway.patch on restart-triggering paths all require the container to have --restart unless-stopped (or compose restart: unless-stopped). Verify from your host with: docker inspect <name> --format '{{.HostConfig.RestartPolicy.Name}}'",
27
27
  errorKind: "config",
28
- module: "daemon",
29
28
  }, "Running in Docker — restart policy required for config-reload operations");
30
29
  }
@@ -139,6 +139,24 @@ export interface SubAgentRunnerDeps {
139
139
  abort(): Promise<void>;
140
140
  } | undefined;
141
141
  };
142
+ /**
143
+ * Optional composite-key resolver (R3, B37). When provided, supersedes
144
+ * `activeRunRegistry.get(sessionKey)` for production aborts: the resolver
145
+ * accepts `{ agentId, channelType, channelId }` so multi-agent /
146
+ * multi-channel sessions are distinguishable. Locally re-declared to a
147
+ * structural minimum (avoids a daemon -> agent type-only import cycle in
148
+ * this leaf module). The daemon wires it via
149
+ * `createBackgroundSessionResolver({activeRunRegistry})`.
150
+ */
151
+ sessionResolver?: {
152
+ resolveActiveSession(key: {
153
+ agentId: string;
154
+ channelType: string;
155
+ channelId: string;
156
+ }): {
157
+ abort(): Promise<void>;
158
+ } | undefined;
159
+ };
142
160
  /** Optional result condenser for compressing subagent output */
143
161
  resultCondenser?: {
144
162
  condense(params: {
@@ -22,6 +22,34 @@ import { classifyAbortReason, buildAnnouncementMessage, deliverAnnouncement, del
22
22
  * Parent agents may call slow tools (image generation at 120s, web search, etc.)
23
23
  * in response to announcements. 30s caused premature fallback + duplicate delivery. */
24
24
  export const ANNOUNCE_PARENT_TIMEOUT_MS = 300_000;
25
+ /**
26
+ * Build the composite-key triple from a SubAgentRun for resolver lookups
27
+ * (R3, B37). Sub-agent runs only carry a formatted `sessionKey` string +
28
+ * `agentId` + optional announce-channel context, so:
29
+ * - agentId -> run.agentId
30
+ * - channelType-> run.announceChannelType ?? "sub-agent"
31
+ * - channelId -> run.announceChannelId
32
+ * ?? parseFormattedSessionKey(run.sessionKey)?.channelId
33
+ * ?? run.sessionKey (last-resort: the formatted key
34
+ * itself; never empty so the
35
+ * resolver's empty-field guard
36
+ * does not trip)
37
+ *
38
+ * The "sub-agent" channelType fallback acknowledges that production
39
+ * SubAgentRun does not carry the original inbound channelType -- the
40
+ * abort path is best-effort regardless (the SDK session may already be
41
+ * in cleanup), so a no-op when the resolver does not find a handle is
42
+ * acceptable. There is a runtime semantic gap (deviation: composite-key
43
+ * triple vs registered formatted-key shape).
44
+ */
45
+ function deriveCompositeForRun(run) {
46
+ const parsed = parseFormattedSessionKey(run.sessionKey);
47
+ return {
48
+ agentId: run.agentId,
49
+ channelType: run.announceChannelType ?? "sub-agent",
50
+ channelId: run.announceChannelId ?? parsed?.channelId ?? run.sessionKey,
51
+ };
52
+ }
25
53
  // Re-export extracted result processor types and functions for backward compatibility
26
54
  export { classifyAbortReason, buildAnnouncementMessage, deliverFailureNotification, sweepResultFiles, persistFailureRecord, validateOutputs } from "./sub-agent-result-processor.js";
27
55
  // ---------------------------------------------------------------------------
@@ -181,9 +209,9 @@ export function createSubAgentRunner(deps) {
181
209
  runtimeMs: runningDurationMs,
182
210
  }, deps.logger), "ghost-sweep-failure-record");
183
211
  }
184
- // Abort SDK session (best-effort)
185
- if (deps.activeRunRegistry) {
186
- const handle = deps.activeRunRegistry.get(run.sessionKey);
212
+ // Abort SDK session (best-effort, R3 / B37 -- composite-key resolver)
213
+ if (deps.sessionResolver) {
214
+ const handle = deps.sessionResolver.resolveActiveSession(deriveCompositeForRun(run));
187
215
  if (handle) {
188
216
  // eslint-disable-next-line no-restricted-syntax -- intentional fire-and-forget
189
217
  handle.abort().catch(() => { });
@@ -1000,9 +1028,12 @@ export function createSubAgentRunner(deps) {
1000
1028
  runtimeMs,
1001
1029
  }, deps.logger), "watchdog-failure-record");
1002
1030
  }
1003
- // Abort SDK session (keyed by sessionKey, NOT runId)
1004
- if (deps.activeRunRegistry) {
1005
- const handle = deps.activeRunRegistry.get(run.sessionKey);
1031
+ // Abort SDK session via composite-key resolver (R3 / B37). The
1032
+ // previous lookup keyed on the formatted sessionKey only; the
1033
+ // resolver makes the `(agentId, channelType, channelId)` triple
1034
+ // explicit so multi-agent collisions are distinguishable.
1035
+ if (deps.sessionResolver) {
1036
+ const handle = deps.sessionResolver.resolveActiveSession(deriveCompositeForRun(run));
1006
1037
  if (handle) {
1007
1038
  handle.abort().catch((abortErr) => {
1008
1039
  deps.logger?.debug({ runId, err: abortErr }, "Watchdog SDK abort best-effort failed");
@@ -1133,9 +1164,10 @@ export function createSubAgentRunner(deps) {
1133
1164
  runtimeMs: run.completedAt - run.startedAt,
1134
1165
  }, deps.logger), "kill-failure-record");
1135
1166
  }
1136
- // Abort the in-flight SDK session to stop LLM API calls (best-effort)
1137
- if (deps.activeRunRegistry) {
1138
- const handle = deps.activeRunRegistry.get(run.sessionKey);
1167
+ // Abort the in-flight SDK session via composite-key resolver
1168
+ // (R3 / B37, best-effort).
1169
+ if (deps.sessionResolver) {
1170
+ const handle = deps.sessionResolver.resolveActiveSession(deriveCompositeForRun(run));
1139
1171
  if (handle) {
1140
1172
  handle.abort().catch((abortErr) => {
1141
1173
  deps.logger?.debug({ runId, err: abortErr }, "Sub-agent SDK abort best-effort failed");
@@ -17,3 +17,7 @@ export { setupGateway, type GatewayDeps, type GatewayResult, setupRpcBridge, typ
17
17
  export { setupDeliveryQueue, type DeliveryQueueResult, setupDeliveryMirror, type DeliveryMirrorResult } from "./setup-delivery.js";
18
18
  export { setupNotifications, type NotificationContext } from "./setup-notifications.js";
19
19
  export { setupBackgroundTasks, type BackgroundTasksContext } from "./setup-background-tasks.js";
20
+ export { setupBackgroundCompletionRunner } from "./setup-background-completion-runner.js";
21
+ export type { BackgroundCompletionRunnerContext, SetupBackgroundCompletionRunnerDeps, } from "./setup-background-completion-runner.js";
22
+ export { setupOutputRetention, validateOutputRetentionConfig, } from "./setup-output-retention.js";
23
+ export type { SetupOutputRetentionDeps, SetupOutputRetentionHandle, } from "./setup-output-retention.js";
@@ -16,3 +16,5 @@ export { setupGateway, setupRpcBridge } from "./setup-gateway.js";
16
16
  export { setupDeliveryQueue, setupDeliveryMirror } from "./setup-delivery.js";
17
17
  export { setupNotifications } from "./setup-notifications.js";
18
18
  export { setupBackgroundTasks } from "./setup-background-tasks.js";
19
+ export { setupBackgroundCompletionRunner } from "./setup-background-completion-runner.js";
20
+ export { setupOutputRetention, validateOutputRetentionConfig, } from "./setup-output-retention.js";
@@ -0,0 +1,21 @@
1
+ import type { ComisLogger } from "@comis/infra";
2
+ import type { PerAgentConfig } from "@comis/core";
3
+ /**
4
+ * Returns `true` iff at least one agent's `provider` is recognised by pi-ai's
5
+ * `getOAuthProvider` as an OAuth-using provider.
6
+ *
7
+ * Single-source-of-truth check — avoids drift with pi-ai's provider catalogue.
8
+ * When this returns `false`, the daemon skips the preflight entirely (zero
9
+ * outbound probes during boot for OAuth-less deployments).
10
+ */
11
+ export declare function hasAnyOAuthAgent(agents: Record<string, PerAgentConfig>): boolean;
12
+ /**
13
+ * Run the OAuth TLS preflight and emit a single structured log line if it
14
+ * fails. Never throws — `runOAuthTlsPreflight` returns a discriminated union
15
+ * and this function only reads-and-logs.
16
+ *
17
+ * Caller is expected to invoke this fire-and-forget (`void`) AFTER the
18
+ * `"Comis daemon started"` banner so the daemon already counts as healthy
19
+ * to PM2/systemd by the time the probe resolves.
20
+ */
21
+ export declare function emitOAuthTlsPreflightWarn(logger: ComisLogger): Promise<void>;
@@ -0,0 +1,134 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * Boot-time OAuth TLS preflight wiring.
4
+ *
5
+ * Two helpers exposed for the daemon entry point:
6
+ *
7
+ * 1. `hasAnyOAuthAgent(agents)` — runtime gate. Returns `true` iff at least
8
+ * one entry in the per-agent map declares a `provider` value that
9
+ * pi-ai's `getOAuthProvider` recognises as an OAuth provider. Used to
10
+ * skip the entire preflight (and any outbound network probe) when no
11
+ * OAuth-using agent is configured.
12
+ *
13
+ * 2. `emitOAuthTlsPreflightWarn(logger)` — fire-and-forget. Calls
14
+ * `runOAuthTlsPreflight({ timeoutMs: 4000 })` from `@comis/agent`
15
+ * and surfaces the result via Pino:
16
+ * - `kind: "tls-cert"` → exactly one WARN with module + errorKind +
17
+ * distro-aware install hint + OpenSSL `code` + raw `message`.
18
+ * - `kind: "network"` → a single DEBUG (no WARN — transient failures
19
+ * should not pollute the boot path).
20
+ * - `{ ok: true }` → silent (operators do not want noise on boot).
21
+ *
22
+ * The 4000 ms timeout is intentionally tighter than the CLI doctor variant's
23
+ * 5000 ms — boot must stay under PM2 / systemd watchdog windows even on the
24
+ * worst case.
25
+ *
26
+ * Distro detection (`/etc/os-release` parser + 5-distro install-hint switch)
27
+ * is duplicated inline from `packages/cli/src/doctor/checks/oauth-health.ts`.
28
+ * Per AGENTS.md §2.3 rule of three, two callers do not yet justify a shared
29
+ * helper. If a third caller appears, extract the pair to
30
+ * `packages/agent/src/model/oauth-os-release.ts`.
31
+ *
32
+ * Per AGENTS.md §2.4 the logger is injected — no `@comis/infra` import.
33
+ *
34
+ * @module
35
+ */
36
+ import { readFile } from "node:fs/promises";
37
+ import { runOAuthTlsPreflight } from "@comis/agent";
38
+ import { getOAuthProvider } from "@mariozechner/pi-ai/oauth";
39
+ /** Boot-tighter timeout — keeps the preflight inside PM2/systemd watchdog windows. */
40
+ const PREFLIGHT_TIMEOUT_MS = 4000;
41
+ /** Pino `module` field — operators grep on this to isolate preflight logs. */
42
+ const MODULE_NAME = "oauth-tls-preflight";
43
+ /**
44
+ * Returns `true` iff at least one agent's `provider` is recognised by pi-ai's
45
+ * `getOAuthProvider` as an OAuth-using provider.
46
+ *
47
+ * Single-source-of-truth check — avoids drift with pi-ai's provider catalogue.
48
+ * When this returns `false`, the daemon skips the preflight entirely (zero
49
+ * outbound probes during boot for OAuth-less deployments).
50
+ */
51
+ export function hasAnyOAuthAgent(agents) {
52
+ return Object.values(agents).some((agent) => Boolean(getOAuthProvider(agent.provider)));
53
+ }
54
+ /**
55
+ * Parses `/etc/os-release` into `{ id, idLike }`. Returns `null` on read
56
+ * error (missing file, permission denied, malformed contents).
57
+ *
58
+ * Verbatim duplication from `oauth-health.ts` — see module JSDoc for the
59
+ * AGENTS.md §2.3 deferral rationale.
60
+ */
61
+ async function readOsRelease(path = "/etc/os-release") {
62
+ try {
63
+ const text = await readFile(path, "utf-8");
64
+ const map = new Map();
65
+ for (const line of text.split("\n")) {
66
+ const m = line.match(/^([A-Z_]+)=(.*)$/);
67
+ if (m)
68
+ map.set(m[1], m[2].replace(/^"|"$/g, ""));
69
+ }
70
+ const id = map.get("ID") ?? "";
71
+ const idLike = (map.get("ID_LIKE") ?? "").split(/\s+/).filter(Boolean);
72
+ return { id, idLike };
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * Produces a distro-aware install command for the system CA bundle.
80
+ *
81
+ * Verbatim duplication from `oauth-health.ts` — see module JSDoc for the
82
+ * AGENTS.md §2.3 deferral rationale.
83
+ */
84
+ function caCertificatesInstallHint(os) {
85
+ if (!os)
86
+ return "Install ca-certificates via your distro's package manager and retry";
87
+ const idChain = [os.id, ...os.idLike];
88
+ if (idChain.includes("alpine"))
89
+ return "apk add ca-certificates && update-ca-certificates";
90
+ if (idChain.includes("debian") || idChain.includes("ubuntu")) {
91
+ return "sudo apt-get install -y ca-certificates && sudo update-ca-certificates";
92
+ }
93
+ if (idChain.includes("fedora") || idChain.includes("rhel") || idChain.includes("centos")) {
94
+ return "sudo dnf install -y ca-certificates && sudo update-ca-trust";
95
+ }
96
+ if (idChain.includes("arch"))
97
+ return "sudo pacman -S ca-certificates && sudo trust extract-compat";
98
+ if (idChain.includes("suse") || idChain.includes("opensuse")) {
99
+ return "sudo zypper install ca-certificates && sudo update-ca-certificates";
100
+ }
101
+ return "Install ca-certificates via your distro's package manager and retry";
102
+ }
103
+ /**
104
+ * Run the OAuth TLS preflight and emit a single structured log line if it
105
+ * fails. Never throws — `runOAuthTlsPreflight` returns a discriminated union
106
+ * and this function only reads-and-logs.
107
+ *
108
+ * Caller is expected to invoke this fire-and-forget (`void`) AFTER the
109
+ * `"Comis daemon started"` banner so the daemon already counts as healthy
110
+ * to PM2/systemd by the time the probe resolves.
111
+ */
112
+ export async function emitOAuthTlsPreflightWarn(logger) {
113
+ const result = await runOAuthTlsPreflight({ timeoutMs: PREFLIGHT_TIMEOUT_MS });
114
+ if (result.ok)
115
+ return;
116
+ if (result.kind === "tls-cert") {
117
+ const os = await readOsRelease();
118
+ const hint = caCertificatesInstallHint(os);
119
+ logger.warn({
120
+ submodule: MODULE_NAME,
121
+ errorKind: "oauth_tls_cert",
122
+ hint,
123
+ code: result.code,
124
+ message: result.message,
125
+ }, "OAuth TLS preflight failed: system CA bundle cannot validate auth.openai.com");
126
+ return;
127
+ }
128
+ // kind === "network" — transient outage / DNS / firewall. DEBUG only.
129
+ logger.debug({
130
+ submodule: MODULE_NAME,
131
+ errorKind: "oauth_tls_network",
132
+ message: result.message,
133
+ }, "OAuth TLS preflight network failure (skipping WARN — likely transient)");
134
+ }
@@ -3,13 +3,23 @@
3
3
  * dependencies (circuit breaker, budget guard, cost tracker, step counter),
4
4
  * and PiExecutor creation.
5
5
  * All agents use PiExecutor (pi-coding-agent AgentSession wrapper).
6
+ *
7
+ * The live ToolCapabilityPort adapter is constructed inside setupSingleAgent
8
+ * (this function), NOT at a higher composition site (daemon.ts). Rationale:
9
+ * skillRegistry is per-agent and the skill-allow/deny precedence chain is
10
+ * per-agent; a daemon-global adapter cannot satisfy this without breaking
11
+ * the port interface (would require adding agentId to every method). The
12
+ * per-agent port is exposed via AgentsResult.toolCapabilityPorts and threaded
13
+ * into setupTools via the getCapabilityPortForAgent closure on ToolsDeps.
14
+ *
6
15
  * @module
7
16
  */
8
- import { type AppContainer, type InjectionRateLimiter, type PerAgentConfig } from "@comis/core";
17
+ import { type AppContainer, type InjectionRateLimiter, type OAuthCredentialStorePort, type SecretsCrypto, type PerAgentConfig, type ToolCapabilityPort } from "@comis/core";
9
18
  import type { ComisLogger } from "@comis/infra";
19
+ import type Database from "better-sqlite3";
10
20
  import type { SqliteMemoryAdapter, createSessionStore } from "@comis/memory";
11
21
  import { createBudgetGuard, createCostTracker, createStepCounter, createSessionLifecycle, createComisSessionManager, type AgentExecutor, type ActiveRunRegistry, type ProviderHealthMonitor, type LastKnownModelTracker } from "@comis/agent";
12
- import { type SkillRegistry, type SkillWatcherHandle } from "@comis/skills";
22
+ import { type SkillRegistry, type SkillWatcherHandle, type McpClientManager } from "@comis/skills";
13
23
  type PiSessionAdapter = ReturnType<typeof createComisSessionManager>;
14
24
  /** Shared dependencies computed once before the agent loop and passed to each
15
25
  * setupSingleAgent() call. Exposed on AgentsResult so daemon.ts can capture
@@ -59,6 +69,38 @@ export interface SingleAgentDeps {
59
69
  backgroundTaskManager?: import("@comis/agent").BackgroundTaskManager;
60
70
  /** Callback to send completion notifications for background tasks. */
61
71
  backgroundNotifyFn?: import("@comis/agent").NotifyFn;
72
+ /**
73
+ * SecretsCrypto engine bound to SECRETS_MASTER_KEY. Defined when the daemon
74
+ * was started with a valid master key (encrypted-secrets mode). Required
75
+ * when `appConfig.oauth.storage === "encrypted"` — selectOAuthCredentialStore
76
+ * fails fast with an operator hint when missing.
77
+ */
78
+ secretsCrypto?: SecretsCrypto;
79
+ /**
80
+ * Shared better-sqlite3 handle to secrets.db (the SqliteSecretStoreHandle.db
81
+ * field, plumbed through from daemon.ts after createSqliteSecretStore).
82
+ * Required when `appConfig.oauth.storage === "encrypted"` so the OAuth
83
+ * profile adapter can share the existing connection rather than opening a
84
+ * second handle to the same DB file — eliminates the dual-handle lifecycle
85
+ * hazards: close-order, schema-init double-execution, prepared-statement
86
+ * cache fragmentation.
87
+ */
88
+ secretsDb?: Database.Database;
89
+ /**
90
+ * The daemon-level OAuthCredentialStore handle. Constructed ONCE in
91
+ * setupAgents() and passed down to every per-agent setupSingleAgent call
92
+ * AND surfaced on AgentsResult so daemon.ts can thread it into
93
+ * RpcDispatchDeps for `agents.update` existence checks. Single shared
94
+ * handle (file backend is stateless on a shared path; encrypted backend
95
+ * shares the secretsDb connection).
96
+ */
97
+ oauthCredentialStore: OAuthCredentialStorePort;
98
+ /**
99
+ * Daemon-global MCP client manager. Live-runtime view consumed by the
100
+ * per-agent ToolCapabilityPort adapter constructed inside setupSingleAgent.
101
+ * Threaded from daemon.ts; setupMcp runs before setupAgents.
102
+ */
103
+ mcpClientManager: McpClientManager;
62
104
  }
63
105
  /** Per-agent outputs from setupSingleAgent(), matching the Maps in AgentsResult. */
64
106
  export interface SingleAgentResult {
@@ -70,6 +112,12 @@ export interface SingleAgentResult {
70
112
  piSessionAdapter: PiSessionAdapter;
71
113
  skillWatcherHandle?: SkillWatcherHandle;
72
114
  skillRegistry: SkillRegistry;
115
+ /**
116
+ * Per-agent live ToolCapabilityPort. Constructed via
117
+ * createToolCapabilityAdapter using this agent's skillRegistry and the
118
+ * daemon-global mcpClientManager.
119
+ */
120
+ toolCapabilityPort: ToolCapabilityPort;
73
121
  }
74
122
  /** All services produced by the per-agent executor setup phase. */
75
123
  export interface AgentsResult {
@@ -97,12 +145,25 @@ export interface AgentsResult {
97
145
  skillWatcherHandles: Map<string, SkillWatcherHandle>;
98
146
  /** Per-agent skill registries for skills.list RPC method. */
99
147
  skillRegistries: Map<string, SkillRegistry>;
148
+ /**
149
+ * Per-agent ToolCapabilityPort instances. Consumed by setupTools via the
150
+ * getCapabilityPortForAgent closure on ToolsDeps; mutated by hot-add /
151
+ * hot-remove in daemon.ts to keep the parallel map consistent with
152
+ * skillRegistries.
153
+ */
154
+ toolCapabilityPorts: Map<string, ToolCapabilityPort>;
100
155
  /** Periodic lock cleanup timer (cleared on shutdown). */
101
156
  lockCleanupTimer: ReturnType<typeof setInterval>;
102
157
  /** Shared single-agent dependencies for hot-add closure capture. */
103
158
  singleAgentDeps: SingleAgentDeps;
104
159
  /** Global provider health monitor for daemon-level health metrics */
105
160
  providerHealth: ProviderHealthMonitor;
161
+ /**
162
+ * Daemon-level OAuthCredentialStore handle. Threaded into
163
+ * RpcDispatchDeps so agents.update can validate oauthProfiles patches
164
+ * via has().
165
+ */
166
+ oauthCredentialStore: OAuthCredentialStorePort;
106
167
  }
107
168
  /**
108
169
  * Set up a single agent's executor and all supporting services.
@@ -162,6 +223,24 @@ export declare function setupAgents(deps: {
162
223
  backgroundTaskManager?: import("@comis/agent").BackgroundTaskManager;
163
224
  /** Callback to send completion notifications for background tasks. */
164
225
  backgroundNotifyFn?: import("@comis/agent").NotifyFn;
226
+ /**
227
+ * SecretsCrypto engine bound to SECRETS_MASTER_KEY. Defined when daemon
228
+ * was started with a valid master key. Required for
229
+ * `appConfig.oauth.storage === "encrypted"` mode.
230
+ */
231
+ secretsCrypto?: SecretsCrypto;
232
+ /**
233
+ * Shared better-sqlite3 handle to secrets.db. Plumbed from daemon.ts where
234
+ * createSqliteSecretStore now exposes its db field. Required for
235
+ * `appConfig.oauth.storage === "encrypted"` mode.
236
+ */
237
+ secretsDb?: Database.Database;
238
+ /**
239
+ * Daemon-global MCP client manager. setupSingleAgent constructs a
240
+ * per-agent ToolCapabilityPort adapter that closes over this manager.
241
+ * daemon.ts threads it in after running setupMcp before setupAgents.
242
+ */
243
+ mcpClientManager: McpClientManager;
165
244
  }): Promise<AgentsResult>;
166
245
  /**
167
246
  * Resolve "default" model/provider placeholders to concrete values from the