poe-code 11.0.28 → 11.0.29
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 +16 -11
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-3OFXSTL2.js → chunk-DB2DNWCX.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-FAAW5HF7.js → chunk-HC3QSP5N.js} +16 -11
- package/packages/safejs/dist/chunks/{chunk-FAAW5HF7.js.map → chunk-HC3QSP5N.js.map} +3 -3
- 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/host-bridge.js +7 -6
- package/packages/safejs/dist/interp/values.d.ts +2 -0
- package/packages/safejs/dist/interp/values.js +2 -2
- /package/packages/safejs/dist/chunks/{chunk-3OFXSTL2.js.map → chunk-DB2DNWCX.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-DB2DNWCX.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-HC3QSP5N.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-DB2DNWCX.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-HC3QSP5N.js";
|
|
53
53
|
import "./chunks/chunk-4YIDX44G.js";
|
|
54
54
|
|
|
55
55
|
// packages/safejs/src/runner/run-harness.ts
|
|
@@ -4,7 +4,7 @@ import { SandboxError } from "./budget.js";
|
|
|
4
4
|
import { createSubsetErrorValue } from "./exceptions.js";
|
|
5
5
|
import { bindOtelSpan, getBoundOtelSpan } from "../observability/otel.js";
|
|
6
6
|
import { digestHostCallArguments, HostCallResumabilityError, UnresolvedReplayCapabilityError } from "./host-call.js";
|
|
7
|
-
import { createSandboxClosure, createSandboxMap, createSandboxPromise, createSandboxSet, deepCopyFromSandbox, deepCopyToSandbox, isSandboxClosure, isSandboxPromise, measureSandboxData } from "./values.js";
|
|
7
|
+
import { createSandboxClosure, createSandboxMap, createSandboxPromise, createSandboxSet, deepCopyFromSandbox, deepCopyToSandbox, defineOwnDataProperty, isArrayIndexKey, isSandboxClosure, isSandboxPromise, measureSandboxData } from "./values.js";
|
|
8
8
|
import { enterRunningState } from "./running-state.js";
|
|
9
9
|
import { promiseReplayContext } from "./promise-replay.js";
|
|
10
10
|
import { hostErrorData, sandboxErrorTypes } from "../error/shape.js";
|
|
@@ -632,14 +632,15 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
632
632
|
const copy = new Array(value.length);
|
|
633
633
|
state.seen.set(value, copy);
|
|
634
634
|
budget.allocateArrayLength(value.length);
|
|
635
|
-
for (
|
|
636
|
-
const
|
|
637
|
-
if (
|
|
635
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
|
|
636
|
+
const indexed = isArrayIndexKey(key);
|
|
637
|
+
if (key === "length" || (!descriptor.enumerable && !indexed))
|
|
638
638
|
continue;
|
|
639
|
+
const entryPath = indexed ? `${path}[${key}]` : joinPath(path, key);
|
|
639
640
|
if (!("value" in descriptor)) {
|
|
640
|
-
throw new TypeError(`Unsupported sandbox value at ${
|
|
641
|
+
throw new TypeError(`Unsupported sandbox value at ${entryPath}: accessor property`);
|
|
641
642
|
}
|
|
642
|
-
copy
|
|
643
|
+
defineOwnDataProperty(copy, indexed ? key : budget.allocateString(key), copyHostValueToSandbox(descriptor.value, stackFrames, { ...options, capabilityPath: [...(options.capabilityPath ?? []), key] }, state, entryPath));
|
|
643
644
|
}
|
|
644
645
|
return copy;
|
|
645
646
|
}
|
|
@@ -126,3 +126,5 @@ export declare function measureSandboxData(values: Iterable<unknown>, options?:
|
|
|
126
126
|
}): number;
|
|
127
127
|
export declare function deepCopyFromSandbox(value: SandboxPromise, options?: CopyFromSandboxOptions): Promise<unknown>;
|
|
128
128
|
export declare function deepCopyFromSandbox(value: SandboxValue, options?: CopyFromSandboxOptions): unknown;
|
|
129
|
+
export declare function defineOwnDataProperty(target: object, key: string, value: unknown): void;
|
|
130
|
+
export declare function isArrayIndexKey(value: string): boolean;
|
|
@@ -548,7 +548,7 @@ function isPlainArray(value) {
|
|
|
548
548
|
function createPlainObject(useNullPrototype) {
|
|
549
549
|
return (useNullPrototype ? Object.create(null) : {});
|
|
550
550
|
}
|
|
551
|
-
function defineOwnDataProperty(target, key, value) {
|
|
551
|
+
export function defineOwnDataProperty(target, key, value) {
|
|
552
552
|
Object.defineProperty(target, key, {
|
|
553
553
|
enumerable: true,
|
|
554
554
|
configurable: true,
|
|
@@ -590,7 +590,7 @@ function getEnumerableArrayEntries(value, path) {
|
|
|
590
590
|
}
|
|
591
591
|
return entries;
|
|
592
592
|
}
|
|
593
|
-
function isArrayIndexKey(value) {
|
|
593
|
+
export function isArrayIndexKey(value) {
|
|
594
594
|
if (value === "") {
|
|
595
595
|
return false;
|
|
596
596
|
}
|
|
File without changes
|