@agentshouse/mdruntime 0.1.0-c069136dcb4e8 → 0.1.0-c076b00ebf42a
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 +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +299 -0
- 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 +26 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +302 -0
- package/dist/adapter.d.ts +108 -85
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -11
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +20 -60
- package/dist/bootstrap.d.ts +9 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +204 -85
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- 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 +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +4 -2
- package/dist/chat-types.d.ts +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +11 -0
- package/dist/client.d.ts +29 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +36 -20
- package/dist/collection.d.ts +26 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +19 -2
- package/dist/compile.d.ts +8 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +286 -336
- package/dist/connection.d.ts +5 -142
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +110 -4970
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-live.d.ts +150 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +35 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +55 -0
- package/dist/conversation.d.ts +65 -44
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +999 -881
- 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 +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +150 -0
- package/dist/durability.d.ts +19 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +4 -0
- package/dist/entry.d.ts +2 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- 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 +6 -0
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +199 -0
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +2 -1
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +21 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +77 -41
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +34 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/install.d.ts +60 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +278 -0
- package/dist/listing.d.ts +52 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +152 -0
- package/dist/live.d.ts +9 -6
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +118 -36
- package/dist/locks.d.ts +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +32 -0
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +49 -0
- package/dist/media.d.ts +1 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +10 -13
- package/dist/memory.d.ts +15 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +178 -89
- package/dist/messages.d.ts +35 -5
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +108 -36
- package/dist/model.d.ts +2 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -14
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +153 -0
- package/dist/observation.d.ts +28 -13
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +185 -81
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +53 -0
- package/dist/outcome.d.ts +11 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +26 -2
- package/dist/overlay.d.ts +6 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +47 -21
- 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 +4 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +13 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts +41 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +314 -0
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +233 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +308 -0
- package/dist/query.d.ts +14 -210
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +29 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +115 -0
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +450 -0
- package/dist/reach.d.ts +16 -15
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +248 -147
- package/dist/react.d.ts +17 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +9 -6
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +39 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +178 -0
- package/dist/recovery.d.ts +3 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +38 -8
- package/dist/refresh.d.ts +2 -1
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +31 -3
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +55 -0
- package/dist/replica.d.ts +11 -16
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +64 -30
- 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 +7 -8
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +113 -111
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +217 -0
- package/dist/rows.d.ts +16 -22
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +49 -186
- package/dist/runtime.d.ts +34 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +42 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +344 -174
- package/dist/saves.d.ts +32 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +409 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/seed.d.ts +11 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +71 -1
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +33 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +309 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +28 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +103 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/session.d.ts +38 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +67 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +164 -0
- package/dist/source.d.ts +54 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +82 -0
- package/dist/status.d.ts +0 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -6
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +40 -0
- package/dist/store/readiness.d.ts +11 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +68 -0
- package/dist/store/records.d.ts +217 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +464 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- 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 +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +113 -144
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +171 -364
- package/dist/stored.d.ts +72 -35
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +340 -197
- package/dist/surface.d.ts +89 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +222 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +535 -0
- package/dist/tables.d.ts +124 -30
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +242 -62
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +128 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +9 -12
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +58 -9
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +21 -5
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -370
- package/dist/log.d.ts +0 -5
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -156
package/dist/cell.js
ADDED
package/dist/chain.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import type {
|
|
3
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
3
4
|
type Rows = DocumentResult | GroupResult;
|
|
4
5
|
export type WindowAnswer = Rows | PendingResult;
|
|
5
6
|
export type WindowChain = {
|
package/dist/chain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7E,KAAK,IAAI,GAAG,cAAc,GAAG,WAAW,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,aAAa,CAAC;AAEhD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAaF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,aAAa,GAAG,UAAU,EACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAC7E,WAAW,CAkEb"}
|
package/dist/change-set.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type ChangeSet = {
|
|
|
12
12
|
queues: readonly string[];
|
|
13
13
|
presentations: readonly string[];
|
|
14
14
|
conversations: readonly string[];
|
|
15
|
+
unindexed: readonly string[];
|
|
16
|
+
due: readonly string[];
|
|
15
17
|
};
|
|
16
18
|
type Changed = {
|
|
17
19
|
documents?: readonly string[] | null;
|
|
@@ -19,6 +21,8 @@ type Changed = {
|
|
|
19
21
|
room?: boolean;
|
|
20
22
|
queue?: boolean;
|
|
21
23
|
presentation?: string;
|
|
24
|
+
unindexed?: boolean;
|
|
25
|
+
due?: boolean;
|
|
22
26
|
};
|
|
23
27
|
export declare function changeSet(locator: string, changed?: Changed): ChangeSet;
|
|
24
28
|
export declare function conversationChangeSet(conversations: readonly string[]): ChangeSet;
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,MAAM,EAAE,SAAS;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names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AI,EAAE,MAAM,GAAG,OAAO,CAI9E"}
|
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
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,IAA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AC;CAC7B,CAAC;AAUF,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAEzD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI5E;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
|
@@ -22,7 +22,8 @@ export function leaving(batch, locator) {
|
|
|
22
22
|
}
|
|
23
23
|
export function landing(changes, index, path) {
|
|
24
24
|
let at = path;
|
|
25
|
-
for (
|
|
25
|
+
for (let next = index + 1; next < changes.length; next += 1) {
|
|
26
|
+
const change = changes[next];
|
|
26
27
|
if (change.path !== at)
|
|
27
28
|
continue;
|
|
28
29
|
if (change.kind === 'remove')
|
|
@@ -34,7 +35,8 @@ export function landing(changes, index, path) {
|
|
|
34
35
|
}
|
|
35
36
|
export function departure(changes, index) {
|
|
36
37
|
let at = changes[index].path;
|
|
37
|
-
for (
|
|
38
|
+
for (let earlier = index - 1; earlier >= 0; earlier -= 1) {
|
|
39
|
+
const change = changes[earlier];
|
|
38
40
|
if (change.kind === 'move' && change.to === at)
|
|
39
41
|
at = change.path;
|
|
40
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const KEPT_LINE = /^\[([^\]\n]+)\]\(\1\)$/u;
|
|
2
|
+
const TOO_BIG_LINE = /^\[too big to keep: [^\n]*\]$/u;
|
|
3
|
+
export function keptFile(line) {
|
|
4
|
+
return KEPT_LINE.exec(line)?.[1] ?? null;
|
|
5
|
+
}
|
|
6
|
+
export function keptLines(body) {
|
|
7
|
+
const trimmed = body.replace(/\n+$/u, '');
|
|
8
|
+
const at = trimmed.lastIndexOf('\n\n');
|
|
9
|
+
const lines = (at === -1 ? trimmed : trimmed.slice(at + 2)).split('\n');
|
|
10
|
+
return lines.every((line) => keptFile(line) !== null || TOO_BIG_LINE.test(line)) ? lines : [];
|
|
11
|
+
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { HistoryQuery } from './actions.js';
|
|
3
|
+
import type { AppRoom } from './listing.js';
|
|
4
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
5
|
+
import type { RoomSchemas } from './surface.js';
|
|
6
|
+
import type { SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
7
|
+
import type { ListedAgent, Member, ServiceMode } from './adapter.js';
|
|
8
|
+
import type { UnsentWork } from './durability.js';
|
|
9
|
+
import type { ChatDraftSurface, ConversationAgent, ConversationEntry, ConversationOptions, ConversationSurface, ConversationView } from './conversation.js';
|
|
4
10
|
import { type Observation } from './observation.js';
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
11
|
+
import { type AttachAnswer, type BinaryAnswer, type CallResult, type DownloadAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
12
|
+
import type { FiguresResult } from './figures.js';
|
|
13
|
+
import type { Holdings } from './holdings.js';
|
|
14
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
7
15
|
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
8
16
|
import type { SearchRequest, SearchResult } from './search.js';
|
|
9
17
|
import type { Readiness } from './readiness.js';
|
|
18
|
+
import type { ObservedRead } from './reads.js';
|
|
10
19
|
import type { SyncStatus } from './status.js';
|
|
11
20
|
import { type RuntimePort } from './wire.js';
|
|
21
|
+
export type BuildFile = (name: string) => Promise<Blob | null>;
|
|
12
22
|
export type MdRuntimeClient = {
|
|
23
|
+
buildFile(name: string): Promise<Blob | null>;
|
|
13
24
|
rooms(): Promise<readonly AppRoom[]>;
|
|
14
25
|
query: {
|
|
15
26
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
@@ -30,22 +41,10 @@ export type MdRuntimeClient = {
|
|
|
30
41
|
write(value: unknown): Promise<void>;
|
|
31
42
|
edit(members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
32
43
|
};
|
|
33
|
-
conversation: {
|
|
34
|
-
|
|
35
|
-
read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
|
|
36
|
-
create(input: unknown): Promise<CallResult>;
|
|
37
|
-
send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
|
|
38
|
-
answer(conversation: string, answer: unknown): Promise<CallResult>;
|
|
39
|
-
interrupt(conversation: string): Promise<CallResult>;
|
|
40
|
-
kill(conversation: string): Promise<CallResult>;
|
|
41
|
-
cancel(conversation: string, turn: string): Promise<CallResult>;
|
|
42
|
-
delete(conversation: string): Promise<CallResult>;
|
|
43
|
-
};
|
|
44
|
-
chatDraft: {
|
|
45
|
-
write(conversation: string, draft: ChatDraft, revision?: string): Promise<void>;
|
|
46
|
-
prepend(conversation: string, draft: ChatDraft): Promise<void>;
|
|
47
|
-
discard(conversation: string): Promise<void>;
|
|
44
|
+
conversation: ConversationSurface & {
|
|
45
|
+
pageMetadata(app: string, address: string): Promise<string>;
|
|
48
46
|
};
|
|
47
|
+
chatDraft: ChatDraftSurface;
|
|
49
48
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
50
49
|
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
51
50
|
binaryFile: {
|
|
@@ -54,11 +53,14 @@ export type MdRuntimeClient = {
|
|
|
54
53
|
download(room: string, path: string, revision?: string): Promise<DownloadAnswer>;
|
|
55
54
|
};
|
|
56
55
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
56
|
+
answered(operation: string): Promise<boolean>;
|
|
57
57
|
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
58
|
-
log(): Promise<string>;
|
|
59
58
|
persistence(): Promise<boolean>;
|
|
60
59
|
retry(): Promise<void>;
|
|
61
60
|
cleanUp(): Promise<number>;
|
|
61
|
+
unsent(): Promise<readonly UnsentWork[]>;
|
|
62
|
+
reset(): Promise<void>;
|
|
63
|
+
readAgain(): Promise<void>;
|
|
62
64
|
observe: {
|
|
63
65
|
(topic: 'deployment-facts'): Promise<Observation<unknown>>;
|
|
64
66
|
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
@@ -68,6 +70,7 @@ export type MdRuntimeClient = {
|
|
|
68
70
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
69
71
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
70
72
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
73
|
+
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
71
74
|
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
72
75
|
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
73
76
|
(topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
|
|
@@ -76,11 +79,15 @@ export type MdRuntimeClient = {
|
|
|
76
79
|
(topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
|
|
77
80
|
(topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
|
|
78
81
|
(topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
|
|
82
|
+
(topic: 'listed-agents'): Promise<Observation<readonly ListedAgent[]>>;
|
|
83
|
+
(topic: 'figures'): Promise<Observation<FiguresResult>>;
|
|
84
|
+
(topic: 'holdings'): Promise<Observation<Holdings>>;
|
|
85
|
+
(topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
|
|
79
86
|
};
|
|
80
87
|
reauthorize(): Promise<void>;
|
|
81
88
|
settled(): Promise<void>;
|
|
82
89
|
};
|
|
83
|
-
export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
|
|
90
|
+
export declare function connectMdRuntime(port: RuntimePort, buildFile?: BuildFile): MdRuntimeClient;
|
|
84
91
|
export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
|
|
85
92
|
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
86
93
|
export { roomDraftRevision } from './identity.js';
|
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,
|
|
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,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAA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,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QACpD,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;KACnF,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAQF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,YAAU,GAAG,eAAe,CA2UxF;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,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { shownBy } from './media.js';
|
|
2
|
+
import { pageMetadataBlock } from './page-metadata.js';
|
|
2
3
|
import { observed } from './observation.js';
|
|
3
4
|
import { runtimeError } from './failure.js';
|
|
4
|
-
import {
|
|
5
|
+
import { blobOf, } 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
9
|
// 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.
|
|
@@ -21,9 +23,10 @@ function handed(url, name) {
|
|
|
21
23
|
anchor.click();
|
|
22
24
|
}
|
|
23
25
|
function refused(refusal) {
|
|
24
|
-
return runtimeError(refusal.code
|
|
26
|
+
return runtimeError(refusal.code);
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
const UNBUILT = () => Promise.resolve(null);
|
|
29
|
+
export function connectMdRuntime(port, buildFile = UNBUILT) {
|
|
27
30
|
let sequence = 0;
|
|
28
31
|
let refusal = null;
|
|
29
32
|
let ended = null;
|
|
@@ -35,13 +38,13 @@ export function connectMdRuntime(port) {
|
|
|
35
38
|
const send = (message) => {
|
|
36
39
|
port.postMessage(message);
|
|
37
40
|
};
|
|
38
|
-
function begin(id, topic, first) {
|
|
41
|
+
function begin(id, topic, input, first) {
|
|
39
42
|
const handle = observed(first, () => {
|
|
40
43
|
observations.delete(id);
|
|
41
44
|
if (refusal === null)
|
|
42
45
|
send({ kind: 'stop', id });
|
|
43
|
-
}, topic
|
|
44
|
-
observations.set(id, { topic, handle });
|
|
46
|
+
}, topic);
|
|
47
|
+
observations.set(id, { topic, input, handle });
|
|
45
48
|
return handle.observation;
|
|
46
49
|
}
|
|
47
50
|
function refuse(reported) {
|
|
@@ -53,7 +56,7 @@ export function connectMdRuntime(port) {
|
|
|
53
56
|
const failure = refused(reported);
|
|
54
57
|
for (const [id, waiting] of opening) {
|
|
55
58
|
if (waiting.topic === 'connection-refusal')
|
|
56
|
-
waiting.settle(begin(id, waiting.topic, reported));
|
|
59
|
+
waiting.settle(begin(id, waiting.topic, waiting.input, reported));
|
|
57
60
|
else
|
|
58
61
|
waiting.fail(failure);
|
|
59
62
|
}
|
|
@@ -79,7 +82,7 @@ export function connectMdRuntime(port) {
|
|
|
79
82
|
drawing?.();
|
|
80
83
|
}
|
|
81
84
|
port.addEventListener('message', (event) => {
|
|
82
|
-
const message =
|
|
85
|
+
const message = wireAnswer(event.data);
|
|
83
86
|
if (message === null)
|
|
84
87
|
return;
|
|
85
88
|
if (message.kind === 'refusal') {
|
|
@@ -105,7 +108,7 @@ export function connectMdRuntime(port) {
|
|
|
105
108
|
waiting.fail(runtimeError(message.code, message.message, message.retryable));
|
|
106
109
|
}
|
|
107
110
|
else
|
|
108
|
-
waiting.settle(begin(message.id, waiting.topic, message.value));
|
|
111
|
+
waiting.settle(begin(message.id, waiting.topic, waiting.input, message.value));
|
|
109
112
|
drawing?.();
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
@@ -141,11 +144,11 @@ export function connectMdRuntime(port) {
|
|
|
141
144
|
const id = (sequence += 1);
|
|
142
145
|
if (refusal !== null) {
|
|
143
146
|
return topic === 'connection-refusal'
|
|
144
|
-
? Promise.resolve(begin(id, topic, refusal))
|
|
147
|
+
? Promise.resolve(begin(id, topic, input, refusal))
|
|
145
148
|
: Promise.reject(refused(refusal));
|
|
146
149
|
}
|
|
147
150
|
return new Promise((settle, fail) => {
|
|
148
|
-
opening.set(id, { topic, settle, fail });
|
|
151
|
+
opening.set(id, { topic, input, settle, fail });
|
|
149
152
|
send({ kind: 'observe', id, topic, input });
|
|
150
153
|
drawing?.();
|
|
151
154
|
});
|
|
@@ -193,9 +196,7 @@ export function connectMdRuntime(port) {
|
|
|
193
196
|
const read = streamed(await ask('binaryFile.read', [room, path, revision]));
|
|
194
197
|
if (read.kind !== 'binary')
|
|
195
198
|
return read;
|
|
196
|
-
const copy = await
|
|
197
|
-
headers: { 'content-type': read.mediaType },
|
|
198
|
-
}).blob();
|
|
199
|
+
const copy = await blobOf(read);
|
|
199
200
|
const url = URL.createObjectURL(copy);
|
|
200
201
|
handed(url, path.slice(path.lastIndexOf('/') + 1));
|
|
201
202
|
setTimeout(() => URL.revokeObjectURL(url), HANDED_COPY_MS);
|
|
@@ -232,6 +233,7 @@ export function connectMdRuntime(port) {
|
|
|
232
233
|
}
|
|
233
234
|
const show = (room, path, revision) => ask('binaryFile.show', [room, path, revision]).then((shown) => streamed(shown));
|
|
234
235
|
return shownBy(show, {
|
|
236
|
+
buildFile,
|
|
235
237
|
rooms: () => ask('rooms', []),
|
|
236
238
|
query: ((query) => ask('query', [query])),
|
|
237
239
|
search: (request) => ask('search', [request]),
|
|
@@ -254,15 +256,26 @@ export function connectMdRuntime(port) {
|
|
|
254
256
|
read: (conversation, options) => ask('conversation.read', [conversation, options]),
|
|
255
257
|
create: (input) => ask('conversation.create', [input]),
|
|
256
258
|
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
|
-
|
|
261
|
-
|
|
259
|
+
answer: (conversation, answer, operation) => ask('conversation.answer', [conversation, answer, operation]),
|
|
260
|
+
interrupt: (conversation, operation) => ask('conversation.interrupt', [conversation, operation]),
|
|
261
|
+
kill: (conversation, operation) => ask('conversation.kill', [conversation, operation]),
|
|
262
|
+
delete: (conversation, operation) => ask('conversation.delete', [conversation, operation]),
|
|
263
|
+
takeOut: (conversation, message, operation) => ask('conversation.takeOut', [conversation, message, operation]),
|
|
264
|
+
decide: (request, decision, operation) => ask('conversation.decide', [request, decision, operation]),
|
|
265
|
+
rename: (conversation, name, operation) => ask('conversation.rename', [conversation, name, operation]),
|
|
266
|
+
option: (conversation, option, value, operation) => ask('conversation.option', [conversation, option, value, operation]),
|
|
267
|
+
retry: (conversation, message, operation) => ask('conversation.retry', [conversation, message, operation]),
|
|
268
|
+
pin: (figures) => ask('conversation.pin', [figures]),
|
|
269
|
+
openTurn: (conversation, turn) => ask('conversation.openTurn', [conversation, turn]),
|
|
270
|
+
dismissSuggestion: (conversation, suggestion) => ask('conversation.dismissSuggestion', [conversation, suggestion]),
|
|
271
|
+
pageMetadata: async (app, address) => pageMetadataBlock(app, address, [...observations]
|
|
272
|
+
.sort(([left], [right]) => left - right)
|
|
273
|
+
.flatMap(([, { topic, input }]) => (topic === 'query' ? [input[0]] : []))),
|
|
262
274
|
},
|
|
263
275
|
chatDraft: {
|
|
264
276
|
write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
|
|
265
277
|
prepend: (conversation, draft) => ask('chatDraft.prepend', [conversation, draft]),
|
|
278
|
+
append: (conversation, draft) => ask('chatDraft.append', [conversation, draft]),
|
|
266
279
|
discard: (conversation) => ask('chatDraft.discard', [conversation]),
|
|
267
280
|
},
|
|
268
281
|
history: (locator, path, query) => ask('history', [locator, path, query]),
|
|
@@ -273,11 +286,14 @@ export function connectMdRuntime(port) {
|
|
|
273
286
|
download,
|
|
274
287
|
},
|
|
275
288
|
call: (name, input) => ask('call', [name, input]),
|
|
289
|
+
answered: (operation) => ask('answered', [operation]),
|
|
276
290
|
reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
|
|
277
|
-
log: () => ask('log', []),
|
|
278
291
|
persistence: () => ask('persistence', []),
|
|
279
292
|
retry: () => ask('retry', []),
|
|
280
293
|
cleanUp: () => ask('cleanUp', []),
|
|
294
|
+
unsent: () => ask('unsent', []),
|
|
295
|
+
reset: () => ask('reset', []),
|
|
296
|
+
readAgain: () => ask('readAgain', []),
|
|
281
297
|
observe: ((topic, ...input) => watch(topic, input)),
|
|
282
298
|
reauthorize: () => ask('reauthorize', []),
|
|
283
299
|
settled,
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Document } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { ModelState } from './model.js';
|
|
1
|
+
import { type DefinitionOf, type Document, type ParseResult, type TypedPath } 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 = {
|
|
@@ -13,16 +14,37 @@ export type Composition = {
|
|
|
13
14
|
roots: readonly string[];
|
|
14
15
|
model: ModelState;
|
|
15
16
|
} | null;
|
|
17
|
+
typedPaths: readonly TypedPath[];
|
|
16
18
|
};
|
|
17
19
|
export type Composed = {
|
|
18
20
|
readonly composition: Composition;
|
|
19
21
|
readonly fingerprint: string;
|
|
20
22
|
};
|
|
21
23
|
export declare function composedOf(composition: Composition): Composed;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
type Selecting<M> = {
|
|
25
|
+
readonly model: M;
|
|
26
|
+
readonly selection: {
|
|
27
|
+
readonly roots: readonly string[];
|
|
28
|
+
readonly model: M;
|
|
29
|
+
} | null;
|
|
30
|
+
};
|
|
31
|
+
export declare function selected(composition: {
|
|
32
|
+
readonly selection: {
|
|
33
|
+
readonly roots: readonly string[];
|
|
34
|
+
} | null;
|
|
35
|
+
}, path: string): boolean;
|
|
36
|
+
export declare function governing<M>(composition: Selecting<M>, path: string): M;
|
|
37
|
+
export declare function definitionsAt(composition: Composition, path: string): DefinitionOf;
|
|
38
|
+
export declare function definitionsIn(room: {
|
|
39
|
+
readonly model: TypesResult;
|
|
40
|
+
readonly typedSelection: AppTypedSelection | null;
|
|
41
|
+
}, path: string, typedPaths: readonly TypedPath[]): DefinitionOf;
|
|
24
42
|
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition): Collection;
|
|
25
43
|
export declare function documentsOf(collection: Collection): Generator<number, Iterable<readonly [string, Document]>, void>;
|
|
26
44
|
export declare function validRoot(root: unknown): root is string;
|
|
45
|
+
export declare const UNTYPED = "any";
|
|
46
|
+
export declare function textType(read: ParseResult): string | undefined;
|
|
47
|
+
export declare function typedText(read: ParseResult): boolean;
|
|
27
48
|
export declare function available(composition: Composition): boolean;
|
|
49
|
+
export {};
|
|
28
50
|
//# 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,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,EAEf,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;AAc3F,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,QAAQ,CAS7D;AAED,KAAK,SAAS,CAAC,CAAC,IAAI;IAClB,QAAQ,CAAC,KAA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,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAE9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEpD;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAE3D"}
|
package/dist/collection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parse, VERSION } from '@agentshouse/mdmodel';
|
|
1
|
+
import { definitionAt, parse, VERSION, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { beneath, normalize } from './paths.js';
|
|
3
3
|
import { hashed } from './observation.js';
|
|
4
4
|
import { sortedKeys } from './shared.js';
|
|
@@ -33,6 +33,16 @@ export function governing(composition, path) {
|
|
|
33
33
|
? composition.selection.model
|
|
34
34
|
: composition.model;
|
|
35
35
|
}
|
|
36
|
+
function definitionsUnder(composition, path, typedPaths, typesOf) {
|
|
37
|
+
const types = typesOf(governing(composition, path));
|
|
38
|
+
return types === null ? () => undefined : definitionAt({ types }, path, typedPaths);
|
|
39
|
+
}
|
|
40
|
+
export function definitionsAt(composition, path) {
|
|
41
|
+
return definitionsUnder(composition, path, composition.typedPaths, (model) => model.status === 'unavailable' ? null : model.types);
|
|
42
|
+
}
|
|
43
|
+
export function definitionsIn(room, path, typedPaths) {
|
|
44
|
+
return definitionsUnder({ model: room.model, selection: room.typedSelection }, path, typedPaths, ({ types }) => types === null ? null : Object.fromEntries(types.map((type) => [type.name, type])));
|
|
45
|
+
}
|
|
36
46
|
export function collectionOf(text, composition) {
|
|
37
47
|
const parsed = new Map();
|
|
38
48
|
return {
|
|
@@ -44,7 +54,7 @@ export function collectionOf(text, composition) {
|
|
|
44
54
|
const content = text[path];
|
|
45
55
|
if (content === undefined)
|
|
46
56
|
return undefined;
|
|
47
|
-
const read = parse(content, path);
|
|
57
|
+
const read = parse(content, path, definitionsAt(composition, path));
|
|
48
58
|
parsed.set(path, read.ok ? read.document : null);
|
|
49
59
|
return read.ok ? read.document : undefined;
|
|
50
60
|
},
|
|
@@ -63,6 +73,13 @@ export function* documentsOf(collection) {
|
|
|
63
73
|
export function validRoot(root) {
|
|
64
74
|
return typeof root === 'string' && normalize(root) === root;
|
|
65
75
|
}
|
|
76
|
+
export const UNTYPED = 'any';
|
|
77
|
+
export function textType(read) {
|
|
78
|
+
return read.ok ? (read.document.type ?? UNTYPED) : undefined;
|
|
79
|
+
}
|
|
80
|
+
export function typedText(read) {
|
|
81
|
+
return (textType(read) ?? UNTYPED) !== UNTYPED;
|
|
82
|
+
}
|
|
66
83
|
export function available(composition) {
|
|
67
84
|
return composition.model.status !== 'unavailable';
|
|
68
85
|
}
|
package/dist/compile.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { sql } from '@agentshouse/mdmodel';
|
|
2
|
+
import { type Composition } from './collection.js';
|
|
1
3
|
import type { Plan, QueryRows } from './query.js';
|
|
2
|
-
import type { Connection
|
|
4
|
+
import type { Connection } from './tables.js';
|
|
3
5
|
export type QueryRoom = {
|
|
4
6
|
readonly locator: string;
|
|
5
7
|
readonly key: number;
|
|
8
|
+
readonly composition?: Composition;
|
|
6
9
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
10
|
+
type Fragment = sql.Fragment;
|
|
11
|
+
export declare const VISIBLE: (alias: string) => string;
|
|
12
|
+
export declare function within(alias: string, path: string): Fragment;
|
|
11
13
|
export type QueryAnswer = QueryRows & {
|
|
12
14
|
readonly more?: string;
|
|
13
15
|
};
|
|
14
|
-
export declare function selected(connection: Connection, plan: Plan, rooms: readonly QueryRoom[]): Fragment;
|
|
15
16
|
export declare function answerQuery(connection: Connection, plan: Plan, rooms: readonly QueryRoom[], budget?: number | null): QueryAnswer;
|
|
17
|
+
export {};
|
|
16
18
|
//# sourceMappingURL=compile.d.ts.map
|
package/dist/compile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,GAAG,EAQJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAG1D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAI7B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAAyD,CAAC;AAalG,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAM5D;AA2dD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA4ZjE,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,WAAW,CAUb"}
|