maka-agent 0.2.2-dev.92.20261019 → 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 (364) hide show
  1. package/LICENSE +7 -7
  2. package/README.md +78 -18
  3. package/README.zh-CN.md +73 -15
  4. package/THIRD_PARTY_NOTICES.txt +12 -12
  5. package/dist/pi-goal.js +13 -0
  6. package/dist/pi-tui-runner.js +44 -1
  7. package/dist/run-command-core.js +111 -70
  8. package/dist/run-session-command.js +91 -15
  9. package/dist/run-turn-outcome.js +2 -33
  10. package/dist/runtime-host-session-channel.js +3 -1
  11. package/dist/runtime-host-session-driver.js +5 -0
  12. package/dist/tui-copy-catalog.js +24 -0
  13. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  14. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Client.md +2 -0
  15. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/connect.js +10 -4
  16. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/symbols.js +1 -0
  17. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/agent.js +6 -2
  18. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  19. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  20. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +3 -2
  21. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  22. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +48 -0
  23. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  24. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  25. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +15 -5
  26. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/index.js +3 -1
  27. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/parse.js +138 -137
  28. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/util.js +21 -2
  29. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  30. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  31. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/fetch/index.js +3 -3
  32. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/infra/index.js +14 -0
  33. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  34. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  35. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
  36. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog-store.js +87 -0
  37. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog.js +98 -21
  38. package/node_modules/@maka/acp-executor-plugin/dist/index.js +90 -14
  39. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +3997 -56
  40. package/node_modules/@maka/core/dist/assistant-turn-ids.js +34 -0
  41. package/node_modules/@maka/core/dist/event-wait.js +28 -10
  42. package/node_modules/@maka/core/dist/executor-catalog.js +3 -1
  43. package/node_modules/@maka/core/dist/model-catalog.js +19 -1
  44. package/node_modules/@maka/core/dist/model-metadata.generated.js +4 -14
  45. package/node_modules/@maka/core/dist/model-metadata.js +42 -1
  46. package/node_modules/@maka/core/dist/models-dev-projection.js +32 -1
  47. package/node_modules/@maka/core/dist/provider-registry.js +16 -2
  48. package/node_modules/@maka/core/dist/runtime-event.js +8 -0
  49. package/node_modules/@maka/core/dist/session-checkin.js +31 -0
  50. package/node_modules/@maka/core/dist/usage-stats/types.js +1 -0
  51. package/node_modules/@maka/core/package.json +2 -0
  52. package/node_modules/@maka/eval/node_modules/undici/README.md +25 -3
  53. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  54. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Client.md +11 -6
  55. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  56. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +76 -1
  57. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  58. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  59. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  60. package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +12 -12
  61. package/node_modules/@maka/eval/node_modules/undici/docs/docs/type-map.json +66 -66
  62. package/node_modules/@maka/eval/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  63. package/node_modules/@maka/eval/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  64. package/node_modules/@maka/eval/node_modules/undici/lib/core/connect.js +10 -4
  65. package/node_modules/@maka/eval/node_modules/undici/lib/core/constants.js +12 -1
  66. package/node_modules/@maka/eval/node_modules/undici/lib/core/errors.js +38 -1
  67. package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +16 -1
  68. package/node_modules/@maka/eval/node_modules/undici/lib/core/symbols.js +2 -0
  69. package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +26 -1
  70. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/agent.js +6 -2
  71. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  72. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  73. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +4 -1
  74. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  75. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  76. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  77. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  78. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +11 -8
  79. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  80. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  81. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  82. package/node_modules/@maka/eval/node_modules/undici/lib/handler/cache-handler.js +153 -15
  83. package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  84. package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  85. package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +44 -11
  86. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +11 -3
  87. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +22 -9
  88. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dns.js +11 -0
  89. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/response-error.js +72 -28
  90. package/node_modules/@maka/eval/node_modules/undici/lib/milo/LICENSE.md +7 -0
  91. package/node_modules/@maka/eval/node_modules/undici/lib/milo/no-simd.js +1002 -0
  92. package/node_modules/@maka/eval/node_modules/undici/lib/milo/simd.js +1002 -0
  93. package/node_modules/@maka/eval/node_modules/undici/lib/mock/mock-agent.js +11 -0
  94. package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  95. package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  96. package/node_modules/@maka/eval/node_modules/undici/lib/util/cache.js +11 -5
  97. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +19 -2
  98. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  99. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  100. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +47 -38
  101. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  102. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +2 -2
  103. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +8 -4
  104. package/node_modules/@maka/eval/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  105. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  106. package/node_modules/@maka/eval/node_modules/undici/package.json +9 -7
  107. package/node_modules/@maka/mcp/package.json +1 -1
  108. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +22 -9
  109. package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +10 -1
  110. package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +101 -127
  111. package/node_modules/@maka/runtime/dist/event-wait-tool.js +2 -2
  112. package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +32 -1
  113. package/node_modules/@maka/runtime/dist/history-compaction.js +7 -0
  114. package/node_modules/@maka/runtime/dist/model-factory.js +26 -6
  115. package/node_modules/@maka/runtime/dist/model-fetcher.js +8 -1
  116. package/node_modules/@maka/runtime/dist/model-history.js +16 -3
  117. package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +7 -2
  118. package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +49 -2
  119. package/node_modules/@maka/runtime/dist/plugin-executor-service.js +12 -3
  120. package/node_modules/@maka/runtime/dist/runtime-context.js +53 -0
  121. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +3 -0
  122. package/node_modules/@maka/runtime/dist/session-checkin.js +331 -0
  123. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +7 -0
  124. package/node_modules/@maka/runtime/dist/shell-run-manager.js +34 -0
  125. package/node_modules/@maka/runtime/dist/telemetry/builtin-pricing.js +21 -2
  126. package/node_modules/@maka/runtime/dist/tool-runtime.js +8 -0
  127. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.mjs +50 -1
  128. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Client.md +2 -0
  129. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/connect.js +10 -4
  130. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/symbols.js +1 -0
  131. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/agent.js +6 -2
  132. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  133. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  134. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +3 -2
  135. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  136. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +48 -0
  137. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  138. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  139. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +15 -5
  140. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/index.js +3 -1
  141. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/parse.js +138 -137
  142. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/util.js +21 -2
  143. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  144. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  145. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/fetch/index.js +3 -3
  146. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/infra/index.js +14 -0
  147. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  148. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  149. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
  150. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +1 -1
  151. package/node_modules/@maka/runtime/node_modules/undici/README.md +25 -3
  152. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  153. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Client.md +11 -6
  154. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  155. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +76 -1
  156. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  157. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  158. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  159. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +12 -12
  160. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/type-map.json +66 -66
  161. package/node_modules/@maka/runtime/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  162. package/node_modules/@maka/runtime/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  163. package/node_modules/@maka/runtime/node_modules/undici/lib/core/connect.js +10 -4
  164. package/node_modules/@maka/runtime/node_modules/undici/lib/core/constants.js +12 -1
  165. package/node_modules/@maka/runtime/node_modules/undici/lib/core/errors.js +38 -1
  166. package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +16 -1
  167. package/node_modules/@maka/runtime/node_modules/undici/lib/core/symbols.js +2 -0
  168. package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +26 -1
  169. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/agent.js +6 -2
  170. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  171. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  172. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +4 -1
  173. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  174. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  175. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  176. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  177. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +11 -8
  178. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  179. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  180. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  181. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/cache-handler.js +153 -15
  182. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  183. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  184. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +44 -11
  185. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +11 -3
  186. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +22 -9
  187. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dns.js +11 -0
  188. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/response-error.js +72 -28
  189. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/LICENSE.md +7 -0
  190. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/no-simd.js +1002 -0
  191. package/node_modules/@maka/runtime/node_modules/undici/lib/milo/simd.js +1002 -0
  192. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/mock-agent.js +11 -0
  193. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  194. package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  195. package/node_modules/@maka/runtime/node_modules/undici/lib/util/cache.js +11 -5
  196. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +19 -2
  197. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  198. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  199. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +47 -38
  200. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  201. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +2 -2
  202. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +8 -4
  203. package/node_modules/@maka/runtime/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  204. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  205. package/node_modules/@maka/runtime/node_modules/undici/package.json +9 -7
  206. package/node_modules/@maka/runtime/package.json +2 -0
  207. package/node_modules/@maka/runtime-host/dist/assistant/bot/bridge.js +8 -0
  208. package/node_modules/@maka/runtime-host/dist/assistant/bot/capabilities.js +1 -0
  209. package/node_modules/@maka/runtime-host/dist/assistant/bot/controller.js +64 -13
  210. package/node_modules/@maka/runtime-host/dist/assistant/bot/host.js +11 -2
  211. package/node_modules/@maka/runtime-host/dist/assistant/bot/store.js +71 -2
  212. package/node_modules/@maka/runtime-host/dist/assistant/bot/turn-ids.js +38 -0
  213. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/assistant.js +7 -0
  214. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/controller.js +193 -32
  215. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/discovery-capabilities.js +69 -0
  216. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/host.js +15 -28
  217. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/notebook.js +286 -0
  218. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/prompt.js +31 -6
  219. package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/store.js +18 -1
  220. package/node_modules/@maka/runtime-host/dist/assistant/memory-network/controller.js +1 -1
  221. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-observer.js +94 -0
  222. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-store.js +253 -0
  223. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition.js +133 -0
  224. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/controller.js +27 -14
  225. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delegation.js +35 -5
  226. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delivery.js +1 -1
  227. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/host.js +16 -2
  228. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/matter.js +13 -0
  229. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/prompt.js +7 -5
  230. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/review.js +1 -1
  231. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/settlement-context.js +126 -0
  232. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/store.js +92 -6
  233. package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/tools.js +87 -23
  234. package/node_modules/@maka/runtime-host/dist/assistant/service.js +49 -5
  235. package/node_modules/@maka/runtime-host/dist/protocol/goal.js +119 -1
  236. package/node_modules/@maka/runtime-host/dist/protocol/index.js +7 -1
  237. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +8 -1
  238. package/node_modules/@maka/runtime-host/dist/protocol/personal-assistant.js +1 -0
  239. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +7 -1
  240. package/node_modules/@maka/runtime-host/dist/protocol/session-checkin.js +133 -0
  241. package/node_modules/@maka/runtime-host/dist/server/canonical-session-projection.js +3 -2
  242. package/node_modules/@maka/runtime-host/dist/server/event-wait-manager.js +63 -12
  243. package/node_modules/@maka/runtime-host/dist/server/event-wait-observation-store.js +19 -0
  244. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +123 -11
  245. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +47 -3
  246. package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +126 -4
  247. package/node_modules/@maka/runtime-host/dist/server/goal-event-waits.js +58 -19
  248. package/node_modules/@maka/runtime-host/dist/server/goal-projection.js +24 -3
  249. package/node_modules/@maka/runtime-host/dist/server/index.js +2 -0
  250. package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +44 -2
  251. package/node_modules/@maka/runtime-host/dist/server/personal-assistant-workspace.js +78 -0
  252. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +73 -3
  253. package/node_modules/@maka/runtime-host/dist/server/session-checkin.js +257 -0
  254. package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-coordinator.js +282 -0
  255. package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-publication.js +250 -0
  256. package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-access.js +166 -0
  257. package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-adapter.js +59 -0
  258. package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +4 -2
  259. package/node_modules/@maka/storage/dist/context-offload-snapshot.js +2 -1
  260. package/node_modules/@maka/storage/dist/execution-stores.js +36 -1
  261. package/node_modules/@maka/storage/dist/local-execution-persistence.js +26 -0
  262. package/node_modules/@maka/storage/dist/production-session-snapshot.js +14 -6
  263. package/node_modules/@maka/storage/dist/runtime-event-persistence.js +1 -0
  264. package/node_modules/@maka/storage/dist/session-bundle-policy.js +86 -16
  265. package/node_modules/@maka/storage/dist/session-checkpoint-publication-store.js +204 -0
  266. package/node_modules/@maka/storage/dist/snapshot-operation-gate.js +65 -0
  267. package/node_modules/@maka/storage/dist/sqlite-context-offload-schema.js +3 -3
  268. package/node_modules/@maka/storage/dist/sqlite-context-offload-store.js +4 -2
  269. package/node_modules/@maka/storage/dist/sqlite-reclamation-checkpoint.js +37 -0
  270. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +31 -0
  271. package/node_modules/@maka/storage/package.json +3 -0
  272. package/node_modules/@modelcontextprotocol/client/dist/index-B-4n9P0J.d.mts.map +1 -0
  273. package/node_modules/@modelcontextprotocol/client/dist/index-J2FaQ-KY.d.cts.map +1 -0
  274. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +76 -22
  275. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
  276. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
  277. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +76 -22
  278. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
  279. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
  280. package/node_modules/@modelcontextprotocol/client/dist/{src-oZBjf3U1.cjs → src-DpAS0jfg.cjs} +105 -8
  281. package/node_modules/@modelcontextprotocol/client/dist/{src-xKF0PJN-.mjs → src-WCy6ifGf.mjs} +88 -9
  282. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +1 -1
  283. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +1 -1
  284. package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/package.json +2 -2
  285. package/node_modules/@modelcontextprotocol/client/package.json +5 -5
  286. package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
  287. package/node_modules/fast-uri/README.md +8 -0
  288. package/node_modules/fast-uri/index.js +98 -18
  289. package/node_modules/fast-uri/lib/utils.js +52 -0
  290. package/node_modules/fast-uri/package.json +1 -1
  291. package/node_modules/follow-redirects/index.js +10 -1
  292. package/node_modules/follow-redirects/package.json +1 -1
  293. package/node_modules/ip-address/README.md +104 -104
  294. package/node_modules/ip-address/dist/ipv4.js +7 -0
  295. package/node_modules/ip-address/dist/ipv6.js +7 -4
  296. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  297. package/node_modules/ip-address/package.json +2 -1
  298. package/node_modules/undici/README.md +25 -3
  299. package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  300. package/node_modules/undici/docs/docs/api/Client.md +11 -6
  301. package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  302. package/node_modules/undici/docs/docs/api/Errors.md +76 -1
  303. package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  304. package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  305. package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  306. package/node_modules/undici/docs/docs/index.md +12 -12
  307. package/node_modules/undici/docs/docs/type-map.json +66 -66
  308. package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  309. package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  310. package/node_modules/undici/lib/core/connect.js +10 -4
  311. package/node_modules/undici/lib/core/constants.js +12 -1
  312. package/node_modules/undici/lib/core/errors.js +38 -1
  313. package/node_modules/undici/lib/core/request.js +16 -1
  314. package/node_modules/undici/lib/core/symbols.js +2 -0
  315. package/node_modules/undici/lib/core/util.js +26 -1
  316. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  317. package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  318. package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  319. package/node_modules/undici/lib/dispatcher/client.js +4 -1
  320. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  321. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  322. package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  323. package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  324. package/node_modules/undici/lib/dispatcher/pool.js +11 -8
  325. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  326. package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  327. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  328. package/node_modules/undici/lib/handler/cache-handler.js +153 -15
  329. package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  330. package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  331. package/node_modules/undici/lib/handler/retry-handler.js +44 -11
  332. package/node_modules/undici/lib/interceptor/cache.js +11 -3
  333. package/node_modules/undici/lib/interceptor/decompress.js +22 -9
  334. package/node_modules/undici/lib/interceptor/dns.js +11 -0
  335. package/node_modules/undici/lib/interceptor/response-error.js +72 -28
  336. package/node_modules/undici/lib/milo/LICENSE.md +7 -0
  337. package/node_modules/undici/lib/milo/no-simd.js +1002 -0
  338. package/node_modules/undici/lib/milo/simd.js +1002 -0
  339. package/node_modules/undici/lib/mock/mock-agent.js +11 -0
  340. package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  341. package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  342. package/node_modules/undici/lib/util/cache.js +11 -5
  343. package/node_modules/undici/lib/web/cookies/util.js +19 -2
  344. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  345. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  346. package/node_modules/undici/lib/web/fetch/body.js +47 -38
  347. package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  348. package/node_modules/undici/lib/web/fetch/headers.js +2 -2
  349. package/node_modules/undici/lib/web/fetch/index.js +8 -4
  350. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  351. package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  352. package/node_modules/undici/package.json +9 -7
  353. package/node_modules/zod/package.json +1 -1
  354. package/node_modules/zod/v4/core/compile.cjs +8 -0
  355. package/node_modules/zod/v4/core/compile.js +8 -0
  356. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  357. package/node_modules/zod/v4/core/schemas.js +30 -0
  358. package/node_modules/zod/v4/core/util.cjs +15 -0
  359. package/node_modules/zod/v4/core/util.js +14 -0
  360. package/node_modules/zod/v4/core/versions.cjs +1 -1
  361. package/node_modules/zod/v4/core/versions.js +1 -1
  362. package/package.json +2 -2
  363. package/node_modules/@modelcontextprotocol/client/dist/index-D_CiY-T3.d.cts.map +0 -1
  364. package/node_modules/@modelcontextprotocol/client/dist/index-D_QDtbiv.d.mts.map +0 -1
@@ -30,7 +30,28 @@ class AssistantRuntime {
30
30
  directory;
31
31
  dependencies;
32
32
  tools = [];
33
+ internalTools = [];
34
+ toolFilters = [];
33
35
  bot = new AssistantBotBridge();
36
+ backgroundSessions = [];
37
+ sessionAccess = [];
38
+ hasSessionAccess(sessionId) {
39
+ return (this.bot.isConversation(sessionId) ||
40
+ this.bot.isWorker(sessionId) ||
41
+ this.backgroundSessions.some((read) => read().includes(sessionId)) ||
42
+ this.sessionAccess.some((allows) => allows(sessionId)));
43
+ }
44
+ /**
45
+ * The only visibility policy. Catalogs and execution both use it, so a tool hidden
46
+ * from a Session cannot run in that Session either.
47
+ */
48
+ visibleTools(sessionId, tools) {
49
+ const nativeNames = new Set(this.tools.map((tool) => tool.name));
50
+ const allowed = this.hasSessionAccess(sessionId)
51
+ ? tools
52
+ : tools.filter((tool) => !nativeNames.has(tool.name));
53
+ return this.toolFilters.reduce((current, filter) => filter(sessionId, current), allowed);
54
+ }
34
55
  sections = [];
35
56
  contexts = [];
36
57
  checks = [];
@@ -53,18 +74,19 @@ class AssistantRuntime {
53
74
  if (this.initialized)
54
75
  throw Error('Personal assistant already initialized');
55
76
  const settings = await this.loadSettings(legacy, entries);
56
- const backgroundSessions = [];
57
77
  const services = {
58
78
  bot: this.bot,
59
- backgroundSessions: { register: (read) => backgroundSessions.push(read) },
79
+ backgroundSessions: { register: (read) => this.backgroundSessions.push(read) },
60
80
  ...this.dependencies,
61
81
  onClose: (dispose) => this.disposers.push(dispose),
62
82
  onStart: (start) => this.starters.push(start),
63
83
  tools: {
84
+ filter: (filter) => this.toolFilters.push(filter),
85
+ registerSessionAccess: (allows) => this.sessionAccess.push(allows),
64
86
  register: (tool) => {
65
87
  if (this.tools.some((t) => t.name === tool.name))
66
88
  throw Error(`Duplicate assistant tool: ${tool.name}`);
67
- this.tools.push({
89
+ const internalTool = {
68
90
  ...tool,
69
91
  impl: (input, call) => {
70
92
  if (this.closing)
@@ -84,9 +106,26 @@ class AssistantRuntime {
84
106
  return this.dependencies.agents.withInvocation(scoped, () => tool.impl(input, scoped));
85
107
  });
86
108
  },
109
+ };
110
+ this.internalTools.push(internalTool);
111
+ this.tools.push({
112
+ ...internalTool,
113
+ impl: (input, call) => {
114
+ if (this.closing)
115
+ throw Error('Personal assistant is shutting down');
116
+ if (!this.hasSessionAccess(call.sessionId))
117
+ throw Error('Personal assistant tools are unavailable in this session');
118
+ if (!this.visibleTools(call.sessionId, [tool]).length)
119
+ throw Error('Personal assistant tool is unavailable in this session');
120
+ return internalTool.impl(input, call);
121
+ },
87
122
  });
88
123
  },
89
- resolve: (sessionId) => sessionId ? this.dependencies.resolveTools(sessionId, this.tools) : { tools: this.tools },
124
+ // Only Host module APIs use this resolver. They retain the caller's source
125
+ // permissions (e.g. ordinary-chat original links) without exposing model tools.
126
+ resolve: (sessionId) => sessionId
127
+ ? this.dependencies.resolveTools(sessionId, this.internalTools)
128
+ : { tools: this.internalTools },
90
129
  },
91
130
  systemPrompt: {
92
131
  section: (value) => this.sections.push(value),
@@ -114,7 +153,7 @@ class AssistantRuntime {
114
153
  ])
115
154
  await initialize(services, settings[name].directory, settings[name].config);
116
155
  await this.dependencies.markBackgroundSessions([
117
- ...new Set(backgroundSessions.flatMap((read) => read())),
156
+ ...new Set(this.backgroundSessions.flatMap((read) => read())),
118
157
  ]);
119
158
  this.initialized = true;
120
159
  }
@@ -427,6 +466,11 @@ export class PersonalAssistantService {
427
466
  hasInboxMessage(sessionId, id) {
428
467
  return this.enabled && this.runtime.bot.hasUserMessage(sessionId, id);
429
468
  }
469
+ filterTools(sessionId, tools) {
470
+ if (!this.enabled)
471
+ return tools;
472
+ return this.runtime.visibleTools(sessionId, tools);
473
+ }
430
474
  toolCeiling(sessionId) {
431
475
  return this.enabled && this.runtime.bot.isWorker(sessionId)
432
476
  ? this.runtime.tools.filter((tool) => BOT_TOOLS.has(tool.name))
@@ -20,7 +20,12 @@ import { GOAL_CONDITION_TEXT_LIMIT, GOAL_MAX_ITERATIONS_LIMIT, GOAL_REASON_TEXT_
20
20
  import { requireCount, requireEncodedByteLimit, requireEntityId, requireExactRecord, requireUtf8String, } from './codec.js';
21
21
  import { invalidProtocolFrame } from './errors.js';
22
22
  import { defineOperation } from './operation-spec.js';
23
- export const GOAL_RESULT_MAX_BYTES = 8 * 1024;
23
+ export const GOAL_RESULT_MAX_BYTES = 16 * 1024;
24
+ /** Display bounds; canonical ShellRun references fit in full. */
25
+ export const GOAL_EVENT_WAIT_SUMMARY_LIMITS = Object.freeze({
26
+ resourceIdBytes: 512,
27
+ reasonCodeBytes: 128,
28
+ });
24
29
  const QUERY_ERRORS = [
25
30
  'host_not_ready',
26
31
  'host_draining',
@@ -31,6 +36,17 @@ const QUERY_ERRORS = [
31
36
  const CONTROL_ERRORS = [...QUERY_ERRORS, 'session_archived', 'operation_conflict'];
32
37
  const ARM_ERRORS = CONTROL_ERRORS;
33
38
  export const GOAL_OPERATION_SPECS = {
39
+ 'goal.event-wait.cancel': defineOperation({
40
+ mode: 'control',
41
+ availability: 'ready',
42
+ errors: CONTROL_ERRORS,
43
+ decodeInput: decodeGoalEventWaitCancelInput,
44
+ decodeOutput: decodeGoalEventWaitCancelResult,
45
+ assertOutputForInput(input, output) {
46
+ if (input.sessionId !== output.sessionId)
47
+ throw invalidProtocolFrame('Wait cancellation belongs to another Session');
48
+ },
49
+ }),
34
50
  'goal.query': defineOperation({
35
51
  mode: 'query',
36
52
  availability: 'ready',
@@ -85,6 +101,7 @@ export function decodeGoalProjection(value) {
85
101
  'lastReason',
86
102
  'achievedAt',
87
103
  'pausedAt',
104
+ 'eventWait',
88
105
  ]);
89
106
  const condition = requireUtf8String(record.condition, 'Goal condition', GOAL_CONDITION_TEXT_LIMIT.utf8Bytes);
90
107
  if (condition.length > GOAL_CONDITION_TEXT_LIMIT.codeUnits) {
@@ -107,6 +124,7 @@ export function decodeGoalProjection(value) {
107
124
  lastReason,
108
125
  achievedAt: requireNullableCount(record.achievedAt, 'Goal achievedAt'),
109
126
  pausedAt: requireNullableCount(record.pausedAt, 'Goal pausedAt'),
127
+ eventWait: record.eventWait === null ? null : decodeGoalEventWaitProjection(record.eventWait),
110
128
  };
111
129
  }
112
130
  function decodeGoalQueryInput(value) {
@@ -220,3 +238,103 @@ function requireNullableCount(value, label) {
220
238
  return null;
221
239
  return requireCount(value, label);
222
240
  }
241
+ export function decodeGoalEventWaitProjection(value) {
242
+ const r = requireExactRecord(value, 'Goal event wait', [
243
+ 'waitId',
244
+ 'controlGeneration',
245
+ 'waitRevision',
246
+ 'resource',
247
+ 'reason',
248
+ 'deadlineAt',
249
+ 'phase',
250
+ 'observation',
251
+ 'outcome',
252
+ ]);
253
+ const resource = requireExactRecord(r.resource, 'Wait resource', [
254
+ 'providerId',
255
+ 'resourceType',
256
+ 'resourceId',
257
+ ]);
258
+ if (r.phase !== 'observing' && r.phase !== 'awaiting_admission')
259
+ throw invalidProtocolFrame('Invalid wait phase');
260
+ if (r.outcome !== null &&
261
+ r.outcome !== 'satisfied' &&
262
+ r.outcome !== 'invalidated' &&
263
+ r.outcome !== 'source_unavailable' &&
264
+ r.outcome !== 'expired')
265
+ throw invalidProtocolFrame('Invalid wait outcome');
266
+ let observation = null;
267
+ if (r.observation !== null) {
268
+ const o = requireExactRecord(r.observation, 'Wait observation', [
269
+ 'state',
270
+ 'lastObservedAt',
271
+ 'reasonCode',
272
+ ]);
273
+ if (o.state !== 'checking' && o.state !== 'pending' && o.state !== 'unknown')
274
+ throw invalidProtocolFrame('Invalid observation state');
275
+ observation = {
276
+ state: o.state,
277
+ lastObservedAt: requireNullableCount(o.lastObservedAt, 'Observation time'),
278
+ reasonCode: o.reasonCode === null
279
+ ? null
280
+ : requireUtf8String(o.reasonCode, 'Observation reason', GOAL_EVENT_WAIT_SUMMARY_LIMITS.reasonCodeBytes),
281
+ };
282
+ }
283
+ if ((r.phase === 'observing' && (observation === null || r.outcome !== null)) ||
284
+ (r.phase === 'awaiting_admission' && (observation !== null || r.outcome === null)))
285
+ throw invalidProtocolFrame('Inconsistent wait phase');
286
+ const reason = requireNullableGoalReason(r.reason);
287
+ if (reason === null)
288
+ throw invalidProtocolFrame('Invalid wait reason');
289
+ return {
290
+ waitId: requireEntityId(r.waitId, 'waitId'),
291
+ controlGeneration: requireCount(r.controlGeneration, 'Control generation'),
292
+ waitRevision: requireCount(r.waitRevision, 'Wait revision'),
293
+ resource: {
294
+ providerId: requireWaitTypeId(resource.providerId, 'Wait provider'),
295
+ resourceType: requireWaitTypeId(resource.resourceType, 'Wait resource type'),
296
+ resourceId: requireUtf8String(resource.resourceId, 'Wait reference', GOAL_EVENT_WAIT_SUMMARY_LIMITS.resourceIdBytes),
297
+ },
298
+ reason,
299
+ deadlineAt: requireCount(r.deadlineAt, 'Wait deadline'),
300
+ phase: r.phase,
301
+ observation,
302
+ outcome: r.outcome,
303
+ };
304
+ }
305
+ function decodeGoalEventWaitCancelInput(value) {
306
+ const r = requireExactRecord(value, 'Wait cancellation', [
307
+ 'sessionId',
308
+ 'goalId',
309
+ 'controlGeneration',
310
+ 'waitId',
311
+ 'expectedGoalRevision',
312
+ ]);
313
+ return {
314
+ sessionId: requireEntityId(r.sessionId, 'sessionId'),
315
+ goalId: requireEntityId(r.goalId, 'goalId'),
316
+ waitId: requireEntityId(r.waitId, 'waitId'),
317
+ controlGeneration: requireCount(r.controlGeneration, 'Control generation'),
318
+ expectedGoalRevision: requireCount(r.expectedGoalRevision, 'Goal revision'),
319
+ };
320
+ }
321
+ function decodeGoalEventWaitCancelResult(value) {
322
+ requireEncodedByteLimit(value, 'Wait cancellation result', GOAL_RESULT_MAX_BYTES);
323
+ const r = requireExactRecord(value, 'Wait cancellation result', ['sessionId', 'outcome', 'goal']);
324
+ if (r.outcome !== 'cancelled' &&
325
+ r.outcome !== 'already_cancelled' &&
326
+ r.outcome !== 'already_admitted' &&
327
+ r.outcome !== 'conflict')
328
+ throw invalidProtocolFrame('Invalid cancellation outcome');
329
+ const sessionId = requireEntityId(r.sessionId, 'sessionId');
330
+ const goal = r.goal === null ? null : decodeGoalProjection(r.goal);
331
+ if (goal && goal.sessionId !== sessionId)
332
+ throw invalidProtocolFrame('Wait cancellation Goal belongs to another Session');
333
+ return { sessionId, outcome: r.outcome, goal };
334
+ }
335
+ function requireWaitTypeId(value, label) {
336
+ const id = requireUtf8String(value, label, 128);
337
+ if (!/^[A-Za-z0-9_.-]{1,128}$/.test(id))
338
+ throw invalidProtocolFrame(`Invalid ${label}`);
339
+ return id;
340
+ }
@@ -69,7 +69,13 @@ export const RUNTIME_HOST_PROTOCOL_VERSION = 0;
69
69
  // Increment when the same protocol version no longer guarantees safe Client-Host
70
70
  // interoperability. Mismatches are rejected before domain commands are admitted.
71
71
  // Re-check against main before merging; sibling PRs may use the same next epoch.
72
- export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 225;
72
+ export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 229;
73
+ // 229: Session check-in proposes cards for unfinished work across Sessions.
74
+ // 228: Executor catalog queries support per-agent filtering and process-free inventory.
75
+ // Older peers reject the executorId and listOnly fields in the strict query decoder.
76
+ // 227: Goal projections carry eventWait and support goal.event-wait.cancel.
77
+ // Older peers cannot decode the wait summary or cancel a specific wait.
78
+ // 226: assistant.allocate-workspace allocates a Host-owned fallback for projectless assistants.
73
79
  // 225: Goal successor transcript origins carry typed event-wait provenance.
74
80
  // Older peers reject the additional field in the strict stored-message decoder.
75
81
  // 224: Assistant conversation admission supports Inbox receipts without a model Turn,
@@ -57,6 +57,7 @@ import { SESSION_REVISION_OPERATION_SPECS } from './session-revision.js';
57
57
  import { SESSION_BUNDLE_OPERATION_SPECS } from './session-bundle.js';
58
58
  import { SESSION_RETIREMENT_OPERATION_SPECS } from './session-retirement.js';
59
59
  import { PROMPT_SUGGESTION_OPERATION_SPECS } from './prompt-suggestions.js';
60
+ import { SESSION_CHECKIN_OPERATION_SPECS } from './session-checkin.js';
60
61
  import { SESSION_EFFECT_OPERATION_SPECS } from './session-effects.js';
61
62
  import { SKILL_CATALOG_OPERATION_SPECS } from './skill-catalog.js';
62
63
  import { STORAGE_RETENTION_OPERATION_SPECS } from './storage-retention.js';
@@ -98,6 +99,7 @@ export * from './session-turns.js';
98
99
  export * from './session-todo.js';
99
100
  export * from './session-effects.js';
100
101
  export * from './prompt-suggestions.js';
102
+ export * from './session-checkin.js';
101
103
  export * from './skill-catalog.js';
102
104
  export * from './storage-retention.js';
103
105
  export * from './storage-usage.js';
@@ -105,7 +107,10 @@ export * from './usage-pricing.js';
105
107
  export * from './web-search.js';
106
108
  export * from './recall.js';
107
109
  export * from './workspace.js';
108
- export const HOST_OPERATION_SPECS = composeOperationSpecMaps(HOST_BOOTSTRAP_OPERATION_SPECS, HOST_RESOURCE_OPERATION_SPECS, PEER_MESH_OPERATION_SPECS, HOSTED_EXECUTION_OPERATION_SPECS, ACCESS_AUTHORITY_OPERATION_SPECS, SESSION_COLLABORATION_OPERATION_SPECS, AGENT_GRAPH_OPERATION_SPECS, GOAL_OPERATION_SPECS, TURN_OPERATION_SPECS, CONTEXT_OPERATION_SPECS, CONNECTION_EFFECT_OPERATION_SPECS, DAILY_REVIEW_OPERATION_SPECS, EXECUTION_INSPECT_OPERATION_SPECS, EXTERNAL_SESSION_OPERATION_SPECS, RUNTIME_POLICY_OPERATION_SPECS, RUNTIME_RESOURCE_OPERATION_SPECS, SCHEDULED_TASK_OPERATION_SPECS, PLAN_OPERATION_SPECS, PROJECT_CATALOG_OPERATION_SPECS, MESSAGE_OPERATION_SPECS, SESSION_TODO_OPERATION_SPECS, INTERACTION_OPERATION_SPECS, SESSION_CONTINUITY_OPERATION_SPECS, SESSION_TRANSCRIPT_OPERATION_SPECS, SESSION_TURNS_OPERATION_SPECS, SESSION_CATALOG_OPERATION_SPECS, SESSION_EFFECT_OPERATION_SPECS, PROMPT_SUGGESTION_OPERATION_SPECS, SESSION_REVISION_OPERATION_SPECS, SESSION_BUNDLE_OPERATION_SPECS, SESSION_RETIREMENT_OPERATION_SPECS, ARTIFACT_OPERATION_SPECS, SKILL_CATALOG_OPERATION_SPECS, USAGE_PRICING_OPERATION_SPECS, STORAGE_USAGE_OPERATION_SPECS, STORAGE_RETENTION_OPERATION_SPECS, composeOperationSpecMaps(MEMORY_OPERATION_SPECS, PERSONAL_ASSISTANT_OPERATION_SPECS), OAUTH_OPERATION_SPECS, EXTERNAL_AGENT_SETUP_OPERATION_SPECS, CLIENT_CAPABILITY_OPERATION_SPECS, WEB_SEARCH_OPERATION_SPECS, NETWORK_PROXY_OPERATION_SPECS, RECALL_OPERATION_SPECS, CONFIGURATION_OPERATION_SPECS, WORKHUB_COORDINATION_OPERATION_SPECS, PLUGIN_PLATFORM_OPERATION_SPECS);
110
+ export const HOST_OPERATION_SPECS = composeOperationSpecMaps(HOST_BOOTSTRAP_OPERATION_SPECS, HOST_RESOURCE_OPERATION_SPECS, PEER_MESH_OPERATION_SPECS, HOSTED_EXECUTION_OPERATION_SPECS, ACCESS_AUTHORITY_OPERATION_SPECS, SESSION_COLLABORATION_OPERATION_SPECS, AGENT_GRAPH_OPERATION_SPECS, GOAL_OPERATION_SPECS, TURN_OPERATION_SPECS, CONTEXT_OPERATION_SPECS, CONNECTION_EFFECT_OPERATION_SPECS, DAILY_REVIEW_OPERATION_SPECS, EXECUTION_INSPECT_OPERATION_SPECS, EXTERNAL_SESSION_OPERATION_SPECS, RUNTIME_POLICY_OPERATION_SPECS, RUNTIME_RESOURCE_OPERATION_SPECS, SCHEDULED_TASK_OPERATION_SPECS, PLAN_OPERATION_SPECS, PROJECT_CATALOG_OPERATION_SPECS, MESSAGE_OPERATION_SPECS, SESSION_TODO_OPERATION_SPECS, INTERACTION_OPERATION_SPECS, SESSION_CONTINUITY_OPERATION_SPECS, SESSION_TRANSCRIPT_OPERATION_SPECS, SESSION_TURNS_OPERATION_SPECS, SESSION_CATALOG_OPERATION_SPECS, SESSION_EFFECT_OPERATION_SPECS,
111
+ // One argument for both: the disjoint-key check across every map passed here
112
+ // already sits at TypeScript's type instantiation depth limit.
113
+ { ...PROMPT_SUGGESTION_OPERATION_SPECS, ...SESSION_CHECKIN_OPERATION_SPECS }, SESSION_REVISION_OPERATION_SPECS, SESSION_BUNDLE_OPERATION_SPECS, SESSION_RETIREMENT_OPERATION_SPECS, ARTIFACT_OPERATION_SPECS, SKILL_CATALOG_OPERATION_SPECS, USAGE_PRICING_OPERATION_SPECS, STORAGE_USAGE_OPERATION_SPECS, STORAGE_RETENTION_OPERATION_SPECS, composeOperationSpecMaps(MEMORY_OPERATION_SPECS, PERSONAL_ASSISTANT_OPERATION_SPECS), OAUTH_OPERATION_SPECS, EXTERNAL_AGENT_SETUP_OPERATION_SPECS, CLIENT_CAPABILITY_OPERATION_SPECS, WEB_SEARCH_OPERATION_SPECS, NETWORK_PROXY_OPERATION_SPECS, RECALL_OPERATION_SPECS, CONFIGURATION_OPERATION_SPECS, WORKHUB_COORDINATION_OPERATION_SPECS, PLUGIN_PLATFORM_OPERATION_SPECS);
109
114
  // Remote credentials are fail-closed: adding a protocol operation does not
110
115
  // grant it to remote owners until this policy is deliberately updated.
111
116
  export const REMOTE_OWNER_OPERATION_GRANTS = Object.freeze([
@@ -152,6 +157,7 @@ export const REMOTE_OWNER_OPERATION_GRANTS = Object.freeze([
152
157
  'external-session.source.query',
153
158
  'goal.arm',
154
159
  'goal.control',
160
+ 'goal.event-wait.cancel',
155
161
  'goal.query',
156
162
  'host.diagnostics.query',
157
163
  'host.resources.query',
@@ -197,6 +203,7 @@ export const REMOTE_OWNER_OPERATION_GRANTS = Object.freeze([
197
203
  'scheduled-task.query',
198
204
  'session.branch.create',
199
205
  'session.catalog.query',
206
+ 'session.checkin.generate',
200
207
  'session.configuration.update',
201
208
  'session.create',
202
209
  'session.execution_boundary.query',
@@ -56,6 +56,7 @@ const request = z
56
56
  'assistant.enablement',
57
57
  'assistant.set-enabled',
58
58
  'assistant.binding',
59
+ 'assistant.allocate-workspace',
59
60
  'assistant.avatar',
60
61
  'assistant.avatar-image',
61
62
  'assistant.original',
@@ -93,13 +93,19 @@ export const PLUGIN_PLATFORM_OPERATION_SPECS = {
93
93
  decodeInput: (value) => {
94
94
  const record = requireRecord(value, 'Executor query');
95
95
  if (record.kind === 'catalog') {
96
- const input = requireShapedRecord(record, 'Executor catalog', ['kind', 'cwd'], ['refresh']);
96
+ const input = requireShapedRecord(record, 'Executor catalog', ['kind', 'cwd'], ['refresh', 'executorId', 'listOnly']);
97
97
  if (input.refresh !== undefined && typeof input.refresh !== 'boolean')
98
98
  throw invalidProtocolFrame('Invalid executor refresh flag');
99
+ if (input.listOnly !== undefined && typeof input.listOnly !== 'boolean')
100
+ throw invalidProtocolFrame('Invalid executor inventory flag');
99
101
  return {
100
102
  kind: 'catalog',
101
103
  cwd: requireString(input.cwd, 'cwd', 4096),
102
104
  ...(input.refresh ? { refresh: true } : {}),
105
+ ...(input.executorId !== undefined
106
+ ? { executorId: requireId(input.executorId, 'executorId') }
107
+ : {}),
108
+ ...(input.listOnly ? { listOnly: true } : {}),
103
109
  };
104
110
  }
105
111
  const input = requireExactRecord(record, 'Executor conversation', ['kind', 'sessionId']);
@@ -0,0 +1,133 @@
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 { CHECKIN_INSTRUCTION_MAX_CHARS, CHECKIN_MAX_CARDS, CHECKIN_QUOTE_MAX_CHARS, CHECKIN_TITLE_MAX_CHARS, isCheckinCardAction, isCheckinEvidenceSource, } from '@maka/core/session-checkin';
20
+ import { requireCount, requireEntityId, requireExactRecord, requireRecord, requireShapedRecord, } from './codec.js';
21
+ import { invalidProtocolFrame } from './errors.js';
22
+ import { defineOperation } from './operation-spec.js';
23
+ const SESSION_NAME_MAX_BYTES = 1024;
24
+ const SESSION_CHECKIN_FAILURE_CLASSES = [
25
+ 'aborted',
26
+ 'timeout',
27
+ 'configuration',
28
+ 'provider',
29
+ 'invalid_response',
30
+ 'unknown',
31
+ ];
32
+ export const SESSION_CHECKIN_OPERATION_SPECS = {
33
+ 'session.checkin.generate': defineOperation({
34
+ mode: 'command',
35
+ availability: 'ready',
36
+ errors: [
37
+ 'host_not_ready',
38
+ 'host_draining',
39
+ 'operation_unavailable',
40
+ 'operation_conflict',
41
+ 'internal_failure',
42
+ ],
43
+ decodeInput: decodeSessionCheckinGenerateInput,
44
+ decodeOutput: decodeSessionCheckinGenerateResult,
45
+ assertOutputForInput: (input, output) => {
46
+ if (input.effectId !== output.effectId) {
47
+ throw invalidProtocolFrame('Session check-in changed effect identity');
48
+ }
49
+ },
50
+ }),
51
+ };
52
+ export function decodeSessionCheckinGenerateInput(value) {
53
+ const input = requireExactRecord(value, 'Session check-in input', ['effectId', 'since']);
54
+ return {
55
+ effectId: requireEntityId(input.effectId, 'effectId'),
56
+ since: input.since === null ? null : requireCount(input.since, 'Session check-in since'),
57
+ };
58
+ }
59
+ export function decodeSessionCheckinGenerateResult(value) {
60
+ const result = requireRecord(value, 'Session check-in result');
61
+ if (result.kind === 'empty') {
62
+ const empty = requireExactRecord(result, 'Empty Session check-in', ['kind', 'effectId']);
63
+ return { kind: 'empty', effectId: requireEntityId(empty.effectId, 'effectId') };
64
+ }
65
+ if (result.kind === 'failed') {
66
+ const failed = requireExactRecord(result, 'Failed Session check-in', [
67
+ 'kind',
68
+ 'effectId',
69
+ 'errorClass',
70
+ ]);
71
+ if (!SESSION_CHECKIN_FAILURE_CLASSES.includes(failed.errorClass)) {
72
+ throw invalidProtocolFrame('Invalid Session check-in failure class');
73
+ }
74
+ return {
75
+ kind: 'failed',
76
+ effectId: requireEntityId(failed.effectId, 'effectId'),
77
+ errorClass: failed.errorClass,
78
+ };
79
+ }
80
+ const generated = requireExactRecord(result, 'Generated Session check-in', [
81
+ 'kind',
82
+ 'effectId',
83
+ 'cards',
84
+ 'dropped',
85
+ ]);
86
+ if (generated.kind !== 'generated')
87
+ throw invalidProtocolFrame('Invalid Session check-in kind');
88
+ if (!Array.isArray(generated.cards) || generated.cards.length > CHECKIN_MAX_CARDS) {
89
+ throw invalidProtocolFrame('Invalid Session check-in cards');
90
+ }
91
+ return {
92
+ kind: 'generated',
93
+ effectId: requireEntityId(generated.effectId, 'effectId'),
94
+ cards: generated.cards.map(decodeCheckinCard),
95
+ dropped: requireCount(generated.dropped, 'Session check-in dropped count'),
96
+ };
97
+ }
98
+ function decodeCheckinCard(value) {
99
+ const card = requireShapedRecord(value, 'Session check-in card', ['sessionId', 'sessionRevision', 'sessionName', 'title', 'evidence', 'action'], ['instruction']);
100
+ const evidence = requireExactRecord(card.evidence, 'Session check-in evidence', [
101
+ 'source',
102
+ 'quote',
103
+ ]);
104
+ if (!isCheckinCardAction(card.action) || !isCheckinEvidenceSource(evidence.source)) {
105
+ throw invalidProtocolFrame('Invalid Session check-in card');
106
+ }
107
+ if (typeof card.sessionName !== 'string' ||
108
+ Buffer.byteLength(card.sessionName) > SESSION_NAME_MAX_BYTES) {
109
+ throw invalidProtocolFrame('Invalid Session check-in Session name');
110
+ }
111
+ return {
112
+ sessionId: requireEntityId(card.sessionId, 'sessionId'),
113
+ sessionRevision: requireCount(card.sessionRevision, 'Session check-in revision'),
114
+ sessionName: card.sessionName,
115
+ title: requireChars(card.title, 'Session check-in title', CHECKIN_TITLE_MAX_CHARS),
116
+ evidence: {
117
+ source: evidence.source,
118
+ quote: requireChars(evidence.quote, 'Session check-in quote', CHECKIN_QUOTE_MAX_CHARS),
119
+ },
120
+ action: card.action,
121
+ ...(card.instruction !== undefined
122
+ ? {
123
+ instruction: requireChars(card.instruction, 'Session check-in instruction', CHECKIN_INSTRUCTION_MAX_CHARS),
124
+ }
125
+ : {}),
126
+ };
127
+ }
128
+ function requireChars(value, label, maxChars) {
129
+ if (typeof value !== 'string' || !value.trim() || Array.from(value).length > maxChars) {
130
+ throw invalidProtocolFrame(`Invalid ${label}`);
131
+ }
132
+ return value;
133
+ }
@@ -60,9 +60,10 @@ export class CanonicalSessionProjectionReader {
60
60
  rootTurn = await readCanonicalTurnSnapshot(this.#stores, durableAdmission);
61
61
  }
62
62
  const interactions = projectSessionInteractions(await this.#stores.interactionStore.listSessionPending(sessionId), await this.#stores.sessionStore.listPendingSandboxBoundaryRequests(sessionId));
63
- // The Session lane barrier must remain held through this final synchronous read.
63
+ // Keep the Session lane across the asynchronous Goal/wait read and the
64
+ // final queue projection; neither read can authorize a second admission.
65
+ const goal = await this.#readGoal(sessionId);
64
66
  const queue = this.#messages.projection(sessionId);
65
- const goal = this.#readGoal(sessionId);
66
67
  const session = {
67
68
  sessionId: header.id,
68
69
  metadataRevision,
@@ -17,7 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
  import { randomUUID } from 'node:crypto';
20
- import { decodeEventWaitRecord, EVENT_WAIT_LIMITS, } from '@maka/core/event-wait';
20
+ import { decodeEventWaitRecord, decodeObservedEventWaitRecord, EVENT_WAIT_LIMITS, } from '@maka/core/event-wait';
21
21
  import { authenticateInteractiveEventWaitAuthorityWriter, EVENT_WAIT_OBSERVATION_HINT_LIMIT, EVENT_WAIT_PAGE_LIMIT, eventWaitSourceKey, } from '@maka/storage/event-wait-authority';
22
22
  import { StorageRootAuthorityError } from '@maka/storage/root-authority';
23
23
  const systemClock = {
@@ -76,7 +76,7 @@ const addTime = (now, delay) => Math.min(Number.MAX_SAFE_INTEGER, now + delay);
76
76
  * Ready candidates normally use durable observation age. Failed preparations get a bounded
77
77
  * traversal by immutable ID, so neither failed writes nor cache capacity can pin selection.
78
78
  */
79
- export class HostEventWaitManager {
79
+ export class HostEventWaitObserver {
80
80
  #store;
81
81
  #options;
82
82
  #clock;
@@ -104,7 +104,7 @@ export class HostEventWaitManager {
104
104
  #closed = false;
105
105
  #ready = false;
106
106
  constructor(options) {
107
- this.#store = authenticateInteractiveEventWaitAuthorityWriter(options.store);
107
+ this.#store = options.store;
108
108
  this.#options = options;
109
109
  this.#clock = options.clock ?? systemClock;
110
110
  this.#policy = { ...DEFAULT_EVENT_WAIT_OBSERVATION_POLICY, ...options.policy };
@@ -113,7 +113,9 @@ export class HostEventWaitManager {
113
113
  if (!Number.isFinite(value) || value < 0 || value > 1)
114
114
  throw new TypeError('Invalid wait jitter');
115
115
  }
116
- else if (!Number.isSafeInteger(value) || value < 1 || value > 2_147_483_647)
116
+ else if (!Number.isSafeInteger(value) ||
117
+ value < 1 ||
118
+ (name !== 'maxLifetimeMs' && value > 2_147_483_647))
117
119
  throw new TypeError(`Invalid wait policy: ${name}`);
118
120
  }
119
121
  if (this.#policy.pageSize > EVENT_WAIT_PAGE_LIMIT ||
@@ -127,9 +129,12 @@ export class HostEventWaitManager {
127
129
  EVENT_WAIT_OBSERVATION_HINT_LIMIT)
128
130
  throw new TypeError('Inconsistent event wait policy');
129
131
  }
132
+ #decode(value) {
133
+ return (this.#options.decodeRecord ?? decodeObservedEventWaitRecord)(value);
134
+ }
130
135
  /** Validates the supported template only; PR3 owns registration authorization and yield. */
131
136
  validate(wait) {
132
- const record = decodeEventWaitRecord(wait);
137
+ const record = this.#decode(wait);
133
138
  if (record.deadlineAt - record.createdAt > this.#policy.maxLifetimeMs)
134
139
  throw new TypeError('Event wait exceeds maximum lifetime');
135
140
  this.#options.adapters.validate(record);
@@ -417,7 +422,8 @@ export class HostEventWaitManager {
417
422
  }
418
423
  }
419
424
  async #observe(snapshot, flight) {
420
- let r = snapshot.record;
425
+ const projectionBefore = snapshot.record;
426
+ let r = projectionBefore;
421
427
  if (r.status !== 'waiting' || this.#closed)
422
428
  return;
423
429
  const cooldown = await this.#store.readSourceCooldown({
@@ -467,7 +473,9 @@ export class HostEventWaitManager {
467
473
  outcome: 'checking',
468
474
  cursor: previous?.cursor ?? null,
469
475
  eventKey: previous?.eventKey ?? null,
470
- reason: null,
476
+ // Reconnecting projections still need the last completed observation's
477
+ // diagnostic while this reservation's source request is in flight.
478
+ reason: previous?.reason ?? null,
471
479
  };
472
480
  const claim = await this.#commit(snapshot, { ...r, updatedAt: now, observation: reserved });
473
481
  if (this.#closed || flight.controller.signal.aborted)
@@ -558,7 +566,10 @@ export class HostEventWaitManager {
558
566
  !subscriptionPending &&
559
567
  !this.#subscriptions.get(r.waitId)?.controller.signal.aborted)
560
568
  this.#detach(r.waitId);
561
- await this.#finish(snapshot, result, { retryAfterUntil: flight.retryAfterUntil });
569
+ await this.#finish(snapshot, result, {
570
+ retryAfterUntil: flight.retryAfterUntil,
571
+ projectionBefore,
572
+ });
562
573
  }
563
574
  #validateAccess(access) {
564
575
  if (!access || !['allowed', 'revoked', 'unknown'].includes(access.kind))
@@ -830,7 +841,7 @@ export class HostEventWaitManager {
830
841
  eventKey: null,
831
842
  reason: null,
832
843
  };
833
- decodeEventWaitRecord({
844
+ this.#decode({
834
845
  ...r,
835
846
  updatedAt: now,
836
847
  observation: {
@@ -958,7 +969,7 @@ export class HostEventWaitManager {
958
969
  },
959
970
  };
960
971
  }
961
- const committed = await this.#commit(snapshot, record);
972
+ const committed = await this.#commit(snapshot, record, options.projectionBefore);
962
973
  if (!committed || committed.record.status !== 'waiting')
963
974
  this.#detach(r.waitId);
964
975
  return committed;
@@ -1095,7 +1106,7 @@ export class HostEventWaitManager {
1095
1106
  finishHandoff();
1096
1107
  }
1097
1108
  }
1098
- async #commit(snapshot, record) {
1109
+ async #commit(snapshot, record, projectionBefore = snapshot.record) {
1099
1110
  if (this.#closed)
1100
1111
  return null;
1101
1112
  const result = await this.#store.commit({
@@ -1103,7 +1114,23 @@ export class HostEventWaitManager {
1103
1114
  expectedAuthorityRevision: snapshot.authorityRevision,
1104
1115
  record,
1105
1116
  });
1106
- return result.kind === 'committed' ? result.snapshot : null;
1117
+ if (result.kind !== 'committed')
1118
+ return null;
1119
+ const after = result.snapshot.record;
1120
+ // Compare durable semantics before the attempt, not its temporary checking
1121
+ // reservation. Cache eviction must not turn unchanged polling into activity.
1122
+ if ((after.status !== 'waiting' || after.observation?.outcome !== 'checking') &&
1123
+ (projectionBefore.status !== after.status ||
1124
+ projectionBefore.observation?.outcome !== after.observation?.outcome ||
1125
+ projectionBefore.observation?.reason !== after.observation?.reason)) {
1126
+ try {
1127
+ this.#options.onChanged?.(after);
1128
+ }
1129
+ catch {
1130
+ /* Projection hints are best effort. */
1131
+ }
1132
+ }
1133
+ return result.snapshot;
1107
1134
  }
1108
1135
  async #expire(snapshot) {
1109
1136
  if (this.#closed || snapshot.record.status !== 'waiting')
@@ -1264,3 +1291,27 @@ export class HostEventWaitManager {
1264
1291
  return this.#close;
1265
1292
  }
1266
1293
  }
1294
+ export class HostEventWaitManager extends HostEventWaitObserver {
1295
+ checkSourceAccess(wait, signal, authorize) {
1296
+ return super.checkSourceAccess(wait, signal, (record, signal) => authorize(decodeEventWaitRecord(record), signal));
1297
+ }
1298
+ constructor(options) {
1299
+ const store = authenticateInteractiveEventWaitAuthorityWriter(options.store);
1300
+ super({
1301
+ ...options,
1302
+ decodeRecord: decodeEventWaitRecord,
1303
+ authorize: (wait, signal) => options.authorize(decodeEventWaitRecord(wait), signal),
1304
+ onChanged: (wait) => options.onChanged?.(decodeEventWaitRecord(wait)),
1305
+ store: {
1306
+ read: (input) => store.read(input),
1307
+ listByStatus: (input) => store.listByStatus(input),
1308
+ listForObservation: (input) => store.listForObservation(input),
1309
+ readSourceCooldown: (input) => store.readSourceCooldown(input),
1310
+ extendSourceCooldown: (input) => store.extendSourceCooldown(input),
1311
+ reserveSourceDispatch: (input) => store.reserveSourceDispatch(input),
1312
+ completeSourceDispatch: (input) => store.completeSourceDispatch(input),
1313
+ commit: (input) => store.commit({ ...input, record: decodeEventWaitRecord(input.record) }),
1314
+ },
1315
+ });
1316
+ }
1317
+ }