@zhin.js/agent 1.1.31 → 1.1.33

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 (1095) hide show
  1. package/README.md +11 -23
  2. package/lib/config/deprecated-agent-binding-keys.d.ts +21 -0
  3. package/lib/config/deprecated-agent-binding-keys.d.ts.map +1 -0
  4. package/lib/config/deprecated-agent-binding-keys.js +37 -0
  5. package/lib/config/deprecated-agent-binding-keys.js.map +1 -0
  6. package/lib/config/deprecated-agent-keys.d.ts +16 -0
  7. package/lib/config/deprecated-agent-keys.d.ts.map +1 -0
  8. package/lib/config/deprecated-agent-keys.js +23 -0
  9. package/lib/config/deprecated-agent-keys.js.map +1 -0
  10. package/lib/config/fix-ai-config.d.ts.map +1 -1
  11. package/lib/config/fix-ai-config.js +16 -20
  12. package/lib/config/fix-ai-config.js.map +1 -1
  13. package/lib/config/index.d.ts +4 -1
  14. package/lib/config/index.d.ts.map +1 -1
  15. package/lib/config/index.js +3 -1
  16. package/lib/config/index.js.map +1 -1
  17. package/lib/config/model-harness-runtime.d.ts.map +1 -1
  18. package/lib/config/model-harness-runtime.js +47 -5
  19. package/lib/config/model-harness-runtime.js.map +1 -1
  20. package/lib/config/model-harness.d.ts +30 -0
  21. package/lib/config/model-harness.d.ts.map +1 -1
  22. package/lib/config/normalize-ai-config.d.ts.map +1 -1
  23. package/lib/config/normalize-ai-config.js +10 -2
  24. package/lib/config/normalize-ai-config.js.map +1 -1
  25. package/lib/config/perception-config.d.ts +36 -0
  26. package/lib/config/perception-config.d.ts.map +1 -0
  27. package/lib/config/perception-config.js +55 -0
  28. package/lib/config/perception-config.js.map +1 -0
  29. package/lib/config/types.d.ts +13 -1
  30. package/lib/config/types.d.ts.map +1 -1
  31. package/lib/config/types.js.map +1 -1
  32. package/lib/config/validate-ai-config.d.ts.map +1 -1
  33. package/lib/config/validate-ai-config.js +0 -19
  34. package/lib/config/validate-ai-config.js.map +1 -1
  35. package/lib/config/zhin-agent-config.d.ts +41 -1
  36. package/lib/config/zhin-agent-config.d.ts.map +1 -1
  37. package/lib/config/zhin-agent-defaults.d.ts.map +1 -1
  38. package/lib/config/zhin-agent-defaults.js +7 -4
  39. package/lib/config/zhin-agent-defaults.js.map +1 -1
  40. package/lib/config/zhin-agent-dependencies.d.ts +5 -0
  41. package/lib/config/zhin-agent-dependencies.d.ts.map +1 -1
  42. package/lib/context/context-system.d.ts +4 -0
  43. package/lib/context/context-system.d.ts.map +1 -1
  44. package/lib/context/context-system.js +2 -0
  45. package/lib/context/context-system.js.map +1 -1
  46. package/lib/context/model-resolver.d.ts +1 -0
  47. package/lib/context/model-resolver.d.ts.map +1 -1
  48. package/lib/context/model-resolver.js +4 -1
  49. package/lib/context/model-resolver.js.map +1 -1
  50. package/lib/context/turn-envelope.d.ts +4 -0
  51. package/lib/context/turn-envelope.d.ts.map +1 -1
  52. package/lib/context/turn-envelope.js +4 -0
  53. package/lib/context/turn-envelope.js.map +1 -1
  54. package/lib/core/agent-core-run.d.ts +22 -1
  55. package/lib/core/agent-core-run.d.ts.map +1 -1
  56. package/lib/core/agent-core-run.js +369 -51
  57. package/lib/core/agent-core-run.js.map +1 -1
  58. package/lib/core/agent-core.d.ts +5 -0
  59. package/lib/core/agent-core.d.ts.map +1 -1
  60. package/lib/core/agent-core.js +5 -0
  61. package/lib/core/agent-core.js.map +1 -1
  62. package/lib/core/agent-loop-standalone.d.ts +6 -0
  63. package/lib/core/agent-loop-standalone.d.ts.map +1 -1
  64. package/lib/core/agent-loop-standalone.js +7 -2
  65. package/lib/core/agent-loop-standalone.js.map +1 -1
  66. package/lib/core/agent-loop-turn.d.ts +5 -0
  67. package/lib/core/agent-loop-turn.d.ts.map +1 -1
  68. package/lib/core/agent-loop-turn.js +5 -0
  69. package/lib/core/agent-loop-turn.js.map +1 -1
  70. package/lib/core/contracts.d.ts +1 -1
  71. package/lib/core/contracts.js +1 -1
  72. package/lib/core/exhausted-turn-reply.d.ts +33 -0
  73. package/lib/core/exhausted-turn-reply.d.ts.map +1 -0
  74. package/lib/core/exhausted-turn-reply.js +54 -0
  75. package/lib/core/exhausted-turn-reply.js.map +1 -0
  76. package/lib/core/exploration-budget.d.ts +17 -0
  77. package/lib/core/exploration-budget.d.ts.map +1 -0
  78. package/lib/core/exploration-budget.js +41 -0
  79. package/lib/core/exploration-budget.js.map +1 -0
  80. package/lib/core/index.d.ts +3 -0
  81. package/lib/core/index.d.ts.map +1 -1
  82. package/lib/core/index.js +2 -0
  83. package/lib/core/index.js.map +1 -1
  84. package/lib/core/missing-tool-resolver.d.ts +17 -0
  85. package/lib/core/missing-tool-resolver.d.ts.map +1 -0
  86. package/lib/core/missing-tool-resolver.js +21 -0
  87. package/lib/core/missing-tool-resolver.js.map +1 -0
  88. package/lib/core/progress-reporter.d.ts +46 -0
  89. package/lib/core/progress-reporter.d.ts.map +1 -0
  90. package/lib/core/progress-reporter.js +100 -0
  91. package/lib/core/progress-reporter.js.map +1 -0
  92. package/lib/core/tool-calls-user-format.d.ts +5 -0
  93. package/lib/core/tool-calls-user-format.d.ts.map +1 -1
  94. package/lib/core/tool-calls-user-format.js +23 -3
  95. package/lib/core/tool-calls-user-format.js.map +1 -1
  96. package/lib/core/turn-event-mapper.d.ts.map +1 -1
  97. package/lib/core/turn-event-mapper.js +2 -0
  98. package/lib/core/turn-event-mapper.js.map +1 -1
  99. package/lib/core/turn-progress.d.ts +75 -0
  100. package/lib/core/turn-progress.d.ts.map +1 -0
  101. package/lib/core/turn-progress.js +152 -0
  102. package/lib/core/turn-progress.js.map +1 -0
  103. package/lib/deferred-worker-runner.d.ts +6 -0
  104. package/lib/deferred-worker-runner.d.ts.map +1 -1
  105. package/lib/deferred-worker-runner.js +4 -0
  106. package/lib/deferred-worker-runner.js.map +1 -1
  107. package/lib/detached-task/index.d.ts +6 -0
  108. package/lib/detached-task/index.d.ts.map +1 -0
  109. package/lib/detached-task/index.js +6 -0
  110. package/lib/detached-task/index.js.map +1 -0
  111. package/lib/detached-task/interjection.d.ts +28 -0
  112. package/lib/detached-task/interjection.d.ts.map +1 -0
  113. package/lib/detached-task/interjection.js +128 -0
  114. package/lib/detached-task/interjection.js.map +1 -0
  115. package/lib/detached-task/runner.d.ts +89 -0
  116. package/lib/detached-task/runner.d.ts.map +1 -0
  117. package/lib/detached-task/runner.js +334 -0
  118. package/lib/detached-task/runner.js.map +1 -0
  119. package/lib/detached-task/store.d.ts +21 -0
  120. package/lib/detached-task/store.d.ts.map +1 -0
  121. package/lib/detached-task/store.js +63 -0
  122. package/lib/detached-task/store.js.map +1 -0
  123. package/lib/detached-task/token.d.ts +8 -0
  124. package/lib/detached-task/token.d.ts.map +1 -0
  125. package/lib/detached-task/token.js +8 -0
  126. package/lib/detached-task/token.js.map +1 -0
  127. package/lib/detached-task/types.d.ts +104 -0
  128. package/lib/detached-task/types.d.ts.map +1 -0
  129. package/lib/detached-task/types.js +43 -0
  130. package/lib/detached-task/types.js.map +1 -0
  131. package/lib/event/turn-event.d.ts +11 -0
  132. package/lib/event/turn-event.d.ts.map +1 -1
  133. package/lib/event/turn-event.js.map +1 -1
  134. package/lib/index.d.ts +7 -87
  135. package/lib/index.d.ts.map +1 -1
  136. package/lib/index.js +6 -85
  137. package/lib/index.js.map +1 -1
  138. package/lib/init/activate-ai-database-storage.d.ts +1 -3
  139. package/lib/init/activate-ai-database-storage.d.ts.map +1 -1
  140. package/lib/init/activate-ai-database-storage.js +13 -18
  141. package/lib/init/activate-ai-database-storage.js.map +1 -1
  142. package/lib/init/configure-zhin-agent.d.ts +1 -1
  143. package/lib/init/configure-zhin-agent.d.ts.map +1 -1
  144. package/lib/init/configure-zhin-agent.js +4 -0
  145. package/lib/init/configure-zhin-agent.js.map +1 -1
  146. package/lib/init/define-ai-database-models.d.ts +1 -1
  147. package/lib/init/define-ai-database-models.d.ts.map +1 -1
  148. package/lib/init/define-ai-database-models.js +1 -21
  149. package/lib/init/define-ai-database-models.js.map +1 -1
  150. package/lib/init/runtime-management-commands.d.ts +8 -0
  151. package/lib/init/runtime-management-commands.d.ts.map +1 -1
  152. package/lib/init/runtime-management-commands.js +38 -0
  153. package/lib/init/runtime-management-commands.js.map +1 -1
  154. package/lib/internal/agent-host.d.ts +11 -0
  155. package/lib/internal/agent-host.d.ts.map +1 -1
  156. package/lib/media/index.d.ts +1 -0
  157. package/lib/media/index.d.ts.map +1 -1
  158. package/lib/media/index.js +1 -0
  159. package/lib/media/index.js.map +1 -1
  160. package/lib/media/perception.d.ts +47 -0
  161. package/lib/media/perception.d.ts.map +1 -0
  162. package/lib/media/perception.js +136 -0
  163. package/lib/media/perception.js.map +1 -0
  164. package/lib/memory/compaction-runtime.d.ts +13 -0
  165. package/lib/memory/compaction-runtime.d.ts.map +1 -1
  166. package/lib/memory/compaction-runtime.js +25 -3
  167. package/lib/memory/compaction-runtime.js.map +1 -1
  168. package/lib/memory/index.d.ts +2 -0
  169. package/lib/memory/index.d.ts.map +1 -1
  170. package/lib/memory/index.js +1 -0
  171. package/lib/memory/index.js.map +1 -1
  172. package/lib/memory/memory-write-policy.d.ts +39 -0
  173. package/lib/memory/memory-write-policy.d.ts.map +1 -0
  174. package/lib/memory/memory-write-policy.js +44 -0
  175. package/lib/memory/memory-write-policy.js.map +1 -0
  176. package/lib/memory/semantic-recall.d.ts +44 -0
  177. package/lib/memory/semantic-recall.d.ts.map +1 -0
  178. package/lib/memory/semantic-recall.js +69 -0
  179. package/lib/memory/semantic-recall.js.map +1 -0
  180. package/lib/memory/told-ledger.d.ts +54 -0
  181. package/lib/memory/told-ledger.d.ts.map +1 -0
  182. package/lib/memory/told-ledger.js +119 -0
  183. package/lib/memory/told-ledger.js.map +1 -0
  184. package/lib/plugin-runtime/agent-host-port.d.ts +0 -102
  185. package/lib/plugin-runtime/agent-host-port.d.ts.map +1 -1
  186. package/lib/plugin-runtime/agent-host-port.js.map +1 -1
  187. package/lib/plugin-runtime/agent-runtime.d.ts +3 -0
  188. package/lib/plugin-runtime/agent-runtime.d.ts.map +1 -1
  189. package/lib/plugin-runtime/agent-runtime.js +42 -10
  190. package/lib/plugin-runtime/agent-runtime.js.map +1 -1
  191. package/lib/plugin-runtime/agent-trace-runtime.d.ts +5 -0
  192. package/lib/plugin-runtime/agent-trace-runtime.d.ts.map +1 -1
  193. package/lib/plugin-runtime/agent-trace-runtime.js +7 -0
  194. package/lib/plugin-runtime/agent-trace-runtime.js.map +1 -1
  195. package/lib/plugin-runtime/ai-completion.d.ts +54 -0
  196. package/lib/plugin-runtime/ai-completion.d.ts.map +1 -0
  197. package/lib/plugin-runtime/ai-completion.js +120 -0
  198. package/lib/plugin-runtime/ai-completion.js.map +1 -0
  199. package/lib/plugin-runtime/deferred-capability-plan.d.ts +27 -24
  200. package/lib/plugin-runtime/deferred-capability-plan.d.ts.map +1 -1
  201. package/lib/plugin-runtime/deferred-capability-plan.js +52 -82
  202. package/lib/plugin-runtime/deferred-capability-plan.js.map +1 -1
  203. package/lib/plugin-runtime/file-search-scope.d.ts +22 -0
  204. package/lib/plugin-runtime/file-search-scope.d.ts.map +1 -0
  205. package/lib/plugin-runtime/file-search-scope.js +129 -0
  206. package/lib/plugin-runtime/file-search-scope.js.map +1 -0
  207. package/lib/plugin-runtime/full-agent-turn-engine.d.ts.map +1 -1
  208. package/lib/plugin-runtime/full-agent-turn-engine.js +177 -21
  209. package/lib/plugin-runtime/full-agent-turn-engine.js.map +1 -1
  210. package/lib/plugin-runtime/index.d.ts +1 -78
  211. package/lib/plugin-runtime/index.d.ts.map +1 -1
  212. package/lib/plugin-runtime/index.js +1 -77
  213. package/lib/plugin-runtime/index.js.map +1 -1
  214. package/lib/plugin-runtime/native-bash-tool.d.ts +12 -0
  215. package/lib/plugin-runtime/native-bash-tool.d.ts.map +1 -1
  216. package/lib/plugin-runtime/native-bash-tool.js +32 -8
  217. package/lib/plugin-runtime/native-bash-tool.js.map +1 -1
  218. package/lib/plugin-runtime/native-file-tools.d.ts.map +1 -1
  219. package/lib/plugin-runtime/native-file-tools.js +120 -51
  220. package/lib/plugin-runtime/native-file-tools.js.map +1 -1
  221. package/lib/plugin-runtime/native-semantic-memory-tools.d.ts +27 -1
  222. package/lib/plugin-runtime/native-semantic-memory-tools.d.ts.map +1 -1
  223. package/lib/plugin-runtime/native-semantic-memory-tools.js +87 -9
  224. package/lib/plugin-runtime/native-semantic-memory-tools.js.map +1 -1
  225. package/lib/plugin-runtime/subagent-turn-capability.d.ts +32 -0
  226. package/lib/plugin-runtime/subagent-turn-capability.d.ts.map +1 -0
  227. package/lib/plugin-runtime/subagent-turn-capability.js +168 -0
  228. package/lib/plugin-runtime/subagent-turn-capability.js.map +1 -0
  229. package/lib/prompt/estimate-tokens.d.ts +7 -0
  230. package/lib/prompt/estimate-tokens.d.ts.map +1 -0
  231. package/lib/prompt/estimate-tokens.js +12 -0
  232. package/lib/prompt/estimate-tokens.js.map +1 -0
  233. package/lib/prompt/system-prompt.d.ts +2 -0
  234. package/lib/prompt/system-prompt.d.ts.map +1 -1
  235. package/lib/prompt/system-prompt.js +13 -2
  236. package/lib/prompt/system-prompt.js.map +1 -1
  237. package/lib/routing/subagent-summarize.d.ts +1 -1
  238. package/lib/routing/subagent-summarize.d.ts.map +1 -1
  239. package/lib/routing/subagent-summarize.js +2 -2
  240. package/lib/routing/subagent-summarize.js.map +1 -1
  241. package/lib/security/file-role-policy.d.ts +4 -2
  242. package/lib/security/file-role-policy.d.ts.map +1 -1
  243. package/lib/security/file-role-policy.js +21 -9
  244. package/lib/security/file-role-policy.js.map +1 -1
  245. package/lib/security/network-authority.d.ts +24 -0
  246. package/lib/security/network-authority.d.ts.map +1 -0
  247. package/lib/security/network-authority.js +28 -0
  248. package/lib/security/network-authority.js.map +1 -0
  249. package/lib/security/outbound-leak-guard.d.ts +61 -0
  250. package/lib/security/outbound-leak-guard.d.ts.map +1 -0
  251. package/lib/security/outbound-leak-guard.js +145 -0
  252. package/lib/security/outbound-leak-guard.js.map +1 -0
  253. package/lib/security/policy-facade.d.ts.map +1 -1
  254. package/lib/security/policy-facade.js +12 -2
  255. package/lib/security/policy-facade.js.map +1 -1
  256. package/lib/security/policy-narrowing.d.ts +12 -0
  257. package/lib/security/policy-narrowing.d.ts.map +1 -0
  258. package/lib/security/policy-narrowing.js +38 -0
  259. package/lib/security/policy-narrowing.js.map +1 -0
  260. package/lib/security/provenance.d.ts +65 -0
  261. package/lib/security/provenance.d.ts.map +1 -0
  262. package/lib/security/provenance.js +112 -0
  263. package/lib/security/provenance.js.map +1 -0
  264. package/lib/security/trust-level.d.ts +76 -0
  265. package/lib/security/trust-level.d.ts.map +1 -0
  266. package/lib/security/trust-level.js +87 -0
  267. package/lib/security/trust-level.js.map +1 -0
  268. package/lib/security/turn-network-client.d.ts.map +1 -1
  269. package/lib/security/turn-network-client.js +2 -1
  270. package/lib/security/turn-network-client.js.map +1 -1
  271. package/lib/security/usage-quota.d.ts +73 -0
  272. package/lib/security/usage-quota.d.ts.map +1 -0
  273. package/lib/security/usage-quota.js +123 -0
  274. package/lib/security/usage-quota.js.map +1 -0
  275. package/lib/service.d.ts +9 -1
  276. package/lib/service.d.ts.map +1 -1
  277. package/lib/service.js +17 -2
  278. package/lib/service.js.map +1 -1
  279. package/lib/session/approval-port.d.ts +26 -0
  280. package/lib/session/approval-port.d.ts.map +1 -1
  281. package/lib/session/approval-port.js +36 -0
  282. package/lib/session/approval-port.js.map +1 -1
  283. package/lib/session/approval-review-agent.d.ts +2 -2
  284. package/lib/session/approval-review-agent.d.ts.map +1 -1
  285. package/lib/session/approval-review-agent.js +57 -39
  286. package/lib/session/approval-review-agent.js.map +1 -1
  287. package/lib/session/session-io.d.ts.map +1 -1
  288. package/lib/session/session-io.js +1 -0
  289. package/lib/session/session-io.js.map +1 -1
  290. package/lib/session/turn-ingress-session.d.ts.map +1 -1
  291. package/lib/session/turn-ingress-session.js +1 -0
  292. package/lib/session/turn-ingress-session.js.map +1 -1
  293. package/lib/skill/capability-catalog.d.ts +27 -0
  294. package/lib/skill/capability-catalog.d.ts.map +1 -0
  295. package/lib/skill/capability-catalog.js +70 -0
  296. package/lib/skill/capability-catalog.js.map +1 -0
  297. package/lib/tool/deferred-resolution.d.ts.map +1 -1
  298. package/lib/tool/deferred-resolution.js +2 -1
  299. package/lib/tool/deferred-resolution.js.map +1 -1
  300. package/lib/tool/turn-tool-runtime.d.ts +13 -1
  301. package/lib/tool/turn-tool-runtime.d.ts.map +1 -1
  302. package/lib/tool/turn-tool-runtime.js +81 -7
  303. package/lib/tool/turn-tool-runtime.js.map +1 -1
  304. package/lib/tool-catalog/deferred-turn-controller.d.ts +4 -0
  305. package/lib/tool-catalog/deferred-turn-controller.d.ts.map +1 -1
  306. package/lib/tool-catalog/deferred-turn-controller.js +13 -3
  307. package/lib/tool-catalog/deferred-turn-controller.js.map +1 -1
  308. package/lib/tool-catalog/resolve-config.d.ts.map +1 -1
  309. package/lib/tool-catalog/resolve-config.js +5 -1
  310. package/lib/tool-catalog/resolve-config.js.map +1 -1
  311. package/lib/tool-catalog/types.d.ts +14 -1
  312. package/lib/tool-catalog/types.d.ts.map +1 -1
  313. package/lib/tool-catalog/types.js +15 -0
  314. package/lib/tool-catalog/types.js.map +1 -1
  315. package/lib/trace/context-budget.d.ts +56 -0
  316. package/lib/trace/context-budget.d.ts.map +1 -0
  317. package/lib/trace/context-budget.js +102 -0
  318. package/lib/trace/context-budget.js.map +1 -0
  319. package/lib/trace/index.d.ts +12 -0
  320. package/lib/trace/index.d.ts.map +1 -0
  321. package/lib/trace/index.js +7 -0
  322. package/lib/trace/index.js.map +1 -0
  323. package/lib/trace/turn-trace-archive.d.ts +49 -0
  324. package/lib/trace/turn-trace-archive.d.ts.map +1 -0
  325. package/lib/trace/turn-trace-archive.js +208 -0
  326. package/lib/trace/turn-trace-archive.js.map +1 -0
  327. package/lib/trace/turn-trace-format.d.ts +10 -0
  328. package/lib/trace/turn-trace-format.d.ts.map +1 -0
  329. package/lib/trace/turn-trace-format.js +132 -0
  330. package/lib/trace/turn-trace-format.js.map +1 -0
  331. package/lib/trace/turn-trace-registry.d.ts +30 -0
  332. package/lib/trace/turn-trace-registry.d.ts.map +1 -0
  333. package/lib/trace/turn-trace-registry.js +62 -0
  334. package/lib/trace/turn-trace-registry.js.map +1 -0
  335. package/lib/trace/turn-trace-store.d.ts +15 -0
  336. package/lib/trace/turn-trace-store.d.ts.map +1 -0
  337. package/lib/trace/turn-trace-store.js +67 -0
  338. package/lib/trace/turn-trace-store.js.map +1 -0
  339. package/lib/trace/turn-trace.d.ts +147 -0
  340. package/lib/trace/turn-trace.d.ts.map +1 -0
  341. package/lib/trace/turn-trace.js +341 -0
  342. package/lib/trace/turn-trace.js.map +1 -0
  343. package/lib/turn/execute-agent-turn.d.ts.map +1 -1
  344. package/lib/turn/execute-agent-turn.js +21 -10
  345. package/lib/turn/execute-agent-turn.js.map +1 -1
  346. package/lib/turn/inbound-media.d.ts +15 -0
  347. package/lib/turn/inbound-media.d.ts.map +1 -1
  348. package/lib/turn/inbound-media.js +41 -1
  349. package/lib/turn/inbound-media.js.map +1 -1
  350. package/lib/turn/inbound-queue-config.d.ts +1 -0
  351. package/lib/turn/inbound-queue-config.d.ts.map +1 -1
  352. package/lib/turn/inbound-queue-config.js +9 -1
  353. package/lib/turn/inbound-queue-config.js.map +1 -1
  354. package/lib/turn/index.d.ts +5 -0
  355. package/lib/turn/index.d.ts.map +1 -1
  356. package/lib/turn/index.js +4 -0
  357. package/lib/turn/index.js.map +1 -1
  358. package/lib/turn/journal-feed.d.ts +31 -0
  359. package/lib/turn/journal-feed.d.ts.map +1 -0
  360. package/lib/turn/journal-feed.js +43 -0
  361. package/lib/turn/journal-feed.js.map +1 -0
  362. package/lib/turn/turn-admission-gate.d.ts +62 -0
  363. package/lib/turn/turn-admission-gate.d.ts.map +1 -0
  364. package/lib/turn/turn-admission-gate.js +194 -0
  365. package/lib/turn/turn-admission-gate.js.map +1 -0
  366. package/lib/turn/turn-ingress.d.ts +4 -0
  367. package/lib/turn/turn-ingress.d.ts.map +1 -1
  368. package/lib/turn/turn-ingress.js.map +1 -1
  369. package/lib/turn/turn-pipeline.js +1 -0
  370. package/lib/turn/turn-pipeline.js.map +1 -1
  371. package/lib/zhin-agent/index.d.ts +9 -0
  372. package/lib/zhin-agent/index.d.ts.map +1 -1
  373. package/lib/zhin-agent/index.js +13 -0
  374. package/lib/zhin-agent/index.js.map +1 -1
  375. package/package.json +21 -33
  376. package/lib/data-governance/data-governance.d.ts +0 -198
  377. package/lib/data-governance/data-governance.d.ts.map +0 -1
  378. package/lib/data-governance/data-governance.js +0 -660
  379. package/lib/data-governance/data-governance.js.map +0 -1
  380. package/lib/data-governance/database-payload-lifecycle-repository.d.ts +0 -68
  381. package/lib/data-governance/database-payload-lifecycle-repository.d.ts.map +0 -1
  382. package/lib/data-governance/database-payload-lifecycle-repository.js +0 -226
  383. package/lib/data-governance/database-payload-lifecycle-repository.js.map +0 -1
  384. package/lib/data-governance/disclosure-authority.d.ts +0 -38
  385. package/lib/data-governance/disclosure-authority.d.ts.map +0 -1
  386. package/lib/data-governance/disclosure-authority.js +0 -2
  387. package/lib/data-governance/disclosure-authority.js.map +0 -1
  388. package/lib/data-governance/disclosure-manifest.d.ts +0 -110
  389. package/lib/data-governance/disclosure-manifest.d.ts.map +0 -1
  390. package/lib/data-governance/disclosure-manifest.js +0 -264
  391. package/lib/data-governance/disclosure-manifest.js.map +0 -1
  392. package/lib/data-governance/encrypted-database-payload-vault.d.ts +0 -107
  393. package/lib/data-governance/encrypted-database-payload-vault.d.ts.map +0 -1
  394. package/lib/data-governance/encrypted-database-payload-vault.js +0 -236
  395. package/lib/data-governance/encrypted-database-payload-vault.js.map +0 -1
  396. package/lib/data-governance/encrypted-file-payload-vault.d.ts +0 -117
  397. package/lib/data-governance/encrypted-file-payload-vault.d.ts.map +0 -1
  398. package/lib/data-governance/encrypted-file-payload-vault.js +0 -507
  399. package/lib/data-governance/encrypted-file-payload-vault.js.map +0 -1
  400. package/lib/data-governance/file-payload-lifecycle-repository.d.ts +0 -19
  401. package/lib/data-governance/file-payload-lifecycle-repository.d.ts.map +0 -1
  402. package/lib/data-governance/file-payload-lifecycle-repository.js +0 -194
  403. package/lib/data-governance/file-payload-lifecycle-repository.js.map +0 -1
  404. package/lib/data-governance/governance-authority-repository.d.ts +0 -152
  405. package/lib/data-governance/governance-authority-repository.d.ts.map +0 -1
  406. package/lib/data-governance/governance-authority-repository.js +0 -455
  407. package/lib/data-governance/governance-authority-repository.js.map +0 -1
  408. package/lib/data-governance/governed-payload-write-saga.d.ts +0 -126
  409. package/lib/data-governance/governed-payload-write-saga.d.ts.map +0 -1
  410. package/lib/data-governance/governed-payload-write-saga.js +0 -471
  411. package/lib/data-governance/governed-payload-write-saga.js.map +0 -1
  412. package/lib/data-governance/payload-hold-overdue-projection.d.ts +0 -57
  413. package/lib/data-governance/payload-hold-overdue-projection.d.ts.map +0 -1
  414. package/lib/data-governance/payload-hold-overdue-projection.js +0 -80
  415. package/lib/data-governance/payload-hold-overdue-projection.js.map +0 -1
  416. package/lib/data-governance/payload-lifecycle.d.ts +0 -359
  417. package/lib/data-governance/payload-lifecycle.d.ts.map +0 -1
  418. package/lib/data-governance/payload-lifecycle.js +0 -930
  419. package/lib/data-governance/payload-lifecycle.js.map +0 -1
  420. package/lib/data-governance/payload-vault-storage-handoff.d.ts +0 -255
  421. package/lib/data-governance/payload-vault-storage-handoff.d.ts.map +0 -1
  422. package/lib/data-governance/payload-vault-storage-handoff.js +0 -471
  423. package/lib/data-governance/payload-vault-storage-handoff.js.map +0 -1
  424. package/lib/plugin-runtime/database-overlay-pack-promotion-repository.d.ts +0 -70
  425. package/lib/plugin-runtime/database-overlay-pack-promotion-repository.d.ts.map +0 -1
  426. package/lib/plugin-runtime/database-overlay-pack-promotion-repository.js +0 -203
  427. package/lib/plugin-runtime/database-overlay-pack-promotion-repository.js.map +0 -1
  428. package/lib/plugin-runtime/github-actions-delivery-provider.d.ts +0 -44
  429. package/lib/plugin-runtime/github-actions-delivery-provider.d.ts.map +0 -1
  430. package/lib/plugin-runtime/github-actions-delivery-provider.js +0 -246
  431. package/lib/plugin-runtime/github-actions-delivery-provider.js.map +0 -1
  432. package/lib/plugin-runtime/github-exact-merge-gateway.d.ts +0 -62
  433. package/lib/plugin-runtime/github-exact-merge-gateway.d.ts.map +0 -1
  434. package/lib/plugin-runtime/github-exact-merge-gateway.js +0 -79
  435. package/lib/plugin-runtime/github-exact-merge-gateway.js.map +0 -1
  436. package/lib/plugin-runtime/github-workroom-capability.d.ts +0 -15
  437. package/lib/plugin-runtime/github-workroom-capability.d.ts.map +0 -1
  438. package/lib/plugin-runtime/github-workroom-capability.js +0 -79
  439. package/lib/plugin-runtime/github-workroom-capability.js.map +0 -1
  440. package/lib/plugin-runtime/self-delivery-project-composition.d.ts +0 -25
  441. package/lib/plugin-runtime/self-delivery-project-composition.d.ts.map +0 -1
  442. package/lib/plugin-runtime/self-delivery-project-composition.js +0 -85
  443. package/lib/plugin-runtime/self-delivery-project-composition.js.map +0 -1
  444. package/lib/plugin-runtime/self-delivery-project.d.ts +0 -65
  445. package/lib/plugin-runtime/self-delivery-project.d.ts.map +0 -1
  446. package/lib/plugin-runtime/self-delivery-project.js +0 -140
  447. package/lib/plugin-runtime/self-delivery-project.js.map +0 -1
  448. package/lib/plugin-runtime/workroom-acceptance-authority.d.ts +0 -5
  449. package/lib/plugin-runtime/workroom-acceptance-authority.d.ts.map +0 -1
  450. package/lib/plugin-runtime/workroom-acceptance-authority.js +0 -14
  451. package/lib/plugin-runtime/workroom-acceptance-authority.js.map +0 -1
  452. package/lib/plugin-runtime/workroom-acceptance-fact-providers.d.ts +0 -233
  453. package/lib/plugin-runtime/workroom-acceptance-fact-providers.d.ts.map +0 -1
  454. package/lib/plugin-runtime/workroom-acceptance-fact-providers.js +0 -517
  455. package/lib/plugin-runtime/workroom-acceptance-fact-providers.js.map +0 -1
  456. package/lib/plugin-runtime/workroom-acceptance-internal-providers.d.ts +0 -139
  457. package/lib/plugin-runtime/workroom-acceptance-internal-providers.d.ts.map +0 -1
  458. package/lib/plugin-runtime/workroom-acceptance-internal-providers.js +0 -435
  459. package/lib/plugin-runtime/workroom-acceptance-internal-providers.js.map +0 -1
  460. package/lib/plugin-runtime/workroom-acceptance-policy.d.ts +0 -4
  461. package/lib/plugin-runtime/workroom-acceptance-policy.d.ts.map +0 -1
  462. package/lib/plugin-runtime/workroom-acceptance-policy.js +0 -20
  463. package/lib/plugin-runtime/workroom-acceptance-policy.js.map +0 -1
  464. package/lib/plugin-runtime/workroom-acceptance-production-composition.d.ts +0 -177
  465. package/lib/plugin-runtime/workroom-acceptance-production-composition.d.ts.map +0 -1
  466. package/lib/plugin-runtime/workroom-acceptance-production-composition.js +0 -794
  467. package/lib/plugin-runtime/workroom-acceptance-production-composition.js.map +0 -1
  468. package/lib/plugin-runtime/workroom-acceptance-provider-composition.d.ts +0 -189
  469. package/lib/plugin-runtime/workroom-acceptance-provider-composition.d.ts.map +0 -1
  470. package/lib/plugin-runtime/workroom-acceptance-provider-composition.js +0 -590
  471. package/lib/plugin-runtime/workroom-acceptance-provider-composition.js.map +0 -1
  472. package/lib/plugin-runtime/workroom-accepted-source-runtime.d.ts +0 -75
  473. package/lib/plugin-runtime/workroom-accepted-source-runtime.d.ts.map +0 -1
  474. package/lib/plugin-runtime/workroom-accepted-source-runtime.js +0 -267
  475. package/lib/plugin-runtime/workroom-accepted-source-runtime.js.map +0 -1
  476. package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.d.ts +0 -42
  477. package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.d.ts.map +0 -1
  478. package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.js +0 -90
  479. package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.js.map +0 -1
  480. package/lib/plugin-runtime/workroom-assignment-authority-provider.d.ts +0 -84
  481. package/lib/plugin-runtime/workroom-assignment-authority-provider.d.ts.map +0 -1
  482. package/lib/plugin-runtime/workroom-assignment-authority-provider.js +0 -494
  483. package/lib/plugin-runtime/workroom-assignment-authority-provider.js.map +0 -1
  484. package/lib/plugin-runtime/workroom-assignment-knowledge-composition.d.ts +0 -58
  485. package/lib/plugin-runtime/workroom-assignment-knowledge-composition.d.ts.map +0 -1
  486. package/lib/plugin-runtime/workroom-assignment-knowledge-composition.js +0 -218
  487. package/lib/plugin-runtime/workroom-assignment-knowledge-composition.js.map +0 -1
  488. package/lib/plugin-runtime/workroom-data-governance-authority-writer.d.ts +0 -49
  489. package/lib/plugin-runtime/workroom-data-governance-authority-writer.d.ts.map +0 -1
  490. package/lib/plugin-runtime/workroom-data-governance-authority-writer.js +0 -140
  491. package/lib/plugin-runtime/workroom-data-governance-authority-writer.js.map +0 -1
  492. package/lib/plugin-runtime/workroom-data-governance-bootstrap.d.ts +0 -27
  493. package/lib/plugin-runtime/workroom-data-governance-bootstrap.d.ts.map +0 -1
  494. package/lib/plugin-runtime/workroom-data-governance-bootstrap.js +0 -324
  495. package/lib/plugin-runtime/workroom-data-governance-bootstrap.js.map +0 -1
  496. package/lib/plugin-runtime/workroom-data-governance-composition.d.ts +0 -28
  497. package/lib/plugin-runtime/workroom-data-governance-composition.d.ts.map +0 -1
  498. package/lib/plugin-runtime/workroom-data-governance-composition.js +0 -41
  499. package/lib/plugin-runtime/workroom-data-governance-composition.js.map +0 -1
  500. package/lib/plugin-runtime/workroom-data-governance-root-provider.d.ts +0 -51
  501. package/lib/plugin-runtime/workroom-data-governance-root-provider.d.ts.map +0 -1
  502. package/lib/plugin-runtime/workroom-data-governance-root-provider.js +0 -66
  503. package/lib/plugin-runtime/workroom-data-governance-root-provider.js.map +0 -1
  504. package/lib/plugin-runtime/workroom-data-governance-runtime.d.ts +0 -100
  505. package/lib/plugin-runtime/workroom-data-governance-runtime.d.ts.map +0 -1
  506. package/lib/plugin-runtime/workroom-data-governance-runtime.js +0 -1356
  507. package/lib/plugin-runtime/workroom-data-governance-runtime.js.map +0 -1
  508. package/lib/plugin-runtime/workroom-data-governance-storage.d.ts +0 -66
  509. package/lib/plugin-runtime/workroom-data-governance-storage.d.ts.map +0 -1
  510. package/lib/plugin-runtime/workroom-data-governance-storage.js +0 -159
  511. package/lib/plugin-runtime/workroom-data-governance-storage.js.map +0 -1
  512. package/lib/plugin-runtime/workroom-data-lifecycle-composition.d.ts +0 -37
  513. package/lib/plugin-runtime/workroom-data-lifecycle-composition.d.ts.map +0 -1
  514. package/lib/plugin-runtime/workroom-data-lifecycle-composition.js +0 -131
  515. package/lib/plugin-runtime/workroom-data-lifecycle-composition.js.map +0 -1
  516. package/lib/plugin-runtime/workroom-data-lifecycle-console.d.ts +0 -238
  517. package/lib/plugin-runtime/workroom-data-lifecycle-console.d.ts.map +0 -1
  518. package/lib/plugin-runtime/workroom-data-lifecycle-console.js +0 -495
  519. package/lib/plugin-runtime/workroom-data-lifecycle-console.js.map +0 -1
  520. package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.d.ts +0 -15
  521. package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.d.ts.map +0 -1
  522. package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.js +0 -119
  523. package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.js.map +0 -1
  524. package/lib/plugin-runtime/workroom-delivery-gateway.d.ts +0 -96
  525. package/lib/plugin-runtime/workroom-delivery-gateway.d.ts.map +0 -1
  526. package/lib/plugin-runtime/workroom-delivery-gateway.js +0 -129
  527. package/lib/plugin-runtime/workroom-delivery-gateway.js.map +0 -1
  528. package/lib/plugin-runtime/workroom-dynamic-planning-provider.d.ts +0 -142
  529. package/lib/plugin-runtime/workroom-dynamic-planning-provider.d.ts.map +0 -1
  530. package/lib/plugin-runtime/workroom-dynamic-planning-provider.js +0 -302
  531. package/lib/plugin-runtime/workroom-dynamic-planning-provider.js.map +0 -1
  532. package/lib/plugin-runtime/workroom-dynamic-planning.d.ts +0 -4
  533. package/lib/plugin-runtime/workroom-dynamic-planning.d.ts.map +0 -1
  534. package/lib/plugin-runtime/workroom-dynamic-planning.js +0 -13
  535. package/lib/plugin-runtime/workroom-dynamic-planning.js.map +0 -1
  536. package/lib/plugin-runtime/workroom-effect-composition.d.ts +0 -37
  537. package/lib/plugin-runtime/workroom-effect-composition.d.ts.map +0 -1
  538. package/lib/plugin-runtime/workroom-effect-composition.js +0 -80
  539. package/lib/plugin-runtime/workroom-effect-composition.js.map +0 -1
  540. package/lib/plugin-runtime/workroom-effect-production.d.ts +0 -138
  541. package/lib/plugin-runtime/workroom-effect-production.d.ts.map +0 -1
  542. package/lib/plugin-runtime/workroom-effect-production.js +0 -291
  543. package/lib/plugin-runtime/workroom-effect-production.js.map +0 -1
  544. package/lib/plugin-runtime/workroom-effect-runtime.d.ts +0 -56
  545. package/lib/plugin-runtime/workroom-effect-runtime.d.ts.map +0 -1
  546. package/lib/plugin-runtime/workroom-effect-runtime.js +0 -239
  547. package/lib/plugin-runtime/workroom-effect-runtime.js.map +0 -1
  548. package/lib/plugin-runtime/workroom-governed-dispatch-composition.d.ts +0 -32
  549. package/lib/plugin-runtime/workroom-governed-dispatch-composition.d.ts.map +0 -1
  550. package/lib/plugin-runtime/workroom-governed-dispatch-composition.js +0 -43
  551. package/lib/plugin-runtime/workroom-governed-dispatch-composition.js.map +0 -1
  552. package/lib/plugin-runtime/workroom-journal-payload-composition.d.ts +0 -16
  553. package/lib/plugin-runtime/workroom-journal-payload-composition.d.ts.map +0 -1
  554. package/lib/plugin-runtime/workroom-journal-payload-composition.js +0 -69
  555. package/lib/plugin-runtime/workroom-journal-payload-composition.js.map +0 -1
  556. package/lib/plugin-runtime/workroom-local-agent-core-adapter.d.ts +0 -17
  557. package/lib/plugin-runtime/workroom-local-agent-core-adapter.d.ts.map +0 -1
  558. package/lib/plugin-runtime/workroom-local-agent-core-adapter.js +0 -101
  559. package/lib/plugin-runtime/workroom-local-agent-core-adapter.js.map +0 -1
  560. package/lib/plugin-runtime/workroom-local-agent-loop.d.ts +0 -91
  561. package/lib/plugin-runtime/workroom-local-agent-loop.d.ts.map +0 -1
  562. package/lib/plugin-runtime/workroom-local-agent-loop.js +0 -313
  563. package/lib/plugin-runtime/workroom-local-agent-loop.js.map +0 -1
  564. package/lib/plugin-runtime/workroom-local-assignment-authority.d.ts +0 -5
  565. package/lib/plugin-runtime/workroom-local-assignment-authority.d.ts.map +0 -1
  566. package/lib/plugin-runtime/workroom-local-assignment-authority.js +0 -16
  567. package/lib/plugin-runtime/workroom-local-assignment-authority.js.map +0 -1
  568. package/lib/plugin-runtime/workroom-local-assignment-executor.d.ts +0 -59
  569. package/lib/plugin-runtime/workroom-local-assignment-executor.d.ts.map +0 -1
  570. package/lib/plugin-runtime/workroom-local-assignment-executor.js +0 -197
  571. package/lib/plugin-runtime/workroom-local-assignment-executor.js.map +0 -1
  572. package/lib/plugin-runtime/workroom-local-assignment-runtime.d.ts +0 -34
  573. package/lib/plugin-runtime/workroom-local-assignment-runtime.d.ts.map +0 -1
  574. package/lib/plugin-runtime/workroom-local-assignment-runtime.js +0 -235
  575. package/lib/plugin-runtime/workroom-local-assignment-runtime.js.map +0 -1
  576. package/lib/plugin-runtime/workroom-local-assignment-supply.d.ts +0 -39
  577. package/lib/plugin-runtime/workroom-local-assignment-supply.d.ts.map +0 -1
  578. package/lib/plugin-runtime/workroom-local-assignment-supply.js +0 -107
  579. package/lib/plugin-runtime/workroom-local-assignment-supply.js.map +0 -1
  580. package/lib/plugin-runtime/workroom-overlay-pack-promotion.d.ts +0 -145
  581. package/lib/plugin-runtime/workroom-overlay-pack-promotion.d.ts.map +0 -1
  582. package/lib/plugin-runtime/workroom-overlay-pack-promotion.js +0 -516
  583. package/lib/plugin-runtime/workroom-overlay-pack-promotion.js.map +0 -1
  584. package/lib/plugin-runtime/workroom-payload-processor-recall.d.ts +0 -91
  585. package/lib/plugin-runtime/workroom-payload-processor-recall.d.ts.map +0 -1
  586. package/lib/plugin-runtime/workroom-payload-processor-recall.js +0 -189
  587. package/lib/plugin-runtime/workroom-payload-processor-recall.js.map +0 -1
  588. package/lib/plugin-runtime/workroom-plan-gate-authority.d.ts +0 -7
  589. package/lib/plugin-runtime/workroom-plan-gate-authority.d.ts.map +0 -1
  590. package/lib/plugin-runtime/workroom-plan-gate-authority.js +0 -40
  591. package/lib/plugin-runtime/workroom-plan-gate-authority.js.map +0 -1
  592. package/lib/plugin-runtime/workroom-portfolio-capacity.d.ts +0 -132
  593. package/lib/plugin-runtime/workroom-portfolio-capacity.d.ts.map +0 -1
  594. package/lib/plugin-runtime/workroom-portfolio-capacity.js +0 -189
  595. package/lib/plugin-runtime/workroom-portfolio-capacity.js.map +0 -1
  596. package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.d.ts +0 -38
  597. package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.d.ts.map +0 -1
  598. package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.js +0 -103
  599. package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.js.map +0 -1
  600. package/lib/plugin-runtime/workroom-portfolio-control-composition.d.ts +0 -30
  601. package/lib/plugin-runtime/workroom-portfolio-control-composition.d.ts.map +0 -1
  602. package/lib/plugin-runtime/workroom-portfolio-control-composition.js +0 -103
  603. package/lib/plugin-runtime/workroom-portfolio-control-composition.js.map +0 -1
  604. package/lib/plugin-runtime/workroom-portfolio-control-runtime.d.ts +0 -42
  605. package/lib/plugin-runtime/workroom-portfolio-control-runtime.d.ts.map +0 -1
  606. package/lib/plugin-runtime/workroom-portfolio-control-runtime.js +0 -209
  607. package/lib/plugin-runtime/workroom-portfolio-control-runtime.js.map +0 -1
  608. package/lib/plugin-runtime/workroom-portfolio-grant-assignment.d.ts +0 -141
  609. package/lib/plugin-runtime/workroom-portfolio-grant-assignment.d.ts.map +0 -1
  610. package/lib/plugin-runtime/workroom-portfolio-grant-assignment.js +0 -334
  611. package/lib/plugin-runtime/workroom-portfolio-grant-assignment.js.map +0 -1
  612. package/lib/plugin-runtime/workroom-portfolio-kernel-authority.d.ts +0 -23
  613. package/lib/plugin-runtime/workroom-portfolio-kernel-authority.d.ts.map +0 -1
  614. package/lib/plugin-runtime/workroom-portfolio-kernel-authority.js +0 -88
  615. package/lib/plugin-runtime/workroom-portfolio-kernel-authority.js.map +0 -1
  616. package/lib/plugin-runtime/workroom-portfolio-sponsor.d.ts +0 -96
  617. package/lib/plugin-runtime/workroom-portfolio-sponsor.d.ts.map +0 -1
  618. package/lib/plugin-runtime/workroom-portfolio-sponsor.js +0 -313
  619. package/lib/plugin-runtime/workroom-portfolio-sponsor.js.map +0 -1
  620. package/lib/plugin-runtime/workroom-preemption-runtime.d.ts +0 -57
  621. package/lib/plugin-runtime/workroom-preemption-runtime.d.ts.map +0 -1
  622. package/lib/plugin-runtime/workroom-preemption-runtime.js +0 -163
  623. package/lib/plugin-runtime/workroom-preemption-runtime.js.map +0 -1
  624. package/lib/plugin-runtime/workroom-priority-authority.d.ts +0 -19
  625. package/lib/plugin-runtime/workroom-priority-authority.d.ts.map +0 -1
  626. package/lib/plugin-runtime/workroom-priority-authority.js +0 -76
  627. package/lib/plugin-runtime/workroom-priority-authority.js.map +0 -1
  628. package/lib/plugin-runtime/workroom-profile-authority-composition.d.ts +0 -61
  629. package/lib/plugin-runtime/workroom-profile-authority-composition.d.ts.map +0 -1
  630. package/lib/plugin-runtime/workroom-profile-authority-composition.js +0 -232
  631. package/lib/plugin-runtime/workroom-profile-authority-composition.js.map +0 -1
  632. package/lib/plugin-runtime/workroom-profile-authority-runtime.d.ts +0 -229
  633. package/lib/plugin-runtime/workroom-profile-authority-runtime.d.ts.map +0 -1
  634. package/lib/plugin-runtime/workroom-profile-authority-runtime.js +0 -1133
  635. package/lib/plugin-runtime/workroom-profile-authority-runtime.js.map +0 -1
  636. package/lib/plugin-runtime/workroom-projection-outbound.d.ts +0 -10
  637. package/lib/plugin-runtime/workroom-projection-outbound.d.ts.map +0 -1
  638. package/lib/plugin-runtime/workroom-projection-outbound.js +0 -35
  639. package/lib/plugin-runtime/workroom-projection-outbound.js.map +0 -1
  640. package/lib/plugin-runtime/workroom-projection-runtime.d.ts +0 -93
  641. package/lib/plugin-runtime/workroom-projection-runtime.d.ts.map +0 -1
  642. package/lib/plugin-runtime/workroom-projection-runtime.js +0 -476
  643. package/lib/plugin-runtime/workroom-projection-runtime.js.map +0 -1
  644. package/lib/plugin-runtime/workroom-remote-assignment-authority.d.ts +0 -9
  645. package/lib/plugin-runtime/workroom-remote-assignment-authority.d.ts.map +0 -1
  646. package/lib/plugin-runtime/workroom-remote-assignment-authority.js +0 -20
  647. package/lib/plugin-runtime/workroom-remote-assignment-authority.js.map +0 -1
  648. package/lib/plugin-runtime/workroom-remote-callback-runtime.d.ts +0 -38
  649. package/lib/plugin-runtime/workroom-remote-callback-runtime.d.ts.map +0 -1
  650. package/lib/plugin-runtime/workroom-remote-callback-runtime.js +0 -80
  651. package/lib/plugin-runtime/workroom-remote-callback-runtime.js.map +0 -1
  652. package/lib/plugin-runtime/workroom-remote-executor.d.ts +0 -9
  653. package/lib/plugin-runtime/workroom-remote-executor.d.ts.map +0 -1
  654. package/lib/plugin-runtime/workroom-remote-executor.js +0 -23
  655. package/lib/plugin-runtime/workroom-remote-executor.js.map +0 -1
  656. package/lib/plugin-runtime/workroom-reviewer-authority-runtime.d.ts +0 -72
  657. package/lib/plugin-runtime/workroom-reviewer-authority-runtime.d.ts.map +0 -1
  658. package/lib/plugin-runtime/workroom-reviewer-authority-runtime.js +0 -142
  659. package/lib/plugin-runtime/workroom-reviewer-authority-runtime.js.map +0 -1
  660. package/lib/plugin-runtime/workroom-risk-acceptance-runtime.d.ts +0 -112
  661. package/lib/plugin-runtime/workroom-risk-acceptance-runtime.d.ts.map +0 -1
  662. package/lib/plugin-runtime/workroom-risk-acceptance-runtime.js +0 -376
  663. package/lib/plugin-runtime/workroom-risk-acceptance-runtime.js.map +0 -1
  664. package/lib/plugin-runtime/workroom-run-profile-pin-authority.d.ts +0 -42
  665. package/lib/plugin-runtime/workroom-run-profile-pin-authority.d.ts.map +0 -1
  666. package/lib/plugin-runtime/workroom-run-profile-pin-authority.js +0 -125
  667. package/lib/plugin-runtime/workroom-run-profile-pin-authority.js.map +0 -1
  668. package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.d.ts +0 -32
  669. package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.d.ts.map +0 -1
  670. package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.js +0 -83
  671. package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.js.map +0 -1
  672. package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.d.ts +0 -16
  673. package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.d.ts.map +0 -1
  674. package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.js +0 -49
  675. package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.js.map +0 -1
  676. package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.d.ts +0 -66
  677. package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.d.ts.map +0 -1
  678. package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.js +0 -250
  679. package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.js.map +0 -1
  680. package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.d.ts +0 -42
  681. package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.d.ts.map +0 -1
  682. package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.js +0 -141
  683. package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.js.map +0 -1
  684. package/lib/plugin-runtime/workroom-scheduler-route-registry.d.ts +0 -27
  685. package/lib/plugin-runtime/workroom-scheduler-route-registry.d.ts.map +0 -1
  686. package/lib/plugin-runtime/workroom-scheduler-route-registry.js +0 -136
  687. package/lib/plugin-runtime/workroom-scheduler-route-registry.js.map +0 -1
  688. package/lib/plugin-runtime/workroom-scheduler-runtime.d.ts +0 -84
  689. package/lib/plugin-runtime/workroom-scheduler-runtime.d.ts.map +0 -1
  690. package/lib/plugin-runtime/workroom-scheduler-runtime.js +0 -236
  691. package/lib/plugin-runtime/workroom-scheduler-runtime.js.map +0 -1
  692. package/lib/portfolio/capacity-control-outbox.d.ts +0 -174
  693. package/lib/portfolio/capacity-control-outbox.d.ts.map +0 -1
  694. package/lib/portfolio/capacity-control-outbox.js +0 -338
  695. package/lib/portfolio/capacity-control-outbox.js.map +0 -1
  696. package/lib/portfolio/database-capacity-control-outbox.d.ts +0 -62
  697. package/lib/portfolio/database-capacity-control-outbox.d.ts.map +0 -1
  698. package/lib/portfolio/database-capacity-control-outbox.js +0 -166
  699. package/lib/portfolio/database-capacity-control-outbox.js.map +0 -1
  700. package/lib/portfolio/file-capacity-control-outbox.d.ts +0 -10
  701. package/lib/portfolio/file-capacity-control-outbox.d.ts.map +0 -1
  702. package/lib/portfolio/file-capacity-control-outbox.js +0 -113
  703. package/lib/portfolio/file-capacity-control-outbox.js.map +0 -1
  704. package/lib/portfolio/file-portfolio-journal.d.ts +0 -11
  705. package/lib/portfolio/file-portfolio-journal.d.ts.map +0 -1
  706. package/lib/portfolio/file-portfolio-journal.js +0 -196
  707. package/lib/portfolio/file-portfolio-journal.js.map +0 -1
  708. package/lib/portfolio/portfolio-admission.d.ts +0 -95
  709. package/lib/portfolio/portfolio-admission.d.ts.map +0 -1
  710. package/lib/portfolio/portfolio-admission.js +0 -1080
  711. package/lib/portfolio/portfolio-admission.js.map +0 -1
  712. package/lib/portfolio/portfolio-journal.d.ts +0 -359
  713. package/lib/portfolio/portfolio-journal.d.ts.map +0 -1
  714. package/lib/portfolio/portfolio-journal.js +0 -844
  715. package/lib/portfolio/portfolio-journal.js.map +0 -1
  716. package/lib/portfolio/resource-bundle.d.ts +0 -136
  717. package/lib/portfolio/resource-bundle.d.ts.map +0 -1
  718. package/lib/portfolio/resource-bundle.js +0 -387
  719. package/lib/portfolio/resource-bundle.js.map +0 -1
  720. package/lib/portfolio/sponsor-projection.d.ts +0 -78
  721. package/lib/portfolio/sponsor-projection.d.ts.map +0 -1
  722. package/lib/portfolio/sponsor-projection.js +0 -135
  723. package/lib/portfolio/sponsor-projection.js.map +0 -1
  724. package/lib/routing/match-rules.d.ts +0 -4
  725. package/lib/routing/match-rules.d.ts.map +0 -1
  726. package/lib/routing/match-rules.js +0 -29
  727. package/lib/routing/match-rules.js.map +0 -1
  728. package/lib/routing/route-matcher.d.ts +0 -16
  729. package/lib/routing/route-matcher.d.ts.map +0 -1
  730. package/lib/routing/route-matcher.js +0 -62
  731. package/lib/routing/route-matcher.js.map +0 -1
  732. package/lib/routing/workroom-bot-identity.d.ts +0 -22
  733. package/lib/routing/workroom-bot-identity.d.ts.map +0 -1
  734. package/lib/routing/workroom-bot-identity.js +0 -53
  735. package/lib/routing/workroom-bot-identity.js.map +0 -1
  736. package/lib/workroom/acceptance-control.d.ts +0 -77
  737. package/lib/workroom/acceptance-control.d.ts.map +0 -1
  738. package/lib/workroom/acceptance-control.js +0 -345
  739. package/lib/workroom/acceptance-control.js.map +0 -1
  740. package/lib/workroom/acceptance-policy.d.ts +0 -152
  741. package/lib/workroom/acceptance-policy.d.ts.map +0 -1
  742. package/lib/workroom/acceptance-policy.js +0 -610
  743. package/lib/workroom/acceptance-policy.js.map +0 -1
  744. package/lib/workroom/accepted-source-memory-application.d.ts +0 -113
  745. package/lib/workroom/accepted-source-memory-application.d.ts.map +0 -1
  746. package/lib/workroom/accepted-source-memory-application.js +0 -327
  747. package/lib/workroom/accepted-source-memory-application.js.map +0 -1
  748. package/lib/workroom/accepted-source-projector.d.ts +0 -89
  749. package/lib/workroom/accepted-source-projector.d.ts.map +0 -1
  750. package/lib/workroom/accepted-source-projector.js +0 -281
  751. package/lib/workroom/accepted-source-projector.js.map +0 -1
  752. package/lib/workroom/assignment-authority-grant-application.d.ts +0 -125
  753. package/lib/workroom/assignment-authority-grant-application.d.ts.map +0 -1
  754. package/lib/workroom/assignment-authority-grant-application.js +0 -318
  755. package/lib/workroom/assignment-authority-grant-application.js.map +0 -1
  756. package/lib/workroom/assignment-authority-grant-repository.d.ts +0 -152
  757. package/lib/workroom/assignment-authority-grant-repository.d.ts.map +0 -1
  758. package/lib/workroom/assignment-authority-grant-repository.js +0 -389
  759. package/lib/workroom/assignment-authority-grant-repository.js.map +0 -1
  760. package/lib/workroom/assignment-authority.d.ts +0 -75
  761. package/lib/workroom/assignment-authority.d.ts.map +0 -1
  762. package/lib/workroom/assignment-authority.js +0 -179
  763. package/lib/workroom/assignment-authority.js.map +0 -1
  764. package/lib/workroom/assignment-executor.d.ts +0 -110
  765. package/lib/workroom/assignment-executor.d.ts.map +0 -1
  766. package/lib/workroom/assignment-executor.js +0 -371
  767. package/lib/workroom/assignment-executor.js.map +0 -1
  768. package/lib/workroom/assignment-observation-ingress.d.ts +0 -21
  769. package/lib/workroom/assignment-observation-ingress.d.ts.map +0 -1
  770. package/lib/workroom/assignment-observation-ingress.js +0 -24
  771. package/lib/workroom/assignment-observation-ingress.js.map +0 -1
  772. package/lib/workroom/canonical-value.d.ts +0 -7
  773. package/lib/workroom/canonical-value.d.ts.map +0 -1
  774. package/lib/workroom/canonical-value.js +0 -32
  775. package/lib/workroom/canonical-value.js.map +0 -1
  776. package/lib/workroom/catalog-definition.d.ts +0 -52
  777. package/lib/workroom/catalog-definition.d.ts.map +0 -1
  778. package/lib/workroom/catalog-definition.js +0 -6
  779. package/lib/workroom/catalog-definition.js.map +0 -1
  780. package/lib/workroom/catalog.d.ts +0 -80
  781. package/lib/workroom/catalog.d.ts.map +0 -1
  782. package/lib/workroom/catalog.js +0 -386
  783. package/lib/workroom/catalog.js.map +0 -1
  784. package/lib/workroom/coding-assignment-executor.d.ts +0 -90
  785. package/lib/workroom/coding-assignment-executor.d.ts.map +0 -1
  786. package/lib/workroom/coding-assignment-executor.js +0 -250
  787. package/lib/workroom/coding-assignment-executor.js.map +0 -1
  788. package/lib/workroom/coding-git-objects.d.ts +0 -17
  789. package/lib/workroom/coding-git-objects.d.ts.map +0 -1
  790. package/lib/workroom/coding-git-objects.js +0 -68
  791. package/lib/workroom/coding-git-objects.js.map +0 -1
  792. package/lib/workroom/database-project-knowledge-journal.d.ts +0 -62
  793. package/lib/workroom/database-project-knowledge-journal.d.ts.map +0 -1
  794. package/lib/workroom/database-project-knowledge-journal.js +0 -161
  795. package/lib/workroom/database-project-knowledge-journal.js.map +0 -1
  796. package/lib/workroom/durable-file-store.d.ts +0 -56
  797. package/lib/workroom/durable-file-store.d.ts.map +0 -1
  798. package/lib/workroom/durable-file-store.js +0 -125
  799. package/lib/workroom/durable-file-store.js.map +0 -1
  800. package/lib/workroom/dynamic-workflow-planner.d.ts +0 -86
  801. package/lib/workroom/dynamic-workflow-planner.d.ts.map +0 -1
  802. package/lib/workroom/dynamic-workflow-planner.js +0 -260
  803. package/lib/workroom/dynamic-workflow-planner.js.map +0 -1
  804. package/lib/workroom/effect-blocker-repository.d.ts +0 -51
  805. package/lib/workroom/effect-blocker-repository.d.ts.map +0 -1
  806. package/lib/workroom/effect-blocker-repository.js +0 -174
  807. package/lib/workroom/effect-blocker-repository.js.map +0 -1
  808. package/lib/workroom/effect-ledger.d.ts +0 -211
  809. package/lib/workroom/effect-ledger.d.ts.map +0 -1
  810. package/lib/workroom/effect-ledger.js +0 -484
  811. package/lib/workroom/effect-ledger.js.map +0 -1
  812. package/lib/workroom/file-accepted-source-memory-repository.d.ts +0 -15
  813. package/lib/workroom/file-accepted-source-memory-repository.d.ts.map +0 -1
  814. package/lib/workroom/file-accepted-source-memory-repository.js +0 -136
  815. package/lib/workroom/file-accepted-source-memory-repository.js.map +0 -1
  816. package/lib/workroom/file-coding-execution-store.d.ts +0 -25
  817. package/lib/workroom/file-coding-execution-store.d.ts.map +0 -1
  818. package/lib/workroom/file-coding-execution-store.js +0 -122
  819. package/lib/workroom/file-coding-execution-store.js.map +0 -1
  820. package/lib/workroom/file-effect-ledger.d.ts +0 -10
  821. package/lib/workroom/file-effect-ledger.d.ts.map +0 -1
  822. package/lib/workroom/file-effect-ledger.js +0 -121
  823. package/lib/workroom/file-effect-ledger.js.map +0 -1
  824. package/lib/workroom/file-human-ingress-application.d.ts +0 -10
  825. package/lib/workroom/file-human-ingress-application.d.ts.map +0 -1
  826. package/lib/workroom/file-human-ingress-application.js +0 -177
  827. package/lib/workroom/file-human-ingress-application.js.map +0 -1
  828. package/lib/workroom/file-human-ingress.d.ts +0 -24
  829. package/lib/workroom/file-human-ingress.d.ts.map +0 -1
  830. package/lib/workroom/file-human-ingress.js +0 -234
  831. package/lib/workroom/file-human-ingress.js.map +0 -1
  832. package/lib/workroom/file-interaction-space-binding-repository.d.ts +0 -24
  833. package/lib/workroom/file-interaction-space-binding-repository.d.ts.map +0 -1
  834. package/lib/workroom/file-interaction-space-binding-repository.js +0 -293
  835. package/lib/workroom/file-interaction-space-binding-repository.js.map +0 -1
  836. package/lib/workroom/file-profile-journal.d.ts +0 -33
  837. package/lib/workroom/file-profile-journal.d.ts.map +0 -1
  838. package/lib/workroom/file-profile-journal.js +0 -311
  839. package/lib/workroom/file-profile-journal.js.map +0 -1
  840. package/lib/workroom/git-workspace-gateway.d.ts +0 -152
  841. package/lib/workroom/git-workspace-gateway.d.ts.map +0 -1
  842. package/lib/workroom/git-workspace-gateway.js +0 -257
  843. package/lib/workroom/git-workspace-gateway.js.map +0 -1
  844. package/lib/workroom/github-workspace-transport.d.ts +0 -30
  845. package/lib/workroom/github-workspace-transport.d.ts.map +0 -1
  846. package/lib/workroom/github-workspace-transport.js +0 -224
  847. package/lib/workroom/github-workspace-transport.js.map +0 -1
  848. package/lib/workroom/governed-dispatch-reasons.d.ts +0 -10
  849. package/lib/workroom/governed-dispatch-reasons.d.ts.map +0 -1
  850. package/lib/workroom/governed-dispatch-reasons.js +0 -20
  851. package/lib/workroom/governed-dispatch-reasons.js.map +0 -1
  852. package/lib/workroom/human-ingress-application.d.ts +0 -128
  853. package/lib/workroom/human-ingress-application.d.ts.map +0 -1
  854. package/lib/workroom/human-ingress-application.js +0 -415
  855. package/lib/workroom/human-ingress-application.js.map +0 -1
  856. package/lib/workroom/human-ingress-orchestrator.d.ts +0 -99
  857. package/lib/workroom/human-ingress-orchestrator.d.ts.map +0 -1
  858. package/lib/workroom/human-ingress-orchestrator.js +0 -262
  859. package/lib/workroom/human-ingress-orchestrator.js.map +0 -1
  860. package/lib/workroom/human-ingress-source-reader.d.ts +0 -29
  861. package/lib/workroom/human-ingress-source-reader.d.ts.map +0 -1
  862. package/lib/workroom/human-ingress-source-reader.js +0 -126
  863. package/lib/workroom/human-ingress-source-reader.js.map +0 -1
  864. package/lib/workroom/human-ingress.d.ts +0 -182
  865. package/lib/workroom/human-ingress.d.ts.map +0 -1
  866. package/lib/workroom/human-ingress.js +0 -526
  867. package/lib/workroom/human-ingress.js.map +0 -1
  868. package/lib/workroom/interaction-space-binding-service.d.ts +0 -57
  869. package/lib/workroom/interaction-space-binding-service.d.ts.map +0 -1
  870. package/lib/workroom/interaction-space-binding-service.js +0 -197
  871. package/lib/workroom/interaction-space-binding-service.js.map +0 -1
  872. package/lib/workroom/interaction-space-router.d.ts +0 -75
  873. package/lib/workroom/interaction-space-router.d.ts.map +0 -1
  874. package/lib/workroom/interaction-space-router.js +0 -243
  875. package/lib/workroom/interaction-space-router.js.map +0 -1
  876. package/lib/workroom/journal/activatable-journal.d.ts +0 -15
  877. package/lib/workroom/journal/activatable-journal.d.ts.map +0 -1
  878. package/lib/workroom/journal/activatable-journal.js +0 -39
  879. package/lib/workroom/journal/activatable-journal.js.map +0 -1
  880. package/lib/workroom/journal/contracts.d.ts +0 -141
  881. package/lib/workroom/journal/contracts.d.ts.map +0 -1
  882. package/lib/workroom/journal/contracts.js +0 -19
  883. package/lib/workroom/journal/contracts.js.map +0 -1
  884. package/lib/workroom/journal/database-journal.d.ts +0 -31
  885. package/lib/workroom/journal/database-journal.d.ts.map +0 -1
  886. package/lib/workroom/journal/database-journal.js +0 -118
  887. package/lib/workroom/journal/database-journal.js.map +0 -1
  888. package/lib/workroom/journal/event-codec.d.ts +0 -26
  889. package/lib/workroom/journal/event-codec.d.ts.map +0 -1
  890. package/lib/workroom/journal/event-codec.js +0 -243
  891. package/lib/workroom/journal/event-codec.js.map +0 -1
  892. package/lib/workroom/journal/event-validation.d.ts +0 -10
  893. package/lib/workroom/journal/event-validation.d.ts.map +0 -1
  894. package/lib/workroom/journal/event-validation.js +0 -671
  895. package/lib/workroom/journal/event-validation.js.map +0 -1
  896. package/lib/workroom/journal/file-journal.d.ts +0 -15
  897. package/lib/workroom/journal/file-journal.d.ts.map +0 -1
  898. package/lib/workroom/journal/file-journal.js +0 -272
  899. package/lib/workroom/journal/file-journal.js.map +0 -1
  900. package/lib/workroom/journal/index.d.ts +0 -9
  901. package/lib/workroom/journal/index.d.ts.map +0 -1
  902. package/lib/workroom/journal/index.js +0 -8
  903. package/lib/workroom/journal/index.js.map +0 -1
  904. package/lib/workroom/journal/memory-journal.d.ts +0 -27
  905. package/lib/workroom/journal/memory-journal.d.ts.map +0 -1
  906. package/lib/workroom/journal/memory-journal.js +0 -103
  907. package/lib/workroom/journal/memory-journal.js.map +0 -1
  908. package/lib/workroom/journal/payload-governance.d.ts +0 -29
  909. package/lib/workroom/journal/payload-governance.d.ts.map +0 -1
  910. package/lib/workroom/journal/payload-governance.js +0 -282
  911. package/lib/workroom/journal/payload-governance.js.map +0 -1
  912. package/lib/workroom/journal/payload-reference.d.ts +0 -9
  913. package/lib/workroom/journal/payload-reference.d.ts.map +0 -1
  914. package/lib/workroom/journal/payload-reference.js +0 -60
  915. package/lib/workroom/journal/payload-reference.js.map +0 -1
  916. package/lib/workroom/journal/stored-event-projection.d.ts +0 -6
  917. package/lib/workroom/journal/stored-event-projection.d.ts.map +0 -1
  918. package/lib/workroom/journal/stored-event-projection.js +0 -280
  919. package/lib/workroom/journal/stored-event-projection.js.map +0 -1
  920. package/lib/workroom/journal-model.d.ts +0 -40
  921. package/lib/workroom/journal-model.d.ts.map +0 -1
  922. package/lib/workroom/journal-model.js +0 -12
  923. package/lib/workroom/journal-model.js.map +0 -1
  924. package/lib/workroom/kernel-contracts.d.ts +0 -168
  925. package/lib/workroom/kernel-contracts.d.ts.map +0 -1
  926. package/lib/workroom/kernel-contracts.js +0 -2
  927. package/lib/workroom/kernel-contracts.js.map +0 -1
  928. package/lib/workroom/kernel-state.d.ts +0 -5
  929. package/lib/workroom/kernel-state.d.ts.map +0 -1
  930. package/lib/workroom/kernel-state.js +0 -885
  931. package/lib/workroom/kernel-state.js.map +0 -1
  932. package/lib/workroom/legacy-embedded-payload-migration.d.ts +0 -89
  933. package/lib/workroom/legacy-embedded-payload-migration.d.ts.map +0 -1
  934. package/lib/workroom/legacy-embedded-payload-migration.js +0 -312
  935. package/lib/workroom/legacy-embedded-payload-migration.js.map +0 -1
  936. package/lib/workroom/legacy-run-offline-migration.d.ts +0 -84
  937. package/lib/workroom/legacy-run-offline-migration.d.ts.map +0 -1
  938. package/lib/workroom/legacy-run-offline-migration.js +0 -470
  939. package/lib/workroom/legacy-run-offline-migration.js.map +0 -1
  940. package/lib/workroom/local-assignment-issuance.d.ts +0 -68
  941. package/lib/workroom/local-assignment-issuance.d.ts.map +0 -1
  942. package/lib/workroom/local-assignment-issuance.js +0 -128
  943. package/lib/workroom/local-assignment-issuance.js.map +0 -1
  944. package/lib/workroom/plan-approval-control.d.ts +0 -52
  945. package/lib/workroom/plan-approval-control.d.ts.map +0 -1
  946. package/lib/workroom/plan-approval-control.js +0 -9
  947. package/lib/workroom/plan-approval-control.js.map +0 -1
  948. package/lib/workroom/plan-revision.d.ts +0 -44
  949. package/lib/workroom/plan-revision.d.ts.map +0 -1
  950. package/lib/workroom/plan-revision.js +0 -133
  951. package/lib/workroom/plan-revision.js.map +0 -1
  952. package/lib/workroom/profile-compiler.d.ts +0 -130
  953. package/lib/workroom/profile-compiler.d.ts.map +0 -1
  954. package/lib/workroom/profile-compiler.js +0 -357
  955. package/lib/workroom/profile-compiler.js.map +0 -1
  956. package/lib/workroom/profile-registry.d.ts +0 -191
  957. package/lib/workroom/profile-registry.d.ts.map +0 -1
  958. package/lib/workroom/profile-registry.js +0 -698
  959. package/lib/workroom/profile-registry.js.map +0 -1
  960. package/lib/workroom/project-knowledge-registry.d.ts +0 -136
  961. package/lib/workroom/project-knowledge-registry.d.ts.map +0 -1
  962. package/lib/workroom/project-knowledge-registry.js +0 -429
  963. package/lib/workroom/project-knowledge-registry.js.map +0 -1
  964. package/lib/workroom/projection-outbox/contracts.d.ts +0 -195
  965. package/lib/workroom/projection-outbox/contracts.d.ts.map +0 -1
  966. package/lib/workroom/projection-outbox/contracts.js +0 -11
  967. package/lib/workroom/projection-outbox/contracts.js.map +0 -1
  968. package/lib/workroom/projection-outbox/delivery-worker.d.ts +0 -22
  969. package/lib/workroom/projection-outbox/delivery-worker.d.ts.map +0 -1
  970. package/lib/workroom/projection-outbox/delivery-worker.js +0 -96
  971. package/lib/workroom/projection-outbox/delivery-worker.js.map +0 -1
  972. package/lib/workroom/projection-outbox/file-repository.d.ts +0 -11
  973. package/lib/workroom/projection-outbox/file-repository.d.ts.map +0 -1
  974. package/lib/workroom/projection-outbox/file-repository.js +0 -89
  975. package/lib/workroom/projection-outbox/file-repository.js.map +0 -1
  976. package/lib/workroom/projection-outbox/index.d.ts +0 -10
  977. package/lib/workroom/projection-outbox/index.d.ts.map +0 -1
  978. package/lib/workroom/projection-outbox/index.js +0 -8
  979. package/lib/workroom/projection-outbox/index.js.map +0 -1
  980. package/lib/workroom/projection-outbox/memory-repository.d.ts +0 -11
  981. package/lib/workroom/projection-outbox/memory-repository.d.ts.map +0 -1
  982. package/lib/workroom/projection-outbox/memory-repository.js +0 -40
  983. package/lib/workroom/projection-outbox/memory-repository.js.map +0 -1
  984. package/lib/workroom/projection-outbox/projector.d.ts +0 -36
  985. package/lib/workroom/projection-outbox/projector.d.ts.map +0 -1
  986. package/lib/workroom/projection-outbox/projector.js +0 -517
  987. package/lib/workroom/projection-outbox/projector.js.map +0 -1
  988. package/lib/workroom/projection-outbox/repository-state.d.ts +0 -17
  989. package/lib/workroom/projection-outbox/repository-state.d.ts.map +0 -1
  990. package/lib/workroom/projection-outbox/repository-state.js +0 -343
  991. package/lib/workroom/projection-outbox/repository-state.js.map +0 -1
  992. package/lib/workroom/projection-outbox/tracer.d.ts +0 -19
  993. package/lib/workroom/projection-outbox/tracer.d.ts.map +0 -1
  994. package/lib/workroom/projection-outbox/tracer.js +0 -201
  995. package/lib/workroom/projection-outbox/tracer.js.map +0 -1
  996. package/lib/workroom/remote-assignment-dispatch-command.d.ts +0 -31
  997. package/lib/workroom/remote-assignment-dispatch-command.d.ts.map +0 -1
  998. package/lib/workroom/remote-assignment-dispatch-command.js +0 -56
  999. package/lib/workroom/remote-assignment-dispatch-command.js.map +0 -1
  1000. package/lib/workroom/remote-assignment-issuance.d.ts +0 -88
  1001. package/lib/workroom/remote-assignment-issuance.d.ts.map +0 -1
  1002. package/lib/workroom/remote-assignment-issuance.js +0 -201
  1003. package/lib/workroom/remote-assignment-issuance.js.map +0 -1
  1004. package/lib/workroom/remote-callback-application.d.ts +0 -115
  1005. package/lib/workroom/remote-callback-application.d.ts.map +0 -1
  1006. package/lib/workroom/remote-callback-application.js +0 -570
  1007. package/lib/workroom/remote-callback-application.js.map +0 -1
  1008. package/lib/workroom/remote-callback-gateway.d.ts +0 -60
  1009. package/lib/workroom/remote-callback-gateway.d.ts.map +0 -1
  1010. package/lib/workroom/remote-callback-gateway.js +0 -173
  1011. package/lib/workroom/remote-callback-gateway.js.map +0 -1
  1012. package/lib/workroom/remote-callback-inbox.d.ts +0 -278
  1013. package/lib/workroom/remote-callback-inbox.d.ts.map +0 -1
  1014. package/lib/workroom/remote-callback-inbox.js +0 -1088
  1015. package/lib/workroom/remote-callback-inbox.js.map +0 -1
  1016. package/lib/workroom/remote-callback-reconciliation-worker.d.ts +0 -60
  1017. package/lib/workroom/remote-callback-reconciliation-worker.d.ts.map +0 -1
  1018. package/lib/workroom/remote-callback-reconciliation-worker.js +0 -197
  1019. package/lib/workroom/remote-callback-reconciliation-worker.js.map +0 -1
  1020. package/lib/workroom/remote-dispatch-admission.d.ts +0 -45
  1021. package/lib/workroom/remote-dispatch-admission.d.ts.map +0 -1
  1022. package/lib/workroom/remote-dispatch-admission.js +0 -187
  1023. package/lib/workroom/remote-dispatch-admission.js.map +0 -1
  1024. package/lib/workroom/remote-dispatch-outbox.d.ts +0 -204
  1025. package/lib/workroom/remote-dispatch-outbox.d.ts.map +0 -1
  1026. package/lib/workroom/remote-dispatch-outbox.js +0 -768
  1027. package/lib/workroom/remote-dispatch-outbox.js.map +0 -1
  1028. package/lib/workroom/remote-dispatch-scheduler.d.ts +0 -36
  1029. package/lib/workroom/remote-dispatch-scheduler.d.ts.map +0 -1
  1030. package/lib/workroom/remote-dispatch-scheduler.js +0 -133
  1031. package/lib/workroom/remote-dispatch-scheduler.js.map +0 -1
  1032. package/lib/workroom/remote-dispatch-worker.d.ts +0 -22
  1033. package/lib/workroom/remote-dispatch-worker.d.ts.map +0 -1
  1034. package/lib/workroom/remote-dispatch-worker.js +0 -124
  1035. package/lib/workroom/remote-dispatch-worker.js.map +0 -1
  1036. package/lib/workroom/remote-dispatch.d.ts +0 -79
  1037. package/lib/workroom/remote-dispatch.d.ts.map +0 -1
  1038. package/lib/workroom/remote-dispatch.js +0 -220
  1039. package/lib/workroom/remote-dispatch.js.map +0 -1
  1040. package/lib/workroom/remote-executor.d.ts +0 -15
  1041. package/lib/workroom/remote-executor.d.ts.map +0 -1
  1042. package/lib/workroom/remote-executor.js +0 -21
  1043. package/lib/workroom/remote-executor.js.map +0 -1
  1044. package/lib/workroom/role-capability-snapshot.d.ts +0 -88
  1045. package/lib/workroom/role-capability-snapshot.d.ts.map +0 -1
  1046. package/lib/workroom/role-capability-snapshot.js +0 -456
  1047. package/lib/workroom/role-capability-snapshot.js.map +0 -1
  1048. package/lib/workroom/runtime.d.ts +0 -142
  1049. package/lib/workroom/runtime.d.ts.map +0 -1
  1050. package/lib/workroom/runtime.js +0 -543
  1051. package/lib/workroom/runtime.js.map +0 -1
  1052. package/lib/workroom/scheduler-priority-control.d.ts +0 -35
  1053. package/lib/workroom/scheduler-priority-control.d.ts.map +0 -1
  1054. package/lib/workroom/scheduler-priority-control.js +0 -9
  1055. package/lib/workroom/scheduler-priority-control.js.map +0 -1
  1056. package/lib/workroom/software-delivery-plan.d.ts +0 -32
  1057. package/lib/workroom/software-delivery-plan.d.ts.map +0 -1
  1058. package/lib/workroom/software-delivery-plan.js +0 -60
  1059. package/lib/workroom/software-delivery-plan.js.map +0 -1
  1060. package/lib/workroom/validate-catalog.d.ts +0 -2
  1061. package/lib/workroom/validate-catalog.d.ts.map +0 -1
  1062. package/lib/workroom/validate-catalog.js +0 -230
  1063. package/lib/workroom/validate-catalog.js.map +0 -1
  1064. package/lib/workroom/workflow-plan-builder.d.ts +0 -88
  1065. package/lib/workroom/workflow-plan-builder.d.ts.map +0 -1
  1066. package/lib/workroom/workflow-plan-builder.js +0 -232
  1067. package/lib/workroom/workflow-plan-builder.js.map +0 -1
  1068. package/lib/workroom/workroom-assignment-knowledge-context.d.ts +0 -102
  1069. package/lib/workroom/workroom-assignment-knowledge-context.d.ts.map +0 -1
  1070. package/lib/workroom/workroom-assignment-knowledge-context.js +0 -127
  1071. package/lib/workroom/workroom-assignment-knowledge-context.js.map +0 -1
  1072. package/lib/workroom/workroom-kernel.d.ts +0 -157
  1073. package/lib/workroom/workroom-kernel.d.ts.map +0 -1
  1074. package/lib/workroom/workroom-kernel.js +0 -1526
  1075. package/lib/workroom/workroom-kernel.js.map +0 -1
  1076. package/lib/workroom/workroom-preemption.d.ts +0 -65
  1077. package/lib/workroom/workroom-preemption.d.ts.map +0 -1
  1078. package/lib/workroom/workroom-preemption.js +0 -213
  1079. package/lib/workroom/workroom-preemption.js.map +0 -1
  1080. package/lib/workroom/workroom-run-control.d.ts +0 -69
  1081. package/lib/workroom/workroom-run-control.d.ts.map +0 -1
  1082. package/lib/workroom/workroom-run-control.js +0 -144
  1083. package/lib/workroom/workroom-run-control.js.map +0 -1
  1084. package/lib/workroom/workroom-scheduler-application.d.ts +0 -43
  1085. package/lib/workroom/workroom-scheduler-application.d.ts.map +0 -1
  1086. package/lib/workroom/workroom-scheduler-application.js +0 -71
  1087. package/lib/workroom/workroom-scheduler-application.js.map +0 -1
  1088. package/lib/workroom/workroom-scheduler.d.ts +0 -135
  1089. package/lib/workroom/workroom-scheduler.d.ts.map +0 -1
  1090. package/lib/workroom/workroom-scheduler.js +0 -660
  1091. package/lib/workroom/workroom-scheduler.js.map +0 -1
  1092. package/lib/workroom/workroom-task-report-store.d.ts +0 -131
  1093. package/lib/workroom/workroom-task-report-store.d.ts.map +0 -1
  1094. package/lib/workroom/workroom-task-report-store.js +0 -528
  1095. package/lib/workroom/workroom-task-report-store.js.map +0 -1
@@ -1,1088 +0,0 @@
1
- import { createHash } from 'node:crypto';
2
- import { readFile as nodeReadFile, readdir as nodeReaddir, } from 'node:fs/promises';
3
- import { join } from 'node:path';
4
- import { canonicalWorkroomJson as stableJson, deepFreezeWorkroomValue as deepFreeze, digestCanonicalWorkroomValue as digest, } from './canonical-value.js';
5
- import { DurableFileStore, nodeDurableFileSystem, } from './durable-file-store.js';
6
- export class RemoteCallbackInboxSequenceConflictError extends Error {
7
- linkId;
8
- expectedSequence;
9
- actualSequence;
10
- constructor(linkId, expectedSequence, actualSequence) {
11
- super(`Remote Callback Inbox ${linkId} sequence conflict: expected ${expectedSequence}, `
12
- + `actual ${actualSequence}`);
13
- this.linkId = linkId;
14
- this.expectedSequence = expectedSequence;
15
- this.actualSequence = actualSequence;
16
- this.name = 'RemoteCallbackInboxSequenceConflictError';
17
- }
18
- }
19
- export class MemoryRemoteCallbackInboxRepository {
20
- #events = new Map();
21
- async read(linkId) {
22
- return project(this.#events.get(identifier(linkId, 'linkId')) ?? []);
23
- }
24
- async append(linkId, expectedSequence, drafts) {
25
- const id = identifier(linkId, 'linkId');
26
- const current = this.#events.get(id) ?? [];
27
- const appended = materializeAppend(id, current, expectedSequence, drafts);
28
- if (appended.some(event => event.sequence >= current.length)) {
29
- this.#events.set(id, Object.freeze([...current, ...appended]));
30
- }
31
- return appended;
32
- }
33
- }
34
- const nodeFileSystem = Object.freeze({
35
- ...nodeDurableFileSystem,
36
- readdir: async (path) => await nodeReaddir(path),
37
- readFile: async (path, encoding) => await nodeReadFile(path, encoding),
38
- });
39
- /** Immutable file segments plus hard-link claim provide a restart-safe filesystem CAS. */
40
- export class FileRemoteCallbackInboxRepository {
41
- directory;
42
- fileSystem;
43
- #durable;
44
- constructor(directory, fileSystem = nodeFileSystem) {
45
- this.directory = directory;
46
- this.fileSystem = fileSystem;
47
- this.#durable = new DurableFileStore(directory, fileSystem);
48
- }
49
- async read(linkId) {
50
- const events = await this.#readEvents(identifier(linkId, 'linkId'));
51
- // A prior hard-link may have succeeded while its directory fsync failed.
52
- // Re-observing the file is not durability proof; sync before confirming it.
53
- if (events.length > 0)
54
- await this.#durable.syncLeaf();
55
- return project(events);
56
- }
57
- async append(linkId, expectedSequence, drafts) {
58
- const id = identifier(linkId, 'linkId');
59
- const current = await this.#readEvents(id);
60
- const appended = materializeAppend(id, current, expectedSequence, drafts);
61
- if (appended.length === 0 || appended.every(event => event.sequence < current.length)) {
62
- if (current.length > 0)
63
- await this.#durable.syncLeaf();
64
- return appended;
65
- }
66
- await this.#durable.ensureDurableLeaf('Remote Callback Inbox');
67
- const firstSequence = appended[0].sequence;
68
- const streamDigest = hash(id);
69
- const segmentPath = join(this.directory, `${streamDigest}.${String(firstSequence).padStart(16, '0')}.json`);
70
- const encoded = JSON.stringify(appended);
71
- const published = await this.#durable.publishCreateOnly({
72
- target: segmentPath,
73
- content: encoded,
74
- createdValue: appended,
75
- onConflict: async () => {
76
- const winner = await this.#readEvents(id);
77
- const replay = materializeAppend(id, winner, expectedSequence, drafts);
78
- if (replay.length > 0 && replay.every(event => event.sequence < winner.length)) {
79
- return replay;
80
- }
81
- throw new RemoteCallbackInboxSequenceConflictError(id, expectedSequence, winner.at(-1)?.sequence ?? -1);
82
- },
83
- });
84
- return published.value;
85
- }
86
- async #readEvents(linkId) {
87
- const prefix = `${hash(linkId)}.`;
88
- let names;
89
- try {
90
- names = (await this.fileSystem.readdir(this.directory))
91
- .filter(name => name.startsWith(prefix) && name.endsWith('.json'))
92
- .sort();
93
- }
94
- catch (error) {
95
- if (isMissingFile(error))
96
- return [];
97
- throw error;
98
- }
99
- const segments = await Promise.all(names.map(async (name) => {
100
- const encodedSequence = name.slice(prefix.length, -'.json'.length);
101
- if (!/^\d{16}$/u.test(encodedSequence)) {
102
- throw new Error('Remote Callback Inbox segment filename sequence is invalid');
103
- }
104
- const firstSequence = Number(encodedSequence);
105
- const parsed = JSON.parse(await this.fileSystem.readFile(join(this.directory, name), 'utf8'));
106
- if (!Array.isArray(parsed))
107
- throw new Error('Remote Callback Inbox segment must be an event array');
108
- const events = parsed.map(parseEvent);
109
- if (events.length === 0 || events[0].sequence !== firstSequence) {
110
- throw new Error('Remote Callback Inbox segment filename sequence does not bind its first event');
111
- }
112
- return events;
113
- }));
114
- const events = segments.flat().sort((left, right) => left.sequence - right.sequence);
115
- if (events.some(event => event.linkId !== linkId)) {
116
- throw new Error('Remote Callback Inbox link identity collision');
117
- }
118
- assertContiguous(events);
119
- return Object.freeze(events);
120
- }
121
- }
122
- export class RemoteCallbackInbox {
123
- repository;
124
- link;
125
- #maxSequenceGap;
126
- constructor(repository, link, options) {
127
- this.repository = repository;
128
- this.link = link;
129
- assertRemoteExecutionLink(link);
130
- this.#maxSequenceGap = positiveInteger(options.maxSequenceGap, 'maxSequenceGap');
131
- }
132
- async read() {
133
- const projection = await this.repository.read(this.link.id);
134
- if (projection && stableJson(projection.link) !== stableJson(this.link)) {
135
- throw new Error('Remote Callback Inbox persisted Link does not match the trusted Link');
136
- }
137
- return projection;
138
- }
139
- async receive(envelope, expectedSequence) {
140
- const normalized = normalizeEnvelope(this.link, envelope);
141
- const current = await this.read();
142
- const duplicate = findDuplicate(current, normalized);
143
- if (duplicate) {
144
- return deepFreeze({
145
- duplicate: true,
146
- ...(duplicate.observation ? { observation: duplicate.observation } : {}),
147
- projection: current,
148
- });
149
- }
150
- const actualSequence = current?.sequence ?? -1;
151
- if (actualSequence !== expectedSequence) {
152
- throw new RemoteCallbackInboxSequenceConflictError(this.link.id, expectedSequence, actualSequence);
153
- }
154
- if (current?.status === 'terminal_observed') {
155
- throw new Error('Remote Callback Inbox cannot accept callbacks after terminal observation');
156
- }
157
- const cursor = current?.callbackCursor ?? 0;
158
- const drafts = [];
159
- if (!current)
160
- drafts.push(registeredDraft(this.link));
161
- if (current?.status === 'reconcile_required' || normalized.callbackSequence > cursor + 1) {
162
- const gap = normalized.callbackSequence - (cursor + 1);
163
- if (gap > this.#maxSequenceGap) {
164
- throw new Error('Remote Callback Inbox callback sequence gap exceeds the bounded window');
165
- }
166
- assertAvailableSequence(current, normalized);
167
- drafts.push(deferredDraft(normalized));
168
- }
169
- else {
170
- if (normalized.callbackSequence !== cursor + 1) {
171
- throw new Error('Remote Callback Inbox callback sequence is stale or non-monotonic');
172
- }
173
- drafts.push(acceptedDraft(this.link, normalized));
174
- }
175
- await this.repository.append(this.link.id, expectedSequence, drafts);
176
- const projection = await this.read();
177
- if (!projection)
178
- throw new Error('Remote Callback Inbox projection disappeared after receive');
179
- const accepted = projection.accepted.find(item => item.eventId === normalized.eventId);
180
- return deepFreeze({
181
- duplicate: false,
182
- ...(accepted ? { observation: accepted.observation } : {}),
183
- projection,
184
- });
185
- }
186
- async reconcile(envelopes, expectedSequence, value) {
187
- const current = await this.read();
188
- if (!current) {
189
- throw new Error('Remote Callback Inbox has no sequence gap to reconcile');
190
- }
191
- const normalizedEnvelopes = envelopes.map(value => normalizeEnvelope(this.link, value));
192
- const reconciliationReceipt = normalizeReconciliationReceipt(this.link, value, normalizedEnvelopes);
193
- if (current.status !== 'reconcile_required') {
194
- const durableReplay = expectedSequence < current.sequence
195
- && normalizedEnvelopes.every(envelope => findDuplicate(current, envelope) !== undefined)
196
- && current.accepted.some(item => stableJson(item.reconciliationReceipt) === stableJson(reconciliationReceipt));
197
- if (durableReplay)
198
- return current;
199
- throw new Error('Remote Callback Inbox has no sequence gap to reconcile');
200
- }
201
- if (current.sequence !== expectedSequence) {
202
- throw new RemoteCallbackInboxSequenceConflictError(this.link.id, expectedSequence, current.sequence);
203
- }
204
- if (reconciliationReceipt.fromCursor !== current.callbackCursor) {
205
- throw new Error('Remote Callback Inbox poll receipt cursor does not match the durable cursor');
206
- }
207
- const expectedSnapshotCursor = Math.max(current.callbackCursor, ...current.deferred.map(envelope => envelope.callbackSequence), ...normalizedEnvelopes.map(envelope => envelope.callbackSequence));
208
- if (reconciliationReceipt.snapshotCursor !== expectedSnapshotCursor) {
209
- throw new Error('Remote Callback Inbox poll snapshot cursor is incomplete or drifted');
210
- }
211
- if (reconciliationReceipt.reconciledAt > this.link.reconcileDeadline) {
212
- throw new Error('Remote Callback Inbox reconciliation deadline has expired');
213
- }
214
- const pending = new Map(current.deferred.map(envelope => [envelope.callbackSequence, envelope]));
215
- const incomingByIdentity = new Map();
216
- for (const normalized of normalizedEnvelopes) {
217
- const identity = `${normalized.gatewayReceipt.endpointId}\0${normalized.eventId}`;
218
- const priorIncoming = incomingByIdentity.get(identity);
219
- if (priorIncoming) {
220
- if (priorIncoming.gatewayReceipt.callbackDigest
221
- !== normalized.gatewayReceipt.callbackDigest) {
222
- throw new Error('Remote Callback Inbox reconciliation callback body drift');
223
- }
224
- continue;
225
- }
226
- incomingByIdentity.set(identity, normalized);
227
- const duplicate = findDuplicate(current, normalized);
228
- if (duplicate)
229
- continue;
230
- if (normalized.callbackSequence - (current.callbackCursor + 1) > this.#maxSequenceGap) {
231
- throw new Error('Remote Callback Inbox callback sequence gap exceeds the bounded window');
232
- }
233
- assertAvailableSequence(current, normalized, pending);
234
- pending.set(normalized.callbackSequence, normalized);
235
- }
236
- const ordered = [...pending.values()].sort((left, right) => left.callbackSequence - right.callbackSequence);
237
- const terminalIndex = ordered.findIndex(envelope => envelope.payload.type === 'execution_completed');
238
- if (terminalIndex >= 0 && terminalIndex !== ordered.length - 1) {
239
- throw new Error('Remote Callback Inbox cannot reconcile callbacks after terminal observation');
240
- }
241
- const drafts = [];
242
- let cursor = current.callbackCursor;
243
- for (const envelope of ordered) {
244
- if (envelope.callbackSequence !== cursor + 1)
245
- break;
246
- drafts.push(acceptedDraft(this.link, envelope, reconciliationReceipt, normalizedEnvelopes));
247
- cursor += 1;
248
- if (envelope.payload.type === 'execution_completed')
249
- break;
250
- }
251
- for (const envelope of incomingByIdentity.values()) {
252
- if (current.deferred.some(item => item.eventId === envelope.eventId)
253
- || drafts.some(draft => draft.type === 'callback.accepted'
254
- && draft.payload.envelope.eventId === envelope.eventId))
255
- continue;
256
- drafts.push(deferredDraft(envelope));
257
- }
258
- if (drafts.length === 0)
259
- return current;
260
- await this.repository.append(this.link.id, expectedSequence, drafts);
261
- const projection = await this.read();
262
- if (!projection)
263
- throw new Error('Remote Callback Inbox projection disappeared after reconcile');
264
- return projection;
265
- }
266
- }
267
- export function createRemoteExecutionLink(input) {
268
- validateLinkInput(input);
269
- const id = `remote-execution-link:v1:${[
270
- input.projectId,
271
- input.runId,
272
- input.assignmentId,
273
- String(input.attempt),
274
- String(input.fence),
275
- ].map(encodeURIComponent).join(':')}`;
276
- const projection = deepFreeze({
277
- version: 1,
278
- id,
279
- ...input,
280
- endpoint: { ...input.endpoint },
281
- workspace: { ...input.workspace, pathScope: [...input.workspace.pathScope] },
282
- });
283
- return deepFreeze({ ...projection, digest: digest(projection) });
284
- }
285
- /** Canonical body digest computed before the trusted gateway receipt is attached. */
286
- export function digestRemoteCallbackMessage(value) {
287
- const { gatewayReceipt: _gatewayReceipt, ...message } = value;
288
- return digest(message);
289
- }
290
- export function digestRemoteCallbackReconciliationBatch(input) {
291
- return digest({
292
- receiptId: input.receiptId,
293
- source: input.source,
294
- reconciledAt: input.reconciledAt,
295
- endpointId: input.endpointId,
296
- cardDigest: input.cardDigest,
297
- authBindingId: input.authBindingId,
298
- linkId: input.linkId,
299
- fromCursor: input.fromCursor,
300
- snapshotCursor: input.snapshotCursor,
301
- callbackDigests: input.callbackDigests,
302
- });
303
- }
304
- function assertRemoteExecutionLink(value) {
305
- if (!value || typeof value !== 'object')
306
- throw new Error('Invalid Remote Execution Link');
307
- const { version, id, digest: actualDigest, ...input } = value;
308
- if (version !== 1)
309
- throw new Error('Remote Execution Link version is unsupported');
310
- const canonical = createRemoteExecutionLink(input);
311
- if (id !== canonical.id || actualDigest !== canonical.digest || stableJson(value) !== stableJson(canonical)) {
312
- throw new Error('Remote Execution Link identity or digest is invalid');
313
- }
314
- if (!Object.isFrozen(value) || !Object.isFrozen(value.endpoint) || !Object.isFrozen(value.workspace)) {
315
- throw new Error('Remote Execution Link must be deeply immutable');
316
- }
317
- }
318
- function validateLinkInput(input) {
319
- assertExactKeys(input, [
320
- 'linkedAt', 'reconcileDeadline', 'projectId', 'runId', 'taskKey',
321
- 'taskRevision', 'assignmentId', 'assignmentRevision', 'attempt', 'fence',
322
- 'assignmentEnvelopeDigest', 'dispatchId', 'messageId',
323
- 'dispatchEnvelopeDigest', 'endpoint', 'remoteTaskId', 'remoteContextId',
324
- 'workspace',
325
- ], 'Remote Execution Link input');
326
- assertExactKeys(input.endpoint, ['id', 'cardDigest', 'authBindingId'], 'Link endpoint');
327
- assertExactKeys(input.workspace, [
328
- 'provider', 'repositoryId', 'integrationBindingId', 'baseSha', 'checkpointSha',
329
- 'targetRef', 'branchRef', 'pathScope', 'mode', 'fence',
330
- ], 'Link workspace');
331
- timestamp(input.linkedAt, 'linkedAt');
332
- timestamp(input.reconcileDeadline, 'reconcileDeadline');
333
- if (input.reconcileDeadline <= input.linkedAt)
334
- throw new Error('Remote Execution Link deadline is invalid');
335
- for (const [name, value] of Object.entries({
336
- projectId: input.projectId,
337
- runId: input.runId,
338
- taskKey: input.taskKey,
339
- assignmentId: input.assignmentId,
340
- dispatchId: input.dispatchId,
341
- messageId: input.messageId,
342
- endpointId: input.endpoint.id,
343
- authBindingId: input.endpoint.authBindingId,
344
- remoteTaskId: input.remoteTaskId,
345
- remoteContextId: input.remoteContextId,
346
- repositoryId: input.workspace.repositoryId,
347
- integrationBindingId: input.workspace.integrationBindingId,
348
- targetRef: input.workspace.targetRef,
349
- branchRef: input.workspace.branchRef,
350
- }))
351
- identifier(value, name);
352
- for (const [name, value] of Object.entries({
353
- taskRevision: input.taskRevision,
354
- assignmentRevision: input.assignmentRevision,
355
- attempt: input.attempt,
356
- fence: input.fence,
357
- }))
358
- positiveInteger(value, name);
359
- requireDigest(input.assignmentEnvelopeDigest, 'assignmentEnvelopeDigest');
360
- requireDigest(input.dispatchEnvelopeDigest, 'dispatchEnvelopeDigest');
361
- requireDigest(input.endpoint.cardDigest, 'endpoint.cardDigest');
362
- if (input.workspace.provider !== 'github_pull_request')
363
- throw new Error('Remote Execution Link workspace provider is unsupported');
364
- requireGitSha(input.workspace.baseSha, 'workspace.baseSha');
365
- if (input.workspace.checkpointSha !== undefined) {
366
- requireGitSha(input.workspace.checkpointSha, 'workspace.checkpointSha');
367
- }
368
- if (input.workspace.fence !== input.fence)
369
- throw new Error('Remote Execution Link workspace fence mismatch');
370
- requireGitRef(input.workspace.targetRef, 'workspace.targetRef');
371
- requireGitRef(input.workspace.branchRef, 'workspace.branchRef');
372
- if (!Array.isArray(input.workspace.pathScope) || input.workspace.pathScope.length === 0
373
- || input.workspace.pathScope.some(path => !isCanonicalRelativePath(path))) {
374
- throw new Error('Remote Execution Link workspace pathScope must contain canonical relative paths');
375
- }
376
- if (new Set(input.workspace.pathScope).size !== input.workspace.pathScope.length) {
377
- throw new Error('Remote Execution Link workspace pathScope must be unique');
378
- }
379
- if (input.workspace.mode !== 'branch_only' && input.workspace.mode !== 'branch_and_pr') {
380
- throw new Error('Remote Execution Link workspace mode is unsupported');
381
- }
382
- if (input.workspace.targetRef === input.workspace.branchRef)
383
- throw new Error('Remote Execution Link requires an attempt branch distinct from target');
384
- }
385
- function registeredDraft(link) {
386
- return deepFreeze({
387
- eventId: `${link.id}:registered`,
388
- occurredAt: link.linkedAt,
389
- type: 'link.registered',
390
- payload: { link },
391
- });
392
- }
393
- function acceptedDraft(link, envelope, reconciliationReceipt, reconciliationBatch) {
394
- const normalized = normalizeCallback(link, envelope);
395
- return deepFreeze({
396
- eventId: callbackEventId(link.id, 'accepted', envelope),
397
- occurredAt: reconciliationReceipt?.reconciledAt ?? envelope.gatewayReceipt.receivedAt,
398
- type: 'callback.accepted',
399
- payload: {
400
- envelope,
401
- payloadHash: digest(envelope.payload),
402
- observation: normalized.observation,
403
- ...(normalized.completionReceipt
404
- ? { completionReceipt: normalized.completionReceipt }
405
- : {}),
406
- ...(reconciliationReceipt ? { reconciliationReceipt } : {}),
407
- ...(reconciliationBatch
408
- ? { reconciliationBatch: deepFreeze(structuredClone(reconciliationBatch)) }
409
- : {}),
410
- },
411
- });
412
- }
413
- function deferredDraft(envelope) {
414
- return deepFreeze({
415
- eventId: callbackEventId(envelope.linkId, 'deferred', envelope),
416
- occurredAt: envelope.gatewayReceipt.receivedAt,
417
- type: 'callback.deferred',
418
- payload: { envelope, payloadHash: digest(envelope.payload) },
419
- });
420
- }
421
- function callbackEventId(linkId, disposition, envelope) {
422
- return `${linkId}:${disposition}:${encodeURIComponent(envelope.gatewayReceipt.endpointId)}:`
423
- + encodeURIComponent(envelope.eventId);
424
- }
425
- function normalizeEnvelope(link, value) {
426
- const envelope = deepFreeze(structuredClone(value));
427
- assertExactKeys(envelope, [
428
- 'version', 'callbackSequence', 'eventId', 'linkId', 'projectId', 'runId',
429
- 'taskKey', 'taskRevision', 'assignmentId', 'assignmentRevision', 'attempt',
430
- 'fence', 'assignmentEnvelopeDigest', 'dispatchId', 'messageId',
431
- 'dispatchEnvelopeDigest', 'claimedEndpoint', 'remoteTaskId',
432
- 'remoteContextId', 'payload', 'gatewayReceipt',
433
- ], 'Envelope');
434
- assertExactKeys(envelope.claimedEndpoint, [
435
- 'endpointId', 'cardDigest', 'authBindingId',
436
- ], 'claimed endpoint');
437
- assertExactKeys(envelope.gatewayReceipt, [
438
- 'receiptId', 'source', 'receivedAt', 'endpointId', 'cardDigest', 'authBindingId',
439
- 'callbackDigest',
440
- ], 'trusted Gateway receipt');
441
- const exactBindings = [
442
- ['version', envelope.version, 1],
443
- ['linkId', envelope.linkId, link.id],
444
- ['projectId', envelope.projectId, link.projectId],
445
- ['runId', envelope.runId, link.runId],
446
- ['taskKey', envelope.taskKey, link.taskKey],
447
- ['taskRevision', envelope.taskRevision, link.taskRevision],
448
- ['assignmentId', envelope.assignmentId, link.assignmentId],
449
- ['assignmentRevision', envelope.assignmentRevision, link.assignmentRevision],
450
- ['attempt', envelope.attempt, link.attempt],
451
- ['fence', envelope.fence, link.fence],
452
- ['assignmentEnvelopeDigest', envelope.assignmentEnvelopeDigest, link.assignmentEnvelopeDigest],
453
- ['dispatchId', envelope.dispatchId, link.dispatchId],
454
- ['messageId', envelope.messageId, link.messageId],
455
- ['dispatchEnvelopeDigest', envelope.dispatchEnvelopeDigest, link.dispatchEnvelopeDigest],
456
- ['claimedEndpointId', envelope.claimedEndpoint?.endpointId, link.endpoint.id],
457
- ['claimedCardDigest', envelope.claimedEndpoint?.cardDigest, link.endpoint.cardDigest],
458
- ['claimedAuthBindingId', envelope.claimedEndpoint?.authBindingId, link.endpoint.authBindingId],
459
- ['authenticatedEndpointId', envelope.gatewayReceipt?.endpointId, link.endpoint.id],
460
- ['authenticatedCardDigest', envelope.gatewayReceipt?.cardDigest, link.endpoint.cardDigest],
461
- ['authenticatedAuthBindingId', envelope.gatewayReceipt?.authBindingId, link.endpoint.authBindingId],
462
- ['remoteTaskId', envelope.remoteTaskId, link.remoteTaskId],
463
- ['remoteContextId', envelope.remoteContextId, link.remoteContextId],
464
- ];
465
- const drift = exactBindings.find(([, actual, expected]) => actual !== expected);
466
- if (drift)
467
- throw new Error(`Remote Callback Inbox ${drift[0]} does not match the trusted Link`);
468
- identifier(envelope.gatewayReceipt.receiptId, 'gatewayReceipt.receiptId');
469
- if (envelope.gatewayReceipt.source !== 'push' && envelope.gatewayReceipt.source !== 'poll') {
470
- throw new Error('Remote Callback Inbox Gateway receipt source is invalid');
471
- }
472
- timestamp(envelope.gatewayReceipt.receivedAt, 'gatewayReceipt.receivedAt');
473
- requireDigest(envelope.gatewayReceipt.callbackDigest, 'gatewayReceipt.callbackDigest');
474
- if (envelope.gatewayReceipt.callbackDigest !== digestRemoteCallbackMessage(envelope)) {
475
- throw new Error('Remote Callback Inbox Gateway receipt does not bind the exact callback body');
476
- }
477
- positiveInteger(envelope.callbackSequence, 'callbackSequence');
478
- identifier(envelope.eventId, 'eventId');
479
- normalizeCallback(link, envelope);
480
- return envelope;
481
- }
482
- function normalizeReconciliationReceipt(link, value, envelopes) {
483
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
484
- throw new Error('Remote Callback Inbox poll reconciliation receipt must be an object');
485
- }
486
- assertExactKeys(value, [
487
- 'receiptId', 'source', 'reconciledAt', 'endpointId', 'cardDigest',
488
- 'authBindingId', 'linkId', 'fromCursor', 'snapshotCursor',
489
- 'callbackDigests', 'batchDigest',
490
- ], 'poll reconciliation receipt');
491
- identifier(value.receiptId, 'reconciliationReceipt.receiptId');
492
- if (value.source !== 'poll') {
493
- throw new Error('Remote Callback Inbox reconciliation requires a trusted poll receipt');
494
- }
495
- timestamp(value.reconciledAt, 'reconciliationReceipt.reconciledAt');
496
- nonNegativeInteger(value.fromCursor, 'reconciliationReceipt.fromCursor');
497
- nonNegativeInteger(value.snapshotCursor, 'reconciliationReceipt.snapshotCursor');
498
- const exactBindings = [
499
- ['endpointId', value.endpointId, link.endpoint.id],
500
- ['cardDigest', value.cardDigest, link.endpoint.cardDigest],
501
- ['authBindingId', value.authBindingId, link.endpoint.authBindingId],
502
- ['linkId', value.linkId, link.id],
503
- ];
504
- const drift = exactBindings.find(([, actual, expected]) => actual !== expected);
505
- if (drift) {
506
- throw new Error(`Remote Callback Inbox poll receipt ${drift[0]} does not match the Link`);
507
- }
508
- if (!Array.isArray(value.callbackDigests)) {
509
- throw new Error('Remote Callback Inbox poll receipt callbackDigests must be an array');
510
- }
511
- const callbackDigests = value.callbackDigests.map((item, index) => {
512
- requireDigest(item, `reconciliationReceipt.callbackDigests[${index}]`);
513
- return item;
514
- });
515
- if (new Set(callbackDigests).size !== callbackDigests.length) {
516
- throw new Error('Remote Callback Inbox poll receipt callbackDigests must be unique');
517
- }
518
- const expectedDigests = envelopes?.map(envelope => envelope.gatewayReceipt.callbackDigest);
519
- if (expectedDigests && stableJson(callbackDigests) !== stableJson(expectedDigests)) {
520
- throw new Error('Remote Callback Inbox poll receipt does not bind the exact callback batch');
521
- }
522
- const input = deepFreeze({
523
- receiptId: value.receiptId,
524
- source: 'poll',
525
- reconciledAt: value.reconciledAt,
526
- endpointId: value.endpointId,
527
- cardDigest: value.cardDigest,
528
- authBindingId: value.authBindingId,
529
- linkId: value.linkId,
530
- fromCursor: value.fromCursor,
531
- snapshotCursor: value.snapshotCursor,
532
- callbackDigests,
533
- });
534
- requireDigest(value.batchDigest, 'reconciliationReceipt.batchDigest');
535
- if (value.batchDigest !== digestRemoteCallbackReconciliationBatch(input)) {
536
- throw new Error('Remote Callback Inbox poll receipt batch digest is invalid');
537
- }
538
- return deepFreeze({ ...input, batchDigest: value.batchDigest });
539
- }
540
- function normalizeCallback(link, envelope) {
541
- const payload = envelope.payload;
542
- if (!payload || typeof payload !== 'object')
543
- throw new Error('Remote Callback Inbox payload is invalid');
544
- let candidate;
545
- let completionReceipt;
546
- if (payload.type === 'heartbeat') {
547
- assertExactKeys(payload, ['type'], 'heartbeat payload');
548
- candidate = { version: 1, type: 'heartbeat', observationId: envelope.eventId, envelopeDigest: link.assignmentEnvelopeDigest };
549
- }
550
- else if (payload.type === 'progress') {
551
- assertExactKeys(payload, ['type', 'progress'], 'progress payload');
552
- if (!payload.progress || typeof payload.progress !== 'object') {
553
- throw new Error('Remote Callback Inbox progress must be an object');
554
- }
555
- assertExactKeys(payload.progress, [
556
- 'summary', 'completedUnits', 'totalUnits',
557
- ], 'progress');
558
- identifier(payload.progress.summary, 'progress.summary');
559
- const completedUnits = optionalNonNegativeInteger(payload.progress.completedUnits, 'progress.completedUnits');
560
- const totalUnits = optionalPositiveInteger(payload.progress.totalUnits, 'progress.totalUnits');
561
- if (completedUnits !== undefined && totalUnits !== undefined && completedUnits > totalUnits) {
562
- throw new Error('Remote Callback Inbox progress completedUnits exceeds totalUnits');
563
- }
564
- candidate = {
565
- version: 1,
566
- type: 'progress',
567
- observationId: envelope.eventId,
568
- envelopeDigest: link.assignmentEnvelopeDigest,
569
- progress: {
570
- summary: payload.progress.summary,
571
- ...(completedUnits === undefined ? {} : { completedUnits }),
572
- ...(totalUnits === undefined ? {} : { totalUnits }),
573
- },
574
- };
575
- }
576
- else if (payload.type === 'checkpoint') {
577
- assertExactKeys(payload, ['type', 'checkpoint'], 'checkpoint payload');
578
- if (!payload.checkpoint || typeof payload.checkpoint !== 'object') {
579
- throw new Error('Remote Callback Inbox checkpoint must be an object');
580
- }
581
- assertExactKeys(payload.checkpoint, ['ref', 'digest'], 'checkpoint');
582
- identifier(payload.checkpoint.ref, 'checkpoint.ref');
583
- requireDigest(payload.checkpoint.digest, 'checkpoint.digest');
584
- candidate = {
585
- version: 1,
586
- type: 'checkpoint',
587
- observationId: envelope.eventId,
588
- envelopeDigest: link.assignmentEnvelopeDigest,
589
- checkpoint: payload.checkpoint,
590
- };
591
- }
592
- else if (payload.type === 'execution_completed') {
593
- assertExactKeys(payload, ['type', 'completion'], 'execution_completed payload');
594
- const completion = payload.completion;
595
- if (!completion || typeof completion !== 'object') {
596
- throw new Error('Remote Callback Inbox completion must be an object');
597
- }
598
- assertExactKeys(completion, [
599
- 'report', 'candidate', 'claims', 'evidence', 'workspaceReceipt',
600
- ], 'completion');
601
- if (!completion.report || typeof completion.report !== 'object'
602
- || !completion.candidate || typeof completion.candidate !== 'object') {
603
- throw new Error('Remote Callback Inbox completion references are invalid');
604
- }
605
- assertExactKeys(completion.report, ['ref', 'digest'], 'completion report');
606
- assertExactKeys(completion.candidate, ['ref', 'hash'], 'completion candidate');
607
- identifier(completion.report.ref, 'completion.report.ref');
608
- requireDigest(completion.report.digest, 'completion.report.digest');
609
- identifier(completion.candidate.ref, 'completion.candidate.ref');
610
- requireDigest(completion.candidate.hash, 'completion.candidate.hash');
611
- const claims = normalizeContentReferences(completion.claims, 'completion.claims');
612
- const evidence = normalizeContentReferences(completion.evidence, 'completion.evidence');
613
- const workspaceReceipt = normalizeWorkspaceReceipt(link, completion.workspaceReceipt);
614
- completionReceipt = deepFreeze({
615
- report: { ref: completion.report.ref, digest: completion.report.digest },
616
- candidate: { ref: completion.candidate.ref, hash: completion.candidate.hash },
617
- claims,
618
- evidence,
619
- workspaceReceipt,
620
- });
621
- candidate = {
622
- version: 1,
623
- type: 'execution_completed',
624
- observationId: envelope.eventId,
625
- envelopeDigest: link.assignmentEnvelopeDigest,
626
- completion: {
627
- report: completion.report,
628
- candidate: completion.candidate,
629
- completionReceiptDigest: digest(completionReceipt),
630
- },
631
- };
632
- }
633
- else {
634
- throw new Error('Remote Callback Inbox callback type is unsupported');
635
- }
636
- return deepFreeze({
637
- observation: deepFreeze(candidate),
638
- ...(completionReceipt ? { completionReceipt } : {}),
639
- });
640
- }
641
- function normalizeContentReferences(value, label) {
642
- if (!Array.isArray(value))
643
- throw new Error(`Remote Callback Inbox ${label} must be an array`);
644
- const refs = new Set();
645
- return deepFreeze(value.map((item, index) => {
646
- if (!item || typeof item !== 'object' || Array.isArray(item)) {
647
- throw new Error(`Remote Callback Inbox ${label}[${index}] must be an object`);
648
- }
649
- assertExactKeys(item, ['ref', 'digest'], `${label}[${index}]`);
650
- const ref = identifier(item.ref, `${label}[${index}].ref`);
651
- requireDigest(item.digest, `${label}[${index}].digest`);
652
- if (refs.has(ref))
653
- throw new Error(`Remote Callback Inbox ${label} refs must be unique`);
654
- refs.add(ref);
655
- return { ref, digest: item.digest };
656
- }));
657
- }
658
- function normalizeWorkspaceReceipt(link, value) {
659
- if (!value || typeof value !== 'object')
660
- throw new Error('Remote completion Workspace receipt is invalid');
661
- assertExactKeys(value, [
662
- 'provider', 'repositoryId', 'integrationBindingId', 'baseSha', 'checkpointSha',
663
- 'targetRef', 'branchRef', 'pathScope', 'mode', 'headSha', 'pullRequestRef',
664
- 'pullRequestHash', 'fence',
665
- ], 'Workspace receipt');
666
- for (const [name, actual, expected] of [
667
- ['provider', value.provider, link.workspace.provider],
668
- ['repositoryId', value.repositoryId, link.workspace.repositoryId],
669
- ['integrationBindingId', value.integrationBindingId, link.workspace.integrationBindingId],
670
- ['baseSha', value.baseSha, link.workspace.baseSha],
671
- ['checkpointSha', value.checkpointSha, link.workspace.checkpointSha],
672
- ['targetRef', value.targetRef, link.workspace.targetRef],
673
- ['branchRef', value.branchRef, link.workspace.branchRef],
674
- ['mode', value.mode, link.workspace.mode],
675
- ['fence', value.fence, link.workspace.fence],
676
- ]) {
677
- if (actual !== expected)
678
- throw new Error(`Remote completion Workspace ${name} does not match the Link`);
679
- }
680
- if (stableJson(value.pathScope) !== stableJson(link.workspace.pathScope)) {
681
- throw new Error('Remote completion Workspace pathScope does not match the Link');
682
- }
683
- requireGitSha(value.headSha, 'workspaceReceipt.headSha');
684
- if (value.mode === 'branch_and_pr') {
685
- identifier(value.pullRequestRef, 'workspaceReceipt.pullRequestRef');
686
- requireDigest(value.pullRequestHash, 'workspaceReceipt.pullRequestHash');
687
- }
688
- else if (value.pullRequestRef !== undefined || value.pullRequestHash !== undefined) {
689
- throw new Error('Remote completion branch_only Workspace cannot contain a PR receipt');
690
- }
691
- return deepFreeze({ ...value, pathScope: [...value.pathScope] });
692
- }
693
- function materializeAppend(linkId, current, expectedSequence, drafts) {
694
- sequence(expectedSequence, 'expectedSequence');
695
- const normalized = drafts.map(normalizeDraft);
696
- const existingById = new Map(current.map(event => [event.eventId, event]));
697
- const replayed = [];
698
- for (const draft of normalized) {
699
- const existing = existingById.get(draft.eventId);
700
- if (!existing)
701
- continue;
702
- if (stableJson({ occurredAt: existing.occurredAt, type: existing.type, payload: existing.payload })
703
- !== stableJson(draft)) {
704
- throw new Error(`Remote Callback Inbox eventId payload conflict: ${draft.eventId}`);
705
- }
706
- replayed.push(existing);
707
- }
708
- if (replayed.length > 0) {
709
- if (replayed.length !== normalized.length)
710
- throw new Error('Remote Callback Inbox append cannot mix replayed and new events');
711
- return Object.freeze(replayed);
712
- }
713
- const actual = current.at(-1)?.sequence ?? -1;
714
- if (actual !== expectedSequence)
715
- throw new RemoteCallbackInboxSequenceConflictError(linkId, expectedSequence, actual);
716
- const appended = normalized.map((draft, index) => deepFreeze({
717
- ...draft,
718
- version: 1,
719
- linkId,
720
- sequence: expectedSequence + index + 1,
721
- }));
722
- project(Object.freeze([...current, ...appended]));
723
- return Object.freeze(appended);
724
- }
725
- function normalizeDraft(draft) {
726
- identifier(draft.eventId, 'eventId');
727
- timestamp(draft.occurredAt, 'occurredAt');
728
- if (draft.type === 'link.registered') {
729
- const raw = draft.payload.link;
730
- if (!raw || typeof raw !== 'object')
731
- throw new Error('Invalid persisted Remote Execution Link');
732
- const { version, id, digest: actualDigest, ...input } = raw;
733
- if (version !== 1)
734
- throw new Error('Remote Execution Link version is unsupported');
735
- const canonical = createRemoteExecutionLink(input);
736
- if (id !== canonical.id || actualDigest !== canonical.digest
737
- || stableJson(raw) !== stableJson(canonical)) {
738
- throw new Error('Persisted Remote Execution Link identity or digest is invalid');
739
- }
740
- return deepFreeze({
741
- eventId: draft.eventId,
742
- occurredAt: draft.occurredAt,
743
- type: 'link.registered',
744
- payload: { link: canonical },
745
- });
746
- }
747
- if (draft.type === 'callback.accepted' || draft.type === 'callback.deferred') {
748
- identifier(draft.payload.payloadHash, 'payloadHash');
749
- if (draft.payload.payloadHash !== digest(draft.payload.envelope.payload)) {
750
- throw new Error('Remote Callback Inbox canonical payload hash is invalid');
751
- }
752
- return deepFreeze(structuredClone(draft));
753
- }
754
- throw new Error('Remote Callback Inbox event type is invalid');
755
- }
756
- function parseEvent(value) {
757
- if (!value || typeof value !== 'object' || Array.isArray(value))
758
- throw new Error('Invalid Remote Callback Inbox event');
759
- const event = value;
760
- const draft = normalizeDraft(event);
761
- if (event.version !== 1)
762
- throw new Error('Remote Callback Inbox event version is invalid');
763
- return deepFreeze({
764
- ...draft,
765
- version: 1,
766
- linkId: identifier(event.linkId, 'linkId'),
767
- sequence: sequence(event.sequence, 'sequence'),
768
- });
769
- }
770
- function createReconciliationReplayGroup(link, receipt, batch, cursor, deferred, accepted) {
771
- if (receipt.fromCursor !== cursor) {
772
- throw new Error('Remote Callback Inbox poll receipt cursor does not match the durable cursor');
773
- }
774
- const expectedSnapshotCursor = Math.max(cursor, ...deferred.keys(), ...batch.map(envelope => envelope.callbackSequence));
775
- if (receipt.snapshotCursor !== expectedSnapshotCursor) {
776
- throw new Error('Remote Callback Inbox poll snapshot cursor is incomplete or drifted');
777
- }
778
- if (receipt.reconciledAt > link.reconcileDeadline) {
779
- throw new Error('Remote Callback Inbox reconciliation deadline has expired');
780
- }
781
- const pending = new Map(deferred);
782
- for (const envelope of batch) {
783
- const priorAccepted = accepted.find(item => item.endpointId === envelope.gatewayReceipt.endpointId
784
- && item.eventId === envelope.eventId);
785
- if (priorAccepted) {
786
- if (priorAccepted.callbackDigest !== envelope.gatewayReceipt.callbackDigest) {
787
- throw new Error('Remote Callback Inbox reconciliation callback body drift');
788
- }
789
- continue;
790
- }
791
- if (envelope.callbackSequence <= cursor) {
792
- throw new Error('Remote Callback Inbox reconciliation batch contains a stale callback');
793
- }
794
- const occupied = pending.get(envelope.callbackSequence);
795
- if (occupied && stableJson(occupied) !== stableJson(envelope)) {
796
- throw new Error('Remote Callback Inbox reconciliation callback sequence drift');
797
- }
798
- pending.set(envelope.callbackSequence, envelope);
799
- }
800
- const ordered = [...pending.values()].sort((left, right) => left.callbackSequence - right.callbackSequence);
801
- const terminalIndex = ordered.findIndex(envelope => envelope.payload.type === 'execution_completed');
802
- if (terminalIndex >= 0 && terminalIndex !== ordered.length - 1) {
803
- throw new Error('Remote Callback Inbox cannot reconcile callbacks after terminal observation');
804
- }
805
- const expected = [];
806
- let expectedCursor = cursor;
807
- for (const envelope of ordered) {
808
- if (envelope.callbackSequence !== expectedCursor + 1)
809
- break;
810
- expected.push(envelope);
811
- expectedCursor += 1;
812
- if (envelope.payload.type === 'execution_completed')
813
- break;
814
- }
815
- if (expected.length === 0) {
816
- throw new Error('Remote Callback Inbox reconciliation accepted group has no proven callback');
817
- }
818
- return {
819
- receipt,
820
- batch,
821
- expected: deepFreeze(expected),
822
- offset: 0,
823
- };
824
- }
825
- function project(events) {
826
- if (events.length === 0)
827
- return undefined;
828
- assertContiguous(events);
829
- const first = events[0];
830
- if (first.type !== 'link.registered' || first.sequence !== 0 || first.linkId !== first.payload.link.id) {
831
- throw new Error('Remote Callback Inbox must begin with its trusted Link');
832
- }
833
- const link = first.payload.link;
834
- if (first.eventId !== `${link.id}:registered` || first.occurredAt !== link.linkedAt) {
835
- throw new Error('Remote Callback Inbox trusted Link registration fact is invalid');
836
- }
837
- const accepted = [];
838
- const deferredBySequence = new Map();
839
- const identities = new Map();
840
- const gatewayReceipts = new Map();
841
- const completedReconciliationReceipts = new Set();
842
- let cursor = 0;
843
- let terminalReceipt;
844
- let activeReconciliation;
845
- for (const event of events.slice(1)) {
846
- if (event.linkId !== link.id)
847
- throw new Error('Remote Callback Inbox event Link identity drift');
848
- if (event.type === 'link.registered')
849
- throw new Error('Remote Callback Inbox Link can only be registered once');
850
- const envelope = normalizeEnvelope(link, event.payload.envelope);
851
- const normalizedCallback = normalizeCallback(link, envelope);
852
- const expectedEventId = callbackEventId(link.id, event.type === 'callback.accepted' ? 'accepted' : 'deferred', envelope);
853
- if (event.eventId !== expectedEventId) {
854
- throw new Error('Remote Callback Inbox persisted callback event identity is invalid');
855
- }
856
- const priorReceiptDigest = gatewayReceipts.get(envelope.gatewayReceipt.receiptId);
857
- if (priorReceiptDigest && priorReceiptDigest !== envelope.gatewayReceipt.callbackDigest) {
858
- throw new Error('Remote Callback Inbox Gateway receipt identity drift');
859
- }
860
- gatewayReceipts.set(envelope.gatewayReceipt.receiptId, envelope.gatewayReceipt.callbackDigest);
861
- const identity = `${envelope.gatewayReceipt.endpointId}\0${envelope.eventId}`;
862
- const existingIdentity = identities.get(identity);
863
- if (existingIdentity && (existingIdentity.payloadHash !== event.payload.payloadHash
864
- || existingIdentity.callbackDigest !== envelope.gatewayReceipt.callbackDigest)) {
865
- throw new Error('Remote Callback Inbox event identity callback body drift');
866
- }
867
- identities.set(identity, {
868
- payloadHash: event.payload.payloadHash,
869
- callbackDigest: envelope.gatewayReceipt.callbackDigest,
870
- });
871
- if (event.type === 'callback.deferred') {
872
- if (activeReconciliation) {
873
- throw new Error('Remote Callback Inbox reconciliation accepted group is incomplete');
874
- }
875
- if (event.occurredAt !== envelope.gatewayReceipt.receivedAt) {
876
- throw new Error('Remote Callback Inbox deferred event time is not Gateway-observed time');
877
- }
878
- if (envelope.callbackSequence <= cursor || deferredBySequence.has(envelope.callbackSequence)) {
879
- throw new Error('Remote Callback Inbox deferred sequence is stale or duplicated');
880
- }
881
- deferredBySequence.set(envelope.callbackSequence, envelope);
882
- continue;
883
- }
884
- if (stableJson(event.payload.observation) !== stableJson(normalizedCallback.observation)
885
- || stableJson(event.payload.completionReceipt)
886
- !== stableJson(normalizedCallback.completionReceipt)) {
887
- throw new Error('Remote Callback Inbox persisted observation does not match callback payload');
888
- }
889
- if (terminalReceipt)
890
- throw new Error('Remote Callback Inbox observation exists after terminal receipt');
891
- if (envelope.callbackSequence !== cursor + 1)
892
- throw new Error('Remote Callback Inbox accepted callback sequence is not contiguous');
893
- const deferred = deferredBySequence.get(envelope.callbackSequence);
894
- if (deferred && stableJson(deferred) !== stableJson(envelope))
895
- throw new Error('Remote Callback Inbox reconciliation callback drift');
896
- const reconciliationReceipt = event.payload.reconciliationReceipt;
897
- const reconciliationBatch = event.payload.reconciliationBatch;
898
- let normalizedReconciliationReceipt;
899
- if (reconciliationReceipt) {
900
- if (!reconciliationBatch) {
901
- throw new Error('Remote Callback Inbox reconciliation receipt is missing its exact callback batch');
902
- }
903
- const normalizedBatch = reconciliationBatch.map(item => normalizeEnvelope(link, item));
904
- normalizedReconciliationReceipt = normalizeReconciliationReceipt(link, reconciliationReceipt, normalizedBatch);
905
- if (!activeReconciliation) {
906
- if (completedReconciliationReceipts.has(normalizedReconciliationReceipt.receiptId)) {
907
- throw new Error('Remote Callback Inbox reconciliation receipt group is not contiguous');
908
- }
909
- activeReconciliation = createReconciliationReplayGroup(link, normalizedReconciliationReceipt, normalizedBatch, cursor, deferredBySequence, accepted);
910
- }
911
- else if (stableJson(activeReconciliation.receipt)
912
- !== stableJson(normalizedReconciliationReceipt)
913
- || stableJson(activeReconciliation.batch) !== stableJson(normalizedBatch)) {
914
- throw new Error('Remote Callback Inbox reconciliation accepted group proof drift');
915
- }
916
- const expectedEnvelope = activeReconciliation.expected[activeReconciliation.offset];
917
- if (!expectedEnvelope || stableJson(expectedEnvelope) !== stableJson(envelope)) {
918
- throw new Error('Remote Callback Inbox reconciliation accepted group does not match its proof');
919
- }
920
- }
921
- else {
922
- if (reconciliationBatch) {
923
- throw new Error('Remote Callback Inbox reconciliation batch lacks its trusted receipt');
924
- }
925
- if (activeReconciliation) {
926
- throw new Error('Remote Callback Inbox reconciliation accepted group is incomplete');
927
- }
928
- }
929
- if (deferred && !reconciliationReceipt) {
930
- throw new Error('Remote Callback Inbox deferred callback requires a poll reconciliation receipt');
931
- }
932
- const expectedOccurredAt = normalizedReconciliationReceipt?.reconciledAt
933
- ?? envelope.gatewayReceipt.receivedAt;
934
- if (event.occurredAt !== expectedOccurredAt) {
935
- throw new Error('Remote Callback Inbox accepted event time is not trusted');
936
- }
937
- deferredBySequence.delete(envelope.callbackSequence);
938
- cursor += 1;
939
- accepted.push(deepFreeze({
940
- endpointId: envelope.gatewayReceipt.endpointId,
941
- eventId: envelope.eventId,
942
- payloadHash: event.payload.payloadHash,
943
- callbackDigest: envelope.gatewayReceipt.callbackDigest,
944
- callbackSequence: envelope.callbackSequence,
945
- receivedAt: envelope.gatewayReceipt.receivedAt,
946
- gatewayReceipt: envelope.gatewayReceipt,
947
- ...(normalizedReconciliationReceipt
948
- ? { reconciliationReceipt: normalizedReconciliationReceipt }
949
- : {}),
950
- observation: event.payload.observation,
951
- ...(event.payload.completionReceipt
952
- ? { completionReceipt: event.payload.completionReceipt }
953
- : {}),
954
- }));
955
- if (event.payload.observation.type === 'execution_completed') {
956
- if (!event.payload.completionReceipt) {
957
- throw new Error('Remote Callback Inbox terminal observation is missing its completion receipt');
958
- }
959
- terminalReceipt = event.payload.completionReceipt;
960
- }
961
- if (activeReconciliation) {
962
- activeReconciliation.offset += 1;
963
- if (activeReconciliation.offset === activeReconciliation.expected.length) {
964
- completedReconciliationReceipts.add(activeReconciliation.receipt.receiptId);
965
- activeReconciliation = undefined;
966
- }
967
- }
968
- }
969
- if (activeReconciliation) {
970
- throw new Error('Remote Callback Inbox reconciliation accepted group is incomplete');
971
- }
972
- return deepFreeze({
973
- version: 1,
974
- link,
975
- sequence: events.at(-1).sequence,
976
- status: terminalReceipt ? 'terminal_observed' : deferredBySequence.size > 0 ? 'reconcile_required' : 'open',
977
- callbackCursor: cursor,
978
- accepted: Object.freeze(accepted),
979
- deferred: Object.freeze([...deferredBySequence.values()].sort((a, b) => a.callbackSequence - b.callbackSequence)),
980
- ...(terminalReceipt ? { terminalReceipt } : {}),
981
- });
982
- }
983
- function findDuplicate(current, envelope) {
984
- if (!current)
985
- return undefined;
986
- const accepted = current.accepted.find(item => item.endpointId === envelope.gatewayReceipt.endpointId && item.eventId === envelope.eventId);
987
- const deferred = current.deferred.find(item => item.gatewayReceipt.endpointId === envelope.gatewayReceipt.endpointId && item.eventId === envelope.eventId);
988
- const existingPayloadHash = accepted?.payloadHash ?? (deferred ? digest(deferred.payload) : undefined);
989
- const existingCallbackDigest = accepted?.callbackDigest
990
- ?? deferred?.gatewayReceipt.callbackDigest;
991
- if (existingPayloadHash && existingPayloadHash !== digest(envelope.payload)) {
992
- throw new Error('Remote Callback Inbox endpoint/event identity payload drift');
993
- }
994
- if (existingCallbackDigest && existingCallbackDigest !== envelope.gatewayReceipt.callbackDigest) {
995
- throw new Error('Remote Callback Inbox endpoint/event identity callback body drift');
996
- }
997
- if (!accepted && !deferred)
998
- return undefined;
999
- return deepFreeze(accepted ? { observation: accepted.observation } : {});
1000
- }
1001
- function assertAvailableSequence(current, envelope, pending = new Map(current?.deferred.map(item => [item.callbackSequence, item]) ?? [])) {
1002
- if (envelope.callbackSequence <= (current?.callbackCursor ?? 0)) {
1003
- throw new Error('Remote Callback Inbox callback sequence is stale');
1004
- }
1005
- const occupied = pending.get(envelope.callbackSequence);
1006
- if (occupied && stableJson(occupied) !== stableJson(envelope)) {
1007
- throw new Error('Remote Callback Inbox callback sequence identity drift');
1008
- }
1009
- }
1010
- function assertContiguous(events) {
1011
- events.forEach((event, index) => {
1012
- if (event.sequence !== index)
1013
- throw new Error('Remote Callback Inbox durable sequence is not contiguous');
1014
- });
1015
- }
1016
- function assertExactKeys(value, allowed, label) {
1017
- const unexpected = Object.keys(value).find(key => !allowed.includes(key));
1018
- if (unexpected)
1019
- throw new Error(`Remote Callback Inbox ${label} contains forbidden field ${unexpected}`);
1020
- }
1021
- function identifier(value, name) {
1022
- if (typeof value !== 'string' || !value.trim())
1023
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1024
- return value;
1025
- }
1026
- function timestamp(value, name) {
1027
- if (!Number.isFinite(value) || Number(value) < 0)
1028
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1029
- return Number(value);
1030
- }
1031
- function sequence(value, name) {
1032
- if (!Number.isSafeInteger(value) || Number(value) < -1)
1033
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1034
- return Number(value);
1035
- }
1036
- function positiveInteger(value, name) {
1037
- if (!Number.isSafeInteger(value) || Number(value) < 1)
1038
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1039
- return Number(value);
1040
- }
1041
- function optionalPositiveInteger(value, name) {
1042
- if (value === undefined)
1043
- return undefined;
1044
- return positiveInteger(value, name);
1045
- }
1046
- function optionalNonNegativeInteger(value, name) {
1047
- if (value === undefined)
1048
- return undefined;
1049
- if (!Number.isSafeInteger(value) || Number(value) < 0) {
1050
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1051
- }
1052
- return Number(value);
1053
- }
1054
- function nonNegativeInteger(value, name) {
1055
- const normalized = optionalNonNegativeInteger(value, name);
1056
- if (normalized === undefined)
1057
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1058
- return normalized;
1059
- }
1060
- function requireDigest(value, name) {
1061
- if (typeof value !== 'string' || !/^sha256:[a-f0-9]{64}$/u.test(value)) {
1062
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1063
- }
1064
- }
1065
- function requireGitSha(value, name) {
1066
- if (typeof value !== 'string' || !/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u.test(value)) {
1067
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1068
- }
1069
- }
1070
- function requireGitRef(value, name) {
1071
- if (typeof value !== 'string' || !/^refs\/heads\/[a-zA-Z0-9._/-]+$/u.test(value)
1072
- || value.includes('..') || value.endsWith('/') || value.endsWith('.lock')) {
1073
- throw new Error(`Invalid Remote Callback Inbox ${name}`);
1074
- }
1075
- }
1076
- function isCanonicalRelativePath(value) {
1077
- if (typeof value !== 'string' || !value.trim() || value.startsWith('/')
1078
- || value.includes('\\') || value.includes('\0'))
1079
- return false;
1080
- return value.split('/').every(segment => segment !== '' && segment !== '.' && segment !== '..');
1081
- }
1082
- function hash(value) {
1083
- return createHash('sha256').update(value).digest('hex');
1084
- }
1085
- function isMissingFile(error) {
1086
- return error instanceof Error && 'code' in error && error.code === 'ENOENT';
1087
- }
1088
- //# sourceMappingURL=remote-callback-inbox.js.map