@agentshouse/app-bridge 0.1.0-caabde65fcc7f → 0.1.0-cac2ee656ded8
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 +136 -406
- package/dist/mdmodel/body.d.ts +84 -0
- package/dist/mdmodel/built-in.d.ts +3 -0
- package/dist/mdmodel/crockford.d.ts +3 -0
- package/dist/mdmodel/definition.d.ts +20 -10
- package/dist/mdmodel/document.d.ts +14 -8
- 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/house-model.d.ts +826 -0
- package/dist/mdmodel/house-references.d.ts +3 -0
- package/dist/mdmodel/index.d.ts +34 -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/room-types.d.ts +6 -0
- package/dist/mdmodel/types.d.ts +21 -12
- package/dist/mdmodel/validate.d.ts +10 -6
- package/dist/mdruntime/actions.d.ts +25 -0
- package/dist/mdruntime/adapter.d.ts +88 -79
- package/dist/mdruntime/attached-model.d.ts +6 -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 +28 -21
- package/dist/mdruntime/collection.d.ts +23 -4
- package/dist/mdruntime/compile.d.ts +9 -7
- package/dist/mdruntime/conversation-live.d.ts +146 -0
- package/dist/mdruntime/conversation-row.d.ts +32 -0
- package/dist/mdruntime/conversation.d.ts +62 -45
- package/dist/mdruntime/declaration.d.ts +9 -0
- package/dist/mdruntime/durability.d.ts +19 -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/media.d.ts +1 -1
- package/dist/mdruntime/messages.d.ts +33 -5
- package/dist/mdruntime/model.d.ts +2 -10
- package/dist/mdruntime/observation.d.ts +4 -3
- 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 -211
- package/dist/mdruntime/reach.d.ts +14 -12
- package/dist/mdruntime/readiness.d.ts +1 -4
- 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 +6 -7
- package/dist/mdruntime/room-drafts.d.ts +23 -0
- package/dist/mdruntime/runtime.d.ts +33 -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 +66 -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 +214 -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 -155
- package/dist/mdruntime/stored.d.ts +60 -66
- package/dist/mdruntime/surface.d.ts +88 -0
- package/dist/mdruntime/tables.d.ts +120 -56
- package/dist/mdruntime/tallies.d.ts +17 -0
- package/dist/mdruntime/transfer.d.ts +4 -0
- package/dist/mdruntime/wire.d.ts +67 -7
- 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 +103 -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 +22 -16
- package/package.json +2 -2
- package/dist/mdmodel/blocks.d.ts +0 -10
- package/dist/mdmodel/condition.d.ts +0 -180
- package/dist/mdmodel/links.d.ts +0 -28
- package/dist/mdmodel/profile.d.ts +0 -5
- package/dist/mdruntime/connection.d.ts +0 -153
- package/dist/mdruntime/fulltext.d.ts +0 -26
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ConversationHistoryRequest } from './adapter.js';
|
|
2
|
+
import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
|
|
3
|
+
import type { Attempted } from './recovery.js';
|
|
4
|
+
import type { Attempt } from './retried.js';
|
|
5
|
+
import type { Runtime } from './runtime.js';
|
|
6
|
+
export type HistoryQuery = {
|
|
7
|
+
revision?: string;
|
|
8
|
+
pageToken?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function readHistory(runtime: Runtime, locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
11
|
+
export declare function located(runtime: Runtime, room: string, path: string, destination: string): Promise<{
|
|
12
|
+
room: string;
|
|
13
|
+
path: string;
|
|
14
|
+
} | null>;
|
|
15
|
+
export declare function resolveReference(runtime: Runtime, room: string, path: string, destination: string): Promise<Resolution>;
|
|
16
|
+
export type Invoked = {
|
|
17
|
+
readonly dispatching?: () => Promise<void>;
|
|
18
|
+
readonly attempt?: Attempt;
|
|
19
|
+
};
|
|
20
|
+
export declare function invokeAction(runtime: Runtime, name: string, input: unknown, { dispatching, attempt }?: Invoked): Promise<CallResult>;
|
|
21
|
+
export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): Promise<CallResult>;
|
|
22
|
+
export declare function called(runtime: Runtime, name: string, input: unknown, attempt?: Attempt): Promise<CallResult>;
|
|
23
|
+
export declare function answeredCall(runtime: Runtime, operation: string): Promise<boolean>;
|
|
24
|
+
export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
|
|
25
|
+
export declare function resendLater(runtime: Runtime): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SavedFacts, TypedPath, VerifiedModel } from '../mdmodel/index.js';
|
|
2
|
+
import type { Operation, SessionState } from '../session-content/index.js';
|
|
2
3
|
import type { ModelResult } from './model.js';
|
|
3
|
-
export type {
|
|
4
|
+
export type { SavedFacts, TypedPath };
|
|
4
5
|
import type { Open } from './open.js';
|
|
5
6
|
import type { ChangeBatch } from './change.js';
|
|
6
7
|
export type Authorization = object;
|
|
@@ -13,22 +14,25 @@ export type TypedSelection = {
|
|
|
13
14
|
};
|
|
14
15
|
export type OperationScopes = {
|
|
15
16
|
write: readonly string[];
|
|
16
|
-
|
|
17
|
+
erase: readonly string[];
|
|
17
18
|
};
|
|
18
19
|
export type ReplicaAdmission = {
|
|
19
20
|
selection: string;
|
|
20
21
|
admission: Open<'admitted' | 'unavailable'>;
|
|
21
22
|
offline: Open<'locked' | 'open'>;
|
|
22
23
|
};
|
|
23
|
-
export type
|
|
24
|
-
name: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
export type RoomDeclaration = {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly handle: string;
|
|
27
|
+
readonly operations: OperationScopes;
|
|
28
|
+
readonly replica: ReplicaAdmission;
|
|
29
|
+
readonly typedSelection: TypedSelection | null;
|
|
30
|
+
readonly providerOwnedPaths: readonly string[];
|
|
31
|
+
readonly authoredPaths: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
export type DiscoveredRoom = RoomDeclaration & {
|
|
34
|
+
readonly locator: string;
|
|
35
|
+
readonly roomVersion: string;
|
|
32
36
|
};
|
|
33
37
|
export type Capability = {
|
|
34
38
|
name: string;
|
|
@@ -38,16 +42,16 @@ export type Capability = {
|
|
|
38
42
|
export type ListedConversation = {
|
|
39
43
|
conversation: string;
|
|
40
44
|
agent: string;
|
|
41
|
-
agentName: string;
|
|
42
|
-
agentRetired: boolean;
|
|
43
45
|
name: string;
|
|
44
46
|
created: string;
|
|
45
47
|
finished: string | null;
|
|
46
48
|
outcome: string | null;
|
|
47
49
|
waiting: boolean;
|
|
48
50
|
newest: string | null;
|
|
51
|
+
processEnded: string | null;
|
|
52
|
+
subject: string | null;
|
|
49
53
|
};
|
|
50
|
-
export type ConversationAction = 'conversations/create' | 'conversations/send' | 'conversations/interaction/answer' | 'conversations/interrupt' | 'conversations/kill' | 'conversations/delete';
|
|
54
|
+
export type ConversationAction = 'conversations/create' | 'conversations/send' | 'conversations/interaction/answer' | 'conversations/interrupt' | 'conversations/kill' | 'conversations/delete' | 'conversations/take-out' | 'conversations/rename' | 'conversations/option/set' | 'conversations/retry' | 'agent-functions/decide';
|
|
51
55
|
export type ConversationMessage = {
|
|
52
56
|
identity: string;
|
|
53
57
|
turn: string;
|
|
@@ -56,6 +60,7 @@ export type ConversationMessage = {
|
|
|
56
60
|
};
|
|
57
61
|
export type AcceptedMessage = ConversationMessage & {
|
|
58
62
|
position: string;
|
|
63
|
+
change: string;
|
|
59
64
|
};
|
|
60
65
|
export type ConversationHistoryRequest = {
|
|
61
66
|
conversations: readonly {
|
|
@@ -71,37 +76,10 @@ export type ConversationHistoryPage = {
|
|
|
71
76
|
export type ConversationHistories = {
|
|
72
77
|
histories: readonly ConversationHistoryPage[];
|
|
73
78
|
};
|
|
74
|
-
export type TurnContext = {
|
|
75
|
-
used: number;
|
|
76
|
-
window: number;
|
|
77
|
-
};
|
|
78
79
|
export type TurnOperation = {
|
|
79
80
|
op: 'begin';
|
|
80
81
|
at: string;
|
|
81
|
-
} |
|
|
82
|
-
op: 'start';
|
|
83
|
-
index: number;
|
|
84
|
-
part: unknown;
|
|
85
|
-
} | {
|
|
86
|
-
op: 'append';
|
|
87
|
-
index: number;
|
|
88
|
-
text: string;
|
|
89
|
-
} | {
|
|
90
|
-
op: 'status';
|
|
91
|
-
index: number;
|
|
92
|
-
status: string;
|
|
93
|
-
result: unknown;
|
|
94
|
-
} | {
|
|
95
|
-
op: 'count';
|
|
96
|
-
index: number;
|
|
97
|
-
count: number;
|
|
98
|
-
} | {
|
|
99
|
-
op: 'plan';
|
|
100
|
-
index: number;
|
|
101
|
-
entries: readonly unknown[];
|
|
102
|
-
} | ({
|
|
103
|
-
op: 'context';
|
|
104
|
-
} & TurnContext);
|
|
82
|
+
} | Operation;
|
|
105
83
|
export type ProcessCommand = {
|
|
106
84
|
[field: string]: unknown;
|
|
107
85
|
name: string;
|
|
@@ -138,10 +116,6 @@ export type SessionOption = (SessionOptionNaming & {
|
|
|
138
116
|
type: 'boolean';
|
|
139
117
|
currentValue: boolean;
|
|
140
118
|
});
|
|
141
|
-
export type RunningSubagent = {
|
|
142
|
-
description: string;
|
|
143
|
-
activity: string | null;
|
|
144
|
-
};
|
|
145
119
|
export type ConversationEvent = {
|
|
146
120
|
kind: 'turn';
|
|
147
121
|
conversation: string;
|
|
@@ -168,9 +142,9 @@ export type ConversationEvent = {
|
|
|
168
142
|
conversation: string;
|
|
169
143
|
step: string | null;
|
|
170
144
|
} | {
|
|
171
|
-
kind: '
|
|
145
|
+
kind: 'state';
|
|
172
146
|
conversation: string;
|
|
173
|
-
|
|
147
|
+
state: SessionState | null;
|
|
174
148
|
} | {
|
|
175
149
|
kind: 'link';
|
|
176
150
|
conversation: string;
|
|
@@ -178,6 +152,7 @@ export type ConversationEvent = {
|
|
|
178
152
|
} | {
|
|
179
153
|
kind: 'deliveries';
|
|
180
154
|
conversation: string;
|
|
155
|
+
waiting: readonly string[];
|
|
181
156
|
unknown: readonly string[];
|
|
182
157
|
} | {
|
|
183
158
|
kind: 'accepted-message';
|
|
@@ -188,6 +163,7 @@ export type ConversationEvent = {
|
|
|
188
163
|
conversation: string;
|
|
189
164
|
} | {
|
|
190
165
|
kind: 'list';
|
|
166
|
+
agents: readonly ListedAgent[];
|
|
191
167
|
entries: readonly ListedConversation[];
|
|
192
168
|
whole: boolean;
|
|
193
169
|
more: boolean;
|
|
@@ -195,20 +171,39 @@ export type ConversationEvent = {
|
|
|
195
171
|
} | {
|
|
196
172
|
kind: 'listed';
|
|
197
173
|
entry: ListedConversation;
|
|
174
|
+
} | {
|
|
175
|
+
kind: 'agent';
|
|
176
|
+
agent: ListedAgent;
|
|
198
177
|
} | {
|
|
199
178
|
kind: 'unlisted';
|
|
200
179
|
conversation: string;
|
|
201
180
|
};
|
|
181
|
+
export type AgentEnvironment = {
|
|
182
|
+
identity: string;
|
|
183
|
+
name: string;
|
|
184
|
+
state: 'online' | 'offline';
|
|
185
|
+
};
|
|
202
186
|
export type ListedAgent = {
|
|
203
|
-
|
|
187
|
+
id: string;
|
|
204
188
|
name: string;
|
|
205
|
-
|
|
189
|
+
revision: number;
|
|
190
|
+
environment: string;
|
|
191
|
+
environment_name: string;
|
|
192
|
+
environment_connected: boolean;
|
|
193
|
+
launch_directory: string;
|
|
194
|
+
cli: string;
|
|
195
|
+
model: string | null;
|
|
196
|
+
effort: string | null;
|
|
197
|
+
mode: string | null;
|
|
198
|
+
base_instructions: string;
|
|
199
|
+
in_telegram: boolean;
|
|
200
|
+
created: string;
|
|
201
|
+
retired_at: string | null;
|
|
206
202
|
};
|
|
207
203
|
export type ConversationStream = {
|
|
208
204
|
replicate(conversations: readonly string[]): void;
|
|
209
205
|
hold(cursor: string | null): void;
|
|
210
206
|
observe(notify: (event: ConversationEvent) => void): () => void;
|
|
211
|
-
agents?(): Promise<readonly ListedAgent[] | null>;
|
|
212
207
|
history?(request: ConversationHistoryRequest): Promise<ActionResult>;
|
|
213
208
|
};
|
|
214
209
|
export type ActionDeclaration = {
|
|
@@ -229,7 +224,6 @@ export type HistoryRetention = {
|
|
|
229
224
|
};
|
|
230
225
|
export type Retention = {
|
|
231
226
|
history: HistoryRetention;
|
|
232
|
-
outcome: number;
|
|
233
227
|
refreshHorizon: number;
|
|
234
228
|
};
|
|
235
229
|
export type Discovery = {
|
|
@@ -242,6 +236,7 @@ export type Discovery = {
|
|
|
242
236
|
};
|
|
243
237
|
export type TransportUncertainty = {
|
|
244
238
|
kind: 'transport-uncertainty';
|
|
239
|
+
failure?: unknown;
|
|
245
240
|
};
|
|
246
241
|
export type RoomNotReadable = {
|
|
247
242
|
kind: 'room-not-readable';
|
|
@@ -285,26 +280,17 @@ export type BinaryFile = {
|
|
|
285
280
|
mediaType: string;
|
|
286
281
|
sha256: string;
|
|
287
282
|
};
|
|
288
|
-
export type HeldFile = {
|
|
289
|
-
readonly path: string;
|
|
290
|
-
readonly revision: string;
|
|
291
|
-
};
|
|
292
|
-
export type HeldContent = {
|
|
293
|
-
files(after: string | null, limit: number): Promise<readonly HeldFile[]>;
|
|
294
|
-
contents(paths: readonly string[]): Promise<ReadonlyMap<string, {
|
|
295
|
-
readonly content: string;
|
|
296
|
-
readonly revision: string;
|
|
297
|
-
}>>;
|
|
298
|
-
};
|
|
299
283
|
export type BootstrapRequest = {
|
|
300
284
|
locator: string;
|
|
301
285
|
selection: string;
|
|
302
|
-
path?: string;
|
|
303
286
|
pageToken?: PageToken;
|
|
304
|
-
held?: HeldContent;
|
|
305
287
|
arriving?: (bytes: number) => void;
|
|
306
288
|
signal?: AbortSignal;
|
|
307
289
|
};
|
|
290
|
+
export type BootstrapPart = {
|
|
291
|
+
readonly id: string;
|
|
292
|
+
readonly bytes: number;
|
|
293
|
+
};
|
|
308
294
|
export type BootstrapInventory = {
|
|
309
295
|
readonly bytes: number;
|
|
310
296
|
};
|
|
@@ -316,18 +302,23 @@ export type BootstrapPage = {
|
|
|
316
302
|
roomVersion: string;
|
|
317
303
|
models?: RoomModels;
|
|
318
304
|
documents: Readonly<Record<string, string>>;
|
|
319
|
-
|
|
305
|
+
facts: Readonly<Record<string, SavedFacts>>;
|
|
320
306
|
revisions: Readonly<Record<string, string>>;
|
|
321
307
|
fileIds?: Readonly<Record<string, string>>;
|
|
308
|
+
created?: Readonly<Record<string, string>>;
|
|
322
309
|
changes: Readonly<Record<string, HeadChange>>;
|
|
323
310
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
324
311
|
folders?: readonly string[];
|
|
325
312
|
pageToken?: PageToken;
|
|
313
|
+
parts?: readonly BootstrapPart[];
|
|
326
314
|
bytes?: number;
|
|
327
315
|
};
|
|
316
|
+
export type NotReady = {
|
|
317
|
+
kind: 'not-ready';
|
|
318
|
+
};
|
|
328
319
|
export type BootstrapResult = BootstrapPage | {
|
|
329
320
|
kind: 'beyond-horizon';
|
|
330
|
-
} | AdapterFailure;
|
|
321
|
+
} | NotReady | AdapterFailure;
|
|
331
322
|
export type RefreshRequest = {
|
|
332
323
|
locator: string;
|
|
333
324
|
selection: string;
|
|
@@ -339,9 +330,10 @@ export type RefreshPage = {
|
|
|
339
330
|
roomVersion: string;
|
|
340
331
|
models?: RoomModels;
|
|
341
332
|
documents: Readonly<Record<string, string>>;
|
|
342
|
-
|
|
333
|
+
facts: Readonly<Record<string, SavedFacts>>;
|
|
343
334
|
revisions: Readonly<Record<string, string>>;
|
|
344
335
|
fileIds?: Readonly<Record<string, string>>;
|
|
336
|
+
created?: Readonly<Record<string, string>>;
|
|
345
337
|
changes: Readonly<Record<string, HeadChange>>;
|
|
346
338
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
347
339
|
removals: readonly string[];
|
|
@@ -379,21 +371,15 @@ export type AcceptedRoom = {
|
|
|
379
371
|
};
|
|
380
372
|
export type MutationResult = (AcceptedRoom & {
|
|
381
373
|
kind: 'accepted';
|
|
382
|
-
author?: string;
|
|
383
|
-
time?: string;
|
|
384
374
|
destination?: AcceptedRoom;
|
|
385
375
|
}) | (ProviderRefusal & {
|
|
386
376
|
kind: 'conflicted';
|
|
387
|
-
roomVersion?: string;
|
|
388
377
|
affected: Readonly<Record<string, string>>;
|
|
389
378
|
}) | (ProviderRefusal & {
|
|
390
379
|
kind: 'rejected';
|
|
391
380
|
affected: Readonly<Record<string, string>>;
|
|
392
381
|
}) | RetryableRefusal | {
|
|
393
382
|
kind: 'write-halted';
|
|
394
|
-
} | {
|
|
395
|
-
kind: 'expired';
|
|
396
|
-
restored?: true;
|
|
397
383
|
} | AdapterFailure;
|
|
398
384
|
export type HistoryAuthor = {
|
|
399
385
|
kind: 'user' | 'site' | 'inbox' | 'app';
|
|
@@ -472,17 +458,34 @@ export type ActionResult = {
|
|
|
472
458
|
kind: 'action';
|
|
473
459
|
result: unknown;
|
|
474
460
|
at?: RoomVersionAt;
|
|
461
|
+
} | (ProviderRefusal & {
|
|
462
|
+
kind: 'rejected';
|
|
463
|
+
reset?: string;
|
|
464
|
+
}) | AdapterFailure;
|
|
465
|
+
export type SearchHit = {
|
|
466
|
+
room: string;
|
|
467
|
+
path: string;
|
|
468
|
+
line?: number;
|
|
469
|
+
snippet?: string;
|
|
470
|
+
};
|
|
471
|
+
export type SearchAsk = {
|
|
472
|
+
text: string;
|
|
473
|
+
rooms: readonly string[] | null;
|
|
474
|
+
};
|
|
475
|
+
export type SearchAnswer = {
|
|
476
|
+
kind: 'found';
|
|
477
|
+
documents: readonly SearchHit[];
|
|
475
478
|
} | (ProviderRefusal & {
|
|
476
479
|
kind: 'rejected';
|
|
477
480
|
}) | AdapterFailure;
|
|
478
481
|
export type HeldRoom = {
|
|
479
482
|
locator: string;
|
|
480
|
-
roomVersion: string;
|
|
483
|
+
roomVersion: string | null;
|
|
481
484
|
};
|
|
482
485
|
export type RoomChange = {
|
|
483
486
|
kind: 'room-change';
|
|
484
487
|
locator: string;
|
|
485
|
-
from: string;
|
|
488
|
+
from: string | null;
|
|
486
489
|
roomVersion: string;
|
|
487
490
|
read(): Promise<RefreshPage>;
|
|
488
491
|
};
|
|
@@ -501,6 +504,7 @@ export type RoomStreamEvent = {
|
|
|
501
504
|
kind: 'closed';
|
|
502
505
|
revoked: boolean;
|
|
503
506
|
lost: boolean;
|
|
507
|
+
authorityChanged: boolean;
|
|
504
508
|
} | {
|
|
505
509
|
kind: 'caught-up';
|
|
506
510
|
expired: readonly string[];
|
|
@@ -509,10 +513,14 @@ export type RoomStream = {
|
|
|
509
513
|
hold(rooms: readonly HeldRoom[]): void;
|
|
510
514
|
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
511
515
|
};
|
|
516
|
+
export type PathRule = (path: string) => boolean;
|
|
512
517
|
export type Adapter = {
|
|
513
518
|
readonly localSaves?: true;
|
|
514
|
-
readonly roomTypes?:
|
|
515
|
-
readonly
|
|
519
|
+
readonly roomTypes?: VerifiedModel;
|
|
520
|
+
readonly typedPaths?: readonly TypedPath[];
|
|
521
|
+
readonly pathRule?: PathRule;
|
|
522
|
+
readonly unkeptReads?: readonly string[];
|
|
523
|
+
readonly leadingReads?: readonly string[];
|
|
516
524
|
authorize(): Promise<Authorization>;
|
|
517
525
|
discover?(authorization: Authorization): Promise<DiscoverResult>;
|
|
518
526
|
bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
|
|
@@ -523,6 +531,7 @@ export type Adapter = {
|
|
|
523
531
|
link(authorization: Authorization, request: BinaryRequest): Promise<BinaryLinkResult>;
|
|
524
532
|
attach(authorization: Authorization, request: AttachRequest): Promise<AttachResult>;
|
|
525
533
|
action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
|
|
534
|
+
search?(authorization: Authorization, request: SearchAsk): Promise<SearchAnswer>;
|
|
526
535
|
reached(locator: string, roomVersion: string, target: string): boolean;
|
|
527
536
|
follows(locator: string, roomVersion: string, next: string): boolean;
|
|
528
537
|
roomStream?: RoomStream;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type VerifiedModel } from '../mdmodel/index.js';
|
|
2
|
+
import type { ModelResult, ModelState } from './model.js';
|
|
3
|
+
export declare const NO_ROOM_TYPES: VerifiedModel;
|
|
4
|
+
export declare function builtInModel(roomTypes: VerifiedModel): ModelState;
|
|
5
|
+
export declare function schemaTypes(schema: string | null, roomTypes: VerifiedModel): VerifiedModel['types'];
|
|
6
|
+
export declare function attachedModel(answer: ModelResult, roomTypes: VerifiedModel): ModelState;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ModelState } from './model.js';
|
|
2
|
+
import type { Adapter, TypedPath, AdapterFailure, Authorization, BootstrapPart, DiscoveredRoom, NotReady, RetryableRefusal, RoomModels } from './adapter.js';
|
|
3
|
+
import type { Composition } from './collection.js';
|
|
4
|
+
import type { InstallationStep } from './readiness.js';
|
|
5
|
+
import { type Refreshing } from './refresh.js';
|
|
6
|
+
import { type ReplicaRecord } from './replica.js';
|
|
7
|
+
import type { StagedPage, TransferRecord } from './store.js';
|
|
8
|
+
import { type Unconfirmed } from './transfer.js';
|
|
9
|
+
export type Bootstrapped = {
|
|
10
|
+
kind: 'staged';
|
|
11
|
+
record: ReplicaRecord;
|
|
12
|
+
refreshed: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type BootstrapOutcome = Bootstrapped | Unconfirmed | NotReady | RetryableRefusal | AdapterFailure;
|
|
15
|
+
export type HeldModels = {
|
|
16
|
+
collection: ModelState;
|
|
17
|
+
};
|
|
18
|
+
export type Remodel = (models: RoomModels | undefined, held: HeldModels) => HeldModels;
|
|
19
|
+
export type Reads = Pick<Adapter, 'bootstrap' | 'refresh' | 'reached'>;
|
|
20
|
+
export type Arriving = {
|
|
21
|
+
at(bytes: number): void;
|
|
22
|
+
end(): void;
|
|
23
|
+
};
|
|
24
|
+
export type Resumed = {
|
|
25
|
+
readonly record: TransferRecord | null;
|
|
26
|
+
readonly staged: ReadonlySet<string>;
|
|
27
|
+
};
|
|
28
|
+
export type Staging = {
|
|
29
|
+
held(locator: string): TransferRecord | null;
|
|
30
|
+
turn(locator: string, step: InstallationStep): Promise<() => void>;
|
|
31
|
+
unqueued(): Promise<void>;
|
|
32
|
+
queued(text: number): () => void;
|
|
33
|
+
arriving(locator: string): Arriving;
|
|
34
|
+
readonly streamed: boolean;
|
|
35
|
+
stage(record: TransferRecord, page: StagedPage, composition: Composition): Promise<TransferRecord | null>;
|
|
36
|
+
resume(record: TransferRecord, parts: readonly BootstrapPart[], composition: Composition): Promise<Resumed | null>;
|
|
37
|
+
derive(locator: string, key: number, composition: Composition): Promise<boolean>;
|
|
38
|
+
refreshing(locator: string, key: number, composition: Composition): Promise<Refreshing>;
|
|
39
|
+
abandon(locator: string): Promise<void>;
|
|
40
|
+
setAside(locator: string): Promise<void>;
|
|
41
|
+
release(key: number): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
export declare function bootstrapRoom(adapter: Reads, authorization: Authorization, room: DiscoveredRoom, held: HeldModels, builtIn: ModelState, typedPaths: readonly TypedPath[], remodel: Remodel, continuing: () => boolean, staging: Staging): Promise<BootstrapOutcome>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
|
|
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 = {
|
|
@@ -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;
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
|
|
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 { AttachAnswer, BinaryAnswer, CallResult, DownloadAnswer, HistoryAnswer,
|
|
6
|
-
import type {
|
|
11
|
+
import type { AttachAnswer, BinaryAnswer, CallResult, DownloadAnswer, HistoryAnswer, QueueEntry, 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,21 +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: ConversationAnswer): Promise<CallResult>;
|
|
39
|
-
interrupt(conversation: string): Promise<CallResult>;
|
|
40
|
-
kill(conversation: string): Promise<CallResult>;
|
|
41
|
-
delete(conversation: string): Promise<CallResult>;
|
|
42
|
-
};
|
|
43
|
-
chatDraft: {
|
|
44
|
-
write(conversation: string, draft: ChatDraft, revision?: string): Promise<void>;
|
|
45
|
-
prepend(conversation: string, draft: ChatDraft): Promise<void>;
|
|
46
|
-
discard(conversation: string): Promise<void>;
|
|
44
|
+
conversation: ConversationSurface & {
|
|
45
|
+
pageMetadata(app: string, address: string): Promise<string>;
|
|
47
46
|
};
|
|
47
|
+
chatDraft: ChatDraftSurface;
|
|
48
48
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
49
49
|
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
50
50
|
binaryFile: {
|
|
@@ -53,11 +53,14 @@ export type MdRuntimeClient = {
|
|
|
53
53
|
download(room: string, path: string, revision?: string): Promise<DownloadAnswer>;
|
|
54
54
|
};
|
|
55
55
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
56
|
+
answered(operation: string): Promise<boolean>;
|
|
56
57
|
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
57
|
-
log(): Promise<string>;
|
|
58
58
|
persistence(): Promise<boolean>;
|
|
59
59
|
retry(): Promise<void>;
|
|
60
60
|
cleanUp(): Promise<number>;
|
|
61
|
+
unsent(): Promise<readonly UnsentWork[]>;
|
|
62
|
+
reset(): Promise<void>;
|
|
63
|
+
readAgain(): Promise<void>;
|
|
61
64
|
observe: {
|
|
62
65
|
(topic: 'deployment-facts'): Promise<Observation<unknown>>;
|
|
63
66
|
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
@@ -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';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Document } from '../mdmodel/index.js';
|
|
2
|
-
import type { ModelState } from './model.js';
|
|
1
|
+
import { type DefinitionOf, type Document, type TypedPath } from '../mdmodel/index.js';
|
|
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,15 +14,33 @@ 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;
|
|
27
45
|
export declare function available(composition: Composition): boolean;
|
|
46
|
+
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { sql } from '../mdmodel/index.js';
|
|
2
|
+
import { type Composition } from './collection.js';
|
|
3
|
+
import type { Plan, QueryRows } from './query.js';
|
|
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 {};
|