@almadar/shell-runtime 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/chunk-57SBCUSM.js +62 -0
  2. package/dist/chunk-625EP7W2.js +108 -0
  3. package/dist/{chunk-NATGCIVM.js → chunk-7WB6VWRK.js} +344 -129
  4. package/dist/{chunk-Q2H75UYT.js → chunk-A2JJT4GA.js} +1 -37
  5. package/dist/chunk-BAS26HBN.js +10 -0
  6. package/dist/{chunk-REPX5QPI.js → chunk-BOVU4TCQ.js} +11 -3
  7. package/dist/chunk-BY5G4225.js +6 -0
  8. package/dist/chunk-DFDNHVDW.js +284 -0
  9. package/dist/chunk-I3TKINSO.js +398 -0
  10. package/dist/{chunk-DYOJGLIX.js → chunk-LKWYCYX5.js} +2 -5
  11. package/dist/chunk-LYFIQPXX.js +1 -0
  12. package/dist/{chunk-VNMG7NKY.js → chunk-MU335ZA4.js} +20 -26
  13. package/dist/{chunk-ODJCZ27I.js → chunk-N7HYNKK6.js} +35 -2
  14. package/dist/{chunk-4J2QEIUV.js → chunk-NTFQ36UN.js} +4 -30
  15. package/dist/chunk-NU6LVKGS.js +15 -0
  16. package/dist/chunk-P2N6K2IV.js +20 -0
  17. package/dist/{chunk-QQRDUMB2.js → chunk-QCJWPXLH.js} +11 -11
  18. package/dist/{chunk-QELZ6TEJ.js → chunk-UD2CXYSJ.js} +39 -3
  19. package/dist/{chunk-UJHOUZAL.js → chunk-V4EMDPCO.js} +2 -5
  20. package/dist/chunk-VNGXRYFF.js +9 -0
  21. package/dist/{chunk-HNOAZWFH.js → chunk-WGCWJOT2.js} +2 -0
  22. package/dist/chunk-X6W44WHO.js +26 -0
  23. package/dist/chunk-ZUSM4VW4.js +197 -0
  24. package/dist/client/EventTransport.d.ts +23 -7
  25. package/dist/client/EventTransport.js +1 -2
  26. package/dist/client/awaiting.js +0 -1
  27. package/dist/client/channel-transport.d.ts +6 -6
  28. package/dist/client/channel-transport.js +0 -1
  29. package/dist/client/circuit-store.d.ts +16 -5
  30. package/dist/client/circuit-store.js +2 -3
  31. package/dist/client/client-kernel.d.ts +36 -15
  32. package/dist/client/declared-input-dispatch.d.ts +19 -2
  33. package/dist/client/declared-input-dispatch.js +1 -2
  34. package/dist/client/inbound-dispatch.d.ts +21 -2
  35. package/dist/client/inbound-dispatch.js +1 -2
  36. package/dist/client/local-fold.d.ts +15 -8
  37. package/dist/client/local-fold.js +1 -2
  38. package/dist/client/render-sigils.js +0 -1
  39. package/dist/client/state-book.d.ts +9 -16
  40. package/dist/client/state-book.js +1 -2
  41. package/dist/client/trait-mount-error.js +0 -1
  42. package/dist/credentials/env-vars.d.ts +5 -1
  43. package/dist/credentials/env-vars.js +1 -3
  44. package/dist/credentials/scope.d.ts +8 -7
  45. package/dist/credentials/scope.js +0 -1
  46. package/dist/credentials/vault.d.ts +142 -0
  47. package/dist/credentials/vault.js +1 -0
  48. package/dist/effects/in-flight-calls.js +0 -1
  49. package/dist/effects/on-device-model.js +0 -1
  50. package/dist/events/EventBus.d.ts +1 -4
  51. package/dist/events/EventBus.js +0 -1
  52. package/dist/events/emit-stamp.js +0 -1
  53. package/dist/index.d.ts +25 -42
  54. package/dist/index.js +27 -45
  55. package/dist/kernel/decode.d.ts +8 -10
  56. package/dist/kernel/decode.js +1 -2
  57. package/dist/kernel/engine.d.ts +132 -31
  58. package/dist/kernel/engine.js +7 -9
  59. package/dist/kernel/frame-applier.d.ts +8 -7
  60. package/dist/kernel/frame-applier.js +1 -2
  61. package/dist/kernel/host.d.ts +127 -16
  62. package/dist/kernel/host.js +4 -7
  63. package/dist/kernel/lane.d.ts +1 -22
  64. package/dist/kernel/lane.js +1 -2
  65. package/dist/kernel/os-fetch-port.d.ts +7 -0
  66. package/dist/kernel/os-fetch-port.js +3 -0
  67. package/dist/kernel/os-port.d.ts +30 -8
  68. package/dist/kernel/os-port.js +1 -2
  69. package/dist/kernel/program-effects.d.ts +11 -28
  70. package/dist/kernel/program-effects.js +1 -2
  71. package/dist/kernel/secret-ports.d.ts +139 -0
  72. package/dist/kernel/secret-ports.js +2 -0
  73. package/dist/kernel/wire.d.ts +50 -12
  74. package/dist/loader/fetch-loader.d.ts +26 -0
  75. package/dist/loader/fetch-loader.js +1 -0
  76. package/dist/loader/lazy-page.js +0 -1
  77. package/dist/loader/schema-loader.d.ts +1 -17
  78. package/dist/persistence/native-memory.js +0 -1
  79. package/dist/runtime/entities/declaredCollections.d.ts +6 -0
  80. package/dist/runtime/entities/declaredCollections.js +1 -0
  81. package/dist/runtime/evaluation/local-store-transport.d.ts +14 -23
  82. package/dist/runtime/evaluation/local-store-transport.js +9 -13
  83. package/dist/runtime/evaluation/residence-transport.d.ts +3 -3
  84. package/dist/runtime/evaluation/residence-transport.js +1 -2
  85. package/dist/runtime/evaluation/routed-persistence.js +0 -1
  86. package/dist/runtime/events/identity/routing.d.ts +2 -53
  87. package/dist/runtime/events/identity/routing.js +1 -2
  88. package/dist/runtime/types.d.ts +5 -205
  89. package/dist/runtime/types.js +1 -2
  90. package/dist/service/default-call-service.js +0 -1
  91. package/dist/service/service-provider.js +0 -1
  92. package/package.json +8 -5
  93. package/dist/chunk-2JU7Y4KU.js +0 -21
  94. package/dist/chunk-46RWK2B5.js +0 -28
  95. package/dist/chunk-4ZICQ5PM.js +0 -192
  96. package/dist/chunk-53IPZXDP.js +0 -76
  97. package/dist/chunk-5D63EMO5.js +0 -16
  98. package/dist/chunk-CPSQXEJ6.js +0 -55
  99. package/dist/chunk-CQP5XAX6.js +0 -173
  100. package/dist/chunk-CROS2GEX.js +0 -49
  101. package/dist/chunk-D4XJTBLB.js +0 -217
  102. package/dist/chunk-D5USD2EX.js +0 -232
  103. package/dist/chunk-EV56K4GB.js +0 -63
  104. package/dist/chunk-FQ6IZMIU.js +0 -10
  105. package/dist/chunk-HMK6YMQS.js +0 -135
  106. package/dist/chunk-IHQLE5M7.js +0 -62
  107. package/dist/chunk-JFWFDUTR.js +0 -35
  108. package/dist/chunk-MHYSHSRG.js +0 -54
  109. package/dist/chunk-MLKGABMK.js +0 -7
  110. package/dist/chunk-NAECVIAR.js +0 -322
  111. package/dist/chunk-Q7JK4KY7.js +0 -9
  112. package/dist/chunk-RBUMDYFS.js +0 -681
  113. package/dist/chunk-SAS5KKCR.js +0 -43
  114. package/dist/chunk-SWPDU752.js +0 -28
  115. package/dist/chunk-T775TUCD.js +0 -18
  116. package/dist/chunk-VMOBW7RK.js +0 -21
  117. package/dist/chunk-WNPNNYXY.js +0 -22
  118. package/dist/chunk-XB5GYODW.js +0 -28
  119. package/dist/chunk-YL2SO5TP.js +0 -334
  120. package/dist/chunk-YO4LWS3I.js +0 -606
  121. package/dist/chunk-ZAQSS47X.js +0 -157
  122. package/dist/chunk-ZCQUUJIF.js +0 -129
  123. package/dist/client/ServerBridge.d.ts +0 -126
  124. package/dist/client/ServerBridge.js +0 -3
  125. package/dist/credentials/seed.d.ts +0 -21
  126. package/dist/credentials/seed.js +0 -2
  127. package/dist/credentials/store.d.ts +0 -110
  128. package/dist/credentials/store.js +0 -2
  129. package/dist/index-hT1xCdTq.d.ts +0 -46
  130. package/dist/kernel/beacon.d.ts +0 -32
  131. package/dist/kernel/beacon.js +0 -2
  132. package/dist/kernel/http.d.ts +0 -302
  133. package/dist/kernel/http.js +0 -6
  134. package/dist/kernel/oauth-effects.d.ts +0 -25
  135. package/dist/kernel/oauth-effects.js +0 -7
  136. package/dist/kernel/oauth-port.d.ts +0 -31
  137. package/dist/kernel/oauth-port.js +0 -2
  138. package/dist/loader/http-loader.d.ts +0 -111
  139. package/dist/loader/http-loader.js +0 -2
  140. package/dist/runtime/effects/composition/compose-behaviors.d.ts +0 -58
  141. package/dist/runtime/effects/composition/compose-behaviors.js +0 -4
  142. package/dist/runtime/effects/composition/event-wiring.d.ts +0 -38
  143. package/dist/runtime/effects/composition/event-wiring.js +0 -2
  144. package/dist/runtime/effects/composition/index.d.ts +0 -5
  145. package/dist/runtime/effects/composition/index.js +0 -6
  146. package/dist/runtime/effects/composition/layout-strategy.d.ts +0 -35
  147. package/dist/runtime/effects/composition/layout-strategy.js +0 -2
  148. package/dist/runtime/effects/composition/pipe.d.ts +0 -25
  149. package/dist/runtime/effects/composition/pipe.js +0 -2
  150. package/dist/runtime/entities/mockStoreSeed.d.ts +0 -56
  151. package/dist/runtime/entities/mockStoreSeed.js +0 -3
  152. package/dist/runtime/entities/seedBrowserStore.d.ts +0 -28
  153. package/dist/runtime/entities/seedBrowserStore.js +0 -2
  154. package/dist/runtime/entities/std-mock-seed.d.ts +0 -87
  155. package/dist/runtime/entities/std-mock-seed.js +0 -2
  156. package/dist/runtime/time/TickScheduler.d.ts +0 -77
  157. package/dist/runtime/time/TickScheduler.js +0 -3
  158. package/dist/runtime/time/cron.d.ts +0 -25
  159. package/dist/runtime/time/cron.js +0 -2
  160. package/dist/runtime/time/duration.d.ts +0 -20
  161. package/dist/runtime/time/duration.js +0 -2
  162. package/dist/runtime/traits/OrbitalTraitParsing.d.ts +0 -34
  163. package/dist/runtime/traits/OrbitalTraitParsing.js +0 -2
  164. package/dist/runtime/traits/listen-targets.d.ts +0 -16
  165. package/dist/runtime/traits/listen-targets.js +0 -3
  166. package/dist/runtime/traits/trait-index.d.ts +0 -35
  167. package/dist/runtime/traits/trait-index.js +0 -3
@@ -1,36 +1,69 @@
1
1
  import { KernelEvaluatorExports } from '@almadar/core';
2
- export { CallRoutesWire, CallSiteWire, CallerWire, HttpBody, HttpFailureWire, HttpRequestWire, HttpResponseWire, IoAnswerWire, IoReplyWire, IoRequestWire, PendingRequestWire, ResolveProgressWire, ServerProgressWire, Settled, SubstrateFailureWire } from '@almadar/core/kernel-wire';
2
+ import { EventRequest, FrameWire } from '@almadar/core/kernel-wire';
3
+ export { CallRoutesWire, CallSiteWire, CallerWire, IoAnswerWire, IoReplyWire, IoRequestWire, NextWire, PendingRequestWire, ResolveProgressWire, ServerProgressWire, Settled, SubstrateFailureWire } from '@almadar/core/kernel-wire';
4
+
5
+ /** Fired ticks keyed by the orbital that declares them: the one a `runTick` request is addressed to. */
6
+ type FiredByOrbital = FrameWire['fired'];
3
7
 
4
8
  /** The `Server` class of `@almadar/kernel` (wasm-bindgen), as the runtime uses it. */
5
9
  interface KernelServerHandle {
6
10
  start(orbital: string, requestJson: string): string;
7
11
  resume(flight: number, repliesJson: string): string;
12
+ /** The oldest request the kernel queued, started now the lane is free: a `NextWire` as JSON, or `null`. */
13
+ next(): string;
14
+ /** Whether `flight` is a dispatch parked holding the lane. */
15
+ holdsLane(flight: number): boolean;
16
+ /** A live stream of `client`'s session opened (EXEC-DIST-9); answers the id that closes it. */
17
+ openSessionStream(client: string): number;
18
+ /** The live stream `id` dropped; the kernel frees its session once all have dropped and it is quiet. */
19
+ closeSessionStream(id: number): boolean;
8
20
  dispatchStream(): string;
9
- liveItemDelivered(itemJson: string, viewerJson: string, clientId?: string): boolean;
10
- /** A row-set reference resolved for a viewer through the host-answered store; a `ResolveProgressWire` as JSON. */
11
- resolveRows(refJson: string, viewerJson: string): string;
21
+ /** Whether a live item reaches `clientId`'s session: addressed to it and admitted by `@read` for the identity that session bound. */
22
+ liveItemDelivered(itemJson: string, clientId?: string): boolean;
23
+ /** A row-set reference resolved through the host-answered store for the identity `clientId`'s session bound (the anonymous viewer with none); a `ResolveProgressWire` as JSON. */
24
+ resolveRows(refJson: string, clientId?: string): string;
12
25
  resumeResolve(flight: number, repliesJson: string): string;
13
26
  abandon(flight: number): boolean;
14
27
  /** `OsGrants::allows` over the grants the registered program declares; `requirementJson` is an `OsRequirement`. */
15
- osAllows(requirementJson: string): boolean;
28
+ osAllows(requirementJson: string, orbital?: string): boolean;
29
+ /** Whether `url`'s origin is one the program declares in `egress`. */
30
+ egressAllows(url: string): boolean;
16
31
  /** Place the program's anchored grants and arguments under the host's anchors; answers `[{ path, message }]` for what grants nothing. */
17
32
  setOsAnchors(anchorsJson: string): string;
33
+ /** Feed a deferred raw `os` outcome (`Settled`) into the TLS operation parked under `key`: `null`, `{ ask }` or `{ done }`. */
34
+ tlsComplete(key: string, outcomeJson: string): string;
18
35
  /** An `os/` call's arguments with its anchored parts resolved; a `Settled<args, OsError>` as JSON. */
19
36
  osResolveArgs(op: string, argsJson: string): string;
20
37
  inFlight(): number;
21
38
  getState(traitName: string, entityId?: string): string;
22
- setDefaultUser(userJson: string): void;
23
39
  /** The kernel's mounts for a host start on `side` (`client|server|process|start`): `MountSeed[]` as JSON. */
24
40
  bootMounts(side: string): string;
25
41
  /** The kernel's mounts for a client opening `routePath`: `MountSeed[]` as JSON. */
26
42
  routeMounts(routePath: string): string;
43
+ /** One question about the registered program (a `ContractQuery`: the declared inputs, inbound hooks, entity owner, scoped rows): its answer as JSON. */
44
+ contractQuery(queryJson: string): string;
27
45
  mount(traitsJson: string): void;
28
46
  remount(traitsJson: string): void;
29
- setTickMount(traitsJson: string): void;
30
- /** Mock-seed the `[runtime]` entities the kernel holds itself, owner columns stamped with `viewerId` (a preview host). */
31
- seedRuntimeMock(viewerId?: string): void;
47
+ /** Whether the kernel holds the circuit state: a client's copy of it is then taken only on a delegated leg, and any other request carrying one is refused. */
48
+ setStateful(stateful: boolean): void;
49
+ /** `client` mounted the traits (`string[]` JSON) of `orbital`: their mount-scoped ticks fire while any client holds them. */
50
+ mountClient(client: string, orbital: string, traitsJson: string): void;
51
+ unmountClient(client: string, orbital: string, traitsJson: string): void;
52
+ /** `client` is gone: everything it mounted is released. */
53
+ releaseClient(client: string): void;
54
+ /** Queue the tick-stamped request (an `EventRequest` as JSON) of `orbital` for the coalesced peer relay: the window length in ms as JSON when it opened one, else `null`. */
55
+ relayTick(orbital: string, requestJson: string): string;
56
+ setTickRelayInterval(intervalMs: number): void;
57
+ /** Every queued relay item (`LiveBroadcastItem[]` as JSON); the window closes. */
58
+ flushTickRelay(): string;
59
+ /** Whether the program declares any tick. */
60
+ declaresTicks(): boolean;
61
+ /** One pass of the kernel's tick clock at monotonic `nowMs`: the `(trait, tick)` pairs due that this server runs, keyed by orbital, as `FiredByOrbital` JSON. */
62
+ tickPass(nowMs: number): string;
63
+ tickPause(): void;
64
+ tickResume(): void;
65
+ tickPaused(): boolean;
32
66
  setCapabilities(entityType: string, queryJson: string, writeJson: string): void;
33
- setMessages(localesJson: string, catalogsJson: string): void;
34
67
  /** The program (as JSON) whose declared credentials this server's credential effects manage beside its own. */
35
68
  setManagedProgram(programJson: string): void;
36
69
  lastError(): string;
@@ -41,7 +74,8 @@ interface KernelServerHandle {
41
74
  }
42
75
  /** The `Server` constructor of a kernel module. */
43
76
  interface KernelServerClass {
44
- new (resolvedSchemaJson: string): KernelServerHandle;
77
+ /** `lazyDir`: the folder the program's `uses lazy` files sit beside; the kernel loads each on the first dispatch that reaches it (EXEC-LOAD-2). */
78
+ new (resolvedSchemaJson: string, lazyDir?: string): KernelServerHandle;
45
79
  }
46
80
  /** An initialised `@almadar/kernel` module: what `OrbitalServerRuntime({ engine: 'kernel' })` is handed. */
47
81
  interface KernelModule extends KernelEvaluatorExports {
@@ -50,6 +84,8 @@ interface KernelModule extends KernelEvaluatorExports {
50
84
  osGlobMatches(glob: string, path: string): boolean;
51
85
  /** `is_public_address`: the rule an outbound host name must pass. */
52
86
  isPublicAddress(ip: string): boolean;
87
+ /** One `ContractQuery` (as JSON) answered for a host with no registered program: the kernel's own answer on an empty kernel, as JSON. */
88
+ contractQueryWithoutProgram(queryJson: string): string;
53
89
  /** The `os/` operations whose keyed call may defer its completion (`OsOp::defers_completion`), as a JSON array of names. */
54
90
  osDeferringOps(): string;
55
91
  /** The `os/` operations whose keyed call is a stream (`OsOp::is_stream`), as a JSON array of names. */
@@ -59,8 +95,10 @@ interface KernelModule extends KernelEvaluatorExports {
59
95
  substrateCompletionEvent(siteJson: string, key: string, op: string, argsJson: string, outcomeJson: string): string;
60
96
  /** Whether the Chrome match pattern matches the URL: the one rule a browser-tab host filters tabs with. */
61
97
  tabUrlMatches(pattern: string, url: string): boolean;
98
+ /** The typed event request a `program/dispatch` call names (`EventRequest::from_dispatch`); a record that is no event request throws the reason. */
99
+ parseEventRequest(payloadJson: string, optionsJson: string): EventRequest;
62
100
  /** Installs the language data (`@almadar/core/language-data` `LanguageBundle` as JSON) for a host with no `node_modules`; the first install wins. */
63
101
  installLanguage(bundleJson: string): void;
64
102
  }
65
103
 
66
- export type { KernelModule, KernelServerClass, KernelServerHandle };
104
+ export type { FiredByOrbital, KernelModule, KernelServerClass, KernelServerHandle };
@@ -0,0 +1,26 @@
1
+ import { SchemaLoader, LoadResult, LoadedSchema, LoadedOrbital } from './schema-loader.js';
2
+ import '@almadar/core';
3
+
4
+ /**
5
+ * A `SchemaLoader` over HTTP: a browser client fetches the `.orb` of a lazy page (`uses lazy`) from beside the program
6
+ * it booted, at the page's `orbRef` resolved against the importer's URL (EXEC-LOAD-2: a browser client opens lazy pages
7
+ * through its own loader).
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ declare class FetchSchemaLoader implements SchemaLoader {
13
+ private readonly base;
14
+ private readonly cache;
15
+ /** `base`: the URL relative imports resolve against when no importer is named (the page's own URL by default). */
16
+ constructor(base: string);
17
+ resolvePath(importPath: string, fromPath?: string): LoadResult<string>;
18
+ load(importPath: string, fromPath?: string): Promise<LoadResult<LoadedSchema>>;
19
+ loadOrbital(importPath: string, orbitalName?: string, fromPath?: string): Promise<LoadResult<LoadedOrbital>>;
20
+ clearCache(): void;
21
+ getCacheStats(): {
22
+ size: number;
23
+ };
24
+ }
25
+
26
+ export { FetchSchemaLoader };
@@ -0,0 +1 @@
1
+ export { FetchSchemaLoader } from '../chunk-57SBCUSM.js';
@@ -1,2 +1 @@
1
1
  export { loadLazyPage } from '../chunk-XXWNMJI6.js';
2
- import '../chunk-MLKGABMK.js';
@@ -6,7 +6,6 @@ import { OrbitalSchema, Orbital, DeclaredTraitConfig } from '@almadar/core';
6
6
  * Abstract interface for loading OrbitalSchema files from various sources.
7
7
  * Implementations exist for:
8
8
  * - FileSystemLoader (Node.js) - uses fs module
9
- * - HttpLoader (Browser) - uses fetch API
10
9
  * - UnifiedLoader (Auto-detect) - routes to appropriate loader
11
10
  *
12
11
  * @packageDocumentation
@@ -68,17 +67,6 @@ interface BaseLoaderOptions {
68
67
  /** Scoped package roots (e.g., { "@game-lib": "/path/to/lib" }) */
69
68
  scopedPaths?: Record<string, string>;
70
69
  }
71
- /**
72
- * Options for HTTP loading.
73
- */
74
- interface HttpLoaderOptions extends BaseLoaderOptions {
75
- /** Default fetch options */
76
- fetchOptions?: RequestInit;
77
- /** Request timeout in milliseconds */
78
- timeout?: number;
79
- /** Whether to use credentials (cookies, auth headers) */
80
- credentials?: RequestCredentials;
81
- }
82
70
  /**
83
71
  * Abstract interface for schema loaders.
84
72
  *
@@ -92,10 +80,6 @@ interface HttpLoaderOptions extends BaseLoaderOptions {
92
80
  * const loader: SchemaLoader = new FileSystemLoader({ basePath: "/schemas" });
93
81
  * const result = await loader.load("./my-schema.orb");
94
82
  *
95
- * // Using HttpLoader (Browser)
96
- * const loader: SchemaLoader = new HttpLoader({ basePath: "/api/schemas" });
97
- * const result = await loader.load("./my-schema.orb");
98
- *
99
83
  * // Using UnifiedLoader (auto-detect)
100
84
  * const loader: SchemaLoader = createUnifiedLoader({ basePath: "/schemas" });
101
85
  * const result = await loader.load("./my-schema.orb");
@@ -157,4 +141,4 @@ interface ImportChainLike {
157
141
  clone(): ImportChainLike;
158
142
  }
159
143
 
160
- export type { BaseLoaderOptions, HttpLoaderOptions, ImportChainLike, LoadResult, LoadedOrbital, LoadedSchema, SchemaLoader };
144
+ export type { BaseLoaderOptions, ImportChainLike, LoadResult, LoadedOrbital, LoadedSchema, SchemaLoader };
@@ -1,2 +1 @@
1
1
  export { NativeMemoryPersistenceAdapter, NativeMemoryWriteError } from '../chunk-7SDV3QWR.js';
2
- import '../chunk-MLKGABMK.js';
@@ -0,0 +1,6 @@
1
+ import { PersistenceAdapter, Entity } from '@almadar/core';
2
+
3
+ /** Tells the store each server-persisted entity's declared `[persistent: tbl]` collection (EXEC-STORE-1). */
4
+ declare function bindDeclaredCollections(store: PersistenceAdapter, entities: readonly Entity[]): void;
5
+
6
+ export { bindDeclaredCollections };
@@ -0,0 +1 @@
1
+ export { bindDeclaredCollections } from '../../chunk-BAS26HBN.js';
@@ -1,23 +1,17 @@
1
- import { OrbitalSchema, PersistenceAdapter, OnDeviceModelPorts, BrowserTabPort, MessageCatalogs, UserContext, RowSetRef, RowQueryPage } from '@almadar/core';
1
+ import { OrbitalSchema, PersistenceAdapter, OnDeviceModelPorts, BrowserTabPort, RowSetRef, RowQueryPage } from '@almadar/core';
2
2
  import { EffectHandlers } from '../types.js';
3
3
  import { KernelEngine } from '../../kernel/engine.js';
4
4
  import { KernelHostPorts } from '../../kernel/host.js';
5
- import { HttpPorts } from '../../kernel/http.js';
5
+ import { OsHostPort } from '../../kernel/os-port.js';
6
+ import { SecretPorts } from '../../kernel/secret-ports.js';
6
7
  import { KernelModule } from '../../kernel/wire.js';
7
8
  import { EventTransport } from '../../client/EventTransport.js';
8
9
  import '../../service/default-call-service.js';
9
10
  import '../../service/service-provider.js';
10
11
  import '../../kernel/program-effects.js';
11
- import '../effects/composition/compose-behaviors.js';
12
- import '../effects/composition/event-wiring.js';
13
- import '../effects/composition/layout-strategy.js';
14
- import '../effects/composition/pipe.js';
15
- import '../../effects/in-flight-calls.js';
16
- import '../../kernel/beacon.js';
17
- import '../../credentials/store.js';
18
- import '../../kernel/decode.js';
19
12
  import '@almadar/core/kernel-wire';
20
- import '../../kernel/os-port.js';
13
+ import '../../effects/in-flight-calls.js';
14
+ import '../../credentials/vault.js';
21
15
 
22
16
  /**
23
17
  * An in-process transport over a local store: every request runs on the kernel opened over that store
@@ -26,10 +20,8 @@ import '../../kernel/os-port.js';
26
20
  */
27
21
 
28
22
  interface LocalKernelOptions {
29
- /** The initialised `@almadar/kernel` module. */
23
+ /** The initialised `@almadar/kernel` module with its language already installed (`loadBrowserKernel`): opening a kernel installs nothing. */
30
24
  kernel: KernelModule;
31
- /** The language bundle as JSON (`LanguageBundle`), installed into `kernel` before it opens: a browser has no `node_modules` to read it from. */
32
- language: string;
33
25
  schema: OrbitalSchema;
34
26
  /** Every row the kernel reads and writes (`localStorePersistence` over a browser store). */
35
27
  persistence: PersistenceAdapter;
@@ -40,11 +32,12 @@ interface LocalKernelOptions {
40
32
  /** Where a follow-on call's outcome is dispatched; absent, nowhere. */
41
33
  deferCallOutcome?: KernelHostPorts['deferCallOutcome'];
42
34
  pageFacts?: KernelHostPorts['pageFacts'];
43
- http?: HttpPorts;
35
+ hostActions?: KernelHostPorts['hostActions'];
36
+ secretPorts?: SecretPorts;
44
37
  onDevice?: OnDeviceModelPorts;
45
38
  tabs?: BrowserTabPort;
46
- /** The program's message catalogs, so `i18n/t` resolves for the request's locale. */
47
- messages?: MessageCatalogs;
39
+ /** The host's `os` port (`createFetchOsHost` in a browser); absent, every `os` ask is denied. */
40
+ os?: OsHostPort;
48
41
  }
49
42
  /** A local store's rows as the kernel holds them: browser-stored entities in `store`, every other entity in `memory` (a native `MemoryStore` adapter). */
50
43
  declare function localStorePersistence(schema: OrbitalSchema, store: PersistenceAdapter, memory: PersistenceAdapter): PersistenceAdapter;
@@ -53,16 +46,14 @@ declare function openLocalKernel(options: LocalKernelOptions): KernelEngine;
53
46
  interface LocalStoreTransportOptions {
54
47
  /** The kernel the requests run on (`openLocalKernel`), or its promise while the kernel module loads. */
55
48
  kernelEngine: KernelEngine | Promise<KernelEngine>;
56
- /** The viewer every request runs as, or its promise while the host resolves it (a mock store's seeded persona). */
57
- user?: UserContext | Promise<UserContext | undefined>;
58
- /** Releases the host's request queue while a `call-service` awaits its provider. */
59
- outsideEventQueue?: <T>(work: () => Promise<T>) => Promise<T>;
60
49
  /** The program the kernel runs; given, the transport resolves row-set references on that kernel. */
61
50
  schema?: OrbitalSchema;
51
+ /** The page's locale, read per request: a request naming none runs in it, as a server request carries its viewer's. */
52
+ locale?: () => string | undefined;
62
53
  }
63
54
  declare function createLocalStoreTransport(options: LocalStoreTransportOptions): EventTransport;
64
- /** `reference` resolved on a local kernel for `user`: the kernel applies the viewer's `@read`, the host answers its row reads. */
65
- declare function resolveLocalRows(engine: KernelEngine, schema: OrbitalSchema, user: UserContext | undefined, reference: RowSetRef): Promise<RowQueryPage>;
55
+ /** `reference` resolved on a local kernel: the kernel applies the session identity's `@read`, the host answers its row reads. */
56
+ declare function resolveLocalRows(engine: KernelEngine, reference: RowSetRef): Promise<RowQueryPage>;
66
57
 
67
58
  export { createLocalStoreTransport, localStorePersistence, openLocalKernel, resolveLocalRows };
68
59
  export type { LocalKernelOptions, LocalStoreTransportOptions };
@@ -1,18 +1,14 @@
1
- export { createLocalStoreTransport, localStorePersistence, openLocalKernel, resolveLocalRows } from '../../chunk-VNMG7NKY.js';
1
+ export { createLocalStoreTransport, localStorePersistence, openLocalKernel, resolveLocalRows } from '../../chunk-MU335ZA4.js';
2
2
  import '../../chunk-4SEK5ER2.js';
3
3
  import '../../chunk-UBN5JJKZ.js';
4
4
  import '../../chunk-O57GKTYU.js';
5
- import '../../chunk-CPSQXEJ6.js';
6
- import '../../chunk-SAS5KKCR.js';
7
- import '../../chunk-D4XJTBLB.js';
8
- import '../../chunk-NATGCIVM.js';
9
- import '../../chunk-HNOAZWFH.js';
10
- import '../../chunk-53IPZXDP.js';
11
- import '../../chunk-YO4LWS3I.js';
12
- import '../../chunk-MZKIL5IN.js';
5
+ import '../../chunk-I3TKINSO.js';
6
+ import '../../chunk-NU6LVKGS.js';
7
+ import '../../chunk-X6W44WHO.js';
8
+ import '../../chunk-7WB6VWRK.js';
9
+ import '../../chunk-WGCWJOT2.js';
10
+ import '../../chunk-ZUSM4VW4.js';
13
11
  import '../../chunk-FWA5K7Q2.js';
14
- import '../../chunk-VMOBW7RK.js';
15
- import '../../chunk-RBUMDYFS.js';
16
12
  import '../../chunk-HLOUDLPI.js';
17
- import '../../chunk-QELZ6TEJ.js';
18
- import '../../chunk-MLKGABMK.js';
13
+ import '../../chunk-MZKIL5IN.js';
14
+ import '../../chunk-UD2CXYSJ.js';
@@ -1,13 +1,13 @@
1
1
  import { EventTransport } from '../../client/EventTransport.js';
2
- import { TraitIndex } from '@almadar/core';
2
+ import '@almadar/core';
3
3
 
4
4
  interface ResidenceTransportOptions {
5
5
  /** In-process transport over the browser store. */
6
6
  local: EventTransport;
7
7
  /** The server; absent on a static host. */
8
8
  remote?: EventTransport;
9
- /** The program's entities, for where a row-set reference's rows live. */
10
- traitIndex: TraitIndex;
9
+ /** The program's browser-stored entities (the kernel's `programSurface`): a row-set reference to one of them is resolved in-process. */
10
+ browserEntities: ReadonlySet<string>;
11
11
  }
12
12
  declare function createResidenceTransport(options: ResidenceTransportOptions): EventTransport;
13
13
 
@@ -1,2 +1 @@
1
- export { createResidenceTransport } from '../../chunk-UJHOUZAL.js';
2
- import '../../chunk-MLKGABMK.js';
1
+ export { createResidenceTransport } from '../../chunk-V4EMDPCO.js';
@@ -1,2 +1 @@
1
1
  export { routeByEntity } from '../../chunk-O57GKTYU.js';
2
- import '../../chunk-MLKGABMK.js';
@@ -1,4 +1,4 @@
1
- import { TraitId, OrbitalId, EventId } from '@almadar/core';
1
+ import { EventId } from '@almadar/core';
2
2
 
3
3
  /**
4
4
  * Identity-keyed routing (Almadar Rabit V4, Phase 4 — interpreter path).
@@ -29,56 +29,5 @@ import { TraitId, OrbitalId, EventId } from '@almadar/core';
29
29
  * wildcard listeners are untouched.
30
30
  */
31
31
  declare function eventRouteKey(eventName: string, eventId?: EventId | string): string;
32
- /** Structured `listens {}` source, carrying V4 dual-carry ids when present. */
33
- type ListenSourceDescriptor = {
34
- kind: 'any';
35
- } | {
36
- kind: 'trait';
37
- trait: string;
38
- traitId?: TraitId;
39
- } | {
40
- kind: 'orbital';
41
- orbital: string;
42
- trait: string;
43
- orbitalId?: OrbitalId;
44
- traitId?: TraitId;
45
- };
46
- /**
47
- * The subset of a bus event's `source` metadata the matcher reads. Kept
48
- * structural (no index signature) so `BusEventSource` assigns to it cleanly.
49
- */
50
- interface RouteSourceMeta {
51
- orbital?: string;
52
- orbitalId?: OrbitalId;
53
- trait?: string;
54
- traitId?: TraitId;
55
- }
56
- /**
57
- * Build a source-scope matcher for a `listens {}` entry.
58
- *
59
- * ID-first: when the listen source carries the id(s) for its scope, the
60
- * matcher compares ids ONLY (exact-match, rename-proof). Otherwise it
61
- * compares names against `listenerOrbital` — the exact legacy predicate.
62
- * No name-similarity, ever: an id present on one side but absent on the
63
- * other is a mismatch, never a fuzzy fallback.
64
- */
65
- declare function buildSourceMatcher(src: ListenSourceDescriptor, listenerOrbital: string): (source: RouteSourceMeta | undefined) => boolean;
66
- /**
67
- * Parse one `listens {}` entry into its bare event name + source matcher.
68
- * Relocated here (was module-private to `OrbitalServerRuntime.ts`) so the
69
- * stateless `@almadar-io/playground-runtime` path can reuse the EXACT same
70
- * matching predicate for its own cross-orbital cascade (Fix A2) instead of
71
- * a second, divergent copy — this function only ever depended on
72
- * `ListenSourceDescriptor`/`buildSourceMatcher`, both already local to this
73
- * module.
74
- */
75
- declare function parseListenSource(listener: {
76
- event: string;
77
- source?: ListenSourceDescriptor;
78
- }, listenerOrbital: string): {
79
- bareEvent: string;
80
- matcher: (source: RouteSourceMeta | undefined) => boolean;
81
- };
82
32
 
83
- export { buildSourceMatcher, eventRouteKey, parseListenSource };
84
- export type { ListenSourceDescriptor, RouteSourceMeta };
33
+ export { eventRouteKey };
@@ -1,2 +1 @@
1
- export { buildSourceMatcher, eventRouteKey, parseListenSource } from '../../../chunk-IHQLE5M7.js';
2
- import '../../../chunk-MLKGABMK.js';
1
+ export { eventRouteKey } from '../../../chunk-BY5G4225.js';