@agentshouse/mdruntime-adapter 0.1.0-ca764edcceec6 → 0.1.0-caaa68a6ba2a5

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 (58) hide show
  1. package/README.md +2 -2
  2. package/dist/actions.d.ts +4 -22
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +21 -134
  5. package/dist/adapter.d.ts.map +1 -1
  6. package/dist/adapter.js +280 -170
  7. package/dist/app-reference.d.ts +2 -0
  8. package/dist/app-reference.d.ts.map +1 -0
  9. package/dist/app-reference.js +2 -0
  10. package/dist/crockford.d.ts +4 -0
  11. package/dist/crockford.d.ts.map +1 -0
  12. package/dist/crockford.js +3 -0
  13. package/dist/discovery.d.ts +6 -10
  14. package/dist/discovery.d.ts.map +1 -1
  15. package/dist/discovery.js +38 -34
  16. package/dist/gather.d.ts +1 -1
  17. package/dist/gather.d.ts.map +1 -1
  18. package/dist/gather.js +4 -14
  19. package/dist/house-model.d.ts +2 -0
  20. package/dist/house-model.d.ts.map +1 -0
  21. package/dist/house-model.js +483 -0
  22. package/dist/index.d.ts +7 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +6 -1
  25. package/dist/model.d.ts +5 -1
  26. package/dist/model.d.ts.map +1 -1
  27. package/dist/model.js +11 -13
  28. package/dist/part.d.ts +15 -0
  29. package/dist/part.d.ts.map +1 -0
  30. package/dist/part.js +82 -0
  31. package/dist/read.d.ts +57 -26
  32. package/dist/read.d.ts.map +1 -1
  33. package/dist/read.js +268 -152
  34. package/dist/room-types.d.ts +7 -0
  35. package/dist/room-types.d.ts.map +1 -0
  36. package/dist/room-types.js +125 -0
  37. package/dist/site.d.ts.map +1 -1
  38. package/dist/site.js +82 -105
  39. package/dist/stream.d.ts +5 -5
  40. package/dist/stream.d.ts.map +1 -1
  41. package/dist/stream.js +61 -39
  42. package/dist/transport.d.ts +26 -15
  43. package/dist/transport.d.ts.map +1 -1
  44. package/dist/transport.js +2 -1
  45. package/dist/upload.d.ts +12 -0
  46. package/dist/upload.d.ts.map +1 -0
  47. package/dist/upload.js +63 -0
  48. package/dist/write.d.ts +12 -1
  49. package/dist/write.d.ts.map +1 -1
  50. package/dist/write.js +92 -55
  51. package/package.json +8 -4
  52. package/AGENTS.md +0 -299
  53. package/dist/handed.d.ts +0 -15
  54. package/dist/handed.d.ts.map +0 -1
  55. package/dist/handed.js +0 -38
  56. package/dist/referrer.d.ts +0 -7
  57. package/dist/referrer.d.ts.map +0 -1
  58. package/dist/referrer.js +0 -35
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAUR,MAAM,wBAAwB,CAAC;AA2BhC,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAyCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAyR1F"}
1
+ {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAWR,MAAM,wBAAwB,CAAC;AA+BhC,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAoCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CA4P1F"}
package/dist/site.js CHANGED
@@ -1,12 +1,13 @@
1
+ import { stepped } from '@agentshouse/mdruntime';
1
2
  import { actionOutcome, SITE_SUBMIT } from './actions.js';
2
3
  import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
3
- import { partModels, streamedModels, viewModels } from './model.js';
4
- import { advancedScope, bootstrapOf, parseEnumeration, parseSiteBootstrap, refreshFrom, siteBootstrapNext, siteBootstrapOffset, viewOf, wholeView, } from './read.js';
5
- import { sha256Hex } from './digest.js';
4
+ import { manifestedModels, partModels, streamedModels, viewModels } from './model.js';
5
+ import { bootstrapping, emptyScope, housePart, manifested, parseEnumeration, parseSiteParted, partInventory, refreshFrom, viewOf, wholeView, } from './read.js';
6
+ import { PART_ATTEMPTS, partArrival, partFrame, unverifiedPart } from './part.js';
6
7
  import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
8
+ import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
7
9
  import { houseNotifications } from './stream.js';
8
- import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, SITE_FILE_RECORD, SITE_FILES, } from './transport.js';
9
- import { houseReferrer } from './referrer.js';
10
+ import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, SITE_FILES, } from './transport.js';
10
11
  import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
11
12
  const UNCERTAIN = { kind: 'transport-uncertainty' };
12
13
  function unfound() {
@@ -18,32 +19,20 @@ function siteRoom(tracked) {
18
19
  locator: tracked.locator,
19
20
  handle: tracked.handle,
20
21
  roomVersion: roomVersion(tracked),
21
- operations: { read: [''], sync: [''], write: [], delete: [] },
22
- replica: { selection: tracked.locator, admission: 'admitted' },
22
+ operations: { write: [], delete: [] },
23
+ replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
23
24
  providerOwnedPaths: [],
24
25
  };
25
26
  }
26
- function settled(refused) {
27
- return refused.kind === 'beyond-horizon' ? UNCERTAIN : refused;
28
- }
29
27
  export function createSiteAdapter(transport, snapshot = false) {
30
28
  const notifications = houseNotifications(transport, 'site');
31
29
  const tracked = new Map();
32
- function published(referrer) {
33
- const named = houseReferrer(referrer, tracked);
34
- return named === null || !tracked.has(named.locator) ? null : named;
35
- }
30
+ const expired = new Map();
36
31
  function fileRoute(request) {
37
- const named = published(request.kind === 'path' ? { room: request.locator, path: request.path } : request.referrer);
38
- if (named === null) {
39
- return { kind: 'rejected', code: 'referrer_unknown', fields: {}, retryable: false };
40
- }
41
- if (request.fileRef === undefined)
42
- return unfound();
43
- const { room_ref, path, record } = named.referrer;
44
- return `${SITE_FILES}${room_ref}/${encodeURIComponent(request.fileRef)}/${path === undefined
45
- ? `${SITE_FILE_RECORD}/${encodeURIComponent(record)}`
46
- : encodeURIComponent(path)}`;
32
+ const entry = tracked.get(request.locator);
33
+ if (entry === undefined)
34
+ return { kind: 'room-not-readable', locator: request.locator };
35
+ return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
47
36
  }
48
37
  async function enumerated(entry, from, page) {
49
38
  const answer = await transport.door(SITE_DOOR_ENUMERATE, {
@@ -68,73 +57,43 @@ export function createSiteAdapter(transport, snapshot = false) {
68
57
  const first = await enumerated(entry, from);
69
58
  return 'kind' in first ? first : wholeView(first, (page) => enumerated(entry, from, page));
70
59
  }
71
- async function bootstrapPart(entry, after, offset) {
72
- const query = [
73
- ...(after === null ? [] : [`after=${encodeURIComponent(after)}`]),
74
- ...(offset === null ? [] : [`offset=${offset}`]),
75
- ];
76
- const answer = await transport.read(`${SITE_DOOR_BOOTSTRAP}${entry.authority}${query.length === 0 ? '' : `?${query.join('&')}`}`);
60
+ async function partedRoom(entry) {
61
+ const cut = expired.get(entry.locator);
62
+ const answer = await transport.read(`${SITE_DOOR_BOOTSTRAP}${entry.authority}${cut === undefined ? '' : `?expired=${cut}`}`);
77
63
  const classified = classifyDoor(answer.status, answer.body, entry.locator);
78
64
  if (classified !== null)
79
- return { failure: classified };
80
- const scope = parseSiteBootstrap(answer.body);
81
- return scope === null ? { failure: UNCERTAIN } : { body: answer.body, scope };
82
- }
83
- async function assembled(entry, scope, path, offset) {
84
- const opened = scope.contents.at(-1);
85
- if (opened === undefined || opened.path !== path || opened.content.length !== offset) {
86
- return UNCERTAIN;
87
- }
88
- let text = opened.content;
89
- for (;;) {
90
- const part = await bootstrapPart(entry, path, text.length);
91
- if ('failure' in part)
92
- return part.failure;
93
- const [piece] = part.scope.contents;
94
- if (piece === undefined ||
95
- part.scope.contents.length !== 1 ||
96
- piece.path !== path ||
97
- piece.content.length === 0) {
98
- return UNCERTAIN;
99
- }
100
- text += piece.content;
101
- const more = siteBootstrapOffset(part.body);
102
- if (more === null)
103
- break;
104
- if (more !== text.length)
105
- return UNCERTAIN;
106
- }
107
- const file = scope.files.find((held) => held.path === path);
108
- if (file === undefined || (await sha256Hex(text)) !== file.version)
109
- return UNCERTAIN;
110
- return { ...scope, contents: [...scope.contents.slice(0, -1), { path, content: text }] };
65
+ return classified;
66
+ const room = parseSiteParted(answer.body);
67
+ return room === null || room.anchor !== entry.authority ? UNCERTAIN : room;
111
68
  }
112
- async function caughtUp(entry, after) {
113
- const part = await bootstrapPart(entry, after, null);
114
- if ('failure' in part)
115
- return part;
116
- const next = siteBootstrapNext(part.body);
117
- const offset = siteBootstrapOffset(part.body);
118
- if (offset !== null) {
119
- if (next === null)
120
- return { failure: UNCERTAIN };
121
- const scope = await assembled(entry, part.scope, next, offset);
122
- return 'kind' in scope ? { failure: scope } : { scope, next };
69
+ async function fetchedPart(entry, room, listed, received, arriving) {
70
+ if (received !== undefined) {
71
+ const kept = new Uint8Array(received);
72
+ const held = await housePart(room, kept, listed, 'site');
73
+ if (held !== null)
74
+ return 'kind' in held ? held : { scope: held, frame: kept };
123
75
  }
124
- const { scope } = part;
125
- if (after !== null || next !== null || roomVersion(scope) === roomVersion(entry)) {
126
- return { scope, next };
76
+ for (let attempt = 0; attempt < PART_ATTEMPTS; attempt += 1) {
77
+ const answer = await transport.read(`${SITE_DOOR_BOOTSTRAP}${entry.authority}?part=${encodeURIComponent(listed.part)}`, partArrival(listed, arriving));
78
+ const failure = classifyRead(answer.status, answer.body, entry.locator);
79
+ if (failure?.kind === 'beyond-horizon')
80
+ expired.set(entry.locator, room.position);
81
+ if (failure !== null)
82
+ return failure;
83
+ const frame = partFrame(answer.body);
84
+ if (frame === null)
85
+ continue;
86
+ const scope = await housePart(room, frame, listed, 'site');
87
+ if (scope !== null)
88
+ return 'kind' in scope ? scope : { scope, frame };
127
89
  }
128
- const view = await enumeration(entry, scope);
129
- if ('kind' in view)
130
- return { failure: settled(view) };
131
- return { scope: advancedScope(scope, view), next: null };
90
+ return unverifiedPart(entry.locator);
132
91
  }
133
92
  async function refreshed(entry, fromRoomVersion) {
134
93
  const from = logPosition(fromRoomVersion);
135
94
  if (from === null)
136
95
  return { kind: 'beyond-horizon' };
137
- const streamed = notifications.advance(entry, from);
96
+ const streamed = await stepped(notifications.advance(entry, from));
138
97
  if (streamed !== null) {
139
98
  const models = await streamedModels(streamed.schemas, entry, 'site');
140
99
  return models === undefined ? streamed.page : { ...streamed.page, models };
@@ -143,7 +102,7 @@ export function createSiteAdapter(transport, snapshot = false) {
143
102
  if ('kind' in view)
144
103
  return view;
145
104
  notifications.reach(entry.authority, view);
146
- const answer = refreshFrom(view, fromRoomVersion);
105
+ const answer = await refreshFrom(view, fromRoomVersion);
147
106
  if (answer.kind !== 'net-advancement')
148
107
  return answer;
149
108
  const models = await viewModels(view, entry);
@@ -152,6 +111,8 @@ export function createSiteAdapter(transport, snapshot = false) {
152
111
  return {
153
112
  localSaves: true,
154
113
  exhaustiveDiscovery: true,
114
+ roomTypes: HOUSE_ROOM_TYPES,
115
+ nameableRoomTypes: HOUSE_NAMEABLE_ROOM_TYPES,
155
116
  async authorize() {
156
117
  return {};
157
118
  },
@@ -174,23 +135,43 @@ export function createSiteAdapter(transport, snapshot = false) {
174
135
  const entry = tracked.get(request.locator);
175
136
  if (entry === undefined)
176
137
  return { kind: 'room-not-readable', locator: request.locator };
177
- const continued = request.pageToken === undefined
178
- ? null
179
- : JSON.parse(request.pageToken);
180
- const held = await caughtUp(entry, continued?.after ?? null);
181
- if ('failure' in held)
182
- return held.failure;
183
- notifications.reach(entry.authority, held.scope);
138
+ let continued;
139
+ let inventory;
140
+ if (request.pageToken === undefined) {
141
+ const room = await partedRoom(entry);
142
+ if ('kind' in room)
143
+ return room;
144
+ const { models, seen } = await manifestedModels(room, entry);
145
+ continued = { room, next: 0, seen };
146
+ inventory = partInventory(room);
147
+ if (inventory.parts > 0) {
148
+ return manifested(room, inventory, JSON.stringify(continued), models);
149
+ }
150
+ }
151
+ else
152
+ continued = JSON.parse(request.pageToken);
153
+ const listed = continued.room.parts[continued.next];
154
+ const sent = listed === undefined
155
+ ? { scope: emptyScope(continued.room), frame: null }
156
+ : await fetchedPart(entry, continued.room, listed, request.received, request.arriving);
157
+ if ('kind' in sent)
158
+ return sent;
159
+ const { scope } = sent;
160
+ notifications.reach(entry.authority, scope);
161
+ const next = continued.next + 1;
162
+ const more = next < continued.room.parts.length;
184
163
  const seen = [
185
- ...(continued?.seen ?? []),
186
- ...entry.schemas.filter((schema) => held.scope.files.some((file) => file.path === schema)),
164
+ ...continued.seen,
165
+ ...(scope.files.some((file) => file.path === entry.schema) ? [entry.schema] : []),
187
166
  ];
188
- const models = await partModels(held.scope, entry, new Set(seen), held.next === null);
189
- const continuation = held.next === null ? null : { after: held.next, seen };
167
+ const models = await partModels(scope, entry, new Set(seen), !more);
168
+ const { folders: _folders, ...page } = await stepped(bootstrapping(scope));
190
169
  return {
191
- ...bootstrapOf(held.scope),
170
+ ...page,
192
171
  ...(models === undefined ? {} : { models }),
193
- ...(continuation === null ? {} : { pageToken: JSON.stringify(continuation) }),
172
+ ...(more ? { pageToken: JSON.stringify({ ...continued, next, seen }) } : {}),
173
+ ...(inventory === undefined ? {} : { inventory }),
174
+ ...(sent.frame === null ? {} : { received: sent.frame }),
194
175
  };
195
176
  },
196
177
  async refresh(_authorization, request) {
@@ -209,6 +190,9 @@ export function createSiteAdapter(transport, snapshot = false) {
209
190
  async mutate() {
210
191
  return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {}, retryable: false };
211
192
  },
193
+ async attach() {
194
+ return { kind: 'rejected', code: 'write-grant', fields: {}, retryable: false };
195
+ },
212
196
  async history() {
213
197
  return { kind: 'no-history' };
214
198
  },
@@ -219,8 +203,8 @@ export function createSiteAdapter(transport, snapshot = false) {
219
203
  const read = await transport.download(route);
220
204
  if (read.status === 404)
221
205
  return unfound();
222
- return read.status === 200 && read.blob !== null
223
- ? { kind: 'binary', blob: read.blob }
206
+ return read.status === 200 && read.body !== null
207
+ ? { kind: 'binary', body: read.body, mediaType: read.mediaType }
224
208
  : UNCERTAIN;
225
209
  },
226
210
  async link(_authorization, request) {
@@ -233,13 +217,6 @@ export function createSiteAdapter(transport, snapshot = false) {
233
217
  name: request.path.slice(request.path.lastIndexOf('/') + 1),
234
218
  };
235
219
  },
236
- referrerScope(referrer) {
237
- const named = published(referrer);
238
- if (named === null)
239
- return null;
240
- const { path } = named.referrer;
241
- return { kind: 'room', locator: named.locator, ...(path === undefined ? {} : { path }) };
242
- },
243
220
  reached(locator, version, target) {
244
221
  return reachedVersion(version, target, tracked.get(locator)?.logEpoch);
245
222
  },
@@ -270,7 +247,7 @@ export function createSiteAdapter(transport, snapshot = false) {
270
247
  return [];
271
248
  notifications.reach(entry.authority, at);
272
249
  return [presented(entry.authority, at)];
273
- }), null);
250
+ }));
274
251
  },
275
252
  reopen: notifications.reopen,
276
253
  observe: notifications.observe,
package/dist/stream.d.ts CHANGED
@@ -1,22 +1,22 @@
1
- import type { ConversationStream, RefreshPage, RoomStreamEvent, ServiceModeSignal, StreamReceipts } from '@agentshouse/mdruntime';
1
+ import { type ConversationStream, type RefreshPage, type RoomStreamEvent, type ServiceModeSignal, type StreamReceipts } from '@agentshouse/mdruntime';
2
2
  import type { TrackedAuthority } from './discovery.js';
3
- import type { HouseDemand, HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
3
+ import type { HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
4
4
  import { type LogPosition } from './version.js';
5
5
  export type HeldRevision = (path: string, revision: string) => boolean;
6
6
  export type StreamedAdvancement = {
7
7
  page: RefreshPage;
8
- entries: readonly HouseStreamEntry[];
9
8
  schemas: ReadonlyMap<string, HouseStreamEntry>;
10
9
  };
11
10
  export type HouseNotifications = {
12
11
  runtime: string;
13
12
  observe(notify: (event: RoomStreamEvent) => void, receipts: StreamReceipts): () => void;
14
- send(rooms: readonly HouseHeldRoom[], demand: HouseDemand | null): void;
13
+ send(rooms: readonly HouseHeldRoom[]): void;
15
14
  published(locator: string, at: LogPosition): void;
16
15
  reopen(): void;
17
16
  track(authorities: readonly TrackedAuthority[]): void;
18
17
  reach(authority: string, at: LogPosition): void;
19
- advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): StreamedAdvancement | null;
18
+ edited(tracked: TrackedAuthority, from: LogPosition): readonly string[];
19
+ advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): Generator<number, StreamedAdvancement | null, void>;
20
20
  conversations: ConversationStream;
21
21
  serviceMode: ServiceModeSignal;
22
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAElB,WAAW,EACX,eAAe,EAEf,iBAAiB,EACjB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,aAAa,EAEb,SAAS,EAET,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AA0C7D,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,OAA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G,kBAAkB,CA8jB5F"}
package/dist/stream.js CHANGED
@@ -1,6 +1,7 @@
1
+ import { ROW_WEIGHT, } from '@agentshouse/mdruntime';
1
2
  import { acceptedMessage } from './actions.js';
2
3
  import { sha256Hex } from './digest.js';
3
- import { binaryFileOf, headChange, identities } from './read.js';
4
+ import { answered, answering, binaryFileOf, folded, forgotten, headChange, revised, } from './read.js';
4
5
  import { roomVersion } from './version.js';
5
6
  const HELD_FRAMES_MAX = 256;
6
7
  function turnOperation(frame) {
@@ -15,6 +16,7 @@ function listedConversation(listed) {
15
16
  created: listed.created_at,
16
17
  finished: listed.finished_at,
17
18
  outcome: listed.outcome,
19
+ waiting: listed.waiting,
18
20
  };
19
21
  }
20
22
  function position(value) {
@@ -111,7 +113,10 @@ export function houseNotifications(transport, mode) {
111
113
  event.kind === 'questions' ||
112
114
  event.kind === 'process' ||
113
115
  event.kind === 'commands' ||
114
- event.kind === 'options') {
116
+ event.kind === 'options' ||
117
+ event.kind === 'starting' ||
118
+ event.kind === 'link' ||
119
+ event.kind === 'deliveries') {
115
120
  live.add(event.conversation);
116
121
  }
117
122
  for (const observer of conversationObservers)
@@ -157,6 +162,18 @@ export function houseNotifications(transport, mode) {
157
162
  emitConversation({ kind: 'options', conversation, options: structuredClone(frame.options) });
158
163
  return;
159
164
  }
165
+ if (frame.type === 'starting') {
166
+ emitConversation({ kind: 'starting', conversation, step: frame.step });
167
+ return;
168
+ }
169
+ if (frame.type === 'link') {
170
+ emitConversation({ kind: 'link', conversation, connected: frame.connected });
171
+ return;
172
+ }
173
+ if (frame.type === 'deliveries') {
174
+ emitConversation({ kind: 'deliveries', conversation, unknown: [...frame.unknown] });
175
+ return;
176
+ }
160
177
  if (frame.type === 'interactions') {
161
178
  emitConversation({
162
179
  kind: 'questions',
@@ -353,7 +370,7 @@ export function houseNotifications(transport, mode) {
353
370
  return;
354
371
  }
355
372
  if (frame.type === 'authority_changed') {
356
- emit({ kind: 'authority-changed' });
373
+ emit({ kind: 'authority-changed', scope: { authorities: frame.rooms } });
357
374
  return;
358
375
  }
359
376
  if (frame.type === 'conversations') {
@@ -372,6 +389,9 @@ export function houseNotifications(transport, mode) {
372
389
  frame.type === 'process' ||
373
390
  frame.type === 'commands' ||
374
391
  frame.type === 'options' ||
392
+ frame.type === 'starting' ||
393
+ frame.type === 'link' ||
394
+ frame.type === 'deliveries' ||
375
395
  frame.type === 'interactions' ||
376
396
  frame.type === 'message') {
377
397
  converse(frame);
@@ -467,7 +487,7 @@ export function houseNotifications(transport, mode) {
467
487
  observers.delete(notify);
468
488
  };
469
489
  },
470
- send(rooms, demand) {
490
+ send(rooms) {
471
491
  for (const room of rooms) {
472
492
  const line = lines.get(room.authority);
473
493
  const held = position(room.position);
@@ -482,7 +502,7 @@ export function houseNotifications(transport, mode) {
482
502
  void loaded
483
503
  .then(() => Promise.all(rooms.map(restored)))
484
504
  .then((presented) => {
485
- current.hold(presented, runtime, demand);
505
+ current.hold(presented, runtime);
486
506
  for (const [index, room] of presented.entries()) {
487
507
  if (room.position === rooms[index].position)
488
508
  continue;
@@ -536,7 +556,18 @@ export function houseNotifications(transport, mode) {
536
556
  held,
537
557
  });
538
558
  },
539
- advance(tracked, from, holds) {
559
+ edited(tracked, from) {
560
+ const line = lines.get(tracked.authority);
561
+ const start = position(from.position);
562
+ if (line === undefined || start === null || line.logEpoch !== from.logEpoch)
563
+ return [];
564
+ return [
565
+ ...new Set(line.frames
566
+ .filter((frame) => frame.position > start)
567
+ .flatMap((frame) => frame.entries.flatMap((entry) => entry.kind === 'edited' && entry.revision !== undefined ? [entry.path] : []))),
568
+ ];
569
+ },
570
+ *advance(tracked, from, holds) {
540
571
  const line = lines.get(tracked.authority);
541
572
  const start = position(from.position);
542
573
  if (line === undefined || start === null || line.logEpoch !== from.logEpoch)
@@ -545,36 +576,26 @@ export function houseNotifications(transport, mode) {
545
576
  const first = pending[0];
546
577
  if (first === undefined || first.after > start)
547
578
  return null;
548
- const documents = {};
549
- const revisions = {};
550
- const changes = {};
551
- const binaryFiles = {};
552
- const removals = [];
553
- const applied = [];
579
+ const answer = answering();
554
580
  const schemas = new Map();
555
- const forget = (path) => {
556
- delete documents[path];
557
- delete revisions[path];
558
- delete changes[path];
559
- delete binaryFiles[path];
560
- const removed = removals.indexOf(path);
561
- if (removed !== -1)
562
- removals.splice(removed, 1);
563
- };
564
581
  for (const frame of pending) {
565
582
  for (const entry of frame.entries) {
583
+ yield ROW_WEIGHT + (entry.text?.length ?? 0);
584
+ if (entry.kind === 'folder') {
585
+ folded(answer, entry.path, entry.removed === true);
586
+ continue;
587
+ }
566
588
  if (entry.kind === 'edited' &&
567
589
  entry.revision !== undefined &&
568
590
  holds?.(entry.path, entry.revision) === true) {
569
- forget(entry.path);
591
+ forgotten(answer, entry.path);
570
592
  continue;
571
593
  }
572
- applied.push(entry);
573
- if (tracked.schemas.includes(entry.path))
594
+ if (entry.path === tracked.schema)
574
595
  schemas.set(entry.path, entry);
575
596
  if (entry.kind === 'removed') {
576
- forget(entry.path);
577
- removals.push(entry.path);
597
+ forgotten(answer, entry.path);
598
+ answer.removals.add(entry.path);
578
599
  continue;
579
600
  }
580
601
  const binary = binaryFileOf(entry);
@@ -585,32 +606,33 @@ export function houseNotifications(transport, mode) {
585
606
  const head = headChange(entry);
586
607
  if (head === null)
587
608
  return null;
588
- forget(entry.path);
609
+ forgotten(answer, entry.path);
589
610
  if (binary === undefined)
590
- documents[entry.path] = entry.text;
611
+ answer.documents.set(entry.path, entry.text);
591
612
  else
592
- binaryFiles[entry.path] = binary;
613
+ answer.binaryFiles.set(entry.path, binary);
593
614
  const revision = entry.revision ?? binary?.sha256;
594
615
  if (revision !== undefined)
595
- revisions[entry.path] = revision;
616
+ revised(answer, entry.path, revision);
596
617
  if (head !== undefined)
597
- changes[entry.path] = head;
618
+ answer.changes.set(entry.path, head);
598
619
  }
599
620
  }
600
621
  const last = pending.at(-1);
601
- lines.set(tracked.authority, { ...line, frames: pending, held: last.position });
622
+ const current = lines.get(tracked.authority);
623
+ if (current?.logEpoch === line.logEpoch) {
624
+ lines.set(tracked.authority, {
625
+ ...current,
626
+ frames: current.frames.filter((frame) => frame.position > start),
627
+ held: current.held !== null && current.held > last.position ? current.held : last.position,
628
+ });
629
+ }
602
630
  return {
603
631
  page: {
604
632
  kind: 'net-advancement',
605
633
  roomVersion: roomVersion({ position: last.position.toString(), logEpoch: line.logEpoch }),
606
- documents,
607
- revisions,
608
- ...identities(revisions),
609
- changes,
610
- binaryFiles,
611
- removals: removals.sort(),
634
+ ...(yield* answered(answer)),
612
635
  },
613
- entries: applied,
614
636
  schemas,
615
637
  };
616
638
  },
@@ -15,27 +15,27 @@ export type HouseDoorAnswer = {
15
15
  body: unknown;
16
16
  };
17
17
  export declare const DOOR_FILES_GET = "/door/files/get";
18
+ export declare const DOOR_FILES_ATTACH = "/door/files/attach";
19
+ export declare const DOOR_FILES_FINISH = "/door/files/finish";
18
20
  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;
21
+ export type HouseByteAct = 'authored_batch_upload';
22
22
  export type HouseBytesAnswer = {
23
23
  status: number;
24
- blob: Blob | null;
24
+ body: ReadableStream<Uint8Array> | null;
25
+ mediaType: string;
25
26
  };
26
27
  export type HouseByteTransfer = {
27
28
  act: HouseByteAct;
28
29
  url: string;
29
- body: HouseByteBody;
30
- operation?: string;
30
+ body: string;
31
31
  };
32
32
  export type HouseStreamEntry = {
33
33
  path: string;
34
- kind: 'edited' | 'removed' | 'piece';
34
+ kind: 'edited' | 'removed' | 'piece' | 'folder';
35
+ removed?: true;
35
36
  revision?: string;
36
37
  sha256?: string;
37
38
  text?: string;
38
- file?: string;
39
39
  bytes?: number;
40
40
  media_type?: string;
41
41
  author?: {
@@ -58,6 +58,7 @@ export type HouseListedConversation = {
58
58
  created_at: string;
59
59
  finished_at: string | null;
60
60
  outcome: string | null;
61
+ waiting: boolean;
61
62
  };
62
63
  export type HouseStreamFrame = {
63
64
  type: 'part';
@@ -82,6 +83,7 @@ export type HouseStreamFrame = {
82
83
  expired: readonly string[];
83
84
  } | {
84
85
  type: 'authority_changed';
86
+ rooms: readonly string[];
85
87
  } | ({
86
88
  type: 'turn';
87
89
  conversation_id: string;
@@ -94,6 +96,10 @@ export type HouseStreamFrame = {
94
96
  type: 'interactions';
95
97
  conversation_id: string;
96
98
  interactions: readonly unknown[];
99
+ } | {
100
+ type: 'deliveries';
101
+ conversation_id: string;
102
+ unknown: readonly string[];
97
103
  } | {
98
104
  type: 'process';
99
105
  conversation_id: string;
@@ -106,6 +112,14 @@ export type HouseStreamFrame = {
106
112
  type: 'options';
107
113
  conversation_id: string;
108
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;
109
123
  } | {
110
124
  type: 'conversations';
111
125
  conversations: readonly HouseListedConversation[];
@@ -136,12 +150,8 @@ export type HouseHeldRoom = {
136
150
  log_epoch: string;
137
151
  carry?: HouseHeldCarry;
138
152
  };
139
- export type HouseDemand = {
140
- rooms: readonly string[];
141
- conversations: boolean;
142
- };
143
153
  export type HouseOpening = {
144
- hold(rooms: readonly HouseHeldRoom[], runtime: string, demand: HouseDemand | null): void;
154
+ hold(rooms: readonly HouseHeldRoom[], runtime: string): void;
145
155
  received(authority: string, carry: string, index: number): void;
146
156
  close(): void;
147
157
  };
@@ -155,16 +165,17 @@ export type HouseStream = {
155
165
  closed(notify: (closing: HouseClosing) => void): () => void;
156
166
  };
157
167
  export type HouseDoor = {
158
- door(route: string, body: unknown): Promise<HouseDoorAnswer>;
168
+ door(route: string, body: unknown, arriving?: (bytes: number) => void): Promise<HouseDoorAnswer>;
159
169
  stream: HouseStream;
160
170
  };
161
171
  export type HouseTransport = HouseDoor & {
162
172
  transfer(request: HouseByteTransfer): Promise<HouseDoorAnswer>;
173
+ put(url: string, body: Blob, headers: Readonly<Record<string, string>>): Promise<number>;
163
174
  download(url: string): Promise<HouseBytesAnswer>;
164
175
  };
165
176
  export type HouseSiteTransport = HouseDoor & {
166
177
  online(): boolean;
167
- read(route: string): Promise<HouseDoorAnswer>;
178
+ read(route: string, arriving?: (bytes: number) => void): Promise<HouseDoorAnswer>;
168
179
  download(route: string): Promise<HouseBytesAnswer>;
169
180
  };
170
181
  export {};
@@ -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,oBAAoB,CAAC;AAEhD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,uBAAuB,GAAG,0BAA0B,GAAG,cAAc,CAAC;AAEjG,MAAM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