@agentshouse/app-bridge 0.1.0-c58a055eeaa71 → 0.1.0-c59dd0a694516
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 +11 -9
- package/dist/index.d.ts +620 -14
- package/dist/mdmodel/body.d.ts +84 -0
- package/dist/mdmodel/built-in.d.ts +3 -0
- package/dist/mdmodel/definition.d.ts +90 -0
- package/dist/mdmodel/divide.d.ts +2 -0
- package/dist/mdmodel/document.d.ts +21 -0
- package/dist/mdmodel/event.d.ts +76 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/fields.d.ts +5 -0
- package/dist/mdmodel/house-model.d.ts +865 -0
- package/dist/mdmodel/house-references/crockford.d.ts +3 -0
- package/dist/mdmodel/house-references/patterns.d.ts +8 -0
- package/dist/mdmodel/index.d.ts +43 -0
- package/dist/mdmodel/kinds.d.ts +17 -0
- package/dist/mdmodel/markdown.d.ts +74 -0
- package/dist/mdmodel/media-type.d.ts +71 -0
- package/dist/mdmodel/not-ready.d.ts +1 -0
- package/dist/mdmodel/paths.d.ts +39 -0
- package/dist/mdmodel/pattern.d.ts +9 -0
- package/dist/mdmodel/project.d.ts +21 -0
- package/dist/mdmodel/query/language.d.ts +253 -0
- package/dist/mdmodel/query/match.d.ts +13 -0
- package/dist/mdmodel/query/rows.d.ts +31 -0
- package/dist/mdmodel/query/sql.d.ts +38 -0
- package/dist/mdmodel/references.d.ts +3 -0
- package/dist/mdmodel/reserved.d.ts +5 -0
- package/dist/mdmodel/room-types.d.ts +6 -0
- package/dist/mdmodel/types.d.ts +172 -0
- package/dist/mdmodel/validate.d.ts +37 -0
- package/dist/mdmodel/version.d.ts +1 -0
- package/dist/mdmodel/yaml.d.ts +55 -0
- package/dist/mdruntime/actions.d.ts +25 -0
- package/dist/mdruntime/adapter.d.ts +575 -0
- package/dist/mdruntime/attached-model.d.ts +6 -0
- package/dist/mdruntime/authored.d.ts +87 -0
- package/dist/mdruntime/binary.d.ts +17 -0
- package/dist/mdruntime/bootstrap.d.ts +43 -0
- package/dist/mdruntime/cell.d.ts +5 -0
- package/dist/mdruntime/chain.d.ts +11 -0
- package/dist/mdruntime/change-set.d.ts +31 -0
- package/dist/mdruntime/change.d.ts +123 -0
- package/dist/mdruntime/client.d.ts +98 -0
- package/dist/mdruntime/collection.d.ts +49 -0
- package/dist/mdruntime/compile.d.ts +17 -0
- package/dist/mdruntime/conversation-live.d.ts +149 -0
- package/dist/mdruntime/conversation-row.d.ts +39 -0
- package/dist/mdruntime/conversation.d.ts +136 -0
- package/dist/mdruntime/declaration.d.ts +9 -0
- package/dist/mdruntime/durability.d.ts +30 -0
- package/dist/mdruntime/failure.d.ts +15 -0
- package/dist/mdruntime/figures.d.ts +48 -0
- package/dist/mdruntime/holdings.d.ts +28 -0
- package/dist/mdruntime/identity.d.ts +5 -0
- package/dist/mdruntime/install.d.ts +59 -0
- package/dist/mdruntime/listing.d.ts +51 -0
- package/dist/mdruntime/live.d.ts +24 -0
- package/dist/mdruntime/media.d.ts +12 -0
- package/dist/mdruntime/messages.d.ts +57 -0
- package/dist/mdruntime/model.d.ts +54 -0
- package/dist/mdruntime/observation.d.ts +59 -0
- package/dist/mdruntime/open.d.ts +1 -0
- package/dist/mdruntime/opened.d.ts +21 -0
- package/dist/mdruntime/outcome.d.ts +94 -0
- package/dist/mdruntime/overlay.d.ts +29 -0
- package/dist/mdruntime/preparation.d.ts +40 -0
- package/dist/mdruntime/presence.d.ts +57 -0
- package/dist/mdruntime/query.d.ts +87 -0
- package/dist/mdruntime/reach.d.ts +54 -0
- package/dist/mdruntime/readiness.d.ts +54 -0
- package/dist/mdruntime/reads.d.ts +38 -0
- package/dist/mdruntime/recovery.d.ts +27 -0
- package/dist/mdruntime/refresh.d.ts +26 -0
- package/dist/mdruntime/replica.d.ts +62 -0
- package/dist/mdruntime/retried.d.ts +29 -0
- package/dist/mdruntime/room-draft.d.ts +197 -0
- package/dist/mdruntime/room-drafts.d.ts +23 -0
- package/dist/mdruntime/runtime.d.ts +33 -0
- package/dist/mdruntime/save.d.ts +58 -0
- package/dist/mdruntime/saves.d.ts +31 -0
- package/dist/mdruntime/search.d.ts +21 -0
- package/dist/mdruntime/seed.d.ts +24 -0
- package/dist/mdruntime/socket/admission.d.ts +6 -0
- package/dist/mdruntime/socket/answers.d.ts +5 -0
- package/dist/mdruntime/socket/lanes.d.ts +27 -0
- package/dist/mdruntime/socket/session.d.ts +37 -0
- package/dist/mdruntime/socket.d.ts +66 -0
- package/dist/mdruntime/source.d.ts +58 -0
- package/dist/mdruntime/status.d.ts +25 -0
- package/dist/mdruntime/store/installs.d.ts +29 -0
- package/dist/mdruntime/store/readiness.d.ts +10 -0
- package/dist/mdruntime/store/records.d.ts +222 -0
- package/dist/mdruntime/store/room-held.d.ts +7 -0
- package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
- package/dist/mdruntime/store/space.d.ts +10 -0
- package/dist/mdruntime/store/watchers.d.ts +16 -0
- package/dist/mdruntime/store/writes.d.ts +23 -0
- package/dist/mdruntime/store.d.ts +125 -0
- package/dist/mdruntime/stored.d.ts +166 -0
- package/dist/mdruntime/surface.d.ts +89 -0
- package/dist/mdruntime/tables.d.ts +375 -0
- package/dist/mdruntime/tallies.d.ts +17 -0
- package/dist/mdruntime/transfer.d.ts +4 -0
- package/dist/mdruntime/wire.d.ts +288 -0
- package/dist/session-content/bounds.d.ts +7 -0
- package/dist/session-content/check.d.ts +18 -0
- package/dist/session-content/index.d.ts +7 -0
- package/dist/session-content/parts.d.ts +103 -0
- package/dist/session-content/state.d.ts +61 -0
- package/dist/session-content/turn.d.ts +328 -0
- package/dist/test-host.d.ts +15 -5
- package/dist/test-host.js +74 -23
- package/docs/families.md +93 -22
- package/package.json +8 -6
package/dist/test-host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const HOST_ORIGIN = 'https://house.invalid';
|
|
2
|
-
const ADDRESS_MAX_CHARS =
|
|
2
|
+
const ADDRESS_MAX_CHARS = 64 * 1024;
|
|
3
3
|
function sameOriginPath(value) {
|
|
4
4
|
if (typeof value !== 'string')
|
|
5
5
|
return null;
|
|
@@ -29,12 +29,29 @@ function navigationRefused(address) {
|
|
|
29
29
|
address,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
function followHeld(listeners, listener, held) {
|
|
33
|
+
let following = true;
|
|
34
|
+
queueMicrotask(() => {
|
|
35
|
+
if (!following)
|
|
36
|
+
return;
|
|
37
|
+
listeners.add(listener);
|
|
38
|
+
const value = held();
|
|
39
|
+
if (value !== null)
|
|
40
|
+
listener(value);
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
following = false;
|
|
44
|
+
listeners.delete(listener);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
32
47
|
export function createHouseBridgeTestHost(options = {}) {
|
|
33
48
|
const navigations = [];
|
|
34
49
|
const ceremonies = [];
|
|
35
50
|
const consents = [];
|
|
36
51
|
const tabs = [];
|
|
37
52
|
const externalCalls = [];
|
|
53
|
+
const chats = [];
|
|
54
|
+
const chatButtons = [];
|
|
38
55
|
const addressListeners = new Set();
|
|
39
56
|
const statusListeners = new Set();
|
|
40
57
|
const messageListeners = new Set();
|
|
@@ -63,7 +80,17 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
63
80
|
});
|
|
64
81
|
}
|
|
65
82
|
function navigate(mode, asked) {
|
|
66
|
-
|
|
83
|
+
let path = asked;
|
|
84
|
+
if (/^https?:\/\//i.test(asked)) {
|
|
85
|
+
try {
|
|
86
|
+
const target = new URL(asked);
|
|
87
|
+
path = target.origin === HOST_ORIGIN ? target.pathname + target.search + target.hash : '';
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
path = '';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const target = sameOriginPath(path);
|
|
67
94
|
if (target === null)
|
|
68
95
|
return Promise.reject(navigationRefused(asked));
|
|
69
96
|
navigations.push({ mode, address: target });
|
|
@@ -73,13 +100,48 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
73
100
|
});
|
|
74
101
|
}
|
|
75
102
|
const bridge = {
|
|
76
|
-
runtime,
|
|
103
|
+
runtime: runtime,
|
|
104
|
+
chat: {
|
|
105
|
+
mount(element, options = {}) {
|
|
106
|
+
const chat = { element, options, mounted: true };
|
|
107
|
+
chats.push(chat);
|
|
108
|
+
return Promise.resolve({
|
|
109
|
+
update(next) {
|
|
110
|
+
chat.options = next;
|
|
111
|
+
},
|
|
112
|
+
unmount() {
|
|
113
|
+
chat.mounted = false;
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
mountButton(options = {}) {
|
|
118
|
+
const button = {
|
|
119
|
+
options,
|
|
120
|
+
shown: false,
|
|
121
|
+
target: null,
|
|
122
|
+
mounted: true,
|
|
123
|
+
};
|
|
124
|
+
chatButtons.push(button);
|
|
125
|
+
return Promise.resolve({
|
|
126
|
+
open(target) {
|
|
127
|
+
button.shown = true;
|
|
128
|
+
button.target = target ?? null;
|
|
129
|
+
},
|
|
130
|
+
hide() {
|
|
131
|
+
button.shown = false;
|
|
132
|
+
},
|
|
133
|
+
update(next) {
|
|
134
|
+
button.options = next;
|
|
135
|
+
},
|
|
136
|
+
unmount() {
|
|
137
|
+
button.mounted = false;
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
},
|
|
77
142
|
address: () => shown,
|
|
78
143
|
onAddress(listener) {
|
|
79
|
-
addressListeners
|
|
80
|
-
return () => {
|
|
81
|
-
addressListeners.delete(listener);
|
|
82
|
-
};
|
|
144
|
+
return followHeld(addressListeners, listener, () => shown);
|
|
83
145
|
},
|
|
84
146
|
push: (asked) => navigate('push', asked),
|
|
85
147
|
replace: (asked) => navigate('replace', asked),
|
|
@@ -92,21 +154,10 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
92
154
|
},
|
|
93
155
|
install: () => Promise.resolve('manual'),
|
|
94
156
|
notifications: () => Promise.resolve('unavailable'),
|
|
95
|
-
|
|
157
|
+
telegram: () => Promise.resolve({ state: 'unavailable', name: null, username: null }),
|
|
96
158
|
setTab(tab) {
|
|
97
159
|
tabs.push(tab);
|
|
98
160
|
},
|
|
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
161
|
sourceTop: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.top ?? null),
|
|
111
162
|
sourceDownload: (app) => Promise.resolve(options.sources?.find((entry) => entry.top.app_ref === app)?.download ?? null),
|
|
112
163
|
callExternal(request) {
|
|
@@ -117,10 +168,7 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
117
168
|
readSiteScreenshot: (site) => Promise.resolve(options.siteScreenshots?.[site] ?? null),
|
|
118
169
|
status: () => seen,
|
|
119
170
|
onStatus(listener) {
|
|
120
|
-
statusListeners
|
|
121
|
-
return () => {
|
|
122
|
-
statusListeners.delete(listener);
|
|
123
|
-
};
|
|
171
|
+
return followHeld(statusListeners, listener, () => seen);
|
|
124
172
|
},
|
|
125
173
|
messages(listener) {
|
|
126
174
|
messageListeners.add(listener);
|
|
@@ -136,6 +184,7 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
136
184
|
consents.push(choice);
|
|
137
185
|
publish({ ...published, analytics: { measures: true, choice } });
|
|
138
186
|
},
|
|
187
|
+
cooperate: () => () => { },
|
|
139
188
|
};
|
|
140
189
|
Object.defineProperty(globalThis, 'houseBridge', { value: bridge, configurable: true });
|
|
141
190
|
if (published !== null)
|
|
@@ -143,6 +192,8 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
143
192
|
arrive(current);
|
|
144
193
|
return {
|
|
145
194
|
navigations,
|
|
195
|
+
chats,
|
|
196
|
+
chatButtons,
|
|
146
197
|
ceremonies,
|
|
147
198
|
consents,
|
|
148
199
|
tabs,
|
package/docs/families.md
CHANGED
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
purpose-bound authenticated pages. The shell navigates only to a same-origin
|
|
13
13
|
absolute path, carries its current address as the return target, and the page
|
|
14
14
|
returns there when it completes. An App names an address House gave it in a
|
|
15
|
-
reading and composes
|
|
15
|
+
reading and composes one only for `/bind/<app_ref>`, where the User binds
|
|
16
|
+
its Rooms, with `?slot=<name>` to open at one slot, and `/sign-out`, which
|
|
17
|
+
signs the User out and opens sign-in. A decision House asks over the App, a
|
|
18
|
+
prepared act's approval at `/approve/<ref>` and a secret or a CLI's sign-in
|
|
19
|
+
at `/secret-input/<id>`, stays in the App: the shell draws House's page as
|
|
20
|
+
its own dialog over the App, which the App cannot reach, and `ceremony()`
|
|
21
|
+
resolves once it closes, with `said`, what the page said it ended with, or
|
|
22
|
+
`null` when it closed with nothing said, and `done`, whether the decision was
|
|
23
|
+
carried out.
|
|
16
24
|
- **Installation** - `install()` offers the page as a Home-screen app. Where the
|
|
17
25
|
browser has an install prompt ready the shell shows it and the call resolves
|
|
18
26
|
`'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
|
|
@@ -27,11 +35,22 @@
|
|
|
27
35
|
notifications, or `'unavailable'` where it has no push, as on an iPhone or
|
|
28
36
|
iPad outside a Home-screen app. `notifications(true)` asks the browser's
|
|
29
37
|
permission and subscribes, `notifications(false)` unsubscribes, and each
|
|
30
|
-
answers the state it leaves; a failure of the browser's push service
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
answers the state it leaves; a failure of the browser's push service
|
|
39
|
+
rejects the same way. Call `notifications(true)` from a click. House's
|
|
40
|
+
service worker counts the icon's badge itself, as pushes arrive and as
|
|
41
|
+
read marks reach this storage.
|
|
42
|
+
- **Telegram** - House's own panel alone, refused to an App or a Site the same
|
|
43
|
+
way. `telegram()` answers `{ state, name, username }`: `state` is
|
|
44
|
+
`'available'` where the page runs inside a House bot's Mini App that gave it
|
|
45
|
+
Telegram's launch data naming an account, with that account's `name` and its
|
|
46
|
+
`username` or `null`, and `'unavailable'` with both `null` elsewhere.
|
|
47
|
+
`telegram(true)` links the signed-in User to that account and answers
|
|
48
|
+
`'linked'` with it; where the User's sign-in is
|
|
49
|
+
not recent, the page goes to sign in again, and nothing links until a later
|
|
50
|
+
`telegram(true)`.
|
|
51
|
+
Telegram's refusal rejects with an error coded `linked_elsewhere`,
|
|
52
|
+
`rate_limited` or `refused`, and a failed request with the browser's own
|
|
53
|
+
error name.
|
|
35
54
|
- **Status** - the App reference the runtime client is attached under,
|
|
36
55
|
`preferences`: the `roomRef` and Path of the App's own preferences document,
|
|
37
56
|
or `null` until the runtime holds that Room, sync
|
|
@@ -39,13 +58,25 @@
|
|
|
39
58
|
whether the page measures and the visitor's stored analytics choice, and
|
|
40
59
|
`serviceMode`: `open`, `write-halted` while House refuses writes, so the
|
|
41
60
|
App can stop retrying them, or `null` while the runtime holds no House
|
|
42
|
-
connection. Every status field is camelCase.
|
|
61
|
+
connection. Every status field is camelCase. `onStatus(listener)` and
|
|
62
|
+
`onAddress(listener)` hand a listener the status and the address the bridge
|
|
63
|
+
already holds, then each change.
|
|
43
64
|
The App reports the visitor's choice with `analyticsConsent('accept')` or
|
|
44
|
-
`analyticsConsent('decline')`;
|
|
45
|
-
the choice never reaches House.
|
|
46
|
-
- **
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
`analyticsConsent('decline')`; a Site's shell that measures hands it to House's
|
|
66
|
+
analytics loader, every other shell drops it, and the choice never reaches House.
|
|
67
|
+
- **Releases and builds** - an open App keeps the release it loaded: a newer
|
|
68
|
+
release, or a newer House build, takes effect at the App's next load, offline
|
|
69
|
+
too once the browser stored it. When one tab loads a newer House build, the
|
|
70
|
+
other House tabs reload into it; Room Drafts, chat drafts and unsent changes
|
|
71
|
+
survive the reload.
|
|
72
|
+
- **A runtime that ends** - when the browser ends House's runtime under an open
|
|
73
|
+
App, the App keeps running, its `runtime` client and observations included:
|
|
74
|
+
each observation goes on with the next runtime's values, and the status and
|
|
75
|
+
the address arrive again. A runtime that ended before answering has its reads
|
|
76
|
+
answered by the next one; since it may have applied any other call, an act on
|
|
77
|
+
House is answered the outcome `transport-uncertainty`, and every other call,
|
|
78
|
+
a Save or a draft write among them, fails with the retryable code
|
|
79
|
+
`transport-uncertainty`.
|
|
49
80
|
- **App release code** - `sourceTop(app, release)` answers the top level of
|
|
50
81
|
the latest successful release of an App the User may use: its folders, its
|
|
51
82
|
files with their sizes and its root README's text, or `null` for none;
|
|
@@ -53,24 +84,24 @@
|
|
|
53
84
|
path, its size and its `text`, or its bytes as `base64`. The browser keeps
|
|
54
85
|
each answer per App and release: a read naming a release it holds answers
|
|
55
86
|
without asking House, and keeping a newer release drops the earlier one. A
|
|
56
|
-
refusal is House's `{ error: { code, retryable } }`, `
|
|
87
|
+
refusal is House's `{ error: { code, retryable } }`, `not_found` for an
|
|
57
88
|
App with no release; a read House does not answer, or one that outlived
|
|
58
89
|
the browser's signed-in User, is `null`.
|
|
59
|
-
- **External calls** - `callExternal({ url, method, headers, body,
|
|
90
|
+
- **External calls** - `callExternal({ url, method, headers, body, room_ref })`
|
|
60
91
|
has House's server send an HTTPS request to one of the release's declared
|
|
61
92
|
external origins and resolves with the service's `status`, `headers` and its
|
|
62
93
|
body as `body` text or `body_base64`, or a refusal as House's
|
|
63
94
|
`{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
|
|
64
|
-
App and its running release
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
`
|
|
95
|
+
App and its running release. A `room_ref` names a Room the signed-in User binds to the App
|
|
96
|
+
in a `write` slot, and House adds that Room's Service key for the URL's origin, which App
|
|
97
|
+
code never sees; a call naming no Room carries no key, and a Site's call names no Room.
|
|
98
|
+
`body_base64` replaces `body` for bytes.
|
|
68
99
|
- **App messages** - `messages(listener)` hands the listener each message
|
|
69
100
|
another holder of this App sends to this User's running copies, as `from`,
|
|
70
101
|
the sender's User id, and `body`, the JSON value they sent, until the
|
|
71
102
|
function it returns is called. App code sends one through the Runtime's
|
|
72
|
-
`call('
|
|
73
|
-
a body of at most 32
|
|
103
|
+
`call('apps/messages/send', { to, body })` with the recipient's User id and
|
|
104
|
+
a body of at most 32 kB of JSON; House fills in the App and relays it only
|
|
74
105
|
to copies running now, storing nothing. The panel sends none.
|
|
75
106
|
- **App screenshot read** - given an App reference, `readScreenshot(app)`
|
|
76
107
|
answers the image this browser captured of that App's screen the first time
|
|
@@ -82,6 +113,40 @@
|
|
|
82
113
|
after its latest release, as a JPEG `Blob`, or `null` when House holds none
|
|
83
114
|
or does not answer. A Site's own renderer reads none.
|
|
84
115
|
|
|
116
|
+
- **Chat** - `chat.mount(element, options)` places House's Chat, the one chat
|
|
117
|
+
in which the User's Agent conversations show, in `element` over the page's
|
|
118
|
+
`runtime` client, and resolves to a handle: `update(options)` replaces its
|
|
119
|
+
options and `unmount()` removes it. House serves the Chat with the page and
|
|
120
|
+
keeps it current, so the App installs and bundles nothing for it. The
|
|
121
|
+
options: the Chat fills the element and lays itself out by its width, the
|
|
122
|
+
list of the User's chats or one chat, the list beside the chat, or the list,
|
|
123
|
+
the chat and its details, `conversation` opens one, `null` for a new chat with
|
|
124
|
+
`agent`, the Agent it goes to, or the list with neither, `onOpen` hears
|
|
125
|
+
each conversation it opens as `{ conversation, agent }` and both `null` on
|
|
126
|
+
the way back to the list, and `onLink` takes
|
|
127
|
+
a link without a scheme in place of the browser. CSS custom properties named `--chat-*` on the element
|
|
128
|
+
or an ancestor set its look, and no other rule of the page's stylesheets reaches it. It shows conversations only to a release that
|
|
129
|
+
declares them. `chat.mountButton(options)` places the Chat as the Chat button
|
|
130
|
+
instead, with no element: House's dot at the window's bottom-right corner, which
|
|
131
|
+
counts what asks the User or, while nothing does, the chats that replied since the User
|
|
132
|
+
opened them, breathes while a turn runs and opens and hides the Chat in a sheet the User
|
|
133
|
+
moves, resizes and fills the window with, over a page that never changes under it. It
|
|
134
|
+
resolves to a handle: `open(target)` shows the sheet, on `target.conversation` or a new
|
|
135
|
+
chat with `target.agent` when it names one, docked at full height when `target.docked` is
|
|
136
|
+
`true`, `hide()` hides it, keeping its chat, scroll and typed text, and `update(options)` and
|
|
137
|
+
`unmount()` work as above, with `onOpen` and `onLink`. The page's Presentation State
|
|
138
|
+
keeps the sheet's size, place, list and open chat. A Site and the House panel have none: both calls reject with
|
|
139
|
+
an error named and coded `NotSupportedError`, with `retryable` false.
|
|
140
|
+
|
|
141
|
+
- **First place** - `cooperate({ placed })` tells House when the page has
|
|
142
|
+
drawn the place it opened on; the function it returns withdraws it. Register
|
|
143
|
+
it in the entry script, before the first draw. `placed()` resolves once the
|
|
144
|
+
page has drawn that place with what it shows: House keeps its
|
|
145
|
+
first-preparation surface over a page registered by its first draw until
|
|
146
|
+
then, and lifts it at the first draw of a page that registered none, so the
|
|
147
|
+
User goes from the surface to a drawn place in one change. House asks the
|
|
148
|
+
page for nothing else.
|
|
149
|
+
|
|
85
150
|
## The test host
|
|
86
151
|
|
|
87
152
|
`createHouseBridgeTestHost(options)` plays House in one page: it installs a
|
|
@@ -102,6 +167,12 @@ records in `tabs` each `setTab`, answers a release code read from the
|
|
|
102
167
|
by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
|
|
103
168
|
given by Site identifier, answers every `install()` `'manual'`, as a browser
|
|
104
169
|
with no install prompt does, answers every `notifications()` `'unavailable'`,
|
|
105
|
-
as a browser without push does,
|
|
170
|
+
as a browser without push does, records in `chats`
|
|
171
|
+
each Chat `chat.mount` places, with its `element`, the `options` it was last
|
|
172
|
+
given and whether it is still `mounted`, and in `chatButtons` each Chat button
|
|
173
|
+
`chat.mountButton` places, with the `options` it was last given, whether its
|
|
174
|
+
sheet is `shown`, the `target` its last `open` named or `null`, and whether it is
|
|
175
|
+
still `mounted`, drawing nothing, delivers each App
|
|
106
176
|
message `message({ from, body })` plays, and hands `bridge.runtime` the MD
|
|
107
|
-
Runtime client `attachRuntime(client)` gives it.
|
|
177
|
+
Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
|
|
178
|
+
never calls `placed()`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/app-bridge",
|
|
3
|
-
"version": "0.1.0-
|
|
4
|
-
"description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications
|
|
3
|
+
"version": "0.1.0-c59dd0a694516",
|
|
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",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -18,13 +18,15 @@
|
|
|
18
18
|
"default": "./dist/test-host.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@agentshouse/mdruntime": "0.1.0-c967d1ca66fee"
|
|
23
|
-
},
|
|
24
21
|
"files": [
|
|
25
22
|
"dist",
|
|
26
23
|
"docs",
|
|
27
24
|
"README.md",
|
|
28
25
|
"LICENSE"
|
|
29
|
-
]
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/agentshouse/core.git",
|
|
30
|
+
"directory": "client"
|
|
31
|
+
}
|
|
30
32
|
}
|