@agentshouse/mdruntime-adapter 0.1.0-c4c8594e5b8d9 → 0.1.0-c4e5de8f794bd
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.
- package/AGENTS.md +275 -275
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +2 -0
- package/dist/adapter.d.ts +1 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +170 -48
- package/dist/discovery.d.ts +2 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/read.d.ts +21 -1
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +78 -4
- package/dist/site.d.ts +1 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +81 -44
- package/dist/stream.d.ts +3 -2
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +220 -44
- package/dist/transport.d.ts +25 -1
- package/dist/transport.d.ts.map +1 -1
- package/dist/version.d.ts +1 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +8 -4
- package/package.json +2 -2
package/dist/stream.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { acceptedMessage } from './actions.js';
|
|
2
2
|
import { sha256Hex } from './digest.js';
|
|
3
|
-
import { binaryFileOf, headChange } from './read.js';
|
|
3
|
+
import { binaryFileOf, headChange, identities } from './read.js';
|
|
4
4
|
import { roomVersion } from './version.js';
|
|
5
5
|
const HELD_FRAMES_MAX = 256;
|
|
6
6
|
function turnOperation(frame) {
|
|
@@ -53,7 +53,9 @@ function assembled(entries) {
|
|
|
53
53
|
async function verified(entries) {
|
|
54
54
|
try {
|
|
55
55
|
for (const entry of entries) {
|
|
56
|
-
if (
|
|
56
|
+
if (entry.text === undefined || entry.sha256 === undefined)
|
|
57
|
+
continue;
|
|
58
|
+
if ((await sha256Hex(entry.text)) !== entry.sha256)
|
|
57
59
|
return false;
|
|
58
60
|
}
|
|
59
61
|
return true;
|
|
@@ -62,10 +64,34 @@ async function verified(entries) {
|
|
|
62
64
|
return false;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
67
|
+
function resumed(kept, frame) {
|
|
68
|
+
const last = frame.entries.at(-1);
|
|
69
|
+
const point = { parts: frame.index + 1, from: frame.from, target: frame.target };
|
|
70
|
+
if (last?.continued !== true)
|
|
71
|
+
return { ...point, handled: frame.handled, piece: null };
|
|
72
|
+
const text = last.text?.length ?? 0;
|
|
73
|
+
if (last.kind !== 'piece') {
|
|
74
|
+
return last.sha256 === undefined
|
|
75
|
+
? kept.resume
|
|
76
|
+
: { ...point, handled: frame.handled, piece: { sha256: last.sha256, offset: text } };
|
|
77
|
+
}
|
|
78
|
+
const piece = kept.resume?.piece ?? null;
|
|
79
|
+
if (piece === null)
|
|
80
|
+
return kept.resume;
|
|
81
|
+
const pieces = frame.entries.reduce((sum, entry) => sum + (entry.kind === 'piece' ? (entry.text?.length ?? 0) : 0), 0);
|
|
82
|
+
return {
|
|
83
|
+
...point,
|
|
84
|
+
handled: frame.handled,
|
|
85
|
+
piece: { sha256: piece.sha256, offset: piece.offset + pieces },
|
|
86
|
+
};
|
|
87
|
+
}
|
|
65
88
|
export function houseNotifications(transport, mode) {
|
|
66
89
|
const stream = transport.stream;
|
|
67
90
|
const lines = new Map();
|
|
68
|
-
const
|
|
91
|
+
const kept = new Map();
|
|
92
|
+
let receipts = null;
|
|
93
|
+
let loaded = Promise.resolve();
|
|
94
|
+
let acknowledging = null;
|
|
69
95
|
let receiving = Promise.resolve();
|
|
70
96
|
let verifying = 0;
|
|
71
97
|
const locators = new Map();
|
|
@@ -93,7 +119,7 @@ export function houseNotifications(transport, mode) {
|
|
|
93
119
|
}
|
|
94
120
|
function reopened(next) {
|
|
95
121
|
opening = next;
|
|
96
|
-
|
|
122
|
+
acknowledging = next;
|
|
97
123
|
const gapped = new Set([...replicated, ...live]);
|
|
98
124
|
live.clear();
|
|
99
125
|
for (const conversation of gapped)
|
|
@@ -155,46 +181,162 @@ export function houseNotifications(transport, mode) {
|
|
|
155
181
|
if (line !== undefined)
|
|
156
182
|
lines.set(authority, { ...line, frames: [] });
|
|
157
183
|
}
|
|
158
|
-
function
|
|
159
|
-
const held =
|
|
160
|
-
if (
|
|
161
|
-
|
|
184
|
+
async function forget(carries) {
|
|
185
|
+
const held = carries.filter((carry) => kept.delete(carry));
|
|
186
|
+
if (held.length > 0)
|
|
187
|
+
await receipts?.drop(held).catch(() => { });
|
|
188
|
+
}
|
|
189
|
+
async function lost(authority, carry) {
|
|
190
|
+
interrupt(authority);
|
|
191
|
+
await forget([carry]);
|
|
192
|
+
}
|
|
193
|
+
async function stage(frame, via) {
|
|
194
|
+
await loaded;
|
|
195
|
+
const port = receipts;
|
|
196
|
+
if (port === null)
|
|
162
197
|
return;
|
|
163
|
-
|
|
164
|
-
if (held
|
|
165
|
-
staged.delete(frame.authority);
|
|
198
|
+
const held = kept.get(frame.carry);
|
|
199
|
+
if (held === undefined && frame.index !== 0) {
|
|
166
200
|
interrupt(frame.authority);
|
|
167
201
|
return;
|
|
168
202
|
}
|
|
169
|
-
held
|
|
170
|
-
|
|
203
|
+
if (held !== undefined &&
|
|
204
|
+
(held.fenced !== null || frame.index > held.parts || frame.index < (held.resume?.parts ?? 0))) {
|
|
205
|
+
await lost(frame.authority, frame.carry);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (held === undefined) {
|
|
209
|
+
await forget([...kept.values()]
|
|
210
|
+
.filter((other) => other.authority === frame.authority && other.fenced === null)
|
|
211
|
+
.map((other) => other.carry));
|
|
212
|
+
}
|
|
213
|
+
const start = held ?? {
|
|
214
|
+
authority: frame.authority,
|
|
215
|
+
carry: frame.carry,
|
|
216
|
+
logEpoch: lines.get(frame.authority)?.logEpoch ?? null,
|
|
217
|
+
after: frame.after,
|
|
218
|
+
parts: 0,
|
|
219
|
+
resume: null,
|
|
220
|
+
fenced: null,
|
|
221
|
+
};
|
|
222
|
+
const next = { ...start, parts: frame.index + 1, resume: resumed(start, frame) };
|
|
223
|
+
const part = { entries: frame.entries };
|
|
224
|
+
try {
|
|
225
|
+
await port.keep(frame.carry, next, { index: frame.index, value: part });
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
await lost(frame.authority, frame.carry);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
kept.set(frame.carry, next);
|
|
232
|
+
via?.received(frame.authority, frame.carry, frame.index);
|
|
233
|
+
}
|
|
234
|
+
async function keptEntries(carry, parts) {
|
|
235
|
+
if (parts === 0)
|
|
236
|
+
return [];
|
|
237
|
+
if (receipts === null)
|
|
238
|
+
return null;
|
|
239
|
+
const read = (await receipts.parts(carry, parts));
|
|
240
|
+
if (read.length !== parts)
|
|
241
|
+
return null;
|
|
242
|
+
const entries = assembled(read.flatMap((part) => part.entries));
|
|
243
|
+
return entries !== null && (await verified(entries)) ? entries : null;
|
|
171
244
|
}
|
|
172
|
-
function carried(frame) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const entries = parts === null ? null : assembled(parts);
|
|
245
|
+
async function carried(frame) {
|
|
246
|
+
await loaded;
|
|
247
|
+
const held = kept.get(frame.carry);
|
|
248
|
+
if (frame.parts > 0 && held?.parts !== frame.parts) {
|
|
249
|
+
await lost(frame.authority, frame.carry);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const entries = await keptEntries(frame.carry, frame.parts).catch(() => null);
|
|
181
253
|
if (entries === null) {
|
|
182
|
-
|
|
254
|
+
await lost(frame.authority, frame.carry);
|
|
183
255
|
return;
|
|
184
256
|
}
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
257
|
+
const fenced = {
|
|
258
|
+
...(held ?? {
|
|
259
|
+
authority: frame.authority,
|
|
260
|
+
carry: frame.carry,
|
|
261
|
+
logEpoch: frame.log_epoch,
|
|
262
|
+
after: frame.after,
|
|
263
|
+
parts: 0,
|
|
264
|
+
resume: null,
|
|
265
|
+
}),
|
|
266
|
+
after: frame.after,
|
|
267
|
+
fenced: { position: frame.position, logEpoch: frame.log_epoch },
|
|
268
|
+
};
|
|
269
|
+
try {
|
|
270
|
+
await receipts?.keep(frame.carry, fenced);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
await lost(frame.authority, frame.carry);
|
|
188
274
|
return;
|
|
189
275
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
publish(frame, entries);
|
|
193
|
-
else
|
|
194
|
-
interrupt(frame.authority);
|
|
195
|
-
});
|
|
276
|
+
kept.set(frame.carry, fenced);
|
|
277
|
+
publish(frame, entries);
|
|
196
278
|
}
|
|
197
|
-
function
|
|
279
|
+
async function load(port) {
|
|
280
|
+
try {
|
|
281
|
+
for (const { key, head } of await port.heads())
|
|
282
|
+
kept.set(key, head);
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
kept.clear();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async function restored(room) {
|
|
289
|
+
const line = lines.get(room.authority);
|
|
290
|
+
let at = room.position;
|
|
291
|
+
const chain = [];
|
|
292
|
+
for (;;) {
|
|
293
|
+
const next = [...kept.values()].find((carry) => carry.authority === room.authority &&
|
|
294
|
+
carry.after === at &&
|
|
295
|
+
carry.fenced?.logEpoch === room.log_epoch);
|
|
296
|
+
if (next?.fenced == null)
|
|
297
|
+
break;
|
|
298
|
+
const entries = await keptEntries(next.carry, next.parts).catch(() => null);
|
|
299
|
+
if (entries === null)
|
|
300
|
+
break;
|
|
301
|
+
chain.push({ carry: next, entries });
|
|
302
|
+
at = next.fenced.position;
|
|
303
|
+
}
|
|
304
|
+
const partial = [...kept.values()].find((carry) => carry.authority === room.authority &&
|
|
305
|
+
carry.fenced === null &&
|
|
306
|
+
carry.logEpoch === room.log_epoch &&
|
|
307
|
+
carry.after === at &&
|
|
308
|
+
carry.resume !== null &&
|
|
309
|
+
carry.resume.parts > 0);
|
|
310
|
+
const stale = [...kept.values()].filter((carry) => carry.authority === room.authority &&
|
|
311
|
+
carry !== partial &&
|
|
312
|
+
!chain.some((link) => link.carry === carry));
|
|
313
|
+
await forget(stale.map((carry) => carry.carry));
|
|
314
|
+
if (line !== undefined && line.logEpoch === room.log_epoch && chain.length > 0) {
|
|
315
|
+
const frames = chain.map(({ carry, entries }) => ({
|
|
316
|
+
after: BigInt(carry.after),
|
|
317
|
+
position: BigInt(carry.fenced.position),
|
|
318
|
+
entries,
|
|
319
|
+
}));
|
|
320
|
+
lines.set(room.authority, { ...line, frames: [...line.frames, ...frames] });
|
|
321
|
+
}
|
|
322
|
+
return {
|
|
323
|
+
...room,
|
|
324
|
+
position: at,
|
|
325
|
+
...(partial?.resume == null
|
|
326
|
+
? {}
|
|
327
|
+
: {
|
|
328
|
+
carry: {
|
|
329
|
+
id: partial.carry,
|
|
330
|
+
parts: partial.resume.parts,
|
|
331
|
+
from: partial.resume.from,
|
|
332
|
+
target: partial.resume.target,
|
|
333
|
+
handled: partial.resume.handled,
|
|
334
|
+
...(partial.resume.piece === null ? {} : { piece: partial.resume.piece }),
|
|
335
|
+
},
|
|
336
|
+
}),
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function handle(frame, via) {
|
|
198
340
|
if (frame.type === 'signal') {
|
|
199
341
|
const mode = frame.service_mode;
|
|
200
342
|
if (mode !== 'open' && mode !== 'write-halted')
|
|
@@ -210,6 +352,10 @@ export function houseNotifications(transport, mode) {
|
|
|
210
352
|
});
|
|
211
353
|
return;
|
|
212
354
|
}
|
|
355
|
+
if (frame.type === 'authority_changed') {
|
|
356
|
+
emit({ kind: 'authority-changed', scope: { authorities: frame.rooms } });
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
213
359
|
if (frame.type === 'conversations') {
|
|
214
360
|
emitConversation({ kind: 'list', entries: frame.conversations.map(listedConversation) });
|
|
215
361
|
return;
|
|
@@ -231,10 +377,8 @@ export function houseNotifications(transport, mode) {
|
|
|
231
377
|
converse(frame);
|
|
232
378
|
return;
|
|
233
379
|
}
|
|
234
|
-
if (frame.type === 'part')
|
|
235
|
-
stage(frame);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
380
|
+
if (frame.type === 'part')
|
|
381
|
+
return stage(frame, via);
|
|
238
382
|
if (frame.type === 'carried')
|
|
239
383
|
return carried(frame);
|
|
240
384
|
}
|
|
@@ -262,8 +406,9 @@ export function houseNotifications(transport, mode) {
|
|
|
262
406
|
announce(frame.authority, { position: frame.position, logEpoch: frame.log_epoch });
|
|
263
407
|
}
|
|
264
408
|
stream.observe((frame) => {
|
|
409
|
+
const via = acknowledging;
|
|
265
410
|
if (verifying === 0) {
|
|
266
|
-
const handled = handle(frame);
|
|
411
|
+
const handled = handle(frame, via);
|
|
267
412
|
if (handled === undefined)
|
|
268
413
|
return;
|
|
269
414
|
verifying += 1;
|
|
@@ -274,16 +419,16 @@ export function houseNotifications(transport, mode) {
|
|
|
274
419
|
}
|
|
275
420
|
verifying += 1;
|
|
276
421
|
receiving = receiving
|
|
277
|
-
.then(() => handle(frame))
|
|
422
|
+
.then(() => handle(frame, via))
|
|
278
423
|
.finally(() => {
|
|
279
424
|
verifying -= 1;
|
|
280
425
|
});
|
|
281
426
|
});
|
|
282
427
|
stream.opened(reopened);
|
|
283
|
-
stream.closed((revoked) => {
|
|
428
|
+
stream.closed(({ revoked, lost }) => {
|
|
284
429
|
opening = null;
|
|
285
|
-
|
|
286
|
-
emit({ kind: 'closed', revoked });
|
|
430
|
+
acknowledging = null;
|
|
431
|
+
emit({ kind: 'closed', revoked, lost });
|
|
287
432
|
});
|
|
288
433
|
return {
|
|
289
434
|
runtime,
|
|
@@ -306,8 +451,12 @@ export function houseNotifications(transport, mode) {
|
|
|
306
451
|
};
|
|
307
452
|
},
|
|
308
453
|
},
|
|
309
|
-
observe(notify) {
|
|
454
|
+
observe(notify, port) {
|
|
310
455
|
observers.add(notify);
|
|
456
|
+
if (receipts === null) {
|
|
457
|
+
receipts = port;
|
|
458
|
+
loaded = load(port);
|
|
459
|
+
}
|
|
311
460
|
if (opening !== null) {
|
|
312
461
|
queueMicrotask(() => {
|
|
313
462
|
if (observers.has(notify))
|
|
@@ -328,7 +477,30 @@ export function houseNotifications(transport, mode) {
|
|
|
328
477
|
}
|
|
329
478
|
const current = opening;
|
|
330
479
|
opening = null;
|
|
331
|
-
current
|
|
480
|
+
if (current === null)
|
|
481
|
+
return;
|
|
482
|
+
void loaded
|
|
483
|
+
.then(() => Promise.all(rooms.map(restored)))
|
|
484
|
+
.then((presented) => {
|
|
485
|
+
current.hold(presented, runtime);
|
|
486
|
+
for (const [index, room] of presented.entries()) {
|
|
487
|
+
if (room.position === rooms[index].position)
|
|
488
|
+
continue;
|
|
489
|
+
announce(room.authority, { position: room.position, logEpoch: room.log_epoch });
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
},
|
|
493
|
+
published(locator, at) {
|
|
494
|
+
const authority = [...locators].find(([, held]) => held.includes(locator))?.[0];
|
|
495
|
+
const reached = position(at.position);
|
|
496
|
+
if (authority === undefined || reached === null)
|
|
497
|
+
return;
|
|
498
|
+
void forget([...kept.values()]
|
|
499
|
+
.filter((carry) => carry.authority === authority &&
|
|
500
|
+
carry.fenced !== null &&
|
|
501
|
+
carry.fenced.logEpoch === at.logEpoch &&
|
|
502
|
+
BigInt(carry.fenced.position) <= reached)
|
|
503
|
+
.map((carry) => carry.carry));
|
|
332
504
|
},
|
|
333
505
|
reopen() {
|
|
334
506
|
const current = opening;
|
|
@@ -347,6 +519,9 @@ export function houseNotifications(transport, mode) {
|
|
|
347
519
|
if (!locators.has(authority))
|
|
348
520
|
lines.delete(authority);
|
|
349
521
|
}
|
|
522
|
+
void loaded.then(() => forget([...kept.values()]
|
|
523
|
+
.filter((carry) => !locators.has(carry.authority))
|
|
524
|
+
.map((carry) => carry.carry)));
|
|
350
525
|
},
|
|
351
526
|
reach(authority, at) {
|
|
352
527
|
const line = lines.get(authority);
|
|
@@ -430,6 +605,7 @@ export function houseNotifications(transport, mode) {
|
|
|
430
605
|
roomVersion: roomVersion({ position: last.position.toString(), logEpoch: line.logEpoch }),
|
|
431
606
|
documents,
|
|
432
607
|
revisions,
|
|
608
|
+
...identities(revisions),
|
|
433
609
|
changes,
|
|
434
610
|
binaryFiles,
|
|
435
611
|
removals: removals.sort(),
|
package/dist/transport.d.ts
CHANGED
|
@@ -64,6 +64,10 @@ export type HouseStreamFrame = {
|
|
|
64
64
|
authority: string;
|
|
65
65
|
carry: string;
|
|
66
66
|
index: number;
|
|
67
|
+
after: string;
|
|
68
|
+
from: string;
|
|
69
|
+
target: string;
|
|
70
|
+
handled: number;
|
|
67
71
|
entries: readonly HouseStreamEntry[];
|
|
68
72
|
} | {
|
|
69
73
|
type: 'carried';
|
|
@@ -76,6 +80,9 @@ export type HouseStreamFrame = {
|
|
|
76
80
|
} | {
|
|
77
81
|
type: 'opening';
|
|
78
82
|
expired: readonly string[];
|
|
83
|
+
} | {
|
|
84
|
+
type: 'authority_changed';
|
|
85
|
+
rooms: readonly string[];
|
|
79
86
|
} | ({
|
|
80
87
|
type: 'turn';
|
|
81
88
|
conversation_id: string;
|
|
@@ -113,19 +120,36 @@ export type HouseStreamFrame = {
|
|
|
113
120
|
type: 'signal';
|
|
114
121
|
service_mode: string;
|
|
115
122
|
};
|
|
123
|
+
export type HouseHeldCarry = {
|
|
124
|
+
id: string;
|
|
125
|
+
parts: number;
|
|
126
|
+
from: string;
|
|
127
|
+
target: string;
|
|
128
|
+
handled: number;
|
|
129
|
+
piece?: {
|
|
130
|
+
sha256: string;
|
|
131
|
+
offset: number;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
116
134
|
export type HouseHeldRoom = {
|
|
117
135
|
authority: string;
|
|
118
136
|
position: string;
|
|
119
137
|
log_epoch: string;
|
|
138
|
+
carry?: HouseHeldCarry;
|
|
120
139
|
};
|
|
121
140
|
export type HouseOpening = {
|
|
122
141
|
hold(rooms: readonly HouseHeldRoom[], runtime: string): void;
|
|
142
|
+
received(authority: string, carry: string, index: number): void;
|
|
123
143
|
close(): void;
|
|
124
144
|
};
|
|
145
|
+
export type HouseClosing = {
|
|
146
|
+
revoked: boolean;
|
|
147
|
+
lost: boolean;
|
|
148
|
+
};
|
|
125
149
|
export type HouseStream = {
|
|
126
150
|
observe(receive: (frame: HouseStreamFrame) => void): () => void;
|
|
127
151
|
opened(notify: (opening: HouseOpening) => void): () => void;
|
|
128
|
-
closed(notify: (
|
|
152
|
+
closed(notify: (closing: HouseClosing) => void): () => void;
|
|
129
153
|
};
|
|
130
154
|
export type HouseDoor = {
|
|
131
155
|
door(route: string, body: unknown): Promise<HouseDoorAnswer>;
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -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,IA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O,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/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/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
|
package/dist/version.d.ts.map
CHANGED
|
@@ -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,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAEnD;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAI/D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,WAAW,GAAG,IAAI,CAKxF;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,iBAAiB,CAE/E;
|
|
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,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAEnD;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAI/D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,WAAW,GAAG,IAAI,CAKxF;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,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;
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAwHrD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAQ9E;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,CAK/D;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,cAAc,E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,CAAC;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM1B;AA4BD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,aAAa,CAyDf"}
|
package/dist/write.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { departure, } from '@agentshouse/mdruntime';
|
|
2
|
-
import { binaryFileOf, headChange } from './read.js';
|
|
2
|
+
import { binaryFileOf, headChange, identities } from './read.js';
|
|
3
3
|
import { sha256Hex, textBytes } from './digest.js';
|
|
4
4
|
import { nativePath, roomLocalPath } from './map.js';
|
|
5
5
|
import { classifyDoor, doorRefusal, scopedRefusal } from './refusal.js';
|
|
@@ -194,8 +194,11 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
194
194
|
if (refusal !== null && refusal.code === 'service_mode_write_halted') {
|
|
195
195
|
return { kind: 'write-halted' };
|
|
196
196
|
}
|
|
197
|
-
if (refusal !== null && refusal.code === 'expired')
|
|
198
|
-
return
|
|
197
|
+
if (refusal !== null && refusal.code === 'expired') {
|
|
198
|
+
return refusal.fields.restored === true
|
|
199
|
+
? { kind: 'expired', restored: true }
|
|
200
|
+
: { kind: 'expired' };
|
|
201
|
+
}
|
|
199
202
|
if (refusal !== null && refusal.code === 'edit_conflict') {
|
|
200
203
|
const { current, ...fields } = refusal.fields;
|
|
201
204
|
const held = material(current, handle) ?? [];
|
|
@@ -269,6 +272,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
269
272
|
roomVersion: roomVersion(at),
|
|
270
273
|
documents,
|
|
271
274
|
revisions,
|
|
275
|
+
...identities(revisions),
|
|
272
276
|
changes,
|
|
273
277
|
removals: removals.sort(),
|
|
274
278
|
...(Object.keys(binaryFiles).length === 0 ? {} : { binaryFiles }),
|
|
@@ -337,7 +341,7 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
337
341
|
return {
|
|
338
342
|
kind: 'scoped-refusal',
|
|
339
343
|
locator,
|
|
340
|
-
scope: '
|
|
344
|
+
scope: 'operation',
|
|
341
345
|
code: 'retained_history_unavailable',
|
|
342
346
|
fields: { path: request.path, revision: request.revision },
|
|
343
347
|
retryable: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/mdruntime-adapter",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-c4e5de8f794bd",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
28
|
+
"@agentshouse/mdruntime": "0.1.0-c1c827aa23c34"
|
|
29
29
|
}
|
|
30
30
|
}
|