@agentshouse/app-bridge 0.1.0-ccef427e0f56d → 0.1.0-cd2d3edbf9805

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 CHANGED
@@ -12,7 +12,7 @@ The bridge carries no credential handling and no Runtime family. House builds
12
12
  the MD Runtime client into the page beside the bridge and serves it the Chat, so
13
13
  the App imports, constructs and bundles neither: `bridge.runtime` resolves to the client.
14
14
 
15
- House's `find_command` "App" is the guide to building an App or a Site.
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
@@ -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 read: 'mcp' | 'online' | 'local' | null;
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 read: 'mcp' | 'online' | 'local' | null;
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 read: 'mcp' | 'online' | 'local' | null;
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;
@@ -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: 'microphone' | 'camera' | 'geolocation' | 'clipboard-read' | 'notifications';
230
+ readonly feature: string;
244
231
  readonly allowed: boolean;
245
232
  }[];
246
233
  };
@@ -359,7 +346,8 @@ export interface HouseMethods {
359
346
  readonly owner: boolean;
360
347
  readonly email?: string;
361
348
  readonly since: string | null;
362
- readonly access?: 'owner' | 'manage' | 'edit' | 'read';
349
+ readonly access?: 'owner' | 'manage' | 'edit' | 'keep' | 'open' | 'search';
350
+ readonly only_while_online?: true;
363
351
  readonly member_document: string | null;
364
352
  readonly schema_roles?: readonly string[];
365
353
  }[];
@@ -506,11 +494,7 @@ export interface HouseMethods {
506
494
  readonly reach: 'selected';
507
495
  readonly refs: readonly string[];
508
496
  };
509
- readonly accounts?: readonly {
510
- readonly id: string;
511
- readonly name: string;
512
- readonly origin: string;
513
- }[];
497
+ readonly key_origins?: readonly string[];
514
498
  readonly url: string;
515
499
  }[];
516
500
  };
@@ -623,303 +607,17 @@ export interface HouseMethods {
623
607
  readonly submitted: true;
624
608
  };
625
609
  };
626
- readonly 'trigger.list': {
627
- readonly params: {
628
- readonly room_refs: readonly string[];
629
- };
630
- readonly result: {
631
- readonly rooms: readonly {
632
- readonly room_ref: string;
633
- readonly triggers: readonly {
634
- readonly trigger: string;
635
- readonly creator: {
636
- readonly user: string;
637
- readonly name: string;
638
- };
639
- readonly description: string;
640
- readonly condition: {
641
- readonly on: 'documents';
642
- readonly scope: {
643
- readonly type: string;
644
- } | {
645
- readonly folder: string;
646
- } | {
647
- readonly document: string;
648
- };
649
- readonly mode: 'starts_matching';
650
- readonly new_documents: boolean;
651
- readonly match: {
652
- readonly all: readonly unknown[];
653
- } | {
654
- readonly any: readonly unknown[];
655
- } | {
656
- readonly not: unknown;
657
- } | {
658
- readonly path: string;
659
- readonly eq: string | number | boolean;
660
- } | {
661
- readonly path: string;
662
- readonly in: readonly (string | number | boolean)[];
663
- } | {
664
- readonly path: string;
665
- readonly exists: boolean;
666
- } | {
667
- readonly path: string;
668
- readonly contains: string | number | boolean;
669
- } | {
670
- readonly path: string;
671
- readonly gt: number | string;
672
- } | {
673
- readonly path: string;
674
- readonly gte: number | string;
675
- } | {
676
- readonly path: string;
677
- readonly lt: number | string;
678
- } | {
679
- readonly path: string;
680
- readonly lte: number | string;
681
- } | {
682
- readonly path: string;
683
- readonly prefix: string;
684
- };
685
- readonly by?: {
686
- readonly all: readonly unknown[];
687
- } | {
688
- readonly any: readonly unknown[];
689
- } | {
690
- readonly not: unknown;
691
- } | {
692
- readonly path: string;
693
- readonly eq: string | number | boolean;
694
- } | {
695
- readonly path: string;
696
- readonly in: readonly (string | number | boolean)[];
697
- } | {
698
- readonly path: string;
699
- readonly exists: boolean;
700
- } | {
701
- readonly path: string;
702
- readonly contains: string | number | boolean;
703
- } | {
704
- readonly path: string;
705
- readonly gt: number | string;
706
- } | {
707
- readonly path: string;
708
- readonly gte: number | string;
709
- } | {
710
- readonly path: string;
711
- readonly lt: number | string;
712
- } | {
713
- readonly path: string;
714
- readonly lte: number | string;
715
- } | {
716
- readonly path: string;
717
- readonly prefix: string;
718
- };
719
- readonly moved_between_rooms?: boolean;
720
- } | {
721
- readonly on: 'documents';
722
- readonly scope: {
723
- readonly type: string;
724
- } | {
725
- readonly folder: string;
726
- } | {
727
- readonly document: string;
728
- };
729
- readonly mode: 'field_changes';
730
- readonly field: string;
731
- readonly from?: readonly (string | number | boolean)[] | 'new';
732
- readonly to?: readonly (string | number | boolean)[] | 'deleted';
733
- readonly match?: {
734
- readonly all: readonly unknown[];
735
- } | {
736
- readonly any: readonly unknown[];
737
- } | {
738
- readonly not: unknown;
739
- } | {
740
- readonly path: string;
741
- readonly eq: string | number | boolean;
742
- } | {
743
- readonly path: string;
744
- readonly in: readonly (string | number | boolean)[];
745
- } | {
746
- readonly path: string;
747
- readonly exists: boolean;
748
- } | {
749
- readonly path: string;
750
- readonly contains: string | number | boolean;
751
- } | {
752
- readonly path: string;
753
- readonly gt: number | string;
754
- } | {
755
- readonly path: string;
756
- readonly gte: number | string;
757
- } | {
758
- readonly path: string;
759
- readonly lt: number | string;
760
- } | {
761
- readonly path: string;
762
- readonly lte: number | string;
763
- } | {
764
- readonly path: string;
765
- readonly prefix: string;
766
- };
767
- readonly by?: {
768
- readonly all: readonly unknown[];
769
- } | {
770
- readonly any: readonly unknown[];
771
- } | {
772
- readonly not: unknown;
773
- } | {
774
- readonly path: string;
775
- readonly eq: string | number | boolean;
776
- } | {
777
- readonly path: string;
778
- readonly in: readonly (string | number | boolean)[];
779
- } | {
780
- readonly path: string;
781
- readonly exists: boolean;
782
- } | {
783
- readonly path: string;
784
- readonly contains: string | number | boolean;
785
- } | {
786
- readonly path: string;
787
- readonly gt: number | string;
788
- } | {
789
- readonly path: string;
790
- readonly gte: number | string;
791
- } | {
792
- readonly path: string;
793
- readonly lt: number | string;
794
- } | {
795
- readonly path: string;
796
- readonly lte: number | string;
797
- } | {
798
- readonly path: string;
799
- readonly prefix: string;
800
- };
801
- readonly moved_between_rooms?: boolean;
802
- } | {
803
- readonly on: 'items';
804
- readonly source?: string;
805
- readonly address?: string;
806
- readonly match?: {
807
- readonly all: readonly unknown[];
808
- } | {
809
- readonly any: readonly unknown[];
810
- } | {
811
- readonly not: unknown;
812
- } | {
813
- readonly path: string;
814
- readonly eq: string | number | boolean;
815
- } | {
816
- readonly path: string;
817
- readonly in: readonly (string | number | boolean)[];
818
- } | {
819
- readonly path: string;
820
- readonly exists: boolean;
821
- } | {
822
- readonly path: string;
823
- readonly contains: string | number | boolean;
824
- } | {
825
- readonly path: string;
826
- readonly gt: number | string;
827
- } | {
828
- readonly path: string;
829
- readonly gte: number | string;
830
- } | {
831
- readonly path: string;
832
- readonly lt: number | string;
833
- } | {
834
- readonly path: string;
835
- readonly lte: number | string;
836
- } | {
837
- readonly path: string;
838
- readonly prefix: string;
839
- };
840
- } | {
841
- readonly on: 'clock';
842
- readonly cron: string;
843
- readonly time_zone: string;
844
- } | {
845
- readonly on: 'clock';
846
- readonly scope: {
847
- readonly type: string;
848
- };
849
- readonly date: string;
850
- readonly days: number;
851
- readonly at: string;
852
- readonly time_zone: string;
853
- readonly match?: {
854
- readonly all: readonly unknown[];
855
- } | {
856
- readonly any: readonly unknown[];
857
- } | {
858
- readonly not: unknown;
859
- } | {
860
- readonly path: string;
861
- readonly eq: string | number | boolean;
862
- } | {
863
- readonly path: string;
864
- readonly in: readonly (string | number | boolean)[];
865
- } | {
866
- readonly path: string;
867
- readonly exists: boolean;
868
- } | {
869
- readonly path: string;
870
- readonly contains: string | number | boolean;
871
- } | {
872
- readonly path: string;
873
- readonly gt: number | string;
874
- } | {
875
- readonly path: string;
876
- readonly gte: number | string;
877
- } | {
878
- readonly path: string;
879
- readonly lt: number | string;
880
- } | {
881
- readonly path: string;
882
- readonly lte: number | string;
883
- } | {
884
- readonly path: string;
885
- readonly prefix: string;
886
- };
887
- };
888
- readonly enabled: boolean;
889
- readonly paused_by?: 'types';
890
- readonly actions: readonly ({
891
- readonly kind: 'notify';
892
- readonly enabled: boolean;
893
- readonly title: string;
894
- readonly text: string;
895
- readonly to: {
896
- readonly users: readonly string[];
897
- readonly fields: readonly string[];
898
- readonly roles: readonly string[];
899
- };
900
- readonly holds: boolean;
901
- } | {
902
- readonly kind: 'routine';
903
- readonly enabled: boolean;
904
- readonly access?: string;
905
- readonly payload: string;
906
- readonly holds: boolean;
907
- })[];
908
- }[];
909
- readonly url: string;
910
- }[];
911
- };
912
- };
913
- readonly 'triggerOccurrence.list': {
610
+ readonly 'triggerEvent.list': {
914
611
  readonly params: {
915
612
  readonly room_ref: string;
916
613
  };
917
614
  readonly result: {
918
- readonly occurrences: readonly {
615
+ readonly events: readonly {
919
616
  readonly trigger: string;
920
617
  readonly path?: string;
921
618
  readonly moment?: string;
922
619
  readonly missed?: 'skipped' | 'failed';
620
+ readonly code?: 'cap_reached';
923
621
  readonly created_at: string;
924
622
  readonly actions: readonly ({
925
623
  readonly position: number;
@@ -928,7 +626,7 @@ export interface HouseMethods {
928
626
  } | {
929
627
  readonly position: number;
930
628
  readonly outcome: 'no_target';
931
- readonly code: 'no_recipient' | 'routine_access_not_found' | 'routine_retired' | 'target_agent_unavailable';
629
+ readonly code: 'no_recipient' | 'routine_access_not_found' | 'routine_retired' | 'target_agent_unavailable' | 'app_not_found' | 'app_function_not_found' | 'environment_function_not_found' | 'environment_offline';
932
630
  } | {
933
631
  readonly position: number;
934
632
  readonly outcome: 'requested';
@@ -978,12 +676,12 @@ export interface HouseMethods {
978
676
  readonly position: number;
979
677
  readonly outcome: 'refused';
980
678
  readonly code: 'cap_reached';
981
- readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | 'external_accounts' | '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';
679
+ 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' | 'environment_functions' | 'folder_subscriptions';
982
680
  } | {
983
681
  readonly position: number;
984
682
  readonly outcome: 'refused';
985
683
  readonly code: 'cap_reached';
986
- readonly cap: 'address_submissions' | 'writes' | 'push_addresses' | 'push_deliveries' | 'external_accounts' | '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';
684
+ 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' | 'environment_functions' | 'folder_subscriptions';
987
685
  readonly retry_at: string;
988
686
  } | {
989
687
  readonly position: number;
@@ -993,6 +691,48 @@ export interface HouseMethods {
993
691
  readonly position: number;
994
692
  readonly outcome: 'failed';
995
693
  readonly code: 'internal_error' | 'routine_request_not_started';
694
+ } | {
695
+ readonly position: number;
696
+ readonly outcome: 'failed';
697
+ readonly code: 'function_failed';
698
+ readonly error: string;
699
+ readonly release: string;
700
+ readonly final: true;
701
+ } | {
702
+ readonly position: number;
703
+ readonly outcome: 'failed';
704
+ readonly code: 'function_failed';
705
+ readonly error: string;
706
+ readonly run: string;
707
+ readonly final: true;
708
+ readonly exit_code?: number;
709
+ readonly output?: string;
710
+ readonly cut?: boolean;
711
+ } | {
712
+ readonly position: number;
713
+ readonly outcome: 'failed';
714
+ readonly code: 'function_not_started';
715
+ readonly tries: number;
716
+ readonly final?: true;
717
+ } | {
718
+ readonly position: number;
719
+ readonly outcome: 'running';
720
+ readonly release: string;
721
+ } | {
722
+ readonly position: number;
723
+ readonly outcome: 'running';
724
+ readonly run: string;
725
+ } | {
726
+ readonly position: number;
727
+ readonly outcome: 'ran';
728
+ readonly release: string;
729
+ } | {
730
+ readonly position: number;
731
+ readonly outcome: 'ran';
732
+ readonly run: string;
733
+ readonly exit_code?: number;
734
+ readonly output?: string;
735
+ readonly cut?: boolean;
996
736
  } | {
997
737
  readonly position: number;
998
738
  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' | 'update-required';
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 = {
@@ -120,19 +118,8 @@ export interface HouseBrowserRefused extends Error {
120
118
  readonly code: string;
121
119
  readonly retryable: boolean;
122
120
  }
123
- export interface HouseTrialWithheld {
124
- readonly code: Open<'house_trial_withheld'>;
125
- readonly retryable: true;
126
- }
127
- export type HouseTask = unknown;
128
- export type HouseActivation = Open<'committed' | 'abandoned'>;
129
121
  export interface HouseCooperation {
130
- checkpoint(): Promise<void> | void;
131
- persist(): Promise<void> | void;
132
- capture(): Promise<HouseTask> | HouseTask;
133
- restore(task: HouseTask | null): Promise<void> | void;
134
- ready(): Promise<boolean> | boolean;
135
- settle(activation: HouseActivation): void;
122
+ placed(): Promise<void> | void;
136
123
  }
137
124
  export type HouseChatWidth = 'full' | '3/4' | '1/2' | '1/3';
138
125
  export interface HouseChatOpened {
@@ -76,7 +76,11 @@ export type DateCondition = {
76
76
  readonly time_zone: string;
77
77
  readonly match?: ConditionTest;
78
78
  };
79
- export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition;
79
+ export type NotificationCondition = {
80
+ readonly on: 'notifications';
81
+ readonly match?: ConditionTest;
82
+ };
83
+ export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition | NotificationCondition;
80
84
  export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
81
85
  type Scalar = string | number | boolean;
82
86
  export type Fact = {
@@ -103,11 +107,13 @@ export type DocumentFacts = {
103
107
  readonly fields: Readonly<Record<string, Fact>>;
104
108
  readonly sections: readonly string[];
105
109
  };
106
- export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client'];
110
+ export declare const TEXT_FIELD = "/text";
111
+ export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client', 'function'];
107
112
  export type WriteDoor = (typeof WRITE_DOORS)[number];
108
113
  export type Actor = {
109
114
  readonly user?: string;
110
115
  readonly site?: string;
116
+ readonly app?: string;
111
117
  readonly door?: WriteDoor;
112
118
  };
113
119
  export type DocumentEvent = {
@@ -157,4 +163,5 @@ export declare function members(document: DocumentFacts, path: string): readonly
157
163
  export declare function holds(test: ConditionTest, document: DocumentFacts): Truth;
158
164
  export declare function fires(condition: DocumentCondition, event: DocumentEvent): boolean;
159
165
  export declare function itemFires(condition: ItemCondition, item: ItemFacts): boolean;
166
+ export declare function notificationFires(condition: NotificationCondition, notification: DocumentFacts): boolean;
160
167
  export {};
@@ -1,5 +1,5 @@
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';
2
- export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, Resolved, WriteDoor, } 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, notificationFires, pointed, prosePaths, testOperators, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './condition.js';
2
+ export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, NotificationCondition, Resolved, WriteDoor, } from './condition.js';
3
3
  export { headingLines } from './blocks.js';
4
4
  export type { HeadingLine } from './blocks.js';
5
5
  export { divide } from './divide.js';