@agentshouse/mdruntime 0.1.0-ce531b51ff088 → 0.1.0-cf24798931067

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 (132) hide show
  1. package/AGENTS.md +110 -27
  2. package/README.md +11 -10
  3. package/dist/adapter.d.ts +65 -28
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js +1 -9
  6. package/dist/attached-model.d.ts +11 -0
  7. package/dist/attached-model.d.ts.map +1 -0
  8. package/dist/attached-model.js +47 -0
  9. package/dist/attempt.d.ts +16 -0
  10. package/dist/attempt.d.ts.map +1 -0
  11. package/dist/attempt.js +57 -0
  12. package/dist/bootstrap.d.ts +20 -6
  13. package/dist/bootstrap.d.ts.map +1 -1
  14. package/dist/bootstrap.js +89 -35
  15. package/dist/change-set.d.ts.map +1 -1
  16. package/dist/change-set.js +13 -7
  17. package/dist/change.d.ts +4 -0
  18. package/dist/change.d.ts.map +1 -1
  19. package/dist/chat/acts.d.ts +34 -0
  20. package/dist/chat/acts.d.ts.map +1 -0
  21. package/dist/chat/acts.js +36 -0
  22. package/dist/chat/messages.d.ts +21 -0
  23. package/dist/chat/messages.d.ts.map +1 -0
  24. package/dist/chat/messages.js +151 -0
  25. package/dist/chat/overlay.d.ts +31 -0
  26. package/dist/chat/overlay.d.ts.map +1 -0
  27. package/dist/chat/overlay.js +97 -0
  28. package/dist/chat/parts.d.ts +57 -0
  29. package/dist/chat/parts.d.ts.map +1 -0
  30. package/dist/chat/parts.js +119 -0
  31. package/dist/chat/process.d.ts +20 -0
  32. package/dist/chat/process.d.ts.map +1 -0
  33. package/dist/chat/process.js +32 -0
  34. package/dist/chat/provider.d.ts +57 -0
  35. package/dist/chat/provider.d.ts.map +1 -0
  36. package/dist/chat/provider.js +637 -0
  37. package/dist/chat/questions.d.ts +31 -0
  38. package/dist/chat/questions.d.ts.map +1 -0
  39. package/dist/chat/questions.js +111 -0
  40. package/dist/chat/read.d.ts +5 -0
  41. package/dist/chat/read.d.ts.map +1 -0
  42. package/dist/chat/read.js +13 -0
  43. package/dist/chat.d.ts +7 -0
  44. package/dist/chat.d.ts.map +1 -0
  45. package/dist/chat.js +2 -0
  46. package/dist/client.d.ts +11 -7
  47. package/dist/client.d.ts.map +1 -1
  48. package/dist/client.js +58 -25
  49. package/dist/collection.d.ts +6 -11
  50. package/dist/collection.d.ts.map +1 -1
  51. package/dist/collection.js +56 -19
  52. package/dist/connection.d.ts +21 -16
  53. package/dist/connection.d.ts.map +1 -1
  54. package/dist/connection.js +713 -587
  55. package/dist/conversation.d.ts +28 -8
  56. package/dist/conversation.d.ts.map +1 -1
  57. package/dist/conversation.js +222 -81
  58. package/dist/expectation.d.ts +21 -0
  59. package/dist/expectation.d.ts.map +1 -0
  60. package/dist/expectation.js +70 -0
  61. package/dist/failure.d.ts +13 -0
  62. package/dist/failure.d.ts.map +1 -0
  63. package/dist/failure.js +19 -0
  64. package/dist/host.d.ts +8 -1
  65. package/dist/host.d.ts.map +1 -1
  66. package/dist/host.js +39 -39
  67. package/dist/identity.d.ts +2 -0
  68. package/dist/identity.d.ts.map +1 -1
  69. package/dist/identity.js +10 -1
  70. package/dist/index.d.ts +7 -4
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +2 -0
  73. package/dist/memory.d.ts +12 -5
  74. package/dist/memory.d.ts.map +1 -1
  75. package/dist/memory.js +108 -36
  76. package/dist/model.d.ts +13 -12
  77. package/dist/model.d.ts.map +1 -1
  78. package/dist/model.js +6 -3
  79. package/dist/observation.d.ts +2 -0
  80. package/dist/observation.d.ts.map +1 -1
  81. package/dist/observation.js +24 -14
  82. package/dist/open.d.ts +2 -0
  83. package/dist/open.d.ts.map +1 -0
  84. package/dist/open.js +1 -0
  85. package/dist/outcome.d.ts +22 -3
  86. package/dist/outcome.d.ts.map +1 -1
  87. package/dist/outcome.js +35 -1
  88. package/dist/overlay.d.ts +1 -1
  89. package/dist/overlay.d.ts.map +1 -1
  90. package/dist/overlay.js +19 -15
  91. package/dist/paths.d.ts +0 -1
  92. package/dist/paths.d.ts.map +1 -1
  93. package/dist/paths.js +0 -16
  94. package/dist/query.d.ts +10 -3
  95. package/dist/query.d.ts.map +1 -1
  96. package/dist/query.js +78 -36
  97. package/dist/reach.d.ts +40 -0
  98. package/dist/reach.d.ts.map +1 -0
  99. package/dist/reach.js +272 -0
  100. package/dist/react.d.ts +41 -0
  101. package/dist/react.d.ts.map +1 -0
  102. package/dist/react.js +64 -0
  103. package/dist/read-side.d.ts +4 -0
  104. package/dist/read-side.d.ts.map +1 -1
  105. package/dist/read-side.js +116 -54
  106. package/dist/refresh.d.ts +12 -1
  107. package/dist/refresh.d.ts.map +1 -1
  108. package/dist/refresh.js +35 -22
  109. package/dist/replica.d.ts +6 -6
  110. package/dist/replica.d.ts.map +1 -1
  111. package/dist/replica.js +53 -39
  112. package/dist/room-draft.d.ts +11 -8
  113. package/dist/room-draft.d.ts.map +1 -1
  114. package/dist/room-draft.js +19 -26
  115. package/dist/rows.d.ts +4 -1
  116. package/dist/rows.d.ts.map +1 -1
  117. package/dist/rows.js +82 -39
  118. package/dist/save.d.ts +4 -3
  119. package/dist/save.d.ts.map +1 -1
  120. package/dist/save.js +127 -68
  121. package/dist/search.d.ts +3 -2
  122. package/dist/search.d.ts.map +1 -1
  123. package/dist/status.d.ts +2 -2
  124. package/dist/status.d.ts.map +1 -1
  125. package/dist/status.js +0 -8
  126. package/dist/store.d.ts +26 -2
  127. package/dist/store.d.ts.map +1 -1
  128. package/dist/store.js +206 -90
  129. package/dist/wire.d.ts +56 -19
  130. package/dist/wire.d.ts.map +1 -1
  131. package/dist/wire.js +63 -61
  132. package/package.json +14 -2
package/AGENTS.md CHANGED
@@ -10,7 +10,16 @@ App code reaches the MD Runtime through the remote client. The surfaces are
10
10
  Rooms, Query, Search, Observe, Types, Room Draft, Save, History, Call, Reached, Log,
11
11
  the reported persistence answer, reauthorization, conversation, the chat draft,
12
12
  and Presentation State. Sync Status, the Service Mode, the storage-loss
13
- statement and the deployment facts are observations only.
13
+ statement, the deployment facts and the signed-in member are observations only.
14
+
15
+ The host attaches each port with its reach, and every member and observation
16
+ answers within it: a Room outside it answers as one the replica does not hold,
17
+ Rooms lists only the Rooms reached whole, a Room reached for single Documents
18
+ shows only those Documents and the Types of the models that govern them, and
19
+ without conversations the conversation members, the chat draft and the
20
+ conversation observation hold none.
21
+ A change of the reach reaches every open observation as its new value, a query
22
+ keeping every unchanged Document the same object.
14
23
 
15
24
  Every `observe` resolves, once its first value has arrived, to a handle:
16
25
  `current()` is the latest complete value, `subscribe(listener)` hears each later
@@ -18,7 +27,13 @@ value whole and returns its unsubscribe, and `close()` ends the observation.
18
27
  Closing the port ends every handle and rejects every pending call and
19
28
  observation; a client that reconnects observes again.
20
29
 
21
- Each conversation a Provider card names is held complete in the browser.
30
+ `observe('agents')` answers every Agent a new conversation can go to, each
31
+ `{ identity, name }`, whether or not it has a conversation yet.
32
+ Each conversation the Provider's conversation list names is held complete in the
33
+ browser. `conversation.list()` and `observe('conversations')` answer each with its
34
+ Agent's identity and name, its name, created and finished times, last outcome and live
35
+ `state`: `asking` while a question waits, `working` while a turn runs, else `idle`,
36
+ and `started`, when the running turn began, or `null`.
22
37
  Observe one with `observe('conversation', id, { limit })`: the view
23
38
  holds its latest `limit` messages, or all of them, oldest first, its chat
24
39
  draft, and what the Provider streams for it whether or not anything views it:
@@ -38,21 +53,42 @@ open one through the Provider Action that serves it.
38
53
 
39
54
  Rooms, Query, Search, Observe, Types, Room Draft, Save, and Reached never
40
55
  touch the network.
41
- History and Call go to the Provider through the Adapter. A Call result whose
56
+ History and Call go to the Provider through the Adapter. Call takes the Action names
57
+ the Adapter declares; any other name answers `undeclared` without reaching the
58
+ Provider. A Call result whose
42
59
  effect the Provider places in a Room carries `at`, that Room and Room Version;
43
60
  `reached(room, roomVersion)` answers whether the Room's confirmed state has
44
61
  reached it, and the MD Runtime keeps refreshing that Room until it has;
45
62
  `reached(room, roomVersion, path)` answers whether the held confirmed copy of
46
63
  that document was written at a later Room Version. Each History revision
47
- names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`. Every
64
+ names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`.
65
+ History of a Path no current document holds answers the removed document's
66
+ revisions with `deleted: true`, newest first; that revision is what a link to
67
+ the Path opens. Every
48
68
  member of the
49
69
  client is asynchronous. Results are detached snapshots. Nothing in this
50
70
  surface returns the authorization, performs a request the App's code
51
71
  composes, or exposes the browser store.
52
72
 
73
+ Every refusal and failure carries `code` and `retryable`: each Call and History answer
74
+ other than its result, a refused Save or Room Draft write, a returned Room Draft's
75
+ reason, a Room's refusal and the Connection Refusal, and every error a member rejects
76
+ with, beside its message. A Provider refusal carries the Provider's own `retryable`.
77
+ Every code and every value the API answers is open: handle one you do not know by its
78
+ `code` and `retryable`.
79
+
53
80
  Read the deployment facts with `observe('deployment-facts')`. Interpret the
54
81
  opaque value using the host's contract.
55
82
 
83
+ `observe('member')` answers who uses the App: the User the Provider signed in,
84
+ `{ kind: 'user', id, name }` in the shape of a change's `author`, so a Document
85
+ whose `change.author.id` equals its `id` is that User's own. It is `null` until
86
+ the Provider first names one, and where it names none, such as a Site. The
87
+ MD Runtime keeps it with the Local Replicas, so it answers offline once known,
88
+ and every port hears the next member the Provider names; signing out answers
89
+ `null`, then ends the observation with the authorization. It is the only way App code learns who
90
+ uses it.
91
+
56
92
  The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
57
93
  ships in no bundle.
58
94
 
@@ -66,22 +102,28 @@ data:
66
102
  - **Filter.** `rooms` names Room locators and defaults to every Room. `types`
67
103
  names MD Types, and `any` names untyped Markdown Documents. `pathPrefix` is a
68
104
  directory: `notes` keeps `notes/a.md` and not `notes2/a.md`.
69
- - **Fields.** `where` names frontmatter fields, ANDs them, and nests `$and` and
70
- `$or`. A bare value is equality; the operators are `$eq`, `$ne`, `$in`, `$nin`,
71
- `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size` and `$exists`. Equality on a list
72
- asks whether it contains the value. Missing, null and empty differ:
105
+ - **Fields.** Every frontmatter value is named by JSON Pointer: `/status`,
106
+ `/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that
107
+ meets a list applies to every item and a number names one item. `where` names
108
+ pointers, ANDs them, and nests `$and` and `$or`; a pointer through a list holds
109
+ when any item satisfies it. A bare value is equality; the operators are `$eq`,
110
+ `$ne`, `$in`, `$nin`, `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size` and
111
+ `$exists`. Equality on a list asks whether it contains the value. Missing, null and empty differ:
73
112
  `$exists: false` keeps a missing field, `null` an explicit null, `''` empty
74
113
  text and `$size: 0` an empty list. A date compares in calendar order and never
75
114
  with a date-time. A reference compares by the Room Path it resolves to.
76
- Untyped frontmatter is plain values. There is no text containment or regular
115
+ Untyped frontmatter, and a value under `oneOf` or a conditional, is plain
116
+ values. There is no text containment or regular
77
117
  expression.
78
118
  - **Relations.** `hop: { field, types, where, pathPrefix }` keeps Documents whose
79
- reference `field` points to a matching Document of the same Room.
80
- `backlinks: { field, types, where, pathPrefix }` keeps Documents that a
119
+ reference at pointer `field`, at any depth, points to a matching Document of the
120
+ same Room. `backlinks: { field, types, where, pathPrefix }` keeps Documents that a
81
121
  matching Document of the same Room references. Each keeps a Document once.
82
122
  - **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
83
- `preamble`, `markdown`, `backlinks` and `change`, where `fields` and `sections`
84
- are `'all'` or a list of names. Room and Path always return; a Markdown
123
+ `preamble`, `markdown`, `backlinks` and `change`, where `fields` is `'all'` or a
124
+ list of pointers and `sections` `'all'` or a list of names. Selected pointers
125
+ return the frontmatter holding only them, nested as written. A backlink names
126
+ the referring Path, MD Type and the pointer it came from as `field`. Room and Path always return; a Markdown
85
127
  Document also returns its MD Type. A non-Markdown Document or binary link
86
128
  target returns only Room and Path. An unselected part is absent. Select only
87
129
  what a screen shows: a list that selects the Markdown hears every edit of it.
@@ -90,17 +132,17 @@ data:
90
132
  or `null` for a write the Provider made itself, and `time` is the Provider's
91
133
  ISO 8601 change time. It is `null` where the Provider delivered no time, as at
92
134
  a Site. An unsent edit or move keeps it, an unsent creation has none, and a
93
- saved write takes the Provider's own once it is Accepted and refreshed. A
135
+ saved write takes the Provider's own once it is Accepted. A
94
136
  Room's last change is its Document with the latest `time`.
95
137
  - **Order and groups.** `orderBy` sorts by `room`, `path`, `type` or `{ field }`
96
138
  with TanStack DB's own options, and ties end with Room, then Path. `groupBy` by
97
139
  `room`, `type` or `{ field }` answers `{ groups: [{ key, count }] }`, counted
98
- over every match and ordered by `count` or a key. `limit` bounds the Documents
99
- or the groups.
140
+ over every match and ordered by `count` or a key. A sort or group takes only a
141
+ pointer that holds one value. `limit` bounds the Documents or the groups.
100
142
  - **Results and errors.** A result carries no Room Version: read freshness from
101
- Rooms and Sync Status. An invalid query fails with `invalid-query`,
102
- `unknown-type`, `unknown-field` or `wrong-kind`, naming where, and never
103
- answers an empty result in its place.
143
+ Rooms and Sync Status. An invalid query fails with the `code`
144
+ `invalid-query`, `unknown-type`, `unknown-field` or `wrong-kind`, naming where,
145
+ and never answers an empty result in its place.
104
146
 
105
147
  ## Local Search rules
106
148
 
@@ -138,9 +180,9 @@ the current Room Draft; read it and write again.
138
180
 
139
181
  Save takes one Room and the Room Drafts of it to save, each with its revision,
140
182
  validates locally, and on success appends one Change Batch to that Room's
141
- queue and removes those Room Drafts. It is refused as `stale`, as
183
+ queue and removes those Room Drafts. It is refused with the `code` `stale`,
142
184
  `changed-underneath` naming each part whose base no longer matches the visible
143
- state, or by a local validation rule, and then creates nothing and leaves every
185
+ state, or a local validation rule, and then creates nothing and leaves every
144
186
  Room Draft in place. A directory move or removal is a move or removal part on
145
187
  each Document and binary link target beneath it, saved together.
146
188
 
@@ -160,6 +202,13 @@ it names; the MD Runtime retries the same Change Batch identity and payload and
160
202
  never infers an outcome from transport uncertainty. The MD Runtime never
161
203
  combines, reorders, or rebases.
162
204
 
205
+ On a Site, every Save stays in the visitor's browser. Write grants and
206
+ revisions do not refuse it, and its Pending Change shows in every query and
207
+ across reloads until the browser's storage is cleared. It is never sent:
208
+ `observe('queue', room)` shows it `local`, and Sync Status never waits on it.
209
+ Once the Room changes so that it no longer applies, it leaves the queue and
210
+ returns no Room Draft.
211
+
163
212
  `observe('service-mode')` answers the Provider's Service
164
213
  Mode, `open` or `write-halted`. While writes are halted, Save still succeeds,
165
214
  its Change Batch waits unsent, and the queue is submitted in order once the
@@ -193,13 +242,47 @@ an App's override respected. What an App Creator's agent adds carries none
193
242
  of these promises by itself. Reading, querying and searching never wait for
194
243
  the network. Data lives only in the App Creator's browser and with the Provider.
195
244
 
196
- ## App code imports only the client entry and never constructs a Runtime
245
+ ## App code takes the client its host hands it and never constructs a Runtime
246
+
247
+ App code takes the client its host hands it: in House,
248
+ `houseBridge().runtime` from `@agentshouse/app-bridge` resolves to the
249
+ client House built into the page. It never constructs a Runtime or a client.
250
+ It imports only types from `@agentshouse/mdruntime/client`, does not call
251
+ `connectMdRuntime` or `serveMdRuntime`, and does not import the package main,
252
+ the host entry, or the Adapter package. Hosts and tests use those entries; the
253
+ served App does not.
254
+
255
+ A React App may observe and save through `@agentshouse/mdruntime/react`, which
256
+ names React as a peer dependency. `useObserve(client, topic, ...input)` takes
257
+ the arguments of `observe` and returns `{ state: 'loading' }` until the topic's
258
+ first value arrives, then `{ state: 'ready', value }`, re-rendering on each
259
+ change; a `null` client observes nothing and stays loading. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
260
+ `save(room, roomDrafts)`, which writes each Path's parts onto the Room Draft
261
+ already there, keeping the bases its parts have, or onto a new one, and saves
262
+ them together. A refused Save leaves the Room Drafts for the App to save again
263
+ or discard; a failure is recorded and rejects. `saveRoomDrafts(client, room,
264
+ roomDrafts)` is that save outside a component. A react-admin or Refine App
265
+ reads and writes its Rooms through the data providers of
266
+ `@agentshouse/mdruntime-families`.
267
+
268
+ ## The Chat
197
269
 
198
- App code imports only `@agentshouse/mdruntime/client` and calls
199
- `connectMdRuntime` on the port the host hands it. It never constructs a
200
- Runtime. It does not import the package main, the host entry, or the Adapter
201
- package, and it does not call `serveMdRuntime`. Hosts
202
- and tests use those entries; the served App does not.
270
+ `@agentshouse/mdruntime/chat` holds the Chat: one data layer over the
271
+ conversations, the same for every App. React and `@assistant-ui/react` are
272
+ required peers of this entry, so every App that uses it adds React as a
273
+ dependency, also an App not written in React. Wrap your own assistant-ui
274
+ primitives in `<ChatProvider client={runtime} conversation={id} agent={agent}>`:
275
+ `conversation` is the one it opens, `null` for a new chat, `agent` the Agent a
276
+ new chat goes to, and `onOpen` hears each conversation it opens. Thread, Messages,
277
+ Composer, its attachments and the thread list run on it: sending with files, a
278
+ message sent mid-turn waiting in the queue, Stop, rename, Done as archive and
279
+ delete. `useChat()` gives the rest: `send`, through the same queue, the
280
+ conversations, the Agents, the open
281
+ questions to `answer`, the CLI's `options` to `choose` and `commands`, the queue
282
+ to `edit` or `unqueue`, `kill`, and each act's outcome. A sent message shows at
283
+ once until House keeps it, and the unsent text stays in the chat draft, the same
284
+ in every composer over that conversation. A secret
285
+ question is never answered here. Never replace its messages, sending or store.
203
286
 
204
287
  ## What an agent must never do
205
288
 
package/README.md CHANGED
@@ -12,22 +12,23 @@ npm install @agentshouse/mdruntime
12
12
 
13
13
  ## Entries
14
14
 
15
- | Entry | For |
16
- | ------------------------------- | -------------------------------------------------- |
17
- | `@agentshouse/mdruntime/client` | App code: `connectMdRuntime(port)` |
18
- | `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime` |
19
- | `@agentshouse/mdruntime` | Shared types |
20
- | `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter |
15
+ | Entry | For |
16
+ | ------------------------------- | ---------------------------------------------------------------- |
17
+ | `@agentshouse/mdruntime/client` | The host's client: `connectMdRuntime(port)` |
18
+ | `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime` |
19
+ | `@agentshouse/mdruntime` | Shared types |
20
+ | `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter |
21
+ | `@agentshouse/mdruntime/react` | React over the client: `useObserve`, `useSave`, `saveRoomDrafts` |
22
+ | `@agentshouse/mdruntime/chat` | The Chat on assistant-ui: `ChatProvider`, `useChat` |
21
23
 
22
24
  ## Usage
23
25
 
24
- App code imports only the client entry and connects on the port its host hands
25
- it:
26
+ App code takes the client its host hands it; in House the App bridge hands it:
26
27
 
27
28
  ```ts
28
- import { connectMdRuntime } from '@agentshouse/mdruntime/client';
29
+ import { houseBridge } from '@agentshouse/app-bridge';
29
30
 
30
- const runtime = connectMdRuntime(port);
31
+ const runtime = await houseBridge().runtime;
31
32
  const rooms = await runtime.rooms();
32
33
  const notes = await runtime.query({ types: ['note'], select: 'all', limit: 20 });
33
34
  ```
package/dist/adapter.d.ts CHANGED
@@ -1,15 +1,13 @@
1
- import type { ModelIdentity, ModelResult } from './model.js';
1
+ import type { ModelResult } from './model.js';
2
+ import type { Open } from './open.js';
2
3
  import type { ChangeBatch } from './change.js';
3
4
  export type Authorization = object;
4
- export declare const ROOM_CONTRACT_VERSION = 1;
5
- export declare const VERSION_1_CAPABILITIES: readonly ['stable-file-ids', 'ranked-provider-search', 'room-version-notifications', 'room-history', 'provider-actions', 'move-reference-rewrites'];
6
5
  export type MdModelIdentity = {
7
6
  identity: string;
8
7
  version: string;
9
8
  };
10
9
  export type TypedSelection = {
11
10
  roots: readonly string[];
12
- attachedModel: ModelIdentity | null;
13
11
  };
14
12
  export type OperationScopes = {
15
13
  read: readonly string[];
@@ -19,15 +17,15 @@ export type OperationScopes = {
19
17
  };
20
18
  export type ReplicaAdmission = {
21
19
  selection: string;
22
- admission: 'admitted' | 'unavailable';
20
+ admission: Open<'admitted' | 'unavailable'>;
23
21
  };
24
22
  export type DiscoveredRoom = {
25
23
  name: string;
26
24
  locator: string;
25
+ handle: string;
27
26
  roomVersion: string;
28
27
  operations: OperationScopes;
29
28
  replica: ReplicaAdmission;
30
- attachedModel: ModelIdentity | null;
31
29
  typedSelection?: TypedSelection;
32
30
  providerOwnedPaths: readonly string[];
33
31
  };
@@ -35,13 +33,22 @@ export type Capability = {
35
33
  name: string;
36
34
  limits?: readonly ProviderLimit[];
37
35
  actions?: readonly ActionDeclaration[];
38
- conversationCards?: ConversationCards;
36
+ conversationAgents?: ConversationAgents;
39
37
  };
40
- export type ConversationCards = {
38
+ export type ConversationAgents = {
41
39
  locator: string;
42
40
  type: string;
43
41
  identity: string;
42
+ name: string;
43
+ retired?: string;
44
+ };
45
+ export type ListedConversation = {
46
+ conversation: string;
44
47
  agent: string;
48
+ name: string;
49
+ created: string;
50
+ finished: string | null;
51
+ outcome: string | null;
45
52
  };
46
53
  export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.answer' | 'conversation.interrupt' | 'conversation.kill' | 'conversation.cancel' | 'conversation.delete' | 'conversation.history';
47
54
  export type ConversationMessage = {
@@ -72,6 +79,9 @@ export type TurnContext = {
72
79
  window: number;
73
80
  };
74
81
  export type TurnOperation = {
82
+ op: 'begin';
83
+ at: string;
84
+ } | {
75
85
  op: 'start';
76
86
  index: number;
77
87
  part: unknown;
@@ -159,6 +169,15 @@ export type ConversationEvent = {
159
169
  } | {
160
170
  kind: 'gap';
161
171
  conversation: string;
172
+ } | {
173
+ kind: 'list';
174
+ entries: readonly ListedConversation[];
175
+ } | {
176
+ kind: 'listed';
177
+ entry: ListedConversation;
178
+ } | {
179
+ kind: 'unlisted';
180
+ conversation: string;
162
181
  };
163
182
  export type ConversationStream = {
164
183
  replicate(conversations: readonly string[]): void;
@@ -186,12 +205,11 @@ export type Retention = {
186
205
  };
187
206
  export type Discovery = {
188
207
  kind: 'discovery';
189
- supportedVersions: readonly number[];
190
- mdModel: MdModelIdentity;
191
208
  rooms: readonly DiscoveredRoom[];
192
209
  capabilities: readonly Capability[];
193
210
  providerLimits: readonly ProviderLimit[];
194
211
  retention: Retention;
212
+ member?: Member;
195
213
  };
196
214
  export type TransportUncertainty = {
197
215
  kind: 'transport-uncertainty';
@@ -206,11 +224,12 @@ export type RevokedAuthorization = {
206
224
  export type ProviderRefusal = {
207
225
  code: string;
208
226
  fields: Readonly<Record<string, unknown>>;
227
+ retryable: boolean;
209
228
  };
210
229
  export type ScopedRefusal = ProviderRefusal & {
211
230
  kind: 'scoped-refusal';
212
231
  locator: string;
213
- scope: 'content' | 'sync' | 'model' | 'operation' | 'undisclosed';
232
+ scope: Open<'content' | 'sync' | 'model' | 'operation' | 'undisclosed'>;
214
233
  };
215
234
  export type AdapterFailure = TransportUncertainty | RoomNotReadable | RevokedAuthorization | ScopedRefusal;
216
235
  export type ContractUnavailable = ProviderRefusal & {
@@ -227,6 +246,9 @@ export type ChangeAuthor = {
227
246
  id: string;
228
247
  name: string;
229
248
  };
249
+ export type Member = Extract<ChangeAuthor, {
250
+ kind: 'user';
251
+ }>;
230
252
  export type HeadChange = {
231
253
  author: ChangeAuthor | null;
232
254
  time: string;
@@ -243,9 +265,14 @@ export type BootstrapRequest = {
243
265
  selection: string;
244
266
  pageToken?: PageToken;
245
267
  };
268
+ export type RoomModels = {
269
+ collection?: ModelResult;
270
+ selection?: ModelResult;
271
+ };
246
272
  export type BootstrapPage = {
247
273
  kind: 'bootstrap';
248
274
  roomVersion: string;
275
+ models?: RoomModels;
249
276
  documents: Readonly<Record<string, string>>;
250
277
  revisions: Readonly<Record<string, string>>;
251
278
  changes: Readonly<Record<string, HeadChange>>;
@@ -258,12 +285,12 @@ export type RefreshRequest = {
258
285
  locator: string;
259
286
  selection: string;
260
287
  fromRoomVersion: string;
261
- minPosition?: string;
262
288
  pageToken?: PageToken;
263
289
  };
264
290
  export type RefreshPage = {
265
291
  kind: 'net-advancement';
266
292
  roomVersion: string;
293
+ models?: RoomModels;
267
294
  documents: Readonly<Record<string, string>>;
268
295
  revisions: Readonly<Record<string, string>>;
269
296
  changes: Readonly<Record<string, HeadChange>>;
@@ -286,7 +313,7 @@ export type RetryableRefusal = ProviderRefusal & {
286
313
  kind: 'retryable-refusal';
287
314
  reset?: string;
288
315
  };
289
- export type ServiceMode = 'open' | 'write-halted';
316
+ export type ServiceMode = Open<'open' | 'write-halted'>;
290
317
  export type ServiceModeSignal = {
291
318
  observe(notify: (mode: ServiceMode) => void): () => void;
292
319
  };
@@ -295,7 +322,9 @@ export type MutationResult = {
295
322
  roomVersion: string;
296
323
  documents: Readonly<Record<string, string>>;
297
324
  revisions: Readonly<Record<string, string>>;
325
+ changes: Readonly<Record<string, HeadChange>>;
298
326
  removals: readonly string[];
327
+ attachments?: readonly RoomAttachment[];
299
328
  author?: string;
300
329
  time?: string;
301
330
  } | (ProviderRefusal & {
@@ -333,6 +362,7 @@ export type HistoryResult = {
333
362
  kind: 'history';
334
363
  revisions: readonly HistoryRevision[];
335
364
  pageToken?: PageToken;
365
+ deleted?: true;
336
366
  } | {
337
367
  kind: 'revision';
338
368
  content: string;
@@ -354,27 +384,33 @@ export type ActionResult = {
354
384
  } | (ProviderRefusal & {
355
385
  kind: 'rejected';
356
386
  }) | AdapterFailure;
357
- export type ModelRequest = {
358
- locator: string;
359
- attached: 'collection';
360
- model: ModelIdentity | null;
361
- } | {
387
+ export type HeldRoom = {
362
388
  locator: string;
363
- attached: 'typed-selection';
364
- roots: readonly string[];
365
- model: ModelIdentity | null;
389
+ roomVersion: string;
390
+ documents: Readonly<Record<string, string>>;
391
+ revisions: Readonly<Record<string, string>>;
392
+ attachments: readonly RoomAttachment[];
366
393
  };
367
- export type RoomVersionNotification = {
394
+ export type RoomStreamEvent = {
395
+ kind: 'opened';
396
+ } | {
397
+ kind: 'closed';
398
+ revoked: boolean;
399
+ } | {
400
+ kind: 'opening';
401
+ expired: readonly string[];
402
+ } | {
403
+ kind: 'room-version';
368
404
  locator: string;
369
405
  roomVersion: string;
370
- modelChanged?: true;
371
406
  };
372
- export type SelectedRooms = {
373
- select(locators: readonly string[]): void;
374
- observe(notify: (notification: RoomVersionNotification) => void): () => void;
407
+ export type RoomStream = {
408
+ hold(rooms: readonly HeldRoom[]): void;
409
+ reopen(): void;
410
+ observe(notify: (event: RoomStreamEvent) => void): () => void;
375
411
  };
376
412
  export type Adapter = {
377
- model(authorization: Authorization, request: ModelRequest): Promise<ModelResult>;
413
+ readonly localSaves?: true;
378
414
  authorize(): Promise<Authorization>;
379
415
  discover(authorization: Authorization): Promise<DiscoverResult>;
380
416
  bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
@@ -383,7 +419,8 @@ export type Adapter = {
383
419
  history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
384
420
  action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
385
421
  reached(locator: string, roomVersion: string, target: string): boolean;
386
- roomVersions?: SelectedRooms;
422
+ follows(locator: string, roomVersion: string, next: string): boolean;
423
+ roomStream?: RoomStream;
387
424
  conversations?: ConversationStream;
388
425
  serviceMode?: ServiceModeSignal;
389
426
  };
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,eAAO,MAAM,sBAAsB,YACjC,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,cAAc,EACd,kBAAkB,EAClB,yBAAyB,CACjB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CACrC,CAAC;AA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,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACrE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC"}
package/dist/adapter.js CHANGED
@@ -1,9 +1 @@
1
- export const ROOM_CONTRACT_VERSION = 1;
2
- export const VERSION_1_CAPABILITIES = [
3
- 'stable-file-ids',
4
- 'ranked-provider-search',
5
- 'room-version-notifications',
6
- 'room-history',
7
- 'provider-actions',
8
- 'move-reference-rewrites',
9
- ];
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type ModelResult, type ModelState } from './model.js';
2
+ export type AttachedModel = {
3
+ state: ModelState;
4
+ refused: {
5
+ identity: string;
6
+ rule: string;
7
+ location?: string;
8
+ } | null;
9
+ };
10
+ export declare function attachedModel(answer: ModelResult, previous: ModelState): AttachedModel;
11
+ //# sourceMappingURL=attached-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attached-model.d.ts","sourceRoot":"","sources":["../src/attached-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAI1E,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACvE,CAAC;AAEF,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,GAAG,aAAa,CA4CtF"}
@@ -0,0 +1,47 @@
1
+ import { verify } from '@agentshouse/mdmodel';
2
+ import { MD_MODEL } from './collection.js';
3
+ import { sameModel } from './model.js';
4
+ const EMPTY_SCHEMA = { verdict: 'accept', model: { types: {} } };
5
+ export function attachedModel(answer, previous) {
6
+ if (answer.kind === 'model-unavailable') {
7
+ return { state: { status: 'unavailable', reason: answer.reason }, refused: null };
8
+ }
9
+ if (previous.status !== 'unavailable' &&
10
+ sameModel(previous.snapshot, answer.snapshot) &&
11
+ previous.snapshot.schema !== answer.snapshot.schema) {
12
+ return {
13
+ state: {
14
+ status: 'unavailable',
15
+ reason: 'invalid',
16
+ schema: answer.snapshot.schema,
17
+ revision: answer.snapshot.revision,
18
+ },
19
+ refused: null,
20
+ };
21
+ }
22
+ const verified = answer.snapshot.schema === null ? EMPTY_SCHEMA : verify(answer.snapshot.schema);
23
+ if (verified.verdict === 'refuse') {
24
+ return {
25
+ state: {
26
+ status: 'unavailable',
27
+ reason: 'invalid',
28
+ schema: answer.snapshot.schema,
29
+ revision: answer.snapshot.revision,
30
+ },
31
+ refused: {
32
+ identity: answer.snapshot.identity,
33
+ rule: verified.rule,
34
+ ...(verified.location === undefined ? {} : { location: verified.location }),
35
+ },
36
+ };
37
+ }
38
+ return {
39
+ state: {
40
+ status: 'current',
41
+ snapshot: structuredClone(answer.snapshot),
42
+ verifiedWith: MD_MODEL,
43
+ types: verified.model.types,
44
+ },
45
+ refused: null,
46
+ };
47
+ }
@@ -0,0 +1,16 @@
1
+ export type Answered = 'accepted' | 'refused' | 'unanswered' | 'offline';
2
+ export type Identities = {
3
+ of(intent: string): string;
4
+ settle(answered: Answered): void;
5
+ };
6
+ export declare function identities(mint?: () => string): Identities;
7
+ export declare function intentOf(name: string, about: unknown): string;
8
+ export type Attempt = {
9
+ identity(intent: string): string;
10
+ settle(answered: Answered, drop: (act: number) => void): void;
11
+ };
12
+ export type Attempts = {
13
+ begin(act: number): Attempt;
14
+ };
15
+ export declare function attempts(mint?: () => string): Attempts;
16
+ //# sourceMappingURL=attempt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../src/attempt.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAM,MAAoC,GAAG,UAAU,CAmBvF;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7D;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAyBtD"}