@agentshouse/mdruntime-adapter 0.1.0-cb0bbc4ccacd0 → 0.1.0-cb2e7eccd0ac9
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/README.md +2 -2
- package/dist/actions.d.ts +2 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +20 -7
- package/dist/adapter.d.ts +0 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +113 -113
- package/dist/authored-path.d.ts +9 -0
- package/dist/authored-path.d.ts.map +1 -0
- package/dist/authored-path.js +34 -0
- package/dist/chunks.d.ts +37 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +269 -0
- package/dist/digest.d.ts +0 -1
- package/dist/discovery.d.ts +1 -4
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +7 -8
- package/dist/history.d.ts +1 -7
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +22 -29
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/map.d.ts +0 -1
- package/dist/model.d.ts +3 -8
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +3 -13
- package/dist/read.d.ts +9 -10
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +26 -145
- package/dist/refusal.d.ts +3 -2
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +17 -7
- package/dist/search.d.ts +0 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +5 -5
- package/dist/session-content/bounds.d.ts +7 -0
- package/dist/session-content/check.d.ts +18 -0
- package/dist/session-content/index.d.ts +7 -0
- package/dist/session-content/parts.d.ts +103 -0
- package/dist/session-content/state.d.ts +61 -0
- package/dist/session-content/turn.d.ts +328 -0
- package/dist/site.d.ts +0 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +42 -50
- package/dist/space-schema.d.ts +1 -2
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +2 -2
- package/dist/stream.d.ts +4 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +119 -49
- package/dist/transport.d.ts +25 -24
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +13 -13
- 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 -2
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +8 -6
- package/dist/version.d.ts +0 -1
- package/dist/write.d.ts +0 -2
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +19 -19
- package/package.json +3 -2
- package/dist/app-reference.d.ts +0 -2
- package/dist/app-reference.d.ts.map +0 -1
- package/dist/app-reference.js +0 -2
- package/dist/crockford.d.ts +0 -4
- package/dist/crockford.d.ts.map +0 -1
- package/dist/crockford.js +0 -3
- package/dist/house-model.d.ts +0 -641
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -361
- package/dist/part.d.ts +0 -14
- package/dist/part.d.ts.map +0 -1
- package/dist/part.js +0 -90
- package/dist/room-stream.d.ts +0 -20
- package/dist/room-stream.d.ts.map +0 -1
- package/dist/room-stream.js +0 -57
- package/dist/room-types.d.ts +0 -7
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -123
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,EAOL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cA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AS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM1B;AA6BD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7B,aAAa,CA+Cf"}
|
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, 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)),
|
|
@@ -276,10 +277,8 @@ export function* mutationOutcome(status, body, locator, handle, move) {
|
|
|
276
277
|
return scopedRefusal(locator, 'undisclosed', refusal);
|
|
277
278
|
}
|
|
278
279
|
const classified = classifyDoor(status, body, locator);
|
|
279
|
-
const reset = refusal
|
|
280
|
-
if (refusal?.
|
|
281
|
-
typeof reset === 'string' &&
|
|
282
|
-
classified?.kind === 'transport-uncertainty') {
|
|
280
|
+
const reset = resetOf(refusal);
|
|
281
|
+
if (refusal !== null && reset !== undefined && classified?.kind === 'transport-uncertainty') {
|
|
283
282
|
return {
|
|
284
283
|
kind: 'retryable-refusal',
|
|
285
284
|
code: refusal.code,
|
|
@@ -302,18 +301,19 @@ export function* mutationOutcome(status, body, locator, handle, move) {
|
|
|
302
301
|
retryable: refusal.retryable,
|
|
303
302
|
};
|
|
304
303
|
}
|
|
305
|
-
if (status !== 200
|
|
306
|
-
return
|
|
307
|
-
|
|
304
|
+
if (status !== 200)
|
|
305
|
+
return answeredFailure(status, body);
|
|
306
|
+
if (typeof body !== 'object' || body === null)
|
|
307
|
+
return unusable();
|
|
308
308
|
const held = body;
|
|
309
309
|
if (move !== undefined)
|
|
310
310
|
return yield* movedOutcome(held, move);
|
|
311
311
|
const at = readPosition(held);
|
|
312
312
|
if (at === null)
|
|
313
|
-
return
|
|
313
|
+
return unusable();
|
|
314
314
|
const contents = yield* material(held.contents, handle);
|
|
315
315
|
if (contents === null)
|
|
316
|
-
return
|
|
316
|
+
return unusable();
|
|
317
317
|
return { kind: 'accepted', ...(yield* acceptedOf(at, contents)) };
|
|
318
318
|
}
|
|
319
319
|
export function rejectedMapping(mapping) {
|
|
@@ -362,15 +362,15 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
362
362
|
if (classified !== null)
|
|
363
363
|
return classified;
|
|
364
364
|
if (status !== 200 || typeof body !== 'object' || body === null) {
|
|
365
|
-
return
|
|
365
|
+
return unusable();
|
|
366
366
|
}
|
|
367
367
|
const held = body;
|
|
368
368
|
if (!Array.isArray(held.revisions))
|
|
369
|
-
return
|
|
369
|
+
return unusable();
|
|
370
370
|
const entries = [];
|
|
371
371
|
for (const entry of held.revisions) {
|
|
372
372
|
if (typeof entry !== 'object' || entry === null)
|
|
373
|
-
return
|
|
373
|
+
return unusable();
|
|
374
374
|
entries.push(entry);
|
|
375
375
|
}
|
|
376
376
|
if (request.revision !== undefined) {
|
|
@@ -380,7 +380,7 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
380
380
|
if (typeof named.media_type === 'string')
|
|
381
381
|
return { kind: 'no-history' };
|
|
382
382
|
if (typeof named.content !== 'string')
|
|
383
|
-
return
|
|
383
|
+
return unusable();
|
|
384
384
|
return { kind: 'revision', content: named.content };
|
|
385
385
|
}
|
|
386
386
|
if (entries.length === 0)
|
|
@@ -391,11 +391,11 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
391
391
|
if (typeof entry.revision !== 'string' ||
|
|
392
392
|
author === null ||
|
|
393
393
|
typeof entry.created_at !== 'string') {
|
|
394
|
-
return
|
|
394
|
+
return unusable();
|
|
395
395
|
}
|
|
396
396
|
const binaryFile = binaryFileOf(entry);
|
|
397
397
|
if (binaryFile === null)
|
|
398
|
-
return
|
|
398
|
+
return unusable();
|
|
399
399
|
revisions.push({
|
|
400
400
|
revision: entry.revision,
|
|
401
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-cb2e7eccd0ac9",
|
|
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-ce6172ed6fa4c",
|
|
28
|
+
"@agentshouse/mdruntime": "0.1.0-c01d4615bfe46"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
package/dist/app-reference.d.ts
DELETED
|
@@ -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