@agentshouse/app-bridge 0.1.0-c415579fa0c3a → 0.1.0-c58a055eeaa71

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
@@ -1,22 +1,25 @@
1
1
  # @agentshouse/app-bridge
2
2
 
3
- The renderer-side client of the agents.house App bridge. An App served by House
4
- receives one message port before its own scripts run; this package is that
5
- port's one listener. It carries eleven families: navigation, ceremonies,
6
- installation, notifications, status, Site image reads, App release code,
7
- external calls, App messages and App and Site screenshot reads.
3
+ The types of the agents.house App bridge, an accessor and an in-page test host.
4
+ House builds the bridge object in every App it serves and hands it to the page
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 eleven families: navigation,
7
+ ceremonies, installation, notifications, status, Site image reads, App release
8
+ code, external calls, App messages and App and Site screenshot reads.
8
9
  [docs/families.md](docs/families.md) describes each and the test host.
9
10
 
10
- The package carries no credential handling and no Runtime family. House builds
11
+ The bridge carries no credential handling and no Runtime family. House builds
11
12
  the MD Runtime client into the page beside the bridge, and `bridge.runtime`
12
13
  resolves to that client, so the App imports and constructs none.
13
14
 
15
+ House's `find_command` "App" is the guide to building an App or a Site.
16
+
14
17
  ## Use
15
18
 
16
19
  ```js
17
- import { connectHouseBridge } from '@agentshouse/app-bridge';
20
+ import { houseBridge } from '@agentshouse/app-bridge';
18
21
 
19
- const bridge = connectHouseBridge();
22
+ const bridge = houseBridge();
20
23
  const md = await bridge.runtime;
21
24
 
22
25
  bridge.onAddress((address) => render(address));
@@ -32,7 +35,7 @@ async function manageSecurity(securityPath) {
32
35
  try {
33
36
  await bridge.ceremony(securityPath);
34
37
  } catch (refusal) {
35
- report(refusal);
38
+ if (refusal.name === 'HouseCeremonyRefused') report(refusal.path);
36
39
  }
37
40
  }
38
41
  ```
@@ -43,11 +46,11 @@ async function manageSecurity(securityPath) {
43
46
  ## Test without a House
44
47
 
45
48
  ```js
46
- import { connectHouseBridge } from '@agentshouse/app-bridge';
49
+ import { houseBridge } from '@agentshouse/app-bridge';
47
50
  import { createHouseBridgeTestHost } from '@agentshouse/app-bridge/test-host';
48
51
 
49
52
  const host = createHouseBridgeTestHost({ address: '/rooms/atlas' });
50
- const bridge = connectHouseBridge(host);
53
+ const bridge = houseBridge();
51
54
 
52
55
  bridge.push('/rooms/atlas/members');
53
56
  host.open('/rooms/atlas');
@@ -0,0 +1,139 @@
1
+ import type { MdRuntimeClient } from '@agentshouse/mdruntime/client';
2
+ type Open<Value extends string> = Value | (string & {});
3
+ export interface HouseSyncState {
4
+ readonly state: string;
5
+ readonly providerUnreachable: boolean;
6
+ }
7
+ export interface HouseCredentialState {
8
+ readonly state: Open<'none' | 'held' | 'rejected'>;
9
+ readonly expiresAt: number | null;
10
+ }
11
+ export type HouseAnalyticsChoice = 'accept' | 'decline';
12
+ export interface HouseAnalytics {
13
+ readonly measures: boolean;
14
+ readonly choice: Open<HouseAnalyticsChoice> | null;
15
+ }
16
+ export interface HouseStatus {
17
+ readonly app: string | null;
18
+ readonly preferences: {
19
+ readonly roomRef: string;
20
+ readonly path: string;
21
+ } | null;
22
+ readonly runtime: string;
23
+ readonly credential: HouseCredentialState;
24
+ readonly sync: HouseSyncState | null;
25
+ readonly refusal: {
26
+ readonly code: string;
27
+ readonly retryable: boolean;
28
+ } | null;
29
+ readonly loss: string | null;
30
+ readonly analytics: HouseAnalytics;
31
+ readonly serviceMode: Open<'open' | 'write-halted'> | null;
32
+ readonly offline: boolean;
33
+ }
34
+ export type HouseNavigationMode = 'push' | 'replace';
35
+ export interface HouseTab {
36
+ readonly title?: string;
37
+ readonly icon?: string;
38
+ }
39
+ interface HouseRelease {
40
+ readonly app_ref: string;
41
+ readonly release: string;
42
+ }
43
+ export interface HouseSourceTop extends HouseRelease {
44
+ readonly folders: readonly string[];
45
+ readonly files: readonly {
46
+ readonly name: string;
47
+ readonly size: number;
48
+ }[];
49
+ readonly readme: string | null;
50
+ }
51
+ export type HouseSourceFile = {
52
+ readonly path: string;
53
+ readonly size: number;
54
+ } & ({
55
+ readonly text: string;
56
+ } | {
57
+ readonly base64: string;
58
+ });
59
+ export interface HouseSourceDownload extends HouseRelease {
60
+ readonly files: readonly HouseSourceFile[];
61
+ }
62
+ export interface HouseExternalRequest {
63
+ readonly url: string;
64
+ readonly method?: string;
65
+ readonly headers?: Readonly<Record<string, string>>;
66
+ readonly body?: string;
67
+ readonly body_base64?: string;
68
+ readonly account?: string;
69
+ readonly slot?: string;
70
+ }
71
+ export type HouseExternalAnswer = {
72
+ readonly status: number;
73
+ readonly headers: Readonly<Record<string, string | readonly string[]>>;
74
+ } & ({
75
+ readonly body: string;
76
+ } | {
77
+ readonly body_base64: string;
78
+ });
79
+ export interface HouseRefusal {
80
+ readonly error: {
81
+ readonly code: string;
82
+ readonly retryable: boolean;
83
+ };
84
+ }
85
+ export interface HouseAppMessage {
86
+ readonly from: string;
87
+ readonly body: unknown;
88
+ }
89
+ export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
90
+ 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
+ export interface HouseCeremonyRefused extends Error {
98
+ readonly name: 'HouseCeremonyRefused';
99
+ readonly code: Open<'house_ceremony_refused'>;
100
+ readonly retryable: boolean;
101
+ readonly path: string | null;
102
+ }
103
+ export interface HouseNavigationRefused extends Error {
104
+ readonly name: 'HouseNavigationRefused';
105
+ readonly code: Open<'house_navigation_refused'>;
106
+ readonly retryable: boolean;
107
+ readonly address: string | null;
108
+ }
109
+ export interface HouseBrowserRefused extends Error {
110
+ readonly code: string;
111
+ readonly retryable: boolean;
112
+ }
113
+ export interface HouseBridge {
114
+ readonly runtime: Promise<MdRuntimeClient>;
115
+ address(): string | null;
116
+ onAddress(listener: (address: string) => void): () => void;
117
+ push(address: string): Promise<string>;
118
+ replace(address: string): Promise<string>;
119
+ ceremony(path: string): Promise<never>;
120
+ install(): Promise<HouseInstallation>;
121
+ notifications(on?: boolean): Promise<HouseNotifications>;
122
+ setBadge(unread: readonly string[]): Promise<void>;
123
+ setTab(tab: HouseTab): void;
124
+ readAttachment(room: string, attachment: string): Promise<HouseImageCopy | null>;
125
+ sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
126
+ sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
127
+ callExternal(request: HouseExternalRequest): Promise<HouseExternalAnswer | HouseRefusal | null>;
128
+ readScreenshot(app: string): Promise<Blob | null>;
129
+ readSiteScreenshot(site: string): Promise<Blob | null>;
130
+ status(): HouseStatus | null;
131
+ onStatus(listener: (status: HouseStatus) => void): () => void;
132
+ messages(listener: (message: HouseAppMessage) => void): () => void;
133
+ analyticsConsent(choice: HouseAnalyticsChoice): void;
134
+ }
135
+ export interface HouseHeld {
136
+ readonly houseBridge: HouseBridge;
137
+ }
138
+ export declare const houseBridge: () => HouseBridge;
139
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export const houseBridge = () => globalThis.houseBridge;
@@ -1,14 +1,13 @@
1
1
  import type { MdRuntimeClient } from '@agentshouse/mdruntime/client';
2
- import type { HouseBridgeSource, HouseImageCopy } from './bridge.js';
3
- import type { HouseAppMessage, HouseExternalAnswer, HouseExternalRequest, HouseGaChoice, HouseNavigationMode, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab } from './wire.js';
2
+ import type { HouseAnalyticsChoice, HouseAppMessage, HouseExternalAnswer, HouseExternalRequest, HouseImageCopy, HouseNavigationMode, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab } from './index.js';
4
3
  export interface HouseBridgeNavigation {
5
4
  readonly mode: HouseNavigationMode;
6
5
  readonly address: string;
7
6
  }
8
- export interface HouseBridgeTestHost extends HouseBridgeSource {
7
+ export interface HouseBridgeTestHost {
9
8
  readonly navigations: readonly HouseBridgeNavigation[];
10
9
  readonly ceremonies: readonly string[];
11
- readonly consents: readonly HouseGaChoice[];
10
+ readonly consents: readonly HouseAnalyticsChoice[];
12
11
  readonly tabs: readonly HouseTab[];
13
12
  readonly externalCalls: readonly HouseExternalRequest[];
14
13
  address(): string;
@@ -0,0 +1,165 @@
1
+ const HOST_ORIGIN = 'https://house.invalid';
2
+ const ADDRESS_MAX_CHARS = 1000;
3
+ function sameOriginPath(value) {
4
+ if (typeof value !== 'string')
5
+ return null;
6
+ if (value.charAt(0) !== '/' || value.slice(0, 2) === '//')
7
+ return null;
8
+ if (value.length > ADDRESS_MAX_CHARS)
9
+ return null;
10
+ const target = new URL(value, HOST_ORIGIN);
11
+ return target.origin === HOST_ORIGIN ? `${target.pathname}${target.search}${target.hash}` : null;
12
+ }
13
+ function appAddress(address) {
14
+ return address.startsWith('/') ? address : `/${address}`;
15
+ }
16
+ function ceremonyRefused(path) {
17
+ return Object.assign(new Error('house_ceremony_refused'), {
18
+ name: 'HouseCeremonyRefused',
19
+ code: 'house_ceremony_refused',
20
+ retryable: false,
21
+ path,
22
+ });
23
+ }
24
+ function navigationRefused(address) {
25
+ return Object.assign(new Error('house_navigation_refused'), {
26
+ name: 'HouseNavigationRefused',
27
+ code: 'house_navigation_refused',
28
+ retryable: false,
29
+ address,
30
+ });
31
+ }
32
+ export function createHouseBridgeTestHost(options = {}) {
33
+ const navigations = [];
34
+ const ceremonies = [];
35
+ const consents = [];
36
+ const tabs = [];
37
+ const externalCalls = [];
38
+ const addressListeners = new Set();
39
+ const statusListeners = new Set();
40
+ const messageListeners = new Set();
41
+ let current = appAddress(options.address ?? '/');
42
+ let published = options.status ?? null;
43
+ let shown = null;
44
+ let seen = null;
45
+ let attached = () => { };
46
+ const runtime = new Promise((resolve) => {
47
+ attached = resolve;
48
+ });
49
+ function arrive(target) {
50
+ current = target;
51
+ queueMicrotask(() => {
52
+ shown = target;
53
+ for (const listener of addressListeners)
54
+ listener(target);
55
+ });
56
+ }
57
+ function publish(next) {
58
+ published = next;
59
+ queueMicrotask(() => {
60
+ seen = next;
61
+ for (const listener of statusListeners)
62
+ listener(next);
63
+ });
64
+ }
65
+ function navigate(mode, asked) {
66
+ const target = sameOriginPath(asked);
67
+ if (target === null)
68
+ return Promise.reject(navigationRefused(asked));
69
+ navigations.push({ mode, address: target });
70
+ arrive(target);
71
+ return new Promise((resolve) => {
72
+ queueMicrotask(() => resolve(target));
73
+ });
74
+ }
75
+ const bridge = {
76
+ runtime,
77
+ address: () => shown,
78
+ onAddress(listener) {
79
+ addressListeners.add(listener);
80
+ return () => {
81
+ addressListeners.delete(listener);
82
+ };
83
+ },
84
+ push: (asked) => navigate('push', asked),
85
+ replace: (asked) => navigate('replace', asked),
86
+ ceremony(path) {
87
+ const target = sameOriginPath(path);
88
+ if (target === null)
89
+ return Promise.reject(ceremonyRefused(path));
90
+ ceremonies.push(target);
91
+ return new Promise(() => { });
92
+ },
93
+ install: () => Promise.resolve('manual'),
94
+ notifications: () => Promise.resolve('unavailable'),
95
+ setBadge: () => Promise.resolve(),
96
+ setTab(tab) {
97
+ tabs.push(tab);
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
+ sourceTop: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.top ?? null),
111
+ sourceDownload: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.download ?? null),
112
+ callExternal(request) {
113
+ externalCalls.push(request);
114
+ return Promise.resolve(options.external?.(request) ?? null);
115
+ },
116
+ readScreenshot: (app) => Promise.resolve(options.screenshots?.[app] ?? null),
117
+ readSiteScreenshot: (site) => Promise.resolve(options.siteScreenshots?.[site] ?? null),
118
+ status: () => seen,
119
+ onStatus(listener) {
120
+ statusListeners.add(listener);
121
+ return () => {
122
+ statusListeners.delete(listener);
123
+ };
124
+ },
125
+ messages(listener) {
126
+ messageListeners.add(listener);
127
+ return () => {
128
+ messageListeners.delete(listener);
129
+ };
130
+ },
131
+ analyticsConsent(choice) {
132
+ if (published === null || !published.analytics.measures)
133
+ return;
134
+ if (choice !== 'accept' && choice !== 'decline')
135
+ return;
136
+ consents.push(choice);
137
+ publish({ ...published, analytics: { measures: true, choice } });
138
+ },
139
+ };
140
+ Object.defineProperty(globalThis, 'houseBridge', { value: bridge, configurable: true });
141
+ if (published !== null)
142
+ publish(published);
143
+ arrive(current);
144
+ return {
145
+ navigations,
146
+ ceremonies,
147
+ consents,
148
+ tabs,
149
+ externalCalls,
150
+ address: () => current,
151
+ open(asked) {
152
+ arrive(appAddress(asked));
153
+ },
154
+ publish,
155
+ message({ from, body }) {
156
+ queueMicrotask(() => {
157
+ for (const listener of messageListeners)
158
+ listener({ from, body });
159
+ });
160
+ },
161
+ attachRuntime(client) {
162
+ attached(client);
163
+ },
164
+ };
165
+ }
package/docs/families.md CHANGED
@@ -18,30 +18,30 @@
18
18
  `'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
19
19
  otherwise, as on every iPhone and iPad, it resolves `'manual'` and the App
20
20
  shows its own instructions. A prompt the browser refuses to show, as for a
21
- call made without a click, rejects with the browser's own `DOMException`
22
- and stays ready. Call it from a click. The standard
21
+ call made without a click, rejects with an error named and coded by the
22
+ browser's own error name, with `retryable` false, and stays ready. Call it from a click. The standard
23
23
  `display-mode: standalone` media query tells the App it runs installed.
24
24
  - **Notifications** - House's own panel alone; an App's or a Site's call
25
- rejects with `HouseCeremonyRefused`. `notifications()` answers this browser
25
+ rejects with an error named `HouseCeremonyRefused`, carrying `code` and `retryable`. `notifications()` answers this browser
26
26
  storage's push state: `'on'`, `'off'`, `'blocked'` where the browser refuses
27
27
  notifications, or `'unavailable'` where it has no push, as on an iPhone or
28
28
  iPad outside a Home-screen app. `notifications(true)` asks the browser's
29
29
  permission and subscribes, `notifications(false)` unsubscribes, and each
30
- answers the state it leaves; a failure of the browser's push service rejects
31
- with the browser's own `DOMException`. Call `notifications(true)` from a
30
+ answers the state it leaves; a failure of the browser's push service, and
31
+ of `setBadge`, rejects the same way. Call `notifications(true)` from a
32
32
  click. `setBadge(unread)` takes the identifiers of the Human Notifications
33
33
  unread in this storage and sets the icon's badge to their number, or clears
34
34
  it at none, where the browser shows one.
35
35
  - **Status** - the App reference the runtime client is attached under,
36
- `preferences`: the `room_ref` and Path of the App's own preferences document,
36
+ `preferences`: the `roomRef` and Path of the App's own preferences document,
37
37
  or `null` until the runtime holds that Room, sync
38
- state, credential state and observed failure, `ga`:
38
+ state, credential state and its `expiresAt`, observed failure, `analytics`:
39
39
  whether the page measures and the visitor's stored analytics choice, and
40
- `service_mode`: `open`, `write-halted` while House refuses writes, so the
40
+ `serviceMode`: `open`, `write-halted` while House refuses writes, so the
41
41
  App can stop retrying them, or `null` while the runtime holds no House
42
- connection.
43
- The App reports the visitor's choice with `gaConsent('accept')` or
44
- `gaConsent('decline')`; the shell hands it to House's analytics loader, and
42
+ connection. Every status field is camelCase.
43
+ The App reports the visitor's choice with `analyticsConsent('accept')` or
44
+ `analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
45
45
  the choice never reaches House.
46
46
  - **Site image read** - given a Published Room and an original attachment
47
47
  reference, it answers the web copy's path and metadata, or `null` when no
@@ -53,14 +53,14 @@
53
53
  path, its size and its `text`, or its bytes as `base64`. The browser keeps
54
54
  each answer per App and release: a read naming a release it holds answers
55
55
  without asking House, and keeping a newer release drops the earlier one. A
56
- refusal is House's `{ error: { code } }`, `app_release_not_found` for an
56
+ refusal is House's `{ error: { code, retryable } }`, `app_release_not_found` for an
57
57
  App with no release; a read House does not answer, or one that outlived
58
58
  the browser's signed-in User, is `null`.
59
59
  - **External calls** - `callExternal({ url, method, headers, body, slot })`
60
60
  has House's server send an HTTPS request to one of the release's declared
61
61
  external origins and resolves with the service's `status`, `headers` and its
62
62
  body as `body` text or `body_base64`, or a refusal as House's
63
- `{ error: { code } }`, or `null` when House does not answer. House fills in the
63
+ `{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
64
64
  App and its running release; naming an account slot places the key of the
65
65
  account the User connected to it, which the App never sees, and naming none
66
66
  sends no key. A Site's call names no slot, and the House panel names an
@@ -69,7 +69,7 @@
69
69
  another holder of this App sends to this User's running copies, as `from`,
70
70
  the sender's User id, and `body`, the JSON value they sent, until the
71
71
  function it returns is called. App code sends one through the Runtime's
72
- `call('apps/messages/send', { to, body })` with the recipient's User id and
72
+ `call('message.send', { to, body })` with the recipient's User id and
73
73
  a body of at most 32 KiB of JSON; House fills in the App and relays it only
74
74
  to copies running now, storing nothing. The panel sends none.
75
75
  - **App screenshot read** - given an App reference, `readScreenshot(app)`
@@ -84,23 +84,24 @@
84
84
 
85
85
  ## The test host
86
86
 
87
- The host plays the shell and the worker: it delivers the address the App starts
88
- at and each address `open` plays as Back or Forward through the shell's own
89
- slice below the App's path, admitting nothing, so it delivers `//notes` exactly
90
- as a browser at `/apps/<app>//notes` does. It records every push and replace
91
- and answers each with the address the shell would then show, records an
92
- admitted ceremony, refuses a push, replace or ceremony that is not a
93
- same-origin absolute path, publishes a status, its `service_mode` included,
94
- records in `consents` each
95
- `gaConsent` it takes while that status measures and publishes the status the
96
- choice leaves, records in `tabs` each `setTab` the shell would take and ignores
97
- any other, answers a release code read from the `sources` it was given, or
98
- `null`, answers each `callExternal` from the `external` function it was given, or
99
- `null`, and records the request in `externalCalls`, answers `readScreenshot`
100
- from the `screenshots` it was given by App
101
- reference and `readSiteScreenshot` from the `siteScreenshots` it was given by
102
- Site identifier, answers every `install()` `'manual'`, as a browser with no install
103
- prompt does, answers every `notifications()` `'unavailable'`, as a browser
104
- without push does, settles every `setBadge`, delivers each App message
105
- `message({ from, body })` plays, and hands `bridge.runtime` the MD Runtime
106
- client `attachRuntime(client)` gives it.
87
+ `createHouseBridgeTestHost(options)` plays House in one page: it installs a
88
+ bridge object that `houseBridge()` returns, until the next host replaces it.
89
+ It delivers the address the App starts at and each address `open` plays as
90
+ Back or Forward, admitting nothing, so it delivers `//notes` exactly as a
91
+ browser at `/apps/<app>//notes` does. It records every push and replace and
92
+ answers each with the address the shell would then show, records an admitted
93
+ ceremony, and refuses a push, replace or ceremony that is not a same-origin
94
+ absolute path of at most 1,000 characters with an error named
95
+ `HouseNavigationRefused` or `HouseCeremonyRefused`. It publishes a status,
96
+ its `serviceMode` included, records in `consents` each `analyticsConsent` it
97
+ takes while that status measures and publishes the status the choice leaves,
98
+ records in `tabs` each `setTab`, answers a release code read from the
99
+ `sources` it was given, or `null`, answers each `callExternal` from the
100
+ `external` function it was given, or `null`, and records the request in
101
+ `externalCalls`, answers `readScreenshot` from the `screenshots` it was given
102
+ by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
103
+ given by Site identifier, answers every `install()` `'manual'`, as a browser
104
+ with no install prompt does, answers every `notifications()` `'unavailable'`,
105
+ as a browser without push does, settles every `setBadge`, delivers each App
106
+ message `message({ from, body })` plays, and hands `bridge.runtime` the MD
107
+ Runtime client `attachRuntime(client)` gives it.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-c415579fa0c3a",
4
- "description": "Renderer-side client of the agents.house App bridge: 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 in-page test host.",
3
+ "version": "0.1.0-c58a055eeaa71",
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",
7
7
  "sideEffects": false,
@@ -10,16 +10,16 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./dist/client/src/index.d.ts",
14
- "default": "./dist/client/src/index.js"
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
15
  },
16
16
  "./test-host": {
17
- "types": "./dist/client/src/test-host.d.ts",
18
- "default": "./dist/client/src/test-host.js"
17
+ "types": "./dist/test-host.d.ts",
18
+ "default": "./dist/test-host.js"
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@agentshouse/mdruntime": "0.1.0-c6e4c19c13638"
22
+ "@agentshouse/mdruntime": "0.1.0-c967d1ca66fee"
23
23
  },
24
24
  "files": [
25
25
  "dist",
@@ -1,38 +0,0 @@
1
- import type { MdRuntimeClient } from '@agentshouse/mdruntime/client';
2
- import type { HouseAppMessage, HouseExternalAnswer, HouseExternalRequest, HouseBridgePort, HouseGaChoice, HouseImageCopy, HouseInstallation, HouseNotifications, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab } from './wire.js';
3
- export type { HouseImageCopy } from './wire.js';
4
- export declare class HouseCeremonyRefused extends Error {
5
- readonly path: string | null;
6
- constructor(path: string | null);
7
- }
8
- export declare class HouseNavigationRefused extends Error {
9
- readonly address: string | null;
10
- constructor(address: string | null);
11
- }
12
- export interface HouseBridgeSource {
13
- readonly port: Promise<HouseBridgePort>;
14
- readonly runtime: Promise<MdRuntimeClient>;
15
- }
16
- export interface HouseBridge {
17
- readonly runtime: Promise<MdRuntimeClient>;
18
- address(): string | null;
19
- onAddress(listener: (address: string) => void): () => void;
20
- push(address: string): Promise<string>;
21
- replace(address: string): Promise<string>;
22
- ceremony(path: string): Promise<never>;
23
- install(): Promise<HouseInstallation>;
24
- notifications(on?: boolean): Promise<HouseNotifications>;
25
- setBadge(unread: readonly string[]): Promise<void>;
26
- setTab(tab: HouseTab): void;
27
- readAttachment(room: string, attachment: string): Promise<HouseImageCopy | null>;
28
- sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
29
- sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
30
- callExternal(request: HouseExternalRequest): Promise<HouseExternalAnswer | HouseRefusal | null>;
31
- readScreenshot(app: string): Promise<Blob | null>;
32
- readSiteScreenshot(site: string): Promise<Blob | null>;
33
- status(): HouseStatus | null;
34
- onStatus(listener: (status: HouseStatus) => void): () => void;
35
- messages(listener: (message: HouseAppMessage) => void): () => void;
36
- gaConsent(choice: HouseGaChoice): void;
37
- }
38
- export declare function connectHouseBridge(source?: HouseBridgeSource): HouseBridge;