maka-agent 0.2.1-dev.91.20261018 → 0.2.2-dev.97.20261024

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 (418) hide show
  1. package/DISCLAIMER-WIP +1 -1
  2. package/LICENSE +15 -11
  3. package/README.md +173 -1
  4. package/README.zh-CN.md +156 -0
  5. package/THIRD_PARTY_NOTICES.txt +12 -12
  6. package/dist/cli-core.js +1 -0
  7. package/dist/pi-goal.js +13 -0
  8. package/dist/pi-tui-runner.js +44 -1
  9. package/dist/run-command-core.js +256 -48
  10. package/dist/run-session-command.js +534 -0
  11. package/dist/run-session-result.js +38 -0
  12. package/dist/run-turn-outcome.js +174 -0
  13. package/dist/runtime-host-cli.js +32 -17
  14. package/dist/runtime-host-run-command.js +53 -165
  15. package/dist/runtime-host-run-mcp.js +3 -0
  16. package/dist/runtime-host-session-channel.js +3 -1
  17. package/dist/runtime-host-session-driver.js +5 -0
  18. package/dist/runtime-host-setup-command.js +114 -7
  19. package/dist/tui-copy-catalog.js +24 -0
  20. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  21. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Client.md +2 -0
  22. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/connect.js +10 -4
  23. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/symbols.js +1 -0
  24. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/agent.js +6 -2
  25. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  26. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  27. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +3 -2
  28. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  29. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +48 -0
  30. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  31. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  32. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +15 -5
  33. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/index.js +3 -1
  34. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/parse.js +138 -137
  35. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/util.js +21 -2
  36. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  37. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  38. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/fetch/index.js +3 -3
  39. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/infra/index.js +14 -0
  40. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  41. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  42. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
  43. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog-store.js +87 -0
  44. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog.js +98 -21
  45. package/node_modules/@maka/acp-executor-plugin/dist/index.js +90 -14
  46. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +3997 -56
  47. package/node_modules/@maka/core/dist/assistant-turn-ids.js +34 -0
  48. package/node_modules/@maka/core/dist/bot-chat-settings.js +10 -1
  49. package/node_modules/@maka/core/dist/event-wait-delivery.js +67 -0
  50. package/node_modules/@maka/core/dist/event-wait.js +75 -10
  51. package/node_modules/@maka/core/dist/executor-catalog.js +3 -1
  52. package/node_modules/@maka/core/dist/goal.js +54 -2
  53. package/node_modules/@maka/core/dist/model-catalog.js +19 -1
  54. package/node_modules/@maka/core/dist/model-metadata.generated.js +4 -14
  55. package/node_modules/@maka/core/dist/model-metadata.js +42 -1
  56. package/node_modules/@maka/core/dist/models-dev-projection.js +32 -1
  57. package/node_modules/@maka/core/dist/provider-registry.js +16 -2
  58. package/node_modules/@maka/core/dist/runtime-event-store.js +0 -1
  59. package/node_modules/@maka/core/dist/runtime-event.js +24 -2
  60. package/node_modules/@maka/core/dist/runtime-invocation.js +10 -0
  61. package/node_modules/@maka/core/dist/session-checkin.js +31 -0
  62. package/node_modules/@maka/core/dist/tool-ledger-scanner.js +1 -9
  63. package/node_modules/@maka/core/dist/tool-recovery-bundle.js +1 -14
  64. package/node_modules/@maka/core/dist/turn-origin.js +14 -2
  65. package/node_modules/@maka/core/dist/usage-stats/types.js +1 -0
  66. package/node_modules/@maka/core/package.json +3 -0
  67. package/node_modules/@maka/eval/node_modules/undici/README.md +25 -3
  68. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  69. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Client.md +11 -6
  70. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  71. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +76 -1
  72. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  73. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  74. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  75. package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +12 -12
  76. package/node_modules/@maka/eval/node_modules/undici/docs/docs/type-map.json +66 -66
  77. package/node_modules/@maka/eval/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  78. package/node_modules/@maka/eval/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  79. package/node_modules/@maka/eval/node_modules/undici/lib/core/connect.js +10 -4
  80. package/node_modules/@maka/eval/node_modules/undici/lib/core/constants.js +12 -1
  81. package/node_modules/@maka/eval/node_modules/undici/lib/core/errors.js +38 -1
  82. package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +16 -1
  83. package/node_modules/@maka/eval/node_modules/undici/lib/core/symbols.js +2 -0
  84. package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +26 -1
  85. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/agent.js +6 -2
  86. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  87. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  88. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +4 -1
  89. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  90. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  91. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  92. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  93. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +11 -8
  94. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  95. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  96. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  97. package/node_modules/@maka/eval/node_modules/undici/lib/handler/cache-handler.js +153 -15
  98. package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  99. package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  100. package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +44 -11
  101. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +11 -3
  102. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +22 -9
  103. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dns.js +11 -0
  104. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/response-error.js +72 -28
  105. package/node_modules/@maka/eval/node_modules/undici/lib/milo/LICENSE.md +7 -0
  106. package/node_modules/@maka/eval/node_modules/undici/lib/milo/no-simd.js +1002 -0
  107. package/node_modules/@maka/eval/node_modules/undici/lib/milo/simd.js +1002 -0
  108. package/node_modules/@maka/eval/node_modules/undici/lib/mock/mock-agent.js +11 -0
  109. package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  110. package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  111. package/node_modules/@maka/eval/node_modules/undici/lib/util/cache.js +11 -5
  112. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +19 -2
  113. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  114. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  115. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +47 -38
  116. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  117. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +2 -2
  118. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +8 -4
  119. package/node_modules/@maka/eval/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  120. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  121. package/node_modules/@maka/eval/node_modules/undici/package.json +9 -7
  122. package/node_modules/@maka/mcp/package.json +1 -1
  123. package/node_modules/@maka/runtime/dist/agent-run.js +5 -1
  124. package/node_modules/@maka/runtime/dist/agent-swarm-status-tool.js +0 -1
  125. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +29 -15
  126. package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +10 -1
  127. package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +125 -131
  128. package/node_modules/@maka/runtime/dist/bots/bot-registry.js +19 -3
  129. package/node_modules/@maka/runtime/dist/bots/feishu-bridge.js +178 -6
  130. package/node_modules/@maka/runtime/dist/bots/wechat-bridge.js +163 -9
  131. package/node_modules/@maka/runtime/dist/context-budget-policy.js +9 -2
  132. package/node_modules/@maka/runtime/dist/event-wait-tool.js +69 -0
  133. package/node_modules/@maka/runtime/dist/goal-continuation.js +195 -117
  134. package/node_modules/@maka/runtime/dist/goal-state.js +8 -0
  135. package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +34 -4
  136. package/node_modules/@maka/runtime/dist/history-compaction.js +7 -0
  137. package/node_modules/@maka/runtime/dist/memory-extraction.js +0 -2
  138. package/node_modules/@maka/runtime/dist/model-factory.js +26 -6
  139. package/node_modules/@maka/runtime/dist/model-fetcher.js +8 -1
  140. package/node_modules/@maka/runtime/dist/model-history.js +16 -3
  141. package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +15 -5
  142. package/node_modules/@maka/runtime/dist/plan-tools.js +0 -3
  143. package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +49 -2
  144. package/node_modules/@maka/runtime/dist/plugin-executor-service.js +12 -3
  145. package/node_modules/@maka/runtime/dist/provider-error-classification.js +2 -0
  146. package/node_modules/@maka/runtime/dist/recovery-resolver.js +2 -1
  147. package/node_modules/@maka/runtime/dist/runtime-context.js +53 -0
  148. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +3 -0
  149. package/node_modules/@maka/runtime/dist/sandbox-boundary-path.js +79 -2
  150. package/node_modules/@maka/runtime/dist/session-checkin.js +331 -0
  151. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +7 -0
  152. package/node_modules/@maka/runtime/dist/session-manager.js +5 -1
  153. package/node_modules/@maka/runtime/dist/shell-run-manager.js +34 -0
  154. package/node_modules/@maka/runtime/dist/stream-graph-supervisor-tools.js +0 -3
  155. package/node_modules/@maka/runtime/dist/telemetry/builtin-pricing.js +21 -2
  156. package/node_modules/@maka/runtime/dist/tool-runtime.js +11 -2
  157. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.mjs +50 -1
  158. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Client.md +2 -0
  159. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/connect.js +10 -4
  160. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/symbols.js +1 -0
  161. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/agent.js +6 -2
  162. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  163. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  164. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +3 -2
  165. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  166. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +48 -0
  167. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  168. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  169. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +15 -5
  170. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/index.js +3 -1
  171. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/parse.js +138 -137
  172. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/util.js +21 -2
  173. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  174. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  175. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/fetch/index.js +3 -3
  176. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/infra/index.js +14 -0
  177. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  178. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  179. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
  180. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +1 -1
  181. package/node_modules/@maka/runtime/node_modules/undici/README.md +25 -3
  182. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  183. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Client.md +11 -6
  184. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  185. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +76 -1
  186. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  187. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  188. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  189. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +12 -12
  190. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/type-map.json +66 -66
  191. package/node_modules/@maka/runtime/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  192. package/node_modules/@maka/runtime/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  193. package/node_modules/@maka/runtime/node_modules/undici/lib/core/connect.js +10 -4
  194. package/node_modules/@maka/runtime/node_modules/undici/lib/core/constants.js +12 -1
  195. package/node_modules/@maka/runtime/node_modules/undici/lib/core/errors.js +38 -1
  196. package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +16 -1
  197. package/node_modules/@maka/runtime/node_modules/undici/lib/core/symbols.js +2 -0
  198. package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +26 -1
  199. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/agent.js +6 -2
  200. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  201. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  202. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +4 -1
  203. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  204. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  205. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  206. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  207. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +11 -8
  208. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  209. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  210. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  211. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/cache-handler.js +153 -15
  212. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  213. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  214. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +44 -11
  215. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +11 -3
  216. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +22 -9
  217. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dns.js +11 -0
  218. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/response-error.js +72 -28
  219. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/LICENSE.md +7 -0
  220. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/no-simd.js +1002 -0
  221. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/simd.js +1002 -0
  222. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/mock-agent.js +11 -0
  223. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  224. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  225. package/node_modules/@maka/runtime/node_modules/undici/lib/util/cache.js +11 -5
  226. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +19 -2
  227. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  228. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  229. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +47 -38
  230. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  231. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +2 -2
  232. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +8 -4
  233. package/node_modules/@maka/runtime/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  234. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  235. package/node_modules/@maka/runtime/node_modules/undici/package.json +9 -7
  236. package/node_modules/@maka/runtime/package.json +3 -0
  237. package/node_modules/@maka/runtime-host/dist/assistant/bot/bridge.js +8 -0
  238. package/node_modules/@maka/runtime-host/dist/assistant/bot/capabilities.js +1 -0
  239. package/node_modules/@maka/runtime-host/dist/assistant/bot/controller.js +92 -22
  240. package/node_modules/@maka/runtime-host/dist/assistant/bot/host.js +11 -2
  241. package/node_modules/@maka/runtime-host/dist/assistant/bot/store.js +71 -2
  242. package/node_modules/@maka/runtime-host/dist/assistant/bot/turn-ids.js +38 -0
  243. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/assistant.js +7 -0
  244. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/controller.js +193 -32
  245. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/discovery-capabilities.js +69 -0
  246. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/host.js +15 -28
  247. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/notebook.js +286 -0
  248. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/prompt.js +31 -6
  249. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/store.js +18 -1
  250. package/node_modules/@maka/runtime-host/dist/assistant/memory-network/controller.js +203 -71
  251. package/node_modules/@maka/runtime-host/dist/assistant/memory-network/host.js +21 -5
  252. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-observer.js +94 -0
  253. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-store.js +253 -0
  254. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition.js +133 -0
  255. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/controller.js +27 -14
  256. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delegation.js +37 -5
  257. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delivery.js +1 -1
  258. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/host.js +16 -2
  259. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/matter.js +13 -0
  260. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/prompt.js +7 -5
  261. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/review.js +68 -14
  262. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/settlement-context.js +126 -0
  263. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/store.js +92 -6
  264. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/tools.js +93 -23
  265. package/node_modules/@maka/runtime-host/dist/assistant/service.js +72 -16
  266. package/node_modules/@maka/runtime-host/dist/client/host-profile.js +30 -1
  267. package/node_modules/@maka/runtime-host/dist/client/ssh-operator-activation.js +9 -2
  268. package/node_modules/@maka/runtime-host/dist/protocol/goal.js +119 -1
  269. package/node_modules/@maka/runtime-host/dist/protocol/index.js +10 -3
  270. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +8 -1
  271. package/node_modules/@maka/runtime-host/dist/protocol/personal-assistant.js +1 -0
  272. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +7 -1
  273. package/node_modules/@maka/runtime-host/dist/protocol/session-checkin.js +133 -0
  274. package/node_modules/@maka/runtime-host/dist/server/agent-settings-tools.js +0 -1
  275. package/node_modules/@maka/runtime-host/dist/server/canonical-session-projection.js +3 -2
  276. package/node_modules/@maka/runtime-host/dist/server/event-wait-manager.js +151 -20
  277. package/node_modules/@maka/runtime-host/dist/server/event-wait-observation-store.js +19 -0
  278. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +127 -11
  279. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +47 -3
  280. package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +11 -0
  281. package/node_modules/@maka/runtime-host/dist/server/external-session-coordinator.js +5 -2
  282. package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +343 -53
  283. package/node_modules/@maka/runtime-host/dist/server/goal-event-waits.js +457 -0
  284. package/node_modules/@maka/runtime-host/dist/server/goal-execution-coordinator.js +23 -6
  285. package/node_modules/@maka/runtime-host/dist/server/goal-projection.js +24 -3
  286. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-recovery.js +5 -1
  287. package/node_modules/@maka/runtime-host/dist/server/index.js +2 -0
  288. package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +44 -2
  289. package/node_modules/@maka/runtime-host/dist/server/personal-assistant-workspace.js +78 -0
  290. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +8 -0
  291. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +73 -3
  292. package/node_modules/@maka/runtime-host/dist/server/session-checkin.js +257 -0
  293. package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-coordinator.js +282 -0
  294. package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-publication.js +250 -0
  295. package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-access.js +166 -0
  296. package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-adapter.js +59 -0
  297. package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +4 -2
  298. package/node_modules/@maka/storage/dist/agent-run-store-contract.js +14 -3
  299. package/node_modules/@maka/storage/dist/agent-run-store.js +10 -0
  300. package/node_modules/@maka/storage/dist/codex-session-adapter.js +20 -3
  301. package/node_modules/@maka/storage/dist/context-offload-snapshot.js +2 -1
  302. package/node_modules/@maka/storage/dist/event-wait-authority.js +18 -1
  303. package/node_modules/@maka/storage/dist/event-wait-bridge.js +336 -0
  304. package/node_modules/@maka/storage/dist/execution-stores.js +39 -1
  305. package/node_modules/@maka/storage/dist/external-session-images.js +131 -0
  306. package/node_modules/@maka/storage/dist/external-session-importer.js +12 -2
  307. package/node_modules/@maka/storage/dist/goal-authority.js +2 -0
  308. package/node_modules/@maka/storage/dist/local-execution-persistence.js +27 -1
  309. package/node_modules/@maka/storage/dist/operational-state-store.js +1 -1
  310. package/node_modules/@maka/storage/dist/production-session-snapshot.js +14 -6
  311. package/node_modules/@maka/storage/dist/runtime-event-persistence.js +1 -0
  312. package/node_modules/@maka/storage/dist/session-bundle-policy.js +116 -16
  313. package/node_modules/@maka/storage/dist/session-checkpoint-publication-store.js +204 -0
  314. package/node_modules/@maka/storage/dist/session-store.js +37 -8
  315. package/node_modules/@maka/storage/dist/snapshot-operation-gate.js +65 -0
  316. package/node_modules/@maka/storage/dist/sqlite-context-offload-schema.js +3 -3
  317. package/node_modules/@maka/storage/dist/sqlite-context-offload-store.js +4 -2
  318. package/node_modules/@maka/storage/dist/sqlite-event-wait-authority.js +81 -8
  319. package/node_modules/@maka/storage/dist/sqlite-event-wait-bridge.js +94 -0
  320. package/node_modules/@maka/storage/dist/sqlite-reclamation-checkpoint.js +37 -0
  321. package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +7 -8
  322. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +38 -162
  323. package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +7 -4
  324. package/node_modules/@maka/storage/dist/tool-commit-validation.js +1 -1
  325. package/node_modules/@maka/storage/package.json +4 -0
  326. package/node_modules/@modelcontextprotocol/client/dist/index-B-4n9P0J.d.mts.map +1 -0
  327. package/node_modules/@modelcontextprotocol/client/dist/index-J2FaQ-KY.d.cts.map +1 -0
  328. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +76 -22
  329. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
  330. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
  331. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +76 -22
  332. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
  333. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
  334. package/node_modules/@modelcontextprotocol/client/dist/{src-oZBjf3U1.cjs → src-DpAS0jfg.cjs} +105 -8
  335. package/node_modules/@modelcontextprotocol/client/dist/{src-xKF0PJN-.mjs → src-WCy6ifGf.mjs} +88 -9
  336. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +1 -1
  337. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +1 -1
  338. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/package.json +2 -2
  339. package/node_modules/@modelcontextprotocol/client/package.json +5 -5
  340. package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
  341. package/node_modules/fast-uri/README.md +8 -0
  342. package/node_modules/fast-uri/index.js +98 -18
  343. package/node_modules/fast-uri/lib/utils.js +52 -0
  344. package/node_modules/fast-uri/package.json +1 -1
  345. package/node_modules/follow-redirects/index.js +10 -1
  346. package/node_modules/follow-redirects/package.json +1 -1
  347. package/node_modules/ip-address/README.md +104 -104
  348. package/node_modules/ip-address/dist/ipv4.js +7 -0
  349. package/node_modules/ip-address/dist/ipv6.js +7 -4
  350. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  351. package/node_modules/ip-address/package.json +2 -1
  352. package/node_modules/undici/README.md +25 -3
  353. package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  354. package/node_modules/undici/docs/docs/api/Client.md +11 -6
  355. package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  356. package/node_modules/undici/docs/docs/api/Errors.md +76 -1
  357. package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  358. package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  359. package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  360. package/node_modules/undici/docs/docs/index.md +12 -12
  361. package/node_modules/undici/docs/docs/type-map.json +66 -66
  362. package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  363. package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  364. package/node_modules/undici/lib/core/connect.js +10 -4
  365. package/node_modules/undici/lib/core/constants.js +12 -1
  366. package/node_modules/undici/lib/core/errors.js +38 -1
  367. package/node_modules/undici/lib/core/request.js +16 -1
  368. package/node_modules/undici/lib/core/symbols.js +2 -0
  369. package/node_modules/undici/lib/core/util.js +26 -1
  370. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  371. package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  372. package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  373. package/node_modules/undici/lib/dispatcher/client.js +4 -1
  374. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  375. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  376. package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  377. package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  378. package/node_modules/undici/lib/dispatcher/pool.js +11 -8
  379. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  380. package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  381. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  382. package/node_modules/undici/lib/handler/cache-handler.js +153 -15
  383. package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  384. package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  385. package/node_modules/undici/lib/handler/retry-handler.js +44 -11
  386. package/node_modules/undici/lib/interceptor/cache.js +11 -3
  387. package/node_modules/undici/lib/interceptor/decompress.js +22 -9
  388. package/node_modules/undici/lib/interceptor/dns.js +11 -0
  389. package/node_modules/undici/lib/interceptor/response-error.js +72 -28
  390. package/node_modules/undici/lib/milo/LICENSE.md +7 -0
  391. package/node_modules/undici/lib/milo/no-simd.js +1002 -0
  392. package/node_modules/undici/lib/milo/simd.js +1002 -0
  393. package/node_modules/undici/lib/mock/mock-agent.js +11 -0
  394. package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  395. package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  396. package/node_modules/undici/lib/util/cache.js +11 -5
  397. package/node_modules/undici/lib/web/cookies/util.js +19 -2
  398. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  399. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  400. package/node_modules/undici/lib/web/fetch/body.js +47 -38
  401. package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  402. package/node_modules/undici/lib/web/fetch/headers.js +2 -2
  403. package/node_modules/undici/lib/web/fetch/index.js +8 -4
  404. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  405. package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  406. package/node_modules/undici/package.json +9 -7
  407. package/node_modules/zod/package.json +1 -1
  408. package/node_modules/zod/v4/core/compile.cjs +8 -0
  409. package/node_modules/zod/v4/core/compile.js +8 -0
  410. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  411. package/node_modules/zod/v4/core/schemas.js +30 -0
  412. package/node_modules/zod/v4/core/util.cjs +15 -0
  413. package/node_modules/zod/v4/core/util.js +14 -0
  414. package/node_modules/zod/v4/core/versions.cjs +1 -1
  415. package/node_modules/zod/v4/core/versions.js +1 -1
  416. package/package.json +2 -2
  417. package/node_modules/@modelcontextprotocol/client/dist/index-D_CiY-T3.d.cts.map +0 -1
  418. package/node_modules/@modelcontextprotocol/client/dist/index-D_QDtbiv.d.mts.map +0 -1
@@ -0,0 +1,34 @@
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
+ /**
20
+ * Classifiers for the assistant conversation's bot-delivered turns.
21
+ *
22
+ * The Runtime Host mints these ids (runtime-host `assistant/bot/turn-ids.ts`)
23
+ * and the UI classifies the turns by them, so both sides share these
24
+ * predicates. Current ids use dashes; transcripts written before the dash form
25
+ * use colons, and both are recognized.
26
+ *
27
+ * Keep this module free of Node-only imports: the UI bundles it.
28
+ */
29
+ export function isAssistantInputTurnId(turnId) {
30
+ return turnId.startsWith('assistant-input-') || turnId.startsWith('assistant-input:');
31
+ }
32
+ export function isAssistantOutputTurnId(turnId) {
33
+ return turnId.startsWith('assistant-output-') || turnId.startsWith('assistant-output:');
34
+ }
@@ -94,7 +94,7 @@ export function mergeBotChatSettings(current, patch) {
94
94
  }
95
95
  export function normalizeBotChatSettings(settings, rawSettings) {
96
96
  return {
97
- messageHandling: rawSettings?.messageHandling === 'workhub' ? 'workhub' : 'task',
97
+ messageHandling: normalizeMessageHandling(rawSettings?.messageHandling) ?? 'task',
98
98
  channels: Object.fromEntries(BOT_PROVIDERS.map((provider) => {
99
99
  const rawChannel = rawSettings?.channels?.[provider];
100
100
  return [provider, normalizeBotChannel(provider, settings.channels[provider], rawChannel)];
@@ -112,6 +112,7 @@ function normalizeBotChannel(provider, channel, rawChannel) {
112
112
  const allowedUserIds = normalizeAllowedUserIds(channel.allowedUserIds);
113
113
  return {
114
114
  ...channel,
115
+ messageHandling: normalizeMessageHandling(channel.messageHandling),
115
116
  provider,
116
117
  connected,
117
118
  ...(allowedUserIds ? { allowedUserIds } : { allowedUserIds: undefined }),
@@ -244,3 +245,11 @@ export function parseAllowedUserIdsFromText(raw) {
244
245
  }
245
246
  return out;
246
247
  }
248
+ function normalizeMessageHandling(value) {
249
+ return value === 'task' || value === 'workhub' || value === 'assistant' ? value : undefined;
250
+ }
251
+ export function resolveBotMessageHandling(settings, provider) {
252
+ return (normalizeMessageHandling(settings.channels[provider]?.messageHandling) ??
253
+ normalizeMessageHandling(settings.messageHandling) ??
254
+ 'task');
255
+ }
@@ -0,0 +1,67 @@
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 { defineObjectShape, hasExactShape, isRecord } from './record-schema.js';
20
+ const shape = defineObjectShape()([
21
+ 'waitId',
22
+ 'deliveryKey',
23
+ 'sourceTurnId',
24
+ 'sourceToolCallId',
25
+ 'generation',
26
+ 'outcome',
27
+ 'resultDigest',
28
+ ], []);
29
+ export function decodeEventWaitProvenance(value) {
30
+ if (!isRecord(value) ||
31
+ !hasExactShape(value, shape) ||
32
+ typeof value.waitId !== 'string' ||
33
+ !/^[A-Za-z0-9_-]{1,128}$/.test(value.waitId) ||
34
+ value.deliveryKey !== `event-wait/${value.waitId}` ||
35
+ typeof value.sourceTurnId !== 'string' ||
36
+ !/^[A-Za-z0-9_-]{1,128}$/.test(value.sourceTurnId) ||
37
+ typeof value.sourceToolCallId !== 'string' ||
38
+ !value.sourceToolCallId ||
39
+ new TextEncoder().encode(value.sourceToolCallId).byteLength > 512 ||
40
+ !Number.isSafeInteger(value.generation) ||
41
+ value.generation < 0 ||
42
+ !['satisfied', 'invalidated', 'source_unavailable', 'expired'].includes(value.outcome) ||
43
+ typeof value.resultDigest !== 'string' ||
44
+ !/^sha256:[a-f0-9]{64}$/.test(value.resultDigest)) {
45
+ throw new TypeError('Invalid event wait provenance');
46
+ }
47
+ return Object.freeze({
48
+ waitId: value.waitId,
49
+ deliveryKey: value.deliveryKey,
50
+ sourceTurnId: value.sourceTurnId,
51
+ sourceToolCallId: value.sourceToolCallId,
52
+ generation: value.generation,
53
+ outcome: value.outcome,
54
+ resultDigest: value.resultDigest,
55
+ });
56
+ }
57
+ export function sameEventWaitProvenance(a, b) {
58
+ if (!a || !b)
59
+ return a === b;
60
+ return (a.waitId === b.waitId &&
61
+ a.deliveryKey === b.deliveryKey &&
62
+ a.sourceTurnId === b.sourceTurnId &&
63
+ a.sourceToolCallId === b.sourceToolCallId &&
64
+ a.generation === b.generation &&
65
+ a.outcome === b.outcome &&
66
+ a.resultDigest === b.resultDigest);
67
+ }
@@ -167,6 +167,13 @@ export function eventWaitDeliveryKey(waitId) {
167
167
  }
168
168
  /** Correlation only: decoding does not authenticate Goal ownership or external truth. */
169
169
  export function decodeEventWaitRecord(value) {
170
+ return decodeWaitRecord(value, true);
171
+ }
172
+ /** Owner-free observation record. Ownership is checked by the supplied store and authorizer. */
173
+ export function decodeObservedEventWaitRecord(value) {
174
+ return decodeWaitRecord(value, false);
175
+ }
176
+ function decodeWaitRecord(value, goal) {
170
177
  const root = object(json(value, EVENT_WAIT_LIMITS.recordBytes, 16, 2048), 'record');
171
178
  const lifecycleKeys = root.status === 'waiting'
172
179
  ? []
@@ -181,7 +188,7 @@ export function decodeEventWaitRecord(value) {
181
188
  'schemaVersion',
182
189
  'waitId',
183
190
  'sessionId',
184
- 'goalControlLease',
191
+ ...(goal ? ['goalControlLease'] : []),
185
192
  'sourceTurnId',
186
193
  'sourceToolCallId',
187
194
  'resource',
@@ -192,10 +199,12 @@ export function decodeEventWaitRecord(value) {
192
199
  'deadlineAt',
193
200
  'status',
194
201
  ...lifecycleKeys,
195
- ], root.status === 'cancelled' ? ['priorResolution', 'observation'] : ['observation']);
202
+ ], root.status === 'cancelled'
203
+ ? ['priorResolution', 'observation', 'delivery']
204
+ : ['observation', 'delivery']);
196
205
  if (r.schemaVersion !== EVENT_WAIT_SCHEMA_VERSION)
197
206
  invalid('schemaVersion');
198
- const lease = shape(r.goalControlLease, ['goalId', 'generation']);
207
+ const lease = goal ? shape(r.goalControlLease, ['goalId', 'generation']) : undefined;
199
208
  const resource = shape(r.resource, ['providerId', 'connectionId', 'resourceType', 'resourceId']);
200
209
  const condition = shape(r.condition, ['typeId', 'version', 'parameters']);
201
210
  const parameters = object(json(condition.parameters, EVENT_WAIT_LIMITS.parameterBytes, EVENT_WAIT_LIMITS.parameterDepth, EVENT_WAIT_LIMITS.parameterNodes), 'parameters');
@@ -203,10 +212,14 @@ export function decodeEventWaitRecord(value) {
203
212
  schemaVersion: EVENT_WAIT_SCHEMA_VERSION,
204
213
  waitId: id(r.waitId, 'waitId'),
205
214
  sessionId: id(r.sessionId, 'sessionId'),
206
- goalControlLease: {
207
- goalId: id(lease.goalId, 'goalId'),
208
- generation: integer(lease.generation, 'generation'),
209
- },
215
+ ...(lease
216
+ ? {
217
+ goalControlLease: {
218
+ goalId: id(lease.goalId, 'goalId'),
219
+ generation: integer(lease.generation, 'generation'),
220
+ },
221
+ }
222
+ : {}),
210
223
  sourceTurnId: id(r.sourceTurnId, 'sourceTurnId'),
211
224
  sourceToolCallId: text(r.sourceToolCallId, 'sourceToolCallId', EVENT_WAIT_LIMITS.toolCallIdBytes),
212
225
  resource: {
@@ -235,6 +248,40 @@ export function decodeEventWaitRecord(value) {
235
248
  invalid('lifecycle time');
236
249
  return result;
237
250
  };
251
+ if (r.delivery !== undefined) {
252
+ const d = object(r.delivery, 'delivery');
253
+ if (r.status === 'waiting')
254
+ invalid('delivery before resolution');
255
+ const terminalAt = r.status === 'resolved' ? r.resolvedAt : r.status === 'expired' ? r.expiredAt : r.cancelledAt;
256
+ if (time(d.at) < time(terminalAt))
257
+ invalid('delivery before terminal fact');
258
+ if (d.kind === 'admitted') {
259
+ shape(d, ['kind', 'turnId', 'runId', 'userMessageId', 'at']);
260
+ if (r.status !== 'resolved' && r.status !== 'expired')
261
+ invalid('admission without result');
262
+ Object.assign(base, {
263
+ delivery: {
264
+ kind: 'admitted',
265
+ turnId: id(d.turnId, 'delivery turn'),
266
+ runId: id(d.runId, 'delivery run'),
267
+ userMessageId: id(d.userMessageId, 'delivery message'),
268
+ at: time(d.at),
269
+ },
270
+ });
271
+ }
272
+ else {
273
+ shape(d, ['kind', 'at', 'reason']);
274
+ if (d.kind !== 'suppressed')
275
+ invalid('delivery kind');
276
+ Object.assign(base, {
277
+ delivery: {
278
+ kind: 'suppressed',
279
+ at: time(d.at),
280
+ reason: text(d.reason, 'delivery reason', EVENT_WAIT_LIMITS.reasonBytes),
281
+ },
282
+ });
283
+ }
284
+ }
238
285
  if (Object.hasOwn(r, 'observation')) {
239
286
  const x = shape(r.observation, [
240
287
  'schemaVersion',
@@ -344,16 +391,34 @@ export function decodeEventWaitRecord(value) {
344
391
  }
345
392
  }
346
393
  export function assertEventWaitTransition(previous, next) {
347
- const a = decodeEventWaitRecord(previous);
348
- const b = decodeEventWaitRecord(next);
394
+ const a = decodeEventWaitRecord(previous), b = decodeEventWaitRecord(next);
395
+ if (JSON.stringify(a.goalControlLease) !== JSON.stringify(b.goalControlLease))
396
+ invalid('immutable goalControlLease');
397
+ const { goalControlLease: _a, ...before } = a;
398
+ const { goalControlLease: _b, ...after } = b;
399
+ assertObservedEventWaitTransition(before, after);
400
+ }
401
+ export function assertObservedEventWaitTransition(previous, next) {
402
+ const a = decodeObservedEventWaitRecord(previous);
403
+ const b = decodeObservedEventWaitRecord(next);
349
404
  const same = (x, y) => JSON.stringify(x) === JSON.stringify(y);
350
405
  if (same(a, b))
351
406
  return;
407
+ if (a.delivery)
408
+ invalid('immutable delivery');
409
+ if (b.delivery) {
410
+ const { delivery: _delivery, updatedAt: _updatedAt, ...rest } = b;
411
+ const { updatedAt: _previousTime, ...prior } = a;
412
+ if (same(rest, prior) && b.updatedAt >= a.updatedAt)
413
+ return;
414
+ const { delivery: _acknowledgement, ...observation } = b;
415
+ assertObservedEventWaitTransition(a, observation);
416
+ return;
417
+ }
352
418
  for (const field of [
353
419
  'schemaVersion',
354
420
  'waitId',
355
421
  'sessionId',
356
- 'goalControlLease',
357
422
  'sourceTurnId',
358
423
  'sourceToolCallId',
359
424
  'resource',
@@ -70,7 +70,8 @@ export function normalizeCatalogEntry(value, id) {
70
70
  !isExecutorConfiguration({ mode: value.currentMode }) ||
71
71
  typeof value.supportsAttachments !== 'boolean' ||
72
72
  typeof value.supportsModelChange !== 'boolean' ||
73
- (value.supportsModeChange !== undefined && typeof value.supportsModeChange !== 'boolean'))
73
+ (value.supportsModeChange !== undefined && typeof value.supportsModeChange !== 'boolean') ||
74
+ (value.refreshFailed !== undefined && typeof value.refreshFailed !== 'boolean'))
74
75
  throw new TypeError('Executor catalog is invalid');
75
76
  const usedModels = new Set();
76
77
  const groupIds = new Set();
@@ -127,6 +128,7 @@ export function normalizeCatalogEntry(value, id) {
127
128
  ...(value.currentMode !== undefined ? { currentMode: value.currentMode } : {}),
128
129
  supportsAttachments: value.supportsAttachments,
129
130
  supportsModelChange: value.supportsModelChange,
131
+ ...(value.refreshFailed !== undefined ? { refreshFailed: value.refreshFailed } : {}),
130
132
  ...(value.supportsModeChange !== undefined
131
133
  ? { supportsModeChange: value.supportsModeChange }
132
134
  : {}),
@@ -16,6 +16,7 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ import { decodeEventWaitProvenance } from './event-wait-delivery.js';
19
20
  import { defineObjectShape, hasExactShape, isRecord } from './record-schema.js';
20
21
  export const GOAL_STATUSES = [
21
22
  'active',
@@ -68,8 +69,8 @@ const GOAL_CONTROL_LEASE_SHAPE = defineObjectShape()(['goalId', 'generation'], [
68
69
  const GOAL_EXECUTION_REF_SHAPE = defineObjectShape()(['sessionId', 'turnId', 'runId'], []);
69
70
  const GOAL_CHECKPOINT_SHAPE = defineObjectShape()(['goalId', 'revision'], []);
70
71
  const GOAL_CURRENT_EXECUTION_SHAPE = defineObjectShape()(['execution', 'checkpoint', 'controlLease'], []);
71
- const GOAL_PENDING_CONTINUATION_SHAPE = defineObjectShape()(['checkpoint', 'controlLease', 'prompt'], ['triggeringTurnId']);
72
- const GOAL_AUTHORITY_RECORD_SHAPE = defineObjectShape()(['schemaVersion', 'goal', 'controlLease', 'currentExecution', 'pendingContinuation'], []);
72
+ const GOAL_PENDING_CONTINUATION_SHAPE = defineObjectShape()(['checkpoint', 'controlLease', 'prompt'], ['triggeringTurnId', 'eventWait']);
73
+ const GOAL_AUTHORITY_RECORD_SHAPE = defineObjectShape()(['schemaVersion', 'goal', 'controlLease', 'currentExecution', 'pendingContinuation'], ['activeEventWait']);
73
74
  const GOAL_AUTHORITY_RECORD_V1_SHAPE = defineObjectShape()(['schemaVersion', 'goal', 'controlLease', 'currentExecution'], []);
74
75
  const GOAL_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
75
76
  export function decodeGoalAuthorityRecord(value) {
@@ -94,12 +95,27 @@ export function decodeGoalAuthorityRecord(value) {
94
95
  if (controlLease.goalId !== goal.id) {
95
96
  throw new TypeError('Goal control lease does not match Goal identity');
96
97
  }
98
+ const activeEventWait = value.activeEventWait === undefined
99
+ ? undefined
100
+ : decodeActiveEventWait(value.activeEventWait, goal, controlLease);
101
+ if (activeEventWait && !['active', 'waiting'].includes(goal.status))
102
+ throw new TypeError('Terminal Goal cannot retain an event wait gate');
103
+ if (pendingContinuation?.eventWait &&
104
+ (!activeEventWait?.settled ||
105
+ activeEventWait.waitId !== pendingContinuation.eventWait.provenance.waitId ||
106
+ activeEventWait.sourceExecution.turnId !==
107
+ pendingContinuation.eventWait.provenance.sourceTurnId ||
108
+ pendingContinuation.triggeringTurnId !== activeEventWait.sourceExecution.turnId))
109
+ throw new TypeError('Event continuation does not match its settled wait gate');
110
+ if (activeEventWait && pendingContinuation && !pendingContinuation.eventWait)
111
+ throw new TypeError('Explicit wait excludes ordinary continuation');
97
112
  return Object.freeze({
98
113
  schemaVersion: 1,
99
114
  goal,
100
115
  controlLease,
101
116
  currentExecution,
102
117
  pendingContinuation,
118
+ ...(activeEventWait ? { activeEventWait } : {}),
103
119
  });
104
120
  }
105
121
  function decodeGoalPendingContinuation(value, goal, authorityLease) {
@@ -122,9 +138,45 @@ function decodeGoalPendingContinuation(value, goal, authorityLease) {
122
138
  checkpoint,
123
139
  controlLease,
124
140
  prompt: value.prompt,
141
+ ...(value.eventWait === undefined
142
+ ? {}
143
+ : { eventWait: decodeEventContinuation(value.eventWait, goal, controlLease) }),
125
144
  ...(value.triggeringTurnId !== undefined ? { triggeringTurnId: value.triggeringTurnId } : {}),
126
145
  });
127
146
  }
147
+ function decodeActiveEventWait(value, goal, lease) {
148
+ if (!isRecord(value) ||
149
+ Object.keys(value).sort().join() !== 'controlLease,reason,settled,sourceExecution,waitId' ||
150
+ !isGoalId(value.waitId) ||
151
+ typeof value.reason !== 'string' ||
152
+ !value.reason.trim() ||
153
+ !isGoalTextWithinLimit(value.reason, GOAL_REASON_TEXT_LIMIT) ||
154
+ typeof value.settled !== 'boolean') {
155
+ throw new TypeError('Invalid active event wait');
156
+ }
157
+ const sourceExecution = decodeGoalExecutionRef(value.sourceExecution);
158
+ const controlLease = decodeGoalControlLease(value.controlLease);
159
+ if (sourceExecution.sessionId !== goal.sessionId || !sameGoalControlLease(controlLease, lease))
160
+ throw new TypeError('Event wait does not own the Goal');
161
+ return Object.freeze({
162
+ waitId: value.waitId,
163
+ sourceExecution,
164
+ controlLease,
165
+ reason: value.reason,
166
+ settled: value.settled,
167
+ });
168
+ }
169
+ function decodeEventContinuation(value, goal, lease) {
170
+ if (!isRecord(value) ||
171
+ Object.keys(value).sort().join() !== 'execution,provenance,userMessageId' ||
172
+ !isGoalId(value.userMessageId))
173
+ throw new TypeError('Invalid event continuation');
174
+ const execution = decodeGoalExecutionRef(value.execution);
175
+ const provenance = decodeEventWaitProvenance(value.provenance);
176
+ if (execution.sessionId !== goal.sessionId || provenance.generation !== lease.generation)
177
+ throw new TypeError('Event continuation does not own the Goal');
178
+ return Object.freeze({ execution, userMessageId: value.userMessageId, provenance });
179
+ }
128
180
  function decodeGoalState(value) {
129
181
  if (!isRecord(value) || !hasExactShape(value, GOAL_STATE_SHAPE)) {
130
182
  throw new TypeError('Invalid Goal state');
@@ -19,6 +19,7 @@
19
19
  import { applyModelOverride, defaultThinkingLevelForConnection, resolveModelLimits, } from './model-thinking.js';
20
20
  import { CODEX_SUBSCRIPTION_UNSUPPORTED_CHATGPT_MODELS, PROVIDER_REGISTRY, providerDefaultsOf, providerFallbackModelIds, providerSupportsModelDiscovery, } from './llm-connections.js';
21
21
  import { isRetiredProvider } from './provider-retirement.js';
22
+ import { MINIMAX_TEXT_MODEL_IDS } from './models-dev-projection.js';
22
23
  import { lookupModelMetadata, resolveModelVisionSupport } from './model-metadata.js';
23
24
  import { thinkingVariantsForConnection, } from './model-thinking.js';
24
25
  export function buildModelCatalogEntries(input) {
@@ -30,13 +31,30 @@ export function buildModelCatalogEntries(input) {
30
31
  // shape of a failed or not-yet-run discovery. It must not hide the static
31
32
  // fallback catalog from the picker. An empty fetched array is different: it
32
33
  // is an authoritative provider response and should remain empty.
33
- const rawModels = liveModels !== undefined && (liveModels.length > 0 || modelSource === 'fetched')
34
+ let rawModels = liveModels !== undefined && (liveModels.length > 0 || modelSource === 'fetched')
34
35
  ? liveModels
35
36
  : (input.fallbackModels ?? []).map((id) => ({
36
37
  id,
37
38
  ...displayNameForKnownModel(input.providerType, id),
38
39
  }));
39
40
  const savedModelIds = normalizedIdSet(input.savedModelIds);
41
+ if (input.providerType === 'MiniMax' || input.providerType === 'MiniMax-cn') {
42
+ // Discovery can lag a release. Keep the current direct text pair first,
43
+ // preserving custom/non-text entries and restoring saved legacy IDs below.
44
+ const discovered = new Map(rawModels.map((model) => [model.id, model]));
45
+ rawModels = [
46
+ ...MINIMAX_TEXT_MODEL_IDS.map((id) => ({
47
+ ...discovered.get(id),
48
+ id,
49
+ ...lookupModelMetadata(input.providerType, id),
50
+ })),
51
+ ...rawModels.filter((model) => !MINIMAX_TEXT_MODEL_IDS.some((id) => id === model.id) &&
52
+ (!/^MiniMax-(?:M1|M2|Text)(?:[.-]|$)/i.test(model.id) ||
53
+ model.id === normalizedDefaultModel ||
54
+ savedModelIds.has(model.id) ||
55
+ (model.modalities?.output && !model.modalities.output.includes('text')))),
56
+ ];
57
+ }
40
58
  const ctx = { input, normalizedDefaultModel };
41
59
  const seen = new Set();
42
60
  const entries = rawModels
@@ -597,22 +597,12 @@ export const GENERATED_MODELS_DEV_METADATA = {
597
597
  "kimi-for-coding-highspeed": { "displayName": "Kimi For Coding HighSpeed", "description": "Lower-latency Kimi Code variant for interactive edits and coding-agent loops", "lifecycle": "active", "contextWindow": 262144, "maxOutputTokens": 32768, "knowledgeCutoff": "2025-01", "structuredOutput": true, "lastUpdated": "2026-06-12", "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] } },
598
598
  },
599
599
  "MiniMax": {
600
- "MiniMax-M2": { "displayName": "MiniMax-M2", "description": "Efficient open MiniMax model built for coding agents and tool-heavy workflows", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2025-10-27", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
601
- "MiniMax-M2.1": { "displayName": "MiniMax-M2.1", "description": "Earlier MiniMax agent model for practical coding and productivity tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2025-12-23", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
602
- "MiniMax-M2.5": { "displayName": "MiniMax-M2.5", "description": "Prior MiniMax coding model for agent workflows, office edits, and automation", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-02-12", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
603
- "MiniMax-M2.5-highspeed": { "displayName": "MiniMax-M2.5-highspeed", "description": "High-speed MiniMax model for low-latency coding and agent workflows", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-02-13", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
604
- "MiniMax-M2.7": { "displayName": "MiniMax-M2.7", "description": "Open MiniMax flagship for coding agents, office automation, and complex environments", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-03-18", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
605
- "MiniMax-M2.7-highspeed": { "displayName": "MiniMax-M2.7-highspeed", "description": "Low-latency M2.7 variant for interactive coding plans and agent loops", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-03-18", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
606
- "MiniMax-M3": { "displayName": "MiniMax-M3", "description": "MiniMax multimodal model for long-context coding, perception, and agent planning", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 512000, "lastUpdated": "2026-06-25", "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "thinkingOptions": { "toggle": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] } },
600
+ "MiniMax-M3.1-Flash": { "displayName": "MiniMax-M3.1-Flash", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 524288, "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, "thinkingOptions": { "efforts": ["low", "medium", "high", "xhigh", "max"] } },
601
+ "MiniMax-M3": { "displayName": "MiniMax-M3", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 524288, "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, "thinkingOptions": { "toggle": true } },
607
602
  },
608
603
  "MiniMax-cn": {
609
- "MiniMax-M2": { "displayName": "MiniMax-M2", "description": "MiniMax model for chat, coding, office work, and agentic tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2025-10-27", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
610
- "MiniMax-M2.1": { "displayName": "MiniMax-M2.1", "description": "MiniMax model for chat, coding, office work, and agentic tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2025-12-23", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
611
- "MiniMax-M2.5": { "displayName": "MiniMax-M2.5", "description": "MiniMax model for chat, coding, office work, and agentic tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-02-12", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
612
- "MiniMax-M2.5-highspeed": { "displayName": "MiniMax-M2.5-highspeed", "description": "High-speed MiniMax model for low-latency coding and agent workflows", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-02-13", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
613
- "MiniMax-M2.7": { "displayName": "MiniMax-M2.7", "description": "MiniMax model for chat, coding, office work, and agentic tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-03-18", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
614
- "MiniMax-M2.7-highspeed": { "displayName": "MiniMax-M2.7-highspeed", "description": "High-speed MiniMax model for low-latency coding and agent workflows", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2026-03-18", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
615
- "MiniMax-M3": { "displayName": "MiniMax-M3", "description": "MiniMax multimodal coding model for long-context reasoning and agent tasks", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 512000, "lastUpdated": "2026-06-25", "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "thinkingOptions": { "toggle": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] } },
604
+ "MiniMax-M3.1-Flash": { "displayName": "MiniMax-M3.1-Flash", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 524288, "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, "thinkingOptions": { "efforts": ["low", "medium", "high", "xhigh", "max"] } },
605
+ "MiniMax-M3": { "displayName": "MiniMax-M3", "lifecycle": "active", "contextWindow": 1000000, "maxOutputTokens": 524288, "capabilities": { "vision": true, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, "thinkingOptions": { "toggle": true } },
616
606
  },
617
607
  "minimax-coding-plan": {
618
608
  "MiniMax-M2": { "displayName": "MiniMax-M2", "description": "MiniMax model for chat, coding, office work, and agentic tasks", "lifecycle": "active", "contextWindow": 204800, "maxOutputTokens": 131072, "lastUpdated": "2025-10-27", "capabilities": { "vision": false, "reasoning": true, "functionCalling": true }, "modalities": { "input": ["text"], "output": ["text"] } },
@@ -16,6 +16,7 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ import { withMiniMaxTextCatalog } from './models-dev-projection.js';
19
20
  import { GENERATED_MODELS_DEV_METADATA, GENERATED_MODELS_DEV_MODEL_PROVIDER_OVERRIDES, } from './model-metadata.generated.js';
20
21
  /**
21
22
  * What this build shipped, before any refresh. Read it to compare a refresh
@@ -36,7 +37,7 @@ let refreshedMetadata;
36
37
  export function installRefreshedModelMetadata(metadata) {
37
38
  if (metadata !== undefined)
38
39
  assertWireTokenLimits(metadata);
39
- refreshedMetadata = metadata;
40
+ refreshedMetadata = metadata === undefined ? undefined : withMiniMaxTextCatalog(metadata);
40
41
  }
41
42
  /**
42
43
  * The wire carries a token limit only as a positive integer
@@ -431,6 +432,11 @@ const COMMAND_CODE_MODEL_METADATA = {
431
432
  // 1.51.1–1.51.3 changelog had not been published at extraction time).
432
433
  'MiniMaxAI/MiniMax-M3': { thinkingOptions: { efforts: ['low', 'medium', 'high'] } },
433
434
  };
435
+ const MINIMAX_MODEL_OVERRIDES = {
436
+ 'MiniMax-M3': {
437
+ thinkingOptions: { toggle: true, offBehavior: 'anthropic-thinking-disabled' },
438
+ },
439
+ };
434
440
  // Facts that models.dev cannot express: provider wire controls and
435
441
  // access-path-specific aliases/limits. Standard model facts stay generated.
436
442
  //
@@ -438,6 +444,8 @@ const COMMAND_CODE_MODEL_METADATA = {
438
444
  // derived from a provider's catalog cover models a refresh introduced.
439
445
  function buildStaticModelMetadata(active) {
440
446
  return {
447
+ MiniMax: MINIMAX_MODEL_OVERRIDES,
448
+ 'MiniMax-cn': MINIMAX_MODEL_OVERRIDES,
441
449
  anthropic: ANTHROPIC_MODEL_OVERRIDES,
442
450
  opencode: {
443
451
  'claude-sonnet-4-5': {
@@ -448,6 +456,39 @@ function buildStaticModelMetadata(active) {
448
456
  },
449
457
  },
450
458
  openai: OPENAI_GPT6_MODEL_OVERRIDES,
459
+ // Inception is absent from the models.dev snapshot. Bootstrap chat facts
460
+ // from https://docs.inceptionlabs.ai/get-started/models and
461
+ // https://docs.inceptionlabs.ai/capabilities/reasoning-efforts.
462
+ // `instant` has no Maka thinking level; expose only the shared effort tiers.
463
+ inception: {
464
+ 'mercury-3': {
465
+ displayName: 'Mercury 3',
466
+ contextWindow: 1_000_000,
467
+ maxOutputTokens: 131_072,
468
+ structuredOutput: true,
469
+ modalities: { input: ['text'], output: ['text'] },
470
+ capabilities: { vision: false, reasoning: true, functionCalling: true },
471
+ thinkingOptions: { efforts: ['low', 'medium', 'high'] },
472
+ },
473
+ 'mercury-2.5': {
474
+ displayName: 'Mercury 2.5',
475
+ contextWindow: 260_000,
476
+ maxOutputTokens: 65_536,
477
+ structuredOutput: true,
478
+ modalities: { input: ['text'], output: ['text'] },
479
+ capabilities: { vision: false, reasoning: true, functionCalling: true },
480
+ thinkingOptions: { efforts: ['low', 'medium', 'high'] },
481
+ },
482
+ 'mercury-2': {
483
+ displayName: 'Mercury 2',
484
+ contextWindow: 128_000,
485
+ maxOutputTokens: 50_000,
486
+ structuredOutput: true,
487
+ modalities: { input: ['text'], output: ['text'] },
488
+ capabilities: { vision: false, reasoning: true, functionCalling: true },
489
+ thinkingOptions: { efforts: ['low', 'medium', 'high'] },
490
+ },
491
+ },
451
492
  'claude-subscription': claudeSubscriptionModelMetadata(active),
452
493
  // The Command Code Provider-API plan rides the same effort table.
453
494
  commandcode: COMMAND_CODE_MODEL_METADATA,
@@ -17,6 +17,37 @@
17
17
  * under the License.
18
18
  */
19
19
  export const MODELS_DEV_SOURCE_URL = 'https://models.dev/api.json';
20
+ // Direct API release facts take precedence over the lagging models.dev catalog.
21
+ // https://platform.minimax.io/docs/guides/models-intro.md
22
+ // https://platform.minimax.io/docs/api-reference/text-chat-anthropic.md
23
+ export const MINIMAX_TEXT_MODEL_IDS = ['MiniMax-M3.1-Flash', 'MiniMax-M3'];
24
+ const MINIMAX_TEXT_METADATA = Object.fromEntries(MINIMAX_TEXT_MODEL_IDS.map((id) => [
25
+ id,
26
+ {
27
+ displayName: id,
28
+ lifecycle: 'active',
29
+ contextWindow: 1_000_000,
30
+ maxOutputTokens: 524_288,
31
+ capabilities: { vision: true, reasoning: true, functionCalling: true },
32
+ modalities: { input: ['text', 'image', 'video'], output: ['text'] },
33
+ thinkingOptions: id === 'MiniMax-M3.1-Flash'
34
+ ? { efforts: ['low', 'medium', 'high', 'xhigh', 'max'] }
35
+ : { toggle: true },
36
+ },
37
+ ]));
38
+ /** Preserve non-text catalogs; this policy never touches saved connection models. */
39
+ export function withMiniMaxTextCatalog(metadata) {
40
+ const result = { ...metadata };
41
+ for (const providerType of ['MiniMax', 'MiniMax-cn']) {
42
+ if (!metadata[providerType])
43
+ continue;
44
+ result[providerType] = {
45
+ ...MINIMAX_TEXT_METADATA,
46
+ ...Object.fromEntries(Object.entries(metadata[providerType]).filter(([, model]) => model.modalities?.output && !model.modalities.output.includes('text'))),
47
+ };
48
+ }
49
+ return result;
50
+ }
20
51
  /** Every provider access path Maka serves, and the models.dev provider it reads. */
21
52
  export const MODELS_DEV_PROVIDERS = {
22
53
  anthropic: 'anthropic',
@@ -138,7 +169,7 @@ export function projectModelsDevMetadata(catalog) {
138
169
  .sort(([left], [right]) => left.localeCompare(right))
139
170
  .map(([id, model]) => [id, projectModelsDevModel(sourceId, id, provider, model)]));
140
171
  }
141
- return metadata;
172
+ return withMiniMaxTextCatalog(metadata);
142
173
  }
143
174
  export function projectModelsDevModel(providerId, modelId, provider, model) {
144
175
  if (typeof provider.doc !== 'string' ||
@@ -588,6 +588,20 @@ const providerRegistry = {
588
588
  signupUrl: 'https://platform.openai.com/api-keys',
589
589
  catalogOrder: 10,
590
590
  },
591
+ inception: {
592
+ label: 'Inception',
593
+ baseUrl: 'https://api.inceptionlabs.ai/v1',
594
+ authKind: 'api_key',
595
+ fallbackModels: ['mercury-3', 'mercury-2.5', 'mercury-2'],
596
+ status: 'ready',
597
+ runtimeAdapter: { kind: 'openai-compatible' },
598
+ // The general /models list also includes non-chat Edit and Decide models.
599
+ modelDiscovery: { kind: 'protocol', path: 'chat/completions/models' },
600
+ category: 'overseas',
601
+ catalogGroup: 'api',
602
+ signupUrl: 'https://platform.inceptionlabs.ai',
603
+ catalogOrder: 10.5,
604
+ },
591
605
  google: {
592
606
  label: 'Google Gemini',
593
607
  menuLabel: 'Google',
@@ -671,7 +685,7 @@ const providerRegistry = {
671
685
  label: 'MiniMax',
672
686
  baseUrl: 'https://api.minimax.io/anthropic/v1',
673
687
  authKind: 'api_key',
674
- fallbackModels: ['MiniMax-M3', 'MiniMax-M2.7'],
688
+ fallbackModels: ['MiniMax-M3.1-Flash', 'MiniMax-M3'],
675
689
  status: 'ready',
676
690
  runtimeAdapter: { kind: 'anthropic', auth: 'bearer', normalizeBaseUrl: false },
677
691
  modelDiscovery: { kind: 'protocol' },
@@ -684,7 +698,7 @@ const providerRegistry = {
684
698
  label: 'MiniMax 中国站',
685
699
  baseUrl: 'https://api.minimaxi.com/anthropic/v1',
686
700
  authKind: 'api_key',
687
- fallbackModels: ['MiniMax-M3', 'MiniMax-M2.7'],
701
+ fallbackModels: ['MiniMax-M3.1-Flash', 'MiniMax-M3'],
688
702
  status: 'ready',
689
703
  runtimeAdapter: { kind: 'anthropic', auth: 'bearer', normalizeBaseUrl: false },
690
704
  modelDiscovery: { kind: 'protocol' },
@@ -18,7 +18,6 @@
18
18
  */
19
19
  import { runtimeHandoffPause } from './runtime-handoff.js';
20
20
  import { mayBeTranscriptLedgerInvocationId, } from './runtime-invocation.js';
21
- export const TOOL_RECOVERY_BUNDLE_CAPABILITY_V1 = 'tool_recovery_bundle_v1';
22
21
  export const RUNTIME_CONTINUATION_AUTHORITY_V1 = 'runtime_continuation_authority_v1';
23
22
  export function runtimeInvocationRecoveryInventoryFromInvocations(invocations) {
24
23
  return invocations.map((invocation) => {