poe-code 11.0.11 → 11.0.12
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/index.js +49 -5
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-QWNCR7EZ.js → chunk-5BWI6HAZ.js} +49 -5
- package/packages/safejs/dist/chunks/{chunk-QWNCR7EZ.js.map → chunk-5BWI6HAZ.js.map} +2 -2
- package/packages/safejs/dist/chunks/{chunk-2M5F6OIT.js → chunk-WV23C6SS.js} +2 -2
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/interp/globals/object-array.js +45 -1
- /package/packages/safejs/dist/chunks/{chunk-2M5F6OIT.js.map → chunk-WV23C6SS.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5BWI6HAZ.js";
|
|
31
31
|
|
|
32
32
|
// packages/safejs/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8055,4 +8055,4 @@ export {
|
|
|
8055
8055
|
parseMcpConfig,
|
|
8056
8056
|
makeMcpModule
|
|
8057
8057
|
};
|
|
8058
|
-
//# sourceMappingURL=chunk-
|
|
8058
|
+
//# sourceMappingURL=chunk-WV23C6SS.js.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
parseMcpConfig,
|
|
21
21
|
splitFrontmatter,
|
|
22
22
|
withBrokenPipeGuard
|
|
23
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-WV23C6SS.js";
|
|
24
24
|
import {
|
|
25
25
|
Budget,
|
|
26
26
|
SandboxError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
replaceErrorStack,
|
|
33
33
|
restore,
|
|
34
34
|
run
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-5BWI6HAZ.js";
|
|
36
36
|
import "./chunks/chunk-4YIDX44G.js";
|
|
37
37
|
|
|
38
38
|
// packages/safejs/src/cli.ts
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
runWithSpawnUsageAccumulator,
|
|
28
28
|
splitFrontmatter,
|
|
29
29
|
supportsSpawnMode
|
|
30
|
-
} from "./chunks/chunk-
|
|
30
|
+
} from "./chunks/chunk-WV23C6SS.js";
|
|
31
31
|
import {
|
|
32
32
|
Budget,
|
|
33
33
|
FileSnapshotBackend,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
registerPendingHostCallPolicy,
|
|
50
50
|
restore,
|
|
51
51
|
run
|
|
52
|
-
} from "./chunks/chunk-
|
|
52
|
+
} from "./chunks/chunk-5BWI6HAZ.js";
|
|
53
53
|
import "./chunks/chunk-4YIDX44G.js";
|
|
54
54
|
|
|
55
55
|
// packages/safejs/src/runner/run-harness.ts
|
|
@@ -30,7 +30,16 @@ export function createObjectArrayGlobals(options) {
|
|
|
30
30
|
}),
|
|
31
31
|
fromEntries: createSandboxClosure({
|
|
32
32
|
sandbox: true,
|
|
33
|
-
call: ([value]) =>
|
|
33
|
+
call: ([value]) => {
|
|
34
|
+
const iterator = getSandboxIterator(value);
|
|
35
|
+
if (iterator === undefined) {
|
|
36
|
+
throw new TypeError("Object.fromEntries requires an iterable.");
|
|
37
|
+
}
|
|
38
|
+
if (!iterator.generator) {
|
|
39
|
+
return allocateProducedSandboxValue(Object.setPrototypeOf(Reflect.apply(Object.fromEntries, Object, [{ [Symbol.iterator]: () => iterator }]), null), options.budget);
|
|
40
|
+
}
|
|
41
|
+
return objectFromSandboxEntries(iterator, options.budget);
|
|
42
|
+
},
|
|
34
43
|
name: "fromEntries"
|
|
35
44
|
}),
|
|
36
45
|
freeze: createSandboxClosure({
|
|
@@ -151,6 +160,41 @@ export function createObjectArrayGlobals(options) {
|
|
|
151
160
|
})
|
|
152
161
|
};
|
|
153
162
|
}
|
|
163
|
+
async function objectFromSandboxEntries(iterator, budget) {
|
|
164
|
+
const object = Object.create(null);
|
|
165
|
+
try {
|
|
166
|
+
while (true) {
|
|
167
|
+
const result = await iterator.next();
|
|
168
|
+
if ((typeof result !== "object" && typeof result !== "function") || result === null) {
|
|
169
|
+
throw new TypeError("Iterator result must be an object.");
|
|
170
|
+
}
|
|
171
|
+
if (result.done)
|
|
172
|
+
break;
|
|
173
|
+
const entry = result.value;
|
|
174
|
+
if ((typeof entry !== "object" && typeof entry !== "function") || entry === null) {
|
|
175
|
+
throw new TypeError("Object.fromEntries requires entry objects.");
|
|
176
|
+
}
|
|
177
|
+
const key = entry[0];
|
|
178
|
+
const value = entry[1];
|
|
179
|
+
Object.defineProperty(object, key, {
|
|
180
|
+
configurable: true,
|
|
181
|
+
enumerable: true,
|
|
182
|
+
value,
|
|
183
|
+
writable: true
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
try {
|
|
189
|
+
await iterator.return?.();
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
throw error;
|
|
195
|
+
}
|
|
196
|
+
return allocateProducedSandboxValue(object, budget);
|
|
197
|
+
}
|
|
154
198
|
function assignSandboxValues(target, sources) {
|
|
155
199
|
if (target === null || target === undefined) {
|
|
156
200
|
throw new TypeError("Object.assign(target, ...sources) requires a non-null target.");
|
|
File without changes
|