@agentshouse/app-bridge 0.1.0-c646d0da70608 → 0.1.0-c66ec79ae3f1a

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.
Files changed (47) hide show
  1. package/README.md +4 -4
  2. package/dist/calls.d.ts +897 -66
  3. package/dist/index.d.ts +15 -4
  4. package/dist/mdmodel/condition.d.ts +20 -8
  5. package/dist/mdmodel/definition.d.ts +16 -1
  6. package/dist/mdmodel/document.d.ts +5 -5
  7. package/dist/mdmodel/index.d.ts +10 -8
  8. package/dist/mdmodel/links.d.ts +28 -0
  9. package/dist/mdmodel/paths.d.ts +9 -1
  10. package/dist/mdmodel/project.d.ts +1 -0
  11. package/dist/mdmodel/types.d.ts +27 -4
  12. package/dist/mdmodel/validate.d.ts +27 -3
  13. package/dist/mdruntime/adapter.d.ts +67 -24
  14. package/dist/mdruntime/chain.d.ts +10 -0
  15. package/dist/mdruntime/change-set.d.ts +8 -9
  16. package/dist/mdruntime/change.d.ts +31 -1
  17. package/dist/mdruntime/client.d.ts +11 -2
  18. package/dist/mdruntime/collection.d.ts +6 -19
  19. package/dist/mdruntime/compile.d.ts +10 -0
  20. package/dist/mdruntime/connection.d.ts +23 -9
  21. package/dist/mdruntime/conversation.d.ts +15 -3
  22. package/dist/mdruntime/durability.d.ts +2 -1
  23. package/dist/mdruntime/file.d.ts +2 -10
  24. package/dist/mdruntime/observation.d.ts +14 -0
  25. package/dist/mdruntime/opened.d.ts +21 -0
  26. package/dist/mdruntime/outcome.d.ts +35 -4
  27. package/dist/mdruntime/overlay.d.ts +3 -5
  28. package/dist/mdruntime/query.d.ts +29 -2
  29. package/dist/mdruntime/reach.d.ts +6 -3
  30. package/dist/mdruntime/readiness.d.ts +1 -1
  31. package/dist/mdruntime/recovery.d.ts +2 -2
  32. package/dist/mdruntime/replica.d.ts +55 -33
  33. package/dist/mdruntime/room-draft.d.ts +15 -1
  34. package/dist/mdruntime/save.d.ts +51 -14
  35. package/dist/mdruntime/search.d.ts +25 -5
  36. package/dist/mdruntime/seed.d.ts +15 -0
  37. package/dist/mdruntime/shared.d.ts +8 -3
  38. package/dist/mdruntime/store.d.ts +99 -71
  39. package/dist/mdruntime/stored.d.ts +142 -0
  40. package/dist/mdruntime/tables.d.ts +319 -0
  41. package/dist/mdruntime/turn.d.ts +5 -3
  42. package/dist/mdruntime/wire.d.ts +32 -0
  43. package/dist/test-host.js +1 -1
  44. package/docs/families.md +8 -5
  45. package/package.json +1 -1
  46. package/dist/mdruntime/acquisition.d.ts +0 -13
  47. package/dist/mdruntime/rows.d.ts +0 -36
@@ -0,0 +1,142 @@
1
+ import type { HeadChange } from './adapter.js';
2
+ import type { Composition } from './collection.js';
3
+ import type { HeldBinary } from './overlay.js';
4
+ import type { SearchedDocument } from './search.js';
5
+ import type { Connection } from './tables.js';
6
+ export declare const REPLICA_TABLES: readonly string[];
7
+ export type View = 'confirmed' | 'visible' | 'refreshed';
8
+ export type StoredEntry = {
9
+ readonly path: string;
10
+ readonly content: string | null;
11
+ readonly binary: HeldBinary | null;
12
+ readonly revision: string | null;
13
+ readonly fileId: string | null;
14
+ readonly change: HeadChange | null;
15
+ readonly written: string | null;
16
+ };
17
+ export type OverlayEntry = StoredEntry & {
18
+ readonly present: boolean;
19
+ };
20
+ export type HeldEntry = StoredEntry & {
21
+ readonly type: string | null;
22
+ };
23
+ export type TypedEntry = {
24
+ readonly path: string;
25
+ readonly type: string | null;
26
+ readonly binary: boolean;
27
+ };
28
+ export type Referrer = {
29
+ readonly path: string;
30
+ readonly target: string;
31
+ readonly kind: string;
32
+ };
33
+ export type HeldKey = {
34
+ readonly key: number;
35
+ readonly locator: string;
36
+ readonly transfer: string;
37
+ readonly rederiving: number | null;
38
+ };
39
+ export type ReplicaOpened = {
40
+ readonly rooms: readonly {
41
+ readonly locator: string;
42
+ readonly key: number;
43
+ readonly record: string;
44
+ }[];
45
+ readonly transfers: readonly {
46
+ readonly locator: string;
47
+ readonly key: number;
48
+ readonly record: string;
49
+ }[];
50
+ readonly keys: readonly HeldKey[];
51
+ readonly facts: Readonly<Record<string, string>>;
52
+ readonly presentation: readonly {
53
+ readonly app: string;
54
+ readonly value: string;
55
+ }[];
56
+ readonly overlaid: readonly {
57
+ readonly key: number;
58
+ readonly path: string;
59
+ }[];
60
+ readonly erasing: readonly {
61
+ readonly key: number;
62
+ readonly locator: string;
63
+ }[];
64
+ readonly orphans: readonly number[];
65
+ };
66
+ export type RoomCommit = {
67
+ readonly locator: string;
68
+ readonly key: number;
69
+ readonly record?: string;
70
+ readonly roots?: readonly string[];
71
+ readonly published?: {
72
+ readonly from: number | null;
73
+ };
74
+ readonly refreshed?: true;
75
+ readonly composition?: Composition;
76
+ readonly confirmed?: {
77
+ readonly set: readonly StoredEntry[];
78
+ readonly removed: readonly string[];
79
+ };
80
+ readonly overlay?: {
81
+ readonly set: readonly OverlayEntry[];
82
+ readonly cleared: readonly string[];
83
+ };
84
+ };
85
+ export type Committed = {
86
+ readonly counts: Readonly<Record<string, number>>;
87
+ readonly changed: Readonly<Record<string, readonly string[] | null>>;
88
+ readonly prepared: Readonly<Record<string, boolean>>;
89
+ };
90
+ export type CountedRoom = {
91
+ readonly key: number;
92
+ readonly roots: readonly string[];
93
+ };
94
+ export type Walked = {
95
+ readonly entries: readonly HeldEntry[];
96
+ readonly next: string | null;
97
+ };
98
+ export declare function fingerprint(composition: Composition): string;
99
+ export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
100
+ export declare function stage(connection: Connection, request: {
101
+ readonly locator: string;
102
+ readonly transfer: string;
103
+ readonly record: string | null;
104
+ readonly key: number | null;
105
+ readonly composition: Composition;
106
+ readonly entries: readonly StoredEntry[];
107
+ readonly folders: readonly string[];
108
+ }): number;
109
+ export declare function refreshing(connection: Connection, request: {
110
+ readonly key: number;
111
+ readonly entries: readonly StoredEntry[];
112
+ readonly removals: readonly string[];
113
+ readonly folders: readonly string[];
114
+ readonly folderRemovals: readonly string[];
115
+ }): null;
116
+ export declare function unrefresh(connection: Connection, key: number): null;
117
+ export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
118
+ export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
119
+ export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
120
+ export declare function abandon(connection: Connection, locator: string, kept: boolean): number | null;
121
+ export declare function release(connection: Connection, key: number): null;
122
+ export declare function erase(connection: Connection, locator: string | null, limit: number): {
123
+ readonly remaining: boolean;
124
+ };
125
+ export declare function rederive(connection: Connection, key: number, limit: number): {
126
+ readonly done: boolean;
127
+ };
128
+ export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
129
+ export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
130
+ 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
+ export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
133
+ readonly path: string;
134
+ readonly revision: string;
135
+ }[];
136
+ export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
137
+ export declare function searched(connection: Connection, key: number, locator: string, after: string | null, limit: number, only: readonly string[] | null): {
138
+ readonly documents: readonly SearchedDocument[];
139
+ readonly next: string | null;
140
+ };
141
+ export declare function opened(connection: Connection): ReplicaOpened;
142
+ export declare function ended(connection: Connection): void;
@@ -0,0 +1,319 @@
1
+ import { type QueryAnswer, type QueryRoom } from './compile.js';
2
+ import type { KeptReceipt } from './adapter.js';
3
+ import type { Composition } from './collection.js';
4
+ import type { Plan } from './query.js';
5
+ import type { SearchedDocument } from './search.js';
6
+ import { type Committed, type CountedRoom, type HeldEntry, type ReplicaOpened, type Referrer, type RoomCommit, type StoredEntry, type TypedEntry, type View, type Walked } from './stored.js';
7
+ export type { Committed, CountedRoom, HeldEntry, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, Walked, } from './stored.js';
8
+ export type { QueryAnswer, QueryRoom } from './compile.js';
9
+ export type Value = string | number | bigint | Uint8Array | null;
10
+ export type Row = Readonly<Record<string, Value>>;
11
+ export interface Connection {
12
+ run(sql: string, bind?: readonly Value[]): void;
13
+ rows(sql: string, bind?: readonly Value[]): readonly Row[];
14
+ collate(name: string, compare: (left: string, right: string) => number): void;
15
+ }
16
+ export interface SqliteEngine {
17
+ readonly capi: {
18
+ readonly SQLITE_UTF8: number;
19
+ sqlite3_create_collation_v2(database: number, name: string, encoding: number, argument: number, compare: (argument: number, leftLength: number, left: number, rightLength: number, right: number) => number, destroy: number): number;
20
+ };
21
+ readonly wasm: {
22
+ heap8u(): Uint8Array;
23
+ };
24
+ }
25
+ export interface SqliteDatabase {
26
+ readonly pointer: number;
27
+ exec(options: {
28
+ readonly sql: string;
29
+ readonly bind: readonly Value[];
30
+ readonly rowMode?: 'object';
31
+ readonly returnValue?: 'resultRows';
32
+ }): Row[];
33
+ }
34
+ export declare function sqliteConnection(engine: SqliteEngine, database: SqliteDatabase): Connection;
35
+ export declare const FILE_PART_BYTES = 1048576;
36
+ export declare const RUNTIME_TABLES: readonly string[];
37
+ export type AuthoredFact = 'holder' | 'binding' | 'generation';
38
+ export type StoredFile = {
39
+ readonly key: string;
40
+ readonly blob: Blob;
41
+ };
42
+ export interface FileSpool {
43
+ held(): Iterable<string>;
44
+ spool(key: string, type: string, parts: Iterable<Uint8Array>): Promise<Blob>;
45
+ drop(key: string): Promise<void>;
46
+ }
47
+ export type KeptPending = {
48
+ readonly id: string;
49
+ readonly batch: string;
50
+ readonly state: string;
51
+ readonly files: readonly string[];
52
+ };
53
+ export type KeptRecord = {
54
+ readonly record: string;
55
+ readonly files: readonly string[];
56
+ };
57
+ export type AuthoredRows = {
58
+ readonly locator: string;
59
+ readonly order?: readonly string[];
60
+ readonly added?: readonly KeptPending[];
61
+ readonly founded?: readonly Omit<KeptPending, 'state'>[];
62
+ readonly roomDrafts?: readonly (KeptRecord & {
63
+ readonly path: string;
64
+ })[];
65
+ readonly consumedRoomDrafts?: readonly string[];
66
+ readonly amendments?: readonly {
67
+ readonly id: string;
68
+ readonly amendment: string;
69
+ }[];
70
+ };
71
+ export type HeldQueues = {
72
+ readonly queues: readonly {
73
+ readonly locator: string;
74
+ readonly ids: readonly string[];
75
+ }[];
76
+ readonly pending: readonly {
77
+ readonly locator: string;
78
+ readonly id: string;
79
+ readonly batch: string;
80
+ readonly state: string;
81
+ }[];
82
+ };
83
+ export type OpenedFile = {
84
+ readonly key: string;
85
+ readonly byteLength: number;
86
+ readonly mediaType: string;
87
+ };
88
+ type Asked<A, R> = {
89
+ readonly asked: A;
90
+ readonly answer: R;
91
+ };
92
+ type Nothing = Readonly<Record<never, never>>;
93
+ export type CommittedWrite = Committed & {
94
+ readonly fenced: string | null;
95
+ };
96
+ export type AuthoredWrite = {
97
+ readonly writes: readonly AuthoredRows[];
98
+ readonly files: readonly StoredFile[];
99
+ readonly whole: boolean;
100
+ readonly discards?: readonly string[];
101
+ };
102
+ export interface RuntimeRequests {
103
+ readonly 'authored.queues': Asked<Nothing, HeldQueues>;
104
+ readonly 'authored.roomDrafts': Asked<Nothing, readonly string[]>;
105
+ readonly 'authored.chatDrafts': Asked<Nothing, readonly string[]>;
106
+ readonly 'authored.calls': Asked<Nothing, readonly string[]>;
107
+ readonly 'authored.fences': Asked<Nothing, readonly string[]>;
108
+ readonly 'authored.fact': Asked<{
109
+ readonly name: AuthoredFact;
110
+ }, string | null>;
111
+ readonly 'authored.file': Asked<{
112
+ readonly key: string;
113
+ readonly type: string;
114
+ }, Blob>;
115
+ readonly 'authored.amend': Asked<{
116
+ readonly locator: string;
117
+ readonly id: string;
118
+ readonly amendment: string;
119
+ }, null>;
120
+ readonly 'authored.roomDraft': Asked<{
121
+ readonly locator: string;
122
+ readonly path: string;
123
+ readonly kept: KeptRecord | null;
124
+ readonly files: readonly StoredFile[];
125
+ }, string | null>;
126
+ readonly 'authored.chatDraft': Asked<{
127
+ readonly kept: readonly {
128
+ readonly conversation: string;
129
+ readonly record: string;
130
+ }[];
131
+ readonly dropped: readonly string[];
132
+ }, null>;
133
+ readonly 'authored.call': Asked<{
134
+ readonly operation: string;
135
+ readonly kept: KeptRecord | null;
136
+ readonly files: readonly StoredFile[];
137
+ }, null>;
138
+ readonly 'authored.remember': Asked<{
139
+ readonly name: AuthoredFact;
140
+ readonly value: string;
141
+ }, null>;
142
+ readonly 'authored.claim': Asked<{
143
+ readonly holder: string;
144
+ }, boolean>;
145
+ readonly 'authored.end': Asked<{
146
+ readonly holder: string | null;
147
+ }, boolean>;
148
+ readonly 'replica.open': Asked<Nothing, ReplicaOpened>;
149
+ readonly 'replica.query': Asked<{
150
+ readonly plan: Plan;
151
+ readonly rooms: readonly QueryRoom[];
152
+ readonly budget: number | null;
153
+ }, QueryAnswer>;
154
+ readonly 'replica.entries': Asked<{
155
+ readonly key: number;
156
+ readonly view: View;
157
+ readonly paths: readonly string[];
158
+ }, readonly HeldEntry[]>;
159
+ readonly 'replica.typed': Asked<{
160
+ readonly key: number;
161
+ readonly view: View;
162
+ readonly paths: readonly string[];
163
+ }, readonly TypedEntry[]>;
164
+ readonly 'replica.referrers': Asked<{
165
+ readonly key: number;
166
+ readonly view: View;
167
+ readonly targets: readonly string[];
168
+ readonly kinds: readonly string[];
169
+ }, readonly Referrer[]>;
170
+ readonly 'replica.walk': Asked<{
171
+ readonly key: number;
172
+ readonly view: View;
173
+ readonly after: string | null;
174
+ readonly bytes: number;
175
+ }, Walked>;
176
+ readonly 'replica.files': Asked<{
177
+ readonly key: number;
178
+ readonly view: View;
179
+ readonly after: string | null;
180
+ readonly limit: number;
181
+ }, readonly {
182
+ readonly path: string;
183
+ readonly revision: string;
184
+ }[]>;
185
+ readonly 'replica.typedWithin': Asked<{
186
+ readonly key: number;
187
+ readonly view: View;
188
+ readonly roots: readonly string[];
189
+ readonly within: boolean;
190
+ }, boolean>;
191
+ readonly 'replica.counts': Asked<{
192
+ readonly rooms: readonly CountedRoom[];
193
+ }, readonly number[]>;
194
+ readonly 'replica.searched': Asked<{
195
+ readonly key: number;
196
+ readonly locator: string;
197
+ readonly after: string | null;
198
+ readonly limit: number;
199
+ readonly paths: readonly string[] | null;
200
+ }, {
201
+ readonly documents: readonly SearchedDocument[];
202
+ readonly next: string | null;
203
+ }>;
204
+ readonly 'replica.received': Asked<Nothing, readonly KeptReceipt[]>;
205
+ readonly 'replica.receivedParts': Asked<{
206
+ readonly key: string;
207
+ readonly count: number;
208
+ }, readonly unknown[]>;
209
+ readonly 'replica.stage': Asked<{
210
+ readonly locator: string;
211
+ readonly transfer: string;
212
+ readonly record: string | null;
213
+ readonly key: number | null;
214
+ readonly composition: Composition;
215
+ readonly entries: readonly StoredEntry[];
216
+ readonly folders: readonly string[];
217
+ }, number | null>;
218
+ readonly 'replica.refresh': Asked<{
219
+ readonly key: number;
220
+ readonly entries: readonly StoredEntry[];
221
+ readonly removals: readonly string[];
222
+ readonly folders: readonly string[];
223
+ readonly folderRemovals: readonly string[];
224
+ }, null>;
225
+ readonly 'replica.unrefresh': Asked<{
226
+ readonly key: number;
227
+ }, null>;
228
+ readonly 'replica.commit': Asked<{
229
+ readonly authored?: AuthoredWrite;
230
+ readonly rooms: readonly RoomCommit[];
231
+ }, CommittedWrite>;
232
+ readonly 'replica.fence': Asked<{
233
+ readonly locators: readonly string[];
234
+ }, null>;
235
+ readonly 'replica.erase': Asked<{
236
+ readonly locator: string | null;
237
+ readonly limit: number;
238
+ }, {
239
+ readonly remaining: boolean;
240
+ }>;
241
+ readonly 'replica.abandon': Asked<{
242
+ readonly locator: string;
243
+ readonly kept: boolean;
244
+ }, number | null>;
245
+ readonly 'replica.release': Asked<{
246
+ readonly key: number;
247
+ }, null>;
248
+ readonly 'replica.rederive': Asked<{
249
+ readonly key: number;
250
+ readonly limit: number;
251
+ }, {
252
+ readonly done: boolean;
253
+ }>;
254
+ readonly 'replica.fact': Asked<{
255
+ readonly name: string;
256
+ readonly value: string;
257
+ }, null>;
258
+ readonly 'replica.present': Asked<{
259
+ readonly app: string;
260
+ readonly value: string;
261
+ }, null>;
262
+ readonly 'replica.receive': Asked<{
263
+ readonly key: string;
264
+ readonly head: string;
265
+ readonly part?: {
266
+ readonly index: number;
267
+ readonly value: string;
268
+ };
269
+ }, null>;
270
+ readonly 'replica.unreceive': Asked<{
271
+ readonly keys: readonly string[];
272
+ }, null>;
273
+ readonly 'opened.find': Asked<{
274
+ readonly locator: string;
275
+ readonly path: string;
276
+ readonly revision: string;
277
+ }, OpenedFile | null>;
278
+ readonly 'opened.begin': Asked<{
279
+ readonly key: string;
280
+ readonly locator: string;
281
+ readonly path: string;
282
+ readonly revision: string;
283
+ readonly mediaType: string;
284
+ }, boolean>;
285
+ readonly 'opened.part': Asked<{
286
+ readonly key: string;
287
+ readonly part: number;
288
+ readonly bytes: Uint8Array;
289
+ }, boolean>;
290
+ readonly 'opened.keep': Asked<{
291
+ readonly key: string;
292
+ readonly sha256: string;
293
+ readonly byteLength: number;
294
+ readonly parts: number;
295
+ }, boolean>;
296
+ readonly 'opened.drop': Asked<{
297
+ readonly key: string;
298
+ }, null>;
299
+ readonly 'opened.clean': Asked<Nothing, number>;
300
+ readonly 'file.part': Asked<{
301
+ readonly key: string;
302
+ readonly part: number;
303
+ }, Uint8Array | null>;
304
+ }
305
+ export type RuntimeKind = keyof RuntimeRequests;
306
+ export type RuntimeRequest<K extends RuntimeKind = RuntimeKind> = {
307
+ readonly [Kind in K]: {
308
+ readonly kind: Kind;
309
+ } & RuntimeRequests[Kind]['asked'];
310
+ }[K];
311
+ export type RuntimeAnswer<K extends RuntimeKind> = RuntimeRequests[K]['answer'];
312
+ export interface RuntimeDatabase {
313
+ ask<K extends RuntimeKind>(request: RuntimeRequest<K>): Promise<RuntimeAnswer<K>>;
314
+ }
315
+ export declare function isRuntime(request: {
316
+ readonly kind: string;
317
+ }): request is RuntimeRequest;
318
+ export declare function readsRuntime(request: RuntimeRequest): boolean;
319
+ export declare function answerRuntime(connection: Connection, request: RuntimeRequest, spool: FileSpool): unknown;
@@ -1,6 +1,8 @@
1
1
  export declare function yielded(): Promise<void>;
2
2
  export declare const ROW_WEIGHT = 256;
3
3
  export type Later<T> = T | Promise<T>;
4
- export declare function after<T, R>(value: Later<T>, next: (value: T) => R): Later<R>;
5
- export declare function inUnits<T>(items: Iterable<T>, each: (item: T) => number): Later<void>;
6
- export declare function inChunks<T>(items: readonly T[], weigh: (item: T) => number, each: (chunk: readonly T[]) => void): Promise<void>;
4
+ export declare function after<T, R>(value: Later<T>, next: (value: T) => Later<R>): Later<R>;
5
+ export declare function paced(): (weight: number) => Later<void>;
6
+ export declare function inUnits<T>(items: Iterable<T>, each: (item: T) => number, ended?: () => void, paused?: () => Promise<void>): Later<void>;
7
+ export declare function finished<R>(steps: Generator<number, R, void>): R;
8
+ export declare function stepped<R>(steps: Generator<number, R, void>): Later<R>;
@@ -34,18 +34,34 @@ declare const MEMBERS: {
34
34
  readonly reach: 'within';
35
35
  readonly effect: 'write';
36
36
  };
37
+ readonly saveParts: {
38
+ readonly reach: 'within';
39
+ readonly effect: 'write';
40
+ };
37
41
  readonly history: {
38
42
  readonly reach: 'within';
39
43
  readonly effect: 'read';
40
44
  };
45
+ readonly resolve: {
46
+ readonly reach: 'within';
47
+ readonly effect: 'read';
48
+ };
41
49
  readonly 'binaryFile.read': {
42
50
  readonly reach: 'within';
43
51
  readonly effect: 'read';
44
52
  };
53
+ readonly 'binaryFile.link': {
54
+ readonly reach: 'within';
55
+ readonly effect: 'read';
56
+ };
45
57
  readonly 'binaryFile.readReference': {
46
58
  readonly reach: 'within';
47
59
  readonly effect: 'read';
48
60
  };
61
+ readonly 'binaryFile.part': {
62
+ readonly reach: 'within';
63
+ readonly effect: 'read';
64
+ };
49
65
  readonly call: {
50
66
  readonly reach: 'actions';
51
67
  readonly effect: 'action';
@@ -58,6 +74,10 @@ declare const MEMBERS: {
58
74
  readonly reach: 'whole';
59
75
  readonly effect: 'read';
60
76
  };
77
+ readonly cleanUp: {
78
+ readonly reach: 'whole';
79
+ readonly effect: 'write';
80
+ };
61
81
  readonly persistence: {
62
82
  readonly reach: 'runtime';
63
83
  readonly effect: 'read';
@@ -94,6 +114,10 @@ declare const MEMBERS: {
94
114
  readonly reach: 'app';
95
115
  readonly effect: 'write';
96
116
  };
117
+ readonly 'presentation.edit': {
118
+ readonly reach: 'app';
119
+ readonly effect: 'write';
120
+ };
97
121
  readonly 'conversation.list': {
98
122
  readonly reach: 'within';
99
123
  readonly effect: 'read';
@@ -110,6 +134,10 @@ declare const MEMBERS: {
110
134
  readonly reach: 'within';
111
135
  readonly effect: 'action';
112
136
  };
137
+ readonly 'conversation.attach': {
138
+ readonly reach: 'within';
139
+ readonly effect: 'action';
140
+ };
113
141
  readonly 'conversation.answer': {
114
142
  readonly reach: 'within';
115
143
  readonly effect: 'action';
@@ -134,6 +162,10 @@ declare const MEMBERS: {
134
162
  readonly reach: 'within';
135
163
  readonly effect: 'write';
136
164
  };
165
+ readonly 'chatDraft.prepend': {
166
+ readonly reach: 'within';
167
+ readonly effect: 'write';
168
+ };
137
169
  readonly 'chatDraft.discard': {
138
170
  readonly reach: 'within';
139
171
  readonly effect: 'write';
package/dist/test-host.js CHANGED
@@ -99,7 +99,7 @@ export function createHouseBridgeTestHost(options = {}) {
99
99
  });
100
100
  }
101
101
  const bridge = {
102
- runtime,
102
+ runtime: runtime,
103
103
  address: () => shown,
104
104
  onAddress(listener) {
105
105
  return followHeld(addressListeners, listener, () => shown);
package/docs/families.md CHANGED
@@ -12,7 +12,9 @@
12
12
  purpose-bound authenticated pages. The shell navigates only to a same-origin
13
13
  absolute path, carries its current address as the return target, and the page
14
14
  returns there when it completes. An App names an address House gave it in a
15
- reading and composes none.
15
+ reading and composes one only for `/bind/<app_ref>`, where the User binds
16
+ its Rooms and connects its account slots, with `?slot=<name>` to open at one
17
+ slot.
16
18
  - **Installation** - `install()` offers the page as a Home-screen app. Where the
17
19
  browser has an install prompt ready the shell shows it and the call resolves
18
20
  `'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
@@ -67,14 +69,15 @@
67
69
  refusal is House's `{ error: { code, retryable } }`, `app_release_not_found` for an
68
70
  App with no release; a read House does not answer, or one that outlived
69
71
  the browser's signed-in User, is `null`.
70
- - **External calls** - `callExternal({ url, method, headers, body, slot })`
72
+ - **External calls** - `callExternal({ url, method, headers, body, slot, room_ref })`
71
73
  has House's server send an HTTPS request to one of the release's declared
72
74
  external origins and resolves with the service's `status`, `headers` and its
73
75
  body as `body` text or `body_base64`, or a refusal as House's
74
76
  `{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
75
- App and its running release; naming an account slot places the key of the
76
- account the User connected to it, which the App never sees, and naming none
77
- sends no key. A Site's call names no slot, and the House panel names an
77
+ App and its running release; naming an account slot and one of the App's
78
+ bound Rooms places the key of the account that Room connects to the slot,
79
+ when the User holds one of the account's roles there, which the App never
80
+ sees, and naming neither sends no key. A Site's call names no slot, and the House panel names an
78
81
  `account` instead. `body_base64` replaces `body` for bytes.
79
82
  - **App messages** - `messages(listener)` hands the listener each message
80
83
  another holder of this App sends to this User's running copies, as `from`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-c646d0da70608",
3
+ "version": "0.1.0-c66ec79ae3f1a",
4
4
  "description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications and the icon badge, status, Site image reads, App release code, App and Site screenshot reads, and App messages, with an accessor and an in-page test host.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,13 +0,0 @@
1
- export type RuntimeDemand = {
2
- readonly whole: boolean;
3
- readonly rooms: readonly string[];
4
- readonly handles: readonly string[];
5
- readonly conversations: boolean;
6
- };
7
- export declare const WHOLE_DEMAND: RuntimeDemand;
8
- export declare function demanded(demand: RuntimeDemand, room: {
9
- readonly locator: string;
10
- readonly handle: string;
11
- }): boolean;
12
- export declare function wider(next: RuntimeDemand, current: RuntimeDemand): boolean;
13
- export declare function narrower(next: RuntimeDemand, current: RuntimeDemand): boolean;
@@ -1,36 +0,0 @@
1
- import { type Frontmatter } from '../mdmodel/index.js';
2
- import type { HeadChange } from './adapter.js';
3
- import type { BinaryFileRecord } from './binary.js';
4
- import { type Composition } from './collection.js';
5
- type Fields = Readonly<Record<string, unknown>>;
6
- export type DocumentRow = {
7
- key: string;
8
- kind: 'document';
9
- room: string;
10
- path: string;
11
- type: string | null;
12
- fields: Fields;
13
- values: Fields;
14
- reached: Readonly<Record<string, readonly unknown[]>>;
15
- directories: readonly string[];
16
- text: string | null;
17
- change: HeadChange | null;
18
- binary: BinaryFileRecord | null;
19
- };
20
- export type ReferenceRow = {
21
- key: string;
22
- kind: 'reference';
23
- room: string;
24
- source: string;
25
- target: string;
26
- field: string;
27
- forms: readonly string[];
28
- path: string;
29
- type: string;
30
- };
31
- export type Row = DocumentRow | ReferenceRow;
32
- export declare function documentKey(room: string, path: string): string;
33
- export declare function roomOfKey(key: string): string;
34
- export declare function markdownPath(path: string): boolean;
35
- export declare function rowsOf(room: string, path: string, document: Frontmatter | null, composition: Composition, change: HeadChange | null, binary: BinaryFileRecord | null): readonly Row[];
36
- export {};