mayura 1.2.0 → 1.2.2

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 (409) hide show
  1. package/README.md +2 -0
  2. package/docs/README.md +17 -4
  3. package/docs/cli/init.md +15 -3
  4. package/docs/concepts/workflows.md +60 -1
  5. package/docs/guides/choosing-a-starter.md +80 -0
  6. package/docs/guides/durable-workflows.md +1 -1
  7. package/docs/guides/framework-starters.md +5 -1
  8. package/docs/guides/hono.md +94 -0
  9. package/docs/guides/nextjs.md +94 -0
  10. package/docs/guides/nuxt.md +94 -0
  11. package/docs/guides/rag-deployment.md +48 -0
  12. package/docs/guides/rag-modal-pinecone-starter.md +63 -0
  13. package/docs/guides/rag-production.md +48 -0
  14. package/docs/guides/rag-quickstart.md +119 -0
  15. package/docs/guides/rag.md +23 -3
  16. package/docs/guides/react-router.md +94 -0
  17. package/docs/guides/release-readiness.md +78 -55
  18. package/docs/guides/sveltekit.md +94 -0
  19. package/docs/guides/tanstack-start.md +94 -0
  20. package/docs/guides/workflow-composition.md +1 -1
  21. package/docs/integrations/reranker-cohere.md +1 -0
  22. package/docs/integrations/reranker-jina.md +1 -0
  23. package/docs/integrations/reranker-voyage.md +1 -0
  24. package/docs/integrations/vector-chroma.md +1 -0
  25. package/docs/integrations/vector-libsql.md +1 -0
  26. package/docs/integrations/vector-pgvector.md +1 -0
  27. package/docs/integrations/vector-pinecone.md +4 -1
  28. package/docs/integrations/vector-qdrant.md +1 -0
  29. package/docs/integrations/vector-weaviate.md +1 -0
  30. package/docs/introduction.md +5 -0
  31. package/docs/project/whats-new.md +70 -2
  32. package/docs/quickstart.md +5 -3
  33. package/lib/adapter-code-docker/image/Dockerfile +1 -1
  34. package/lib/adapter-code-docker/package.json +1 -1
  35. package/lib/adapter-code-quickjs/package.json +1 -1
  36. package/lib/adapter-mcp/package.json +1 -1
  37. package/lib/ag-ui/package.json +1 -1
  38. package/lib/artifacts/package.json +1 -1
  39. package/lib/auth/package.json +1 -1
  40. package/lib/authz/package.json +1 -1
  41. package/lib/browser/package.json +1 -1
  42. package/lib/cli/dist/index.d.ts +1 -1
  43. package/lib/cli/dist/index.d.ts.map +1 -1
  44. package/lib/cli/dist/index.js +63 -20
  45. package/lib/cli/dist/index.js.map +1 -1
  46. package/lib/cli/dist/interactive.js +2 -2
  47. package/lib/cli/dist/interactive.js.map +1 -1
  48. package/lib/cli/dist/operations.d.ts +1 -0
  49. package/lib/cli/dist/operations.d.ts.map +1 -1
  50. package/lib/cli/dist/operations.js +13 -5
  51. package/lib/cli/dist/operations.js.map +1 -1
  52. package/lib/cli/package.json +1 -1
  53. package/lib/cli/src/index.ts +51 -12
  54. package/lib/cli/src/interactive.ts +2 -2
  55. package/lib/cli/src/operations.ts +9 -5
  56. package/lib/cli/starter-assets/manifest.json +1 -0
  57. package/lib/cli/starters/hono/package.json +2 -2
  58. package/lib/cli/starters/rag-modal-pinecone/README.md +60 -0
  59. package/lib/cli/starters/rag-modal-pinecone/dot-env.example +23 -0
  60. package/lib/cli/starters/{event-automation → rag-modal-pinecone}/dot-gitignore +2 -4
  61. package/lib/cli/starters/rag-modal-pinecone/fixtures/on-call.md +4 -0
  62. package/lib/cli/starters/rag-modal-pinecone/mayura.project.json +13 -0
  63. package/lib/cli/starters/rag-modal-pinecone/modal-app.py +110 -0
  64. package/lib/cli/starters/rag-modal-pinecone/package.json +28 -0
  65. package/lib/cli/starters/rag-modal-pinecone/src/application.ts +148 -0
  66. package/lib/cli/starters/rag-modal-pinecone/src/cli.ts +78 -0
  67. package/lib/cli/starters/rag-modal-pinecone/src/hosted.ts +137 -0
  68. package/lib/cli/starters/rag-modal-pinecone/test/modal_worker_test.py +53 -0
  69. package/lib/cli/starters/rag-modal-pinecone/test/pipeline.test.ts +137 -0
  70. package/lib/cli/starters/{cli-agent → rag-modal-pinecone}/tsconfig.json +0 -1
  71. package/lib/client/dist/index.d.ts.map +1 -1
  72. package/lib/client/dist/index.js +12 -4
  73. package/lib/client/dist/index.js.map +1 -1
  74. package/lib/client/dist/workflow-limits.d.ts +6 -0
  75. package/lib/client/dist/workflow-limits.d.ts.map +1 -0
  76. package/lib/client/dist/workflow-limits.js +15 -0
  77. package/lib/client/dist/workflow-limits.js.map +1 -0
  78. package/lib/client/dist/workflows.d.ts +3 -0
  79. package/lib/client/dist/workflows.d.ts.map +1 -1
  80. package/lib/client/dist/workflows.js +15 -7
  81. package/lib/client/dist/workflows.js.map +1 -1
  82. package/lib/client/package.json +1 -1
  83. package/lib/client/src/index.ts +7 -4
  84. package/lib/client/src/workflow-limits.ts +12 -0
  85. package/lib/client/src/workflows.ts +12 -6
  86. package/lib/client-react/package.json +1 -1
  87. package/lib/code-mode/package.json +1 -1
  88. package/lib/code-mode-workflows/package.json +1 -1
  89. package/lib/context/package.json +1 -1
  90. package/lib/core/dist/host.d.ts +1 -0
  91. package/lib/core/dist/host.d.ts.map +1 -1
  92. package/lib/core/dist/host.js +1 -0
  93. package/lib/core/dist/host.js.map +1 -1
  94. package/lib/core/dist/index.d.ts +1 -0
  95. package/lib/core/dist/index.d.ts.map +1 -1
  96. package/lib/core/dist/index.js +1 -0
  97. package/lib/core/dist/index.js.map +1 -1
  98. package/lib/core/dist/workflow-environment.d.ts +9 -0
  99. package/lib/core/dist/workflow-environment.d.ts.map +1 -0
  100. package/lib/core/dist/workflow-environment.js +15 -0
  101. package/lib/core/dist/workflow-environment.js.map +1 -0
  102. package/lib/core/dist/workflow-limits.d.ts +7 -0
  103. package/lib/core/dist/workflow-limits.d.ts.map +1 -0
  104. package/lib/core/dist/workflow-limits.js +17 -0
  105. package/lib/core/dist/workflow-limits.js.map +1 -0
  106. package/lib/core/package.json +1 -1
  107. package/lib/core/src/host.ts +1 -0
  108. package/lib/core/src/index.ts +1 -0
  109. package/lib/core/src/workflow-environment.ts +15 -0
  110. package/lib/core/src/workflow-limits.ts +16 -0
  111. package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
  112. package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
  113. package/lib/exporter-otlp/dist/signals.js +2 -2
  114. package/lib/exporter-otlp/dist/signals.js.map +1 -1
  115. package/lib/exporter-otlp/package.json +1 -1
  116. package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
  117. package/lib/exporter-otlp/src/signals.ts +2 -2
  118. package/lib/files/package.json +1 -1
  119. package/lib/guardrails/package.json +1 -1
  120. package/lib/helpers/package.json +1 -1
  121. package/lib/keys/package.json +1 -1
  122. package/lib/memory/package.json +1 -1
  123. package/lib/memory-remote/package.json +1 -1
  124. package/lib/observability/package.json +1 -1
  125. package/lib/provider-anthropic/package.json +1 -1
  126. package/lib/provider-openai/package.json +1 -1
  127. package/lib/rag/dist/bm25.d.ts +13 -0
  128. package/lib/rag/dist/bm25.d.ts.map +1 -0
  129. package/lib/rag/dist/bm25.js +76 -0
  130. package/lib/rag/dist/bm25.js.map +1 -0
  131. package/lib/rag/dist/document-lexical.d.ts +7 -0
  132. package/lib/rag/dist/document-lexical.d.ts.map +1 -0
  133. package/lib/rag/dist/document-lexical.js +33 -0
  134. package/lib/rag/dist/document-lexical.js.map +1 -0
  135. package/lib/rag/dist/evidence-window.d.ts +15 -0
  136. package/lib/rag/dist/evidence-window.d.ts.map +1 -0
  137. package/lib/rag/dist/evidence-window.js +52 -0
  138. package/lib/rag/dist/evidence-window.js.map +1 -0
  139. package/lib/rag/dist/retrieval.d.ts +6 -0
  140. package/lib/rag/dist/retrieval.d.ts.map +1 -1
  141. package/lib/rag/dist/retrieval.js +60 -6
  142. package/lib/rag/dist/retrieval.js.map +1 -1
  143. package/lib/rag/dist/vectors.d.ts +8 -0
  144. package/lib/rag/dist/vectors.d.ts.map +1 -1
  145. package/lib/rag/dist/vectors.js +121 -4
  146. package/lib/rag/dist/vectors.js.map +1 -1
  147. package/lib/rag/package.json +1 -1
  148. package/lib/rag/src/bm25.ts +35 -0
  149. package/lib/rag/src/document-lexical.ts +17 -0
  150. package/lib/rag/src/evidence-window.ts +41 -0
  151. package/lib/rag/src/retrieval.ts +56 -7
  152. package/lib/rag/src/vectors.ts +62 -4
  153. package/lib/runtime/package.json +1 -1
  154. package/lib/sandbox/package.json +1 -1
  155. package/lib/sdk/package.json +1 -1
  156. package/lib/server/dist/index.d.ts +2 -0
  157. package/lib/server/dist/index.d.ts.map +1 -1
  158. package/lib/server/dist/index.js +12 -4
  159. package/lib/server/dist/index.js.map +1 -1
  160. package/lib/server/dist/inspector-bundle.d.ts +1 -1
  161. package/lib/server/dist/inspector-bundle.d.ts.map +1 -1
  162. package/lib/server/dist/inspector-bundle.js +4 -4
  163. package/lib/server/dist/inspector-bundle.js.map +1 -1
  164. package/lib/server/package.json +1 -1
  165. package/lib/server/src/index.ts +9 -4
  166. package/lib/server/src/inspector-bundle.ts +4 -4
  167. package/lib/server-node/package.json +1 -1
  168. package/lib/skills/package.json +1 -1
  169. package/lib/storage/package.json +1 -1
  170. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +2 -0
  171. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -1
  172. package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -1
  173. package/lib/storage-contracts/dist/workflow-format2.d.ts +2 -0
  174. package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -1
  175. package/lib/storage-contracts/dist/workflow-format2.js +8 -7
  176. package/lib/storage-contracts/dist/workflow-format2.js.map +1 -1
  177. package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -1
  178. package/lib/storage-contracts/dist/workflow-format3.js +9 -7
  179. package/lib/storage-contracts/dist/workflow-format3.js.map +1 -1
  180. package/lib/storage-contracts/dist/workflow-format4.d.ts +2 -0
  181. package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -1
  182. package/lib/storage-contracts/dist/workflow-format4.js +9 -8
  183. package/lib/storage-contracts/dist/workflow-format4.js.map +1 -1
  184. package/lib/storage-contracts/dist/workflow-format5.d.ts +4 -0
  185. package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -1
  186. package/lib/storage-contracts/dist/workflow-format5.js +9 -8
  187. package/lib/storage-contracts/dist/workflow-format5.js.map +1 -1
  188. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +2 -0
  189. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -1
  190. package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -1
  191. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +2 -0
  192. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -1
  193. package/lib/storage-contracts/dist/workflow-tree-contracts.js +5 -3
  194. package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -1
  195. package/lib/storage-contracts/package.json +1 -1
  196. package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +2 -0
  197. package/lib/storage-contracts/src/workflow-format2.ts +10 -7
  198. package/lib/storage-contracts/src/workflow-format3.ts +9 -7
  199. package/lib/storage-contracts/src/workflow-format4.ts +11 -8
  200. package/lib/storage-contracts/src/workflow-format5.ts +13 -8
  201. package/lib/storage-contracts/src/workflow-graph-contracts.ts +2 -0
  202. package/lib/storage-contracts/src/workflow-tree-contracts.ts +7 -3
  203. package/lib/storage-postgres/package.json +1 -1
  204. package/lib/storage-sql/dist/scheduled-database.js +1 -1
  205. package/lib/storage-sql/dist/scheduled-database.js.map +1 -1
  206. package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -1
  207. package/lib/storage-sql/dist/workflow-tree-database.js +37 -1
  208. package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -1
  209. package/lib/storage-sql/package.json +1 -1
  210. package/lib/storage-sql/src/scheduled-database.ts +1 -1
  211. package/lib/storage-sql/src/workflow-tree-database.ts +15 -1
  212. package/lib/storage-sqlite/package.json +1 -1
  213. package/lib/terminal/package.json +1 -1
  214. package/lib/testing/package.json +1 -1
  215. package/lib/threads/package.json +1 -1
  216. package/lib/tools/package.json +1 -1
  217. package/lib/voice/package.json +1 -1
  218. package/lib/workflows/dist/children-definition.d.ts +5 -1
  219. package/lib/workflows/dist/children-definition.d.ts.map +1 -1
  220. package/lib/workflows/dist/children-definition.js +6 -2
  221. package/lib/workflows/dist/children-definition.js.map +1 -1
  222. package/lib/workflows/dist/children-runtime.d.ts.map +1 -1
  223. package/lib/workflows/dist/children-runtime.js +4 -3
  224. package/lib/workflows/dist/children-runtime.js.map +1 -1
  225. package/lib/workflows/dist/definition.d.ts +4 -0
  226. package/lib/workflows/dist/definition.d.ts.map +1 -1
  227. package/lib/workflows/dist/definition.js +6 -3
  228. package/lib/workflows/dist/definition.js.map +1 -1
  229. package/lib/workflows/dist/graph-definition.d.ts +5 -1
  230. package/lib/workflows/dist/graph-definition.d.ts.map +1 -1
  231. package/lib/workflows/dist/graph-definition.js +8 -4
  232. package/lib/workflows/dist/graph-definition.js.map +1 -1
  233. package/lib/workflows/dist/lifecycle-definition.d.ts +5 -1
  234. package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -1
  235. package/lib/workflows/dist/lifecycle-definition.js +5 -2
  236. package/lib/workflows/dist/lifecycle-definition.js.map +1 -1
  237. package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -1
  238. package/lib/workflows/dist/lifecycle-runtime.js +4 -5
  239. package/lib/workflows/dist/lifecycle-runtime.js.map +1 -1
  240. package/lib/workflows/dist/node-batches.d.ts +9 -0
  241. package/lib/workflows/dist/node-batches.d.ts.map +1 -0
  242. package/lib/workflows/dist/node-batches.js +19 -0
  243. package/lib/workflows/dist/node-batches.js.map +1 -0
  244. package/lib/workflows/dist/operator-transports.d.ts +1 -0
  245. package/lib/workflows/dist/operator-transports.d.ts.map +1 -1
  246. package/lib/workflows/dist/operator-transports.js +1 -0
  247. package/lib/workflows/dist/operator-transports.js.map +1 -1
  248. package/lib/workflows/dist/runtime.d.ts.map +1 -1
  249. package/lib/workflows/dist/runtime.js +6 -7
  250. package/lib/workflows/dist/runtime.js.map +1 -1
  251. package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -1
  252. package/lib/workflows/dist/scheduled-helpers.js +3 -2
  253. package/lib/workflows/dist/scheduled-helpers.js.map +1 -1
  254. package/lib/workflows/dist/scheduled.d.ts.map +1 -1
  255. package/lib/workflows/dist/scheduled.js +2 -1
  256. package/lib/workflows/dist/scheduled.js.map +1 -1
  257. package/lib/workflows/package.json +1 -1
  258. package/lib/workflows/src/children-definition.ts +10 -3
  259. package/lib/workflows/src/children-runtime.ts +3 -2
  260. package/lib/workflows/src/definition.ts +9 -2
  261. package/lib/workflows/src/graph-definition.ts +10 -3
  262. package/lib/workflows/src/lifecycle-definition.ts +10 -3
  263. package/lib/workflows/src/lifecycle-runtime.ts +4 -4
  264. package/lib/workflows/src/node-batches.ts +21 -0
  265. package/lib/workflows/src/operator-transports.ts +3 -1
  266. package/lib/workflows/src/runtime.ts +6 -6
  267. package/lib/workflows/src/scheduled-helpers.ts +3 -2
  268. package/lib/workflows/src/scheduled.ts +2 -1
  269. package/lib/workstream/package.json +1 -1
  270. package/llms-full.txt +1442 -281
  271. package/llms.txt +17 -3
  272. package/package.json +4 -4
  273. package/lib/cli/starters/cli-agent/dot-github/workflows/ci.yml +0 -13
  274. package/lib/cli/starters/cli-agent/dot-gitignore +0 -10
  275. package/lib/cli/starters/event-automation/dot-dockerignore +0 -7
  276. package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +0 -13
  277. package/lib/cli/starters/event-automation/src/model.ts +0 -40
  278. package/lib/cli/starters/event-automation/tsconfig.json +0 -20
  279. package/lib/cli/starters/nextjs/Dockerfile +0 -12
  280. package/lib/cli/starters/nextjs/compose.yaml +0 -19
  281. package/lib/cli/starters/nextjs/dot-dockerignore +0 -11
  282. package/lib/cli/starters/nextjs/dot-env.example +0 -7
  283. package/lib/cli/starters/nextjs/scripts/setup.mjs +0 -9
  284. package/lib/cli/starters/nextjs/server/application.mjs +0 -74
  285. package/lib/cli/starters/nextjs/server/auth.mjs +0 -24
  286. package/lib/cli/starters/nextjs/server/worker.mjs +0 -11
  287. package/lib/cli/starters/nextjs/server/workflows.mjs +0 -23
  288. package/lib/cli/starters/nextjs/src/ChatApp.jsx +0 -57
  289. package/lib/cli/starters/nextjs/src/Notebook.jsx +0 -25
  290. package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +0 -142
  291. package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +0 -142
  292. package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +0 -9
  293. package/lib/cli/starters/nextjs/src/components/mayura/ui.css +0 -14
  294. package/lib/cli/starters/nextjs/src/connect.js +0 -21
  295. package/lib/cli/starters/nextjs/src/session.js +0 -138
  296. package/lib/cli/starters/nextjs/src/style.css +0 -11
  297. package/lib/cli/starters/nextjs/test/server.test.mjs +0 -95
  298. package/lib/cli/starters/nextjs/test/session.test.mjs +0 -16
  299. package/lib/cli/starters/nuxt/compose.yaml +0 -19
  300. package/lib/cli/starters/nuxt/dot-dockerignore +0 -11
  301. package/lib/cli/starters/nuxt/dot-env.example +0 -7
  302. package/lib/cli/starters/nuxt/dot-gitignore +0 -14
  303. package/lib/cli/starters/nuxt/scripts/setup.mjs +0 -9
  304. package/lib/cli/starters/nuxt/server/application.mjs +0 -74
  305. package/lib/cli/starters/nuxt/server/auth.mjs +0 -24
  306. package/lib/cli/starters/nuxt/server/worker.mjs +0 -11
  307. package/lib/cli/starters/nuxt/server/workflows.mjs +0 -23
  308. package/lib/cli/starters/nuxt/src/connect.js +0 -21
  309. package/lib/cli/starters/nuxt/src/session.js +0 -138
  310. package/lib/cli/starters/nuxt/src/style.css +0 -11
  311. package/lib/cli/starters/nuxt/test/server.test.mjs +0 -95
  312. package/lib/cli/starters/nuxt/test/session.test.mjs +0 -16
  313. package/lib/cli/starters/react-router/Dockerfile +0 -12
  314. package/lib/cli/starters/react-router/compose.yaml +0 -19
  315. package/lib/cli/starters/react-router/dot-dockerignore +0 -11
  316. package/lib/cli/starters/react-router/dot-env.example +0 -7
  317. package/lib/cli/starters/react-router/dot-gitignore +0 -14
  318. package/lib/cli/starters/react-router/scripts/setup.mjs +0 -9
  319. package/lib/cli/starters/react-router/server/application.mjs +0 -74
  320. package/lib/cli/starters/react-router/server/auth.mjs +0 -24
  321. package/lib/cli/starters/react-router/server/worker.mjs +0 -11
  322. package/lib/cli/starters/react-router/server/workflows.mjs +0 -23
  323. package/lib/cli/starters/react-router/src/ChatApp.jsx +0 -57
  324. package/lib/cli/starters/react-router/src/Notebook.jsx +0 -25
  325. package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +0 -142
  326. package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +0 -142
  327. package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +0 -9
  328. package/lib/cli/starters/react-router/src/components/mayura/ui.css +0 -14
  329. package/lib/cli/starters/react-router/src/connect.js +0 -21
  330. package/lib/cli/starters/react-router/src/session.js +0 -138
  331. package/lib/cli/starters/react-router/src/style.css +0 -11
  332. package/lib/cli/starters/react-router/src/vite-env.d.ts +0 -1
  333. package/lib/cli/starters/react-router/test/server.test.mjs +0 -95
  334. package/lib/cli/starters/react-router/test/session.test.mjs +0 -16
  335. package/lib/cli/starters/research-team/dot-dockerignore +0 -7
  336. package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +0 -13
  337. package/lib/cli/starters/research-team/dot-gitignore +0 -10
  338. package/lib/cli/starters/research-team/src/model.ts +0 -40
  339. package/lib/cli/starters/research-team/tsconfig.json +0 -20
  340. package/lib/cli/starters/support-agent/dot-dockerignore +0 -7
  341. package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +0 -13
  342. package/lib/cli/starters/support-agent/dot-gitignore +0 -10
  343. package/lib/cli/starters/support-agent/src/model.ts +0 -40
  344. package/lib/cli/starters/support-agent/tsconfig.json +0 -20
  345. package/lib/cli/starters/sveltekit/Dockerfile +0 -12
  346. package/lib/cli/starters/sveltekit/compose.yaml +0 -19
  347. package/lib/cli/starters/sveltekit/dot-dockerignore +0 -11
  348. package/lib/cli/starters/sveltekit/dot-env.example +0 -7
  349. package/lib/cli/starters/sveltekit/dot-gitignore +0 -14
  350. package/lib/cli/starters/sveltekit/scripts/setup.mjs +0 -9
  351. package/lib/cli/starters/sveltekit/server/application.mjs +0 -74
  352. package/lib/cli/starters/sveltekit/server/auth.mjs +0 -24
  353. package/lib/cli/starters/sveltekit/server/worker.mjs +0 -11
  354. package/lib/cli/starters/sveltekit/server/workflows.mjs +0 -23
  355. package/lib/cli/starters/sveltekit/src/connect.js +0 -21
  356. package/lib/cli/starters/sveltekit/src/session.js +0 -138
  357. package/lib/cli/starters/sveltekit/src/style.css +0 -11
  358. package/lib/cli/starters/sveltekit/src/view.js +0 -49
  359. package/lib/cli/starters/sveltekit/test/server.test.mjs +0 -95
  360. package/lib/cli/starters/sveltekit/test/session.test.mjs +0 -16
  361. package/lib/cli/starters/tanstack-start/Dockerfile +0 -12
  362. package/lib/cli/starters/tanstack-start/compose.yaml +0 -19
  363. package/lib/cli/starters/tanstack-start/dot-dockerignore +0 -11
  364. package/lib/cli/starters/tanstack-start/dot-env.example +0 -7
  365. package/lib/cli/starters/tanstack-start/dot-gitignore +0 -14
  366. package/lib/cli/starters/tanstack-start/scripts/setup.mjs +0 -9
  367. package/lib/cli/starters/tanstack-start/server/application.mjs +0 -74
  368. package/lib/cli/starters/tanstack-start/server/auth.mjs +0 -24
  369. package/lib/cli/starters/tanstack-start/server/worker.mjs +0 -11
  370. package/lib/cli/starters/tanstack-start/server/workflows.mjs +0 -23
  371. package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +0 -57
  372. package/lib/cli/starters/tanstack-start/src/Notebook.jsx +0 -25
  373. package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +0 -142
  374. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +0 -142
  375. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +0 -9
  376. package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +0 -14
  377. package/lib/cli/starters/tanstack-start/src/connect.js +0 -21
  378. package/lib/cli/starters/tanstack-start/src/session.js +0 -138
  379. package/lib/cli/starters/tanstack-start/src/style.css +0 -11
  380. package/lib/cli/starters/tanstack-start/test/server.test.mjs +0 -95
  381. package/lib/cli/starters/tanstack-start/test/session.test.mjs +0 -16
  382. /package/lib/cli/{starters/hono/src/components/mayura/ui.css → starter-assets/011cacc77ada0de5b447674e9fc4374a247b9a46eb169722b12649753f24188f} +0 -0
  383. /package/lib/cli/{starters/hono/test/server.test.mjs → starter-assets/0c825d6a776673ec6274cfc29cd45b1a8c56dcb880c291a91075c77e1ef1e4f3} +0 -0
  384. /package/lib/cli/{starters/hono/server/auth.mjs → starter-assets/0dd570bfacc357d23be3340250090b9a4c6193a49cdd02e9b6789e7bee8433dd} +0 -0
  385. /package/lib/cli/{starters/hono/src/components/mayura/approval.tsx → starter-assets/11292bd14cdaf27a8f8317ba4ab768d706a726b2e26474b599f3db116674b4b3} +0 -0
  386. /package/lib/cli/{starters/nextjs/dot-gitignore → starter-assets/1873b02e070347f9a449e07084242982fa6af412c45aa764985d553975b64589} +0 -0
  387. /package/lib/cli/{starters/hono/src/style.css → starter-assets/2f3869e6d69134e43be713c4590bfe48896a5c54ece6ffc1a4f204cfcfe54218} +0 -0
  388. /package/lib/cli/{starters/hono/server/worker.mjs → starter-assets/350d77757f548369beff29d658cf1620752d4e23b4b732d99a1b403ca043137f} +0 -0
  389. /package/lib/cli/{starters/approval-workflow/src/model.ts → starter-assets/37294d24c04b71eaf6d6f0bd52fd4c1cc7a5d3cb63da9c7920ed1d44276da9cb} +0 -0
  390. /package/lib/cli/{starters/approval-workflow/tsconfig.json → starter-assets/4387d6537dd5924ae62326aa3d7d8cbad1e5abd930aecc9daa6fab1ac2f6ef24} +0 -0
  391. /package/lib/cli/{starters/hono/dot-dockerignore → starter-assets/4434be031b58cc6ee680b2860b2ad1fe4089af7ee866c13223dfb621dd042ff1} +0 -0
  392. /package/lib/cli/{starters/hono/src/ChatApp.jsx → starter-assets/46e199317648a076243d6c8e7ffedc48785a6ffc0f203b88c7c4a9479b34c5b9} +0 -0
  393. /package/lib/cli/{starters/hono/src/components/mayura/thread-history.tsx → starter-assets/4741fccbca2e0d2fc6f61d11af3cf7bcc5f0238b67bb46282287207abdc6c536} +0 -0
  394. /package/lib/cli/{starters/approval-workflow/dot-dockerignore → starter-assets/4be664708b0120da5d2b73c5a27968093da06b8728f88f2bda2a1ccbf40f6891} +0 -0
  395. /package/lib/cli/{starters/hono/server/workflows.mjs → starter-assets/4d11f729672df54969a851494877a3c5aee24bb8f8c68eacaaa22e715bf5ed69} +0 -0
  396. /package/lib/cli/{starters/hono/dot-env.example → starter-assets/4f141323062660c4dc5b563300d57bb4cdbdc7fe9bfba96e43d9c64bb274474e} +0 -0
  397. /package/lib/cli/{starters/hono/Dockerfile → starter-assets/5471b74c46258d1edb00eb8f60f4219c389a252f7e224f2692f8f3e71ae43e3e} +0 -0
  398. /package/lib/cli/{starters/hono/scripts/setup.mjs → starter-assets/56e2d6db9fe4b0449c979acd06947a5b776bcc645184b54b8d3654a48bd12c38} +0 -0
  399. /package/lib/cli/{starters/hono/src/Notebook.jsx → starter-assets/6138d1e2ca4469daf4f5545d140943f6e23b0c37f865051b266ec99695cf181a} +0 -0
  400. /package/lib/cli/{starters/hono/src/vite-env.d.ts → starter-assets/65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5} +0 -0
  401. /package/lib/cli/{starters/hono/server/application.mjs → starter-assets/757f43c27415654049ecf01b67d560c83d788108d1aebcf1f16a86d956bd7fb6} +0 -0
  402. /package/lib/cli/{starters/hono/src/components/mayura/thread-list.tsx → starter-assets/97601d0bf331df7bbde88f7ee269610bc8a1239f8eeb58fded6416e588a5b7dd} +0 -0
  403. /package/lib/cli/{starters/approval-workflow/dot-github/workflows/ci.yml → starter-assets/aa4182c76778ba2194ecbfde9a960c20181534fd1ab484df126278dbc6eb0186} +0 -0
  404. /package/lib/cli/{starters/hono/src/session.js → starter-assets/abcc6ebd29ba47a079befb6568054dec8f43d4c729187e4a3610af39789e77be} +0 -0
  405. /package/lib/cli/{starters/hono/compose.yaml → starter-assets/cc1df6f5ce0eebffc567ecea1d599eba97cd1b94ab01551085c0eb87a28e3a6c} +0 -0
  406. /package/lib/cli/{starters/hono/src/connect.js → starter-assets/cd3ddb959b277e7d495cc020a6f8146acfbcc9d05ececa3809e8aafcf84504d9} +0 -0
  407. /package/lib/cli/{starters/hono/test/session.test.mjs → starter-assets/dfe75fd07538427d80ba76767e037e929664c80ff5a41b7544496a789181bb73} +0 -0
  408. /package/lib/cli/{starters/approval-workflow/dot-gitignore → starter-assets/f3ef7285253ec9668732f535306beee602e91cb6e20f83d4799b3323399ce569} +0 -0
  409. /package/lib/cli/{starters/nuxt/src/view.js → starter-assets/ff840fe960683d377e78f731b5d4318adf6050384791fa20e4948d34192aa35d} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAmC,MAAM,oBAAoB,CAAC;AAErH,OAAO,EAAE,6BAA6B,EAAsC,MAAM,wBAAwB,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAAsK,MAAM,8BAA8B,CAAC;AAEhP,OAAO,EAAE,wBAAwB,EAAyI,MAAM,4BAA4B,CAAC;AAE7M,OAAO,EAAE,gBAAgB,EAAmE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAA0I,MAAM,cAAc,CAAC;AACrU,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqC,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,aAAa,EAA0D,MAAM,iBAAiB,CAAC;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BACC,IAAI,KAAgD,CAAC;gBACrD,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrP,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YACD,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { authorizationCursors, serverAuthorizationRoute, type ServerAuthorizationOptions } from './authorization.js';\nexport type { ServerAuthorizationOptions } from './authorization.js';\nimport { createThreadCompactionService, type ServerThreadCompactionOptions } from './thread-compaction.js';\nexport type { ServerThreadCompactionOptions, ServerThreadCompactionCommand } from './thread-compaction.js';\nimport { createApprovalReconciliation, type ApprovalReconciliationOptions, type ClaimedApprovalRequest, type ReconcileClaimedApprovalRequest, type ClaimedApprovalView, type ApprovalReconciliationResult } from './approval-reconciliation.js';\nexport type { ApprovalReconciliationOptions, ClaimedApprovalRequest, ReconcileClaimedApprovalRequest, ClaimedApprovalView, ApprovalReconciliationResult } from './approval-reconciliation.js';\nimport { createRecoveryController, type ConversationRecoveryOptions, type ConversationRecoveryOutcome, type ConversationRecoveryRequest, type ConversationRecoveryReport } from './conversation-recovery.js';\nexport type { ConversationRecoveryOptions, ConversationRecoveryOutcome, ConversationRecoveryRequest, ConversationRecoveryReport } from './conversation-recovery.js';\nimport { createAuthorizer, type AuthorizationResourceKind, type AuthorizationAuditSnapshot, freezeJson, jsonValue, MayuraError, MEDIA_TYPES, mediaFromBase64, mediaUrl, type JsonObject, type JsonValue, type Media, type MediaType, type Outcome, type Permissions, type RunEvent, type RunHandle, type Scope } from '@mayura/core';\nimport { admitMedia, sha256Hex } from '@mayura/core/host';\nimport type { RunCheckpointStore } from '@mayura/storage-contracts';\nimport { inspectorAsset } from './inspector.js';\nimport { createThreads, runInThread, type Threads, type ThreadsOptions } from '@mayura/threads';\nimport { assertAgent, createRuntime, type AgentDefinition, type Runtime, type RuntimeLimits } from '@mayura/runtime';\n\nexport interface ServerIdentity {\n readonly scope: Scope;\n readonly agentIds: readonly string[];\n readonly capabilities: readonly ('runs:read' | 'runs:submit' | 'runs:cancel' | 'runs:approve' | 'runs:resume' | 'threads:read' | 'threads:write' | 'threads:delete' | 'threads:compact' | 'threads:import' | 'operations:read' | 'humans:read' | 'humans:respond' | 'workflows:read' | 'workflows:control' | 'workflows:fleet' | 'workflows:migrate')[];\n readonly expiresAtMs: number;\n}\nexport interface HealthCheck {\n readonly id: string;\n /** Trusted application callback. Returning false or throwing marks the dependency unavailable. */\n readonly check: (context: { readonly signal: AbortSignal; readonly scope: Scope }) => boolean | Promise<boolean>;\n}\nexport interface HumanRequestRecord {\n readonly id: string; readonly agentId: string; readonly kind: 'information' | 'correction' | 'plan_selection';\n readonly schemaId: string; readonly schemaDigest: string; readonly prompt: string; readonly digest: string;\n readonly status: 'waiting' | 'answered' | 'cancelled' | 'timed_out'; readonly context?: JsonValue;\n readonly subjectDigest?: string; readonly deadlineAtMs?: number;\n}\nexport interface HumanRequestTransport {\n readonly list: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly after: string | null; readonly limit: number; readonly signal: AbortSignal }) => Promise<{ readonly items: readonly HumanRequestRecord[]; readonly next: string | null }>;\n readonly inspect: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly id: string; readonly signal: AbortSignal }) => Promise<HumanRequestRecord | null>;\n readonly respond: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly id: string;\n readonly requestDigest: string; readonly commandId: string; readonly value: JsonValue; readonly signal: AbortSignal }) => Promise<HumanRequestRecord>;\n}\nexport interface WorkflowViewRecord {\n readonly format: 2 | 3 | 4 | 5; readonly definitionId: string; readonly definitionVersion: string; readonly runId: string;\n readonly revision: number; readonly status: 'running' | 'waiting' | 'paused' | 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';\n readonly nodes: readonly { readonly id: string; readonly kind: 'tool' | 'join' | 'wait' | 'child' | 'human' | 'timer' | 'signal'; readonly dependsOn: readonly string[] }[];\n readonly steps: readonly { readonly id: string; readonly kind: 'tool' | 'join' | 'wait' | 'child' | 'human' | 'timer' | 'signal';\n readonly status: 'pending' | 'waiting' | 'approved' | 'dispatching' | 'succeeded' | 'failed' | 'blocked' | 'unknown' | 'skipped' | 'timed_out';\n readonly childRunId?: string; readonly approval?: WorkflowApprovalRecord }[];\n}\n/** A tool step waiting for approval: the digest an approval must name, its expiry and, when known, the exact tool call. */\nexport interface WorkflowApprovalRecord {\n readonly digest: string; readonly expiresAtMs: number;\n readonly subject?: { readonly toolId: string; readonly toolVersion: string; readonly input: JsonValue };\n}\nexport interface WorkflowViewTransport {\n readonly inspect: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly runId: string;\n readonly signal: AbortSignal }) => Promise<WorkflowViewRecord | null>;\n}\nexport interface WorkflowIndexRecord {\n readonly format: 2 | 3 | 4 | 5; readonly definitionId: string; readonly definitionVersion: string; readonly runId: string;\n readonly revision: number; readonly status: WorkflowViewRecord['status'];\n /** Only in the settled view: when the run reached its final status. */\n readonly settledAtMs?: number;\n}\nexport interface WorkflowIndexTransport {\n /**\n * Active runs, or with `view: 'settled'` recently finished runs and runs whose outcome is unknown. The field is\n * present only for the settled view; a transport that ignores it fails the settled request closed.\n */\n readonly list: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly after: string | null;\n readonly limit: number; readonly signal: AbortSignal; readonly view?: 'settled' }) => Promise<{ readonly items: readonly WorkflowIndexRecord[]; readonly next: string | null }>;\n}\nexport type WorkflowControlResult = { readonly status: 'applied'; readonly workflow: WorkflowViewRecord }\n | { readonly status: 'conflict' } | { readonly status: 'not_found' };\ninterface WorkflowControlBase {\n readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly runId: string;\n readonly revision: number; readonly commandId: string; readonly signal: AbortSignal;\n}\nexport interface WorkflowControlTransport {\n readonly cancel: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n readonly approve: (input: WorkflowControlBase & { readonly nodeId: string; readonly approvalDigest: string;\n readonly childRunId: string | null }) => Promise<WorkflowControlResult>;\n}\n/** Durable signal delivery remains an explicit adapter boundary so each workflow format owns persistence and idempotency. */\nexport interface WorkflowSignalTransport {\n readonly deliver: (input: WorkflowControlBase & { readonly signalId: string; readonly signalName: string;\n readonly value: JsonValue }) => Promise<WorkflowControlResult>;\n}\n/** Requests durable continuation without granting authority to force a waiting gate or replay an uncertain effect. */\nexport interface WorkflowResumeTransport {\n readonly resume: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n}\n/** Requests a quiescent durable operator pause; it never interrupts an in-flight effect or cancels a run. */\nexport interface WorkflowPauseTransport {\n readonly pause: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n}\nexport interface WorkflowFleetHoldRecord { readonly held: boolean; readonly generation: number; readonly changedAtMs: number | null }\nexport type WorkflowFleetSweepOutcomeRecord =\n | { readonly target: string; readonly runId: string;\n readonly outcome: 'paused' | 'already_paused' | 'terminal' | 'busy' | 'resumed' | 'not_paused' | 'missing' | 'unregistered' }\n | { readonly target: string; readonly runId: string; readonly outcome: 'failed'; readonly code: string };\nexport interface WorkflowFleetSweepRecord { readonly outcomes: readonly WorkflowFleetSweepOutcomeRecord[]; readonly nextCursor: JsonObject | null }\ninterface WorkflowFleetBase { readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly signal: AbortSignal }\n/** Durable fleet hold and ledger-backed sweep for one verified scope. Mutations require the separate `workflows:fleet` capability. */\nexport interface WorkflowFleetTransport {\n readonly inspect: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly hold: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly release: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly sweep: (input: WorkflowFleetBase & { readonly phase: 'pause' | 'resume'; readonly cursor: JsonObject | null; readonly limit: number })\n => Promise<{ readonly status: 'applied'; readonly sweep: WorkflowFleetSweepRecord } | { readonly status: 'conflict' }>;\n}\n/** A reviewed migration the host offers for runs pinned to its source definition. */\nexport interface WorkflowMigrationRecord {\n readonly id: string; readonly description: string;\n readonly fromVersion: string; readonly toVersion: string; readonly fromDigest: string; readonly toDigest: string;\n}\n/** What a migration would do to one run, decided from the run's real state. */\nexport interface WorkflowMigrationPlanRecord {\n readonly migrationId: string; readonly format: string; readonly runId: string; readonly fromDigest: string; readonly toDigest: string;\n readonly entries: readonly { readonly action: 'keep' | 'update' | 'reset' | 'accept' | 'add' | 'remove'; readonly target?: string; readonly source?: string; readonly status?: string }[];\n readonly blockers: readonly { readonly node: string; readonly reason: string }[];\n readonly allowed: boolean;\n}\ninterface WorkflowMigrationBase { readonly scope: Scope; readonly agentIds: readonly string[]; readonly runId: string; readonly signal: AbortSignal }\n/**\n * In-place migration of paused runs to a new definition version. Listing and planning are reads; applying requires the\n * separate `workflows:migrate` capability, the run's exact revision and a stable command id.\n */\nexport interface WorkflowMigrationTransport {\n /** Migrations whose source is the run's pinned definition; null when the run is not visible to this identity. */\n readonly list: (input: WorkflowMigrationBase) => Promise<readonly WorkflowMigrationRecord[] | null>;\n /** Dry run: the plan for this run. Writes nothing. Null when the run or migration is not visible. */\n readonly plan: (input: WorkflowMigrationBase & { readonly migrationId: string }) => Promise<WorkflowMigrationPlanRecord | null>;\n readonly apply: (input: WorkflowControlBase & { readonly migrationId: string }) => Promise<\n | { readonly status: 'applied'; readonly plan: WorkflowMigrationPlanRecord; readonly workflow: WorkflowViewRecord }\n | { readonly status: 'refused'; readonly plan: WorkflowMigrationPlanRecord }\n | { readonly status: 'conflict' } | { readonly status: 'not_found' }>;\n}\nexport interface SubmissionJournal {\n readonly claim: (input: { readonly owner: string; readonly key: string; readonly digest: string; readonly signal: AbortSignal })\n => Promise<{ readonly status: 'claimed' } | { readonly status: 'existing'; readonly digest: string }>;\n}\nexport type RunRecordStatus = 'running' | 'waiting' | 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';\n/** One durable agent run as every replica sees it. `snapshot` is the run's inspection; `outcome` is present once it ended. */\nexport interface RunRecordView {\n readonly runId: string; readonly agentId: string; readonly replicaId: string; readonly status: RunRecordStatus;\n readonly leaseExpiresAtMs: number; readonly cancelRequested: boolean; readonly lastSequence: number;\n readonly snapshot: JsonObject; readonly outcome?: JsonObject;\n}\nexport type RunRecordClaim = { readonly status: 'claimed' }\n | { readonly status: 'existing'; readonly digest: string; readonly runId: string | null; readonly claimedAtMs: number };\n/**\n * Durable agent run records shared by every server replica (`createAggregateRunRecords` in mayura/storage-contracts).\n * The replica that accepts a run executes it and is its only writer: it records metadata events, snapshots and the\n * outcome, and renews a lease. Any replica can read a run, stream its recorded events and request its cancellation,\n * which the owner observes. A run whose owner stops renewing its lease is settled as `outcome_unknown` by the next reader.\n */\nexport interface RunRecordStore {\n /** Atomically claim a submission key; an existing claim reports its digest and, once started, its run. */\n claim(input: { readonly owner: string; readonly key: string; readonly digest: string; readonly replicaId: string; readonly nowMs: number;\n readonly signal: AbortSignal }): Promise<RunRecordClaim>;\n /** Give up a claim whose run never started, so the same key can be submitted again. */\n release(input: { readonly owner: string; readonly key: string; readonly replicaId: string; readonly signal: AbortSignal }): Promise<void>;\n /** Create the run's record and bind the submission key to it. */\n start(input: { readonly owner: string; readonly key: string; readonly runId: string; readonly agentId: string; readonly replicaId: string;\n readonly leaseExpiresAtMs: number; readonly snapshot: JsonObject; readonly signal: AbortSignal }): Promise<void>;\n /** Owner only: append events in order, replace the snapshot, renew the lease and, last, record the outcome. */\n update(input: { readonly owner: string; readonly runId: string; readonly replicaId: string; readonly events: readonly RunEvent[];\n readonly snapshot: JsonObject; readonly leaseExpiresAtMs: number; readonly outcome?: JsonObject; readonly signal: AbortSignal })\n : Promise<{ readonly status: 'written'; readonly cancelRequested: boolean } | { readonly status: 'lost' }>;\n /** Atomically transfer a waiting record to a resuming replica; required with threads and durable run records. */\n resume?(input: { readonly owner: string; readonly runId: string; readonly replicaId: string; readonly leaseExpiresAtMs: number;\n readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n read(input: { readonly owner: string; readonly runId: string; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n /** Recorded events after a run sequence, in order; a missing range is one `events.gap`. */\n events(input: { readonly owner: string; readonly runId: string; readonly after: number; readonly limit: number; readonly signal: AbortSignal }): Promise<readonly RunEvent[]>;\n requestCancel(input: { readonly owner: string; readonly runId: string; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n /** Settle a running record whose lease expired before `nowMs` as `outcome_unknown`; returns the current record. */\n abandon(input: { readonly owner: string; readonly runId: string; readonly nowMs: number; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n}\nexport interface RegisteredAgent {\n readonly agent: AgentDefinition;\n readonly permissions: Permissions;\n readonly limits?: RuntimeLimits;\n}\nexport interface AgentServerOptions {\n readonly publicOrigin: string;\n /**\n * Browser origins other than `publicOrigin` allowed to call the API. A page served from `publicOrigin` itself is\n * always allowed.\n */\n readonly allowedOrigins?: readonly string[];\n /**\n * Set when a trusted reverse proxy or your own HTTP framework routes requests to this handler under another host or\n * scheme (for example `http://app:3000` inside a cluster). The request URL's scheme, host and port are then ignored\n * and `publicOrigin` is authoritative; only its path and query are used. Host and X-Forwarded-* headers are never\n * read. Without it, a request whose URL origin differs from `publicOrigin` is refused with INVALID_DESTINATION.\n */\n readonly mounted?: boolean;\n readonly agents: readonly RegisteredAgent[];\n /** Opt-in fine-grained HTTP enforcement in addition to token capabilities and scoped adapters. Server owns its lifecycle. */\n readonly authorization?: ServerAuthorizationOptions;\n /** Expose only a content-free process liveness response at GET /healthz. */\n readonly publicLiveness?: boolean;\n /** Serve the read-only local inspector at GET /inspector. Its static assets contain no data; every read is authenticated. */\n readonly inspector?: boolean;\n /** Access-controlled readiness checks. Credentials and exception details must remain inside callbacks. */\n readonly healthChecks?: readonly HealthCheck[];\n readonly humanRequests?: HumanRequestTransport;\n readonly workflowViews?: WorkflowViewTransport;\n readonly workflowIndex?: WorkflowIndexTransport;\n readonly workflowControls?: WorkflowControlTransport;\n readonly workflowSignals?: WorkflowSignalTransport;\n readonly workflowResumes?: WorkflowResumeTransport;\n readonly workflowPauses?: WorkflowPauseTransport;\n readonly workflowFleet?: WorkflowFleetTransport;\n readonly workflowMigrations?: WorkflowMigrationTransport;\n /**\n * Durable claim of every run submission key. Without it, idempotency lasts only as long as the process: a retry\n * after a restart could start a duplicate run. With it, such a retry is refused with SUBMISSION_OUTCOME_UNKNOWN.\n */\n readonly submissionJournal?: SubmissionJournal;\n /**\n * Resolve `{ artifact: reference }` media in a run submission: read the stored bytes for the caller's scope and\n * return them as media, for example `(reference, scope) => mediaFromArtifact(store, reference, scope)` with\n * `mediaFromArtifact` from mayura/artifacts. Without it, artifact media is refused with NOT_ENABLED.\n */\n readonly mediaArtifacts?: (reference: JsonObject, scope: Scope, signal: AbortSignal) => Promise<Media>;\n /**\n * Durable agent run records (`createAggregateRunRecords(store)` from mayura/storage-contracts). With them, several\n * replicas sharing one store can each read, stream, wait for and cancel any run, and a run whose replica dies ends as\n * `outcome_unknown` after its lease instead of disappearing. They also make submission idempotency durable.\n */\n readonly runRecords?: RunRecordStore;\n /** Scoped conversation routes, thread-bound submissions and durable approval checkpoints. Initialize storage first. */\n /** Explicit service policy and optional process scheduler for saved approvals and recording outboxes. */\n readonly conversationRecovery?: ConversationRecoveryOptions;\n /** Host-only operator controls for expired claimed approvals. */\n readonly approvalReconciliation?: ApprovalReconciliationOptions;\n /** Opt-in paid summarization with host-pinned agents, explicit grants and per-command ceilings. */\n readonly threadCompaction?: ServerThreadCompactionOptions;\n readonly threads?: { readonly store: ThreadsOptions['store'] & { readonly runCheckpoints: RunCheckpointStore } };\n /**\n * Where an agent run executes. `'background'` (the default): the run keeps going in this process after\n * `POST /v1/runs` answers 202. `'request'`: the run finishes, and its outcome is recorded, before that 202 is sent, so\n * nothing runs once the response is out; use it where the platform may stop or freeze the process after it responds,\n * such as serverless functions. It requires `runRecords`, so any instance can serve the run's result and events\n * afterwards. The submission waits up to the agent's `limits.maxDurationMs` (60 s unless set) plus\n * `requestTimeoutMs`: keep that under the platform's time limit, and give clients a `requestTimeoutMs` above it.\n */\n readonly runExecution?: 'background' | 'request';\n /** Verify the token using trusted application authentication; never trust token claims without verification. */\n readonly authenticate: (request: { readonly token: string; readonly signal: AbortSignal }) => Promise<ServerIdentity | null>;\n readonly limits?: {\n readonly maxRuns?: number; readonly maxRuntimes?: number; readonly maxRequests?: number;\n readonly maxStreams?: number; readonly maxBodyBytes?: number; readonly maxResponseBytes?: number;\n /**\n * The body limit of a run submission when a registered agent accepts media (images and PDFs are sent as base64,\n * about a third larger than their bytes). Default 16 MiB; other requests keep maxBodyBytes.\n */\n readonly maxMediaBodyBytes?: number;\n readonly maxHealthOperations?: number; readonly maxHumanOperations?: number; readonly maxWorkflowOperations?: number;\n readonly requestTimeoutMs?: number; readonly streamDurationMs?: number;\n /**\n * How long a finished run stays readable (result, events and same-key resubmission) before the server releases\n * it, and with it any runtime no retained run still uses. Default 10 minutes. At `maxRuns` or `maxRuntimes` a\n * finished run whose outcome its owner has already read (a run read with its outcome, or an event stream read to\n * the end) is released early, oldest first; a result nobody has read is kept for the full period.\n * After release, a same-key resubmission is answered `410 RUN_EXPIRED` (or `409 IDEMPOTENCY_CONFLICT` for a\n * different payload) from a bounded tombstone rather than starting a second run. Configure `submissionJournal`\n * for idempotency that also survives restarts and tombstone expiry.\n */\n readonly runRetentionMs?: number;\n /** With `runRecords`: how long a run's owner lease lasts without renewal (default 30 s; renewed every third of it). */\n readonly runLeaseMs?: number;\n /** With `runRecords`: how often owners check for cancel requests and other replicas poll for new events (default 500 ms). */\n readonly runRecordPollMs?: number;\n /** How often an idle event stream sends a comment so proxies and clients see it is alive (default 15 s). */\n readonly streamHeartbeatMs?: number;\n };\n}\nexport interface AgentServer {\n /** Host-only audit counters; no resource or principal data. Null when authorization is disabled. */\n inspectAuthorizationAudit(): AuthorizationAuditSnapshot | null;\n /** Drain admitted audit deliveries to their deadlines before host shutdown. */\n flushAuthorizationAudit(): Promise<void>;\n fetch(request: Request): Promise<Response>;\n /** Trusted host/cron entry point, never an HTTP/browser route. Requires conversationRecovery configuration. */\n recoverConversations(options?: ConversationRecoveryRequest): Promise<ConversationRecoveryReport>;\n inspectClaimedApproval(request: ClaimedApprovalRequest): Promise<ClaimedApprovalView>;\n reconcileClaimedApproval(request: ReconcileClaimedApprovalRequest): Promise<ApprovalReconciliationResult>;\n close(): Promise<void>;\n}\n/** A submission another replica already started: answered with its run id. */\ntype Replay = { readonly replay: string; readonly digest: string };\ninterface Entry {\n readonly owner: string; readonly agentId: string; readonly digest: string;\n readonly handle: RunHandle<unknown>; readonly runtime: Runtime;\n readonly runtimeKey: string; readonly submissionKey: string;\n outcome?: Outcome<unknown>;\n /** Run event sequence before this replica resumed the run. */\n eventOffset?: number;\n observedAfter?: number;\n finished?: boolean;\n /** With run records: settles once the owner has recorded the outcome (or lost the run, or the server closed). */\n persisted?: Promise<void>;\n /** The owner has received the outcome; the run may be released early under capacity pressure. */\n collected?: boolean;\n /** Another replica settled this durable run after its lease lapsed; its record, not this entry, is authoritative. */\n lost?: boolean;\n}\n/** Machine-useful, content-free facts an error may carry next to its code and message. */\ntype FailureDetails = { readonly retryAfterMs?: number; readonly capability?: string; readonly option?: string; readonly limitBytes?: number;\n readonly currentRevision?: number; readonly message?: string };\nclass HttpFailure extends Error {\n constructor(readonly status: number, readonly code: ServerErrorCode, readonly details: FailureDetails = {}) { super(code); }\n}\n/**\n * Every error code the server answers with, and the fixed message that explains it. Messages never contain request\n * data, credentials or adapter text: only what happened and what to do. docs/guides/server-and-client.md lists them.\n */\nconst errorMessages = Object.freeze({\n AUTHORIZATION_DENIED: 'The operation is not authorized.',\n THREAD_NOT_FOUND: 'No thread with this id is visible in this access token scope.',\n THREAD_CONFLICT: 'The thread changed or has an unfinished turn. Read it again before retrying.',\n CONVERSATION_UNAVAILABLE: 'Conversation storage is unavailable. Retry shortly.',\n TOOL_CONTINUATION_CONFLICT: 'The external result checkpoint changed, expired or was already consumed. Inspect the existing run; do not repeat execution.',\n APPROVAL_CONFLICT: 'The approval expired, was already answered, or no longer matches the waiting run. Read the run again.',\n AUTH_REQUIRED: 'Send an Authorization: Bearer <token> header with an access token.',\n AUTH_INVALID: 'The access token was not accepted. Get a new token and try again.',\n AUTH_EXPIRED: 'The identity for this access token has expired. Get a new token and try again.',\n AUTH_UNAVAILABLE: 'The server could not verify the access token right now. Retry shortly.',\n AUTH_LIMIT: 'Too many token verifications are in progress on this server. Retry after retryAfterMs.',\n IDENTITY_INVALID: 'The server\\'s authenticate callback returned an identity Mayura cannot use: principalId, projectId and agent ids must be 1-128 letters, digits, \".\", \"_\", \"/\" or \"-\" starting with a letter or digit, capabilities must be known, and expiresAtMs must be in the future. This is a server configuration problem.',\n CAPABILITY_REQUIRED: 'The access token lacks the capability this request needs (see capability).',\n ORIGIN_DENIED: 'Browser requests from this origin are not allowed. Add the page\\'s exact origin to the server\\'s allowedOrigins.',\n PREFLIGHT_DENIED: 'The CORS preflight asked for a method or header this API does not accept. Use GET or POST, or DELETE for a thread, with only Authorization, Content-Type and Idempotency-Key.',\n INVALID_DESTINATION: 'The request URL\\'s origin is not this server\\'s publicOrigin. Send requests to the public origin, or set mounted: true when a trusted proxy or framework routes requests to this handler.',\n INVALID_QUERY: 'The query string has a parameter this route does not accept, or repeats one.',\n INVALID_CURSOR: 'The after or limit query parameter is invalid. Use a cursor the server returned and a limit from 1 to 100.',\n INVALID_JSON: 'The request body is not valid UTF-8 JSON.',\n INVALID_REQUEST: 'The request body does not have exactly the fields and types this route expects.',\n INVALID_MEDIA: 'The run\\'s media was refused (see message): each item needs a supported mediaType and base64 data, an https url or an artifact reference, and the agent must accept it within its limits.',\n IDEMPOTENCY_KEY_REQUIRED: 'POST /v1/runs needs an Idempotency-Key header of 1-128 letters, digits, \".\", \"_\", \":\" or \"-\" starting with a letter or digit. Use one key per user action and reuse it only to retry that action.',\n UNSUPPORTED_MEDIA_TYPE: 'Send the request body as Content-Type: application/json, without Content-Encoding.',\n BODY_TOO_LARGE: 'The request body is larger than the server accepts (see limitBytes).',\n ROUTE_NOT_FOUND: 'This server has no such API route.',\n METHOD_NOT_ALLOWED: 'This API route does not accept this HTTP method.',\n NOT_ENABLED: 'This server does not offer this API: the operator has not configured it (see option).',\n AGENT_NOT_FOUND: 'No agent with this id is registered on this server and visible to this access token.',\n RUN_NOT_FOUND: 'No run with this id is visible to this access token. Finished runs are released after runRetentionMs, and without durable run records only the replica that started a run can read it.',\n HUMAN_REQUEST_NOT_FOUND: 'No human request with this id is visible to this access token.',\n WORKFLOW_RUN_NOT_FOUND: 'No workflow run with this id is visible to this access token.',\n MIGRATION_NOT_FOUND: 'No migration with this id is offered for this workflow run.',\n REQUEST_TIMEOUT: 'The request did not finish within the server\\'s time limit, or the caller cancelled it. It may or may not have taken effect: retry with the same idempotency key or command id.',\n IDEMPOTENCY_CONFLICT: 'This Idempotency-Key was already used for a different agent or input. Use a new key for a new action.',\n SUBMISSION_IN_PROGRESS: 'Another server replica is still starting the run for this Idempotency-Key. Retry with the same key after retryAfterMs.',\n SUBMISSION_OUTCOME_UNKNOWN: 'This Idempotency-Key was claimed by a submission whose run can no longer be found, for example after a server restart. Mayura cannot tell whether it ran, so it will not start another. Check your own records before using a new key.',\n RUN_EXPIRED: 'The run for this Idempotency-Key finished and was released after runRetentionMs. Its result is no longer available; use a new key to run again.',\n WORKFLOW_CONFLICT: 'The workflow run changed since it was read, or is not in a state that accepts this command. Read the run again and decide with its current revision.',\n FLEET_CONFLICT: 'The fleet hold is not in the state this sweep needs: hold the fleet before a pause sweep and release it before a resume sweep.',\n MIGRATION_REFUSED: 'The migration has blockers for this run (see plan). Plan it again after resolving them.',\n REQUEST_LIMIT: 'The server is handling as many requests as it allows (maxRequests). Retry after retryAfterMs.',\n STREAM_LIMIT: 'The server has as many open event streams as it allows (maxStreams). Retry after retryAfterMs.',\n RUN_LIMIT: 'The server holds as many runs as it allows (maxRuns). Retry after retryAfterMs.',\n RUNTIME_LIMIT: 'The server holds as many runtimes as it allows (maxRuntimes). Retry after retryAfterMs.',\n HUMAN_LIMIT: 'Too many human request operations are in progress (maxHumanOperations). Retry after retryAfterMs.',\n WORKFLOW_LIMIT: 'Too many workflow operations are in progress (maxWorkflowOperations). Retry after retryAfterMs.',\n SERVER_CLOSED: 'The server is shutting down. Retry against another replica.',\n SERVICE_UNAVAILABLE: 'The server could not complete the request right now. Retry shortly.',\n SUBMISSION_JOURNAL_UNAVAILABLE: 'The submission could not be recorded in durable storage, so no run was started. Retry with the same Idempotency-Key.',\n RUN_RECORDS_UNAVAILABLE: 'Durable run records could not be read or written right now. Retry shortly; a submission refused with this code was cancelled before it could do work.',\n HUMAN_UNAVAILABLE: 'The human request service failed or is unavailable. Retry shortly.',\n HUMAN_TRANSPORT_INVALID: 'The server\\'s human request adapter returned data Mayura could not validate. This is a server problem.',\n WORKFLOW_UNAVAILABLE: 'The workflow service failed or is unavailable. Retry shortly.',\n WORKFLOW_TRANSPORT_INVALID: 'The server\\'s workflow adapter returned data Mayura could not validate. This is a server problem.',\n RESPONSE_TOO_LARGE: 'The response would be larger than the server allows (maxResponseBytes).',\n OBSERVATION_FAILED: 'The server could not follow this run\\'s events from the requested position. Read the run, then reconnect from a sequence it has sent.',\n THREAD_COMPACTION_NOT_FOUND: 'No such compaction command in this thread.',\n THREAD_COMPACTION_LIMIT: 'Compaction exceeded an admission or source limit. Inspect the command before taking further action.',\n THREAD_COMPACTION_CANCELLED: 'Compaction was cancelled. Inspect the command to determine whether a summary committed.',\n INTERNAL_ERROR: 'The server failed unexpectedly. The request may or may not have taken effect: retry with the same idempotency key or command id.',\n} satisfies Record<string, string>);\nexport type ServerErrorCode = keyof typeof errorMessages;\n/** Codes a client may retry after the hinted delay; the server sends retryAfterMs and a Retry-After header with them. */\nconst retryable: Readonly<Partial<Record<ServerErrorCode, number>>> = Object.freeze({\n AUTH_LIMIT: 1_000, REQUEST_LIMIT: 1_000, STREAM_LIMIT: 1_000, RUN_LIMIT: 1_000, RUNTIME_LIMIT: 1_000, HUMAN_LIMIT: 1_000, WORKFLOW_LIMIT: 1_000,\n SUBMISSION_IN_PROGRESS: 1_000, AUTH_UNAVAILABLE: 2_000, SERVER_CLOSED: 1_000, SERVICE_UNAVAILABLE: 2_000, SUBMISSION_JOURNAL_UNAVAILABLE: 2_000,\n CONVERSATION_UNAVAILABLE: 2_000, RUN_RECORDS_UNAVAILABLE: 2_000, HUMAN_UNAVAILABLE: 2_000, WORKFLOW_UNAVAILABLE: 2_000,\n});\nconst identifier = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/;\nconst capabilities: readonly ServerIdentity['capabilities'][number][] = Object.freeze(['runs:read', 'runs:submit', 'runs:cancel', 'runs:approve', 'runs:resume', 'threads:read', 'threads:write', 'threads:delete', 'threads:compact', 'threads:import', 'operations:read',\n 'humans:read', 'humans:respond', 'workflows:read', 'workflows:control', 'workflows:fleet', 'workflows:migrate']);\nconst runStatuses = new Set(['running', 'waiting', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\n/** Replica clocks may disagree by up to this much (or one lease, if shorter); a lease counts as lapsed only after it. */\nconst maxLeaseSkewMs = 5_000;\nconst commandFields = 'commandId must be 1-128 letters, digits, \".\", \"_\", \"/\" or \"-\" starting with a letter or digit, and revision a positive integer.';\nconst humanIdentifier = /^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$/;\nconst encoder = new TextEncoder();\nconst workflowKinds = Object.freeze({ 2: new Set(['tool', 'join']), 3: new Set(['tool', 'join', 'wait']),\n 4: new Set(['tool', 'join', 'child']), 5: new Set(['tool', 'join', 'human', 'timer', 'signal']) });\nconst workflowStatuses = new Set(['running', 'waiting', 'paused', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\nconst workflowStepStatuses = new Set(['pending', 'waiting', 'approved', 'dispatching', 'succeeded', 'failed', 'blocked', 'unknown', 'skipped', 'timed_out']);\nconst approvalRecord = (value: JsonValue | undefined): boolean => {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;\n const keys = Object.keys(value); const subject = value['subject'];\n return keys.every(key => ['digest', 'expiresAtMs', 'subject'].includes(key)) && typeof value['digest'] === 'string' && /^[a-f0-9]{64}$/.test(value['digest'])\n && typeof value['expiresAtMs'] === 'number' && Number.isSafeInteger(value['expiresAtMs']) && value['expiresAtMs'] > 0\n && (subject === undefined || (subject !== null && typeof subject === 'object' && !Array.isArray(subject)\n && Object.keys(subject).length === 3 && Object.hasOwn(subject, 'input')\n && typeof subject['toolId'] === 'string' && identifier.test(subject['toolId'])\n && typeof subject['toolVersion'] === 'string' && identifier.test(subject['toolVersion'])));\n};\nfunction object(value: unknown, maxBytes = 1_048_576): JsonObject {\n let copy: JsonValue;\n try { copy = jsonValue(value, { maxBytes }); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (copy === null || Array.isArray(copy) || typeof copy !== 'object') throw new HttpFailure(400, 'INVALID_REQUEST');\n return copy;\n}\n/** Exact body fields. The message names the expected fields (API facts, never the request's own data). */\nfunction exact(value: JsonObject, keys: readonly string[]): void {\n if (Object.keys(value).length !== keys.length || keys.some(key => !(key in value))) {\n throw new HttpFailure(400, 'INVALID_REQUEST', { message: keys.length === 0 ? 'Send an empty JSON object as the body.'\n : `Send a JSON object with exactly these fields: ${keys.join(', ')}.` });\n }\n}\nfunction canonical(value: JsonValue): string {\n if (value === null || typeof value !== 'object') return JSON.stringify(value);\n return Array.isArray(value) ? `[${value.map(canonical).join(',')}]`\n : `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${canonical(value[key]!)}`).join(',')}}`;\n}\nfunction origin(value: string): string {\n const url = new URL(value);\n if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw new Error('Invalid server origin.');\n if (url.protocol === 'http:' && !['localhost', '127.0.0.1', '[::1]'].includes(url.hostname)) throw new Error('Non-loopback origins require HTTPS.');\n return url.origin;\n}\nfunction assertActive(signal: AbortSignal): void { if (signal.aborted) throw new HttpFailure(408, 'REQUEST_TIMEOUT'); }\nfunction workflowExact(value: JsonObject, keys: readonly string[]): void {\n if (Object.keys(value).length !== keys.length || keys.some(key => !Object.hasOwn(value, key))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n}\nfunction workflowRecord(value: unknown, expectedRunId: string): WorkflowViewRecord {\n let raw: JsonObject;\n try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['format', 'definitionId', 'definitionVersion', 'runId', 'revision', 'status', 'nodes', 'steps']);\n const format = raw['format']; const nodes = raw['nodes']; const steps = raw['steps'];\n if (![2, 3, 4, 5].includes(format as number) || typeof raw['definitionId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(raw['definitionId'])\n || typeof raw['definitionVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['definitionVersion'])\n || raw['runId'] !== expectedRunId || typeof raw['revision'] !== 'number' || !Number.isSafeInteger(raw['revision']) || raw['revision'] < 1\n || typeof raw['status'] !== 'string' || !workflowStatuses.has(raw['status']) || !Array.isArray(nodes) || nodes.length < 1 || nodes.length > 128\n || !Array.isArray(steps) || steps.length !== nodes.length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const admittedKinds = workflowKinds[format as keyof typeof workflowKinds]; const graph = new Map<string, readonly string[]>(); const nodeKinds = new Map<string, string>(); let edges = 0;\n for (const candidate of nodes) {\n let node: JsonObject; try { node = object(candidate, 32_768); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(node, ['id', 'kind', 'dependsOn']);\n if (typeof node['id'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(node['id']) || graph.has(node['id'])\n || typeof node['kind'] !== 'string' || !admittedKinds.has(node['kind']) || !Array.isArray(node['dependsOn']) || node['dependsOn'].length > 127\n || node['dependsOn'].some(item => typeof item !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(item))\n || new Set(node['dependsOn']).size !== node['dependsOn'].length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n edges += node['dependsOn'].length; if (edges > 512) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n graph.set(node['id'], node['dependsOn'] as readonly string[]); nodeKinds.set(node['id'], node['kind']);\n }\n for (const [id, dependencies] of graph) if (dependencies.some(dependency => dependency === id || !graph.has(dependency))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const seen = new Set<string>();\n for (const candidate of steps) {\n let step: JsonObject; try { step = object(candidate, 16_384); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n const allowed = ['id', 'kind', 'status', 'childRunId', 'approval'];\n if (Object.keys(step).some(key => !allowed.includes(key)) || !['id', 'kind', 'status'].every(key => Object.hasOwn(step, key)) || typeof step['id'] !== 'string'\n || seen.has(step['id']) || step['kind'] !== nodeKinds.get(step['id']) || typeof step['status'] !== 'string' || !workflowStepStatuses.has(step['status'])\n || (step['kind'] === 'human' && !['pending', 'waiting', 'succeeded', 'timed_out', 'skipped'].includes(step['status']))\n || (step['kind'] === 'timer' && !['pending', 'waiting', 'succeeded', 'skipped'].includes(step['status']))\n || (step['kind'] === 'signal' && !['pending', 'waiting', 'succeeded', 'timed_out', 'skipped'].includes(step['status']))\n || (step['status'] === 'timed_out' && step['kind'] !== 'human' && step['kind'] !== 'signal')\n || (step['childRunId'] !== undefined && (step['kind'] !== 'child' || typeof step['childRunId'] !== 'string' || !/^[a-f0-9]{64}$/.test(step['childRunId'])))\n || (step['approval'] !== undefined && (step['kind'] !== 'tool' || step['status'] !== 'waiting' || !approvalRecord(step['approval'])))\n ) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n seen.add(step['id']);\n }\n if (seen.size !== graph.size) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const remaining = new Map([...graph].map(([id, dependencies]) => [id, dependencies.length])); const dependents = new Map<string, string[]>();\n for (const [id, dependencies] of graph) for (const dependency of dependencies) { const list = dependents.get(dependency) ?? []; list.push(id); dependents.set(dependency, list); }\n const queue = [...remaining].filter(([, count]) => count === 0).map(([id]) => id);\n for (let cursor = 0; cursor < queue.length; cursor++) for (const dependent of dependents.get(queue[cursor]!) ?? []) {\n const count = remaining.get(dependent)! - 1; remaining.set(dependent, count); if (count === 0) queue.push(dependent);\n }\n if (queue.length !== graph.size) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowViewRecord;\n}\nconst fleetOutcomes = new Set(['paused', 'already_paused', 'terminal', 'busy', 'resumed', 'not_paused', 'missing', 'unregistered']);\nfunction fleetHold(value: unknown): WorkflowFleetHoldRecord {\n let raw: JsonObject; try { raw = object(value, 1_024); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['held', 'generation', 'changedAtMs']);\n const { held, generation, changedAtMs } = raw;\n if (typeof held !== 'boolean' || typeof generation !== 'number' || !Number.isSafeInteger(generation) || generation < (held ? 1 : 0)\n || (changedAtMs !== null && (typeof changedAtMs !== 'number' || !Number.isSafeInteger(changedAtMs) || changedAtMs < 0)))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return Object.freeze({ held, generation, changedAtMs: changedAtMs as number | null });\n}\n/** Sweep pages are content-free: target names, run identities and fixed outcome codes only. */\nfunction fleetSweep(value: unknown, limit: number): WorkflowFleetSweepRecord {\n let raw: JsonObject; try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['outcomes', 'nextCursor']);\n if (!Array.isArray(raw['outcomes']) || raw['outcomes'].length > limit) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const outcomes = raw['outcomes'].map(entry => {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const failed = entry['outcome'] === 'failed'; workflowExact(entry, failed ? ['target', 'runId', 'outcome', 'code'] : ['target', 'runId', 'outcome']);\n if (typeof entry['target'] !== 'string' || !/^[a-z][a-z0-9-]{0,31}$/.test(entry['target']) || typeof entry['runId'] !== 'string'\n || !/^[a-f0-9]{64}$/.test(entry['runId']) || (failed ? typeof entry['code'] !== 'string' || !/^[A-Z][A-Z_]{0,39}$/.test(entry['code'])\n : !fleetOutcomes.has(String(entry['outcome'])))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return Object.freeze({ ...entry }) as unknown as WorkflowFleetSweepOutcomeRecord;\n });\n let nextCursor: JsonObject | null = null;\n if (raw['nextCursor'] !== null) { try { nextCursor = object(raw['nextCursor'], 4_096); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); } }\n return Object.freeze({ outcomes: Object.freeze(outcomes), nextCursor });\n}\nconst migrationIdPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;\nconst migrationActions = new Set(['keep', 'update', 'reset', 'accept', 'add', 'remove']);\nconst nodeIdPattern = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;\nconst shortText = (value: unknown, maximum: number): boolean => typeof value === 'string' && value.length <= maximum && !/[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F]/.test(value);\nfunction migrationRecord(value: unknown): WorkflowMigrationRecord {\n let raw: JsonObject; try { raw = object(value, 8_192); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['id', 'description', 'fromVersion', 'toVersion', 'fromDigest', 'toDigest']);\n if (typeof raw['id'] !== 'string' || !migrationIdPattern.test(raw['id']) || !shortText(raw['description'], 2_048)\n || typeof raw['fromVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['fromVersion'])\n || typeof raw['toVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['toVersion'])\n || typeof raw['fromDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['fromDigest'])\n || typeof raw['toDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['toDigest']) || raw['fromDigest'] === raw['toDigest']) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowMigrationRecord;\n}\nfunction migrationPlan(value: unknown, runId: string, migrationId: string): WorkflowMigrationPlanRecord {\n let raw: JsonObject; try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['migrationId', 'format', 'runId', 'fromDigest', 'toDigest', 'entries', 'blockers', 'allowed']);\n const entries = raw['entries']; const blockers = raw['blockers'];\n if (raw['migrationId'] !== migrationId || raw['runId'] !== runId || typeof raw['format'] !== 'string' || !/^[a-z0-9-]{1,32}$/.test(raw['format'])\n || typeof raw['fromDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['fromDigest']) || typeof raw['toDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['toDigest'])\n || typeof raw['allowed'] !== 'boolean' || !Array.isArray(entries) || entries.length > 512 || !Array.isArray(blockers) || blockers.length > 512\n || raw['allowed'] !== (blockers.length === 0)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n for (const entry of entries) {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n if (Object.keys(entry).some(key => !['action', 'target', 'source', 'status'].includes(key)) || !migrationActions.has(String(entry['action']))\n || (entry['target'] !== undefined && (typeof entry['target'] !== 'string' || !nodeIdPattern.test(entry['target'])))\n || (entry['source'] !== undefined && (typeof entry['source'] !== 'string' || !nodeIdPattern.test(entry['source'])))\n || (entry['status'] !== undefined && (typeof entry['status'] !== 'string' || !/^[a-z_]{1,32}$/.test(entry['status'])))\n || (entry['target'] === undefined && entry['source'] === undefined)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n }\n for (const blocker of blockers) {\n if (blocker === null || typeof blocker !== 'object' || Array.isArray(blocker)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n workflowExact(blocker, ['node', 'reason']);\n if (typeof blocker['node'] !== 'string' || !(blocker['node'] === '*' || nodeIdPattern.test(blocker['node'])) || !shortText(blocker['reason'], 512) || !blocker['reason'])\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n }\n return freezeJson(raw) as unknown as WorkflowMigrationPlanRecord;\n}\nconst settledStatuses = new Set(['succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\nfunction workflowIndexRecord(value: unknown, settled = false): WorkflowIndexRecord {\n let raw: JsonObject; try { raw = object(value, 4_096); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['format', 'definitionId', 'definitionVersion', 'runId', 'revision', 'status', ...(settled ? ['settledAtMs'] : [])]);\n if (settled && (!settledStatuses.has(raw['status'] as string) || typeof raw['settledAtMs'] !== 'number' || !Number.isSafeInteger(raw['settledAtMs']) || raw['settledAtMs'] < 0))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n if (![2, 3, 4, 5].includes(raw['format'] as number) || typeof raw['definitionId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(raw['definitionId'])\n || typeof raw['definitionVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['definitionVersion'])\n || typeof raw['runId'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['runId']) || typeof raw['revision'] !== 'number'\n || !Number.isSafeInteger(raw['revision']) || raw['revision'] < 1 || typeof raw['status'] !== 'string' || !workflowStatuses.has(raw['status']))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowIndexRecord;\n}\nasync function bounded<T>(operation: PromiseLike<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void Promise.resolve(operation).catch(() => {}); throw new HttpFailure(408, 'REQUEST_TIMEOUT'); }\n assertActive(signal);\n return await new Promise<T>((resolve, reject) => {\n const abort = (): void => { cleanup(); reject(new HttpFailure(408, 'REQUEST_TIMEOUT')); };\n const cleanup = (): void => { signal.removeEventListener('abort', abort); };\n signal.addEventListener('abort', abort, { once: true });\n Promise.resolve(operation).then(value => { cleanup(); resolve(value); }, (error: unknown) => { cleanup(); reject(error instanceof HttpFailure ? error : new HttpFailure(503, 'SERVICE_UNAVAILABLE')); });\n if (signal.aborted) abort();\n });\n}\n\n/** Authenticated Fetch facade. Hosting, TLS, durable execution, and token verification remain explicit. */\nexport function createAgentServer(options: AgentServerOptions): AgentServer {\n const publicOrigin = origin(options.publicOrigin);\n const origins = new Set((options.allowedOrigins ?? []).map(origin));\n if (typeof options.authenticate !== 'function' || !Array.isArray(options.agents) || options.agents.length > 256) throw new Error('Explicit authentication and a bounded agent registry are required.');\n const authenticate = options.authenticate;\n if (options.publicLiveness !== undefined && typeof options.publicLiveness !== 'boolean') throw new Error('Public liveness must be explicit.');\n if (options.inspector !== undefined && typeof options.inspector !== 'boolean') throw new Error('The inspector setting must be a boolean.');\n if (options.mounted !== undefined && typeof options.mounted !== 'boolean') throw new Error('The mounted setting must be a boolean.');\n const limits = Object.freeze({ maxRuns: 512, maxRuntimes: 128, maxRequests: 64, maxStreams: 64,\n maxBodyBytes: 1_048_576, maxMediaBodyBytes: 16_777_216, maxResponseBytes: 4_194_304, maxHealthOperations: 32, maxHumanOperations: 32, maxWorkflowOperations: 32,\n requestTimeoutMs: 10_000, streamDurationMs: 30_000, runRetentionMs: 600_000, runLeaseMs: 30_000, runRecordPollMs: 500, streamHeartbeatMs: 15_000, ...options.limits });\n if (Object.keys(limits).some(key => !['maxRuns', 'maxRuntimes', 'maxRequests', 'maxStreams', 'maxBodyBytes', 'maxMediaBodyBytes', 'maxResponseBytes', 'maxHealthOperations', 'maxHumanOperations', 'maxWorkflowOperations', 'requestTimeoutMs', 'streamDurationMs', 'runRetentionMs', 'runLeaseMs', 'runRecordPollMs', 'streamHeartbeatMs'].includes(key))) throw new Error('Unknown server limit.');\n for (const value of Object.values(limits)) if (!Number.isSafeInteger(value) || value < 1 || value > 16_777_216) throw new Error('Server limits must be bounded positive integers.');\n const healthChecks: readonly HealthCheck[] = (() => {\n const supplied = options.healthChecks ?? [];\n if (!Array.isArray(supplied) || supplied.length > 32) throw new Error('Health checks must be a bounded dense list.');\n const descriptors = Object.getOwnPropertyDescriptors(supplied);\n if (Reflect.ownKeys(descriptors).length !== supplied.length + 1) throw new Error('Health checks must be a bounded dense list.');\n const ids = new Set<string>(); const captured: HealthCheck[] = [];\n for (let index = 0; index < supplied.length; index++) {\n const entry = descriptors[String(index)];\n if (!entry || !('value' in entry) || entry.value === null || typeof entry.value !== 'object') throw new Error('Health checks must contain data entries.');\n const fields = Object.getOwnPropertyDescriptors(entry.value as object);\n if (Reflect.ownKeys(fields).some(key => !['id', 'check'].includes(String(key)))) throw new Error('Health checks contain unknown fields.');\n const id = fields['id']; const check = fields['check'];\n if (!id || !('value' in id) || typeof id.value !== 'string' || !identifier.test(id.value) || ids.has(id.value)\n || !check || !('value' in check) || typeof check.value !== 'function') throw new Error('Health checks require unique IDs and callbacks.');\n ids.add(id.value); captured.push(Object.freeze({ id: id.value, check: check.value as HealthCheck['check'] }));\n }\n return Object.freeze(captured);\n })();\n const humanRequests: HumanRequestTransport | undefined = (() => {\n if (options.humanRequests === undefined) return undefined;\n if (options.humanRequests === null || typeof options.humanRequests !== 'object') throw new Error('Human request transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.humanRequests);\n if (Reflect.ownKeys(fields).length !== 3 || ['list', 'inspect', 'respond'].some(key => !fields[key] || !('value' in fields[key]!) || typeof fields[key]!.value !== 'function')) throw new Error('Human request transport requires exact callbacks.');\n return Object.freeze({ list: fields['list']!.value, inspect: fields['inspect']!.value, respond: fields['respond']!.value }) as HumanRequestTransport;\n })();\n const workflowViews: WorkflowViewTransport | undefined = (() => {\n if (options.workflowViews === undefined) return undefined;\n if (options.workflowViews === null || typeof options.workflowViews !== 'object') throw new Error('Workflow view transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowViews);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['inspect'] || !('value' in fields['inspect']) || typeof fields['inspect'].value !== 'function')\n throw new Error('Workflow view transport requires one exact inspect callback.');\n return Object.freeze({ inspect: fields['inspect'].value as WorkflowViewTransport['inspect'] });\n })();\n const workflowIndex: WorkflowIndexTransport | undefined = (() => {\n if (options.workflowIndex === undefined) return undefined;\n if (options.workflowIndex === null || typeof options.workflowIndex !== 'object') throw new Error('Workflow index transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowIndex);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['list'] || !('value' in fields['list']) || typeof fields['list'].value !== 'function')\n throw new Error('Workflow index transport requires one exact list callback.');\n return Object.freeze({ list: fields['list'].value as WorkflowIndexTransport['list'] });\n })();\n const workflowControls: WorkflowControlTransport | undefined = (() => {\n if (options.workflowControls === undefined) return undefined;\n if (options.workflowControls === null || typeof options.workflowControls !== 'object') throw new Error('Workflow control transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowControls);\n if (Reflect.ownKeys(fields).length !== 2 || ['cancel', 'approve'].some(key => !fields[key] || !('value' in fields[key]!) || typeof fields[key]!.value !== 'function'))\n throw new Error('Workflow control transport requires exact cancel and approve callbacks.');\n return Object.freeze({ cancel: fields['cancel']!.value, approve: fields['approve']!.value }) as WorkflowControlTransport;\n })();\n const workflowSignals: WorkflowSignalTransport | undefined = (() => {\n if (options.workflowSignals === undefined) return undefined;\n if (options.workflowSignals === null || typeof options.workflowSignals !== 'object') throw new Error('Workflow signal transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowSignals);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['deliver'] || !('value' in fields['deliver']) || typeof fields['deliver'].value !== 'function')\n throw new Error('Workflow signal transport requires one exact deliver callback.');\n return Object.freeze({ deliver: fields['deliver'].value as WorkflowSignalTransport['deliver'] });\n })();\n const workflowResumes: WorkflowResumeTransport | undefined = (() => {\n if (options.workflowResumes === undefined) return undefined;\n if (options.workflowResumes === null || typeof options.workflowResumes !== 'object') throw new Error('Workflow resume transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowResumes);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['resume'] || !('value' in fields['resume']) || typeof fields['resume'].value !== 'function')\n throw new Error('Workflow resume transport requires one exact resume callback.');\n return Object.freeze({ resume: fields['resume'].value as WorkflowResumeTransport['resume'] });\n })();\n const workflowPauses: WorkflowPauseTransport | undefined = (() => {\n if (options.workflowPauses === undefined) return undefined;\n if (options.workflowPauses === null || typeof options.workflowPauses !== 'object') throw new Error('Workflow pause transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowPauses);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['pause'] || !('value' in fields['pause']) || typeof fields['pause'].value !== 'function')\n throw new Error('Workflow pause transport requires one exact pause callback.');\n return Object.freeze({ pause: fields['pause'].value as WorkflowPauseTransport['pause'] });\n })();\n const workflowFleet: WorkflowFleetTransport | undefined = (() => {\n if (options.workflowFleet === undefined) return undefined;\n if (options.workflowFleet === null || typeof options.workflowFleet !== 'object') throw new Error('Workflow fleet transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowFleet); const names = ['inspect', 'hold', 'release', 'sweep'] as const;\n if (Reflect.ownKeys(fields).length !== names.length || names.some(name => !fields[name] || !('value' in fields[name]!) || typeof fields[name]!.value !== 'function'))\n throw new Error('Workflow fleet transport requires exact inspect, hold, release and sweep callbacks.');\n return Object.freeze(Object.fromEntries(names.map(name => [name, fields[name]!.value])) as unknown as WorkflowFleetTransport);\n })();\n const workflowMigrations: WorkflowMigrationTransport | undefined = (() => {\n if (options.workflowMigrations === undefined) return undefined;\n if (options.workflowMigrations === null || typeof options.workflowMigrations !== 'object') throw new Error('Workflow migration transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowMigrations); const names = ['list', 'plan', 'apply'] as const;\n if (Reflect.ownKeys(fields).length !== names.length || names.some(name => !fields[name] || !('value' in fields[name]!) || typeof fields[name]!.value !== 'function'))\n throw new Error('Workflow migration transport requires exact list, plan and apply callbacks.');\n return Object.freeze(Object.fromEntries(names.map(name => [name, fields[name]!.value])) as unknown as WorkflowMigrationTransport);\n })();\n const registry = new Map<string, RegisteredAgent>();\n for (const config of options.agents) {\n assertAgent(config.agent);\n if (registry.has(config.agent.id)) throw new Error('Agent registry IDs must be unique.');\n // Validate configuration now, not after accepting an HTTP command. No model work is performed.\n const permissions = Object.freeze({ allow: Object.freeze([...config.permissions.allow]) });\n const settings = config.limits === undefined ? {} : Object.freeze({ ...config.limits });\n const check = createRuntime({ profile: 'ephemeral', permissions, limits: settings });\n void check.close();\n registry.set(config.agent.id, Object.freeze({ agent: config.agent, permissions, limits: settings }));\n }\n // Run submissions may carry media only when some agent accepts it; otherwise they keep the ordinary body limit.\n const runBodyBytes = [...registry.values()].some(config => config.agent.media) ? Math.max(limits.maxBodyBytes, limits.maxMediaBodyBytes) : limits.maxBodyBytes;\n const mediaArtifacts = options.mediaArtifacts;\n if (mediaArtifacts !== undefined && typeof mediaArtifacts !== 'function') throw new Error('mediaArtifacts must be a function.');\n /** Media items of a run submission, as Mayura media: base64 bytes, an https URL, or a stored artifact. */\n const submittedMedia = async (value: JsonValue | undefined, scope: Scope, signal: AbortSignal): Promise<readonly Media[]> => {\n if (value === undefined) return [];\n const refuse = (message: string): never => { throw new HttpFailure(400, 'INVALID_MEDIA', { message }); };\n if (!Array.isArray(value) || value.length > 32) return refuse('media must be a list of at most 32 items.');\n const items: Media[] = [];\n for (const [index, raw] of value.entries()) {\n const label = `media ${index + 1}`;\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return refuse(`${label} must be an object.`);\n const keys = Object.keys(raw).sort().join(',');\n const name = raw['name']; const mediaType = raw['mediaType'];\n if (name !== undefined && typeof name !== 'string') refuse(`${label}: name must be text.`);\n const options = name === undefined ? {} : { name: name as string };\n try {\n if (keys === 'artifact' || keys === 'artifact,name') {\n if (!mediaArtifacts) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'mediaArtifacts' });\n const reference = raw['artifact'];\n if (!reference || typeof reference !== 'object' || Array.isArray(reference)) return refuse(`${label}: artifact must be an artifact reference.`);\n let item: Media;\n try { item = await bounded(Promise.resolve().then(() => mediaArtifacts(reference, scope, signal)), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; return refuse(`${label}: the artifact could not be read for this caller.`); }\n items.push(item);\n continue;\n }\n if (typeof mediaType !== 'string' || !(MEDIA_TYPES as readonly string[]).includes(mediaType)) return refuse(`${label}: mediaType must be one of ${MEDIA_TYPES.join(', ')}.`);\n if (keys === 'data,mediaType' || keys === 'data,mediaType,name') {\n if (typeof raw['data'] !== 'string') return refuse(`${label}: data must be base64 text.`);\n items.push(mediaFromBase64(raw['data'], mediaType as MediaType, options));\n } else if (keys === 'mediaType,url' || keys === 'mediaType,name,url') {\n if (typeof raw['url'] !== 'string') return refuse(`${label}: url must be text.`);\n items.push(mediaUrl(raw['url'], mediaType as MediaType, options));\n } else return refuse(`${label} must have mediaType with data (base64) or url, or an artifact reference, and optionally a name.`);\n } catch (error) {\n if (error instanceof MayuraError) return refuse(`${label}: ${error.message}`);\n throw error;\n }\n }\n return items;\n };\n /** A digest of each media item for the idempotency key: its bytes' SHA-256, or its URL. */\n const mediaDigests = async (items: readonly Media[]): Promise<JsonValue> => Promise.all(items.map(async item => {\n if (!('data' in item)) return { mediaType: item.mediaType, url: item.url, name: item.name ?? null };\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', new Uint8Array(item.data)));\n return { mediaType: item.mediaType, sha256: [...digest].map(byte => byte.toString(16).padStart(2, '0')).join(''), name: item.name ?? null };\n }));\n const toolCatalog = Object.freeze([...registry.values()].flatMap(config => [...config.agent.tools.map(tool => Object.freeze({\n agentId: config.agent.id, agentVersion: config.agent.version, id: tool.id, version: tool.version,\n effects: tool.effects, capabilities: tool.capabilities, timeoutMs: tool.timeoutMs, costMicros: tool.costMicros,\n })), ...(config.agent.handoffs ?? []).map(edge => Object.freeze({\n agentId: config.agent.id, agentVersion: config.agent.version, id: `handoff.${edge.agent.id}`, version: edge.agent.version,\n effects: 'none' as const, capabilities: Object.freeze([`agent:${edge.agent.id}`]),\n timeoutMs: config.limits?.maxDurationMs ?? 60_000, costMicros: 0,\n }))]).sort((left, right) => left.agentId.localeCompare(right.agentId) || left.id.localeCompare(right.id) || left.version.localeCompare(right.version)));\n const authorization = options.authorization === undefined ? undefined : createAuthorizer(options.authorization);\n const cursorCodec = options.authorization === undefined ? undefined : authorizationCursors(options.authorization);\n const readCursor = async (cursor: string | null, identity: ServerIdentity, context: string, signal: AbortSignal): Promise<string | null> => {\n if (!cursorCodec) return cursor;\n try { return await bounded(cursorCodec.decode(cursor, identity, context), signal); } catch { throw new HttpFailure(400, 'INVALID_CURSOR'); }\n };\n const writeCursor = async (cursor: string | null, identity: ServerIdentity, context: string, signal: AbortSignal): Promise<string | null> => {\n if (!cursorCodec) return cursor;\n try { return await bounded(cursorCodec.encode(cursor, identity, context), signal); } catch { throw new HttpFailure(503, 'SERVICE_UNAVAILABLE'); }\n };\n const access = async (identity: ServerIdentity, kind: AuthorizationResourceKind, id: string, action: string, signal: AbortSignal): Promise<boolean> => {\n assertActive(signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n if (!authorization) return true;\n const owned = action !== 'list' && ['thread', 'run', 'workflow', 'human_request'].includes(kind);\n const decision = await authorization.authorize(identity.scope, action, { kind, id, scope: identity.scope,\n ...(owned ? { ownerId: identity.scope.principalId } : {}) }, { signal });\n assertActive(signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n return decision.effect === 'allow';\n };\n const authorize = async (identity: ServerIdentity, kind: AuthorizationResourceKind, id: string, action: string, signal: AbortSignal): Promise<void> => {\n if (!await access(identity, kind, id, action, signal)) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n };\n const filterAuthorized = async <T>(items: readonly T[], identity: ServerIdentity, kind: AuthorizationResourceKind,\n id: (item: T) => string, signal: AbortSignal): Promise<T[]> => {\n if (!authorization) return [...items];\n const visible: T[] = [];\n for (const item of items) if (await access(identity, kind, id(item), 'read', signal)) visible.push(item);\n return visible;\n };\n const conversationStore = options.threads?.store;\n if (options.threads !== undefined && (!conversationStore || typeof conversationStore.threads?.recording !== 'function'\n || typeof conversationStore.runCheckpoints?.get !== 'function')) throw new MayuraError('INVALID_CONFIG', 'threads requires initialized thread and run-checkpoint storage.');\n const compaction = createThreadCompactionService(options.threadCompaction, conversationStore, id => registry.has(id), authorization);\n const scopedThreads = (scope: Scope, signal?: AbortSignal): Threads => createThreads({ store: conversationStore!, scope, ...(authorization === undefined ? {} : { authorization }), ...(signal === undefined ? {} : { signal }),\n permissions: { allow: ['thread:read', 'thread:write', 'thread:delete', 'thread:import'] } });\n const resumeOffsets = new Map<string, number>();\n const runtimeThreads = new Map<string, Threads>();\n const runtimes = new Map<string, Runtime>();\n const runs = new Map<string, Entry>();\n // Same-process concurrent submissions share one journal claim and one run.\n const pendingSubmissions = new Map<string, Promise<Entry | 'duplicate' | Replay>>();\n const submissionJournal = (() => {\n if (options.submissionJournal === undefined) return undefined;\n if (options.submissionJournal === null || typeof options.submissionJournal !== 'object' || typeof options.submissionJournal.claim !== 'function')\n throw new Error('Submission journal requires a claim function.');\n return Object.freeze({ claim: options.submissionJournal.claim.bind(options.submissionJournal) });\n })();\n const runRecords: RunRecordStore | undefined = (() => {\n if (options.runRecords === undefined) return undefined;\n const names = ['claim', 'release', 'start', 'update', 'read', 'events', 'requestCancel', 'abandon'] as const;\n const supplied = options.runRecords as unknown as Record<string, unknown> | null;\n if (supplied === null || typeof supplied !== 'object' || names.some(name => typeof supplied[name] !== 'function'))\n throw new Error('Run records require claim, release, start, update, read, events, requestCancel and abandon functions.');\n if (conversationStore && typeof supplied['resume'] !== 'function') throw new MayuraError('INVALID_CONFIG', 'Thread approvals with durable run records require runRecords.resume.');\n return Object.freeze({ ...Object.fromEntries(names.map(name => [name, (supplied[name] as (...values: unknown[]) => unknown).bind(supplied)])),\n ...(typeof supplied['resume'] === 'function' ? { resume: supplied['resume'].bind(supplied) } : {}) } as unknown as RunRecordStore);\n })();\n const runExecution = options.runExecution ?? 'background';\n if (runExecution !== 'background' && runExecution !== 'request') throw new MayuraError('INVALID_CONFIG', \"runExecution must be 'background' or 'request'.\");\n if (options.conversationRecovery !== undefined && (!conversationStore || !runRecords || typeof conversationStore.runCheckpoints.scan !== 'function'))\n throw new MayuraError('INVALID_CONFIG', 'Conversation recovery requires threads, runRecords and checkpoint scan support.');\n if (options.approvalReconciliation !== undefined && (!conversationStore || !runRecords || typeof conversationStore.runCheckpoints.reconcile !== 'function'))\n throw new MayuraError('INVALID_CONFIG', 'Approval reconciliation requires threads, runRecords and atomic checkpoint reconciliation support.');\n if (runExecution === 'request' && options.conversationRecovery?.intervalMs !== undefined)\n throw new MayuraError('INVALID_CONFIG', 'Request-mode conversation recovery must be invoked by a trusted cron/job, without a process interval.');\n if (runExecution === 'request' && !runRecords) throw new MayuraError('INVALID_CONFIG', \"runExecution 'request' requires runRecords, so any instance can serve a run's result and events.\");\n // In request mode a submission lasts as long as the longest run it may start, plus time to record the outcome.\n const submissionTimeoutMs = runExecution === 'request'\n ? Math.max(...[...registry.values()].map(agent => agent.limits?.maxDurationMs ?? 60_000)) + limits.requestTimeoutMs : limits.requestTimeoutMs;\n // Identifies this server instance as the owner of the runs it executes; never derived from request data.\n const replicaId = crypto.randomUUID(); const leaseSkewMs = Math.min(maxLeaseSkewMs, limits.runLeaseMs);\n const submissions = new Map<string, Entry>();\n // Runs retained per runtime; a runtime closes when its last retained run is released.\n const retained = new Map<string, number>();\n const retentionTimers = new Set<ReturnType<typeof setTimeout>>();\n // Idempotency evidence for released runs: submission key -> request digest, oldest dropped past a fixed bound.\n const tombstones = new Map<string, string>(); const maxTombstones = 16_384;\n const release = (entry: Entry): void => {\n if (runs.get(entry.handle.id) !== entry) return;\n runs.delete(entry.handle.id);\n if (submissions.get(entry.submissionKey) === entry) {\n submissions.delete(entry.submissionKey); tombstones.delete(entry.submissionKey);\n // Durable run records answer a released key themselves; tombstones cover only in-memory runs.\n if (!runRecords) tombstones.set(entry.submissionKey, entry.digest);\n if (tombstones.size > maxTombstones) tombstones.delete(tombstones.keys().next().value!);\n }\n const remaining = (retained.get(entry.runtimeKey) ?? 1) - 1;\n if (remaining > 0) { retained.set(entry.runtimeKey, remaining); return; }\n retained.delete(entry.runtimeKey);\n const runtime = runtimes.get(entry.runtimeKey);\n if (runtime === entry.runtime) { runtimes.delete(entry.runtimeKey); runtimeThreads.delete(entry.runtimeKey); void Promise.resolve().then(() => runtime.close()).catch(() => undefined); }\n };\n /** Release the oldest finished runs until a new run (and, when needed, a new runtime) fits. Active runs are never released. */\n const makeRoom = (runtimeKey: string): void => {\n for (const entry of runs.values()) {\n if (runs.size < limits.maxRuns && (runtimes.has(runtimeKey) || runtimes.size < limits.maxRuntimes)) return;\n if (entry.finished && entry.collected) release(entry);\n }\n };\n const streams = new Set<() => void>();\n let closed = false;\n let requests = 0;\n let authentications = 0;\n let healthOperations = 0;\n let humanOperations = 0;\n let workflowOperations = 0;\n\n const humanRecord = (value: unknown, identity: ServerIdentity): HumanRequestRecord => {\n let raw: JsonObject; try { raw = object(value, 16_384); } catch { throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID'); }\n const allowed = ['id', 'agentId', 'kind', 'schemaId', 'schemaDigest', 'prompt', 'digest', 'status', 'context', 'subjectDigest', 'deadlineAtMs'];\n if (Object.keys(raw).some(key => !allowed.includes(key)) || !['id', 'agentId', 'kind', 'schemaId', 'schemaDigest', 'prompt', 'digest', 'status'].every(key => Object.hasOwn(raw, key))\n || typeof raw['id'] !== 'string' || !humanIdentifier.test(raw['id']) || typeof raw['agentId'] !== 'string' || !identity.agentIds.includes(raw['agentId'])\n || !['information', 'correction', 'plan_selection'].includes(String(raw['kind'])) || typeof raw['schemaId'] !== 'string' || !identifier.test(raw['schemaId'])\n || typeof raw['schemaDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['schemaDigest']) || typeof raw['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['digest'])\n || typeof raw['prompt'] !== 'string' || encoder.encode(raw['prompt']).byteLength < 1 || encoder.encode(raw['prompt']).byteLength > 1_024\n || !['waiting', 'answered', 'cancelled', 'timed_out'].includes(String(raw['status']))\n || (raw['subjectDigest'] !== undefined && (typeof raw['subjectDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['subjectDigest'])))\n || ((raw['kind'] === 'correction') !== (raw['subjectDigest'] !== undefined))\n || (raw['deadlineAtMs'] !== undefined && (!Number.isSafeInteger(raw['deadlineAtMs']) || (raw['deadlineAtMs'] as number) < 0))) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as HumanRequestRecord;\n };\n const humanCall = async <T>(callback: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n if (humanOperations >= limits.maxHumanOperations) throw new HttpFailure(429, 'HUMAN_LIMIT');\n humanOperations++; const operation = Promise.resolve().then(callback).finally(() => { humanOperations--; });\n try { return await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'HUMAN_UNAVAILABLE'); }\n };\n\n const response = (value: unknown, status = 200, extra: Record<string, string> = {}): Response => {\n let text: string;\n try { text = JSON.stringify(jsonValue(value, { maxBytes: limits.maxResponseBytes })); }\n catch { text = JSON.stringify({ error: { code: 'RESPONSE_TOO_LARGE', message: errorMessages.RESPONSE_TOO_LARGE } }); status = 500; extra = {}; }\n return new Response(text, { status, headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', ...extra } });\n };\n /** `{ error: { code, message, ...details } }`, plus `Retry-After` for codes worth retrying. */\n const failureResponse = (failure: HttpFailure, extraBody: Record<string, JsonValue> = {}): Response => {\n const { message, ...details } = failure.details; const retryAfterMs = details.retryAfterMs ?? retryable[failure.code];\n return response({ ...extraBody, error: { code: failure.code, message: message ?? errorMessages[failure.code], ...details,\n ...(retryAfterMs === undefined ? {} : { retryAfterMs }) } }, failure.status,\n retryAfterMs === undefined ? {} : { 'Retry-After': String(Math.max(1, Math.ceil(retryAfterMs / 1_000))) });\n };\n const session = async (request: Request, signal: AbortSignal): Promise<ServerIdentity> => {\n const authorization = request.headers.get('authorization') ?? '';\n if (!/^Bearer [\\x21-\\x7e]{1,8192}$/.test(authorization)) throw new HttpFailure(401, 'AUTH_REQUIRED');\n let supplied: ServerIdentity | null;\n assertActive(signal);\n if (authentications >= limits.maxRequests) throw new HttpFailure(429, 'AUTH_LIMIT');\n authentications++;\n const verification = Promise.resolve().then(() => {\n assertActive(signal); return authenticate(Object.freeze({ token: authorization.slice(7), signal }));\n }).finally(() => { authentications--; });\n // A non-cooperative verifier retains its admission until it really completes.\n try { supplied = await bounded(verification, signal); }\n catch { assertActive(signal); throw new HttpFailure(503, 'AUTH_UNAVAILABLE'); }\n assertActive(signal);\n // null is the verifier's \"not accepted\"; an identity Mayura cannot use is the application's configuration problem.\n if (supplied === null) throw new HttpFailure(401, 'AUTH_INVALID');\n let raw: JsonObject;\n try {\n raw = object(supplied, 65_536); const scope = object(raw['scope']);\n exact(raw, ['scope', 'agentIds', 'capabilities', 'expiresAtMs']); exact(scope, ['principalId', 'projectId']);\n if (typeof scope['principalId'] !== 'string' || !identifier.test(scope['principalId']) || typeof scope['projectId'] !== 'string' || !identifier.test(scope['projectId'])\n || !Array.isArray(raw['agentIds']) || raw['agentIds'].length > 256 || raw['agentIds'].some(id => typeof id !== 'string' || !identifier.test(id))\n || !Array.isArray(raw['capabilities']) || raw['capabilities'].length > capabilities.length || raw['capabilities'].some(cap => !(capabilities as readonly string[]).includes(String(cap)))\n || typeof raw['expiresAtMs'] !== 'number' || !Number.isSafeInteger(raw['expiresAtMs'])) throw new Error();\n } catch { throw new HttpFailure(500, 'IDENTITY_INVALID'); }\n if ((raw['expiresAtMs'] as number) <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n return freezeJson(raw) as unknown as ServerIdentity;\n };\n const requireCapability = (identity: ServerIdentity, capability: ServerIdentity['capabilities'][number]): void => {\n if (!identity.capabilities.includes(capability)) throw new HttpFailure(403, 'CAPABILITY_REQUIRED', { capability });\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n };\n const body = async (request: Request, signal: AbortSignal, maxBodyBytes = limits.maxBodyBytes): Promise<JsonObject> => {\n if (!/^application\\/json(?:\\s*;\\s*charset=utf-8)?$/i.test(request.headers.get('content-type') ?? '') || request.headers.has('content-encoding')) throw new HttpFailure(415, 'UNSUPPORTED_MEDIA_TYPE');\n const declared = request.headers.get('content-length');\n if (declared !== null && (!/^\\d+$/.test(declared) || Number(declared) > maxBodyBytes)) throw new HttpFailure(413, 'BODY_TOO_LARGE', { limitBytes: maxBodyBytes });\n const reader = request.body?.getReader();\n if (!reader) throw new HttpFailure(400, 'INVALID_JSON', { message: 'This request needs a JSON body.' });\n const chunks: Uint8Array[] = []; let total = 0; let complete = false;\n try {\n while (true) {\n const item = await bounded(reader.read(), signal);\n if (item.done) { complete = true; break; }\n total += item.value.byteLength;\n if (total > maxBodyBytes) throw new HttpFailure(413, 'BODY_TOO_LARGE', { limitBytes: maxBodyBytes });\n chunks.push(item.value);\n }\n const data = new Uint8Array(total); let offset = 0;\n for (const chunk of chunks) { data.set(chunk, offset); offset += chunk.byteLength; }\n let parsed: unknown;\n try { parsed = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(data)); } catch { throw new HttpFailure(400, 'INVALID_JSON'); }\n try { return object(parsed, maxBodyBytes); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'The body must be a JSON object within the server\\'s depth and size limits.' }); }\n } finally { if (!complete) void reader.cancel().catch(() => {}); reader.releaseLock(); }\n };\n /** A run-record call bounded by the signal; any failure other than a timeout is RUN_RECORDS_UNAVAILABLE. */\n const recorded = async <T>(call: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n try { return await bounded(Promise.resolve().then(call), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE'); }\n };\n const recordView = (value: unknown, runId: string): RunRecordView | null => {\n if (value === null) return null;\n let raw: JsonObject; try { raw = object(value, 8_388_608); } catch { throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE'); }\n const snapshot = raw['snapshot']; const outcome = raw['outcome']; const status = raw['status'];\n if (Object.keys(raw).some(key => !['runId', 'agentId', 'replicaId', 'status', 'leaseExpiresAtMs', 'cancelRequested', 'lastSequence', 'snapshot', 'outcome'].includes(key))\n || raw['runId'] !== runId || typeof raw['agentId'] !== 'string' || !identifier.test(raw['agentId']) || typeof raw['replicaId'] !== 'string'\n || !/^[A-Za-z0-9._:-]{1,128}$/.test(raw['replicaId']) || typeof status !== 'string' || !runStatuses.has(status)\n || !Number.isSafeInteger(raw['leaseExpiresAtMs']) || typeof raw['cancelRequested'] !== 'boolean' || !Number.isSafeInteger(raw['lastSequence']) || (raw['lastSequence'] as number) < 0\n || snapshot === null || typeof snapshot !== 'object' || Array.isArray(snapshot) || Object.keys(snapshot).some(key => !['id', 'status', 'budget', 'evidence', 'approval', 'toolWait'].includes(key))\n || snapshot['id'] !== runId || snapshot['status'] !== status\n || (['running', 'waiting'].includes(status)) !== (outcome === undefined)\n || (outcome !== undefined && (outcome === null || typeof outcome !== 'object' || Array.isArray(outcome) || outcome['status'] !== status))) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n return raw as unknown as RunRecordView;\n };\n /** Read a durable run; a running run whose owner's lease lapsed is settled as outcome_unknown first. */\n const readRecord = async (owner: string, runId: string, signal: AbortSignal): Promise<RunRecordView | null> => {\n const records = runRecords!;\n let record = recordView(await recorded(() => records.read({ owner, runId, signal }), signal), runId);\n if (record && ['running', 'waiting'].includes(record.status) && record.replicaId !== replicaId && record.leaseExpiresAtMs < Date.now() - leaseSkewMs) {\n const checkpoint = conversationStore ? await recorded(() => conversationStore.runCheckpoints.get({ runId }), signal) : undefined;\n if (!checkpoint || !checkpoint.body['scope'] || canonical(checkpoint.body['scope']) !== owner) {\n record = recordView(await recorded(() => records.abandon({ owner, runId, nowMs: Date.now() - leaseSkewMs, signal }), signal), runId);\n }\n }\n return record;\n };\n\n /**\n * One bounded SSE response over a run's events. An idle stream sends a comment every `streamHeartbeatMs` so proxies\n * keep it open and clients can tell a quiet run from a dead connection. The stream ends when the run's events end,\n * after `streamDurationMs`, or when the identity expires; clients reconnect from their last sequence.\n */\n const eventStream = (open: (signal: AbortSignal) => AsyncIterator<RunEvent>, identity: ServerIdentity, request: Request, onDone?: () => void): Response => {\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (streams.size >= limits.maxStreams) throw new HttpFailure(429, 'STREAM_LIMIT');\n const controller = new AbortController();\n const iterator = open(controller.signal);\n let sink: ReadableStreamDefaultController<Uint8Array>;\n let ended = false; let pending: Promise<IteratorResult<RunEvent>> | undefined;\n const finish = (): void => {\n if (ended) return;\n ended = true; controller.abort(); clearTimeout(timer); streams.delete(finish);\n request.signal.removeEventListener('abort', finish);\n try { sink.close(); } catch { /* Consumer cancellation may already have closed the stream. */ }\n void iterator.return?.().catch(() => {});\n };\n const timer = setTimeout(finish, Math.max(0, Math.min(limits.streamDurationMs, identity.expiresAtMs - Date.now())));\n streams.add(finish);\n const stream = new ReadableStream<Uint8Array>({\n start(value) { sink = value; },\n async pull(value) {\n if (ended) return;\n let beat: ReturnType<typeof setTimeout> | undefined;\n try {\n if (!pending) { pending = iterator.next(); pending.catch(() => {}); }\n const next = await Promise.race([pending, new Promise<'beat'>(resolve => { beat = setTimeout(resolve, limits.streamHeartbeatMs, 'beat'); })]);\n if (ended) return;\n if (authorization) {\n const path = new URL(request.url).pathname; const runId = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/events$/.exec(path)?.[1];\n if (!runId) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n await authorize(identity, 'run', runId, 'read', controller.signal);\n if (ended) return;\n }\n if (next === 'beat') { value.enqueue(encoder.encode(': keep-alive\\n\\n')); return; }\n pending = undefined;\n if (next.done) { onDone?.(); finish(); return; }\n const event = JSON.stringify(jsonValue(next.value, { maxBytes: 16_384 }));\n value.enqueue(encoder.encode(`id: ${next.value.sequence}\\nevent: ${next.value.type}\\ndata: ${event}\\n\\n`));\n } catch (error) {\n const code: ServerErrorCode = error instanceof HttpFailure && ['RUN_RECORDS_UNAVAILABLE', 'AUTHORIZATION_DENIED'].includes(error.code) ? error.code : 'OBSERVATION_FAILED';\n if (!ended) value.enqueue(encoder.encode(`event: stream.error\\ndata: ${JSON.stringify({ code, message: errorMessages[code] })}\\n\\n`));\n finish();\n } finally { clearTimeout(beat); }\n },\n cancel() { finish(); },\n }, { highWaterMark: 1 });\n request.signal.addEventListener('abort', finish, { once: true });\n if (request.signal.aborted) finish();\n return new Response(stream, { headers: { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', 'X-Accel-Buffering': 'no' } });\n };\n /** Recorded events of a run owned by another replica, polled until the run has ended and every event was read. */\n async function* recordedEvents(owner: string, runId: string, after: number, signal: AbortSignal): AsyncGenerator<RunEvent> {\n const records = runRecords!; let cursor = after;\n while (!signal.aborted) {\n const page = await recorded(() => records.events({ owner, runId, after: cursor, limit: 256, signal }), signal);\n if (!Array.isArray(page) || page.length > 256) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n for (const item of page as readonly RunEvent[]) {\n const gap = item?.type === 'events.gap';\n if (!item || item.runId !== runId || !Number.isSafeInteger(item.sequence) || (gap ? item.sequence <= cursor || item.metadata?.['from'] !== cursor + 1\n || item.metadata?.['to'] !== item.sequence : item.sequence !== cursor + 1)) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n cursor = item.sequence; yield item;\n if (item.type === 'run.completed') return;\n }\n if (page.length === 256) continue;\n const record = await readRecord(owner, runId, signal);\n if (!record || (!['running', 'waiting'].includes(record.status) && record.lastSequence <= cursor)) return;\n if (page.length === 0) await new Promise<void>(resolve => {\n const done = (): void => { clearTimeout(wait); signal.removeEventListener('abort', done); resolve(); };\n const wait = setTimeout(done, limits.runRecordPollMs); signal.addEventListener('abort', done, { once: true });\n });\n }\n }\n\n /** The run's public inspection: identity, status, budget and effect evidence. Every replica answers with this shape. */\n const inspection = (entry: Entry): JsonObject => {\n const view = entry.runtime.inspect(entry.handle);\n // A snapshot that is not JSON is an internal failure, not the caller's bad request.\n return jsonValue({ id: view.id, status: view.status, budget: view.budget, evidence: view.evidence, ...(view.approval ? { approval: view.approval } : {}), ...(view.toolWait ? { toolWait: view.toolWait } : {}) }, { maxBytes: 4_194_304 }) as JsonObject;\n };\n /** In-flight owner loops; close() lets them record final outcomes for a bounded time. */\n const persisters = new Set<Promise<void>>(); const persisterStop = new AbortController();\n /**\n * The owner's side of a durable run: record events in order, the snapshot and finally the outcome; renew the lease;\n * and act on cancel requests from other replicas. A write that fails is retried with backoff; if the lease lapses\n * meanwhile, another replica settles the run as outcome_unknown and this owner, told it lost the run, cancels it.\n */\n const persist = (entry: Entry): Promise<void> => {\n const records = runRecords!; const runId = entry.handle.id; const owner = entry.owner;\n const observer = new AbortController();\n const buffer: RunEvent[] = []; let observed = false; let wake: (() => void) | undefined;\n const notify = (): void => { const resume = wake; wake = undefined; resume?.(); };\n void (async () => {\n try { for await (const event of entry.handle.observe({ after: entry.observedAfter ?? 0, signal: observer.signal })) { buffer.push(entry.eventOffset ? { ...event, sequence: event.sequence + entry.eventOffset,\n ...(event.type === 'events.gap' ? { metadata: { ...event.metadata, from: Number(event.metadata['from']) + entry.eventOffset, to: Number(event.metadata['to']) + entry.eventOffset } } : {}) } : event); notify(); } }\n catch { /* The final write still records the outcome; readers see the missing events as a gap. */ }\n finally { observed = true; notify(); }\n })();\n void entry.handle.result().then(notify, notify);\n const call = async <T>(operation: (signal: AbortSignal) => Promise<T>): Promise<T> => {\n const controller = new AbortController(); const stop = (): void => controller.abort();\n const timer = setTimeout(stop, Math.max(1, Math.floor(limits.runLeaseMs / 3))); persisterStop.signal.addEventListener('abort', stop, { once: true });\n try { return await bounded(Promise.resolve().then(() => operation(controller.signal)), controller.signal); }\n finally { clearTimeout(timer); persisterStop.signal.removeEventListener('abort', stop); }\n };\n const task = (async () => {\n let lastWrite = Date.now(); let failures = 0;\n while (!persisterStop.signal.aborted) {\n const now = Date.now(); const ended = observed && entry.finished === true;\n try {\n if (buffer.length > 0 || ended || now - lastWrite >= limits.runLeaseMs / 3) {\n const events = buffer.slice(0, 256); const final = ended && events.length === buffer.length;\n const result = await call(signal => records.update({ owner, runId, replicaId, events, snapshot: inspection(entry),\n leaseExpiresAtMs: now + limits.runLeaseMs, ...(final ? { outcome: object(entry.outcome, 4_194_304) } : {}), signal })) as unknown;\n const written = result as { status?: unknown; cancelRequested?: unknown } | null;\n if (written?.status === 'lost') { entry.lost = true; if (entry.runtime.inspect(entry.handle).status !== 'waiting') entry.handle.cancel(); return; }\n if (written?.status !== 'written' || typeof written.cancelRequested !== 'boolean') throw new Error('invalid');\n if (events.length > 0) entry.observedAfter = events[events.length - 1]!.sequence - (entry.eventOffset ?? 0);\n buffer.splice(0, events.length); lastWrite = now; failures = 0;\n if (written.cancelRequested) entry.handle.cancel();\n if (final || (closed && buffer.length === 0 && inspection(entry)['status'] === 'waiting')) return;\n if (runExecution === 'request' && buffer.length === 0 && inspection(entry)['status'] === 'waiting' && conversationStore) {\n const checkpoint = await call(() => conversationStore.runCheckpoints.get({ runId }));\n if (checkpoint) return;\n }\n if (buffer.length > 0 || (observed && entry.finished)) continue;\n } else {\n const record = recordView(await call(signal => records.read({ owner, runId, signal })), runId);\n if (!record) throw new Error('missing');\n if (record.replicaId !== replicaId || !['running', 'waiting'].includes(record.status)) { entry.lost = true; if (entry.runtime.inspect(entry.handle).status !== 'waiting') entry.handle.cancel(); return; }\n if (record.cancelRequested) entry.handle.cancel();\n failures = 0;\n }\n } catch { failures = Math.min(failures + 1, 16); }\n const delay = failures > 0 ? Math.min(Math.floor(limits.runLeaseMs / 3), 100 * 2 ** failures) : limits.runRecordPollMs;\n await new Promise<void>(resolve => {\n const done = (): void => { clearTimeout(timer); persisterStop.signal.removeEventListener('abort', done); wake = undefined; resolve(); };\n const timer = setTimeout(done, delay); persisterStop.signal.addEventListener('abort', done, { once: true });\n // New events wake a healthy loop at once; after a failure the backoff is kept.\n if (failures === 0) wake = done;\n });\n }\n })();\n persisters.add(task); void task.finally(() => { observer.abort(); persisters.delete(task); });\n return task;\n };\n /** A 409 for a workflow command; with read access the caller also learns the run's current revision. */\n const workflowConflict = async (identity: ServerIdentity, runId: string, signal: AbortSignal): Promise<HttpFailure> => {\n if (!workflowViews || !identity.capabilities.includes('workflows:read') || signal.aborted) return new HttpFailure(409, 'WORKFLOW_CONFLICT');\n try {\n await authorize(identity, 'workflow', runId, 'read', signal);\n const item = await bounded(Promise.resolve().then(() => workflowViews.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, runId, signal }))), signal);\n if (item !== null) return new HttpFailure(409, 'WORKFLOW_CONFLICT', { currentRevision: workflowRecord(item, runId).revision });\n } catch { /* The conflict stands without the hint. */ }\n return new HttpFailure(409, 'WORKFLOW_CONFLICT');\n };\n\n const runtimeFor = (owner: string, agentId: string, scope: Scope): Runtime => {\n const key = JSON.stringify([owner, agentId]); const existing = runtimes.get(key); if (existing) return existing;\n makeRoom(key);\n if (runtimes.size >= limits.maxRuntimes) throw new HttpFailure(429, 'RUNTIME_LIMIT');\n const config = registry.get(agentId)!; const threads = conversationStore ? scopedThreads(scope) : undefined;\n const runtime = createRuntime({ profile: 'ephemeral', scope, permissions: config.permissions,\n ...(authorization ? { authorization } : {}),\n ...(config.limits ? { limits: config.limits } : {}), ...(threads ? { recorder: threads.recorder,\n checkpoints: { store: {\n ...conversationStore!.runCheckpoints,\n // Runtime claims the checkpoint before this callback returns, and deletes it only before dispatch.\n // Transfer the run record inside that exclusive claim, so a losing approval can never steal the writer.\n claim: async command => {\n const checkpoints = conversationStore!.runCheckpoints;\n const claimed = await checkpoints.claim(command);\n if (!runRecords) return claimed;\n const signal = AbortSignal.timeout(Math.min(limits.requestTimeoutMs, 10_000));\n try {\n if (closed) throw new Error('closed');\n let before = recordView(await recorded(() => runRecords.read({ owner, runId: command.runId, signal }), signal), command.runId);\n if (!before || before.agentId !== agentId) throw new Error('missing');\n // A process can stop after saving its checkpoint but before its final waiting snapshot.\n if (before.status === 'running') {\n const saved = savedInspection(claimed);\n const refreshed = await recorded(() => runRecords.update({ owner, runId: command.runId, replicaId: before!.replicaId,\n events: [], snapshot: saved, leaseExpiresAtMs: before!.leaseExpiresAtMs, signal }), signal);\n if (refreshed.status !== 'written') throw new Error('lost');\n }\n before = recordView(await recorded(() => runRecords.resume!({ owner, runId: command.runId, replicaId,\n leaseExpiresAtMs: Date.now() + limits.runLeaseMs, signal }), signal), command.runId);\n if (!before || closed) throw new Error('lost');\n if (!runs.has(command.runId)) resumeOffsets.set(command.runId, before.lastSequence);\n return claimed;\n } catch {\n await checkpoints.update({ runId: command.runId, holderId: command.holderId, expectedVersion: claimed.version, body: claimed.body, status: 'waiting' });\n throw new MayuraError('CONFLICT', 'The run record could not be claimed; the checkpoint remains waiting.');\n }\n },\n }, agents: [config.agent], autoExpire: runExecution === 'background' && options.conversationRecovery === undefined } } : {}) });\n runtimes.set(key, runtime); if (threads) runtimeThreads.set(key, threads); return runtime;\n };\n /** Keep adapter diagnostics private; request cancellation does not undo already committed storage writes. */\n const conversationCall = async <T>(operation: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n assertActive(signal);\n return bounded(Promise.resolve().then(operation).catch(error => {\n if (error instanceof HttpFailure) throw error;\n if (error instanceof MayuraError) {\n if (error.code === 'NOT_FOUND') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n if (error.code === 'CONFLICT') throw new HttpFailure(409, 'THREAD_CONFLICT');\n if (error.code === 'INVALID_INPUT') throw new HttpFailure(400, 'INVALID_REQUEST');\n if (error.code === 'LIMIT_EXCEEDED') throw new HttpFailure(500, 'RESPONSE_TOO_LARGE');\n }\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }), signal);\n };\n const savedRun = async (runId: string, identity: ServerIdentity, signal: AbortSignal) => {\n if (!conversationStore) return undefined;\n const checkpoint = await conversationCall(() => conversationStore.runCheckpoints.get({ runId }), signal);\n const expected = sha256Hex(`mayura:run-scope:v1\\0${identity.scope.principalId}\\0${identity.scope.projectId}`);\n const agent = checkpoint?.body['agent']; const storedScope = checkpoint?.body['scope'];\n if (!checkpoint || checkpoint.body['reconciliation'] !== undefined || checkpoint.scope !== expected || !agent || typeof agent !== 'object' || Array.isArray(agent)\n || typeof agent['id'] !== 'string' || !identity.agentIds.includes(agent['id']) || !registry.has(agent['id'])\n || !storedScope || typeof storedScope !== 'object' || Array.isArray(storedScope) || canonical(storedScope) !== canonical(identity.scope as unknown as JsonValue)) return undefined;\n return checkpoint;\n };\n const savedInspection = (checkpoint: NonNullable<Awaited<ReturnType<typeof savedRun>>>): JsonObject => {\n const pending = checkpoint.body['pending']; const spent = checkpoint.body['spent'];\n if (!pending || typeof pending !== 'object' || Array.isArray(pending) || !spent || typeof spent !== 'object' || Array.isArray(spent)) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n const { callId, toolId, toolVersion, input, digest, expiresAtMs } = pending;\n if (typeof callId !== 'string' || callId.length > 128 || typeof toolId !== 'string' || typeof toolVersion !== 'string'\n || input === undefined || typeof digest !== 'string' || !/^[a-f0-9]{64}$/.test(digest) || !Number.isSafeInteger(expiresAtMs)\n || typeof spent['micros'] !== 'string' || !/^[0-9]{1,30}$/.test(spent['micros']) || !Number.isSafeInteger(spent['calls'])) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n const receipts = checkpoint.body['receipts'] ?? [];\n if (!Array.isArray(receipts) || receipts.some(receipt => !receipt || typeof receipt !== 'object' || Array.isArray(receipt))) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n return { id: checkpoint.runId, status: 'waiting', budget: { spentMicros: Number(spent['micros']) > Number.MAX_SAFE_INTEGER ? spent['micros'] : Number(spent['micros']), reservedMicros: 0, calls: spent['calls']! },\n evidence: receipts.map(receipt => ({ runId: checkpoint.runId, receipt })), [checkpoint.body['waitKind'] === 'frontend' ? 'toolWait' : 'approval']: { callId: callId!, toolId: toolId!, toolVersion: toolVersion!, input: input!, digest: digest!, expiresAtMs: expiresAtMs! } };\n };\n const settleSaved = async (owner: string, runId: string, status: 'failed' | 'cancelled', code: 'DEFINITION_CHANGED' | 'CANCELLED', message: string, signal: AbortSignal): Promise<void> => {\n const previousSequence = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!runRecords || previousSequence === undefined) return;\n const before = recordView(await recorded(() => runRecords.read({ owner, runId, signal }), signal), runId);\n if (!before) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n const snapshot: JsonObject = { id: runId, status, budget: before.snapshot['budget']!, evidence: before.snapshot['evidence'] ?? [] };\n await recorded(() => runRecords.update({ owner, runId, replicaId, snapshot, leaseExpiresAtMs: Date.now() + limits.runLeaseMs,\n events: [{ runId, sequence: previousSequence + 1, timestamp: new Date().toISOString(), type: 'run.completed', metadata: { status } }],\n outcome: { status, error: { code, message } }, signal }), signal);\n };\n const retain = (entry: Entry): void => {\n runs.set(entry.handle.id, entry); retained.set(entry.runtimeKey, (retained.get(entry.runtimeKey) ?? 0) + 1);\n void entry.handle.result().then(outcome => {\n entry.outcome = outcome; entry.finished = true; if (closed) return;\n const timer = setTimeout(() => { retentionTimers.delete(timer); release(entry); }, limits.runRetentionMs);\n (timer as { unref?: () => void }).unref?.(); retentionTimers.add(timer);\n });\n };\n /** Verify persisted scope/agent metadata before asking the host policy to authorize any work. */\n const recoverCandidate = async (id: string, signal: AbortSignal, authorize: ConversationRecoveryOptions['authorize']): Promise<ConversationRecoveryOutcome> => {\n const active = (): void => { if (closed || signal.aborted) throw new MayuraError('CANCELLED', 'Conversation recovery stopped.'); };\n active(); if (id.startsWith('thread-compact:')) return { id, status: 'skipped' };\n const checkpoint = await conversationStore!.runCheckpoints.get({ runId: id }); active();\n if (!checkpoint) return { id, status: 'skipped' };\n const journal = id.startsWith('thread-record:');\n const frontendWait = !journal && checkpoint.body['waitKind'] === 'frontend';\n const completion = journal ? checkpoint.body['completion'] : checkpoint.body;\n if (!completion || typeof completion !== 'object' || Array.isArray(completion)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const storedScope = completion['scope'];\n if (!storedScope || typeof storedScope !== 'object' || Array.isArray(storedScope) || Object.keys(storedScope).sort().join(',') !== 'principalId,projectId'\n || ![storedScope['principalId'], storedScope['projectId']].every(value => typeof value === 'string' && /^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/.test(value))) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const scope: Scope = Object.freeze({ principalId: storedScope['principalId'] as string, projectId: storedScope['projectId'] as string });\n const prefix = journal ? 'thread' : 'run';\n if (checkpoint.scope !== sha256Hex(`mayura:${prefix}-scope:v1\\0${scope.principalId}\\0${scope.projectId}`)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const runId = journal ? completion['runId'] : id;\n if (typeof runId !== 'string' || !/^[a-f0-9-]{36}$/.test(runId) || (journal && id !== `thread-record:${sha256Hex(runId)}`)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const owner = canonical(scope as unknown as JsonValue);\n const record = recordView(await runRecords!.read({ owner, runId, signal }), runId); active();\n if (!record || !registry.has(record.agentId)) return { id, status: 'skipped' };\n if (!journal) {\n const agent = completion['agent'];\n if (!agent || typeof agent !== 'object' || Array.isArray(agent) || agent['id'] !== record.agentId) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n // A claimed approval may already have executed a write; lease expiry cannot authorize replay.\n if ((!frontendWait && (checkpoint.expiresAtMs > Date.now() || checkpoint.status === 'claimed'))\n || (frontendWait && checkpoint.status === 'claimed' && (checkpoint.leaseExpiresAtMs ?? Infinity) > Date.now())\n || !['running', 'waiting'].includes(record.status)) return { id, status: 'skipped' };\n } else if (['running', 'waiting'].includes(record.status) && record.leaseExpiresAtMs > Date.now()) return { id, status: 'skipped' };\n if (await authorize(Object.freeze({ scope, agentId: record.agentId, kind: journal ? 'recording' as const : frontendWait ? 'frontend' as const : 'approval' as const, signal })) !== true) return { id, status: 'skipped', code: 'PERMISSION_DENIED' };\n active();\n if (frontendWait) {\n const binding = completion['recording'];\n if (!binding || typeof binding !== 'object' || Array.isArray(binding) || typeof binding['threadId'] !== 'string') return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const thread = await scopedThreads(scope).get(binding['threadId']);\n if (!thread || thread.status !== 'active' || thread.agentId !== record.agentId) return { id, status: 'skipped', code: 'CONFLICT' };\n }\n if (journal) {\n const threadId = checkpoint.body['threadId'];\n if (typeof threadId !== 'string') return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const recovered = await scopedThreads(scope).recoverRun(threadId, runId);\n return { id, status: recovered ? 'recovered' : 'skipped' };\n }\n let entry = runs.get(runId); if (entry?.lost) { release(entry); entry = undefined; }\n if (!entry && runs.size >= limits.maxRuns) throw new MayuraError('LIMIT_EXCEEDED', 'The run retention limit is reached.');\n const runtimeKey = JSON.stringify([owner, record.agentId]); const runtime = runtimeFor(owner, record.agentId, scope);\n try {\n const pending = checkpoint.body['pending'] as JsonObject;\n const resumedTool = frontendWait && checkpoint.expiresAtMs > Date.now()\n ? await runtime.resumeTool(runId, { callId: pending['callId'] as string, digest: pending['digest'] as string }) : undefined;\n const result = frontendWait && checkpoint.expiresAtMs > Date.now()\n ? resumedTool ? { status: 'resumed' as const, run: resumedTool } : { status: 'not_due' as const }\n : await runtime.expireApproval(runId);\n if (result.status === 'not_due') { resumeOffsets.delete(runId); return { id, status: 'skipped' }; }\n if (result.status === 'cancelled') {\n if (entry) { if (runExecution === 'request') { await entry.handle.result(); entry.persisted = persist(entry); await entry.persisted; } }\n else await settleSaved(owner, runId, 'cancelled', 'CANCELLED', 'The approval request expired and the run was cancelled.', signal);\n return { id, status: 'cancelled' };\n }\n const offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n entry = { owner, agentId: record.agentId, digest: '', handle: result.run, runtime, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); entry.persisted = persist(entry);\n } else if (runExecution === 'request') entry.persisted = persist(entry);\n if (runExecution === 'request') await entry.persisted;\n return { id, status: 'resumed' };\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'DEFINITION_CHANGED') {\n if (entry && runExecution === 'request') { await entry.handle.result(); entry.persisted = persist(entry); await entry.persisted; }\n else await settleSaved(owner, runId, 'failed', 'DEFINITION_CHANGED', 'The agent changed while the run waited for approval.', signal);\n return { id, status: 'skipped', code: 'DEFINITION_CHANGED' };\n }\n throw error;\n } finally { resumeOffsets.delete(runId); }\n };\n const route = async (request: Request, signal: AbortSignal): Promise<Response> => {\n const received = new URL(request.url);\n // Mounted behind a trusted router, only the path and query are taken from the request; the destination is always\n // publicOrigin and no header can change it.\n if ((options.mounted !== true && received.origin !== publicOrigin) || received.username || received.password || received.hash) throw new HttpFailure(400, 'INVALID_DESTINATION');\n // Assigned field by field: a path such as `//other.host/` must never be resolved as a new authority.\n const url = new URL(publicOrigin); url.pathname = received.pathname; url.search = received.search;\n // Console assets are static and data-free; module scripts carry an Origin header even when same-origin.\n if (options.inspector === true && !url.search) { const asset = inspectorAsset(request.method, url.pathname); if (asset) return asset; }\n const requestOrigin = request.headers.get('origin');\n // A page served from the public origin is a same-origin caller; other browser origins need allowedOrigins.\n if (requestOrigin !== null && requestOrigin !== publicOrigin && !origins.has(requestOrigin)) throw new HttpFailure(403, 'ORIGIN_DENIED');\n // A preflight is validated as the request it announces: the same query rules apply, so query credentials still fail,\n // but a legitimate paginated GET can be preflighted.\n const effectiveMethod = request.method === 'OPTIONS' ? request.headers.get('access-control-request-method') ?? '' : request.method;\n const eventMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/events$/.exec(url.pathname);\n const catalogQuery = effectiveMethod === 'GET' && url.pathname === '/v1/tools';\n const humanListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/human-requests';\n const workflowListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/workflow-runs';\n const threadListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/threads';\n const threadEntriesQuery = effectiveMethod === 'GET' && /^\\/v1\\/threads\\/[^/]+\\/entries$/.test(url.pathname);\n const allowedQuery = eventMatch ? ['after'] : catalogQuery || humanListQuery ? ['after', 'limit'] : workflowListQuery ? ['after', 'limit', 'view']\n : threadListQuery ? ['cursor', 'limit', 'status'] : threadEntriesQuery ? ['after', 'before', 'limit'] : [];\n if ([...url.searchParams.keys()].some(key => effectiveMethod !== 'GET' || !allowedQuery.includes(key) || url.searchParams.getAll(key).length > 1)) throw new HttpFailure(400, 'INVALID_QUERY');\n if (request.method === 'OPTIONS') {\n const threadDelete = effectiveMethod === 'DELETE' && /^\\/v1\\/threads\\/[^/]+$/.test(url.pathname);\n if (!requestOrigin || (!['GET', 'POST'].includes(effectiveMethod) && !threadDelete)) throw new HttpFailure(403, requestOrigin ? 'PREFLIGHT_DENIED' : 'ORIGIN_DENIED');\n const headers = (request.headers.get('access-control-request-headers') ?? '').toLowerCase().split(',').map(value => value.trim()).filter(Boolean);\n if (headers.some(value => !['authorization', 'content-type', 'idempotency-key'].includes(value))) throw new HttpFailure(403, 'PREFLIGHT_DENIED');\n return new Response(null, { status: 204, headers: { 'Access-Control-Allow-Methods': threadDelete ? 'GET, POST, DELETE' : 'GET, POST', 'Access-Control-Allow-Headers': 'Authorization, Content-Type, Idempotency-Key' } });\n }\n if (request.method === 'GET' && url.pathname === '/healthz' && options.publicLiveness === true) return response({ status: 'ok' });\n const identity = await session(request, signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n const owner = canonical(identity.scope as unknown as JsonValue);\n const checkRoute = async (): Promise<void> => {\n if (!authorization) return;\n let checks; try { checks = serverAuthorizationRoute(request.method, url.pathname); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (checks === null) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n for (const check of checks) for (const capability of check.capabilities) requireCapability(identity, capability);\n for (const check of checks) await authorize(identity, check.kind, check.id, check.action, signal);\n };\n await checkRoute();\n const respond = async (...args: Parameters<typeof response>): Promise<Response> => { await checkRoute(); return response(...args); };\n if (workflowListQuery) {\n requireCapability(identity, 'workflows:read'); if (!workflowIndex) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowIndex' });\n const viewKey = url.searchParams.get('view') ?? 'active';\n const after = await readCursor(url.searchParams.get('after'), identity, `workflow:${viewKey}`, signal); const limitText = url.searchParams.get('limit') ?? '20';\n if ((after !== null && !/^[A-Za-z0-9._:-]{1,128}$/.test(after)) || !/^\\d+$/.test(limitText)) throw new HttpFailure(400, 'INVALID_CURSOR');\n const limit = Number(limitText); if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const view = url.searchParams.get('view') ?? 'active'; if (view !== 'active' && view !== 'settled') throw new HttpFailure(400, 'INVALID_QUERY');\n const settled = view === 'settled';\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => workflowIndex.list(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n after, limit, signal, ...(settled ? { view: 'settled' as const } : {}) }))).finally(() => { workflowOperations--; });\n let supplied: unknown; try { supplied = await bounded(operation, signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n let page: JsonObject; try { page = object(supplied, 524_288); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(page, ['items', 'next']);\n if (!Array.isArray(page['items']) || page['items'].length > limit || (page['next'] !== null\n && (typeof page['next'] !== 'string' || !/^[A-Za-z0-9._:-]{1,128}$/.test(page['next']) || page['next'] === after)))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const items = page['items'].map(item => workflowIndexRecord(item, settled)); if (new Set(items.map(item => item.runId)).size !== items.length)\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'workflows:read'); return respond({ items: await filterAuthorized(items, identity, 'workflow', item => item.runId, signal), next: await writeCursor(page['next'] as string | null, identity, `workflow:${view}`, signal) });\n }\n const fleetMatch = /^\\/v1\\/workflow-fleet(?:\\/(hold|release|sweeps\\/pause|sweeps\\/resume))?$/.exec(url.pathname);\n if (fleetMatch && request.method === (fleetMatch[1] === undefined ? 'GET' : 'POST')) {\n const action = fleetMatch[1] ?? 'inspect'; const capability = action === 'inspect' ? 'workflows:read' : 'workflows:fleet';\n requireCapability(identity, capability); if (!workflowFleet) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowFleet' });\n let cursor: JsonObject | null = null; let limit = 0; const sweep = action.startsWith('sweeps/');\n if (action !== 'inspect') {\n const data = await body(request, signal);\n if (!sweep) exact(data, []);\n else {\n exact(data, ['cursor', 'limit']);\n if (typeof data['limit'] !== 'number' || !Number.isSafeInteger(data['limit']) || data['limit'] < 1 || data['limit'] > 128) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'limit must be an integer from 1 to 128, and cursor null or the nextCursor the server returned.' });\n limit = data['limit']; if (data['cursor'] !== null) cursor = object(data['cursor'], 4_096);\n }\n }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const base = Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId, signal });\n const call = (): Promise<unknown> => action === 'inspect' ? workflowFleet.inspect(base) : action === 'hold' ? workflowFleet.hold(base)\n : action === 'release' ? workflowFleet.release(base)\n : workflowFleet.sweep(Object.freeze({ ...base, phase: action === 'sweeps/pause' ? 'pause' as const : 'resume' as const, cursor, limit }));\n const operation = Promise.resolve().then(call).finally(() => { workflowOperations--; });\n let result: unknown;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, capability);\n if (sweep) {\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw new HttpFailure(409, 'FLEET_CONFLICT');\n workflowExact(raw, ['status', 'sweep']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ sweep: fleetSweep(raw['sweep'], limit) });\n }\n const fleet = fleetHold(result);\n if ((action === 'hold' && !fleet.held) || (action === 'release' && fleet.held)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ fleet });\n }\n const workflowMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})$/.exec(url.pathname);\n if (workflowMatch && request.method === 'GET') {\n requireCapability(identity, 'workflows:read'); if (!workflowViews) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowViews' });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT');\n workflowOperations++;\n const operation = Promise.resolve().then(() => workflowViews.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n runId: workflowMatch[1]!, signal }))).finally(() => { workflowOperations--; });\n let item: WorkflowViewRecord | null;\n try { item = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n if (item === null) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND'); const record = workflowRecord(item, workflowMatch[1]!);\n assertActive(signal); requireCapability(identity, 'workflows:read'); return respond({ workflow: record });\n }\n const workflowControlMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/(cancel|approvals)$/.exec(url.pathname);\n if (workflowControlMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control'); if (!workflowControls) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowControls' });\n const data = await body(request, signal); const action = workflowControlMatch[2]!;\n const fields = action === 'cancel' ? ['commandId', 'revision'] : ['commandId', 'revision', 'nodeId', 'approvalDigest', 'childRunId']; exact(data, fields);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n if (action === 'approvals' && (typeof data['nodeId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(data['nodeId'])\n || typeof data['approvalDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['approvalDigest'])\n || (data['childRunId'] !== null && (typeof data['childRunId'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['childRunId'])))))\n throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'nodeId must be a workflow node id, approvalDigest a 64-character lowercase hex digest, and childRunId null or a workflow run id.' });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const common = { scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId, runId: workflowControlMatch[1]!,\n revision: data['revision'] as number, commandId: data['commandId'] as string, signal };\n const operation = Promise.resolve().then(() => action === 'cancel' ? workflowControls.cancel(Object.freeze(common))\n : workflowControls.approve(Object.freeze({ ...common, nodeId: data['nodeId'] as string, approvalDigest: data['approvalDigest'] as string,\n childRunId: data['childRunId'] as string | null }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowControlMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowControlMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n const workflowSignalMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/signals$/.exec(url.pathname);\n if (workflowSignalMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control'); if (!workflowSignals) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowSignals' });\n const data = await body(request, signal); exact(data, ['commandId', 'revision', 'signalId', 'signalName', 'value']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1 || typeof data['signalId'] !== 'string' || !identifier.test(data['signalId'])\n || typeof data['signalName'] !== 'string' || !identifier.test(data['signalName'])) throw new HttpFailure(400, 'INVALID_REQUEST', { message: `${commandFields} signalId and signalName must be identifiers of the same form.` });\n let value: JsonValue; try { value = freezeJson(jsonValue(data['value'], { maxBytes: 4_096, maxDepth: 16, maxNodes: 1_024 })); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'value must be JSON of at most 4,096 bytes, 16 levels and 1,024 values.' }); }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => workflowSignals.deliver(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n actorId: identity.scope.principalId, runId: workflowSignalMatch[1]!, revision: data['revision'] as number,\n commandId: data['commandId'] as string, signalId: data['signalId'] as string, signalName: data['signalName'] as string,\n value, signal }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowSignalMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowSignalMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n const migrationMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/migrations(?:\\/([A-Za-z0-9][A-Za-z0-9._-]{0,127}))?$/.exec(url.pathname);\n if (migrationMatch && (request.method === 'GET' || (request.method === 'POST' && migrationMatch[2] !== undefined))) {\n const runId = migrationMatch[1]!; const migrationId = migrationMatch[2];\n const capability = request.method === 'POST' ? 'workflows:migrate' as const : 'workflows:read' as const;\n requireCapability(identity, capability); if (!workflowMigrations) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowMigrations' });\n let data: JsonObject | undefined;\n if (request.method === 'POST') {\n data = await body(request, signal); exact(data, ['commandId', 'revision']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const base = { scope: identity.scope, agentIds: identity.agentIds, runId, signal };\n const operation = Promise.resolve().then((): Promise<unknown> => migrationId === undefined ? workflowMigrations.list(Object.freeze(base))\n : data === undefined ? workflowMigrations.plan(Object.freeze({ ...base, migrationId }))\n : workflowMigrations.apply(Object.freeze({ ...base, actorId: identity.scope.principalId, revision: data['revision'] as number,\n commandId: data['commandId'] as string, migrationId }))).finally(() => { workflowOperations--; });\n let result: unknown;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, capability);\n if (migrationId === undefined) {\n if (result === null) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n if (!Array.isArray(result) || result.length > 256) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const migrations = result.map(migrationRecord);\n if (new Set(migrations.map(item => item.id)).size !== migrations.length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ migrations });\n }\n if (data === undefined) {\n if (result === null) throw new HttpFailure(404, 'MIGRATION_NOT_FOUND');\n return respond({ plan: migrationPlan(result, runId, migrationId) });\n }\n let raw: JsonObject; try { raw = object(result, 524_288); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, runId, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n if (raw['status'] === 'refused') {\n workflowExact(raw, ['status', 'plan']); const plan = migrationPlan(raw['plan'], runId, migrationId);\n if (plan.allowed) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n await checkRoute();\n return failureResponse(new HttpFailure(409, 'MIGRATION_REFUSED'), { plan: plan as unknown as JsonValue });\n }\n workflowExact(raw, ['status', 'plan', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const plan = migrationPlan(raw['plan'], runId, migrationId); const record = workflowRecord(raw['workflow'], runId);\n if (!plan.allowed || record.revision <= (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ plan, workflow: record });\n }\n // Continuation and operator pause share one exact revision-bound body; each has its own least-authority adapter.\n const workflowResumeMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/(resume|pause)$/.exec(url.pathname);\n if (workflowResumeMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control');\n const callback = workflowResumeMatch[2] === 'pause' ? workflowPauses?.pause : workflowResumes?.resume;\n if (!callback) throw new HttpFailure(404, 'NOT_ENABLED', { option: workflowResumeMatch[2] === 'pause' ? 'workflowPauses' : 'workflowResumes' });\n const data = await body(request, signal); exact(data, ['commandId', 'revision']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => callback(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n actorId: identity.scope.principalId, runId: workflowResumeMatch[1]!, revision: data['revision'] as number,\n commandId: data['commandId'] as string, signal }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowResumeMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowResumeMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n if (request.method === 'GET' && url.pathname === '/v1/session') {\n // What this token may do and which optional APIs this server offers it, so a UI shows only usable views.\n const has = (prefix: string): boolean => identity.capabilities.some(capability => capability.startsWith(prefix));\n const features = [\n ...(authorization ? ['authorization'] : []),\n ...(has('humans:') && humanRequests ? ['humanRequests'] : []),\n ...(has('workflows:') ? ([['workflowIndex', workflowIndex], ['workflowViews', workflowViews], ['workflowControls', workflowControls],\n ['workflowSignals', workflowSignals], ['workflowResumes', workflowResumes], ['workflowPauses', workflowPauses], ['workflowFleet', workflowFleet],\n ['workflowMigrations', workflowMigrations]] as const).filter(([, enabled]) => enabled !== undefined).map(([name]) => name) : []),\n ...(has('runs:') && runRecords ? ['runRecords'] : []),\n ...(has('threads:') && conversationStore ? ['threads'] : []),\n ...(identity.capabilities.includes('runs:approve') ? ['runApprovals'] : []),\n ...(identity.capabilities.includes('runs:resume') && conversationStore && runRecords ? ['toolContinuations'] : []),\n ...(compaction && identity.capabilities.includes('threads:compact') && identity.capabilities.includes('threads:read')\n && identity.agentIds.some(id => compaction.allows(id)) ? ['threadCompaction'] : []),\n ];\n return respond({ session: { scope: identity.scope, agentIds: identity.agentIds, capabilities: identity.capabilities, expiresAtMs: identity.expiresAtMs, features } });\n }\n if (request.method === 'GET' && url.pathname === '/v1/agents') {\n requireCapability(identity, 'runs:read');\n return respond({ agents: (await filterAuthorized([...registry.values()].filter(config => identity.agentIds.includes(config.agent.id)), identity, 'agent', config => config.agent.id, signal)).map(config => ({ id: config.agent.id, version: config.agent.version })) });\n }\n if (request.method === 'GET' && url.pathname === '/v1/operations/health') {\n requireCapability(identity, 'operations:read');\n const results = await Promise.all(healthChecks.map(async health => {\n if (healthOperations >= limits.maxHealthOperations) return { id: health.id, status: 'unavailable' as const };\n healthOperations++;\n const operation = Promise.resolve().then(() => health.check(Object.freeze({ signal, scope: identity.scope })))\n .finally(() => { healthOperations--; });\n try { return { id: health.id, status: await bounded(operation, signal) === true ? 'ready' as const : 'unavailable' as const }; }\n catch { return { id: health.id, status: 'unavailable' as const }; }\n }));\n assertActive(signal); requireCapability(identity, 'operations:read');\n const checks = [{ id: 'server', status: 'ready' as const }, ...results];\n const ready = checks.every(check => check.status === 'ready');\n return respond({ status: ready ? 'ready' : 'degraded', checks }, ready ? 200 : 503);\n }\n if (request.method === 'GET' && url.pathname === '/v1/tools') {\n requireCapability(identity, 'operations:read');\n const afterText = url.searchParams.get('after') ?? '0'; const limitText = url.searchParams.get('limit') ?? '50';\n if (!/^\\d+$/.test(afterText) || !/^\\d+$/.test(limitText)) throw new HttpFailure(400, 'INVALID_CURSOR');\n const after = Number(afterText); const limit = Number(limitText);\n if (!Number.isSafeInteger(after) || !Number.isSafeInteger(limit) || limit < 1 || limit > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const visible = toolCatalog.filter(tool => identity.agentIds.includes(tool.agentId));\n if (after > visible.length) throw new HttpFailure(400, 'INVALID_CURSOR');\n const page = visible.slice(after, after + limit); const next = after + page.length;\n const tools = await filterAuthorized(page, identity, 'tool', tool => tool.id, signal);\n return respond({ tools, next: next < visible.length ? next : null });\n }\n if (request.method === 'GET' && url.pathname === '/v1/human-requests') {\n requireCapability(identity, 'humans:read'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const after = await readCursor(url.searchParams.get('after'), identity, 'human_request', signal); const limitText = url.searchParams.get('limit') ?? '50';\n if ((after !== null && !/^[A-Za-z0-9._:-]{1,128}$/.test(after)) || !/^\\d+$/.test(limitText) || Number(limitText) < 1 || Number(limitText) > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const page = await humanCall(() => humanRequests.list(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, after, limit: Number(limitText), signal })), signal);\n let raw: JsonObject; try { raw = object(page, 1_048_576); exact(raw, ['items', 'next']); } catch { throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID'); }\n if (!Array.isArray(raw['items']) || raw['items'].length > Number(limitText) || (raw['next'] !== null && (typeof raw['next'] !== 'string' || !/^[A-Za-z0-9._:-]{1,128}$/.test(raw['next'])))) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n const items = raw['items'].map(item => humanRecord(item, identity));\n if (new Set(items.map(item => item.id)).size !== items.length) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:read'); return respond({ items: await filterAuthorized(items, identity, 'human_request', item => item.id, signal), next: await writeCursor(raw['next'] as string | null, identity, 'human_request', signal) });\n }\n const humanMatch = /^\\/v1\\/human-requests\\/([A-Za-z0-9][A-Za-z0-9._-]{0,79})(?:\\/responses)?$/.exec(url.pathname);\n if (humanMatch && request.method === 'GET' && !url.pathname.endsWith('/responses')) {\n requireCapability(identity, 'humans:read'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const item = await humanCall(() => humanRequests.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, id: humanMatch[1]!, signal })), signal);\n if (item === null) throw new HttpFailure(404, 'HUMAN_REQUEST_NOT_FOUND'); const record = humanRecord(item, identity);\n if (record.id !== humanMatch[1]) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:read'); return respond({ request: record });\n }\n if (humanMatch && request.method === 'POST' && url.pathname.endsWith('/responses')) {\n requireCapability(identity, 'humans:respond'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const data = await body(request, signal); exact(data, ['commandId', 'requestDigest', 'value']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['requestDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['requestDigest'])) throw new HttpFailure(400, 'INVALID_REQUEST', { message: `${commandFields.replace(' and revision a positive integer', '')} requestDigest must be the request's 64-character lowercase hex digest.` });\n await checkRoute();\n const item = await humanCall(() => humanRequests.respond(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId,\n id: humanMatch[1]!, commandId: data['commandId'] as string, requestDigest: data['requestDigest'] as string, value: data['value']!, signal })), signal);\n const record = humanRecord(item, identity);\n if (record.id !== humanMatch[1] || record.digest !== data['requestDigest'] || record.status === 'waiting') throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:respond'); return respond({ request: record });\n }\n const compactionMatch = /^\\/v1\\/threads\\/([^/]+)\\/compactions(?:\\/([^/]+)(?:\\/(cancel))?)?$/.exec(url.pathname);\n if (compactionMatch) {\n requireCapability(identity, 'threads:compact'); requireCapability(identity, 'threads:read');\n if (!compaction || !conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threadCompaction' });\n const decode = (value: string): string => {\n let decoded: string; try { decoded = decodeURIComponent(value); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(decoded)) throw new HttpFailure(400, 'INVALID_REQUEST'); return decoded;\n };\n const id = decode(compactionMatch[1]!); const commandId = compactionMatch[2] === undefined ? undefined : decode(compactionMatch[2]);\n const thread = await conversationCall(() => scopedThreads(identity.scope).get(id), signal);\n if (!thread || !['active', 'archived'].includes(thread.status) || thread.agentId === null\n || !identity.agentIds.includes(thread.agentId) || !compaction.allows(thread.agentId)) throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n if (request.method === 'GET' && commandId && !compactionMatch[3]) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n const view = await conversationCall(() => compaction.inspect(identity.scope, id, commandId, signal), signal);\n assertActive(signal); requireCapability(identity, 'threads:compact');\n if (!view) throw new HttpFailure(404, 'THREAD_COMPACTION_NOT_FOUND'); return respond({ compaction: view });\n }\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n requireCapability(identity, 'threads:write');\n if (commandId && compactionMatch[3] === 'cancel') {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond(await conversationCall(() => compaction.cancel(identity.scope, id, commandId, signal), signal));\n }\n if (commandId) throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n const data = await body(request, signal);\n exact(data, ['commandId', 'through', ...('previousSummarySequence' in data ? ['previousSummarySequence'] : [])]);\n if (typeof data['commandId'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['commandId'])\n || !Number.isSafeInteger(data['through']) || (data['through'] as number) < 1 || (data['through'] as number) > 999_999_997\n || (data['previousSummarySequence'] !== undefined && (!Number.isSafeInteger(data['previousSummarySequence'])\n || (data['previousSummarySequence'] as number) < 1 || (data['previousSummarySequence'] as number) > 999_999_999))) throw new HttpFailure(400, 'INVALID_REQUEST');\n assertActive(signal); requireCapability(identity, 'threads:compact'); requireCapability(identity, 'threads:write');\n await checkRoute();\n try {\n const result = await compaction.compact(identity.scope, id, { commandId: data['commandId'], through: data['through'] as number,\n ...(data['previousSummarySequence'] === undefined ? {} : { previousSummarySequence: data['previousSummarySequence'] as number }) }, signal, identity.expiresAtMs);\n assertActive(signal); requireCapability(identity, 'threads:compact'); return respond({ result });\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'LIMIT_EXCEEDED') throw new HttpFailure(422, 'THREAD_COMPACTION_LIMIT');\n if (error instanceof MayuraError && error.code === 'CANCELLED') throw new HttpFailure(409, 'THREAD_COMPACTION_CANCELLED');\n return conversationCall(() => Promise.reject(error), signal);\n }\n }\n const threadMatch = /^\\/v1\\/threads(?:\\/([^/]+)(?:\\/(entries|archive|restore))?)?$/.exec(url.pathname);\n if (threadMatch) {\n const reading = request.method === 'GET'; const deleting = request.method === 'DELETE';\n requireCapability(identity, deleting ? 'threads:delete' : reading ? 'threads:read' : 'threads:write');\n if (!conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threads' });\n const threads = scopedThreads(identity.scope, signal); let id: string | undefined;\n if (threadMatch[1]) {\n try { id = decodeURIComponent(threadMatch[1]); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(id)) throw new HttpFailure(400, 'INVALID_REQUEST');\n }\n const action = threadMatch[2];\n if (!id && reading) {\n const status = url.searchParams.get('status') ?? 'active'; const limit = url.searchParams.get('limit') ?? '20';\n const cursor = await readCursor(url.searchParams.get('cursor'), identity, `thread:${status}`, signal);\n if (!['active', 'archived', 'all'].includes(status) || !/^[1-9][0-9]?$|^100$/.test(limit)\n || (cursor !== null && (cursor.length === 0 || cursor.length > 256))) throw new HttpFailure(400, 'INVALID_CURSOR');\n // HTTP listing owns its existing identity-bound cursor and row policy checks; avoid nesting service cursors.\n const listing = createThreads({ store: conversationStore!, scope: identity.scope, permissions: { allow: ['thread:read'] } });\n const page = await conversationCall(() => listing.list({ status: status as 'active' | 'archived' | 'all', limit: Number(limit), ...(cursor ? { cursor } : {}) }), signal);\n return respond({ ...page, threads: await filterAuthorized(page.threads, identity, 'thread', thread => thread.id, signal), cursor: await writeCursor(page.cursor, identity, `thread:${status}`, signal) });\n }\n if (!id && request.method === 'POST') {\n const data = await body(request, signal);\n if (Object.keys(data).some(key => !['id', 'agentId', 'title', 'metadata'].includes(key))) throw new HttpFailure(400, 'INVALID_REQUEST');\n if (data['agentId'] !== undefined && (typeof data['agentId'] !== 'string' || !identity.agentIds.includes(data['agentId']) || !registry.has(data['agentId']))) throw new HttpFailure(404, 'AGENT_NOT_FOUND');\n requireCapability(identity, 'threads:write');\n if (data['id'] !== undefined && (typeof data['id'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['id']))) throw new HttpFailure(400, 'INVALID_REQUEST');\n const id = typeof data['id'] === 'string' ? data['id'] : crypto.randomUUID();\n if (authorization) requireCapability(identity, 'threads:read');\n await authorize(identity, 'thread', id, 'create', signal);\n await authorize(identity, 'thread', id, 'read', signal);\n const thread = await conversationCall(() => threads.create({ ...data, id } as Parameters<Threads['create']>[0]), signal);\n await authorize(identity, 'thread', id, 'read', signal);\n return respond({ thread }, 201);\n }\n if (id && reading && !action) {\n const thread = await conversationCall(() => threads.get(id!), signal);\n if (!thread || thread.status === 'deleted' || thread.status === 'deleting') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n return respond({ thread });\n }\n if (id && request.method === 'POST' && action === 'entries') {\n requireCapability(identity, 'threads:import'); requireCapability(identity, 'threads:read');\n await checkRoute(); const data = await body(request, signal);\n return respond({ entries: await conversationCall(() => threads.append(id!, data as unknown as Parameters<Threads['append']>[1]), signal) });\n }\n if (id && reading && action === 'entries') {\n const after = url.searchParams.get('after'); const before = url.searchParams.get('before'); const limit = url.searchParams.get('limit') ?? '100';\n if ((after !== null && before !== null) || [after, before].some(value => value !== null && (!/^[0-9]{1,10}$/.test(value) || !Number.isSafeInteger(Number(value))))\n || !/^[1-9][0-9]{0,2}$/.test(limit) || Number(limit) > 500) throw new HttpFailure(400, 'INVALID_CURSOR');\n const thread = await conversationCall(() => threads.get(id!), signal);\n if (!thread || thread.status === 'deleted' || thread.status === 'deleting') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n return respond({ entries: await conversationCall(() => threads.entries(id!, { limit: Number(limit), ...(after !== null ? { after: Number(after) } : {}), ...(before !== null ? { before: Number(before) } : {}) }), signal) });\n }\n if (id && deleting && !action) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond(await conversationCall(() => threads.delete(id!), signal));\n }\n if (id && request.method === 'POST' && (action === 'archive' || action === 'restore')) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond({ thread: await conversationCall(() => threads[action](id!), signal) });\n }\n if (id && request.method === 'POST' && !action) {\n const data = await body(request, signal);\n if (Object.keys(data).some(key => !['title', 'metadata', 'expectedVersion'].includes(key)) || (!('title' in data) && !('metadata' in data))) throw new HttpFailure(400, 'INVALID_REQUEST');\n if (data['expectedVersion'] !== undefined && (!Number.isSafeInteger(data['expectedVersion']) || (data['expectedVersion'] as number) < 1)) throw new HttpFailure(400, 'INVALID_REQUEST');\n requireCapability(identity, 'threads:write');\n await checkRoute();\n return respond({ thread: await conversationCall(() => threads.update(id!, data as Parameters<Threads['update']>[1]), signal) });\n }\n throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n }\n const toolResumeMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/tool-results\\/resume$/.exec(url.pathname);\n if (toolResumeMatch) {\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n for (const capability of ['runs:resume', 'runs:read', 'threads:read', 'threads:write'] as const) requireCapability(identity, capability);\n if (!conversationStore || !runRecords || runExecution !== 'background') throw new HttpFailure(404, 'NOT_ENABLED');\n const runId = toolResumeMatch[1]!; const data = await body(request, signal); exact(data, ['callId', 'digest']);\n if (typeof data['callId'] !== 'string' || !data['callId'].length || data['callId'].length > 128\n || typeof data['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['digest'])) throw new HttpFailure(400, 'INVALID_REQUEST');\n const checkpoint = await savedRun(runId, identity, signal);\n if (!checkpoint || checkpoint.body['waitKind'] !== 'frontend') throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n const agentId = (checkpoint.body['agent'] as JsonObject)['id'] as string;\n const bound = checkpoint.body['recording'];\n if (!bound || typeof bound !== 'object' || Array.isArray(bound) || typeof bound['threadId'] !== 'string') throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n await authorize(identity, 'thread', bound['threadId'], 'read', signal); await authorize(identity, 'thread', bound['threadId'], 'append', signal);\n const thread = await conversationCall(() => scopedThreads(identity.scope).get(bound['threadId'] as string), signal);\n if (!thread || thread.status !== 'active' || thread.agentId !== agentId) throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n await authorize(identity, 'agent', agentId, 'execute', signal); await checkRoute(); assertActive(signal);\n const local = runs.get(runId);\n if (local && (local.owner !== owner || !identity.agentIds.includes(local.agentId))) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n let entry = local && !local.lost ? local : undefined;\n if (!entry && runs.size >= limits.maxRuns && !local) throw new HttpFailure(429, 'RUN_LIMIT');\n if (local?.lost) release(local);\n const runtime = entry?.runtime ?? runtimeFor(owner, agentId, identity.scope);\n try {\n const handle = await runtime.resumeTool(runId, { callId: data['callId'], digest: data['digest'] });\n if (!handle) return respond({ id: runId, profile: 'ephemeral' }, 202);\n const offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n const runtimeKey = JSON.stringify([owner, agentId]);\n entry = { owner, agentId, digest: '', handle, runtime, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); entry.persisted = persist(entry);\n }\n return respond({ id: runId, profile: 'ephemeral' }, 202);\n } catch (error) {\n resumeOffsets.delete(runId);\n if (error instanceof MayuraError && ['CONFLICT', 'NOT_FOUND', 'DEFINITION_CHANGED'].includes(error.code)) throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n if (error instanceof MayuraError && error.code === 'PERMISSION_DENIED') throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n if (error instanceof HttpFailure) throw error;\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n }\n const approvalMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/approvals$/.exec(url.pathname);\n if (approvalMatch) {\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n requireCapability(identity, 'runs:approve');\n const runId = approvalMatch[1]!; const data = await body(request, signal);\n exact(data, ['callId', 'digest', 'decision', ...('reason' in data ? ['reason'] : [])]);\n if (typeof data['callId'] !== 'string' || data['callId'].length > 128 || typeof data['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['digest'])\n || !['approved', 'rejected'].includes(data['decision'] as string) || (data['reason'] !== undefined && (typeof data['reason'] !== 'string' || data['reason'].length > 1000))) throw new HttpFailure(400, 'INVALID_REQUEST');\n const local = runs.get(runId);\n let entry = local && !local.lost && local.owner === owner && identity.agentIds.includes(local.agentId) ? local : undefined;\n if (local && !local.lost && !entry) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n let runtime = entry?.runtime; let agentId = entry?.agentId; let offset: number | undefined;\n if (!entry) {\n if (!conversationStore) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n const checkpoint = await savedRun(runId, identity, signal);\n if (!checkpoint) {\n if (runRecords) {\n const recorded = await readRecord(owner, runId, signal);\n if (recorded && identity.agentIds.includes(recorded.agentId)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n }\n throw new HttpFailure(404, 'RUN_NOT_FOUND');\n }\n const agent = checkpoint.body['agent'] as JsonObject;\n const pending = checkpoint.body['pending'];\n if (!pending || typeof pending !== 'object' || Array.isArray(pending) || pending['callId'] !== data['callId'] || pending['digest'] !== data['digest']\n || typeof pending['expiresAtMs'] !== 'number' || pending['expiresAtMs'] <= Date.now()) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n agentId = agent['id'] as string; const runtimeKey = JSON.stringify([owner, agentId]); makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n if (local?.lost) release(local);\n runtime = runtimeFor(owner, agentId, identity.scope);\n\n }\n assertActive(signal); requireCapability(identity, 'runs:approve');\n await checkRoute();\n try {\n const handle = await runtime!.approve(runId, { callId: data['callId'], digest: data['digest'], decision: data['decision'] as 'approved' | 'rejected',\n actorId: identity.scope.principalId, ...(typeof data['reason'] === 'string' ? { reason: data['reason'] } : {}) });\n offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n const runtimeKey = JSON.stringify([owner, agentId]);\n entry = { owner, agentId: agentId!, digest: '', handle, runtime: runtime!, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); if (runRecords) entry.persisted = persist(entry);\n }\n if (runExecution === 'request') {\n if (local && runRecords) entry.persisted = persist(entry);\n await entry.persisted;\n }\n return respond({ id: handle.id, profile: 'ephemeral' }, 202);\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'DEFINITION_CHANGED') {\n await settleSaved(owner, runId, 'failed', 'DEFINITION_CHANGED', 'The agent changed while the run waited for approval.', signal);\n } else resumeOffsets.delete(runId);\n if (error instanceof HttpFailure) throw error;\n if (error instanceof MayuraError && ['CONFLICT', 'DEFINITION_CHANGED', 'NOT_FOUND'].includes(error.code)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n if (error instanceof MayuraError && error.code === 'INVALID_INPUT') throw new HttpFailure(400, 'INVALID_REQUEST');\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n }\n if (request.method === 'POST' && url.pathname === '/v1/runs') {\n requireCapability(identity, 'runs:submit');\n const key = request.headers.get('idempotency-key') ?? '';\n if (!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(key)) throw new HttpFailure(400, 'IDEMPOTENCY_KEY_REQUIRED');\n const data = await body(request, signal, runBodyBytes); exact(data, ['agentId', 'input', ...('media' in data ? ['media'] : []), ...('threadId' in data ? ['threadId'] : [])]);\n const agentId = data['agentId'];\n if (typeof agentId !== 'string' || !identity.agentIds.includes(agentId) || !registry.has(agentId)) throw new HttpFailure(404, 'AGENT_NOT_FOUND');\n const config = registry.get(agentId)!;\n if ('threadId' in data) {\n requireCapability(identity, 'threads:read'); requireCapability(identity, 'threads:write');\n if (!conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threads' });\n if (typeof data['threadId'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['threadId'])) throw new HttpFailure(400, 'INVALID_REQUEST');\n if ('media' in data) throw new HttpFailure(400, 'INVALID_REQUEST');\n }\n await authorize(identity, 'agent', agentId, 'submit', signal);\n if (typeof data['threadId'] === 'string') {\n await authorize(identity, 'thread', data['threadId'], 'read', signal);\n await authorize(identity, 'thread', data['threadId'], 'append', signal);\n }\n // Media is checked here against the agent's policy and limits, so a refusal says exactly why.\n const media = await submittedMedia(data['media'], identity.scope, signal);\n try { admitMedia(media, config.agent.media, config.limits?.maxMediaBytes ?? 20_971_520, 'INVALID_INPUT', `Agent ${agentId}`); }\n catch (error) { throw new HttpFailure(400, 'INVALID_MEDIA', { message: error instanceof MayuraError ? error.message : 'The media was refused.' }); }\n const digestBytes = await crypto.subtle.digest('SHA-256', encoder.encode(canonical({ agentId, version: config.agent.version, input: data['input']!, ...('threadId' in data ? { threadId: data['threadId']! } : {}),\n ...(media.length > 0 ? { media: await mediaDigests(media) } : {}) })));\n const digest = [...new Uint8Array(digestBytes)].map(value => value.toString(16).padStart(2, '0')).join('');\n assertActive(signal); requireCapability(identity, 'runs:submit');\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n const submissionKey = JSON.stringify([owner, key]);\n const previous = submissions.get(submissionKey) ?? await pendingSubmissions.get(submissionKey);\n if (previous === 'duplicate') throw new HttpFailure(409, 'SUBMISSION_OUTCOME_UNKNOWN');\n if (previous && typeof previous === 'object' && 'replay' in previous) {\n if (previous.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n await authorize(identity, 'run', previous.replay, 'read', signal);\n return respond({ id: previous.replay, profile: 'ephemeral' }, 200);\n }\n if (previous) {\n if (previous.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n await authorize(identity, 'run', previous.handle.id, 'read', signal);\n return respond({ id: previous.handle.id, profile: 'ephemeral' }, 200);\n }\n const expired = tombstones.get(submissionKey);\n if (expired !== undefined) throw new HttpFailure(expired === digest ? 410 : 409, expired === digest ? 'RUN_EXPIRED' : 'IDEMPOTENCY_CONFLICT');\n const runtimeKey = JSON.stringify([owner, agentId]);\n makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n if (!runtimes.has(runtimeKey) && runtimes.size >= limits.maxRuntimes) throw new HttpFailure(429, 'RUNTIME_LIMIT');\n const start = async (): Promise<Entry | 'duplicate' | Replay> => {\n let claimed = false;\n try {\n if (runRecords) {\n const claim = await recorded(() => runRecords.claim({ owner, key, digest, replicaId, nowMs: Date.now(), signal }), signal) as unknown;\n const result = claim as { status?: unknown; digest?: unknown; runId?: unknown; claimedAtMs?: unknown } | null;\n if (result?.status === 'existing' && typeof result.digest === 'string' && /^[a-f0-9]{64}$/.test(result.digest)\n && (result.runId === null || (typeof result.runId === 'string' && /^[a-f0-9-]{36}$/.test(result.runId))) && Number.isSafeInteger(result.claimedAtMs)) {\n if (result.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n // Another replica, or an earlier process, owns this key: replay its run, wait for it to start, or admit uncertainty.\n if (result.runId !== null) return { replay: result.runId as string, digest };\n if ((result.claimedAtMs as number) >= Date.now() - limits.runLeaseMs - leaseSkewMs) throw new HttpFailure(409, 'SUBMISSION_IN_PROGRESS');\n return 'duplicate';\n }\n if (result?.status !== 'claimed') throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n claimed = true;\n }\n if (submissionJournal) {\n let claim: unknown;\n try { claim = await bounded(Promise.resolve().then(() => submissionJournal.claim(Object.freeze({ owner, key, digest, signal }))), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'SUBMISSION_JOURNAL_UNAVAILABLE'); }\n const result = claim as { status?: unknown; digest?: unknown } | null;\n if (result?.status === 'existing' && typeof result.digest === 'string') {\n // A claim made by an earlier process: its ephemeral run is gone, so neither replay nor a new run is truthful.\n if (result.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n return 'duplicate';\n }\n if (result?.status !== 'claimed') throw new HttpFailure(503, 'SUBMISSION_JOURNAL_UNAVAILABLE');\n }\n assertActive(signal); if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n await authorize(identity, 'agent', agentId, 'submit', signal);\n if (typeof data['threadId'] === 'string') { await authorize(identity, 'thread', data['threadId'], 'read', signal); await authorize(identity, 'thread', data['threadId'], 'append', signal); }\n requireCapability(identity, 'runs:submit');\n const runtime = runtimeFor(owner, agentId, identity.scope);\n const handle = 'threadId' in data\n ? (await conversationCall(() => runInThread({ threads: runtimeThreads.get(runtimeKey)!, runtime, agent: config.agent,\n threadId: data['threadId'] as string, input: data['input'] }), signal)).run\n : runtime.submit(config.agent, { input: data['input'], ...(media.length > 0 ? { media } : {}) });\n claimed = false;\n const entry: Entry = { owner, agentId, digest, handle, runtime, runtimeKey, submissionKey };\n retain(entry); submissions.set(submissionKey, entry);\n if (runRecords) {\n // 202 means the run is recorded: without its record no other replica could find it, so it is stopped instead.\n try {\n await recorded(() => runRecords.start({ owner, key, runId: handle.id, agentId, replicaId, leaseExpiresAtMs: Date.now() + limits.runLeaseMs,\n snapshot: inspection(entry), signal }), signal);\n } catch (error) { handle.cancel(); release(entry); throw error; }\n entry.persisted = persist(entry);\n }\n return entry;\n } catch (error) {\n // A claim whose run never started is given back, so a retry with the same key can start it.\n if (claimed && runRecords) void Promise.resolve().then(() => runRecords.release({ owner, key, replicaId, signal: AbortSignal.timeout(limits.requestTimeoutMs) })).catch(() => {});\n throw error;\n }\n };\n const pending = start(); pendingSubmissions.set(submissionKey, pending);\n let started: Entry | 'duplicate' | Replay;\n try { started = await pending; } finally { pendingSubmissions.delete(submissionKey); }\n if (started === 'duplicate') throw new HttpFailure(409, 'SUBMISSION_OUTCOME_UNKNOWN');\n if ('replay' in started) { await authorize(identity, 'run', started.replay, 'read', signal); return respond({ id: started.replay, profile: 'ephemeral' }, 200); }\n // Request mode: answer only once the run has ended and its outcome is recorded, so nothing runs after the response.\n if (runExecution === 'request') await started.persisted;\n return respond({ id: started.handle.id, profile: 'ephemeral' }, 202);\n }\n const match = /^\\/v1\\/runs\\/([a-f0-9-]{36})(?:\\/(cancel|events))?$/.exec(url.pathname);\n if (!match) throw new HttpFailure(404, 'ROUTE_NOT_FOUND');\n const runId = match[1]!; const local = runs.get(runId);\n const entry = local && !local.lost && local.owner === owner && identity.agentIds.includes(local.agentId) ? local : undefined;\n const action = request.method === 'POST' && match[2] === 'cancel' ? 'cancel' : request.method === 'GET' && match[2] === 'events' ? 'events'\n : request.method === 'GET' && !match[2] ? 'read' : null;\n if (!action) throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n if (!entry && action === 'read' && (!local || local.lost)) {\n requireCapability(identity, 'runs:read');\n const checkpoint = await savedRun(runId, identity, signal);\n if (checkpoint) return respond(savedInspection(checkpoint));\n }\n if (!entry && action === 'cancel' && (!local || local.lost)) {\n requireCapability(identity, 'runs:cancel');\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n const checkpoint = await savedRun(runId, identity, signal);\n if (checkpoint) {\n const agentId = (checkpoint.body['agent'] as JsonObject)['id'] as string;\n if (local?.lost) release(local);\n await checkRoute();\n try { await runtimeFor(owner, agentId, identity.scope).cancelSaved(runId); }\n catch (error) {\n if (error instanceof MayuraError && ['CONFLICT', 'NOT_FOUND'].includes(error.code)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n await settleSaved(owner, runId, 'cancelled', 'CANCELLED', 'Run cancellation was requested.', signal);\n return respond({ id: runId, cancellationRequested: true }, 202);\n }\n }\n if (!entry) {\n // Not held here: another replica's (or an earlier process's) run, answered from durable run records when configured.\n if (!runRecords || (local && !local.lost)) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n requireCapability(identity, action === 'cancel' ? 'runs:cancel' : 'runs:read');\n if (action === 'cancel' && request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'Send the cancel request without a body.' });\n let cursor = 0;\n if (action === 'events') {\n const text = url.searchParams.get('after') ?? '0';\n if (!/^\\d+$/.test(text) || !Number.isSafeInteger(Number(text))) throw new HttpFailure(400, 'INVALID_CURSOR'); cursor = Number(text);\n }\n const record = await readRecord(owner, runId, signal);\n if (!record || !identity.agentIds.includes(record.agentId)) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n assertActive(signal); requireCapability(identity, action === 'cancel' ? 'runs:cancel' : 'runs:read');\n if (action === 'cancel') {\n if (['running', 'waiting'].includes(record.status)) {\n await checkRoute();\n const records = runRecords;\n if (recordView(await recorded(() => records.requestCancel({ owner, runId, signal }), signal), runId) === null) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n }\n return respond({ id: runId, cancellationRequested: true }, 202);\n }\n if (action === 'events') return eventStream(stop => recordedEvents(owner, runId, cursor, stop), identity, request);\n const saved = ['running', 'waiting'].includes(record.status) ? await savedRun(runId, identity, signal) : undefined;\n if (saved?.body['waitKind'] === 'frontend' && saved.status === 'waiting') return respond(savedInspection(saved));\n return respond({ ...record.snapshot, ...(record.outcome ? { outcome: record.outcome } : {}) });\n }\n if (action === 'cancel') {\n requireCapability(identity, 'runs:cancel');\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'Send the cancel request without a body.' });\n await checkRoute();\n assertActive(signal); entry.handle.cancel();\n return respond({ id: entry.handle.id, cancellationRequested: true }, 202);\n }\n if (action === 'events') {\n requireCapability(identity, 'runs:read');\n const cursor = url.searchParams.get('after') ?? '0';\n if (!/^\\d+$/.test(cursor) || !Number.isSafeInteger(Number(cursor))) throw new HttpFailure(400, 'INVALID_CURSOR');\n assertActive(signal);\n if (entry.eventOffset !== undefined && runRecords) return eventStream(stop => recordedEvents(owner, runId, Number(cursor), stop), identity, request);\n return eventStream(stop => entry.handle.observe({ after: Number(cursor), signal: stop })[Symbol.asyncIterator](), identity, request,\n () => { if (entry.finished) entry.collected = true; });\n }\n requireCapability(identity, 'runs:read');\n if (entry.outcome) entry.collected = true;\n return respond({ ...inspection(entry), ...(entry.outcome ? { outcome: entry.outcome } : {}) });\n };\n\n const reconciliation = createApprovalReconciliation(options.approvalReconciliation, {\n ...(conversationStore ? { store: conversationStore.runCheckpoints } : {}), ...(authorization === undefined ? {} : { authorization }),\n read: async (scope, runId, signal) => recordView(await recorded(() => runRecords!.read({ owner: canonical(scope as unknown as JsonValue), runId, signal }), signal), runId),\n abandon: async (scope, runId, signal) => recordView(await recorded(() => runRecords!.abandon({ owner: canonical(scope as unknown as JsonValue), runId, nowMs: Date.now(), signal }), signal), runId),\n agentExists: id => registry.has(id),\n hasRecording: async (scope, checkpoint) => {\n const binding = checkpoint.body['recording']; if (binding === undefined) return false;\n if (!binding || typeof binding !== 'object' || Array.isArray(binding) || typeof binding['threadId'] !== 'string') throw new MayuraError('STORAGE_UNAVAILABLE', 'Invalid thread association.');\n return !!await conversationStore!.threads.recording({ scope: sha256Hex(`mayura:thread-scope:v1\\0${scope.principalId}\\0${scope.projectId}`),\n id: binding['threadId'], runtimeRunId: checkpoint.runId, action: 'read' });\n },\n record: async (scope, checkpoint, receipt) => {\n const binding = checkpoint.body['recording'];\n if (binding !== undefined) {\n if (!binding || typeof binding !== 'object' || Array.isArray(binding)) throw new MayuraError('STORAGE_UNAVAILABLE', 'Invalid thread association.');\n // Keep uncertain transcript/results in the sealed checkpoint, outside model history. Close only its turn.\n await scopedThreads(scope).recorder.complete({ runId: checkpoint.runId, scope, binding, messages: [], approvals: [], reconciliation: receipt,\n outcome: { status: 'outcome_unknown', error: { code: 'OUTCOME_UNKNOWN', message: 'An operator closed the claimed approval without resuming the unfinished run.' } } });\n }\n const entry = runs.get(checkpoint.runId); if (entry) { entry.lost = true; release(entry); }\n },\n timeoutMs: limits.requestTimeoutMs, maxOperations: limits.maxRequests,\n });\n const recovery = createRecoveryController(options.conversationRecovery, {\n scan: (after, limit) => conversationStore!.runCheckpoints.scan({ limit, ...(after ? { after } : {}) }),\n process: recoverCandidate, timeoutMs: submissionTimeoutMs,\n });\n return Object.freeze({\n inspectAuthorizationAudit: () => authorization?.auditSnapshot() ?? null,\n flushAuthorizationAudit: async () => { await authorization?.flushAudit(); },\n recoverConversations: recovery.recover,\n inspectClaimedApproval: reconciliation.inspect, reconcileClaimedApproval: reconciliation.reconcile,\n async fetch(request: Request): Promise<Response> {\n const allow = (result: Response): Response => {\n const requestOrigin = request.headers.get('origin');\n if (requestOrigin && requestOrigin !== publicOrigin && origins.has(requestOrigin)) {\n result.headers.set('Access-Control-Allow-Origin', requestOrigin); result.headers.set('Vary', 'Origin');\n result.headers.set('Access-Control-Expose-Headers', 'Retry-After');\n }\n return result;\n };\n if (closed) return allow(failureResponse(new HttpFailure(503, 'SERVER_CLOSED')));\n if (requests >= limits.maxRequests) return allow(failureResponse(new HttpFailure(429, 'REQUEST_LIMIT')));\n requests++;\n const controller = new AbortController();\n const abort = (): void => { controller.abort(); };\n request.signal.addEventListener('abort', abort, { once: true });\n if (request.signal.aborted) abort();\n const submission = runExecution === 'request' && request.method === 'POST' && /^\\/v1\\/runs(?:\\/[a-f0-9-]{36}\\/approvals)?$/.test(new URL(request.url).pathname);\n const compacting = request.method === 'POST' && /^\\/v1\\/threads\\/[^/]+\\/compactions$/.test(new URL(request.url).pathname);\n const timer = setTimeout(abort, compacting && compaction ? compaction.maxDurationMs + limits.requestTimeoutMs : submission ? submissionTimeoutMs : limits.requestTimeoutMs);\n let result: Response;\n try { result = await bounded(route(request, controller.signal).catch(error => {\n throw error instanceof HttpFailure ? error : new HttpFailure(500, 'INTERNAL_ERROR');\n }), controller.signal); }\n catch (error) {\n result = failureResponse(error instanceof HttpFailure ? error : new HttpFailure(503, 'SERVICE_UNAVAILABLE'));\n } finally { requests--; clearTimeout(timer); request.signal.removeEventListener('abort', abort); }\n return allow(result);\n },\n async close(): Promise<void> {\n closed = true; authorization?.close(); recovery.stop(); reconciliation.stop(); compaction?.stop();\n for (const timer of retentionTimers) clearTimeout(timer); retentionTimers.clear();\n for (const finish of [...streams]) finish();\n await Promise.all([...runtimes.values()].map(runtime => runtime.close()));\n // Let owners record the outcomes of the runs just closed; a write still pending after this ends as outcome_unknown\n // once its lease lapses.\n {\n let timer: ReturnType<typeof setTimeout> | undefined;\n await Promise.race([Promise.allSettled([recovery.settled(), reconciliation.settled(), ...(compaction ? [compaction.settled()] : []), ...persisters]), new Promise(resolve => { timer = setTimeout(resolve, Math.min(5_000, limits.runLeaseMs)); })]);\n clearTimeout(timer);\n }\n persisterStop.abort();\n },\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAmC,MAAM,oBAAoB,CAAC;AAErH,OAAO,EAAE,6BAA6B,EAAsC,MAAM,wBAAwB,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAAsK,MAAM,8BAA8B,CAAC;AAEhP,OAAO,EAAE,wBAAwB,EAAyI,MAAM,4BAA4B,CAAC;AAE7M,OAAO,EAAE,gBAAgB,EAAmE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAA0I,MAAM,cAAc,CAAC;AACrU,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqC,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,aAAa,EAA0D,MAAM,iBAAiB,CAAC;AA4SrH,MAAM,WAAY,SAAQ,KAAK;IACR,MAAM;IAAmB,IAAI;IAA4B,OAAO;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,CAAC;YAClG,KAAK,MAAM,KAAK,IAAI,eAAe;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAClF,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,OAAO,CAAC;gBAAE,MAAM,EAAE,CAAC;YAC5C,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC1E,mHAAmH;YACnH,yBAAyB;YACzB,CAAC;gBACC,IAAI,KAAgD,CAAC;gBACrD,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrP,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YACD,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { workflowNodeLimit } from '@mayura/core';\nimport { authorizationCursors, serverAuthorizationRoute, type ServerAuthorizationOptions } from './authorization.js';\nexport type { ServerAuthorizationOptions } from './authorization.js';\nimport { createThreadCompactionService, type ServerThreadCompactionOptions } from './thread-compaction.js';\nexport type { ServerThreadCompactionOptions, ServerThreadCompactionCommand } from './thread-compaction.js';\nimport { createApprovalReconciliation, type ApprovalReconciliationOptions, type ClaimedApprovalRequest, type ReconcileClaimedApprovalRequest, type ClaimedApprovalView, type ApprovalReconciliationResult } from './approval-reconciliation.js';\nexport type { ApprovalReconciliationOptions, ClaimedApprovalRequest, ReconcileClaimedApprovalRequest, ClaimedApprovalView, ApprovalReconciliationResult } from './approval-reconciliation.js';\nimport { createRecoveryController, type ConversationRecoveryOptions, type ConversationRecoveryOutcome, type ConversationRecoveryRequest, type ConversationRecoveryReport } from './conversation-recovery.js';\nexport type { ConversationRecoveryOptions, ConversationRecoveryOutcome, ConversationRecoveryRequest, ConversationRecoveryReport } from './conversation-recovery.js';\nimport { createAuthorizer, type AuthorizationResourceKind, type AuthorizationAuditSnapshot, freezeJson, jsonValue, MayuraError, MEDIA_TYPES, mediaFromBase64, mediaUrl, type JsonObject, type JsonValue, type Media, type MediaType, type Outcome, type Permissions, type RunEvent, type RunHandle, type Scope } from '@mayura/core';\nimport { admitMedia, sha256Hex } from '@mayura/core/host';\nimport type { RunCheckpointStore } from '@mayura/storage-contracts';\nimport { inspectorAsset } from './inspector.js';\nimport { createThreads, runInThread, type Threads, type ThreadsOptions } from '@mayura/threads';\nimport { assertAgent, createRuntime, type AgentDefinition, type Runtime, type RuntimeLimits } from '@mayura/runtime';\n\nexport interface ServerIdentity {\n readonly scope: Scope;\n readonly agentIds: readonly string[];\n readonly capabilities: readonly ('runs:read' | 'runs:submit' | 'runs:cancel' | 'runs:approve' | 'runs:resume' | 'threads:read' | 'threads:write' | 'threads:delete' | 'threads:compact' | 'threads:import' | 'operations:read' | 'humans:read' | 'humans:respond' | 'workflows:read' | 'workflows:control' | 'workflows:fleet' | 'workflows:migrate')[];\n readonly expiresAtMs: number;\n}\nexport interface HealthCheck {\n readonly id: string;\n /** Trusted application callback. Returning false or throwing marks the dependency unavailable. */\n readonly check: (context: { readonly signal: AbortSignal; readonly scope: Scope }) => boolean | Promise<boolean>;\n}\nexport interface HumanRequestRecord {\n readonly id: string; readonly agentId: string; readonly kind: 'information' | 'correction' | 'plan_selection';\n readonly schemaId: string; readonly schemaDigest: string; readonly prompt: string; readonly digest: string;\n readonly status: 'waiting' | 'answered' | 'cancelled' | 'timed_out'; readonly context?: JsonValue;\n readonly subjectDigest?: string; readonly deadlineAtMs?: number;\n}\nexport interface HumanRequestTransport {\n readonly list: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly after: string | null; readonly limit: number; readonly signal: AbortSignal }) => Promise<{ readonly items: readonly HumanRequestRecord[]; readonly next: string | null }>;\n readonly inspect: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly id: string; readonly signal: AbortSignal }) => Promise<HumanRequestRecord | null>;\n readonly respond: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly id: string;\n readonly requestDigest: string; readonly commandId: string; readonly value: JsonValue; readonly signal: AbortSignal }) => Promise<HumanRequestRecord>;\n}\nexport interface WorkflowViewRecord {\n /** Per-graph admission bound, defaulting to 128 when omitted. */\n readonly maxNodes?: number | false;\n readonly format: 2 | 3 | 4 | 5; readonly definitionId: string; readonly definitionVersion: string; readonly runId: string;\n readonly revision: number; readonly status: 'running' | 'waiting' | 'paused' | 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';\n readonly nodes: readonly { readonly id: string; readonly kind: 'tool' | 'join' | 'wait' | 'child' | 'human' | 'timer' | 'signal'; readonly dependsOn: readonly string[] }[];\n readonly steps: readonly { readonly id: string; readonly kind: 'tool' | 'join' | 'wait' | 'child' | 'human' | 'timer' | 'signal';\n readonly status: 'pending' | 'waiting' | 'approved' | 'dispatching' | 'succeeded' | 'failed' | 'blocked' | 'unknown' | 'skipped' | 'timed_out';\n readonly childRunId?: string; readonly approval?: WorkflowApprovalRecord }[];\n}\n/** A tool step waiting for approval: the digest an approval must name, its expiry and, when known, the exact tool call. */\nexport interface WorkflowApprovalRecord {\n readonly digest: string; readonly expiresAtMs: number;\n readonly subject?: { readonly toolId: string; readonly toolVersion: string; readonly input: JsonValue };\n}\nexport interface WorkflowViewTransport {\n readonly inspect: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly runId: string;\n readonly signal: AbortSignal }) => Promise<WorkflowViewRecord | null>;\n}\nexport interface WorkflowIndexRecord {\n readonly format: 2 | 3 | 4 | 5; readonly definitionId: string; readonly definitionVersion: string; readonly runId: string;\n readonly revision: number; readonly status: WorkflowViewRecord['status'];\n /** Only in the settled view: when the run reached its final status. */\n readonly settledAtMs?: number;\n}\nexport interface WorkflowIndexTransport {\n /**\n * Active runs, or with `view: 'settled'` recently finished runs and runs whose outcome is unknown. The field is\n * present only for the settled view; a transport that ignores it fails the settled request closed.\n */\n readonly list: (input: { readonly scope: Scope; readonly agentIds: readonly string[]; readonly after: string | null;\n readonly limit: number; readonly signal: AbortSignal; readonly view?: 'settled' }) => Promise<{ readonly items: readonly WorkflowIndexRecord[]; readonly next: string | null }>;\n}\nexport type WorkflowControlResult = { readonly status: 'applied'; readonly workflow: WorkflowViewRecord }\n | { readonly status: 'conflict' } | { readonly status: 'not_found' };\ninterface WorkflowControlBase {\n readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly runId: string;\n readonly revision: number; readonly commandId: string; readonly signal: AbortSignal;\n}\nexport interface WorkflowControlTransport {\n readonly cancel: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n readonly approve: (input: WorkflowControlBase & { readonly nodeId: string; readonly approvalDigest: string;\n readonly childRunId: string | null }) => Promise<WorkflowControlResult>;\n}\n/** Durable signal delivery remains an explicit adapter boundary so each workflow format owns persistence and idempotency. */\nexport interface WorkflowSignalTransport {\n readonly deliver: (input: WorkflowControlBase & { readonly signalId: string; readonly signalName: string;\n readonly value: JsonValue }) => Promise<WorkflowControlResult>;\n}\n/** Requests durable continuation without granting authority to force a waiting gate or replay an uncertain effect. */\nexport interface WorkflowResumeTransport {\n readonly resume: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n}\n/** Requests a quiescent durable operator pause; it never interrupts an in-flight effect or cancels a run. */\nexport interface WorkflowPauseTransport {\n readonly pause: (input: WorkflowControlBase) => Promise<WorkflowControlResult>;\n}\nexport interface WorkflowFleetHoldRecord { readonly held: boolean; readonly generation: number; readonly changedAtMs: number | null }\nexport type WorkflowFleetSweepOutcomeRecord =\n | { readonly target: string; readonly runId: string;\n readonly outcome: 'paused' | 'already_paused' | 'terminal' | 'busy' | 'resumed' | 'not_paused' | 'missing' | 'unregistered' }\n | { readonly target: string; readonly runId: string; readonly outcome: 'failed'; readonly code: string };\nexport interface WorkflowFleetSweepRecord { readonly outcomes: readonly WorkflowFleetSweepOutcomeRecord[]; readonly nextCursor: JsonObject | null }\ninterface WorkflowFleetBase { readonly scope: Scope; readonly agentIds: readonly string[]; readonly actorId: string; readonly signal: AbortSignal }\n/** Durable fleet hold and ledger-backed sweep for one verified scope. Mutations require the separate `workflows:fleet` capability. */\nexport interface WorkflowFleetTransport {\n readonly inspect: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly hold: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly release: (input: WorkflowFleetBase) => Promise<WorkflowFleetHoldRecord>;\n readonly sweep: (input: WorkflowFleetBase & { readonly phase: 'pause' | 'resume'; readonly cursor: JsonObject | null; readonly limit: number })\n => Promise<{ readonly status: 'applied'; readonly sweep: WorkflowFleetSweepRecord } | { readonly status: 'conflict' }>;\n}\n/** A reviewed migration the host offers for runs pinned to its source definition. */\nexport interface WorkflowMigrationRecord {\n readonly id: string; readonly description: string;\n readonly fromVersion: string; readonly toVersion: string; readonly fromDigest: string; readonly toDigest: string;\n}\n/** What a migration would do to one run, decided from the run's real state. */\nexport interface WorkflowMigrationPlanRecord {\n readonly migrationId: string; readonly format: string; readonly runId: string; readonly fromDigest: string; readonly toDigest: string;\n readonly entries: readonly { readonly action: 'keep' | 'update' | 'reset' | 'accept' | 'add' | 'remove'; readonly target?: string; readonly source?: string; readonly status?: string }[];\n readonly blockers: readonly { readonly node: string; readonly reason: string }[];\n readonly allowed: boolean;\n}\ninterface WorkflowMigrationBase { readonly scope: Scope; readonly agentIds: readonly string[]; readonly runId: string; readonly signal: AbortSignal }\n/**\n * In-place migration of paused runs to a new definition version. Listing and planning are reads; applying requires the\n * separate `workflows:migrate` capability, the run's exact revision and a stable command id.\n */\nexport interface WorkflowMigrationTransport {\n /** Migrations whose source is the run's pinned definition; null when the run is not visible to this identity. */\n readonly list: (input: WorkflowMigrationBase) => Promise<readonly WorkflowMigrationRecord[] | null>;\n /** Dry run: the plan for this run. Writes nothing. Null when the run or migration is not visible. */\n readonly plan: (input: WorkflowMigrationBase & { readonly migrationId: string }) => Promise<WorkflowMigrationPlanRecord | null>;\n readonly apply: (input: WorkflowControlBase & { readonly migrationId: string }) => Promise<\n | { readonly status: 'applied'; readonly plan: WorkflowMigrationPlanRecord; readonly workflow: WorkflowViewRecord }\n | { readonly status: 'refused'; readonly plan: WorkflowMigrationPlanRecord }\n | { readonly status: 'conflict' } | { readonly status: 'not_found' }>;\n}\nexport interface SubmissionJournal {\n readonly claim: (input: { readonly owner: string; readonly key: string; readonly digest: string; readonly signal: AbortSignal })\n => Promise<{ readonly status: 'claimed' } | { readonly status: 'existing'; readonly digest: string }>;\n}\nexport type RunRecordStatus = 'running' | 'waiting' | 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';\n/** One durable agent run as every replica sees it. `snapshot` is the run's inspection; `outcome` is present once it ended. */\nexport interface RunRecordView {\n readonly runId: string; readonly agentId: string; readonly replicaId: string; readonly status: RunRecordStatus;\n readonly leaseExpiresAtMs: number; readonly cancelRequested: boolean; readonly lastSequence: number;\n readonly snapshot: JsonObject; readonly outcome?: JsonObject;\n}\nexport type RunRecordClaim = { readonly status: 'claimed' }\n | { readonly status: 'existing'; readonly digest: string; readonly runId: string | null; readonly claimedAtMs: number };\n/**\n * Durable agent run records shared by every server replica (`createAggregateRunRecords` in mayura/storage-contracts).\n * The replica that accepts a run executes it and is its only writer: it records metadata events, snapshots and the\n * outcome, and renews a lease. Any replica can read a run, stream its recorded events and request its cancellation,\n * which the owner observes. A run whose owner stops renewing its lease is settled as `outcome_unknown` by the next reader.\n */\nexport interface RunRecordStore {\n /** Atomically claim a submission key; an existing claim reports its digest and, once started, its run. */\n claim(input: { readonly owner: string; readonly key: string; readonly digest: string; readonly replicaId: string; readonly nowMs: number;\n readonly signal: AbortSignal }): Promise<RunRecordClaim>;\n /** Give up a claim whose run never started, so the same key can be submitted again. */\n release(input: { readonly owner: string; readonly key: string; readonly replicaId: string; readonly signal: AbortSignal }): Promise<void>;\n /** Create the run's record and bind the submission key to it. */\n start(input: { readonly owner: string; readonly key: string; readonly runId: string; readonly agentId: string; readonly replicaId: string;\n readonly leaseExpiresAtMs: number; readonly snapshot: JsonObject; readonly signal: AbortSignal }): Promise<void>;\n /** Owner only: append events in order, replace the snapshot, renew the lease and, last, record the outcome. */\n update(input: { readonly owner: string; readonly runId: string; readonly replicaId: string; readonly events: readonly RunEvent[];\n readonly snapshot: JsonObject; readonly leaseExpiresAtMs: number; readonly outcome?: JsonObject; readonly signal: AbortSignal })\n : Promise<{ readonly status: 'written'; readonly cancelRequested: boolean } | { readonly status: 'lost' }>;\n /** Atomically transfer a waiting record to a resuming replica; required with threads and durable run records. */\n resume?(input: { readonly owner: string; readonly runId: string; readonly replicaId: string; readonly leaseExpiresAtMs: number;\n readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n read(input: { readonly owner: string; readonly runId: string; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n /** Recorded events after a run sequence, in order; a missing range is one `events.gap`. */\n events(input: { readonly owner: string; readonly runId: string; readonly after: number; readonly limit: number; readonly signal: AbortSignal }): Promise<readonly RunEvent[]>;\n requestCancel(input: { readonly owner: string; readonly runId: string; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n /** Settle a running record whose lease expired before `nowMs` as `outcome_unknown`; returns the current record. */\n abandon(input: { readonly owner: string; readonly runId: string; readonly nowMs: number; readonly signal: AbortSignal }): Promise<RunRecordView | null>;\n}\nexport interface RegisteredAgent {\n readonly agent: AgentDefinition;\n readonly permissions: Permissions;\n readonly limits?: RuntimeLimits;\n}\nexport interface AgentServerOptions {\n readonly publicOrigin: string;\n /**\n * Browser origins other than `publicOrigin` allowed to call the API. A page served from `publicOrigin` itself is\n * always allowed.\n */\n readonly allowedOrigins?: readonly string[];\n /**\n * Set when a trusted reverse proxy or your own HTTP framework routes requests to this handler under another host or\n * scheme (for example `http://app:3000` inside a cluster). The request URL's scheme, host and port are then ignored\n * and `publicOrigin` is authoritative; only its path and query are used. Host and X-Forwarded-* headers are never\n * read. Without it, a request whose URL origin differs from `publicOrigin` is refused with INVALID_DESTINATION.\n */\n readonly mounted?: boolean;\n readonly agents: readonly RegisteredAgent[];\n /** Opt-in fine-grained HTTP enforcement in addition to token capabilities and scoped adapters. Server owns its lifecycle. */\n readonly authorization?: ServerAuthorizationOptions;\n /** Expose only a content-free process liveness response at GET /healthz. */\n readonly publicLiveness?: boolean;\n /** Serve the read-only local inspector at GET /inspector. Its static assets contain no data; every read is authenticated. */\n readonly inspector?: boolean;\n /** Access-controlled readiness checks. Credentials and exception details must remain inside callbacks. */\n readonly healthChecks?: readonly HealthCheck[];\n readonly humanRequests?: HumanRequestTransport;\n readonly workflowViews?: WorkflowViewTransport;\n readonly workflowIndex?: WorkflowIndexTransport;\n readonly workflowControls?: WorkflowControlTransport;\n readonly workflowSignals?: WorkflowSignalTransport;\n readonly workflowResumes?: WorkflowResumeTransport;\n readonly workflowPauses?: WorkflowPauseTransport;\n readonly workflowFleet?: WorkflowFleetTransport;\n readonly workflowMigrations?: WorkflowMigrationTransport;\n /**\n * Durable claim of every run submission key. Without it, idempotency lasts only as long as the process: a retry\n * after a restart could start a duplicate run. With it, such a retry is refused with SUBMISSION_OUTCOME_UNKNOWN.\n */\n readonly submissionJournal?: SubmissionJournal;\n /**\n * Resolve `{ artifact: reference }` media in a run submission: read the stored bytes for the caller's scope and\n * return them as media, for example `(reference, scope) => mediaFromArtifact(store, reference, scope)` with\n * `mediaFromArtifact` from mayura/artifacts. Without it, artifact media is refused with NOT_ENABLED.\n */\n readonly mediaArtifacts?: (reference: JsonObject, scope: Scope, signal: AbortSignal) => Promise<Media>;\n /**\n * Durable agent run records (`createAggregateRunRecords(store)` from mayura/storage-contracts). With them, several\n * replicas sharing one store can each read, stream, wait for and cancel any run, and a run whose replica dies ends as\n * `outcome_unknown` after its lease instead of disappearing. They also make submission idempotency durable.\n */\n readonly runRecords?: RunRecordStore;\n /** Scoped conversation routes, thread-bound submissions and durable approval checkpoints. Initialize storage first. */\n /** Explicit service policy and optional process scheduler for saved approvals and recording outboxes. */\n readonly conversationRecovery?: ConversationRecoveryOptions;\n /** Host-only operator controls for expired claimed approvals. */\n readonly approvalReconciliation?: ApprovalReconciliationOptions;\n /** Opt-in paid summarization with host-pinned agents, explicit grants and per-command ceilings. */\n readonly threadCompaction?: ServerThreadCompactionOptions;\n readonly threads?: { readonly store: ThreadsOptions['store'] & { readonly runCheckpoints: RunCheckpointStore } };\n /**\n * Where an agent run executes. `'background'` (the default): the run keeps going in this process after\n * `POST /v1/runs` answers 202. `'request'`: the run finishes, and its outcome is recorded, before that 202 is sent, so\n * nothing runs once the response is out; use it where the platform may stop or freeze the process after it responds,\n * such as serverless functions. It requires `runRecords`, so any instance can serve the run's result and events\n * afterwards. The submission waits up to the agent's `limits.maxDurationMs` (60 s unless set) plus\n * `requestTimeoutMs`: keep that under the platform's time limit, and give clients a `requestTimeoutMs` above it.\n */\n readonly runExecution?: 'background' | 'request';\n /** Verify the token using trusted application authentication; never trust token claims without verification. */\n readonly authenticate: (request: { readonly token: string; readonly signal: AbortSignal }) => Promise<ServerIdentity | null>;\n readonly limits?: {\n readonly maxRuns?: number; readonly maxRuntimes?: number; readonly maxRequests?: number;\n readonly maxStreams?: number; readonly maxBodyBytes?: number; readonly maxResponseBytes?: number;\n /**\n * The body limit of a run submission when a registered agent accepts media (images and PDFs are sent as base64,\n * about a third larger than their bytes). Default 16 MiB; other requests keep maxBodyBytes.\n */\n readonly maxMediaBodyBytes?: number;\n readonly maxHealthOperations?: number; readonly maxHumanOperations?: number; readonly maxWorkflowOperations?: number;\n readonly requestTimeoutMs?: number; readonly streamDurationMs?: number;\n /**\n * How long a finished run stays readable (result, events and same-key resubmission) before the server releases\n * it, and with it any runtime no retained run still uses. Default 10 minutes. At `maxRuns` or `maxRuntimes` a\n * finished run whose outcome its owner has already read (a run read with its outcome, or an event stream read to\n * the end) is released early, oldest first; a result nobody has read is kept for the full period.\n * After release, a same-key resubmission is answered `410 RUN_EXPIRED` (or `409 IDEMPOTENCY_CONFLICT` for a\n * different payload) from a bounded tombstone rather than starting a second run. Configure `submissionJournal`\n * for idempotency that also survives restarts and tombstone expiry.\n */\n readonly runRetentionMs?: number;\n /** With `runRecords`: how long a run's owner lease lasts without renewal (default 30 s; renewed every third of it). */\n readonly runLeaseMs?: number;\n /** With `runRecords`: how often owners check for cancel requests and other replicas poll for new events (default 500 ms). */\n readonly runRecordPollMs?: number;\n /** How often an idle event stream sends a comment so proxies and clients see it is alive (default 15 s). */\n readonly streamHeartbeatMs?: number;\n };\n}\nexport interface AgentServer {\n /** Host-only audit counters; no resource or principal data. Null when authorization is disabled. */\n inspectAuthorizationAudit(): AuthorizationAuditSnapshot | null;\n /** Drain admitted audit deliveries to their deadlines before host shutdown. */\n flushAuthorizationAudit(): Promise<void>;\n fetch(request: Request): Promise<Response>;\n /** Trusted host/cron entry point, never an HTTP/browser route. Requires conversationRecovery configuration. */\n recoverConversations(options?: ConversationRecoveryRequest): Promise<ConversationRecoveryReport>;\n inspectClaimedApproval(request: ClaimedApprovalRequest): Promise<ClaimedApprovalView>;\n reconcileClaimedApproval(request: ReconcileClaimedApprovalRequest): Promise<ApprovalReconciliationResult>;\n close(): Promise<void>;\n}\n/** A submission another replica already started: answered with its run id. */\ntype Replay = { readonly replay: string; readonly digest: string };\ninterface Entry {\n readonly owner: string; readonly agentId: string; readonly digest: string;\n readonly handle: RunHandle<unknown>; readonly runtime: Runtime;\n readonly runtimeKey: string; readonly submissionKey: string;\n outcome?: Outcome<unknown>;\n /** Run event sequence before this replica resumed the run. */\n eventOffset?: number;\n observedAfter?: number;\n finished?: boolean;\n /** With run records: settles once the owner has recorded the outcome (or lost the run, or the server closed). */\n persisted?: Promise<void>;\n /** The owner has received the outcome; the run may be released early under capacity pressure. */\n collected?: boolean;\n /** Another replica settled this durable run after its lease lapsed; its record, not this entry, is authoritative. */\n lost?: boolean;\n}\n/** Machine-useful, content-free facts an error may carry next to its code and message. */\ntype FailureDetails = { readonly retryAfterMs?: number; readonly capability?: string; readonly option?: string; readonly limitBytes?: number;\n readonly currentRevision?: number; readonly message?: string };\nclass HttpFailure extends Error {\n constructor(readonly status: number, readonly code: ServerErrorCode, readonly details: FailureDetails = {}) { super(code); }\n}\n/**\n * Every error code the server answers with, and the fixed message that explains it. Messages never contain request\n * data, credentials or adapter text: only what happened and what to do. docs/guides/server-and-client.md lists them.\n */\nconst errorMessages = Object.freeze({\n AUTHORIZATION_DENIED: 'The operation is not authorized.',\n THREAD_NOT_FOUND: 'No thread with this id is visible in this access token scope.',\n THREAD_CONFLICT: 'The thread changed or has an unfinished turn. Read it again before retrying.',\n CONVERSATION_UNAVAILABLE: 'Conversation storage is unavailable. Retry shortly.',\n TOOL_CONTINUATION_CONFLICT: 'The external result checkpoint changed, expired or was already consumed. Inspect the existing run; do not repeat execution.',\n APPROVAL_CONFLICT: 'The approval expired, was already answered, or no longer matches the waiting run. Read the run again.',\n AUTH_REQUIRED: 'Send an Authorization: Bearer <token> header with an access token.',\n AUTH_INVALID: 'The access token was not accepted. Get a new token and try again.',\n AUTH_EXPIRED: 'The identity for this access token has expired. Get a new token and try again.',\n AUTH_UNAVAILABLE: 'The server could not verify the access token right now. Retry shortly.',\n AUTH_LIMIT: 'Too many token verifications are in progress on this server. Retry after retryAfterMs.',\n IDENTITY_INVALID: 'The server\\'s authenticate callback returned an identity Mayura cannot use: principalId, projectId and agent ids must be 1-128 letters, digits, \".\", \"_\", \"/\" or \"-\" starting with a letter or digit, capabilities must be known, and expiresAtMs must be in the future. This is a server configuration problem.',\n CAPABILITY_REQUIRED: 'The access token lacks the capability this request needs (see capability).',\n ORIGIN_DENIED: 'Browser requests from this origin are not allowed. Add the page\\'s exact origin to the server\\'s allowedOrigins.',\n PREFLIGHT_DENIED: 'The CORS preflight asked for a method or header this API does not accept. Use GET or POST, or DELETE for a thread, with only Authorization, Content-Type and Idempotency-Key.',\n INVALID_DESTINATION: 'The request URL\\'s origin is not this server\\'s publicOrigin. Send requests to the public origin, or set mounted: true when a trusted proxy or framework routes requests to this handler.',\n INVALID_QUERY: 'The query string has a parameter this route does not accept, or repeats one.',\n INVALID_CURSOR: 'The after or limit query parameter is invalid. Use a cursor the server returned and a limit from 1 to 100.',\n INVALID_JSON: 'The request body is not valid UTF-8 JSON.',\n INVALID_REQUEST: 'The request body does not have exactly the fields and types this route expects.',\n INVALID_MEDIA: 'The run\\'s media was refused (see message): each item needs a supported mediaType and base64 data, an https url or an artifact reference, and the agent must accept it within its limits.',\n IDEMPOTENCY_KEY_REQUIRED: 'POST /v1/runs needs an Idempotency-Key header of 1-128 letters, digits, \".\", \"_\", \":\" or \"-\" starting with a letter or digit. Use one key per user action and reuse it only to retry that action.',\n UNSUPPORTED_MEDIA_TYPE: 'Send the request body as Content-Type: application/json, without Content-Encoding.',\n BODY_TOO_LARGE: 'The request body is larger than the server accepts (see limitBytes).',\n ROUTE_NOT_FOUND: 'This server has no such API route.',\n METHOD_NOT_ALLOWED: 'This API route does not accept this HTTP method.',\n NOT_ENABLED: 'This server does not offer this API: the operator has not configured it (see option).',\n AGENT_NOT_FOUND: 'No agent with this id is registered on this server and visible to this access token.',\n RUN_NOT_FOUND: 'No run with this id is visible to this access token. Finished runs are released after runRetentionMs, and without durable run records only the replica that started a run can read it.',\n HUMAN_REQUEST_NOT_FOUND: 'No human request with this id is visible to this access token.',\n WORKFLOW_RUN_NOT_FOUND: 'No workflow run with this id is visible to this access token.',\n MIGRATION_NOT_FOUND: 'No migration with this id is offered for this workflow run.',\n REQUEST_TIMEOUT: 'The request did not finish within the server\\'s time limit, or the caller cancelled it. It may or may not have taken effect: retry with the same idempotency key or command id.',\n IDEMPOTENCY_CONFLICT: 'This Idempotency-Key was already used for a different agent or input. Use a new key for a new action.',\n SUBMISSION_IN_PROGRESS: 'Another server replica is still starting the run for this Idempotency-Key. Retry with the same key after retryAfterMs.',\n SUBMISSION_OUTCOME_UNKNOWN: 'This Idempotency-Key was claimed by a submission whose run can no longer be found, for example after a server restart. Mayura cannot tell whether it ran, so it will not start another. Check your own records before using a new key.',\n RUN_EXPIRED: 'The run for this Idempotency-Key finished and was released after runRetentionMs. Its result is no longer available; use a new key to run again.',\n WORKFLOW_CONFLICT: 'The workflow run changed since it was read, or is not in a state that accepts this command. Read the run again and decide with its current revision.',\n FLEET_CONFLICT: 'The fleet hold is not in the state this sweep needs: hold the fleet before a pause sweep and release it before a resume sweep.',\n MIGRATION_REFUSED: 'The migration has blockers for this run (see plan). Plan it again after resolving them.',\n REQUEST_LIMIT: 'The server is handling as many requests as it allows (maxRequests). Retry after retryAfterMs.',\n STREAM_LIMIT: 'The server has as many open event streams as it allows (maxStreams). Retry after retryAfterMs.',\n RUN_LIMIT: 'The server holds as many runs as it allows (maxRuns). Retry after retryAfterMs.',\n RUNTIME_LIMIT: 'The server holds as many runtimes as it allows (maxRuntimes). Retry after retryAfterMs.',\n HUMAN_LIMIT: 'Too many human request operations are in progress (maxHumanOperations). Retry after retryAfterMs.',\n WORKFLOW_LIMIT: 'Too many workflow operations are in progress (maxWorkflowOperations). Retry after retryAfterMs.',\n SERVER_CLOSED: 'The server is shutting down. Retry against another replica.',\n SERVICE_UNAVAILABLE: 'The server could not complete the request right now. Retry shortly.',\n SUBMISSION_JOURNAL_UNAVAILABLE: 'The submission could not be recorded in durable storage, so no run was started. Retry with the same Idempotency-Key.',\n RUN_RECORDS_UNAVAILABLE: 'Durable run records could not be read or written right now. Retry shortly; a submission refused with this code was cancelled before it could do work.',\n HUMAN_UNAVAILABLE: 'The human request service failed or is unavailable. Retry shortly.',\n HUMAN_TRANSPORT_INVALID: 'The server\\'s human request adapter returned data Mayura could not validate. This is a server problem.',\n WORKFLOW_UNAVAILABLE: 'The workflow service failed or is unavailable. Retry shortly.',\n WORKFLOW_TRANSPORT_INVALID: 'The server\\'s workflow adapter returned data Mayura could not validate. This is a server problem.',\n RESPONSE_TOO_LARGE: 'The response would be larger than the server allows (maxResponseBytes).',\n OBSERVATION_FAILED: 'The server could not follow this run\\'s events from the requested position. Read the run, then reconnect from a sequence it has sent.',\n THREAD_COMPACTION_NOT_FOUND: 'No such compaction command in this thread.',\n THREAD_COMPACTION_LIMIT: 'Compaction exceeded an admission or source limit. Inspect the command before taking further action.',\n THREAD_COMPACTION_CANCELLED: 'Compaction was cancelled. Inspect the command to determine whether a summary committed.',\n INTERNAL_ERROR: 'The server failed unexpectedly. The request may or may not have taken effect: retry with the same idempotency key or command id.',\n} satisfies Record<string, string>);\nexport type ServerErrorCode = keyof typeof errorMessages;\n/** Codes a client may retry after the hinted delay; the server sends retryAfterMs and a Retry-After header with them. */\nconst retryable: Readonly<Partial<Record<ServerErrorCode, number>>> = Object.freeze({\n AUTH_LIMIT: 1_000, REQUEST_LIMIT: 1_000, STREAM_LIMIT: 1_000, RUN_LIMIT: 1_000, RUNTIME_LIMIT: 1_000, HUMAN_LIMIT: 1_000, WORKFLOW_LIMIT: 1_000,\n SUBMISSION_IN_PROGRESS: 1_000, AUTH_UNAVAILABLE: 2_000, SERVER_CLOSED: 1_000, SERVICE_UNAVAILABLE: 2_000, SUBMISSION_JOURNAL_UNAVAILABLE: 2_000,\n CONVERSATION_UNAVAILABLE: 2_000, RUN_RECORDS_UNAVAILABLE: 2_000, HUMAN_UNAVAILABLE: 2_000, WORKFLOW_UNAVAILABLE: 2_000,\n});\nconst identifier = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/;\nconst capabilities: readonly ServerIdentity['capabilities'][number][] = Object.freeze(['runs:read', 'runs:submit', 'runs:cancel', 'runs:approve', 'runs:resume', 'threads:read', 'threads:write', 'threads:delete', 'threads:compact', 'threads:import', 'operations:read',\n 'humans:read', 'humans:respond', 'workflows:read', 'workflows:control', 'workflows:fleet', 'workflows:migrate']);\nconst runStatuses = new Set(['running', 'waiting', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\n/** Replica clocks may disagree by up to this much (or one lease, if shorter); a lease counts as lapsed only after it. */\nconst maxLeaseSkewMs = 5_000;\nconst commandFields = 'commandId must be 1-128 letters, digits, \".\", \"_\", \"/\" or \"-\" starting with a letter or digit, and revision a positive integer.';\nconst humanIdentifier = /^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$/;\nconst encoder = new TextEncoder();\nconst workflowKinds = Object.freeze({ 2: new Set(['tool', 'join']), 3: new Set(['tool', 'join', 'wait']),\n 4: new Set(['tool', 'join', 'child']), 5: new Set(['tool', 'join', 'human', 'timer', 'signal']) });\nconst workflowStatuses = new Set(['running', 'waiting', 'paused', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\nconst workflowStepStatuses = new Set(['pending', 'waiting', 'approved', 'dispatching', 'succeeded', 'failed', 'blocked', 'unknown', 'skipped', 'timed_out']);\nconst approvalRecord = (value: JsonValue | undefined): boolean => {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;\n const keys = Object.keys(value); const subject = value['subject'];\n return keys.every(key => ['digest', 'expiresAtMs', 'subject'].includes(key)) && typeof value['digest'] === 'string' && /^[a-f0-9]{64}$/.test(value['digest'])\n && typeof value['expiresAtMs'] === 'number' && Number.isSafeInteger(value['expiresAtMs']) && value['expiresAtMs'] > 0\n && (subject === undefined || (subject !== null && typeof subject === 'object' && !Array.isArray(subject)\n && Object.keys(subject).length === 3 && Object.hasOwn(subject, 'input')\n && typeof subject['toolId'] === 'string' && identifier.test(subject['toolId'])\n && typeof subject['toolVersion'] === 'string' && identifier.test(subject['toolVersion'])));\n};\nfunction object(value: unknown, maxBytes = 1_048_576): JsonObject {\n let copy: JsonValue;\n try { copy = jsonValue(value, { maxBytes }); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (copy === null || Array.isArray(copy) || typeof copy !== 'object') throw new HttpFailure(400, 'INVALID_REQUEST');\n return copy;\n}\n/** Exact body fields. The message names the expected fields (API facts, never the request's own data). */\nfunction exact(value: JsonObject, keys: readonly string[]): void {\n if (Object.keys(value).length !== keys.length || keys.some(key => !(key in value))) {\n throw new HttpFailure(400, 'INVALID_REQUEST', { message: keys.length === 0 ? 'Send an empty JSON object as the body.'\n : `Send a JSON object with exactly these fields: ${keys.join(', ')}.` });\n }\n}\nfunction canonical(value: JsonValue): string {\n if (value === null || typeof value !== 'object') return JSON.stringify(value);\n return Array.isArray(value) ? `[${value.map(canonical).join(',')}]`\n : `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${canonical(value[key]!)}`).join(',')}}`;\n}\nfunction origin(value: string): string {\n const url = new URL(value);\n if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw new Error('Invalid server origin.');\n if (url.protocol === 'http:' && !['localhost', '127.0.0.1', '[::1]'].includes(url.hostname)) throw new Error('Non-loopback origins require HTTPS.');\n return url.origin;\n}\nfunction assertActive(signal: AbortSignal): void { if (signal.aborted) throw new HttpFailure(408, 'REQUEST_TIMEOUT'); }\nfunction workflowExact(value: JsonObject, keys: readonly string[]): void {\n if (Object.keys(value).length !== keys.length || keys.some(key => !Object.hasOwn(value, key))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n}\nfunction workflowRecord(value: unknown, expectedRunId: string): WorkflowViewRecord {\n let raw: JsonObject;\n try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['format', 'definitionId', 'definitionVersion', 'runId', 'revision', 'status', 'nodes', 'steps', ...(Object.hasOwn(raw, 'maxNodes') ? ['maxNodes'] : [])]);\n let maximum: number;\n try { maximum = workflowNodeLimit(raw['maxNodes']); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n const format = raw['format']; const nodes = raw['nodes']; const steps = raw['steps'];\n if (![2, 3, 4, 5].includes(format as number) || typeof raw['definitionId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(raw['definitionId'])\n || typeof raw['definitionVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['definitionVersion'])\n || raw['runId'] !== expectedRunId || typeof raw['revision'] !== 'number' || !Number.isSafeInteger(raw['revision']) || raw['revision'] < 1\n || typeof raw['status'] !== 'string' || !workflowStatuses.has(raw['status']) || !Array.isArray(nodes) || nodes.length < 1 || nodes.length > maximum\n || !Array.isArray(steps) || steps.length !== nodes.length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const admittedKinds = workflowKinds[format as keyof typeof workflowKinds]; const graph = new Map<string, readonly string[]>(); const nodeKinds = new Map<string, string>(); let edges = 0;\n for (const candidate of nodes) {\n let node: JsonObject; try { node = object(candidate, 32_768); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(node, ['id', 'kind', 'dependsOn']);\n if (typeof node['id'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(node['id']) || graph.has(node['id'])\n || typeof node['kind'] !== 'string' || !admittedKinds.has(node['kind']) || !Array.isArray(node['dependsOn']) || node['dependsOn'].length > maximum - 1\n || node['dependsOn'].some(item => typeof item !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(item))\n || new Set(node['dependsOn']).size !== node['dependsOn'].length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n edges += node['dependsOn'].length; if (edges > (Number.isFinite(maximum) ? maximum : nodes.length) * 4) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n graph.set(node['id'], node['dependsOn'] as readonly string[]); nodeKinds.set(node['id'], node['kind']);\n }\n for (const [id, dependencies] of graph) if (dependencies.some(dependency => dependency === id || !graph.has(dependency))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const seen = new Set<string>();\n for (const candidate of steps) {\n let step: JsonObject; try { step = object(candidate, 16_384); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n const allowed = ['id', 'kind', 'status', 'childRunId', 'approval'];\n if (Object.keys(step).some(key => !allowed.includes(key)) || !['id', 'kind', 'status'].every(key => Object.hasOwn(step, key)) || typeof step['id'] !== 'string'\n || seen.has(step['id']) || step['kind'] !== nodeKinds.get(step['id']) || typeof step['status'] !== 'string' || !workflowStepStatuses.has(step['status'])\n || (step['kind'] === 'human' && !['pending', 'waiting', 'succeeded', 'timed_out', 'skipped'].includes(step['status']))\n || (step['kind'] === 'timer' && !['pending', 'waiting', 'succeeded', 'skipped'].includes(step['status']))\n || (step['kind'] === 'signal' && !['pending', 'waiting', 'succeeded', 'timed_out', 'skipped'].includes(step['status']))\n || (step['status'] === 'timed_out' && step['kind'] !== 'human' && step['kind'] !== 'signal')\n || (step['childRunId'] !== undefined && (step['kind'] !== 'child' || typeof step['childRunId'] !== 'string' || !/^[a-f0-9]{64}$/.test(step['childRunId'])))\n || (step['approval'] !== undefined && (step['kind'] !== 'tool' || step['status'] !== 'waiting' || !approvalRecord(step['approval'])))\n ) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n seen.add(step['id']);\n }\n if (seen.size !== graph.size) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const remaining = new Map([...graph].map(([id, dependencies]) => [id, dependencies.length])); const dependents = new Map<string, string[]>();\n for (const [id, dependencies] of graph) for (const dependency of dependencies) { const list = dependents.get(dependency) ?? []; list.push(id); dependents.set(dependency, list); }\n const queue = [...remaining].filter(([, count]) => count === 0).map(([id]) => id);\n for (let cursor = 0; cursor < queue.length; cursor++) for (const dependent of dependents.get(queue[cursor]!) ?? []) {\n const count = remaining.get(dependent)! - 1; remaining.set(dependent, count); if (count === 0) queue.push(dependent);\n }\n if (queue.length !== graph.size) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowViewRecord;\n}\nconst fleetOutcomes = new Set(['paused', 'already_paused', 'terminal', 'busy', 'resumed', 'not_paused', 'missing', 'unregistered']);\nfunction fleetHold(value: unknown): WorkflowFleetHoldRecord {\n let raw: JsonObject; try { raw = object(value, 1_024); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['held', 'generation', 'changedAtMs']);\n const { held, generation, changedAtMs } = raw;\n if (typeof held !== 'boolean' || typeof generation !== 'number' || !Number.isSafeInteger(generation) || generation < (held ? 1 : 0)\n || (changedAtMs !== null && (typeof changedAtMs !== 'number' || !Number.isSafeInteger(changedAtMs) || changedAtMs < 0)))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return Object.freeze({ held, generation, changedAtMs: changedAtMs as number | null });\n}\n/** Sweep pages are content-free: target names, run identities and fixed outcome codes only. */\nfunction fleetSweep(value: unknown, limit: number): WorkflowFleetSweepRecord {\n let raw: JsonObject; try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['outcomes', 'nextCursor']);\n if (!Array.isArray(raw['outcomes']) || raw['outcomes'].length > limit) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const outcomes = raw['outcomes'].map(entry => {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const failed = entry['outcome'] === 'failed'; workflowExact(entry, failed ? ['target', 'runId', 'outcome', 'code'] : ['target', 'runId', 'outcome']);\n if (typeof entry['target'] !== 'string' || !/^[a-z][a-z0-9-]{0,31}$/.test(entry['target']) || typeof entry['runId'] !== 'string'\n || !/^[a-f0-9]{64}$/.test(entry['runId']) || (failed ? typeof entry['code'] !== 'string' || !/^[A-Z][A-Z_]{0,39}$/.test(entry['code'])\n : !fleetOutcomes.has(String(entry['outcome'])))) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return Object.freeze({ ...entry }) as unknown as WorkflowFleetSweepOutcomeRecord;\n });\n let nextCursor: JsonObject | null = null;\n if (raw['nextCursor'] !== null) { try { nextCursor = object(raw['nextCursor'], 4_096); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); } }\n return Object.freeze({ outcomes: Object.freeze(outcomes), nextCursor });\n}\nconst migrationIdPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;\nconst migrationActions = new Set(['keep', 'update', 'reset', 'accept', 'add', 'remove']);\nconst nodeIdPattern = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;\nconst shortText = (value: unknown, maximum: number): boolean => typeof value === 'string' && value.length <= maximum && !/[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F]/.test(value);\nfunction migrationRecord(value: unknown): WorkflowMigrationRecord {\n let raw: JsonObject; try { raw = object(value, 8_192); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['id', 'description', 'fromVersion', 'toVersion', 'fromDigest', 'toDigest']);\n if (typeof raw['id'] !== 'string' || !migrationIdPattern.test(raw['id']) || !shortText(raw['description'], 2_048)\n || typeof raw['fromVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['fromVersion'])\n || typeof raw['toVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['toVersion'])\n || typeof raw['fromDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['fromDigest'])\n || typeof raw['toDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['toDigest']) || raw['fromDigest'] === raw['toDigest']) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowMigrationRecord;\n}\nfunction migrationPlan(value: unknown, runId: string, migrationId: string): WorkflowMigrationPlanRecord {\n let raw: JsonObject; try { raw = object(value, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['migrationId', 'format', 'runId', 'fromDigest', 'toDigest', 'entries', 'blockers', 'allowed']);\n const entries = raw['entries']; const blockers = raw['blockers'];\n if (raw['migrationId'] !== migrationId || raw['runId'] !== runId || typeof raw['format'] !== 'string' || !/^[a-z0-9-]{1,32}$/.test(raw['format'])\n || typeof raw['fromDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['fromDigest']) || typeof raw['toDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['toDigest'])\n || typeof raw['allowed'] !== 'boolean' || !Array.isArray(entries) || entries.length > 512 || !Array.isArray(blockers) || blockers.length > 512\n || raw['allowed'] !== (blockers.length === 0)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n for (const entry of entries) {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n if (Object.keys(entry).some(key => !['action', 'target', 'source', 'status'].includes(key)) || !migrationActions.has(String(entry['action']))\n || (entry['target'] !== undefined && (typeof entry['target'] !== 'string' || !nodeIdPattern.test(entry['target'])))\n || (entry['source'] !== undefined && (typeof entry['source'] !== 'string' || !nodeIdPattern.test(entry['source'])))\n || (entry['status'] !== undefined && (typeof entry['status'] !== 'string' || !/^[a-z_]{1,32}$/.test(entry['status'])))\n || (entry['target'] === undefined && entry['source'] === undefined)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n }\n for (const blocker of blockers) {\n if (blocker === null || typeof blocker !== 'object' || Array.isArray(blocker)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n workflowExact(blocker, ['node', 'reason']);\n if (typeof blocker['node'] !== 'string' || !(blocker['node'] === '*' || nodeIdPattern.test(blocker['node'])) || !shortText(blocker['reason'], 512) || !blocker['reason'])\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n }\n return freezeJson(raw) as unknown as WorkflowMigrationPlanRecord;\n}\nconst settledStatuses = new Set(['succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown']);\nfunction workflowIndexRecord(value: unknown, settled = false): WorkflowIndexRecord {\n let raw: JsonObject; try { raw = object(value, 4_096); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(raw, ['format', 'definitionId', 'definitionVersion', 'runId', 'revision', 'status', ...(settled ? ['settledAtMs'] : [])]);\n if (settled && (!settledStatuses.has(raw['status'] as string) || typeof raw['settledAtMs'] !== 'number' || !Number.isSafeInteger(raw['settledAtMs']) || raw['settledAtMs'] < 0))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n if (![2, 3, 4, 5].includes(raw['format'] as number) || typeof raw['definitionId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(raw['definitionId'])\n || typeof raw['definitionVersion'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/.test(raw['definitionVersion'])\n || typeof raw['runId'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['runId']) || typeof raw['revision'] !== 'number'\n || !Number.isSafeInteger(raw['revision']) || raw['revision'] < 1 || typeof raw['status'] !== 'string' || !workflowStatuses.has(raw['status']))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as WorkflowIndexRecord;\n}\nasync function bounded<T>(operation: PromiseLike<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void Promise.resolve(operation).catch(() => {}); throw new HttpFailure(408, 'REQUEST_TIMEOUT'); }\n assertActive(signal);\n return await new Promise<T>((resolve, reject) => {\n const abort = (): void => { cleanup(); reject(new HttpFailure(408, 'REQUEST_TIMEOUT')); };\n const cleanup = (): void => { signal.removeEventListener('abort', abort); };\n signal.addEventListener('abort', abort, { once: true });\n Promise.resolve(operation).then(value => { cleanup(); resolve(value); }, (error: unknown) => { cleanup(); reject(error instanceof HttpFailure ? error : new HttpFailure(503, 'SERVICE_UNAVAILABLE')); });\n if (signal.aborted) abort();\n });\n}\n\n/** Authenticated Fetch facade. Hosting, TLS, durable execution, and token verification remain explicit. */\nexport function createAgentServer(options: AgentServerOptions): AgentServer {\n const publicOrigin = origin(options.publicOrigin);\n const origins = new Set((options.allowedOrigins ?? []).map(origin));\n if (typeof options.authenticate !== 'function' || !Array.isArray(options.agents) || options.agents.length > 256) throw new Error('Explicit authentication and a bounded agent registry are required.');\n const authenticate = options.authenticate;\n if (options.publicLiveness !== undefined && typeof options.publicLiveness !== 'boolean') throw new Error('Public liveness must be explicit.');\n if (options.inspector !== undefined && typeof options.inspector !== 'boolean') throw new Error('The inspector setting must be a boolean.');\n if (options.mounted !== undefined && typeof options.mounted !== 'boolean') throw new Error('The mounted setting must be a boolean.');\n const limits = Object.freeze({ maxRuns: 512, maxRuntimes: 128, maxRequests: 64, maxStreams: 64,\n maxBodyBytes: 1_048_576, maxMediaBodyBytes: 16_777_216, maxResponseBytes: 4_194_304, maxHealthOperations: 32, maxHumanOperations: 32, maxWorkflowOperations: 32,\n requestTimeoutMs: 10_000, streamDurationMs: 30_000, runRetentionMs: 600_000, runLeaseMs: 30_000, runRecordPollMs: 500, streamHeartbeatMs: 15_000, ...options.limits });\n if (Object.keys(limits).some(key => !['maxRuns', 'maxRuntimes', 'maxRequests', 'maxStreams', 'maxBodyBytes', 'maxMediaBodyBytes', 'maxResponseBytes', 'maxHealthOperations', 'maxHumanOperations', 'maxWorkflowOperations', 'requestTimeoutMs', 'streamDurationMs', 'runRetentionMs', 'runLeaseMs', 'runRecordPollMs', 'streamHeartbeatMs'].includes(key))) throw new Error('Unknown server limit.');\n for (const value of Object.values(limits)) if (!Number.isSafeInteger(value) || value < 1 || value > 16_777_216) throw new Error('Server limits must be bounded positive integers.');\n const healthChecks: readonly HealthCheck[] = (() => {\n const supplied = options.healthChecks ?? [];\n if (!Array.isArray(supplied) || supplied.length > 32) throw new Error('Health checks must be a bounded dense list.');\n const descriptors = Object.getOwnPropertyDescriptors(supplied);\n if (Reflect.ownKeys(descriptors).length !== supplied.length + 1) throw new Error('Health checks must be a bounded dense list.');\n const ids = new Set<string>(); const captured: HealthCheck[] = [];\n for (let index = 0; index < supplied.length; index++) {\n const entry = descriptors[String(index)];\n if (!entry || !('value' in entry) || entry.value === null || typeof entry.value !== 'object') throw new Error('Health checks must contain data entries.');\n const fields = Object.getOwnPropertyDescriptors(entry.value as object);\n if (Reflect.ownKeys(fields).some(key => !['id', 'check'].includes(String(key)))) throw new Error('Health checks contain unknown fields.');\n const id = fields['id']; const check = fields['check'];\n if (!id || !('value' in id) || typeof id.value !== 'string' || !identifier.test(id.value) || ids.has(id.value)\n || !check || !('value' in check) || typeof check.value !== 'function') throw new Error('Health checks require unique IDs and callbacks.');\n ids.add(id.value); captured.push(Object.freeze({ id: id.value, check: check.value as HealthCheck['check'] }));\n }\n return Object.freeze(captured);\n })();\n const humanRequests: HumanRequestTransport | undefined = (() => {\n if (options.humanRequests === undefined) return undefined;\n if (options.humanRequests === null || typeof options.humanRequests !== 'object') throw new Error('Human request transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.humanRequests);\n if (Reflect.ownKeys(fields).length !== 3 || ['list', 'inspect', 'respond'].some(key => !fields[key] || !('value' in fields[key]!) || typeof fields[key]!.value !== 'function')) throw new Error('Human request transport requires exact callbacks.');\n return Object.freeze({ list: fields['list']!.value, inspect: fields['inspect']!.value, respond: fields['respond']!.value }) as HumanRequestTransport;\n })();\n const workflowViews: WorkflowViewTransport | undefined = (() => {\n if (options.workflowViews === undefined) return undefined;\n if (options.workflowViews === null || typeof options.workflowViews !== 'object') throw new Error('Workflow view transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowViews);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['inspect'] || !('value' in fields['inspect']) || typeof fields['inspect'].value !== 'function')\n throw new Error('Workflow view transport requires one exact inspect callback.');\n return Object.freeze({ inspect: fields['inspect'].value as WorkflowViewTransport['inspect'] });\n })();\n const workflowIndex: WorkflowIndexTransport | undefined = (() => {\n if (options.workflowIndex === undefined) return undefined;\n if (options.workflowIndex === null || typeof options.workflowIndex !== 'object') throw new Error('Workflow index transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowIndex);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['list'] || !('value' in fields['list']) || typeof fields['list'].value !== 'function')\n throw new Error('Workflow index transport requires one exact list callback.');\n return Object.freeze({ list: fields['list'].value as WorkflowIndexTransport['list'] });\n })();\n const workflowControls: WorkflowControlTransport | undefined = (() => {\n if (options.workflowControls === undefined) return undefined;\n if (options.workflowControls === null || typeof options.workflowControls !== 'object') throw new Error('Workflow control transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowControls);\n if (Reflect.ownKeys(fields).length !== 2 || ['cancel', 'approve'].some(key => !fields[key] || !('value' in fields[key]!) || typeof fields[key]!.value !== 'function'))\n throw new Error('Workflow control transport requires exact cancel and approve callbacks.');\n return Object.freeze({ cancel: fields['cancel']!.value, approve: fields['approve']!.value }) as WorkflowControlTransport;\n })();\n const workflowSignals: WorkflowSignalTransport | undefined = (() => {\n if (options.workflowSignals === undefined) return undefined;\n if (options.workflowSignals === null || typeof options.workflowSignals !== 'object') throw new Error('Workflow signal transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowSignals);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['deliver'] || !('value' in fields['deliver']) || typeof fields['deliver'].value !== 'function')\n throw new Error('Workflow signal transport requires one exact deliver callback.');\n return Object.freeze({ deliver: fields['deliver'].value as WorkflowSignalTransport['deliver'] });\n })();\n const workflowResumes: WorkflowResumeTransport | undefined = (() => {\n if (options.workflowResumes === undefined) return undefined;\n if (options.workflowResumes === null || typeof options.workflowResumes !== 'object') throw new Error('Workflow resume transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowResumes);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['resume'] || !('value' in fields['resume']) || typeof fields['resume'].value !== 'function')\n throw new Error('Workflow resume transport requires one exact resume callback.');\n return Object.freeze({ resume: fields['resume'].value as WorkflowResumeTransport['resume'] });\n })();\n const workflowPauses: WorkflowPauseTransport | undefined = (() => {\n if (options.workflowPauses === undefined) return undefined;\n if (options.workflowPauses === null || typeof options.workflowPauses !== 'object') throw new Error('Workflow pause transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowPauses);\n if (Reflect.ownKeys(fields).length !== 1 || !fields['pause'] || !('value' in fields['pause']) || typeof fields['pause'].value !== 'function')\n throw new Error('Workflow pause transport requires one exact pause callback.');\n return Object.freeze({ pause: fields['pause'].value as WorkflowPauseTransport['pause'] });\n })();\n const workflowFleet: WorkflowFleetTransport | undefined = (() => {\n if (options.workflowFleet === undefined) return undefined;\n if (options.workflowFleet === null || typeof options.workflowFleet !== 'object') throw new Error('Workflow fleet transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowFleet); const names = ['inspect', 'hold', 'release', 'sweep'] as const;\n if (Reflect.ownKeys(fields).length !== names.length || names.some(name => !fields[name] || !('value' in fields[name]!) || typeof fields[name]!.value !== 'function'))\n throw new Error('Workflow fleet transport requires exact inspect, hold, release and sweep callbacks.');\n return Object.freeze(Object.fromEntries(names.map(name => [name, fields[name]!.value])) as unknown as WorkflowFleetTransport);\n })();\n const workflowMigrations: WorkflowMigrationTransport | undefined = (() => {\n if (options.workflowMigrations === undefined) return undefined;\n if (options.workflowMigrations === null || typeof options.workflowMigrations !== 'object') throw new Error('Workflow migration transport is invalid.');\n const fields = Object.getOwnPropertyDescriptors(options.workflowMigrations); const names = ['list', 'plan', 'apply'] as const;\n if (Reflect.ownKeys(fields).length !== names.length || names.some(name => !fields[name] || !('value' in fields[name]!) || typeof fields[name]!.value !== 'function'))\n throw new Error('Workflow migration transport requires exact list, plan and apply callbacks.');\n return Object.freeze(Object.fromEntries(names.map(name => [name, fields[name]!.value])) as unknown as WorkflowMigrationTransport);\n })();\n const registry = new Map<string, RegisteredAgent>();\n for (const config of options.agents) {\n assertAgent(config.agent);\n if (registry.has(config.agent.id)) throw new Error('Agent registry IDs must be unique.');\n // Validate configuration now, not after accepting an HTTP command. No model work is performed.\n const permissions = Object.freeze({ allow: Object.freeze([...config.permissions.allow]) });\n const settings = config.limits === undefined ? {} : Object.freeze({ ...config.limits });\n const check = createRuntime({ profile: 'ephemeral', permissions, limits: settings });\n void check.close();\n registry.set(config.agent.id, Object.freeze({ agent: config.agent, permissions, limits: settings }));\n }\n // Run submissions may carry media only when some agent accepts it; otherwise they keep the ordinary body limit.\n const runBodyBytes = [...registry.values()].some(config => config.agent.media) ? Math.max(limits.maxBodyBytes, limits.maxMediaBodyBytes) : limits.maxBodyBytes;\n const mediaArtifacts = options.mediaArtifacts;\n if (mediaArtifacts !== undefined && typeof mediaArtifacts !== 'function') throw new Error('mediaArtifacts must be a function.');\n /** Media items of a run submission, as Mayura media: base64 bytes, an https URL, or a stored artifact. */\n const submittedMedia = async (value: JsonValue | undefined, scope: Scope, signal: AbortSignal): Promise<readonly Media[]> => {\n if (value === undefined) return [];\n const refuse = (message: string): never => { throw new HttpFailure(400, 'INVALID_MEDIA', { message }); };\n if (!Array.isArray(value) || value.length > 32) return refuse('media must be a list of at most 32 items.');\n const items: Media[] = [];\n for (const [index, raw] of value.entries()) {\n const label = `media ${index + 1}`;\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return refuse(`${label} must be an object.`);\n const keys = Object.keys(raw).sort().join(',');\n const name = raw['name']; const mediaType = raw['mediaType'];\n if (name !== undefined && typeof name !== 'string') refuse(`${label}: name must be text.`);\n const options = name === undefined ? {} : { name: name as string };\n try {\n if (keys === 'artifact' || keys === 'artifact,name') {\n if (!mediaArtifacts) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'mediaArtifacts' });\n const reference = raw['artifact'];\n if (!reference || typeof reference !== 'object' || Array.isArray(reference)) return refuse(`${label}: artifact must be an artifact reference.`);\n let item: Media;\n try { item = await bounded(Promise.resolve().then(() => mediaArtifacts(reference, scope, signal)), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; return refuse(`${label}: the artifact could not be read for this caller.`); }\n items.push(item);\n continue;\n }\n if (typeof mediaType !== 'string' || !(MEDIA_TYPES as readonly string[]).includes(mediaType)) return refuse(`${label}: mediaType must be one of ${MEDIA_TYPES.join(', ')}.`);\n if (keys === 'data,mediaType' || keys === 'data,mediaType,name') {\n if (typeof raw['data'] !== 'string') return refuse(`${label}: data must be base64 text.`);\n items.push(mediaFromBase64(raw['data'], mediaType as MediaType, options));\n } else if (keys === 'mediaType,url' || keys === 'mediaType,name,url') {\n if (typeof raw['url'] !== 'string') return refuse(`${label}: url must be text.`);\n items.push(mediaUrl(raw['url'], mediaType as MediaType, options));\n } else return refuse(`${label} must have mediaType with data (base64) or url, or an artifact reference, and optionally a name.`);\n } catch (error) {\n if (error instanceof MayuraError) return refuse(`${label}: ${error.message}`);\n throw error;\n }\n }\n return items;\n };\n /** A digest of each media item for the idempotency key: its bytes' SHA-256, or its URL. */\n const mediaDigests = async (items: readonly Media[]): Promise<JsonValue> => Promise.all(items.map(async item => {\n if (!('data' in item)) return { mediaType: item.mediaType, url: item.url, name: item.name ?? null };\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', new Uint8Array(item.data)));\n return { mediaType: item.mediaType, sha256: [...digest].map(byte => byte.toString(16).padStart(2, '0')).join(''), name: item.name ?? null };\n }));\n const toolCatalog = Object.freeze([...registry.values()].flatMap(config => [...config.agent.tools.map(tool => Object.freeze({\n agentId: config.agent.id, agentVersion: config.agent.version, id: tool.id, version: tool.version,\n effects: tool.effects, capabilities: tool.capabilities, timeoutMs: tool.timeoutMs, costMicros: tool.costMicros,\n })), ...(config.agent.handoffs ?? []).map(edge => Object.freeze({\n agentId: config.agent.id, agentVersion: config.agent.version, id: `handoff.${edge.agent.id}`, version: edge.agent.version,\n effects: 'none' as const, capabilities: Object.freeze([`agent:${edge.agent.id}`]),\n timeoutMs: config.limits?.maxDurationMs ?? 60_000, costMicros: 0,\n }))]).sort((left, right) => left.agentId.localeCompare(right.agentId) || left.id.localeCompare(right.id) || left.version.localeCompare(right.version)));\n const authorization = options.authorization === undefined ? undefined : createAuthorizer(options.authorization);\n const cursorCodec = options.authorization === undefined ? undefined : authorizationCursors(options.authorization);\n const readCursor = async (cursor: string | null, identity: ServerIdentity, context: string, signal: AbortSignal): Promise<string | null> => {\n if (!cursorCodec) return cursor;\n try { return await bounded(cursorCodec.decode(cursor, identity, context), signal); } catch { throw new HttpFailure(400, 'INVALID_CURSOR'); }\n };\n const writeCursor = async (cursor: string | null, identity: ServerIdentity, context: string, signal: AbortSignal): Promise<string | null> => {\n if (!cursorCodec) return cursor;\n try { return await bounded(cursorCodec.encode(cursor, identity, context), signal); } catch { throw new HttpFailure(503, 'SERVICE_UNAVAILABLE'); }\n };\n const access = async (identity: ServerIdentity, kind: AuthorizationResourceKind, id: string, action: string, signal: AbortSignal): Promise<boolean> => {\n assertActive(signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n if (!authorization) return true;\n const owned = action !== 'list' && ['thread', 'run', 'workflow', 'human_request'].includes(kind);\n const decision = await authorization.authorize(identity.scope, action, { kind, id, scope: identity.scope,\n ...(owned ? { ownerId: identity.scope.principalId } : {}) }, { signal });\n assertActive(signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n return decision.effect === 'allow';\n };\n const authorize = async (identity: ServerIdentity, kind: AuthorizationResourceKind, id: string, action: string, signal: AbortSignal): Promise<void> => {\n if (!await access(identity, kind, id, action, signal)) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n };\n const filterAuthorized = async <T>(items: readonly T[], identity: ServerIdentity, kind: AuthorizationResourceKind,\n id: (item: T) => string, signal: AbortSignal): Promise<T[]> => {\n if (!authorization) return [...items];\n const visible: T[] = [];\n for (const item of items) if (await access(identity, kind, id(item), 'read', signal)) visible.push(item);\n return visible;\n };\n const conversationStore = options.threads?.store;\n if (options.threads !== undefined && (!conversationStore || typeof conversationStore.threads?.recording !== 'function'\n || typeof conversationStore.runCheckpoints?.get !== 'function')) throw new MayuraError('INVALID_CONFIG', 'threads requires initialized thread and run-checkpoint storage.');\n const compaction = createThreadCompactionService(options.threadCompaction, conversationStore, id => registry.has(id), authorization);\n const scopedThreads = (scope: Scope, signal?: AbortSignal): Threads => createThreads({ store: conversationStore!, scope, ...(authorization === undefined ? {} : { authorization }), ...(signal === undefined ? {} : { signal }),\n permissions: { allow: ['thread:read', 'thread:write', 'thread:delete', 'thread:import'] } });\n const resumeOffsets = new Map<string, number>();\n const runtimeThreads = new Map<string, Threads>();\n const runtimes = new Map<string, Runtime>();\n const runs = new Map<string, Entry>();\n // Same-process concurrent submissions share one journal claim and one run.\n const pendingSubmissions = new Map<string, Promise<Entry | 'duplicate' | Replay>>();\n const submissionJournal = (() => {\n if (options.submissionJournal === undefined) return undefined;\n if (options.submissionJournal === null || typeof options.submissionJournal !== 'object' || typeof options.submissionJournal.claim !== 'function')\n throw new Error('Submission journal requires a claim function.');\n return Object.freeze({ claim: options.submissionJournal.claim.bind(options.submissionJournal) });\n })();\n const runRecords: RunRecordStore | undefined = (() => {\n if (options.runRecords === undefined) return undefined;\n const names = ['claim', 'release', 'start', 'update', 'read', 'events', 'requestCancel', 'abandon'] as const;\n const supplied = options.runRecords as unknown as Record<string, unknown> | null;\n if (supplied === null || typeof supplied !== 'object' || names.some(name => typeof supplied[name] !== 'function'))\n throw new Error('Run records require claim, release, start, update, read, events, requestCancel and abandon functions.');\n if (conversationStore && typeof supplied['resume'] !== 'function') throw new MayuraError('INVALID_CONFIG', 'Thread approvals with durable run records require runRecords.resume.');\n return Object.freeze({ ...Object.fromEntries(names.map(name => [name, (supplied[name] as (...values: unknown[]) => unknown).bind(supplied)])),\n ...(typeof supplied['resume'] === 'function' ? { resume: supplied['resume'].bind(supplied) } : {}) } as unknown as RunRecordStore);\n })();\n const runExecution = options.runExecution ?? 'background';\n if (runExecution !== 'background' && runExecution !== 'request') throw new MayuraError('INVALID_CONFIG', \"runExecution must be 'background' or 'request'.\");\n if (options.conversationRecovery !== undefined && (!conversationStore || !runRecords || typeof conversationStore.runCheckpoints.scan !== 'function'))\n throw new MayuraError('INVALID_CONFIG', 'Conversation recovery requires threads, runRecords and checkpoint scan support.');\n if (options.approvalReconciliation !== undefined && (!conversationStore || !runRecords || typeof conversationStore.runCheckpoints.reconcile !== 'function'))\n throw new MayuraError('INVALID_CONFIG', 'Approval reconciliation requires threads, runRecords and atomic checkpoint reconciliation support.');\n if (runExecution === 'request' && options.conversationRecovery?.intervalMs !== undefined)\n throw new MayuraError('INVALID_CONFIG', 'Request-mode conversation recovery must be invoked by a trusted cron/job, without a process interval.');\n if (runExecution === 'request' && !runRecords) throw new MayuraError('INVALID_CONFIG', \"runExecution 'request' requires runRecords, so any instance can serve a run's result and events.\");\n // In request mode a submission lasts as long as the longest run it may start, plus time to record the outcome.\n const submissionTimeoutMs = runExecution === 'request'\n ? Math.max(...[...registry.values()].map(agent => agent.limits?.maxDurationMs ?? 60_000)) + limits.requestTimeoutMs : limits.requestTimeoutMs;\n // Identifies this server instance as the owner of the runs it executes; never derived from request data.\n const replicaId = crypto.randomUUID(); const leaseSkewMs = Math.min(maxLeaseSkewMs, limits.runLeaseMs);\n const submissions = new Map<string, Entry>();\n // Runs retained per runtime; a runtime closes when its last retained run is released.\n const retained = new Map<string, number>();\n const retentionTimers = new Set<ReturnType<typeof setTimeout>>();\n // Idempotency evidence for released runs: submission key -> request digest, oldest dropped past a fixed bound.\n const tombstones = new Map<string, string>(); const maxTombstones = 16_384;\n const release = (entry: Entry): void => {\n if (runs.get(entry.handle.id) !== entry) return;\n runs.delete(entry.handle.id);\n if (submissions.get(entry.submissionKey) === entry) {\n submissions.delete(entry.submissionKey); tombstones.delete(entry.submissionKey);\n // Durable run records answer a released key themselves; tombstones cover only in-memory runs.\n if (!runRecords) tombstones.set(entry.submissionKey, entry.digest);\n if (tombstones.size > maxTombstones) tombstones.delete(tombstones.keys().next().value!);\n }\n const remaining = (retained.get(entry.runtimeKey) ?? 1) - 1;\n if (remaining > 0) { retained.set(entry.runtimeKey, remaining); return; }\n retained.delete(entry.runtimeKey);\n const runtime = runtimes.get(entry.runtimeKey);\n if (runtime === entry.runtime) { runtimes.delete(entry.runtimeKey); runtimeThreads.delete(entry.runtimeKey); void Promise.resolve().then(() => runtime.close()).catch(() => undefined); }\n };\n /** Release the oldest finished runs until a new run (and, when needed, a new runtime) fits. Active runs are never released. */\n const makeRoom = (runtimeKey: string): void => {\n for (const entry of runs.values()) {\n if (runs.size < limits.maxRuns && (runtimes.has(runtimeKey) || runtimes.size < limits.maxRuntimes)) return;\n if (entry.finished && entry.collected) release(entry);\n }\n };\n const streams = new Set<() => void>();\n let closed = false;\n let requests = 0;\n let authentications = 0;\n let healthOperations = 0;\n let humanOperations = 0;\n let workflowOperations = 0;\n\n const humanRecord = (value: unknown, identity: ServerIdentity): HumanRequestRecord => {\n let raw: JsonObject; try { raw = object(value, 16_384); } catch { throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID'); }\n const allowed = ['id', 'agentId', 'kind', 'schemaId', 'schemaDigest', 'prompt', 'digest', 'status', 'context', 'subjectDigest', 'deadlineAtMs'];\n if (Object.keys(raw).some(key => !allowed.includes(key)) || !['id', 'agentId', 'kind', 'schemaId', 'schemaDigest', 'prompt', 'digest', 'status'].every(key => Object.hasOwn(raw, key))\n || typeof raw['id'] !== 'string' || !humanIdentifier.test(raw['id']) || typeof raw['agentId'] !== 'string' || !identity.agentIds.includes(raw['agentId'])\n || !['information', 'correction', 'plan_selection'].includes(String(raw['kind'])) || typeof raw['schemaId'] !== 'string' || !identifier.test(raw['schemaId'])\n || typeof raw['schemaDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['schemaDigest']) || typeof raw['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['digest'])\n || typeof raw['prompt'] !== 'string' || encoder.encode(raw['prompt']).byteLength < 1 || encoder.encode(raw['prompt']).byteLength > 1_024\n || !['waiting', 'answered', 'cancelled', 'timed_out'].includes(String(raw['status']))\n || (raw['subjectDigest'] !== undefined && (typeof raw['subjectDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(raw['subjectDigest'])))\n || ((raw['kind'] === 'correction') !== (raw['subjectDigest'] !== undefined))\n || (raw['deadlineAtMs'] !== undefined && (!Number.isSafeInteger(raw['deadlineAtMs']) || (raw['deadlineAtMs'] as number) < 0))) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n return freezeJson(raw) as unknown as HumanRequestRecord;\n };\n const humanCall = async <T>(callback: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n if (humanOperations >= limits.maxHumanOperations) throw new HttpFailure(429, 'HUMAN_LIMIT');\n humanOperations++; const operation = Promise.resolve().then(callback).finally(() => { humanOperations--; });\n try { return await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'HUMAN_UNAVAILABLE'); }\n };\n\n const response = (value: unknown, status = 200, extra: Record<string, string> = {}): Response => {\n let text: string;\n try { text = JSON.stringify(jsonValue(value, { maxBytes: limits.maxResponseBytes })); }\n catch { text = JSON.stringify({ error: { code: 'RESPONSE_TOO_LARGE', message: errorMessages.RESPONSE_TOO_LARGE } }); status = 500; extra = {}; }\n return new Response(text, { status, headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', ...extra } });\n };\n /** `{ error: { code, message, ...details } }`, plus `Retry-After` for codes worth retrying. */\n const failureResponse = (failure: HttpFailure, extraBody: Record<string, JsonValue> = {}): Response => {\n const { message, ...details } = failure.details; const retryAfterMs = details.retryAfterMs ?? retryable[failure.code];\n return response({ ...extraBody, error: { code: failure.code, message: message ?? errorMessages[failure.code], ...details,\n ...(retryAfterMs === undefined ? {} : { retryAfterMs }) } }, failure.status,\n retryAfterMs === undefined ? {} : { 'Retry-After': String(Math.max(1, Math.ceil(retryAfterMs / 1_000))) });\n };\n const session = async (request: Request, signal: AbortSignal): Promise<ServerIdentity> => {\n const authorization = request.headers.get('authorization') ?? '';\n if (!/^Bearer [\\x21-\\x7e]{1,8192}$/.test(authorization)) throw new HttpFailure(401, 'AUTH_REQUIRED');\n let supplied: ServerIdentity | null;\n assertActive(signal);\n if (authentications >= limits.maxRequests) throw new HttpFailure(429, 'AUTH_LIMIT');\n authentications++;\n const verification = Promise.resolve().then(() => {\n assertActive(signal); return authenticate(Object.freeze({ token: authorization.slice(7), signal }));\n }).finally(() => { authentications--; });\n // A non-cooperative verifier retains its admission until it really completes.\n try { supplied = await bounded(verification, signal); }\n catch { assertActive(signal); throw new HttpFailure(503, 'AUTH_UNAVAILABLE'); }\n assertActive(signal);\n // null is the verifier's \"not accepted\"; an identity Mayura cannot use is the application's configuration problem.\n if (supplied === null) throw new HttpFailure(401, 'AUTH_INVALID');\n let raw: JsonObject;\n try {\n raw = object(supplied, 65_536); const scope = object(raw['scope']);\n exact(raw, ['scope', 'agentIds', 'capabilities', 'expiresAtMs']); exact(scope, ['principalId', 'projectId']);\n if (typeof scope['principalId'] !== 'string' || !identifier.test(scope['principalId']) || typeof scope['projectId'] !== 'string' || !identifier.test(scope['projectId'])\n || !Array.isArray(raw['agentIds']) || raw['agentIds'].length > 256 || raw['agentIds'].some(id => typeof id !== 'string' || !identifier.test(id))\n || !Array.isArray(raw['capabilities']) || raw['capabilities'].length > capabilities.length || raw['capabilities'].some(cap => !(capabilities as readonly string[]).includes(String(cap)))\n || typeof raw['expiresAtMs'] !== 'number' || !Number.isSafeInteger(raw['expiresAtMs'])) throw new Error();\n } catch { throw new HttpFailure(500, 'IDENTITY_INVALID'); }\n if ((raw['expiresAtMs'] as number) <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n return freezeJson(raw) as unknown as ServerIdentity;\n };\n const requireCapability = (identity: ServerIdentity, capability: ServerIdentity['capabilities'][number]): void => {\n if (!identity.capabilities.includes(capability)) throw new HttpFailure(403, 'CAPABILITY_REQUIRED', { capability });\n if (identity.expiresAtMs <= Date.now()) throw new HttpFailure(401, 'AUTH_EXPIRED');\n };\n const body = async (request: Request, signal: AbortSignal, maxBodyBytes = limits.maxBodyBytes): Promise<JsonObject> => {\n if (!/^application\\/json(?:\\s*;\\s*charset=utf-8)?$/i.test(request.headers.get('content-type') ?? '') || request.headers.has('content-encoding')) throw new HttpFailure(415, 'UNSUPPORTED_MEDIA_TYPE');\n const declared = request.headers.get('content-length');\n if (declared !== null && (!/^\\d+$/.test(declared) || Number(declared) > maxBodyBytes)) throw new HttpFailure(413, 'BODY_TOO_LARGE', { limitBytes: maxBodyBytes });\n const reader = request.body?.getReader();\n if (!reader) throw new HttpFailure(400, 'INVALID_JSON', { message: 'This request needs a JSON body.' });\n const chunks: Uint8Array[] = []; let total = 0; let complete = false;\n try {\n while (true) {\n const item = await bounded(reader.read(), signal);\n if (item.done) { complete = true; break; }\n total += item.value.byteLength;\n if (total > maxBodyBytes) throw new HttpFailure(413, 'BODY_TOO_LARGE', { limitBytes: maxBodyBytes });\n chunks.push(item.value);\n }\n const data = new Uint8Array(total); let offset = 0;\n for (const chunk of chunks) { data.set(chunk, offset); offset += chunk.byteLength; }\n let parsed: unknown;\n try { parsed = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(data)); } catch { throw new HttpFailure(400, 'INVALID_JSON'); }\n try { return object(parsed, maxBodyBytes); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'The body must be a JSON object within the server\\'s depth and size limits.' }); }\n } finally { if (!complete) void reader.cancel().catch(() => {}); reader.releaseLock(); }\n };\n /** A run-record call bounded by the signal; any failure other than a timeout is RUN_RECORDS_UNAVAILABLE. */\n const recorded = async <T>(call: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n try { return await bounded(Promise.resolve().then(call), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE'); }\n };\n const recordView = (value: unknown, runId: string): RunRecordView | null => {\n if (value === null) return null;\n let raw: JsonObject; try { raw = object(value, 8_388_608); } catch { throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE'); }\n const snapshot = raw['snapshot']; const outcome = raw['outcome']; const status = raw['status'];\n if (Object.keys(raw).some(key => !['runId', 'agentId', 'replicaId', 'status', 'leaseExpiresAtMs', 'cancelRequested', 'lastSequence', 'snapshot', 'outcome'].includes(key))\n || raw['runId'] !== runId || typeof raw['agentId'] !== 'string' || !identifier.test(raw['agentId']) || typeof raw['replicaId'] !== 'string'\n || !/^[A-Za-z0-9._:-]{1,128}$/.test(raw['replicaId']) || typeof status !== 'string' || !runStatuses.has(status)\n || !Number.isSafeInteger(raw['leaseExpiresAtMs']) || typeof raw['cancelRequested'] !== 'boolean' || !Number.isSafeInteger(raw['lastSequence']) || (raw['lastSequence'] as number) < 0\n || snapshot === null || typeof snapshot !== 'object' || Array.isArray(snapshot) || Object.keys(snapshot).some(key => !['id', 'status', 'budget', 'evidence', 'approval', 'toolWait'].includes(key))\n || snapshot['id'] !== runId || snapshot['status'] !== status\n || (['running', 'waiting'].includes(status)) !== (outcome === undefined)\n || (outcome !== undefined && (outcome === null || typeof outcome !== 'object' || Array.isArray(outcome) || outcome['status'] !== status))) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n return raw as unknown as RunRecordView;\n };\n /** Read a durable run; a running run whose owner's lease lapsed is settled as outcome_unknown first. */\n const readRecord = async (owner: string, runId: string, signal: AbortSignal): Promise<RunRecordView | null> => {\n const records = runRecords!;\n let record = recordView(await recorded(() => records.read({ owner, runId, signal }), signal), runId);\n if (record && ['running', 'waiting'].includes(record.status) && record.replicaId !== replicaId && record.leaseExpiresAtMs < Date.now() - leaseSkewMs) {\n const checkpoint = conversationStore ? await recorded(() => conversationStore.runCheckpoints.get({ runId }), signal) : undefined;\n if (!checkpoint || !checkpoint.body['scope'] || canonical(checkpoint.body['scope']) !== owner) {\n record = recordView(await recorded(() => records.abandon({ owner, runId, nowMs: Date.now() - leaseSkewMs, signal }), signal), runId);\n }\n }\n return record;\n };\n\n /**\n * One bounded SSE response over a run's events. An idle stream sends a comment every `streamHeartbeatMs` so proxies\n * keep it open and clients can tell a quiet run from a dead connection. The stream ends when the run's events end,\n * after `streamDurationMs`, or when the identity expires; clients reconnect from their last sequence.\n */\n const eventStream = (open: (signal: AbortSignal) => AsyncIterator<RunEvent>, identity: ServerIdentity, request: Request, onDone?: () => void): Response => {\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n if (streams.size >= limits.maxStreams) throw new HttpFailure(429, 'STREAM_LIMIT');\n const controller = new AbortController();\n const iterator = open(controller.signal);\n let sink: ReadableStreamDefaultController<Uint8Array>;\n let ended = false; let pending: Promise<IteratorResult<RunEvent>> | undefined;\n const finish = (): void => {\n if (ended) return;\n ended = true; controller.abort(); clearTimeout(timer); streams.delete(finish);\n request.signal.removeEventListener('abort', finish);\n try { sink.close(); } catch { /* Consumer cancellation may already have closed the stream. */ }\n void iterator.return?.().catch(() => {});\n };\n const timer = setTimeout(finish, Math.max(0, Math.min(limits.streamDurationMs, identity.expiresAtMs - Date.now())));\n streams.add(finish);\n const stream = new ReadableStream<Uint8Array>({\n start(value) { sink = value; },\n async pull(value) {\n if (ended) return;\n let beat: ReturnType<typeof setTimeout> | undefined;\n try {\n if (!pending) { pending = iterator.next(); pending.catch(() => {}); }\n const next = await Promise.race([pending, new Promise<'beat'>(resolve => { beat = setTimeout(resolve, limits.streamHeartbeatMs, 'beat'); })]);\n if (ended) return;\n if (authorization) {\n const path = new URL(request.url).pathname; const runId = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/events$/.exec(path)?.[1];\n if (!runId) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n await authorize(identity, 'run', runId, 'read', controller.signal);\n if (ended) return;\n }\n if (next === 'beat') { value.enqueue(encoder.encode(': keep-alive\\n\\n')); return; }\n pending = undefined;\n if (next.done) { onDone?.(); finish(); return; }\n const event = JSON.stringify(jsonValue(next.value, { maxBytes: 16_384 }));\n value.enqueue(encoder.encode(`id: ${next.value.sequence}\\nevent: ${next.value.type}\\ndata: ${event}\\n\\n`));\n } catch (error) {\n const code: ServerErrorCode = error instanceof HttpFailure && ['RUN_RECORDS_UNAVAILABLE', 'AUTHORIZATION_DENIED'].includes(error.code) ? error.code : 'OBSERVATION_FAILED';\n if (!ended) value.enqueue(encoder.encode(`event: stream.error\\ndata: ${JSON.stringify({ code, message: errorMessages[code] })}\\n\\n`));\n finish();\n } finally { clearTimeout(beat); }\n },\n cancel() { finish(); },\n }, { highWaterMark: 1 });\n request.signal.addEventListener('abort', finish, { once: true });\n if (request.signal.aborted) finish();\n return new Response(stream, { headers: { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', 'X-Accel-Buffering': 'no' } });\n };\n /** Recorded events of a run owned by another replica, polled until the run has ended and every event was read. */\n async function* recordedEvents(owner: string, runId: string, after: number, signal: AbortSignal): AsyncGenerator<RunEvent> {\n const records = runRecords!; let cursor = after;\n while (!signal.aborted) {\n const page = await recorded(() => records.events({ owner, runId, after: cursor, limit: 256, signal }), signal);\n if (!Array.isArray(page) || page.length > 256) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n for (const item of page as readonly RunEvent[]) {\n const gap = item?.type === 'events.gap';\n if (!item || item.runId !== runId || !Number.isSafeInteger(item.sequence) || (gap ? item.sequence <= cursor || item.metadata?.['from'] !== cursor + 1\n || item.metadata?.['to'] !== item.sequence : item.sequence !== cursor + 1)) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n cursor = item.sequence; yield item;\n if (item.type === 'run.completed') return;\n }\n if (page.length === 256) continue;\n const record = await readRecord(owner, runId, signal);\n if (!record || (!['running', 'waiting'].includes(record.status) && record.lastSequence <= cursor)) return;\n if (page.length === 0) await new Promise<void>(resolve => {\n const done = (): void => { clearTimeout(wait); signal.removeEventListener('abort', done); resolve(); };\n const wait = setTimeout(done, limits.runRecordPollMs); signal.addEventListener('abort', done, { once: true });\n });\n }\n }\n\n /** The run's public inspection: identity, status, budget and effect evidence. Every replica answers with this shape. */\n const inspection = (entry: Entry): JsonObject => {\n const view = entry.runtime.inspect(entry.handle);\n // A snapshot that is not JSON is an internal failure, not the caller's bad request.\n return jsonValue({ id: view.id, status: view.status, budget: view.budget, evidence: view.evidence, ...(view.approval ? { approval: view.approval } : {}), ...(view.toolWait ? { toolWait: view.toolWait } : {}) }, { maxBytes: 4_194_304 }) as JsonObject;\n };\n /** In-flight owner loops; close() lets them record final outcomes for a bounded time. */\n const persisters = new Set<Promise<void>>(); const persisterStop = new AbortController();\n /**\n * The owner's side of a durable run: record events in order, the snapshot and finally the outcome; renew the lease;\n * and act on cancel requests from other replicas. A write that fails is retried with backoff; if the lease lapses\n * meanwhile, another replica settles the run as outcome_unknown and this owner, told it lost the run, cancels it.\n */\n const persist = (entry: Entry): Promise<void> => {\n const records = runRecords!; const runId = entry.handle.id; const owner = entry.owner;\n const observer = new AbortController();\n const buffer: RunEvent[] = []; let observed = false; let wake: (() => void) | undefined;\n const notify = (): void => { const resume = wake; wake = undefined; resume?.(); };\n void (async () => {\n try { for await (const event of entry.handle.observe({ after: entry.observedAfter ?? 0, signal: observer.signal })) { buffer.push(entry.eventOffset ? { ...event, sequence: event.sequence + entry.eventOffset,\n ...(event.type === 'events.gap' ? { metadata: { ...event.metadata, from: Number(event.metadata['from']) + entry.eventOffset, to: Number(event.metadata['to']) + entry.eventOffset } } : {}) } : event); notify(); } }\n catch { /* The final write still records the outcome; readers see the missing events as a gap. */ }\n finally { observed = true; notify(); }\n })();\n void entry.handle.result().then(notify, notify);\n const call = async <T>(operation: (signal: AbortSignal) => Promise<T>): Promise<T> => {\n const controller = new AbortController(); const stop = (): void => controller.abort();\n const timer = setTimeout(stop, Math.max(1, Math.floor(limits.runLeaseMs / 3))); persisterStop.signal.addEventListener('abort', stop, { once: true });\n try { return await bounded(Promise.resolve().then(() => operation(controller.signal)), controller.signal); }\n finally { clearTimeout(timer); persisterStop.signal.removeEventListener('abort', stop); }\n };\n const task = (async () => {\n let lastWrite = Date.now(); let failures = 0;\n while (!persisterStop.signal.aborted) {\n const now = Date.now(); const ended = observed && entry.finished === true;\n try {\n if (buffer.length > 0 || ended || now - lastWrite >= limits.runLeaseMs / 3) {\n const events = buffer.slice(0, 256); const final = ended && events.length === buffer.length;\n const result = await call(signal => records.update({ owner, runId, replicaId, events, snapshot: inspection(entry),\n leaseExpiresAtMs: now + limits.runLeaseMs, ...(final ? { outcome: object(entry.outcome, 4_194_304) } : {}), signal })) as unknown;\n const written = result as { status?: unknown; cancelRequested?: unknown } | null;\n if (written?.status === 'lost') { entry.lost = true; if (entry.runtime.inspect(entry.handle).status !== 'waiting') entry.handle.cancel(); return; }\n if (written?.status !== 'written' || typeof written.cancelRequested !== 'boolean') throw new Error('invalid');\n if (events.length > 0) entry.observedAfter = events[events.length - 1]!.sequence - (entry.eventOffset ?? 0);\n buffer.splice(0, events.length); lastWrite = now; failures = 0;\n if (written.cancelRequested) entry.handle.cancel();\n if (final || (closed && buffer.length === 0 && inspection(entry)['status'] === 'waiting')) return;\n if (runExecution === 'request' && buffer.length === 0 && inspection(entry)['status'] === 'waiting' && conversationStore) {\n const checkpoint = await call(() => conversationStore.runCheckpoints.get({ runId }));\n if (checkpoint) return;\n }\n if (buffer.length > 0 || (observed && entry.finished)) continue;\n } else {\n const record = recordView(await call(signal => records.read({ owner, runId, signal })), runId);\n if (!record) throw new Error('missing');\n if (record.replicaId !== replicaId || !['running', 'waiting'].includes(record.status)) { entry.lost = true; if (entry.runtime.inspect(entry.handle).status !== 'waiting') entry.handle.cancel(); return; }\n if (record.cancelRequested) entry.handle.cancel();\n failures = 0;\n }\n } catch { failures = Math.min(failures + 1, 16); }\n const delay = failures > 0 ? Math.min(Math.floor(limits.runLeaseMs / 3), 100 * 2 ** failures) : limits.runRecordPollMs;\n await new Promise<void>(resolve => {\n const done = (): void => { clearTimeout(timer); persisterStop.signal.removeEventListener('abort', done); wake = undefined; resolve(); };\n const timer = setTimeout(done, delay); persisterStop.signal.addEventListener('abort', done, { once: true });\n // New events wake a healthy loop at once; after a failure the backoff is kept.\n if (failures === 0) wake = done;\n });\n }\n })();\n persisters.add(task); void task.finally(() => { observer.abort(); persisters.delete(task); });\n return task;\n };\n /** A 409 for a workflow command; with read access the caller also learns the run's current revision. */\n const workflowConflict = async (identity: ServerIdentity, runId: string, signal: AbortSignal): Promise<HttpFailure> => {\n if (!workflowViews || !identity.capabilities.includes('workflows:read') || signal.aborted) return new HttpFailure(409, 'WORKFLOW_CONFLICT');\n try {\n await authorize(identity, 'workflow', runId, 'read', signal);\n const item = await bounded(Promise.resolve().then(() => workflowViews.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, runId, signal }))), signal);\n if (item !== null) return new HttpFailure(409, 'WORKFLOW_CONFLICT', { currentRevision: workflowRecord(item, runId).revision });\n } catch { /* The conflict stands without the hint. */ }\n return new HttpFailure(409, 'WORKFLOW_CONFLICT');\n };\n\n const runtimeFor = (owner: string, agentId: string, scope: Scope): Runtime => {\n const key = JSON.stringify([owner, agentId]); const existing = runtimes.get(key); if (existing) return existing;\n makeRoom(key);\n if (runtimes.size >= limits.maxRuntimes) throw new HttpFailure(429, 'RUNTIME_LIMIT');\n const config = registry.get(agentId)!; const threads = conversationStore ? scopedThreads(scope) : undefined;\n const runtime = createRuntime({ profile: 'ephemeral', scope, permissions: config.permissions,\n ...(authorization ? { authorization } : {}),\n ...(config.limits ? { limits: config.limits } : {}), ...(threads ? { recorder: threads.recorder,\n checkpoints: { store: {\n ...conversationStore!.runCheckpoints,\n // Runtime claims the checkpoint before this callback returns, and deletes it only before dispatch.\n // Transfer the run record inside that exclusive claim, so a losing approval can never steal the writer.\n claim: async command => {\n const checkpoints = conversationStore!.runCheckpoints;\n const claimed = await checkpoints.claim(command);\n if (!runRecords) return claimed;\n const signal = AbortSignal.timeout(Math.min(limits.requestTimeoutMs, 10_000));\n try {\n if (closed) throw new Error('closed');\n let before = recordView(await recorded(() => runRecords.read({ owner, runId: command.runId, signal }), signal), command.runId);\n if (!before || before.agentId !== agentId) throw new Error('missing');\n // A process can stop after saving its checkpoint but before its final waiting snapshot.\n if (before.status === 'running') {\n const saved = savedInspection(claimed);\n const refreshed = await recorded(() => runRecords.update({ owner, runId: command.runId, replicaId: before!.replicaId,\n events: [], snapshot: saved, leaseExpiresAtMs: before!.leaseExpiresAtMs, signal }), signal);\n if (refreshed.status !== 'written') throw new Error('lost');\n }\n before = recordView(await recorded(() => runRecords.resume!({ owner, runId: command.runId, replicaId,\n leaseExpiresAtMs: Date.now() + limits.runLeaseMs, signal }), signal), command.runId);\n if (!before || closed) throw new Error('lost');\n if (!runs.has(command.runId)) resumeOffsets.set(command.runId, before.lastSequence);\n return claimed;\n } catch {\n await checkpoints.update({ runId: command.runId, holderId: command.holderId, expectedVersion: claimed.version, body: claimed.body, status: 'waiting' });\n throw new MayuraError('CONFLICT', 'The run record could not be claimed; the checkpoint remains waiting.');\n }\n },\n }, agents: [config.agent], autoExpire: runExecution === 'background' && options.conversationRecovery === undefined } } : {}) });\n runtimes.set(key, runtime); if (threads) runtimeThreads.set(key, threads); return runtime;\n };\n /** Keep adapter diagnostics private; request cancellation does not undo already committed storage writes. */\n const conversationCall = async <T>(operation: () => Promise<T>, signal: AbortSignal): Promise<T> => {\n assertActive(signal);\n return bounded(Promise.resolve().then(operation).catch(error => {\n if (error instanceof HttpFailure) throw error;\n if (error instanceof MayuraError) {\n if (error.code === 'NOT_FOUND') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n if (error.code === 'CONFLICT') throw new HttpFailure(409, 'THREAD_CONFLICT');\n if (error.code === 'INVALID_INPUT') throw new HttpFailure(400, 'INVALID_REQUEST');\n if (error.code === 'LIMIT_EXCEEDED') throw new HttpFailure(500, 'RESPONSE_TOO_LARGE');\n }\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }), signal);\n };\n const savedRun = async (runId: string, identity: ServerIdentity, signal: AbortSignal) => {\n if (!conversationStore) return undefined;\n const checkpoint = await conversationCall(() => conversationStore.runCheckpoints.get({ runId }), signal);\n const expected = sha256Hex(`mayura:run-scope:v1\\0${identity.scope.principalId}\\0${identity.scope.projectId}`);\n const agent = checkpoint?.body['agent']; const storedScope = checkpoint?.body['scope'];\n if (!checkpoint || checkpoint.body['reconciliation'] !== undefined || checkpoint.scope !== expected || !agent || typeof agent !== 'object' || Array.isArray(agent)\n || typeof agent['id'] !== 'string' || !identity.agentIds.includes(agent['id']) || !registry.has(agent['id'])\n || !storedScope || typeof storedScope !== 'object' || Array.isArray(storedScope) || canonical(storedScope) !== canonical(identity.scope as unknown as JsonValue)) return undefined;\n return checkpoint;\n };\n const savedInspection = (checkpoint: NonNullable<Awaited<ReturnType<typeof savedRun>>>): JsonObject => {\n const pending = checkpoint.body['pending']; const spent = checkpoint.body['spent'];\n if (!pending || typeof pending !== 'object' || Array.isArray(pending) || !spent || typeof spent !== 'object' || Array.isArray(spent)) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n const { callId, toolId, toolVersion, input, digest, expiresAtMs } = pending;\n if (typeof callId !== 'string' || callId.length > 128 || typeof toolId !== 'string' || typeof toolVersion !== 'string'\n || input === undefined || typeof digest !== 'string' || !/^[a-f0-9]{64}$/.test(digest) || !Number.isSafeInteger(expiresAtMs)\n || typeof spent['micros'] !== 'string' || !/^[0-9]{1,30}$/.test(spent['micros']) || !Number.isSafeInteger(spent['calls'])) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n const receipts = checkpoint.body['receipts'] ?? [];\n if (!Array.isArray(receipts) || receipts.some(receipt => !receipt || typeof receipt !== 'object' || Array.isArray(receipt))) throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n return { id: checkpoint.runId, status: 'waiting', budget: { spentMicros: Number(spent['micros']) > Number.MAX_SAFE_INTEGER ? spent['micros'] : Number(spent['micros']), reservedMicros: 0, calls: spent['calls']! },\n evidence: receipts.map(receipt => ({ runId: checkpoint.runId, receipt })), [checkpoint.body['waitKind'] === 'frontend' ? 'toolWait' : 'approval']: { callId: callId!, toolId: toolId!, toolVersion: toolVersion!, input: input!, digest: digest!, expiresAtMs: expiresAtMs! } };\n };\n const settleSaved = async (owner: string, runId: string, status: 'failed' | 'cancelled', code: 'DEFINITION_CHANGED' | 'CANCELLED', message: string, signal: AbortSignal): Promise<void> => {\n const previousSequence = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!runRecords || previousSequence === undefined) return;\n const before = recordView(await recorded(() => runRecords.read({ owner, runId, signal }), signal), runId);\n if (!before) throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n const snapshot: JsonObject = { id: runId, status, budget: before.snapshot['budget']!, evidence: before.snapshot['evidence'] ?? [] };\n await recorded(() => runRecords.update({ owner, runId, replicaId, snapshot, leaseExpiresAtMs: Date.now() + limits.runLeaseMs,\n events: [{ runId, sequence: previousSequence + 1, timestamp: new Date().toISOString(), type: 'run.completed', metadata: { status } }],\n outcome: { status, error: { code, message } }, signal }), signal);\n };\n const retain = (entry: Entry): void => {\n runs.set(entry.handle.id, entry); retained.set(entry.runtimeKey, (retained.get(entry.runtimeKey) ?? 0) + 1);\n void entry.handle.result().then(outcome => {\n entry.outcome = outcome; entry.finished = true; if (closed) return;\n const timer = setTimeout(() => { retentionTimers.delete(timer); release(entry); }, limits.runRetentionMs);\n (timer as { unref?: () => void }).unref?.(); retentionTimers.add(timer);\n });\n };\n /** Verify persisted scope/agent metadata before asking the host policy to authorize any work. */\n const recoverCandidate = async (id: string, signal: AbortSignal, authorize: ConversationRecoveryOptions['authorize']): Promise<ConversationRecoveryOutcome> => {\n const active = (): void => { if (closed || signal.aborted) throw new MayuraError('CANCELLED', 'Conversation recovery stopped.'); };\n active(); if (id.startsWith('thread-compact:')) return { id, status: 'skipped' };\n const checkpoint = await conversationStore!.runCheckpoints.get({ runId: id }); active();\n if (!checkpoint) return { id, status: 'skipped' };\n const journal = id.startsWith('thread-record:');\n const frontendWait = !journal && checkpoint.body['waitKind'] === 'frontend';\n const completion = journal ? checkpoint.body['completion'] : checkpoint.body;\n if (!completion || typeof completion !== 'object' || Array.isArray(completion)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const storedScope = completion['scope'];\n if (!storedScope || typeof storedScope !== 'object' || Array.isArray(storedScope) || Object.keys(storedScope).sort().join(',') !== 'principalId,projectId'\n || ![storedScope['principalId'], storedScope['projectId']].every(value => typeof value === 'string' && /^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/.test(value))) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const scope: Scope = Object.freeze({ principalId: storedScope['principalId'] as string, projectId: storedScope['projectId'] as string });\n const prefix = journal ? 'thread' : 'run';\n if (checkpoint.scope !== sha256Hex(`mayura:${prefix}-scope:v1\\0${scope.principalId}\\0${scope.projectId}`)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const runId = journal ? completion['runId'] : id;\n if (typeof runId !== 'string' || !/^[a-f0-9-]{36}$/.test(runId) || (journal && id !== `thread-record:${sha256Hex(runId)}`)) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const owner = canonical(scope as unknown as JsonValue);\n const record = recordView(await runRecords!.read({ owner, runId, signal }), runId); active();\n if (!record || !registry.has(record.agentId)) return { id, status: 'skipped' };\n if (!journal) {\n const agent = completion['agent'];\n if (!agent || typeof agent !== 'object' || Array.isArray(agent) || agent['id'] !== record.agentId) return { id, status: 'skipped', code: 'INVALID_INPUT' };\n // A claimed approval may already have executed a write; lease expiry cannot authorize replay.\n if ((!frontendWait && (checkpoint.expiresAtMs > Date.now() || checkpoint.status === 'claimed'))\n || (frontendWait && checkpoint.status === 'claimed' && (checkpoint.leaseExpiresAtMs ?? Infinity) > Date.now())\n || !['running', 'waiting'].includes(record.status)) return { id, status: 'skipped' };\n } else if (['running', 'waiting'].includes(record.status) && record.leaseExpiresAtMs > Date.now()) return { id, status: 'skipped' };\n if (await authorize(Object.freeze({ scope, agentId: record.agentId, kind: journal ? 'recording' as const : frontendWait ? 'frontend' as const : 'approval' as const, signal })) !== true) return { id, status: 'skipped', code: 'PERMISSION_DENIED' };\n active();\n if (frontendWait) {\n const binding = completion['recording'];\n if (!binding || typeof binding !== 'object' || Array.isArray(binding) || typeof binding['threadId'] !== 'string') return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const thread = await scopedThreads(scope).get(binding['threadId']);\n if (!thread || thread.status !== 'active' || thread.agentId !== record.agentId) return { id, status: 'skipped', code: 'CONFLICT' };\n }\n if (journal) {\n const threadId = checkpoint.body['threadId'];\n if (typeof threadId !== 'string') return { id, status: 'skipped', code: 'INVALID_INPUT' };\n const recovered = await scopedThreads(scope).recoverRun(threadId, runId);\n return { id, status: recovered ? 'recovered' : 'skipped' };\n }\n let entry = runs.get(runId); if (entry?.lost) { release(entry); entry = undefined; }\n if (!entry && runs.size >= limits.maxRuns) throw new MayuraError('LIMIT_EXCEEDED', 'The run retention limit is reached.');\n const runtimeKey = JSON.stringify([owner, record.agentId]); const runtime = runtimeFor(owner, record.agentId, scope);\n try {\n const pending = checkpoint.body['pending'] as JsonObject;\n const resumedTool = frontendWait && checkpoint.expiresAtMs > Date.now()\n ? await runtime.resumeTool(runId, { callId: pending['callId'] as string, digest: pending['digest'] as string }) : undefined;\n const result = frontendWait && checkpoint.expiresAtMs > Date.now()\n ? resumedTool ? { status: 'resumed' as const, run: resumedTool } : { status: 'not_due' as const }\n : await runtime.expireApproval(runId);\n if (result.status === 'not_due') { resumeOffsets.delete(runId); return { id, status: 'skipped' }; }\n if (result.status === 'cancelled') {\n if (entry) { if (runExecution === 'request') { await entry.handle.result(); entry.persisted = persist(entry); await entry.persisted; } }\n else await settleSaved(owner, runId, 'cancelled', 'CANCELLED', 'The approval request expired and the run was cancelled.', signal);\n return { id, status: 'cancelled' };\n }\n const offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n entry = { owner, agentId: record.agentId, digest: '', handle: result.run, runtime, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); entry.persisted = persist(entry);\n } else if (runExecution === 'request') entry.persisted = persist(entry);\n if (runExecution === 'request') await entry.persisted;\n return { id, status: 'resumed' };\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'DEFINITION_CHANGED') {\n if (entry && runExecution === 'request') { await entry.handle.result(); entry.persisted = persist(entry); await entry.persisted; }\n else await settleSaved(owner, runId, 'failed', 'DEFINITION_CHANGED', 'The agent changed while the run waited for approval.', signal);\n return { id, status: 'skipped', code: 'DEFINITION_CHANGED' };\n }\n throw error;\n } finally { resumeOffsets.delete(runId); }\n };\n const route = async (request: Request, signal: AbortSignal): Promise<Response> => {\n const received = new URL(request.url);\n // Mounted behind a trusted router, only the path and query are taken from the request; the destination is always\n // publicOrigin and no header can change it.\n if ((options.mounted !== true && received.origin !== publicOrigin) || received.username || received.password || received.hash) throw new HttpFailure(400, 'INVALID_DESTINATION');\n // Assigned field by field: a path such as `//other.host/` must never be resolved as a new authority.\n const url = new URL(publicOrigin); url.pathname = received.pathname; url.search = received.search;\n // Console assets are static and data-free; module scripts carry an Origin header even when same-origin.\n if (options.inspector === true && !url.search) { const asset = inspectorAsset(request.method, url.pathname); if (asset) return asset; }\n const requestOrigin = request.headers.get('origin');\n // A page served from the public origin is a same-origin caller; other browser origins need allowedOrigins.\n if (requestOrigin !== null && requestOrigin !== publicOrigin && !origins.has(requestOrigin)) throw new HttpFailure(403, 'ORIGIN_DENIED');\n // A preflight is validated as the request it announces: the same query rules apply, so query credentials still fail,\n // but a legitimate paginated GET can be preflighted.\n const effectiveMethod = request.method === 'OPTIONS' ? request.headers.get('access-control-request-method') ?? '' : request.method;\n const eventMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/events$/.exec(url.pathname);\n const catalogQuery = effectiveMethod === 'GET' && url.pathname === '/v1/tools';\n const humanListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/human-requests';\n const workflowListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/workflow-runs';\n const threadListQuery = effectiveMethod === 'GET' && url.pathname === '/v1/threads';\n const threadEntriesQuery = effectiveMethod === 'GET' && /^\\/v1\\/threads\\/[^/]+\\/entries$/.test(url.pathname);\n const allowedQuery = eventMatch ? ['after'] : catalogQuery || humanListQuery ? ['after', 'limit'] : workflowListQuery ? ['after', 'limit', 'view']\n : threadListQuery ? ['cursor', 'limit', 'status'] : threadEntriesQuery ? ['after', 'before', 'limit'] : [];\n if ([...url.searchParams.keys()].some(key => effectiveMethod !== 'GET' || !allowedQuery.includes(key) || url.searchParams.getAll(key).length > 1)) throw new HttpFailure(400, 'INVALID_QUERY');\n if (request.method === 'OPTIONS') {\n const threadDelete = effectiveMethod === 'DELETE' && /^\\/v1\\/threads\\/[^/]+$/.test(url.pathname);\n if (!requestOrigin || (!['GET', 'POST'].includes(effectiveMethod) && !threadDelete)) throw new HttpFailure(403, requestOrigin ? 'PREFLIGHT_DENIED' : 'ORIGIN_DENIED');\n const headers = (request.headers.get('access-control-request-headers') ?? '').toLowerCase().split(',').map(value => value.trim()).filter(Boolean);\n if (headers.some(value => !['authorization', 'content-type', 'idempotency-key'].includes(value))) throw new HttpFailure(403, 'PREFLIGHT_DENIED');\n return new Response(null, { status: 204, headers: { 'Access-Control-Allow-Methods': threadDelete ? 'GET, POST, DELETE' : 'GET, POST', 'Access-Control-Allow-Headers': 'Authorization, Content-Type, Idempotency-Key' } });\n }\n if (request.method === 'GET' && url.pathname === '/healthz' && options.publicLiveness === true) return response({ status: 'ok' });\n const identity = await session(request, signal);\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n const owner = canonical(identity.scope as unknown as JsonValue);\n const checkRoute = async (): Promise<void> => {\n if (!authorization) return;\n let checks; try { checks = serverAuthorizationRoute(request.method, url.pathname); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (checks === null) throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n for (const check of checks) for (const capability of check.capabilities) requireCapability(identity, capability);\n for (const check of checks) await authorize(identity, check.kind, check.id, check.action, signal);\n };\n await checkRoute();\n const respond = async (...args: Parameters<typeof response>): Promise<Response> => { await checkRoute(); return response(...args); };\n if (workflowListQuery) {\n requireCapability(identity, 'workflows:read'); if (!workflowIndex) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowIndex' });\n const viewKey = url.searchParams.get('view') ?? 'active';\n const after = await readCursor(url.searchParams.get('after'), identity, `workflow:${viewKey}`, signal); const limitText = url.searchParams.get('limit') ?? '20';\n if ((after !== null && !/^[A-Za-z0-9._:-]{1,128}$/.test(after)) || !/^\\d+$/.test(limitText)) throw new HttpFailure(400, 'INVALID_CURSOR');\n const limit = Number(limitText); if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const view = url.searchParams.get('view') ?? 'active'; if (view !== 'active' && view !== 'settled') throw new HttpFailure(400, 'INVALID_QUERY');\n const settled = view === 'settled';\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => workflowIndex.list(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n after, limit, signal, ...(settled ? { view: 'settled' as const } : {}) }))).finally(() => { workflowOperations--; });\n let supplied: unknown; try { supplied = await bounded(operation, signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n let page: JsonObject; try { page = object(supplied, 524_288); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n workflowExact(page, ['items', 'next']);\n if (!Array.isArray(page['items']) || page['items'].length > limit || (page['next'] !== null\n && (typeof page['next'] !== 'string' || !/^[A-Za-z0-9._:-]{1,128}$/.test(page['next']) || page['next'] === after)))\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const items = page['items'].map(item => workflowIndexRecord(item, settled)); if (new Set(items.map(item => item.runId)).size !== items.length)\n throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'workflows:read'); return respond({ items: await filterAuthorized(items, identity, 'workflow', item => item.runId, signal), next: await writeCursor(page['next'] as string | null, identity, `workflow:${view}`, signal) });\n }\n const fleetMatch = /^\\/v1\\/workflow-fleet(?:\\/(hold|release|sweeps\\/pause|sweeps\\/resume))?$/.exec(url.pathname);\n if (fleetMatch && request.method === (fleetMatch[1] === undefined ? 'GET' : 'POST')) {\n const action = fleetMatch[1] ?? 'inspect'; const capability = action === 'inspect' ? 'workflows:read' : 'workflows:fleet';\n requireCapability(identity, capability); if (!workflowFleet) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowFleet' });\n let cursor: JsonObject | null = null; let limit = 0; const sweep = action.startsWith('sweeps/');\n if (action !== 'inspect') {\n const data = await body(request, signal);\n if (!sweep) exact(data, []);\n else {\n exact(data, ['cursor', 'limit']);\n if (typeof data['limit'] !== 'number' || !Number.isSafeInteger(data['limit']) || data['limit'] < 1 || data['limit'] > 128) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'limit must be an integer from 1 to 128, and cursor null or the nextCursor the server returned.' });\n limit = data['limit']; if (data['cursor'] !== null) cursor = object(data['cursor'], 4_096);\n }\n }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const base = Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId, signal });\n const call = (): Promise<unknown> => action === 'inspect' ? workflowFleet.inspect(base) : action === 'hold' ? workflowFleet.hold(base)\n : action === 'release' ? workflowFleet.release(base)\n : workflowFleet.sweep(Object.freeze({ ...base, phase: action === 'sweeps/pause' ? 'pause' as const : 'resume' as const, cursor, limit }));\n const operation = Promise.resolve().then(call).finally(() => { workflowOperations--; });\n let result: unknown;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, capability);\n if (sweep) {\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw new HttpFailure(409, 'FLEET_CONFLICT');\n workflowExact(raw, ['status', 'sweep']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ sweep: fleetSweep(raw['sweep'], limit) });\n }\n const fleet = fleetHold(result);\n if ((action === 'hold' && !fleet.held) || (action === 'release' && fleet.held)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ fleet });\n }\n const workflowMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})$/.exec(url.pathname);\n if (workflowMatch && request.method === 'GET') {\n requireCapability(identity, 'workflows:read'); if (!workflowViews) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowViews' });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT');\n workflowOperations++;\n const operation = Promise.resolve().then(() => workflowViews.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n runId: workflowMatch[1]!, signal }))).finally(() => { workflowOperations--; });\n let item: WorkflowViewRecord | null;\n try { item = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n if (item === null) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND'); const record = workflowRecord(item, workflowMatch[1]!);\n assertActive(signal); requireCapability(identity, 'workflows:read'); return respond({ workflow: record });\n }\n const workflowControlMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/(cancel|approvals)$/.exec(url.pathname);\n if (workflowControlMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control'); if (!workflowControls) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowControls' });\n const data = await body(request, signal); const action = workflowControlMatch[2]!;\n const fields = action === 'cancel' ? ['commandId', 'revision'] : ['commandId', 'revision', 'nodeId', 'approvalDigest', 'childRunId']; exact(data, fields);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n if (action === 'approvals' && (typeof data['nodeId'] !== 'string' || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(data['nodeId'])\n || typeof data['approvalDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['approvalDigest'])\n || (data['childRunId'] !== null && (typeof data['childRunId'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['childRunId'])))))\n throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'nodeId must be a workflow node id, approvalDigest a 64-character lowercase hex digest, and childRunId null or a workflow run id.' });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const common = { scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId, runId: workflowControlMatch[1]!,\n revision: data['revision'] as number, commandId: data['commandId'] as string, signal };\n const operation = Promise.resolve().then(() => action === 'cancel' ? workflowControls.cancel(Object.freeze(common))\n : workflowControls.approve(Object.freeze({ ...common, nodeId: data['nodeId'] as string, approvalDigest: data['approvalDigest'] as string,\n childRunId: data['childRunId'] as string | null }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowControlMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowControlMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n const workflowSignalMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/signals$/.exec(url.pathname);\n if (workflowSignalMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control'); if (!workflowSignals) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowSignals' });\n const data = await body(request, signal); exact(data, ['commandId', 'revision', 'signalId', 'signalName', 'value']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1 || typeof data['signalId'] !== 'string' || !identifier.test(data['signalId'])\n || typeof data['signalName'] !== 'string' || !identifier.test(data['signalName'])) throw new HttpFailure(400, 'INVALID_REQUEST', { message: `${commandFields} signalId and signalName must be identifiers of the same form.` });\n let value: JsonValue; try { value = freezeJson(jsonValue(data['value'], { maxBytes: 4_096, maxDepth: 16, maxNodes: 1_024 })); }\n catch { throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'value must be JSON of at most 4,096 bytes, 16 levels and 1,024 values.' }); }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => workflowSignals.deliver(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n actorId: identity.scope.principalId, runId: workflowSignalMatch[1]!, revision: data['revision'] as number,\n commandId: data['commandId'] as string, signalId: data['signalId'] as string, signalName: data['signalName'] as string,\n value, signal }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowSignalMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowSignalMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n const migrationMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/migrations(?:\\/([A-Za-z0-9][A-Za-z0-9._-]{0,127}))?$/.exec(url.pathname);\n if (migrationMatch && (request.method === 'GET' || (request.method === 'POST' && migrationMatch[2] !== undefined))) {\n const runId = migrationMatch[1]!; const migrationId = migrationMatch[2];\n const capability = request.method === 'POST' ? 'workflows:migrate' as const : 'workflows:read' as const;\n requireCapability(identity, capability); if (!workflowMigrations) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'workflowMigrations' });\n let data: JsonObject | undefined;\n if (request.method === 'POST') {\n data = await body(request, signal); exact(data, ['commandId', 'revision']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n }\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const base = { scope: identity.scope, agentIds: identity.agentIds, runId, signal };\n const operation = Promise.resolve().then((): Promise<unknown> => migrationId === undefined ? workflowMigrations.list(Object.freeze(base))\n : data === undefined ? workflowMigrations.plan(Object.freeze({ ...base, migrationId }))\n : workflowMigrations.apply(Object.freeze({ ...base, actorId: identity.scope.principalId, revision: data['revision'] as number,\n commandId: data['commandId'] as string, migrationId }))).finally(() => { workflowOperations--; });\n let result: unknown;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, capability);\n if (migrationId === undefined) {\n if (result === null) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n if (!Array.isArray(result) || result.length > 256) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const migrations = result.map(migrationRecord);\n if (new Set(migrations.map(item => item.id)).size !== migrations.length) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ migrations });\n }\n if (data === undefined) {\n if (result === null) throw new HttpFailure(404, 'MIGRATION_NOT_FOUND');\n return respond({ plan: migrationPlan(result, runId, migrationId) });\n }\n let raw: JsonObject; try { raw = object(result, 524_288); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, runId, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n if (raw['status'] === 'refused') {\n workflowExact(raw, ['status', 'plan']); const plan = migrationPlan(raw['plan'], runId, migrationId);\n if (plan.allowed) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n await checkRoute();\n return failureResponse(new HttpFailure(409, 'MIGRATION_REFUSED'), { plan: plan as unknown as JsonValue });\n }\n workflowExact(raw, ['status', 'plan', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const plan = migrationPlan(raw['plan'], runId, migrationId); const record = workflowRecord(raw['workflow'], runId);\n if (!plan.allowed || record.revision <= (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ plan, workflow: record });\n }\n // Continuation and operator pause share one exact revision-bound body; each has its own least-authority adapter.\n const workflowResumeMatch = /^\\/v1\\/workflow-runs\\/([a-f0-9]{64})\\/(resume|pause)$/.exec(url.pathname);\n if (workflowResumeMatch && request.method === 'POST') {\n requireCapability(identity, 'workflows:control');\n const callback = workflowResumeMatch[2] === 'pause' ? workflowPauses?.pause : workflowResumes?.resume;\n if (!callback) throw new HttpFailure(404, 'NOT_ENABLED', { option: workflowResumeMatch[2] === 'pause' ? 'workflowPauses' : 'workflowResumes' });\n const data = await body(request, signal); exact(data, ['commandId', 'revision']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['revision'] !== 'number'\n || !Number.isSafeInteger(data['revision']) || data['revision'] < 1) throw new HttpFailure(400, 'INVALID_REQUEST', { message: commandFields });\n await checkRoute();\n if (workflowOperations >= limits.maxWorkflowOperations) throw new HttpFailure(429, 'WORKFLOW_LIMIT'); workflowOperations++;\n const operation = Promise.resolve().then(() => callback(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds,\n actorId: identity.scope.principalId, runId: workflowResumeMatch[1]!, revision: data['revision'] as number,\n commandId: data['commandId'] as string, signal }))).finally(() => { workflowOperations--; });\n let result: WorkflowControlResult;\n try { result = await bounded(operation, signal); } catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'WORKFLOW_UNAVAILABLE'); }\n assertActive(signal); requireCapability(identity, 'workflows:control');\n let raw: JsonObject; try { raw = object(result, 262_144); } catch { throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID'); }\n if (raw['status'] === 'conflict' && Object.keys(raw).length === 1) throw await workflowConflict(identity, workflowResumeMatch[1]!, signal);\n if (raw['status'] === 'not_found' && Object.keys(raw).length === 1) throw new HttpFailure(404, 'WORKFLOW_RUN_NOT_FOUND');\n workflowExact(raw, ['status', 'workflow']); if (raw['status'] !== 'applied') throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n const record = workflowRecord(raw['workflow'], workflowResumeMatch[1]!);\n if (record.revision < (data['revision'] as number)) throw new HttpFailure(503, 'WORKFLOW_TRANSPORT_INVALID');\n return respond({ workflow: record });\n }\n if (request.method === 'GET' && url.pathname === '/v1/session') {\n // What this token may do and which optional APIs this server offers it, so a UI shows only usable views.\n const has = (prefix: string): boolean => identity.capabilities.some(capability => capability.startsWith(prefix));\n const features = [\n ...(authorization ? ['authorization'] : []),\n ...(has('humans:') && humanRequests ? ['humanRequests'] : []),\n ...(has('workflows:') ? ([['workflowIndex', workflowIndex], ['workflowViews', workflowViews], ['workflowControls', workflowControls],\n ['workflowSignals', workflowSignals], ['workflowResumes', workflowResumes], ['workflowPauses', workflowPauses], ['workflowFleet', workflowFleet],\n ['workflowMigrations', workflowMigrations]] as const).filter(([, enabled]) => enabled !== undefined).map(([name]) => name) : []),\n ...(has('runs:') && runRecords ? ['runRecords'] : []),\n ...(has('threads:') && conversationStore ? ['threads'] : []),\n ...(identity.capabilities.includes('runs:approve') ? ['runApprovals'] : []),\n ...(identity.capabilities.includes('runs:resume') && conversationStore && runRecords ? ['toolContinuations'] : []),\n ...(compaction && identity.capabilities.includes('threads:compact') && identity.capabilities.includes('threads:read')\n && identity.agentIds.some(id => compaction.allows(id)) ? ['threadCompaction'] : []),\n ];\n return respond({ session: { scope: identity.scope, agentIds: identity.agentIds, capabilities: identity.capabilities, expiresAtMs: identity.expiresAtMs, features } });\n }\n if (request.method === 'GET' && url.pathname === '/v1/agents') {\n requireCapability(identity, 'runs:read');\n return respond({ agents: (await filterAuthorized([...registry.values()].filter(config => identity.agentIds.includes(config.agent.id)), identity, 'agent', config => config.agent.id, signal)).map(config => ({ id: config.agent.id, version: config.agent.version })) });\n }\n if (request.method === 'GET' && url.pathname === '/v1/operations/health') {\n requireCapability(identity, 'operations:read');\n const results = await Promise.all(healthChecks.map(async health => {\n if (healthOperations >= limits.maxHealthOperations) return { id: health.id, status: 'unavailable' as const };\n healthOperations++;\n const operation = Promise.resolve().then(() => health.check(Object.freeze({ signal, scope: identity.scope })))\n .finally(() => { healthOperations--; });\n try { return { id: health.id, status: await bounded(operation, signal) === true ? 'ready' as const : 'unavailable' as const }; }\n catch { return { id: health.id, status: 'unavailable' as const }; }\n }));\n assertActive(signal); requireCapability(identity, 'operations:read');\n const checks = [{ id: 'server', status: 'ready' as const }, ...results];\n const ready = checks.every(check => check.status === 'ready');\n return respond({ status: ready ? 'ready' : 'degraded', checks }, ready ? 200 : 503);\n }\n if (request.method === 'GET' && url.pathname === '/v1/tools') {\n requireCapability(identity, 'operations:read');\n const afterText = url.searchParams.get('after') ?? '0'; const limitText = url.searchParams.get('limit') ?? '50';\n if (!/^\\d+$/.test(afterText) || !/^\\d+$/.test(limitText)) throw new HttpFailure(400, 'INVALID_CURSOR');\n const after = Number(afterText); const limit = Number(limitText);\n if (!Number.isSafeInteger(after) || !Number.isSafeInteger(limit) || limit < 1 || limit > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const visible = toolCatalog.filter(tool => identity.agentIds.includes(tool.agentId));\n if (after > visible.length) throw new HttpFailure(400, 'INVALID_CURSOR');\n const page = visible.slice(after, after + limit); const next = after + page.length;\n const tools = await filterAuthorized(page, identity, 'tool', tool => tool.id, signal);\n return respond({ tools, next: next < visible.length ? next : null });\n }\n if (request.method === 'GET' && url.pathname === '/v1/human-requests') {\n requireCapability(identity, 'humans:read'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const after = await readCursor(url.searchParams.get('after'), identity, 'human_request', signal); const limitText = url.searchParams.get('limit') ?? '50';\n if ((after !== null && !/^[A-Za-z0-9._:-]{1,128}$/.test(after)) || !/^\\d+$/.test(limitText) || Number(limitText) < 1 || Number(limitText) > 100) throw new HttpFailure(400, 'INVALID_CURSOR');\n const page = await humanCall(() => humanRequests.list(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, after, limit: Number(limitText), signal })), signal);\n let raw: JsonObject; try { raw = object(page, 1_048_576); exact(raw, ['items', 'next']); } catch { throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID'); }\n if (!Array.isArray(raw['items']) || raw['items'].length > Number(limitText) || (raw['next'] !== null && (typeof raw['next'] !== 'string' || !/^[A-Za-z0-9._:-]{1,128}$/.test(raw['next'])))) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n const items = raw['items'].map(item => humanRecord(item, identity));\n if (new Set(items.map(item => item.id)).size !== items.length) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:read'); return respond({ items: await filterAuthorized(items, identity, 'human_request', item => item.id, signal), next: await writeCursor(raw['next'] as string | null, identity, 'human_request', signal) });\n }\n const humanMatch = /^\\/v1\\/human-requests\\/([A-Za-z0-9][A-Za-z0-9._-]{0,79})(?:\\/responses)?$/.exec(url.pathname);\n if (humanMatch && request.method === 'GET' && !url.pathname.endsWith('/responses')) {\n requireCapability(identity, 'humans:read'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const item = await humanCall(() => humanRequests.inspect(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, id: humanMatch[1]!, signal })), signal);\n if (item === null) throw new HttpFailure(404, 'HUMAN_REQUEST_NOT_FOUND'); const record = humanRecord(item, identity);\n if (record.id !== humanMatch[1]) throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:read'); return respond({ request: record });\n }\n if (humanMatch && request.method === 'POST' && url.pathname.endsWith('/responses')) {\n requireCapability(identity, 'humans:respond'); if (!humanRequests) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'humanRequests' });\n const data = await body(request, signal); exact(data, ['commandId', 'requestDigest', 'value']);\n if (typeof data['commandId'] !== 'string' || !identifier.test(data['commandId']) || typeof data['requestDigest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['requestDigest'])) throw new HttpFailure(400, 'INVALID_REQUEST', { message: `${commandFields.replace(' and revision a positive integer', '')} requestDigest must be the request's 64-character lowercase hex digest.` });\n await checkRoute();\n const item = await humanCall(() => humanRequests.respond(Object.freeze({ scope: identity.scope, agentIds: identity.agentIds, actorId: identity.scope.principalId,\n id: humanMatch[1]!, commandId: data['commandId'] as string, requestDigest: data['requestDigest'] as string, value: data['value']!, signal })), signal);\n const record = humanRecord(item, identity);\n if (record.id !== humanMatch[1] || record.digest !== data['requestDigest'] || record.status === 'waiting') throw new HttpFailure(503, 'HUMAN_TRANSPORT_INVALID');\n assertActive(signal); requireCapability(identity, 'humans:respond'); return respond({ request: record });\n }\n const compactionMatch = /^\\/v1\\/threads\\/([^/]+)\\/compactions(?:\\/([^/]+)(?:\\/(cancel))?)?$/.exec(url.pathname);\n if (compactionMatch) {\n requireCapability(identity, 'threads:compact'); requireCapability(identity, 'threads:read');\n if (!compaction || !conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threadCompaction' });\n const decode = (value: string): string => {\n let decoded: string; try { decoded = decodeURIComponent(value); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(decoded)) throw new HttpFailure(400, 'INVALID_REQUEST'); return decoded;\n };\n const id = decode(compactionMatch[1]!); const commandId = compactionMatch[2] === undefined ? undefined : decode(compactionMatch[2]);\n const thread = await conversationCall(() => scopedThreads(identity.scope).get(id), signal);\n if (!thread || !['active', 'archived'].includes(thread.status) || thread.agentId === null\n || !identity.agentIds.includes(thread.agentId) || !compaction.allows(thread.agentId)) throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n if (request.method === 'GET' && commandId && !compactionMatch[3]) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n const view = await conversationCall(() => compaction.inspect(identity.scope, id, commandId, signal), signal);\n assertActive(signal); requireCapability(identity, 'threads:compact');\n if (!view) throw new HttpFailure(404, 'THREAD_COMPACTION_NOT_FOUND'); return respond({ compaction: view });\n }\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n requireCapability(identity, 'threads:write');\n if (commandId && compactionMatch[3] === 'cancel') {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond(await conversationCall(() => compaction.cancel(identity.scope, id, commandId, signal), signal));\n }\n if (commandId) throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n const data = await body(request, signal);\n exact(data, ['commandId', 'through', ...('previousSummarySequence' in data ? ['previousSummarySequence'] : [])]);\n if (typeof data['commandId'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['commandId'])\n || !Number.isSafeInteger(data['through']) || (data['through'] as number) < 1 || (data['through'] as number) > 999_999_997\n || (data['previousSummarySequence'] !== undefined && (!Number.isSafeInteger(data['previousSummarySequence'])\n || (data['previousSummarySequence'] as number) < 1 || (data['previousSummarySequence'] as number) > 999_999_999))) throw new HttpFailure(400, 'INVALID_REQUEST');\n assertActive(signal); requireCapability(identity, 'threads:compact'); requireCapability(identity, 'threads:write');\n await checkRoute();\n try {\n const result = await compaction.compact(identity.scope, id, { commandId: data['commandId'], through: data['through'] as number,\n ...(data['previousSummarySequence'] === undefined ? {} : { previousSummarySequence: data['previousSummarySequence'] as number }) }, signal, identity.expiresAtMs);\n assertActive(signal); requireCapability(identity, 'threads:compact'); return respond({ result });\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'LIMIT_EXCEEDED') throw new HttpFailure(422, 'THREAD_COMPACTION_LIMIT');\n if (error instanceof MayuraError && error.code === 'CANCELLED') throw new HttpFailure(409, 'THREAD_COMPACTION_CANCELLED');\n return conversationCall(() => Promise.reject(error), signal);\n }\n }\n const threadMatch = /^\\/v1\\/threads(?:\\/([^/]+)(?:\\/(entries|archive|restore))?)?$/.exec(url.pathname);\n if (threadMatch) {\n const reading = request.method === 'GET'; const deleting = request.method === 'DELETE';\n requireCapability(identity, deleting ? 'threads:delete' : reading ? 'threads:read' : 'threads:write');\n if (!conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threads' });\n const threads = scopedThreads(identity.scope, signal); let id: string | undefined;\n if (threadMatch[1]) {\n try { id = decodeURIComponent(threadMatch[1]); } catch { throw new HttpFailure(400, 'INVALID_REQUEST'); }\n if (!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(id)) throw new HttpFailure(400, 'INVALID_REQUEST');\n }\n const action = threadMatch[2];\n if (!id && reading) {\n const status = url.searchParams.get('status') ?? 'active'; const limit = url.searchParams.get('limit') ?? '20';\n const cursor = await readCursor(url.searchParams.get('cursor'), identity, `thread:${status}`, signal);\n if (!['active', 'archived', 'all'].includes(status) || !/^[1-9][0-9]?$|^100$/.test(limit)\n || (cursor !== null && (cursor.length === 0 || cursor.length > 256))) throw new HttpFailure(400, 'INVALID_CURSOR');\n // HTTP listing owns its existing identity-bound cursor and row policy checks; avoid nesting service cursors.\n const listing = createThreads({ store: conversationStore!, scope: identity.scope, permissions: { allow: ['thread:read'] } });\n const page = await conversationCall(() => listing.list({ status: status as 'active' | 'archived' | 'all', limit: Number(limit), ...(cursor ? { cursor } : {}) }), signal);\n return respond({ ...page, threads: await filterAuthorized(page.threads, identity, 'thread', thread => thread.id, signal), cursor: await writeCursor(page.cursor, identity, `thread:${status}`, signal) });\n }\n if (!id && request.method === 'POST') {\n const data = await body(request, signal);\n if (Object.keys(data).some(key => !['id', 'agentId', 'title', 'metadata'].includes(key))) throw new HttpFailure(400, 'INVALID_REQUEST');\n if (data['agentId'] !== undefined && (typeof data['agentId'] !== 'string' || !identity.agentIds.includes(data['agentId']) || !registry.has(data['agentId']))) throw new HttpFailure(404, 'AGENT_NOT_FOUND');\n requireCapability(identity, 'threads:write');\n if (data['id'] !== undefined && (typeof data['id'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['id']))) throw new HttpFailure(400, 'INVALID_REQUEST');\n const id = typeof data['id'] === 'string' ? data['id'] : crypto.randomUUID();\n if (authorization) requireCapability(identity, 'threads:read');\n await authorize(identity, 'thread', id, 'create', signal);\n await authorize(identity, 'thread', id, 'read', signal);\n const thread = await conversationCall(() => threads.create({ ...data, id } as Parameters<Threads['create']>[0]), signal);\n await authorize(identity, 'thread', id, 'read', signal);\n return respond({ thread }, 201);\n }\n if (id && reading && !action) {\n const thread = await conversationCall(() => threads.get(id!), signal);\n if (!thread || thread.status === 'deleted' || thread.status === 'deleting') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n return respond({ thread });\n }\n if (id && request.method === 'POST' && action === 'entries') {\n requireCapability(identity, 'threads:import'); requireCapability(identity, 'threads:read');\n await checkRoute(); const data = await body(request, signal);\n return respond({ entries: await conversationCall(() => threads.append(id!, data as unknown as Parameters<Threads['append']>[1]), signal) });\n }\n if (id && reading && action === 'entries') {\n const after = url.searchParams.get('after'); const before = url.searchParams.get('before'); const limit = url.searchParams.get('limit') ?? '100';\n if ((after !== null && before !== null) || [after, before].some(value => value !== null && (!/^[0-9]{1,10}$/.test(value) || !Number.isSafeInteger(Number(value))))\n || !/^[1-9][0-9]{0,2}$/.test(limit) || Number(limit) > 500) throw new HttpFailure(400, 'INVALID_CURSOR');\n const thread = await conversationCall(() => threads.get(id!), signal);\n if (!thread || thread.status === 'deleted' || thread.status === 'deleting') throw new HttpFailure(404, 'THREAD_NOT_FOUND');\n return respond({ entries: await conversationCall(() => threads.entries(id!, { limit: Number(limit), ...(after !== null ? { after: Number(after) } : {}), ...(before !== null ? { before: Number(before) } : {}) }), signal) });\n }\n if (id && deleting && !action) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond(await conversationCall(() => threads.delete(id!), signal));\n }\n if (id && request.method === 'POST' && (action === 'archive' || action === 'restore')) {\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n await checkRoute();\n return respond({ thread: await conversationCall(() => threads[action](id!), signal) });\n }\n if (id && request.method === 'POST' && !action) {\n const data = await body(request, signal);\n if (Object.keys(data).some(key => !['title', 'metadata', 'expectedVersion'].includes(key)) || (!('title' in data) && !('metadata' in data))) throw new HttpFailure(400, 'INVALID_REQUEST');\n if (data['expectedVersion'] !== undefined && (!Number.isSafeInteger(data['expectedVersion']) || (data['expectedVersion'] as number) < 1)) throw new HttpFailure(400, 'INVALID_REQUEST');\n requireCapability(identity, 'threads:write');\n await checkRoute();\n return respond({ thread: await conversationCall(() => threads.update(id!, data as Parameters<Threads['update']>[1]), signal) });\n }\n throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n }\n const toolResumeMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/tool-results\\/resume$/.exec(url.pathname);\n if (toolResumeMatch) {\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n for (const capability of ['runs:resume', 'runs:read', 'threads:read', 'threads:write'] as const) requireCapability(identity, capability);\n if (!conversationStore || !runRecords || runExecution !== 'background') throw new HttpFailure(404, 'NOT_ENABLED');\n const runId = toolResumeMatch[1]!; const data = await body(request, signal); exact(data, ['callId', 'digest']);\n if (typeof data['callId'] !== 'string' || !data['callId'].length || data['callId'].length > 128\n || typeof data['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['digest'])) throw new HttpFailure(400, 'INVALID_REQUEST');\n const checkpoint = await savedRun(runId, identity, signal);\n if (!checkpoint || checkpoint.body['waitKind'] !== 'frontend') throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n const agentId = (checkpoint.body['agent'] as JsonObject)['id'] as string;\n const bound = checkpoint.body['recording'];\n if (!bound || typeof bound !== 'object' || Array.isArray(bound) || typeof bound['threadId'] !== 'string') throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n await authorize(identity, 'thread', bound['threadId'], 'read', signal); await authorize(identity, 'thread', bound['threadId'], 'append', signal);\n const thread = await conversationCall(() => scopedThreads(identity.scope).get(bound['threadId'] as string), signal);\n if (!thread || thread.status !== 'active' || thread.agentId !== agentId) throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n await authorize(identity, 'agent', agentId, 'execute', signal); await checkRoute(); assertActive(signal);\n const local = runs.get(runId);\n if (local && (local.owner !== owner || !identity.agentIds.includes(local.agentId))) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n let entry = local && !local.lost ? local : undefined;\n if (!entry && runs.size >= limits.maxRuns && !local) throw new HttpFailure(429, 'RUN_LIMIT');\n if (local?.lost) release(local);\n const runtime = entry?.runtime ?? runtimeFor(owner, agentId, identity.scope);\n try {\n const handle = await runtime.resumeTool(runId, { callId: data['callId'], digest: data['digest'] });\n if (!handle) return respond({ id: runId, profile: 'ephemeral' }, 202);\n const offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n const runtimeKey = JSON.stringify([owner, agentId]);\n entry = { owner, agentId, digest: '', handle, runtime, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); entry.persisted = persist(entry);\n }\n return respond({ id: runId, profile: 'ephemeral' }, 202);\n } catch (error) {\n resumeOffsets.delete(runId);\n if (error instanceof MayuraError && ['CONFLICT', 'NOT_FOUND', 'DEFINITION_CHANGED'].includes(error.code)) throw new HttpFailure(409, 'TOOL_CONTINUATION_CONFLICT');\n if (error instanceof MayuraError && error.code === 'PERMISSION_DENIED') throw new HttpFailure(403, 'AUTHORIZATION_DENIED');\n if (error instanceof HttpFailure) throw error;\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n }\n const approvalMatch = /^\\/v1\\/runs\\/([a-f0-9-]{36})\\/approvals$/.exec(url.pathname);\n if (approvalMatch) {\n if (request.method !== 'POST') throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n requireCapability(identity, 'runs:approve');\n const runId = approvalMatch[1]!; const data = await body(request, signal);\n exact(data, ['callId', 'digest', 'decision', ...('reason' in data ? ['reason'] : [])]);\n if (typeof data['callId'] !== 'string' || data['callId'].length > 128 || typeof data['digest'] !== 'string' || !/^[a-f0-9]{64}$/.test(data['digest'])\n || !['approved', 'rejected'].includes(data['decision'] as string) || (data['reason'] !== undefined && (typeof data['reason'] !== 'string' || data['reason'].length > 1000))) throw new HttpFailure(400, 'INVALID_REQUEST');\n const local = runs.get(runId);\n let entry = local && !local.lost && local.owner === owner && identity.agentIds.includes(local.agentId) ? local : undefined;\n if (local && !local.lost && !entry) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n let runtime = entry?.runtime; let agentId = entry?.agentId; let offset: number | undefined;\n if (!entry) {\n if (!conversationStore) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n const checkpoint = await savedRun(runId, identity, signal);\n if (!checkpoint) {\n if (runRecords) {\n const recorded = await readRecord(owner, runId, signal);\n if (recorded && identity.agentIds.includes(recorded.agentId)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n }\n throw new HttpFailure(404, 'RUN_NOT_FOUND');\n }\n const agent = checkpoint.body['agent'] as JsonObject;\n const pending = checkpoint.body['pending'];\n if (!pending || typeof pending !== 'object' || Array.isArray(pending) || pending['callId'] !== data['callId'] || pending['digest'] !== data['digest']\n || typeof pending['expiresAtMs'] !== 'number' || pending['expiresAtMs'] <= Date.now()) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n agentId = agent['id'] as string; const runtimeKey = JSON.stringify([owner, agentId]); makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n if (local?.lost) release(local);\n runtime = runtimeFor(owner, agentId, identity.scope);\n\n }\n assertActive(signal); requireCapability(identity, 'runs:approve');\n await checkRoute();\n try {\n const handle = await runtime!.approve(runId, { callId: data['callId'], digest: data['digest'], decision: data['decision'] as 'approved' | 'rejected',\n actorId: identity.scope.principalId, ...(typeof data['reason'] === 'string' ? { reason: data['reason'] } : {}) });\n offset = resumeOffsets.get(runId); resumeOffsets.delete(runId);\n if (!entry) {\n const runtimeKey = JSON.stringify([owner, agentId]);\n entry = { owner, agentId: agentId!, digest: '', handle, runtime: runtime!, runtimeKey, submissionKey: '', ...(offset === undefined ? {} : { eventOffset: offset }) };\n retain(entry); if (runRecords) entry.persisted = persist(entry);\n }\n if (runExecution === 'request') {\n if (local && runRecords) entry.persisted = persist(entry);\n await entry.persisted;\n }\n return respond({ id: handle.id, profile: 'ephemeral' }, 202);\n } catch (error) {\n if (error instanceof MayuraError && error.code === 'DEFINITION_CHANGED') {\n await settleSaved(owner, runId, 'failed', 'DEFINITION_CHANGED', 'The agent changed while the run waited for approval.', signal);\n } else resumeOffsets.delete(runId);\n if (error instanceof HttpFailure) throw error;\n if (error instanceof MayuraError && ['CONFLICT', 'DEFINITION_CHANGED', 'NOT_FOUND'].includes(error.code)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n if (error instanceof MayuraError && error.code === 'INVALID_INPUT') throw new HttpFailure(400, 'INVALID_REQUEST');\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n }\n if (request.method === 'POST' && url.pathname === '/v1/runs') {\n requireCapability(identity, 'runs:submit');\n const key = request.headers.get('idempotency-key') ?? '';\n if (!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(key)) throw new HttpFailure(400, 'IDEMPOTENCY_KEY_REQUIRED');\n const data = await body(request, signal, runBodyBytes); exact(data, ['agentId', 'input', ...('media' in data ? ['media'] : []), ...('threadId' in data ? ['threadId'] : [])]);\n const agentId = data['agentId'];\n if (typeof agentId !== 'string' || !identity.agentIds.includes(agentId) || !registry.has(agentId)) throw new HttpFailure(404, 'AGENT_NOT_FOUND');\n const config = registry.get(agentId)!;\n if ('threadId' in data) {\n requireCapability(identity, 'threads:read'); requireCapability(identity, 'threads:write');\n if (!conversationStore) throw new HttpFailure(404, 'NOT_ENABLED', { option: 'threads' });\n if (typeof data['threadId'] !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(data['threadId'])) throw new HttpFailure(400, 'INVALID_REQUEST');\n if ('media' in data) throw new HttpFailure(400, 'INVALID_REQUEST');\n }\n await authorize(identity, 'agent', agentId, 'submit', signal);\n if (typeof data['threadId'] === 'string') {\n await authorize(identity, 'thread', data['threadId'], 'read', signal);\n await authorize(identity, 'thread', data['threadId'], 'append', signal);\n }\n // Media is checked here against the agent's policy and limits, so a refusal says exactly why.\n const media = await submittedMedia(data['media'], identity.scope, signal);\n try { admitMedia(media, config.agent.media, config.limits?.maxMediaBytes ?? 20_971_520, 'INVALID_INPUT', `Agent ${agentId}`); }\n catch (error) { throw new HttpFailure(400, 'INVALID_MEDIA', { message: error instanceof MayuraError ? error.message : 'The media was refused.' }); }\n const digestBytes = await crypto.subtle.digest('SHA-256', encoder.encode(canonical({ agentId, version: config.agent.version, input: data['input']!, ...('threadId' in data ? { threadId: data['threadId']! } : {}),\n ...(media.length > 0 ? { media: await mediaDigests(media) } : {}) })));\n const digest = [...new Uint8Array(digestBytes)].map(value => value.toString(16).padStart(2, '0')).join('');\n assertActive(signal); requireCapability(identity, 'runs:submit');\n if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n const submissionKey = JSON.stringify([owner, key]);\n const previous = submissions.get(submissionKey) ?? await pendingSubmissions.get(submissionKey);\n if (previous === 'duplicate') throw new HttpFailure(409, 'SUBMISSION_OUTCOME_UNKNOWN');\n if (previous && typeof previous === 'object' && 'replay' in previous) {\n if (previous.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n await authorize(identity, 'run', previous.replay, 'read', signal);\n return respond({ id: previous.replay, profile: 'ephemeral' }, 200);\n }\n if (previous) {\n if (previous.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n await authorize(identity, 'run', previous.handle.id, 'read', signal);\n return respond({ id: previous.handle.id, profile: 'ephemeral' }, 200);\n }\n const expired = tombstones.get(submissionKey);\n if (expired !== undefined) throw new HttpFailure(expired === digest ? 410 : 409, expired === digest ? 'RUN_EXPIRED' : 'IDEMPOTENCY_CONFLICT');\n const runtimeKey = JSON.stringify([owner, agentId]);\n makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n if (!runtimes.has(runtimeKey) && runtimes.size >= limits.maxRuntimes) throw new HttpFailure(429, 'RUNTIME_LIMIT');\n const start = async (): Promise<Entry | 'duplicate' | Replay> => {\n let claimed = false;\n try {\n if (runRecords) {\n const claim = await recorded(() => runRecords.claim({ owner, key, digest, replicaId, nowMs: Date.now(), signal }), signal) as unknown;\n const result = claim as { status?: unknown; digest?: unknown; runId?: unknown; claimedAtMs?: unknown } | null;\n if (result?.status === 'existing' && typeof result.digest === 'string' && /^[a-f0-9]{64}$/.test(result.digest)\n && (result.runId === null || (typeof result.runId === 'string' && /^[a-f0-9-]{36}$/.test(result.runId))) && Number.isSafeInteger(result.claimedAtMs)) {\n if (result.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n // Another replica, or an earlier process, owns this key: replay its run, wait for it to start, or admit uncertainty.\n if (result.runId !== null) return { replay: result.runId as string, digest };\n if ((result.claimedAtMs as number) >= Date.now() - limits.runLeaseMs - leaseSkewMs) throw new HttpFailure(409, 'SUBMISSION_IN_PROGRESS');\n return 'duplicate';\n }\n if (result?.status !== 'claimed') throw new HttpFailure(503, 'RUN_RECORDS_UNAVAILABLE');\n claimed = true;\n }\n if (submissionJournal) {\n let claim: unknown;\n try { claim = await bounded(Promise.resolve().then(() => submissionJournal.claim(Object.freeze({ owner, key, digest, signal }))), signal); }\n catch (error) { if (error instanceof HttpFailure && error.status === 408) throw error; throw new HttpFailure(503, 'SUBMISSION_JOURNAL_UNAVAILABLE'); }\n const result = claim as { status?: unknown; digest?: unknown } | null;\n if (result?.status === 'existing' && typeof result.digest === 'string') {\n // A claim made by an earlier process: its ephemeral run is gone, so neither replay nor a new run is truthful.\n if (result.digest !== digest) throw new HttpFailure(409, 'IDEMPOTENCY_CONFLICT');\n return 'duplicate';\n }\n if (result?.status !== 'claimed') throw new HttpFailure(503, 'SUBMISSION_JOURNAL_UNAVAILABLE');\n }\n assertActive(signal); if (closed) throw new HttpFailure(503, 'SERVER_CLOSED');\n makeRoom(runtimeKey);\n if (runs.size >= limits.maxRuns) throw new HttpFailure(429, 'RUN_LIMIT');\n await authorize(identity, 'agent', agentId, 'submit', signal);\n if (typeof data['threadId'] === 'string') { await authorize(identity, 'thread', data['threadId'], 'read', signal); await authorize(identity, 'thread', data['threadId'], 'append', signal); }\n requireCapability(identity, 'runs:submit');\n const runtime = runtimeFor(owner, agentId, identity.scope);\n const handle = 'threadId' in data\n ? (await conversationCall(() => runInThread({ threads: runtimeThreads.get(runtimeKey)!, runtime, agent: config.agent,\n threadId: data['threadId'] as string, input: data['input'] }), signal)).run\n : runtime.submit(config.agent, { input: data['input'], ...(media.length > 0 ? { media } : {}) });\n claimed = false;\n const entry: Entry = { owner, agentId, digest, handle, runtime, runtimeKey, submissionKey };\n retain(entry); submissions.set(submissionKey, entry);\n if (runRecords) {\n // 202 means the run is recorded: without its record no other replica could find it, so it is stopped instead.\n try {\n await recorded(() => runRecords.start({ owner, key, runId: handle.id, agentId, replicaId, leaseExpiresAtMs: Date.now() + limits.runLeaseMs,\n snapshot: inspection(entry), signal }), signal);\n } catch (error) { handle.cancel(); release(entry); throw error; }\n entry.persisted = persist(entry);\n }\n return entry;\n } catch (error) {\n // A claim whose run never started is given back, so a retry with the same key can start it.\n if (claimed && runRecords) void Promise.resolve().then(() => runRecords.release({ owner, key, replicaId, signal: AbortSignal.timeout(limits.requestTimeoutMs) })).catch(() => {});\n throw error;\n }\n };\n const pending = start(); pendingSubmissions.set(submissionKey, pending);\n let started: Entry | 'duplicate' | Replay;\n try { started = await pending; } finally { pendingSubmissions.delete(submissionKey); }\n if (started === 'duplicate') throw new HttpFailure(409, 'SUBMISSION_OUTCOME_UNKNOWN');\n if ('replay' in started) { await authorize(identity, 'run', started.replay, 'read', signal); return respond({ id: started.replay, profile: 'ephemeral' }, 200); }\n // Request mode: answer only once the run has ended and its outcome is recorded, so nothing runs after the response.\n if (runExecution === 'request') await started.persisted;\n return respond({ id: started.handle.id, profile: 'ephemeral' }, 202);\n }\n const match = /^\\/v1\\/runs\\/([a-f0-9-]{36})(?:\\/(cancel|events))?$/.exec(url.pathname);\n if (!match) throw new HttpFailure(404, 'ROUTE_NOT_FOUND');\n const runId = match[1]!; const local = runs.get(runId);\n const entry = local && !local.lost && local.owner === owner && identity.agentIds.includes(local.agentId) ? local : undefined;\n const action = request.method === 'POST' && match[2] === 'cancel' ? 'cancel' : request.method === 'GET' && match[2] === 'events' ? 'events'\n : request.method === 'GET' && !match[2] ? 'read' : null;\n if (!action) throw new HttpFailure(405, 'METHOD_NOT_ALLOWED');\n if (!entry && action === 'read' && (!local || local.lost)) {\n requireCapability(identity, 'runs:read');\n const checkpoint = await savedRun(runId, identity, signal);\n if (checkpoint) return respond(savedInspection(checkpoint));\n }\n if (!entry && action === 'cancel' && (!local || local.lost)) {\n requireCapability(identity, 'runs:cancel');\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST');\n const checkpoint = await savedRun(runId, identity, signal);\n if (checkpoint) {\n const agentId = (checkpoint.body['agent'] as JsonObject)['id'] as string;\n if (local?.lost) release(local);\n await checkRoute();\n try { await runtimeFor(owner, agentId, identity.scope).cancelSaved(runId); }\n catch (error) {\n if (error instanceof MayuraError && ['CONFLICT', 'NOT_FOUND'].includes(error.code)) throw new HttpFailure(409, 'APPROVAL_CONFLICT');\n throw new HttpFailure(503, 'CONVERSATION_UNAVAILABLE');\n }\n await settleSaved(owner, runId, 'cancelled', 'CANCELLED', 'Run cancellation was requested.', signal);\n return respond({ id: runId, cancellationRequested: true }, 202);\n }\n }\n if (!entry) {\n // Not held here: another replica's (or an earlier process's) run, answered from durable run records when configured.\n if (!runRecords || (local && !local.lost)) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n requireCapability(identity, action === 'cancel' ? 'runs:cancel' : 'runs:read');\n if (action === 'cancel' && request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'Send the cancel request without a body.' });\n let cursor = 0;\n if (action === 'events') {\n const text = url.searchParams.get('after') ?? '0';\n if (!/^\\d+$/.test(text) || !Number.isSafeInteger(Number(text))) throw new HttpFailure(400, 'INVALID_CURSOR'); cursor = Number(text);\n }\n const record = await readRecord(owner, runId, signal);\n if (!record || !identity.agentIds.includes(record.agentId)) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n assertActive(signal); requireCapability(identity, action === 'cancel' ? 'runs:cancel' : 'runs:read');\n if (action === 'cancel') {\n if (['running', 'waiting'].includes(record.status)) {\n await checkRoute();\n const records = runRecords;\n if (recordView(await recorded(() => records.requestCancel({ owner, runId, signal }), signal), runId) === null) throw new HttpFailure(404, 'RUN_NOT_FOUND');\n }\n return respond({ id: runId, cancellationRequested: true }, 202);\n }\n if (action === 'events') return eventStream(stop => recordedEvents(owner, runId, cursor, stop), identity, request);\n const saved = ['running', 'waiting'].includes(record.status) ? await savedRun(runId, identity, signal) : undefined;\n if (saved?.body['waitKind'] === 'frontend' && saved.status === 'waiting') return respond(savedInspection(saved));\n return respond({ ...record.snapshot, ...(record.outcome ? { outcome: record.outcome } : {}) });\n }\n if (action === 'cancel') {\n requireCapability(identity, 'runs:cancel');\n if (request.body !== null) throw new HttpFailure(400, 'INVALID_REQUEST', { message: 'Send the cancel request without a body.' });\n await checkRoute();\n assertActive(signal); entry.handle.cancel();\n return respond({ id: entry.handle.id, cancellationRequested: true }, 202);\n }\n if (action === 'events') {\n requireCapability(identity, 'runs:read');\n const cursor = url.searchParams.get('after') ?? '0';\n if (!/^\\d+$/.test(cursor) || !Number.isSafeInteger(Number(cursor))) throw new HttpFailure(400, 'INVALID_CURSOR');\n assertActive(signal);\n if (entry.eventOffset !== undefined && runRecords) return eventStream(stop => recordedEvents(owner, runId, Number(cursor), stop), identity, request);\n return eventStream(stop => entry.handle.observe({ after: Number(cursor), signal: stop })[Symbol.asyncIterator](), identity, request,\n () => { if (entry.finished) entry.collected = true; });\n }\n requireCapability(identity, 'runs:read');\n if (entry.outcome) entry.collected = true;\n return respond({ ...inspection(entry), ...(entry.outcome ? { outcome: entry.outcome } : {}) });\n };\n\n const reconciliation = createApprovalReconciliation(options.approvalReconciliation, {\n ...(conversationStore ? { store: conversationStore.runCheckpoints } : {}), ...(authorization === undefined ? {} : { authorization }),\n read: async (scope, runId, signal) => recordView(await recorded(() => runRecords!.read({ owner: canonical(scope as unknown as JsonValue), runId, signal }), signal), runId),\n abandon: async (scope, runId, signal) => recordView(await recorded(() => runRecords!.abandon({ owner: canonical(scope as unknown as JsonValue), runId, nowMs: Date.now(), signal }), signal), runId),\n agentExists: id => registry.has(id),\n hasRecording: async (scope, checkpoint) => {\n const binding = checkpoint.body['recording']; if (binding === undefined) return false;\n if (!binding || typeof binding !== 'object' || Array.isArray(binding) || typeof binding['threadId'] !== 'string') throw new MayuraError('STORAGE_UNAVAILABLE', 'Invalid thread association.');\n return !!await conversationStore!.threads.recording({ scope: sha256Hex(`mayura:thread-scope:v1\\0${scope.principalId}\\0${scope.projectId}`),\n id: binding['threadId'], runtimeRunId: checkpoint.runId, action: 'read' });\n },\n record: async (scope, checkpoint, receipt) => {\n const binding = checkpoint.body['recording'];\n if (binding !== undefined) {\n if (!binding || typeof binding !== 'object' || Array.isArray(binding)) throw new MayuraError('STORAGE_UNAVAILABLE', 'Invalid thread association.');\n // Keep uncertain transcript/results in the sealed checkpoint, outside model history. Close only its turn.\n await scopedThreads(scope).recorder.complete({ runId: checkpoint.runId, scope, binding, messages: [], approvals: [], reconciliation: receipt,\n outcome: { status: 'outcome_unknown', error: { code: 'OUTCOME_UNKNOWN', message: 'An operator closed the claimed approval without resuming the unfinished run.' } } });\n }\n const entry = runs.get(checkpoint.runId); if (entry) { entry.lost = true; release(entry); }\n },\n timeoutMs: limits.requestTimeoutMs, maxOperations: limits.maxRequests,\n });\n const recovery = createRecoveryController(options.conversationRecovery, {\n scan: (after, limit) => conversationStore!.runCheckpoints.scan({ limit, ...(after ? { after } : {}) }),\n process: recoverCandidate, timeoutMs: submissionTimeoutMs,\n });\n return Object.freeze({\n inspectAuthorizationAudit: () => authorization?.auditSnapshot() ?? null,\n flushAuthorizationAudit: async () => { await authorization?.flushAudit(); },\n recoverConversations: recovery.recover,\n inspectClaimedApproval: reconciliation.inspect, reconcileClaimedApproval: reconciliation.reconcile,\n async fetch(request: Request): Promise<Response> {\n const allow = (result: Response): Response => {\n const requestOrigin = request.headers.get('origin');\n if (requestOrigin && requestOrigin !== publicOrigin && origins.has(requestOrigin)) {\n result.headers.set('Access-Control-Allow-Origin', requestOrigin); result.headers.set('Vary', 'Origin');\n result.headers.set('Access-Control-Expose-Headers', 'Retry-After');\n }\n return result;\n };\n if (closed) return allow(failureResponse(new HttpFailure(503, 'SERVER_CLOSED')));\n if (requests >= limits.maxRequests) return allow(failureResponse(new HttpFailure(429, 'REQUEST_LIMIT')));\n requests++;\n const controller = new AbortController();\n const abort = (): void => { controller.abort(); };\n request.signal.addEventListener('abort', abort, { once: true });\n if (request.signal.aborted) abort();\n const submission = runExecution === 'request' && request.method === 'POST' && /^\\/v1\\/runs(?:\\/[a-f0-9-]{36}\\/approvals)?$/.test(new URL(request.url).pathname);\n const compacting = request.method === 'POST' && /^\\/v1\\/threads\\/[^/]+\\/compactions$/.test(new URL(request.url).pathname);\n const timer = setTimeout(abort, compacting && compaction ? compaction.maxDurationMs + limits.requestTimeoutMs : submission ? submissionTimeoutMs : limits.requestTimeoutMs);\n let result: Response;\n try { result = await bounded(route(request, controller.signal).catch(error => {\n throw error instanceof HttpFailure ? error : new HttpFailure(500, 'INTERNAL_ERROR');\n }), controller.signal); }\n catch (error) {\n result = failureResponse(error instanceof HttpFailure ? error : new HttpFailure(503, 'SERVICE_UNAVAILABLE'));\n } finally { requests--; clearTimeout(timer); request.signal.removeEventListener('abort', abort); }\n return allow(result);\n },\n async close(): Promise<void> {\n closed = true; authorization?.close(); recovery.stop(); reconciliation.stop(); compaction?.stop();\n for (const timer of retentionTimers) clearTimeout(timer); retentionTimers.clear();\n for (const finish of [...streams]) finish();\n await Promise.all([...runtimes.values()].map(runtime => runtime.close()));\n // Let owners record the outcomes of the runs just closed; a write still pending after this ends as outcome_unknown\n // once its lease lapses.\n {\n let timer: ReturnType<typeof setTimeout> | undefined;\n await Promise.race([Promise.allSettled([recovery.settled(), reconciliation.settled(), ...(compaction ? [compaction.settled()] : []), ...persisters]), new Promise(resolve => { timer = setTimeout(resolve, Math.min(5_000, limits.runLeaseMs)); })]);\n clearTimeout(timer);\n }\n persisterStop.abort();\n },\n });\n}\n"]}