@procedures/client 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/procedures/invoke.d.ts +6 -1
- package/dist/procedures/invoke.d.ts.map +1 -1
- package/dist/procedures/invoke.js +2 -2
- package/dist/procedures/invoke.js.map +1 -1
- package/dist/procedures/schema.d.ts +4 -1
- package/dist/procedures/schema.d.ts.map +1 -1
- package/dist/procedures/schema.js +27 -2
- package/dist/procedures/schema.js.map +1 -1
- package/dist/server/host-policy.d.ts +3 -3
- package/dist/server/host-policy.d.ts.map +1 -1
- package/dist/server/procedure-server.d.ts +2 -2
- package/dist/server/procedure-server.d.ts.map +1 -1
- package/dist/server/procedure-server.js.map +1 -1
- package/package.json +1 -1
- package/src/browser.ts +1 -0
- package/src/procedures/invoke.ts +10 -4
- package/src/procedures/schema.ts +27 -2
- package/src/server/host-policy.ts +3 -3
- package/src/server/procedure-server.ts +2 -2
- package/dist/client/middleware/batching.d.ts +0 -102
- package/dist/client/middleware/batching.d.ts.map +0 -1
- package/dist/client/middleware/batching.js +0 -245
- package/dist/client/middleware/batching.js.map +0 -1
- package/dist/collections/async/async-queue.d.ts +0 -144
- package/dist/collections/async/async-queue.d.ts.map +0 -1
- package/dist/collections/async/async-queue.js +0 -347
- package/dist/collections/async/async-queue.js.map +0 -1
- package/dist/collections/async/channels.d.ts +0 -188
- package/dist/collections/async/channels.d.ts.map +0 -1
- package/dist/collections/async/channels.js +0 -312
- package/dist/collections/async/channels.js.map +0 -1
- package/dist/collections/behaviors/bounded.d.ts +0 -79
- package/dist/collections/behaviors/bounded.d.ts.map +0 -1
- package/dist/collections/behaviors/bounded.js +0 -384
- package/dist/collections/behaviors/bounded.js.map +0 -1
- package/dist/collections/behaviors/evented.d.ts +0 -154
- package/dist/collections/behaviors/evented.d.ts.map +0 -1
- package/dist/collections/behaviors/evented.js +0 -299
- package/dist/collections/behaviors/evented.js.map +0 -1
- package/dist/collections/behaviors/lru.d.ts +0 -84
- package/dist/collections/behaviors/lru.d.ts.map +0 -1
- package/dist/collections/behaviors/lru.js +0 -330
- package/dist/collections/behaviors/lru.js.map +0 -1
- package/dist/collections/behaviors/readonly.d.ts +0 -73
- package/dist/collections/behaviors/readonly.d.ts.map +0 -1
- package/dist/collections/behaviors/readonly.js +0 -158
- package/dist/collections/behaviors/readonly.js.map +0 -1
- package/dist/collections/behaviors/safe.d.ts +0 -163
- package/dist/collections/behaviors/safe.d.ts.map +0 -1
- package/dist/collections/behaviors/safe.js +0 -172
- package/dist/collections/behaviors/safe.js.map +0 -1
- package/dist/collections/behaviors/synchronized.d.ts +0 -88
- package/dist/collections/behaviors/synchronized.d.ts.map +0 -1
- package/dist/collections/behaviors/synchronized.js +0 -294
- package/dist/collections/behaviors/synchronized.js.map +0 -1
- package/dist/collections/behaviors/ttl.d.ts +0 -118
- package/dist/collections/behaviors/ttl.d.ts.map +0 -1
- package/dist/collections/behaviors/ttl.js +0 -338
- package/dist/collections/behaviors/ttl.js.map +0 -1
- package/dist/collections/core/effects.d.ts +0 -176
- package/dist/collections/core/effects.d.ts.map +0 -1
- package/dist/collections/core/effects.js +0 -180
- package/dist/collections/core/effects.js.map +0 -1
- package/dist/collections/core/events.d.ts +0 -192
- package/dist/collections/core/events.d.ts.map +0 -1
- package/dist/collections/core/events.js +0 -291
- package/dist/collections/core/events.js.map +0 -1
- package/dist/collections/core/middleware.d.ts +0 -231
- package/dist/collections/core/middleware.d.ts.map +0 -1
- package/dist/collections/core/middleware.js +0 -161
- package/dist/collections/core/middleware.js.map +0 -1
- package/dist/collections/core/policies.d.ts +0 -220
- package/dist/collections/core/policies.d.ts.map +0 -1
- package/dist/collections/core/policies.js +0 -48
- package/dist/collections/core/policies.js.map +0 -1
- package/dist/collections/core/traits.d.ts +0 -142
- package/dist/collections/core/traits.d.ts.map +0 -1
- package/dist/collections/core/traits.js +0 -8
- package/dist/collections/core/traits.js.map +0 -1
- package/dist/collections/examples.d.ts +0 -13
- package/dist/collections/examples.d.ts.map +0 -1
- package/dist/collections/examples.js +0 -302
- package/dist/collections/examples.js.map +0 -1
- package/dist/collections/fx/collectors.d.ts +0 -190
- package/dist/collections/fx/collectors.d.ts.map +0 -1
- package/dist/collections/fx/collectors.js +0 -369
- package/dist/collections/fx/collectors.js.map +0 -1
- package/dist/collections/fx/iter.d.ts +0 -166
- package/dist/collections/fx/iter.d.ts.map +0 -1
- package/dist/collections/fx/iter.js +0 -421
- package/dist/collections/fx/iter.js.map +0 -1
- package/dist/collections/impl/array-deque.d.ts +0 -107
- package/dist/collections/impl/array-deque.d.ts.map +0 -1
- package/dist/collections/impl/array-deque.js +0 -381
- package/dist/collections/impl/array-deque.js.map +0 -1
- package/dist/collections/impl/array-list.d.ts +0 -101
- package/dist/collections/impl/array-list.d.ts.map +0 -1
- package/dist/collections/impl/array-list.js +0 -387
- package/dist/collections/impl/array-list.js.map +0 -1
- package/dist/collections/impl/hash-map.d.ts +0 -141
- package/dist/collections/impl/hash-map.d.ts.map +0 -1
- package/dist/collections/impl/hash-map.js +0 -450
- package/dist/collections/impl/hash-map.js.map +0 -1
- package/dist/collections/impl/hash-set.d.ts +0 -125
- package/dist/collections/impl/hash-set.d.ts.map +0 -1
- package/dist/collections/impl/hash-set.js +0 -264
- package/dist/collections/impl/hash-set.js.map +0 -1
- package/dist/collections/impl/linked-hash-map.d.ts +0 -141
- package/dist/collections/impl/linked-hash-map.d.ts.map +0 -1
- package/dist/collections/impl/linked-hash-map.js +0 -472
- package/dist/collections/impl/linked-hash-map.js.map +0 -1
- package/dist/collections/impl/linked-list.d.ts +0 -109
- package/dist/collections/impl/linked-list.d.ts.map +0 -1
- package/dist/collections/impl/linked-list.js +0 -491
- package/dist/collections/impl/linked-list.js.map +0 -1
- package/dist/collections/impl/priority-queue.d.ts +0 -134
- package/dist/collections/impl/priority-queue.d.ts.map +0 -1
- package/dist/collections/impl/priority-queue.js +0 -336
- package/dist/collections/impl/priority-queue.js.map +0 -1
- package/dist/collections/impl/tree-map.d.ts +0 -146
- package/dist/collections/impl/tree-map.d.ts.map +0 -1
- package/dist/collections/impl/tree-map.js +0 -781
- package/dist/collections/impl/tree-map.js.map +0 -1
- package/dist/collections/impl/tree-set.d.ts +0 -112
- package/dist/collections/impl/tree-set.d.ts.map +0 -1
- package/dist/collections/impl/tree-set.js +0 -374
- package/dist/collections/impl/tree-set.js.map +0 -1
- package/dist/collections/index.d.ts +0 -105
- package/dist/collections/index.d.ts.map +0 -1
- package/dist/collections/index.js +0 -135
- package/dist/collections/index.js.map +0 -1
- package/dist/collections/interfaces/collection.d.ts +0 -119
- package/dist/collections/interfaces/collection.d.ts.map +0 -1
- package/dist/collections/interfaces/collection.js +0 -8
- package/dist/collections/interfaces/collection.js.map +0 -1
- package/dist/collections/interfaces/list.d.ts +0 -247
- package/dist/collections/interfaces/list.d.ts.map +0 -1
- package/dist/collections/interfaces/list.js +0 -8
- package/dist/collections/interfaces/list.js.map +0 -1
- package/dist/collections/interfaces/map.d.ts +0 -344
- package/dist/collections/interfaces/map.d.ts.map +0 -1
- package/dist/collections/interfaces/map.js +0 -8
- package/dist/collections/interfaces/map.js.map +0 -1
- package/dist/collections/interfaces/queue.d.ts +0 -304
- package/dist/collections/interfaces/queue.d.ts.map +0 -1
- package/dist/collections/interfaces/queue.js +0 -8
- package/dist/collections/interfaces/queue.js.map +0 -1
- package/dist/collections/interfaces/set.d.ts +0 -137
- package/dist/collections/interfaces/set.d.ts.map +0 -1
- package/dist/collections/interfaces/set.js +0 -8
- package/dist/collections/interfaces/set.js.map +0 -1
- package/dist/collections/storage/api.d.ts +0 -109
- package/dist/collections/storage/api.d.ts.map +0 -1
- package/dist/collections/storage/api.js +0 -182
- package/dist/collections/storage/api.js.map +0 -1
- package/dist/collections/storage/hybrid.d.ts +0 -164
- package/dist/collections/storage/hybrid.d.ts.map +0 -1
- package/dist/collections/storage/hybrid.js +0 -416
- package/dist/collections/storage/hybrid.js.map +0 -1
- package/dist/collections/storage/index.d.ts +0 -16
- package/dist/collections/storage/index.d.ts.map +0 -1
- package/dist/collections/storage/index.js +0 -13
- package/dist/collections/storage/index.js.map +0 -1
- package/dist/collections/storage/interface.d.ts +0 -141
- package/dist/collections/storage/interface.d.ts.map +0 -1
- package/dist/collections/storage/interface.js +0 -23
- package/dist/collections/storage/interface.js.map +0 -1
- package/dist/collections/storage/memory.d.ts +0 -68
- package/dist/collections/storage/memory.d.ts.map +0 -1
- package/dist/collections/storage/memory.js +0 -154
- package/dist/collections/storage/memory.js.map +0 -1
- package/dist/collections/utils/defaults.d.ts +0 -135
- package/dist/collections/utils/defaults.d.ts.map +0 -1
- package/dist/collections/utils/defaults.js +0 -322
- package/dist/collections/utils/defaults.js.map +0 -1
- package/dist/collections/utils/factories.d.ts +0 -144
- package/dist/collections/utils/factories.d.ts.map +0 -1
- package/dist/collections/utils/factories.js +0 -293
- package/dist/collections/utils/factories.js.map +0 -1
- package/dist/collections/utils/helpers.d.ts +0 -137
- package/dist/collections/utils/helpers.d.ts.map +0 -1
- package/dist/collections/utils/helpers.js +0 -221
- package/dist/collections/utils/helpers.js.map +0 -1
- package/dist/collections.d.ts +0 -12
- package/dist/collections.d.ts.map +0 -1
- package/dist/collections.js +0 -10
- package/dist/collections.js.map +0 -1
- package/dist/components/define.d.ts +0 -134
- package/dist/components/define.d.ts.map +0 -1
- package/dist/components/define.js +0 -486
- package/dist/components/define.js.map +0 -1
- package/dist/components/index.d.ts +0 -39
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -38
- package/dist/components/index.js.map +0 -1
- package/dist/components/types.d.ts +0 -264
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -46
- package/dist/components/types.js.map +0 -1
- package/dist/procedures/storage/adapter.d.ts +0 -148
- package/dist/procedures/storage/adapter.d.ts.map +0 -1
- package/dist/procedures/storage/adapter.js +0 -214
- package/dist/procedures/storage/adapter.js.map +0 -1
- package/dist/procedures/storage/api.d.ts +0 -125
- package/dist/procedures/storage/api.d.ts.map +0 -1
- package/dist/procedures/storage/api.js +0 -220
- package/dist/procedures/storage/api.js.map +0 -1
- package/dist/procedures/storage/factory.d.ts +0 -134
- package/dist/procedures/storage/factory.d.ts.map +0 -1
- package/dist/procedures/storage/factory.js +0 -166
- package/dist/procedures/storage/factory.js.map +0 -1
- package/dist/procedures/storage/hybrid.d.ts +0 -193
- package/dist/procedures/storage/hybrid.d.ts.map +0 -1
- package/dist/procedures/storage/hybrid.js +0 -519
- package/dist/procedures/storage/hybrid.js.map +0 -1
- package/dist/procedures/storage/index.d.ts +0 -17
- package/dist/procedures/storage/index.d.ts.map +0 -1
- package/dist/procedures/storage/index.js +0 -17
- package/dist/procedures/storage/index.js.map +0 -1
- package/dist/procedures/storage/procedures.d.ts +0 -39
- package/dist/procedures/storage/procedures.d.ts.map +0 -1
- package/dist/procedures/storage/procedures.js +0 -261
- package/dist/procedures/storage/procedures.js.map +0 -1
- package/dist/procedures/storage/serialization.d.ts +0 -123
- package/dist/procedures/storage/serialization.d.ts.map +0 -1
- package/dist/procedures/storage/serialization.js +0 -216
- package/dist/procedures/storage/serialization.js.map +0 -1
- package/dist/procedures/storage/synced-registry.d.ts +0 -246
- package/dist/procedures/storage/synced-registry.d.ts.map +0 -1
- package/dist/procedures/storage/synced-registry.js +0 -575
- package/dist/procedures/storage/synced-registry.js.map +0 -1
- package/dist/procedures/storage/types.d.ts +0 -130
- package/dist/procedures/storage/types.d.ts.map +0 -1
- package/dist/procedures/storage/types.js +0 -8
- package/dist/procedures/storage/types.js.map +0 -1
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Synced Procedure Registry
|
|
3
|
-
*
|
|
4
|
-
* Wraps ProcedureRegistry with storage synchronization capabilities.
|
|
5
|
-
* Enables procedure persistence and sync across backends.
|
|
6
|
-
*/
|
|
7
|
-
import { ProcedureRegistry } from "../registry.js";
|
|
8
|
-
import { pathToKey } from "../types.js";
|
|
9
|
-
import { ProcedureStorageAdapter } from "./adapter.js";
|
|
10
|
-
import { serializeProcedure, deserializeProcedure, getSerializedKey } from "./serialization.js";
|
|
11
|
-
// =============================================================================
|
|
12
|
-
// The store of a registry
|
|
13
|
-
// =============================================================================
|
|
14
|
-
const STORES = new WeakMap();
|
|
15
|
-
/**
|
|
16
|
-
* The synced registry that wraps a registry, if one does. The `procedure.store`, `load`,
|
|
17
|
-
* `sync` and `remote` procedures use it.
|
|
18
|
-
*
|
|
19
|
-
* @param registry - A procedure registry
|
|
20
|
-
* @returns The synced registry of the newest wrapper that is not closed, or undefined
|
|
21
|
-
*/
|
|
22
|
-
export function getProcedureStore(registry) {
|
|
23
|
-
return STORES.get(registry);
|
|
24
|
-
}
|
|
25
|
-
// =============================================================================
|
|
26
|
-
// Synced Procedure Registry
|
|
27
|
-
// =============================================================================
|
|
28
|
-
/**
|
|
29
|
-
* Procedure registry with storage synchronization.
|
|
30
|
-
*
|
|
31
|
-
* Wraps an existing ProcedureRegistry and adds:
|
|
32
|
-
* - Automatic persistence on register (write-through/write-back)
|
|
33
|
-
* - Sync from storage on demand
|
|
34
|
-
* - Conflict resolution
|
|
35
|
-
* - Connection management for remote storage
|
|
36
|
-
*
|
|
37
|
-
* A pull compares the `storedAt` of each record with the one of the last sync, and a local
|
|
38
|
-
* change counter for each path. A change on one side only is not a conflict: the changed side
|
|
39
|
-
* wins. A change on both sides (or a path with no sync yet) is a conflict, and the
|
|
40
|
-
* `conflictResolution` option decides. A record with no handler never replaces a procedure
|
|
41
|
-
* that has one: the procedure keeps its handler and takes the record's metadata.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const registry = new SyncedProcedureRegistry(
|
|
46
|
-
* PROCEDURE_REGISTRY,
|
|
47
|
-
* storageAdapter,
|
|
48
|
-
* {
|
|
49
|
-
* writeStrategy: 'write-through',
|
|
50
|
-
* conflictResolution: 'remote',
|
|
51
|
-
* }
|
|
52
|
-
* );
|
|
53
|
-
*
|
|
54
|
-
* // Sync from storage on startup
|
|
55
|
-
* await registry.syncFromStorage();
|
|
56
|
-
*
|
|
57
|
-
* // Register with auto-persistence
|
|
58
|
-
* registry.register(myProcedure, { persist: true });
|
|
59
|
-
*
|
|
60
|
-
* // Manual sync
|
|
61
|
-
* const result = await registry.sync('both');
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export class SyncedProcedureRegistry {
|
|
65
|
-
baseRegistry;
|
|
66
|
-
adapter;
|
|
67
|
-
options;
|
|
68
|
-
/** Pending changes for write-back strategy */
|
|
69
|
-
pendingChanges = new Map();
|
|
70
|
-
/** Pending deletes for write-back strategy (deep dive DATA-8: they were never deleted) */
|
|
71
|
-
pendingDeletes = new Map();
|
|
72
|
-
/** The handler reference of each path, for the stored records */
|
|
73
|
-
handlerRefs = new Map();
|
|
74
|
-
/** The `storedAt` of the record of each path at its last push or pull */
|
|
75
|
-
syncedAt = new Map();
|
|
76
|
-
/** A counter of local changes for each path, and its value at the last push or pull */
|
|
77
|
-
localVersion = new Map();
|
|
78
|
-
syncedVersion = new Map();
|
|
79
|
-
/** Write-through stores that have not finished */
|
|
80
|
-
inFlight = new Set();
|
|
81
|
-
/** Whether currently connected to remote storage */
|
|
82
|
-
connected = false;
|
|
83
|
-
/** Remote endpoint (if connected) */
|
|
84
|
-
endpoint;
|
|
85
|
-
/** Last sync timestamp */
|
|
86
|
-
lastSyncTime;
|
|
87
|
-
/** Whether currently syncing */
|
|
88
|
-
syncing = false;
|
|
89
|
-
/** Auto-sync interval handle */
|
|
90
|
-
syncIntervalHandle;
|
|
91
|
-
constructor(baseRegistry, storage, options = {}) {
|
|
92
|
-
this.baseRegistry = baseRegistry;
|
|
93
|
-
this.adapter = new ProcedureStorageAdapter(storage, {
|
|
94
|
-
handlerLoader: options.handlerLoader,
|
|
95
|
-
});
|
|
96
|
-
this.options = {
|
|
97
|
-
writeStrategy: options.writeStrategy ?? "write-through",
|
|
98
|
-
conflictResolution: options.conflictResolution ?? "local",
|
|
99
|
-
syncInterval: options.syncInterval ?? 0,
|
|
100
|
-
handlerLoader: options.handlerLoader,
|
|
101
|
-
syncOnInit: options.syncOnInit ?? false,
|
|
102
|
-
};
|
|
103
|
-
// The storage procedures of this registry find this wrapper
|
|
104
|
-
STORES.set(baseRegistry, this);
|
|
105
|
-
// Set up auto-sync if configured
|
|
106
|
-
if (this.options.syncInterval && this.options.syncInterval > 0) {
|
|
107
|
-
this.startAutoSync(this.options.syncInterval);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// ===========================================================================
|
|
111
|
-
// Registry Methods (delegated to base registry)
|
|
112
|
-
// ===========================================================================
|
|
113
|
-
/**
|
|
114
|
-
* Register a procedure with optional persistence.
|
|
115
|
-
*
|
|
116
|
-
* The record has the path where the procedure is registered: with a `pathPrefix`, the
|
|
117
|
-
* prefixed path. (Before, the record had the path without the prefix: deep dive CORE-8.)
|
|
118
|
-
*
|
|
119
|
-
* @param procedure - Procedure to register
|
|
120
|
-
* @param options - Registration options including persist flag
|
|
121
|
-
*/
|
|
122
|
-
register(procedure, options) {
|
|
123
|
-
// Register in base registry
|
|
124
|
-
this.baseRegistry.register(procedure, options);
|
|
125
|
-
const path = options?.pathPrefix ? [...options.pathPrefix, ...procedure.path] : procedure.path;
|
|
126
|
-
const registered = this.baseRegistry.get(path) ?? { ...procedure, path };
|
|
127
|
-
const key = pathToKey(path);
|
|
128
|
-
if (options?.handlerRef) {
|
|
129
|
-
this.handlerRefs.set(key, options.handlerRef);
|
|
130
|
-
}
|
|
131
|
-
this.touch(key);
|
|
132
|
-
if (options?.persist === false) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
this.pendingDeletes.delete(key);
|
|
136
|
-
if (this.options.writeStrategy === "write-through") {
|
|
137
|
-
// Write-through: persist now. flushWrites() waits for these writes.
|
|
138
|
-
this.track(this.storeRecords([registered]).catch((err) => {
|
|
139
|
-
console.error(`Failed to persist procedure ${key}:`, err);
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
// Write-back: queue for later sync
|
|
144
|
-
this.pendingChanges.set(key, registered);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Unregister a procedure. Its record is deleted from storage: now (write-through), or at the
|
|
149
|
-
* next flush (write-back).
|
|
150
|
-
*
|
|
151
|
-
* @param path - Procedure path
|
|
152
|
-
* @returns True if procedure was removed
|
|
153
|
-
*/
|
|
154
|
-
unregister(path) {
|
|
155
|
-
const result = this.baseRegistry.unregister(path);
|
|
156
|
-
if (result) {
|
|
157
|
-
const key = pathToKey(path);
|
|
158
|
-
this.pendingChanges.delete(key);
|
|
159
|
-
this.touch(key);
|
|
160
|
-
if (this.options.writeStrategy === "write-through") {
|
|
161
|
-
this.track(this.adapter.remove(path).catch((err) => {
|
|
162
|
-
console.error(`Failed to remove procedure ${key} from storage:`, err);
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
this.pendingDeletes.set(key, path);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return result;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Get a procedure by path.
|
|
173
|
-
*/
|
|
174
|
-
get(path) {
|
|
175
|
-
return this.baseRegistry.get(path);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Check if a procedure exists.
|
|
179
|
-
*/
|
|
180
|
-
has(path) {
|
|
181
|
-
return this.baseRegistry.has(path);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Get all registered procedures.
|
|
185
|
-
*/
|
|
186
|
-
getAll() {
|
|
187
|
-
return this.baseRegistry.getAll();
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Get procedures by prefix.
|
|
191
|
-
*/
|
|
192
|
-
getByPrefix(prefix) {
|
|
193
|
-
return this.baseRegistry.getByPrefix(prefix);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Get count of registered procedures.
|
|
197
|
-
*/
|
|
198
|
-
get size() {
|
|
199
|
-
return this.baseRegistry.size;
|
|
200
|
-
}
|
|
201
|
-
// ===========================================================================
|
|
202
|
-
// Sync Operations
|
|
203
|
-
// ===========================================================================
|
|
204
|
-
/**
|
|
205
|
-
* Sync from storage to registry.
|
|
206
|
-
* Loads procedures from storage and merges with registry.
|
|
207
|
-
*
|
|
208
|
-
* @param filter - Pull only the records for which this function gives true (default: all)
|
|
209
|
-
* @returns Sync result with counts and conflicts
|
|
210
|
-
*/
|
|
211
|
-
async syncFromStorage(filter) {
|
|
212
|
-
this.syncing = true;
|
|
213
|
-
const conflicts = [];
|
|
214
|
-
let pulled = 0;
|
|
215
|
-
try {
|
|
216
|
-
const records = (await this.adapter.getAllRaw()).filter((record) => !filter || filter(record));
|
|
217
|
-
for (const record of records) {
|
|
218
|
-
const key = getSerializedKey(record);
|
|
219
|
-
const remote = await deserializeProcedure(record, { handlerLoader: this.options.handlerLoader });
|
|
220
|
-
if (record.handlerRef) {
|
|
221
|
-
this.handlerRefs.set(key, record.handlerRef);
|
|
222
|
-
}
|
|
223
|
-
const existing = this.baseRegistry.get(record.path);
|
|
224
|
-
if (!existing) {
|
|
225
|
-
this.baseRegistry.register(remote, { override: false });
|
|
226
|
-
this.markSynced(key, record);
|
|
227
|
-
pulled++;
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
const known = this.syncedAt.get(key);
|
|
231
|
-
const remoteChanged = known === undefined || (record.storedAt ?? 0) !== known;
|
|
232
|
-
const localChanged = known === undefined || this.isDirty(key);
|
|
233
|
-
if (!remoteChanged) {
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
if (!localChanged) {
|
|
237
|
-
// Only the remote changed: it wins, and it is not a conflict
|
|
238
|
-
this.baseRegistry.register(this.keepHandler(existing, remote), { override: true });
|
|
239
|
-
this.markSynced(key, record);
|
|
240
|
-
pulled++;
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
const conflict = this.resolveConflict(record.path, existing, remote);
|
|
244
|
-
if (conflict) {
|
|
245
|
-
conflicts.push(conflict);
|
|
246
|
-
}
|
|
247
|
-
if (conflict?.resolution !== "local") {
|
|
248
|
-
this.markSynced(key, record);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
// The local version stays, and the next push stores it
|
|
252
|
-
this.syncedAt.set(key, record.storedAt ?? 0);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
this.lastSyncTime = Date.now();
|
|
256
|
-
return {
|
|
257
|
-
pushed: 0,
|
|
258
|
-
pulled,
|
|
259
|
-
conflicts,
|
|
260
|
-
timestamp: this.lastSyncTime,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
finally {
|
|
264
|
-
this.syncing = false;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Sync from registry to storage.
|
|
269
|
-
* Persists all registered procedures to storage, each with its handler reference.
|
|
270
|
-
*
|
|
271
|
-
* @returns Sync result
|
|
272
|
-
*/
|
|
273
|
-
async syncToStorage() {
|
|
274
|
-
this.syncing = true;
|
|
275
|
-
try {
|
|
276
|
-
const procedures = this.baseRegistry.getAll();
|
|
277
|
-
await this.storeRecords(procedures);
|
|
278
|
-
await this.removeRecords([...this.pendingDeletes.values()]);
|
|
279
|
-
// Clear pending changes
|
|
280
|
-
this.pendingChanges.clear();
|
|
281
|
-
this.pendingDeletes.clear();
|
|
282
|
-
this.lastSyncTime = Date.now();
|
|
283
|
-
return {
|
|
284
|
-
pushed: procedures.length,
|
|
285
|
-
pulled: 0,
|
|
286
|
-
conflicts: [],
|
|
287
|
-
timestamp: this.lastSyncTime,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
finally {
|
|
291
|
-
this.syncing = false;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Full bidirectional sync.
|
|
296
|
-
*
|
|
297
|
-
* @param direction - Sync direction (push/pull/both)
|
|
298
|
-
* @returns Sync result
|
|
299
|
-
*/
|
|
300
|
-
async sync(direction = "both") {
|
|
301
|
-
const results = {
|
|
302
|
-
pushed: 0,
|
|
303
|
-
pulled: 0,
|
|
304
|
-
conflicts: [],
|
|
305
|
-
timestamp: Date.now(),
|
|
306
|
-
};
|
|
307
|
-
if (direction === "pull" || direction === "both") {
|
|
308
|
-
const pullResult = await this.syncFromStorage();
|
|
309
|
-
results.pulled = pullResult.pulled;
|
|
310
|
-
results.conflicts.push(...pullResult.conflicts);
|
|
311
|
-
}
|
|
312
|
-
if (direction === "push" || direction === "both") {
|
|
313
|
-
const pushResult = await this.syncToStorage();
|
|
314
|
-
results.pushed = pushResult.pushed;
|
|
315
|
-
}
|
|
316
|
-
this.lastSyncTime = results.timestamp;
|
|
317
|
-
return results;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Flush pending changes to storage: the queued writes and deletes of the write-back strategy.
|
|
321
|
-
*
|
|
322
|
-
* @returns The number of records written or deleted
|
|
323
|
-
*/
|
|
324
|
-
async flushPending() {
|
|
325
|
-
await this.flushWrites();
|
|
326
|
-
const procedures = Array.from(this.pendingChanges.values());
|
|
327
|
-
const deletes = Array.from(this.pendingDeletes.values());
|
|
328
|
-
if (procedures.length === 0 && deletes.length === 0)
|
|
329
|
-
return 0;
|
|
330
|
-
if (procedures.length > 0) {
|
|
331
|
-
await this.storeRecords(procedures);
|
|
332
|
-
}
|
|
333
|
-
await this.removeRecords(deletes);
|
|
334
|
-
this.pendingChanges.clear();
|
|
335
|
-
this.pendingDeletes.clear();
|
|
336
|
-
return procedures.length + deletes.length;
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Store the registered procedure at a path now, whatever the write strategy.
|
|
340
|
-
*
|
|
341
|
-
* @param path - Procedure path
|
|
342
|
-
* @param options - A handler reference for the record
|
|
343
|
-
* @returns The stored record, or undefined when no procedure is registered at the path
|
|
344
|
-
*/
|
|
345
|
-
async storeProcedure(path, options = {}) {
|
|
346
|
-
const procedure = this.baseRegistry.get(path);
|
|
347
|
-
if (!procedure)
|
|
348
|
-
return undefined;
|
|
349
|
-
const key = pathToKey(path);
|
|
350
|
-
if (options.handlerRef) {
|
|
351
|
-
this.handlerRefs.set(key, options.handlerRef);
|
|
352
|
-
}
|
|
353
|
-
await this.storeRecords([procedure]);
|
|
354
|
-
this.pendingChanges.delete(key);
|
|
355
|
-
this.pendingDeletes.delete(key);
|
|
356
|
-
return this.adapter.getRaw(path);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Wait for the write-through writes that have started.
|
|
360
|
-
*/
|
|
361
|
-
async flushWrites() {
|
|
362
|
-
while (this.inFlight.size > 0) {
|
|
363
|
-
await Promise.all([...this.inFlight]);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
// ===========================================================================
|
|
367
|
-
// Connection Management
|
|
368
|
-
// ===========================================================================
|
|
369
|
-
/**
|
|
370
|
-
* Record a remote endpoint, and optionally pull from storage. This method does not change the
|
|
371
|
-
* storage: give the registry an `ApiStorage` for the endpoint when you make it.
|
|
372
|
-
*
|
|
373
|
-
* @param endpoint - Remote endpoint URL
|
|
374
|
-
* @param options - Connection options
|
|
375
|
-
*/
|
|
376
|
-
async connect(endpoint, options) {
|
|
377
|
-
this.endpoint = endpoint;
|
|
378
|
-
this.connected = true;
|
|
379
|
-
if (options?.syncOnConnect ?? this.options.syncOnInit) {
|
|
380
|
-
await this.syncFromStorage();
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Disconnect from remote storage.
|
|
385
|
-
*/
|
|
386
|
-
disconnect() {
|
|
387
|
-
this.connected = false;
|
|
388
|
-
this.endpoint = undefined;
|
|
389
|
-
this.stopAutoSync();
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Get current sync status.
|
|
393
|
-
*/
|
|
394
|
-
getStatus() {
|
|
395
|
-
return {
|
|
396
|
-
connected: this.connected,
|
|
397
|
-
endpoint: this.endpoint,
|
|
398
|
-
lastSync: this.lastSyncTime,
|
|
399
|
-
pendingChanges: this.pendingChanges.size + this.pendingDeletes.size,
|
|
400
|
-
syncing: this.syncing,
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
// ===========================================================================
|
|
404
|
-
// Auto-Sync
|
|
405
|
-
// ===========================================================================
|
|
406
|
-
/**
|
|
407
|
-
* Start auto-sync at specified interval.
|
|
408
|
-
*
|
|
409
|
-
* @param intervalMs - Sync interval in milliseconds
|
|
410
|
-
*/
|
|
411
|
-
startAutoSync(intervalMs) {
|
|
412
|
-
this.stopAutoSync();
|
|
413
|
-
const handle = setInterval(() => {
|
|
414
|
-
void this.sync("both").catch((err) => {
|
|
415
|
-
console.error("Auto-sync failed:", err);
|
|
416
|
-
});
|
|
417
|
-
}, intervalMs);
|
|
418
|
-
// Don't let the auto-sync timer keep the process alive. See BUGS-2026-07.md (M4).
|
|
419
|
-
handle.unref?.();
|
|
420
|
-
this.syncIntervalHandle = handle;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Stop auto-sync.
|
|
424
|
-
*/
|
|
425
|
-
stopAutoSync() {
|
|
426
|
-
if (this.syncIntervalHandle) {
|
|
427
|
-
clearInterval(this.syncIntervalHandle);
|
|
428
|
-
this.syncIntervalHandle = undefined;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
// ===========================================================================
|
|
432
|
-
// Conflict Resolution
|
|
433
|
-
// ===========================================================================
|
|
434
|
-
/**
|
|
435
|
-
* Resolve a conflict between local and remote procedures.
|
|
436
|
-
*
|
|
437
|
-
* @param path - Procedure path
|
|
438
|
-
* @param local - Local procedure
|
|
439
|
-
* @param remote - Remote procedure
|
|
440
|
-
* @returns Conflict info if not automatically resolved
|
|
441
|
-
*/
|
|
442
|
-
resolveConflict(path, local, remote) {
|
|
443
|
-
switch (this.options.conflictResolution) {
|
|
444
|
-
case "local":
|
|
445
|
-
// Keep local, ignore remote
|
|
446
|
-
return {
|
|
447
|
-
path,
|
|
448
|
-
resolution: "local",
|
|
449
|
-
local: serializeProcedure(local),
|
|
450
|
-
remote: serializeProcedure(remote),
|
|
451
|
-
};
|
|
452
|
-
case "remote":
|
|
453
|
-
// Replace with remote, but never replace a handler with a stub (deep dive CORE-8)
|
|
454
|
-
this.baseRegistry.register(this.keepHandler(local, remote), { override: true });
|
|
455
|
-
return {
|
|
456
|
-
path,
|
|
457
|
-
resolution: "remote",
|
|
458
|
-
local: serializeProcedure(local),
|
|
459
|
-
remote: serializeProcedure(remote),
|
|
460
|
-
};
|
|
461
|
-
case "error":
|
|
462
|
-
// Throw error on conflict
|
|
463
|
-
throw new Error(`Sync conflict at ${pathToKey(path)}`);
|
|
464
|
-
case "merge": {
|
|
465
|
-
// Merge metadata, keep local handler
|
|
466
|
-
const merged = {
|
|
467
|
-
...local,
|
|
468
|
-
metadata: { ...remote.metadata, ...local.metadata },
|
|
469
|
-
};
|
|
470
|
-
this.baseRegistry.register(merged, { override: true });
|
|
471
|
-
return {
|
|
472
|
-
path,
|
|
473
|
-
resolution: "merge",
|
|
474
|
-
local: serializeProcedure(local),
|
|
475
|
-
remote: serializeProcedure(remote),
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
default:
|
|
479
|
-
return undefined;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* The remote version of a procedure. When the remote record gives no handler (a stub), the
|
|
484
|
-
* local handler and schemas stay, and the remote metadata applies.
|
|
485
|
-
*/
|
|
486
|
-
keepHandler(local, remote) {
|
|
487
|
-
if (remote.handler || !local.handler) {
|
|
488
|
-
return remote;
|
|
489
|
-
}
|
|
490
|
-
const merged = { ...local, metadata: { ...remote.metadata } };
|
|
491
|
-
if (remote.streaming !== undefined) {
|
|
492
|
-
merged.streaming = remote.streaming;
|
|
493
|
-
}
|
|
494
|
-
return merged;
|
|
495
|
-
}
|
|
496
|
-
// ===========================================================================
|
|
497
|
-
// Change tracking
|
|
498
|
-
// ===========================================================================
|
|
499
|
-
/** Record a local change of a path. */
|
|
500
|
-
touch(key) {
|
|
501
|
-
this.localVersion.set(key, (this.localVersion.get(key) ?? 0) + 1);
|
|
502
|
-
}
|
|
503
|
-
/** True when the path changed locally since its last push or pull. */
|
|
504
|
-
isDirty(key) {
|
|
505
|
-
return (this.localVersion.get(key) ?? 0) !== (this.syncedVersion.get(key) ?? 0);
|
|
506
|
-
}
|
|
507
|
-
/** Record that storage and the registry agree on a path. */
|
|
508
|
-
markSynced(key, record, version = this.localVersion.get(key) ?? 0) {
|
|
509
|
-
this.syncedAt.set(key, record.storedAt ?? 0);
|
|
510
|
-
this.syncedVersion.set(key, version);
|
|
511
|
-
}
|
|
512
|
-
/** Store records for procedures, each with its handler reference, and mark them synced. */
|
|
513
|
-
async storeRecords(procedures) {
|
|
514
|
-
// The local versions at the start: a change during the write stays dirty
|
|
515
|
-
const versions = procedures.map((procedure) => this.localVersion.get(pathToKey(procedure.path)) ?? 0);
|
|
516
|
-
const records = await this.adapter.storeAll(procedures, (procedure) => {
|
|
517
|
-
const handlerRef = this.handlerRefs.get(pathToKey(procedure.path));
|
|
518
|
-
return handlerRef ? { handlerRef } : undefined;
|
|
519
|
-
});
|
|
520
|
-
records.forEach((record, index) => this.markSynced(getSerializedKey(record), record, versions[index]));
|
|
521
|
-
}
|
|
522
|
-
/** Delete records, and forget their sync state. */
|
|
523
|
-
async removeRecords(paths) {
|
|
524
|
-
if (paths.length === 0)
|
|
525
|
-
return;
|
|
526
|
-
await this.adapter.removeAll(paths);
|
|
527
|
-
for (const path of paths) {
|
|
528
|
-
const key = pathToKey(path);
|
|
529
|
-
this.syncedAt.delete(key);
|
|
530
|
-
this.syncedVersion.set(key, this.localVersion.get(key) ?? 0);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
track(write) {
|
|
534
|
-
this.inFlight.add(write);
|
|
535
|
-
void write.finally(() => this.inFlight.delete(write));
|
|
536
|
-
}
|
|
537
|
-
// ===========================================================================
|
|
538
|
-
// Access to Underlying Components
|
|
539
|
-
// ===========================================================================
|
|
540
|
-
/**
|
|
541
|
-
* Get the base registry.
|
|
542
|
-
*/
|
|
543
|
-
getBaseRegistry() {
|
|
544
|
-
return this.baseRegistry;
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Get the storage adapter.
|
|
548
|
-
*/
|
|
549
|
-
getAdapter() {
|
|
550
|
-
return this.adapter;
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* Get the handler loader.
|
|
554
|
-
*/
|
|
555
|
-
getHandlerLoader() {
|
|
556
|
-
return this.options.handlerLoader;
|
|
557
|
-
}
|
|
558
|
-
// ===========================================================================
|
|
559
|
-
// Lifecycle
|
|
560
|
-
// ===========================================================================
|
|
561
|
-
/**
|
|
562
|
-
* Close the synced registry and cleanup resources.
|
|
563
|
-
*/
|
|
564
|
-
async close() {
|
|
565
|
-
this.stopAutoSync();
|
|
566
|
-
// Flush pending changes before closing
|
|
567
|
-
await this.flushPending();
|
|
568
|
-
await this.adapter.close();
|
|
569
|
-
this.connected = false;
|
|
570
|
-
if (STORES.get(this.baseRegistry) === this) {
|
|
571
|
-
STORES.delete(this.baseRegistry);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
//# sourceMappingURL=synced-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"synced-registry.js","sourceRoot":"","sources":["../../../src/procedures/storage/synced-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAWxC,OAAO,EAAE,uBAAuB,EA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