@poe-platform/safe-js 0.1.743 → 0.1.745
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 +4 -3
- package/dist/safe-js/chunks/{chunk-F6CV74HU.js → chunk-3NFTBEZR.js} +2 -3
- package/dist/safe-js/chunks/{chunk-LMS5SSTN.js → chunk-5WP5IRMP.js} +437 -388
- package/dist/safe-js/chunks/{chunk-47JWFV2B.js → chunk-6UP3B5TB.js} +7 -8
- package/dist/safe-js/chunks/{chunk-24Z6PSCN.js → chunk-6ZVFR4HR.js} +1 -2
- package/dist/safe-js/chunks/{chunk-J3CUCOMP.js → chunk-AB6ERQE5.js} +14798 -14210
- package/dist/safe-js/chunks/{chunk-4YIDX44G.js → chunk-CQ52GEHY.js} +0 -1
- package/dist/safe-js/chunks/chunk-DHGJSEFX.js +0 -0
- package/dist/safe-js/chunks/{chunk-GVKXZW53.js → chunk-DIG26TEI.js} +0 -1
- package/dist/safe-js/chunks/{chunk-JCVARKWT.js → chunk-DIMBVKHT.js} +6 -7
- package/dist/safe-js/chunks/{chunk-UQPYTZOZ.js → chunk-JCHJGIQA.js} +0 -1
- package/dist/safe-js/chunks/{chunk-IRYOK5BR.js → chunk-L265M6OS.js} +2 -3
- package/dist/safe-js/chunks/{chunk-3ITVV2R6.js → chunk-L3MIVH3T.js} +1 -2
- package/dist/safe-js/chunks/{chunk-AUVGHYM5.js → chunk-LRINZRJA.js} +2 -3
- package/dist/safe-js/chunks/{chunk-UIUJHTWG.js → chunk-MKY3MQUB.js} +3 -4
- package/dist/safe-js/chunks/{chunk-YDVEVDVT.js → chunk-MLJ4BKDX.js} +102 -20
- package/dist/safe-js/chunks/{chunk-YUQFFRUF.js → chunk-MMN3IESA.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WEGFNME4.js → chunk-O3S3JVWS.js} +1 -2
- package/dist/safe-js/chunks/{chunk-2GVBG23M.js → chunk-ONWFPHUI.js} +0 -1
- package/dist/safe-js/chunks/chunk-OQYVEDRN.js +66 -0
- package/dist/safe-js/chunks/{chunk-EMH7CXQM.js → chunk-POEMWNHD.js} +1 -2
- package/dist/safe-js/chunks/{chunk-G6WTEIJJ.js → chunk-X3YCE3ZH.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WWETRQCF.js → chunk-YYF5R6ML.js} +3 -4
- package/dist/safe-js/chunks/{cli-runtime-3SOHLG5M.js → cli-runtime-BGB24HNE.js} +19 -20
- package/dist/safe-js/chunks/{dump-CSLHITIE.js → dump-M7CMVXW7.js} +5 -6
- package/dist/safe-js/chunks/harness-4CPQ7WKS.js +10 -0
- package/dist/safe-js/chunks/mcp-7SNWIP5H.js +11 -0
- package/dist/safe-js/chunks/migration-file-CPBVNMLD.js +14 -0
- package/dist/safe-js/chunks/restore-FLH6OC5F.js +13 -0
- package/dist/safe-js/chunks/run-KFAD7GTT.js +19 -0
- package/dist/safe-js/chunks/runtime-modules-D6NO4KJW.js +10 -0
- package/dist/safe-js/chunks/source-files-BSDM22Y2.js +9 -0
- package/dist/safe-js/cli.js +5 -6
- package/dist/safe-js/core.d.ts +1 -1
- package/dist/safe-js/core.js +14 -15
- package/dist/safe-js/extensions.d.ts +17 -0
- package/dist/safe-js/index.d.ts +2 -2
- package/dist/safe-js/index.js +22 -23
- package/dist/safe-js/interp/arguments.d.ts +2 -0
- package/dist/safe-js/interp/collection-properties.d.ts +2 -0
- package/dist/safe-js/interp/data-copy.d.ts +2 -0
- package/dist/safe-js/interp/host-bridge.d.ts +5 -0
- package/dist/safe-js/interp/host-capabilities.d.ts +5 -0
- package/dist/safe-js/interp/internal-symbols.d.ts +1 -0
- package/dist/safe-js/interp/interpreter.d.ts +3 -1
- package/dist/safe-js/interp/regex/compile-guard.d.ts +6 -4
- package/dist/safe-js/interp/template-cache.d.ts +5 -0
- package/dist/safe-js/interp/values.d.ts +11 -0
- package/dist/safe-js/modules/fs.d.ts +4 -3
- package/dist/safe-js/modules/fs.js +8 -9
- package/dist/safe-js/platform/context.d.ts +14 -0
- package/dist/safe-js/platform/node.d.ts +16 -0
- package/dist/safe-js/platform/types.d.ts +18 -0
- package/dist/safe-js/platform/workerd.d.ts +21 -0
- package/dist/safe-js/restore.d.ts +1 -1
- package/dist/safe-js/snapshot/validation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/safe-js/chunks/chunk-24Z6PSCN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-2GVBG23M.js.map +0 -7
- package/dist/safe-js/chunks/chunk-3ITVV2R6.js.map +0 -7
- package/dist/safe-js/chunks/chunk-47JWFV2B.js.map +0 -7
- package/dist/safe-js/chunks/chunk-4YIDX44G.js.map +0 -7
- package/dist/safe-js/chunks/chunk-AUVGHYM5.js.map +0 -7
- package/dist/safe-js/chunks/chunk-EMH7CXQM.js.map +0 -7
- package/dist/safe-js/chunks/chunk-F6CV74HU.js.map +0 -7
- package/dist/safe-js/chunks/chunk-G6WTEIJJ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-GVKXZW53.js.map +0 -7
- package/dist/safe-js/chunks/chunk-IRYOK5BR.js.map +0 -7
- package/dist/safe-js/chunks/chunk-J3CUCOMP.js.map +0 -7
- package/dist/safe-js/chunks/chunk-JCVARKWT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-LMS5SSTN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js +0 -1
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UIUJHTWG.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UQPYTZOZ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-V72WS373.js +0 -128
- package/dist/safe-js/chunks/chunk-V72WS373.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WEGFNME4.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WWETRQCF.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YDVEVDVT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YUQFFRUF.js.map +0 -7
- package/dist/safe-js/chunks/cli-runtime-3SOHLG5M.js.map +0 -7
- package/dist/safe-js/chunks/dump-CSLHITIE.js.map +0 -7
- package/dist/safe-js/chunks/harness-QKPVLVOT.js +0 -11
- package/dist/safe-js/chunks/harness-QKPVLVOT.js.map +0 -7
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js +0 -12
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js.map +0 -7
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js +0 -15
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js.map +0 -7
- package/dist/safe-js/chunks/restore-22OGYS6N.js +0 -14
- package/dist/safe-js/chunks/restore-22OGYS6N.js.map +0 -7
- package/dist/safe-js/chunks/run-EMFOFJ22.js +0 -20
- package/dist/safe-js/chunks/run-EMFOFJ22.js.map +0 -7
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js +0 -11
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js.map +0 -7
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js +0 -10
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js.map +0 -7
- package/dist/safe-js/cli.js.map +0 -7
- package/dist/safe-js/core.js.map +0 -7
- package/dist/safe-js/index.js.map +0 -7
- package/dist/safe-js/modules/fs.js.map +0 -7
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
hashParsedAst,
|
|
3
|
-
hashSource,
|
|
4
|
-
validateSnapshotMigration
|
|
5
|
-
} from "./chunk-AUVGHYM5.js";
|
|
6
|
-
import {
|
|
7
|
-
SnapshotValidationError,
|
|
8
|
-
assertSnapshotInactive,
|
|
9
|
-
createDynamicSource,
|
|
10
|
-
createEvalSource,
|
|
11
|
-
createModuleSource,
|
|
12
|
-
inMemoryRunSnapshots,
|
|
13
|
-
serializeSafeJSSnapshot,
|
|
14
|
-
validateDumpEnvelope,
|
|
15
|
-
validateGuestFunctionAst,
|
|
16
|
-
validateGuestHeapGraphs,
|
|
17
|
-
validateRuntimeSnapshotDescriptors,
|
|
18
|
-
validateTemplateObjects
|
|
19
|
-
} from "./chunk-J3CUCOMP.js";
|
|
20
|
-
import {
|
|
21
|
-
ParseError,
|
|
22
|
-
parseExecutableModule,
|
|
23
|
-
parseModule,
|
|
24
|
-
replaceErrorStack
|
|
25
|
-
} from "./chunk-LMS5SSTN.js";
|
|
26
|
-
|
|
27
|
-
// packages/safe-js/src/restore.ts
|
|
28
|
-
var SnapshotMismatchError = class extends Error {
|
|
29
|
-
actualHash;
|
|
30
|
-
expectedHash;
|
|
31
|
-
constructor(expectedHash, actualHash) {
|
|
32
|
-
super(
|
|
33
|
-
`source changed since snapshot was taken (hash ${expectedHash} expected, got ${actualHash}); pass --reset to discard`
|
|
34
|
-
);
|
|
35
|
-
this.name = "SnapshotMismatchError";
|
|
36
|
-
this.actualHash = actualHash;
|
|
37
|
-
this.expectedHash = expectedHash;
|
|
38
|
-
replaceErrorStack(this);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function restore(snapshot, options, owner) {
|
|
42
|
-
assertSnapshotInactive(snapshot);
|
|
43
|
-
try {
|
|
44
|
-
validateDumpEnvelope(snapshot, { resume: true });
|
|
45
|
-
} catch (error) {
|
|
46
|
-
if (!(error instanceof SnapshotValidationError) || error.code !== "invalidState" || error.path === "$.replayError" || !inMemoryRunSnapshots.has(snapshot)) throw error;
|
|
47
|
-
validateRuntimeSnapshotDescriptors(snapshot);
|
|
48
|
-
snapshot = JSON.parse(serializeSafeJSSnapshot(snapshot));
|
|
49
|
-
validateDumpEnvelope(snapshot, { resume: true });
|
|
50
|
-
}
|
|
51
|
-
validateSnapshotMigration(snapshot.migration, snapshot.sourceHash, owner);
|
|
52
|
-
const includeFunctionSource = snapshot.executionSemantics !== "jobs-v6" && snapshot.executionSemantics !== "jobs-v7";
|
|
53
|
-
const currentSourceHash = options.importSpecifiers === void 0 ? hashSource(options.source, owner, includeFunctionSource) : hashParsedAst(parseExecutableModule(options.source, "<input>", owner, options.importSpecifiers), includeFunctionSource);
|
|
54
|
-
if (snapshot.sourceHash !== currentSourceHash) {
|
|
55
|
-
throw new SnapshotMismatchError(snapshot.sourceHash, currentSourceHash);
|
|
56
|
-
}
|
|
57
|
-
if (snapshot.heap !== void 0 && typeof snapshot.heap === "object" && snapshot.heap !== null) {
|
|
58
|
-
const entries = Object.entries(snapshot.heap);
|
|
59
|
-
const closures = entries.filter(([, value]) => value !== null && typeof value === "object" && (["guest-function", "guest-class", "guest-generator"].includes(String(value.kind)) || value.templateNodeId !== void 0));
|
|
60
|
-
const dynamicSources = /* @__PURE__ */ new Map();
|
|
61
|
-
for (const [id, value] of entries) {
|
|
62
|
-
const record = value;
|
|
63
|
-
if (record.kind === "guest-source" || record.kind === "guest-script") {
|
|
64
|
-
try {
|
|
65
|
-
const compiled = record.kind === "guest-script" ? createEvalSource(record.body, record.context, owner) : record.functionKind === "module" ? createModuleSource(record.body, owner) : createDynamicSource(
|
|
66
|
-
record.functionKind,
|
|
67
|
-
record.parameters,
|
|
68
|
-
record.body,
|
|
69
|
-
owner
|
|
70
|
-
);
|
|
71
|
-
dynamicSources.set(Number(id), compiled.source);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
if (!(error instanceof SyntaxError) && !(error instanceof ParseError)) throw error;
|
|
74
|
-
throw new SnapshotValidationError("invalidValue", `$.heap[${JSON.stringify(id)}]`, error.message);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (closures.length > 0) {
|
|
79
|
-
const functions = /* @__PURE__ */ new Map();
|
|
80
|
-
const pending = [options.importSpecifiers === void 0 ? parseModule(options.source, "<input>", owner) : parseExecutableModule(options.source, "<input>", owner, options.importSpecifiers)];
|
|
81
|
-
while (pending.length > 0) {
|
|
82
|
-
const value = pending.pop();
|
|
83
|
-
if (value === null || typeof value !== "object") continue;
|
|
84
|
-
const node = value;
|
|
85
|
-
if (typeof node.nodeId === "number") {
|
|
86
|
-
functions.set(node.nodeId, node);
|
|
87
|
-
}
|
|
88
|
-
for (const entry of Object.values(node)) pending.push(entry);
|
|
89
|
-
}
|
|
90
|
-
const functionConstructibility = /* @__PURE__ */ new Map();
|
|
91
|
-
for (const [id, value] of closures) {
|
|
92
|
-
const record = value;
|
|
93
|
-
if (record.kind === "guest-array") continue;
|
|
94
|
-
const nodes = record.dynamicSource === void 0 ? functions : dynamicSources.get(record.dynamicSource.id).nodes;
|
|
95
|
-
const origin = nodes.get(record.astNodeId);
|
|
96
|
-
try {
|
|
97
|
-
validateGuestFunctionAst(record, origin);
|
|
98
|
-
if (record.kind === "guest-function") {
|
|
99
|
-
const node = origin;
|
|
100
|
-
functionConstructibility.set(
|
|
101
|
-
id,
|
|
102
|
-
(node.type === "FunctionDeclaration" || node.type === "FunctionExpression" && !node.method) && !node.async && !node.generator && !record.environment?.classInitializer
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
} catch (error) {
|
|
106
|
-
throw new SnapshotValidationError("invalidValue", `$.heap[${JSON.stringify(id)}].astNodeId`, error instanceof Error ? error.message : String(error));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
validateGuestHeapGraphs(snapshot.heap, functionConstructibility);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
throw new SnapshotValidationError("invalidValue", "$.heap", error instanceof Error ? error.message : String(error));
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
validateTemplateObjects(snapshot.heap, functions.values(), dynamicSources);
|
|
116
|
-
} catch (error) {
|
|
117
|
-
throw new SnapshotValidationError("invalidValue", "$.heap", String(error));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return snapshot;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export {
|
|
125
|
-
SnapshotMismatchError,
|
|
126
|
-
restore
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=chunk-V72WS373.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/restore.ts"],
|
|
4
|
-
"sourcesContent": ["import { hashParsedAst, hashSource } from \"./parse/hash.js\";\nimport type { CompileOwner } from \"./interp/budget.js\";\nimport { replaceErrorStack } from \"./error/shape.js\";\nimport { SnapshotValidationError, validateDumpEnvelope, validateRuntimeSnapshotDescriptors } from \"./snapshot/validation.js\";\nimport { inMemoryRunSnapshots, serializeSafeJSSnapshot } from \"./snapshot/dump-format.js\";\nimport { assertSnapshotInactive } from \"./interp/running-state.js\";\nimport { validateSnapshotMigration, type SnapshotMigration } from \"./snapshot/migration.js\";\nimport { parseExecutableModule, parseModule } from \"./parse/parser.js\";\nimport { ParseError } from \"./parse/format-error.js\";\nimport { createModuleSource, createDynamicSource, createEvalSource, type DynamicSource, type EvalSourceContext } from \"./parse/dynamic-source.js\";\nimport { validateGuestFunctionAst } from \"./snapshot/guest-ast-validation.js\";\nimport { validateGuestHeapGraphs } from \"./snapshot/guest-heap-validation.js\";\nimport { validateTemplateObjects } from \"./snapshot/template-validation.js\";\nimport type { ParseResult } from \"./parse.js\";\n\nexport type SafeJSSnapshot = {\n version?: number;\n sourceHash: string;\n migration?: SnapshotMigration;\n clock?: {\n next: number;\n };\n random?: {\n seed: number;\n state: number;\n initialState?: number;\n resumeState?: number;\n };\n [key: string]: unknown;\n};\n\nexport type RestoreOptions = {\n source: string;\n importSpecifiers?: readonly string[];\n};\n\nexport class SnapshotMismatchError extends Error {\n readonly actualHash: string;\n readonly expectedHash: string;\n\n constructor(expectedHash: string, actualHash: string) {\n super(\n `source changed since snapshot was taken (hash ${expectedHash} expected, got ${actualHash}); pass --reset to discard`\n );\n this.name = \"SnapshotMismatchError\";\n this.actualHash = actualHash;\n this.expectedHash = expectedHash;\n replaceErrorStack(this);\n }\n}\n\nexport function restore<TSnapshot extends SafeJSSnapshot>(\n snapshot: TSnapshot,\n options: RestoreOptions,\n owner?: CompileOwner\n): TSnapshot {\n assertSnapshotInactive(snapshot);\n try {\n validateDumpEnvelope(snapshot, { resume: true });\n } catch (error) {\n if (!(error instanceof SnapshotValidationError) || error.code !== \"invalidState\" || error.path === \"$.replayError\" ||\n !inMemoryRunSnapshots.has(snapshot)) throw error;\n // Runtime snapshots can retain guest descriptor state. Use the same portable\n // representation as dump(), then apply all normal validation below.\n validateRuntimeSnapshotDescriptors(snapshot);\n snapshot = JSON.parse(serializeSafeJSSnapshot(snapshot)) as TSnapshot;\n validateDumpEnvelope(snapshot, { resume: true });\n }\n validateSnapshotMigration(snapshot.migration, snapshot.sourceHash, owner);\n\n const includeFunctionSource = snapshot.executionSemantics !== \"jobs-v6\" && snapshot.executionSemantics !== \"jobs-v7\";\n const currentSourceHash = options.importSpecifiers === undefined\n ? hashSource(options.source, owner, includeFunctionSource)\n : hashParsedAst(parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers), includeFunctionSource);\n\n if (snapshot.sourceHash !== currentSourceHash) {\n throw new SnapshotMismatchError(snapshot.sourceHash, currentSourceHash);\n }\n\n if (snapshot.heap !== undefined && typeof snapshot.heap === \"object\" && snapshot.heap !== null) {\n const entries = Object.entries(snapshot.heap);\n const closures = entries.filter(([, value]) =>\n value !== null && typeof value === \"object\" && ([\"guest-function\", \"guest-class\", \"guest-generator\"].includes(String((value as Record<string, unknown>).kind)) ||\n (value as Record<string, unknown>).templateNodeId !== undefined));\n const dynamicSources = new Map<number, DynamicSource>();\n for (const [id, value] of entries) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-source\" || record.kind === \"guest-script\") {\n try {\n const compiled = record.kind === \"guest-script\"\n ? createEvalSource(record.body as string, record.context as EvalSourceContext, owner)\n : record.functionKind === \"module\" ? createModuleSource(record.body as string, owner)\n : createDynamicSource(record.functionKind as Exclude<DynamicSource[\"kind\"], \"eval\" | \"module\">,\n record.parameters as string, record.body as string, owner);\n dynamicSources.set(Number(id), compiled.source);\n } catch (error) {\n if (!(error instanceof SyntaxError) && !(error instanceof ParseError)) throw error;\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}]`, error.message);\n }\n }\n }\n if (closures.length > 0) {\n const functions = new Map<number, Record<string, unknown>>();\n const pending: unknown[] = [options.importSpecifiers === undefined\n ? parseModule(options.source, \"<input>\", owner)\n : parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers)];\n while (pending.length > 0) {\n const value = pending.pop();\n if (value === null || typeof value !== \"object\") continue;\n const node = value as Record<string, unknown>;\n if (typeof node.nodeId === \"number\") {\n functions.set(node.nodeId, node);\n }\n for (const entry of Object.values(node)) pending.push(entry);\n }\n const functionConstructibility = new Map<string, boolean>();\n for (const [id, value] of closures) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-array\") continue;\n const nodes = record.dynamicSource === undefined ? functions\n : dynamicSources.get((record.dynamicSource as {id: number}).id)!.nodes;\n const origin = nodes.get(record.astNodeId as number);\n try {\n validateGuestFunctionAst(record, origin);\n if (record.kind === \"guest-function\") {\n const node = origin as Record<string, unknown>;\n functionConstructibility.set(id,\n (node.type === \"FunctionDeclaration\" || (node.type === \"FunctionExpression\" && !node.method)) &&\n !node.async && !node.generator && !(record.environment as Record<string, unknown> | undefined)?.classInitializer);\n }\n }\n catch (error) {\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}].astNodeId`, error instanceof Error ? error.message : String(error));\n }\n }\n try { validateGuestHeapGraphs(snapshot.heap as Record<string, unknown>, functionConstructibility); }\n catch (error) { throw new SnapshotValidationError(\"invalidValue\", \"$.heap\", error instanceof Error ? error.message : String(error)); }\n try { validateTemplateObjects(snapshot.heap as Record<string, unknown>, functions.values() as Iterable<ParseResult>, dynamicSources); }\n catch (error) { throw new SnapshotValidationError(\"invalidValue\", \"$.heap\", String(error)); }\n }\n }\n\n return snapshot;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAM,wBAAN,cAAoC,MAAM;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AI,OAAO,SAAS,cAAe;AACnC,cAAM,QAAQ,OAAO,kBAAkB,SAAY,YAC/C,eAAe,IAAK,OAAO,cAA+B,EAAE,EAAG;AACnE,cAAM,SAAS,MAAM,IAAI,OAAO,SAAmB;AACnD,YAAI;AACF,mCAAyB,QAAQ,MAAM;AACvC,cAAI,OAAO,SAAS,kBAAkB;AACpC,kBAAM,OAAO;AACb,qCAAyB;AAAA,cAAI;AAAA,eAC1B,KAAK,SAAS,yBAA0B,KAAK,SAAS,wBAAwB,CAAC,KAAK,WACrF,CAAC,KAAK,SAAS,CAAC,KAAK,aAAa,CAAE,OAAO,aAAqD;AAAA,YAAgB;AAAA,UACpH;AAAA,QACF,SACO,OAAO;AACZ,gBAAM,IAAI,wBAAwB,gBAAgB,UAAU,KAAK,UAAU,EAAE,CAAC,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,QACrJ;AAAA,MACF;AACA,UAAI;AAAE,gCAAwB,SAAS,MAAiC,wBAAwB;AAAA,MAAG,SAC5F,OAAO;AAAE,cAAM,IAAI,wBAAwB,gBAAgB,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,MAAG;AACrI,UAAI;AAAE,gCAAwB,SAAS,MAAiC,UAAU,OAAO,GAA4B,cAAc;AAAA,MAAG,SAC/H,OAAO;AAAE,cAAM,IAAI,wBAAwB,gBAAgB,UAAU,OAAO,KAAK,CAAC;AAAA,MAAG;AAAA,IAC9F;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/lint/runtime-modules.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CallerInjectedBinding } from \"../interp/host-bridge.js\";\nimport { isSandboxClosure } from \"../interp/values.js\";\nimport type { ModuleExports, ModuleRegistry } from \"../modules/registry.js\";\nimport type { LintModuleExport, LintModuleExports, Modules } from \"./rules/module-registry.js\";\n\nconst AsyncFunction = (async () => undefined).constructor;\n\nexport function createLintModulesFromRuntimeRegistry(modules: ModuleRegistry): Modules {\n const entries = modules instanceof Map ? [...modules.entries()] : Object.entries(modules);\n\n return new Map(\n entries.map(([moduleName, moduleExports]) => [\n moduleName,\n {\n exports: createLintModuleExports(moduleExports)\n }\n ])\n );\n}\n\nfunction createLintModuleExports(moduleExports: ModuleExports): LintModuleExports {\n const entries =\n moduleExports instanceof Map ? [...moduleExports.entries()] : Object.entries(moduleExports);\n\n return new Map(\n entries\n .filter(([exportName]) => exportName.length > 0)\n .map(([exportName, value]) => [exportName, createLintModuleExport(value)] as const)\n .sort(([left], [right]) => left.localeCompare(right))\n );\n}\n\nfunction createLintModuleExport(value: CallerInjectedBinding): LintModuleExport {\n return isAsyncRuntimeExport(value) ? { async: true } : {};\n}\n\nfunction isAsyncRuntimeExport(value: CallerInjectedBinding): boolean {\n if (isSandboxClosure(value)) {\n return value.async === true;\n }\n\n return typeof value === \"function\" && value.constructor === AsyncFunction;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAKA,IAAM,iBAAiB,YAAY,QAAW;AAEvC,SAAS,qCAAqC,SAAkC;AACrF,QAAM,UAAU,mBAAmB,MAAM,CAAC,GAAG,QAAQ,QAAQ,CAAC,IAAI,OAAO,QAAQ,OAAO;AAExF,SAAO,IAAI;AAAA,IACT,QAAQ,IAAI,CAAC,CAAC,YAAY,aAAa,MAAM;AAAA,MAC3C;AAAA,MACA;AAAA,QACE,SAAS,wBAAwB,aAAa;AAAA,MAChD;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEA,SAAS,wBAAwB,eAAiD;AAChF,QAAM,UACJ,yBAAyB,MAAM,CAAC,GAAG,cAAc,QAAQ,CAAC,IAAI,OAAO,QAAQ,aAAa;AAE5F,SAAO,IAAI;AAAA,IACT,QACG,OAAO,CAAC,CAAC,UAAU,MAAM,WAAW,SAAS,CAAC,EAC9C,IAAI,CAAC,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY,uBAAuB,KAAK,CAAC,CAAU,EACjF,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,EACxD;AACF;AAEA,SAAS,uBAAuB,OAAgD;AAC9E,SAAO,qBAAqB,KAAK,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;AAC1D;AAEA,SAAS,qBAAqB,OAAuC;AACnE,MAAI,iBAAiB,KAAK,GAAG;AAC3B,WAAO,MAAM,UAAU;AAAA,EACzB;AAEA,SAAO,OAAO,UAAU,cAAc,MAAM,gBAAgB;AAC9D;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/modules/mcp.ts"],
|
|
4
|
-
"sourcesContent": ["import { McpError } from \"tiny-mcp-client\";\nimport { hostErrorData } from \"../error/shape.js\";\nimport { declareHostOperation } from \"../interp/host-bridge.js\";\nimport { runResources } from \"../interp/resources.js\";\nimport {\n connectMcpTransport,\n normalizeMcpOptions,\n type ManagedMcpConnection,\n type McpModuleOptions\n} from \"./mcp-transport.js\";\n\nexport type McpModuleServerHandle = {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n};\n\nexport type McpModuleTool = {\n name: string;\n description?: string;\n schema?: unknown;\n};\n\nexport type McpModuleToolCall = {\n name: string;\n args?: unknown;\n};\n\nexport type McpModuleToolBatchError = {\n name: string;\n message: string;\n};\n\nexport type McpModuleToolBatchResult =\n | {\n ok: true;\n value: unknown;\n }\n | {\n ok: false;\n error: McpModuleToolBatchError;\n };\n\nexport type McpModuleClient = {\n tools(): Promise<McpModuleTool[]>;\n tool(name: string, args?: unknown): Promise<unknown>;\n toolBatch(calls: McpModuleToolCall[]): Promise<McpModuleToolBatchResult[]>;\n};\n\nexport type McpConnection = {\n listTools(params?: { cursor?: string }): Promise<{\n tools: unknown[];\n nextCursor?: string;\n }>;\n callTool(params: { name: string; arguments?: unknown }): Promise<unknown>;\n callToolBatch?(\n params: Array<{\n name: string;\n arguments?: unknown;\n }>\n ): Promise<McpModuleToolBatchResult[]>;\n};\n\ntype McpToolRequest = Parameters<McpConnection[\"callTool\"]>[0];\n\ntype NormalizedToolBatchCall =\n | {\n ok: true;\n request: McpToolRequest;\n }\n | {\n ok: false;\n error: McpModuleToolBatchError;\n };\n\nconst DEFAULT_TOOL_BATCH_CONCURRENCY = 4;\n\nexport type ConnectMcp = (server: McpModuleServerHandle) => Promise<McpConnection> | McpConnection;\n\nexport type McpNamedServerHandle = { name: string };\nexport type ManagedMcpClient = McpModuleClient & { close(): Promise<void> };\nexport type ManagedMcpModule = {\n servers: Record<string, ManagedMcpClient>;\n server(name: string): McpNamedServerHandle;\n client(handle: McpNamedServerHandle | string): Promise<ManagedMcpClient>;\n};\n\ntype CustomMcpModule = {\n server(server: McpModuleServerHandle): McpModuleServerHandle;\n client(handle: McpModuleServerHandle): Promise<McpModuleClient>;\n};\n\nexport function makeMcpModule(options: McpModuleOptions): ManagedMcpModule;\nexport function makeMcpModule(connectMcp: ConnectMcp): CustomMcpModule;\nexport function makeMcpModule(\n connectMcp: ConnectMcp | McpModuleOptions\n): CustomMcpModule | ManagedMcpModule {\n if (typeof connectMcp !== \"function\") {\n const options = normalizeMcpOptions(connectMcp);\n const servers = Object.create(null) as Record<string, ManagedMcpClient>;\n for (const [name, config] of Object.entries(options.servers)) {\n const connections = new WeakMap<object, ManagedMcpConnection>();\n const directScope = {};\n const connection = () => {\n const scope = runResources.getStore();\n scope?.signal.throwIfAborted();\n options.signal?.throwIfAborted();\n const owner = scope ?? directScope;\n let current = connections.get(owner);\n if (current === undefined) {\n current = connectMcpTransport(config, options, scope?.signal);\n connections.set(owner, current);\n scope?.add(current.close);\n }\n return current.ready;\n };\n const invoke = async <Result>(\n operation: (client: Awaited<ReturnType<typeof connection>>) => Promise<Result>\n ): Promise<Result> => {\n try {\n const result = await operation(await connection());\n runResources.getStore()?.signal.throwIfAborted();\n options.signal?.throwIfAborted();\n return result;\n } catch (error) {\n runResources.getStore()?.signal.throwIfAborted();\n options.signal?.throwIfAborted();\n if (error instanceof McpError) {\n hostErrorData.set(error, {\n code: error.code,\n ...(error.data === undefined ? {} : { data: error.data })\n });\n }\n throw error;\n }\n };\n servers[name] = {\n tools: declareHostOperation(\n async () =>\n invoke(async (client) => {\n const tools: McpModuleTool[] = [];\n const cursors = new Set<string>();\n let pages = 0;\n let cursor: string | undefined;\n do {\n const result = await client.listTools(\n cursor === undefined ? undefined : { cursor }\n );\n pages += 1;\n tools.push(...normalizeToolsResult(result));\n cursor = result.nextCursor;\n if (cursor !== undefined) {\n if (typeof cursor !== \"string\" || cursors.has(cursor))\n throw new Error(\"MCP tools pagination did not advance.\");\n cursors.add(cursor);\n if (pages >= options.maxToolPages!)\n throw new Error(\"MCP tools page limit exceeded.\");\n }\n } while (cursor !== undefined);\n return tools;\n }),\n \"re-issue\"\n ),\n tool: declareHostOperation(async (toolName: string, args?: unknown) => {\n const request = createNullRecord({\n name: readNonEmptyTrimmedString(toolName, \"MCP tool name\"),\n ...(args === undefined ? {} : { arguments: readToolArguments(args) })\n });\n return invoke((client) => client.callTool(request));\n }, \"read-side-effect\"),\n toolBatch: declareHostOperation(async (calls: McpModuleToolCall[]) => {\n const normalized = readToolBatchCalls(calls);\n if (normalized.length === 0) return [];\n return invoke((client) => executeToolBatch(client, normalized));\n }, \"read-side-effect\"),\n close: declareHostOperation(async () => {\n const owner = runResources.getStore() ?? directScope;\n const current = connections.get(owner);\n if (current !== undefined) {\n await current.close();\n connections.delete(owner);\n }\n }, \"re-issue\")\n };\n }\n const readName = (value: unknown): string => {\n const name = readNonEmptyString(value, \"MCP server name\");\n if (!Object.hasOwn(servers, name)) throw new Error(`MCP server '${name}' is not configured.`);\n return name;\n };\n return {\n servers,\n server(name: string) {\n return createNullRecord({ name: readName(name) });\n },\n async client(handle: McpNamedServerHandle | string) {\n if (typeof handle === \"string\") return servers[readName(handle)];\n if (!isRecord(handle) || Object.keys(handle).length !== 1 || !Object.hasOwn(handle, \"name\"))\n throw new TypeError(\"MCP client requires a named server handle.\");\n return servers[readName(getOwnProperty(handle, \"name\"))];\n }\n };\n }\n return {\n server(server: McpModuleServerHandle) {\n return normalizeServerHandle(server);\n },\n\n async client(handle: McpModuleServerHandle) {\n const connection = validateConnection(await connectMcp(normalizeServerHandle(handle)));\n\n return {\n async tools() {\n return normalizeToolsResult(await connection.listTools());\n },\n\n async tool(name: string, args?: unknown) {\n return connection.callTool(\n createNullRecord({\n name: readNonEmptyTrimmedString(name, \"MCP tool name\"),\n ...(args === undefined ? {} : { arguments: readToolArguments(args) })\n })\n );\n },\n\n async toolBatch(calls: McpModuleToolCall[]) {\n return executeToolBatch(connection, readToolBatchCalls(calls));\n }\n };\n }\n };\n}\n\nasync function executeToolBatch(\n connection: McpConnection,\n calls: NormalizedToolBatchCall[]\n): Promise<McpModuleToolBatchResult[]> {\n if (calls.length === 0) {\n return [];\n }\n\n if (connection.callToolBatch !== undefined && calls.every((call) => call.ok)) {\n try {\n return normalizeProtocolBatchResults(\n await connection.callToolBatch(calls.map((call) => call.request)),\n calls.length\n );\n } catch (error) {\n const batchError = normalizeToolBatchError(error);\n return calls.map(() =>\n createNullRecord({\n ok: false,\n error: batchError\n })\n );\n }\n }\n\n return executeToolBatchWithConcurrency(connection, calls, DEFAULT_TOOL_BATCH_CONCURRENCY);\n}\n\nasync function executeToolBatchWithConcurrency(\n connection: McpConnection,\n calls: NormalizedToolBatchCall[],\n concurrency: number\n): Promise<McpModuleToolBatchResult[]> {\n const results = new Array<McpModuleToolBatchResult>(calls.length);\n let nextIndex = 0;\n let disconnectError: McpModuleToolBatchError | undefined;\n\n const workerCount = Math.min(concurrency, calls.length);\n const workers = Array.from({ length: workerCount }, async () => {\n while (nextIndex < calls.length) {\n const index = nextIndex;\n nextIndex += 1;\n\n const call = calls[index];\n if (call === undefined) {\n continue;\n }\n\n if (!call.ok) {\n results[index] = createNullRecord({\n ok: false,\n error: call.error\n });\n continue;\n }\n\n if (disconnectError !== undefined) {\n results[index] = createNullRecord({\n ok: false,\n error: disconnectError\n });\n continue;\n }\n\n try {\n results[index] = createNullRecord({\n ok: true,\n value: await connection.callTool(call.request)\n });\n } catch (error) {\n const toolError = normalizeToolBatchError(error);\n results[index] = createNullRecord({\n ok: false,\n error: toolError\n });\n\n if (isMcpDisconnectError(toolError)) {\n disconnectError = toolError;\n }\n }\n }\n });\n\n await Promise.all(workers);\n\n return results;\n}\n\nfunction normalizeProtocolBatchResults(\n value: unknown,\n expectedLength: number\n): McpModuleToolBatchResult[] {\n if (!Array.isArray(value) || value.length !== expectedLength) {\n throw new Error(\n \"MCP callToolBatch() must resolve to a result array matching the input length.\"\n );\n }\n\n return value.map((entry, index) => normalizeProtocolBatchResult(entry, index));\n}\n\nfunction normalizeProtocolBatchResult(value: unknown, index: number): McpModuleToolBatchResult {\n if (!isRecord(value)) {\n throw new Error(`MCP callToolBatch()[${index}] must be a result envelope.`);\n }\n\n const ok = getOwnProperty(value, \"ok\");\n if (typeof ok !== \"boolean\") {\n throw new Error(`MCP callToolBatch()[${index}] must be a result envelope.`);\n }\n\n if (ok === true) {\n return createNullRecord({\n ok: true,\n value: getOwnProperty(value, \"value\")\n });\n }\n\n return createNullRecord({\n ok: false,\n error: normalizeToolBatchError(getOwnProperty(value, \"error\"))\n });\n}\n\nfunction normalizeServerHandle(value: unknown): McpModuleServerHandle {\n if (!isRecord(value)) {\n throw new Error(\"MCP server must be an object.\");\n }\n\n const command = getOwnProperty(value, \"command\");\n const args = getOwnProperty(value, \"args\");\n const env = getOwnProperty(value, \"env\");\n\n return createNullRecord({\n command: readNonEmptyTrimmedString(command, \"MCP server command\"),\n ...(args === undefined ? {} : { args: readStringArray(args, \"MCP server args\") }),\n ...(env === undefined ? {} : { env: readStringRecord(env, \"MCP server env\") })\n });\n}\n\nfunction validateConnection(value: unknown): McpConnection {\n if (\n !isRecord(value) ||\n typeof value.listTools !== \"function\" ||\n typeof value.callTool !== \"function\"\n ) {\n throw new Error(\"connectMcp must resolve to an object with listTools() and callTool().\");\n }\n\n const callToolBatch = getOwnProperty(value, \"callToolBatch\");\n\n return createNullRecord({\n listTools: () => (value.listTools as McpConnection[\"listTools\"])(),\n callTool: (params) => (value.callTool as McpConnection[\"callTool\"])(params),\n ...(typeof callToolBatch === \"function\"\n ? {\n callToolBatch: (params: McpToolRequest[]) =>\n (callToolBatch as NonNullable<McpConnection[\"callToolBatch\"]>)(params)\n }\n : {})\n });\n}\n\nfunction normalizeToolsResult(value: unknown): McpModuleTool[] {\n const tools = isRecord(value) ? getOwnProperty(value, \"tools\") : undefined;\n if (!Array.isArray(tools)) {\n throw new Error(\"MCP listTools() must resolve to an object with a tools array.\");\n }\n\n return tools.map((tool, index) => normalizeTool(tool, index));\n}\n\nfunction normalizeTool(value: unknown, index: number): McpModuleTool {\n if (!isRecord(value)) {\n throw new Error(`MCP tool[${index}] must be an object.`);\n }\n\n const description = getOwnProperty(value, \"description\");\n const inputSchema = getOwnProperty(value, \"inputSchema\");\n\n return createNullRecord({\n name: readNonEmptyString(getOwnProperty(value, \"name\"), `MCP tool[${index}] name`),\n ...(description === undefined\n ? {}\n : { description: readOptionalString(description, `MCP tool[${index}] description`) }),\n ...(inputSchema === undefined ? {} : { schema: inputSchema })\n });\n}\n\nfunction readStringArray(value: unknown, label: string): string[] {\n if (!Array.isArray(value) || value.some((entry) => typeof entry !== \"string\")) {\n throw new Error(`${label} must be an array of strings.`);\n }\n\n return [...value];\n}\n\nfunction readStringRecord(value: unknown, label: string): Record<string, string> {\n if (!isRecord(value)) {\n throw new Error(`${label} must be an object.`);\n }\n\n const entries = Object.entries(value);\n\n if (entries.some(([, entry]) => typeof entry !== \"string\")) {\n throw new Error(`${label} must be a string record.`);\n }\n\n return createNullRecord(Object.fromEntries(entries) as Record<string, string>);\n}\n\nfunction readOptionalString(value: unknown, label: string): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n\n if (typeof value !== \"string\") {\n throw new Error(`${label} must be a string.`);\n }\n\n return value;\n}\n\nfunction readNonEmptyString(value: unknown, label: string): string {\n const text = readOptionalString(value, label);\n\n if (text === undefined || text.trim().length === 0) {\n throw new Error(`${label} must be a non-empty string.`);\n }\n\n return text;\n}\n\nfunction readNonEmptyTrimmedString(value: unknown, label: string): string {\n return readNonEmptyString(value, label).trim();\n}\n\nfunction readToolArguments(value: unknown): Record<string, unknown> {\n if (!isPlainObjectRecord(value)) {\n throw new Error(\"MCP tool arguments must be an object.\");\n }\n\n return createNullRecord(Object.fromEntries(Object.entries(value)) as Record<string, unknown>);\n}\n\nfunction readToolBatchCalls(value: unknown): NormalizedToolBatchCall[] {\n if (!Array.isArray(value)) {\n throw new Error(\"MCP toolBatch calls must be an array.\");\n }\n\n return value.map((entry, index) => normalizeToolBatchCall(entry, index));\n}\n\nfunction normalizeToolBatchCall(value: unknown, index: number): NormalizedToolBatchCall {\n try {\n if (!isRecord(value)) {\n throw new Error(`MCP toolBatch call[${index}] must be an object.`);\n }\n\n const args = getOwnProperty(value, \"args\");\n\n return createNullRecord({\n ok: true,\n request: createNullRecord({\n name: readNonEmptyTrimmedString(\n getOwnProperty(value, \"name\"),\n `MCP toolBatch call[${index}] name`\n ),\n ...(args === undefined ? {} : { arguments: readToolArguments(args) })\n })\n });\n } catch (error) {\n return createNullRecord({\n ok: false,\n error: normalizeToolBatchError(error)\n });\n }\n}\n\nfunction normalizeToolBatchError(error: unknown): McpModuleToolBatchError {\n if (error instanceof Error) {\n return createNullRecord({\n name: error.name.length === 0 ? \"Error\" : error.name,\n message: error.message\n });\n }\n\n if (isRecord(error)) {\n const nameValue = getOwnProperty(error, \"name\");\n const messageValue = getOwnProperty(error, \"message\");\n const name = typeof nameValue === \"string\" && nameValue.trim().length > 0 ? nameValue : \"Error\";\n const message = typeof messageValue === \"string\" ? messageValue : String(error);\n\n return createNullRecord({\n name,\n message\n });\n }\n\n return createNullRecord({\n name: \"Error\",\n message: error === undefined ? \"\" : String(error)\n });\n}\n\nfunction isMcpDisconnectError(error: McpModuleToolBatchError): boolean {\n const message = error.message.toLowerCase();\n\n return (\n message.includes(\"disconnected\") ||\n message.includes(\"connection closed\") ||\n message.includes(\"transport closed\") ||\n message.includes(\"disposed\") ||\n message.includes(\"eof\")\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction getOwnProperty<Name extends PropertyKey>(value: object, name: Name): unknown {\n return hasOwnProperty(value, name) ? value[name] : undefined;\n}\n\nfunction hasOwnProperty<Name extends PropertyKey>(\n value: object,\n name: Name\n): value is Record<Name, unknown> {\n return Object.prototype.hasOwnProperty.call(value, name);\n}\n\nfunction createNullRecord<T extends object>(value: T): T {\n return Object.assign(Object.create(null) as T, value);\n}\n\nfunction isPlainObjectRecord(value: unknown): value is Record<string, unknown> {\n if (!isRecord(value) || Array.isArray(value)) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AA2EA,IAAM,iCAAiC;AAmBhC,SAAS,cACd,YACoC;AACpC,MAAI,OAAO,eAAe,YAAY;AACpC,UAAM,UAAU,oBAAoB,UAAU;AAC9C,UAAM,UAAU,uBAAO,OAAO,IAAI;AAClC,eAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,QAAQ,OAAO,GAAG;AAC5D,YAAM,cAAc,oBAAI,QAAsC;AAC9D,YAAM,cAAc,CAAC;AACrB,YAAM,aAAa,MAAM;AACvB,cAAM,QAAQ,aAAa,SAAS;AACpC,eAAO,OAAO,eAAe;AAC7B,gBAAQ,QAAQ,eAAe;AAC/B,cAAM,QAAQ,SAAS;AACvB,YAAI,UAAU,YAAY,IAAI,KAAK;AACnC,YAAI,YAAY,QAAW;AACzB,oBAAU,oBAAoB,QAAQ,SAAS,OA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