@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.
Files changed (144) hide show
  1. package/dist/agents/budget-ledger.d.ts.map +1 -1
  2. package/dist/agents/handoff-continuation.d.ts +4 -0
  3. package/dist/agents/handoff-continuation.d.ts.map +1 -0
  4. package/dist/agents/manager.d.ts.map +1 -1
  5. package/dist/agents.js +3 -3
  6. package/dist/chunks/{chunk-GXNR6NRU.js → chunk-2IAVP4O2.js} +2 -2
  7. package/dist/chunks/{chunk-2UQV52II.js → chunk-3CPWRPCE.js} +6 -6
  8. package/dist/chunks/{chunk-YK5AZ7CZ.js → chunk-3ZX76BVU.js} +3 -3
  9. package/dist/chunks/{chunk-PH7ZJ27F.js → chunk-7OH6DD3S.js} +210 -118
  10. package/dist/chunks/chunk-7OH6DD3S.js.map +7 -0
  11. package/dist/chunks/chunk-EDL4JDW7.js +184 -0
  12. package/dist/chunks/chunk-EDL4JDW7.js.map +7 -0
  13. package/dist/chunks/{chunk-RNOPHITP.js → chunk-H6DDV6E2.js} +180 -24
  14. package/dist/chunks/chunk-H6DDV6E2.js.map +7 -0
  15. package/dist/chunks/{chunk-ARLYAW2A.js → chunk-IR3PIHJM.js} +2 -1
  16. package/dist/chunks/chunk-IR3PIHJM.js.map +7 -0
  17. package/dist/chunks/{chunk-VRZNFNPB.js → chunk-IYQ5MNCW.js} +20 -17
  18. package/dist/chunks/chunk-IYQ5MNCW.js.map +7 -0
  19. package/dist/chunks/{chunk-CPSW2GW4.js → chunk-KFZYTGF5.js} +5 -5
  20. package/dist/chunks/{chunk-U6CTHPZC.js → chunk-MQG5QKGI.js} +2 -2
  21. package/dist/chunks/{chunk-CI56CW53.js → chunk-NPHCGLGH.js} +16 -10
  22. package/dist/chunks/chunk-NPHCGLGH.js.map +7 -0
  23. package/dist/chunks/{chunk-2DMJ7MEI.js → chunk-QX3TUAWO.js} +172 -141
  24. package/dist/chunks/chunk-QX3TUAWO.js.map +7 -0
  25. package/dist/chunks/chunk-RAO6TQFP.js +187 -0
  26. package/dist/chunks/chunk-RAO6TQFP.js.map +7 -0
  27. package/dist/chunks/{chunk-ZZ4LHQYJ.js → chunk-RTXZHKMS.js} +22 -13
  28. package/dist/chunks/chunk-RTXZHKMS.js.map +7 -0
  29. package/dist/chunks/{chunk-656HWVFU.js → chunk-SZUXWOO7.js} +5 -3
  30. package/dist/chunks/chunk-SZUXWOO7.js.map +7 -0
  31. package/dist/chunks/{chunk-UDFDF7IY.js → chunk-VWSXAEX6.js} +143 -54
  32. package/dist/chunks/chunk-VWSXAEX6.js.map +7 -0
  33. package/dist/chunks/{chunk-TPLMVELH.js → chunk-VYXFSUWU.js} +4 -4
  34. package/dist/chunks/{chunk-UTR3I23Z.js → chunk-W63E3WEO.js} +2 -2
  35. package/dist/chunks/{chunk-3MEHEH6B.js → chunk-X3OD47CL.js} +12 -2
  36. package/dist/chunks/chunk-X3OD47CL.js.map +7 -0
  37. package/dist/chunks/{chunk-OP2KTYQB.js → chunk-ZMIJ6AT4.js} +4 -4
  38. package/dist/compaction/hook.js +2 -2
  39. package/dist/config.d.ts.map +1 -1
  40. package/dist/core/action-registry.js +2 -2
  41. package/dist/core/auto-approval-classifier.d.ts.map +1 -1
  42. package/dist/core/shell-jobs.d.ts +7 -1
  43. package/dist/core/shell-jobs.d.ts.map +1 -1
  44. package/dist/entropy/compiler.d.ts +8 -0
  45. package/dist/entropy/compiler.d.ts.map +1 -1
  46. package/dist/entropy/index.js +9 -1
  47. package/dist/entropy/meter.d.ts +10 -0
  48. package/dist/entropy/meter.d.ts.map +1 -1
  49. package/dist/entropy/pool.d.ts +5 -0
  50. package/dist/entropy/pool.d.ts.map +1 -1
  51. package/dist/entropy/sessions.d.ts +12 -1
  52. package/dist/entropy/sessions.d.ts.map +1 -1
  53. package/dist/fabric-runtime-state.js +30 -22
  54. package/dist/fabric-runtime-state.js.map +2 -2
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +70 -38
  57. package/dist/index.js.map +3 -3
  58. package/dist/jev/browser.js +2 -2
  59. package/dist/jev/config.d.ts +2 -0
  60. package/dist/jev/config.d.ts.map +1 -1
  61. package/dist/jev/model-key.d.ts +6 -0
  62. package/dist/jev/model-key.d.ts.map +1 -0
  63. package/dist/jev/observation.js +2 -2
  64. package/dist/jev.js +7 -7
  65. package/dist/memory/file-worker.d.ts +15 -0
  66. package/dist/memory/file-worker.d.ts.map +1 -0
  67. package/dist/memory/file-worker.js +44 -0
  68. package/dist/memory/file-worker.js.map +7 -0
  69. package/dist/memory/worker-provider.d.ts +24 -0
  70. package/dist/memory/worker-provider.d.ts.map +1 -0
  71. package/dist/memory/worker-provider.js +18 -0
  72. package/dist/memory/worker-provider.js.map +7 -0
  73. package/dist/output-budget.d.ts.map +1 -1
  74. package/dist/prewalk/arm.d.ts.map +1 -1
  75. package/dist/prewalk/handoff.d.ts.map +1 -1
  76. package/dist/providers/jev-provider.js +6 -6
  77. package/dist/residency/host.js +9 -8
  78. package/dist/residency/pi-entry.js +9 -8
  79. package/dist/residency/pi-entry.js.map +1 -1
  80. package/dist/runtime/monty-runtime.js +3 -2
  81. package/dist/runtime/monty-runtime.js.map +1 -1
  82. package/dist/runtime/typescript-kernel.js +6 -6
  83. package/dist/runtime-state-builtins.d.ts.map +1 -1
  84. package/dist/speculation/stream-tap.d.ts.map +1 -1
  85. package/dist/storage/retention.d.ts +3 -1
  86. package/dist/storage/retention.d.ts.map +1 -1
  87. package/dist/storage/scratch.d.ts +33 -0
  88. package/dist/storage/scratch.d.ts.map +1 -0
  89. package/dist/ui/code-preview-shell.d.ts.map +1 -1
  90. package/dist/ui/conversation-chrome.js +2 -2
  91. package/dist/ui/conversation-native-reader.js +4 -2
  92. package/dist/ui/conversation-native-reader.js.map +2 -2
  93. package/dist/ui/conversation.js +3 -3
  94. package/dist/ui/dashboard-presentation.d.ts.map +1 -1
  95. package/dist/ui/dashboard.js +13 -9
  96. package/dist/ui/dashboard.js.map +2 -2
  97. package/dist/ui/fabric-code-parser.d.ts.map +1 -1
  98. package/dist/ui/format.d.ts +1 -0
  99. package/dist/ui/format.d.ts.map +1 -1
  100. package/dist/ui/highlight.d.ts.map +1 -1
  101. package/dist/ui/settings-rpc.d.ts.map +1 -1
  102. package/dist/ui/settings-sections-execution.d.ts.map +1 -1
  103. package/dist/ui/settings-submenus.d.ts +12 -4
  104. package/dist/ui/settings-submenus.d.ts.map +1 -1
  105. package/dist/ui/settings.js +78 -31
  106. package/dist/ui/settings.js.map +2 -2
  107. package/dist/ui/shiki-catalog.d.ts +3 -0
  108. package/dist/ui/shiki-catalog.d.ts.map +1 -0
  109. package/dist/ui/structured.d.ts.map +1 -1
  110. package/dist/ui/tool-call-timing.d.ts.map +1 -1
  111. package/dist/ui/widget.d.ts.map +1 -1
  112. package/dist/worker/model-control.d.ts.map +1 -1
  113. package/dist/worker/model-control.js +0 -1
  114. package/dist/worker/model-control.js.map +2 -2
  115. package/dist/worker.js +3 -9
  116. package/dist/worker.js.map +2 -2
  117. package/docs/agents.md +7 -3
  118. package/docs/configuration.md +19 -7
  119. package/docs/entropy.md +17 -1
  120. package/docs/jev.md +2 -2
  121. package/docs/memory-recall.md +21 -0
  122. package/package.json +5 -2
  123. package/skillsets/python/fabric-exec/references/agents.md +2 -0
  124. package/skillsets/python/fabric-jev/SKILL.md +1 -1
  125. package/skillsets/typescript/fabric-exec/references/agents.md +2 -0
  126. package/skillsets/typescript/fabric-jev/SKILL.md +1 -1
  127. package/dist/chunks/chunk-2DMJ7MEI.js.map +0 -7
  128. package/dist/chunks/chunk-3MEHEH6B.js.map +0 -7
  129. package/dist/chunks/chunk-656HWVFU.js.map +0 -7
  130. package/dist/chunks/chunk-ARLYAW2A.js.map +0 -7
  131. package/dist/chunks/chunk-CI56CW53.js.map +0 -7
  132. package/dist/chunks/chunk-PH7ZJ27F.js.map +0 -7
  133. package/dist/chunks/chunk-RNOPHITP.js.map +0 -7
  134. package/dist/chunks/chunk-UDFDF7IY.js.map +0 -7
  135. package/dist/chunks/chunk-VRZNFNPB.js.map +0 -7
  136. package/dist/chunks/chunk-ZZ4LHQYJ.js.map +0 -7
  137. /package/dist/chunks/{chunk-GXNR6NRU.js.map → chunk-2IAVP4O2.js.map} +0 -0
  138. /package/dist/chunks/{chunk-2UQV52II.js.map → chunk-3CPWRPCE.js.map} +0 -0
  139. /package/dist/chunks/{chunk-YK5AZ7CZ.js.map → chunk-3ZX76BVU.js.map} +0 -0
  140. /package/dist/chunks/{chunk-CPSW2GW4.js.map → chunk-KFZYTGF5.js.map} +0 -0
  141. /package/dist/chunks/{chunk-U6CTHPZC.js.map → chunk-MQG5QKGI.js.map} +0 -0
  142. /package/dist/chunks/{chunk-TPLMVELH.js.map → chunk-VYXFSUWU.js.map} +0 -0
  143. /package/dist/chunks/{chunk-UTR3I23Z.js.map → chunk-W63E3WEO.js.map} +0 -0
  144. /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-3MEHEH6B.js";
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 { createWriteStream } from "node:fs";
214
- import { readFile, unlink, writeFile } from "node:fs/promises";
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}. Live output: ${input.logPath}]`;
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
- #chunks = [];
254
- #stream;
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
- this.#chunks.push(data);
266
- this.#stream?.write(data);
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 all = Buffer.concat(this.#chunks);
270
- const slice = all.length <= maxBytes ? all : all.subarray(all.length - maxBytes);
271
- return slice.toString("utf8");
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
- const logPath = path.join(tmpdir(), `pi-fabric-shell-${this.id}.log`);
276
- this.logPath = logPath;
277
- await writeFile(logPath, Buffer.concat(this.#chunks), { encoding: "utf8", mode: 384 });
278
- this.#stream = createWriteStream(logPath, { flags: "a", encoding: "utf8", mode: 384 });
279
- return logPath;
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 && this.#stream) this.#stream.write(footer.endsWith("\n") ? footer : `${footer}
323
- `);
324
- await new Promise((resolve) => {
325
- if (!this.#stream) {
326
- resolve();
327
- return;
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
- this.#stream.end(() => resolve());
330
- });
331
- this.#stream = void 0;
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
- if (!this.spilled) {
334
- await unlink(this.pidPath).catch(() => void 0);
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
- const job = new FabricShellJob(tool, command);
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 fs2 from "node:fs";
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 fs from "node:fs";
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
- fs.renameSync(filePath, destination);
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 = fs2.readFileSync(filePath, "utf8");
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 = fs2.existsSync(filePath) ? fs2.realpathSync(filePath) : filePath;
1518
+ const resolvedPath = fs3.existsSync(filePath) ? fs3.realpathSync(filePath) : filePath;
1430
1519
  const directory = path3.dirname(resolvedPath);
1431
- if (!fs2.existsSync(directory)) fs2.mkdirSync(directory, { recursive: true });
1432
- const mode = fs2.existsSync(resolvedPath) ? fs2.statSync(resolvedPath).mode & 511 : 384;
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 = fs2.openSync(temporaryPath, "wx", mode);
1440
- fs2.writeFileSync(descriptor, `${JSON.stringify(document, null, 2)}
1528
+ descriptor = fs3.openSync(temporaryPath, "wx", mode);
1529
+ fs3.writeFileSync(descriptor, `${JSON.stringify(document, null, 2)}
1441
1530
  `, "utf8");
1442
- fs2.fsyncSync(descriptor);
1443
- fs2.closeSync(descriptor);
1531
+ fs3.fsyncSync(descriptor);
1532
+ fs3.closeSync(descriptor);
1444
1533
  descriptor = void 0;
1445
1534
  if (expectedSource === null) {
1446
- if (fs2.existsSync(resolvedPath)) {
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 = fs2.readFileSync(resolvedPath, "utf8");
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 = fs2.openSync(directory, "r");
1551
+ const directoryDescriptor = fs3.openSync(directory, "r");
1463
1552
  try {
1464
- fs2.fsyncSync(directoryDescriptor);
1553
+ fs3.fsyncSync(directoryDescriptor);
1465
1554
  } finally {
1466
- fs2.closeSync(directoryDescriptor);
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) fs2.closeSync(descriptor);
1474
- fs2.rmSync(temporaryPath, { force: true });
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-UDFDF7IY.js.map
1661
+ //# sourceMappingURL=chunk-VWSXAEX6.js.map