comisai 1.0.4

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 (2340) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +186 -0
  3. package/dist/agent.d.ts +1 -0
  4. package/dist/agent.js +2 -0
  5. package/dist/channels.d.ts +1 -0
  6. package/dist/channels.js +2 -0
  7. package/dist/cli-entry.d.ts +2 -0
  8. package/dist/cli-entry.js +16 -0
  9. package/dist/cli.d.ts +1 -0
  10. package/dist/cli.js +2 -0
  11. package/dist/core.d.ts +1 -0
  12. package/dist/core.js +2 -0
  13. package/dist/daemon.d.ts +1 -0
  14. package/dist/daemon.js +2 -0
  15. package/dist/gateway.d.ts +1 -0
  16. package/dist/gateway.js +2 -0
  17. package/dist/index.d.ts +12 -0
  18. package/dist/index.js +15 -0
  19. package/dist/infra.d.ts +1 -0
  20. package/dist/infra.js +2 -0
  21. package/dist/memory.d.ts +1 -0
  22. package/dist/memory.js +2 -0
  23. package/dist/scheduler.d.ts +1 -0
  24. package/dist/scheduler.js +2 -0
  25. package/dist/shared.d.ts +1 -0
  26. package/dist/shared.js +2 -0
  27. package/dist/skills.d.ts +1 -0
  28. package/dist/skills.js +2 -0
  29. package/node_modules/@comis/agent/dist/background/auto-background-middleware.d.ts +27 -0
  30. package/node_modules/@comis/agent/dist/background/auto-background-middleware.js +87 -0
  31. package/node_modules/@comis/agent/dist/background/background-task-manager.d.ts +34 -0
  32. package/node_modules/@comis/agent/dist/background/background-task-manager.js +199 -0
  33. package/node_modules/@comis/agent/dist/background/background-task-persistence.d.ts +26 -0
  34. package/node_modules/@comis/agent/dist/background/background-task-persistence.js +117 -0
  35. package/node_modules/@comis/agent/dist/background/background-task-types.d.ts +30 -0
  36. package/node_modules/@comis/agent/dist/background/background-task-types.js +7 -0
  37. package/node_modules/@comis/agent/dist/background/index.d.ts +11 -0
  38. package/node_modules/@comis/agent/dist/background/index.js +9 -0
  39. package/node_modules/@comis/agent/dist/bootstrap/index.d.ts +6 -0
  40. package/node_modules/@comis/agent/dist/bootstrap/index.js +7 -0
  41. package/node_modules/@comis/agent/dist/bootstrap/section-extractor.d.ts +28 -0
  42. package/node_modules/@comis/agent/dist/bootstrap/section-extractor.js +70 -0
  43. package/node_modules/@comis/agent/dist/bootstrap/sections/context-sections.d.ts +43 -0
  44. package/node_modules/@comis/agent/dist/bootstrap/sections/context-sections.js +224 -0
  45. package/node_modules/@comis/agent/dist/bootstrap/sections/core-sections.d.ts +12 -0
  46. package/node_modules/@comis/agent/dist/bootstrap/sections/core-sections.js +162 -0
  47. package/node_modules/@comis/agent/dist/bootstrap/sections/docs-sections.d.ts +19 -0
  48. package/node_modules/@comis/agent/dist/bootstrap/sections/docs-sections.js +75 -0
  49. package/node_modules/@comis/agent/dist/bootstrap/sections/index.d.ts +10 -0
  50. package/node_modules/@comis/agent/dist/bootstrap/sections/index.js +11 -0
  51. package/node_modules/@comis/agent/dist/bootstrap/sections/media-sections.d.ts +21 -0
  52. package/node_modules/@comis/agent/dist/bootstrap/sections/media-sections.js +117 -0
  53. package/node_modules/@comis/agent/dist/bootstrap/sections/messaging-sections.d.ts +14 -0
  54. package/node_modules/@comis/agent/dist/bootstrap/sections/messaging-sections.js +119 -0
  55. package/node_modules/@comis/agent/dist/bootstrap/sections/skills-memory-sections.d.ts +7 -0
  56. package/node_modules/@comis/agent/dist/bootstrap/sections/skills-memory-sections.js +114 -0
  57. package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.d.ts +81 -0
  58. package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.js +549 -0
  59. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +62 -0
  60. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +363 -0
  61. package/node_modules/@comis/agent/dist/bootstrap/sections/trust-sections.d.ts +47 -0
  62. package/node_modules/@comis/agent/dist/bootstrap/sections/trust-sections.js +106 -0
  63. package/node_modules/@comis/agent/dist/bootstrap/sections/verbosity-sections.d.ts +30 -0
  64. package/node_modules/@comis/agent/dist/bootstrap/sections/verbosity-sections.js +68 -0
  65. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.d.ts +108 -0
  66. package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.js +199 -0
  67. package/node_modules/@comis/agent/dist/bootstrap/types.d.ts +96 -0
  68. package/node_modules/@comis/agent/dist/bootstrap/types.js +21 -0
  69. package/node_modules/@comis/agent/dist/bootstrap/workspace-loader.d.ts +121 -0
  70. package/node_modules/@comis/agent/dist/bootstrap/workspace-loader.js +227 -0
  71. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.d.ts +30 -0
  72. package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.js +94 -0
  73. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +95 -0
  74. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +104 -0
  75. package/node_modules/@comis/agent/dist/bridge/bridge-safety-controls.d.ts +105 -0
  76. package/node_modules/@comis/agent/dist/bridge/bridge-safety-controls.js +182 -0
  77. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +185 -0
  78. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +775 -0
  79. package/node_modules/@comis/agent/dist/budget/budget-guard.d.ts +48 -0
  80. package/node_modules/@comis/agent/dist/budget/budget-guard.js +128 -0
  81. package/node_modules/@comis/agent/dist/budget/cost-tracker.d.ts +110 -0
  82. package/node_modules/@comis/agent/dist/budget/cost-tracker.js +124 -0
  83. package/node_modules/@comis/agent/dist/budget/turn-budget-tracker.d.ts +63 -0
  84. package/node_modules/@comis/agent/dist/budget/turn-budget-tracker.js +65 -0
  85. package/node_modules/@comis/agent/dist/commands/budget-command.d.ts +37 -0
  86. package/node_modules/@comis/agent/dist/commands/budget-command.js +97 -0
  87. package/node_modules/@comis/agent/dist/commands/command-handler.d.ts +23 -0
  88. package/node_modules/@comis/agent/dist/commands/command-handler.js +508 -0
  89. package/node_modules/@comis/agent/dist/commands/command-parser.d.ts +24 -0
  90. package/node_modules/@comis/agent/dist/commands/command-parser.js +182 -0
  91. package/node_modules/@comis/agent/dist/commands/index.d.ts +8 -0
  92. package/node_modules/@comis/agent/dist/commands/index.js +10 -0
  93. package/node_modules/@comis/agent/dist/commands/prompt-skill-command.d.ts +53 -0
  94. package/node_modules/@comis/agent/dist/commands/prompt-skill-command.js +105 -0
  95. package/node_modules/@comis/agent/dist/commands/types.d.ts +184 -0
  96. package/node_modules/@comis/agent/dist/commands/types.js +14 -0
  97. package/node_modules/@comis/agent/dist/context-engine/cleanup-helpers.d.ts +20 -0
  98. package/node_modules/@comis/agent/dist/context-engine/cleanup-helpers.js +36 -0
  99. package/node_modules/@comis/agent/dist/context-engine/constants.d.ts +167 -0
  100. package/node_modules/@comis/agent/dist/context-engine/constants.js +292 -0
  101. package/node_modules/@comis/agent/dist/context-engine/context-engine.d.ts +26 -0
  102. package/node_modules/@comis/agent/dist/context-engine/context-engine.js +554 -0
  103. package/node_modules/@comis/agent/dist/context-engine/dag-annotator.d.ts +49 -0
  104. package/node_modules/@comis/agent/dist/context-engine/dag-annotator.js +178 -0
  105. package/node_modules/@comis/agent/dist/context-engine/dag-assembler.d.ts +32 -0
  106. package/node_modules/@comis/agent/dist/context-engine/dag-assembler.js +298 -0
  107. package/node_modules/@comis/agent/dist/context-engine/dag-compaction.d.ts +110 -0
  108. package/node_modules/@comis/agent/dist/context-engine/dag-compaction.js +358 -0
  109. package/node_modules/@comis/agent/dist/context-engine/dag-integrity.d.ts +27 -0
  110. package/node_modules/@comis/agent/dist/context-engine/dag-integrity.js +371 -0
  111. package/node_modules/@comis/agent/dist/context-engine/dag-reconciliation.d.ts +95 -0
  112. package/node_modules/@comis/agent/dist/context-engine/dag-reconciliation.js +521 -0
  113. package/node_modules/@comis/agent/dist/context-engine/dag-triggers.d.ts +88 -0
  114. package/node_modules/@comis/agent/dist/context-engine/dag-triggers.js +229 -0
  115. package/node_modules/@comis/agent/dist/context-engine/dead-content-evictor.d.ts +40 -0
  116. package/node_modules/@comis/agent/dist/context-engine/dead-content-evictor.js +441 -0
  117. package/node_modules/@comis/agent/dist/context-engine/history-window.d.ts +59 -0
  118. package/node_modules/@comis/agent/dist/context-engine/history-window.js +250 -0
  119. package/node_modules/@comis/agent/dist/context-engine/index.d.ts +45 -0
  120. package/node_modules/@comis/agent/dist/context-engine/index.js +51 -0
  121. package/node_modules/@comis/agent/dist/context-engine/llm-compaction.d.ts +52 -0
  122. package/node_modules/@comis/agent/dist/context-engine/llm-compaction.js +466 -0
  123. package/node_modules/@comis/agent/dist/context-engine/microcompaction-guard.d.ts +49 -0
  124. package/node_modules/@comis/agent/dist/context-engine/microcompaction-guard.js +288 -0
  125. package/node_modules/@comis/agent/dist/context-engine/objective-reinforcement.d.ts +24 -0
  126. package/node_modules/@comis/agent/dist/context-engine/objective-reinforcement.js +100 -0
  127. package/node_modules/@comis/agent/dist/context-engine/observation-masker.d.ts +53 -0
  128. package/node_modules/@comis/agent/dist/context-engine/observation-masker.js +344 -0
  129. package/node_modules/@comis/agent/dist/context-engine/reasoning-tag-stripper.d.ts +43 -0
  130. package/node_modules/@comis/agent/dist/context-engine/reasoning-tag-stripper.js +131 -0
  131. package/node_modules/@comis/agent/dist/context-engine/rehydration.d.ts +30 -0
  132. package/node_modules/@comis/agent/dist/context-engine/rehydration.js +393 -0
  133. package/node_modules/@comis/agent/dist/context-engine/reread-detector.d.ts +31 -0
  134. package/node_modules/@comis/agent/dist/context-engine/reread-detector.js +116 -0
  135. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.d.ts +37 -0
  136. package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.js +119 -0
  137. package/node_modules/@comis/agent/dist/context-engine/token-budget.d.ts +31 -0
  138. package/node_modules/@comis/agent/dist/context-engine/token-budget.js +52 -0
  139. package/node_modules/@comis/agent/dist/context-engine/types-compaction.d.ts +109 -0
  140. package/node_modules/@comis/agent/dist/context-engine/types-compaction.js +7 -0
  141. package/node_modules/@comis/agent/dist/context-engine/types-core.d.ts +292 -0
  142. package/node_modules/@comis/agent/dist/context-engine/types-core.js +7 -0
  143. package/node_modules/@comis/agent/dist/context-engine/types-dag.d.ts +239 -0
  144. package/node_modules/@comis/agent/dist/context-engine/types-dag.js +7 -0
  145. package/node_modules/@comis/agent/dist/context-engine/types-eviction.d.ts +17 -0
  146. package/node_modules/@comis/agent/dist/context-engine/types-eviction.js +7 -0
  147. package/node_modules/@comis/agent/dist/context-engine/types-integrity.d.ts +77 -0
  148. package/node_modules/@comis/agent/dist/context-engine/types-integrity.js +7 -0
  149. package/node_modules/@comis/agent/dist/context-engine/types.d.ts +20 -0
  150. package/node_modules/@comis/agent/dist/context-engine/types.js +21 -0
  151. package/node_modules/@comis/agent/dist/envelope/elapsed-time.d.ts +12 -0
  152. package/node_modules/@comis/agent/dist/envelope/elapsed-time.js +30 -0
  153. package/node_modules/@comis/agent/dist/envelope/index.d.ts +2 -0
  154. package/node_modules/@comis/agent/dist/envelope/index.js +4 -0
  155. package/node_modules/@comis/agent/dist/envelope/message-envelope.d.ts +25 -0
  156. package/node_modules/@comis/agent/dist/envelope/message-envelope.js +71 -0
  157. package/node_modules/@comis/agent/dist/executor/active-run-registry.d.ts +47 -0
  158. package/node_modules/@comis/agent/dist/executor/active-run-registry.js +48 -0
  159. package/node_modules/@comis/agent/dist/executor/adaptive-cache-retention.d.ts +72 -0
  160. package/node_modules/@comis/agent/dist/executor/adaptive-cache-retention.js +144 -0
  161. package/node_modules/@comis/agent/dist/executor/block-stability-tracker.d.ts +41 -0
  162. package/node_modules/@comis/agent/dist/executor/block-stability-tracker.js +69 -0
  163. package/node_modules/@comis/agent/dist/executor/cache-break-detection.d.ts +228 -0
  164. package/node_modules/@comis/agent/dist/executor/cache-break-detection.js +656 -0
  165. package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.d.ts +90 -0
  166. package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.js +159 -0
  167. package/node_modules/@comis/agent/dist/executor/cache-usage-helpers.d.ts +26 -0
  168. package/node_modules/@comis/agent/dist/executor/cache-usage-helpers.js +48 -0
  169. package/node_modules/@comis/agent/dist/executor/discovery-tracker.d.ts +74 -0
  170. package/node_modules/@comis/agent/dist/executor/discovery-tracker.js +130 -0
  171. package/node_modules/@comis/agent/dist/executor/error-classifier.d.ts +37 -0
  172. package/node_modules/@comis/agent/dist/executor/error-classifier.js +141 -0
  173. package/node_modules/@comis/agent/dist/executor/executor-command-handlers.d.ts +73 -0
  174. package/node_modules/@comis/agent/dist/executor/executor-command-handlers.js +275 -0
  175. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.d.ts +98 -0
  176. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +259 -0
  177. package/node_modules/@comis/agent/dist/executor/executor-input-guard.d.ts +42 -0
  178. package/node_modules/@comis/agent/dist/executor/executor-input-guard.js +156 -0
  179. package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +154 -0
  180. package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +337 -0
  181. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +133 -0
  182. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +755 -0
  183. package/node_modules/@comis/agent/dist/executor/executor-response-filter.d.ts +91 -0
  184. package/node_modules/@comis/agent/dist/executor/executor-response-filter.js +224 -0
  185. package/node_modules/@comis/agent/dist/executor/executor-session-state.d.ts +142 -0
  186. package/node_modules/@comis/agent/dist/executor/executor-session-state.js +299 -0
  187. package/node_modules/@comis/agent/dist/executor/executor-stream-setup.d.ts +124 -0
  188. package/node_modules/@comis/agent/dist/executor/executor-stream-setup.js +244 -0
  189. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.d.ts +144 -0
  190. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +339 -0
  191. package/node_modules/@comis/agent/dist/executor/executor-tool-pipeline.d.ts +75 -0
  192. package/node_modules/@comis/agent/dist/executor/executor-tool-pipeline.js +192 -0
  193. package/node_modules/@comis/agent/dist/executor/fault-injector.d.ts +51 -0
  194. package/node_modules/@comis/agent/dist/executor/fault-injector.js +93 -0
  195. package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.d.ts +50 -0
  196. package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.js +140 -0
  197. package/node_modules/@comis/agent/dist/executor/gemini-cache-lifecycle.d.ts +30 -0
  198. package/node_modules/@comis/agent/dist/executor/gemini-cache-lifecycle.js +31 -0
  199. package/node_modules/@comis/agent/dist/executor/gemini-cache-manager.d.ts +74 -0
  200. package/node_modules/@comis/agent/dist/executor/gemini-cache-manager.js +323 -0
  201. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.d.ts +56 -0
  202. package/node_modules/@comis/agent/dist/executor/jit-guide-injector.js +127 -0
  203. package/node_modules/@comis/agent/dist/executor/mcp-disconnect-cleanup.d.ts +36 -0
  204. package/node_modules/@comis/agent/dist/executor/mcp-disconnect-cleanup.js +43 -0
  205. package/node_modules/@comis/agent/dist/executor/model-retry.d.ts +85 -0
  206. package/node_modules/@comis/agent/dist/executor/model-retry.js +301 -0
  207. package/node_modules/@comis/agent/dist/executor/overflow-recovery.d.ts +69 -0
  208. package/node_modules/@comis/agent/dist/executor/overflow-recovery.js +182 -0
  209. package/node_modules/@comis/agent/dist/executor/phase-filter.d.ts +21 -0
  210. package/node_modules/@comis/agent/dist/executor/phase-filter.js +63 -0
  211. package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +200 -0
  212. package/node_modules/@comis/agent/dist/executor/pi-executor.js +1028 -0
  213. package/node_modules/@comis/agent/dist/executor/prompt-assembly.d.ts +174 -0
  214. package/node_modules/@comis/agent/dist/executor/prompt-assembly.js +767 -0
  215. package/node_modules/@comis/agent/dist/executor/prompt-timeout.d.ts +57 -0
  216. package/node_modules/@comis/agent/dist/executor/prompt-timeout.js +112 -0
  217. package/node_modules/@comis/agent/dist/executor/schema-stripping.d.ts +19 -0
  218. package/node_modules/@comis/agent/dist/executor/schema-stripping.js +113 -0
  219. package/node_modules/@comis/agent/dist/executor/session-latch.d.ts +63 -0
  220. package/node_modules/@comis/agent/dist/executor/session-latch.js +60 -0
  221. package/node_modules/@comis/agent/dist/executor/session-snapshot-cleanup.d.ts +35 -0
  222. package/node_modules/@comis/agent/dist/executor/session-snapshot-cleanup.js +65 -0
  223. package/node_modules/@comis/agent/dist/executor/step-counter.d.ts +21 -0
  224. package/node_modules/@comis/agent/dist/executor/step-counter.js +29 -0
  225. package/node_modules/@comis/agent/dist/executor/stream-wrappers/__test-helpers.d.ts +9 -0
  226. package/node_modules/@comis/agent/dist/executor/stream-wrappers/__test-helpers.js +43 -0
  227. package/node_modules/@comis/agent/dist/executor/stream-wrappers/api-payload-trace-writer.d.ts +40 -0
  228. package/node_modules/@comis/agent/dist/executor/stream-wrappers/api-payload-trace-writer.js +91 -0
  229. package/node_modules/@comis/agent/dist/executor/stream-wrappers/cache-trace-writer.d.ts +65 -0
  230. package/node_modules/@comis/agent/dist/executor/stream-wrappers/cache-trace-writer.js +145 -0
  231. package/node_modules/@comis/agent/dist/executor/stream-wrappers/compose.d.ts +20 -0
  232. package/node_modules/@comis/agent/dist/executor/stream-wrappers/compose.js +27 -0
  233. package/node_modules/@comis/agent/dist/executor/stream-wrappers/config-resolver.d.ts +55 -0
  234. package/node_modules/@comis/agent/dist/executor/stream-wrappers/config-resolver.js +85 -0
  235. package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.d.ts +26 -0
  236. package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.js +22 -0
  237. package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.d.ts +273 -0
  238. package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +1679 -0
  239. package/node_modules/@comis/agent/dist/executor/stream-wrappers/tool-result-size-bouncer.d.ts +46 -0
  240. package/node_modules/@comis/agent/dist/executor/stream-wrappers/tool-result-size-bouncer.js +92 -0
  241. package/node_modules/@comis/agent/dist/executor/stream-wrappers/tool-schema-cache.d.ts +28 -0
  242. package/node_modules/@comis/agent/dist/executor/stream-wrappers/tool-schema-cache.js +50 -0
  243. package/node_modules/@comis/agent/dist/executor/stream-wrappers/turn-result-budget-wrapper.d.ts +42 -0
  244. package/node_modules/@comis/agent/dist/executor/stream-wrappers/turn-result-budget-wrapper.js +68 -0
  245. package/node_modules/@comis/agent/dist/executor/stream-wrappers/types.d.ts +12 -0
  246. package/node_modules/@comis/agent/dist/executor/stream-wrappers/types.js +7 -0
  247. package/node_modules/@comis/agent/dist/executor/stream-wrappers/validation-error-formatter.d.ts +27 -0
  248. package/node_modules/@comis/agent/dist/executor/stream-wrappers/validation-error-formatter.js +51 -0
  249. package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +159 -0
  250. package/node_modules/@comis/agent/dist/executor/tool-deferral.js +617 -0
  251. package/node_modules/@comis/agent/dist/executor/tool-lifecycle.d.ts +112 -0
  252. package/node_modules/@comis/agent/dist/executor/tool-lifecycle.js +164 -0
  253. package/node_modules/@comis/agent/dist/executor/tool-parallelism.d.ts +59 -0
  254. package/node_modules/@comis/agent/dist/executor/tool-parallelism.js +158 -0
  255. package/node_modules/@comis/agent/dist/executor/ttl-guard.d.ts +55 -0
  256. package/node_modules/@comis/agent/dist/executor/ttl-guard.js +103 -0
  257. package/node_modules/@comis/agent/dist/executor/types.d.ts +112 -0
  258. package/node_modules/@comis/agent/dist/executor/types.js +7 -0
  259. package/node_modules/@comis/agent/dist/file-state/session-tracker-registry.d.ts +59 -0
  260. package/node_modules/@comis/agent/dist/file-state/session-tracker-registry.js +57 -0
  261. package/node_modules/@comis/agent/dist/greeting/session-greeting.d.ts +40 -0
  262. package/node_modules/@comis/agent/dist/greeting/session-greeting.js +94 -0
  263. package/node_modules/@comis/agent/dist/identity/identity-link-resolver.d.ts +47 -0
  264. package/node_modules/@comis/agent/dist/identity/identity-link-resolver.js +54 -0
  265. package/node_modules/@comis/agent/dist/identity/identity-loader.d.ts +38 -0
  266. package/node_modules/@comis/agent/dist/identity/identity-loader.js +91 -0
  267. package/node_modules/@comis/agent/dist/identity/identity-updater.d.ts +37 -0
  268. package/node_modules/@comis/agent/dist/identity/identity-updater.js +104 -0
  269. package/node_modules/@comis/agent/dist/index.d.ts +188 -0
  270. package/node_modules/@comis/agent/dist/index.js +192 -0
  271. package/node_modules/@comis/agent/dist/memory/memory-review-job.d.ts +72 -0
  272. package/node_modules/@comis/agent/dist/memory/memory-review-job.js +341 -0
  273. package/node_modules/@comis/agent/dist/model/auth-profile.d.ts +61 -0
  274. package/node_modules/@comis/agent/dist/model/auth-profile.js +154 -0
  275. package/node_modules/@comis/agent/dist/model/auth-provider.d.ts +70 -0
  276. package/node_modules/@comis/agent/dist/model/auth-provider.js +83 -0
  277. package/node_modules/@comis/agent/dist/model/auth-rotation-adapter.d.ts +53 -0
  278. package/node_modules/@comis/agent/dist/model/auth-rotation-adapter.js +78 -0
  279. package/node_modules/@comis/agent/dist/model/auth-storage-adapter.d.ts +27 -0
  280. package/node_modules/@comis/agent/dist/model/auth-storage-adapter.js +37 -0
  281. package/node_modules/@comis/agent/dist/model/auth-usage-tracker.d.ts +60 -0
  282. package/node_modules/@comis/agent/dist/model/auth-usage-tracker.js +90 -0
  283. package/node_modules/@comis/agent/dist/model/context-window-resolver.d.ts +48 -0
  284. package/node_modules/@comis/agent/dist/model/context-window-resolver.js +55 -0
  285. package/node_modules/@comis/agent/dist/model/image-router.d.ts +109 -0
  286. package/node_modules/@comis/agent/dist/model/image-router.js +128 -0
  287. package/node_modules/@comis/agent/dist/model/model-alias-resolver.d.ts +57 -0
  288. package/node_modules/@comis/agent/dist/model/model-alias-resolver.js +72 -0
  289. package/node_modules/@comis/agent/dist/model/model-allowlist.d.ts +52 -0
  290. package/node_modules/@comis/agent/dist/model/model-allowlist.js +61 -0
  291. package/node_modules/@comis/agent/dist/model/model-catalog.d.ts +93 -0
  292. package/node_modules/@comis/agent/dist/model/model-catalog.js +152 -0
  293. package/node_modules/@comis/agent/dist/model/model-registry-adapter.d.ts +47 -0
  294. package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +74 -0
  295. package/node_modules/@comis/agent/dist/model/model-scanner.d.ts +59 -0
  296. package/node_modules/@comis/agent/dist/model/model-scanner.js +199 -0
  297. package/node_modules/@comis/agent/dist/model/oauth-token-manager.d.ts +60 -0
  298. package/node_modules/@comis/agent/dist/model/oauth-token-manager.js +138 -0
  299. package/node_modules/@comis/agent/dist/model/operation-model-defaults.d.ts +48 -0
  300. package/node_modules/@comis/agent/dist/model/operation-model-defaults.js +78 -0
  301. package/node_modules/@comis/agent/dist/model/operation-model-resolver.d.ts +65 -0
  302. package/node_modules/@comis/agent/dist/model/operation-model-resolver.js +135 -0
  303. package/node_modules/@comis/agent/dist/planner/checklist-formatter.d.ts +21 -0
  304. package/node_modules/@comis/agent/dist/planner/checklist-formatter.js +53 -0
  305. package/node_modules/@comis/agent/dist/planner/plan-extractor.d.ts +24 -0
  306. package/node_modules/@comis/agent/dist/planner/plan-extractor.js +66 -0
  307. package/node_modules/@comis/agent/dist/planner/types.d.ts +38 -0
  308. package/node_modules/@comis/agent/dist/planner/types.js +12 -0
  309. package/node_modules/@comis/agent/dist/provider/capabilities.d.ts +72 -0
  310. package/node_modules/@comis/agent/dist/provider/capabilities.js +163 -0
  311. package/node_modules/@comis/agent/dist/provider/model-compat.d.ts +35 -0
  312. package/node_modules/@comis/agent/dist/provider/model-compat.js +40 -0
  313. package/node_modules/@comis/agent/dist/provider/model-id-normalize.d.ts +33 -0
  314. package/node_modules/@comis/agent/dist/provider/model-id-normalize.js +87 -0
  315. package/node_modules/@comis/agent/dist/provider/response/sanitize-pipeline.d.ts +50 -0
  316. package/node_modules/@comis/agent/dist/provider/response/sanitize-pipeline.js +173 -0
  317. package/node_modules/@comis/agent/dist/provider/response/strip-minimax-xml.d.ts +9 -0
  318. package/node_modules/@comis/agent/dist/provider/response/strip-minimax-xml.js +17 -0
  319. package/node_modules/@comis/agent/dist/provider/response/strip-model-tokens.d.ts +13 -0
  320. package/node_modules/@comis/agent/dist/provider/response/strip-model-tokens.js +19 -0
  321. package/node_modules/@comis/agent/dist/provider/response/strip-tool-text.d.ts +11 -0
  322. package/node_modules/@comis/agent/dist/provider/response/strip-tool-text.js +32 -0
  323. package/node_modules/@comis/agent/dist/provider/tool-schema/clean-for-gemini.d.ts +20 -0
  324. package/node_modules/@comis/agent/dist/provider/tool-schema/clean-for-gemini.js +83 -0
  325. package/node_modules/@comis/agent/dist/provider/tool-schema/clean-for-xai.d.ts +20 -0
  326. package/node_modules/@comis/agent/dist/provider/tool-schema/clean-for-xai.js +82 -0
  327. package/node_modules/@comis/agent/dist/provider/tool-schema/normalize-enums.d.ts +33 -0
  328. package/node_modules/@comis/agent/dist/provider/tool-schema/normalize-enums.js +117 -0
  329. package/node_modules/@comis/agent/dist/provider/tool-schema/normalize.d.ts +43 -0
  330. package/node_modules/@comis/agent/dist/provider/tool-schema/normalize.js +133 -0
  331. package/node_modules/@comis/agent/dist/queue/coalescer.d.ts +25 -0
  332. package/node_modules/@comis/agent/dist/queue/coalescer.js +58 -0
  333. package/node_modules/@comis/agent/dist/queue/command-queue.d.ts +88 -0
  334. package/node_modules/@comis/agent/dist/queue/command-queue.js +351 -0
  335. package/node_modules/@comis/agent/dist/queue/debounce-buffer.d.ts +48 -0
  336. package/node_modules/@comis/agent/dist/queue/debounce-buffer.js +132 -0
  337. package/node_modules/@comis/agent/dist/queue/followup-trigger.d.ts +34 -0
  338. package/node_modules/@comis/agent/dist/queue/followup-trigger.js +62 -0
  339. package/node_modules/@comis/agent/dist/queue/index.d.ts +12 -0
  340. package/node_modules/@comis/agent/dist/queue/index.js +8 -0
  341. package/node_modules/@comis/agent/dist/queue/lane.d.ts +22 -0
  342. package/node_modules/@comis/agent/dist/queue/lane.js +10 -0
  343. package/node_modules/@comis/agent/dist/queue/overflow.d.ts +34 -0
  344. package/node_modules/@comis/agent/dist/queue/overflow.js +97 -0
  345. package/node_modules/@comis/agent/dist/queue/priority-scheduler.d.ts +59 -0
  346. package/node_modules/@comis/agent/dist/queue/priority-scheduler.js +198 -0
  347. package/node_modules/@comis/agent/dist/rag/hybrid-memory-injector.d.ts +41 -0
  348. package/node_modules/@comis/agent/dist/rag/hybrid-memory-injector.js +57 -0
  349. package/node_modules/@comis/agent/dist/rag/rag-retriever.d.ts +58 -0
  350. package/node_modules/@comis/agent/dist/rag/rag-retriever.js +147 -0
  351. package/node_modules/@comis/agent/dist/response-filter/code-regions.d.ts +27 -0
  352. package/node_modules/@comis/agent/dist/response-filter/code-regions.js +46 -0
  353. package/node_modules/@comis/agent/dist/response-filter/reasoning-tags.d.ts +27 -0
  354. package/node_modules/@comis/agent/dist/response-filter/reasoning-tags.js +85 -0
  355. package/node_modules/@comis/agent/dist/response-filter/thinking-tag-filter.d.ts +43 -0
  356. package/node_modules/@comis/agent/dist/response-filter/thinking-tag-filter.js +384 -0
  357. package/node_modules/@comis/agent/dist/routing/message-router.d.ts +49 -0
  358. package/node_modules/@comis/agent/dist/routing/message-router.js +121 -0
  359. package/node_modules/@comis/agent/dist/safety/circuit-breaker.d.ts +29 -0
  360. package/node_modules/@comis/agent/dist/safety/circuit-breaker.js +59 -0
  361. package/node_modules/@comis/agent/dist/safety/context-truncation-recovery.d.ts +40 -0
  362. package/node_modules/@comis/agent/dist/safety/context-truncation-recovery.js +115 -0
  363. package/node_modules/@comis/agent/dist/safety/context-window-guard.d.ts +59 -0
  364. package/node_modules/@comis/agent/dist/safety/context-window-guard.js +54 -0
  365. package/node_modules/@comis/agent/dist/safety/follow-through-detector.d.ts +46 -0
  366. package/node_modules/@comis/agent/dist/safety/follow-through-detector.js +76 -0
  367. package/node_modules/@comis/agent/dist/safety/message-send-limiter.d.ts +44 -0
  368. package/node_modules/@comis/agent/dist/safety/message-send-limiter.js +71 -0
  369. package/node_modules/@comis/agent/dist/safety/post-compaction-safety.d.ts +30 -0
  370. package/node_modules/@comis/agent/dist/safety/post-compaction-safety.js +51 -0
  371. package/node_modules/@comis/agent/dist/safety/provider-health-monitor.d.ts +56 -0
  372. package/node_modules/@comis/agent/dist/safety/provider-health-monitor.js +158 -0
  373. package/node_modules/@comis/agent/dist/safety/response-safety-checks.d.ts +65 -0
  374. package/node_modules/@comis/agent/dist/safety/response-safety-checks.js +118 -0
  375. package/node_modules/@comis/agent/dist/safety/schema-normalizer.d.ts +37 -0
  376. package/node_modules/@comis/agent/dist/safety/schema-normalizer.js +137 -0
  377. package/node_modules/@comis/agent/dist/safety/schema-pruning.d.ts +50 -0
  378. package/node_modules/@comis/agent/dist/safety/schema-pruning.js +112 -0
  379. package/node_modules/@comis/agent/dist/safety/token-estimator.d.ts +95 -0
  380. package/node_modules/@comis/agent/dist/safety/token-estimator.js +236 -0
  381. package/node_modules/@comis/agent/dist/safety/tool-display-names.d.ts +26 -0
  382. package/node_modules/@comis/agent/dist/safety/tool-display-names.js +66 -0
  383. package/node_modules/@comis/agent/dist/safety/tool-image-sanitizer.d.ts +43 -0
  384. package/node_modules/@comis/agent/dist/safety/tool-image-sanitizer.js +96 -0
  385. package/node_modules/@comis/agent/dist/safety/tool-output-safety.d.ts +79 -0
  386. package/node_modules/@comis/agent/dist/safety/tool-output-safety.js +184 -0
  387. package/node_modules/@comis/agent/dist/safety/tool-result-size-guard.d.ts +76 -0
  388. package/node_modules/@comis/agent/dist/safety/tool-result-size-guard.js +220 -0
  389. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.d.ts +80 -0
  390. package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.js +365 -0
  391. package/node_modules/@comis/agent/dist/safety/tool-sanitizer.d.ts +44 -0
  392. package/node_modules/@comis/agent/dist/safety/tool-sanitizer.js +94 -0
  393. package/node_modules/@comis/agent/dist/safety/tool-schema-safety.d.ts +89 -0
  394. package/node_modules/@comis/agent/dist/safety/tool-schema-safety.js +253 -0
  395. package/node_modules/@comis/agent/dist/safety/turn-result-budget.d.ts +48 -0
  396. package/node_modules/@comis/agent/dist/safety/turn-result-budget.js +173 -0
  397. package/node_modules/@comis/agent/dist/safety/validation-error-formatter.d.ts +22 -0
  398. package/node_modules/@comis/agent/dist/safety/validation-error-formatter.js +131 -0
  399. package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +114 -0
  400. package/node_modules/@comis/agent/dist/session/comis-session-manager.js +169 -0
  401. package/node_modules/@comis/agent/dist/session/orphaned-message-repair.d.ts +84 -0
  402. package/node_modules/@comis/agent/dist/session/orphaned-message-repair.js +337 -0
  403. package/node_modules/@comis/agent/dist/session/sanitize-session-secrets.d.ts +34 -0
  404. package/node_modules/@comis/agent/dist/session/sanitize-session-secrets.js +232 -0
  405. package/node_modules/@comis/agent/dist/session/scrub-redacted-tool-calls.d.ts +47 -0
  406. package/node_modules/@comis/agent/dist/session/scrub-redacted-tool-calls.js +183 -0
  407. package/node_modules/@comis/agent/dist/session/session-key-builder.d.ts +46 -0
  408. package/node_modules/@comis/agent/dist/session/session-key-builder.js +100 -0
  409. package/node_modules/@comis/agent/dist/session/session-key-mapper.d.ts +33 -0
  410. package/node_modules/@comis/agent/dist/session/session-key-mapper.js +183 -0
  411. package/node_modules/@comis/agent/dist/session/session-label-store.d.ts +34 -0
  412. package/node_modules/@comis/agent/dist/session/session-label-store.js +54 -0
  413. package/node_modules/@comis/agent/dist/session/session-lifecycle.d.ts +55 -0
  414. package/node_modules/@comis/agent/dist/session/session-lifecycle.js +82 -0
  415. package/node_modules/@comis/agent/dist/session/session-reset-policy.d.ts +113 -0
  416. package/node_modules/@comis/agent/dist/session/session-reset-policy.js +192 -0
  417. package/node_modules/@comis/agent/dist/session/session-write-lock.d.ts +48 -0
  418. package/node_modules/@comis/agent/dist/session/session-write-lock.js +151 -0
  419. package/node_modules/@comis/agent/dist/spawn/generate-parent-summary.d.ts +34 -0
  420. package/node_modules/@comis/agent/dist/spawn/generate-parent-summary.js +29 -0
  421. package/node_modules/@comis/agent/dist/spawn/index.d.ts +17 -0
  422. package/node_modules/@comis/agent/dist/spawn/index.js +13 -0
  423. package/node_modules/@comis/agent/dist/spawn/lifecycle-hooks.d.ts +86 -0
  424. package/node_modules/@comis/agent/dist/spawn/lifecycle-hooks.js +114 -0
  425. package/node_modules/@comis/agent/dist/spawn/narrative-caster.d.ts +46 -0
  426. package/node_modules/@comis/agent/dist/spawn/narrative-caster.js +159 -0
  427. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.d.ts +29 -0
  428. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +54 -0
  429. package/node_modules/@comis/agent/dist/spawn/result-condenser.d.ts +98 -0
  430. package/node_modules/@comis/agent/dist/spawn/result-condenser.js +343 -0
  431. package/node_modules/@comis/agent/dist/spawn/spawn-packet-builder.d.ts +41 -0
  432. package/node_modules/@comis/agent/dist/spawn/spawn-packet-builder.js +39 -0
  433. package/node_modules/@comis/agent/dist/workspace/boot-file.d.ts +23 -0
  434. package/node_modules/@comis/agent/dist/workspace/boot-file.js +38 -0
  435. package/node_modules/@comis/agent/dist/workspace/heartbeat-file.d.ts +24 -0
  436. package/node_modules/@comis/agent/dist/workspace/heartbeat-file.js +37 -0
  437. package/node_modules/@comis/agent/dist/workspace/index.d.ts +10 -0
  438. package/node_modules/@comis/agent/dist/workspace/index.js +8 -0
  439. package/node_modules/@comis/agent/dist/workspace/onboarding-detector.d.ts +12 -0
  440. package/node_modules/@comis/agent/dist/workspace/onboarding-detector.js +42 -0
  441. package/node_modules/@comis/agent/dist/workspace/templates.d.ts +11 -0
  442. package/node_modules/@comis/agent/dist/workspace/templates.js +499 -0
  443. package/node_modules/@comis/agent/dist/workspace/workspace-manager.d.ts +127 -0
  444. package/node_modules/@comis/agent/dist/workspace/workspace-manager.js +242 -0
  445. package/node_modules/@comis/agent/dist/workspace/workspace-resolver.d.ts +13 -0
  446. package/node_modules/@comis/agent/dist/workspace/workspace-resolver.js +27 -0
  447. package/node_modules/@comis/agent/dist/workspace/workspace-state.d.ts +39 -0
  448. package/node_modules/@comis/agent/dist/workspace/workspace-state.js +120 -0
  449. package/node_modules/@comis/agent/package.json +44 -0
  450. package/node_modules/@comis/channels/dist/discord/credential-validator.d.ts +23 -0
  451. package/node_modules/@comis/channels/dist/discord/credential-validator.js +33 -0
  452. package/node_modules/@comis/channels/dist/discord/discord-actions.d.ts +17 -0
  453. package/node_modules/@comis/channels/dist/discord/discord-actions.js +340 -0
  454. package/node_modules/@comis/channels/dist/discord/discord-adapter.d.ts +28 -0
  455. package/node_modules/@comis/channels/dist/discord/discord-adapter.js +451 -0
  456. package/node_modules/@comis/channels/dist/discord/discord-plugin.d.ts +17 -0
  457. package/node_modules/@comis/channels/dist/discord/discord-plugin.js +70 -0
  458. package/node_modules/@comis/channels/dist/discord/discord-resolver.d.ts +43 -0
  459. package/node_modules/@comis/channels/dist/discord/discord-resolver.js +50 -0
  460. package/node_modules/@comis/channels/dist/discord/format-discord.d.ts +31 -0
  461. package/node_modules/@comis/channels/dist/discord/format-discord.js +217 -0
  462. package/node_modules/@comis/channels/dist/discord/media-handler.d.ts +18 -0
  463. package/node_modules/@comis/channels/dist/discord/media-handler.js +43 -0
  464. package/node_modules/@comis/channels/dist/discord/message-mapper.d.ts +21 -0
  465. package/node_modules/@comis/channels/dist/discord/message-mapper.js +54 -0
  466. package/node_modules/@comis/channels/dist/discord/rich-renderer.d.ts +32 -0
  467. package/node_modules/@comis/channels/dist/discord/rich-renderer.js +97 -0
  468. package/node_modules/@comis/channels/dist/discord/voice-sender.d.ts +46 -0
  469. package/node_modules/@comis/channels/dist/discord/voice-sender.js +171 -0
  470. package/node_modules/@comis/channels/dist/echo/echo-adapter.d.ts +82 -0
  471. package/node_modules/@comis/channels/dist/echo/echo-adapter.js +170 -0
  472. package/node_modules/@comis/channels/dist/echo/echo-plugin.d.ts +19 -0
  473. package/node_modules/@comis/channels/dist/echo/echo-plugin.js +68 -0
  474. package/node_modules/@comis/channels/dist/email/credential-validator.d.ts +33 -0
  475. package/node_modules/@comis/channels/dist/email/credential-validator.js +45 -0
  476. package/node_modules/@comis/channels/dist/email/email-adapter.d.ts +46 -0
  477. package/node_modules/@comis/channels/dist/email/email-adapter.js +271 -0
  478. package/node_modules/@comis/channels/dist/email/email-plugin.d.ts +20 -0
  479. package/node_modules/@comis/channels/dist/email/email-plugin.js +76 -0
  480. package/node_modules/@comis/channels/dist/email/imap-lifecycle.d.ts +37 -0
  481. package/node_modules/@comis/channels/dist/email/imap-lifecycle.js +191 -0
  482. package/node_modules/@comis/channels/dist/email/message-mapper.d.ts +53 -0
  483. package/node_modules/@comis/channels/dist/email/message-mapper.js +107 -0
  484. package/node_modules/@comis/channels/dist/email/sender-filter.d.ts +31 -0
  485. package/node_modules/@comis/channels/dist/email/sender-filter.js +82 -0
  486. package/node_modules/@comis/channels/dist/email/threading.d.ts +38 -0
  487. package/node_modules/@comis/channels/dist/email/threading.js +44 -0
  488. package/node_modules/@comis/channels/dist/imessage/credential-validator.d.ts +36 -0
  489. package/node_modules/@comis/channels/dist/imessage/credential-validator.js +102 -0
  490. package/node_modules/@comis/channels/dist/imessage/imessage-adapter.d.ts +31 -0
  491. package/node_modules/@comis/channels/dist/imessage/imessage-adapter.js +290 -0
  492. package/node_modules/@comis/channels/dist/imessage/imessage-client.d.ts +52 -0
  493. package/node_modules/@comis/channels/dist/imessage/imessage-client.js +209 -0
  494. package/node_modules/@comis/channels/dist/imessage/imessage-plugin.d.ts +20 -0
  495. package/node_modules/@comis/channels/dist/imessage/imessage-plugin.js +71 -0
  496. package/node_modules/@comis/channels/dist/imessage/imessage-resolver.d.ts +33 -0
  497. package/node_modules/@comis/channels/dist/imessage/imessage-resolver.js +73 -0
  498. package/node_modules/@comis/channels/dist/imessage/media-handler.d.ts +31 -0
  499. package/node_modules/@comis/channels/dist/imessage/media-handler.js +34 -0
  500. package/node_modules/@comis/channels/dist/imessage/message-mapper.d.ts +56 -0
  501. package/node_modules/@comis/channels/dist/imessage/message-mapper.js +67 -0
  502. package/node_modules/@comis/channels/dist/index.d.ts +138 -0
  503. package/node_modules/@comis/channels/dist/index.js +127 -0
  504. package/node_modules/@comis/channels/dist/irc/credential-validator.d.ts +34 -0
  505. package/node_modules/@comis/channels/dist/irc/credential-validator.js +78 -0
  506. package/node_modules/@comis/channels/dist/irc/irc-adapter.d.ts +39 -0
  507. package/node_modules/@comis/channels/dist/irc/irc-adapter.js +302 -0
  508. package/node_modules/@comis/channels/dist/irc/irc-plugin.d.ts +21 -0
  509. package/node_modules/@comis/channels/dist/irc/irc-plugin.js +71 -0
  510. package/node_modules/@comis/channels/dist/irc/message-mapper.d.ts +34 -0
  511. package/node_modules/@comis/channels/dist/irc/message-mapper.js +41 -0
  512. package/node_modules/@comis/channels/dist/line/credential-validator.d.ts +37 -0
  513. package/node_modules/@comis/channels/dist/line/credential-validator.js +50 -0
  514. package/node_modules/@comis/channels/dist/line/flex-builder.d.ts +52 -0
  515. package/node_modules/@comis/channels/dist/line/flex-builder.js +136 -0
  516. package/node_modules/@comis/channels/dist/line/line-adapter.d.ts +40 -0
  517. package/node_modules/@comis/channels/dist/line/line-adapter.js +324 -0
  518. package/node_modules/@comis/channels/dist/line/line-plugin.d.ts +36 -0
  519. package/node_modules/@comis/channels/dist/line/line-plugin.js +83 -0
  520. package/node_modules/@comis/channels/dist/line/line-resolver.d.ts +31 -0
  521. package/node_modules/@comis/channels/dist/line/line-resolver.js +69 -0
  522. package/node_modules/@comis/channels/dist/line/media-handler.d.ts +24 -0
  523. package/node_modules/@comis/channels/dist/line/media-handler.js +72 -0
  524. package/node_modules/@comis/channels/dist/line/message-mapper.d.ts +29 -0
  525. package/node_modules/@comis/channels/dist/line/message-mapper.js +127 -0
  526. package/node_modules/@comis/channels/dist/line/rich-menu-manager.d.ts +79 -0
  527. package/node_modules/@comis/channels/dist/line/rich-menu-manager.js +90 -0
  528. package/node_modules/@comis/channels/dist/shared/abort-summary.d.ts +26 -0
  529. package/node_modules/@comis/channels/dist/shared/abort-summary.js +47 -0
  530. package/node_modules/@comis/channels/dist/shared/approval-notifier.d.ts +31 -0
  531. package/node_modules/@comis/channels/dist/shared/approval-notifier.js +82 -0
  532. package/node_modules/@comis/channels/dist/shared/audio-preflight.d.ts +49 -0
  533. package/node_modules/@comis/channels/dist/shared/audio-preflight.js +78 -0
  534. package/node_modules/@comis/channels/dist/shared/auto-reply-engine.d.ts +68 -0
  535. package/node_modules/@comis/channels/dist/shared/auto-reply-engine.js +132 -0
  536. package/node_modules/@comis/channels/dist/shared/block-chunker.d.ts +30 -0
  537. package/node_modules/@comis/channels/dist/shared/block-chunker.js +201 -0
  538. package/node_modules/@comis/channels/dist/shared/block-coalescer.d.ts +59 -0
  539. package/node_modules/@comis/channels/dist/shared/block-coalescer.js +154 -0
  540. package/node_modules/@comis/channels/dist/shared/block-pacer.d.ts +42 -0
  541. package/node_modules/@comis/channels/dist/shared/block-pacer.js +130 -0
  542. package/node_modules/@comis/channels/dist/shared/channel-health-monitor.d.ts +90 -0
  543. package/node_modules/@comis/channels/dist/shared/channel-health-monitor.js +317 -0
  544. package/node_modules/@comis/channels/dist/shared/channel-manager.d.ts +169 -0
  545. package/node_modules/@comis/channels/dist/shared/channel-manager.js +174 -0
  546. package/node_modules/@comis/channels/dist/shared/channel-registry.d.ts +46 -0
  547. package/node_modules/@comis/channels/dist/shared/channel-registry.js +81 -0
  548. package/node_modules/@comis/channels/dist/shared/chunk-for-delivery.d.ts +40 -0
  549. package/node_modules/@comis/channels/dist/shared/chunk-for-delivery.js +77 -0
  550. package/node_modules/@comis/channels/dist/shared/credential-validator-factory.d.ts +20 -0
  551. package/node_modules/@comis/channels/dist/shared/credential-validator-factory.js +24 -0
  552. package/node_modules/@comis/channels/dist/shared/deliver-to-channel.d.ts +156 -0
  553. package/node_modules/@comis/channels/dist/shared/deliver-to-channel.js +516 -0
  554. package/node_modules/@comis/channels/dist/shared/delivery-timing.d.ts +31 -0
  555. package/node_modules/@comis/channels/dist/shared/delivery-timing.js +87 -0
  556. package/node_modules/@comis/channels/dist/shared/emoji-tier-map.d.ts +46 -0
  557. package/node_modules/@comis/channels/dist/shared/emoji-tier-map.js +87 -0
  558. package/node_modules/@comis/channels/dist/shared/execution-deliver.d.ts +21 -0
  559. package/node_modules/@comis/channels/dist/shared/execution-deliver.js +174 -0
  560. package/node_modules/@comis/channels/dist/shared/execution-execute.d.ts +45 -0
  561. package/node_modules/@comis/channels/dist/shared/execution-execute.js +175 -0
  562. package/node_modules/@comis/channels/dist/shared/execution-filter.d.ts +30 -0
  563. package/node_modules/@comis/channels/dist/shared/execution-filter.js +186 -0
  564. package/node_modules/@comis/channels/dist/shared/execution-pipeline.d.ts +95 -0
  565. package/node_modules/@comis/channels/dist/shared/execution-pipeline.js +294 -0
  566. package/node_modules/@comis/channels/dist/shared/execution-policy.d.ts +34 -0
  567. package/node_modules/@comis/channels/dist/shared/execution-policy.js +128 -0
  568. package/node_modules/@comis/channels/dist/shared/format-for-channel.d.ts +27 -0
  569. package/node_modules/@comis/channels/dist/shared/format-for-channel.js +62 -0
  570. package/node_modules/@comis/channels/dist/shared/group-history-buffer.d.ts +33 -0
  571. package/node_modules/@comis/channels/dist/shared/group-history-buffer.js +58 -0
  572. package/node_modules/@comis/channels/dist/shared/inbound-gate.d.ts +35 -0
  573. package/node_modules/@comis/channels/dist/shared/inbound-gate.js +353 -0
  574. package/node_modules/@comis/channels/dist/shared/inbound-pipeline.d.ts +144 -0
  575. package/node_modules/@comis/channels/dist/shared/inbound-pipeline.js +89 -0
  576. package/node_modules/@comis/channels/dist/shared/inbound-preprocess.d.ts +19 -0
  577. package/node_modules/@comis/channels/dist/shared/inbound-preprocess.js +83 -0
  578. package/node_modules/@comis/channels/dist/shared/inbound-resolve.d.ts +28 -0
  579. package/node_modules/@comis/channels/dist/shared/inbound-resolve.js +55 -0
  580. package/node_modules/@comis/channels/dist/shared/inbound-route.d.ts +26 -0
  581. package/node_modules/@comis/channels/dist/shared/inbound-route.js +235 -0
  582. package/node_modules/@comis/channels/dist/shared/inbound-setup.d.ts +32 -0
  583. package/node_modules/@comis/channels/dist/shared/inbound-setup.js +148 -0
  584. package/node_modules/@comis/channels/dist/shared/ir-chunker.d.ts +42 -0
  585. package/node_modules/@comis/channels/dist/shared/ir-chunker.js +234 -0
  586. package/node_modules/@comis/channels/dist/shared/ir-renderer.d.ts +26 -0
  587. package/node_modules/@comis/channels/dist/shared/ir-renderer.js +565 -0
  588. package/node_modules/@comis/channels/dist/shared/lifecycle-reactor.d.ts +44 -0
  589. package/node_modules/@comis/channels/dist/shared/lifecycle-reactor.js +420 -0
  590. package/node_modules/@comis/channels/dist/shared/lifecycle-state-machine.d.ts +56 -0
  591. package/node_modules/@comis/channels/dist/shared/lifecycle-state-machine.js +85 -0
  592. package/node_modules/@comis/channels/dist/shared/location-normalizer.d.ts +45 -0
  593. package/node_modules/@comis/channels/dist/shared/location-normalizer.js +37 -0
  594. package/node_modules/@comis/channels/dist/shared/markdown-ir.d.ts +49 -0
  595. package/node_modules/@comis/channels/dist/shared/markdown-ir.js +479 -0
  596. package/node_modules/@comis/channels/dist/shared/markdown-tables.d.ts +18 -0
  597. package/node_modules/@comis/channels/dist/shared/markdown-tables.js +142 -0
  598. package/node_modules/@comis/channels/dist/shared/media-compressor.d.ts +31 -0
  599. package/node_modules/@comis/channels/dist/shared/media-compressor.js +114 -0
  600. package/node_modules/@comis/channels/dist/shared/media-utils.d.ts +10 -0
  601. package/node_modules/@comis/channels/dist/shared/media-utils.js +19 -0
  602. package/node_modules/@comis/channels/dist/shared/outbound-media-handler.d.ts +56 -0
  603. package/node_modules/@comis/channels/dist/shared/outbound-media-handler.js +151 -0
  604. package/node_modules/@comis/channels/dist/shared/permanent-errors.d.ts +30 -0
  605. package/node_modules/@comis/channels/dist/shared/permanent-errors.js +41 -0
  606. package/node_modules/@comis/channels/dist/shared/poll-normalizer.d.ts +59 -0
  607. package/node_modules/@comis/channels/dist/shared/poll-normalizer.js +80 -0
  608. package/node_modules/@comis/channels/dist/shared/prefix-template.d.ts +53 -0
  609. package/node_modules/@comis/channels/dist/shared/prefix-template.js +158 -0
  610. package/node_modules/@comis/channels/dist/shared/regex-guard.d.ts +33 -0
  611. package/node_modules/@comis/channels/dist/shared/regex-guard.js +48 -0
  612. package/node_modules/@comis/channels/dist/shared/response-filter.d.ts +41 -0
  613. package/node_modules/@comis/channels/dist/shared/response-filter.js +75 -0
  614. package/node_modules/@comis/channels/dist/shared/retry-engine.d.ts +88 -0
  615. package/node_modules/@comis/channels/dist/shared/retry-engine.js +258 -0
  616. package/node_modules/@comis/channels/dist/shared/sanitize-for-plain-text.d.ts +32 -0
  617. package/node_modules/@comis/channels/dist/shared/sanitize-for-plain-text.js +80 -0
  618. package/node_modules/@comis/channels/dist/shared/send-policy.d.ts +53 -0
  619. package/node_modules/@comis/channels/dist/shared/send-policy.js +88 -0
  620. package/node_modules/@comis/channels/dist/shared/slack-emoji-map.d.ts +22 -0
  621. package/node_modules/@comis/channels/dist/shared/slack-emoji-map.js +44 -0
  622. package/node_modules/@comis/channels/dist/shared/stall-detector.d.ts +54 -0
  623. package/node_modules/@comis/channels/dist/shared/stall-detector.js +61 -0
  624. package/node_modules/@comis/channels/dist/shared/table-converter.d.ts +24 -0
  625. package/node_modules/@comis/channels/dist/shared/table-converter.js +139 -0
  626. package/node_modules/@comis/channels/dist/shared/telegram-file-ref-guard.d.ts +59 -0
  627. package/node_modules/@comis/channels/dist/shared/telegram-file-ref-guard.js +172 -0
  628. package/node_modules/@comis/channels/dist/shared/thinking-tag-filter.d.ts +28 -0
  629. package/node_modules/@comis/channels/dist/shared/thinking-tag-filter.js +206 -0
  630. package/node_modules/@comis/channels/dist/shared/typing-controller.d.ts +107 -0
  631. package/node_modules/@comis/channels/dist/shared/typing-controller.js +156 -0
  632. package/node_modules/@comis/channels/dist/shared/typing-lifecycle-controller.d.ts +55 -0
  633. package/node_modules/@comis/channels/dist/shared/typing-lifecycle-controller.js +86 -0
  634. package/node_modules/@comis/channels/dist/shared/voice-response-pipeline.d.ts +149 -0
  635. package/node_modules/@comis/channels/dist/shared/voice-response-pipeline.js +157 -0
  636. package/node_modules/@comis/channels/dist/shared/voice-sender.d.ts +64 -0
  637. package/node_modules/@comis/channels/dist/shared/voice-sender.js +77 -0
  638. package/node_modules/@comis/channels/dist/signal/credential-validator.d.ts +30 -0
  639. package/node_modules/@comis/channels/dist/signal/credential-validator.js +75 -0
  640. package/node_modules/@comis/channels/dist/signal/media-handler.d.ts +18 -0
  641. package/node_modules/@comis/channels/dist/signal/media-handler.js +40 -0
  642. package/node_modules/@comis/channels/dist/signal/message-mapper.d.ts +18 -0
  643. package/node_modules/@comis/channels/dist/signal/message-mapper.js +79 -0
  644. package/node_modules/@comis/channels/dist/signal/signal-adapter.d.ts +28 -0
  645. package/node_modules/@comis/channels/dist/signal/signal-adapter.js +339 -0
  646. package/node_modules/@comis/channels/dist/signal/signal-client.d.ts +98 -0
  647. package/node_modules/@comis/channels/dist/signal/signal-client.js +244 -0
  648. package/node_modules/@comis/channels/dist/signal/signal-format.d.ts +40 -0
  649. package/node_modules/@comis/channels/dist/signal/signal-format.js +169 -0
  650. package/node_modules/@comis/channels/dist/signal/signal-plugin.d.ts +17 -0
  651. package/node_modules/@comis/channels/dist/signal/signal-plugin.js +68 -0
  652. package/node_modules/@comis/channels/dist/signal/signal-resolver.d.ts +43 -0
  653. package/node_modules/@comis/channels/dist/signal/signal-resolver.js +50 -0
  654. package/node_modules/@comis/channels/dist/slack/credential-validator.d.ts +43 -0
  655. package/node_modules/@comis/channels/dist/slack/credential-validator.js +66 -0
  656. package/node_modules/@comis/channels/dist/slack/format-slack.d.ts +20 -0
  657. package/node_modules/@comis/channels/dist/slack/format-slack.js +73 -0
  658. package/node_modules/@comis/channels/dist/slack/media-handler.d.ts +47 -0
  659. package/node_modules/@comis/channels/dist/slack/media-handler.js +132 -0
  660. package/node_modules/@comis/channels/dist/slack/message-mapper.d.ts +50 -0
  661. package/node_modules/@comis/channels/dist/slack/message-mapper.js +70 -0
  662. package/node_modules/@comis/channels/dist/slack/rich-renderer.d.ts +32 -0
  663. package/node_modules/@comis/channels/dist/slack/rich-renderer.js +89 -0
  664. package/node_modules/@comis/channels/dist/slack/slack-actions.d.ts +22 -0
  665. package/node_modules/@comis/channels/dist/slack/slack-actions.js +137 -0
  666. package/node_modules/@comis/channels/dist/slack/slack-adapter.d.ts +30 -0
  667. package/node_modules/@comis/channels/dist/slack/slack-adapter.js +399 -0
  668. package/node_modules/@comis/channels/dist/slack/slack-plugin.d.ts +17 -0
  669. package/node_modules/@comis/channels/dist/slack/slack-plugin.js +69 -0
  670. package/node_modules/@comis/channels/dist/slack/slack-resolver.d.ts +31 -0
  671. package/node_modules/@comis/channels/dist/slack/slack-resolver.js +83 -0
  672. package/node_modules/@comis/channels/dist/telegram/credential-validator.d.ts +37 -0
  673. package/node_modules/@comis/channels/dist/telegram/credential-validator.js +62 -0
  674. package/node_modules/@comis/channels/dist/telegram/emoji-fallback.d.ts +30 -0
  675. package/node_modules/@comis/channels/dist/telegram/emoji-fallback.js +60 -0
  676. package/node_modules/@comis/channels/dist/telegram/media-handler.d.ts +13 -0
  677. package/node_modules/@comis/channels/dist/telegram/media-handler.js +92 -0
  678. package/node_modules/@comis/channels/dist/telegram/message-mapper.d.ts +21 -0
  679. package/node_modules/@comis/channels/dist/telegram/message-mapper.js +78 -0
  680. package/node_modules/@comis/channels/dist/telegram/rich-renderer.d.ts +33 -0
  681. package/node_modules/@comis/channels/dist/telegram/rich-renderer.js +97 -0
  682. package/node_modules/@comis/channels/dist/telegram/telegram-adapter.d.ts +36 -0
  683. package/node_modules/@comis/channels/dist/telegram/telegram-adapter.js +673 -0
  684. package/node_modules/@comis/channels/dist/telegram/telegram-plugin.d.ts +39 -0
  685. package/node_modules/@comis/channels/dist/telegram/telegram-plugin.js +79 -0
  686. package/node_modules/@comis/channels/dist/telegram/telegram-resolver.d.ts +44 -0
  687. package/node_modules/@comis/channels/dist/telegram/telegram-resolver.js +83 -0
  688. package/node_modules/@comis/channels/dist/telegram/thread-context.d.ts +90 -0
  689. package/node_modules/@comis/channels/dist/telegram/thread-context.js +119 -0
  690. package/node_modules/@comis/channels/dist/telegram/voice-sender.d.ts +35 -0
  691. package/node_modules/@comis/channels/dist/telegram/voice-sender.js +75 -0
  692. package/node_modules/@comis/channels/dist/whatsapp/credential-validator.d.ts +27 -0
  693. package/node_modules/@comis/channels/dist/whatsapp/credential-validator.js +80 -0
  694. package/node_modules/@comis/channels/dist/whatsapp/jid-utils.d.ts +39 -0
  695. package/node_modules/@comis/channels/dist/whatsapp/jid-utils.js +125 -0
  696. package/node_modules/@comis/channels/dist/whatsapp/media-handler.d.ts +27 -0
  697. package/node_modules/@comis/channels/dist/whatsapp/media-handler.js +84 -0
  698. package/node_modules/@comis/channels/dist/whatsapp/message-mapper.d.ts +74 -0
  699. package/node_modules/@comis/channels/dist/whatsapp/message-mapper.js +106 -0
  700. package/node_modules/@comis/channels/dist/whatsapp/voice-sender.d.ts +37 -0
  701. package/node_modules/@comis/channels/dist/whatsapp/voice-sender.js +49 -0
  702. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-adapter.d.ts +27 -0
  703. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-adapter.js +475 -0
  704. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-plugin.d.ts +17 -0
  705. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-plugin.js +69 -0
  706. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-resolver.d.ts +34 -0
  707. package/node_modules/@comis/channels/dist/whatsapp/whatsapp-resolver.js +99 -0
  708. package/node_modules/@comis/channels/package.json +47 -0
  709. package/node_modules/@comis/cli/dist/cli.d.ts +12 -0
  710. package/node_modules/@comis/cli/dist/cli.js +57 -0
  711. package/node_modules/@comis/cli/dist/client/rpc-client.d.ts +61 -0
  712. package/node_modules/@comis/cli/dist/client/rpc-client.js +274 -0
  713. package/node_modules/@comis/cli/dist/commands/agent.d.ts +15 -0
  714. package/node_modules/@comis/cli/dist/commands/agent.js +282 -0
  715. package/node_modules/@comis/cli/dist/commands/channel.d.ts +15 -0
  716. package/node_modules/@comis/cli/dist/commands/channel.js +113 -0
  717. package/node_modules/@comis/cli/dist/commands/config.d.ts +16 -0
  718. package/node_modules/@comis/cli/dist/commands/config.js +293 -0
  719. package/node_modules/@comis/cli/dist/commands/configure.d.ts +20 -0
  720. package/node_modules/@comis/cli/dist/commands/configure.js +273 -0
  721. package/node_modules/@comis/cli/dist/commands/daemon.d.ts +17 -0
  722. package/node_modules/@comis/cli/dist/commands/daemon.js +562 -0
  723. package/node_modules/@comis/cli/dist/commands/doctor.d.ts +20 -0
  724. package/node_modules/@comis/cli/dist/commands/doctor.js +160 -0
  725. package/node_modules/@comis/cli/dist/commands/health.d.ts +20 -0
  726. package/node_modules/@comis/cli/dist/commands/health.js +158 -0
  727. package/node_modules/@comis/cli/dist/commands/init.d.ts +24 -0
  728. package/node_modules/@comis/cli/dist/commands/init.js +229 -0
  729. package/node_modules/@comis/cli/dist/commands/memory.d.ts +15 -0
  730. package/node_modules/@comis/cli/dist/commands/memory.js +266 -0
  731. package/node_modules/@comis/cli/dist/commands/models.d.ts +20 -0
  732. package/node_modules/@comis/cli/dist/commands/models.js +225 -0
  733. package/node_modules/@comis/cli/dist/commands/pm2.d.ts +16 -0
  734. package/node_modules/@comis/cli/dist/commands/pm2.js +216 -0
  735. package/node_modules/@comis/cli/dist/commands/reset.d.ts +19 -0
  736. package/node_modules/@comis/cli/dist/commands/reset.js +186 -0
  737. package/node_modules/@comis/cli/dist/commands/secrets.d.ts +25 -0
  738. package/node_modules/@comis/cli/dist/commands/secrets.js +491 -0
  739. package/node_modules/@comis/cli/dist/commands/security.d.ts +21 -0
  740. package/node_modules/@comis/cli/dist/commands/security.js +231 -0
  741. package/node_modules/@comis/cli/dist/commands/sessions.d.ts +25 -0
  742. package/node_modules/@comis/cli/dist/commands/sessions.js +179 -0
  743. package/node_modules/@comis/cli/dist/commands/signal-setup.d.ts +19 -0
  744. package/node_modules/@comis/cli/dist/commands/signal-setup.js +398 -0
  745. package/node_modules/@comis/cli/dist/commands/status.d.ts +20 -0
  746. package/node_modules/@comis/cli/dist/commands/status.js +243 -0
  747. package/node_modules/@comis/cli/dist/commands/uninstall.d.ts +13 -0
  748. package/node_modules/@comis/cli/dist/commands/uninstall.js +143 -0
  749. package/node_modules/@comis/cli/dist/doctor/check-runner.d.ts +23 -0
  750. package/node_modules/@comis/cli/dist/doctor/check-runner.js +56 -0
  751. package/node_modules/@comis/cli/dist/doctor/checks/channel-health.d.ts +18 -0
  752. package/node_modules/@comis/cli/dist/doctor/checks/channel-health.js +94 -0
  753. package/node_modules/@comis/cli/dist/doctor/checks/config-health.d.ts +17 -0
  754. package/node_modules/@comis/cli/dist/doctor/checks/config-health.js +114 -0
  755. package/node_modules/@comis/cli/dist/doctor/checks/daemon-health.d.ts +17 -0
  756. package/node_modules/@comis/cli/dist/doctor/checks/daemon-health.js +77 -0
  757. package/node_modules/@comis/cli/dist/doctor/checks/gateway-health.d.ts +15 -0
  758. package/node_modules/@comis/cli/dist/doctor/checks/gateway-health.js +110 -0
  759. package/node_modules/@comis/cli/dist/doctor/checks/workspace-health.d.ts +19 -0
  760. package/node_modules/@comis/cli/dist/doctor/checks/workspace-health.js +97 -0
  761. package/node_modules/@comis/cli/dist/doctor/output.d.ts +28 -0
  762. package/node_modules/@comis/cli/dist/doctor/output.js +83 -0
  763. package/node_modules/@comis/cli/dist/doctor/repairs/repair-config.d.ts +24 -0
  764. package/node_modules/@comis/cli/dist/doctor/repairs/repair-config.js +88 -0
  765. package/node_modules/@comis/cli/dist/doctor/repairs/repair-daemon.d.ts +21 -0
  766. package/node_modules/@comis/cli/dist/doctor/repairs/repair-daemon.js +38 -0
  767. package/node_modules/@comis/cli/dist/doctor/repairs/repair-workspace.d.ts +23 -0
  768. package/node_modules/@comis/cli/dist/doctor/repairs/repair-workspace.js +56 -0
  769. package/node_modules/@comis/cli/dist/doctor/types.d.ts +65 -0
  770. package/node_modules/@comis/cli/dist/doctor/types.js +11 -0
  771. package/node_modules/@comis/cli/dist/index.d.ts +23 -0
  772. package/node_modules/@comis/cli/dist/index.js +48 -0
  773. package/node_modules/@comis/cli/dist/mock-rpc-client.d.ts +69 -0
  774. package/node_modules/@comis/cli/dist/mock-rpc-client.js +105 -0
  775. package/node_modules/@comis/cli/dist/output/format.d.ts +28 -0
  776. package/node_modules/@comis/cli/dist/output/format.js +42 -0
  777. package/node_modules/@comis/cli/dist/output/spinner.d.ts +19 -0
  778. package/node_modules/@comis/cli/dist/output/spinner.js +32 -0
  779. package/node_modules/@comis/cli/dist/output/table.d.ts +21 -0
  780. package/node_modules/@comis/cli/dist/output/table.js +57 -0
  781. package/node_modules/@comis/cli/dist/security/check-runner.d.ts +25 -0
  782. package/node_modules/@comis/cli/dist/security/check-runner.js +68 -0
  783. package/node_modules/@comis/cli/dist/security/checks/action-confirmation.d.ts +18 -0
  784. package/node_modules/@comis/cli/dist/security/checks/action-confirmation.js +52 -0
  785. package/node_modules/@comis/cli/dist/security/checks/audit-logging.d.ts +19 -0
  786. package/node_modules/@comis/cli/dist/security/checks/audit-logging.js +57 -0
  787. package/node_modules/@comis/cli/dist/security/checks/browser-exposure.d.ts +17 -0
  788. package/node_modules/@comis/cli/dist/security/checks/browser-exposure.js +56 -0
  789. package/node_modules/@comis/cli/dist/security/checks/channel-security.d.ts +16 -0
  790. package/node_modules/@comis/cli/dist/security/checks/channel-security.js +63 -0
  791. package/node_modules/@comis/cli/dist/security/checks/config-validation.d.ts +17 -0
  792. package/node_modules/@comis/cli/dist/security/checks/config-validation.js +77 -0
  793. package/node_modules/@comis/cli/dist/security/checks/file-permissions.d.ts +18 -0
  794. package/node_modules/@comis/cli/dist/security/checks/file-permissions.js +97 -0
  795. package/node_modules/@comis/cli/dist/security/checks/gateway-exposure.d.ts +17 -0
  796. package/node_modules/@comis/cli/dist/security/checks/gateway-exposure.js +69 -0
  797. package/node_modules/@comis/cli/dist/security/checks/hooks-hardening.d.ts +17 -0
  798. package/node_modules/@comis/cli/dist/security/checks/hooks-hardening.js +72 -0
  799. package/node_modules/@comis/cli/dist/security/checks/model-hygiene.d.ts +18 -0
  800. package/node_modules/@comis/cli/dist/security/checks/model-hygiene.js +61 -0
  801. package/node_modules/@comis/cli/dist/security/checks/secrets-exposure.d.ts +20 -0
  802. package/node_modules/@comis/cli/dist/security/checks/secrets-exposure.js +82 -0
  803. package/node_modules/@comis/cli/dist/security/checks/skills-code.d.ts +18 -0
  804. package/node_modules/@comis/cli/dist/security/checks/skills-code.js +136 -0
  805. package/node_modules/@comis/cli/dist/security/checks/ssrf-surface.d.ts +17 -0
  806. package/node_modules/@comis/cli/dist/security/checks/ssrf-surface.js +66 -0
  807. package/node_modules/@comis/cli/dist/security/checks/state-protection.d.ts +16 -0
  808. package/node_modules/@comis/cli/dist/security/checks/state-protection.js +97 -0
  809. package/node_modules/@comis/cli/dist/security/checks/webhook-security.d.ts +21 -0
  810. package/node_modules/@comis/cli/dist/security/checks/webhook-security.js +61 -0
  811. package/node_modules/@comis/cli/dist/security/fix-runner.d.ts +32 -0
  812. package/node_modules/@comis/cli/dist/security/fix-runner.js +95 -0
  813. package/node_modules/@comis/cli/dist/security/fix-types.d.ts +46 -0
  814. package/node_modules/@comis/cli/dist/security/fix-types.js +10 -0
  815. package/node_modules/@comis/cli/dist/security/fixes/fix-config.d.ts +25 -0
  816. package/node_modules/@comis/cli/dist/security/fixes/fix-config.js +46 -0
  817. package/node_modules/@comis/cli/dist/security/fixes/fix-permissions.d.ts +21 -0
  818. package/node_modules/@comis/cli/dist/security/fixes/fix-permissions.js +82 -0
  819. package/node_modules/@comis/cli/dist/security/fixes/fix-secrets.d.ts +21 -0
  820. package/node_modules/@comis/cli/dist/security/fixes/fix-secrets.js +34 -0
  821. package/node_modules/@comis/cli/dist/security/output.d.ts +28 -0
  822. package/node_modules/@comis/cli/dist/security/output.js +92 -0
  823. package/node_modules/@comis/cli/dist/security/types.d.ts +65 -0
  824. package/node_modules/@comis/cli/dist/security/types.js +11 -0
  825. package/node_modules/@comis/cli/dist/test-fixtures.d.ts +76 -0
  826. package/node_modules/@comis/cli/dist/test-fixtures.js +164 -0
  827. package/node_modules/@comis/cli/dist/test-helpers.d.ts +54 -0
  828. package/node_modules/@comis/cli/dist/test-helpers.js +73 -0
  829. package/node_modules/@comis/cli/dist/wizard/clack-adapter.d.ts +46 -0
  830. package/node_modules/@comis/cli/dist/wizard/clack-adapter.js +248 -0
  831. package/node_modules/@comis/cli/dist/wizard/config-writer.d.ts +25 -0
  832. package/node_modules/@comis/cli/dist/wizard/config-writer.js +144 -0
  833. package/node_modules/@comis/cli/dist/wizard/flow-types.d.ts +48 -0
  834. package/node_modules/@comis/cli/dist/wizard/flow-types.js +70 -0
  835. package/node_modules/@comis/cli/dist/wizard/index.d.ts +44 -0
  836. package/node_modules/@comis/cli/dist/wizard/index.js +46 -0
  837. package/node_modules/@comis/cli/dist/wizard/json-output.d.ts +66 -0
  838. package/node_modules/@comis/cli/dist/wizard/json-output.js +83 -0
  839. package/node_modules/@comis/cli/dist/wizard/manual-flow.d.ts +21 -0
  840. package/node_modules/@comis/cli/dist/wizard/manual-flow.js +345 -0
  841. package/node_modules/@comis/cli/dist/wizard/non-interactive.d.ts +120 -0
  842. package/node_modules/@comis/cli/dist/wizard/non-interactive.js +403 -0
  843. package/node_modules/@comis/cli/dist/wizard/prompter.d.ts +122 -0
  844. package/node_modules/@comis/cli/dist/wizard/prompter.js +44 -0
  845. package/node_modules/@comis/cli/dist/wizard/quickstart-flow.d.ts +21 -0
  846. package/node_modules/@comis/cli/dist/wizard/quickstart-flow.js +116 -0
  847. package/node_modules/@comis/cli/dist/wizard/state.d.ts +124 -0
  848. package/node_modules/@comis/cli/dist/wizard/state.js +448 -0
  849. package/node_modules/@comis/cli/dist/wizard/steps/00-welcome.d.ts +12 -0
  850. package/node_modules/@comis/cli/dist/wizard/steps/00-welcome.js +42 -0
  851. package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.d.ts +12 -0
  852. package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.js +369 -0
  853. package/node_modules/@comis/cli/dist/wizard/steps/02-flow-select.d.ts +14 -0
  854. package/node_modules/@comis/cli/dist/wizard/steps/02-flow-select.js +43 -0
  855. package/node_modules/@comis/cli/dist/wizard/steps/03-provider.d.ts +15 -0
  856. package/node_modules/@comis/cli/dist/wizard/steps/03-provider.js +46 -0
  857. package/node_modules/@comis/cli/dist/wizard/steps/04-credentials.d.ts +18 -0
  858. package/node_modules/@comis/cli/dist/wizard/steps/04-credentials.js +324 -0
  859. package/node_modules/@comis/cli/dist/wizard/steps/05-agent.d.ts +12 -0
  860. package/node_modules/@comis/cli/dist/wizard/steps/05-agent.js +116 -0
  861. package/node_modules/@comis/cli/dist/wizard/steps/06-channels.d.ts +15 -0
  862. package/node_modules/@comis/cli/dist/wizard/steps/06-channels.js +476 -0
  863. package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.d.ts +14 -0
  864. package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.js +105 -0
  865. package/node_modules/@comis/cli/dist/wizard/steps/08-workspace.d.ts +14 -0
  866. package/node_modules/@comis/cli/dist/wizard/steps/08-workspace.js +69 -0
  867. package/node_modules/@comis/cli/dist/wizard/steps/08b-tool-providers.d.ts +14 -0
  868. package/node_modules/@comis/cli/dist/wizard/steps/08b-tool-providers.js +61 -0
  869. package/node_modules/@comis/cli/dist/wizard/steps/09-review.d.ts +17 -0
  870. package/node_modules/@comis/cli/dist/wizard/steps/09-review.js +150 -0
  871. package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.d.ts +11 -0
  872. package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +342 -0
  873. package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.d.ts +16 -0
  874. package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.js +330 -0
  875. package/node_modules/@comis/cli/dist/wizard/steps/12-finish.d.ts +14 -0
  876. package/node_modules/@comis/cli/dist/wizard/steps/12-finish.js +95 -0
  877. package/node_modules/@comis/cli/dist/wizard/theme.d.ts +93 -0
  878. package/node_modules/@comis/cli/dist/wizard/theme.js +170 -0
  879. package/node_modules/@comis/cli/dist/wizard/types.d.ts +172 -0
  880. package/node_modules/@comis/cli/dist/wizard/types.js +88 -0
  881. package/node_modules/@comis/cli/dist/wizard/validators/agent-name.d.ts +26 -0
  882. package/node_modules/@comis/cli/dist/wizard/validators/agent-name.js +62 -0
  883. package/node_modules/@comis/cli/dist/wizard/validators/api-key.d.ts +36 -0
  884. package/node_modules/@comis/cli/dist/wizard/validators/api-key.js +124 -0
  885. package/node_modules/@comis/cli/dist/wizard/validators/channel-creds.d.ts +34 -0
  886. package/node_modules/@comis/cli/dist/wizard/validators/channel-creds.js +164 -0
  887. package/node_modules/@comis/cli/dist/wizard/validators/network.d.ts +27 -0
  888. package/node_modules/@comis/cli/dist/wizard/validators/network.js +68 -0
  889. package/node_modules/@comis/cli/dist/wizard/validators/port.d.ts +23 -0
  890. package/node_modules/@comis/cli/dist/wizard/validators/port.js +63 -0
  891. package/node_modules/@comis/cli/package.json +51 -0
  892. package/node_modules/@comis/core/dist/approval/approval-gate.d.ts +63 -0
  893. package/node_modules/@comis/core/dist/approval/approval-gate.js +330 -0
  894. package/node_modules/@comis/core/dist/approval/approval-gate.test.d.ts +1 -0
  895. package/node_modules/@comis/core/dist/approval/approval-gate.test.js +1003 -0
  896. package/node_modules/@comis/core/dist/approval/index.d.ts +4 -0
  897. package/node_modules/@comis/core/dist/approval/index.js +3 -0
  898. package/node_modules/@comis/core/dist/bootstrap.d.ts +55 -0
  899. package/node_modules/@comis/core/dist/bootstrap.js +81 -0
  900. package/node_modules/@comis/core/dist/bootstrap.test.d.ts +1 -0
  901. package/node_modules/@comis/core/dist/bootstrap.test.js +150 -0
  902. package/node_modules/@comis/core/dist/config/backup.d.ts +51 -0
  903. package/node_modules/@comis/core/dist/config/backup.js +116 -0
  904. package/node_modules/@comis/core/dist/config/backup.test.d.ts +1 -0
  905. package/node_modules/@comis/core/dist/config/backup.test.js +160 -0
  906. package/node_modules/@comis/core/dist/config/env-substitution.d.ts +59 -0
  907. package/node_modules/@comis/core/dist/config/env-substitution.js +262 -0
  908. package/node_modules/@comis/core/dist/config/env-substitution.test.d.ts +1 -0
  909. package/node_modules/@comis/core/dist/config/env-substitution.test.js +259 -0
  910. package/node_modules/@comis/core/dist/config/field-metadata.d.ts +42 -0
  911. package/node_modules/@comis/core/dist/config/field-metadata.js +187 -0
  912. package/node_modules/@comis/core/dist/config/field-metadata.test.d.ts +1 -0
  913. package/node_modules/@comis/core/dist/config/field-metadata.test.js +72 -0
  914. package/node_modules/@comis/core/dist/config/git-manager.d.ts +146 -0
  915. package/node_modules/@comis/core/dist/config/git-manager.js +466 -0
  916. package/node_modules/@comis/core/dist/config/git-manager.test.d.ts +1 -0
  917. package/node_modules/@comis/core/dist/config/git-manager.test.js +1042 -0
  918. package/node_modules/@comis/core/dist/config/immutable-keys.d.ts +79 -0
  919. package/node_modules/@comis/core/dist/config/immutable-keys.js +139 -0
  920. package/node_modules/@comis/core/dist/config/immutable-keys.test.d.ts +1 -0
  921. package/node_modules/@comis/core/dist/config/immutable-keys.test.js +283 -0
  922. package/node_modules/@comis/core/dist/config/include-resolver.d.ts +38 -0
  923. package/node_modules/@comis/core/dist/config/include-resolver.js +130 -0
  924. package/node_modules/@comis/core/dist/config/include-resolver.test.d.ts +1 -0
  925. package/node_modules/@comis/core/dist/config/include-resolver.test.js +292 -0
  926. package/node_modules/@comis/core/dist/config/index.d.ts +76 -0
  927. package/node_modules/@comis/core/dist/config/index.js +70 -0
  928. package/node_modules/@comis/core/dist/config/layered.d.ts +30 -0
  929. package/node_modules/@comis/core/dist/config/layered.js +87 -0
  930. package/node_modules/@comis/core/dist/config/layered.test.d.ts +1 -0
  931. package/node_modules/@comis/core/dist/config/layered.test.js +211 -0
  932. package/node_modules/@comis/core/dist/config/loader.d.ts +36 -0
  933. package/node_modules/@comis/core/dist/config/loader.js +110 -0
  934. package/node_modules/@comis/core/dist/config/loader.test.d.ts +1 -0
  935. package/node_modules/@comis/core/dist/config/loader.test.js +300 -0
  936. package/node_modules/@comis/core/dist/config/migrate.d.ts +27 -0
  937. package/node_modules/@comis/core/dist/config/migrate.js +114 -0
  938. package/node_modules/@comis/core/dist/config/migrate.test.d.ts +1 -0
  939. package/node_modules/@comis/core/dist/config/migrate.test.js +244 -0
  940. package/node_modules/@comis/core/dist/config/partial-validator.d.ts +49 -0
  941. package/node_modules/@comis/core/dist/config/partial-validator.js +77 -0
  942. package/node_modules/@comis/core/dist/config/partial-validator.test.d.ts +1 -0
  943. package/node_modules/@comis/core/dist/config/partial-validator.test.js +98 -0
  944. package/node_modules/@comis/core/dist/config/schema-agent-model.d.ts +135 -0
  945. package/node_modules/@comis/core/dist/config/schema-agent-model.js +114 -0
  946. package/node_modules/@comis/core/dist/config/schema-agent-model.test.d.ts +1 -0
  947. package/node_modules/@comis/core/dist/config/schema-agent-model.test.js +279 -0
  948. package/node_modules/@comis/core/dist/config/schema-agent-session.d.ts +177 -0
  949. package/node_modules/@comis/core/dist/config/schema-agent-session.js +116 -0
  950. package/node_modules/@comis/core/dist/config/schema-agent-session.test.d.ts +1 -0
  951. package/node_modules/@comis/core/dist/config/schema-agent-session.test.js +242 -0
  952. package/node_modules/@comis/core/dist/config/schema-agent.d.ts +2373 -0
  953. package/node_modules/@comis/core/dist/config/schema-agent.js +732 -0
  954. package/node_modules/@comis/core/dist/config/schema-agent.test.d.ts +1 -0
  955. package/node_modules/@comis/core/dist/config/schema-agent.test.js +645 -0
  956. package/node_modules/@comis/core/dist/config/schema-approvals.d.ts +78 -0
  957. package/node_modules/@comis/core/dist/config/schema-approvals.js +49 -0
  958. package/node_modules/@comis/core/dist/config/schema-auto-reply-engine.d.ts +42 -0
  959. package/node_modules/@comis/core/dist/config/schema-auto-reply-engine.js +35 -0
  960. package/node_modules/@comis/core/dist/config/schema-background-tasks.d.ts +25 -0
  961. package/node_modules/@comis/core/dist/config/schema-background-tasks.js +25 -0
  962. package/node_modules/@comis/core/dist/config/schema-browser.d.ts +42 -0
  963. package/node_modules/@comis/core/dist/config/schema-browser.js +51 -0
  964. package/node_modules/@comis/core/dist/config/schema-channel.d.ts +1172 -0
  965. package/node_modules/@comis/core/dist/config/schema-channel.js +165 -0
  966. package/node_modules/@comis/core/dist/config/schema-channel.test.d.ts +1 -0
  967. package/node_modules/@comis/core/dist/config/schema-channel.test.js +341 -0
  968. package/node_modules/@comis/core/dist/config/schema-coalescer.d.ts +24 -0
  969. package/node_modules/@comis/core/dist/config/schema-coalescer.js +21 -0
  970. package/node_modules/@comis/core/dist/config/schema-coalescer.test.d.ts +1 -0
  971. package/node_modules/@comis/core/dist/config/schema-coalescer.test.js +51 -0
  972. package/node_modules/@comis/core/dist/config/schema-context-engine.d.ts +92 -0
  973. package/node_modules/@comis/core/dist/config/schema-context-engine.js +92 -0
  974. package/node_modules/@comis/core/dist/config/schema-context-engine.test.d.ts +1 -0
  975. package/node_modules/@comis/core/dist/config/schema-context-engine.test.js +797 -0
  976. package/node_modules/@comis/core/dist/config/schema-context-guard.d.ts +34 -0
  977. package/node_modules/@comis/core/dist/config/schema-context-guard.js +32 -0
  978. package/node_modules/@comis/core/dist/config/schema-context-guard.test.d.ts +1 -0
  979. package/node_modules/@comis/core/dist/config/schema-context-guard.test.js +111 -0
  980. package/node_modules/@comis/core/dist/config/schema-daemon.d.ts +140 -0
  981. package/node_modules/@comis/core/dist/config/schema-daemon.js +91 -0
  982. package/node_modules/@comis/core/dist/config/schema-daemon.test.d.ts +1 -0
  983. package/node_modules/@comis/core/dist/config/schema-daemon.test.js +107 -0
  984. package/node_modules/@comis/core/dist/config/schema-delivery-mirror.d.ts +27 -0
  985. package/node_modules/@comis/core/dist/config/schema-delivery-mirror.js +26 -0
  986. package/node_modules/@comis/core/dist/config/schema-delivery-queue.d.ts +31 -0
  987. package/node_modules/@comis/core/dist/config/schema-delivery-queue.js +30 -0
  988. package/node_modules/@comis/core/dist/config/schema-delivery-timing.d.ts +41 -0
  989. package/node_modules/@comis/core/dist/config/schema-delivery-timing.js +31 -0
  990. package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.d.ts +1 -0
  991. package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.js +51 -0
  992. package/node_modules/@comis/core/dist/config/schema-delivery.d.ts +97 -0
  993. package/node_modules/@comis/core/dist/config/schema-delivery.js +89 -0
  994. package/node_modules/@comis/core/dist/config/schema-documentation.d.ts +42 -0
  995. package/node_modules/@comis/core/dist/config/schema-documentation.js +36 -0
  996. package/node_modules/@comis/core/dist/config/schema-documentation.test.d.ts +1 -0
  997. package/node_modules/@comis/core/dist/config/schema-documentation.test.js +63 -0
  998. package/node_modules/@comis/core/dist/config/schema-embedding.d.ts +58 -0
  999. package/node_modules/@comis/core/dist/config/schema-embedding.js +61 -0
  1000. package/node_modules/@comis/core/dist/config/schema-envelope.d.ts +35 -0
  1001. package/node_modules/@comis/core/dist/config/schema-envelope.js +32 -0
  1002. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +124 -0
  1003. package/node_modules/@comis/core/dist/config/schema-gateway.js +85 -0
  1004. package/node_modules/@comis/core/dist/config/schema-gateway.test.d.ts +1 -0
  1005. package/node_modules/@comis/core/dist/config/schema-gateway.test.js +219 -0
  1006. package/node_modules/@comis/core/dist/config/schema-gemini-cache.d.ts +19 -0
  1007. package/node_modules/@comis/core/dist/config/schema-gemini-cache.js +19 -0
  1008. package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.d.ts +1 -0
  1009. package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.js +41 -0
  1010. package/node_modules/@comis/core/dist/config/schema-integrations.d.ts +960 -0
  1011. package/node_modules/@comis/core/dist/config/schema-integrations.js +369 -0
  1012. package/node_modules/@comis/core/dist/config/schema-integrations.test.d.ts +1 -0
  1013. package/node_modules/@comis/core/dist/config/schema-integrations.test.js +92 -0
  1014. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.d.ts +78 -0
  1015. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.js +49 -0
  1016. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.d.ts +1 -0
  1017. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.js +61 -0
  1018. package/node_modules/@comis/core/dist/config/schema-memory-review.d.ts +38 -0
  1019. package/node_modules/@comis/core/dist/config/schema-memory-review.js +38 -0
  1020. package/node_modules/@comis/core/dist/config/schema-memory.d.ts +50 -0
  1021. package/node_modules/@comis/core/dist/config/schema-memory.js +36 -0
  1022. package/node_modules/@comis/core/dist/config/schema-messages.d.ts +29 -0
  1023. package/node_modules/@comis/core/dist/config/schema-messages.js +28 -0
  1024. package/node_modules/@comis/core/dist/config/schema-misc.test.d.ts +1 -0
  1025. package/node_modules/@comis/core/dist/config/schema-misc.test.js +394 -0
  1026. package/node_modules/@comis/core/dist/config/schema-models.d.ts +46 -0
  1027. package/node_modules/@comis/core/dist/config/schema-models.js +36 -0
  1028. package/node_modules/@comis/core/dist/config/schema-monitoring.d.ts +105 -0
  1029. package/node_modules/@comis/core/dist/config/schema-monitoring.js +67 -0
  1030. package/node_modules/@comis/core/dist/config/schema-notification.d.ts +25 -0
  1031. package/node_modules/@comis/core/dist/config/schema-notification.js +25 -0
  1032. package/node_modules/@comis/core/dist/config/schema-observability.d.ts +139 -0
  1033. package/node_modules/@comis/core/dist/config/schema-observability.js +95 -0
  1034. package/node_modules/@comis/core/dist/config/schema-observability.test.d.ts +1 -0
  1035. package/node_modules/@comis/core/dist/config/schema-observability.test.js +76 -0
  1036. package/node_modules/@comis/core/dist/config/schema-plugins.d.ts +37 -0
  1037. package/node_modules/@comis/core/dist/config/schema-plugins.js +27 -0
  1038. package/node_modules/@comis/core/dist/config/schema-providers.d.ts +241 -0
  1039. package/node_modules/@comis/core/dist/config/schema-providers.js +88 -0
  1040. package/node_modules/@comis/core/dist/config/schema-providers.test.d.ts +1 -0
  1041. package/node_modules/@comis/core/dist/config/schema-providers.test.js +294 -0
  1042. package/node_modules/@comis/core/dist/config/schema-queue.d.ts +248 -0
  1043. package/node_modules/@comis/core/dist/config/schema-queue.js +145 -0
  1044. package/node_modules/@comis/core/dist/config/schema-queue.test.d.ts +1 -0
  1045. package/node_modules/@comis/core/dist/config/schema-queue.test.js +234 -0
  1046. package/node_modules/@comis/core/dist/config/schema-response-prefix.d.ts +20 -0
  1047. package/node_modules/@comis/core/dist/config/schema-response-prefix.js +17 -0
  1048. package/node_modules/@comis/core/dist/config/schema-response-prefix.test.d.ts +1 -0
  1049. package/node_modules/@comis/core/dist/config/schema-response-prefix.test.js +36 -0
  1050. package/node_modules/@comis/core/dist/config/schema-retry.d.ts +25 -0
  1051. package/node_modules/@comis/core/dist/config/schema-retry.js +25 -0
  1052. package/node_modules/@comis/core/dist/config/schema-scheduler.d.ts +90 -0
  1053. package/node_modules/@comis/core/dist/config/schema-scheduler.js +88 -0
  1054. package/node_modules/@comis/core/dist/config/schema-secrets.d.ts +15 -0
  1055. package/node_modules/@comis/core/dist/config/schema-secrets.js +14 -0
  1056. package/node_modules/@comis/core/dist/config/schema-security.d.ts +159 -0
  1057. package/node_modules/@comis/core/dist/config/schema-security.js +70 -0
  1058. package/node_modules/@comis/core/dist/config/schema-security.test.d.ts +1 -0
  1059. package/node_modules/@comis/core/dist/config/schema-security.test.js +54 -0
  1060. package/node_modules/@comis/core/dist/config/schema-send-policy.d.ts +65 -0
  1061. package/node_modules/@comis/core/dist/config/schema-send-policy.js +40 -0
  1062. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.d.ts +26 -0
  1063. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.js +22 -0
  1064. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.d.ts +1 -0
  1065. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.js +60 -0
  1066. package/node_modules/@comis/core/dist/config/schema-serializer.d.ts +33 -0
  1067. package/node_modules/@comis/core/dist/config/schema-serializer.js +97 -0
  1068. package/node_modules/@comis/core/dist/config/schema-serializer.test.d.ts +1 -0
  1069. package/node_modules/@comis/core/dist/config/schema-serializer.test.js +73 -0
  1070. package/node_modules/@comis/core/dist/config/schema-skills.d.ts +134 -0
  1071. package/node_modules/@comis/core/dist/config/schema-skills.js +122 -0
  1072. package/node_modules/@comis/core/dist/config/schema-streaming.d.ts +286 -0
  1073. package/node_modules/@comis/core/dist/config/schema-streaming.js +110 -0
  1074. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.d.ts +19 -0
  1075. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.js +19 -0
  1076. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.d.ts +1 -0
  1077. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.js +39 -0
  1078. package/node_modules/@comis/core/dist/config/schema-verbosity.d.ts +68 -0
  1079. package/node_modules/@comis/core/dist/config/schema-verbosity.js +27 -0
  1080. package/node_modules/@comis/core/dist/config/schema-webhooks.d.ts +131 -0
  1081. package/node_modules/@comis/core/dist/config/schema-webhooks.js +72 -0
  1082. package/node_modules/@comis/core/dist/config/schema.d.ts +2041 -0
  1083. package/node_modules/@comis/core/dist/config/schema.js +115 -0
  1084. package/node_modules/@comis/core/dist/config/types.d.ts +52 -0
  1085. package/node_modules/@comis/core/dist/config/types.js +7 -0
  1086. package/node_modules/@comis/core/dist/context/context.d.ts +78 -0
  1087. package/node_modules/@comis/core/dist/context/context.js +82 -0
  1088. package/node_modules/@comis/core/dist/context/context.test.d.ts +1 -0
  1089. package/node_modules/@comis/core/dist/context/context.test.js +276 -0
  1090. package/node_modules/@comis/core/dist/context/index.d.ts +2 -0
  1091. package/node_modules/@comis/core/dist/context/index.js +2 -0
  1092. package/node_modules/@comis/core/dist/domain/agent-response.d.ts +55 -0
  1093. package/node_modules/@comis/core/dist/domain/agent-response.js +46 -0
  1094. package/node_modules/@comis/core/dist/domain/agent-response.test.d.ts +1 -0
  1095. package/node_modules/@comis/core/dist/domain/agent-response.test.js +159 -0
  1096. package/node_modules/@comis/core/dist/domain/approval-request.d.ts +98 -0
  1097. package/node_modules/@comis/core/dist/domain/approval-request.js +83 -0
  1098. package/node_modules/@comis/core/dist/domain/credential-mapping.d.ts +46 -0
  1099. package/node_modules/@comis/core/dist/domain/credential-mapping.js +62 -0
  1100. package/node_modules/@comis/core/dist/domain/credential-mapping.test.d.ts +1 -0
  1101. package/node_modules/@comis/core/dist/domain/credential-mapping.test.js +135 -0
  1102. package/node_modules/@comis/core/dist/domain/delivery-origin.d.ts +32 -0
  1103. package/node_modules/@comis/core/dist/domain/delivery-origin.js +35 -0
  1104. package/node_modules/@comis/core/dist/domain/delivery-origin.test.d.ts +1 -0
  1105. package/node_modules/@comis/core/dist/domain/delivery-origin.test.js +68 -0
  1106. package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +260 -0
  1107. package/node_modules/@comis/core/dist/domain/execution-graph.js +322 -0
  1108. package/node_modules/@comis/core/dist/domain/execution-graph.test.d.ts +1 -0
  1109. package/node_modules/@comis/core/dist/domain/execution-graph.test.js +441 -0
  1110. package/node_modules/@comis/core/dist/domain/index.d.ts +31 -0
  1111. package/node_modules/@comis/core/dist/domain/index.js +20 -0
  1112. package/node_modules/@comis/core/dist/domain/memory-entry.d.ts +74 -0
  1113. package/node_modules/@comis/core/dist/domain/memory-entry.js +56 -0
  1114. package/node_modules/@comis/core/dist/domain/memory-entry.test.d.ts +1 -0
  1115. package/node_modules/@comis/core/dist/domain/memory-entry.test.js +193 -0
  1116. package/node_modules/@comis/core/dist/domain/model-compat.d.ts +61 -0
  1117. package/node_modules/@comis/core/dist/domain/model-compat.js +47 -0
  1118. package/node_modules/@comis/core/dist/domain/node-type-driver.d.ts +124 -0
  1119. package/node_modules/@comis/core/dist/domain/node-type-driver.js +1 -0
  1120. package/node_modules/@comis/core/dist/domain/normalized-message.d.ts +98 -0
  1121. package/node_modules/@comis/core/dist/domain/normalized-message.js +62 -0
  1122. package/node_modules/@comis/core/dist/domain/normalized-message.test.d.ts +1 -0
  1123. package/node_modules/@comis/core/dist/domain/normalized-message.test.js +255 -0
  1124. package/node_modules/@comis/core/dist/domain/poll-input.d.ts +46 -0
  1125. package/node_modules/@comis/core/dist/domain/poll-input.js +67 -0
  1126. package/node_modules/@comis/core/dist/domain/provider-capabilities.d.ts +69 -0
  1127. package/node_modules/@comis/core/dist/domain/provider-capabilities.js +51 -0
  1128. package/node_modules/@comis/core/dist/domain/rich-message.d.ts +85 -0
  1129. package/node_modules/@comis/core/dist/domain/rich-message.js +83 -0
  1130. package/node_modules/@comis/core/dist/domain/secret-ref.d.ts +54 -0
  1131. package/node_modules/@comis/core/dist/domain/secret-ref.js +43 -0
  1132. package/node_modules/@comis/core/dist/domain/session-key.d.ts +47 -0
  1133. package/node_modules/@comis/core/dist/domain/session-key.js +120 -0
  1134. package/node_modules/@comis/core/dist/domain/session-key.test.d.ts +1 -0
  1135. package/node_modules/@comis/core/dist/domain/session-key.test.js +291 -0
  1136. package/node_modules/@comis/core/dist/domain/subagent-context-config.d.ts +62 -0
  1137. package/node_modules/@comis/core/dist/domain/subagent-context-config.js +58 -0
  1138. package/node_modules/@comis/core/dist/domain/subagent-context-config.test.d.ts +1 -0
  1139. package/node_modules/@comis/core/dist/domain/subagent-context-config.test.js +131 -0
  1140. package/node_modules/@comis/core/dist/domain/subagent-context-types.d.ts +203 -0
  1141. package/node_modules/@comis/core/dist/domain/subagent-context-types.js +57 -0
  1142. package/node_modules/@comis/core/dist/domain/subagent-context-types.test.d.ts +1 -0
  1143. package/node_modules/@comis/core/dist/domain/subagent-context-types.test.js +182 -0
  1144. package/node_modules/@comis/core/dist/event-bus/bus.d.ts +50 -0
  1145. package/node_modules/@comis/core/dist/event-bus/bus.js +71 -0
  1146. package/node_modules/@comis/core/dist/event-bus/bus.test.d.ts +1 -0
  1147. package/node_modules/@comis/core/dist/event-bus/bus.test.js +152 -0
  1148. package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +387 -0
  1149. package/node_modules/@comis/core/dist/event-bus/events-agent.js +1 -0
  1150. package/node_modules/@comis/core/dist/event-bus/events-agent.test.d.ts +1 -0
  1151. package/node_modules/@comis/core/dist/event-bus/events-agent.test.js +409 -0
  1152. package/node_modules/@comis/core/dist/event-bus/events-channel.d.ts +376 -0
  1153. package/node_modules/@comis/core/dist/event-bus/events-channel.js +1 -0
  1154. package/node_modules/@comis/core/dist/event-bus/events-channel.test.d.ts +1 -0
  1155. package/node_modules/@comis/core/dist/event-bus/events-channel.test.js +240 -0
  1156. package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +437 -0
  1157. package/node_modules/@comis/core/dist/event-bus/events-infra.js +1 -0
  1158. package/node_modules/@comis/core/dist/event-bus/events-infra.test.d.ts +1 -0
  1159. package/node_modules/@comis/core/dist/event-bus/events-infra.test.js +416 -0
  1160. package/node_modules/@comis/core/dist/event-bus/events-messaging.d.ts +298 -0
  1161. package/node_modules/@comis/core/dist/event-bus/events-messaging.js +1 -0
  1162. package/node_modules/@comis/core/dist/event-bus/events-messaging.test.d.ts +1 -0
  1163. package/node_modules/@comis/core/dist/event-bus/events-messaging.test.js +433 -0
  1164. package/node_modules/@comis/core/dist/event-bus/events.d.ts +15 -0
  1165. package/node_modules/@comis/core/dist/event-bus/events.js +1 -0
  1166. package/node_modules/@comis/core/dist/event-bus/events.test.d.ts +1 -0
  1167. package/node_modules/@comis/core/dist/event-bus/events.test.js +93 -0
  1168. package/node_modules/@comis/core/dist/event-bus/index.d.ts +7 -0
  1169. package/node_modules/@comis/core/dist/event-bus/index.js +2 -0
  1170. package/node_modules/@comis/core/dist/exports/bootstrap.d.ts +5 -0
  1171. package/node_modules/@comis/core/dist/exports/bootstrap.js +8 -0
  1172. package/node_modules/@comis/core/dist/exports/config.d.ts +2 -0
  1173. package/node_modules/@comis/core/dist/exports/config.js +3 -0
  1174. package/node_modules/@comis/core/dist/exports/domain.d.ts +2 -0
  1175. package/node_modules/@comis/core/dist/exports/domain.js +33 -0
  1176. package/node_modules/@comis/core/dist/exports/event-bus.d.ts +2 -0
  1177. package/node_modules/@comis/core/dist/exports/event-bus.js +3 -0
  1178. package/node_modules/@comis/core/dist/exports/hooks.d.ts +6 -0
  1179. package/node_modules/@comis/core/dist/exports/hooks.js +7 -0
  1180. package/node_modules/@comis/core/dist/exports/ports.d.ts +2 -0
  1181. package/node_modules/@comis/core/dist/exports/ports.js +3 -0
  1182. package/node_modules/@comis/core/dist/exports/security.d.ts +38 -0
  1183. package/node_modules/@comis/core/dist/exports/security.js +45 -0
  1184. package/node_modules/@comis/core/dist/hooks/hook-runner-global.d.ts +4 -0
  1185. package/node_modules/@comis/core/dist/hooks/hook-runner-global.js +22 -0
  1186. package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.d.ts +1 -0
  1187. package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.js +29 -0
  1188. package/node_modules/@comis/core/dist/hooks/hook-runner.d.ts +52 -0
  1189. package/node_modules/@comis/core/dist/hooks/hook-runner.js +204 -0
  1190. package/node_modules/@comis/core/dist/hooks/hook-runner.test.d.ts +1 -0
  1191. package/node_modules/@comis/core/dist/hooks/hook-runner.test.js +490 -0
  1192. package/node_modules/@comis/core/dist/hooks/hook-strategies.d.ts +29 -0
  1193. package/node_modules/@comis/core/dist/hooks/hook-strategies.js +58 -0
  1194. package/node_modules/@comis/core/dist/hooks/hook-strategies.test.d.ts +1 -0
  1195. package/node_modules/@comis/core/dist/hooks/hook-strategies.test.js +209 -0
  1196. package/node_modules/@comis/core/dist/hooks/index.d.ts +6 -0
  1197. package/node_modules/@comis/core/dist/hooks/index.js +6 -0
  1198. package/node_modules/@comis/core/dist/hooks/integration.test.d.ts +1 -0
  1199. package/node_modules/@comis/core/dist/hooks/integration.test.js +235 -0
  1200. package/node_modules/@comis/core/dist/hooks/plugin-registry.d.ts +49 -0
  1201. package/node_modules/@comis/core/dist/hooks/plugin-registry.js +176 -0
  1202. package/node_modules/@comis/core/dist/hooks/plugin-registry.test.d.ts +1 -0
  1203. package/node_modules/@comis/core/dist/hooks/plugin-registry.test.js +470 -0
  1204. package/node_modules/@comis/core/dist/index.d.ts +7 -0
  1205. package/node_modules/@comis/core/dist/index.js +12 -0
  1206. package/node_modules/@comis/core/dist/load-env.d.ts +31 -0
  1207. package/node_modules/@comis/core/dist/load-env.js +83 -0
  1208. package/node_modules/@comis/core/dist/load-env.test.d.ts +1 -0
  1209. package/node_modules/@comis/core/dist/load-env.test.js +21 -0
  1210. package/node_modules/@comis/core/dist/ports/channel-plugin.d.ts +104 -0
  1211. package/node_modules/@comis/core/dist/ports/channel-plugin.js +59 -0
  1212. package/node_modules/@comis/core/dist/ports/channel.d.ts +223 -0
  1213. package/node_modules/@comis/core/dist/ports/channel.js +1 -0
  1214. package/node_modules/@comis/core/dist/ports/credential-mapping.d.ts +61 -0
  1215. package/node_modules/@comis/core/dist/ports/credential-mapping.js +1 -0
  1216. package/node_modules/@comis/core/dist/ports/delivery-mirror.d.ts +87 -0
  1217. package/node_modules/@comis/core/dist/ports/delivery-mirror.js +29 -0
  1218. package/node_modules/@comis/core/dist/ports/delivery-queue.d.ts +114 -0
  1219. package/node_modules/@comis/core/dist/ports/delivery-queue.js +33 -0
  1220. package/node_modules/@comis/core/dist/ports/device-identity.d.ts +50 -0
  1221. package/node_modules/@comis/core/dist/ports/device-identity.js +14 -0
  1222. package/node_modules/@comis/core/dist/ports/embedding.d.ts +51 -0
  1223. package/node_modules/@comis/core/dist/ports/embedding.js +1 -0
  1224. package/node_modules/@comis/core/dist/ports/file-extraction-port.d.ts +82 -0
  1225. package/node_modules/@comis/core/dist/ports/file-extraction-port.js +1 -0
  1226. package/node_modules/@comis/core/dist/ports/hook-types.d.ts +218 -0
  1227. package/node_modules/@comis/core/dist/ports/hook-types.js +1 -0
  1228. package/node_modules/@comis/core/dist/ports/image-analysis-port.d.ts +27 -0
  1229. package/node_modules/@comis/core/dist/ports/image-analysis-port.js +1 -0
  1230. package/node_modules/@comis/core/dist/ports/index.d.ts +23 -0
  1231. package/node_modules/@comis/core/dist/ports/index.js +5 -0
  1232. package/node_modules/@comis/core/dist/ports/media-ports.d.ts +278 -0
  1233. package/node_modules/@comis/core/dist/ports/media-ports.js +1 -0
  1234. package/node_modules/@comis/core/dist/ports/media-resolver-port.d.ts +42 -0
  1235. package/node_modules/@comis/core/dist/ports/media-resolver-port.js +1 -0
  1236. package/node_modules/@comis/core/dist/ports/memory.d.ts +97 -0
  1237. package/node_modules/@comis/core/dist/ports/memory.js +1 -0
  1238. package/node_modules/@comis/core/dist/ports/output-guard.d.ts +22 -0
  1239. package/node_modules/@comis/core/dist/ports/output-guard.js +1 -0
  1240. package/node_modules/@comis/core/dist/ports/plugin.d.ts +87 -0
  1241. package/node_modules/@comis/core/dist/ports/plugin.js +1 -0
  1242. package/node_modules/@comis/core/dist/ports/provider.d.ts +44 -0
  1243. package/node_modules/@comis/core/dist/ports/provider.js +1 -0
  1244. package/node_modules/@comis/core/dist/ports/secret-store.d.ts +106 -0
  1245. package/node_modules/@comis/core/dist/ports/secret-store.js +1 -0
  1246. package/node_modules/@comis/core/dist/ports/skill.d.ts +92 -0
  1247. package/node_modules/@comis/core/dist/ports/skill.js +1 -0
  1248. package/node_modules/@comis/core/dist/ports/transcription-port.d.ts +39 -0
  1249. package/node_modules/@comis/core/dist/ports/transcription-port.js +1 -0
  1250. package/node_modules/@comis/core/dist/ports/tts-port.d.ts +37 -0
  1251. package/node_modules/@comis/core/dist/ports/tts-port.js +1 -0
  1252. package/node_modules/@comis/core/dist/ports/vision-port.d.ts +56 -0
  1253. package/node_modules/@comis/core/dist/ports/vision-port.js +1 -0
  1254. package/node_modules/@comis/core/dist/security/action-classifier.d.ts +64 -0
  1255. package/node_modules/@comis/core/dist/security/action-classifier.js +320 -0
  1256. package/node_modules/@comis/core/dist/security/action-classifier.test.d.ts +1 -0
  1257. package/node_modules/@comis/core/dist/security/action-classifier.test.js +298 -0
  1258. package/node_modules/@comis/core/dist/security/audit-aggregator.d.ts +38 -0
  1259. package/node_modules/@comis/core/dist/security/audit-aggregator.js +73 -0
  1260. package/node_modules/@comis/core/dist/security/audit-aggregator.test.d.ts +1 -0
  1261. package/node_modules/@comis/core/dist/security/audit-aggregator.test.js +128 -0
  1262. package/node_modules/@comis/core/dist/security/audit.d.ts +64 -0
  1263. package/node_modules/@comis/core/dist/security/audit.js +56 -0
  1264. package/node_modules/@comis/core/dist/security/audit.test.d.ts +1 -0
  1265. package/node_modules/@comis/core/dist/security/audit.test.js +154 -0
  1266. package/node_modules/@comis/core/dist/security/canary-token.d.ts +18 -0
  1267. package/node_modules/@comis/core/dist/security/canary-token.js +28 -0
  1268. package/node_modules/@comis/core/dist/security/canary-token.test.d.ts +1 -0
  1269. package/node_modules/@comis/core/dist/security/canary-token.test.js +45 -0
  1270. package/node_modules/@comis/core/dist/security/config-redaction.d.ts +19 -0
  1271. package/node_modules/@comis/core/dist/security/config-redaction.js +42 -0
  1272. package/node_modules/@comis/core/dist/security/config-redaction.test.d.ts +1 -0
  1273. package/node_modules/@comis/core/dist/security/config-redaction.test.js +107 -0
  1274. package/node_modules/@comis/core/dist/security/external-content.d.ts +57 -0
  1275. package/node_modules/@comis/core/dist/security/external-content.js +210 -0
  1276. package/node_modules/@comis/core/dist/security/external-content.test.d.ts +1 -0
  1277. package/node_modules/@comis/core/dist/security/external-content.test.js +210 -0
  1278. package/node_modules/@comis/core/dist/security/index.d.ts +38 -0
  1279. package/node_modules/@comis/core/dist/security/index.js +66 -0
  1280. package/node_modules/@comis/core/dist/security/injection-patterns.d.ts +9 -0
  1281. package/node_modules/@comis/core/dist/security/injection-patterns.js +10 -0
  1282. package/node_modules/@comis/core/dist/security/injection-patterns.test.d.ts +1 -0
  1283. package/node_modules/@comis/core/dist/security/injection-patterns.test.js +213 -0
  1284. package/node_modules/@comis/core/dist/security/injection-rate-limiter.d.ts +43 -0
  1285. package/node_modules/@comis/core/dist/security/injection-rate-limiter.js +108 -0
  1286. package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.d.ts +1 -0
  1287. package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.js +194 -0
  1288. package/node_modules/@comis/core/dist/security/input-guard.d.ts +46 -0
  1289. package/node_modules/@comis/core/dist/security/input-guard.js +166 -0
  1290. package/node_modules/@comis/core/dist/security/input-guard.test.d.ts +1 -0
  1291. package/node_modules/@comis/core/dist/security/input-guard.test.js +215 -0
  1292. package/node_modules/@comis/core/dist/security/input-security-guard.d.ts +45 -0
  1293. package/node_modules/@comis/core/dist/security/input-security-guard.js +166 -0
  1294. package/node_modules/@comis/core/dist/security/input-security-guard.test.d.ts +1 -0
  1295. package/node_modules/@comis/core/dist/security/input-security-guard.test.js +215 -0
  1296. package/node_modules/@comis/core/dist/security/input-validator.d.ts +37 -0
  1297. package/node_modules/@comis/core/dist/security/input-validator.js +68 -0
  1298. package/node_modules/@comis/core/dist/security/input-validator.test.d.ts +1 -0
  1299. package/node_modules/@comis/core/dist/security/input-validator.test.js +133 -0
  1300. package/node_modules/@comis/core/dist/security/log-sanitizer.d.ts +21 -0
  1301. package/node_modules/@comis/core/dist/security/log-sanitizer.js +83 -0
  1302. package/node_modules/@comis/core/dist/security/log-sanitizer.test.d.ts +1 -0
  1303. package/node_modules/@comis/core/dist/security/log-sanitizer.test.js +260 -0
  1304. package/node_modules/@comis/core/dist/security/memory-write-validator.d.ts +35 -0
  1305. package/node_modules/@comis/core/dist/security/memory-write-validator.js +42 -0
  1306. package/node_modules/@comis/core/dist/security/memory-write-validator.test.d.ts +1 -0
  1307. package/node_modules/@comis/core/dist/security/memory-write-validator.test.js +62 -0
  1308. package/node_modules/@comis/core/dist/security/output-guard.d.ts +17 -0
  1309. package/node_modules/@comis/core/dist/security/output-guard.js +94 -0
  1310. package/node_modules/@comis/core/dist/security/output-guard.test.d.ts +1 -0
  1311. package/node_modules/@comis/core/dist/security/output-guard.test.js +397 -0
  1312. package/node_modules/@comis/core/dist/security/patterns/content-scanner.d.ts +57 -0
  1313. package/node_modules/@comis/core/dist/security/patterns/content-scanner.js +70 -0
  1314. package/node_modules/@comis/core/dist/security/patterns/credential-log.d.ts +37 -0
  1315. package/node_modules/@comis/core/dist/security/patterns/credential-log.js +52 -0
  1316. package/node_modules/@comis/core/dist/security/patterns/dangerous-commands.d.ts +18 -0
  1317. package/node_modules/@comis/core/dist/security/patterns/dangerous-commands.js +24 -0
  1318. package/node_modules/@comis/core/dist/security/patterns/index.d.ts +8 -0
  1319. package/node_modules/@comis/core/dist/security/patterns/index.js +9 -0
  1320. package/node_modules/@comis/core/dist/security/patterns/invisible-chars.d.ts +85 -0
  1321. package/node_modules/@comis/core/dist/security/patterns/invisible-chars.js +94 -0
  1322. package/node_modules/@comis/core/dist/security/patterns/jailbreak.d.ts +45 -0
  1323. package/node_modules/@comis/core/dist/security/patterns/jailbreak.js +67 -0
  1324. package/node_modules/@comis/core/dist/security/patterns/prompt-extraction.d.ts +14 -0
  1325. package/node_modules/@comis/core/dist/security/patterns/prompt-extraction.js +18 -0
  1326. package/node_modules/@comis/core/dist/security/patterns/role-markers.d.ts +22 -0
  1327. package/node_modules/@comis/core/dist/security/patterns/role-markers.js +30 -0
  1328. package/node_modules/@comis/core/dist/security/patterns/secret-formats.d.ts +35 -0
  1329. package/node_modules/@comis/core/dist/security/patterns/secret-formats.js +52 -0
  1330. package/node_modules/@comis/core/dist/security/safe-path.d.ts +26 -0
  1331. package/node_modules/@comis/core/dist/security/safe-path.js +97 -0
  1332. package/node_modules/@comis/core/dist/security/safe-path.test.d.ts +1 -0
  1333. package/node_modules/@comis/core/dist/security/safe-path.test.js +95 -0
  1334. package/node_modules/@comis/core/dist/security/scoped-secret-manager.d.ts +38 -0
  1335. package/node_modules/@comis/core/dist/security/scoped-secret-manager.js +94 -0
  1336. package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.d.ts +1 -0
  1337. package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.js +231 -0
  1338. package/node_modules/@comis/core/dist/security/secret-access.d.ts +36 -0
  1339. package/node_modules/@comis/core/dist/security/secret-access.js +53 -0
  1340. package/node_modules/@comis/core/dist/security/secret-access.test.d.ts +1 -0
  1341. package/node_modules/@comis/core/dist/security/secret-access.test.js +41 -0
  1342. package/node_modules/@comis/core/dist/security/secret-crypto.d.ts +52 -0
  1343. package/node_modules/@comis/core/dist/security/secret-crypto.js +83 -0
  1344. package/node_modules/@comis/core/dist/security/secret-crypto.test.d.ts +1 -0
  1345. package/node_modules/@comis/core/dist/security/secret-crypto.test.js +113 -0
  1346. package/node_modules/@comis/core/dist/security/secret-manager.d.ts +77 -0
  1347. package/node_modules/@comis/core/dist/security/secret-manager.js +154 -0
  1348. package/node_modules/@comis/core/dist/security/secret-manager.test.d.ts +1 -0
  1349. package/node_modules/@comis/core/dist/security/secret-manager.test.js +394 -0
  1350. package/node_modules/@comis/core/dist/security/secret-ref-resolver.d.ts +66 -0
  1351. package/node_modules/@comis/core/dist/security/secret-ref-resolver.js +233 -0
  1352. package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.d.ts +1 -0
  1353. package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.js +268 -0
  1354. package/node_modules/@comis/core/dist/security/secrets-audit.d.ts +71 -0
  1355. package/node_modules/@comis/core/dist/security/secrets-audit.js +226 -0
  1356. package/node_modules/@comis/core/dist/security/secrets-audit.test.d.ts +10 -0
  1357. package/node_modules/@comis/core/dist/security/secrets-audit.test.js +295 -0
  1358. package/node_modules/@comis/core/dist/security/ssrf-guard.d.ts +53 -0
  1359. package/node_modules/@comis/core/dist/security/ssrf-guard.js +106 -0
  1360. package/node_modules/@comis/core/dist/security/ssrf-guard.test.d.ts +1 -0
  1361. package/node_modules/@comis/core/dist/security/ssrf-guard.test.js +127 -0
  1362. package/node_modules/@comis/core/dist/security/token-generator.d.ts +21 -0
  1363. package/node_modules/@comis/core/dist/security/token-generator.js +28 -0
  1364. package/node_modules/@comis/core/dist/security/token-generator.test.d.ts +1 -0
  1365. package/node_modules/@comis/core/dist/security/token-generator.test.js +35 -0
  1366. package/node_modules/@comis/core/dist/tool-metadata.d.ts +62 -0
  1367. package/node_modules/@comis/core/dist/tool-metadata.js +85 -0
  1368. package/node_modules/@comis/core/dist/tool-metadata.test.d.ts +1 -0
  1369. package/node_modules/@comis/core/dist/tool-metadata.test.js +112 -0
  1370. package/node_modules/@comis/core/package.json +44 -0
  1371. package/node_modules/@comis/daemon/bundled-skills/skill-creator/SKILL.md +320 -0
  1372. package/node_modules/@comis/daemon/bundled-skills/skill-creator/references/schema.md +101 -0
  1373. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/init-skill.py +137 -0
  1374. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/validate-skill.py +286 -0
  1375. package/node_modules/@comis/daemon/dist/announcement-batcher.d.ts +58 -0
  1376. package/node_modules/@comis/daemon/dist/announcement-batcher.js +229 -0
  1377. package/node_modules/@comis/daemon/dist/announcement-dead-letter.d.ts +71 -0
  1378. package/node_modules/@comis/daemon/dist/announcement-dead-letter.js +216 -0
  1379. package/node_modules/@comis/daemon/dist/config/exec-git.d.ts +14 -0
  1380. package/node_modules/@comis/daemon/dist/config/exec-git.js +30 -0
  1381. package/node_modules/@comis/daemon/dist/config/last-known-good.d.ts +43 -0
  1382. package/node_modules/@comis/daemon/dist/config/last-known-good.js +141 -0
  1383. package/node_modules/@comis/daemon/dist/cross-session-sender.d.ts +56 -0
  1384. package/node_modules/@comis/daemon/dist/cross-session-sender.js +144 -0
  1385. package/node_modules/@comis/daemon/dist/daemon-types.d.ts +113 -0
  1386. package/node_modules/@comis/daemon/dist/daemon-types.js +8 -0
  1387. package/node_modules/@comis/daemon/dist/daemon.d.ts +37 -0
  1388. package/node_modules/@comis/daemon/dist/daemon.js +1327 -0
  1389. package/node_modules/@comis/daemon/dist/device/device-identity.d.ts +29 -0
  1390. package/node_modules/@comis/daemon/dist/device/device-identity.js +95 -0
  1391. package/node_modules/@comis/daemon/dist/device/device-pairing.d.ts +31 -0
  1392. package/node_modules/@comis/daemon/dist/device/device-pairing.js +240 -0
  1393. package/node_modules/@comis/daemon/dist/graph/drivers/agent-driver.d.ts +8 -0
  1394. package/node_modules/@comis/daemon/dist/graph/drivers/agent-driver.js +41 -0
  1395. package/node_modules/@comis/daemon/dist/graph/drivers/approval-gate-driver.d.ts +10 -0
  1396. package/node_modules/@comis/daemon/dist/graph/drivers/approval-gate-driver.js +76 -0
  1397. package/node_modules/@comis/daemon/dist/graph/drivers/collaborate-driver.d.ts +9 -0
  1398. package/node_modules/@comis/daemon/dist/graph/drivers/collaborate-driver.js +87 -0
  1399. package/node_modules/@comis/daemon/dist/graph/drivers/debate-driver.d.ts +9 -0
  1400. package/node_modules/@comis/daemon/dist/graph/drivers/debate-driver.js +208 -0
  1401. package/node_modules/@comis/daemon/dist/graph/drivers/index.d.ts +7 -0
  1402. package/node_modules/@comis/daemon/dist/graph/drivers/index.js +8 -0
  1403. package/node_modules/@comis/daemon/dist/graph/drivers/map-reduce-driver.d.ts +10 -0
  1404. package/node_modules/@comis/daemon/dist/graph/drivers/map-reduce-driver.js +79 -0
  1405. package/node_modules/@comis/daemon/dist/graph/drivers/refine-driver.d.ts +9 -0
  1406. package/node_modules/@comis/daemon/dist/graph/drivers/refine-driver.js +67 -0
  1407. package/node_modules/@comis/daemon/dist/graph/drivers/vote-driver.d.ts +9 -0
  1408. package/node_modules/@comis/daemon/dist/graph/drivers/vote-driver.js +66 -0
  1409. package/node_modules/@comis/daemon/dist/graph/graph-cleanup.d.ts +18 -0
  1410. package/node_modules/@comis/daemon/dist/graph/graph-cleanup.js +69 -0
  1411. package/node_modules/@comis/daemon/dist/graph/graph-completion.d.ts +64 -0
  1412. package/node_modules/@comis/daemon/dist/graph/graph-completion.js +478 -0
  1413. package/node_modules/@comis/daemon/dist/graph/graph-concurrency.d.ts +54 -0
  1414. package/node_modules/@comis/daemon/dist/graph/graph-concurrency.js +77 -0
  1415. package/node_modules/@comis/daemon/dist/graph/graph-coordinator-state.d.ts +233 -0
  1416. package/node_modules/@comis/daemon/dist/graph/graph-coordinator-state.js +9 -0
  1417. package/node_modules/@comis/daemon/dist/graph/graph-coordinator.d.ts +44 -0
  1418. package/node_modules/@comis/daemon/dist/graph/graph-coordinator.js +344 -0
  1419. package/node_modules/@comis/daemon/dist/graph/graph-driver-handler.d.ts +62 -0
  1420. package/node_modules/@comis/daemon/dist/graph/graph-driver-handler.js +611 -0
  1421. package/node_modules/@comis/daemon/dist/graph/graph-node-lifecycle.d.ts +97 -0
  1422. package/node_modules/@comis/daemon/dist/graph/graph-node-lifecycle.js +611 -0
  1423. package/node_modules/@comis/daemon/dist/graph/graph-prewarm.d.ts +65 -0
  1424. package/node_modules/@comis/daemon/dist/graph/graph-prewarm.js +95 -0
  1425. package/node_modules/@comis/daemon/dist/graph/graph-state-machine.d.ts +77 -0
  1426. package/node_modules/@comis/daemon/dist/graph/graph-state-machine.js +439 -0
  1427. package/node_modules/@comis/daemon/dist/graph/graph-tool-superset.d.ts +33 -0
  1428. package/node_modules/@comis/daemon/dist/graph/graph-tool-superset.js +74 -0
  1429. package/node_modules/@comis/daemon/dist/graph/index.d.ts +7 -0
  1430. package/node_modules/@comis/daemon/dist/graph/index.js +7 -0
  1431. package/node_modules/@comis/daemon/dist/graph/node-type-registry.d.ts +18 -0
  1432. package/node_modules/@comis/daemon/dist/graph/node-type-registry.js +45 -0
  1433. package/node_modules/@comis/daemon/dist/graph/template-interpolation.d.ts +73 -0
  1434. package/node_modules/@comis/daemon/dist/graph/template-interpolation.js +205 -0
  1435. package/node_modules/@comis/daemon/dist/graph/user-variables.d.ts +45 -0
  1436. package/node_modules/@comis/daemon/dist/graph/user-variables.js +68 -0
  1437. package/node_modules/@comis/daemon/dist/health/index.d.ts +1 -0
  1438. package/node_modules/@comis/daemon/dist/health/index.js +3 -0
  1439. package/node_modules/@comis/daemon/dist/health/watchdog.d.ts +50 -0
  1440. package/node_modules/@comis/daemon/dist/health/watchdog.js +84 -0
  1441. package/node_modules/@comis/daemon/dist/index.d.ts +9 -0
  1442. package/node_modules/@comis/daemon/dist/index.js +12 -0
  1443. package/node_modules/@comis/daemon/dist/monitoring/disk-space-source.d.ts +14 -0
  1444. package/node_modules/@comis/daemon/dist/monitoring/disk-space-source.js +71 -0
  1445. package/node_modules/@comis/daemon/dist/monitoring/exec-helpers.d.ts +31 -0
  1446. package/node_modules/@comis/daemon/dist/monitoring/exec-helpers.js +44 -0
  1447. package/node_modules/@comis/daemon/dist/monitoring/git-watcher-source.d.ts +15 -0
  1448. package/node_modules/@comis/daemon/dist/monitoring/git-watcher-source.js +104 -0
  1449. package/node_modules/@comis/daemon/dist/monitoring/index.d.ts +5 -0
  1450. package/node_modules/@comis/daemon/dist/monitoring/index.js +7 -0
  1451. package/node_modules/@comis/daemon/dist/monitoring/security-update-source.d.ts +14 -0
  1452. package/node_modules/@comis/daemon/dist/monitoring/security-update-source.js +141 -0
  1453. package/node_modules/@comis/daemon/dist/monitoring/system-resources-source.d.ts +15 -0
  1454. package/node_modules/@comis/daemon/dist/monitoring/system-resources-source.js +197 -0
  1455. package/node_modules/@comis/daemon/dist/monitoring/systemd-service-source.d.ts +14 -0
  1456. package/node_modules/@comis/daemon/dist/monitoring/systemd-service-source.js +115 -0
  1457. package/node_modules/@comis/daemon/dist/notification/channel-resolver.d.ts +40 -0
  1458. package/node_modules/@comis/daemon/dist/notification/channel-resolver.js +33 -0
  1459. package/node_modules/@comis/daemon/dist/notification/notification-service.d.ts +48 -0
  1460. package/node_modules/@comis/daemon/dist/notification/notification-service.js +150 -0
  1461. package/node_modules/@comis/daemon/dist/notification/rate-limiter.d.ts +15 -0
  1462. package/node_modules/@comis/daemon/dist/notification/rate-limiter.js +28 -0
  1463. package/node_modules/@comis/daemon/dist/notification/session-tracker.d.ts +23 -0
  1464. package/node_modules/@comis/daemon/dist/notification/session-tracker.js +40 -0
  1465. package/node_modules/@comis/daemon/dist/observability/billing-estimator.d.ts +63 -0
  1466. package/node_modules/@comis/daemon/dist/observability/billing-estimator.js +98 -0
  1467. package/node_modules/@comis/daemon/dist/observability/channel-activity-tracker.d.ts +36 -0
  1468. package/node_modules/@comis/daemon/dist/observability/channel-activity-tracker.js +97 -0
  1469. package/node_modules/@comis/daemon/dist/observability/channel-health-logger.d.ts +25 -0
  1470. package/node_modules/@comis/daemon/dist/observability/channel-health-logger.js +82 -0
  1471. package/node_modules/@comis/daemon/dist/observability/context-pipeline-collector.d.ts +73 -0
  1472. package/node_modules/@comis/daemon/dist/observability/context-pipeline-collector.js +132 -0
  1473. package/node_modules/@comis/daemon/dist/observability/delivery-context.d.ts +37 -0
  1474. package/node_modules/@comis/daemon/dist/observability/delivery-context.js +1 -0
  1475. package/node_modules/@comis/daemon/dist/observability/delivery-queue-logger.d.ts +25 -0
  1476. package/node_modules/@comis/daemon/dist/observability/delivery-queue-logger.js +99 -0
  1477. package/node_modules/@comis/daemon/dist/observability/delivery-tracer.d.ts +59 -0
  1478. package/node_modules/@comis/daemon/dist/observability/delivery-tracer.js +150 -0
  1479. package/node_modules/@comis/daemon/dist/observability/diagnostic-collector.d.ts +46 -0
  1480. package/node_modules/@comis/daemon/dist/observability/diagnostic-collector.js +129 -0
  1481. package/node_modules/@comis/daemon/dist/observability/index.d.ts +30 -0
  1482. package/node_modules/@comis/daemon/dist/observability/index.js +30 -0
  1483. package/node_modules/@comis/daemon/dist/observability/latency-recorder.d.ts +54 -0
  1484. package/node_modules/@comis/daemon/dist/observability/latency-recorder.js +85 -0
  1485. package/node_modules/@comis/daemon/dist/observability/log-infra.d.ts +57 -0
  1486. package/node_modules/@comis/daemon/dist/observability/log-infra.js +104 -0
  1487. package/node_modules/@comis/daemon/dist/observability/log-level-manager.d.ts +23 -0
  1488. package/node_modules/@comis/daemon/dist/observability/log-level-manager.js +34 -0
  1489. package/node_modules/@comis/daemon/dist/observability/log-transport.d.ts +44 -0
  1490. package/node_modules/@comis/daemon/dist/observability/log-transport.js +74 -0
  1491. package/node_modules/@comis/daemon/dist/observability/obs-persistence-wiring.d.ts +82 -0
  1492. package/node_modules/@comis/daemon/dist/observability/obs-persistence-wiring.js +213 -0
  1493. package/node_modules/@comis/daemon/dist/observability/obs-write-buffer.d.ts +53 -0
  1494. package/node_modules/@comis/daemon/dist/observability/obs-write-buffer.js +68 -0
  1495. package/node_modules/@comis/daemon/dist/observability/token-tracker.d.ts +70 -0
  1496. package/node_modules/@comis/daemon/dist/observability/token-tracker.js +120 -0
  1497. package/node_modules/@comis/daemon/dist/observability/trace-logger.d.ts +17 -0
  1498. package/node_modules/@comis/daemon/dist/observability/trace-logger.js +37 -0
  1499. package/node_modules/@comis/daemon/dist/observability/types.d.ts +6 -0
  1500. package/node_modules/@comis/daemon/dist/observability/types.js +1 -0
  1501. package/node_modules/@comis/daemon/dist/process/graceful-shutdown.d.ts +50 -0
  1502. package/node_modules/@comis/daemon/dist/process/graceful-shutdown.js +126 -0
  1503. package/node_modules/@comis/daemon/dist/process/index.d.ts +2 -0
  1504. package/node_modules/@comis/daemon/dist/process/index.js +4 -0
  1505. package/node_modules/@comis/daemon/dist/process/process-monitor.d.ts +52 -0
  1506. package/node_modules/@comis/daemon/dist/process/process-monitor.js +69 -0
  1507. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.d.ts +40 -0
  1508. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.js +293 -0
  1509. package/node_modules/@comis/daemon/dist/rpc/approval-handlers.d.ts +18 -0
  1510. package/node_modules/@comis/daemon/dist/rpc/approval-handlers.js +68 -0
  1511. package/node_modules/@comis/daemon/dist/rpc/browser-handlers.d.ts +22 -0
  1512. package/node_modules/@comis/daemon/dist/rpc/browser-handlers.js +118 -0
  1513. package/node_modules/@comis/daemon/dist/rpc/channel-handlers.d.ts +34 -0
  1514. package/node_modules/@comis/daemon/dist/rpc/channel-handlers.js +217 -0
  1515. package/node_modules/@comis/daemon/dist/rpc/config-handlers.d.ts +95 -0
  1516. package/node_modules/@comis/daemon/dist/rpc/config-handlers.js +855 -0
  1517. package/node_modules/@comis/daemon/dist/rpc/context-handlers.d.ts +42 -0
  1518. package/node_modules/@comis/daemon/dist/rpc/context-handlers.js +371 -0
  1519. package/node_modules/@comis/daemon/dist/rpc/cron-handlers.d.ts +22 -0
  1520. package/node_modules/@comis/daemon/dist/rpc/cron-handlers.js +204 -0
  1521. package/node_modules/@comis/daemon/dist/rpc/daemon-handlers.d.ts +19 -0
  1522. package/node_modules/@comis/daemon/dist/rpc/daemon-handlers.js +49 -0
  1523. package/node_modules/@comis/daemon/dist/rpc/env-handlers.d.ts +26 -0
  1524. package/node_modules/@comis/daemon/dist/rpc/env-handlers.js +289 -0
  1525. package/node_modules/@comis/daemon/dist/rpc/graph-handlers.d.ts +84 -0
  1526. package/node_modules/@comis/daemon/dist/rpc/graph-handlers.js +803 -0
  1527. package/node_modules/@comis/daemon/dist/rpc/heartbeat-handlers.d.ts +30 -0
  1528. package/node_modules/@comis/daemon/dist/rpc/heartbeat-handlers.js +195 -0
  1529. package/node_modules/@comis/daemon/dist/rpc/image-handlers.d.ts +28 -0
  1530. package/node_modules/@comis/daemon/dist/rpc/image-handlers.js +95 -0
  1531. package/node_modules/@comis/daemon/dist/rpc/index.d.ts +24 -0
  1532. package/node_modules/@comis/daemon/dist/rpc/index.js +23 -0
  1533. package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.d.ts +24 -0
  1534. package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.js +195 -0
  1535. package/node_modules/@comis/daemon/dist/rpc/media-handlers.d.ts +59 -0
  1536. package/node_modules/@comis/daemon/dist/rpc/media-handlers.js +480 -0
  1537. package/node_modules/@comis/daemon/dist/rpc/memory-handlers.d.ts +36 -0
  1538. package/node_modules/@comis/daemon/dist/rpc/memory-handlers.js +246 -0
  1539. package/node_modules/@comis/daemon/dist/rpc/message-handlers.d.ts +40 -0
  1540. package/node_modules/@comis/daemon/dist/rpc/message-handlers.js +296 -0
  1541. package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +26 -0
  1542. package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +100 -0
  1543. package/node_modules/@comis/daemon/dist/rpc/notification-handlers.d.ts +25 -0
  1544. package/node_modules/@comis/daemon/dist/rpc/notification-handlers.js +56 -0
  1545. package/node_modules/@comis/daemon/dist/rpc/obs-handlers.d.ts +86 -0
  1546. package/node_modules/@comis/daemon/dist/rpc/obs-handlers.js +570 -0
  1547. package/node_modules/@comis/daemon/dist/rpc/persist-to-config.d.ts +74 -0
  1548. package/node_modules/@comis/daemon/dist/rpc/persist-to-config.js +204 -0
  1549. package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.d.ts +200 -0
  1550. package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.js +199 -0
  1551. package/node_modules/@comis/daemon/dist/rpc/session-handlers.d.ts +73 -0
  1552. package/node_modules/@comis/daemon/dist/rpc/session-handlers.js +828 -0
  1553. package/node_modules/@comis/daemon/dist/rpc/skill-handlers.d.ts +34 -0
  1554. package/node_modules/@comis/daemon/dist/rpc/skill-handlers.js +444 -0
  1555. package/node_modules/@comis/daemon/dist/rpc/subagent-handlers.d.ts +25 -0
  1556. package/node_modules/@comis/daemon/dist/rpc/subagent-handlers.js +80 -0
  1557. package/node_modules/@comis/daemon/dist/rpc/token-handlers.d.ts +56 -0
  1558. package/node_modules/@comis/daemon/dist/rpc/token-handlers.js +212 -0
  1559. package/node_modules/@comis/daemon/dist/rpc/types.d.ts +2 -0
  1560. package/node_modules/@comis/daemon/dist/rpc/types.js +1 -0
  1561. package/node_modules/@comis/daemon/dist/rpc/workspace-handlers.d.ts +34 -0
  1562. package/node_modules/@comis/daemon/dist/rpc/workspace-handlers.js +424 -0
  1563. package/node_modules/@comis/daemon/dist/sub-agent-result-processor.d.ts +143 -0
  1564. package/node_modules/@comis/daemon/dist/sub-agent-result-processor.js +493 -0
  1565. package/node_modules/@comis/daemon/dist/sub-agent-runner.d.ts +321 -0
  1566. package/node_modules/@comis/daemon/dist/sub-agent-runner.js +1224 -0
  1567. package/node_modules/@comis/daemon/dist/wiring/daemon-context.d.ts +149 -0
  1568. package/node_modules/@comis/daemon/dist/wiring/daemon-context.js +13 -0
  1569. package/node_modules/@comis/daemon/dist/wiring/daemon-utils.d.ts +40 -0
  1570. package/node_modules/@comis/daemon/dist/wiring/daemon-utils.js +109 -0
  1571. package/node_modules/@comis/daemon/dist/wiring/index.d.ts +19 -0
  1572. package/node_modules/@comis/daemon/dist/wiring/index.js +18 -0
  1573. package/node_modules/@comis/daemon/dist/wiring/restart-continuation.d.ts +59 -0
  1574. package/node_modules/@comis/daemon/dist/wiring/restart-continuation.js +113 -0
  1575. package/node_modules/@comis/daemon/dist/wiring/seed-bundled-skills.d.ts +41 -0
  1576. package/node_modules/@comis/daemon/dist/wiring/seed-bundled-skills.js +84 -0
  1577. package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +182 -0
  1578. package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +455 -0
  1579. package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.d.ts +28 -0
  1580. package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.js +30 -0
  1581. package/node_modules/@comis/daemon/dist/wiring/setup-channels-adapters.d.ts +42 -0
  1582. package/node_modules/@comis/daemon/dist/wiring/setup-channels-adapters.js +296 -0
  1583. package/node_modules/@comis/daemon/dist/wiring/setup-channels-media.d.ts +54 -0
  1584. package/node_modules/@comis/daemon/dist/wiring/setup-channels-media.js +332 -0
  1585. package/node_modules/@comis/daemon/dist/wiring/setup-channels.d.ts +161 -0
  1586. package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +731 -0
  1587. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.d.ts +108 -0
  1588. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +732 -0
  1589. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-mirror.d.ts +24 -0
  1590. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-mirror.js +88 -0
  1591. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-queue.d.ts +31 -0
  1592. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-queue.js +132 -0
  1593. package/node_modules/@comis/daemon/dist/wiring/setup-delivery.d.ts +48 -0
  1594. package/node_modules/@comis/daemon/dist/wiring/setup-delivery.js +225 -0
  1595. package/node_modules/@comis/daemon/dist/wiring/setup-gateway-routes.d.ts +48 -0
  1596. package/node_modules/@comis/daemon/dist/wiring/setup-gateway-routes.js +262 -0
  1597. package/node_modules/@comis/daemon/dist/wiring/setup-gateway-rpc.d.ts +31 -0
  1598. package/node_modules/@comis/daemon/dist/wiring/setup-gateway-rpc.js +234 -0
  1599. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.d.ts +146 -0
  1600. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +690 -0
  1601. package/node_modules/@comis/daemon/dist/wiring/setup-health.d.ts +59 -0
  1602. package/node_modules/@comis/daemon/dist/wiring/setup-health.js +138 -0
  1603. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.d.ts +63 -0
  1604. package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.js +111 -0
  1605. package/node_modules/@comis/daemon/dist/wiring/setup-logging.d.ts +38 -0
  1606. package/node_modules/@comis/daemon/dist/wiring/setup-logging.js +78 -0
  1607. package/node_modules/@comis/daemon/dist/wiring/setup-mcp.d.ts +47 -0
  1608. package/node_modules/@comis/daemon/dist/wiring/setup-mcp.js +182 -0
  1609. package/node_modules/@comis/daemon/dist/wiring/setup-media.d.ts +48 -0
  1610. package/node_modules/@comis/daemon/dist/wiring/setup-media.js +193 -0
  1611. package/node_modules/@comis/daemon/dist/wiring/setup-memory.d.ts +56 -0
  1612. package/node_modules/@comis/daemon/dist/wiring/setup-memory.js +214 -0
  1613. package/node_modules/@comis/daemon/dist/wiring/setup-monitoring.d.ts +38 -0
  1614. package/node_modules/@comis/daemon/dist/wiring/setup-monitoring.js +100 -0
  1615. package/node_modules/@comis/daemon/dist/wiring/setup-notifications.d.ts +43 -0
  1616. package/node_modules/@comis/daemon/dist/wiring/setup-notifications.js +53 -0
  1617. package/node_modules/@comis/daemon/dist/wiring/setup-observability.d.ts +48 -0
  1618. package/node_modules/@comis/daemon/dist/wiring/setup-observability.js +106 -0
  1619. package/node_modules/@comis/daemon/dist/wiring/setup-rpc-bridge.d.ts +34 -0
  1620. package/node_modules/@comis/daemon/dist/wiring/setup-rpc-bridge.js +52 -0
  1621. package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.d.ts +84 -0
  1622. package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.js +327 -0
  1623. package/node_modules/@comis/daemon/dist/wiring/setup-shutdown.d.ts +135 -0
  1624. package/node_modules/@comis/daemon/dist/wiring/setup-shutdown.js +308 -0
  1625. package/node_modules/@comis/daemon/dist/wiring/setup-task-extraction.d.ts +41 -0
  1626. package/node_modules/@comis/daemon/dist/wiring/setup-task-extraction.js +86 -0
  1627. package/node_modules/@comis/daemon/dist/wiring/setup-tools.d.ts +104 -0
  1628. package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +440 -0
  1629. package/node_modules/@comis/daemon/dist/wiring/startup-dry-run.d.ts +41 -0
  1630. package/node_modules/@comis/daemon/dist/wiring/startup-dry-run.js +88 -0
  1631. package/node_modules/@comis/daemon/package.json +50 -0
  1632. package/node_modules/@comis/gateway/dist/acp/acp-server.d.ts +74 -0
  1633. package/node_modules/@comis/gateway/dist/acp/acp-server.js +122 -0
  1634. package/node_modules/@comis/gateway/dist/acp/acp-session-map.d.ts +39 -0
  1635. package/node_modules/@comis/gateway/dist/acp/acp-session-map.js +50 -0
  1636. package/node_modules/@comis/gateway/dist/acp/index.d.ts +4 -0
  1637. package/node_modules/@comis/gateway/dist/acp/index.js +4 -0
  1638. package/node_modules/@comis/gateway/dist/auth/mtls-verifier.d.ts +24 -0
  1639. package/node_modules/@comis/gateway/dist/auth/mtls-verifier.js +70 -0
  1640. package/node_modules/@comis/gateway/dist/auth/token-auth.d.ts +54 -0
  1641. package/node_modules/@comis/gateway/dist/auth/token-auth.js +56 -0
  1642. package/node_modules/@comis/gateway/dist/discovery/index.d.ts +1 -0
  1643. package/node_modules/@comis/gateway/dist/discovery/index.js +3 -0
  1644. package/node_modules/@comis/gateway/dist/discovery/mdns-advertiser.d.ts +45 -0
  1645. package/node_modules/@comis/gateway/dist/discovery/mdns-advertiser.js +63 -0
  1646. package/node_modules/@comis/gateway/dist/index.d.ts +19 -0
  1647. package/node_modules/@comis/gateway/dist/index.js +30 -0
  1648. package/node_modules/@comis/gateway/dist/openai/index.d.ts +8 -0
  1649. package/node_modules/@comis/gateway/dist/openai/index.js +6 -0
  1650. package/node_modules/@comis/gateway/dist/openai/openai-completions.d.ts +60 -0
  1651. package/node_modules/@comis/gateway/dist/openai/openai-completions.js +236 -0
  1652. package/node_modules/@comis/gateway/dist/openai/openai-embeddings.d.ts +68 -0
  1653. package/node_modules/@comis/gateway/dist/openai/openai-embeddings.js +90 -0
  1654. package/node_modules/@comis/gateway/dist/openai/openai-models.d.ts +37 -0
  1655. package/node_modules/@comis/gateway/dist/openai/openai-models.js +59 -0
  1656. package/node_modules/@comis/gateway/dist/openai/openai-types.d.ts +115 -0
  1657. package/node_modules/@comis/gateway/dist/openai/openai-types.js +84 -0
  1658. package/node_modules/@comis/gateway/dist/rate-limit/rate-limiter.d.ts +40 -0
  1659. package/node_modules/@comis/gateway/dist/rate-limit/rate-limiter.js +83 -0
  1660. package/node_modules/@comis/gateway/dist/responses/index.d.ts +4 -0
  1661. package/node_modules/@comis/gateway/dist/responses/index.js +4 -0
  1662. package/node_modules/@comis/gateway/dist/responses/responses-endpoint.d.ts +57 -0
  1663. package/node_modules/@comis/gateway/dist/responses/responses-endpoint.js +293 -0
  1664. package/node_modules/@comis/gateway/dist/responses/responses-types.d.ts +148 -0
  1665. package/node_modules/@comis/gateway/dist/responses/responses-types.js +51 -0
  1666. package/node_modules/@comis/gateway/dist/rpc/method-router.d.ts +77 -0
  1667. package/node_modules/@comis/gateway/dist/rpc/method-router.js +223 -0
  1668. package/node_modules/@comis/gateway/dist/rpc/rpc-adapters.d.ts +120 -0
  1669. package/node_modules/@comis/gateway/dist/rpc/rpc-adapters.js +155 -0
  1670. package/node_modules/@comis/gateway/dist/rpc/ws-handler.d.ts +121 -0
  1671. package/node_modules/@comis/gateway/dist/rpc/ws-handler.js +313 -0
  1672. package/node_modules/@comis/gateway/dist/server/hono-server.d.ts +90 -0
  1673. package/node_modules/@comis/gateway/dist/server/hono-server.js +250 -0
  1674. package/node_modules/@comis/gateway/dist/web/index.d.ts +7 -0
  1675. package/node_modules/@comis/gateway/dist/web/index.js +6 -0
  1676. package/node_modules/@comis/gateway/dist/web/media-routes.d.ts +30 -0
  1677. package/node_modules/@comis/gateway/dist/web/media-routes.js +164 -0
  1678. package/node_modules/@comis/gateway/dist/web/rest-api.d.ts +83 -0
  1679. package/node_modules/@comis/gateway/dist/web/rest-api.js +300 -0
  1680. package/node_modules/@comis/gateway/dist/web/sse-endpoint.d.ts +32 -0
  1681. package/node_modules/@comis/gateway/dist/web/sse-endpoint.js +181 -0
  1682. package/node_modules/@comis/gateway/dist/web/static-middleware.d.ts +13 -0
  1683. package/node_modules/@comis/gateway/dist/web/static-middleware.js +59 -0
  1684. package/node_modules/@comis/gateway/dist/webhook/hmac-verifier.d.ts +61 -0
  1685. package/node_modules/@comis/gateway/dist/webhook/hmac-verifier.js +69 -0
  1686. package/node_modules/@comis/gateway/dist/webhook/webhook-endpoint.d.ts +115 -0
  1687. package/node_modules/@comis/gateway/dist/webhook/webhook-endpoint.js +186 -0
  1688. package/node_modules/@comis/gateway/dist/webhook/webhook-mapping.d.ts +69 -0
  1689. package/node_modules/@comis/gateway/dist/webhook/webhook-mapping.js +149 -0
  1690. package/node_modules/@comis/gateway/dist/webhook/webhook-presets.d.ts +27 -0
  1691. package/node_modules/@comis/gateway/dist/webhook/webhook-presets.js +57 -0
  1692. package/node_modules/@comis/gateway/package.json +45 -0
  1693. package/node_modules/@comis/infra/dist/index.d.ts +4 -0
  1694. package/node_modules/@comis/infra/dist/index.js +5 -0
  1695. package/node_modules/@comis/infra/dist/logging/index.d.ts +4 -0
  1696. package/node_modules/@comis/infra/dist/logging/index.js +4 -0
  1697. package/node_modules/@comis/infra/dist/logging/log-fields.d.ts +164 -0
  1698. package/node_modules/@comis/infra/dist/logging/log-fields.js +19 -0
  1699. package/node_modules/@comis/infra/dist/logging/logger.d.ts +39 -0
  1700. package/node_modules/@comis/infra/dist/logging/logger.js +152 -0
  1701. package/node_modules/@comis/infra/package.json +43 -0
  1702. package/node_modules/@comis/memory/dist/compaction.d.ts +85 -0
  1703. package/node_modules/@comis/memory/dist/compaction.js +181 -0
  1704. package/node_modules/@comis/memory/dist/compaction.test.d.ts +1 -0
  1705. package/node_modules/@comis/memory/dist/compaction.test.js +298 -0
  1706. package/node_modules/@comis/memory/dist/context-schema.d.ts +24 -0
  1707. package/node_modules/@comis/memory/dist/context-schema.js +161 -0
  1708. package/node_modules/@comis/memory/dist/context-schema.test.d.ts +1 -0
  1709. package/node_modules/@comis/memory/dist/context-schema.test.js +246 -0
  1710. package/node_modules/@comis/memory/dist/context-store.d.ts +139 -0
  1711. package/node_modules/@comis/memory/dist/context-store.js +450 -0
  1712. package/node_modules/@comis/memory/dist/context-store.test.d.ts +1 -0
  1713. package/node_modules/@comis/memory/dist/context-store.test.js +708 -0
  1714. package/node_modules/@comis/memory/dist/credential-mapping-schema.d.ts +25 -0
  1715. package/node_modules/@comis/memory/dist/credential-mapping-schema.js +40 -0
  1716. package/node_modules/@comis/memory/dist/credential-mapping-schema.test.d.ts +7 -0
  1717. package/node_modules/@comis/memory/dist/credential-mapping-schema.test.js +73 -0
  1718. package/node_modules/@comis/memory/dist/credential-mapping-store.d.ts +22 -0
  1719. package/node_modules/@comis/memory/dist/credential-mapping-store.js +98 -0
  1720. package/node_modules/@comis/memory/dist/credential-mapping-store.test.d.ts +8 -0
  1721. package/node_modules/@comis/memory/dist/credential-mapping-store.test.js +340 -0
  1722. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.d.ts +21 -0
  1723. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.js +112 -0
  1724. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.d.ts +1 -0
  1725. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.js +165 -0
  1726. package/node_modules/@comis/memory/dist/delivery-queue-adapter.d.ts +21 -0
  1727. package/node_modules/@comis/memory/dist/delivery-queue-adapter.js +197 -0
  1728. package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.d.ts +1 -0
  1729. package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.js +263 -0
  1730. package/node_modules/@comis/memory/dist/embedding-batch-indexer.d.ts +50 -0
  1731. package/node_modules/@comis/memory/dist/embedding-batch-indexer.js +104 -0
  1732. package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.d.ts +1 -0
  1733. package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.js +202 -0
  1734. package/node_modules/@comis/memory/dist/embedding-cache-lru.d.ts +36 -0
  1735. package/node_modules/@comis/memory/dist/embedding-cache-lru.js +100 -0
  1736. package/node_modules/@comis/memory/dist/embedding-cache-lru.test.d.ts +1 -0
  1737. package/node_modules/@comis/memory/dist/embedding-cache-lru.test.js +241 -0
  1738. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.d.ts +36 -0
  1739. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.js +247 -0
  1740. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.d.ts +8 -0
  1741. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.js +678 -0
  1742. package/node_modules/@comis/memory/dist/embedding-cache.d.ts +36 -0
  1743. package/node_modules/@comis/memory/dist/embedding-cache.js +94 -0
  1744. package/node_modules/@comis/memory/dist/embedding-cache.test.d.ts +1 -0
  1745. package/node_modules/@comis/memory/dist/embedding-cache.test.js +213 -0
  1746. package/node_modules/@comis/memory/dist/embedding-fingerprint.d.ts +35 -0
  1747. package/node_modules/@comis/memory/dist/embedding-fingerprint.js +75 -0
  1748. package/node_modules/@comis/memory/dist/embedding-fingerprint.test.d.ts +1 -0
  1749. package/node_modules/@comis/memory/dist/embedding-fingerprint.test.js +87 -0
  1750. package/node_modules/@comis/memory/dist/embedding-hash.d.ts +9 -0
  1751. package/node_modules/@comis/memory/dist/embedding-hash.js +14 -0
  1752. package/node_modules/@comis/memory/dist/embedding-hash.test.d.ts +1 -0
  1753. package/node_modules/@comis/memory/dist/embedding-hash.test.js +31 -0
  1754. package/node_modules/@comis/memory/dist/embedding-integration.test.d.ts +8 -0
  1755. package/node_modules/@comis/memory/dist/embedding-integration.test.js +232 -0
  1756. package/node_modules/@comis/memory/dist/embedding-provider-factory.d.ts +40 -0
  1757. package/node_modules/@comis/memory/dist/embedding-provider-factory.js +59 -0
  1758. package/node_modules/@comis/memory/dist/embedding-provider-factory.test.d.ts +1 -0
  1759. package/node_modules/@comis/memory/dist/embedding-provider-factory.test.js +176 -0
  1760. package/node_modules/@comis/memory/dist/embedding-provider-local.d.ts +32 -0
  1761. package/node_modules/@comis/memory/dist/embedding-provider-local.js +83 -0
  1762. package/node_modules/@comis/memory/dist/embedding-provider-local.test.d.ts +8 -0
  1763. package/node_modules/@comis/memory/dist/embedding-provider-local.test.js +76 -0
  1764. package/node_modules/@comis/memory/dist/embedding-provider-openai.d.ts +29 -0
  1765. package/node_modules/@comis/memory/dist/embedding-provider-openai.js +60 -0
  1766. package/node_modules/@comis/memory/dist/embedding-provider-openai.test.d.ts +8 -0
  1767. package/node_modules/@comis/memory/dist/embedding-provider-openai.test.js +100 -0
  1768. package/node_modules/@comis/memory/dist/embedding-queue.d.ts +48 -0
  1769. package/node_modules/@comis/memory/dist/embedding-queue.js +66 -0
  1770. package/node_modules/@comis/memory/dist/embedding-queue.test.d.ts +1 -0
  1771. package/node_modules/@comis/memory/dist/embedding-queue.test.js +236 -0
  1772. package/node_modules/@comis/memory/dist/hybrid-search.d.ts +104 -0
  1773. package/node_modules/@comis/memory/dist/hybrid-search.js +255 -0
  1774. package/node_modules/@comis/memory/dist/hybrid-search.test.d.ts +1 -0
  1775. package/node_modules/@comis/memory/dist/hybrid-search.test.js +476 -0
  1776. package/node_modules/@comis/memory/dist/identity-link-store.d.ts +45 -0
  1777. package/node_modules/@comis/memory/dist/identity-link-store.js +63 -0
  1778. package/node_modules/@comis/memory/dist/identity-link-store.test.d.ts +1 -0
  1779. package/node_modules/@comis/memory/dist/identity-link-store.test.js +88 -0
  1780. package/node_modules/@comis/memory/dist/index.d.ts +36 -0
  1781. package/node_modules/@comis/memory/dist/index.js +44 -0
  1782. package/node_modules/@comis/memory/dist/memory-api.d.ts +85 -0
  1783. package/node_modules/@comis/memory/dist/memory-api.js +225 -0
  1784. package/node_modules/@comis/memory/dist/memory-api.test.d.ts +1 -0
  1785. package/node_modules/@comis/memory/dist/memory-api.test.js +495 -0
  1786. package/node_modules/@comis/memory/dist/memory-concurrency.test.d.ts +20 -0
  1787. package/node_modules/@comis/memory/dist/memory-concurrency.test.js +222 -0
  1788. package/node_modules/@comis/memory/dist/named-graph-schema.d.ts +23 -0
  1789. package/node_modules/@comis/memory/dist/named-graph-schema.js +42 -0
  1790. package/node_modules/@comis/memory/dist/named-graph-store.d.ts +65 -0
  1791. package/node_modules/@comis/memory/dist/named-graph-store.js +111 -0
  1792. package/node_modules/@comis/memory/dist/named-graph-store.test.d.ts +1 -0
  1793. package/node_modules/@comis/memory/dist/named-graph-store.test.js +227 -0
  1794. package/node_modules/@comis/memory/dist/observability-store.d.ts +184 -0
  1795. package/node_modules/@comis/memory/dist/observability-store.js +387 -0
  1796. package/node_modules/@comis/memory/dist/observability-store.test.d.ts +1 -0
  1797. package/node_modules/@comis/memory/dist/observability-store.test.js +704 -0
  1798. package/node_modules/@comis/memory/dist/row-mapper.d.ts +70 -0
  1799. package/node_modules/@comis/memory/dist/row-mapper.js +159 -0
  1800. package/node_modules/@comis/memory/dist/row-mapper.test.d.ts +1 -0
  1801. package/node_modules/@comis/memory/dist/row-mapper.test.js +409 -0
  1802. package/node_modules/@comis/memory/dist/schema.d.ts +31 -0
  1803. package/node_modules/@comis/memory/dist/schema.js +358 -0
  1804. package/node_modules/@comis/memory/dist/schema.test.d.ts +1 -0
  1805. package/node_modules/@comis/memory/dist/schema.test.js +240 -0
  1806. package/node_modules/@comis/memory/dist/secret-store-schema.d.ts +43 -0
  1807. package/node_modules/@comis/memory/dist/secret-store-schema.js +92 -0
  1808. package/node_modules/@comis/memory/dist/secret-store-schema.test.d.ts +7 -0
  1809. package/node_modules/@comis/memory/dist/secret-store-schema.test.js +90 -0
  1810. package/node_modules/@comis/memory/dist/session-store.d.ts +93 -0
  1811. package/node_modules/@comis/memory/dist/session-store.js +131 -0
  1812. package/node_modules/@comis/memory/dist/session-store.test.d.ts +1 -0
  1813. package/node_modules/@comis/memory/dist/session-store.test.js +262 -0
  1814. package/node_modules/@comis/memory/dist/setup-secrets.d.ts +35 -0
  1815. package/node_modules/@comis/memory/dist/setup-secrets.js +45 -0
  1816. package/node_modules/@comis/memory/dist/setup-secrets.test.d.ts +1 -0
  1817. package/node_modules/@comis/memory/dist/setup-secrets.test.js +140 -0
  1818. package/node_modules/@comis/memory/dist/sqlite-adapter-base.d.ts +39 -0
  1819. package/node_modules/@comis/memory/dist/sqlite-adapter-base.js +72 -0
  1820. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.d.ts +52 -0
  1821. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.js +378 -0
  1822. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.d.ts +1 -0
  1823. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.js +888 -0
  1824. package/node_modules/@comis/memory/dist/sqlite-secret-store.d.ts +32 -0
  1825. package/node_modules/@comis/memory/dist/sqlite-secret-store.js +153 -0
  1826. package/node_modules/@comis/memory/dist/sqlite-secret-store.test.d.ts +8 -0
  1827. package/node_modules/@comis/memory/dist/sqlite-secret-store.test.js +245 -0
  1828. package/node_modules/@comis/memory/dist/types.d.ts +192 -0
  1829. package/node_modules/@comis/memory/dist/types.js +8 -0
  1830. package/node_modules/@comis/memory/package.json +45 -0
  1831. package/node_modules/@comis/scheduler/dist/config/scheduler-config.d.ts +9 -0
  1832. package/node_modules/@comis/scheduler/dist/config/scheduler-config.js +9 -0
  1833. package/node_modules/@comis/scheduler/dist/cron/cron-expression.d.ts +12 -0
  1834. package/node_modules/@comis/scheduler/dist/cron/cron-expression.js +57 -0
  1835. package/node_modules/@comis/scheduler/dist/cron/cron-scheduler.d.ts +47 -0
  1836. package/node_modules/@comis/scheduler/dist/cron/cron-scheduler.js +214 -0
  1837. package/node_modules/@comis/scheduler/dist/cron/cron-store.d.ts +33 -0
  1838. package/node_modules/@comis/scheduler/dist/cron/cron-store.js +155 -0
  1839. package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +161 -0
  1840. package/node_modules/@comis/scheduler/dist/cron/cron-types.js +113 -0
  1841. package/node_modules/@comis/scheduler/dist/cron/index.d.ts +6 -0
  1842. package/node_modules/@comis/scheduler/dist/cron/index.js +8 -0
  1843. package/node_modules/@comis/scheduler/dist/execution/execution-lock.d.ts +32 -0
  1844. package/node_modules/@comis/scheduler/dist/execution/execution-lock.js +86 -0
  1845. package/node_modules/@comis/scheduler/dist/execution/execution-tracker.d.ts +68 -0
  1846. package/node_modules/@comis/scheduler/dist/execution/execution-tracker.js +124 -0
  1847. package/node_modules/@comis/scheduler/dist/execution/index.d.ts +2 -0
  1848. package/node_modules/@comis/scheduler/dist/execution/index.js +4 -0
  1849. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.d.ts +117 -0
  1850. package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.js +226 -0
  1851. package/node_modules/@comis/scheduler/dist/heartbeat/cron-delivery-policy.d.ts +28 -0
  1852. package/node_modules/@comis/scheduler/dist/heartbeat/cron-delivery-policy.js +33 -0
  1853. package/node_modules/@comis/scheduler/dist/heartbeat/cron-event-prompt.d.ts +21 -0
  1854. package/node_modules/@comis/scheduler/dist/heartbeat/cron-event-prompt.js +25 -0
  1855. package/node_modules/@comis/scheduler/dist/heartbeat/delivery-bridge.d.ts +61 -0
  1856. package/node_modules/@comis/scheduler/dist/heartbeat/delivery-bridge.js +110 -0
  1857. package/node_modules/@comis/scheduler/dist/heartbeat/duplicate-detector.d.ts +31 -0
  1858. package/node_modules/@comis/scheduler/dist/heartbeat/duplicate-detector.js +56 -0
  1859. package/node_modules/@comis/scheduler/dist/heartbeat/file-gate.d.ts +22 -0
  1860. package/node_modules/@comis/scheduler/dist/heartbeat/file-gate.js +29 -0
  1861. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-config.d.ts +27 -0
  1862. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-config.js +19 -0
  1863. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-runner.d.ts +75 -0
  1864. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-runner.js +136 -0
  1865. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-source.d.ts +34 -0
  1866. package/node_modules/@comis/scheduler/dist/heartbeat/heartbeat-source.js +9 -0
  1867. package/node_modules/@comis/scheduler/dist/heartbeat/index.d.ts +32 -0
  1868. package/node_modules/@comis/scheduler/dist/heartbeat/index.js +34 -0
  1869. package/node_modules/@comis/scheduler/dist/heartbeat/per-agent-heartbeat-runner.d.ts +52 -0
  1870. package/node_modules/@comis/scheduler/dist/heartbeat/per-agent-heartbeat-runner.js +227 -0
  1871. package/node_modules/@comis/scheduler/dist/heartbeat/prompt-builder.d.ts +43 -0
  1872. package/node_modules/@comis/scheduler/dist/heartbeat/prompt-builder.js +92 -0
  1873. package/node_modules/@comis/scheduler/dist/heartbeat/quiet-hours.d.ts +41 -0
  1874. package/node_modules/@comis/scheduler/dist/heartbeat/quiet-hours.js +75 -0
  1875. package/node_modules/@comis/scheduler/dist/heartbeat/relevance-filter.d.ts +49 -0
  1876. package/node_modules/@comis/scheduler/dist/heartbeat/relevance-filter.js +55 -0
  1877. package/node_modules/@comis/scheduler/dist/heartbeat/resilience-tracker.d.ts +53 -0
  1878. package/node_modules/@comis/scheduler/dist/heartbeat/resilience-tracker.js +81 -0
  1879. package/node_modules/@comis/scheduler/dist/heartbeat/response-cache.d.ts +42 -0
  1880. package/node_modules/@comis/scheduler/dist/heartbeat/response-cache.js +61 -0
  1881. package/node_modules/@comis/scheduler/dist/heartbeat/response-processor.d.ts +74 -0
  1882. package/node_modules/@comis/scheduler/dist/heartbeat/response-processor.js +120 -0
  1883. package/node_modules/@comis/scheduler/dist/heartbeat/wake-coalescer.d.ts +21 -0
  1884. package/node_modules/@comis/scheduler/dist/heartbeat/wake-coalescer.js +135 -0
  1885. package/node_modules/@comis/scheduler/dist/heartbeat/wake-types.d.ts +44 -0
  1886. package/node_modules/@comis/scheduler/dist/heartbeat/wake-types.js +22 -0
  1887. package/node_modules/@comis/scheduler/dist/index.d.ts +43 -0
  1888. package/node_modules/@comis/scheduler/dist/index.js +41 -0
  1889. package/node_modules/@comis/scheduler/dist/shared-types.d.ts +12 -0
  1890. package/node_modules/@comis/scheduler/dist/shared-types.js +1 -0
  1891. package/node_modules/@comis/scheduler/dist/system-events/index.d.ts +4 -0
  1892. package/node_modules/@comis/scheduler/dist/system-events/index.js +6 -0
  1893. package/node_modules/@comis/scheduler/dist/system-events/system-event-queue.d.ts +33 -0
  1894. package/node_modules/@comis/scheduler/dist/system-events/system-event-queue.js +63 -0
  1895. package/node_modules/@comis/scheduler/dist/system-events/system-event-types.d.ts +14 -0
  1896. package/node_modules/@comis/scheduler/dist/system-events/system-event-types.js +14 -0
  1897. package/node_modules/@comis/scheduler/dist/tasks/index.d.ts +8 -0
  1898. package/node_modules/@comis/scheduler/dist/tasks/index.js +6 -0
  1899. package/node_modules/@comis/scheduler/dist/tasks/task-extractor.d.ts +60 -0
  1900. package/node_modules/@comis/scheduler/dist/tasks/task-extractor.js +90 -0
  1901. package/node_modules/@comis/scheduler/dist/tasks/task-priority.d.ts +38 -0
  1902. package/node_modules/@comis/scheduler/dist/tasks/task-priority.js +65 -0
  1903. package/node_modules/@comis/scheduler/dist/tasks/task-store.d.ts +30 -0
  1904. package/node_modules/@comis/scheduler/dist/tasks/task-store.js +73 -0
  1905. package/node_modules/@comis/scheduler/dist/tasks/task-types.d.ts +92 -0
  1906. package/node_modules/@comis/scheduler/dist/tasks/task-types.js +50 -0
  1907. package/node_modules/@comis/scheduler/package.json +43 -0
  1908. package/node_modules/@comis/shared/dist/abort.d.ts +16 -0
  1909. package/node_modules/@comis/shared/dist/abort.js +24 -0
  1910. package/node_modules/@comis/shared/dist/abort.test.d.ts +1 -0
  1911. package/node_modules/@comis/shared/dist/abort.test.js +71 -0
  1912. package/node_modules/@comis/shared/dist/index.d.ts +7 -0
  1913. package/node_modules/@comis/shared/dist/index.js +7 -0
  1914. package/node_modules/@comis/shared/dist/result.d.ts +38 -0
  1915. package/node_modules/@comis/shared/dist/result.js +52 -0
  1916. package/node_modules/@comis/shared/dist/result.test.d.ts +1 -0
  1917. package/node_modules/@comis/shared/dist/result.test.js +178 -0
  1918. package/node_modules/@comis/shared/dist/suppress-error.d.ts +14 -0
  1919. package/node_modules/@comis/shared/dist/suppress-error.js +25 -0
  1920. package/node_modules/@comis/shared/dist/suppress-error.test.d.ts +1 -0
  1921. package/node_modules/@comis/shared/dist/suppress-error.test.js +50 -0
  1922. package/node_modules/@comis/shared/dist/timeout.d.ts +31 -0
  1923. package/node_modules/@comis/shared/dist/timeout.js +50 -0
  1924. package/node_modules/@comis/shared/dist/timeout.test.d.ts +1 -0
  1925. package/node_modules/@comis/shared/dist/timeout.test.js +75 -0
  1926. package/node_modules/@comis/shared/dist/ttl-cache.d.ts +41 -0
  1927. package/node_modules/@comis/shared/dist/ttl-cache.js +73 -0
  1928. package/node_modules/@comis/shared/dist/ttl-cache.test.d.ts +1 -0
  1929. package/node_modules/@comis/shared/dist/ttl-cache.test.js +81 -0
  1930. package/node_modules/@comis/shared/package.json +43 -0
  1931. package/node_modules/@comis/skills/dist/audit/skill-audit.d.ts +36 -0
  1932. package/node_modules/@comis/skills/dist/audit/skill-audit.js +72 -0
  1933. package/node_modules/@comis/skills/dist/bridge/credential-injector.d.ts +90 -0
  1934. package/node_modules/@comis/skills/dist/bridge/credential-injector.js +235 -0
  1935. package/node_modules/@comis/skills/dist/bridge/json-truncate.d.ts +33 -0
  1936. package/node_modules/@comis/skills/dist/bridge/json-truncate.js +185 -0
  1937. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.d.ts +81 -0
  1938. package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.js +260 -0
  1939. package/node_modules/@comis/skills/dist/bridge/tool-audit.d.ts +25 -0
  1940. package/node_modules/@comis/skills/dist/bridge/tool-audit.js +78 -0
  1941. package/node_modules/@comis/skills/dist/bridge/tool-bridge.d.ts +91 -0
  1942. package/node_modules/@comis/skills/dist/bridge/tool-bridge.js +136 -0
  1943. package/node_modules/@comis/skills/dist/bridge/tool-definition-adapter.d.ts +33 -0
  1944. package/node_modules/@comis/skills/dist/bridge/tool-definition-adapter.js +56 -0
  1945. package/node_modules/@comis/skills/dist/bridge/tool-metadata-enforcement.d.ts +45 -0
  1946. package/node_modules/@comis/skills/dist/bridge/tool-metadata-enforcement.js +101 -0
  1947. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.d.ts +13 -0
  1948. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +350 -0
  1949. package/node_modules/@comis/skills/dist/bridge/tool-output-schemas.d.ts +17 -0
  1950. package/node_modules/@comis/skills/dist/bridge/tool-output-schemas.js +125 -0
  1951. package/node_modules/@comis/skills/dist/bridge/tool-parallelism-metadata.d.ts +14 -0
  1952. package/node_modules/@comis/skills/dist/bridge/tool-parallelism-metadata.js +92 -0
  1953. package/node_modules/@comis/skills/dist/bridge/tool-result-caps.d.ts +14 -0
  1954. package/node_modules/@comis/skills/dist/bridge/tool-result-caps.js +36 -0
  1955. package/node_modules/@comis/skills/dist/bridge/tool-search-hints.d.ts +15 -0
  1956. package/node_modules/@comis/skills/dist/bridge/tool-search-hints.js +68 -0
  1957. package/node_modules/@comis/skills/dist/bridge/tool-validators.d.ts +11 -0
  1958. package/node_modules/@comis/skills/dist/bridge/tool-validators.js +105 -0
  1959. package/node_modules/@comis/skills/dist/browser/browser-service.d.ts +105 -0
  1960. package/node_modules/@comis/skills/dist/browser/browser-service.js +192 -0
  1961. package/node_modules/@comis/skills/dist/browser/cdp.d.ts +60 -0
  1962. package/node_modules/@comis/skills/dist/browser/cdp.js +91 -0
  1963. package/node_modules/@comis/skills/dist/browser/chrome-detection.d.ts +45 -0
  1964. package/node_modules/@comis/skills/dist/browser/chrome-detection.js +256 -0
  1965. package/node_modules/@comis/skills/dist/browser/config.d.ts +45 -0
  1966. package/node_modules/@comis/skills/dist/browser/config.js +49 -0
  1967. package/node_modules/@comis/skills/dist/browser/constants.d.ts +30 -0
  1968. package/node_modules/@comis/skills/dist/browser/constants.js +31 -0
  1969. package/node_modules/@comis/skills/dist/browser/downloads.d.ts +63 -0
  1970. package/node_modules/@comis/skills/dist/browser/downloads.js +135 -0
  1971. package/node_modules/@comis/skills/dist/browser/index.d.ts +24 -0
  1972. package/node_modules/@comis/skills/dist/browser/index.js +15 -0
  1973. package/node_modules/@comis/skills/dist/browser/playwright-actions.d.ts +78 -0
  1974. package/node_modules/@comis/skills/dist/browser/playwright-actions.js +232 -0
  1975. package/node_modules/@comis/skills/dist/browser/playwright-session.d.ts +120 -0
  1976. package/node_modules/@comis/skills/dist/browser/playwright-session.js +341 -0
  1977. package/node_modules/@comis/skills/dist/browser/playwright-snapshots.d.ts +61 -0
  1978. package/node_modules/@comis/skills/dist/browser/playwright-snapshots.js +287 -0
  1979. package/node_modules/@comis/skills/dist/browser/profile-decoration.d.ts +30 -0
  1980. package/node_modules/@comis/skills/dist/browser/profile-decoration.js +63 -0
  1981. package/node_modules/@comis/skills/dist/browser/profiles-service.d.ts +51 -0
  1982. package/node_modules/@comis/skills/dist/browser/profiles-service.js +137 -0
  1983. package/node_modules/@comis/skills/dist/browser/profiles.d.ts +42 -0
  1984. package/node_modules/@comis/skills/dist/browser/profiles.js +70 -0
  1985. package/node_modules/@comis/skills/dist/browser/screenshot-normalizer.d.ts +63 -0
  1986. package/node_modules/@comis/skills/dist/browser/screenshot-normalizer.js +124 -0
  1987. package/node_modules/@comis/skills/dist/browser/screenshots.d.ts +51 -0
  1988. package/node_modules/@comis/skills/dist/browser/screenshots.js +65 -0
  1989. package/node_modules/@comis/skills/dist/browser/smart-waits.d.ts +44 -0
  1990. package/node_modules/@comis/skills/dist/browser/smart-waits.js +74 -0
  1991. package/node_modules/@comis/skills/dist/browser/viewport.d.ts +45 -0
  1992. package/node_modules/@comis/skills/dist/browser/viewport.js +73 -0
  1993. package/node_modules/@comis/skills/dist/builtin/exec-security.d.ts +204 -0
  1994. package/node_modules/@comis/skills/dist/builtin/exec-security.js +988 -0
  1995. package/node_modules/@comis/skills/dist/builtin/exec-tool.d.ts +83 -0
  1996. package/node_modules/@comis/skills/dist/builtin/exec-tool.js +886 -0
  1997. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-parser.d.ts +49 -0
  1998. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-parser.js +232 -0
  1999. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-similarity.d.ts +25 -0
  2000. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-similarity.js +94 -0
  2001. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-tool.d.ts +16 -0
  2002. package/node_modules/@comis/skills/dist/builtin/file/apply-patch-tool.js +418 -0
  2003. package/node_modules/@comis/skills/dist/builtin/file/file-state-tracker.d.ts +102 -0
  2004. package/node_modules/@comis/skills/dist/builtin/file/file-state-tracker.js +138 -0
  2005. package/node_modules/@comis/skills/dist/builtin/file/file-tools.d.ts +31 -0
  2006. package/node_modules/@comis/skills/dist/builtin/file/file-tools.js +67 -0
  2007. package/node_modules/@comis/skills/dist/builtin/file/find-sort-wrapper.d.ts +22 -0
  2008. package/node_modules/@comis/skills/dist/builtin/file/find-sort-wrapper.js +95 -0
  2009. package/node_modules/@comis/skills/dist/builtin/file/grep-output-mode-wrapper.d.ts +24 -0
  2010. package/node_modules/@comis/skills/dist/builtin/file/grep-output-mode-wrapper.js +167 -0
  2011. package/node_modules/@comis/skills/dist/builtin/file/path-suggest.d.ts +64 -0
  2012. package/node_modules/@comis/skills/dist/builtin/file/path-suggest.js +208 -0
  2013. package/node_modules/@comis/skills/dist/builtin/file/safe-path-wrapper.d.ts +26 -0
  2014. package/node_modules/@comis/skills/dist/builtin/file/safe-path-wrapper.js +23 -0
  2015. package/node_modules/@comis/skills/dist/builtin/file-tools/edit-tool.d.ts +40 -0
  2016. package/node_modules/@comis/skills/dist/builtin/file-tools/edit-tool.js +308 -0
  2017. package/node_modules/@comis/skills/dist/builtin/file-tools/find-tool.d.ts +36 -0
  2018. package/node_modules/@comis/skills/dist/builtin/file-tools/find-tool.js +313 -0
  2019. package/node_modules/@comis/skills/dist/builtin/file-tools/grep-tool.d.ts +46 -0
  2020. package/node_modules/@comis/skills/dist/builtin/file-tools/grep-tool.js +424 -0
  2021. package/node_modules/@comis/skills/dist/builtin/file-tools/ls-tool.d.ts +34 -0
  2022. package/node_modules/@comis/skills/dist/builtin/file-tools/ls-tool.js +166 -0
  2023. package/node_modules/@comis/skills/dist/builtin/file-tools/notebook-edit-tool.d.ts +32 -0
  2024. package/node_modules/@comis/skills/dist/builtin/file-tools/notebook-edit-tool.js +195 -0
  2025. package/node_modules/@comis/skills/dist/builtin/file-tools/read-tool.d.ts +50 -0
  2026. package/node_modules/@comis/skills/dist/builtin/file-tools/read-tool.js +427 -0
  2027. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/edit-diff.d.ts +109 -0
  2028. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/edit-diff.js +575 -0
  2029. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/file-encoding.d.ts +63 -0
  2030. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/file-encoding.js +130 -0
  2031. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/file-mutation-queue.d.ts +24 -0
  2032. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/file-mutation-queue.js +58 -0
  2033. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/git-diff.d.ts +20 -0
  2034. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/git-diff.js +34 -0
  2035. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/notebook-edit-ops.d.ts +47 -0
  2036. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/notebook-edit-ops.js +89 -0
  2037. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/notebook-utils.d.ts +32 -0
  2038. package/node_modules/@comis/skills/dist/builtin/file-tools/shared/notebook-utils.js +112 -0
  2039. package/node_modules/@comis/skills/dist/builtin/file-tools/write-tool.d.ts +36 -0
  2040. package/node_modules/@comis/skills/dist/builtin/file-tools/write-tool.js +283 -0
  2041. package/node_modules/@comis/skills/dist/builtin/output-cleaner.d.ts +33 -0
  2042. package/node_modules/@comis/skills/dist/builtin/output-cleaner.js +107 -0
  2043. package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.d.ts +70 -0
  2044. package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +95 -0
  2045. package/node_modules/@comis/skills/dist/builtin/platform/agents-list-tool.d.ts +19 -0
  2046. package/node_modules/@comis/skills/dist/builtin/platform/agents-list-tool.js +39 -0
  2047. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +69 -0
  2048. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +196 -0
  2049. package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.d.ts +50 -0
  2050. package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.js +157 -0
  2051. package/node_modules/@comis/skills/dist/builtin/platform/browser-tool-schema.d.ts +87 -0
  2052. package/node_modules/@comis/skills/dist/builtin/platform/browser-tool-schema.js +123 -0
  2053. package/node_modules/@comis/skills/dist/builtin/platform/browser-tool.d.ts +43 -0
  2054. package/node_modules/@comis/skills/dist/builtin/platform/browser-tool.js +98 -0
  2055. package/node_modules/@comis/skills/dist/builtin/platform/channels-manage-tool.d.ts +36 -0
  2056. package/node_modules/@comis/skills/dist/builtin/platform/channels-manage-tool.js +140 -0
  2057. package/node_modules/@comis/skills/dist/builtin/platform/cron-tool.d.ts +48 -0
  2058. package/node_modules/@comis/skills/dist/builtin/platform/cron-tool.js +172 -0
  2059. package/node_modules/@comis/skills/dist/builtin/platform/ctx-expand-tool.d.ts +24 -0
  2060. package/node_modules/@comis/skills/dist/builtin/platform/ctx-expand-tool.js +48 -0
  2061. package/node_modules/@comis/skills/dist/builtin/platform/ctx-inspect-tool.d.ts +22 -0
  2062. package/node_modules/@comis/skills/dist/builtin/platform/ctx-inspect-tool.js +47 -0
  2063. package/node_modules/@comis/skills/dist/builtin/platform/ctx-recall-tool.d.ts +26 -0
  2064. package/node_modules/@comis/skills/dist/builtin/platform/ctx-recall-tool.js +62 -0
  2065. package/node_modules/@comis/skills/dist/builtin/platform/ctx-search-tool.d.ts +26 -0
  2066. package/node_modules/@comis/skills/dist/builtin/platform/ctx-search-tool.js +52 -0
  2067. package/node_modules/@comis/skills/dist/builtin/platform/describe-video-tool.d.ts +23 -0
  2068. package/node_modules/@comis/skills/dist/builtin/platform/describe-video-tool.js +53 -0
  2069. package/node_modules/@comis/skills/dist/builtin/platform/discord-action-tool.d.ts +29 -0
  2070. package/node_modules/@comis/skills/dist/builtin/platform/discord-action-tool.js +90 -0
  2071. package/node_modules/@comis/skills/dist/builtin/platform/extract-document-tool.d.ts +23 -0
  2072. package/node_modules/@comis/skills/dist/builtin/platform/extract-document-tool.js +53 -0
  2073. package/node_modules/@comis/skills/dist/builtin/platform/fts5-sanitizer.d.ts +27 -0
  2074. package/node_modules/@comis/skills/dist/builtin/platform/fts5-sanitizer.js +78 -0
  2075. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +55 -0
  2076. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +255 -0
  2077. package/node_modules/@comis/skills/dist/builtin/platform/heartbeat-manage-tool.d.ts +36 -0
  2078. package/node_modules/@comis/skills/dist/builtin/platform/heartbeat-manage-tool.js +139 -0
  2079. package/node_modules/@comis/skills/dist/builtin/platform/image-generate-tool.d.ts +26 -0
  2080. package/node_modules/@comis/skills/dist/builtin/platform/image-generate-tool.js +41 -0
  2081. package/node_modules/@comis/skills/dist/builtin/platform/image-tool.d.ts +27 -0
  2082. package/node_modules/@comis/skills/dist/builtin/platform/image-tool.js +73 -0
  2083. package/node_modules/@comis/skills/dist/builtin/platform/index.d.ts +60 -0
  2084. package/node_modules/@comis/skills/dist/builtin/platform/index.js +74 -0
  2085. package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.d.ts +23 -0
  2086. package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.js +109 -0
  2087. package/node_modules/@comis/skills/dist/builtin/platform/memory-get-tool.d.ts +27 -0
  2088. package/node_modules/@comis/skills/dist/builtin/platform/memory-get-tool.js +55 -0
  2089. package/node_modules/@comis/skills/dist/builtin/platform/memory-manage-tool.d.ts +41 -0
  2090. package/node_modules/@comis/skills/dist/builtin/platform/memory-manage-tool.js +183 -0
  2091. package/node_modules/@comis/skills/dist/builtin/platform/memory-search-tool.d.ts +23 -0
  2092. package/node_modules/@comis/skills/dist/builtin/platform/memory-search-tool.js +44 -0
  2093. package/node_modules/@comis/skills/dist/builtin/platform/memory-store-tool.d.ts +22 -0
  2094. package/node_modules/@comis/skills/dist/builtin/platform/memory-store-tool.js +66 -0
  2095. package/node_modules/@comis/skills/dist/builtin/platform/message-tool.d.ts +49 -0
  2096. package/node_modules/@comis/skills/dist/builtin/platform/message-tool.js +190 -0
  2097. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.d.ts +75 -0
  2098. package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.js +83 -0
  2099. package/node_modules/@comis/skills/dist/builtin/platform/models-manage-tool.d.ts +32 -0
  2100. package/node_modules/@comis/skills/dist/builtin/platform/models-manage-tool.js +76 -0
  2101. package/node_modules/@comis/skills/dist/builtin/platform/notify-tool.d.ts +28 -0
  2102. package/node_modules/@comis/skills/dist/builtin/platform/notify-tool.js +54 -0
  2103. package/node_modules/@comis/skills/dist/builtin/platform/obs-query-tool.d.ts +25 -0
  2104. package/node_modules/@comis/skills/dist/builtin/platform/obs-query-tool.js +179 -0
  2105. package/node_modules/@comis/skills/dist/builtin/platform/pipeline-tool.d.ts +62 -0
  2106. package/node_modules/@comis/skills/dist/builtin/platform/pipeline-tool.js +460 -0
  2107. package/node_modules/@comis/skills/dist/builtin/platform/platform-action-tool.d.ts +60 -0
  2108. package/node_modules/@comis/skills/dist/builtin/platform/platform-action-tool.js +70 -0
  2109. package/node_modules/@comis/skills/dist/builtin/platform/session-search-tool.d.ts +32 -0
  2110. package/node_modules/@comis/skills/dist/builtin/platform/session-search-tool.js +76 -0
  2111. package/node_modules/@comis/skills/dist/builtin/platform/session-status-tool.d.ts +21 -0
  2112. package/node_modules/@comis/skills/dist/builtin/platform/session-status-tool.js +43 -0
  2113. package/node_modules/@comis/skills/dist/builtin/platform/sessions-history-tool.d.ts +23 -0
  2114. package/node_modules/@comis/skills/dist/builtin/platform/sessions-history-tool.js +51 -0
  2115. package/node_modules/@comis/skills/dist/builtin/platform/sessions-list-tool.d.ts +22 -0
  2116. package/node_modules/@comis/skills/dist/builtin/platform/sessions-list-tool.js +51 -0
  2117. package/node_modules/@comis/skills/dist/builtin/platform/sessions-manage-tool.d.ts +33 -0
  2118. package/node_modules/@comis/skills/dist/builtin/platform/sessions-manage-tool.js +82 -0
  2119. package/node_modules/@comis/skills/dist/builtin/platform/sessions-send-tool.d.ts +29 -0
  2120. package/node_modules/@comis/skills/dist/builtin/platform/sessions-send-tool.js +58 -0
  2121. package/node_modules/@comis/skills/dist/builtin/platform/sessions-spawn-tool.d.ts +38 -0
  2122. package/node_modules/@comis/skills/dist/builtin/platform/sessions-spawn-tool.js +84 -0
  2123. package/node_modules/@comis/skills/dist/builtin/platform/skills-manage-tool.d.ts +38 -0
  2124. package/node_modules/@comis/skills/dist/builtin/platform/skills-manage-tool.js +107 -0
  2125. package/node_modules/@comis/skills/dist/builtin/platform/slack-action-tool.d.ts +23 -0
  2126. package/node_modules/@comis/skills/dist/builtin/platform/slack-action-tool.js +77 -0
  2127. package/node_modules/@comis/skills/dist/builtin/platform/subagents-tool.d.ts +26 -0
  2128. package/node_modules/@comis/skills/dist/builtin/platform/subagents-tool.js +100 -0
  2129. package/node_modules/@comis/skills/dist/builtin/platform/telegram-action-tool.d.ts +21 -0
  2130. package/node_modules/@comis/skills/dist/builtin/platform/telegram-action-tool.js +72 -0
  2131. package/node_modules/@comis/skills/dist/builtin/platform/tokens-manage-tool.d.ts +33 -0
  2132. package/node_modules/@comis/skills/dist/builtin/platform/tokens-manage-tool.js +87 -0
  2133. package/node_modules/@comis/skills/dist/builtin/platform/tool-helpers.d.ts +163 -0
  2134. package/node_modules/@comis/skills/dist/builtin/platform/tool-helpers.js +237 -0
  2135. package/node_modules/@comis/skills/dist/builtin/platform/transcribe-audio-tool.d.ts +23 -0
  2136. package/node_modules/@comis/skills/dist/builtin/platform/transcribe-audio-tool.js +53 -0
  2137. package/node_modules/@comis/skills/dist/builtin/platform/tts-tool.d.ts +25 -0
  2138. package/node_modules/@comis/skills/dist/builtin/platform/tts-tool.js +61 -0
  2139. package/node_modules/@comis/skills/dist/builtin/platform/unified-context-tool.d.ts +34 -0
  2140. package/node_modules/@comis/skills/dist/builtin/platform/unified-context-tool.js +106 -0
  2141. package/node_modules/@comis/skills/dist/builtin/platform/unified-memory-tool.d.ts +44 -0
  2142. package/node_modules/@comis/skills/dist/builtin/platform/unified-memory-tool.js +230 -0
  2143. package/node_modules/@comis/skills/dist/builtin/platform/unified-session-tool.d.ts +32 -0
  2144. package/node_modules/@comis/skills/dist/builtin/platform/unified-session-tool.js +130 -0
  2145. package/node_modules/@comis/skills/dist/builtin/platform/whatsapp-action-tool.d.ts +24 -0
  2146. package/node_modules/@comis/skills/dist/builtin/platform/whatsapp-action-tool.js +79 -0
  2147. package/node_modules/@comis/skills/dist/builtin/process-registry.d.ts +74 -0
  2148. package/node_modules/@comis/skills/dist/builtin/process-registry.js +213 -0
  2149. package/node_modules/@comis/skills/dist/builtin/process-tool.d.ts +35 -0
  2150. package/node_modules/@comis/skills/dist/builtin/process-tool.js +104 -0
  2151. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.d.ts +19 -0
  2152. package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.js +181 -0
  2153. package/node_modules/@comis/skills/dist/builtin/sandbox/detect-provider.d.ts +20 -0
  2154. package/node_modules/@comis/skills/dist/builtin/sandbox/detect-provider.js +41 -0
  2155. package/node_modules/@comis/skills/dist/builtin/sandbox/sandbox-exec-provider.d.ts +15 -0
  2156. package/node_modules/@comis/skills/dist/builtin/sandbox/sandbox-exec-provider.js +201 -0
  2157. package/node_modules/@comis/skills/dist/builtin/sandbox/types.d.ts +46 -0
  2158. package/node_modules/@comis/skills/dist/builtin/sandbox/types.js +12 -0
  2159. package/node_modules/@comis/skills/dist/builtin/search-provider.d.ts +81 -0
  2160. package/node_modules/@comis/skills/dist/builtin/search-provider.js +45 -0
  2161. package/node_modules/@comis/skills/dist/builtin/task-plan-tool.d.ts +25 -0
  2162. package/node_modules/@comis/skills/dist/builtin/task-plan-tool.js +67 -0
  2163. package/node_modules/@comis/skills/dist/builtin/tool-provisioner.d.ts +29 -0
  2164. package/node_modules/@comis/skills/dist/builtin/tool-provisioner.js +227 -0
  2165. package/node_modules/@comis/skills/dist/builtin/tool-source-profiles.d.ts +48 -0
  2166. package/node_modules/@comis/skills/dist/builtin/tool-source-profiles.js +103 -0
  2167. package/node_modules/@comis/skills/dist/builtin/truncate.d.ts +59 -0
  2168. package/node_modules/@comis/skills/dist/builtin/truncate.js +125 -0
  2169. package/node_modules/@comis/skills/dist/builtin/web-fetch-tool.d.ts +77 -0
  2170. package/node_modules/@comis/skills/dist/builtin/web-fetch-tool.js +528 -0
  2171. package/node_modules/@comis/skills/dist/builtin/web-fetch-utils.d.ts +67 -0
  2172. package/node_modules/@comis/skills/dist/builtin/web-fetch-utils.js +268 -0
  2173. package/node_modules/@comis/skills/dist/builtin/web-fetch-visibility.d.ts +35 -0
  2174. package/node_modules/@comis/skills/dist/builtin/web-fetch-visibility.js +190 -0
  2175. package/node_modules/@comis/skills/dist/builtin/web-search-brave.d.ts +35 -0
  2176. package/node_modules/@comis/skills/dist/builtin/web-search-brave.js +147 -0
  2177. package/node_modules/@comis/skills/dist/builtin/web-search-duckduckgo.d.ts +43 -0
  2178. package/node_modules/@comis/skills/dist/builtin/web-search-duckduckgo.js +192 -0
  2179. package/node_modules/@comis/skills/dist/builtin/web-search-exa.d.ts +32 -0
  2180. package/node_modules/@comis/skills/dist/builtin/web-search-exa.js +84 -0
  2181. package/node_modules/@comis/skills/dist/builtin/web-search-grok.d.ts +50 -0
  2182. package/node_modules/@comis/skills/dist/builtin/web-search-grok.js +87 -0
  2183. package/node_modules/@comis/skills/dist/builtin/web-search-jina.d.ts +29 -0
  2184. package/node_modules/@comis/skills/dist/builtin/web-search-jina.js +94 -0
  2185. package/node_modules/@comis/skills/dist/builtin/web-search-perplexity.d.ts +45 -0
  2186. package/node_modules/@comis/skills/dist/builtin/web-search-perplexity.js +115 -0
  2187. package/node_modules/@comis/skills/dist/builtin/web-search-searxng.d.ts +31 -0
  2188. package/node_modules/@comis/skills/dist/builtin/web-search-searxng.js +100 -0
  2189. package/node_modules/@comis/skills/dist/builtin/web-search-tavily.d.ts +31 -0
  2190. package/node_modules/@comis/skills/dist/builtin/web-search-tavily.js +87 -0
  2191. package/node_modules/@comis/skills/dist/builtin/web-search-tool.d.ts +174 -0
  2192. package/node_modules/@comis/skills/dist/builtin/web-search-tool.js +666 -0
  2193. package/node_modules/@comis/skills/dist/builtin/web-shared.d.ts +60 -0
  2194. package/node_modules/@comis/skills/dist/builtin/web-shared.js +127 -0
  2195. package/node_modules/@comis/skills/dist/index.d.ts +62 -0
  2196. package/node_modules/@comis/skills/dist/index.js +113 -0
  2197. package/node_modules/@comis/skills/dist/integrations/deepgram-stt-adapter.d.ts +27 -0
  2198. package/node_modules/@comis/skills/dist/integrations/deepgram-stt-adapter.js +81 -0
  2199. package/node_modules/@comis/skills/dist/integrations/document/binary-detector.d.ts +28 -0
  2200. package/node_modules/@comis/skills/dist/integrations/document/binary-detector.js +59 -0
  2201. package/node_modules/@comis/skills/dist/integrations/document/composite-extractor.d.ts +22 -0
  2202. package/node_modules/@comis/skills/dist/integrations/document/composite-extractor.js +34 -0
  2203. package/node_modules/@comis/skills/dist/integrations/document/file-classifier.d.ts +25 -0
  2204. package/node_modules/@comis/skills/dist/integrations/document/file-classifier.js +60 -0
  2205. package/node_modules/@comis/skills/dist/integrations/document/file-extractor.d.ts +41 -0
  2206. package/node_modules/@comis/skills/dist/integrations/document/file-extractor.js +148 -0
  2207. package/node_modules/@comis/skills/dist/integrations/document/pdf-extractor.d.ts +50 -0
  2208. package/node_modules/@comis/skills/dist/integrations/document/pdf-extractor.js +214 -0
  2209. package/node_modules/@comis/skills/dist/integrations/document/pdf-page-renderer.d.ts +41 -0
  2210. package/node_modules/@comis/skills/dist/integrations/document/pdf-page-renderer.js +78 -0
  2211. package/node_modules/@comis/skills/dist/integrations/document/text-decoder.d.ts +21 -0
  2212. package/node_modules/@comis/skills/dist/integrations/document/text-decoder.js +53 -0
  2213. package/node_modules/@comis/skills/dist/integrations/document/xml-block.d.ts +59 -0
  2214. package/node_modules/@comis/skills/dist/integrations/document/xml-block.js +80 -0
  2215. package/node_modules/@comis/skills/dist/integrations/edge-tts-adapter.d.ts +15 -0
  2216. package/node_modules/@comis/skills/dist/integrations/edge-tts-adapter.js +42 -0
  2217. package/node_modules/@comis/skills/dist/integrations/elevenlabs-tts-adapter.d.ts +19 -0
  2218. package/node_modules/@comis/skills/dist/integrations/elevenlabs-tts-adapter.js +65 -0
  2219. package/node_modules/@comis/skills/dist/integrations/groq-stt-adapter.d.ts +23 -0
  2220. package/node_modules/@comis/skills/dist/integrations/groq-stt-adapter.js +76 -0
  2221. package/node_modules/@comis/skills/dist/integrations/image-gen/fal-adapter.d.ts +11 -0
  2222. package/node_modules/@comis/skills/dist/integrations/image-gen/fal-adapter.js +39 -0
  2223. package/node_modules/@comis/skills/dist/integrations/image-gen/image-gen-factory.d.ts +13 -0
  2224. package/node_modules/@comis/skills/dist/integrations/image-gen/image-gen-factory.js +31 -0
  2225. package/node_modules/@comis/skills/dist/integrations/image-gen/index.d.ts +5 -0
  2226. package/node_modules/@comis/skills/dist/integrations/image-gen/index.js +5 -0
  2227. package/node_modules/@comis/skills/dist/integrations/image-gen/openai-adapter.d.ts +11 -0
  2228. package/node_modules/@comis/skills/dist/integrations/image-gen/openai-adapter.js +32 -0
  2229. package/node_modules/@comis/skills/dist/integrations/image-gen/rate-limiter.d.ts +22 -0
  2230. package/node_modules/@comis/skills/dist/integrations/image-gen/rate-limiter.js +32 -0
  2231. package/node_modules/@comis/skills/dist/integrations/image-sanitizer.d.ts +39 -0
  2232. package/node_modules/@comis/skills/dist/integrations/image-sanitizer.js +121 -0
  2233. package/node_modules/@comis/skills/dist/integrations/link/link-detector.d.ts +26 -0
  2234. package/node_modules/@comis/skills/dist/integrations/link/link-detector.js +114 -0
  2235. package/node_modules/@comis/skills/dist/integrations/link/link-fetcher.d.ts +43 -0
  2236. package/node_modules/@comis/skills/dist/integrations/link/link-fetcher.js +74 -0
  2237. package/node_modules/@comis/skills/dist/integrations/link/link-formatter.d.ts +39 -0
  2238. package/node_modules/@comis/skills/dist/integrations/link/link-formatter.js +55 -0
  2239. package/node_modules/@comis/skills/dist/integrations/link/link-runner.d.ts +56 -0
  2240. package/node_modules/@comis/skills/dist/integrations/link/link-runner.js +77 -0
  2241. package/node_modules/@comis/skills/dist/integrations/mcp-client.d.ts +163 -0
  2242. package/node_modules/@comis/skills/dist/integrations/mcp-client.js +705 -0
  2243. package/node_modules/@comis/skills/dist/integrations/mcp-result-sanitizer.d.ts +21 -0
  2244. package/node_modules/@comis/skills/dist/integrations/mcp-result-sanitizer.js +44 -0
  2245. package/node_modules/@comis/skills/dist/integrations/mcp-tool-bridge.d.ts +75 -0
  2246. package/node_modules/@comis/skills/dist/integrations/mcp-tool-bridge.js +235 -0
  2247. package/node_modules/@comis/skills/dist/integrations/media-adapter-shared.d.ts +16 -0
  2248. package/node_modules/@comis/skills/dist/integrations/media-adapter-shared.js +35 -0
  2249. package/node_modules/@comis/skills/dist/integrations/media-handler-audio.d.ts +33 -0
  2250. package/node_modules/@comis/skills/dist/integrations/media-handler-audio.js +62 -0
  2251. package/node_modules/@comis/skills/dist/integrations/media-handler-document.d.ts +38 -0
  2252. package/node_modules/@comis/skills/dist/integrations/media-handler-document.js +70 -0
  2253. package/node_modules/@comis/skills/dist/integrations/media-handler-factory.d.ts +25 -0
  2254. package/node_modules/@comis/skills/dist/integrations/media-handler-factory.js +39 -0
  2255. package/node_modules/@comis/skills/dist/integrations/media-handler-image.d.ts +48 -0
  2256. package/node_modules/@comis/skills/dist/integrations/media-handler-image.js +86 -0
  2257. package/node_modules/@comis/skills/dist/integrations/media-handler-video.d.ts +37 -0
  2258. package/node_modules/@comis/skills/dist/integrations/media-handler-video.js +49 -0
  2259. package/node_modules/@comis/skills/dist/integrations/media-preprocessor.d.ts +118 -0
  2260. package/node_modules/@comis/skills/dist/integrations/media-preprocessor.js +176 -0
  2261. package/node_modules/@comis/skills/dist/integrations/multimodal-analyzer.d.ts +27 -0
  2262. package/node_modules/@comis/skills/dist/integrations/multimodal-analyzer.js +139 -0
  2263. package/node_modules/@comis/skills/dist/integrations/openai-stt-adapter.d.ts +24 -0
  2264. package/node_modules/@comis/skills/dist/integrations/openai-stt-adapter.js +78 -0
  2265. package/node_modules/@comis/skills/dist/integrations/openai-tts-adapter.d.ts +19 -0
  2266. package/node_modules/@comis/skills/dist/integrations/openai-tts-adapter.js +78 -0
  2267. package/node_modules/@comis/skills/dist/integrations/outbound-media-parser.d.ts +33 -0
  2268. package/node_modules/@comis/skills/dist/integrations/outbound-media-parser.js +58 -0
  2269. package/node_modules/@comis/skills/dist/integrations/stt-factory.d.ts +36 -0
  2270. package/node_modules/@comis/skills/dist/integrations/stt-factory.js +84 -0
  2271. package/node_modules/@comis/skills/dist/integrations/tts/tts-auto-mode.d.ts +44 -0
  2272. package/node_modules/@comis/skills/dist/integrations/tts/tts-auto-mode.js +48 -0
  2273. package/node_modules/@comis/skills/dist/integrations/tts/tts-directive-parser.d.ts +53 -0
  2274. package/node_modules/@comis/skills/dist/integrations/tts/tts-directive-parser.js +93 -0
  2275. package/node_modules/@comis/skills/dist/integrations/tts/tts-output-format.d.ts +42 -0
  2276. package/node_modules/@comis/skills/dist/integrations/tts/tts-output-format.js +114 -0
  2277. package/node_modules/@comis/skills/dist/integrations/tts-factory.d.ts +15 -0
  2278. package/node_modules/@comis/skills/dist/integrations/tts-factory.js +37 -0
  2279. package/node_modules/@comis/skills/dist/integrations/vision/gemini-vision-adapter.d.ts +35 -0
  2280. package/node_modules/@comis/skills/dist/integrations/vision/gemini-vision-adapter.js +149 -0
  2281. package/node_modules/@comis/skills/dist/integrations/vision/scope-resolver.d.ts +40 -0
  2282. package/node_modules/@comis/skills/dist/integrations/vision/scope-resolver.js +55 -0
  2283. package/node_modules/@comis/skills/dist/integrations/vision/video-handler.d.ts +33 -0
  2284. package/node_modules/@comis/skills/dist/integrations/vision/video-handler.js +46 -0
  2285. package/node_modules/@comis/skills/dist/integrations/vision/vision-provider-registry.d.ts +48 -0
  2286. package/node_modules/@comis/skills/dist/integrations/vision/vision-provider-registry.js +134 -0
  2287. package/node_modules/@comis/skills/dist/manifest/parser.d.ts +29 -0
  2288. package/node_modules/@comis/skills/dist/manifest/parser.js +69 -0
  2289. package/node_modules/@comis/skills/dist/manifest/schema.d.ts +125 -0
  2290. package/node_modules/@comis/skills/dist/manifest/schema.js +113 -0
  2291. package/node_modules/@comis/skills/dist/media/audio-converter.d.ts +39 -0
  2292. package/node_modules/@comis/skills/dist/media/audio-converter.js +154 -0
  2293. package/node_modules/@comis/skills/dist/media/audio-tags.d.ts +37 -0
  2294. package/node_modules/@comis/skills/dist/media/audio-tags.js +45 -0
  2295. package/node_modules/@comis/skills/dist/media/composite-resolver.d.ts +41 -0
  2296. package/node_modules/@comis/skills/dist/media/composite-resolver.js +78 -0
  2297. package/node_modules/@comis/skills/dist/media/constants.d.ts +17 -0
  2298. package/node_modules/@comis/skills/dist/media/constants.js +54 -0
  2299. package/node_modules/@comis/skills/dist/media/ffmpeg-detect.d.ts +27 -0
  2300. package/node_modules/@comis/skills/dist/media/ffmpeg-detect.js +41 -0
  2301. package/node_modules/@comis/skills/dist/media/file-validator.d.ts +45 -0
  2302. package/node_modules/@comis/skills/dist/media/file-validator.js +98 -0
  2303. package/node_modules/@comis/skills/dist/media/image-ops.d.ts +64 -0
  2304. package/node_modules/@comis/skills/dist/media/image-ops.js +139 -0
  2305. package/node_modules/@comis/skills/dist/media/index.d.ts +31 -0
  2306. package/node_modules/@comis/skills/dist/media/index.js +33 -0
  2307. package/node_modules/@comis/skills/dist/media/media-persistence.d.ts +64 -0
  2308. package/node_modules/@comis/skills/dist/media/media-persistence.js +95 -0
  2309. package/node_modules/@comis/skills/dist/media/media-semaphore.d.ts +37 -0
  2310. package/node_modules/@comis/skills/dist/media/media-semaphore.js +47 -0
  2311. package/node_modules/@comis/skills/dist/media/media-store.d.ts +64 -0
  2312. package/node_modules/@comis/skills/dist/media/media-store.js +178 -0
  2313. package/node_modules/@comis/skills/dist/media/media-temp.d.ts +53 -0
  2314. package/node_modules/@comis/skills/dist/media/media-temp.js +134 -0
  2315. package/node_modules/@comis/skills/dist/media/mime-detection.d.ts +45 -0
  2316. package/node_modules/@comis/skills/dist/media/mime-detection.js +125 -0
  2317. package/node_modules/@comis/skills/dist/media/ssrf-fetcher.d.ts +65 -0
  2318. package/node_modules/@comis/skills/dist/media/ssrf-fetcher.js +208 -0
  2319. package/node_modules/@comis/skills/dist/policy/index.d.ts +7 -0
  2320. package/node_modules/@comis/skills/dist/policy/index.js +7 -0
  2321. package/node_modules/@comis/skills/dist/policy/tool-policy.d.ts +74 -0
  2322. package/node_modules/@comis/skills/dist/policy/tool-policy.js +220 -0
  2323. package/node_modules/@comis/skills/dist/prompt/content-scanner.d.ts +58 -0
  2324. package/node_modules/@comis/skills/dist/prompt/content-scanner.js +284 -0
  2325. package/node_modules/@comis/skills/dist/prompt/processor.d.ts +98 -0
  2326. package/node_modules/@comis/skills/dist/prompt/processor.js +232 -0
  2327. package/node_modules/@comis/skills/dist/prompt/sanitizer.d.ts +62 -0
  2328. package/node_modules/@comis/skills/dist/prompt/sanitizer.js +72 -0
  2329. package/node_modules/@comis/skills/dist/registry/diagnostics.d.ts +23 -0
  2330. package/node_modules/@comis/skills/dist/registry/diagnostics.js +11 -0
  2331. package/node_modules/@comis/skills/dist/registry/discovery.d.ts +94 -0
  2332. package/node_modules/@comis/skills/dist/registry/discovery.js +332 -0
  2333. package/node_modules/@comis/skills/dist/registry/eligibility.d.ts +61 -0
  2334. package/node_modules/@comis/skills/dist/registry/eligibility.js +124 -0
  2335. package/node_modules/@comis/skills/dist/registry/skill-registry.d.ts +127 -0
  2336. package/node_modules/@comis/skills/dist/registry/skill-registry.js +496 -0
  2337. package/node_modules/@comis/skills/dist/registry/skill-watcher.d.ts +50 -0
  2338. package/node_modules/@comis/skills/dist/registry/skill-watcher.js +166 -0
  2339. package/node_modules/@comis/skills/package.json +44 -0
  2340. package/package.json +201 -0
@@ -0,0 +1,1679 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * Request body injector stream wrapper.
4
+ *
5
+ * Mutates the outgoing request body via the onPayload hook. Consolidates:
6
+ * 1. Cache breakpoints (Anthropic-family): cache_control markers
7
+ * 2. 1M beta header (direct Anthropic only)
8
+ * 3. service_tier (Responses API + fastMode)
9
+ * 4. store (Responses API + storeCompletions)
10
+ *
11
+ * Cache breakpoints:
12
+ *
13
+ * @module
14
+ */
15
+ import { SYSTEM_PROMPT_DYNAMIC_BOUNDARY, resolveBreakpointStrategy } from "./config-resolver.js";
16
+ import { createAccumulativeLatch } from "../session-latch.js";
17
+ import { MIN_CACHEABLE_TOKENS, DEFAULT_MIN_CACHEABLE_TOKENS, CHARS_PER_TOKEN_RATIO, CHARS_PER_TOKEN_RATIO_STRUCTURED, CACHE_LOOKBACK_WINDOW } from "../../context-engine/index.js";
18
+ import { estimateContextChars } from "../../safety/token-estimator.js";
19
+ import { computeHash, djb2 } from "../cache-break-detection.js";
20
+ // ---------------------------------------------------------------------------
21
+ // Tool schema caches extracted to tool-schema-cache.ts (leaf module).
22
+ // Re-exported here for backward compatibility with existing consumers.
23
+ // ---------------------------------------------------------------------------
24
+ import { sessionRenderedToolCache, getOrCacheRenderedTool } from "./tool-schema-cache.js";
25
+ export { clearSessionRenderedToolCache, getOrCacheRenderedTool, clearSessionPerToolCache } from "./tool-schema-cache.js";
26
+ // ---------------------------------------------------------------------------
27
+ // Sticky-on beta header latches.
28
+ // Tracks individual beta header values seen per session. Once a beta value
29
+ // appears in any API call, it is latched and included in all subsequent calls.
30
+ // Prevents mid-session beta header toggling from busting the cache prefix.
31
+ // ---------------------------------------------------------------------------
32
+ const sessionBetaHeaderLatches = new Map();
33
+ // ---------------------------------------------------------------------------
34
+ // Prefix stability tracking.
35
+ // Hashes the first N messages before microcompaction to detect prefix instability.
36
+ // When the prefix hash changes on consecutive turns, the cache prefix is unstable
37
+ // and every turn will miss cache reads beyond the system prompt.
38
+ // ---------------------------------------------------------------------------
39
+ const sessionPrefixStability = new Map();
40
+ export function clearSessionPrefixStability(sessionKey) {
41
+ sessionPrefixStability.delete(sessionKey);
42
+ }
43
+ export function clearSessionBetaHeaderLatches(sessionKey) {
44
+ sessionBetaHeaderLatches.delete(sessionKey);
45
+ }
46
+ // ---------------------------------------------------------------------------
47
+ // Per-model cache retention override resolution.
48
+ // Enables selectively disabling or changing prompt caching for specific model
49
+ // families. Longest-prefix-first matching ensures specific model variants
50
+ // (e.g., "claude-sonnet-4-6") take priority over broad families ("claude-sonnet").
51
+ // ---------------------------------------------------------------------------
52
+ /**
53
+ * Resolve effective cache retention for a model, considering per-model overrides.
54
+ * Uses longest-prefix-first matching: "claude-sonnet-4-6" wins over "claude-sonnet".
55
+ *
56
+ * @param modelId - Full model identifier (e.g., "claude-sonnet-4-6-20260301")
57
+ * @param agentRetention - Agent-level default cache retention
58
+ * @param overrides - Optional per-model family overrides (prefix -> retention)
59
+ * @returns Resolved cache retention value
60
+ */
61
+ export function resolveCacheRetention(modelId, agentRetention, overrides) {
62
+ if (!overrides || Object.keys(overrides).length === 0) {
63
+ return agentRetention;
64
+ }
65
+ // Sort by key length descending (longest-prefix-first)
66
+ const sorted = Object.entries(overrides).sort((a, b) => b[0].length - a[0].length);
67
+ for (const [prefix, retention] of sorted) {
68
+ if (modelId.startsWith(prefix))
69
+ return retention;
70
+ }
71
+ return agentRetention;
72
+ }
73
+ // ---------------------------------------------------------------------------
74
+ // Internal helpers
75
+ // ---------------------------------------------------------------------------
76
+ /** Anthropic beta header for 1M context window. */
77
+ const CONTEXT_1M_BETA = "context-1m-2025-08-07";
78
+ /** Anthropic-family providers that support cache_control breakpoints. */
79
+ const ANTHROPIC_FAMILY = new Set(["anthropic", "anthropic-vertex", "amazon-bedrock"]);
80
+ /** Check if a model uses the OpenAI Responses API. */
81
+ function isResponsesApiProvider(model) {
82
+ return model.api === "openai-responses" || model.api === "azure-openai-responses";
83
+ }
84
+ /** Parse a comma-separated header list, returning individual values. */
85
+ function parseHeaderList(header) {
86
+ if (!header)
87
+ return [];
88
+ return header.split(",").map(s => s.trim()).filter(Boolean);
89
+ }
90
+ /**
91
+ * Compute a hash of rendered tools excluding cache_control.
92
+ * Uses computeHash (djb2 over JSON.stringify) from cache-break-detection.
93
+ */
94
+ function computeRenderedToolsHash(tools) {
95
+ const forHash = tools.map(t => ({
96
+ name: t.name,
97
+ description: t.description,
98
+ input_schema: t.input_schema,
99
+ }));
100
+ return computeHash(forHash);
101
+ }
102
+ /**
103
+ * Pre-sorted MIN_CACHEABLE_TOKENS entries by key length descending.
104
+ * Ensures longest-prefix-first matching: "claude-opus-4-6" (len 15)
105
+ * always matches before "claude-opus-4-" (len 14).
106
+ * Computed once at module load time.
107
+ */
108
+ const SORTED_MIN_CACHEABLE_ENTRIES = Object.entries(MIN_CACHEABLE_TOKENS).sort((a, b) => b[0].length - a[0].length);
109
+ /**
110
+ * Resolve minimum cacheable tokens for a model ID.
111
+ * Matches by prefix: "claude-opus-4-6-20260301" -> "claude-opus-4-6".
112
+ * Uses pre-sorted entries to guarantee longest prefix wins.
113
+ * Falls back to DEFAULT_MIN_CACHEABLE_TOKENS (1024).
114
+ */
115
+ export function getMinCacheableTokens(modelId) {
116
+ if (!modelId)
117
+ return DEFAULT_MIN_CACHEABLE_TOKENS;
118
+ for (const [prefix, threshold] of SORTED_MIN_CACHEABLE_ENTRIES) {
119
+ if (modelId.startsWith(prefix))
120
+ return threshold;
121
+ }
122
+ return DEFAULT_MIN_CACHEABLE_TOKENS;
123
+ }
124
+ /**
125
+ * Count existing cache_control breakpoints in an Anthropic API payload.
126
+ * Counts across tools, system blocks, and message content blocks.
127
+ * Tools are counted first because their breakpoints consume slots from
128
+ * the same 4-breakpoint budget.
129
+ */
130
+ function countCacheBreakpoints(params) {
131
+ let count = 0;
132
+ // Count in tools array
133
+ const tools = params.tools;
134
+ if (Array.isArray(tools)) {
135
+ for (const tool of tools) {
136
+ if (tool.cache_control)
137
+ count++;
138
+ }
139
+ }
140
+ // Count in system array
141
+ const system = params.system;
142
+ if (Array.isArray(system)) {
143
+ for (const block of system) {
144
+ if (block.cache_control)
145
+ count++;
146
+ }
147
+ }
148
+ // Count in messages
149
+ const messages = params.messages;
150
+ if (Array.isArray(messages)) {
151
+ for (const msg of messages) {
152
+ const content = msg.content;
153
+ if (Array.isArray(content)) {
154
+ for (const block of content) {
155
+ if (block.cache_control)
156
+ count++;
157
+ }
158
+ }
159
+ }
160
+ }
161
+ return count;
162
+ }
163
+ /**
164
+ * Block types eligible for cache_control markers.
165
+ * Thinking and redacted_thinking blocks must never receive cache_control
166
+ * because they waste breakpoint slots.
167
+ */
168
+ export const CACHEABLE_BLOCK_TYPES = new Set(["text", "tool_use", "tool_result", "image"]);
169
+ /**
170
+ * Add cache_control marker to the last cacheable content block of a message.
171
+ *
172
+ * Walks backwards through the content array to find the last block whose
173
+ * type is in CACHEABLE_BLOCK_TYPES. Thinking and redacted_thinking blocks
174
+ * are skipped because they waste breakpoint slots.
175
+ *
176
+ * When retention is "long", uses ttl="1h" to match the pi-ai SDK's
177
+ * Anthropic provider which sets `{ type: "ephemeral", ttl: "1h" }` on
178
+ * the last user message. The Anthropic API requires TTLs to be
179
+ * monotonically non-increasing across the request (tools -> system ->
180
+ * messages). Since Comis places breakpoints earlier in the message array
181
+ * than the SDK, using the same "1h" TTL ensures ordering compliance.
182
+ *
183
+ * When retention is "short" or undefined, uses the 5m default (no
184
+ * explicit TTL) which is the Anthropic API baseline.
185
+ */
186
+ export function addCacheControlToLastBlock(message, retention) {
187
+ const content = message.content;
188
+ if (!Array.isArray(content) || content.length === 0)
189
+ return;
190
+ const cacheControl = retention === "long"
191
+ ? { type: "ephemeral", ttl: "1h" }
192
+ : { type: "ephemeral" };
193
+ // Walk backwards to find the last cacheable block (skip thinking, redacted_thinking, etc.)
194
+ for (let i = content.length - 1; i >= 0; i--) {
195
+ const block = content[i];
196
+ if (CACHEABLE_BLOCK_TYPES.has(block.type)) {
197
+ block.cache_control = cacheControl;
198
+ return;
199
+ }
200
+ }
201
+ // Edge case: no cacheable block found -- place on last block as fallback
202
+ content[content.length - 1].cache_control = cacheControl;
203
+ }
204
+ /** DEFER-TOOL: Check if a model supports Anthropic's tool search (defer_loading).
205
+ * Supported: Sonnet 4.x+, Opus 4.x+. NOT supported: Haiku. */
206
+ function supportsToolSearch(modelId) {
207
+ const lower = modelId.toLowerCase();
208
+ if (lower.includes("haiku"))
209
+ return false;
210
+ // Sonnet 4.x and Opus 4.x support tool search
211
+ return lower.includes("sonnet") || lower.includes("opus");
212
+ }
213
+ /**
214
+ * Place exactly 1 cache_control marker on the second-to-last user message.
215
+ * The SDK already places one on the last user message, so we target second-to-last
216
+ * to avoid duplication while still getting one Comis-controlled breakpoint.
217
+ *
218
+ * When skipCacheWrite is true, target the third-to-last user message instead,
219
+ * falling back to second-to-last if insufficient user messages exist.
220
+ */
221
+ /* eslint-disable @typescript-eslint/no-explicit-any -- SDK message types lack public type exports */
222
+ function placeSingleBreakpoint(messages, retention, skipCacheWrite) {
223
+ if (messages.length < 2)
224
+ return 0;
225
+ // When skipCacheWrite, find third-to-last instead of second-to-last
226
+ const targetOrdinal = skipCacheWrite ? 3 : 2; // 1st=last, 2nd=second-to-last, 3rd=third-to-last
227
+ let userCount = 0;
228
+ for (let i = messages.length - 1; i >= 0; i--) {
229
+ if (messages[i].role === "user") {
230
+ userCount++;
231
+ if (userCount === targetOrdinal) {
232
+ addCacheControlToLastBlock(messages[i], retention);
233
+ return 1;
234
+ }
235
+ }
236
+ }
237
+ // Fallback: if not enough user messages for the target ordinal,
238
+ // try second-to-last (skipCacheWrite fallback)
239
+ if (skipCacheWrite && userCount >= 2) {
240
+ let fallbackCount = 0;
241
+ for (let i = messages.length - 1; i >= 0; i--) {
242
+ if (messages[i].role === "user") {
243
+ fallbackCount++;
244
+ if (fallbackCount === 2) {
245
+ addCacheControlToLastBlock(messages[i], retention);
246
+ return 1;
247
+ }
248
+ }
249
+ }
250
+ }
251
+ return 0;
252
+ }
253
+ /* eslint-enable @typescript-eslint/no-explicit-any */
254
+ /**
255
+ * Place cache breakpoints at strategic positions within the messages array.
256
+ *
257
+ * Zone strategy (up to 3 custom breakpoints):
258
+ * - Breakpoint #2 (semi-stable zone): After the compaction summary or the
259
+ * boundary between old and recent messages.
260
+ * - Breakpoint #3 (recent zone): On the second-to-last user message (the
261
+ * SDK places #4 on the last user message).
262
+ * - Breakpoint #3.5 (mid zone): At the midpoint between semi-stable and
263
+ * second-to-last user -- covers the gap in longer conversations.
264
+ *
265
+ * @param messages - The messages array from the Anthropic API payload
266
+ * @param options - Breakpoint placement options
267
+ * @returns Number of breakpoints actually placed
268
+ */
269
+ /* eslint-disable @typescript-eslint/no-explicit-any -- SDK message types lack public type exports */
270
+ function placeCacheBreakpoints(messages, options) {
271
+ const { minTokens, maxBreakpoints, retention, resolvedRetention, strategy, skipCacheWrite } = options;
272
+ if (messages.length < 4 || maxBreakpoints <= 0)
273
+ return 0;
274
+ // Single-breakpoint strategy dispatch
275
+ if (strategy === "single") {
276
+ return placeSingleBreakpoint(messages, retention, skipCacheWrite);
277
+ }
278
+ let placed = 0;
279
+ const remaining = Math.min(maxBreakpoints, 3); // Use full budget (4 total - SDK's 1 = 3 available)
280
+ // Find the second-to-last user message for breakpoint #3
281
+ let secondToLastUserIdx = -1;
282
+ let lastUserIdx = -1;
283
+ for (let i = messages.length - 1; i >= 0; i--) {
284
+ if (messages[i].role === "user") {
285
+ if (lastUserIdx === -1) {
286
+ lastUserIdx = i;
287
+ }
288
+ else if (secondToLastUserIdx === -1) {
289
+ secondToLastUserIdx = i;
290
+ break;
291
+ }
292
+ }
293
+ }
294
+ // For sub-agent spawns, shift recent-zone breakpoint back by one
295
+ // user message to avoid cache_creation on the final message pair.
296
+ if (skipCacheWrite && secondToLastUserIdx >= 0) {
297
+ let thirdToLastUserIdx = -1;
298
+ for (let i = secondToLastUserIdx - 1; i >= 0; i--) {
299
+ if (messages[i].role === "user") {
300
+ thirdToLastUserIdx = i;
301
+ break;
302
+ }
303
+ }
304
+ if (thirdToLastUserIdx >= 0) {
305
+ secondToLastUserIdx = thirdToLastUserIdx;
306
+ }
307
+ // If no third-to-last user found, fall through to original secondToLastUserIdx
308
+ }
309
+ // Estimate cumulative tokens for threshold checking.
310
+ // Uses content-aware char/token ratio: structured content (tool results,
311
+ // tool use JSON) tokenizes at ~3 chars/token; natural language at ~4.
312
+ function estimateTokensInRange(start, end) {
313
+ let tokens = 0;
314
+ for (let i = start; i <= end && i < messages.length; i++) {
315
+ const msg = messages[i];
316
+ const content = msg.content;
317
+ const isStructured = msg.role === "user"
318
+ ? Array.isArray(content) && content.some((b) => b.type === "tool_result")
319
+ : msg.role === "assistant"
320
+ ? Array.isArray(content) && content.some((b) => b.type === "tool_use")
321
+ : false;
322
+ const ratio = isStructured ? CHARS_PER_TOKEN_RATIO_STRUCTURED : CHARS_PER_TOKEN_RATIO;
323
+ if (typeof content === "string") {
324
+ tokens += Math.ceil(content.length / ratio);
325
+ }
326
+ else if (Array.isArray(content)) {
327
+ for (const block of content) {
328
+ if (typeof block.text === "string") {
329
+ tokens += Math.ceil(block.text.length / ratio);
330
+ }
331
+ // tool_result blocks nest text inside block.content[]
332
+ if (Array.isArray(block.content)) {
333
+ for (const inner of block.content) {
334
+ if (typeof inner.text === "string") {
335
+ tokens += Math.ceil(inner.text.length / ratio);
336
+ }
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ return tokens;
343
+ }
344
+ // Find compaction summary position (breakpoint #2 candidate)
345
+ let semiStableIdx = -1;
346
+ for (let i = 0; i < messages.length; i++) {
347
+ const msg = messages[i];
348
+ if (msg.role === "user") {
349
+ const content = msg.content;
350
+ const text = typeof content === "string" ? content :
351
+ (Array.isArray(content) ? content.find((b) => b.type === "text")?.text ?? "" : "");
352
+ if (text.startsWith("<summary>") || text.includes("[Compaction summary]")) {
353
+ semiStableIdx = i;
354
+ break;
355
+ }
356
+ }
357
+ }
358
+ // Place at 50% cumulative token threshold (not 50% message index).
359
+ // Token-density placement ensures sessions with tool-heavy early messages
360
+ // place the breakpoint at the actual token midpoint.
361
+ if (semiStableIdx === -1 && secondToLastUserIdx > 2) {
362
+ const totalTokens = estimateTokensInRange(0, secondToLastUserIdx);
363
+ const halfTokens = totalTokens / 2;
364
+ let cumulative = 0;
365
+ let crossingIdx = -1;
366
+ for (let i = 0; i <= secondToLastUserIdx; i++) {
367
+ cumulative += estimateTokensInRange(i, i);
368
+ if (cumulative >= halfTokens) {
369
+ crossingIdx = i;
370
+ break;
371
+ }
372
+ }
373
+ // Find nearest user message at or before the crossing point
374
+ if (crossingIdx >= 0) {
375
+ for (let i = crossingIdx; i >= 0; i--) {
376
+ if (messages[i].role === "user") {
377
+ semiStableIdx = i;
378
+ break;
379
+ }
380
+ }
381
+ // Fallback: if no user message at/before crossing, scan forward
382
+ if (semiStableIdx === -1) {
383
+ for (let i = crossingIdx + 1; i <= secondToLastUserIdx; i++) {
384
+ if (messages[i].role === "user") {
385
+ semiStableIdx = i;
386
+ break;
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
392
+ // Place breakpoint #2 if above threshold
393
+ if (semiStableIdx >= 0 && placed < remaining) {
394
+ const tokensToPoint = estimateTokensInRange(0, semiStableIdx);
395
+ if (tokensToPoint >= minTokens) {
396
+ addCacheControlToLastBlock(messages[semiStableIdx], resolvedRetention ?? retention);
397
+ placed++;
398
+ }
399
+ }
400
+ // Place breakpoint #3 on second-to-last user message if above threshold
401
+ if (secondToLastUserIdx >= 0 && placed < remaining) {
402
+ const startFrom = semiStableIdx >= 0 ? semiStableIdx + 1 : 0;
403
+ const tokensInRange = estimateTokensInRange(startFrom, secondToLastUserIdx);
404
+ if (tokensInRange >= minTokens) {
405
+ addCacheControlToLastBlock(messages[secondToLastUserIdx], retention);
406
+ placed++;
407
+ }
408
+ }
409
+ // Place breakpoint at mid-point between semi-stable and second-to-last user.
410
+ // Covers the gap in longer conversations where the semi-stable zone (compaction summary)
411
+ // is far from the recent zone (second-to-last user message).
412
+ if (semiStableIdx >= 0 && secondToLastUserIdx >= 0 && placed < remaining) {
413
+ const midIdx = Math.floor((semiStableIdx + secondToLastUserIdx) / 2);
414
+ if (midIdx > semiStableIdx && midIdx < secondToLastUserIdx) {
415
+ // Find nearest user message at or before the midpoint
416
+ let midUserIdx = -1;
417
+ for (let i = midIdx; i > semiStableIdx; i--) {
418
+ if (messages[i].role === "user") {
419
+ midUserIdx = i;
420
+ break;
421
+ }
422
+ }
423
+ if (midUserIdx >= 0) {
424
+ const startFrom = semiStableIdx + 1;
425
+ const tokensInRange = estimateTokensInRange(startFrom, midUserIdx);
426
+ if (tokensInRange >= minTokens) {
427
+ addCacheControlToLastBlock(messages[midUserIdx], resolvedRetention ?? retention);
428
+ placed++;
429
+ }
430
+ }
431
+ }
432
+ }
433
+ // Lookback window enforcement: check gaps between consecutive breakpoints.
434
+ // The Anthropic API uses a 20-block lookback window for cache prefix matching.
435
+ // If any gap exceeds the window and slots remain, place a bridging breakpoint
436
+ // at the midpoint of the gap to prevent silent cache misses.
437
+ if (placed > 0 && placed < Math.min(maxBreakpoints, 3)) {
438
+ const breakpointPositions = [];
439
+ for (let i = 0; i < messages.length; i++) {
440
+ const content = messages[i].content;
441
+ if (Array.isArray(content)) {
442
+ for (const block of content) {
443
+ if (block.cache_control) {
444
+ breakpointPositions.push(i);
445
+ break;
446
+ }
447
+ }
448
+ }
449
+ }
450
+ // Check gaps between consecutive breakpoints
451
+ for (let g = 1; g < breakpointPositions.length && placed < Math.min(maxBreakpoints, 3); g++) {
452
+ const gap = breakpointPositions[g] - breakpointPositions[g - 1];
453
+ if (gap > CACHE_LOOKBACK_WINDOW) {
454
+ // Find a user message near the midpoint of the gap
455
+ const midTarget = Math.floor((breakpointPositions[g - 1] + breakpointPositions[g]) / 2);
456
+ for (let j = midTarget; j > breakpointPositions[g - 1]; j--) {
457
+ if (messages[j].role === "user") {
458
+ const startFrom = breakpointPositions[g - 1] + 1;
459
+ const tokensInRange = estimateTokensInRange(startFrom, j);
460
+ if (tokensInRange >= minTokens) {
461
+ addCacheControlToLastBlock(messages[j], resolvedRetention ?? retention);
462
+ placed++;
463
+ }
464
+ break;
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
470
+ return placed;
471
+ }
472
+ /* eslint-enable @typescript-eslint/no-explicit-any */
473
+ // ---------------------------------------------------------------------------
474
+ // Time-based microcompact helper
475
+ // ---------------------------------------------------------------------------
476
+ /** Minimum content length (chars) for a tool result to be considered clearable. */
477
+ const MICROCOMPACT_MIN_CONTENT_LENGTH = 1000;
478
+ /**
479
+ * Read-only tool names whose results are safely clearable during microcompact.
480
+ * Edit/write tool results are preserved because they carry the LLM's understanding
481
+ * of what was changed -- clearing them loses context.
482
+ */
483
+ const COMPACTABLE_TOOL_NAMES = new Set([
484
+ "grep", "glob", "file_read", "web_search", "web_fetch",
485
+ "exec_tool", // Shell equivalent -- output is ephemeral
486
+ "list_dir", // Directory listing -- ephemeral
487
+ "search_files", // File search -- ephemeral
488
+ ]);
489
+ /**
490
+ * Edit/write tool names whose tool_use INPUT blocks are clearable during microcompact.
491
+ * Unlike COMPACTABLE_TOOL_NAMES (which clears tool_result output), this clears the
492
+ * tool_use input (the request the LLM sent). The tool_result (what the tool returned)
493
+ * is preserved because edit/write results carry confirmation of what changed.
494
+ */
495
+ const CLEARABLE_USES_TOOL_NAMES = new Set([
496
+ "file_edit",
497
+ "file_write",
498
+ "notebook_edit",
499
+ ]);
500
+ /**
501
+ * Clear stale tool results from messages, preserving the most recent ones.
502
+ * Replaces long tool_result content with a placeholder to reduce cache-write
503
+ * token cost when the cache has expired after an idle gap.
504
+ *
505
+ * Only clears read-only (compactable) tool types. Edit/write tool
506
+ * results and orphaned results (no matching tool_use) are preserved.
507
+ *
508
+ * @param messages - The messages array (mutated in place)
509
+ * @param keepWindow - Number of most recent tool_result messages to preserve
510
+ * @returns Number of tool results cleared
511
+ */
512
+ function clearStaleToolResults(messages, keepWindow, fenceIndex = -1) {
513
+ // Build tool_use_id -> tool_name map for type filtering
514
+ const toolNameById = new Map();
515
+ for (const msg of messages) {
516
+ if (msg.role === "assistant" && Array.isArray(msg.content)) {
517
+ for (const block of msg.content) {
518
+ if (block.type === "tool_use" && typeof block.id === "string" && typeof block.name === "string") {
519
+ toolNameById.set(block.id, block.name);
520
+ }
521
+ }
522
+ }
523
+ }
524
+ // Find all tool_result indices (role === "tool" in Anthropic API format)
525
+ const toolResultIndices = [];
526
+ for (let i = 0; i < messages.length; i++) {
527
+ if (messages[i].role === "tool") {
528
+ toolResultIndices.push(i);
529
+ }
530
+ }
531
+ // Protect the last `keepWindow` tool results
532
+ const clearableIndices = toolResultIndices.slice(0, Math.max(0, toolResultIndices.length - keepWindow));
533
+ let cleared = 0;
534
+ for (const idx of clearableIndices) {
535
+ // Protect messages within the cached prefix (at or below the fence).
536
+ if (idx <= fenceIndex)
537
+ continue;
538
+ const msg = messages[idx];
539
+ // Only clear compactable (read-only) tool types
540
+ const toolUseId = msg.tool_use_id;
541
+ if (toolUseId) {
542
+ const toolName = toolNameById.get(toolUseId);
543
+ if (toolName && !COMPACTABLE_TOOL_NAMES.has(toolName)) {
544
+ continue; // Preserve edit/write tool results
545
+ }
546
+ // If tool name not found (orphaned result), skip clearing (conservative)
547
+ if (!toolName) {
548
+ continue;
549
+ }
550
+ }
551
+ const content = msg.content;
552
+ if (Array.isArray(content)) {
553
+ // Check if any content block exceeds the threshold
554
+ let totalLen = 0;
555
+ for (const block of content) {
556
+ if (typeof block.text === "string") {
557
+ totalLen += block.text.length;
558
+ }
559
+ }
560
+ if (totalLen >= MICROCOMPACT_MIN_CONTENT_LENGTH) {
561
+ // Replace content with lightweight placeholder
562
+ msg.content = [{ type: "text", text: "[Stale tool result cleared: idle > TTL]" }];
563
+ cleared++;
564
+ }
565
+ }
566
+ else if (typeof content === "string" && content.length >= MICROCOMPACT_MIN_CONTENT_LENGTH) {
567
+ msg.content = [{ type: "text", text: "[Stale tool result cleared: idle > TTL]" }];
568
+ cleared++;
569
+ }
570
+ }
571
+ // Second pass -- clear tool_use input blocks for edit/write tools.
572
+ // These tool_use blocks contain the full file content the LLM wanted to write/edit.
573
+ // After the result is confirmed, the input is no longer needed and just wastes cache space.
574
+ const assistantWithToolUseIndices = [];
575
+ for (let i = 0; i < messages.length; i++) {
576
+ const msg = messages[i];
577
+ if (msg.role === "assistant" && Array.isArray(msg.content)) {
578
+ const content = msg.content;
579
+ if (content.some(b => b.type === "tool_use")) {
580
+ assistantWithToolUseIndices.push(i);
581
+ }
582
+ }
583
+ }
584
+ const clearableAssistantIndices = assistantWithToolUseIndices.slice(0, Math.max(0, assistantWithToolUseIndices.length - keepWindow));
585
+ for (const idx of clearableAssistantIndices) {
586
+ // Protect messages within the cached prefix.
587
+ if (idx <= fenceIndex)
588
+ continue;
589
+ const msg = messages[idx];
590
+ const content = msg.content;
591
+ for (const block of content) {
592
+ if (block.type !== "tool_use")
593
+ continue;
594
+ const toolName = block.name;
595
+ if (!CLEARABLE_USES_TOOL_NAMES.has(toolName))
596
+ continue;
597
+ const inputStr = JSON.stringify(block.input);
598
+ if (inputStr.length >= MICROCOMPACT_MIN_CONTENT_LENGTH) {
599
+ block.input = { _cleared: true, reason: "stale edit/write input" };
600
+ cleared++;
601
+ }
602
+ }
603
+ }
604
+ return cleared;
605
+ }
606
+ /**
607
+ * Clear non-redacted thinking blocks from old assistant messages.
608
+ * Thinking blocks (5-20K tokens each) waste cache_creation budget when the cache
609
+ * is cold. This function strips them from assistant messages beyond the keepWindow,
610
+ * preserving redacted thinking blocks (which carry encrypted signatures for API continuity).
611
+ *
612
+ * Mutates messages in place (same pattern as clearStaleToolResults).
613
+ *
614
+ * @param messages - The messages array (mutated in place)
615
+ * @param keepWindow - Number of most recent assistant messages to preserve thinking blocks in
616
+ * @returns Number of thinking blocks cleared
617
+ */
618
+ export function clearStaleThinkingBlocks(messages, keepWindow, fenceIndex = -1) {
619
+ // Collect assistant message indices
620
+ const assistantIndices = [];
621
+ for (let i = 0; i < messages.length; i++) {
622
+ if (messages[i].role === "assistant") {
623
+ assistantIndices.push(i);
624
+ }
625
+ }
626
+ // Calculate how many are clearable (beyond keepWindow)
627
+ const clearableCount = Math.max(0, assistantIndices.length - keepWindow);
628
+ if (clearableCount === 0)
629
+ return 0;
630
+ const clearableIndices = new Set(assistantIndices.slice(0, clearableCount));
631
+ let cleared = 0;
632
+ for (const idx of clearableIndices) {
633
+ // Protect messages within the cached prefix.
634
+ if (idx <= fenceIndex)
635
+ continue;
636
+ const msg = messages[idx];
637
+ const content = msg.content;
638
+ if (!Array.isArray(content))
639
+ continue;
640
+ // Filter: keep everything EXCEPT non-redacted thinking blocks
641
+ const filtered = content.filter(block => {
642
+ if (block.type !== "thinking")
643
+ return true;
644
+ // Preserve redacted thinking blocks (encrypted signatures for API continuity)
645
+ return block.redacted === true;
646
+ });
647
+ if (filtered.length < content.length) {
648
+ cleared += content.length - filtered.length;
649
+ msg.content = filtered;
650
+ }
651
+ }
652
+ return cleared;
653
+ }
654
+ /**
655
+ * Reorder content blocks within user messages for deterministic cache prefix.
656
+ * Moves non-text blocks (images, media) before text blocks within each user message.
657
+ * This ensures attachments always appear at the start of a message, preventing
658
+ * cache prefix invalidation when the user sends text+image in varying orders.
659
+ *
660
+ * Only reorders within user messages. Assistant and tool messages are unchanged.
661
+ * Must run AFTER structuredClone and BEFORE any cache_control marker placement.
662
+ */
663
+ function reorderContentForStablePrefix(messages) {
664
+ for (const msg of messages) {
665
+ if (msg.role !== "user" || !Array.isArray(msg.content))
666
+ continue;
667
+ const content = msg.content;
668
+ if (content.length <= 1)
669
+ continue;
670
+ // Partition: non-text blocks first, then text blocks (stable sort within groups)
671
+ const nonText = [];
672
+ const text = [];
673
+ for (const block of content) {
674
+ if (block.type === "text") {
675
+ text.push(block);
676
+ }
677
+ else {
678
+ nonText.push(block);
679
+ }
680
+ }
681
+ // Only reorder if there are both types (avoid unnecessary mutations)
682
+ if (nonText.length > 0 && text.length > 0) {
683
+ msg.content = [...nonText, ...text];
684
+ }
685
+ }
686
+ }
687
+ // ---------------------------------------------------------------------------
688
+ // Tool suffix ordering for cache-stable Anthropic payloads
689
+ // ---------------------------------------------------------------------------
690
+ /**
691
+ * Sort tools for Anthropic cache prefix stability: built-in tools first
692
+ * (preserving original order), then MCP tools sorted alphabetically.
693
+ *
694
+ * This ensures dynamic MCP tool late-joins always append AFTER the cached
695
+ * built-in tool prefix, preventing mid-array insertions from busting
696
+ * Anthropic's prefix cache matching.
697
+ *
698
+ * Server-side tools (type: "tool_search_tool_*") are excluded from sorting
699
+ * and placed at the end since they are appended by the deferral pipeline.
700
+ */
701
+ export function sortToolsForCacheStability(tools) {
702
+ const builtins = [];
703
+ const mcpTools = [];
704
+ const serverTools = [];
705
+ for (const tool of tools) {
706
+ const name = tool.name ?? "";
707
+ const type = tool.type ?? "";
708
+ if (type.startsWith("tool_search_tool_")) {
709
+ serverTools.push(tool);
710
+ }
711
+ else if (name.startsWith("mcp:") || name.startsWith("mcp__")) {
712
+ mcpTools.push(tool);
713
+ }
714
+ else {
715
+ builtins.push(tool);
716
+ }
717
+ }
718
+ mcpTools.sort((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
719
+ return [...builtins, ...mcpTools, ...serverTools];
720
+ }
721
+ // ---------------------------------------------------------------------------
722
+ // Adaptive TTL promotion helpers
723
+ // ---------------------------------------------------------------------------
724
+ /**
725
+ * Identify the logical zone for a message breakpoint position.
726
+ * Three zones based on placeCacheBreakpoints() placement logic:
727
+ * - "semi-stable": Near compaction summary or first-third boundary (breakpoint #2)
728
+ * - "mid": Midpoint between semi-stable and recent (breakpoint #3.5)
729
+ * - "recent": Second-to-last user message (breakpoint #3)
730
+ *
731
+ * Uses relative position within the message array since absolute indices drift.
732
+ * Zone boundaries: first 40% = semi-stable, last 30% = recent, middle = mid.
733
+ */
734
+ export function identifyBreakpointZone(breakpointIdx, messageCount) {
735
+ if (messageCount <= 0)
736
+ return "recent";
737
+ const ratio = breakpointIdx / messageCount;
738
+ if (ratio <= 0.4)
739
+ return "semi-stable";
740
+ if (ratio >= 0.7)
741
+ return "recent";
742
+ return "mid";
743
+ }
744
+ /**
745
+ * Hash message content at and around a breakpoint position for stability tracking.
746
+ * Hashes the message at the breakpoint index plus 1 message before it (context window).
747
+ * Strips cache_control from content blocks to avoid circular dependency where
748
+ * the hash changes when TTL changes.
749
+ */
750
+ export function hashBreakpointContent(messages, breakpointIdx) {
751
+ let combined = "";
752
+ const start = Math.max(0, breakpointIdx - 1);
753
+ for (let i = start; i <= breakpointIdx && i < messages.length; i++) {
754
+ const content = messages[i].content;
755
+ if (Array.isArray(content)) {
756
+ for (const block of content) {
757
+ // Strip cache_control to avoid circular hash dependency
758
+ const { cache_control: _cc, ...rest } = block;
759
+ combined += JSON.stringify(rest);
760
+ }
761
+ }
762
+ else if (typeof content === "string") {
763
+ combined += content;
764
+ }
765
+ }
766
+ return computeHash(combined);
767
+ }
768
+ /**
769
+ * Walk placed message breakpoints, record zone hashes, and promote
770
+ * stable zones from 5m to 1h TTL. Only promotes when resolvedRetention is "long"
771
+ * (monotonicity constraint: tools >= system >= messages).
772
+ *
773
+ * Must be called AFTER placeCacheBreakpoints() and BEFORE onPayloadForCacheDetection().
774
+ *
775
+ * @param messages - The messages array with placed breakpoints
776
+ * @param tracker - BlockStabilityTracker for per-session zone tracking
777
+ * @param sessionKey - The session key for per-session state
778
+ * @param threshold - Number of consecutive unchanged calls before promotion
779
+ * @param resolvedRetention - Current cache retention level (must be "long" for promotion)
780
+ * @returns Number of breakpoints promoted from 5m to 1h TTL
781
+ */
782
+ export function maybePromoteBreakpoints(messages, tracker, sessionKey, threshold, resolvedRetention) {
783
+ // Monotonicity guard: cannot promote to 1h if tools/system use 5m
784
+ if (resolvedRetention !== "long")
785
+ return 0;
786
+ let promoted = 0;
787
+ for (let i = 0; i < messages.length; i++) {
788
+ const msg = messages[i];
789
+ const content = msg.content;
790
+ if (!Array.isArray(content))
791
+ continue;
792
+ for (const block of content) {
793
+ // Find message-level breakpoints (placed by placeCacheBreakpoints)
794
+ const cc = block.cache_control;
795
+ if (!cc || cc.type !== "ephemeral")
796
+ continue;
797
+ // Skip breakpoints that already have 1h TTL (tool/system breakpoints)
798
+ if (cc.ttl === "1h")
799
+ continue;
800
+ // This is a message breakpoint with 5m TTL -- check stability
801
+ const zone = identifyBreakpointZone(i, messages.length);
802
+ const contentHash = hashBreakpointContent(messages, i);
803
+ tracker.recordZoneHash(sessionKey, zone, contentHash);
804
+ if (tracker.isStable(sessionKey, zone, threshold)) {
805
+ // Promote to 1h TTL
806
+ block.cache_control = { type: "ephemeral", ttl: "1h" };
807
+ promoted++;
808
+ }
809
+ }
810
+ }
811
+ return promoted;
812
+ }
813
+ // ---------------------------------------------------------------------------
814
+ // Main factory
815
+ // ---------------------------------------------------------------------------
816
+ // ---------------------------------------------------------------------------
817
+ // 49-01: Per-block token estimator for TTL split estimation
818
+ // ---------------------------------------------------------------------------
819
+ /**
820
+ * Estimate the token count for a single content block.
821
+ *
822
+ * Extracts the `text` field when present (text blocks) and divides by
823
+ * CHARS_PER_TOKEN_RATIO. For non-text blocks (images, tool_use JSON) falls
824
+ * back to JSON.stringify length / CHARS_PER_TOKEN_RATIO. The 3.5 ratio
825
+ * better matches Anthropic's tokenizer than the previously used 4.0 ratio.
826
+ *
827
+ * @param block - A content block from the API payload
828
+ * @returns Estimated token count (always >= 1)
829
+ */
830
+ export function estimateBlockTokens(block) {
831
+ const text = typeof block.text === "string" ? block.text : JSON.stringify(block);
832
+ return Math.ceil(text.length / CHARS_PER_TOKEN_RATIO);
833
+ }
834
+ /**
835
+ * Create a stream wrapper that mutates the outgoing request body via the
836
+ * onPayload hook. Consolidates four concerns:
837
+ *
838
+ * 1. **Cache breakpoints** (Anthropic-family): injects cache_control markers
839
+ * at strategic positions in the message array.
840
+ * 2. **1M beta header** (direct Anthropic only): appends the context-1m beta
841
+ * header for 1M context window models.
842
+ * 3. **service_tier** (Responses API + fastMode): injects service_tier: "auto".
843
+ * 4. **store** (Responses API + storeCompletions): injects store: true.
844
+ *
845
+ * The wrapper only activates when the model matches at least one concern;
846
+ * for non-Anthropic non-Responses providers, it passes through unchanged.
847
+ *
848
+ * @param config - Request body injector configuration
849
+ * @param logger - Logger for debug output
850
+ * @returns A named StreamFnWrapper ("requestBodyInjector")
851
+ */
852
+ export function createRequestBodyInjector(config, logger) {
853
+ return function requestBodyInjector(next) {
854
+ return (model, context, options) => {
855
+ const needsCacheBreakpoints = ANTHROPIC_FAMILY.has(model.provider);
856
+ const needsResponsesApiInjection = isResponsesApiProvider(model);
857
+ if (!needsCacheBreakpoints && !needsResponsesApiInjection) {
858
+ return next(model, context, options);
859
+ }
860
+ const minTokens = config.getMinTokensOverride?.() ?? getMinCacheableTokens(model.id);
861
+ // Concern 2: 1M beta header (direct Anthropic only -- NOT Bedrock/Vertex)
862
+ // Must be injected as HTTP headers via options.headers, NOT in the request body.
863
+ // The pi-ai SDK passes options.headers to createClient() for HTTP transport,
864
+ // while onPayload mutates the JSON body -- putting headers there causes
865
+ // Anthropic API to reject with "headers: Extra inputs are not permitted".
866
+ let mergedHeaders;
867
+ if (model.provider === "anthropic") {
868
+ const existingHeaders = options?.headers;
869
+ const headers = { ...(existingHeaders ?? {}) };
870
+ const existingBetas = parseHeaderList(headers["anthropic-beta"]);
871
+ if (!existingBetas.includes(CONTEXT_1M_BETA)) {
872
+ existingBetas.push(CONTEXT_1M_BETA);
873
+ headers["anthropic-beta"] = existingBetas.join(", ");
874
+ mergedHeaders = headers;
875
+ }
876
+ // SESS-LATCH: Latch beta header on first use
877
+ const betaLatch = config.getBetaHeaderLatch?.();
878
+ if (betaLatch) {
879
+ if (mergedHeaders) {
880
+ const betaValue = mergedHeaders["anthropic-beta"];
881
+ if (betaValue) {
882
+ mergedHeaders["anthropic-beta"] = betaLatch.setOnce(betaValue);
883
+ }
884
+ }
885
+ else {
886
+ // No new headers to merge but latch has a value -- use latched value
887
+ const latched = betaLatch.get();
888
+ if (latched) {
889
+ mergedHeaders = { ...(existingHeaders ?? {}), "anthropic-beta": latched };
890
+ }
891
+ }
892
+ }
893
+ // Sticky-on beta header latches -- accumulate individual beta
894
+ // values across calls. Unlike SESS-LATCH (set-once for entire string), this
895
+ // tracks individual values and ensures once-seen-always-included semantics.
896
+ if (config.sessionKey) {
897
+ // Ensure mergedHeaders exists (even if CONTEXT_1M_BETA was already present)
898
+ if (!mergedHeaders) {
899
+ mergedHeaders = { ...(existingHeaders ?? {}) };
900
+ }
901
+ const currentBetas = parseHeaderList(mergedHeaders["anthropic-beta"]);
902
+ let latched = sessionBetaHeaderLatches.get(config.sessionKey);
903
+ if (!latched) {
904
+ latched = createAccumulativeLatch();
905
+ sessionBetaHeaderLatches.set(config.sessionKey, latched);
906
+ }
907
+ // Latch all current beta values (sticky-on: once seen, always included)
908
+ for (const beta of currentBetas) {
909
+ latched.add(beta);
910
+ }
911
+ // Merge any previously-latched values not in current set
912
+ let changed = false;
913
+ for (const beta of latched.getAll()) {
914
+ if (!currentBetas.includes(beta)) {
915
+ currentBetas.push(beta);
916
+ changed = true;
917
+ }
918
+ }
919
+ if (changed) {
920
+ mergedHeaders["anthropic-beta"] = currentBetas.join(", ");
921
+ }
922
+ }
923
+ }
924
+ // Chain onPayload: preserve any existing onPayload callback
925
+ const existingOnPayload = options?.onPayload;
926
+ const enhancedOptions = {
927
+ ...options,
928
+ ...(mergedHeaders ? { headers: mergedHeaders } : {}),
929
+ onPayload: async (payload, payloadModel) => {
930
+ // Let existing onPayload run first
931
+ const transformed = existingOnPayload
932
+ ? await existingOnPayload(payload, payloadModel)
933
+ : undefined;
934
+ const params = (transformed ?? payload);
935
+ // Clone mutable sub-structures before any mutation.
936
+ // Prevents contaminating reused content in secondary queries (title generation, compaction)
937
+ // that may share the original params reference. The SDK builds params fresh each call
938
+ // via buildParams(), but we must not mutate SDK-owned objects to prevent stale marker
939
+ // accumulation if the SDK ever caches or reuses params across calls.
940
+ const result = { ...params };
941
+ if (needsCacheBreakpoints) {
942
+ if (Array.isArray(params.system)) {
943
+ result.system = structuredClone(params.system);
944
+ }
945
+ if (Array.isArray(params.tools)) {
946
+ result.tools = structuredClone(params.tools);
947
+ }
948
+ if (Array.isArray(params.messages)) {
949
+ result.messages = structuredClone(params.messages);
950
+ }
951
+ }
952
+ // Reorder content blocks for stable prefix (before any cache marker placement)
953
+ if (needsCacheBreakpoints && Array.isArray(result.messages)) {
954
+ reorderContentForStablePrefix(result.messages);
955
+ }
956
+ // 2.1: TTL expiry guard for skipCacheWrite -- when the parent's cache write
957
+ // timestamp indicates the shared prefix cache has likely expired (>80% of TTL
958
+ // elapsed), disable skipCacheWrite so the sub-agent creates its own cache entry
959
+ // instead of referencing a stale one. Prevents 100% cache misses on round-2
960
+ // sub-agents where the 5-minute TTL expired between rounds.
961
+ // Computed early so the W2 guard below can defer to the sub-agent bypass
962
+ // path (line ~1854) for SDK-placed tool markers.
963
+ let effectiveSkipCacheWrite = config.skipCacheWrite ?? false;
964
+ if (effectiveSkipCacheWrite && config.cacheWriteTimestamp != null) {
965
+ const TTL_MAP = { short: 300_000, long: 3_600_000 };
966
+ const ttlMs = TTL_MAP[config.parentCacheRetention ?? "short"] ?? 300_000;
967
+ const SAFETY_MARGIN = 0.8;
968
+ const elapsed = Date.now() - config.cacheWriteTimestamp;
969
+ if (elapsed > ttlMs * SAFETY_MARGIN) {
970
+ effectiveSkipCacheWrite = false;
971
+ logger.debug({ elapsed, ttlMs, safetyMargin: SAFETY_MARGIN, sessionKey: config.sessionKey }, "TTL likely expired, disabling skipCacheWrite");
972
+ }
973
+ }
974
+ // pi-ai 0.67.4+ auto-places cache_control on the last tool in
975
+ // convertTools(). W2 keeps tools at zero breakpoints (cached
976
+ // implicitly via the cumulative hash at the system breakpoint), so
977
+ // strip the auto-placed marker before our budget + zone strategy runs.
978
+ //
979
+ // Skipped for effectiveSkipCacheWrite=true (sub-agent path): single-turn
980
+ // sub-agents need SDK-placed markers intact to match the parent's cached
981
+ // prefix; multi-turn sub-agents strip+re-place at line ~1874 anyway.
982
+ if (needsCacheBreakpoints && !effectiveSkipCacheWrite && Array.isArray(result.tools)) {
983
+ for (const tool of result.tools) {
984
+ if (tool.cache_control)
985
+ delete tool.cache_control;
986
+ }
987
+ }
988
+ // Sort tools for cache-stable prefix: builtins first, MCP alphabetically
989
+ if (needsCacheBreakpoints && Array.isArray(result.tools) && result.tools.length > 0) {
990
+ result.tools = sortToolsForCacheStability(result.tools);
991
+ }
992
+ // Rendered tool cache -- ensures byte-identical
993
+ // tool JSON across turns when composition is unchanged. On aggregate cache miss,
994
+ // per-tool content-addressed memoization preserves unchanged individual tools.
995
+ if (config.sessionKey && needsCacheBreakpoints && Array.isArray(result.tools)) {
996
+ // When ALL MCP tools use defer_loading, tool composition is guaranteed stable.
997
+ // Skip per-tool hash recomputation since no MCP tool connect/disconnect can change schemas.
998
+ // Only activate after defer_loading latch is set AND tool cache exists (not first turn).
999
+ const allDeferredToolHashSkip = (() => {
1000
+ if (!config.getDeferredToolNames || !config.getTotalMcpToolCount)
1001
+ return false;
1002
+ const deferredNames = config.getDeferredToolNames();
1003
+ const totalMcpTools = config.getTotalMcpToolCount();
1004
+ if (totalMcpTools === 0 || deferredNames.size === 0)
1005
+ return false;
1006
+ // All MCP tools deferred AND we have a cached entry from a prior turn
1007
+ return deferredNames.size >= totalMcpTools && sessionRenderedToolCache.has(config.sessionKey);
1008
+ })();
1009
+ if (allDeferredToolHashSkip) {
1010
+ logger.debug({ sessionKey: config.sessionKey }, "All tools deferred, skipping per-tool hash recomputation");
1011
+ // Use cached tools from prior turn (already in sessionRenderedToolCache)
1012
+ const cached = sessionRenderedToolCache.get(config.sessionKey);
1013
+ if (cached) {
1014
+ result.tools = structuredClone(cached.tools);
1015
+ }
1016
+ }
1017
+ else {
1018
+ const tools = result.tools;
1019
+ const renderedHash = computeRenderedToolsHash(tools);
1020
+ // Include feature flag hash so config changes that affect tool rendering
1021
+ // invalidate the cached tool array.
1022
+ const featureFlagHash = config.featureFlagHash ?? "default";
1023
+ const cached = sessionRenderedToolCache.get(config.sessionKey);
1024
+ if (cached && cached.hash === renderedHash && cached.featureFlagHash === featureFlagHash) {
1025
+ // Aggregate cache hit -- replace with cached copy for byte-identical output
1026
+ result.tools = structuredClone(cached.tools);
1027
+ }
1028
+ else {
1029
+ // Aggregate hash changed -- iterate per-tool cache.
1030
+ // Unchanged individual tools keep byte-identical references while
1031
+ // changed ones get new snapshots via getOrCacheRenderedTool().
1032
+ const perToolCached = tools.map(t => getOrCacheRenderedTool(config.sessionKey, t));
1033
+ // Store rebuilt array as new aggregate snapshot
1034
+ result.tools = perToolCached;
1035
+ sessionRenderedToolCache.set(config.sessionKey, {
1036
+ hash: renderedHash,
1037
+ featureFlagHash,
1038
+ tools: structuredClone(perToolCached), // Snapshot before cache_control
1039
+ });
1040
+ }
1041
+ }
1042
+ }
1043
+ // Time-based microcompact -- clear stale tool results when cache is cold.
1044
+ // Runs BEFORE breakpoint placement because clearing results changes message sizes.
1045
+ // Fence-aware — skip clearing messages at/below the previous turn's
1046
+ // cache fence to preserve prefix stability after cache breaks.
1047
+ if (needsCacheBreakpoints && config.getElapsedSinceLastResponse && config.sessionKey) {
1048
+ const elapsed = config.getElapsedSinceLastResponse();
1049
+ if (elapsed !== undefined) {
1050
+ // Determine TTL from current retention (pre-latch, since we're checking if cache is cold)
1051
+ const baseRetentionForTtl = config.getCacheRetention() ?? "long";
1052
+ const ttlMs = baseRetentionForTtl === "long" ? 3_600_000 : 300_000;
1053
+ if (elapsed > ttlMs && Array.isArray(result.messages)) {
1054
+ const keepWindow = config.observationKeepWindow ?? 25;
1055
+ const microcompactFence = config.getCacheFenceIndex?.() ?? -1;
1056
+ const cleared = clearStaleToolResults(result.messages, keepWindow, microcompactFence);
1057
+ // Also clear thinking blocks from old assistant messages
1058
+ const thinkingCleared = clearStaleThinkingBlocks(result.messages, keepWindow, microcompactFence);
1059
+ if (cleared > 0 || thinkingCleared > 0) {
1060
+ config.onContentModification?.();
1061
+ if (cleared > 0)
1062
+ config.onAdaptiveRetentionReset?.();
1063
+ logger.debug({ cleared, thinkingCleared, elapsedMs: elapsed, ttlMs, keepWindow, sessionKey: config.sessionKey }, "Time-based microcompact cleared stale content");
1064
+ }
1065
+ }
1066
+ }
1067
+ }
1068
+ // Token-ceiling microcompact -- clear stale content when context grows too large.
1069
+ // Runs independently of TTL: a session with rapid back-and-forth can accumulate massive
1070
+ // context within a single TTL window. Unlike TTL trigger, does NOT reset adaptive retention
1071
+ // because the cache may still be warm.
1072
+ // Fence-aware — respects cache fence.
1073
+ if (needsCacheBreakpoints && config.microcompactTokenCeiling && config.sessionKey) {
1074
+ const msgs = result.messages;
1075
+ if (Array.isArray(msgs)) {
1076
+ const estimatedTokens = estimateContextChars(msgs) / CHARS_PER_TOKEN_RATIO;
1077
+ if (estimatedTokens > config.microcompactTokenCeiling) {
1078
+ const keepWindow = config.observationKeepWindow ?? 25;
1079
+ const ceilingFence = config.getCacheFenceIndex?.() ?? -1;
1080
+ const cleared = clearStaleToolResults(msgs, keepWindow, ceilingFence);
1081
+ const thinkingCleared = clearStaleThinkingBlocks(msgs, keepWindow, ceilingFence);
1082
+ if (cleared > 0 || thinkingCleared > 0) {
1083
+ config.onContentModification?.();
1084
+ // NOTE: Do NOT call onAdaptiveRetentionReset -- cache may still be warm
1085
+ logger.debug({ cleared, thinkingCleared, estimatedTokens: Math.round(estimatedTokens), ceiling: config.microcompactTokenCeiling, sessionKey: config.sessionKey }, "Token-ceiling microcompact cleared stale content");
1086
+ }
1087
+ }
1088
+ }
1089
+ }
1090
+ // Prefix stability diagnostic — detect when microcompaction
1091
+ // changes the cache-fenced prefix between turns (indicating permanent cache collapse).
1092
+ // Fence-index-aware: growing fence (normal conversation growth) is benign unless
1093
+ // the old prefix content was mutated. Fence shrink (compaction) resets the counter.
1094
+ // Uses getCacheFenceIndex() to hash only the cached region; skips detection
1095
+ // when no fence is set yet (early bootstrap / non-Anthropic provider).
1096
+ if (needsCacheBreakpoints && config.sessionKey && Array.isArray(result.messages)) {
1097
+ const diagFenceIdx = config.getCacheFenceIndex?.() ?? -1;
1098
+ if (diagFenceIdx >= 0) {
1099
+ const msgs = result.messages;
1100
+ /** Hash role + first 200 chars of content for messages up to endIdx (inclusive). */
1101
+ const hashMessageSlice = (messages, endIdx) => {
1102
+ const slice = messages.slice(0, endIdx + 1);
1103
+ return computeHash(slice.map(m => {
1104
+ const c = m.content;
1105
+ const text = typeof c === "string" ? c.slice(0, 200) :
1106
+ Array.isArray(c) ? c.map(b => String(b.text ?? b.type ?? "")).join("").slice(0, 200) : "";
1107
+ return `${m.role}:${text}`;
1108
+ }));
1109
+ };
1110
+ const prefixHash = hashMessageSlice(msgs, diagFenceIdx);
1111
+ const prev = sessionPrefixStability.get(config.sessionKey);
1112
+ if (!prev) {
1113
+ // First observation — store baseline, no comparison needed
1114
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: 0 });
1115
+ }
1116
+ else if (diagFenceIdx < prev.fenceIdx) {
1117
+ // Case C: Fence shrank (compaction reset) — reset counter entirely
1118
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: 0 });
1119
+ }
1120
+ else if (diagFenceIdx > prev.fenceIdx) {
1121
+ // Case A: Fence grew (normal conversation growth).
1122
+ // Re-hash using the old fence boundary to check if old prefix content is intact.
1123
+ const oldRangeHash = hashMessageSlice(msgs, prev.fenceIdx);
1124
+ if (oldRangeHash === prev.hash) {
1125
+ // Old prefix content unchanged — benign growth, reset counter
1126
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: 0 });
1127
+ }
1128
+ else {
1129
+ // Old prefix content was mutated — genuine instability
1130
+ const changes = prev.consecutiveChanges + 1;
1131
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: changes });
1132
+ if (changes >= 3) {
1133
+ logger.warn({
1134
+ sessionKey: config.sessionKey,
1135
+ consecutiveChanges: changes,
1136
+ hint: "Cache prefix changing every turn — microcompaction or content modification destabilizing the prefix. Cache writes are wasted.",
1137
+ errorKind: "performance",
1138
+ }, "Unstable prefix detected");
1139
+ }
1140
+ }
1141
+ }
1142
+ else {
1143
+ // Case B: Same fence position — direct hash comparison
1144
+ if (prev.hash !== prefixHash) {
1145
+ const changes = prev.consecutiveChanges + 1;
1146
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: changes });
1147
+ if (changes >= 3) {
1148
+ logger.warn({
1149
+ sessionKey: config.sessionKey,
1150
+ consecutiveChanges: changes,
1151
+ hint: "Cache prefix changing every turn — microcompaction or content modification destabilizing the prefix. Cache writes are wasted.",
1152
+ errorKind: "performance",
1153
+ }, "Unstable prefix detected");
1154
+ }
1155
+ }
1156
+ else {
1157
+ // Prefix stable — reset counter
1158
+ sessionPrefixStability.set(config.sessionKey, { hash: prefixHash, fenceIdx: diagFenceIdx, consecutiveChanges: 0 });
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+ // Hoist resolvedRetention for kill switch access after needsCacheBreakpoints block
1164
+ let resolvedRetention;
1165
+ // Concern 1: Cache breakpoints (Anthropic-family)
1166
+ if (needsCacheBreakpoints) {
1167
+ // Resolve per-model cache retention override before latching
1168
+ const baseRetention = config.getCacheRetention() ?? "long";
1169
+ const modelId = config.getModelId?.() ?? model.id;
1170
+ const effectiveRetention = resolveCacheRetention(modelId, baseRetention, config.getCacheRetentionOverrides?.());
1171
+ // Latch retention on first resolution
1172
+ const rawRetention = effectiveRetention;
1173
+ const retentionLatch = config.getRetentionLatch?.();
1174
+ resolvedRetention = retentionLatch
1175
+ ? retentionLatch.setOnce(rawRetention)
1176
+ : rawRetention;
1177
+ // Replace single system block with multi-block for independent caching.
1178
+ // Must run AFTER structuredClone (operates on cloned system) and BEFORE the
1179
+ // TTL upgrade (so all new blocks get upgraded). The SDK-placed single-block
1180
+ // cache_control is discarded -- we inject cache_control on all blocks explicitly.
1181
+ const promptBlocks = config.getSystemPromptBlocks?.();
1182
+ if (promptBlocks && Array.isArray(result.system)) {
1183
+ const blocks = [
1184
+ { type: "text", text: promptBlocks.staticPrefix + SYSTEM_PROMPT_DYNAMIC_BOUNDARY },
1185
+ ];
1186
+ // Attribution block only when non-empty (empty in "none" mode)
1187
+ if (promptBlocks.attribution) {
1188
+ blocks.push({ type: "text", text: promptBlocks.attribution });
1189
+ }
1190
+ blocks.push({ type: "text", text: promptBlocks.semiStableBody });
1191
+ result.system = blocks;
1192
+ // Only last system block gets cache_control -- cumulative hash covers
1193
+ // all prior blocks. Frees 2 breakpoint slots for message breakpoints.
1194
+ const sysBlocks = result.system;
1195
+ for (const block of sysBlocks) {
1196
+ delete block.cache_control;
1197
+ }
1198
+ sysBlocks[sysBlocks.length - 1].cache_control = resolvedRetention === "long"
1199
+ ? { type: "ephemeral", ttl: "1h" }
1200
+ : { type: "ephemeral" };
1201
+ logger.debug({ blockCount: blocks.length, retention: resolvedRetention, modelId: model.id }, "Multi-block system prompt injected");
1202
+ }
1203
+ // Log first system prompt block hash for prefix-matching debug.
1204
+ // Runs after multi-block injection so the hash reflects the final static prefix.
1205
+ if (Array.isArray(result.system)) {
1206
+ const sysBlocks = result.system;
1207
+ if (sysBlocks.length > 0 && typeof sysBlocks[0]?.text === "string") {
1208
+ const text = sysBlocks[0].text;
1209
+ logger.debug({
1210
+ firstBlockHash: djb2(text),
1211
+ firstBlockSnippet: text.slice(0, 80).replace(/\n/g, "\\n"),
1212
+ blockCount: sysBlocks.length,
1213
+ modelId: model.id,
1214
+ }, "System prompt first-block hash");
1215
+ }
1216
+ }
1217
+ // Upgrade system prompt TTL to satisfy monotonicity constraint.
1218
+ // The SDK always sets system blocks to { type: "ephemeral" } (5m) because
1219
+ // configResolver passes getMessageRetention() = "short" for the SDK's
1220
+ // cacheRetention option (we can't give the SDK different values for system
1221
+ // vs last-user-message). But after adaptive escalation, the tool breakpoint
1222
+ // uses ttl: "1h". Without this upgrade, system(5m) -> tools(1h) violates
1223
+ // Anthropic's non-increasing TTL requirement, causing the API to silently
1224
+ // downgrade tools to 5m.
1225
+ if (resolvedRetention === "long" && Array.isArray(result.system)) {
1226
+ for (const block of result.system) {
1227
+ if (block.cache_control) {
1228
+ block.cache_control = { type: "ephemeral", ttl: "1h" };
1229
+ }
1230
+ }
1231
+ }
1232
+ // Count breakpoints on `result` (post-clone, post-multi-block-injection)
1233
+ // not `params` (pre-clone). Multi-block injection may have added cache_control to
1234
+ // 2 system blocks that didn't exist in the original params.
1235
+ const existingCount = countCacheBreakpoints(result);
1236
+ let slotsAvailable = 4 - existingCount;
1237
+ // Breakpoint budget audit -- 1 per API call.
1238
+ {
1239
+ let systemBpCount = 0;
1240
+ let toolBpCount = 0;
1241
+ if (Array.isArray(result.system)) {
1242
+ for (const block of result.system) {
1243
+ if (block.cache_control)
1244
+ systemBpCount++;
1245
+ }
1246
+ }
1247
+ if (Array.isArray(result.tools)) {
1248
+ for (const tool of result.tools) {
1249
+ if (tool.cache_control)
1250
+ toolBpCount++;
1251
+ }
1252
+ }
1253
+ logger.info({
1254
+ existingCount,
1255
+ slotsAvailable,
1256
+ systemBreakpoints: systemBpCount,
1257
+ toolBreakpoints: toolBpCount,
1258
+ modelId: model.id,
1259
+ }, "Breakpoint budget audit (pre-message-placement)");
1260
+ }
1261
+ // W2: Tool breakpoint removed -- tools cached implicitly via cumulative hash
1262
+ // at system breakpoint position (zero tool breakpoints).
1263
+ // DEFER-TOOL: Inject defer_loading on deferred tools for Anthropic non-Haiku models.
1264
+ // Runs after tool cache breakpoints so deferred marking doesn't pollute breakpoint logic.
1265
+ if (config.getDeferredToolNames && supportsToolSearch(model.id)) {
1266
+ const deferredNames = config.getDeferredToolNames();
1267
+ // SESS-LATCH: Latch defer_loading activation
1268
+ const deferLatch = config.getDeferLoadingLatch?.();
1269
+ const shouldDeferLoad = deferLatch
1270
+ ? deferLatch.setOnce(deferredNames.size > 0)
1271
+ : deferredNames.size > 0;
1272
+ if (shouldDeferLoad && Array.isArray(result.tools)) {
1273
+ const tools = result.tools;
1274
+ let deferCount = 0;
1275
+ for (const tool of tools) {
1276
+ if (deferredNames.has(tool.name)) {
1277
+ tool.defer_loading = true;
1278
+ deferCount++;
1279
+ }
1280
+ }
1281
+ // Only switch to server-side tool_search when tools were actually
1282
+ // marked defer_loading in the payload. When deferred tools are
1283
+ // excluded upstream (tool-deferral.ts client-side exclusion),
1284
+ // deferCount is 0 and the payload lacks deferred definitions —
1285
+ // injecting tool_search_tool without any deferred tools crashes
1286
+ // the Anthropic API/SDK.
1287
+ if (deferCount > 0) {
1288
+ // Remove client-side discover_tools (replaced by server-side tool_search)
1289
+ const discoverIdx = tools.findIndex(t => t.name === "discover_tools");
1290
+ if (discoverIdx !== -1) {
1291
+ tools.splice(discoverIdx, 1);
1292
+ }
1293
+ // Append server-side search tool (only if not already present)
1294
+ const hasSearchTool = tools.some(t => typeof t.type === "string" && t.type.startsWith("tool_search_tool_"));
1295
+ if (!hasSearchTool) {
1296
+ tools.push({
1297
+ type: "tool_search_tool_regex_20251119",
1298
+ name: "tool_search_tool_regex",
1299
+ });
1300
+ }
1301
+ }
1302
+ logger.debug({ deferCount, modelId: model.id, searchToolAppended: deferCount > 0 }, "DEFER-TOOL: Injected defer_loading on deferred tools");
1303
+ }
1304
+ }
1305
+ // GRAPH-BREAKPOINT: Place a cache breakpoint on graph context envelope.
1306
+ // Wave 2+ subagents and graph-enabled sessions receive injected research
1307
+ // results as the first user message. This dynamic content (~100K+ tokens)
1308
+ // falls between the standard cache breakpoints, paying full uncached input
1309
+ // rate. Placing a breakpoint captures it under the cache prefix.
1310
+ // Must run INSIDE the budget-aware block to consume a slot from slotsAvailable.
1311
+ if (slotsAvailable > 0 && !effectiveSkipCacheWrite && Array.isArray(result.messages)) {
1312
+ const msgs = result.messages;
1313
+ for (let i = 0; i < Math.min(msgs.length, 3); i++) {
1314
+ const msg = msgs[i];
1315
+ if (msg.role !== "user")
1316
+ continue;
1317
+ const content = Array.isArray(msg.content) ? msg.content : [];
1318
+ const hasGraphContext = content.some((block) => typeof block.text === "string" && block.text.includes("## Graph Context"));
1319
+ if (hasGraphContext) {
1320
+ addCacheControlToLastBlock(msg, resolvedRetention ?? "long");
1321
+ slotsAvailable--;
1322
+ logger.debug({ modelId: model.id, messageIndex: i, sessionKey: config.sessionKey }, "GRAPH-BREAKPOINT: Placed cache breakpoint on graph context envelope message");
1323
+ break;
1324
+ }
1325
+ }
1326
+ }
1327
+ // During eviction cooldown, limit to 1 breakpoint (recent zone) at "short" retention.
1328
+ const evictionCooldown = config.getEvictionCooldown?.();
1329
+ const inCooldown = evictionCooldown != null && evictionCooldown.turnsRemaining > 0;
1330
+ if (slotsAvailable > 0 && Array.isArray(result.messages)) {
1331
+ // Conversation breakpoints use zone-aware retention.
1332
+ // Recent zone always uses "short" (5m); semi-stable/mid zones get escalated retention.
1333
+ const messageRetention = config.getMessageRetention?.() ?? resolvedRetention;
1334
+ const placed = placeCacheBreakpoints(result.messages, {
1335
+ minTokens,
1336
+ maxBreakpoints: inCooldown ? 1 : slotsAvailable,
1337
+ retention: "short", // Recent zone always "short" (5m)
1338
+ resolvedRetention: inCooldown ? "short" : messageRetention, // Force "short" during cooldown
1339
+ strategy: resolveBreakpointStrategy(config.cacheBreakpointStrategy, model.provider),
1340
+ skipCacheWrite: effectiveSkipCacheWrite,
1341
+ });
1342
+ if (placed > 0) {
1343
+ logger.debug({
1344
+ placed,
1345
+ existingCount,
1346
+ totalBreakpoints: existingCount + placed,
1347
+ minTokens,
1348
+ modelId: model.id,
1349
+ strategy: resolveBreakpointStrategy(config.cacheBreakpointStrategy, model.provider),
1350
+ }, "Message breakpoints placed");
1351
+ }
1352
+ else if (Array.isArray(result.messages) && result.messages.length >= 4) {
1353
+ logger.debug({ messageCount: result.messages.length, minTokens, modelId: model.id, existingCount }, "Cache breakpoints skipped: token gaps below minTokens threshold");
1354
+ }
1355
+ // W12: Unconditional scan for ANY message breakpoint (including SDK auto-marker).
1356
+ // Ensures cacheFenceIndex is set for all sessions, not just those with explicit placements.
1357
+ if (config.onBreakpointsPlaced && Array.isArray(result.messages)) {
1358
+ let highestBreakpointIdx = -1;
1359
+ const scanMsgs = result.messages;
1360
+ for (let i = scanMsgs.length - 1; i >= 0; i--) {
1361
+ const content = scanMsgs[i].content;
1362
+ if (Array.isArray(content)) {
1363
+ for (const block of content) {
1364
+ if (block.cache_control) {
1365
+ highestBreakpointIdx = i;
1366
+ break;
1367
+ }
1368
+ }
1369
+ }
1370
+ if (highestBreakpointIdx >= 0)
1371
+ break;
1372
+ }
1373
+ if (highestBreakpointIdx >= 0) {
1374
+ config.onBreakpointsPlaced(highestBreakpointIdx);
1375
+ logger.debug({ highestBreakpointIdx, modelId: model.id }, "Cache fence callback fired");
1376
+ }
1377
+ }
1378
+ }
1379
+ // W12-FALLBACK: When all breakpoint slots are consumed, still scan for SDK auto-marker
1380
+ // to set cache fence. The SDK always places a marker on the last user message.
1381
+ if (slotsAvailable <= 0 && config.onBreakpointsPlaced && Array.isArray(result.messages)) {
1382
+ let highestBreakpointIdx = -1;
1383
+ const fallbackMsgs = result.messages;
1384
+ for (let i = fallbackMsgs.length - 1; i >= 0; i--) {
1385
+ const content = fallbackMsgs[i].content;
1386
+ if (Array.isArray(content)) {
1387
+ for (const block of content) {
1388
+ if (block.cache_control) {
1389
+ highestBreakpointIdx = i;
1390
+ break;
1391
+ }
1392
+ }
1393
+ }
1394
+ if (highestBreakpointIdx >= 0)
1395
+ break;
1396
+ }
1397
+ if (highestBreakpointIdx >= 0) {
1398
+ config.onBreakpointsPlaced(highestBreakpointIdx);
1399
+ logger.debug({ highestBreakpointIdx, modelId: model.id, source: "sdk-auto-marker" }, "W12-FALLBACK: Cache fence set from SDK auto-marker (no explicit slots available)");
1400
+ }
1401
+ }
1402
+ // Warn when cache fence remains unset in mature conversation.
1403
+ // This indicates no cache_control markers exist on any message -- neither explicit nor SDK auto.
1404
+ if (config.onBreakpointsPlaced && Array.isArray(result.messages) && result.messages.length >= 10) {
1405
+ const scanForFence = result.messages;
1406
+ let fenceFound = false;
1407
+ for (let i = scanForFence.length - 1; i >= 0; i--) {
1408
+ const content = scanForFence[i].content;
1409
+ if (Array.isArray(content)) {
1410
+ for (const block of content) {
1411
+ if (block.cache_control) {
1412
+ fenceFound = true;
1413
+ break;
1414
+ }
1415
+ }
1416
+ }
1417
+ if (fenceFound)
1418
+ break;
1419
+ }
1420
+ if (!fenceFound) {
1421
+ logger.warn({
1422
+ messageCount: result.messages.length,
1423
+ modelId: model.id,
1424
+ hint: "No cache breakpoint found on any message in mature conversation. Cache fence is unset -- thinking block cleaner has no protection boundary.",
1425
+ errorKind: "performance",
1426
+ }, "Cache fence unset in mature session");
1427
+ }
1428
+ }
1429
+ // W7: Diagnostic WARN when breakpoint budget exhausted on mature conversation.
1430
+ if (slotsAvailable <= 0 && Array.isArray(result.messages) && result.messages.length >= 20) {
1431
+ logger.warn({
1432
+ existingCount,
1433
+ messageCount: result.messages.length,
1434
+ modelId: model.id,
1435
+ hint: "Breakpoint budget exhausted before message breakpoints. System prompt may need consolidation or tool breakpoint reduction.",
1436
+ errorKind: "performance",
1437
+ }, "W7: Cache breakpoint budget exhausted -- no message breakpoints placed on mature conversation");
1438
+ }
1439
+ }
1440
+ // Promote stable message breakpoints from 5m to 1h TTL
1441
+ // Skip breakpoint TTL promotion during eviction cooldown (conservative caching).
1442
+ {
1443
+ const cooldownForPromotion = config.getEvictionCooldown?.();
1444
+ const promotionBlocked = cooldownForPromotion != null && cooldownForPromotion.turnsRemaining > 0;
1445
+ if (config.blockStabilityTracker && config.sessionKey && !effectiveSkipCacheWrite && !promotionBlocked) {
1446
+ const promotionThreshold = config.stabilityThreshold ?? 3;
1447
+ const promotedCount = maybePromoteBreakpoints(result.messages, config.blockStabilityTracker, config.sessionKey, promotionThreshold, resolvedRetention);
1448
+ if (promotedCount > 0) {
1449
+ logger.debug({ promoted: promotedCount, threshold: promotionThreshold, modelId: model.id }, "Message breakpoints promoted to 1h TTL");
1450
+ }
1451
+ }
1452
+ } // end eviction cooldown promotion scope
1453
+ // Sticky-on sweep -- capture any beta headers modified inside onPayload
1454
+ // and merge previously-latched values. Ensures consistency regardless of where
1455
+ // beta headers are added (outer scope or inside onPayload callbacks).
1456
+ if (config.sessionKey && mergedHeaders) {
1457
+ const allBetas = parseHeaderList(mergedHeaders["anthropic-beta"]);
1458
+ let latched = sessionBetaHeaderLatches.get(config.sessionKey);
1459
+ if (!latched) {
1460
+ latched = createAccumulativeLatch();
1461
+ sessionBetaHeaderLatches.set(config.sessionKey, latched);
1462
+ }
1463
+ for (const beta of allBetas)
1464
+ latched.add(beta);
1465
+ // Inject any previously latched values not yet in current headers
1466
+ let changed = false;
1467
+ for (const beta of latched.getAll()) {
1468
+ if (!allBetas.includes(beta)) {
1469
+ allBetas.push(beta);
1470
+ changed = true;
1471
+ }
1472
+ }
1473
+ if (changed) {
1474
+ mergedHeaders["anthropic-beta"] = allBetas.join(", ");
1475
+ }
1476
+ }
1477
+ // Feed payload to cache break detector Phase 1 (after breakpoint placement)
1478
+ if (config.onPayloadForCacheDetection) {
1479
+ config.onPayloadForCacheDetection(result, model, mergedHeaders);
1480
+ }
1481
+ // SDK-UPGRADE: Upgrade SDK auto-placed 5m markers to 1h when retention is long.
1482
+ // The pi-ai SDK places cache_control: { type: "ephemeral" } (5m TTL) on the last
1483
+ // user message. When the session uses "long" retention, these 5m writes waste money
1484
+ // because they expire before the conversation can reuse them. Upgrading to 1h aligns
1485
+ // SDK markers with our retention strategy.
1486
+ // Runs BEFORE (skipCacheWrite overrides these anyway for subagents) and
1487
+ // BEFORE TTL split estimation (so estimates see the upgraded TTLs).
1488
+ // Note: message markers respect getMessageRetention (may be "short" even when
1489
+ // resolvedRetention is "long" -- e.g., adaptive retention splits tool/system from
1490
+ // conversation). System and tool markers always use resolvedRetention.
1491
+ if (needsCacheBreakpoints && resolvedRetention === "long" && !effectiveSkipCacheWrite) {
1492
+ const upgradeMarkers = (blocks) => {
1493
+ for (const block of blocks) {
1494
+ const cc = block.cache_control;
1495
+ if (cc && cc.type === "ephemeral" && !cc.ttl) {
1496
+ cc.ttl = "1h";
1497
+ }
1498
+ }
1499
+ };
1500
+ // Upgrade system blocks (always follow resolvedRetention)
1501
+ if (Array.isArray(result.system)) {
1502
+ upgradeMarkers(result.system);
1503
+ }
1504
+ // Upgrade tool blocks (always follow resolvedRetention)
1505
+ if (Array.isArray(result.tools)) {
1506
+ upgradeMarkers(result.tools);
1507
+ }
1508
+ // Do NOT upgrade message markers here. placeCacheBreakpoints
1509
+ // already assigns zone-aware TTLs: semi-stable/mid get 1h, recent stays 5m.
1510
+ // Upgrading all message markers would override the intentionally "short"
1511
+ // recent-zone markers. System and tool markers above still get upgraded.
1512
+ // The SDK's auto-placed marker on the last user message is in the recent
1513
+ // zone and should remain at 5m.
1514
+ logger.debug({ modelId: model.id, sessionKey: config.sessionKey }, "SDK-UPGRADE: Upgraded SDK 5m auto-markers to 1h for long retention");
1515
+ }
1516
+ // skipCacheWrite places marker at shared-prefix point instead of stripping all.
1517
+ // The second-to-last user message is the shared-prefix boundary -- the parent's cache
1518
+ // already covers everything up to that point. Placing a marker there (instead of stripping)
1519
+ // lets the server merge with the existing cache entry without creating new writes.
1520
+ if (needsCacheBreakpoints && effectiveSkipCacheWrite && Array.isArray(result.messages)) {
1521
+ const msgs = result.messages;
1522
+ // Count user messages FIRST. Single-turn sub-agents (userCount < 2) have
1523
+ // no second-to-last-user anchor, so the shared-prefix strip+replace logic
1524
+ // cannot do anything useful. If we stripped markers unconditionally, the
1525
+ // request would reach Anthropic with ZERO cache_control anywhere -> 100%
1526
+ // cache miss, full-price input tokens. Bypass here so the SDK's earlier
1527
+ // auto-placed markers (system/tools, and last-user at 5m) remain intact
1528
+ // and the sub-agent can still match the parent's cached prefix.
1529
+ let userCount = 0;
1530
+ for (const msg of msgs) {
1531
+ if (msg.role === "user")
1532
+ userCount++;
1533
+ }
1534
+ if (userCount < 2) {
1535
+ logger.debug({ modelId: model.id, sessionKey: config.sessionKey, userCount }, "skipCacheWrite bypassed -- single-turn sub-agent keeps standard cache markers");
1536
+ }
1537
+ else {
1538
+ // Strip system block cache_control markers (shared prefix)
1539
+ if (Array.isArray(result.system)) {
1540
+ for (const block of result.system) {
1541
+ delete block.cache_control;
1542
+ }
1543
+ }
1544
+ // Strip tool definition cache_control markers (shared prefix)
1545
+ if (Array.isArray(result.tools)) {
1546
+ for (const tool of result.tools) {
1547
+ delete tool.cache_control;
1548
+ }
1549
+ }
1550
+ // Strip all existing message-level cache_control markers
1551
+ for (const msg of msgs) {
1552
+ if (Array.isArray(msg.content)) {
1553
+ for (const block of msg.content) {
1554
+ delete block.cache_control;
1555
+ }
1556
+ }
1557
+ }
1558
+ // Then: place marker on second-to-last user message (shared-prefix point)
1559
+ let seen = 0;
1560
+ for (let i = msgs.length - 1; i >= 0; i--) {
1561
+ if (msgs[i].role === "user") {
1562
+ seen++;
1563
+ if (seen === 2) {
1564
+ addCacheControlToLastBlock(msgs[i], resolvedRetention ?? "long");
1565
+ break;
1566
+ }
1567
+ }
1568
+ }
1569
+ // Re-place marker on last user message (volatile per-turn content).
1570
+ // The SDK's auto-placed last-user-message marker was stripped above. Re-placing
1571
+ // with "short" (5m) TTL ensures the last user message (with tool results) gets
1572
+ // cache reads ($0.30/MTok) instead of full-price uncached input ($3/MTok).
1573
+ for (let i = msgs.length - 1; i >= 0; i--) {
1574
+ if (msgs[i].role === "user") {
1575
+ addCacheControlToLastBlock(msgs[i], "short");
1576
+ break;
1577
+ }
1578
+ }
1579
+ logger.debug({ modelId: model.id, sessionKey: config.sessionKey, markerPlaced: true, lastUserMarkerPlaced: true }, "skipCacheWrite shared-prefix marker placement");
1580
+ }
1581
+ }
1582
+ // Kill switch -- strip ALL cache_control when resolved retention is "none".
1583
+ // Must run AFTER all breakpoint/marker placement (system, tools, messages) so
1584
+ // nothing gets re-added after the strip pass.
1585
+ if (needsCacheBreakpoints && resolvedRetention === "none") {
1586
+ if (Array.isArray(result.system)) {
1587
+ for (const block of result.system) {
1588
+ delete block.cache_control;
1589
+ }
1590
+ }
1591
+ if (Array.isArray(result.tools)) {
1592
+ for (const tool of result.tools) {
1593
+ delete tool.cache_control;
1594
+ }
1595
+ }
1596
+ if (Array.isArray(result.messages)) {
1597
+ for (const msg of result.messages) {
1598
+ if (Array.isArray(msg.content)) {
1599
+ for (const block of msg.content) {
1600
+ delete block.cache_control;
1601
+ }
1602
+ }
1603
+ }
1604
+ }
1605
+ logger.debug({ modelId: model.id, sessionKey: config.sessionKey }, "Kill switch active -- stripped all cache_control markers");
1606
+ }
1607
+ // Count per-TTL token distribution from final cache_control markers.
1608
+ // Runs AFTER all breakpoint placement and kill-switch stripping so counts
1609
+ // reflect the exact markers sent to the API.
1610
+ if (config.onTtlSplitEstimate && needsCacheBreakpoints) {
1611
+ let cacheWrite5mTokens = 0;
1612
+ let cacheWrite1hTokens = 0;
1613
+ // Uses module-level estimateBlockTokens (text extraction + CHARS_PER_TOKEN_RATIO)
1614
+ // Count system blocks with cache_control
1615
+ if (Array.isArray(result.system)) {
1616
+ for (const block of result.system) {
1617
+ if (block.cache_control) {
1618
+ const tokens = estimateBlockTokens(block);
1619
+ const cc = block.cache_control;
1620
+ if (cc.ttl === "1h") {
1621
+ cacheWrite1hTokens += tokens;
1622
+ }
1623
+ else {
1624
+ cacheWrite5mTokens += tokens;
1625
+ }
1626
+ }
1627
+ }
1628
+ }
1629
+ // Count tool definitions with cache_control
1630
+ if (Array.isArray(result.tools)) {
1631
+ for (const tool of result.tools) {
1632
+ if (tool.cache_control) {
1633
+ const tokens = estimateBlockTokens(tool);
1634
+ const cc = tool.cache_control;
1635
+ if (cc.ttl === "1h") {
1636
+ cacheWrite1hTokens += tokens;
1637
+ }
1638
+ else {
1639
+ cacheWrite5mTokens += tokens;
1640
+ }
1641
+ }
1642
+ }
1643
+ }
1644
+ // Count message blocks with cache_control
1645
+ if (Array.isArray(result.messages)) {
1646
+ for (const msg of result.messages) {
1647
+ if (Array.isArray(msg.content)) {
1648
+ for (const block of msg.content) {
1649
+ if (block.cache_control) {
1650
+ const tokens = estimateBlockTokens(block);
1651
+ const cc = block.cache_control;
1652
+ if (cc.ttl === "1h") {
1653
+ cacheWrite1hTokens += tokens;
1654
+ }
1655
+ else {
1656
+ cacheWrite5mTokens += tokens;
1657
+ }
1658
+ }
1659
+ }
1660
+ }
1661
+ }
1662
+ }
1663
+ config.onTtlSplitEstimate({ cacheWrite5mTokens, cacheWrite1hTokens });
1664
+ }
1665
+ // Concern 3: service_tier (Responses API + fastMode)
1666
+ if (needsResponsesApiInjection && config.fastMode) {
1667
+ result.service_tier = "auto";
1668
+ }
1669
+ // Concern 4: store (Responses API + storeCompletions)
1670
+ if (needsResponsesApiInjection && config.storeCompletions) {
1671
+ result.store = true;
1672
+ }
1673
+ return result;
1674
+ },
1675
+ };
1676
+ return next(model, context, enhancedOptions);
1677
+ };
1678
+ };
1679
+ }