poe-code 11.0.15 → 11.0.17
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 +19 -6
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-RMMJ2USI.js → chunk-COHIMIAF.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-CMWFNRW4.js → chunk-D4DDI3HH.js} +18 -5
- package/packages/safejs/dist/chunks/{chunk-CMWFNRW4.js.map → chunk-D4DDI3HH.js.map} +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/methods/array.js +12 -2
- package/packages/safejs/dist/interp/values.js +8 -3
- /package/packages/safejs/dist/chunks/{chunk-RMMJ2USI.js.map → chunk-COHIMIAF.js.map} +0 -0
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
parseMcpConfig,
|
|
21
21
|
splitFrontmatter,
|
|
22
22
|
withBrokenPipeGuard
|
|
23
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-COHIMIAF.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-D4DDI3HH.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-COHIMIAF.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-D4DDI3HH.js";
|
|
53
53
|
import "./chunks/chunk-4YIDX44G.js";
|
|
54
54
|
|
|
55
55
|
// packages/safejs/src/runner/run-harness.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSandboxClosure, isSandboxClosure, isSandboxMap, isSandboxPromise, isSandboxSet } from "../values.js";
|
|
2
2
|
import { assertCollectionMutable, enterCollectionCallback } from "../running-state.js";
|
|
3
|
+
const activeArrayCallbacks = new WeakMap();
|
|
3
4
|
const arrayMethodNames = new Set([
|
|
4
5
|
"map",
|
|
5
6
|
"filter",
|
|
@@ -73,12 +74,21 @@ export async function callArrayMethod(value, methodName, args, options, stack =
|
|
|
73
74
|
assertCollectionMutable(value);
|
|
74
75
|
}
|
|
75
76
|
if (isCallbackArrayMethod(methodName)) {
|
|
76
|
-
|
|
77
|
+
let callbackState = activeArrayCallbacks.get(value);
|
|
78
|
+
if (callbackState === undefined) {
|
|
79
|
+
callbackState = { depth: 0, leave: enterCollectionCallback(value) };
|
|
80
|
+
activeArrayCallbacks.set(value, callbackState);
|
|
81
|
+
}
|
|
82
|
+
callbackState.depth += 1;
|
|
77
83
|
try {
|
|
78
84
|
return await callArrayMethodUnlocked(value, methodName, args, options, stack);
|
|
79
85
|
}
|
|
80
86
|
finally {
|
|
81
|
-
|
|
87
|
+
callbackState.depth -= 1;
|
|
88
|
+
if (callbackState.depth === 0) {
|
|
89
|
+
activeArrayCallbacks.delete(value);
|
|
90
|
+
callbackState.leave();
|
|
91
|
+
}
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
94
|
return callArrayMethodUnlocked(value, methodName, args, options, stack);
|
|
@@ -200,8 +200,11 @@ export function measureSandboxData(values, options = {}) {
|
|
|
200
200
|
usage += 1;
|
|
201
201
|
if (Array.isArray(value)) {
|
|
202
202
|
usage += value.length;
|
|
203
|
-
for (
|
|
204
|
-
|
|
203
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
204
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, index);
|
|
205
|
+
if (descriptor !== undefined && "value" in descriptor)
|
|
206
|
+
visit(descriptor.value);
|
|
207
|
+
}
|
|
205
208
|
return;
|
|
206
209
|
}
|
|
207
210
|
if (isSandboxMap(value)) {
|
|
@@ -243,7 +246,9 @@ export function measureSandboxData(values, options = {}) {
|
|
|
243
246
|
}
|
|
244
247
|
const entries = isSandboxArguments(value)
|
|
245
248
|
? getSandboxArgumentEntries(value)
|
|
246
|
-
: Object.entries(value)
|
|
249
|
+
: Object.entries(Object.getOwnPropertyDescriptors(value))
|
|
250
|
+
.filter(([, descriptor]) => descriptor.enumerable)
|
|
251
|
+
.map(([key, descriptor]) => [key, "value" in descriptor ? descriptor.value : undefined]);
|
|
247
252
|
usage += entries.length;
|
|
248
253
|
for (const [key, entry] of entries) {
|
|
249
254
|
usage += key.length;
|
|
File without changes
|