pulseed 0.6.3 → 0.6.5

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 (615) hide show
  1. package/dist/adapters/datasources/artifact-metric-datasource.d.ts +11 -1
  2. package/dist/adapters/datasources/artifact-metric-datasource.d.ts.map +1 -1
  3. package/dist/adapters/datasources/artifact-metric-datasource.js +256 -9
  4. package/dist/adapters/datasources/artifact-metric-datasource.js.map +1 -1
  5. package/dist/base/config/global-config.d.ts +7 -4
  6. package/dist/base/config/global-config.d.ts.map +1 -1
  7. package/dist/base/config/global-config.js +3 -1
  8. package/dist/base/config/global-config.js.map +1 -1
  9. package/dist/base/protocol/exact-protocol.d.ts +47 -0
  10. package/dist/base/protocol/exact-protocol.d.ts.map +1 -0
  11. package/dist/base/protocol/exact-protocol.js +175 -0
  12. package/dist/base/protocol/exact-protocol.js.map +1 -0
  13. package/dist/base/types/core.d.ts +1 -1
  14. package/dist/base/types/core.d.ts.map +1 -1
  15. package/dist/base/types/core.js +1 -0
  16. package/dist/base/types/core.js.map +1 -1
  17. package/dist/base/utils/paths.d.ts +5 -0
  18. package/dist/base/utils/paths.d.ts.map +1 -1
  19. package/dist/base/utils/paths.js +7 -0
  20. package/dist/base/utils/paths.js.map +1 -1
  21. package/dist/base/utils/workspace-path.d.ts +6 -0
  22. package/dist/base/utils/workspace-path.d.ts.map +1 -0
  23. package/dist/base/utils/workspace-path.js +24 -0
  24. package/dist/base/utils/workspace-path.js.map +1 -0
  25. package/dist/base/utils/workspace-root.d.ts +6 -0
  26. package/dist/base/utils/workspace-root.d.ts.map +1 -0
  27. package/dist/base/utils/workspace-root.js +87 -0
  28. package/dist/base/utils/workspace-root.js.map +1 -0
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +2 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/interface/chat/chat-event-state.d.ts +2 -0
  34. package/dist/interface/chat/chat-event-state.d.ts.map +1 -1
  35. package/dist/interface/chat/chat-event-state.js +22 -41
  36. package/dist/interface/chat/chat-event-state.js.map +1 -1
  37. package/dist/interface/chat/chat-events.d.ts +15 -1
  38. package/dist/interface/chat/chat-events.d.ts.map +1 -1
  39. package/dist/interface/chat/chat-history.d.ts +3816 -192
  40. package/dist/interface/chat/chat-history.d.ts.map +1 -1
  41. package/dist/interface/chat/chat-history.js +529 -5
  42. package/dist/interface/chat/chat-history.js.map +1 -1
  43. package/dist/interface/chat/chat-runner-commands.d.ts +2 -0
  44. package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
  45. package/dist/interface/chat/chat-runner-commands.js +83 -22
  46. package/dist/interface/chat/chat-runner-commands.js.map +1 -1
  47. package/dist/interface/chat/chat-runner-contracts.d.ts +5 -1
  48. package/dist/interface/chat/chat-runner-contracts.d.ts.map +1 -1
  49. package/dist/interface/chat/chat-runner-event-bridge.d.ts +13 -1
  50. package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -1
  51. package/dist/interface/chat/chat-runner-event-bridge.js +51 -3
  52. package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -1
  53. package/dist/interface/chat/chat-runner-routes.d.ts +5 -17
  54. package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -1
  55. package/dist/interface/chat/chat-runner-routes.js +80 -51
  56. package/dist/interface/chat/chat-runner-routes.js.map +1 -1
  57. package/dist/interface/chat/chat-runner-runtime.d.ts.map +1 -1
  58. package/dist/interface/chat/chat-runner-runtime.js +4 -0
  59. package/dist/interface/chat/chat-runner-runtime.js.map +1 -1
  60. package/dist/interface/chat/chat-runner.d.ts +7 -1
  61. package/dist/interface/chat/chat-runner.d.ts.map +1 -1
  62. package/dist/interface/chat/chat-runner.js +135 -49
  63. package/dist/interface/chat/chat-runner.js.map +1 -1
  64. package/dist/interface/chat/chat-session-store.d.ts +3 -0
  65. package/dist/interface/chat/chat-session-store.d.ts.map +1 -1
  66. package/dist/interface/chat/chat-session-store.js +12 -0
  67. package/dist/interface/chat/chat-session-store.js.map +1 -1
  68. package/dist/interface/chat/cross-platform-session.d.ts +15 -0
  69. package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
  70. package/dist/interface/chat/cross-platform-session.js +260 -42
  71. package/dist/interface/chat/cross-platform-session.js.map +1 -1
  72. package/dist/interface/chat/failure-recovery.d.ts.map +1 -1
  73. package/dist/interface/chat/failure-recovery.js +15 -1
  74. package/dist/interface/chat/failure-recovery.js.map +1 -1
  75. package/dist/interface/chat/freeform-route-classifier.d.ts +4 -4
  76. package/dist/interface/chat/ingress-router.d.ts +3 -0
  77. package/dist/interface/chat/ingress-router.d.ts.map +1 -1
  78. package/dist/interface/chat/ingress-router.js +3 -0
  79. package/dist/interface/chat/ingress-router.js.map +1 -1
  80. package/dist/interface/chat/model-request-builder.d.ts +37 -0
  81. package/dist/interface/chat/model-request-builder.d.ts.map +1 -0
  82. package/dist/interface/chat/model-request-builder.js +76 -0
  83. package/dist/interface/chat/model-request-builder.js.map +1 -0
  84. package/dist/interface/chat/turn-context.d.ts +200 -0
  85. package/dist/interface/chat/turn-context.d.ts.map +1 -0
  86. package/dist/interface/chat/turn-context.js +249 -0
  87. package/dist/interface/chat/turn-context.js.map +1 -0
  88. package/dist/interface/chat/turn-protocol.d.ts +35 -0
  89. package/dist/interface/chat/turn-protocol.d.ts.map +1 -0
  90. package/dist/interface/chat/turn-protocol.js +27 -0
  91. package/dist/interface/chat/turn-protocol.js.map +1 -0
  92. package/dist/interface/chat/user-input.d.ts +55 -0
  93. package/dist/interface/chat/user-input.d.ts.map +1 -0
  94. package/dist/interface/chat/user-input.js +52 -0
  95. package/dist/interface/chat/user-input.js.map +1 -0
  96. package/dist/interface/cli/cli-command-registry.d.ts +1 -1
  97. package/dist/interface/cli/cli-command-registry.d.ts.map +1 -1
  98. package/dist/interface/cli/cli-command-registry.js +12 -16
  99. package/dist/interface/cli/cli-command-registry.js.map +1 -1
  100. package/dist/interface/cli/cli-runner.js +0 -0
  101. package/dist/interface/cli/commands/daemon-shared.d.ts +12 -1
  102. package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -1
  103. package/dist/interface/cli/commands/daemon-shared.js +26 -4
  104. package/dist/interface/cli/commands/daemon-shared.js.map +1 -1
  105. package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
  106. package/dist/interface/cli/commands/daemon.js +66 -8
  107. package/dist/interface/cli/commands/daemon.js.map +1 -1
  108. package/dist/interface/cli/commands/doctor.d.ts +1 -1
  109. package/dist/interface/cli/commands/doctor.d.ts.map +1 -1
  110. package/dist/interface/cli/commands/doctor.js +61 -29
  111. package/dist/interface/cli/commands/doctor.js.map +1 -1
  112. package/dist/interface/cli/commands/goal-dispatch.d.ts.map +1 -1
  113. package/dist/interface/cli/commands/goal-dispatch.js +10 -6
  114. package/dist/interface/cli/commands/goal-dispatch.js.map +1 -1
  115. package/dist/interface/cli/commands/goal-utils.d.ts.map +1 -1
  116. package/dist/interface/cli/commands/goal-utils.js +3 -5
  117. package/dist/interface/cli/commands/goal-utils.js.map +1 -1
  118. package/dist/interface/cli/commands/run.d.ts.map +1 -1
  119. package/dist/interface/cli/commands/run.js +50 -0
  120. package/dist/interface/cli/commands/run.js.map +1 -1
  121. package/dist/interface/cli/setup.d.ts +1 -1
  122. package/dist/interface/cli/setup.d.ts.map +1 -1
  123. package/dist/interface/cli/setup.js +4 -3
  124. package/dist/interface/cli/setup.js.map +1 -1
  125. package/dist/interface/cli/utils/loop-runner.d.ts +1 -0
  126. package/dist/interface/cli/utils/loop-runner.d.ts.map +1 -1
  127. package/dist/interface/cli/utils/loop-runner.js +12 -3
  128. package/dist/interface/cli/utils/loop-runner.js.map +1 -1
  129. package/dist/interface/tui/app.d.ts +6 -1
  130. package/dist/interface/tui/app.d.ts.map +1 -1
  131. package/dist/interface/tui/app.js +29 -12
  132. package/dist/interface/tui/app.js.map +1 -1
  133. package/dist/interface/tui/bash-mode.d.ts.map +1 -1
  134. package/dist/interface/tui/bash-mode.js +2 -9
  135. package/dist/interface/tui/bash-mode.js.map +1 -1
  136. package/dist/interface/tui/chat/viewport.d.ts.map +1 -1
  137. package/dist/interface/tui/chat/viewport.js +57 -11
  138. package/dist/interface/tui/chat/viewport.js.map +1 -1
  139. package/dist/interface/tui/entry-deps.d.ts +6 -1
  140. package/dist/interface/tui/entry-deps.d.ts.map +1 -1
  141. package/dist/interface/tui/entry-deps.js +3 -0
  142. package/dist/interface/tui/entry-deps.js.map +1 -1
  143. package/dist/interface/tui/entry.d.ts.map +1 -1
  144. package/dist/interface/tui/entry.js +6 -2
  145. package/dist/interface/tui/entry.js.map +1 -1
  146. package/dist/interface/tui/input-action.d.ts.map +1 -1
  147. package/dist/interface/tui/input-action.js +3 -2
  148. package/dist/interface/tui/input-action.js.map +1 -1
  149. package/dist/interface/tui/intent-recognizer.d.ts.map +1 -1
  150. package/dist/interface/tui/intent-recognizer.js +21 -33
  151. package/dist/interface/tui/intent-recognizer.js.map +1 -1
  152. package/dist/orchestrator/execution/adapter-layer.d.ts +10 -1
  153. package/dist/orchestrator/execution/adapter-layer.d.ts.map +1 -1
  154. package/dist/orchestrator/execution/adapter-layer.js.map +1 -1
  155. package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.d.ts +12 -1
  156. package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.d.ts.map +1 -1
  157. package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.js +16 -31
  158. package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.js.map +1 -1
  159. package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.d.ts +75 -0
  160. package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.d.ts.map +1 -0
  161. package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.js +10 -0
  162. package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.js.map +1 -0
  163. package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.d.ts +3 -2
  164. package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.d.ts.map +1 -1
  165. package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.js +185 -22
  166. package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.js.map +1 -1
  167. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.d.ts.map +1 -1
  168. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js +18 -1
  169. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js.map +1 -1
  170. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
  171. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +7 -1
  172. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
  173. package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts +8 -1
  174. package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts.map +1 -1
  175. package/dist/orchestrator/execution/agent-loop/agent-loop-events.js.map +1 -1
  176. package/dist/orchestrator/execution/agent-loop/agent-loop-history.d.ts +3 -1
  177. package/dist/orchestrator/execution/agent-loop/agent-loop-history.d.ts.map +1 -1
  178. package/dist/orchestrator/execution/agent-loop/agent-loop-history.js +12 -3
  179. package/dist/orchestrator/execution/agent-loop/agent-loop-history.js.map +1 -1
  180. package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.d.ts.map +1 -1
  181. package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.js +7 -1
  182. package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.js.map +1 -1
  183. package/dist/orchestrator/execution/agent-loop/agent-loop-model.d.ts +37 -0
  184. package/dist/orchestrator/execution/agent-loop/agent-loop-model.d.ts.map +1 -1
  185. package/dist/orchestrator/execution/agent-loop/agent-loop-model.js +21 -0
  186. package/dist/orchestrator/execution/agent-loop/agent-loop-model.js.map +1 -1
  187. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.d.ts.map +1 -1
  188. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js +1 -0
  189. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js.map +1 -1
  190. package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts +19 -11
  191. package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts.map +1 -1
  192. package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.d.ts +4 -0
  193. package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.d.ts.map +1 -1
  194. package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.js +135 -0
  195. package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.js.map +1 -1
  196. package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts +3 -2
  197. package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts.map +1 -1
  198. package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js +68 -61
  199. package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js.map +1 -1
  200. package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts +3 -1
  201. package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts.map +1 -1
  202. package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.js.map +1 -1
  203. package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts +12 -1
  204. package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts.map +1 -1
  205. package/dist/orchestrator/execution/agent-loop/agent-timeline.js +19 -56
  206. package/dist/orchestrator/execution/agent-loop/agent-timeline.js.map +1 -1
  207. package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.d.ts.map +1 -1
  208. package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.js +8 -2
  209. package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.js.map +1 -1
  210. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts +14 -0
  211. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
  212. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +440 -81
  213. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
  214. package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts +1 -1
  215. package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts.map +1 -1
  216. package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js +80 -12
  217. package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js.map +1 -1
  218. package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts +1 -0
  219. package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts.map +1 -1
  220. package/dist/orchestrator/execution/agent-loop/chat-display-output.js +3 -1
  221. package/dist/orchestrator/execution/agent-loop/chat-display-output.js.map +1 -1
  222. package/dist/orchestrator/execution/agent-loop/index.d.ts +3 -0
  223. package/dist/orchestrator/execution/agent-loop/index.d.ts.map +1 -1
  224. package/dist/orchestrator/execution/agent-loop/index.js +3 -0
  225. package/dist/orchestrator/execution/agent-loop/index.js.map +1 -1
  226. package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.d.ts +1 -0
  227. package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.d.ts.map +1 -1
  228. package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.js +51 -9
  229. package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.js.map +1 -1
  230. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.d.ts +20 -0
  231. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.d.ts.map +1 -0
  232. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js +181 -0
  233. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js.map +1 -0
  234. package/dist/orchestrator/execution/agent-loop/response-item.d.ts +805 -0
  235. package/dist/orchestrator/execution/agent-loop/response-item.d.ts.map +1 -0
  236. package/dist/orchestrator/execution/agent-loop/response-item.js +104 -0
  237. package/dist/orchestrator/execution/agent-loop/response-item.js.map +1 -0
  238. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.d.ts +7 -2
  239. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.d.ts.map +1 -1
  240. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js +33 -1
  241. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js.map +1 -1
  242. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts +32 -17
  243. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts.map +1 -1
  244. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js +174 -16
  245. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js.map +1 -1
  246. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.d.ts +2 -0
  247. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.d.ts.map +1 -1
  248. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js +10 -4
  249. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js.map +1 -1
  250. package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.d.ts +0 -1
  251. package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.d.ts.map +1 -1
  252. package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.js +7 -87
  253. package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.js.map +1 -1
  254. package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.d.ts.map +1 -1
  255. package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.js +25 -0
  256. package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.js.map +1 -1
  257. package/dist/orchestrator/execution/context/issue-context-fetcher.d.ts +5 -1
  258. package/dist/orchestrator/execution/context/issue-context-fetcher.d.ts.map +1 -1
  259. package/dist/orchestrator/execution/context/issue-context-fetcher.js +7 -4
  260. package/dist/orchestrator/execution/context/issue-context-fetcher.js.map +1 -1
  261. package/dist/orchestrator/execution/task/task-artifact-contract.d.ts +18 -0
  262. package/dist/orchestrator/execution/task/task-artifact-contract.d.ts.map +1 -0
  263. package/dist/orchestrator/execution/task/task-artifact-contract.js +199 -0
  264. package/dist/orchestrator/execution/task/task-artifact-contract.js.map +1 -0
  265. package/dist/orchestrator/execution/task/task-diff-capture.d.ts +15 -1
  266. package/dist/orchestrator/execution/task/task-diff-capture.d.ts.map +1 -1
  267. package/dist/orchestrator/execution/task/task-diff-capture.js +271 -18
  268. package/dist/orchestrator/execution/task/task-diff-capture.js.map +1 -1
  269. package/dist/orchestrator/execution/task/task-execution-helpers.d.ts +1 -0
  270. package/dist/orchestrator/execution/task/task-execution-helpers.d.ts.map +1 -1
  271. package/dist/orchestrator/execution/task/task-execution-helpers.js +76 -17
  272. package/dist/orchestrator/execution/task/task-execution-helpers.js.map +1 -1
  273. package/dist/orchestrator/execution/task/task-execution-types.d.ts +2 -0
  274. package/dist/orchestrator/execution/task/task-execution-types.d.ts.map +1 -1
  275. package/dist/orchestrator/execution/task/task-execution-types.js.map +1 -1
  276. package/dist/orchestrator/execution/task/task-executor.d.ts +16 -1
  277. package/dist/orchestrator/execution/task/task-executor.d.ts.map +1 -1
  278. package/dist/orchestrator/execution/task/task-executor.js +56 -50
  279. package/dist/orchestrator/execution/task/task-executor.js.map +1 -1
  280. package/dist/orchestrator/execution/task/task-generation.d.ts +62 -2
  281. package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
  282. package/dist/orchestrator/execution/task/task-generation.js +30 -13
  283. package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
  284. package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts +2 -2
  285. package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -1
  286. package/dist/orchestrator/execution/task/task-lifecycle-runner.js +32 -4
  287. package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -1
  288. package/dist/orchestrator/execution/task/task-lifecycle.d.ts +3 -3
  289. package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
  290. package/dist/orchestrator/execution/task/task-lifecycle.js +109 -10
  291. package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
  292. package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts +9 -0
  293. package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts.map +1 -1
  294. package/dist/orchestrator/execution/task/task-outcome-ledger.js +64 -3
  295. package/dist/orchestrator/execution/task/task-outcome-ledger.js.map +1 -1
  296. package/dist/orchestrator/execution/task/task-prompt-builder.d.ts +3 -1
  297. package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
  298. package/dist/orchestrator/execution/task/task-prompt-builder.js +28 -13
  299. package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
  300. package/dist/orchestrator/execution/task/task-verifier-rules.d.ts +3 -2
  301. package/dist/orchestrator/execution/task/task-verifier-rules.d.ts.map +1 -1
  302. package/dist/orchestrator/execution/task/task-verifier-rules.js +377 -90
  303. package/dist/orchestrator/execution/task/task-verifier-rules.js.map +1 -1
  304. package/dist/orchestrator/execution/task/task-verifier-types.d.ts +13 -0
  305. package/dist/orchestrator/execution/task/task-verifier-types.d.ts.map +1 -1
  306. package/dist/orchestrator/execution/task/task-verifier-types.js.map +1 -1
  307. package/dist/orchestrator/execution/task/task-verifier.d.ts +5 -4
  308. package/dist/orchestrator/execution/task/task-verifier.d.ts.map +1 -1
  309. package/dist/orchestrator/execution/task/task-verifier.js +396 -25
  310. package/dist/orchestrator/execution/task/task-verifier.js.map +1 -1
  311. package/dist/orchestrator/execution/task/task-workspace.d.ts +5 -0
  312. package/dist/orchestrator/execution/task/task-workspace.d.ts.map +1 -1
  313. package/dist/orchestrator/execution/task/task-workspace.js +20 -10
  314. package/dist/orchestrator/execution/task/task-workspace.js.map +1 -1
  315. package/dist/orchestrator/execution/types/task-group.d.ts +85 -5
  316. package/dist/orchestrator/execution/types/task-group.d.ts.map +1 -1
  317. package/dist/orchestrator/execution/types/task.d.ts +155 -3
  318. package/dist/orchestrator/execution/types/task.d.ts.map +1 -1
  319. package/dist/orchestrator/execution/types/task.js +18 -0
  320. package/dist/orchestrator/execution/types/task.js.map +1 -1
  321. package/dist/orchestrator/loop/durable-loop/contracts.d.ts +2 -0
  322. package/dist/orchestrator/loop/durable-loop/contracts.d.ts.map +1 -1
  323. package/dist/orchestrator/loop/durable-loop/contracts.js.map +1 -1
  324. package/dist/orchestrator/loop/durable-loop/phase-specs.d.ts +12 -12
  325. package/dist/orchestrator/loop/durable-loop/preparation.d.ts.map +1 -1
  326. package/dist/orchestrator/loop/durable-loop/preparation.js +7 -1
  327. package/dist/orchestrator/loop/durable-loop/preparation.js.map +1 -1
  328. package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
  329. package/dist/orchestrator/loop/loop-report-helper.js +2 -0
  330. package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
  331. package/dist/platform/corrections/memory-correction-ledger.d.ts +30 -30
  332. package/dist/platform/corrections/memory-governance.d.ts +2 -2
  333. package/dist/platform/corrections/memory-quarantine.d.ts +2 -2
  334. package/dist/platform/dream/playbook-memory.d.ts +4 -4
  335. package/dist/platform/knowledge/types/agent-memory.d.ts +46 -46
  336. package/dist/platform/observation/context-provider/collector.d.ts.map +1 -1
  337. package/dist/platform/observation/context-provider/collector.js +89 -24
  338. package/dist/platform/observation/context-provider/collector.js.map +1 -1
  339. package/dist/platform/observation/data-source-adapter.d.ts +2 -0
  340. package/dist/platform/observation/data-source-adapter.d.ts.map +1 -1
  341. package/dist/platform/observation/data-source-adapter.js.map +1 -1
  342. package/dist/platform/observation/observation-apply.d.ts.map +1 -1
  343. package/dist/platform/observation/observation-apply.js +8 -2
  344. package/dist/platform/observation/observation-apply.js.map +1 -1
  345. package/dist/platform/observation/observation-engine.d.ts.map +1 -1
  346. package/dist/platform/observation/observation-engine.js +118 -70
  347. package/dist/platform/observation/observation-engine.js.map +1 -1
  348. package/dist/platform/observation/observation-helpers.d.ts +2 -0
  349. package/dist/platform/observation/observation-helpers.d.ts.map +1 -1
  350. package/dist/platform/observation/observation-helpers.js.map +1 -1
  351. package/dist/platform/observation/types/data-source.d.ts +48 -0
  352. package/dist/platform/observation/types/data-source.d.ts.map +1 -1
  353. package/dist/platform/observation/types/data-source.js +4 -0
  354. package/dist/platform/observation/types/data-source.js.map +1 -1
  355. package/dist/platform/observation/workspace-context.d.ts.map +1 -1
  356. package/dist/platform/observation/workspace-context.js +13 -18
  357. package/dist/platform/observation/workspace-context.js.map +1 -1
  358. package/dist/platform/soil/contracts.d.ts +58 -58
  359. package/dist/prompt/purposes/verification.d.ts +2 -2
  360. package/dist/reporting/report-formatters.d.ts.map +1 -1
  361. package/dist/reporting/report-formatters.js +26 -1
  362. package/dist/reporting/report-formatters.js.map +1 -1
  363. package/dist/reporting/reporting-engine.d.ts.map +1 -1
  364. package/dist/reporting/reporting-engine.js +1 -0
  365. package/dist/reporting/reporting-engine.js.map +1 -1
  366. package/dist/reporting/reporting-types.d.ts +7 -0
  367. package/dist/reporting/reporting-types.d.ts.map +1 -1
  368. package/dist/reporting/types/report.d.ts +12 -0
  369. package/dist/reporting/types/report.d.ts.map +1 -1
  370. package/dist/reporting/types/report.js +1 -0
  371. package/dist/reporting/types/report.js.map +1 -1
  372. package/dist/runtime/approval-broker.d.ts +12 -0
  373. package/dist/runtime/approval-broker.d.ts.map +1 -1
  374. package/dist/runtime/approval-broker.js +27 -7
  375. package/dist/runtime/approval-broker.js.map +1 -1
  376. package/dist/runtime/control/daemon-runtime-control-executor.d.ts.map +1 -1
  377. package/dist/runtime/control/daemon-runtime-control-executor.js +9 -4
  378. package/dist/runtime/control/daemon-runtime-control-executor.js.map +1 -1
  379. package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
  380. package/dist/runtime/control/runtime-control-intent.js +3 -2
  381. package/dist/runtime/control/runtime-control-intent.js.map +1 -1
  382. package/dist/runtime/control/runtime-control-service.d.ts +27 -1
  383. package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
  384. package/dist/runtime/control/runtime-control-service.js +181 -2
  385. package/dist/runtime/control/runtime-control-service.js.map +1 -1
  386. package/dist/runtime/control/runtime-target-resolver.js +2 -0
  387. package/dist/runtime/control/runtime-target-resolver.js.map +1 -1
  388. package/dist/runtime/daemon/browser-backpressure-policy.d.ts +22 -0
  389. package/dist/runtime/daemon/browser-backpressure-policy.d.ts.map +1 -0
  390. package/dist/runtime/daemon/browser-backpressure-policy.js +95 -0
  391. package/dist/runtime/daemon/browser-backpressure-policy.js.map +1 -0
  392. package/dist/runtime/daemon/client.d.ts +1 -0
  393. package/dist/runtime/daemon/client.d.ts.map +1 -1
  394. package/dist/runtime/daemon/client.js.map +1 -1
  395. package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
  396. package/dist/runtime/daemon/runner-goal-cycle.js +1 -2
  397. package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
  398. package/dist/runtime/daemon/runner-recovery.d.ts +17 -3
  399. package/dist/runtime/daemon/runner-recovery.d.ts.map +1 -1
  400. package/dist/runtime/daemon/runner-recovery.js +50 -12
  401. package/dist/runtime/daemon/runner-recovery.js.map +1 -1
  402. package/dist/runtime/daemon/runner-startup.d.ts.map +1 -1
  403. package/dist/runtime/daemon/runner-startup.js +18 -1
  404. package/dist/runtime/daemon/runner-startup.js.map +1 -1
  405. package/dist/runtime/daemon/runner.d.ts.map +1 -1
  406. package/dist/runtime/daemon/runner.js +13 -3
  407. package/dist/runtime/daemon/runner.js.map +1 -1
  408. package/dist/runtime/daemon/runtime-ownership.d.ts +7 -1
  409. package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -1
  410. package/dist/runtime/daemon/runtime-ownership.js +171 -25
  411. package/dist/runtime/daemon/runtime-ownership.js.map +1 -1
  412. package/dist/runtime/daemon/wait-deadline-resolver.d.ts.map +1 -1
  413. package/dist/runtime/daemon/wait-deadline-resolver.js +2 -0
  414. package/dist/runtime/daemon/wait-deadline-resolver.js.map +1 -1
  415. package/dist/runtime/event/server-snapshot-reader.d.ts +3 -1
  416. package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -1
  417. package/dist/runtime/event/server-snapshot-reader.js +68 -2
  418. package/dist/runtime/event/server-snapshot-reader.js.map +1 -1
  419. package/dist/runtime/event/server-types.d.ts +2 -0
  420. package/dist/runtime/event/server-types.d.ts.map +1 -1
  421. package/dist/runtime/evidence-answer.d.ts.map +1 -1
  422. package/dist/runtime/evidence-answer.js +34 -7
  423. package/dist/runtime/evidence-answer.js.map +1 -1
  424. package/dist/runtime/gateway/channel-adapter.d.ts +3 -0
  425. package/dist/runtime/gateway/channel-adapter.d.ts.map +1 -1
  426. package/dist/runtime/gateway/channel-display-policy.d.ts +42 -0
  427. package/dist/runtime/gateway/channel-display-policy.d.ts.map +1 -0
  428. package/dist/runtime/gateway/channel-display-policy.js +85 -0
  429. package/dist/runtime/gateway/channel-display-policy.js.map +1 -0
  430. package/dist/runtime/gateway/chat-event-rendering.d.ts +2 -1
  431. package/dist/runtime/gateway/chat-event-rendering.d.ts.map +1 -1
  432. package/dist/runtime/gateway/chat-event-rendering.js +2 -0
  433. package/dist/runtime/gateway/chat-event-rendering.js.map +1 -1
  434. package/dist/runtime/gateway/chat-session-dispatch.d.ts.map +1 -1
  435. package/dist/runtime/gateway/chat-session-dispatch.js +4 -9
  436. package/dist/runtime/gateway/chat-session-dispatch.js.map +1 -1
  437. package/dist/runtime/gateway/chat-session-port.d.ts +2 -0
  438. package/dist/runtime/gateway/chat-session-port.d.ts.map +1 -1
  439. package/dist/runtime/gateway/chat-session-port.js.map +1 -1
  440. package/dist/runtime/gateway/discord-gateway-adapter.d.ts +4 -0
  441. package/dist/runtime/gateway/discord-gateway-adapter.d.ts.map +1 -1
  442. package/dist/runtime/gateway/discord-gateway-adapter.js +100 -31
  443. package/dist/runtime/gateway/discord-gateway-adapter.js.map +1 -1
  444. package/dist/runtime/gateway/index.d.ts +4 -0
  445. package/dist/runtime/gateway/index.d.ts.map +1 -1
  446. package/dist/runtime/gateway/index.js +2 -0
  447. package/dist/runtime/gateway/index.js.map +1 -1
  448. package/dist/runtime/gateway/non-tui-display-projector.d.ts +40 -0
  449. package/dist/runtime/gateway/non-tui-display-projector.d.ts.map +1 -0
  450. package/dist/runtime/gateway/non-tui-display-projector.js +166 -0
  451. package/dist/runtime/gateway/non-tui-display-projector.js.map +1 -0
  452. package/dist/runtime/gateway/signal-gateway-adapter.d.ts +1 -0
  453. package/dist/runtime/gateway/signal-gateway-adapter.d.ts.map +1 -1
  454. package/dist/runtime/gateway/signal-gateway-adapter.js +47 -4
  455. package/dist/runtime/gateway/signal-gateway-adapter.js.map +1 -1
  456. package/dist/runtime/gateway/slack-channel-adapter.d.ts +1 -0
  457. package/dist/runtime/gateway/slack-channel-adapter.d.ts.map +1 -1
  458. package/dist/runtime/gateway/slack-channel-adapter.js +93 -18
  459. package/dist/runtime/gateway/slack-channel-adapter.js.map +1 -1
  460. package/dist/runtime/gateway/telegram-gateway-adapter.d.ts +2 -0
  461. package/dist/runtime/gateway/telegram-gateway-adapter.d.ts.map +1 -1
  462. package/dist/runtime/gateway/telegram-gateway-adapter.js +61 -113
  463. package/dist/runtime/gateway/telegram-gateway-adapter.js.map +1 -1
  464. package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts +1 -0
  465. package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts.map +1 -1
  466. package/dist/runtime/gateway/whatsapp-gateway-adapter.js +49 -4
  467. package/dist/runtime/gateway/whatsapp-gateway-adapter.js.map +1 -1
  468. package/dist/runtime/interactive-automation/browser-session-resolver.d.ts +26 -0
  469. package/dist/runtime/interactive-automation/browser-session-resolver.d.ts.map +1 -0
  470. package/dist/runtime/interactive-automation/browser-session-resolver.js +75 -0
  471. package/dist/runtime/interactive-automation/browser-session-resolver.js.map +1 -0
  472. package/dist/runtime/interactive-automation/index.d.ts +2 -0
  473. package/dist/runtime/interactive-automation/index.d.ts.map +1 -1
  474. package/dist/runtime/interactive-automation/index.js +2 -0
  475. package/dist/runtime/interactive-automation/index.js.map +1 -1
  476. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts +35 -0
  477. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts.map +1 -0
  478. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js +125 -0
  479. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js.map +1 -0
  480. package/dist/runtime/permission-dialogue.d.ts +113 -0
  481. package/dist/runtime/permission-dialogue.d.ts.map +1 -0
  482. package/dist/runtime/permission-dialogue.js +82 -0
  483. package/dist/runtime/permission-dialogue.js.map +1 -0
  484. package/dist/runtime/run-spec/derive.d.ts +14 -14
  485. package/dist/runtime/run-spec/handoff.d.ts.map +1 -1
  486. package/dist/runtime/run-spec/handoff.js +33 -0
  487. package/dist/runtime/run-spec/handoff.js.map +1 -1
  488. package/dist/runtime/run-spec/types.d.ts +16 -16
  489. package/dist/runtime/session-registry/types.d.ts +12 -12
  490. package/dist/runtime/store/artifact-retention.d.ts +2 -0
  491. package/dist/runtime/store/artifact-retention.d.ts.map +1 -1
  492. package/dist/runtime/store/artifact-retention.js +24 -21
  493. package/dist/runtime/store/artifact-retention.js.map +1 -1
  494. package/dist/runtime/store/budget-store.d.ts +8 -8
  495. package/dist/runtime/store/evidence-ledger.d.ts.map +1 -1
  496. package/dist/runtime/store/evidence-ledger.js +39 -1
  497. package/dist/runtime/store/evidence-ledger.js.map +1 -1
  498. package/dist/runtime/store/evidence-types.d.ts +204 -204
  499. package/dist/runtime/store/experiment-queue-store.d.ts +20 -20
  500. package/dist/runtime/store/index.d.ts +2 -2
  501. package/dist/runtime/store/index.d.ts.map +1 -1
  502. package/dist/runtime/store/index.js +1 -1
  503. package/dist/runtime/store/index.js.map +1 -1
  504. package/dist/runtime/store/operator-handoff-store.d.ts +3 -3
  505. package/dist/runtime/store/reproducibility-manifest.d.ts +20 -20
  506. package/dist/runtime/store/runtime-operation-schemas.d.ts +95 -62
  507. package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
  508. package/dist/runtime/store/runtime-operation-schemas.js +9 -0
  509. package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
  510. package/dist/runtime/store/runtime-paths.d.ts +2 -0
  511. package/dist/runtime/store/runtime-paths.d.ts.map +1 -1
  512. package/dist/runtime/store/runtime-paths.js +6 -0
  513. package/dist/runtime/store/runtime-paths.js.map +1 -1
  514. package/dist/runtime/store/runtime-schemas.d.ts +2256 -46
  515. package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
  516. package/dist/runtime/store/runtime-schemas.js +85 -0
  517. package/dist/runtime/store/runtime-schemas.js.map +1 -1
  518. package/dist/runtime/types/companion.d.ts +52 -52
  519. package/dist/runtime/types/daemon.d.ts +31 -31
  520. package/dist/tools/automation/InteractiveAutomationTools.d.ts +22 -2
  521. package/dist/tools/automation/InteractiveAutomationTools.d.ts.map +1 -1
  522. package/dist/tools/automation/InteractiveAutomationTools.js +75 -10
  523. package/dist/tools/automation/InteractiveAutomationTools.js.map +1 -1
  524. package/dist/tools/builtin/factory.d.ts +2 -1
  525. package/dist/tools/builtin/factory.d.ts.map +1 -1
  526. package/dist/tools/builtin/factory.js +6 -2
  527. package/dist/tools/builtin/factory.js.map +1 -1
  528. package/dist/tools/execution/MemorySaveTool/MemorySaveTool.d.ts +20 -20
  529. package/dist/tools/execution/RunAdapterTool/RunAdapterTool.d.ts +6 -0
  530. package/dist/tools/execution/RunAdapterTool/RunAdapterTool.d.ts.map +1 -1
  531. package/dist/tools/execution/RunAdapterTool/RunAdapterTool.js +2 -0
  532. package/dist/tools/execution/RunAdapterTool/RunAdapterTool.js.map +1 -1
  533. package/dist/tools/execution-orchestrator.d.ts +29 -0
  534. package/dist/tools/execution-orchestrator.d.ts.map +1 -0
  535. package/dist/tools/execution-orchestrator.js +153 -0
  536. package/dist/tools/execution-orchestrator.js.map +1 -0
  537. package/dist/tools/executor.d.ts +6 -0
  538. package/dist/tools/executor.d.ts.map +1 -1
  539. package/dist/tools/executor.js +48 -11
  540. package/dist/tools/executor.js.map +1 -1
  541. package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.d.ts.map +1 -1
  542. package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js +130 -17
  543. package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js.map +1 -1
  544. package/dist/tools/kaggle/KaggleExperimentTools.js +4 -3
  545. package/dist/tools/kaggle/KaggleExperimentTools.js.map +1 -1
  546. package/dist/tools/kaggle/KaggleSubmissionTools.js +6 -5
  547. package/dist/tools/kaggle/KaggleSubmissionTools.js.map +1 -1
  548. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js +6 -5
  549. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js.map +1 -1
  550. package/dist/tools/kaggle/paths.d.ts.map +1 -1
  551. package/dist/tools/kaggle/paths.js +12 -8
  552. package/dist/tools/kaggle/paths.js.map +1 -1
  553. package/dist/tools/mutation/TaskStopTool/TaskStopTool.d.ts.map +1 -1
  554. package/dist/tools/mutation/TaskStopTool/TaskStopTool.js +8 -0
  555. package/dist/tools/mutation/TaskStopTool/TaskStopTool.js.map +1 -1
  556. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts +8 -8
  557. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts.map +1 -1
  558. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js +49 -7
  559. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
  560. package/dist/tools/network/GitHubCliTool/GitHubCliTool.d.ts +4 -4
  561. package/dist/tools/network/McpStdioTool/McpStdioTool.d.ts +4 -4
  562. package/dist/tools/permission.d.ts +0 -1
  563. package/dist/tools/permission.d.ts.map +1 -1
  564. package/dist/tools/permission.js +9 -33
  565. package/dist/tools/permission.js.map +1 -1
  566. package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.d.ts +4 -4
  567. package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.d.ts +8 -8
  568. package/dist/tools/query/CodeSearchTool/CodeSearchTool.d.ts +4 -4
  569. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts +4 -4
  570. package/dist/tools/query/runtime-session-tools.d.ts +73 -5
  571. package/dist/tools/query/runtime-session-tools.d.ts.map +1 -1
  572. package/dist/tools/query/runtime-session-tools.js +114 -0
  573. package/dist/tools/query/runtime-session-tools.js.map +1 -1
  574. package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +72 -54
  575. package/dist/tools/runtime/LongRunningRuntimeTools.d.ts.map +1 -1
  576. package/dist/tools/runtime/LongRunningRuntimeTools.js +4 -1
  577. package/dist/tools/runtime/LongRunningRuntimeTools.js.map +1 -1
  578. package/dist/tools/runtime/RunSpecHandoffTools.d.ts.map +1 -1
  579. package/dist/tools/runtime/RunSpecHandoffTools.js +162 -2
  580. package/dist/tools/runtime/RunSpecHandoffTools.js.map +1 -1
  581. package/dist/tools/runtime/SetupRuntimeControlTools.d.ts.map +1 -1
  582. package/dist/tools/runtime/SetupRuntimeControlTools.js +169 -17
  583. package/dist/tools/runtime/SetupRuntimeControlTools.js.map +1 -1
  584. package/dist/tools/system/EnvTool/EnvTool.d.ts +4 -4
  585. package/dist/tools/system/GitDiffTool/GitDiffTool.d.ts +4 -4
  586. package/dist/tools/system/GitLogTool/GitLogTool.d.ts +4 -4
  587. package/dist/tools/system/ShellCommandTool/ShellCommandTool.d.ts.map +1 -1
  588. package/dist/tools/system/ShellCommandTool/ShellCommandTool.js +8 -2
  589. package/dist/tools/system/ShellCommandTool/ShellCommandTool.js.map +1 -1
  590. package/dist/tools/system/ShellTool/ShellTool.d.ts.map +1 -1
  591. package/dist/tools/system/ShellTool/ShellTool.js +29 -11
  592. package/dist/tools/system/ShellTool/ShellTool.js.map +1 -1
  593. package/dist/tools/system/ShellTool/command-policy.d.ts +12 -8
  594. package/dist/tools/system/ShellTool/command-policy.d.ts.map +1 -1
  595. package/dist/tools/system/ShellTool/command-policy.js +412 -98
  596. package/dist/tools/system/ShellTool/command-policy.js.map +1 -1
  597. package/dist/tools/system/ShellTool/prompt.d.ts +1 -1
  598. package/dist/tools/system/ShellTool/prompt.d.ts.map +1 -1
  599. package/dist/tools/system/ShellTool/prompt.js +1 -1
  600. package/dist/tools/system/ShellTool/prompt.js.map +1 -1
  601. package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts +1 -1
  602. package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts.map +1 -1
  603. package/dist/tools/system/TestRunnerTool/TestRunnerTool.js +152 -8
  604. package/dist/tools/system/TestRunnerTool/TestRunnerTool.js.map +1 -1
  605. package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js +1 -1
  606. package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js.map +1 -1
  607. package/dist/tools/types.d.ts +36 -12
  608. package/dist/tools/types.d.ts.map +1 -1
  609. package/dist/tools/types.js +26 -3
  610. package/dist/tools/types.js.map +1 -1
  611. package/dist/tools/workspace-scope.d.ts +11 -0
  612. package/dist/tools/workspace-scope.d.ts.map +1 -0
  613. package/dist/tools/workspace-scope.js +77 -0
  614. package/dist/tools/workspace-scope.js.map +1 -0
  615. package/package.json +2 -2
@@ -6,6 +6,8 @@ import { dispatchGatewayChatInput } from "./chat-session-dispatch.js";
6
6
  import { formatPlaintextNotification, supportsCoreGatewayNotification } from "./core-channel-notification.js";
7
7
  import { evaluateChannelAccess, resolveChannelRoute } from "./channel-policy.js";
8
8
  import { createUnsupportedTypingIndicator, withTypingIndicator } from "./typing-indicator.js";
9
+ import { WHATSAPP_GATEWAY_DISPLAY_CONTRACT } from "./channel-display-policy.js";
10
+ import { NonTuiDisplayProjector } from "./non-tui-display-projector.js";
9
11
  export class WhatsAppGatewayNotifier {
10
12
  client;
11
13
  config;
@@ -27,6 +29,7 @@ export class WhatsAppGatewayNotifier {
27
29
  export class WhatsAppGatewayAdapter {
28
30
  config;
29
31
  name = "whatsapp";
32
+ displayContract = WHATSAPP_GATEWAY_DISPLAY_CONTRACT;
30
33
  typingIndicator = createUnsupportedTypingIndicator("whatsapp cloud adapter has no native typing endpoint in the current contract");
31
34
  handler = null;
32
35
  server = null;
@@ -130,6 +133,21 @@ export class WhatsAppGatewayAdapter {
130
133
  senderGoalMap: this.config.sender_goal_map,
131
134
  defaultGoalId: this.config.default_goal_id,
132
135
  }, channelContext);
136
+ const projector = new NonTuiDisplayProjector({
137
+ display: {
138
+ capabilities: WHATSAPP_GATEWAY_DISPLAY_CONTRACT.capabilities,
139
+ policy: {
140
+ progressSurface: "off",
141
+ finalSurface: "chunked",
142
+ cleanupPolicy: "none",
143
+ toolProgress: "off",
144
+ showReasoning: false,
145
+ progressMaxItems: 0,
146
+ progressMaxChars: 0,
147
+ },
148
+ },
149
+ transport: new WhatsAppDisplayTransport(this.client, senderId),
150
+ });
133
151
  const reply = await withTypingIndicator(this.typingIndicator, {
134
152
  platform: "whatsapp",
135
153
  conversation_id: senderId,
@@ -147,6 +165,7 @@ export class WhatsAppGatewayAdapter {
147
165
  sender_id: senderId,
148
166
  message_id: message.id,
149
167
  goal_id: route.goalId,
168
+ onEvent: (event) => projector.handle(event),
150
169
  metadata: {
151
170
  ...route.metadata,
152
171
  message_type: message.type,
@@ -156,10 +175,16 @@ export class WhatsAppGatewayAdapter {
156
175
  ...(access.runtimeControlConfigured && !access.runtimeControlApproved ? { runtime_control_denied: true } : {}),
157
176
  },
158
177
  }));
159
- await this.client.sendTextMessage({
160
- to: senderId,
161
- body: reply ?? "Received.",
162
- });
178
+ if (!projector.renderedAssistantOutput) {
179
+ await projector.handle({
180
+ type: "assistant_final",
181
+ runId: "fallback",
182
+ turnId: "fallback",
183
+ createdAt: new Date().toISOString(),
184
+ text: reply ?? "Received.",
185
+ persisted: false,
186
+ });
187
+ }
163
188
  }
164
189
  extractMessages(payload) {
165
190
  const messages = [];
@@ -199,6 +224,26 @@ export class WhatsAppGatewayAdapter {
199
224
  res.end(JSON.stringify(payload));
200
225
  }
201
226
  }
227
+ class WhatsAppDisplayTransport {
228
+ client;
229
+ recipientId;
230
+ nextId = 0;
231
+ constructor(client, recipientId) {
232
+ this.client = client;
233
+ this.recipientId = recipientId;
234
+ }
235
+ async sendProgress(text) {
236
+ return this.sendFinal(text);
237
+ }
238
+ async editProgress() { }
239
+ async deleteProgress() { }
240
+ async sendFinal(text) {
241
+ await this.client.sendTextMessage({ to: this.recipientId, body: text });
242
+ this.nextId += 1;
243
+ return { id: `whatsapp-${this.nextId}` };
244
+ }
245
+ async editFinal() { }
246
+ }
202
247
  class WhatsAppCloudClient {
203
248
  phoneNumberId;
204
249
  accessToken;
@@ -1 +1 @@
1
- {"version":3,"file":"whatsapp-gateway-adapter.js","sourceRoot":"","sources":["../../../src/runtime/gateway/whatsapp-gateway-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAoC9F,MAAM,OAAO,uBAAuB;IAIf;IACA;IAJV,IAAI,GAAG,kBAAkB,CAAC;IAEnC,YACmB,MAA2B,EAC3B,MAA6B;QAD7B,WAAM,GAAN,MAAM,CAAqB;QAC3B,WAAM,GAAN,MAAM,CAAuB;IAC7C,CAAC;IAEJ,QAAQ,CAAC,SAAgC;QACvC,OAAO,+BAA+B,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,MAAM,CA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E,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EACxF,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { BrowserAutomationSessionRecord } from "../store/index.js";
2
+ import { BrowserSessionStore, type BrowserSessionScope } from "./browser-session-store.js";
3
+ export type BrowserSessionResolution = {
4
+ ok: true;
5
+ sessionId?: string;
6
+ record?: BrowserAutomationSessionRecord;
7
+ } | {
8
+ ok: false;
9
+ code: "browser_session_scope_required" | "browser_session_not_found" | "browser_session_stale" | "browser_session_scope_mismatch";
10
+ summary: string;
11
+ sessionId?: string;
12
+ };
13
+ export declare class BrowserSessionResolver {
14
+ private readonly store?;
15
+ constructor(store?: BrowserSessionStore | undefined);
16
+ resolveForWorkflow(input: {
17
+ scope: BrowserSessionScope;
18
+ sessionId?: string;
19
+ }): Promise<BrowserSessionResolution>;
20
+ resolveForState(input: {
21
+ scope?: BrowserSessionScope;
22
+ sessionId?: string;
23
+ }): Promise<BrowserSessionResolution>;
24
+ private resolve;
25
+ }
26
+ //# sourceMappingURL=browser-session-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-session-resolver.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/browser-session-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE3F,MAAM,MAAM,wBAAwB,GAChC;IACA,EAAE,EAAE,IAAI,CAAC;IACT,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC,GACC;IACA,EAAE,EAAE,KAAK,CAAC;IACV,IAAI,EACA,gCAAgC,GAChC,2BAA2B,GAC3B,uBAAuB,GACvB,gCAAgC,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAN,KAAK,CAAC,EAAE,mBAAmB,YAAA;IAElD,kBAAkB,CAAC,KAAK,EAAE;QAC9B,KAAK,EAAE,mBAAmB,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI/B,eAAe,CAAC,KAAK,EAAE;QAC3B,KAAK,CAAC,EAAE,mBAAmB,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,wBAAwB,CAAC;YAWvB,OAAO;CAgDtB"}
@@ -0,0 +1,75 @@
1
+ export class BrowserSessionResolver {
2
+ store;
3
+ constructor(store) {
4
+ this.store = store;
5
+ }
6
+ async resolveForWorkflow(input) {
7
+ return this.resolve({ ...input, implicitAllowed: true });
8
+ }
9
+ async resolveForState(input) {
10
+ if (!input.sessionId && !input.scope) {
11
+ return {
12
+ ok: false,
13
+ code: "browser_session_scope_required",
14
+ summary: "browser_get_state requires sessionId or explicit service scope before reusing the latest browser session",
15
+ };
16
+ }
17
+ return this.resolve({ ...input, implicitAllowed: Boolean(input.scope) });
18
+ }
19
+ async resolve(input) {
20
+ if (!this.store) {
21
+ return input.sessionId ? { ok: true, sessionId: input.sessionId } : { ok: true };
22
+ }
23
+ if (input.sessionId) {
24
+ const record = await this.store.load(input.sessionId);
25
+ if (!record) {
26
+ return {
27
+ ok: false,
28
+ code: "browser_session_not_found",
29
+ summary: `Browser session ${input.sessionId} was not found`,
30
+ sessionId: input.sessionId,
31
+ };
32
+ }
33
+ if (input.scope && !sameScope(record, input.scope)) {
34
+ return {
35
+ ok: false,
36
+ code: "browser_session_scope_mismatch",
37
+ summary: `Browser session ${input.sessionId} does not match the requested browser scope`,
38
+ sessionId: input.sessionId,
39
+ };
40
+ }
41
+ const staleReason = staleSessionReason(record);
42
+ if (staleReason) {
43
+ return {
44
+ ok: false,
45
+ code: "browser_session_stale",
46
+ summary: `Browser session ${input.sessionId} is not reusable: ${staleReason}`,
47
+ sessionId: input.sessionId,
48
+ };
49
+ }
50
+ return { ok: true, sessionId: record.session_id, record };
51
+ }
52
+ if (!input.implicitAllowed || !input.scope) {
53
+ return { ok: true };
54
+ }
55
+ const latest = await this.store.findLatest(input.scope, ["authenticated"]);
56
+ return latest
57
+ ? { ok: true, sessionId: latest.session_id, record: latest }
58
+ : { ok: true };
59
+ }
60
+ }
61
+ function sameScope(record, scope) {
62
+ return record.provider_id === scope.providerId
63
+ && record.service_key === scope.serviceKey
64
+ && record.workspace === scope.workspace
65
+ && record.actor_key === scope.actorKey;
66
+ }
67
+ function staleSessionReason(record) {
68
+ if (record.state !== "authenticated")
69
+ return record.state;
70
+ if (!record.expires_at)
71
+ return null;
72
+ const expiresAtMs = Date.parse(record.expires_at);
73
+ return Number.isFinite(expiresAtMs) && expiresAtMs <= Date.now() ? "expired" : null;
74
+ }
75
+ //# sourceMappingURL=browser-session-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-session-resolver.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/browser-session-resolver.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,KAA2B;QAA3B,UAAK,GAAL,KAAK,CAAsB;IAAG,CAAC;IAE5D,KAAK,CAAC,kBAAkB,CAAC,KAGxB;QACC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,KAGrB;QACC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACrC,OAAO;gBACL,EA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,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACtF,CAAC"}
@@ -3,6 +3,8 @@ export * from "./registry.js";
3
3
  export * from "./default-registry.js";
4
4
  export * from "./failure-classifier.js";
5
5
  export * from "./browser-session-store.js";
6
+ export * from "./browser-session-resolver.js";
7
+ export * from "./runtime-auth-handoff-store.js";
6
8
  export * from "./providers/noop.js";
7
9
  export * from "./providers/codex-app.js";
8
10
  export * from "./providers/perplexity-research.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
@@ -3,6 +3,8 @@ export * from "./registry.js";
3
3
  export * from "./default-registry.js";
4
4
  export * from "./failure-classifier.js";
5
5
  export * from "./browser-session-store.js";
6
+ export * from "./browser-session-resolver.js";
7
+ export * from "./runtime-auth-handoff-store.js";
6
8
  export * from "./providers/noop.js";
7
9
  export * from "./providers/codex-app.js";
8
10
  export * from "./providers/perplexity-research.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { RuntimeAuthHandoffRecord, RuntimeAuthHandoffState, RuntimeControlActor, RuntimeControlReplyTarget } from "../store/index.js";
2
+ import { type RuntimeStorePaths } from "../store/index.js";
3
+ import type { BrowserSessionScope } from "./browser-session-store.js";
4
+ export interface RuntimeAuthHandoffCreateInput {
5
+ providerId: string;
6
+ serviceKey: string;
7
+ workspace: string;
8
+ actorKey: string;
9
+ state?: Extract<RuntimeAuthHandoffState, "requested" | "pending_operator" | "blocked">;
10
+ browserSessionId?: string | null;
11
+ resumableSessionId?: string | null;
12
+ replyTarget?: RuntimeControlReplyTarget | null;
13
+ requestedBy?: RuntimeControlActor | null;
14
+ expiresAt?: string | null;
15
+ failureCode?: string | null;
16
+ failureMessage?: string | null;
17
+ taskSummary: string;
18
+ evidenceRefs?: RuntimeAuthHandoffRecord["evidence_refs"];
19
+ }
20
+ export declare class RuntimeAuthHandoffStore {
21
+ private readonly paths;
22
+ private readonly journal;
23
+ constructor(runtimeRootOrPaths?: string | RuntimeStorePaths);
24
+ ensureReady(): Promise<void>;
25
+ load(handoffId: string): Promise<RuntimeAuthHandoffRecord | null>;
26
+ list(): Promise<RuntimeAuthHandoffRecord[]>;
27
+ listActive(scope?: BrowserSessionScope): Promise<RuntimeAuthHandoffRecord[]>;
28
+ findLatestActive(scope: BrowserSessionScope): Promise<RuntimeAuthHandoffRecord | null>;
29
+ upsert(record: RuntimeAuthHandoffRecord): Promise<RuntimeAuthHandoffRecord>;
30
+ createPending(input: RuntimeAuthHandoffCreateInput): Promise<RuntimeAuthHandoffRecord>;
31
+ transition(handoffId: string, state: RuntimeAuthHandoffState, updates?: Partial<Pick<RuntimeAuthHandoffRecord, "browser_session_id" | "resumable_session_id" | "failure_code" | "failure_message" | "evidence_refs">>): Promise<RuntimeAuthHandoffRecord | null>;
32
+ transitionLatestActive(scope: BrowserSessionScope, state: RuntimeAuthHandoffState, updates?: Partial<Pick<RuntimeAuthHandoffRecord, "browser_session_id" | "resumable_session_id" | "failure_code" | "failure_message" | "evidence_refs">>): Promise<RuntimeAuthHandoffRecord | null>;
33
+ private supersedeActive;
34
+ }
35
+ //# sourceMappingURL=runtime-auth-handoff-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-auth-handoff-store.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/runtime-auth-handoff-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACx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C,KAAK,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAa5E,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAItF,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAO3E,aAAa,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA8CtF,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,uBAAuB,EAC9B,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAC5C,oBAAoB,GAAG,sBAAsB,GAAG,cAAc,GAAG,iBAAiB,GAAG,eAAe,CACrG,CAAM,GACN,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAarC,sBAAsB,CAC1B,KAAK,EAAE,mBAAmB,EAC1B,KAAK,EAAE,uBAAuB,EAC9B,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAC5C,oBAAoB,GAAG,sBAAsB,GAAG,cAAc,GAAG,iBAAiB,GAAG,eAAe,CACrG,CAAM,GACN,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;YAM7B,eAAe;CAe9B"}
@@ -0,0 +1,125 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { createRuntimeStorePaths, RuntimeAuthHandoffRecordSchema, RuntimeJournal, } from "../store/index.js";
3
+ const ACTIVE_STATES = new Set([
4
+ "requested",
5
+ "pending_operator",
6
+ "in_progress",
7
+ "blocked",
8
+ ]);
9
+ const RuntimeAuthHandoffJournalSchema = RuntimeAuthHandoffRecordSchema;
10
+ export class RuntimeAuthHandoffStore {
11
+ paths;
12
+ journal;
13
+ constructor(runtimeRootOrPaths) {
14
+ this.paths =
15
+ typeof runtimeRootOrPaths === "string"
16
+ ? createRuntimeStorePaths(runtimeRootOrPaths)
17
+ : runtimeRootOrPaths ?? createRuntimeStorePaths();
18
+ this.journal = new RuntimeJournal(this.paths);
19
+ }
20
+ async ensureReady() {
21
+ await this.journal.ensureReady();
22
+ }
23
+ async load(handoffId) {
24
+ return this.journal.load(this.paths.authHandoffPath(handoffId), RuntimeAuthHandoffJournalSchema);
25
+ }
26
+ async list() {
27
+ return this.journal.list(this.paths.authHandoffsDir, RuntimeAuthHandoffJournalSchema);
28
+ }
29
+ async listActive(scope) {
30
+ return (await this.list())
31
+ .filter((record) => ACTIVE_STATES.has(record.state)
32
+ && (!scope
33
+ || (record.provider_id === scope.providerId
34
+ && record.service_key === scope.serviceKey
35
+ && record.workspace === scope.workspace
36
+ && record.actor_key === scope.actorKey)))
37
+ .sort((a, b) => b.updated_at.localeCompare(a.updated_at));
38
+ }
39
+ async findLatestActive(scope) {
40
+ return (await this.listActive(scope))[0] ?? null;
41
+ }
42
+ async upsert(record) {
43
+ await this.ensureReady();
44
+ const parsed = RuntimeAuthHandoffRecordSchema.parse(record);
45
+ await this.journal.save(this.paths.authHandoffPath(parsed.handoff_id), RuntimeAuthHandoffJournalSchema, parsed);
46
+ return parsed;
47
+ }
48
+ async createPending(input) {
49
+ const now = new Date().toISOString();
50
+ const scope = {
51
+ providerId: input.providerId,
52
+ serviceKey: input.serviceKey,
53
+ workspace: input.workspace,
54
+ actorKey: input.actorKey,
55
+ };
56
+ const superseded = await this.supersedeActive(scope, now);
57
+ const latestSuperseded = superseded[0] ?? null;
58
+ const handoff = {
59
+ schema_version: "runtime-auth-handoff-v1",
60
+ handoff_id: randomUUID(),
61
+ provider_id: input.providerId,
62
+ service_key: input.serviceKey,
63
+ workspace: input.workspace,
64
+ actor_key: input.actorKey,
65
+ state: input.state ?? "pending_operator",
66
+ requested_at: now,
67
+ updated_at: now,
68
+ expires_at: input.expiresAt ?? null,
69
+ completed_at: null,
70
+ browser_session_id: input.browserSessionId ?? null,
71
+ resumable_session_id: input.resumableSessionId ?? null,
72
+ supersedes_handoff_id: latestSuperseded?.handoff_id ?? null,
73
+ superseded_by_handoff_id: null,
74
+ reply_target: input.replyTarget ?? null,
75
+ requested_by: input.requestedBy ?? null,
76
+ failure_code: input.failureCode ?? null,
77
+ failure_message: input.failureMessage ?? null,
78
+ resume_hint: {
79
+ tool_name: "browser_run_workflow",
80
+ task_summary: input.taskSummary,
81
+ },
82
+ evidence_refs: input.evidenceRefs ?? [],
83
+ };
84
+ const created = await this.upsert(handoff);
85
+ for (const record of superseded) {
86
+ await this.upsert({
87
+ ...record,
88
+ superseded_by_handoff_id: created.handoff_id,
89
+ });
90
+ }
91
+ return created;
92
+ }
93
+ async transition(handoffId, state, updates = {}) {
94
+ const existing = await this.load(handoffId);
95
+ if (!existing)
96
+ return null;
97
+ const now = new Date().toISOString();
98
+ return this.upsert({
99
+ ...existing,
100
+ ...updates,
101
+ state,
102
+ updated_at: now,
103
+ completed_at: state === "completed" ? now : existing.completed_at ?? null,
104
+ });
105
+ }
106
+ async transitionLatestActive(scope, state, updates = {}) {
107
+ const latest = await this.findLatestActive(scope);
108
+ if (!latest)
109
+ return null;
110
+ return this.transition(latest.handoff_id, state, updates);
111
+ }
112
+ async supersedeActive(scope, now) {
113
+ const active = await this.listActive(scope);
114
+ const superseded = active.map((record) => ({
115
+ ...record,
116
+ state: "superseded",
117
+ updated_at: now,
118
+ }));
119
+ for (const record of superseded) {
120
+ await this.upsert(record);
121
+ }
122
+ return superseded;
123
+ }
124
+ }
125
+ //# sourceMappingURL=runtime-auth-handoff-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-auth-handoff-store.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/runtime-auth-handoff-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,cAAc,GAEf,MAAM,mBAAmB,CAAC;AAI3B,MAAM,aAAa,GAAG,IAAI,GAAG,CAA0B;IACrD,WAAW;IACX,kBAAkB;IACl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;YAAE,OAAO,IAAI,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC;YACjB,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,KAAK;YACL,UAAU,EAAE,GAAG;YACf,YAAY,EAAE,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,KAA0B,EAC1B,KAA8B,EAC9B,UAEK,EAAE;QAEP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,KAA0B,EAC1B,GAAW;QAEX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACzC,GAAG,MAAM;YACT,KAAK,EAAE,YAAqB;YAC5B,UAAU,EAAE,GAAG;SAChB,CAAC,CAAC,CAAC;QACJ,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;YAChC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ import type { ApprovalRecord } from "./store/runtime-schemas.js";
3
+ export declare const PermissionRiskClassSchema: z.ZodEnum<["low", "medium", "high", "critical", "unknown"]>;
4
+ export type PermissionRiskClass = z.infer<typeof PermissionRiskClassSchema>;
5
+ export declare const PendingPermissionTargetSchema: z.ZodObject<{
6
+ session_id: z.ZodOptional<z.ZodString>;
7
+ run_id: z.ZodOptional<z.ZodString>;
8
+ tool_id: z.ZodOptional<z.ZodString>;
9
+ tool_call_id: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ session_id?: string | undefined;
12
+ run_id?: string | undefined;
13
+ tool_id?: string | undefined;
14
+ tool_call_id?: string | undefined;
15
+ }, {
16
+ session_id?: string | undefined;
17
+ run_id?: string | undefined;
18
+ tool_id?: string | undefined;
19
+ tool_call_id?: string | undefined;
20
+ }>;
21
+ export type PendingPermissionTarget = z.infer<typeof PendingPermissionTargetSchema>;
22
+ export declare const PendingPermissionTaskSchema: z.ZodObject<{
23
+ kind: z.ZodLiteral<"permission">;
24
+ id: z.ZodString;
25
+ description: z.ZodString;
26
+ action: z.ZodString;
27
+ operation_summary: z.ZodString;
28
+ risk_class: z.ZodEnum<["low", "medium", "high", "critical", "unknown"]>;
29
+ target: z.ZodObject<{
30
+ session_id: z.ZodOptional<z.ZodString>;
31
+ run_id: z.ZodOptional<z.ZodString>;
32
+ tool_id: z.ZodOptional<z.ZodString>;
33
+ tool_call_id: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ session_id?: string | undefined;
36
+ run_id?: string | undefined;
37
+ tool_id?: string | undefined;
38
+ tool_call_id?: string | undefined;
39
+ }, {
40
+ session_id?: string | undefined;
41
+ run_id?: string | undefined;
42
+ tool_id?: string | undefined;
43
+ tool_call_id?: string | undefined;
44
+ }>;
45
+ state_epoch: z.ZodString;
46
+ state_version: z.ZodOptional<z.ZodString>;
47
+ expires_at: z.ZodOptional<z.ZodNumber>;
48
+ permission_level: z.ZodOptional<z.ZodString>;
49
+ is_destructive: z.ZodOptional<z.ZodBoolean>;
50
+ reversibility: z.ZodOptional<z.ZodString>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ kind: "permission";
53
+ id: string;
54
+ description: string;
55
+ action: string;
56
+ target: {
57
+ session_id?: string | undefined;
58
+ run_id?: string | undefined;
59
+ tool_id?: string | undefined;
60
+ tool_call_id?: string | undefined;
61
+ };
62
+ operation_summary: string;
63
+ risk_class: "unknown" | "low" | "high" | "medium" | "critical";
64
+ state_epoch: string;
65
+ reversibility?: string | undefined;
66
+ expires_at?: number | undefined;
67
+ state_version?: string | undefined;
68
+ permission_level?: string | undefined;
69
+ is_destructive?: boolean | undefined;
70
+ }, {
71
+ kind: "permission";
72
+ id: string;
73
+ description: string;
74
+ action: string;
75
+ target: {
76
+ session_id?: string | undefined;
77
+ run_id?: string | undefined;
78
+ tool_id?: string | undefined;
79
+ tool_call_id?: string | undefined;
80
+ };
81
+ operation_summary: string;
82
+ risk_class: "unknown" | "low" | "high" | "medium" | "critical";
83
+ state_epoch: string;
84
+ reversibility?: string | undefined;
85
+ expires_at?: number | undefined;
86
+ state_version?: string | undefined;
87
+ permission_level?: string | undefined;
88
+ is_destructive?: boolean | undefined;
89
+ }>;
90
+ export type PendingPermissionTask = z.infer<typeof PendingPermissionTaskSchema>;
91
+ export declare function createPendingPermissionTask(input: {
92
+ id: string;
93
+ description: string;
94
+ action: string;
95
+ target: PendingPermissionTarget;
96
+ stateEpoch: string;
97
+ stateVersion?: string;
98
+ expiresAt?: number;
99
+ permissionLevel?: string;
100
+ isDestructive?: boolean;
101
+ reversibility?: string;
102
+ }): PendingPermissionTask;
103
+ export declare function withPermissionExpiry<T extends {
104
+ kind?: string;
105
+ expires_at?: number;
106
+ }>(task: T, expiresAt: number): T;
107
+ export declare function getPendingPermissionTask(record: ApprovalRecord): PendingPermissionTask | null;
108
+ export declare function isPermissionApprovalStale(record: ApprovalRecord, currentStateEpoch: string | null): boolean;
109
+ export declare function classifyPermissionRisk(input: {
110
+ permissionLevel?: string;
111
+ isDestructive?: boolean;
112
+ }): PermissionRiskClass;
113
+ //# sourceMappingURL=permission-dialogue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