@rulvar/planner 1.24.0 → 1.25.0
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.d.ts +13 -0
- package/dist/index.js +6 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -167,12 +167,25 @@ interface WorkerSandboxRunnerOptions {
|
|
|
167
167
|
* to this module. Tests running from source point at the built dist.
|
|
168
168
|
*/
|
|
169
169
|
workerUrl?: URL;
|
|
170
|
+
/**
|
|
171
|
+
* Node CLI options for the worker thread; default `[]` (an isolated
|
|
172
|
+
* list). Without an explicit value Node would hand the worker
|
|
173
|
+
* `process.execArgv`, and host-only launch flags break a file-entry
|
|
174
|
+
* worker before the first sandbox operation: `--input-type=module`
|
|
175
|
+
* (any ESM stdin or `--eval` host) is rejected for file entries, and
|
|
176
|
+
* an inherited `--eval` carries the host's whole source text (v1.24.1
|
|
177
|
+
* review P2-2). Hosts that need loader, coverage, or instrumentation
|
|
178
|
+
* flags inside the worker opt in explicitly; the list is passed to the
|
|
179
|
+
* worker verbatim.
|
|
180
|
+
*/
|
|
181
|
+
execArgv?: readonly string[];
|
|
170
182
|
}
|
|
171
183
|
/** Accepts CompiledWorkflow ONLY: feeding a closure is a type error. */
|
|
172
184
|
declare class WorkerSandboxRunner implements ScriptRunner {
|
|
173
185
|
private readonly timeoutMs;
|
|
174
186
|
private readonly memoryMb;
|
|
175
187
|
private readonly workerUrl;
|
|
188
|
+
private readonly execArgv;
|
|
176
189
|
constructor(options?: WorkerSandboxRunnerOptions);
|
|
177
190
|
execute<A, R>(wf: CompiledWorkflow, ctx: Ctx<never>, args: A): Promise<R>;
|
|
178
191
|
}
|
package/dist/index.js
CHANGED
|
@@ -275,16 +275,21 @@ var WorkerSandboxRunner = class {
|
|
|
275
275
|
timeoutMs;
|
|
276
276
|
memoryMb;
|
|
277
277
|
workerUrl;
|
|
278
|
+
execArgv;
|
|
278
279
|
constructor(options) {
|
|
279
280
|
this.timeoutMs = options?.timeoutMs ?? 3e5;
|
|
280
281
|
this.memoryMb = options?.memoryMb ?? 512;
|
|
281
282
|
this.workerUrl = options?.workerUrl ?? new URL("./sandbox-worker.js", import.meta.url);
|
|
283
|
+
this.execArgv = [...options?.execArgv ?? []];
|
|
282
284
|
}
|
|
283
285
|
async execute(wf, ctx, args) {
|
|
284
286
|
if (wf.kind !== "compiled-workflow") throw new ConfigError("WorkerSandboxRunner executes CompiledWorkflow values only; closures run in process ");
|
|
285
287
|
const argsJson = toJournalValue(args ?? null, "sandbox workflow args");
|
|
286
288
|
const channel = new MessageChannel();
|
|
287
|
-
const worker = new Worker(this.workerUrl, {
|
|
289
|
+
const worker = new Worker(this.workerUrl, {
|
|
290
|
+
execArgv: [...this.execArgv],
|
|
291
|
+
resourceLimits: { maxOldGenerationSizeMb: this.memoryMb }
|
|
292
|
+
});
|
|
288
293
|
const bridge = createSandboxBridge(ctx, { post: (message) => channel.port1.postMessage(message) });
|
|
289
294
|
return new Promise((resolve, reject) => {
|
|
290
295
|
let settled = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/planner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Rulvar flagship hybrid mode: plan agent, compileScript, WorkerSandboxRunner, self-repair loop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"eslint": "^9.39.4",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"eslint-plugin-rulvar": "1.25.0",
|
|
27
|
+
"@rulvar/core": "1.25.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^22.20.0",
|
|
31
31
|
"tsdown": "^0.22.3",
|
|
32
32
|
"typescript": "~6.0.3",
|
|
33
|
-
"@rulvar/testing": "1.
|
|
33
|
+
"@rulvar/testing": "1.25.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|