@agentshouse/app-bridge 0.1.0-c43d9cbcf6c8d → 0.1.0-c44cf2cfcc09a
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 +6 -6
- package/dist/index.d.ts +143 -399
- package/dist/mdmodel/body.d.ts +84 -0
- package/dist/mdmodel/definition.d.ts +20 -10
- package/dist/mdmodel/document.d.ts +14 -7
- package/dist/mdmodel/event.d.ts +76 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/fields.d.ts +1 -1
- package/dist/mdmodel/index.d.ts +27 -13
- package/dist/mdmodel/kinds.d.ts +17 -0
- package/dist/mdmodel/markdown.d.ts +74 -0
- package/dist/mdmodel/paths.d.ts +10 -1
- package/dist/mdmodel/pattern.d.ts +9 -0
- package/dist/mdmodel/query/language.d.ts +253 -0
- package/dist/mdmodel/query/match.d.ts +13 -0
- package/dist/mdmodel/query/rows.d.ts +31 -0
- package/dist/mdmodel/query/sql.d.ts +38 -0
- package/dist/mdmodel/reserved.d.ts +5 -0
- package/dist/mdmodel/types.d.ts +21 -7
- package/dist/mdmodel/validate.d.ts +10 -6
- package/dist/mdruntime/actions.d.ts +25 -0
- package/dist/mdruntime/adapter.d.ts +71 -69
- package/dist/mdruntime/attached-model.d.ts +7 -0
- package/dist/mdruntime/bootstrap.d.ts +43 -0
- package/dist/mdruntime/cell.d.ts +5 -0
- package/dist/mdruntime/chain.d.ts +2 -1
- package/dist/mdruntime/change-set.d.ts +4 -0
- package/dist/mdruntime/change.d.ts +1 -0
- package/dist/mdruntime/client.d.ts +27 -19
- package/dist/mdruntime/collection.d.ts +23 -4
- package/dist/mdruntime/compile.d.ts +8 -6
- package/dist/mdruntime/conversation-live.d.ts +139 -0
- package/dist/mdruntime/conversation-row.d.ts +32 -0
- package/dist/mdruntime/conversation.d.ts +59 -45
- package/dist/mdruntime/declaration.d.ts +9 -0
- package/dist/mdruntime/durability.d.ts +18 -0
- package/dist/mdruntime/failure.d.ts +3 -0
- package/dist/mdruntime/figures.d.ts +48 -0
- package/dist/mdruntime/holdings.d.ts +28 -0
- package/dist/mdruntime/identity.d.ts +0 -1
- package/dist/mdruntime/listing.d.ts +47 -0
- package/dist/mdruntime/live.d.ts +22 -0
- package/dist/mdruntime/log.d.ts +5 -0
- package/dist/mdruntime/media.d.ts +1 -1
- package/dist/mdruntime/messages.d.ts +24 -3
- package/dist/mdruntime/model.d.ts +2 -10
- package/dist/mdruntime/observation.d.ts +2 -2
- package/dist/mdruntime/opened.d.ts +1 -1
- package/dist/mdruntime/outcome.d.ts +7 -1
- package/dist/mdruntime/overlay.d.ts +6 -1
- package/dist/mdruntime/preparation.d.ts +19 -0
- package/dist/mdruntime/presence.d.ts +51 -0
- package/dist/mdruntime/query.d.ts +13 -209
- package/dist/mdruntime/reach.d.ts +14 -12
- package/dist/mdruntime/readiness.d.ts +0 -3
- package/dist/mdruntime/reads.d.ts +38 -0
- package/dist/mdruntime/recovery.d.ts +3 -1
- package/dist/mdruntime/refresh.d.ts +26 -0
- package/dist/mdruntime/replica.d.ts +11 -16
- package/dist/mdruntime/retried.d.ts +29 -0
- package/dist/mdruntime/room-draft.d.ts +7 -8
- package/dist/mdruntime/room-drafts.d.ts +23 -0
- package/dist/mdruntime/runtime.d.ts +35 -0
- package/dist/mdruntime/save.d.ts +42 -86
- package/dist/mdruntime/saves.d.ts +31 -0
- package/dist/mdruntime/search.d.ts +12 -63
- package/dist/mdruntime/seed.d.ts +11 -2
- package/dist/mdruntime/socket/admission.d.ts +6 -0
- package/dist/mdruntime/socket/answers.d.ts +5 -0
- package/dist/mdruntime/socket/lanes.d.ts +27 -0
- package/dist/mdruntime/socket/session.d.ts +37 -0
- package/dist/mdruntime/socket.d.ts +67 -0
- package/dist/mdruntime/source.d.ts +53 -0
- package/dist/mdruntime/status.d.ts +0 -2
- package/dist/mdruntime/store/installs.d.ts +29 -0
- package/dist/mdruntime/store/readiness.d.ts +9 -0
- package/dist/mdruntime/store/records.d.ts +212 -0
- package/dist/mdruntime/store/room-held.d.ts +7 -0
- package/dist/mdruntime/store/space.d.ts +10 -0
- package/dist/mdruntime/store/watchers.d.ts +16 -0
- package/dist/mdruntime/store/writes.d.ts +23 -0
- package/dist/mdruntime/store.d.ts +112 -145
- package/dist/mdruntime/stored.d.ts +59 -33
- package/dist/mdruntime/surface.d.ts +88 -0
- package/dist/mdruntime/tables.d.ts +116 -29
- package/dist/mdruntime/tallies.d.ts +17 -0
- package/dist/mdruntime/transfer.d.ts +4 -0
- package/dist/mdruntime/wire.d.ts +69 -5
- package/dist/session-content/bounds.d.ts +7 -0
- package/dist/session-content/check.d.ts +18 -0
- package/dist/session-content/index.d.ts +7 -0
- package/dist/session-content/parts.d.ts +102 -0
- package/dist/session-content/state.d.ts +61 -0
- package/dist/session-content/turn.d.ts +328 -0
- package/dist/test-host.js +1 -1
- package/docs/families.md +24 -17
- package/package.json +2 -2
- package/dist/mdmodel/blocks.d.ts +0 -10
- package/dist/mdmodel/condition.d.ts +0 -179
- package/dist/mdmodel/links.d.ts +0 -28
- package/dist/mdmodel/profile.d.ts +0 -5
- package/dist/mdruntime/connection.d.ts +0 -152
- package/dist/mdruntime/fulltext.d.ts +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HeadChange } from './adapter.js';
|
|
1
|
+
import type { SavedFacts, HeadChange } from './adapter.js';
|
|
2
2
|
import { type Composed, type Composition } from './collection.js';
|
|
3
3
|
import type { HeldBinary } from './overlay.js';
|
|
4
4
|
import type { Connection } from './tables.js';
|
|
@@ -10,8 +10,10 @@ export type StoredEntry = {
|
|
|
10
10
|
readonly binary: HeldBinary | null;
|
|
11
11
|
readonly revision: string | null;
|
|
12
12
|
readonly fileId: string | null;
|
|
13
|
+
readonly created: string | null;
|
|
13
14
|
readonly change: HeadChange | null;
|
|
14
15
|
readonly written: string | null;
|
|
16
|
+
readonly facts: SavedFacts | null;
|
|
15
17
|
};
|
|
16
18
|
export type OverlayEntry = StoredEntry & {
|
|
17
19
|
readonly present: boolean;
|
|
@@ -27,35 +29,46 @@ export type TypedEntry = {
|
|
|
27
29
|
export type Referrer = {
|
|
28
30
|
readonly path: string;
|
|
29
31
|
readonly target: string;
|
|
30
|
-
readonly kind: string;
|
|
31
32
|
};
|
|
32
|
-
export type
|
|
33
|
-
readonly key: number;
|
|
33
|
+
export type HeldRoomRow = {
|
|
34
34
|
readonly locator: string;
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
35
|
+
readonly key: number;
|
|
36
|
+
readonly record: string;
|
|
37
|
+
readonly indexed: boolean;
|
|
38
|
+
readonly documents: number;
|
|
38
39
|
};
|
|
39
|
-
export type
|
|
40
|
+
export type HeldRoomWork = {
|
|
41
|
+
readonly room: (HeldRoomRow & {
|
|
42
|
+
readonly overlaid: readonly string[];
|
|
43
|
+
}) | null;
|
|
44
|
+
readonly queue: readonly {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly batch: string;
|
|
47
|
+
readonly state: string;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
50
|
+
export type Covering = {
|
|
40
51
|
readonly rooms: readonly {
|
|
41
52
|
readonly locator: string;
|
|
42
53
|
readonly key: number;
|
|
43
|
-
readonly
|
|
54
|
+
readonly transfer: string;
|
|
55
|
+
readonly roomVersion: string;
|
|
56
|
+
readonly indexed: boolean;
|
|
57
|
+
readonly documents: number;
|
|
58
|
+
readonly bytes: number;
|
|
59
|
+
readonly offline: string;
|
|
44
60
|
}[];
|
|
45
|
-
readonly
|
|
46
|
-
readonly facts: Readonly<Record<string, string>>;
|
|
47
|
-
readonly presentation: readonly {
|
|
48
|
-
readonly app: string;
|
|
49
|
-
readonly value: string;
|
|
50
|
-
}[];
|
|
51
|
-
readonly overlaid: readonly {
|
|
52
|
-
readonly key: number;
|
|
53
|
-
readonly path: string;
|
|
54
|
-
}[];
|
|
55
|
-
readonly erasing: readonly {
|
|
56
|
-
readonly key: number;
|
|
61
|
+
readonly queues: readonly {
|
|
57
62
|
readonly locator: string;
|
|
63
|
+
readonly ids: readonly string[];
|
|
58
64
|
}[];
|
|
65
|
+
};
|
|
66
|
+
export type HeldLocators = {
|
|
67
|
+
readonly held: readonly string[];
|
|
68
|
+
readonly staged: readonly string[];
|
|
69
|
+
};
|
|
70
|
+
export type ReplicaOpened = {
|
|
71
|
+
readonly erasing: boolean;
|
|
59
72
|
readonly orphans: readonly number[];
|
|
60
73
|
};
|
|
61
74
|
export type RoomCommit = {
|
|
@@ -78,14 +91,9 @@ export type RoomCommit = {
|
|
|
78
91
|
};
|
|
79
92
|
};
|
|
80
93
|
export type Committed = {
|
|
81
|
-
readonly counts: Readonly<Record<string, number>>;
|
|
82
94
|
readonly changed: Readonly<Record<string, readonly string[] | null>>;
|
|
83
95
|
readonly indexed: Readonly<Record<string, boolean>>;
|
|
84
96
|
};
|
|
85
|
-
export type CountedRoom = {
|
|
86
|
-
readonly key: number;
|
|
87
|
-
readonly roots: readonly string[];
|
|
88
|
-
};
|
|
89
97
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
90
98
|
export declare function stage(connection: Connection, request: {
|
|
91
99
|
readonly locator: string;
|
|
@@ -94,7 +102,20 @@ export declare function stage(connection: Connection, request: {
|
|
|
94
102
|
readonly fingerprint: string;
|
|
95
103
|
readonly entries: readonly StoredEntry[];
|
|
96
104
|
readonly folders: readonly string[];
|
|
105
|
+
readonly part: string | null;
|
|
97
106
|
}): number;
|
|
107
|
+
export type Resumed = {
|
|
108
|
+
readonly key: number | null;
|
|
109
|
+
readonly transfer: string;
|
|
110
|
+
readonly staged: readonly string[];
|
|
111
|
+
};
|
|
112
|
+
export declare function resume(connection: Connection, request: {
|
|
113
|
+
readonly locator: string;
|
|
114
|
+
readonly transfer: string;
|
|
115
|
+
readonly fingerprint: string;
|
|
116
|
+
readonly parts: readonly string[];
|
|
117
|
+
readonly published: number | null;
|
|
118
|
+
}): Resumed;
|
|
98
119
|
export declare function refreshing(connection: Connection, request: {
|
|
99
120
|
readonly key: number;
|
|
100
121
|
readonly composed: Composed;
|
|
@@ -104,7 +125,6 @@ export declare function refreshing(connection: Connection, request: {
|
|
|
104
125
|
readonly folderRemovals: readonly string[];
|
|
105
126
|
}): null;
|
|
106
127
|
export declare function unrefresh(connection: Connection, key: number): null;
|
|
107
|
-
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
108
128
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
109
129
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
110
130
|
export declare function abandon(connection: Connection, locator: string): null;
|
|
@@ -118,12 +138,18 @@ export declare function rederive(connection: Connection, key: number, composed:
|
|
|
118
138
|
};
|
|
119
139
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
120
140
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
121
|
-
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]
|
|
122
|
-
export declare function
|
|
123
|
-
readonly path: string;
|
|
124
|
-
readonly revision: string;
|
|
125
|
-
}[];
|
|
126
|
-
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
141
|
+
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[]): Referrer[];
|
|
142
|
+
export declare function folders(connection: Connection, key: number, list: readonly string[]): string[];
|
|
127
143
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
128
144
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
145
|
+
export declare function heldRooms(connection: Connection, locators: readonly string[] | null): readonly HeldRoomRow[];
|
|
146
|
+
export declare function heldRoom(connection: Connection, locator: string): HeldRoomRow | null;
|
|
147
|
+
export declare function overlaid(connection: Connection, key: number): readonly string[];
|
|
148
|
+
export declare function covering(connection: Connection): Covering['rooms'];
|
|
149
|
+
export declare function offlineMode(connection: Connection, locator: string): string | null;
|
|
150
|
+
export declare function stagedLocators(connection: Connection): readonly string[];
|
|
151
|
+
export declare function heldLocators(connection: Connection): readonly string[];
|
|
152
|
+
export declare function demoted(connection: Connection): null;
|
|
153
|
+
export declare function facts(connection: Connection): Readonly<Record<string, string>>;
|
|
154
|
+
export declare function presentation(connection: Connection, app: string): string | null;
|
|
129
155
|
export declare function ended(connection: Connection): void;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
|
|
2
|
+
import { type HistoryQuery } from './actions.js';
|
|
3
|
+
import type { Member, ServiceMode } from './adapter.js';
|
|
4
|
+
import type { WrittenBy } from './change.js';
|
|
5
|
+
import { type ChatDraftSurface, type ConversationEntry, type ConversationAgent, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
6
|
+
import type { UnsentWork } from './durability.js';
|
|
7
|
+
import type { FiguresResult } from './figures.js';
|
|
8
|
+
import { type Holdings } from './holdings.js';
|
|
9
|
+
import { type AppRoom } from './listing.js';
|
|
10
|
+
import { type TypesResult } from './model.js';
|
|
11
|
+
import { type Observation } from './observation.js';
|
|
12
|
+
import type { HistoryAnswer, QueueEntry, Resolution, CallResult } from './outcome.js';
|
|
13
|
+
import { type ReadinessPort } from './preparation.js';
|
|
14
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
15
|
+
import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
|
|
16
|
+
import type { Persistence, Readiness } from './readiness.js';
|
|
17
|
+
import type { ObservedRead } from './reads.js';
|
|
18
|
+
import type { RoomDraft } from './room-draft.js';
|
|
19
|
+
import { type PresentationSurface, type RoomDraftSurface } from './room-drafts.js';
|
|
20
|
+
import type { Runtime } from './runtime.js';
|
|
21
|
+
import { type BinaryFileSurface, type SavedParts, type SavedRoomDraft, type SaveResult } from './saves.js';
|
|
22
|
+
import type { SearchRequest, SearchResult } from './search.js';
|
|
23
|
+
import { type EntrySeed } from './seed.js';
|
|
24
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
25
|
+
import type { SyncStatus } from './status.js';
|
|
26
|
+
export type RoomSchemas = {
|
|
27
|
+
collection: TypesResult;
|
|
28
|
+
typedSelection: TypesResult | null;
|
|
29
|
+
};
|
|
30
|
+
export type MdRuntime = {
|
|
31
|
+
loaded(): Promise<void>;
|
|
32
|
+
rooms(): Promise<readonly AppRoom[]>;
|
|
33
|
+
query: {
|
|
34
|
+
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
35
|
+
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
36
|
+
};
|
|
37
|
+
search(request: SearchRequest): Promise<SearchResult>;
|
|
38
|
+
types(locator: string): Promise<RoomSchemas>;
|
|
39
|
+
roomDraft: RoomDraftSurface;
|
|
40
|
+
conversation: ConversationSurface;
|
|
41
|
+
chatDraft: ChatDraftSurface;
|
|
42
|
+
presentation: PresentationSurface;
|
|
43
|
+
save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
44
|
+
saveParts(room: string, parts: readonly SavedParts[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
45
|
+
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
46
|
+
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
47
|
+
binaryFile: BinaryFileSurface;
|
|
48
|
+
call(name: string, input: unknown): Promise<CallResult>;
|
|
49
|
+
answered(operation: string): Promise<boolean>;
|
|
50
|
+
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
51
|
+
log(): string;
|
|
52
|
+
persistence(): boolean;
|
|
53
|
+
retry(): Promise<void>;
|
|
54
|
+
cleanUp(): Promise<number>;
|
|
55
|
+
unsent(): Promise<readonly UnsentWork[]>;
|
|
56
|
+
reset(): Promise<void>;
|
|
57
|
+
readAgain(): Promise<void>;
|
|
58
|
+
observe: {
|
|
59
|
+
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
60
|
+
(topic: 'readiness'): Promise<Observation<Readiness>>;
|
|
61
|
+
(topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;
|
|
62
|
+
(topic: 'storage-loss'): Promise<Observation<string | null>>;
|
|
63
|
+
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
64
|
+
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
65
|
+
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
66
|
+
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
67
|
+
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
68
|
+
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
69
|
+
(topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
|
|
70
|
+
(topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
|
|
71
|
+
(topic: 'presentation', app: string): Promise<Observation<unknown>>;
|
|
72
|
+
(topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
|
|
73
|
+
(topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
|
|
74
|
+
(topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
|
|
75
|
+
(topic: 'figures'): Promise<Observation<FiguresResult>>;
|
|
76
|
+
(topic: 'holdings'): Promise<Observation<Holdings>>;
|
|
77
|
+
(topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
|
|
78
|
+
};
|
|
79
|
+
reauthorize(): Promise<void>;
|
|
80
|
+
};
|
|
81
|
+
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'figures' | 'holdings' | 'read';
|
|
82
|
+
export type ComposedRuntime = RuntimeView & {
|
|
83
|
+
seed(entry: EntrySeed): void;
|
|
84
|
+
stop(): Promise<void>;
|
|
85
|
+
persisted(answer: Persistence): void;
|
|
86
|
+
within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
87
|
+
};
|
|
88
|
+
export declare function composedRuntime(runtime: Runtime): ComposedRuntime;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
2
|
import type { Composed } from './collection.js';
|
|
3
|
-
import {
|
|
4
|
-
import { type ConversationWrite, type HeldConversation, type MessageWindow } from './messages.js';
|
|
5
|
-
import type { Plan } from './query.js';
|
|
6
|
-
import type
|
|
7
|
-
import { type
|
|
8
|
-
|
|
3
|
+
import type { UnsentWork } from './durability.js';
|
|
4
|
+
import { type ConversationWrite, type HeldConversation, type HeldRow, type MessageWindow } from './messages.js';
|
|
5
|
+
import type { GroupTotal, Plan } from './query.js';
|
|
6
|
+
import { type ReadAt } from './reads.js';
|
|
7
|
+
import { type ConversationTally, type RoomTally } from './tallies.js';
|
|
8
|
+
import { type Committed, type Covering, type HeldEntry, type HeldLocators, type HeldRoomRow, type HeldRoomWork, type ReplicaOpened, type Referrer, type Resumed, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
9
|
+
export type { Committed, Covering, HeldEntry, HeldLocators, HeldRoomRow, HeldRoomWork, OverlayEntry, ReplicaOpened, Referrer, Resumed, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
9
10
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
11
|
+
export type { ConversationWrite, HeldConversation, HeldRow, MessageWindow } from './messages.js';
|
|
12
|
+
export type { ConversationTally, RoomTally } from './tallies.js';
|
|
12
13
|
export type Value = string | number | bigint | Uint8Array | null;
|
|
13
14
|
export type Row = Readonly<Record<string, Value>>;
|
|
14
15
|
export interface Connection {
|
|
@@ -36,6 +37,10 @@ export interface SqliteStatement {
|
|
|
36
37
|
}
|
|
37
38
|
export interface SqliteDatabase {
|
|
38
39
|
readonly pointer: number;
|
|
40
|
+
createFunction(name: string, run: (context: number, ...values: Value[]) => Value, options: {
|
|
41
|
+
readonly arity: number;
|
|
42
|
+
readonly deterministic: true;
|
|
43
|
+
}): unknown;
|
|
39
44
|
exec(options: {
|
|
40
45
|
readonly sql: string;
|
|
41
46
|
readonly bind: readonly Value[];
|
|
@@ -47,7 +52,7 @@ export interface SqliteDatabase {
|
|
|
47
52
|
export declare function sqliteConnection(engine: SqliteEngine, database: SqliteDatabase): Connection;
|
|
48
53
|
export declare const FILE_PART_BYTES = 1048576;
|
|
49
54
|
export declare const RUNTIME_TABLES: readonly string[];
|
|
50
|
-
export type AuthoredFact = 'holder' | '
|
|
55
|
+
export type AuthoredFact = 'holder' | 'generation';
|
|
51
56
|
export type StoredFile = {
|
|
52
57
|
readonly key: string;
|
|
53
58
|
readonly blob: Blob;
|
|
@@ -63,6 +68,8 @@ export type KeptPending = {
|
|
|
63
68
|
readonly batch: string;
|
|
64
69
|
readonly state: string;
|
|
65
70
|
readonly files: readonly string[];
|
|
71
|
+
readonly paths: readonly string[];
|
|
72
|
+
readonly moving: boolean;
|
|
66
73
|
};
|
|
67
74
|
export type KeptRecord = {
|
|
68
75
|
readonly record: string;
|
|
@@ -90,11 +97,31 @@ export type HeldQueues = {
|
|
|
90
97
|
readonly state: string;
|
|
91
98
|
}[];
|
|
92
99
|
};
|
|
100
|
+
export type HeldStatus = {
|
|
101
|
+
readonly queued: readonly string[];
|
|
102
|
+
readonly lastCompleted: string | null;
|
|
103
|
+
readonly changes: readonly {
|
|
104
|
+
readonly locator: string;
|
|
105
|
+
readonly path: string;
|
|
106
|
+
}[];
|
|
107
|
+
readonly resets: readonly {
|
|
108
|
+
readonly locator: string;
|
|
109
|
+
readonly reset: string;
|
|
110
|
+
}[];
|
|
111
|
+
readonly returned: readonly string[];
|
|
112
|
+
};
|
|
93
113
|
export type OpenedFile = {
|
|
94
114
|
readonly key: string;
|
|
95
115
|
readonly byteLength: number;
|
|
96
116
|
readonly mediaType: string;
|
|
97
117
|
};
|
|
118
|
+
export type OpenedRoom = GroupTotal & {
|
|
119
|
+
readonly room: string;
|
|
120
|
+
};
|
|
121
|
+
export type OpenedHeld = {
|
|
122
|
+
readonly rooms: readonly OpenedRoom[];
|
|
123
|
+
readonly cleanable: number;
|
|
124
|
+
};
|
|
98
125
|
type Asked<A, R> = {
|
|
99
126
|
readonly asked: A;
|
|
100
127
|
readonly answer: R;
|
|
@@ -107,14 +134,36 @@ export type AuthoredWrite = {
|
|
|
107
134
|
readonly writes: readonly AuthoredRows[];
|
|
108
135
|
readonly files: readonly StoredFile[];
|
|
109
136
|
readonly whole: boolean;
|
|
110
|
-
readonly discards?: readonly string[];
|
|
111
137
|
};
|
|
112
138
|
export interface RuntimeRequests {
|
|
113
|
-
readonly 'authored.
|
|
114
|
-
readonly 'authored.
|
|
139
|
+
readonly 'authored.status': Asked<Nothing, HeldStatus>;
|
|
140
|
+
readonly 'authored.moving': Asked<Nothing, HeldQueues>;
|
|
141
|
+
readonly 'authored.pending': Asked<{
|
|
142
|
+
readonly locator: string;
|
|
143
|
+
readonly id: string;
|
|
144
|
+
}, {
|
|
145
|
+
readonly state: string | null;
|
|
146
|
+
readonly room: boolean;
|
|
147
|
+
}>;
|
|
148
|
+
readonly 'authored.batch': Asked<{
|
|
149
|
+
readonly locator: string;
|
|
150
|
+
readonly id: string;
|
|
151
|
+
}, string | null>;
|
|
152
|
+
readonly 'authored.order': Asked<{
|
|
153
|
+
readonly locator: string;
|
|
154
|
+
}, readonly string[]>;
|
|
155
|
+
readonly 'authored.queued': Asked<Nothing, readonly string[]>;
|
|
156
|
+
readonly 'authored.roomDrafts': Asked<{
|
|
157
|
+
readonly locator: string | null;
|
|
158
|
+
readonly paths: readonly string[] | null;
|
|
159
|
+
}, readonly string[]>;
|
|
160
|
+
readonly 'authored.chatDraft.read': Asked<{
|
|
161
|
+
readonly conversation: string;
|
|
162
|
+
}, string | null>;
|
|
115
163
|
readonly 'authored.chatDrafts': Asked<Nothing, readonly string[]>;
|
|
116
164
|
readonly 'authored.calls': Asked<Nothing, readonly string[]>;
|
|
117
165
|
readonly 'authored.fences': Asked<Nothing, readonly string[]>;
|
|
166
|
+
readonly 'authored.unsent': Asked<Nothing, readonly UnsentWork[]>;
|
|
118
167
|
readonly 'authored.fact': Asked<{
|
|
119
168
|
readonly name: AuthoredFact;
|
|
120
169
|
}, string | null>;
|
|
@@ -156,11 +205,32 @@ export interface RuntimeRequests {
|
|
|
156
205
|
readonly holder: string | null;
|
|
157
206
|
}, boolean>;
|
|
158
207
|
readonly 'replica.open': Asked<Nothing, ReplicaOpened>;
|
|
208
|
+
readonly 'replica.rooms': Asked<{
|
|
209
|
+
readonly locators: readonly string[] | null;
|
|
210
|
+
}, readonly HeldRoomRow[]>;
|
|
211
|
+
readonly 'replica.room': Asked<{
|
|
212
|
+
readonly locator: string;
|
|
213
|
+
}, HeldRoomWork>;
|
|
214
|
+
readonly 'replica.covering': Asked<Nothing, Covering>;
|
|
215
|
+
readonly 'replica.offline': Asked<{
|
|
216
|
+
readonly locator: string;
|
|
217
|
+
}, string | null>;
|
|
218
|
+
readonly 'replica.held': Asked<Nothing, HeldLocators>;
|
|
219
|
+
readonly 'replica.demote': Asked<Nothing, null>;
|
|
220
|
+
readonly 'replica.facts': Asked<Nothing, Readonly<Record<string, string>>>;
|
|
221
|
+
readonly 'replica.presentation': Asked<{
|
|
222
|
+
readonly app: string;
|
|
223
|
+
}, string | null>;
|
|
159
224
|
readonly 'replica.query': Asked<{
|
|
160
225
|
readonly plan: Plan;
|
|
161
226
|
readonly rooms: readonly QueryRoom[];
|
|
162
227
|
readonly budget: number | null;
|
|
163
228
|
}, QueryAnswer>;
|
|
229
|
+
readonly 'replica.tallies': Asked<{
|
|
230
|
+
readonly totals: Plan;
|
|
231
|
+
readonly rooms: readonly QueryRoom[];
|
|
232
|
+
readonly since: string;
|
|
233
|
+
}, readonly RoomTally[]>;
|
|
164
234
|
readonly 'replica.entries': Asked<{
|
|
165
235
|
readonly key: number;
|
|
166
236
|
readonly view: View;
|
|
@@ -175,20 +245,9 @@ export interface RuntimeRequests {
|
|
|
175
245
|
readonly key: number;
|
|
176
246
|
readonly view: View;
|
|
177
247
|
readonly targets: readonly string[];
|
|
178
|
-
readonly kinds: readonly string[];
|
|
179
248
|
}, readonly Referrer[]>;
|
|
180
|
-
readonly 'replica.files': Asked<{
|
|
181
|
-
readonly key: number;
|
|
182
|
-
readonly view: View;
|
|
183
|
-
readonly after: string | null;
|
|
184
|
-
readonly limit: number;
|
|
185
|
-
}, readonly {
|
|
186
|
-
readonly path: string;
|
|
187
|
-
readonly revision: string;
|
|
188
|
-
}[]>;
|
|
189
249
|
readonly 'replica.folders': Asked<{
|
|
190
250
|
readonly key: number;
|
|
191
|
-
readonly view: View;
|
|
192
251
|
readonly paths: readonly string[];
|
|
193
252
|
}, readonly string[]>;
|
|
194
253
|
readonly 'replica.typedWithin': Asked<{
|
|
@@ -197,10 +256,6 @@ export interface RuntimeRequests {
|
|
|
197
256
|
readonly roots: readonly string[];
|
|
198
257
|
readonly within: boolean;
|
|
199
258
|
}, boolean>;
|
|
200
|
-
readonly 'replica.counts': Asked<{
|
|
201
|
-
readonly rooms: readonly CountedRoom[];
|
|
202
|
-
}, readonly number[]>;
|
|
203
|
-
readonly 'replica.search': Asked<SearchAsk, SearchWindow>;
|
|
204
259
|
readonly 'replica.stage': Asked<{
|
|
205
260
|
readonly locator: string;
|
|
206
261
|
readonly transfer: string;
|
|
@@ -208,7 +263,15 @@ export interface RuntimeRequests {
|
|
|
208
263
|
readonly fingerprint: string;
|
|
209
264
|
readonly entries: readonly StoredEntry[];
|
|
210
265
|
readonly folders: readonly string[];
|
|
266
|
+
readonly part: string | null;
|
|
211
267
|
}, number | null>;
|
|
268
|
+
readonly 'replica.resume': Asked<{
|
|
269
|
+
readonly locator: string;
|
|
270
|
+
readonly transfer: string;
|
|
271
|
+
readonly fingerprint: string;
|
|
272
|
+
readonly parts: readonly string[];
|
|
273
|
+
readonly published: number | null;
|
|
274
|
+
}, Resumed | null>;
|
|
212
275
|
readonly 'replica.refresh': Asked<{
|
|
213
276
|
readonly key: number;
|
|
214
277
|
readonly composed: Composed;
|
|
@@ -236,6 +299,9 @@ export interface RuntimeRequests {
|
|
|
236
299
|
readonly 'replica.abandon': Asked<{
|
|
237
300
|
readonly locator: string;
|
|
238
301
|
}, null>;
|
|
302
|
+
readonly 'replica.unfence': Asked<{
|
|
303
|
+
readonly locators: readonly string[];
|
|
304
|
+
}, readonly string[]>;
|
|
239
305
|
readonly 'replica.release': Asked<{
|
|
240
306
|
readonly key: number;
|
|
241
307
|
}, null>;
|
|
@@ -284,28 +350,47 @@ export interface RuntimeRequests {
|
|
|
284
350
|
readonly key: string;
|
|
285
351
|
}, null>;
|
|
286
352
|
readonly 'opened.clean': Asked<Nothing, number>;
|
|
353
|
+
readonly 'opened.held': Asked<Nothing, OpenedHeld>;
|
|
287
354
|
readonly 'file.part': Asked<{
|
|
288
355
|
readonly key: string;
|
|
289
356
|
readonly part: number;
|
|
290
357
|
}, Uint8Array | null>;
|
|
291
|
-
readonly 'conversation.held': Asked<
|
|
358
|
+
readonly 'conversation.held': Asked<{
|
|
359
|
+
readonly conversations: readonly string[] | null;
|
|
360
|
+
}, readonly HeldConversation[]>;
|
|
292
361
|
readonly 'conversation.keep': Asked<ConversationWrite, null>;
|
|
293
362
|
readonly 'conversation.window': Asked<{
|
|
294
363
|
readonly conversation: string;
|
|
295
364
|
readonly limit: number;
|
|
296
365
|
readonly before: readonly [string, string] | null;
|
|
366
|
+
readonly phrase: string | null;
|
|
297
367
|
}, MessageWindow>;
|
|
298
368
|
readonly 'conversation.count': Asked<{
|
|
299
369
|
readonly conversation: string;
|
|
370
|
+
readonly phrase: string | null;
|
|
300
371
|
}, number>;
|
|
301
372
|
readonly 'conversation.turn': Asked<{
|
|
302
373
|
readonly conversation: string;
|
|
303
374
|
readonly turn: string;
|
|
304
375
|
}, boolean>;
|
|
376
|
+
readonly 'conversation.rows': Asked<{
|
|
377
|
+
readonly conversations: readonly string[];
|
|
378
|
+
}, readonly HeldRow[]>;
|
|
379
|
+
readonly 'conversation.tallies': Asked<{
|
|
380
|
+
readonly conversations: readonly string[] | null;
|
|
381
|
+
readonly since: string;
|
|
382
|
+
}, readonly ConversationTally[]>;
|
|
305
383
|
readonly 'conversation.drop': Asked<{
|
|
306
384
|
readonly conversations: readonly string[];
|
|
307
385
|
}, null>;
|
|
308
386
|
readonly 'space.probe': Asked<Nothing, null>;
|
|
387
|
+
readonly 'read.stored': Asked<ReadAt, string | null>;
|
|
388
|
+
readonly 'read.keep': Asked<ReadAt & {
|
|
389
|
+
readonly answer: string;
|
|
390
|
+
}, null>;
|
|
391
|
+
readonly 'read.builds': Asked<{
|
|
392
|
+
readonly build: string;
|
|
393
|
+
}, null>;
|
|
309
394
|
}
|
|
310
395
|
export type RuntimeKind = keyof RuntimeRequests;
|
|
311
396
|
export type RuntimeRequest<K extends RuntimeKind = RuntimeKind> = {
|
|
@@ -320,5 +405,7 @@ export interface RuntimeDatabase {
|
|
|
320
405
|
export declare function isRuntime(request: {
|
|
321
406
|
readonly kind: string;
|
|
322
407
|
}): request is RuntimeRequest;
|
|
323
|
-
export declare function readsRuntime(request:
|
|
408
|
+
export declare function readsRuntime(request: {
|
|
409
|
+
readonly kind: string;
|
|
410
|
+
}): boolean;
|
|
324
411
|
export declare function answerRuntime(connection: Connection, request: RuntimeRequest, spool: FileSpool): unknown;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type QueryRoom } from './compile.js';
|
|
2
|
+
import type { GroupTotal, Plan } from './query.js';
|
|
3
|
+
import type { Connection } from './tables.js';
|
|
4
|
+
export type RoomTally = {
|
|
5
|
+
readonly key: number;
|
|
6
|
+
readonly documents: GroupTotal;
|
|
7
|
+
readonly files: GroupTotal;
|
|
8
|
+
readonly documentTimes: readonly (readonly [string | null, string | null])[];
|
|
9
|
+
readonly chatTimes: readonly string[];
|
|
10
|
+
readonly messageTimes: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
export type ConversationTally = {
|
|
13
|
+
readonly conversation: string;
|
|
14
|
+
readonly said: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function roomTallies(connection: Connection, totals: Plan, rooms: readonly QueryRoom[], since: string): RoomTally[];
|
|
17
|
+
export declare function conversationTallies(connection: Connection, conversations: readonly string[] | null, since: string): ConversationTally[];
|
package/dist/mdruntime/wire.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectionRefusal } from './
|
|
1
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
2
2
|
import type { Described } from './failure.js';
|
|
3
3
|
export type RuntimePort = {
|
|
4
4
|
postMessage(message: unknown): void;
|
|
@@ -7,7 +7,7 @@ export type RuntimePort = {
|
|
|
7
7
|
}) => void): void;
|
|
8
8
|
start(): void;
|
|
9
9
|
};
|
|
10
|
-
export type WireReach = 'within' | 'app' | 'runtime' | '
|
|
10
|
+
export type WireReach = 'within' | 'app' | 'runtime' | 'whole';
|
|
11
11
|
export type WireEffect = 'read' | 'write' | 'action';
|
|
12
12
|
export type WireCall = {
|
|
13
13
|
readonly reach: WireReach;
|
|
@@ -67,9 +67,13 @@ declare const MEMBERS: {
|
|
|
67
67
|
readonly effect: 'read';
|
|
68
68
|
};
|
|
69
69
|
readonly call: {
|
|
70
|
-
readonly reach: '
|
|
70
|
+
readonly reach: 'within';
|
|
71
71
|
readonly effect: 'action';
|
|
72
72
|
};
|
|
73
|
+
readonly answered: {
|
|
74
|
+
readonly reach: 'within';
|
|
75
|
+
readonly effect: 'read';
|
|
76
|
+
};
|
|
73
77
|
readonly reached: {
|
|
74
78
|
readonly reach: 'within';
|
|
75
79
|
readonly effect: 'read';
|
|
@@ -82,6 +86,18 @@ declare const MEMBERS: {
|
|
|
82
86
|
readonly reach: 'whole';
|
|
83
87
|
readonly effect: 'write';
|
|
84
88
|
};
|
|
89
|
+
readonly unsent: {
|
|
90
|
+
readonly reach: 'whole';
|
|
91
|
+
readonly effect: 'read';
|
|
92
|
+
};
|
|
93
|
+
readonly reset: {
|
|
94
|
+
readonly reach: 'whole';
|
|
95
|
+
readonly effect: 'write';
|
|
96
|
+
};
|
|
97
|
+
readonly readAgain: {
|
|
98
|
+
readonly reach: 'whole';
|
|
99
|
+
readonly effect: 'read';
|
|
100
|
+
};
|
|
85
101
|
readonly persistence: {
|
|
86
102
|
readonly reach: 'runtime';
|
|
87
103
|
readonly effect: 'read';
|
|
@@ -154,6 +170,46 @@ declare const MEMBERS: {
|
|
|
154
170
|
readonly reach: 'within';
|
|
155
171
|
readonly effect: 'action';
|
|
156
172
|
};
|
|
173
|
+
readonly 'conversation.takeOut': {
|
|
174
|
+
readonly reach: 'within';
|
|
175
|
+
readonly effect: 'action';
|
|
176
|
+
};
|
|
177
|
+
readonly 'conversation.decide': {
|
|
178
|
+
readonly reach: 'within';
|
|
179
|
+
readonly effect: 'action';
|
|
180
|
+
};
|
|
181
|
+
readonly 'conversation.rename': {
|
|
182
|
+
readonly reach: 'within';
|
|
183
|
+
readonly effect: 'action';
|
|
184
|
+
};
|
|
185
|
+
readonly 'conversation.option': {
|
|
186
|
+
readonly reach: 'within';
|
|
187
|
+
readonly effect: 'action';
|
|
188
|
+
};
|
|
189
|
+
readonly 'conversation.retry': {
|
|
190
|
+
readonly reach: 'within';
|
|
191
|
+
readonly effect: 'action';
|
|
192
|
+
};
|
|
193
|
+
readonly 'conversation.pins': {
|
|
194
|
+
readonly reach: 'within';
|
|
195
|
+
readonly effect: 'read';
|
|
196
|
+
};
|
|
197
|
+
readonly 'conversation.pin': {
|
|
198
|
+
readonly reach: 'within';
|
|
199
|
+
readonly effect: 'write';
|
|
200
|
+
};
|
|
201
|
+
readonly 'conversation.openedTurns': {
|
|
202
|
+
readonly reach: 'within';
|
|
203
|
+
readonly effect: 'read';
|
|
204
|
+
};
|
|
205
|
+
readonly 'conversation.openTurn': {
|
|
206
|
+
readonly reach: 'within';
|
|
207
|
+
readonly effect: 'write';
|
|
208
|
+
};
|
|
209
|
+
readonly 'conversation.dismissSuggestion': {
|
|
210
|
+
readonly reach: 'within';
|
|
211
|
+
readonly effect: 'write';
|
|
212
|
+
};
|
|
157
213
|
readonly 'chatDraft.write': {
|
|
158
214
|
readonly reach: 'within';
|
|
159
215
|
readonly effect: 'write';
|
|
@@ -162,6 +218,10 @@ declare const MEMBERS: {
|
|
|
162
218
|
readonly reach: 'within';
|
|
163
219
|
readonly effect: 'write';
|
|
164
220
|
};
|
|
221
|
+
readonly 'chatDraft.append': {
|
|
222
|
+
readonly reach: 'within';
|
|
223
|
+
readonly effect: 'write';
|
|
224
|
+
};
|
|
165
225
|
readonly 'chatDraft.discard': {
|
|
166
226
|
readonly reach: 'within';
|
|
167
227
|
readonly effect: 'write';
|
|
@@ -176,6 +236,7 @@ declare const TOPICS: {
|
|
|
176
236
|
readonly 'sync-status': 'within';
|
|
177
237
|
readonly 'service-mode': 'runtime';
|
|
178
238
|
readonly member: 'runtime';
|
|
239
|
+
readonly 'authority-changes': 'runtime';
|
|
179
240
|
readonly query: 'within';
|
|
180
241
|
readonly queue: 'within';
|
|
181
242
|
readonly 'room-drafts': 'within';
|
|
@@ -183,6 +244,9 @@ declare const TOPICS: {
|
|
|
183
244
|
readonly conversation: 'within';
|
|
184
245
|
readonly conversations: 'within';
|
|
185
246
|
readonly agents: 'within';
|
|
247
|
+
readonly figures: 'whole';
|
|
248
|
+
readonly holdings: 'whole';
|
|
249
|
+
readonly read: 'whole';
|
|
186
250
|
};
|
|
187
251
|
export declare const WIRE: {
|
|
188
252
|
readonly members: Readonly<Record<string, WireCall>>;
|
|
@@ -229,6 +293,6 @@ export declare function unanswered(call: {
|
|
|
229
293
|
}): WireAnswer | null;
|
|
230
294
|
export declare const AUTHORIZATION_ENDED = "the host authorization ended";
|
|
231
295
|
export declare const PORT_CLOSED = "the port closed";
|
|
232
|
-
export declare function
|
|
233
|
-
export declare function
|
|
296
|
+
export declare function wireRequest(message: unknown): WireRequest | null;
|
|
297
|
+
export declare function wireAnswer(message: unknown): WireAnswer | null;
|
|
234
298
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const OUTPUT_LINES = 20;
|
|
2
|
+
export declare const OUTPUT_CHARACTERS = 4000;
|
|
3
|
+
export declare const DIFF_CHARACTERS = 10000;
|
|
4
|
+
export declare const FIRST_PART_CHARACTERS = 2000;
|
|
5
|
+
export declare function lastLines(output: string): string;
|
|
6
|
+
export declare function firstPart(result: string): string;
|
|
7
|
+
export declare function keptDiff(diff: string): string | null;
|