@agentshouse/app-bridge 0.1.0-c951f91b2c8ee → 0.1.0-c98040c2bf3b7
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 +3 -1
- package/dist/calls.d.ts +117 -0
- package/dist/calls.js +1 -0
- package/dist/index.d.ts +7 -9
- package/dist/test-host.d.ts +1 -4
- package/dist/test-host.js +0 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,7 +41,9 @@ async function manageSecurity(securityPath) {
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
`bridge.runtime` resolves to the `MdRuntimeClient` of
|
|
44
|
-
`@agentshouse/mdruntime/client`, whose README describes its members.
|
|
44
|
+
`@agentshouse/mdruntime/client`, whose README describes its members. Its
|
|
45
|
+
`call(name, input)` reaches House: `HouseCalls` names each Call an App makes
|
|
46
|
+
and the input it takes, such as `call('member.list', { room_ref })`.
|
|
45
47
|
|
|
46
48
|
## Test without a House
|
|
47
49
|
|
package/dist/calls.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export interface HouseCalls {
|
|
2
|
+
readonly 'access.read': {
|
|
3
|
+
readonly room_ref: string;
|
|
4
|
+
};
|
|
5
|
+
readonly 'conversation.answer': {
|
|
6
|
+
readonly answer: {
|
|
7
|
+
readonly interaction_id: string;
|
|
8
|
+
readonly response: unknown;
|
|
9
|
+
};
|
|
10
|
+
readonly conversation: string;
|
|
11
|
+
readonly operation_id?: string;
|
|
12
|
+
};
|
|
13
|
+
readonly 'conversation.create': {
|
|
14
|
+
readonly agent_id: string;
|
|
15
|
+
readonly operation_id?: string;
|
|
16
|
+
};
|
|
17
|
+
readonly 'conversation.delete': {
|
|
18
|
+
readonly conversation: string;
|
|
19
|
+
readonly operation_id?: string;
|
|
20
|
+
};
|
|
21
|
+
readonly 'conversation.history': {
|
|
22
|
+
readonly conversations: readonly {
|
|
23
|
+
readonly after?: string;
|
|
24
|
+
readonly conversation: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
readonly 'conversation.interrupt': {
|
|
28
|
+
readonly conversation: string;
|
|
29
|
+
readonly operation_id?: string;
|
|
30
|
+
};
|
|
31
|
+
readonly 'conversation.kill': {
|
|
32
|
+
readonly conversation: string;
|
|
33
|
+
readonly operation_id?: string;
|
|
34
|
+
};
|
|
35
|
+
readonly 'conversation.markDone': {
|
|
36
|
+
readonly conversation_id?: string;
|
|
37
|
+
readonly result?: string;
|
|
38
|
+
readonly operation_id: string;
|
|
39
|
+
};
|
|
40
|
+
readonly 'conversation.rename': {
|
|
41
|
+
readonly conversation_id: string;
|
|
42
|
+
readonly operation_id: string;
|
|
43
|
+
readonly name: string;
|
|
44
|
+
};
|
|
45
|
+
readonly 'conversation.send': {
|
|
46
|
+
readonly conversation: string;
|
|
47
|
+
readonly files?: readonly {
|
|
48
|
+
readonly blob: Blob;
|
|
49
|
+
readonly byteLength: number;
|
|
50
|
+
readonly contentHash: string;
|
|
51
|
+
readonly height?: number;
|
|
52
|
+
readonly mediaType: string;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly width?: number;
|
|
55
|
+
}[];
|
|
56
|
+
readonly operation_id?: string;
|
|
57
|
+
readonly text?: string;
|
|
58
|
+
};
|
|
59
|
+
readonly 'conversation.setOption': {
|
|
60
|
+
readonly conversation_id: string;
|
|
61
|
+
readonly operation_id: string;
|
|
62
|
+
readonly option: string;
|
|
63
|
+
readonly value: string | boolean;
|
|
64
|
+
};
|
|
65
|
+
readonly 'feature.list': Readonly<Record<string, never>>;
|
|
66
|
+
readonly 'holder.list': Readonly<Record<string, never>>;
|
|
67
|
+
readonly 'holder.ring': {
|
|
68
|
+
readonly to: string;
|
|
69
|
+
};
|
|
70
|
+
readonly 'member.list': {
|
|
71
|
+
readonly room_ref: string;
|
|
72
|
+
readonly history?: boolean;
|
|
73
|
+
readonly limit?: number;
|
|
74
|
+
readonly cursor?: string;
|
|
75
|
+
};
|
|
76
|
+
readonly 'message.send': {
|
|
77
|
+
readonly to: string;
|
|
78
|
+
readonly body: unknown;
|
|
79
|
+
};
|
|
80
|
+
readonly 'processing.read': {
|
|
81
|
+
readonly room_ref: string;
|
|
82
|
+
readonly path: string;
|
|
83
|
+
};
|
|
84
|
+
readonly 'record.list': {
|
|
85
|
+
readonly room_ref: string;
|
|
86
|
+
readonly record?: string;
|
|
87
|
+
readonly cursor?: string;
|
|
88
|
+
readonly limit?: number;
|
|
89
|
+
readonly order?: 'asc' | 'desc';
|
|
90
|
+
};
|
|
91
|
+
readonly 'relay.read': Readonly<Record<string, never>>;
|
|
92
|
+
readonly 'routine.list': {
|
|
93
|
+
readonly room_ref: string;
|
|
94
|
+
};
|
|
95
|
+
readonly 'routineAccess.list': {
|
|
96
|
+
readonly room_ref: string;
|
|
97
|
+
};
|
|
98
|
+
readonly 'routineAllowance.list': {
|
|
99
|
+
readonly room_ref: string;
|
|
100
|
+
readonly access: string;
|
|
101
|
+
};
|
|
102
|
+
readonly 'routineRequest.list': {
|
|
103
|
+
readonly room_ref: string;
|
|
104
|
+
};
|
|
105
|
+
readonly 'storage.read': {
|
|
106
|
+
readonly room_ref?: string;
|
|
107
|
+
};
|
|
108
|
+
readonly submit: {
|
|
109
|
+
readonly content: string;
|
|
110
|
+
};
|
|
111
|
+
readonly 'trigger.list': {
|
|
112
|
+
readonly room_ref: string;
|
|
113
|
+
};
|
|
114
|
+
readonly 'triggerOccurrence.list': {
|
|
115
|
+
readonly room_ref: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
package/dist/calls.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from '@agentshouse/mdruntime/client';
|
|
2
|
+
import type { HouseCalls } from './calls.js';
|
|
3
|
+
export type { HouseCalls } from './calls.js';
|
|
2
4
|
type Open<Value extends string> = Value | (string & {});
|
|
5
|
+
export type HouseCallInput<Name extends string> = Name extends keyof HouseCalls ? HouseCalls[Name] : unknown;
|
|
6
|
+
export interface HouseRuntime extends Omit<MdRuntimeClient, 'call'> {
|
|
7
|
+
call<Name extends Open<keyof HouseCalls>>(name: Name, input: HouseCallInput<Name>): ReturnType<MdRuntimeClient['call']>;
|
|
8
|
+
}
|
|
3
9
|
export interface HouseSyncState {
|
|
4
10
|
readonly state: string;
|
|
5
11
|
readonly providerUnreachable: boolean;
|
|
@@ -88,12 +94,6 @@ export interface HouseAppMessage {
|
|
|
88
94
|
}
|
|
89
95
|
export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
|
|
90
96
|
export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
|
|
91
|
-
export interface HouseImageCopy {
|
|
92
|
-
readonly attachment: string;
|
|
93
|
-
readonly copy: string;
|
|
94
|
-
readonly name: string;
|
|
95
|
-
readonly media_type: string;
|
|
96
|
-
}
|
|
97
97
|
export interface HouseCeremonyRefused extends Error {
|
|
98
98
|
readonly name: 'HouseCeremonyRefused';
|
|
99
99
|
readonly code: Open<'house_ceremony_refused'>;
|
|
@@ -111,7 +111,7 @@ export interface HouseBrowserRefused extends Error {
|
|
|
111
111
|
readonly retryable: boolean;
|
|
112
112
|
}
|
|
113
113
|
export interface HouseBridge {
|
|
114
|
-
readonly runtime: Promise<
|
|
114
|
+
readonly runtime: Promise<HouseRuntime>;
|
|
115
115
|
address(): string | null;
|
|
116
116
|
onAddress(listener: (address: string) => void): () => void;
|
|
117
117
|
push(address: string): Promise<string>;
|
|
@@ -121,7 +121,6 @@ export interface HouseBridge {
|
|
|
121
121
|
notifications(on?: boolean): Promise<HouseNotifications>;
|
|
122
122
|
setBadge(unread: readonly string[]): Promise<void>;
|
|
123
123
|
setTab(tab: HouseTab): void;
|
|
124
|
-
readAttachment(room: string, attachment: string): Promise<HouseImageCopy | null>;
|
|
125
124
|
sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
|
|
126
125
|
sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
|
|
127
126
|
callExternal(request: HouseExternalRequest): Promise<HouseExternalAnswer | HouseRefusal | null>;
|
|
@@ -136,4 +135,3 @@ export interface HouseHeld {
|
|
|
136
135
|
readonly houseBridge: HouseBridge;
|
|
137
136
|
}
|
|
138
137
|
export declare const houseBridge: () => HouseBridge;
|
|
139
|
-
export {};
|
package/dist/test-host.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MdRuntimeClient } from '@agentshouse/mdruntime/client';
|
|
2
|
-
import type { HouseAnalyticsChoice, HouseAppMessage, HouseExternalAnswer, HouseExternalRequest,
|
|
2
|
+
import type { HouseAnalyticsChoice, HouseAppMessage, 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;
|
|
@@ -19,9 +19,6 @@ export interface HouseBridgeTestHost {
|
|
|
19
19
|
export interface HouseBridgeTestHostOptions {
|
|
20
20
|
readonly address?: string;
|
|
21
21
|
readonly status?: HouseStatus;
|
|
22
|
-
readonly images?: readonly (HouseImageCopy & {
|
|
23
|
-
readonly room: string;
|
|
24
|
-
})[];
|
|
25
22
|
readonly sources?: readonly {
|
|
26
23
|
readonly top: HouseSourceTop;
|
|
27
24
|
readonly download: HouseSourceDownload;
|
package/dist/test-host.js
CHANGED
|
@@ -96,17 +96,6 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
96
96
|
setTab(tab) {
|
|
97
97
|
tabs.push(tab);
|
|
98
98
|
},
|
|
99
|
-
readAttachment(room, attachment) {
|
|
100
|
-
const image = options.images?.find((entry) => entry.room === room && entry.attachment === attachment);
|
|
101
|
-
return Promise.resolve(image === undefined
|
|
102
|
-
? null
|
|
103
|
-
: {
|
|
104
|
-
attachment: image.attachment,
|
|
105
|
-
copy: image.copy,
|
|
106
|
-
name: image.name,
|
|
107
|
-
media_type: image.media_type,
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
99
|
sourceTop: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.top ?? null),
|
|
111
100
|
sourceDownload: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.download ?? null),
|
|
112
101
|
callExternal(request) {
|
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-c98040c2bf3b7",
|
|
4
4
|
"description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications and the icon badge, status, Site image reads, App release code, App and Site screenshot reads, and App messages, with an accessor and an in-page test host.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
22
|
+
"@agentshouse/mdruntime": "0.1.0-c24bc09d750de"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|