@agentshouse/app-bridge 0.1.0-ce77dca2c4f9f → 0.1.0-ce7c3baa4a247
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/dist/calls.d.ts +30 -12
- package/dist/index.d.ts +2 -3
- package/dist/mdmodel/condition.d.ts +3 -1
- package/dist/mdmodel/index.d.ts +1 -1
- package/dist/mdruntime/adapter.d.ts +6 -5
- package/dist/mdruntime/collection.d.ts +5 -0
- package/dist/mdruntime/connection.d.ts +2 -1
- package/dist/mdruntime/conversation.d.ts +5 -3
- package/dist/mdruntime/model.d.ts +6 -0
- package/dist/mdruntime/observation.d.ts +1 -0
- package/dist/mdruntime/reach.d.ts +2 -1
- package/dist/mdruntime/readiness.d.ts +1 -2
- package/dist/mdruntime/replica.d.ts +2 -2
- package/dist/mdruntime/room-draft.d.ts +17 -2
- package/dist/mdruntime/save.d.ts +2 -0
- package/dist/mdruntime/status.d.ts +5 -0
- package/dist/mdruntime/store.d.ts +17 -15
- package/dist/mdruntime/stored.d.ts +8 -25
- package/dist/mdruntime/tables.d.ts +15 -15
- package/docs/families.md +12 -9
- package/package.json +1 -1
package/dist/calls.d.ts
CHANGED
|
@@ -16,18 +16,18 @@ export interface HouseMethods {
|
|
|
16
16
|
readonly user_name: string;
|
|
17
17
|
readonly entries: readonly {
|
|
18
18
|
readonly namespace: string;
|
|
19
|
-
readonly
|
|
19
|
+
readonly level: 'search' | 'open' | 'keep' | null;
|
|
20
20
|
readonly operations: readonly ('write' | 'delete' | 'export' | 'manageAccess')[];
|
|
21
21
|
readonly sources: readonly {
|
|
22
22
|
readonly kind: 'direct' | 'inherited';
|
|
23
23
|
readonly namespace: string;
|
|
24
|
-
readonly
|
|
24
|
+
readonly level: 'search' | 'open' | 'keep' | null;
|
|
25
25
|
readonly operations: readonly ('write' | 'delete' | 'export' | 'manageAccess')[];
|
|
26
26
|
}[];
|
|
27
27
|
}[];
|
|
28
28
|
readonly direct: readonly {
|
|
29
29
|
readonly namespace: string;
|
|
30
|
-
readonly
|
|
30
|
+
readonly level: 'search' | 'open' | 'keep' | null;
|
|
31
31
|
readonly operations: readonly ('write' | 'delete' | 'export' | 'manageAccess')[];
|
|
32
32
|
}[];
|
|
33
33
|
readonly admitted_at: string | null;
|
|
@@ -346,7 +346,8 @@ export interface HouseMethods {
|
|
|
346
346
|
readonly owner: boolean;
|
|
347
347
|
readonly email?: string;
|
|
348
348
|
readonly since: string | null;
|
|
349
|
-
readonly access?: 'owner' | 'manage' | 'edit' | '
|
|
349
|
+
readonly access?: 'owner' | 'manage' | 'edit' | 'keep' | 'open' | 'search';
|
|
350
|
+
readonly only_while_online?: true;
|
|
350
351
|
readonly member_document: string | null;
|
|
351
352
|
readonly schema_roles?: readonly string[];
|
|
352
353
|
}[];
|
|
@@ -493,11 +494,7 @@ export interface HouseMethods {
|
|
|
493
494
|
readonly reach: 'selected';
|
|
494
495
|
readonly refs: readonly string[];
|
|
495
496
|
};
|
|
496
|
-
readonly
|
|
497
|
-
readonly id: string;
|
|
498
|
-
readonly name: string;
|
|
499
|
-
readonly origin: string;
|
|
500
|
-
}[];
|
|
497
|
+
readonly key_origins?: readonly string[];
|
|
501
498
|
readonly url: string;
|
|
502
499
|
}[];
|
|
503
500
|
};
|
|
@@ -628,7 +625,7 @@ export interface HouseMethods {
|
|
|
628
625
|
} | {
|
|
629
626
|
readonly position: number;
|
|
630
627
|
readonly outcome: 'no_target';
|
|
631
|
-
readonly code: 'no_recipient' | 'routine_access_not_found' | 'routine_retired' | 'target_agent_unavailable';
|
|
628
|
+
readonly code: 'no_recipient' | 'routine_access_not_found' | 'routine_retired' | 'target_agent_unavailable' | 'app_not_found' | 'app_function_not_found';
|
|
632
629
|
} | {
|
|
633
630
|
readonly position: number;
|
|
634
631
|
readonly outcome: 'requested';
|
|
@@ -678,12 +675,12 @@ export interface HouseMethods {
|
|
|
678
675
|
readonly position: number;
|
|
679
676
|
readonly outcome: 'refused';
|
|
680
677
|
readonly code: 'cap_reached';
|
|
681
|
-
readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | '
|
|
678
|
+
readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | 'service_keys' | 'shared_schemas' | 'export_starts' | 'share_creations' | 'share_room_creations' | 'live_shares' | 'ownership_offers' | 'site_rooms' | 'slot_rooms' | 'room_triggers' | 'app_sockets' | 'kit_connections' | 'open_uploads' | 'waiting_web_wizards' | 'folder_subscriptions';
|
|
682
679
|
} | {
|
|
683
680
|
readonly position: number;
|
|
684
681
|
readonly outcome: 'refused';
|
|
685
682
|
readonly code: 'cap_reached';
|
|
686
|
-
readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | '
|
|
683
|
+
readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | 'service_keys' | 'shared_schemas' | 'export_starts' | 'share_creations' | 'share_room_creations' | 'live_shares' | 'ownership_offers' | 'site_rooms' | 'slot_rooms' | 'room_triggers' | 'app_sockets' | 'kit_connections' | 'open_uploads' | 'waiting_web_wizards' | 'folder_subscriptions';
|
|
687
684
|
readonly retry_at: string;
|
|
688
685
|
} | {
|
|
689
686
|
readonly position: number;
|
|
@@ -693,6 +690,27 @@ export interface HouseMethods {
|
|
|
693
690
|
readonly position: number;
|
|
694
691
|
readonly outcome: 'failed';
|
|
695
692
|
readonly code: 'internal_error' | 'routine_request_not_started';
|
|
693
|
+
} | {
|
|
694
|
+
readonly position: number;
|
|
695
|
+
readonly outcome: 'failed';
|
|
696
|
+
readonly code: 'function_failed';
|
|
697
|
+
readonly error: string;
|
|
698
|
+
readonly release: string;
|
|
699
|
+
readonly final: true;
|
|
700
|
+
} | {
|
|
701
|
+
readonly position: number;
|
|
702
|
+
readonly outcome: 'failed';
|
|
703
|
+
readonly code: 'function_not_started';
|
|
704
|
+
readonly tries: number;
|
|
705
|
+
readonly final?: true;
|
|
706
|
+
} | {
|
|
707
|
+
readonly position: number;
|
|
708
|
+
readonly outcome: 'running';
|
|
709
|
+
readonly release: string;
|
|
710
|
+
} | {
|
|
711
|
+
readonly position: number;
|
|
712
|
+
readonly outcome: 'ran';
|
|
713
|
+
readonly release: string;
|
|
696
714
|
} | {
|
|
697
715
|
readonly position: number;
|
|
698
716
|
readonly outcome: 'waiting';
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface HouseCredentialState {
|
|
|
21
21
|
readonly state: Open<'none' | 'held' | 'rejected'>;
|
|
22
22
|
readonly expiresAt: number | null;
|
|
23
23
|
}
|
|
24
|
-
export type HouseDatabaseFailure = 'unsupported' | 'damaged'
|
|
24
|
+
export type HouseDatabaseFailure = 'unsupported' | 'damaged';
|
|
25
25
|
export type HouseAnalyticsChoice = 'accept' | 'decline';
|
|
26
26
|
export interface HouseAnalytics {
|
|
27
27
|
readonly measures: boolean;
|
|
@@ -80,8 +80,6 @@ export interface HouseExternalRequest {
|
|
|
80
80
|
readonly headers?: Readonly<Record<string, string>>;
|
|
81
81
|
readonly body?: string;
|
|
82
82
|
readonly body_base64?: string;
|
|
83
|
-
readonly account?: string;
|
|
84
|
-
readonly slot?: string;
|
|
85
83
|
readonly room_ref?: string;
|
|
86
84
|
}
|
|
87
85
|
export type HouseExternalAnswer = {
|
|
@@ -132,6 +130,7 @@ export interface HouseCooperation {
|
|
|
132
130
|
capture(): Promise<HouseTask> | HouseTask;
|
|
133
131
|
restore(task: HouseTask | null): Promise<void> | void;
|
|
134
132
|
ready(): Promise<boolean> | boolean;
|
|
133
|
+
placed?(): Promise<void> | void;
|
|
135
134
|
settle(activation: HouseActivation): void;
|
|
136
135
|
}
|
|
137
136
|
export type HouseChatWidth = 'full' | '3/4' | '1/2' | '1/3';
|
|
@@ -103,11 +103,13 @@ export type DocumentFacts = {
|
|
|
103
103
|
readonly fields: Readonly<Record<string, Fact>>;
|
|
104
104
|
readonly sections: readonly string[];
|
|
105
105
|
};
|
|
106
|
-
export declare const
|
|
106
|
+
export declare const TEXT_FIELD = "/text";
|
|
107
|
+
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client', 'function'];
|
|
107
108
|
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
108
109
|
export type Actor = {
|
|
109
110
|
readonly user?: string;
|
|
110
111
|
readonly site?: string;
|
|
112
|
+
readonly app?: string;
|
|
111
113
|
readonly door?: WriteDoor;
|
|
112
114
|
};
|
|
113
115
|
export type DocumentEvent = {
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTOR_PATHS, actorOperators, changeFields, CONDITION_OPERATORS, dated, datePointers, DOCUMENT_PATHS, factKind, facts, fires, holds, instant, ITEM_PATHS, itemFires, itemKind, itemOperators, memberPointers, members, pointed, prosePaths, testOperators, valuedChange, WRITE_DOORS, } from './condition.js';
|
|
1
|
+
export { ACTOR_PATHS, actorOperators, changeFields, CONDITION_OPERATORS, dated, datePointers, DOCUMENT_PATHS, factKind, facts, fires, holds, instant, ITEM_PATHS, itemFires, itemKind, itemOperators, memberPointers, members, pointed, prosePaths, testOperators, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './condition.js';
|
|
2
2
|
export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, Resolved, WriteDoor, } from './condition.js';
|
|
3
3
|
export { headingLines } from './blocks.js';
|
|
4
4
|
export type { HeadingLine } from './blocks.js';
|
|
@@ -49,6 +49,7 @@ export type ListedConversation = {
|
|
|
49
49
|
finished: string | null;
|
|
50
50
|
outcome: string | null;
|
|
51
51
|
waiting: boolean;
|
|
52
|
+
newest: string | null;
|
|
52
53
|
};
|
|
53
54
|
export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.answer' | 'conversation.interrupt' | 'conversation.kill' | 'conversation.cancel' | 'conversation.delete' | 'conversation.history';
|
|
54
55
|
export type ConversationMessage = {
|
|
@@ -255,7 +256,7 @@ export type ContractUnavailable = ProviderRefusal & {
|
|
|
255
256
|
export type DiscoverResult = Discovery | TransportUncertainty | RevokedAuthorization | ContractUnavailable;
|
|
256
257
|
export type PageToken = string;
|
|
257
258
|
export type ChangeAuthor = {
|
|
258
|
-
kind: Open<'user' | 'site' | 'inbox'>;
|
|
259
|
+
kind: Open<'user' | 'site' | 'inbox' | 'app'>;
|
|
259
260
|
id: string;
|
|
260
261
|
name: string;
|
|
261
262
|
};
|
|
@@ -289,8 +290,8 @@ export type BootstrapRequest = {
|
|
|
289
290
|
selection: string;
|
|
290
291
|
pageToken?: PageToken;
|
|
291
292
|
held?: HeldContent;
|
|
292
|
-
received?: Uint8Array;
|
|
293
293
|
arriving?: (bytes: number) => void;
|
|
294
|
+
signal?: AbortSignal;
|
|
294
295
|
};
|
|
295
296
|
export type BootstrapInventory = {
|
|
296
297
|
readonly parts: number;
|
|
@@ -310,8 +311,7 @@ export type BootstrapPage = {
|
|
|
310
311
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
311
312
|
folders?: readonly string[];
|
|
312
313
|
pageToken?: PageToken;
|
|
313
|
-
|
|
314
|
-
received?: Uint8Array;
|
|
314
|
+
bytes?: number;
|
|
315
315
|
};
|
|
316
316
|
export type BootstrapResult = BootstrapPage | {
|
|
317
317
|
kind: 'beyond-horizon';
|
|
@@ -386,7 +386,7 @@ export type HistoryAuthor = {
|
|
|
386
386
|
kind: 'user';
|
|
387
387
|
id: string;
|
|
388
388
|
} | {
|
|
389
|
-
kind: 'site' | 'inbox';
|
|
389
|
+
kind: 'site' | 'inbox' | 'app';
|
|
390
390
|
id: string;
|
|
391
391
|
name: string;
|
|
392
392
|
};
|
|
@@ -446,6 +446,7 @@ export type AttachRequest = {
|
|
|
446
446
|
export type AttachResult = {
|
|
447
447
|
kind: 'attached';
|
|
448
448
|
path: string;
|
|
449
|
+
revision: string;
|
|
449
450
|
} | (ProviderRefusal & {
|
|
450
451
|
kind: 'rejected';
|
|
451
452
|
}) | AdapterFailure;
|
|
@@ -16,6 +16,11 @@ export type Composition = {
|
|
|
16
16
|
model: ModelState;
|
|
17
17
|
} | null;
|
|
18
18
|
};
|
|
19
|
+
export type Composed = {
|
|
20
|
+
readonly composition: Composition;
|
|
21
|
+
readonly fingerprint: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function composedOf(composition: Composition): Composed;
|
|
19
24
|
export declare function selected(composition: Composition, path: string): boolean;
|
|
20
25
|
export declare function governing(composition: Composition, path: string): ModelState;
|
|
21
26
|
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition): Collection;
|
|
@@ -54,6 +54,7 @@ export type MdRuntimeOptions = {
|
|
|
54
54
|
authorization?: Authorization;
|
|
55
55
|
signal?: AbortSignal;
|
|
56
56
|
recovery?: Recovery;
|
|
57
|
+
usableWhenHeld?: readonly string[];
|
|
57
58
|
};
|
|
58
59
|
export type SaveResult = {
|
|
59
60
|
outcome: 'saved';
|
|
@@ -93,7 +94,7 @@ export type HistoryQuery = {
|
|
|
93
94
|
};
|
|
94
95
|
export type MdRuntime = {
|
|
95
96
|
loaded(): Promise<void>;
|
|
96
|
-
rooms(): readonly AppRoom[]
|
|
97
|
+
rooms(): Promise<readonly AppRoom[]>;
|
|
97
98
|
query: {
|
|
98
99
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
99
100
|
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConversationAction, ConversationAgents, ConversationEvent, ConversationMessage, ConversationStream, ProcessCommand, SessionOption, TurnContext } from './adapter.js';
|
|
1
|
+
import type { ConversationAction, ConversationAgents, ConversationEvent, ConversationMessage, ConversationStream, ListedConversation, ProcessCommand, SessionOption, TurnContext } from './adapter.js';
|
|
2
2
|
import { type ChangeSet } from './change-set.js';
|
|
3
3
|
import type { Open } from './open.js';
|
|
4
4
|
import { type CallResult, type Offline } from './outcome.js';
|
|
@@ -83,6 +83,7 @@ export type ConversationDependencies = {
|
|
|
83
83
|
stream(): ConversationStream | undefined;
|
|
84
84
|
publish(set: ChangeSet): void;
|
|
85
85
|
online(): boolean;
|
|
86
|
+
listed(): boolean;
|
|
86
87
|
full(): boolean;
|
|
87
88
|
closed(): boolean;
|
|
88
89
|
unanswered(): void;
|
|
@@ -91,13 +92,14 @@ export type ConversationDependencies = {
|
|
|
91
92
|
export type ConversationStore = {
|
|
92
93
|
surface: ConversationSurface;
|
|
93
94
|
chatDraft: ChatDraftSurface;
|
|
94
|
-
hydrate(held: readonly HeldConversation[], drafts: readonly ChatDraftRecord[]): void;
|
|
95
|
+
hydrate(held: readonly HeldConversation[], drafts: readonly ChatDraftRecord[], list: readonly ListedConversation[] | null): void;
|
|
95
96
|
reconcile(): Promise<void>;
|
|
96
97
|
catchUp(progress: CycleProgress): Promise<void>;
|
|
97
98
|
resend(progress: CycleProgress): Promise<void>;
|
|
98
99
|
current(): boolean;
|
|
99
100
|
known(): boolean;
|
|
100
|
-
|
|
101
|
+
learned(): void;
|
|
102
|
+
declared(): void;
|
|
101
103
|
reopened(): void;
|
|
102
104
|
lost(): void;
|
|
103
105
|
watch(conversation: string, options: ConversationOptions, deliver: (view: ConversationView) => void): () => void;
|
|
@@ -28,6 +28,11 @@ export type ModelState = {
|
|
|
28
28
|
verifiedWith: ModelIdentity;
|
|
29
29
|
types: VerifiedModel['types'];
|
|
30
30
|
};
|
|
31
|
+
export type StoredModel = Extract<ModelState, {
|
|
32
|
+
status: 'unavailable';
|
|
33
|
+
}> | Omit<Extract<ModelState, {
|
|
34
|
+
status: 'current' | 'cached';
|
|
35
|
+
}>, 'types'>;
|
|
31
36
|
export type TypesResult = {
|
|
32
37
|
status: Open<'unavailable'>;
|
|
33
38
|
reason: ModelUnavailableReason;
|
|
@@ -51,6 +56,7 @@ export type ValidationReceipt = {
|
|
|
51
56
|
export declare const NO_MODEL: ModelState;
|
|
52
57
|
export declare function definitionOf(state: ModelState, type: string | undefined): Definition | undefined;
|
|
53
58
|
export declare function modelTypes(state: ModelState): TypesResult;
|
|
59
|
+
export declare function storedModel(state: ModelState): StoredModel;
|
|
54
60
|
export declare function cached(state: ModelState): ModelState;
|
|
55
61
|
export declare function sameModel(left: ModelIdentity, right: ModelIdentity): boolean;
|
|
56
62
|
export declare function sameTyping(left: ModelState, right: ModelState): boolean;
|
|
@@ -38,6 +38,7 @@ export type Digest = {
|
|
|
38
38
|
readonly next: string | undefined;
|
|
39
39
|
readonly total: number | undefined;
|
|
40
40
|
};
|
|
41
|
+
export declare function hashed(text: string): number;
|
|
41
42
|
export declare function digestOf({ result, keys }: KeyedResult): Digest;
|
|
42
43
|
export declare function digestApplied(digest: Digest, message: QueryMessage): Digest;
|
|
43
44
|
export declare function changeOf(previous: Digest, next: KeyedResult): QueryMessage | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MdRuntime, ReadinessPort, RuntimeTopic } from './connection.js';
|
|
1
|
+
import type { AppRoom, MdRuntime, ReadinessPort, RuntimeTopic } from './connection.js';
|
|
2
2
|
import type { Plan, PlanReach, QueryResult } from './query.js';
|
|
3
3
|
import type { Readiness } from './readiness.js';
|
|
4
4
|
import { type SearchResult } from './search.js';
|
|
@@ -37,6 +37,7 @@ export type Reachable = RuntimeView & {
|
|
|
37
37
|
lockedRooms(): readonly string[];
|
|
38
38
|
watchLocks(notify: () => void): () => void;
|
|
39
39
|
located(room: string, path: string, destination: string): ReachedDocument | null;
|
|
40
|
+
room(locator: string): AppRoom | undefined;
|
|
40
41
|
};
|
|
41
42
|
export declare function holds(reach: PortReach | null, room: string): boolean;
|
|
42
43
|
export declare function governs(reach: PortReach | null, room: {
|
|
@@ -26,7 +26,7 @@ export type RefusedRoom = {
|
|
|
26
26
|
readonly rule: string;
|
|
27
27
|
readonly location: string | null;
|
|
28
28
|
};
|
|
29
|
-
export type InstallationStep = Open<'
|
|
29
|
+
export type InstallationStep = Open<'downloading' | 'writing' | 'replaying'>;
|
|
30
30
|
export type InstallationPause = Open<'hidden'>;
|
|
31
31
|
export type InstallationAmount = {
|
|
32
32
|
readonly done: number;
|
|
@@ -38,7 +38,6 @@ export type Installation = {
|
|
|
38
38
|
readonly rooms: InstallationAmount;
|
|
39
39
|
readonly parts: InstallationAmount;
|
|
40
40
|
readonly bytes: InstallationAmount;
|
|
41
|
-
readonly received: InstallationAmount;
|
|
42
41
|
};
|
|
43
42
|
export type ReadinessStatus = Open<'preparing' | 'paused' | 'refused' | 'ready' | 'lost'>;
|
|
44
43
|
export type Readiness = {
|
|
@@ -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 = {
|
|
@@ -15,7 +15,7 @@ export type ReplicaRecord = {
|
|
|
15
15
|
readonly providerOwnedPaths: readonly string[];
|
|
16
16
|
readonly roomVersion: string;
|
|
17
17
|
readonly transfer: string;
|
|
18
|
-
readonly inventory: BootstrapInventory
|
|
18
|
+
readonly inventory: BootstrapInventory;
|
|
19
19
|
readonly key: number;
|
|
20
20
|
};
|
|
21
21
|
export type HeldReplica = {
|
|
@@ -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;
|
|
@@ -9,11 +9,16 @@ export type AttentionEntry = {
|
|
|
9
9
|
room: string;
|
|
10
10
|
refusal: ProviderRefusal;
|
|
11
11
|
};
|
|
12
|
+
export type UnsentChange = {
|
|
13
|
+
room: string;
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
12
16
|
export type SyncStatus = {
|
|
13
17
|
state: Open<'pending' | 'syncing' | 'synced'>;
|
|
14
18
|
lastCompleted: string | null;
|
|
15
19
|
providerUnreachable: boolean;
|
|
16
20
|
attentionRequired: readonly AttentionEntry[];
|
|
21
|
+
unsent: readonly UnsentChange[];
|
|
17
22
|
reset: string | null;
|
|
18
23
|
};
|
|
19
24
|
export type CycleProgress = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { BootstrapInventory, Capability, KeptReceipt, Member, ProviderLimit } from './adapter.js';
|
|
1
|
+
import type { BootstrapInventory, Capability, KeptReceipt, 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,
|
|
10
|
+
import type { CommittedWrite, ConversationWrite, CountedRoom, HeldConversation, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, RoomCommit, RuntimeDatabase, SearchAsk, StoredEntry, StoredFile, TypedEntry, View, Walked } from './tables.js';
|
|
11
11
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './tables.js';
|
|
12
12
|
export type TransferRecord = {
|
|
13
13
|
readonly locator: string;
|
|
@@ -15,14 +15,15 @@ export type TransferRecord = {
|
|
|
15
15
|
readonly selection: string;
|
|
16
16
|
readonly from: string;
|
|
17
17
|
readonly last: string;
|
|
18
|
-
readonly pageToken: string | null;
|
|
19
|
-
readonly inventory: BootstrapInventory | null;
|
|
20
18
|
readonly done: BootstrapInventory;
|
|
21
19
|
readonly models: {
|
|
22
20
|
readonly collection: ModelState;
|
|
23
21
|
};
|
|
24
22
|
readonly key: number | null;
|
|
25
23
|
};
|
|
24
|
+
export type StoredReplica = Omit<ReplicaRecord, 'model'> & {
|
|
25
|
+
readonly model: StoredModel;
|
|
26
|
+
};
|
|
26
27
|
export type PendingState = {
|
|
27
28
|
readonly drafts: readonly SavedDraft[];
|
|
28
29
|
readonly submission: Submission;
|
|
@@ -82,9 +83,7 @@ export type RefreshedPage = StagedPage & {
|
|
|
82
83
|
readonly folderRemovals: readonly string[];
|
|
83
84
|
};
|
|
84
85
|
export type Opened = {
|
|
85
|
-
readonly rooms: ReadonlyMap<string,
|
|
86
|
-
readonly transfers: ReadonlyMap<string, TransferRecord>;
|
|
87
|
-
readonly kept: ReadonlyMap<string, ReadonlyMap<string, number>>;
|
|
86
|
+
readonly rooms: ReadonlyMap<string, StoredReplica>;
|
|
88
87
|
readonly unindexed: ReadonlySet<number>;
|
|
89
88
|
readonly overlaid: ReadonlyMap<number, ReadonlySet<string>>;
|
|
90
89
|
readonly erasing: boolean;
|
|
@@ -95,6 +94,7 @@ export type Opened = {
|
|
|
95
94
|
readonly member: Member | null;
|
|
96
95
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
97
96
|
readonly presentation: readonly PresentationRecord[];
|
|
97
|
+
readonly conversationList: readonly ListedConversation[] | null;
|
|
98
98
|
};
|
|
99
99
|
export type Commit = {
|
|
100
100
|
readonly rooms: readonly RoomCommit[];
|
|
@@ -116,19 +116,21 @@ export type RuntimeStore = {
|
|
|
116
116
|
readonly path: string;
|
|
117
117
|
readonly revision: string;
|
|
118
118
|
}[]>;
|
|
119
|
+
folders(key: number, view: View, paths: readonly string[]): Promise<readonly string[]>;
|
|
119
120
|
typedWithin(key: number, view: View, roots: readonly string[], within: boolean): Promise<boolean>;
|
|
120
121
|
search(ask: SearchAsk): Promise<SearchWindow>;
|
|
121
|
-
stage(record: TransferRecord, composition: Composition, page: StagedPage
|
|
122
|
-
|
|
123
|
-
keepParts(parts: readonly KeptPart[]): Promise<void>;
|
|
124
|
-
refresh(key: number, page: RefreshedPage): Promise<void>;
|
|
122
|
+
stage(record: TransferRecord, composition: Composition, page: StagedPage): Promise<number | null>;
|
|
123
|
+
refresh(key: number, composition: Composition, page: RefreshedPage): Promise<void>;
|
|
125
124
|
unrefresh(key: number): Promise<void>;
|
|
126
125
|
commit(commit: Commit): Promise<CommittedWrite>;
|
|
127
126
|
fence(locators: readonly string[]): Promise<void>;
|
|
128
127
|
erase(locator: string | null, limit: number): Promise<boolean>;
|
|
129
|
-
abandon(locator: string
|
|
128
|
+
abandon(locator: string): Promise<void>;
|
|
130
129
|
release(key: number): Promise<void>;
|
|
131
|
-
rederive(key: number, bytes: number): Promise<
|
|
130
|
+
rederive(key: number, composition: Composition, bytes: number, ms: number, floor: number): Promise<{
|
|
131
|
+
readonly done: boolean;
|
|
132
|
+
readonly text: number;
|
|
133
|
+
}>;
|
|
132
134
|
fact(name: string, value: unknown): Promise<void>;
|
|
133
135
|
queues(): Promise<readonly QueueRecord[]>;
|
|
134
136
|
submit(locator: string, id: string, submission: Submission, lost: boolean): Promise<void>;
|
|
@@ -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[];
|
|
@@ -42,16 +42,6 @@ export type ReplicaOpened = {
|
|
|
42
42
|
readonly key: number;
|
|
43
43
|
readonly record: string;
|
|
44
44
|
}[];
|
|
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
45
|
readonly keys: readonly HeldKey[];
|
|
56
46
|
readonly facts: Readonly<Record<string, string>>;
|
|
57
47
|
readonly presentation: readonly {
|
|
@@ -77,7 +67,7 @@ export type RoomCommit = {
|
|
|
77
67
|
readonly from: number | null;
|
|
78
68
|
};
|
|
79
69
|
readonly refreshed?: true;
|
|
80
|
-
readonly
|
|
70
|
+
readonly composed: Composed;
|
|
81
71
|
readonly confirmed?: {
|
|
82
72
|
readonly set: readonly StoredEntry[];
|
|
83
73
|
readonly removed: readonly string[];
|
|
@@ -100,20 +90,18 @@ export type Walked = {
|
|
|
100
90
|
readonly entries: readonly HeldEntry[];
|
|
101
91
|
readonly next: string | null;
|
|
102
92
|
};
|
|
103
|
-
export declare function fingerprint(composition: Composition): string;
|
|
104
93
|
export declare function entered(connection: Connection, locator: string, composition: Composition, rows: readonly StoredEntry[]): number;
|
|
105
94
|
export declare function stage(connection: Connection, request: {
|
|
106
95
|
readonly locator: string;
|
|
107
96
|
readonly transfer: string;
|
|
108
|
-
readonly record: string;
|
|
109
97
|
readonly key: number | null;
|
|
110
|
-
readonly
|
|
98
|
+
readonly fingerprint: string;
|
|
111
99
|
readonly entries: readonly StoredEntry[];
|
|
112
100
|
readonly folders: readonly string[];
|
|
113
|
-
readonly written?: string;
|
|
114
101
|
}): number;
|
|
115
102
|
export declare function refreshing(connection: Connection, request: {
|
|
116
103
|
readonly key: number;
|
|
104
|
+
readonly composed: Composed;
|
|
117
105
|
readonly entries: readonly StoredEntry[];
|
|
118
106
|
readonly removals: readonly string[];
|
|
119
107
|
readonly folders: readonly string[];
|
|
@@ -123,13 +111,14 @@ export declare function unrefresh(connection: Connection, key: number): null;
|
|
|
123
111
|
export declare function counts(connection: Connection, rooms: readonly CountedRoom[]): number[];
|
|
124
112
|
export declare function commit(connection: Connection, rooms: readonly RoomCommit[]): Committed;
|
|
125
113
|
export declare function fenceRooms(connection: Connection, locators: readonly string[]): null;
|
|
126
|
-
export declare function abandon(connection: Connection, locator: string
|
|
114
|
+
export declare function abandon(connection: Connection, locator: string): null;
|
|
127
115
|
export declare function release(connection: Connection, key: number): null;
|
|
128
116
|
export declare function erase(connection: Connection, locator: string | null, limit: number): {
|
|
129
117
|
readonly remaining: boolean;
|
|
130
118
|
};
|
|
131
|
-
export declare function rederive(connection: Connection, key: number, bytes: number): {
|
|
119
|
+
export declare function rederive(connection: Connection, key: number, composed: Composed, bytes: number, ms: number, floor: number): {
|
|
132
120
|
readonly done: boolean;
|
|
121
|
+
readonly text: number;
|
|
133
122
|
};
|
|
134
123
|
export declare function entries(connection: Connection, key: number, view: View, list: readonly string[]): HeldEntry[];
|
|
135
124
|
export declare function typed(connection: Connection, key: number, view: View, list: readonly string[]): TypedEntry[];
|
|
@@ -139,13 +128,7 @@ export declare function files(connection: Connection, key: number, view: View, a
|
|
|
139
128
|
readonly path: string;
|
|
140
129
|
readonly revision: string;
|
|
141
130
|
}[];
|
|
131
|
+
export declare function folders(connection: Connection, key: number, view: View, list: readonly string[]): string[];
|
|
142
132
|
export declare function typedWithin(connection: Connection, key: number, view: View, roots: readonly string[], within: boolean): boolean;
|
|
143
|
-
export declare function transferPart(connection: Connection, locator: string, token: string): Uint8Array | null;
|
|
144
|
-
export type KeptPart = {
|
|
145
|
-
readonly locator: string;
|
|
146
|
-
readonly token: string;
|
|
147
|
-
readonly part: Uint8Array;
|
|
148
|
-
};
|
|
149
|
-
export declare function keepParts(connection: Connection, parts: readonly KeptPart[]): null;
|
|
150
133
|
export declare function opened(connection: Connection): ReplicaOpened;
|
|
151
134
|
export declare function ended(connection: Connection): void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
2
|
import type { KeptReceipt } from './adapter.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Composed } from './collection.js';
|
|
4
4
|
import { type SearchAsk } from './fulltext.js';
|
|
5
5
|
import { type ConversationWrite, type HeldConversation, type MessageWindow } from './messages.js';
|
|
6
6
|
import type { Plan } from './query.js';
|
|
7
7
|
import type { SearchWindow } from './search.js';
|
|
8
|
-
import { type Committed, type CountedRoom, type HeldEntry, type
|
|
9
|
-
export type { Committed, CountedRoom, HeldEntry,
|
|
8
|
+
import { type Committed, type CountedRoom, type HeldEntry, type ReplicaOpened, type Referrer, type RoomCommit, type StoredEntry, type TypedEntry, type View, type Walked } from './stored.js';
|
|
9
|
+
export type { Committed, CountedRoom, HeldEntry, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, Walked, } from './stored.js';
|
|
10
10
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
11
11
|
export type { SearchAsk } from './fulltext.js';
|
|
12
12
|
export type { ConversationWrite, HeldConversation, MessageWindow } from './messages.js';
|
|
@@ -197,6 +197,11 @@ export interface RuntimeRequests {
|
|
|
197
197
|
readonly path: string;
|
|
198
198
|
readonly revision: string;
|
|
199
199
|
}[]>;
|
|
200
|
+
readonly 'replica.folders': Asked<{
|
|
201
|
+
readonly key: number;
|
|
202
|
+
readonly view: View;
|
|
203
|
+
readonly paths: readonly string[];
|
|
204
|
+
}, readonly string[]>;
|
|
200
205
|
readonly 'replica.typedWithin': Asked<{
|
|
201
206
|
readonly key: number;
|
|
202
207
|
readonly view: View;
|
|
@@ -215,22 +220,14 @@ export interface RuntimeRequests {
|
|
|
215
220
|
readonly 'replica.stage': Asked<{
|
|
216
221
|
readonly locator: string;
|
|
217
222
|
readonly transfer: string;
|
|
218
|
-
readonly record: string;
|
|
219
223
|
readonly key: number | null;
|
|
220
|
-
readonly
|
|
224
|
+
readonly fingerprint: string;
|
|
221
225
|
readonly entries: readonly StoredEntry[];
|
|
222
226
|
readonly folders: readonly string[];
|
|
223
|
-
readonly written?: string;
|
|
224
227
|
}, number | null>;
|
|
225
|
-
readonly 'replica.transferPart': Asked<{
|
|
226
|
-
readonly locator: string;
|
|
227
|
-
readonly token: string;
|
|
228
|
-
}, Uint8Array | null>;
|
|
229
|
-
readonly 'replica.keepParts': Asked<{
|
|
230
|
-
readonly parts: readonly KeptPart[];
|
|
231
|
-
}, null>;
|
|
232
228
|
readonly 'replica.refresh': Asked<{
|
|
233
229
|
readonly key: number;
|
|
230
|
+
readonly composed: Composed;
|
|
234
231
|
readonly entries: readonly StoredEntry[];
|
|
235
232
|
readonly removals: readonly string[];
|
|
236
233
|
readonly folders: readonly string[];
|
|
@@ -254,16 +251,19 @@ export interface RuntimeRequests {
|
|
|
254
251
|
}>;
|
|
255
252
|
readonly 'replica.abandon': Asked<{
|
|
256
253
|
readonly locator: string;
|
|
257
|
-
|
|
258
|
-
}, number | null>;
|
|
254
|
+
}, null>;
|
|
259
255
|
readonly 'replica.release': Asked<{
|
|
260
256
|
readonly key: number;
|
|
261
257
|
}, null>;
|
|
262
258
|
readonly 'replica.rederive': Asked<{
|
|
263
259
|
readonly key: number;
|
|
260
|
+
readonly composed: Composed;
|
|
264
261
|
readonly bytes: number;
|
|
262
|
+
readonly ms: number;
|
|
263
|
+
readonly floor: number;
|
|
265
264
|
}, {
|
|
266
265
|
readonly done: boolean;
|
|
266
|
+
readonly text: number;
|
|
267
267
|
}>;
|
|
268
268
|
readonly 'replica.fact': Asked<{
|
|
269
269
|
readonly name: string;
|
package/docs/families.md
CHANGED
|
@@ -13,8 +13,7 @@
|
|
|
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
|
|
17
|
-
slot.
|
|
16
|
+
its Rooms, with `?slot=<name>` to open at one slot.
|
|
18
17
|
- **Installation** - `install()` offers the page as a Home-screen app. Where the
|
|
19
18
|
browser has an install prompt ready the shell shows it and the call resolves
|
|
20
19
|
`'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
|
|
@@ -69,16 +68,15 @@
|
|
|
69
68
|
refusal is House's `{ error: { code, retryable } }`, `app_release_not_found` for an
|
|
70
69
|
App with no release; a read House does not answer, or one that outlived
|
|
71
70
|
the browser's signed-in User, is `null`.
|
|
72
|
-
- **External calls** - `callExternal({ url, method, headers, body,
|
|
71
|
+
- **External calls** - `callExternal({ url, method, headers, body, room_ref })`
|
|
73
72
|
has House's server send an HTTPS request to one of the release's declared
|
|
74
73
|
external origins and resolves with the service's `status`, `headers` and its
|
|
75
74
|
body as `body` text or `body_base64`, or a refusal as House's
|
|
76
75
|
`{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
|
|
77
|
-
App and its running release
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`account` instead. `body_base64` replaces `body` for bytes.
|
|
76
|
+
App and its running release. A `room_ref` names a Room the signed-in User binds to the App
|
|
77
|
+
in a `write` slot, and House adds that Room's Service key for the URL's origin, which App
|
|
78
|
+
code never sees; a call naming no Room carries no key, and a Site's call names no Room.
|
|
79
|
+
`body_base64` replaces `body` for bytes.
|
|
82
80
|
- **App messages** - `messages(listener)` hands the listener each message
|
|
83
81
|
another holder of this App sends to this User's running copies, as `from`,
|
|
84
82
|
the sender's User id, and `body`, the JSON value they sent, until the
|
|
@@ -134,7 +132,12 @@
|
|
|
134
132
|
calls at once, as offline, those of the workers it starts included, and
|
|
135
133
|
refuses its Saves, write acts and external calls with the retryable code
|
|
136
134
|
`house_trial_withheld`, so a start-up effect is not repeated; run start-up
|
|
137
|
-
effects after `settle('committed')`.
|
|
135
|
+
effects after `settle('committed')`. An optional `placed()` resolves once
|
|
136
|
+
the page has drawn the place it opened on with what that place shows:
|
|
137
|
+
House keeps its first-preparation surface over a page registered by its
|
|
138
|
+
first draw until then, and lifts it at the first draw of a page whose
|
|
139
|
+
cooperation defines none, so the User goes from the surface to a drawn
|
|
140
|
+
place in one change; a release's readiness check never waits for it.
|
|
138
141
|
|
|
139
142
|
## The test host
|
|
140
143
|
|
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-ce7c3baa4a247",
|
|
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",
|