openmeld 0.3.236 → 0.3.238
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/{add-me-membership-C_ytPYUu.js → add-me-membership-_7nC0hkr.js} +2 -2
- package/dist/{add-me-membership-C_ytPYUu.js.map → add-me-membership-_7nC0hkr.js.map} +1 -1
- package/dist/{agents-mFz8qI_p.js → agents-kG9UvazC.js} +10 -10
- package/dist/{agents-mFz8qI_p.js.map → agents-kG9UvazC.js.map} +1 -1
- package/dist/{api-client-foundation-BVVqHzYr.js → api-client-foundation-DIcNjG9w.js} +1 -1
- package/dist/{api-client-foundation-BzGnJzcb.js → api-client-foundation-DNbvvZW2.js} +3 -3
- package/dist/{api-client-foundation-BzGnJzcb.js.map → api-client-foundation-DNbvvZW2.js.map} +1 -1
- package/dist/{auth-session-CjxqNKvh.js → auth-session-BTRu2Kc5.js} +2 -2
- package/dist/{auth-session-CjxqNKvh.js.map → auth-session-BTRu2Kc5.js.map} +1 -1
- package/dist/auth-session-D2f7Lud02.js +4 -0
- package/dist/{channel-BW2_rI6u.js → channel-BxlX3o3i.js} +78 -4
- package/dist/channel-BxlX3o3i.js.map +1 -0
- package/dist/{command-DApK5Fss.js → command-Cyw5Gj59.js} +41 -127
- package/dist/command-Cyw5Gj59.js.map +1 -0
- package/dist/{computer-connection-LX1R7jD0.js → computer-connection-Sntn_-XO.js} +2 -2
- package/dist/{computer-connection-LX1R7jD0.js.map → computer-connection-Sntn_-XO.js.map} +1 -1
- package/dist/{computer-connection-review-CSe-ljcH.js → computer-connection-review-DWiapsro.js} +5 -5
- package/dist/{computer-connection-review-CSe-ljcH.js.map → computer-connection-review-DWiapsro.js.map} +1 -1
- package/dist/{computer-disconnect-CELa6Aef.js → computer-disconnect-Bxxreumk.js} +8 -8
- package/dist/{computer-disconnect-CELa6Aef.js.map → computer-disconnect-Bxxreumk.js.map} +1 -1
- package/dist/{computer-setup-continuation-BfsOJDh1.js → computer-setup-continuation-DkPRFlA1.js} +4 -4
- package/dist/{computer-setup-continuation-BfsOJDh1.js.map → computer-setup-continuation-DkPRFlA1.js.map} +1 -1
- package/dist/{daemon-device-id-OMqh2F9_.js → daemon-device-id-D7lbw6c4.js} +226 -42
- package/dist/daemon-device-id-D7lbw6c4.js.map +1 -0
- package/dist/{daemon-lifecycle-journal-BHCda5cr.js → daemon-lifecycle-journal-C0P8xFTk.js} +3 -3
- package/dist/{daemon-lifecycle-journal-BHCda5cr.js.map → daemon-lifecycle-journal-C0P8xFTk.js.map} +1 -1
- package/dist/{daemon-service-runtime-DYq2FIVh.js → daemon-service-runtime-DhV7AKAv.js} +2 -2
- package/dist/{daemon-service-runtime-DYq2FIVh.js.map → daemon-service-runtime-DhV7AKAv.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-BUsyLme1.js → daemon-service-update-coordinator-BM4ha5Nj.js} +9 -10
- package/dist/{daemon-service-update-coordinator-BUsyLme1.js.map → daemon-service-update-coordinator-BM4ha5Nj.js.map} +1 -1
- package/dist/{dispatch-owned-runtime-BbFZbSCZ.js → dispatch-owned-runtime-CfPwparq.js} +7 -7
- package/dist/{dispatch-owned-runtime-BbFZbSCZ.js.map → dispatch-owned-runtime-CfPwparq.js.map} +1 -1
- package/dist/dist-Bfz_GJ0l.js +4 -0
- package/dist/{dist-Co4QfNdK.js → dist-s_YTHAIc.js} +307 -16
- package/dist/dist-s_YTHAIc.js.map +1 -0
- package/dist/{elapsed-time-LyPBZcr1.js → dual-view-guide-catalog-DDYa38RT.js} +215 -164
- package/dist/dual-view-guide-catalog-DDYa38RT.js.map +1 -0
- package/dist/elapsed-time-Ck4GiT9P.js +165 -0
- package/dist/elapsed-time-Ck4GiT9P.js.map +1 -0
- package/dist/{entry-7fJyrzKV.js → entry-CTw122mn.js} +7 -8
- package/dist/{entry-7fJyrzKV.js.map → entry-CTw122mn.js.map} +1 -1
- package/dist/{installation-inventory-UQLiccH6.js → installation-inventory-CSNq9dzc.js} +3 -3
- package/dist/{installation-inventory-UQLiccH6.js.map → installation-inventory-CSNq9dzc.js.map} +1 -1
- package/dist/{installer-nI8qVBer.js → installer-B4MjFlzg.js} +2 -2
- package/dist/{installer-nI8qVBer.js.map → installer-B4MjFlzg.js.map} +1 -1
- package/dist/{meta-api-JNwpu5-2.js → meta-api-tg1rD8mP.js} +117 -6
- package/dist/meta-api-tg1rD8mP.js.map +1 -0
- package/dist/{openmeld-DDUAg1-S.js → openmeld-MSrVnYw0.js} +128 -88
- package/dist/openmeld-MSrVnYw0.js.map +1 -0
- package/dist/{openmeld-maintenance-worker-BgWOmRDu.js → openmeld-maintenance-worker-CQGwuIl9.js} +9 -9
- package/dist/{openmeld-maintenance-worker-BgWOmRDu.js.map → openmeld-maintenance-worker-CQGwuIl9.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-CK54PNzJ.js → openmeld-tools-update-join-CzBRWKVT.js} +4 -4
- package/dist/{openmeld-tools-update-join-CK54PNzJ.js.map → openmeld-tools-update-join-CzBRWKVT.js.map} +1 -1
- package/dist/openmeld.js +4 -4
- package/dist/{prepare-provider-runtime-DAiq8vyv.js → prepare-provider-runtime-L7u8iHAb.js} +975 -41
- package/dist/prepare-provider-runtime-L7u8iHAb.js.map +1 -0
- package/dist/{prepare-session-executor-CFqmUlIh.js → prepare-session-executor-D8LvC1d8.js} +19 -20
- package/dist/{prepare-session-executor-CFqmUlIh.js.map → prepare-session-executor-D8LvC1d8.js.map} +1 -1
- package/dist/{presenter-MJ5YgsOT.js → presenter-BcxiQyJg.js} +13 -3
- package/dist/presenter-BcxiQyJg.js.map +1 -0
- package/dist/{process-channel-CTPL81j6.js → process-channel-QRugdtrY.js} +2 -2
- package/dist/{process-channel-CTPL81j6.js.map → process-channel-QRugdtrY.js.map} +1 -1
- package/dist/{runtime-B5qYKA19.js → runtime-C2v7iKNY.js} +126 -16
- package/dist/runtime-C2v7iKNY.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-DLxVsqpW.js → runtime-agent-controller-reporting-submission-BFXtOHAU.js} +14 -25
- package/dist/runtime-agent-controller-reporting-submission-BFXtOHAU.js.map +1 -0
- package/dist/{runtime-transport-DyBmX7ds.js → runtime-transport-BVCHi4qM.js} +12 -6
- package/dist/runtime-transport-BVCHi4qM.js.map +1 -0
- package/dist/{service-CP8OUj6f.js → service-6waBVmON.js} +43 -20
- package/dist/service-6waBVmON.js.map +1 -0
- package/dist/{service-account-authorization-CdyvPbvg.js → service-account-authorization-C1CdX1P3.js} +2 -2
- package/dist/{service-account-authorization-CdyvPbvg.js.map → service-account-authorization-C1CdX1P3.js.map} +1 -1
- package/dist/{service-account-control-DoUzhuAB.js → service-account-control-BBY6pX86.js} +8 -9
- package/dist/{service-account-control-DoUzhuAB.js.map → service-account-control-BBY6pX86.js.map} +1 -1
- package/dist/{service-control-capabilities-aDlHjg5W.js → service-control-capabilities-BP9UE3a7.js} +3 -3
- package/dist/{service-control-capabilities-aDlHjg5W.js.map → service-control-capabilities-BP9UE3a7.js.map} +1 -1
- package/dist/{service-control-capabilities-DBwPbnh8.js → service-control-capabilities-CQjhvDFx.js} +1 -1
- package/dist/{state-BEY9weSc.js → state-BJJLEoJY.js} +2 -2
- package/dist/{state-BEY9weSc.js.map → state-BJJLEoJY.js.map} +1 -1
- package/dist/{updates-api-D4T5RACL.js → updates-api-dsNUTfpa.js} +142 -11
- package/dist/updates-api-dsNUTfpa.js.map +1 -0
- package/dist/upgrade-CUyMj35o.js +4 -0
- package/dist/{upgrade-BplZgGrz.js → upgrade-DwlRN4_U.js} +9 -9
- package/dist/{upgrade-BplZgGrz.js.map → upgrade-DwlRN4_U.js.map} +1 -1
- package/dist/windows/openmeld-windows-process.exe +0 -0
- package/package.json +9 -9
- package/skills/openmeld-cli/playbooks/space-ops.md +24 -2
- package/skills/openmeld-cli/references/commands.md +9 -2
- package/dist/auth-session-CCLabxRT.js +0 -4
- package/dist/channel-BW2_rI6u.js.map +0 -1
- package/dist/command-DApK5Fss.js.map +0 -1
- package/dist/context-D3GnSqg8.js +0 -162
- package/dist/context-D3GnSqg8.js.map +0 -1
- package/dist/daemon-device-id-OMqh2F9_.js.map +0 -1
- package/dist/dist-Be3IwaFl.js +0 -4
- package/dist/dist-Ccpvj1tf.js +0 -216
- package/dist/dist-Ccpvj1tf.js.map +0 -1
- package/dist/dist-Co4QfNdK.js.map +0 -1
- package/dist/elapsed-time-LyPBZcr1.js.map +0 -1
- package/dist/io-DT66typ4.js +0 -16
- package/dist/io-DT66typ4.js.map +0 -1
- package/dist/meta-api-JNwpu5-2.js.map +0 -1
- package/dist/openmeld-DDUAg1-S.js.map +0 -1
- package/dist/prepare-provider-runtime-DAiq8vyv.js.map +0 -1
- package/dist/presenter-MJ5YgsOT.js.map +0 -1
- package/dist/runtime-B5qYKA19.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-DLxVsqpW.js.map +0 -1
- package/dist/runtime-transport-DyBmX7ds.js.map +0 -1
- package/dist/service-CP8OUj6f.js.map +0 -1
- package/dist/updates-api-D4T5RACL.js.map +0 -1
- package/dist/upgrade-foZUS_GZ.js +0 -4
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { f as toSpaceMetaUrl } from "./urls-CY2uzH2-.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Vn as toStructuredApiClientFailure, mn as createSpaceApi, rr as OPENMELD_HEADER_REQUEST_ID, t as OpenMeldApiClientHttpError, vi as spaceMetaSchema, xr as gatewayErrorEnvelopeSchema } from "./dist-s_YTHAIc.js";
|
|
5
|
+
import { Pn as spaceFileNameSchema, Rr as clientMessageIdSchema, Sr as executionContextSelectionSchema, dn as SPACE_FILE_MAX_SIZE_BYTES, or as buildTargetWakeLifecycleId, xn as resolveSpaceFileMimeType } from "./runtime-transport-BVCHi4qM.js";
|
|
6
|
+
import { C as createSpaceSendInputConflictGuideError, E as createSpaceSendInputRequiredGuideError, T as createSpaceSendInputFileReadFailedGuideError, w as createSpaceSendInputEmptyGuideError } from "./dual-view-guide-catalog-DDYa38RT.js";
|
|
7
|
+
import { n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-DNbvvZW2.js";
|
|
7
8
|
import { basename } from "node:path";
|
|
8
|
-
import { access } from "node:fs/promises";
|
|
9
|
+
import { access, readFile } from "node:fs/promises";
|
|
10
|
+
import * as z$1 from "zod/v4";
|
|
9
11
|
import { openAsBlob } from "node:fs";
|
|
12
|
+
//#region ../../packages/schemas/dist/schemas/cli/space-send.js
|
|
13
|
+
const selectorSchema = z$1.string().trim().min(1);
|
|
14
|
+
/** The Agent View `space.send.request` data, emitted before publication. */
|
|
15
|
+
const spaceSendRequestReceiptSchema = z$1.strictObject({
|
|
16
|
+
spaceId: selectorSchema,
|
|
17
|
+
clientMessageId: clientMessageIdSchema,
|
|
18
|
+
targetProfileIds: z$1.array(selectorSchema),
|
|
19
|
+
profileId: selectorSchema.optional()
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
10
22
|
//#region src/space/cli-space-api.ts
|
|
11
23
|
function createCliSpaceApi(baseUrl, options = {}) {
|
|
12
24
|
return createSpaceApi(createCliApiClientFoundation(baseUrl, options));
|
|
@@ -154,6 +166,105 @@ function formatFileSizeLimit() {
|
|
|
154
166
|
return `${SPACE_FILE_MAX_SIZE_BYTES / (1024 * 1024)} MiB`;
|
|
155
167
|
}
|
|
156
168
|
//#endregion
|
|
169
|
+
//#region src/space/send-input.ts
|
|
170
|
+
function resolveSpaceTaskSelection(input) {
|
|
171
|
+
const modes = Number(input.newTask === true) + Number(Boolean(input.forkFrom)) + Number(Boolean(input.continueFrom));
|
|
172
|
+
if (modes === 0 && !input.taskAccess && !input.taskWorkspace) return;
|
|
173
|
+
if (modes > 1) throw new Error("Choose only one of --new-task, --fork-from, or --continue-from.");
|
|
174
|
+
const targetProfileId = input.wakeTargets?.[0];
|
|
175
|
+
if (!targetProfileId || input.wakeTargets?.length !== 1) throw new Error("Task selection requires exactly one --wake <profile-id>.");
|
|
176
|
+
if (input.continueFrom && (input.taskAccess || input.taskWorkspace)) throw new Error("A continued task keeps its original file access and workspace. Start a new task to change them.");
|
|
177
|
+
const sourceSignalId = input.forkFrom ?? input.continueFrom;
|
|
178
|
+
const sourceWakeId = sourceSignalId ? buildTargetWakeLifecycleId({
|
|
179
|
+
spaceId: input.space,
|
|
180
|
+
sourceSignalId,
|
|
181
|
+
targetProfileId
|
|
182
|
+
}) : void 0;
|
|
183
|
+
const preferences = {
|
|
184
|
+
access: input.taskAccess,
|
|
185
|
+
workspace: input.taskWorkspace
|
|
186
|
+
};
|
|
187
|
+
let value;
|
|
188
|
+
if (input.continueFrom) value = {
|
|
189
|
+
mode: "resume",
|
|
190
|
+
sourceWakeId
|
|
191
|
+
};
|
|
192
|
+
else if (input.forkFrom) value = {
|
|
193
|
+
mode: "fork",
|
|
194
|
+
sourceWakeId,
|
|
195
|
+
...preferences
|
|
196
|
+
};
|
|
197
|
+
else value = {
|
|
198
|
+
mode: input.newTask ? "new" : "auto",
|
|
199
|
+
...preferences
|
|
200
|
+
};
|
|
201
|
+
const parsed = executionContextSelectionSchema.safeParse(value);
|
|
202
|
+
if (!parsed.success) throw new Error(parsed.error.issues[0]?.message ?? "Invalid task selection.");
|
|
203
|
+
return parsed.data;
|
|
204
|
+
}
|
|
205
|
+
async function resolveSpaceSendText(input) {
|
|
206
|
+
const textValue = String(input.text ?? "");
|
|
207
|
+
const stdinEnabled = input.stdin === true;
|
|
208
|
+
const filePath = String(input.file ?? "").trim();
|
|
209
|
+
const hasTextSource = textValue.length > 0;
|
|
210
|
+
const hasFileSource = filePath.length > 0;
|
|
211
|
+
const sourceCount = Number(hasTextSource) + Number(stdinEnabled) + Number(hasFileSource);
|
|
212
|
+
if (sourceCount === 0) {
|
|
213
|
+
if (input.allowEmpty) return "";
|
|
214
|
+
throw createSpaceSendInputRequiredGuideError();
|
|
215
|
+
}
|
|
216
|
+
if (sourceCount > 1) throw createSpaceSendInputConflictGuideError();
|
|
217
|
+
let resolvedText = textValue;
|
|
218
|
+
if (hasFileSource) {
|
|
219
|
+
const readFromFile = input.readFromFile ?? readSpaceSendFile;
|
|
220
|
+
try {
|
|
221
|
+
resolvedText = await readFromFile(filePath);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
throw createSpaceSendInputFileReadFailedGuideError(filePath, toErrorMessage(error));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (stdinEnabled) resolvedText = await (input.readFromStdin ?? readSpaceSendStdin)();
|
|
227
|
+
if (resolvedText.trim().length === 0 && !input.allowEmpty) throw createSpaceSendInputEmptyGuideError();
|
|
228
|
+
return resolvedText;
|
|
229
|
+
}
|
|
230
|
+
function readSpaceSendFile(path) {
|
|
231
|
+
return readFile(path, "utf8");
|
|
232
|
+
}
|
|
233
|
+
function readSpaceSendStdin() {
|
|
234
|
+
return new Promise((resolve, reject) => {
|
|
235
|
+
const chunks = [];
|
|
236
|
+
const cleanup = () => {
|
|
237
|
+
process.stdin.off("data", onData);
|
|
238
|
+
process.stdin.off("end", onEnd);
|
|
239
|
+
process.stdin.off("error", onError);
|
|
240
|
+
};
|
|
241
|
+
const onData = (chunk) => {
|
|
242
|
+
if (typeof chunk === "string") {
|
|
243
|
+
chunks.push(chunk);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
chunks.push(chunk.toString("utf8"));
|
|
247
|
+
};
|
|
248
|
+
const onEnd = () => {
|
|
249
|
+
cleanup();
|
|
250
|
+
resolve(chunks.join(""));
|
|
251
|
+
};
|
|
252
|
+
const onError = (error) => {
|
|
253
|
+
cleanup();
|
|
254
|
+
reject(error);
|
|
255
|
+
};
|
|
256
|
+
process.stdin.setEncoding("utf8");
|
|
257
|
+
process.stdin.on("data", onData);
|
|
258
|
+
process.stdin.on("end", onEnd);
|
|
259
|
+
process.stdin.on("error", onError);
|
|
260
|
+
process.stdin.resume();
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function toErrorMessage(error) {
|
|
264
|
+
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
265
|
+
return String(error ?? "unknown error");
|
|
266
|
+
}
|
|
267
|
+
//#endregion
|
|
157
268
|
//#region src/space/api-json.ts
|
|
158
269
|
function parseJsonResponse(raw) {
|
|
159
270
|
if (!raw.trim()) return null;
|
|
@@ -366,6 +477,6 @@ async function updateSpaceMeta(input) {
|
|
|
366
477
|
});
|
|
367
478
|
}
|
|
368
479
|
//#endregion
|
|
369
|
-
export { GatewayHttpError as a, toStructuredGatewayFailure as c,
|
|
480
|
+
export { GatewayHttpError as a, toStructuredGatewayFailure as c, resolveSpaceTaskSelection as d, prepareRequestedSpaceSendFiles as f, spaceSendRequestReceiptSchema as h, parseSpaceMetaResponse as i, parseJsonResponse as l, createCliSpaceApi as m, updateSpaceMeta as n, readGatewayJsonResponse as o, uploadPreparedSpaceFiles as p, parseSpaceMetaPayload as r, readGatewayTextResponse as s, fetchSpaceMeta as t, resolveSpaceSendText as u };
|
|
370
481
|
|
|
371
|
-
//# sourceMappingURL=meta-api-
|
|
482
|
+
//# sourceMappingURL=meta-api-tg1rD8mP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-api-tg1rD8mP.js","names":["record"],"sources":["../../../packages/schemas/dist/schemas/cli/space-send.js","../src/space/cli-space-api.ts","../src/space/send-files.ts","../src/space/send-input.ts","../src/space/api-json.ts","../src/space/gateway-response.ts","../src/space/space-meta-response.ts","../src/space/meta-api.ts"],"sourcesContent":["import { clientMessageIdSchema } from \"../protocol/client-message-id.js\";\nimport * as z$1 from \"zod/v4\";\n//#region src/schemas/cli/space-send.ts\nconst selectorSchema = z$1.string().trim().min(1);\n/** The Agent View `space.send.request` data, emitted before publication. */\nconst spaceSendRequestReceiptSchema = z$1.strictObject({\n\tspaceId: selectorSchema,\n\tclientMessageId: clientMessageIdSchema,\n\ttargetProfileIds: z$1.array(selectorSchema),\n\tprofileId: selectorSchema.optional()\n});\n//#endregion\nexport { spaceSendRequestReceiptSchema };\n\n//# sourceMappingURL=space-send.js.map","import { createSpaceApi, type SpaceApi } from \"@openmeld/api-client\";\nimport { createCliApiClientFoundation } from \"./api-client-foundation\";\n\nexport type {\n SpaceApi,\n SpaceSignalsReadQuery,\n} from \"@openmeld/api-client\";\n\nexport function createCliSpaceApi(\n baseUrl: string,\n options: Parameters<typeof createCliApiClientFoundation>[1] = {}\n): SpaceApi {\n return createSpaceApi(createCliApiClientFoundation(baseUrl, options));\n}\n","import { openAsBlob } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { basename } from \"node:path\";\nimport {\n type StructuredApiClientFailure,\n toStructuredApiClientFailure,\n} from \"@openmeld/api-client\";\nimport {\n resolveSpaceFileMimeType,\n SPACE_FILE_MAX_SIZE_BYTES,\n SPACE_MESSAGE_FILE_MAX_COUNT,\n spaceFileNameSchema,\n} from \"@openmeld/schemas\";\nimport type {\n OpenMeldRequestContext,\n SpaceMessageFileReference,\n} from \"@openmeld/schemas/types\";\nimport type { SpaceApi } from \"./cli-space-api\";\n\ntype PreparedSpaceFile = {\n bytes: Blob;\n name: string;\n mimeType: string;\n};\n\ntype SpaceFileCleanupFailure = {\n failure: StructuredApiClientFailure;\n fileId: string;\n};\n\nexport class SpaceSendFileError extends Error {\n readonly code: string;\n readonly requestId?: string;\n readonly status?: number;\n readonly upstreamCode?: string;\n\n constructor(input: {\n code: string;\n message: string;\n cause?: unknown;\n requestId?: string | null;\n status?: number | null;\n upstreamCode?: string | null;\n }) {\n super(input.message, { cause: input.cause });\n this.name = \"SpaceSendFileError\";\n this.code = input.code;\n if (input.requestId) {\n this.requestId = input.requestId;\n }\n if (input.status !== null && input.status !== undefined) {\n this.status = input.status;\n }\n if (input.upstreamCode) {\n this.upstreamCode = input.upstreamCode;\n }\n }\n}\n\nexport async function prepareRequestedSpaceSendFiles(input: {\n filePaths: readonly string[];\n}): Promise<readonly PreparedSpaceFile[]> {\n if (input.filePaths.length > SPACE_MESSAGE_FILE_MAX_COUNT) {\n throw new SpaceSendFileError({\n code: \"space.file.too_many\",\n message: `A Space message can include at most ${SPACE_MESSAGE_FILE_MAX_COUNT} files. The message was not sent.`,\n });\n }\n\n const prepared: PreparedSpaceFile[] = [];\n for (const rawPath of input.filePaths) {\n if (!rawPath.trim()) {\n throw new SpaceSendFileError({\n code: \"space.file.invalid_path\",\n message: \"File paths cannot be empty. The message was not sent.\",\n });\n }\n prepared.push(await prepareSpaceSendFile(rawPath));\n }\n return prepared;\n}\n\nexport async function uploadPreparedSpaceFiles(input: {\n files: readonly PreparedSpaceFile[];\n password?: string;\n requestContext: OpenMeldRequestContext;\n spaceApi: SpaceApi;\n spaceId: string;\n}): Promise<readonly SpaceMessageFileReference[]> {\n const uploaded: SpaceMessageFileReference[] = [];\n for (const file of input.files) {\n try {\n const descriptor = await input.spaceApi.uploadFile({\n bytes: file.bytes,\n clientMutationId: crypto.randomUUID(),\n mimeType: file.mimeType,\n name: file.name,\n origin: \"chat_upload\",\n parentId: null,\n requestContext: input.requestContext,\n spaceId: input.spaceId,\n ...(input.password === undefined\n ? {}\n : { spacePassword: input.password }),\n });\n uploaded.push({\n fileId: descriptor.id,\n revision: descriptor.latestRevision.revision,\n name: descriptor.name,\n mimeType: descriptor.latestRevision.mimeType,\n sizeBytes: descriptor.latestRevision.sizeBytes,\n });\n } catch (error) {\n const failure = toStructuredApiClientFailure(error);\n const cleanupFailures = await moveUploadedFilesToTrash({\n files: uploaded,\n password: input.password,\n requestContext: input.requestContext,\n spaceApi: input.spaceApi,\n spaceId: input.spaceId,\n });\n let cleanupMessage = \"\";\n if (uploaded.length > 0) {\n cleanupMessage =\n cleanupFailures.length === 0\n ? \" Files added earlier in this send were moved to Trash.\"\n : ` ${formatCleanupFailures({\n failures: cleanupFailures,\n passwordProtected: input.password !== undefined,\n profileId: input.requestContext.actorContext.openMeldProfileId,\n spaceId: input.spaceId,\n })}`;\n }\n throw new SpaceSendFileError({\n code: failure.code ?? \"space.file.upload_failed\",\n message: `Could not add file \"${file.name}\" to this Space. The message was not sent. ${failure.message}${cleanupMessage}`,\n cause: error,\n requestId: failure.requestId,\n status: failure.status,\n upstreamCode: failure.upstreamCode,\n });\n }\n }\n return uploaded;\n}\n\nasync function moveUploadedFilesToTrash(input: {\n files: readonly SpaceMessageFileReference[];\n password?: string;\n requestContext: OpenMeldRequestContext;\n spaceApi: SpaceApi;\n spaceId: string;\n}): Promise<readonly SpaceFileCleanupFailure[]> {\n const failures: SpaceFileCleanupFailure[] = [];\n for (const file of input.files) {\n try {\n await input.spaceApi.trashFileEntry({\n clientMutationId: crypto.randomUUID(),\n entryId: file.fileId,\n requestContext: input.requestContext,\n spaceId: input.spaceId,\n ...(input.password === undefined\n ? {}\n : { spacePassword: input.password }),\n });\n } catch (error) {\n failures.push({\n failure: toStructuredApiClientFailure(error),\n fileId: file.fileId,\n });\n }\n }\n return failures;\n}\n\nfunction formatCleanupFailures(input: {\n failures: readonly SpaceFileCleanupFailure[];\n passwordProtected: boolean;\n profileId: string;\n spaceId: string;\n}): string {\n const failureMessages = input.failures\n .map(({ failure, fileId }) => {\n const evidence = [\n failure.code ? `code ${failure.code}` : null,\n failure.requestId ? `request ${failure.requestId}` : null,\n ]\n .filter((value): value is string => value !== null)\n .join(\", \");\n const evidenceText = evidence ? ` (${evidence})` : \"\";\n return `Could not move file ${fileId} to Trash${evidenceText}: ${failure.message} Run \\`openmeld space files trash ${input.spaceId} ${fileId} --profile ${input.profileId}\\` to finish cleanup.`;\n })\n .join(\" \");\n const passwordGuidance = input.passwordProtected\n ? \" This Space is password protected. Add `--password` with the same Space password you used for this send; OpenMeld does not include the password in this message.\"\n : \"\";\n return `${failureMessages}${passwordGuidance}`;\n}\n\nasync function prepareSpaceSendFile(\n sourcePath: string\n): Promise<PreparedSpaceFile> {\n let bytes: Blob;\n try {\n // openAsBlob collapses missing paths into ERR_INVALID_ARG_VALUE on Node 24.\n // Preserve the filesystem error code for the user-facing failure category.\n await access(sourcePath);\n bytes = await openAsBlob(sourcePath);\n } catch (error) {\n const code = readNodeErrorCode(error);\n if (code === \"ENOENT\") {\n throw new SpaceSendFileError({\n code: \"space.file.file_not_found\",\n message: `File not found: ${sourcePath}. The message was not sent.`,\n cause: error,\n });\n }\n throw new SpaceSendFileError({\n code: \"space.file.file_unreadable\",\n message: `Could not read file: ${sourcePath}. The message was not sent.`,\n cause: error,\n });\n }\n\n if (bytes.size > SPACE_FILE_MAX_SIZE_BYTES) {\n throw new SpaceSendFileError({\n code: \"space.file.too_large\",\n message: `File exceeds the ${formatFileSizeLimit()} limit: ${sourcePath}. The message was not sent.`,\n });\n }\n\n const parsedName = spaceFileNameSchema.safeParse(basename(sourcePath));\n if (!parsedName.success) {\n throw new SpaceSendFileError({\n code: \"space.file.invalid_file_name\",\n message: `File name is invalid: ${sourcePath}. The message was not sent.`,\n });\n }\n\n return {\n bytes,\n name: parsedName.data,\n mimeType: resolveSpaceFileMimeType({ fileName: parsedName.data }),\n };\n}\n\nfunction readNodeErrorCode(error: unknown): string | null {\n if (!(error && typeof error === \"object\" && \"code\" in error)) {\n return null;\n }\n return typeof error.code === \"string\" ? error.code : null;\n}\n\nfunction formatFileSizeLimit(): string {\n return `${SPACE_FILE_MAX_SIZE_BYTES / (1024 * 1024)} MiB`;\n}\n","import { readFile } from \"node:fs/promises\";\nimport {\n buildTargetWakeLifecycleId,\n executionContextSelectionSchema,\n} from \"@openmeld/schemas\";\nimport type { ExecutionContextSelection } from \"@openmeld/schemas/types\";\nimport {\n createSpaceSendInputConflictGuideError,\n createSpaceSendInputEmptyGuideError,\n createSpaceSendInputFileReadFailedGuideError,\n createSpaceSendInputRequiredGuideError,\n} from \"../runtime/dual-view-guide-catalog\";\n\ntype ResolveSpaceSendTextInput = {\n allowEmpty?: boolean;\n text?: string;\n stdin?: boolean;\n file?: string;\n readFromStdin?: () => Promise<string>;\n readFromFile?: (path: string) => Promise<string>;\n};\n\nexport function resolveSpaceTaskSelection(input: {\n space: string;\n wakeTargets?: readonly string[];\n newTask?: boolean;\n forkFrom?: string;\n continueFrom?: string;\n taskAccess?: string;\n taskWorkspace?: string;\n}): ExecutionContextSelection | undefined {\n const modes =\n Number(input.newTask === true) +\n Number(Boolean(input.forkFrom)) +\n Number(Boolean(input.continueFrom));\n if (modes === 0 && !input.taskAccess && !input.taskWorkspace) {\n return undefined;\n }\n if (modes > 1) {\n throw new Error(\n \"Choose only one of --new-task, --fork-from, or --continue-from.\"\n );\n }\n const targetProfileId = input.wakeTargets?.[0];\n if (!targetProfileId || input.wakeTargets?.length !== 1) {\n throw new Error(\"Task selection requires exactly one --wake <profile-id>.\");\n }\n if (input.continueFrom && (input.taskAccess || input.taskWorkspace)) {\n throw new Error(\n \"A continued task keeps its original file access and workspace. Start a new task to change them.\"\n );\n }\n const sourceSignalId = input.forkFrom ?? input.continueFrom;\n const sourceWakeId = sourceSignalId\n ? buildTargetWakeLifecycleId({\n spaceId: input.space,\n sourceSignalId,\n targetProfileId,\n })\n : undefined;\n const preferences = {\n access: input.taskAccess,\n workspace: input.taskWorkspace,\n };\n let value: unknown;\n if (input.continueFrom) {\n value = { mode: \"resume\", sourceWakeId };\n } else if (input.forkFrom) {\n value = { mode: \"fork\", sourceWakeId, ...preferences };\n } else {\n value = { mode: input.newTask ? \"new\" : \"auto\", ...preferences };\n }\n const parsed = executionContextSelectionSchema.safeParse(value);\n if (!parsed.success) {\n throw new Error(\n parsed.error.issues[0]?.message ?? \"Invalid task selection.\"\n );\n }\n return parsed.data;\n}\n\nexport async function resolveSpaceSendText(\n input: ResolveSpaceSendTextInput\n): Promise<string> {\n const textValue = String(input.text ?? \"\");\n const stdinEnabled = input.stdin === true;\n const filePath = String(input.file ?? \"\").trim();\n\n const hasTextSource = textValue.length > 0;\n const hasFileSource = filePath.length > 0;\n const sourceCount =\n Number(hasTextSource) + Number(stdinEnabled) + Number(hasFileSource);\n\n if (sourceCount === 0) {\n if (input.allowEmpty) {\n return \"\";\n }\n throw createSpaceSendInputRequiredGuideError();\n }\n if (sourceCount > 1) {\n throw createSpaceSendInputConflictGuideError();\n }\n\n let resolvedText = textValue;\n if (hasFileSource) {\n const readFromFile = input.readFromFile ?? readSpaceSendFile;\n try {\n resolvedText = await readFromFile(filePath);\n } catch (error) {\n throw createSpaceSendInputFileReadFailedGuideError(\n filePath,\n toErrorMessage(error)\n );\n }\n }\n if (stdinEnabled) {\n const readFromStdin = input.readFromStdin ?? readSpaceSendStdin;\n resolvedText = await readFromStdin();\n }\n\n if (resolvedText.trim().length === 0 && !input.allowEmpty) {\n throw createSpaceSendInputEmptyGuideError();\n }\n\n return resolvedText;\n}\n\nfunction readSpaceSendFile(path: string): Promise<string> {\n return readFile(path, \"utf8\");\n}\n\nfunction readSpaceSendStdin(): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const chunks: string[] = [];\n\n const cleanup = () => {\n process.stdin.off(\"data\", onData);\n process.stdin.off(\"end\", onEnd);\n process.stdin.off(\"error\", onError);\n };\n\n const onData = (chunk: string | Buffer) => {\n if (typeof chunk === \"string\") {\n chunks.push(chunk);\n return;\n }\n chunks.push(chunk.toString(\"utf8\"));\n };\n\n const onEnd = () => {\n cleanup();\n resolve(chunks.join(\"\"));\n };\n\n const onError = (error: Error) => {\n cleanup();\n reject(error);\n };\n\n process.stdin.setEncoding(\"utf8\");\n process.stdin.on(\"data\", onData);\n process.stdin.on(\"end\", onEnd);\n process.stdin.on(\"error\", onError);\n process.stdin.resume();\n });\n}\n\nfunction toErrorMessage(error: unknown): string {\n if (error instanceof Error && error.message.trim().length > 0) {\n return error.message;\n }\n return String(error ?? \"unknown error\");\n}\n","export function parseJsonResponse(raw: string): unknown {\n if (!raw.trim()) {\n return null;\n }\n try {\n return JSON.parse(raw);\n } catch {\n return null;\n }\n}\n","import { OpenMeldApiClientHttpError } from \"@openmeld/api-client\";\nimport { OPENMELD_HEADER_REQUEST_ID } from \"@openmeld/gateway-contract\";\nimport { gatewayErrorEnvelopeSchema } from \"@openmeld/schemas\";\nimport type { GatewayErrorCode } from \"@openmeld/schemas/types\";\nimport { parseJsonResponse } from \"./api-json\";\n\nconst FALLBACK_GATEWAY_HTTP_ERROR_CODE = \"gateway.http_error\" as const;\nconst GENERIC_NETWORK_ERROR_CODES = [\n \"network.timeout\",\n \"network.request_failed\",\n] as const;\n\ntype SafeParseResult<T> = { success: true; data: T } | { success: false };\n\ntype GatewayResponseSchema<T> = {\n safeParse: (value: unknown) => SafeParseResult<T>;\n};\n\nexport type GatewayResponseErrorCode =\n | GatewayErrorCode\n | typeof FALLBACK_GATEWAY_HTTP_ERROR_CODE\n | (typeof GENERIC_NETWORK_ERROR_CODES)[number]\n | string;\n\nexport type StructuredGatewayFailure = {\n code: GatewayResponseErrorCode | null;\n message: string;\n requestId: string | null;\n status: number | null;\n upstreamCode: string | null;\n};\n\nexport class GatewayHttpError extends Error {\n readonly code: GatewayResponseErrorCode;\n readonly requestId: string | null;\n readonly status: number;\n readonly rawBody: string;\n readonly upstreamCode: string | null;\n\n constructor(input: {\n code: GatewayResponseErrorCode;\n message: string;\n requestId?: string | null;\n status: number;\n rawBody: string;\n upstreamCode?: string | null;\n }) {\n super(input.message);\n this.name = \"GatewayHttpError\";\n this.code = input.code;\n this.requestId = normalizeOptionalText(input.requestId);\n this.status = input.status;\n this.rawBody = input.rawBody;\n this.upstreamCode = normalizeOptionalText(input.upstreamCode);\n }\n}\n\nexport async function readGatewayJsonResponse<T>(input: {\n response: Response;\n schema: GatewayResponseSchema<T>;\n invalidMessage: string;\n}): Promise<T> {\n const raw = await input.response.text();\n assertGatewayResponseOk({\n response: input.response,\n raw,\n });\n\n const parsed = input.schema.safeParse(parseJsonResponse(raw));\n if (!parsed.success) {\n throw new Error(input.invalidMessage);\n }\n return parsed.data;\n}\n\nexport async function readGatewayTextResponse(input: {\n response: Response;\n}): Promise<string> {\n const raw = await input.response.text();\n assertGatewayResponseOk({\n response: input.response,\n raw,\n });\n return raw;\n}\n\nexport function assertGatewayResponseOk(input: {\n response: Response;\n raw: string;\n}): void {\n if (input.response.ok) {\n return;\n }\n throw parseGatewayErrorResponse(input);\n}\n\nexport function parseGatewayErrorResponse(input: {\n response: Pick<Response, \"headers\" | \"status\">;\n raw: string;\n}): GatewayHttpError {\n const payload = parseJsonResponse(input.raw);\n const parsed = gatewayErrorEnvelopeSchema.safeParse(payload);\n const headerRequestId = normalizeOptionalText(\n input.response.headers.get(OPENMELD_HEADER_REQUEST_ID)\n );\n\n if (parsed.success) {\n return new GatewayHttpError({\n code: parsed.data.error.code,\n message: parsed.data.error.message,\n requestId: parsed.data.error.requestId || headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: parsed.data.error.upstreamCode ?? null,\n });\n }\n\n const looseEnvelope = readLooseGatewayErrorEnvelope(payload);\n if (looseEnvelope) {\n return new GatewayHttpError({\n code: looseEnvelope.code ?? FALLBACK_GATEWAY_HTTP_ERROR_CODE,\n message:\n looseEnvelope.message ??\n `Gateway request failed with HTTP ${input.response.status}.`,\n requestId: looseEnvelope.requestId ?? headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: looseEnvelope.upstreamCode,\n });\n }\n\n return new GatewayHttpError({\n code: FALLBACK_GATEWAY_HTTP_ERROR_CODE,\n message:\n normalizeOptionalText(input.raw) ??\n `Gateway request failed with HTTP ${input.response.status}.`,\n requestId: headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: null,\n });\n}\n\nexport function toStructuredGatewayFailure(\n error: unknown\n): StructuredGatewayFailure {\n if (error instanceof OpenMeldApiClientHttpError) {\n return {\n code: error.code,\n message: normalizeFailureMessage(error.message),\n requestId: error.requestId,\n status: error.status,\n upstreamCode: error.upstreamCode,\n };\n }\n\n if (error instanceof GatewayHttpError) {\n return {\n code: error.code,\n message: normalizeFailureMessage(error.message),\n requestId: error.requestId,\n status: error.status,\n upstreamCode: error.upstreamCode,\n };\n }\n\n const genericErrorCode = readGenericErrorCode(error);\n if (genericErrorCode) {\n return {\n code: genericErrorCode,\n message: normalizeFailureMessage(\n error instanceof Error ? error.message : String(error)\n ),\n requestId: null,\n status: null,\n upstreamCode: null,\n };\n }\n\n return {\n code: null,\n message: normalizeFailureMessage(\n error instanceof Error ? error.message : String(error)\n ),\n requestId: null,\n status: null,\n upstreamCode: null,\n };\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFailureMessage(value: unknown): string {\n return normalizeOptionalText(value) ?? \"Unknown error.\";\n}\n\nfunction readGenericErrorCode(value: unknown): GatewayResponseErrorCode | null {\n if (!value || typeof value !== \"object\" || !(\"code\" in value)) {\n return null;\n }\n\n const normalized = normalizeOptionalText(\n (value as { code?: unknown }).code ?? null\n );\n return normalized as GatewayResponseErrorCode | null;\n}\n\nfunction readLooseGatewayErrorEnvelope(value: unknown): {\n code: string | null;\n message: string | null;\n requestId: string | null;\n upstreamCode: string | null;\n} | null {\n if (!value || typeof value !== \"object\") {\n return null;\n }\n\n const record = value as {\n error?: {\n code?: unknown;\n message?: unknown;\n requestId?: unknown;\n upstreamCode?: unknown;\n } | null;\n };\n const error = record.error;\n if (!error || typeof error !== \"object\") {\n return null;\n }\n\n const code = normalizeOptionalText(error.code);\n const message = normalizeOptionalText(error.message);\n const requestId = normalizeOptionalText(error.requestId);\n const upstreamCode = normalizeOptionalText(error.upstreamCode);\n if (!(code || message || requestId || upstreamCode)) {\n return null;\n }\n\n return {\n code,\n message,\n requestId,\n upstreamCode,\n };\n}\n","import type { SpaceMeta } from \"@openmeld/protocol\";\nimport { spaceMetaSchema } from \"@openmeld/schemas\";\n\ntype SpaceMetaParseOperation =\n | \"createSpaceMeta\"\n | \"fetchSpaceMeta\"\n | \"updateSpaceMeta\";\n\nexport function parseSpaceMetaPayload(input: {\n data: unknown;\n endpoint: string;\n operation: SpaceMetaParseOperation;\n}): SpaceMeta {\n try {\n const validation = spaceMetaSchema.safeParse(input.data);\n if (!validation.success) {\n const reason =\n validation.error.issues[0]?.message ??\n \"space meta payload does not match schema\";\n throw new Error(reason);\n }\n return validation.data;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${input.operation} received invalid response payload from ${input.endpoint}: ${reason}; raw=${JSON.stringify(input.data)}`\n );\n }\n}\n\nexport function parseSpaceMetaResponse(input: {\n raw: string;\n endpoint: string;\n operation: Extract<\n SpaceMetaParseOperation,\n \"fetchSpaceMeta\" | \"updateSpaceMeta\"\n >;\n}): SpaceMeta {\n try {\n return parseSpaceMetaPayload({\n data: JSON.parse(input.raw) as unknown,\n endpoint: input.endpoint,\n operation: input.operation,\n });\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${input.operation} received invalid response payload from ${input.endpoint}: ${reason}; raw=${input.raw}`\n );\n }\n}\n","import type { SpaceMeta } from \"@openmeld/protocol\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport { buildOpenMeldRequestContextHeadersWithAuth } from \"../config/request-headers\";\nimport { toSpaceMetaUrl } from \"../protocol/urls\";\nimport { fetchSpaceRequestWithTimeout } from \"./fetch-with-timeout\";\nimport { readGatewayTextResponse } from \"./gateway-response\";\nimport { parseSpaceMetaResponse } from \"./space-meta-response\";\n\ntype SpaceMetaApiInput = {\n requestContext: OpenMeldRequestContext;\n baseUrl: string;\n space: string;\n password?: string;\n};\n\nexport async function fetchSpaceMeta(\n input: SpaceMetaApiInput\n): Promise<SpaceMeta> {\n const endpoint = toSpaceMetaUrl(input.baseUrl, input.space);\n const response = await fetchSpaceRequestWithTimeout({\n url: endpoint,\n operation: \"space.fetch_meta\",\n init: {\n method: \"GET\",\n headers: await buildOpenMeldRequestContextHeadersWithAuth({\n requestUrl: endpoint,\n requestContext: input.requestContext,\n spacePassword: input.password,\n }),\n },\n });\n const raw = await readGatewayTextResponse({ response });\n\n return parseSpaceMetaResponse({\n raw,\n endpoint,\n operation: \"fetchSpaceMeta\",\n });\n}\n\nexport async function updateSpaceMeta(\n input: SpaceMetaApiInput & {\n purpose?: string;\n guide?: string;\n }\n): Promise<SpaceMeta> {\n const endpoint = toSpaceMetaUrl(input.baseUrl, input.space);\n const headers = await buildOpenMeldRequestContextHeadersWithAuth({\n requestUrl: endpoint,\n requestContext: input.requestContext,\n spacePassword: input.password,\n });\n headers[\"content-type\"] = \"application/json\";\n\n const response = await fetchSpaceRequestWithTimeout({\n url: endpoint,\n operation: \"space.update_meta\",\n init: {\n method: \"PATCH\",\n headers,\n body: JSON.stringify({\n ...(input.purpose === undefined ? {} : { purpose: input.purpose }),\n ...(input.guide === undefined ? {} : { guide: input.guide }),\n }),\n },\n });\n const raw = await readGatewayTextResponse({ response });\n\n return parseSpaceMetaResponse({\n raw,\n endpoint,\n operation: \"updateSpaceMeta\",\n });\n}\n"],"mappings":";;;;;;;;;;;;AAGA,MAAM,iBAAiB,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;;AAEhD,MAAM,gCAAgC,IAAI,aAAa;CACtD,SAAS;CACT,iBAAiB;CACjB,kBAAkB,IAAI,MAAM,cAAc;CAC1C,WAAW,eAAe,SAAS;AACpC,CAAC;;;ACFD,SAAgB,kBACd,SACA,UAA8D,CAAC,GACrD;CACV,OAAO,eAAe,6BAA6B,SAAS,OAAO,CAAC;AACtE;;;ACiBA,IAAa,qBAAb,cAAwC,MAAM;CAC5C;CACA;CACA;CACA;CAEA,YAAY,OAOT;EACD,MAAM,MAAM,SAAS,EAAE,OAAO,MAAM,MAAM,CAAC;EAC3C,KAAK,OAAO;EACZ,KAAK,OAAO,MAAM;EAClB,IAAI,MAAM,WACR,KAAK,YAAY,MAAM;EAEzB,IAAI,MAAM,WAAW,QAAQ,MAAM,WAAW,KAAA,GAC5C,KAAK,SAAS,MAAM;EAEtB,IAAI,MAAM,cACR,KAAK,eAAe,MAAM;CAE9B;AACF;AAEA,eAAsB,+BAA+B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