@agentshouse/mdruntime-adapter 0.1.0-c8d322eea4abd → 0.1.0-c8d6935639fda
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/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +62 -49
- package/dist/authored-path.d.ts +0 -1
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +2 -3
- package/dist/chunks.d.ts +2 -3
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +71 -37
- package/dist/discovery.d.ts +16 -5
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +127 -6
- package/dist/history.d.ts +1 -6
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +21 -28
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -6
- package/dist/model.d.ts +5 -5
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -27
- package/dist/read.d.ts +5 -19
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +34 -35
- package/dist/refusal.d.ts +2 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +12 -6
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +4 -4
- package/dist/session-content/index.d.ts +1 -1
- package/dist/session-content/parts.d.ts +4 -3
- package/dist/session-content/turn.d.ts +3 -3
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +15 -17
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +1 -8
- package/dist/stream.d.ts +2 -3
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +79 -72
- package/dist/transport.d.ts +28 -11
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +3 -1
- package/dist/uncertain.d.ts +5 -0
- package/dist/uncertain.d.ts.map +1 -0
- package/dist/uncertain.js +11 -0
- package/dist/upload.d.ts +3 -1
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +8 -6
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +17 -15
- package/package.json +3 -2
- package/dist/app-reference.d.ts +0 -1
- package/dist/app-reference.d.ts.map +0 -1
- package/dist/app-reference.js +0 -2
- package/dist/crockford.d.ts +0 -3
- package/dist/crockford.d.ts.map +0 -1
- package/dist/crockford.js +0 -3
- package/dist/house-model.d.ts +0 -697
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -405
- package/dist/room-types.d.ts +0 -4
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -120
package/dist/write.js
CHANGED
|
@@ -2,8 +2,9 @@ import { departure, partsChanges, ROW_WEIGHT, } from '@agentshouse/mdruntime';
|
|
|
2
2
|
import { answered, answering, binaryFileOf, headChange, revised } from './read.js';
|
|
3
3
|
import { sha256Hex, textBytes } from './digest.js';
|
|
4
4
|
import { nativePath, roomLocalPath } from './map.js';
|
|
5
|
-
import { classifyDoor, doorRefusal, resetOf, scopedRefusal } from './refusal.js';
|
|
5
|
+
import { answeredFailure, classifyDoor, doorRefusal, resetOf, scopedRefusal } from './refusal.js';
|
|
6
6
|
import { readPosition, roomVersion } from './version.js';
|
|
7
|
+
import { unusable } from './uncertain.js';
|
|
7
8
|
function priorField(batch, path, name) {
|
|
8
9
|
return batch.preconditions.find((precondition) => precondition.kind === 'field' && precondition.path === path && precondition.name === name);
|
|
9
10
|
}
|
|
@@ -28,7 +29,7 @@ function created(change, path) {
|
|
|
28
29
|
const { type, ...fields } = change.fields;
|
|
29
30
|
if (typeof type !== 'string' || type.length === 0)
|
|
30
31
|
return null;
|
|
31
|
-
return { op: 'create_typed', path, type, fields
|
|
32
|
+
return { op: 'create_typed', path, type, fields };
|
|
32
33
|
}
|
|
33
34
|
function operationOf(batch, change, handle) {
|
|
34
35
|
const path = nativePath(change.path, handle);
|
|
@@ -244,12 +245,12 @@ function* movedOutcome(held, move) {
|
|
|
244
245
|
const left = at(move.source.authority);
|
|
245
246
|
const arrived = at(move.destination.authority);
|
|
246
247
|
if (left === null || arrived === null)
|
|
247
|
-
return
|
|
248
|
+
return unusable();
|
|
248
249
|
const under = (handle) => (path) => path.startsWith(`/rooms/${handle}/`);
|
|
249
250
|
const leaving = yield* material(held.contents, move.source.handle, under(move.source.handle));
|
|
250
251
|
const arriving = yield* material(held.contents, move.destination.handle, under(move.destination.handle));
|
|
251
252
|
if (leaving === null || arriving === null)
|
|
252
|
-
return
|
|
253
|
+
return unusable();
|
|
253
254
|
return {
|
|
254
255
|
kind: 'accepted',
|
|
255
256
|
...(yield* acceptedOf(left, leaving)),
|
|
@@ -300,18 +301,19 @@ export function* mutationOutcome(status, body, locator, handle, move) {
|
|
|
300
301
|
retryable: refusal.retryable,
|
|
301
302
|
};
|
|
302
303
|
}
|
|
303
|
-
if (status !== 200
|
|
304
|
-
return
|
|
305
|
-
|
|
304
|
+
if (status !== 200)
|
|
305
|
+
return answeredFailure(status, body);
|
|
306
|
+
if (typeof body !== 'object' || body === null)
|
|
307
|
+
return unusable();
|
|
306
308
|
const held = body;
|
|
307
309
|
if (move !== undefined)
|
|
308
310
|
return yield* movedOutcome(held, move);
|
|
309
311
|
const at = readPosition(held);
|
|
310
312
|
if (at === null)
|
|
311
|
-
return
|
|
313
|
+
return unusable();
|
|
312
314
|
const contents = yield* material(held.contents, handle);
|
|
313
315
|
if (contents === null)
|
|
314
|
-
return
|
|
316
|
+
return unusable();
|
|
315
317
|
return { kind: 'accepted', ...(yield* acceptedOf(at, contents)) };
|
|
316
318
|
}
|
|
317
319
|
export function rejectedMapping(mapping) {
|
|
@@ -360,15 +362,15 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
360
362
|
if (classified !== null)
|
|
361
363
|
return classified;
|
|
362
364
|
if (status !== 200 || typeof body !== 'object' || body === null) {
|
|
363
|
-
return
|
|
365
|
+
return unusable();
|
|
364
366
|
}
|
|
365
367
|
const held = body;
|
|
366
368
|
if (!Array.isArray(held.revisions))
|
|
367
|
-
return
|
|
369
|
+
return unusable();
|
|
368
370
|
const entries = [];
|
|
369
371
|
for (const entry of held.revisions) {
|
|
370
372
|
if (typeof entry !== 'object' || entry === null)
|
|
371
|
-
return
|
|
373
|
+
return unusable();
|
|
372
374
|
entries.push(entry);
|
|
373
375
|
}
|
|
374
376
|
if (request.revision !== undefined) {
|
|
@@ -378,7 +380,7 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
378
380
|
if (typeof named.media_type === 'string')
|
|
379
381
|
return { kind: 'no-history' };
|
|
380
382
|
if (typeof named.content !== 'string')
|
|
381
|
-
return
|
|
383
|
+
return unusable();
|
|
382
384
|
return { kind: 'revision', content: named.content };
|
|
383
385
|
}
|
|
384
386
|
if (entries.length === 0)
|
|
@@ -389,11 +391,11 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
389
391
|
if (typeof entry.revision !== 'string' ||
|
|
390
392
|
author === null ||
|
|
391
393
|
typeof entry.created_at !== 'string') {
|
|
392
|
-
return
|
|
394
|
+
return unusable();
|
|
393
395
|
}
|
|
394
396
|
const binaryFile = binaryFileOf(entry);
|
|
395
397
|
if (binaryFile === null)
|
|
396
|
-
return
|
|
398
|
+
return unusable();
|
|
397
399
|
revisions.push({
|
|
398
400
|
revision: entry.revision,
|
|
399
401
|
author,
|
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-c8d6935639fda",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@agentshouse/
|
|
27
|
+
"@agentshouse/mdmodel": "0.1.0-c03f6cf931ca0",
|
|
28
|
+
"@agentshouse/mdruntime": "0.1.0-c780569da0b1c"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
package/dist/app-reference.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const APP_REFERENCE_PATTERN: RegExp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-reference.d.ts","sourceRoot":"","sources":["../src/app-reference.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,QAEjC,CAAC"}
|
package/dist/app-reference.js
DELETED
package/dist/crockford.d.ts
DELETED
package/dist/crockford.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crockford.d.ts","sourceRoot":"","sources":["../src/crockford.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAErE,eAAO,MAAM,mBAAmB,uCAA4B,CAAC;AAE7D,eAAO,MAAM,2BAA2B,QAAqC,CAAC"}
|
package/dist/crockford.js
DELETED