@agentshouse/app-bridge 0.1.0-c8d8dc6285bbd → 0.1.0-c8d97d63f2350
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 +3 -3
- package/dist/index.d.ts +844 -17
- package/dist/mdmodel/condition.d.ts +9 -2
- package/dist/mdmodel/index.d.ts +2 -2
- package/dist/mdruntime/adapter.d.ts +65 -49
- package/dist/mdruntime/client.d.ts +6 -7
- package/dist/mdruntime/collection.d.ts +5 -3
- package/dist/mdruntime/connection.d.ts +5 -4
- package/dist/mdruntime/conversation.d.ts +11 -11
- package/dist/mdruntime/durability.d.ts +0 -1
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/model.d.ts +6 -1
- package/dist/mdruntime/observation.d.ts +1 -0
- package/dist/mdruntime/outcome.d.ts +13 -5
- package/dist/mdruntime/query.d.ts +6 -0
- package/dist/mdruntime/reach.d.ts +8 -1
- package/dist/mdruntime/readiness.d.ts +3 -15
- package/dist/mdruntime/recovery.d.ts +1 -0
- package/dist/mdruntime/replica.d.ts +3 -5
- package/dist/mdruntime/room-draft.d.ts +17 -2
- package/dist/mdruntime/save.d.ts +2 -0
- package/dist/mdruntime/status.d.ts +4 -3
- package/dist/mdruntime/store.d.ts +18 -33
- package/dist/mdruntime/stored.d.ts +9 -24
- package/dist/mdruntime/tables.d.ts +16 -45
- package/dist/mdruntime/wire.d.ts +8 -8
- package/dist/test-host.d.ts +1 -4
- package/dist/test-host.js +1 -27
- package/docs/families.md +30 -46
- package/package.json +1 -1
- package/dist/calls.d.ts +0 -1007
- package/dist/calls.js +0 -1
- package/dist/mdruntime/file.d.ts +0 -11
- package/dist/mdruntime/shared.d.ts +0 -15
- package/dist/mdruntime/transfer.d.ts +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BootstrapInventory, MutationResult, OperationScopes, ReplicaAdmission, TypedSelection } from './adapter.js';
|
|
2
2
|
import { type ChangeBatch, type Precondition } from './change.js';
|
|
3
3
|
import { type Collection, type Composition } from './collection.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type ModelState } from './model.js';
|
|
5
5
|
import { type Layer } from './overlay.js';
|
|
6
6
|
import type { HeldEntry, OverlayEntry, StoredEntry } from './tables.js';
|
|
7
7
|
export type ReplicaRecord = {
|
|
@@ -12,11 +12,10 @@ export type ReplicaRecord = {
|
|
|
12
12
|
readonly replica: ReplicaAdmission;
|
|
13
13
|
readonly model: ModelState;
|
|
14
14
|
readonly typedSelection: TypedSelection | null;
|
|
15
|
-
readonly selectionModel: ModelState;
|
|
16
15
|
readonly providerOwnedPaths: readonly string[];
|
|
17
16
|
readonly roomVersion: string;
|
|
18
17
|
readonly transfer: string;
|
|
19
|
-
readonly inventory: BootstrapInventory
|
|
18
|
+
readonly inventory: BootstrapInventory;
|
|
20
19
|
readonly key: number;
|
|
21
20
|
};
|
|
22
21
|
export type HeldReplica = {
|
|
@@ -34,8 +33,7 @@ export type Slice = Layer & {
|
|
|
34
33
|
readonly written: Readonly<Record<string, string>>;
|
|
35
34
|
readonly held: ReadonlySet<string>;
|
|
36
35
|
};
|
|
37
|
-
export declare function compositionOf(record: Pick<ReplicaRecord, 'model' | 'typedSelection'
|
|
38
|
-
export declare function sameMembership(record: Pick<ReplicaRecord, 'typedSelection'>, other: Pick<ReplicaRecord, 'typedSelection'>): boolean;
|
|
36
|
+
export declare function compositionOf(record: Pick<ReplicaRecord, 'model' | 'typedSelection'>, builtIn: ModelState): Composition;
|
|
39
37
|
export declare function storedRecord(record: ReplicaRecord): string;
|
|
40
38
|
export declare function slicing(entries: readonly HeldEntry[], paths: Iterable<string>): Generator<number, Slice, void>;
|
|
41
39
|
export declare function entryAt(layer: Layer & {
|
|
@@ -40,6 +40,7 @@ export type RoomDraftParts = {
|
|
|
40
40
|
};
|
|
41
41
|
readonly file?: {
|
|
42
42
|
readonly blob: Blob;
|
|
43
|
+
readonly base?: string | null;
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
export type HeldFile = {
|
|
@@ -112,7 +113,7 @@ export type RoomDraftWrite = {
|
|
|
112
113
|
export declare function staleWrite(current: RoomDraft | null): RoomDraftWrite;
|
|
113
114
|
export type ChangedPart = {
|
|
114
115
|
readonly path: string;
|
|
115
|
-
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | '
|
|
116
|
+
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | 'move' | 'removal' | 'file'>;
|
|
116
117
|
readonly name?: string;
|
|
117
118
|
};
|
|
118
119
|
export type RoomDraftRecord = {
|
|
@@ -132,7 +133,7 @@ export declare function held(current: HeldParts | undefined, parts: RoomDraftPar
|
|
|
132
133
|
export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
|
|
133
134
|
export declare function heldFile(blob: Blob, base: string | null): Promise<HeldFile>;
|
|
134
135
|
export declare function binaryBase(visible: VisibleLayer | undefined, path: string): string | null;
|
|
135
|
-
export declare function changedParts(path: string,
|
|
136
|
+
export declare function changedParts(path: string, parts: HeldParts, visible: VisibleLayer | undefined): readonly ChangedPart[];
|
|
136
137
|
export type TextParts = {
|
|
137
138
|
readonly fields?: Readonly<Record<string, {
|
|
138
139
|
readonly value: unknown;
|
|
@@ -149,6 +150,20 @@ export declare function returnedInto(existing: HeldParts | undefined, returned:
|
|
|
149
150
|
export declare function moveTarget(move: {
|
|
150
151
|
readonly to: string;
|
|
151
152
|
}): string;
|
|
153
|
+
export declare function readSavedParts(named: readonly {
|
|
154
|
+
readonly path: string;
|
|
155
|
+
readonly parts: unknown;
|
|
156
|
+
}[]): readonly {
|
|
157
|
+
readonly path: string;
|
|
158
|
+
readonly parts: RoomDraftParts;
|
|
159
|
+
}[];
|
|
160
|
+
export declare function partsChanges(named: readonly {
|
|
161
|
+
readonly path: string;
|
|
162
|
+
readonly parts: unknown;
|
|
163
|
+
}[]): {
|
|
164
|
+
readonly changes: readonly Change[];
|
|
165
|
+
readonly preconditions: readonly Precondition[];
|
|
166
|
+
};
|
|
152
167
|
export declare function changesOf(path: string, parts: HeldParts): {
|
|
153
168
|
changes: readonly Change[];
|
|
154
169
|
bases: readonly Precondition[];
|
package/dist/mdruntime/save.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type SaveInput = {
|
|
|
21
21
|
providerOwnedPaths: readonly string[];
|
|
22
22
|
providerLimits: readonly ProviderLimit[];
|
|
23
23
|
visible: VisibleLayer;
|
|
24
|
+
folders: ReadonlySet<string>;
|
|
24
25
|
handle: string;
|
|
25
26
|
changes: readonly Change[];
|
|
26
27
|
bases: readonly Precondition[];
|
|
@@ -75,6 +76,7 @@ export type MoveSide = {
|
|
|
75
76
|
operations: OperationScopes;
|
|
76
77
|
providerOwnedPaths: readonly string[];
|
|
77
78
|
visible: VisibleLayer;
|
|
79
|
+
folders: ReadonlySet<string>;
|
|
78
80
|
queued: ReadonlySet<string>;
|
|
79
81
|
unmodeled: boolean;
|
|
80
82
|
validate: Validator;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { Open } from './open.js';
|
|
2
|
-
import type { ProviderRefusal } from './adapter.js';
|
|
3
2
|
import type { ReturnReason } from './room-draft.js';
|
|
4
3
|
export type AttentionEntry = {
|
|
5
4
|
room: string;
|
|
6
5
|
path: string;
|
|
7
6
|
returned: ReturnReason;
|
|
8
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export type UnsentChange = {
|
|
9
9
|
room: string;
|
|
10
|
-
|
|
10
|
+
path: string;
|
|
11
11
|
};
|
|
12
12
|
export type SyncStatus = {
|
|
13
13
|
state: Open<'pending' | 'syncing' | 'synced'>;
|
|
14
14
|
lastCompleted: string | null;
|
|
15
15
|
providerUnreachable: boolean;
|
|
16
16
|
attentionRequired: readonly AttentionEntry[];
|
|
17
|
+
unsent: readonly UnsentChange[];
|
|
17
18
|
reset: string | null;
|
|
18
19
|
};
|
|
19
20
|
export type CycleProgress = {
|
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
import type { BootstrapInventory, Capability,
|
|
1
|
+
import type { BootstrapInventory, Capability, ListedConversation, Member, ProviderLimit } from './adapter.js';
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type Composition } from './collection.js';
|
|
4
4
|
import type { Plan } from './query.js';
|
|
5
5
|
import type { ReplicaRecord } from './replica.js';
|
|
6
6
|
import type { Submission } from './outcome.js';
|
|
7
7
|
import type { RoomDraftRecord, SavedDraft } from './room-draft.js';
|
|
8
|
-
import type { ModelState } from './model.js';
|
|
8
|
+
import type { ModelState, StoredModel } from './model.js';
|
|
9
9
|
import type { SearchWindow } from './search.js';
|
|
10
|
-
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, SearchAsk, StoredEntry, StoredFile, TypedEntry, View
|
|
10
|
+
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, SearchAsk, StoredEntry, StoredFile, TypedEntry, View } from './tables.js';
|
|
11
11
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './tables.js';
|
|
12
|
-
export type TransferWriting = {
|
|
13
|
-
readonly token: string | null;
|
|
14
|
-
readonly written: number;
|
|
15
|
-
};
|
|
16
12
|
export type TransferRecord = {
|
|
17
13
|
readonly locator: string;
|
|
18
14
|
readonly transfer: string;
|
|
19
15
|
readonly selection: string;
|
|
20
16
|
readonly from: string;
|
|
21
17
|
readonly last: string;
|
|
22
|
-
readonly pageToken: string | null;
|
|
23
|
-
readonly writing: TransferWriting | null;
|
|
24
|
-
readonly inventory: BootstrapInventory | null;
|
|
25
18
|
readonly done: BootstrapInventory;
|
|
26
19
|
readonly models: {
|
|
27
20
|
readonly collection: ModelState;
|
|
28
|
-
readonly selection: ModelState;
|
|
29
21
|
};
|
|
30
22
|
readonly key: number | null;
|
|
31
23
|
};
|
|
24
|
+
export type StoredReplica = Omit<ReplicaRecord, 'model'> & {
|
|
25
|
+
readonly model: StoredModel;
|
|
26
|
+
};
|
|
32
27
|
export type PendingState = {
|
|
33
28
|
readonly drafts: readonly SavedDraft[];
|
|
34
29
|
readonly submission: Submission;
|
|
35
30
|
readonly lost: boolean;
|
|
36
31
|
readonly upload?: unknown;
|
|
37
|
-
readonly accepted?: string;
|
|
38
32
|
};
|
|
39
33
|
export type TargetRecord = {
|
|
40
34
|
established: boolean;
|
|
@@ -74,10 +68,6 @@ export type AuthoredWrite = {
|
|
|
74
68
|
saved?: ReadonlyMap<string, readonly SavedDraft[]>;
|
|
75
69
|
roomDrafts?: readonly RoomDraftRecord[];
|
|
76
70
|
consumedRoomDrafts?: readonly string[];
|
|
77
|
-
accepted?: readonly {
|
|
78
|
-
readonly id: string;
|
|
79
|
-
readonly roomVersion: string;
|
|
80
|
-
}[];
|
|
81
71
|
};
|
|
82
72
|
export type StagedPage = {
|
|
83
73
|
readonly entries: readonly StoredEntry[];
|
|
@@ -88,8 +78,7 @@ export type RefreshedPage = StagedPage & {
|
|
|
88
78
|
readonly folderRemovals: readonly string[];
|
|
89
79
|
};
|
|
90
80
|
export type Opened = {
|
|
91
|
-
readonly rooms: ReadonlyMap<string,
|
|
92
|
-
readonly transfers: ReadonlyMap<string, TransferRecord>;
|
|
81
|
+
readonly rooms: ReadonlyMap<string, StoredReplica>;
|
|
93
82
|
readonly unindexed: ReadonlySet<number>;
|
|
94
83
|
readonly overlaid: ReadonlyMap<number, ReadonlySet<string>>;
|
|
95
84
|
readonly erasing: boolean;
|
|
@@ -100,6 +89,8 @@ export type Opened = {
|
|
|
100
89
|
readonly member: Member | null;
|
|
101
90
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
102
91
|
readonly presentation: readonly PresentationRecord[];
|
|
92
|
+
readonly conversationList: readonly ListedConversation[] | null;
|
|
93
|
+
readonly conversationCursor: string | null;
|
|
103
94
|
};
|
|
104
95
|
export type Commit = {
|
|
105
96
|
readonly rooms: readonly RoomCommit[];
|
|
@@ -116,24 +107,25 @@ export type RuntimeStore = {
|
|
|
116
107
|
entries(key: number, view: View, paths: readonly string[]): Promise<readonly HeldEntry[]>;
|
|
117
108
|
typed(key: number, view: View, paths: readonly string[]): Promise<readonly TypedEntry[]>;
|
|
118
109
|
referrers(key: number, view: View, targets: readonly string[], kinds: readonly string[]): Promise<readonly Referrer[]>;
|
|
119
|
-
walk(key: number, view: View, after: string | null, bytes: number): Promise<Walked>;
|
|
120
110
|
files(key: number, view: View, after: string | null, limit: number): Promise<readonly {
|
|
121
111
|
readonly path: string;
|
|
122
112
|
readonly revision: string;
|
|
123
113
|
}[]>;
|
|
114
|
+
folders(key: number, view: View, paths: readonly string[]): Promise<readonly string[]>;
|
|
124
115
|
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
125
116
|
search(ask: SearchAsk): Promise<SearchWindow>;
|
|
126
|
-
stage(record: TransferRecord, composition: Composition, page: StagedPage
|
|
127
|
-
|
|
128
|
-
keepPart(locator: string, token: string, part: Uint8Array): Promise<void>;
|
|
129
|
-
refresh(key: number, page: RefreshedPage): Promise<void>;
|
|
117
|
+
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
118
|
+
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
130
119
|
unrefresh(key: number): Promise<void>;
|
|
131
120
|
commit(commit: Commit): Promise<CommittedWrite>;
|
|
132
121
|
fence(locators: readonly string[]): Promise<void>;
|
|
133
122
|
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
134
|
-
abandon(locator: string
|
|
123
|
+
abandon(locator: string): Promise<void>;
|
|
135
124
|
release(key: number): Promise<void>;
|
|
136
|
-
rederive(key: number,
|
|
125
|
+
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
126
|
+
readonly done: boolean;
|
|
127
|
+
readonly text: number;
|
|
128
|
+
}>;
|
|
137
129
|
fact(name: string, value: unknown): Promise<void>;
|
|
138
130
|
queues(): Promise<readonly QueueRecord[]>;
|
|
139
131
|
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
@@ -155,13 +147,6 @@ export type RuntimeStore = {
|
|
|
155
147
|
keepRoomDraft(record: RoomDraftRecord, files: readonly StoredFile[]): Promise<void>;
|
|
156
148
|
discardRoomDraft(locator: string, path: string): Promise<void>;
|
|
157
149
|
fences(): Promise<readonly string[]>;
|
|
158
|
-
receivedHeads(): Promise<readonly KeptReceipt[]>;
|
|
159
|
-
receivedParts(key: string, count: number): Promise<readonly unknown[]>;
|
|
160
|
-
keepReceived(key: string, head: unknown, part?: {
|
|
161
|
-
index: number;
|
|
162
|
-
value: unknown;
|
|
163
|
-
}): Promise<void>;
|
|
164
|
-
dropReceived(keys: readonly string[]): Promise<void>;
|
|
165
150
|
generation(): Promise<string | null>;
|
|
166
151
|
rememberGeneration(value: string): Promise<void>;
|
|
167
152
|
file(key: string, type: string): Promise<Blob>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HeadChange } from './adapter.js';
|
|
2
|
-
import type
|
|
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';
|
|
5
5
|
export declare const REPLICA_TABLES: readonly string[];
|
|
@@ -34,6 +34,7 @@ export type HeldKey = {
|
|
|
34
34
|
readonly locator: string;
|
|
35
35
|
readonly transfer: string;
|
|
36
36
|
readonly rederiving: number | null;
|
|
37
|
+
readonly searching: number | null;
|
|
37
38
|
};
|
|
38
39
|
export type ReplicaOpened = {
|
|
39
40
|
readonly rooms: readonly {
|
|
@@ -41,11 +42,6 @@ export type ReplicaOpened = {
|
|
|
41
42
|
readonly key: number;
|
|
42
43
|
readonly record: string;
|
|
43
44
|
}[];
|
|
44
|
-
readonly transfers: readonly {
|
|
45
|
-
readonly locator: string;
|
|
46
|
-
readonly key: number;
|
|
47
|
-
readonly record: string;
|
|
48
|
-
}[];
|
|
49
45
|
readonly keys: readonly HeldKey[];
|
|
50
46
|
readonly facts: Readonly<Record<string, string>>;
|
|
51
47
|
readonly presentation: readonly {
|
|
@@ -71,7 +67,7 @@ export type RoomCommit = {
|
|
|
71
67
|
readonly from: number | null;
|
|
72
68
|
};
|
|
73
69
|
readonly refreshed?: true;
|
|
74
|
-
readonly
|
|
70
|
+
readonly composed: Composed;
|
|
75
71
|
readonly confirmed?: {
|
|
76
72
|
readonly set: readonly StoredEntry[];
|
|
77
73
|
readonly removed: readonly string[];
|
|
@@ -90,24 +86,18 @@ export type CountedRoom = {
|
|
|
90
86
|
readonly key: number;
|
|
91
87
|
readonly roots: readonly string[];
|
|
92
88
|
};
|
|
93
|
-
export type Walked = {
|
|
94
|
-
readonly entries: readonly HeldEntry[];
|
|
95
|
-
readonly next: string | null;
|
|
96
|
-
};
|
|
97
|
-
export declare function fingerprint(composition: Composition): string;
|
|
98
89
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
99
90
|
export declare function stage(connection: Connection, request: {
|
|
100
91
|
readonly locator: string;
|
|
101
92
|
readonly transfer: string;
|
|
102
|
-
readonly record: string;
|
|
103
93
|
readonly key: number | null;
|
|
104
|
-
readonly
|
|
94
|
+
readonly fingerprint: string;
|
|
105
95
|
readonly entries: readonly StoredEntry[];
|
|
106
96
|
readonly folders: readonly string[];
|
|
107
|
-
readonly written?: string;
|
|
108
97
|
}): number;
|
|
109
98
|
export declare function refreshing(connection: Connection, request: {
|
|
110
99
|
readonly key: number;
|
|
100
|
+
readonly composed: Composed;
|
|
111
101
|
readonly entries: readonly StoredEntry[];
|
|
112
102
|
readonly removals: readonly string[];
|
|
113
103
|
readonly folders: readonly string[];
|
|
@@ -117,28 +107,23 @@ export declare function unrefresh(connection: Connection, key: number): null;
|
|
|
117
107
|
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
118
108
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
119
109
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
120
|
-
export declare function abandon(connection: Connection, locator: string
|
|
110
|
+
export declare function abandon(connection: Connection, locator: string): null;
|
|
121
111
|
export declare function release(connection: Connection, key: number): null;
|
|
122
112
|
export declare function erase(connection: Connection, locator: string | null, limit: number): {
|
|
123
113
|
readonly remaining: boolean;
|
|
124
114
|
};
|
|
125
|
-
export declare function rederive(connection: Connection, key: number,
|
|
115
|
+
export declare function rederive(connection: Connection, key: number, composed: Composed, bytes: number, ms: number, floor: number): {
|
|
126
116
|
readonly done: boolean;
|
|
117
|
+
readonly text: number;
|
|
127
118
|
};
|
|
128
119
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
129
120
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
130
121
|
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[], kinds: readonly string[]): Referrer[];
|
|
131
|
-
export declare function walk(connection: Connection, key: number, view: View, after: string | null, bytes: number): Walked;
|
|
132
122
|
export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
|
|
133
123
|
readonly path: string;
|
|
134
124
|
readonly revision: string;
|
|
135
125
|
}[];
|
|
126
|
+
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
136
127
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
137
|
-
export declare function transferPart(connection: Connection, locator: string, token: string): Uint8Array | null;
|
|
138
|
-
export declare function keepPart(connection: Connection, request: {
|
|
139
|
-
readonly locator: string;
|
|
140
|
-
readonly token: string;
|
|
141
|
-
readonly part: Uint8Array;
|
|
142
|
-
}): null;
|
|
143
128
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
144
129
|
export declare function ended(connection: Connection): void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Composition } from './collection.js';
|
|
2
|
+
import type { Composed } from './collection.js';
|
|
4
3
|
import { type SearchAsk } from './fulltext.js';
|
|
5
4
|
import { type ConversationWrite, type HeldConversation, type MessageWindow } from './messages.js';
|
|
6
5
|
import type { Plan } from './query.js';
|
|
7
6
|
import type { SearchWindow } from './search.js';
|
|
8
|
-
import { type Committed, type CountedRoom, type HeldEntry, type ReplicaOpened, type Referrer, type RoomCommit, type StoredEntry, type TypedEntry, type View
|
|
9
|
-
export type { Committed, CountedRoom, HeldEntry, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View,
|
|
7
|
+
import { type Committed, type CountedRoom, type HeldEntry, type ReplicaOpened, type Referrer, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
8
|
+
export type { Committed, CountedRoom, HeldEntry, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
10
9
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
11
10
|
export type { SearchAsk } from './fulltext.js';
|
|
12
11
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './messages.js';
|
|
@@ -78,10 +77,6 @@ export type AuthoredRows = {
|
|
|
78
77
|
readonly path: string;
|
|
79
78
|
})[];
|
|
80
79
|
readonly consumedRoomDrafts?: readonly string[];
|
|
81
|
-
readonly amendments?: readonly {
|
|
82
|
-
readonly id: string;
|
|
83
|
-
readonly amendment: string;
|
|
84
|
-
}[];
|
|
85
80
|
};
|
|
86
81
|
export type HeldQueues = {
|
|
87
82
|
readonly queues: readonly {
|
|
@@ -182,12 +177,6 @@ export interface RuntimeRequests {
|
|
|
182
177
|
readonly targets: readonly string[];
|
|
183
178
|
readonly kinds: readonly string[];
|
|
184
179
|
}, readonly Referrer[]>;
|
|
185
|
-
readonly 'replica.walk': Asked<{
|
|
186
|
-
readonly key: number;
|
|
187
|
-
readonly view: View;
|
|
188
|
-
readonly after: string | null;
|
|
189
|
-
readonly bytes: number;
|
|
190
|
-
}, Walked>;
|
|
191
180
|
readonly 'replica.files': Asked<{
|
|
192
181
|
readonly key: number;
|
|
193
182
|
readonly view: View;
|
|
@@ -197,6 +186,11 @@ export interface RuntimeRequests {
|
|
|
197
186
|
readonly path: string;
|
|
198
187
|
readonly revision: string;
|
|
199
188
|
}[]>;
|
|
189
|
+
readonly 'replica.folders': Asked<{
|
|
190
|
+
readonly key: number;
|
|
191
|
+
readonly view: View;
|
|
192
|
+
readonly paths: readonly string[];
|
|
193
|
+
}, readonly string[]>;
|
|
200
194
|
readonly 'replica.typedWithin': Asked<{
|
|
201
195
|
readonly key: number;
|
|
202
196
|
readonly view: View;
|
|
@@ -207,32 +201,17 @@ export interface RuntimeRequests {
|
|
|
207
201
|
readonly rooms: readonly CountedRoom[];
|
|
208
202
|
}, readonly number[]>;
|
|
209
203
|
readonly 'replica.search': Asked<SearchAsk, SearchWindow>;
|
|
210
|
-
readonly 'replica.received': Asked<Nothing, readonly KeptReceipt[]>;
|
|
211
|
-
readonly 'replica.receivedParts': Asked<{
|
|
212
|
-
readonly key: string;
|
|
213
|
-
readonly count: number;
|
|
214
|
-
}, readonly unknown[]>;
|
|
215
204
|
readonly 'replica.stage': Asked<{
|
|
216
205
|
readonly locator: string;
|
|
217
206
|
readonly transfer: string;
|
|
218
|
-
readonly record: string;
|
|
219
207
|
readonly key: number | null;
|
|
220
|
-
readonly
|
|
208
|
+
readonly fingerprint: string;
|
|
221
209
|
readonly entries: readonly StoredEntry[];
|
|
222
210
|
readonly folders: readonly string[];
|
|
223
|
-
readonly written?: string;
|
|
224
211
|
}, number | null>;
|
|
225
|
-
readonly 'replica.transferPart': Asked<{
|
|
226
|
-
readonly locator: string;
|
|
227
|
-
readonly token: string;
|
|
228
|
-
}, Uint8Array | null>;
|
|
229
|
-
readonly 'replica.keepPart': Asked<{
|
|
230
|
-
readonly locator: string;
|
|
231
|
-
readonly token: string;
|
|
232
|
-
readonly part: Uint8Array;
|
|
233
|
-
}, null>;
|
|
234
212
|
readonly 'replica.refresh': Asked<{
|
|
235
213
|
readonly key: number;
|
|
214
|
+
readonly composed: Composed;
|
|
236
215
|
readonly entries: readonly StoredEntry[];
|
|
237
216
|
readonly removals: readonly string[];
|
|
238
217
|
readonly folders: readonly string[];
|
|
@@ -256,16 +235,19 @@ export interface RuntimeRequests {
|
|
|
256
235
|
}>;
|
|
257
236
|
readonly 'replica.abandon': Asked<{
|
|
258
237
|
readonly locator: string;
|
|
259
|
-
|
|
260
|
-
}, number | null>;
|
|
238
|
+
}, null>;
|
|
261
239
|
readonly 'replica.release': Asked<{
|
|
262
240
|
readonly key: number;
|
|
263
241
|
}, null>;
|
|
264
242
|
readonly 'replica.rederive': Asked<{
|
|
265
243
|
readonly key: number;
|
|
266
|
-
readonly
|
|
244
|
+
readonly composed: Composed;
|
|
245
|
+
readonly bytes: number;
|
|
246
|
+
readonly ms: number;
|
|
247
|
+
readonly floor: number;
|
|
267
248
|
}, {
|
|
268
249
|
readonly done: boolean;
|
|
250
|
+
readonly text: number;
|
|
269
251
|
}>;
|
|
270
252
|
readonly 'replica.fact': Asked<{
|
|
271
253
|
readonly name: string;
|
|
@@ -275,17 +257,6 @@ export interface RuntimeRequests {
|
|
|
275
257
|
readonly app: string;
|
|
276
258
|
readonly value: string;
|
|
277
259
|
}, null>;
|
|
278
|
-
readonly 'replica.receive': Asked<{
|
|
279
|
-
readonly key: string;
|
|
280
|
-
readonly head: string;
|
|
281
|
-
readonly part?: {
|
|
282
|
-
readonly index: number;
|
|
283
|
-
readonly value: string;
|
|
284
|
-
};
|
|
285
|
-
}, null>;
|
|
286
|
-
readonly 'replica.unreceive': Asked<{
|
|
287
|
-
readonly keys: readonly string[];
|
|
288
|
-
}, null>;
|
|
289
260
|
readonly 'opened.find': Asked<{
|
|
290
261
|
readonly locator: string;
|
|
291
262
|
readonly path: string;
|
package/dist/mdruntime/wire.d.ts
CHANGED
|
@@ -54,6 +54,14 @@ declare const MEMBERS: {
|
|
|
54
54
|
readonly reach: 'within';
|
|
55
55
|
readonly effect: 'read';
|
|
56
56
|
};
|
|
57
|
+
readonly 'binaryFile.show': {
|
|
58
|
+
readonly reach: 'within';
|
|
59
|
+
readonly effect: 'read';
|
|
60
|
+
};
|
|
61
|
+
readonly 'binaryFile.attach': {
|
|
62
|
+
readonly reach: 'within';
|
|
63
|
+
readonly effect: 'action';
|
|
64
|
+
};
|
|
57
65
|
readonly 'binaryFile.part': {
|
|
58
66
|
readonly reach: 'within';
|
|
59
67
|
readonly effect: 'read';
|
|
@@ -130,10 +138,6 @@ declare const MEMBERS: {
|
|
|
130
138
|
readonly reach: 'within';
|
|
131
139
|
readonly effect: 'action';
|
|
132
140
|
};
|
|
133
|
-
readonly 'conversation.attach': {
|
|
134
|
-
readonly reach: 'within';
|
|
135
|
-
readonly effect: 'action';
|
|
136
|
-
};
|
|
137
141
|
readonly 'conversation.answer': {
|
|
138
142
|
readonly reach: 'within';
|
|
139
143
|
readonly effect: 'action';
|
|
@@ -146,10 +150,6 @@ declare const MEMBERS: {
|
|
|
146
150
|
readonly reach: 'within';
|
|
147
151
|
readonly effect: 'action';
|
|
148
152
|
};
|
|
149
|
-
readonly 'conversation.cancel': {
|
|
150
|
-
readonly reach: 'within';
|
|
151
|
-
readonly effect: 'action';
|
|
152
|
-
};
|
|
153
153
|
readonly 'conversation.delete': {
|
|
154
154
|
readonly reach: 'within';
|
|
155
155
|
readonly effect: 'action';
|
package/dist/test-host.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './mdruntime/client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HouseAnalyticsChoice, HouseAppMessage, HouseChatOptions, HouseExternalAnswer, HouseExternalRequest, HouseNavigationMode, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab } from './index.js';
|
|
3
3
|
export interface HouseBridgeNavigation {
|
|
4
4
|
readonly mode: HouseNavigationMode;
|
|
5
5
|
readonly address: string;
|
|
@@ -21,9 +21,6 @@ export interface HouseBridgeTestHost {
|
|
|
21
21
|
publish(status: HouseStatus): void;
|
|
22
22
|
message(message: HouseAppMessage): void;
|
|
23
23
|
attachRuntime(runtime: MdRuntimeClient): void;
|
|
24
|
-
checkpoint(): Promise<HouseTask>;
|
|
25
|
-
restore(task: HouseTask | null): Promise<boolean>;
|
|
26
|
-
settle(activation: HouseActivation): void;
|
|
27
24
|
}
|
|
28
25
|
export interface HouseBridgeTestHostOptions {
|
|
29
26
|
readonly address?: string;
|
package/dist/test-host.js
CHANGED
|
@@ -58,7 +58,6 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
58
58
|
let published = options.status ?? null;
|
|
59
59
|
let shown = null;
|
|
60
60
|
let seen = null;
|
|
61
|
-
let cooperation = null;
|
|
62
61
|
let attached = () => { };
|
|
63
62
|
const runtime = new Promise((resolve) => {
|
|
64
63
|
attached = resolve;
|
|
@@ -160,19 +159,8 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
160
159
|
consents.push(choice);
|
|
161
160
|
publish({ ...published, analytics: { measures: true, choice } });
|
|
162
161
|
},
|
|
163
|
-
cooperate(
|
|
164
|
-
cooperation = given;
|
|
165
|
-
return () => {
|
|
166
|
-
if (cooperation === given)
|
|
167
|
-
cooperation = null;
|
|
168
|
-
};
|
|
169
|
-
},
|
|
162
|
+
cooperate: () => () => { },
|
|
170
163
|
};
|
|
171
|
-
function cooperating() {
|
|
172
|
-
if (cooperation === null)
|
|
173
|
-
throw new Error('the App registered no cooperation');
|
|
174
|
-
return cooperation;
|
|
175
|
-
}
|
|
176
164
|
Object.defineProperty(globalThis, 'houseBridge', { value: bridge, configurable: true });
|
|
177
165
|
if (published !== null)
|
|
178
166
|
publish(published);
|
|
@@ -198,19 +186,5 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
198
186
|
attachRuntime(client) {
|
|
199
187
|
attached(client);
|
|
200
188
|
},
|
|
201
|
-
async checkpoint() {
|
|
202
|
-
const held = cooperating();
|
|
203
|
-
await held.checkpoint();
|
|
204
|
-
await held.persist();
|
|
205
|
-
return JSON.parse(JSON.stringify((await held.capture()) ?? null));
|
|
206
|
-
},
|
|
207
|
-
async restore(task) {
|
|
208
|
-
const held = cooperating();
|
|
209
|
-
await held.restore(task);
|
|
210
|
-
return (await held.ready()) === true;
|
|
211
|
-
},
|
|
212
|
-
settle(activation) {
|
|
213
|
-
cooperating().settle(activation);
|
|
214
|
-
},
|
|
215
189
|
};
|
|
216
190
|
}
|