@agentshouse/mdruntime 0.1.0-cfbf80d8d4644 → 0.1.0-cfcf93be6310b

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 (187) hide show
  1. package/README.md +24 -11
  2. package/dist/adapter.d.ts +182 -47
  3. package/dist/adapter.d.ts.map +1 -1
  4. package/dist/attached-model.d.ts +5 -1
  5. package/dist/attached-model.d.ts.map +1 -1
  6. package/dist/attached-model.js +53 -6
  7. package/dist/attempt.d.ts +16 -0
  8. package/dist/attempt.d.ts.map +1 -0
  9. package/dist/attempt.js +70 -0
  10. package/dist/binary.d.ts +18 -0
  11. package/dist/binary.d.ts.map +1 -0
  12. package/dist/binary.js +8 -0
  13. package/dist/bootstrap.d.ts +33 -5
  14. package/dist/bootstrap.d.ts.map +1 -1
  15. package/dist/bootstrap.js +202 -48
  16. package/dist/chain.d.ts +11 -0
  17. package/dist/chain.d.ts.map +1 -0
  18. package/dist/chain.js +64 -0
  19. package/dist/change-set.d.ts +9 -14
  20. package/dist/change-set.d.ts.map +1 -1
  21. package/dist/change-set.js +11 -56
  22. package/dist/change.d.ts +45 -0
  23. package/dist/change.d.ts.map +1 -1
  24. package/dist/change.js +34 -0
  25. package/dist/client.d.ts +38 -17
  26. package/dist/client.d.ts.map +1 -1
  27. package/dist/client.js +156 -20
  28. package/dist/collection.d.ts +13 -14
  29. package/dist/collection.d.ts.map +1 -1
  30. package/dist/collection.js +52 -56
  31. package/dist/compile.d.ts +16 -0
  32. package/dist/compile.d.ts.map +1 -0
  33. package/dist/compile.js +789 -0
  34. package/dist/connection.d.ts +59 -20
  35. package/dist/connection.d.ts.map +1 -1
  36. package/dist/connection.js +4080 -879
  37. package/dist/context.d.ts +2 -0
  38. package/dist/context.d.ts.map +1 -0
  39. package/dist/context.js +7 -0
  40. package/dist/conversation.d.ts +51 -20
  41. package/dist/conversation.d.ts.map +1 -1
  42. package/dist/conversation.js +732 -242
  43. package/dist/digest.d.ts +7 -0
  44. package/dist/digest.d.ts.map +1 -0
  45. package/dist/digest.js +113 -0
  46. package/dist/durability.d.ts +4 -1
  47. package/dist/durability.d.ts.map +1 -1
  48. package/dist/durability.js +5 -0
  49. package/dist/entry.d.ts +20 -0
  50. package/dist/entry.d.ts.map +1 -0
  51. package/dist/entry.js +152 -0
  52. package/dist/expectation.d.ts +21 -0
  53. package/dist/expectation.d.ts.map +1 -0
  54. package/dist/expectation.js +70 -0
  55. package/dist/failure.d.ts +13 -0
  56. package/dist/failure.d.ts.map +1 -0
  57. package/dist/failure.js +19 -0
  58. package/dist/fence.d.ts +6 -0
  59. package/dist/fence.d.ts.map +1 -0
  60. package/dist/fence.js +10 -0
  61. package/dist/file.d.ts +2 -19
  62. package/dist/file.d.ts.map +1 -1
  63. package/dist/file.js +7 -122
  64. package/dist/host.d.ts +11 -2
  65. package/dist/host.d.ts.map +1 -1
  66. package/dist/host.js +128 -24
  67. package/dist/identity.d.ts +4 -0
  68. package/dist/identity.d.ts.map +1 -1
  69. package/dist/identity.js +16 -1
  70. package/dist/index.d.ts +22 -9
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +11 -0
  73. package/dist/job.d.ts +14 -0
  74. package/dist/job.d.ts.map +1 -0
  75. package/dist/job.js +28 -0
  76. package/dist/live.d.ts +23 -0
  77. package/dist/live.d.ts.map +1 -0
  78. package/dist/live.js +127 -0
  79. package/dist/media.d.ts +8 -0
  80. package/dist/media.d.ts.map +1 -0
  81. package/dist/media.js +218 -0
  82. package/dist/memory.d.ts +20 -7
  83. package/dist/memory.d.ts.map +1 -1
  84. package/dist/memory.js +253 -92
  85. package/dist/messages.d.ts +28 -0
  86. package/dist/messages.d.ts.map +1 -0
  87. package/dist/messages.js +89 -0
  88. package/dist/model.d.ts +19 -4
  89. package/dist/model.d.ts.map +1 -1
  90. package/dist/model.js +10 -2
  91. package/dist/name.d.ts +4 -0
  92. package/dist/name.d.ts.map +1 -0
  93. package/dist/name.js +122 -0
  94. package/dist/observation.d.ts +22 -4
  95. package/dist/observation.d.ts.map +1 -1
  96. package/dist/observation.js +120 -14
  97. package/dist/open.d.ts +2 -0
  98. package/dist/open.d.ts.map +1 -0
  99. package/dist/open.js +1 -0
  100. package/dist/opened.d.ts +22 -0
  101. package/dist/opened.d.ts.map +1 -0
  102. package/dist/opened.js +107 -0
  103. package/dist/outcome.d.ts +72 -5
  104. package/dist/outcome.d.ts.map +1 -1
  105. package/dist/outcome.js +81 -1
  106. package/dist/overlay.d.ts +15 -5
  107. package/dist/overlay.d.ts.map +1 -1
  108. package/dist/overlay.js +136 -180
  109. package/dist/paths.d.ts +1 -0
  110. package/dist/paths.d.ts.map +1 -1
  111. package/dist/paths.js +4 -0
  112. package/dist/phrase.d.ts +3 -0
  113. package/dist/phrase.d.ts.map +1 -0
  114. package/dist/phrase.js +8 -0
  115. package/dist/query.d.ts +75 -5
  116. package/dist/query.d.ts.map +1 -1
  117. package/dist/query.js +119 -26
  118. package/dist/reach.d.ts +18 -4
  119. package/dist/reach.d.ts.map +1 -1
  120. package/dist/reach.js +234 -69
  121. package/dist/react.d.ts +32 -19
  122. package/dist/react.d.ts.map +1 -1
  123. package/dist/react.js +13 -21
  124. package/dist/readiness.d.ts +50 -0
  125. package/dist/readiness.d.ts.map +1 -0
  126. package/dist/readiness.js +27 -0
  127. package/dist/recovery.d.ts +26 -0
  128. package/dist/recovery.d.ts.map +1 -0
  129. package/dist/recovery.js +224 -0
  130. package/dist/refresh.d.ts +20 -7
  131. package/dist/refresh.d.ts.map +1 -1
  132. package/dist/refresh.js +167 -59
  133. package/dist/replica.d.ts +59 -33
  134. package/dist/replica.d.ts.map +1 -1
  135. package/dist/replica.js +324 -157
  136. package/dist/room-draft.d.ts +59 -11
  137. package/dist/room-draft.d.ts.map +1 -1
  138. package/dist/room-draft.js +276 -80
  139. package/dist/rows.d.ts +40 -34
  140. package/dist/rows.d.ts.map +1 -1
  141. package/dist/rows.js +202 -80
  142. package/dist/save.d.ts +73 -4
  143. package/dist/save.d.ts.map +1 -1
  144. package/dist/save.js +825 -152
  145. package/dist/search.d.ts +15 -54
  146. package/dist/search.d.ts.map +1 -1
  147. package/dist/search.js +10 -121
  148. package/dist/seed.d.ts +16 -0
  149. package/dist/seed.d.ts.map +1 -0
  150. package/dist/seed.js +75 -0
  151. package/dist/shared.d.ts +15 -0
  152. package/dist/shared.d.ts.map +1 -0
  153. package/dist/shared.js +421 -0
  154. package/dist/status.d.ts +7 -2
  155. package/dist/status.d.ts.map +1 -1
  156. package/dist/status.js +3 -9
  157. package/dist/store.d.ts +118 -59
  158. package/dist/store.d.ts.map +1 -1
  159. package/dist/store.js +354 -344
  160. package/dist/stored.d.ts +162 -0
  161. package/dist/stored.d.ts.map +1 -0
  162. package/dist/stored.js +549 -0
  163. package/dist/tables.d.ts +353 -0
  164. package/dist/tables.d.ts.map +1 -0
  165. package/dist/tables.js +585 -0
  166. package/dist/transfer.d.ts +0 -5
  167. package/dist/transfer.d.ts.map +1 -1
  168. package/dist/turn.d.ts +9 -0
  169. package/dist/turn.d.ts.map +1 -0
  170. package/dist/turn.js +75 -0
  171. package/dist/validation.d.ts +29 -0
  172. package/dist/validation.d.ts.map +1 -0
  173. package/dist/validation.js +104 -0
  174. package/dist/windows.d.ts +22 -0
  175. package/dist/windows.d.ts.map +1 -0
  176. package/dist/windows.js +89 -0
  177. package/dist/wire.d.ts +170 -33
  178. package/dist/wire.d.ts.map +1 -1
  179. package/dist/wire.js +69 -31
  180. package/package.json +26 -15
  181. package/AGENTS.md +0 -232
  182. package/dist/attachment.d.ts +0 -3
  183. package/dist/attachment.d.ts.map +0 -1
  184. package/dist/attachment.js +0 -8
  185. package/dist/read-side.d.ts +0 -18
  186. package/dist/read-side.d.ts.map +0 -1
  187. package/dist/read-side.js +0 -377
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdruntime",
3
- "version": "0.1.0-cfbf80d8d4644",
3
+ "version": "0.1.0-cfcf93be6310b",
4
4
  "description": "The headless core of MD App",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,48 +9,59 @@
9
9
  "access": "public"
10
10
  },
11
11
  "engines": {
12
- "node": ">=24.21.0"
12
+ "node": ">=24.22.1"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js"
17
+ "default": "./dist/index.js"
18
18
  },
19
19
  "./host": {
20
20
  "types": "./dist/host.d.ts",
21
- "import": "./dist/host.js"
21
+ "default": "./dist/host.js"
22
22
  },
23
23
  "./client": {
24
24
  "types": "./dist/client.d.ts",
25
- "import": "./dist/client.js"
25
+ "default": "./dist/client.js"
26
+ },
27
+ "./entry": {
28
+ "types": "./dist/entry.d.ts",
29
+ "default": "./dist/entry.js"
26
30
  },
27
31
  "./memory": {
28
32
  "types": "./dist/memory.d.ts",
29
- "import": "./dist/memory.js"
33
+ "default": "./dist/memory.js"
34
+ },
35
+ "./tables": {
36
+ "types": "./dist/tables.d.ts",
37
+ "default": "./dist/tables.js"
30
38
  },
31
39
  "./react": {
32
40
  "types": "./dist/react.d.ts",
33
- "import": "./dist/react.js"
41
+ "default": "./dist/react.js"
42
+ },
43
+ "./digest": {
44
+ "types": "./dist/digest.d.ts",
45
+ "default": "./dist/digest.js"
34
46
  },
35
47
  "./package.json": "./package.json"
36
48
  },
37
49
  "files": [
38
50
  "dist",
39
- "AGENTS.md",
51
+ "!dist/chat.*",
52
+ "!dist/chat/",
40
53
  "README.md",
41
54
  "LICENSE"
42
55
  ],
43
56
  "dependencies": {
44
- "@agentshouse/mdmodel": "0.1.0-c5a71fe539a49",
45
- "@tanstack/db": "0.9.2",
46
- "minisearch": "7.2.0"
57
+ "@agentshouse/mdmodel": "0.1.0-caf3d712ed842"
47
58
  },
48
59
  "peerDependencies": {
49
60
  "react": ">=18"
50
61
  },
51
- "peerDependenciesMeta": {
52
- "react": {
53
- "optional": true
54
- }
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/agentshouse/core.git",
65
+ "directory": "mdruntime/packages/mdruntime"
55
66
  }
56
67
  }
package/AGENTS.md DELETED
@@ -1,232 +0,0 @@
1
- # Instructions for the App Creator's agent
2
-
3
- These instructions address an agent in an environment with Git. Obtain the
4
- App Repository, change it, build, and push. They are documentation, not
5
- enforcement.
6
-
7
- ## The MD Runtime API
8
-
9
- App code reaches the MD Runtime through the remote client. The surfaces are
10
- Rooms, Query, Search, Observe, Types, Room Draft, Save, History, Call, Reached, Log,
11
- the reported persistence answer, reauthorization, conversation, the chat draft,
12
- and Presentation State. Sync Status, the Service Mode, the storage-loss
13
- statement and the deployment facts 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.
23
-
24
- Every `observe` resolves, once its first value has arrived, to a handle:
25
- `current()` is the latest complete value, `subscribe(listener)` hears each later
26
- value whole and returns its unsubscribe, and `close()` ends the observation.
27
- Closing the port ends every handle and rejects every pending call and
28
- observation; a client that reconnects observes again.
29
-
30
- Each conversation the Provider's conversation list names is held complete in the
31
- browser. `conversation.list()` and `observe('conversations')` answer each with its
32
- Agent's identity and name, its name, created and finished times, last outcome and live
33
- `state`: `asking` while a question waits, `working` while a turn runs, else `idle`,
34
- and `started`, when the running turn began, or `null`.
35
- Observe one with `observe('conversation', id, { limit })`: the view
36
- holds its latest `limit` messages, or all of them, oldest first, its chat
37
- draft, and what the Provider streams for it whether or not anything views it:
38
- the running `turn` with its message parts and its context in use and window, the
39
- open questions, the process state, and the CLI's commands and options. These live
40
- only in memory: the message accepted under the turn's id replaces the running turn,
41
- and none of them is stored or searchable.
42
- `chatDraft.write` and `chatDraft.discard` keep what the App Creator composes;
43
- sending it is a Provider Action that needs the Provider reachable and is never
44
- queued.
45
-
46
- Each Room in Rooms lists its `attachments`, the files the Provider holds for it
47
- that its Documents link by the Provider's reference, ordered by `reference`,
48
- each with `name`, `byteLength`, `mediaType` and the Provider's own entry as
49
- `entry`. They are as the Provider last declared them and hold no bytes;
50
- open one through the Provider Action that serves it.
51
-
52
- Rooms, Query, Search, Observe, Types, Room Draft, Save, and Reached never
53
- touch the network.
54
- History and Call go to the Provider through the Adapter. A Call result whose
55
- effect the Provider places in a Room carries `at`, that Room and Room Version;
56
- `reached(room, roomVersion)` answers whether the Room's confirmed state has
57
- reached it, and the MD Runtime keeps refreshing that Room until it has;
58
- `reached(room, roomVersion, path)` answers whether the held confirmed copy of
59
- that document was written at a later Room Version. Each History revision
60
- names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`. Every
61
- member of the
62
- client is asynchronous. Results are detached snapshots. Nothing in this
63
- surface returns the authorization, performs a request the App's code
64
- composes, or exposes the browser store.
65
-
66
- Read the deployment facts with `observe('deployment-facts')`. Interpret the
67
- opaque value using the host's contract.
68
-
69
- The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
70
- ships in no bundle.
71
-
72
- ## Local Query rules
73
-
74
- `query(q)` answers once from local state; `observe('query', q)` holds the whole
75
- result and hears it again only when it changes, keeping every unchanged Document
76
- the same object, so a component can tell what changed by identity. A query is
77
- data:
78
-
79
- - **Filter.** `rooms` names Room locators and defaults to every Room. `types`
80
- names MD Types, and `any` names untyped Markdown Documents. `pathPrefix` is a
81
- directory: `notes` keeps `notes/a.md` and not `notes2/a.md`.
82
- - **Fields.** `where` names frontmatter fields, ANDs them, and nests `$and` and
83
- `$or`. A bare value is equality; the operators are `$eq`, `$ne`, `$in`, `$nin`,
84
- `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size` and `$exists`. Equality on a list
85
- asks whether it contains the value. Missing, null and empty differ:
86
- `$exists: false` keeps a missing field, `null` an explicit null, `''` empty
87
- text and `$size: 0` an empty list. A date compares in calendar order and never
88
- with a date-time. A reference compares by the Room Path it resolves to.
89
- Untyped frontmatter is plain values. There is no text containment or regular
90
- expression.
91
- - **Relations.** `hop: { field, types, where, pathPrefix }` keeps Documents whose
92
- reference `field` points to a matching Document of the same Room.
93
- `backlinks: { field, types, where, pathPrefix }` keeps Documents that a
94
- matching Document of the same Room references. Each keeps a Document once.
95
- - **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
96
- `preamble`, `markdown`, `backlinks` and `change`, where `fields` and `sections`
97
- are `'all'` or a list of names. Room and Path always return; a Markdown
98
- Document also returns its MD Type. A non-Markdown Document or binary link
99
- target returns only Room and Path. An unselected part is absent. Select only
100
- what a screen shows: a list that selects the Markdown hears every edit of it.
101
- - **Change.** `change` is `{ author, time }` of the Document's head revision as
102
- the Provider last delivered it: `author` is `{ kind: 'user' | 'site', id, name }`
103
- or `null` for a write the Provider made itself, and `time` is the Provider's
104
- ISO 8601 change time. It is `null` where the Provider delivered no time, as at
105
- a Site. An unsent edit or move keeps it, an unsent creation has none, and a
106
- saved write takes the Provider's own once it is Accepted and refreshed. A
107
- Room's last change is its Document with the latest `time`.
108
- - **Order and groups.** `orderBy` sorts by `room`, `path`, `type` or `{ field }`
109
- with TanStack DB's own options, and ties end with Room, then Path. `groupBy` by
110
- `room`, `type` or `{ field }` answers `{ groups: [{ key, count }] }`, counted
111
- over every match and ordered by `count` or a key. `limit` bounds the Documents
112
- or the groups.
113
- - **Results and errors.** A result carries no Room Version: read freshness from
114
- Rooms and Sync Status. An invalid query fails with `invalid-query`,
115
- `unknown-type`, `unknown-field` or `wrong-kind`, naming where, and never
116
- answers an empty result in its place.
117
-
118
- ## Local Search rules
119
-
120
- `search({ text, documents, conversations, limit })` answers once, by words, from
121
- local state, with MiniSearch at its default configuration. There is no observed
122
- search.
123
-
124
- - **What is found.** A Document by its field values, its sections' headings and
125
- text, its preamble and its Path; a message by its text. Frontmatter keys, Room
126
- Drafts, chat drafts and a running turn's parts are never found. There are no phrases,
127
- word forms, typo tolerance or prefix matching.
128
- - **Narrowing.** `documents` is a Local Query filter: `rooms`, `types`, `where`,
129
- `pathPrefix`, `hop` and `backlinks`. `conversations` names conversations. Both
130
- apply before `limit`, which bounds each list; without it every hit returns.
131
- - **Results.** `{ documents, messages }`, each ranked by `score`, which compares
132
- hits of one list of one search. A Document hit names its `room`, `path` and
133
- `type`, a message hit its `conversation` and `identity`, and `matches` maps each
134
- matched word to the parts it matched in: `fields`, `sections`, `preamble` or
135
- `path`, or `text`. A hit carries no position; mark the words in the text you
136
- show. An invalid filter fails with its Local Query error.
137
-
138
- ## Room Draft, Save, and outcome rules
139
-
140
- The MD Runtime owns one Room Draft per Room and Path, shared by every App and
141
- tab. It is durable: it survives reload and navigation. A Room that Discovery
142
- stops listing takes its Room Drafts and its queue with it.
143
- Write a Room Draft with `roomDraft.write(room, path, revision, parts)`, naming
144
- the revision you read, or `null` when there was none, and every part it should
145
- now change: fields, sections and the preamble, or the whole Markdown, a
146
- creation, a move, or a removal. A part new to the Room Draft names its base,
147
- the value you showed when it was opened; the MD Runtime keeps a part's first
148
- base. A binary link target has a Room Draft too, for a move or a removal, with
149
- `null` as its base. A write or a discard from an older revision is refused as `stale` with
150
- the current Room Draft; read it and write again.
151
-
152
- Save takes one Room and the Room Drafts of it to save, each with its revision,
153
- validates locally, and on success appends one Change Batch to that Room's
154
- queue and removes those Room Drafts. It is refused as `stale`, as
155
- `changed-underneath` naming each part whose base no longer matches the visible
156
- state, or by a local validation rule, and then creates nothing and leaves every
157
- Room Draft in place. A directory move or removal is a move or removal part on
158
- each Document and binary link target beneath it, saved together.
159
-
160
- Outcomes follow the Provider's answer. An Accepted Change Batch stays in the
161
- queue, drawn over the confirmed layer, until the confirmed layer reaches the
162
- Room Version it was accepted at, and then leaves it. Conflicted and Rejected, an expired operation, and a change that no
163
- longer applies over the Room each leave the queue and return as Room Drafts on
164
- the Documents they changed, marked with why: the Provider's structured refusal
165
- code and fields as returned, not known to have applied, or withdrawn locally.
166
- The rest of the queue keeps synchronizing, and Sync Status requires attention
167
- until each returned Room Draft is saved again or discarded. A Change Batch
168
- keeps no outcome once it leaves the queue; `observe('queue', room)` shows each
169
- Pending one, and a returned Room Draft says why it returned. Transport
170
- failure and Provider unavailability keep work Pending and do not infer a
171
- rejection. A refusal the Provider marks retryable stays Pending until the reset
172
- it names; the MD Runtime retries the same Change Batch identity and payload and
173
- never infers an outcome from transport uncertainty. The MD Runtime never
174
- combines, reorders, or rebases.
175
-
176
- `observe('service-mode')` answers the Provider's Service
177
- Mode, `open` or `write-halted`. While writes are halted, Save still succeeds,
178
- its Change Batch waits unsent, and the queue is submitted in order once the
179
- Provider reopens writes. An Action is never held: a write the Provider refuses
180
- for the halt returns that refusal to its caller. Show the Provider as read-only
181
- instead of retrying.
182
-
183
- ## The neutrality rule
184
-
185
- No module outside an Adapter package imports, names, or special-cases a
186
- Provider. MD UI and every App reach data only through the client entry.
187
-
188
- ## Content-safety rules
189
-
190
- The Provider authorization belongs to the Runtime host and is never readable
191
- by the App's code. The App's code reaches the network only at the external
192
- origins its manifest declares, empty by default, and the Provider enforces
193
- that set. Every request to the Provider itself goes through the MD Runtime.
194
- Rendered Markdown never executes scripts, renders raw HTML only for the
195
- details and summary elements, and loads images and other resources only from
196
- origins the Provider's policy allows.
197
-
198
- ## Launch promises MD UI keeps
199
-
200
- MD UI uses semantic HTML, is fully operable from a keyboard with visible
201
- focus and labelled controls, and lays out from a 360 pixel wide viewport to
202
- a desktop. Its strings are English only, dates and numbers follow the
203
- browser locale, and content is never translated. Light and dark themes come
204
- from CSS custom properties with the browser's preference as the default and
205
- an App's override respected. What an App Creator's agent adds carries none
206
- of these promises by itself. Reading, querying and searching never wait for
207
- the network. Data lives only in the App Creator's browser and with the Provider.
208
-
209
- ## App code takes the client its host hands it and never constructs a Runtime
210
-
211
- App code takes the client its host hands it: in House,
212
- `connectHouseBridge().runtime` from `@agentshouse/app-bridge` resolves to the
213
- client House built into the page. It never constructs a Runtime or a client.
214
- It imports only types from `@agentshouse/mdruntime/client`, does not call
215
- `connectMdRuntime` or `serveMdRuntime`, and does not import the package main,
216
- the host entry, or the Adapter package. Hosts and tests use those entries; the
217
- served App does not.
218
-
219
- A React App may observe and save through `@agentshouse/mdruntime/react`, which
220
- names React as a peer dependency. `useObserve(client, topic, ...input)` takes
221
- the arguments of `observe` and returns the topic's current value, `undefined`
222
- until it arrives, re-rendering on each change; a `null` client observes
223
- nothing. `useSave(client)` returns `busy`, the last `outcome` or `failure`, and
224
- `save(room, roomDrafts)`, which writes each Path's parts onto the Room Draft
225
- already there, keeping the bases its parts have, or onto a new one, and saves
226
- them together. A refused Save leaves the Room Drafts for the App to save again
227
- or discard; a failure is recorded and rejects.
228
-
229
- ## What an agent must never do
230
-
231
- An agent must never read the authorization, load code from a Room, call the
232
- Provider directly, or rebase a refused Change Batch.
@@ -1,3 +0,0 @@
1
- import type { RoomAttachment } from './adapter.js';
2
- export declare function declaredAttachments(pages: readonly (readonly RoomAttachment[])[]): readonly RoomAttachment[];
3
- //# sourceMappingURL=attachment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,GAC5C,SAAS,cAAc,EAAE,CAQ3B"}
@@ -1,8 +0,0 @@
1
- export function declaredAttachments(pages) {
2
- const byReference = new Map();
3
- for (const page of pages) {
4
- for (const attachment of page)
5
- byReference.set(attachment.reference, attachment);
6
- }
7
- return [...byReference.values()].sort((left, right) => left.reference < right.reference ? -1 : left.reference > right.reference ? 1 : 0);
8
- }
@@ -1,18 +0,0 @@
1
- import type { ChangeSet } from './change-set.js';
2
- import { type KeyedResult, type QueryChange } from './observation.js';
3
- import type { Plan, QueryResult } from './query.js';
4
- import type { SearchedDocument } from './search.js';
5
- export type ReadSide = {
6
- apply(set: ChangeSet): void;
7
- query(plan: Plan): Promise<QueryResult>;
8
- watch(plan: Plan, identity: string, deliver: (message: KeyedResult | QueryChange) => void): () => void;
9
- documents(): readonly SearchedDocument[];
10
- document(room: string, path: string): SearchedDocument | null;
11
- close(): void;
12
- };
13
- export declare function reconciled(previous: KeyedResult, next: KeyedResult): {
14
- keyed: KeyedResult;
15
- change: QueryChange;
16
- } | null;
17
- export declare function createReadSide(): ReadSide;
18
- //# sourceMappingURL=read-side.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-side.d.ts","sourceRoot":"","sources":["../src/read-side.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,EAOV,IAAI,EAIJ,WAAW,EAIZ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqDpD,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CACH,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,KAAK,IAAI,GACpD,MAAM,IAAI,CAAC;IACd,SAAS,IAAI,SAAS,gBAAgB,EAAE,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAC9D,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AA8RF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,WAAW,GAChB;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CA4BpD;AAED,wBAAgB,cAAc,IAAI,QAAQ,CA4HzC"}