@astrale-os/sdk 0.6.0-beta.6 → 0.6.0-beta.61

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 (717) hide show
  1. package/README.md +220 -66
  2. package/dist/application/action/action.d.ts +6 -0
  3. package/dist/application/action/authoring.d.ts +3 -1
  4. package/dist/application/action/authoring.js +1 -0
  5. package/dist/application/action/context.d.ts +95 -34
  6. package/dist/application/action/define.d.ts +3 -3
  7. package/dist/application/action/index.d.ts +3 -1
  8. package/dist/application/action/index.js +1 -0
  9. package/dist/application/define.d.ts +8 -6
  10. package/dist/application/define.js +28 -14
  11. package/dist/application/dependency/index.d.ts +1 -1
  12. package/dist/application/dependency/invoker.d.ts +21 -10
  13. package/dist/application/domain.d.ts +30 -0
  14. package/dist/application/error/error.d.ts +16 -1
  15. package/dist/application/error/error.js +40 -6
  16. package/dist/application/error/index.d.ts +1 -1
  17. package/dist/application/error/index.js +1 -1
  18. package/dist/application/file/binary.d.ts +11 -0
  19. package/dist/application/file/binary.js +45 -0
  20. package/dist/application/file/file.d.ts +77 -0
  21. package/dist/application/file/file.js +111 -0
  22. package/dist/application/file/index.d.ts +4 -0
  23. package/dist/application/file/index.js +2 -0
  24. package/dist/application/file/input.d.ts +13 -0
  25. package/dist/application/file/input.js +57 -0
  26. package/dist/application/index.d.ts +6 -5
  27. package/dist/application/index.js +1 -1
  28. package/dist/application/integration/define.d.ts +8 -1
  29. package/dist/application/integration/index.d.ts +2 -2
  30. package/dist/application/integration/integration.d.ts +13 -1
  31. package/dist/application/integration/operation.d.ts +16 -3
  32. package/dist/application/mutation/authoring/builder.d.ts +81 -33
  33. package/dist/application/mutation/authoring/builder.js +100 -30
  34. package/dist/application/mutation/authoring/guard.d.ts +37 -0
  35. package/dist/application/mutation/authoring/guard.js +150 -0
  36. package/dist/application/mutation/authoring/index.d.ts +5 -2
  37. package/dist/application/mutation/authoring/index.js +2 -1
  38. package/dist/application/mutation/authoring/names.d.ts +19 -0
  39. package/dist/application/mutation/authoring/names.js +83 -0
  40. package/dist/application/mutation/authoring/properties.d.ts +17 -4
  41. package/dist/application/mutation/authoring/properties.js +38 -2
  42. package/dist/application/mutation/authoring/transition.d.ts +3 -2
  43. package/dist/application/mutation/authoring/transition.js +4 -1
  44. package/dist/application/mutation/define.d.ts +24 -10
  45. package/dist/application/mutation/define.js +49 -53
  46. package/dist/application/mutation/execution/execute.d.ts +2 -2
  47. package/dist/application/mutation/execution/execute.js +78 -7
  48. package/dist/application/mutation/execution/executor.d.ts +4 -1
  49. package/dist/application/mutation/execution/executor.js +6 -1
  50. package/dist/application/mutation/failure.d.ts +17 -1
  51. package/dist/application/mutation/failure.js +40 -19
  52. package/dist/application/mutation/index.d.ts +9 -5
  53. package/dist/application/mutation/index.js +5 -2
  54. package/dist/application/mutation/legacy/v6/builder.d.ts +84 -0
  55. package/dist/application/mutation/legacy/v6/define.d.ts +18 -0
  56. package/dist/application/mutation/legacy/v6/define.js +56 -0
  57. package/dist/application/mutation/legacy/v6/mutation.d.ts +28 -0
  58. package/dist/application/mutation/{authoring → legacy/v6}/precondition.d.ts +4 -0
  59. package/dist/application/mutation/mutation.d.ts +47 -19
  60. package/dist/application/query/answer/answer.d.ts +117 -0
  61. package/dist/application/query/answer/conformance.d.ts +4 -0
  62. package/dist/application/query/answer/conformance.js +27 -0
  63. package/dist/application/query/answer/facts.d.ts +17 -0
  64. package/dist/application/query/answer/facts.js +57 -0
  65. package/dist/application/query/composite/builder.d.ts +1 -1
  66. package/dist/application/query/composite/builder.js +2 -2
  67. package/dist/application/query/composite/plan.d.ts +1 -5
  68. package/dist/application/query/composite/plan.js +1 -3
  69. package/dist/application/query/composite/query.d.ts +1 -2
  70. package/dist/application/query/define.d.ts +3 -34
  71. package/dist/application/query/define.js +5 -131
  72. package/dist/application/query/defined/define.d.ts +45 -0
  73. package/dist/application/query/defined/define.js +96 -0
  74. package/dist/application/query/defined/query.d.ts +139 -0
  75. package/dist/application/query/definition.d.ts +12 -0
  76. package/dist/application/query/definition.js +47 -0
  77. package/dist/application/query/execution/bounds.d.ts +22 -0
  78. package/dist/application/query/execution/bounds.js +88 -0
  79. package/dist/application/query/execution/client.d.ts +21 -0
  80. package/dist/application/query/execution/crossings.d.ts +30 -0
  81. package/dist/application/query/execution/crossings.js +232 -0
  82. package/dist/application/query/execution/error.d.ts +71 -0
  83. package/dist/application/query/execution/error.js +50 -0
  84. package/dist/application/query/execution/execute.d.ts +4 -10
  85. package/dist/application/query/execution/execute.js +3 -45
  86. package/dist/application/query/execution/executor.d.ts +2 -2
  87. package/dist/application/query/execution/legacy/declared-classes.d.ts +10 -0
  88. package/dist/application/query/execution/legacy/declared-classes.js +9 -0
  89. package/dist/application/query/execution/refusal.d.ts +37 -0
  90. package/dist/application/query/execution/refusal.js +80 -0
  91. package/dist/application/query/execution/rows.d.ts +42 -0
  92. package/dist/application/query/execution/rows.js +326 -0
  93. package/dist/application/query/execution/run.d.ts +85 -0
  94. package/dist/application/query/execution/run.js +372 -0
  95. package/dist/application/query/execution/split.d.ts +24 -0
  96. package/dist/application/query/execution/split.js +190 -0
  97. package/dist/application/query/failure.d.ts +8 -0
  98. package/dist/application/query/failure.js +8 -0
  99. package/dist/application/query/handles/build.d.ts +10 -0
  100. package/dist/application/query/handles/build.js +53 -0
  101. package/dist/application/query/handles/conditions.d.ts +94 -0
  102. package/dist/application/query/handles/domain.d.ts +157 -0
  103. package/dist/application/query/handles/handles.d.ts +285 -0
  104. package/dist/application/query/handles/handles.js +1 -0
  105. package/dist/application/query/handles/model.d.ts +106 -0
  106. package/dist/application/query/handles/model.js +261 -0
  107. package/dist/application/query/handles/plan.d.ts +100 -0
  108. package/dist/application/query/handles/plan.js +37 -0
  109. package/dist/application/query/handles/reads.d.ts +106 -0
  110. package/dist/application/query/handles/reads.js +978 -0
  111. package/dist/application/query/handles/relations.d.ts +106 -0
  112. package/dist/application/query/handles/relations.js +1 -0
  113. package/dist/application/query/handles/rows.d.ts +94 -0
  114. package/dist/application/query/handles/rows.js +4 -0
  115. package/dist/application/query/handles/terms.d.ts +103 -0
  116. package/dist/application/query/handles/terms.js +282 -0
  117. package/dist/application/query/index.d.ts +14 -8
  118. package/dist/application/query/index.js +10 -5
  119. package/dist/application/query/language/index.d.ts +2 -0
  120. package/dist/application/query/language/index.js +2 -0
  121. package/dist/application/query/language/query.d.ts +323 -0
  122. package/dist/application/query/language/query.js +2 -0
  123. package/dist/application/query/{collection → legacy/v6/collection}/identity.d.ts +2 -2
  124. package/dist/application/query/{collection → legacy/v6/collection}/metadata.d.ts +1 -1
  125. package/dist/application/query/{collection → legacy/v6/collection}/union.d.ts +4 -4
  126. package/dist/application/query/{collection → legacy/v6/collection}/union.js +15 -8
  127. package/dist/application/query/legacy/v6/conformance.d.ts +15 -0
  128. package/dist/application/query/legacy/v6/conformance.js +46 -0
  129. package/dist/application/query/legacy/v6/define.d.ts +37 -0
  130. package/dist/application/query/legacy/v6/define.js +90 -0
  131. package/dist/application/query/legacy/v6/execution/execute.d.ts +18 -0
  132. package/dist/application/query/legacy/v6/execution/execute.js +50 -0
  133. package/dist/application/query/legacy/v6/index.d.ts +7 -0
  134. package/dist/application/query/legacy/v6/index.js +3 -0
  135. package/dist/application/query/legacy/v6/kernel.d.ts +6 -0
  136. package/dist/application/query/legacy/v6/kernel.js +5 -0
  137. package/dist/application/query/{single → legacy/v6/single}/pagination.js +1 -1
  138. package/dist/application/query/{single → legacy/v6/single}/query.d.ts +2 -14
  139. package/dist/application/query/legacy/v6/single/query.js +1 -0
  140. package/dist/application/query/query.d.ts +19 -4
  141. package/dist/application/requirements/canonical.d.ts +7 -0
  142. package/dist/application/requirements/canonical.js +16 -0
  143. package/dist/application/requirements/classes.d.ts +9 -7
  144. package/dist/application/requirements/classes.js +35 -42
  145. package/dist/application/requirements/functions.d.ts +3 -1
  146. package/dist/application/requirements/functions.js +12 -27
  147. package/dist/application/requirements/index.d.ts +34 -16
  148. package/dist/application/requirements/index.js +17 -20
  149. package/dist/application/requirements/legacy/authority.d.ts +21 -0
  150. package/dist/application/requirements/{authority.js → legacy/authority.js} +5 -2
  151. package/dist/application/requirements/legacy/classes.d.ts +22 -0
  152. package/dist/application/requirements/legacy/classes.js +24 -0
  153. package/dist/application/requirements/legacy/core.d.ts +30 -0
  154. package/dist/application/requirements/{core.js → legacy/core.js} +15 -13
  155. package/dist/application/requirements/legacy/functions.d.ts +7 -0
  156. package/dist/application/requirements/legacy/functions.js +15 -0
  157. package/dist/application/requirements/legacy/index.d.ts +43 -0
  158. package/dist/application/requirements/legacy/index.js +1 -0
  159. package/dist/application/requirements/legacy/requirements.d.ts +31 -0
  160. package/dist/application/requirements/legacy/requirements.js +31 -0
  161. package/dist/application/requirements/requirement.d.ts +30 -19
  162. package/dist/application/requirements/roles.d.ts +17 -0
  163. package/dist/application/requirements/roles.js +62 -0
  164. package/dist/application/requirements/scopes.d.ts +16 -0
  165. package/dist/application/requirements/scopes.js +34 -0
  166. package/dist/application/routes/admission.d.ts +3 -3
  167. package/dist/application/routes/admission.js +3 -3
  168. package/dist/application/routes/index.d.ts +3 -2
  169. package/dist/application/routes/route.d.ts +3 -3
  170. package/dist/application/runtime/actions.js +3 -0
  171. package/dist/application/runtime/declarations.d.ts +6 -6
  172. package/dist/application/runtime/define.d.ts +5 -5
  173. package/dist/application/runtime/runtime.js +12 -0
  174. package/dist/application/runtime/workflows.d.ts +3 -1
  175. package/dist/application/runtime/workflows.js +3 -4
  176. package/dist/application/view/define.js +4 -6
  177. package/dist/application/view/frontend.d.ts +2 -2
  178. package/dist/application/view/index.d.ts +1 -1
  179. package/dist/application/view/route.d.ts +0 -14
  180. package/dist/application/view/route.js +1 -64
  181. package/dist/application/workflow/authoring.d.ts +3 -2
  182. package/dist/application/workflow/context.d.ts +8 -2
  183. package/dist/application/workflow/define.d.ts +4 -4
  184. package/dist/application/workflow/define.js +14 -9
  185. package/dist/application/workflow/durable.d.ts +211 -0
  186. package/dist/application/workflow/durable.js +1 -0
  187. package/dist/application/workflow/index.d.ts +3 -2
  188. package/dist/application/workflow/runner/inline.js +1 -0
  189. package/dist/application/workflow/runner/runner.d.ts +2 -2
  190. package/dist/application/workflow/workflow.d.ts +5 -3
  191. package/dist/deployment/adapter/adapter.d.ts +55 -13
  192. package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
  193. package/dist/deployment/adapter/bundle/bundle.js +1 -0
  194. package/dist/deployment/adapter/bundle/file.d.ts +10 -0
  195. package/dist/deployment/adapter/bundle/file.js +1 -0
  196. package/dist/deployment/adapter/bundle/index.d.ts +2 -0
  197. package/dist/deployment/adapter/bundle/index.js +1 -0
  198. package/dist/deployment/adapter/define.d.ts +4 -3
  199. package/dist/deployment/adapter/define.js +107 -23
  200. package/dist/deployment/adapter/index.d.ts +4 -3
  201. package/dist/deployment/adapter/index.js +1 -0
  202. package/dist/deployment/adapter/release/command.d.ts +33 -0
  203. package/dist/deployment/adapter/release/command.js +1 -0
  204. package/dist/deployment/adapter/release/context.d.ts +94 -0
  205. package/dist/deployment/adapter/release/context.js +1 -0
  206. package/dist/deployment/adapter/release/index.d.ts +4 -0
  207. package/dist/deployment/adapter/release/index.js +1 -0
  208. package/dist/deployment/adapter/release/list.d.ts +53 -0
  209. package/dist/deployment/adapter/release/list.js +1 -0
  210. package/dist/deployment/adapter/release/refusal.d.ts +10 -0
  211. package/dist/deployment/adapter/release/refusal.js +14 -0
  212. package/dist/deployment/adapter/release/result.d.ts +56 -0
  213. package/dist/deployment/adapter/release/result.js +1 -0
  214. package/dist/deployment/address/configuration.d.ts +96 -0
  215. package/dist/deployment/address/configuration.js +274 -0
  216. package/dist/deployment/address/fingerprint.d.ts +5 -0
  217. package/dist/deployment/address/fingerprint.js +27 -0
  218. package/dist/deployment/address/index.d.ts +5 -0
  219. package/dist/deployment/address/index.js +4 -0
  220. package/dist/deployment/address/label.d.ts +42 -0
  221. package/dist/deployment/address/label.js +80 -0
  222. package/dist/deployment/address/line.d.ts +29 -0
  223. package/dist/deployment/address/line.js +53 -0
  224. package/dist/deployment/address/record.d.ts +73 -0
  225. package/dist/deployment/address/record.js +138 -0
  226. package/dist/deployment/address/summary.d.ts +30 -0
  227. package/dist/deployment/address/summary.js +1 -0
  228. package/dist/deployment/address/vectors.d.ts +60 -0
  229. package/dist/deployment/address/vectors.js +517 -0
  230. package/dist/deployment/authoring.d.ts +0 -2
  231. package/dist/deployment/authoring.js +0 -1
  232. package/dist/deployment/build/build.d.ts +13 -2
  233. package/dist/deployment/build/compile.d.ts +4 -4
  234. package/dist/deployment/build/compile.js +31 -81
  235. package/dist/deployment/build/frontend/compilation.d.ts +2 -4
  236. package/dist/deployment/build/frontend/compilation.js +0 -5
  237. package/dist/deployment/build/frontend/digest.js +1 -5
  238. package/dist/deployment/build/index.d.ts +1 -0
  239. package/dist/deployment/build/index.js +1 -0
  240. package/dist/deployment/build/legacy/requirements.d.ts +11 -0
  241. package/dist/deployment/build/legacy/requirements.js +79 -0
  242. package/dist/deployment/build/manifest.d.ts +59 -0
  243. package/dist/deployment/build/manifest.js +118 -0
  244. package/dist/deployment/build/material.d.ts +2 -2
  245. package/dist/deployment/build/material.js +28 -13
  246. package/dist/deployment/build/schema.d.ts +2 -2
  247. package/dist/deployment/deployment.d.ts +3 -2
  248. package/dist/deployment/environment.d.ts +6 -0
  249. package/dist/deployment/environment.js +6 -0
  250. package/dist/deployment/index.d.ts +4 -6
  251. package/dist/deployment/index.js +1 -2
  252. package/dist/deployment/release/addressing.d.ts +6 -5
  253. package/dist/deployment/release/addressing.js +2 -3
  254. package/dist/deployment/release/assemble.d.ts +6 -3
  255. package/dist/deployment/release/assemble.js +12 -10
  256. package/dist/deployment/release/release.d.ts +16 -5
  257. package/dist/deployment/release/seal.d.ts +14 -0
  258. package/dist/deployment/release/seal.js +22 -0
  259. package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
  260. package/dist/deployment/release/{publication → served}/callables.js +2 -2
  261. package/dist/deployment/release/served/index.d.ts +11 -0
  262. package/dist/deployment/release/served/index.js +26 -0
  263. package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
  264. package/dist/deployment/release/{publication → served}/views.js +0 -1
  265. package/dist/deployment/runtime/admission.d.ts +2 -2
  266. package/dist/deployment/runtime/admission.js +5 -5
  267. package/dist/deployment/verify/index.d.ts +3 -4
  268. package/dist/deployment/verify/index.js +2 -3
  269. package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
  270. package/dist/deployment/verify/preflight/bundle.js +71 -0
  271. package/dist/deployment/verify/preflight/index.d.ts +1 -12
  272. package/dist/deployment/verify/preflight/index.js +1 -12
  273. package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
  274. package/dist/deployment/verify/readiness/fetch.js +26 -0
  275. package/dist/deployment/verify/readiness/identity.d.ts +3 -6
  276. package/dist/deployment/verify/readiness/identity.js +3 -3
  277. package/dist/deployment/verify/readiness/index.d.ts +15 -8
  278. package/dist/deployment/verify/readiness/index.js +25 -6
  279. package/dist/deployment/verify/readiness/release.d.ts +8 -0
  280. package/dist/deployment/verify/readiness/release.js +22 -0
  281. package/dist/deployment/worker/address.d.ts +26 -0
  282. package/dist/deployment/worker/address.js +43 -0
  283. package/dist/deployment/worker/build.d.ts +60 -0
  284. package/dist/deployment/worker/build.js +172 -0
  285. package/dist/deployment/worker/configuration.d.ts +73 -0
  286. package/dist/deployment/worker/configuration.js +165 -0
  287. package/dist/deployment/worker/content.d.ts +38 -0
  288. package/dist/deployment/worker/content.js +169 -0
  289. package/dist/deployment/worker/index.d.ts +29 -0
  290. package/dist/deployment/worker/index.js +29 -0
  291. package/dist/deployment/worker/limits.d.ts +30 -0
  292. package/dist/deployment/worker/limits.js +30 -0
  293. package/dist/deployment/worker/record.d.ts +29 -0
  294. package/dist/deployment/worker/record.js +69 -0
  295. package/dist/deployment/worker/request.d.ts +118 -0
  296. package/dist/deployment/worker/request.js +280 -0
  297. package/dist/deployment/worker/response.d.ts +101 -0
  298. package/dist/deployment/worker/response.js +207 -0
  299. package/dist/execution/cache/cache.d.ts +17 -0
  300. package/dist/execution/cache/cache.js +11 -0
  301. package/dist/execution/cache/index.d.ts +2 -0
  302. package/dist/execution/cache/index.js +2 -0
  303. package/dist/execution/cache/memory.d.ts +13 -0
  304. package/dist/execution/cache/memory.js +48 -0
  305. package/dist/execution/identity/authentication.d.ts +33 -3
  306. package/dist/execution/identity/authentication.js +95 -36
  307. package/dist/execution/identity/callback.d.ts +20 -20
  308. package/dist/execution/identity/callback.js +34 -26
  309. package/dist/execution/identity/delivery.d.ts +6 -4
  310. package/dist/execution/identity/delivery.js +25 -20
  311. package/dist/execution/identity/exchange.js +11 -1
  312. package/dist/execution/identity/identity.d.ts +17 -3
  313. package/dist/execution/identity/identity.js +12 -4
  314. package/dist/execution/identity/jwks.d.ts +5 -0
  315. package/dist/execution/identity/jwks.js +92 -102
  316. package/dist/execution/index.d.ts +6 -4
  317. package/dist/execution/index.js +4 -2
  318. package/dist/execution/invocation/admission/age.d.ts +57 -0
  319. package/dist/execution/invocation/admission/age.js +208 -0
  320. package/dist/execution/invocation/admission/authentication.d.ts +13 -13
  321. package/dist/execution/invocation/admission/authentication.js +52 -44
  322. package/dist/execution/invocation/admission/authority.d.ts +28 -6
  323. package/dist/execution/invocation/admission/authority.js +9 -2
  324. package/dist/execution/invocation/admission/index.d.ts +4 -3
  325. package/dist/execution/invocation/admission/index.js +3 -2
  326. package/dist/execution/invocation/admission/input.d.ts +2 -2
  327. package/dist/execution/invocation/admission/input.js +16 -2
  328. package/dist/execution/invocation/admission/target.d.ts +11 -0
  329. package/dist/execution/invocation/admission/target.js +22 -3
  330. package/dist/execution/invocation/capabilities/bind.d.ts +14 -0
  331. package/dist/execution/invocation/capabilities/bind.js +74 -0
  332. package/dist/execution/invocation/capabilities/index.d.ts +1 -0
  333. package/dist/execution/invocation/capabilities/index.js +1 -0
  334. package/dist/execution/invocation/dependency/bind.d.ts +3 -1
  335. package/dist/execution/invocation/dependency/bind.js +36 -16
  336. package/dist/execution/invocation/dispatch/action.js +4 -2
  337. package/dist/execution/invocation/dispatch/context.d.ts +8 -7
  338. package/dist/execution/invocation/dispatch/context.js +34 -45
  339. package/dist/execution/invocation/dispatch/workflow.js +4 -6
  340. package/dist/execution/invocation/handler.js +8 -2
  341. package/dist/execution/invocation/index.d.ts +2 -2
  342. package/dist/execution/invocation/index.js +1 -1
  343. package/dist/execution/invocation/integration/authentication.d.ts +3 -3
  344. package/dist/execution/invocation/integration/authentication.js +7 -7
  345. package/dist/execution/invocation/integration/call.d.ts +2 -1
  346. package/dist/execution/invocation/integration/call.js +3 -3
  347. package/dist/execution/invocation/integration/clients.d.ts +1 -1
  348. package/dist/execution/invocation/integration/index.d.ts +1 -0
  349. package/dist/execution/invocation/integration/index.js +1 -0
  350. package/dist/execution/invocation/invocation.d.ts +6 -0
  351. package/dist/execution/invocation/invocation.js +130 -22
  352. package/dist/execution/invocation/lifecycle/active.d.ts +8 -2
  353. package/dist/execution/invocation/lifecycle/active.js +3 -3
  354. package/dist/execution/invocation/lifecycle/index.d.ts +1 -1
  355. package/dist/execution/invocation/result/errors.d.ts +0 -10
  356. package/dist/execution/invocation/result/errors.js +12 -16
  357. package/dist/execution/invocation/result/index.d.ts +3 -2
  358. package/dist/execution/invocation/result/index.js +2 -1
  359. package/dist/execution/invocation/result/project.js +41 -1
  360. package/dist/execution/invocation/result/undeclared.d.ts +7 -0
  361. package/dist/execution/invocation/result/undeclared.js +18 -0
  362. package/dist/execution/node/serve.d.ts +2 -2
  363. package/dist/execution/node/serve.js +1 -1
  364. package/dist/execution/runtime/index.d.ts +1 -0
  365. package/dist/execution/runtime/index.js +1 -0
  366. package/dist/execution/runtime/load.d.ts +3 -3
  367. package/dist/execution/runtime/load.js +3 -2
  368. package/dist/execution/runtime/release.d.ts +17 -0
  369. package/dist/execution/runtime/release.js +7 -0
  370. package/dist/execution/serve.d.ts +18 -4
  371. package/dist/execution/serve.js +10 -0
  372. package/dist/execution/service/create.js +43 -7
  373. package/dist/execution/service/initialization.d.ts +4 -4
  374. package/dist/execution/service/initialization.js +23 -14
  375. package/dist/execution/service/release.d.ts +2 -2
  376. package/dist/execution/service/release.js +3 -2
  377. package/dist/execution/service/service.d.ts +20 -5
  378. package/dist/execution/service/serving/delivery.d.ts +5 -0
  379. package/dist/execution/service/{publication → serving}/delivery.js +4 -1
  380. package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
  381. package/dist/execution/service/serving/installation.d.ts +4 -0
  382. package/dist/execution/service/serving/installation.js +9 -0
  383. package/dist/execution/service/serving/source.d.ts +11 -0
  384. package/dist/execution/service/serving/source.js +15 -0
  385. package/dist/execution/workflows/attempts.d.ts +87 -0
  386. package/dist/execution/workflows/attempts.js +205 -0
  387. package/dist/execution/workflows/discovery.d.ts +14 -0
  388. package/dist/execution/workflows/discovery.js +151 -0
  389. package/dist/execution/workflows/engine.d.ts +83 -0
  390. package/dist/execution/workflows/engine.js +1 -0
  391. package/dist/execution/workflows/envelope.d.ts +12 -0
  392. package/dist/execution/workflows/envelope.js +46 -0
  393. package/dist/execution/workflows/failure.d.ts +56 -0
  394. package/dist/execution/workflows/failure.js +204 -0
  395. package/dist/execution/workflows/index.d.ts +4 -0
  396. package/dist/execution/workflows/index.js +3 -0
  397. package/dist/execution/workflows/integrations.d.ts +13 -0
  398. package/dist/execution/workflows/integrations.js +25 -0
  399. package/dist/execution/workflows/options.d.ts +81 -0
  400. package/dist/execution/workflows/options.js +158 -0
  401. package/dist/execution/workflows/receiver.d.ts +24 -0
  402. package/dist/execution/workflows/receiver.js +99 -0
  403. package/dist/execution/workflows/route.d.ts +12 -0
  404. package/dist/execution/workflows/route.js +35 -0
  405. package/dist/execution/workflows/run.d.ts +23 -0
  406. package/dist/execution/workflows/run.js +369 -0
  407. package/dist/execution/workflows/steps.d.ts +48 -0
  408. package/dist/execution/workflows/steps.js +93 -0
  409. package/dist/index.d.ts +5 -5
  410. package/dist/index.js +2 -2
  411. package/dist/platform/graph/alias.d.ts +1 -5
  412. package/dist/platform/graph/alias.js +1 -5
  413. package/dist/platform/graph/document/index.d.ts +1 -1
  414. package/dist/platform/graph/document/index.js +1 -1
  415. package/dist/platform/graph/index.d.ts +1 -1
  416. package/dist/platform/graph/index.js +1 -1
  417. package/dist/platform/release/index.d.ts +2 -0
  418. package/dist/platform/release/index.js +2 -0
  419. package/dist/platform/schema/callable-authoring.d.ts +21 -0
  420. package/dist/platform/schema/callable-authoring.js +27 -0
  421. package/dist/platform/schema/class-authoring.d.ts +58 -12
  422. package/dist/platform/schema/class-authoring.js +38 -4
  423. package/dist/platform/schema/class-icon-svg.d.ts +9 -0
  424. package/dist/platform/schema/class-icon-svg.js +29 -0
  425. package/dist/platform/schema/class-icon.d.ts +3 -8
  426. package/dist/platform/schema/class-icon.js +2 -29
  427. package/dist/platform/schema/index.d.ts +11 -4
  428. package/dist/platform/schema/index.js +2 -1
  429. package/dist/platform/schema/kernel-compiled.d.ts +2 -0
  430. package/dist/platform/schema/kernel-compiled.js +2 -0
  431. package/dist/platform/schema/kernel.d.ts +4 -2
  432. package/dist/platform/schema/property.d.ts +5 -0
  433. package/dist/platform/schema/references/index.d.ts +6 -0
  434. package/dist/platform/schema/references/index.js +1 -0
  435. package/dist/platform/schema/schema-authoring.d.ts +14 -7
  436. package/dist/platform/schema/schema-authoring.js +5 -1
  437. package/dist/platform/versioning/dependents.d.ts +18 -0
  438. package/dist/platform/versioning/dependents.js +15 -0
  439. package/dist/platform/versioning/index.d.ts +5 -0
  440. package/dist/platform/versioning/index.js +5 -0
  441. package/dist/platform/versioning/name.d.ts +38 -0
  442. package/dist/platform/versioning/name.js +58 -0
  443. package/dist/platform/versioning/reference.d.ts +48 -0
  444. package/dist/platform/versioning/reference.js +95 -0
  445. package/dist/platform/versioning/version.d.ts +72 -0
  446. package/dist/platform/versioning/version.js +98 -0
  447. package/dist/project/admit.js +1 -5
  448. package/dist/project/define.d.ts +4 -4
  449. package/dist/project/define.js +55 -35
  450. package/dist/project/index.d.ts +1 -1
  451. package/dist/project/install-command.d.ts +6 -0
  452. package/dist/project/install-command.js +9 -0
  453. package/dist/project/project.d.ts +10 -8
  454. package/dist/testing/dataset/define.d.ts +1 -1
  455. package/dist/testing/durable/engine.d.ts +128 -0
  456. package/dist/testing/durable/engine.js +619 -0
  457. package/dist/testing/durable/index.d.ts +3 -0
  458. package/dist/testing/durable/index.js +1 -0
  459. package/dist/testing/durable/steps.d.ts +30 -0
  460. package/dist/testing/durable/steps.js +45 -0
  461. package/dist/testing/file.d.ts +20 -0
  462. package/dist/testing/file.js +49 -0
  463. package/dist/testing/index.d.ts +10 -1
  464. package/dist/testing/index.js +7 -1
  465. package/dist/testing/load.js +1 -1
  466. package/dist/testing/query.d.ts +22 -0
  467. package/dist/testing/query.js +36 -0
  468. package/dist/tooling/cli/adapter-command.d.ts +35 -0
  469. package/dist/tooling/cli/adapter-command.js +66 -0
  470. package/dist/tooling/cli/arguments.d.ts +17 -6
  471. package/dist/tooling/cli/arguments.js +175 -52
  472. package/dist/tooling/cli/build.d.ts +55 -0
  473. package/dist/tooling/cli/build.js +77 -0
  474. package/dist/tooling/cli/bun.d.ts +0 -1
  475. package/dist/tooling/cli/bun.js +0 -7
  476. package/dist/tooling/cli/commit.d.ts +35 -0
  477. package/dist/tooling/cli/commit.js +235 -0
  478. package/dist/tooling/cli/deploy-mode.d.ts +26 -0
  479. package/dist/tooling/cli/deploy-mode.js +59 -0
  480. package/dist/tooling/cli/deploy-result.d.ts +80 -0
  481. package/dist/tooling/cli/deploy-result.js +64 -0
  482. package/dist/tooling/cli/diff/declared.d.ts +7 -0
  483. package/dist/tooling/cli/diff/declared.js +27 -0
  484. package/dist/tooling/cli/diff/index.d.ts +30 -0
  485. package/dist/tooling/cli/diff/index.js +58 -0
  486. package/dist/tooling/cli/diff/render.d.ts +15 -0
  487. package/dist/tooling/cli/diff/render.js +131 -0
  488. package/dist/tooling/cli/diff/report.d.ts +88 -0
  489. package/dist/tooling/cli/diff/report.js +154 -0
  490. package/dist/tooling/cli/dotenv.d.ts +5 -5
  491. package/dist/tooling/cli/dotenv.js +6 -36
  492. package/dist/tooling/cli/help.js +173 -60
  493. package/dist/tooling/cli/immutable-deployment.d.ts +83 -0
  494. package/dist/tooling/cli/immutable-deployment.js +135 -0
  495. package/dist/tooling/cli/index.d.ts +12 -4
  496. package/dist/tooling/cli/index.js +6 -3
  497. package/dist/tooling/cli/installed-on.d.ts +83 -0
  498. package/dist/tooling/cli/installed-on.js +156 -0
  499. package/dist/tooling/cli/list.d.ts +152 -0
  500. package/dist/tooling/cli/list.js +331 -0
  501. package/dist/tooling/cli/log.d.ts +5 -2
  502. package/dist/tooling/cli/log.js +9 -2
  503. package/dist/tooling/cli/orchestrate.d.ts +0 -6
  504. package/dist/tooling/cli/orchestrate.js +252 -91
  505. package/dist/tooling/cli/project.d.ts +3 -3
  506. package/dist/tooling/cli/publish/index.d.ts +81 -0
  507. package/dist/tooling/cli/publish/index.js +383 -0
  508. package/dist/tooling/cli/publish/report.d.ts +49 -0
  509. package/dist/tooling/cli/publish/report.js +15 -0
  510. package/dist/tooling/cli/registry/client.d.ts +121 -0
  511. package/dist/tooling/cli/registry/client.js +354 -0
  512. package/dist/tooling/cli/registry/error.d.ts +11 -0
  513. package/dist/tooling/cli/registry/error.js +17 -0
  514. package/dist/tooling/cli/registry/executable.d.ts +35 -0
  515. package/dist/tooling/cli/registry/executable.js +96 -0
  516. package/dist/tooling/cli/registry/index.d.ts +9 -0
  517. package/dist/tooling/cli/registry/index.js +8 -0
  518. package/dist/tooling/cli/registry/installations.d.ts +67 -0
  519. package/dist/tooling/cli/registry/installations.js +108 -0
  520. package/dist/tooling/cli/registry/process.d.ts +36 -0
  521. package/dist/tooling/cli/registry/process.js +119 -0
  522. package/dist/tooling/cli/secrets.d.ts +9 -0
  523. package/dist/tooling/cli/secrets.js +19 -0
  524. package/dist/tooling/cli/yank.d.ts +34 -0
  525. package/dist/tooling/cli/yank.js +32 -0
  526. package/dist/tooling/linter/adapters/typescript/definition-calls.d.ts +34 -0
  527. package/dist/tooling/linter/adapters/typescript/definition-calls.js +88 -0
  528. package/dist/tooling/linter/adapters/typescript/discover.js +8 -2
  529. package/dist/tooling/linter/adapters/typescript/imports.d.ts +0 -1
  530. package/dist/tooling/linter/adapters/typescript/imports.js +1 -5
  531. package/dist/tooling/linter/adapters/typescript/index.d.ts +9 -2
  532. package/dist/tooling/linter/adapters/typescript/index.js +4 -2
  533. package/dist/tooling/linter/adapters/typescript/legacy.d.ts +20 -0
  534. package/dist/tooling/linter/adapters/typescript/legacy.js +28 -0
  535. package/dist/tooling/linter/adapters/typescript/query-observation.js +37 -12
  536. package/dist/tooling/linter/adapters/typescript/syntax.d.ts +3 -3
  537. package/dist/tooling/linter/adapters/typescript/syntax.js +13 -25
  538. package/dist/tooling/linter/adapters/typescript/type-analysis.d.ts +2 -0
  539. package/dist/tooling/linter/adapters/typescript/type-analysis.js +10 -0
  540. package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +2 -4
  541. package/dist/tooling/linter/implementations/source/callable-requirements.js +16 -58
  542. package/dist/tooling/linter/implementations/source/const-initializer.d.ts +3 -0
  543. package/dist/tooling/linter/implementations/source/const-initializer.js +31 -0
  544. package/dist/tooling/linter/implementations/source/definitions.d.ts +2 -0
  545. package/dist/tooling/linter/implementations/source/definitions.js +425 -0
  546. package/dist/tooling/linter/implementations/source/dependencies.js +13 -72
  547. package/dist/tooling/linter/implementations/source/domain-requirements.d.ts +8 -0
  548. package/dist/tooling/linter/implementations/source/domain-requirements.js +35 -0
  549. package/dist/tooling/linter/implementations/source/global.js +39 -19
  550. package/dist/tooling/linter/implementations/source/legacy/requirements.d.ts +10 -0
  551. package/dist/tooling/linter/implementations/source/legacy/requirements.js +40 -0
  552. package/dist/tooling/linter/implementations/source/legacy-folders.d.ts +3 -0
  553. package/dist/tooling/linter/implementations/source/legacy-folders.js +126 -0
  554. package/dist/tooling/linter/implementations/source/mutations.js +153 -70
  555. package/dist/tooling/linter/implementations/source/policy-edges.d.ts +2 -0
  556. package/dist/tooling/linter/implementations/source/policy-edges.js +113 -0
  557. package/dist/tooling/linter/implementations/source/providers.js +5 -5
  558. package/dist/tooling/linter/implementations/source/queries.js +1 -17
  559. package/dist/tooling/linter/implementations/source/requirement-entries.d.ts +24 -0
  560. package/dist/tooling/linter/implementations/source/requirement-entries.js +52 -0
  561. package/dist/tooling/linter/implementations/source/runtime-imports.d.ts +2 -0
  562. package/dist/tooling/linter/implementations/source/runtime-imports.js +119 -0
  563. package/dist/tooling/linter/implementations/source/schema.d.ts +3 -0
  564. package/dist/tooling/linter/implementations/source/schema.js +9 -5
  565. package/dist/tooling/linter/implementations/source/shared.d.ts +19 -5
  566. package/dist/tooling/linter/implementations/source/shared.js +131 -55
  567. package/dist/tooling/linter/implementations/source/tests.js +1 -1
  568. package/dist/tooling/linter/implementations/source/verifiers.js +8 -2
  569. package/dist/tooling/linter/implementations/source/views.js +2 -2
  570. package/dist/tooling/linter/implementations/source/workflows.js +499 -17
  571. package/dist/tooling/linter/policy/generated.js +18 -67
  572. package/dist/tooling/linter/requirements/registry.js +14 -9
  573. package/dist/tooling/packaging/declarations/ownership.js +1 -1
  574. package/dist/tooling/packaging/finalize.d.ts +1 -1
  575. package/dist/tooling/packaging/finalize.js +1 -1
  576. package/docs/accounts/scenarios.tsv +12 -0
  577. package/docs/admission-age.md +88 -0
  578. package/docs/auth-api-migration.md +57 -0
  579. package/docs/business-errors.md +42 -0
  580. package/docs/domain-definition-migration.md +44 -0
  581. package/docs/domain-schema-migration.md +36 -0
  582. package/docs/durable-workflows.md +530 -0
  583. package/docs/handler-dependencies.md +381 -0
  584. package/docs/legacy/query-v6.md +62 -0
  585. package/docs/legacy.md +113 -0
  586. package/docs/queries.md +493 -0
  587. package/docs/release.md +155 -0
  588. package/docs/requirements.md +143 -0
  589. package/docs/schema-cost.md +124 -0
  590. package/package.json +62 -26
  591. package/dist/application/application.d.ts +0 -28
  592. package/dist/application/query/execution/projection.d.ts +0 -3
  593. package/dist/application/query/execution/projection.js +0 -3
  594. package/dist/application/requirements/authority.d.ts +0 -7
  595. package/dist/application/requirements/core.d.ts +0 -14
  596. package/dist/deployment/adapter/deploy/context.d.ts +0 -15
  597. package/dist/deployment/adapter/deploy/index.d.ts +0 -2
  598. package/dist/deployment/adapter/deploy/result.d.ts +0 -50
  599. package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
  600. package/dist/deployment/adapter/prepare/context.d.ts +0 -23
  601. package/dist/deployment/adapter/prepare/index.d.ts +0 -2
  602. package/dist/deployment/deploy.d.ts +0 -20
  603. package/dist/deployment/deploy.js +0 -31
  604. package/dist/deployment/release/publication/index.d.ts +0 -6
  605. package/dist/deployment/release/publication/index.js +0 -6
  606. package/dist/deployment/release/publication/manifest.d.ts +0 -3
  607. package/dist/deployment/release/publication/manifest.js +0 -5
  608. package/dist/deployment/release/publication/requirements.d.ts +0 -3
  609. package/dist/deployment/release/publication/requirements.js +0 -3
  610. package/dist/deployment/release/publication/seal.d.ts +0 -10
  611. package/dist/deployment/release/publication/seal.js +0 -39
  612. package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
  613. package/dist/deployment/verify/preflight/artifact.js +0 -122
  614. package/dist/deployment/verify/preflight/publication.d.ts +0 -4
  615. package/dist/deployment/verify/preflight/publication.js +0 -14
  616. package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
  617. package/dist/deployment/verify/readiness/deployment.js +0 -151
  618. package/dist/deployment/verify/readiness/publication.d.ts +0 -11
  619. package/dist/deployment/verify/readiness/publication.js +0 -41
  620. package/dist/execution/service/errors.d.ts +0 -3
  621. package/dist/execution/service/errors.js +0 -3
  622. package/dist/execution/service/publication/delivery.d.ts +0 -2
  623. package/dist/execution/service/publication/installation.d.ts +0 -3
  624. package/dist/execution/service/publication/installation.js +0 -8
  625. package/dist/execution/service/publication/source.d.ts +0 -3
  626. package/dist/execution/service/publication/source.js +0 -11
  627. package/dist/platform/publication/index.d.ts +0 -2
  628. package/dist/platform/publication/index.js +0 -2
  629. package/dist/tooling/cli/astrale/authority.d.ts +0 -5
  630. package/dist/tooling/cli/astrale/authority.js +0 -11
  631. package/dist/tooling/cli/astrale/executable.d.ts +0 -2
  632. package/dist/tooling/cli/astrale/executable.js +0 -47
  633. package/dist/tooling/cli/astrale/failure.d.ts +0 -6
  634. package/dist/tooling/cli/astrale/failure.js +0 -48
  635. package/dist/tooling/cli/astrale/instance.d.ts +0 -11
  636. package/dist/tooling/cli/astrale/instance.js +0 -52
  637. package/dist/tooling/cli/astrale/process.d.ts +0 -13
  638. package/dist/tooling/cli/astrale/process.js +0 -94
  639. package/dist/tooling/cli/astrale/version.d.ts +0 -18
  640. package/dist/tooling/cli/astrale/version.js +0 -55
  641. package/dist/tooling/cli/credential.d.ts +0 -2
  642. package/dist/tooling/cli/credential.js +0 -57
  643. package/dist/tooling/cli/deprecations.d.ts +0 -9
  644. package/dist/tooling/cli/deprecations.js +0 -15
  645. package/dist/tooling/cli/development/candidate.d.ts +0 -25
  646. package/dist/tooling/cli/development/candidate.js +0 -176
  647. package/dist/tooling/cli/development/deployment.d.ts +0 -16
  648. package/dist/tooling/cli/development/deployment.js +0 -39
  649. package/dist/tooling/cli/development/develop.d.ts +0 -11
  650. package/dist/tooling/cli/development/develop.js +0 -243
  651. package/dist/tooling/cli/development/lease.d.ts +0 -18
  652. package/dist/tooling/cli/development/lease.js +0 -163
  653. package/dist/tooling/cli/development/lifecycle.d.ts +0 -9
  654. package/dist/tooling/cli/development/lifecycle.js +0 -43
  655. package/dist/tooling/cli/development/project-imports.d.ts +0 -22
  656. package/dist/tooling/cli/development/project-imports.js +0 -39
  657. package/dist/tooling/cli/development/project-lock.d.ts +0 -16
  658. package/dist/tooling/cli/development/project-lock.js +0 -41
  659. package/dist/tooling/cli/development/rebuild.d.ts +0 -13
  660. package/dist/tooling/cli/development/rebuild.js +0 -58
  661. package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
  662. package/dist/tooling/cli/development/release-evidence.js +0 -10
  663. package/dist/tooling/cli/development/report.d.ts +0 -6
  664. package/dist/tooling/cli/development/report.js +0 -14
  665. package/dist/tooling/cli/development/session-file.d.ts +0 -53
  666. package/dist/tooling/cli/development/session-file.js +0 -337
  667. package/dist/tooling/cli/development/source-watch.d.ts +0 -14
  668. package/dist/tooling/cli/development/source-watch.js +0 -140
  669. package/dist/tooling/cli/development/sources.d.ts +0 -7
  670. package/dist/tooling/cli/development/sources.js +0 -48
  671. package/dist/tooling/cli/development/target-lock.d.ts +0 -16
  672. package/dist/tooling/cli/development/target-lock.js +0 -68
  673. package/dist/tooling/cli/development/view.d.ts +0 -28
  674. package/dist/tooling/cli/development/view.js +0 -151
  675. package/dist/tooling/cli/environment-release.d.ts +0 -21
  676. package/dist/tooling/cli/environment-release.js +0 -46
  677. package/dist/tooling/cli/evidence.d.ts +0 -11
  678. package/dist/tooling/cli/evidence.js +0 -53
  679. package/dist/tooling/cli/installation/index.d.ts +0 -2
  680. package/dist/tooling/cli/installation/index.js +0 -1
  681. package/dist/tooling/cli/installation/observation.d.ts +0 -10
  682. package/dist/tooling/cli/installation/observation.js +0 -44
  683. package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
  684. package/dist/tooling/cli/installation/reconcile.js +0 -122
  685. package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
  686. package/dist/tooling/linter/implementations/source/migrations.js +0 -113
  687. package/dist/tooling/linter/qualification/index.d.ts +0 -10
  688. package/dist/tooling/linter/qualification/index.js +0 -2
  689. package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
  690. package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
  691. package/dist/tooling/linter/qualification/runner.d.ts +0 -3
  692. package/dist/tooling/linter/qualification/runner.js +0 -6
  693. /package/dist/application/{application.js → domain.js} +0 -0
  694. /package/dist/application/{query/single/query.js → mutation/legacy/v6/builder.js} +0 -0
  695. /package/dist/{deployment/adapter/deploy/context.js → application/mutation/legacy/v6/mutation.js} +0 -0
  696. /package/dist/application/mutation/{authoring → legacy/v6}/precondition.js +0 -0
  697. /package/dist/{deployment/adapter/deploy/index.js → application/query/answer/answer.js} +0 -0
  698. /package/dist/{deployment/adapter/deploy/result.js → application/query/defined/query.js} +0 -0
  699. /package/dist/{deployment/adapter/prepare/artifact.js → application/query/execution/client.js} +0 -0
  700. /package/dist/{deployment/adapter/prepare/context.js → application/query/handles/conditions.js} +0 -0
  701. /package/dist/{deployment/adapter/prepare/index.js → application/query/handles/domain.js} +0 -0
  702. /package/dist/application/query/{collection → legacy/v6/collection}/identity.js +0 -0
  703. /package/dist/application/query/{collection → legacy/v6/collection}/limits.d.ts +0 -0
  704. /package/dist/application/query/{collection → legacy/v6/collection}/limits.js +0 -0
  705. /package/dist/application/query/{collection → legacy/v6/collection}/metadata.js +0 -0
  706. /package/dist/application/query/{execution → legacy/v6/execution}/pages.d.ts +0 -0
  707. /package/dist/application/query/{execution → legacy/v6/execution}/pages.js +0 -0
  708. /package/dist/application/query/{single → legacy/v6/single}/index.d.ts +0 -0
  709. /package/dist/application/query/{single → legacy/v6/single}/index.js +0 -0
  710. /package/dist/application/query/{single → legacy/v6/single}/node.d.ts +0 -0
  711. /package/dist/application/query/{single → legacy/v6/single}/node.js +0 -0
  712. /package/dist/application/query/{single → legacy/v6/single}/pagination.d.ts +0 -0
  713. /package/dist/application/query/{single → legacy/v6/single}/selection.d.ts +0 -0
  714. /package/dist/application/query/{single → legacy/v6/single}/selection.js +0 -0
  715. /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
  716. /package/dist/deployment/release/{publication → served}/routes.js +0 -0
  717. /package/dist/execution/service/{publication → serving}/index.js +0 -0
package/README.md CHANGED
@@ -1,10 +1,13 @@
1
1
  # SDK
2
2
 
3
- Schema-first SDK for authoring and deploying Astrale Applications. The public surface separates
3
+ Schema-first SDK for authoring and deploying Astrale Domains. The public surface separates
4
4
  single-step Actions, explicit multi-step Workflows, provider-neutral Integrations, concrete Providers, graph
5
- authoring, Application composition, Deployment, and Execution without exposing DSL callable
5
+ authoring, Domain composition, Deployment, and Execution without exposing DSL callable
6
6
  topology in implementation files.
7
7
 
8
+ The Domain name and optional View entrypoint belong to its root Schema. See
9
+ [the Schema authoring contract](docs/domain-schema-migration.md).
10
+
8
11
  [![CI](https://github.com/astrale-os/sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/astrale-os/sdk/actions/workflows/ci.yml)
9
12
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
10
13
 
@@ -17,7 +20,7 @@ npm install @astrale-os/sdk
17
20
  ```
18
21
 
19
22
  Zod schemas cross the SDK and Kernel compiler boundary by runtime identity. The SDK therefore
20
- declares one exact, non-optional Zod peer. If an Application declares Zod directly, it must use the
23
+ declares one exact, non-optional Zod peer. If a Domain declares Zod directly, it must use the
21
24
  same exact version rather than a range; a second physical Zod runtime is not an admitted authoring
22
25
  environment.
23
26
 
@@ -42,41 +45,57 @@ The command covers the workspace root and its packages, pins exact versions, and
42
45
  lockfile through pnpm. Use `--channel latest` to select that tag instead. Missing tags and local,
43
46
  catalog, or aliased dependencies are left unchanged and reported; peers and overrides are not edited.
44
47
  For an older SDK without this command, start with `pnpm dlx @astrale-os/sdk@beta upgrade`.
45
- Stop development watchers first, then run the project's checks and validate on development.
48
+ Run the project's checks and validate on development.
46
49
  Nothing is committed or deployed. A Shell update also requires checking the installed Shell revision.
47
50
  Rerunning an upgrade synchronizes installation even when the manifest versions are already current.
48
51
 
49
- ## Move a runtime without changing its Domain identity
50
-
51
- A Domain issuer is retained across installation upgrades. To deploy a new Cloudflare runtime for
52
- selected instances, keep the existing signing identity and issuer while selecting a new public origin:
53
-
54
- ```ts
55
- cloudflare({
56
- route: 'services-v2.example.com',
57
- workerName: 'services-v2',
58
- identityIssuer: 'https://services.example.com',
59
- signingIdentity: '.astrale/identity.json',
60
- })
61
- ```
62
-
63
- The new Publication places its Bundle, Delivery, callables, Views and routes at the new origin.
64
- Install that public URL on each intended instance. The Kernel verifies its Delivery against the
65
- retained issuer's keys and preserves the Domain installation identity and owned data. Keep the
66
- original issuer discovery endpoints and keys available; unadopted instances continue to use their
67
- previous bindings. Deployment readiness checks the exact new Worker version separately from issuer
68
- discovery. No uninstall or identity rotation is involved.
52
+ ## Immutable deployments
69
53
 
70
- At the provider-neutral release boundary, use
71
- `addressing('https://services.example.com', { publicUrl: 'https://services-v2.example.com' })`.
72
- The one-argument form continues to use the issuer as the public URL.
54
+ A deployment serves one `DomainRelease` v4 at its immutable URL, which is also its issuer.
55
+ `assemble(build, buildDigest, url)` seals the document from the exact Build and running bytes.
56
+ Cloudflare deployments require a dispatch namespace; `astrale()` hosts them on Admin's Services.
57
+ Install the URL printed by `astrale-domain deploy` on each intended instance.
73
58
 
74
59
  ## Handler authority and dependencies
75
60
 
76
- Authenticated handlers use Domain self authority for `kernel`, `graph`, `query`, and `mutate`.
77
- `dependencies.directory.invoke(d => d.functions.lookup, input)` calls a direct declared dependency
78
- with the incoming caller Grant. Explicit authority remains on `kernel` and `graph`; the former
79
- handler `client` is removed. See [the API and migration guide](docs/handler-dependencies.md).
61
+ Handlers use Domain self authority for `kernel`, `graph`, Query V6 definitions, and a `mutate`
62
+ given no options; a Query v7, and a `mutate` given `{ as }`, name their authority on each call.
63
+ `dependencies.directory.caller.invoke(d => d.functions.lookup, input)` calls a direct declared
64
+ dependency on behalf of the incoming caller Identity; `.self` calls it as the executing Domain.
65
+ Explicit `caller` or `self` authority is also available on `kernel` and `graph`; the former
66
+ handler `client` is removed. A call to an `auth: 'anonymous'` callable that carries no credential
67
+ has no caller: its handler acts as the Domain alone, without the `caller` selections. See
68
+ [the API and migration guide](docs/handler-dependencies.md).
69
+
70
+ ## Queries
71
+
72
+ `defineQuery<Schema>()(id, { build, output?, errors? })` defines a Query: typed handles over
73
+ the Domain (`d.Article.where((a) => a.state.eq('published')).first(50)`), reads bounded by
74
+ their verbs, a pure `output` and declared errors. An Action calls
75
+ `query(query, input, { as: 'executor' | 'caller' })`; a durable Workflow reads in
76
+ `step.query(step, query, input, { as: 'executor' })`. Before anything is sent, the SDK checks the
77
+ Query's bounds and the requirements its relations need; `checkQuery` from
78
+ `@astrale-os/sdk/testing` runs both checks in a test, on the first step it builds for a sample
79
+ input. A Query reads on a Host whose Kernel serves Query v7 and the Class of each row. Query V6
80
+ definitions keep their meaning and are deprecated. See [the Query guide](docs/queries.md) and
81
+ [Query V6 and the move to v7](docs/legacy/query-v6.md).
82
+
83
+ ## Durable Workflows
84
+
85
+ A callable declared with `execution: { durable: true }` is implemented by `defineWorkflow` and runs
86
+ on the Kernel's workflow engine: a call returns its `K.Execution` at once, and the run survives
87
+ restarts with journaled Steps, durable timers and signals. Serve it with `serve({ durable })`. See
88
+ [the durable Workflow guide](docs/durable-workflows.md).
89
+
90
+ ## Admission age
91
+
92
+ A callable declared with `admission: { maxAge: <seconds> }` (1 to 300) lets its deployment reuse an
93
+ admission the source Kernel granted, for the same Kernel, caller, target and Policy-read input fields,
94
+ while it is younger than that age: such a call skips its `Function.admit` round trip. Revocation then
95
+ reaches it within that age. Credential verification, the release pin and input validation still run
96
+ on every call. Admissions are kept in the deployment cache, `serve({ cache })`: a memory cache by
97
+ default, the Cache API on Cloudflare, and none with `cache: false`. See
98
+ [the admission age guide](docs/admission-age.md).
80
99
 
81
100
  ## Node Class icons
82
101
 
@@ -100,6 +119,66 @@ valid; the linter emits a non-failing `SCH-ICON-NEUTRAL` warning. Bare names suc
100
119
  non-canonical empty SVGs, external references, and executable SVG content are rejected during
101
120
  Schema authoring.
102
121
 
122
+ ## Read rules and caller rules
123
+
124
+ Every concrete Class authored through the SDK declares who may read it, and every executable
125
+ `authorized` callable declares who may call it. Omission is rejected by TypeScript and at the
126
+ runtime authoring boundary. A rule is a predicate on the caller: a Policy, or its constant value
127
+ `true` or `false`.
128
+
129
+ ```typescript
130
+ import { classIcon, func, nodeClass } from '@astrale-os/sdk/schema'
131
+ import { FileText, Lock } from '@astrale-os/sdk/schema/icons'
132
+ import { z } from 'zod'
133
+
134
+ export const Article = nodeClass({
135
+ icon: classIcon.lucide(FileText),
136
+ policies: { read: true },
137
+ })
138
+
139
+ export const Secret = nodeClass({
140
+ icon: classIcon.lucide(Lock),
141
+ policies: { read: false, traverse: false },
142
+ })
143
+
144
+ export const purge = func({
145
+ auth: 'authorized',
146
+ policy: false,
147
+ input: z.strictObject({}),
148
+ output: z.boolean(),
149
+ })
150
+ ```
151
+
152
+ A Class rule judges the caller, which passes by owning the Class's installation or by the rule,
153
+ never by a capability it holds. When a Domain acts for a caller, the Domain must also hold its own
154
+ right on the Class (the scope its requirements declare, or ownership), whatever the rule; an
155
+ Identity acting for itself delegates nothing and meets no such ceiling. A callable reads the same
156
+ way, with its `call` scope (or ownership) as the right of its ceiling. `true` admits every Identity of the
157
+ instance, never an anonymous request.
158
+
159
+ | Declared | Caller is admitted when |
160
+ | --- | --- |
161
+ | Class `read: true` | always |
162
+ | Class `read: false` | it is the owning installation |
163
+ | Class `read: aPolicy` | ownership or the Policy |
164
+ | Callable `policy: false` | it is Root or the owning installation |
165
+ | Callable `policy: true` | always |
166
+ | Callable `policy: checks` | Root, ownership, or the checks |
167
+
168
+ - `read: true` and `policy: false` are what an absent rule already meant. Writing them changes
169
+ neither the compiled Schema nor its revision.
170
+ - An excluded caller stays denied: `true` holds only for a caller whose live composition is not
171
+ denied.
172
+ - `read` governs values, `traverse` governs reachability: a Node is reachable, and its reference
173
+ selectable, when either rule admits the caller. A Class whose `read` is not `true` must
174
+ therefore declare `traverse` as well: `traverse: false` hides that its Nodes exist,
175
+ `traverse: true` keeps them reachable for every caller. Beside `read: true`, `traverse` stays
176
+ optional.
177
+ - An abstract Class declares no rule. An abstract Method declares its caller rule only where a
178
+ concrete Class executes it.
179
+ - `read: false`, `traverse: false` and `policy: true` need a Kernel that knows the two constants.
180
+ Earlier Kernels refuse such a Schema at installation.
181
+
103
182
  ## Business-error declarations
104
183
 
105
184
  Declare reusable business errors in `schema/modules/<module>/errors/` through the Schema facade:
@@ -125,22 +204,32 @@ Error declarations are not yet published in the installed Kernel Schema.
125
204
 
126
205
  ## Development
127
206
 
128
- ### Core Identity requirements
129
-
130
- Use `requirements({ core: [{ subject, functions, classes, authority }] })` to declare capabilities
131
- for an Identity in the Application's local Core. `subject` is the resolved Core Node; each entry
132
- must request at least one capability. The top-level `functions`, `classes`, and `authority` members
133
- describe capabilities for the Domain principal.
134
-
135
- This replaces `requirements.profiles`. Rename that property to `core` and imported
136
- `CapabilityProfileRequirement` / `CapabilityProfileRequirementInput` types to `CoreRequirement` /
137
- `CoreRequirementInput`. Builds emit `requirements.capabilities.core`; new releases use Publication
138
- v3 and require a Kernel that supports it. That Kernel can restore historical v2 Publications and
139
- installation ledgers without changing their existing authority or integrity evidence.
207
+ ### Requirements: Kernel Roles and scopes
208
+
209
+ `requirements({ roles, scopes })` declares what a Domain's release needs from an instance: each
210
+ Role binding names a Role (a Core Node of the Domain or of a dependency) and the holders that are
211
+ its `members` or its `granters` (one of the Domain's Core Identities, or `requirements.domain` for
212
+ the installed Domain itself); each scope names a Class with Class operations, or a Function or
213
+ Method with `call`. Builds emit them as the release's `requirements.capabilities.roles` and
214
+ `.scopes`, which the Kernel validates against the exact dependency closure. See
215
+ [Requirements](docs/requirements.md). The previous shape (`functions`, `classes`, `authority`,
216
+ `core`) still builds unchanged and is deprecated; see [the legacy method](docs/legacy.md).
217
+
218
+ ### Durable schema installations
219
+
220
+ `schema.install()` and `schema.uninstall()` return an Execution id and its status; `result` is
221
+ present only after successful completion. They wait at most `waitMs` (110 s by default) for the
222
+ outcome; `waitMs: 0` returns at once. Keep the `execution` id to continue observing it through
223
+ `schema.installation.status()` or `schema.installation.result()` from a new Client session.
224
+ Uninstalls have the corresponding `schema.uninstallation` methods, and `session.execution` drives
225
+ any Execution, a durable call's included: `session.execution.result(run, { waitMs })` waits for
226
+ its outcome across as many requests as the wait takes.
227
+ The Client decodes the Kernel’s `kind: execution` call result before reading the durable status.
228
+ An admitted or pending Execution is not proof that the schema change completed.
140
229
 
141
230
  ### Prerequisites
142
231
 
143
- - Node.js 26.7.0 (default) or Node.js 24; published packages remain compatible with Node.js 22+
232
+ - Node.js 26.13.0 (default) or Node.js 24; published packages require Node.js 24 or later
144
233
  - pnpm 12.1.0
145
234
 
146
235
  ### Setup
@@ -253,13 +342,18 @@ NodePath and its Dataset Node ID through encoding and decoding. Matching propert
253
342
  not create that association. Studio uses it when simulating `sameNode` and reference endpoints;
254
343
  a missing association makes that simulation unavailable.
255
344
 
256
- ## Kernel publication discovery
345
+ ## Kernel release discovery
257
346
 
258
- Use `session.publication()` when a consumer needs the intrinsic Kernel's published identity or
259
- endpoints without its schema bundle or Views. It revalidates through the Client's existing issuer,
260
- URL, size, and ETag checks. Concurrent publication and snapshot observations share acquisition;
261
- cancelling one observer does not cancel another. `session.snapshot()` remains the complete,
262
- coherent Publication, bundle, and View catalog observation.
347
+ Use `session.release()` for the intrinsic Kernel's Release without its schema bundle or Views.
348
+ It revalidates issuer, URL, size and ETag. Concurrent release and snapshot observations share
349
+ acquisition; cancelling one observer does not cancel another. `session.snapshot()` returns one
350
+ coherent Release and Bundle observation.
351
+
352
+ A View is a Node that carries its own placement, whether its Domain declares it or a Mutation
353
+ created it. Read Views from the graph, under the caller's read authority: `session.view(path)`
354
+ reads one View by any Path, a Domain's entrypoint included, and `session.view({ domain })` lists
355
+ the Views a Domain declares. The snapshot's `views` catalog and `session.viewsFor` are deprecated:
356
+ they read Views from the Release rather than from their Nodes.
263
357
 
264
358
  ## Headless scripts and Domain callables
265
359
 
@@ -272,30 +366,33 @@ evaluated against the caller. Kernel callables, including graph reads and writes
272
366
  credential.
273
367
 
274
368
  ```ts
275
- import { connect, createSessionCredentialProvider } from '@astrale-os/sdk/client/session'
369
+ import { connect, credentials } from '@astrale-os/sdk/client/session'
276
370
 
277
371
  const session = connect({
278
372
  url: 'https://instance.example/api',
279
- auth: createSessionCredentialProvider({
280
- ttlSeconds: 60,
281
- // Return { credential, expiresAt } with expiresAt in Unix milliseconds.
282
- mint: (signal) => mintSourceCredential(signal),
283
- }),
284
- exchange: {},
373
+ // A fixed `astrale token`; pass a mint instead, `credentials((signal) => fetchToken(signal))`,
374
+ // for a script that outlives it.
375
+ auth: credentials(token),
376
+ exchange: { mode: 'auto' },
285
377
  })
286
378
 
287
379
  await session.call({ target: '/:orders.example:class.Order:create', input }) // Domain callable
288
380
  await session.graph.get('@order-id') // Kernel callable: the source credential
289
381
  ```
290
382
 
291
- - **Hold the source in a provider.** Domain credentials are cached per source credential, so a
292
- `resolve` that returns a new token on every call also exchanges on every call. The provider also
293
- lets the Session renew a source that is too close to expiry to feed a Domain credential.
294
- - **Lifetimes.** `exchange.ttlSeconds` (default 300) must exceed the provider's `ttlSeconds` plus a
295
- 5-second settlement skew. A Domain credential never outlives its source.
383
+ - **Hold the source in `credentials`.** It takes a fixed credential (a compact JWT whose `exp` is
384
+ its expiry), a mint returning a JWT or `{ credential, expiresAt }` in Unix milliseconds, or options
385
+ (`ttlSeconds`, default 60; `mint`; `initial`; `onChange`). Domain credentials are cached per source
386
+ credential, so a `resolve` that returns a new token on every call also exchanges on every call.
387
+ With a mint, `credentials` also lets the Session renew a source that is too close to expiry to
388
+ feed a Domain credential; a fixed credential fails once it no longer covers a call.
389
+ - **Lifetimes.** In `exchange: { mode: 'auto', ttlSeconds }`, `ttlSeconds` (default 300) must exceed
390
+ the `ttlSeconds` of `credentials` plus a 5-second settlement skew. A Domain credential never outlives its
391
+ source. `exchange: { mode: 'source' }` keeps the source credential for every Call and takes no
392
+ `ttlSeconds`; an empty `{}` or a bare `{ ttlSeconds }` is rejected.
296
393
  - **Reading as a Domain.** To call Kernel callables as a Domain, for example to read Shell-owned
297
394
  Classes, feed a second Session from an explicit exchange:
298
- `createSessionCredentialProvider({ ttlSeconds: 60, mint: (signal) => session.exchange(shellIssuer, { signal }) })`.
395
+ `credentials((signal) => session.exchange(shellIssuer, { signal }))`.
299
396
  `session.exchange(issuer)` caches nothing.
300
397
  - **Current identity.** Use `session.auth.whoami()`; `@self` is a CLI shorthand.
301
398
  - **Failures.** A failed exchange raises `ExchangeError` from `@astrale-os/sdk/client`. Its
@@ -305,14 +402,68 @@ await session.graph.get('@order-id') // Kernel callable: the source credential
305
402
 
306
403
  | Credential presented | Principal | Kernel callable | Domain callable reached by Policy |
307
404
  | --- | --- | --- | --- |
308
- | Source credential (minted or key) | the identity | ✅ | ❌ `2004`, unless the identity holds `can_use` on it through a Group |
405
+ | Source credential (minted or key) | the identity | ✅ | ✅ the identity acts for itself: the Policy alone decides |
309
406
  | Session with `exchange` | the declaring Domain, for Domain callables | ✅ with the source credential | ✅ Policy evaluated against the identity |
310
407
  | `session.exchange(issuer)` held by a second Session | that Domain | ✅ as that Domain | only what that Domain may use |
311
408
 
409
+ ## Deployment addresses
410
+
411
+ `@astrale-os/sdk/deployment/address` derives the one immutable URL of a deployment,
412
+ `https://<line>-<content>.<routingDomain>`, from its inputs alone. Whoever deploys and whoever
413
+ hosts compute it with the same pure, runtime-safe functions, so a host can refuse an address it
414
+ did not derive.
415
+
416
+ - **Line.** `deploymentLine({ origin, environment, addressing })` is shared by every deployment of
417
+ an origin in an environment. Its 16-character fingerprint, the first 80 bits of
418
+ `sha256(origin ‖ 0x00 ‖ environment)` in base32, makes it unique. A `readable` line (platform
419
+ Domains) prefixes it with a cosmetic part, so `agencies.example.com` in `staging` gives
420
+ `agencies-staging-354iwg4avm6wdmrs`. An `opaque` line (tenant Domains) is the fingerprint alone.
421
+ - **Content.** `deploymentContent(buildDigest, configuration)` covers the build and the
422
+ `FrozenConfigurationV1`: the plain variables and execution settings (with the durable Workflow
423
+ options, when declared), the services and dispatch namespaces it binds, and the names of the
424
+ bound secrets, never their values. A changed variable or binding gives another URL, and a rotated
425
+ secret keeps the URL. `configurationDigest` gives the full digest that a deployment record keeps. It checks
426
+ canonical form only: the host refuses settings no Worker runs under when it encodes
427
+ `ASTRALE_SETTINGS` (`encodeWorkerSettings`), before it uploads anything.
428
+ - **Label.** `deploymentLabel(line, content)` is at most 57 characters. `DEPLOYMENT_LABEL`
429
+ recognizes it, never a legacy UUID or stable Worker name, and `parseDeploymentLabel` splits it
430
+ and refuses anything longer than 57 characters.
431
+ - **Record.** `acceptDeploymentRecord` admits a `DeploymentRecordV1` only when its provider
432
+ script is the label that its own fields derive. A host admits the record a deploy declares with
433
+ it before storing it, so every stored record decodes.
434
+
435
+ ```ts
436
+ import {
437
+ deploymentContent,
438
+ deploymentLabel,
439
+ deploymentLine,
440
+ deploymentUrl,
441
+ } from '@astrale-os/sdk/deployment/address'
442
+
443
+ const line = deploymentLine({ origin, environment, addressing: 'opaque' })
444
+ const url = deploymentUrl(deploymentLabel(line, deploymentContent(build, configuration)), routingDomain)
445
+ ```
446
+
447
+ `@astrale-os/sdk/deployment/address/vectors` holds the conformance vectors: Worker uploads and
448
+ configurations with the manifest, build digest, label and URL each one gives. Every host that
449
+ recomputes an address tests against them.
450
+
312
451
  ## License
313
452
 
314
453
  Apache License 2.0 — see [LICENSE](LICENSE) for details.
315
454
 
455
+ ## Domain icon
456
+
457
+ ```ts
458
+ import { classIcon } from '@astrale-os/sdk/schema'
459
+ import { Building2 } from '@astrale-os/sdk/schema/icons'
460
+
461
+ export const domain = defineDomain({ schema, runtime, icon: classIcon.lucide(Building2) })
462
+ ```
463
+
464
+ The release publishes the icon as `manifest.logo`. Use `classIcon.svg(...)` for a self-contained
465
+ inline SVG, or omit `icon` and the release carries no manifest.
466
+
316
467
  ## View host requirements
317
468
 
318
469
  A frontend route can declare the exact external origins its View needs to open:
@@ -330,11 +481,14 @@ routes: {
330
481
  }
331
482
  ```
332
483
 
333
- These requirements are publication metadata, so changing them updates the publication ETag without
334
- changing the Application's business Schema. They require the `shell` handshake. Origins must use
484
+ These requirements belong to the Release, so changing them updates its digest without
485
+ changing the Domain's business Schema. They require the `shell` handshake. Origins must use
335
486
  HTTPS without credentials, paths, queries, fragments, or wildcards; authoring normalizes and sorts
336
487
  them. Supporting hosts admit them per mount and execute the existing `browser.openExternal`
337
488
  intent. Nested Views cannot expand their parent's grant.
338
489
 
339
490
  For the unified authentication facade and coordinated consumer update, see
340
491
  [the Auth API migration guide](docs/auth-api-migration.md).
492
+
493
+ The authored composition formerly called an Application is now a Domain definition: see
494
+ [the Domain definition migration guide](docs/domain-definition-migration.md).
@@ -29,6 +29,12 @@ export type ActionAddressOf<Callable> = Callable extends {
29
29
  export type ResolvedDomainOf<Schema extends schema.DomainSchema> = Extract<schema.DomainOf<Schema>, Domain>;
30
30
  /** SDK Action address derived mechanically from the canonical local callable key. */
31
31
  export type ActionAddress<Schema extends schema.DomainSchema> = ActionAddressOf<LocalCallable<ResolvedDomainOf<Schema>>>;
32
+ /** Address of a callable an Action may implement: a durable callable needs a Workflow. */
33
+ export type ImmediateActionAddress<Schema extends schema.DomainSchema> = ActionAddressOf<Exclude<LocalCallable<ResolvedDomainOf<Schema>>, {
34
+ readonly execution: {
35
+ readonly durable: true;
36
+ };
37
+ }>>;
32
38
  export type CallableAtAddress<Schema extends schema.DomainSchema, Address extends string> = LocalCallable<ResolvedDomainOf<Schema>> extends infer Callable ? Callable extends unknown ? ActionAddressOf<Callable> extends Address ? Callable : never : never : never;
33
39
  export type Action<Callable extends ResolvedCallable, Definitions extends Integrations = Readonly<Record<never, never>>, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = (context: ActionContext<Callable, DomainValue, Definitions, Errors>) => Promise<ActionOutputOf<Callable>>;
34
40
  declare const ACTION_SCHEMA: unique symbol;
@@ -1,5 +1,7 @@
1
1
  export { defineAction } from './define.js';
2
2
  export type { Action, ActionDefinition } from './action.js';
3
- export type { ActionContext, ActionExecution, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, } from './context.js';
3
+ export type { ActionContext, ActionBinaryInput, ActionExecution, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, DomainMutate, DomainQuery, } from './context.js';
4
4
  export type { ActionBinary, ActionOutputOf } from './output.js';
5
+ export { FILE_MEMORY_LIMIT, FileReadError } from '../file/index.js';
6
+ export type { FileReadErrorCode, ReceivedFile, WithFiles } from '../file/index.js';
5
7
  export type { DeclaredErrorDefinition, DeclaredErrorFactory, DeclaredErrorFamily, DeclaredErrorOptions, DeclaredErrors, } from '../error/index.js';
@@ -1 +1,2 @@
1
1
  export { defineAction } from './define.js';
2
+ export { FILE_MEMORY_LIMIT, FileReadError } from '../file/index.js';
@@ -1,21 +1,22 @@
1
- import type { AuthenticationEvidence, Grant, IdentityId } from '../../platform/auth/index.js';
1
+ import type { BinaryRequestBody } from '@astrale-os/kernel-core/callable';
2
+ import type { AuthenticationEvidence, IdentityId } from '../../platform/auth/index.js';
2
3
  import type { BoundClientSession } from '../../platform/client/session/index.js';
3
4
  import type { NodeId } from '../../platform/graph/node/index.js';
4
- import type { CallableInputOf, Domain, ResolvedFunction, ResolvedMethod } from '../../platform/schema/index.js';
5
+ import type { CallableInputOf, CallableInputModeOf, Domain, ResolvedFunction, ResolvedMethod } from '../../platform/schema/index.js';
5
6
  import type { HandlerDependencies } from '../dependency/index.js';
6
7
  import type { DeclaredErrorFactory, DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
8
+ import type { WithFiles } from '../file/index.js';
7
9
  import type { IntegrationClients, Integrations } from '../integration/index.js';
8
- import type { MutationExecutor } from '../mutation/index.js';
9
- import type { QueryExecutor } from '../query/index.js';
10
+ import type { Mutation, MutationExecutor, MutationInputOf, MutationOutputOf, DefinedMutation } from '../mutation/index.js';
11
+ import type { InputOf, OutputOf, Page, QueryDefinition, QueryExecutor, DefinedQuery, QueryOptions } from '../query/index.js';
10
12
  export type ResolvedCallable = ResolvedFunction | ResolvedMethod;
11
13
  /** Bearer-free caller evidence established before an Action or Workflow runs. */
12
14
  export interface AuthenticatedCaller {
13
15
  readonly kind: 'authenticated';
14
- /** Exact effective caller Identity. Access fails when authority is compound. */
16
+ /** The one Identity whose authority this invocation exercises: ownership and attribution. */
15
17
  readonly identity: IdentityId;
16
- /** Identity whose credential directly authenticated this invocation. */
18
+ /** Identity whose credential directly authenticated this invocation (for example this Domain). */
17
19
  readonly principal: IdentityId;
18
- readonly authority: Grant;
19
20
  readonly authentication: AuthenticationEvidence;
20
21
  }
21
22
  export interface AnonymousCaller {
@@ -34,41 +35,97 @@ export interface ActionExecution {
34
35
  body(): Uint8Array;
35
36
  };
36
37
  }
38
+ /**
39
+ * One admitted, single-consumer binary Function request body: the Core request body itself, so a
40
+ * handler can hand it as it is to the Kernel's content upload without reading it first.
41
+ */
42
+ export interface ActionBinaryInput extends BinaryRequestBody {
43
+ }
44
+ type BinaryInputOf<Callable> = CallableInputModeOf<Callable> extends 'binary' ? {
45
+ readonly body: ActionBinaryInput;
46
+ } : {
47
+ readonly body?: never;
48
+ };
37
49
  export interface DomainGraphExecutor<DomainValue extends Domain = Domain> {
38
50
  readonly query: QueryExecutor<DomainValue>;
39
51
  readonly mutate: MutationExecutor<DomainValue>;
40
52
  }
41
- export type DomainGraphExecutors<DomainValue extends Domain = Domain> = Readonly<DomainGraphExecutor<DomainValue> & Record<'caller' | 'self' | 'union', DomainGraphExecutor<DomainValue>>>;
53
+ /** Whose authority one Kernel call exercises: the incoming caller's or the executor's (`self`). */
54
+ export type AuthorityMode = 'caller' | 'self';
55
+ /**
56
+ * The name a call gives an authority with `as`: `executor` is `self`, the authority the handler
57
+ * executes with.
58
+ */
59
+ export type AuthorityName<Authority extends AuthorityMode = AuthorityMode> = Authority extends 'self' ? 'executor' : 'caller';
60
+ /**
61
+ * Reads under the authority `as` names. A Query v7 names it on every call; a V6 Query definition
62
+ * reads as the executor.
63
+ */
64
+ export interface DomainQuery<DomainValue extends Domain = Domain, As extends AuthorityName = AuthorityName> {
65
+ <R extends DefinedQuery>(query: R, input: InputOf<R>, options: QueryOptions<R, As>): Promise<OutputOf<R>>;
66
+ <Output>(query: QueryDefinition<DomainValue, void, Output>): Promise<Output>;
67
+ <Input, Output>(query: QueryDefinition<DomainValue, Input, Output>, input: Input): Promise<Output>;
68
+ /**
69
+ * Every row of a page Query, page after page; past `max` rows, `TOO_MANY`, as `all({ max })`.
70
+ * Each page is a read of its own, at its own snapshot.
71
+ */
72
+ readonly all: <R extends DefinedQuery>(query: R, input: InputOf<R>, options: '~page' extends keyof R ? {
73
+ readonly as: As;
74
+ readonly max: number;
75
+ } : never) => Promise<OutputOf<R> extends Page<infer Row> ? readonly Row[] : never>;
76
+ }
77
+ /**
78
+ * Writes under the authority `as` names. A defined Mutation names it on every call; a Mutation of
79
+ * the closure form may omit it, and writes as the executor.
80
+ */
81
+ export interface DomainMutate<DomainValue extends Domain = Domain, As extends AuthorityName = AuthorityName> {
82
+ <M extends DefinedMutation>(mutation: M, input: MutationInputOf<M>, options: {
83
+ readonly as: As;
84
+ }): Promise<MutationOutputOf<M>>;
85
+ <Input, Output>(definition: Mutation<DomainValue, Input, Output>, input: Input, options: {
86
+ readonly as: As;
87
+ }): Promise<Output>;
88
+ <Input, Output>(definition: Mutation<DomainValue, Input, Output>, input: Input): Promise<Output>;
89
+ }
90
+ /**
91
+ * One value per authority the code may act under. `self` exists in every invocation; `caller`
92
+ * exists only when the call carried a credential, so it is absent from a call that carried none.
93
+ */
94
+ export type AuthoritySelection<Value, Authority extends AuthorityMode = AuthorityMode> = Readonly<Record<Authority, Value> & {
95
+ readonly [Absent in Exclude<AuthorityMode, Authority>]?: never;
96
+ }>;
97
+ export type DomainGraphExecutors<DomainValue extends Domain = Domain, Authority extends AuthorityMode = AuthorityMode> = Readonly<DomainGraphExecutor<DomainValue> & AuthoritySelection<DomainGraphExecutor<DomainValue>, Authority>>;
42
98
  /** Self-default Kernel session with one level of explicit authority selection. */
43
- export type DomainKernelSessions = Readonly<BoundClientSession & Record<'caller' | 'self' | 'union', BoundClientSession>>;
99
+ export type DomainKernelSessions<Authority extends AuthorityMode = AuthorityMode> = Readonly<BoundClientSession & AuthoritySelection<BoundClientSession, Authority>>;
100
+ /**
101
+ * What code acting under `Authority` holds toward the Kernel and its dependencies: `kernel` and
102
+ * `graph` act with the executor's authority by default. An Action and a durable Step receive the
103
+ * same capabilities.
104
+ * `query` and `mutate` take the authorities `As` names.
105
+ */
106
+ export interface DomainCapabilities<DomainValue extends Domain = Domain, Authority extends AuthorityMode = AuthorityMode, As extends AuthorityName = AuthorityName<Authority>> {
107
+ readonly dependencies: HandlerDependencies<DomainValue, Authority>;
108
+ readonly kernel: DomainKernelSessions<Authority>;
109
+ readonly graph: DomainGraphExecutors<DomainValue, Authority>;
110
+ /** A Query v7 under `as`; a V6 Query definition as the executor (`graph.self`). */
111
+ readonly query: DomainQuery<DomainValue, As>;
112
+ /** A Mutation under `as`, or as the executor (`graph.self`). */
113
+ readonly mutate: DomainMutate<DomainValue, As>;
114
+ }
115
+ /**
116
+ * A call to an `anonymous` callable that carries no credential has no caller, and its handler acts
117
+ * as the executor alone. Every other call also selects its authenticated caller. An `anonymous`
118
+ * callable's `query` and `mutate` name the executor alone, whichever call it is.
119
+ */
44
120
  type AuthorityOf<Callable, DomainValue extends Domain> = Callable extends {
45
121
  readonly auth: 'anonymous';
46
- } ? {
122
+ } ? ({
47
123
  readonly caller: AnonymousCaller;
48
- readonly dependencies: null;
49
- readonly kernel: null;
50
- readonly graph: null;
51
- readonly query?: never;
52
- readonly mutate?: never;
53
- } | {
124
+ } & DomainCapabilities<DomainValue, 'self'>) | ({
54
125
  readonly caller: AuthenticatedCaller;
55
- readonly dependencies: HandlerDependencies<DomainValue>;
56
- readonly kernel: DomainKernelSessions;
57
- readonly graph: DomainGraphExecutors<DomainValue>;
58
- /** Convenience executor using the installed Domain authority (`graph.self`). */
59
- readonly query: QueryExecutor<DomainValue>;
60
- /** Convenience executor using the installed Domain authority (`graph.self`). */
61
- readonly mutate: MutationExecutor<DomainValue>;
62
- } : {
126
+ } & DomainCapabilities<DomainValue, AuthorityMode, 'executor'>) : {
63
127
  readonly caller: AuthenticatedCaller;
64
- readonly dependencies: HandlerDependencies<DomainValue>;
65
- readonly kernel: DomainKernelSessions;
66
- readonly graph: DomainGraphExecutors<DomainValue>;
67
- /** Convenience executor using the installed Domain authority (`graph.self`). */
68
- readonly query: QueryExecutor<DomainValue>;
69
- /** Convenience executor using the installed Domain authority (`graph.self`). */
70
- readonly mutate: MutationExecutor<DomainValue>;
71
- };
128
+ } & DomainCapabilities<DomainValue, AuthorityMode>;
72
129
  type SelfOf<Callable> = Callable extends ResolvedMethod<unknown, unknown, false> ? {
73
130
  readonly self: NodeId;
74
131
  } : {
@@ -78,10 +135,14 @@ type SelfOf<Callable> = Callable extends ResolvedMethod<unknown, unknown, false>
78
135
  export type ActionContext<Callable extends ResolvedCallable, DomainValue extends Domain = Domain, Definitions extends Integrations = Readonly<Record<never, never>>, Errors extends DeclaredErrors = NoDeclaredErrors> = {
79
136
  /** Exact admitted Domain retained by the Build being executed. */
80
137
  readonly domain: DomainValue;
81
- readonly input: CallableInputOf<Callable>;
138
+ /**
139
+ * The admitted input, with a file object in place of the receipt at each `file()` field. A file
140
+ * object reads the file with the caller's authority, and a blob Property accepts it as it is.
141
+ */
142
+ readonly input: WithFiles<CallableInputOf<Callable>>;
82
143
  readonly integrations: IntegrationClients<Definitions>;
83
144
  readonly execution: ActionExecution;
84
145
  /** Construct one implementation-declared safe business error for `throw error(...)`. */
85
146
  readonly error: DeclaredErrorFactory<Errors>;
86
- } & AuthorityOf<Callable, DomainValue> & SelfOf<Callable>;
147
+ } & AuthorityOf<Callable, DomainValue> & SelfOf<Callable> & BinaryInputOf<Callable>;
87
148
  export {};
@@ -1,12 +1,12 @@
1
1
  import type { schema } from '../../platform/schema/index.js';
2
2
  import type { DeclaredErrorOptions, DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
3
3
  import type { Integrations } from '../integration/index.js';
4
- import type { Action, ActionAddress, ActionDefinition, CallableAtAddress, ResolvedDomainOf } from './action.js';
4
+ import type { Action, ActionDefinition, CallableAtAddress, ImmediateActionAddress, ResolvedDomainOf } from './action.js';
5
5
  import type { ResolvedCallable } from './context.js';
6
6
  /** Define one simple single-step implementation by its SDK Action address. */
7
7
  export declare function defineAction<Schema extends schema.DomainSchema, Definitions extends Integrations = Readonly<Record<never, never>>>(): {
8
- <const Address extends ActionAddress<Schema>>(address: Address, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, NoDeclaredErrors>): ActionDefinition<Schema, Address, Definitions, NoDeclaredErrors>;
9
- <const Address extends ActionAddress<Schema>, const Errors extends DeclaredErrors>(address: Address, options: DeclaredErrorOptions<Errors>, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, Errors>): ActionDefinition<Schema, Address, Definitions, Errors>;
8
+ <const Address extends ImmediateActionAddress<Schema>>(address: Address, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, NoDeclaredErrors>): ActionDefinition<Schema, Address, Definitions, NoDeclaredErrors>;
9
+ <const Address extends ImmediateActionAddress<Schema>, const Errors extends DeclaredErrors>(address: Address, options: DeclaredErrorOptions<Errors>, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, Errors>): ActionDefinition<Schema, Address, Definitions, Errors>;
10
10
  };
11
11
  /** True only for an Action produced by defineAction in this SDK package root. */
12
12
  export declare function isAction(input: unknown): input is ActionDefinition;
@@ -1,5 +1,7 @@
1
1
  export { defineAction, isAction } from './define.js';
2
2
  export type { Action, ActionAddress, ActionAddressOf, ActionDefinition, CallableAtAddress, LocalCallable, ResolvedDomainOf, } from './action.js';
3
- export type { ActionContext, ActionExecution, AnonymousCaller, AuthenticatedCaller, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, ResolvedCallable, } from './context.js';
3
+ export type { ActionContext, ActionBinaryInput, ActionExecution, AnonymousCaller, AuthenticatedCaller, AuthorityMode, AuthorityName, AuthoritySelection, Caller, DomainCapabilities, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, DomainMutate, DomainQuery, ResolvedCallable, } from './context.js';
4
4
  export type { ActionBinary, ActionOutputOf } from './output.js';
5
+ export { FILE_MEMORY_LIMIT, FileReadError } from '../file/index.js';
6
+ export type { FileReadErrorCode, ReceivedFile, WithFiles } from '../file/index.js';
5
7
  export type { DeclaredErrorDefinition, DeclaredErrorFactory, DeclaredErrorFamily, DeclaredErrorOptions, DeclaredErrors, } from '../error/index.js';
@@ -1 +1,2 @@
1
1
  export { defineAction, isAction } from './define.js';
2
+ export { FILE_MEMORY_LIMIT, FileReadError } from '../file/index.js';