@astrale-os/sdk 0.6.0-beta.3 → 0.6.0-beta.30

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 (444) hide show
  1. package/README.md +179 -58
  2. package/dist/application/action/action.d.ts +6 -0
  3. package/dist/application/action/authoring.d.ts +1 -1
  4. package/dist/application/action/context.d.ts +44 -31
  5. package/dist/application/action/define.d.ts +3 -3
  6. package/dist/application/action/index.d.ts +1 -1
  7. package/dist/application/define.d.ts +8 -6
  8. package/dist/application/define.js +28 -14
  9. package/dist/application/dependency/index.d.ts +1 -1
  10. package/dist/application/dependency/invoker.d.ts +14 -9
  11. package/dist/application/domain.d.ts +30 -0
  12. package/dist/application/index.d.ts +4 -4
  13. package/dist/application/index.js +1 -1
  14. package/dist/application/integration/operation.d.ts +2 -2
  15. package/dist/application/mutation/authoring/properties.d.ts +5 -3
  16. package/dist/application/mutation/authoring/properties.js +35 -2
  17. package/dist/application/mutation/authoring/transition.js +4 -1
  18. package/dist/application/mutation/index.d.ts +1 -1
  19. package/dist/application/query/composite/plan.d.ts +0 -4
  20. package/dist/application/query/composite/plan.js +0 -2
  21. package/dist/application/routes/admission.d.ts +2 -2
  22. package/dist/application/routes/admission.js +1 -1
  23. package/dist/application/routes/route.d.ts +2 -2
  24. package/dist/application/runtime/actions.js +3 -0
  25. package/dist/application/runtime/workflows.d.ts +3 -1
  26. package/dist/application/runtime/workflows.js +6 -4
  27. package/dist/application/view/define.js +4 -6
  28. package/dist/application/view/frontend.d.ts +2 -2
  29. package/dist/application/view/index.d.ts +1 -1
  30. package/dist/application/view/route.d.ts +0 -14
  31. package/dist/application/view/route.js +1 -64
  32. package/dist/application/workflow/authoring.d.ts +3 -2
  33. package/dist/application/workflow/context.d.ts +8 -2
  34. package/dist/application/workflow/define.d.ts +4 -4
  35. package/dist/application/workflow/define.js +20 -4
  36. package/dist/application/workflow/durable.d.ts +87 -0
  37. package/dist/application/workflow/index.d.ts +3 -2
  38. package/dist/application/workflow/runner/inline.js +3 -4
  39. package/dist/application/workflow/runner/runner.d.ts +2 -2
  40. package/dist/application/workflow/step/output.d.ts +2 -0
  41. package/dist/application/workflow/step/output.js +73 -0
  42. package/dist/application/workflow/workflow.d.ts +13 -3
  43. package/dist/deployment/adapter/adapter.d.ts +55 -13
  44. package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
  45. package/dist/deployment/adapter/bundle/file.d.ts +10 -0
  46. package/dist/deployment/adapter/bundle/index.d.ts +2 -0
  47. package/dist/deployment/adapter/define.d.ts +4 -3
  48. package/dist/deployment/adapter/define.js +107 -23
  49. package/dist/deployment/adapter/index.d.ts +4 -3
  50. package/dist/deployment/adapter/index.js +1 -0
  51. package/dist/deployment/adapter/release/command.d.ts +33 -0
  52. package/dist/deployment/adapter/release/context.d.ts +94 -0
  53. package/dist/deployment/adapter/release/index.d.ts +4 -0
  54. package/dist/deployment/adapter/release/index.js +1 -0
  55. package/dist/deployment/adapter/release/list.d.ts +53 -0
  56. package/dist/deployment/adapter/release/list.js +1 -0
  57. package/dist/deployment/adapter/release/refusal.d.ts +10 -0
  58. package/dist/deployment/adapter/release/refusal.js +14 -0
  59. package/dist/deployment/adapter/release/result.d.ts +56 -0
  60. package/dist/deployment/adapter/release/result.js +1 -0
  61. package/dist/deployment/address/configuration.d.ts +95 -0
  62. package/dist/deployment/address/configuration.js +273 -0
  63. package/dist/deployment/address/fingerprint.d.ts +5 -0
  64. package/dist/deployment/address/fingerprint.js +27 -0
  65. package/dist/deployment/address/index.d.ts +5 -0
  66. package/dist/deployment/address/index.js +4 -0
  67. package/dist/deployment/address/label.d.ts +42 -0
  68. package/dist/deployment/address/label.js +80 -0
  69. package/dist/deployment/address/line.d.ts +29 -0
  70. package/dist/deployment/address/line.js +53 -0
  71. package/dist/deployment/address/record.d.ts +73 -0
  72. package/dist/deployment/address/record.js +138 -0
  73. package/dist/deployment/address/summary.d.ts +30 -0
  74. package/dist/deployment/address/summary.js +1 -0
  75. package/dist/deployment/address/vectors.d.ts +60 -0
  76. package/dist/deployment/address/vectors.js +517 -0
  77. package/dist/deployment/authoring.d.ts +0 -2
  78. package/dist/deployment/authoring.js +0 -1
  79. package/dist/deployment/build/build.d.ts +8 -2
  80. package/dist/deployment/build/compile.d.ts +4 -4
  81. package/dist/deployment/build/compile.js +19 -17
  82. package/dist/deployment/build/frontend/compilation.d.ts +2 -4
  83. package/dist/deployment/build/frontend/compilation.js +0 -5
  84. package/dist/deployment/build/frontend/digest.js +1 -5
  85. package/dist/deployment/build/index.d.ts +1 -0
  86. package/dist/deployment/build/index.js +1 -0
  87. package/dist/deployment/build/manifest.d.ts +59 -0
  88. package/dist/deployment/build/manifest.js +118 -0
  89. package/dist/deployment/build/material.d.ts +2 -2
  90. package/dist/deployment/build/material.js +28 -13
  91. package/dist/deployment/build/schema.d.ts +2 -2
  92. package/dist/deployment/deployment.d.ts +3 -2
  93. package/dist/deployment/environment.d.ts +6 -0
  94. package/dist/deployment/environment.js +6 -0
  95. package/dist/deployment/index.d.ts +4 -6
  96. package/dist/deployment/index.js +1 -2
  97. package/dist/deployment/release/addressing.d.ts +6 -5
  98. package/dist/deployment/release/addressing.js +2 -3
  99. package/dist/deployment/release/assemble.d.ts +6 -3
  100. package/dist/deployment/release/assemble.js +12 -10
  101. package/dist/deployment/release/release.d.ts +16 -5
  102. package/dist/deployment/release/seal.d.ts +14 -0
  103. package/dist/deployment/release/seal.js +22 -0
  104. package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
  105. package/dist/deployment/release/{publication → served}/callables.js +2 -2
  106. package/dist/deployment/release/served/index.d.ts +11 -0
  107. package/dist/deployment/release/served/index.js +26 -0
  108. package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
  109. package/dist/deployment/release/{publication → served}/views.js +0 -1
  110. package/dist/deployment/runtime/admission.d.ts +2 -2
  111. package/dist/deployment/runtime/admission.js +5 -5
  112. package/dist/deployment/verify/index.d.ts +3 -4
  113. package/dist/deployment/verify/index.js +2 -3
  114. package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
  115. package/dist/deployment/verify/preflight/bundle.js +71 -0
  116. package/dist/deployment/verify/preflight/index.d.ts +1 -12
  117. package/dist/deployment/verify/preflight/index.js +1 -12
  118. package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
  119. package/dist/deployment/verify/readiness/fetch.js +26 -0
  120. package/dist/deployment/verify/readiness/identity.d.ts +3 -6
  121. package/dist/deployment/verify/readiness/identity.js +3 -3
  122. package/dist/deployment/verify/readiness/index.d.ts +15 -8
  123. package/dist/deployment/verify/readiness/index.js +25 -6
  124. package/dist/deployment/verify/readiness/release.d.ts +8 -0
  125. package/dist/deployment/verify/readiness/release.js +22 -0
  126. package/dist/deployment/worker/address.d.ts +26 -0
  127. package/dist/deployment/worker/address.js +43 -0
  128. package/dist/deployment/worker/build.d.ts +60 -0
  129. package/dist/deployment/worker/build.js +172 -0
  130. package/dist/deployment/worker/configuration.d.ts +73 -0
  131. package/dist/deployment/worker/configuration.js +165 -0
  132. package/dist/deployment/worker/content.d.ts +38 -0
  133. package/dist/deployment/worker/content.js +169 -0
  134. package/dist/deployment/worker/index.d.ts +29 -0
  135. package/dist/deployment/worker/index.js +29 -0
  136. package/dist/deployment/worker/limits.d.ts +30 -0
  137. package/dist/deployment/worker/limits.js +30 -0
  138. package/dist/deployment/worker/record.d.ts +29 -0
  139. package/dist/deployment/worker/record.js +69 -0
  140. package/dist/deployment/worker/request.d.ts +118 -0
  141. package/dist/deployment/worker/request.js +280 -0
  142. package/dist/deployment/worker/response.d.ts +101 -0
  143. package/dist/deployment/worker/response.js +207 -0
  144. package/dist/execution/identity/authentication.d.ts +33 -3
  145. package/dist/execution/identity/authentication.js +85 -40
  146. package/dist/execution/identity/callback.d.ts +16 -15
  147. package/dist/execution/identity/callback.js +21 -16
  148. package/dist/execution/identity/delivery.d.ts +6 -4
  149. package/dist/execution/identity/delivery.js +25 -20
  150. package/dist/execution/identity/identity.d.ts +17 -3
  151. package/dist/execution/identity/identity.js +12 -4
  152. package/dist/execution/identity/jwks.d.ts +5 -0
  153. package/dist/execution/identity/jwks.js +92 -102
  154. package/dist/execution/index.d.ts +4 -4
  155. package/dist/execution/index.js +2 -2
  156. package/dist/execution/invocation/admission/authentication.d.ts +11 -13
  157. package/dist/execution/invocation/admission/authentication.js +48 -44
  158. package/dist/execution/invocation/admission/authority.d.ts +28 -6
  159. package/dist/execution/invocation/admission/authority.js +9 -2
  160. package/dist/execution/invocation/admission/index.d.ts +2 -2
  161. package/dist/execution/invocation/admission/index.js +1 -1
  162. package/dist/execution/invocation/admission/input.d.ts +2 -2
  163. package/dist/execution/invocation/admission/input.js +16 -2
  164. package/dist/execution/invocation/dependency/bind.d.ts +3 -1
  165. package/dist/execution/invocation/dependency/bind.js +36 -16
  166. package/dist/execution/invocation/dispatch/context.d.ts +7 -6
  167. package/dist/execution/invocation/dispatch/context.js +17 -31
  168. package/dist/execution/invocation/dispatch/workflow.js +0 -4
  169. package/dist/execution/invocation/index.d.ts +2 -2
  170. package/dist/execution/invocation/index.js +1 -1
  171. package/dist/execution/invocation/integration/call.d.ts +2 -1
  172. package/dist/execution/invocation/integration/call.js +1 -1
  173. package/dist/execution/invocation/integration/clients.d.ts +1 -1
  174. package/dist/execution/invocation/invocation.js +49 -16
  175. package/dist/execution/invocation/result/errors.d.ts +0 -10
  176. package/dist/execution/invocation/result/errors.js +0 -17
  177. package/dist/execution/invocation/result/index.d.ts +2 -2
  178. package/dist/execution/invocation/result/index.js +1 -1
  179. package/dist/execution/invocation/result/project.js +41 -1
  180. package/dist/execution/node/serve.d.ts +2 -2
  181. package/dist/execution/node/serve.js +1 -1
  182. package/dist/execution/runtime/index.d.ts +1 -0
  183. package/dist/execution/runtime/index.js +1 -0
  184. package/dist/execution/runtime/load.d.ts +3 -3
  185. package/dist/execution/runtime/load.js +3 -2
  186. package/dist/execution/runtime/release.d.ts +17 -0
  187. package/dist/execution/runtime/release.js +7 -0
  188. package/dist/execution/serve.d.ts +10 -4
  189. package/dist/execution/serve.js +3 -0
  190. package/dist/execution/service/create.js +41 -7
  191. package/dist/execution/service/initialization.d.ts +4 -4
  192. package/dist/execution/service/initialization.js +23 -14
  193. package/dist/execution/service/release.d.ts +2 -2
  194. package/dist/execution/service/release.js +3 -2
  195. package/dist/execution/service/service.d.ts +14 -5
  196. package/dist/execution/service/serving/delivery.d.ts +5 -0
  197. package/dist/execution/service/{publication → serving}/delivery.js +4 -1
  198. package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
  199. package/dist/execution/service/serving/installation.d.ts +4 -0
  200. package/dist/execution/service/serving/installation.js +9 -0
  201. package/dist/execution/service/serving/source.d.ts +11 -0
  202. package/dist/execution/service/serving/source.js +15 -0
  203. package/dist/execution/workflows/discovery.d.ts +14 -0
  204. package/dist/execution/workflows/discovery.js +151 -0
  205. package/dist/execution/workflows/engine.d.ts +52 -0
  206. package/dist/execution/workflows/engine.js +1 -0
  207. package/dist/execution/workflows/envelope.d.ts +12 -0
  208. package/dist/execution/workflows/envelope.js +46 -0
  209. package/dist/execution/workflows/failure.d.ts +11 -0
  210. package/dist/execution/workflows/failure.js +43 -0
  211. package/dist/execution/workflows/index.d.ts +4 -0
  212. package/dist/execution/workflows/index.js +3 -0
  213. package/dist/execution/workflows/options.d.ts +34 -0
  214. package/dist/execution/workflows/options.js +65 -0
  215. package/dist/execution/workflows/receiver.d.ts +21 -0
  216. package/dist/execution/workflows/receiver.js +92 -0
  217. package/dist/execution/workflows/route.d.ts +12 -0
  218. package/dist/execution/workflows/route.js +35 -0
  219. package/dist/execution/workflows/run.d.ts +22 -0
  220. package/dist/execution/workflows/run.js +223 -0
  221. package/dist/index.d.ts +4 -4
  222. package/dist/index.js +2 -2
  223. package/dist/platform/graph/alias.d.ts +1 -5
  224. package/dist/platform/graph/alias.js +1 -5
  225. package/dist/platform/graph/document/index.d.ts +1 -1
  226. package/dist/platform/graph/document/index.js +1 -1
  227. package/dist/platform/graph/index.d.ts +1 -1
  228. package/dist/platform/graph/index.js +1 -1
  229. package/dist/platform/release/index.d.ts +2 -0
  230. package/dist/platform/release/index.js +2 -0
  231. package/dist/platform/schema/callable-authoring.d.ts +21 -0
  232. package/dist/platform/schema/callable-authoring.js +27 -0
  233. package/dist/platform/schema/class-authoring.d.ts +61 -11
  234. package/dist/platform/schema/class-authoring.js +37 -4
  235. package/dist/platform/schema/class-icon-svg.d.ts +9 -0
  236. package/dist/platform/schema/class-icon-svg.js +29 -0
  237. package/dist/platform/schema/class-icon.d.ts +3 -8
  238. package/dist/platform/schema/class-icon.js +2 -29
  239. package/dist/platform/schema/index.d.ts +6 -4
  240. package/dist/platform/schema/index.js +2 -1
  241. package/dist/platform/schema/property.d.ts +5 -0
  242. package/dist/platform/schema/schema-authoring.d.ts +14 -7
  243. package/dist/platform/schema/schema-authoring.js +5 -1
  244. package/dist/platform/versioning/dependents.d.ts +18 -0
  245. package/dist/platform/versioning/dependents.js +15 -0
  246. package/dist/platform/versioning/index.d.ts +5 -0
  247. package/dist/platform/versioning/index.js +5 -0
  248. package/dist/platform/versioning/name.d.ts +38 -0
  249. package/dist/platform/versioning/name.js +58 -0
  250. package/dist/platform/versioning/reference.d.ts +48 -0
  251. package/dist/platform/versioning/reference.js +95 -0
  252. package/dist/platform/versioning/version.d.ts +72 -0
  253. package/dist/platform/versioning/version.js +98 -0
  254. package/dist/project/admit.js +1 -5
  255. package/dist/project/define.d.ts +4 -4
  256. package/dist/project/define.js +55 -35
  257. package/dist/project/index.d.ts +1 -1
  258. package/dist/project/install-command.d.ts +6 -0
  259. package/dist/project/install-command.js +9 -0
  260. package/dist/project/project.d.ts +10 -8
  261. package/dist/testing/dataset/define.d.ts +1 -1
  262. package/dist/testing/load.js +1 -1
  263. package/dist/tooling/cli/adapter-command.d.ts +35 -0
  264. package/dist/tooling/cli/adapter-command.js +66 -0
  265. package/dist/tooling/cli/arguments.d.ts +17 -6
  266. package/dist/tooling/cli/arguments.js +175 -52
  267. package/dist/tooling/cli/build.d.ts +55 -0
  268. package/dist/tooling/cli/build.js +77 -0
  269. package/dist/tooling/cli/bun.d.ts +0 -1
  270. package/dist/tooling/cli/bun.js +0 -7
  271. package/dist/tooling/cli/commit.d.ts +35 -0
  272. package/dist/tooling/cli/commit.js +235 -0
  273. package/dist/tooling/cli/deploy-mode.d.ts +26 -0
  274. package/dist/tooling/cli/deploy-mode.js +59 -0
  275. package/dist/tooling/cli/deploy-result.d.ts +80 -0
  276. package/dist/tooling/cli/deploy-result.js +64 -0
  277. package/dist/tooling/cli/diff/declared.d.ts +7 -0
  278. package/dist/tooling/cli/diff/declared.js +27 -0
  279. package/dist/tooling/cli/diff/index.d.ts +30 -0
  280. package/dist/tooling/cli/diff/index.js +58 -0
  281. package/dist/tooling/cli/diff/render.d.ts +15 -0
  282. package/dist/tooling/cli/diff/render.js +131 -0
  283. package/dist/tooling/cli/diff/report.d.ts +88 -0
  284. package/dist/tooling/cli/diff/report.js +154 -0
  285. package/dist/tooling/cli/dotenv.d.ts +2 -2
  286. package/dist/tooling/cli/dotenv.js +3 -33
  287. package/dist/tooling/cli/help.js +173 -60
  288. package/dist/tooling/cli/immutable-deployment.d.ts +83 -0
  289. package/dist/tooling/cli/immutable-deployment.js +135 -0
  290. package/dist/tooling/cli/index.d.ts +12 -4
  291. package/dist/tooling/cli/index.js +6 -3
  292. package/dist/tooling/cli/installed-on.d.ts +83 -0
  293. package/dist/tooling/cli/installed-on.js +156 -0
  294. package/dist/tooling/cli/list.d.ts +152 -0
  295. package/dist/tooling/cli/list.js +331 -0
  296. package/dist/tooling/cli/log.d.ts +5 -0
  297. package/dist/tooling/cli/log.js +9 -0
  298. package/dist/tooling/cli/orchestrate.d.ts +0 -6
  299. package/dist/tooling/cli/orchestrate.js +246 -90
  300. package/dist/tooling/cli/project.d.ts +3 -3
  301. package/dist/tooling/cli/publish/index.d.ts +81 -0
  302. package/dist/tooling/cli/publish/index.js +383 -0
  303. package/dist/tooling/cli/publish/report.d.ts +49 -0
  304. package/dist/tooling/cli/publish/report.js +15 -0
  305. package/dist/tooling/cli/registry/client.d.ts +121 -0
  306. package/dist/tooling/cli/registry/client.js +354 -0
  307. package/dist/tooling/cli/registry/error.d.ts +11 -0
  308. package/dist/tooling/cli/registry/error.js +17 -0
  309. package/dist/tooling/cli/registry/executable.d.ts +35 -0
  310. package/dist/tooling/cli/registry/executable.js +96 -0
  311. package/dist/tooling/cli/registry/index.d.ts +9 -0
  312. package/dist/tooling/cli/registry/index.js +8 -0
  313. package/dist/tooling/cli/registry/installations.d.ts +67 -0
  314. package/dist/tooling/cli/registry/installations.js +108 -0
  315. package/dist/tooling/cli/registry/process.d.ts +36 -0
  316. package/dist/tooling/cli/registry/process.js +119 -0
  317. package/dist/tooling/cli/secrets.d.ts +9 -0
  318. package/dist/tooling/cli/secrets.js +19 -0
  319. package/dist/tooling/cli/yank.d.ts +34 -0
  320. package/dist/tooling/cli/yank.js +32 -0
  321. package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -1
  322. package/dist/tooling/linter/implementations/source/callable-requirements.js +10 -10
  323. package/dist/tooling/linter/implementations/source/dependencies.js +12 -10
  324. package/dist/tooling/linter/implementations/source/global.js +1 -2
  325. package/dist/tooling/linter/implementations/source/mutations.js +17 -17
  326. package/dist/tooling/linter/implementations/source/providers.js +5 -5
  327. package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
  328. package/dist/tooling/linter/implementations/source/views.js +2 -2
  329. package/dist/tooling/linter/policy/generated.js +14 -63
  330. package/dist/tooling/linter/requirements/registry.js +1 -6
  331. package/dist/tooling/packaging/declarations/ownership.js +1 -1
  332. package/dist/tooling/packaging/finalize.d.ts +1 -1
  333. package/dist/tooling/packaging/finalize.js +1 -1
  334. package/package.json +39 -13
  335. package/dist/application/application.d.ts +0 -28
  336. package/dist/application/query/execution/projection.d.ts +0 -3
  337. package/dist/application/query/execution/projection.js +0 -3
  338. package/dist/deployment/adapter/deploy/context.d.ts +0 -15
  339. package/dist/deployment/adapter/deploy/index.d.ts +0 -2
  340. package/dist/deployment/adapter/deploy/result.d.ts +0 -50
  341. package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
  342. package/dist/deployment/adapter/prepare/context.d.ts +0 -23
  343. package/dist/deployment/adapter/prepare/index.d.ts +0 -2
  344. package/dist/deployment/deploy.d.ts +0 -20
  345. package/dist/deployment/deploy.js +0 -31
  346. package/dist/deployment/release/publication/index.d.ts +0 -6
  347. package/dist/deployment/release/publication/index.js +0 -6
  348. package/dist/deployment/release/publication/manifest.d.ts +0 -3
  349. package/dist/deployment/release/publication/manifest.js +0 -5
  350. package/dist/deployment/release/publication/requirements.d.ts +0 -3
  351. package/dist/deployment/release/publication/requirements.js +0 -3
  352. package/dist/deployment/release/publication/seal.d.ts +0 -10
  353. package/dist/deployment/release/publication/seal.js +0 -39
  354. package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
  355. package/dist/deployment/verify/preflight/artifact.js +0 -122
  356. package/dist/deployment/verify/preflight/publication.d.ts +0 -4
  357. package/dist/deployment/verify/preflight/publication.js +0 -14
  358. package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
  359. package/dist/deployment/verify/readiness/deployment.js +0 -151
  360. package/dist/deployment/verify/readiness/publication.d.ts +0 -11
  361. package/dist/deployment/verify/readiness/publication.js +0 -41
  362. package/dist/execution/service/errors.d.ts +0 -3
  363. package/dist/execution/service/errors.js +0 -3
  364. package/dist/execution/service/publication/delivery.d.ts +0 -2
  365. package/dist/execution/service/publication/installation.d.ts +0 -3
  366. package/dist/execution/service/publication/installation.js +0 -8
  367. package/dist/execution/service/publication/source.d.ts +0 -3
  368. package/dist/execution/service/publication/source.js +0 -11
  369. package/dist/platform/publication/index.d.ts +0 -2
  370. package/dist/platform/publication/index.js +0 -2
  371. package/dist/tooling/cli/astrale/authority.d.ts +0 -5
  372. package/dist/tooling/cli/astrale/authority.js +0 -11
  373. package/dist/tooling/cli/astrale/executable.d.ts +0 -2
  374. package/dist/tooling/cli/astrale/executable.js +0 -47
  375. package/dist/tooling/cli/astrale/failure.d.ts +0 -6
  376. package/dist/tooling/cli/astrale/failure.js +0 -48
  377. package/dist/tooling/cli/astrale/instance.d.ts +0 -11
  378. package/dist/tooling/cli/astrale/instance.js +0 -52
  379. package/dist/tooling/cli/astrale/process.d.ts +0 -13
  380. package/dist/tooling/cli/astrale/process.js +0 -94
  381. package/dist/tooling/cli/astrale/version.d.ts +0 -18
  382. package/dist/tooling/cli/astrale/version.js +0 -55
  383. package/dist/tooling/cli/credential.d.ts +0 -2
  384. package/dist/tooling/cli/credential.js +0 -57
  385. package/dist/tooling/cli/deprecations.d.ts +0 -9
  386. package/dist/tooling/cli/deprecations.js +0 -15
  387. package/dist/tooling/cli/development/candidate.d.ts +0 -25
  388. package/dist/tooling/cli/development/candidate.js +0 -176
  389. package/dist/tooling/cli/development/deployment.d.ts +0 -16
  390. package/dist/tooling/cli/development/deployment.js +0 -39
  391. package/dist/tooling/cli/development/develop.d.ts +0 -11
  392. package/dist/tooling/cli/development/develop.js +0 -243
  393. package/dist/tooling/cli/development/lease.d.ts +0 -18
  394. package/dist/tooling/cli/development/lease.js +0 -163
  395. package/dist/tooling/cli/development/lifecycle.d.ts +0 -9
  396. package/dist/tooling/cli/development/lifecycle.js +0 -43
  397. package/dist/tooling/cli/development/project-imports.d.ts +0 -22
  398. package/dist/tooling/cli/development/project-imports.js +0 -39
  399. package/dist/tooling/cli/development/project-lock.d.ts +0 -16
  400. package/dist/tooling/cli/development/project-lock.js +0 -41
  401. package/dist/tooling/cli/development/rebuild.d.ts +0 -13
  402. package/dist/tooling/cli/development/rebuild.js +0 -58
  403. package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
  404. package/dist/tooling/cli/development/release-evidence.js +0 -10
  405. package/dist/tooling/cli/development/report.d.ts +0 -6
  406. package/dist/tooling/cli/development/report.js +0 -14
  407. package/dist/tooling/cli/development/session-file.d.ts +0 -53
  408. package/dist/tooling/cli/development/session-file.js +0 -337
  409. package/dist/tooling/cli/development/source-watch.d.ts +0 -14
  410. package/dist/tooling/cli/development/source-watch.js +0 -140
  411. package/dist/tooling/cli/development/sources.d.ts +0 -7
  412. package/dist/tooling/cli/development/sources.js +0 -48
  413. package/dist/tooling/cli/development/target-lock.d.ts +0 -16
  414. package/dist/tooling/cli/development/target-lock.js +0 -68
  415. package/dist/tooling/cli/development/view.d.ts +0 -28
  416. package/dist/tooling/cli/development/view.js +0 -151
  417. package/dist/tooling/cli/environment-release.d.ts +0 -21
  418. package/dist/tooling/cli/environment-release.js +0 -46
  419. package/dist/tooling/cli/evidence.d.ts +0 -11
  420. package/dist/tooling/cli/evidence.js +0 -53
  421. package/dist/tooling/cli/installation/index.d.ts +0 -2
  422. package/dist/tooling/cli/installation/index.js +0 -1
  423. package/dist/tooling/cli/installation/observation.d.ts +0 -10
  424. package/dist/tooling/cli/installation/observation.js +0 -44
  425. package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
  426. package/dist/tooling/cli/installation/reconcile.js +0 -122
  427. package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
  428. package/dist/tooling/linter/implementations/source/migrations.js +0 -113
  429. package/dist/tooling/linter/qualification/index.d.ts +0 -10
  430. package/dist/tooling/linter/qualification/index.js +0 -2
  431. package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
  432. package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
  433. package/dist/tooling/linter/qualification/runner.d.ts +0 -3
  434. package/dist/tooling/linter/qualification/runner.js +0 -6
  435. /package/dist/application/{application.js → domain.js} +0 -0
  436. /package/dist/{deployment/adapter/deploy/context.js → application/workflow/durable.js} +0 -0
  437. /package/dist/deployment/adapter/{deploy/index.js → bundle/bundle.js} +0 -0
  438. /package/dist/deployment/adapter/{deploy/result.js → bundle/file.js} +0 -0
  439. /package/dist/deployment/adapter/{prepare → bundle}/index.js +0 -0
  440. /package/dist/deployment/adapter/{prepare/artifact.js → release/command.js} +0 -0
  441. /package/dist/deployment/adapter/{prepare → release}/context.js +0 -0
  442. /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
  443. /package/dist/deployment/release/{publication → served}/routes.js +0 -0
  444. /package/dist/execution/service/{publication → serving}/index.js +0 -0
@@ -1,18 +1,14 @@
1
- import { grant, issuer } from '../../../platform/auth/index.js';
1
+ import { issuer } from '../../../platform/auth/index.js';
2
2
  import { bindSession } from '../../../platform/client/session/index.js';
3
3
  import { NodeId } from '../../../platform/graph/node/index.js';
4
4
  import { protocolError } from '../result/index.js';
5
5
  import { requireVia } from './authority.js';
6
- const ANONYMOUS = Object.freeze({
7
- caller: Object.freeze({ kind: 'anonymous' }),
8
- kernel: null,
9
- graph: null,
10
- close() { },
11
- });
12
- export async function authentication(callable, request, release, domain, authority) {
6
+ const ANONYMOUS = Object.freeze({ kind: 'anonymous' });
7
+ export async function authentication(callable, request, domain, authority) {
13
8
  const credential = request.credential;
14
- if (callable.auth === 'anonymous' && credential === undefined)
15
- return ANONYMOUS;
9
+ if (callable.auth === 'anonymous' && credential === undefined) {
10
+ return anonymous(await authority.self({ via: requireVia(request), domain, context: request.context }));
11
+ }
16
12
  if (credential === undefined) {
17
13
  throw protocolError('AUTH_MISSING', 'Authentication is required.');
18
14
  }
@@ -21,7 +17,6 @@ export async function authentication(callable, request, release, domain, authori
21
17
  const authenticated = await authority.authenticate({
22
18
  credential,
23
19
  via: requireVia(request),
24
- publication: release.publication,
25
20
  domain,
26
21
  context: request.context,
27
22
  });
@@ -36,34 +31,54 @@ export async function authentication(callable, request, release, domain, authori
36
31
  invalid();
37
32
  }
38
33
  const caller = admitCaller(authenticated.caller);
39
- const graphInput = admitGraph(authenticated.graph);
34
+ const graphInput = admitGraph(authenticated.graph, ['caller', 'self']);
40
35
  const graph = Object.freeze({
41
36
  caller: bindSession(graphInput.caller),
42
37
  self: bindSession(graphInput.self),
43
- union: bindSession(graphInput.union),
44
38
  });
45
39
  return Object.freeze({ caller, graph, close });
46
40
  }
47
41
  catch (cause) {
48
- if (close === undefined)
49
- invalid(cause);
50
- try {
51
- close();
52
- }
53
- catch (cleanup) {
54
- throw new AggregateError([cause, cleanup], 'Invocation authority returned invalid authenticated capabilities and cleanup failed.');
42
+ rejectClosing(close, cause);
43
+ }
44
+ }
45
+ /** Admit the Domain's own capabilities for a call that carries no credential. */
46
+ function anonymous(own) {
47
+ let close;
48
+ try {
49
+ close = captureClose(own);
50
+ if (own === null ||
51
+ typeof own !== 'object' ||
52
+ Array.isArray(own) ||
53
+ Reflect.ownKeys(own).some((key) => key !== 'graph' && key !== 'close') ||
54
+ close === undefined) {
55
+ invalid();
55
56
  }
57
+ const graph = Object.freeze({ self: bindSession(admitGraph(own.graph, ['self']).self) });
58
+ return Object.freeze({ caller: ANONYMOUS, graph, close });
59
+ }
60
+ catch (cause) {
61
+ rejectClosing(close, cause);
62
+ }
63
+ }
64
+ /** Release whatever the authority opened before refusing its invalid capabilities. */
65
+ function rejectClosing(close, cause) {
66
+ if (close === undefined)
56
67
  invalid(cause);
68
+ try {
69
+ close();
70
+ }
71
+ catch (cleanup) {
72
+ throw new AggregateError([cause, cleanup], 'Invocation authority returned invalid capabilities and cleanup failed.');
57
73
  }
74
+ invalid(cause);
58
75
  }
59
- function admitGraph(input) {
76
+ function admitGraph(input, modes) {
60
77
  if (input === null ||
61
78
  typeof input !== 'object' ||
62
79
  Array.isArray(input) ||
63
- !Object.hasOwn(input, 'caller') ||
64
- !Object.hasOwn(input, 'self') ||
65
- !Object.hasOwn(input, 'union') ||
66
- Reflect.ownKeys(input).some((key) => key !== 'caller' && key !== 'self' && key !== 'union')) {
80
+ modes.some((mode) => !Object.hasOwn(input, mode)) ||
81
+ Reflect.ownKeys(input).some((key) => !modes.includes(key))) {
67
82
  invalid();
68
83
  }
69
84
  return input;
@@ -79,29 +94,18 @@ function admitCaller(input) {
79
94
  invalid();
80
95
  if (!Object.hasOwn(input, 'kind') ||
81
96
  !Object.hasOwn(input, 'principal') ||
82
- !Object.hasOwn(input, 'authority') ||
97
+ !Object.hasOwn(input, 'identity') ||
83
98
  !Object.hasOwn(input, 'authentication') ||
84
- Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== 'authority' && key !== 'authentication') ||
99
+ Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== 'identity' && key !== 'authentication') ||
85
100
  Reflect.get(input, 'kind') !== 'authenticated') {
86
101
  invalid();
87
102
  }
88
- const principal = NodeId(Reflect.get(input, 'principal'));
89
- const authority = grant.accept(Reflect.get(input, 'authority'));
90
- const authentication = admitEvidence(Reflect.get(input, 'authentication'));
91
- const caller = {
103
+ return Object.freeze({
92
104
  kind: 'authenticated',
93
- get identity() {
94
- if (authority.expr.kind !== 'identity') {
95
- throw new TypeError('Caller authority does not resolve to one exact Identity.');
96
- }
97
- return authority.expr.id;
98
- },
99
- principal,
100
- authority,
101
- authentication,
102
- };
103
- Object.defineProperty(caller, 'identity', { enumerable: false });
104
- return Object.freeze(caller);
105
+ identity: NodeId(Reflect.get(input, 'identity')),
106
+ principal: NodeId(Reflect.get(input, 'principal')),
107
+ authentication: admitEvidence(Reflect.get(input, 'authentication')),
108
+ });
105
109
  }
106
110
  function admitEvidence(input) {
107
111
  if (input === null || typeof input !== 'object' || Array.isArray(input))
@@ -148,6 +152,6 @@ function optionalTime(input) {
148
152
  return input === undefined || (typeof input === 'number' && Number.isFinite(input));
149
153
  }
150
154
  function invalid(cause) {
151
- const message = 'Invocation authority returned invalid authenticated capabilities.';
155
+ const message = 'Invocation authority returned invalid capabilities.';
152
156
  throw cause === undefined ? new TypeError(message) : new TypeError(message, { cause });
153
157
  }
@@ -1,5 +1,4 @@
1
1
  import type * as invocation from '@astrale-os/kernel-protocol/invocation';
2
- import type * as publication from '@astrale-os/kernel-protocol/publication';
3
2
  import type { HandlerRequest, InvocationContext } from '@astrale-os/kernel-server';
4
3
  import type { AuthenticatedCaller } from '../../../application/action/index.js';
5
4
  import type { BoundClientSession } from '../../../platform/client/session/index.js';
@@ -8,27 +7,50 @@ export interface InvocationAdmissionInput {
8
7
  readonly call: invocation.Call;
9
8
  readonly credential?: string;
10
9
  readonly via: invocation.Via;
11
- readonly publication: publication.Publication;
12
10
  readonly domain: Domain;
13
11
  readonly context: InvocationContext;
14
12
  }
15
13
  export interface InvocationAuthenticationInput {
16
14
  readonly credential: string;
17
15
  readonly via: invocation.Via;
18
- readonly publication: publication.Publication;
16
+ readonly domain: Domain;
17
+ readonly context: InvocationContext;
18
+ }
19
+ export interface InvocationSelfInput {
20
+ readonly via: invocation.Via;
19
21
  readonly domain: Domain;
20
22
  readonly context: InvocationContext;
21
23
  }
22
24
  /** Authenticated capabilities before the SDK admits and derives application caller context. */
23
25
  export interface AuthenticatedInvocation {
24
- readonly caller: Omit<AuthenticatedCaller, 'identity'>;
25
- readonly graph: Readonly<Record<'caller' | 'self' | 'union', BoundClientSession>>;
26
+ readonly caller: AuthenticatedCaller;
27
+ readonly graph: Readonly<Record<'caller' | 'self', BoundClientSession>>;
28
+ close(): void;
29
+ }
30
+ /** The Domain's own capabilities, before the SDK admits them for a call without a credential. */
31
+ export interface SelfInvocation {
32
+ readonly graph: Readonly<Record<'self', BoundClientSession>>;
26
33
  close(): void;
27
34
  }
28
35
  export interface InvocationAuthority {
36
+ /**
37
+ * The source Kernel's `Function.admit` of a remote call: resolves to the admitted target, or
38
+ * rejects with the public refusal. A refusal whose reason is `FUNCTION_MISS` (the Kernel no longer
39
+ * places the call on this deployment) is answered as the reserved miss, never as an error.
40
+ */
29
41
  admit(input: InvocationAdmissionInput): Promise<unknown>;
30
42
  authenticate(input: InvocationAuthenticationInput): Promise<AuthenticatedInvocation>;
43
+ /**
44
+ * The Domain's own authority toward the source Kernel, for an admitted call to an `anonymous`
45
+ * callable that carries no credential: its handler acts as the installed Domain, never as a
46
+ * caller.
47
+ */
48
+ self(input: InvocationSelfInput): Promise<SelfInvocation>;
31
49
  }
32
- /** Capture the execution Identity capability and receiver-bind both privileged operations. */
50
+ /** Capture the execution Identity capability and receiver-bind its privileged operations. */
33
51
  export declare function authority(input: InvocationAuthority): InvocationAuthority;
52
+ /**
53
+ * The routed witness of a remote call, already admitted by the Kernel Server against the served
54
+ * snapshot: the exact ReleaseRef of this immutable deployment.
55
+ */
34
56
  export declare function requireVia(request: HandlerRequest): invocation.Via;
@@ -1,17 +1,24 @@
1
1
  import { protocolError } from '../result/index.js';
2
- /** Capture the execution Identity capability and receiver-bind both privileged operations. */
2
+ /** Capture the execution Identity capability and receiver-bind its privileged operations. */
3
3
  export function authority(input) {
4
4
  if (input === null || typeof input !== 'object' || Array.isArray(input))
5
5
  invalid();
6
- if (typeof input.admit !== 'function' || typeof input.authenticate !== 'function') {
6
+ if (typeof input.admit !== 'function' ||
7
+ typeof input.authenticate !== 'function' ||
8
+ typeof input.self !== 'function') {
7
9
  invalid();
8
10
  }
9
11
  const receiver = Object.freeze({ ...input });
10
12
  return Object.freeze({
11
13
  admit: receiver.admit.bind(receiver),
12
14
  authenticate: receiver.authenticate.bind(receiver),
15
+ self: receiver.self.bind(receiver),
13
16
  });
14
17
  }
18
+ /**
19
+ * The routed witness of a remote call, already admitted by the Kernel Server against the served
20
+ * snapshot: the exact ReleaseRef of this immutable deployment.
21
+ */
15
22
  export function requireVia(request) {
16
23
  if (request.via === undefined) {
17
24
  throw protocolError('VALIDATION_ERROR', 'Remote invocation requires Via.');
@@ -1,5 +1,5 @@
1
1
  export { authority, requireVia } from './authority.js';
2
- export type { AuthenticatedInvocation, InvocationAdmissionInput, InvocationAuthenticationInput, InvocationAuthority, } from './authority.js';
3
- export { authentication, type InvocationAuthentication } from './authentication.js';
2
+ export type { AuthenticatedInvocation, InvocationAdmissionInput, InvocationAuthenticationInput, InvocationAuthority, InvocationSelfInput, SelfInvocation, } from './authority.js';
3
+ export { authentication, type AnonymousInvocation, type InvocationAuthentication, type InvocationSessions, } from './authentication.js';
4
4
  export { input } from './input.js';
5
5
  export { target, type InvocationTarget } from './target.js';
@@ -1,4 +1,4 @@
1
1
  export { authority, requireVia } from './authority.js';
2
- export { authentication } from './authentication.js';
2
+ export { authentication, } from './authentication.js';
3
3
  export { input } from './input.js';
4
4
  export { target } from './target.js';
@@ -1,2 +1,2 @@
1
- import type { ResolvedCallable } from '../../../application/action/index.js';
2
- export declare function input(callable: ResolvedCallable, value: unknown): void;
1
+ import type { ResolvedCallable, ActionBinaryInput } from '../../../application/action/index.js';
2
+ export declare function input(callable: ResolvedCallable, value: unknown, binary?: ActionBinaryInput): void;
@@ -1,4 +1,18 @@
1
- import { validateInput } from '../result/index.js';
2
- export function input(callable, value) {
1
+ import { isBinaryInput } from '@astrale-os/kernel-dsl/v1/language';
2
+ import { validateInput, protocolError } from '../result/index.js';
3
+ export function input(callable, value, binary) {
4
+ if (isBinaryInput(callable.input)) {
5
+ if (binary === undefined) {
6
+ throw protocolError('VALIDATION_ERROR', 'Binary Function request body is required.');
7
+ }
8
+ if (!Number.isSafeInteger(binary.length) ||
9
+ binary.length < 0 ||
10
+ binary.length > callable.input.maximumBytes) {
11
+ throw protocolError('LIMIT_EXCEEDED', 'Binary Function request body exceeds its limit.');
12
+ }
13
+ }
14
+ else if (binary !== undefined) {
15
+ throw protocolError('VALIDATION_ERROR', 'Callable does not accept a binary request body.');
16
+ }
3
17
  validateInput(callable, value);
4
18
  }
@@ -1,5 +1,7 @@
1
1
  import type { HandlerDependencies } from '../../../application/dependency/index.js';
2
2
  import type { BoundClientSession } from '../../../platform/client/session/index.js';
3
3
  import type { Domain } from '../../../platform/schema/index.js';
4
+ import type { InvocationSessions } from '../admission/index.js';
4
5
  /** Bind each explicit authority to its admitted session; metadata remains inert. */
5
- export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self' | 'union', BoundClientSession>>): HandlerDependencies<D>;
6
+ export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self', BoundClientSession>>): HandlerDependencies<D>;
7
+ export declare function bindDependencies<D extends Domain>(domain: D, sessions: InvocationSessions): HandlerDependencies<D> | HandlerDependencies<D, 'self'>;
@@ -1,17 +1,16 @@
1
1
  import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { isBinaryInput } from '@astrale-os/kernel-dsl/v1/language';
2
3
  import { reference } from '../../../platform/client/session/index.js';
3
4
  import { NodeId } from '../../../platform/graph/node/index.js';
4
5
  import { Path } from '../../../platform/graph/path/index.js';
5
- /** Bind each explicit authority to its admitted session; metadata remains inert. */
6
6
  export function bindDependencies(domain, sessions) {
7
7
  const dependencies = Object.create(null);
8
8
  for (const [alias, dependency] of Object.entries(domain.dependencies)) {
9
9
  if (dependency.origin === 'kernel.astrale.ai')
10
10
  continue;
11
11
  dependencies[alias] = Object.freeze({
12
- caller: bindDependency(dependency, sessions.caller),
12
+ ...('caller' in sessions ? { caller: bindDependency(dependency, sessions.caller) } : {}),
13
13
  self: bindDependency(dependency, sessions.self),
14
- union: bindDependency(dependency, sessions.union),
15
14
  });
16
15
  }
17
16
  return Object.freeze(dependencies);
@@ -20,19 +19,14 @@ function bindDependency(dependency, session) {
20
19
  const invoke = session.invoke.bind(session);
21
20
  return Object.freeze({
22
21
  async invoke(select, ...args) {
23
- if (typeof select !== 'function')
24
- invalid();
25
- const selected = select(dependency);
26
- if (selected === null ||
27
- typeof selected !== 'object' ||
28
- !('key' in selected) ||
29
- typeof selected.key !== 'string')
30
- invalid();
31
- const callable = dependency.callable(selected.key);
32
- if (callable !== selected || Key.origin(callable.key) !== dependency.origin)
33
- invalid();
34
- if ('owner' in callable && (!callable.executable || !ownMethod(dependency, callable)))
35
- invalid();
22
+ const callable = selectedCallable(dependency, select);
23
+ if (isBinaryInput(callable.input)) {
24
+ if ('owner' in callable || args.length !== 2)
25
+ invalid();
26
+ // Runtime selection is wider than the authored Function; mode was checked above.
27
+ const binaryReference = reference(dependency, callable);
28
+ return invoke(binaryReference, args[0], binaryOptions(args[1]));
29
+ }
36
30
  if ('owner' in callable && !callable.static) {
37
31
  if (args.length < 2 || args.length > 3 || typeof args[0] !== 'string')
38
32
  invalid();
@@ -45,6 +39,22 @@ function bindDependency(dependency, session) {
45
39
  },
46
40
  });
47
41
  }
42
+ function selectedCallable(domain, select) {
43
+ if (typeof select !== 'function')
44
+ invalid();
45
+ const selected = select(domain);
46
+ if (selected === null ||
47
+ typeof selected !== 'object' ||
48
+ !('key' in selected) ||
49
+ typeof selected.key !== 'string')
50
+ invalid();
51
+ const callable = domain.callable(selected.key);
52
+ if (callable !== selected || Key.origin(callable.key) !== domain.origin)
53
+ invalid();
54
+ if ('owner' in callable && (!callable.executable || !ownMethod(domain, callable)))
55
+ invalid();
56
+ return callable;
57
+ }
48
58
  function ownMethod(domain, callable) {
49
59
  const owner = Object.values(domain.classes).find((value) => value === callable.owner);
50
60
  if (owner === undefined)
@@ -63,6 +73,16 @@ function options(value) {
63
73
  // Canonical ClientSession admits option values and clamps them to the parent lifetime.
64
74
  return value;
65
75
  }
76
+ function binaryOptions(value) {
77
+ if (value === null ||
78
+ typeof value !== 'object' ||
79
+ Array.isArray(value) ||
80
+ !Object.hasOwn(value, 'body') ||
81
+ !(value.body instanceof Blob) ||
82
+ Reflect.ownKeys(value).some((key) => key !== 'body' && key !== 'timeoutMs'))
83
+ invalid();
84
+ return value;
85
+ }
66
86
  function invalid() {
67
87
  throw new TypeError('Dependency invocation requires one owned executable callable, its input, and valid instance/options.');
68
88
  }
@@ -1,5 +1,5 @@
1
1
  import type { HandlerRequest } from '@astrale-os/kernel-server';
2
- import type { ActionExecution, Caller, DomainGraphExecutors, DomainKernelSessions } from '../../../application/action/index.js';
2
+ import type { ActionExecution, ActionBinaryInput, Caller, DomainGraphExecutors, DomainKernelSessions } from '../../../application/action/index.js';
3
3
  import type { HandlerDependencies } from '../../../application/dependency/index.js';
4
4
  import type { MutationExecutor } from '../../../application/mutation/index.js';
5
5
  import type { QueryExecutor } from '../../../application/query/index.js';
@@ -10,12 +10,13 @@ import type { InvocationAuthentication } from '../admission/index.js';
10
10
  export interface DispatchContext {
11
11
  readonly domain: Domain;
12
12
  readonly input: unknown;
13
+ readonly body?: ActionBinaryInput;
13
14
  readonly caller: Caller;
14
- readonly dependencies: HandlerDependencies<Domain> | null;
15
- readonly kernel: DomainKernelSessions | null;
16
- readonly graph: DomainGraphExecutors | null;
17
- readonly query?: QueryExecutor;
18
- readonly mutate?: MutationExecutor;
15
+ readonly dependencies: HandlerDependencies<Domain> | HandlerDependencies<Domain, 'self'>;
16
+ readonly kernel: DomainKernelSessions | DomainKernelSessions<'self'>;
17
+ readonly graph: DomainGraphExecutors | DomainGraphExecutors<Domain, 'self'>;
18
+ readonly query: QueryExecutor;
19
+ readonly mutate: MutationExecutor;
19
20
  readonly integrations: Readonly<Record<string, unknown>>;
20
21
  readonly execution: ActionExecution;
21
22
  readonly self?: NodeId;
@@ -3,7 +3,8 @@ import { bindQuery } from '../../../application/query/execution/executor.js';
3
3
  import { bindDependencies } from '../dependency/index.js';
4
4
  import { clients } from '../integration/index.js';
5
5
  export function context(request, runtime, authentication, self) {
6
- const graph = authentication.graph === null ? null : bindGraph(authentication.graph, runtime.loaded.domain);
6
+ const sessions = authentication.graph;
7
+ const graph = bindGraph(sessions, runtime.loaded.domain);
7
8
  const execution = Object.freeze({
8
9
  signal: request.context.execution.signal,
9
10
  deadline: request.context.execution.deadline,
@@ -17,48 +18,33 @@ export function context(request, runtime, authentication, self) {
17
18
  return Object.freeze({
18
19
  domain: runtime.loaded.domain,
19
20
  input: request.call.input,
21
+ ...(request.context.binary === undefined ? {} : { body: request.context.binary }),
20
22
  caller: authentication.caller,
21
- kernel: authentication.graph === null
22
- ? null
23
- : Object.freeze({
24
- ...authentication.graph.self,
25
- ...authentication.graph,
26
- }),
27
- dependencies: authentication.graph === null
28
- ? null
29
- : bindDependencies(runtime.loaded.domain, authentication.graph),
23
+ kernel: Object.freeze({ ...sessions.self, ...sessions }),
24
+ dependencies: bindDependencies(runtime.loaded.domain, sessions),
30
25
  graph,
31
- ...(graph === null
32
- ? {}
33
- : {
34
- query: graph.self.query,
35
- mutate: graph.self.mutate,
36
- }),
37
- integrations: clients(runtime, request.context, authentication.graph === null
38
- ? null
39
- : {
40
- caller: authentication.graph.caller,
41
- self: authentication.graph.self,
42
- ...(authentication.caller.authentication.expiresAt === undefined
43
- ? {}
44
- : {
45
- expiresAt: authentication.caller.authentication.expiresAt,
46
- }),
47
- }),
26
+ query: graph.self.query,
27
+ mutate: graph.self.mutate,
28
+ integrations: clients(runtime, request.context, {
29
+ ...sessions,
30
+ ...(authentication.caller.kind !== 'authenticated' ||
31
+ authentication.caller.authentication.expiresAt === undefined
32
+ ? {}
33
+ : { expiresAt: authentication.caller.authentication.expiresAt }),
34
+ }),
48
35
  execution,
49
36
  ...(self === undefined ? {} : { self }),
50
37
  });
51
38
  }
52
- function bindGraph(clients, domain) {
39
+ function bindGraph(sessions, domain) {
53
40
  const bind = (client) => Object.freeze({
54
41
  query: bindQuery(client, domain),
55
42
  mutate: bindMutation(client, domain),
56
43
  });
57
- const self = bind(clients.self);
44
+ const self = bind(sessions.self);
58
45
  return Object.freeze({
59
46
  ...self,
60
- caller: bind(clients.caller),
47
+ ...('caller' in sessions ? { caller: bind(sessions.caller) } : {}),
61
48
  self,
62
- union: bind(clients.union),
63
49
  });
64
50
  }
@@ -1,12 +1,8 @@
1
1
  import { declaredErrorFactory, declaredErrorOf } from '../../../application/error/index.js';
2
2
  import { protocolError } from '../result/index.js';
3
3
  export async function workflow(selected, context, runner) {
4
- if (context.caller.kind !== 'authenticated' || context.kernel === null) {
5
- throw protocolError('AUTH_MISSING', 'Workflow authentication is required.');
6
- }
7
4
  const complete = Object.freeze({
8
5
  ...context,
9
- caller: context.caller,
10
6
  error: declaredErrorFactory(selected.definition),
11
7
  });
12
8
  try {
@@ -1,5 +1,5 @@
1
1
  export { createHandler, type HandlerInput } from './handler.js';
2
2
  export { invoke, type InvocationInput } from './invocation.js';
3
3
  export type * from './admission/index.js';
4
- export { InvocationDefect, InvocationError } from './result/index.js';
5
- export type { InvocationDefectCode, InvocationErrorCode } from './result/index.js';
4
+ export { InvocationDefect } from './result/index.js';
5
+ export type { InvocationDefectCode } from './result/index.js';
@@ -1,3 +1,3 @@
1
1
  export { createHandler } from './handler.js';
2
2
  export { invoke } from './invocation.js';
3
- export { InvocationDefect, InvocationError } from './result/index.js';
3
+ export { InvocationDefect } from './result/index.js';
@@ -2,7 +2,8 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
2
2
  import type { IntegrationInvocationOwner } from '../../../application/integration/index.js';
3
3
  import type { BoundClientSession } from '../../../platform/client/session/index.js';
4
4
  export interface IntegrationInvocationSessions {
5
- readonly caller: BoundClientSession;
5
+ /** Absent when the call carried no credential: there is no caller to invoke for. */
6
+ readonly caller?: BoundClientSession;
6
7
  readonly self: BoundClientSession;
7
8
  /** Verified incoming carrier expiry, in Unix seconds. */
8
9
  readonly expiresAt?: number;
@@ -3,7 +3,7 @@ import { bindIntegrationAuthentication } from './authentication.js';
3
3
  /** One invocation-owned logical Integration call sequence. */
4
4
  export function calls(context, sessions = null) {
5
5
  const prefix = context.idempotencyKey ?? JSON.stringify([context.invocation.source, context.invocation.id]);
6
- const invoke = sessions?.caller.invoke.bind(sessions.caller);
6
+ const invoke = sessions?.caller?.invoke.bind(sessions.caller);
7
7
  const auth = sessions === null
8
8
  ? undefined
9
9
  : bindIntegrationAuthentication(context, sessions.self, sessions.expiresAt);
@@ -2,4 +2,4 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
2
2
  import type { IntegrationClients, Integrations } from '../../../application/integration/index.js';
3
3
  import type { InitializedRuntime } from '../../runtime/index.js';
4
4
  import type { IntegrationInvocationSessions } from './call.js';
5
- export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions | null): IntegrationClients<Integrations>;
5
+ export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions): IntegrationClients<Integrations>;
@@ -1,36 +1,42 @@
1
- import * as publication from '@astrale-os/kernel-protocol/publication';
1
+ import * as errors from '@astrale-os/kernel-protocol/errors';
2
+ import * as release from '@astrale-os/kernel-protocol/release';
2
3
  import { authentication, input, requireVia, target } from './admission/index.js';
3
4
  import { action, context, select, workflow } from './dispatch/index.js';
4
5
  import { active, settle } from './lifecycle/index.js';
5
6
  import { project, protocolError } from './result/index.js';
7
+ /** The reserved answer of a deployment that does not serve the call: its caller re-routes. */
8
+ const MISS = Object.freeze({ kind: 'miss' });
9
+ const FUNCTION_MISS = 'FUNCTION_MISS';
6
10
  export async function invoke(request, inputConfig) {
7
11
  active(request.context);
8
- const release = inputConfig.runtime.loaded.release;
9
- const snapshot = request.publication;
10
- if (snapshot === undefined ||
11
- !publication.matchesReference(snapshot.publication, publication.reference(release.publication))) {
12
- throw protocolError('CONFLICT', 'Invocation Publication differs from the running Release.');
12
+ if (!pinsRunningRelease(request, inputConfig.runtime.loaded.release)) {
13
+ throw protocolError('CONFLICT', 'Invocation release differs from the running Release.');
13
14
  }
14
15
  if (request.credential !== undefined && typeof request.credential !== 'string') {
15
16
  throw protocolError('AUTH_INVALID', 'Credential is invalid.');
16
17
  }
17
- const via = requireVia(request);
18
- const selectedTarget = target(await inputConfig.authority.admit({
18
+ const admitted = await admit(inputConfig.authority, {
19
19
  call: request.call,
20
20
  ...(request.credential === undefined ? {} : { credential: request.credential }),
21
- via,
22
- publication: release.publication,
21
+ via: requireVia(request),
23
22
  domain: inputConfig.runtime.loaded.domain,
24
23
  context: request.context,
25
- }));
26
- const selected = select(inputConfig.runtime.loaded.registry, selectedTarget);
24
+ });
25
+ if (admitted === undefined)
26
+ return MISS;
27
+ const selected = select(inputConfig.runtime.loaded.registry, admitted);
27
28
  if (selected === undefined)
28
- return Object.freeze({ kind: 'miss' });
29
- input(selected.implementation.callable, request.call.input);
30
- const admittedAuthentication = await authentication(selected.implementation.callable, request, release, inputConfig.runtime.loaded.domain, inputConfig.authority);
29
+ return MISS;
30
+ if (selected.implementation.kind === 'workflow' && selected.implementation.durable) {
31
+ // The Kernel records a durable call as an Execution and runs it on the engine; running it
32
+ // inline here would silently drop durability.
33
+ throw protocolError('UNSUPPORTED', 'A durable Workflow runs only as a Kernel Execution.');
34
+ }
35
+ input(selected.implementation.callable, request.call.input, request.context.binary);
36
+ const admittedAuthentication = await authentication(selected.implementation.callable, request, inputConfig.runtime.loaded.domain, inputConfig.authority);
31
37
  const close = once(admittedAuthentication.close);
32
- active(request.context);
33
38
  try {
39
+ active(request.context);
34
40
  const dispatchContext = context(request, inputConfig.runtime, admittedAuthentication, selected.self);
35
41
  const output = selected.implementation.kind === 'action'
36
42
  ? await action(selected.implementation, dispatchContext)
@@ -42,6 +48,33 @@ export async function invoke(request, inputConfig) {
42
48
  throw cause;
43
49
  }
44
50
  }
51
+ /**
52
+ * The source Kernel's `Function.admit` refuses `FUNCTION_MISS` when it no longer places the call on
53
+ * this deployment, as for a client whose learned route still names a deployment replaced by a
54
+ * consented install. That refusal is answered as the reserved miss, never as a public error, so
55
+ * the client re-routes through its source Kernel (AM-85). Every other refusal is unchanged.
56
+ */
57
+ async function admit(authority, admission) {
58
+ let admitted;
59
+ try {
60
+ admitted = await authority.admit(admission);
61
+ }
62
+ catch (cause) {
63
+ if (refusedAsMiss(cause))
64
+ return undefined;
65
+ throw cause;
66
+ }
67
+ return target(admitted);
68
+ }
69
+ function refusedAsMiss(cause) {
70
+ return (cause instanceof errors.ProtocolError &&
71
+ errors.reasonOf(cause.payload.data)?.code === FUNCTION_MISS);
72
+ }
73
+ /** Execution answers only for the exact release pinned by the Kernel Server snapshot. */
74
+ function pinsRunningRelease(request, running) {
75
+ return (request.release !== undefined &&
76
+ release.matchesReference(request.release.release, release.reference(running.document)));
77
+ }
45
78
  function once(operation) {
46
79
  let called = false;
47
80
  return () => {