@brud/kernel 0.0.0-stage → 0.0.2

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 (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +63 -2
  3. package/dist/index.d.ts +15 -0
  4. package/dist/index.js +13 -0
  5. package/dist/serviceModules/events.d.ts +1 -0
  6. package/dist/serviceModules/events.js +1 -0
  7. package/dist/serviceModules/exposedApiRegistry.d.ts +1 -0
  8. package/dist/serviceModules/exposedApiRegistry.js +1 -0
  9. package/dist/serviceModules/identityRegistry.d.ts +1 -0
  10. package/dist/serviceModules/identityRegistry.js +1 -0
  11. package/dist/serviceModules/interception.d.ts +1 -0
  12. package/dist/serviceModules/interception.js +1 -0
  13. package/dist/serviceModules/parser.d.ts +1 -0
  14. package/dist/serviceModules/parser.js +1 -0
  15. package/dist/serviceModules/router.d.ts +1 -0
  16. package/dist/serviceModules/router.js +1 -0
  17. package/dist/serviceModules/wasmCage.d.ts +1 -0
  18. package/dist/serviceModules/wasmCage.js +1 -0
  19. package/dist/services/Events/contracts/IEventsService.d.ts +64 -0
  20. package/dist/services/Events/contracts/IEventsService.js +1 -0
  21. package/dist/services/Events/contracts/errors.d.ts +31 -0
  22. package/dist/services/Events/contracts/errors.js +40 -0
  23. package/dist/services/Events/contracts/index.d.ts +3 -0
  24. package/dist/services/Events/contracts/index.js +3 -0
  25. package/dist/services/Events/contracts/tokens.d.ts +2 -0
  26. package/dist/services/Events/contracts/tokens.js +2 -0
  27. package/dist/services/Events/descriptor/EventsDescriptor.d.ts +9 -0
  28. package/dist/services/Events/descriptor/EventsDescriptor.js +56 -0
  29. package/dist/services/Events/descriptor/tokens.d.ts +1 -0
  30. package/dist/services/Events/descriptor/tokens.js +1 -0
  31. package/dist/services/Events/index.d.ts +4 -0
  32. package/dist/services/Events/index.js +4 -0
  33. package/dist/services/Events/orchestrator/EventsService.d.ts +51 -0
  34. package/dist/services/Events/orchestrator/EventsService.js +339 -0
  35. package/dist/services/Events/orchestrator/index.d.ts +2 -0
  36. package/dist/services/Events/orchestrator/index.js +2 -0
  37. package/dist/services/Events/orchestrator/limits.d.ts +22 -0
  38. package/dist/services/Events/orchestrator/limits.js +33 -0
  39. package/dist/services/Events/serviceModule.d.ts +2 -0
  40. package/dist/services/Events/serviceModule.js +5 -0
  41. package/dist/services/ExposedApiRegistry/contracts/IExposedApiRegistry.d.ts +56 -0
  42. package/dist/services/ExposedApiRegistry/contracts/IExposedApiRegistry.js +1 -0
  43. package/dist/services/ExposedApiRegistry/contracts/errors.d.ts +132 -0
  44. package/dist/services/ExposedApiRegistry/contracts/errors.js +195 -0
  45. package/dist/services/ExposedApiRegistry/contracts/index.d.ts +9 -0
  46. package/dist/services/ExposedApiRegistry/contracts/index.js +4 -0
  47. package/dist/services/ExposedApiRegistry/contracts/policy.d.ts +90 -0
  48. package/dist/services/ExposedApiRegistry/contracts/policy.js +169 -0
  49. package/dist/services/ExposedApiRegistry/contracts/registrant.d.ts +37 -0
  50. package/dist/services/ExposedApiRegistry/contracts/registrant.js +36 -0
  51. package/dist/services/ExposedApiRegistry/contracts/types.d.ts +133 -0
  52. package/dist/services/ExposedApiRegistry/contracts/types.js +73 -0
  53. package/dist/services/ExposedApiRegistry/descriptor/ExposedApiRegistryDescriptor.d.ts +44 -0
  54. package/dist/services/ExposedApiRegistry/descriptor/ExposedApiRegistryDescriptor.js +58 -0
  55. package/dist/services/ExposedApiRegistry/descriptor/tokens.d.ts +8 -0
  56. package/dist/services/ExposedApiRegistry/descriptor/tokens.js +8 -0
  57. package/dist/services/ExposedApiRegistry/index.d.ts +6 -0
  58. package/dist/services/ExposedApiRegistry/index.js +5 -0
  59. package/dist/services/ExposedApiRegistry/orchestrator/ExposedApiRegistryService.d.ts +68 -0
  60. package/dist/services/ExposedApiRegistry/orchestrator/ExposedApiRegistryService.js +452 -0
  61. package/dist/services/ExposedApiRegistry/orchestrator/index.d.ts +2 -0
  62. package/dist/services/ExposedApiRegistry/orchestrator/index.js +1 -0
  63. package/dist/services/ExposedApiRegistry/serviceModule.d.ts +10 -0
  64. package/dist/services/ExposedApiRegistry/serviceModule.js +20 -0
  65. package/dist/services/ExposedApiRegistry/storage/protection.d.ts +21 -0
  66. package/dist/services/ExposedApiRegistry/storage/protection.js +35 -0
  67. package/dist/services/ExposedApiRegistry/storage/scopeRecord.d.ts +45 -0
  68. package/dist/services/ExposedApiRegistry/storage/scopeRecord.js +178 -0
  69. package/dist/services/IdentityRegistry/contracts/errors.d.ts +88 -0
  70. package/dist/services/IdentityRegistry/contracts/errors.js +128 -0
  71. package/dist/services/IdentityRegistry/contracts/index.d.ts +5 -0
  72. package/dist/services/IdentityRegistry/contracts/index.js +3 -0
  73. package/dist/services/IdentityRegistry/contracts/types.d.ts +77 -0
  74. package/dist/services/IdentityRegistry/contracts/types.js +18 -0
  75. package/dist/services/IdentityRegistry/descriptor/descriptor.d.ts +36 -0
  76. package/dist/services/IdentityRegistry/descriptor/descriptor.js +44 -0
  77. package/dist/services/IdentityRegistry/descriptor/tokens.d.ts +8 -0
  78. package/dist/services/IdentityRegistry/descriptor/tokens.js +8 -0
  79. package/dist/services/IdentityRegistry/index.d.ts +11 -0
  80. package/dist/services/IdentityRegistry/index.js +6 -0
  81. package/dist/services/IdentityRegistry/orchestrator/IdentityRegistryService.d.ts +47 -0
  82. package/dist/services/IdentityRegistry/orchestrator/IdentityRegistryService.js +240 -0
  83. package/dist/services/IdentityRegistry/serviceModule.d.ts +10 -0
  84. package/dist/services/IdentityRegistry/serviceModule.js +24 -0
  85. package/dist/services/IdentityRegistry/storage/registryDocument.d.ts +55 -0
  86. package/dist/services/IdentityRegistry/storage/registryDocument.js +235 -0
  87. package/dist/services/Interception/contracts/IInterceptionService.d.ts +155 -0
  88. package/dist/services/Interception/contracts/IInterceptionService.js +12 -0
  89. package/dist/services/Interception/contracts/errors.d.ts +26 -0
  90. package/dist/services/Interception/contracts/errors.js +35 -0
  91. package/dist/services/Interception/contracts/index.d.ts +3 -0
  92. package/dist/services/Interception/contracts/index.js +3 -0
  93. package/dist/services/Interception/contracts/tokens.d.ts +2 -0
  94. package/dist/services/Interception/contracts/tokens.js +2 -0
  95. package/dist/services/Interception/descriptor/InterceptionDescriptor.d.ts +9 -0
  96. package/dist/services/Interception/descriptor/InterceptionDescriptor.js +50 -0
  97. package/dist/services/Interception/descriptor/tokens.d.ts +1 -0
  98. package/dist/services/Interception/descriptor/tokens.js +1 -0
  99. package/dist/services/Interception/index.d.ts +4 -0
  100. package/dist/services/Interception/index.js +4 -0
  101. package/dist/services/Interception/orchestrator/InterceptionService.d.ts +40 -0
  102. package/dist/services/Interception/orchestrator/InterceptionService.js +343 -0
  103. package/dist/services/Interception/orchestrator/index.d.ts +1 -0
  104. package/dist/services/Interception/orchestrator/index.js +1 -0
  105. package/dist/services/Interception/serviceModule.d.ts +2 -0
  106. package/dist/services/Interception/serviceModule.js +5 -0
  107. package/dist/services/Parser/contracts/IParserService.d.ts +21 -0
  108. package/dist/services/Parser/contracts/IParserService.js +1 -0
  109. package/dist/services/Parser/contracts/errors.d.ts +25 -0
  110. package/dist/services/Parser/contracts/errors.js +33 -0
  111. package/dist/services/Parser/contracts/index.d.ts +4 -0
  112. package/dist/services/Parser/contracts/index.js +1 -0
  113. package/dist/services/Parser/contracts/types.d.ts +42 -0
  114. package/dist/services/Parser/contracts/types.js +1 -0
  115. package/dist/services/Parser/descriptor/ParserDescriptor.d.ts +23 -0
  116. package/dist/services/Parser/descriptor/ParserDescriptor.js +50 -0
  117. package/dist/services/Parser/descriptor/tokens.d.ts +8 -0
  118. package/dist/services/Parser/descriptor/tokens.js +8 -0
  119. package/dist/services/Parser/index.d.ts +8 -0
  120. package/dist/services/Parser/index.js +8 -0
  121. package/dist/services/Parser/orchestrator/ParserService.d.ts +20 -0
  122. package/dist/services/Parser/orchestrator/ParserService.js +105 -0
  123. package/dist/services/Parser/orchestrator/index.d.ts +1 -0
  124. package/dist/services/Parser/orchestrator/index.js +1 -0
  125. package/dist/services/Parser/parser/indexSynthesis.d.ts +11 -0
  126. package/dist/services/Parser/parser/indexSynthesis.js +13 -0
  127. package/dist/services/Parser/parser/parameters.d.ts +14 -0
  128. package/dist/services/Parser/parser/parameters.js +89 -0
  129. package/dist/services/Parser/parser/scanner.d.ts +48 -0
  130. package/dist/services/Parser/parser/scanner.js +156 -0
  131. package/dist/services/Parser/parser/syntax.d.ts +30 -0
  132. package/dist/services/Parser/parser/syntax.js +34 -0
  133. package/dist/services/Parser/serviceModule.d.ts +2 -0
  134. package/dist/services/Parser/serviceModule.js +5 -0
  135. package/dist/services/Router/bootOptions.d.ts +2 -0
  136. package/dist/services/Router/bootOptions.js +2 -0
  137. package/dist/services/Router/contracts/IRouterService.d.ts +43 -0
  138. package/dist/services/Router/contracts/IRouterService.js +1 -0
  139. package/dist/services/Router/contracts/caller.d.ts +6 -0
  140. package/dist/services/Router/contracts/caller.js +6 -0
  141. package/dist/services/Router/contracts/errors.d.ts +67 -0
  142. package/dist/services/Router/contracts/errors.js +90 -0
  143. package/dist/services/Router/contracts/index.d.ts +8 -0
  144. package/dist/services/Router/contracts/index.js +4 -0
  145. package/dist/services/Router/contracts/kind.d.ts +7 -0
  146. package/dist/services/Router/contracts/kind.js +10 -0
  147. package/dist/services/Router/contracts/registrant.d.ts +23 -0
  148. package/dist/services/Router/contracts/registrant.js +13 -0
  149. package/dist/services/Router/contracts/types.d.ts +110 -0
  150. package/dist/services/Router/contracts/types.js +1 -0
  151. package/dist/services/Router/descriptor/RouterDescriptor.d.ts +32 -0
  152. package/dist/services/Router/descriptor/RouterDescriptor.js +92 -0
  153. package/dist/services/Router/descriptor/tokens.d.ts +9 -0
  154. package/dist/services/Router/descriptor/tokens.js +9 -0
  155. package/dist/services/Router/index.d.ts +4 -0
  156. package/dist/services/Router/index.js +4 -0
  157. package/dist/services/Router/orchestrator/RouterService.d.ts +93 -0
  158. package/dist/services/Router/orchestrator/RouterService.js +457 -0
  159. package/dist/services/Router/orchestrator/index.d.ts +2 -0
  160. package/dist/services/Router/orchestrator/index.js +1 -0
  161. package/dist/services/Router/serviceModule.d.ts +4 -0
  162. package/dist/services/Router/serviceModule.js +22 -0
  163. package/dist/services/WasmCage/index.d.ts +7 -0
  164. package/dist/services/WasmCage/index.js +4 -0
  165. package/dist/services/WasmCage/scripts/prepin.d.ts +1 -0
  166. package/dist/services/WasmCage/scripts/prepin.js +38 -0
  167. package/dist/services/WasmCage/serviceModule.d.ts +12 -0
  168. package/dist/services/WasmCage/serviceModule.js +18 -0
  169. package/dist/services/WasmCage/src/caged.d.ts +121 -0
  170. package/dist/services/WasmCage/src/caged.js +460 -0
  171. package/dist/services/WasmCage/src/descriptor.d.ts +47 -0
  172. package/dist/services/WasmCage/src/descriptor.js +56 -0
  173. package/dist/services/WasmCage/src/native.d.ts +29 -0
  174. package/dist/services/WasmCage/src/native.js +66 -0
  175. package/dist/services/WasmCage/src/nativeDigests.d.ts +9 -0
  176. package/dist/services/WasmCage/src/nativeDigests.js +15 -0
  177. package/dist/services/WasmCage/src/package.d.ts +36 -0
  178. package/dist/services/WasmCage/src/package.js +122 -0
  179. package/dist/services/shared/canonicalJson.d.ts +29 -0
  180. package/dist/services/shared/canonicalJson.js +93 -0
  181. package/dist/services/shared/documentStore.d.ts +16 -0
  182. package/dist/services/shared/documentStore.js +98 -0
  183. package/dist/src/bootstrap/bootKernelInternal.d.ts +19 -0
  184. package/dist/src/bootstrap/bootKernelInternal.js +633 -0
  185. package/dist/src/bootstrap/bootTypes.d.ts +113 -0
  186. package/dist/src/bootstrap/bootTypes.js +1 -0
  187. package/dist/src/bootstrap/config/index.d.ts +3 -0
  188. package/dist/src/bootstrap/config/index.js +2 -0
  189. package/dist/src/bootstrap/config/integrity.d.ts +45 -0
  190. package/dist/src/bootstrap/config/integrity.js +92 -0
  191. package/dist/src/bootstrap/config/parse.d.ts +15 -0
  192. package/dist/src/bootstrap/config/parse.js +81 -0
  193. package/dist/src/bootstrap/config/pathWriteGuard.d.ts +20 -0
  194. package/dist/src/bootstrap/config/pathWriteGuard.js +349 -0
  195. package/dist/src/bootstrap/config/types.d.ts +41 -0
  196. package/dist/src/bootstrap/config/types.js +15 -0
  197. package/dist/src/bootstrap/hardcore.d.ts +212 -0
  198. package/dist/src/bootstrap/hardcore.js +312 -0
  199. package/dist/src/bootstrap/hardcoreServices.d.ts +10 -0
  200. package/dist/src/bootstrap/hardcoreServices.js +258 -0
  201. package/dist/src/bootstrap/index.d.ts +13 -0
  202. package/dist/src/bootstrap/index.js +7 -0
  203. package/dist/src/bootstrap/loaded.d.ts +30 -0
  204. package/dist/src/bootstrap/loaded.js +45 -0
  205. package/dist/src/bootstrap/packageRequirements.d.ts +26 -0
  206. package/dist/src/bootstrap/packageRequirements.js +52 -0
  207. package/dist/src/bootstrap/reload.d.ts +44 -0
  208. package/dist/src/bootstrap/reload.js +45 -0
  209. package/dist/src/bootstrap/seal.d.ts +32 -0
  210. package/dist/src/bootstrap/seal.js +101 -0
  211. package/dist/src/contracts/accessBroker.d.ts +53 -0
  212. package/dist/src/contracts/accessBroker.js +1 -0
  213. package/dist/src/contracts/brudOperation.d.ts +20 -0
  214. package/dist/src/contracts/brudOperation.js +20 -0
  215. package/dist/src/contracts/callChain.d.ts +161 -0
  216. package/dist/src/contracts/callChain.js +19 -0
  217. package/dist/src/contracts/capability.d.ts +26 -0
  218. package/dist/src/contracts/capability.js +26 -0
  219. package/dist/src/contracts/capabilitySet.d.ts +23 -0
  220. package/dist/src/contracts/capabilitySet.js +72 -0
  221. package/dist/src/contracts/container.d.ts +17 -0
  222. package/dist/src/contracts/container.js +8 -0
  223. package/dist/src/contracts/context.d.ts +19 -0
  224. package/dist/src/contracts/context.js +1 -0
  225. package/dist/src/contracts/contextContract.d.ts +132 -0
  226. package/dist/src/contracts/contextContract.js +274 -0
  227. package/dist/src/contracts/dispatchView.d.ts +21 -0
  228. package/dist/src/contracts/dispatchView.js +1 -0
  229. package/dist/src/contracts/handler.d.ts +21 -0
  230. package/dist/src/contracts/handler.js +1 -0
  231. package/dist/src/contracts/index.d.ts +26 -0
  232. package/dist/src/contracts/index.js +9 -0
  233. package/dist/src/contracts/kernel.d.ts +60 -0
  234. package/dist/src/contracts/kernel.js +1 -0
  235. package/dist/src/contracts/lifecycle.d.ts +59 -0
  236. package/dist/src/contracts/lifecycle.js +1 -0
  237. package/dist/src/contracts/manifest.d.ts +180 -0
  238. package/dist/src/contracts/manifest.js +334 -0
  239. package/dist/src/contracts/pipeline.d.ts +8 -0
  240. package/dist/src/contracts/pipeline.js +1 -0
  241. package/dist/src/contracts/policy.d.ts +75 -0
  242. package/dist/src/contracts/policy.js +77 -0
  243. package/dist/src/contracts/registry.d.ts +7 -0
  244. package/dist/src/contracts/registry.js +1 -0
  245. package/dist/src/contracts/serviceDescriptor.d.ts +67 -0
  246. package/dist/src/contracts/serviceDescriptor.js +1 -0
  247. package/dist/src/contracts/serviceToken.d.ts +36 -0
  248. package/dist/src/contracts/serviceToken.js +16 -0
  249. package/dist/src/engine/BrudKernel.d.ts +120 -0
  250. package/dist/src/engine/BrudKernel.js +395 -0
  251. package/dist/src/engine/ExecutionPipeline.d.ts +13 -0
  252. package/dist/src/engine/ExecutionPipeline.js +62 -0
  253. package/dist/src/engine/KernelAccessBroker.d.ts +47 -0
  254. package/dist/src/engine/KernelAccessBroker.js +107 -0
  255. package/dist/src/engine/KernelRegistry.d.ts +14 -0
  256. package/dist/src/engine/KernelRegistry.js +33 -0
  257. package/dist/src/engine/OperationRegistry.d.ts +9 -0
  258. package/dist/src/engine/OperationRegistry.js +18 -0
  259. package/dist/src/engine/ServiceContainer.d.ts +13 -0
  260. package/dist/src/engine/ServiceContainer.js +53 -0
  261. package/dist/src/engine/callChain.d.ts +68 -0
  262. package/dist/src/engine/callChain.js +175 -0
  263. package/dist/src/engine/dag.d.ts +2 -0
  264. package/dist/src/engine/dag.js +34 -0
  265. package/dist/src/engine/errors.d.ts +26 -0
  266. package/dist/src/engine/errors.js +52 -0
  267. package/dist/src/engine/index.d.ts +11 -0
  268. package/dist/src/engine/index.js +8 -0
  269. package/dist/src/engine/state.d.ts +1 -0
  270. package/dist/src/engine/state.js +1 -0
  271. package/dist/src/validation/jsonSchema/compile.d.ts +8 -0
  272. package/dist/src/validation/jsonSchema/compile.js +386 -0
  273. package/dist/src/validation/jsonSchema/index.d.ts +3 -0
  274. package/dist/src/validation/jsonSchema/index.js +2 -0
  275. package/dist/src/validation/jsonSchema/jsonValue.d.ts +29 -0
  276. package/dist/src/validation/jsonSchema/jsonValue.js +190 -0
  277. package/dist/src/validation/jsonSchema/pattern.d.ts +28 -0
  278. package/dist/src/validation/jsonSchema/pattern.js +155 -0
  279. package/dist/src/validation/jsonSchema/types.d.ts +71 -0
  280. package/dist/src/validation/jsonSchema/types.js +15 -0
  281. package/package.json +59 -4
  282. package/services/WasmCage/native/brud-wasm-cage.darwin-arm64.node +0 -0
  283. package/services/WasmCage/native/brud-wasm-cage.darwin-x64.node +0 -0
  284. package/services/WasmCage/native/brud-wasm-cage.linux-arm64-gnu.node +0 -0
  285. package/services/WasmCage/native/brud-wasm-cage.linux-x64-gnu.node +0 -0
  286. package/services/WasmCage/native/brud-wasm-cage.win32-x64-msvc.node +0 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Extensible capability token vocabulary.
3
+ *
4
+ * Capabilities are declared by the service that exposes an API and claimed by
5
+ * callers. They are open strings: the kernel validates their shape, not
6
+ * membership in a closed list. A token is one or more lowercase segments
7
+ * separated by `:`, for example `fs:read` or `photoshop:access`.
8
+ *
9
+ * The kernel provides this mechanism only. A giver that wants a public preset
10
+ * declares it in its own contract; the kernel ships none.
11
+ */
12
+ /**
13
+ * Shape accepted for capability tokens.
14
+ *
15
+ * Lowercase-only keeps diagnostics and manifest comparisons deterministic.
16
+ */
17
+ export const CAPABILITY_TOKEN_PATTERN = /^[a-z][a-z0-9_-]*(?::[a-z][a-z0-9_-]*)*$/;
18
+ /**
19
+ * Validates a declarable capability token.
20
+ *
21
+ * @param value - Untrusted capability.
22
+ * @returns `true` when the value has the accepted capability shape.
23
+ */
24
+ export function isCapabilityToken(value) {
25
+ return typeof value === 'string' && CAPABILITY_TOKEN_PATTERN.test(value);
26
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The one shape in which a caller's capabilities reach a participant.
3
+ *
4
+ * A caller record is created once and passed by reference to every giver that
5
+ * is shown the caller. A plain `Set` cannot be that shape: freezing a Set does
6
+ * not stop `add`, `delete` or `clear`, and `Set.prototype.add.call(set, x)`
7
+ * works on any Set. A giver could then grant any caller it can see
8
+ * capabilities the kernel never granted. This view holds a private copy,
9
+ * offers only the read side of a Set, and has no mutator to reach.
10
+ */
11
+ export declare function createCapabilitySet(values: Iterable<string>): ReadonlySet<string>;
12
+ /** Reports whether a value is a capability view made by {@link createCapabilitySet}. */
13
+ export declare function isCapabilitySet(value: unknown): value is ReadonlySet<string>;
14
+ /**
15
+ * Copies a value for a boundary that carries only plain JSON, replacing every
16
+ * capability view in it with its sorted array. Everything else is left as it
17
+ * is, so a boundary's own plain-value check still refuses what is not plain.
18
+ *
19
+ * @param value - The value to carry across.
20
+ */
21
+ export declare function withPlainCapabilities(value: unknown, depth?: number): unknown;
22
+ /** The capability view of a caller that holds none. */
23
+ export declare const NO_CAPABILITIES: ReadonlySet<string>;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * The one shape in which a caller's capabilities reach a participant.
3
+ *
4
+ * A caller record is created once and passed by reference to every giver that
5
+ * is shown the caller. A plain `Set` cannot be that shape: freezing a Set does
6
+ * not stop `add`, `delete` or `clear`, and `Set.prototype.add.call(set, x)`
7
+ * works on any Set. A giver could then grant any caller it can see
8
+ * capabilities the kernel never granted. This view holds a private copy,
9
+ * offers only the read side of a Set, and has no mutator to reach.
10
+ */
11
+ /**
12
+ * Creates a read-only view of a set of capability tokens.
13
+ *
14
+ * It satisfies `ReadonlySet<string>`: `has`, `size`, `forEach`, `keys`,
15
+ * `values`, `entries` and iteration. Iteration order is sorted, so it is the
16
+ * same for the same capabilities. `toJSON` returns the sorted array, so any
17
+ * JSON boundary carries the capabilities instead of losing them.
18
+ *
19
+ * @param values - The capabilities. Copied; later changes to the source do not show.
20
+ */
21
+ const VIEWS = new WeakSet();
22
+ export function createCapabilitySet(values) {
23
+ const sorted = Object.freeze([...new Set(values)].sort());
24
+ const members = new Set(sorted);
25
+ const view = {
26
+ has: (value) => members.has(value),
27
+ get size() {
28
+ return sorted.length;
29
+ },
30
+ forEach(callback, thisArg) {
31
+ for (const value of sorted) {
32
+ callback.call(thisArg, value, value, view);
33
+ }
34
+ },
35
+ keys: () => sorted.values(),
36
+ values: () => sorted.values(),
37
+ entries: () => sorted.map((value) => [value, value]).values(),
38
+ [Symbol.iterator]: () => sorted.values(),
39
+ toJSON: () => sorted,
40
+ };
41
+ VIEWS.add(view);
42
+ return Object.freeze(view);
43
+ }
44
+ /** Reports whether a value is a capability view made by {@link createCapabilitySet}. */
45
+ export function isCapabilitySet(value) {
46
+ return typeof value === 'object' && value !== null && VIEWS.has(value);
47
+ }
48
+ /**
49
+ * Copies a value for a boundary that carries only plain JSON, replacing every
50
+ * capability view in it with its sorted array. Everything else is left as it
51
+ * is, so a boundary's own plain-value check still refuses what is not plain.
52
+ *
53
+ * @param value - The value to carry across.
54
+ */
55
+ export function withPlainCapabilities(value, depth = 0) {
56
+ if (isCapabilitySet(value)) {
57
+ return [...value];
58
+ }
59
+ if (depth >= 16 || typeof value !== 'object' || value === null) {
60
+ return value;
61
+ }
62
+ if (Array.isArray(value)) {
63
+ return value.map((item) => withPlainCapabilities(item, depth + 1));
64
+ }
65
+ const prototype = Object.getPrototypeOf(value);
66
+ if (prototype !== Object.prototype && prototype !== null) {
67
+ return value;
68
+ }
69
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, withPlainCapabilities(item, depth + 1)]));
70
+ }
71
+ /** The capability view of a caller that holds none. */
72
+ export const NO_CAPABILITIES = createCapabilitySet([]);
@@ -0,0 +1,17 @@
1
+ export type Token<T> = symbol & {
2
+ __brand: T;
3
+ };
4
+ /**
5
+ * Planned: the token-keyed container is a universal kernel primitive. It is
6
+ * constructed and consulted by the dispatch pipeline; no production module
7
+ * registers into it yet.
8
+ */
9
+ export declare function createToken<T>(description: string): Token<T>;
10
+ export interface IServiceContainer {
11
+ register<T>(token: Token<T>, provider: T | (() => T)): void;
12
+ resolve<T>(token: Token<T>): T;
13
+ has<T>(token: Token<T>): boolean;
14
+ createChildScope(): IServiceContainer;
15
+ freeze(): void;
16
+ readonly isFrozen: boolean;
17
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Planned: the token-keyed container is a universal kernel primitive. It is
3
+ * constructed and consulted by the dispatch pipeline; no production module
4
+ * registers into it yet.
5
+ */
6
+ export function createToken(description) {
7
+ return Symbol(description);
8
+ }
@@ -0,0 +1,19 @@
1
+ import type { Token } from './container.js';
2
+ import type { OperationResult } from './handler.js';
3
+ export interface ExecutionContext {
4
+ readonly sessionId: string;
5
+ /**
6
+ * Opaque host-supplied options bag.
7
+ *
8
+ * The kernel stores the bag at boot and attaches it unchanged to every
9
+ * execution context. The core never inspects a key; operations read the
10
+ * options their own domain owns.
11
+ */
12
+ readonly options: Readonly<Record<string, unknown>>;
13
+ readonly signal?: AbortSignal;
14
+ readonly callDepth: number;
15
+ readonly metadata?: Record<string, unknown>;
16
+ resolve<T>(token: Token<T>): T;
17
+ invoke<TInput, TOutput>(kind: string, input: TInput): Promise<OperationResult<TOutput>>;
18
+ createChildContext(overrides?: Partial<ExecutionContext>): ExecutionContext;
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Dynamic context contract.
3
+ *
4
+ * Services declare the fields they need from the host-supplied options bag.
5
+ * The core builds one schema from those declarations, enforces it at the boot
6
+ * and runtime boundaries, and never names a concrete field itself.
7
+ *
8
+ * Each participant declares only its own fields under its own namespace and
9
+ * reads only its own fields. The bag is owner-namespaced and opaque to the
10
+ * kernel core, and no kernel code synthesizes a context field. Secrets never
11
+ * travel in the bag: every participant constructed by the kernel receives it.
12
+ */
13
+ /** Primitive types the contract understands. */
14
+ export declare const CONTEXT_FIELD_TYPES: readonly ["string", "number", "boolean", "object"];
15
+ /** A supported context field type. */
16
+ export type ContextFieldType = (typeof CONTEXT_FIELD_TYPES)[number];
17
+ /** One field a service requires or accepts from the options bag. */
18
+ export interface ContextFieldDeclaration {
19
+ /** Dotted field name inside the declaring service's namespace. */
20
+ readonly name: string;
21
+ /** Primitive type the value must have. */
22
+ readonly type: ContextFieldType;
23
+ /** Whether the field must be present when a context is created. */
24
+ readonly required: boolean;
25
+ /** Short explanation of what the field is for. */
26
+ readonly description: string;
27
+ }
28
+ /** One service's set of declarations for a single namespace. */
29
+ export interface ContextScopeDeclaration {
30
+ /** Namespace owned by the declaring service. */
31
+ readonly scope: string;
32
+ /** Fields declared inside that namespace. */
33
+ readonly fields: readonly ContextFieldDeclaration[];
34
+ }
35
+ /** A field after the kernel has accepted a declaration. */
36
+ export interface ContextFieldSchema extends ContextFieldDeclaration {
37
+ /** Service that owns the namespace and declared the field. */
38
+ readonly service: string;
39
+ }
40
+ /** The complete, introspectable contract for one kernel. */
41
+ export interface ContextSchema {
42
+ /** Whether further declarations are rejected. */
43
+ readonly locked: boolean;
44
+ /** Accepted fields in declaration order. */
45
+ readonly fields: readonly ContextFieldSchema[];
46
+ }
47
+ /** Stable failure code for every contract violation. */
48
+ export type ContextContractErrorCode = 'CONTEXT_CONTRACT_VIOLATION';
49
+ /** Raised when a declaration, a field name, or a value violates the contract. */
50
+ export declare class ContextContractError extends Error {
51
+ readonly code: ContextContractErrorCode;
52
+ /** Field involved in the violation, when one exists. */
53
+ readonly field: string | undefined;
54
+ /** Namespace/service involved in the violation, when one exists. */
55
+ readonly service: string | undefined;
56
+ /** Expected primitive type, when the violation is a type mismatch. */
57
+ readonly expectedType: ContextFieldType | undefined;
58
+ /** Actual value type observed, when the violation is a type mismatch. */
59
+ readonly actualType: string | undefined;
60
+ constructor(message: string, details?: {
61
+ readonly field?: string;
62
+ readonly service?: string;
63
+ readonly expectedType?: ContextFieldType;
64
+ readonly actualType?: string;
65
+ });
66
+ }
67
+ /**
68
+ * Reads a required non-empty string field from an options bag.
69
+ *
70
+ * The field name is supplied by the service; the core does not know any
71
+ * concrete field. This is the descriptor-level read used after contract
72
+ * validation, and it also protects standalone descriptor construction.
73
+ *
74
+ * @param options - Opaque options bag.
75
+ * @param field - Dotted field name owned by the calling service.
76
+ * @param service - Service id used in the error.
77
+ * @returns The string value.
78
+ * @throws {ContextContractError} When the value is absent or not a non-empty
79
+ * string.
80
+ */
81
+ export declare function requireContextString(options: Readonly<Record<string, unknown>>, field: string, service: string): string;
82
+ /**
83
+ * Per-kernel declaration store and validator.
84
+ *
85
+ * The class is generic: it understands dotted namespaces, primitive types, and
86
+ * ownership, but no concrete field name.
87
+ */
88
+ export declare class ContextContract {
89
+ private readonly fields;
90
+ private readonly owners;
91
+ private locked;
92
+ /** `true` once the kernel has reached `RUNNING`. */
93
+ get isLocked(): boolean;
94
+ /**
95
+ * Records one service's declarations.
96
+ *
97
+ * @param ownerId - Stable identity of the declaring module.
98
+ * @param scopeOrDeclaration - Namespace string or a complete scope declaration.
99
+ * @param fields - Fields to declare when the second argument is a scope string.
100
+ */
101
+ declare(ownerId: string, scopeOrDeclaration: string | ContextScopeDeclaration, fields?: readonly ContextFieldDeclaration[]): void;
102
+ /**
103
+ * Validates an options bag against every accepted declaration.
104
+ *
105
+ * @param options - Host-supplied values carried through unchanged.
106
+ * @throws {ContextContractError} When a required field is missing or a value
107
+ * has the wrong type.
108
+ */
109
+ validate(options: Readonly<Record<string, unknown>>): void;
110
+ /**
111
+ * Refuses a string option that is not a dotted namespace path.
112
+ *
113
+ * String-valued options are contract fields. Flat aliases have no service
114
+ * owner and cannot be read, so one is reported as that, not as a missing
115
+ * field.
116
+ *
117
+ * @param options - Host-supplied values.
118
+ * @throws {ContextContractError} When a flat string option is present.
119
+ */
120
+ assertNamespaced(options: Readonly<Record<string, unknown>>): void;
121
+ /**
122
+ * Lists, per declaring owner, the required fields the bag does not carry.
123
+ *
124
+ * @param options - Host-supplied values.
125
+ * @returns Owner id mapped to its missing required field names.
126
+ */
127
+ missingRequiredByOwner(options: Readonly<Record<string, unknown>>): ReadonlyMap<string, readonly string[]>;
128
+ /** Prevents any further declaration. */
129
+ lock(): void;
130
+ /** Returns an immutable snapshot of the current schema. */
131
+ schema(): ContextSchema;
132
+ }
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Dynamic context contract.
3
+ *
4
+ * Services declare the fields they need from the host-supplied options bag.
5
+ * The core builds one schema from those declarations, enforces it at the boot
6
+ * and runtime boundaries, and never names a concrete field itself.
7
+ *
8
+ * Each participant declares only its own fields under its own namespace and
9
+ * reads only its own fields. The bag is owner-namespaced and opaque to the
10
+ * kernel core, and no kernel code synthesizes a context field. Secrets never
11
+ * travel in the bag: every participant constructed by the kernel receives it.
12
+ */
13
+ /** Primitive types the contract understands. */
14
+ export const CONTEXT_FIELD_TYPES = ['string', 'number', 'boolean', 'object'];
15
+ /** Raised when a declaration, a field name, or a value violates the contract. */
16
+ export class ContextContractError extends Error {
17
+ code = 'CONTEXT_CONTRACT_VIOLATION';
18
+ /** Field involved in the violation, when one exists. */
19
+ field;
20
+ /** Namespace/service involved in the violation, when one exists. */
21
+ service;
22
+ /** Expected primitive type, when the violation is a type mismatch. */
23
+ expectedType;
24
+ /** Actual value type observed, when the violation is a type mismatch. */
25
+ actualType;
26
+ constructor(message, details = {}) {
27
+ super(message);
28
+ this.name = 'ContextContractError';
29
+ this.field = details.field;
30
+ this.service = details.service;
31
+ this.expectedType = details.expectedType;
32
+ this.actualType = details.actualType;
33
+ }
34
+ }
35
+ const SCOPE_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/u;
36
+ const SEGMENT_PATTERN = /^[A-Za-z0-9_-]+$/u;
37
+ function isRecord(value) {
38
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
39
+ }
40
+ function isContextFieldType(value) {
41
+ return typeof value === 'string'
42
+ && CONTEXT_FIELD_TYPES.includes(value);
43
+ }
44
+ function describeValueType(value) {
45
+ if (value === null) {
46
+ return 'null';
47
+ }
48
+ if (Array.isArray(value)) {
49
+ return 'array';
50
+ }
51
+ return typeof value;
52
+ }
53
+ function matchesType(value, type) {
54
+ switch (type) {
55
+ case 'string':
56
+ return typeof value === 'string';
57
+ case 'number':
58
+ return typeof value === 'number' && !Number.isNaN(value);
59
+ case 'boolean':
60
+ return typeof value === 'boolean';
61
+ case 'object':
62
+ return isRecord(value);
63
+ }
64
+ }
65
+ /**
66
+ * Reads a required non-empty string field from an options bag.
67
+ *
68
+ * The field name is supplied by the service; the core does not know any
69
+ * concrete field. This is the descriptor-level read used after contract
70
+ * validation, and it also protects standalone descriptor construction.
71
+ *
72
+ * @param options - Opaque options bag.
73
+ * @param field - Dotted field name owned by the calling service.
74
+ * @param service - Service id used in the error.
75
+ * @returns The string value.
76
+ * @throws {ContextContractError} When the value is absent or not a non-empty
77
+ * string.
78
+ */
79
+ export function requireContextString(options, field, service) {
80
+ const value = options[field];
81
+ if (typeof value !== 'string' || value.length === 0) {
82
+ throw new ContextContractError(`${service} requires the non-empty string context field "${field}" (options['${field}']).`, {
83
+ field,
84
+ service,
85
+ expectedType: 'string',
86
+ actualType: value === undefined ? 'missing' : describeValueType(value),
87
+ });
88
+ }
89
+ return value;
90
+ }
91
+ function assertScope(scope) {
92
+ if (typeof scope !== 'string' || !SCOPE_PATTERN.test(scope)) {
93
+ throw new ContextContractError(`Invalid context namespace "${String(scope)}". A namespace must start with a letter and contain only letters, digits, "_" or "-".`);
94
+ }
95
+ }
96
+ function assertFieldName(scope, name) {
97
+ if (typeof name !== 'string') {
98
+ throw new ContextContractError(`A context field declared by namespace "${scope}" must have a string name.`, { service: scope });
99
+ }
100
+ const segments = name.split('.');
101
+ if (segments.length < 2 || segments.some((segment) => !SEGMENT_PATTERN.test(segment))) {
102
+ throw new ContextContractError(`Field "${name}" declared by namespace "${scope}" must be a dotted path such as "${scope}.name".`, { field: name, service: scope });
103
+ }
104
+ if (segments[0] !== scope) {
105
+ throw new ContextContractError(`Namespace "${scope}" cannot declare field "${name}"; declarations must stay inside the "${scope}." namespace.`, { field: name, service: scope });
106
+ }
107
+ }
108
+ function assertDeclaration(scope, declaration) {
109
+ if (!isRecord(declaration)) {
110
+ throw new ContextContractError(`Namespace "${scope}" supplied a context field declaration that is not an object.`, { service: scope });
111
+ }
112
+ assertFieldName(scope, declaration.name);
113
+ if (!isContextFieldType(declaration.type)) {
114
+ throw new ContextContractError(`Field "${declaration.name}" declared by namespace "${scope}" has unsupported type "${String(declaration.type)}". Expected one of: ${CONTEXT_FIELD_TYPES.join(', ')}.`, { field: declaration.name, service: scope });
115
+ }
116
+ if (typeof declaration.required !== 'boolean') {
117
+ throw new ContextContractError(`Field "${declaration.name}" declared by namespace "${scope}" must set "required" to a boolean.`, { field: declaration.name, service: scope });
118
+ }
119
+ if (typeof declaration.description !== 'string' || declaration.description.length === 0) {
120
+ throw new ContextContractError(`Field "${declaration.name}" declared by namespace "${scope}" must include a non-empty description.`, { field: declaration.name, service: scope });
121
+ }
122
+ }
123
+ function normalizeDeclaration(scopeOrDeclaration, fields) {
124
+ if (typeof scopeOrDeclaration === 'string') {
125
+ return { scope: scopeOrDeclaration, fields: fields ?? [] };
126
+ }
127
+ if (!isRecord(scopeOrDeclaration)
128
+ || typeof scopeOrDeclaration.scope !== 'string'
129
+ || !Array.isArray(scopeOrDeclaration.fields)) {
130
+ throw new ContextContractError('A context contract declaration requires a scope string and a fields array.');
131
+ }
132
+ return {
133
+ scope: scopeOrDeclaration.scope,
134
+ fields: scopeOrDeclaration.fields,
135
+ };
136
+ }
137
+ /**
138
+ * Per-kernel declaration store and validator.
139
+ *
140
+ * The class is generic: it understands dotted namespaces, primitive types, and
141
+ * ownership, but no concrete field name.
142
+ */
143
+ export class ContextContract {
144
+ fields = new Map();
145
+ owners = new Map();
146
+ locked = false;
147
+ /** `true` once the kernel has reached `RUNNING`. */
148
+ get isLocked() {
149
+ return this.locked;
150
+ }
151
+ /**
152
+ * Records one service's declarations.
153
+ *
154
+ * @param ownerId - Stable identity of the declaring module.
155
+ * @param scopeOrDeclaration - Namespace string or a complete scope declaration.
156
+ * @param fields - Fields to declare when the second argument is a scope string.
157
+ */
158
+ declare(ownerId, scopeOrDeclaration, fields) {
159
+ const { scope, fields: declarations } = normalizeDeclaration(scopeOrDeclaration, fields);
160
+ assertScope(scope);
161
+ if (this.locked) {
162
+ throw new ContextContractError(`Context contract is locked; namespace "${scope}" cannot declare new fields after the kernel reached RUNNING.`, { service: scope });
163
+ }
164
+ const owner = this.owners.get(scope);
165
+ if (owner !== undefined && owner !== ownerId) {
166
+ throw new ContextContractError(`Context namespace "${scope}" is already owned by another service; a namespace can only be declared by its owning service.`, { service: scope });
167
+ }
168
+ if (owner === undefined) {
169
+ this.owners.set(scope, ownerId);
170
+ }
171
+ for (const declaration of declarations) {
172
+ assertDeclaration(scope, declaration);
173
+ const existing = this.fields.get(declaration.name);
174
+ if (existing !== undefined) {
175
+ throw new ContextContractError(`Field "${declaration.name}" is already declared by namespace "${existing.service}".`, { field: declaration.name, service: scope });
176
+ }
177
+ this.fields.set(declaration.name, {
178
+ name: declaration.name,
179
+ type: declaration.type,
180
+ required: declaration.required,
181
+ description: declaration.description,
182
+ service: scope,
183
+ ownerId,
184
+ });
185
+ }
186
+ }
187
+ /**
188
+ * Validates an options bag against every accepted declaration.
189
+ *
190
+ * @param options - Host-supplied values carried through unchanged.
191
+ * @throws {ContextContractError} When a required field is missing or a value
192
+ * has the wrong type.
193
+ */
194
+ validate(options) {
195
+ this.assertNamespaced(options);
196
+ for (const field of this.fields.values()) {
197
+ const value = options[field.name];
198
+ if (value === undefined) {
199
+ if (field.required) {
200
+ throw new ContextContractError(`Required context field "${field.name}" declared by service "${field.service}" is missing. Expected ${field.type}.`, {
201
+ field: field.name,
202
+ service: field.service,
203
+ expectedType: field.type,
204
+ actualType: 'missing',
205
+ });
206
+ }
207
+ continue;
208
+ }
209
+ if (!matchesType(value, field.type)) {
210
+ throw new ContextContractError(`Context field "${field.name}" declared by service "${field.service}" must be of type ${field.type}; received ${describeValueType(value)}.`, {
211
+ field: field.name,
212
+ service: field.service,
213
+ expectedType: field.type,
214
+ actualType: describeValueType(value),
215
+ });
216
+ }
217
+ }
218
+ }
219
+ /**
220
+ * Refuses a string option that is not a dotted namespace path.
221
+ *
222
+ * String-valued options are contract fields. Flat aliases have no service
223
+ * owner and cannot be read, so one is reported as that, not as a missing
224
+ * field.
225
+ *
226
+ * @param options - Host-supplied values.
227
+ * @throws {ContextContractError} When a flat string option is present.
228
+ */
229
+ assertNamespaced(options) {
230
+ for (const [key, value] of Object.entries(options)) {
231
+ if (this.fields.has(key)) {
232
+ continue;
233
+ }
234
+ if (typeof value === 'string' && !key.includes('.')) {
235
+ throw new ContextContractError(`Un-namespaced string context option "${key}" is forbidden; use a dotted service namespace.`, { field: key, actualType: 'string' });
236
+ }
237
+ }
238
+ }
239
+ /**
240
+ * Lists, per declaring owner, the required fields the bag does not carry.
241
+ *
242
+ * @param options - Host-supplied values.
243
+ * @returns Owner id mapped to its missing required field names.
244
+ */
245
+ missingRequiredByOwner(options) {
246
+ const missing = new Map();
247
+ for (const field of this.fields.values()) {
248
+ if (field.required && options[field.name] === undefined) {
249
+ const names = missing.get(field.ownerId) ?? [];
250
+ names.push(field.name);
251
+ missing.set(field.ownerId, names);
252
+ }
253
+ }
254
+ return missing;
255
+ }
256
+ /** Prevents any further declaration. */
257
+ lock() {
258
+ this.locked = true;
259
+ }
260
+ /** Returns an immutable snapshot of the current schema. */
261
+ schema() {
262
+ const fields = [...this.fields.values()].map((field) => Object.freeze({
263
+ name: field.name,
264
+ type: field.type,
265
+ required: field.required,
266
+ description: field.description,
267
+ service: field.service,
268
+ }));
269
+ return Object.freeze({
270
+ locked: this.locked,
271
+ fields: Object.freeze(fields),
272
+ });
273
+ }
274
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The caller of a routed operation, as recorded on the kernel call chain.
3
+ * It is never taken from the request. `capabilities` is the same read-only
4
+ * view every participant sees for a caller.
5
+ */
6
+ export interface DispatchCallerView {
7
+ readonly identity: string | null;
8
+ readonly callerClass: string;
9
+ readonly official: boolean;
10
+ readonly capabilities: ReadonlySet<string>;
11
+ readonly origin: string;
12
+ }
13
+ /** What a kind's dispatch exposure receives for one operation. */
14
+ export interface DispatchContextView {
15
+ /** Kernel-derived caller of the route request. */
16
+ readonly caller: DispatchCallerView;
17
+ /** Cancellation signal, when the transport supplied one. */
18
+ readonly signal?: AbortSignal;
19
+ /** Validate only; do not execute. */
20
+ readonly dryRun?: boolean;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { Token } from './container.js';
2
+ import type { ExecutionContext } from './context.js';
3
+ export interface OperationResult<TData = unknown> {
4
+ status: "success" | "failed" | "aborted" | "skipped";
5
+ data?: TData;
6
+ message?: string;
7
+ error?: Error | string;
8
+ durationMs?: number;
9
+ }
10
+ export interface PromptDescriptor {
11
+ readonly description: string;
12
+ readonly syntaxGuide?: string;
13
+ readonly systemPromptFragment?: string;
14
+ readonly examples?: readonly string[];
15
+ }
16
+ export interface OperationHandler<TInput = unknown, TOutput = unknown> {
17
+ readonly kind: string;
18
+ readonly requiredCapabilities?: readonly Token<unknown>[];
19
+ readonly promptDescriptor?: PromptDescriptor;
20
+ execute(context: ExecutionContext, input: TInput): Promise<OperationResult<TOutput>>;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ export type { ServiceToken, InferService } from './serviceToken.js';
2
+ export { createServiceToken } from './serviceToken.js';
3
+ export type { ServiceAccessPolicy } from './policy.js';
4
+ export { AccessDeniedError, BlacklistedAccessViolationError, AllowlistViolationError, CallerIdentityMismatchError, } from './policy.js';
5
+ export type { ServiceTier, ServiceContext, IServiceLifecycle, KernelLogger, } from './lifecycle.js';
6
+ export type { ServiceInfo, IKernelAccessBroker } from './accessBroker.js';
7
+ export type { ServiceDescriptor, ServiceContractDeclaration, } from './serviceDescriptor.js';
8
+ export type { KernelBootOptions, IBrudKernel } from './kernel.js';
9
+ export type { CallOrigin, CallerClass, KernelCallAuthority, KernelCallContext, KernelCallLimits, KernelCaller, KernelHostSession, KernelObservation, } from './callChain.js';
10
+ export { CALLER_CLASSES, CALL_ORIGINS, DEFAULT_KERNEL_CALL_LIMITS, } from './callChain.js';
11
+ export type { AdmittedManifest, EventDeclaration, InterceptionDeclaration, InterceptionPointDeclaration, KindDeclaration, ExposureDeclaration, ParticipantManifest, ParticipantRequests, } from './manifest.js';
12
+ export { ParticipantManifestError, admitParticipantManifest, } from './manifest.js';
13
+ export type { Token } from './container.js';
14
+ export { createToken } from './container.js';
15
+ export type { IServiceContainer } from './container.js';
16
+ export type { ExecutionContext } from './context.js';
17
+ export type { ContextContractErrorCode, ContextFieldDeclaration, ContextFieldSchema, ContextFieldType, ContextSchema, ContextScopeDeclaration, } from './contextContract.js';
18
+ export { CONTEXT_FIELD_TYPES, ContextContract, ContextContractError, requireContextString, } from './contextContract.js';
19
+ export type { OperationResult, OperationHandler, PromptDescriptor } from './handler.js';
20
+ export type { CapabilityToken } from './capability.js';
21
+ export { CAPABILITY_TOKEN_PATTERN, isCapabilityToken, } from './capability.js';
22
+ export type { BrudOperationKind } from './brudOperation.js';
23
+ export { BRUD_KIND_PATTERN, isValidBrudKind, } from './brudOperation.js';
24
+ export type { MiddlewareNext, Middleware, IExecutionPipeline } from './pipeline.js';
25
+ export type { IOperationRegistry } from './registry.js';
26
+ export { NO_CAPABILITIES, createCapabilitySet, isCapabilitySet, withPlainCapabilities } from './capabilitySet.js';
@@ -0,0 +1,9 @@
1
+ export { createServiceToken } from './serviceToken.js';
2
+ export { AccessDeniedError, BlacklistedAccessViolationError, AllowlistViolationError, CallerIdentityMismatchError, } from './policy.js';
3
+ export { CALLER_CLASSES, CALL_ORIGINS, DEFAULT_KERNEL_CALL_LIMITS, } from './callChain.js';
4
+ export { ParticipantManifestError, admitParticipantManifest, } from './manifest.js';
5
+ export { createToken } from './container.js';
6
+ export { CONTEXT_FIELD_TYPES, ContextContract, ContextContractError, requireContextString, } from './contextContract.js';
7
+ export { CAPABILITY_TOKEN_PATTERN, isCapabilityToken, } from './capability.js';
8
+ export { BRUD_KIND_PATTERN, isValidBrudKind, } from './brudOperation.js';
9
+ export { NO_CAPABILITIES, createCapabilitySet, isCapabilitySet, withPlainCapabilities } from './capabilitySet.js';