@agentshouse/app-bridge 0.1.0-c38399ec02f49 → 0.1.0-c38910dcdc9fa
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 +5 -5
- package/dist/calls.d.ts +4 -308
- package/dist/index.d.ts +23 -1
- package/dist/mdmodel/condition.d.ts +1 -0
- package/dist/mdmodel/index.d.ts +1 -1
- package/dist/mdmodel/types.d.ts +1 -0
- package/dist/mdruntime/adapter.d.ts +19 -2
- package/dist/mdruntime/client.d.ts +6 -5
- package/dist/mdruntime/collection.d.ts +5 -0
- package/dist/mdruntime/connection.d.ts +6 -3
- package/dist/mdruntime/conversation.d.ts +3 -2
- package/dist/mdruntime/identity.d.ts +6 -0
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/model.d.ts +6 -0
- package/dist/mdruntime/observation.d.ts +1 -0
- package/dist/mdruntime/outcome.d.ts +13 -2
- package/dist/mdruntime/query.d.ts +6 -0
- package/dist/mdruntime/reach.d.ts +8 -1
- package/dist/mdruntime/readiness.d.ts +1 -0
- package/dist/mdruntime/replica.d.ts +2 -3
- package/dist/mdruntime/room-draft.d.ts +1 -0
- package/dist/mdruntime/save.d.ts +2 -0
- package/dist/mdruntime/status.d.ts +5 -0
- package/dist/mdruntime/store.d.ts +21 -14
- package/dist/mdruntime/stored.d.ts +16 -7
- package/dist/mdruntime/tables.d.ts +27 -9
- package/dist/mdruntime/wire.d.ts +8 -4
- package/dist/test-host.d.ts +7 -1
- package/dist/test-host.js +16 -0
- package/docs/families.md +25 -3
- package/package.json +8 -3
- package/dist/mdruntime/file.d.ts +0 -11
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
The types of the agents.house App bridge, an accessor and an in-page test host.
|
|
4
4
|
House builds the bridge object in every App it serves and hands it to the page
|
|
5
5
|
before the App's own scripts run; `houseBridge()` returns that object, so an App
|
|
6
|
-
carries no bridge code of its own. It carries
|
|
6
|
+
carries no bridge code of its own. It carries twelve families: navigation,
|
|
7
7
|
ceremonies, installation, notifications, status, Site image reads, App release
|
|
8
|
-
code, external calls, App messages
|
|
8
|
+
code, external calls, App messages, App and Site screenshot reads and the Chat.
|
|
9
9
|
[docs/families.md](docs/families.md) describes each and the test host.
|
|
10
10
|
|
|
11
11
|
The bridge carries no credential handling and no Runtime family. House builds
|
|
12
|
-
the MD Runtime client into the page beside the bridge
|
|
13
|
-
|
|
12
|
+
the MD Runtime client into the page beside the bridge and serves it the Chat, so
|
|
13
|
+
the App imports, constructs and bundles neither: `bridge.runtime` resolves to the client.
|
|
14
14
|
|
|
15
|
-
House's
|
|
15
|
+
House's guide to building an App is its Guide's `apps/` pages, which `open_guide` opens.
|
|
16
16
|
|
|
17
17
|
## Use
|
|
18
18
|
|
package/dist/calls.d.ts
CHANGED
|
@@ -64,19 +64,6 @@ export interface HouseMethods {
|
|
|
64
64
|
readonly url: string;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
readonly 'conversation.attach': {
|
|
68
|
-
readonly params: {
|
|
69
|
-
readonly blob: Blob;
|
|
70
|
-
readonly byteLength: number;
|
|
71
|
-
readonly contentHash: string;
|
|
72
|
-
readonly mediaType: string;
|
|
73
|
-
readonly name: string;
|
|
74
|
-
readonly room: string;
|
|
75
|
-
};
|
|
76
|
-
readonly result: {
|
|
77
|
-
readonly path: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
67
|
readonly 'conversation.create': {
|
|
81
68
|
readonly params: {
|
|
82
69
|
readonly agent_id: string;
|
|
@@ -240,7 +227,7 @@ export interface HouseMethods {
|
|
|
240
227
|
readonly params: Readonly<Record<string, never>>;
|
|
241
228
|
readonly result: {
|
|
242
229
|
readonly features: readonly {
|
|
243
|
-
readonly feature:
|
|
230
|
+
readonly feature: string;
|
|
244
231
|
readonly allowed: boolean;
|
|
245
232
|
}[];
|
|
246
233
|
};
|
|
@@ -414,18 +401,11 @@ export interface HouseMethods {
|
|
|
414
401
|
readonly 'record.list': {
|
|
415
402
|
readonly params: {
|
|
416
403
|
readonly room_ref: string;
|
|
417
|
-
readonly record?: string;
|
|
418
404
|
readonly cursor?: string;
|
|
419
405
|
readonly limit?: number;
|
|
420
406
|
readonly order?: 'asc' | 'desc';
|
|
421
407
|
};
|
|
422
408
|
readonly result: {
|
|
423
|
-
readonly record: string;
|
|
424
|
-
readonly ref: string;
|
|
425
|
-
readonly created_at: string;
|
|
426
|
-
readonly body: string | null;
|
|
427
|
-
readonly claimed: unknown;
|
|
428
|
-
} | {
|
|
429
409
|
readonly records: readonly {
|
|
430
410
|
readonly record: string;
|
|
431
411
|
readonly ref: string;
|
|
@@ -630,293 +610,6 @@ export interface HouseMethods {
|
|
|
630
610
|
readonly submitted: true;
|
|
631
611
|
};
|
|
632
612
|
};
|
|
633
|
-
readonly 'trigger.list': {
|
|
634
|
-
readonly params: {
|
|
635
|
-
readonly room_refs: readonly string[];
|
|
636
|
-
};
|
|
637
|
-
readonly result: {
|
|
638
|
-
readonly rooms: readonly {
|
|
639
|
-
readonly room_ref: string;
|
|
640
|
-
readonly triggers: readonly {
|
|
641
|
-
readonly trigger: string;
|
|
642
|
-
readonly creator: {
|
|
643
|
-
readonly user: string;
|
|
644
|
-
readonly name: string;
|
|
645
|
-
};
|
|
646
|
-
readonly description: string;
|
|
647
|
-
readonly condition: {
|
|
648
|
-
readonly on: 'documents';
|
|
649
|
-
readonly scope: {
|
|
650
|
-
readonly type: string;
|
|
651
|
-
} | {
|
|
652
|
-
readonly folder: string;
|
|
653
|
-
} | {
|
|
654
|
-
readonly document: string;
|
|
655
|
-
};
|
|
656
|
-
readonly mode: 'starts_matching';
|
|
657
|
-
readonly new_documents: boolean;
|
|
658
|
-
readonly match: {
|
|
659
|
-
readonly all: readonly unknown[];
|
|
660
|
-
} | {
|
|
661
|
-
readonly any: readonly unknown[];
|
|
662
|
-
} | {
|
|
663
|
-
readonly not: unknown;
|
|
664
|
-
} | {
|
|
665
|
-
readonly path: string;
|
|
666
|
-
readonly eq: string | number | boolean;
|
|
667
|
-
} | {
|
|
668
|
-
readonly path: string;
|
|
669
|
-
readonly in: readonly (string | number | boolean)[];
|
|
670
|
-
} | {
|
|
671
|
-
readonly path: string;
|
|
672
|
-
readonly exists: boolean;
|
|
673
|
-
} | {
|
|
674
|
-
readonly path: string;
|
|
675
|
-
readonly contains: string | number | boolean;
|
|
676
|
-
} | {
|
|
677
|
-
readonly path: string;
|
|
678
|
-
readonly gt: number | string;
|
|
679
|
-
} | {
|
|
680
|
-
readonly path: string;
|
|
681
|
-
readonly gte: number | string;
|
|
682
|
-
} | {
|
|
683
|
-
readonly path: string;
|
|
684
|
-
readonly lt: number | string;
|
|
685
|
-
} | {
|
|
686
|
-
readonly path: string;
|
|
687
|
-
readonly lte: number | string;
|
|
688
|
-
} | {
|
|
689
|
-
readonly path: string;
|
|
690
|
-
readonly prefix: string;
|
|
691
|
-
};
|
|
692
|
-
readonly by?: {
|
|
693
|
-
readonly all: readonly unknown[];
|
|
694
|
-
} | {
|
|
695
|
-
readonly any: readonly unknown[];
|
|
696
|
-
} | {
|
|
697
|
-
readonly not: unknown;
|
|
698
|
-
} | {
|
|
699
|
-
readonly path: string;
|
|
700
|
-
readonly eq: string | number | boolean;
|
|
701
|
-
} | {
|
|
702
|
-
readonly path: string;
|
|
703
|
-
readonly in: readonly (string | number | boolean)[];
|
|
704
|
-
} | {
|
|
705
|
-
readonly path: string;
|
|
706
|
-
readonly exists: boolean;
|
|
707
|
-
} | {
|
|
708
|
-
readonly path: string;
|
|
709
|
-
readonly contains: string | number | boolean;
|
|
710
|
-
} | {
|
|
711
|
-
readonly path: string;
|
|
712
|
-
readonly gt: number | string;
|
|
713
|
-
} | {
|
|
714
|
-
readonly path: string;
|
|
715
|
-
readonly gte: number | string;
|
|
716
|
-
} | {
|
|
717
|
-
readonly path: string;
|
|
718
|
-
readonly lt: number | string;
|
|
719
|
-
} | {
|
|
720
|
-
readonly path: string;
|
|
721
|
-
readonly lte: number | string;
|
|
722
|
-
} | {
|
|
723
|
-
readonly path: string;
|
|
724
|
-
readonly prefix: string;
|
|
725
|
-
};
|
|
726
|
-
readonly moved_between_rooms?: boolean;
|
|
727
|
-
} | {
|
|
728
|
-
readonly on: 'documents';
|
|
729
|
-
readonly scope: {
|
|
730
|
-
readonly type: string;
|
|
731
|
-
} | {
|
|
732
|
-
readonly folder: string;
|
|
733
|
-
} | {
|
|
734
|
-
readonly document: string;
|
|
735
|
-
};
|
|
736
|
-
readonly mode: 'field_changes';
|
|
737
|
-
readonly field: string;
|
|
738
|
-
readonly from?: readonly (string | number | boolean)[] | 'new';
|
|
739
|
-
readonly to?: readonly (string | number | boolean)[] | 'deleted';
|
|
740
|
-
readonly match?: {
|
|
741
|
-
readonly all: readonly unknown[];
|
|
742
|
-
} | {
|
|
743
|
-
readonly any: readonly unknown[];
|
|
744
|
-
} | {
|
|
745
|
-
readonly not: unknown;
|
|
746
|
-
} | {
|
|
747
|
-
readonly path: string;
|
|
748
|
-
readonly eq: string | number | boolean;
|
|
749
|
-
} | {
|
|
750
|
-
readonly path: string;
|
|
751
|
-
readonly in: readonly (string | number | boolean)[];
|
|
752
|
-
} | {
|
|
753
|
-
readonly path: string;
|
|
754
|
-
readonly exists: boolean;
|
|
755
|
-
} | {
|
|
756
|
-
readonly path: string;
|
|
757
|
-
readonly contains: string | number | boolean;
|
|
758
|
-
} | {
|
|
759
|
-
readonly path: string;
|
|
760
|
-
readonly gt: number | string;
|
|
761
|
-
} | {
|
|
762
|
-
readonly path: string;
|
|
763
|
-
readonly gte: number | string;
|
|
764
|
-
} | {
|
|
765
|
-
readonly path: string;
|
|
766
|
-
readonly lt: number | string;
|
|
767
|
-
} | {
|
|
768
|
-
readonly path: string;
|
|
769
|
-
readonly lte: number | string;
|
|
770
|
-
} | {
|
|
771
|
-
readonly path: string;
|
|
772
|
-
readonly prefix: string;
|
|
773
|
-
};
|
|
774
|
-
readonly by?: {
|
|
775
|
-
readonly all: readonly unknown[];
|
|
776
|
-
} | {
|
|
777
|
-
readonly any: readonly unknown[];
|
|
778
|
-
} | {
|
|
779
|
-
readonly not: unknown;
|
|
780
|
-
} | {
|
|
781
|
-
readonly path: string;
|
|
782
|
-
readonly eq: string | number | boolean;
|
|
783
|
-
} | {
|
|
784
|
-
readonly path: string;
|
|
785
|
-
readonly in: readonly (string | number | boolean)[];
|
|
786
|
-
} | {
|
|
787
|
-
readonly path: string;
|
|
788
|
-
readonly exists: boolean;
|
|
789
|
-
} | {
|
|
790
|
-
readonly path: string;
|
|
791
|
-
readonly contains: string | number | boolean;
|
|
792
|
-
} | {
|
|
793
|
-
readonly path: string;
|
|
794
|
-
readonly gt: number | string;
|
|
795
|
-
} | {
|
|
796
|
-
readonly path: string;
|
|
797
|
-
readonly gte: number | string;
|
|
798
|
-
} | {
|
|
799
|
-
readonly path: string;
|
|
800
|
-
readonly lt: number | string;
|
|
801
|
-
} | {
|
|
802
|
-
readonly path: string;
|
|
803
|
-
readonly lte: number | string;
|
|
804
|
-
} | {
|
|
805
|
-
readonly path: string;
|
|
806
|
-
readonly prefix: string;
|
|
807
|
-
};
|
|
808
|
-
readonly moved_between_rooms?: boolean;
|
|
809
|
-
} | {
|
|
810
|
-
readonly on: 'items';
|
|
811
|
-
readonly source?: string;
|
|
812
|
-
readonly address?: string;
|
|
813
|
-
readonly match?: {
|
|
814
|
-
readonly all: readonly unknown[];
|
|
815
|
-
} | {
|
|
816
|
-
readonly any: readonly unknown[];
|
|
817
|
-
} | {
|
|
818
|
-
readonly not: unknown;
|
|
819
|
-
} | {
|
|
820
|
-
readonly path: string;
|
|
821
|
-
readonly eq: string | number | boolean;
|
|
822
|
-
} | {
|
|
823
|
-
readonly path: string;
|
|
824
|
-
readonly in: readonly (string | number | boolean)[];
|
|
825
|
-
} | {
|
|
826
|
-
readonly path: string;
|
|
827
|
-
readonly exists: boolean;
|
|
828
|
-
} | {
|
|
829
|
-
readonly path: string;
|
|
830
|
-
readonly contains: string | number | boolean;
|
|
831
|
-
} | {
|
|
832
|
-
readonly path: string;
|
|
833
|
-
readonly gt: number | string;
|
|
834
|
-
} | {
|
|
835
|
-
readonly path: string;
|
|
836
|
-
readonly gte: number | string;
|
|
837
|
-
} | {
|
|
838
|
-
readonly path: string;
|
|
839
|
-
readonly lt: number | string;
|
|
840
|
-
} | {
|
|
841
|
-
readonly path: string;
|
|
842
|
-
readonly lte: number | string;
|
|
843
|
-
} | {
|
|
844
|
-
readonly path: string;
|
|
845
|
-
readonly prefix: string;
|
|
846
|
-
};
|
|
847
|
-
} | {
|
|
848
|
-
readonly on: 'clock';
|
|
849
|
-
readonly cron: string;
|
|
850
|
-
readonly time_zone: string;
|
|
851
|
-
} | {
|
|
852
|
-
readonly on: 'clock';
|
|
853
|
-
readonly scope: {
|
|
854
|
-
readonly type: string;
|
|
855
|
-
};
|
|
856
|
-
readonly date: string;
|
|
857
|
-
readonly days: number;
|
|
858
|
-
readonly at: string;
|
|
859
|
-
readonly time_zone: string;
|
|
860
|
-
readonly match?: {
|
|
861
|
-
readonly all: readonly unknown[];
|
|
862
|
-
} | {
|
|
863
|
-
readonly any: readonly unknown[];
|
|
864
|
-
} | {
|
|
865
|
-
readonly not: unknown;
|
|
866
|
-
} | {
|
|
867
|
-
readonly path: string;
|
|
868
|
-
readonly eq: string | number | boolean;
|
|
869
|
-
} | {
|
|
870
|
-
readonly path: string;
|
|
871
|
-
readonly in: readonly (string | number | boolean)[];
|
|
872
|
-
} | {
|
|
873
|
-
readonly path: string;
|
|
874
|
-
readonly exists: boolean;
|
|
875
|
-
} | {
|
|
876
|
-
readonly path: string;
|
|
877
|
-
readonly contains: string | number | boolean;
|
|
878
|
-
} | {
|
|
879
|
-
readonly path: string;
|
|
880
|
-
readonly gt: number | string;
|
|
881
|
-
} | {
|
|
882
|
-
readonly path: string;
|
|
883
|
-
readonly gte: number | string;
|
|
884
|
-
} | {
|
|
885
|
-
readonly path: string;
|
|
886
|
-
readonly lt: number | string;
|
|
887
|
-
} | {
|
|
888
|
-
readonly path: string;
|
|
889
|
-
readonly lte: number | string;
|
|
890
|
-
} | {
|
|
891
|
-
readonly path: string;
|
|
892
|
-
readonly prefix: string;
|
|
893
|
-
};
|
|
894
|
-
};
|
|
895
|
-
readonly enabled: boolean;
|
|
896
|
-
readonly paused_by?: 'types';
|
|
897
|
-
readonly actions: readonly ({
|
|
898
|
-
readonly kind: 'notify';
|
|
899
|
-
readonly enabled: boolean;
|
|
900
|
-
readonly title: string;
|
|
901
|
-
readonly text: string;
|
|
902
|
-
readonly to: {
|
|
903
|
-
readonly users: readonly string[];
|
|
904
|
-
readonly fields: readonly string[];
|
|
905
|
-
readonly roles: readonly string[];
|
|
906
|
-
};
|
|
907
|
-
readonly holds: boolean;
|
|
908
|
-
} | {
|
|
909
|
-
readonly kind: 'routine';
|
|
910
|
-
readonly enabled: boolean;
|
|
911
|
-
readonly access?: string;
|
|
912
|
-
readonly payload: string;
|
|
913
|
-
readonly holds: boolean;
|
|
914
|
-
})[];
|
|
915
|
-
}[];
|
|
916
|
-
readonly url: string;
|
|
917
|
-
}[];
|
|
918
|
-
};
|
|
919
|
-
};
|
|
920
613
|
readonly 'triggerOccurrence.list': {
|
|
921
614
|
readonly params: {
|
|
922
615
|
readonly room_ref: string;
|
|
@@ -935,6 +628,7 @@ export interface HouseMethods {
|
|
|
935
628
|
} | {
|
|
936
629
|
readonly position: number;
|
|
937
630
|
readonly outcome: 'no_target';
|
|
631
|
+
readonly code: 'no_recipient' | 'routine_access_not_found' | 'routine_retired' | 'target_agent_unavailable';
|
|
938
632
|
} | {
|
|
939
633
|
readonly position: number;
|
|
940
634
|
readonly outcome: 'requested';
|
|
@@ -994,9 +688,11 @@ export interface HouseMethods {
|
|
|
994
688
|
} | {
|
|
995
689
|
readonly position: number;
|
|
996
690
|
readonly outcome: 'withdrawn';
|
|
691
|
+
readonly code: 'agent_unavailable';
|
|
997
692
|
} | {
|
|
998
693
|
readonly position: number;
|
|
999
694
|
readonly outcome: 'failed';
|
|
695
|
+
readonly code: 'internal_error' | 'routine_request_not_started';
|
|
1000
696
|
} | {
|
|
1001
697
|
readonly position: number;
|
|
1002
698
|
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;
|
|
@@ -132,10 +132,32 @@ export interface HouseCooperation {
|
|
|
132
132
|
capture(): Promise<HouseTask> | HouseTask;
|
|
133
133
|
restore(task: HouseTask | null): Promise<void> | void;
|
|
134
134
|
ready(): Promise<boolean> | boolean;
|
|
135
|
+
placed?(): Promise<void> | void;
|
|
135
136
|
settle(activation: HouseActivation): void;
|
|
136
137
|
}
|
|
138
|
+
export type HouseChatWidth = 'full' | '3/4' | '1/2' | '1/3';
|
|
139
|
+
export interface HouseChatOpened {
|
|
140
|
+
readonly conversation: string | null;
|
|
141
|
+
readonly agent: string | null;
|
|
142
|
+
}
|
|
143
|
+
export interface HouseChatOptions {
|
|
144
|
+
readonly conversation?: string | null;
|
|
145
|
+
readonly agent?: string | null;
|
|
146
|
+
readonly showChats?: boolean;
|
|
147
|
+
readonly width?: HouseChatWidth;
|
|
148
|
+
readonly onOpen?: (opened: HouseChatOpened) => void;
|
|
149
|
+
readonly onLink?: (href: string) => void;
|
|
150
|
+
}
|
|
151
|
+
export interface HouseMountedChat {
|
|
152
|
+
update(options: HouseChatOptions): void;
|
|
153
|
+
unmount(): void;
|
|
154
|
+
}
|
|
155
|
+
export interface HouseChat {
|
|
156
|
+
mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
|
|
157
|
+
}
|
|
137
158
|
export interface HouseBridge {
|
|
138
159
|
readonly runtime: Promise<HouseRuntime>;
|
|
160
|
+
readonly chat: HouseChat;
|
|
139
161
|
address(): string | null;
|
|
140
162
|
onAddress(listener: (address: string) => void): () => void;
|
|
141
163
|
push(address: string): Promise<string>;
|
|
@@ -103,6 +103,7 @@ export type DocumentFacts = {
|
|
|
103
103
|
readonly fields: Readonly<Record<string, Fact>>;
|
|
104
104
|
readonly sections: readonly string[];
|
|
105
105
|
};
|
|
106
|
+
export declare const TEXT_FIELD = "/text";
|
|
106
107
|
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client'];
|
|
107
108
|
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
108
109
|
export type Actor = {
|
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';
|
package/dist/mdmodel/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Definition } from './definition.js';
|
|
|
2
2
|
export type Library = Readonly<Record<string, string>>;
|
|
3
3
|
export type VerifiedModel = {
|
|
4
4
|
readonly types: Readonly<Record<string, Definition>>;
|
|
5
|
+
readonly nameable?: readonly string[];
|
|
5
6
|
};
|
|
6
7
|
export type ModelVerification = {
|
|
7
8
|
readonly verdict: 'accept';
|
|
@@ -50,7 +50,7 @@ export type ListedConversation = {
|
|
|
50
50
|
outcome: string | null;
|
|
51
51
|
waiting: boolean;
|
|
52
52
|
};
|
|
53
|
-
export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.
|
|
53
|
+
export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.answer' | 'conversation.interrupt' | 'conversation.kill' | 'conversation.cancel' | 'conversation.delete' | 'conversation.history';
|
|
54
54
|
export type ConversationMessage = {
|
|
55
55
|
identity: string;
|
|
56
56
|
turn: string;
|
|
@@ -298,7 +298,6 @@ export type BootstrapInventory = {
|
|
|
298
298
|
};
|
|
299
299
|
export type RoomModels = {
|
|
300
300
|
collection?: ModelResult;
|
|
301
|
-
selection?: ModelResult;
|
|
302
301
|
};
|
|
303
302
|
export type BootstrapPage = {
|
|
304
303
|
kind: 'bootstrap';
|
|
@@ -432,6 +431,22 @@ export type BinaryLinkResult = {
|
|
|
432
431
|
kind: 'link';
|
|
433
432
|
url: string;
|
|
434
433
|
name: string;
|
|
434
|
+
mediaType?: string;
|
|
435
|
+
} | (ProviderRefusal & {
|
|
436
|
+
kind: 'rejected';
|
|
437
|
+
}) | AdapterFailure;
|
|
438
|
+
export type AttachRequest = {
|
|
439
|
+
locator: string;
|
|
440
|
+
name: string;
|
|
441
|
+
mediaType: string;
|
|
442
|
+
byteLength: number;
|
|
443
|
+
sha256: string;
|
|
444
|
+
blob: Blob;
|
|
445
|
+
};
|
|
446
|
+
export type AttachResult = {
|
|
447
|
+
kind: 'attached';
|
|
448
|
+
path: string;
|
|
449
|
+
revision: string;
|
|
435
450
|
} | (ProviderRefusal & {
|
|
436
451
|
kind: 'rejected';
|
|
437
452
|
}) | AdapterFailure;
|
|
@@ -495,6 +510,7 @@ export type Adapter = {
|
|
|
495
510
|
readonly localSaves?: true;
|
|
496
511
|
readonly exhaustiveDiscovery?: true;
|
|
497
512
|
readonly roomTypes?: string;
|
|
513
|
+
readonly nameableRoomTypes?: readonly string[];
|
|
498
514
|
authorize(): Promise<Authorization>;
|
|
499
515
|
discover(authorization: Authorization, scope?: DiscoveryScope): Promise<DiscoverResult>;
|
|
500
516
|
bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
|
|
@@ -503,6 +519,7 @@ export type Adapter = {
|
|
|
503
519
|
history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
|
|
504
520
|
binary(authorization: Authorization, request: BinaryRequest): Promise<BinaryResult>;
|
|
505
521
|
link(authorization: Authorization, request: BinaryRequest): Promise<BinaryLinkResult>;
|
|
522
|
+
attach(authorization: Authorization, request: AttachRequest): Promise<AttachResult>;
|
|
506
523
|
action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
|
|
507
524
|
reached(locator: string, roomVersion: string, target: string): boolean;
|
|
508
525
|
follows(locator: string, roomVersion: string, next: string): boolean;
|
|
@@ -2,8 +2,7 @@ import type { AppRoom, ConnectionRefusal, HistoryQuery, RoomSchemas, SavedParts,
|
|
|
2
2
|
import type { Member, ServiceMode } from './adapter.js';
|
|
3
3
|
import type { ChatDraft, ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
4
4
|
import { type Observation } from './observation.js';
|
|
5
|
-
import type {
|
|
6
|
-
import type { BinaryAnswer, BinaryLinkAnswer, CallResult, HistoryAnswer, Offline, QueueEntry, Resolution } from './outcome.js';
|
|
5
|
+
import type { AttachAnswer, BinaryAnswer, CallResult, DownloadAnswer, HistoryAnswer, Offline, QueueEntry, Resolution } from './outcome.js';
|
|
7
6
|
import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult, PendingResult } from './query.js';
|
|
8
7
|
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
9
8
|
import type { SearchRequest, SearchResult } from './search.js';
|
|
@@ -21,7 +20,7 @@ export type MdRuntimeClient = {
|
|
|
21
20
|
roomDraft: {
|
|
22
21
|
list(): Promise<readonly RoomDraft[]>;
|
|
23
22
|
read(room: string, path: string): Promise<RoomDraft | null>;
|
|
24
|
-
write(room: string, path: string, revision: string | null, parts: RoomDraftParts): Promise<RoomDraftWrite>;
|
|
23
|
+
write(room: string, path: string, revision: string | null, parts: RoomDraftParts, next?: string): Promise<RoomDraftWrite>;
|
|
25
24
|
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
26
25
|
};
|
|
27
26
|
save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;
|
|
@@ -36,7 +35,6 @@ export type MdRuntimeClient = {
|
|
|
36
35
|
read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
|
|
37
36
|
create(input: unknown): Promise<CallResult>;
|
|
38
37
|
send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
|
|
39
|
-
attach(room: string, file: ChosenFile): Promise<CallResult | Offline>;
|
|
40
38
|
answer(conversation: string, answer: unknown): Promise<CallResult>;
|
|
41
39
|
interrupt(conversation: string): Promise<CallResult>;
|
|
42
40
|
kill(conversation: string): Promise<CallResult>;
|
|
@@ -52,7 +50,8 @@ export type MdRuntimeClient = {
|
|
|
52
50
|
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
53
51
|
binaryFile: {
|
|
54
52
|
read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
|
|
55
|
-
|
|
53
|
+
attach(room: string, file: File): Promise<AttachAnswer>;
|
|
54
|
+
download(room: string, path: string, revision?: string): Promise<DownloadAnswer>;
|
|
56
55
|
};
|
|
57
56
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
58
57
|
reached(locator: string, roomVersion: string, path?: string): Promise<boolean>;
|
|
@@ -84,6 +83,8 @@ export type MdRuntimeClient = {
|
|
|
84
83
|
export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
|
|
85
84
|
export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
|
|
86
85
|
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
86
|
+
export { roomDraftRevision } from './identity.js';
|
|
87
|
+
export { defineRoomMedia, ROOM_MEDIA } from './media.js';
|
|
87
88
|
export type { Observation } from './observation.js';
|
|
88
89
|
export type { Open } from './open.js';
|
|
89
90
|
export { unanswered, type RuntimePort, type WireMember } from './wire.js';
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ import { type Adapter, type Authorization, type Member, type ProviderRefusal, ty
|
|
|
7
7
|
import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
8
8
|
import { type WrittenBy } from './change.js';
|
|
9
9
|
import type { Open } from './open.js';
|
|
10
|
-
import { type BinaryLinkAnswer, type CallResult, type HeldBinaryAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
10
|
+
import { type AttachAnswer, type BinaryLinkAnswer, type CallResult, type HeldBinaryAnswer, type HeldShownAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
11
11
|
import { type Recovery } from './recovery.js';
|
|
12
12
|
import { type SaveRefusal } from './save.js';
|
|
13
13
|
import { type RoomDraft, type RoomDraftParts, type RoomDraftWrite } from './room-draft.js';
|
|
@@ -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';
|
|
@@ -72,7 +73,7 @@ export type SavedParts = {
|
|
|
72
73
|
export type RoomDraftSurface = {
|
|
73
74
|
list(): Promise<readonly RoomDraft[]>;
|
|
74
75
|
read(room: string, path: string): Promise<RoomDraft | null>;
|
|
75
|
-
write(room: string, path: string, revision: string | null, parts: unknown): Promise<RoomDraftWrite>;
|
|
76
|
+
write(room: string, path: string, revision: string | null, parts: unknown, next?: string): Promise<RoomDraftWrite>;
|
|
76
77
|
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
77
78
|
};
|
|
78
79
|
export type PresentationSurface = {
|
|
@@ -83,6 +84,8 @@ export type PresentationSurface = {
|
|
|
83
84
|
export type BinaryFileSurface = {
|
|
84
85
|
read(room: string, path: string, revision?: string): Promise<HeldBinaryAnswer>;
|
|
85
86
|
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
87
|
+
show(room: string, path: string, revision?: string): Promise<HeldShownAnswer>;
|
|
88
|
+
attach(room: string, file: File): Promise<AttachAnswer>;
|
|
86
89
|
part(file: string, part: number): Promise<Uint8Array | null>;
|
|
87
90
|
};
|
|
88
91
|
export type HistoryQuery = {
|
|
@@ -91,7 +94,7 @@ export type HistoryQuery = {
|
|
|
91
94
|
};
|
|
92
95
|
export type MdRuntime = {
|
|
93
96
|
loaded(): Promise<void>;
|
|
94
|
-
rooms(): readonly AppRoom[]
|
|
97
|
+
rooms(): Promise<readonly AppRoom[]>;
|
|
95
98
|
query: {
|
|
96
99
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
97
100
|
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ConversationAction, ConversationAgents, ConversationEvent, ConversationMessage, ConversationStream, ProcessCommand, SessionOption, TurnContext } from './adapter.js';
|
|
2
2
|
import { type ChangeSet } from './change-set.js';
|
|
3
|
-
import { type ChosenFile } from './file.js';
|
|
4
3
|
import type { Open } from './open.js';
|
|
5
4
|
import { type CallResult, type Offline } from './outcome.js';
|
|
6
5
|
import type { DocumentResult, PendingResult } from './query.js';
|
|
@@ -65,7 +64,6 @@ export type ConversationSurface = {
|
|
|
65
64
|
read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
|
|
66
65
|
create(input: unknown): Promise<CallResult>;
|
|
67
66
|
send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
|
|
68
|
-
attach(room: string, file: ChosenFile): Promise<CallResult | Offline>;
|
|
69
67
|
answer(conversation: string, answer: unknown): Promise<CallResult>;
|
|
70
68
|
interrupt(conversation: string): Promise<CallResult>;
|
|
71
69
|
kill(conversation: string): Promise<CallResult>;
|
|
@@ -85,6 +83,7 @@ export type ConversationDependencies = {
|
|
|
85
83
|
stream(): ConversationStream | undefined;
|
|
86
84
|
publish(set: ChangeSet): void;
|
|
87
85
|
online(): boolean;
|
|
86
|
+
listed(): boolean;
|
|
88
87
|
full(): boolean;
|
|
89
88
|
closed(): boolean;
|
|
90
89
|
unanswered(): void;
|
|
@@ -99,6 +98,8 @@ export type ConversationStore = {
|
|
|
99
98
|
resend(progress: CycleProgress): Promise<void>;
|
|
100
99
|
current(): boolean;
|
|
101
100
|
known(): boolean;
|
|
101
|
+
learned(): void;
|
|
102
|
+
declared(): void;
|
|
102
103
|
reconnected(): void;
|
|
103
104
|
reopened(): void;
|
|
104
105
|
lost(): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function changeBatchIdentity(at?: number): string;
|
|
2
|
+
export declare function identityTime(identity: string): number;
|
|
3
|
+
export declare function roomDraftRevision(): string;
|
|
4
|
+
export declare function chatDraftRevision(): string;
|
|
5
|
+
export declare function transferIdentity(): string;
|
|
6
|
+
export declare function binaryLocalId(): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MdRuntimeClient } from './client.js';
|
|
2
|
+
import type { ShownAnswer } from './outcome.js';
|
|
3
|
+
export declare const ROOM_MEDIA = "room-media";
|
|
4
|
+
type Show = (room: string, path: string, revision?: string) => Promise<ShownAnswer>;
|
|
5
|
+
export declare function shownBy(show: Show, client: MdRuntimeClient): MdRuntimeClient;
|
|
6
|
+
export declare function defineRoomMedia(client: Promise<MdRuntimeClient> | MdRuntimeClient, registry?: CustomElementRegistry): void;
|
|
7
|
+
export {};
|