@poe-platform/safe-js 0.1.805 → 0.1.807
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 +17 -1
- package/dist/agent-harness-tools/execution-env.d.ts +1 -1
- package/dist/agent-harness-tools/harness-dashboard.d.ts +2 -1
- package/dist/agent-harness-tools/poe-command-execution.d.ts +5 -3
- package/dist/agent-harness-tools/runner.d.ts +1 -1
- package/dist/agent-harness-tools/workspace-transfer.d.ts +2 -2
- package/dist/poe-acp-client/acp-transport.d.ts +1 -1
- package/dist/poe-code-config/memory.d.ts +1 -0
- package/dist/poe-code-config/runtime.d.ts +5 -2
- package/dist/process-runner/types.d.ts +1 -1
- package/dist/process-runner/workspace-transfer.d.ts +6 -5
- package/dist/safe-js/chunks/{chunk-KMBCLXER.js → chunk-2IYZK337.js} +1 -1
- package/dist/safe-js/chunks/{chunk-WNCT5WTP.js → chunk-3W4JJFK6.js} +1 -1
- package/dist/safe-js/chunks/{chunk-GJPD4ALZ.js → chunk-425IYA26.js} +1 -1
- package/dist/safe-js/chunks/{chunk-2LI4AP6C.js → chunk-5FPEN6AM.js} +8 -7
- package/dist/safe-js/chunks/{chunk-NOS76GMS.js → chunk-5ZVTZBH2.js} +1 -1
- package/dist/safe-js/chunks/{chunk-N3EL5B4L.js → chunk-7RGEML7S.js} +5 -4
- package/dist/safe-js/chunks/{chunk-VQKUOXQ2.js → chunk-BEA7FA5M.js} +9 -2
- package/dist/safe-js/chunks/{chunk-WZ27FAD3.js → chunk-C5NG3LHQ.js} +3 -3
- package/dist/safe-js/chunks/{chunk-HFCSCNZN.js → chunk-E7V44LSN.js} +54 -47
- package/dist/safe-js/chunks/{chunk-VVOPJZRG.js → chunk-H25SH6HQ.js} +3 -1
- package/dist/safe-js/chunks/{chunk-AN6Z3R6M.js → chunk-MJH5AYEK.js} +1 -1
- package/dist/safe-js/chunks/{chunk-JQ5QJV5Q.js → chunk-P5Y4UF4L.js} +2 -2
- package/dist/safe-js/chunks/{chunk-JVE54EBX.js → chunk-ROIZEQTS.js} +7 -4
- package/dist/safe-js/chunks/{chunk-HR3HSM26.js → chunk-SAYUBVHD.js} +2 -2
- package/dist/safe-js/chunks/{chunk-IRCZI6HL.js → chunk-SV37HEM5.js} +4 -4
- package/dist/safe-js/chunks/{chunk-RPGCF4KE.js → chunk-TG7TRXYG.js} +49 -2
- package/dist/safe-js/chunks/{chunk-ECMGBHAB.js → chunk-XQOJJA4C.js} +11 -65
- package/dist/safe-js/chunks/{cli-runtime-6EBUM6AL.js → cli-runtime-EV4DQ7UW.js} +16 -16
- package/dist/safe-js/chunks/{dump-S6HOPYA6.js → dump-OX7M4C56.js} +3 -3
- package/dist/safe-js/chunks/{harness-GQGDTZ5P.js → harness-4BETCNJY.js} +3 -3
- package/dist/safe-js/chunks/mcp-DSJET2K4.js +12 -0
- package/dist/safe-js/chunks/{migration-file-BJVZMCID.js → migration-file-6LFFQLZN.js} +5 -5
- package/dist/safe-js/chunks/{restore-GU6CISV6.js → restore-BFVCW6H4.js} +4 -4
- package/dist/safe-js/chunks/{run-STNASYDW.js → run-PWX3SVTF.js} +7 -7
- package/dist/safe-js/chunks/{runtime-modules-5MQCTIB5.js → runtime-modules-UOVJSSD7.js} +3 -3
- package/dist/safe-js/chunks/{source-files-A2WSOO6G.js → source-files-QT24SQTE.js} +3 -3
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.d.ts +3 -0
- package/dist/safe-js/core.js +19 -13
- package/dist/safe-js/host-context.d.ts +5 -0
- package/dist/safe-js/index.d.ts +1 -0
- package/dist/safe-js/index.js +22 -20
- package/dist/safe-js/interp/host-bridge.d.ts +2 -0
- package/dist/safe-js/interp/resources.d.ts +23 -0
- package/dist/safe-js/modules/fs-config.d.ts +1 -1
- package/dist/safe-js/modules/fs.js +4 -4
- package/dist/safe-js/modules/mcp-transport.d.ts +1 -1
- package/dist/safe-js/modules/registry.d.ts +2 -0
- package/dist/safe-js/platform/context.js +19 -8
- package/dist/safe-js/platform/node.d.ts +1 -0
- package/dist/safe-js/platform/node.js +1 -0
- package/dist/safe-js/platform/workerd.d.ts +1 -0
- package/dist/safe-js/platform/workerd.js +1 -0
- package/dist/safe-js/portable/chunks/{chunk-W6MZOTYR.js → chunk-LCUQNFD2.js} +17 -7
- package/dist/safe-js/portable/chunks/{chunk-NLGXLZCK.js → chunk-MKRVEJD6.js} +1 -1
- package/dist/safe-js/portable/chunks/{chunk-OCBLPMJE.js → chunk-OCBYWLKS.js} +7 -4
- package/dist/safe-js/portable/chunks/{source-files-AEDWESAJ.js → source-files-HMG6KJLP.js} +2 -2
- package/dist/safe-js/portable/core.js +56 -4
- package/dist/safe-js/portable/modules/fs.js +2 -2
- package/dist/safe-js/workerd.d.ts +1 -2
- package/dist/safe-js/workerd.js +11645 -831
- package/package.json +2 -2
- package/dist/safe-js/chunks/mcp-MILSUBPS.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FileSystemAdapterRegistry, type FileSystemConfig } from "@poe-platform/safe-fs";
|
|
1
|
+
import { type FileSystemAdapterRegistry, type FileSystemConfig } from "@poe-platform/safe-fs/core";
|
|
2
2
|
import type { FsModuleOptions } from "./fs.js";
|
|
3
3
|
export type FsConfig = {
|
|
4
4
|
readonly adapter: FileSystemConfig;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FS_OPTION_SURFACE,
|
|
3
3
|
makeFsModule
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-C5NG3LHQ.js";
|
|
5
5
|
import "../chunks/chunk-DIG26TEI.js";
|
|
6
6
|
import "../chunks/chunk-ONWFPHUI.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-ROIZEQTS.js";
|
|
8
8
|
import "../chunks/chunk-EQUBWQJN.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-2IYZK337.js";
|
|
10
|
+
import "../chunks/chunk-H25SH6HQ.js";
|
|
11
11
|
import "../chunks/chunk-CQ52GEHY.js";
|
|
12
12
|
export {
|
|
13
13
|
FS_OPTION_SURFACE,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChildProcessWithoutNullStreams, SpawnOptions } from "node:child_process";
|
|
2
2
|
import type { McpConnection } from "./mcp.js";
|
|
3
3
|
export type McpServerConfig = {
|
|
4
4
|
command: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RunResources } from "../interp/resources.js";
|
|
1
2
|
import type { Budget, CompileOwner } from "../interp/budget.js";
|
|
2
3
|
import type { HostCallJournal } from "../interp/host-call.js";
|
|
3
4
|
import { type RealmBridge, type CallerInjectedBinding } from "../interp/host-bridge.js";
|
|
@@ -11,6 +12,7 @@ export type ModuleEnvironment = {
|
|
|
11
12
|
namespaces: Record<string, SandboxValue>;
|
|
12
13
|
};
|
|
13
14
|
export type ModuleEnvironmentOptions = {
|
|
15
|
+
resources?: RunResources;
|
|
14
16
|
budget: Budget;
|
|
15
17
|
realm?: RealmBridge;
|
|
16
18
|
wrappedModules?: Map<string, Record<string, SandboxValue>>;
|
|
@@ -33,25 +33,36 @@ export class StackContext {
|
|
|
33
33
|
}
|
|
34
34
|
disable() { this.value = undefined; this.generation++; }
|
|
35
35
|
static snapshot() {
|
|
36
|
-
const values =
|
|
36
|
+
const values = new Map();
|
|
37
37
|
for (const reference of StackContext.stores) {
|
|
38
38
|
const store = reference.deref();
|
|
39
39
|
if (store === undefined)
|
|
40
40
|
StackContext.stores.delete(reference);
|
|
41
41
|
else
|
|
42
|
-
values.
|
|
42
|
+
values.set(store, [store.value, store.generation]);
|
|
43
43
|
}
|
|
44
44
|
return callback => {
|
|
45
|
-
const restore =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const restore = [];
|
|
46
|
+
// A later-created execution must not leak its ambient context into an
|
|
47
|
+
// earlier continuation. Save and clear every live store, not only those
|
|
48
|
+
// that existed when the continuation was captured.
|
|
49
|
+
for (const reference of StackContext.stores) {
|
|
50
|
+
const store = reference.deref();
|
|
51
|
+
if (store === undefined) {
|
|
52
|
+
StackContext.stores.delete(reference);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
restore.push([store, store.value, store.generation]);
|
|
56
|
+
const captured = values.get(store);
|
|
57
|
+
store.value = captured?.[1] === store.generation ? captured[0] : undefined;
|
|
58
|
+
}
|
|
49
59
|
try {
|
|
50
60
|
return callback();
|
|
51
61
|
}
|
|
52
62
|
finally {
|
|
53
|
-
|
|
54
|
-
store.
|
|
63
|
+
for (const [store, value, generation] of restore)
|
|
64
|
+
if (store.generation === generation)
|
|
65
|
+
store.value = value;
|
|
55
66
|
}
|
|
56
67
|
};
|
|
57
68
|
}
|
|
@@ -15,3 +15,4 @@ export declare const hostFs: typeof nativeFsPromises;
|
|
|
15
15
|
export declare const hostCwd: () => string;
|
|
16
16
|
export declare const hostPlatform: NodeJS.Platform;
|
|
17
17
|
export declare const hostEnv: () => Readonly<Record<string, string | undefined>>;
|
|
18
|
+
export { createNodeFileSystemAdapterRegistry as createFileSystemAdapterRegistry } from "@poe-platform/safe-fs";
|
|
@@ -63,3 +63,4 @@ export const hostFs = nativeFsPromises;
|
|
|
63
63
|
export const hostCwd = process.cwd.bind(process);
|
|
64
64
|
export const hostPlatform = process.platform;
|
|
65
65
|
export const hostEnv = () => process.env;
|
|
66
|
+
export { createNodeFileSystemAdapterRegistry as createFileSystemAdapterRegistry } from "@poe-platform/safe-fs";
|
|
@@ -20,3 +20,4 @@ export declare const hostFs: import("@poe-platform/safe-fs/core").FsBridge;
|
|
|
20
20
|
export declare function inspect(value: unknown, _options?: {
|
|
21
21
|
depth?: number;
|
|
22
22
|
}): string;
|
|
23
|
+
export { createPortableFileSystemAdapterRegistry as createFileSystemAdapterRegistry } from "@poe-platform/safe-fs/core";
|
|
@@ -743,21 +743,29 @@ var StackContext = class _StackContext {
|
|
|
743
743
|
this.generation++;
|
|
744
744
|
}
|
|
745
745
|
static snapshot() {
|
|
746
|
-
const values =
|
|
746
|
+
const values = /* @__PURE__ */ new Map();
|
|
747
747
|
for (const reference of _StackContext.stores) {
|
|
748
748
|
const store = reference.deref();
|
|
749
749
|
if (store === void 0) _StackContext.stores.delete(reference);
|
|
750
|
-
else values.
|
|
750
|
+
else values.set(store, [store.value, store.generation]);
|
|
751
751
|
}
|
|
752
752
|
return (callback) => {
|
|
753
|
-
const restore =
|
|
754
|
-
for (const
|
|
753
|
+
const restore = [];
|
|
754
|
+
for (const reference of _StackContext.stores) {
|
|
755
|
+
const store = reference.deref();
|
|
756
|
+
if (store === void 0) {
|
|
757
|
+
_StackContext.stores.delete(reference);
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
restore.push([store, store.value, store.generation]);
|
|
761
|
+
const captured = values.get(store);
|
|
762
|
+
store.value = captured?.[1] === store.generation ? captured[0] : void 0;
|
|
763
|
+
}
|
|
755
764
|
try {
|
|
756
765
|
return callback();
|
|
757
766
|
} finally {
|
|
758
|
-
|
|
759
|
-
if (store.generation === generation) store.value =
|
|
760
|
-
});
|
|
767
|
+
for (const [store, value, generation] of restore)
|
|
768
|
+
if (store.generation === generation) store.value = value;
|
|
761
769
|
}
|
|
762
770
|
};
|
|
763
771
|
}
|
|
@@ -824,6 +832,7 @@ var types = {
|
|
|
824
832
|
};
|
|
825
833
|
|
|
826
834
|
// packages/safe-js/src/platform/workerd.ts
|
|
835
|
+
import { createPortableFileSystemAdapterRegistry } from "@poe-platform/safe-fs/core";
|
|
827
836
|
var AsyncLocalStorage = Reflect.get(globalThis, "AsyncLocalStorage") ?? StackContext;
|
|
828
837
|
var cloneSharedBufferWrapper = structuredClone;
|
|
829
838
|
function createHostCallbackContext() {
|
|
@@ -901,6 +910,7 @@ export {
|
|
|
901
910
|
fsConstants,
|
|
902
911
|
hostFs,
|
|
903
912
|
inspect,
|
|
913
|
+
createPortableFileSystemAdapterRegistry,
|
|
904
914
|
basename,
|
|
905
915
|
dirname,
|
|
906
916
|
isAbsolutePath,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
templateRealms,
|
|
34
34
|
types,
|
|
35
35
|
yieldToHost
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LCUQNFD2.js";
|
|
37
37
|
|
|
38
38
|
// packages/safe-js/src/modules/fs.ts
|
|
39
39
|
import { createFsBridge } from "@poe-platform/safe-fs/core";
|
|
@@ -28782,7 +28782,7 @@ function createModuleEnvironment(modules, options, restored) {
|
|
|
28782
28782
|
namespaces: createBindingRecord(Object.fromEntries(options.wrappedModules ?? []))
|
|
28783
28783
|
};
|
|
28784
28784
|
revokeImmutableEmptyModuleEnvironment(environment);
|
|
28785
|
-
moduleEnvironments.set(environment, { registry, options, prepared: /* @__PURE__ */ new Set(), capabilities: /* @__PURE__ */ new Map() });
|
|
28785
|
+
moduleEnvironments.set(environment, { registry, options, resources: options.resources ?? runResources.getStore(), prepared: /* @__PURE__ */ new Set(), capabilities: /* @__PURE__ */ new Map() });
|
|
28786
28786
|
return environment;
|
|
28787
28787
|
}
|
|
28788
28788
|
function createImmutableEmptyModuleEnvironment(options) {
|
|
@@ -28815,6 +28815,7 @@ function resolveModuleNamespace(environment, moduleName, prepare = true) {
|
|
|
28815
28815
|
if (exports === void 0) throw new Error(createUnknownModuleMessage(moduleName, [...backend.registry.keys()]));
|
|
28816
28816
|
let namespace = createModuleNamespace(wrapCancelableBindings(
|
|
28817
28817
|
wrapCallerInjectedBindings(Object.fromEntries(exports), {
|
|
28818
|
+
resources: backend.resources,
|
|
28818
28819
|
realm: options.realm,
|
|
28819
28820
|
budget: options.budget,
|
|
28820
28821
|
compileOwner: options.compileOwner,
|
|
@@ -56560,7 +56561,7 @@ function readHostOperationPolicy(operation) {
|
|
|
56560
56561
|
}
|
|
56561
56562
|
function wrapCallerInjectedBindings(bindings, options) {
|
|
56562
56563
|
const operation = options.budget.acquireCompileOwner(false, options.compileOwner);
|
|
56563
|
-
options = { ...options, registerCapabilities: true, compileOwner: operation.owner };
|
|
56564
|
+
options = { ...options, resources: options.resources ?? runResources.getStore(), registerCapabilities: true, compileOwner: operation.owner };
|
|
56564
56565
|
try {
|
|
56565
56566
|
const state = { seen: /* @__PURE__ */ new WeakMap() };
|
|
56566
56567
|
const copied = Object.fromEntries(
|
|
@@ -56711,10 +56712,12 @@ function wrapCallerInjectedFunction(name, value, options, state, validateResult)
|
|
|
56711
56712
|
const captured = options.realm?.captureArguments(callable, args, copyArguments);
|
|
56712
56713
|
const hostArgs = captured?.args ?? copyArguments(args);
|
|
56713
56714
|
const budgetedOperation = budgetedHostOperations.get(callable);
|
|
56714
|
-
const
|
|
56715
|
+
const invokeOperation = () => {
|
|
56715
56716
|
const result2 = budgetedOperation === void 0 ? Reflect.apply(callable, void 0, hostArgs) : budgetedOperation(hostArgs, options.budget);
|
|
56716
56717
|
return validateResult === void 0 ? result2 : validateResult(result2);
|
|
56717
56718
|
};
|
|
56719
|
+
const resources = options.resources;
|
|
56720
|
+
const callOperation = resources === void 0 ? invokeOperation : () => runResources.run(resources, invokeOperation);
|
|
56718
56721
|
const hostCalls = options.hostCalls;
|
|
56719
56722
|
const operation = options.operation ?? bindingName;
|
|
56720
56723
|
const moduleId = options.moduleId ?? "<bindings>";
|
|
@@ -119,16 +119,17 @@ import {
|
|
|
119
119
|
wrapCallerInjectedBindings,
|
|
120
120
|
wrapCancelableBindings,
|
|
121
121
|
wrapHostConstructor
|
|
122
|
-
} from "./chunks/chunk-
|
|
122
|
+
} from "./chunks/chunk-OCBYWLKS.js";
|
|
123
123
|
import {
|
|
124
124
|
createRootedSourceResolver
|
|
125
|
-
} from "./chunks/chunk-
|
|
125
|
+
} from "./chunks/chunk-MKRVEJD6.js";
|
|
126
126
|
import {
|
|
127
127
|
AsyncLocalStorage,
|
|
128
128
|
Budget,
|
|
129
129
|
SandboxError,
|
|
130
130
|
attachErrorSpan,
|
|
131
131
|
createHostCallbackContext,
|
|
132
|
+
createPortableFileSystemAdapterRegistry,
|
|
132
133
|
describeThrownValue,
|
|
133
134
|
dirname,
|
|
134
135
|
hostEnv,
|
|
@@ -137,7 +138,7 @@ import {
|
|
|
137
138
|
materializeWrappedErrorCause,
|
|
138
139
|
replaceErrorStack,
|
|
139
140
|
types
|
|
140
|
-
} from "./chunks/chunk-
|
|
141
|
+
} from "./chunks/chunk-LCUQNFD2.js";
|
|
141
142
|
|
|
142
143
|
// packages/safe-js/src/parse/hash.ts
|
|
143
144
|
var FNV_OFFSET_BASIS = 2166136261;
|
|
@@ -383,6 +384,9 @@ function restore(snapshot, options, owner) {
|
|
|
383
384
|
// packages/safe-js/src/parse.ts
|
|
384
385
|
var parse2 = parse;
|
|
385
386
|
|
|
387
|
+
// packages/safe-js/src/host-context.ts
|
|
388
|
+
var captureHostContext = AsyncLocalStorage.snapshot;
|
|
389
|
+
|
|
386
390
|
// packages/safe-js/src/lint/rules/AS001.ts
|
|
387
391
|
function AS001(source, options = {}) {
|
|
388
392
|
return new AS001Scanner(source, options.filename ?? "<input>").scan();
|
|
@@ -12215,6 +12219,7 @@ var RealmState = class {
|
|
|
12215
12219
|
nestedDepth = 0;
|
|
12216
12220
|
failure;
|
|
12217
12221
|
bridgeOptions = () => ({
|
|
12222
|
+
resources: this.resources,
|
|
12218
12223
|
budget: this.budget,
|
|
12219
12224
|
compileOwner: this.lease.owner,
|
|
12220
12225
|
signal: this.controller.signal,
|
|
@@ -13928,7 +13933,7 @@ function run(source, options = {}) {
|
|
|
13928
13933
|
throw new TypeError("Source resolution requires sourceType: 'module'.");
|
|
13929
13934
|
if (options.sourceRoot !== void 0) {
|
|
13930
13935
|
if (options.sourceResolver !== void 0) throw new TypeError("Specify sourceRoot or sourceResolver, not both.");
|
|
13931
|
-
const { createRootedSourceResolver: createRootedSourceResolver2 } = await import("./chunks/source-files-
|
|
13936
|
+
const { createRootedSourceResolver: createRootedSourceResolver2 } = await import("./chunks/source-files-HMG6KJLP.js");
|
|
13932
13937
|
const { sourceRoot, ...resolved } = options;
|
|
13933
13938
|
const sourceResolver = await createRootedSourceResolver2(sourceRoot);
|
|
13934
13939
|
return runWithExtensions(source, { ...resolved, filename: await sourceResolver.entryId(options.filename), sourceResolver }, jobs);
|
|
@@ -14943,6 +14948,50 @@ function toJsonValue(value, seen) {
|
|
|
14943
14948
|
return String(value);
|
|
14944
14949
|
}
|
|
14945
14950
|
|
|
14951
|
+
// packages/safe-js/src/modules/fs-config.ts
|
|
14952
|
+
import {
|
|
14953
|
+
createFileSystem,
|
|
14954
|
+
readConfigRecord,
|
|
14955
|
+
validateFileSystemConfig
|
|
14956
|
+
} from "@poe-platform/safe-fs/core";
|
|
14957
|
+
function validateFsConfig(value) {
|
|
14958
|
+
const config = readConfigRecord(value, "fs config", ["adapter", "root", "cwd", "readFileMaxBytes", "hostReadMemoryLimit", "maxSymlinkFollows"]);
|
|
14959
|
+
const paths = {};
|
|
14960
|
+
for (const key of ["root", "cwd"]) {
|
|
14961
|
+
const path = config[key];
|
|
14962
|
+
if (path === void 0) continue;
|
|
14963
|
+
if (typeof path !== "string" || !path.startsWith("/") || path.includes("\0")) {
|
|
14964
|
+
throw new TypeError(`${key} must be an absolute virtual path`);
|
|
14965
|
+
}
|
|
14966
|
+
paths[key] = path;
|
|
14967
|
+
}
|
|
14968
|
+
const limits = {};
|
|
14969
|
+
for (const key of ["readFileMaxBytes", "hostReadMemoryLimit", "maxSymlinkFollows"]) {
|
|
14970
|
+
const value2 = config[key];
|
|
14971
|
+
if (value2 === void 0) continue;
|
|
14972
|
+
if (value2 !== Infinity && (typeof value2 !== "number" || !Number.isSafeInteger(value2) || value2 < 0))
|
|
14973
|
+
throw new TypeError(`${key} must be a non-negative safe integer or Infinity`);
|
|
14974
|
+
Object.assign(limits, { [key]: value2 });
|
|
14975
|
+
}
|
|
14976
|
+
return {
|
|
14977
|
+
adapter: validateFileSystemConfig(config.adapter),
|
|
14978
|
+
...paths,
|
|
14979
|
+
...limits
|
|
14980
|
+
};
|
|
14981
|
+
}
|
|
14982
|
+
function parseFsConfig(json) {
|
|
14983
|
+
return validateFsConfig(JSON.parse(json));
|
|
14984
|
+
}
|
|
14985
|
+
async function resolveFsConfig(config, options = {}) {
|
|
14986
|
+
const { adapter: adapterConfig, ...paths } = validateFsConfig(config);
|
|
14987
|
+
const resolution = readConfigRecord(options, "fs resolution option", ["registry"]);
|
|
14988
|
+
const registry = createPortableFileSystemAdapterRegistry(
|
|
14989
|
+
resolution.registry
|
|
14990
|
+
);
|
|
14991
|
+
const adapter = await createFileSystem(adapterConfig, { registry });
|
|
14992
|
+
return { adapter, ...paths };
|
|
14993
|
+
}
|
|
14994
|
+
|
|
14946
14995
|
// packages/safe-js/src/core.ts
|
|
14947
14996
|
var parseModule2 = parseModule;
|
|
14948
14997
|
var parseSourceModule2 = parseSourceModule;
|
|
@@ -14956,6 +15005,7 @@ export {
|
|
|
14956
15005
|
SandboxError,
|
|
14957
15006
|
SnapshotValidationError,
|
|
14958
15007
|
admitNativePromiseProperties,
|
|
15008
|
+
captureHostContext,
|
|
14959
15009
|
createRealm,
|
|
14960
15010
|
createReplayableRandom,
|
|
14961
15011
|
createRootedSourceResolver,
|
|
@@ -14974,8 +15024,10 @@ export {
|
|
|
14974
15024
|
makeTimeModule,
|
|
14975
15025
|
parse2 as parse,
|
|
14976
15026
|
parseEnvConfig,
|
|
15027
|
+
parseFsConfig,
|
|
14977
15028
|
parseModule2 as parseModule,
|
|
14978
15029
|
parseSourceModule2 as parseSourceModule,
|
|
15030
|
+
resolveFsConfig,
|
|
14979
15031
|
restore2 as restore,
|
|
14980
15032
|
run
|
|
14981
15033
|
};
|