stitchkit 0.76.0 → 0.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/keyspace.d.ts +37 -0
- package/dist/application/keyspace.d.ts.map +1 -1
- package/dist/application.d.ts +1 -1
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +28 -4
- package/dist/live/watch-client.d.ts +52 -5
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live.d.ts +1 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +4 -0
- package/llms-full.txt +30 -5
- package/package.json +1 -1
|
@@ -29,6 +29,18 @@
|
|
|
29
29
|
* and the owner's to configure. Saying "durable" without saying whose durability
|
|
30
30
|
* would be the more comfortable lie.
|
|
31
31
|
*
|
|
32
|
+
* ## Two ways in, because there are two lifecycles
|
|
33
|
+
*
|
|
34
|
+
* {@link keyspaceResource} declares it to the application kernel, which is right
|
|
35
|
+
* whenever there is a kernel: it closes after everything that writes to it,
|
|
36
|
+
* because a writer that depends on it is stopped first.
|
|
37
|
+
*
|
|
38
|
+
* {@link openKeyspace} opens one directly, for an application that owns its own
|
|
39
|
+
* lifecycle — a server that binds its signals and closes what it holds in an
|
|
40
|
+
* order it wrote itself. The resource is a thin wrapper over exactly this, not a
|
|
41
|
+
* second implementation: without it the only way to open a keyspace would be to
|
|
42
|
+
* have a kernel, which is a requirement nothing about a keyspace justifies.
|
|
43
|
+
*
|
|
32
44
|
* ## It is a resource, not a global
|
|
33
45
|
*
|
|
34
46
|
* A keyspace is opened as a {@link ManagedResource} and its handle is read with
|
|
@@ -127,6 +139,31 @@ export declare function defineKeyspace<TValue>(name: string, declaration: {
|
|
|
127
139
|
schema: z.ZodType<TValue>;
|
|
128
140
|
key: (value: TValue) => string;
|
|
129
141
|
}): KeyspaceDeclaration<TValue>;
|
|
142
|
+
/**
|
|
143
|
+
* An opened keyspace, plus the lifecycle its owner drives.
|
|
144
|
+
*
|
|
145
|
+
* The same four phases a {@link ManagedResource} has, because they are the same
|
|
146
|
+
* four phases — an application without a kernel calls them in the order it
|
|
147
|
+
* chose, and one with a kernel gets them called for it.
|
|
148
|
+
*/
|
|
149
|
+
export interface OpenedKeyspace<TValue> {
|
|
150
|
+
readonly keyspace: OpenKeyspace<TValue>;
|
|
151
|
+
/** Refuse new writes. The queued ones still finish. */
|
|
152
|
+
stopAdmission(): void;
|
|
153
|
+
/** Wait for every accepted write to reach the backend. */
|
|
154
|
+
drain(): Promise<void>;
|
|
155
|
+
/** Report anything still unwritten, then close the backend. */
|
|
156
|
+
close(): Promise<void>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Open a keyspace directly, for an application that owns its own lifecycle.
|
|
160
|
+
*
|
|
161
|
+
* Loads every stored record before it returns, so `get` and `list` are
|
|
162
|
+
* answerable from the first call. Where there is a kernel, prefer
|
|
163
|
+
* {@link keyspaceResource} — it gets the ordering right without anyone
|
|
164
|
+
* remembering to.
|
|
165
|
+
*/
|
|
166
|
+
export declare function openKeyspace<TValue>(declaration: KeyspaceDeclaration<TValue>, config: KeyspaceResourceConfig<TValue>): Promise<OpenedKeyspace<TValue>>;
|
|
130
167
|
/**
|
|
131
168
|
* A keyspace as a managed resource. Its `start` publishes the {@link OpenKeyspace}.
|
|
132
169
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyspace.d.ts","sourceRoot":"","sources":["../../src/application/keyspace.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"keyspace.d.ts","sourceRoot":"","sources":["../../src/application/keyspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,mBAAmB,CAAC,MAAM;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,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CASjC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EACrC,WAAW,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACxC,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC,GACrC,eAAe,CAcjB;AA4GD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAWvD"}
|
package/dist/application.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { type DiagnosticJournal, type DiagnosticJournalCloseResult, DiagnosticJo
|
|
|
6
6
|
export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events.js';
|
|
7
7
|
export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, type ApplicationOperationalHandlers, type ApplicationOperationalHandlersOptions, ApplicationOperationalHandlersOptionsSchema, createApplicationHealthHandler, createApplicationOperationalHandlers, } from './application/health.js';
|
|
8
8
|
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownBudget, ApplicationShutdownBudgetSchema, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel.js';
|
|
9
|
-
export { defineKeyspace, type KeyspaceBackend, type KeyspaceChange, type KeyspaceDeclaration, type KeyspaceResourceConfig, keyspaceResource, memoryKeyspaceBackend, type OpenKeyspace, } from './application/keyspace.js';
|
|
9
|
+
export { defineKeyspace, type KeyspaceBackend, type KeyspaceChange, type KeyspaceDeclaration, type KeyspaceResourceConfig, keyspaceResource, memoryKeyspaceBackend, type OpenedKeyspace, type OpenKeyspace, openKeyspace, } from './application/keyspace.js';
|
|
10
10
|
export { type SqliteKeyspaceBackendConfig, sqliteKeyspaceBackend, } from './application/keyspace-sqlite.js';
|
|
11
11
|
export { type ApplicationSnapshotSink, type ApplicationSnapshotSinkConfig, type ApplicationSnapshotSinkError, type ApplicationSnapshotSinkStatus, ApplicationSnapshotSinkStatusSchema, createApplicationSnapshotSink, type RevisionedApplicationSnapshot, } from './application/latest-sink.js';
|
|
12
12
|
export { defineManagedResource, type ManagedResource, type ManagedResourceContext, type ManagedResourceDependency, type ManagedResourcePublished, type ManagedResourcePublishesNoValue, type ManagedResourceStartResult, managedResourceDependencyId, } from './application/resource.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,mCAAmC,EACxC,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,KAAK,6BAA6B,EAClC,mCAAmC,EACnC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,8BAA8B,EAC9B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,KAAK,i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BAA+B,EACpC,qCAAqC,EACrC,KAAK,8BAA8B,EACnC,KAAK,qCAAqC,EAC1C,2CAA2C,EAC3C,8BAA8B,EAC9B,oCAAoC,GACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,oBAAoB,EACzB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,gCAAgC,EAChC,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,mCAAmC,EACxC,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B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AA0B,EAC/B,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,gCAAgC,EAChC,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/application.js
CHANGED
|
@@ -1223,7 +1223,32 @@ function defineKeyspace(name, declaration) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
return { name, schema: declaration.schema, key: declaration.key };
|
|
1225
1225
|
}
|
|
1226
|
+
async function openKeyspace(declaration, config) {
|
|
1227
|
+
const machine = keyspaceMachine(declaration, config);
|
|
1228
|
+
await machine.load();
|
|
1229
|
+
return {
|
|
1230
|
+
keyspace: machine.keyspace,
|
|
1231
|
+
stopAdmission: machine.stopAdmission,
|
|
1232
|
+
drain: machine.drain,
|
|
1233
|
+
close: machine.close
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1226
1236
|
function keyspaceResource(declaration, config) {
|
|
1237
|
+
const machine = keyspaceMachine(declaration, config);
|
|
1238
|
+
return {
|
|
1239
|
+
id: config.id ?? `keyspace:${declaration.name}`,
|
|
1240
|
+
...config.dependsOn && { dependsOn: config.dependsOn },
|
|
1241
|
+
async start(_context) {
|
|
1242
|
+
await machine.load();
|
|
1243
|
+
return { value: machine.keyspace };
|
|
1244
|
+
},
|
|
1245
|
+
stopAdmission: machine.stopAdmission,
|
|
1246
|
+
drain: machine.drain,
|
|
1247
|
+
close: machine.close,
|
|
1248
|
+
force: machine.force
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function keyspaceMachine(declaration, config) {
|
|
1227
1252
|
const maxPending = config.maxPendingWrites ?? 1024;
|
|
1228
1253
|
const records = new Map;
|
|
1229
1254
|
let admitting = true;
|
|
@@ -1281,14 +1306,12 @@ function keyspaceResource(declaration, config) {
|
|
|
1281
1306
|
config.onUnwritten?.(pending);
|
|
1282
1307
|
}
|
|
1283
1308
|
return {
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
async start(_context) {
|
|
1309
|
+
keyspace,
|
|
1310
|
+
async load() {
|
|
1287
1311
|
for (const stored of await config.backend.load()) {
|
|
1288
1312
|
const value = declaration.schema.parse(stored);
|
|
1289
1313
|
records.set(declaration.key(value), value);
|
|
1290
1314
|
}
|
|
1291
|
-
return { value: keyspace };
|
|
1292
1315
|
},
|
|
1293
1316
|
stopAdmission() {
|
|
1294
1317
|
admitting = false;
|
|
@@ -1724,6 +1747,7 @@ export {
|
|
|
1724
1747
|
sqliteKeyspaceBackend,
|
|
1725
1748
|
readDiagnosticJournalLockDiagnosis,
|
|
1726
1749
|
projectApplicationStatus,
|
|
1750
|
+
openKeyspace,
|
|
1727
1751
|
memoryKeyspaceBackend,
|
|
1728
1752
|
managedServerResource,
|
|
1729
1753
|
managedResourceDependencyId,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* sense a rendering component can use.
|
|
45
45
|
*/
|
|
46
46
|
import type { ContractDef, EndpointDef } from '../contract/define.js';
|
|
47
|
-
import { type WatchKey, type WatchStateFrame } from './watch-contract.js';
|
|
47
|
+
import { WATCH_CLOSE, WATCH_OPEN, WATCH_STATE, WATCH_VALUE, type WatchKey, type WatchStateFrame, type WatchValueFrame } from './watch-contract.js';
|
|
48
48
|
export interface WatchListeners<TValue> {
|
|
49
49
|
value(value: TValue): void;
|
|
50
50
|
/** Phase and, when unhealthy, the read's own code and message. */
|
|
@@ -56,11 +56,58 @@ export interface WatchHandle<TValue> {
|
|
|
56
56
|
/** Drops every listener this handle registered and releases the key. */
|
|
57
57
|
close(): void;
|
|
58
58
|
}
|
|
59
|
-
/**
|
|
59
|
+
/** What the server sends a watcher, by event name. */
|
|
60
|
+
export interface WatchInboundEvents {
|
|
61
|
+
[WATCH_VALUE]: WatchValueFrame;
|
|
62
|
+
[WATCH_STATE]: WatchStateFrame;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A realtime client, as much of one as this adapter needs to see.
|
|
66
|
+
*
|
|
67
|
+
* Four members and no types on them, because the point of this shape is that a
|
|
68
|
+
* *typed* client satisfies it: a bound realtime client's `on` is generic over
|
|
69
|
+
* the events of the contract it was bound to, and TypeScript will not relate
|
|
70
|
+
* that signature to any concrete one written here — measured, both with a payload
|
|
71
|
+
* parameter and with the tuple form the realtime handler actually has.
|
|
72
|
+
*/
|
|
73
|
+
export interface RealtimeClientLike {
|
|
74
|
+
on: (...args: never[]) => unknown;
|
|
75
|
+
emit: (...args: never[]) => unknown;
|
|
76
|
+
request: (...args: never[]) => unknown;
|
|
77
|
+
onConnectionChange: (...args: never[]) => unknown;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Hand a bound realtime client to {@link createWatchClient}.
|
|
81
|
+
*
|
|
82
|
+
* The guide used to say "pass a bound realtime client" and the types refused it,
|
|
83
|
+
* which is the worst combination: an instruction that reads as supported and
|
|
84
|
+
* fails at the call site. This is the conversion, once, in the framework —
|
|
85
|
+
* rather than the same cast copied into every application that follows the
|
|
86
|
+
* guide.
|
|
87
|
+
*/
|
|
88
|
+
export declare function watchTransport(client: RealtimeClientLike): WatchTransport;
|
|
89
|
+
/**
|
|
90
|
+
* The transport half a watch client needs — a realtime client bound to a
|
|
91
|
+
* contract that carries `watchContract`.
|
|
92
|
+
*
|
|
93
|
+
* Written in the protocol's own four event names rather than in `string`, so an
|
|
94
|
+
* application bringing its own transport knows exactly what to implement.
|
|
95
|
+
*
|
|
96
|
+
* A **bound realtime client does not satisfy this shape**, and no phrasing of it
|
|
97
|
+
* would fix that: its `on` is generic over the events of the contract it was
|
|
98
|
+
* bound to, and TypeScript will not relate two generic signatures like these.
|
|
99
|
+
* Pass it through {@link watchTransport}, which is that conversion done once
|
|
100
|
+
* here instead of once per application.
|
|
101
|
+
*/
|
|
60
102
|
export interface WatchTransport {
|
|
61
|
-
on(event:
|
|
62
|
-
emit(event:
|
|
63
|
-
|
|
103
|
+
on<TEvent extends keyof WatchInboundEvents>(event: TEvent, handler: (payload: WatchInboundEvents[TEvent]) => void): () => void;
|
|
104
|
+
emit(event: typeof WATCH_CLOSE, payload: {
|
|
105
|
+
key: WatchKey;
|
|
106
|
+
}): unknown;
|
|
107
|
+
request(event: typeof WATCH_OPEN, payload: {
|
|
108
|
+
key: WatchKey;
|
|
109
|
+
args: unknown;
|
|
110
|
+
}, options: {
|
|
64
111
|
timeoutMs: number;
|
|
65
112
|
}): Promise<{
|
|
66
113
|
accepted: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-client.d.ts","sourceRoot":"","sources":["../../src/live/watch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,
|
|
1
|
+
{"version":3,"file":"watch-client.d.ts","sourceRoot":"","sources":["../../src/live/watch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,cAAc,CAAC,MAAM;IACpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,KAAK,CAAC,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,WAAW,CAAC,MAAM;IACjC,sFAAsF;IACtF,SAAS,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC;IACzD,wEAAwE;IACxE,KAAK,IAAI,IAAI,CAAC;CACf;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC/B,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC;IAClC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC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SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D;AAuBD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI;KACnE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC;CACzE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrE,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,MAAM,EAAE,iBAAiB,GACxB,gBAAgB,CAAC,CAAC,CAAC,CAwNrB"}
|
package/dist/live.d.ts
CHANGED
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* a watched read live in `stitchkit/application`. → ADR 0150.
|
|
14
14
|
*/
|
|
15
15
|
export { defineEvents, type EventDecision, type EventDeliveryMode, type EventPayloads, type EventsConfig, type EventsDeclaration, type EventTopicDeclaration, type EventTopicRegistry, type EventTopicsOfMode, type EventUndecided, toRealtimeContract, type WireTopic, } from './live/events.js';
|
|
16
|
-
export { createWatchClient, type TypedWatchClient, type WatchClientConfig, type WatchHandle, type WatchListeners, type WatchTransport, } from './live/watch-client.js';
|
|
16
|
+
export { createWatchClient, type RealtimeClientLike, type TypedWatchClient, type WatchClientConfig, type WatchHandle, type WatchInboundEvents, type WatchListeners, type WatchTransport, watchTransport, } from './live/watch-client.js';
|
|
17
17
|
export { WATCH_CLOSE, WATCH_OPEN, WATCH_STATE, WATCH_VALUE, type WatchKey, WatchKeySchema, type WatchStateFrame, WatchStateSchema, type WatchValueFrame, WatchValueSchema, watchContract, watchKeyString, } from './live/watch-contract.js';
|
|
18
18
|
//# sourceMappingURL=live.d.ts.map
|
package/dist/live.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,kBAAkB,EAClB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,kBAAkB,EAClB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,eAAe,EACpB,gBAAgB,EAChB,KAAK,eAAe,EACpB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
package/dist/live.js
CHANGED
|
@@ -116,6 +116,9 @@ function watchKeyString(key) {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
// src/live/watch-client.ts
|
|
119
|
+
function watchTransport(client) {
|
|
120
|
+
return client;
|
|
121
|
+
}
|
|
119
122
|
function createWatchClient(contract, config) {
|
|
120
123
|
const entries = new Map;
|
|
121
124
|
const digests = new Map;
|
|
@@ -302,6 +305,7 @@ function createWatchClient(contract, config) {
|
|
|
302
305
|
return client;
|
|
303
306
|
}
|
|
304
307
|
export {
|
|
308
|
+
watchTransport,
|
|
305
309
|
watchKeyString,
|
|
306
310
|
watchContract,
|
|
307
311
|
toRealtimeContract,
|
package/llms-full.txt
CHANGED
|
@@ -7617,9 +7617,17 @@ const hub = createWatchHub({
|
|
|
7617
7617
|
|
|
7618
7618
|
```ts
|
|
7619
7619
|
// browser
|
|
7620
|
-
import { createWatchClient } from 'stitchkit/live';
|
|
7621
|
-
|
|
7622
|
-
|
|
7620
|
+
import { createWatchClient, watchTransport } from 'stitchkit/live';
|
|
7621
|
+
|
|
7622
|
+
// `live` is the bound realtime client. It goes through `watchTransport`, and
|
|
7623
|
+
// that is not ceremony: its `on` is generic over the contract it was bound to,
|
|
7624
|
+
// and TypeScript will not relate that signature to the one a watch client
|
|
7625
|
+
// declares. The conversion lives in the framework so it is written once rather
|
|
7626
|
+
// than in every application.
|
|
7627
|
+
const watch = createWatchClient(notesContract, {
|
|
7628
|
+
transport: watchTransport(live),
|
|
7629
|
+
holdMs: 30_000,
|
|
7630
|
+
});
|
|
7623
7631
|
|
|
7624
7632
|
const handle = watch.list({ folder: 'inbox' });
|
|
7625
7633
|
const stop = handle.subscribe({
|
|
@@ -7737,8 +7745,23 @@ point:
|
|
|
7737
7745
|
immediately. An event emitted before the memory update is a wake-up to the old
|
|
7738
7746
|
value.
|
|
7739
7747
|
|
|
7740
|
-
|
|
7741
|
-
|
|
7748
|
+
Where there is no kernel — a server that binds its own signals and closes what
|
|
7749
|
+
it holds in an order it wrote — open it directly instead:
|
|
7750
|
+
|
|
7751
|
+
```ts
|
|
7752
|
+
const opened = await openKeyspace(sessions, { backend });
|
|
7753
|
+
opened.keyspace.get(id); // synchronous, from memory
|
|
7754
|
+
// on shutdown, in the order you chose:
|
|
7755
|
+
opened.stopAdmission();
|
|
7756
|
+
await opened.drain();
|
|
7757
|
+
await opened.close();
|
|
7758
|
+
```
|
|
7759
|
+
|
|
7760
|
+
The resource is a thin wrapper over exactly that, so there is one implementation
|
|
7761
|
+
and two lifecycles, not two keyspaces.
|
|
7762
|
+
|
|
7763
|
+
Where there **is** a kernel it is a **resource**, read with `context.use(...)`,
|
|
7764
|
+
rather than a function you call wherever you need it. The kernel resolves its resource graph in the constructor
|
|
7742
7765
|
and cannot register one afterwards, so a keyspace opened by a bare call inside
|
|
7743
7766
|
another resource's `start` is never drained, never closed, and never ordered
|
|
7744
7767
|
against the things that write to it.
|
|
@@ -13125,6 +13148,7 @@ realtime contract from `stitchkit`, and the server halves live in `stitchkit/app
|
|
|
13125
13148
|
| `EventPayloads` / `EventTopicsOfMode` / `WireTopic` | _types_ | payload map keyed by wire topic, the topics of one mode, and the `prefix.name` a topic is addressed by |
|
|
13126
13149
|
| `createWatchClient` | function | contract-shaped watch client: `watch.action(args)` returns a ref-counted handle sharing one subscription |
|
|
13127
13150
|
| `WatchHandle` / `WatchListeners` / `WatchClientConfig` / `WatchTransport` / `TypedWatchClient` | _types_ | subscribe/close, the value and state listeners, hold window and open deadline, and the bound realtime client it rides |
|
|
13151
|
+
| `watchTransport` / `RealtimeClientLike` / `WatchInboundEvents` | function / _types_ | hands a bound realtime client to a watch client — two generic signatures TypeScript will not relate, converted once here |
|
|
13128
13152
|
| `watchContract` | const | the four-event realtime contract a watched read travels on |
|
|
13129
13153
|
| `WATCH_OPEN` / `WATCH_CLOSE` / `WATCH_VALUE` / `WATCH_STATE` | const | the event names of that contract |
|
|
13130
13154
|
| `WatchKey` / `WatchKeySchema` / `watchKeyString` | type / schema / function | `(service, action, arguments digest)` — the identity both ends compute the same way |
|
|
@@ -13555,6 +13579,7 @@ the function that derives it from a snapshot,
|
|
|
13555
13579
|
| Export | Kind | Summary |
|
|
13556
13580
|
|--------|------|---------|
|
|
13557
13581
|
| `defineKeyspace` / `keyspaceResource` | function | a named record set read synchronously from memory and written through one serialised chain; backend first, then memory, then the change event |
|
|
13582
|
+
| `openKeyspace` / `OpenedKeyspace` | function / type | the same keyspace opened directly, for an application that owns its own lifecycle rather than declaring resources to a kernel |
|
|
13558
13583
|
| `KeyspaceBackend` / `KeyspaceDeclaration` / `KeyspaceChange` / `KeyspaceResourceConfig` / `OpenKeyspace` | _types_ | the four-method durability port, the declaration, the announced change, the resource's options and the published handle |
|
|
13559
13584
|
| `memoryKeyspaceBackend` / `sqliteKeyspaceBackend` / `SqliteKeyspaceBackendConfig` | function / type | a disposable in-process backend, and one table with a key and a JSON payload over a caller-owned database |
|
|
13560
13585
|
| `SqliteDatabase` / `SqliteStatement` / `SqliteValue` | _types_ | the minimal synchronous SQLite boundary the framework types against |
|
package/package.json
CHANGED