@astrale-os/kernel-client 0.2.4 → 0.3.1

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 (279) hide show
  1. package/dist/auth/addressing.d.ts +32 -0
  2. package/dist/auth/addressing.d.ts.map +1 -0
  3. package/dist/auth/addressing.js +36 -0
  4. package/dist/auth/addressing.js.map +1 -0
  5. package/dist/auth/api.d.ts +69 -0
  6. package/dist/auth/api.d.ts.map +1 -0
  7. package/dist/auth/api.js +24 -0
  8. package/dist/auth/api.js.map +1 -0
  9. package/dist/auth/batch.d.ts +18 -0
  10. package/dist/auth/batch.d.ts.map +1 -0
  11. package/dist/auth/batch.js +25 -0
  12. package/dist/auth/batch.js.map +1 -0
  13. package/dist/auth/composition.d.ts +27 -0
  14. package/dist/auth/composition.d.ts.map +1 -0
  15. package/dist/auth/composition.js +83 -0
  16. package/dist/auth/composition.js.map +1 -0
  17. package/dist/auth/index.d.ts +14 -0
  18. package/dist/auth/index.d.ts.map +1 -0
  19. package/dist/auth/index.js +9 -0
  20. package/dist/auth/index.js.map +1 -0
  21. package/dist/auth/minting.d.ts +35 -0
  22. package/dist/auth/minting.d.ts.map +1 -0
  23. package/dist/auth/minting.js +35 -0
  24. package/dist/auth/minting.js.map +1 -0
  25. package/dist/auth/permissions.d.ts +55 -0
  26. package/dist/auth/permissions.d.ts.map +1 -0
  27. package/dist/auth/permissions.js +47 -0
  28. package/dist/auth/permissions.js.map +1 -0
  29. package/dist/auth/principal.d.ts +19 -0
  30. package/dist/auth/principal.d.ts.map +1 -0
  31. package/dist/auth/principal.js +46 -0
  32. package/dist/auth/principal.js.map +1 -0
  33. package/dist/errors/errors.d.ts +53 -0
  34. package/dist/errors/errors.d.ts.map +1 -1
  35. package/dist/errors/errors.js +69 -1
  36. package/dist/errors/errors.js.map +1 -1
  37. package/dist/errors/guards.d.ts +39 -0
  38. package/dist/errors/guards.d.ts.map +1 -0
  39. package/dist/errors/guards.js +127 -0
  40. package/dist/errors/guards.js.map +1 -0
  41. package/dist/errors/index.d.ts +4 -2
  42. package/dist/errors/index.d.ts.map +1 -1
  43. package/dist/errors/index.js +2 -1
  44. package/dist/errors/index.js.map +1 -1
  45. package/dist/graph/api.d.ts +82 -0
  46. package/dist/graph/api.d.ts.map +1 -0
  47. package/dist/graph/api.js +64 -0
  48. package/dist/graph/api.js.map +1 -0
  49. package/dist/graph/index.d.ts +24 -0
  50. package/dist/graph/index.d.ts.map +1 -0
  51. package/dist/graph/index.js +20 -0
  52. package/dist/graph/index.js.map +1 -0
  53. package/dist/graph/mutate/builder.d.ts +108 -0
  54. package/dist/graph/mutate/builder.d.ts.map +1 -0
  55. package/dist/graph/mutate/builder.js +127 -0
  56. package/dist/graph/mutate/builder.js.map +1 -0
  57. package/dist/graph/mutate/index.d.ts +5 -0
  58. package/dist/graph/mutate/index.d.ts.map +1 -0
  59. package/dist/graph/mutate/index.js +3 -0
  60. package/dist/graph/mutate/index.js.map +1 -0
  61. package/dist/graph/mutate/shorthands.d.ts +42 -0
  62. package/dist/graph/mutate/shorthands.d.ts.map +1 -0
  63. package/dist/graph/mutate/shorthands.js +65 -0
  64. package/dist/graph/mutate/shorthands.js.map +1 -0
  65. package/dist/graph/named.d.ts +38 -0
  66. package/dist/graph/named.d.ts.map +1 -0
  67. package/dist/graph/named.js +47 -0
  68. package/dist/graph/named.js.map +1 -0
  69. package/dist/graph/query/builder.d.ts +116 -0
  70. package/dist/graph/query/builder.d.ts.map +1 -0
  71. package/dist/graph/query/builder.js +136 -0
  72. package/dist/graph/query/builder.js.map +1 -0
  73. package/dist/graph/query/edge-ref.d.ts +13 -0
  74. package/dist/graph/query/edge-ref.d.ts.map +1 -0
  75. package/dist/graph/query/edge-ref.js +56 -0
  76. package/dist/graph/query/edge-ref.js.map +1 -0
  77. package/dist/graph/query/edges.d.ts +10 -0
  78. package/dist/graph/query/edges.d.ts.map +1 -0
  79. package/dist/graph/query/edges.js +11 -0
  80. package/dist/graph/query/edges.js.map +1 -0
  81. package/dist/graph/query/errors.d.ts +31 -0
  82. package/dist/graph/query/errors.d.ts.map +1 -0
  83. package/dist/graph/query/errors.js +28 -0
  84. package/dist/graph/query/errors.js.map +1 -0
  85. package/dist/graph/query/filter.d.ts +50 -0
  86. package/dist/graph/query/filter.d.ts.map +1 -0
  87. package/dist/graph/query/filter.js +32 -0
  88. package/dist/graph/query/filter.js.map +1 -0
  89. package/dist/graph/query/index.d.ts +12 -0
  90. package/dist/graph/query/index.d.ts.map +1 -0
  91. package/dist/graph/query/index.js +7 -0
  92. package/dist/graph/query/index.js.map +1 -0
  93. package/dist/graph/query/lower.d.ts +30 -0
  94. package/dist/graph/query/lower.d.ts.map +1 -0
  95. package/dist/graph/query/lower.js +171 -0
  96. package/dist/graph/query/lower.js.map +1 -0
  97. package/dist/graph/query/shorthands.d.ts +34 -0
  98. package/dist/graph/query/shorthands.d.ts.map +1 -0
  99. package/dist/graph/query/shorthands.js +71 -0
  100. package/dist/graph/query/shorthands.js.map +1 -0
  101. package/dist/graph/query/traverse.d.ts +59 -0
  102. package/dist/graph/query/traverse.d.ts.map +1 -0
  103. package/dist/graph/query/traverse.js +144 -0
  104. package/dist/graph/query/traverse.js.map +1 -0
  105. package/dist/graph/result/envelope.d.ts +37 -0
  106. package/dist/graph/result/envelope.d.ts.map +1 -0
  107. package/dist/graph/result/envelope.js +59 -0
  108. package/dist/graph/result/envelope.js.map +1 -0
  109. package/dist/graph/result/index.d.ts +6 -0
  110. package/dist/graph/result/index.d.ts.map +1 -0
  111. package/dist/graph/result/index.js +4 -0
  112. package/dist/graph/result/index.js.map +1 -0
  113. package/dist/graph/result/next.d.ts +16 -0
  114. package/dist/graph/result/next.d.ts.map +1 -0
  115. package/dist/graph/result/next.js +77 -0
  116. package/dist/graph/result/next.js.map +1 -0
  117. package/dist/graph/result/paged.d.ts +30 -0
  118. package/dist/graph/result/paged.d.ts.map +1 -0
  119. package/dist/graph/result/paged.js +41 -0
  120. package/dist/graph/result/paged.js.map +1 -0
  121. package/dist/graph/wire.d.ts +33 -0
  122. package/dist/graph/wire.d.ts.map +1 -0
  123. package/dist/graph/wire.js +16 -0
  124. package/dist/graph/wire.js.map +1 -0
  125. package/dist/index.d.ts +11 -3
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +10 -1
  128. package/dist/index.js.map +1 -1
  129. package/dist/schema/bound/binder.d.ts +49 -0
  130. package/dist/schema/bound/binder.d.ts.map +1 -0
  131. package/dist/schema/bound/binder.js +192 -0
  132. package/dist/schema/bound/binder.js.map +1 -0
  133. package/dist/schema/bound/bound-node.d.ts +89 -0
  134. package/dist/schema/bound/bound-node.d.ts.map +1 -0
  135. package/dist/schema/bound/bound-node.js +77 -0
  136. package/dist/schema/bound/bound-node.js.map +1 -0
  137. package/dist/schema/bound/index.d.ts +10 -0
  138. package/dist/schema/bound/index.d.ts.map +1 -0
  139. package/dist/schema/bound/index.js +5 -0
  140. package/dist/schema/bound/index.js.map +1 -0
  141. package/dist/schema/bound/view.d.ts +48 -0
  142. package/dist/schema/bound/view.d.ts.map +1 -0
  143. package/dist/schema/bound/view.js +90 -0
  144. package/dist/schema/bound/view.js.map +1 -0
  145. package/dist/schema/bound/write-props.d.ts +38 -0
  146. package/dist/schema/bound/write-props.d.ts.map +1 -0
  147. package/dist/schema/bound/write-props.js +2 -0
  148. package/dist/schema/bound/write-props.js.map +1 -0
  149. package/dist/schema/extract.d.ts +12 -0
  150. package/dist/schema/extract.d.ts.map +1 -1
  151. package/dist/schema/extract.js +16 -0
  152. package/dist/schema/extract.js.map +1 -1
  153. package/dist/schema/index.d.ts +7 -3
  154. package/dist/schema/index.d.ts.map +1 -1
  155. package/dist/schema/index.js +4 -2
  156. package/dist/schema/index.js.map +1 -1
  157. package/dist/schema/node-proxy.d.ts +9 -0
  158. package/dist/schema/node-proxy.d.ts.map +1 -1
  159. package/dist/schema/node-proxy.js +31 -1
  160. package/dist/schema/node-proxy.js.map +1 -1
  161. package/dist/{persistence → schema}/persistence.d.ts +1 -22
  162. package/dist/schema/persistence.d.ts.map +1 -0
  163. package/dist/schema/persistence.js +2 -0
  164. package/dist/schema/persistence.js.map +1 -0
  165. package/dist/schema/proxy-types.d.ts +28 -22
  166. package/dist/schema/proxy-types.d.ts.map +1 -1
  167. package/dist/schema/registry.d.ts +1 -2
  168. package/dist/schema/registry.d.ts.map +1 -1
  169. package/dist/schema/registry.js +1 -2
  170. package/dist/schema/registry.js.map +1 -1
  171. package/dist/session/bound.d.ts.map +1 -1
  172. package/dist/session/bound.js +15 -2
  173. package/dist/session/bound.js.map +1 -1
  174. package/dist/session/client-session.d.ts +1 -1
  175. package/dist/session/client-session.d.ts.map +1 -1
  176. package/dist/session/client-session.js +5 -5
  177. package/dist/session/client-session.js.map +1 -1
  178. package/dist/session/config.d.ts +8 -4
  179. package/dist/session/config.d.ts.map +1 -1
  180. package/dist/{delegation → session/delegation}/cache.d.ts +3 -4
  181. package/dist/session/delegation/cache.d.ts.map +1 -0
  182. package/dist/session/delegation/cache.js.map +1 -0
  183. package/dist/{delegation → session/delegation}/errors.d.ts +1 -1
  184. package/dist/session/delegation/errors.d.ts.map +1 -0
  185. package/dist/{delegation → session/delegation}/errors.js +1 -1
  186. package/dist/session/delegation/errors.js.map +1 -0
  187. package/dist/session/delegation/policy.d.ts.map +1 -0
  188. package/dist/{delegation → session/delegation}/policy.js +1 -1
  189. package/dist/session/delegation/policy.js.map +1 -0
  190. package/dist/session/delegation-mint.d.ts +13 -0
  191. package/dist/session/delegation-mint.d.ts.map +1 -0
  192. package/dist/session/delegation-mint.js +31 -0
  193. package/dist/session/delegation-mint.js.map +1 -0
  194. package/dist/session/errors/index.d.ts +2 -2
  195. package/dist/session/errors/index.d.ts.map +1 -1
  196. package/dist/session/errors/index.js +2 -2
  197. package/dist/session/errors/index.js.map +1 -1
  198. package/dist/session/helpers.js +2 -2
  199. package/dist/session/helpers.js.map +1 -1
  200. package/dist/session/index.d.ts +9 -1
  201. package/dist/session/index.d.ts.map +1 -1
  202. package/dist/session/index.js +6 -1
  203. package/dist/session/index.js.map +1 -1
  204. package/dist/{redirect → session/redirect}/errors.d.ts +1 -1
  205. package/dist/session/redirect/errors.d.ts.map +1 -0
  206. package/dist/{redirect → session/redirect}/errors.js +1 -1
  207. package/dist/session/redirect/errors.js.map +1 -0
  208. package/dist/session/redirect/policy.d.ts.map +1 -0
  209. package/dist/{redirect → session/redirect}/policy.js +1 -1
  210. package/dist/session/redirect/policy.js.map +1 -0
  211. package/dist/session/types.d.ts +13 -2
  212. package/dist/session/types.d.ts.map +1 -1
  213. package/dist/store/canonicalize.d.ts +44 -0
  214. package/dist/store/canonicalize.d.ts.map +1 -0
  215. package/dist/store/canonicalize.js +0 -0
  216. package/dist/store/canonicalize.js.map +1 -0
  217. package/dist/store/entities.d.ts +81 -0
  218. package/dist/store/entities.d.ts.map +1 -0
  219. package/dist/store/entities.js +202 -0
  220. package/dist/store/entities.js.map +1 -0
  221. package/dist/store/index.d.ts +26 -0
  222. package/dist/store/index.d.ts.map +1 -0
  223. package/dist/store/index.js +19 -0
  224. package/dist/store/index.js.map +1 -0
  225. package/dist/store/invalidate.d.ts +66 -0
  226. package/dist/store/invalidate.d.ts.map +1 -0
  227. package/dist/store/invalidate.js +117 -0
  228. package/dist/store/invalidate.js.map +1 -0
  229. package/dist/store/memory.d.ts +97 -0
  230. package/dist/store/memory.d.ts.map +1 -0
  231. package/dist/store/memory.js +790 -0
  232. package/dist/store/memory.js.map +1 -0
  233. package/dist/store/overlay.d.ts +118 -0
  234. package/dist/store/overlay.d.ts.map +1 -0
  235. package/dist/store/overlay.js +237 -0
  236. package/dist/store/overlay.js.map +1 -0
  237. package/dist/store/schedule.d.ts +31 -0
  238. package/dist/store/schedule.d.ts.map +1 -0
  239. package/dist/store/schedule.js +76 -0
  240. package/dist/store/schedule.js.map +1 -0
  241. package/dist/store/shapes.d.ts +92 -0
  242. package/dist/store/shapes.d.ts.map +1 -0
  243. package/dist/store/shapes.js +369 -0
  244. package/dist/store/shapes.js.map +1 -0
  245. package/dist/store/types.d.ts +168 -0
  246. package/dist/store/types.d.ts.map +1 -0
  247. package/dist/store/types.js +7 -0
  248. package/dist/store/types.js.map +1 -0
  249. package/dist/transport/fetch.d.ts +1 -1
  250. package/dist/transport/fetch.js +1 -1
  251. package/package.json +17 -33
  252. package/dist/delegation/cache.d.ts.map +0 -1
  253. package/dist/delegation/cache.js.map +0 -1
  254. package/dist/delegation/errors.d.ts.map +0 -1
  255. package/dist/delegation/errors.js.map +0 -1
  256. package/dist/delegation/index.d.ts +0 -6
  257. package/dist/delegation/index.d.ts.map +0 -1
  258. package/dist/delegation/index.js +0 -4
  259. package/dist/delegation/index.js.map +0 -1
  260. package/dist/delegation/policy.d.ts.map +0 -1
  261. package/dist/delegation/policy.js.map +0 -1
  262. package/dist/persistence/index.d.ts +0 -3
  263. package/dist/persistence/index.d.ts.map +0 -1
  264. package/dist/persistence/index.js +0 -2
  265. package/dist/persistence/index.js.map +0 -1
  266. package/dist/persistence/persistence.d.ts.map +0 -1
  267. package/dist/persistence/persistence.js +0 -32
  268. package/dist/persistence/persistence.js.map +0 -1
  269. package/dist/redirect/errors.d.ts.map +0 -1
  270. package/dist/redirect/errors.js.map +0 -1
  271. package/dist/redirect/index.d.ts +0 -4
  272. package/dist/redirect/index.d.ts.map +0 -1
  273. package/dist/redirect/index.js +0 -3
  274. package/dist/redirect/index.js.map +0 -1
  275. package/dist/redirect/policy.d.ts.map +0 -1
  276. package/dist/redirect/policy.js.map +0 -1
  277. /package/dist/{delegation → session/delegation}/cache.js +0 -0
  278. /package/dist/{delegation → session/delegation}/policy.d.ts +0 -0
  279. /package/dist/{redirect → session/redirect}/policy.d.ts +0 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Addressing for the auth surface — the one place a syscall address is formed.
3
+ * Method slugs and the static `whoami` path derive from `K.Identity.*`
4
+ * accessors, so a kernel schema rename breaks at compile time (the property
5
+ * access) instead of failing silently at dispatch.
6
+ */
7
+ /** AuthApi verb → the K-derived Identity method slug it dispatches. */
8
+ export declare const IDENTITY_METHOD: {
9
+ readonly mint: string;
10
+ readonly delegate: string;
11
+ readonly check: string;
12
+ readonly grant: string;
13
+ readonly revoke: string;
14
+ readonly extend: string;
15
+ readonly constrain: string;
16
+ readonly exclude: string;
17
+ readonly removeExtension: string;
18
+ readonly removeConstraint: string;
19
+ readonly removeExclusion: string;
20
+ };
21
+ /**
22
+ * Static dispatch path of `Identity.whoami` — the layout-independent MethodPath
23
+ * (`/:kernel.astrale.ai:interface.Identity:whoami`). The one static syscall.
24
+ */
25
+ export declare const WHOAMI_PATH: string;
26
+ /**
27
+ * Format an `InstanceMethodPath` (`<base>::<slug>`) for a syscall dispatched at
28
+ * one identity node. `idOrPath` is already-raw; a leading `/` or `@` is used
29
+ * verbatim, a bare id gets the `@` prefix — never a double `@`.
30
+ */
31
+ export declare function instanceTarget(idOrPath: string, slug: string): string;
32
+ //# sourceMappingURL=addressing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addressing.d.ts","sourceRoot":"","sources":["../../src/auth/addressing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,uEAAuE;AACvE,eAAO,MAAM,eAAe;aAC1B,IAAI;aACJ,QAAQ;aACR,KAAK;aACL,KAAK;aACL,MAAM;aACN,MAAM;aACN,SAAS;aACT,OAAO;aACP,eAAe;aACf,gBAAgB;aAChB,eAAe;CACP,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAA0C,CAAA;AAEpE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrE"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Addressing for the auth surface — the one place a syscall address is formed.
3
+ * Method slugs and the static `whoami` path derive from `K.Identity.*`
4
+ * accessors, so a kernel schema rename breaks at compile time (the property
5
+ * access) instead of failing silently at dispatch.
6
+ */
7
+ import { K } from '@astrale-os/kernel-core';
8
+ /** AuthApi verb → the K-derived Identity method slug it dispatches. */
9
+ export const IDENTITY_METHOD = {
10
+ mint: K.Identity.mintIdentityCredential.path.method.method,
11
+ delegate: K.Identity.mintDelegationCredential.path.method.method,
12
+ check: K.Identity.checkPerm.path.method.method,
13
+ grant: K.Identity.grantPerm.path.method.method,
14
+ revoke: K.Identity.revokePerm.path.method.method,
15
+ extend: K.Identity.extendIdentity.path.method.method,
16
+ constrain: K.Identity.constrainIdentity.path.method.method,
17
+ exclude: K.Identity.excludeIdentity.path.method.method,
18
+ removeExtension: K.Identity.removeExtension.path.method.method,
19
+ removeConstraint: K.Identity.removeConstraint.path.method.method,
20
+ removeExclusion: K.Identity.removeExclusion.path.method.method,
21
+ };
22
+ /**
23
+ * Static dispatch path of `Identity.whoami` — the layout-independent MethodPath
24
+ * (`/:kernel.astrale.ai:interface.Identity:whoami`). The one static syscall.
25
+ */
26
+ export const WHOAMI_PATH = K.Identity.whoami.path.method.raw;
27
+ /**
28
+ * Format an `InstanceMethodPath` (`<base>::<slug>`) for a syscall dispatched at
29
+ * one identity node. `idOrPath` is already-raw; a leading `/` or `@` is used
30
+ * verbatim, a bare id gets the `@` prefix — never a double `@`.
31
+ */
32
+ export function instanceTarget(idOrPath, slug) {
33
+ const base = idOrPath.startsWith('/') || idOrPath.startsWith('@') ? idOrPath : `@${idOrPath}`;
34
+ return `${base}::${slug}`;
35
+ }
36
+ //# sourceMappingURL=addressing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addressing.js","sourceRoot":"","sources":["../../src/auth/addressing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,yBAAyB,CAAA;AAE3C,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;IAC1D,QAAQ,EAAE,CAA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O,GAAG,IAAI,KAAK,IAAI,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The `AuthApi` surface and its one implementation, `createAuth` — the control
3
+ * plane of a bound session view, over the same {@link GraphCall} capability as
4
+ * `graph/`. Instance-dispatched verbs target the counterparty identity
5
+ * (`@<id>::<slug>`); `whoami` is the one static syscall. `createAuth` is thin:
6
+ * it wires the verb modules over one caller resolver.
7
+ */
8
+ import type { CredentialInput, Node } from '@astrale-os/kernel-core';
9
+ import type { GraphCall } from '../graph';
10
+ import type { Composition } from './composition';
11
+ import type { DelegateOpts, MintOpts } from './minting';
12
+ import type { CheckInput, GrantInput, RevokeInput } from './permissions';
13
+ /**
14
+ * Control-plane surface of a bound session view. All calls dispatch with the
15
+ * view's credential.
16
+ */
17
+ export interface AuthApi {
18
+ /** The authenticated caller's identity node. Always a live syscall — never cached. */
19
+ whoami(): Promise<Node>;
20
+ /**
21
+ * The credential this view currently dispatches with — resolved fresh per
22
+ * call, so never cache the return.
23
+ */
24
+ credential(): CredentialInput;
25
+ /**
26
+ * Mint a single-layer identity credential for {@link MintOpts.subject}
27
+ * (default: the memoized principal). (syscall: mintIdentityCredential)
28
+ */
29
+ mint(opts?: MintOpts): Promise<string>;
30
+ /**
31
+ * Mint a two-layer delegation credential — always as self (no subject param).
32
+ * {@link DelegateOpts.delegation} defaults to `{ kind: 'identity', self: true }`.
33
+ * (syscall: mintDelegationCredential)
34
+ */
35
+ delegate(opts?: DelegateOpts): Promise<string>;
36
+ /**
37
+ * Does `who` (default: self) hold `perms` on `on` by its own STANDING grant
38
+ * edges — "does this identity hold X", not "would the current (maybe narrowed)
39
+ * token pass". Batch: array in → positionally-aligned `boolean[]`.
40
+ */
41
+ check(q: CheckInput): Promise<boolean>;
42
+ check(q: readonly CheckInput[]): Promise<boolean[]>;
43
+ /**
44
+ * Grant `perms` to `to` on `on` (and its subtree). ⚠ SETS the has_perm bits —
45
+ * does NOT OR; re-granting with fewer bits downgrades. Batch: set semantics,
46
+ * not a transaction — a failure throws `AuthBatchError` with per-entry outcomes.
47
+ */
48
+ grant(g: GrantInput): Promise<void>;
49
+ grant(g: readonly GrantInput[]): Promise<void>;
50
+ /** Remove `perms` from `from` on `on`. Batch semantics mirror {@link grant}. */
51
+ revoke(r: RevokeInput): Promise<void>;
52
+ revoke(r: readonly RevokeInput[]): Promise<void>;
53
+ /**
54
+ * Attach the described composition edges to `who` (default: self). Fields fan
55
+ * out; an empty record is a resolved no-op. On any entry failure throws
56
+ * `AuthBatchError` with per-entry outcomes.
57
+ */
58
+ bind(c: Composition): Promise<void>;
59
+ /** Detach the described composition edges — the exact mirror of {@link bind}. */
60
+ unbind(c: Composition): Promise<void>;
61
+ }
62
+ /**
63
+ * Bind the auth surface onto a call capability and a credential thunk. One caller
64
+ * resolver (whoami + principal memo) fans into the verb modules.
65
+ */
66
+ export declare function createAuth(call: GraphCall, opts: {
67
+ credential: () => CredentialInput;
68
+ }): AuthApi;
69
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/auth/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAOxE;;;GAGG;AACH,MAAM,WAAW,OAAO;IAEtB,sFAAsF;IACtF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAGvB;;;OAGG;IACH,UAAU,IAAI,eAAe,CAAA;IAC7B;;;OAGG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACtC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAG9C;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,KAAK,CAAC,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IACnD;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,KAAK,CAAC,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,gFAAgF;IAChF,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,MAAM,CAAC,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAGhD;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,iFAAiF;IACjF,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,eAAe,CAAA;CAAE,GAAG,OAAO,CAShG"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The `AuthApi` surface and its one implementation, `createAuth` — the control
3
+ * plane of a bound session view, over the same {@link GraphCall} capability as
4
+ * `graph/`. Instance-dispatched verbs target the counterparty identity
5
+ * (`@<id>::<slug>`); `whoami` is the one static syscall. `createAuth` is thin:
6
+ * it wires the verb modules over one caller resolver.
7
+ */
8
+ import { createComposition } from './composition';
9
+ import { createMinting } from './minting';
10
+ import { createPermissions } from './permissions';
11
+ import { createCaller } from './principal';
12
+ /**
13
+ * Bind the auth surface onto a call capability and a credential thunk. One caller
14
+ * resolver (whoami + principal memo) fans into the verb modules.
15
+ */
16
+ export function createAuth(call, opts) {
17
+ const caller = createCaller(call);
18
+ const { mint, delegate } = createMinting(call, caller);
19
+ const { check, grant, revoke } = createPermissions(call, caller);
20
+ const { bind, unbind } = createComposition(call, caller);
21
+ const credential = () => opts.credential();
22
+ return { whoami: caller.whoami, credential, mint, delegate, check, grant, revoke, bind, unbind };
23
+ }
24
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/auth/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AA2D1C;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAe,EAAE,IAA2C;IACrF,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACtD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAChE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAExD,MAAM,UAAU,GAAG,GAAoB,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,CAAA;IAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAClG,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Batch fan-out for the auth surface. Set semantics, not a transaction: entries
3
+ * dispatch in PARALLEL and partial application is possible, so a failure
4
+ * surfaces every entry's outcome through {@link AuthBatchError}.
5
+ */
6
+ /** One unit of a fan-out: a summary of the entry plus the dispatch that runs it. */
7
+ export interface BatchEntry<T> {
8
+ /** Caller-legible summary of this entry (goes into {@link AuthBatchOutcome.input}). */
9
+ readonly input: unknown;
10
+ run(): Promise<T>;
11
+ }
12
+ /**
13
+ * Run every entry in parallel; resolve to the results positionally aligned with
14
+ * `entries`, or throw {@link AuthBatchError} carrying all outcomes if any
15
+ * rejected. Zero entries ⇒ zero dispatches, resolves to `[]` (the no-op case).
16
+ */
17
+ export declare function settleAll<T>(operation: string, entries: readonly BatchEntry<T>[]): Promise<T[]>;
18
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/auth/batch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,oFAAoF;AACpF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;CAClB;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,GAChC,OAAO,CAAC,CAAC,EAAE,CAAC,CAed"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Batch fan-out for the auth surface. Set semantics, not a transaction: entries
3
+ * dispatch in PARALLEL and partial application is possible, so a failure
4
+ * surfaces every entry's outcome through {@link AuthBatchError}.
5
+ */
6
+ import { AuthBatchError } from '../errors/errors';
7
+ /**
8
+ * Run every entry in parallel; resolve to the results positionally aligned with
9
+ * `entries`, or throw {@link AuthBatchError} carrying all outcomes if any
10
+ * rejected. Zero entries ⇒ zero dispatches, resolves to `[]` (the no-op case).
11
+ */
12
+ export async function settleAll(operation, entries) {
13
+ const settled = await Promise.allSettled(entries.map((e) => e.run()));
14
+ const outcomes = settled.map((result, index) => ({
15
+ index,
16
+ input: entries[index].input,
17
+ status: result.status,
18
+ ...(result.status === 'fulfilled' ? { value: result.value } : { error: result.reason }),
19
+ }));
20
+ if (outcomes.some((o) => o.status === 'rejected')) {
21
+ throw new AuthBatchError(operation, outcomes);
22
+ }
23
+ return settled.map((r) => r.value);
24
+ }
25
+ //# sourceMappingURL=batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/auth/batch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AASjD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,SAAiB,EACjB,OAAiC;IAEjC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAErE,MAAM,QAAQ,GAAuB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnE,KAAK;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,CAAE,CAAC,KAAK;QAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;KACxF,CAAC,CAAC,CAAA;IAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAA+B,CAAC,KAAK,CAAC,CAAA;AACnE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Durable composition — `bind` / `unbind`, six syscalls behind two verbs over
3
+ * one described edge delta, plus the delta shape and its flattening.
4
+ */
5
+ import type { GraphCall, Ref } from '../graph';
6
+ import type { Caller } from './principal';
7
+ /**
8
+ * A described composition delta — the flat edge set on one identity node. Field
9
+ * names are the edge classes (camelCased); each is optional, accepts one or many
10
+ * counterparties, and fans out. An empty record is a resolved no-op.
11
+ */
12
+ export interface Composition {
13
+ /** The identity the edges hang off. Absent ⇒ the memoized principal. */
14
+ who?: Ref;
15
+ /** extends_with — `who` gains each counterparty's reach (union). */
16
+ extendsWith?: Ref | readonly Ref[];
17
+ /** constrained_by — `who` reaches only the overlap (intersect). */
18
+ constrainedBy?: Ref | readonly Ref[];
19
+ /** excluded_from — `who` loses each counterparty's reach (asymmetric). */
20
+ excludedFrom?: Ref | readonly Ref[];
21
+ }
22
+ /** Bind bind + unbind onto a call capability and the caller resolver. */
23
+ export declare function createComposition(call: GraphCall, caller: Caller): {
24
+ bind(c: Composition): Promise<void>;
25
+ unbind(c: Composition): Promise<void>;
26
+ };
27
+ //# sourceMappingURL=composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../src/auth/composition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMzC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,oEAAoE;IACpE,WAAW,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,EAAE,CAAA;IAClC,mEAAmE;IACnE,aAAa,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,EAAE,CAAA;IACpC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,EAAE,CAAA;CACpC;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GACb;IAAE,IAAI,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAwBhF"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Durable composition — `bind` / `unbind`, six syscalls behind two verbs over
3
+ * one described edge delta, plus the delta shape and its flattening.
4
+ */
5
+ import { refRaw } from '../graph/mutate';
6
+ import { IDENTITY_METHOD, instanceTarget } from './addressing';
7
+ import { settleAll } from './batch';
8
+ /** Bind bind + unbind onto a call capability and the caller resolver. */
9
+ export function createComposition(call, caller) {
10
+ const compose = async (c, kind) => {
11
+ const fields = compositionFields(c, kind);
12
+ // Empty / all-absent record: a resolved no-op — no whoami, no dispatch.
13
+ if (fields.length === 0)
14
+ return;
15
+ const whoRaw = c.who !== undefined ? refRaw(c.who) : await caller.principal();
16
+ const entries = fields.map(({ ref, slug, paramKey, edge }) => {
17
+ const counterparty = refRaw(ref);
18
+ const target = instanceTarget(whoRaw, slug);
19
+ return {
20
+ input: { who: whoRaw, edge, counterparty },
21
+ run: async () => {
22
+ await call(target, { [paramKey]: counterparty });
23
+ },
24
+ };
25
+ });
26
+ await settleAll(kind, entries);
27
+ };
28
+ const bind = (c) => compose(c, 'bind');
29
+ const unbind = (c) => compose(c, 'unbind');
30
+ return { bind, unbind };
31
+ }
32
+ /** Flatten a {@link Composition} into per-(field × counterparty) dispatch specs. */
33
+ function compositionFields(c, kind) {
34
+ const specs = kind === 'bind'
35
+ ? [
36
+ {
37
+ refs: c.extendsWith,
38
+ slug: IDENTITY_METHOD.extend,
39
+ paramKey: 'with',
40
+ edge: 'extendsWith',
41
+ },
42
+ {
43
+ refs: c.constrainedBy,
44
+ slug: IDENTITY_METHOD.constrain,
45
+ paramKey: 'by',
46
+ edge: 'constrainedBy',
47
+ },
48
+ {
49
+ refs: c.excludedFrom,
50
+ slug: IDENTITY_METHOD.exclude,
51
+ paramKey: 'without',
52
+ edge: 'excludedFrom',
53
+ },
54
+ ]
55
+ : [
56
+ {
57
+ refs: c.extendsWith,
58
+ slug: IDENTITY_METHOD.removeExtension,
59
+ paramKey: 'identity',
60
+ edge: 'extendsWith',
61
+ },
62
+ {
63
+ refs: c.constrainedBy,
64
+ slug: IDENTITY_METHOD.removeConstraint,
65
+ paramKey: 'identity',
66
+ edge: 'constrainedBy',
67
+ },
68
+ {
69
+ refs: c.excludedFrom,
70
+ slug: IDENTITY_METHOD.removeExclusion,
71
+ paramKey: 'identity',
72
+ edge: 'excludedFrom',
73
+ },
74
+ ];
75
+ return specs.flatMap(({ refs, slug, paramKey, edge }) => toRefArray(refs).map((ref) => ({ ref, slug, paramKey, edge })));
76
+ }
77
+ /** Normalize `Ref | readonly Ref[] | undefined` to an array (single Ref → `[ref]`). */
78
+ function toRefArray(v) {
79
+ if (v === undefined)
80
+ return [];
81
+ return Array.isArray(v) ? v : [v];
82
+ }
83
+ //# sourceMappingURL=composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.js","sourceRoot":"","sources":["../../src/auth/composition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,MAAM,EAAE,MAAM,iBA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AE,EAAE,CACtD,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAC/D,CAAA;AACH,CAAC;AAED,uFAAuF;AACvF,SAAS,UAAU,CAAC,CAAmC;IACrD,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAoB,CAAC,CAAC,CAAC,CAAC,CAAQ,CAAC,CAAA;AAC9D,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The auth surface — control plane of a bound session view (`view.auth`), pure
3
+ * over a `GraphCall` capability. Re-exports the expression leaves (`self`,
4
+ * `cred`) and builder type (`Expr`) from kernel-core so the composed-authority
5
+ * flow imports from one place.
6
+ */
7
+ export { createAuth } from './api';
8
+ export type { AuthApi } from './api';
9
+ export type { Composition } from './composition';
10
+ export type { DelegateOpts, MintOpts } from './minting';
11
+ export type { CheckInput, GrantInput, Perms, RevokeInput } from './permissions';
12
+ export { cred, self } from '@astrale-os/kernel-core/expression';
13
+ export type { Expr } from '@astrale-os/kernel-core/expression';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,YAAY,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACpC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE/E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAC/D,YAAY,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The auth surface — control plane of a bound session view (`view.auth`), pure
3
+ * over a `GraphCall` capability. Re-exports the expression leaves (`self`,
4
+ * `cred`) and builder type (`Expr`) from kernel-core so the composed-authority
5
+ * flow imports from one place.
6
+ */
7
+ export { createAuth } from './api';
8
+ export { cred, self } from '@astrale-os/kernel-core/expression';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAMlC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Credential minting — `mint` (single-layer identity, for any subject) and
3
+ * `delegate` (two-layer delegation, always as self), plus their option shapes.
4
+ */
5
+ import type { Expr, SelfIdentityExpr, UnresolvedIdentityExpr } from '@astrale-os/kernel-core/expression';
6
+ import type { GraphCall, Ref } from '../graph';
7
+ import type { Caller } from './principal';
8
+ /** Options for {@link AuthApi.mint}. */
9
+ export interface MintOpts {
10
+ /**
11
+ * Identity to mint for. Absent ⇒ the memoized principal; pin it only to mint
12
+ * for a node you hold EDIT on.
13
+ */
14
+ subject?: Ref;
15
+ }
16
+ /** Options for {@link AuthApi.delegate} — mirrors `MintDelegationParams` one-for-one. */
17
+ export interface DelegateOpts {
18
+ /** Intended `aud` of the minted credential. */
19
+ audience?: string;
20
+ /**
21
+ * Composed grant expression — a raw {@link UnresolvedIdentityExpr} or a builder
22
+ * (`self()`, `cred()`). Absent ⇒ `{ kind: 'identity', self: true }`.
23
+ */
24
+ delegation?: UnresolvedIdentityExpr | Expr<UnresolvedIdentityExpr>;
25
+ /** Self-asserted claims carried alongside the delegation. */
26
+ attestation?: SelfIdentityExpr;
27
+ /** Credential lifetime in seconds. */
28
+ ttl?: number;
29
+ }
30
+ /** Bind mint + delegate onto a call capability and the caller resolver. */
31
+ export declare function createMinting(call: GraphCall, caller: Caller): {
32
+ mint(opts?: MintOpts): Promise<string>;
33
+ delegate(opts?: DelegateOpts): Promise<string>;
34
+ };
35
+ //# sourceMappingURL=minting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minting.d.ts","sourceRoot":"","sources":["../../src/auth/minting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,oCAAoC,CAAA;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAIzC,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,GAAG,CAAA;CACd;AAED,yFAAyF;AACzF,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAA;IAClE,6DAA6D;IAC7D,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAgBD,2EAA2E;AAC3E,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GACb;IACD,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC/C,CAgBA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Credential minting — `mint` (single-layer identity, for any subject) and
3
+ * `delegate` (two-layer delegation, always as self), plus their option shapes.
4
+ */
5
+ import { isExprBuilder } from '@astrale-os/kernel-core/expression';
6
+ import { IDENTITY_METHOD, instanceTarget } from './addressing';
7
+ /** Frozen — shared by reference into every default delegate call; mirrors DEFAULT_SELF_DELEGATION. */
8
+ const DEFAULT_DELEGATION = Object.freeze({
9
+ kind: 'identity',
10
+ self: true,
11
+ });
12
+ /** Bind mint + delegate onto a call capability and the caller resolver. */
13
+ export function createMinting(call, caller) {
14
+ const mint = async (mintOpts) => (await call(await caller.targetFor(mintOpts?.subject, IDENTITY_METHOD.mint), {}));
15
+ const delegate = async (delegateOpts) => {
16
+ const target = instanceTarget(await caller.principal(), IDENTITY_METHOD.delegate);
17
+ const params = {
18
+ delegation: resolveDelegation(delegateOpts?.delegation),
19
+ ...(delegateOpts?.audience !== undefined ? { audience: delegateOpts.audience } : {}),
20
+ ...(delegateOpts?.attestation !== undefined ? { attestation: delegateOpts.attestation } : {}),
21
+ ...(delegateOpts?.ttl !== undefined ? { ttl: delegateOpts.ttl } : {}),
22
+ };
23
+ return (await call(target, params));
24
+ };
25
+ return { mint, delegate };
26
+ }
27
+ /** Resolve the `delegation` input to a raw tree — builder → `.build()`, raw as-is. */
28
+ function resolveDelegation(input) {
29
+ if (input === undefined)
30
+ return DEFAULT_DELEGATION;
31
+ if (isExprBuilder(input))
32
+ return input.build();
33
+ return input;
34
+ }
35
+ //# sourceMappingURL=minting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minting.js","sourceRoot":"","sources":["../../src/auth/minting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAKlE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AA0B9D,sGAAsG;AACtG,MAAM,kBAAkB,GAA2B,MAAM,CAAC,MAAM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AAK,SAAS;QAAE,OAAO,kBAAkB,CAAA;IAClD,IAAI,aAAa,CAAyB,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAA;IACtE,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Permission verbs — `check` / `grant` / `revoke`, each single-or-batch over one
3
+ * dispatch per entry on the counterparty identity, plus their input shapes.
4
+ */
5
+ import type { PermissionMask } from '@astrale-os/kernel-core/permissions';
6
+ import type { GraphCall, Ref } from '../graph';
7
+ import type { Caller } from './principal';
8
+ /** A permission bitmask (combined flags) — not the single-bit branded `Permission`. */
9
+ export type Perms = PermissionMask;
10
+ /**
11
+ * Does `who` (default: self) hold `perms` on `on`, by its own grant edges? See
12
+ * {@link AuthApi.check} for the standing-grants-not-current-token caveat.
13
+ */
14
+ export interface CheckInput {
15
+ /** Identity to interrogate. Absent ⇒ the memoized principal. */
16
+ who?: Ref;
17
+ on: Ref;
18
+ /** Permission bits required — all must be held. */
19
+ perms: Perms;
20
+ }
21
+ /** Grant `perms` to `to` on `on` (and its subtree). ⚠ SETS the bits — see {@link AuthApi.grant}. */
22
+ export interface GrantInput {
23
+ to: Ref;
24
+ /** Node the grant covers (and its subtree). */
25
+ on: Ref;
26
+ perms: Perms;
27
+ }
28
+ /** Remove `perms` from `from` on `on`. */
29
+ export interface RevokeInput {
30
+ from: Ref;
31
+ on: Ref;
32
+ perms: Perms;
33
+ }
34
+ /** {@link AuthApi.check} as a callable — single in → boolean, array in → aligned boolean[]. */
35
+ export interface CheckFn {
36
+ (q: CheckInput): Promise<boolean>;
37
+ (q: readonly CheckInput[]): Promise<boolean[]>;
38
+ }
39
+ /** {@link AuthApi.grant} as a callable — single or batch (set semantics, not a transaction). */
40
+ export interface GrantFn {
41
+ (g: GrantInput): Promise<void>;
42
+ (g: readonly GrantInput[]): Promise<void>;
43
+ }
44
+ /** {@link AuthApi.revoke} as a callable — the exact mirror of {@link GrantFn}. */
45
+ export interface RevokeFn {
46
+ (r: RevokeInput): Promise<void>;
47
+ (r: readonly RevokeInput[]): Promise<void>;
48
+ }
49
+ /** Bind check/grant/revoke onto a call capability and the caller resolver. */
50
+ export declare function createPermissions(call: GraphCall, caller: Caller): {
51
+ check: CheckFn;
52
+ grant: GrantFn;
53
+ revoke: RevokeFn;
54
+ };
55
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMzC,uFAAuF;AACvF,MAAM,MAAM,KAAK,GAAG,cAAc,CAAA;AAElC;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,EAAE,EAAE,GAAG,CAAA;IACP,mDAAmD;IACnD,KAAK,EAAE,KAAK,CAAA;CACb;AAED,oGAAoG;AACpG,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,GAAG,CAAA;IACP,+CAA+C;IAC/C,EAAE,EAAE,GAAG,CAAA;IACP,KAAK,EAAE,KAAK,CAAA;CACb;AAED,0CAA0C;AAC1C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,GAAG,CAAA;IACT,EAAE,EAAE,GAAG,CAAA;IACP,KAAK,EAAE,KAAK,CAAA;CACb;AAED,+FAA+F;AAC/F,MAAM,WAAW,OAAO;IACtB,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACjC,CAAC,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CAC/C;AAED,gGAAgG;AAChG,MAAM,WAAW,OAAO;IACtB,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1C;AAED,kFAAkF;AAClF,MAAM,WAAW,QAAQ;IACvB,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CA2BtD"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Permission verbs — `check` / `grant` / `revoke`, each single-or-batch over one
3
+ * dispatch per entry on the counterparty identity, plus their input shapes.
4
+ */
5
+ import { refRaw } from '../graph/mutate';
6
+ import { IDENTITY_METHOD } from './addressing';
7
+ import { settleAll } from './batch';
8
+ /** Bind check/grant/revoke onto a call capability and the caller resolver. */
9
+ export function createPermissions(call, caller) {
10
+ // One dispatch per entry on the counterparty identity.
11
+ const checkOne = async (q) => (await call(await caller.targetFor(q.who, IDENTITY_METHOD.check), {
12
+ node: refRaw(q.on),
13
+ perms: q.perms,
14
+ }));
15
+ const grantOne = async (g) => {
16
+ await call(await caller.targetFor(g.to, IDENTITY_METHOD.grant), {
17
+ node: refRaw(g.on),
18
+ perms: g.perms,
19
+ });
20
+ };
21
+ const revokeOne = async (r) => {
22
+ await call(await caller.targetFor(r.from, IDENTITY_METHOD.revoke), {
23
+ node: refRaw(r.on),
24
+ perms: r.perms,
25
+ });
26
+ };
27
+ const check = oneOrMany('check', checkOne);
28
+ const grant = oneOrMany('grant', grantOne);
29
+ const revoke = oneOrMany('revoke', revokeOne);
30
+ return { check, grant, revoke };
31
+ }
32
+ /**
33
+ * Fold a single-entry runner into a one-or-many verb: one entry runs directly,
34
+ * an array fans out through `settleAll`. The call site casts back to the
35
+ * verb's overloaded public shape.
36
+ */
37
+ function oneOrMany(op, runOne) {
38
+ return (arg) => {
39
+ // `Array.isArray` can't narrow a `readonly T[]` out of a union (readonly →
40
+ // mutable is unsound), so the array branch is cast to its concrete shape.
41
+ if (Array.isArray(arg)) {
42
+ return settleAll(op, arg.map((entry) => ({ input: entry, run: () => runOne(entry) })));
43
+ }
44
+ return runOne(arg);
45
+ };
46
+ }
47
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAkDnC,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAC/B,IAAe,EACf,MAAc;IAEd,uDAAuD;IACvD,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAa,EAAoB,EAAE,CACzD,CAAC,MAAM,IAAI,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE;QAChE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAClB,KAAK,EAAE,CAAC,CAAC,KAAK;KACf,CAAC,CAAY,CAAA;IAEhB,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAa,EAAiB,EAAE;QACtD,MAAM,IAAI,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE;YAC9D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principal id (one per bound view), and ref→dispatch-address resolution over
4
+ * the shared {@link GraphCall} capability.
5
+ */
6
+ import type { Node } from '@astrale-os/kernel-core';
7
+ import type { GraphCall, Ref } from '../graph';
8
+ /** The resolved caller behind a bound view: identity resolution + verb addressing. */
9
+ export interface Caller {
10
+ /** The authenticated caller's identity node. Always a live syscall — never cached. */
11
+ whoami(): Promise<Node>;
12
+ /** Memoized principal id — concurrent first callers dedup to ONE whoami; cleared on reject. */
13
+ principal(): Promise<string>;
14
+ /** Explicit `Ref` targets it directly (no whoami); else the memoized principal. */
15
+ targetFor(ref: Ref | undefined, slug: string): Promise<string>;
16
+ }
17
+ /** Bind the caller resolver onto a call capability — one principal memo per view. */
18
+ export declare function createCaller(call: GraphCall): Caller;
19
+ //# sourceMappingURL=principal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"principal.d.ts","sourceRoot":"","sources":["../../src/auth/principal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAInD,OAAO,KAAK,EAAE,SAAS,EAAY,GAAG,EAAE,MAAM,UAAU,CAAA;AA0BxD,sFAAsF;AACtF,MAAM,WAAW,MAAM;IACrB,sFAAsF;IACtF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,+FAA+F;IAC/F,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5B,mFAAmF;IACnF,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC/D;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CA0BpD"}