@astrale-os/kernel-core 0.9.0-beta.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/dist/auth/authority/accept.js +4 -0
  2. package/dist/auth/authority/admission/admission.d.ts +4 -1
  3. package/dist/auth/authority/admission/admission.js +46 -147
  4. package/dist/auth/authority/admission/index.d.ts +1 -1
  5. package/dist/auth/authority/admission/index.js +1 -1
  6. package/dist/auth/authority/admission/references.d.ts +13 -0
  7. package/dist/auth/authority/admission/references.js +38 -0
  8. package/dist/auth/authority/admission/term.d.ts +6 -0
  9. package/dist/auth/authority/admission/term.js +60 -0
  10. package/dist/auth/authority/admission/wire.d.ts +8 -0
  11. package/dist/auth/authority/admission/wire.js +33 -0
  12. package/dist/auth/authority/canonical.d.ts +2 -0
  13. package/dist/auth/authority/canonical.js +15 -0
  14. package/dist/auth/authority/index.d.ts +9 -2
  15. package/dist/auth/authority/index.js +6 -1
  16. package/dist/auth/authority/language/index.d.ts +3 -1
  17. package/dist/auth/authority/language/index.js +1 -0
  18. package/dist/auth/authority/language/predicate.d.ts +31 -16
  19. package/dist/auth/authority/language/predicate.js +1 -1
  20. package/dist/auth/authority/language/program.d.ts +21 -0
  21. package/dist/auth/authority/language/program.js +2 -0
  22. package/dist/auth/authority/normalization/index.d.ts +1 -1
  23. package/dist/auth/authority/normalization/index.js +1 -1
  24. package/dist/auth/authority/normalization/normalize.d.ts +2 -0
  25. package/dist/auth/authority/normalization/normalize.js +38 -16
  26. package/dist/auth/authority/ownership.optimization.d.ts +8 -0
  27. package/dist/auth/authority/ownership.optimization.js +83 -0
  28. package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
  29. package/dist/auth/authority/prepare-binder-body.js +31 -0
  30. package/dist/auth/authority/program.d.ts +28 -0
  31. package/dist/auth/authority/program.js +191 -0
  32. package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
  33. package/dist/auth/authority/semantics/class-authority.js +26 -0
  34. package/dist/auth/authority/semantics/composition.d.ts +46 -0
  35. package/dist/auth/authority/semantics/composition.js +150 -0
  36. package/dist/auth/authority/semantics/failure.d.ts +21 -0
  37. package/dist/auth/authority/semantics/failure.js +10 -0
  38. package/dist/auth/authority/semantics/index.d.ts +13 -0
  39. package/dist/auth/authority/semantics/index.js +6 -0
  40. package/dist/auth/authority/semantics/interpret.d.ts +41 -0
  41. package/dist/auth/authority/semantics/interpret.js +388 -0
  42. package/dist/auth/authority/semantics/residual.d.ts +32 -0
  43. package/dist/auth/authority/semantics/residual.js +166 -0
  44. package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
  45. package/dist/auth/authority/semantics/terms.d.ts +22 -0
  46. package/dist/auth/authority/semantics/terms.js +96 -0
  47. package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
  48. package/dist/auth/context/context.d.ts +4 -3
  49. package/dist/auth/expression/authoring/builder.d.ts +2 -11
  50. package/dist/auth/expression/authoring/builder.js +1 -45
  51. package/dist/auth/expression/authoring/index.d.ts +1 -1
  52. package/dist/auth/expression/authoring/index.js +1 -1
  53. package/dist/auth/expression/index.d.ts +1 -2
  54. package/dist/auth/expression/index.js +1 -2
  55. package/dist/auth/expression/language/identity-expression.d.ts +2 -22
  56. package/dist/auth/grant/index.d.ts +1 -1
  57. package/dist/auth/grant/index.js +1 -1
  58. package/dist/auth/grant/resolved/admission.d.ts +4 -3
  59. package/dist/auth/grant/resolved/admission.js +23 -13
  60. package/dist/auth/grant/resolved/grant.d.ts +1 -1
  61. package/dist/auth/grant/resolved/index.d.ts +1 -1
  62. package/dist/auth/grant/resolved/index.js +1 -1
  63. package/dist/auth/grant/unresolved/admission.d.ts +4 -1
  64. package/dist/auth/grant/unresolved/admission.js +27 -67
  65. package/dist/auth/grant/unresolved/limits.d.ts +2 -4
  66. package/dist/auth/grant/unresolved/limits.js +1 -5
  67. package/dist/auth/identity/admission.js +11 -3
  68. package/dist/auth/identity/identity.d.ts +15 -3
  69. package/dist/auth/identity/index.d.ts +1 -1
  70. package/dist/auth/index.d.ts +4 -4
  71. package/dist/auth/index.js +1 -1
  72. package/dist/auth/jwk/index.d.ts +1 -1
  73. package/dist/auth/jwk/index.js +1 -1
  74. package/dist/auth/jwk/thumbprint.d.ts +2 -0
  75. package/dist/auth/jwk/thumbprint.js +12 -6
  76. package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
  77. package/dist/auth/register/fingerprint/fingerprint.js +31 -0
  78. package/dist/auth/register/fingerprint/index.d.ts +2 -0
  79. package/dist/auth/register/index.d.ts +5 -0
  80. package/dist/auth/register/request/admission.d.ts +3 -0
  81. package/dist/auth/register/request/admission.js +103 -0
  82. package/dist/auth/register/request/index.d.ts +3 -0
  83. package/dist/auth/register/request/limits.d.ts +6 -0
  84. package/dist/auth/register/request/limits.js +6 -0
  85. package/dist/auth/register/request/request.d.ts +19 -0
  86. package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
  87. package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
  88. package/dist/auth/register/result/index.d.ts +1 -0
  89. package/dist/auth/register/result/result.d.ts +10 -0
  90. package/dist/auth/register/result/result.js +1 -0
  91. package/dist/callable/contract/body.d.ts +10 -0
  92. package/dist/callable/contract/body.js +7 -0
  93. package/dist/callable/contract/index.d.ts +2 -1
  94. package/dist/callable/contract/index.js +1 -1
  95. package/dist/callable/contract/output.d.ts +18 -2
  96. package/dist/callable/index.d.ts +3 -2
  97. package/dist/callable/index.js +2 -1
  98. package/dist/callable/invocation/call.d.ts +16 -2
  99. package/dist/callable/invocation/call.js +41 -1
  100. package/dist/callable/invocation/index.d.ts +1 -1
  101. package/dist/callable/invocation/index.js +1 -1
  102. package/dist/callable/invocation/result.d.ts +10 -3
  103. package/dist/dns-label.d.ts +1 -2
  104. package/dist/dns-label.js +2 -3
  105. package/dist/graph/graph/graph.d.ts +1 -5
  106. package/dist/graph/graph/graph.js +3 -27
  107. package/dist/graph/graph/index.d.ts +2 -4
  108. package/dist/graph/graph/index.js +2 -3
  109. package/dist/graph/graph/model/codec.js +4 -4
  110. package/dist/graph/graph/model/index.d.ts +1 -1
  111. package/dist/graph/graph/model/index.js +1 -1
  112. package/dist/graph/graph/model/model.d.ts +7 -7
  113. package/dist/graph/graph/model/model.js +6 -6
  114. package/dist/graph/graph/model/wire.d.ts +58 -78
  115. package/dist/graph/graph/model/wire.js +18 -19
  116. package/dist/graph/mutate/authoring/builder.d.ts +2 -2
  117. package/dist/graph/mutate/authoring/builder.js +2 -2
  118. package/dist/graph/mutate/authoring/create.js +13 -5
  119. package/dist/graph/mutate/index.d.ts +1 -1
  120. package/dist/graph/mutate/language/codec.js +3 -3
  121. package/dist/graph/mutate/language/model.d.ts +4 -4
  122. package/dist/graph/mutate/language/wire.d.ts +226 -215
  123. package/dist/graph/mutate/language/wire.js +42 -47
  124. package/dist/graph/mutate/result/index.d.ts +4 -3
  125. package/dist/graph/mutate/result/index.js +8 -6
  126. package/dist/graph/mutate/result/wire.d.ts +4 -4
  127. package/dist/graph/mutate/result/wire.js +7 -4
  128. package/dist/graph/node/identity/id.d.ts +0 -4
  129. package/dist/graph/node/identity/id.js +0 -5
  130. package/dist/graph/node/identity/order.js +20 -0
  131. package/dist/graph/path/authoring/path.d.ts +8 -5
  132. package/dist/graph/path/authoring/path.js +21 -3
  133. package/dist/graph/path/language/model.d.ts +8 -3
  134. package/dist/graph/path/language/syntax.js +23 -8
  135. package/dist/graph/query/authoring/builder.js +37 -5
  136. package/dist/graph/query/authoring/model.d.ts +20 -1
  137. package/dist/graph/query/index.d.ts +4 -2
  138. package/dist/graph/query/index.js +1 -0
  139. package/dist/graph/query/language/codec.js +18 -3
  140. package/dist/graph/query/language/fingerprint.js +8 -0
  141. package/dist/graph/query/language/model.d.ts +22 -4
  142. package/dist/graph/query/language/wire.d.ts +124 -114
  143. package/dist/graph/query/language/wire.js +54 -47
  144. package/dist/graph/query/order/index.d.ts +53 -0
  145. package/dist/graph/query/order/index.js +79 -0
  146. package/dist/graph/query/reference/evaluate.d.ts +1 -0
  147. package/dist/graph/query/reference/evaluate.js +39 -52
  148. package/dist/graph/query/result/index.js +1 -1
  149. package/dist/graph/query/result/wire.d.ts +93 -94
  150. package/dist/graph/query/result/wire.js +20 -20
  151. package/dist/graph/reconcile/condition/model.d.ts +2 -2
  152. package/dist/graph/reconcile/condition/references.d.ts +0 -1
  153. package/dist/graph/reconcile/condition/references.js +4 -4
  154. package/dist/graph/reconcile/correspondence.d.ts +9 -8
  155. package/dist/graph/reconcile/evidence.d.ts +2 -2
  156. package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
  157. package/dist/graph/reconcile/observation.d.ts +4 -3
  158. package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
  159. package/dist/graph/reconcile/planning/canonical.js +28 -0
  160. package/dist/graph/reconcile/planning/context.d.ts +3 -3
  161. package/dist/graph/reconcile/planning/model.d.ts +8 -4
  162. package/dist/graph/reconcile/planning/plan.js +2 -1
  163. package/dist/schema/authority/authority-relation.js +3 -0
  164. package/dist/schema/authority/claims.d.ts +24 -25
  165. package/dist/schema/authority/claims.js +8 -8
  166. package/dist/schema/authority/governed-by.d.ts +16 -91
  167. package/dist/schema/authority/governed-by.js +1 -1
  168. package/dist/schema/authority/operation-node.d.ts +27 -13
  169. package/dist/schema/authority/operations.d.ts +8 -168
  170. package/dist/schema/authority/policy.d.ts +27 -15
  171. package/dist/schema/authority/vocabulary.d.ts +3 -0
  172. package/dist/schema/authority/vocabulary.js +25 -0
  173. package/dist/schema/callables/entrypoint.d.ts +32 -0
  174. package/dist/schema/callables/entrypoint.js +12 -0
  175. package/dist/schema/callables/execution.d.ts +569 -0
  176. package/dist/schema/callables/execution.js +32 -0
  177. package/dist/schema/callables/function.d.ts +3400 -55
  178. package/dist/schema/callables/function.js +6 -4
  179. package/dist/schema/callables/index.d.ts +2 -1
  180. package/dist/schema/callables/index.js +2 -1
  181. package/dist/schema/callables/method-of.d.ts +18 -143
  182. package/dist/schema/callables/method-of.js +2 -2
  183. package/dist/schema/callables/view.d.ts +83 -51
  184. package/dist/schema/definitions/class.d.ts +45 -33
  185. package/dist/schema/definitions/extends.d.ts +16 -110
  186. package/dist/schema/definitions/instance-of.d.ts +17 -69
  187. package/dist/schema/domain/domain.d.ts +3343 -148
  188. package/dist/schema/domain/domain.js +6 -3
  189. package/dist/schema/domain/of-domain.d.ts +18 -192
  190. package/dist/schema/domain/of-domain.js +1 -1
  191. package/dist/schema/identity/composition.d.ts +5 -0
  192. package/dist/schema/identity/composition.js +5 -0
  193. package/dist/schema/identity/identity.d.ts +225 -122
  194. package/dist/schema/identity/identity.js +3 -4
  195. package/dist/schema/index.d.ts +1 -0
  196. package/dist/schema/index.js +1 -0
  197. package/dist/schema/installation/operation-id.d.ts +1 -2
  198. package/dist/schema/installation/operation-id.js +2 -4
  199. package/dist/schema/introspection/index.d.ts +1 -1
  200. package/dist/schema/introspection/language.d.ts +12 -28
  201. package/dist/schema/kernel/projection/callables.js +2 -3
  202. package/dist/schema/kernel/projection/core.d.ts +7 -0
  203. package/dist/schema/kernel/projection/core.js +51 -0
  204. package/dist/schema/kernel/projection/definitions.d.ts +13 -0
  205. package/dist/schema/kernel/projection/definitions.js +71 -0
  206. package/dist/schema/kernel/projection/index.d.ts +3 -3
  207. package/dist/schema/kernel/projection/index.js +2 -2
  208. package/dist/schema/kernel/projection/methods.d.ts +5 -0
  209. package/dist/schema/kernel/projection/methods.js +41 -0
  210. package/dist/schema/kernel/projection/part.d.ts +34 -0
  211. package/dist/schema/kernel/projection/part.js +42 -0
  212. package/dist/schema/kernel/projection/paths.d.ts +6 -0
  213. package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
  214. package/dist/schema/kernel/projection/project.d.ts +4 -2
  215. package/dist/schema/kernel/projection/project.js +33 -258
  216. package/dist/schema/kernel/projection/properties.d.ts +11 -0
  217. package/dist/schema/kernel/projection/properties.js +36 -0
  218. package/dist/schema/kernel/projection/relations.d.ts +7 -0
  219. package/dist/schema/kernel/projection/relations.js +61 -0
  220. package/dist/schema/kernel/projection/types.d.ts +28 -2
  221. package/dist/schema/kernel/schema.d.ts +9008 -4939
  222. package/dist/schema/kernel/schema.js +12 -8
  223. package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
  224. package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
  225. package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
  226. package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
  227. package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
  228. package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
  229. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
  230. package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
  231. package/dist/schema/kernel/syscalls/contracts/execution.d.ts +300 -0
  232. package/dist/schema/kernel/syscalls/contracts/execution.js +116 -0
  233. package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
  234. package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
  235. package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
  236. package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
  237. package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
  238. package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
  239. package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
  240. package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
  241. package/dist/schema/kernel/syscalls/contracts/install.d.ts +309 -217
  242. package/dist/schema/kernel/syscalls/contracts/install.js +68 -26
  243. package/dist/schema/kernel/syscalls/contracts/installation.d.ts +70 -351
  244. package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
  245. package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
  246. package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
  247. package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
  248. package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
  249. package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
  250. package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
  251. package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
  252. package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
  253. package/dist/schema/kernel/syscalls/contracts/query.d.ts +239 -222
  254. package/dist/schema/kernel/syscalls/contracts/query.js +17 -15
  255. package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
  256. package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
  257. package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +55 -148
  258. package/dist/schema/kernel/syscalls/contracts/uninstall.js +7 -5
  259. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
  260. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
  261. package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
  262. package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
  263. package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
  264. package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
  265. package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
  266. package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
  267. package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
  268. package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
  269. package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
  270. package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
  271. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
  272. package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
  273. package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
  274. package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
  275. package/dist/schema/kernel/syscalls/declarations/execution.d.ts +255 -0
  276. package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
  277. package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
  278. package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
  279. package/dist/schema/kernel/syscalls/declarations/index.d.ts +1079 -1323
  280. package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
  281. package/dist/schema/kernel/syscalls/declarations/install.d.ts +85 -172
  282. package/dist/schema/kernel/syscalls/declarations/install.js +7 -3
  283. package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
  284. package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
  285. package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
  286. package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
  287. package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
  288. package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
  289. package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
  290. package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
  291. package/dist/schema/kernel/syscalls/declarations/query.d.ts +236 -260
  292. package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
  293. package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
  294. package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
  295. package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +51 -153
  296. package/dist/schema/kernel/syscalls/declarations/uninstall.js +6 -2
  297. package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
  298. package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
  299. package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
  300. package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
  301. package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
  302. package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
  303. package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
  304. package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
  305. package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
  306. package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
  307. package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +303 -0
  308. package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
  309. package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
  310. package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
  311. package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
  312. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
  313. package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
  314. package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
  315. package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
  316. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
  317. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
  318. package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
  319. package/dist/schema/kernel/syscalls/index.d.ts +2 -2
  320. package/dist/schema/kernel/syscalls/index.js +2 -2
  321. package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
  322. package/dist/schema/kernel/syscalls/references/execution.js +13 -0
  323. package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
  324. package/dist/schema/kernel/syscalls/references/functions.js +3 -1
  325. package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
  326. package/dist/schema/kernel/syscalls/references/identity.js +1 -0
  327. package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
  328. package/dist/schema/kernel/syscalls/references/index.js +2 -1
  329. package/dist/schema/meta/created-by.d.ts +32 -0
  330. package/dist/schema/meta/created-by.js +17 -0
  331. package/dist/schema/meta/descriptable.d.ts +13 -11
  332. package/dist/schema/meta/edge.d.ts +5 -9
  333. package/dist/schema/meta/iconable.d.ts +13 -11
  334. package/dist/schema/meta/index.d.ts +1 -0
  335. package/dist/schema/meta/index.js +1 -0
  336. package/dist/schema/meta/named.d.ts +13 -9
  337. package/dist/schema/meta/node.d.ts +9 -1
  338. package/dist/schema/meta/remotable.d.ts +15 -22
  339. package/dist/schema/meta/statused.d.ts +13 -7
  340. package/dist/schema/meta/timestamped.d.ts +14 -12
  341. package/package.json +9 -7
  342. package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
  343. package/dist/auth/expression/normalization/canonicalize.js +0 -102
  344. package/dist/auth/expression/normalization/index.d.ts +0 -2
  345. package/dist/auth/expression/normalization/index.js +0 -2
  346. package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
  347. package/dist/auth/expression/normalization/raise-denials.js +0 -59
  348. package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
  349. package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
  350. package/dist/auth/provision/fingerprint/index.d.ts +0 -2
  351. package/dist/auth/provision/index.d.ts +0 -5
  352. package/dist/auth/provision/request/admission.d.ts +0 -3
  353. package/dist/auth/provision/request/admission.js +0 -125
  354. package/dist/auth/provision/request/index.d.ts +0 -3
  355. package/dist/auth/provision/request/request.d.ts +0 -29
  356. package/dist/auth/provision/result/index.d.ts +0 -1
  357. package/dist/auth/provision/result/result.d.ts +0 -12
  358. package/dist/graph/graph/navigation/error.d.ts +0 -12
  359. package/dist/graph/graph/navigation/error.js +0 -20
  360. package/dist/graph/graph/navigation/index.d.ts +0 -2
  361. package/dist/graph/graph/navigation/index.js +0 -1
  362. package/dist/graph/graph/navigation/model.d.ts +0 -15
  363. package/dist/schema/callables/view-for.d.ts +0 -296
  364. package/dist/schema/callables/view-for.js +0 -12
  365. package/dist/schema/kernel/projection/keys.d.ts +0 -3
  366. package/dist/schema/kernel/projection/path.d.ts +0 -2
  367. package/dist/schema/kernel/projection/path.js +0 -140
  368. package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
  369. package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
  370. package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
  371. package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
  372. package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
  373. package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
  374. /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
  375. /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
  376. /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
  377. /package/dist/auth/{provision → register}/index.js +0 -0
  378. /package/dist/auth/{provision → register}/request/index.js +0 -0
  379. /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
  380. /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
@@ -1,17 +1,17 @@
1
1
  import { AuthValueError } from '../../error.js';
2
- import { EXPRESSION_DEPTH_LIMIT, EXPRESSION_OPERAND_LIMIT, } from '../../expression/normalization/index.js';
3
- import { CREDENTIAL_BYTES_LIMIT, CREDENTIAL_NESTING_DEPTH_LIMIT } from './limits.js';
4
- /** Admit the exact bounded unresolved Grant wire language. */
2
+ import { CREDENTIAL_BYTES_LIMIT } from './limits.js';
3
+ const COMPOUND = new Set(['union', 'intersect', 'exclude']);
4
+ /**
5
+ * Admit the exact version-1 unresolved Grant claim: exactly one `self` or one credential leaf.
6
+ * Compound structure is refused before any nested credential could be verified.
7
+ */
5
8
  export function acceptUnresolved(input) {
6
9
  try {
7
10
  const value = record(input, '');
8
11
  exact(value, ['expr', 'v'], '');
9
12
  if (data(value, 'v', '/v') !== 1)
10
13
  invalid('/v', 'Unsupported unresolved Grant version');
11
- return Object.freeze({
12
- v: 1,
13
- expr: expression(data(value, 'expr', '/expr'), '/expr', 0, 0, new WeakSet()),
14
- });
14
+ return Object.freeze({ v: 1, expr: leaf(data(value, 'expr', '/expr'), '/expr') });
15
15
  }
16
16
  catch (cause) {
17
17
  if (cause instanceof AuthValueError)
@@ -21,61 +21,29 @@ export function acceptUnresolved(input) {
21
21
  });
22
22
  }
23
23
  }
24
- function expression(input, path, depth, credentialDepth, active) {
25
- if (depth > EXPRESSION_DEPTH_LIMIT)
26
- invalid(path, 'Identity expression exceeds its depth limit');
24
+ function leaf(input, path) {
27
25
  const value = record(input, path);
28
- if (active.has(value))
29
- invalid(path, 'Cyclic Identity expressions are not supported');
30
- active.add(value);
31
- try {
32
- const kind = data(value, 'kind', `${path}/kind`);
33
- switch (kind) {
34
- case 'identity': {
35
- const hasSelf = own(value, 'self');
36
- const hasCredential = own(value, 'credential');
37
- if (hasSelf === hasCredential)
38
- invalid(path, 'Expected exactly one unresolved Identity leaf');
39
- if (hasSelf) {
40
- exact(value, ['kind', 'self'], path);
41
- if (data(value, 'self', `${path}/self`) !== true)
42
- invalid(`${path}/self`, 'Expected true');
43
- return Object.freeze({ kind: 'identity', self: true });
44
- }
45
- exact(value, ['credential', 'kind'], path);
46
- if (credentialDepth >= CREDENTIAL_NESTING_DEPTH_LIMIT) {
47
- invalid(`${path}/credential`, 'Credential nesting exceeds its limit');
48
- }
49
- return Object.freeze({
50
- kind: 'identity',
51
- credential: credential(data(value, 'credential', `${path}/credential`), `${path}/credential`),
52
- });
53
- }
54
- case 'union':
55
- case 'intersect': {
56
- exact(value, ['kind', 'operands'], path);
57
- const operands = list(data(value, 'operands', `${path}/operands`), `${path}/operands`, 2);
58
- return Object.freeze({
59
- kind,
60
- operands: Object.freeze(operands.map((operand, index) => expression(operand, `${path}/operands/${index}`, depth + 1, credentialDepth, active))),
61
- });
62
- }
63
- case 'exclude': {
64
- exact(value, ['base', 'excluded', 'kind'], path);
65
- const excluded = list(data(value, 'excluded', `${path}/excluded`), `${path}/excluded`, 1);
66
- return Object.freeze({
67
- kind: 'exclude',
68
- base: expression(data(value, 'base', `${path}/base`), `${path}/base`, depth + 1, credentialDepth, active),
69
- excluded: Object.freeze(excluded.map((operand, index) => expression(operand, `${path}/excluded/${index}`, depth + 1, credentialDepth, active))),
70
- });
71
- }
72
- default:
73
- invalid(`${path}/kind`, 'Expected identity, union, intersect, or exclude');
74
- }
26
+ const kind = data(value, 'kind', `${path}/kind`);
27
+ if (typeof kind === 'string' && COMPOUND.has(kind)) {
28
+ throw new AuthValueError('AUTH_GRANT_COMPOUND', 'Unresolved Grant must name exactly one Identity', path);
29
+ }
30
+ if (kind !== 'identity')
31
+ invalid(`${path}/kind`, 'Expected identity');
32
+ const hasSelf = own(value, 'self');
33
+ if (hasSelf === own(value, 'credential')) {
34
+ invalid(path, 'Expected exactly one unresolved Identity leaf');
75
35
  }
76
- finally {
77
- active.delete(value);
36
+ if (hasSelf) {
37
+ exact(value, ['kind', 'self'], path);
38
+ if (data(value, 'self', `${path}/self`) !== true)
39
+ invalid(`${path}/self`, 'Expected true');
40
+ return Object.freeze({ kind: 'identity', self: true });
78
41
  }
42
+ exact(value, ['credential', 'kind'], path);
43
+ return Object.freeze({
44
+ kind: 'identity',
45
+ credential: credential(data(value, 'credential', `${path}/credential`), `${path}/credential`),
46
+ });
79
47
  }
80
48
  function credential(input, path) {
81
49
  if (typeof input === 'string') {
@@ -120,14 +88,6 @@ function exact(input, expected, path) {
120
88
  invalid(path, `Expected exactly ${expected.join(', ')}`);
121
89
  }
122
90
  }
123
- function list(input, path, minimum) {
124
- if (!Array.isArray(input) || input.length < minimum || input.length > EXPRESSION_OPERAND_LIMIT) {
125
- invalid(path, `Expected ${minimum}-${EXPRESSION_OPERAND_LIMIT} operands`);
126
- }
127
- if (Object.keys(input).length !== input.length)
128
- invalid(path, 'Expected a dense array');
129
- return input;
130
- }
131
91
  function compare(left, right) {
132
92
  return left < right ? -1 : left > right ? 1 : 0;
133
93
  }
@@ -1,7 +1,5 @@
1
- export declare const CREDENTIAL_NESTING_DEPTH_LIMIT = 3;
2
1
  export declare const CREDENTIAL_BYTES_LIMIT: number;
3
2
  export declare const limits: {
4
- readonly expressionDepth: 32;
5
- readonly operandsPerExpression: 64;
6
- readonly credentialNestingDepth: 3;
3
+ /** One nested Kernel delegation proof; proofs never nest further. */
4
+ readonly credentialNestingDepth: 1;
7
5
  };
@@ -1,8 +1,4 @@
1
- import { EXPRESSION_DEPTH_LIMIT, EXPRESSION_OPERAND_LIMIT, } from '../../expression/normalization/index.js';
2
- export const CREDENTIAL_NESTING_DEPTH_LIMIT = 3;
3
1
  export const CREDENTIAL_BYTES_LIMIT = 64 * 1024;
4
2
  export const limits = Object.freeze({
5
- expressionDepth: EXPRESSION_DEPTH_LIMIT,
6
- operandsPerExpression: EXPRESSION_OPERAND_LIMIT,
7
- credentialNestingDepth: CREDENTIAL_NESTING_DEPTH_LIMIT,
3
+ credentialNestingDepth: 1,
8
4
  });
@@ -7,11 +7,19 @@ import { accept as acceptIssuer } from '../issuer/index.js';
7
7
  export function accept(input) {
8
8
  try {
9
9
  const value = object(portable.accept(input), '');
10
- exact(value, ['frozen', 'id', 'issuer', 'requiredClaims', 'subject'], '');
10
+ exact(value, ['frozen', 'id', 'iss', 'requiredClaims', 'sub'], '');
11
+ const hasIssuer = value.iss !== undefined;
12
+ const hasSubject = value.sub !== undefined;
13
+ if (hasIssuer !== hasSubject)
14
+ invalid('', 'Expected both iss and sub or neither');
11
15
  return Object.freeze({
12
16
  id: NodeId(text(value.id, '/id')),
13
- issuer: acceptIssuer(text(value.issuer, '/issuer')),
14
- subject: text(value.subject, '/subject'),
17
+ ...(hasIssuer
18
+ ? {
19
+ iss: acceptIssuer(text(value.iss, '/iss')),
20
+ sub: text(value.sub, '/sub'),
21
+ }
22
+ : {}),
15
23
  frozen: value.frozen === undefined ? false : boolean(value.frozen, '/frozen'),
16
24
  requiredClaims: constraints(value.requiredClaims, '/requiredClaims'),
17
25
  });
@@ -4,11 +4,23 @@ import type { IssuerId } from '../issuer/index.js';
4
4
  /** Stable graph identity of one authenticated principal. */
5
5
  export type IdentityId = NodeId;
6
6
  export type Subject = string;
7
+ /** One complete authentication assertion at an API boundary. */
8
+ export interface Authentication {
9
+ readonly iss: IssuerId;
10
+ readonly sub: Subject;
11
+ }
7
12
  /** Normalized Identity value used at authentication boundaries, not a complete graph Node. */
8
- export interface Identity {
13
+ interface IdentityBase {
9
14
  readonly id: IdentityId;
10
- readonly issuer: IssuerId;
11
- readonly subject: Subject;
12
15
  readonly frozen: boolean;
13
16
  readonly requiredClaims: readonly ClaimConstraint[];
14
17
  }
18
+ /** A stable principal with either both protected authentication facts or neither. */
19
+ export type Identity = IdentityBase & ({
20
+ readonly iss?: never;
21
+ readonly sub?: never;
22
+ } | {
23
+ readonly iss: IssuerId;
24
+ readonly sub: Subject;
25
+ });
26
+ export {};
@@ -1,3 +1,3 @@
1
1
  export { accept } from './admission.js';
2
2
  export { verify, verifyFrozen } from './verification.js';
3
- export type { Identity, IdentityId, Subject } from './identity.js';
3
+ export type { Authentication, Identity, IdentityId, Subject } from './identity.js';
@@ -1,16 +1,16 @@
1
1
  export { AuthValueError } from './error.js';
2
2
  export type { Attestation } from './attestation/index.js';
3
- export type { AuthorityExpr, AuthorityPredicate } from './authority/language/index.js';
3
+ export type { AuthorityExpr, AuthorityPredicate, AuthorityProgram, PredicateRef, ClosedEdgeExtent, } from './authority/language/index.js';
4
4
  export type { ClaimConstraint } from './claims/index.js';
5
5
  export type { AuthenticationEvidence, AuthenticationMethod, CredentialAudience, CredentialInput, MintedCredential, UnverifiedCredential, VerifiedCredential, } from './credential/index.js';
6
6
  export type { AuthContext, Authenticated, CredentialContext } from './context/index.js';
7
7
  export type { Delegation, DelegationCredential } from './delegation/index.js';
8
8
  export type { IdentityExpr, SelfIdentityExpr, UnresolvedIdentityExpr } from './expression/index.js';
9
9
  export type { Grant, UnresolvedGrant } from './grant/index.js';
10
- export type { Identity, IdentityId, Subject } from './identity/index.js';
10
+ export type { Authentication, Identity, IdentityId, Subject } from './identity/index.js';
11
11
  export type { IssuerId } from './issuer/index.js';
12
12
  export type { JsonWebKey, KeyId } from './jwk/index.js';
13
- export type { AssertedIdentityProvision, IdentityProvisionInput, ProvisionFingerprint, ProvisionRequest, ProvisionResult, ProvisionedIdentity, RequiredClaims, SelfIdentityProvision, } from './provision/index.js';
13
+ export type { IdentityRegistration, RegisterFingerprint, RegisterFingerprintIdentity, RegisterFingerprintInput, RegisterRequest, RegisterResult, RegisteredIdentity, } from './register/index.js';
14
14
  export type { AuthenticationCandidate, AuthenticationTrust, StringPatternSet, TrustDecision, TrustRule, } from './trust/index.js';
15
15
  export * as attestation from './attestation/index.js';
16
16
  export * as authority from './authority/index.js';
@@ -22,5 +22,5 @@ export * as grant from './grant/index.js';
22
22
  export * as identity from './identity/index.js';
23
23
  export * as issuer from './issuer/index.js';
24
24
  export * as jwk from './jwk/index.js';
25
- export * as provision from './provision/index.js';
25
+ export * as register from './register/index.js';
26
26
  export * as trust from './trust/index.js';
@@ -9,5 +9,5 @@ export * as grant from './grant/index.js';
9
9
  export * as identity from './identity/index.js';
10
10
  export * as issuer from './issuer/index.js';
11
11
  export * as jwk from './jwk/index.js';
12
- export * as provision from './provision/index.js';
12
+ export * as register from './register/index.js';
13
13
  export * as trust from './trust/index.js';
@@ -1,3 +1,3 @@
1
1
  export { acceptPublic } from './public-key.js';
2
- export { thumbprint } from './thumbprint.js';
2
+ export { thumbprint, thumbprintMembers } from './thumbprint.js';
3
3
  export type { JsonWebKey, KeyId } from './public-key.js';
@@ -1,2 +1,2 @@
1
1
  export { acceptPublic } from './public-key.js';
2
- export { thumbprint } from './thumbprint.js';
2
+ export { thumbprint, thumbprintMembers } from './thumbprint.js';
@@ -1,3 +1,5 @@
1
1
  import type { JsonWebKey } from './public-key.js';
2
2
  /** Compute the RFC 7638 SHA-256 thumbprint of an admitted public key. */
3
3
  export declare function thumbprint(input: JsonWebKey): Promise<string>;
4
+ /** Return the exact RFC 7638 members that identify one public key's cryptographic material. */
5
+ export declare function thumbprintMembers(input: JsonWebKey): Readonly<Record<string, string>>;
@@ -1,19 +1,25 @@
1
1
  import { acceptPublic } from './public-key.js';
2
2
  /** Compute the RFC 7638 SHA-256 thumbprint of an admitted public key. */
3
3
  export async function thumbprint(input) {
4
- const key = acceptPublic(input);
5
- const canonical = JSON.stringify(members(key));
4
+ const canonical = JSON.stringify(thumbprintMembers(input));
6
5
  const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(canonical)));
7
6
  return base64url(digest);
8
7
  }
9
- function members(key) {
8
+ /** Return the exact RFC 7638 members that identify one public key's cryptographic material. */
9
+ export function thumbprintMembers(input) {
10
+ const key = acceptPublic(input);
10
11
  if (key.kty === 'EC') {
11
- return { crv: key.crv, kty: key.kty, x: key.x, y: key.y };
12
+ return Object.freeze({
13
+ crv: key.crv,
14
+ kty: key.kty,
15
+ x: key.x,
16
+ y: key.y,
17
+ });
12
18
  }
13
19
  if (key.kty === 'RSA') {
14
- return { e: key.e, kty: key.kty, n: key.n };
20
+ return Object.freeze({ e: key.e, kty: key.kty, n: key.n });
15
21
  }
16
- return { crv: key.crv, kty: key.kty, x: key.x };
22
+ return Object.freeze({ crv: key.crv, kty: key.kty, x: key.x });
17
23
  }
18
24
  function base64url(input) {
19
25
  let binary = '';
@@ -0,0 +1,25 @@
1
+ import type { Authentication, IdentityId } from '../../identity/index.js';
2
+ import type { JsonWebKey } from '../../jwk/index.js';
3
+ declare const REGISTER_FINGERPRINT: unique symbol;
4
+ /** Digest of the semantic request. Credential bytes and verifier evidence are excluded. */
5
+ export type RegisterFingerprint = `sha256:${string}` & {
6
+ readonly [REGISTER_FINGERPRINT]: true;
7
+ };
8
+ export type RegisterFingerprintIdentity = {
9
+ readonly id: IdentityId;
10
+ readonly mode: 'external';
11
+ readonly authentication: Authentication;
12
+ readonly publicKey?: never;
13
+ } | {
14
+ readonly id: IdentityId;
15
+ readonly mode: 'self';
16
+ readonly authentication: Authentication;
17
+ readonly publicKey: JsonWebKey;
18
+ };
19
+ export interface RegisterFingerprintInput {
20
+ readonly idempotencyKey: string;
21
+ readonly identities: readonly [RegisterFingerprintIdentity, ...RegisterFingerprintIdentity[]];
22
+ }
23
+ /** Compute a deterministic post-verification digest without retaining credential evidence. */
24
+ export declare function fingerprint(input: RegisterFingerprintInput): Promise<RegisterFingerprint>;
25
+ export {};
@@ -0,0 +1,31 @@
1
+ import * as portable from '@astrale-os/kernel-dsl/value';
2
+ import { thumbprint as jwkThumbprint } from '../../jwk/index.js';
3
+ /** Compute a deterministic post-verification digest without retaining credential evidence. */
4
+ export async function fingerprint(input) {
5
+ const identities = await Promise.all([...input.identities]
6
+ .sort((left, right) => compare(left.id, right.id))
7
+ .map(async (identity) => ({
8
+ id: identity.id,
9
+ mode: identity.mode,
10
+ iss: identity.authentication.iss,
11
+ sub: identity.authentication.sub,
12
+ ...(identity.mode === 'self' ? { publication: await publication(identity.publicKey) } : {}),
13
+ })));
14
+ const encoded = portable.json.encode(portable.accept({ version: 2, idempotencyKey: input.idempotencyKey, identities }));
15
+ const digest = await crypto.subtle.digest('SHA-256', Uint8Array.from(encoded).buffer);
16
+ return `sha256:${hex(new Uint8Array(digest))}`;
17
+ }
18
+ async function publication(publicKey) {
19
+ const thumbprint = await jwkThumbprint(publicKey);
20
+ return Object.freeze({
21
+ key: publicKey,
22
+ thumbprint,
23
+ slot: publicKey.kid === undefined ? `thumbprint:${thumbprint}` : `kid:${publicKey.kid}`,
24
+ });
25
+ }
26
+ function hex(input) {
27
+ return [...input].map((value) => value.toString(16).padStart(2, '0')).join('');
28
+ }
29
+ function compare(left, right) {
30
+ return left < right ? -1 : left > right ? 1 : 0;
31
+ }
@@ -0,0 +1,2 @@
1
+ export { fingerprint } from './fingerprint.js';
2
+ export type { RegisterFingerprint, RegisterFingerprintIdentity, RegisterFingerprintInput, } from './fingerprint.js';
@@ -0,0 +1,5 @@
1
+ export { fingerprint } from './fingerprint/index.js';
2
+ export type { RegisterFingerprint, RegisterFingerprintIdentity, RegisterFingerprintInput, } from './fingerprint/index.js';
3
+ export { accept, isSelfIssuer, selfIssuer } from './request/index.js';
4
+ export type { IdentityRegistration, RegisterRequest } from './request/index.js';
5
+ export type { RegisteredIdentity, RegisterResult } from './result/index.js';
@@ -0,0 +1,3 @@
1
+ import type { RegisterRequest } from './request.js';
2
+ /** Admit unknown input into the exact immutable existing-target Register language. */
3
+ export declare function accept(input: unknown): RegisterRequest;
@@ -0,0 +1,103 @@
1
+ import { NodeId } from '../../../graph/node/index.js';
2
+ import { AuthValueError } from '../../error.js';
3
+ import { acceptPublic } from '../../jwk/index.js';
4
+ import { REGISTER_REQUEST_LIMITS } from './limits.js';
5
+ const textEncoder = new TextEncoder();
6
+ /** Admit unknown input into the exact immutable existing-target Register language. */
7
+ export function accept(input) {
8
+ if (!isRecord(input))
9
+ invalid('', 'Expected a Register request object');
10
+ exact(input, ['idempotencyKey', 'identities'], '');
11
+ if (typeof input.idempotencyKey !== 'string' ||
12
+ input.idempotencyKey.length === 0 ||
13
+ input.idempotencyKey.length > REGISTER_REQUEST_LIMITS.idempotencyKeyCharacters ||
14
+ textEncoder.encode(input.idempotencyKey).byteLength >
15
+ REGISTER_REQUEST_LIMITS.idempotencyKeyBytes) {
16
+ invalid('/idempotencyKey', 'Expected a bounded non-empty idempotency key');
17
+ }
18
+ if (!Array.isArray(input.identities) ||
19
+ input.identities.length === 0 ||
20
+ input.identities.length > REGISTER_REQUEST_LIMITS.identities) {
21
+ invalid('/identities', 'Expected a bounded non-empty Identity register array');
22
+ }
23
+ const identities = input.identities
24
+ .map((candidate, index) => identityInput(candidate, `/identities/${index}`))
25
+ .sort((left, right) => compare(left.id, right.id));
26
+ for (let index = 1; index < identities.length; index += 1) {
27
+ if (identities[index - 1].id === identities[index].id) {
28
+ invalid(`/identities/${index}/id`, 'Duplicate Identity target');
29
+ }
30
+ }
31
+ return Object.freeze({
32
+ idempotencyKey: input.idempotencyKey,
33
+ identities: Object.freeze(identities),
34
+ });
35
+ }
36
+ function identityInput(input, path) {
37
+ if (!isRecord(input))
38
+ invalid(path, 'Expected an Identity register object');
39
+ if (input.mode !== 'external' && input.mode !== 'self') {
40
+ invalid(`${path}/mode`, 'Expected external or self');
41
+ }
42
+ exact(input, input.mode === 'self'
43
+ ? ['credential', 'id', 'mode', 'publicKey']
44
+ : ['credential', 'id', 'mode'], path);
45
+ let id;
46
+ try {
47
+ if (typeof input.id !== 'string')
48
+ throw new TypeError('IdentityId must be text.');
49
+ id = NodeId(input.id);
50
+ }
51
+ catch (cause) {
52
+ invalid(`${path}/id`, 'Expected an IdentityId', cause);
53
+ }
54
+ const credential = credentialInput(input.credential, `${path}/credential`);
55
+ if (input.mode === 'external') {
56
+ return Object.freeze({ id, mode: 'external', credential });
57
+ }
58
+ return Object.freeze({
59
+ id,
60
+ mode: 'self',
61
+ publicKey: publicJwk(input.publicKey, `${path}/publicKey`),
62
+ credential,
63
+ });
64
+ }
65
+ function credentialInput(input, path) {
66
+ if (typeof input === 'string') {
67
+ const bytes = textEncoder.encode(input).byteLength;
68
+ if (bytes === 0 || bytes > REGISTER_REQUEST_LIMITS.credentialBytes) {
69
+ invalid(path, `Credential must contain 1-${REGISTER_REQUEST_LIMITS.credentialBytes} bytes`);
70
+ }
71
+ return input;
72
+ }
73
+ if (!(input instanceof Uint8Array) ||
74
+ input.byteLength === 0 ||
75
+ input.byteLength > REGISTER_REQUEST_LIMITS.credentialBytes) {
76
+ invalid(path, `Credential must contain 1-${REGISTER_REQUEST_LIMITS.credentialBytes} bytes`);
77
+ }
78
+ return input.slice();
79
+ }
80
+ function publicJwk(input, path) {
81
+ try {
82
+ return acceptPublic(input);
83
+ }
84
+ catch (cause) {
85
+ invalid(path, 'Expected a thumbprintable public JWK', cause);
86
+ }
87
+ }
88
+ function exact(input, expected, path) {
89
+ const actual = Object.keys(input).sort(compare);
90
+ const wanted = [...expected].sort(compare);
91
+ if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) {
92
+ invalid(path, `Expected exactly ${expected.join(', ')}`);
93
+ }
94
+ }
95
+ function isRecord(input) {
96
+ return input !== null && typeof input === 'object' && !Array.isArray(input);
97
+ }
98
+ function compare(left, right) {
99
+ return left < right ? -1 : left > right ? 1 : 0;
100
+ }
101
+ function invalid(path, message, cause) {
102
+ throw new AuthValueError('AUTH_REGISTER_REQUEST_INVALID', message, path, cause === undefined ? undefined : { cause });
103
+ }
@@ -0,0 +1,3 @@
1
+ export { accept } from './admission.js';
2
+ export { isSelfIssuer, selfIssuer } from './self-issuer.js';
3
+ export type { IdentityRegistration, RegisterRequest } from './request.js';
@@ -0,0 +1,6 @@
1
+ export declare const REGISTER_REQUEST_LIMITS: Readonly<{
2
+ credentialBytes: number;
3
+ idempotencyKeyBytes: 1024;
4
+ idempotencyKeyCharacters: 256;
5
+ identities: 256;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ export const REGISTER_REQUEST_LIMITS = Object.freeze({
2
+ credentialBytes: 64 * 1024,
3
+ idempotencyKeyBytes: 1_024,
4
+ idempotencyKeyCharacters: 256,
5
+ identities: 256,
6
+ });
@@ -0,0 +1,19 @@
1
+ import type { CredentialInput } from '../../credential/input/index.js';
2
+ import type { IdentityId } from '../../identity/index.js';
3
+ import type { JsonWebKey } from '../../jwk/index.js';
4
+ export type IdentityRegistration = {
5
+ readonly id: IdentityId;
6
+ readonly mode: 'external';
7
+ readonly credential: CredentialInput;
8
+ readonly publicKey?: never;
9
+ } | {
10
+ readonly id: IdentityId;
11
+ readonly mode: 'self';
12
+ readonly publicKey: JsonWebKey;
13
+ readonly credential: CredentialInput;
14
+ };
15
+ /** Claim credential-evidenced Authentication for existing Identity-bearing Nodes. */
16
+ export interface RegisterRequest {
17
+ readonly idempotencyKey: string;
18
+ readonly identities: readonly [IdentityRegistration, ...IdentityRegistration[]];
19
+ }
@@ -1,6 +1,6 @@
1
1
  import type { IssuerId } from '../../issuer/index.js';
2
2
  import type { JsonWebKey } from '../../jwk/index.js';
3
- /** Build the hosted issuer controlled by one self-provisioned public key. */
3
+ /** Build the hosted issuer controlled by one self-registered public key. */
4
4
  export declare function selfIssuer(kernel: IssuerId, publicKey: JsonWebKey): Promise<IssuerId>;
5
5
  /** Whether an issuer is one exact key-bound issuer hosted by this Kernel. */
6
6
  export declare function isSelfIssuer(kernel: IssuerId, candidate: IssuerId): boolean;
@@ -1,6 +1,6 @@
1
1
  import { accept as acceptIssuer } from '../../issuer/index.js';
2
2
  import { thumbprint } from '../../jwk/index.js';
3
- /** Build the hosted issuer controlled by one self-provisioned public key. */
3
+ /** Build the hosted issuer controlled by one self-registered public key. */
4
4
  export async function selfIssuer(kernel, publicKey) {
5
5
  const base = String(kernel).replace(/\/+$/u, '');
6
6
  return acceptIssuer(`${base}/iss/${await thumbprint(publicKey)}`);
@@ -0,0 +1 @@
1
+ export type { RegisteredIdentity, RegisterResult } from './result.js';
@@ -0,0 +1,10 @@
1
+ import type { IdentityId, Subject } from '../../identity/index.js';
2
+ import type { IssuerId } from '../../issuer/index.js';
3
+ export interface RegisteredIdentity {
4
+ readonly id: IdentityId;
5
+ readonly iss: IssuerId;
6
+ readonly sub: Subject;
7
+ }
8
+ export interface RegisterResult {
9
+ readonly identities: readonly [RegisteredIdentity, ...RegisteredIdentity[]];
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /** One root invocation's already bounded, single-consumer binary request body. */
2
+ export interface BinaryRequestBody {
3
+ readonly body: ReadableStream<Uint8Array>;
4
+ readonly length: number;
5
+ }
6
+ /** The streamed request ended early or exceeded its declared Content-Length. */
7
+ export declare class BinaryBodyLengthError extends Error {
8
+ readonly name = "BinaryBodyLengthError";
9
+ constructor();
10
+ }
@@ -0,0 +1,7 @@
1
+ /** The streamed request ended early or exceeded its declared Content-Length. */
2
+ export class BinaryBodyLengthError extends Error {
3
+ name = 'BinaryBodyLengthError';
4
+ constructor() {
5
+ super('Binary request length mismatch.');
6
+ }
7
+ }
@@ -1,5 +1,6 @@
1
1
  export type { CallOf } from './call.js';
2
+ export { BinaryBodyLengthError, type BinaryRequestBody } from './body.js';
2
3
  export type { InputOf } from './input.js';
3
- export type { BinaryResult, OutputContractOf, OutputOf, TypedCallableOutput } from './output.js';
4
+ export type { BinaryOutput, BinaryDeliveryBudget, BufferedBinaryResult, OutputContractOf, OutputOf, StreamingBinaryResult, TypedCallableOutput, } from './output.js';
4
5
  export type { CallableSignature } from './signature.js';
5
6
  export type { Callable, SignatureOf } from './witness.js';
@@ -1 +1 @@
1
- export {};
1
+ export { BinaryBodyLengthError } from './body.js';
@@ -1,9 +1,25 @@
1
1
  import type { SignatureOf } from './witness.js';
2
- export interface BinaryResult {
2
+ /** Optional owner-selected lifetime for a large HTTP binary result. */
3
+ export interface BinaryDeliveryBudget {
4
+ readonly maximumDurationMs: number;
5
+ readonly idleTimeoutMs: number;
6
+ }
7
+ export interface BufferedBinaryResult {
3
8
  readonly body: Uint8Array;
4
9
  readonly mediaType: string;
10
+ readonly status?: number;
11
+ readonly headers?: Readonly<Record<string, string>>;
12
+ }
13
+ export interface StreamingBinaryResult {
14
+ readonly body: AsyncIterable<Uint8Array>;
15
+ /** Exact byte length; HTTP aborts delivery if the stream differs. */
16
+ readonly length?: number;
17
+ readonly delivery?: BinaryDeliveryBudget;
18
+ readonly mediaType: string;
19
+ readonly status?: number;
5
20
  readonly headers?: Readonly<Record<string, string>>;
6
21
  }
22
+ export type BinaryOutput = BufferedBinaryResult | StreamingBinaryResult;
7
23
  /** Output modes retained by a rich callable declaration. */
8
24
  export type TypedCallableOutput = {
9
25
  readonly mode: 'value';
@@ -24,4 +40,4 @@ export type OutputOf<Value> = OutputContractOf<Value> extends infer Output exten
24
40
  readonly item: infer Item;
25
41
  } ? AsyncIterable<Item> : Output extends {
26
42
  readonly mode: 'binary';
27
- } ? BinaryResult : never : never;
43
+ } ? BinaryOutput : never : never;
@@ -1,2 +1,3 @@
1
- export type { BinaryResult, Callable, CallableSignature, CallOf, InputOf, OutputContractOf, OutputOf, SignatureOf, TypedCallableOutput, } from './contract/index.js';
2
- export type { Call, CallableResult } from './invocation/index.js';
1
+ export { BinaryBodyLengthError } from './contract/index.js';
2
+ export type { BinaryOutput, BinaryDeliveryBudget, BinaryRequestBody, BufferedBinaryResult, Callable, CallableSignature, CallOf, InputOf, OutputContractOf, OutputOf, SignatureOf, StreamingBinaryResult, TypedCallableOutput, } from './contract/index.js';
3
+ export { Target, targetPath, type Call, type CallableResult } from './invocation/index.js';
@@ -1 +1,2 @@
1
- export {};
1
+ export { BinaryBodyLengthError } from './contract/index.js';
2
+ export { Target, targetPath } from './invocation/index.js';