@agentshouse/mdruntime-adapter 0.1.0-cd59fd8945dcb → 0.1.0-cd61dfca5d699

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 (46) hide show
  1. package/AGENTS.md +271 -262
  2. package/dist/actions.d.ts +23 -0
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +68 -31
  5. package/dist/adapter.d.ts +1 -0
  6. package/dist/adapter.d.ts.map +1 -1
  7. package/dist/adapter.js +261 -64
  8. package/dist/discovery.d.ts +2 -1
  9. package/dist/discovery.d.ts.map +1 -1
  10. package/dist/discovery.js +10 -6
  11. package/dist/handed.d.ts +15 -0
  12. package/dist/handed.d.ts.map +1 -0
  13. package/dist/handed.js +38 -0
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/model.d.ts +0 -1
  18. package/dist/model.d.ts.map +1 -1
  19. package/dist/model.js +0 -3
  20. package/dist/read.d.ts +29 -6
  21. package/dist/read.d.ts.map +1 -1
  22. package/dist/read.js +150 -52
  23. package/dist/referrer.d.ts +7 -0
  24. package/dist/referrer.d.ts.map +1 -0
  25. package/dist/referrer.js +35 -0
  26. package/dist/refusal.d.ts.map +1 -1
  27. package/dist/refusal.js +2 -1
  28. package/dist/site.d.ts +1 -1
  29. package/dist/site.d.ts.map +1 -1
  30. package/dist/site.js +174 -47
  31. package/dist/stream.d.ts +3 -2
  32. package/dist/stream.d.ts.map +1 -1
  33. package/dist/stream.js +326 -16
  34. package/dist/transport.d.ts +63 -6
  35. package/dist/transport.d.ts.map +1 -1
  36. package/dist/transport.js +3 -0
  37. package/dist/version.d.ts +1 -0
  38. package/dist/version.d.ts.map +1 -1
  39. package/dist/version.js +1 -1
  40. package/dist/write.d.ts +2 -9
  41. package/dist/write.d.ts.map +1 -1
  42. package/dist/write.js +61 -8
  43. package/package.json +2 -3
  44. package/dist/links.d.ts +0 -20
  45. package/dist/links.d.ts.map +0 -1
  46. package/dist/links.js +0 -104
package/dist/stream.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { acceptedMessage } from './actions.js';
2
- import { headChange } from './read.js';
2
+ import { sha256Hex } from './digest.js';
3
+ import { binaryFileOf, headChange, identities } from './read.js';
3
4
  import { roomVersion } from './version.js';
4
5
  const HELD_FRAMES_MAX = 256;
5
6
  function turnOperation(frame) {
@@ -14,6 +15,7 @@ function listedConversation(listed) {
14
15
  created: listed.created_at,
15
16
  finished: listed.finished_at,
16
17
  outcome: listed.outcome,
18
+ waiting: listed.waiting,
17
19
  };
18
20
  }
19
21
  function position(value) {
@@ -21,9 +23,78 @@ function position(value) {
21
23
  return null;
22
24
  return BigInt(value);
23
25
  }
26
+ function assembled(entries) {
27
+ const whole = [];
28
+ let open = null;
29
+ for (const entry of entries) {
30
+ if (entry.kind === 'piece') {
31
+ if (open === null || open.entry.path !== entry.path || entry.text === undefined)
32
+ return null;
33
+ open.texts.push(entry.text);
34
+ }
35
+ else {
36
+ if (open !== null)
37
+ return null;
38
+ if (entry.continued !== true) {
39
+ whole.push(entry);
40
+ continue;
41
+ }
42
+ if (entry.text === undefined)
43
+ return null;
44
+ open = { entry, texts: [entry.text] };
45
+ }
46
+ if (entry.continued === true)
47
+ continue;
48
+ const { continued: _continued, ...head } = open.entry;
49
+ whole.push({ ...head, text: open.texts.join('') });
50
+ open = null;
51
+ }
52
+ return open === null ? whole : null;
53
+ }
54
+ async function verified(entries) {
55
+ try {
56
+ for (const entry of entries) {
57
+ if (entry.text === undefined || entry.sha256 === undefined)
58
+ continue;
59
+ if ((await sha256Hex(entry.text)) !== entry.sha256)
60
+ return false;
61
+ }
62
+ return true;
63
+ }
64
+ catch {
65
+ return false;
66
+ }
67
+ }
68
+ function resumed(kept, frame) {
69
+ const last = frame.entries.at(-1);
70
+ const point = { parts: frame.index + 1, from: frame.from, target: frame.target };
71
+ if (last?.continued !== true)
72
+ return { ...point, handled: frame.handled, piece: null };
73
+ const text = last.text?.length ?? 0;
74
+ if (last.kind !== 'piece') {
75
+ return last.sha256 === undefined
76
+ ? kept.resume
77
+ : { ...point, handled: frame.handled, piece: { sha256: last.sha256, offset: text } };
78
+ }
79
+ const piece = kept.resume?.piece ?? null;
80
+ if (piece === null)
81
+ return kept.resume;
82
+ const pieces = frame.entries.reduce((sum, entry) => sum + (entry.kind === 'piece' ? (entry.text?.length ?? 0) : 0), 0);
83
+ return {
84
+ ...point,
85
+ handled: frame.handled,
86
+ piece: { sha256: piece.sha256, offset: piece.offset + pieces },
87
+ };
88
+ }
24
89
  export function houseNotifications(transport, mode) {
25
90
  const stream = transport.stream;
26
91
  const lines = new Map();
92
+ const kept = new Map();
93
+ let receipts = null;
94
+ let loaded = Promise.resolve();
95
+ let acknowledging = null;
96
+ let receiving = Promise.resolve();
97
+ let verifying = 0;
27
98
  const locators = new Map();
28
99
  const observers = new Set();
29
100
  const conversationObservers = new Set();
@@ -41,7 +112,10 @@ export function houseNotifications(transport, mode) {
41
112
  event.kind === 'questions' ||
42
113
  event.kind === 'process' ||
43
114
  event.kind === 'commands' ||
44
- event.kind === 'options') {
115
+ event.kind === 'options' ||
116
+ event.kind === 'starting' ||
117
+ event.kind === 'link' ||
118
+ event.kind === 'deliveries') {
45
119
  live.add(event.conversation);
46
120
  }
47
121
  for (const observer of conversationObservers)
@@ -49,6 +123,7 @@ export function houseNotifications(transport, mode) {
49
123
  }
50
124
  function reopened(next) {
51
125
  opening = next;
126
+ acknowledging = next;
52
127
  const gapped = new Set([...replicated, ...live]);
53
128
  live.clear();
54
129
  for (const conversation of gapped)
@@ -86,6 +161,18 @@ export function houseNotifications(transport, mode) {
86
161
  emitConversation({ kind: 'options', conversation, options: structuredClone(frame.options) });
87
162
  return;
88
163
  }
164
+ if (frame.type === 'starting') {
165
+ emitConversation({ kind: 'starting', conversation, step: frame.step });
166
+ return;
167
+ }
168
+ if (frame.type === 'link') {
169
+ emitConversation({ kind: 'link', conversation, connected: frame.connected });
170
+ return;
171
+ }
172
+ if (frame.type === 'deliveries') {
173
+ emitConversation({ kind: 'deliveries', conversation, unknown: [...frame.unknown] });
174
+ return;
175
+ }
89
176
  if (frame.type === 'interactions') {
90
177
  emitConversation({
91
178
  kind: 'questions',
@@ -110,7 +197,162 @@ export function houseNotifications(transport, mode) {
110
197
  if (line !== undefined)
111
198
  lines.set(authority, { ...line, frames: [] });
112
199
  }
113
- function receive(frame) {
200
+ async function forget(carries) {
201
+ const held = carries.filter((carry) => kept.delete(carry));
202
+ if (held.length > 0)
203
+ await receipts?.drop(held).catch(() => { });
204
+ }
205
+ async function lost(authority, carry) {
206
+ interrupt(authority);
207
+ await forget([carry]);
208
+ }
209
+ async function stage(frame, via) {
210
+ await loaded;
211
+ const port = receipts;
212
+ if (port === null)
213
+ return;
214
+ const held = kept.get(frame.carry);
215
+ if (held === undefined && frame.index !== 0) {
216
+ interrupt(frame.authority);
217
+ return;
218
+ }
219
+ if (held !== undefined &&
220
+ (held.fenced !== null || frame.index > held.parts || frame.index < (held.resume?.parts ?? 0))) {
221
+ await lost(frame.authority, frame.carry);
222
+ return;
223
+ }
224
+ if (held === undefined) {
225
+ await forget([...kept.values()]
226
+ .filter((other) => other.authority === frame.authority && other.fenced === null)
227
+ .map((other) => other.carry));
228
+ }
229
+ const start = held ?? {
230
+ authority: frame.authority,
231
+ carry: frame.carry,
232
+ logEpoch: lines.get(frame.authority)?.logEpoch ?? null,
233
+ after: frame.after,
234
+ parts: 0,
235
+ resume: null,
236
+ fenced: null,
237
+ };
238
+ const next = { ...start, parts: frame.index + 1, resume: resumed(start, frame) };
239
+ const part = { entries: frame.entries };
240
+ try {
241
+ await port.keep(frame.carry, next, { index: frame.index, value: part });
242
+ }
243
+ catch {
244
+ await lost(frame.authority, frame.carry);
245
+ return;
246
+ }
247
+ kept.set(frame.carry, next);
248
+ via?.received(frame.authority, frame.carry, frame.index);
249
+ }
250
+ async function keptEntries(carry, parts) {
251
+ if (parts === 0)
252
+ return [];
253
+ if (receipts === null)
254
+ return null;
255
+ const read = (await receipts.parts(carry, parts));
256
+ if (read.length !== parts)
257
+ return null;
258
+ const entries = assembled(read.flatMap((part) => part.entries));
259
+ return entries !== null && (await verified(entries)) ? entries : null;
260
+ }
261
+ async function carried(frame) {
262
+ await loaded;
263
+ const held = kept.get(frame.carry);
264
+ if (frame.parts > 0 && held?.parts !== frame.parts) {
265
+ await lost(frame.authority, frame.carry);
266
+ return;
267
+ }
268
+ const entries = await keptEntries(frame.carry, frame.parts).catch(() => null);
269
+ if (entries === null) {
270
+ await lost(frame.authority, frame.carry);
271
+ return;
272
+ }
273
+ const fenced = {
274
+ ...(held ?? {
275
+ authority: frame.authority,
276
+ carry: frame.carry,
277
+ logEpoch: frame.log_epoch,
278
+ after: frame.after,
279
+ parts: 0,
280
+ resume: null,
281
+ }),
282
+ after: frame.after,
283
+ fenced: { position: frame.position, logEpoch: frame.log_epoch },
284
+ };
285
+ try {
286
+ await receipts?.keep(frame.carry, fenced);
287
+ }
288
+ catch {
289
+ await lost(frame.authority, frame.carry);
290
+ return;
291
+ }
292
+ kept.set(frame.carry, fenced);
293
+ publish(frame, entries);
294
+ }
295
+ async function load(port) {
296
+ try {
297
+ for (const { key, head } of await port.heads())
298
+ kept.set(key, head);
299
+ }
300
+ catch {
301
+ kept.clear();
302
+ }
303
+ }
304
+ async function restored(room) {
305
+ const line = lines.get(room.authority);
306
+ let at = room.position;
307
+ const chain = [];
308
+ for (;;) {
309
+ const next = [...kept.values()].find((carry) => carry.authority === room.authority &&
310
+ carry.after === at &&
311
+ carry.fenced?.logEpoch === room.log_epoch);
312
+ if (next?.fenced == null)
313
+ break;
314
+ const entries = await keptEntries(next.carry, next.parts).catch(() => null);
315
+ if (entries === null)
316
+ break;
317
+ chain.push({ carry: next, entries });
318
+ at = next.fenced.position;
319
+ }
320
+ const partial = [...kept.values()].find((carry) => carry.authority === room.authority &&
321
+ carry.fenced === null &&
322
+ carry.logEpoch === room.log_epoch &&
323
+ carry.after === at &&
324
+ carry.resume !== null &&
325
+ carry.resume.parts > 0);
326
+ const stale = [...kept.values()].filter((carry) => carry.authority === room.authority &&
327
+ carry !== partial &&
328
+ !chain.some((link) => link.carry === carry));
329
+ await forget(stale.map((carry) => carry.carry));
330
+ if (line !== undefined && line.logEpoch === room.log_epoch && chain.length > 0) {
331
+ const frames = chain.map(({ carry, entries }) => ({
332
+ after: BigInt(carry.after),
333
+ position: BigInt(carry.fenced.position),
334
+ entries,
335
+ }));
336
+ lines.set(room.authority, { ...line, frames: [...line.frames, ...frames] });
337
+ }
338
+ return {
339
+ ...room,
340
+ position: at,
341
+ ...(partial?.resume == null
342
+ ? {}
343
+ : {
344
+ carry: {
345
+ id: partial.carry,
346
+ parts: partial.resume.parts,
347
+ from: partial.resume.from,
348
+ target: partial.resume.target,
349
+ handled: partial.resume.handled,
350
+ ...(partial.resume.piece === null ? {} : { piece: partial.resume.piece }),
351
+ },
352
+ }),
353
+ };
354
+ }
355
+ function handle(frame, via) {
114
356
  if (frame.type === 'signal') {
115
357
  const mode = frame.service_mode;
116
358
  if (mode !== 'open' && mode !== 'write-halted')
@@ -126,6 +368,10 @@ export function houseNotifications(transport, mode) {
126
368
  });
127
369
  return;
128
370
  }
371
+ if (frame.type === 'authority_changed') {
372
+ emit({ kind: 'authority-changed', scope: { authorities: frame.rooms } });
373
+ return;
374
+ }
129
375
  if (frame.type === 'conversations') {
130
376
  emitConversation({ kind: 'list', entries: frame.conversations.map(listedConversation) });
131
377
  return;
@@ -142,13 +388,20 @@ export function houseNotifications(transport, mode) {
142
388
  frame.type === 'process' ||
143
389
  frame.type === 'commands' ||
144
390
  frame.type === 'options' ||
391
+ frame.type === 'starting' ||
392
+ frame.type === 'link' ||
393
+ frame.type === 'deliveries' ||
145
394
  frame.type === 'interactions' ||
146
395
  frame.type === 'message') {
147
396
  converse(frame);
148
397
  return;
149
398
  }
150
- if (frame.type !== 'entries')
151
- return;
399
+ if (frame.type === 'part')
400
+ return stage(frame, via);
401
+ if (frame.type === 'carried')
402
+ return carried(frame);
403
+ }
404
+ function publish(frame, entries) {
152
405
  const at = position(frame.position);
153
406
  const after = position(frame.after);
154
407
  if (at === null || after === null || after >= at) {
@@ -162,7 +415,7 @@ export function houseNotifications(transport, mode) {
162
415
  const last = line.frames.at(-1);
163
416
  if (last !== undefined && at <= last.position)
164
417
  return;
165
- const held = { after, position: at, entries: frame.entries };
418
+ const held = { after, position: at, entries };
166
419
  const next = last !== undefined && after <= last.position ? [...line.frames, held] : [held];
167
420
  lines.set(frame.authority, { ...line, frames: next.length > HELD_FRAMES_MAX ? [] : next });
168
421
  }
@@ -171,11 +424,30 @@ export function houseNotifications(transport, mode) {
171
424
  }
172
425
  announce(frame.authority, { position: frame.position, logEpoch: frame.log_epoch });
173
426
  }
174
- stream.observe(receive);
427
+ stream.observe((frame) => {
428
+ const via = acknowledging;
429
+ if (verifying === 0) {
430
+ const handled = handle(frame, via);
431
+ if (handled === undefined)
432
+ return;
433
+ verifying += 1;
434
+ receiving = handled.finally(() => {
435
+ verifying -= 1;
436
+ });
437
+ return;
438
+ }
439
+ verifying += 1;
440
+ receiving = receiving
441
+ .then(() => handle(frame, via))
442
+ .finally(() => {
443
+ verifying -= 1;
444
+ });
445
+ });
175
446
  stream.opened(reopened);
176
- stream.closed((revoked) => {
447
+ stream.closed(({ revoked, lost }) => {
177
448
  opening = null;
178
- emit({ kind: 'closed', revoked });
449
+ acknowledging = null;
450
+ emit({ kind: 'closed', revoked, lost });
179
451
  });
180
452
  return {
181
453
  runtime,
@@ -198,8 +470,12 @@ export function houseNotifications(transport, mode) {
198
470
  };
199
471
  },
200
472
  },
201
- observe(notify) {
473
+ observe(notify, port) {
202
474
  observers.add(notify);
475
+ if (receipts === null) {
476
+ receipts = port;
477
+ loaded = load(port);
478
+ }
203
479
  if (opening !== null) {
204
480
  queueMicrotask(() => {
205
481
  if (observers.has(notify))
@@ -220,7 +496,30 @@ export function houseNotifications(transport, mode) {
220
496
  }
221
497
  const current = opening;
222
498
  opening = null;
223
- current?.hold(rooms, runtime);
499
+ if (current === null)
500
+ return;
501
+ void loaded
502
+ .then(() => Promise.all(rooms.map(restored)))
503
+ .then((presented) => {
504
+ current.hold(presented, runtime);
505
+ for (const [index, room] of presented.entries()) {
506
+ if (room.position === rooms[index].position)
507
+ continue;
508
+ announce(room.authority, { position: room.position, logEpoch: room.log_epoch });
509
+ }
510
+ });
511
+ },
512
+ published(locator, at) {
513
+ const authority = [...locators].find(([, held]) => held.includes(locator))?.[0];
514
+ const reached = position(at.position);
515
+ if (authority === undefined || reached === null)
516
+ return;
517
+ void forget([...kept.values()]
518
+ .filter((carry) => carry.authority === authority &&
519
+ carry.fenced !== null &&
520
+ carry.fenced.logEpoch === at.logEpoch &&
521
+ BigInt(carry.fenced.position) <= reached)
522
+ .map((carry) => carry.carry));
224
523
  },
225
524
  reopen() {
226
525
  const current = opening;
@@ -239,6 +538,9 @@ export function houseNotifications(transport, mode) {
239
538
  if (!locators.has(authority))
240
539
  lines.delete(authority);
241
540
  }
541
+ void loaded.then(() => forget([...kept.values()]
542
+ .filter((carry) => !locators.has(carry.authority))
543
+ .map((carry) => carry.carry)));
242
544
  },
243
545
  reach(authority, at) {
244
546
  const line = lines.get(authority);
@@ -265,6 +567,7 @@ export function houseNotifications(transport, mode) {
265
567
  const documents = {};
266
568
  const revisions = {};
267
569
  const changes = {};
570
+ const binaryFiles = {};
268
571
  const removals = [];
269
572
  const applied = [];
270
573
  const schemas = new Map();
@@ -272,6 +575,7 @@ export function houseNotifications(transport, mode) {
272
575
  delete documents[path];
273
576
  delete revisions[path];
274
577
  delete changes[path];
578
+ delete binaryFiles[path];
275
579
  const removed = removals.indexOf(path);
276
580
  if (removed !== -1)
277
581
  removals.splice(removed, 1);
@@ -292,7 +596,8 @@ export function houseNotifications(transport, mode) {
292
596
  removals.push(entry.path);
293
597
  continue;
294
598
  }
295
- if (entry.text === undefined)
599
+ const binary = binaryFileOf(entry);
600
+ if (binary === null || (binary === undefined && entry.text === undefined))
296
601
  return null;
297
602
  if (mode === 'credential' && entry.revision === undefined)
298
603
  return null;
@@ -300,9 +605,13 @@ export function houseNotifications(transport, mode) {
300
605
  if (head === null)
301
606
  return null;
302
607
  forget(entry.path);
303
- documents[entry.path] = entry.text;
304
- if (entry.revision !== undefined)
305
- revisions[entry.path] = entry.revision;
608
+ if (binary === undefined)
609
+ documents[entry.path] = entry.text;
610
+ else
611
+ binaryFiles[entry.path] = binary;
612
+ const revision = entry.revision ?? binary?.sha256;
613
+ if (revision !== undefined)
614
+ revisions[entry.path] = revision;
306
615
  if (head !== undefined)
307
616
  changes[entry.path] = head;
308
617
  }
@@ -315,8 +624,9 @@ export function houseNotifications(transport, mode) {
315
624
  roomVersion: roomVersion({ position: last.position.toString(), logEpoch: line.logEpoch }),
316
625
  documents,
317
626
  revisions,
627
+ ...identities(revisions),
318
628
  changes,
319
- binaryTargets: [],
629
+ binaryFiles,
320
630
  removals: removals.sort(),
321
631
  },
322
632
  entries: applied,
@@ -14,8 +14,15 @@ export type HouseDoorAnswer = {
14
14
  status: number;
15
15
  body: unknown;
16
16
  };
17
- export type HouseByteAct = 'authored_batch_upload' | 'conversation_file_upload';
18
- export type HouseByteBody = string | ArrayBuffer | Uint8Array;
17
+ export declare const DOOR_FILES_GET = "/door/files/get";
18
+ export declare const SITE_FILES = "/_house/files/";
19
+ export declare const SITE_FILE_RECORD = "record";
20
+ export type HouseByteAct = 'authored_batch_upload' | 'conversation_file_upload' | 'binary_stage';
21
+ export type HouseByteBody = string | ArrayBuffer | Uint8Array | Blob;
22
+ export type HouseBytesAnswer = {
23
+ status: number;
24
+ blob: Blob | null;
25
+ };
19
26
  export type HouseByteTransfer = {
20
27
  act: HouseByteAct;
21
28
  url: string;
@@ -24,10 +31,13 @@ export type HouseByteTransfer = {
24
31
  };
25
32
  export type HouseStreamEntry = {
26
33
  path: string;
27
- kind: 'edited' | 'removed';
34
+ kind: 'edited' | 'removed' | 'piece';
28
35
  revision?: string;
29
36
  sha256?: string;
30
37
  text?: string;
38
+ file?: string;
39
+ bytes?: number;
40
+ media_type?: string;
31
41
  author?: {
32
42
  user: string;
33
43
  name: string;
@@ -36,6 +46,7 @@ export type HouseStreamEntry = {
36
46
  name: string;
37
47
  };
38
48
  created_at?: string;
49
+ continued?: true;
39
50
  };
40
51
  type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
41
52
  kind: K;
@@ -47,17 +58,32 @@ export type HouseListedConversation = {
47
58
  created_at: string;
48
59
  finished_at: string | null;
49
60
  outcome: string | null;
61
+ waiting: boolean;
50
62
  };
51
63
  export type HouseStreamFrame = {
52
- type: 'entries';
64
+ type: 'part';
53
65
  authority: string;
66
+ carry: string;
67
+ index: number;
68
+ after: string;
69
+ from: string;
70
+ target: string;
71
+ handled: number;
72
+ entries: readonly HouseStreamEntry[];
73
+ } | {
74
+ type: 'carried';
75
+ authority: string;
76
+ carry: string;
77
+ parts: number;
54
78
  after: string;
55
79
  position: string;
56
80
  log_epoch: string;
57
- entries: readonly HouseStreamEntry[];
58
81
  } | {
59
82
  type: 'opening';
60
83
  expired: readonly string[];
84
+ } | {
85
+ type: 'authority_changed';
86
+ rooms: readonly string[];
61
87
  } | ({
62
88
  type: 'turn';
63
89
  conversation_id: string;
@@ -70,6 +96,10 @@ export type HouseStreamFrame = {
70
96
  type: 'interactions';
71
97
  conversation_id: string;
72
98
  interactions: readonly unknown[];
99
+ } | {
100
+ type: 'deliveries';
101
+ conversation_id: string;
102
+ unknown: readonly string[];
73
103
  } | {
74
104
  type: 'process';
75
105
  conversation_id: string;
@@ -82,6 +112,14 @@ export type HouseStreamFrame = {
82
112
  type: 'options';
83
113
  conversation_id: string;
84
114
  options: LiveFact<'options'>['options'];
115
+ } | {
116
+ type: 'starting';
117
+ conversation_id: string;
118
+ step: string | null;
119
+ } | {
120
+ type: 'link';
121
+ conversation_id: string;
122
+ connected: boolean;
85
123
  } | {
86
124
  type: 'conversations';
87
125
  conversations: readonly HouseListedConversation[];
@@ -95,19 +133,36 @@ export type HouseStreamFrame = {
95
133
  type: 'signal';
96
134
  service_mode: string;
97
135
  };
136
+ export type HouseHeldCarry = {
137
+ id: string;
138
+ parts: number;
139
+ from: string;
140
+ target: string;
141
+ handled: number;
142
+ piece?: {
143
+ sha256: string;
144
+ offset: number;
145
+ };
146
+ };
98
147
  export type HouseHeldRoom = {
99
148
  authority: string;
100
149
  position: string;
101
150
  log_epoch: string;
151
+ carry?: HouseHeldCarry;
102
152
  };
103
153
  export type HouseOpening = {
104
154
  hold(rooms: readonly HouseHeldRoom[], runtime: string): void;
155
+ received(authority: string, carry: string, index: number): void;
105
156
  close(): void;
106
157
  };
158
+ export type HouseClosing = {
159
+ revoked: boolean;
160
+ lost: boolean;
161
+ };
107
162
  export type HouseStream = {
108
163
  observe(receive: (frame: HouseStreamFrame) => void): () => void;
109
164
  opened(notify: (opening: HouseOpening) => void): () => void;
110
- closed(notify: (revoked: boolean) => void): () => void;
165
+ closed(notify: (closing: HouseClosing) => void): () => void;
111
166
  };
112
167
  export type HouseDoor = {
113
168
  door(route: string, body: unknown): Promise<HouseDoorAnswer>;
@@ -115,10 +170,12 @@ export type HouseDoor = {
115
170
  };
116
171
  export type HouseTransport = HouseDoor & {
117
172
  transfer(request: HouseByteTransfer): Promise<HouseDoorAnswer>;
173
+ download(url: string): Promise<HouseBytesAnswer>;
118
174
  };
119
175
  export type HouseSiteTransport = HouseDoor & {
120
176
  online(): boolean;
121
177
  read(route: string): Promise<HouseDoorAnswer>;
178
+ download(route: string): Promise<HouseBytesAnswer>;
122
179
  };
123
180
  export {};
124
181
  //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,eAAO,MAAM,cAAc,oBAA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C/D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,MAAM,IAAI,OAAO,CAAC;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
package/dist/transport.js CHANGED
@@ -8,3 +8,6 @@ export const SITE_DOOR_DISCOVER = '/_house/door/discover';
8
8
  export const SITE_DOOR_BOOTSTRAP = '/_house/door/bootstrap/';
9
9
  export const SITE_DOOR_ENUMERATE = '/_house/door/enumerate';
10
10
  export const SITE_DOOR_SUBMIT = '/_house/door/submit';
11
+ export const DOOR_FILES_GET = '/door/files/get';
12
+ export const SITE_FILES = '/_house/files/';
13
+ export const SITE_FILE_RECORD = 'record';
package/dist/version.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare function roomVersion(at: LogPosition): string;
11
11
  export declare function logPosition(version: string): LogPosition | null;
12
12
  export declare function readPosition(held: Readonly<Record<string, unknown>>): LogPosition | null;
13
13
  export declare function presented(authority: string, at: LogPosition): PresentedPosition;
14
+ export declare const DECIMAL: RegExp;
14
15
  export declare function reachedVersion(roomVersion: string, target: string, currentEpoch: string | undefined): boolean;
15
16
  export declare function followsVersion(roomVersion: string, next: string): boolean;
16
17
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,C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E,EAAE,WAAW,GAAG,iBAAiB,CAE/E;AAED,eAAO,MAAM,OAAO,QAAwB,CAAC;AAE7C,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,CAQT;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMzE"}
package/dist/version.js CHANGED
@@ -18,7 +18,7 @@ export function readPosition(held) {
18
18
  export function presented(authority, at) {
19
19
  return { authority, position: at.position, log_epoch: at.logEpoch };
20
20
  }
21
- const DECIMAL = /^(?:0|[1-9][0-9]*)$/;
21
+ export const DECIMAL = /^(?:0|[1-9][0-9]*)$/;
22
22
  export function reachedVersion(roomVersion, target, currentEpoch) {
23
23
  if (roomVersion === target)
24
24
  return true;