@e4779/pi-fabric 0.92.17-fork.3 → 0.92.24-fork.4
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/agents/budget-ledger.d.ts.map +1 -1
- package/dist/agents/handoff-continuation.d.ts +4 -0
- package/dist/agents/handoff-continuation.d.ts.map +1 -0
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents.js +3 -3
- package/dist/chunks/{chunk-GXNR6NRU.js → chunk-2IAVP4O2.js} +2 -2
- package/dist/chunks/{chunk-2UQV52II.js → chunk-3CPWRPCE.js} +6 -6
- package/dist/chunks/{chunk-YK5AZ7CZ.js → chunk-3ZX76BVU.js} +3 -3
- package/dist/chunks/{chunk-PH7ZJ27F.js → chunk-7OH6DD3S.js} +210 -118
- package/dist/chunks/chunk-7OH6DD3S.js.map +7 -0
- package/dist/chunks/chunk-EDL4JDW7.js +184 -0
- package/dist/chunks/chunk-EDL4JDW7.js.map +7 -0
- package/dist/chunks/{chunk-RNOPHITP.js → chunk-H6DDV6E2.js} +180 -24
- package/dist/chunks/chunk-H6DDV6E2.js.map +7 -0
- package/dist/chunks/{chunk-ARLYAW2A.js → chunk-IR3PIHJM.js} +2 -1
- package/dist/chunks/chunk-IR3PIHJM.js.map +7 -0
- package/dist/chunks/{chunk-VRZNFNPB.js → chunk-IYQ5MNCW.js} +20 -17
- package/dist/chunks/chunk-IYQ5MNCW.js.map +7 -0
- package/dist/chunks/{chunk-CPSW2GW4.js → chunk-KFZYTGF5.js} +5 -5
- package/dist/chunks/{chunk-U6CTHPZC.js → chunk-MQG5QKGI.js} +2 -2
- package/dist/chunks/{chunk-CI56CW53.js → chunk-NPHCGLGH.js} +16 -10
- package/dist/chunks/chunk-NPHCGLGH.js.map +7 -0
- package/dist/chunks/{chunk-2DMJ7MEI.js → chunk-QX3TUAWO.js} +172 -141
- package/dist/chunks/chunk-QX3TUAWO.js.map +7 -0
- package/dist/chunks/chunk-RAO6TQFP.js +187 -0
- package/dist/chunks/chunk-RAO6TQFP.js.map +7 -0
- package/dist/chunks/{chunk-ZZ4LHQYJ.js → chunk-RTXZHKMS.js} +22 -13
- package/dist/chunks/chunk-RTXZHKMS.js.map +7 -0
- package/dist/chunks/{chunk-656HWVFU.js → chunk-SZUXWOO7.js} +5 -3
- package/dist/chunks/chunk-SZUXWOO7.js.map +7 -0
- package/dist/chunks/{chunk-UDFDF7IY.js → chunk-VWSXAEX6.js} +143 -54
- package/dist/chunks/chunk-VWSXAEX6.js.map +7 -0
- package/dist/chunks/{chunk-TPLMVELH.js → chunk-VYXFSUWU.js} +4 -4
- package/dist/chunks/{chunk-UTR3I23Z.js → chunk-W63E3WEO.js} +2 -2
- package/dist/chunks/{chunk-3MEHEH6B.js → chunk-X3OD47CL.js} +12 -2
- package/dist/chunks/chunk-X3OD47CL.js.map +7 -0
- package/dist/chunks/{chunk-OP2KTYQB.js → chunk-ZMIJ6AT4.js} +4 -4
- package/dist/compaction/hook.js +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.js +2 -2
- package/dist/core/auto-approval-classifier.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +7 -1
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/entropy/compiler.d.ts +8 -0
- package/dist/entropy/compiler.d.ts.map +1 -1
- package/dist/entropy/index.js +9 -1
- package/dist/entropy/meter.d.ts +10 -0
- package/dist/entropy/meter.d.ts.map +1 -1
- package/dist/entropy/pool.d.ts +5 -0
- package/dist/entropy/pool.d.ts.map +1 -1
- package/dist/entropy/sessions.d.ts +12 -1
- package/dist/entropy/sessions.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +30 -22
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -38
- package/dist/index.js.map +3 -3
- package/dist/jev/browser.js +2 -2
- package/dist/jev/config.d.ts +2 -0
- package/dist/jev/config.d.ts.map +1 -1
- package/dist/jev/model-key.d.ts +6 -0
- package/dist/jev/model-key.d.ts.map +1 -0
- package/dist/jev/observation.js +2 -2
- package/dist/jev.js +7 -7
- package/dist/memory/file-worker.d.ts +15 -0
- package/dist/memory/file-worker.d.ts.map +1 -0
- package/dist/memory/file-worker.js +44 -0
- package/dist/memory/file-worker.js.map +7 -0
- package/dist/memory/worker-provider.d.ts +24 -0
- package/dist/memory/worker-provider.d.ts.map +1 -0
- package/dist/memory/worker-provider.js +18 -0
- package/dist/memory/worker-provider.js.map +7 -0
- package/dist/output-budget.d.ts.map +1 -1
- package/dist/prewalk/arm.d.ts.map +1 -1
- package/dist/prewalk/handoff.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +6 -6
- package/dist/residency/host.js +9 -8
- package/dist/residency/pi-entry.js +9 -8
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/runtime/monty-runtime.js +3 -2
- package/dist/runtime/monty-runtime.js.map +1 -1
- package/dist/runtime/typescript-kernel.js +6 -6
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/speculation/stream-tap.d.ts.map +1 -1
- package/dist/storage/retention.d.ts +3 -1
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/storage/scratch.d.ts +33 -0
- package/dist/storage/scratch.d.ts.map +1 -0
- package/dist/ui/code-preview-shell.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +2 -2
- package/dist/ui/conversation-native-reader.js +4 -2
- package/dist/ui/conversation-native-reader.js.map +2 -2
- package/dist/ui/conversation.js +3 -3
- package/dist/ui/dashboard-presentation.d.ts.map +1 -1
- package/dist/ui/dashboard.js +13 -9
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/fabric-code-parser.d.ts.map +1 -1
- package/dist/ui/format.d.ts +1 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/settings-rpc.d.ts.map +1 -1
- package/dist/ui/settings-sections-execution.d.ts.map +1 -1
- package/dist/ui/settings-submenus.d.ts +12 -4
- package/dist/ui/settings-submenus.d.ts.map +1 -1
- package/dist/ui/settings.js +78 -31
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shiki-catalog.d.ts +3 -0
- package/dist/ui/shiki-catalog.d.ts.map +1 -0
- package/dist/ui/structured.d.ts.map +1 -1
- package/dist/ui/tool-call-timing.d.ts.map +1 -1
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/worker/model-control.d.ts.map +1 -1
- package/dist/worker/model-control.js +0 -1
- package/dist/worker/model-control.js.map +2 -2
- package/dist/worker.js +3 -9
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +7 -3
- package/docs/configuration.md +19 -7
- package/docs/entropy.md +17 -1
- package/docs/jev.md +2 -2
- package/docs/memory-recall.md +21 -0
- package/package.json +5 -2
- package/skillsets/python/fabric-exec/references/agents.md +2 -0
- package/skillsets/python/fabric-jev/SKILL.md +1 -1
- package/skillsets/typescript/fabric-exec/references/agents.md +2 -0
- package/skillsets/typescript/fabric-jev/SKILL.md +1 -1
- package/dist/chunks/chunk-2DMJ7MEI.js.map +0 -7
- package/dist/chunks/chunk-3MEHEH6B.js.map +0 -7
- package/dist/chunks/chunk-656HWVFU.js.map +0 -7
- package/dist/chunks/chunk-ARLYAW2A.js.map +0 -7
- package/dist/chunks/chunk-CI56CW53.js.map +0 -7
- package/dist/chunks/chunk-PH7ZJ27F.js.map +0 -7
- package/dist/chunks/chunk-RNOPHITP.js.map +0 -7
- package/dist/chunks/chunk-UDFDF7IY.js.map +0 -7
- package/dist/chunks/chunk-VRZNFNPB.js.map +0 -7
- package/dist/chunks/chunk-ZZ4LHQYJ.js.map +0 -7
- /package/dist/chunks/{chunk-GXNR6NRU.js.map → chunk-2IAVP4O2.js.map} +0 -0
- /package/dist/chunks/{chunk-2UQV52II.js.map → chunk-3CPWRPCE.js.map} +0 -0
- /package/dist/chunks/{chunk-YK5AZ7CZ.js.map → chunk-3ZX76BVU.js.map} +0 -0
- /package/dist/chunks/{chunk-CPSW2GW4.js.map → chunk-KFZYTGF5.js.map} +0 -0
- /package/dist/chunks/{chunk-U6CTHPZC.js.map → chunk-MQG5QKGI.js.map} +0 -0
- /package/dist/chunks/{chunk-TPLMVELH.js.map → chunk-VYXFSUWU.js.map} +0 -0
- /package/dist/chunks/{chunk-UTR3I23Z.js.map → chunk-W63E3WEO.js.map} +0 -0
- /package/dist/chunks/{chunk-OP2KTYQB.js.map → chunk-ZMIJ6AT4.js.map} +0 -0
|
@@ -2,6 +2,10 @@ import {
|
|
|
2
2
|
defaultCodePreviewSettings,
|
|
3
3
|
normalizeCodePreviewSettings
|
|
4
4
|
} from "./chunk-OKOHRXGF.js";
|
|
5
|
+
import {
|
|
6
|
+
closeScratch,
|
|
7
|
+
createScratch
|
|
8
|
+
} from "./chunk-RAO6TQFP.js";
|
|
5
9
|
import {
|
|
6
10
|
renameAtomic
|
|
7
11
|
} from "./chunk-KAD7UWT2.js";
|
|
@@ -11,8 +15,9 @@ import {
|
|
|
11
15
|
} from "./chunk-MGWQOKBV.js";
|
|
12
16
|
import {
|
|
13
17
|
DEFAULT_JEV_CONFIG,
|
|
18
|
+
normalizeJevApprovalModel,
|
|
14
19
|
normalizeJevConfig
|
|
15
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-X3OD47CL.js";
|
|
16
21
|
import {
|
|
17
22
|
PI_CORE_TOOL_NAME_SET
|
|
18
23
|
} from "./chunk-YU62DDKK.js";
|
|
@@ -210,14 +215,20 @@ var resolveAvailablePiModel = (selector, options) => {
|
|
|
210
215
|
};
|
|
211
216
|
|
|
212
217
|
// src/core/shell-jobs.ts
|
|
213
|
-
import
|
|
214
|
-
import { readFile, unlink
|
|
218
|
+
import fs from "node:fs";
|
|
219
|
+
import { readFile, unlink } from "node:fs/promises";
|
|
215
220
|
import { tmpdir } from "node:os";
|
|
216
221
|
import path from "node:path";
|
|
217
222
|
import { randomUUID } from "node:crypto";
|
|
218
223
|
var DEFAULT_SHELL_HANG_MS = 12e4;
|
|
219
224
|
var SHELL_HANG_MAX_MS = 6e5;
|
|
220
225
|
var SHELL_HANG_SNAPSHOT_BYTES = 8e3;
|
|
226
|
+
var SHELL_TAIL_BYTES = 1024 * 1024;
|
|
227
|
+
var SHELL_LOG_BYTES = 8 * 1024 * 1024;
|
|
228
|
+
var SHELL_COMPLETED_HANDLES = 256;
|
|
229
|
+
var SHELL_COMPLETED_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
230
|
+
var LOG_HEADER = "[Bounded shell log: starts with retained pre-spill tail; 8 MiB total cap, then further output is omitted. Not a full-output archive.]\n";
|
|
231
|
+
var LOG_TRUNCATED = "\n[Shell log truncated: disk limit reached; subsequent output omitted.]\n";
|
|
221
232
|
var posixQuote = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
222
233
|
var powershellQuote = (value) => "'" + value.replaceAll("'", "''") + "'";
|
|
223
234
|
var wrapShellCommandForPid = (command, pidPath, tool) => tool === "powershell" ? `Set-Content -LiteralPath ${powershellQuote(pidPath)} -Value $PID
|
|
@@ -226,7 +237,7 @@ ${command}`;
|
|
|
226
237
|
var formatShellHangNotice = (input) => {
|
|
227
238
|
const seconds = Math.max(1, Math.round(input.elapsedMs / 1e3));
|
|
228
239
|
const pid = input.pid !== void 0 ? ` (pid ${input.pid})` : "";
|
|
229
|
-
return `[Still running after ${seconds}s${pid}.
|
|
240
|
+
return `[Still running after ${seconds}s${pid}. Bounded live output (may be truncated): ${input.logPath}]`;
|
|
230
241
|
};
|
|
231
242
|
var appendShellHangNotice = (output, notice) => output ? `${output}
|
|
232
243
|
|
|
@@ -236,6 +247,14 @@ var parseShellPid = (text) => {
|
|
|
236
247
|
return Number.isSafeInteger(pid) && pid > 1 ? pid : void 0;
|
|
237
248
|
};
|
|
238
249
|
var FabricShellJob = class {
|
|
250
|
+
constructor(tool, command, onFinish, tempRoot) {
|
|
251
|
+
this.onFinish = onFinish;
|
|
252
|
+
this.id = randomUUID();
|
|
253
|
+
this.tool = tool;
|
|
254
|
+
this.command = command;
|
|
255
|
+
this.#directory = createScratch("shell", tempRoot);
|
|
256
|
+
this.pidPath = path.join(this.#directory, "child.pid");
|
|
257
|
+
}
|
|
239
258
|
id;
|
|
240
259
|
tool;
|
|
241
260
|
command;
|
|
@@ -250,33 +269,81 @@ var FabricShellJob = class {
|
|
|
250
269
|
finishedAt;
|
|
251
270
|
exitCode;
|
|
252
271
|
status = "running";
|
|
253
|
-
#
|
|
254
|
-
#
|
|
272
|
+
#tail = Buffer.alloc(0);
|
|
273
|
+
#omitted = false;
|
|
274
|
+
#directory;
|
|
275
|
+
#descriptor;
|
|
276
|
+
#logBytes = 0;
|
|
277
|
+
#logTruncated = false;
|
|
255
278
|
#spill = new AbortController();
|
|
256
279
|
#pidRead;
|
|
257
|
-
constructor(tool, command) {
|
|
258
|
-
this.id = randomUUID();
|
|
259
|
-
this.tool = tool;
|
|
260
|
-
this.command = command;
|
|
261
|
-
this.pidPath = path.join(tmpdir(), `pi-fabric-shell-${this.id}.pid`);
|
|
262
|
-
}
|
|
263
280
|
append(data) {
|
|
264
281
|
if (this.finished) return;
|
|
265
|
-
|
|
266
|
-
this.#
|
|
282
|
+
const keep = Math.max(0, SHELL_TAIL_BYTES - data.length);
|
|
283
|
+
if (this.#tail.length + data.length > SHELL_TAIL_BYTES) this.#omitted = true;
|
|
284
|
+
this.#tail = Buffer.concat([
|
|
285
|
+
this.#tail.subarray(Math.max(0, this.#tail.length - keep)),
|
|
286
|
+
data.subarray(Math.max(0, data.length - SHELL_TAIL_BYTES))
|
|
287
|
+
]);
|
|
288
|
+
this.#writeLog(data);
|
|
289
|
+
}
|
|
290
|
+
#writeLog(data) {
|
|
291
|
+
if (this.#descriptor === void 0 || this.#logTruncated) return;
|
|
292
|
+
const available = Math.max(0, SHELL_LOG_BYTES - Buffer.byteLength(LOG_TRUNCATED) - this.#logBytes);
|
|
293
|
+
try {
|
|
294
|
+
const chunk = data.subarray(0, available);
|
|
295
|
+
let offset = 0;
|
|
296
|
+
while (offset < chunk.length) {
|
|
297
|
+
const written = fs.writeSync(this.#descriptor, chunk, offset);
|
|
298
|
+
if (written <= 0) throw new Error("Shell log write made no progress");
|
|
299
|
+
offset += written;
|
|
300
|
+
}
|
|
301
|
+
this.#logBytes += chunk.length;
|
|
302
|
+
if (chunk.length < data.length) {
|
|
303
|
+
fs.writeSync(this.#descriptor, LOG_TRUNCATED);
|
|
304
|
+
this.#logTruncated = true;
|
|
305
|
+
}
|
|
306
|
+
} catch {
|
|
307
|
+
try {
|
|
308
|
+
fs.closeSync(this.#descriptor);
|
|
309
|
+
} catch {
|
|
310
|
+
}
|
|
311
|
+
this.#descriptor = void 0;
|
|
312
|
+
this.#logTruncated = true;
|
|
313
|
+
}
|
|
267
314
|
}
|
|
268
315
|
snapshotText(maxBytes = SHELL_HANG_SNAPSHOT_BYTES) {
|
|
269
|
-
const
|
|
270
|
-
const slice =
|
|
271
|
-
|
|
316
|
+
const limit = Number.isFinite(maxBytes) ? Math.max(0, Math.floor(maxBytes)) : SHELL_TAIL_BYTES;
|
|
317
|
+
const slice = this.#tail.subarray(Math.max(0, this.#tail.length - limit));
|
|
318
|
+
const truncated = this.#omitted || slice.length < this.#tail.length;
|
|
319
|
+
return `${truncated ? "[Output truncated; retained tail follows]\n" : ""}${slice.toString("utf8")}`;
|
|
272
320
|
}
|
|
273
321
|
async persistLog() {
|
|
274
322
|
if (this.logPath) return this.logPath;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
323
|
+
if (this.finished) throw new Error("Shell job finished before a log was requested");
|
|
324
|
+
const logPath = path.join(this.#directory, "output.log");
|
|
325
|
+
try {
|
|
326
|
+
this.#descriptor = fs.openSync(logPath, "wx", 384);
|
|
327
|
+
fs.writeSync(this.#descriptor, LOG_HEADER);
|
|
328
|
+
this.#logBytes = Buffer.byteLength(LOG_HEADER);
|
|
329
|
+
if (this.#omitted) this.#writeLog(Buffer.from("[Pre-spill output truncated: only the last 1 MiB was retained.]\n"));
|
|
330
|
+
this.#writeLog(this.#tail);
|
|
331
|
+
this.logPath = logPath;
|
|
332
|
+
return logPath;
|
|
333
|
+
} catch (error) {
|
|
334
|
+
if (this.#descriptor !== void 0) {
|
|
335
|
+
try {
|
|
336
|
+
fs.closeSync(this.#descriptor);
|
|
337
|
+
} catch {
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
this.#descriptor = void 0;
|
|
341
|
+
try {
|
|
342
|
+
fs.unlinkSync(logPath);
|
|
343
|
+
} catch {
|
|
344
|
+
}
|
|
345
|
+
throw error;
|
|
346
|
+
}
|
|
280
347
|
}
|
|
281
348
|
async readPid() {
|
|
282
349
|
if (this.pid !== void 0) return this.pid;
|
|
@@ -311,7 +378,9 @@ var FabricShellJob = class {
|
|
|
311
378
|
}
|
|
312
379
|
async finish(exitCode, footer) {
|
|
313
380
|
if (this.finished) return;
|
|
381
|
+
const persistence = this.spilled && !this.logPath ? this.persistLog() : void 0;
|
|
314
382
|
this.finished = true;
|
|
383
|
+
await persistence?.catch(() => void 0);
|
|
315
384
|
this.finishedAt = Date.now();
|
|
316
385
|
if (exitCode !== void 0) this.exitCode = exitCode;
|
|
317
386
|
if (this.status === "running") {
|
|
@@ -319,20 +388,27 @@ var FabricShellJob = class {
|
|
|
319
388
|
} else if (this.abort.signal.aborted && this.status === "spilled") {
|
|
320
389
|
this.status = "killed";
|
|
321
390
|
}
|
|
322
|
-
if (footer
|
|
323
|
-
`);
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
391
|
+
if (footer) this.#writeLog(Buffer.from(footer.endsWith("\n") ? footer : `${footer}
|
|
392
|
+
`));
|
|
393
|
+
if (this.#descriptor !== void 0) {
|
|
394
|
+
try {
|
|
395
|
+
fs.closeSync(this.#descriptor);
|
|
396
|
+
} catch {
|
|
328
397
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
this.#
|
|
398
|
+
}
|
|
399
|
+
this.#descriptor = void 0;
|
|
400
|
+
this.#tail = Buffer.alloc(0);
|
|
401
|
+
this.#omitted = false;
|
|
332
402
|
if (!this.#spill.signal.aborted) this.#spill.abort();
|
|
333
|
-
|
|
334
|
-
|
|
403
|
+
await unlink(this.pidPath).catch(() => void 0);
|
|
404
|
+
if (this.logPath) closeScratch(this.#directory);
|
|
405
|
+
else {
|
|
406
|
+
try {
|
|
407
|
+
fs.rmSync(this.#directory, { recursive: true, force: true });
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
335
410
|
}
|
|
411
|
+
this.onFinish();
|
|
336
412
|
}
|
|
337
413
|
info() {
|
|
338
414
|
return {
|
|
@@ -359,16 +435,29 @@ var trackShellOperations = (inner, job, tool) => ({
|
|
|
359
435
|
})
|
|
360
436
|
});
|
|
361
437
|
var FabricShellJobStore = class {
|
|
438
|
+
constructor(tempRoot = tmpdir()) {
|
|
439
|
+
this.tempRoot = tempRoot;
|
|
440
|
+
}
|
|
362
441
|
#jobs = /* @__PURE__ */ new Map();
|
|
442
|
+
#prune() {
|
|
443
|
+
const completed = [...this.#jobs.values()].filter((job) => job.finished);
|
|
444
|
+
completed.sort((a, b) => (a.finishedAt ?? 0) - (b.finishedAt ?? 0));
|
|
445
|
+
for (const [index, job] of completed.entries()) {
|
|
446
|
+
if (index < completed.length - SHELL_COMPLETED_HANDLES || Date.now() - (job.finishedAt ?? 0) >= SHELL_COMPLETED_MAX_AGE_MS) this.#jobs.delete(job.id);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
363
449
|
begin(tool, command) {
|
|
364
|
-
|
|
450
|
+
this.#prune();
|
|
451
|
+
const job = new FabricShellJob(tool, command, () => this.#prune(), this.tempRoot);
|
|
365
452
|
this.#jobs.set(job.id, job);
|
|
366
453
|
return job;
|
|
367
454
|
}
|
|
368
455
|
get(id) {
|
|
456
|
+
this.#prune();
|
|
369
457
|
return this.#jobs.get(id);
|
|
370
458
|
}
|
|
371
459
|
list() {
|
|
460
|
+
this.#prune();
|
|
372
461
|
return [...this.#jobs.values()].map((job) => job.info());
|
|
373
462
|
}
|
|
374
463
|
waiting() {
|
|
@@ -457,12 +546,12 @@ var raceShellHang = async (options) => {
|
|
|
457
546
|
};
|
|
458
547
|
|
|
459
548
|
// src/config.ts
|
|
460
|
-
import
|
|
549
|
+
import fs3 from "node:fs";
|
|
461
550
|
import os from "node:os";
|
|
462
551
|
import path3 from "node:path";
|
|
463
552
|
|
|
464
553
|
// src/core/damaged-file.ts
|
|
465
|
-
import
|
|
554
|
+
import fs2 from "node:fs";
|
|
466
555
|
import path2 from "node:path";
|
|
467
556
|
var quarantineDamagedFile = (filePath) => {
|
|
468
557
|
const destination = path2.join(
|
|
@@ -470,7 +559,7 @@ var quarantineDamagedFile = (filePath) => {
|
|
|
470
559
|
`${path2.basename(filePath)}.damaged.${process.pid}.${Date.now()}`
|
|
471
560
|
);
|
|
472
561
|
try {
|
|
473
|
-
|
|
562
|
+
fs2.renameSync(filePath, destination);
|
|
474
563
|
return destination;
|
|
475
564
|
} catch {
|
|
476
565
|
return void 0;
|
|
@@ -787,7 +876,7 @@ var DEFAULT_FABRIC_CONFIG = {
|
|
|
787
876
|
var readJsonObjectFile = (filePath) => {
|
|
788
877
|
let source;
|
|
789
878
|
try {
|
|
790
|
-
source =
|
|
879
|
+
source = fs3.readFileSync(filePath, "utf8");
|
|
791
880
|
} catch (error) {
|
|
792
881
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") return void 0;
|
|
793
882
|
return void 0;
|
|
@@ -877,7 +966,7 @@ var normalizeFabricConfig = (input) => {
|
|
|
877
966
|
const configuredTools = Array.isArray(agents.defaultTools) ? agents.defaultTools.filter(
|
|
878
967
|
(tool) => typeof tool === "string" && Boolean(tool)
|
|
879
968
|
) : DEFAULT_FABRIC_CONFIG.agents.defaultTools;
|
|
880
|
-
const approvalModel = stringValue(approvals.model);
|
|
969
|
+
const approvalModel = normalizeJevApprovalModel(stringValue(approvals.model));
|
|
881
970
|
const configPath = stringValue(mcp.configPath);
|
|
882
971
|
const meshRoot = stringValue(mesh.root);
|
|
883
972
|
const memoryIndexDir = stringValue(memory.indexDir);
|
|
@@ -1426,30 +1515,30 @@ var planConfigFile = (filePath) => {
|
|
|
1426
1515
|
};
|
|
1427
1516
|
};
|
|
1428
1517
|
var writeJsonAtomic = (filePath, document, expectedSource) => {
|
|
1429
|
-
const resolvedPath =
|
|
1518
|
+
const resolvedPath = fs3.existsSync(filePath) ? fs3.realpathSync(filePath) : filePath;
|
|
1430
1519
|
const directory = path3.dirname(resolvedPath);
|
|
1431
|
-
if (!
|
|
1432
|
-
const mode =
|
|
1520
|
+
if (!fs3.existsSync(directory)) fs3.mkdirSync(directory, { recursive: true });
|
|
1521
|
+
const mode = fs3.existsSync(resolvedPath) ? fs3.statSync(resolvedPath).mode & 511 : 384;
|
|
1433
1522
|
const temporaryPath = path3.join(
|
|
1434
1523
|
directory,
|
|
1435
1524
|
`.${path3.basename(resolvedPath)}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
|
|
1436
1525
|
);
|
|
1437
1526
|
let descriptor;
|
|
1438
1527
|
try {
|
|
1439
|
-
descriptor =
|
|
1440
|
-
|
|
1528
|
+
descriptor = fs3.openSync(temporaryPath, "wx", mode);
|
|
1529
|
+
fs3.writeFileSync(descriptor, `${JSON.stringify(document, null, 2)}
|
|
1441
1530
|
`, "utf8");
|
|
1442
|
-
|
|
1443
|
-
|
|
1531
|
+
fs3.fsyncSync(descriptor);
|
|
1532
|
+
fs3.closeSync(descriptor);
|
|
1444
1533
|
descriptor = void 0;
|
|
1445
1534
|
if (expectedSource === null) {
|
|
1446
|
-
if (
|
|
1535
|
+
if (fs3.existsSync(resolvedPath)) {
|
|
1447
1536
|
throw new Error(`Fabric configuration changed while updating ${filePath}`);
|
|
1448
1537
|
}
|
|
1449
1538
|
} else {
|
|
1450
1539
|
let currentSource;
|
|
1451
1540
|
try {
|
|
1452
|
-
currentSource =
|
|
1541
|
+
currentSource = fs3.readFileSync(resolvedPath, "utf8");
|
|
1453
1542
|
} catch (error) {
|
|
1454
1543
|
throw new Error(`Fabric configuration changed while updating ${filePath}`, { cause: error });
|
|
1455
1544
|
}
|
|
@@ -1459,19 +1548,19 @@ var writeJsonAtomic = (filePath, document, expectedSource) => {
|
|
|
1459
1548
|
}
|
|
1460
1549
|
renameAtomic(temporaryPath, resolvedPath);
|
|
1461
1550
|
try {
|
|
1462
|
-
const directoryDescriptor =
|
|
1551
|
+
const directoryDescriptor = fs3.openSync(directory, "r");
|
|
1463
1552
|
try {
|
|
1464
|
-
|
|
1553
|
+
fs3.fsyncSync(directoryDescriptor);
|
|
1465
1554
|
} finally {
|
|
1466
|
-
|
|
1555
|
+
fs3.closeSync(directoryDescriptor);
|
|
1467
1556
|
}
|
|
1468
1557
|
} catch (error) {
|
|
1469
1558
|
const code = error instanceof Error && "code" in error ? error.code : void 0;
|
|
1470
1559
|
if (code !== "EINVAL" && code !== "ENOTSUP" && code !== "EISDIR" && code !== "EPERM") throw error;
|
|
1471
1560
|
}
|
|
1472
1561
|
} catch (error) {
|
|
1473
|
-
if (descriptor !== void 0)
|
|
1474
|
-
|
|
1562
|
+
if (descriptor !== void 0) fs3.closeSync(descriptor);
|
|
1563
|
+
fs3.rmSync(temporaryPath, { force: true });
|
|
1475
1564
|
throw error;
|
|
1476
1565
|
}
|
|
1477
1566
|
};
|
|
@@ -1569,4 +1658,4 @@ export {
|
|
|
1569
1658
|
loadFabricConfig,
|
|
1570
1659
|
saveFabricConfig
|
|
1571
1660
|
};
|
|
1572
|
-
//# sourceMappingURL=chunk-
|
|
1661
|
+
//# sourceMappingURL=chunk-VWSXAEX6.js.map
|