@agentshouse/app-bridge 0.1.0-cd2f88c8097d7 → 0.1.0-cd44fa24fb809

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 (123) hide show
  1. package/README.md +11 -11
  2. package/dist/index.d.ts +626 -21
  3. package/dist/mdmodel/body.d.ts +84 -0
  4. package/dist/mdmodel/built-in.d.ts +3 -0
  5. package/dist/mdmodel/definition.d.ts +22 -11
  6. package/dist/mdmodel/document.d.ts +15 -9
  7. package/dist/mdmodel/event.d.ts +76 -0
  8. package/dist/mdmodel/facts.d.ts +14 -0
  9. package/dist/mdmodel/fields.d.ts +1 -1
  10. package/dist/mdmodel/house-model.d.ts +869 -0
  11. package/dist/mdmodel/house-references/crockford.d.ts +3 -0
  12. package/dist/mdmodel/house-references/patterns.d.ts +8 -0
  13. package/dist/mdmodel/index.d.ts +41 -14
  14. package/dist/mdmodel/kinds.d.ts +17 -0
  15. package/dist/mdmodel/markdown.d.ts +74 -0
  16. package/dist/mdmodel/media-type.d.ts +71 -0
  17. package/dist/mdmodel/moment.d.ts +6 -0
  18. package/dist/mdmodel/not-ready.d.ts +1 -0
  19. package/dist/mdmodel/paths.d.ts +24 -2
  20. package/dist/mdmodel/pattern.d.ts +9 -0
  21. package/dist/mdmodel/project.d.ts +1 -0
  22. package/dist/mdmodel/query/language.d.ts +253 -0
  23. package/dist/mdmodel/query/match.d.ts +13 -0
  24. package/dist/mdmodel/query/rows.d.ts +31 -0
  25. package/dist/mdmodel/query/sql.d.ts +38 -0
  26. package/dist/mdmodel/references.d.ts +2 -2
  27. package/dist/mdmodel/reserved.d.ts +5 -0
  28. package/dist/mdmodel/room-types.d.ts +6 -0
  29. package/dist/mdmodel/types.d.ts +44 -15
  30. package/dist/mdmodel/validate.d.ts +34 -4
  31. package/dist/mdmodel/yaml.d.ts +4 -4
  32. package/dist/mdruntime/actions.d.ts +25 -0
  33. package/dist/mdruntime/adapter.d.ts +216 -123
  34. package/dist/mdruntime/attached-model.d.ts +6 -0
  35. package/dist/mdruntime/authored.d.ts +87 -0
  36. package/dist/mdruntime/binary.d.ts +0 -5
  37. package/dist/mdruntime/bootstrap.d.ts +43 -0
  38. package/dist/mdruntime/cell.d.ts +5 -0
  39. package/dist/mdruntime/chain.d.ts +11 -0
  40. package/dist/mdruntime/change-set.d.ts +13 -16
  41. package/dist/mdruntime/change.d.ts +36 -1
  42. package/dist/mdruntime/client.d.ts +41 -25
  43. package/dist/mdruntime/collection.d.ts +32 -21
  44. package/dist/mdruntime/compile.d.ts +17 -0
  45. package/dist/mdruntime/conversation-live.d.ts +149 -0
  46. package/dist/mdruntime/conversation-row.d.ts +39 -0
  47. package/dist/mdruntime/conversation.d.ts +84 -50
  48. package/dist/mdruntime/declaration.d.ts +9 -0
  49. package/dist/mdruntime/durability.d.ts +21 -4
  50. package/dist/mdruntime/failure.d.ts +3 -0
  51. package/dist/mdruntime/figures.d.ts +48 -0
  52. package/dist/mdruntime/holdings.d.ts +28 -0
  53. package/dist/mdruntime/identity.d.ts +5 -0
  54. package/dist/mdruntime/install.d.ts +59 -0
  55. package/dist/mdruntime/listing.d.ts +51 -0
  56. package/dist/mdruntime/live.d.ts +24 -0
  57. package/dist/mdruntime/media.d.ts +24 -0
  58. package/dist/mdruntime/messages.d.ts +57 -0
  59. package/dist/mdruntime/model.d.ts +8 -11
  60. package/dist/mdruntime/observation.d.ts +40 -10
  61. package/dist/mdruntime/opened.d.ts +21 -0
  62. package/dist/mdruntime/outcome.d.ts +57 -10
  63. package/dist/mdruntime/overlay.d.ts +8 -6
  64. package/dist/mdruntime/preparation.d.ts +40 -0
  65. package/dist/mdruntime/presence.d.ts +57 -0
  66. package/dist/mdruntime/query.d.ts +25 -191
  67. package/dist/mdruntime/reach.d.ts +21 -11
  68. package/dist/mdruntime/readiness.d.ts +22 -20
  69. package/dist/mdruntime/reads.d.ts +38 -0
  70. package/dist/mdruntime/recovery.d.ts +5 -2
  71. package/dist/mdruntime/refresh.d.ts +26 -0
  72. package/dist/mdruntime/replica.d.ts +50 -33
  73. package/dist/mdruntime/retried.d.ts +29 -0
  74. package/dist/mdruntime/room-draft.d.ts +55 -13
  75. package/dist/mdruntime/room-drafts.d.ts +23 -0
  76. package/dist/mdruntime/runtime.d.ts +33 -0
  77. package/dist/mdruntime/save.d.ts +43 -48
  78. package/dist/mdruntime/saves.d.ts +33 -0
  79. package/dist/mdruntime/search.d.ts +12 -82
  80. package/dist/mdruntime/seed.d.ts +11 -2
  81. package/dist/mdruntime/socket/admission.d.ts +6 -0
  82. package/dist/mdruntime/socket/answers.d.ts +5 -0
  83. package/dist/mdruntime/socket/lanes.d.ts +27 -0
  84. package/dist/mdruntime/socket/session.d.ts +37 -0
  85. package/dist/mdruntime/socket.d.ts +66 -0
  86. package/dist/mdruntime/source.d.ts +58 -0
  87. package/dist/mdruntime/status.d.ts +4 -5
  88. package/dist/mdruntime/store/installs.d.ts +29 -0
  89. package/dist/mdruntime/store/readiness.d.ts +10 -0
  90. package/dist/mdruntime/store/records.d.ts +223 -0
  91. package/dist/mdruntime/store/room-held.d.ts +7 -0
  92. package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
  93. package/dist/mdruntime/store/space.d.ts +10 -0
  94. package/dist/mdruntime/store/watchers.d.ts +16 -0
  95. package/dist/mdruntime/store/writes.d.ts +23 -0
  96. package/dist/mdruntime/store.d.ts +114 -157
  97. package/dist/mdruntime/stored.d.ts +166 -0
  98. package/dist/mdruntime/surface.d.ts +91 -0
  99. package/dist/mdruntime/tables.d.ts +375 -0
  100. package/dist/mdruntime/tallies.d.ts +17 -0
  101. package/dist/mdruntime/transfer.d.ts +0 -5
  102. package/dist/mdruntime/wire.d.ts +96 -9
  103. package/dist/session-content/bounds.d.ts +7 -0
  104. package/dist/session-content/check.d.ts +18 -0
  105. package/dist/session-content/index.d.ts +7 -0
  106. package/dist/session-content/parts.d.ts +103 -0
  107. package/dist/session-content/state.d.ts +61 -0
  108. package/dist/session-content/turn.d.ts +328 -0
  109. package/dist/test-host.d.ts +14 -4
  110. package/dist/test-host.js +45 -29
  111. package/docs/families.md +90 -59
  112. package/package.json +8 -3
  113. package/dist/calls.d.ts +0 -118
  114. package/dist/calls.js +0 -1
  115. package/dist/mdmodel/blocks.d.ts +0 -10
  116. package/dist/mdmodel/condition.d.ts +0 -149
  117. package/dist/mdmodel/profile.d.ts +0 -5
  118. package/dist/mdruntime/acquisition.d.ts +0 -13
  119. package/dist/mdruntime/connection.d.ts +0 -143
  120. package/dist/mdruntime/file.d.ts +0 -19
  121. package/dist/mdruntime/rows.d.ts +0 -37
  122. package/dist/mdruntime/shared.d.ts +0 -10
  123. package/dist/mdruntime/turn.d.ts +0 -6
package/docs/families.md CHANGED
@@ -13,8 +13,14 @@
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. 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.
18
24
  - **Installation** - `install()` offers the page as a Home-screen app. Where the
19
25
  browser has an install prompt ready the shell shows it and the call resolves
20
26
  `'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
@@ -29,11 +35,22 @@
29
35
  notifications, or `'unavailable'` where it has no push, as on an iPhone or
30
36
  iPad outside a Home-screen app. `notifications(true)` asks the browser's
31
37
  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.
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.
37
54
  - **Status** - the App reference the runtime client is attached under,
38
55
  `preferences`: the `roomRef` and Path of the App's own preferences document,
39
56
  or `null` until the runtime holds that Room, sync
@@ -45,20 +62,21 @@
45
62
  `onAddress(listener)` hand a listener the status and the address the bridge
46
63
  already holds, then each change.
47
64
  The App reports the visitor's choice with `analyticsConsent('accept')` or
48
- `analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
49
- 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`.
59
- - **Site image read** - given a Published Room and an original attachment
60
- reference, it answers the web copy's path and metadata, or `null` when no
61
- copy exists. The original bytes never cross this bridge at a Site.
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`.
62
80
  - **App release code** - `sourceTop(app, release)` answers the top level of
63
81
  the latest successful release of an App the User may use: its folders, its
64
82
  files with their sizes and its root README's text, or `null` for none;
@@ -66,25 +84,24 @@
66
84
  path, its size and its `text`, or its bytes as `base64`. The browser keeps
67
85
  each answer per App and release: a read naming a release it holds answers
68
86
  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
87
+ refusal is House's `{ error: { code, retryable } }`, `not_found` for an
70
88
  App with no release; a read House does not answer, or one that outlived
71
89
  the browser's signed-in User, is `null`.
72
- - **External calls** - `callExternal({ url, method, headers, body, slot, room_ref })`
90
+ - **External calls** - `callExternal({ url, method, headers, body, room_ref })`
73
91
  has House's server send an HTTPS request to one of the release's declared
74
92
  external origins and resolves with the service's `status`, `headers` and its
75
93
  body as `body` text or `body_base64`, or a refusal as House's
76
94
  `{ 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.
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.
82
99
  - **App messages** - `messages(listener)` hands the listener each message
83
100
  another holder of this App sends to this User's running copies, as `from`,
84
101
  the sender's User id, and `body`, the JSON value they sent, until the
85
102
  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
87
- a body of at most 32 KiB of JSON; House fills in the App and relays it only
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
88
105
  to copies running now, storing nothing. The panel sends none.
89
106
  - **App screenshot read** - given an App reference, `readScreenshot(app)`
90
107
  answers the image this browser captured of that App's screen the first time
@@ -96,30 +113,41 @@
96
113
  after its latest release, as a JPEG `Blob`, or `null` when House holds none
97
114
  or does not answer. A Site's own renderer reads none.
98
115
 
99
- - **Cooperation** - `cooperate({ checkpoint, persist, capture, restore,
100
- ready, settle })` lets House activate a newer release of the App while it
101
- runs, keeping the User's task; the function it returns withdraws it.
102
- Register it in the entry script, before the first draw, or House treats the
103
- page as not cooperating and the newer release waits for the App's next
104
- open. When a newer release is stored, House calls `checkpoint()`, which
105
- resolves at the App's next safe checkpoint and may never resolve, then
106
- `persist()`, which makes authored work durable, then `capture()`, which
107
- answers the meaningful task the App owns, such as the selected record,
108
- filters, cursor, selection and scroll position, as JSON of at most 65,536
109
- characters; House keeps the address itself. In the newer release House
110
- calls `restore(task)` once its document has drawn, so the scroll position
111
- and focus it sets hold, or `restore(null)` when it opens the release without
112
- a task, then `ready()`, the App's own check that its local data and
113
- capabilities work, and finally `settle('committed')` once the release is
114
- active or `settle('abandoned')` when House returns to the release before
115
- it, restoring the same task there. A release House opens already active is
116
- settled `'committed'` at once, after `restore(task)` when House hands it a
117
- task, and a cooperation registered after House settled is settled at its
118
- registration. Until `settle('committed')` House fails the release's outside
119
- calls at once, as offline, those of the workers it starts included, and
120
- refuses its Saves, write acts and external calls with the retryable code
121
- `house_trial_withheld`, so a start-up effect is not repeated; run start-up
122
- effects after `settle('committed')`.
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`. `agent` among the mount's options
138
+ names the Agent the dot first opens the sheet on, a new chat with it in place of the chat the
139
+ sheet kept, and leaves the sheet hidden. The page's Presentation State
140
+ keeps the sheet's size, place, list and open chat. A Site and the House panel have none: both calls reject with
141
+ an error named and coded `NotSupportedError`, with `retryable` false.
142
+
143
+ - **First place** - `cooperate({ placed })` tells House when the page has
144
+ drawn the place it opened on; the function it returns withdraws it. Register
145
+ it in the entry script, before the first draw. `placed()` resolves once the
146
+ page has drawn that place with what it shows: House keeps its
147
+ first-preparation surface over a page registered by its first draw until
148
+ then, and lifts it at the first draw of a page that registered none, so the
149
+ User goes from the surface to a drawn place in one change. House asks the
150
+ page for nothing else.
123
151
 
124
152
  ## The test host
125
153
 
@@ -141,9 +169,12 @@ records in `tabs` each `setTab`, answers a release code read from the
141
169
  by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
142
170
  given by Site identifier, answers every `install()` `'manual'`, as a browser
143
171
  with no install prompt does, answers every `notifications()` `'unavailable'`,
144
- as a browser without push does, settles every `setBadge`, delivers each App
172
+ as a browser without push does, records in `chats`
173
+ each Chat `chat.mount` places, with its `element`, the `options` it was last
174
+ given and whether it is still `mounted`, and in `chatButtons` each Chat button
175
+ `chat.mountButton` places, with the `options` it was last given, whether its
176
+ sheet is `shown`, the `target` its last `open` named or `null`, and whether it is
177
+ still `mounted`, drawing nothing, delivers each App
145
178
  message `message({ from, body })` plays, and hands `bridge.runtime` the MD
146
- Runtime client `attachRuntime(client)` gives it. `checkpoint()` runs the
147
- registered cooperation's checkpoint, persist and capture and answers the task,
148
- `restore(task)` runs its restore and answers its readiness check, and
149
- `settle(activation)` hands it the outcome.
179
+ Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
180
+ never calls `placed()`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-cd2f88c8097d7",
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.",
3
+ "version": "0.1.0-cd44fa24fb809",
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,
@@ -23,5 +23,10 @@
23
23
  "docs",
24
24
  "README.md",
25
25
  "LICENSE"
26
- ]
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/agentshouse/core.git",
30
+ "directory": "client"
31
+ }
27
32
  }
package/dist/calls.d.ts DELETED
@@ -1,118 +0,0 @@
1
- export interface HouseCalls {
2
- readonly 'access.read': {
3
- readonly room_ref: string;
4
- readonly statistics?: boolean;
5
- };
6
- readonly 'conversation.answer': {
7
- readonly answer: {
8
- readonly interaction_id: string;
9
- readonly response: unknown;
10
- };
11
- readonly conversation: string;
12
- readonly operation_id?: string;
13
- };
14
- readonly 'conversation.create': {
15
- readonly agent_id: string;
16
- readonly operation_id?: string;
17
- };
18
- readonly 'conversation.delete': {
19
- readonly conversation: string;
20
- readonly operation_id?: string;
21
- };
22
- readonly 'conversation.history': {
23
- readonly conversations: readonly {
24
- readonly after?: string;
25
- readonly conversation: string;
26
- }[];
27
- };
28
- readonly 'conversation.interrupt': {
29
- readonly conversation: string;
30
- readonly operation_id?: string;
31
- };
32
- readonly 'conversation.kill': {
33
- readonly conversation: string;
34
- readonly operation_id?: string;
35
- };
36
- readonly 'conversation.markDone': {
37
- readonly conversation_id?: string;
38
- readonly result?: string;
39
- readonly operation_id: string;
40
- };
41
- readonly 'conversation.rename': {
42
- readonly conversation_id: string;
43
- readonly operation_id: string;
44
- readonly name: string;
45
- };
46
- readonly 'conversation.send': {
47
- readonly conversation: string;
48
- readonly files?: readonly {
49
- readonly blob: Blob;
50
- readonly byteLength: number;
51
- readonly contentHash: string;
52
- readonly height?: number;
53
- readonly mediaType: string;
54
- readonly name: string;
55
- readonly width?: number;
56
- }[];
57
- readonly operation_id: string;
58
- readonly text?: string;
59
- };
60
- readonly 'conversation.setOption': {
61
- readonly conversation_id: string;
62
- readonly operation_id: string;
63
- readonly option: string;
64
- readonly value: string | boolean;
65
- };
66
- readonly 'feature.list': Readonly<Record<string, never>>;
67
- readonly 'holder.list': Readonly<Record<string, never>>;
68
- readonly 'holder.ring': {
69
- readonly to: string;
70
- };
71
- readonly 'member.list': {
72
- readonly room_ref: string;
73
- readonly history?: boolean;
74
- readonly limit?: number;
75
- readonly cursor?: string;
76
- };
77
- readonly 'message.send': {
78
- readonly to: string;
79
- readonly body: unknown;
80
- };
81
- readonly 'processing.read': {
82
- readonly room_ref: string;
83
- readonly path: string;
84
- };
85
- readonly 'record.list': {
86
- readonly room_ref: string;
87
- readonly record?: string;
88
- readonly cursor?: string;
89
- readonly limit?: number;
90
- readonly order?: 'asc' | 'desc';
91
- };
92
- readonly 'relay.read': Readonly<Record<string, never>>;
93
- readonly 'routine.list': {
94
- readonly room_ref: string;
95
- };
96
- readonly 'routineAccess.list': {
97
- readonly room_ref: string;
98
- };
99
- readonly 'routineAllowance.list': {
100
- readonly room_ref: string;
101
- readonly access: string;
102
- };
103
- readonly 'routineRequest.list': {
104
- readonly room_ref: string;
105
- };
106
- readonly 'storage.read': {
107
- readonly room_ref?: string;
108
- };
109
- readonly submit: {
110
- readonly content: string;
111
- };
112
- readonly 'trigger.list': {
113
- readonly room_ref: string;
114
- };
115
- readonly 'triggerOccurrence.list': {
116
- readonly room_ref: string;
117
- };
118
- }
package/dist/calls.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import type { Extent } from './types.js';
2
- export type HeadingLine = {
3
- readonly level: number;
4
- readonly name: string;
5
- readonly start: number;
6
- readonly textEnd: number;
7
- readonly next: number;
8
- };
9
- export declare function headingLines(content: string, from: number, to: number): HeadingLine[];
10
- export declare function blockRanges(content: string, from: number, to: number): Extent[];
@@ -1,149 +0,0 @@
1
- import { type ValueFacts } from './definition.js';
2
- import type { Document, VerifiedModel } from './types.js';
3
- export type ConditionValue = string | number | boolean | {
4
- readonly owner: true;
5
- };
6
- export type ConditionTest = {
7
- readonly all: readonly ConditionTest[];
8
- } | {
9
- readonly any: readonly ConditionTest[];
10
- } | {
11
- readonly not: ConditionTest;
12
- } | ({
13
- readonly path: string;
14
- } & ({
15
- readonly eq: ConditionValue;
16
- } | {
17
- readonly in: readonly ConditionValue[];
18
- } | {
19
- readonly exists: boolean;
20
- } | {
21
- readonly contains: ConditionValue;
22
- } | {
23
- readonly gt: number | string;
24
- } | {
25
- readonly gte: number | string;
26
- } | {
27
- readonly lt: number | string;
28
- } | {
29
- readonly lte: number | string;
30
- } | {
31
- readonly prefix: string;
32
- }));
33
- export type ConditionScope = {
34
- readonly type: string;
35
- } | {
36
- readonly folder: string;
37
- } | {
38
- readonly document: string;
39
- };
40
- type DocumentEventBase = {
41
- readonly on: 'documents';
42
- readonly scope: ConditionScope;
43
- readonly by?: ConditionTest;
44
- };
45
- export type DocumentCondition = (DocumentEventBase & {
46
- readonly mode: 'starts_matching';
47
- readonly new_documents: boolean;
48
- readonly match: ConditionTest;
49
- }) | (DocumentEventBase & {
50
- readonly mode: 'field_changes';
51
- readonly field: string;
52
- readonly from?: readonly ConditionValue[] | 'new';
53
- readonly to?: readonly ConditionValue[] | 'deleted';
54
- readonly match?: ConditionTest;
55
- });
56
- export type ItemCondition = {
57
- readonly on: 'items';
58
- readonly source?: string;
59
- readonly address?: string;
60
- readonly match?: ConditionTest;
61
- };
62
- export type CronCondition = {
63
- readonly on: 'clock';
64
- readonly cron: string;
65
- readonly time_zone: string;
66
- };
67
- export type DateCondition = {
68
- readonly on: 'clock';
69
- readonly scope: {
70
- readonly type: string;
71
- };
72
- readonly date: string;
73
- readonly days: number;
74
- readonly at: string;
75
- readonly time_zone: string;
76
- readonly match?: ConditionTest;
77
- };
78
- export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition;
79
- export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
80
- type Scalar = string | number | boolean;
81
- export type Fact = {
82
- readonly kind: FactKind;
83
- readonly value: Scalar;
84
- readonly member?: string;
85
- } | {
86
- readonly kind: 'prose';
87
- } | {
88
- readonly kind: 'null';
89
- } | {
90
- readonly kind: 'unreadable';
91
- } | {
92
- readonly kind: 'list';
93
- readonly items: readonly Fact[];
94
- } | {
95
- readonly kind: 'object';
96
- readonly fields: Readonly<Record<string, Fact>>;
97
- };
98
- export type DocumentFacts = {
99
- readonly id: string;
100
- readonly path: string;
101
- readonly type: string | null;
102
- readonly fields: Readonly<Record<string, Fact>>;
103
- readonly sections: readonly string[];
104
- };
105
- export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client'];
106
- export type WriteDoor = (typeof WRITE_DOORS)[number];
107
- export type Actor = {
108
- readonly user?: string;
109
- readonly site?: string;
110
- readonly door?: WriteDoor;
111
- };
112
- export type DocumentEvent = {
113
- readonly before: DocumentFacts | null;
114
- readonly after: DocumentFacts | null;
115
- readonly changed: readonly string[];
116
- readonly by: Actor;
117
- };
118
- export type ItemFacts = {
119
- readonly delivery: string;
120
- readonly source: string | null;
121
- readonly address: string | null;
122
- readonly has_attachment: boolean;
123
- readonly provider: string | null;
124
- readonly container: string | null;
125
- readonly author: string | null;
126
- readonly headers: Readonly<Record<string, string>>;
127
- readonly json: {
128
- readonly value: unknown;
129
- } | null;
130
- };
131
- export type Resolved = {
132
- readonly id: string;
133
- readonly member?: string;
134
- };
135
- type Truth = boolean | undefined;
136
- export declare function factKind(facts: ValueFacts): FactKind | null;
137
- export declare function facts(document: Document, at: {
138
- readonly id: string;
139
- readonly path: string;
140
- }, model: VerifiedModel, resolve: (target: string) => Resolved | undefined): DocumentFacts;
141
- export declare function prosePaths(facts: DocumentFacts): string[];
142
- export declare function datePointers(fields: Readonly<Record<string, ValueFacts>>): string[];
143
- export declare function dated(value: unknown): value is string;
144
- export declare function instant(value: unknown): bigint | undefined;
145
- export declare function pointed(value: unknown, pointer: string): unknown;
146
- export declare function holds(test: ConditionTest, document: DocumentFacts, owner: string): Truth;
147
- export declare function fires(condition: DocumentCondition, event: DocumentEvent, owner: string): boolean;
148
- export declare function itemFires(condition: ItemCondition, item: ItemFacts, owner: string): boolean;
149
- export {};
@@ -1,5 +0,0 @@
1
- export declare const MARKDOWN_SYNTAX_PROFILE: {
2
- readonly name: 'GitHub Flavored Markdown';
3
- readonly spec: '0.29';
4
- readonly url: 'https://github.github.com/gfm/';
5
- };
@@ -1,13 +0,0 @@
1
- export type RuntimeDemand = {
2
- readonly whole: boolean;
3
- readonly rooms: readonly string[];
4
- readonly handles: readonly string[];
5
- readonly conversations: boolean;
6
- };
7
- export declare const WHOLE_DEMAND: RuntimeDemand;
8
- export declare function demanded(demand: RuntimeDemand, room: {
9
- readonly locator: string;
10
- readonly handle: string;
11
- }): boolean;
12
- export declare function wider(next: RuntimeDemand, current: RuntimeDemand): boolean;
13
- export declare function narrower(next: RuntimeDemand, current: RuntimeDemand): boolean;