@volter/world-core 2.0.11 → 2.0.13
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.
- package/dist/generated/pack-facts.json +14 -1
- package/dist/src/derived-core.d.ts +1 -2
- package/dist/src/derived.d.ts +2 -4
- package/dist/src/derived.js +2 -2
- package/dist/src/packRegistry.d.ts +13 -0
- package/generated/pack-facts.json +14 -1
- package/package.json +1 -1
- package/src/derived-core.ts +1 -2
- package/src/derived.ts +4 -6
- package/src/packRegistry.ts +9 -0
|
@@ -3590,7 +3590,15 @@
|
|
|
3590
3590
|
"supabasemgmt"
|
|
3591
3591
|
]
|
|
3592
3592
|
},
|
|
3593
|
-
"
|
|
3593
|
+
"hosts": [
|
|
3594
|
+
{
|
|
3595
|
+
"host": "api.supabase.com"
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
"suffix": ".supabase.co",
|
|
3599
|
+
"pathPattern": "^/(rest|storage|auth)/v1(/|$)"
|
|
3600
|
+
}
|
|
3601
|
+
],
|
|
3594
3602
|
"archetype": "engine-control",
|
|
3595
3603
|
"protocol": {
|
|
3596
3604
|
"major": 1,
|
|
@@ -3617,6 +3625,11 @@
|
|
|
3617
3625
|
"read_replica",
|
|
3618
3626
|
"backup"
|
|
3619
3627
|
],
|
|
3628
|
+
"managedDatabase": {
|
|
3629
|
+
"kind": "postgres",
|
|
3630
|
+
"arg": "--database",
|
|
3631
|
+
"note": "PostgREST, Storage and Auth are served over the application's own database: the World's managed postgres, the database its migrations and direct queries use"
|
|
3632
|
+
},
|
|
3620
3633
|
"serveExport": "createSupabaseTwinServer"
|
|
3621
3634
|
},
|
|
3622
3635
|
"supermemory": {
|
|
@@ -163,8 +163,7 @@ export type DerivedManifest = {
|
|
|
163
163
|
template: string;
|
|
164
164
|
acceptProvided?: boolean;
|
|
165
165
|
};
|
|
166
|
-
/** operations the derived core must not claim though their resource is declared:
|
|
167
|
-
* the pack's existing code, or a gap, until someone models them */
|
|
166
|
+
/** operations the derived core must not claim though their resource is declared: a gap until someone models them */
|
|
168
167
|
unmodeled?: string[];
|
|
169
168
|
/** operations that only read though nothing in the spec says so (a POST that returns data):
|
|
170
169
|
* a read-only twin answers them */
|
package/dist/src/derived.d.ts
CHANGED
|
@@ -54,10 +54,8 @@ export type DerivedFetchOptions = {
|
|
|
54
54
|
};
|
|
55
55
|
/** An RPC wire: every method is reached by any HTTP method (Slack's clients POST reads too). */
|
|
56
56
|
anyMethod?: boolean;
|
|
57
|
-
/** The pack's existing fetch while it moves: everything no handler or core owns, and what the core cannot model. */
|
|
58
|
-
legacy?: (request: Request) => Promise<Response>;
|
|
59
57
|
/** What every operation a handler or the core serves passes through (read-only refusal, version
|
|
60
|
-
* checks, idempotent replay)
|
|
58
|
+
* checks, idempotent replay). */
|
|
61
59
|
around?: (call: DerivedCall, next: () => Promise<Response>) => Promise<Response>;
|
|
62
60
|
/** The vendor's answer for an operation nothing models: the pack's gap. */
|
|
63
61
|
gap: (request: Request, operation: DerivedOperation | undefined, reason: string) => Response;
|
|
@@ -74,7 +72,7 @@ export declare function matchOperation(routes: Map<string, Route[]>, method: str
|
|
|
74
72
|
operation: DerivedOperation;
|
|
75
73
|
params: Record<string, string>;
|
|
76
74
|
} | undefined;
|
|
77
|
-
export type DerivedOwner = 'handler' | 'core' | '
|
|
75
|
+
export type DerivedOwner = 'handler' | 'core' | 'gap';
|
|
78
76
|
export type DerivedFetch = ((request: Request) => Promise<Response>) & {
|
|
79
77
|
/** Per operationId, who serves it: a semantics handler, the derived core, the pack's existing
|
|
80
78
|
* fetch while it moves, or nothing (the vendor's gap). */
|
package/dist/src/derived.js
CHANGED
|
@@ -85,7 +85,7 @@ export function createDerivedFetch(options) {
|
|
|
85
85
|
if (unknown.length)
|
|
86
86
|
throw new Error(`derived dispatch: handlers name operations the surface does not have: ${unknown.sort().join(', ')}`);
|
|
87
87
|
const routes = compileSurface(options.surface);
|
|
88
|
-
const fallback = (request, operation, reason) =>
|
|
88
|
+
const fallback = (request, operation, reason) => Promise.resolve(options.gap(request, operation, reason));
|
|
89
89
|
// a valid incoming W3C traceparent scopes the dispatch, so every entry it appends records it (trace-context.ts)
|
|
90
90
|
const fetch = ((request) => runWithRequestTrace(request, () => dispatch(request)));
|
|
91
91
|
const dispatch = async (request) => {
|
|
@@ -120,6 +120,6 @@ export function createDerivedFetch(options) {
|
|
|
120
120
|
}
|
|
121
121
|
return fallback(request, matched.operation, 'no handler');
|
|
122
122
|
};
|
|
123
|
-
fetch.owners = () => Object.fromEntries(options.surface.operations.map((o) => [o.id, handlers[o.id] ? 'handler' : options.core?.owns(o) ? 'core' :
|
|
123
|
+
fetch.owners = () => Object.fromEntries(options.surface.operations.map((o) => [o.id, handlers[o.id] ? 'handler' : options.core?.owns(o) ? 'core' : 'gap']));
|
|
124
124
|
return fetch;
|
|
125
125
|
}
|
|
@@ -307,6 +307,19 @@ export type TwinPack = {
|
|
|
307
307
|
export: string;
|
|
308
308
|
urlEnv: string;
|
|
309
309
|
};
|
|
310
|
+
/**
|
|
311
|
+
* THE WORLD'S MANAGED DATABASE — the declared exception to kernel-held state (docs/contributing/architecture.md,
|
|
312
|
+
* managed infrastructure: "A vendor whose data plane is a server in front of Postgres"): the pack's data plane is
|
|
313
|
+
* served over the World's own managed Postgres, which the runtime binds as DATA, never through the environment. At
|
|
314
|
+
* boot the runtime hands the connection URL of the World's managed `kind` service to the twin: `serve <arg> <url>` on
|
|
315
|
+
* the spawn path, the factory's `database` option in the colocated host. A World whose database is not its own
|
|
316
|
+
* managed infrastructure (none declared, or a URL outside it) binds nothing, and the twin refuses its data plane.
|
|
317
|
+
*/
|
|
318
|
+
managedDatabase?: {
|
|
319
|
+
kind: 'postgres';
|
|
320
|
+
arg: string;
|
|
321
|
+
note: string;
|
|
322
|
+
};
|
|
310
323
|
/** PROTOCOL 2 — the pack's half of the REAL state system (state-system.ts): perform one entry
|
|
311
324
|
* against the vendor, refresh the parent log from it, ingest one signed webhook. All over the
|
|
312
325
|
* kernel executor; the pack never holds a credential. Registered with the pack. */
|
|
@@ -3590,7 +3590,15 @@
|
|
|
3590
3590
|
"supabasemgmt"
|
|
3591
3591
|
]
|
|
3592
3592
|
},
|
|
3593
|
-
"
|
|
3593
|
+
"hosts": [
|
|
3594
|
+
{
|
|
3595
|
+
"host": "api.supabase.com"
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
"suffix": ".supabase.co",
|
|
3599
|
+
"pathPattern": "^/(rest|storage|auth)/v1(/|$)"
|
|
3600
|
+
}
|
|
3601
|
+
],
|
|
3594
3602
|
"archetype": "engine-control",
|
|
3595
3603
|
"protocol": {
|
|
3596
3604
|
"major": 1,
|
|
@@ -3617,6 +3625,11 @@
|
|
|
3617
3625
|
"read_replica",
|
|
3618
3626
|
"backup"
|
|
3619
3627
|
],
|
|
3628
|
+
"managedDatabase": {
|
|
3629
|
+
"kind": "postgres",
|
|
3630
|
+
"arg": "--database",
|
|
3631
|
+
"note": "PostgREST, Storage and Auth are served over the application's own database: the World's managed postgres, the database its migrations and direct queries use"
|
|
3632
|
+
},
|
|
3620
3633
|
"serveExport": "createSupabaseTwinServer"
|
|
3621
3634
|
},
|
|
3622
3635
|
"supermemory": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "The kernel of Volter World: one log per twin, branches as pointers, checkpoints, the fold that keeps a twin current, the head that performs a write against the vendor, references, and the git plane. A twin package builds on it; the runtime serves it.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twin",
|
package/src/derived-core.ts
CHANGED
|
@@ -147,8 +147,7 @@ export type DerivedManifest = {
|
|
|
147
147
|
* (`{prefix}_{n}`), or is `{uuid}` for a vendor whose ids are UUIDs: the next is derived from the resource and its
|
|
148
148
|
* count, so a World mints the same ids every run */
|
|
149
149
|
ids: { template: string; acceptProvided?: boolean };
|
|
150
|
-
/** operations the derived core must not claim though their resource is declared:
|
|
151
|
-
* the pack's existing code, or a gap, until someone models them */
|
|
150
|
+
/** operations the derived core must not claim though their resource is declared: a gap until someone models them */
|
|
152
151
|
unmodeled?: string[];
|
|
153
152
|
/** operations that only read though nothing in the spec says so (a POST that returns data):
|
|
154
153
|
* a read-only twin answers them */
|
package/src/derived.ts
CHANGED
|
@@ -46,10 +46,8 @@ export type DerivedFetchOptions = {
|
|
|
46
46
|
core?: { owns: (operation: DerivedOperation) => boolean; serve: (call: DerivedCall) => Promise<DerivedCoreOutcome> };
|
|
47
47
|
/** An RPC wire: every method is reached by any HTTP method (Slack's clients POST reads too). */
|
|
48
48
|
anyMethod?: boolean;
|
|
49
|
-
/** The pack's existing fetch while it moves: everything no handler or core owns, and what the core cannot model. */
|
|
50
|
-
legacy?: (request: Request) => Promise<Response>;
|
|
51
49
|
/** What every operation a handler or the core serves passes through (read-only refusal, version
|
|
52
|
-
* checks, idempotent replay)
|
|
50
|
+
* checks, idempotent replay). */
|
|
53
51
|
around?: (call: DerivedCall, next: () => Promise<Response>) => Promise<Response>;
|
|
54
52
|
/** The vendor's answer for an operation nothing models: the pack's gap. */
|
|
55
53
|
gap: (request: Request, operation: DerivedOperation | undefined, reason: string) => Response;
|
|
@@ -126,7 +124,7 @@ export function matchOperation(routes: Map<string, Route[]>, method: string, pat
|
|
|
126
124
|
return undefined;
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
export type DerivedOwner = 'handler' | 'core' | '
|
|
127
|
+
export type DerivedOwner = 'handler' | 'core' | 'gap';
|
|
130
128
|
|
|
131
129
|
export type DerivedFetch = ((request: Request) => Promise<Response>) & {
|
|
132
130
|
/** Per operationId, who serves it: a semantics handler, the derived core, the pack's existing
|
|
@@ -141,7 +139,7 @@ export function createDerivedFetch(options: DerivedFetchOptions): DerivedFetch {
|
|
|
141
139
|
if (unknown.length) throw new Error(`derived dispatch: handlers name operations the surface does not have: ${unknown.sort().join(', ')}`);
|
|
142
140
|
const routes = compileSurface(options.surface);
|
|
143
141
|
const fallback = (request: Request, operation: DerivedOperation | undefined, reason: string): Promise<Response> =>
|
|
144
|
-
|
|
142
|
+
Promise.resolve(options.gap(request, operation, reason));
|
|
145
143
|
// a valid incoming W3C traceparent scopes the dispatch, so every entry it appends records it (trace-context.ts)
|
|
146
144
|
const fetch = ((request: Request): Promise<Response> => runWithRequestTrace(request, () => dispatch(request))) as DerivedFetch;
|
|
147
145
|
const dispatch = async (request: Request): Promise<Response> => {
|
|
@@ -173,7 +171,7 @@ export function createDerivedFetch(options: DerivedFetchOptions): DerivedFetch {
|
|
|
173
171
|
};
|
|
174
172
|
fetch.owners = () =>
|
|
175
173
|
Object.fromEntries(
|
|
176
|
-
options.surface.operations.map((o) => [o.id, handlers[o.id] ? 'handler' : options.core?.owns(o) ? 'core' :
|
|
174
|
+
options.surface.operations.map((o) => [o.id, handlers[o.id] ? 'handler' : options.core?.owns(o) ? 'core' : 'gap'] as const),
|
|
177
175
|
);
|
|
178
176
|
return fetch;
|
|
179
177
|
}
|
package/src/packRegistry.ts
CHANGED
|
@@ -330,6 +330,15 @@ export type TwinPack = {
|
|
|
330
330
|
* never installed by the World: absent from the application, the client is left as it was.
|
|
331
331
|
*/
|
|
332
332
|
prismaAdapter?: { adapter: string; export: string; urlEnv: string };
|
|
333
|
+
/**
|
|
334
|
+
* THE WORLD'S MANAGED DATABASE — the declared exception to kernel-held state (docs/contributing/architecture.md,
|
|
335
|
+
* managed infrastructure: "A vendor whose data plane is a server in front of Postgres"): the pack's data plane is
|
|
336
|
+
* served over the World's own managed Postgres, which the runtime binds as DATA, never through the environment. At
|
|
337
|
+
* boot the runtime hands the connection URL of the World's managed `kind` service to the twin: `serve <arg> <url>` on
|
|
338
|
+
* the spawn path, the factory's `database` option in the colocated host. A World whose database is not its own
|
|
339
|
+
* managed infrastructure (none declared, or a URL outside it) binds nothing, and the twin refuses its data plane.
|
|
340
|
+
*/
|
|
341
|
+
managedDatabase?: { kind: 'postgres'; arg: string; note: string };
|
|
333
342
|
/** PROTOCOL 2 — the pack's half of the REAL state system (state-system.ts): perform one entry
|
|
334
343
|
* against the vendor, refresh the parent log from it, ingest one signed webhook. All over the
|
|
335
344
|
* kernel executor; the pack never holds a credential. Registered with the pack. */
|