@agentshouse/mdruntime 0.1.0-c83bc1fac9b35 → 0.1.0-c8996aa8895a1
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/adapter.d.ts +21 -8
- package/dist/adapter.d.ts.map +1 -1
- package/dist/binary.d.ts +4 -0
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +9 -2
- package/dist/chat-types.js +2 -2
- package/dist/client.d.ts +8 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -5
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +3 -5
- package/dist/conversation-live.d.ts +0 -3
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +0 -2
- package/dist/conversation.d.ts +2 -4
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +21 -15
- package/dist/declaration.js +1 -1
- package/dist/entry.d.ts +9 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +45 -27
- package/dist/host.d.ts +1 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +18 -6
- package/dist/house-query.d.ts +7 -10
- package/dist/house-query.d.ts.map +1 -1
- package/dist/house-query.js +19 -6
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- 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 +5 -6
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +77 -21
- package/dist/messages.d.ts +6 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +5 -0
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/outcome.d.ts +11 -3
- package/dist/outcome.d.ts.map +1 -1
- package/dist/preparation.d.ts +1 -0
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +15 -6
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +2 -1
- package/dist/reach.d.ts +3 -2
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +19 -6
- package/dist/readiness.d.ts +4 -0
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +7 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +5 -2
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +6 -4
- package/dist/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +22 -2
- package/dist/stored.d.ts +7 -1
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +106 -23
- package/dist/surface.d.ts +2 -2
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +4 -4
- package/package.json +2 -2
package/dist/declaration.js
CHANGED
|
@@ -8,7 +8,7 @@ export function sameDeclaration(left, right) {
|
|
|
8
8
|
}
|
|
9
9
|
export function writeRule({ operations, providerOwnedPaths, authoredPaths, }, pathRule, local) {
|
|
10
10
|
return (path, needs) => {
|
|
11
|
-
const normalized = normalize(path);
|
|
11
|
+
const normalized = normalize(path.normalize('NFC'));
|
|
12
12
|
if (normalized === null || normalized === '')
|
|
13
13
|
return { code: 'room-root', path };
|
|
14
14
|
if (covered(providerOwnedPaths, normalized) || !authoredAt(authoredPaths, normalized)) {
|
package/dist/entry.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { BinaryFile, HeadChange } from './adapter.js';
|
|
3
3
|
import { type QueryRows } from './query.js';
|
|
4
|
+
import { type ValuedEntry } from './stored.js';
|
|
4
5
|
import type { Connection } from './tables.js';
|
|
5
6
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
7
|
+
export { documentKey, pathOfKey } from './rows.js';
|
|
8
|
+
export type { ValuedEntry } from './stored.js';
|
|
6
9
|
export type EntryRoom = {
|
|
7
10
|
locator: string;
|
|
8
11
|
schema: string | null;
|
|
@@ -21,5 +24,11 @@ export declare function entryRefusal(template: unknown): string | null;
|
|
|
21
24
|
export type EntryScope = {
|
|
22
25
|
results(queries: Readonly<Record<string, unknown>>): Promise<Record<string, QueryRows>>;
|
|
23
26
|
};
|
|
27
|
+
export type CountedRoom = {
|
|
28
|
+
locator: string;
|
|
29
|
+
schema: string | null;
|
|
30
|
+
documents: readonly ValuedEntry[];
|
|
31
|
+
};
|
|
24
32
|
export declare function entryScope(rooms: readonly EntryRoom[], roomTypes: VerifiedModel, connection: Connection): EntryScope;
|
|
33
|
+
export declare function countScope(room: CountedRoom, roomTypes: VerifiedModel, connection: Connection): EntryScope;
|
|
25
34
|
//# 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;AAI3D,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,YAAY,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;AAI3D,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE,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,SAA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,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;AAgDF,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAwCZ;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACrB,UAAU,CAaZ"}
|
package/dist/entry.js
CHANGED
|
@@ -3,8 +3,9 @@ import { attachedModel } from './attached-model.js';
|
|
|
3
3
|
import { answerQuery } from './compile.js';
|
|
4
4
|
import { planWithin } from './query.js';
|
|
5
5
|
import { writtenFacts } from './rows.js';
|
|
6
|
-
import { entered, REPLICA_TABLES } from './stored.js';
|
|
6
|
+
import { entered, enteredValues, REPLICA_TABLES, } from './stored.js';
|
|
7
7
|
export { QueryError } from '@agentshouse/mdmodel';
|
|
8
|
+
export { documentKey, pathOfKey } from './rows.js';
|
|
8
9
|
const PARAMETER = '$param';
|
|
9
10
|
const KIND = 'as';
|
|
10
11
|
const INTEGER = /^-?(?:0|[1-9][0-9]*)$/u;
|
|
@@ -117,7 +118,7 @@ export function entryRefusal(template) {
|
|
|
117
118
|
throw error;
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
+
function scope(rooms, roomTypes, connection) {
|
|
121
122
|
for (const table of REPLICA_TABLES)
|
|
122
123
|
connection.run(table);
|
|
123
124
|
const held = [];
|
|
@@ -132,31 +133,7 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
132
133
|
types: model.status === 'unavailable' ? [] : Object.values(model.types),
|
|
133
134
|
});
|
|
134
135
|
const composition = { model, selection: null, typedPaths: [] };
|
|
135
|
-
|
|
136
|
-
revision: room.revisions?.[path] ?? null,
|
|
137
|
-
fileId: room.fileIds?.[path] ?? null,
|
|
138
|
-
created: room.created?.[path] ?? null,
|
|
139
|
-
change: room.changes?.[path] ?? null,
|
|
140
|
-
written: null,
|
|
141
|
-
});
|
|
142
|
-
const entries = [
|
|
143
|
-
...Object.entries(room.documents).map(([path, content]) => ({
|
|
144
|
-
path,
|
|
145
|
-
content,
|
|
146
|
-
facts: writtenFacts(path, content, composition),
|
|
147
|
-
binary: null,
|
|
148
|
-
...heads(path),
|
|
149
|
-
})),
|
|
150
|
-
...Object.entries(room.binaryFiles ?? {}).map(([path, binary]) => ({
|
|
151
|
-
path,
|
|
152
|
-
content: null,
|
|
153
|
-
facts: null,
|
|
154
|
-
binary: { state: 'accepted', ...binary },
|
|
155
|
-
...heads(path),
|
|
156
|
-
})),
|
|
157
|
-
];
|
|
158
|
-
const key = entered(connection, room.locator, composition, entries.sort((left, right) => (left.path < right.path ? -1 : 1)));
|
|
159
|
-
return { locator: room.locator, key, composition };
|
|
136
|
+
return { locator: room.locator, key: room.enter(composition), composition };
|
|
160
137
|
});
|
|
161
138
|
const planned = { listed: true, rooms: held };
|
|
162
139
|
return {
|
|
@@ -170,3 +147,44 @@ export function entryScope(rooms, roomTypes, connection) {
|
|
|
170
147
|
},
|
|
171
148
|
};
|
|
172
149
|
}
|
|
150
|
+
export function entryScope(rooms, roomTypes, connection) {
|
|
151
|
+
return scope(rooms.map((room) => ({
|
|
152
|
+
locator: room.locator,
|
|
153
|
+
schema: room.schema,
|
|
154
|
+
enter(composition) {
|
|
155
|
+
const heads = (path) => ({
|
|
156
|
+
revision: room.revisions?.[path] ?? null,
|
|
157
|
+
fileId: room.fileIds?.[path] ?? null,
|
|
158
|
+
created: room.created?.[path] ?? null,
|
|
159
|
+
change: room.changes?.[path] ?? null,
|
|
160
|
+
written: null,
|
|
161
|
+
});
|
|
162
|
+
const entries = [
|
|
163
|
+
...Object.entries(room.documents).map(([path, content]) => ({
|
|
164
|
+
path,
|
|
165
|
+
content,
|
|
166
|
+
facts: writtenFacts(path, content, composition),
|
|
167
|
+
binary: null,
|
|
168
|
+
...heads(path),
|
|
169
|
+
})),
|
|
170
|
+
...Object.entries(room.binaryFiles ?? {}).map(([path, binary]) => ({
|
|
171
|
+
path,
|
|
172
|
+
content: null,
|
|
173
|
+
facts: null,
|
|
174
|
+
binary: { state: 'accepted', ...binary },
|
|
175
|
+
...heads(path),
|
|
176
|
+
})),
|
|
177
|
+
];
|
|
178
|
+
return entered(connection, room.locator, composition, entries.sort((left, right) => (left.path < right.path ? -1 : 1)));
|
|
179
|
+
},
|
|
180
|
+
})), roomTypes, connection);
|
|
181
|
+
}
|
|
182
|
+
export function countScope(room, roomTypes, connection) {
|
|
183
|
+
return scope([
|
|
184
|
+
{
|
|
185
|
+
locator: room.locator,
|
|
186
|
+
schema: room.schema,
|
|
187
|
+
enter: (composition) => enteredValues(connection, room.locator, composition, room.documents),
|
|
188
|
+
},
|
|
189
|
+
], roomTypes, connection);
|
|
190
|
+
}
|
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;AAUxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,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aAAa,CAsN3E;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,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();
|
|
@@ -25,13 +25,17 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
25
25
|
case 'search':
|
|
26
26
|
return md.search(input[0]);
|
|
27
27
|
case 'queryHouse':
|
|
28
|
-
return md.queryHouse(input[0]);
|
|
28
|
+
return md.queryHouse(input[0], input[1]);
|
|
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':
|
|
@@ -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();
|
|
@@ -165,7 +176,7 @@ export function serveMdRuntime(options) {
|
|
|
165
176
|
throw new Error(AUTHORIZATION_ENDED);
|
|
166
177
|
const { app, release, reach, admission, code = 'stored', first = null } = options;
|
|
167
178
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
168
|
-
const view = runtime.within(reach ?? null, { target: app, code, first });
|
|
179
|
+
const view = runtime.within(reach ?? null, { target: app, code, first, inboxed: null });
|
|
169
180
|
const observations = new Map();
|
|
170
181
|
const followed = new Set();
|
|
171
182
|
const answeredKeys = new Set();
|
|
@@ -191,6 +202,7 @@ export function serveMdRuntime(options) {
|
|
|
191
202
|
observations.clear();
|
|
192
203
|
for (const end of [...followed])
|
|
193
204
|
end();
|
|
205
|
+
view.close();
|
|
194
206
|
attachments.delete(detach);
|
|
195
207
|
};
|
|
196
208
|
const observe = (id, topic, input) => {
|
|
@@ -264,7 +276,7 @@ export function serveMdRuntime(options) {
|
|
|
264
276
|
return;
|
|
265
277
|
}
|
|
266
278
|
const { id, member, input } = message;
|
|
267
|
-
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));
|
|
268
280
|
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
269
281
|
};
|
|
270
282
|
port.addEventListener('message', (event) => {
|
package/dist/house-query.d.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { type DocumentQuery } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { ProviderRefusal } from './adapter.js';
|
|
1
|
+
import { type DocumentQuery, type GroupQuery } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { HouseQueryGroups, HouseQueryRows, ProviderRefusal } from './adapter.js';
|
|
3
3
|
import { type Failure, type Offline } from './outcome.js';
|
|
4
|
-
import type { QueryDocument } from './query.js';
|
|
5
4
|
import { type PortReach } from './reach.js';
|
|
6
5
|
import type { Runtime } from './runtime.js';
|
|
7
|
-
export type HouseQuery = DocumentQuery & {
|
|
6
|
+
export type HouseQuery = (DocumentQuery | GroupQuery) & {
|
|
8
7
|
rooms: readonly [string];
|
|
9
8
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
documents: readonly QueryDocument[];
|
|
13
|
-
next?: string;
|
|
9
|
+
export type HouseQueryOptions = {
|
|
10
|
+
readonly fresh?: boolean;
|
|
14
11
|
};
|
|
15
|
-
export type HouseQueryResult = HouseQueryRows | Offline | (ProviderRefusal & {
|
|
12
|
+
export type HouseQueryResult = HouseQueryRows | HouseQueryGroups | Offline | (ProviderRefusal & {
|
|
16
13
|
kind: 'rejected';
|
|
17
14
|
}) | (ProviderRefusal & {
|
|
18
15
|
kind: 'undeclared';
|
|
19
16
|
}) | Failure;
|
|
20
|
-
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null): Promise<HouseQueryResult>;
|
|
17
|
+
export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null, options: unknown): Promise<HouseQueryResult>;
|
|
21
18
|
//# 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,
|
|
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,EAEV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAA2C,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAErF,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;AA8BZ,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,4 +1,4 @@
|
|
|
1
|
-
import { invalid, plain } from '@agentshouse/mdmodel';
|
|
1
|
+
import { invalid, known, plain } from '@agentshouse/mdmodel';
|
|
2
2
|
import { listedOrHeld } from './listing.js';
|
|
3
3
|
import { failure, OFFLINE, UNCERTAIN, undeclared } from './outcome.js';
|
|
4
4
|
import { askedOnline, offline } from './online.js';
|
|
@@ -9,20 +9,31 @@ const HELD_ON_DEVICE = {
|
|
|
9
9
|
fields: {},
|
|
10
10
|
retryable: false,
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function freshOf(options) {
|
|
13
|
+
if (options === undefined)
|
|
14
|
+
return false;
|
|
15
|
+
if (!plain(options))
|
|
16
|
+
invalid('options', 'expects { fresh }');
|
|
17
|
+
known(options, ['fresh'], 'options');
|
|
18
|
+
const { fresh = false } = options;
|
|
19
|
+
if (typeof fresh !== 'boolean')
|
|
20
|
+
invalid('fresh', 'expects true or false');
|
|
21
|
+
return fresh;
|
|
22
|
+
}
|
|
23
|
+
function houseQueryOf(input, options) {
|
|
13
24
|
if (!plain(input))
|
|
14
25
|
invalid('query', 'expects a query object');
|
|
15
26
|
const { rooms, ...query } = input;
|
|
16
27
|
if (!Array.isArray(rooms) || rooms.length !== 1 || typeof rooms[0] !== 'string')
|
|
17
28
|
invalid('rooms', 'names the one Room House answers');
|
|
18
|
-
return { room: rooms[0], query };
|
|
29
|
+
return { room: rooms[0], query, fresh: freshOf(options) };
|
|
19
30
|
}
|
|
20
31
|
async function heldHere(runtime, reach, room) {
|
|
21
32
|
return holds(reach, room) && listedOrHeld(runtime, await runtime.store.rooms([room]), room);
|
|
22
33
|
}
|
|
23
|
-
export async function queriedHouse(runtime, input, reach) {
|
|
34
|
+
export async function queriedHouse(runtime, input, reach, options) {
|
|
24
35
|
const { socket } = runtime;
|
|
25
|
-
const asked = houseQueryOf(input);
|
|
36
|
+
const asked = houseQueryOf(input, options);
|
|
26
37
|
await socket.ready;
|
|
27
38
|
const query = socket.queryHouse();
|
|
28
39
|
if (query === undefined)
|
|
@@ -37,5 +48,7 @@ export async function queriedHouse(runtime, input, reach) {
|
|
|
37
48
|
const answer = await askedOnline(runtime, (authorization) => query(authorization, asked));
|
|
38
49
|
if (answer === null)
|
|
39
50
|
return UNCERTAIN;
|
|
40
|
-
return answer.kind === 'rows' || answer.kind === '
|
|
51
|
+
return answer.kind === 'rows' || answer.kind === 'groups' || answer.kind === 'rejected'
|
|
52
|
+
? answer
|
|
53
|
+
: failure(answer);
|
|
41
54
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, HouseQueryAnswer, HouseQueryAsk, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryCopy, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, KeyedRequest, AgentEnvironment, ListedAgent, ListedConversation, ListedOwner, ListedSpaceRef, RoomList, RoomListEntry, SpaceListEntry, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, HouseQueryAnswer, HouseQueryAsk, HouseQueryGroups, HouseQueryRows, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
2
|
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
3
|
export { heldFacts } from './conversation-row.js';
|
|
4
4
|
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
@@ -15,7 +15,7 @@ export type { Observation } from './observation.js';
|
|
|
15
15
|
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
16
16
|
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
17
17
|
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
18
|
-
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, ConversationAttachAnswer, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
18
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, ShownAnswer, ConversationAttachAnswer, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
19
19
|
export { blobOf, declaredType } from './outcome.js';
|
|
20
20
|
export type { BinaryFileRecord } from './binary.js';
|
|
21
21
|
export type { RuntimeError } from './failure.js';
|
|
@@ -23,14 +23,14 @@ export { refusalError } from './failure.js';
|
|
|
23
23
|
export type { ChangedPart, FieldValue, Marks, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
24
24
|
export type { SaveRefusal } from './save.js';
|
|
25
25
|
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
26
|
-
export type { HouseQuery,
|
|
26
|
+
export type { HouseQuery, HouseQueryOptions, HouseQueryResult } from './house-query.js';
|
|
27
27
|
export { keptFile, keptLines } from './chat-types.js';
|
|
28
28
|
export { FIGURES_DAY_MS } from './figures.js';
|
|
29
29
|
export { departure } from './change.js';
|
|
30
30
|
export { definitionsIn, selected } from './collection.js';
|
|
31
31
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
32
|
-
export { cutName, nameFrom
|
|
33
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
32
|
+
export { cutName, nameFrom } from './name.js';
|
|
33
|
+
export { HISTORY_CONVERSATIONS, newChat } from './conversation.js';
|
|
34
34
|
export { contextFigure } from './context.js';
|
|
35
35
|
export { runningWords } from './running.js';
|
|
36
36
|
export { turnLine, WORKING } from './parts.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YA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,EACjB,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,cAAc,EACd,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oB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AC;AACxB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,SAAS,EACT,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,GAAG,EACH,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,MAAM,EACN,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@ export { FIGURES_DAY_MS } from './figures.js';
|
|
|
8
8
|
export { departure } from './change.js';
|
|
9
9
|
export { definitionsIn, selected } from './collection.js';
|
|
10
10
|
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
11
|
-
export { cutName, nameFrom
|
|
12
|
-
export { HISTORY_CONVERSATIONS } from './conversation.js';
|
|
11
|
+
export { cutName, nameFrom } from './name.js';
|
|
12
|
+
export { HISTORY_CONVERSATIONS, newChat } from './conversation.js';
|
|
13
13
|
export { contextFigure } from './context.js';
|
|
14
14
|
export { runningWords } from './running.js';
|
|
15
15
|
export { turnLine, WORKING } from './parts.js';
|
package/dist/loaded.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { BuildFile } from './client.js';
|
|
2
|
-
export declare function
|
|
1
|
+
import type { BuildFile, BuiltFile } from './client.js';
|
|
2
|
+
export declare function atAddress<T>(file: BuiltFile, use: (address: string) => Promise<T>): Promise<T>;
|
|
3
|
+
export declare function importedFile(file: BuiltFile | null): Promise<unknown>;
|
|
4
|
+
export declare function parsed(file: BuiltFile | null): Promise<unknown>;
|
|
3
5
|
export declare function perBuild<T>(buildFile: BuildFile, key: string, make: () => Promise<T>): Promise<T>;
|
|
4
|
-
export declare function loaded<T>(buildFile: BuildFile, name: string, read?: (file:
|
|
6
|
+
export declare function loaded<T>(buildFile: BuildFile, name: string, read?: (file: BuiltFile | null) => Promise<unknown>): Promise<T | null>;
|
|
5
7
|
//# sourceMappingURL=loaded.d.ts.map
|
package/dist/loaded.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loaded.d.ts","sourceRoot":"","sources":["../src/loaded.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"loaded.d.ts","sourceRoot":"","sources":["../src/loaded.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxD,wBAAsB,SAAS,CAAC,CAAC,EAC/B,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACnC,OAAO,CAAC,CAAC,CAAC,CAQZ;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAIrE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYjG;AAED,wBAAgB,MAAM,CAAC,CAAC,EACtB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,OAAO,CAAC,OAAO,CAAgB,GAChE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAEnB"}
|
package/dist/loaded.js
CHANGED
|
@@ -7,19 +7,25 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
const holdings = new WeakMap();
|
|
10
|
-
async function
|
|
11
|
-
if (file ===
|
|
12
|
-
return
|
|
10
|
+
export async function atAddress(file, use) {
|
|
11
|
+
if (typeof file === 'string')
|
|
12
|
+
return use(file);
|
|
13
13
|
const address = URL.createObjectURL(file);
|
|
14
14
|
try {
|
|
15
|
-
return await
|
|
15
|
+
return await use(address);
|
|
16
16
|
}
|
|
17
17
|
finally {
|
|
18
18
|
URL.revokeObjectURL(address);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
export function importedFile(file) {
|
|
22
|
+
return file === null ? Promise.resolve(null) : atAddress(file, (address) => import(__rewriteRelativeImportExtension(address)));
|
|
23
|
+
}
|
|
21
24
|
export async function parsed(file) {
|
|
22
|
-
|
|
25
|
+
if (file === null)
|
|
26
|
+
return null;
|
|
27
|
+
const text = typeof file === 'string' ? await (await fetch(file)).text() : await file.text();
|
|
28
|
+
return JSON.parse(text);
|
|
23
29
|
}
|
|
24
30
|
export function perBuild(buildFile, key, make) {
|
|
25
31
|
let named = holdings.get(buildFile);
|
|
@@ -35,6 +41,6 @@ export function perBuild(buildFile, key, make) {
|
|
|
35
41
|
making.catch(() => named.delete(key));
|
|
36
42
|
return making;
|
|
37
43
|
}
|
|
38
|
-
export function loaded(buildFile, name, read =
|
|
44
|
+
export function loaded(buildFile, name, read = importedFile) {
|
|
39
45
|
return perBuild(buildFile, name, () => buildFile(name).then(read));
|
|
40
46
|
}
|
package/dist/media.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import { type DownloadAnswer
|
|
2
|
+
import { type DownloadAnswer } from './outcome.js';
|
|
3
3
|
export declare const ROOM_MEDIA = "room-media";
|
|
4
4
|
export declare const KEYED_MEDIA = "ahc-attachment";
|
|
5
5
|
export declare const MEDIA = "room-media, ahc-attachment";
|
|
6
6
|
export declare const DIAGRAM = "md-diagram";
|
|
7
7
|
export declare const VIEWING = "ahc-viewer";
|
|
8
|
-
type
|
|
9
|
-
export type MediaAt = {
|
|
10
|
-
readonly link: string;
|
|
11
|
-
} | {
|
|
8
|
+
type RoomAt = {
|
|
12
9
|
readonly room: string;
|
|
13
10
|
readonly path: string;
|
|
14
11
|
readonly revision: string | undefined;
|
|
15
12
|
};
|
|
16
|
-
export
|
|
13
|
+
export type MediaAt = {
|
|
14
|
+
readonly link: string;
|
|
15
|
+
} | RoomAt;
|
|
17
16
|
export declare function mediaAt(media: Element): MediaAt | null;
|
|
18
17
|
export declare function mediaTag(at: MediaAt): string;
|
|
19
18
|
export declare function downloadAt(client: MdRuntimeClient, at: MediaAt): Promise<DownloadAnswer>;
|
package/dist/media.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAqB,KAAK,cAAc,EAAoB,MAAM,cAAc,CAAC;AAGxF,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAE5C,eAAO,MAAM,KAAK,+BAAkC,CAAC;AAMrD,eAA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