@agentshouse/app-bridge 0.1.0-ca559eade7c19 → 0.1.0-ca61ac777c0b7

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 (108) hide show
  1. package/README.md +11 -11
  2. package/dist/index.d.ts +1033 -20
  3. package/dist/mdmodel/definition.d.ts +18 -1
  4. package/dist/mdmodel/document.d.ts +10 -6
  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 +25 -11
  8. package/dist/mdmodel/kinds.d.ts +17 -0
  9. package/dist/mdmodel/markdown.d.ts +50 -0
  10. package/dist/mdmodel/paths.d.ts +9 -1
  11. package/dist/mdmodel/pattern.d.ts +9 -0
  12. package/dist/mdmodel/project.d.ts +1 -0
  13. package/dist/mdmodel/query/language.d.ts +253 -0
  14. package/dist/mdmodel/query/match.d.ts +13 -0
  15. package/dist/mdmodel/query/rows.d.ts +31 -0
  16. package/dist/mdmodel/query/sql.d.ts +38 -0
  17. package/dist/mdmodel/reserved.d.ts +5 -0
  18. package/dist/mdmodel/types.d.ts +46 -5
  19. package/dist/mdmodel/validate.d.ts +31 -4
  20. package/dist/mdruntime/actions.d.ts +19 -0
  21. package/dist/mdruntime/adapter.d.ts +161 -116
  22. package/dist/mdruntime/attached-model.d.ts +7 -0
  23. package/dist/mdruntime/binary.d.ts +0 -5
  24. package/dist/mdruntime/bootstrap.d.ts +43 -0
  25. package/dist/mdruntime/cell.d.ts +5 -0
  26. package/dist/mdruntime/chain.d.ts +11 -0
  27. package/dist/mdruntime/change-set.d.ts +13 -16
  28. package/dist/mdruntime/change.d.ts +32 -1
  29. package/dist/mdruntime/client.d.ts +36 -11
  30. package/dist/mdruntime/collection.d.ts +29 -21
  31. package/dist/mdruntime/compile.d.ts +15 -0
  32. package/dist/mdruntime/conversation-live.d.ts +135 -0
  33. package/dist/mdruntime/conversation-row.d.ts +32 -0
  34. package/dist/mdruntime/conversation.d.ts +54 -46
  35. package/dist/mdruntime/declaration.d.ts +9 -0
  36. package/dist/mdruntime/durability.d.ts +16 -4
  37. package/dist/mdruntime/failure.d.ts +1 -0
  38. package/dist/mdruntime/figures.d.ts +48 -0
  39. package/dist/mdruntime/holdings.d.ts +28 -0
  40. package/dist/mdruntime/identity.d.ts +5 -0
  41. package/dist/mdruntime/listing.d.ts +47 -0
  42. package/dist/mdruntime/live.d.ts +22 -0
  43. package/dist/mdruntime/log.d.ts +5 -0
  44. package/dist/mdruntime/media.d.ts +7 -0
  45. package/dist/mdruntime/messages.d.ts +48 -0
  46. package/dist/mdruntime/model.d.ts +8 -11
  47. package/dist/mdruntime/observation.d.ts +17 -2
  48. package/dist/mdruntime/opened.d.ts +21 -0
  49. package/dist/mdruntime/outcome.d.ts +49 -8
  50. package/dist/mdruntime/overlay.d.ts +4 -5
  51. package/dist/mdruntime/preparation.d.ts +19 -0
  52. package/dist/mdruntime/presence.d.ts +51 -0
  53. package/dist/mdruntime/query.d.ts +25 -191
  54. package/dist/mdruntime/reach.d.ts +20 -9
  55. package/dist/mdruntime/readiness.d.ts +13 -17
  56. package/dist/mdruntime/reads.d.ts +36 -0
  57. package/dist/mdruntime/recovery.d.ts +3 -2
  58. package/dist/mdruntime/refresh.d.ts +26 -0
  59. package/dist/mdruntime/replica.d.ts +50 -33
  60. package/dist/mdruntime/room-draft.d.ts +28 -11
  61. package/dist/mdruntime/room-drafts.d.ts +23 -0
  62. package/dist/mdruntime/runtime.d.ts +33 -0
  63. package/dist/mdruntime/save.d.ts +42 -48
  64. package/dist/mdruntime/saves.d.ts +31 -0
  65. package/dist/mdruntime/search.d.ts +12 -82
  66. package/dist/mdruntime/seed.d.ts +11 -2
  67. package/dist/mdruntime/socket/admission.d.ts +6 -0
  68. package/dist/mdruntime/socket/answers.d.ts +5 -0
  69. package/dist/mdruntime/socket/lanes.d.ts +19 -0
  70. package/dist/mdruntime/socket/session.d.ts +37 -0
  71. package/dist/mdruntime/socket.d.ts +66 -0
  72. package/dist/mdruntime/source.d.ts +60 -0
  73. package/dist/mdruntime/status.d.ts +4 -5
  74. package/dist/mdruntime/store/installs.d.ts +29 -0
  75. package/dist/mdruntime/store/readiness.d.ts +9 -0
  76. package/dist/mdruntime/store/records.d.ts +209 -0
  77. package/dist/mdruntime/store/room-held.d.ts +7 -0
  78. package/dist/mdruntime/store/space.d.ts +10 -0
  79. package/dist/mdruntime/store/watchers.d.ts +16 -0
  80. package/dist/mdruntime/store/writes.d.ts +23 -0
  81. package/dist/mdruntime/store.d.ts +109 -150
  82. package/dist/mdruntime/stored.d.ts +155 -0
  83. package/dist/mdruntime/surface.d.ts +87 -0
  84. package/dist/mdruntime/tables.d.ts +411 -0
  85. package/dist/mdruntime/tallies.d.ts +17 -0
  86. package/dist/mdruntime/transfer.d.ts +0 -5
  87. package/dist/mdruntime/wire.d.ts +54 -10
  88. package/dist/session-content/bounds.d.ts +7 -0
  89. package/dist/session-content/check.d.ts +18 -0
  90. package/dist/session-content/index.d.ts +7 -0
  91. package/dist/session-content/parts.d.ts +102 -0
  92. package/dist/session-content/state.d.ts +61 -0
  93. package/dist/session-content/turn.d.ts +328 -0
  94. package/dist/test-host.d.ts +7 -4
  95. package/dist/test-host.js +19 -29
  96. package/docs/families.md +69 -56
  97. package/package.json +8 -3
  98. package/dist/calls.d.ts +0 -118
  99. package/dist/calls.js +0 -1
  100. package/dist/mdmodel/blocks.d.ts +0 -10
  101. package/dist/mdmodel/condition.d.ts +0 -149
  102. package/dist/mdmodel/profile.d.ts +0 -5
  103. package/dist/mdruntime/acquisition.d.ts +0 -13
  104. package/dist/mdruntime/connection.d.ts +0 -141
  105. package/dist/mdruntime/file.d.ts +0 -19
  106. package/dist/mdruntime/rows.d.ts +0 -37
  107. package/dist/mdruntime/shared.d.ts +0 -10
  108. package/dist/mdruntime/turn.d.ts +0 -6
@@ -1,11 +1,17 @@
1
1
  import type { MdRuntimeClient } from './mdruntime/client.js';
2
- import type { HouseActivation, HouseAnalyticsChoice, HouseAppMessage, HouseExternalAnswer, HouseExternalRequest, HouseNavigationMode, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab, HouseTask } from './index.js';
2
+ import type { HouseAnalyticsChoice, HouseAppMessage, HouseChatOptions, HouseExternalAnswer, HouseExternalRequest, HouseNavigationMode, HouseRefusal, HouseSourceDownload, HouseSourceTop, HouseStatus, HouseTab } from './index.js';
3
3
  export interface HouseBridgeNavigation {
4
4
  readonly mode: HouseNavigationMode;
5
5
  readonly address: string;
6
6
  }
7
+ export interface HouseBridgeChat {
8
+ readonly element: object;
9
+ readonly options: HouseChatOptions;
10
+ readonly mounted: boolean;
11
+ }
7
12
  export interface HouseBridgeTestHost {
8
13
  readonly navigations: readonly HouseBridgeNavigation[];
14
+ readonly chats: readonly HouseBridgeChat[];
9
15
  readonly ceremonies: readonly string[];
10
16
  readonly consents: readonly HouseAnalyticsChoice[];
11
17
  readonly tabs: readonly HouseTab[];
@@ -15,9 +21,6 @@ export interface HouseBridgeTestHost {
15
21
  publish(status: HouseStatus): void;
16
22
  message(message: HouseAppMessage): void;
17
23
  attachRuntime(runtime: MdRuntimeClient): void;
18
- checkpoint(): Promise<HouseTask>;
19
- restore(task: HouseTask | null): Promise<boolean>;
20
- settle(activation: HouseActivation): void;
21
24
  }
22
25
  export interface HouseBridgeTestHostOptions {
23
26
  readonly address?: string;
package/dist/test-host.js CHANGED
@@ -50,6 +50,7 @@ export function createHouseBridgeTestHost(options = {}) {
50
50
  const consents = [];
51
51
  const tabs = [];
52
52
  const externalCalls = [];
53
+ const chats = [];
53
54
  const addressListeners = new Set();
54
55
  const statusListeners = new Set();
55
56
  const messageListeners = new Set();
@@ -57,7 +58,6 @@ export function createHouseBridgeTestHost(options = {}) {
57
58
  let published = options.status ?? null;
58
59
  let shown = null;
59
60
  let seen = null;
60
- let cooperation = null;
61
61
  let attached = () => { };
62
62
  const runtime = new Promise((resolve) => {
63
63
  attached = resolve;
@@ -99,7 +99,21 @@ export function createHouseBridgeTestHost(options = {}) {
99
99
  });
100
100
  }
101
101
  const bridge = {
102
- runtime,
102
+ runtime: runtime,
103
+ chat: {
104
+ mount(element, options = {}) {
105
+ const chat = { element, options, mounted: true };
106
+ chats.push(chat);
107
+ return Promise.resolve({
108
+ update(next) {
109
+ chat.options = next;
110
+ },
111
+ unmount() {
112
+ chat.mounted = false;
113
+ },
114
+ });
115
+ },
116
+ },
103
117
  address: () => shown,
104
118
  onAddress(listener) {
105
119
  return followHeld(addressListeners, listener, () => shown);
@@ -115,7 +129,7 @@ export function createHouseBridgeTestHost(options = {}) {
115
129
  },
116
130
  install: () => Promise.resolve('manual'),
117
131
  notifications: () => Promise.resolve('unavailable'),
118
- setBadge: () => Promise.resolve(),
132
+ telegram: () => Promise.resolve({ state: 'unavailable', name: null, username: null }),
119
133
  setTab(tab) {
120
134
  tabs.push(tab);
121
135
  },
@@ -145,25 +159,15 @@ export function createHouseBridgeTestHost(options = {}) {
145
159
  consents.push(choice);
146
160
  publish({ ...published, analytics: { measures: true, choice } });
147
161
  },
148
- cooperate(given) {
149
- cooperation = given;
150
- return () => {
151
- if (cooperation === given)
152
- cooperation = null;
153
- };
154
- },
162
+ cooperate: () => () => { },
155
163
  };
156
- function cooperating() {
157
- if (cooperation === null)
158
- throw new Error('the App registered no cooperation');
159
- return cooperation;
160
- }
161
164
  Object.defineProperty(globalThis, 'houseBridge', { value: bridge, configurable: true });
162
165
  if (published !== null)
163
166
  publish(published);
164
167
  arrive(current);
165
168
  return {
166
169
  navigations,
170
+ chats,
167
171
  ceremonies,
168
172
  consents,
169
173
  tabs,
@@ -182,19 +186,5 @@ export function createHouseBridgeTestHost(options = {}) {
182
186
  attachRuntime(client) {
183
187
  attached(client);
184
188
  },
185
- async checkpoint() {
186
- const held = cooperating();
187
- await held.checkpoint();
188
- await held.persist();
189
- return JSON.parse(JSON.stringify((await held.capture()) ?? null));
190
- },
191
- async restore(task) {
192
- const held = cooperating();
193
- await held.restore(task);
194
- return (await held.ready()) === true;
195
- },
196
- settle(activation) {
197
- cooperating().settle(activation);
198
- },
199
189
  };
200
190
  }
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,17 +58,21 @@
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`.
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
+ - **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`.
74
+ - **Site image read** - given a Published Room and the Path of one of its
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.
62
77
  - **App release code** - `sourceTop(app, release)` answers the top level of
63
78
  the latest successful release of an App the User may use: its folders, its
@@ -66,25 +81,24 @@
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
87
- a body of at most 32 KiB of JSON; House fills in the App and relays it only
100
+ `call('apps/messages/send', { to, body })` with the recipient's User id and
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)`
90
104
  answers the image this browser captured of that App's screen the first time
@@ -96,30 +110,29 @@
96
110
  after its latest release, as a JPEG `Blob`, or `null` when House holds none
97
111
  or does not answer. A Site's own renderer reads none.
98
112
 
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')`.
113
+ - **Chat** - `chat.mount(element, options)` places House's Chat, the one chat
114
+ in which the User's Agent conversations show, in `element` over the page's
115
+ `runtime` client, and resolves to a handle: `update(options)` replaces its
116
+ options and `unmount()` removes it. House serves the Chat with the page and
117
+ keeps it current, so the App installs and bundles nothing for it. The
118
+ options: `conversation` opens one, `null` for a new chat, `agent` is the
119
+ Agent a new chat goes to, `showChats` adds its conversation list, `width` is
120
+ `full`, the element, or `3/4`, `1/2` or `1/3` of the window docked at its
121
+ right edge, `onOpen` hears each conversation it opens as
122
+ `{ conversation, agent }`, and `onLink` takes a link without a scheme in
123
+ place of the browser. CSS custom properties named `--chat-*` on the element
124
+ or an ancestor set its look. It shows conversations only to a release that
125
+ declares them. A Site and the House panel have none: their call rejects with
126
+ an error named and coded `NotSupportedError`, with `retryable` false.
127
+
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.
123
136
 
124
137
  ## The test host
125
138
 
@@ -141,9 +154,9 @@ records in `tabs` each `setTab`, answers a release code read from the
141
154
  by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
142
155
  given by Site identifier, answers every `install()` `'manual'`, as a browser
143
156
  with no install prompt does, answers every `notifications()` `'unavailable'`,
144
- as a browser without push does, settles every `setBadge`, delivers each App
157
+ as a browser without push does, records in `chats`
158
+ each Chat `chat.mount` places, with its `element`, the `options` it was last
159
+ given and whether it is still `mounted`, drawing nothing, delivers each App
145
160
  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.
161
+ Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
162
+ never calls `placed()`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-ca559eade7c19",
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-ca61ac777c0b7",
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",
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;