mayura 0.1.0-dev.0

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 (1116) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +8 -0
  3. package/README.md +55 -0
  4. package/lib/adapter-code-docker/dist/index.d.ts +65 -0
  5. package/lib/adapter-code-docker/dist/index.d.ts.map +1 -0
  6. package/lib/adapter-code-docker/dist/index.js +228 -0
  7. package/lib/adapter-code-docker/dist/index.js.map +1 -0
  8. package/lib/adapter-code-docker/image/Dockerfile +12 -0
  9. package/lib/adapter-code-docker/package.json +5 -0
  10. package/lib/adapter-code-docker/src/index.ts +244 -0
  11. package/lib/adapter-code-quickjs/dist/index.d.ts +40 -0
  12. package/lib/adapter-code-quickjs/dist/index.d.ts.map +1 -0
  13. package/lib/adapter-code-quickjs/dist/index.js +169 -0
  14. package/lib/adapter-code-quickjs/dist/index.js.map +1 -0
  15. package/lib/adapter-code-quickjs/dist/worker.d.ts +2 -0
  16. package/lib/adapter-code-quickjs/dist/worker.d.ts.map +1 -0
  17. package/lib/adapter-code-quickjs/dist/worker.js +164 -0
  18. package/lib/adapter-code-quickjs/dist/worker.js.map +1 -0
  19. package/lib/adapter-code-quickjs/package.json +5 -0
  20. package/lib/adapter-code-quickjs/src/index.ts +174 -0
  21. package/lib/adapter-code-quickjs/src/worker.ts +142 -0
  22. package/lib/adapter-mcp/dist/index.d.ts +29 -0
  23. package/lib/adapter-mcp/dist/index.d.ts.map +1 -0
  24. package/lib/adapter-mcp/dist/index.js +54 -0
  25. package/lib/adapter-mcp/dist/index.js.map +1 -0
  26. package/lib/adapter-mcp/package.json +5 -0
  27. package/lib/adapter-mcp/src/index.ts +82 -0
  28. package/lib/artifacts/dist/contracts.d.ts +139 -0
  29. package/lib/artifacts/dist/contracts.d.ts.map +1 -0
  30. package/lib/artifacts/dist/contracts.js +2 -0
  31. package/lib/artifacts/dist/contracts.js.map +1 -0
  32. package/lib/artifacts/dist/index.d.ts +3 -0
  33. package/lib/artifacts/dist/index.d.ts.map +1 -0
  34. package/lib/artifacts/dist/index.js +2 -0
  35. package/lib/artifacts/dist/index.js.map +1 -0
  36. package/lib/artifacts/dist/local-store.d.ts +3 -0
  37. package/lib/artifacts/dist/local-store.d.ts.map +1 -0
  38. package/lib/artifacts/dist/local-store.js +922 -0
  39. package/lib/artifacts/dist/local-store.js.map +1 -0
  40. package/lib/artifacts/package.json +5 -0
  41. package/lib/artifacts/src/contracts.ts +159 -0
  42. package/lib/artifacts/src/index.ts +26 -0
  43. package/lib/artifacts/src/local-store.ts +816 -0
  44. package/lib/cli/dist/application.d.ts +85 -0
  45. package/lib/cli/dist/application.d.ts.map +1 -0
  46. package/lib/cli/dist/application.js +116 -0
  47. package/lib/cli/dist/application.js.map +1 -0
  48. package/lib/cli/dist/bin.d.ts +3 -0
  49. package/lib/cli/dist/bin.d.ts.map +1 -0
  50. package/lib/cli/dist/bin.js +394 -0
  51. package/lib/cli/dist/bin.js.map +1 -0
  52. package/lib/cli/dist/dev.d.ts +21 -0
  53. package/lib/cli/dist/dev.d.ts.map +1 -0
  54. package/lib/cli/dist/dev.js +205 -0
  55. package/lib/cli/dist/dev.js.map +1 -0
  56. package/lib/cli/dist/index.d.ts +72 -0
  57. package/lib/cli/dist/index.d.ts.map +1 -0
  58. package/lib/cli/dist/index.js +423 -0
  59. package/lib/cli/dist/index.js.map +1 -0
  60. package/lib/cli/dist/interactive.d.ts +19 -0
  61. package/lib/cli/dist/interactive.d.ts.map +1 -0
  62. package/lib/cli/dist/interactive.js +163 -0
  63. package/lib/cli/dist/interactive.js.map +1 -0
  64. package/lib/cli/dist/operations.d.ts +215 -0
  65. package/lib/cli/dist/operations.d.ts.map +1 -0
  66. package/lib/cli/dist/operations.js +580 -0
  67. package/lib/cli/dist/operations.js.map +1 -0
  68. package/lib/cli/dist/output.d.ts +29 -0
  69. package/lib/cli/dist/output.d.ts.map +1 -0
  70. package/lib/cli/dist/output.js +244 -0
  71. package/lib/cli/dist/output.js.map +1 -0
  72. package/lib/cli/dist/providers.d.ts +54 -0
  73. package/lib/cli/dist/providers.d.ts.map +1 -0
  74. package/lib/cli/dist/providers.js +96 -0
  75. package/lib/cli/dist/providers.js.map +1 -0
  76. package/lib/cli/package.json +5 -0
  77. package/lib/cli/src/application.ts +109 -0
  78. package/lib/cli/src/bin.ts +261 -0
  79. package/lib/cli/src/dev.ts +139 -0
  80. package/lib/cli/src/index.ts +386 -0
  81. package/lib/cli/src/interactive.ts +132 -0
  82. package/lib/cli/src/operations.ts +458 -0
  83. package/lib/cli/src/output.ts +205 -0
  84. package/lib/cli/src/providers.ts +102 -0
  85. package/lib/cli/starters/approval-workflow/Dockerfile +20 -0
  86. package/lib/cli/starters/approval-workflow/README.md +102 -0
  87. package/lib/cli/starters/approval-workflow/compose.yaml +33 -0
  88. package/lib/cli/starters/approval-workflow/dot-dockerignore +7 -0
  89. package/lib/cli/starters/approval-workflow/dot-env.example +41 -0
  90. package/lib/cli/starters/approval-workflow/dot-github/workflows/ci.yml +13 -0
  91. package/lib/cli/starters/approval-workflow/dot-gitignore +10 -0
  92. package/lib/cli/starters/approval-workflow/mayura.project.json +16 -0
  93. package/lib/cli/starters/approval-workflow/package.json +30 -0
  94. package/lib/cli/starters/approval-workflow/src/app.ts +19 -0
  95. package/lib/cli/starters/approval-workflow/src/auth.ts +68 -0
  96. package/lib/cli/starters/approval-workflow/src/config.ts +107 -0
  97. package/lib/cli/starters/approval-workflow/src/dev.ts +59 -0
  98. package/lib/cli/starters/approval-workflow/src/intake.ts +104 -0
  99. package/lib/cli/starters/approval-workflow/src/model.ts +33 -0
  100. package/lib/cli/starters/approval-workflow/src/server.ts +56 -0
  101. package/lib/cli/starters/approval-workflow/src/services.ts +26 -0
  102. package/lib/cli/starters/approval-workflow/src/token.ts +6 -0
  103. package/lib/cli/starters/approval-workflow/src/worker.ts +18 -0
  104. package/lib/cli/starters/approval-workflow/src/workflow.ts +100 -0
  105. package/lib/cli/starters/approval-workflow/test/refunds.test.ts +140 -0
  106. package/lib/cli/starters/approval-workflow/tsconfig.json +20 -0
  107. package/lib/cli/starters/event-automation/Dockerfile +21 -0
  108. package/lib/cli/starters/event-automation/README.md +150 -0
  109. package/lib/cli/starters/event-automation/compose.yaml +41 -0
  110. package/lib/cli/starters/event-automation/dot-dockerignore +7 -0
  111. package/lib/cli/starters/event-automation/dot-env.example +51 -0
  112. package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +13 -0
  113. package/lib/cli/starters/event-automation/dot-gitignore +10 -0
  114. package/lib/cli/starters/event-automation/mayura.project.json +17 -0
  115. package/lib/cli/starters/event-automation/package.json +32 -0
  116. package/lib/cli/starters/event-automation/src/app.ts +19 -0
  117. package/lib/cli/starters/event-automation/src/auth.ts +61 -0
  118. package/lib/cli/starters/event-automation/src/config.ts +138 -0
  119. package/lib/cli/starters/event-automation/src/dev.ts +54 -0
  120. package/lib/cli/starters/event-automation/src/ingress.ts +129 -0
  121. package/lib/cli/starters/event-automation/src/mcp.ts +139 -0
  122. package/lib/cli/starters/event-automation/src/model.ts +33 -0
  123. package/lib/cli/starters/event-automation/src/send-sample.ts +29 -0
  124. package/lib/cli/starters/event-automation/src/server.ts +58 -0
  125. package/lib/cli/starters/event-automation/src/services.ts +54 -0
  126. package/lib/cli/starters/event-automation/src/signing.ts +30 -0
  127. package/lib/cli/starters/event-automation/src/token.ts +7 -0
  128. package/lib/cli/starters/event-automation/src/tracker/main.ts +18 -0
  129. package/lib/cli/starters/event-automation/src/tracker/mcp-server.ts +145 -0
  130. package/lib/cli/starters/event-automation/src/tracker/samples.ts +19 -0
  131. package/lib/cli/starters/event-automation/src/tracker/tickets.ts +54 -0
  132. package/lib/cli/starters/event-automation/src/tracker-tools.ts +38 -0
  133. package/lib/cli/starters/event-automation/src/triage.ts +151 -0
  134. package/lib/cli/starters/event-automation/src/worker.ts +19 -0
  135. package/lib/cli/starters/event-automation/src/workflows.ts +57 -0
  136. package/lib/cli/starters/event-automation/test/automation.test.ts +200 -0
  137. package/lib/cli/starters/event-automation/tsconfig.json +20 -0
  138. package/lib/cli/starters/research-team/Dockerfile +22 -0
  139. package/lib/cli/starters/research-team/README.md +189 -0
  140. package/lib/cli/starters/research-team/compose.yaml +38 -0
  141. package/lib/cli/starters/research-team/dot-dockerignore +7 -0
  142. package/lib/cli/starters/research-team/dot-env.example +49 -0
  143. package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +13 -0
  144. package/lib/cli/starters/research-team/dot-gitignore +10 -0
  145. package/lib/cli/starters/research-team/mayura.project.json +22 -0
  146. package/lib/cli/starters/research-team/package.json +30 -0
  147. package/lib/cli/starters/research-team/src/app.ts +19 -0
  148. package/lib/cli/starters/research-team/src/auth.ts +56 -0
  149. package/lib/cli/starters/research-team/src/config.ts +170 -0
  150. package/lib/cli/starters/research-team/src/desk.ts +124 -0
  151. package/lib/cli/starters/research-team/src/dev.ts +58 -0
  152. package/lib/cli/starters/research-team/src/library/corpus.ts +76 -0
  153. package/lib/cli/starters/research-team/src/library/index.ts +109 -0
  154. package/lib/cli/starters/research-team/src/model.ts +33 -0
  155. package/lib/cli/starters/research-team/src/server.ts +69 -0
  156. package/lib/cli/starters/research-team/src/services.ts +48 -0
  157. package/lib/cli/starters/research-team/src/team.ts +173 -0
  158. package/lib/cli/starters/research-team/src/telemetry.ts +95 -0
  159. package/lib/cli/starters/research-team/src/token.ts +6 -0
  160. package/lib/cli/starters/research-team/src/worker.ts +21 -0
  161. package/lib/cli/starters/research-team/src/workflow.ts +197 -0
  162. package/lib/cli/starters/research-team/test/research.test.ts +271 -0
  163. package/lib/cli/starters/research-team/tsconfig.json +20 -0
  164. package/lib/cli/starters/support-agent/Dockerfile +21 -0
  165. package/lib/cli/starters/support-agent/README.md +128 -0
  166. package/lib/cli/starters/support-agent/compose.yaml +33 -0
  167. package/lib/cli/starters/support-agent/dot-dockerignore +7 -0
  168. package/lib/cli/starters/support-agent/dot-env.example +44 -0
  169. package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +13 -0
  170. package/lib/cli/starters/support-agent/dot-gitignore +10 -0
  171. package/lib/cli/starters/support-agent/mayura.project.json +18 -0
  172. package/lib/cli/starters/support-agent/package.json +43 -0
  173. package/lib/cli/starters/support-agent/src/app.ts +19 -0
  174. package/lib/cli/starters/support-agent/src/assistant.ts +313 -0
  175. package/lib/cli/starters/support-agent/src/auth.ts +69 -0
  176. package/lib/cli/starters/support-agent/src/config.ts +120 -0
  177. package/lib/cli/starters/support-agent/src/dev.ts +115 -0
  178. package/lib/cli/starters/support-agent/src/guardrails.ts +71 -0
  179. package/lib/cli/starters/support-agent/src/model.ts +33 -0
  180. package/lib/cli/starters/support-agent/src/orders.ts +62 -0
  181. package/lib/cli/starters/support-agent/src/returns.ts +86 -0
  182. package/lib/cli/starters/support-agent/src/server.ts +72 -0
  183. package/lib/cli/starters/support-agent/src/services.ts +32 -0
  184. package/lib/cli/starters/support-agent/src/session.ts +55 -0
  185. package/lib/cli/starters/support-agent/src/token.ts +9 -0
  186. package/lib/cli/starters/support-agent/src/worker.ts +19 -0
  187. package/lib/cli/starters/support-agent/test/support.test.ts +263 -0
  188. package/lib/cli/starters/support-agent/tsconfig.json +20 -0
  189. package/lib/cli/starters/support-agent/web/index.html +12 -0
  190. package/lib/cli/starters/support-agent/web/src/App.tsx +43 -0
  191. package/lib/cli/starters/support-agent/web/src/components/chat.tsx +161 -0
  192. package/lib/cli/starters/support-agent/web/src/components/ui/button.tsx +33 -0
  193. package/lib/cli/starters/support-agent/web/src/components/ui/primitives.tsx +48 -0
  194. package/lib/cli/starters/support-agent/web/src/env.d.ts +1 -0
  195. package/lib/cli/starters/support-agent/web/src/lib/api.ts +56 -0
  196. package/lib/cli/starters/support-agent/web/src/lib/utils.ts +4 -0
  197. package/lib/cli/starters/support-agent/web/src/main.tsx +6 -0
  198. package/lib/cli/starters/support-agent/web/src/styles.css +86 -0
  199. package/lib/cli/starters/support-agent/web/tsconfig.json +9 -0
  200. package/lib/cli/starters/support-agent/web/vite.config.ts +13 -0
  201. package/lib/cli/templates/basic-agent.ts +10 -0
  202. package/lib/cli/templates/capability-policy.ts +18 -0
  203. package/lib/cli/templates/code-mode-workflow.ts +34 -0
  204. package/lib/cli/templates/durable-approval.ts +25 -0
  205. package/lib/cli/templates/guarded-streaming-app.ts +23 -0
  206. package/lib/cli/templates/native-memory.ts +15 -0
  207. package/lib/cli/templates/parallel-research.ts +21 -0
  208. package/lib/cli/templates/typed-tool-runner.ts +15 -0
  209. package/lib/client/dist/forms.d.ts +77 -0
  210. package/lib/client/dist/forms.d.ts.map +1 -0
  211. package/lib/client/dist/forms.js +282 -0
  212. package/lib/client/dist/forms.js.map +1 -0
  213. package/lib/client/dist/headless.d.ts +84 -0
  214. package/lib/client/dist/headless.d.ts.map +1 -0
  215. package/lib/client/dist/headless.js +376 -0
  216. package/lib/client/dist/headless.js.map +1 -0
  217. package/lib/client/dist/index.d.ts +266 -0
  218. package/lib/client/dist/index.d.ts.map +1 -0
  219. package/lib/client/dist/index.js +814 -0
  220. package/lib/client/dist/index.js.map +1 -0
  221. package/lib/client/dist/workflows.d.ts +128 -0
  222. package/lib/client/dist/workflows.d.ts.map +1 -0
  223. package/lib/client/dist/workflows.js +379 -0
  224. package/lib/client/dist/workflows.js.map +1 -0
  225. package/lib/client/package.json +5 -0
  226. package/lib/client/src/forms.ts +215 -0
  227. package/lib/client/src/headless.ts +265 -0
  228. package/lib/client/src/index.ts +646 -0
  229. package/lib/client/src/workflows.ts +307 -0
  230. package/lib/client-react/dist/components.d.ts +70 -0
  231. package/lib/client-react/dist/components.d.ts.map +1 -0
  232. package/lib/client-react/dist/components.js +173 -0
  233. package/lib/client-react/dist/components.js.map +1 -0
  234. package/lib/client-react/dist/index.d.ts +29 -0
  235. package/lib/client-react/dist/index.d.ts.map +1 -0
  236. package/lib/client-react/dist/index.js +57 -0
  237. package/lib/client-react/dist/index.js.map +1 -0
  238. package/lib/client-react/package.json +5 -0
  239. package/lib/client-react/src/components.ts +183 -0
  240. package/lib/client-react/src/index.ts +70 -0
  241. package/lib/code-mode/dist/index.d.ts +142 -0
  242. package/lib/code-mode/dist/index.d.ts.map +1 -0
  243. package/lib/code-mode/dist/index.js +498 -0
  244. package/lib/code-mode/dist/index.js.map +1 -0
  245. package/lib/code-mode/package.json +5 -0
  246. package/lib/code-mode/src/index.ts +605 -0
  247. package/lib/code-mode-workflows/dist/index.d.ts +51 -0
  248. package/lib/code-mode-workflows/dist/index.d.ts.map +1 -0
  249. package/lib/code-mode-workflows/dist/index.js +231 -0
  250. package/lib/code-mode-workflows/dist/index.js.map +1 -0
  251. package/lib/code-mode-workflows/package.json +5 -0
  252. package/lib/code-mode-workflows/src/index.ts +259 -0
  253. package/lib/context/dist/assemble.d.ts +11 -0
  254. package/lib/context/dist/assemble.d.ts.map +1 -0
  255. package/lib/context/dist/assemble.js +265 -0
  256. package/lib/context/dist/assemble.js.map +1 -0
  257. package/lib/context/dist/cache.d.ts +53 -0
  258. package/lib/context/dist/cache.d.ts.map +1 -0
  259. package/lib/context/dist/cache.js +147 -0
  260. package/lib/context/dist/cache.js.map +1 -0
  261. package/lib/context/dist/contracts.d.ts +145 -0
  262. package/lib/context/dist/contracts.d.ts.map +1 -0
  263. package/lib/context/dist/contracts.js +2 -0
  264. package/lib/context/dist/contracts.js.map +1 -0
  265. package/lib/context/dist/index.d.ts +4 -0
  266. package/lib/context/dist/index.d.ts.map +1 -0
  267. package/lib/context/dist/index.js +3 -0
  268. package/lib/context/dist/index.js.map +1 -0
  269. package/lib/context/package.json +5 -0
  270. package/lib/context/src/assemble.ts +205 -0
  271. package/lib/context/src/cache.ts +143 -0
  272. package/lib/context/src/contracts.ts +124 -0
  273. package/lib/context/src/index.ts +3 -0
  274. package/lib/core/dist/budget.d.ts +85 -0
  275. package/lib/core/dist/budget.d.ts.map +1 -0
  276. package/lib/core/dist/budget.js +328 -0
  277. package/lib/core/dist/budget.js.map +1 -0
  278. package/lib/core/dist/contracts.d.ts +156 -0
  279. package/lib/core/dist/contracts.d.ts.map +1 -0
  280. package/lib/core/dist/contracts.js +13 -0
  281. package/lib/core/dist/contracts.js.map +1 -0
  282. package/lib/core/dist/errors.d.ts +17 -0
  283. package/lib/core/dist/errors.d.ts.map +1 -0
  284. package/lib/core/dist/errors.js +22 -0
  285. package/lib/core/dist/errors.js.map +1 -0
  286. package/lib/core/dist/event-stream.d.ts +26 -0
  287. package/lib/core/dist/event-stream.d.ts.map +1 -0
  288. package/lib/core/dist/event-stream.js +116 -0
  289. package/lib/core/dist/event-stream.js.map +1 -0
  290. package/lib/core/dist/host.d.ts +7 -0
  291. package/lib/core/dist/host.d.ts.map +1 -0
  292. package/lib/core/dist/host.js +7 -0
  293. package/lib/core/dist/host.js.map +1 -0
  294. package/lib/core/dist/index.d.ts +8 -0
  295. package/lib/core/dist/index.d.ts.map +1 -0
  296. package/lib/core/dist/index.js +7 -0
  297. package/lib/core/dist/index.js.map +1 -0
  298. package/lib/core/dist/json.d.ts +18 -0
  299. package/lib/core/dist/json.d.ts.map +1 -0
  300. package/lib/core/dist/json.js +100 -0
  301. package/lib/core/dist/json.js.map +1 -0
  302. package/lib/core/dist/lifecycle.d.ts +45 -0
  303. package/lib/core/dist/lifecycle.d.ts.map +1 -0
  304. package/lib/core/dist/lifecycle.js +114 -0
  305. package/lib/core/dist/lifecycle.js.map +1 -0
  306. package/lib/core/dist/local-guards.d.ts +4 -0
  307. package/lib/core/dist/local-guards.d.ts.map +1 -0
  308. package/lib/core/dist/local-guards.js +47 -0
  309. package/lib/core/dist/local-guards.js.map +1 -0
  310. package/lib/core/dist/managed-guards.d.ts +44 -0
  311. package/lib/core/dist/managed-guards.d.ts.map +1 -0
  312. package/lib/core/dist/managed-guards.js +146 -0
  313. package/lib/core/dist/managed-guards.js.map +1 -0
  314. package/lib/core/dist/schema.d.ts +36 -0
  315. package/lib/core/dist/schema.d.ts.map +1 -0
  316. package/lib/core/dist/schema.js +24 -0
  317. package/lib/core/dist/schema.js.map +1 -0
  318. package/lib/core/package.json +5 -0
  319. package/lib/core/src/budget.ts +366 -0
  320. package/lib/core/src/contracts.ts +107 -0
  321. package/lib/core/src/errors.ts +33 -0
  322. package/lib/core/src/event-stream.ts +87 -0
  323. package/lib/core/src/host.ts +6 -0
  324. package/lib/core/src/index.ts +7 -0
  325. package/lib/core/src/json.ts +81 -0
  326. package/lib/core/src/lifecycle.ts +133 -0
  327. package/lib/core/src/local-guards.ts +37 -0
  328. package/lib/core/src/managed-guards.ts +154 -0
  329. package/lib/core/src/schema.ts +43 -0
  330. package/lib/exporter-otlp/dist/contracts.d.ts +112 -0
  331. package/lib/exporter-otlp/dist/contracts.d.ts.map +1 -0
  332. package/lib/exporter-otlp/dist/contracts.js +2 -0
  333. package/lib/exporter-otlp/dist/contracts.js.map +1 -0
  334. package/lib/exporter-otlp/dist/index.d.ts +5 -0
  335. package/lib/exporter-otlp/dist/index.d.ts.map +1 -0
  336. package/lib/exporter-otlp/dist/index.js +4 -0
  337. package/lib/exporter-otlp/dist/index.js.map +1 -0
  338. package/lib/exporter-otlp/dist/otlp-http-json.d.ts +4 -0
  339. package/lib/exporter-otlp/dist/otlp-http-json.d.ts.map +1 -0
  340. package/lib/exporter-otlp/dist/otlp-http-json.js +286 -0
  341. package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -0
  342. package/lib/exporter-otlp/dist/run-traces.d.ts +15 -0
  343. package/lib/exporter-otlp/dist/run-traces.d.ts.map +1 -0
  344. package/lib/exporter-otlp/dist/run-traces.js +114 -0
  345. package/lib/exporter-otlp/dist/run-traces.js.map +1 -0
  346. package/lib/exporter-otlp/dist/signals.d.ts +4 -0
  347. package/lib/exporter-otlp/dist/signals.d.ts.map +1 -0
  348. package/lib/exporter-otlp/dist/signals.js +330 -0
  349. package/lib/exporter-otlp/dist/signals.js.map +1 -0
  350. package/lib/exporter-otlp/package.json +5 -0
  351. package/lib/exporter-otlp/src/contracts.ts +119 -0
  352. package/lib/exporter-otlp/src/index.ts +23 -0
  353. package/lib/exporter-otlp/src/otlp-http-json.ts +189 -0
  354. package/lib/exporter-otlp/src/run-traces.ts +86 -0
  355. package/lib/exporter-otlp/src/signals.ts +185 -0
  356. package/lib/guardrails/dist/agent-guard.d.ts +9 -0
  357. package/lib/guardrails/dist/agent-guard.d.ts.map +1 -0
  358. package/lib/guardrails/dist/agent-guard.js +23 -0
  359. package/lib/guardrails/dist/agent-guard.js.map +1 -0
  360. package/lib/guardrails/dist/auxiliary-helpers.d.ts +63 -0
  361. package/lib/guardrails/dist/auxiliary-helpers.d.ts.map +1 -0
  362. package/lib/guardrails/dist/auxiliary-helpers.js +147 -0
  363. package/lib/guardrails/dist/auxiliary-helpers.js.map +1 -0
  364. package/lib/guardrails/dist/auxiliary.d.ts +51 -0
  365. package/lib/guardrails/dist/auxiliary.d.ts.map +1 -0
  366. package/lib/guardrails/dist/auxiliary.js +230 -0
  367. package/lib/guardrails/dist/auxiliary.js.map +1 -0
  368. package/lib/guardrails/dist/batches.d.ts +18 -0
  369. package/lib/guardrails/dist/batches.d.ts.map +1 -0
  370. package/lib/guardrails/dist/batches.js +160 -0
  371. package/lib/guardrails/dist/batches.js.map +1 -0
  372. package/lib/guardrails/dist/disclosure.d.ts +30 -0
  373. package/lib/guardrails/dist/disclosure.d.ts.map +1 -0
  374. package/lib/guardrails/dist/disclosure.js +109 -0
  375. package/lib/guardrails/dist/disclosure.js.map +1 -0
  376. package/lib/guardrails/dist/helpers.d.ts +20 -0
  377. package/lib/guardrails/dist/helpers.d.ts.map +1 -0
  378. package/lib/guardrails/dist/helpers.js +72 -0
  379. package/lib/guardrails/dist/helpers.js.map +1 -0
  380. package/lib/guardrails/dist/index.d.ts +9 -0
  381. package/lib/guardrails/dist/index.d.ts.map +1 -0
  382. package/lib/guardrails/dist/index.js +9 -0
  383. package/lib/guardrails/dist/index.js.map +1 -0
  384. package/lib/guardrails/dist/managed.d.ts +18 -0
  385. package/lib/guardrails/dist/managed.d.ts.map +1 -0
  386. package/lib/guardrails/dist/managed.js +67 -0
  387. package/lib/guardrails/dist/managed.js.map +1 -0
  388. package/lib/guardrails/dist/pipeline.d.ts +55 -0
  389. package/lib/guardrails/dist/pipeline.d.ts.map +1 -0
  390. package/lib/guardrails/dist/pipeline.js +201 -0
  391. package/lib/guardrails/dist/pipeline.js.map +1 -0
  392. package/lib/guardrails/package.json +5 -0
  393. package/lib/guardrails/src/agent-guard.ts +22 -0
  394. package/lib/guardrails/src/auxiliary-helpers.ts +146 -0
  395. package/lib/guardrails/src/auxiliary.ts +202 -0
  396. package/lib/guardrails/src/batches.ts +130 -0
  397. package/lib/guardrails/src/disclosure.ts +92 -0
  398. package/lib/guardrails/src/helpers.ts +67 -0
  399. package/lib/guardrails/src/index.ts +8 -0
  400. package/lib/guardrails/src/managed.ts +64 -0
  401. package/lib/guardrails/src/pipeline.ts +185 -0
  402. package/lib/helpers/dist/concurrency.d.ts +25 -0
  403. package/lib/helpers/dist/concurrency.d.ts.map +1 -0
  404. package/lib/helpers/dist/concurrency.js +106 -0
  405. package/lib/helpers/dist/concurrency.js.map +1 -0
  406. package/lib/helpers/dist/configuration.d.ts +42 -0
  407. package/lib/helpers/dist/configuration.d.ts.map +1 -0
  408. package/lib/helpers/dist/configuration.js +119 -0
  409. package/lib/helpers/dist/configuration.js.map +1 -0
  410. package/lib/helpers/dist/control.d.ts +61 -0
  411. package/lib/helpers/dist/control.d.ts.map +1 -0
  412. package/lib/helpers/dist/control.js +220 -0
  413. package/lib/helpers/dist/control.js.map +1 -0
  414. package/lib/helpers/dist/credentials.d.ts +42 -0
  415. package/lib/helpers/dist/credentials.d.ts.map +1 -0
  416. package/lib/helpers/dist/credentials.js +126 -0
  417. package/lib/helpers/dist/credentials.js.map +1 -0
  418. package/lib/helpers/dist/data.d.ts +30 -0
  419. package/lib/helpers/dist/data.d.ts.map +1 -0
  420. package/lib/helpers/dist/data.js +90 -0
  421. package/lib/helpers/dist/data.js.map +1 -0
  422. package/lib/helpers/dist/index.d.ts +6 -0
  423. package/lib/helpers/dist/index.d.ts.map +1 -0
  424. package/lib/helpers/dist/index.js +6 -0
  425. package/lib/helpers/dist/index.js.map +1 -0
  426. package/lib/helpers/package.json +5 -0
  427. package/lib/helpers/src/concurrency.ts +92 -0
  428. package/lib/helpers/src/configuration.ts +131 -0
  429. package/lib/helpers/src/control.ts +231 -0
  430. package/lib/helpers/src/credentials.ts +113 -0
  431. package/lib/helpers/src/data.ts +105 -0
  432. package/lib/helpers/src/index.ts +5 -0
  433. package/lib/memory/dist/contracts.d.ts +146 -0
  434. package/lib/memory/dist/contracts.d.ts.map +1 -0
  435. package/lib/memory/dist/contracts.js +2 -0
  436. package/lib/memory/dist/contracts.js.map +1 -0
  437. package/lib/memory/dist/index.d.ts +10 -0
  438. package/lib/memory/dist/index.d.ts.map +1 -0
  439. package/lib/memory/dist/index.js +316 -0
  440. package/lib/memory/dist/index.js.map +1 -0
  441. package/lib/memory/dist/native.d.ts +157 -0
  442. package/lib/memory/dist/native.d.ts.map +1 -0
  443. package/lib/memory/dist/native.js +664 -0
  444. package/lib/memory/dist/native.js.map +1 -0
  445. package/lib/memory/dist/validation.d.ts +21 -0
  446. package/lib/memory/dist/validation.d.ts.map +1 -0
  447. package/lib/memory/dist/validation.js +123 -0
  448. package/lib/memory/dist/validation.js.map +1 -0
  449. package/lib/memory/dist/vectors.d.ts +40 -0
  450. package/lib/memory/dist/vectors.d.ts.map +1 -0
  451. package/lib/memory/dist/vectors.js +134 -0
  452. package/lib/memory/dist/vectors.js.map +1 -0
  453. package/lib/memory/package.json +5 -0
  454. package/lib/memory/src/contracts.ts +113 -0
  455. package/lib/memory/src/index.ts +241 -0
  456. package/lib/memory/src/native.ts +568 -0
  457. package/lib/memory/src/validation.ts +103 -0
  458. package/lib/memory/src/vectors.ts +121 -0
  459. package/lib/memory-remote/dist/index.d.ts +91 -0
  460. package/lib/memory-remote/dist/index.d.ts.map +1 -0
  461. package/lib/memory-remote/dist/index.js +434 -0
  462. package/lib/memory-remote/dist/index.js.map +1 -0
  463. package/lib/memory-remote/package.json +5 -0
  464. package/lib/memory-remote/src/index.ts +367 -0
  465. package/lib/observability/dist/contracts.d.ts +102 -0
  466. package/lib/observability/dist/contracts.d.ts.map +1 -0
  467. package/lib/observability/dist/contracts.js +2 -0
  468. package/lib/observability/dist/contracts.js.map +1 -0
  469. package/lib/observability/dist/index.d.ts +5 -0
  470. package/lib/observability/dist/index.d.ts.map +1 -0
  471. package/lib/observability/dist/index.js +4 -0
  472. package/lib/observability/dist/index.js.map +1 -0
  473. package/lib/observability/dist/observer.d.ts +4 -0
  474. package/lib/observability/dist/observer.d.ts.map +1 -0
  475. package/lib/observability/dist/observer.js +354 -0
  476. package/lib/observability/dist/observer.js.map +1 -0
  477. package/lib/observability/dist/validation.d.ts +6 -0
  478. package/lib/observability/dist/validation.d.ts.map +1 -0
  479. package/lib/observability/dist/validation.js +203 -0
  480. package/lib/observability/dist/validation.js.map +1 -0
  481. package/lib/observability/package.json +5 -0
  482. package/lib/observability/src/contracts.ts +85 -0
  483. package/lib/observability/src/index.ts +4 -0
  484. package/lib/observability/src/observer.ts +246 -0
  485. package/lib/observability/src/validation.ts +132 -0
  486. package/lib/provider-anthropic/dist/index.d.ts +19 -0
  487. package/lib/provider-anthropic/dist/index.d.ts.map +1 -0
  488. package/lib/provider-anthropic/dist/index.js +342 -0
  489. package/lib/provider-anthropic/dist/index.js.map +1 -0
  490. package/lib/provider-anthropic/package.json +5 -0
  491. package/lib/provider-anthropic/src/index.ts +317 -0
  492. package/lib/provider-openai/dist/index.d.ts +77 -0
  493. package/lib/provider-openai/dist/index.d.ts.map +1 -0
  494. package/lib/provider-openai/dist/index.js +577 -0
  495. package/lib/provider-openai/dist/index.js.map +1 -0
  496. package/lib/provider-openai/package.json +5 -0
  497. package/lib/provider-openai/src/index.ts +459 -0
  498. package/lib/runtime/dist/agent.d.ts +63 -0
  499. package/lib/runtime/dist/agent.d.ts.map +1 -0
  500. package/lib/runtime/dist/agent.js +134 -0
  501. package/lib/runtime/dist/agent.js.map +1 -0
  502. package/lib/runtime/dist/composition.d.ts +21 -0
  503. package/lib/runtime/dist/composition.d.ts.map +1 -0
  504. package/lib/runtime/dist/composition.js +54 -0
  505. package/lib/runtime/dist/composition.js.map +1 -0
  506. package/lib/runtime/dist/event-buffer.d.ts +18 -0
  507. package/lib/runtime/dist/event-buffer.d.ts.map +1 -0
  508. package/lib/runtime/dist/event-buffer.js +66 -0
  509. package/lib/runtime/dist/event-buffer.js.map +1 -0
  510. package/lib/runtime/dist/hook-execution.d.ts +40 -0
  511. package/lib/runtime/dist/hook-execution.d.ts.map +1 -0
  512. package/lib/runtime/dist/hook-execution.js +186 -0
  513. package/lib/runtime/dist/hook-execution.js.map +1 -0
  514. package/lib/runtime/dist/hooks.d.ts +178 -0
  515. package/lib/runtime/dist/hooks.d.ts.map +1 -0
  516. package/lib/runtime/dist/hooks.js +120 -0
  517. package/lib/runtime/dist/hooks.js.map +1 -0
  518. package/lib/runtime/dist/index.d.ts +6 -0
  519. package/lib/runtime/dist/index.d.ts.map +1 -0
  520. package/lib/runtime/dist/index.js +6 -0
  521. package/lib/runtime/dist/index.js.map +1 -0
  522. package/lib/runtime/dist/managed-guards.d.ts +27 -0
  523. package/lib/runtime/dist/managed-guards.d.ts.map +1 -0
  524. package/lib/runtime/dist/managed-guards.js +183 -0
  525. package/lib/runtime/dist/managed-guards.js.map +1 -0
  526. package/lib/runtime/dist/permits.d.ts +9 -0
  527. package/lib/runtime/dist/permits.d.ts.map +1 -0
  528. package/lib/runtime/dist/permits.js +77 -0
  529. package/lib/runtime/dist/permits.js.map +1 -0
  530. package/lib/runtime/dist/response.d.ts +8 -0
  531. package/lib/runtime/dist/response.d.ts.map +1 -0
  532. package/lib/runtime/dist/response.js +83 -0
  533. package/lib/runtime/dist/response.js.map +1 -0
  534. package/lib/runtime/dist/router.d.ts +51 -0
  535. package/lib/runtime/dist/router.d.ts.map +1 -0
  536. package/lib/runtime/dist/router.js +181 -0
  537. package/lib/runtime/dist/router.js.map +1 -0
  538. package/lib/runtime/dist/runtime.d.ts +98 -0
  539. package/lib/runtime/dist/runtime.d.ts.map +1 -0
  540. package/lib/runtime/dist/runtime.js +945 -0
  541. package/lib/runtime/dist/runtime.js.map +1 -0
  542. package/lib/runtime/dist/stream.d.ts +25 -0
  543. package/lib/runtime/dist/stream.d.ts.map +1 -0
  544. package/lib/runtime/dist/stream.js +226 -0
  545. package/lib/runtime/dist/stream.js.map +1 -0
  546. package/lib/runtime/package.json +5 -0
  547. package/lib/runtime/src/agent.ts +167 -0
  548. package/lib/runtime/src/composition.ts +63 -0
  549. package/lib/runtime/src/event-buffer.ts +55 -0
  550. package/lib/runtime/src/hook-execution.ts +188 -0
  551. package/lib/runtime/src/hooks.ts +227 -0
  552. package/lib/runtime/src/index.ts +5 -0
  553. package/lib/runtime/src/managed-guards.ts +176 -0
  554. package/lib/runtime/src/permits.ts +65 -0
  555. package/lib/runtime/src/response.ts +68 -0
  556. package/lib/runtime/src/router.ts +178 -0
  557. package/lib/runtime/src/runtime.ts +909 -0
  558. package/lib/runtime/src/stream.ts +130 -0
  559. package/lib/sdk/dist/index.d.ts +5 -0
  560. package/lib/sdk/dist/index.d.ts.map +1 -0
  561. package/lib/sdk/dist/index.js +5 -0
  562. package/lib/sdk/dist/index.js.map +1 -0
  563. package/lib/sdk/package.json +5 -0
  564. package/lib/sdk/src/index.ts +4 -0
  565. package/lib/server/dist/index.d.ts +343 -0
  566. package/lib/server/dist/index.d.ts.map +1 -0
  567. package/lib/server/dist/index.js +1356 -0
  568. package/lib/server/dist/index.js.map +1 -0
  569. package/lib/server/dist/inspector-bundle.d.ts +6 -0
  570. package/lib/server/dist/inspector-bundle.d.ts.map +1 -0
  571. package/lib/server/dist/inspector-bundle.js +6 -0
  572. package/lib/server/dist/inspector-bundle.js.map +1 -0
  573. package/lib/server/dist/inspector.d.ts +3 -0
  574. package/lib/server/dist/inspector.d.ts.map +1 -0
  575. package/lib/server/dist/inspector.js +27 -0
  576. package/lib/server/dist/inspector.js.map +1 -0
  577. package/lib/server/package.json +5 -0
  578. package/lib/server/src/index.ts +1033 -0
  579. package/lib/server/src/inspector-bundle.ts +5 -0
  580. package/lib/server/src/inspector.ts +27 -0
  581. package/lib/server-node/dist/hardening.d.ts +19 -0
  582. package/lib/server-node/dist/hardening.d.ts.map +1 -0
  583. package/lib/server-node/dist/hardening.js +79 -0
  584. package/lib/server-node/dist/hardening.js.map +1 -0
  585. package/lib/server-node/dist/index.d.ts +18 -0
  586. package/lib/server-node/dist/index.d.ts.map +1 -0
  587. package/lib/server-node/dist/index.js +53 -0
  588. package/lib/server-node/dist/index.js.map +1 -0
  589. package/lib/server-node/dist/probe.d.ts +13 -0
  590. package/lib/server-node/dist/probe.d.ts.map +1 -0
  591. package/lib/server-node/dist/probe.js +44 -0
  592. package/lib/server-node/dist/probe.js.map +1 -0
  593. package/lib/server-node/dist/production.d.ts +32 -0
  594. package/lib/server-node/dist/production.d.ts.map +1 -0
  595. package/lib/server-node/dist/production.js +125 -0
  596. package/lib/server-node/dist/production.js.map +1 -0
  597. package/lib/server-node/package.json +5 -0
  598. package/lib/server-node/src/hardening.ts +79 -0
  599. package/lib/server-node/src/index.ts +58 -0
  600. package/lib/server-node/src/probe.ts +36 -0
  601. package/lib/server-node/src/production.ts +116 -0
  602. package/lib/storage/dist/index.d.ts +4 -0
  603. package/lib/storage/dist/index.d.ts.map +1 -0
  604. package/lib/storage/dist/index.js +5 -0
  605. package/lib/storage/dist/index.js.map +1 -0
  606. package/lib/storage/package.json +5 -0
  607. package/lib/storage/src/index.ts +5 -0
  608. package/lib/storage-contracts/dist/contracts.d.ts +69 -0
  609. package/lib/storage-contracts/dist/contracts.d.ts.map +1 -0
  610. package/lib/storage-contracts/dist/contracts.js +15 -0
  611. package/lib/storage-contracts/dist/contracts.js.map +1 -0
  612. package/lib/storage-contracts/dist/durable-budget-contracts.d.ts +110 -0
  613. package/lib/storage-contracts/dist/durable-budget-contracts.d.ts.map +1 -0
  614. package/lib/storage-contracts/dist/durable-budget-contracts.js +430 -0
  615. package/lib/storage-contracts/dist/durable-budget-contracts.js.map +1 -0
  616. package/lib/storage-contracts/dist/execution-wait-contracts.d.ts +74 -0
  617. package/lib/storage-contracts/dist/execution-wait-contracts.d.ts.map +1 -0
  618. package/lib/storage-contracts/dist/execution-wait-contracts.js +159 -0
  619. package/lib/storage-contracts/dist/execution-wait-contracts.js.map +1 -0
  620. package/lib/storage-contracts/dist/index.d.ts +18 -0
  621. package/lib/storage-contracts/dist/index.d.ts.map +1 -0
  622. package/lib/storage-contracts/dist/index.js +18 -0
  623. package/lib/storage-contracts/dist/index.js.map +1 -0
  624. package/lib/storage-contracts/dist/memory-contracts.d.ts +208 -0
  625. package/lib/storage-contracts/dist/memory-contracts.d.ts.map +1 -0
  626. package/lib/storage-contracts/dist/memory-contracts.js +350 -0
  627. package/lib/storage-contracts/dist/memory-contracts.js.map +1 -0
  628. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +171 -0
  629. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -0
  630. package/lib/storage-contracts/dist/scheduled-workflow-contracts.js +2 -0
  631. package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -0
  632. package/lib/storage-contracts/dist/scheduler-contracts.d.ts +133 -0
  633. package/lib/storage-contracts/dist/scheduler-contracts.d.ts.map +1 -0
  634. package/lib/storage-contracts/dist/scheduler-contracts.js +2 -0
  635. package/lib/storage-contracts/dist/scheduler-contracts.js.map +1 -0
  636. package/lib/storage-contracts/dist/submission-journal.d.ts +21 -0
  637. package/lib/storage-contracts/dist/submission-journal.d.ts.map +1 -0
  638. package/lib/storage-contracts/dist/submission-journal.js +51 -0
  639. package/lib/storage-contracts/dist/submission-journal.js.map +1 -0
  640. package/lib/storage-contracts/dist/workflow-format2.d.ts +54 -0
  641. package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -0
  642. package/lib/storage-contracts/dist/workflow-format2.js +398 -0
  643. package/lib/storage-contracts/dist/workflow-format2.js.map +1 -0
  644. package/lib/storage-contracts/dist/workflow-format3.d.ts +20 -0
  645. package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -0
  646. package/lib/storage-contracts/dist/workflow-format3.js +309 -0
  647. package/lib/storage-contracts/dist/workflow-format3.js.map +1 -0
  648. package/lib/storage-contracts/dist/workflow-format4.d.ts +48 -0
  649. package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -0
  650. package/lib/storage-contracts/dist/workflow-format4.js +132 -0
  651. package/lib/storage-contracts/dist/workflow-format4.js.map +1 -0
  652. package/lib/storage-contracts/dist/workflow-format5.d.ts +94 -0
  653. package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -0
  654. package/lib/storage-contracts/dist/workflow-format5.js +365 -0
  655. package/lib/storage-contracts/dist/workflow-format5.js.map +1 -0
  656. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +69 -0
  657. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -0
  658. package/lib/storage-contracts/dist/workflow-graph-contracts.js +2 -0
  659. package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -0
  660. package/lib/storage-contracts/dist/workflow-graph-discovery.d.ts +45 -0
  661. package/lib/storage-contracts/dist/workflow-graph-discovery.d.ts.map +1 -0
  662. package/lib/storage-contracts/dist/workflow-graph-discovery.js +101 -0
  663. package/lib/storage-contracts/dist/workflow-graph-discovery.js.map +1 -0
  664. package/lib/storage-contracts/dist/workflow-loop-format1.d.ts +52 -0
  665. package/lib/storage-contracts/dist/workflow-loop-format1.d.ts.map +1 -0
  666. package/lib/storage-contracts/dist/workflow-loop-format1.js +134 -0
  667. package/lib/storage-contracts/dist/workflow-loop-format1.js.map +1 -0
  668. package/lib/storage-contracts/dist/workflow-saga-format1.d.ts +52 -0
  669. package/lib/storage-contracts/dist/workflow-saga-format1.d.ts.map +1 -0
  670. package/lib/storage-contracts/dist/workflow-saga-format1.js +235 -0
  671. package/lib/storage-contracts/dist/workflow-saga-format1.js.map +1 -0
  672. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +428 -0
  673. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -0
  674. package/lib/storage-contracts/dist/workflow-tree-contracts.js +151 -0
  675. package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -0
  676. package/lib/storage-contracts/dist/workflow-tree-discovery.d.ts +38 -0
  677. package/lib/storage-contracts/dist/workflow-tree-discovery.d.ts.map +1 -0
  678. package/lib/storage-contracts/dist/workflow-tree-discovery.js +57 -0
  679. package/lib/storage-contracts/dist/workflow-tree-discovery.js.map +1 -0
  680. package/lib/storage-contracts/package.json +5 -0
  681. package/lib/storage-contracts/src/contracts.ts +73 -0
  682. package/lib/storage-contracts/src/durable-budget-contracts.ts +266 -0
  683. package/lib/storage-contracts/src/execution-wait-contracts.ts +169 -0
  684. package/lib/storage-contracts/src/index.ts +17 -0
  685. package/lib/storage-contracts/src/memory-contracts.ts +322 -0
  686. package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +88 -0
  687. package/lib/storage-contracts/src/scheduler-contracts.ts +68 -0
  688. package/lib/storage-contracts/src/submission-journal.ts +50 -0
  689. package/lib/storage-contracts/src/workflow-format2.ts +288 -0
  690. package/lib/storage-contracts/src/workflow-format3.ts +201 -0
  691. package/lib/storage-contracts/src/workflow-format4.ts +96 -0
  692. package/lib/storage-contracts/src/workflow-format5.ts +375 -0
  693. package/lib/storage-contracts/src/workflow-graph-contracts.ts +44 -0
  694. package/lib/storage-contracts/src/workflow-graph-discovery.ts +107 -0
  695. package/lib/storage-contracts/src/workflow-loop-format1.ts +102 -0
  696. package/lib/storage-contracts/src/workflow-saga-format1.ts +165 -0
  697. package/lib/storage-contracts/src/workflow-tree-contracts.ts +191 -0
  698. package/lib/storage-contracts/src/workflow-tree-discovery.ts +39 -0
  699. package/lib/storage-postgres/dist/index.d.ts +2 -0
  700. package/lib/storage-postgres/dist/index.d.ts.map +1 -0
  701. package/lib/storage-postgres/dist/index.js +2 -0
  702. package/lib/storage-postgres/dist/index.js.map +1 -0
  703. package/lib/storage-postgres/dist/postgres.d.ts +8 -0
  704. package/lib/storage-postgres/dist/postgres.d.ts.map +1 -0
  705. package/lib/storage-postgres/dist/postgres.js +233 -0
  706. package/lib/storage-postgres/dist/postgres.js.map +1 -0
  707. package/lib/storage-postgres/package.json +5 -0
  708. package/lib/storage-postgres/src/index.ts +1 -0
  709. package/lib/storage-postgres/src/postgres.ts +222 -0
  710. package/lib/storage-sql/dist/aggregate-session.d.ts +31 -0
  711. package/lib/storage-sql/dist/aggregate-session.d.ts.map +1 -0
  712. package/lib/storage-sql/dist/aggregate-session.js +78 -0
  713. package/lib/storage-sql/dist/aggregate-session.js.map +1 -0
  714. package/lib/storage-sql/dist/contracts.d.ts +2 -0
  715. package/lib/storage-sql/dist/contracts.d.ts.map +1 -0
  716. package/lib/storage-sql/dist/contracts.js +3 -0
  717. package/lib/storage-sql/dist/contracts.js.map +1 -0
  718. package/lib/storage-sql/dist/durable-budget-database.d.ts +33 -0
  719. package/lib/storage-sql/dist/durable-budget-database.d.ts.map +1 -0
  720. package/lib/storage-sql/dist/durable-budget-database.js +191 -0
  721. package/lib/storage-sql/dist/durable-budget-database.js.map +1 -0
  722. package/lib/storage-sql/dist/durable-budget-state.d.ts +24 -0
  723. package/lib/storage-sql/dist/durable-budget-state.d.ts.map +1 -0
  724. package/lib/storage-sql/dist/durable-budget-state.js +211 -0
  725. package/lib/storage-sql/dist/durable-budget-state.js.map +1 -0
  726. package/lib/storage-sql/dist/durable-budget-validation.d.ts +5 -0
  727. package/lib/storage-sql/dist/durable-budget-validation.d.ts.map +1 -0
  728. package/lib/storage-sql/dist/durable-budget-validation.js +22 -0
  729. package/lib/storage-sql/dist/durable-budget-validation.js.map +1 -0
  730. package/lib/storage-sql/dist/execution-completions.d.ts +12 -0
  731. package/lib/storage-sql/dist/execution-completions.d.ts.map +1 -0
  732. package/lib/storage-sql/dist/execution-completions.js +60 -0
  733. package/lib/storage-sql/dist/execution-completions.js.map +1 -0
  734. package/lib/storage-sql/dist/execution-wait-database.d.ts +22 -0
  735. package/lib/storage-sql/dist/execution-wait-database.d.ts.map +1 -0
  736. package/lib/storage-sql/dist/execution-wait-database.js +288 -0
  737. package/lib/storage-sql/dist/execution-wait-database.js.map +1 -0
  738. package/lib/storage-sql/dist/execution-wait-validation.d.ts +8 -0
  739. package/lib/storage-sql/dist/execution-wait-validation.d.ts.map +1 -0
  740. package/lib/storage-sql/dist/execution-wait-validation.js +125 -0
  741. package/lib/storage-sql/dist/execution-wait-validation.js.map +1 -0
  742. package/lib/storage-sql/dist/host.d.ts +22 -0
  743. package/lib/storage-sql/dist/host.d.ts.map +1 -0
  744. package/lib/storage-sql/dist/host.js +21 -0
  745. package/lib/storage-sql/dist/host.js.map +1 -0
  746. package/lib/storage-sql/dist/memory-database.d.ts +24 -0
  747. package/lib/storage-sql/dist/memory-database.d.ts.map +1 -0
  748. package/lib/storage-sql/dist/memory-database.js +359 -0
  749. package/lib/storage-sql/dist/memory-database.js.map +1 -0
  750. package/lib/storage-sql/dist/scheduled-database.d.ts +74 -0
  751. package/lib/storage-sql/dist/scheduled-database.d.ts.map +1 -0
  752. package/lib/storage-sql/dist/scheduled-database.js +1152 -0
  753. package/lib/storage-sql/dist/scheduled-database.js.map +1 -0
  754. package/lib/storage-sql/dist/scheduled-validation.d.ts +9 -0
  755. package/lib/storage-sql/dist/scheduled-validation.d.ts.map +1 -0
  756. package/lib/storage-sql/dist/scheduled-validation.js +200 -0
  757. package/lib/storage-sql/dist/scheduled-validation.js.map +1 -0
  758. package/lib/storage-sql/dist/scheduler-contracts.d.ts +2 -0
  759. package/lib/storage-sql/dist/scheduler-contracts.d.ts.map +1 -0
  760. package/lib/storage-sql/dist/scheduler-contracts.js +3 -0
  761. package/lib/storage-sql/dist/scheduler-contracts.js.map +1 -0
  762. package/lib/storage-sql/dist/scheduler-database.d.ts +55 -0
  763. package/lib/storage-sql/dist/scheduler-database.d.ts.map +1 -0
  764. package/lib/storage-sql/dist/scheduler-database.js +655 -0
  765. package/lib/storage-sql/dist/scheduler-database.js.map +1 -0
  766. package/lib/storage-sql/dist/scheduler-validation.d.ts +22 -0
  767. package/lib/storage-sql/dist/scheduler-validation.d.ts.map +1 -0
  768. package/lib/storage-sql/dist/scheduler-validation.js +201 -0
  769. package/lib/storage-sql/dist/scheduler-validation.js.map +1 -0
  770. package/lib/storage-sql/dist/validation.d.ts +14 -0
  771. package/lib/storage-sql/dist/validation.d.ts.map +1 -0
  772. package/lib/storage-sql/dist/validation.js +106 -0
  773. package/lib/storage-sql/dist/validation.js.map +1 -0
  774. package/lib/storage-sql/dist/workflow-graph-discovery-index.d.ts +7 -0
  775. package/lib/storage-sql/dist/workflow-graph-discovery-index.d.ts.map +1 -0
  776. package/lib/storage-sql/dist/workflow-graph-discovery-index.js +55 -0
  777. package/lib/storage-sql/dist/workflow-graph-discovery-index.js.map +1 -0
  778. package/lib/storage-sql/dist/workflow-graph-discovery-validation.d.ts +5 -0
  779. package/lib/storage-sql/dist/workflow-graph-discovery-validation.d.ts.map +1 -0
  780. package/lib/storage-sql/dist/workflow-graph-discovery-validation.js +22 -0
  781. package/lib/storage-sql/dist/workflow-graph-discovery-validation.js.map +1 -0
  782. package/lib/storage-sql/dist/workflow-tree-database.d.ts +270 -0
  783. package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -0
  784. package/lib/storage-sql/dist/workflow-tree-database.js +1692 -0
  785. package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -0
  786. package/lib/storage-sql/dist/workflow-tree-discovery-validation.d.ts +5 -0
  787. package/lib/storage-sql/dist/workflow-tree-discovery-validation.d.ts.map +1 -0
  788. package/lib/storage-sql/dist/workflow-tree-discovery-validation.js +15 -0
  789. package/lib/storage-sql/dist/workflow-tree-discovery-validation.js.map +1 -0
  790. package/lib/storage-sql/dist/workflow-tree-validation.d.ts +9 -0
  791. package/lib/storage-sql/dist/workflow-tree-validation.d.ts.map +1 -0
  792. package/lib/storage-sql/dist/workflow-tree-validation.js +576 -0
  793. package/lib/storage-sql/dist/workflow-tree-validation.js.map +1 -0
  794. package/lib/storage-sql/package.json +5 -0
  795. package/lib/storage-sql/src/aggregate-session.ts +72 -0
  796. package/lib/storage-sql/src/contracts.ts +2 -0
  797. package/lib/storage-sql/src/durable-budget-database.ts +180 -0
  798. package/lib/storage-sql/src/durable-budget-state.ts +155 -0
  799. package/lib/storage-sql/src/durable-budget-validation.ts +23 -0
  800. package/lib/storage-sql/src/execution-completions.ts +58 -0
  801. package/lib/storage-sql/src/execution-wait-database.ts +219 -0
  802. package/lib/storage-sql/src/execution-wait-validation.ts +108 -0
  803. package/lib/storage-sql/src/host.ts +21 -0
  804. package/lib/storage-sql/src/memory-database.ts +320 -0
  805. package/lib/storage-sql/src/scheduled-database.ts +811 -0
  806. package/lib/storage-sql/src/scheduled-validation.ts +89 -0
  807. package/lib/storage-sql/src/scheduler-contracts.ts +2 -0
  808. package/lib/storage-sql/src/scheduler-database.ts +475 -0
  809. package/lib/storage-sql/src/scheduler-validation.ts +112 -0
  810. package/lib/storage-sql/src/validation.ts +104 -0
  811. package/lib/storage-sql/src/workflow-graph-discovery-index.ts +60 -0
  812. package/lib/storage-sql/src/workflow-graph-discovery-validation.ts +21 -0
  813. package/lib/storage-sql/src/workflow-tree-database.ts +450 -0
  814. package/lib/storage-sql/src/workflow-tree-discovery-validation.ts +13 -0
  815. package/lib/storage-sql/src/workflow-tree-validation.ts +166 -0
  816. package/lib/storage-sqlite/dist/backup.d.ts +24 -0
  817. package/lib/storage-sqlite/dist/backup.d.ts.map +1 -0
  818. package/lib/storage-sqlite/dist/backup.js +84 -0
  819. package/lib/storage-sqlite/dist/backup.js.map +1 -0
  820. package/lib/storage-sqlite/dist/index.d.ts +4 -0
  821. package/lib/storage-sqlite/dist/index.d.ts.map +1 -0
  822. package/lib/storage-sqlite/dist/index.js +4 -0
  823. package/lib/storage-sqlite/dist/index.js.map +1 -0
  824. package/lib/storage-sqlite/dist/migrations.d.ts +6 -0
  825. package/lib/storage-sqlite/dist/migrations.d.ts.map +1 -0
  826. package/lib/storage-sqlite/dist/migrations.js +50 -0
  827. package/lib/storage-sqlite/dist/migrations.js.map +1 -0
  828. package/lib/storage-sqlite/dist/sqlite-database.d.ts +36 -0
  829. package/lib/storage-sqlite/dist/sqlite-database.d.ts.map +1 -0
  830. package/lib/storage-sqlite/dist/sqlite-database.js +179 -0
  831. package/lib/storage-sqlite/dist/sqlite-database.js.map +1 -0
  832. package/lib/storage-sqlite/dist/sqlite-worker.d.ts +2 -0
  833. package/lib/storage-sqlite/dist/sqlite-worker.d.ts.map +1 -0
  834. package/lib/storage-sqlite/dist/sqlite-worker.js +95 -0
  835. package/lib/storage-sqlite/dist/sqlite-worker.js.map +1 -0
  836. package/lib/storage-sqlite/dist/sqlite.d.ts +7 -0
  837. package/lib/storage-sqlite/dist/sqlite.d.ts.map +1 -0
  838. package/lib/storage-sqlite/dist/sqlite.js +78 -0
  839. package/lib/storage-sqlite/dist/sqlite.js.map +1 -0
  840. package/lib/storage-sqlite/package.json +5 -0
  841. package/lib/storage-sqlite/src/backup.ts +58 -0
  842. package/lib/storage-sqlite/src/index.ts +3 -0
  843. package/lib/storage-sqlite/src/migrations.ts +46 -0
  844. package/lib/storage-sqlite/src/sqlite-database.ts +172 -0
  845. package/lib/storage-sqlite/src/sqlite-worker.ts +52 -0
  846. package/lib/storage-sqlite/src/sqlite.ts +72 -0
  847. package/lib/testing/dist/index.d.ts +10 -0
  848. package/lib/testing/dist/index.d.ts.map +1 -0
  849. package/lib/testing/dist/index.js +24 -0
  850. package/lib/testing/dist/index.js.map +1 -0
  851. package/lib/testing/package.json +5 -0
  852. package/lib/testing/src/index.ts +26 -0
  853. package/lib/tools/dist/batch.d.ts +71 -0
  854. package/lib/tools/dist/batch.d.ts.map +1 -0
  855. package/lib/tools/dist/batch.js +542 -0
  856. package/lib/tools/dist/batch.js.map +1 -0
  857. package/lib/tools/dist/budget-binding.d.ts +18 -0
  858. package/lib/tools/dist/budget-binding.d.ts.map +1 -0
  859. package/lib/tools/dist/budget-binding.js +65 -0
  860. package/lib/tools/dist/budget-binding.js.map +1 -0
  861. package/lib/tools/dist/context.d.ts +17 -0
  862. package/lib/tools/dist/context.d.ts.map +1 -0
  863. package/lib/tools/dist/context.js +52 -0
  864. package/lib/tools/dist/context.js.map +1 -0
  865. package/lib/tools/dist/host.d.ts +3 -0
  866. package/lib/tools/dist/host.d.ts.map +1 -0
  867. package/lib/tools/dist/host.js +3 -0
  868. package/lib/tools/dist/host.js.map +1 -0
  869. package/lib/tools/dist/index.d.ts +79 -0
  870. package/lib/tools/dist/index.d.ts.map +1 -0
  871. package/lib/tools/dist/index.js +462 -0
  872. package/lib/tools/dist/index.js.map +1 -0
  873. package/lib/tools/package.json +5 -0
  874. package/lib/tools/src/batch.ts +496 -0
  875. package/lib/tools/src/budget-binding.ts +63 -0
  876. package/lib/tools/src/context.ts +56 -0
  877. package/lib/tools/src/host.ts +2 -0
  878. package/lib/tools/src/index.ts +479 -0
  879. package/lib/workflows/dist/agents.d.ts +24 -0
  880. package/lib/workflows/dist/agents.d.ts.map +1 -0
  881. package/lib/workflows/dist/agents.js +55 -0
  882. package/lib/workflows/dist/agents.js.map +1 -0
  883. package/lib/workflows/dist/children-coordinator.d.ts +58 -0
  884. package/lib/workflows/dist/children-coordinator.d.ts.map +1 -0
  885. package/lib/workflows/dist/children-coordinator.js +148 -0
  886. package/lib/workflows/dist/children-coordinator.js.map +1 -0
  887. package/lib/workflows/dist/children-definition.d.ts +43 -0
  888. package/lib/workflows/dist/children-definition.d.ts.map +1 -0
  889. package/lib/workflows/dist/children-definition.js +74 -0
  890. package/lib/workflows/dist/children-definition.js.map +1 -0
  891. package/lib/workflows/dist/children-discovery.d.ts +20 -0
  892. package/lib/workflows/dist/children-discovery.d.ts.map +1 -0
  893. package/lib/workflows/dist/children-discovery.js +103 -0
  894. package/lib/workflows/dist/children-discovery.js.map +1 -0
  895. package/lib/workflows/dist/children-runtime.d.ts +72 -0
  896. package/lib/workflows/dist/children-runtime.d.ts.map +1 -0
  897. package/lib/workflows/dist/children-runtime.js +600 -0
  898. package/lib/workflows/dist/children-runtime.js.map +1 -0
  899. package/lib/workflows/dist/children.d.ts +9 -0
  900. package/lib/workflows/dist/children.d.ts.map +1 -0
  901. package/lib/workflows/dist/children.js +6 -0
  902. package/lib/workflows/dist/children.js.map +1 -0
  903. package/lib/workflows/dist/composite-fleet.d.ts +87 -0
  904. package/lib/workflows/dist/composite-fleet.d.ts.map +1 -0
  905. package/lib/workflows/dist/composite-fleet.js +259 -0
  906. package/lib/workflows/dist/composite-fleet.js.map +1 -0
  907. package/lib/workflows/dist/composite-host.d.ts +45 -0
  908. package/lib/workflows/dist/composite-host.d.ts.map +1 -0
  909. package/lib/workflows/dist/composite-host.js +132 -0
  910. package/lib/workflows/dist/composite-host.js.map +1 -0
  911. package/lib/workflows/dist/composites.d.ts +4 -0
  912. package/lib/workflows/dist/composites.d.ts.map +1 -0
  913. package/lib/workflows/dist/composites.js +3 -0
  914. package/lib/workflows/dist/composites.js.map +1 -0
  915. package/lib/workflows/dist/definition.d.ts +61 -0
  916. package/lib/workflows/dist/definition.d.ts.map +1 -0
  917. package/lib/workflows/dist/definition.js +112 -0
  918. package/lib/workflows/dist/definition.js.map +1 -0
  919. package/lib/workflows/dist/drain.d.ts +21 -0
  920. package/lib/workflows/dist/drain.d.ts.map +1 -0
  921. package/lib/workflows/dist/drain.js +53 -0
  922. package/lib/workflows/dist/drain.js.map +1 -0
  923. package/lib/workflows/dist/ephemeral.d.ts +24 -0
  924. package/lib/workflows/dist/ephemeral.d.ts.map +1 -0
  925. package/lib/workflows/dist/ephemeral.js +122 -0
  926. package/lib/workflows/dist/ephemeral.js.map +1 -0
  927. package/lib/workflows/dist/fleet-control.d.ts +129 -0
  928. package/lib/workflows/dist/fleet-control.d.ts.map +1 -0
  929. package/lib/workflows/dist/fleet-control.js +356 -0
  930. package/lib/workflows/dist/fleet-control.js.map +1 -0
  931. package/lib/workflows/dist/graph-coordinator.d.ts +60 -0
  932. package/lib/workflows/dist/graph-coordinator.d.ts.map +1 -0
  933. package/lib/workflows/dist/graph-coordinator.js +266 -0
  934. package/lib/workflows/dist/graph-coordinator.js.map +1 -0
  935. package/lib/workflows/dist/graph-definition.d.ts +40 -0
  936. package/lib/workflows/dist/graph-definition.d.ts.map +1 -0
  937. package/lib/workflows/dist/graph-definition.js +58 -0
  938. package/lib/workflows/dist/graph-definition.js.map +1 -0
  939. package/lib/workflows/dist/graph-discovery.d.ts +27 -0
  940. package/lib/workflows/dist/graph-discovery.d.ts.map +1 -0
  941. package/lib/workflows/dist/graph-discovery.js +165 -0
  942. package/lib/workflows/dist/graph-discovery.js.map +1 -0
  943. package/lib/workflows/dist/graphs.d.ts +55 -0
  944. package/lib/workflows/dist/graphs.d.ts.map +1 -0
  945. package/lib/workflows/dist/graphs.js +10 -0
  946. package/lib/workflows/dist/graphs.js.map +1 -0
  947. package/lib/workflows/dist/hook-relay.d.ts +67 -0
  948. package/lib/workflows/dist/hook-relay.d.ts.map +1 -0
  949. package/lib/workflows/dist/hook-relay.js +157 -0
  950. package/lib/workflows/dist/hook-relay.js.map +1 -0
  951. package/lib/workflows/dist/index.d.ts +16 -0
  952. package/lib/workflows/dist/index.d.ts.map +1 -0
  953. package/lib/workflows/dist/index.js +15 -0
  954. package/lib/workflows/dist/index.js.map +1 -0
  955. package/lib/workflows/dist/leadership.d.ts +33 -0
  956. package/lib/workflows/dist/leadership.d.ts.map +1 -0
  957. package/lib/workflows/dist/leadership.js +109 -0
  958. package/lib/workflows/dist/leadership.js.map +1 -0
  959. package/lib/workflows/dist/lifecycle-definition.d.ts +89 -0
  960. package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -0
  961. package/lib/workflows/dist/lifecycle-definition.js +137 -0
  962. package/lib/workflows/dist/lifecycle-definition.js.map +1 -0
  963. package/lib/workflows/dist/lifecycle-fleet.d.ts +90 -0
  964. package/lib/workflows/dist/lifecycle-fleet.d.ts.map +1 -0
  965. package/lib/workflows/dist/lifecycle-fleet.js +406 -0
  966. package/lib/workflows/dist/lifecycle-fleet.js.map +1 -0
  967. package/lib/workflows/dist/lifecycle-host.d.ts +44 -0
  968. package/lib/workflows/dist/lifecycle-host.d.ts.map +1 -0
  969. package/lib/workflows/dist/lifecycle-host.js +133 -0
  970. package/lib/workflows/dist/lifecycle-host.js.map +1 -0
  971. package/lib/workflows/dist/lifecycle-human-transport.d.ts +67 -0
  972. package/lib/workflows/dist/lifecycle-human-transport.d.ts.map +1 -0
  973. package/lib/workflows/dist/lifecycle-human-transport.js +149 -0
  974. package/lib/workflows/dist/lifecycle-human-transport.js.map +1 -0
  975. package/lib/workflows/dist/lifecycle-runtime.d.ts +115 -0
  976. package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -0
  977. package/lib/workflows/dist/lifecycle-runtime.js +831 -0
  978. package/lib/workflows/dist/lifecycle-runtime.js.map +1 -0
  979. package/lib/workflows/dist/lifecycle.d.ts +10 -0
  980. package/lib/workflows/dist/lifecycle.d.ts.map +1 -0
  981. package/lib/workflows/dist/lifecycle.js +7 -0
  982. package/lib/workflows/dist/lifecycle.js.map +1 -0
  983. package/lib/workflows/dist/loop-definition.d.ts +46 -0
  984. package/lib/workflows/dist/loop-definition.d.ts.map +1 -0
  985. package/lib/workflows/dist/loop-definition.js +55 -0
  986. package/lib/workflows/dist/loop-definition.js.map +1 -0
  987. package/lib/workflows/dist/loop-runtime.d.ts +47 -0
  988. package/lib/workflows/dist/loop-runtime.d.ts.map +1 -0
  989. package/lib/workflows/dist/loop-runtime.js +358 -0
  990. package/lib/workflows/dist/loop-runtime.js.map +1 -0
  991. package/lib/workflows/dist/loops.d.ts +6 -0
  992. package/lib/workflows/dist/loops.d.ts.map +1 -0
  993. package/lib/workflows/dist/loops.js +4 -0
  994. package/lib/workflows/dist/loops.js.map +1 -0
  995. package/lib/workflows/dist/migration-service.d.ts +55 -0
  996. package/lib/workflows/dist/migration-service.d.ts.map +1 -0
  997. package/lib/workflows/dist/migration-service.js +73 -0
  998. package/lib/workflows/dist/migration-service.js.map +1 -0
  999. package/lib/workflows/dist/migration.d.ts +123 -0
  1000. package/lib/workflows/dist/migration.d.ts.map +1 -0
  1001. package/lib/workflows/dist/migration.js +217 -0
  1002. package/lib/workflows/dist/migration.js.map +1 -0
  1003. package/lib/workflows/dist/operator-transports.d.ts +265 -0
  1004. package/lib/workflows/dist/operator-transports.d.ts.map +1 -0
  1005. package/lib/workflows/dist/operator-transports.js +404 -0
  1006. package/lib/workflows/dist/operator-transports.js.map +1 -0
  1007. package/lib/workflows/dist/reconciliation.d.ts +25 -0
  1008. package/lib/workflows/dist/reconciliation.d.ts.map +1 -0
  1009. package/lib/workflows/dist/reconciliation.js +109 -0
  1010. package/lib/workflows/dist/reconciliation.js.map +1 -0
  1011. package/lib/workflows/dist/runtime.d.ts +65 -0
  1012. package/lib/workflows/dist/runtime.d.ts.map +1 -0
  1013. package/lib/workflows/dist/runtime.js +492 -0
  1014. package/lib/workflows/dist/runtime.js.map +1 -0
  1015. package/lib/workflows/dist/saga-definition.d.ts +46 -0
  1016. package/lib/workflows/dist/saga-definition.d.ts.map +1 -0
  1017. package/lib/workflows/dist/saga-definition.js +71 -0
  1018. package/lib/workflows/dist/saga-definition.js.map +1 -0
  1019. package/lib/workflows/dist/saga-runtime.d.ts +51 -0
  1020. package/lib/workflows/dist/saga-runtime.d.ts.map +1 -0
  1021. package/lib/workflows/dist/saga-runtime.js +499 -0
  1022. package/lib/workflows/dist/saga-runtime.js.map +1 -0
  1023. package/lib/workflows/dist/sagas.d.ts +6 -0
  1024. package/lib/workflows/dist/sagas.d.ts.map +1 -0
  1025. package/lib/workflows/dist/sagas.js +4 -0
  1026. package/lib/workflows/dist/sagas.js.map +1 -0
  1027. package/lib/workflows/dist/scheduled-helpers.d.ts +53 -0
  1028. package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -0
  1029. package/lib/workflows/dist/scheduled-helpers.js +230 -0
  1030. package/lib/workflows/dist/scheduled-helpers.js.map +1 -0
  1031. package/lib/workflows/dist/scheduled.d.ts +116 -0
  1032. package/lib/workflows/dist/scheduled.d.ts.map +1 -0
  1033. package/lib/workflows/dist/scheduled.js +781 -0
  1034. package/lib/workflows/dist/scheduled.js.map +1 -0
  1035. package/lib/workflows/dist/traces.d.ts +158 -0
  1036. package/lib/workflows/dist/traces.d.ts.map +1 -0
  1037. package/lib/workflows/dist/traces.js +366 -0
  1038. package/lib/workflows/dist/traces.js.map +1 -0
  1039. package/lib/workflows/dist/versions.d.ts +57 -0
  1040. package/lib/workflows/dist/versions.d.ts.map +1 -0
  1041. package/lib/workflows/dist/versions.js +87 -0
  1042. package/lib/workflows/dist/versions.js.map +1 -0
  1043. package/lib/workflows/dist/worker.d.ts +51 -0
  1044. package/lib/workflows/dist/worker.d.ts.map +1 -0
  1045. package/lib/workflows/dist/worker.js +143 -0
  1046. package/lib/workflows/dist/worker.js.map +1 -0
  1047. package/lib/workflows/package.json +5 -0
  1048. package/lib/workflows/src/agents.ts +65 -0
  1049. package/lib/workflows/src/children-coordinator.ts +50 -0
  1050. package/lib/workflows/src/children-definition.ts +88 -0
  1051. package/lib/workflows/src/children-discovery.ts +32 -0
  1052. package/lib/workflows/src/children-runtime.ts +169 -0
  1053. package/lib/workflows/src/children.ts +12 -0
  1054. package/lib/workflows/src/composite-fleet.ts +155 -0
  1055. package/lib/workflows/src/composite-host.ts +67 -0
  1056. package/lib/workflows/src/composites.ts +6 -0
  1057. package/lib/workflows/src/definition.ts +113 -0
  1058. package/lib/workflows/src/drain.ts +56 -0
  1059. package/lib/workflows/src/ephemeral.ts +124 -0
  1060. package/lib/workflows/src/fleet-control.ts +326 -0
  1061. package/lib/workflows/src/graph-coordinator.ts +223 -0
  1062. package/lib/workflows/src/graph-definition.ts +70 -0
  1063. package/lib/workflows/src/graph-discovery.ts +145 -0
  1064. package/lib/workflows/src/graphs.ts +56 -0
  1065. package/lib/workflows/src/hook-relay.ts +177 -0
  1066. package/lib/workflows/src/index.ts +27 -0
  1067. package/lib/workflows/src/leadership.ts +102 -0
  1068. package/lib/workflows/src/lifecycle-definition.ts +194 -0
  1069. package/lib/workflows/src/lifecycle-fleet.ts +346 -0
  1070. package/lib/workflows/src/lifecycle-host.ts +109 -0
  1071. package/lib/workflows/src/lifecycle-human-transport.ts +170 -0
  1072. package/lib/workflows/src/lifecycle-runtime.ts +673 -0
  1073. package/lib/workflows/src/lifecycle.ts +59 -0
  1074. package/lib/workflows/src/loop-definition.ts +62 -0
  1075. package/lib/workflows/src/loop-runtime.ts +260 -0
  1076. package/lib/workflows/src/loops.ts +7 -0
  1077. package/lib/workflows/src/migration-service.ts +83 -0
  1078. package/lib/workflows/src/migration.ts +242 -0
  1079. package/lib/workflows/src/operator-transports.ts +439 -0
  1080. package/lib/workflows/src/reconciliation.ts +121 -0
  1081. package/lib/workflows/src/runtime.ts +348 -0
  1082. package/lib/workflows/src/saga-definition.ts +104 -0
  1083. package/lib/workflows/src/saga-runtime.ts +406 -0
  1084. package/lib/workflows/src/sagas.ts +24 -0
  1085. package/lib/workflows/src/scheduled-helpers.ts +214 -0
  1086. package/lib/workflows/src/scheduled.ts +707 -0
  1087. package/lib/workflows/src/traces.ts +381 -0
  1088. package/lib/workflows/src/versions.ts +114 -0
  1089. package/lib/workflows/src/worker.ts +115 -0
  1090. package/lib/workstream/dist/executions.d.ts +34 -0
  1091. package/lib/workstream/dist/executions.d.ts.map +1 -0
  1092. package/lib/workstream/dist/executions.js +344 -0
  1093. package/lib/workstream/dist/executions.js.map +1 -0
  1094. package/lib/workstream/dist/humans.d.ts +76 -0
  1095. package/lib/workstream/dist/humans.d.ts.map +1 -0
  1096. package/lib/workstream/dist/humans.js +273 -0
  1097. package/lib/workstream/dist/humans.js.map +1 -0
  1098. package/lib/workstream/dist/index.d.ts +61 -0
  1099. package/lib/workstream/dist/index.d.ts.map +1 -0
  1100. package/lib/workstream/dist/index.js +310 -0
  1101. package/lib/workstream/dist/index.js.map +1 -0
  1102. package/lib/workstream/dist/timers.d.ts +41 -0
  1103. package/lib/workstream/dist/timers.d.ts.map +1 -0
  1104. package/lib/workstream/dist/timers.js +240 -0
  1105. package/lib/workstream/dist/timers.js.map +1 -0
  1106. package/lib/workstream/dist/webhooks.d.ts +69 -0
  1107. package/lib/workstream/dist/webhooks.d.ts.map +1 -0
  1108. package/lib/workstream/dist/webhooks.js +313 -0
  1109. package/lib/workstream/dist/webhooks.js.map +1 -0
  1110. package/lib/workstream/package.json +5 -0
  1111. package/lib/workstream/src/executions.ts +253 -0
  1112. package/lib/workstream/src/humans.ts +323 -0
  1113. package/lib/workstream/src/index.ts +279 -0
  1114. package/lib/workstream/src/timers.ts +212 -0
  1115. package/lib/workstream/src/webhooks.ts +180 -0
  1116. package/package.json +281 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ Mayura
2
+ Copyright 2026 The Mayura Authors
3
+
4
+ This product includes software developed by the Mayura contributors.
5
+
6
+ Third-party dependencies retain their own copyright and license terms. Exact
7
+ resolved versions are recorded in pnpm-lock.yaml and reviewed by the release
8
+ artifact and dependency qualification procedures.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Mayura
2
+
3
+ An independent TypeScript framework for building agents, typed tools and durable workflows.
4
+
5
+ **Pre-1.0 — not yet published.** The public API is classified stable for 1.0 and gated by an API report ([policy](docs/api-stability.md)), but no package is published. Owner-held release steps remain; see the [v1 release plan](docs/v1-release-plan.md). Mayura is Apache-2.0 licensed; the currently qualified platforms are intentionally narrow. See [development status](docs/development-status.md) and the [support matrix](docs/support-matrix.md).
6
+
7
+ Mayura is one npm package, `mayura` (not yet published). `mayura` is the SDK, and each part has its own entry point:
8
+
9
+ ```ts
10
+ import { createRuntime, defineAgent } from 'mayura';
11
+ import { defineWorkflowLifecycle, fanOut } from 'mayura/workflows/lifecycle';
12
+ import { createSqliteStore } from 'mayura/storage-sqlite'; // with the optional peer: npm install better-sqlite3
13
+ ```
14
+
15
+ `npx mayura init` creates a project. Native SQLite, PostgreSQL, QuickJS and React are optional peers: install
16
+ `better-sqlite3`, `pg`, `quickjs-emscripten-core` with `@jitl/quickjs-wasmfile-release-sync`, or `react` only when you
17
+ use the part that needs it. Inside this repository the same entry points come from `packages/mayura`, a generated
18
+ facade over the workspace packages (`@mayura/*`, which are internal and never published).
19
+
20
+ ## Developing this checkout
21
+
22
+ Mayura supports Node.js 22 LTS (>= 22.12.0) and 24 (>= 24.14.1); the maintainer workspace uses Node.js 24.14.1 and pnpm 10.17.1. Consumer applications will not need this workspace build system.
23
+
24
+ ```sh
25
+ pnpm install --frozen-lockfile --ignore-scripts
26
+ pnpm check
27
+ pnpm example
28
+ ```
29
+
30
+ The basic SDK requires no Docker, native database, server or hosted account. [Select SQLite or PostgreSQL explicitly](docs/how-to/storage-installation.md); existing `mayura/storage` imports remain a both-adapter compatibility option. Docker is used only for integration testing/deployment profiles that select it.
31
+
32
+ ## Current development slices
33
+
34
+ - Typed agents and tools, bounded process-local tool DAGs with exact predecessor-output references, and [required child agents](docs/how-to/agent-orchestration.md) with shared authority, budgets and cancellation.
35
+ - [Workflow-as-tool composition](docs/how-to/workflow-composition.md) for explicit approval-free ephemeral graphs, without installing database drivers.
36
+ - Optional SQL-backed workflows, approvals, signals, memory/context foundations and a [standalone leased job ledger](docs/specs/leased-scheduler.md). Explicit [scheduled workflows](docs/scheduled-workflows.md) couple claims, approvals, fixed costs and workflow transitions atomically.
37
+ - [Durable completion waits](docs/how-to/execution-completion-waits.md) over existing scheduled workflows, without keeping a worker or callback alive while waiting.
38
+ - [Versioned workflow graph waits](docs/how-to/workflow-graph-waits.md) with immutable existing-run targets, explicit resumption and metadata-only results before downstream tools or approvals.
39
+ - [Finite graph discovery](docs/how-to/workflow-graph-discovery.md) for finding unfinished persisted graphs after restart, with bounded examined-owner pages and explicit application-owned continuation.
40
+ - [Registered graph continuation](docs/how-to/workflow-graph-coordinator.md) through one shared driver, with finite pages, exact per-definition resource plans and safe partial-page retry reports.
41
+ - [Durable shared budgets](docs/how-to/durable-budgets.md) for trusted hosts, with atomic financial/call reservations, unknown-cost retention and committed overrun evidence. Existing workflows are not automatically enrolled.
42
+ - Local processors and [metered auxiliary guardrails](docs/specs/auxiliary-guardrails.md), including explicit moderation and protected-segment language processing.
43
+ - [Required lifecycle hooks](docs/how-to/lifecycle-hooks.md) with immutable proposals, mediated read/pure-tool actions, shared limits and output withholding.
44
+ - An authenticated Fetch API, browser-safe client and optional [loopback-only Hono/Node host](docs/how-to/local-server.md). This is not production or durable multi-host serving.
45
+ - Authenticated, revision-bound [workflow signal delivery](docs/specs/workflow-signal-transport.md) across server, browser client and Node CLI, with application-owned durable journaling.
46
+ - Optional [native metadata observability](docs/specs/native-observability.md) with bounded history, explicit gaps and isolated sinks, plus a separate experimental [OTLP/HTTP JSON log exporter](docs/specs/otlp-http-json-logs.md); neither is mandatory durable audit.
47
+ - Optional [local artifact storage](docs/specs/local-artifacts.md) with scoped content addressing, staged promotion, integrity-checked reads, bounded attachment disclosure and staging cleanup.
48
+
49
+ The retained verification history includes a clean 2,525-test two-process checkpoint with PostgreSQL and live Docker, later focused slices, packed-consumer profiles, cross-platform base installation checks and exact V01–V22 evidence. Passing those finite gates does not qualify untested production environments; see the [status ledger](docs/development-status.md) and [closure ledger](docs/release-gate-closure.md).
50
+
51
+ ## Documentation
52
+
53
+ Start with the [quickstart](docs/quickstart.md), [documentation index](docs/README.md), and [architecture](docs/adr/0001-foundation.md).
54
+
55
+ Mayura is open source under Apache-2.0. Workspace manifests remain private as a publication safety control; the controlled release process creates reviewed public artifacts only after registry/repository ownership and provenance are verified.
@@ -0,0 +1,65 @@
1
+ import type { SandboxAdapter } from '../../code-mode/dist/index.js';
2
+ export interface DockerQuickJsAdapterOptions {
3
+ /** Absolute trusted Docker CLI path. PATH lookup is deliberately unsupported. */
4
+ readonly dockerPath: string;
5
+ /** Exact locally present content ID returned by `docker image inspect --format {{.Id}}`. */
6
+ readonly image: string;
7
+ /** Exact SHA-256 digest of the retained SPDX document embedded and labeled by the build. */
8
+ readonly provenance: string;
9
+ }
10
+ export interface DockerImagePromotionStatement {
11
+ readonly format: 'mayura-docker-promotion-v1';
12
+ readonly subject: {
13
+ readonly image: string;
14
+ readonly provenance: string;
15
+ };
16
+ readonly builderId: string;
17
+ readonly scan: {
18
+ readonly scannerId: string;
19
+ readonly scannerVersion: string;
20
+ readonly reportDigest: string;
21
+ readonly completedAt: string;
22
+ readonly critical: number;
23
+ readonly high: number;
24
+ readonly unknown: number;
25
+ };
26
+ readonly issuedAt: string;
27
+ readonly expiresAt: string;
28
+ }
29
+ export interface DockerImagePromotionProof {
30
+ readonly statement: DockerImagePromotionStatement;
31
+ /** `base64:` followed by the detached Ed25519 signature of the canonical statement. */
32
+ readonly signature: string;
33
+ /** Trusted Ed25519 SubjectPublicKeyInfo PEM pinned by the application. */
34
+ readonly publicKey: string;
35
+ }
36
+ export interface PromotedDockerQuickJsAdapterOptions extends DockerQuickJsAdapterOptions {
37
+ readonly promotion: DockerImagePromotionProof;
38
+ /** Defaults to 24 hours; maximum seven days. */
39
+ readonly maxScanAgeMs?: number;
40
+ }
41
+ export interface DockerImagePromotionIssuance {
42
+ /** Exact UTF-8 SARIF emitted by the fixed high/critical/unspecified scan command. */
43
+ readonly sarif: string;
44
+ readonly image: string;
45
+ readonly provenance: string;
46
+ readonly builderId: string;
47
+ readonly scannerId: string;
48
+ readonly scannerVersion: string;
49
+ readonly completedAt: string;
50
+ readonly issuedAt: string;
51
+ readonly expiresAt: string;
52
+ /** Ed25519 private key in PKCS#8 PEM. It is never returned. */
53
+ readonly privateKey: string;
54
+ }
55
+ /** Stable bytes for CI signing; validation rejects extensions and ambiguous data before serialization. */
56
+ export declare function serializeDockerImagePromotion(value: DockerImagePromotionStatement): string;
57
+ /** Converts a successful empty bounded SARIF report into a signed promotion proof. */
58
+ export declare function issueDockerImagePromotion(value: DockerImagePromotionIssuance): DockerImagePromotionProof;
59
+ /** Verifies a signed, clean, fresh statement against the exact configured image identity and current host time. */
60
+ export declare function verifyDockerImagePromotion(proof: DockerImagePromotionProof, expected: Pick<DockerQuickJsAdapterOptions, 'image' | 'provenance'>, maxScanAgeMs?: number): DockerImagePromotionStatement;
61
+ /** Creates the hardened local Docker profile; qualification remains test-only until the full V15 matrix passes. */
62
+ export declare function createDockerQuickJsSandboxAdapter(options: DockerQuickJsAdapterOptions): SandboxAdapter;
63
+ /** Requires a currently valid clean Ed25519-signed promotion in addition to exact local image inspection. */
64
+ export declare function createPromotedDockerQuickJsSandboxAdapter(options: PromotedDockerQuickJsAdapterOptions): SandboxAdapter;
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AAOjF,MAAM,WAAW,2BAA2B;IAC1C,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CA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C1G,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,6BAA6B,GAAG,MAAM,CAE1F;AAED,sFAAsF;AACtF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,4BAA4B,GAAG,yBAAyB,CAiCxG;AA8BD,mHAAmH;AACnH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,CAAC,2BAA2B,EAAE,OAAO,GAAG,YAAY,CAAC,EAC9I,YAAY,SAAa,GAAG,6BAA6B,CAE1D;AAsDD,mHAAmH;AACnH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,2BAA2B,GAAG,cAAc,CAEtG;AAED,6GAA6G;AAC7G,wBAAgB,yCAAyC,CAAC,OAAO,EAAE,mCAAmC,GAAG,cAAc,CAWtH"}
@@ -0,0 +1,228 @@
1
+ import { execFile, spawn } from 'node:child_process';
2
+ import { createHash, createPrivateKey, createPublicKey, randomUUID, sign, verify } from 'node:crypto';
3
+ import { isAbsolute } from 'node:path';
4
+ import { promisify } from 'node:util';
5
+ import { createQuickJsProtocolAdapter } from '../../adapter-code-quickjs/dist/index.js';
6
+ const executeFile = promisify(execFile);
7
+ const imageId = /^sha256:[a-f0-9]{64}$/;
8
+ const provenanceDigest = /^sha256:[a-f0-9]{64}$/;
9
+ const provenanceLabel = 'dev.mayura.code-sandbox.provenance';
10
+ const identity = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;
11
+ const own = (value, expected) => {
12
+ if (!value || typeof value !== 'object' || Object.getPrototypeOf(value) !== Object.prototype)
13
+ throw new TypeError('Promotion evidence must be plain data.');
14
+ const fields = Object.getOwnPropertyDescriptors(value);
15
+ if (Reflect.ownKeys(fields).length !== expected.length || expected.some(key => !fields[key] || !('value' in fields[key])))
16
+ throw new TypeError('Promotion evidence has an invalid shape.');
17
+ return fields;
18
+ };
19
+ const text = (value, pattern = identity) => {
20
+ if (typeof value !== 'string' || !pattern.test(value))
21
+ throw new TypeError('Promotion evidence contains an invalid identity.');
22
+ return value;
23
+ };
24
+ const count = (value) => {
25
+ if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0)
26
+ throw new TypeError('Promotion evidence contains an invalid finding count.');
27
+ return value;
28
+ };
29
+ const instant = (value) => {
30
+ if (typeof value !== 'string')
31
+ throw new TypeError('Promotion evidence requires canonical timestamps.');
32
+ const time = Date.parse(value);
33
+ if (!Number.isFinite(time) || new Date(time).toISOString() !== value)
34
+ throw new TypeError('Promotion evidence requires canonical timestamps.');
35
+ return { value, time };
36
+ };
37
+ function statement(value) {
38
+ const root = own(value, ['format', 'subject', 'builderId', 'scan', 'issuedAt', 'expiresAt']);
39
+ if (root['format'].value !== 'mayura-docker-promotion-v1')
40
+ throw new TypeError('Unsupported Docker promotion statement.');
41
+ const subject = own(root['subject'].value, ['image', 'provenance']);
42
+ const scan = own(root['scan'].value, ['scannerId', 'scannerVersion', 'reportDigest', 'completedAt', 'critical', 'high', 'unknown']);
43
+ const issued = instant(root['issuedAt'].value);
44
+ const expires = instant(root['expiresAt'].value);
45
+ const completed = instant(scan['completedAt'].value);
46
+ if (completed.time > issued.time || issued.time >= expires.time)
47
+ throw new TypeError('Docker promotion timestamps are inconsistent.');
48
+ return Object.freeze({
49
+ format: 'mayura-docker-promotion-v1',
50
+ subject: Object.freeze({ image: text(subject['image'].value, imageId), provenance: text(subject['provenance'].value, provenanceDigest) }),
51
+ builderId: text(root['builderId'].value),
52
+ scan: Object.freeze({ scannerId: text(scan['scannerId'].value), scannerVersion: text(scan['scannerVersion'].value),
53
+ reportDigest: text(scan['reportDigest'].value, provenanceDigest), completedAt: completed.value,
54
+ critical: count(scan['critical'].value), high: count(scan['high'].value), unknown: count(scan['unknown'].value) }),
55
+ issuedAt: issued.value, expiresAt: expires.value,
56
+ });
57
+ }
58
+ /** Stable bytes for CI signing; validation rejects extensions and ambiguous data before serialization. */
59
+ export function serializeDockerImagePromotion(value) {
60
+ return JSON.stringify(statement(value));
61
+ }
62
+ /** Converts a successful empty bounded SARIF report into a signed promotion proof. */
63
+ export function issueDockerImagePromotion(value) {
64
+ const fields = own(value, ['sarif', 'image', 'provenance', 'builderId', 'scannerId', 'scannerVersion', 'completedAt', 'issuedAt', 'expiresAt', 'privateKey']);
65
+ const sarif = fields['sarif'].value;
66
+ const privateKey = fields['privateKey'].value;
67
+ if (typeof sarif !== 'string' || Buffer.byteLength(sarif) < 2 || Buffer.byteLength(sarif) > 16 * 1_024 * 1_024
68
+ || typeof privateKey !== 'string' || privateKey.length < 80 || privateKey.length > 16_384)
69
+ throw new TypeError('Promotion issuance input is malformed.');
70
+ let report;
71
+ try {
72
+ report = JSON.parse(sarif);
73
+ }
74
+ catch {
75
+ throw new TypeError('Promotion issuance requires valid SARIF JSON.');
76
+ }
77
+ const root = own(report, ['version', 'runs', '$schema'].filter(key => Object.hasOwn(report, key)));
78
+ if (root['version']?.value !== '2.1.0' || !Array.isArray(root['runs']?.value) || root['runs'].value.length < 1 || root['runs'].value.length > 16) {
79
+ throw new TypeError('Promotion issuance requires bounded SARIF 2.1.0 runs.');
80
+ }
81
+ for (const item of root['runs'].value) {
82
+ if (!item || typeof item !== 'object' || Object.getPrototypeOf(item) !== Object.prototype)
83
+ throw new TypeError('Promotion SARIF run is malformed.');
84
+ const results = Object.getOwnPropertyDescriptor(item, 'results');
85
+ if (!results || !('value' in results) || !Array.isArray(results.value) || results.value.length !== 0) {
86
+ throw new TypeError('Promotion is denied when the filtered scan reports a finding or omits results.');
87
+ }
88
+ }
89
+ const completed = instant(fields['completedAt'].value);
90
+ const issued = instant(fields['issuedAt'].value);
91
+ const expires = instant(fields['expiresAt'].value);
92
+ if (completed.time > issued.time || issued.time >= expires.time)
93
+ throw new TypeError('Promotion issuance timestamps are inconsistent.');
94
+ let key;
95
+ try {
96
+ key = createPrivateKey(privateKey);
97
+ }
98
+ catch {
99
+ throw new TypeError('Promotion issuance requires a valid private key.');
100
+ }
101
+ if (key.type !== 'private' || key.asymmetricKeyType !== 'ed25519')
102
+ throw new TypeError('Promotion issuance requires an Ed25519 private key.');
103
+ const promoted = {
104
+ format: 'mayura-docker-promotion-v1', subject: { image: text(fields['image'].value, imageId), provenance: text(fields['provenance'].value, provenanceDigest) },
105
+ builderId: text(fields['builderId'].value), scan: { scannerId: text(fields['scannerId'].value), scannerVersion: text(fields['scannerVersion'].value),
106
+ reportDigest: `sha256:${createHash('sha256').update(sarif, 'utf8').digest('hex')}`, completedAt: completed.value,
107
+ critical: 0, high: 0, unknown: 0 }, issuedAt: issued.value, expiresAt: expires.value,
108
+ };
109
+ const serialized = serializeDockerImagePromotion(promoted);
110
+ const proof = { statement: promoted, signature: `base64:${sign(null, Buffer.from(serialized), key).toString('base64')}`,
111
+ publicKey: createPublicKey(key).export({ type: 'spki', format: 'pem' }).toString() };
112
+ return promotion(proof);
113
+ }
114
+ function promotion(value) {
115
+ const fields = own(value, ['statement', 'signature', 'publicKey']);
116
+ const signed = statement(fields['statement'].value);
117
+ const signature = fields['signature'].value;
118
+ const publicKey = fields['publicKey'].value;
119
+ if (typeof signature !== 'string' || !/^base64:[A-Za-z0-9+/]+={0,2}$/.test(signature)
120
+ || typeof publicKey !== 'string' || publicKey.length < 80 || publicKey.length > 4_096)
121
+ throw new TypeError('Docker promotion proof is malformed.');
122
+ const encoded = signature.slice(7);
123
+ const decoded = Buffer.from(encoded, 'base64');
124
+ if (decoded.length !== 64 || decoded.toString('base64') !== encoded)
125
+ throw new TypeError('Docker promotion signature is malformed.');
126
+ const key = createPublicKey(publicKey);
127
+ if (key.type !== 'public' || key.asymmetricKeyType !== 'ed25519'
128
+ || !verify(null, Buffer.from(JSON.stringify(signed)), key, decoded))
129
+ throw new TypeError('Docker promotion signature is invalid.');
130
+ return Object.freeze({ statement: signed, signature, publicKey });
131
+ }
132
+ function verifyPromotion(proof, expected, maxScanAgeMs, now) {
133
+ if (!Number.isSafeInteger(maxScanAgeMs) || maxScanAgeMs < 1 || maxScanAgeMs > 7 * 86_400_000 || !Number.isSafeInteger(now) || now < 0) {
134
+ throw new TypeError('Docker promotion freshness bounds are invalid.');
135
+ }
136
+ const verified = promotion(proof).statement;
137
+ const scanned = Date.parse(verified.scan.completedAt);
138
+ if (verified.subject.image !== expected.image || verified.subject.provenance !== expected.provenance
139
+ || verified.scan.critical !== 0 || verified.scan.high !== 0 || verified.scan.unknown !== 0
140
+ || now < Date.parse(verified.issuedAt) || now >= Date.parse(verified.expiresAt) || now - scanned > maxScanAgeMs) {
141
+ throw new TypeError('Docker image promotion policy was not satisfied.');
142
+ }
143
+ return verified;
144
+ }
145
+ /** Verifies a signed, clean, fresh statement against the exact configured image identity and current host time. */
146
+ export function verifyDockerImagePromotion(proof, expected, maxScanAgeMs = 86_400_000) {
147
+ return verifyPromotion(proof, expected, maxScanAgeMs, Date.now());
148
+ }
149
+ function config(value) {
150
+ if (!value || Object.getPrototypeOf(value) !== Object.prototype)
151
+ throw new TypeError('Docker adapter configuration must be plain data.');
152
+ const fields = Object.getOwnPropertyDescriptors(value);
153
+ if (Reflect.ownKeys(fields).length !== 3 || !fields['dockerPath'] || !('value' in fields['dockerPath'])
154
+ || !fields['image'] || !('value' in fields['image']) || typeof fields['dockerPath'].value !== 'string'
155
+ || !fields['provenance'] || !('value' in fields['provenance'])
156
+ || !isAbsolute(fields['dockerPath'].value) || typeof fields['image'].value !== 'string' || !imageId.test(fields['image'].value)
157
+ || typeof fields['provenance'].value !== 'string' || !provenanceDigest.test(fields['provenance'].value)) {
158
+ throw new TypeError('Docker adapter requires an absolute CLI path plus exact image and provenance digests.');
159
+ }
160
+ return Object.freeze({ dockerPath: fields['dockerPath'].value, image: fields['image'].value, provenance: fields['provenance'].value });
161
+ }
162
+ function bytes(value) { return `${value}b`; }
163
+ function createAdapter(selected, admit) {
164
+ return createQuickJsProtocolAdapter({
165
+ id: 'mayura.quickjs-docker',
166
+ version: '0.1.0',
167
+ isAvailable: async () => {
168
+ try {
169
+ if (admit && !admit())
170
+ return false;
171
+ const result = await executeFile(selected.dockerPath, ['image', 'inspect', '--format', '{{json .}}', selected.image], {
172
+ windowsHide: true, timeout: 10_000, maxBuffer: 128 * 1_024, env: Object.freeze({}),
173
+ });
174
+ const inspected = JSON.parse(result.stdout);
175
+ return inspected.Id === selected.image && inspected.Config?.Labels?.[provenanceLabel] === selected.provenance;
176
+ }
177
+ catch {
178
+ return false;
179
+ }
180
+ },
181
+ launch: (request) => {
182
+ const name = `mayura-code-${randomUUID()}`;
183
+ const memory = Math.min(2_415_919_104, request.manifest.limits.memoryBytes + 268_435_456);
184
+ const args = ['run', '--rm', '--interactive', '--pull=never', '--name', name,
185
+ '--network=none', '--read-only', '--cap-drop=ALL', '--security-opt=no-new-privileges=true', '--security-opt=seccomp=builtin',
186
+ '--pids-limit=16', '--ulimit=nofile=64:64', '--cpus=1', '--memory', bytes(memory), '--memory-swap', bytes(memory),
187
+ '--user=65532:65532', '--ipc=none', '--tmpfs', `/tmp:rw,noexec,nosuid,nodev,size=${request.manifest.limits.scratchBytes}`,
188
+ selected.image];
189
+ const child = spawn(selected.dockerPath, args, {
190
+ windowsHide: true,
191
+ env: Object.freeze({}),
192
+ stdio: ['pipe', 'pipe', 'pipe'],
193
+ });
194
+ const terminate = () => {
195
+ child.stdin.destroy();
196
+ child.stdout.destroy();
197
+ child.stderr.destroy();
198
+ child.kill('SIGKILL');
199
+ const remover = execFile(selected.dockerPath, ['rm', '--force', name], { windowsHide: true, env: Object.freeze({}), timeout: 10_000 }, () => undefined);
200
+ remover.unref();
201
+ };
202
+ return Object.freeze({ child, terminate });
203
+ },
204
+ });
205
+ }
206
+ /** Creates the hardened local Docker profile; qualification remains test-only until the full V15 matrix passes. */
207
+ export function createDockerQuickJsSandboxAdapter(options) {
208
+ return createAdapter(config(options));
209
+ }
210
+ /** Requires a currently valid clean Ed25519-signed promotion in addition to exact local image inspection. */
211
+ export function createPromotedDockerQuickJsSandboxAdapter(options) {
212
+ const fields = own(options, Object.hasOwn(options, 'maxScanAgeMs')
213
+ ? ['dockerPath', 'image', 'provenance', 'promotion', 'maxScanAgeMs'] : ['dockerPath', 'image', 'provenance', 'promotion']);
214
+ const selected = config({ dockerPath: fields['dockerPath'].value, image: fields['image'].value, provenance: fields['provenance'].value });
215
+ const proof = promotion(fields['promotion'].value);
216
+ const maximum = fields['maxScanAgeMs']?.value ?? 86_400_000;
217
+ verifyDockerImagePromotion(proof, selected, maximum);
218
+ return createAdapter(selected, () => {
219
+ try {
220
+ verifyDockerImagePromotion(proof, selected, maximum);
221
+ return true;
222
+ }
223
+ catch {
224
+ return false;
225
+ }
226
+ });
227
+ }
228
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAuD,MAAM,8BAA8B,CAAC;AAGjI,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxC,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,eAAe,GAAG,oCAAoC,CAAC;AAiD7D,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,GAAG,GAAG,CAAC,KAAc,EAAE,QAA2B,EAAsC,EAAE;IAC9F,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS;QAAE,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;IA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AAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE;QAClC,IAAI,CAAC;YAAC,0BAA0B,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAAC,OAAO,IAAI,CAAC;QAAC,CAAC;QAC1E,MAAM,CAAC;YAAC,OAAO,KAAK,CAAC;QAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { execFile, spawn } from 'node:child_process';\nimport { createHash, createPrivateKey, createPublicKey, randomUUID, sign, verify } from 'node:crypto';\nimport { isAbsolute } from 'node:path';\nimport { promisify } from 'node:util';\nimport { createQuickJsProtocolAdapter, type QuickJsChildProcess, type QuickJsWorkerProcess } from '@mayura/adapter-code-quickjs';\nimport type { SandboxAdapter, SandboxExecutionRequest } from '@mayura/code-mode';\n\nconst executeFile = promisify(execFile);\nconst imageId = /^sha256:[a-f0-9]{64}$/;\nconst provenanceDigest = /^sha256:[a-f0-9]{64}$/;\nconst provenanceLabel = 'dev.mayura.code-sandbox.provenance';\n\nexport interface DockerQuickJsAdapterOptions {\n /** Absolute trusted Docker CLI path. PATH lookup is deliberately unsupported. */\n readonly dockerPath: string;\n /** Exact locally present content ID returned by `docker image inspect --format {{.Id}}`. */\n readonly image: string;\n /** Exact SHA-256 digest of the retained SPDX document embedded and labeled by the build. */\n readonly provenance: string;\n}\n\nexport interface DockerImagePromotionStatement {\n readonly format: 'mayura-docker-promotion-v1';\n readonly subject: { readonly image: string; readonly provenance: string };\n readonly builderId: string;\n readonly scan: {\n readonly scannerId: string; readonly scannerVersion: string; readonly reportDigest: string;\n readonly completedAt: string; readonly critical: number; readonly high: number; readonly unknown: number;\n };\n readonly issuedAt: string;\n readonly expiresAt: string;\n}\nexport interface DockerImagePromotionProof {\n readonly statement: DockerImagePromotionStatement;\n /** `base64:` followed by the detached Ed25519 signature of the canonical statement. */\n readonly signature: string;\n /** Trusted Ed25519 SubjectPublicKeyInfo PEM pinned by the application. */\n readonly publicKey: string;\n}\nexport interface PromotedDockerQuickJsAdapterOptions extends DockerQuickJsAdapterOptions {\n readonly promotion: DockerImagePromotionProof;\n /** Defaults to 24 hours; maximum seven days. */\n readonly maxScanAgeMs?: number;\n}\nexport interface DockerImagePromotionIssuance {\n /** Exact UTF-8 SARIF emitted by the fixed high/critical/unspecified scan command. */\n readonly sarif: string;\n readonly image: string;\n readonly provenance: string;\n readonly builderId: string;\n readonly scannerId: string;\n readonly scannerVersion: string;\n readonly completedAt: string;\n readonly issuedAt: string;\n readonly expiresAt: string;\n /** Ed25519 private key in PKCS#8 PEM. It is never returned. */\n readonly privateKey: string;\n}\n\nconst identity = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;\nconst own = (value: unknown, expected: readonly string[]): Record<string, PropertyDescriptor> => {\n if (!value || typeof value !== 'object' || Object.getPrototypeOf(value) !== Object.prototype) throw new TypeError('Promotion evidence must be plain data.');\n const fields = Object.getOwnPropertyDescriptors(value);\n if (Reflect.ownKeys(fields).length !== expected.length || expected.some(key => !fields[key] || !('value' in fields[key]!))) throw new TypeError('Promotion evidence has an invalid shape.');\n return fields;\n};\nconst text = (value: unknown, pattern = identity): string => {\n if (typeof value !== 'string' || !pattern.test(value)) throw new TypeError('Promotion evidence contains an invalid identity.');\n return value;\n};\nconst count = (value: unknown): number => {\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0) throw new TypeError('Promotion evidence contains an invalid finding count.');\n return value;\n};\nconst instant = (value: unknown): { readonly value: string; readonly time: number } => {\n if (typeof value !== 'string') throw new TypeError('Promotion evidence requires canonical timestamps.');\n const time = Date.parse(value);\n if (!Number.isFinite(time) || new Date(time).toISOString() !== value) throw new TypeError('Promotion evidence requires canonical timestamps.');\n return { value, time };\n};\n\nfunction statement(value: unknown): DockerImagePromotionStatement {\n const root = own(value, ['format', 'subject', 'builderId', 'scan', 'issuedAt', 'expiresAt']);\n if (root['format']!.value !== 'mayura-docker-promotion-v1') throw new TypeError('Unsupported Docker promotion statement.');\n const subject = own(root['subject']!.value, ['image', 'provenance']);\n const scan = own(root['scan']!.value, ['scannerId', 'scannerVersion', 'reportDigest', 'completedAt', 'critical', 'high', 'unknown']);\n const issued = instant(root['issuedAt']!.value); const expires = instant(root['expiresAt']!.value); const completed = instant(scan['completedAt']!.value);\n if (completed.time > issued.time || issued.time >= expires.time) throw new TypeError('Docker promotion timestamps are inconsistent.');\n return Object.freeze({\n format: 'mayura-docker-promotion-v1',\n subject: Object.freeze({ image: text(subject['image']!.value, imageId), provenance: text(subject['provenance']!.value, provenanceDigest) }),\n builderId: text(root['builderId']!.value),\n scan: Object.freeze({ scannerId: text(scan['scannerId']!.value), scannerVersion: text(scan['scannerVersion']!.value),\n reportDigest: text(scan['reportDigest']!.value, provenanceDigest), completedAt: completed.value,\n critical: count(scan['critical']!.value), high: count(scan['high']!.value), unknown: count(scan['unknown']!.value) }),\n issuedAt: issued.value, expiresAt: expires.value,\n });\n}\n\n/** Stable bytes for CI signing; validation rejects extensions and ambiguous data before serialization. */\nexport function serializeDockerImagePromotion(value: DockerImagePromotionStatement): string {\n return JSON.stringify(statement(value));\n}\n\n/** Converts a successful empty bounded SARIF report into a signed promotion proof. */\nexport function issueDockerImagePromotion(value: DockerImagePromotionIssuance): DockerImagePromotionProof {\n const fields = own(value, ['sarif', 'image', 'provenance', 'builderId', 'scannerId', 'scannerVersion', 'completedAt', 'issuedAt', 'expiresAt', 'privateKey']);\n const sarif = fields['sarif']!.value; const privateKey = fields['privateKey']!.value;\n if (typeof sarif !== 'string' || Buffer.byteLength(sarif) < 2 || Buffer.byteLength(sarif) > 16 * 1_024 * 1_024\n || typeof privateKey !== 'string' || privateKey.length < 80 || privateKey.length > 16_384) throw new TypeError('Promotion issuance input is malformed.');\n let report: unknown;\n try { report = JSON.parse(sarif); } catch { throw new TypeError('Promotion issuance requires valid SARIF JSON.'); }\n const root = own(report, ['version', 'runs', '$schema'].filter(key => Object.hasOwn(report as object, key)));\n if (root['version']?.value !== '2.1.0' || !Array.isArray(root['runs']?.value) || root['runs']!.value.length < 1 || root['runs']!.value.length > 16) {\n throw new TypeError('Promotion issuance requires bounded SARIF 2.1.0 runs.');\n }\n for (const item of root['runs']!.value as unknown[]) {\n if (!item || typeof item !== 'object' || Object.getPrototypeOf(item) !== Object.prototype) throw new TypeError('Promotion SARIF run is malformed.');\n const results = Object.getOwnPropertyDescriptor(item, 'results');\n if (!results || !('value' in results) || !Array.isArray(results.value) || results.value.length !== 0) {\n throw new TypeError('Promotion is denied when the filtered scan reports a finding or omits results.');\n }\n }\n const completed = instant(fields['completedAt']!.value); const issued = instant(fields['issuedAt']!.value); const expires = instant(fields['expiresAt']!.value);\n if (completed.time > issued.time || issued.time >= expires.time) throw new TypeError('Promotion issuance timestamps are inconsistent.');\n let key: ReturnType<typeof createPrivateKey>;\n try { key = createPrivateKey(privateKey); } catch { throw new TypeError('Promotion issuance requires a valid private key.'); }\n if (key.type !== 'private' || key.asymmetricKeyType !== 'ed25519') throw new TypeError('Promotion issuance requires an Ed25519 private key.');\n const promoted: DockerImagePromotionStatement = {\n format: 'mayura-docker-promotion-v1', subject: { image: text(fields['image']!.value, imageId), provenance: text(fields['provenance']!.value, provenanceDigest) },\n builderId: text(fields['builderId']!.value), scan: { scannerId: text(fields['scannerId']!.value), scannerVersion: text(fields['scannerVersion']!.value),\n reportDigest: `sha256:${createHash('sha256').update(sarif, 'utf8').digest('hex')}`, completedAt: completed.value,\n critical: 0, high: 0, unknown: 0 }, issuedAt: issued.value, expiresAt: expires.value,\n };\n const serialized = serializeDockerImagePromotion(promoted);\n const proof = { statement: promoted, signature: `base64:${sign(null, Buffer.from(serialized), key).toString('base64')}`,\n publicKey: createPublicKey(key).export({ type: 'spki', format: 'pem' }).toString() };\n return promotion(proof);\n}\n\nfunction promotion(value: unknown): DockerImagePromotionProof {\n const fields = own(value, ['statement', 'signature', 'publicKey']);\n const signed = statement(fields['statement']!.value);\n const signature = fields['signature']!.value; const publicKey = fields['publicKey']!.value;\n if (typeof signature !== 'string' || !/^base64:[A-Za-z0-9+/]+={0,2}$/.test(signature)\n || typeof publicKey !== 'string' || publicKey.length < 80 || publicKey.length > 4_096) throw new TypeError('Docker promotion proof is malformed.');\n const encoded = signature.slice(7); const decoded = Buffer.from(encoded, 'base64');\n if (decoded.length !== 64 || decoded.toString('base64') !== encoded) throw new TypeError('Docker promotion signature is malformed.');\n const key = createPublicKey(publicKey);\n if (key.type !== 'public' || key.asymmetricKeyType !== 'ed25519'\n || !verify(null, Buffer.from(JSON.stringify(signed)), key, decoded)) throw new TypeError('Docker promotion signature is invalid.');\n return Object.freeze({ statement: signed, signature, publicKey });\n}\n\nfunction verifyPromotion(proof: DockerImagePromotionProof, expected: Pick<DockerQuickJsAdapterOptions, 'image' | 'provenance'>,\n maxScanAgeMs: number, now: number): DockerImagePromotionStatement {\n if (!Number.isSafeInteger(maxScanAgeMs) || maxScanAgeMs < 1 || maxScanAgeMs > 7 * 86_400_000 || !Number.isSafeInteger(now) || now < 0) {\n throw new TypeError('Docker promotion freshness bounds are invalid.');\n }\n const verified = promotion(proof).statement; const scanned = Date.parse(verified.scan.completedAt);\n if (verified.subject.image !== expected.image || verified.subject.provenance !== expected.provenance\n || verified.scan.critical !== 0 || verified.scan.high !== 0 || verified.scan.unknown !== 0\n || now < Date.parse(verified.issuedAt) || now >= Date.parse(verified.expiresAt) || now - scanned > maxScanAgeMs) {\n throw new TypeError('Docker image promotion policy was not satisfied.');\n }\n return verified;\n}\n\n/** Verifies a signed, clean, fresh statement against the exact configured image identity and current host time. */\nexport function verifyDockerImagePromotion(proof: DockerImagePromotionProof, expected: Pick<DockerQuickJsAdapterOptions, 'image' | 'provenance'>,\n maxScanAgeMs = 86_400_000): DockerImagePromotionStatement {\n return verifyPromotion(proof, expected, maxScanAgeMs, Date.now());\n}\n\nfunction config(value: DockerQuickJsAdapterOptions): DockerQuickJsAdapterOptions {\n if (!value || Object.getPrototypeOf(value) !== Object.prototype) throw new TypeError('Docker adapter configuration must be plain data.');\n const fields = Object.getOwnPropertyDescriptors(value);\n if (Reflect.ownKeys(fields).length !== 3 || !fields['dockerPath'] || !('value' in fields['dockerPath'])\n || !fields['image'] || !('value' in fields['image']) || typeof fields['dockerPath'].value !== 'string'\n || !fields['provenance'] || !('value' in fields['provenance'])\n || !isAbsolute(fields['dockerPath'].value) || typeof fields['image'].value !== 'string' || !imageId.test(fields['image'].value)\n || typeof fields['provenance'].value !== 'string' || !provenanceDigest.test(fields['provenance'].value)) {\n throw new TypeError('Docker adapter requires an absolute CLI path plus exact image and provenance digests.');\n }\n return Object.freeze({ dockerPath: fields['dockerPath'].value, image: fields['image'].value, provenance: fields['provenance'].value });\n}\n\nfunction bytes(value: number): string { return `${value}b`; }\n\nfunction createAdapter(selected: DockerQuickJsAdapterOptions, admit?: () => boolean): SandboxAdapter {\n return createQuickJsProtocolAdapter({\n id: 'mayura.quickjs-docker',\n version: '0.1.0',\n isAvailable: async () => {\n try {\n if (admit && !admit()) return false;\n const result = await executeFile(selected.dockerPath, ['image', 'inspect', '--format', '{{json .}}', selected.image], {\n windowsHide: true, timeout: 10_000, maxBuffer: 128 * 1_024, env: Object.freeze({}),\n });\n const inspected = JSON.parse(result.stdout) as { Id?: unknown; Config?: { Labels?: Record<string, unknown> | null } };\n return inspected.Id === selected.image && inspected.Config?.Labels?.[provenanceLabel] === selected.provenance;\n } catch { return false; }\n },\n launch: (request: SandboxExecutionRequest): QuickJsWorkerProcess => {\n const name = `mayura-code-${randomUUID()}`;\n const memory = Math.min(2_415_919_104, request.manifest.limits.memoryBytes + 268_435_456);\n const args = ['run', '--rm', '--interactive', '--pull=never', '--name', name,\n '--network=none', '--read-only', '--cap-drop=ALL', '--security-opt=no-new-privileges=true', '--security-opt=seccomp=builtin',\n '--pids-limit=16', '--ulimit=nofile=64:64', '--cpus=1', '--memory', bytes(memory), '--memory-swap', bytes(memory),\n '--user=65532:65532', '--ipc=none', '--tmpfs', `/tmp:rw,noexec,nosuid,nodev,size=${request.manifest.limits.scratchBytes}`,\n selected.image];\n const child = spawn(selected.dockerPath, args, {\n windowsHide: true,\n env: Object.freeze({}),\n stdio: ['pipe', 'pipe', 'pipe'],\n }) as unknown as QuickJsChildProcess;\n const terminate = (): void => {\n child.stdin.destroy(); child.stdout.destroy(); child.stderr.destroy(); child.kill('SIGKILL');\n const remover = execFile(selected.dockerPath, ['rm', '--force', name], { windowsHide: true, env: Object.freeze({}), timeout: 10_000 }, () => undefined);\n remover.unref();\n };\n return Object.freeze({ child, terminate });\n },\n });\n}\n\n/** Creates the hardened local Docker profile; qualification remains test-only until the full V15 matrix passes. */\nexport function createDockerQuickJsSandboxAdapter(options: DockerQuickJsAdapterOptions): SandboxAdapter {\n return createAdapter(config(options));\n}\n\n/** Requires a currently valid clean Ed25519-signed promotion in addition to exact local image inspection. */\nexport function createPromotedDockerQuickJsSandboxAdapter(options: PromotedDockerQuickJsAdapterOptions): SandboxAdapter {\n const fields = own(options, Object.hasOwn(options, 'maxScanAgeMs')\n ? ['dockerPath', 'image', 'provenance', 'promotion', 'maxScanAgeMs'] : ['dockerPath', 'image', 'provenance', 'promotion']);\n const selected = config({ dockerPath: fields['dockerPath']!.value, image: fields['image']!.value, provenance: fields['provenance']!.value });\n const proof = promotion(fields['promotion']!.value);\n const maximum = fields['maxScanAgeMs']?.value ?? 86_400_000;\n verifyDockerImagePromotion(proof, selected, maximum);\n return createAdapter(selected, () => {\n try { verifyDockerImagePromotion(proof, selected, maximum); return true; }\n catch { return false; }\n });\n}\n"]}