@agentshouse/mdruntime-adapter 0.1.0-c916bf3c9b348 → 0.1.0-c917a90145758
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 +9 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +179 -5
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +41 -54
- package/dist/authored-path.d.ts +0 -4
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +12 -9
- package/dist/chunks.js +1 -1
- package/dist/discovery.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- 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/site.d.ts.map +1 -1
- package/dist/site.js +11 -3
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +21 -1
- package/dist/transport.d.ts +28 -6
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +15 -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
CHANGED
|
@@ -3,6 +3,15 @@ import type { HouseDoorAnswer, HouseTransport } from './transport.js';
|
|
|
3
3
|
export type HouseActDoor = Pick<HouseTransport, 'door'>;
|
|
4
4
|
export declare const HOUSE_UNKEPT_READS: readonly string[];
|
|
5
5
|
export declare const HOUSE_LEADING_READS: readonly string[];
|
|
6
|
+
export declare const HOUSE_RENAMED_UNTIL_2026_12_18: ReadonlyMap<string, string>;
|
|
7
|
+
type Rewrites = ReadonlyMap<string, (input: unknown) => unknown>;
|
|
8
|
+
export declare const HOUSE_REWRITTEN_UNTIL_2026_12_19: Rewrites;
|
|
9
|
+
export declare const HOUSE_RENAMED_UNTIL_2026_12_21: ReadonlyMap<string, string>;
|
|
10
|
+
export declare const HOUSE_REWRITTEN_UNTIL_2026_12_21: Rewrites;
|
|
11
|
+
export declare const HOUSE_RENAMED_UNTIL_2026_12_22: ReadonlyMap<string, string>;
|
|
12
|
+
export declare const HOUSE_REWRITTEN_UNTIL_2026_12_22: Rewrites;
|
|
13
|
+
export declare function rewrittenInTurn(...rewrites: readonly Rewrites[]): Rewrites;
|
|
6
14
|
export declare function declaredActions(routes: readonly string[]): readonly ActionDeclaration[];
|
|
7
15
|
export declare function houseAction(transport: HouseActDoor, request: ActionRequest): Promise<ActionResult>;
|
|
8
16
|
export declare function actionOutcome(answer: HouseDoorAnswer, name: string, input: unknown): ActionResult;
|
|
17
|
+
export {};
|
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,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|
|
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
|
+
export const HOUSE_RENAMED_UNTIL_2026_12_18 = new Map([
|
|
17
|
+
['files/batch', 'update'],
|
|
18
|
+
]);
|
|
19
|
+
function withoutRoomRef(input) {
|
|
20
|
+
if (typeof input !== 'object' || input === null || !('room_ref' in input))
|
|
21
|
+
return input;
|
|
22
|
+
const { room_ref: _room, ...paths } = input;
|
|
23
|
+
return paths;
|
|
24
|
+
}
|
|
25
|
+
const CURRENT_OPS = new Map([
|
|
26
|
+
['create', 'write'],
|
|
27
|
+
['replace', 'write'],
|
|
28
|
+
['patch', 'edit'],
|
|
29
|
+
['rename', 'move'],
|
|
30
|
+
['remove', 'delete'],
|
|
31
|
+
['create_folder', 'mkdir'],
|
|
32
|
+
['remove_folder', 'delete'],
|
|
33
|
+
]);
|
|
34
|
+
function withCurrentOps(input) {
|
|
35
|
+
if (typeof input !== 'object' || input === null || !('changes' in input))
|
|
36
|
+
return input;
|
|
37
|
+
const { changes } = input;
|
|
38
|
+
if (!Array.isArray(changes))
|
|
39
|
+
return input;
|
|
40
|
+
return {
|
|
41
|
+
...input,
|
|
42
|
+
changes: changes.map((change) => {
|
|
43
|
+
if (typeof change !== 'object' || change === null || !('op' in change))
|
|
44
|
+
return change;
|
|
45
|
+
const op = CURRENT_OPS.get(change.op);
|
|
46
|
+
return op === undefined ? change : { ...change, op };
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export const HOUSE_REWRITTEN_UNTIL_2026_12_19 = new Map([['update', withoutRoomRef]]);
|
|
51
|
+
export const HOUSE_RENAMED_UNTIL_2026_12_21 = new Map([
|
|
52
|
+
['apps/create', 'app_update'],
|
|
53
|
+
['apps/upload', 'app_update'],
|
|
54
|
+
['shares/accept', 'sharing_update'],
|
|
55
|
+
['shares/decline', 'sharing_update'],
|
|
56
|
+
['shares/join-requests/approve', 'sharing_update'],
|
|
57
|
+
['shares/join-requests/decline', 'sharing_update'],
|
|
58
|
+
['rooms/ownership/offer', 'sharing_update'],
|
|
59
|
+
['rooms/ownership/accept', 'sharing_update'],
|
|
60
|
+
['rooms/ownership/decline', 'sharing_update'],
|
|
61
|
+
['rooms/instructions/follow', 'sharing_update'],
|
|
62
|
+
['agents/standing-answer/set', 'agent_update'],
|
|
63
|
+
['agents/ask-afk/set', 'agent_update'],
|
|
64
|
+
['environments/sign-in', 'environment_update'],
|
|
65
|
+
['environments/rooms/set', 'environment_update'],
|
|
66
|
+
['environments/login-code/create', 'environment_update'],
|
|
67
|
+
['environments/login-code/create-reusable', 'environment_update'],
|
|
68
|
+
['environments/login-code/cancel', 'environment_update'],
|
|
69
|
+
]);
|
|
70
|
+
function held(input) {
|
|
71
|
+
return typeof input === 'object' && input !== null
|
|
72
|
+
? { ...input }
|
|
73
|
+
: {};
|
|
74
|
+
}
|
|
75
|
+
function created(input) {
|
|
76
|
+
return { op: 'create', ...held(input) };
|
|
77
|
+
}
|
|
78
|
+
function uploaded(input) {
|
|
79
|
+
const { app_ref: app, ...files } = held(input);
|
|
80
|
+
return { op: 'publish', app, ...files };
|
|
81
|
+
}
|
|
82
|
+
function decided(op) {
|
|
83
|
+
return (input) => ({ op, ...held(input) });
|
|
84
|
+
}
|
|
85
|
+
function reusable(input) {
|
|
86
|
+
return { op: 'login_code_create', reusable: true, ...held(input) };
|
|
87
|
+
}
|
|
88
|
+
function zoned(input) {
|
|
89
|
+
const { browser, ...named } = held(input);
|
|
90
|
+
return { op: 'set', ...named, ...(browser === undefined ? {} : { if_unset: browser }) };
|
|
91
|
+
}
|
|
92
|
+
function exported(input) {
|
|
93
|
+
const { room_refs: rooms, ...named } = held(input);
|
|
94
|
+
return { op: 'export', ...named, ...(rooms === undefined ? {} : { rooms }) };
|
|
95
|
+
}
|
|
96
|
+
function roomNamed(op) {
|
|
97
|
+
return (input) => {
|
|
98
|
+
const { room_ref: room, ...named } = held(input);
|
|
99
|
+
return { op, room, ...named };
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function appNamed(op) {
|
|
103
|
+
return (input) => {
|
|
104
|
+
const { app_ref: app, ...named } = held(input);
|
|
105
|
+
return { op, app, ...named };
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function askedAway(input) {
|
|
109
|
+
const { room_ref: room, afk, ...named } = held(input);
|
|
110
|
+
return { op: 'set', ...named, room, ask_afk: afk };
|
|
111
|
+
}
|
|
112
|
+
export const HOUSE_REWRITTEN_UNTIL_2026_12_21 = new Map([
|
|
113
|
+
['apps/create', created],
|
|
114
|
+
['apps/upload', uploaded],
|
|
115
|
+
['shares/accept', decided('share_accept')],
|
|
116
|
+
['shares/decline', decided('share_decline')],
|
|
117
|
+
['shares/join-requests/approve', decided('join_request_approve')],
|
|
118
|
+
['shares/join-requests/decline', decided('join_request_decline')],
|
|
119
|
+
['rooms/ownership/offer', roomNamed('ownership_offer')],
|
|
120
|
+
['rooms/ownership/accept', decided('ownership_accept')],
|
|
121
|
+
['rooms/ownership/decline', decided('ownership_decline')],
|
|
122
|
+
['rooms/instructions/follow', roomNamed('instructions_follow')],
|
|
123
|
+
['agents/standing-answer/set', roomNamed('standing_answer_set')],
|
|
124
|
+
['agents/ask-afk/set', askedAway],
|
|
125
|
+
['environments/sign-in', decided('sign_in')],
|
|
126
|
+
['environments/rooms/set', decided('set')],
|
|
127
|
+
['environments/login-code/create', decided('login_code_create')],
|
|
128
|
+
['environments/login-code/create-reusable', reusable],
|
|
129
|
+
['environments/login-code/cancel', decided('login_code_cancel')],
|
|
130
|
+
['update', withCurrentOps],
|
|
131
|
+
]);
|
|
132
|
+
export const HOUSE_RENAMED_UNTIL_2026_12_22 = new Map([
|
|
133
|
+
['account/security/browsers/revoke', 'account_update'],
|
|
134
|
+
['account/security/browsers/revoke-others', 'account_update'],
|
|
135
|
+
['account/time-zone/set', 'account_update'],
|
|
136
|
+
['account/who-can-add-me/set', 'account_update'],
|
|
137
|
+
['clients/revoke', 'account_update'],
|
|
138
|
+
['clients/rooms/set', 'account_update'],
|
|
139
|
+
['storage/archive', 'account_update'],
|
|
140
|
+
['billing/subscribe', 'account_update'],
|
|
141
|
+
['billing/top-up', 'account_update'],
|
|
142
|
+
['billing/manage', 'account_update'],
|
|
143
|
+
['apps/features/set', 'app_update'],
|
|
144
|
+
]);
|
|
145
|
+
export const HOUSE_REWRITTEN_UNTIL_2026_12_22 = new Map([
|
|
146
|
+
['account/security/browsers/revoke', decided('browser_revoke')],
|
|
147
|
+
[
|
|
148
|
+
'account/security/browsers/revoke-others',
|
|
149
|
+
(input) => ({ op: 'browser_revoke', ...held(input), others: true }),
|
|
150
|
+
],
|
|
151
|
+
['account/time-zone/set', zoned],
|
|
152
|
+
['account/who-can-add-me/set', decided('set')],
|
|
153
|
+
['clients/revoke', decided('client_revoke')],
|
|
154
|
+
['clients/rooms/set', decided('client_rooms_set')],
|
|
155
|
+
['storage/archive', exported],
|
|
156
|
+
['billing/subscribe', decided('subscribe')],
|
|
157
|
+
['billing/top-up', decided('top_up')],
|
|
158
|
+
['billing/manage', decided('billing_manage')],
|
|
159
|
+
['apps/features/set', appNamed('feature_set')],
|
|
160
|
+
]);
|
|
161
|
+
export function rewrittenInTurn(...rewrites) {
|
|
162
|
+
const names = new Set(rewrites.flatMap((each) => [...each.keys()]));
|
|
163
|
+
return new Map([...names].map((name) => [
|
|
164
|
+
name,
|
|
165
|
+
(input) => rewrites.reduce((held, each) => each.get(name)?.(held) ?? held, input),
|
|
166
|
+
]));
|
|
167
|
+
}
|
|
168
|
+
const ROOM_SELECTORS = new Map([
|
|
169
|
+
['update', { room: 'changes.room', roomPaths: ['changes.path', 'changes.to', 'paths', 'mount'] }],
|
|
170
|
+
['sharing', { room: 'room' }],
|
|
171
|
+
['sharing_update', { room: 'room' }],
|
|
172
|
+
['inbox_update', { room: 'room', roomPaths: ['path'] }],
|
|
173
|
+
['agent', { room: 'room' }],
|
|
174
|
+
['agent_update', { room: 'room' }],
|
|
175
|
+
['environment', { room: 'room' }],
|
|
176
|
+
]);
|
|
13
177
|
export function declaredActions(routes) {
|
|
14
|
-
return routes.map((name) => ({
|
|
178
|
+
return routes.map((name) => ({
|
|
179
|
+
name,
|
|
180
|
+
inputShape: {},
|
|
181
|
+
resultKind: 'house',
|
|
182
|
+
...(ROOM_SELECTORS.get(name) ?? { room: 'room_ref' }),
|
|
183
|
+
}));
|
|
15
184
|
}
|
|
16
185
|
export function houseAction(transport, request) {
|
|
17
186
|
const route = routeOf(request.name);
|
|
@@ -57,5 +226,10 @@ export function actionOutcome(answer, name, input) {
|
|
|
57
226
|
return { kind: 'action', result: answer.body };
|
|
58
227
|
}
|
|
59
228
|
async function carry(transport, route, name, input) {
|
|
60
|
-
|
|
229
|
+
const answered = actionOutcome(await transport.door(route, input), name, input);
|
|
230
|
+
const renamed = renamedHandle(answered);
|
|
231
|
+
if (renamed === null)
|
|
232
|
+
return answered;
|
|
233
|
+
const moved = movedPaths(input, ROOM_SELECTORS.get(name)?.roomPaths ?? [], renamed);
|
|
234
|
+
return actionOutcome(await transport.door(route, moved), name, moved);
|
|
61
235
|
}
|
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;AAqChC,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,CAmdpF"}
|
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';
|
|
8
|
-
import { houseAction, HOUSE_LEADING_READS, HOUSE_UNKEPT_READS } from './actions.js';
|
|
7
|
+
import { finishedUpload, houseUpload, stagedBatch } from './upload.js';
|
|
8
|
+
import { houseAction, HOUSE_LEADING_READS, HOUSE_RENAMED_UNTIL_2026_12_18, HOUSE_RENAMED_UNTIL_2026_12_21, HOUSE_RENAMED_UNTIL_2026_12_22, HOUSE_REWRITTEN_UNTIL_2026_12_19, HOUSE_REWRITTEN_UNTIL_2026_12_21, HOUSE_REWRITTEN_UNTIL_2026_12_22, HOUSE_UNKEPT_READS, rewrittenInTurn, } 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);
|
|
@@ -323,6 +313,12 @@ export function createAgentsHouseAdapter(options) {
|
|
|
323
313
|
pathRule: admittedPath,
|
|
324
314
|
unkeptReads: HOUSE_UNKEPT_READS,
|
|
325
315
|
leadingReads: HOUSE_LEADING_READS,
|
|
316
|
+
renamedActions: new Map([
|
|
317
|
+
...HOUSE_RENAMED_UNTIL_2026_12_18,
|
|
318
|
+
...HOUSE_RENAMED_UNTIL_2026_12_21,
|
|
319
|
+
...HOUSE_RENAMED_UNTIL_2026_12_22,
|
|
320
|
+
]),
|
|
321
|
+
rewrittenInputs: rewrittenInTurn(HOUSE_REWRITTEN_UNTIL_2026_12_19, HOUSE_REWRITTEN_UNTIL_2026_12_21, HOUSE_REWRITTEN_UNTIL_2026_12_22),
|
|
326
322
|
async authorize() {
|
|
327
323
|
return options.authorize();
|
|
328
324
|
},
|
|
@@ -338,26 +334,17 @@ export function createAgentsHouseAdapter(options) {
|
|
|
338
334
|
const entry = authorityFor(request.locator);
|
|
339
335
|
if (entry === undefined)
|
|
340
336
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
341
|
-
const
|
|
342
|
-
const destination = batch.between?.destination.room;
|
|
337
|
+
const destination = request.changeBatch.between?.destination.room;
|
|
343
338
|
const into = destination === undefined ? undefined : authorityFor(destination);
|
|
344
339
|
if (destination !== undefined && into === undefined) {
|
|
345
340
|
return { kind: 'room-not-readable', locator: destination };
|
|
346
341
|
}
|
|
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))
|
|
342
|
+
const outcome = await mutated(request, keep, entry, into);
|
|
343
|
+
const renamed = renamedHandle(outcome);
|
|
344
|
+
if (renamed === null)
|
|
359
345
|
return outcome;
|
|
360
|
-
|
|
346
|
+
const moved = (held) => held.handle === renamed.from ? { ...held, handle: renamed.to } : held;
|
|
347
|
+
return mutated(request, keep, moved(entry), into === undefined ? undefined : moved(into));
|
|
361
348
|
},
|
|
362
349
|
async history(_authorization, request) {
|
|
363
350
|
const entry = authorityFor(request.locator);
|
package/dist/authored-path.d.ts
CHANGED
|
@@ -58,8 +58,4 @@ export declare function nameRefusal(name: string): NameRefusal | null;
|
|
|
58
58
|
export declare function pathRefusal(path: string): PathRefusal | null;
|
|
59
59
|
export declare function admittedPath(path: string): boolean;
|
|
60
60
|
export declare function sameName(left: string, right: string): boolean;
|
|
61
|
-
export declare function nameParts(name: string): {
|
|
62
|
-
readonly stem: string;
|
|
63
|
-
readonly extension: string;
|
|
64
|
-
};
|
|
65
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,mBAAmB,WAAW,CAAC;
|
|
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,CAAC,IAAI,EAAE,WAAW,CAAC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AY,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
|
@@ -10,10 +10,12 @@ export const WHOLE_ESCAPED_NAMES = [
|
|
|
10
10
|
RESERVED_DERIVED,
|
|
11
11
|
];
|
|
12
12
|
export const LOCAL_COPY_MANIFEST = '.house';
|
|
13
|
+
const ROOM_FOLDER_FILES = ['AGENTS.md', 'CLAUDE.md'];
|
|
13
14
|
export const LOCAL_COPY_ROOT_NAMES = [
|
|
14
15
|
'.gitignore',
|
|
15
16
|
'.ignore',
|
|
16
17
|
LOCAL_COPY_MANIFEST,
|
|
18
|
+
...ROOM_FOLDER_FILES,
|
|
17
19
|
];
|
|
18
20
|
export const AUTHORED_NAME_MAX_BYTES = 255;
|
|
19
21
|
export const AUTHORED_PATH_MAX_BYTES = 768;
|
|
@@ -138,26 +140,27 @@ function trimmedStart(text) {
|
|
|
138
140
|
start += 1;
|
|
139
141
|
return text.slice(start);
|
|
140
142
|
}
|
|
141
|
-
|
|
143
|
+
function nameParts(name) {
|
|
142
144
|
const dot = name.lastIndexOf('.');
|
|
143
145
|
return dot <= 0
|
|
144
146
|
? { stem: name, extension: '' }
|
|
145
147
|
: { stem: name.slice(0, dot), extension: name.slice(dot) };
|
|
146
148
|
}
|
|
147
|
-
function fitted(stem,
|
|
149
|
+
function fitted(stem, extension, tail, count) {
|
|
148
150
|
const suffix = count > 1 ? `-${count}` : '';
|
|
149
151
|
const room = AUTHORED_NAME_MAX_BYTES - utf8Bytes(suffix);
|
|
150
|
-
const
|
|
151
|
-
const
|
|
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));
|
|
152
155
|
return `${suffix === '' && kept === '' ? trimmedEnd(cut) : cut}${suffix}${kept}`;
|
|
153
156
|
}
|
|
154
157
|
export function fittedName(name, count = 1, tail = '') {
|
|
155
158
|
let replaced = '';
|
|
156
159
|
for (const point of name.replace(LONE_SURROGATES, '\uFFFD').normalize('NFC'))
|
|
157
160
|
replaced += refusedCharacter(point) ? '-' : point;
|
|
158
|
-
const { stem, extension } = nameParts(trimmedEnd(
|
|
159
|
-
const
|
|
160
|
-
const named = nameRefusal(fitted(stem,
|
|
161
|
-
const counted = fitted(named,
|
|
162
|
-
return nameRefusal(counted) === null ? counted : fitted(FITTED_STEM,
|
|
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);
|
|
163
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 {
|
|
8
|
+
export { houseChanges, type ChangeMapping } from './write.js';
|
|
9
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_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, type HouseRuntimeAct, type HouseRuntimeFrame, } from './transport.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 {
|
|
8
|
+
export { houseChanges } from './write.js';
|
|
9
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_IMAGE_COPIES_HEADER, SITE_QUERY, SITE_QUERY_ROUTE_CHARACTERS, siteQueryAsked, siteQueryRoute, } from './transport.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 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAM1D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,SAAS,EAAE,G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