@agentshouse/app-bridge 0.1.0-cbe35d3d6ed3f → 0.1.0-cbfba8eb42db9
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/index.d.ts +55 -5
- package/dist/mdmodel/definition.d.ts +1 -0
- package/dist/mdmodel/house-model.d.ts +8 -4
- package/dist/mdmodel/index.d.ts +4 -2
- package/dist/mdmodel/moment.d.ts +6 -0
- package/dist/mdmodel/paths.d.ts +5 -0
- package/dist/mdmodel/validate.d.ts +2 -0
- package/dist/mdruntime/adapter.d.ts +11 -2
- package/dist/mdruntime/client.d.ts +3 -0
- package/dist/mdruntime/conversation.d.ts +5 -2
- package/dist/mdruntime/durability.d.ts +1 -0
- package/dist/mdruntime/media.d.ts +13 -1
- package/dist/mdruntime/modal.d.ts +1 -0
- package/dist/mdruntime/outcome.d.ts +6 -1
- package/dist/mdruntime/saves.d.ts +2 -0
- package/dist/mdruntime/store/records.d.ts +6 -0
- package/dist/mdruntime/surface.d.ts +4 -2
- package/dist/mdruntime/wire.d.ts +13 -0
- package/dist/test-host.d.ts +2 -2
- package/dist/test-host.js +6 -0
- package/docs/families.md +33 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -271,11 +271,18 @@ export interface HouseMethods {
|
|
|
271
271
|
readonly room_ref: string;
|
|
272
272
|
};
|
|
273
273
|
readonly result: {
|
|
274
|
-
readonly history?: readonly {
|
|
274
|
+
readonly history?: readonly ({
|
|
275
|
+
readonly agent_name?: string;
|
|
276
|
+
readonly at: string;
|
|
277
|
+
readonly by?: string;
|
|
278
|
+
readonly kind: "role_given" | "role_taken";
|
|
279
|
+
readonly role: string;
|
|
280
|
+
readonly user: string;
|
|
281
|
+
} | {
|
|
275
282
|
readonly at: string;
|
|
276
283
|
readonly kind: "granted" | "revoked";
|
|
277
284
|
readonly user: string;
|
|
278
|
-
}[];
|
|
285
|
+
})[];
|
|
279
286
|
readonly members: readonly {
|
|
280
287
|
readonly access?: "manage" | "owner" | "read" | "write";
|
|
281
288
|
readonly copies?: "online_only" | "search_only";
|
|
@@ -284,6 +291,12 @@ export interface HouseMethods {
|
|
|
284
291
|
readonly member_document: null | string;
|
|
285
292
|
readonly owner: boolean;
|
|
286
293
|
readonly schema_roles?: readonly string[];
|
|
294
|
+
readonly schema_roles_given?: readonly {
|
|
295
|
+
readonly agent_name?: string;
|
|
296
|
+
readonly at: string;
|
|
297
|
+
readonly by?: string;
|
|
298
|
+
readonly role: string;
|
|
299
|
+
}[];
|
|
287
300
|
readonly since: null | string;
|
|
288
301
|
readonly through_space?: true;
|
|
289
302
|
readonly user: string;
|
|
@@ -324,6 +337,18 @@ export interface HouseMethods {
|
|
|
324
337
|
readonly writable: boolean;
|
|
325
338
|
};
|
|
326
339
|
};
|
|
340
|
+
readonly "service-keys/signatures/check": {
|
|
341
|
+
readonly params: {
|
|
342
|
+
readonly operation_id?: string;
|
|
343
|
+
readonly origin: string;
|
|
344
|
+
readonly room_ref: string;
|
|
345
|
+
readonly signature: string;
|
|
346
|
+
readonly text: string;
|
|
347
|
+
};
|
|
348
|
+
readonly result: {
|
|
349
|
+
readonly matched: boolean;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
327
352
|
readonly "sites/submissions/create": {
|
|
328
353
|
readonly params: {
|
|
329
354
|
readonly content: string;
|
|
@@ -493,7 +518,12 @@ export interface HouseMethods {
|
|
|
493
518
|
readonly outcome: "refused";
|
|
494
519
|
readonly position: number;
|
|
495
520
|
} | {
|
|
496
|
-
readonly code: "
|
|
521
|
+
readonly code: "post_not_confirmed";
|
|
522
|
+
readonly final: true;
|
|
523
|
+
readonly outcome: "failed";
|
|
524
|
+
readonly position: number;
|
|
525
|
+
} | {
|
|
526
|
+
readonly code: "agent_function_retired" | "environment_offline" | "no_group" | "no_recipient" | "not_found" | "target_agent_unavailable";
|
|
497
527
|
readonly outcome: "no_target";
|
|
498
528
|
readonly position: number;
|
|
499
529
|
} | {
|
|
@@ -511,6 +541,10 @@ export interface HouseMethods {
|
|
|
511
541
|
readonly output?: string;
|
|
512
542
|
readonly position: number;
|
|
513
543
|
readonly run: string;
|
|
544
|
+
} | {
|
|
545
|
+
readonly mentioned: number;
|
|
546
|
+
readonly outcome: "posted";
|
|
547
|
+
readonly position: number;
|
|
514
548
|
} | {
|
|
515
549
|
readonly outcome: "continued";
|
|
516
550
|
readonly position: number;
|
|
@@ -653,6 +687,16 @@ export interface HouseAppMessage {
|
|
|
653
687
|
readonly body: unknown;
|
|
654
688
|
}
|
|
655
689
|
export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
|
|
690
|
+
export interface HouseBox {
|
|
691
|
+
readonly x: number;
|
|
692
|
+
readonly y: number;
|
|
693
|
+
readonly width: number;
|
|
694
|
+
readonly height: number;
|
|
695
|
+
}
|
|
696
|
+
export interface HouseTitleRow {
|
|
697
|
+
readonly height: number;
|
|
698
|
+
readonly controls: readonly HouseBox[];
|
|
699
|
+
}
|
|
656
700
|
export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
|
|
657
701
|
export interface HouseTelegram {
|
|
658
702
|
readonly state: Open<'available' | 'linked' | 'unavailable'>;
|
|
@@ -700,6 +744,9 @@ export interface HouseChatButtonOptions {
|
|
|
700
744
|
readonly onOpen?: (opened: HouseChatOpened) => void;
|
|
701
745
|
readonly onLink?: (href: string) => void;
|
|
702
746
|
}
|
|
747
|
+
export interface HouseChatButtonMount extends HouseChatButtonOptions {
|
|
748
|
+
readonly agent?: string | null;
|
|
749
|
+
}
|
|
703
750
|
export interface HouseChatTarget {
|
|
704
751
|
readonly conversation?: string | null;
|
|
705
752
|
readonly agent?: string | null;
|
|
@@ -713,7 +760,7 @@ export interface HouseChatButton {
|
|
|
713
760
|
}
|
|
714
761
|
export interface HouseChat {
|
|
715
762
|
mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
|
|
716
|
-
mountButton(options?:
|
|
763
|
+
mountButton(options?: HouseChatButtonMount): Promise<HouseChatButton>;
|
|
717
764
|
}
|
|
718
765
|
export interface HouseBridge {
|
|
719
766
|
readonly runtime: Promise<HouseRuntime>;
|
|
@@ -723,7 +770,10 @@ export interface HouseBridge {
|
|
|
723
770
|
push(address: string): Promise<string>;
|
|
724
771
|
replace(address: string): Promise<string>;
|
|
725
772
|
ceremony(path: string): Promise<HouseCeremonyEnded>;
|
|
726
|
-
install(): Promise<HouseInstallation>;
|
|
773
|
+
install(app?: string): Promise<HouseInstallation>;
|
|
774
|
+
installed(): Promise<boolean>;
|
|
775
|
+
onTitleBar(listener: (area: HouseBox | null) => void): () => void;
|
|
776
|
+
setTitleBar(row: HouseTitleRow | null): void;
|
|
727
777
|
notifications(on?: boolean): Promise<HouseNotifications>;
|
|
728
778
|
telegram(link?: true): Promise<HouseTelegram>;
|
|
729
779
|
setTab(tab: HouseTab): void;
|
|
@@ -14,6 +14,7 @@ export type ValueFacts = {
|
|
|
14
14
|
readonly prefix?: readonly ValueFacts[];
|
|
15
15
|
readonly items?: ValueFacts;
|
|
16
16
|
readonly properties?: Readonly<Record<string, ValueFacts>>;
|
|
17
|
+
readonly required?: readonly string[];
|
|
17
18
|
readonly patterns?: readonly PatternFacts[];
|
|
18
19
|
readonly additional?: ValueFacts;
|
|
19
20
|
};
|
|
@@ -103,7 +103,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
|
|
|
103
103
|
readonly format: 'email';
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
readonly required: readonly ['name'
|
|
106
|
+
readonly required: readonly ['name'];
|
|
107
107
|
};
|
|
108
108
|
readonly rooms: {
|
|
109
109
|
readonly title: 'Rooms';
|
|
@@ -246,7 +246,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
|
|
|
246
246
|
readonly format: 'email';
|
|
247
247
|
};
|
|
248
248
|
};
|
|
249
|
-
readonly required: readonly ['name'
|
|
249
|
+
readonly required: readonly ['name'];
|
|
250
250
|
};
|
|
251
251
|
readonly environment: {
|
|
252
252
|
readonly title: 'Environment';
|
|
@@ -411,7 +411,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
|
|
|
411
411
|
readonly code: {
|
|
412
412
|
readonly title: 'Code';
|
|
413
413
|
readonly type: 'string';
|
|
414
|
-
readonly enum: readonly ['failed', 'internal_error', 'agent_function_unreadable', 'function_failed', 'function_not_started', 'agent_function_request_not_started'];
|
|
414
|
+
readonly enum: readonly ['failed', 'internal_error', 'agent_function_unreadable', 'function_failed', 'function_not_started', 'agent_function_request_not_started', 'post_not_confirmed'];
|
|
415
415
|
};
|
|
416
416
|
readonly action: {
|
|
417
417
|
readonly title: 'Action';
|
|
@@ -571,7 +571,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
|
|
|
571
571
|
readonly required: readonly ['description', 'input', 'agent'];
|
|
572
572
|
};
|
|
573
573
|
readonly 'house-trigger': {
|
|
574
|
-
readonly description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles
|
|
574
|
+
readonly description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`, or, `in_group`, posts once in this Room's Telegram group in their place, mentioning each; an `agent_function` action sends its `payload` to the Agent function whose card under this Room's `house/agent-functions/` its `card` names, absent while this Room holds no card of that Agent function; a `message` action puts its `text` into the active conversation that Agent function started for what the Event is about, or starts that Agent function when none is active; a `done` action marks Done every active conversation an Agent function request of this Room started for the Event's document; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, or, naming no `app`, the Room owner's Environment function of that name on its Environment, which only a Trigger of their Private Room holds. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release and the owner's functions.";
|
|
575
575
|
readonly properties: {
|
|
576
576
|
readonly reflected: {
|
|
577
577
|
readonly title: 'Reflected';
|
|
@@ -653,6 +653,10 @@ export declare const HOUSE_MODEL_DECLARATION: {
|
|
|
653
653
|
};
|
|
654
654
|
readonly required: readonly ['users', 'fields', 'roles'];
|
|
655
655
|
};
|
|
656
|
+
readonly in_group: {
|
|
657
|
+
readonly title: 'In group';
|
|
658
|
+
readonly const: true;
|
|
659
|
+
};
|
|
656
660
|
};
|
|
657
661
|
readonly required: readonly ['kind', 'enabled', 'title', 'text', 'to'];
|
|
658
662
|
}, {
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export * as sql from './query/sql.js';
|
|
|
12
12
|
export { headingLines } from './markdown.js';
|
|
13
13
|
export type { HeadingLine } from './markdown.js';
|
|
14
14
|
export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
|
|
15
|
+
export { shownDay, shownMoment } from './moment.js';
|
|
16
|
+
export type { MomentReader } from './moment.js';
|
|
15
17
|
export { labelAt, NAME_FIELD } from './body.js';
|
|
16
18
|
export type { Naming } from './body.js';
|
|
17
19
|
export { divide } from './divide.js';
|
|
@@ -27,7 +29,7 @@ export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, RE
|
|
|
27
29
|
export type { HouseDocumentFields, HouseModelType } from './house-model.js';
|
|
28
30
|
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
|
|
29
31
|
export type { InboxChannelKind } from './room-types.js';
|
|
30
|
-
export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
32
|
+
export { keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, } from './paths.js';
|
|
31
33
|
export { openPatternBudget } from './pattern.js';
|
|
32
34
|
export type { LinkedPath, RoomTarget } from './paths.js';
|
|
33
35
|
export { project } from './project.js';
|
|
@@ -36,7 +38,7 @@ export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESC
|
|
|
36
38
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
|
|
37
39
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
|
|
38
40
|
export type { ApplyResult, BodyResult, Change, DefinitionOf, Division, DivisionContext, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
39
|
-
export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
|
|
41
|
+
export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
|
|
40
42
|
export type { Assessment, Verdicts } from './validate.js';
|
|
41
43
|
export { VERSION } from './version.js';
|
|
42
44
|
export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
|
package/dist/mdmodel/paths.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ export interface LinkedPath {
|
|
|
26
26
|
readonly fragment: string | null;
|
|
27
27
|
}
|
|
28
28
|
export declare function linkedPath(from: string, href: string): LinkedPath | null;
|
|
29
|
+
export interface KeyedLink extends RoomTarget {
|
|
30
|
+
readonly key: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function keyedLink(href: string): KeyedLink | null;
|
|
33
|
+
export declare function keyedDestination(path: string, key: string): string;
|
|
29
34
|
export declare function retarget(href: string, to: string): string;
|
|
30
35
|
export declare function relative(from: string, target: string): string;
|
|
31
36
|
export declare const SHELL_ROOMS = "/rooms/";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
+
import { type KeyedLink } from './paths.js';
|
|
2
3
|
import type { DefinitionOf, Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, TypedPath, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
|
|
3
4
|
export declare function definitionAt(model: VerifiedModel, file: string, typedPaths?: readonly TypedPath[]): DefinitionOf;
|
|
4
5
|
export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
|
|
@@ -7,6 +8,7 @@ export declare function readTypes(schema: string, provided?: VerifiedModel): Ver
|
|
|
7
8
|
type Placing = Pick<ValidationContext, 'anyRoom' | 'typedPaths'>;
|
|
8
9
|
export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Placing): DocumentCheck;
|
|
9
10
|
export declare function bodyRoomLinks(body: string): RoomReference[];
|
|
11
|
+
export declare function bodyKeyedLinks(body: string): KeyedLink[];
|
|
10
12
|
export declare function roomReferences(document: Document, definition?: Definition): readonly RoomReference[];
|
|
11
13
|
type Placed = {
|
|
12
14
|
readonly reference: Reached;
|
|
@@ -262,6 +262,7 @@ export type Discovery = {
|
|
|
262
262
|
providerLimits: readonly ProviderLimit[];
|
|
263
263
|
retention: Retention;
|
|
264
264
|
member?: Member;
|
|
265
|
+
timeZone?: string | null;
|
|
265
266
|
roomList?: RoomList;
|
|
266
267
|
};
|
|
267
268
|
export type TransportUncertainty = {
|
|
@@ -445,6 +446,10 @@ export type BinaryRequest = {
|
|
|
445
446
|
path: string;
|
|
446
447
|
revision: string;
|
|
447
448
|
};
|
|
449
|
+
export type KeyedRequest = {
|
|
450
|
+
kind: 'key';
|
|
451
|
+
link: string;
|
|
452
|
+
};
|
|
448
453
|
export type BinaryResult = {
|
|
449
454
|
kind: 'binary';
|
|
450
455
|
body: ReadableStream<Uint8Array>;
|
|
@@ -462,7 +467,7 @@ export type BinaryLinkResult = {
|
|
|
462
467
|
kind: 'rejected';
|
|
463
468
|
}) | AdapterFailure;
|
|
464
469
|
export type AttachRequest = {
|
|
465
|
-
locator
|
|
470
|
+
locator?: string;
|
|
466
471
|
name: string;
|
|
467
472
|
mediaType: string;
|
|
468
473
|
byteLength: number;
|
|
@@ -473,6 +478,9 @@ export type AttachResult = {
|
|
|
473
478
|
kind: 'attached';
|
|
474
479
|
path: string;
|
|
475
480
|
revision: string;
|
|
481
|
+
} | {
|
|
482
|
+
kind: 'linked';
|
|
483
|
+
link: string;
|
|
476
484
|
} | (ProviderRefusal & {
|
|
477
485
|
kind: 'rejected';
|
|
478
486
|
}) | AdapterFailure;
|
|
@@ -524,6 +532,7 @@ export type AuthorityChange = {
|
|
|
524
532
|
rooms: readonly DiscoveredRoom[];
|
|
525
533
|
left: readonly string[];
|
|
526
534
|
member?: Member;
|
|
535
|
+
timeZone?: string | null;
|
|
527
536
|
roomList?: RoomList & {
|
|
528
537
|
readonly left: readonly string[];
|
|
529
538
|
};
|
|
@@ -563,7 +572,7 @@ export type Adapter = {
|
|
|
563
572
|
mutate(authorization: Authorization, request: MutationRequest, keep: (upload: unknown) => Promise<void>): Promise<MutationResult>;
|
|
564
573
|
history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
|
|
565
574
|
binary(authorization: Authorization, request: BinaryRequest): Promise<BinaryResult>;
|
|
566
|
-
link(authorization: Authorization, request: BinaryRequest): Promise<BinaryLinkResult>;
|
|
575
|
+
link(authorization: Authorization, request: BinaryRequest | KeyedRequest): Promise<BinaryLinkResult>;
|
|
567
576
|
attach(authorization: Authorization, request: AttachRequest): Promise<AttachResult>;
|
|
568
577
|
action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
|
|
569
578
|
search?(authorization: Authorization, request: SearchAsk): Promise<SearchAnswer>;
|
|
@@ -59,6 +59,7 @@ export type MdRuntimeClient = {
|
|
|
59
59
|
retry(): Promise<void>;
|
|
60
60
|
cleanUp(): Promise<number>;
|
|
61
61
|
unsent(): Promise<readonly UnsentWork[]>;
|
|
62
|
+
sent(): Promise<void>;
|
|
62
63
|
reset(): Promise<void>;
|
|
63
64
|
readAgain(): Promise<void>;
|
|
64
65
|
observe: {
|
|
@@ -70,6 +71,7 @@ export type MdRuntimeClient = {
|
|
|
70
71
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
71
72
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
72
73
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
74
|
+
(topic: 'time-zone'): Promise<Observation<string | null>>;
|
|
73
75
|
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
74
76
|
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
75
77
|
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
@@ -93,6 +95,7 @@ export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void
|
|
|
93
95
|
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
94
96
|
export { roomDraftRevision } from './identity.js';
|
|
95
97
|
export { defineRoomMedia, ROOM_MEDIA, viewFile } from './media.js';
|
|
98
|
+
export { shownModal } from './modal.js';
|
|
96
99
|
export type { Observation } from './observation.js';
|
|
97
100
|
export type { Open } from './open.js';
|
|
98
101
|
export { unanswered, type RuntimePort, type WireMember } from './wire.js';
|
|
@@ -4,7 +4,7 @@ import { type ChangeSet } from './change-set.js';
|
|
|
4
4
|
import { type LiveConversations } from './conversation-live.js';
|
|
5
5
|
import { type ConversationHeld } from './conversation-row.js';
|
|
6
6
|
import type { Open } from './open.js';
|
|
7
|
-
import { type CallResult, type Offline } from './outcome.js';
|
|
7
|
+
import { type BinaryLinkAnswer, type CallResult, type ConversationAttachAnswer, type Offline } from './outcome.js';
|
|
8
8
|
import type { ChatRequest } from './source.js';
|
|
9
9
|
import type { CycleProgress } from './status.js';
|
|
10
10
|
import type { RuntimeStore } from './store.js';
|
|
@@ -96,7 +96,10 @@ export type ConversationSurface = {
|
|
|
96
96
|
pin(figures: readonly string[]): Promise<void>;
|
|
97
97
|
openTurn(conversation: string, turn: string): Promise<void>;
|
|
98
98
|
dismissSuggestion(conversation: string, suggestion: string): Promise<void>;
|
|
99
|
+
attach(file: File): Promise<ConversationAttachAnswer>;
|
|
100
|
+
attachment(link: string): Promise<BinaryLinkAnswer>;
|
|
99
101
|
};
|
|
102
|
+
export type ConversationFiles = Pick<ConversationSurface, 'attach' | 'attachment'>;
|
|
100
103
|
export type ConversationAnswer = {
|
|
101
104
|
interaction_id: string;
|
|
102
105
|
response: unknown;
|
|
@@ -120,7 +123,7 @@ export type Asked = {
|
|
|
120
123
|
};
|
|
121
124
|
export declare function joinedDraft(first: string, second: string): string;
|
|
122
125
|
export declare function conversationsLearned(alive: LiveConversations): void;
|
|
123
|
-
export declare function conversationSurface(alive: LiveConversations): ConversationSurface;
|
|
126
|
+
export declare function conversationSurface(alive: LiveConversations, files: ConversationFiles): ConversationSurface;
|
|
124
127
|
export declare function chatDraftSurface(alive: LiveConversations): ChatDraftSurface;
|
|
125
128
|
export declare function conversationsOpened(alive: LiveConversations, local: RuntimeStore): Promise<void>;
|
|
126
129
|
export declare function reconcileOpening(alive: LiveConversations): Promise<void>;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './client.js';
|
|
2
|
-
import { type ShownAnswer } from './outcome.js';
|
|
2
|
+
import { type DownloadAnswer, type ShownAnswer } from './outcome.js';
|
|
3
3
|
export declare const ROOM_MEDIA = "room-media";
|
|
4
|
+
export declare const KEYED_MEDIA = "ahc-attachment";
|
|
5
|
+
export declare const MEDIA = "room-media, ahc-attachment";
|
|
4
6
|
export declare const DIAGRAM = "md-diagram";
|
|
5
7
|
export declare const VIEWING = "ahc-viewer";
|
|
6
8
|
type Show = (room: string, path: string, revision?: string) => Promise<ShownAnswer>;
|
|
9
|
+
export type MediaAt = {
|
|
10
|
+
readonly link: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly room: string;
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly revision: string | undefined;
|
|
15
|
+
};
|
|
7
16
|
export declare function shownBy(show: Show, client: MdRuntimeClient): MdRuntimeClient;
|
|
17
|
+
export declare function mediaAt(media: Element): MediaAt | null;
|
|
18
|
+
export declare function mediaTag(at: MediaAt): string;
|
|
19
|
+
export declare function downloadAt(client: MdRuntimeClient, at: MediaAt): Promise<DownloadAnswer>;
|
|
8
20
|
export declare function rendered(element: Element): boolean;
|
|
9
21
|
export declare function viewable(element: Element): boolean;
|
|
10
22
|
export declare function viewFile(client: MdRuntimeClient, media: Element): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shownModal(dialog: HTMLDialogElement): void;
|
|
@@ -40,6 +40,10 @@ export type AttachAnswer = {
|
|
|
40
40
|
kind: 'attached';
|
|
41
41
|
path: string;
|
|
42
42
|
} | Offline | Refused<'rejected'> | Failure;
|
|
43
|
+
export type ConversationAttachAnswer = {
|
|
44
|
+
kind: 'attached';
|
|
45
|
+
link: string;
|
|
46
|
+
} | Offline | Refused<'rejected'> | Refused<'undeclared'> | Failure;
|
|
43
47
|
export type DownloadAnswer = {
|
|
44
48
|
kind: 'started';
|
|
45
49
|
} | Refused<'rejected'> | Refused<'absent'> | Refused<'blocked'> | Failure;
|
|
@@ -64,6 +68,7 @@ export declare function blobOf(binary: Extract<BinaryAnswer, {
|
|
|
64
68
|
export declare function binaryAnswer(result: KeptResult): HeldBinaryAnswer;
|
|
65
69
|
export declare function binaryLinkAnswer(result: BinaryLinkResult, held?: string): BinaryLinkAnswer;
|
|
66
70
|
export declare function attachAnswer(result: AttachResult): AttachAnswer;
|
|
71
|
+
export declare function linkedAnswer(result: AttachResult): ConversationAttachAnswer;
|
|
67
72
|
export declare const ROOM_LOCKED = "room-locked";
|
|
68
73
|
export declare function lockedRoom(locator: string): Refused<'room-locked'> & {
|
|
69
74
|
locator: string;
|
|
@@ -74,7 +79,7 @@ export type Offline = {
|
|
|
74
79
|
export declare const OFFLINE: Offline;
|
|
75
80
|
export declare function answeredResult(value: unknown): boolean;
|
|
76
81
|
export declare const UNCERTAIN: Failure;
|
|
77
|
-
export declare function undeclared(name: string):
|
|
82
|
+
export declare function undeclared(name: string): Refused<'undeclared'>;
|
|
78
83
|
export declare function failure(result: AdapterFailure): Failure;
|
|
79
84
|
export declare function calledResult(result: ActionResult): CallResult;
|
|
80
85
|
export declare function historyAnswer(result: HistoryResult): HistoryAnswer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ChangeBatch, type WrittenBy } from './change.js';
|
|
2
|
+
import type { ConversationFiles } from './conversation.js';
|
|
2
3
|
import { type AttachAnswer, type BinaryLinkAnswer, type HeldBinaryAnswer, type HeldShownAnswer } from './outcome.js';
|
|
3
4
|
import { type RoomDraftParts } from './room-draft.js';
|
|
4
5
|
import type { Runtime } from './runtime.js';
|
|
@@ -28,4 +29,5 @@ export type BinaryFileSurface = {
|
|
|
28
29
|
export declare function saveRoomDrafts(runtime: Runtime, locator: string, named: readonly SavedRoomDraft[], writtenBy: WrittenBy | undefined): Promise<SaveResult>;
|
|
29
30
|
export declare function saveParts(runtime: Runtime, locator: string, named: readonly SavedParts[], writtenBy: WrittenBy | undefined): Promise<SaveResult>;
|
|
30
31
|
export declare function batchFile(store: Store, batch: ChangeBatch): (localId: string) => Promise<Blob>;
|
|
32
|
+
export declare function conversationFiles(runtime: Runtime): ConversationFiles;
|
|
31
33
|
export declare function binaryFileSurface(runtime: Runtime): BinaryFileSurface;
|
|
@@ -8,6 +8,7 @@ import type { RoomDraftRecord, SavedDraft } from '../room-draft.js';
|
|
|
8
8
|
import type { ModelState, StoredModel } from '../model.js';
|
|
9
9
|
import type { CommittedWrite, ConversationWrite, HeldConversation, HeldFact, HeldRow, HeldEntry, MessageWindow, QueryAnswer, QueryRoom, Referrer, ReplicaOpened, RoomCommit, RuntimeDatabase, StoredEntry, StoredFile, TypedEntry, View } from '../tables.js';
|
|
10
10
|
export type { ConversationFact, ConversationWrite, HeldConversation, MessageWindow, } from '../tables.js';
|
|
11
|
+
declare const FILE = "\0file";
|
|
11
12
|
export type TransferRecord = {
|
|
12
13
|
readonly locator: string;
|
|
13
14
|
readonly transfer: string;
|
|
@@ -123,6 +124,7 @@ export type Facts = {
|
|
|
123
124
|
readonly providerLimits: readonly ProviderLimit[];
|
|
124
125
|
readonly capabilities: readonly Capability[];
|
|
125
126
|
readonly member: Member | null;
|
|
127
|
+
readonly timeZone: string | null;
|
|
126
128
|
readonly targets: Readonly<Record<string, TargetRecord>>;
|
|
127
129
|
readonly conversationList: readonly ListedConversation[] | null;
|
|
128
130
|
readonly agentList: readonly ListedAgent[] | null;
|
|
@@ -214,4 +216,8 @@ export type RuntimeStore = {
|
|
|
214
216
|
rememberGeneration(value: string): Promise<void>;
|
|
215
217
|
file(key: string, type: string): Promise<Blob>;
|
|
216
218
|
};
|
|
219
|
+
export type FileMark = {
|
|
220
|
+
readonly [FILE]: string;
|
|
221
|
+
readonly type: string;
|
|
222
|
+
};
|
|
217
223
|
export declare function openRuntimeStore(database: RuntimeDatabase): RuntimeStore;
|
|
@@ -3,7 +3,7 @@ import { type HistoryQuery } from './actions.js';
|
|
|
3
3
|
import type { ListedAgent, Member, RoomList, ServiceMode } from './adapter.js';
|
|
4
4
|
import type { WrittenBy } from './change.js';
|
|
5
5
|
import { type ChatDraftSurface, type ConversationEntry, type ConversationAgent, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
6
|
-
import type
|
|
6
|
+
import { type UnsentWork } from './durability.js';
|
|
7
7
|
import type { FiguresResult } from './figures.js';
|
|
8
8
|
import { type Holdings } from './holdings.js';
|
|
9
9
|
import { type AppRoom } from './listing.js';
|
|
@@ -52,6 +52,7 @@ export type MdRuntime = {
|
|
|
52
52
|
retry(): Promise<void>;
|
|
53
53
|
cleanUp(): Promise<number>;
|
|
54
54
|
unsent(): Promise<readonly UnsentWork[]>;
|
|
55
|
+
sent(): Promise<void>;
|
|
55
56
|
reset(): Promise<void>;
|
|
56
57
|
readAgain(): Promise<void>;
|
|
57
58
|
observe: {
|
|
@@ -62,6 +63,7 @@ export type MdRuntime = {
|
|
|
62
63
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
63
64
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
64
65
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
66
|
+
(topic: 'time-zone'): Promise<Observation<string | null>>;
|
|
65
67
|
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
66
68
|
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
67
69
|
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
@@ -79,7 +81,7 @@ export type MdRuntime = {
|
|
|
79
81
|
};
|
|
80
82
|
reauthorize(): Promise<void>;
|
|
81
83
|
};
|
|
82
|
-
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'listed-agents' | 'room-list' | 'figures' | 'holdings' | 'read';
|
|
84
|
+
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'time-zone' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'listed-agents' | 'room-list' | 'figures' | 'holdings' | 'read';
|
|
83
85
|
export type ComposedRuntime = RuntimeView & {
|
|
84
86
|
seed(entry: EntrySeed): void;
|
|
85
87
|
stop(): Promise<void>;
|
package/dist/mdruntime/wire.d.ts
CHANGED
|
@@ -86,6 +86,10 @@ declare const MEMBERS: {
|
|
|
86
86
|
readonly reach: 'whole';
|
|
87
87
|
readonly effect: 'read';
|
|
88
88
|
};
|
|
89
|
+
readonly sent: {
|
|
90
|
+
readonly reach: 'whole';
|
|
91
|
+
readonly effect: 'read';
|
|
92
|
+
};
|
|
89
93
|
readonly reset: {
|
|
90
94
|
readonly reach: 'whole';
|
|
91
95
|
readonly effect: 'write';
|
|
@@ -198,6 +202,14 @@ declare const MEMBERS: {
|
|
|
198
202
|
readonly reach: 'within';
|
|
199
203
|
readonly effect: 'write';
|
|
200
204
|
};
|
|
205
|
+
readonly 'conversation.attach': {
|
|
206
|
+
readonly reach: 'within';
|
|
207
|
+
readonly effect: 'action';
|
|
208
|
+
};
|
|
209
|
+
readonly 'conversation.attachment': {
|
|
210
|
+
readonly reach: 'within';
|
|
211
|
+
readonly effect: 'read';
|
|
212
|
+
};
|
|
201
213
|
readonly 'chatDraft.write': {
|
|
202
214
|
readonly reach: 'within';
|
|
203
215
|
readonly effect: 'write';
|
|
@@ -224,6 +236,7 @@ declare const TOPICS: {
|
|
|
224
236
|
readonly 'sync-status': 'within';
|
|
225
237
|
readonly 'service-mode': 'runtime';
|
|
226
238
|
readonly member: 'runtime';
|
|
239
|
+
readonly 'time-zone': 'runtime';
|
|
227
240
|
readonly 'authority-changes': 'runtime';
|
|
228
241
|
readonly query: 'within';
|
|
229
242
|
readonly queue: 'within';
|
package/dist/test-host.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from './mdruntime/client.js';
|
|
2
|
-
import type { HouseAnalyticsChoice, HouseAppMessage,
|
|
2
|
+
import type { HouseAnalyticsChoice, HouseAppMessage, HouseChatButtonMount, HouseChatOptions, HouseChatTarget, 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;
|
|
@@ -10,7 +10,7 @@ export interface HouseBridgeChat {
|
|
|
10
10
|
readonly mounted: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface HouseBridgeChatButton {
|
|
13
|
-
readonly options:
|
|
13
|
+
readonly options: HouseChatButtonMount;
|
|
14
14
|
readonly shown: boolean;
|
|
15
15
|
readonly target: HouseChatTarget | null;
|
|
16
16
|
readonly mounted: boolean;
|
package/dist/test-host.js
CHANGED
|
@@ -153,6 +153,12 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
153
153
|
return new Promise(() => { });
|
|
154
154
|
},
|
|
155
155
|
install: () => Promise.resolve('manual'),
|
|
156
|
+
installed: () => Promise.resolve(false),
|
|
157
|
+
onTitleBar(listener) {
|
|
158
|
+
queueMicrotask(() => listener(null));
|
|
159
|
+
return () => { };
|
|
160
|
+
},
|
|
161
|
+
setTitleBar() { },
|
|
156
162
|
notifications: () => Promise.resolve('unavailable'),
|
|
157
163
|
telegram: () => Promise.resolve({ state: 'unavailable', name: null, username: null }),
|
|
158
164
|
setTab(tab) {
|
package/docs/families.md
CHANGED
|
@@ -22,13 +22,33 @@
|
|
|
22
22
|
`null` when it closed with nothing said, and `done`, whether the decision was
|
|
23
23
|
carried out.
|
|
24
24
|
- **Installation** - `install()` offers the page as a Home-screen app. Where the
|
|
25
|
-
browser
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
browser can start the install itself the shell starts it, and otherwise,
|
|
26
|
+
where the browser has an install prompt ready, the shell shows it; the call
|
|
27
|
+
resolves `'accepted'` or `'dismissed'` with the User's choice, spending that
|
|
28
|
+
prompt. Otherwise, as on every iPhone and iPad, it resolves `'manual'` and
|
|
29
|
+
the App shows its own instructions. A start or a prompt the browser refuses,
|
|
30
|
+
as for a call made without a click, rejects with an error named and coded by
|
|
31
|
+
the browser's own error name, with `retryable` false, and a prompt stays
|
|
32
|
+
ready. Call it from a click. `installed()` resolves `true` where the browser
|
|
33
|
+
lists one of the related applications the page's manifest names as installed,
|
|
34
|
+
and `false` otherwise; an App's manifest names none. The standard
|
|
35
|
+
`display-mode` media query, `standalone`, `fullscreen` on an iPhone or
|
|
36
|
+
iPad, or `window-controls-overlay` in a desktop window with its title-bar
|
|
37
|
+
overlay on, and `navigator.standalone` tell the App it runs installed.
|
|
38
|
+
`install(app)` installs another App, named by its reference, from House's
|
|
39
|
+
own panel alone, where the browser can start the install itself, and
|
|
40
|
+
resolves `'manual'` elsewhere; an App's or a Site's call rejects with an
|
|
41
|
+
error named `HouseCeremonyRefused`.
|
|
42
|
+
- **Title bar** - `onTitleBar(listener)` tells the listener the box of the
|
|
43
|
+
window's title bar in the page, `{ x, y, width, height }`, once the shell
|
|
44
|
+
knows it and at each change, or `null` while the window draws its own;
|
|
45
|
+
only House's own panel asks an installed window to let it draw the row, so
|
|
46
|
+
an App's and a Site's listener hears `null`; an App shown in the installed
|
|
47
|
+
House's window with the overlay on starts below a bar of its top colour
|
|
48
|
+
that drags the window. `setTitleBar({ height,
|
|
49
|
+
controls })` names the page's top row, its height from the top and the box
|
|
50
|
+
of each control in it; the shell lets the person drag the window by the
|
|
51
|
+
rest of the row, and `setTitleBar(null)` ends that.
|
|
32
52
|
- **Notifications** - House's own panel alone; an App's or a Site's call
|
|
33
53
|
rejects with an error named `HouseCeremonyRefused`, carrying `code` and `retryable`. `notifications()` answers this browser
|
|
34
54
|
storage's push state: `'on'`, `'off'`, `'blocked'` where the browser refuses
|
|
@@ -134,7 +154,9 @@
|
|
|
134
154
|
resolves to a handle: `open(target)` shows the sheet, on `target.conversation` or a new
|
|
135
155
|
chat with `target.agent` when it names one, docked at full height when `target.docked` is
|
|
136
156
|
`true`, `hide()` hides it, keeping its chat, scroll and typed text, and `update(options)` and
|
|
137
|
-
`unmount()` work as above, with `onOpen` and `onLink`.
|
|
157
|
+
`unmount()` work as above, with `onOpen` and `onLink`. `agent` among the mount's options
|
|
158
|
+
names the Agent the dot first opens the sheet on, a new chat with it in place of the chat the
|
|
159
|
+
sheet kept, and leaves the sheet hidden. The page's Presentation State
|
|
138
160
|
keeps the sheet's size, place, list and open chat. A Site and the House panel have none: both calls reject with
|
|
139
161
|
an error named and coded `NotSupportedError`, with `retryable` false.
|
|
140
162
|
|
|
@@ -166,7 +188,9 @@ records in `tabs` each `setTab`, answers a release code read from the
|
|
|
166
188
|
`externalCalls`, answers `readScreenshot` from the `screenshots` it was given
|
|
167
189
|
by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
|
|
168
190
|
given by Site identifier, answers every `install()` `'manual'`, as a browser
|
|
169
|
-
with no install prompt does,
|
|
191
|
+
with no install prompt does, and every `installed()` `false`, tells every `onTitleBar` listener
|
|
192
|
+
`null`, as a window that draws its own title bar does, and takes every `setTitleBar` as such a
|
|
193
|
+
window does, answers every `notifications()` `'unavailable'`,
|
|
170
194
|
as a browser without push does, records in `chats`
|
|
171
195
|
each Chat `chat.mount` places, with its `element`, the `options` it was last
|
|
172
196
|
given and whether it is still `mounted`, and in `chatButtons` each Chat button
|
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-cbfba8eb42db9",
|
|
4
4
|
"description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications, status, 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",
|