@agentshouse/app-bridge 0.1.0-ca16e10794fd8 → 0.1.0-ca2cc2cd99f13
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 +827 -16
- package/dist/mdmodel/condition.d.ts +22 -5
- package/dist/mdmodel/document.d.ts +2 -1
- package/dist/mdmodel/index.d.ts +15 -5
- package/dist/mdmodel/kinds.d.ts +17 -0
- package/dist/mdmodel/query/language.d.ts +217 -0
- package/dist/mdmodel/query/match.d.ts +11 -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 +12 -0
- package/dist/mdmodel/validate.d.ts +3 -2
- package/dist/mdruntime/adapter.d.ts +73 -52
- package/dist/mdruntime/chain.d.ts +2 -1
- package/dist/mdruntime/client.d.ts +6 -5
- package/dist/mdruntime/collection.d.ts +2 -4
- package/dist/mdruntime/compile.d.ts +1 -6
- package/dist/mdruntime/connection.d.ts +5 -7
- package/dist/mdruntime/conversation.d.ts +15 -14
- package/dist/mdruntime/durability.d.ts +0 -1
- package/dist/mdruntime/media.d.ts +1 -1
- package/dist/mdruntime/messages.d.ts +2 -2
- package/dist/mdruntime/model.d.ts +1 -3
- package/dist/mdruntime/observation.d.ts +2 -2
- package/dist/mdruntime/outcome.d.ts +0 -3
- package/dist/mdruntime/query.d.ts +5 -209
- package/dist/mdruntime/reach.d.ts +7 -7
- package/dist/mdruntime/readiness.d.ts +3 -17
- package/dist/mdruntime/recovery.d.ts +1 -0
- package/dist/mdruntime/replica.d.ts +3 -3
- package/dist/mdruntime/room-draft.d.ts +16 -1
- package/dist/mdruntime/search.d.ts +12 -63
- package/dist/mdruntime/status.d.ts +0 -4
- package/dist/mdruntime/store.d.ts +19 -33
- package/dist/mdruntime/stored.d.ts +34 -26
- package/dist/mdruntime/tables.d.ts +35 -44
- package/dist/mdruntime/wire.d.ts +1 -4
- package/dist/test-host.d.ts +1 -4
- package/dist/test-host.js +2 -27
- package/docs/families.md +42 -47
- package/package.json +1 -1
- package/dist/calls.d.ts +0 -707
- package/dist/calls.js +0 -1
- package/dist/mdruntime/fulltext.d.ts +0 -26
- package/dist/mdruntime/shared.d.ts +0 -15
- package/dist/mdruntime/transfer.d.ts +0 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Outline } from '../mdmodel/index.js';
|
|
1
2
|
import type { HeadChange } from './adapter.js';
|
|
2
3
|
import { type Composed, type Composition } from './collection.js';
|
|
3
4
|
import type { HeldBinary } from './overlay.js';
|
|
@@ -7,6 +8,7 @@ export type View = 'confirmed' | 'visible' | 'refreshed';
|
|
|
7
8
|
export type StoredEntry = {
|
|
8
9
|
readonly path: string;
|
|
9
10
|
readonly content: string | null;
|
|
11
|
+
readonly outline: Outline | null;
|
|
10
12
|
readonly binary: HeldBinary | null;
|
|
11
13
|
readonly revision: string | null;
|
|
12
14
|
readonly fileId: string | null;
|
|
@@ -34,7 +36,6 @@ export type HeldKey = {
|
|
|
34
36
|
readonly locator: string;
|
|
35
37
|
readonly transfer: string;
|
|
36
38
|
readonly rederiving: number | null;
|
|
37
|
-
readonly searching: number | null;
|
|
38
39
|
};
|
|
39
40
|
export type ReplicaOpened = {
|
|
40
41
|
readonly rooms: readonly {
|
|
@@ -42,16 +43,6 @@ export type ReplicaOpened = {
|
|
|
42
43
|
readonly key: number;
|
|
43
44
|
readonly record: string;
|
|
44
45
|
}[];
|
|
45
|
-
readonly transfers: readonly {
|
|
46
|
-
readonly locator: string;
|
|
47
|
-
readonly key: number;
|
|
48
|
-
readonly record: string;
|
|
49
|
-
}[];
|
|
50
|
-
readonly kept: readonly {
|
|
51
|
-
readonly locator: string;
|
|
52
|
-
readonly token: string;
|
|
53
|
-
readonly bytes: number;
|
|
54
|
-
}[];
|
|
55
46
|
readonly keys: readonly HeldKey[];
|
|
56
47
|
readonly facts: Readonly<Record<string, string>>;
|
|
57
48
|
readonly presentation: readonly {
|
|
@@ -96,20 +87,14 @@ export type CountedRoom = {
|
|
|
96
87
|
readonly key: number;
|
|
97
88
|
readonly roots: readonly string[];
|
|
98
89
|
};
|
|
99
|
-
export type Walked = {
|
|
100
|
-
readonly entries: readonly HeldEntry[];
|
|
101
|
-
readonly next: string | null;
|
|
102
|
-
};
|
|
103
90
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
104
91
|
export declare function stage(connection: Connection, request: {
|
|
105
92
|
readonly locator: string;
|
|
106
93
|
readonly transfer: string;
|
|
107
|
-
readonly record: string;
|
|
108
94
|
readonly key: number | null;
|
|
109
95
|
readonly fingerprint: string;
|
|
110
96
|
readonly entries: readonly StoredEntry[];
|
|
111
97
|
readonly folders: readonly string[];
|
|
112
|
-
readonly written?: string;
|
|
113
98
|
}): number;
|
|
114
99
|
export declare function refreshing(connection: Connection, request: {
|
|
115
100
|
readonly key: number;
|
|
@@ -123,7 +108,7 @@ export declare function unrefresh(connection: Connection, key: number): null;
|
|
|
123
108
|
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
124
109
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
125
110
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
126
|
-
export declare function abandon(connection: Connection, locator: string
|
|
111
|
+
export declare function abandon(connection: Connection, locator: string): null;
|
|
127
112
|
export declare function release(connection: Connection, key: number): null;
|
|
128
113
|
export declare function erase(connection: Connection, locator: string | null, limit: number): {
|
|
129
114
|
readonly remaining: boolean;
|
|
@@ -132,22 +117,45 @@ export declare function rederive(connection: Connection, key: number, composed:
|
|
|
132
117
|
readonly done: boolean;
|
|
133
118
|
readonly text: number;
|
|
134
119
|
};
|
|
120
|
+
export type HeldText = {
|
|
121
|
+
readonly path: string;
|
|
122
|
+
readonly revision: string;
|
|
123
|
+
readonly content: string;
|
|
124
|
+
};
|
|
125
|
+
export declare function holdTexts(connection: Connection, request: {
|
|
126
|
+
readonly key: number;
|
|
127
|
+
readonly locator: string;
|
|
128
|
+
readonly composed: Composed;
|
|
129
|
+
readonly texts: readonly HeldText[];
|
|
130
|
+
}): string[];
|
|
131
|
+
export declare function unholdTexts(connection: Connection, request: {
|
|
132
|
+
readonly key: number;
|
|
133
|
+
readonly locator: string;
|
|
134
|
+
readonly composed: Composed;
|
|
135
|
+
}): {
|
|
136
|
+
readonly paths: readonly string[];
|
|
137
|
+
readonly bytes: number;
|
|
138
|
+
};
|
|
139
|
+
export declare function remembered(connection: Connection, request: {
|
|
140
|
+
readonly key: number;
|
|
141
|
+
readonly locator: string;
|
|
142
|
+
readonly paths: readonly string[];
|
|
143
|
+
}): null;
|
|
144
|
+
export declare function wanted(connection: Connection, request: {
|
|
145
|
+
readonly key: number;
|
|
146
|
+
readonly locator: string;
|
|
147
|
+
}): {
|
|
148
|
+
readonly path: string;
|
|
149
|
+
readonly revision: string;
|
|
150
|
+
}[];
|
|
135
151
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
136
152
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
137
153
|
export declare function referrers(connection: Connection, key: number, view: View, targets: readonly string[], kinds: readonly string[]): Referrer[];
|
|
138
|
-
export declare function walk(connection: Connection, key: number, view: View, after: string | null, bytes: number): Walked;
|
|
139
154
|
export declare function files(connection: Connection, key: number, view: View, after: string | null, limit: number): {
|
|
140
155
|
readonly path: string;
|
|
141
156
|
readonly revision: string;
|
|
142
157
|
}[];
|
|
143
158
|
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
144
159
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
145
|
-
export declare function transferPart(connection: Connection, locator: string, token: string): Uint8Array | null;
|
|
146
|
-
export type KeptPart = {
|
|
147
|
-
readonly locator: string;
|
|
148
|
-
readonly token: string;
|
|
149
|
-
readonly part: Uint8Array;
|
|
150
|
-
};
|
|
151
|
-
export declare function keepParts(connection: Connection, parts: readonly KeptPart[]): null;
|
|
152
160
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
153
161
|
export declare function ended(connection: Connection): void;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
|
-
import type { KeptReceipt } from './adapter.js';
|
|
3
2
|
import type { Composed } from './collection.js';
|
|
4
|
-
import { type SearchAsk } from './fulltext.js';
|
|
5
3
|
import { type ConversationWrite, type HeldConversation, type MessageWindow } from './messages.js';
|
|
6
4
|
import type { Plan } from './query.js';
|
|
7
|
-
import type
|
|
8
|
-
|
|
9
|
-
export type { Committed, CountedRoom, HeldEntry, KeptPart, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, Walked, } from './stored.js';
|
|
5
|
+
import { type Committed, type CountedRoom, type HeldEntry, type HeldText, type ReplicaOpened, type Referrer, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
6
|
+
export type { Committed, CountedRoom, HeldEntry, HeldText, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
10
7
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
11
|
-
export type { SearchAsk } from './fulltext.js';
|
|
12
8
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './messages.js';
|
|
13
9
|
export type Value = string | number | bigint | Uint8Array | null;
|
|
14
10
|
export type Row = Readonly<Record<string, Value>>;
|
|
@@ -37,6 +33,10 @@ export interface SqliteStatement {
|
|
|
37
33
|
}
|
|
38
34
|
export interface SqliteDatabase {
|
|
39
35
|
readonly pointer: number;
|
|
36
|
+
createFunction(name: string, run: (context: number, ...values: Value[]) => Value, options: {
|
|
37
|
+
readonly arity: number;
|
|
38
|
+
readonly deterministic: true;
|
|
39
|
+
}): unknown;
|
|
40
40
|
exec(options: {
|
|
41
41
|
readonly sql: string;
|
|
42
42
|
readonly bind: readonly Value[];
|
|
@@ -78,10 +78,6 @@ export type AuthoredRows = {
|
|
|
78
78
|
readonly path: string;
|
|
79
79
|
})[];
|
|
80
80
|
readonly consumedRoomDrafts?: readonly string[];
|
|
81
|
-
readonly amendments?: readonly {
|
|
82
|
-
readonly id: string;
|
|
83
|
-
readonly amendment: string;
|
|
84
|
-
}[];
|
|
85
81
|
};
|
|
86
82
|
export type HeldQueues = {
|
|
87
83
|
readonly queues: readonly {
|
|
@@ -182,12 +178,6 @@ export interface RuntimeRequests {
|
|
|
182
178
|
readonly targets: readonly string[];
|
|
183
179
|
readonly kinds: readonly string[];
|
|
184
180
|
}, 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
181
|
readonly 'replica.files': Asked<{
|
|
192
182
|
readonly key: number;
|
|
193
183
|
readonly view: View;
|
|
@@ -211,29 +201,14 @@ export interface RuntimeRequests {
|
|
|
211
201
|
readonly 'replica.counts': Asked<{
|
|
212
202
|
readonly rooms: readonly CountedRoom[];
|
|
213
203
|
}, readonly number[]>;
|
|
214
|
-
readonly 'replica.search': Asked<SearchAsk, SearchWindow>;
|
|
215
|
-
readonly 'replica.received': Asked<Nothing, readonly KeptReceipt[]>;
|
|
216
|
-
readonly 'replica.receivedParts': Asked<{
|
|
217
|
-
readonly key: string;
|
|
218
|
-
readonly count: number;
|
|
219
|
-
}, readonly unknown[]>;
|
|
220
204
|
readonly 'replica.stage': Asked<{
|
|
221
205
|
readonly locator: string;
|
|
222
206
|
readonly transfer: string;
|
|
223
|
-
readonly record: string;
|
|
224
207
|
readonly key: number | null;
|
|
225
208
|
readonly fingerprint: string;
|
|
226
209
|
readonly entries: readonly StoredEntry[];
|
|
227
210
|
readonly folders: readonly string[];
|
|
228
|
-
readonly written?: string;
|
|
229
211
|
}, number | null>;
|
|
230
|
-
readonly 'replica.transferPart': Asked<{
|
|
231
|
-
readonly locator: string;
|
|
232
|
-
readonly token: string;
|
|
233
|
-
}, Uint8Array | null>;
|
|
234
|
-
readonly 'replica.keepParts': Asked<{
|
|
235
|
-
readonly parts: readonly KeptPart[];
|
|
236
|
-
}, null>;
|
|
237
212
|
readonly 'replica.refresh': Asked<{
|
|
238
213
|
readonly key: number;
|
|
239
214
|
readonly composed: Composed;
|
|
@@ -260,8 +235,7 @@ export interface RuntimeRequests {
|
|
|
260
235
|
}>;
|
|
261
236
|
readonly 'replica.abandon': Asked<{
|
|
262
237
|
readonly locator: string;
|
|
263
|
-
|
|
264
|
-
}, number | null>;
|
|
238
|
+
}, null>;
|
|
265
239
|
readonly 'replica.release': Asked<{
|
|
266
240
|
readonly key: number;
|
|
267
241
|
}, null>;
|
|
@@ -275,6 +249,32 @@ export interface RuntimeRequests {
|
|
|
275
249
|
readonly done: boolean;
|
|
276
250
|
readonly text: number;
|
|
277
251
|
}>;
|
|
252
|
+
readonly 'replica.hold': Asked<{
|
|
253
|
+
readonly key: number;
|
|
254
|
+
readonly locator: string;
|
|
255
|
+
readonly composed: Composed;
|
|
256
|
+
readonly texts: readonly HeldText[];
|
|
257
|
+
}, readonly string[]>;
|
|
258
|
+
readonly 'replica.remember': Asked<{
|
|
259
|
+
readonly key: number;
|
|
260
|
+
readonly locator: string;
|
|
261
|
+
readonly paths: readonly string[];
|
|
262
|
+
}, null>;
|
|
263
|
+
readonly 'replica.wanted': Asked<{
|
|
264
|
+
readonly key: number;
|
|
265
|
+
readonly locator: string;
|
|
266
|
+
}, readonly {
|
|
267
|
+
readonly path: string;
|
|
268
|
+
readonly revision: string;
|
|
269
|
+
}[]>;
|
|
270
|
+
readonly 'replica.unhold': Asked<{
|
|
271
|
+
readonly key: number;
|
|
272
|
+
readonly locator: string;
|
|
273
|
+
readonly composed: Composed;
|
|
274
|
+
}, {
|
|
275
|
+
readonly paths: readonly string[];
|
|
276
|
+
readonly bytes: number;
|
|
277
|
+
}>;
|
|
278
278
|
readonly 'replica.fact': Asked<{
|
|
279
279
|
readonly name: string;
|
|
280
280
|
readonly value: string;
|
|
@@ -283,17 +283,6 @@ export interface RuntimeRequests {
|
|
|
283
283
|
readonly app: string;
|
|
284
284
|
readonly value: string;
|
|
285
285
|
}, null>;
|
|
286
|
-
readonly 'replica.receive': Asked<{
|
|
287
|
-
readonly key: string;
|
|
288
|
-
readonly head: string;
|
|
289
|
-
readonly part?: {
|
|
290
|
-
readonly index: number;
|
|
291
|
-
readonly value: string;
|
|
292
|
-
};
|
|
293
|
-
}, null>;
|
|
294
|
-
readonly 'replica.unreceive': Asked<{
|
|
295
|
-
readonly keys: readonly string[];
|
|
296
|
-
}, null>;
|
|
297
286
|
readonly 'opened.find': Asked<{
|
|
298
287
|
readonly locator: string;
|
|
299
288
|
readonly path: string;
|
|
@@ -331,9 +320,11 @@ export interface RuntimeRequests {
|
|
|
331
320
|
readonly conversation: string;
|
|
332
321
|
readonly limit: number;
|
|
333
322
|
readonly before: readonly [string, string] | null;
|
|
323
|
+
readonly phrase: string | null;
|
|
334
324
|
}, MessageWindow>;
|
|
335
325
|
readonly 'conversation.count': Asked<{
|
|
336
326
|
readonly conversation: string;
|
|
327
|
+
readonly phrase: string | null;
|
|
337
328
|
}, number>;
|
|
338
329
|
readonly 'conversation.turn': Asked<{
|
|
339
330
|
readonly conversation: string;
|
package/dist/mdruntime/wire.d.ts
CHANGED
|
@@ -150,10 +150,6 @@ declare const MEMBERS: {
|
|
|
150
150
|
readonly reach: 'within';
|
|
151
151
|
readonly effect: 'action';
|
|
152
152
|
};
|
|
153
|
-
readonly 'conversation.cancel': {
|
|
154
|
-
readonly reach: 'within';
|
|
155
|
-
readonly effect: 'action';
|
|
156
|
-
};
|
|
157
153
|
readonly 'conversation.delete': {
|
|
158
154
|
readonly reach: 'within';
|
|
159
155
|
readonly effect: 'action';
|
|
@@ -180,6 +176,7 @@ declare const TOPICS: {
|
|
|
180
176
|
readonly 'sync-status': 'within';
|
|
181
177
|
readonly 'service-mode': 'runtime';
|
|
182
178
|
readonly member: 'runtime';
|
|
179
|
+
readonly 'authority-changes': 'runtime';
|
|
183
180
|
readonly query: 'within';
|
|
184
181
|
readonly queue: 'within';
|
|
185
182
|
readonly 'room-drafts': 'within';
|
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;
|
|
@@ -130,6 +129,7 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
130
129
|
},
|
|
131
130
|
install: () => Promise.resolve('manual'),
|
|
132
131
|
notifications: () => Promise.resolve('unavailable'),
|
|
132
|
+
telegram: () => Promise.resolve({ state: 'unavailable', name: null, username: null }),
|
|
133
133
|
setBadge: () => Promise.resolve(),
|
|
134
134
|
setTab(tab) {
|
|
135
135
|
tabs.push(tab);
|
|
@@ -160,19 +160,8 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
160
160
|
consents.push(choice);
|
|
161
161
|
publish({ ...published, analytics: { measures: true, choice } });
|
|
162
162
|
},
|
|
163
|
-
cooperate(
|
|
164
|
-
cooperation = given;
|
|
165
|
-
return () => {
|
|
166
|
-
if (cooperation === given)
|
|
167
|
-
cooperation = null;
|
|
168
|
-
};
|
|
169
|
-
},
|
|
163
|
+
cooperate: () => () => { },
|
|
170
164
|
};
|
|
171
|
-
function cooperating() {
|
|
172
|
-
if (cooperation === null)
|
|
173
|
-
throw new Error('the App registered no cooperation');
|
|
174
|
-
return cooperation;
|
|
175
|
-
}
|
|
176
165
|
Object.defineProperty(globalThis, 'houseBridge', { value: bridge, configurable: true });
|
|
177
166
|
if (published !== null)
|
|
178
167
|
publish(published);
|
|
@@ -198,19 +187,5 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
198
187
|
attachRuntime(client) {
|
|
199
188
|
attached(client);
|
|
200
189
|
},
|
|
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
190
|
};
|
|
216
191
|
}
|
package/docs/families.md
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
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
15
|
reading and composes one only for `/bind/<app_ref>`, where the User binds
|
|
16
|
-
its Rooms, with `?slot=<name>` to open at one slot
|
|
16
|
+
its Rooms, with `?slot=<name>` to open at one slot, and `/sign-out`, which
|
|
17
|
+
signs the User out and opens sign-in.
|
|
17
18
|
- **Installation** - `install()` offers the page as a Home-screen app. Where the
|
|
18
19
|
browser has an install prompt ready the shell shows it and the call resolves
|
|
19
20
|
`'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
|
|
@@ -33,6 +34,18 @@
|
|
|
33
34
|
click. `setBadge(unread)` takes the identifiers of the Human Notifications
|
|
34
35
|
unread in this storage and sets the icon's badge to their number, or clears
|
|
35
36
|
it at none, where the browser shows one.
|
|
37
|
+
- **Telegram** - House's own panel alone, refused to an App or a Site the same
|
|
38
|
+
way. `telegram()` answers `{ state, name, username }`: `state` is
|
|
39
|
+
`'available'` where the page runs inside a House bot's Mini App that gave it
|
|
40
|
+
Telegram's launch data naming an account, with that account's `name` and its
|
|
41
|
+
`username` or `null`, and `'unavailable'` with both `null` elsewhere.
|
|
42
|
+
`telegram(true)` links the signed-in User to that account and answers
|
|
43
|
+
`'linked'` with it; where the User's sign-in is
|
|
44
|
+
not recent, the page goes to sign in again, and nothing links until a later
|
|
45
|
+
`telegram(true)`.
|
|
46
|
+
Telegram's refusal rejects with an error coded `linked_elsewhere`,
|
|
47
|
+
`rate_limited` or `refused`, and a failed request with the browser's own
|
|
48
|
+
error name.
|
|
36
49
|
- **Status** - the App reference the runtime client is attached under,
|
|
37
50
|
`preferences`: the `roomRef` and Path of the App's own preferences document,
|
|
38
51
|
or `null` until the runtime holds that Room, sync
|
|
@@ -46,15 +59,19 @@
|
|
|
46
59
|
The App reports the visitor's choice with `analyticsConsent('accept')` or
|
|
47
60
|
`analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
|
|
48
61
|
the choice never reaches House.
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
- **Releases and builds** - an open App keeps the release it loaded: a newer
|
|
63
|
+
release, or a newer House build, takes effect at the App's next load, offline
|
|
64
|
+
too once the browser stored it. When one tab loads a newer House build, the
|
|
65
|
+
other House tabs reload into it; Room Drafts, chat drafts and unsent changes
|
|
66
|
+
survive the reload.
|
|
67
|
+
- **A runtime that ends** - when the browser ends House's runtime under an open
|
|
68
|
+
App, the App keeps running, its `runtime` client and observations included:
|
|
69
|
+
each observation goes on with the next runtime's values, and the status and
|
|
70
|
+
the address arrive again. A runtime that ended before answering has its reads
|
|
71
|
+
answered by the next one; since it may have applied any other call, an act on
|
|
72
|
+
House is answered the outcome `transport-uncertainty`, and every other call,
|
|
73
|
+
a Save or a draft write among them, fails with the retryable code
|
|
74
|
+
`transport-uncertainty`.
|
|
58
75
|
- **Site image read** - given a Published Room and the Path of one of its
|
|
59
76
|
binary entries, it answers the web copy's path and metadata, or `null` when no
|
|
60
77
|
copy exists. The original bytes never cross this bridge at a Site.
|
|
@@ -73,14 +90,15 @@
|
|
|
73
90
|
external origins and resolves with the service's `status`, `headers` and its
|
|
74
91
|
body as `body` text or `body_base64`, or a refusal as House's
|
|
75
92
|
`{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
|
|
76
|
-
App and its running release
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
App and its running release. A `room_ref` names a Room the signed-in User binds to the App
|
|
94
|
+
in a `write` slot, and House adds that Room's Service key for the URL's origin, which App
|
|
95
|
+
code never sees; a call naming no Room carries no key, and a Site's call names no Room.
|
|
96
|
+
`body_base64` replaces `body` for bytes.
|
|
79
97
|
- **App messages** - `messages(listener)` hands the listener each message
|
|
80
98
|
another holder of this App sends to this User's running copies, as `from`,
|
|
81
99
|
the sender's User id, and `body`, the JSON value they sent, until the
|
|
82
100
|
function it returns is called. App code sends one through the Runtime's
|
|
83
|
-
`call('
|
|
101
|
+
`call('apps/messages/send', { to, body })` with the recipient's User id and
|
|
84
102
|
a body of at most 32 kB of JSON; House fills in the App and relays it only
|
|
85
103
|
to copies running now, storing nothing. The panel sends none.
|
|
86
104
|
- **App screenshot read** - given an App reference, `readScreenshot(app)`
|
|
@@ -108,35 +126,14 @@
|
|
|
108
126
|
declares them. A Site and the House panel have none: their call rejects with
|
|
109
127
|
an error named and coded `NotSupportedError`, with `retryable` false.
|
|
110
128
|
|
|
111
|
-
- **
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
answers the meaningful task the App owns, such as the selected record,
|
|
120
|
-
filters, cursor, selection and scroll position, as JSON of at most 65,536
|
|
121
|
-
characters; House keeps the address itself. In the newer release House
|
|
122
|
-
calls `restore(task)` once its document has drawn, so the scroll position
|
|
123
|
-
and focus it sets hold, or `restore(null)` when it opens the release without
|
|
124
|
-
a task, then `ready()`, the App's own check that its local data and
|
|
125
|
-
capabilities work, and finally `settle('committed')` once the release is
|
|
126
|
-
active or `settle('abandoned')` when House returns to the release before
|
|
127
|
-
it, restoring the same task there. A release House opens already active is
|
|
128
|
-
settled `'committed'` at once, after `restore(task)` when House hands it a
|
|
129
|
-
task, and a cooperation registered after House settled is settled at its
|
|
130
|
-
registration. Until `settle('committed')` House fails the release's outside
|
|
131
|
-
calls at once, as offline, those of the workers it starts included, and
|
|
132
|
-
refuses its Saves, write acts and external calls with the retryable code
|
|
133
|
-
`house_trial_withheld`, so a start-up effect is not repeated; run start-up
|
|
134
|
-
effects after `settle('committed')`. An optional `placed()` resolves once
|
|
135
|
-
the page has drawn the place it opened on with what that place shows:
|
|
136
|
-
House keeps its first-preparation surface over a page registered by its
|
|
137
|
-
first draw until then, and lifts it at the first draw of a page whose
|
|
138
|
-
cooperation defines none, so the User goes from the surface to a drawn
|
|
139
|
-
place in one change; a release's readiness check never waits for it.
|
|
129
|
+
- **First place** - `cooperate({ placed })` tells House when the page has
|
|
130
|
+
drawn the place it opened on; the function it returns withdraws it. Register
|
|
131
|
+
it in the entry script, before the first draw. `placed()` resolves once the
|
|
132
|
+
page has drawn that place with what it shows: House keeps its
|
|
133
|
+
first-preparation surface over a page registered by its first draw until
|
|
134
|
+
then, and lifts it at the first draw of a page that registered none, so the
|
|
135
|
+
User goes from the surface to a drawn place in one change. House asks the
|
|
136
|
+
page for nothing else.
|
|
140
137
|
|
|
141
138
|
## The test host
|
|
142
139
|
|
|
@@ -162,7 +159,5 @@ as a browser without push does, settles every `setBadge`, records in `chats`
|
|
|
162
159
|
each Chat `chat.mount` places, with its `element`, the `options` it was last
|
|
163
160
|
given and whether it is still `mounted`, drawing nothing, delivers each App
|
|
164
161
|
message `message({ from, body })` plays, and hands `bridge.runtime` the MD
|
|
165
|
-
Runtime client `attachRuntime(client)` gives it. `
|
|
166
|
-
|
|
167
|
-
`restore(task)` runs its restore and answers its readiness check, and
|
|
168
|
-
`settle(activation)` hands it the outcome.
|
|
162
|
+
Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
|
|
163
|
+
never calls `placed()`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/app-bridge",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-ca2cc2cd99f13",
|
|
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, App messages and the Chat, with an accessor and an in-page test host.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|