@agentshouse/mdruntime-adapter 0.1.0-cc7fa1e066844 → 0.1.0-cf22c8563f9f4
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 +57 -20
- package/README.md +3 -3
- package/dist/actions.d.ts +2 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +3 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +75 -111
- package/dist/discovery.d.ts +4 -12
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +16 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/links.d.ts +9 -1
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +40 -2
- package/dist/model.d.ts +7 -18
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +48 -41
- package/dist/read.d.ts +1 -1
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +5 -8
- package/dist/refusal.d.ts +3 -4
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +31 -14
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +45 -78
- package/dist/stream.d.ts +8 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +89 -37
- package/dist/transport.d.ts +31 -2
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +0 -1
- package/dist/version.d.ts +1 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +9 -0
- package/dist/write.d.ts +9 -2
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +11 -7
- package/package.json +3 -3
package/dist/write.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseOriginals } from './read.js';
|
|
1
2
|
import { sha256Hex, textBytes } from './digest.js';
|
|
2
3
|
import { nativePath, roomLocalPath } from './map.js';
|
|
3
4
|
import { classifyDoor, doorRefusal, scopedRefusal } from './refusal.js';
|
|
@@ -165,7 +166,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
165
166
|
if (refusal !== null && refusal.code === 'service_mode_write_halted') {
|
|
166
167
|
return { kind: 'write-halted' };
|
|
167
168
|
}
|
|
168
|
-
if (refusal !== null && refusal.code === '
|
|
169
|
+
if (refusal !== null && refusal.code === 'expired')
|
|
169
170
|
return { kind: 'expired' };
|
|
170
171
|
if (refusal !== null && refusal.code === 'edit_conflict') {
|
|
171
172
|
const { current, ...fields } = refusal.fields;
|
|
@@ -182,9 +183,8 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
182
183
|
classified?.kind === 'transport-uncertainty') {
|
|
183
184
|
return { kind: 'retryable-refusal', code: refusal.code, fields: refusal.fields, reset };
|
|
184
185
|
}
|
|
185
|
-
if (classified !== null && classified.kind !== 'scoped-refusal')
|
|
186
|
-
return classified
|
|
187
|
-
}
|
|
186
|
+
if (classified !== null && classified.kind !== 'scoped-refusal')
|
|
187
|
+
return classified;
|
|
188
188
|
if (classified !== null && status === 403)
|
|
189
189
|
return classified;
|
|
190
190
|
if (refusal !== null && status >= 400) {
|
|
@@ -200,6 +200,9 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
200
200
|
const contents = material(held.contents, handle);
|
|
201
201
|
if (contents === null)
|
|
202
202
|
return { kind: 'transport-uncertainty' };
|
|
203
|
+
const originals = parseOriginals(held.originals);
|
|
204
|
+
if (originals === null)
|
|
205
|
+
return { kind: 'transport-uncertainty' };
|
|
203
206
|
const documents = {};
|
|
204
207
|
const revisions = {};
|
|
205
208
|
const removals = [];
|
|
@@ -217,6 +220,7 @@ export function mutationOutcome(status, body, locator, handle) {
|
|
|
217
220
|
documents,
|
|
218
221
|
revisions,
|
|
219
222
|
removals: removals.sort(),
|
|
223
|
+
originals,
|
|
220
224
|
};
|
|
221
225
|
}
|
|
222
226
|
export function rejectedMapping(mapping) {
|
|
@@ -248,9 +252,8 @@ function revisionAuthor(entry) {
|
|
|
248
252
|
}
|
|
249
253
|
export function historyOutcome(status, body, locator, request) {
|
|
250
254
|
const classified = classifyDoor(status, body, locator);
|
|
251
|
-
if (classified !== null)
|
|
252
|
-
return classified
|
|
253
|
-
}
|
|
255
|
+
if (classified !== null)
|
|
256
|
+
return classified;
|
|
254
257
|
if (status !== 200 || typeof body !== 'object' || body === null) {
|
|
255
258
|
return { kind: 'transport-uncertainty' };
|
|
256
259
|
}
|
|
@@ -297,5 +300,6 @@ export function historyOutcome(status, body, locator, request) {
|
|
|
297
300
|
kind: 'history',
|
|
298
301
|
revisions,
|
|
299
302
|
...(typeof next === 'number' ? { pageToken: String(next) } : {}),
|
|
303
|
+
...(held.deleted === true ? { deleted: true } : {}),
|
|
300
304
|
};
|
|
301
305
|
}
|
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-cf22c8563f9f4",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentshouse/mdmodel": "0.1.0-
|
|
29
|
-
"@agentshouse/mdruntime": "0.1.0-
|
|
28
|
+
"@agentshouse/mdmodel": "0.1.0-c3d58cb8652e6",
|
|
29
|
+
"@agentshouse/mdruntime": "0.1.0-cebcd51f70ed1"
|
|
30
30
|
}
|
|
31
31
|
}
|