@agentshouse/mdruntime 0.1.0-cf04ede9fb796 → 0.1.0-cf08df9b663d8
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 +21 -19
- package/dist/acceptance.d.ts +0 -3
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +105 -166
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +8 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +175 -85
- package/dist/adapter.d.ts +226 -74
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +2 -7
- package/dist/{binary.d.ts → attachment.d.ts} +8 -4
- package/dist/attachment.d.ts.map +1 -0
- package/dist/attachment.js +15 -0
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -19
- package/dist/chain.d.ts +1 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +5 -2
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/change.d.ts +6 -2
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +2 -4
- package/dist/client.d.ts +30 -23
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -68
- package/dist/collection.d.ts +27 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +34 -10
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +4 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +101 -63
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +42 -27
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +29 -15
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +26 -14
- package/dist/conversation-row.d.ts +23 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +37 -8
- package/dist/conversation.d.ts +48 -16
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +368 -262
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts +3 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +47 -47
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +26 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +126 -36
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +8 -0
- package/dist/figures.d.ts +1 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +6 -4
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/holdings.d.ts.map +1 -1
- package/dist/holdings.js +5 -3
- package/dist/host.d.ts +24 -4
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +108 -32
- package/dist/house-query.d.ts +24 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +102 -0
- 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 +29 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -9
- package/dist/install.d.ts +10 -6
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +92 -111
- package/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +80 -54
- package/dist/linked-file.d.ts +7 -0
- package/dist/linked-file.d.ts.map +1 -0
- package/dist/linked-file.js +13 -0
- package/dist/listing.d.ts +29 -22
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +71 -79
- package/dist/live.d.ts +19 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +97 -39
- package/dist/loaded.d.ts +7 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +46 -0
- package/dist/locks.d.ts +2 -4
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +12 -39
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +11 -23
- package/dist/media.d.ts +20 -4
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +184 -37
- package/dist/memory.d.ts +10 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +105 -41
- package/dist/messages.d.ts +21 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +53 -41
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +10 -8
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -5
- package/dist/models.d.ts +4 -8
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +97 -139
- package/dist/name.d.ts +0 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +3 -7
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +217 -85
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opened.d.ts +6 -6
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +7 -7
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +24 -10
- package/dist/outcome.d.ts +33 -13
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +36 -6
- package/dist/overlay.d.ts +23 -8
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +132 -48
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +6 -59
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +32 -122
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/preparation.d.ts +33 -7
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +210 -92
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +231 -0
- package/dist/queries.d.ts +2 -2
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +138 -80
- package/dist/query.d.ts +2 -3
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +1 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +3 -8
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +482 -0
- package/dist/reach.d.ts +15 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +200 -40
- package/dist/react.d.ts +17 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +23 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +18 -10
- package/dist/reads.d.ts +5 -3
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +30 -15
- package/dist/recovery.d.ts +4 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +31 -8
- package/dist/refresh.d.ts +1 -1
- package/dist/refresh.js +6 -6
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +5 -6
- package/dist/replica.d.ts +6 -17
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +18 -20
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +32 -9
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +282 -72
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +29 -23
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +47 -0
- package/dist/rows.d.ts +11 -3
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +28 -15
- package/dist/run-tables.d.ts +25 -0
- package/dist/run-tables.d.ts.map +1 -0
- package/dist/run-tables.js +98 -0
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runs.d.ts +27 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +92 -0
- package/dist/runtime.d.ts +15 -20
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +43 -90
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +338 -236
- package/dist/saves.d.ts +9 -45
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +208 -752
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +4 -5
- package/dist/selector.d.ts +3 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +22 -0
- package/dist/shared.d.ts +0 -5
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -90
- package/dist/shown.d.ts +10 -6
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +105 -73
- package/dist/socket/lanes.d.ts +12 -4
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +34 -8
- package/dist/socket/session.d.ts +4 -2
- package/dist/socket/session.d.ts.map +1 -1
- package/dist/socket/session.js +3 -0
- package/dist/socket.d.ts +9 -7
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +19 -18
- package/dist/source.d.ts +42 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +81 -13
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +32 -10
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +71 -28
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store/space.d.ts +1 -1
- package/dist/store/space.d.ts.map +1 -1
- package/dist/store/space.js +0 -2
- package/dist/store/watchers.js +1 -2
- package/dist/store.d.ts +25 -15
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +50 -18
- package/dist/stored.d.ts +42 -17
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +220 -62
- package/dist/surface.d.ts +20 -8
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +70 -35
- package/dist/sync.d.ts +4 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +134 -109
- package/dist/tables.d.ts +40 -57
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +114 -334
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +8 -9
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +51 -11
- package/dist/wire.d.ts +72 -12
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +31 -14
- package/package.json +4 -3
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/binary.d.ts.map +0 -1
- package/dist/binary.js +0 -8
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/socket/rooms.d.ts +0 -44
- package/dist/socket/rooms.d.ts.map +0 -1
- package/dist/socket/rooms.js +0 -90
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/dist/change-set.js
CHANGED
|
@@ -11,6 +11,8 @@ export function changeSet(locator, changed = {}) {
|
|
|
11
11
|
queues: changed.queue ? [locator] : [],
|
|
12
12
|
presentations: changed.presentation === undefined ? [] : [changed.presentation],
|
|
13
13
|
conversations: [],
|
|
14
|
+
unindexed: changed.unindexed ? [locator] : [],
|
|
15
|
+
due: changed.due ? [locator] : [],
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
export function conversationChangeSet(conversations) {
|
|
@@ -21,6 +23,8 @@ export function conversationChangeSet(conversations) {
|
|
|
21
23
|
queues: [],
|
|
22
24
|
presentations: [],
|
|
23
25
|
conversations: [...new Set(conversations)],
|
|
26
|
+
unindexed: [],
|
|
27
|
+
due: [],
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
export function mergeChangeSets(sets) {
|
|
@@ -31,6 +35,8 @@ export function mergeChangeSets(sets) {
|
|
|
31
35
|
queues: [...new Set(sets.flatMap((set) => set.queues))],
|
|
32
36
|
presentations: [...new Set(sets.flatMap((set) => set.presentations))],
|
|
33
37
|
conversations: [...new Set(sets.flatMap((set) => set.conversations))],
|
|
38
|
+
unindexed: [...new Set(sets.flatMap((set) => set.unindexed))],
|
|
39
|
+
due: [...new Set(sets.flatMap((set) => set.due))],
|
|
34
40
|
};
|
|
35
41
|
}
|
|
36
42
|
export function touches(set, locator, path) {
|
package/dist/change.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Attachment, HeadChange } from './adapter.js';
|
|
2
2
|
export type Change = {
|
|
3
3
|
readonly kind: 'field';
|
|
4
4
|
readonly path: string;
|
|
@@ -43,7 +43,7 @@ export type Change = {
|
|
|
43
43
|
} | (Arriving & {
|
|
44
44
|
readonly content: string;
|
|
45
45
|
}) | (Arriving & {
|
|
46
|
-
readonly binary:
|
|
46
|
+
readonly binary: Attachment;
|
|
47
47
|
});
|
|
48
48
|
type Arriving = {
|
|
49
49
|
readonly kind: 'arrival';
|
|
@@ -53,6 +53,10 @@ type Arriving = {
|
|
|
53
53
|
readonly created?: string;
|
|
54
54
|
readonly change?: HeadChange;
|
|
55
55
|
};
|
|
56
|
+
export type PartChange = Extract<Change, {
|
|
57
|
+
readonly kind: 'field' | 'section' | 'preamble';
|
|
58
|
+
}>;
|
|
59
|
+
export declare function isPart(change: Change): change is PartChange;
|
|
56
60
|
export type RoomMove = {
|
|
57
61
|
readonly source: {
|
|
58
62
|
readonly room: string;
|
package/dist/change.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,MAAM,GACd;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5E;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC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E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpF"}
|
package/dist/change.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export function isPart(change) {
|
|
2
|
+
return change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble';
|
|
3
|
+
}
|
|
1
4
|
function frozen(value) {
|
|
2
5
|
if (Array.isArray(value))
|
|
3
6
|
return Object.freeze(value.map((item) => frozen(item)));
|
|
@@ -22,7 +25,8 @@ export function leaving(batch, locator) {
|
|
|
22
25
|
}
|
|
23
26
|
export function landing(changes, index, path) {
|
|
24
27
|
let at = path;
|
|
25
|
-
for (
|
|
28
|
+
for (let next = index + 1; next < changes.length; next += 1) {
|
|
29
|
+
const change = changes[next];
|
|
26
30
|
if (change.path !== at)
|
|
27
31
|
continue;
|
|
28
32
|
if (change.kind === 'remove')
|
|
@@ -34,7 +38,8 @@ export function landing(changes, index, path) {
|
|
|
34
38
|
}
|
|
35
39
|
export function departure(changes, index) {
|
|
36
40
|
let at = changes[index].path;
|
|
37
|
-
for (
|
|
41
|
+
for (let earlier = index - 1; earlier >= 0; earlier -= 1) {
|
|
42
|
+
const change = changes[earlier];
|
|
38
43
|
if (change.kind === 'move' && change.to === at)
|
|
39
44
|
at = change.path;
|
|
40
45
|
}
|
package/dist/chat-types.d.ts
CHANGED
package/dist/chat-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../src/chat-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../src/chat-types.ts"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEpD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKhD"}
|
package/dist/chat-types.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export const CHAT_TYPE = 'chat';
|
|
2
|
-
export const CHAT_MESSAGE_TYPE = 'chat-message';
|
|
3
1
|
const KEPT_LINE = /^\[([^\]\n]+)\]\(\1\)$/u;
|
|
4
|
-
const
|
|
2
|
+
const UNKEPT_LINE = /^\[(?:too big to keep|not kept, [^:\n]+): [^\n]*\]$/u;
|
|
5
3
|
export function keptFile(line) {
|
|
6
4
|
return KEPT_LINE.exec(line)?.[1] ?? null;
|
|
7
5
|
}
|
|
@@ -9,5 +7,5 @@ export function keptLines(body) {
|
|
|
9
7
|
const trimmed = body.replace(/\n+$/u, '');
|
|
10
8
|
const at = trimmed.lastIndexOf('\n\n');
|
|
11
9
|
const lines = (at === -1 ? trimmed : trimmed.slice(at + 2)).split('\n');
|
|
12
|
-
return lines.every((line) => keptFile(line) !== null ||
|
|
10
|
+
return lines.every((line) => keptFile(line) !== null || UNKEPT_LINE.test(line)) ? lines : [];
|
|
13
11
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -4,27 +4,33 @@ import type { AppRoom } from './listing.js';
|
|
|
4
4
|
import type { ConnectionRefusal } from './socket.js';
|
|
5
5
|
import type { RoomSchemas } from './surface.js';
|
|
6
6
|
import type { SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
7
|
-
import type { Member, ServiceMode } from './adapter.js';
|
|
7
|
+
import type { ListedAgent, Member, RoomList, ServiceMode } from './adapter.js';
|
|
8
8
|
import type { UnsentWork } from './durability.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { ChatDraftSurface, ConversationAgent, ConversationEntry, ConversationOptions, ConversationSurface, ConversationView } from './conversation.js';
|
|
10
10
|
import { type Observation } from './observation.js';
|
|
11
|
-
import type
|
|
11
|
+
import { type AttachAnswer, type AttachmentAnswer, type CallResult, type DownloadAnswer, type HistoryAnswer, type QueueEntry, type Resolution, type ShownAnswer } from './outcome.js';
|
|
12
12
|
import type { FiguresResult } from './figures.js';
|
|
13
13
|
import type { Holdings } from './holdings.js';
|
|
14
14
|
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
15
15
|
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
16
16
|
import type { SearchRequest, SearchResult } from './search.js';
|
|
17
|
+
import type { HouseQuery, HouseQueryOptions, HouseQueryResult } from './house-query.js';
|
|
17
18
|
import type { Readiness } from './readiness.js';
|
|
18
19
|
import type { ObservedRead } from './reads.js';
|
|
20
|
+
import type { Runs } from './runs.js';
|
|
19
21
|
import type { SyncStatus } from './status.js';
|
|
20
22
|
import { type RuntimePort } from './wire.js';
|
|
23
|
+
export type BuiltFile = Blob | string;
|
|
24
|
+
export type BuildFile = (name: string) => Promise<BuiltFile | null>;
|
|
21
25
|
export type MdRuntimeClient = {
|
|
26
|
+
buildFile(name: string): Promise<BuiltFile | null>;
|
|
22
27
|
rooms(): Promise<readonly AppRoom[]>;
|
|
23
28
|
query: {
|
|
24
29
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
25
30
|
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
26
31
|
};
|
|
27
32
|
search(request: SearchRequest): Promise<SearchResult>;
|
|
33
|
+
queryHouse(query: HouseQuery, options?: HouseQueryOptions): Promise<HouseQueryResult>;
|
|
28
34
|
types(locator: string): Promise<RoomSchemas>;
|
|
29
35
|
roomDraft: {
|
|
30
36
|
list(): Promise<readonly RoomDraft[]>;
|
|
@@ -39,35 +45,26 @@ export type MdRuntimeClient = {
|
|
|
39
45
|
write(value: unknown): Promise<void>;
|
|
40
46
|
edit(members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
41
47
|
};
|
|
42
|
-
conversation: {
|
|
43
|
-
|
|
44
|
-
read(conversation: string, options?: ConversationRead): Promise<ConversationView>;
|
|
45
|
-
create(input: unknown): Promise<CallResult>;
|
|
46
|
-
send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
|
|
47
|
-
answer(conversation: string, answer: ConversationAnswer): Promise<CallResult>;
|
|
48
|
-
interrupt(conversation: string): Promise<CallResult>;
|
|
49
|
-
kill(conversation: string): Promise<CallResult>;
|
|
50
|
-
delete(conversation: string): Promise<CallResult>;
|
|
51
|
-
};
|
|
52
|
-
chatDraft: {
|
|
53
|
-
write(conversation: string, draft: ChatDraft, revision?: string): Promise<void>;
|
|
54
|
-
prepend(conversation: string, draft: ChatDraft): Promise<void>;
|
|
55
|
-
discard(conversation: string): Promise<void>;
|
|
48
|
+
conversation: ConversationSurface & {
|
|
49
|
+
pageMetadata(app: string, address: string): Promise<string>;
|
|
56
50
|
};
|
|
51
|
+
chatDraft: ChatDraftSurface;
|
|
57
52
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
58
53
|
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
59
|
-
|
|
60
|
-
read(room: string, path: string, revision?: string): Promise<
|
|
54
|
+
attachment: {
|
|
55
|
+
read(room: string, path: string, revision?: string): Promise<AttachmentAnswer>;
|
|
56
|
+
show(room: string, path: string, revision?: string): Promise<ShownAnswer>;
|
|
61
57
|
attach(room: string, file: File): Promise<AttachAnswer>;
|
|
62
58
|
download(room: string, path: string, revision?: string): Promise<DownloadAnswer>;
|
|
63
59
|
};
|
|
64
60
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
61
|
+
answered(operation: string): Promise<boolean>;
|
|
65
62
|
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
66
|
-
log(): Promise<string>;
|
|
67
63
|
persistence(): Promise<boolean>;
|
|
68
64
|
retry(): Promise<void>;
|
|
69
65
|
cleanUp(): Promise<number>;
|
|
70
66
|
unsent(): Promise<readonly UnsentWork[]>;
|
|
67
|
+
sent(): Promise<void>;
|
|
71
68
|
reset(): Promise<void>;
|
|
72
69
|
readAgain(): Promise<void>;
|
|
73
70
|
observe: {
|
|
@@ -79,6 +76,7 @@ export type MdRuntimeClient = {
|
|
|
79
76
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
80
77
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
81
78
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
79
|
+
(topic: 'time-zone'): Promise<Observation<string | null>>;
|
|
82
80
|
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
83
81
|
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
84
82
|
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
@@ -88,19 +86,28 @@ export type MdRuntimeClient = {
|
|
|
88
86
|
(topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
|
|
89
87
|
(topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
|
|
90
88
|
(topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
|
|
89
|
+
(topic: 'listed-agents'): Promise<Observation<readonly ListedAgent[]>>;
|
|
90
|
+
(topic: 'room-list'): Promise<Observation<RoomList | null>>;
|
|
91
91
|
(topic: 'figures'): Promise<Observation<FiguresResult>>;
|
|
92
92
|
(topic: 'holdings'): Promise<Observation<Holdings>>;
|
|
93
93
|
(topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
|
|
94
|
+
(topic: 'runs', asked: {
|
|
95
|
+
room: string;
|
|
96
|
+
} | {
|
|
97
|
+
sent: true;
|
|
98
|
+
}): Promise<Observation<Runs | PendingResult>>;
|
|
94
99
|
};
|
|
95
100
|
reauthorize(): Promise<void>;
|
|
96
101
|
settled(): Promise<void>;
|
|
97
102
|
};
|
|
98
|
-
export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
|
|
103
|
+
export declare function connectMdRuntime(port: RuntimePort, buildFile?: BuildFile): MdRuntimeClient;
|
|
99
104
|
export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
|
|
100
105
|
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
101
106
|
export { roomDraftRevision } from './identity.js';
|
|
102
|
-
export {
|
|
107
|
+
export { atAddress, importedFile } from './loaded.js';
|
|
108
|
+
export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
|
|
109
|
+
export { shownModal } from './modal.js';
|
|
103
110
|
export type { Observation } from './observation.js';
|
|
104
111
|
export type { Open } from './open.js';
|
|
105
|
-
export { unanswered, type RuntimePort, type WireMember } from './wire.js';
|
|
112
|
+
export { unanswered, undelivered, type RuntimePort, type WireMember } from './wire.js';
|
|
106
113
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,cA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AAC;CAC1B,CAAC;AAQF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,YAAU,GAAG,eAAe,CAmUxF;AAID,wBAAgB,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxF;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { handedCopy, handedLink } from './download.js';
|
|
2
|
+
import { pageMetadataBlock } from './page-metadata.js';
|
|
3
|
+
import { appRooms, observed } from './observation.js';
|
|
3
4
|
import { runtimeError } from './failure.js';
|
|
4
|
-
import {
|
|
5
|
+
import { attachmentBlob, } from './outcome.js';
|
|
6
|
+
import { AUTHORIZATION_ENDED, PORT_CLOSED, wireAnswer, } from './wire.js';
|
|
5
7
|
// React renders an arrived value in a later task and opens what that render observes as it commits, so this many frames opening nothing mean the page drew what it observes.
|
|
6
8
|
const SETTLED_FRAMES = 2;
|
|
7
|
-
// A browser reads a download's address only after the click that hands it returns, so a copy's address is released a minute later.
|
|
8
|
-
const HANDED_COPY_MS = 60_000;
|
|
9
|
-
const PAGE = /\.html?$/iu;
|
|
10
|
-
const STARTED = { kind: 'started' };
|
|
11
|
-
const BLOCKED = {
|
|
12
|
-
kind: 'blocked',
|
|
13
|
-
code: 'popup-blocked',
|
|
14
|
-
fields: {},
|
|
15
|
-
retryable: true,
|
|
16
|
-
};
|
|
17
|
-
function handed(url, name) {
|
|
18
|
-
const anchor = document.createElement('a');
|
|
19
|
-
anchor.href = url;
|
|
20
|
-
anchor.download = name;
|
|
21
|
-
anchor.click();
|
|
22
|
-
}
|
|
23
9
|
function refused(refusal) {
|
|
24
|
-
return runtimeError(refusal.code
|
|
10
|
+
return runtimeError(refusal.code);
|
|
25
11
|
}
|
|
26
|
-
|
|
12
|
+
const UNBUILT = () => Promise.resolve(null);
|
|
13
|
+
export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
27
14
|
let sequence = 0;
|
|
28
15
|
let refusal = null;
|
|
29
16
|
let ended = null;
|
|
@@ -35,13 +22,13 @@ export function connectMdRuntime(port) {
|
|
|
35
22
|
const send = (message) => {
|
|
36
23
|
port.postMessage(message);
|
|
37
24
|
};
|
|
38
|
-
function begin(id, topic, first) {
|
|
25
|
+
function begin(id, topic, input, first) {
|
|
39
26
|
const handle = observed(first, () => {
|
|
40
27
|
observations.delete(id);
|
|
41
28
|
if (refusal === null)
|
|
42
29
|
send({ kind: 'stop', id });
|
|
43
|
-
}, topic
|
|
44
|
-
observations.set(id, { topic, handle });
|
|
30
|
+
}, topic);
|
|
31
|
+
observations.set(id, { topic, input, handle });
|
|
45
32
|
return handle.observation;
|
|
46
33
|
}
|
|
47
34
|
function refuse(reported) {
|
|
@@ -53,7 +40,7 @@ export function connectMdRuntime(port) {
|
|
|
53
40
|
const failure = refused(reported);
|
|
54
41
|
for (const [id, waiting] of opening) {
|
|
55
42
|
if (waiting.topic === 'connection-refusal')
|
|
56
|
-
waiting.settle(begin(id, waiting.topic, reported));
|
|
43
|
+
waiting.settle(begin(id, waiting.topic, waiting.input, reported));
|
|
57
44
|
else
|
|
58
45
|
waiting.fail(failure);
|
|
59
46
|
}
|
|
@@ -79,7 +66,7 @@ export function connectMdRuntime(port) {
|
|
|
79
66
|
drawing?.();
|
|
80
67
|
}
|
|
81
68
|
port.addEventListener('message', (event) => {
|
|
82
|
-
const message =
|
|
69
|
+
const message = wireAnswer(event.data);
|
|
83
70
|
if (message === null)
|
|
84
71
|
return;
|
|
85
72
|
if (message.kind === 'refusal') {
|
|
@@ -88,7 +75,7 @@ export function connectMdRuntime(port) {
|
|
|
88
75
|
}
|
|
89
76
|
if (message.kind === 'ended') {
|
|
90
77
|
for (const { topic, handle } of observations.values()) {
|
|
91
|
-
if (topic === 'member')
|
|
78
|
+
if (topic === 'member' || topic === 'time-zone')
|
|
92
79
|
handle.receive(null);
|
|
93
80
|
}
|
|
94
81
|
end(runtimeError('authorization-ended', AUTHORIZATION_ENDED));
|
|
@@ -105,7 +92,7 @@ export function connectMdRuntime(port) {
|
|
|
105
92
|
waiting.fail(runtimeError(message.code, message.message, message.retryable));
|
|
106
93
|
}
|
|
107
94
|
else
|
|
108
|
-
waiting.settle(begin(message.id, waiting.topic, message.value));
|
|
95
|
+
waiting.settle(begin(message.id, waiting.topic, waiting.input, message.value));
|
|
109
96
|
drawing?.();
|
|
110
97
|
return;
|
|
111
98
|
}
|
|
@@ -141,11 +128,11 @@ export function connectMdRuntime(port) {
|
|
|
141
128
|
const id = (sequence += 1);
|
|
142
129
|
if (refusal !== null) {
|
|
143
130
|
return topic === 'connection-refusal'
|
|
144
|
-
? Promise.resolve(begin(id, topic, refusal))
|
|
131
|
+
? Promise.resolve(begin(id, topic, input, refusal))
|
|
145
132
|
: Promise.reject(refused(refusal));
|
|
146
133
|
}
|
|
147
134
|
return new Promise((settle, fail) => {
|
|
148
|
-
opening.set(id, { topic, settle, fail });
|
|
135
|
+
opening.set(id, { topic, input, settle, fail });
|
|
149
136
|
send({ kind: 'observe', id, topic, input });
|
|
150
137
|
drawing?.();
|
|
151
138
|
});
|
|
@@ -158,12 +145,12 @@ export function connectMdRuntime(port) {
|
|
|
158
145
|
let received = 0;
|
|
159
146
|
const stream = new ReadableStream({
|
|
160
147
|
async pull(controller) {
|
|
161
|
-
const bytes = await ask('
|
|
148
|
+
const bytes = await ask('attachment.part', [file, part]);
|
|
162
149
|
if (bytes === null) {
|
|
163
150
|
if (received === byteLength)
|
|
164
151
|
controller.close();
|
|
165
152
|
else
|
|
166
|
-
controller.error(runtimeError('
|
|
153
|
+
controller.error(runtimeError('attachment-absent', 'The file ended early'));
|
|
167
154
|
return;
|
|
168
155
|
}
|
|
169
156
|
part += 1;
|
|
@@ -174,32 +161,13 @@ export function connectMdRuntime(port) {
|
|
|
174
161
|
return { kind: 'binary', stream, byteLength, mediaType };
|
|
175
162
|
}
|
|
176
163
|
async function download(room, path, revision) {
|
|
177
|
-
const
|
|
178
|
-
const linked = await ask('binaryFile.link', [room, path, revision]);
|
|
179
|
-
if (linked.kind === 'link' && PAGE.test(linked.name)) {
|
|
180
|
-
const away = tab ?? globalThis.open('', '_blank');
|
|
181
|
-
if (away === null)
|
|
182
|
-
return BLOCKED;
|
|
183
|
-
away.location.replace(linked.url);
|
|
184
|
-
return STARTED;
|
|
185
|
-
}
|
|
186
|
-
tab?.close();
|
|
187
|
-
if (linked.kind === 'link') {
|
|
188
|
-
handed(linked.url, linked.name);
|
|
189
|
-
return STARTED;
|
|
190
|
-
}
|
|
164
|
+
const linked = await handedLink(path, () => ask('attachment.link', [room, path, revision]));
|
|
191
165
|
if (linked.kind !== 'absent')
|
|
192
166
|
return linked;
|
|
193
|
-
const read = streamed(await ask('
|
|
167
|
+
const read = streamed(await ask('attachment.read', [room, path, revision]));
|
|
194
168
|
if (read.kind !== 'binary')
|
|
195
169
|
return read;
|
|
196
|
-
|
|
197
|
-
headers: { 'content-type': read.mediaType },
|
|
198
|
-
}).blob();
|
|
199
|
-
const url = URL.createObjectURL(copy);
|
|
200
|
-
handed(url, path.slice(path.lastIndexOf('/') + 1));
|
|
201
|
-
setTimeout(() => URL.revokeObjectURL(url), HANDED_COPY_MS);
|
|
202
|
-
return STARTED;
|
|
170
|
+
return handedCopy(await attachmentBlob(read), path.slice(path.lastIndexOf('/') + 1));
|
|
203
171
|
}
|
|
204
172
|
function settled() {
|
|
205
173
|
if (settling !== null)
|
|
@@ -230,11 +198,12 @@ export function connectMdRuntime(port) {
|
|
|
230
198
|
});
|
|
231
199
|
return settling;
|
|
232
200
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
rooms: () => ask('rooms', []),
|
|
201
|
+
return {
|
|
202
|
+
buildFile,
|
|
203
|
+
rooms: () => ask('rooms', []).then(appRooms),
|
|
236
204
|
query: ((query) => ask('query', [query])),
|
|
237
205
|
search: (request) => ask('search', [request]),
|
|
206
|
+
queryHouse: (query, options) => ask('queryHouse', options === undefined ? [query] : [query, options]),
|
|
238
207
|
types: (locator) => ask('types', [locator]),
|
|
239
208
|
roomDraft: {
|
|
240
209
|
list: () => ask('roomDraft.list', []),
|
|
@@ -254,36 +223,52 @@ export function connectMdRuntime(port) {
|
|
|
254
223
|
read: (conversation, options) => ask('conversation.read', [conversation, options]),
|
|
255
224
|
create: (input) => ask('conversation.create', [input]),
|
|
256
225
|
send: (conversation, operation, draft) => ask('conversation.send', [conversation, operation, draft]),
|
|
257
|
-
answer: (conversation, answer) => ask('conversation.answer', [conversation, answer]),
|
|
258
|
-
interrupt: (conversation) => ask('conversation.interrupt', [conversation]),
|
|
259
|
-
kill: (conversation) => ask('conversation.kill', [conversation]),
|
|
260
|
-
delete: (conversation) => ask('conversation.delete', [conversation]),
|
|
226
|
+
answer: (conversation, answer, operation) => ask('conversation.answer', [conversation, answer, operation]),
|
|
227
|
+
interrupt: (conversation, operation) => ask('conversation.interrupt', [conversation, operation]),
|
|
228
|
+
kill: (conversation, operation) => ask('conversation.kill', [conversation, operation]),
|
|
229
|
+
delete: (conversation, operation) => ask('conversation.delete', [conversation, operation]),
|
|
230
|
+
takeOut: (conversation, message, operation) => ask('conversation.takeOut', [conversation, message, operation]),
|
|
231
|
+
decide: (request, decision, operation) => ask('conversation.decide', [request, decision, operation]),
|
|
232
|
+
rename: (conversation, name, operation) => ask('conversation.rename', [conversation, name, operation]),
|
|
233
|
+
set: (conversation, settings, operation) => ask('conversation.set', [conversation, settings, operation]),
|
|
234
|
+
retry: (conversation, message, operation) => ask('conversation.retry', [conversation, message, operation]),
|
|
235
|
+
pin: (figures) => ask('conversation.pin', [figures]),
|
|
236
|
+
openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
|
|
237
|
+
dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
|
|
238
|
+
attach: (file) => ask('conversation.attach', [file]),
|
|
239
|
+
attachment: (link) => ask('conversation.attachment', [link]),
|
|
240
|
+
pageMetadata: async (app, address) => pageMetadataBlock(app, address, [...observations]
|
|
241
|
+
.sort(([left], [right]) => left - right)
|
|
242
|
+
.flatMap(([, { topic, input }]) => (topic === 'query' ? [input[0]] : []))),
|
|
261
243
|
},
|
|
262
244
|
chatDraft: {
|
|
263
245
|
write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
|
|
264
246
|
prepend: (conversation, draft) => ask('chatDraft.prepend', [conversation, draft]),
|
|
247
|
+
append: (conversation, draft) => ask('chatDraft.append', [conversation, draft]),
|
|
265
248
|
discard: (conversation) => ask('chatDraft.discard', [conversation]),
|
|
266
249
|
},
|
|
267
250
|
history: (locator, path, query) => ask('history', [locator, path, query]),
|
|
268
251
|
resolve: (room, path, destination) => ask('resolve', [room, path, destination]),
|
|
269
|
-
|
|
270
|
-
read: (room, path, revision) => ask('
|
|
271
|
-
|
|
252
|
+
attachment: {
|
|
253
|
+
read: (room, path, revision) => ask('attachment.read', [room, path, revision]).then((read) => streamed(read)),
|
|
254
|
+
show: (room, path, revision) => ask('attachment.show', [room, path, revision]).then((shown) => streamed(shown)),
|
|
255
|
+
attach: (room, file) => ask('attachment.attach', [room, file]),
|
|
272
256
|
download,
|
|
273
257
|
},
|
|
274
258
|
call: (name, input) => ask('call', [name, input]),
|
|
259
|
+
answered: (operation) => ask('answered', [operation]),
|
|
275
260
|
reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
|
|
276
|
-
log: () => ask('log', []),
|
|
277
261
|
persistence: () => ask('persistence', []),
|
|
278
262
|
retry: () => ask('retry', []),
|
|
279
263
|
cleanUp: () => ask('cleanUp', []),
|
|
280
264
|
unsent: () => ask('unsent', []),
|
|
265
|
+
sent: () => ask('sent', []),
|
|
281
266
|
reset: () => ask('reset', []),
|
|
282
267
|
readAgain: () => ask('readAgain', []),
|
|
283
268
|
observe: ((topic, ...input) => watch(topic, input)),
|
|
284
269
|
reauthorize: () => ask('reauthorize', []),
|
|
285
270
|
settled,
|
|
286
|
-
}
|
|
271
|
+
};
|
|
287
272
|
}
|
|
288
273
|
const turns = new WeakMap();
|
|
289
274
|
export function inTurn(client, work) {
|
|
@@ -293,5 +278,7 @@ export function inTurn(client, work) {
|
|
|
293
278
|
}
|
|
294
279
|
export { chainedWindows } from './chain.js';
|
|
295
280
|
export { roomDraftRevision } from './identity.js';
|
|
296
|
-
export {
|
|
297
|
-
export {
|
|
281
|
+
export { atAddress, importedFile } from './loaded.js';
|
|
282
|
+
export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
|
|
283
|
+
export { shownModal } from './modal.js';
|
|
284
|
+
export { unanswered, undelivered } from './wire.js';
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Document, type TypedPath } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { ModelState } from './model.js';
|
|
1
|
+
import { type DefinitionOf, type Document, type ParseResult, type TypedPath, type VerifiedModel } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { ModelState, TypesResult } from './model.js';
|
|
3
|
+
import type { AppTypedSelection } from './listing.js';
|
|
3
4
|
import type { MdModelIdentity } from './adapter.js';
|
|
4
5
|
export declare const MD_MODEL: MdModelIdentity;
|
|
5
6
|
export type Collection = {
|
|
@@ -19,11 +20,33 @@ export type Composed = {
|
|
|
19
20
|
readonly composition: Composition;
|
|
20
21
|
readonly fingerprint: string;
|
|
21
22
|
};
|
|
23
|
+
export declare function typesPrint(types: VerifiedModel['types']): string;
|
|
22
24
|
export declare function composedOf(composition: Composition): Composed;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
type Selecting<M> = {
|
|
26
|
+
readonly model: M;
|
|
27
|
+
readonly selection: {
|
|
28
|
+
readonly roots: readonly string[];
|
|
29
|
+
readonly model: M;
|
|
30
|
+
} | null;
|
|
31
|
+
};
|
|
32
|
+
export declare function selected(composition: {
|
|
33
|
+
readonly selection: {
|
|
34
|
+
readonly roots: readonly string[];
|
|
35
|
+
} | null;
|
|
36
|
+
}, path: string): boolean;
|
|
37
|
+
export declare function governing<M>(composition: Selecting<M>, path: string): M;
|
|
38
|
+
export declare function definitionsAt(composition: Composition, path: string): DefinitionOf;
|
|
39
|
+
export declare function definitionsIn(room: {
|
|
40
|
+
readonly model: TypesResult;
|
|
41
|
+
readonly typedSelection: AppTypedSelection | null;
|
|
42
|
+
}, path: string, typedPaths: readonly TypedPath[]): DefinitionOf;
|
|
25
43
|
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition): Collection;
|
|
26
44
|
export declare function documentsOf(collection: Collection): Generator<number, Iterable<readonly [string, Document]>, void>;
|
|
27
45
|
export declare function validRoot(root: unknown): root is string;
|
|
46
|
+
export declare const UNTYPED = "any";
|
|
47
|
+
export declare function textType(read: ParseResult): string | undefined;
|
|
48
|
+
export declare function typeAt(composition: Composition, path: string, read: ParseResult): string | undefined;
|
|
49
|
+
export declare function typedText(read: ParseResult): boolean;
|
|
28
50
|
export declare function available(composition: Composition): boolean;
|
|
51
|
+
export {};
|
|
29
52
|
//# sourceMappingURL=collection.d.ts.map
|
package/dist/collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,QAAQ,EAAE,eAAwE,CAAC;AAEhG,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAI3F,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAOhE;AAMD,wBAAgB,UAAU,CAAC,WAAW,EAA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