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
@@ -16,8 +16,10 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ import { readMatterRuntimeEvents } from '../assistant/proactive-matters/settlement-context.js';
19
20
  import { markAssistantBackgroundSessions } from '../assistant/background-sessions.js';
20
21
  import { PersonalAssistantService, ASSISTANT_LEGACY_PACKAGES } from '../assistant/service.js';
22
+ import { assistantInputTurnId, legacyAssistantInputTurnId } from '../assistant/bot/turn-ids.js';
21
23
  import { createAssistantMessageReader } from './session-transcript-reader.js';
22
24
  import { createImageFileReader } from '@maka/runtime/image-file-reader';
23
25
  import { ChatImageDeliveryService } from './chat-image-delivery.js';
@@ -60,6 +62,9 @@ import { RuntimeReadModel } from '@maka/runtime/runtime-read-model';
60
62
  import { renderAgentSwarmSupervisorWake, shouldWakeAgentSwarmSupervisor, } from '@maka/runtime/agent-swarm-status-tool';
61
63
  import { SessionActivityRegistry } from '@maka/runtime/goal-turn-lifecycle';
62
64
  import { ShellRunProcessManager } from '@maka/runtime/shell-run-manager';
65
+ import { ShellRunEventWaitAccess } from './shell-run-event-wait-access.js';
66
+ import { ShellRunEventWaitAdapter } from './shell-run-event-wait-adapter.js';
67
+ import { EventWaitAdapterRegistry } from './event-wait-adapter.js';
63
68
  import { resolveShellPlan, resolveTurnShellPlan, validateShellPreference, } from '@maka/runtime/shell-detect';
64
69
  import { Context } from '@maka/runtime/plugin-kernel';
65
70
  import { PluginAgentService } from '@maka/runtime/plugin-agent-service';
@@ -109,12 +114,13 @@ import { HostConnectionEffectCoordinator } from './connection-effect-coordinator
109
114
  import { HostChangeFeed } from './host-change-feed.js';
110
115
  import { HostConfigurationCoordinator } from './configuration-coordinator.js';
111
116
  import { HostPromptSuggestionCoordinator, supportsPromptSuggestion } from './prompt-suggestion.js';
117
+ import { checkinSessionState, HostSessionCheckinCoordinator, listCheckinCatalogSessions, } from './session-checkin.js';
112
118
  import { HostContextCoordinator } from './context-coordinator.js';
113
119
  import { HostClientCapabilityCoordinator } from './client-capability-coordinator.js';
114
120
  import { HostDailyReviewCoordinator } from './daily-review-coordinator.js';
115
121
  import { prepareHostAiSdkBackend } from './execution-model-composition.js';
116
122
  import { createInteractiveRunComposer, createInteractiveRunComposerFactory, routeInteractiveRunToolSurface, } from './interactive-run-composer.js';
117
- import { createHostGoalEvaluator, createHostDailyReviewModel, createHostMemoryExtractionModel, createHostPluginModel, createHostSessionEffectModel, createHostPromptSuggestionModel, } from './execution-model-authority.js';
123
+ import { createHostGoalEvaluator, createHostDailyReviewModel, createHostMemoryExtractionModel, createHostPluginModel, createHostSessionEffectModel, createHostPromptSuggestionModel, createHostCheckinModel, resolveDefaultModelHeader, } from './execution-model-authority.js';
118
124
  import { HostExecutionInspectCoordinator } from './execution-inspect-coordinator.js';
119
125
  import { HostExternalSessionCoordinator } from './external-session-coordinator.js';
120
126
  import { boundedFailureDiagnostic } from './failure-diagnostic.js';
@@ -143,6 +149,7 @@ import { join } from 'node:path';
143
149
  import { toRuntimePolicyProxy } from './runtime-policy-proxy.js';
144
150
  import { AcpSetupError } from './acp/connection.js';
145
151
  import { installAntigravity } from './acp/antigravity-install.js';
152
+ import { ANTIGRAVITY_ACP_EXECUTOR_ID } from '@maka/antigravity-acp-plugin';
146
153
  import { createProxiedFetchTransport } from '@maka/runtime/network/scoped-fetch-transport';
147
154
  import { HostExternalAgentSetupCoordinator } from './external-agent-setup-coordinator.js';
148
155
  import { HostOAuthCoordinator } from './oauth-coordinator.js';
@@ -163,6 +170,7 @@ import { startHostModelMetadataRefresh } from './model-metadata-refresh.js';
163
170
  import { HostRuntimeResourceCoordinator } from './runtime-resource-coordinator.js';
164
171
  import { SessionAdmissionGate } from './session-admission-gate.js';
165
172
  import { workHubResultOrigin } from './workhub-result-coordinator.js';
173
+ import { HostPersonalAssistantWorkspace } from './personal-assistant-workspace.js';
166
174
  import { HostSessionCatalogCoordinator } from './session-catalog-coordinator.js';
167
175
  import { SessionBackgroundActivityProjection } from './session-background-activity.js';
168
176
  import { SessionInteractionActivityProjection } from './session-interaction-activity.js';
@@ -171,6 +179,7 @@ import { HostSessionRetirementCoordinator } from './session-retirement-coordinat
171
179
  import { HostStorageMaintenance } from './storage-maintenance.js';
172
180
  import { HostStorageUsageCoordinator } from './storage-usage-coordinator.js';
173
181
  import { HostArchiveRetentionCoordinator } from './archive-retention-coordinator.js';
182
+ import { createHostSessionCheckpointPublication, } from './session-checkpoint-publication.js';
174
183
  import { HostSessionRevisionCoordinator } from './session-revision-coordinator.js';
175
184
  import { HostSessionEffectCoordinator } from './session-effect-coordinator.js';
176
185
  import { SessionContinuityCoordinator } from './session-continuity-coordinator.js';
@@ -226,6 +235,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
226
235
  let graphClient;
227
236
  let sessionEffects;
228
237
  let promptSuggestions;
238
+ let checkins;
229
239
  let memoryExtraction;
230
240
  let imageDelivery;
231
241
  let unsubscribeTranscriptChanges;
@@ -240,6 +250,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
240
250
  let invalidatePluginExecutorBackends = () => undefined;
241
251
  let modelMetadataRefresh;
242
252
  let archiveEvidence;
253
+ let sessionCheckpoints;
243
254
  try {
244
255
  const pluginRoot = new Context();
245
256
  const pluginAgents = new PluginAgentService(pluginRoot);
@@ -295,9 +306,20 @@ export async function createExecutionRuntimeHostComposition(context, options = {
295
306
  ...(header.executorConfig ? { configuration: header.executorConfig } : {}),
296
307
  });
297
308
  }
298
- return pluginExecutors.catalog({ cwd: input.cwd, refresh: input.refresh });
309
+ return pluginExecutors.catalog({
310
+ cwd: input.cwd,
311
+ refresh: input.refresh,
312
+ executorId: input.executorId,
313
+ listOnly: input.listOnly,
314
+ });
299
315
  });
300
316
  const personalAssistant = (assistant = new PersonalAssistantService(join(context.owner.controlDirectory, 'personal-assistant'), {
317
+ prepareBotWake: async (ownerId, workerId) => {
318
+ if (await interactions.hasPendingSession(workerId))
319
+ return 'deferred';
320
+ return sessionCatalog.synchronizeAssistantBotModel(ownerId, workerId);
321
+ },
322
+ allocateWorkspace: () => assistantWorkspace.allocate(),
301
323
  stopSessions: async () => {
302
324
  if (!rootCoordinator)
303
325
  return;
@@ -344,6 +366,9 @@ export async function createExecutionRuntimeHostComposition(context, options = {
344
366
  });
345
367
  },
346
368
  markBackgroundSessions: (ids) => markAssistantBackgroundSessions(stores.sessionStore, ids),
369
+ readRuntimeEvents: async (sessionId, runId) => runId
370
+ ? readMatterRuntimeEvents(stores.runtimeEventStore, sessionId, runId)
371
+ : (await stores.runtimeEventStore.readSessionRuntimeEventEntries(sessionId)).map((entry) => entry.event),
347
372
  agents: pluginAgents,
348
373
  llm: pluginLlm,
349
374
  sessionQuery: pluginSessionQuery,
@@ -879,13 +904,15 @@ export async function createExecutionRuntimeHostComposition(context, options = {
879
904
  continuity = new SessionContinuityCoordinator(context.hostEpoch, (sessionId) => canonicalProjectionReader.read(sessionId), sessionAdmission, context.requestDrain, transcriptReader, async (sessionId, attention) => {
880
905
  if (attention) {
881
906
  try {
882
- if ((await runtimePolicyStores.runtimePolicy.getSnapshot()).policy.privacy.incognitoActive) {
907
+ const header = await stores.sessionStore.readHeaderSnapshot(sessionId);
908
+ if (header.labels?.includes(ASSISTANT_BACKGROUND_SESSION_LABEL) ||
909
+ (await runtimePolicyStores.runtimePolicy.getSnapshot()).policy.privacy.incognitoActive) {
883
910
  attention = undefined;
884
911
  }
885
912
  }
886
913
  catch (error) {
887
914
  attention = undefined;
888
- console.warn('[runtime-host] Could not read notification privacy policy', error);
915
+ console.warn('[runtime-host] Could not read notification policy', error);
889
916
  }
890
917
  }
891
918
  hostChanges.publishSessionCatalog(sessionId, attention);
@@ -927,6 +954,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
927
954
  let domainModuleDrainBegun = false;
928
955
  const beginDrain = () => {
929
956
  draining = true;
957
+ sessionCheckpoints?.beginDrain();
930
958
  if (!domainModules || domainModuleDrainBegun)
931
959
  return;
932
960
  domainModuleDrainBegun = true;
@@ -1022,19 +1050,24 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1022
1050
  ...(scheduledTaskTool ? { scheduledTaskTool } : {}),
1023
1051
  planStore,
1024
1052
  goalTools: requireGoal(goal).tools,
1053
+ eventWaitAvailable: () => backendContext.header.toolMode !== 'code_mode' &&
1054
+ ['active', 'waiting'].includes(requireGoal(goal).manager.get(backendContext.sessionId)?.status ?? ''),
1025
1055
  builtinTools,
1026
1056
  hostTools,
1027
1057
  resolveToolCeiling: (sessionId) => personalAssistant.toolCeiling(sessionId),
1028
1058
  resolveRootTools: async (sessionId) => {
1029
1059
  await assertAssistantSessionEnabled(sessionId);
1030
1060
  return [
1031
- ...personalAssistant.tools,
1061
+ ...personalAssistant.filterTools(sessionId, personalAssistant.tools),
1032
1062
  ...(sessionId === WORKHUB_COORDINATION_SESSION_ID && workHubResults && workHubInspection
1033
1063
  ? [workHubResults.tool, workHubInspection]
1034
1064
  : await requireGraphCoordinator(graphCoordinator).toolsForSession(sessionId)),
1035
1065
  ];
1036
1066
  },
1037
- resolvePluginTools: (sessionId, coreTools) => pluginTools.resolveContributions(sessionId, coreTools),
1067
+ resolvePluginTools: (sessionId, coreTools) => {
1068
+ const resolved = pluginTools.resolveContributions(sessionId, coreTools);
1069
+ return { ...resolved, tools: personalAssistant.filterTools(sessionId, resolved.tools) };
1070
+ },
1038
1071
  resolvePluginSystemPrompt: async (sessionId, promptContext, baseText) => {
1039
1072
  const assembly = await pluginSystemPrompt.assemble({
1040
1073
  sessionId,
@@ -1190,7 +1223,10 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1190
1223
  const [graphTools, planState] = await Promise.all([
1191
1224
  (sessionId === WORKHUB_COORDINATION_SESSION_ID && workHubResults && workHubInspection
1192
1225
  ? Promise.resolve([workHubResults.tool, workHubInspection])
1193
- : requireGraphCoordinator(graphCoordinator).toolsForSession(sessionId)).then((tools) => [...personalAssistant.tools, ...tools]),
1226
+ : requireGraphCoordinator(graphCoordinator).toolsForSession(sessionId)).then((tools) => [
1227
+ ...personalAssistant.filterTools(sessionId, personalAssistant.tools),
1228
+ ...tools,
1229
+ ]),
1194
1230
  planStore.readState(sessionId),
1195
1231
  ]);
1196
1232
  const { runtimePolicy, surface } = await resolveInteractiveToolSurface({
@@ -1524,7 +1560,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1524
1560
  context.requestDrain();
1525
1561
  },
1526
1562
  onSucceeded: () => {
1527
- pluginExecutors.invalidateCatalog();
1563
+ pluginExecutors.invalidateCatalog(ANTIGRAVITY_ACP_EXECUTOR_ID);
1528
1564
  hostChanges.publishConfiguration();
1529
1565
  },
1530
1566
  capabilities: clientCapabilities,
@@ -1621,6 +1657,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1621
1657
  };
1622
1658
  const pluginSessionSummary = (session) => Object.freeze({
1623
1659
  id: session.id,
1660
+ isArchived: session.isArchived,
1624
1661
  ...(session.name ? { title: session.name } : {}),
1625
1662
  ...(session.cwd ? { cwd: session.cwd } : {}),
1626
1663
  ...(session.labels?.length ? { labels: session.labels } : {}),
@@ -1970,12 +2007,20 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1970
2007
  onError: () => context.requestDrain(),
1971
2008
  });
1972
2009
  const goalExecutionCoordinator = new HostGoalExecutionCoordinator({
2010
+ authorizeEventWait: async (sessionId, pending) => (await requireGoal(goal).eventWaitBridge?.authorizeAdmission(sessionId, pending)) ?? false,
1973
2011
  executions: coordinator,
1974
2012
  runtime: manager,
1975
2013
  matchesActive: (sessionId, checkpoint, controlLease) => requireGoal(goal).matchesActive(sessionId, checkpoint, controlLease),
1976
2014
  });
1977
2015
  goalExecutions = goalExecutionCoordinator;
2016
+ const shellRunWaitAccess = new ShellRunEventWaitAccess(openedShellRunStore, stores.runtimeEventStore);
1978
2017
  goal = new HostGoalCoordinator({
2018
+ eventWaitSources: dependencies.eventWaitSources ?? {
2019
+ adapters: new EventWaitAdapterRegistry([
2020
+ new ShellRunEventWaitAdapter(shellRunWaitAccess, shellRuns),
2021
+ ]),
2022
+ authorize: (wait, signal) => shellRunWaitAccess.authorize(wait, signal),
2023
+ },
1979
2024
  store: openedGoalStore,
1980
2025
  stores,
1981
2026
  readSessionContext: async (sessionId) => {
@@ -1996,7 +2041,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
1996
2041
  requestDrain: context.requestDrain,
1997
2042
  readSessionHeader: (sessionId) => stores.sessionStore.readHeaderSnapshot(sessionId),
1998
2043
  }),
1999
- admitTurn: (sessionId, text, checkpoint, controlLease) => goalExecutionCoordinator.admitTurn(sessionId, text, checkpoint, controlLease),
2044
+ admitTurn: (sessionId, text, checkpoint, controlLease, eventWait) => goalExecutionCoordinator.admitTurn(sessionId, text, checkpoint, controlLease, eventWait),
2000
2045
  acquireResidency: (kind) => context.acquireResidency('goal', kind),
2001
2046
  onProjectionChanged: (sessionId) => continuityCoordinator.enqueueCanonicalRefresh(sessionId),
2002
2047
  requestDrain: context.requestDrain,
@@ -2031,7 +2076,8 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2031
2076
  });
2032
2077
  async function applyRuntimePolicyMutationEffects() {
2033
2078
  try {
2034
- pluginExecutors.invalidateCatalog();
2079
+ // Reconciliation replaces only changed agent configurations. Unrelated
2080
+ // policy edits must not discard every provider's persistent catalog.
2035
2081
  await builtinExternalAgentPlugins.reconcile();
2036
2082
  await requireMemory(memory).refreshAfterPolicyMutation();
2037
2083
  }
@@ -2095,6 +2141,46 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2095
2141
  ? { sessionAccessAuthority: context.sessionAccessAuthority }
2096
2142
  : {}),
2097
2143
  });
2144
+ const sessionCheckins = new HostSessionCheckinCoordinator({
2145
+ allowed: async () => !(await runtimePolicyStores.runtimePolicy.getSnapshot()).policy.privacy.incognitoActive,
2146
+ listSessions: (context) => listCheckinCatalogSessions((input) => sessionCatalog.handlers['session.catalog.query'](input, context)),
2147
+ readSession: async (session) => {
2148
+ // The Todo read takes the Session's admission itself, so it cannot run inside this one.
2149
+ const todos = (await sessionTodo.read(session.id)).items;
2150
+ return sessionAdmission.run(session.id, async () => {
2151
+ const canonical = await canonicalProjectionReader.read(session.id);
2152
+ if (!canonical || canonical.session.isArchived)
2153
+ return undefined;
2154
+ await requireSessionManager(manager).ensureTranscriptLedgerForRead(session.id);
2155
+ const view = await recapReadModel.getSessionView(session.id);
2156
+ return checkinSessionState({
2157
+ session,
2158
+ canonical,
2159
+ todos,
2160
+ messages: view.messages,
2161
+ turns: view.turns,
2162
+ });
2163
+ });
2164
+ },
2165
+ readModelTarget: () => resolveDefaultModelHeader(runtimePolicyStores),
2166
+ generate: createHostCheckinModel({
2167
+ runtimePolicy: runtimePolicyStores,
2168
+ oauthCredentials,
2169
+ usage: openedUsageStores,
2170
+ requestDrain: context.requestDrain,
2171
+ }),
2172
+ });
2173
+ checkins = sessionCheckins;
2174
+ const assistantWorkspace = new HostPersonalAssistantWorkspace({
2175
+ stateRoot: context.owner.capability.canonicalPath,
2176
+ ...(options.assistantHomeDirectory ? { homeDirectory: options.assistantHomeDirectory } : {}),
2177
+ projects: openedProjectCatalog,
2178
+ membership: projectMembership,
2179
+ projectChanged: () => hostChanges.publishProjectCatalog(),
2180
+ preflightSessionCreation: async () => {
2181
+ await sessionCatalog.resolveDefaultCreateTarget();
2182
+ },
2183
+ });
2098
2184
  const workHubTargetExecution = new HostWorkHubTargetExecutionAuthority({
2099
2185
  readSession: (sessionId) => stores.sessionStore.readHeaderRecordSnapshot(sessionId),
2100
2186
  runtimePolicy: {
@@ -2468,6 +2554,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2468
2554
  });
2469
2555
  const externalSessions = new HostExternalSessionCoordinator({
2470
2556
  adapters: createExternalSessionAdapterRegistry(),
2557
+ artifacts: openedArtifactStore,
2471
2558
  admission: sessionAdmission,
2472
2559
  sessions: stores.sessionStore,
2473
2560
  workspaceResolver,
@@ -2477,6 +2564,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2477
2564
  const outcomes = await Promise.allSettled([
2478
2565
  stores.purgeConversationOperationalState(sessionId),
2479
2566
  sessionTodoStore.purgeSessionState(sessionId),
2567
+ openedArtifactStore.purgeSessionArtifacts(sessionId),
2480
2568
  stores.sessionStore.remove(sessionId),
2481
2569
  ]);
2482
2570
  for (const outcome of outcomes) {
@@ -2606,6 +2694,15 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2606
2694
  catalog: stores.sessionStore,
2607
2695
  retirement: sessionRetirement,
2608
2696
  });
2697
+ sessionCheckpoints = await createHostSessionCheckpointPublication({
2698
+ context,
2699
+ stores,
2700
+ admission: sessionAdmission,
2701
+ manager: requireSessionManager(manager),
2702
+ shellRuns: openedShellRunStore,
2703
+ isSessionIdle: (sessionId) => rootRecoveryCompleted && !draining && coordinator.isSessionExecutionIdle(sessionId),
2704
+ options: dependencies.checkpointPublication,
2705
+ });
2609
2706
  const storageMaintenance = new HostStorageMaintenance({
2610
2707
  artifacts: openedArtifactStore,
2611
2708
  contextOffload: openedContextOffloadStore,
@@ -2839,7 +2936,9 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2839
2936
  return result;
2840
2937
  // Canonical receipts remain queryable even while the feature is disabled.
2841
2938
  const visible = new Set((await stores.sessionStore.readMessagesSnapshot(input.sessionId))
2842
- .filter((row) => row.type === 'user' && row.turnId === `assistant-input:${row.id}`)
2939
+ .filter((row) => row.type === 'user' &&
2940
+ (row.turnId === assistantInputTurnId(row.id) ||
2941
+ row.turnId === legacyAssistantInputTurnId(row.id)))
2843
2942
  .map((row) => row.id));
2844
2943
  return {
2845
2944
  ok: true,
@@ -2904,6 +3003,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2904
3003
  interactions.handlers,
2905
3004
  sessionEffectCoordinator.handlers,
2906
3005
  promptSuggestionCoordinator.handlers,
3006
+ sessionCheckins.handlers,
2907
3007
  continuityCoordinator.handlers,
2908
3008
  runtimeResources.handlers,
2909
3009
  contextOperations.handlers,
@@ -2934,6 +3034,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2934
3034
  () => interactions.beginDrain(),
2935
3035
  () => sessionEffects?.beginDrain(),
2936
3036
  () => promptSuggestions?.beginDrain(),
3037
+ () => checkins?.beginDrain(),
2937
3038
  ],
2938
3039
  close: [
2939
3040
  async () => {
@@ -2949,6 +3050,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
2949
3050
  () => workspaceExecution?.close(),
2950
3051
  () => sessionEffects?.close(),
2951
3052
  () => promptSuggestions?.close(),
3053
+ () => checkins?.close(),
2952
3054
  () => messages.close(),
2953
3055
  () => interactions.close(),
2954
3056
  () => turnAccessRequests?.close(),
@@ -3018,6 +3120,12 @@ export async function createExecutionRuntimeHostComposition(context, options = {
3018
3120
  catch (error) {
3019
3121
  errors.push(error);
3020
3122
  }
3123
+ try {
3124
+ await sessionCheckpoints?.close();
3125
+ }
3126
+ catch (error) {
3127
+ errors.push(error);
3128
+ }
3021
3129
  try {
3022
3130
  await closeRuntimeHostDomainModules(domainModules);
3023
3131
  }
@@ -3040,6 +3148,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
3040
3148
  };
3041
3149
  return {
3042
3150
  handlers,
3151
+ sessionCheckpoints,
3043
3152
  moduleIds: Object.freeze(domainModules.map(({ id }) => id)),
3044
3153
  workspaceExecution: requireWorkspaceExecution(workspaceExecution),
3045
3154
  plugins: pluginPlatform,
@@ -3124,6 +3233,12 @@ export async function createExecutionRuntimeHostComposition(context, options = {
3124
3233
  }
3125
3234
  catch (error) {
3126
3235
  const errors = [error];
3236
+ try {
3237
+ await sessionCheckpoints?.close();
3238
+ }
3239
+ catch (closeError) {
3240
+ errors.push(closeError);
3241
+ }
3127
3242
  archiveEvidence?.close();
3128
3243
  try {
3129
3244
  await modelMetadataRefresh?.close();
@@ -3149,6 +3264,7 @@ export async function createExecutionRuntimeHostComposition(context, options = {
3149
3264
  try {
3150
3265
  await sessionEffects?.close();
3151
3266
  await promptSuggestions?.close();
3267
+ await checkins?.close();
3152
3268
  }
3153
3269
  catch (closeError) {
3154
3270
  errors.push(closeError);
@@ -215,6 +215,43 @@ export function createHostPromptSuggestionModel(input) {
215
215
  return result.finishReason === 'length' ? undefined : result.text;
216
216
  };
217
217
  }
218
+ const CHECKIN_MAX_OUTPUT_TOKENS = 2_048;
219
+ const CHECKIN_REASONING_MAX_OUTPUT_TOKENS = 8_192;
220
+ /**
221
+ * Creates the root-scoped check-in call. It reads many Sessions, so it runs on
222
+ * the user's default model (resolved by the coordinator before any read)
223
+ * rather than borrowing any one Session's.
224
+ */
225
+ export function createHostCheckinModel(input) {
226
+ const authority = createAuxiliaryModelCallAuthority(input);
227
+ return async ({ target, prompt, abortSignal, }) => {
228
+ try {
229
+ const callId = authority.newId();
230
+ const result = await runHostAuxiliaryModelCall(authority, {
231
+ transportContextId: callId,
232
+ header: target,
233
+ callKind: 'session_checkin',
234
+ callId: `session_checkin_${callId}`,
235
+ abortSignal,
236
+ reasoning: 'least',
237
+ buildRequest: (_target, thinkingLevel) => ({
238
+ prompt,
239
+ maxOutputTokens: thinkingLevel === 'off'
240
+ ? CHECKIN_MAX_OUTPUT_TOKENS
241
+ : CHECKIN_REASONING_MAX_OUTPUT_TOKENS,
242
+ maxRetries: 0,
243
+ }),
244
+ });
245
+ return result.finishReason === 'length'
246
+ ? { ok: false, errorClass: 'invalid_response' }
247
+ : { ok: true, text: result.text };
248
+ }
249
+ catch (error) {
250
+ const errorClass = auxiliaryModelErrorClass(error, abortSignal);
251
+ return { ok: false, errorClass: errorClass === 'persistence' ? 'unknown' : errorClass };
252
+ }
253
+ };
254
+ }
218
255
  /** Creates tool-free Session title and recap calls on canonical Host model authority. */
219
256
  export function createHostSessionEffectModel(input) {
220
257
  const authority = createAuxiliaryModelCallAuthority(input);
@@ -649,14 +686,21 @@ async function resolveDailyReviewHeader(runtimePolicy, modelKey) {
649
686
  thinkingLevel: 'off',
650
687
  };
651
688
  }
689
+ const header = await resolveDefaultModelHeader(runtimePolicy);
690
+ if (!header) {
691
+ throw new AuxiliaryModelCallConfigurationError('Daily Review has no canonical default model target');
692
+ }
693
+ return header;
694
+ }
695
+ /** The connection and model the user chose as default, or undefined when none is set. */
696
+ export async function resolveDefaultModelHeader(runtimePolicy) {
652
697
  const catalog = await runtimePolicy.connectionCatalog.getSnapshot();
653
698
  const target = catalog.defaultTarget;
654
699
  const connection = target
655
700
  ? catalog.connections.find((candidate) => candidate.connectionId === target.connectionId)
656
701
  : undefined;
657
- if (!target || !connection) {
658
- throw new AuxiliaryModelCallConfigurationError('Daily Review has no canonical default model target');
659
- }
702
+ if (!target || !connection)
703
+ return undefined;
660
704
  return {
661
705
  llmConnectionId: connection.connectionId,
662
706
  llmConnectionSlug: connection.slug,
@@ -17,6 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
  import { randomUUID } from 'node:crypto';
20
+ import { ASSISTANT_BACKGROUND_SESSION_LABEL } from '@maka/core/session';
20
21
  import { createRunCompositionSnapshot } from '@maka/core/run-composition';
21
22
  import { resolveModelVisionSupport } from '@maka/core/model-metadata';
22
23
  import { modelOverride } from '@maka/core/model-thinking';
@@ -269,6 +270,16 @@ async function buildHostAiSdkBackend(input, target) {
269
270
  contextBudget: buildDefaultContextBudgetPolicy({
270
271
  name: 'runtime-host-default-history-budget',
271
272
  modelId: target.model,
273
+ // The persistent Bot cannot depend on a provider rejecting its ever-growing
274
+ // history. Ordinary sessions retain their existing opt-in policy. The
275
+ // runtime gives an explicit user threshold precedence over this fallback.
276
+ ...(input.context.header.labels?.includes(ASSISTANT_BACKGROUND_SESSION_LABEL) &&
277
+ input.context.header.labels.some((label) => label.startsWith('assistant-bot:')) &&
278
+ contextWindow !== undefined
279
+ ? {
280
+ fallbackCompactionThresholdTokens: Math.floor(contextWindow * 0.8),
281
+ }
282
+ : {}),
272
283
  }),
273
284
  supportsVision: resolveModelVisionSupport(target.connection.providerType, target.connection.models, target.model, modelOverride(target.connection, target.model)?.vision),
274
285
  readAttachmentBytes: createAttachmentByteReader({
@@ -31,6 +31,7 @@ export class HostExternalSessionCoordinator {
31
31
  'external-session.import': (input) => this.importSession(input),
32
32
  };
33
33
  #adapters;
34
+ #artifacts;
34
35
  #admission;
35
36
  #sessions;
36
37
  #workspaceResolver;
@@ -60,6 +61,7 @@ export class HostExternalSessionCoordinator {
60
61
  #importsInFlight = new Map();
61
62
  constructor(options) {
62
63
  this.#adapters = options.adapters;
64
+ this.#artifacts = options.artifacts;
63
65
  this.#admission = options.admission;
64
66
  this.#sessions = options.sessions;
65
67
  this.#workspaceResolver = options.workspaceResolver;
@@ -228,14 +230,15 @@ export class HostExternalSessionCoordinator {
228
230
  }
229
231
  let commitAttempted = false;
230
232
  const importer = new ExternalSessionImporter(this.#adapters, {
231
- createImportedSession: async (sessionInput, messages, externalOrigin) => {
233
+ createImportedSession: async (sessionInput, messages, externalOrigin, options) => {
232
234
  return this.#sessions.createImportedSession(sessionInput, messages, externalOrigin, {
235
+ ...options,
233
236
  onCommitStarted: () => {
234
237
  commitAttempted = true;
235
238
  },
236
239
  });
237
240
  },
238
- });
241
+ }, this.#artifacts);
239
242
  let header;
240
243
  try {
241
244
  header = await importer.import({