@agentshouse/app-bridge 0.1.0-c8d8dc6285bbd → 0.1.0-c8dd3de04bf64

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.
Files changed (95) hide show
  1. package/README.md +7 -7
  2. package/dist/index.d.ts +910 -19
  3. package/dist/mdmodel/definition.d.ts +1 -1
  4. package/dist/mdmodel/document.d.ts +2 -1
  5. package/dist/mdmodel/event.d.ts +77 -0
  6. package/dist/mdmodel/facts.d.ts +14 -0
  7. package/dist/mdmodel/index.d.ts +19 -7
  8. package/dist/mdmodel/kinds.d.ts +17 -0
  9. package/dist/mdmodel/pattern.d.ts +9 -0
  10. package/dist/mdmodel/query/language.d.ts +253 -0
  11. package/dist/mdmodel/query/match.d.ts +13 -0
  12. package/dist/mdmodel/query/rows.d.ts +31 -0
  13. package/dist/mdmodel/query/sql.d.ts +38 -0
  14. package/dist/mdmodel/reserved.d.ts +5 -0
  15. package/dist/mdmodel/types.d.ts +11 -0
  16. package/dist/mdmodel/validate.d.ts +7 -5
  17. package/dist/mdruntime/actions.d.ts +19 -0
  18. package/dist/mdruntime/adapter.d.ts +107 -71
  19. package/dist/mdruntime/attached-model.d.ts +7 -0
  20. package/dist/mdruntime/bootstrap.d.ts +43 -0
  21. package/dist/mdruntime/cell.d.ts +5 -0
  22. package/dist/mdruntime/chain.d.ts +2 -1
  23. package/dist/mdruntime/change.d.ts +1 -0
  24. package/dist/mdruntime/client.d.ts +28 -11
  25. package/dist/mdruntime/collection.d.ts +7 -4
  26. package/dist/mdruntime/compile.d.ts +6 -6
  27. package/dist/mdruntime/conversation-live.d.ts +135 -0
  28. package/dist/mdruntime/conversation-row.d.ts +32 -0
  29. package/dist/mdruntime/conversation.d.ts +41 -45
  30. package/dist/mdruntime/durability.d.ts +15 -1
  31. package/dist/mdruntime/figures.d.ts +48 -0
  32. package/dist/mdruntime/holdings.d.ts +28 -0
  33. package/dist/mdruntime/identity.d.ts +0 -1
  34. package/dist/mdruntime/install.d.ts +55 -0
  35. package/dist/mdruntime/job.d.ts +32 -0
  36. package/dist/mdruntime/listing.d.ts +52 -0
  37. package/dist/mdruntime/live.d.ts +22 -0
  38. package/dist/mdruntime/log.d.ts +5 -0
  39. package/dist/mdruntime/media.d.ts +7 -0
  40. package/dist/mdruntime/messages.d.ts +27 -3
  41. package/dist/mdruntime/model.d.ts +8 -10
  42. package/dist/mdruntime/observation.d.ts +3 -2
  43. package/dist/mdruntime/outcome.d.ts +17 -6
  44. package/dist/mdruntime/overlay.d.ts +1 -0
  45. package/dist/mdruntime/preparation.d.ts +19 -0
  46. package/dist/mdruntime/query.d.ts +18 -208
  47. package/dist/mdruntime/reach.d.ts +20 -11
  48. package/dist/mdruntime/readiness.d.ts +3 -18
  49. package/dist/mdruntime/reads.d.ts +36 -0
  50. package/dist/mdruntime/recovery.d.ts +1 -0
  51. package/dist/mdruntime/refresh.d.ts +26 -0
  52. package/dist/mdruntime/replica.d.ts +11 -12
  53. package/dist/mdruntime/room-draft.d.ts +21 -7
  54. package/dist/mdruntime/room-drafts.d.ts +23 -0
  55. package/dist/mdruntime/runtime.d.ts +42 -0
  56. package/dist/mdruntime/save.d.ts +7 -1
  57. package/dist/mdruntime/saves.d.ts +69 -0
  58. package/dist/mdruntime/search.d.ts +12 -63
  59. package/dist/mdruntime/seed.d.ts +11 -2
  60. package/dist/mdruntime/socket/admission.d.ts +6 -0
  61. package/dist/mdruntime/socket/answers.d.ts +5 -0
  62. package/dist/mdruntime/socket/lanes.d.ts +19 -0
  63. package/dist/mdruntime/socket/rooms.d.ts +43 -0
  64. package/dist/mdruntime/socket/session.d.ts +37 -0
  65. package/dist/mdruntime/socket.d.ts +69 -0
  66. package/dist/mdruntime/source.d.ts +60 -0
  67. package/dist/mdruntime/status.d.ts +4 -5
  68. package/dist/mdruntime/store/fences.d.ts +15 -0
  69. package/dist/mdruntime/store/installs.d.ts +29 -0
  70. package/dist/mdruntime/store/readiness.d.ts +9 -0
  71. package/dist/mdruntime/store/records.d.ts +211 -0
  72. package/dist/mdruntime/store/room-held.d.ts +7 -0
  73. package/dist/mdruntime/store/space.d.ts +10 -0
  74. package/dist/mdruntime/store/watchers.d.ts +16 -0
  75. package/dist/mdruntime/store/writes.d.ts +23 -0
  76. package/dist/mdruntime/store.d.ts +105 -158
  77. package/dist/mdruntime/stored.d.ts +66 -55
  78. package/dist/mdruntime/surface.d.ts +87 -0
  79. package/dist/mdruntime/tables.d.ts +131 -69
  80. package/dist/mdruntime/tallies.d.ts +17 -0
  81. package/dist/mdruntime/transfer.d.ts +0 -5
  82. package/dist/mdruntime/turn.d.ts +8 -0
  83. package/dist/mdruntime/wire.d.ts +25 -9
  84. package/dist/test-host.d.ts +1 -4
  85. package/dist/test-host.js +2 -28
  86. package/docs/families.md +49 -53
  87. package/package.json +1 -1
  88. package/dist/calls.d.ts +0 -1007
  89. package/dist/calls.js +0 -1
  90. package/dist/mdmodel/condition.d.ts +0 -160
  91. package/dist/mdmodel/profile.d.ts +0 -5
  92. package/dist/mdruntime/connection.d.ts +0 -151
  93. package/dist/mdruntime/file.d.ts +0 -11
  94. package/dist/mdruntime/fulltext.d.ts +0 -26
  95. package/dist/mdruntime/shared.d.ts +0 -15
package/docs/families.md CHANGED
@@ -13,8 +13,8 @@
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
15
  reading and composes one only for `/bind/<app_ref>`, where the User binds
16
- its Rooms and connects its account slots, with `?slot=<name>` to open at one
17
- slot.
16
+ its Rooms, with `?slot=<name>` to open at one slot, and `/sign-out`, which
17
+ signs the User out and opens sign-in.
18
18
  - **Installation** - `install()` offers the page as a Home-screen app. Where the
19
19
  browser has an install prompt ready the shell shows it and the call resolves
20
20
  `'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
@@ -29,11 +29,22 @@
29
29
  notifications, or `'unavailable'` where it has no push, as on an iPhone or
30
30
  iPad outside a Home-screen app. `notifications(true)` asks the browser's
31
31
  permission and subscribes, `notifications(false)` unsubscribes, and each
32
- answers the state it leaves; a failure of the browser's push service, and
33
- of `setBadge`, rejects the same way. Call `notifications(true)` from a
34
- click. `setBadge(unread)` takes the identifiers of the Human Notifications
35
- unread in this storage and sets the icon's badge to their number, or clears
36
- it at none, where the browser shows one.
32
+ answers the state it leaves; a failure of the browser's push service
33
+ rejects the same way. Call `notifications(true)` from a click. House's
34
+ service worker counts the icon's badge itself, as pushes arrive and as
35
+ read marks reach this storage.
36
+ - **Telegram** - House's own panel alone, refused to an App or a Site the same
37
+ way. `telegram()` answers `{ state, name, username }`: `state` is
38
+ `'available'` where the page runs inside a House bot's Mini App that gave it
39
+ Telegram's launch data naming an account, with that account's `name` and its
40
+ `username` or `null`, and `'unavailable'` with both `null` elsewhere.
41
+ `telegram(true)` links the signed-in User to that account and answers
42
+ `'linked'` with it; where the User's sign-in is
43
+ not recent, the page goes to sign in again, and nothing links until a later
44
+ `telegram(true)`.
45
+ Telegram's refusal rejects with an error coded `linked_elsewhere`,
46
+ `rate_limited` or `refused`, and a failed request with the browser's own
47
+ error name.
37
48
  - **Status** - the App reference the runtime client is attached under,
38
49
  `preferences`: the `roomRef` and Path of the App's own preferences document,
39
50
  or `null` until the runtime holds that Room, sync
@@ -47,15 +58,19 @@
47
58
  The App reports the visitor's choice with `analyticsConsent('accept')` or
48
59
  `analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
49
60
  the choice never reaches House.
50
- - **Handoff** - when House hands its runtime over to a newer build, the App keeps
51
- running, its `runtime` client and observations included: a call it makes
52
- meanwhile waits for the newer runtime, however long that takes, and is
53
- answered once, by it; each observation goes on with the newer runtime's
54
- values; and the status and the address arrive again. A runtime that ended
55
- before answering has its reads answered by the next one; since it may have
56
- applied any other call, an act on House is answered the outcome
57
- `transport-uncertainty`, and every other call, a Save or a draft write among
58
- them, fails with the retryable code `transport-uncertainty`.
61
+ - **Releases and builds** - an open App keeps the release it loaded: a newer
62
+ release, or a newer House build, takes effect at the App's next load, offline
63
+ too once the browser stored it. When one tab loads a newer House build, the
64
+ other House tabs reload into it; Room Drafts, chat drafts and unsent changes
65
+ survive the reload.
66
+ - **A runtime that ends** - when the browser ends House's runtime under an open
67
+ App, the App keeps running, its `runtime` client and observations included:
68
+ each observation goes on with the next runtime's values, and the status and
69
+ the address arrive again. A runtime that ended before answering has its reads
70
+ answered by the next one; since it may have applied any other call, an act on
71
+ House is answered the outcome `transport-uncertainty`, and every other call,
72
+ a Save or a draft write among them, fails with the retryable code
73
+ `transport-uncertainty`.
59
74
  - **Site image read** - given a Published Room and the Path of one of its
60
75
  binary entries, it answers the web copy's path and metadata, or `null` when no
61
76
  copy exists. The original bytes never cross this bridge at a Site.
@@ -66,24 +81,23 @@
66
81
  path, its size and its `text`, or its bytes as `base64`. The browser keeps
67
82
  each answer per App and release: a read naming a release it holds answers
68
83
  without asking House, and keeping a newer release drops the earlier one. A
69
- refusal is House's `{ error: { code, retryable } }`, `app_release_not_found` for an
84
+ refusal is House's `{ error: { code, retryable } }`, `not_found` for an
70
85
  App with no release; a read House does not answer, or one that outlived
71
86
  the browser's signed-in User, is `null`.
72
- - **External calls** - `callExternal({ url, method, headers, body, slot, room_ref })`
87
+ - **External calls** - `callExternal({ url, method, headers, body, room_ref })`
73
88
  has House's server send an HTTPS request to one of the release's declared
74
89
  external origins and resolves with the service's `status`, `headers` and its
75
90
  body as `body` text or `body_base64`, or a refusal as House's
76
91
  `{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
77
- App and its running release; naming an account slot and one of the App's
78
- bound Rooms places the key of the account that Room connects to the slot,
79
- when the User holds one of the account's roles there, which the App never
80
- sees, and naming neither sends no key. A Site's call names no slot, and the House panel names an
81
- `account` instead. `body_base64` replaces `body` for bytes.
92
+ App and its running release. A `room_ref` names a Room the signed-in User binds to the App
93
+ in a `write` slot, and House adds that Room's Service key for the URL's origin, which App
94
+ code never sees; a call naming no Room carries no key, and a Site's call names no Room.
95
+ `body_base64` replaces `body` for bytes.
82
96
  - **App messages** - `messages(listener)` hands the listener each message
83
97
  another holder of this App sends to this User's running copies, as `from`,
84
98
  the sender's User id, and `body`, the JSON value they sent, until the
85
99
  function it returns is called. App code sends one through the Runtime's
86
- `call('message.send', { to, body })` with the recipient's User id and
100
+ `call('apps/messages/send', { to, body })` with the recipient's User id and
87
101
  a body of at most 32 kB of JSON; House fills in the App and relays it only
88
102
  to copies running now, storing nothing. The panel sends none.
89
103
  - **App screenshot read** - given an App reference, `readScreenshot(app)`
@@ -111,30 +125,14 @@
111
125
  declares them. A Site and the House panel have none: their call rejects with
112
126
  an error named and coded `NotSupportedError`, with `retryable` false.
113
127
 
114
- - **Cooperation** - `cooperate({ checkpoint, persist, capture, restore,
115
- ready, settle })` lets House activate a newer release of the App while it
116
- runs, keeping the User's task; the function it returns withdraws it.
117
- Register it in the entry script, before the first draw, or House treats the
118
- page as not cooperating and the newer release waits for the App's next
119
- open. When a newer release is stored, House calls `checkpoint()`, which
120
- resolves at the App's next safe checkpoint and may never resolve, then
121
- `persist()`, which makes authored work durable, then `capture()`, which
122
- answers the meaningful task the App owns, such as the selected record,
123
- filters, cursor, selection and scroll position, as JSON of at most 65,536
124
- characters; House keeps the address itself. In the newer release House
125
- calls `restore(task)` once its document has drawn, so the scroll position
126
- and focus it sets hold, or `restore(null)` when it opens the release without
127
- a task, then `ready()`, the App's own check that its local data and
128
- capabilities work, and finally `settle('committed')` once the release is
129
- active or `settle('abandoned')` when House returns to the release before
130
- it, restoring the same task there. A release House opens already active is
131
- settled `'committed'` at once, after `restore(task)` when House hands it a
132
- task, and a cooperation registered after House settled is settled at its
133
- registration. Until `settle('committed')` House fails the release's outside
134
- calls at once, as offline, those of the workers it starts included, and
135
- refuses its Saves, write acts and external calls with the retryable code
136
- `house_trial_withheld`, so a start-up effect is not repeated; run start-up
137
- effects after `settle('committed')`.
128
+ - **First place** - `cooperate({ placed })` tells House when the page has
129
+ drawn the place it opened on; the function it returns withdraws it. Register
130
+ it in the entry script, before the first draw. `placed()` resolves once the
131
+ page has drawn that place with what it shows: House keeps its
132
+ first-preparation surface over a page registered by its first draw until
133
+ then, and lifts it at the first draw of a page that registered none, so the
134
+ User goes from the surface to a drawn place in one change. House asks the
135
+ page for nothing else.
138
136
 
139
137
  ## The test host
140
138
 
@@ -156,11 +154,9 @@ records in `tabs` each `setTab`, answers a release code read from the
156
154
  by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
157
155
  given by Site identifier, answers every `install()` `'manual'`, as a browser
158
156
  with no install prompt does, answers every `notifications()` `'unavailable'`,
159
- as a browser without push does, settles every `setBadge`, records in `chats`
157
+ as a browser without push does, records in `chats`
160
158
  each Chat `chat.mount` places, with its `element`, the `options` it was last
161
159
  given and whether it is still `mounted`, drawing nothing, delivers each App
162
160
  message `message({ from, body })` plays, and hands `bridge.runtime` the MD
163
- Runtime client `attachRuntime(client)` gives it. `checkpoint()` runs the
164
- registered cooperation's checkpoint, persist and capture and answers the task,
165
- `restore(task)` runs its restore and answers its readiness check, and
166
- `settle(activation)` hands it the outcome.
161
+ Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
162
+ never calls `placed()`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-c8d8dc6285bbd",
3
+ "version": "0.1.0-c8dd3de04bf64",
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, App messages and the Chat, with an accessor and an in-page test host.",
5
5
  "license": "MIT",
6
6
  "type": "module",