@agentshouse/mdruntime 0.1.0-c89b819f8a6bf → 0.1.0-c8a9c5beaa50b
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/README.md +1 -1
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +30 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +25 -5
- package/dist/adapter.d.ts +67 -17
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +2 -2
- package/dist/{binary.d.ts → attachment.d.ts} +4 -4
- package/dist/attachment.d.ts.map +1 -0
- package/dist/{binary.js → attachment.js} +2 -2
- package/dist/authored.d.ts.map +1 -1
- package/dist/authored.js +2 -0
- package/dist/chain.d.ts +1 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +5 -2
- package/dist/change.d.ts +2 -2
- package/dist/client.d.ts +13 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -11
- package/dist/collection.d.ts +1 -0
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +7 -1
- package/dist/compile.d.ts +2 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +71 -39
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +2 -0
- package/dist/conversation-live.d.ts +1 -0
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +2 -1
- package/dist/conversation-row.d.ts +12 -0
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +10 -0
- package/dist/conversation.d.ts +12 -5
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +37 -30
- package/dist/declaration.js +2 -2
- package/dist/download.d.ts +2 -2
- package/dist/download.d.ts.map +1 -1
- package/dist/entry.d.ts +13 -3
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +72 -24
- package/dist/figures.d.ts +1 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +2 -2
- package/dist/host.d.ts +1 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +27 -16
- package/dist/house-query.d.ts +8 -2
- package/dist/house-query.d.ts.map +1 -1
- package/dist/house-query.js +53 -5
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +2 -0
- package/dist/live.d.ts +14 -0
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +29 -12
- package/dist/loaded.d.ts +5 -3
- package/dist/loaded.d.ts.map +1 -1
- package/dist/loaded.js +12 -6
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +19 -6
- package/dist/memory.d.ts +2 -2
- package/dist/memory.js +9 -9
- package/dist/messages.d.ts +5 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +14 -3
- package/dist/model.d.ts +6 -5
- package/dist/model.d.ts.map +1 -1
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/opened.d.ts +5 -5
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +2 -2
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +2 -0
- package/dist/outcome.d.ts +16 -16
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +5 -5
- package/dist/overlay.d.ts +19 -8
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +108 -37
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +56 -13
- package/dist/query.d.ts +2 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +29 -13
- package/dist/react.d.ts +6 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +4 -1
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +15 -4
- package/dist/reference-forms.d.ts +4 -0
- package/dist/reference-forms.d.ts.map +1 -0
- package/dist/reference-forms.js +74 -0
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +4 -4
- package/dist/replica.d.ts +3 -8
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +3 -3
- package/dist/room-draft.d.ts +1 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +4 -4
- package/dist/room-drafts.js +2 -2
- package/dist/room-list.d.ts.map +1 -1
- package/dist/room-list.js +2 -0
- package/dist/rows.d.ts +9 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +18 -4
- package/dist/run-tables.d.ts +25 -0
- package/dist/run-tables.d.ts.map +1 -0
- package/dist/run-tables.js +94 -0
- package/dist/runs.d.ts +27 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +90 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +6 -6
- package/dist/saves.d.ts +5 -5
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +51 -45
- package/dist/selector.d.ts +3 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +22 -0
- package/dist/socket.d.ts +3 -1
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +7 -0
- package/dist/source.d.ts +13 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +23 -0
- package/dist/store/records.d.ts +12 -5
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +10 -4
- package/dist/store.d.ts +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/stored.d.ts +9 -2
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +33 -11
- package/dist/surface.d.ts +9 -3
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +5 -2
- package/dist/sync.js +1 -1
- package/dist/tables.d.ts +27 -2
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +25 -3
- package/dist/tallies.js +2 -2
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +49 -3
- package/dist/wire.d.ts +7 -6
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +7 -6
- package/package.json +4 -4
- package/dist/binary.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAEV,gBAAgB,EAEhB,iBAAiB,EAEjB,mBAAmB,EACnB,WAAW,EAEX,cAAc,EACd,aAAa,EAEd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAEV,gBAAgB,EAEhB,iBAAiB,EAEjB,mBAAmB,EACnB,WAAW,EAEX,cAAc,EACd,aAAa,EAEd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAKL,KAAK,iBAAiB,EAEvB,M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AAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,KAAK,IAAI,GAChD,MAAM,IAAI,CAIZ;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAEnF;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAgCjG"}
|
package/dist/conversation.js
CHANGED
|
@@ -329,10 +329,12 @@ async function entries(alive) {
|
|
|
329
329
|
agent: { identity: agent.id, name: agent.name, retired: agent.retired_at !== null },
|
|
330
330
|
name: entry.name,
|
|
331
331
|
created: entry.created,
|
|
332
|
-
finished: entry.finished,
|
|
333
332
|
outcome: entry.outcome,
|
|
334
333
|
waiting: entry.waiting,
|
|
335
334
|
subject: entry.subject,
|
|
335
|
+
room: entry.room,
|
|
336
|
+
model: entry.model,
|
|
337
|
+
effort: entry.effort,
|
|
336
338
|
...rowOf(alive, entry.conversation),
|
|
337
339
|
...heldFacts(rows.get(entry.conversation), entry),
|
|
338
340
|
jobs: standing(alive.liveOf(entry.conversation), rows.get(entry.conversation)?.saved ?? null, entry.processEnded)?.running ?? [],
|
|
@@ -358,35 +360,39 @@ function upserted(kept, set, key) {
|
|
|
358
360
|
held.set(key(one), { ...one });
|
|
359
361
|
return held;
|
|
360
362
|
}
|
|
363
|
+
async function listStored(alive, local, change) {
|
|
364
|
+
const { conversationList, agentList, conversationCursor, readUntil } = await local.facts();
|
|
365
|
+
if (readUntil === null)
|
|
366
|
+
await local.fact('readUntil', new Date().toISOString());
|
|
367
|
+
const held = upserted(change.replacing ? [] : (conversationList ?? []), change.set, (entry) => entry.conversation);
|
|
368
|
+
for (const entry of change.set)
|
|
369
|
+
alive.created(entry.conversation);
|
|
370
|
+
if (change.gone !== null)
|
|
371
|
+
held.delete(change.gone);
|
|
372
|
+
const list = [...held.values()];
|
|
373
|
+
const agents = [
|
|
374
|
+
...upserted(change.replacing ? [] : (agentList ?? []), change.agents, (agent) => agent.id).values(),
|
|
375
|
+
];
|
|
376
|
+
if (JSON.stringify(list) !== JSON.stringify(conversationList)) {
|
|
377
|
+
await local.fact('conversationList', list);
|
|
378
|
+
}
|
|
379
|
+
if (JSON.stringify(agents) !== JSON.stringify(agentList)) {
|
|
380
|
+
await local.fact('agentList', agents);
|
|
381
|
+
}
|
|
382
|
+
if (change.cursor !== undefined && !alive.held.now().listRefused) {
|
|
383
|
+
if (change.cursor !== conversationCursor) {
|
|
384
|
+
await local.fact('conversationCursor', change.cursor);
|
|
385
|
+
}
|
|
386
|
+
alive.deps.stream()?.hold(change.cursor);
|
|
387
|
+
}
|
|
388
|
+
return { conversations: list, agents };
|
|
389
|
+
}
|
|
361
390
|
function listChanged(alive, change) {
|
|
362
391
|
void alive.deps
|
|
363
|
-
.durably(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
const held = upserted(change.replacing ? [] : (conversationList ?? []), change.set, (entry) => entry.conversation);
|
|
368
|
-
for (const entry of change.set)
|
|
369
|
-
alive.created(entry.conversation);
|
|
370
|
-
if (change.gone !== null)
|
|
371
|
-
held.delete(change.gone);
|
|
372
|
-
const list = [...held.values()];
|
|
373
|
-
const agents = [
|
|
374
|
-
...upserted(change.replacing ? [] : (agentList ?? []), change.agents, (agent) => agent.id).values(),
|
|
375
|
-
];
|
|
376
|
-
if (JSON.stringify(list) !== JSON.stringify(conversationList)) {
|
|
377
|
-
await local.fact('conversationList', list);
|
|
378
|
-
}
|
|
379
|
-
if (JSON.stringify(agents) !== JSON.stringify(agentList)) {
|
|
380
|
-
await local.fact('agentList', agents);
|
|
381
|
-
}
|
|
382
|
-
if (change.cursor !== undefined) {
|
|
383
|
-
if (change.cursor !== conversationCursor) {
|
|
384
|
-
await local.fact('conversationCursor', change.cursor);
|
|
385
|
-
}
|
|
386
|
-
alive.deps.stream()?.hold(change.cursor);
|
|
387
|
-
}
|
|
388
|
-
return { conversations: list, agents };
|
|
389
|
-
})
|
|
392
|
+
.durably((local) => listStored(alive, local, change).catch((error) => {
|
|
393
|
+
alive.held.set({ listRefused: true });
|
|
394
|
+
throw error;
|
|
395
|
+
}))
|
|
390
396
|
.catch(async () => {
|
|
391
397
|
const { conversationList, agentList } = await (await alive.deps.local()).facts();
|
|
392
398
|
return { conversations: conversationList ?? [], agents: agentList ?? [] };
|
|
@@ -496,6 +502,7 @@ function agentsOf(listing) {
|
|
|
496
502
|
cli: agent.cli,
|
|
497
503
|
model: agent.model,
|
|
498
504
|
effort: agent.effort,
|
|
505
|
+
model_fixed: agent.model_fixed,
|
|
499
506
|
environment: {
|
|
500
507
|
identity: agent.environment,
|
|
501
508
|
name: agent.environment_name,
|
|
@@ -1034,8 +1041,8 @@ export function conversationSurface(alive, files) {
|
|
|
1034
1041
|
rename(conversation, name, operation) {
|
|
1035
1042
|
return invoke(alive, 'conversations/rename', conversation, operation, { name });
|
|
1036
1043
|
},
|
|
1037
|
-
|
|
1038
|
-
return invoke(alive, 'conversations/
|
|
1044
|
+
set(conversation, settings, operation) {
|
|
1045
|
+
return invoke(alive, 'conversations/set', conversation, operation, settings);
|
|
1039
1046
|
},
|
|
1040
1047
|
retry(conversation, message, operation) {
|
|
1041
1048
|
return invoke(alive, 'conversations/retry', conversation, operation, {
|
package/dist/declaration.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { equalValue } from '@agentshouse/mdmodel';
|
|
2
|
-
import {
|
|
2
|
+
import { documentAt, covered, normalize } from './paths.js';
|
|
3
3
|
export function declared({ locator: _locator, roomVersion: _roomVersion, ...declaration }) {
|
|
4
4
|
return declaration;
|
|
5
5
|
}
|
|
@@ -11,7 +11,7 @@ export function writeRule({ operations, providerOwnedPaths, authoredPaths, }, pa
|
|
|
11
11
|
const normalized = normalize(path.normalize('NFC'));
|
|
12
12
|
if (normalized === null || normalized === '')
|
|
13
13
|
return { code: 'room-root', path };
|
|
14
|
-
if (covered(providerOwnedPaths, normalized) || !
|
|
14
|
+
if (covered(providerOwnedPaths, normalized) || !documentAt(authoredPaths, normalized)) {
|
|
15
15
|
return { code: 'provider-owned-path', path: normalized };
|
|
16
16
|
}
|
|
17
17
|
if (!pathRule(normalized))
|
package/dist/download.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AttachmentLinkAnswer, DownloadAnswer } from './outcome.js';
|
|
3
3
|
export declare function handedCopy(copy: Blob, name: string): DownloadAnswer;
|
|
4
|
-
export declare function handedLink(path: string, link: () => Promise<
|
|
4
|
+
export declare function handedLink(path: string, link: () => Promise<AttachmentLinkAnswer>): Promise<DownloadAnswer>;
|
|
5
5
|
export declare function downloadAttachment(client: MdRuntimeClient, link: string): Promise<DownloadAnswer>;
|
|
6
6
|
//# sourceMappingURL=download.d.ts.map
|
package/dist/download.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAuBzE,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAKnE;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAAC,cAAc,CAAC,CAazB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAEjG"}
|
package/dist/entry.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { type VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Attachment, HeadChange } from './adapter.js';
|
|
3
|
+
import type { ChangeBatch } from './change.js';
|
|
4
|
+
import { type Written } from './overlay.js';
|
|
3
5
|
import { type QueryRows } from './query.js';
|
|
4
6
|
import { type ValuedEntry } from './stored.js';
|
|
5
7
|
import type { Connection } from './tables.js';
|
|
6
8
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
7
9
|
export { documentKey, pathOfKey } from './rows.js';
|
|
8
10
|
export type { ValuedEntry } from './stored.js';
|
|
11
|
+
export type EntryArea = {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly open: readonly string[];
|
|
14
|
+
};
|
|
9
15
|
export type EntryRoom = {
|
|
10
16
|
locator: string;
|
|
17
|
+
handle?: string;
|
|
18
|
+
readable?: readonly string[];
|
|
19
|
+
areas?: readonly EntryArea[];
|
|
11
20
|
schema: string | null;
|
|
12
21
|
documents: Readonly<Record<string, string>>;
|
|
13
22
|
revisions?: Readonly<Record<string, string>>;
|
|
14
23
|
fileIds?: Readonly<Record<string, string>>;
|
|
15
24
|
created?: Readonly<Record<string, string>>;
|
|
16
25
|
changes?: Readonly<Record<string, HeadChange>>;
|
|
17
|
-
|
|
26
|
+
attachments?: Readonly<Record<string, Attachment>>;
|
|
18
27
|
};
|
|
19
28
|
export type EntryArguments = Readonly<Record<string, string>>;
|
|
20
29
|
export type EntryParameterKind = 'string' | 'integer' | 'number' | 'boolean';
|
|
@@ -29,6 +38,7 @@ export type CountedRoom = {
|
|
|
29
38
|
schema: string | null;
|
|
30
39
|
documents: readonly ValuedEntry[];
|
|
31
40
|
};
|
|
32
|
-
export declare function
|
|
41
|
+
export declare function writtenIn(room: EntryRoom, roomTypes: VerifiedModel, batch: ChangeBatch): Written;
|
|
42
|
+
export declare function entryScope(rooms: readonly EntryRoom[], roomTypes: VerifiedModel, connection: Connection, followed?: readonly EntryRoom[]): EntryScope;
|
|
33
43
|
export declare function countScope(room: CountedRoom, roomTypes: VerifiedModel, connection: Connection): EntryScope;
|
|
34
44
|
//# sourceMappingURL=entry.d.ts.map
|
package/dist/entry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,S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MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACzF,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,SAAS,WAAW,EAAE,CAAC;CACnC,CAAC;AAgCF,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAiBhG;AAqHD,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,GAAE,SAAS,SAAS,EAAO,GAClC,UAAU,CAOZ;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAaZ"}
|
package/dist/entry.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { invalid, plain, QueryError, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { attachedModel } from './attached-model.js';
|
|
3
|
+
import { writtenDocuments } from './overlay.js';
|
|
3
4
|
import { answerQuery } from './compile.js';
|
|
4
5
|
import { planWithin } from './query.js';
|
|
5
|
-
import { writtenFacts } from './rows.js';
|
|
6
|
+
import { documentKey, writtenFacts } from './rows.js';
|
|
6
7
|
import { entered, enteredValues, REPLICA_TABLES, } from './stored.js';
|
|
7
8
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
8
9
|
export { documentKey, pathOfKey } from './rows.js';
|
|
@@ -101,8 +102,8 @@ function sampled(template, key) {
|
|
|
101
102
|
}
|
|
102
103
|
return template;
|
|
103
104
|
}
|
|
104
|
-
function entryPlan(query, facts) {
|
|
105
|
-
const plan = planWithin(query, facts);
|
|
105
|
+
function entryPlan(query, facts, reach = null) {
|
|
106
|
+
const plan = planWithin(query, facts, reach);
|
|
106
107
|
if (plan.fileIds !== null)
|
|
107
108
|
invalid('fileIds', 'an entry Room holds no file IDs');
|
|
108
109
|
return plan;
|
|
@@ -118,38 +119,82 @@ export function entryRefusal(template) {
|
|
|
118
119
|
throw error;
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
function composedRoom(room, roomTypes) {
|
|
123
|
+
const model = attachedModel({
|
|
124
|
+
kind: 'model',
|
|
125
|
+
snapshot: { identity: room.locator, version: '', schema: room.schema, revision: null },
|
|
126
|
+
}, roomTypes);
|
|
127
|
+
return { model, selection: null, typedPaths: [] };
|
|
128
|
+
}
|
|
129
|
+
export function writtenIn(room, roomTypes, batch) {
|
|
130
|
+
const written = writtenDocuments({
|
|
131
|
+
documents: room.documents,
|
|
132
|
+
binaries: {},
|
|
133
|
+
revisions: room.revisions ?? {},
|
|
134
|
+
fileIds: {},
|
|
135
|
+
created: {},
|
|
136
|
+
changes: {},
|
|
137
|
+
}, batch, composedRoom(room, roomTypes));
|
|
138
|
+
for (;;) {
|
|
139
|
+
const step = written.next();
|
|
140
|
+
if (step.done === true)
|
|
141
|
+
return step.value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function enteredRoom(room, roomTypes, connection) {
|
|
145
|
+
const composition = composedRoom(room, roomTypes);
|
|
146
|
+
const { model } = composition;
|
|
147
|
+
const key = room.enter(composition);
|
|
148
|
+
if (room.handle !== undefined)
|
|
149
|
+
connection.run("INSERT INTO replica_rooms (locator, key, record) VALUES (?, ?, json_object('declaration', json_object('handle', ?)))", [room.locator, key, room.handle]);
|
|
150
|
+
return {
|
|
151
|
+
locator: room.locator,
|
|
152
|
+
key,
|
|
153
|
+
composition,
|
|
154
|
+
...(room.handle === undefined ? {} : { handle: room.handle }),
|
|
155
|
+
facts: {
|
|
131
156
|
locator: room.locator,
|
|
132
157
|
available: model.status !== 'unavailable',
|
|
133
158
|
types: model.status === 'unavailable' ? [] : Object.values(model.types),
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function reachOf(rooms, followed) {
|
|
163
|
+
if (followed.every(({ readable, areas }) => readable === undefined && areas === undefined))
|
|
164
|
+
return null;
|
|
165
|
+
return {
|
|
166
|
+
rooms: [...rooms, ...followed.filter(({ readable }) => readable === undefined)].map(({ locator }) => locator),
|
|
167
|
+
documents: followed.flatMap(({ locator, readable }) => (readable ?? []).map((path) => documentKey(locator, path))),
|
|
168
|
+
areas: followed.flatMap(({ locator, areas }) => (areas ?? []).map(({ path, open }) => ({ room: locator, path, open }))),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function scope(rooms, roomTypes, connection, followed = []) {
|
|
172
|
+
for (const table of REPLICA_TABLES)
|
|
173
|
+
connection.run(table);
|
|
174
|
+
const keys = rooms.map((room) => enteredRoom(room, roomTypes, connection));
|
|
175
|
+
const follows = [
|
|
176
|
+
...keys,
|
|
177
|
+
...followed.map((room) => enteredRoom(room, roomTypes, connection)),
|
|
178
|
+
].filter(({ handle }) => handle !== undefined);
|
|
179
|
+
const planned = { listed: true, rooms: keys.map(({ facts }) => facts) };
|
|
180
|
+
const reach = reachOf(rooms, followed);
|
|
139
181
|
return {
|
|
140
182
|
async results(queries) {
|
|
141
183
|
const results = {};
|
|
142
184
|
for (const [name, query] of Object.entries(queries)) {
|
|
143
|
-
const plan = entryPlan(query, planned);
|
|
144
|
-
results[name] = answerQuery(connection, plan, keys.filter(({ locator }) => plan.rooms === null || plan.rooms.includes(locator)));
|
|
185
|
+
const plan = entryPlan(query, planned, reach);
|
|
186
|
+
results[name] = answerQuery(connection, plan, keys.filter(({ locator }) => plan.rooms === null || plan.rooms.includes(locator)), null, follows);
|
|
145
187
|
}
|
|
146
188
|
return results;
|
|
147
189
|
},
|
|
148
190
|
};
|
|
149
191
|
}
|
|
150
|
-
|
|
151
|
-
return
|
|
192
|
+
function scopedRoom(room, connection) {
|
|
193
|
+
return {
|
|
152
194
|
locator: room.locator,
|
|
195
|
+
...(room.handle === undefined ? {} : { handle: room.handle }),
|
|
196
|
+
...(room.readable === undefined ? {} : { readable: room.readable }),
|
|
197
|
+
...(room.areas === undefined ? {} : { areas: room.areas }),
|
|
153
198
|
schema: room.schema,
|
|
154
199
|
enter(composition) {
|
|
155
200
|
const heads = (path) => ({
|
|
@@ -167,7 +212,7 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
167
212
|
binary: null,
|
|
168
213
|
...heads(path),
|
|
169
214
|
})),
|
|
170
|
-
...Object.entries(room.
|
|
215
|
+
...Object.entries(room.attachments ?? {}).map(([path, binary]) => ({
|
|
171
216
|
path,
|
|
172
217
|
content: null,
|
|
173
218
|
facts: null,
|
|
@@ -177,7 +222,10 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
177
222
|
];
|
|
178
223
|
return entered(connection, room.locator, composition, entries.sort((left, right) => (left.path < right.path ? -1 : 1)));
|
|
179
224
|
},
|
|
180
|
-
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
export function entryScope(rooms, roomTypes, connection, followed = []) {
|
|
228
|
+
return scope(rooms.map((room) => scopedRoom(room, connection)), roomTypes, connection, followed.map((room) => scopedRoom(room, connection)));
|
|
181
229
|
}
|
|
182
230
|
export function countScope(room, roomTypes, connection) {
|
|
183
231
|
return scope([
|
package/dist/figures.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { GroupTotal, PendingResult } from './query.js';
|
|
|
3
3
|
import type { Deliver, Fail } from './reach.js';
|
|
4
4
|
import type { ConversationTally, RoomTally } from './tallies.js';
|
|
5
5
|
import type { QueryRoom } from './tables.js';
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const HOUSE_FOLDER = "house";
|
|
7
7
|
export declare const ROOM_TOTALS: {
|
|
8
8
|
readonly outside: readonly ["house"];
|
|
9
9
|
readonly groupBy: readonly ["room"];
|
package/dist/figures.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../src/figures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../src/figures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,eAAO,MAAM,WAAW;;;;iBAGZ,IAAI;;CACe,CAAC;AAGhC,eAAO,MAAM,cAAc,WAAa,CAAC;AAQzC,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAA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AS,GAAG,IAAI,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAgDF,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAwIlE"}
|
package/dist/figures.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { instantKey } from '@agentshouse/mdmodel';
|
|
2
|
-
export const
|
|
2
|
+
export const HOUSE_FOLDER = 'house';
|
|
3
3
|
export const ROOM_TOTALS = {
|
|
4
|
-
outside: [
|
|
4
|
+
outside: [HOUSE_FOLDER],
|
|
5
5
|
groupBy: ['room'],
|
|
6
6
|
select: { size: true },
|
|
7
7
|
};
|
package/dist/host.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type CallResult } from './outcome.js';
|
|
|
6
6
|
import { type RuntimePort } from './wire.js';
|
|
7
7
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
8
8
|
deploymentFacts?: unknown;
|
|
9
|
+
saveMessages?: Readonly<Record<string, string>>;
|
|
9
10
|
};
|
|
10
11
|
export type Admitted = {
|
|
11
12
|
readonly admitted: unknown;
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,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CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -16,7 +16,7 @@ const UNWAITED_TOPICS = new Set([
|
|
|
16
16
|
'service-mode',
|
|
17
17
|
'authority-changes',
|
|
18
18
|
]);
|
|
19
|
-
function answered(md, app, writtenBy, member, input) {
|
|
19
|
+
function answered(md, app, writtenBy, member, input, said) {
|
|
20
20
|
switch (member) {
|
|
21
21
|
case 'rooms':
|
|
22
22
|
return md.rooms();
|
|
@@ -29,23 +29,27 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
29
29
|
case 'types':
|
|
30
30
|
return md.types(input[0]);
|
|
31
31
|
case 'save':
|
|
32
|
-
return md
|
|
32
|
+
return md
|
|
33
|
+
.save(input[0], input[1], writtenBy)
|
|
34
|
+
.then(said);
|
|
33
35
|
case 'saveParts':
|
|
34
|
-
return md
|
|
36
|
+
return md
|
|
37
|
+
.saveParts(input[0], input[1], writtenBy)
|
|
38
|
+
.then(said);
|
|
35
39
|
case 'history':
|
|
36
40
|
return md.history(input[0], input[1], input[2]);
|
|
37
41
|
case 'resolve':
|
|
38
42
|
return md.resolve(input[0], input[1], input[2]);
|
|
39
|
-
case '
|
|
40
|
-
return md.
|
|
41
|
-
case '
|
|
42
|
-
return md.
|
|
43
|
-
case '
|
|
44
|
-
return md.
|
|
45
|
-
case '
|
|
46
|
-
return md.
|
|
47
|
-
case '
|
|
48
|
-
return md.
|
|
43
|
+
case 'attachment.read':
|
|
44
|
+
return md.attachment.read(input[0], input[1], input[2]);
|
|
45
|
+
case 'attachment.link':
|
|
46
|
+
return md.attachment.link(input[0], input[1], input[2]);
|
|
47
|
+
case 'attachment.show':
|
|
48
|
+
return md.attachment.show(input[0], input[1], input[2]);
|
|
49
|
+
case 'attachment.attach':
|
|
50
|
+
return md.attachment.attach(input[0], input[1]);
|
|
51
|
+
case 'attachment.part':
|
|
52
|
+
return md.attachment.part(input[0], input[1]);
|
|
49
53
|
case 'call':
|
|
50
54
|
return md.call(input[0], input[1]);
|
|
51
55
|
case 'answered':
|
|
@@ -104,8 +108,8 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
104
108
|
return md.conversation.decide(input[0], input[1], input[2]);
|
|
105
109
|
case 'conversation.rename':
|
|
106
110
|
return md.conversation.rename(input[0], input[1], input[2]);
|
|
107
|
-
case 'conversation.
|
|
108
|
-
return md.conversation.
|
|
111
|
+
case 'conversation.set':
|
|
112
|
+
return md.conversation.set(input[0], input[1], input[2]);
|
|
109
113
|
case 'conversation.retry':
|
|
110
114
|
return md.conversation.retry(input[0], input[1], input[2]);
|
|
111
115
|
case 'conversation.pin':
|
|
@@ -143,6 +147,13 @@ function answeredMessage(value) {
|
|
|
143
147
|
}
|
|
144
148
|
export function serveMdRuntime(options) {
|
|
145
149
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
150
|
+
const saveMessages = new Map(Object.entries(options.saveMessages ?? {}));
|
|
151
|
+
const said = (result) => {
|
|
152
|
+
if (result.outcome !== 'refused')
|
|
153
|
+
return result;
|
|
154
|
+
const message = saveMessages.get(result.code);
|
|
155
|
+
return message === undefined ? result : { ...result, message };
|
|
156
|
+
};
|
|
146
157
|
const closing = new AbortController();
|
|
147
158
|
const close = () => {
|
|
148
159
|
closing.abort();
|
|
@@ -265,7 +276,7 @@ export function serveMdRuntime(options) {
|
|
|
265
276
|
return;
|
|
266
277
|
}
|
|
267
278
|
const { id, member, input } = message;
|
|
268
|
-
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
279
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input, said));
|
|
269
280
|
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
270
281
|
};
|
|
271
282
|
port.addEventListener('message', (event) => {
|
package/dist/house-query.d.ts
CHANGED
|
@@ -3,9 +3,14 @@ import type { HouseQueryGroups, HouseQueryRows, ProviderRefusal } from './adapte
|
|
|
3
3
|
import { type Failure, type Offline } from './outcome.js';
|
|
4
4
|
import { type PortReach } from './reach.js';
|
|
5
5
|
import type { Runtime } from './runtime.js';
|
|
6
|
-
|
|
7
|
-
rooms: readonly [string];
|
|
6
|
+
type HouseViewQuery = {
|
|
7
|
+
readonly rooms: readonly [string];
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly after?: string;
|
|
8
10
|
};
|
|
11
|
+
export type HouseQuery = ((DocumentQuery | GroupQuery) & {
|
|
12
|
+
rooms: readonly [string];
|
|
13
|
+
}) | HouseViewQuery;
|
|
9
14
|
export type HouseQueryOptions = {
|
|
10
15
|
readonly fresh?: boolean;
|
|
11
16
|
};
|
|
@@ -15,4 +20,5 @@ export type HouseQueryResult = HouseQueryRows | HouseQueryGroups | Offline | (Pr
|
|
|
15
20
|
kind: 'undeclared';
|
|
16
21
|
}) | Failure;
|
|
17
22
|
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null, options: unknown): Promise<HouseQueryResult>;
|
|
23
|
+
export {};
|
|
18
24
|
//# sourceMappingURL=house-query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"house-query.d.ts","sourceRoot":"","sources":["../src/house-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"house-query.d.ts","sourceRoot":"","sources":["../src/house-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAGV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAA2C,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,CAAC,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,GAC7D,cAAc,CAAC;AAEnB,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACxC,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAC1C,OAAO,CAAC;AAgFZ,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
package/dist/house-query.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { invalid, known, plain } from '@agentshouse/mdmodel';
|
|
2
2
|
import { listedOrHeld } from './listing.js';
|
|
3
|
+
import { normalize } from './paths.js';
|
|
3
4
|
import { failure, OFFLINE, UNCERTAIN, undeclared } from './outcome.js';
|
|
4
5
|
import { askedOnline, offline } from './online.js';
|
|
5
6
|
import { holds, queriedOnly } from './reach.js';
|
|
7
|
+
import { documentKey } from './rows.js';
|
|
6
8
|
const HELD_ON_DEVICE = {
|
|
7
9
|
kind: 'rejected',
|
|
8
10
|
code: 'held-on-device',
|
|
@@ -20,25 +22,71 @@ function freshOf(options) {
|
|
|
20
22
|
invalid('fresh', 'expects true or false');
|
|
21
23
|
return fresh;
|
|
22
24
|
}
|
|
23
|
-
function
|
|
25
|
+
function viewOf(query) {
|
|
26
|
+
known(query, ['path', 'after'], '');
|
|
27
|
+
const { path, after } = query;
|
|
28
|
+
if (typeof path !== 'string' || path === '' || normalize(path) !== path)
|
|
29
|
+
invalid('path', 'names a View by its Path in the Room');
|
|
30
|
+
if (after === undefined)
|
|
31
|
+
return { path };
|
|
32
|
+
if (typeof after !== 'string')
|
|
33
|
+
invalid('after', 'expects the next an earlier page answered');
|
|
34
|
+
return { path, after };
|
|
35
|
+
}
|
|
36
|
+
function followedOf(reach) {
|
|
37
|
+
if (reach === null)
|
|
38
|
+
return {};
|
|
39
|
+
const whole = new Set([
|
|
40
|
+
...reach.rooms,
|
|
41
|
+
...(reach.queriesOnly ?? []).map(({ locator }) => locator),
|
|
42
|
+
]);
|
|
43
|
+
const documents = new Map(reach.documents
|
|
44
|
+
.filter(({ room }) => !whole.has(room))
|
|
45
|
+
.map(({ room, path }) => [documentKey(room, path), { room, path }]));
|
|
46
|
+
const followed = new Set([...whole, ...[...documents.values()].map(({ room }) => room)]);
|
|
47
|
+
const areas = new Map((reach.areas ?? [])
|
|
48
|
+
.filter(({ room }) => followed.has(room))
|
|
49
|
+
.map(({ room, path, open }) => [
|
|
50
|
+
documentKey(room, path),
|
|
51
|
+
{ room, path, open: [...new Set(open)].sort() },
|
|
52
|
+
]));
|
|
53
|
+
return {
|
|
54
|
+
follows: [
|
|
55
|
+
...[...whole].sort(),
|
|
56
|
+
...[...documents.keys()].sort().map((key) => documents.get(key)),
|
|
57
|
+
...[...areas.keys()].sort().map((key) => areas.get(key)),
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function houseQueryOf(input, options, reach) {
|
|
24
62
|
if (!plain(input))
|
|
25
63
|
invalid('query', 'expects a query object');
|
|
26
64
|
const { rooms, ...query } = input;
|
|
27
65
|
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
28
66
|
invalid('rooms', 'names the one Room House answers');
|
|
29
|
-
|
|
67
|
+
const asked = { room: rooms[0], fresh: freshOf(options), ...followedOf(reach) };
|
|
68
|
+
return query.path === undefined ? { ...asked, query } : { ...asked, ...viewOf(query) };
|
|
30
69
|
}
|
|
31
70
|
async function heldHere(runtime, reach, room) {
|
|
32
71
|
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
33
72
|
}
|
|
73
|
+
async function searchListed(runtime, room) {
|
|
74
|
+
const { roomList } = await (await runtime.store.open()).facts(['roomList']);
|
|
75
|
+
return roomList?.rooms.some((one) => one.room_ref === room && one.level === 'search') === true;
|
|
76
|
+
}
|
|
77
|
+
async function queriedHere(runtime, reach, room) {
|
|
78
|
+
if (queriedOnly(reach, runtime.socket.session.now().queriesOnly, room))
|
|
79
|
+
return true;
|
|
80
|
+
return reach === null && (await searchListed(runtime, room));
|
|
81
|
+
}
|
|
34
82
|
export async function queriedHouse(runtime, input, reach, options) {
|
|
35
83
|
const { socket } = runtime;
|
|
36
|
-
const asked = houseQueryOf(input, options);
|
|
37
|
-
await socket.ready;
|
|
38
84
|
const query = socket.queryHouse();
|
|
39
85
|
if (query === undefined)
|
|
40
86
|
return undeclared('queryHouse');
|
|
41
|
-
|
|
87
|
+
const asked = houseQueryOf(input, options, reach);
|
|
88
|
+
await socket.ready;
|
|
89
|
+
if (!(await queriedHere(runtime, reach, asked.room))) {
|
|
42
90
|
return (await heldHere(runtime, reach, asked.room))
|
|
43
91
|
? HELD_ON_DEVICE
|
|
44
92
|
: failure({ kind: 'room-not-readable', locator: asked.room });
|
package/dist/identity.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export declare function changeBatchIdentity(at?: number): string;
|
|
|
2
2
|
export declare function roomDraftRevision(): string;
|
|
3
3
|
export declare function chatDraftRevision(): string;
|
|
4
4
|
export declare function transferIdentity(): string;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function attachmentLocalId(): string;
|
|
6
6
|
//# sourceMappingURL=identity.d.ts.map
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;AAQD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;AAQD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
|