@agentshouse/mdruntime 0.1.0-cf28918c2bf91 → 0.1.0-cf6d5f0a5c9c8
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/AGENTS.md +68 -22
- package/README.md +10 -10
- package/dist/adapter.d.ts +58 -25
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +1 -9
- package/dist/attached-model.d.ts +11 -0
- package/dist/attached-model.d.ts.map +1 -0
- package/dist/attached-model.js +47 -0
- package/dist/bootstrap.d.ts +20 -6
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +89 -35
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +13 -7
- package/dist/client.d.ts +6 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -10
- package/dist/collection.d.ts +6 -11
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +56 -19
- package/dist/connection.d.ts +13 -13
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +643 -542
- package/dist/conversation.d.ts +18 -6
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +179 -78
- package/dist/host.d.ts +8 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +35 -31
- package/dist/identity.d.ts +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +7 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/memory.d.ts +12 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +92 -31
- package/dist/model.d.ts +11 -11
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -3
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +24 -14
- package/dist/paths.d.ts +0 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +0 -16
- package/dist/query.d.ts +8 -3
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +75 -36
- package/dist/reach.d.ts +40 -0
- package/dist/reach.d.ts.map +1 -0
- package/dist/reach.js +270 -0
- package/dist/react.d.ts +39 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +63 -0
- package/dist/read-side.d.ts +4 -0
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +116 -54
- package/dist/refresh.d.ts +12 -1
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +35 -22
- package/dist/replica.d.ts +6 -6
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +41 -36
- package/dist/room-draft.d.ts +3 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +7 -5
- package/dist/rows.d.ts +4 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +82 -39
- package/dist/save.d.ts +1 -2
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +106 -58
- package/dist/store.d.ts +25 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +206 -90
- package/dist/wire.d.ts +52 -16
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +51 -59
- package/package.json +14 -2
package/dist/memory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelResult } from './model.js';
|
|
2
|
-
import { type AcceptedMessage, type ActionResult, type Adapter, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type HeadChange, type
|
|
2
|
+
import { type AcceptedMessage, type ActionResult, type Adapter, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type HeadChange, type ListedConversation, type Member, type ProviderLimit, type Retention, type RoomAttachment, type ServiceMode } from './adapter.js';
|
|
3
3
|
export type MemoryRoom = DiscoveredRoom & {
|
|
4
4
|
model?: ModelResult;
|
|
5
5
|
selectionModel?: ModelResult;
|
|
@@ -11,6 +11,7 @@ export type MemoryRoom = DiscoveredRoom & {
|
|
|
11
11
|
};
|
|
12
12
|
export type MemoryConversation = {
|
|
13
13
|
conversation: string;
|
|
14
|
+
listed?: Omit<ListedConversation, 'conversation'>;
|
|
14
15
|
messages?: readonly AcceptedMessage[];
|
|
15
16
|
outcomes?: Partial<Record<ConversationAction, ActionResult>>;
|
|
16
17
|
};
|
|
@@ -19,20 +20,26 @@ export type MemoryAdapterOptions = {
|
|
|
19
20
|
conversations?: readonly MemoryConversation[];
|
|
20
21
|
historyPageSize?: number;
|
|
21
22
|
pageSize?: number;
|
|
22
|
-
mdModel?: MdModelIdentity;
|
|
23
|
-
supportedVersions?: readonly number[];
|
|
24
23
|
capabilities?: readonly Capability[];
|
|
25
24
|
providerLimits?: readonly ProviderLimit[];
|
|
26
25
|
retention?: Retention;
|
|
26
|
+
member?: Member;
|
|
27
|
+
unopened?: boolean;
|
|
27
28
|
};
|
|
28
29
|
export type MemoryAdapter = Adapter & {
|
|
29
30
|
setRooms(rooms: readonly MemoryRoom[]): void;
|
|
30
31
|
setConversations(conversations: readonly MemoryConversation[]): void;
|
|
31
32
|
script(operation: keyof Adapter, answer: unknown): void;
|
|
32
|
-
|
|
33
|
+
open(): void;
|
|
34
|
+
close(revoked?: boolean): void;
|
|
35
|
+
expire(locators: readonly string[]): void;
|
|
36
|
+
notifyRoomVersion(notification: {
|
|
37
|
+
locator: string;
|
|
38
|
+
roomVersion: string;
|
|
39
|
+
}): void;
|
|
33
40
|
notifyConversation(event: ConversationEvent): void;
|
|
34
41
|
notifyServiceMode(mode: ServiceMode): void;
|
|
35
|
-
|
|
42
|
+
heldRooms(): readonly string[];
|
|
36
43
|
replicatedConversations(): readonly string[];
|
|
37
44
|
};
|
|
38
45
|
export declare function createMemoryAdapter(options?: MemoryAdapterOptions): MemoryAdapter;
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"memory.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 @@
|
|
|
1
|
-
import { ROOM_CONTRACT_VERSION, } from './adapter.js';
|
|
2
|
-
import { MD_MODEL } from './collection.js';
|
|
3
1
|
import { sameChange } from './overlay.js';
|
|
4
2
|
const FIXTURE_RETENTION = {
|
|
5
3
|
history: { kind: 'duration', seconds: 1 },
|
|
@@ -15,6 +13,19 @@ function declaredRetention(value) {
|
|
|
15
13
|
}
|
|
16
14
|
throw new Error('history retention duration must be a finite positive number of seconds');
|
|
17
15
|
}
|
|
16
|
+
const MODEL_ABSENT = { kind: 'model-unavailable', reason: 'not-readable' };
|
|
17
|
+
function modelsOf(room) {
|
|
18
|
+
return {
|
|
19
|
+
collection: room.model ?? MODEL_ABSENT,
|
|
20
|
+
...(room.typedSelection === undefined
|
|
21
|
+
? {}
|
|
22
|
+
: { selection: room.selectionModel ?? MODEL_ABSENT }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function changedModels(room, from) {
|
|
26
|
+
const now = modelsOf(room);
|
|
27
|
+
return JSON.stringify(now) === JSON.stringify(modelsOf(from)) ? undefined : now;
|
|
28
|
+
}
|
|
18
29
|
function named(source, paths) {
|
|
19
30
|
const taken = {};
|
|
20
31
|
for (const path of paths) {
|
|
@@ -31,8 +42,6 @@ async function resolveScript(answer, fallback, request) {
|
|
|
31
42
|
}
|
|
32
43
|
export function createMemoryAdapter(options = {}) {
|
|
33
44
|
let rooms = options.rooms === undefined ? [] : [...options.rooms];
|
|
34
|
-
const mdModel = options.mdModel ?? MD_MODEL;
|
|
35
|
-
const supportedVersions = options.supportedVersions ?? [ROOM_CONTRACT_VERSION];
|
|
36
45
|
const capabilities = options.capabilities ?? [];
|
|
37
46
|
const providerLimits = options.providerLimits ?? [];
|
|
38
47
|
const retention = declaredRetention(options.retention);
|
|
@@ -47,7 +56,8 @@ export function createMemoryAdapter(options = {}) {
|
|
|
47
56
|
const unsealed = new Map();
|
|
48
57
|
const sealed = new Set();
|
|
49
58
|
const historyPageSize = options.historyPageSize;
|
|
50
|
-
let
|
|
59
|
+
let held = [];
|
|
60
|
+
let expiring = [];
|
|
51
61
|
let replicated = [];
|
|
52
62
|
let issued = 0;
|
|
53
63
|
function scriptConversations(entries) {
|
|
@@ -89,29 +99,32 @@ export function createMemoryAdapter(options = {}) {
|
|
|
89
99
|
return {
|
|
90
100
|
name: room.name,
|
|
91
101
|
locator: room.locator,
|
|
102
|
+
handle: room.handle,
|
|
92
103
|
roomVersion: room.roomVersion,
|
|
93
104
|
operations: room.operations,
|
|
94
105
|
replica: room.replica,
|
|
95
|
-
attachedModel: room.attachedModel,
|
|
96
106
|
...(room.typedSelection === undefined ? {} : { typedSelection: room.typedSelection }),
|
|
97
107
|
providerOwnedPaths: room.providerOwnedPaths,
|
|
98
108
|
};
|
|
99
109
|
}
|
|
100
|
-
function page(room,
|
|
110
|
+
function page(room, after) {
|
|
101
111
|
const paths = Object.keys(room.documents ?? {}).sort();
|
|
112
|
+
const opening = after === undefined;
|
|
113
|
+
const from = opening ? 0 : paths.filter((path) => path <= after).length;
|
|
102
114
|
const size = pageSize ?? paths.length;
|
|
103
115
|
const taken = paths.slice(from, from + size);
|
|
104
116
|
const next = from + taken.length;
|
|
105
|
-
const targets =
|
|
117
|
+
const targets = opening ? (room.binaryTargets ?? []) : [];
|
|
106
118
|
return {
|
|
107
119
|
kind: 'bootstrap',
|
|
108
120
|
roomVersion: room.roomVersion,
|
|
121
|
+
...(opening ? { models: modelsOf(room) } : {}),
|
|
109
122
|
documents: named(room.documents ?? {}, taken),
|
|
110
123
|
revisions: named(room.revisions ?? {}, taken),
|
|
111
124
|
changes: named(room.changes ?? {}, [...taken, ...targets]),
|
|
112
125
|
binaryTargets: targets,
|
|
113
|
-
...(
|
|
114
|
-
...(next < paths.length ? { pageToken:
|
|
126
|
+
...(opening && room.attachments !== undefined ? { attachments: room.attachments } : {}),
|
|
127
|
+
...(next < paths.length ? { pageToken: taken.at(-1) } : {}),
|
|
115
128
|
};
|
|
116
129
|
}
|
|
117
130
|
function advancement(room, from, at) {
|
|
@@ -136,9 +149,11 @@ export function createMemoryAdapter(options = {}) {
|
|
|
136
149
|
: [];
|
|
137
150
|
const attachments = room.attachments ?? [];
|
|
138
151
|
const declared = opening && JSON.stringify(attachments) !== JSON.stringify(from.attachments ?? []);
|
|
152
|
+
const models = opening ? changedModels(room, from) : undefined;
|
|
139
153
|
return {
|
|
140
154
|
kind: 'net-advancement',
|
|
141
155
|
roomVersion: room.roomVersion,
|
|
156
|
+
...(models === undefined ? {} : { models }),
|
|
142
157
|
documents: named(current, taken),
|
|
143
158
|
revisions: named(room.revisions ?? {}, taken),
|
|
144
159
|
changes: named(room.changes ?? {}, [...taken, ...targets]),
|
|
@@ -221,15 +236,19 @@ export function createMemoryAdapter(options = {}) {
|
|
|
221
236
|
scripted.delete(named);
|
|
222
237
|
return { kind: 'action', result: { conversation: named } };
|
|
223
238
|
}
|
|
239
|
+
function announceList() {
|
|
240
|
+
const entries = [...scripted.values()].flatMap(({ conversation, listed }) => listed === undefined ? [] : [{ conversation, ...listed }]);
|
|
241
|
+
for (const listener of listeners)
|
|
242
|
+
listener({ kind: 'list', entries });
|
|
243
|
+
}
|
|
224
244
|
function discovery() {
|
|
225
245
|
return {
|
|
226
246
|
kind: 'discovery',
|
|
227
|
-
supportedVersions,
|
|
228
|
-
mdModel,
|
|
229
247
|
rooms: rooms.map(declared),
|
|
230
248
|
capabilities,
|
|
231
249
|
providerLimits,
|
|
232
250
|
retention,
|
|
251
|
+
...(options.member === undefined ? {} : { member: options.member }),
|
|
233
252
|
};
|
|
234
253
|
}
|
|
235
254
|
return {
|
|
@@ -240,9 +259,21 @@ export function createMemoryAdapter(options = {}) {
|
|
|
240
259
|
setConversations(next) {
|
|
241
260
|
scriptConversations(next);
|
|
242
261
|
},
|
|
243
|
-
|
|
262
|
+
open() {
|
|
263
|
+
announceList();
|
|
264
|
+
for (const observer of observers)
|
|
265
|
+
observer({ kind: 'opened' });
|
|
266
|
+
},
|
|
267
|
+
close(revoked = false) {
|
|
268
|
+
for (const observer of observers)
|
|
269
|
+
observer({ kind: 'closed', revoked });
|
|
270
|
+
},
|
|
271
|
+
expire(locators) {
|
|
272
|
+
expiring = [...locators];
|
|
273
|
+
},
|
|
274
|
+
notifyRoomVersion({ locator, roomVersion }) {
|
|
244
275
|
for (const observer of observers)
|
|
245
|
-
observer(
|
|
276
|
+
observer({ kind: 'room-version', locator, roomVersion });
|
|
246
277
|
},
|
|
247
278
|
notifyConversation(event) {
|
|
248
279
|
if (event.kind === 'accepted-message') {
|
|
@@ -256,8 +287,8 @@ export function createMemoryAdapter(options = {}) {
|
|
|
256
287
|
for (const observer of modeObservers)
|
|
257
288
|
observer(mode);
|
|
258
289
|
},
|
|
259
|
-
|
|
260
|
-
return
|
|
290
|
+
heldRooms() {
|
|
291
|
+
return held;
|
|
261
292
|
},
|
|
262
293
|
replicatedConversations() {
|
|
263
294
|
return replicated;
|
|
@@ -281,12 +312,45 @@ export function createMemoryAdapter(options = {}) {
|
|
|
281
312
|
};
|
|
282
313
|
},
|
|
283
314
|
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
315
|
+
roomStream: {
|
|
316
|
+
hold(asked) {
|
|
317
|
+
held = asked.map((room) => room.locator);
|
|
318
|
+
const expired = expiring.filter((locator) => held.includes(locator));
|
|
319
|
+
expiring = [];
|
|
320
|
+
const moved = asked.flatMap((room) => {
|
|
321
|
+
const current = rooms.find((entry) => entry.locator === room.locator);
|
|
322
|
+
return current === undefined ||
|
|
323
|
+
expired.includes(room.locator) ||
|
|
324
|
+
current.roomVersion === room.roomVersion
|
|
325
|
+
? []
|
|
326
|
+
: [{ locator: room.locator, roomVersion: current.roomVersion }];
|
|
327
|
+
});
|
|
328
|
+
queueMicrotask(() => {
|
|
329
|
+
for (const observer of observers) {
|
|
330
|
+
for (const room of moved)
|
|
331
|
+
observer({ kind: 'room-version', ...room });
|
|
332
|
+
observer({ kind: 'opening', expired });
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
reopen() {
|
|
337
|
+
queueMicrotask(() => {
|
|
338
|
+
for (const observer of observers)
|
|
339
|
+
observer({ kind: 'closed', revoked: false });
|
|
340
|
+
});
|
|
287
341
|
},
|
|
288
342
|
observe(notify) {
|
|
289
343
|
observers.add(notify);
|
|
344
|
+
queueMicrotask(() => {
|
|
345
|
+
if (!observers.has(notify))
|
|
346
|
+
return;
|
|
347
|
+
if (options.unopened === true) {
|
|
348
|
+
notify({ kind: 'closed', revoked: false });
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
announceList();
|
|
352
|
+
notify({ kind: 'opened' });
|
|
353
|
+
});
|
|
290
354
|
return () => {
|
|
291
355
|
observers.delete(notify);
|
|
292
356
|
};
|
|
@@ -298,13 +362,6 @@ export function createMemoryAdapter(options = {}) {
|
|
|
298
362
|
else
|
|
299
363
|
scripts[operation] = answer;
|
|
300
364
|
},
|
|
301
|
-
async model(_authorization, request) {
|
|
302
|
-
return resolveScript(scripts.model, () => {
|
|
303
|
-
const room = rooms.find((entry) => entry.locator === request.locator);
|
|
304
|
-
const answer = request.attached === 'collection' ? room?.model : room?.selectionModel;
|
|
305
|
-
return answer ?? { kind: 'model-unavailable', reason: 'not-readable' };
|
|
306
|
-
}, request);
|
|
307
|
-
},
|
|
308
365
|
async authorize() {
|
|
309
366
|
return resolveScript(scripts.authorize, () => ({}), undefined);
|
|
310
367
|
},
|
|
@@ -317,13 +374,21 @@ export function createMemoryAdapter(options = {}) {
|
|
|
317
374
|
});
|
|
318
375
|
},
|
|
319
376
|
reached,
|
|
377
|
+
follows(locator, roomVersion, next) {
|
|
378
|
+
const scripted = scripts.follows;
|
|
379
|
+
if (typeof scripted === 'boolean')
|
|
380
|
+
return scripted;
|
|
381
|
+
if (scripted !== undefined)
|
|
382
|
+
return scripted(locator, roomVersion, next);
|
|
383
|
+
return true;
|
|
384
|
+
},
|
|
320
385
|
async bootstrap(_authorization, request) {
|
|
321
386
|
return resolveScript(scripts.bootstrap, () => {
|
|
322
387
|
const room = rooms.find((entry) => entry.locator === request.locator);
|
|
323
388
|
if (room === undefined) {
|
|
324
389
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
325
390
|
}
|
|
326
|
-
return page(room, request.pageToken
|
|
391
|
+
return page(room, request.pageToken);
|
|
327
392
|
}, request).then((answer) => note(request.locator, answer));
|
|
328
393
|
},
|
|
329
394
|
async refresh(_authorization, request) {
|
|
@@ -341,10 +406,6 @@ export function createMemoryAdapter(options = {}) {
|
|
|
341
406
|
}
|
|
342
407
|
return advancement(continuation.room, continuation.from, continuation.at);
|
|
343
408
|
}
|
|
344
|
-
if (request.minPosition !== undefined &&
|
|
345
|
-
!reached(room.locator, room.roomVersion, request.minPosition)) {
|
|
346
|
-
return { kind: 'retryable-refusal', code: 'replica_behind', fields: {} };
|
|
347
|
-
}
|
|
348
409
|
if (request.fromRoomVersion === room.roomVersion) {
|
|
349
410
|
return { kind: 'still-current' };
|
|
350
411
|
}
|
package/dist/model.d.ts
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import type { Definition,
|
|
1
|
+
import type { Definition, ValueFacts, VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
2
|
export type ModelIdentity = {
|
|
3
3
|
identity: string;
|
|
4
4
|
version: string;
|
|
5
5
|
};
|
|
6
6
|
export type ModelSnapshot = ModelIdentity & {
|
|
7
7
|
schema: string | null;
|
|
8
|
+
revision: string | null;
|
|
8
9
|
};
|
|
9
|
-
export type ModelUnavailableReason = 'not-readable' | 'revoked' | 'not-acquired' | '
|
|
10
|
+
export type ModelUnavailableReason = 'not-readable' | 'revoked' | 'not-acquired' | 'invalid';
|
|
10
11
|
export type ModelResult = {
|
|
11
12
|
kind: 'model';
|
|
12
13
|
snapshot: ModelSnapshot;
|
|
13
14
|
} | {
|
|
14
15
|
kind: 'model-unavailable';
|
|
15
16
|
reason: ModelUnavailableReason;
|
|
16
|
-
} | {
|
|
17
|
-
kind: 'transport-uncertainty';
|
|
18
|
-
} | {
|
|
19
|
-
kind: 'revoked-authorization';
|
|
20
|
-
};
|
|
21
|
-
export type MdType = {
|
|
22
|
-
name: string;
|
|
23
|
-
fields: Readonly<Record<string, FieldSpec>>;
|
|
24
|
-
sections: Readonly<Record<string, SectionSpec>>;
|
|
25
17
|
};
|
|
18
|
+
export type MdType = Definition;
|
|
26
19
|
export type ModelState = {
|
|
27
20
|
status: 'unavailable';
|
|
28
21
|
reason: ModelUnavailableReason;
|
|
22
|
+
schema?: string | null;
|
|
23
|
+
revision?: string | null;
|
|
29
24
|
} | {
|
|
30
25
|
status: 'current' | 'cached';
|
|
31
26
|
snapshot: ModelSnapshot;
|
|
@@ -35,12 +30,16 @@ export type ModelState = {
|
|
|
35
30
|
export type TypesResult = {
|
|
36
31
|
status: 'unavailable';
|
|
37
32
|
reason: ModelUnavailableReason;
|
|
33
|
+
schema?: string | null;
|
|
34
|
+
revision?: string | null;
|
|
38
35
|
} | {
|
|
39
36
|
status: 'current' | 'cached';
|
|
40
37
|
identity: string;
|
|
41
38
|
version: string;
|
|
42
39
|
verifiedWith: ModelIdentity;
|
|
43
40
|
types: readonly MdType[];
|
|
41
|
+
schema: string | null;
|
|
42
|
+
revision: string | null;
|
|
44
43
|
};
|
|
45
44
|
export type ValidationReceipt = {
|
|
46
45
|
identity: string;
|
|
@@ -52,4 +51,5 @@ export declare function definitionOf(state: ModelState, type: string | undefined
|
|
|
52
51
|
export declare function modelTypes(state: ModelState): TypesResult;
|
|
53
52
|
export declare function cached(state: ModelState): ModelState;
|
|
54
53
|
export declare function sameModel(left: ModelIdentity, right: ModelIdentity): boolean;
|
|
54
|
+
export declare function referenceField(facts: ValueFacts | undefined): boolean;
|
|
55
55
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EA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AC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GACD;IACE,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,aAAa,CAAC;IAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AACN,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAC;AACpG,eAAO,MAAM,QAAQ,EAAE,UAA8D,CAAC;AACtF,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAGhG;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAgBzD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEpD;AACD,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAE5E;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAErE"}
|
package/dist/model.js
CHANGED
|
@@ -12,9 +12,9 @@ export function modelTypes(state) {
|
|
|
12
12
|
identity: state.snapshot.identity,
|
|
13
13
|
version: state.snapshot.version,
|
|
14
14
|
verifiedWith: { ...state.verifiedWith },
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
schema: state.snapshot.schema,
|
|
16
|
+
revision: state.snapshot.revision,
|
|
17
|
+
types: structuredClone(Object.values(state.types).sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export function cached(state) {
|
|
@@ -23,3 +23,6 @@ export function cached(state) {
|
|
|
23
23
|
export function sameModel(left, right) {
|
|
24
24
|
return left.identity === right.identity && left.version === right.version;
|
|
25
25
|
}
|
|
26
|
+
export function referenceField(facts) {
|
|
27
|
+
return facts?.reference !== undefined || facts?.items?.reference !== undefined;
|
|
28
|
+
}
|
package/dist/observation.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export type Observed = {
|
|
|
20
20
|
end(): void;
|
|
21
21
|
};
|
|
22
22
|
export declare function rowsOf(result: QueryResult): readonly (QueryDocument | QueryGroup)[];
|
|
23
|
+
export declare function applied(keyed: KeyedResult, change: QueryChange): KeyedResult;
|
|
23
24
|
export declare function observed(first: unknown, stop: () => void, keyed: boolean): Observed;
|
|
24
25
|
export declare function opened(watch: (deliver: (message: unknown) => void) => () => void, keyed: boolean): Promise<Observation<unknown>>;
|
|
26
|
+
export declare function observing<Topic extends string>(watch: (topic: Topic, input: readonly unknown[], deliver: (message: unknown) => void) => () => void): (topic: Topic, ...input: unknown[]) => Promise<Observation<unknown>>;
|
|
25
27
|
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../src/observation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,OAAO,IAAI,CAAC,CAAC;IACb,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACpD,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,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;IACpE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,GAAG,IAAI,IAAI,CAAC;CACb,CAAC;AAEF,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,aAAa,GAAG,UAAU,CAAC,EAAE,CAEnF;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,WAAW,CAc5E;AAiBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,CAkCnF;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,EAC1D,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAiB/B;AAED,wBAAgB,SAAS,CAAC,KAAK,SAAS,MAAM,EAC5C,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAChC,MAAM,IAAI,WAEA,KAAK,YAAY,OAAO,EAAE,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAQ1E"}
|
package/dist/observation.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
export function rowsOf(result) {
|
|
2
2
|
return 'groups' in result ? result.groups : result.documents;
|
|
3
3
|
}
|
|
4
|
+
export function applied(keyed, change) {
|
|
5
|
+
const rows = rowsOf(keyed.result);
|
|
6
|
+
const byKey = new Map(keyed.keys.map((key, index) => [key, rows[index]]));
|
|
7
|
+
for (const key of change.removed)
|
|
8
|
+
byKey.delete(key);
|
|
9
|
+
for (const [key, row] of change.changed)
|
|
10
|
+
byKey.set(key, row);
|
|
11
|
+
const keys = change.order ?? keyed.keys.filter((key) => byKey.has(key));
|
|
12
|
+
const next = keys.map((key) => byKey.get(key));
|
|
13
|
+
return {
|
|
14
|
+
result: 'groups' in keyed.result
|
|
15
|
+
? { groups: next }
|
|
16
|
+
: { documents: next },
|
|
17
|
+
keys,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
4
20
|
function keyedResult(first) {
|
|
5
|
-
|
|
6
|
-
const rows = rowsOf(first.result);
|
|
7
|
-
const byKey = new Map(first.keys.map((key, index) => [key, rows[index]]));
|
|
8
|
-
let keys = first.keys;
|
|
21
|
+
let keyed = first;
|
|
9
22
|
return {
|
|
10
23
|
value: first.result,
|
|
11
24
|
next(message) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
byKey.delete(key);
|
|
15
|
-
for (const [key, row] of change.changed)
|
|
16
|
-
byKey.set(key, row);
|
|
17
|
-
keys = change.order ?? keys.filter((key) => byKey.has(key));
|
|
18
|
-
const next = keys.map((key) => byKey.get(key));
|
|
19
|
-
return grouped
|
|
20
|
-
? { groups: next }
|
|
21
|
-
: { documents: next };
|
|
25
|
+
keyed = applied(keyed, message);
|
|
26
|
+
return keyed.result;
|
|
22
27
|
},
|
|
23
28
|
};
|
|
24
29
|
}
|
|
@@ -83,3 +88,8 @@ export function opened(watch, keyed) {
|
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
}
|
|
91
|
+
export function observing(watch) {
|
|
92
|
+
return (topic, ...input) => opened((deliver) => watch(topic, input, (message) => {
|
|
93
|
+
deliver(structuredClone(message));
|
|
94
|
+
}), topic === 'query');
|
|
95
|
+
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare function normalize(path: string): string | null;
|
|
2
|
-
export declare function relative(from: string, target: string): string;
|
|
3
2
|
export declare function beneath(prefix: string, path: string): boolean;
|
|
4
3
|
export declare function covered(prefixes: readonly string[], path: string): boolean;
|
|
5
4
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E"}
|
package/dist/paths.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function dirname(path) {
|
|
2
|
-
const index = path.lastIndexOf('/');
|
|
3
|
-
return index === -1 ? '' : path.slice(0, index);
|
|
4
|
-
}
|
|
5
1
|
export function normalize(path) {
|
|
6
2
|
const parts = [];
|
|
7
3
|
for (const part of path.split('/')) {
|
|
@@ -17,18 +13,6 @@ export function normalize(path) {
|
|
|
17
13
|
}
|
|
18
14
|
return parts.join('/');
|
|
19
15
|
}
|
|
20
|
-
export function relative(from, target) {
|
|
21
|
-
const base = dirname(from)
|
|
22
|
-
.split('/')
|
|
23
|
-
.filter((part) => part !== '');
|
|
24
|
-
const parts = target.split('/');
|
|
25
|
-
let shared = 0;
|
|
26
|
-
while (shared < base.length && shared + 1 < parts.length && base[shared] === parts[shared]) {
|
|
27
|
-
shared += 1;
|
|
28
|
-
}
|
|
29
|
-
const up = Array.from({ length: base.length - shared }, () => '..');
|
|
30
|
-
return [...up, ...parts.slice(shared)].join('/');
|
|
31
|
-
}
|
|
32
16
|
export function beneath(prefix, path) {
|
|
33
17
|
return path === prefix || path.startsWith(`${prefix}/`);
|
|
34
18
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Definition } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { HeadChange } from './adapter.js';
|
|
3
3
|
export type Value = string | number | boolean | null;
|
|
4
4
|
export type Predicate = Value | {
|
|
@@ -186,8 +186,13 @@ export type GroupShape = {
|
|
|
186
186
|
direction: Direction;
|
|
187
187
|
}[];
|
|
188
188
|
};
|
|
189
|
+
export type PlanReach = {
|
|
190
|
+
rooms: readonly string[];
|
|
191
|
+
documents: readonly string[];
|
|
192
|
+
};
|
|
189
193
|
export type Plan = {
|
|
190
194
|
rooms: readonly string[] | null;
|
|
195
|
+
reach: PlanReach | null;
|
|
191
196
|
root: Scope;
|
|
192
197
|
hop: (Scope & {
|
|
193
198
|
field: string;
|
|
@@ -205,9 +210,9 @@ type Entries = Readonly<Record<string, unknown>>;
|
|
|
205
210
|
export declare function invalid(at: string, problem: string): never;
|
|
206
211
|
export declare function plain(value: unknown): value is Entries;
|
|
207
212
|
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
208
|
-
export declare function planOf(input: unknown, facts: HeldRooms): Plan;
|
|
213
|
+
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
209
214
|
export declare function limitOf(input: unknown): number | null;
|
|
210
|
-
export declare function filterOf(input: unknown, facts: HeldRooms): Plan;
|
|
215
|
+
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
211
216
|
export declare function identityOf(plan: Plan): string;
|
|
212
217
|
export {};
|
|
213
218
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,KAAK,GACL;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzB,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACvB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,KAAK,EAAE,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,UAAU,CAAC,EA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