@agentshouse/mdruntime-adapter 0.1.0-ce7ce34e4ced0 → 0.1.0-ce861e3fb788a
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 +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +27 -5
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +35 -53
- package/dist/authored-path.d.ts +54 -2
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +142 -10
- package/dist/chunks.js +1 -1
- package/dist/discovery.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/read.d.ts +6 -6
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +9 -9
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +20 -0
- package/dist/room-query.d.ts.map +1 -1
- package/dist/room-query.js +24 -9
- package/dist/session-content/check.d.ts +4 -1
- package/dist/session-content/index.d.ts +1 -1
- package/dist/session-content/parts.d.ts +5 -5
- package/dist/session-content/state.d.ts +18 -18
- package/dist/session-content/turn.d.ts +55 -40
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +12 -4
- package/dist/stream.d.ts +2 -1
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +72 -4
- package/dist/transport.d.ts +36 -8
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -13
- package/dist/upload.d.ts +4 -0
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +41 -0
- package/dist/write.d.ts +3 -8
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +70 -88
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ host.attach(port, { app: 'my-app' });
|
|
|
25
25
|
|
|
26
26
|
App code never imports this package; it reaches the Runtime only through the
|
|
27
27
|
client its host hands it. The rules an App's agent follows are the `apps/` pages
|
|
28
|
-
of House's Guide, which House's `guide
|
|
28
|
+
of House's Guide, which House's `guide` tool opens.
|
|
29
29
|
|
|
30
30
|
## License
|
|
31
31
|
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI7F,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAI/C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAMhD,CAAC;AAcF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,iBAAiB,EAAE,CAOvF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAIvB;AAwBD,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY,CAajG"}
|
package/dist/actions.js
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
import { answeredFailure, doorRefusal, resetOf } from './refusal.js';
|
|
2
|
+
import { movedPaths, renamedHandle } from './renamed.js';
|
|
2
3
|
import { refusedFor } from './uncertain.js';
|
|
3
4
|
export const HOUSE_UNKEPT_READS = [
|
|
4
|
-
'account
|
|
5
|
-
'billing
|
|
6
|
-
'clients
|
|
5
|
+
'account.read security',
|
|
6
|
+
'account.billing',
|
|
7
|
+
'account.clients',
|
|
7
8
|
];
|
|
8
9
|
export const HOUSE_LEADING_READS = [
|
|
10
|
+
'app.list',
|
|
9
11
|
'apps/list',
|
|
10
12
|
'sites/list',
|
|
11
13
|
'rooms/members/list',
|
|
14
|
+
'sharing.members',
|
|
12
15
|
];
|
|
16
|
+
const ROOM_SELECTORS = new Map([
|
|
17
|
+
['update', { room: 'changes.room', roomPaths: ['changes.path', 'changes.to', 'paths', 'mount'] }],
|
|
18
|
+
['sharing', { room: 'room' }],
|
|
19
|
+
['sharing_update', { room: 'room' }],
|
|
20
|
+
['inbox_update', { room: 'room', roomPaths: ['path'] }],
|
|
21
|
+
['agent', { room: 'room' }],
|
|
22
|
+
['agent_update', { room: 'room' }],
|
|
23
|
+
['environment', { room: 'room' }],
|
|
24
|
+
]);
|
|
13
25
|
export function declaredActions(routes) {
|
|
14
|
-
return routes.map((name) => ({
|
|
26
|
+
return routes.map((name) => ({
|
|
27
|
+
name,
|
|
28
|
+
inputShape: {},
|
|
29
|
+
resultKind: 'house',
|
|
30
|
+
...(ROOM_SELECTORS.get(name) ?? { room: 'room_ref' }),
|
|
31
|
+
}));
|
|
15
32
|
}
|
|
16
33
|
export function houseAction(transport, request) {
|
|
17
34
|
const route = routeOf(request.name);
|
|
@@ -57,5 +74,10 @@ export function actionOutcome(answer, name, input) {
|
|
|
57
74
|
return { kind: 'action', result: answer.body };
|
|
58
75
|
}
|
|
59
76
|
async function carry(transport, route, name, input) {
|
|
60
|
-
|
|
77
|
+
const answered = actionOutcome(await transport.door(route, input), name, input);
|
|
78
|
+
const renamed = renamedHandle(answered);
|
|
79
|
+
if (renamed === null)
|
|
80
|
+
return answered;
|
|
81
|
+
const moved = movedPaths(input, ROOM_SELECTORS.get(name)?.roomPaths ?? [], renamed);
|
|
82
|
+
return actionOutcome(await transport.door(route, moved), name, moved);
|
|
61
83
|
}
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,OAAO,EAIP,aAAa,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,OAAO,EAIP,aAAa,EAkBd,MAAM,wBAAwB,CAAC;AA0BhC,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAoBxB,MAAM,MAAM,yBAAyB,GACjC;IACE,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACrC,GACD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAcrD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CA0cpF"}
|
package/dist/adapter.js
CHANGED
|
@@ -4,14 +4,15 @@ import { capabilities, discoveredRoom, mapDiscovery, parseAuthorityChange, parse
|
|
|
4
4
|
import { createSiteAdapter } from './site.js';
|
|
5
5
|
import { parseFileAddress, parseGrant } from './read.js';
|
|
6
6
|
import { chunkedHead, chunkLister, chunkPart } from './chunks.js';
|
|
7
|
-
import { finishedUpload, houseUpload } from './upload.js';
|
|
7
|
+
import { finishedUpload, houseUpload, stagedBatch } from './upload.js';
|
|
8
8
|
import { houseAction, HOUSE_LEADING_READS, HOUSE_UNKEPT_READS } from './actions.js';
|
|
9
9
|
import { houseQuery } from './room-query.js';
|
|
10
10
|
import { houseSearch } from './search.js';
|
|
11
|
-
import { answeredFailure, classifyDoor,
|
|
11
|
+
import { answeredFailure, classifyDoor, keyedFailure } from './refusal.js';
|
|
12
12
|
import { UNANSWERED, unusable } from './uncertain.js';
|
|
13
13
|
import { houseNotifications, } from './stream.js';
|
|
14
14
|
import { houseDoorRoute, } from './transport.js';
|
|
15
|
+
import { renamedHandle } from './renamed.js';
|
|
15
16
|
import { batchPaths, deltaBody, deltaBytes, deltaDigest, historyOutcome, houseChanges, houseMove, mutationOutcome, operationHead, rejectedMapping, revisionBody, uploadable, } from './write.js';
|
|
16
17
|
import { admittedPath } from './authored-path.js';
|
|
17
18
|
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
@@ -19,10 +20,6 @@ const EXPIRED_ADDRESS = 403;
|
|
|
19
20
|
function lapsedGrant(outcome) {
|
|
20
21
|
return outcome.kind === 'rejected' && outcome.code === 'upload_unavailable';
|
|
21
22
|
}
|
|
22
|
-
function unstagedRefusal(answer) {
|
|
23
|
-
const refusal = doorRefusal(answer.body);
|
|
24
|
-
return refusal?.code === 'files_unstaged' ? refusal : null;
|
|
25
|
-
}
|
|
26
23
|
export function createAgentsHouseAdapter(options) {
|
|
27
24
|
if ('site' in options)
|
|
28
25
|
return createSiteAdapter(options.site, options.snapshot === true);
|
|
@@ -153,8 +150,9 @@ export function createAgentsHouseAdapter(options) {
|
|
|
153
150
|
if (handed !== undefined && handed.sha256 === sha256) {
|
|
154
151
|
return { body: { ...head, paths, upload: handed, runtime: notifications.runtime } };
|
|
155
152
|
}
|
|
156
|
-
const minted = await transport.door(houseDoorRoute('
|
|
153
|
+
const minted = await transport.door(houseDoorRoute('update'), {
|
|
157
154
|
...head,
|
|
155
|
+
op: 'stage',
|
|
158
156
|
paths,
|
|
159
157
|
bytes,
|
|
160
158
|
sha256,
|
|
@@ -181,24 +179,6 @@ export function createAgentsHouseAdapter(options) {
|
|
|
181
179
|
await keep(upload);
|
|
182
180
|
return { body: { ...head, paths, upload, runtime: notifications.runtime } };
|
|
183
181
|
}
|
|
184
|
-
async function staged(uploads, { changeBatch: batch, file }) {
|
|
185
|
-
if (!Array.isArray(uploads))
|
|
186
|
-
return unusable();
|
|
187
|
-
for (const named of uploads) {
|
|
188
|
-
const upload = houseUpload(named);
|
|
189
|
-
const change = batch.changes.find((held) => held.kind === 'binary' && held.sha256 === named.sha256);
|
|
190
|
-
if (upload === null || change === undefined)
|
|
191
|
-
return unusable();
|
|
192
|
-
const finished = await finishedUpload(transport, upload, await file(change.localId));
|
|
193
|
-
if ('unfinished' in finished)
|
|
194
|
-
return answeredFailure(finished.unfinished, null);
|
|
195
|
-
if (finished.status !== 200)
|
|
196
|
-
return answeredFailure(finished.status, finished.body);
|
|
197
|
-
if (finished.body?.staged !== true)
|
|
198
|
-
return unusable();
|
|
199
|
-
}
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
182
|
async function submit(request, head, changes, delta, bytes, entry, handed, keep, into) {
|
|
203
183
|
const inline = { ...head, changes, runtime: notifications.runtime };
|
|
204
184
|
const prepared = uploadable(inline, bytes, declared())
|
|
@@ -206,19 +186,12 @@ export function createAgentsHouseAdapter(options) {
|
|
|
206
186
|
: { body: inline };
|
|
207
187
|
if ('outcome' in prepared)
|
|
208
188
|
return prepared.outcome;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
const settled = unstaged === null
|
|
217
|
-
? answer
|
|
218
|
-
: await transport.door(houseDoorRoute('files/batch'), prepared.body);
|
|
219
|
-
if (unstaged !== null && unstagedRefusal(settled) !== null) {
|
|
220
|
-
return answeredFailure(settled.status, settled.body);
|
|
221
|
-
}
|
|
189
|
+
const settled = await stagedBatch(transport, prepared.body, (sha256) => {
|
|
190
|
+
const change = request.changeBatch.changes.find((held) => held.kind === 'binary' && held.sha256 === sha256);
|
|
191
|
+
return change === undefined ? null : request.file(change.localId);
|
|
192
|
+
});
|
|
193
|
+
if ('kind' in settled)
|
|
194
|
+
return settled;
|
|
222
195
|
return stepped(mutationOutcome(settled.status, settled.body, entry.locator, entry.handle, into === undefined
|
|
223
196
|
? undefined
|
|
224
197
|
: {
|
|
@@ -226,6 +199,23 @@ export function createAgentsHouseAdapter(options) {
|
|
|
226
199
|
destination: { authority: into.authority, handle: into.handle },
|
|
227
200
|
}));
|
|
228
201
|
}
|
|
202
|
+
async function mutated(request, keep, entry, into) {
|
|
203
|
+
const batch = request.changeBatch;
|
|
204
|
+
const mapped = into === undefined
|
|
205
|
+
? houseChanges(batch, entry.handle, request.written)
|
|
206
|
+
: houseMove(batch, entry.handle, into.handle);
|
|
207
|
+
if (mapped.kind === 'unmapped')
|
|
208
|
+
return rejectedMapping(mapped);
|
|
209
|
+
const head = operationHead(batch);
|
|
210
|
+
const delta = deltaBody(mapped.changes);
|
|
211
|
+
const bytes = deltaBytes(delta);
|
|
212
|
+
const handed = request.upload;
|
|
213
|
+
const answer = (upload) => submit(request, head, mapped.changes, delta, bytes, entry, upload, keep, into);
|
|
214
|
+
const outcome = await answer(handed);
|
|
215
|
+
if (handed === undefined || !lapsedGrant(outcome))
|
|
216
|
+
return outcome;
|
|
217
|
+
return answer(undefined);
|
|
218
|
+
}
|
|
229
219
|
function refusedOn(answer, locator) {
|
|
230
220
|
if (locator === null)
|
|
231
221
|
return keyedFailure(answer.status, answer.body);
|
|
@@ -338,26 +328,17 @@ export function createAgentsHouseAdapter(options) {
|
|
|
338
328
|
const entry = authorityFor(request.locator);
|
|
339
329
|
if (entry === undefined)
|
|
340
330
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
341
|
-
const
|
|
342
|
-
const destination = batch.between?.destination.room;
|
|
331
|
+
const destination = request.changeBatch.between?.destination.room;
|
|
343
332
|
const into = destination === undefined ? undefined : authorityFor(destination);
|
|
344
333
|
if (destination !== undefined && into === undefined) {
|
|
345
334
|
return { kind: 'room-not-readable', locator: destination };
|
|
346
335
|
}
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (mapped.kind === 'unmapped')
|
|
351
|
-
return rejectedMapping(mapped);
|
|
352
|
-
const head = operationHead(batch, entry.authority);
|
|
353
|
-
const delta = deltaBody(mapped.changes);
|
|
354
|
-
const bytes = deltaBytes(delta);
|
|
355
|
-
const handed = request.upload;
|
|
356
|
-
const answer = (upload) => submit(request, head, mapped.changes, delta, bytes, entry, upload, keep, into);
|
|
357
|
-
const outcome = await answer(handed);
|
|
358
|
-
if (handed === undefined || !lapsedGrant(outcome))
|
|
336
|
+
const outcome = await mutated(request, keep, entry, into);
|
|
337
|
+
const renamed = renamedHandle(outcome);
|
|
338
|
+
if (renamed === null)
|
|
359
339
|
return outcome;
|
|
360
|
-
|
|
340
|
+
const moved = (held) => held.handle === renamed.from ? { ...held, handle: renamed.to } : held;
|
|
341
|
+
return mutated(request, keep, moved(entry), into === undefined ? undefined : moved(into));
|
|
361
342
|
},
|
|
362
343
|
async history(_authorization, request) {
|
|
363
344
|
const entry = authorityFor(request.locator);
|
|
@@ -414,6 +395,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
414
395
|
observe: notifications.observe,
|
|
415
396
|
},
|
|
416
397
|
conversations: notifications.conversations,
|
|
398
|
+
runs: notifications.runs,
|
|
417
399
|
serviceMode: notifications.serviceMode,
|
|
418
400
|
};
|
|
419
401
|
}
|
package/dist/authored-path.d.ts
CHANGED
|
@@ -2,8 +2,60 @@ export declare const GENERATED_PROVENANCE = "_provenance";
|
|
|
2
2
|
export declare const GENERATED_REVISIONS = "_revisions";
|
|
3
3
|
export declare const RESERVED_DERIVED = "_derived";
|
|
4
4
|
export declare const WHOLE_ESCAPED_NAMES: readonly string[];
|
|
5
|
-
export declare const AUTHORED_SEGMENT_MAX_CHARS = 255;
|
|
6
|
-
export declare const AUTHORED_SEGMENT: RegExp;
|
|
7
5
|
export declare const LOCAL_COPY_MANIFEST = ".house";
|
|
8
6
|
export declare const LOCAL_COPY_ROOT_NAMES: readonly string[];
|
|
7
|
+
export declare const AUTHORED_NAME_MAX_BYTES = 255;
|
|
8
|
+
export declare const AUTHORED_PATH_MAX_BYTES = 768;
|
|
9
|
+
export declare const AUTHORED_NAME_RULE: {
|
|
10
|
+
readonly refusedCharacters: '/\\:*?"<>|';
|
|
11
|
+
readonly controlCharacters: 'Cc';
|
|
12
|
+
readonly refusedEnds: ' .';
|
|
13
|
+
readonly refusedStart: '-';
|
|
14
|
+
readonly gitNames: readonly ['.git', 'git~1'];
|
|
15
|
+
readonly windowsNames: readonly ["CON", "PRN", "AUX", "NUL", ...string[]];
|
|
16
|
+
readonly generatedNames: readonly ["_provenance", "_revisions", "_derived"];
|
|
17
|
+
readonly nameMaxBytes: 255;
|
|
18
|
+
readonly pathMaxBytes: 768;
|
|
19
|
+
};
|
|
20
|
+
export type NameRefusal = {
|
|
21
|
+
readonly rule: 'unicode';
|
|
22
|
+
} | {
|
|
23
|
+
readonly rule: 'character';
|
|
24
|
+
readonly character: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly rule: 'empty';
|
|
27
|
+
} | {
|
|
28
|
+
readonly rule: 'dots';
|
|
29
|
+
} | {
|
|
30
|
+
readonly rule: 'end';
|
|
31
|
+
readonly character: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly rule: 'git';
|
|
34
|
+
} | {
|
|
35
|
+
readonly rule: 'windows';
|
|
36
|
+
readonly reserved: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly rule: 'name_bytes';
|
|
39
|
+
readonly bytes: number;
|
|
40
|
+
} | {
|
|
41
|
+
readonly rule: 'start';
|
|
42
|
+
} | {
|
|
43
|
+
readonly rule: 'generated';
|
|
44
|
+
} | {
|
|
45
|
+
readonly rule: 'nfc';
|
|
46
|
+
};
|
|
47
|
+
export type PathRefusal = (NameRefusal & {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
}) | {
|
|
50
|
+
readonly rule: 'root';
|
|
51
|
+
readonly name: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly rule: 'path_bytes';
|
|
54
|
+
readonly bytes: number;
|
|
55
|
+
};
|
|
56
|
+
export declare function utf8Bytes(text: string): number;
|
|
57
|
+
export declare function nameRefusal(name: string): NameRefusal | null;
|
|
58
|
+
export declare function pathRefusal(path: string): PathRefusal | null;
|
|
9
59
|
export declare function admittedPath(path: string): boolean;
|
|
60
|
+
export declare function sameName(left: string, right: string): boolean;
|
|
61
|
+
export declare function fittedName(name: string, count?: number, tail?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authored-path.d.ts","sourceRoot":"","sources":["../src/authored-path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAMhD,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"authored-path.d.ts","sourceRoot":"","sources":["../src/authored-path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAMhD,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAI5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAKlD,CAAC;AAEF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAI3C,eAAO,MAAM,kBAAkB;aAC7B,iBAAiB,EAAE,YAAY;aAC/B,iBAAiB,EAAE,IAAI;aACvB,WAAW,EAAE,IAAI;aACjB,YAAY,EAAE,GAAG;aACjB,QAAQ,YAAG,MAAM,EAAE,OAAO;aAC1B,YAAY;aAUZ,cAAc;aACd,YAAY;aACZ,YAAY;CACJ,CAAC;AAEX,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAA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I,CAU5D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKlD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAyCD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,EAAE,IAAI,SAAK,GAAG,MAAM,CAUrE"}
|
package/dist/authored-path.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_PREFERENCES_HOME, APP_REFERENCE_PATTERN } from '@agentshouse/mdmodel';
|
|
1
|
+
import { APP_PREFERENCES_HOME, APP_REFERENCE_PATTERN, foldedName } from '@agentshouse/mdmodel';
|
|
2
2
|
export const GENERATED_PROVENANCE = '_provenance';
|
|
3
3
|
export const GENERATED_REVISIONS = '_revisions';
|
|
4
4
|
export const RESERVED_DERIVED = '_derived';
|
|
@@ -9,26 +9,158 @@ export const WHOLE_ESCAPED_NAMES = [
|
|
|
9
9
|
GENERATED_REVISIONS,
|
|
10
10
|
RESERVED_DERIVED,
|
|
11
11
|
];
|
|
12
|
-
export const AUTHORED_SEGMENT_MAX_CHARS = 255;
|
|
13
|
-
const REFUSED_SEGMENTS = [
|
|
14
|
-
...WHOLE_ESCAPED_NAMES.map((name) => name.split('.').join('[.]')),
|
|
15
|
-
'[.][Gg][Ii][Tt][.]*',
|
|
16
|
-
].join('|');
|
|
17
|
-
export const AUTHORED_SEGMENT = new RegExp(`^(?!(?:${REFUSED_SEGMENTS})(?:/|$))[A-Za-z0-9._][A-Za-z0-9._-]{0,${AUTHORED_SEGMENT_MAX_CHARS - 1}}$`);
|
|
18
12
|
export const LOCAL_COPY_MANIFEST = '.house';
|
|
13
|
+
const ROOM_FOLDER_FILES = ['AGENTS.md', 'CLAUDE.md'];
|
|
19
14
|
export const LOCAL_COPY_ROOT_NAMES = [
|
|
20
15
|
'.gitignore',
|
|
21
16
|
'.ignore',
|
|
22
17
|
LOCAL_COPY_MANIFEST,
|
|
18
|
+
...ROOM_FOLDER_FILES,
|
|
23
19
|
];
|
|
20
|
+
export const AUTHORED_NAME_MAX_BYTES = 255;
|
|
21
|
+
export const AUTHORED_PATH_MAX_BYTES = 768;
|
|
22
|
+
const FITTED_STEM = 'file';
|
|
23
|
+
export const AUTHORED_NAME_RULE = {
|
|
24
|
+
refusedCharacters: '/\\:*?"<>|',
|
|
25
|
+
controlCharacters: 'Cc',
|
|
26
|
+
refusedEnds: ' .',
|
|
27
|
+
refusedStart: '-',
|
|
28
|
+
gitNames: ['.git', 'git~1'],
|
|
29
|
+
windowsNames: [
|
|
30
|
+
'CON',
|
|
31
|
+
'PRN',
|
|
32
|
+
'AUX',
|
|
33
|
+
'NUL',
|
|
34
|
+
...['1', '2', '3', '4', '5', '6', '7', '8', '9', '¹', '²', '³'].flatMap((digit) => [
|
|
35
|
+
`COM${digit}`,
|
|
36
|
+
`LPT${digit}`,
|
|
37
|
+
]),
|
|
38
|
+
],
|
|
39
|
+
generatedNames: [GENERATED_PROVENANCE, GENERATED_REVISIONS, RESERVED_DERIVED],
|
|
40
|
+
nameMaxBytes: AUTHORED_NAME_MAX_BYTES,
|
|
41
|
+
pathMaxBytes: AUTHORED_PATH_MAX_BYTES,
|
|
42
|
+
};
|
|
43
|
+
const LONE_SURROGATE = /\p{Cs}/u;
|
|
44
|
+
const LONE_SURROGATES = /\p{Cs}/gu;
|
|
45
|
+
const CONTROL = /\p{Cc}/u;
|
|
46
|
+
const MAC_IGNORED = /[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/gu;
|
|
47
|
+
const FOLDED_GIT_NAMES = new Set(AUTHORED_NAME_RULE.gitNames.map(foldedName));
|
|
48
|
+
const FOLDED_WINDOWS_NAMES = new Set(AUTHORED_NAME_RULE.windowsNames.map(foldedName));
|
|
49
|
+
const FOLDED_GENERATED_NAMES = new Set(AUTHORED_NAME_RULE.generatedNames.map(foldedName));
|
|
50
|
+
const FOLDED_ROOT_NAMES = new Set(LOCAL_COPY_ROOT_NAMES.map(foldedName));
|
|
51
|
+
export function utf8Bytes(text) {
|
|
52
|
+
let bytes = 0;
|
|
53
|
+
for (const point of text) {
|
|
54
|
+
const code = point.codePointAt(0);
|
|
55
|
+
bytes += code < 0x80 ? 1 : code < 0x800 ? 2 : code < 0x10000 ? 3 : 4;
|
|
56
|
+
}
|
|
57
|
+
return bytes;
|
|
58
|
+
}
|
|
59
|
+
function refusedCharacter(point) {
|
|
60
|
+
return AUTHORED_NAME_RULE.refusedCharacters.includes(point) || CONTROL.test(point);
|
|
61
|
+
}
|
|
62
|
+
function windowsName(name) {
|
|
63
|
+
const dot = name.indexOf('.');
|
|
64
|
+
const base = dot < 0 ? name : name.slice(0, dot);
|
|
65
|
+
return FOLDED_WINDOWS_NAMES.has(foldedName(base)) ? base : null;
|
|
66
|
+
}
|
|
67
|
+
export function nameRefusal(name) {
|
|
68
|
+
if (LONE_SURROGATE.test(name))
|
|
69
|
+
return { rule: 'unicode' };
|
|
70
|
+
for (const point of name)
|
|
71
|
+
if (refusedCharacter(point))
|
|
72
|
+
return { rule: 'character', character: point };
|
|
73
|
+
if (name === '')
|
|
74
|
+
return { rule: 'empty' };
|
|
75
|
+
if (name === '.' || name === '..')
|
|
76
|
+
return { rule: 'dots' };
|
|
77
|
+
const last = name.at(-1);
|
|
78
|
+
if (AUTHORED_NAME_RULE.refusedEnds.includes(last))
|
|
79
|
+
return { rule: 'end', character: last };
|
|
80
|
+
if (FOLDED_GIT_NAMES.has(foldedName(name.replace(MAC_IGNORED, ''))))
|
|
81
|
+
return { rule: 'git' };
|
|
82
|
+
const reserved = windowsName(name);
|
|
83
|
+
if (reserved !== null)
|
|
84
|
+
return { rule: 'windows', reserved };
|
|
85
|
+
const bytes = utf8Bytes(name);
|
|
86
|
+
if (bytes > AUTHORED_NAME_MAX_BYTES)
|
|
87
|
+
return { rule: 'name_bytes', bytes };
|
|
88
|
+
if (name.startsWith(AUTHORED_NAME_RULE.refusedStart))
|
|
89
|
+
return { rule: 'start' };
|
|
90
|
+
if (FOLDED_GENERATED_NAMES.has(foldedName(name)))
|
|
91
|
+
return { rule: 'generated' };
|
|
92
|
+
if (name.normalize('NFC') !== name)
|
|
93
|
+
return { rule: 'nfc' };
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
24
96
|
function appPreferences(path) {
|
|
25
97
|
return (path.endsWith('.md') &&
|
|
26
98
|
APP_REFERENCE_PATTERN.test(path.slice(APP_PREFERENCES_HOME.length + 1, -3)));
|
|
27
99
|
}
|
|
28
|
-
export function
|
|
100
|
+
export function pathRefusal(path) {
|
|
29
101
|
const names = path.split('/');
|
|
30
102
|
const [root] = names;
|
|
31
|
-
|
|
32
|
-
|
|
103
|
+
if (FOLDED_ROOT_NAMES.has(foldedName(root)))
|
|
104
|
+
return { rule: 'root', name: root };
|
|
105
|
+
for (const name of names) {
|
|
106
|
+
const refused = nameRefusal(name);
|
|
107
|
+
if (refused !== null)
|
|
108
|
+
return { ...refused, name };
|
|
109
|
+
}
|
|
110
|
+
const bytes = utf8Bytes(path);
|
|
111
|
+
return bytes > AUTHORED_PATH_MAX_BYTES ? { rule: 'path_bytes', bytes } : null;
|
|
112
|
+
}
|
|
113
|
+
export function admittedPath(path) {
|
|
114
|
+
return (pathRefusal(path) === null &&
|
|
33
115
|
(!path.startsWith(`${APP_PREFERENCES_HOME}/`) || appPreferences(path)));
|
|
34
116
|
}
|
|
117
|
+
export function sameName(left, right) {
|
|
118
|
+
return foldedName(left) === foldedName(right);
|
|
119
|
+
}
|
|
120
|
+
function cutToBytes(text, bytes) {
|
|
121
|
+
let kept = '';
|
|
122
|
+
let used = 0;
|
|
123
|
+
for (const point of text) {
|
|
124
|
+
used += utf8Bytes(point);
|
|
125
|
+
if (used > bytes)
|
|
126
|
+
break;
|
|
127
|
+
kept += point;
|
|
128
|
+
}
|
|
129
|
+
return kept;
|
|
130
|
+
}
|
|
131
|
+
function trimmedEnd(text) {
|
|
132
|
+
let end = text.length;
|
|
133
|
+
while (end > 0 && AUTHORED_NAME_RULE.refusedEnds.includes(text[end - 1]))
|
|
134
|
+
end -= 1;
|
|
135
|
+
return text.slice(0, end);
|
|
136
|
+
}
|
|
137
|
+
function trimmedStart(text) {
|
|
138
|
+
let start = 0;
|
|
139
|
+
while (start < text.length && text[start] === AUTHORED_NAME_RULE.refusedStart)
|
|
140
|
+
start += 1;
|
|
141
|
+
return text.slice(start);
|
|
142
|
+
}
|
|
143
|
+
function nameParts(name) {
|
|
144
|
+
const dot = name.lastIndexOf('.');
|
|
145
|
+
return dot <= 0
|
|
146
|
+
? { stem: name, extension: '' }
|
|
147
|
+
: { stem: name.slice(0, dot), extension: name.slice(dot) };
|
|
148
|
+
}
|
|
149
|
+
function fitted(stem, extension, tail, count) {
|
|
150
|
+
const suffix = count > 1 ? `-${count}` : '';
|
|
151
|
+
const room = AUTHORED_NAME_MAX_BYTES - utf8Bytes(suffix);
|
|
152
|
+
const whole = utf8Bytes(`${extension}${tail}`) < room;
|
|
153
|
+
const kept = whole ? `${extension}${tail}` : tail;
|
|
154
|
+
const cut = cutToBytes(whole ? stem : `${stem}${extension}`, room - utf8Bytes(kept));
|
|
155
|
+
return `${suffix === '' && kept === '' ? trimmedEnd(cut) : cut}${suffix}${kept}`;
|
|
156
|
+
}
|
|
157
|
+
export function fittedName(name, count = 1, tail = '') {
|
|
158
|
+
let replaced = '';
|
|
159
|
+
for (const point of name.replace(LONE_SURROGATES, '\uFFFD').normalize('NFC'))
|
|
160
|
+
replaced += refusedCharacter(point) ? '-' : point;
|
|
161
|
+
const { stem: typed, extension } = nameParts(trimmedEnd(replaced));
|
|
162
|
+
const stem = trimmedStart(typed);
|
|
163
|
+
const named = stem !== '' && nameRefusal(fitted(stem, extension, tail, 1)) === null ? stem : FITTED_STEM;
|
|
164
|
+
const counted = fitted(named, extension, tail, count);
|
|
165
|
+
return nameRefusal(counted) === null ? counted : fitted(FITTED_STEM, extension, tail, count);
|
|
166
|
+
}
|
package/dist/chunks.js
CHANGED
package/dist/discovery.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { declaredActions } from './actions.js';
|
|
2
|
-
import { SITE_DOOR_ACTS } from './transport.js';
|
|
2
|
+
import { SITE_DOOR_ACTS, SITE_DOOR_TOOL } from './transport.js';
|
|
3
3
|
import { readPosition, roomVersion } from './version.js';
|
|
4
4
|
export const PROVIDER_ACTIONS = 'provider-actions';
|
|
5
5
|
const BOUND_KEYS = [
|
|
@@ -412,7 +412,7 @@ export function siteCapabilities() {
|
|
|
412
412
|
return [
|
|
413
413
|
{
|
|
414
414
|
name: PROVIDER_ACTIONS,
|
|
415
|
-
actions: Object.keys(SITE_DOOR_ACTS).map((name) => ({
|
|
415
|
+
actions: [...Object.keys(SITE_DOOR_ACTS), SITE_DOOR_TOOL].map((name) => ({
|
|
416
416
|
name,
|
|
417
417
|
inputShape: {},
|
|
418
418
|
resultKind: 'house',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
2
|
export { foldedAuthorities, ROOM_OWN } from './discovery.js';
|
|
3
|
-
export { finishedUpload, houseUpload, type HouseUpload } from './upload.js';
|
|
3
|
+
export { finishedUpload, houseUpload, stagedBatch, type HouseUpload } from './upload.js';
|
|
4
4
|
export { houseAction, type HouseActDoor } from './actions.js';
|
|
5
5
|
export { HISTORY_PAGE } from './history.js';
|
|
6
6
|
export { answeredFailure } from './refusal.js';
|
|
7
7
|
export { answering, documentEntry, kept, type Answered, type HouseManifestFile } from './read.js';
|
|
8
|
-
export {
|
|
9
|
-
export { admittedPath,
|
|
10
|
-
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, SITE_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, type HouseRuntimeAct, type HouseRuntimeFrame, } from './transport.js';
|
|
8
|
+
export { houseChanges, type ChangeMapping } from './write.js';
|
|
9
|
+
export { admittedPath, AUTHORED_NAME_MAX_BYTES, AUTHORED_NAME_RULE, AUTHORED_PATH_MAX_BYTES, fittedName, GENERATED_PROVENANCE, GENERATED_REVISIONS, LOCAL_COPY_MANIFEST, LOCAL_COPY_ROOT_NAMES, nameRefusal, pathRefusal, RESERVED_DERIVED, sameName, utf8Bytes, WHOLE_ESCAPED_NAMES, type NameRefusal, type PathRefusal, } from './authored-path.js';
|
|
10
|
+
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, SITE_FRESH_QUERY, SITE_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, type HouseRuntimeAct, type HouseRuntimeFrame, } from './transport.js';
|
|
11
11
|
export type { HouseByteTransfer, HouseBytesAnswer, HouseClosing, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,2BAA2B,EAC3B,cAAc,EACd,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter } from './adapter.js';
|
|
2
2
|
export { foldedAuthorities, ROOM_OWN } from './discovery.js';
|
|
3
|
-
export { finishedUpload, houseUpload } from './upload.js';
|
|
3
|
+
export { finishedUpload, houseUpload, stagedBatch } from './upload.js';
|
|
4
4
|
export { houseAction } from './actions.js';
|
|
5
5
|
export { HISTORY_PAGE } from './history.js';
|
|
6
6
|
export { answeredFailure } from './refusal.js';
|
|
7
7
|
export { answering, documentEntry, kept } from './read.js';
|
|
8
|
-
export {
|
|
9
|
-
export { admittedPath,
|
|
10
|
-
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, SITE_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, } from './transport.js';
|
|
8
|
+
export { houseChanges } from './write.js';
|
|
9
|
+
export { admittedPath, AUTHORED_NAME_MAX_BYTES, AUTHORED_NAME_RULE, AUTHORED_PATH_MAX_BYTES, fittedName, GENERATED_PROVENANCE, GENERATED_REVISIONS, LOCAL_COPY_MANIFEST, LOCAL_COPY_ROOT_NAMES, nameRefusal, pathRefusal, RESERVED_DERIVED, sameName, utf8Bytes, WHOLE_ESCAPED_NAMES, } from './authored-path.js';
|
|
10
|
+
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, SITE_FRESH_QUERY, SITE_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, } from './transport.js';
|
package/dist/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AttachmentCopy, type Attachment, type BootstrapPage, type SavedFacts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { HouseMode } from './transport.js';
|
|
3
3
|
import { type LogPosition } from './version.js';
|
|
4
4
|
export type HeadChange = BootstrapPage['changes'][string];
|
|
@@ -9,7 +9,7 @@ export type Answered = {
|
|
|
9
9
|
readonly fileIds: Map<string, string>;
|
|
10
10
|
readonly created: Map<string, string>;
|
|
11
11
|
readonly changes: Map<string, HeadChange>;
|
|
12
|
-
readonly
|
|
12
|
+
readonly attachments: Map<string, Attachment>;
|
|
13
13
|
readonly removals: Set<string>;
|
|
14
14
|
readonly folders: Set<string>;
|
|
15
15
|
readonly folderRemovals: Set<string>;
|
|
@@ -25,7 +25,7 @@ export declare function answered(answer: Answered): Generator<number, {
|
|
|
25
25
|
fileIds?: Readonly<Record<string, string>>;
|
|
26
26
|
created?: Readonly<Record<string, string>>;
|
|
27
27
|
changes: Readonly<Record<string, HeadChange>>;
|
|
28
|
-
|
|
28
|
+
attachments: Readonly<Record<string, Attachment>>;
|
|
29
29
|
removals: readonly string[];
|
|
30
30
|
folders?: readonly string[];
|
|
31
31
|
folderRemovals?: readonly string[];
|
|
@@ -36,7 +36,7 @@ export type HouseManifestFile = {
|
|
|
36
36
|
version: string;
|
|
37
37
|
head?: HeadChange;
|
|
38
38
|
created?: string;
|
|
39
|
-
binary?:
|
|
39
|
+
binary?: Attachment;
|
|
40
40
|
facts?: SavedFacts;
|
|
41
41
|
space?: string;
|
|
42
42
|
content?: string;
|
|
@@ -60,7 +60,7 @@ export type HouseFileAddress = {
|
|
|
60
60
|
name: string;
|
|
61
61
|
sha256: string;
|
|
62
62
|
mediaType: string;
|
|
63
|
-
copies: readonly
|
|
63
|
+
copies: readonly AttachmentCopy[];
|
|
64
64
|
};
|
|
65
65
|
export declare function authorityRoot(handle: string): string;
|
|
66
66
|
export declare function schemaPath(handle: string, schema: string): string;
|
|
@@ -70,7 +70,7 @@ export declare function headChange(held: {
|
|
|
70
70
|
readonly author?: unknown;
|
|
71
71
|
readonly changed_at?: unknown;
|
|
72
72
|
}): HeadChange | undefined | null;
|
|
73
|
-
export declare function
|
|
73
|
+
export declare function attachmentOf(held: Readonly<Record<string, unknown>>): Attachment | undefined | null;
|
|
74
74
|
export declare function documentEntry(value: unknown, mode: HouseMode): HouseManifestFile | null;
|
|
75
75
|
export declare function kept(answer: Answered, file: HouseManifestFile): void;
|
|
76
76
|
export declare function modelScope(room: HouseRoomHead): HouseScope;
|
package/dist/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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