@agentshouse/mdruntime 0.1.0-c666b13a07022 → 0.1.0-c697ef79d87a3

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 (148) hide show
  1. package/README.md +1 -1
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js +44 -7
  4. package/dist/adapter.d.ts +39 -15
  5. package/dist/adapter.d.ts.map +1 -1
  6. package/dist/attached-model.d.ts.map +1 -1
  7. package/dist/attached-model.js +2 -2
  8. package/dist/authored.d.ts.map +1 -1
  9. package/dist/authored.js +2 -0
  10. package/dist/binary.d.ts +6 -2
  11. package/dist/binary.d.ts.map +1 -1
  12. package/dist/binary.js +10 -3
  13. package/dist/chain.d.ts +1 -1
  14. package/dist/chain.d.ts.map +1 -1
  15. package/dist/chain.js +5 -2
  16. package/dist/change.d.ts +2 -2
  17. package/dist/chat-types.js +2 -2
  18. package/dist/client.d.ts +9 -6
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +13 -13
  21. package/dist/collection.d.ts +1 -0
  22. package/dist/collection.d.ts.map +1 -1
  23. package/dist/collection.js +7 -1
  24. package/dist/compile.d.ts +2 -1
  25. package/dist/compile.d.ts.map +1 -1
  26. package/dist/compile.js +70 -38
  27. package/dist/connection.d.ts +1 -1
  28. package/dist/connection.d.ts.map +1 -1
  29. package/dist/connection.js +5 -3
  30. package/dist/conversation-live.d.ts +2 -3
  31. package/dist/conversation-live.d.ts.map +1 -1
  32. package/dist/conversation-live.js +2 -2
  33. package/dist/conversation.d.ts +10 -5
  34. package/dist/conversation.d.ts.map +1 -1
  35. package/dist/conversation.js +31 -19
  36. package/dist/declaration.js +1 -1
  37. package/dist/discovery.d.ts +1 -1
  38. package/dist/discovery.d.ts.map +1 -1
  39. package/dist/discovery.js +18 -5
  40. package/dist/entry.d.ts +13 -3
  41. package/dist/entry.d.ts.map +1 -1
  42. package/dist/entry.js +75 -41
  43. package/dist/host.d.ts +4 -2
  44. package/dist/host.d.ts.map +1 -1
  45. package/dist/host.js +46 -22
  46. package/dist/house-query.d.ts +14 -11
  47. package/dist/house-query.d.ts.map +1 -1
  48. package/dist/house-query.js +48 -7
  49. package/dist/index.d.ts +8 -8
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +2 -2
  52. package/dist/lifecycle.d.ts +1 -1
  53. package/dist/lifecycle.d.ts.map +1 -1
  54. package/dist/lifecycle.js +22 -19
  55. package/dist/live.d.ts +14 -0
  56. package/dist/live.d.ts.map +1 -1
  57. package/dist/live.js +29 -12
  58. package/dist/loaded.d.ts +5 -3
  59. package/dist/loaded.d.ts.map +1 -1
  60. package/dist/loaded.js +12 -6
  61. package/dist/locks.d.ts.map +1 -1
  62. package/dist/locks.js +2 -0
  63. package/dist/media.d.ts +5 -6
  64. package/dist/media.d.ts.map +1 -1
  65. package/dist/media.js +78 -22
  66. package/dist/memory.d.ts +2 -2
  67. package/dist/memory.js +5 -5
  68. package/dist/messages.d.ts +6 -1
  69. package/dist/messages.d.ts.map +1 -1
  70. package/dist/messages.js +5 -0
  71. package/dist/name.d.ts +0 -1
  72. package/dist/name.d.ts.map +1 -1
  73. package/dist/name.js +3 -7
  74. package/dist/opening.js +17 -2
  75. package/dist/outcome.d.ts +11 -3
  76. package/dist/outcome.d.ts.map +1 -1
  77. package/dist/outcome.js +1 -1
  78. package/dist/overlay.d.ts +3 -3
  79. package/dist/preparation.d.ts +10 -5
  80. package/dist/preparation.d.ts.map +1 -1
  81. package/dist/preparation.js +78 -48
  82. package/dist/queries.d.ts.map +1 -1
  83. package/dist/queries.js +54 -11
  84. package/dist/query.d.ts +2 -2
  85. package/dist/questions.d.ts.map +1 -1
  86. package/dist/questions.js +2 -1
  87. package/dist/reach.d.ts +3 -2
  88. package/dist/reach.d.ts.map +1 -1
  89. package/dist/reach.js +28 -15
  90. package/dist/readiness.d.ts +14 -4
  91. package/dist/readiness.d.ts.map +1 -1
  92. package/dist/readiness.js +16 -7
  93. package/dist/reads.d.ts.map +1 -1
  94. package/dist/reads.js +2 -1
  95. package/dist/reference-forms.d.ts +4 -0
  96. package/dist/reference-forms.d.ts.map +1 -0
  97. package/dist/reference-forms.js +74 -0
  98. package/dist/refresh.d.ts +1 -1
  99. package/dist/refresh.js +4 -4
  100. package/dist/replica.js +2 -2
  101. package/dist/room-draft.d.ts.map +1 -1
  102. package/dist/room-draft.js +5 -2
  103. package/dist/room-drafts.d.ts.map +1 -1
  104. package/dist/room-drafts.js +6 -4
  105. package/dist/rows.d.ts +9 -1
  106. package/dist/rows.d.ts.map +1 -1
  107. package/dist/rows.js +18 -4
  108. package/dist/runtime.d.ts +4 -2
  109. package/dist/runtime.d.ts.map +1 -1
  110. package/dist/save.d.ts +1 -0
  111. package/dist/save.d.ts.map +1 -1
  112. package/dist/save.js +6 -6
  113. package/dist/saves.d.ts +2 -2
  114. package/dist/saves.d.ts.map +1 -1
  115. package/dist/saves.js +36 -10
  116. package/dist/shown.d.ts.map +1 -1
  117. package/dist/shown.js +17 -4
  118. package/dist/socket/session.d.ts +3 -1
  119. package/dist/socket/session.d.ts.map +1 -1
  120. package/dist/socket/session.js +2 -0
  121. package/dist/source.d.ts +2 -0
  122. package/dist/source.d.ts.map +1 -1
  123. package/dist/source.js +2 -0
  124. package/dist/store/records.d.ts +5 -2
  125. package/dist/store/records.d.ts.map +1 -1
  126. package/dist/store/records.js +8 -2
  127. package/dist/store.d.ts +1 -1
  128. package/dist/store.d.ts.map +1 -1
  129. package/dist/store.js +3 -1
  130. package/dist/stored.d.ts +15 -1
  131. package/dist/stored.d.ts.map +1 -1
  132. package/dist/stored.js +138 -31
  133. package/dist/surface.d.ts +4 -4
  134. package/dist/surface.d.ts.map +1 -1
  135. package/dist/surface.js +6 -6
  136. package/dist/sync.d.ts +2 -1
  137. package/dist/sync.d.ts.map +1 -1
  138. package/dist/sync.js +26 -18
  139. package/dist/tables.d.ts +14 -2
  140. package/dist/tables.d.ts.map +1 -1
  141. package/dist/tables.js +10 -3
  142. package/dist/validation.d.ts +2 -0
  143. package/dist/validation.d.ts.map +1 -1
  144. package/dist/validation.js +49 -3
  145. package/dist/wire.d.ts +6 -6
  146. package/dist/wire.d.ts.map +1 -1
  147. package/dist/wire.js +6 -6
  148. package/package.json +3 -3
package/dist/media.js CHANGED
@@ -25,11 +25,6 @@ const STYLE = `:host{display:block}
25
25
  [part=box]>slot{display:flex;align-items:center;justify-content:center;width:100%;height:100%;text-align:center}
26
26
  [part=play]{position:absolute;top:50%;left:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:rgb(0 0 0/.6);pointer-events:none}
27
27
  [part=play]::before{content:"";position:absolute;top:18px;left:22px;border-style:solid;border-width:10px 0 10px 16px;border-color:transparent transparent transparent #fff}`;
28
- const shows = new WeakMap();
29
- export function shownBy(show, client) {
30
- shows.set(client, show);
31
- return client;
32
- }
33
28
  export function mediaAt(media) {
34
29
  if (media.localName === KEYED_MEDIA) {
35
30
  const link = media.getAttribute('link');
@@ -47,22 +42,42 @@ export function mediaTag(at) {
47
42
  export function downloadAt(client, at) {
48
43
  return 'link' in at
49
44
  ? downloadAttachment(client, at.link)
50
- : client.binaryFile.download(at.room, at.path, at.revision);
45
+ : client.attachment.download(at.room, at.path, at.revision);
51
46
  }
52
47
  function shownAt(client, at) {
53
48
  if (at === null)
54
49
  return null;
55
- if ('link' in at)
56
- return client.conversation.attachment(at.link);
57
- const show = shows.get(client);
58
- return show === undefined ? null : show(at.room, at.path, at.revision);
50
+ if ('link' in at) {
51
+ return client.conversation
52
+ .attachment(at.link)
53
+ .then((shown) => (shown.kind === 'link' ? { ...shown, copies: [] } : shown));
54
+ }
55
+ return client.attachment.show(at.room, at.path, at.revision);
59
56
  }
60
57
  function ratioOf(width, height) {
61
58
  const across = Number(width);
62
59
  const down = Number(height);
63
60
  return Number.isFinite(across) && Number.isFinite(down) && across > 0 && down > 0
64
61
  ? `${across} / ${down}`
65
- : SHAPE;
62
+ : null;
63
+ }
64
+ function ownRatio(found, at) {
65
+ const record = 'documents' in found ? found.documents[0]?.attachment : undefined;
66
+ if (record?.state !== 'accepted' ||
67
+ (at.revision !== undefined && record.revision !== at.revision)) {
68
+ return null;
69
+ }
70
+ return ratioOf(record.width, record.height);
71
+ }
72
+ function offered(drawn, box, copies) {
73
+ if (copies.length === 0) {
74
+ drawn.removeAttribute('srcset');
75
+ drawn.removeAttribute('sizes');
76
+ return;
77
+ }
78
+ const across = Math.ceil(box.getBoundingClientRect().width);
79
+ drawn.sizes = across > 0 ? `${across}px` : '100vw';
80
+ drawn.srcset = copies.map(({ url, width }) => `${url} ${width}w`).join(', ');
66
81
  }
67
82
  function refusedForGood(shown) {
68
83
  if (shown.kind === 'revoked-authorization')
@@ -88,14 +103,25 @@ export function viewable(element) {
88
103
  return false;
89
104
  return (rendered(element) || (element.shadowRoot?.querySelector('[part=box] > video') ?? null) !== null);
90
105
  }
91
- function viewed(client, opener, alone) {
92
- void loaded(client.buildFile, VIEWER).then((file) => file?.openViewer({
93
- opener,
94
- alone,
95
- download: (at) => void downloadAt(client, at),
96
- }));
106
+ function viewed(client, opener, alone, taken = () => true) {
107
+ void loaded(client.buildFile, VIEWER).then((file) => {
108
+ if (!opener.isConnected || !taken())
109
+ return;
110
+ file?.openViewer({
111
+ opener,
112
+ alone,
113
+ download: (at) => void downloadAt(client, at),
114
+ });
115
+ });
97
116
  }
98
117
  function pressed(client) {
118
+ let latest = null;
119
+ const taken = (opener) => () => {
120
+ if (latest !== opener)
121
+ return false;
122
+ latest = null;
123
+ return true;
124
+ };
99
125
  return (event) => {
100
126
  if (event.defaultPrevented || event.detail > 1)
101
127
  return;
@@ -104,7 +130,8 @@ function pressed(client) {
104
130
  continue;
105
131
  if (viewable(node)) {
106
132
  event.preventDefault();
107
- void client.then((one) => viewed(one, node, !rendered(node)));
133
+ latest = node;
134
+ void client.then((one) => viewed(one, node, !rendered(node), taken(node)));
108
135
  return;
109
136
  }
110
137
  if (node.matches(PRESSED_ELSEWHERE))
@@ -133,6 +160,8 @@ export function defineRoomMedia(client) {
133
160
  #drawn = null;
134
161
  #loaded = false;
135
162
  #relinked = 0;
163
+ #own = null;
164
+ #measuring = null;
136
165
  constructor() {
137
166
  super();
138
167
  this.#box.setAttribute('part', 'box');
@@ -149,17 +178,21 @@ export function defineRoomMedia(client) {
149
178
  void this.#load();
150
179
  }, { rootMargin: NEARING });
151
180
  this.#watching.observe(this);
181
+ this.#measure();
152
182
  }
153
183
  disconnectedCallback() {
154
184
  this.#watching?.disconnect();
155
185
  this.#watching = null;
156
186
  this.#near = false;
157
187
  this.#asked += 1;
188
+ this.#measure();
158
189
  this.#show(null);
159
190
  }
160
191
  attributeChangedCallback(name, before, after) {
161
192
  if (before === after)
162
193
  return;
194
+ if (LOADING.has(name))
195
+ this.#measure();
163
196
  this.#shape();
164
197
  if (this.isConnected)
165
198
  this.#label();
@@ -169,7 +202,28 @@ export function defineRoomMedia(client) {
169
202
  void this.#load();
170
203
  }
171
204
  #shape() {
172
- this.#box.style.aspectRatio = ratioOf(this.getAttribute('width'), this.getAttribute('height'));
205
+ this.#box.style.aspectRatio =
206
+ ratioOf(this.getAttribute('width'), this.getAttribute('height')) ?? this.#own ?? SHAPE;
207
+ }
208
+ #measure() {
209
+ void this.#measuring?.then((measured) => measured.close(), () => undefined);
210
+ this.#measuring = null;
211
+ this.#own = null;
212
+ const at = mediaAt(this);
213
+ if (this.#watching === null || at === null || 'link' in at)
214
+ return;
215
+ const measuring = connected.then((one) => one.observe('query', { rooms: [at.room], paths: [at.path], select: {} }));
216
+ this.#measuring = measuring;
217
+ void measuring.then((measured) => {
218
+ const heard = () => {
219
+ if (this.#measuring !== measuring)
220
+ return;
221
+ this.#own = ownRatio(measured.current(), at);
222
+ this.#shape();
223
+ };
224
+ measured.subscribe(heard);
225
+ heard();
226
+ }, () => undefined);
173
227
  }
174
228
  #label() {
175
229
  const alt = this.getAttribute('alt') ?? '';
@@ -193,7 +247,7 @@ export function defineRoomMedia(client) {
193
247
  if (asked !== this.#asked)
194
248
  return;
195
249
  if (shown?.kind === 'link') {
196
- this.#draw({ url: shown.url, copy: false }, shown.mediaType);
250
+ this.#draw({ url: shown.url, copy: false }, shown.mediaType, shown.copies);
197
251
  return;
198
252
  }
199
253
  if (shown?.kind !== 'binary') {
@@ -209,7 +263,7 @@ export function defineRoomMedia(client) {
209
263
  if (copy === null)
210
264
  this.#unshown(asked);
211
265
  else
212
- this.#draw({ url: URL.createObjectURL(copy), copy: true }, shown.mediaType);
266
+ this.#draw({ url: URL.createObjectURL(copy), copy: true }, shown.mediaType, []);
213
267
  }
214
268
  #unshown(asked) {
215
269
  this.#unreadable();
@@ -235,7 +289,7 @@ export function defineRoomMedia(client) {
235
289
  #unreadable() {
236
290
  this.#show(null, this.#fallback);
237
291
  }
238
- #draw(shown, mediaType) {
292
+ #draw(shown, mediaType, copies) {
239
293
  const tag = drawnFor(mediaType);
240
294
  if (tag === null) {
241
295
  if (shown.copy)
@@ -267,6 +321,8 @@ export function defineRoomMedia(client) {
267
321
  }
268
322
  this.#drawn = drawn;
269
323
  this.#show(shown, drawn);
324
+ if (drawn instanceof HTMLImageElement)
325
+ offered(drawn, this.#box, copies);
270
326
  drawn.src = shown.url;
271
327
  }
272
328
  #failed(drawn) {
package/dist/memory.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type VerifiedModel } from '@agentshouse/mdmodel';
2
2
  import type { ModelResult } from './model.js';
3
- import { type AcceptedMessage, type ActionResult, type Adapter, type BinaryFile, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type SavedFacts, type HeadChange, type ListedAgent, type ListedConversation, type Member, type ProviderLimit, type Retention, type ServiceMode, type TypedPath, type TypedSelection } from './adapter.js';
3
+ import { type AcceptedMessage, type ActionResult, type Adapter, type Attachment, type Capability, type ConversationAction, type ConversationEvent, type DiscoveredRoom, type SavedFacts, type HeadChange, type ListedAgent, type ListedConversation, type Member, type ProviderLimit, type Retention, type ServiceMode, type TypedPath, type TypedSelection } from './adapter.js';
4
4
  export type MemoryRoom = Omit<DiscoveredRoom, 'typedSelection' | 'authoredPaths'> & {
5
5
  typedSelection?: TypedSelection | null;
6
6
  authoredPaths?: readonly string[];
@@ -11,7 +11,7 @@ export type MemoryRoom = Omit<DiscoveredRoom, 'typedSelection' | 'authoredPaths'
11
11
  fileIds?: Readonly<Record<string, string>>;
12
12
  created?: Readonly<Record<string, string>>;
13
13
  changes?: Readonly<Record<string, HeadChange>>;
14
- binaryFiles?: Readonly<Record<string, BinaryFile>>;
14
+ attachments?: Readonly<Record<string, Attachment>>;
15
15
  folders?: readonly string[];
16
16
  blobs?: Readonly<Record<string, Blob>>;
17
17
  };
package/dist/memory.js CHANGED
@@ -193,7 +193,7 @@ export function createMemoryAdapter(options = {}) {
193
193
  const size = pageSize ?? paths.length;
194
194
  const taken = paths.slice(from, from + size);
195
195
  const next = from + taken.length;
196
- const targets = opening ? Object.keys(room.binaryFiles ?? {}) : [];
196
+ const targets = opening ? Object.keys(room.attachments ?? {}) : [];
197
197
  return {
198
198
  kind: 'bootstrap',
199
199
  roomVersion: room.roomVersion,
@@ -208,7 +208,7 @@ export function createMemoryAdapter(options = {}) {
208
208
  ? {}
209
209
  : { created: named(room.created, [...taken, ...targets]) }),
210
210
  changes: named(room.changes ?? {}, [...taken, ...targets]),
211
- binaryFiles: named(room.binaryFiles ?? {}, targets),
211
+ attachments: named(room.attachments ?? {}, targets),
212
212
  ...(opening && room.folders !== undefined ? { folders: room.folders } : {}),
213
213
  ...(next < paths.length ? { pageToken: taken.at(-1) } : {}),
214
214
  };
@@ -226,8 +226,8 @@ export function createMemoryAdapter(options = {}) {
226
226
  function advancement(room, from, at, whole = false) {
227
227
  const current = room.documents ?? {};
228
228
  const previous = from.documents ?? {};
229
- const currentTargets = new Set(Object.keys(room.binaryFiles ?? {}));
230
- const previousTargets = new Set(Object.keys(from.binaryFiles ?? {}));
229
+ const currentTargets = new Set(Object.keys(room.attachments ?? {}));
230
+ const previousTargets = new Set(Object.keys(from.attachments ?? {}));
231
231
  const headMoved = (path) => room.revisions?.[path] !== from.revisions?.[path] ||
232
232
  room.fileIds?.[path] !== from.fileIds?.[path] ||
233
233
  room.created?.[path] !== from.created?.[path] ||
@@ -260,7 +260,7 @@ export function createMemoryAdapter(options = {}) {
260
260
  ? {}
261
261
  : { created: named(room.created, [...taken, ...targets]) }),
262
262
  changes: named(room.changes ?? {}, [...taken, ...targets]),
263
- binaryFiles: named(room.binaryFiles ?? {}, targets),
263
+ attachments: named(room.attachments ?? {}, targets),
264
264
  ...(opening ? foldersMoved(room, from) : {}),
265
265
  removals: opening
266
266
  ? [
@@ -1,7 +1,8 @@
1
+ import type { SessionState } from '@agentshouse/session-content';
1
2
  import type { AcceptedMessage } from './adapter.js';
2
3
  import type { Connection } from './tables.js';
3
4
  export declare const MESSAGE_TABLES: readonly string[];
4
- export declare const ROWS = "WITH chosen AS (\n SELECT listed.value AS conversation,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'assistant' ORDER BY position DESC, identity DESC LIMIT 1) AS answer,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND text <> '' ORDER BY position DESC, identity DESC LIMIT 1) AS said,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' ORDER BY position, identity LIMIT 1) AS opened,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' AND json_extract(message, '$.waiting') = 1 ORDER BY position, identity LIMIT 1) AS asking\n FROM json_each(?) AS listed\n )\n SELECT chosen.conversation AS conversation,\n substr(said.text, 1, 512) AS said_text,\n json_extract(said.message, '$.role') AS said_role,\n json_extract(said.message, '$.accepted_at') AS said_at,\n answer.turn AS answered,\n substr(json_extract(answer.message, '$.failure'), 1, 512) AS failure,\n COALESCE(\n (SELECT value FROM conversation_facts WHERE conversation = chosen.conversation AND name = 'openedTurn'),\n CASE WHEN julianday(json_extract(answer.message, '$.accepted_at')) < (SELECT julianday(json_extract(value, '$')) FROM replica_facts WHERE name = 'readUntil') THEN answer.turn END\n ) AS opened_turn,\n json_extract(opened.message, '$.source') AS opened_source,\n json_extract(opened.message, '$.sender') AS opened_sender,\n asking.identity AS asking_identity,\n asking.text AS asking_text,\n json_extract(asking.message, '$.accepted_at') AS asking_at,\n json_extract(asking.message, '$.source') AS asking_source,\n json_extract(asking.message, '$.sender') AS asking_sender\n FROM chosen\n LEFT JOIN conversation_messages said ON said.id = chosen.said\n LEFT JOIN conversation_messages answer ON answer.id = chosen.answer\n LEFT JOIN conversation_messages opened ON opened.id = chosen.opened\n LEFT JOIN conversation_messages asking ON asking.id = chosen.asking";
5
+ export declare const ROWS = "WITH chosen AS (\n SELECT listed.value AS conversation,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'assistant' ORDER BY position DESC, identity DESC LIMIT 1) AS answer,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND text <> '' ORDER BY position DESC, identity DESC LIMIT 1) AS said,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' ORDER BY position, identity LIMIT 1) AS opened,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' AND json_extract(message, '$.waiting') = 1 ORDER BY position, identity LIMIT 1) AS asking\n FROM json_each(?) AS listed\n )\n SELECT chosen.conversation AS conversation,\n substr(said.text, 1, 512) AS said_text,\n json_extract(said.message, '$.role') AS said_role,\n json_extract(said.message, '$.accepted_at') AS said_at,\n answer.turn AS answered,\n json_extract(answer.message, '$.content.state') AS saved_state,\n json_extract(answer.message, '$.accepted_at') AS saved_at,\n substr(json_extract(answer.message, '$.failure'), 1, 512) AS failure,\n COALESCE(\n (SELECT value FROM conversation_facts WHERE conversation = chosen.conversation AND name = 'openedTurn'),\n CASE WHEN julianday(json_extract(answer.message, '$.accepted_at')) < (SELECT julianday(json_extract(value, '$')) FROM replica_facts WHERE name = 'readUntil') THEN answer.turn END\n ) AS opened_turn,\n json_extract(opened.message, '$.source') AS opened_source,\n json_extract(opened.message, '$.sender') AS opened_sender,\n asking.identity AS asking_identity,\n asking.text AS asking_text,\n json_extract(asking.message, '$.accepted_at') AS asking_at,\n json_extract(asking.message, '$.source') AS asking_source,\n json_extract(asking.message, '$.sender') AS asking_sender\n FROM chosen\n LEFT JOIN conversation_messages said ON said.id = chosen.said\n LEFT JOIN conversation_messages answer ON answer.id = chosen.answer\n LEFT JOIN conversation_messages opened ON opened.id = chosen.opened\n LEFT JOIN conversation_messages asking ON asking.id = chosen.asking";
5
6
  export type HeldConversation = {
6
7
  readonly conversation: string;
7
8
  readonly read: string | null | undefined;
@@ -23,6 +24,10 @@ export type HeldRow = {
23
24
  readonly at: string | null;
24
25
  } | null;
25
26
  readonly answered: string | null;
27
+ readonly saved: {
28
+ readonly state: SessionState;
29
+ readonly at: string;
30
+ } | null;
26
31
  readonly openedTurn: string | null;
27
32
  readonly failure: string | null;
28
33
  readonly opened: HeldSource | null;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAM1D,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAQ3C,CAAC;AAUF,eAAO,MAAM,IAAI,mnEA6BqD,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAA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AE,QAAQ,EAAE,IAAI,EAAE,EAAE,iBAAiB,GAClD,IAAI,CAsBN;AAmBD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACxC,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,aAAa,CAWf;AAED,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAOR;AAaD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,EAAE,CA6BX;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAO/F;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,EAAE,CAMpE;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,QAAQ,GAAG,IAAI,CAM9F;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAEnE"}
package/dist/messages.js CHANGED
@@ -30,6 +30,8 @@ export const ROWS = `WITH chosen AS (
30
30
  json_extract(said.message, '$.role') AS said_role,
31
31
  json_extract(said.message, '$.accepted_at') AS said_at,
32
32
  answer.turn AS answered,
33
+ json_extract(answer.message, '$.content.state') AS saved_state,
34
+ json_extract(answer.message, '$.accepted_at') AS saved_at,
33
35
  substr(json_extract(answer.message, '$.failure'), 1, ${EXCERPT}) AS failure,
34
36
  COALESCE(
35
37
  (SELECT value FROM conversation_facts WHERE conversation = chosen.conversation AND name = 'openedTurn'),
@@ -131,6 +133,9 @@ export function conversationRows(connection, conversations) {
131
133
  at: textOrNull(row.said_at),
132
134
  },
133
135
  answered: textOrNull(row.answered),
136
+ saved: row.saved_state === null || row.saved_at === null
137
+ ? null
138
+ : { state: JSON.parse(text(row.saved_state)), at: text(row.saved_at) },
134
139
  openedTurn: textOrNull(row.opened_turn),
135
140
  failure: textOrNull(row.failure),
136
141
  opened: row.opened_source === null ? null : heldSource(row.opened_source, row.opened_sender),
package/dist/name.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export declare function transliterated(text: string): string;
2
1
  export declare function nameFrom(title: string): string;
3
2
  export declare function cutName(name: string, most: number): string;
4
3
  //# sourceMappingURL=name.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../src/name.ts"],"names":[],"mappings":"AAgHA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D"}
1
+ {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../src/name.ts"],"names":[],"mappings":"AA+GA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D"}
package/dist/name.js CHANGED
@@ -97,22 +97,18 @@ function lowerLetterOf(character) {
97
97
  function codePoint(character) {
98
98
  return WORDLIKE.test(character) ? `-u${character.codePointAt(0)?.toString(16) ?? ''}-` : '-';
99
99
  }
100
- function latin(text, unknown) {
100
+ function latin(text) {
101
101
  return [...text]
102
102
  .map((character) => {
103
103
  if ((character.codePointAt(0) ?? 0) < 0x80)
104
104
  return character;
105
105
  const lower = character.toLowerCase();
106
- const letter = lowerLetterOf(lower) ?? unknown(lower);
107
- return lower === character ? letter : `${letter.charAt(0).toUpperCase()}${letter.slice(1)}`;
106
+ return lowerLetterOf(lower) ?? codePoint(lower);
108
107
  })
109
108
  .join('');
110
109
  }
111
- export function transliterated(text) {
112
- return latin(text, () => '-');
113
- }
114
110
  export function nameFrom(title) {
115
- return latin(title, codePoint)
111
+ return latin(title)
116
112
  .toLowerCase()
117
113
  .replace(/[^a-z0-9]+/g, '-')
118
114
  .replace(/^-+|-+$/g, '');
package/dist/opening.js CHANGED
@@ -7,7 +7,7 @@ import { prepare } from './preparation.js';
7
7
  import { unpair } from './queue.js';
8
8
  import { emitRooms, emitStorageLoss, statusShown } from './shown.js';
9
9
  export async function open(runtime, opened) {
10
- const { store, socket, shell, conversations, build, usableWhenHeld } = runtime;
10
+ const { store, socket, shell, conversations, build } = runtime;
11
11
  if (socket.closed())
12
12
  throw new Error('runtime closed');
13
13
  const interrupted = await opened.fences();
@@ -25,7 +25,6 @@ export async function open(runtime, opened) {
25
25
  }
26
26
  const held = await opened.opened();
27
27
  store.device.set({
28
- heldWhenOpened: usableWhenHeld.length > 0 && (await opened.covering()).rooms.size > 0,
29
28
  completedWhenOpened: (await opened.facts(['lastCompleted'])).lastCompleted !== null,
30
29
  });
31
30
  try {
@@ -46,9 +45,25 @@ export async function open(runtime, opened) {
46
45
  void eraseFenced(runtime, interrupted).catch(uncaught);
47
46
  });
48
47
  }
48
+ await factsKept(runtime, opened);
49
49
  statusShown(runtime);
50
50
  prepare(runtime);
51
51
  emitRooms(runtime);
52
52
  void unpair(runtime).catch(uncaught);
53
53
  return opened;
54
54
  }
55
+ async function factsKept({ socket, adopt }, opened) {
56
+ const { session } = socket;
57
+ const { unstored } = session.now();
58
+ if (unstored !== null) {
59
+ queueMicrotask(() => {
60
+ void adopt(unstored).catch(uncaught);
61
+ });
62
+ return;
63
+ }
64
+ const { capabilities, queriesOnly } = await opened.facts(['capabilities', 'queriesOnly']);
65
+ if (queriesOnly.length > 0 && !session.now().roomsNamed)
66
+ session.set({ queriesOnly });
67
+ if (capabilities.length > 0)
68
+ socket.readyFromStore();
69
+ }
package/dist/outcome.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ActionResult, AdapterFailure, AttachResult, BinaryLinkResult, HistoryResult, HistoryRevision, ProviderRefusal, RoomVersionAt, ScopedRefusal } from './adapter.js';
1
+ import type { ActionResult, AdapterFailure, AttachResult, BinaryCopy, BinaryLinkResult, HistoryResult, HistoryRevision, ProviderRefusal, RoomVersionAt, ScopedRefusal } from './adapter.js';
2
2
  import type { ChangeBatch } from './change.js';
3
3
  import type { Attempt, Retries } from './retried.js';
4
4
  import type { KeptBinary, KeptResult } from './opened.js';
@@ -34,8 +34,16 @@ export type BinaryLinkAnswer = {
34
34
  name: string;
35
35
  mediaType: string;
36
36
  } | Refused<'rejected'> | Refused<'absent'> | Failure;
37
- export type HeldShownAnswer = KeptBinary | BinaryLinkAnswer;
38
- export type ShownAnswer = BinaryAnswer | BinaryLinkAnswer;
37
+ export type ShownLinkAnswer = Extract<BinaryLinkAnswer, {
38
+ kind: 'link';
39
+ }> & {
40
+ copies: readonly BinaryCopy[];
41
+ };
42
+ type ShownRefusal = Exclude<BinaryLinkAnswer, {
43
+ kind: 'link';
44
+ }>;
45
+ export type HeldShownAnswer = KeptBinary | ShownLinkAnswer | ShownRefusal;
46
+ export type ShownAnswer = BinaryAnswer | ShownLinkAnswer | ShownRefusal;
39
47
  export type AttachAnswer = {
40
48
  kind: 'attached';
41
49
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../src/outcome.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C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AAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEnD,eAAO,MAAM,OAAO,EAAE,OAA6B,CAAC;AAEpD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,eAAO,MAAM,SAAS,EAAE,OAKvB,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAE9D;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAiBvD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAE7D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAIlE;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG,CACvD,UAAU,GACV;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,YAAgD,CAAC;AAE1E,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,MAAM,EAAE,YAAY,GACnB,UAAU,CAUZ"}
package/dist/outcome.js CHANGED
@@ -19,7 +19,7 @@ export const ABSENT_TARGET = {
19
19
  retryable: false,
20
20
  };
21
21
  export function absentBinary(path) {
22
- return { kind: 'absent', code: 'binary-file-absent', fields: { path }, retryable: false };
22
+ return { kind: 'absent', code: 'attachment-absent', fields: { path }, retryable: false };
23
23
  }
24
24
  export function declaredType(blob) {
25
25
  return blob.type === '' ? MEDIA_TYPES.octetStream : blob.type;
package/dist/overlay.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ApplyResult } from '@agentshouse/mdmodel';
2
- import type { BinaryFile, HeadChange } from './adapter.js';
2
+ import type { Attachment, HeadChange } from './adapter.js';
3
3
  import { type Composition } from './collection.js';
4
4
  import { type ChangeBatch } from './change.js';
5
5
  export type Heads = {
@@ -10,7 +10,7 @@ export type Heads = {
10
10
  };
11
11
  export type HeldBinary = ({
12
12
  readonly state: 'accepted';
13
- } & BinaryFile) | {
13
+ } & Attachment) | {
14
14
  readonly state: 'pending';
15
15
  readonly localId: string;
16
16
  readonly byteLength: number;
@@ -21,7 +21,7 @@ export type Layer = Heads & {
21
21
  documents: Readonly<Record<string, string>>;
22
22
  binaries: Readonly<Record<string, HeldBinary>>;
23
23
  };
24
- export declare function acceptedBinaries(files: Readonly<Record<string, BinaryFile>>): Generator<readonly [string, HeldBinary]>;
24
+ export declare function acceptedBinaries(files: Readonly<Record<string, Attachment>>): Generator<readonly [string, HeldBinary]>;
25
25
  export declare function sameBinary(left: HeldBinary | undefined, right: HeldBinary | undefined): boolean;
26
26
  export declare function sameChange(left: HeadChange | undefined, right: HeadChange | undefined): boolean;
27
27
  export declare function composed(path: string, fields: Readonly<Record<string, unknown>>, sections: Readonly<Record<string, string>>, composition: Composition): ApplyResult;
@@ -1,11 +1,13 @@
1
1
  import { type InstallShare } from './install.js';
2
2
  import { type ReadinessChange } from './observation.js';
3
3
  import { type PortReach } from './reach.js';
4
- import { type CodeAvailability, type ConnectionAvailability, type Readiness, type RoomCoverage } from './readiness.js';
4
+ import { type CodeAvailability, type ConnectionAvailability, type FirstTier, type Readiness, type RoomCoverage } from './readiness.js';
5
5
  import type { Runtime } from './runtime.js';
6
6
  export type ReadinessPort = {
7
7
  readonly target: string;
8
8
  readonly code: CodeAvailability;
9
+ readonly first: FirstTier | null;
10
+ readonly inboxed: readonly string[] | null;
9
11
  };
10
12
  export type ReadinessMessage = Readiness | ReadinessChange;
11
13
  export type ReadinessWatch = {
@@ -16,11 +18,13 @@ export type ReadinessWatch = {
16
18
  type Share = InstallShare & {
17
19
  readonly coverage: RoomCoverage;
18
20
  };
19
- type Totals = {
20
- installing: number;
21
- downloading: number;
21
+ type Settled = {
22
22
  acquiring: number;
23
23
  unsettled: number;
24
+ };
25
+ type Totals = Settled & {
26
+ installing: number;
27
+ downloading: number;
24
28
  done: number;
25
29
  total: number;
26
30
  };
@@ -29,6 +33,7 @@ export type ReadinessShowing = {
29
33
  readonly roomsListed: boolean;
30
34
  readonly named: ReadonlySet<string> | null;
31
35
  readonly rooms: Map<string, Share>;
36
+ readonly first: Map<string, string>;
32
37
  readonly totals: Totals;
33
38
  shown: string;
34
39
  };
@@ -36,6 +41,6 @@ export declare function prepare(runtime: Runtime, locators?: readonly string[]):
36
41
  export declare function connectionNow(runtime: Runtime): Promise<ConnectionAvailability>;
37
42
  export declare function deliverOwedReadiness(runtime: Runtime, owed: readonly ReadinessWatch[], touched: ReadonlySet<string> | null): Promise<void>;
38
43
  export declare function watchReadiness({ store }: Runtime, port: ReadinessPort, reach: PortReach | null, deliver: (readiness: ReadinessMessage) => void): () => void;
39
- export declare function filled(runtime: Runtime): void;
44
+ export declare function filled({ store, socket }: Runtime): void;
40
45
  export {};
41
46
  //# sourceMappingURL=preparation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preparation.d.ts","sourceRoot":"","sources":["../src/preparation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAE3B,KAAK,SAAS,EAEd,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAC;AAEx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