maka-agent 0.2.0-dev.6.20260830 → 0.2.0-dev.64.20260929

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 (2558) hide show
  1. package/DISCLAIMER-WIP +6 -1
  2. package/LICENSE +291 -9
  3. package/README.md +50 -20
  4. package/README.zh-CN.md +39 -19
  5. package/RUNTIME_HOST_PEER_DEPENDENCIES.rust.tsv +70 -0
  6. package/RUNTIME_HOST_PEER_THIRD_PARTY_NOTICES.txt +1839 -140
  7. package/THIRD_PARTY_NOTICES.txt +490 -271
  8. package/dist/acp/active-promise.js +38 -0
  9. package/dist/acp/goal-plan-operations.js +142 -0
  10. package/dist/acp/goal-plan-routes.js +33 -0
  11. package/dist/acp/maka-acp-agent.js +128 -7
  12. package/dist/acp/prompt-content.js +225 -0
  13. package/dist/acp/session-configuration.js +143 -0
  14. package/dist/acp/session-domain-observation.js +185 -0
  15. package/dist/acp/session-event-mapper.js +205 -0
  16. package/dist/acp/session-interactions.js +550 -0
  17. package/dist/acp/session-mcp.js +361 -0
  18. package/dist/acp/session-registry.js +2378 -0
  19. package/dist/acp/stdio-server.js +32 -1
  20. package/dist/acp/tool-event-mapper.js +457 -0
  21. package/dist/acp/turn-observation.js +260 -0
  22. package/dist/activation-command.js +12 -5
  23. package/dist/bounded-chunk-buffer.js +16 -3
  24. package/dist/cli-core.js +98 -102
  25. package/dist/cli-ui-locale.js +7 -2
  26. package/dist/mcp-capability-provider.js +21 -12
  27. package/dist/mcp-capability-publication.js +155 -0
  28. package/dist/onboarding-catalog.js +23 -8
  29. package/dist/pi-transcript-tools.js +17 -5
  30. package/dist/pi-transcript.js +77 -31
  31. package/dist/pi-tui-form-interaction.js +497 -0
  32. package/dist/pi-tui-layout.js +101 -24
  33. package/dist/pi-tui-mcp-status.js +194 -128
  34. package/dist/pi-tui-pickers.js +588 -103
  35. package/dist/pi-tui-runner.js +1097 -251
  36. package/dist/pi-tui-todo.js +221 -0
  37. package/dist/pi-tui-transcript-viewer.js +134 -7
  38. package/dist/run-command-core.js +6 -14
  39. package/dist/runtime-host-access-command.js +37 -4
  40. package/dist/runtime-host-capability-provider-command.js +41 -8
  41. package/dist/runtime-host-cli-context.js +300 -80
  42. package/dist/runtime-host-cli-installation.js +8 -2
  43. package/dist/runtime-host-cli.js +360 -64
  44. package/dist/runtime-host-handoff-surface.js +108 -0
  45. package/dist/runtime-host-help.js +244 -0
  46. package/dist/runtime-host-installed-update-activator.js +70 -33
  47. package/dist/runtime-host-installed-update-bootstrap.js +16 -1
  48. package/dist/runtime-host-installed-update-coordinator.js +44 -96
  49. package/dist/runtime-host-lifecycle-transaction.js +101 -28
  50. package/dist/runtime-host-local-handoff.js +215 -41
  51. package/dist/runtime-host-local-managed-activation.js +84 -0
  52. package/dist/runtime-host-local-source-retirement.js +119 -0
  53. package/dist/runtime-host-local-target-activation.js +141 -0
  54. package/dist/runtime-host-managed-deployment.js +158 -51
  55. package/dist/runtime-host-managed-lifecycle-manager.js +5 -6
  56. package/dist/runtime-host-onboarding.js +363 -23
  57. package/dist/runtime-host-openrc-service.js +469 -0
  58. package/dist/runtime-host-operator-retirement.js +50 -0
  59. package/dist/runtime-host-package-deployment.js +36 -2
  60. package/dist/runtime-host-peer-artifact.js +3 -3
  61. package/dist/runtime-host-peer-management-command.js +30 -12
  62. package/dist/runtime-host-peer-mesh-management-command.js +1 -1
  63. package/dist/runtime-host-plugin-command.js +101 -0
  64. package/dist/runtime-host-profile-command.js +1 -1
  65. package/dist/runtime-host-run-command.js +89 -67
  66. package/dist/runtime-host-run-mcp.js +161 -0
  67. package/dist/runtime-host-service-command.js +3 -3
  68. package/dist/runtime-host-service-management-command.js +67 -17
  69. package/dist/runtime-host-service-manager.js +30 -11
  70. package/dist/runtime-host-session-channel.js +282 -28
  71. package/dist/runtime-host-session-driver.js +115 -55
  72. package/dist/runtime-host-session-update.js +62 -0
  73. package/dist/runtime-host-setup-command.js +72 -52
  74. package/dist/runtime-host-task-readiness.js +2 -3
  75. package/dist/runtime-host-tui-command.js +63 -82
  76. package/dist/runtime-host-tui-context.js +74 -11
  77. package/dist/runtime-host-tui-owner.js +226 -0
  78. package/dist/runtime-host-update-command.js +165 -70
  79. package/dist/runtime-host-update-discovery.js +1 -0
  80. package/dist/runtime-host-update-reconciliation.js +7 -7
  81. package/dist/runtime-host-windows-service.js +166 -0
  82. package/dist/runtime-host-windows-task-launcher-artifact.js +75 -0
  83. package/dist/session-export-command.js +72 -0
  84. package/dist/session-import-command.js +69 -0
  85. package/dist/tui-autocomplete-layout.js +3 -1
  86. package/dist/tui-clipboard.js +86 -0
  87. package/dist/tui-context-refresh.js +92 -0
  88. package/dist/tui-copy-catalog.js +1060 -14
  89. package/dist/tui-copy-command.js +103 -0
  90. package/dist/tui-editor-render.js +36 -0
  91. package/dist/tui-host-owner-copy.js +24 -0
  92. package/dist/tui-mcp-control.js +162 -122
  93. package/dist/tui-mcp-remote-publication.js +395 -0
  94. package/dist/workspace-root.js +2 -2
  95. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  96. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  97. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  98. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  99. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  100. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +12 -12
  101. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +52 -0
  102. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +5 -4
  103. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +7 -0
  104. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +51 -8
  105. package/node_modules/@agentclientprotocol/sdk/package.json +2 -2
  106. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +90 -2
  107. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +103 -12
  108. package/node_modules/@ai-sdk/anthropic/CHANGELOG.md +257 -0
  109. package/node_modules/@ai-sdk/anthropic/README.md +1 -1
  110. package/node_modules/@ai-sdk/anthropic/dist/index.js +2478 -1198
  111. package/node_modules/@ai-sdk/anthropic/dist/internal/index.js +1822 -894
  112. package/node_modules/@ai-sdk/anthropic/docs/05-anthropic.mdx +590 -80
  113. package/node_modules/@ai-sdk/anthropic/package.json +6 -6
  114. package/node_modules/@ai-sdk/code-mode/dist/approval-continuation.js +0 -1
  115. package/node_modules/@ai-sdk/code-mode/dist/code-mode-tool.js +26 -7
  116. package/node_modules/@ai-sdk/code-mode/dist/errors.js +0 -8
  117. package/node_modules/@ai-sdk/code-mode/dist/interrupt-continuation.js +0 -2
  118. package/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js +8 -19
  119. package/node_modules/@ai-sdk/code-mode/dist/tool-prompt.js +43 -15
  120. package/node_modules/@ai-sdk/code-mode/package.json +5 -5
  121. package/node_modules/@ai-sdk/cohere/CHANGELOG.md +204 -0
  122. package/node_modules/@ai-sdk/cohere/README.md +1 -1
  123. package/node_modules/@ai-sdk/cohere/dist/index.js +54 -70
  124. package/node_modules/@ai-sdk/cohere/docs/25-cohere.mdx +11 -9
  125. package/node_modules/@ai-sdk/cohere/package.json +6 -6
  126. package/node_modules/@ai-sdk/gateway/CHANGELOG.md +385 -0
  127. package/node_modules/@ai-sdk/gateway/README.md +1 -1
  128. package/node_modules/@ai-sdk/gateway/dist/index.js +1326 -357
  129. package/node_modules/@ai-sdk/gateway/docs/00-ai-gateway.mdx +547 -29
  130. package/node_modules/@ai-sdk/gateway/package.json +8 -8
  131. package/node_modules/@ai-sdk/google/CHANGELOG.md +356 -0
  132. package/node_modules/@ai-sdk/google/README.md +1 -1
  133. package/node_modules/@ai-sdk/google/dist/index.js +6356 -4699
  134. package/node_modules/@ai-sdk/google/dist/internal/index.js +1207 -824
  135. package/node_modules/@ai-sdk/google/docs/15-google.mdx +444 -133
  136. package/node_modules/@ai-sdk/google/package.json +6 -6
  137. package/node_modules/@ai-sdk/open-responses/CHANGELOG.md +190 -0
  138. package/node_modules/@ai-sdk/open-responses/dist/index.js +908 -124
  139. package/node_modules/@ai-sdk/open-responses/docs/06-open-responses.mdx +240 -4
  140. package/node_modules/@ai-sdk/open-responses/package.json +4 -4
  141. package/node_modules/@ai-sdk/openai/CHANGELOG.md +331 -0
  142. package/node_modules/@ai-sdk/openai/README.md +27 -2
  143. package/node_modules/@ai-sdk/openai/dist/index.js +3791 -1897
  144. package/node_modules/@ai-sdk/openai/dist/internal/index.js +3008 -1980
  145. package/node_modules/@ai-sdk/openai/docs/03-openai.mdx +485 -120
  146. package/node_modules/@ai-sdk/openai/package.json +6 -6
  147. package/node_modules/@ai-sdk/openai-compatible/CHANGELOG.md +236 -0
  148. package/node_modules/@ai-sdk/openai-compatible/dist/index.js +218 -143
  149. package/node_modules/@ai-sdk/openai-compatible/dist/internal/index.js +31 -14
  150. package/node_modules/@ai-sdk/openai-compatible/docs/index.mdx +80 -0
  151. package/node_modules/@ai-sdk/openai-compatible/package.json +6 -6
  152. package/node_modules/@ai-sdk/provider/CHANGELOG.md +91 -0
  153. package/node_modules/@ai-sdk/provider/dist/index.js +127 -102
  154. package/node_modules/@ai-sdk/provider/package.json +3 -3
  155. package/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +191 -0
  156. package/node_modules/@ai-sdk/provider-utils/dist/experimental-evaluation/index.js +1618 -0
  157. package/node_modules/@ai-sdk/provider-utils/dist/index.js +1105 -407
  158. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
  159. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
  160. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/request.js +23 -2
  161. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  162. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  163. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
  164. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +6 -2
  165. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +21 -5
  166. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/retry-handler.js +109 -23
  167. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/cache.js +20 -1
  168. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +338 -46
  169. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/dump.js +10 -23
  170. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  171. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/connection.js +19 -9
  172. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  173. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  174. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
  175. package/node_modules/@ai-sdk/provider-utils/package.json +10 -5
  176. package/node_modules/@earendil-works/pi-tui/README.md +61 -6
  177. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +202 -42
  178. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +54 -14
  179. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +29 -0
  180. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +114 -28
  181. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +44 -5
  182. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +10 -3
  183. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +9 -4
  184. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +21 -0
  185. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +8 -2
  186. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +49 -2
  187. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +79 -9
  188. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +5 -4
  189. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +23 -22
  190. package/node_modules/@earendil-works/pi-tui/dist/index.js +4 -1
  191. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -2
  192. package/node_modules/@earendil-works/pi-tui/dist/latex.js +123 -16
  193. package/node_modules/@earendil-works/pi-tui/dist/layout.js +32 -9
  194. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -50
  195. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js +19 -0
  196. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
  197. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +38 -6
  198. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +19 -30
  199. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +427 -60
  200. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +111 -50
  201. package/node_modules/@earendil-works/pi-tui/dist/tui.js +123 -9
  202. package/node_modules/@earendil-works/pi-tui/dist/utils.js +13 -0
  203. package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
  204. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
  205. package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
  206. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  207. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  208. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
  209. package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
  210. package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
  211. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  212. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  213. package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
  214. package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
  215. package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
  216. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +16 -7
  217. package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
  218. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  219. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  220. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
  221. package/node_modules/@earendil-works/pi-tui/package.json +11 -4
  222. package/node_modules/@larksuiteoapi/node-sdk/README.md +20 -0
  223. package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +20 -0
  224. package/node_modules/@larksuiteoapi/node-sdk/es/index.js +232 -36
  225. package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +232 -36
  226. package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
  227. package/node_modules/@maka/acp-executor-plugin/dist/acp-errors.js +26 -0
  228. package/node_modules/@maka/acp-executor-plugin/dist/acp-filesystem.js +103 -0
  229. package/node_modules/@maka/acp-executor-plugin/dist/acp-process.js +119 -0
  230. package/node_modules/@maka/acp-executor-plugin/dist/acp-projection.js +146 -0
  231. package/node_modules/@maka/acp-executor-plugin/dist/index.js +958 -0
  232. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +24719 -0
  233. package/node_modules/@maka/acp-executor-plugin/package.json +15 -0
  234. package/node_modules/@maka/antigravity-acp-plugin/dist/index.js +88 -0
  235. package/node_modules/@maka/antigravity-acp-plugin/dist/model-presentation.js +53 -0
  236. package/node_modules/@maka/antigravity-acp-plugin/dist/plugin.mjs +115 -0
  237. package/node_modules/@maka/antigravity-acp-plugin/package.json +15 -0
  238. package/node_modules/@maka/core/dist/agent-graph-schedule.js +15 -4
  239. package/node_modules/@maka/core/dist/agent-run.js +25 -336
  240. package/node_modules/@maka/core/dist/artifacts.js +33 -23
  241. package/node_modules/@maka/core/dist/attachments.js +107 -1
  242. package/node_modules/@maka/core/dist/bot-events.js +18 -63
  243. package/node_modules/@maka/core/dist/bounded-response.js +71 -0
  244. package/node_modules/@maka/core/dist/canonical-json.js +27 -0
  245. package/node_modules/@maka/core/dist/canonical-runtime-event.js +3 -1
  246. package/node_modules/@maka/core/dist/capabilities.js +35 -0
  247. package/node_modules/@maka/core/dist/chat-model-choice.js +14 -31
  248. package/node_modules/@maka/core/dist/client-capability-grant.js +149 -0
  249. package/node_modules/@maka/core/dist/collaboration.js +12 -0
  250. package/node_modules/@maka/core/dist/computer-use.js +27 -93
  251. package/node_modules/@maka/core/dist/connection-error-copy.js +17 -34
  252. package/node_modules/@maka/core/dist/connection-readiness.js +3 -31
  253. package/node_modules/@maka/core/dist/diagnostic-log.js +18 -7
  254. package/node_modules/@maka/core/dist/display-redaction.js +18 -0
  255. package/node_modules/@maka/core/dist/durable-tool-result-projection.js +126 -0
  256. package/node_modules/@maka/core/dist/events.js +125 -21
  257. package/node_modules/@maka/core/dist/execution-inspect.js +12 -21
  258. package/node_modules/@maka/core/dist/executor-catalog.js +115 -0
  259. package/node_modules/@maka/core/dist/executor-id.js +22 -0
  260. package/node_modules/@maka/core/dist/external-session.js +65 -3
  261. package/node_modules/@maka/core/dist/goal.js +44 -2
  262. package/node_modules/@maka/core/dist/health.js +50 -45
  263. package/node_modules/@maka/core/dist/interaction.js +657 -2
  264. package/node_modules/@maka/core/dist/llm-connections.js +108 -97
  265. package/node_modules/@maka/core/dist/local-memory.js +2 -2
  266. package/node_modules/@maka/core/dist/maka-wordmark.js +23 -0
  267. package/node_modules/@maka/core/dist/mcp.js +4 -1
  268. package/node_modules/@maka/core/dist/message-queue-order.js +47 -0
  269. package/node_modules/@maka/core/dist/model-call-attempt.js +134 -82
  270. package/node_modules/@maka/core/dist/model-call-usage-projection.js +0 -196
  271. package/node_modules/@maka/core/dist/model-catalog.js +194 -337
  272. package/node_modules/@maka/core/dist/model-facts.js +204 -0
  273. package/node_modules/@maka/core/dist/model-failure.js +40 -0
  274. package/node_modules/@maka/core/dist/model-metadata.generated.js +2069 -1878
  275. package/node_modules/@maka/core/dist/model-metadata.js +371 -215
  276. package/node_modules/@maka/core/dist/model-projection-transition.js +145 -0
  277. package/node_modules/@maka/core/dist/model-thinking.js +133 -34
  278. package/node_modules/@maka/core/dist/model-web-search.js +13 -15
  279. package/node_modules/@maka/core/dist/models-dev-projection.js +320 -0
  280. package/node_modules/@maka/core/dist/models-dev-refresh.js +55 -0
  281. package/node_modules/@maka/core/dist/onboarding.js +3 -5
  282. package/node_modules/@maka/core/dist/openai-urls.js +51 -0
  283. package/node_modules/@maka/core/dist/permission-profile.js +17 -0
  284. package/node_modules/@maka/core/dist/permission.js +0 -1
  285. package/node_modules/@maka/core/dist/provider-auth.js +49 -291
  286. package/node_modules/@maka/core/dist/provider-registry.js +251 -494
  287. package/node_modules/@maka/core/dist/recall.js +1143 -0
  288. package/node_modules/@maka/core/dist/record-schema.js +22 -2
  289. package/node_modules/@maka/core/dist/redaction.js +128 -43
  290. package/node_modules/@maka/core/dist/refresh-read-coordinator.js +62 -0
  291. package/node_modules/@maka/core/dist/relative-time-policy.js +71 -0
  292. package/node_modules/@maka/core/dist/relative-time.js +26 -77
  293. package/node_modules/@maka/core/dist/run-composition.js +77 -2
  294. package/node_modules/@maka/core/dist/runtime-boundary.js +182 -66
  295. package/node_modules/@maka/core/dist/runtime-event-store.js +31 -0
  296. package/node_modules/@maka/core/dist/runtime-event.js +270 -12
  297. package/node_modules/@maka/core/dist/runtime-handoff.js +106 -0
  298. package/node_modules/@maka/core/dist/runtime-invocation.js +228 -0
  299. package/node_modules/@maka/core/dist/runtime-logical-execution.js +137 -0
  300. package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +247 -74
  301. package/node_modules/@maka/core/dist/runtime-policy/credential-vault-codec.js +15 -1
  302. package/node_modules/@maka/core/dist/runtime-policy/model-catalog-entry-codec.js +106 -0
  303. package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +139 -4
  304. package/node_modules/@maka/core/dist/runtime-policy.js +7 -3
  305. package/node_modules/@maka/core/dist/scheduled-task.js +12 -2
  306. package/node_modules/@maka/core/dist/session-name.js +2 -3
  307. package/node_modules/@maka/core/dist/session-reference.js +149 -0
  308. package/node_modules/@maka/core/dist/session-send-projection.js +8 -4
  309. package/node_modules/@maka/core/dist/session-start-mode.js +39 -0
  310. package/node_modules/@maka/core/dist/session-todo.js +101 -0
  311. package/node_modules/@maka/core/dist/session-trace.js +5 -1
  312. package/node_modules/@maka/core/dist/session.js +356 -57
  313. package/node_modules/@maka/core/dist/settings.js +50 -12
  314. package/node_modules/@maka/core/dist/shell-run-result.js +1 -0
  315. package/node_modules/@maka/core/dist/shell-run.js +15 -0
  316. package/node_modules/@maka/core/dist/skill-locations.js +29 -0
  317. package/node_modules/@maka/core/dist/slash-command-catalog.js +4 -0
  318. package/node_modules/@maka/core/dist/task-submission-readiness.js +2 -1
  319. package/node_modules/@maka/core/dist/text-sanitize.js +29 -4
  320. package/node_modules/@maka/core/dist/tool-activity-args.js +4 -0
  321. package/node_modules/@maka/core/dist/tool-ledger-scanner.js +365 -104
  322. package/node_modules/@maka/core/dist/tool-quiet-preview.js +53 -26
  323. package/node_modules/@maka/core/dist/tool-result-archive-evidence.js +22 -0
  324. package/node_modules/@maka/core/dist/tool-result-record-schema.js +12 -2
  325. package/node_modules/@maka/core/dist/transcript-search.js +46 -0
  326. package/node_modules/@maka/core/dist/turn-origin.js +20 -0
  327. package/node_modules/@maka/core/dist/ui-locale.js +23 -10
  328. package/node_modules/@maka/core/dist/unified-diff.js +33 -26
  329. package/node_modules/@maka/core/dist/usage-ledger-merge.js +10 -9
  330. package/node_modules/@maka/core/dist/usage-record-schema.js +38 -31
  331. package/node_modules/@maka/core/dist/usage-stats/types.js +3 -0
  332. package/node_modules/@maka/core/dist/work-board.js +94 -1
  333. package/node_modules/@maka/core/dist/workhub-action-result.js +68 -0
  334. package/node_modules/@maka/core/dist/workhub-routing.js +126 -0
  335. package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/index.js +2178 -0
  336. package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
  337. package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
  338. package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
  339. package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
  340. package/node_modules/@maka/core/node_modules/intl-messageformat/intl-messageformat.iife.js +2810 -0
  341. package/node_modules/@maka/core/node_modules/intl-messageformat/package.json +40 -0
  342. package/node_modules/@maka/core/package.json +34 -8
  343. package/node_modules/@maka/eval/dist/egress-audit.js +127 -0
  344. package/node_modules/@maka/eval/dist/experiment-directory.js +4 -13
  345. package/node_modules/@maka/eval/dist/fleet-simulation.js +270 -0
  346. package/node_modules/@maka/eval/dist/fleet-store.js +243 -0
  347. package/node_modules/@maka/eval/dist/fleet-worker.js +125 -0
  348. package/node_modules/@maka/eval/dist/fleet.js +329 -0
  349. package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -1
  350. package/node_modules/@maka/eval/dist/harbor-maka-subject.js +16 -3
  351. package/node_modules/@maka/eval/dist/harness-executor.js +19 -98
  352. package/node_modules/@maka/eval/dist/index.js +3 -0
  353. package/node_modules/@maka/eval/dist/install-preflight.js +39 -10
  354. package/node_modules/@maka/eval/dist/maka-artifacts.js +28 -14
  355. package/node_modules/@maka/eval/dist/maka-subject.js +35 -3
  356. package/node_modules/@maka/eval/dist/metering-checkpoint.js +4 -4
  357. package/node_modules/@maka/eval/dist/process-termination.js +83 -0
  358. package/node_modules/@maka/eval/dist/toolchain-verification.js +1 -1
  359. package/node_modules/@maka/eval/harbor/egress-proxy/entrypoint.sh +6 -5
  360. package/node_modules/@maka/eval/harbor/egress_filter.py +202 -136
  361. package/node_modules/@maka/eval/harbor/eval_framework.py +39 -16
  362. package/node_modules/@maka/eval/harbor/relay_agent.py +47 -10
  363. package/node_modules/@maka/eval/harbor/run_trial.py +13 -6
  364. package/node_modules/@maka/eval/node_modules/undici/README.md +10 -1
  365. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Agent.md +8 -8
  366. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Client.md +4 -0
  367. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  368. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  369. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  370. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +25 -0
  371. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  372. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  373. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +8 -3
  374. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Pool.md +5 -6
  375. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  376. package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +10 -1
  377. package/node_modules/@maka/eval/node_modules/undici/lib/api/readable.js +1 -2
  378. package/node_modules/@maka/eval/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  379. package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +23 -2
  380. package/node_modules/@maka/eval/node_modules/undici/lib/core/symbols.js +2 -0
  381. package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +0 -39
  382. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/agent.js +7 -2
  383. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  384. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  385. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +94 -10
  386. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +9 -3
  387. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  388. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  389. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  390. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +31 -9
  391. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  392. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +90 -7
  393. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +33 -3
  394. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  395. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  396. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  397. package/node_modules/@maka/eval/node_modules/undici/lib/handler/cache-handler.js +29 -5
  398. package/node_modules/@maka/eval/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  399. package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +29 -10
  400. package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +26 -4
  401. package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +215 -38
  402. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +69 -13
  403. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +319 -50
  404. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  405. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dns.js +7 -0
  406. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dump.js +10 -23
  407. package/node_modules/@maka/eval/node_modules/undici/lib/mock/mock-agent.js +13 -1
  408. package/node_modules/@maka/eval/node_modules/undici/lib/mock/mock-utils.js +11 -10
  409. package/node_modules/@maka/eval/node_modules/undici/lib/util/cache.js +45 -3
  410. package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cache.js +17 -8
  411. package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  412. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/index.js +19 -7
  413. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/parse.js +150 -147
  414. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +3 -1
  415. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  416. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +38 -4
  417. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +22 -15
  418. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  419. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  420. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +34 -31
  421. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +52 -25
  422. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/request.js +76 -82
  423. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/response.js +43 -44
  424. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/util.js +13 -8
  425. package/node_modules/@maka/eval/node_modules/undici/lib/web/infra/index.js +16 -1
  426. package/node_modules/@maka/eval/node_modules/undici/lib/web/webidl/index.js +5 -17
  427. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/connection.js +34 -13
  428. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/events.js +43 -26
  429. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  430. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  431. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  432. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketstream.js +27 -14
  433. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  434. package/node_modules/@maka/eval/node_modules/undici/package.json +3 -3
  435. package/node_modules/@maka/eval/package.json +1 -1
  436. package/node_modules/@maka/mcp/dist/credential-coordinator.js +6 -1
  437. package/node_modules/@maka/mcp/dist/form-elicitation.js +213 -0
  438. package/node_modules/@maka/mcp/dist/index.js +517 -72
  439. package/node_modules/@maka/mcp/dist/oauth.js +58 -8
  440. package/node_modules/@maka/mcp/dist/sep-2243.js +3 -3
  441. package/node_modules/@maka/mcp/dist/tool-progress.js +45 -0
  442. package/node_modules/@maka/mcp/package.json +1 -1
  443. package/node_modules/@maka/runtime/dist/agent-graph-supervisor-wake.js +33 -6
  444. package/node_modules/@maka/runtime/dist/agent-graph-timeline.js +12 -11
  445. package/node_modules/@maka/runtime/dist/agent-run-inspect.js +38 -86
  446. package/node_modules/@maka/runtime/dist/agent-run-recovery.js +36 -46
  447. package/node_modules/@maka/runtime/dist/agent-run.js +603 -470
  448. package/node_modules/@maka/runtime/dist/agent-swarm-status-tool.js +0 -1
  449. package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +116 -3753
  450. package/node_modules/@maka/runtime/dist/ai-sdk-compaction-contract.js +6 -1
  451. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +511 -549
  452. package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +623 -0
  453. package/node_modules/@maka/runtime/dist/ai-sdk-tool-repair.js +115 -0
  454. package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +2616 -0
  455. package/node_modules/@maka/runtime/dist/apply-patch-profile.js +64 -14
  456. package/node_modules/@maka/runtime/dist/ask-user-question-tool.js +0 -1
  457. package/node_modules/@maka/runtime/dist/background-task-health-tool.js +104 -0
  458. package/node_modules/@maka/runtime/dist/bash-model-output.js +7 -1
  459. package/node_modules/@maka/runtime/dist/bash-tail-buffer.js +13 -52
  460. package/node_modules/@maka/runtime/dist/bots/base-adapter.js +17 -0
  461. package/node_modules/@maka/runtime/dist/bots/bot-test.js +40 -23
  462. package/node_modules/@maka/runtime/dist/bots/dingtalk-bridge.js +93 -24
  463. package/node_modules/@maka/runtime/dist/bots/discord-bridge.js +4 -4
  464. package/node_modules/@maka/runtime/dist/bots/feishu-bridge.js +28 -25
  465. package/node_modules/@maka/runtime/dist/bots/proxied-fetch.js +5 -4
  466. package/node_modules/@maka/runtime/dist/bots/qq-bridge.js +6 -4
  467. package/node_modules/@maka/runtime/dist/bots/slack-bridge.js +8 -7
  468. package/node_modules/@maka/runtime/dist/bots/telegram-bridge.js +7 -31
  469. package/node_modules/@maka/runtime/dist/bots/wechat-bridge.js +104 -48
  470. package/node_modules/@maka/runtime/dist/bots/wecom-bridge.js +45 -42
  471. package/node_modules/@maka/runtime/dist/bots/ws-bridge-base.js +2 -3
  472. package/node_modules/@maka/runtime/dist/builtin-tools.js +134 -133
  473. package/node_modules/@maka/runtime/dist/bundled-skill-catalog.generated.js +1 -1
  474. package/node_modules/@maka/runtime/dist/child-fd-input.js +3 -2
  475. package/node_modules/@maka/runtime/dist/code-mode.js +7 -4
  476. package/node_modules/@maka/runtime/dist/codex-v4a-patch.js +18 -0
  477. package/node_modules/@maka/runtime/dist/computer-use-codec.js +1 -141
  478. package/node_modules/@maka/runtime/dist/computer-use-tools.js +162 -205
  479. package/node_modules/@maka/runtime/dist/context-budget-helpers.js +7 -56
  480. package/node_modules/@maka/runtime/dist/context-budget-policy.js +26 -65
  481. package/node_modules/@maka/runtime/dist/context-budget.js +44 -103
  482. package/node_modules/@maka/runtime/dist/context-diagnostics.js +72 -33
  483. package/node_modules/@maka/runtime/dist/continuation-replay.js +25 -12
  484. package/node_modules/@maka/runtime/dist/conversation-copy.js +731 -356
  485. package/node_modules/@maka/runtime/dist/cua-frame-state.js +1 -69
  486. package/node_modules/@maka/runtime/dist/deepseek-web-search-codec.js +71 -0
  487. package/node_modules/@maka/runtime/dist/durable-tool-result-projection.js +436 -0
  488. package/node_modules/@maka/runtime/dist/edit-replace.js +9 -9
  489. package/node_modules/@maka/runtime/dist/execution-inspect.js +56 -41
  490. package/node_modules/@maka/runtime/dist/filesystem-executor.js +17 -28
  491. package/node_modules/@maka/runtime/dist/filesystem-worker/client.js +77 -19
  492. package/node_modules/@maka/runtime/dist/filesystem-worker/launch-spec.js +66 -55
  493. package/node_modules/@maka/runtime/dist/filesystem-worker/operations.js +50 -125
  494. package/node_modules/@maka/runtime/dist/filesystem-worker/protocol.js +29 -11
  495. package/node_modules/@maka/runtime/dist/filesystem-worker/worker-entry.js +2 -0
  496. package/node_modules/@maka/runtime/dist/format-json.js +39 -0
  497. package/node_modules/@maka/runtime/dist/github-copilot-oauth-enrollment.js +267 -0
  498. package/node_modules/@maka/runtime/dist/glob-search.js +87 -0
  499. package/node_modules/@maka/runtime/dist/goal-continuation.js +119 -13
  500. package/node_modules/@maka/runtime/dist/goal-evaluator.js +10 -4
  501. package/node_modules/@maka/runtime/dist/goal-state.js +7 -0
  502. package/node_modules/@maka/runtime/dist/grep-search.js +155 -0
  503. package/node_modules/@maka/runtime/dist/history-compact-checkpoint-coordinator.js +16 -6
  504. package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +79 -34
  505. package/node_modules/@maka/runtime/dist/history-compact-error.js +10 -2
  506. package/node_modules/@maka/runtime/dist/history-compact-input-fit.js +7 -1
  507. package/node_modules/@maka/runtime/dist/history-compact-ledger.js +18 -18
  508. package/node_modules/@maka/runtime/dist/history-compact-summarizer.js +132 -110
  509. package/node_modules/@maka/runtime/dist/history-compact-summary-validation.js +14 -30
  510. package/node_modules/@maka/runtime/dist/history-compaction.js +114 -93
  511. package/node_modules/@maka/runtime/dist/image-file.js +26 -33
  512. package/node_modules/@maka/runtime/dist/interaction-authority.js +85 -0
  513. package/node_modules/@maka/runtime/dist/latest-context-snapshot.js +112 -23
  514. package/node_modules/@maka/runtime/dist/ledger-tool-result-archive-reader.js +164 -0
  515. package/node_modules/@maka/runtime/dist/local-web-fetch.js +26 -55
  516. package/node_modules/@maka/runtime/dist/mcp-tools.js +102 -37
  517. package/node_modules/@maka/runtime/dist/memory-extraction-evidence.js +7 -1
  518. package/node_modules/@maka/runtime/dist/memory-extraction.js +30 -19
  519. package/node_modules/@maka/runtime/dist/message-authority.js +9 -0
  520. package/node_modules/@maka/runtime/dist/model-adapter.js +291 -193
  521. package/node_modules/@maka/runtime/dist/model-factory.js +131 -135
  522. package/node_modules/@maka/runtime/dist/model-fetcher.js +102 -90
  523. package/node_modules/@maka/runtime/dist/model-history.js +533 -169
  524. package/node_modules/@maka/runtime/dist/model-projection-transition-ledger.js +207 -0
  525. package/node_modules/@maka/runtime/dist/model-runtime.js +91 -113
  526. package/node_modules/@maka/runtime/dist/native-web-search-tool.js +2 -1
  527. package/node_modules/@maka/runtime/dist/network/abortable-connector.js +55 -0
  528. package/node_modules/@maka/runtime/dist/network/proxy-dispatcher.js +72 -37
  529. package/node_modules/@maka/runtime/dist/network/proxy-test.js +1 -1
  530. package/node_modules/@maka/runtime/dist/network/scoped-fetch-transport.js +7 -2
  531. package/node_modules/@maka/runtime/dist/oauth-provider-contracts.js +28 -1
  532. package/node_modules/@maka/runtime/dist/openai-apply-patch.js +5 -0
  533. package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +29 -77
  534. package/node_modules/@maka/runtime/dist/openai-responses-websocket.js +2 -5
  535. package/node_modules/@maka/runtime/dist/opencode-session-header.js +30 -0
  536. package/node_modules/@maka/runtime/dist/pipe-tail-collector.js +6 -9
  537. package/node_modules/@maka/runtime/dist/plan-mode.js +0 -65
  538. package/node_modules/@maka/runtime/dist/plan-tools.js +0 -3
  539. package/node_modules/@maka/runtime/dist/plugin-agent-service.js +123 -0
  540. package/node_modules/@maka/runtime/dist/plugin-approval-service.js +33 -0
  541. package/node_modules/@maka/runtime/dist/plugin-attachment-service.js +45 -0
  542. package/node_modules/@maka/runtime/dist/plugin-client-bridge-service.js +308 -0
  543. package/node_modules/@maka/runtime/dist/plugin-command-service.js +100 -0
  544. package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +209 -56
  545. package/node_modules/@maka/runtime/dist/plugin-data-services.js +315 -0
  546. package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +451 -0
  547. package/node_modules/@maka/runtime/dist/plugin-executor-service.js +576 -0
  548. package/node_modules/@maka/runtime/dist/plugin-fs-service.js +54 -0
  549. package/node_modules/@maka/runtime/dist/plugin-goal-service.js +53 -0
  550. package/node_modules/@maka/runtime/dist/plugin-internals.js +78 -0
  551. package/node_modules/@maka/runtime/dist/plugin-invocation-signal.js +24 -0
  552. package/node_modules/@maka/runtime/dist/plugin-llm-service.js +77 -0
  553. package/node_modules/@maka/runtime/dist/plugin-lsp-service.js +94 -0
  554. package/node_modules/@maka/runtime/dist/plugin-runtime.js +211 -10
  555. package/node_modules/@maka/runtime/dist/plugin-scope-registry.js +91 -0
  556. package/node_modules/@maka/runtime/dist/plugin-session-query-service.js +63 -0
  557. package/node_modules/@maka/runtime/dist/plugin-shell-env-service.js +87 -0
  558. package/node_modules/@maka/runtime/dist/plugin-shell-service.js +66 -0
  559. package/node_modules/@maka/runtime/dist/plugin-skill-service.js +93 -0
  560. package/node_modules/@maka/runtime/dist/plugin-system-prompt-service.js +346 -0
  561. package/node_modules/@maka/runtime/dist/plugin-tool-service.js +171 -0
  562. package/node_modules/@maka/runtime/dist/plugin-user-question-service.js +43 -0
  563. package/node_modules/@maka/runtime/dist/plugin-web-service.js +61 -0
  564. package/node_modules/@maka/runtime/dist/prior-run-context.js +24 -94
  565. package/node_modules/@maka/runtime/dist/process-tree-terminator.js +2 -2
  566. package/node_modules/@maka/runtime/dist/prompt-composition.js +36 -31
  567. package/node_modules/@maka/runtime/dist/provider-error-classification.js +127 -205
  568. package/node_modules/@maka/runtime/dist/provider-error-signals.js +31 -0
  569. package/node_modules/@maka/runtime/dist/provider-image-overflow-recovery.js +12 -31
  570. package/node_modules/@maka/runtime/dist/provider-request-telemetry.js +207 -204
  571. package/node_modules/@maka/runtime/dist/provider-retry-policy.js +79 -0
  572. package/node_modules/@maka/runtime/dist/provider-urls.js +1 -18
  573. package/node_modules/@maka/runtime/dist/pty-screen-collector.js +32 -6
  574. package/node_modules/@maka/runtime/dist/quiescent-session-snapshot.js +78 -0
  575. package/node_modules/@maka/runtime/dist/read-page.js +234 -0
  576. package/node_modules/@maka/runtime/dist/recall-candidates.js +53 -0
  577. package/node_modules/@maka/runtime/dist/recall-tools.js +282 -0
  578. package/node_modules/@maka/runtime/dist/recovery-resolver.js +0 -59
  579. package/node_modules/@maka/runtime/dist/request-customization-fetch.js +14 -7
  580. package/node_modules/@maka/runtime/dist/request-projection.js +2 -15
  581. package/node_modules/@maka/runtime/dist/request-shape.js +187 -365
  582. package/node_modules/@maka/runtime/dist/responses-reasoning-state.js +19 -7
  583. package/node_modules/@maka/runtime/dist/ripgrep-executable.js +62 -0
  584. package/node_modules/@maka/runtime/dist/ripgrep-guidance.js +81 -0
  585. package/node_modules/@maka/runtime/dist/run-handoff-gate.js +97 -0
  586. package/node_modules/@maka/runtime/dist/run-trace.js +2 -34
  587. package/node_modules/@maka/runtime/dist/runtime-continuation-admission.js +1 -1
  588. package/node_modules/@maka/runtime/dist/runtime-event-backfill.js +114 -66
  589. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +420 -234
  590. package/node_modules/@maka/runtime/dist/runtime-invocation-route.js +49 -0
  591. package/node_modules/@maka/runtime/dist/runtime-kernel.js +619 -357
  592. package/node_modules/@maka/runtime/dist/runtime-ledger-repair.js +235 -450
  593. package/node_modules/@maka/runtime/dist/runtime-read-model.js +94 -200
  594. package/node_modules/@maka/runtime/dist/runtime-resume.js +162 -126
  595. package/node_modules/@maka/runtime/dist/sandbox/index.js +0 -1
  596. package/node_modules/@maka/runtime/dist/sandbox/linux-profile-path.js +7 -1
  597. package/node_modules/@maka/runtime/dist/sandbox/linux-sandbox.js +20 -17
  598. package/node_modules/@maka/runtime/dist/sandbox/macos-seatbelt.js +0 -12
  599. package/node_modules/@maka/runtime/dist/sandbox/sandbox-manager.js +0 -35
  600. package/node_modules/@maka/runtime/dist/sandbox/windows-sandbox.js +0 -12
  601. package/node_modules/@maka/runtime/dist/scheduled-task-tools.js +68 -9
  602. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +67 -20
  603. package/node_modules/@maka/runtime/dist/session-export.js +178 -0
  604. package/node_modules/@maka/runtime/dist/session-import.js +100 -0
  605. package/node_modules/@maka/runtime/dist/session-manager.js +985 -1067
  606. package/node_modules/@maka/runtime/dist/session-projection-helpers.js +18 -28
  607. package/node_modules/@maka/runtime/dist/session-recap.js +90 -17
  608. package/node_modules/@maka/runtime/dist/session-todo-tools.js +67 -0
  609. package/node_modules/@maka/runtime/dist/session-trace-projection.js +25 -30
  610. package/node_modules/@maka/runtime/dist/shell-detect.js +3 -7
  611. package/node_modules/@maka/runtime/dist/shell-exec.js +7 -25
  612. package/node_modules/@maka/runtime/dist/shell-run-contract.js +0 -1
  613. package/node_modules/@maka/runtime/dist/shell-run-manager.js +83 -78
  614. package/node_modules/@maka/runtime/dist/shell-run-tool-result.js +19 -9
  615. package/node_modules/@maka/runtime/dist/shell-tools.js +84 -14
  616. package/node_modules/@maka/runtime/dist/skills-discovery.js +17 -23
  617. package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +96 -20
  618. package/node_modules/@maka/runtime/dist/stream-graph-handoff.js +6 -1
  619. package/node_modules/@maka/runtime/dist/stream-graph-projection.js +18 -15
  620. package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +5 -0
  621. package/node_modules/@maka/runtime/dist/stream-graph-schedule-reconcile.js +1 -0
  622. package/node_modules/@maka/runtime/dist/stream-graph-supervisor-tools.js +26 -12
  623. package/node_modules/@maka/runtime/dist/stream-usage-fallback-fetch.js +74 -0
  624. package/node_modules/@maka/runtime/dist/subagent-tools.js +77 -90
  625. package/node_modules/@maka/runtime/dist/subscription-credentials.js +51 -4
  626. package/node_modules/@maka/runtime/dist/subscription-model-fetch.js +135 -13
  627. package/node_modules/@maka/runtime/dist/system-prompt/main-session-prompt.js +21 -2
  628. package/node_modules/@maka/runtime/dist/system-prompt/workspace-instructions.js +11 -6
  629. package/node_modules/@maka/runtime/dist/tavily-search.js +8 -2
  630. package/node_modules/@maka/runtime/dist/telemetry/model-pricing.generated.js +299 -215
  631. package/node_modules/@maka/runtime/dist/terminal-run-commit.js +42 -171
  632. package/node_modules/@maka/runtime/dist/test-connection.js +35 -85
  633. package/node_modules/@maka/runtime/dist/text-line-window.js +49 -0
  634. package/node_modules/@maka/runtime/dist/tool-activation-identity.js +41 -0
  635. package/node_modules/@maka/runtime/dist/tool-availability.js +89 -8
  636. package/node_modules/@maka/runtime/dist/tool-output.js +36 -13
  637. package/node_modules/@maka/runtime/dist/tool-result-archive-capability.js +24 -36
  638. package/node_modules/@maka/runtime/dist/tool-result-archive-encoding.js +38 -0
  639. package/node_modules/@maka/runtime/dist/tool-result-archive-resource.js +93 -245
  640. package/node_modules/@maka/runtime/dist/tool-result-archive-transition.js +186 -0
  641. package/node_modules/@maka/runtime/dist/tool-result-archive.js +50 -173
  642. package/node_modules/@maka/runtime/dist/tool-runtime.js +415 -613
  643. package/node_modules/@maka/runtime/dist/unified-diff.js +40 -10
  644. package/node_modules/@maka/runtime/dist/web-fetch-tool.js +4 -2
  645. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +13681 -5108
  646. package/node_modules/@maka/runtime/dist/workspace-executor.js +26 -35
  647. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/README.md +44 -8
  648. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/dist/package.json +4 -4
  649. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js +39 -3
  650. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js +4 -0
  651. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
  652. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
  653. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/request.js +23 -2
  654. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  655. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  656. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
  657. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +6 -2
  658. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +21 -5
  659. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/retry-handler.js +109 -23
  660. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/cache.js +20 -1
  661. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +338 -46
  662. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/dump.js +10 -23
  663. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  664. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/connection.js +19 -9
  665. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  666. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  667. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
  668. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +5 -5
  669. package/node_modules/@maka/runtime/node_modules/undici/README.md +10 -1
  670. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Agent.md +8 -8
  671. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Client.md +4 -0
  672. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  673. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  674. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  675. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +25 -0
  676. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  677. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  678. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +8 -3
  679. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Pool.md +5 -6
  680. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  681. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +10 -1
  682. package/node_modules/@maka/runtime/node_modules/undici/lib/api/readable.js +1 -2
  683. package/node_modules/@maka/runtime/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  684. package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +23 -2
  685. package/node_modules/@maka/runtime/node_modules/undici/lib/core/symbols.js +2 -0
  686. package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +0 -39
  687. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/agent.js +7 -2
  688. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  689. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  690. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +94 -10
  691. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +9 -3
  692. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  693. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  694. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  695. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +31 -9
  696. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  697. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +90 -7
  698. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +33 -3
  699. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  700. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  701. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  702. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/cache-handler.js +29 -5
  703. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  704. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +29 -10
  705. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +26 -4
  706. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +215 -38
  707. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +69 -13
  708. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +319 -50
  709. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  710. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dns.js +7 -0
  711. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dump.js +10 -23
  712. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/mock-agent.js +13 -1
  713. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/mock-utils.js +11 -10
  714. package/node_modules/@maka/runtime/node_modules/undici/lib/util/cache.js +45 -3
  715. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cache.js +17 -8
  716. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  717. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/index.js +19 -7
  718. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/parse.js +150 -147
  719. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +3 -1
  720. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  721. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +38 -4
  722. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +22 -15
  723. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  724. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  725. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +34 -31
  726. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +52 -25
  727. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/request.js +76 -82
  728. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/response.js +43 -44
  729. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/util.js +13 -8
  730. package/node_modules/@maka/runtime/node_modules/undici/lib/web/infra/index.js +16 -1
  731. package/node_modules/@maka/runtime/node_modules/undici/lib/web/webidl/index.js +5 -17
  732. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/connection.js +34 -13
  733. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/events.js +43 -26
  734. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  735. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  736. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  737. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketstream.js +27 -14
  738. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  739. package/node_modules/@maka/runtime/node_modules/undici/package.json +3 -3
  740. package/node_modules/@maka/runtime/package.json +53 -22
  741. package/node_modules/@maka/runtime-host/dist/adapter/provider-retry-projector.js +63 -0
  742. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +137 -156
  743. package/node_modules/@maka/runtime-host/dist/candidate-cli.js +7 -7
  744. package/node_modules/@maka/runtime-host/dist/candidate-entry.js +18 -7
  745. package/node_modules/@maka/runtime-host/dist/candidate-launch-owner-guard.js +13 -0
  746. package/node_modules/@maka/runtime-host/dist/client/capability-provider-service.js +2 -0
  747. package/node_modules/@maka/runtime-host/dist/client/catalog-reader.js +64 -25
  748. package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +190 -30
  749. package/node_modules/@maka/runtime-host/dist/client/connect-or-spawn.js +60 -20
  750. package/node_modules/@maka/runtime-host/dist/client/connection.js +170 -63
  751. package/node_modules/@maka/runtime-host/dist/client/host-handoff-copy.js +248 -0
  752. package/node_modules/@maka/runtime-host/dist/client/host-handoff.js +311 -0
  753. package/node_modules/@maka/runtime-host/dist/client/host-profile.js +483 -94
  754. package/node_modules/@maka/runtime-host/dist/client/host-retirement.js +28 -5
  755. package/node_modules/@maka/runtime-host/dist/client/hosted-execution-target.js +33 -6
  756. package/node_modules/@maka/runtime-host/dist/client/hosted-execution.js +10 -28
  757. package/node_modules/@maka/runtime-host/dist/client/index.js +15 -11
  758. package/node_modules/@maka/runtime-host/dist/client/launcher.js +12 -3
  759. package/node_modules/@maka/runtime-host/dist/client/oauth-presentation.js +1 -1
  760. package/node_modules/@maka/runtime-host/dist/client/owner-connection-code.js +38 -4
  761. package/node_modules/@maka/runtime-host/dist/client/peer-client.js +389 -25
  762. package/node_modules/@maka/runtime-host/dist/client/process-identity.js +73 -0
  763. package/node_modules/@maka/runtime-host/dist/client/reconnect-lifecycle.js +80 -8
  764. package/node_modules/@maka/runtime-host/dist/client/reconnecting-connection.js +15 -4
  765. package/node_modules/@maka/runtime-host/dist/client/registered-host-termination.js +107 -0
  766. package/node_modules/@maka/runtime-host/dist/client/remote-compatibility-error.js +2 -0
  767. package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +15 -1
  768. package/node_modules/@maka/runtime-host/dist/client/session-subscription.js +105 -125
  769. package/node_modules/@maka/runtime-host/dist/client/ssh-operator-activation.js +48 -11
  770. package/node_modules/@maka/runtime-host/dist/client/startup-error.js +1 -1
  771. package/node_modules/@maka/runtime-host/dist/client/wait-for-ready.js +1 -1
  772. package/node_modules/@maka/runtime-host/dist/client/wsl-control.js +0 -8
  773. package/node_modules/@maka/runtime-host/dist/client/wsl-environment.js +12 -8
  774. package/node_modules/@maka/runtime-host/dist/client-capability-entity-id.js +27 -0
  775. package/node_modules/@maka/runtime-host/dist/composition-identity.js +19 -0
  776. package/node_modules/@maka/runtime-host/dist/control/endpoint.js +8 -9
  777. package/node_modules/@maka/runtime-host/dist/execution-candidate-main.js +8 -1
  778. package/node_modules/@maka/runtime-host/dist/node-error.js +22 -0
  779. package/node_modules/@maka/runtime-host/dist/operator/access-management-frame.js +10 -1
  780. package/node_modules/@maka/runtime-host/dist/operator/index.js +5 -2
  781. package/node_modules/@maka/runtime-host/dist/operator/managed-deployment.js +17 -8
  782. package/node_modules/@maka/runtime-host/dist/operator/operator-command.js +110 -0
  783. package/node_modules/@maka/runtime-host/dist/operator/peer-management-frame.js +2 -0
  784. package/node_modules/@maka/runtime-host/dist/operator/retirement-cancellation.js +20 -0
  785. package/node_modules/@maka/runtime-host/dist/operator/service-management-frame.js +5 -6
  786. package/node_modules/@maka/runtime-host/dist/operator/setup-frame.js +32 -6
  787. package/node_modules/@maka/runtime-host/dist/peer-mesh/index.js +3 -3
  788. package/node_modules/@maka/runtime-host/dist/peer-mesh/limits.js +1 -2
  789. package/node_modules/@maka/runtime-host/dist/peer-mesh/model.js +48 -60
  790. package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +1228 -472
  791. package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +33 -70
  792. package/node_modules/@maka/runtime-host/dist/peer-mesh/store.js +141 -59
  793. package/node_modules/@maka/runtime-host/dist/peer-reachability/index.js +21 -0
  794. package/node_modules/@maka/runtime-host/dist/peer-reachability/model.js +202 -0
  795. package/node_modules/@maka/runtime-host/dist/peer-reachability/owner.js +118 -0
  796. package/node_modules/@maka/runtime-host/dist/peer-reachability/publisher.js +243 -0
  797. package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +5 -12
  798. package/node_modules/@maka/runtime-host/dist/protocol/artifact.js +11 -20
  799. package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +273 -46
  800. package/node_modules/@maka/runtime-host/dist/protocol/codec.js +11 -0
  801. package/node_modules/@maka/runtime-host/dist/protocol/configuration.js +55 -9
  802. package/node_modules/@maka/runtime-host/dist/protocol/connection-catalog-change.js +26 -0
  803. package/node_modules/@maka/runtime-host/dist/protocol/connection-effects.js +42 -9
  804. package/node_modules/@maka/runtime-host/dist/protocol/external-agent-setup.js +149 -0
  805. package/node_modules/@maka/runtime-host/dist/protocol/external-session.js +41 -12
  806. package/node_modules/@maka/runtime-host/dist/protocol/host-resources.js +253 -0
  807. package/node_modules/@maka/runtime-host/dist/protocol/host-status.js +49 -11
  808. package/node_modules/@maka/runtime-host/dist/protocol/index.js +283 -5
  809. package/node_modules/@maka/runtime-host/dist/protocol/message-queue-limits.js +21 -0
  810. package/node_modules/@maka/runtime-host/dist/protocol/message.js +29 -112
  811. package/node_modules/@maka/runtime-host/dist/protocol/network-proxy.js +1 -7
  812. package/node_modules/@maka/runtime-host/dist/protocol/oauth.js +104 -8
  813. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +34 -10
  814. package/node_modules/@maka/runtime-host/dist/protocol/peer-mesh.js +14 -31
  815. package/node_modules/@maka/runtime-host/dist/protocol/plan.js +1 -0
  816. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +899 -0
  817. package/node_modules/@maka/runtime-host/dist/protocol/project-catalog.js +2 -2
  818. package/node_modules/@maka/runtime-host/dist/protocol/prompt-suggestions.js +61 -0
  819. package/node_modules/@maka/runtime-host/dist/protocol/queue-mutation.js +136 -0
  820. package/node_modules/@maka/runtime-host/dist/protocol/recall.js +270 -0
  821. package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +84 -26
  822. package/node_modules/@maka/runtime-host/dist/protocol/runtime-resource.js +4 -17
  823. package/node_modules/@maka/runtime-host/dist/protocol/scheduled-task.js +26 -6
  824. package/node_modules/@maka/runtime-host/dist/protocol/session-bundle.js +100 -0
  825. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog-change.js +24 -6
  826. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +134 -14
  827. package/node_modules/@maka/runtime-host/dist/protocol/session-collaboration.js +68 -4
  828. package/node_modules/@maka/runtime-host/dist/protocol/session-continuity.js +71 -34
  829. package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +30 -3
  830. package/node_modules/@maka/runtime-host/dist/protocol/session-revision.js +11 -2
  831. package/node_modules/@maka/runtime-host/dist/protocol/session-todo.js +53 -0
  832. package/node_modules/@maka/runtime-host/dist/protocol/session-transcript.js +34 -127
  833. package/node_modules/@maka/runtime-host/dist/protocol/session-turns.js +38 -59
  834. package/node_modules/@maka/runtime-host/dist/protocol/skill-catalog.js +2 -1
  835. package/node_modules/@maka/runtime-host/dist/protocol/turn-provider-retry.js +69 -0
  836. package/node_modules/@maka/runtime-host/dist/protocol/turn.js +54 -95
  837. package/node_modules/@maka/runtime-host/dist/protocol/usage-pricing.js +39 -3
  838. package/node_modules/@maka/runtime-host/dist/protocol/usage-screen.js +312 -0
  839. package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +218 -75
  840. package/node_modules/@maka/runtime-host/dist/server/access-authority.js +78 -17
  841. package/node_modules/@maka/runtime-host/dist/server/access-credential-metadata.js +4 -2
  842. package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +137 -49
  843. package/node_modules/@maka/runtime-host/dist/server/acp/antigravity-install.js +242 -0
  844. package/node_modules/@maka/runtime-host/dist/server/acp/antigravity.js +154 -0
  845. package/node_modules/@maka/runtime-host/dist/server/acp/connection.js +116 -0
  846. package/node_modules/@maka/runtime-host/dist/server/agent-graph-coordinator.js +0 -3
  847. package/node_modules/@maka/runtime-host/dist/server/agent-graph-execution-coordinator.js +1 -2
  848. package/node_modules/@maka/runtime-host/dist/server/artifact-coordinator.js +19 -22
  849. package/node_modules/@maka/runtime-host/dist/server/bootstrap-runtime-policy.js +95 -97
  850. package/node_modules/@maka/runtime-host/dist/server/builtin-external-agent-plugins.js +188 -0
  851. package/node_modules/@maka/runtime-host/dist/server/candidate.js +15 -7
  852. package/node_modules/@maka/runtime-host/dist/server/canonical-session-projection.js +2 -1
  853. package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +34 -24
  854. package/node_modules/@maka/runtime-host/dist/server/canonical-usage-reader.js +24 -11
  855. package/node_modules/@maka/runtime-host/dist/server/child-agent-composition.js +2 -1
  856. package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +633 -101
  857. package/node_modules/@maka/runtime-host/dist/server/client-capability-invocation-broker.js +266 -53
  858. package/node_modules/@maka/runtime-host/dist/server/client-capability-provider-id.js +31 -0
  859. package/node_modules/@maka/runtime-host/dist/server/client-capability-recovery.js +45 -44
  860. package/node_modules/@maka/runtime-host/dist/server/configuration-coordinator.js +20 -1
  861. package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +46 -18
  862. package/node_modules/@maka/runtime-host/dist/server/connection-session.js +42 -19
  863. package/node_modules/@maka/runtime-host/dist/server/context-coordinator.js +2 -0
  864. package/node_modules/@maka/runtime-host/dist/server/daily-review-coordinator.js +164 -82
  865. package/node_modules/@maka/runtime-host/dist/server/execution-artifacts.js +59 -57
  866. package/node_modules/@maka/runtime-host/dist/server/execution-candidate.js +4 -1
  867. package/node_modules/@maka/runtime-host/dist/server/execution-composition-factory.js +10 -4
  868. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +1511 -240
  869. package/node_modules/@maka/runtime-host/dist/server/execution-inspect-coordinator.js +35 -29
  870. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +160 -20
  871. package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +102 -73
  872. package/node_modules/@maka/runtime-host/dist/server/execution-service.js +49 -25
  873. package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +253 -0
  874. package/node_modules/@maka/runtime-host/dist/server/extension-package-manifest.js +280 -0
  875. package/node_modules/@maka/runtime-host/dist/server/external-agent-setup-coordinator.js +190 -0
  876. package/node_modules/@maka/runtime-host/dist/server/external-session-coordinator.js +130 -55
  877. package/node_modules/@maka/runtime-host/dist/server/failure-diagnostic.js +24 -0
  878. package/node_modules/@maka/runtime-host/dist/server/generated-text.js +39 -0
  879. package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +176 -40
  880. package/node_modules/@maka/runtime-host/dist/server/host-change-feed.js +26 -22
  881. package/node_modules/@maka/runtime-host/dist/server/host-composition-source.js +47 -0
  882. package/node_modules/@maka/runtime-host/dist/server/host-composition.js +1 -29
  883. package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +164 -35
  884. package/node_modules/@maka/runtime-host/dist/server/host-residency-registry.js +41 -20
  885. package/node_modules/@maka/runtime-host/dist/server/host-resource-collector.js +223 -0
  886. package/node_modules/@maka/runtime-host/dist/server/host-resource-probe-main.js +44 -0
  887. package/node_modules/@maka/runtime-host/dist/server/host-resource-probe.js +83 -0
  888. package/node_modules/@maka/runtime-host/dist/server/host-session-availability.js +15 -4
  889. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-admission-registry.js +3 -1
  890. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-projection.js +12 -7
  891. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-recovery.js +205 -75
  892. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +82 -12
  893. package/node_modules/@maka/runtime-host/dist/server/index.js +5 -0
  894. package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +467 -40
  895. package/node_modules/@maka/runtime-host/dist/server/interaction-projection.js +36 -1
  896. package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +178 -126
  897. package/node_modules/@maka/runtime-host/dist/server/interactive-turn-coordinator.js +5 -17
  898. package/node_modules/@maka/runtime-host/dist/server/jev-routing-model.js +157 -0
  899. package/node_modules/@maka/runtime-host/dist/server/json-array-page-budget.js +48 -0
  900. package/node_modules/@maka/runtime-host/dist/server/listener-set.js +8 -6
  901. package/node_modules/@maka/runtime-host/dist/server/memory-projection.js +14 -15
  902. package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +565 -353
  903. package/node_modules/@maka/runtime-host/dist/server/message-queue-state.js +69 -0
  904. package/node_modules/@maka/runtime-host/dist/server/model-metadata-refresh.js +96 -0
  905. package/node_modules/@maka/runtime-host/dist/server/network-proxy-coordinator.js +0 -1
  906. package/node_modules/@maka/runtime-host/dist/server/oauth-coordinator.js +169 -45
  907. package/node_modules/@maka/runtime-host/dist/server/oauth-execution-authority.js +20 -3
  908. package/node_modules/@maka/runtime-host/dist/server/operation-dispatcher.js +66 -127
  909. package/node_modules/@maka/runtime-host/dist/server/peer-listener.js +131 -48
  910. package/node_modules/@maka/runtime-host/dist/server/peer-mesh-authority.js +1 -1
  911. package/node_modules/@maka/runtime-host/dist/server/plan-coordinator.js +52 -16
  912. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-patch.js +58 -0
  913. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-store.js +141 -0
  914. package/node_modules/@maka/runtime-host/dist/server/plugin-data-runtime.js +234 -0
  915. package/node_modules/@maka/runtime-host/dist/server/plugin-package-loader.js +204 -0
  916. package/node_modules/@maka/runtime-host/dist/server/plugin-package-store.js +545 -0
  917. package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +400 -0
  918. package/node_modules/@maka/runtime-host/dist/server/plugin-platform.js +1273 -0
  919. package/node_modules/@maka/runtime-host/dist/server/process-lifecycle.js +1 -1
  920. package/node_modules/@maka/runtime-host/dist/server/process-termination-error.js +27 -0
  921. package/node_modules/@maka/runtime-host/dist/server/project-catalog-coordinator.js +10 -12
  922. package/node_modules/@maka/runtime-host/dist/server/project-directory-authority.js +4 -3
  923. package/node_modules/@maka/runtime-host/dist/server/prompt-suggestion.js +179 -0
  924. package/node_modules/@maka/runtime-host/dist/server/provider-retry-projection.js +71 -0
  925. package/node_modules/@maka/runtime-host/dist/server/queued-mutation-executor.js +94 -0
  926. package/node_modules/@maka/runtime-host/dist/server/recall-coordinator.js +117 -0
  927. package/node_modules/@maka/runtime-host/dist/server/recall-material-fetch.js +92 -0
  928. package/node_modules/@maka/runtime-host/dist/server/root-admission-owner.js +32 -7
  929. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +803 -218
  930. package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +74 -18
  931. package/node_modules/@maka/runtime-host/dist/server/runtime-resource-coordinator.js +24 -31
  932. package/node_modules/@maka/runtime-host/dist/server/runtime-resource-projection.js +15 -32
  933. package/node_modules/@maka/runtime-host/dist/server/safe-boundary-resume-policy.js +27 -0
  934. package/node_modules/@maka/runtime-host/dist/server/sandbox-boundary-graph-wake.js +3 -5
  935. package/node_modules/@maka/runtime-host/dist/server/scheduled-task-coordinator.js +150 -41
  936. package/node_modules/@maka/runtime-host/dist/server/serial-outbound-writer.js +46 -4
  937. package/node_modules/@maka/runtime-host/dist/server/session-admission-gate.js +21 -1
  938. package/node_modules/@maka/runtime-host/dist/server/session-bundle-coordinator.js +166 -0
  939. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +461 -62
  940. package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +484 -586
  941. package/node_modules/@maka/runtime-host/dist/server/session-effect-coordinator.js +13 -7
  942. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +68 -16
  943. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +118 -189
  944. package/node_modules/@maka/runtime-host/dist/server/session-revision-graph-references.js +64 -85
  945. package/node_modules/@maka/runtime-host/dist/server/session-sidecar-purge.js +2 -1
  946. package/node_modules/@maka/runtime-host/dist/server/session-title.js +3 -16
  947. package/node_modules/@maka/runtime-host/dist/server/session-todo-coordinator.js +77 -0
  948. package/node_modules/@maka/runtime-host/dist/server/session-transcript-pager.js +23 -488
  949. package/node_modules/@maka/runtime-host/dist/server/session-transcript-reader.js +407 -115
  950. package/node_modules/@maka/runtime-host/dist/server/session-turn-access-request-coordinator.js +33 -26
  951. package/node_modules/@maka/runtime-host/dist/server/shared-session-transcript.js +4 -1
  952. package/node_modules/@maka/runtime-host/dist/server/skill-catalog-coordinator.js +18 -2
  953. package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +16 -17
  954. package/node_modules/@maka/runtime-host/dist/server/storage-maintenance.js +109 -0
  955. package/node_modules/@maka/runtime-host/dist/server/usage-pricing-coordinator.js +120 -36
  956. package/node_modules/@maka/runtime-host/dist/server/web-fetch-tool.js +38 -2
  957. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +625 -39
  958. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +625 -132
  959. package/node_modules/@maka/runtime-host/dist/server/workhub-message-attachments.js +47 -0
  960. package/node_modules/@maka/runtime-host/dist/server/workhub-result-coordinator.js +203 -0
  961. package/node_modules/@maka/runtime-host/dist/server/workhub-result-runtime.js +293 -0
  962. package/node_modules/@maka/runtime-host/dist/server/workhub-target-execution-authority.js +161 -0
  963. package/node_modules/@maka/runtime-host/dist/transport/framed-byte-stream-transport.js +43 -6
  964. package/node_modules/@maka/runtime-host/dist/transport/local-ipc-framing.js +4 -2
  965. package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +112 -24
  966. package/node_modules/@maka/runtime-host/dist/transport/resumable-peer-stream.js +469 -0
  967. package/node_modules/@maka/runtime-host/dist/webrtc-stun-policy.js +114 -0
  968. package/node_modules/@maka/runtime-host/package.json +9 -1
  969. package/node_modules/@maka/storage/dist/agent-run-store-contract.js +956 -0
  970. package/node_modules/@maka/storage/dist/agent-run-store.js +264 -1058
  971. package/node_modules/@maka/storage/dist/artifact-attachments.js +66 -18
  972. package/node_modules/@maka/storage/dist/artifact-metadata-codec.js +28 -31
  973. package/node_modules/@maka/storage/dist/artifact-store.js +265 -787
  974. package/node_modules/@maka/storage/dist/artifact-stores.js +5 -12
  975. package/node_modules/@maka/storage/dist/artifact-writer-lock.js +1 -1
  976. package/node_modules/@maka/storage/dist/atomic-file-write.js +75 -0
  977. package/node_modules/@maka/storage/dist/claude-code-session-adapter.js +802 -321
  978. package/node_modules/@maka/storage/dist/claude-code-transcript-lineage.js +106 -77
  979. package/node_modules/@maka/storage/dist/codex-session-adapter.js +845 -315
  980. package/node_modules/@maka/storage/dist/config-transfer.js +14 -8
  981. package/node_modules/@maka/storage/dist/context-offload-snapshot.js +397 -0
  982. package/node_modules/@maka/storage/dist/context-value-mutation-gate.js +59 -0
  983. package/node_modules/@maka/storage/dist/conversation-operational-state.js +10 -0
  984. package/node_modules/@maka/storage/dist/credential-store.js +15 -63
  985. package/node_modules/@maka/storage/dist/execution-persistence-provider.js +55 -0
  986. package/node_modules/@maka/storage/dist/execution-record-codec.js +1 -22
  987. package/node_modules/@maka/storage/dist/execution-stores.js +254 -81
  988. package/node_modules/@maka/storage/dist/external-session-importer.js +25 -3
  989. package/node_modules/@maka/storage/dist/file-lifetime-owner.js +30 -2
  990. package/node_modules/@maka/storage/dist/file-session-repository.js +1012 -0
  991. package/node_modules/@maka/storage/dist/git-exec.js +61 -0
  992. package/node_modules/@maka/storage/dist/git-worktree-child-executor.js +8 -35
  993. package/node_modules/@maka/storage/dist/goal-authority.js +41 -10
  994. package/node_modules/@maka/storage/dist/graph-control-values.js +126 -0
  995. package/node_modules/@maka/storage/dist/interaction-store-contract.js +231 -0
  996. package/node_modules/@maka/storage/dist/interaction-store-public.js +1 -1
  997. package/node_modules/@maka/storage/dist/interaction-store.js +196 -166
  998. package/node_modules/@maka/storage/dist/legacy-run-header.js +327 -0
  999. package/node_modules/@maka/storage/dist/local-execution-persistence.js +80 -0
  1000. package/node_modules/@maka/storage/dist/mcp-config-store.js +123 -30
  1001. package/node_modules/@maka/storage/dist/message-admission-store.js +8 -3
  1002. package/node_modules/@maka/storage/dist/model-call-ledger.js +199 -32
  1003. package/node_modules/@maka/storage/dist/model-call-usage-sql.js +136 -0
  1004. package/node_modules/@maka/storage/dist/model-facts-store.js +56 -0
  1005. package/node_modules/@maka/storage/dist/offset-external-session-catalog.js +69 -0
  1006. package/node_modules/@maka/storage/dist/opencode-session-adapter.js +278 -77
  1007. package/node_modules/@maka/storage/dist/operational-state-backup.js +15 -11
  1008. package/node_modules/@maka/storage/dist/operational-state-store-public.js +1 -1
  1009. package/node_modules/@maka/storage/dist/operational-state-store.js +60 -8
  1010. package/node_modules/@maka/storage/dist/plan-authority.js +50 -0
  1011. package/node_modules/@maka/storage/dist/plan-store.js +30 -0
  1012. package/node_modules/@maka/storage/dist/process-lifetime-file-update-lock.js +0 -41
  1013. package/node_modules/@maka/storage/dist/production-session-snapshot.js +761 -0
  1014. package/node_modules/@maka/storage/dist/project-catalog.js +51 -74
  1015. package/node_modules/@maka/storage/dist/quiescent-session-snapshot.js +1154 -0
  1016. package/node_modules/@maka/storage/dist/recall-fold.js +65 -0
  1017. package/node_modules/@maka/storage/dist/root-authority.js +4 -0
  1018. package/node_modules/@maka/storage/dist/runtime-event-invariants.js +2 -2
  1019. package/node_modules/@maka/storage/dist/runtime-event-persistence.js +9 -0
  1020. package/node_modules/@maka/storage/dist/runtime-event-store-contract.js +19 -0
  1021. package/node_modules/@maka/storage/dist/runtime-partial-values.js +118 -0
  1022. package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +181 -112
  1023. package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +552 -121
  1024. package/node_modules/@maka/storage/dist/runtime-policy/credential-vault-document.js +4 -1
  1025. package/node_modules/@maka/storage/dist/runtime-policy/document-io.js +22 -16
  1026. package/node_modules/@maka/storage/dist/runtime-policy/legacy-custom-connection.js +65 -0
  1027. package/node_modules/@maka/storage/dist/runtime-policy/oauth-login-receipt-document.js +207 -0
  1028. package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +157 -9
  1029. package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +12 -4
  1030. package/node_modules/@maka/storage/dist/runtime-policy-stores.js +7 -4
  1031. package/node_modules/@maka/storage/dist/runtime-transcript-query.js +333 -0
  1032. package/node_modules/@maka/storage/dist/scheduled-task-store.js +256 -283
  1033. package/node_modules/@maka/storage/dist/session-bundle-manifest.js +5 -17
  1034. package/node_modules/@maka/storage/dist/session-bundle-policy.js +1042 -34
  1035. package/node_modules/@maka/storage/dist/session-bundle-ustar.js +12 -0
  1036. package/node_modules/@maka/storage/dist/session-copy-cleanup.js +12 -7
  1037. package/node_modules/@maka/storage/dist/session-message-projection.js +24 -5
  1038. package/node_modules/@maka/storage/dist/session-repository.js +767 -0
  1039. package/node_modules/@maka/storage/dist/session-store-contract.js +61 -0
  1040. package/node_modules/@maka/storage/dist/session-store-values.js +354 -0
  1041. package/node_modules/@maka/storage/dist/session-store.js +129 -433
  1042. package/node_modules/@maka/storage/dist/session-todo-authority.js +106 -0
  1043. package/node_modules/@maka/storage/dist/session-todo-store.js +169 -0
  1044. package/node_modules/@maka/storage/dist/settings-store.js +297 -34
  1045. package/node_modules/@maka/storage/dist/shell-run-authority.js +1 -0
  1046. package/node_modules/@maka/storage/dist/shell-run-store.js +15 -0
  1047. package/node_modules/@maka/storage/dist/sqlite-artifact-metadata.js +51 -17
  1048. package/node_modules/@maka/storage/dist/sqlite-artifact-schema.js +55 -5
  1049. package/node_modules/@maka/storage/dist/sqlite-context-offload-store.js +42 -12
  1050. package/node_modules/@maka/storage/dist/sqlite-core-execution-schema.js +46 -2
  1051. package/node_modules/@maka/storage/dist/sqlite-long-term-memory-store.js +86 -12
  1052. package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +455 -1
  1053. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +1461 -359
  1054. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +114 -5
  1055. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +705 -1049
  1056. package/node_modules/@maka/storage/dist/sqlite-usage-schema.js +280 -20
  1057. package/node_modules/@maka/storage/dist/sqlite-usage-store.js +29 -6
  1058. package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +7 -8
  1059. package/node_modules/@maka/storage/dist/stable-storage.js +16 -2
  1060. package/node_modules/@maka/storage/dist/storage-id.js +28 -0
  1061. package/node_modules/@maka/storage/dist/storage-writer-composition.js +5 -9
  1062. package/node_modules/@maka/storage/dist/telemetry-file-schema.js +5 -3
  1063. package/node_modules/@maka/storage/dist/tool-commit-validation.js +111 -0
  1064. package/node_modules/@maka/storage/dist/tool-result-archive-evidence.js +138 -0
  1065. package/node_modules/@maka/storage/dist/usage-screen.js +384 -0
  1066. package/node_modules/@maka/storage/dist/usage-stores.js +30 -9
  1067. package/node_modules/@maka/storage/dist/work-board-store.js +44 -5
  1068. package/node_modules/@maka/storage/dist/workspace-identity.js +2 -15
  1069. package/node_modules/@maka/storage/dist/workspace-version-authority-internal.js +1 -8
  1070. package/node_modules/@maka/storage/package.json +9 -5
  1071. package/node_modules/@modelcontextprotocol/client/dist/index-BCtJi0p5.d.mts.map +1 -0
  1072. package/node_modules/@modelcontextprotocol/client/dist/index-CEk3qkZM.d.cts.map +1 -0
  1073. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +375 -60
  1074. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
  1075. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
  1076. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +369 -61
  1077. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
  1078. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
  1079. package/node_modules/@modelcontextprotocol/client/dist/src-D0qEN74R.cjs +7521 -0
  1080. package/node_modules/@modelcontextprotocol/client/dist/src-DDAAhLnO.mjs +7153 -0
  1081. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +8 -2
  1082. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -1
  1083. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -1
  1084. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +8 -2
  1085. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/auth--n_Yzytt.d.cts.map +1 -0
  1086. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/auth-4-zilcqg.cjs +2900 -0
  1087. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs +1679 -0
  1088. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/auth-YUQV3RRv.d.mts.map +1 -0
  1089. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
  1090. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
  1091. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
  1092. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
  1093. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/package.json +85 -0
  1094. package/node_modules/@modelcontextprotocol/client/package.json +4 -4
  1095. package/node_modules/@openai/agents-core/dist/agent.js +8 -10
  1096. package/node_modules/@openai/agents-core/dist/agent.mjs +9 -11
  1097. package/node_modules/@openai/agents-core/dist/agentToolInput.js +2 -30
  1098. package/node_modules/@openai/agents-core/dist/agentToolInput.mjs +1 -29
  1099. package/node_modules/@openai/agents-core/dist/defaultModel.js +23 -3
  1100. package/node_modules/@openai/agents-core/dist/defaultModel.mjs +21 -3
  1101. package/node_modules/@openai/agents-core/dist/handoff.js +5 -5
  1102. package/node_modules/@openai/agents-core/dist/handoff.mjs +5 -5
  1103. package/node_modules/@openai/agents-core/dist/index.js +2 -1
  1104. package/node_modules/@openai/agents-core/dist/index.mjs +1 -1
  1105. package/node_modules/@openai/agents-core/dist/items.js +8 -1
  1106. package/node_modules/@openai/agents-core/dist/items.mjs +8 -1
  1107. package/node_modules/@openai/agents-core/dist/mcp.js +26 -16
  1108. package/node_modules/@openai/agents-core/dist/mcp.mjs +27 -17
  1109. package/node_modules/@openai/agents-core/dist/mcpServers.js +18 -15
  1110. package/node_modules/@openai/agents-core/dist/mcpServers.mjs +18 -15
  1111. package/node_modules/@openai/agents-core/dist/mcpShared.js +12 -0
  1112. package/node_modules/@openai/agents-core/dist/mcpShared.mjs +12 -0
  1113. package/node_modules/@openai/agents-core/dist/memory/session.js +8 -0
  1114. package/node_modules/@openai/agents-core/dist/memory/session.mjs +7 -0
  1115. package/node_modules/@openai/agents-core/dist/metadata.js +2 -2
  1116. package/node_modules/@openai/agents-core/dist/metadata.mjs +2 -2
  1117. package/node_modules/@openai/agents-core/dist/run.js +550 -248
  1118. package/node_modules/@openai/agents-core/dist/run.mjs +555 -253
  1119. package/node_modules/@openai/agents-core/dist/runState.js +747 -420
  1120. package/node_modules/@openai/agents-core/dist/runState.mjs +742 -421
  1121. package/node_modules/@openai/agents-core/dist/runStateLegacyCompaction.js +440 -0
  1122. package/node_modules/@openai/agents-core/dist/runStateLegacyCompaction.mjs +404 -0
  1123. package/node_modules/@openai/agents-core/dist/runner/blockedOutputPersistence.js +274 -78
  1124. package/node_modules/@openai/agents-core/dist/runner/blockedOutputPersistence.mjs +268 -77
  1125. package/node_modules/@openai/agents-core/dist/runner/conversation.js +22 -3
  1126. package/node_modules/@openai/agents-core/dist/runner/conversation.mjs +23 -4
  1127. package/node_modules/@openai/agents-core/dist/runner/guardrails.js +80 -15
  1128. package/node_modules/@openai/agents-core/dist/runner/guardrails.mjs +78 -15
  1129. package/node_modules/@openai/agents-core/dist/runner/items.js +35 -2
  1130. package/node_modules/@openai/agents-core/dist/runner/items.mjs +35 -2
  1131. package/node_modules/@openai/agents-core/dist/runner/modelOutputs.js +47 -18
  1132. package/node_modules/@openai/agents-core/dist/runner/modelOutputs.mjs +50 -21
  1133. package/node_modules/@openai/agents-core/dist/runner/modelPreparation.js +28 -0
  1134. package/node_modules/@openai/agents-core/dist/runner/modelPreparation.mjs +28 -1
  1135. package/node_modules/@openai/agents-core/dist/runner/modelRetry.js +322 -217
  1136. package/node_modules/@openai/agents-core/dist/runner/modelRetry.mjs +322 -217
  1137. package/node_modules/@openai/agents-core/dist/runner/modelSettings.js +15 -22
  1138. package/node_modules/@openai/agents-core/dist/runner/modelSettings.mjs +15 -22
  1139. package/node_modules/@openai/agents-core/dist/runner/outputGuardrailBlockedMessage.js +32 -0
  1140. package/node_modules/@openai/agents-core/dist/runner/outputGuardrailBlockedMessage.mjs +28 -0
  1141. package/node_modules/@openai/agents-core/dist/runner/runLoop.js +53 -8
  1142. package/node_modules/@openai/agents-core/dist/runner/runLoop.mjs +53 -8
  1143. package/node_modules/@openai/agents-core/dist/runner/sessionItems.js +119 -0
  1144. package/node_modules/@openai/agents-core/dist/runner/sessionItems.mjs +114 -0
  1145. package/node_modules/@openai/agents-core/dist/runner/sessionPersistence.js +408 -157
  1146. package/node_modules/@openai/agents-core/dist/runner/sessionPersistence.mjs +388 -142
  1147. package/node_modules/@openai/agents-core/dist/runner/toolExecution.js +42 -3
  1148. package/node_modules/@openai/agents-core/dist/runner/toolExecution.mjs +42 -3
  1149. package/node_modules/@openai/agents-core/dist/runner/toolSearch.js +1 -0
  1150. package/node_modules/@openai/agents-core/dist/runner/toolSearch.mjs +1 -1
  1151. package/node_modules/@openai/agents-core/dist/runner/toolSearchAttribution.js +19 -0
  1152. package/node_modules/@openai/agents-core/dist/runner/toolSearchAttribution.mjs +15 -0
  1153. package/node_modules/@openai/agents-core/dist/runner/turnResolution.js +65 -13
  1154. package/node_modules/@openai/agents-core/dist/runner/turnResolution.mjs +65 -13
  1155. package/node_modules/@openai/agents-core/dist/runner/usageTracking.js +69 -0
  1156. package/node_modules/@openai/agents-core/dist/runner/usageTracking.mjs +65 -0
  1157. package/node_modules/@openai/agents-core/dist/sandbox/manifest.js +4 -0
  1158. package/node_modules/@openai/agents-core/dist/sandbox/manifest.mjs +4 -0
  1159. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/docker.js +317 -127
  1160. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/docker.mjs +319 -129
  1161. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/localWorkspace.js +1 -1
  1162. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/localWorkspace.mjs +1 -1
  1163. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/pty.js +27 -13
  1164. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/pty.mjs +27 -13
  1165. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFileWorker.js +196 -0
  1166. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFileWorker.mjs +193 -0
  1167. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFiles.js +215 -0
  1168. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFiles.mjs +211 -0
  1169. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/unixLocal.js +193 -83
  1170. package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/unixLocal.mjs +196 -86
  1171. package/node_modules/@openai/agents-core/dist/sandbox/session.js +2 -1
  1172. package/node_modules/@openai/agents-core/dist/sandbox/session.mjs +2 -1
  1173. package/node_modules/@openai/agents-core/dist/tracing/processor.js +21 -7
  1174. package/node_modules/@openai/agents-core/dist/tracing/processor.mjs +21 -7
  1175. package/node_modules/@openai/agents-core/dist/tracing/spans.js +40 -6
  1176. package/node_modules/@openai/agents-core/dist/tracing/spans.mjs +7 -3
  1177. package/node_modules/@openai/agents-core/dist/types/protocol.js +6 -0
  1178. package/node_modules/@openai/agents-core/dist/types/protocol.mjs +6 -0
  1179. package/node_modules/@openai/agents-core/dist/usage.js +13 -4
  1180. package/node_modules/@openai/agents-core/dist/usage.mjs +13 -4
  1181. package/node_modules/@openai/agents-core/dist/utils/applyDiff.js +24 -7
  1182. package/node_modules/@openai/agents-core/dist/utils/applyDiff.mjs +24 -7
  1183. package/node_modules/@openai/agents-core/dist/utils/internal.js +3 -1
  1184. package/node_modules/@openai/agents-core/dist/utils/internal.mjs +1 -1
  1185. package/node_modules/@openai/agents-core/dist/utils/zodCompat.js +29 -0
  1186. package/node_modules/@openai/agents-core/dist/utils/zodCompat.mjs +28 -0
  1187. package/node_modules/@openai/agents-core/dist/utils/zodJsonSchemaCompat.js +3 -31
  1188. package/node_modules/@openai/agents-core/dist/utils/zodJsonSchemaCompat.mjs +1 -29
  1189. package/node_modules/@openai/agents-core/package.json +1 -1
  1190. package/node_modules/@slack/types/dist/events/agent.js +3 -0
  1191. package/node_modules/@slack/types/dist/events/index.js +44 -0
  1192. package/node_modules/@slack/types/package.json +47 -0
  1193. package/node_modules/@slack/web-api/README.md +382 -0
  1194. package/node_modules/@slack/web-api/dist/methods.js +1636 -0
  1195. package/node_modules/@slack/web-api/dist/types/request/agents.js +3 -0
  1196. package/node_modules/@slack/web-api/dist/types/request/blocks.js +3 -0
  1197. package/node_modules/@slack/web-api/dist/types/response/AdminUsersGetExpirationResponse.js +11 -0
  1198. package/node_modules/@slack/web-api/dist/types/response/AgentsSessionsRenameResponse.js +11 -0
  1199. package/node_modules/@slack/web-api/dist/types/response/AgentsSessionsSetStatusResponse.js +11 -0
  1200. package/node_modules/@slack/web-api/dist/types/response/BlocksValidateResponse.js +11 -0
  1201. package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js +11 -0
  1202. package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js +11 -0
  1203. package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js +48 -0
  1204. package/node_modules/@slack/web-api/dist/types/response/PinsListResponse.js +67 -0
  1205. package/node_modules/@slack/web-api/dist/types/response/SearchAllResponse.js +72 -0
  1206. package/node_modules/@slack/web-api/dist/types/response/SearchFilesResponse.js +48 -0
  1207. package/node_modules/@slack/web-api/dist/types/response/SlackListsAccessDeleteResponse.js +11 -0
  1208. package/node_modules/@slack/web-api/dist/types/response/SlackListsAccessSetResponse.js +11 -0
  1209. package/node_modules/@slack/web-api/dist/types/response/SlackListsCreateResponse.js +11 -0
  1210. package/node_modules/@slack/web-api/dist/types/response/SlackListsDownloadGetResponse.js +11 -0
  1211. package/node_modules/@slack/web-api/dist/types/response/SlackListsDownloadStartResponse.js +11 -0
  1212. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsCreateResponse.js +11 -0
  1213. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsDeleteMultipleResponse.js +11 -0
  1214. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsDeleteResponse.js +11 -0
  1215. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsInfoResponse.js +11 -0
  1216. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsListResponse.js +11 -0
  1217. package/node_modules/@slack/web-api/dist/types/response/SlackListsItemsUpdateResponse.js +11 -0
  1218. package/node_modules/@slack/web-api/dist/types/response/SlackListsUpdateResponse.js +11 -0
  1219. package/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedAddResponse.js +11 -0
  1220. package/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedListResponse.js +11 -0
  1221. package/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedRemoveResponse.js +11 -0
  1222. package/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedSetResponse.js +11 -0
  1223. package/node_modules/@slack/web-api/node_modules/@types/retry/LICENSE +21 -0
  1224. package/node_modules/@slack/web-api/node_modules/@types/retry/README.md +15 -0
  1225. package/node_modules/@slack/web-api/node_modules/@types/retry/package.json +30 -0
  1226. package/node_modules/@slack/web-api/package.json +71 -0
  1227. package/node_modules/@types/node/README.md +2 -2
  1228. package/node_modules/@types/node/package.json +3 -18
  1229. package/node_modules/ai/CHANGELOG.md +611 -0
  1230. package/node_modules/ai/README.md +6 -6
  1231. package/node_modules/ai/dist/index.js +7872 -3383
  1232. package/node_modules/ai/dist/internal/index.js +837 -465
  1233. package/node_modules/ai/docs/00-introduction/index.mdx +1 -1
  1234. package/node_modules/ai/docs/02-foundations/02-providers-and-models.mdx +15 -4
  1235. package/node_modules/ai/docs/02-foundations/03-prompts.mdx +1 -1
  1236. package/node_modules/ai/docs/02-foundations/04-tools.mdx +2 -2
  1237. package/node_modules/ai/docs/02-foundations/06-provider-options.mdx +11 -11
  1238. package/node_modules/ai/docs/02-getting-started/00-choosing-a-provider.mdx +4 -4
  1239. package/node_modules/ai/docs/02-getting-started/02-nextjs-app-router.mdx +3 -3
  1240. package/node_modules/ai/docs/02-getting-started/03-nextjs-pages-router.mdx +4 -4
  1241. package/node_modules/ai/docs/02-getting-started/04-svelte.mdx +7 -7
  1242. package/node_modules/ai/docs/02-getting-started/05-nuxt.mdx +8 -8
  1243. package/node_modules/ai/docs/02-getting-started/06-nodejs.mdx +3 -3
  1244. package/node_modules/ai/docs/02-getting-started/07-expo.mdx +10 -3
  1245. package/node_modules/ai/docs/02-getting-started/08-tanstack-start.mdx +3 -3
  1246. package/node_modules/ai/docs/02-getting-started/09-coding-agents.mdx +1 -1
  1247. package/node_modules/ai/docs/03-agents/02-building-agents.mdx +2 -2
  1248. package/node_modules/ai/docs/03-agents/03-workflows.mdx +2 -2
  1249. package/node_modules/ai/docs/03-agents/04-loop-control.mdx +6 -4
  1250. package/node_modules/ai/docs/03-agents/05-configuring-call-options.mdx +4 -2
  1251. package/node_modules/ai/docs/03-agents/06-memory.mdx +2 -2
  1252. package/node_modules/ai/docs/03-agents/06-policy-tool-approvals.mdx +5 -4
  1253. package/node_modules/ai/docs/03-agents/06-tool-approvals.mdx +35 -7
  1254. package/node_modules/ai/docs/03-agents/07-workflow-agent.mdx +125 -28
  1255. package/node_modules/ai/docs/03-agents/08-terminal-ui.mdx +14 -10
  1256. package/node_modules/ai/docs/03-ai-sdk-core/05-generating-text.mdx +2 -2
  1257. package/node_modules/ai/docs/03-ai-sdk-core/10-generating-structured-data.mdx +15 -3
  1258. package/node_modules/ai/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +14 -6
  1259. package/node_modules/ai/docs/03-ai-sdk-core/16-mcp-tools.mdx +95 -1
  1260. package/node_modules/ai/docs/03-ai-sdk-core/17-mcp-apps.mdx +2 -2
  1261. package/node_modules/ai/docs/03-ai-sdk-core/18-code-mode.mdx +50 -0
  1262. package/node_modules/ai/docs/03-ai-sdk-core/19-tool-search.mdx +82 -0
  1263. package/node_modules/ai/docs/03-ai-sdk-core/20-prompt-engineering.mdx +1 -1
  1264. package/node_modules/ai/docs/03-ai-sdk-core/26-reasoning.mdx +15 -14
  1265. package/node_modules/ai/docs/03-ai-sdk-core/31-reranking.mdx +12 -10
  1266. package/node_modules/ai/docs/03-ai-sdk-core/32-evaluation.mdx +287 -0
  1267. package/node_modules/ai/docs/03-ai-sdk-core/35-image-generation.mdx +79 -14
  1268. package/node_modules/ai/docs/03-ai-sdk-core/36-realtime.mdx +41 -18
  1269. package/node_modules/ai/docs/03-ai-sdk-core/36-transcription.mdx +37 -35
  1270. package/node_modules/ai/docs/03-ai-sdk-core/37-speech.mdx +8 -23
  1271. package/node_modules/ai/docs/03-ai-sdk-core/39-file-uploads.mdx +26 -1
  1272. package/node_modules/ai/docs/03-ai-sdk-core/40-middleware.mdx +92 -7
  1273. package/node_modules/ai/docs/03-ai-sdk-core/41-skill-uploads.mdx +1 -1
  1274. package/node_modules/ai/docs/03-ai-sdk-core/42-batch.mdx +371 -0
  1275. package/node_modules/ai/docs/03-ai-sdk-core/45-provider-management.mdx +31 -21
  1276. package/node_modules/ai/docs/03-ai-sdk-core/50-error-handling.mdx +94 -2
  1277. package/node_modules/ai/docs/03-ai-sdk-core/55-testing.mdx +75 -0
  1278. package/node_modules/ai/docs/03-ai-sdk-core/60-telemetry.mdx +89 -11
  1279. package/node_modules/ai/docs/03-ai-sdk-core/65-devtools.mdx +3 -3
  1280. package/node_modules/ai/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +132 -7
  1281. package/node_modules/ai/docs/03-ai-sdk-core/index.mdx +11 -0
  1282. package/node_modules/ai/docs/03-ai-sdk-harnesses/01-overview.mdx +3 -2
  1283. package/node_modules/ai/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +324 -97
  1284. package/node_modules/ai/docs/03-ai-sdk-harnesses/03-tools.mdx +47 -22
  1285. package/node_modules/ai/docs/03-ai-sdk-harnesses/04-skills.mdx +6 -6
  1286. package/node_modules/ai/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +15 -13
  1287. package/node_modules/ai/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +43 -9
  1288. package/node_modules/ai/docs/03-ai-sdk-harnesses/07-ui.mdx +33 -30
  1289. package/node_modules/ai/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +8 -6
  1290. package/node_modules/ai/docs/04-ai-sdk-ui/01-overview.mdx +1 -1
  1291. package/node_modules/ai/docs/04-ai-sdk-ui/02-chatbot.mdx +47 -21
  1292. package/node_modules/ai/docs/04-ai-sdk-ui/03-chatbot-message-persistence.mdx +46 -3
  1293. package/node_modules/ai/docs/04-ai-sdk-ui/03-chatbot-resume-streams.mdx +11 -4
  1294. package/node_modules/ai/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +39 -2
  1295. package/node_modules/ai/docs/04-ai-sdk-ui/05-completion.mdx +1 -1
  1296. package/node_modules/ai/docs/04-ai-sdk-ui/08-object-generation.mdx +4 -1
  1297. package/node_modules/ai/docs/04-ai-sdk-ui/20-streaming-data.mdx +11 -6
  1298. package/node_modules/ai/docs/04-ai-sdk-ui/21-error-handling.mdx +28 -2
  1299. package/node_modules/ai/docs/04-ai-sdk-ui/21-transport.mdx +7 -3
  1300. package/node_modules/ai/docs/04-ai-sdk-ui/50-stream-protocol.mdx +6 -2
  1301. package/node_modules/ai/docs/05-ai-sdk-rsc/02-streaming-react-components.mdx +5 -5
  1302. package/node_modules/ai/docs/05-ai-sdk-rsc/04-multistep-interfaces.mdx +2 -2
  1303. package/node_modules/ai/docs/05-ai-sdk-rsc/06-loading-state.mdx +1 -1
  1304. package/node_modules/ai/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +3 -3
  1305. package/node_modules/ai/docs/06-advanced/02-stopping-streams.mdx +8 -0
  1306. package/node_modules/ai/docs/06-advanced/04-caching.mdx +9 -1
  1307. package/node_modules/ai/docs/06-advanced/11-secure-url-fetching.mdx +54 -3
  1308. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +28 -5
  1309. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +66 -15
  1310. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/05-embed.mdx +31 -5
  1311. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +38 -8
  1312. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +24 -10
  1313. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +2 -1
  1314. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +1 -1
  1315. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +3 -3
  1316. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/14-evaluate.mdx +74 -0
  1317. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/14-upload-file.mdx +37 -4
  1318. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +5 -3
  1319. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/20-start-batch.mdx +154 -0
  1320. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/20-tool.mdx +7 -0
  1321. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/21-get-batch-status.mdx +133 -0
  1322. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +7 -0
  1323. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/22-get-batch-results.mdx +109 -0
  1324. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-cancel-batch.mdx +96 -0
  1325. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-tool-search.mdx +76 -0
  1326. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/24-list-batches.mdx +121 -0
  1327. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/28-output.mdx +27 -1
  1328. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +63 -0
  1329. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +30 -0
  1330. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/33-safe-validate-ui-messages.mdx +12 -0
  1331. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +19 -1
  1332. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +22 -4
  1333. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +1 -1
  1334. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +17 -2
  1335. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/80-smooth-stream.mdx +5 -3
  1336. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/index.mdx +31 -0
  1337. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +2 -2
  1338. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/03-use-object.mdx +4 -1
  1339. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +364 -48
  1340. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +14 -2
  1341. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +45 -6
  1342. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +6 -1
  1343. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/50-direct-chat-transport.mdx +3 -3
  1344. package/node_modules/ai/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +2 -1
  1345. package/node_modules/ai/docs/07-reference/03-ai-sdk-rsc/02-create-ai.mdx +1 -1
  1346. package/node_modules/ai/docs/07-reference/03-ai-sdk-rsc/03-create-streamable-ui.mdx +1 -1
  1347. package/node_modules/ai/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +124 -43
  1348. package/node_modules/ai/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx +29 -15
  1349. package/node_modules/ai/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +157 -0
  1350. package/node_modules/ai/docs/07-reference/04-ai-sdk-workflow/index.mdx +6 -0
  1351. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx +4 -0
  1352. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-evaluation-unsupported-question-type-error.mdx +31 -0
  1353. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-invalid-argument-error.mdx +6 -1
  1354. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +7 -0
  1355. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +4 -0
  1356. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +4 -0
  1357. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +52 -0
  1358. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-tool-choice-violation-error.mdx +38 -0
  1359. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-ui-message-stream-error.mdx +6 -2
  1360. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/index.mdx +131 -34
  1361. package/node_modules/ai/docs/07-reference/06-ai-sdk-tui/01-run-agent-tui.mdx +13 -9
  1362. package/node_modules/ai/docs/08-migration-guides/29-migration-guide-4-0.mdx +5 -5
  1363. package/node_modules/ai/docs/08-migration-guides/37-migration-guide-3-3.mdx +1 -1
  1364. package/node_modules/ai/docs/09-troubleshooting/11-use-chat-custom-request-options.mdx +3 -3
  1365. package/node_modules/ai/docs/09-troubleshooting/13-repeated-assistant-messages.mdx +2 -2
  1366. package/node_modules/ai/docs/09-troubleshooting/17-use-chat-stale-body-data.mdx +1 -1
  1367. package/node_modules/ai/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +2 -2
  1368. package/node_modules/ai/package.json +19 -9
  1369. package/node_modules/balanced-match/LICENSE.md +23 -0
  1370. package/node_modules/balanced-match/README.md +57 -0
  1371. package/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  1372. package/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  1373. package/node_modules/balanced-match/dist/esm/index.js +54 -0
  1374. package/node_modules/balanced-match/dist/esm/package.json +3 -0
  1375. package/node_modules/balanced-match/package.json +68 -0
  1376. package/node_modules/brace-expansion/LICENSE +23 -0
  1377. package/node_modules/brace-expansion/README.md +105 -0
  1378. package/node_modules/brace-expansion/dist/commonjs/index.js +289 -0
  1379. package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  1380. package/node_modules/brace-expansion/dist/esm/index.js +285 -0
  1381. package/node_modules/brace-expansion/dist/esm/package.json +3 -0
  1382. package/node_modules/brace-expansion/package.json +64 -0
  1383. package/node_modules/fast-uri/index.js +215 -47
  1384. package/node_modules/fast-uri/lib/schemes.js +9 -4
  1385. package/node_modules/fast-uri/lib/utils.js +396 -92
  1386. package/node_modules/fast-uri/package.json +1 -1
  1387. package/node_modules/fs-native-extensions/package.json +1 -1
  1388. package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.bare +0 -0
  1389. package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.bare +0 -0
  1390. package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.bare +0 -0
  1391. package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.bare +0 -0
  1392. package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.bare +0 -0
  1393. package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.node +0 -0
  1394. package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.bare +0 -0
  1395. package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.node +0 -0
  1396. package/node_modules/fs-native-extensions/prebuilds/ios-arm64/fs-native-extensions.bare +0 -0
  1397. package/node_modules/fs-native-extensions/prebuilds/ios-arm64-simulator/fs-native-extensions.bare +0 -0
  1398. package/node_modules/fs-native-extensions/prebuilds/ios-x64-simulator/fs-native-extensions.bare +0 -0
  1399. package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.bare +0 -0
  1400. package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.bare +0 -0
  1401. package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.bare +0 -0
  1402. package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.node +0 -0
  1403. package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.bare +0 -0
  1404. package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.node +0 -0
  1405. package/node_modules/fs-native-extensions/src/win32.c +50 -11
  1406. package/node_modules/glob/LICENSE.md +63 -0
  1407. package/node_modules/glob/README.md +1203 -0
  1408. package/node_modules/glob/dist/commonjs/glob.js +248 -0
  1409. package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  1410. package/node_modules/glob/dist/commonjs/ignore.js +119 -0
  1411. package/node_modules/glob/dist/commonjs/index.js +68 -0
  1412. package/node_modules/glob/dist/commonjs/index.min.js +4 -0
  1413. package/node_modules/glob/dist/commonjs/package.json +3 -0
  1414. package/node_modules/glob/dist/commonjs/pattern.js +223 -0
  1415. package/node_modules/glob/dist/commonjs/processor.js +301 -0
  1416. package/node_modules/glob/dist/commonjs/walker.js +387 -0
  1417. package/node_modules/glob/dist/esm/glob.js +244 -0
  1418. package/node_modules/glob/dist/esm/has-magic.js +23 -0
  1419. package/node_modules/glob/dist/esm/ignore.js +115 -0
  1420. package/node_modules/glob/dist/esm/index.js +55 -0
  1421. package/node_modules/glob/dist/esm/index.min.js +4 -0
  1422. package/node_modules/glob/dist/esm/package.json +3 -0
  1423. package/node_modules/glob/dist/esm/pattern.js +219 -0
  1424. package/node_modules/glob/dist/esm/processor.js +294 -0
  1425. package/node_modules/glob/dist/esm/walker.js +381 -0
  1426. package/node_modules/glob/package.json +98 -0
  1427. package/node_modules/image-dimensions/cli.js +18 -3
  1428. package/node_modules/image-dimensions/index.js +7 -5
  1429. package/node_modules/image-dimensions/package.json +4 -1
  1430. package/node_modules/image-dimensions/readme.md +2 -1
  1431. package/node_modules/image-dimensions/types/avif.js +2 -24
  1432. package/node_modules/image-dimensions/types/heic.js +2 -24
  1433. package/node_modules/image-dimensions/types/jpeg.js +28 -7
  1434. package/node_modules/image-dimensions/types/png.js +13 -2
  1435. package/node_modules/image-dimensions/types/webp.js +20 -36
  1436. package/node_modules/image-dimensions/utilities.js +184 -60
  1437. package/node_modules/ip-address/README.md +145 -135
  1438. package/node_modules/ip-address/dist/common.js +48 -0
  1439. package/node_modules/ip-address/dist/ipv4.js +117 -11
  1440. package/node_modules/ip-address/dist/ipv6.js +162 -48
  1441. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  1442. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  1443. package/node_modules/ip-address/package.json +1 -1
  1444. package/node_modules/marked/README.md +1 -0
  1445. package/node_modules/marked/lib/marked.esm.js +30 -29
  1446. package/node_modules/marked/lib/marked.umd.js +30 -29
  1447. package/node_modules/marked/man/marked.1 +1 -1
  1448. package/node_modules/marked/package.json +11 -11
  1449. package/node_modules/minimatch/LICENSE.md +55 -0
  1450. package/node_modules/minimatch/README.md +528 -0
  1451. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  1452. package/node_modules/minimatch/dist/commonjs/ast.js +845 -0
  1453. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  1454. package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  1455. package/node_modules/minimatch/dist/commonjs/index.js +1127 -0
  1456. package/node_modules/minimatch/dist/commonjs/package.json +3 -0
  1457. package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  1458. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  1459. package/node_modules/minimatch/dist/esm/ast.js +841 -0
  1460. package/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  1461. package/node_modules/minimatch/dist/esm/escape.js +26 -0
  1462. package/node_modules/minimatch/dist/esm/index.js +1114 -0
  1463. package/node_modules/minimatch/dist/esm/package.json +3 -0
  1464. package/node_modules/minimatch/dist/esm/unescape.js +34 -0
  1465. package/node_modules/minimatch/package.json +73 -0
  1466. package/node_modules/minipass/LICENSE.md +55 -0
  1467. package/node_modules/minipass/README.md +825 -0
  1468. package/node_modules/minipass/dist/commonjs/index.js +1038 -0
  1469. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  1470. package/node_modules/minipass/dist/esm/index.js +1020 -0
  1471. package/node_modules/minipass/dist/esm/package.json +3 -0
  1472. package/node_modules/minipass/package.json +77 -0
  1473. package/node_modules/path-scurry/LICENSE.md +55 -0
  1474. package/node_modules/path-scurry/README.md +636 -0
  1475. package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  1476. package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  1477. package/node_modules/path-scurry/dist/esm/index.js +1983 -0
  1478. package/node_modules/path-scurry/dist/esm/package.json +3 -0
  1479. package/node_modules/path-scurry/node_modules/lru-cache/LICENSE.md +55 -0
  1480. package/node_modules/path-scurry/node_modules/lru-cache/README.md +469 -0
  1481. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  1482. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/browser/index.js +1726 -0
  1483. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  1484. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/browser/perf.js +10 -0
  1485. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  1486. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +7 -0
  1487. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1726 -0
  1488. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  1489. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  1490. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/node/index.js +1726 -0
  1491. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  1492. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/node/perf.js +10 -0
  1493. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  1494. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/perf.js +10 -0
  1495. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +4 -0
  1496. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/browser/index.js +1722 -0
  1497. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/browser/index.min.js +2 -0
  1498. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/browser/perf.js +7 -0
  1499. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -0
  1500. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/diagnostics-channel.js +19 -0
  1501. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1722 -0
  1502. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  1503. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +6 -0
  1504. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/node/index.js +1722 -0
  1505. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/node/index.min.js +2 -0
  1506. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/node/perf.js +7 -0
  1507. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
  1508. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/perf.js +7 -0
  1509. package/node_modules/path-scurry/node_modules/lru-cache/package.json +154 -0
  1510. package/node_modules/path-scurry/package.json +72 -0
  1511. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  1512. package/node_modules/qs/CHANGELOG.md +15 -0
  1513. package/node_modules/qs/README.md +19 -1
  1514. package/node_modules/qs/dist/qs.js +21 -21
  1515. package/node_modules/qs/eslint.config.mjs +1 -1
  1516. package/node_modules/qs/lib/parse.js +3 -4
  1517. package/node_modules/qs/lib/stringify.js +23 -8
  1518. package/node_modules/qs/lib/utils.js +10 -3
  1519. package/node_modules/qs/package.json +4 -4
  1520. package/node_modules/run/README.md +109 -18
  1521. package/node_modules/run/THIRD_PARTY_NOTICES.md +11 -11
  1522. package/node_modules/run/dist/continuation-validation.js +116 -1
  1523. package/node_modules/run/dist/errors.js +12 -2
  1524. package/node_modules/run/dist/host-function-invocation.js +2 -1
  1525. package/node_modules/run/dist/run.js +30 -4
  1526. package/node_modules/run/dist/runtime/guest-serde-source.js +1 -1
  1527. package/node_modules/run/dist/runtime/guest-sources.js +214 -56
  1528. package/node_modules/run/dist/runtime/manager.js +575 -116
  1529. package/node_modules/run/dist/runtime/max-workers.js +8 -4
  1530. package/node_modules/run/dist/runtime/protocol-validation.js +20 -7
  1531. package/node_modules/run/dist/runtime/sync-bridge-protocol.js +135 -0
  1532. package/node_modules/run/dist/runtime/worker-source.js +1 -1
  1533. package/node_modules/run/dist/utils/options.js +7 -0
  1534. package/node_modules/run/dist/utils/promise-with-resolvers.js +13 -1
  1535. package/node_modules/run/dist/utils/serde.js +1 -7
  1536. package/node_modules/run/dist/utils/source-cache.js +83 -13
  1537. package/node_modules/run/package.json +6 -4
  1538. package/node_modules/socks/build/common/helpers.js +5 -6
  1539. package/node_modules/socks/build/common/util.js +2 -2
  1540. package/node_modules/socks/package.json +7 -7
  1541. package/node_modules/systeminformation/LICENSE +20 -0
  1542. package/node_modules/systeminformation/README.md +1251 -0
  1543. package/node_modules/systeminformation/lib/audio.js +335 -0
  1544. package/node_modules/systeminformation/lib/battery.js +355 -0
  1545. package/node_modules/systeminformation/lib/bluetooth.js +315 -0
  1546. package/node_modules/systeminformation/lib/bluetoothVendors.js +1138 -0
  1547. package/node_modules/systeminformation/lib/cli.js +100 -0
  1548. package/node_modules/systeminformation/lib/cpu.js +2285 -0
  1549. package/node_modules/systeminformation/lib/docker.js +791 -0
  1550. package/node_modules/systeminformation/lib/dockerSocket.js +117 -0
  1551. package/node_modules/systeminformation/lib/filesystem.js +1933 -0
  1552. package/node_modules/systeminformation/lib/graphics.js +1317 -0
  1553. package/node_modules/systeminformation/lib/index.js +520 -0
  1554. package/node_modules/systeminformation/lib/internet.js +265 -0
  1555. package/node_modules/systeminformation/lib/memory.js +620 -0
  1556. package/node_modules/systeminformation/lib/network.js +2014 -0
  1557. package/node_modules/systeminformation/lib/osinfo.js +1304 -0
  1558. package/node_modules/systeminformation/lib/printer.js +209 -0
  1559. package/node_modules/systeminformation/lib/processes.js +1496 -0
  1560. package/node_modules/systeminformation/lib/system.js +855 -0
  1561. package/node_modules/systeminformation/lib/usb.js +309 -0
  1562. package/node_modules/systeminformation/lib/users.js +412 -0
  1563. package/node_modules/systeminformation/lib/util.js +2840 -0
  1564. package/node_modules/systeminformation/lib/virtualbox.js +116 -0
  1565. package/node_modules/systeminformation/lib/wifi.js +839 -0
  1566. package/node_modules/systeminformation/package.json +102 -0
  1567. package/node_modules/undici/README.md +10 -1
  1568. package/node_modules/undici/docs/docs/api/Agent.md +8 -8
  1569. package/node_modules/undici/docs/docs/api/Client.md +4 -0
  1570. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  1571. package/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  1572. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  1573. package/node_modules/undici/docs/docs/api/Errors.md +25 -0
  1574. package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  1575. package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  1576. package/node_modules/undici/docs/docs/api/Interceptors.md +8 -3
  1577. package/node_modules/undici/docs/docs/api/Pool.md +5 -6
  1578. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  1579. package/node_modules/undici/docs/docs/index.md +10 -1
  1580. package/node_modules/undici/lib/api/readable.js +1 -2
  1581. package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  1582. package/node_modules/undici/lib/core/request.js +23 -2
  1583. package/node_modules/undici/lib/core/symbols.js +2 -0
  1584. package/node_modules/undici/lib/core/util.js +0 -39
  1585. package/node_modules/undici/lib/dispatcher/agent.js +7 -2
  1586. package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  1587. package/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  1588. package/node_modules/undici/lib/dispatcher/client-h2.js +94 -10
  1589. package/node_modules/undici/lib/dispatcher/client.js +9 -3
  1590. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  1591. package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  1592. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  1593. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +31 -9
  1594. package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  1595. package/node_modules/undici/lib/dispatcher/pool.js +90 -7
  1596. package/node_modules/undici/lib/dispatcher/proxy-agent.js +33 -3
  1597. package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  1598. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  1599. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  1600. package/node_modules/undici/lib/handler/cache-handler.js +29 -5
  1601. package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  1602. package/node_modules/undici/lib/handler/deduplication-handler.js +29 -10
  1603. package/node_modules/undici/lib/handler/redirect-handler.js +26 -4
  1604. package/node_modules/undici/lib/handler/retry-handler.js +215 -38
  1605. package/node_modules/undici/lib/interceptor/cache.js +69 -13
  1606. package/node_modules/undici/lib/interceptor/decompress.js +319 -50
  1607. package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  1608. package/node_modules/undici/lib/interceptor/dns.js +7 -0
  1609. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  1610. package/node_modules/undici/lib/mock/mock-agent.js +13 -1
  1611. package/node_modules/undici/lib/mock/mock-utils.js +11 -10
  1612. package/node_modules/undici/lib/util/cache.js +45 -3
  1613. package/node_modules/undici/lib/web/cache/cache.js +17 -8
  1614. package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  1615. package/node_modules/undici/lib/web/cookies/index.js +19 -7
  1616. package/node_modules/undici/lib/web/cookies/parse.js +150 -147
  1617. package/node_modules/undici/lib/web/cookies/util.js +3 -1
  1618. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  1619. package/node_modules/undici/lib/web/eventsource/eventsource.js +38 -4
  1620. package/node_modules/undici/lib/web/fetch/body.js +22 -15
  1621. package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  1622. package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  1623. package/node_modules/undici/lib/web/fetch/headers.js +34 -31
  1624. package/node_modules/undici/lib/web/fetch/index.js +52 -25
  1625. package/node_modules/undici/lib/web/fetch/request.js +76 -82
  1626. package/node_modules/undici/lib/web/fetch/response.js +43 -44
  1627. package/node_modules/undici/lib/web/fetch/util.js +13 -8
  1628. package/node_modules/undici/lib/web/infra/index.js +16 -1
  1629. package/node_modules/undici/lib/web/webidl/index.js +5 -17
  1630. package/node_modules/undici/lib/web/websocket/connection.js +34 -13
  1631. package/node_modules/undici/lib/web/websocket/events.js +43 -26
  1632. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  1633. package/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  1634. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  1635. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +27 -14
  1636. package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  1637. package/node_modules/undici/package.json +3 -3
  1638. package/node_modules/undici-types/package.json +1 -1
  1639. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
  1640. package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
  1641. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
  1642. package/node_modules/yaml/dist/nodes/Alias.js +25 -23
  1643. package/node_modules/yaml/package.json +1 -1
  1644. package/node_modules/zod/README.md +29 -2
  1645. package/node_modules/zod/compile.cjs +96 -0
  1646. package/node_modules/zod/compile.js +52 -0
  1647. package/node_modules/zod/index.cjs +21 -2
  1648. package/node_modules/zod/index.js +5 -2
  1649. package/node_modules/zod/locales/index.cjs +19 -0
  1650. package/node_modules/zod/mini/index.cjs +19 -0
  1651. package/node_modules/zod/package.json +20 -8
  1652. package/node_modules/zod/v3/ZodError.cjs +41 -12
  1653. package/node_modules/zod/v3/ZodError.js +22 -12
  1654. package/node_modules/zod/v3/errors.cjs +19 -0
  1655. package/node_modules/zod/v3/external.cjs +19 -0
  1656. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  1657. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  1658. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  1659. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  1660. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  1661. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  1662. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  1663. package/node_modules/zod/v3/index.cjs +19 -0
  1664. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  1665. package/node_modules/zod/v3/types.cjs +26 -5
  1666. package/node_modules/zod/v3/types.js +7 -5
  1667. package/node_modules/zod/v4/classic/checks.cjs +21 -1
  1668. package/node_modules/zod/v4/classic/checks.js +1 -1
  1669. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  1670. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  1671. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  1672. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  1673. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  1674. package/node_modules/zod/v4/classic/errors.js +43 -34
  1675. package/node_modules/zod/v4/classic/external.cjs +51 -27
  1676. package/node_modules/zod/v4/classic/external.js +5 -8
  1677. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  1678. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  1679. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  1680. package/node_modules/zod/v4/classic/in-out.js +36 -0
  1681. package/node_modules/zod/v4/classic/index.cjs +21 -2
  1682. package/node_modules/zod/v4/classic/index.js +2 -2
  1683. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  1684. package/node_modules/zod/v4/classic/iso.js +2 -17
  1685. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  1686. package/node_modules/zod/v4/classic/parse.js +1 -0
  1687. package/node_modules/zod/v4/classic/schemas.cjs +591 -426
  1688. package/node_modules/zod/v4/classic/schemas.js +564 -424
  1689. package/node_modules/zod/v4/core/api.cjs +66 -24
  1690. package/node_modules/zod/v4/core/api.js +44 -24
  1691. package/node_modules/zod/v4/core/checks.cjs +88 -128
  1692. package/node_modules/zod/v4/core/checks.js +68 -127
  1693. package/node_modules/zod/v4/core/compile.cjs +1908 -0
  1694. package/node_modules/zod/v4/core/compile.js +1858 -0
  1695. package/node_modules/zod/v4/core/core.cjs +101 -19
  1696. package/node_modules/zod/v4/core/core.js +83 -20
  1697. package/node_modules/zod/v4/core/doc.cjs +31 -9
  1698. package/node_modules/zod/v4/core/doc.js +12 -9
  1699. package/node_modules/zod/v4/core/errors.cjs +126 -25
  1700. package/node_modules/zod/v4/core/errors.js +107 -25
  1701. package/node_modules/zod/v4/core/index.cjs +24 -1
  1702. package/node_modules/zod/v4/core/index.js +3 -0
  1703. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  1704. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  1705. package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
  1706. package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
  1707. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  1708. package/node_modules/zod/v4/core/memoizer.cjs +356 -0
  1709. package/node_modules/zod/v4/core/memoizer.js +307 -0
  1710. package/node_modules/zod/v4/core/parse.cjs +148 -46
  1711. package/node_modules/zod/v4/core/parse.js +127 -45
  1712. package/node_modules/zod/v4/core/regexes.cjs +54 -17
  1713. package/node_modules/zod/v4/core/regexes.js +32 -15
  1714. package/node_modules/zod/v4/core/registries.cjs +19 -0
  1715. package/node_modules/zod/v4/core/registries.js +2 -2
  1716. package/node_modules/zod/v4/core/schemas.cjs +785 -386
  1717. package/node_modules/zod/v4/core/schemas.js +753 -386
  1718. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  1719. package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
  1720. package/node_modules/zod/v4/core/to-json-schema.js +247 -44
  1721. package/node_modules/zod/v4/core/util.cjs +372 -157
  1722. package/node_modules/zod/v4/core/util.js +341 -156
  1723. package/node_modules/zod/v4/core/versions.cjs +21 -2
  1724. package/node_modules/zod/v4/core/versions.js +2 -2
  1725. package/node_modules/zod/v4/core/visit.cjs +214 -0
  1726. package/node_modules/zod/v4/core/visit.js +169 -0
  1727. package/node_modules/zod/v4/index.cjs +34 -5
  1728. package/node_modules/zod/v4/index.js +3 -2
  1729. package/node_modules/zod/v4/locales/ar.cjs +5 -0
  1730. package/node_modules/zod/v4/locales/ar.js +5 -0
  1731. package/node_modules/zod/v4/locales/az.cjs +5 -0
  1732. package/node_modules/zod/v4/locales/az.js +5 -0
  1733. package/node_modules/zod/v4/locales/be.cjs +12 -0
  1734. package/node_modules/zod/v4/locales/be.js +12 -0
  1735. package/node_modules/zod/v4/locales/bg.cjs +5 -0
  1736. package/node_modules/zod/v4/locales/bg.js +5 -0
  1737. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  1738. package/node_modules/zod/v4/locales/bn.js +113 -0
  1739. package/node_modules/zod/v4/locales/ca.cjs +5 -0
  1740. package/node_modules/zod/v4/locales/ca.js +5 -0
  1741. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  1742. package/node_modules/zod/v4/locales/ckb.js +133 -0
  1743. package/node_modules/zod/v4/locales/cs.cjs +5 -0
  1744. package/node_modules/zod/v4/locales/cs.js +5 -0
  1745. package/node_modules/zod/v4/locales/da.cjs +7 -2
  1746. package/node_modules/zod/v4/locales/da.js +7 -2
  1747. package/node_modules/zod/v4/locales/de.cjs +5 -0
  1748. package/node_modules/zod/v4/locales/de.js +5 -0
  1749. package/node_modules/zod/v4/locales/el.cjs +3 -0
  1750. package/node_modules/zod/v4/locales/el.js +3 -0
  1751. package/node_modules/zod/v4/locales/en.cjs +16 -4
  1752. package/node_modules/zod/v4/locales/en.js +16 -4
  1753. package/node_modules/zod/v4/locales/eo.cjs +5 -0
  1754. package/node_modules/zod/v4/locales/eo.js +5 -0
  1755. package/node_modules/zod/v4/locales/es.cjs +4 -0
  1756. package/node_modules/zod/v4/locales/es.js +4 -0
  1757. package/node_modules/zod/v4/locales/fa.cjs +5 -0
  1758. package/node_modules/zod/v4/locales/fa.js +5 -0
  1759. package/node_modules/zod/v4/locales/fi.cjs +5 -0
  1760. package/node_modules/zod/v4/locales/fi.js +5 -0
  1761. package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
  1762. package/node_modules/zod/v4/locales/fr-CA.js +5 -0
  1763. package/node_modules/zod/v4/locales/fr.cjs +18 -14
  1764. package/node_modules/zod/v4/locales/fr.js +18 -14
  1765. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  1766. package/node_modules/zod/v4/locales/gu.js +113 -0
  1767. package/node_modules/zod/v4/locales/he.cjs +7 -0
  1768. package/node_modules/zod/v4/locales/he.js +7 -0
  1769. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  1770. package/node_modules/zod/v4/locales/hi.js +111 -0
  1771. package/node_modules/zod/v4/locales/hr.cjs +4 -0
  1772. package/node_modules/zod/v4/locales/hr.js +4 -0
  1773. package/node_modules/zod/v4/locales/hu.cjs +5 -0
  1774. package/node_modules/zod/v4/locales/hu.js +5 -0
  1775. package/node_modules/zod/v4/locales/hy.cjs +11 -0
  1776. package/node_modules/zod/v4/locales/hy.js +11 -0
  1777. package/node_modules/zod/v4/locales/id.cjs +5 -0
  1778. package/node_modules/zod/v4/locales/id.js +5 -0
  1779. package/node_modules/zod/v4/locales/index.cjs +43 -2
  1780. package/node_modules/zod/v4/locales/index.js +11 -0
  1781. package/node_modules/zod/v4/locales/is.cjs +5 -0
  1782. package/node_modules/zod/v4/locales/is.js +5 -0
  1783. package/node_modules/zod/v4/locales/it.cjs +5 -0
  1784. package/node_modules/zod/v4/locales/it.js +5 -0
  1785. package/node_modules/zod/v4/locales/ja.cjs +5 -0
  1786. package/node_modules/zod/v4/locales/ja.js +5 -0
  1787. package/node_modules/zod/v4/locales/ka.cjs +5 -0
  1788. package/node_modules/zod/v4/locales/ka.js +5 -0
  1789. package/node_modules/zod/v4/locales/km.cjs +5 -0
  1790. package/node_modules/zod/v4/locales/km.js +5 -0
  1791. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  1792. package/node_modules/zod/v4/locales/kn.js +116 -0
  1793. package/node_modules/zod/v4/locales/ko.cjs +5 -0
  1794. package/node_modules/zod/v4/locales/ko.js +5 -0
  1795. package/node_modules/zod/v4/locales/lt.cjs +4 -0
  1796. package/node_modules/zod/v4/locales/lt.js +4 -0
  1797. package/node_modules/zod/v4/locales/mk.cjs +5 -0
  1798. package/node_modules/zod/v4/locales/mk.js +5 -0
  1799. package/node_modules/zod/v4/locales/ms.cjs +5 -0
  1800. package/node_modules/zod/v4/locales/ms.js +5 -0
  1801. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  1802. package/node_modules/zod/v4/locales/ne.js +111 -0
  1803. package/node_modules/zod/v4/locales/nl.cjs +5 -0
  1804. package/node_modules/zod/v4/locales/nl.js +5 -0
  1805. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  1806. package/node_modules/zod/v4/locales/nn.js +113 -0
  1807. package/node_modules/zod/v4/locales/no.cjs +7 -2
  1808. package/node_modules/zod/v4/locales/no.js +7 -2
  1809. package/node_modules/zod/v4/locales/ota.cjs +5 -0
  1810. package/node_modules/zod/v4/locales/ota.js +5 -0
  1811. package/node_modules/zod/v4/locales/pl.cjs +5 -0
  1812. package/node_modules/zod/v4/locales/pl.js +5 -0
  1813. package/node_modules/zod/v4/locales/ps.cjs +5 -0
  1814. package/node_modules/zod/v4/locales/ps.js +5 -0
  1815. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  1816. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  1817. package/node_modules/zod/v4/locales/pt.cjs +89 -55
  1818. package/node_modules/zod/v4/locales/pt.js +89 -55
  1819. package/node_modules/zod/v4/locales/ro.cjs +3 -0
  1820. package/node_modules/zod/v4/locales/ro.js +3 -0
  1821. package/node_modules/zod/v4/locales/ru.cjs +12 -0
  1822. package/node_modules/zod/v4/locales/ru.js +12 -0
  1823. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  1824. package/node_modules/zod/v4/locales/sk.js +116 -0
  1825. package/node_modules/zod/v4/locales/sl.cjs +5 -0
  1826. package/node_modules/zod/v4/locales/sl.js +5 -0
  1827. package/node_modules/zod/v4/locales/sv.cjs +7 -2
  1828. package/node_modules/zod/v4/locales/sv.js +7 -2
  1829. package/node_modules/zod/v4/locales/ta.cjs +5 -0
  1830. package/node_modules/zod/v4/locales/ta.js +5 -0
  1831. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  1832. package/node_modules/zod/v4/locales/tg.js +117 -0
  1833. package/node_modules/zod/v4/locales/th.cjs +5 -0
  1834. package/node_modules/zod/v4/locales/th.js +5 -0
  1835. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  1836. package/node_modules/zod/v4/locales/tk.js +107 -0
  1837. package/node_modules/zod/v4/locales/tr.cjs +5 -0
  1838. package/node_modules/zod/v4/locales/tr.js +5 -0
  1839. package/node_modules/zod/v4/locales/uk.cjs +5 -0
  1840. package/node_modules/zod/v4/locales/uk.js +5 -0
  1841. package/node_modules/zod/v4/locales/ur.cjs +5 -0
  1842. package/node_modules/zod/v4/locales/ur.js +5 -0
  1843. package/node_modules/zod/v4/locales/uz.cjs +3 -0
  1844. package/node_modules/zod/v4/locales/uz.js +3 -0
  1845. package/node_modules/zod/v4/locales/vi.cjs +5 -0
  1846. package/node_modules/zod/v4/locales/vi.js +5 -0
  1847. package/node_modules/zod/v4/locales/yo.cjs +5 -0
  1848. package/node_modules/zod/v4/locales/yo.js +5 -0
  1849. package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
  1850. package/node_modules/zod/v4/locales/zh-CN.js +5 -0
  1851. package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
  1852. package/node_modules/zod/v4/locales/zh-TW.js +5 -0
  1853. package/node_modules/zod/v4/mini/checks.cjs +21 -1
  1854. package/node_modules/zod/v4/mini/checks.js +1 -1
  1855. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  1856. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  1857. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1858. package/node_modules/zod/v4/mini/external.cjs +33 -1
  1859. package/node_modules/zod/v4/mini/external.js +3 -1
  1860. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  1861. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1862. package/node_modules/zod/v4/mini/index.cjs +19 -0
  1863. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  1864. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  1865. package/node_modules/zod/v4/mini/parse.js +1 -1
  1866. package/node_modules/zod/v4/mini/schemas.cjs +117 -53
  1867. package/node_modules/zod/v4/mini/schemas.js +92 -51
  1868. package/node_modules/zod/v4-mini/index.cjs +19 -0
  1869. package/package.json +4 -4
  1870. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1224
  1871. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/LICENSE +0 -13
  1872. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/README.md +0 -1
  1873. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  1874. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/package.json +0 -63
  1875. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +0 -2444
  1876. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/README.md +0 -1
  1877. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -4295
  1878. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/package.json +0 -82
  1879. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/src/to-json-schema/zod3-to-json-schema/LICENSE +0 -16
  1880. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils/src/to-json-schema/zod3-to-json-schema/README.md +0 -24
  1881. package/node_modules/@ai-sdk/open-responses/node_modules/undici/LICENSE +0 -21
  1882. package/node_modules/@ai-sdk/open-responses/node_modules/undici/README.md +0 -741
  1883. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Agent.md +0 -84
  1884. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/BalancedPool.md +0 -99
  1885. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/CacheStorage.md +0 -30
  1886. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/CacheStore.md +0 -164
  1887. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Client.md +0 -288
  1888. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/ClientStats.md +0 -27
  1889. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Connector.md +0 -115
  1890. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/ContentType.md +0 -57
  1891. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Cookies.md +0 -128
  1892. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Debug.md +0 -62
  1893. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -315
  1894. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Dispatcher.md +0 -1392
  1895. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -159
  1896. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Errors.md +0 -49
  1897. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/EventSource.md +0 -45
  1898. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Fetch.md +0 -60
  1899. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -139
  1900. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/H2CClient.md +0 -263
  1901. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockAgent.md +0 -603
  1902. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -197
  1903. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -43
  1904. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockClient.md +0 -81
  1905. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockErrors.md +0 -12
  1906. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/MockPool.md +0 -555
  1907. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Pool.md +0 -84
  1908. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/PoolStats.md +0 -35
  1909. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -229
  1910. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -93
  1911. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/RetryAgent.md +0 -50
  1912. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/RetryHandler.md +0 -118
  1913. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -145
  1914. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -616
  1915. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -275
  1916. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/Util.md +0 -25
  1917. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/WebSocket.md +0 -141
  1918. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -91
  1919. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -64
  1920. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/crawling.md +0 -58
  1921. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -190
  1922. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/proxy.md +0 -127
  1923. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +0 -224
  1924. package/node_modules/@ai-sdk/open-responses/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -63
  1925. package/node_modules/@ai-sdk/open-responses/node_modules/undici/index-fetch.js +0 -65
  1926. package/node_modules/@ai-sdk/open-responses/node_modules/undici/index.js +0 -234
  1927. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/abort-signal.js +0 -59
  1928. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/api-connect.js +0 -110
  1929. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/api-pipeline.js +0 -252
  1930. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/api-request.js +0 -214
  1931. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/api-stream.js +0 -209
  1932. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/api-upgrade.js +0 -111
  1933. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/index.js +0 -7
  1934. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/api/readable.js +0 -580
  1935. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/cache/memory-cache-store.js +0 -279
  1936. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -467
  1937. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/connect.js +0 -153
  1938. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/constants.js +0 -143
  1939. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/diagnostics.js +0 -227
  1940. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/errors.js +0 -477
  1941. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/request.js +0 -464
  1942. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/socks5-client.js +0 -422
  1943. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/socks5-utils.js +0 -212
  1944. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/symbols.js +0 -75
  1945. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/tree.js +0 -160
  1946. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/core/util.js +0 -992
  1947. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/agent.js +0 -158
  1948. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -219
  1949. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/client-h1.js +0 -1731
  1950. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/client-h2.js +0 -995
  1951. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/client.js +0 -664
  1952. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -184
  1953. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/dispatcher.js +0 -48
  1954. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -146
  1955. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -135
  1956. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/h2c-client.js +0 -51
  1957. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/pool-base.js +0 -214
  1958. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/pool.js +0 -118
  1959. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -319
  1960. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/retry-agent.js +0 -35
  1961. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/round-robin-pool.js +0 -137
  1962. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +0 -260
  1963. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/encoding/index.js +0 -33
  1964. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/global.js +0 -59
  1965. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/cache-handler.js +0 -760
  1966. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -124
  1967. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/decorator-handler.js +0 -67
  1968. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/deduplication-handler.js +0 -460
  1969. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/redirect-handler.js +0 -238
  1970. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/retry-handler.js +0 -418
  1971. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/unwrap-handler.js +0 -106
  1972. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/handler/wrap-handler.js +0 -105
  1973. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/cache.js +0 -602
  1974. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/decompress.js +0 -259
  1975. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/deduplicate.js +0 -117
  1976. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/dns.js +0 -571
  1977. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/dump.js +0 -112
  1978. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/redirect.js +0 -21
  1979. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/response-error.js +0 -95
  1980. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/interceptor/retry.js +0 -19
  1981. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  1982. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/llhttp/constants.js +0 -531
  1983. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  1984. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  1985. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/llhttp/utils.js +0 -12
  1986. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-agent.js +0 -232
  1987. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  1988. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-client.js +0 -68
  1989. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-errors.js +0 -29
  1990. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-interceptor.js +0 -209
  1991. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-pool.js +0 -68
  1992. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-symbols.js +0 -32
  1993. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/mock-utils.js +0 -486
  1994. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  1995. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/snapshot-agent.js +0 -353
  1996. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/snapshot-recorder.js +0 -588
  1997. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/mock/snapshot-utils.js +0 -158
  1998. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/cache.js +0 -676
  1999. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/date.js +0 -670
  2000. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/promise.js +0 -28
  2001. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/runtime-features.js +0 -124
  2002. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/stats.js +0 -32
  2003. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/util/timers.js +0 -425
  2004. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cache/cache.js +0 -864
  2005. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  2006. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cache/util.js +0 -45
  2007. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cookies/constants.js +0 -12
  2008. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cookies/index.js +0 -199
  2009. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cookies/parse.js +0 -314
  2010. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/cookies/util.js +0 -352
  2011. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -399
  2012. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/eventsource/eventsource.js +0 -501
  2013. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/eventsource/util.js +0 -29
  2014. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  2015. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/body.js +0 -509
  2016. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/constants.js +0 -131
  2017. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/data-url.js +0 -596
  2018. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -586
  2019. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/formdata.js +0 -259
  2020. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/global.js +0 -40
  2021. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/headers.js +0 -719
  2022. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/index.js +0 -2413
  2023. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/request.js +0 -1115
  2024. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/response.js +0 -641
  2025. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/fetch/util.js +0 -1522
  2026. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/infra/index.js +0 -229
  2027. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/subresource-integrity/Readme.md +0 -9
  2028. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +0 -307
  2029. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/webidl/index.js +0 -1006
  2030. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/connection.js +0 -329
  2031. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/constants.js +0 -126
  2032. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/events.js +0 -331
  2033. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/frame.js +0 -133
  2034. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -100
  2035. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/receiver.js +0 -507
  2036. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/sender.js +0 -109
  2037. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -104
  2038. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -498
  2039. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/util.js +0 -347
  2040. package/node_modules/@ai-sdk/open-responses/node_modules/undici/lib/web/websocket/websocket.js +0 -758
  2041. package/node_modules/@ai-sdk/open-responses/node_modules/undici/package.json +0 -152
  2042. package/node_modules/@ai-sdk/open-responses/node_modules/undici/scripts/strip-comments.js +0 -10
  2043. package/node_modules/@ai-sdk/open-responses/node_modules/undici/types/README.md +0 -6
  2044. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  2045. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  2046. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
  2047. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  2048. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  2049. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
  2050. package/node_modules/@formatjs/icu-messageformat-parser/index.js +0 -2173
  2051. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +0 -207
  2052. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +0 -160
  2053. package/node_modules/@formatjs/icu-messageformat-parser/package.json +0 -21
  2054. package/node_modules/@formatjs/icu-messageformat-parser/printer.js +0 -224
  2055. package/node_modules/@maka/core/dist/deep-research-client-progress.js +0 -132
  2056. package/node_modules/@maka/core/dist/deep-research-run.js +0 -625
  2057. package/node_modules/@maka/core/dist/deep-research.js +0 -227
  2058. package/node_modules/@maka/core/dist/foreign-session.js +0 -596
  2059. package/node_modules/@maka/core/dist/task-ledger.js +0 -797
  2060. package/node_modules/@maka/core/dist/thread-search.js +0 -498
  2061. package/node_modules/@maka/eval/dist/maka-runtime-policy.js +0 -42
  2062. package/node_modules/@maka/runtime/dist/active-tool-result-prune.js +0 -334
  2063. package/node_modules/@maka/runtime/dist/active-tool-result-working-set.js +0 -218
  2064. package/node_modules/@maka/runtime/dist/archive-read-tool.js +0 -92
  2065. package/node_modules/@maka/runtime/dist/deep-research-tools.js +0 -741
  2066. package/node_modules/@maka/runtime/dist/history-tools.js +0 -429
  2067. package/node_modules/@maka/runtime/dist/provider-runtime-policy.js +0 -43
  2068. package/node_modules/@maka/runtime/dist/sandbox/diagnostics.js +0 -285
  2069. package/node_modules/@maka/runtime/dist/system-prompt/sandbox-context-prompt.js +0 -77
  2070. package/node_modules/@maka/runtime/dist/system-prompt/session-environment-prompt.js +0 -47
  2071. package/node_modules/@maka/runtime/dist/task-ledger-tools.js +0 -244
  2072. package/node_modules/@maka/runtime/dist/test-helpers.js +0 -61
  2073. package/node_modules/@maka/runtime/node_modules/@slack/types/dist/events/index.js +0 -43
  2074. package/node_modules/@maka/runtime/node_modules/@slack/types/package.json +0 -47
  2075. package/node_modules/@maka/runtime/node_modules/@slack/web-api/README.md +0 -390
  2076. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/methods.js +0 -1610
  2077. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js +0 -3
  2078. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js +0 -3
  2079. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js +0 -3
  2080. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/PinsListResponse.js +0 -37
  2081. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SearchAllResponse.js +0 -82
  2082. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SearchFilesResponse.js +0 -63
  2083. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsAccessDeleteResponse.js +0 -3
  2084. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsAccessSetResponse.js +0 -3
  2085. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsCreateResponse.js +0 -3
  2086. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsDownloadGetResponse.js +0 -3
  2087. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsDownloadStartResponse.js +0 -3
  2088. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsCreateResponse.js +0 -3
  2089. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsDeleteMultipleResponse.js +0 -3
  2090. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsDeleteResponse.js +0 -3
  2091. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsInfoResponse.js +0 -3
  2092. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsListResponse.js +0 -3
  2093. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsItemsUpdateResponse.js +0 -3
  2094. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/SlackListsUpdateResponse.js +0 -3
  2095. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedAddResponse.js +0 -3
  2096. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedListResponse.js +0 -3
  2097. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedRemoveResponse.js +0 -3
  2098. package/node_modules/@maka/runtime/node_modules/@slack/web-api/dist/types/response/WorkflowsFeaturedSetResponse.js +0 -3
  2099. package/node_modules/@maka/runtime/node_modules/@slack/web-api/package.json +0 -71
  2100. package/node_modules/@maka/runtime-host/dist/protocol/deep-research.js +0 -233
  2101. package/node_modules/@maka/runtime-host/dist/protocol/task-ledger.js +0 -321
  2102. package/node_modules/@maka/runtime-host/dist/server/deep-research-coordinator.js +0 -116
  2103. package/node_modules/@maka/runtime-host/dist/server/task-ledger-coordinator.js +0 -154
  2104. package/node_modules/@maka/storage/dist/artifact-storage-layout.js +0 -26
  2105. package/node_modules/@maka/storage/dist/deep-research-authority.js +0 -129
  2106. package/node_modules/@maka/storage/dist/deep-research-store.js +0 -343
  2107. package/node_modules/@maka/storage/dist/foreign-session-store.js +0 -641
  2108. package/node_modules/@maka/storage/dist/provider-request-capture-artifact.js +0 -31
  2109. package/node_modules/@maka/storage/dist/task-ledger-authority.js +0 -121
  2110. package/node_modules/@maka/storage/dist/task-ledger-store-internal.js +0 -32
  2111. package/node_modules/@maka/storage/dist/task-ledger-store.js +0 -663
  2112. package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +0 -1
  2113. package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +0 -1
  2114. package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +0 -7063
  2115. package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +0 -7431
  2116. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +0 -1
  2117. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +0 -1678
  2118. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +0 -2899
  2119. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +0 -1
  2120. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -175
  2121. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
  2122. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -201
  2123. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
  2124. package/node_modules/@modelcontextprotocol/core/package.json +0 -85
  2125. package/node_modules/intl-messageformat/intl-messageformat.iife.js +0 -2807
  2126. package/node_modules/intl-messageformat/package.json +0 -40
  2127. package/node_modules/socks/.eslintrc.cjs +0 -11
  2128. /package/node_modules/@maka/{storage/dist/artifact-metadata-repository.js → core/dist/client-plugin-bridge.js} +0 -0
  2129. /package/node_modules/{@formatjs → @maka/core/node_modules/@formatjs}/icu-messageformat-parser/LICENSE.md +0 -0
  2130. /package/node_modules/{@formatjs → @maka/core/node_modules/@formatjs}/icu-messageformat-parser/README.md +0 -0
  2131. /package/node_modules/{intl-messageformat → @maka/core/node_modules/intl-messageformat}/LICENSE.md +0 -0
  2132. /package/node_modules/{intl-messageformat → @maka/core/node_modules/intl-messageformat}/README.md +0 -0
  2133. /package/node_modules/{intl-messageformat → @maka/core/node_modules/intl-messageformat}/index.js +0 -0
  2134. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/LICENSE +0 -0
  2135. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/README.md +0 -0
  2136. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.cts.map +0 -0
  2137. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.mts.map +0 -0
  2138. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/logger/LICENSE +0 -0
  2139. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/logger/README.md +0 -0
  2140. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/logger/dist/index.js +0 -0
  2141. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/logger/package.json +0 -0
  2142. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/LICENSE +0 -0
  2143. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/README.md +0 -0
  2144. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/block-kit/block-elements.js +0 -0
  2145. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/block-kit/blocks.js +0 -0
  2146. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/block-kit/composition-objects.js +0 -0
  2147. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/block-kit/extensions.js +0 -0
  2148. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/calls.js +0 -0
  2149. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/chunk.js +0 -0
  2150. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/common/bot-profile.js +0 -0
  2151. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/common/status-emoji-display-info.js +0 -0
  2152. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/dialog.js +0 -0
  2153. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/app.js +0 -0
  2154. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/assistant.js +0 -0
  2155. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/call.js +0 -0
  2156. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/channel.js +0 -0
  2157. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/dnd.js +0 -0
  2158. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/email.js +0 -0
  2159. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/emoji.js +0 -0
  2160. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/entity-details-requested.js +0 -0
  2161. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/file.js +0 -0
  2162. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/function.js +0 -0
  2163. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/grid-migration.js +0 -0
  2164. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/group.js +0 -0
  2165. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/im.js +0 -0
  2166. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/invite.js +0 -0
  2167. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/link-shared.js +0 -0
  2168. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/member.js +0 -0
  2169. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/message-metadata.js +0 -0
  2170. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/message.js +0 -0
  2171. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/pin.js +0 -0
  2172. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/reaction.js +0 -0
  2173. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/shared-channel.js +0 -0
  2174. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/star.js +0 -0
  2175. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/steps-from-apps.js +0 -0
  2176. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/subteam.js +0 -0
  2177. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/team.js +0 -0
  2178. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/token.js +0 -0
  2179. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/events/user.js +0 -0
  2180. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/index.js +0 -0
  2181. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/message-attachments.js +0 -0
  2182. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/message-metadata.js +0 -0
  2183. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/types/dist/views.js +0 -0
  2184. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/LICENSE +0 -0
  2185. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/WebClient.js +0 -0
  2186. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/chat-stream.js +0 -0
  2187. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/errors.js +0 -0
  2188. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/file-upload.js +0 -0
  2189. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/helpers.js +0 -0
  2190. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/index.js +0 -0
  2191. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/instrument.js +0 -0
  2192. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/logger.js +0 -0
  2193. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/retry-policies.js +0 -0
  2194. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/helpers.js +0 -0
  2195. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/analytics.js +0 -0
  2196. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/apps.js +0 -0
  2197. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/auth.js +0 -0
  2198. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/barriers.js +0 -0
  2199. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/conversations.js +0 -0
  2200. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/emoji.js +0 -0
  2201. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/functions.js +0 -0
  2202. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/inviteRequests.js +0 -0
  2203. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/roles.js +0 -0
  2204. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/teams.js +0 -0
  2205. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/usergroups.js +0 -0
  2206. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/users.js +0 -0
  2207. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/admin/workflows.js +0 -0
  2208. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/api.js +0 -0
  2209. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/apps.js +0 -0
  2210. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/assistant.js +0 -0
  2211. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/auth.js +0 -0
  2212. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/bookmarks.js +0 -0
  2213. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/bots.js +0 -0
  2214. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/calls.js +0 -0
  2215. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/canvas.js +0 -0
  2216. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/chat.js +0 -0
  2217. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/common.js +0 -0
  2218. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/conversations.js +0 -0
  2219. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/dialog.js +0 -0
  2220. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/dnd.js +0 -0
  2221. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/emoji.js +0 -0
  2222. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/entity.js +0 -0
  2223. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/files.js +0 -0
  2224. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/functions.js +0 -0
  2225. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/index.js +0 -0
  2226. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/manifest.js +0 -0
  2227. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/migration.js +0 -0
  2228. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/oauth.js +0 -0
  2229. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/openid.js +0 -0
  2230. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/pins.js +0 -0
  2231. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/reactions.js +0 -0
  2232. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/reminders.js +0 -0
  2233. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/rtm.js +0 -0
  2234. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/search.js +0 -0
  2235. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/slackLists.js +0 -0
  2236. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/stars.js +0 -0
  2237. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/team.js +0 -0
  2238. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/tooling.js +0 -0
  2239. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/usergroups.js +0 -0
  2240. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/users.js +0 -0
  2241. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/views.js +0 -0
  2242. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/request/workflows.js +0 -0
  2243. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAnalyticsGetFileResponse.js +0 -0
  2244. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsActivitiesListResponse.js +0 -0
  2245. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsApproveResponse.js +0 -0
  2246. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsApprovedListResponse.js +0 -0
  2247. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsClearResolutionResponse.js +0 -0
  2248. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsConfigLookupResponse.js +0 -0
  2249. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsConfigSetResponse.js +0 -0
  2250. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsRequestsCancelResponse.js +0 -0
  2251. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsRequestsListResponse.js +0 -0
  2252. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsRestrictResponse.js +0 -0
  2253. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsRestrictedListResponse.js +0 -0
  2254. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAppsUninstallResponse.js +0 -0
  2255. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAuthPolicyAssignEntitiesResponse.js +0 -0
  2256. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAuthPolicyGetEntitiesResponse.js +0 -0
  2257. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminAuthPolicyRemoveEntitiesResponse.js +0 -0
  2258. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminBarriersCreateResponse.js +0 -0
  2259. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminBarriersDeleteResponse.js +0 -0
  2260. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminBarriersListResponse.js +0 -0
  2261. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminBarriersUpdateResponse.js +0 -0
  2262. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsArchiveResponse.js +0 -0
  2263. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsBulkArchiveResponse.js +0 -0
  2264. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsBulkDeleteResponse.js +0 -0
  2265. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsBulkMoveResponse.js +0 -0
  2266. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsConvertToPrivateResponse.js +0 -0
  2267. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsConvertToPublicResponse.js +0 -0
  2268. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsCreateResponse.js +0 -0
  2269. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsDeleteResponse.js +0 -0
  2270. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsDisconnectSharedResponse.js +0 -0
  2271. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.js +0 -0
  2272. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsGetConversationPrefsResponse.js +0 -0
  2273. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsGetCustomRetentionResponse.js +0 -0
  2274. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsGetTeamsResponse.js +0 -0
  2275. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsInviteResponse.js +0 -0
  2276. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsLookupResponse.js +0 -0
  2277. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsRemoveCustomRetentionResponse.js +0 -0
  2278. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsRenameResponse.js +0 -0
  2279. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsRestrictAccessAddGroupResponse.js +0 -0
  2280. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsRestrictAccessListGroupsResponse.js +0 -0
  2281. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.js +0 -0
  2282. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsSearchResponse.js +0 -0
  2283. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsSetConversationPrefsResponse.js +0 -0
  2284. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsSetCustomRetentionResponse.js +0 -0
  2285. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsSetTeamsResponse.js +0 -0
  2286. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsUnarchiveResponse.js +0 -0
  2287. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsWhitelistAddResponse.js +0 -0
  2288. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.js +0 -0
  2289. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminConversationsWhitelistRemoveResponse.js +0 -0
  2290. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminEmojiAddAliasResponse.js +0 -0
  2291. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminEmojiAddResponse.js +0 -0
  2292. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminEmojiListResponse.js +0 -0
  2293. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminEmojiRemoveResponse.js +0 -0
  2294. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminEmojiRenameResponse.js +0 -0
  2295. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminFunctionsListResponse.js +0 -0
  2296. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminFunctionsPermissionsLookupResponse.js +0 -0
  2297. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminFunctionsPermissionsSetResponse.js +0 -0
  2298. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminInviteRequestsApproveResponse.js +0 -0
  2299. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminInviteRequestsApprovedListResponse.js +0 -0
  2300. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminInviteRequestsDeniedListResponse.js +0 -0
  2301. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminInviteRequestsDenyResponse.js +0 -0
  2302. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminInviteRequestsListResponse.js +0 -0
  2303. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminRolesAddAssignmentsResponse.js +0 -0
  2304. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminRolesListAssignmentsResponse.js +0 -0
  2305. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminRolesRemoveAssignmentsResponse.js +0 -0
  2306. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsAdminsListResponse.js +0 -0
  2307. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsCreateResponse.js +0 -0
  2308. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsListResponse.js +0 -0
  2309. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsOwnersListResponse.js +0 -0
  2310. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsInfoResponse.js +0 -0
  2311. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.js +0 -0
  2312. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsSetDescriptionResponse.js +0 -0
  2313. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.js +0 -0
  2314. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsSetIconResponse.js +0 -0
  2315. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminTeamsSettingsSetNameResponse.js +0 -0
  2316. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsergroupsAddChannelsResponse.js +0 -0
  2317. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsergroupsAddTeamsResponse.js +0 -0
  2318. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsergroupsListChannelsResponse.js +0 -0
  2319. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsergroupsRemoveChannelsResponse.js +0 -0
  2320. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersAssignResponse.js +0 -0
  2321. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersInviteResponse.js +0 -0
  2322. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersListResponse.js +0 -0
  2323. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersRemoveResponse.js +0 -0
  2324. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionClearSettingsResponse.js +0 -0
  2325. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionGetSettingsResponse.js +0 -0
  2326. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionInvalidateResponse.js +0 -0
  2327. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionListResponse.js +0 -0
  2328. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionResetBulkResponse.js +0 -0
  2329. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionResetResponse.js +0 -0
  2330. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSessionSetSettingsResponse.js +0 -0
  2331. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSetAdminResponse.js +0 -0
  2332. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSetExpirationResponse.js +0 -0
  2333. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSetOwnerResponse.js +0 -0
  2334. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersSetRegularResponse.js +0 -0
  2335. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminUsersUnsupportedVersionsExportResponse.js +0 -0
  2336. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminWorkflowsCollaboratorsAddResponse.js +0 -0
  2337. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminWorkflowsCollaboratorsRemoveResponse.js +0 -0
  2338. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminWorkflowsPermissionsLookupResponse.js +0 -0
  2339. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminWorkflowsSearchResponse.js +0 -0
  2340. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AdminWorkflowsUnpublishResponse.js +0 -0
  2341. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ApiTestResponse.js +0 -0
  2342. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsConnectionsOpenResponse.js +0 -0
  2343. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsEventAuthorizationsListResponse.js +0 -0
  2344. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsManifestCreateResponse.js +0 -0
  2345. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsManifestDeleteResponse.js +0 -0
  2346. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsManifestExportResponse.js +0 -0
  2347. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsManifestUpdateResponse.js +0 -0
  2348. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsManifestValidateResponse.js +0 -0
  2349. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsInfoResponse.js +0 -0
  2350. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsRequestResponse.js +0 -0
  2351. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsResourcesListResponse.js +0 -0
  2352. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsScopesListResponse.js +0 -0
  2353. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsUsersListResponse.js +0 -0
  2354. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsPermissionsUsersRequestResponse.js +0 -0
  2355. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsUninstallResponse.js +0 -0
  2356. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AppsUserConnectionUpdateResponse.js +0 -0
  2357. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AssistantThreadsSetStatusResponse.js +0 -0
  2358. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AssistantThreadsSetSuggestedPromptsResponse.js +0 -0
  2359. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AssistantThreadsSetTitleResponse.js +0 -0
  2360. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AuthRevokeResponse.js +0 -0
  2361. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AuthTeamsListResponse.js +0 -0
  2362. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/AuthTestResponse.js +0 -0
  2363. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/BookmarksAddResponse.js +0 -0
  2364. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/BookmarksEditResponse.js +0 -0
  2365. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/BookmarksListResponse.js +0 -0
  2366. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/BookmarksRemoveResponse.js +0 -0
  2367. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/BotsInfoResponse.js +0 -0
  2368. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsAddResponse.js +0 -0
  2369. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsEndResponse.js +0 -0
  2370. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsInfoResponse.js +0 -0
  2371. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsParticipantsAddResponse.js +0 -0
  2372. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsParticipantsRemoveResponse.js +0 -0
  2373. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CallsUpdateResponse.js +0 -0
  2374. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesAccessDeleteResponse.js +0 -0
  2375. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesAccessSetResponse.js +0 -0
  2376. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesCreateResponse.js +0 -0
  2377. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesDeleteResponse.js +0 -0
  2378. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesEditResponse.js +0 -0
  2379. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/CanvasesSectionsLookupResponse.js +0 -0
  2380. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsArchiveResponse.js +0 -0
  2381. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsCreateResponse.js +0 -0
  2382. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsHistoryResponse.js +0 -0
  2383. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsInfoResponse.js +0 -0
  2384. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsInviteResponse.js +0 -0
  2385. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsJoinResponse.js +0 -0
  2386. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsKickResponse.js +0 -0
  2387. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsLeaveResponse.js +0 -0
  2388. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsListResponse.js +0 -0
  2389. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsMarkResponse.js +0 -0
  2390. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsRenameResponse.js +0 -0
  2391. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsRepliesResponse.js +0 -0
  2392. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsSetPurposeResponse.js +0 -0
  2393. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsSetTopicResponse.js +0 -0
  2394. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChannelsUnarchiveResponse.js +0 -0
  2395. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatDeleteResponse.js +0 -0
  2396. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatDeleteScheduledMessageResponse.js +0 -0
  2397. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatGetPermalinkResponse.js +0 -0
  2398. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatMeMessageResponse.js +0 -0
  2399. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatPostEphemeralResponse.js +0 -0
  2400. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatPostMessageResponse.js +0 -0
  2401. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatScheduleMessageResponse.js +0 -0
  2402. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatScheduledMessagesListResponse.js +0 -0
  2403. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatUnfurlResponse.js +0 -0
  2404. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ChatUpdateResponse.js +0 -0
  2405. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsAcceptSharedInviteResponse.js +0 -0
  2406. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsApproveSharedInviteResponse.js +0 -0
  2407. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsArchiveResponse.js +0 -0
  2408. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsCanvasesCreateResponse.js +0 -0
  2409. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsCloseResponse.js +0 -0
  2410. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsCreateResponse.js +0 -0
  2411. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsDeclineSharedInviteResponse.js +0 -0
  2412. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsExternalInvitePermissionsSetResponse.js +0 -0
  2413. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsHistoryResponse.js +0 -0
  2414. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsInfoResponse.js +0 -0
  2415. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsInviteResponse.js +0 -0
  2416. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsInviteSharedResponse.js +0 -0
  2417. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsJoinResponse.js +0 -0
  2418. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsKickResponse.js +0 -0
  2419. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsLeaveResponse.js +0 -0
  2420. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsListConnectInvitesResponse.js +0 -0
  2421. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsListResponse.js +0 -0
  2422. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsMarkResponse.js +0 -0
  2423. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsMembersResponse.js +0 -0
  2424. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsOpenResponse.js +0 -0
  2425. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsRenameResponse.js +0 -0
  2426. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsRepliesResponse.js +0 -0
  2427. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsRequestSharedInviteApproveResponse.js +0 -0
  2428. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsRequestSharedInviteDenyResponse.js +0 -0
  2429. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsRequestSharedInviteListResponse.js +0 -0
  2430. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsSetPurposeResponse.js +0 -0
  2431. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsSetTopicResponse.js +0 -0
  2432. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ConversationsUnarchiveResponse.js +0 -0
  2433. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DialogOpenResponse.js +0 -0
  2434. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DndEndDndResponse.js +0 -0
  2435. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DndEndSnoozeResponse.js +0 -0
  2436. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DndInfoResponse.js +0 -0
  2437. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DndSetSnoozeResponse.js +0 -0
  2438. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/DndTeamInfoResponse.js +0 -0
  2439. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/EmojiListResponse.js +0 -0
  2440. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/EntityPresentDetailsResponse.js +0 -0
  2441. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesCommentsAddResponse.js +0 -0
  2442. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesCommentsDeleteResponse.js +0 -0
  2443. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesCommentsEditResponse.js +0 -0
  2444. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesCompleteUploadExternalResponse.js +0 -0
  2445. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesDeleteResponse.js +0 -0
  2446. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesGetUploadURLExternalResponse.js +0 -0
  2447. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesInfoResponse.js +0 -0
  2448. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesListResponse.js +0 -0
  2449. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteAddResponse.js +0 -0
  2450. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteInfoResponse.js +0 -0
  2451. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteListResponse.js +0 -0
  2452. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteRemoveResponse.js +0 -0
  2453. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteShareResponse.js +0 -0
  2454. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRemoteUpdateResponse.js +0 -0
  2455. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesRevokePublicURLResponse.js +0 -0
  2456. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesSharedPublicURLResponse.js +0 -0
  2457. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FilesUploadResponse.js +0 -0
  2458. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FunctionsCompleteErrorResponse.js +0 -0
  2459. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/FunctionsCompleteSuccessResponse.js +0 -0
  2460. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsArchiveResponse.js +0 -0
  2461. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsCloseResponse.js +0 -0
  2462. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsCreateChildResponse.js +0 -0
  2463. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsCreateResponse.js +0 -0
  2464. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsHistoryResponse.js +0 -0
  2465. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsInfoResponse.js +0 -0
  2466. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsInviteResponse.js +0 -0
  2467. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsKickResponse.js +0 -0
  2468. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsLeaveResponse.js +0 -0
  2469. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsListResponse.js +0 -0
  2470. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsMarkResponse.js +0 -0
  2471. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsOpenResponse.js +0 -0
  2472. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsRenameResponse.js +0 -0
  2473. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsRepliesResponse.js +0 -0
  2474. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsSetPurposeResponse.js +0 -0
  2475. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsSetTopicResponse.js +0 -0
  2476. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/GroupsUnarchiveResponse.js +0 -0
  2477. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImCloseResponse.js +0 -0
  2478. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImHistoryResponse.js +0 -0
  2479. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImListResponse.js +0 -0
  2480. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImMarkResponse.js +0 -0
  2481. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImOpenResponse.js +0 -0
  2482. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ImRepliesResponse.js +0 -0
  2483. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MigrationExchangeResponse.js +0 -0
  2484. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimCloseResponse.js +0 -0
  2485. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimHistoryResponse.js +0 -0
  2486. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimListResponse.js +0 -0
  2487. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimMarkResponse.js +0 -0
  2488. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimOpenResponse.js +0 -0
  2489. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/MpimRepliesResponse.js +0 -0
  2490. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OauthAccessResponse.js +0 -0
  2491. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OauthTokenResponse.js +0 -0
  2492. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OauthV2AccessResponse.js +0 -0
  2493. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OauthV2ExchangeResponse.js +0 -0
  2494. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OpenIDConnectTokenResponse.js +0 -0
  2495. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/OpenIDConnectUserInfoResponse.js +0 -0
  2496. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/PinsAddResponse.js +0 -0
  2497. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/PinsRemoveResponse.js +0 -0
  2498. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ReactionsAddResponse.js +0 -0
  2499. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ReactionsGetResponse.js +0 -0
  2500. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ReactionsListResponse.js +0 -0
  2501. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ReactionsRemoveResponse.js +0 -0
  2502. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RemindersAddResponse.js +0 -0
  2503. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RemindersCompleteResponse.js +0 -0
  2504. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RemindersDeleteResponse.js +0 -0
  2505. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RemindersInfoResponse.js +0 -0
  2506. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RemindersListResponse.js +0 -0
  2507. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RtmConnectResponse.js +0 -0
  2508. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/RtmStartResponse.js +0 -0
  2509. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/SearchMessagesResponse.js +0 -0
  2510. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/StarsAddResponse.js +0 -0
  2511. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/StarsListResponse.js +0 -0
  2512. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/StarsRemoveResponse.js +0 -0
  2513. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamAccessLogsResponse.js +0 -0
  2514. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamBillableInfoResponse.js +0 -0
  2515. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamBillingInfoResponse.js +0 -0
  2516. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamExternalTeamsDisconnectResponse.js +0 -0
  2517. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamExternalTeamsListResponse.js +0 -0
  2518. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamInfoResponse.js +0 -0
  2519. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamIntegrationLogsResponse.js +0 -0
  2520. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamPreferencesListResponse.js +0 -0
  2521. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/TeamProfileGetResponse.js +0 -0
  2522. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ToolingTokensRotateResponse.js +0 -0
  2523. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsCreateResponse.js +0 -0
  2524. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsDisableResponse.js +0 -0
  2525. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsEnableResponse.js +0 -0
  2526. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsListResponse.js +0 -0
  2527. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsUpdateResponse.js +0 -0
  2528. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsUsersListResponse.js +0 -0
  2529. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsergroupsUsersUpdateResponse.js +0 -0
  2530. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersConversationsResponse.js +0 -0
  2531. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersDeletePhotoResponse.js +0 -0
  2532. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersDiscoverableContactsLookupResponse.js +0 -0
  2533. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersGetPresenceResponse.js +0 -0
  2534. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersIdentityResponse.js +0 -0
  2535. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersInfoResponse.js +0 -0
  2536. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersListResponse.js +0 -0
  2537. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersLookupByEmailResponse.js +0 -0
  2538. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersProfileGetResponse.js +0 -0
  2539. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersProfileSetResponse.js +0 -0
  2540. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersSetActiveResponse.js +0 -0
  2541. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersSetPhotoResponse.js +0 -0
  2542. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/UsersSetPresenceResponse.js +0 -0
  2543. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ViewsOpenResponse.js +0 -0
  2544. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ViewsPublishResponse.js +0 -0
  2545. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ViewsPushResponse.js +0 -0
  2546. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/ViewsUpdateResponse.js +0 -0
  2547. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/WorkflowsStepCompletedResponse.js +0 -0
  2548. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/WorkflowsStepFailedResponse.js +0 -0
  2549. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/WorkflowsUpdateStepResponse.js +0 -0
  2550. /package/node_modules/{@maka/runtime/node_modules/@slack → @slack}/web-api/dist/types/response/index.js +0 -0
  2551. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/License +0 -0
  2552. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/README.md +0 -0
  2553. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/example/dns.js +0 -0
  2554. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/example/stop.js +0 -0
  2555. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/index.js +0 -0
  2556. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/lib/retry.js +0 -0
  2557. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/lib/retry_operation.js +0 -0
  2558. /package/node_modules/{@maka/runtime → @slack/web-api}/node_modules/retry/package.json +0 -0
@@ -0,0 +1,2616 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ import { DEFAULT_TOOL_MODE, isToolMode } from '@maka/core/tool-mode';
20
+ import { resolveEffectiveOrchestration, } from '@maka/core/orchestration';
21
+ import { stripUndefinedDeep } from '@maka/core/tool-args-identity';
22
+ import { YIELD_AGENT_GRAPH_TOOL_NAME, } from './stream-graph-supervisor-tools.js';
23
+ import { providerRetryReason } from './provider-retry-policy.js';
24
+ import Ajv from 'ajv';
25
+ import Ajv2019 from 'ajv/dist/2019.js';
26
+ import Ajv2020 from 'ajv/dist/2020.js';
27
+ import { z } from 'zod';
28
+ import { AsyncEventQueue } from './async-queue.js';
29
+ import { DEFAULT_CODE_MODE_EXECUTION_POLICY, executeCodeCell, } from './code-mode.js';
30
+ import { StreamWatchdog, formatStreamWatchdogError, } from './stream-watchdog.js';
31
+ import { isRuntimeCommitBoundaryError, } from './tool-runtime.js';
32
+ import { persistedOpenAiResponsesStepMessages } from './openai-responses-continuation.js';
33
+ import { composeRequestProjection, } from './request-projection.js';
34
+ import { decodePlaintextResponsesReasoningState, responsesReasoningItemId, } from './responses-reasoning-state.js';
35
+ import { finitePositive } from './context-budget-helpers.js';
36
+ import { contextDiagnosticsCompactionOf, } from './context-diagnostics.js';
37
+ import { hasBlockingReplayDiagnostics } from './ai-sdk-compaction.js';
38
+ import { portableApplyPatchTool } from './apply-patch-profile.js';
39
+ import { RunTrace } from './run-trace.js';
40
+ import { REQUEST_SANDBOX_BOUNDARY_TOOL_NAME, SANDBOX_BOUNDARY_DENIED_FOR_TURN, SANDBOX_BOUNDARY_FINALIZATION_PROMPT, } from './sandbox-boundary-tool.js';
41
+ import { buildRuntimeEventModelReplayPlan, appendPriorUnknownToolResponses, buildSteeringEnvelope, collectToolActivityTurnIds, compatibleProviderReasoningReplayEventIds, formatTextWithInlineRefs, inspectPriorUnknownToolOutcomes, steeringMessagesMissingFromBase, steeringModelMessage, } from './model-history.js';
42
+ import { toolSchemaCharsForDiagnostics, requestCompositionToolSchemas, stableHash, toolCatalogHash, } from './request-shape.js';
43
+ import { toolAvailabilityHash } from './tool-availability.js';
44
+ import { hasFinalizedReasoning } from './ai-sdk-message-projection.js';
45
+ import { renderSwarmModePrompt } from './swarm-mode.js';
46
+ import { renderGraphModePrompt } from './graph-mode.js';
47
+ import { modelUsesNativeOpenAiResponses } from './model-runtime.js';
48
+ import { applyRuntimeEventContextBudget, buildContextBudgetDiagnosticShell, mergeContextBudgetDiagnostic, addToolResultPruneStats, minimalContextBudgetDiagnostic, shouldAppendContextCompactedNote, shouldAppendContextCompactionFailedOpenNote, } from './context-budget.js';
49
+ import { isHistoryCompactContentEvent } from './history-compaction.js';
50
+ import { canContinueHistoryCompactCheckpointForModel, historyCompactSourceDigest, isProviderHistoryCompactCheckpoint, matchHistoryCompactCheckpointPrefix, projectHistoryCompactCheckpointReplay, } from './history-compact-checkpoint.js';
51
+ import { resolveSelectedModelContextWindow } from './context-budget-policy.js';
52
+ import { INVALID_TOOL_NAME, isProviderSandboxBoundaryAttempt, repairMakaToolCall, } from './ai-sdk-tool-repair.js';
53
+ const CHILD_STEP_BUDGET_FINALIZATION_PROMPT = [
54
+ '<step_budget_finalization>',
55
+ 'This is the final budgeted step for this child-agent turn.',
56
+ 'Do not call tools. Return the best concise final answer now using evidence already gathered.',
57
+ 'Clearly separate verified findings from inference and explicitly name any remaining gaps.',
58
+ '</step_budget_finalization>',
59
+ ].join('\n');
60
+ function providerToolResultContent(toolName, output, input) {
61
+ if (output === undefined) {
62
+ return {
63
+ kind: 'text',
64
+ text: `${toolName} completed without a structured result.`,
65
+ };
66
+ }
67
+ if (toolName !== 'WebSearch') {
68
+ return { kind: 'json', value: output };
69
+ }
70
+ const queryFromInput = providerWebSearchQuery(input);
71
+ if (Array.isArray(output)) {
72
+ const rows = [];
73
+ for (const result of output) {
74
+ if (!result ||
75
+ typeof result !== 'object' ||
76
+ result.type !== 'web_search_result' ||
77
+ typeof result.url !== 'string') {
78
+ continue;
79
+ }
80
+ const item = result;
81
+ try {
82
+ const parsed = new URL(item.url);
83
+ if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
84
+ continue;
85
+ rows.push({
86
+ title: typeof item.title === 'string' && item.title.trim() ? item.title : parsed.hostname,
87
+ url: parsed.toString(),
88
+ snippet: typeof item.pageAge === 'string' ? item.pageAge : '',
89
+ source: parsed.hostname,
90
+ });
91
+ }
92
+ catch {
93
+ // Provider source rows are untrusted; malformed URLs are dropped.
94
+ }
95
+ }
96
+ return {
97
+ kind: 'web_search',
98
+ provider: 'model',
99
+ query: queryFromInput,
100
+ rows,
101
+ };
102
+ }
103
+ if (!output || typeof output !== 'object')
104
+ return { kind: 'json', value: output };
105
+ const providerError = output;
106
+ if (providerError.type === 'web_search_tool_result_error' ||
107
+ typeof providerError.errorCode === 'string') {
108
+ return {
109
+ kind: 'web_search_error',
110
+ ok: false,
111
+ provider: 'model',
112
+ ...(queryFromInput ? { query: queryFromInput } : {}),
113
+ reason: 'provider_error',
114
+ message: typeof providerError.errorCode === 'string'
115
+ ? `Provider web search failed: ${providerError.errorCode}`
116
+ : 'Provider web search failed.',
117
+ };
118
+ }
119
+ const action = output.action;
120
+ const sources = output.sources;
121
+ let query = queryFromInput;
122
+ if (action && typeof action === 'object') {
123
+ const value = action;
124
+ if (Array.isArray(value.queries)) {
125
+ query = value.queries.filter((item) => typeof item === 'string').join(' | ');
126
+ }
127
+ else if (typeof value.query === 'string') {
128
+ query = value.query;
129
+ }
130
+ }
131
+ const rows = [];
132
+ if (Array.isArray(sources)) {
133
+ for (const source of sources) {
134
+ if (!source ||
135
+ typeof source !== 'object' ||
136
+ source.type !== 'url' ||
137
+ typeof source.url !== 'string') {
138
+ continue;
139
+ }
140
+ const url = source.url;
141
+ try {
142
+ const parsed = new URL(url);
143
+ if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
144
+ continue;
145
+ rows.push({
146
+ title: parsed.hostname,
147
+ url: parsed.toString(),
148
+ snippet: '',
149
+ source: parsed.hostname,
150
+ });
151
+ }
152
+ catch {
153
+ // Provider source rows are untrusted; malformed URLs are dropped.
154
+ }
155
+ }
156
+ }
157
+ return { kind: 'web_search', provider: 'model', query, rows };
158
+ }
159
+ function providerWebSearchQuery(input) {
160
+ let value = input;
161
+ if (typeof input === 'string') {
162
+ try {
163
+ value = JSON.parse(input);
164
+ }
165
+ catch {
166
+ return '';
167
+ }
168
+ }
169
+ if (!value || typeof value !== 'object')
170
+ return '';
171
+ const query = value.query;
172
+ return typeof query === 'string' ? query : '';
173
+ }
174
+ function mergeTextProviderOptions(current, next, textOffset) {
175
+ const shifted = structuredClone(next);
176
+ const shiftedOpenAi = shifted.openai;
177
+ if (shiftedOpenAi && typeof shiftedOpenAi === 'object' && !Array.isArray(shiftedOpenAi)) {
178
+ const annotations = shiftedOpenAi.annotations;
179
+ if (Array.isArray(annotations) && textOffset > 0) {
180
+ shiftedOpenAi.annotations = annotations.map((annotation) => {
181
+ if (!annotation || typeof annotation !== 'object' || Array.isArray(annotation)) {
182
+ return annotation;
183
+ }
184
+ const value = { ...annotation };
185
+ if (typeof value.startIndex === 'number')
186
+ value.startIndex += textOffset;
187
+ if (typeof value.endIndex === 'number')
188
+ value.endIndex += textOffset;
189
+ if (typeof value.start_index === 'number')
190
+ value.start_index += textOffset;
191
+ if (typeof value.end_index === 'number')
192
+ value.end_index += textOffset;
193
+ return value;
194
+ });
195
+ }
196
+ }
197
+ if (!current)
198
+ return shifted;
199
+ const merged = { ...structuredClone(current), ...shifted };
200
+ const currentOpenAi = current.openai;
201
+ if (currentOpenAi &&
202
+ typeof currentOpenAi === 'object' &&
203
+ !Array.isArray(currentOpenAi) &&
204
+ shiftedOpenAi &&
205
+ typeof shiftedOpenAi === 'object' &&
206
+ !Array.isArray(shiftedOpenAi)) {
207
+ const left = currentOpenAi;
208
+ const right = shiftedOpenAi;
209
+ const openai = { ...left, ...right };
210
+ const leftAnnotations = Array.isArray(left.annotations) ? left.annotations : [];
211
+ const rightAnnotations = Array.isArray(right.annotations) ? right.annotations : [];
212
+ if (leftAnnotations.length > 0 || rightAnnotations.length > 0) {
213
+ openai.annotations = [...leftAnnotations, ...rightAnnotations];
214
+ }
215
+ if (typeof left.itemId === 'string' &&
216
+ typeof right.itemId === 'string' &&
217
+ left.itemId !== right.itemId) {
218
+ delete openai.itemId;
219
+ }
220
+ merged.openai = openai;
221
+ }
222
+ return merged;
223
+ }
224
+ function projectToolModePlan(plan, toolMode, execTool) {
225
+ if (toolMode === 'direct')
226
+ return plan;
227
+ return {
228
+ ...plan,
229
+ providerTools: [
230
+ execTool,
231
+ ...plan.providerTools.filter((tool) => tool.name === INVALID_TOOL_NAME),
232
+ ],
233
+ activeTools: [execTool.name],
234
+ ...(plan.projectActiveTools
235
+ ? { projectActiveTools: () => ({ activeTools: [execTool.name] }) }
236
+ : {}),
237
+ currentRepairToolNames: () => [execTool.name],
238
+ diagnostics: () => undefined,
239
+ };
240
+ }
241
+ function renderCodeModeCatalogPrompt(nested) {
242
+ // The aggregate catalog can exceed the evidence codec's bound for one tool
243
+ // description. Keep exec's schema fixed; requestSystemPrompt and its hash
244
+ // carry this step's exact, refreshable nested surface instead.
245
+ const catalog = requestCompositionToolSchemas([...nested.values()], [...nested.keys()]);
246
+ return [
247
+ 'Code Mode: exec is the only callable tool. Call the following tools from inside exec.',
248
+ 'After tool_search, return its result and use the refreshed catalog in the next exec call.',
249
+ JSON.stringify(catalog),
250
+ ].join('\n');
251
+ }
252
+ function nestableToolSnapshot(providerTools, activeToolNames) {
253
+ const active = new Set(activeToolNames);
254
+ return new Map(providerTools
255
+ .map((tool) => tool.providerTool?.kind === 'openai-apply-patch' ||
256
+ tool.providerTool?.kind === 'codex-apply-patch'
257
+ ? portableApplyPatchTool(tool)
258
+ : tool)
259
+ .filter((tool) => active.has(tool.name) &&
260
+ tool.name !== INVALID_TOOL_NAME &&
261
+ tool.name !== 'exec' &&
262
+ tool.providerTool === undefined &&
263
+ tool.nesting !== 'direct_only')
264
+ .map((tool) => [tool.name, tool]));
265
+ }
266
+ const codeModeJsonSchemaOptions = {
267
+ allErrors: true,
268
+ strict: false,
269
+ validateFormats: false,
270
+ };
271
+ const codeModeDraft7Validator = new Ajv(codeModeJsonSchemaOptions);
272
+ const codeModeDraft2019Validator = new Ajv2019(codeModeJsonSchemaOptions);
273
+ const codeModeDraft2020Validator = new Ajv2020(codeModeJsonSchemaOptions);
274
+ const codeModeCompiledSchemas = new WeakMap();
275
+ async function validateCodeModeToolInput(tool, input) {
276
+ const parameters = tool.parameters;
277
+ const parserResult = parameters.safeParseAsync
278
+ ? await parameters.safeParseAsync(input)
279
+ : parameters.safeParse?.(input);
280
+ if (parserResult) {
281
+ if (parserResult.success)
282
+ return parserResult.data;
283
+ throw invalidCodeModeToolArguments(tool.name, parserResult.error);
284
+ }
285
+ if (parameters.validate) {
286
+ const validationResult = await parameters.validate(input);
287
+ if (validationResult.success)
288
+ return validationResult.value;
289
+ throw invalidCodeModeToolArguments(tool.name, validationResult.error);
290
+ }
291
+ const schema = await parameters.jsonSchema;
292
+ const validator = compileCodeModeJsonSchema(schema ?? tool.parameters);
293
+ if (!validator || validator(input))
294
+ return input;
295
+ throw invalidCodeModeToolArguments(tool.name, validator.errors);
296
+ }
297
+ function compileCodeModeJsonSchema(schema) {
298
+ if (typeof schema === 'boolean')
299
+ return codeModeDraft2020Validator.compile(schema);
300
+ if (typeof schema !== 'object' || schema === null || Array.isArray(schema))
301
+ return undefined;
302
+ const cached = codeModeCompiledSchemas.get(schema);
303
+ if (cached)
304
+ return cached;
305
+ const declaredDialect = schema.$schema;
306
+ const dialect = typeof declaredDialect === 'string' ? declaredDialect : '';
307
+ const validator = dialect.includes('draft-07')
308
+ ? codeModeDraft7Validator
309
+ : dialect.includes('2019-09')
310
+ ? codeModeDraft2019Validator
311
+ : codeModeDraft2020Validator;
312
+ const schemaForCompile = dialect.startsWith('https://json-schema.org/draft-07/schema')
313
+ ? { ...schema, $schema: dialect.replace('https://', 'http://') }
314
+ : schema;
315
+ const compiled = validator.compile(schemaForCompile);
316
+ codeModeCompiledSchemas.set(schema, compiled);
317
+ return compiled;
318
+ }
319
+ function invalidCodeModeToolArguments(toolName, error) {
320
+ return new Error(`Invalid arguments for tool "${toolName}": ${schemaErrorSummary(error)}`);
321
+ }
322
+ function schemaErrorSummary(error) {
323
+ if (error && typeof error === 'object' && Array.isArray(error.issues)) {
324
+ const issues = error.issues;
325
+ return issues
326
+ .slice(0, 5)
327
+ .map((issue) => {
328
+ const path = Array.isArray(issue.path) ? issue.path.join('.') : '';
329
+ const message = typeof issue.message === 'string' ? issue.message : 'invalid value';
330
+ return path ? `${path}: ${message}` : message;
331
+ })
332
+ .join('; ')
333
+ .slice(0, 1000);
334
+ }
335
+ if (Array.isArray(error)) {
336
+ return error
337
+ .slice(0, 5)
338
+ .map((issue) => {
339
+ const path = issue.instancePath || issue.schemaPath;
340
+ return `${path || 'input'} ${issue.message ?? 'is invalid'}`;
341
+ })
342
+ .join('; ')
343
+ .slice(0, 1000);
344
+ }
345
+ return 'input does not match the declared schema';
346
+ }
347
+ function joinPromptFragments(fragments) {
348
+ const joined = fragments
349
+ .map((fragment) => fragment?.trim())
350
+ .filter((fragment) => Boolean(fragment))
351
+ .join('\n\n');
352
+ return joined.length > 0 ? joined : undefined;
353
+ }
354
+ const MAX_WAITING_CODE_MODE_CELLS = 1;
355
+ const MAX_PROVIDER_ATTEMPTS_PER_STEP = 10;
356
+ const CONTEXT_RECOVERY_MAX_OUTPUT_TOKENS = 8_000;
357
+ const PROVIDER_RETRY_BASE_DELAY_MS = 1_000;
358
+ const PROVIDER_RETRY_MAX_DELAY_MS = 32_000;
359
+ const PROVIDER_RETRY_JITTER_FACTOR = 0.25;
360
+ function providerRetryDelayMs(failedAttempt, retryAfterMs) {
361
+ if (retryAfterMs !== undefined)
362
+ return retryAfterMs;
363
+ const base = Math.min(PROVIDER_RETRY_BASE_DELAY_MS * 2 ** Math.max(0, failedAttempt - 1), PROVIDER_RETRY_MAX_DELAY_MS);
364
+ return Math.ceil(base + Math.random() * PROVIDER_RETRY_JITTER_FACTOR * base);
365
+ }
366
+ /**
367
+ * The mutable state of ONE `send()`.
368
+ *
369
+ * Identity is readonly and captured at dispatch: a tool that executes minutes
370
+ * later commits against the run that actually issued it, never against whatever
371
+ * run happens to be current when it finishes. The remaining fields are the
372
+ * turn's own stream/abort bookkeeping, isolated so an overlapping turn on the
373
+ * same backend cannot observe or clear them.
374
+ *
375
+ * Each turn owns its ToolRuntime for the same reason: gating, the loop gate,
376
+ * the subagent and child-run limiters, durable attempts, and step admission are
377
+ * all per-turn facts.
378
+ */
379
+ export class AiSdkTurn {
380
+ deps;
381
+ request;
382
+ abortController = new AbortController();
383
+ activeTools = new Map();
384
+ aborted = false;
385
+ loopStopRequested = false;
386
+ loopStopReason;
387
+ handoffPaused = false;
388
+ watchdog = null;
389
+ runTrace = null;
390
+ imageBudget = { used: 0, decisions: new Map() };
391
+ injectedSteeringMessages = [];
392
+ memoryExtractRequested = false;
393
+ memorySourceMessages;
394
+ memorySourceEventMessagePositions;
395
+ memorySourceSystemPrompt;
396
+ memorySourceTools;
397
+ memorySourceActiveTools;
398
+ finalAssistantText;
399
+ codeModeTools;
400
+ turnId;
401
+ runId;
402
+ orchestration;
403
+ toolRuntime;
404
+ startedAt;
405
+ constructor(deps, request) {
406
+ this.deps = deps;
407
+ this.request = request;
408
+ this.turnId = request.turnId;
409
+ this.runId = request.runId;
410
+ this.startedAt = deps.now();
411
+ this.orchestration =
412
+ request.orchestration ??
413
+ resolveEffectiveOrchestration(deps.backend.header.orchestrationMode, undefined);
414
+ this.toolRuntime = deps.createToolRuntime(this);
415
+ }
416
+ async *run() {
417
+ yield* this.runWithinScope(this.request);
418
+ }
419
+ /** Release resources after the backend removes this turn from its active index. */
420
+ async close() {
421
+ this.deps.modelAdapter.endContinuation(this.turnId);
422
+ await this.toolRuntime.endTurn(this.aborted ? 'aborted' : 'completed');
423
+ }
424
+ requestStop(reason, mode) {
425
+ if (mode === 'after_step') {
426
+ this.loopStopRequested = true;
427
+ this.runTrace?.abortRequested(reason);
428
+ return;
429
+ }
430
+ this.aborted = true;
431
+ this.abortController.abort();
432
+ this.runTrace?.abortRequested(reason);
433
+ }
434
+ async endAbortedTools() {
435
+ await this.toolRuntime.endTurn('aborted');
436
+ }
437
+ async respondToSandboxBoundary(decision) {
438
+ return await this.toolRuntime.respondToSandboxBoundaryResponse(decision);
439
+ }
440
+ respondToUserQuestion(response) {
441
+ return this.toolRuntime.respondToUserQuestion(response);
442
+ }
443
+ memorySourceSnapshot(boundary) {
444
+ if (!this.runId ||
445
+ !this.memorySourceMessages ||
446
+ !this.memorySourceTools ||
447
+ !this.memorySourceActiveTools) {
448
+ return undefined;
449
+ }
450
+ const sourceMessages = boundary.trigger === 'extract' && this.finalAssistantText
451
+ ? [
452
+ ...this.memorySourceMessages,
453
+ {
454
+ role: 'assistant',
455
+ content: [{ type: 'text', text: this.finalAssistantText }],
456
+ },
457
+ ]
458
+ : this.memorySourceMessages;
459
+ const memoryProjection = projectMemoryConversationPrefix(sourceMessages, this.memorySourceEventMessagePositions);
460
+ return {
461
+ ...boundary,
462
+ sourceHeader: memoryExtractionModelHeader(this.deps.backend.header),
463
+ ...(this.memorySourceSystemPrompt
464
+ ? { sourceSystemPrompt: this.memorySourceSystemPrompt }
465
+ : {}),
466
+ sourceMessages: structuredClone(memoryProjection.messages),
467
+ ...(memoryProjection.eventMessagePositions
468
+ ? {
469
+ sourceEventMessagePositions: structuredClone(memoryProjection.eventMessagePositions),
470
+ }
471
+ : {}),
472
+ sourceTools: { ...this.memorySourceTools },
473
+ sourceActiveTools: [...this.memorySourceActiveTools],
474
+ sourceProviderOptions: structuredClone(this.deps.resolvedProviderOptions),
475
+ ...(this.deps.modelAdapter.maxOutputTokens() !== undefined
476
+ ? { sourceMaxOutputTokens: this.deps.modelAdapter.maxOutputTokens() }
477
+ : {}),
478
+ ...(resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId) !== undefined
479
+ ? {
480
+ sourceContextWindowTokens: resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId),
481
+ }
482
+ : {}),
483
+ sessionId: this.deps.backend.sessionId,
484
+ runId: this.runId,
485
+ turnId: this.turnId,
486
+ workspaceKey: this.deps.backend.header.workspaceRoot,
487
+ };
488
+ }
489
+ dispatchAutomaticMemoryCompaction(dispatch) {
490
+ const capabilities = this.deps.backend.memoryExtraction;
491
+ const boundary = dispatch.checkpoint.memoryExtractionBoundary;
492
+ if (!capabilities ||
493
+ !this.runId ||
494
+ !boundary ||
495
+ modelUsesNativeOpenAiResponses(this.deps.backend.connection, this.deps.backend.modelId)) {
496
+ return;
497
+ }
498
+ try {
499
+ capabilities.extract({
500
+ trigger: 'compaction',
501
+ sourceHeader: memoryExtractionModelHeader(this.deps.backend.header),
502
+ // Compaction messages are rebuilt from the durable RuntimeEvent prefix
503
+ // inside the background lane, avoiding a full Memory projection here.
504
+ sourceMessages: [],
505
+ rebuildSourceContextFromCompactionCheckpoint: true,
506
+ sourceTools: {},
507
+ sourceActiveTools: [],
508
+ ...(this.deps.modelAdapter.maxOutputTokens() !== undefined
509
+ ? { sourceMaxOutputTokens: this.deps.modelAdapter.maxOutputTokens() }
510
+ : {}),
511
+ ...(resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId) !== undefined
512
+ ? {
513
+ sourceContextWindowTokens: resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId),
514
+ }
515
+ : {}),
516
+ sessionId: this.deps.backend.sessionId,
517
+ runId: this.runId,
518
+ turnId: this.turnId,
519
+ workspaceKey: this.deps.backend.header.workspaceRoot,
520
+ compactionCheckpointId: dispatch.checkpoint.checkpointId,
521
+ compactionBoundaryEventId: boundary.runtimeEventId,
522
+ });
523
+ }
524
+ catch {
525
+ // Automatic memory extraction is fail-open and must never perturb the caller.
526
+ }
527
+ }
528
+ automaticMemoryCompactionSupported() {
529
+ return (this.deps.backend.memoryExtraction !== undefined &&
530
+ !modelUsesNativeOpenAiResponses(this.deps.backend.connection, this.deps.backend.modelId));
531
+ }
532
+ automaticMemoryCompactionDecision() {
533
+ const capabilities = this.deps.backend.memoryExtraction;
534
+ if (!capabilities)
535
+ return { disposition: 'eligible', dispatch: false };
536
+ if (this.deps.backend.header.subagentParent || this.deps.backend.header.isArchived) {
537
+ return { disposition: 'policy_denied', dispatch: false };
538
+ }
539
+ const gate = capabilities.automaticGate?.() ?? {
540
+ allowed: false,
541
+ reason: 'unavailable',
542
+ };
543
+ if (gate.allowed)
544
+ return { disposition: 'eligible', dispatch: true };
545
+ return gate.reason === 'unavailable'
546
+ ? { disposition: 'eligible', dispatch: false }
547
+ : { disposition: 'policy_denied', dispatch: false };
548
+ }
549
+ createCodeModeExecTool(eventSink) {
550
+ return {
551
+ name: 'exec',
552
+ description: [
553
+ 'Execute a bounded orchestration cell over the active tools.',
554
+ 'Use tools.<name>(args), await dependent calls, and Promise.all for independent calls.',
555
+ 'The sandbox has no process, filesystem, network, timer, eval, import, or cross-cell state.',
556
+ 'Terminate by returning a JSON-serializable value. Failures return a structured diagnostic.',
557
+ ].join(' '),
558
+ parameters: z.object({ code: z.string() }),
559
+ executionSemantics: 'exclusive_step',
560
+ nesting: 'direct_only',
561
+ recoveryMode: 'never_auto_retry',
562
+ impl: (args, context) => this.executeCodeModeCell(eventSink, args.code, context),
563
+ };
564
+ }
565
+ /**
566
+ * A note about what happened inside this invocation, written to the
567
+ * invocation's own ledger. Fail-open: the note explains a turn, it is not
568
+ * what the turn did, so losing it must never end a send that is otherwise
569
+ * fine. Returns whether the note landed.
570
+ */
571
+ async recordSystemNote(kind, turnId, data) {
572
+ if (!this.deps.backend.recordSystemNote)
573
+ return false;
574
+ return await this.deps.backend
575
+ .recordSystemNote(kind, turnId, data)
576
+ .then(() => true)
577
+ .catch(() => false);
578
+ }
579
+ // --------------------------------------------------------------------------
580
+ // manual history compaction
581
+ // --------------------------------------------------------------------------
582
+ async *runWithinScope(input) {
583
+ const turnId = input.turnId;
584
+ const maxSteps = input.maxSteps === null ? undefined : (input.maxSteps ?? this.deps.maxSteps);
585
+ const toolRuntime = this.toolRuntime;
586
+ const turnAbortController = this.abortController;
587
+ const priorEvents = (input.runtimeContext ?? []).filter((event) => input.continuation !== undefined || event.turnId !== input.turnId);
588
+ const observedPriorUnknownProjection = !input.continuation
589
+ ? inspectPriorUnknownToolOutcomes(priorEvents, input.runtimeContextInvocations)
590
+ : { kind: 'none' };
591
+ if (observedPriorUnknownProjection.kind === 'blocked') {
592
+ throw new Error(`Cannot use prior tool history: ${observedPriorUnknownProjection.reason}`);
593
+ }
594
+ if (observedPriorUnknownProjection.kind === 'projected' &&
595
+ !input.allowPriorUnknownToolOutcomes) {
596
+ throw new Error('Cannot continue an automated turn while a prior tool outcome is unknown; an explicit user message is required');
597
+ }
598
+ const priorUnknownProjection = input.allowPriorUnknownToolOutcomes
599
+ ? observedPriorUnknownProjection
600
+ : { kind: 'none' };
601
+ const preservingUnknownHistory = priorUnknownProjection.kind === 'projected';
602
+ const midTurnState = preservingUnknownHistory
603
+ ? undefined
604
+ : this.deps.compaction.buildMidTurnCapacityCompactState(input);
605
+ const queue = new AsyncEventQueue();
606
+ const codeModeExecTool = this.createCodeModeExecTool(queue);
607
+ // One AssistantMessage is flushed per provider step (not per turn), so the
608
+ // ledger records the text↔tool timeline at step granularity and each step's
609
+ // Anthropic thinking signature stays paired with its own thinking text. The
610
+ // turn's first step reuses this id; every later step rotates to a fresh one
611
+ // at its step boundary (see the stream loop below).
612
+ let currentStepMessageId = this.deps.newId();
613
+ let stepText = '';
614
+ let stepTextProviderOptions;
615
+ let stepTextPartStartOffset = 0;
616
+ let stepThinkingParts = [];
617
+ let stepThinkingPartsById = new Map();
618
+ // Flush the current step's AssistantMessage (text + thinking) and the paired
619
+ // terminal thinking/text events, then clear the per-step accumulators.
620
+ // Persist when the step produced text OR reasoning — a thinking-only step
621
+ // (Anthropic's signed/omitted reasoning has empty text) still round-trips its
622
+ // signed block; a pure-tool step (no text, no thinking) writes nothing, so
623
+ // tool-only steps leave no placeholder assistant row. thinking_complete
624
+ // precedes text_complete so the read-model attaches this step's reasoning to
625
+ // this step's assistant row. Hoisted to turn scope so both the streaming
626
+ // path and the abort/error handler can flush a partial step.
627
+ const resetStep = () => {
628
+ stepText = '';
629
+ stepTextProviderOptions = undefined;
630
+ stepTextPartStartOffset = 0;
631
+ stepThinkingParts = [];
632
+ stepThinkingPartsById = new Map();
633
+ };
634
+ const flushStep = async (interrupted = false) => {
635
+ const hasThinking = stepThinkingParts.length > 0;
636
+ if (stepText.length === 0 && !hasThinking) {
637
+ resetStep();
638
+ return;
639
+ }
640
+ // A provider may finalize one reasoning item before the next item fails.
641
+ // Keep completed and interrupted parts in separate transcript rows so
642
+ // missing-ledger recovery preserves the same model visibility.
643
+ const fragments = [];
644
+ for (const part of stepThinkingParts) {
645
+ const partInterrupted = interrupted && !hasFinalizedReasoning(part);
646
+ let fragment = fragments.at(-1);
647
+ if (!fragment || fragment.interrupted !== partInterrupted) {
648
+ fragment = { thinking: [], text: '', interrupted: partInterrupted };
649
+ fragments.push(fragment);
650
+ }
651
+ fragment.thinking.push(part);
652
+ }
653
+ if (stepText.length > 0) {
654
+ let fragment = fragments.at(-1);
655
+ if (!fragment || fragment.interrupted !== interrupted) {
656
+ fragment = { thinking: [], text: '', interrupted };
657
+ fragments.push(fragment);
658
+ }
659
+ fragment.text = stepText;
660
+ }
661
+ for (const [index, fragment] of fragments.entries()) {
662
+ const stepId = index === 0 ? currentStepMessageId : this.deps.newId();
663
+ for (const part of fragment.thinking) {
664
+ queue.push({
665
+ type: 'thinking_complete',
666
+ id: this.deps.newId(),
667
+ turnId,
668
+ ts: this.deps.now(),
669
+ messageId: stepId,
670
+ text: part.text,
671
+ ...(fragment.interrupted ? { interrupted: true } : {}),
672
+ ...(part.signature !== undefined ? { signature: part.signature } : {}),
673
+ // No sanitiser here, unlike the tool call below: these options are
674
+ // not the provider's object. `translateChunk` rebuilds reasoning
675
+ // metadata from two named string fields, so an omitted provider
676
+ // field cannot arrive as an explicit `undefined` and break the
677
+ // canonical encoding. Passing the provider's object through
678
+ // instead would need the same `stripUndefinedDeep` a tool call has.
679
+ ...(part.providerOptions !== undefined
680
+ ? { providerOptions: part.providerOptions }
681
+ : {}),
682
+ });
683
+ }
684
+ queue.push({
685
+ type: 'text_complete',
686
+ id: this.deps.newId(),
687
+ turnId,
688
+ ts: this.deps.now(),
689
+ messageId: stepId,
690
+ text: fragment.text,
691
+ ...(fragment.interrupted ? { interrupted: true } : {}),
692
+ ...(index === fragments.length - 1 && stepTextProviderOptions !== undefined
693
+ ? { providerOptions: stepTextProviderOptions }
694
+ : {}),
695
+ });
696
+ }
697
+ this.finalAssistantText = stepText.length > 0 ? stepText : undefined;
698
+ resetStep();
699
+ };
700
+ let tokenUsage;
701
+ let tokenUsageCostUsd;
702
+ // Per-send sum of every completed step's usage, merged at settlement
703
+ // boundary. When the send aborts (mid-turn exhaust, user stop, stream
704
+ // error) the SDK's cumulative `usage` promise may not resolve, but this sum is
705
+ // real provider-reported evidence for the steps that did finish — IF every
706
+ // completed step produced a usable sample. One unusable sample makes the
707
+ // sum a partial cost, and LlmCallRecord has no partial marker, so the flag
708
+ // fails the whole fallback closed (#972: incomplete usage is no usage).
709
+ let completedStepUsage;
710
+ let sawUnusableStepUsage = false;
711
+ // Input tokens from the last completed step — the actual prompt token count
712
+ // of the final API request. Used to compute contextRemaining for the TUI
713
+ // statusline ctx segment (#1067): contextRemaining = contextWindow - this.
714
+ // result.usage.inputTokens is cumulative across steps and would produce
715
+ // misleading >100% percentages, so the per-step value is captured here.
716
+ let lastStepInputTokens;
717
+ // Output tokens of the same step: with the input they are the baseline the
718
+ // next request is judged from (everything the model produced is re-sent).
719
+ let lastStepOutputTokens;
720
+ let streamStatus = 'success';
721
+ let streamErrorClass;
722
+ let runtimeSteps = 0;
723
+ let toolAvailabilityForTelemetry = undefined;
724
+ let contextBudgetForTelemetry;
725
+ let contextCompactedNoteWritten = false;
726
+ let contextCompactionFailedOpenNoteWritten = false;
727
+ let contextWindowOverrunNoteWritten = false;
728
+ let contextReportedWindowNoteWritten = false;
729
+ let contextOverflowAfterCompactionNoteWritten = false;
730
+ let contextWindowSuggestionNoteWritten = false;
731
+ // A compaction decision is known the moment its stage reports it — the
732
+ // pre-turn replay resolves its fold before the first request goes out —
733
+ // while the settlement path is skipped entirely by a stop or a stream
734
+ // error. Write both notes when the decision is known, once per send,
735
+ // whichever stage reports first (#4850).
736
+ const appendCompactionDecisionNotes = async (contextBudget) => {
737
+ if (!contextCompactionFailedOpenNoteWritten &&
738
+ shouldAppendContextCompactionFailedOpenNote(contextBudget)) {
739
+ // The most recent stage that refused the fold: a send can carry both a
740
+ // priorReplay and an activeStep refusal after a diagnostic merge, and
741
+ // array order would pin the stale one.
742
+ const failOpenReason = contextBudget?.compactionDecisions
743
+ ?.filter((decision) => decision.boundaryKind === 'historyCompact' && decision.decision === 'failedOpen')
744
+ .at(-1)?.failOpenReason;
745
+ // Mark written only after the append lands: a failed write must leave
746
+ // the flag down so the settlement fallback can still record the note.
747
+ contextCompactionFailedOpenNoteWritten = await this.recordSystemNote('context_compaction_failed_open', turnId, failOpenReason !== undefined ? { failOpenReason } : undefined);
748
+ }
749
+ if (!contextCompactedNoteWritten && shouldAppendContextCompactedNote(contextBudget)) {
750
+ contextCompactedNoteWritten = await this.recordSystemNote('context_compacted', turnId);
751
+ }
752
+ };
753
+ const trace = new RunTrace({
754
+ sessionId: this.deps.backend.sessionId,
755
+ turnId,
756
+ connectionSlug: this.deps.backend.connection.slug,
757
+ providerId: this.deps.backend.connection.providerType,
758
+ modelId: this.deps.backend.modelId,
759
+ newId: this.deps.newId,
760
+ now: this.deps.now,
761
+ record: this.deps.backend.recordRunTrace,
762
+ });
763
+ this.runTrace = trace;
764
+ trace.turnStarted({
765
+ orchestrationMode: this.orchestration.mode,
766
+ orchestrationSource: this.orchestration.source,
767
+ agentSwarmAuthorization: this.orchestration.agentSwarmAuthorization,
768
+ });
769
+ if (this.deps.backend.planTraceContext) {
770
+ trace.emit('plan', 'plan_context_resolved', 'Plan context resolved', {
771
+ ...this.deps.backend.planTraceContext,
772
+ });
773
+ if (this.deps.backend.planTraceContext.executionId) {
774
+ trace.emit('plan', 'plan_execution_started', 'Plan execution turn started', {
775
+ ...this.deps.backend.planTraceContext,
776
+ });
777
+ }
778
+ }
779
+ const providerRequestTracker = this.deps.providerTelemetry.createTracker({
780
+ turnId,
781
+ callKind: 'main',
782
+ modelId: this.deps.backend.modelId,
783
+ runId: this.runId,
784
+ });
785
+ const providerRequestTraceId = providerRequestTracker?.traceId;
786
+ // --- Resolve model (API key already attached at construct time) ---
787
+ let model;
788
+ try {
789
+ model = this.deps.modelAdapter.resolveModel();
790
+ trace.modelResolved();
791
+ }
792
+ catch (err) {
793
+ trace.modelResolveFailed(err);
794
+ queue.push(this.makeErrorEvent(turnId, err));
795
+ queue.push({
796
+ type: 'complete',
797
+ id: this.deps.newId(),
798
+ turnId,
799
+ ts: this.deps.now(),
800
+ stopReason: 'error',
801
+ });
802
+ queue.close();
803
+ yield* this.drain(queue);
804
+ return;
805
+ }
806
+ // --- Build the provider-visible schema set. Tool execution stays in Runtime. ---
807
+ // Each logical step freezes its own scoped catalog and search projection.
808
+ // Mutable activation belongs to this turn and follows contribution identity.
809
+ const requiredOrchestrationTools = this.orchestration.mode === 'swarm'
810
+ ? new Set([
811
+ 'agent_list',
812
+ 'update_agent_graph',
813
+ 'yield_agent_graph',
814
+ 'agent_swarm_status',
815
+ 'agent_output',
816
+ ])
817
+ : this.orchestration.mode === 'graph'
818
+ ? new Set([
819
+ 'agent_list',
820
+ 'view_agent_graph',
821
+ 'update_agent_graph',
822
+ 'yield_agent_graph',
823
+ 'agent_swarm_status',
824
+ 'agent_output',
825
+ ])
826
+ : new Set();
827
+ const requestedToolMode = input.toolMode ?? this.deps.backend.header.toolMode ?? DEFAULT_TOOL_MODE;
828
+ if (!isToolMode(requestedToolMode)) {
829
+ throw new Error(`Invalid tool mode: ${String(requestedToolMode)}`);
830
+ }
831
+ const toolMode = requestedToolMode;
832
+ const snapshotStepTools = () => {
833
+ const snapshot = this.deps.snapshotToolAvailability();
834
+ if (toolMode === 'code_mode' && snapshot.hostTools.some((tool) => tool.name === 'exec')) {
835
+ throw new Error('Tool name "exec" is reserved for Code Mode.');
836
+ }
837
+ const basePlan = snapshot.runtime.prepare(this.activeTools, requiredOrchestrationTools);
838
+ const nestedTools = nestableToolSnapshot(basePlan.providerTools, basePlan.activeTools);
839
+ const plan = projectToolModePlan(basePlan, toolMode, codeModeExecTool);
840
+ const modelTools = {};
841
+ for (const tool of plan.providerTools) {
842
+ modelTools[tool.name] = tool.providerTool
843
+ ? { kind: 'provider', providerTool: tool.providerTool }
844
+ : { kind: 'function', description: tool.description, inputSchema: tool.parameters };
845
+ }
846
+ toolRuntime.setGating(plan.gating);
847
+ return { plan, providerTools: plan.providerTools, modelTools, nestedTools };
848
+ };
849
+ let { plan, providerTools, modelTools, nestedTools } = snapshotStepTools();
850
+ // Tool names the repair path matches a mis-cased call against — follows the
851
+ // current step's snapshot so a tool activated mid-turn is repairable on the
852
+ // step it becomes active, not routed to `invalid`.
853
+ const boundaryAwareToolNames = (names) => {
854
+ if (toolRuntime.shouldFinalizeSandboxBoundary())
855
+ return [];
856
+ return toolRuntime.hasSandboxBoundaryDenial()
857
+ ? names.filter((name) => name !== REQUEST_SANDBOX_BOUNDARY_TOOL_NAME)
858
+ : [...names];
859
+ };
860
+ const currentRepairToolNames = () => boundaryAwareToolNames(plan.currentRepairToolNames());
861
+ let resolvedSystemPrompt = { sourceRevisions: [] };
862
+ let systemPrompt;
863
+ // --- Build messages from RuntimeEvent history and its compatibility projection. ---
864
+ const priorReplayResult = await this.buildPriorMessages(input, priorUnknownProjection);
865
+ if (this.aborted) {
866
+ queue.push({
867
+ type: 'abort',
868
+ id: this.deps.newId(),
869
+ turnId,
870
+ ts: this.deps.now(),
871
+ reason: 'user_stop',
872
+ });
873
+ queue.push({
874
+ type: 'complete',
875
+ id: this.deps.newId(),
876
+ turnId,
877
+ ts: this.deps.now(),
878
+ stopReason: 'user_stop',
879
+ });
880
+ queue.close();
881
+ yield* this.drain(queue);
882
+ return;
883
+ }
884
+ const priorReplay = priorReplayResult;
885
+ if (input.continuation && priorReplay.messages.length === 0) {
886
+ const replay = priorReplayFailureTrace(priorReplay);
887
+ const error = new ContinuationReplayEmptyError(replay.gate, replay.diagnosticCodes);
888
+ trace.modelStreamFailed(error.code, error, replay);
889
+ queue.push(this.makeErrorEvent(turnId, error));
890
+ queue.push({
891
+ type: 'complete',
892
+ id: this.deps.newId(),
893
+ turnId,
894
+ ts: this.deps.now(),
895
+ stopReason: 'error',
896
+ });
897
+ queue.close();
898
+ yield* this.drain(queue);
899
+ return;
900
+ }
901
+ // The pre-turn replay's fold decision is final here: surface it now so a
902
+ // stop or stream error later in the send cannot keep it from the
903
+ // transcript (#4850).
904
+ await appendCompactionDecisionNotes(priorReplay.contextBudget);
905
+ if (midTurnState) {
906
+ // Roll-forward seed: the latest durable checkpoint (loaded or written at
907
+ // turn start) so a mid-turn summary only re-reads the newly folded span.
908
+ const checkpoint = priorReplay.latestHistoryCompactCheckpoint;
909
+ midTurnState.seedCheckpoint =
910
+ checkpoint &&
911
+ canContinueHistoryCompactCheckpointForModel(checkpoint, this.deps.backend.connection, this.deps.backend.header.llmConnectionId, this.deps.backend.modelId)
912
+ ? checkpoint
913
+ : undefined;
914
+ }
915
+ /**
916
+ * The fold THIS request's prompt was built under (#2323).
917
+ *
918
+ * Called once per physical dispatch rather than once per send, because the
919
+ * boundary moves between dispatches of the same send: mid-turn capacity
920
+ * compaction advances it before a later step, and overflow recovery
921
+ * advances it before it resends the request the provider just rejected.
922
+ * Sealed from session state at settlement it would be whichever fold
923
+ * arrived last — not the one the sealed prompt was actually made of.
924
+ *
925
+ * Mid-turn state is the single rolling authority whenever the turn has one:
926
+ * it is seeded just above from the pre-turn checkpoint and is what both of
927
+ * those folds write to. A turn without that seam can only have been built
928
+ * under the pre-turn checkpoint.
929
+ */
930
+ const requestHistoryCompactBoundary = () => {
931
+ const checkpoint = midTurnState
932
+ ? midTurnState.previousCheckpoint
933
+ : priorReplay.latestHistoryCompactCheckpoint;
934
+ return checkpoint ? contextDiagnosticsCompactionOf(checkpoint) : undefined;
935
+ };
936
+ // --- Background pump: streamText → stream → normalize → queue ---
937
+ const pumpDone = (async () => {
938
+ const watchdogState = {
939
+ current: null,
940
+ };
941
+ let providerRequestAbortController = new AbortController();
942
+ const watchdogTimeoutState = { current: null };
943
+ const currentWatchdogTimeout = () => watchdogTimeoutState.current;
944
+ const consumeWatchdogTimeout = () => {
945
+ const timeout = watchdogTimeoutState.current;
946
+ watchdogTimeoutState.current = null;
947
+ return timeout;
948
+ };
949
+ let lastCompletedStepHadToolResult = false;
950
+ let terminalProviderErrorReason;
951
+ let terminalRetry;
952
+ try {
953
+ const startWatchdog = () => {
954
+ watchdogState.current?.stop();
955
+ const next = new StreamWatchdog({
956
+ now: this.deps.now,
957
+ connectTimeoutMs: this.deps.backend.streamConnectTimeoutMs,
958
+ idleTimeoutMs: this.deps.backend.streamIdleTimeoutMs,
959
+ ...this.deps.backend.streamWatchdogTimer,
960
+ onTimeout: (timeout) => {
961
+ const error = Object.assign(new Error(formatStreamWatchdogError(timeout)), {
962
+ code: 'MODEL_STREAM_TIMEOUT',
963
+ });
964
+ watchdogTimeoutState.current = { phase: timeout.phase, error };
965
+ providerRequestAbortController.abort(error);
966
+ },
967
+ });
968
+ watchdogState.current = next;
969
+ this.watchdog = next;
970
+ next.start();
971
+ };
972
+ const activeTools = plan.activeTools;
973
+ const currentUserContent = input.continuation
974
+ ? undefined
975
+ : await this.deps.messageProjection.buildCurrentUserContent(this.imageBudget, input.text, input.attachments, input.directoryReferences, input.quotes, input.headAnchorRuntimeEvent?.id);
976
+ const messages = currentUserContent === undefined
977
+ ? [...priorReplay.messages]
978
+ : [
979
+ ...priorReplay.messages,
980
+ {
981
+ role: 'user',
982
+ content: currentUserContent,
983
+ },
984
+ ];
985
+ const loadDurableTurnEvents = async () => {
986
+ const loadTurnRuntimeEvents = this.deps.backend.loadTurnRuntimeEvents;
987
+ if (!loadTurnRuntimeEvents) {
988
+ throw new Error('durable current-run reader is required for tool continuation');
989
+ }
990
+ await queue.waitUntilConsumedThroughCurrent();
991
+ return (await loadTurnRuntimeEvents(turnId)).filter((event) => event.turnId === turnId);
992
+ };
993
+ const loadDurableTurnProjection = async () => {
994
+ const turnEvents = await loadDurableTurnEvents();
995
+ // Prior unknown call/result pairs are outside this current-turn event
996
+ // set and are preserved separately in priorReplay. Continue pruning
997
+ // new tool results from this turn so one unknown predecessor does not
998
+ // make an unrelated large result permanently unprunable.
999
+ const pruned = await this.deps.compaction.pruneToolResults(turnEvents, turnId);
1000
+ if (pruned.stats) {
1001
+ contextBudgetForTelemetry = addToolResultPruneStats(contextBudgetForTelemetry ?? minimalContextBudgetDiagnostic(), pruned.stats);
1002
+ }
1003
+ const projectionCheckpoint = midTurnState?.projectionCheckpoint;
1004
+ const rawProjectionEvents = projectionCheckpoint
1005
+ ? [
1006
+ ...midTurnState.priorContentEvents,
1007
+ ...turnEvents.filter(isHistoryCompactContentEvent),
1008
+ ]
1009
+ : turnEvents;
1010
+ let replayEvents = rawProjectionEvents;
1011
+ let effectiveProjectionCheckpoint = projectionCheckpoint;
1012
+ if (projectionCheckpoint) {
1013
+ const checkpointMatch = matchHistoryCompactCheckpointPrefix(projectionCheckpoint, rawProjectionEvents);
1014
+ if (checkpointMatch.reason) {
1015
+ throw new Error(`durable checkpoint projection mismatch: ${checkpointMatch.reason}`);
1016
+ }
1017
+ // Content-currency guard: the raw identity still matches, but a
1018
+ // transition committed after this fold (e.g. an active-turn prune
1019
+ // in this very send) changed the effective view the block was
1020
+ // built from. Replay without the stale block — the provider
1021
+ // decides fit and overflow recovery re-folds (#4845 review).
1022
+ const pinnedEffectiveDigest = projectionCheckpoint.coverage.effectiveSourceDigest;
1023
+ const coveredEffective = await this.deps.compaction.foldEffectiveModelHistory(checkpointMatch.coveredRuntimeEvents, pruned.projectionSnapshot);
1024
+ if (pinnedEffectiveDigest === undefined ||
1025
+ historyCompactSourceDigest(coveredEffective) !== pinnedEffectiveDigest) {
1026
+ effectiveProjectionCheckpoint = undefined;
1027
+ }
1028
+ else {
1029
+ replayEvents = projectHistoryCompactCheckpointReplay(projectionCheckpoint, checkpointMatch.coveredRuntimeEvents, checkpointMatch.successorRuntimeEvents);
1030
+ }
1031
+ // The checkpoint was capacity-validated before it was persisted.
1032
+ // Do not re-run that gate against a later, larger successor tail:
1033
+ // the active-step shaper must see that growth so it can roll the
1034
+ // checkpoint forward instead of resurrecting raw history.
1035
+ }
1036
+ // The current Turn is model-visible history like any other, so it is
1037
+ // folded through the same reducer before it becomes messages. Without
1038
+ // this, a result archived at step N is rebuilt in full at step N+1 and
1039
+ // the ledger's account of what the model sees stops being true.
1040
+ const foldedReplayEvents = projectionCheckpoint
1041
+ ? await this.deps.compaction.foldEffectiveModelHistory(replayEvents, pruned.projectionSnapshot)
1042
+ : pruned.events;
1043
+ const replayPlan = buildRuntimeEventModelReplayPlan(foldedReplayEvents, {
1044
+ toolActivityTurnIds: collectToolActivityTurnIds([
1045
+ ...(input.runtimeContext ?? []),
1046
+ ...turnEvents,
1047
+ ]),
1048
+ });
1049
+ if (hasBlockingReplayDiagnostics(replayPlan) ||
1050
+ (replayPlan.hasProviderNativeSemantics &&
1051
+ !this.deps.messageProjection.canReplayProviderNative(replayPlan))) {
1052
+ throw new Error('durable current-run projection is not replayable');
1053
+ }
1054
+ const currentTurnMessages = await this.deps.messageProjection.materializeRuntimeReplayPlan(replayPlan, this.imageBudget, effectiveProjectionCheckpoint, compatibleProviderReasoningReplayEventIds(replayEvents, input.runtimeContextInvocations, this.deps.backend.providerStateIdentity, this.deps.backend.modelId, this.runId));
1055
+ return effectiveProjectionCheckpoint
1056
+ ? currentTurnMessages
1057
+ : [...priorReplay.messages, ...currentTurnMessages];
1058
+ };
1059
+ // Tool Availability describes the provider-visible (active) subset. A
1060
+ // group loaded this turn expands that subset on later requests, so the
1061
+ // terminal trace is refined against the final active set below.
1062
+ contextBudgetForTelemetry = priorReplay.contextBudget;
1063
+ const computeToolAvailability = (active) => {
1064
+ const toolSchemaChars = toolSchemaCharsForDiagnostics(providerTools, active);
1065
+ return plan.diagnostics(active, toolSchemaChars);
1066
+ };
1067
+ toolAvailabilityForTelemetry = computeToolAvailability(activeTools);
1068
+ trace.modelStreamStarted(activeTools, {
1069
+ ...(toolAvailabilityForTelemetry !== undefined
1070
+ ? { toolAvailability: toolAvailabilityForTelemetry }
1071
+ : {}),
1072
+ ...(priorReplay.contextBudget ? { contextBudget: priorReplay.contextBudget } : {}),
1073
+ });
1074
+ const onMidTurnDiagnosticPatch = (patch) => {
1075
+ contextBudgetForTelemetry = mergeContextBudgetDiagnostic(contextBudgetForTelemetry ?? minimalContextBudgetDiagnostic(), patch);
1076
+ };
1077
+ const capacityProviderTools = [...providerTools];
1078
+ const midTurnCapacityHook = this.deps.compaction.buildMidTurnCapacityCompactProjection(turnId, midTurnState, queue, capacityProviderTools, onMidTurnDiagnosticPatch, this, this.automaticMemoryCompactionSupported()
1079
+ ? () => this.automaticMemoryCompactionDecision()
1080
+ : undefined, this.automaticMemoryCompactionSupported()
1081
+ ? (dispatch) => this.dispatchAutomaticMemoryCompaction(dispatch)
1082
+ : undefined, turnAbortController.signal);
1083
+ const projectCurrentToolAvailability = (options) => plan.projectActiveTools?.(options);
1084
+ const shapedProjection = composeRequestProjection(projectCurrentToolAvailability, midTurnCapacityHook);
1085
+ // Hooks shape; nothing measures the final payload. Whether it fits is
1086
+ // the provider's answer (#4559).
1087
+ const requestProjection = shapedProjection;
1088
+ const completedProviderSteps = [];
1089
+ let requestMessages = messages;
1090
+ let result;
1091
+ let providerOutcome;
1092
+ let finishReason = 'stop';
1093
+ let terminalProviderError;
1094
+ agentLoop: for (;;) {
1095
+ ({ plan, providerTools, modelTools, nestedTools } = snapshotStepTools());
1096
+ resolvedSystemPrompt = await this.resolveSystemPrompt();
1097
+ systemPrompt = joinPromptFragments([
1098
+ resolvedSystemPrompt.text,
1099
+ this.orchestration.mode === 'swarm' ? renderSwarmModePrompt() : undefined,
1100
+ this.orchestration.mode === 'graph' ? renderGraphModePrompt() : undefined,
1101
+ ]);
1102
+ capacityProviderTools.splice(0, capacityProviderTools.length, ...providerTools);
1103
+ await this.drainSteeringInto(input, queue);
1104
+ if (this.deps.backend.loadTurnRuntimeEvents) {
1105
+ requestMessages = await loadDurableTurnProjection();
1106
+ }
1107
+ else {
1108
+ const missingSteering = steeringMessagesMissingFromBase(this.injectedSteeringMessages, requestMessages);
1109
+ if (missingSteering.length > 0)
1110
+ requestMessages = [...requestMessages, ...missingSteering];
1111
+ }
1112
+ // Resolved BEFORE request projection so the capacity measurement and
1113
+ // the request that goes out are the same request: a finalization step
1114
+ // adds prompt fragments and sends no tool schemas, and an anchor
1115
+ // paired with the un-finalized shape describes a different payload.
1116
+ const finalChildSummaryStep = this.deps.backend.header.collaborationMode === 'agent' &&
1117
+ maxSteps !== undefined &&
1118
+ maxSteps > 1 &&
1119
+ runtimeSteps === maxSteps - 1 &&
1120
+ completedProviderSteps.length > 0;
1121
+ const sandboxBoundaryFinalizationStep = toolRuntime.shouldFinalizeSandboxBoundary() ||
1122
+ (toolRuntime.hasSandboxBoundaryDenial() &&
1123
+ maxSteps !== undefined &&
1124
+ runtimeSteps === maxSteps - 1);
1125
+ if (sandboxBoundaryFinalizationStep) {
1126
+ toolRuntime.forceSandboxBoundaryFinalization();
1127
+ }
1128
+ const requestSystemPromptBase = joinPromptFragments([
1129
+ systemPrompt,
1130
+ priorUnknownProjection.kind === 'projected'
1131
+ ? priorUnknownProjection.systemNotice
1132
+ : undefined,
1133
+ finalChildSummaryStep ? CHILD_STEP_BUDGET_FINALIZATION_PROMPT : undefined,
1134
+ toolRuntime.hasSandboxBoundaryDenial() ? SANDBOX_BOUNDARY_DENIED_FOR_TURN : undefined,
1135
+ sandboxBoundaryFinalizationStep ? SANDBOX_BOUNDARY_FINALIZATION_PROMPT : undefined,
1136
+ ]);
1137
+ const codeModeCatalogPrompt = toolMode === 'code_mode'
1138
+ ? renderCodeModeCatalogPrompt(toolRuntime.hasSandboxBoundaryDenial()
1139
+ ? new Map([...nestedTools].filter(([name]) => name !== REQUEST_SANDBOX_BOUNDARY_TOOL_NAME))
1140
+ : nestedTools)
1141
+ : undefined;
1142
+ const resolveDispatch = (active) => {
1143
+ const activeTools = finalChildSummaryStep || sandboxBoundaryFinalizationStep
1144
+ ? []
1145
+ : boundaryAwareToolNames(active ?? plan.currentRepairToolNames());
1146
+ const effectiveSystemPrompt = joinPromptFragments([
1147
+ requestSystemPromptBase,
1148
+ activeTools.includes(codeModeExecTool.name) ? codeModeCatalogPrompt : undefined,
1149
+ ]);
1150
+ return {
1151
+ systemPromptChars: effectiveSystemPrompt?.length ?? 0,
1152
+ activeTools,
1153
+ };
1154
+ };
1155
+ const dynamicContextMessages = (resolvedSystemPrompt.contexts ?? []).map(({ text }) => ({ role: 'user', content: text }));
1156
+ const shaped = requestProjection
1157
+ ? await requestProjection({
1158
+ completedSteps: completedProviderSteps,
1159
+ stepNumber: runtimeSteps,
1160
+ model,
1161
+ messages: requestMessages,
1162
+ resolveDispatch,
1163
+ })
1164
+ : undefined;
1165
+ const projectedMessages = shaped?.messages ?? requestMessages;
1166
+ const activeToolsForRequest = resolveDispatch(shaped?.activeTools).activeTools;
1167
+ const requestSystemPrompt = joinPromptFragments([
1168
+ requestSystemPromptBase,
1169
+ activeToolsForRequest.includes(codeModeExecTool.name)
1170
+ ? codeModeCatalogPrompt
1171
+ : undefined,
1172
+ ]);
1173
+ const requestCompositionId = this.runId && this.deps.backend.recordRequestComposition
1174
+ ? await this.deps.backend.recordRequestComposition(this.runId, {
1175
+ compositionId: this.deps.newId(),
1176
+ step: runtimeSteps,
1177
+ sourceRevisions: resolvedSystemPrompt.sourceRevisions,
1178
+ systemPromptHash: stableHash(requestSystemPrompt ?? ''),
1179
+ toolCatalogHash: toolCatalogHash(providerTools),
1180
+ toolAvailabilityHash: toolAvailabilityHash(this.deps.backend.toolAvailability),
1181
+ providerOptionsHash: stableHash(this.deps.resolvedProviderOptions),
1182
+ toolNames: activeToolsForRequest,
1183
+ toolSchemas: requestCompositionToolSchemas(providerTools, activeToolsForRequest),
1184
+ })
1185
+ : undefined;
1186
+ providerRequestTracker?.setStep(runtimeSteps, requestCompositionId);
1187
+ let attemptMessages = projectedMessages;
1188
+ let overflowRecoveryMaxOutputTokens;
1189
+ let providerAttempt = 0;
1190
+ const returnedToolCalls = [];
1191
+ const providerToolInputs = new Map();
1192
+ let providerStepUsage;
1193
+ for (;;) {
1194
+ providerAttempt += 1;
1195
+ // Local calls are only admitted after a successful provider outcome.
1196
+ // A new physical request must not inherit the failed one's intents.
1197
+ returnedToolCalls.length = 0;
1198
+ providerRequestAbortController = new AbortController();
1199
+ watchdogTimeoutState.current = null;
1200
+ startWatchdog();
1201
+ // Monotonic facts for this physical request. The step accumulators
1202
+ // are cleared after flushStep(), so they cannot decide whether a
1203
+ // later stream failure is safe to retry.
1204
+ let attemptSawVisibleContent = false;
1205
+ let attemptSawToolActivity = false;
1206
+ let attemptSawToolInput = false;
1207
+ let attemptSawReplayBarrier = false;
1208
+ const attemptHasNoObservableOutput = () => !attemptSawVisibleContent && !attemptSawToolActivity && !attemptSawReplayBarrier;
1209
+ const attemptCanReplay = () => !attemptSawToolActivity && !attemptSawReplayBarrier;
1210
+ // Request-only facts must survive history replacement and overflow recovery.
1211
+ const dispatchMessages = [...attemptMessages, ...dynamicContextMessages];
1212
+ this.memorySourceMessages = dispatchMessages;
1213
+ this.memorySourceEventMessagePositions =
1214
+ this.deps.messageProjection.memoryEventMessagePositions(dispatchMessages);
1215
+ this.memorySourceSystemPrompt = requestSystemPrompt;
1216
+ this.memorySourceTools = modelTools;
1217
+ this.memorySourceActiveTools = [...activeToolsForRequest];
1218
+ this.finalAssistantText = undefined;
1219
+ // Keep a denied boundary request as a Code Mode trap: the provider
1220
+ // no longer sees it as a direct tool, but a nested retry must still
1221
+ // reach ToolRuntime's denial latch instead of becoming an endlessly
1222
+ // variable unknown-tool error inside `exec`.
1223
+ this.codeModeTools =
1224
+ toolMode === 'code_mode' && activeToolsForRequest.includes('exec')
1225
+ ? nestedTools
1226
+ : undefined;
1227
+ const requestWatchdog = watchdogState.current;
1228
+ const requestMaxOutputTokens = overflowRecoveryMaxOutputTokens ??
1229
+ this.deps.modelAdapter.maxOutputTokensForInput(midTurnState?.baselineTokens ?? midTurnState?.lastAcceptedTotalTokens);
1230
+ // Read here, beside the messages it describes: `attemptMessages` is
1231
+ // rebuilt in place by overflow recovery, and the boundary it folded
1232
+ // under must travel with that rebuild, not with the step.
1233
+ const historyCompactBoundary = requestHistoryCompactBoundary();
1234
+ result = await this.deps.modelAdapter.startStream({
1235
+ model,
1236
+ messages: dispatchMessages,
1237
+ tools: modelTools,
1238
+ activeTools: activeToolsForRequest,
1239
+ onStreamActivity: () => requestWatchdog?.markActivity(),
1240
+ repairToolCall: async ({ toolCall, error, }) => {
1241
+ return repairMakaToolCall({
1242
+ toolCall,
1243
+ availableToolNames: currentRepairToolNames(),
1244
+ toolParameters: (name) => providerTools.find((candidate) => candidate.name === name)?.parameters,
1245
+ toolCategoryHint: (name) => providerTools.find((candidate) => candidate.name === name)?.categoryHint,
1246
+ error,
1247
+ });
1248
+ },
1249
+ system: requestSystemPrompt,
1250
+ abortSignal: AbortSignal.any([
1251
+ turnAbortController.signal,
1252
+ providerRequestAbortController.signal,
1253
+ ]),
1254
+ ...(providerRequestTracker ? { providerRequestTracker } : {}),
1255
+ ...(historyCompactBoundary ? { historyCompactBoundary } : {}),
1256
+ continuationKey: this.turnId,
1257
+ ...(requestMaxOutputTokens !== undefined
1258
+ ? { maxOutputTokens: requestMaxOutputTokens }
1259
+ : {}),
1260
+ });
1261
+ for await (const event of result.events) {
1262
+ if (this.aborted)
1263
+ break;
1264
+ if (event.kind === 'error') {
1265
+ // Settlement owns the failure; stop before any synthesized
1266
+ // trailer and consume the one authoritative outcome below.
1267
+ break;
1268
+ }
1269
+ if (event.kind === 'text-start') {
1270
+ if (stepText.length > 0 && event.providerItemBoundary === true) {
1271
+ attemptSawReplayBarrier = true;
1272
+ await flushStep();
1273
+ currentStepMessageId = this.deps.newId();
1274
+ }
1275
+ stepTextPartStartOffset = stepText.length;
1276
+ }
1277
+ else if (event.kind === 'text') {
1278
+ stepText += event.text;
1279
+ if (event.text.length > 0)
1280
+ attemptSawVisibleContent = true;
1281
+ queue.push({
1282
+ type: 'text_delta',
1283
+ id: this.deps.newId(),
1284
+ turnId,
1285
+ ts: this.deps.now(),
1286
+ messageId: currentStepMessageId,
1287
+ text: event.text,
1288
+ });
1289
+ }
1290
+ else if (event.kind === 'text-end') {
1291
+ if (event.providerOptions !== undefined) {
1292
+ attemptSawReplayBarrier = true;
1293
+ stepTextProviderOptions = mergeTextProviderOptions(stepTextProviderOptions, stripUndefinedDeep(event.providerOptions), stepTextPartStartOffset);
1294
+ }
1295
+ if (event.providerItemBoundary === true) {
1296
+ await flushStep();
1297
+ currentStepMessageId = this.deps.newId();
1298
+ }
1299
+ }
1300
+ else if (event.kind === 'thinking-start') {
1301
+ if (event.providerOptions !== undefined) {
1302
+ attemptSawReplayBarrier = true;
1303
+ }
1304
+ const part = {
1305
+ text: '',
1306
+ ...(event.providerOptions !== undefined
1307
+ ? { providerOptions: event.providerOptions }
1308
+ : {}),
1309
+ };
1310
+ stepThinkingParts.push(part);
1311
+ if (event.reasoningPartId) {
1312
+ stepThinkingPartsById.set(event.reasoningPartId, part);
1313
+ }
1314
+ }
1315
+ else if (event.kind === 'thinking') {
1316
+ if (event.text.length > 0)
1317
+ attemptSawVisibleContent = true;
1318
+ if (event.providerOptions !== undefined) {
1319
+ if (event.providerOptionsOrigin !== 'maka_transport') {
1320
+ attemptSawReplayBarrier = true;
1321
+ }
1322
+ }
1323
+ const partId = event.reasoningPartId ?? responsesReasoningItemId(event.providerOptions);
1324
+ let part;
1325
+ if (typeof partId === 'string' && partId.length > 0) {
1326
+ part = stepThinkingPartsById.get(partId);
1327
+ if (part &&
1328
+ event.providerOptions === undefined &&
1329
+ decodePlaintextResponsesReasoningState(part.providerOptions).kind === 'valid') {
1330
+ // The SDK does not suppress a stray delta after
1331
+ // output_item.done. Keep it out of the finalized item or
1332
+ // its durable summary boundaries will no longer match.
1333
+ part = { text: '' };
1334
+ stepThinkingParts.push(part);
1335
+ stepThinkingPartsById.set(partId, part);
1336
+ }
1337
+ if (!part) {
1338
+ part = { text: '' };
1339
+ stepThinkingParts.push(part);
1340
+ stepThinkingPartsById.set(partId, part);
1341
+ }
1342
+ }
1343
+ else {
1344
+ part = stepThinkingParts.at(-1);
1345
+ if (part &&
1346
+ decodePlaintextResponsesReasoningState(part.providerOptions).kind === 'valid') {
1347
+ // An invalid next item has no usable stream id. Do not
1348
+ // append its deltas to the finalized item: partial-error
1349
+ // flush must keep that item's durable boundaries valid.
1350
+ part = undefined;
1351
+ }
1352
+ }
1353
+ if (!part) {
1354
+ part = { text: '' };
1355
+ stepThinkingParts.push(part);
1356
+ }
1357
+ // The provider's final summary is the authoritative text the
1358
+ // durable part boundaries describe; adopt it when the
1359
+ // streamed deltas diverge so replay stays self-consistent.
1360
+ part.text = event.reasoningSummaryText ?? part.text + event.text;
1361
+ if (event.providerOptions !== undefined) {
1362
+ part.providerOptions = event.providerOptions;
1363
+ }
1364
+ queue.push({
1365
+ type: 'thinking_delta',
1366
+ id: this.deps.newId(),
1367
+ turnId,
1368
+ ts: this.deps.now(),
1369
+ messageId: currentStepMessageId,
1370
+ text: event.text,
1371
+ });
1372
+ }
1373
+ else if (event.kind === 'thinking-signature') {
1374
+ attemptSawReplayBarrier = true;
1375
+ let part = event.reasoningPartId
1376
+ ? stepThinkingPartsById.get(event.reasoningPartId)
1377
+ : stepThinkingParts.at(-1);
1378
+ if (!part) {
1379
+ part = { text: '' };
1380
+ stepThinkingParts.push(part);
1381
+ if (event.reasoningPartId) {
1382
+ stepThinkingPartsById.set(event.reasoningPartId, part);
1383
+ }
1384
+ }
1385
+ part.signature = event.signature;
1386
+ }
1387
+ else if (event.kind === 'tool-input') {
1388
+ attemptSawToolInput = true;
1389
+ // The provider has started its own tool. Even without a
1390
+ // final tool-call/result event, retrying can repeat external
1391
+ // work that the Runtime cannot observe or reconcile.
1392
+ if (event.providerExecuted)
1393
+ attemptSawToolActivity = true;
1394
+ }
1395
+ else if (event.kind === 'tool-call') {
1396
+ if (event.toolCall.providerExecuted) {
1397
+ attemptSawToolActivity = true;
1398
+ providerToolInputs.set(event.toolCall.toolCallId, event.toolCall.input);
1399
+ queue.push({
1400
+ type: 'tool_start',
1401
+ id: this.deps.newId(),
1402
+ turnId,
1403
+ ts: this.deps.now(),
1404
+ toolUseId: event.toolCall.toolCallId,
1405
+ toolName: event.toolCall.toolName,
1406
+ args: event.toolCall.input,
1407
+ providerExecuted: true,
1408
+ activityKind: 'websearch',
1409
+ displayName: 'Web search',
1410
+ stepId: currentStepMessageId,
1411
+ ...(event.toolCall.providerOptions !== undefined
1412
+ ? {
1413
+ providerOptions: stripUndefinedDeep(event.toolCall.providerOptions),
1414
+ }
1415
+ : {}),
1416
+ });
1417
+ }
1418
+ else {
1419
+ returnedToolCalls.push(event.toolCall);
1420
+ }
1421
+ }
1422
+ else if (event.kind === 'provider-tool-result') {
1423
+ attemptSawToolActivity = true;
1424
+ const providerOutput = stripUndefinedDeep(event.output);
1425
+ queue.push({
1426
+ type: 'tool_result',
1427
+ id: this.deps.newId(),
1428
+ turnId,
1429
+ ts: this.deps.now(),
1430
+ toolUseId: event.toolCallId,
1431
+ providerExecuted: true,
1432
+ ...(providerOutput !== undefined ? { providerOutput } : {}),
1433
+ isError: event.isError === true,
1434
+ content: providerToolResultContent(event.toolName, providerOutput, providerToolInputs.get(event.toolCallId)),
1435
+ });
1436
+ providerToolInputs.delete(event.toolCallId);
1437
+ }
1438
+ }
1439
+ watchdogState.current?.stop();
1440
+ // This timeout belongs to the physical request that just settled.
1441
+ // Consume it before recovery/flush work: a later persistence error
1442
+ // must not be reported as the already-handled watchdog timeout.
1443
+ consumeWatchdogTimeout();
1444
+ providerOutcome = await result.outcome;
1445
+ if (providerOutcome.kind === 'completed') {
1446
+ // A compacted overflow retry only needs the conservative cap for
1447
+ // that one request. Once the provider accepts the request, the
1448
+ // next step can use the fresh provider count to derive a larger
1449
+ // safe cap again.
1450
+ overflowRecoveryMaxOutputTokens = undefined;
1451
+ runtimeSteps += 1;
1452
+ const stepUsage = providerOutcome.usage;
1453
+ providerStepUsage = stepUsage;
1454
+ if (!stepUsage)
1455
+ sawUnusableStepUsage = true;
1456
+ midTurnState?.stepShaping.clear();
1457
+ // Fail closed: reset on every step boundary so a missing final
1458
+ // step's usage does not leave a stale value from an earlier step.
1459
+ // The reply needed more room than the declared window had
1460
+ // left after this request's own input. Both halves are the
1461
+ // provider's numbers, read after the fact: the reserve that
1462
+ // should have kept them apart was measured from a smaller
1463
+ // previous reply. Say so once per send; the next request
1464
+ // folds anyway because the baseline now exceeds the window.
1465
+ if (!contextWindowOverrunNoteWritten &&
1466
+ midTurnState?.capacity !== undefined &&
1467
+ stepUsage !== undefined &&
1468
+ Number.isFinite(stepUsage.inputTokens) &&
1469
+ stepUsage.inputTokens > 0 &&
1470
+ Number.isFinite(stepUsage.outputTokens) &&
1471
+ stepUsage.outputTokens > 0 &&
1472
+ stepUsage.inputTokens + stepUsage.outputTokens > midTurnState.capacity) {
1473
+ contextWindowOverrunNoteWritten = true;
1474
+ await this.recordSystemNote('context_window_overrun', turnId, {
1475
+ usedTokens: stepUsage.inputTokens + stepUsage.outputTokens,
1476
+ declaredContextWindow: midTurnState.capacity,
1477
+ });
1478
+ }
1479
+ // Nothing declared, and the provider accepted a request past
1480
+ // the window this model reports. Every other signal in this
1481
+ // design stays dark there: no rejection to recover from and
1482
+ // no declaration to arm the proactive threshold, so the
1483
+ // session degrades quietly and
1484
+ // indefinitely (#4634). Report the two real numbers and
1485
+ // leave the decision with the user: a reported window is a
1486
+ // hint, and Maka still declares nothing on their behalf.
1487
+ //
1488
+ // Once per crossing, not once per send. On these providers
1489
+ // usage keeps growing past the line (305K → 322K observed),
1490
+ // so the note fires on the transition: the previous accepted
1491
+ // total was still inside the reported window and this one is
1492
+ // not. The baseline carries that previous total across
1493
+ // sessions through the persisted anchor, so a resumed
1494
+ // session does not repeat a crossing it already reported.
1495
+ if (!contextReportedWindowNoteWritten &&
1496
+ midTurnState !== undefined &&
1497
+ midTurnState.capacity === undefined &&
1498
+ stepUsage !== undefined &&
1499
+ Number.isFinite(stepUsage.inputTokens) &&
1500
+ stepUsage.inputTokens > 0 &&
1501
+ Number.isFinite(stepUsage.outputTokens)) {
1502
+ const reported = resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId);
1503
+ const used = stepUsage.inputTokens + Math.max(0, stepUsage.outputTokens);
1504
+ // `baselineTokens` still describes the request before this
1505
+ // one: the capacity hook sets it from the previous step, or
1506
+ // from the persisted anchor on a send's first request.
1507
+ const previousTotal = midTurnState.baselineTokens;
1508
+ const crossedNow = reported !== undefined &&
1509
+ used > reported &&
1510
+ (previousTotal === undefined || previousTotal <= reported);
1511
+ if (reported !== undefined && crossedNow) {
1512
+ contextReportedWindowNoteWritten = true;
1513
+ await this.recordSystemNote('context_reported_window_exceeded', turnId, {
1514
+ usedTokens: used,
1515
+ reportedContextWindow: reported,
1516
+ });
1517
+ }
1518
+ }
1519
+ lastStepInputTokens = stepUsage?.inputTokens;
1520
+ lastStepOutputTokens = stepUsage?.outputTokens;
1521
+ // A `finishReason: length` is deliberately not a trigger. The
1522
+ // reply may have been cut because the provider ran out of
1523
+ // window room, or because the provider's own output cap is
1524
+ // lower than the one Maka sends. Those are indistinguishable
1525
+ // from outside, and an indistinguishable signal must not
1526
+ // drive an action; the cut reply is visible to the user
1527
+ // either way (#4559).
1528
+ if (stepUsage) {
1529
+ completedStepUsage = mergeNormalizedUsage(completedStepUsage, stepUsage);
1530
+ this.deps.session.cumulativeUsageCheckpoint = mergeNormalizedUsage(this.deps.session.cumulativeUsageCheckpoint, stepUsage);
1531
+ await this.deps.backend.recordUsageCheckpoint?.({
1532
+ ...this.deps.session.cumulativeUsageCheckpoint,
1533
+ costUsd: this.deps.providerTelemetry.normalizedUsageCostUsd(this.deps.session.cumulativeUsageCheckpoint),
1534
+ });
1535
+ }
1536
+ await flushStep();
1537
+ if (midTurnState) {
1538
+ // Durability clock: step N's thinking/text completion events
1539
+ // are enqueued by flushStep just above, so only after this
1540
+ // boundary can a seq-ack wait for step N mean anything. Wake
1541
+ // waiters AFTER the increment or they would re-check a stale
1542
+ // count and sleep.
1543
+ midTurnState.flushedSteps += 1;
1544
+ queue.wake();
1545
+ }
1546
+ }
1547
+ if (providerOutcome.kind === 'failed' && !this.aborted) {
1548
+ const failure = providerOutcome.failure;
1549
+ // An output-free context rejection did not sample a response.
1550
+ // Preserve metering for completed steps across compaction recovery.
1551
+ if (!providerOutcome.usage &&
1552
+ !(failure.kind === 'context_overflow' &&
1553
+ attemptHasNoObservableOutput() &&
1554
+ !attemptSawToolInput &&
1555
+ returnedToolCalls.length === 0))
1556
+ sawUnusableStepUsage = true;
1557
+ if (this.loopStopRequested) {
1558
+ terminalProviderError = failure;
1559
+ terminalProviderErrorReason =
1560
+ lastCompletedStepHadToolResult && failure.kind === 'timeout'
1561
+ ? 'model_after_tool_timeout'
1562
+ : undefined;
1563
+ break agentLoop;
1564
+ }
1565
+ // A retry is a fresh provider request that would run at least one
1566
+ // more step; with the send-level budget already spent there is
1567
+ // nothing left to grant it, so the error is terminal.
1568
+ const stepBudgetRemains = maxSteps === undefined || runtimeSteps < maxSteps;
1569
+ const recovered = !preservingUnknownHistory &&
1570
+ stepBudgetRemains &&
1571
+ failure.kind === 'context_overflow' &&
1572
+ providerAttempt < MAX_PROVIDER_ATTEMPTS_PER_STEP &&
1573
+ attemptHasNoObservableOutput()
1574
+ ? await this.deps.compaction.recoverFromOverflowError({
1575
+ midTurnState,
1576
+ turnId,
1577
+ stepNumber: runtimeSteps,
1578
+ currentMessages: attemptMessages,
1579
+ activeTools: activeToolsForRequest,
1580
+ queue,
1581
+ onDiagnosticPatch: onMidTurnDiagnosticPatch,
1582
+ origin: this,
1583
+ ...(this.automaticMemoryCompactionSupported()
1584
+ ? {
1585
+ memoryCompactionDecision: () => this.automaticMemoryCompactionDecision(),
1586
+ onMemoryCompaction: (dispatch) => this.dispatchAutomaticMemoryCompaction(dispatch),
1587
+ }
1588
+ : {}),
1589
+ abortSignal: turnAbortController.signal,
1590
+ })
1591
+ : undefined;
1592
+ if (recovered) {
1593
+ attemptMessages = recovered.messages;
1594
+ overflowRecoveryMaxOutputTokens = Math.min(this.deps.modelAdapter.maxOutputTokens() ?? CONTEXT_RECOVERY_MAX_OUTPUT_TOKENS, CONTEXT_RECOVERY_MAX_OUTPUT_TOKENS);
1595
+ continue;
1596
+ }
1597
+ // Window suggestion (#4559): the provider rejected a request and
1598
+ // no recovery is left — this step's fold is spent, or there was
1599
+ // no seam. The baseline is a proven-fit total (input + output of an
1600
+ // accepted request), so it is a number the user can declare; the
1601
+ // trigger is `>=`, so declaring exactly it folds before this
1602
+ // point next time. Once per send, and only when the turn is
1603
+ // about to surface the error rather than continue.
1604
+ const acceptedTotal = midTurnState?.lastAcceptedTotalTokens;
1605
+ if (!contextWindowSuggestionNoteWritten &&
1606
+ failure.kind === 'context_overflow' &&
1607
+ midTurnState &&
1608
+ acceptedTotal !== undefined &&
1609
+ (midTurnState.capacity === undefined || acceptedTotal < midTurnState.capacity)) {
1610
+ contextWindowSuggestionNoteWritten = true;
1611
+ await this.recordSystemNote('context_window_suggestion', turnId, {
1612
+ suggestedContextWindow: acceptedTotal,
1613
+ ...(midTurnState.capacity !== undefined
1614
+ ? { declaredContextWindow: midTurnState.capacity }
1615
+ : {}),
1616
+ });
1617
+ }
1618
+ // A folded projection was selected in this send and the provider
1619
+ // still rejects the request. That is worth saying, because the
1620
+ // usual remedy has already been applied; it is NOT proof that the
1621
+ // new message alone is the cause, since what remains also carries
1622
+ // the system prompt, the tool schemas, the summary and the recent
1623
+ // tail. A fold that failed open is deliberately excluded: that
1624
+ // request went out with its full raw history, so nothing about
1625
+ // its size can be concluded (#4559).
1626
+ if (!contextOverflowAfterCompactionNoteWritten &&
1627
+ failure.kind === 'context_overflow' &&
1628
+ midTurnState?.projectionCheckpoint !== undefined) {
1629
+ contextOverflowAfterCompactionNoteWritten = true;
1630
+ await this.recordSystemNote('context_overflow_after_compaction', turnId);
1631
+ }
1632
+ // The stopping gate also supplies the durable reason. An absent
1633
+ // decision means this attempt is allowed to retry.
1634
+ let retry;
1635
+ if (!attemptCanReplay()) {
1636
+ retry = {
1637
+ decision: 'declined',
1638
+ because: attemptSawToolActivity ? 'side_effects' : 'observable_output',
1639
+ };
1640
+ }
1641
+ else if (!stepBudgetRemains) {
1642
+ retry = { decision: 'declined', because: 'budget' };
1643
+ }
1644
+ else if (providerAttempt >= MAX_PROVIDER_ATTEMPTS_PER_STEP) {
1645
+ retry = { decision: 'exhausted', attempts: providerAttempt };
1646
+ }
1647
+ else if (!failure.retryable) {
1648
+ retry = { decision: 'declined', because: 'policy' };
1649
+ }
1650
+ if (!retry) {
1651
+ // Preserve the failed fragment for the transcript, but exclude
1652
+ // it from model history when a later tool step reloads the ledger.
1653
+ await flushStep(true);
1654
+ currentStepMessageId = this.deps.newId();
1655
+ // The failed request did not return authoritative usage. Keep
1656
+ // effectiveness recoverable, but fail final metering closed.
1657
+ sawUnusableStepUsage = true;
1658
+ const delayMs = providerRetryDelayMs(providerAttempt, failure.retryAfterMs);
1659
+ const nextAttempt = providerAttempt + 1;
1660
+ const maxAttempts = MAX_PROVIDER_ATTEMPTS_PER_STEP;
1661
+ const reason = providerRetryReason(failure.kind) ?? 'unknown';
1662
+ queue.push({
1663
+ type: 'provider_retry',
1664
+ id: this.deps.newId(),
1665
+ turnId,
1666
+ ts: this.deps.now(),
1667
+ phase: 'scheduled',
1668
+ attempt: nextAttempt,
1669
+ maxAttempts,
1670
+ delayMs,
1671
+ remainingMs: delayMs,
1672
+ reason,
1673
+ });
1674
+ await this.deps.providerRetrySleep(delayMs, turnAbortController.signal);
1675
+ queue.push({
1676
+ type: 'provider_retry',
1677
+ id: this.deps.newId(),
1678
+ turnId,
1679
+ ts: this.deps.now(),
1680
+ phase: 'started',
1681
+ attempt: nextAttempt,
1682
+ maxAttempts,
1683
+ reason,
1684
+ });
1685
+ continue;
1686
+ }
1687
+ // Unrecoverable (not context-length, this step's attempt spent,
1688
+ // no seam, or no safe fold): surface the real provider error via
1689
+ // the terminal handler after settling any authoritative usage —
1690
+ // never a fabricated success.
1691
+ terminalProviderError = failure;
1692
+ terminalRetry = { error: terminalProviderError, retry };
1693
+ terminalProviderErrorReason =
1694
+ lastCompletedStepHadToolResult && failure.kind === 'timeout'
1695
+ ? 'model_after_tool_timeout'
1696
+ : undefined;
1697
+ break agentLoop;
1698
+ }
1699
+ break;
1700
+ }
1701
+ // If the stream loop exited because stop() flipped this.aborted while a
1702
+ // provider kept yielding after abort instead of throwing, route to the
1703
+ // abort handling below. Without this, the post-stream success path would
1704
+ // persist a partial assistant turn and emit a false end_turn completion.
1705
+ if (this.aborted) {
1706
+ throw Object.assign(new Error('aborted'), { name: 'AbortError' });
1707
+ }
1708
+ const providerStepId = currentStepMessageId;
1709
+ if (providerOutcome.kind !== 'completed')
1710
+ throw providerOutcome.failure;
1711
+ finishReason = providerOutcome.finishReason;
1712
+ await queue.waitUntilConsumedThroughCurrent();
1713
+ if (returnedToolCalls.length > 0) {
1714
+ const continuationBudgetRemains = maxSteps === undefined || runtimeSteps < maxSteps;
1715
+ if (continuationBudgetRemains && !this.deps.backend.loadTurnRuntimeEvents) {
1716
+ throw new Error('durable current-run reader is required for tool continuation');
1717
+ }
1718
+ if (this.deps.backend.loadTurnRuntimeEvents) {
1719
+ // Queue consumption alone does not prove that the latest assistant
1720
+ // facts remain readable. Fail before any external tool side effect
1721
+ // when the authoritative ledger became unavailable after the step.
1722
+ await loadDurableTurnEvents();
1723
+ }
1724
+ const toolsByName = new Map(providerTools.map((tool) => [tool.name, tool]));
1725
+ const settlementOutcomes = await Promise.allSettled(returnedToolCalls.map(async (toolCall) => {
1726
+ if (toolCall.providerExecuted) {
1727
+ throw new Error(`Provider-executed tool call "${toolCall.toolName}" is outside the main-agent tool loop`);
1728
+ }
1729
+ const sandboxBoundaryAttempt = isProviderSandboxBoundaryAttempt(toolCall);
1730
+ const deniedBoundaryRequest = toolRuntime.hasSandboxBoundaryDenial() &&
1731
+ toolCall.toolName.toLowerCase() === REQUEST_SANDBOX_BOUNDARY_TOOL_NAME;
1732
+ if (deniedBoundaryRequest) {
1733
+ toolRuntime.forceSandboxBoundaryFinalization();
1734
+ }
1735
+ const blockedToolCall = sandboxBoundaryFinalizationStep || deniedBoundaryRequest;
1736
+ const requestedTool = blockedToolCall
1737
+ ? undefined
1738
+ : toolsByName.get(toolCall.toolName);
1739
+ const tool = requestedTool ?? toolsByName.get(INVALID_TOOL_NAME);
1740
+ if (!tool)
1741
+ throw new Error('Runtime invalid-tool fallback is unavailable');
1742
+ const unavailableError = sandboxBoundaryFinalizationStep
1743
+ ? 'Sandbox boundary finalization does not permit tool execution.'
1744
+ : deniedBoundaryRequest
1745
+ ? SANDBOX_BOUNDARY_DENIED_FOR_TURN
1746
+ : 'returned tool is unavailable';
1747
+ return await toolRuntime.settleToolCall({
1748
+ tool,
1749
+ turnId,
1750
+ stepId: providerStepId,
1751
+ toolCallId: toolCall.toolCallId,
1752
+ // Provider metadata is persisted verbatim into an immutable
1753
+ // RuntimeEvent, and a field the response did not carry
1754
+ // arrives as an explicit `undefined` — which JSON drops, so
1755
+ // the event no longer reads back as it was written and the
1756
+ // store refuses it. One refusal took every tool-calling turn
1757
+ // with it.
1758
+ ...(toolCall.providerOptions !== undefined
1759
+ ? {
1760
+ providerOptions: stripUndefinedDeep(toolCall.providerOptions),
1761
+ }
1762
+ : {}),
1763
+ input: requestedTool !== undefined
1764
+ ? toolCall.input
1765
+ : {
1766
+ tool: toolCall.toolName,
1767
+ error: unavailableError,
1768
+ ...(sandboxBoundaryAttempt ? { sandboxBoundaryAttempt: true } : {}),
1769
+ },
1770
+ abortSignal: turnAbortController.signal,
1771
+ eventSink: queue,
1772
+ });
1773
+ }));
1774
+ const rejectedSettlement = settlementOutcomes.find((outcome) => outcome.status === 'rejected');
1775
+ if (rejectedSettlement)
1776
+ throw rejectedSettlement.reason;
1777
+ settlementOutcomes.forEach((outcome, index) => {
1778
+ // All settlements completed and rejection was checked above;
1779
+ // preserve provider order for Plan and Yield result handling.
1780
+ if (outcome.status === 'rejected')
1781
+ throw outcome.reason;
1782
+ const settlement = outcome.value;
1783
+ const toolCall = returnedToolCalls[index];
1784
+ if (isPlanToolResult(settlement.result)) {
1785
+ this.handlePlanToolResult(settlement.result, queue);
1786
+ }
1787
+ if (returnedToolCalls.length === 1 &&
1788
+ toolCall?.toolName === YIELD_AGENT_GRAPH_TOOL_NAME &&
1789
+ isAgentGraphYieldToolResult(settlement.result)) {
1790
+ this.handleAgentGraphYieldToolResult(settlement.result);
1791
+ }
1792
+ });
1793
+ // Continuation reads durable events, not raw results. Do not retain
1794
+ // an entire completed batch across the next provider request.
1795
+ settlementOutcomes.length = 0;
1796
+ await queue.waitUntilConsumedThroughCurrent();
1797
+ const continuationWillRun = (maxSteps === undefined || runtimeSteps < maxSteps) &&
1798
+ !this.loopStopRequested &&
1799
+ !this.aborted;
1800
+ if (continuationWillRun && providerOutcome.continuation === 'pending') {
1801
+ const persistedProjection = await loadDurableTurnProjection();
1802
+ const responseMessages = persistedOpenAiResponsesStepMessages(attemptMessages, persistedProjection, returnedToolCalls.map((toolCall) => toolCall.toolCallId));
1803
+ if (responseMessages) {
1804
+ this.deps.modelAdapter.recordContinuationResponse(this.turnId, responseMessages);
1805
+ }
1806
+ else {
1807
+ this.deps.modelAdapter.clearContinuation(this.turnId);
1808
+ }
1809
+ }
1810
+ }
1811
+ completedProviderSteps.push({
1812
+ toolCalls: returnedToolCalls,
1813
+ ...(providerStepUsage ? { usage: providerStepUsage } : {}),
1814
+ });
1815
+ lastCompletedStepHadToolResult = returnedToolCalls.length > 0;
1816
+ const stepLimitReached = maxSteps !== undefined && runtimeSteps >= maxSteps;
1817
+ if (sandboxBoundaryFinalizationStep ||
1818
+ (stepLimitReached &&
1819
+ (toolRuntime.shouldFinalizeSandboxBoundary() ||
1820
+ toolRuntime.hasSandboxBoundaryDenial()))) {
1821
+ this.loopStopReason = 'permission_handoff';
1822
+ this.loopStopRequested = true;
1823
+ }
1824
+ const mayTakeAnotherStep = !stepLimitReached && !this.loopStopRequested && !this.aborted;
1825
+ if (returnedToolCalls.length > 0 && mayTakeAnotherStep) {
1826
+ if ((await input.handoffBoundary?.(turnAbortController.signal, maxSteps === undefined ? null : maxSteps - runtimeSteps)) === 'pause') {
1827
+ this.handoffPaused = true;
1828
+ break agentLoop;
1829
+ }
1830
+ if (this.aborted || this.loopStopRequested)
1831
+ break agentLoop;
1832
+ currentStepMessageId = this.deps.newId();
1833
+ continue agentLoop;
1834
+ }
1835
+ // Continuing the turn needs the durable current-run reader, for the
1836
+ // same reason the tool-call edge above demands it: the next request
1837
+ // has to carry the assistant output this step just produced, and only
1838
+ // the ledger projection has it. The no-reader fallback at the top of
1839
+ // the loop appends steering alone, which would ask the model to
1840
+ // redirect work it cannot see. Without a reader this edge is skipped
1841
+ // rather than throwing — the turn still completes and the Host folds
1842
+ // the message into the next Turn, which is today's behaviour.
1843
+ if (mayTakeAnotherStep && this.deps.backend.loadTurnRuntimeEvents) {
1844
+ // Last chance for a steer that landed after this turn's final
1845
+ // tool-call boundary — including the only boundary a tool-free
1846
+ // turn has, which precedes the model's first token. Without it the
1847
+ // message is never pulled at all, and whether Steer works would
1848
+ // depend on the model happening to call a tool afterwards (#3529).
1849
+ // A step-limited turn deliberately skips this: its budget is spent,
1850
+ // and the Host folds the message into the next Turn instead.
1851
+ const injectedBefore = this.injectedSteeringMessages.length;
1852
+ await this.drainSteeringInto(input, queue);
1853
+ // Re-read the stop flags: the drain awaits a durable push, so an
1854
+ // `after_step` stop or an abort can land while it is in flight, and
1855
+ // `mayTakeAnotherStep` is stale by now. Stop wins — the message is
1856
+ // already durable, so the Host folds it into the next Turn.
1857
+ if (this.injectedSteeringMessages.length > injectedBefore &&
1858
+ !this.loopStopRequested &&
1859
+ !this.aborted) {
1860
+ await queue.waitUntilConsumedThroughCurrent();
1861
+ if ((await input.handoffBoundary?.(turnAbortController.signal, maxSteps === undefined ? null : maxSteps - runtimeSteps)) === 'pause') {
1862
+ this.handoffPaused = true;
1863
+ break agentLoop;
1864
+ }
1865
+ if (this.aborted || this.loopStopRequested)
1866
+ break agentLoop;
1867
+ currentStepMessageId = this.deps.newId();
1868
+ continue agentLoop;
1869
+ }
1870
+ }
1871
+ break agentLoop;
1872
+ }
1873
+ // Refine Tool Availability against the final active set. Deferred
1874
+ // loading may add tools, while boundary convergence may remove them;
1875
+ // comparing membership avoids missing a same-size swap.
1876
+ const finalActiveTools = currentRepairToolNames();
1877
+ if (finalActiveTools.length !== activeTools.length ||
1878
+ finalActiveTools.some((name, index) => name !== activeTools[index])) {
1879
+ toolAvailabilityForTelemetry = computeToolAvailability(finalActiveTools);
1880
+ }
1881
+ // Final usage event. Each adapter result covers one provider request.
1882
+ // The send-level owner is `completedStepUsage`, which spans every
1883
+ // Runtime loop step and retry. Recording only the final result would
1884
+ // silently drop prior requests. An unusable sample in ANY request fails
1885
+ // the whole record closed (#972).
1886
+ try {
1887
+ const attemptTotalUsage = providerOutcome.usage;
1888
+ tokenUsage = sawUnusableStepUsage ? undefined : (completedStepUsage ?? attemptTotalUsage);
1889
+ if (tokenUsage) {
1890
+ tokenUsageCostUsd = this.deps.providerTelemetry.normalizedUsageCostUsd(tokenUsage);
1891
+ const contextBudgetForUsage = contextBudgetForTelemetry;
1892
+ // Persisted alongside the live event so transcript rebuilds from
1893
+ // stored messages keep the TUI ctx segment instead of degrading to
1894
+ // `?/<window>` (#4019). Computed once; both writers share it.
1895
+ const contextRemainingForUsage = (() => {
1896
+ const contextWindow = resolveSelectedModelContextWindow(this.deps.backend.connection, this.deps.backend.modelId);
1897
+ if (lastStepInputTokens !== undefined && contextWindow !== undefined) {
1898
+ return Math.max(0, contextWindow - lastStepInputTokens);
1899
+ }
1900
+ return undefined;
1901
+ })();
1902
+ // The anchor the NEXT turn judges its first request from — see
1903
+ // `LastRequestAnchor`. `input` below is the sum across this send's
1904
+ // steps and anchors nothing; the LAST step's real input and output
1905
+ // are what the next request re-sends. No usable input count, no
1906
+ // anchor: the next turn then has no proactive fold until its first
1907
+ // accepted request.
1908
+ const anchorInputTokens = finitePositive(lastStepInputTokens);
1909
+ const anchorOutputTokens = lastStepOutputTokens !== undefined && Number.isFinite(lastStepOutputTokens)
1910
+ ? Math.max(0, lastStepOutputTokens)
1911
+ : undefined;
1912
+ // One shared usage payload for the durable message and the live
1913
+ // event: twin per-field literals drifted before (#4019), so a field
1914
+ // now has exactly one definition site.
1915
+ const usageFields = {
1916
+ input: tokenUsage.inputTokens,
1917
+ output: tokenUsage.outputTokens,
1918
+ cacheHitInput: tokenUsage.cacheHitInputTokens,
1919
+ cacheMissInput: tokenUsage.cacheMissInputTokens,
1920
+ cacheMissInputSource: tokenUsage.cacheMissInputSource,
1921
+ cacheWriteInput: tokenUsage.cacheWriteInputTokens,
1922
+ reasoning: tokenUsage.reasoningTokens,
1923
+ total: tokenUsage.totalTokens,
1924
+ ...(tokenUsage.rawFinishReason !== undefined
1925
+ ? { rawFinishReason: tokenUsage.rawFinishReason }
1926
+ : {}),
1927
+ ...(runtimeSteps > 0 ? { runtimeSteps } : {}),
1928
+ ...(tokenUsage.cachedInputTokens > 0
1929
+ ? { cacheRead: tokenUsage.cachedInputTokens }
1930
+ : {}),
1931
+ ...(tokenUsage.cacheWriteInputTokens > 0
1932
+ ? { cacheCreation: tokenUsage.cacheWriteInputTokens }
1933
+ : {}),
1934
+ ...(tokenUsageCostUsd !== undefined ? { costUsd: tokenUsageCostUsd } : {}),
1935
+ ...(contextBudgetForUsage ? { contextBudget: contextBudgetForUsage } : {}),
1936
+ ...(contextRemainingForUsage !== undefined
1937
+ ? { contextRemaining: contextRemainingForUsage }
1938
+ : {}),
1939
+ ...(providerRequestTraceId ? { providerRequestTraceId } : {}),
1940
+ ...(anchorInputTokens !== undefined
1941
+ ? {
1942
+ lastRequestAnchor: {
1943
+ inputTokens: anchorInputTokens,
1944
+ ...(anchorOutputTokens !== undefined
1945
+ ? { outputTokens: anchorOutputTokens }
1946
+ : {}),
1947
+ modelId: this.deps.backend.modelId,
1948
+ ...(this.deps.backend.header.llmConnectionId !== undefined
1949
+ ? { connectionId: this.deps.backend.header.llmConnectionId }
1950
+ : {}),
1951
+ },
1952
+ }
1953
+ : {}),
1954
+ };
1955
+ // Settlement fallback: a mid-turn or request-hook fold is only
1956
+ // known here. Notes already written at decision time are skipped
1957
+ // by the flags inside.
1958
+ await appendCompactionDecisionNotes(contextBudgetForUsage);
1959
+ queue.push({
1960
+ type: 'token_usage',
1961
+ id: this.deps.newId(),
1962
+ turnId,
1963
+ ts: this.deps.now(),
1964
+ ...usageFields,
1965
+ });
1966
+ }
1967
+ }
1968
+ catch {
1969
+ // best-effort; ai-sdk usage promise may reject on abort
1970
+ }
1971
+ // Nothing may await between this check and terminal emission: Stop must
1972
+ // win even when it arrives during post-stream usage persistence.
1973
+ if (this.aborted)
1974
+ throw Object.assign(new Error('aborted'), { name: 'AbortError' });
1975
+ if (terminalProviderError)
1976
+ throw terminalProviderError;
1977
+ // Usage above still belongs to this physical attempt. Its Runtime owner
1978
+ // seals the drained stream; no complete/abort event ends the logical Turn.
1979
+ if (this.handoffPaused)
1980
+ return;
1981
+ const stopReason = this.loopStopReason ??
1982
+ (maxSteps !== undefined && finishReason === 'tool-calls'
1983
+ ? 'step_limit'
1984
+ : this.mapFinishReason(finishReason));
1985
+ trace.modelStreamCompleted(stopReason);
1986
+ const completeEvent = {
1987
+ type: 'complete',
1988
+ id: this.deps.newId(),
1989
+ turnId,
1990
+ ts: this.deps.now(),
1991
+ stopReason,
1992
+ };
1993
+ queue.push(completeEvent);
1994
+ if (this.memoryExtractRequested && this.deps.backend.memoryExtraction) {
1995
+ const snapshot = this.memorySourceSnapshot({
1996
+ trigger: 'extract',
1997
+ terminalEventId: completeEvent.id,
1998
+ });
1999
+ if (snapshot) {
2000
+ void queue
2001
+ .waitUntilConsumedThroughCurrent()
2002
+ .then(() => this.deps.backend.memoryExtraction?.extract(snapshot))
2003
+ .catch(() => undefined);
2004
+ }
2005
+ }
2006
+ }
2007
+ catch (err) {
2008
+ streamStatus = this.aborted ? 'aborted' : 'error';
2009
+ streamErrorClass = this.deps.modelAdapter.classifyError(currentWatchdogTimeout()?.error ?? err);
2010
+ // Flush the in-flight step's partial text/thinking before the terminal
2011
+ // abort/error events. Earlier steps already flushed at settlement;
2012
+ // this keeps their and this step's streamed-out output on
2013
+ // BOTH exits — user stop and provider error / watchdog timeout — so the
2014
+ // transcript keeps what the user actually saw.
2015
+ await flushStep(!this.aborted).catch(() => { });
2016
+ if (this.aborted) {
2017
+ queue.push({
2018
+ type: 'abort',
2019
+ id: this.deps.newId(),
2020
+ turnId,
2021
+ ts: this.deps.now(),
2022
+ reason: 'user_stop',
2023
+ });
2024
+ queue.push({
2025
+ type: 'complete',
2026
+ id: this.deps.newId(),
2027
+ turnId,
2028
+ ts: this.deps.now(),
2029
+ stopReason: 'user_stop',
2030
+ });
2031
+ }
2032
+ else {
2033
+ const terminalError = currentWatchdogTimeout()?.error ?? err;
2034
+ queue.push({
2035
+ ...this.makeErrorEvent(turnId, terminalError, terminalProviderErrorReason),
2036
+ ...(terminalRetry && terminalRetry.error === terminalError
2037
+ ? { retry: terminalRetry.retry }
2038
+ : {}),
2039
+ });
2040
+ trace.modelStreamFailed(streamErrorClass, terminalError, priorReplayFailureTrace(priorReplay));
2041
+ queue.push({
2042
+ type: 'complete',
2043
+ id: this.deps.newId(),
2044
+ turnId,
2045
+ ts: this.deps.now(),
2046
+ stopReason: 'error',
2047
+ });
2048
+ }
2049
+ }
2050
+ finally {
2051
+ watchdogState.current?.stop();
2052
+ if (this.watchdog === watchdogState.current)
2053
+ this.watchdog = null;
2054
+ // `tokenUsage` still backfills from the completed steps when the send
2055
+ // ended without a final `usage`: the terminal outcome and the
2056
+ // `token_usage` SessionEvent below both read it. An unusable sample in
2057
+ // any step fails it closed rather than posing a partial sum as the
2058
+ // whole call (#972).
2059
+ //
2060
+ // The send-level `recordLlmCall` that used to sit here is gone (#1679).
2061
+ // It measured the same provider requests the canonical seam now settles
2062
+ // into `ModelCallAttempt`, one record per physical request instead of
2063
+ // one aggregate per send, and keeping both would have been two
2064
+ // independent meters free to disagree.
2065
+ //
2066
+ // What does NOT follow it out is the diagnostics that rode on it. The
2067
+ // exhausted and aborted paths emit no `token_usage` SessionEvent, so
2068
+ // their compaction decisions and the accumulated usage of the steps that
2069
+ // did complete had that record as their only durable home. They move to
2070
+ // the run trace, which carries no cost and meters nothing.
2071
+ if (!tokenUsage && completedStepUsage && !sawUnusableStepUsage) {
2072
+ tokenUsage = completedStepUsage;
2073
+ tokenUsageCostUsd = this.deps.providerTelemetry.normalizedUsageCostUsd(tokenUsage);
2074
+ }
2075
+ trace.sendDiagnostics({
2076
+ status: streamStatus,
2077
+ ...(streamErrorClass ? { errorClass: streamErrorClass } : {}),
2078
+ ...(tokenUsage
2079
+ ? {
2080
+ inputTokens: tokenUsage.inputTokens,
2081
+ outputTokens: tokenUsage.outputTokens,
2082
+ totalTokens: tokenUsage.totalTokens,
2083
+ }
2084
+ : {}),
2085
+ ...(contextBudgetForTelemetry !== undefined
2086
+ ? { contextBudget: contextBudgetForTelemetry }
2087
+ : {}),
2088
+ ...(toolAvailabilityForTelemetry !== undefined
2089
+ ? { toolAvailability: toolAvailabilityForTelemetry }
2090
+ : {}),
2091
+ });
2092
+ queue.close();
2093
+ }
2094
+ })();
2095
+ let drainedNormally = false;
2096
+ try {
2097
+ // drain() carries the seq-ack semantics (consumer pull = processed ack);
2098
+ // every consumer-facing path must go through it.
2099
+ yield* this.drain(queue);
2100
+ drainedNormally = true;
2101
+ }
2102
+ finally {
2103
+ if (!drainedNormally)
2104
+ turnAbortController.abort();
2105
+ await pumpDone.catch(() => { });
2106
+ }
2107
+ }
2108
+ async executeCodeModeCell(eventSink, code, context) {
2109
+ const snapshot = new Map(this.codeModeTools);
2110
+ let nestedOutputBytes = 0;
2111
+ let nestedOutputLimitExceeded = false;
2112
+ const nestedEventSink = {
2113
+ push: (event) => {
2114
+ if (event.type === 'tool_output_delta') {
2115
+ const nextBytes = new TextEncoder().encode(event.chunk).byteLength;
2116
+ if (nestedOutputLimitExceeded ||
2117
+ nestedOutputBytes + nextBytes > DEFAULT_CODE_MODE_EXECUTION_POLICY.maxToolOutputBytes) {
2118
+ nestedOutputLimitExceeded = true;
2119
+ return;
2120
+ }
2121
+ nestedOutputBytes += nextBytes;
2122
+ }
2123
+ eventSink.push(event);
2124
+ },
2125
+ pushAndWaitUntilConsumed: (event) => eventSink.pushAndWaitUntilConsumed(event),
2126
+ };
2127
+ // Admission covers the whole cell, including host waits. executeCodeCell
2128
+ // waits for every started host call
2129
+ // on both success and cancellation, so settlement is the release boundary.
2130
+ //
2131
+ // One cell may wait; the next is turned away rather than queued, which is
2132
+ // what the Code Mode adapter did before this moved to the side that owns
2133
+ // execution. Nothing awaits between reading `waitingCount` and the enqueue
2134
+ // inside `acquire`, so the pair is atomic.
2135
+ if (this.deps.codeCellAdmission.waitingCount >= MAX_WAITING_CODE_MODE_CELLS) {
2136
+ return {
2137
+ ok: false,
2138
+ error: { kind: 'limit_exceeded', message: 'Code Mode execution queue is full' },
2139
+ toolCalls: [],
2140
+ };
2141
+ }
2142
+ const permit = await this.deps.codeCellAdmission.acquire(context.abortSignal);
2143
+ try {
2144
+ return await executeCodeCell({
2145
+ code,
2146
+ signal: context.abortSignal,
2147
+ tools: [...snapshot.values()].map((tool) => ({
2148
+ name: tool.name,
2149
+ })),
2150
+ isFatalToolError: isRuntimeCommitBoundaryError,
2151
+ callTool: async (name, input, signal) => {
2152
+ if (this.loopStopRequested)
2153
+ throw new Error('The turn has yielded; no further tools may run.');
2154
+ const tool = snapshot.get(name);
2155
+ if (!tool)
2156
+ throw new Error(`Tool "${name}" is not active or nestable in this cell`);
2157
+ const parsedInput = await validateCodeModeToolInput(tool, input);
2158
+ const settlement = await this.toolRuntime.settleToolCall({
2159
+ tool,
2160
+ turnId: context.turnId,
2161
+ toolCallId: `${context.toolCallId}:nested:${this.deps.newId()}`,
2162
+ stepId: `${context.toolCallId}:nested`,
2163
+ input: parsedInput,
2164
+ abortSignal: signal,
2165
+ eventSink: nestedEventSink,
2166
+ origin: 'code_mode',
2167
+ parentToolCallId: context.toolCallId,
2168
+ ...(context.operationId ? { parentOperationId: context.operationId } : {}),
2169
+ maxResultBytes: DEFAULT_CODE_MODE_EXECUTION_POLICY.maxToolOutputBytes,
2170
+ });
2171
+ if (settlement.providerError !== undefined) {
2172
+ throw new Error(settlement.providerError);
2173
+ }
2174
+ if (nestedOutputLimitExceeded) {
2175
+ throw new Error('Code Mode nested output byte limit exceeded');
2176
+ }
2177
+ if (isPlanToolResult(settlement.result))
2178
+ this.handlePlanToolResult(settlement.result, eventSink);
2179
+ if (name === YIELD_AGENT_GRAPH_TOOL_NAME &&
2180
+ isAgentGraphYieldToolResult(settlement.result)) {
2181
+ this.handleAgentGraphYieldToolResult(settlement.result);
2182
+ }
2183
+ return settlement.result;
2184
+ },
2185
+ });
2186
+ }
2187
+ finally {
2188
+ permit.release();
2189
+ }
2190
+ }
2191
+ handlePlanToolResult(result, queue) {
2192
+ const turnId = this.turnId;
2193
+ if (result.kind === 'plan_submitted') {
2194
+ const proposal = result.proposal;
2195
+ queue.push({
2196
+ type: 'plan_submitted',
2197
+ id: this.deps.newId(),
2198
+ turnId,
2199
+ ts: this.deps.now(),
2200
+ planId: proposal.planId,
2201
+ proposalId: proposal.proposalId,
2202
+ revision: proposal.revision,
2203
+ title: proposal.title,
2204
+ ...(proposal.overview ? { overview: proposal.overview } : {}),
2205
+ ...(proposal.risks ? { risks: proposal.risks } : {}),
2206
+ steps: proposal.steps.map((step) => ({ ...step, status: 'pending' })),
2207
+ });
2208
+ this.runTrace?.emit('plan', 'plan_submitted', 'Plan submitted', {
2209
+ planId: proposal.planId,
2210
+ proposalId: proposal.proposalId,
2211
+ revision: proposal.revision,
2212
+ storeVersion: result.storeVersion,
2213
+ });
2214
+ this.loopStopReason = 'plan_handoff';
2215
+ this.loopStopRequested = true;
2216
+ return;
2217
+ }
2218
+ const traceType = result.kind;
2219
+ this.runTrace?.emit('plan', traceType, 'Plan execution state changed', {
2220
+ planId: result.execution.planId,
2221
+ proposalId: result.execution.proposalId,
2222
+ executionId: result.execution.executionId,
2223
+ storeVersion: result.storeVersion,
2224
+ });
2225
+ // Completing or cancelling the execution is a tool boundary, not the end of
2226
+ // the conversational Turn. The execution prompt tells the model to persist
2227
+ // final progress before its final response, so let it consume this result
2228
+ // and produce that response on the next provider step.
2229
+ }
2230
+ handleAgentGraphYieldToolResult(result) {
2231
+ this.runTrace?.emit('agent_graph', 'graph_supervisor_yielded', 'Graph supervisor yielded', {
2232
+ pendingWorkCount: result.pendingWorkCount,
2233
+ liveOperatorCount: result.liveOperatorCount,
2234
+ reason: result.reason,
2235
+ });
2236
+ this.loopStopReason = 'graph_yield';
2237
+ this.loopStopRequested = true;
2238
+ }
2239
+ mapFinishReason(reason) {
2240
+ return this.deps.modelAdapter.mapFinishReason(reason);
2241
+ }
2242
+ makeErrorEvent(turnId, err, reasonOverride) {
2243
+ return this.deps.modelAdapter.makeErrorEvent(turnId, err, reasonOverride);
2244
+ }
2245
+ /** Materialize canonical RuntimeEvent history into ai-sdk's message format. */
2246
+ async buildPriorMessages(input, priorUnknownProjection) {
2247
+ if (!input.runtimeContext) {
2248
+ return {
2249
+ status: 'ready',
2250
+ messages: [],
2251
+ gate: 'runtime_replay_text_only',
2252
+ diagnostics: [],
2253
+ };
2254
+ }
2255
+ // A handoff changes the physical Run, not the logical Turn. Its admitted
2256
+ // replay is all predecessor history, including events with this turnId.
2257
+ const rawPriorRuntimeContext = input.continuation
2258
+ ? input.runtimeContext
2259
+ : input.runtimeContext.filter((event) => event.turnId !== input.turnId);
2260
+ // Everything below reads EFFECTIVE model history: raw events folded through
2261
+ // the durable projection-transition reducer (#4283). Replay, budgeting and
2262
+ // compaction share one input, so no RuntimeEvent replay path can resurrect
2263
+ // content a committed transition removed.
2264
+ const preservingUnknownHistory = priorUnknownProjection.kind === 'projected';
2265
+ let priorRuntimeContext;
2266
+ let runtimeContext;
2267
+ let contextBudget;
2268
+ let contextBudgetDiagnostic;
2269
+ let projectedHistoryCompactCheckpoint;
2270
+ if (priorUnknownProjection.kind === 'projected') {
2271
+ const preparedContextBudget = await this.deps.compaction.prepareContextBudgetPolicy(rawPriorRuntimeContext, input.turnId);
2272
+ priorRuntimeContext = preparedContextBudget.events;
2273
+ contextBudget = preparedContextBudget.policy;
2274
+ const budgeted = applyRuntimeEventContextBudget(rawPriorRuntimeContext, contextBudget);
2275
+ const budgetedEvents = budgeted?.events ?? rawPriorRuntimeContext;
2276
+ const preservesUnknownCalls = priorUnknownProjection.outcomes.every((outcome) => budgetedEvents.some((event) => event.id === outcome.callEventId));
2277
+ // Existing checkpoints and durable result pruning are safe when they
2278
+ // leave every unknown call available to pair with its temporary result.
2279
+ // Otherwise replay the full effective ledger: a summary that erases T1
2280
+ // would make the request-local T2 orphaned or hide the uncertainty.
2281
+ const selectedEvents = preservesUnknownCalls ? budgetedEvents : rawPriorRuntimeContext;
2282
+ const effectiveEvents = await this.deps.compaction.foldEffectiveModelHistory(selectedEvents, preparedContextBudget.projectionSnapshot);
2283
+ runtimeContext = appendPriorUnknownToolResponses(effectiveEvents, priorUnknownProjection);
2284
+ if (preservesUnknownCalls) {
2285
+ contextBudgetDiagnostic = budgeted?.diagnostic;
2286
+ projectedHistoryCompactCheckpoint = budgeted?.historyCompactCheckpoint;
2287
+ }
2288
+ if (preparedContextBudget.diagnosticPatch) {
2289
+ contextBudgetDiagnostic = mergeContextBudgetDiagnostic(contextBudgetDiagnostic ??
2290
+ buildContextBudgetDiagnosticShell(priorRuntimeContext, effectiveEvents, contextBudget), preparedContextBudget.diagnosticPatch);
2291
+ }
2292
+ }
2293
+ else {
2294
+ const preparedContextBudget = await this.deps.compaction.prepareContextBudgetPolicy(rawPriorRuntimeContext, input.turnId);
2295
+ priorRuntimeContext = preparedContextBudget.events;
2296
+ contextBudget = preparedContextBudget.policy;
2297
+ // Match the durable checkpoint against the RAW ledger prefix: every
2298
+ // creation path (standalone compactHistory and the mid-turn state) pins
2299
+ // its coverage digest on raw events, so matching the folded view here
2300
+ // lets any durable projection transition inside the covered prefix orphan
2301
+ // the checkpoint and silently fail open into a full-history replay
2302
+ // (#4842). The projected [block, tail] is then folded through the
2303
+ // transition reducer before it becomes messages, so a committed
2304
+ // transition still cannot resurrect content for the model (#4283).
2305
+ const budgeted = applyRuntimeEventContextBudget(rawPriorRuntimeContext, contextBudget);
2306
+ runtimeContext = await this.deps.compaction.foldEffectiveModelHistory(budgeted?.events ?? rawPriorRuntimeContext, preparedContextBudget.projectionSnapshot);
2307
+ contextBudgetDiagnostic = budgeted?.diagnostic;
2308
+ projectedHistoryCompactCheckpoint = budgeted?.historyCompactCheckpoint;
2309
+ if (preparedContextBudget.diagnosticPatch) {
2310
+ contextBudgetDiagnostic = mergeContextBudgetDiagnostic(contextBudgetDiagnostic ??
2311
+ buildContextBudgetDiagnosticShell(priorRuntimeContext, runtimeContext, contextBudget), preparedContextBudget.diagnosticPatch);
2312
+ }
2313
+ }
2314
+ const providerReasoningReplayEventIds = compatibleProviderReasoningReplayEventIds(priorRuntimeContext, input.runtimeContextInvocations, this.deps.backend.providerStateIdentity, this.deps.backend.modelId);
2315
+ // No pre-turn estimate gate: the turn's first request is judged by the
2316
+ // request-projection hook from the previous request's real usage, and by
2317
+ // the provider when it goes out (#4559).
2318
+ // The boundary belongs to the RuntimeEvent projection above.
2319
+ const replayBoundary = (fromRuntimeReplay) => fromRuntimeReplay && projectedHistoryCompactCheckpoint
2320
+ ? { latestHistoryCompactCheckpoint: projectedHistoryCompactCheckpoint }
2321
+ : {};
2322
+ const plan = buildRuntimeEventModelReplayPlan(runtimeContext,
2323
+ // `runtimeContext` may be a budget/history-search slice; the tool-turn
2324
+ // thinking skip is a whole-history invariant, so seed it from the full
2325
+ // prior ledger so a sliced-in tool-turn thinking still gets skipped.
2326
+ {
2327
+ toolActivityTurnIds: collectToolActivityTurnIds(priorRuntimeContext),
2328
+ // Transcript repair can preserve an assistant-only opening from either
2329
+ // an imported or a native legacy Session. Ordinary provider requests
2330
+ // admit both at the first valid user head; explicit continuations use
2331
+ // their separately admitted boundary.
2332
+ allowRepairedAssistantPrefix: input.continuation !== undefined,
2333
+ });
2334
+ const hasProviderHistoryCompactCheckpoint = projectedHistoryCompactCheckpoint !== undefined &&
2335
+ isProviderHistoryCompactCheckpoint(projectedHistoryCompactCheckpoint);
2336
+ const materializeReplayFallback = () => this.deps.messageProjection.materializeRuntimeReplayTextOnly(this.imageBudget, plan, projectedHistoryCompactCheckpoint);
2337
+ if (plan.items.length === 0 && !hasProviderHistoryCompactCheckpoint) {
2338
+ return {
2339
+ status: 'ready',
2340
+ messages: await materializeReplayFallback(),
2341
+ gate: 'runtime_replay_text_only',
2342
+ diagnostics: plan.diagnostics,
2343
+ runtimeEventCount: runtimeContext.length,
2344
+ ...(contextBudgetDiagnostic ? { contextBudget: contextBudgetDiagnostic } : {}),
2345
+ ...replayBoundary(true),
2346
+ };
2347
+ }
2348
+ if (hasBlockingReplayDiagnostics(plan)) {
2349
+ return {
2350
+ status: 'ready',
2351
+ messages: await materializeReplayFallback(),
2352
+ gate: input.continuation
2353
+ ? 'runtime_replay_text_only'
2354
+ : 'runtime_replay_unsupported_semantics',
2355
+ diagnostics: plan.diagnostics,
2356
+ runtimeEventCount: runtimeContext.length,
2357
+ ...(contextBudgetDiagnostic ? { contextBudget: contextBudgetDiagnostic } : {}),
2358
+ ...replayBoundary(true),
2359
+ };
2360
+ }
2361
+ if (!plan.hasProviderNativeSemantics) {
2362
+ return {
2363
+ status: 'ready',
2364
+ messages: await this.deps.messageProjection.materializeRuntimeReplayPlan(plan, this.imageBudget, projectedHistoryCompactCheckpoint, providerReasoningReplayEventIds),
2365
+ gate: 'runtime_replay_text_only',
2366
+ diagnostics: plan.diagnostics,
2367
+ runtimeEventCount: runtimeContext.length,
2368
+ ...(contextBudgetDiagnostic ? { contextBudget: contextBudgetDiagnostic } : {}),
2369
+ ...replayBoundary(true),
2370
+ };
2371
+ }
2372
+ if (!this.deps.messageProjection.canReplayProviderNative(plan)) {
2373
+ // Degrade per item, not per plan: an unsupported provider-executed pair
2374
+ // must not cost unrelated client tool history (#2972). Thinking items
2375
+ // stay in the plan; materializeRuntimeReplayPlan degrades unsupported
2376
+ // reasoning per item via reasoningReplay.
2377
+ const degradedPlan = this.deps.messageProjection.dropUnsupportedReplayItems(plan);
2378
+ return {
2379
+ status: 'ready',
2380
+ messages: degradedPlan.items.length > 0 || hasProviderHistoryCompactCheckpoint
2381
+ ? await this.deps.messageProjection.materializeRuntimeReplayPlan(degradedPlan, this.imageBudget, projectedHistoryCompactCheckpoint, providerReasoningReplayEventIds)
2382
+ : await materializeReplayFallback(),
2383
+ gate: input.continuation
2384
+ ? 'runtime_replay_text_only'
2385
+ : 'runtime_replay_unsupported_semantics',
2386
+ diagnostics: plan.diagnostics,
2387
+ runtimeEventCount: runtimeContext.length,
2388
+ ...(contextBudgetDiagnostic ? { contextBudget: contextBudgetDiagnostic } : {}),
2389
+ ...replayBoundary(true),
2390
+ };
2391
+ }
2392
+ return {
2393
+ status: 'ready',
2394
+ messages: await this.deps.messageProjection.materializeRuntimeReplayPlan(plan, this.imageBudget, projectedHistoryCompactCheckpoint, providerReasoningReplayEventIds),
2395
+ gate: 'runtime_replay_provider_native',
2396
+ diagnostics: plan.diagnostics,
2397
+ runtimeEventCount: runtimeContext.length,
2398
+ ...(contextBudgetDiagnostic ? { contextBudget: contextBudgetDiagnostic } : {}),
2399
+ ...replayBoundary(true),
2400
+ };
2401
+ }
2402
+ async resolveSystemPrompt() {
2403
+ const turnId = this.turnId;
2404
+ if (typeof this.deps.backend.systemPrompt === 'function') {
2405
+ const resolved = await this.deps.backend.systemPrompt({
2406
+ sessionId: this.deps.backend.sessionId,
2407
+ turnId,
2408
+ cwd: this.deps.backend.header.cwd,
2409
+ turnStartedAt: this.startedAt,
2410
+ emitSkillCatalogTrace: (message, data) => this.runTrace?.emit('skill', 'skill_catalog_built', message, data),
2411
+ });
2412
+ return typeof resolved === 'string' || resolved === undefined
2413
+ ? { ...(resolved === undefined ? {} : { text: resolved }), sourceRevisions: [] }
2414
+ : resolved;
2415
+ }
2416
+ return {
2417
+ ...(this.deps.backend.systemPrompt === undefined
2418
+ ? {}
2419
+ : { text: this.deps.backend.systemPrompt }),
2420
+ sourceRevisions: [],
2421
+ };
2422
+ }
2423
+ async *drain(queue) {
2424
+ try {
2425
+ for await (const ev of queue) {
2426
+ yield ev;
2427
+ // Generator backpressure IS the consumer's ack: this line runs only
2428
+ // when the consumer's loop body finished for `ev` and pulled the next
2429
+ // event, so `consumedCount` counts fully PROCESSED events. AgentRun
2430
+ // persists each mapped event before continuing, so an acked event is
2431
+ // either durable or deliberately skipped (partials, non-terminal
2432
+ // errors) — exactly the set a durable read can ever return.
2433
+ queue.ackConsumed();
2434
+ }
2435
+ }
2436
+ finally {
2437
+ // The consumer abandoned or finished the stream; wake any seq-ack waiter
2438
+ // so it observes `consumerDetached` instead of blocking forever.
2439
+ queue.noteConsumerDetached();
2440
+ }
2441
+ }
2442
+ /**
2443
+ * Drain the caller's pending steering at a step boundary. Each message is
2444
+ * echoed as a `steering_message` event (so the ledger + transcript render the
2445
+ * interjection in place) and accumulated as an envelope-wrapped user message
2446
+ * for injection into subsequent provider requests.
2447
+ *
2448
+ * Persist-before-include invariant: the initial user message is durable
2449
+ * before the backend is invoked, and a steered message must hold the same
2450
+ * line — the provider must never start executing a directive the ledger does
2451
+ * not carry. The seq-ack boundary provides that without a second write path:
2452
+ * the consumer's pull is the ack, and AgentRun persists each mapped event
2453
+ * before continuing (see drain()), so once everything enqueued up to the
2454
+ * steering event is consumed, the event is durable. If the consumer detaches
2455
+ * (the persist path failed or the turn is being torn down) before that, the
2456
+ * message is nacked and NOT included in any request; an abort after the push
2457
+ * waits for that same convergence — durable ⇒ ack (history owns it), detach
2458
+ * ⇒ nack — and only then throws so the dying request is never sent.
2459
+ */
2460
+ async drainSteeringInto(input, queue) {
2461
+ const turnId = this.turnId;
2462
+ const abortSignal = this.abortController.signal;
2463
+ const pull = input.pullSteering;
2464
+ if (!pull)
2465
+ return;
2466
+ const leases = await pull();
2467
+ if (leases.length === 0)
2468
+ return;
2469
+ // Binary settlement: every pulled lease settles exactly once, decided
2470
+ // ONLY by the persistence fact — durably consumed ⇒ ack + injection set;
2471
+ // provably never persisted (never pushed, or the consumer detached
2472
+ // without consuming it) ⇒ nack. An abort does NOT settle a pushed lease:
2473
+ // it only stops new pushes and the dying request; the wait continues
2474
+ // until the teardown converges it (the flow drains after terminal events
2475
+ // or detaches on failure), because nacking a durably appended event
2476
+ // would put the same directive in the account twice — once via history
2477
+ // replay, once via the reclaimed queue.
2478
+ const undelivered = [...leases];
2479
+ try {
2480
+ for (const lease of leases) {
2481
+ if (this.aborted || abortSignal?.aborted) {
2482
+ // Never pushed: settles as undelivered.
2483
+ throw Object.assign(new Error('aborted before steering was pushed'), {
2484
+ name: 'AbortError',
2485
+ });
2486
+ }
2487
+ if (queue.consumerDetached) {
2488
+ throw new Error('steering message was not durably consumed: event consumer detached');
2489
+ }
2490
+ // Materialize provider content before publishing the durable event.
2491
+ // After consumption there must be no fallible gap before ack/injection.
2492
+ const eventId = this.deps.newId();
2493
+ const providerContent = await this.deps.messageProjection.appendImageParts(this.imageBudget, buildSteeringEnvelope(formatTextWithInlineRefs(lease.content.text, lease.content)), lease.content.attachments, `steering:${eventId}`);
2494
+ if (this.aborted || abortSignal?.aborted) {
2495
+ throw Object.assign(new Error('aborted before steering was pushed'), {
2496
+ name: 'AbortError',
2497
+ });
2498
+ }
2499
+ if (queue.consumerDetached) {
2500
+ throw new Error('steering message was not durably consumed: event consumer detached');
2501
+ }
2502
+ await queue.pushAndWaitUntilConsumed({
2503
+ type: 'steering_message',
2504
+ id: eventId,
2505
+ turnId,
2506
+ ts: this.deps.now(),
2507
+ messageId: lease.messageId,
2508
+ content: lease.content,
2509
+ ...(lease.submittedContentDigest
2510
+ ? { submittedContentDigest: lease.submittedContentDigest }
2511
+ : {}),
2512
+ });
2513
+ // The mapped RuntimeEvent inherits this session event's id, so the
2514
+ // injected message and its future ledger replay share one identity.
2515
+ this.injectedSteeringMessages.push(steeringModelMessage(eventId, providerContent));
2516
+ input.ackSteering?.([lease.id]);
2517
+ undelivered.shift();
2518
+ if (this.aborted || abortSignal?.aborted) {
2519
+ // Settled (the ledger owns the message; the next turn replays it),
2520
+ // but the send is dying: stop before any request is built with it.
2521
+ throw Object.assign(new Error('aborted after steering was durable'), {
2522
+ name: 'AbortError',
2523
+ });
2524
+ }
2525
+ }
2526
+ }
2527
+ catch (error) {
2528
+ if (undelivered.length > 0) {
2529
+ input.nackSteering?.(undelivered.map((lease) => lease.id));
2530
+ }
2531
+ throw error;
2532
+ }
2533
+ }
2534
+ }
2535
+ function isPlanToolResult(output) {
2536
+ if (!output || typeof output !== 'object')
2537
+ return false;
2538
+ return [
2539
+ 'plan_submitted',
2540
+ 'plan_progress_updated',
2541
+ 'plan_execution_completed',
2542
+ 'plan_execution_cancelled',
2543
+ ].includes(String(output.kind));
2544
+ }
2545
+ function isAgentGraphYieldToolResult(output) {
2546
+ if (output === null || typeof output !== 'object' || Array.isArray(output))
2547
+ return false;
2548
+ const result = output;
2549
+ return (Object.keys(result).length === 4 &&
2550
+ result.kind === 'agent_graph_yielded' &&
2551
+ typeof result.pendingWorkCount === 'number' &&
2552
+ Number.isSafeInteger(result.pendingWorkCount) &&
2553
+ result.pendingWorkCount > 0 &&
2554
+ typeof result.liveOperatorCount === 'number' &&
2555
+ Number.isSafeInteger(result.liveOperatorCount) &&
2556
+ result.liveOperatorCount >= 0 &&
2557
+ typeof result.reason === 'string' &&
2558
+ result.reason.length > 0 &&
2559
+ result.reason.length <= 4_000 &&
2560
+ result.reason.trim() === result.reason);
2561
+ }
2562
+ function priorReplayFailureTrace(replay) {
2563
+ return {
2564
+ gate: replay.gate,
2565
+ diagnosticCodes: [...new Set(replay.diagnostics.map((diagnostic) => diagnostic.code))],
2566
+ };
2567
+ }
2568
+ class ContinuationReplayEmptyError extends Error {
2569
+ replayGate;
2570
+ diagnosticCodes;
2571
+ code = 'continuation_replay_empty';
2572
+ constructor(replayGate, diagnosticCodes) {
2573
+ super(`Continuation replay is empty after ${replayGate}`);
2574
+ this.replayGate = replayGate;
2575
+ this.diagnosticCodes = diagnosticCodes;
2576
+ this.name = 'ContinuationReplayEmptyError';
2577
+ }
2578
+ }
2579
+ function mergeNormalizedUsage(current, next) {
2580
+ if (!current)
2581
+ return next;
2582
+ const cacheMissInputSource = current.cacheMissInputSource === 'explicit' || next.cacheMissInputSource === 'explicit'
2583
+ ? 'explicit'
2584
+ : 'derived';
2585
+ const cacheHitInputTokens = current.cacheHitInputTokens + next.cacheHitInputTokens;
2586
+ return {
2587
+ inputTokens: current.inputTokens + next.inputTokens,
2588
+ outputTokens: current.outputTokens + next.outputTokens,
2589
+ cacheHitInputTokens,
2590
+ cacheMissInputTokens: current.cacheMissInputTokens + next.cacheMissInputTokens,
2591
+ cacheMissInputSource,
2592
+ cacheWriteInputTokens: current.cacheWriteInputTokens + next.cacheWriteInputTokens,
2593
+ reasoningTokens: current.reasoningTokens + next.reasoningTokens,
2594
+ totalTokens: current.totalTokens + next.totalTokens,
2595
+ ...(next.rawFinishReason !== undefined ? { rawFinishReason: next.rawFinishReason } : {}),
2596
+ cachedInputTokens: cacheHitInputTokens,
2597
+ };
2598
+ }
2599
+ function projectMemoryConversationPrefix(messages, eventMessagePositions) {
2600
+ // Context visibility and durable evidence authority are separate boundaries.
2601
+ // Keep the exact source prefix so the auxiliary request preserves referents
2602
+ // and provider-cache shape. The Evidence Index and trusted admission layer
2603
+ // independently restrict durable citations to user-authored RuntimeEvents.
2604
+ return {
2605
+ messages: [...messages],
2606
+ ...(eventMessagePositions ? { eventMessagePositions } : {}),
2607
+ };
2608
+ }
2609
+ function memoryExtractionModelHeader(header) {
2610
+ return {
2611
+ ...(header.llmConnectionId === undefined ? {} : { llmConnectionId: header.llmConnectionId }),
2612
+ llmConnectionSlug: header.llmConnectionSlug,
2613
+ model: header.model,
2614
+ ...(header.thinkingLevel !== undefined ? { thinkingLevel: header.thinkingLevel } : {}),
2615
+ };
2616
+ }