@substrat-run/adapter-sqlite 0.240.0 → 0.242.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.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The LOCAL relay mesh (K-74): every app served side by side on the pure host, each with its own
3
+ * in-process broker relaying through the local relay router, and each subscribing app's declared
4
+ * receiver policy applied as that app's own subscription (`relay.edges`). DEV AND TEST ONLY, on the
5
+ * terms of the router it composes (`local-relay-router.ts`): reached through
6
+ * `@substrat-run/adapter-sqlite/vertical-broker`, constructed only by a harness. `substrat serve`
7
+ * does not, since it runs each entry in workerd.
8
+ *
9
+ * `localRelayMesh(hosts, tenantId, options)` builds, for each app (keyed by registry slug, as the
10
+ * router's hosts are):
11
+ * - its broker, relaying through `routerFor(app)` over that host's own scope ends
12
+ * (`relayScopeEnds(host.relayScopeDoors(actor, requests))`), plugged into the router;
13
+ * - its edges: for every type the app EXPORTS (`registeredExportTypes`), each app the router answers
14
+ * as subscribing in `tenantId`, with the receiver policy it declares. An app no edge covers (none,
15
+ * once the mesh is built) goes by the relay under `options.relay.policy`.
16
+ *
17
+ * Edges are read once, when the mesh is built (`relay-edges.ts`'s limit): build it after the tenant's
18
+ * instances are provisioned. A scope's commits reach its app's broker through the host's own
19
+ * `deliveryBroker` option, which a harness points at `mesh.brokers[app]`; or the harness hands off.
20
+ */
21
+ import type { PlatformActorId } from '@substrat-run/contracts';
22
+ import { type RelayScopeDoors } from '@substrat-run/kernel';
23
+ import { InProcessDeliveryBroker, type InProcessDeliveryBrokerOptions } from './delivery-broker.js';
24
+ import type { SqliteScopeHost } from './index.js';
25
+ import { type LocalRelayRouter } from './local-relay-router.js';
26
+ import type { RelayEdge } from './relay-edges.js';
27
+ type RelayTerms = NonNullable<InProcessDeliveryBrokerOptions['relay']>;
28
+ export interface LocalRelayMeshOptions {
29
+ /** The platform actor each host's relay doors act as. */
30
+ actor: PlatformActorId;
31
+ /** Per app, the host code that takes a relayed request (`relayScopeDoors`' `requests`). */
32
+ requests?: Readonly<Record<string, RelayScopeDoors['requests']>>;
33
+ /** What every broker is built with besides its relay: a clock, the timing, the jitter's draw. */
34
+ broker?: Pick<InProcessDeliveryBrokerOptions, 'now' | 'timing' | 'random'>;
35
+ /** The relay's own terms on every broker: its retries, and its policy for an app no edge covers. */
36
+ relay?: Pick<RelayTerms, 'retryMs' | 'policy' | 'maxWaitMs' | 'retentionMs' | 'log'>;
37
+ }
38
+ export interface LocalRelayMesh {
39
+ readonly router: LocalRelayRouter;
40
+ /** Each app's broker, by slug. */
41
+ readonly brokers: Readonly<Record<string, InProcessDeliveryBroker>>;
42
+ /** Each app's edges as built: the subscribing apps of each type it exports, with their policies. */
43
+ readonly edges: Readonly<Record<string, readonly RelayEdge[]>>;
44
+ /** One delivery pass of every broker, in slug order. */
45
+ deliverDue(): Promise<void>;
46
+ close(): void;
47
+ }
48
+ export declare function localRelayMesh(hosts: Readonly<Record<string, SqliteScopeHost>>, tenantId: string, options: LocalRelayMeshOptions): Promise<LocalRelayMesh>;
49
+ export {};
50
+ //# sourceMappingURL=local-relay-mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-relay-mesh.d.ts","sourceRoot":"","sources":["../src/local-relay-mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,KAAK,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,UAAU,GAAG,WAAW,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,KAAK,EAAE,eAAe,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjE,iGAAiG;IACjG,MAAM,CAAC,EAAE,IAAI,CAAC,8BAA8B,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAC3E,oGAAoG;IACpG,KAAK,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,kCAAkC;IAClC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACpE,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC,CAAC,CAAC;IAC/D,wDAAwD;IACxD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAChD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CA4CzB"}
@@ -0,0 +1,52 @@
1
+ import { relayScopeEnds } from '@substrat-run/kernel';
2
+ import { InProcessDeliveryBroker } from './delivery-broker.js';
3
+ import { createLocalRelayRouter } from './local-relay-router.js';
4
+ export async function localRelayMesh(hosts, tenantId, options) {
5
+ const router = createLocalRelayRouter(hosts);
6
+ const apps = Object.keys(hosts).sort();
7
+ const edges = {};
8
+ for (const app of apps) {
9
+ const own = [];
10
+ for (const type of [...hosts[app].registeredExportTypes()].sort()) {
11
+ for (const s of await router.routerFor(app).subscriptions({ tenantId, type })) {
12
+ own.push({ app: s.app, type, ...(s.delivery ? { delivery: s.delivery } : {}) });
13
+ }
14
+ }
15
+ edges[app] = own;
16
+ }
17
+ const brokers = {};
18
+ const close = () => {
19
+ for (const b of Object.values(brokers))
20
+ b.close();
21
+ };
22
+ try {
23
+ for (const app of apps) {
24
+ const broker = new InProcessDeliveryBroker({
25
+ ...options.broker,
26
+ relay: {
27
+ ...options.relay,
28
+ router: router.routerFor(app),
29
+ ...relayScopeEnds(hosts[app].relayScopeDoors(options.actor, options.requests?.[app])),
30
+ edges: edges[app],
31
+ },
32
+ });
33
+ brokers[app] = broker;
34
+ router.attach(app, (envelope) => broker.acceptRelayed(envelope));
35
+ }
36
+ }
37
+ catch (err) {
38
+ close();
39
+ throw err;
40
+ }
41
+ return {
42
+ router,
43
+ brokers,
44
+ edges,
45
+ deliverDue: async () => {
46
+ for (const app of apps)
47
+ await brokers[app].deliverDue();
48
+ },
49
+ close,
50
+ };
51
+ }
52
+ //# sourceMappingURL=local-relay-mesh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-relay-mesh.js","sourceRoot":"","sources":["../src/local-relay-mesh.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAuC,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EAAE,sBAAsB,EAAyB,MAAM,yBAAyB,CAAC;AA2BxF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAgD,EAChD,QAAgB,EAChB,OAA8B;IAE9B,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,IAA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AAC,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;oBACtF,KAAK,EAAE,KAAK,CAAC,GAAG,CAAE;iBACnB;aACF,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,KAAK,EAAE,CAAC;QACR,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,OAAO;QACL,MAAM;QACN,OAAO;QACP,KAAK;QACL,UAAU,EAAE,KAAK,IAAI,EAAE;YACrB,KAAK,MAAM,GAAG,IAAI,IAAI;gBAAE,MAAM,OAAO,CAAC,GAAG,CAAE,CAAC,UAAU,EAAE,CAAC;QAC3D,CAAC;QACD,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The LOCAL relay router (K-74, #3469): what the router is to two apps' brokers on the hosted path,
3
+ * for apps served side by side on the pure host. DEV AND TEST ONLY, on the same terms as the local
4
+ * peer broker beside it (`vertical-broker.ts`): it takes `SqliteScopeHost`s, which no Workers bundle
5
+ * can carry, and it is reached only through `@substrat-run/adapter-sqlite/vertical-broker`, whose
6
+ * worker conditions resolve to nothing and which boundary-lint R9 keeps to tests and node harnesses.
7
+ *
8
+ * **Off unless wired.** Nothing constructs it. A harness that wants relaying gives each app's
9
+ * `InProcessDeliveryBroker` a `relay` whose `router` is `routerFor(app)`, with that host's own scope
10
+ * ends (`relayScopeEnds(host.relayScopeDoors(actor))`), and attaches the broker's `acceptRelayed`.
11
+ * `substrat serve` does not.
12
+ *
13
+ * **What it keeps identical to the router** (`apps/router`'s `carryRelay` and the supervisor's
14
+ * `subscribers`):
15
+ * - The calling app is the one the router was made for (`routerFor(app)`), never an argument, as the
16
+ * router names it from its binding.
17
+ * - A message's scope is held to a live primary instance of that app in the tenant of a live tenant
18
+ * (`assertLiveCaller`, the local peer broker's gate), and the receiving instance is resolved by the
19
+ * kernel's one rule (`resolvePeerInstanceFrom`). What cannot be carried is a final refusal, as the
20
+ * router answers it; an app served with no broker is `no-broker`.
21
+ * - The envelope's caller lines are written here from what was checked, never taken from the message.
22
+ * - `subscriptions` answers in the shape the hosted answer gives (`relaySubscriber`: `{ app,
23
+ * delivery? }`): each co-served app with a live primary instance in the tenant that imports the type
24
+ * from the calling app, with the receiver policy it declares. It reads the policy from the app's
25
+ * registered modules (`registeredImports`), where the hosted answer reads the pushed manifest's
26
+ * `importDelivery`; both come from the same `events.consumes[].delivery`. The kernel's `subscribers`
27
+ * seam takes the apps alone: a broker does not apply a declared policy yet.
28
+ *
29
+ * **What it does not do.** Honour a peer binding: the local peer broker keeps those in its own memory,
30
+ * so a tenant running two instances of the receiving app is refused here, as an unbound hosted relay
31
+ * is. Name a tenant beyond the one the message's scope is in, or reach a preview.
32
+ */
33
+ import { type ReceiverDelivery, type RelayAnswer, type RelayEnvelope } from '@substrat-run/contracts';
34
+ import { type RelayRouter } from '@substrat-run/kernel';
35
+ import type { SqliteScopeHost } from './index.js';
36
+ /** One app that subscribes, in the hosted answer's shape (`relaySubscriber`, without `unreadable`: a local app's modules are read, not a stored manifest). */
37
+ export interface LocalRelaySubscriber {
38
+ app: string;
39
+ delivery?: ReceiverDelivery;
40
+ }
41
+ export interface LocalRelayRouter {
42
+ /** The router one app's broker relays through. Its caller is `app`, and nothing it is passed changes that. */
43
+ routerFor(app: string): RelayRouter & {
44
+ /** Each subscribing app with its declared receiver policy: the hosted `subscribers` answer, locally. */
45
+ subscriptions(input: {
46
+ tenantId: string;
47
+ type: string;
48
+ }): Promise<LocalRelaySubscriber[]>;
49
+ };
50
+ /** Plug an app's broker in (`acceptRelayed`), or `null`: the app is served with no broker. */
51
+ attach(app: string, accept: ((envelope: RelayEnvelope) => Promise<RelayAnswer>) | null): void;
52
+ }
53
+ /** The relay router over co-served pure hosts, keyed by registry slug as `createLocalVerticalBroker`'s hosts are. */
54
+ export declare function createLocalRelayRouter(hosts: Readonly<Record<string, SqliteScopeHost>>): LocalRelayRouter;
55
+ //# sourceMappingURL=local-relay-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-relay-router.d.ts","sourceRoot":"","sources":["../src/local-relay-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA2C,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,8JAA8J;AAC9J,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,8GAA8G;IAC9G,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG;QACpC,wGAAwG;QACxG,aAAa,CAAC,KAAK,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;KAC3F,CAAC;IACF,8FAA8F;IAC9F,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;CAC/F;AAKD,qHAAqH;AACrH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,GAAG,gBAAgB,CAkEzG"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The LOCAL relay router (K-74, #3469): what the router is to two apps' brokers on the hosted path,
3
+ * for apps served side by side on the pure host. DEV AND TEST ONLY, on the same terms as the local
4
+ * peer broker beside it (`vertical-broker.ts`): it takes `SqliteScopeHost`s, which no Workers bundle
5
+ * can carry, and it is reached only through `@substrat-run/adapter-sqlite/vertical-broker`, whose
6
+ * worker conditions resolve to nothing and which boundary-lint R9 keeps to tests and node harnesses.
7
+ *
8
+ * **Off unless wired.** Nothing constructs it. A harness that wants relaying gives each app's
9
+ * `InProcessDeliveryBroker` a `relay` whose `router` is `routerFor(app)`, with that host's own scope
10
+ * ends (`relayScopeEnds(host.relayScopeDoors(actor))`), and attaches the broker's `acceptRelayed`.
11
+ * `substrat serve` does not.
12
+ *
13
+ * **What it keeps identical to the router** (`apps/router`'s `carryRelay` and the supervisor's
14
+ * `subscribers`):
15
+ * - The calling app is the one the router was made for (`routerFor(app)`), never an argument, as the
16
+ * router names it from its binding.
17
+ * - A message's scope is held to a live primary instance of that app in the tenant of a live tenant
18
+ * (`assertLiveCaller`, the local peer broker's gate), and the receiving instance is resolved by the
19
+ * kernel's one rule (`resolvePeerInstanceFrom`). What cannot be carried is a final refusal, as the
20
+ * router answers it; an app served with no broker is `no-broker`.
21
+ * - The envelope's caller lines are written here from what was checked, never taken from the message.
22
+ * - `subscriptions` answers in the shape the hosted answer gives (`relaySubscriber`: `{ app,
23
+ * delivery? }`): each co-served app with a live primary instance in the tenant that imports the type
24
+ * from the calling app, with the receiver policy it declares. It reads the policy from the app's
25
+ * registered modules (`registeredImports`), where the hosted answer reads the pushed manifest's
26
+ * `importDelivery`; both come from the same `events.consumes[].delivery`. The kernel's `subscribers`
27
+ * seam takes the apps alone: a broker does not apply a declared policy yet.
28
+ *
29
+ * **What it does not do.** Honour a peer binding: the local peer broker keeps those in its own memory,
30
+ * so a tenant running two instances of the receiving app is refused here, as an unbound hosted relay
31
+ * is. Name a tenant beyond the one the message's scope is in, or reach a preview.
32
+ */
33
+ import { relayEnvelope, scopeId as scopeIdOf, tenantId as tenantIdOf, } from '@substrat-run/contracts';
34
+ import { isPrimaryScope, resolvePeerInstanceFrom } from '@substrat-run/kernel';
35
+ import { assertLiveCaller, LOCAL_BROKER_ACTOR } from './vertical-broker.js';
36
+ const refused = (message) => ({ outcome: 'refused', reason: 'forbidden', message });
37
+ const codeOf = (err) => err?.code;
38
+ /** The relay router over co-served pure hosts, keyed by registry slug as `createLocalVerticalBroker`'s hosts are. */
39
+ export function createLocalRelayRouter(hosts) {
40
+ const hostOf = (app) => Object.prototype.hasOwnProperty.call(hosts, app) ? hosts[app] : undefined;
41
+ const accepts = new Map();
42
+ const liveIn = async (host, tenantId, app) => (await host.admin.listScopes(LOCAL_BROKER_ACTOR, { tenantId: tenantIdOf.parse(tenantId), vertical: app })).filter((s) => s.status === 'active' && isPrimaryScope(s));
43
+ return {
44
+ attach: (app, accept) => void accepts.set(app, accept),
45
+ routerFor(app) {
46
+ const subscriptions = async ({ tenantId, type }) => {
47
+ const out = [];
48
+ for (const name of Object.keys(hosts).sort()) {
49
+ if (name === app)
50
+ continue;
51
+ const host = hostOf(name);
52
+ // Local apps register under their bare slug, so the names match exactly (#2252).
53
+ const edge = host.registeredImports().find((r) => r.from === app && r.type === type);
54
+ if (!edge || (await liveIn(host, tenantId, name)).length === 0)
55
+ continue;
56
+ out.push({ app: name, ...(edge.delivery ? { delivery: edge.delivery } : {}) });
57
+ }
58
+ return out;
59
+ };
60
+ return {
61
+ subscriptions,
62
+ subscribers: async (input) => (await subscriptions(input)).map((s) => s.app),
63
+ forward: async (rawTenantId, handoff) => {
64
+ const tenantId = tenantIdOf.parse(rawTenantId);
65
+ const scopeId = scopeIdOf.parse(handoff.message.scopeId);
66
+ try {
67
+ await assertLiveCaller(hostOf(app), { vertical: app, tenantId, scopeId });
68
+ }
69
+ catch (err) {
70
+ if (codeOf(err) === 'forbidden')
71
+ return refused(err.message);
72
+ throw err;
73
+ }
74
+ const targetHost = hostOf(handoff.to);
75
+ if (!targetHost)
76
+ return refused(`vertical '${handoff.to}' is not installed in this tenant`);
77
+ const resolution = resolvePeerInstanceFrom(await targetHost.admin.listScopes(LOCAL_BROKER_ACTOR, { tenantId, vertical: handoff.to }), { id: tenantId, slug: null }, handoff.to, null, false);
78
+ if (resolution.outcome === 'not-installed')
79
+ return refused(`vertical '${handoff.to}' is not installed in this tenant`);
80
+ if (resolution.outcome === 'ambiguous') {
81
+ return refused(`this tenant runs ${resolution.count} instances of '${handoff.to}' — a relay cannot pick one`);
82
+ }
83
+ // No binding is passed, so `bound-unavailable` cannot come back; the narrowing says so.
84
+ if (resolution.outcome !== 'resolved')
85
+ return refused(`vertical '${handoff.to}' cannot be reached`);
86
+ const accept = accepts.get(handoff.to);
87
+ if (!accept)
88
+ return { outcome: 'no-broker' };
89
+ // K-66's lines, written from what was checked above, as the router writes them.
90
+ return accept(relayEnvelope.parse({
91
+ tenantId,
92
+ caller: { app, scopeId, actor: 'app' },
93
+ target: { app: handoff.to, scopeId: resolution.instance.scopeId },
94
+ message: handoff.message,
95
+ }));
96
+ },
97
+ };
98
+ },
99
+ };
100
+ }
101
+ //# sourceMappingURL=local-relay-router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-relay-router.js","sourceRoot":"","sources":["../src/local-relay-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACL,aAAa,EACb,OAAO,IAAI,SAAS,EACpB,QAAQ,IAAI,UAAU,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAoB,MAAM,sBAAsB,CAAC;AAEjG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAkB5E,MAAM,OAAO,GAAG,CAAC,OAAe,EAAe,EAAE,CAAC,CAAC,EAAE,OAAO,E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;wBAClB,QAAQ;wBACR,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;wBACtC,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE;wBACjE,OAAO,EAAE,OAAO,CAAC,OAAO;qBACzB,CAAC,CACH,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * K-74's receiver's half, applied on the pure host: one store subscription per subscribing app and
3
+ * type (an EDGE), under the receiver policy that app declares on its `events.consumes[].delivery`.
4
+ *
5
+ * The relay (`BrokerRelay`) carries an event to every subscribing app under ONE subscription and one
6
+ * policy. Given edges, `InProcessDeliveryBroker` registers each as its own subscription instead,
7
+ * owed only events of its type (`eventTypes`, so no other message holds its lanes or fills its dead
8
+ * letters), and the kernel's `BrokerStore` applies that app's attempts, backoff, jitter, ordered
9
+ * lanes and dead letter exactly as it does for any receiver; the relay keeps every app no edge covers, through a
10
+ * router that leaves the covered ones out, so no event is carried twice.
11
+ *
12
+ * An edge's receiver does what the relay does for one hop: it asks the router whether the app
13
+ * subscribes in the message's tenant (an edge names no tenant), then the producer scope's export
14
+ * read, then the router's `forward`. `accepted`, `no-broker`, `unexported` and a refusal are final (a refusal is
15
+ * logged, as the relay logs one); a paused export or a failure is the store's to retry under the
16
+ * edge's policy, until it dead-letters.
17
+ *
18
+ * Stated limits (dev and test only, where this broker runs):
19
+ * - Edges are fixed when the broker is built. An app that starts subscribing later is carried by the
20
+ * relay, under the relay's policy.
21
+ * - Edges are given to an in-memory broker only. A broker over a `file` outlives the edges it was
22
+ * built with: reopened with an edge added, a message it already owed the relay would go to neither
23
+ * (the store owes a new subscription only what it owes nobody, and the relay leaves the covered app
24
+ * out); reopened with one dropped, what it owed that edge would stay pending. So it is refused.
25
+ * - The relay's hop view (`relayHops`) does not list an edge's app. Its state is the store's:
26
+ * `queue()` and `deadLetters()`, under the edge's subscription name.
27
+ * - Eligibility is judged before the prune as well (`InProcessDeliveryBroker`'s pass): a tenant the
28
+ * app does not subscribe in settles, one whose answer is unknown is held (not sent, not expired)
29
+ * until it is known, and an edge's lanes are per (tenant, key), so neither stops another tenant's
30
+ * key. Whether the producer exports the event is still read per message, here: an `unexported` one
31
+ * past its time to live goes to dead letter first and stops its own tenant's key until discarded.
32
+ *
33
+ * Not the hosted path: a Durable Object broker is given no edges, and nothing here is read there.
34
+ */
35
+ import type { ReceiverDelivery } from '@substrat-run/contracts';
36
+ import { type BrokerRelayOptions, type BrokerSql, type DeliveryReceiver, type RelayRouter } from '@substrat-run/kernel';
37
+ /** One subscribing app's subscription to one type, with the receiver policy it declares. */
38
+ export interface RelayEdge {
39
+ app: string;
40
+ type: string;
41
+ delivery?: ReceiverDelivery;
42
+ }
43
+ /** The store subscription an edge is registered as. */
44
+ export declare const relayEdgeSubscription: (edge: Pick<RelayEdge, 'app' | 'type'>) => string;
45
+ /** Refuse two edges for one (app, type): one subscription is one policy. */
46
+ export declare function assertDistinctEdges(edges: readonly RelayEdge[]): void;
47
+ /** Refuse edges on a broker over a file: it outlives them (the limit above). */
48
+ export declare function assertEdgesInMemory(file: string | undefined, edges: readonly RelayEdge[] | undefined): void;
49
+ /** The relay's router, with the apps an edge covers left out of `subscribers`. `forward` is the router's own. */
50
+ export declare function routerWithout(router: RelayRouter, edges: readonly RelayEdge[]): RelayRouter;
51
+ /** The receiver registered under {@link relayEdgeSubscription}: one hop of the relay, for one app and one type. */
52
+ export declare function relayEdgeReceiver(edge: RelayEdge, seams: Pick<BrokerRelayOptions, 'router' | 'exports' | 'log'>, sql: BrokerSql): DeliveryReceiver;
53
+ //# sourceMappingURL=relay-edges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-edges.d.ts","sourceRoot":"","sources":["../src/relay-edges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAoB,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE1I,4FAA4F;AAC5F,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,SAAU,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,KAAG,MAA0C,CAAC;AAEzH,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAOrE;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,GAAG,IAAI,CAI3G;AAED,iHAAiH;AACjH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,WAAW,CAO3F;AAED,mHAAmH;AACnH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC,EAC7D,GAAG,EAAE,SAAS,GACb,gBAAgB,CAqClB"}
@@ -0,0 +1,74 @@
1
+ import { screenRelayError } from '@substrat-run/kernel';
2
+ /** The store subscription an edge is registered as. */
3
+ export const relayEdgeSubscription = (edge) => `relay:${edge.app}:${edge.type}`;
4
+ /** Refuse two edges for one (app, type): one subscription is one policy. */
5
+ export function assertDistinctEdges(edges) {
6
+ const seen = new Set();
7
+ for (const e of edges) {
8
+ const name = relayEdgeSubscription(e);
9
+ if (seen.has(name))
10
+ throw new Error(`relay: '${e.app}' subscribes to '${e.type}' twice — one edge is one subscription under one policy`);
11
+ seen.add(name);
12
+ }
13
+ }
14
+ /** Refuse edges on a broker over a file: it outlives them (the limit above). */
15
+ export function assertEdgesInMemory(file, edges) {
16
+ if (file !== undefined && edges !== undefined && edges.length > 0) {
17
+ throw new Error('relay: edges are fixed for a broker’s life, and a broker over a file outlives them — give edges to an in-memory broker');
18
+ }
19
+ }
20
+ /** The relay's router, with the apps an edge covers left out of `subscribers`. `forward` is the router's own. */
21
+ export function routerWithout(router, edges) {
22
+ if (edges.length === 0)
23
+ return router;
24
+ const covered = new Set(edges.map(relayEdgeSubscription));
25
+ return {
26
+ subscribers: async (input) => (await router.subscribers(input)).filter((app) => !covered.has(relayEdgeSubscription({ app, type: input.type }))),
27
+ forward: (tenantId, handoff) => router.forward(tenantId, handoff),
28
+ };
29
+ }
30
+ /** The receiver registered under {@link relayEdgeSubscription}: one hop of the relay, for one app and one type. */
31
+ export function relayEdgeReceiver(edge, seams, sql) {
32
+ const log = seams.log ?? ((line) => console.log(JSON.stringify({ broker: 'relay', ...line })));
33
+ return {
34
+ deliver: async (message) => {
35
+ // The store owes an edge only its type's events (`eventTypes`); held here too, defensively.
36
+ if (message.kind !== 'event' || message.type !== edge.type)
37
+ return;
38
+ try {
39
+ // Asked per message, as the relay asks (`subscribers`): an edge names no tenant, so an app
40
+ // with no live install in this message's tenant, or one that stopped importing the type, is
41
+ // owed nothing here, where the relay would open no hop. The router is the unfiltered one.
42
+ const apps = await seams.router.subscribers({ tenantId: message.tenantId, type: edge.type });
43
+ if (!apps.includes(edge.app))
44
+ return;
45
+ const exported = await seams.exports.exportOne({ tenantId: message.tenantId, scopeId: message.scopeId, consumer: edge.app, message });
46
+ if (exported.outcome === 'unexported')
47
+ return;
48
+ if (exported.outcome === 'paused')
49
+ throw new Error(`paused: '${edge.app}' lacks ${exported.missing.join(', ')}`);
50
+ const body = exported.outcome === 'released' ? { event: exported.event } : { withheld: exported.withheld };
51
+ const answer = await seams.router.forward(message.tenantId, {
52
+ to: edge.app,
53
+ message: {
54
+ id: message.id,
55
+ kind: 'event',
56
+ scopeId: message.scopeId,
57
+ type: message.type,
58
+ body,
59
+ committedAt: message.committedAt,
60
+ },
61
+ });
62
+ if (answer.outcome === 'refused') {
63
+ log({ event: 'relay-refused', reason: answer.reason, messageId: message.id, to: edge.app, tenantId: message.tenantId });
64
+ }
65
+ }
66
+ catch (err) {
67
+ // Screened as the relay screens its own: an erasure that landed while the call was out must
68
+ // not come back through the text of its failure.
69
+ throw new Error(screenRelayError(sql, message.tenantId, message.scopeId, err instanceof Error ? err.message : String(err)));
70
+ }
71
+ },
72
+ };
73
+ }
74
+ //# sourceMappingURL=relay-edges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-edges.js","sourceRoot":"","sources":["../src/relay-edges.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,gBAAgB,EAAoF,MAAM,sBAAsB,CAAC;AAS1I,uDAAuD;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAqC,EAAU,EAAE,CAAC,SAAS,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;AAEzH,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB,CAAC,KAA2B;IAC7D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,oBAAoB,CAAC,CAAC,IAAI,yDAAyD,CAAC,CAAC;QACzI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;AACH,CAAC;AAED,gF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C,EAAE;wBACd,IAAI,EAAE,OAAO;wBACb,OAAO,EAAE,OAAO,CAAC,OAAkC;wBACnD,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,IAAI;wBACJ,WAAW,EAAE,OAAO,CAAC,WAAW;qBACjC;iBACF,CAAC,CAAC;gBACH,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBACjC,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1H,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,4FAA4F;gBAC5F,iDAAiD;gBACjD,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC9H,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -100,6 +100,14 @@ export interface LocalVerticalBroker {
100
100
  */
101
101
  setBinding(from: LocalVerticalCallerRef, target: string, targetScopeId: ScopeId | null): Promise<void>;
102
102
  }
103
+ /**
104
+ * The caller of a local peer call or relay, re-read from ITS host's directory: a live, primary
105
+ * instance of the vertical it says it is, in the tenant it says, of a live tenant. Suspended,
106
+ * archived, forked, preview — all refused `forbidden`, before any target is looked up. The one
107
+ * copy of the gate the local peer broker and the local relay router share (the router's gates 3
108
+ * and 4 on the hosted path).
109
+ */
110
+ export declare function assertLiveCaller(callerHost: SqliteScopeHost | undefined, caller: LocalVerticalCallerRef): Promise<void>;
103
111
  /**
104
112
  * Stand two (or more) verticals side by side on the pure host, each on its own `SqliteScopeHost`
105
113
  * — one vertical's code per host, as one script per vertical in production — keyed by registry
@@ -109,4 +117,6 @@ export interface LocalVerticalBroker {
109
117
  export declare function createLocalVerticalBroker(hosts: Readonly<Record<string, SqliteScopeHost>>,
110
118
  /** Keyed by the target's registry slug, as `hosts` is. */
111
119
  targets?: Readonly<Record<string, LocalVerticalTargetHooks>>): LocalVerticalBroker;
120
+ export { createLocalRelayRouter, type LocalRelayRouter, type LocalRelaySubscriber } from './local-relay-router.js';
121
+ export { localRelayMesh, type LocalRelayMesh, type LocalRelayMeshOptions } from './local-relay-mesh.js';
112
122
  //# sourceMappingURL=vertical-broker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-broker.d.ts","sourceRoot":"","sources":["../src/vertical-broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EASL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,EAAE,eAAqE,CAAC;AAEvG,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,iGAAiG;AACjG,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,kFAAkF;IAClF,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED,8FAA8F;AAC9F,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,MAAM,CAAC,CAAC,GA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, peerOnBehalf, platformActorId, scopeId as scopeI
38
38
  import { isPrimaryScope, resolvePeerInstanceFrom } from '@substrat-run/kernel';
39
39
  /** The platform actor the broker reads the directory as — the platform, on the pure host. */
40
40
  export const LOCAL_BROKER_ACTOR = platformActorId.parse('01JZ00000000000000PEERBRKR');
41
+ /**
42
+ * The caller of a local peer call or relay, re-read from ITS host's directory: a live, primary
43
+ * instance of the vertical it says it is, in the tenant it says, of a live tenant. Suspended,
44
+ * archived, forked, preview — all refused `forbidden`, before any target is looked up. The one
45
+ * copy of the gate the local peer broker and the local relay router share (the router's gates 3
46
+ * and 4 on the hosted path).
47
+ */
48
+ export async function assertLiveCaller(callerHost, caller) {
49
+ const record = await callerHost?.admin.getScopeRecord(LOCAL_BROKER_ACTOR, caller.tenantId, caller.scopeId);
50
+ if (!record || record.vertical !== caller.vertical) {
51
+ throw substratError('forbidden', `scope ${caller.scopeId} is not an instance of '${caller.vertical}' in this tenant — a peer ` +
52
+ 'call is made by a live instance of the calling vertical');
53
+ }
54
+ const tenant = await callerHost.admin.getTenant(LOCAL_BROKER_ACTOR, caller.tenantId);
55
+ if (tenant?.status !== 'active' || record.status !== 'active' || !isPrimaryScope(record)) {
56
+ throw substratError('forbidden', `scope ${caller.scopeId} of '${caller.vertical}' may not call other verticals: it is ` +
57
+ (tenant?.status !== 'active' ? `in a ${tenant?.status ?? 'missing'} tenant` : record.status !== 'active' ? `${record.status}` : 'a preview or a fork') +
58
+ ' — only a live primary instance acts as its vertical');
59
+ }
60
+ }
41
61
  /**
42
62
  * Stand two (or more) verticals side by side on the pure host, each on its own `SqliteScopeHost`
43
63
  * — one vertical's code per host, as one script per vertical in production — keyed by registry
@@ -94,22 +114,9 @@ targets = {}) {
94
114
  return {
95
115
  async invoke(target, operation, input, options) {
96
116
  const { onBehalf, ...invokeOptions } = options ?? {};
97
- // 1. The caller, re-read from ITS host's directory on every call: a live, primary
98
- // instance of the vertical it says it is, in the tenant it says. Suspended,
99
- // archived, forked, preview — all refused here, before any target is looked up.
117
+ // 1. The caller, re-read from ITS host's directory on every call (`assertLiveCaller`).
100
118
  // This is the router's per-call gate; nothing downstream re-checks it.
101
- const callerHost = hostOf(caller.vertical);
102
- const record = await callerHost?.admin.getScopeRecord(LOCAL_BROKER_ACTOR, caller.tenantId, caller.scopeId);
103
- if (!record || record.vertical !== caller.vertical) {
104
- throw substratError('forbidden', `scope ${caller.scopeId} is not an instance of '${caller.vertical}' in this tenant — a peer ` +
105
- 'call is made by a live instance of the calling vertical');
106
- }
107
- const tenant = await callerHost.admin.getTenant(LOCAL_BROKER_ACTOR, caller.tenantId);
108
- if (tenant?.status !== 'active' || record.status !== 'active' || !isPrimaryScope(record)) {
109
- throw substratError('forbidden', `scope ${caller.scopeId} of '${caller.vertical}' may not call other verticals: it is ` +
110
- (tenant?.status !== 'active' ? `in a ${tenant?.status ?? 'missing'} tenant` : record.status !== 'active' ? `${record.status}` : 'a preview or a fork') +
111
- ' — only a live primary instance acts as its vertical');
112
- }
119
+ await assertLiveCaller(hostOf(caller.vertical), caller);
113
120
  // 2. The target, by slug, in the CALLER's tenant only — the kernel's one rule.
114
121
  const target_ = verticalSlug.parse(target);
115
122
  const targetHost = hostOf(target_);
@@ -182,4 +189,6 @@ targets = {}) {
182
189
  },
183
190
  };
184
191
  }
192
+ export { createLocalRelayRouter } from './local-relay-router.js';
193
+ export { localRelayMesh } from './local-relay-mesh.js';
185
194
  //# sourceMappingURL=vertical-broker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-broker.js","sourceRoot":"","sources":["../src/vertical-broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,OAAO,IAAI,SAAS,EACpB,aAAa,EACb,QAAQ,IAAI,UAAU,EACtB,YAAY,GAMb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAs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AC;AACJ,CAAC;AAED,OAAO,EAAE,sBAAsB,EAAoD,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,cAAc,EAAmD,MAAM,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/adapter-sqlite",
3
- "version": "0.240.0",
3
+ "version": "0.242.0",
4
4
  "description": "Pure-SQLite scope host — real kernel semantics with no Cloudflare dependency (D-14): local dev, CI, self-host/escrow",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -39,18 +39,18 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "better-sqlite3": "^13.2.0",
42
- "@substrat-run/kernel": "^0.240.0",
43
- "@substrat-run/model-view": "^0.8.14",
44
- "@substrat-run/contracts": "^0.233.0"
42
+ "@substrat-run/contracts": "^0.235.0",
43
+ "@substrat-run/model-view": "^0.9.0",
44
+ "@substrat-run/kernel": "^0.242.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/better-sqlite3": "^9.6.0",
48
48
  "hono": "^4.13.13",
49
49
  "typescript": "^7.0.0",
50
50
  "vitest": "5.0.5",
51
- "@substrat-run/contract-tests": "^0.240.0",
52
- "@substrat-run/attachment-extractors": "^0.2.101",
53
- "@substrat-run/vertical-auth": "^0.42.3"
51
+ "@substrat-run/contract-tests": "^0.242.0",
52
+ "@substrat-run/vertical-auth": "^0.42.5",
53
+ "@substrat-run/attachment-extractors": "^0.2.103"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"