@agentshouse/app-bridge 0.1.0-cedebf3bb1f58 → 0.1.0-cefd2eeb54a01
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 +11 -11
- package/dist/index.d.ts +881 -19
- package/dist/mdmodel/definition.d.ts +17 -1
- package/dist/mdmodel/document.d.ts +5 -5
- package/dist/mdmodel/event.d.ts +77 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/index.d.ts +24 -9
- package/dist/mdmodel/kinds.d.ts +18 -0
- package/dist/mdmodel/links.d.ts +28 -0
- package/dist/mdmodel/paths.d.ts +9 -1
- package/dist/mdmodel/pattern.d.ts +9 -0
- package/dist/mdmodel/project.d.ts +1 -0
- package/dist/mdmodel/query/language.d.ts +222 -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 +4 -0
- package/dist/mdmodel/types.d.ts +35 -4
- package/dist/mdmodel/validate.d.ts +30 -4
- package/dist/mdruntime/adapter.d.ts +144 -79
- package/dist/mdruntime/binary.d.ts +0 -5
- package/dist/mdruntime/chain.d.ts +11 -0
- package/dist/mdruntime/change-set.d.ts +9 -16
- package/dist/mdruntime/change.d.ts +32 -1
- package/dist/mdruntime/client.d.ts +22 -10
- package/dist/mdruntime/collection.d.ts +11 -21
- package/dist/mdruntime/compile.d.ts +10 -0
- package/dist/mdruntime/connection.d.ts +32 -19
- package/dist/mdruntime/conversation.d.ts +34 -17
- package/dist/mdruntime/durability.d.ts +7 -4
- package/dist/mdruntime/identity.d.ts +5 -0
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/messages.d.ts +27 -0
- package/dist/mdruntime/model.d.ts +8 -10
- package/dist/mdruntime/observation.d.ts +17 -2
- package/dist/mdruntime/opened.d.ts +21 -0
- package/dist/mdruntime/outcome.d.ts +45 -7
- package/dist/mdruntime/overlay.d.ts +3 -5
- package/dist/mdruntime/query.d.ts +15 -190
- package/dist/mdruntime/reach.d.ts +18 -9
- package/dist/mdruntime/readiness.d.ts +14 -17
- package/dist/mdruntime/recovery.d.ts +3 -2
- package/dist/mdruntime/replica.d.ts +58 -33
- package/dist/mdruntime/room-draft.d.ts +25 -6
- package/dist/mdruntime/save.d.ts +53 -14
- package/dist/mdruntime/search.d.ts +12 -82
- package/dist/mdruntime/status.d.ts +4 -5
- package/dist/mdruntime/store.d.ts +156 -108
- package/dist/mdruntime/stored.d.ts +155 -0
- package/dist/mdruntime/tables.d.ts +380 -0
- package/dist/mdruntime/wire.d.ts +42 -5
- package/dist/test-host.d.ts +7 -4
- package/dist/test-host.js +19 -29
- package/docs/families.md +69 -53
- package/package.json +8 -3
- package/dist/calls.d.ts +0 -117
- package/dist/calls.js +0 -1
- package/dist/mdmodel/condition.d.ts +0 -149
- package/dist/mdruntime/acquisition.d.ts +0 -13
- package/dist/mdruntime/file.d.ts +0 -19
- package/dist/mdruntime/rows.d.ts +0 -37
- package/dist/mdruntime/shared.d.ts +0 -10
- package/dist/mdruntime/transfer.d.ts +0 -9
- package/dist/mdruntime/turn.d.ts +0 -6
package/dist/mdmodel/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Definition } from './definition.js';
|
|
|
2
2
|
export type Library = Readonly<Record<string, string>>;
|
|
3
3
|
export type VerifiedModel = {
|
|
4
4
|
readonly types: Readonly<Record<string, Definition>>;
|
|
5
|
+
readonly nameable?: readonly string[];
|
|
5
6
|
};
|
|
6
7
|
export type ModelVerification = {
|
|
7
8
|
readonly verdict: 'accept';
|
|
@@ -11,15 +12,23 @@ export type ModelVerification = {
|
|
|
11
12
|
readonly rule: string;
|
|
12
13
|
readonly location?: string;
|
|
13
14
|
};
|
|
15
|
+
export type TypedPath = {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly type: string;
|
|
18
|
+
readonly named: boolean;
|
|
19
|
+
readonly body: boolean;
|
|
20
|
+
};
|
|
14
21
|
export type ValidationContext = {
|
|
15
22
|
readonly binaryTargets: readonly string[];
|
|
23
|
+
readonly anyRoom?: true;
|
|
24
|
+
readonly typedPaths?: readonly TypedPath[];
|
|
16
25
|
};
|
|
17
26
|
export type ProjectionContext = {
|
|
18
27
|
readonly documentTargets: readonly string[];
|
|
19
28
|
readonly definition?: Definition;
|
|
20
29
|
};
|
|
21
30
|
export type DivisionContext = ProjectionContext & {
|
|
22
|
-
readonly
|
|
31
|
+
readonly bound: number;
|
|
23
32
|
};
|
|
24
33
|
export type Extent = {
|
|
25
34
|
readonly start: number;
|
|
@@ -60,6 +69,10 @@ export type Validation = {
|
|
|
60
69
|
} | ({
|
|
61
70
|
readonly verdict: 'refuse';
|
|
62
71
|
} & Refusal);
|
|
72
|
+
export type ValidationStep = {
|
|
73
|
+
readonly path: string;
|
|
74
|
+
readonly resolved: number;
|
|
75
|
+
};
|
|
63
76
|
export type Projection = {
|
|
64
77
|
readonly ok: true;
|
|
65
78
|
readonly text: string;
|
|
@@ -92,14 +105,31 @@ export type Link = {
|
|
|
92
105
|
readonly href: string;
|
|
93
106
|
readonly target: string;
|
|
94
107
|
};
|
|
95
|
-
export type LinkOccurrence = Link & {
|
|
96
|
-
readonly start: number;
|
|
97
|
-
};
|
|
98
108
|
export type Reference = {
|
|
99
109
|
readonly pointer: string;
|
|
100
110
|
readonly value: string;
|
|
101
111
|
readonly to: readonly string[];
|
|
112
|
+
readonly crossRoom?: true;
|
|
102
113
|
};
|
|
114
|
+
export type RoomReference = {
|
|
115
|
+
readonly handle: string;
|
|
116
|
+
readonly path: string;
|
|
117
|
+
} & ({
|
|
118
|
+
readonly kind: 'link';
|
|
119
|
+
readonly href: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly kind: 'field';
|
|
122
|
+
readonly pointer: string;
|
|
123
|
+
readonly value: string;
|
|
124
|
+
readonly to: readonly string[];
|
|
125
|
+
readonly crossRoom?: true;
|
|
126
|
+
} | {
|
|
127
|
+
readonly kind: 'item';
|
|
128
|
+
readonly section: string;
|
|
129
|
+
readonly href: string;
|
|
130
|
+
readonly to: readonly string[];
|
|
131
|
+
readonly crossRoom?: true;
|
|
132
|
+
});
|
|
103
133
|
export type Change = {
|
|
104
134
|
readonly kind: 'field';
|
|
105
135
|
readonly name: string;
|
|
@@ -130,6 +160,7 @@ export type ApplyResult = {
|
|
|
130
160
|
} | {
|
|
131
161
|
readonly outcome: 'stale';
|
|
132
162
|
readonly document: Document;
|
|
163
|
+
readonly stale: readonly number[];
|
|
133
164
|
} | {
|
|
134
165
|
readonly outcome: 'refuse';
|
|
135
166
|
readonly refusal: Refusal;
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
-
import type { DocumentCheck, Library, ModelVerification, Reached, Validation, ValidationContext, VerifiedModel } from './types.js';
|
|
2
|
+
import type { Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
|
|
3
3
|
export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
|
|
4
|
-
export declare function verify(schema: string): ModelVerification;
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
4
|
+
export declare function verify(schema: string, provided?: VerifiedModel): ModelVerification;
|
|
5
|
+
export declare function readTypes(schema: string, provided?: VerifiedModel): VerifiedModel;
|
|
6
|
+
type Placing = Pick<ValidationContext, 'anyRoom' | 'typedPaths'>;
|
|
7
|
+
export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Placing): DocumentCheck;
|
|
8
|
+
export declare function bodyRoomLinks(body: string): RoomReference[];
|
|
9
|
+
export declare function roomReferences(document: Document, definition?: Definition): readonly RoomReference[];
|
|
10
|
+
type Placed = {
|
|
11
|
+
readonly reference: Reached;
|
|
12
|
+
readonly location: string;
|
|
13
|
+
};
|
|
14
|
+
export type Assessment = {
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly type: string | undefined;
|
|
17
|
+
readonly targets: readonly string[];
|
|
18
|
+
readonly read: Validation | null;
|
|
19
|
+
readonly structured: Validation | null;
|
|
20
|
+
readonly fields: readonly Placed[];
|
|
21
|
+
readonly linked: boolean;
|
|
22
|
+
readonly sections: readonly Placed[];
|
|
23
|
+
};
|
|
24
|
+
export declare function assess(file: string, parsed: ParseResult, binary: boolean, model?: VerifiedModel, context?: Placing): Assessment;
|
|
25
|
+
export declare function assessReferences(file: string, parsed: ParseResult, changed: ReadonlySet<string>, model?: VerifiedModel, context?: Placing): Assessment;
|
|
26
|
+
export type Verdicts = {
|
|
27
|
+
add(assessment: Assessment, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): number;
|
|
28
|
+
verdict(): Validation;
|
|
29
|
+
};
|
|
30
|
+
export declare function verdicts(): Verdicts;
|
|
31
|
+
export declare function validating(library: ReadonlyMap<string, string>, context?: ValidationContext, model?: VerifiedModel): Generator<ValidationStep, Validation, void>;
|
|
7
32
|
export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
|
|
33
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { SavedFacts, TypedPath } from '../mdmodel/index.js';
|
|
1
2
|
import type { ModelResult } from './model.js';
|
|
3
|
+
export type { SavedFacts, TypedPath };
|
|
2
4
|
import type { Open } from './open.js';
|
|
3
5
|
import type { ChangeBatch } from './change.js';
|
|
4
6
|
export type Authorization = object;
|
|
@@ -10,14 +12,13 @@ export type TypedSelection = {
|
|
|
10
12
|
roots: readonly string[];
|
|
11
13
|
};
|
|
12
14
|
export type OperationScopes = {
|
|
13
|
-
read: readonly string[];
|
|
14
|
-
sync: readonly string[];
|
|
15
15
|
write: readonly string[];
|
|
16
|
-
|
|
16
|
+
erase: readonly string[];
|
|
17
17
|
};
|
|
18
18
|
export type ReplicaAdmission = {
|
|
19
19
|
selection: string;
|
|
20
20
|
admission: Open<'admitted' | 'unavailable'>;
|
|
21
|
+
offline: Open<'locked' | 'open'>;
|
|
21
22
|
};
|
|
22
23
|
export type DiscoveredRoom = {
|
|
23
24
|
name: string;
|
|
@@ -33,24 +34,21 @@ export type Capability = {
|
|
|
33
34
|
name: string;
|
|
34
35
|
limits?: readonly ProviderLimit[];
|
|
35
36
|
actions?: readonly ActionDeclaration[];
|
|
36
|
-
conversationAgents?: ConversationAgents;
|
|
37
|
-
};
|
|
38
|
-
export type ConversationAgents = {
|
|
39
|
-
locator: string;
|
|
40
|
-
type: string;
|
|
41
|
-
identity: string;
|
|
42
|
-
name: string;
|
|
43
|
-
retired?: string;
|
|
44
37
|
};
|
|
45
38
|
export type ListedConversation = {
|
|
46
39
|
conversation: string;
|
|
47
40
|
agent: string;
|
|
41
|
+
agentName: string;
|
|
42
|
+
agentRetired: boolean;
|
|
48
43
|
name: string;
|
|
49
44
|
created: string;
|
|
50
45
|
finished: string | null;
|
|
51
46
|
outcome: string | null;
|
|
47
|
+
waiting: boolean;
|
|
48
|
+
newest: string | null;
|
|
49
|
+
processEnded: string | null;
|
|
52
50
|
};
|
|
53
|
-
export type ConversationAction = '
|
|
51
|
+
export type ConversationAction = 'conversations/create' | 'conversations/send' | 'conversations/interaction/answer' | 'conversations/interrupt' | 'conversations/kill' | 'conversations/delete';
|
|
54
52
|
export type ConversationMessage = {
|
|
55
53
|
identity: string;
|
|
56
54
|
turn: string;
|
|
@@ -141,6 +139,10 @@ export type SessionOption = (SessionOptionNaming & {
|
|
|
141
139
|
type: 'boolean';
|
|
142
140
|
currentValue: boolean;
|
|
143
141
|
});
|
|
142
|
+
export type RunningSubagent = {
|
|
143
|
+
description: string;
|
|
144
|
+
activity: string | null;
|
|
145
|
+
};
|
|
144
146
|
export type ConversationEvent = {
|
|
145
147
|
kind: 'turn';
|
|
146
148
|
conversation: string;
|
|
@@ -162,6 +164,22 @@ export type ConversationEvent = {
|
|
|
162
164
|
kind: 'options';
|
|
163
165
|
conversation: string;
|
|
164
166
|
options: readonly SessionOption[];
|
|
167
|
+
} | {
|
|
168
|
+
kind: 'starting';
|
|
169
|
+
conversation: string;
|
|
170
|
+
step: string | null;
|
|
171
|
+
} | {
|
|
172
|
+
kind: 'subagents';
|
|
173
|
+
conversation: string;
|
|
174
|
+
subagents: readonly RunningSubagent[];
|
|
175
|
+
} | {
|
|
176
|
+
kind: 'link';
|
|
177
|
+
conversation: string;
|
|
178
|
+
connected: boolean;
|
|
179
|
+
} | {
|
|
180
|
+
kind: 'deliveries';
|
|
181
|
+
conversation: string;
|
|
182
|
+
unknown: readonly string[];
|
|
165
183
|
} | {
|
|
166
184
|
kind: 'accepted-message';
|
|
167
185
|
conversation: string;
|
|
@@ -172,6 +190,9 @@ export type ConversationEvent = {
|
|
|
172
190
|
} | {
|
|
173
191
|
kind: 'list';
|
|
174
192
|
entries: readonly ListedConversation[];
|
|
193
|
+
whole: boolean;
|
|
194
|
+
more: boolean;
|
|
195
|
+
cursor: string | null;
|
|
175
196
|
} | {
|
|
176
197
|
kind: 'listed';
|
|
177
198
|
entry: ListedConversation;
|
|
@@ -179,14 +200,23 @@ export type ConversationEvent = {
|
|
|
179
200
|
kind: 'unlisted';
|
|
180
201
|
conversation: string;
|
|
181
202
|
};
|
|
203
|
+
export type ListedAgent = {
|
|
204
|
+
agent: string;
|
|
205
|
+
name: string;
|
|
206
|
+
retired: boolean;
|
|
207
|
+
};
|
|
182
208
|
export type ConversationStream = {
|
|
183
209
|
replicate(conversations: readonly string[]): void;
|
|
210
|
+
hold(cursor: string | null): void;
|
|
184
211
|
observe(notify: (event: ConversationEvent) => void): () => void;
|
|
212
|
+
agents?(): Promise<readonly ListedAgent[] | null>;
|
|
213
|
+
history?(request: ConversationHistoryRequest): Promise<ActionResult>;
|
|
185
214
|
};
|
|
186
215
|
export type ActionDeclaration = {
|
|
187
216
|
name: string;
|
|
188
217
|
inputShape: unknown;
|
|
189
218
|
resultKind: unknown;
|
|
219
|
+
room?: string;
|
|
190
220
|
};
|
|
191
221
|
export type ProviderLimit = {
|
|
192
222
|
name: string;
|
|
@@ -200,7 +230,6 @@ export type HistoryRetention = {
|
|
|
200
230
|
};
|
|
201
231
|
export type Retention = {
|
|
202
232
|
history: HistoryRetention;
|
|
203
|
-
outcome: number;
|
|
204
233
|
refreshHorizon: number;
|
|
205
234
|
};
|
|
206
235
|
export type Discovery = {
|
|
@@ -229,7 +258,7 @@ export type ProviderRefusal = {
|
|
|
229
258
|
export type ScopedRefusal = ProviderRefusal & {
|
|
230
259
|
kind: 'scoped-refusal';
|
|
231
260
|
locator: string;
|
|
232
|
-
scope: Open<'content' | '
|
|
261
|
+
scope: Open<'content' | 'model' | 'operation' | 'undisclosed'>;
|
|
233
262
|
};
|
|
234
263
|
export type AdapterFailure = TransportUncertainty | RoomNotReadable | RevokedAuthorization | ScopedRefusal;
|
|
235
264
|
export type ContractUnavailable = ProviderRefusal & {
|
|
@@ -238,7 +267,7 @@ export type ContractUnavailable = ProviderRefusal & {
|
|
|
238
267
|
export type DiscoverResult = Discovery | TransportUncertainty | RevokedAuthorization | ContractUnavailable;
|
|
239
268
|
export type PageToken = string;
|
|
240
269
|
export type ChangeAuthor = {
|
|
241
|
-
kind: Open<'user' | 'site'>;
|
|
270
|
+
kind: Open<'user' | 'site' | 'inbox' | 'app'>;
|
|
242
271
|
id: string;
|
|
243
272
|
name: string;
|
|
244
273
|
};
|
|
@@ -252,39 +281,49 @@ export type HeadChange = {
|
|
|
252
281
|
time: string;
|
|
253
282
|
};
|
|
254
283
|
export type BinaryFile = {
|
|
255
|
-
fileRef: string;
|
|
256
284
|
byteLength: number;
|
|
257
285
|
mediaType: string;
|
|
258
286
|
sha256: string;
|
|
259
287
|
};
|
|
260
|
-
export type HeldContent = {
|
|
261
|
-
documents: Readonly<Record<string, string>>;
|
|
262
|
-
revisions: Readonly<Record<string, string>>;
|
|
263
|
-
};
|
|
264
288
|
export type BootstrapRequest = {
|
|
265
289
|
locator: string;
|
|
266
290
|
selection: string;
|
|
267
291
|
pageToken?: PageToken;
|
|
268
|
-
|
|
292
|
+
arriving?: (bytes: number) => void;
|
|
293
|
+
signal?: AbortSignal;
|
|
294
|
+
};
|
|
295
|
+
export type BootstrapPart = {
|
|
296
|
+
readonly id: string;
|
|
297
|
+
readonly bytes: number;
|
|
298
|
+
};
|
|
299
|
+
export type BootstrapInventory = {
|
|
300
|
+
readonly bytes: number;
|
|
269
301
|
};
|
|
270
302
|
export type RoomModels = {
|
|
271
303
|
collection?: ModelResult;
|
|
272
|
-
selection?: ModelResult;
|
|
273
304
|
};
|
|
274
305
|
export type BootstrapPage = {
|
|
275
306
|
kind: 'bootstrap';
|
|
276
307
|
roomVersion: string;
|
|
277
308
|
models?: RoomModels;
|
|
278
309
|
documents: Readonly<Record<string, string>>;
|
|
310
|
+
facts: Readonly<Record<string, SavedFacts>>;
|
|
279
311
|
revisions: Readonly<Record<string, string>>;
|
|
280
312
|
fileIds?: Readonly<Record<string, string>>;
|
|
313
|
+
created?: Readonly<Record<string, string>>;
|
|
281
314
|
changes: Readonly<Record<string, HeadChange>>;
|
|
282
315
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
316
|
+
folders?: readonly string[];
|
|
283
317
|
pageToken?: PageToken;
|
|
318
|
+
parts?: readonly BootstrapPart[];
|
|
319
|
+
bytes?: number;
|
|
320
|
+
};
|
|
321
|
+
export type NotReady = {
|
|
322
|
+
kind: 'not-ready';
|
|
284
323
|
};
|
|
285
324
|
export type BootstrapResult = BootstrapPage | {
|
|
286
325
|
kind: 'beyond-horizon';
|
|
287
|
-
} | AdapterFailure;
|
|
326
|
+
} | NotReady | AdapterFailure;
|
|
288
327
|
export type RefreshRequest = {
|
|
289
328
|
locator: string;
|
|
290
329
|
selection: string;
|
|
@@ -296,11 +335,15 @@ export type RefreshPage = {
|
|
|
296
335
|
roomVersion: string;
|
|
297
336
|
models?: RoomModels;
|
|
298
337
|
documents: Readonly<Record<string, string>>;
|
|
338
|
+
facts: Readonly<Record<string, SavedFacts>>;
|
|
299
339
|
revisions: Readonly<Record<string, string>>;
|
|
300
340
|
fileIds?: Readonly<Record<string, string>>;
|
|
341
|
+
created?: Readonly<Record<string, string>>;
|
|
301
342
|
changes: Readonly<Record<string, HeadChange>>;
|
|
302
343
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
303
344
|
removals: readonly string[];
|
|
345
|
+
folders?: readonly string[];
|
|
346
|
+
folderRemovals?: readonly string[];
|
|
304
347
|
pageToken?: PageToken;
|
|
305
348
|
};
|
|
306
349
|
export type RefreshResult = {
|
|
@@ -311,6 +354,7 @@ export type RefreshResult = {
|
|
|
311
354
|
export type MutationRequest = {
|
|
312
355
|
locator: string;
|
|
313
356
|
changeBatch: ChangeBatch;
|
|
357
|
+
file(localId: string): Promise<Blob>;
|
|
314
358
|
upload?: unknown;
|
|
315
359
|
};
|
|
316
360
|
export type RetryableRefusal = ProviderRefusal & {
|
|
@@ -321,8 +365,7 @@ export type ServiceMode = Open<'open' | 'write-halted'>;
|
|
|
321
365
|
export type ServiceModeSignal = {
|
|
322
366
|
observe(notify: (mode: ServiceMode) => void): () => void;
|
|
323
367
|
};
|
|
324
|
-
export type
|
|
325
|
-
kind: 'accepted';
|
|
368
|
+
export type AcceptedRoom = {
|
|
326
369
|
roomVersion: string;
|
|
327
370
|
documents: Readonly<Record<string, string>>;
|
|
328
371
|
revisions: Readonly<Record<string, string>>;
|
|
@@ -330,9 +373,13 @@ export type MutationResult = {
|
|
|
330
373
|
changes: Readonly<Record<string, HeadChange>>;
|
|
331
374
|
removals: readonly string[];
|
|
332
375
|
binaryFiles?: Readonly<Record<string, BinaryFile>>;
|
|
376
|
+
};
|
|
377
|
+
export type MutationResult = (AcceptedRoom & {
|
|
378
|
+
kind: 'accepted';
|
|
333
379
|
author?: string;
|
|
334
380
|
time?: string;
|
|
335
|
-
|
|
381
|
+
destination?: AcceptedRoom;
|
|
382
|
+
}) | (ProviderRefusal & {
|
|
336
383
|
kind: 'conflicted';
|
|
337
384
|
roomVersion?: string;
|
|
338
385
|
affected: Readonly<Record<string, string>>;
|
|
@@ -341,15 +388,9 @@ export type MutationResult = {
|
|
|
341
388
|
affected: Readonly<Record<string, string>>;
|
|
342
389
|
}) | RetryableRefusal | {
|
|
343
390
|
kind: 'write-halted';
|
|
344
|
-
} | {
|
|
345
|
-
kind: 'expired';
|
|
346
|
-
restored?: true;
|
|
347
391
|
} | AdapterFailure;
|
|
348
392
|
export type HistoryAuthor = {
|
|
349
|
-
kind: 'user';
|
|
350
|
-
id: string;
|
|
351
|
-
} | {
|
|
352
|
-
kind: 'site';
|
|
393
|
+
kind: 'user' | 'site' | 'inbox' | 'app';
|
|
353
394
|
id: string;
|
|
354
395
|
name: string;
|
|
355
396
|
};
|
|
@@ -381,22 +422,35 @@ export type BinaryRequest = {
|
|
|
381
422
|
locator: string;
|
|
382
423
|
path: string;
|
|
383
424
|
revision: string;
|
|
384
|
-
fileRef?: string;
|
|
385
|
-
} | {
|
|
386
|
-
kind: 'reference';
|
|
387
|
-
fileRef: string;
|
|
388
|
-
referrer: unknown;
|
|
389
|
-
};
|
|
390
|
-
export type ReferrerScope = {
|
|
391
|
-
kind: 'room';
|
|
392
|
-
locator: string;
|
|
393
|
-
path?: string;
|
|
394
|
-
} | {
|
|
395
|
-
kind: 'conversations';
|
|
396
425
|
};
|
|
397
426
|
export type BinaryResult = {
|
|
398
427
|
kind: 'binary';
|
|
428
|
+
body: ReadableStream<Uint8Array>;
|
|
429
|
+
mediaType: string;
|
|
430
|
+
sha256?: string;
|
|
431
|
+
} | (ProviderRefusal & {
|
|
432
|
+
kind: 'rejected';
|
|
433
|
+
}) | AdapterFailure;
|
|
434
|
+
export type BinaryLinkResult = {
|
|
435
|
+
kind: 'link';
|
|
436
|
+
url: string;
|
|
437
|
+
name: string;
|
|
438
|
+
mediaType?: string;
|
|
439
|
+
} | (ProviderRefusal & {
|
|
440
|
+
kind: 'rejected';
|
|
441
|
+
}) | AdapterFailure;
|
|
442
|
+
export type AttachRequest = {
|
|
443
|
+
locator: string;
|
|
444
|
+
name: string;
|
|
445
|
+
mediaType: string;
|
|
446
|
+
byteLength: number;
|
|
447
|
+
sha256: string;
|
|
399
448
|
blob: Blob;
|
|
449
|
+
};
|
|
450
|
+
export type AttachResult = {
|
|
451
|
+
kind: 'attached';
|
|
452
|
+
path: string;
|
|
453
|
+
revision: string;
|
|
400
454
|
} | (ProviderRefusal & {
|
|
401
455
|
kind: 'rejected';
|
|
402
456
|
}) | AdapterFailure;
|
|
@@ -415,65 +469,76 @@ export type ActionResult = {
|
|
|
415
469
|
} | (ProviderRefusal & {
|
|
416
470
|
kind: 'rejected';
|
|
417
471
|
}) | AdapterFailure;
|
|
472
|
+
export type SearchHit = {
|
|
473
|
+
room: string;
|
|
474
|
+
path: string;
|
|
475
|
+
line?: number;
|
|
476
|
+
snippet?: string;
|
|
477
|
+
};
|
|
478
|
+
export type SearchAsk = {
|
|
479
|
+
text: string;
|
|
480
|
+
rooms: readonly string[] | null;
|
|
481
|
+
};
|
|
482
|
+
export type SearchAnswer = {
|
|
483
|
+
kind: 'found';
|
|
484
|
+
documents: readonly SearchHit[];
|
|
485
|
+
} | (ProviderRefusal & {
|
|
486
|
+
kind: 'rejected';
|
|
487
|
+
}) | AdapterFailure;
|
|
418
488
|
export type HeldRoom = {
|
|
419
489
|
locator: string;
|
|
490
|
+
roomVersion: string | null;
|
|
491
|
+
};
|
|
492
|
+
export type RoomChange = {
|
|
493
|
+
kind: 'room-change';
|
|
494
|
+
locator: string;
|
|
495
|
+
from: string | null;
|
|
420
496
|
roomVersion: string;
|
|
421
|
-
|
|
422
|
-
|
|
497
|
+
read(): Promise<RefreshPage>;
|
|
498
|
+
};
|
|
499
|
+
export type AuthorityChange = {
|
|
500
|
+
kind: 'authority-changed';
|
|
501
|
+
rooms: readonly DiscoveredRoom[];
|
|
502
|
+
left: readonly string[];
|
|
503
|
+
member?: Member;
|
|
423
504
|
};
|
|
424
505
|
export type RoomStreamEvent = {
|
|
425
506
|
kind: 'opened';
|
|
507
|
+
} | {
|
|
508
|
+
kind: 'discovered';
|
|
509
|
+
discovery: Discovery;
|
|
426
510
|
} | {
|
|
427
511
|
kind: 'closed';
|
|
428
512
|
revoked: boolean;
|
|
429
513
|
lost: boolean;
|
|
514
|
+
authorityChanged: boolean;
|
|
430
515
|
} | {
|
|
431
|
-
kind: '
|
|
516
|
+
kind: 'caught-up';
|
|
432
517
|
expired: readonly string[];
|
|
433
|
-
} |
|
|
434
|
-
kind: 'room-version';
|
|
435
|
-
locator: string;
|
|
436
|
-
roomVersion: string;
|
|
437
|
-
};
|
|
438
|
-
export type KeptReceipt = {
|
|
439
|
-
key: string;
|
|
440
|
-
head: unknown;
|
|
441
|
-
};
|
|
442
|
-
export type StreamReceipts = {
|
|
443
|
-
heads(): Promise<readonly KeptReceipt[]>;
|
|
444
|
-
parts(key: string, count: number): Promise<readonly unknown[]>;
|
|
445
|
-
keep(key: string, head: unknown, part?: {
|
|
446
|
-
index: number;
|
|
447
|
-
value: unknown;
|
|
448
|
-
}): Promise<void>;
|
|
449
|
-
drop(keys: readonly string[]): Promise<void>;
|
|
450
|
-
};
|
|
451
|
-
export type AcquiredDemand = {
|
|
452
|
-
rooms: readonly string[];
|
|
453
|
-
conversations: boolean;
|
|
454
|
-
};
|
|
518
|
+
} | AuthorityChange | RoomChange;
|
|
455
519
|
export type RoomStream = {
|
|
456
|
-
hold(rooms: readonly HeldRoom[]
|
|
457
|
-
|
|
458
|
-
published(locator: string, roomVersion: string): void;
|
|
459
|
-
observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
|
|
520
|
+
hold(rooms: readonly HeldRoom[]): void;
|
|
521
|
+
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
460
522
|
};
|
|
461
523
|
export type Adapter = {
|
|
462
524
|
readonly localSaves?: true;
|
|
463
|
-
readonly
|
|
525
|
+
readonly roomTypes?: string;
|
|
526
|
+
readonly nameableRoomTypes?: readonly string[];
|
|
527
|
+
readonly typedPaths?: readonly TypedPath[];
|
|
464
528
|
authorize(): Promise<Authorization>;
|
|
465
|
-
discover(authorization: Authorization): Promise<DiscoverResult>;
|
|
529
|
+
discover?(authorization: Authorization): Promise<DiscoverResult>;
|
|
466
530
|
bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
|
|
467
|
-
refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;
|
|
531
|
+
refresh?(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;
|
|
468
532
|
mutate(authorization: Authorization, request: MutationRequest, keep: (upload: unknown) => Promise<void>): Promise<MutationResult>;
|
|
469
533
|
history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
|
|
470
534
|
binary(authorization: Authorization, request: BinaryRequest): Promise<BinaryResult>;
|
|
471
|
-
|
|
535
|
+
link(authorization: Authorization, request: BinaryRequest): Promise<BinaryLinkResult>;
|
|
536
|
+
attach(authorization: Authorization, request: AttachRequest): Promise<AttachResult>;
|
|
472
537
|
action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
|
|
538
|
+
search?(authorization: Authorization, request: SearchAsk): Promise<SearchAnswer>;
|
|
473
539
|
reached(locator: string, roomVersion: string, target: string): boolean;
|
|
474
540
|
follows(locator: string, roomVersion: string, next: string): boolean;
|
|
475
541
|
roomStream?: RoomStream;
|
|
476
542
|
conversations?: ConversationStream;
|
|
477
543
|
serviceMode?: ServiceModeSignal;
|
|
478
544
|
};
|
|
479
|
-
export {};
|
|
@@ -3,7 +3,6 @@ export type BinaryFileRecord = {
|
|
|
3
3
|
readonly state: 'accepted';
|
|
4
4
|
readonly revision: string;
|
|
5
5
|
readonly path: string;
|
|
6
|
-
readonly fileRef: string;
|
|
7
6
|
readonly byteLength: number;
|
|
8
7
|
readonly mediaType: string;
|
|
9
8
|
readonly sha256: string;
|
|
@@ -15,8 +14,4 @@ export type BinaryFileRecord = {
|
|
|
15
14
|
readonly mediaType: string;
|
|
16
15
|
readonly sha256: string;
|
|
17
16
|
};
|
|
18
|
-
export type BinaryReference = {
|
|
19
|
-
readonly fileRef: string;
|
|
20
|
-
readonly referrer: unknown;
|
|
21
|
-
};
|
|
22
17
|
export declare function binaryRecord(path: string, held: HeldBinary, revision: string | undefined): BinaryFileRecord;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
|
|
2
|
+
import type { MdRuntimeClient } from './client.js';
|
|
3
|
+
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
4
|
+
type Rows = DocumentResult | GroupResult;
|
|
5
|
+
export type WindowAnswer = Rows | PendingResult;
|
|
6
|
+
export type WindowChain = {
|
|
7
|
+
want(count: number): void;
|
|
8
|
+
close(): void;
|
|
9
|
+
};
|
|
10
|
+
export declare function chainedWindows(runtime: MdRuntimeClient, query: DocumentQuery | GroupQuery, count: number, publish: (answers: readonly (WindowAnswer | null)[], settled: boolean) => void): WindowChain;
|
|
11
|
+
export {};
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { type Replica } from './replica.js';
|
|
2
|
-
import { type Row } from './rows.js';
|
|
3
1
|
export type DocumentChange = {
|
|
4
|
-
locator: string;
|
|
5
|
-
path: string;
|
|
6
|
-
before: readonly Row[];
|
|
7
|
-
after: readonly Row[];
|
|
8
|
-
};
|
|
9
|
-
export type MessageChange = {
|
|
10
|
-
conversation: string;
|
|
11
|
-
identity: string;
|
|
12
|
-
text: string | null;
|
|
2
|
+
readonly locator: string;
|
|
3
|
+
readonly path: string | null;
|
|
13
4
|
};
|
|
14
5
|
export type ChangeSet = {
|
|
15
6
|
documents: readonly DocumentChange[];
|
|
@@ -20,15 +11,17 @@ export type ChangeSet = {
|
|
|
20
11
|
rooms: readonly string[];
|
|
21
12
|
queues: readonly string[];
|
|
22
13
|
presentations: readonly string[];
|
|
23
|
-
messages: readonly MessageChange[];
|
|
24
14
|
conversations: readonly string[];
|
|
25
15
|
};
|
|
26
|
-
|
|
16
|
+
type Changed = {
|
|
17
|
+
documents?: readonly string[] | null;
|
|
27
18
|
drafts?: readonly string[];
|
|
28
19
|
room?: boolean;
|
|
29
20
|
queue?: boolean;
|
|
30
21
|
presentation?: string;
|
|
31
|
-
}
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function conversationChangeSet(
|
|
22
|
+
};
|
|
23
|
+
export declare function changeSet(locator: string, changed?: Changed): ChangeSet;
|
|
24
|
+
export declare function conversationChangeSet(conversations: readonly string[]): ChangeSet;
|
|
34
25
|
export declare function mergeChangeSets(sets: readonly ChangeSet[]): ChangeSet;
|
|
26
|
+
export declare function touches(set: ChangeSet, locator: string, path: string): boolean;
|
|
27
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BinaryFile, HeadChange } from './adapter.js';
|
|
1
2
|
export type Change = {
|
|
2
3
|
readonly kind: 'field';
|
|
3
4
|
readonly path: string;
|
|
@@ -29,7 +30,6 @@ export type Change = {
|
|
|
29
30
|
readonly kind: 'binary';
|
|
30
31
|
readonly path: string;
|
|
31
32
|
readonly localId: string;
|
|
32
|
-
readonly blob: Blob;
|
|
33
33
|
readonly byteLength: number;
|
|
34
34
|
readonly mediaType: string;
|
|
35
35
|
readonly sha256: string;
|
|
@@ -40,6 +40,33 @@ export type Change = {
|
|
|
40
40
|
} | {
|
|
41
41
|
readonly kind: 'remove';
|
|
42
42
|
readonly path: string;
|
|
43
|
+
} | (Arriving & {
|
|
44
|
+
readonly content: string;
|
|
45
|
+
}) | (Arriving & {
|
|
46
|
+
readonly binary: BinaryFile;
|
|
47
|
+
});
|
|
48
|
+
type Arriving = {
|
|
49
|
+
readonly kind: 'arrival';
|
|
50
|
+
readonly path: string;
|
|
51
|
+
readonly revision?: string;
|
|
52
|
+
readonly fileId?: string;
|
|
53
|
+
readonly created?: string;
|
|
54
|
+
readonly change?: HeadChange;
|
|
55
|
+
};
|
|
56
|
+
export type RoomMove = {
|
|
57
|
+
readonly source: {
|
|
58
|
+
readonly room: string;
|
|
59
|
+
readonly baseRoomVersion: string;
|
|
60
|
+
};
|
|
61
|
+
readonly destination: {
|
|
62
|
+
readonly room: string;
|
|
63
|
+
readonly baseRoomVersion: string;
|
|
64
|
+
readonly handle: string;
|
|
65
|
+
};
|
|
66
|
+
readonly moves: readonly {
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly to: string;
|
|
69
|
+
}[];
|
|
43
70
|
};
|
|
44
71
|
export type Precondition = {
|
|
45
72
|
readonly kind: 'field';
|
|
@@ -81,8 +108,12 @@ export type ChangeBatch = {
|
|
|
81
108
|
readonly changes: readonly Change[];
|
|
82
109
|
readonly preconditions: readonly Precondition[];
|
|
83
110
|
readonly writtenBy?: WrittenBy;
|
|
111
|
+
readonly between?: RoomMove;
|
|
84
112
|
};
|
|
85
113
|
export declare function immutable(batch: ChangeBatch): ChangeBatch;
|
|
114
|
+
export declare function partnerOf(batch: ChangeBatch, locator: string): string | null;
|
|
115
|
+
export declare function leaving(batch: ChangeBatch, locator: string): boolean;
|
|
86
116
|
export declare function landing(changes: readonly Change[], index: number, path: string): string | null;
|
|
87
117
|
export declare function departure(changes: readonly Change[], index: number): string;
|
|
88
118
|
export declare function queuedFile(batch: ChangeBatch, path: string, localId: string): number;
|
|
119
|
+
export {};
|