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

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 (55) hide show
  1. package/README.md +3 -1
  2. package/dist/calls.d.ts +117 -0
  3. package/dist/calls.js +1 -0
  4. package/dist/index.d.ts +23 -11
  5. package/dist/mdmodel/blocks.d.ts +10 -0
  6. package/dist/mdmodel/condition.d.ts +149 -0
  7. package/dist/mdmodel/definition.d.ts +65 -0
  8. package/dist/mdmodel/divide.d.ts +2 -0
  9. package/dist/mdmodel/document.d.ts +15 -0
  10. package/dist/mdmodel/fields.d.ts +5 -0
  11. package/dist/mdmodel/index.d.ts +18 -0
  12. package/dist/mdmodel/paths.d.ts +17 -0
  13. package/dist/mdmodel/profile.d.ts +5 -0
  14. package/dist/mdmodel/project.d.ts +20 -0
  15. package/dist/mdmodel/references.d.ts +3 -0
  16. package/dist/mdmodel/types.d.ts +143 -0
  17. package/dist/mdmodel/validate.d.ts +7 -0
  18. package/dist/mdmodel/version.d.ts +1 -0
  19. package/dist/mdmodel/yaml.d.ts +55 -0
  20. package/dist/mdruntime/acquisition.d.ts +13 -0
  21. package/dist/mdruntime/adapter.d.ts +475 -0
  22. package/dist/mdruntime/binary.d.ts +22 -0
  23. package/dist/mdruntime/change-set.d.ts +34 -0
  24. package/dist/mdruntime/change.d.ts +88 -0
  25. package/dist/mdruntime/client.d.ts +82 -0
  26. package/dist/mdruntime/collection.d.ts +38 -0
  27. package/dist/mdruntime/connection.d.ts +138 -0
  28. package/dist/mdruntime/conversation.d.ts +104 -0
  29. package/dist/mdruntime/durability.d.ts +14 -0
  30. package/dist/mdruntime/failure.d.ts +12 -0
  31. package/dist/mdruntime/file.d.ts +19 -0
  32. package/dist/mdruntime/model.d.ts +57 -0
  33. package/dist/mdruntime/observation.d.ts +29 -0
  34. package/dist/mdruntime/open.d.ts +1 -0
  35. package/dist/mdruntime/outcome.d.ts +46 -0
  36. package/dist/mdruntime/overlay.d.ts +26 -0
  37. package/dist/mdruntime/query.d.ts +247 -0
  38. package/dist/mdruntime/reach.d.ts +45 -0
  39. package/dist/mdruntime/readiness.d.ts +52 -0
  40. package/dist/mdruntime/recovery.d.ts +24 -0
  41. package/dist/mdruntime/replica.d.ts +45 -0
  42. package/dist/mdruntime/room-draft.d.ts +143 -0
  43. package/dist/mdruntime/rows.d.ts +36 -0
  44. package/dist/mdruntime/save.d.ts +63 -0
  45. package/dist/mdruntime/search.d.ts +84 -0
  46. package/dist/mdruntime/shared.d.ts +10 -0
  47. package/dist/mdruntime/status.d.ts +26 -0
  48. package/dist/mdruntime/store.d.ts +160 -0
  49. package/dist/mdruntime/transfer.d.ts +9 -0
  50. package/dist/mdruntime/turn.d.ts +6 -0
  51. package/dist/mdruntime/wire.d.ts +206 -0
  52. package/dist/test-host.d.ts +5 -5
  53. package/dist/test-host.js +56 -21
  54. package/docs/families.md +41 -2
  55. package/package.json +1 -4
package/docs/families.md CHANGED
@@ -39,10 +39,21 @@
39
39
  whether the page measures and the visitor's stored analytics choice, and
40
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. Every status field is camelCase.
42
+ connection. Every status field is camelCase. `onStatus(listener)` and
43
+ `onAddress(listener)` hand a listener the status and the address the bridge
44
+ already holds, then each change.
43
45
  The App reports the visitor's choice with `analyticsConsent('accept')` or
44
46
  `analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
45
47
  the choice never reaches House.
48
+ - **Handoff** - when House hands its runtime over to a newer build, the App keeps
49
+ running, its `runtime` client and observations included: a call it makes
50
+ meanwhile waits for the newer runtime, however long that takes, and is
51
+ answered once, by it; each observation goes on with the newer runtime's
52
+ values; and the status and the address arrive again. A runtime that ended
53
+ before answering has its reads answered by the next one; since it may have
54
+ applied any other call, an act on House is answered the outcome
55
+ `transport-uncertainty`, and every other call, a Save or a draft write among
56
+ them, fails with the retryable code `transport-uncertainty`.
46
57
  - **Site image read** - given a Published Room and an original attachment
47
58
  reference, it answers the web copy's path and metadata, or `null` when no
48
59
  copy exists. The original bytes never cross this bridge at a Site.
@@ -82,6 +93,31 @@
82
93
  after its latest release, as a JPEG `Blob`, or `null` when House holds none
83
94
  or does not answer. A Site's own renderer reads none.
84
95
 
96
+ - **Cooperation** - `cooperate({ checkpoint, persist, capture, restore,
97
+ ready, settle })` lets House activate a newer release of the App while it
98
+ runs, keeping the User's task; the function it returns withdraws it.
99
+ Register it in the entry script, before the first draw, or House treats the
100
+ page as not cooperating and the newer release waits for the App's next
101
+ open. When a newer release is stored, House calls `checkpoint()`, which
102
+ resolves at the App's next safe checkpoint and may never resolve, then
103
+ `persist()`, which makes authored work durable, then `capture()`, which
104
+ answers the meaningful task the App owns, such as the selected record,
105
+ filters, cursor, selection and scroll position, as JSON of at most 65,536
106
+ characters; House keeps the address itself. In the newer release House
107
+ calls `restore(task)` once its document has drawn, so the scroll position
108
+ and focus it sets hold, or `restore(null)` when it opens the release without
109
+ a task, then `ready()`, the App's own check that its local data and
110
+ capabilities work, and finally `settle('committed')` once the release is
111
+ active or `settle('abandoned')` when House returns to the release before
112
+ it, restoring the same task there. A release House opens already active is
113
+ settled `'committed'` at once, after `restore(task)` when House hands it a
114
+ task, and a cooperation registered after House settled is settled at its
115
+ registration. Until `settle('committed')` House fails the release's outside
116
+ calls at once, as offline, those of the workers it starts included, and
117
+ refuses its Saves, write acts and external calls with the retryable code
118
+ `house_trial_withheld`, so a start-up effect is not repeated; run start-up
119
+ effects after `settle('committed')`.
120
+
85
121
  ## The test host
86
122
 
87
123
  `createHouseBridgeTestHost(options)` plays House in one page: it installs a
@@ -104,4 +140,7 @@ given by Site identifier, answers every `install()` `'manual'`, as a browser
104
140
  with no install prompt does, answers every `notifications()` `'unavailable'`,
105
141
  as a browser without push does, settles every `setBadge`, delivers each App
106
142
  message `message({ from, body })` plays, and hands `bridge.runtime` the MD
107
- Runtime client `attachRuntime(client)` gives it.
143
+ Runtime client `attachRuntime(client)` gives it. `checkpoint()` runs the
144
+ registered cooperation's checkpoint, persist and capture and answers the task,
145
+ `restore(task)` runs its restore and answers its readiness check, and
146
+ `settle(activation)` hands it the outcome.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-c58a055eeaa71",
3
+ "version": "0.1.0-c646d0da70608",
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",
@@ -18,9 +18,6 @@
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",