windows-development-sandbox 1.14.0 → 1.16.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.
Files changed (100) hide show
  1. package/config.example.json +2 -1
  2. package/dist/app/features/accounts/accounts.def.js +4 -3
  3. package/dist/app/features/defs.d.ts +4 -2
  4. package/dist/app/features/defs.js +26 -12
  5. package/dist/app/features/projects/projects.def.d.ts +1 -1
  6. package/dist/app/features/projects/projects.run.d.ts +1 -1
  7. package/dist/app/features/projects/projects.run.js +10 -2
  8. package/dist/app/features/sandbox/sandbox.def.js +12 -6
  9. package/dist/app/features/sessions/sessions.def.js +1 -1
  10. package/dist/app/features/settings/categories.def.js +1 -0
  11. package/dist/bin/agent-sandbox.js +2 -2
  12. package/dist/bin/{chunk-F7IMME5G.js → chunk-7EXDUNE7.js} +98 -79
  13. package/dist/bin/{chunk-BQ23GBLC.js → chunk-HIC4CUMY.js} +1925 -1430
  14. package/dist/bin/{chunk-LQHEUN2A.js → chunk-PXTLKIV4.js} +1 -1
  15. package/dist/bin/claude-host.js +2 -2
  16. package/dist/bin/claude-sbx.js +2 -2
  17. package/dist/bin/codex-sbx.js +2 -2
  18. package/dist/bin/gemini-sbx.js +2 -2
  19. package/dist/bin/sandbox.js +2 -2
  20. package/dist/bin/sbx-hide.js +2 -2
  21. package/dist/bin/sbx-show.js +2 -2
  22. package/dist/cli/commands/projects/here.js +2 -0
  23. package/dist/cli/index.js +4 -1
  24. package/dist/cli/report.d.ts +7 -0
  25. package/dist/cli/report.js +31 -0
  26. package/dist/cli/services/health-service.js +15 -3
  27. package/dist/cli/services/projects-service.d.ts +8 -3
  28. package/dist/cli/services/projects-service.js +21 -4
  29. package/dist/core/config/defaults.js +1 -0
  30. package/dist/core/schema/config.d.ts +4 -0
  31. package/dist/core/schema/projects.d.ts +4 -0
  32. package/dist/core/schema/projects.js +3 -0
  33. package/dist/guest/boot/boot.js +8 -2
  34. package/dist/guest/daemon/daemon.js +3 -0
  35. package/dist/guest/daemon/live-folders.d.ts +48 -0
  36. package/dist/guest/daemon/live-folders.js +245 -0
  37. package/dist/guest/daemon/live.d.ts +4 -0
  38. package/dist/guest/daemon/live.js +57 -0
  39. package/dist/guest/entries/daemon.js +4 -2
  40. package/dist/guest/runtime/csc.d.ts +1 -0
  41. package/dist/guest/runtime/csc.js +1 -0
  42. package/dist/guest/runtime/secrets.d.ts +5 -2
  43. package/dist/guest/runtime/secrets.js +12 -5
  44. package/dist/host/engines/hcs/live-folders.d.ts +117 -0
  45. package/dist/host/engines/hcs/live-folders.js +347 -0
  46. package/dist/host/engines/index.d.ts +1 -0
  47. package/dist/host/engines/index.js +1 -0
  48. package/dist/host/launch/generate.js +8 -1
  49. package/dist/host/projects/join.d.ts +4 -0
  50. package/dist/host/projects/join.js +11 -3
  51. package/dist/host/projects/mapper.d.ts +34 -5
  52. package/dist/host/projects/mapper.js +88 -20
  53. package/dist/host/projects/registry.d.ts +2 -0
  54. package/dist/host/projects/registry.js +1 -1
  55. package/dist/host/secrets/launch-secrets.js +2 -1
  56. package/dist/runtime/agent.js +14 -0
  57. package/dist/runtime/daemon.js +466 -132
  58. package/dist/runtime/db.js +14 -0
  59. package/dist/runtime/main.js +26 -3
  60. package/dist/runtime/netproxy.js +14 -0
  61. package/dist/runtime/view.js +14 -0
  62. package/dist/selftest/accounts.test.js +22 -0
  63. package/dist/selftest/app.test.js +2 -2
  64. package/dist/selftest/index.js +2 -0
  65. package/dist/selftest/layout.test.js +1 -0
  66. package/dist/selftest/live-folders.test.d.ts +2 -0
  67. package/dist/selftest/live-folders.test.js +588 -0
  68. package/dist/selftest/projects.test.js +7 -7
  69. package/dist/selftest/support/engine-golden.js +1 -0
  70. package/dist/selftest/support/fixtures.d.ts +1 -0
  71. package/dist/selftest/support/live.js +2 -0
  72. package/dist/shared/channel/index.d.ts +1 -0
  73. package/dist/shared/channel/index.js +1 -0
  74. package/dist/shared/channel/live.d.ts +53 -0
  75. package/dist/shared/channel/live.js +92 -0
  76. package/dist/shared/channel/run-dir.d.ts +5 -0
  77. package/dist/shared/channel/run-dir.js +11 -0
  78. package/dist/shared/channel/secrets.d.ts +1 -0
  79. package/dist/shared/channel/secrets.js +5 -0
  80. package/dist/shared/paths/projects.d.ts +6 -1
  81. package/dist/shared/paths/projects.js +21 -1
  82. package/dist/sync/watcher.js +9 -0
  83. package/dist/web/index.html +2 -2
  84. package/dist/web/main-JTH3FT4O.js +221 -0
  85. package/dist/web/{main-UAQPI5XD.css → main-XT7T6ODM.css} +1 -1
  86. package/native/csharp/HcsHost/AssemblyInfo.cs +4 -4
  87. package/native/csharp/HcsHost/FolderAccess.cs +361 -0
  88. package/native/csharp/HcsHost/Hcs.cs +31 -3
  89. package/native/csharp/HcsHost/Program.cs +54 -6
  90. package/native/csharp/HcsHost/Share.cs +64 -11
  91. package/native/csharp/HcsHost/WsbGuard.cs +130 -0
  92. package/native/csharp/HcsHost/WsbShare.cs +295 -0
  93. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  94. package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
  95. package/native/scripts/contained-common.ps1 +4 -0
  96. package/native/scripts/hcs-live-share.ps1 +191 -0
  97. package/package.json +1 -1
  98. package/sandbox/csharp/BindMount.cs +120 -0
  99. package/schemas/config.schema.json +8 -0
  100. package/dist/web/main-6XNBTJLT.js +0 -221
@@ -226,7 +226,7 @@ import {
226
226
  withOperationCommands,
227
227
  working,
228
228
  writeJson
229
- } from "./chunk-BQ23GBLC.js";
229
+ } from "./chunk-HIC4CUMY.js";
230
230
 
231
231
  // node_modules/commander/lib/error.js
232
232
  var require_error = __commonJS({
@@ -1391,8 +1391,8 @@ var require_command = __commonJS({
1391
1391
  "node_modules/commander/lib/command.js"(exports) {
1392
1392
  var EventEmitter = __require("node:events").EventEmitter;
1393
1393
  var childProcess = __require("node:child_process");
1394
- var path13 = __require("node:path");
1395
- var fs8 = __require("node:fs");
1394
+ var path14 = __require("node:path");
1395
+ var fs9 = __require("node:fs");
1396
1396
  var process2 = __require("node:process");
1397
1397
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1398
1398
  var { CommanderError: CommanderError2 } = require_error();
@@ -2386,7 +2386,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2386
2386
  * @param {string} subcommandName
2387
2387
  */
2388
2388
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
2389
- if (fs8.existsSync(executableFile)) return;
2389
+ if (fs9.existsSync(executableFile)) return;
2390
2390
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
2391
2391
  const executableMissing = `'${executableFile}' does not exist
2392
2392
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -2404,11 +2404,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2404
2404
  let launchWithNode = false;
2405
2405
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
2406
2406
  function findFile(baseDir, baseName) {
2407
- const localBin = path13.resolve(baseDir, baseName);
2408
- if (fs8.existsSync(localBin)) return localBin;
2409
- if (sourceExt.includes(path13.extname(baseName))) return void 0;
2407
+ const localBin = path14.resolve(baseDir, baseName);
2408
+ if (fs9.existsSync(localBin)) return localBin;
2409
+ if (sourceExt.includes(path14.extname(baseName))) return void 0;
2410
2410
  const foundExt = sourceExt.find(
2411
- (ext) => fs8.existsSync(`${localBin}${ext}`)
2411
+ (ext) => fs9.existsSync(`${localBin}${ext}`)
2412
2412
  );
2413
2413
  if (foundExt) return `${localBin}${foundExt}`;
2414
2414
  return void 0;
@@ -2420,21 +2420,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
2420
2420
  if (this._scriptPath) {
2421
2421
  let resolvedScriptPath;
2422
2422
  try {
2423
- resolvedScriptPath = fs8.realpathSync(this._scriptPath);
2423
+ resolvedScriptPath = fs9.realpathSync(this._scriptPath);
2424
2424
  } catch {
2425
2425
  resolvedScriptPath = this._scriptPath;
2426
2426
  }
2427
- executableDir = path13.resolve(
2428
- path13.dirname(resolvedScriptPath),
2427
+ executableDir = path14.resolve(
2428
+ path14.dirname(resolvedScriptPath),
2429
2429
  executableDir
2430
2430
  );
2431
2431
  }
2432
2432
  if (executableDir) {
2433
2433
  let localFile = findFile(executableDir, executableFile);
2434
2434
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2435
- const legacyName = path13.basename(
2435
+ const legacyName = path14.basename(
2436
2436
  this._scriptPath,
2437
- path13.extname(this._scriptPath)
2437
+ path14.extname(this._scriptPath)
2438
2438
  );
2439
2439
  if (legacyName !== this._name) {
2440
2440
  localFile = findFile(
@@ -2445,7 +2445,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2445
2445
  }
2446
2446
  executableFile = localFile || executableFile;
2447
2447
  }
2448
- launchWithNode = sourceExt.includes(path13.extname(executableFile));
2448
+ launchWithNode = sourceExt.includes(path14.extname(executableFile));
2449
2449
  let proc;
2450
2450
  if (process2.platform !== "win32") {
2451
2451
  if (launchWithNode) {
@@ -3360,7 +3360,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3360
3360
  * @return {Command}
3361
3361
  */
3362
3362
  nameFromFilename(filename) {
3363
- this._name = path13.basename(filename, path13.extname(filename));
3363
+ this._name = path14.basename(filename, path14.extname(filename));
3364
3364
  return this;
3365
3365
  }
3366
3366
  /**
@@ -3374,9 +3374,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3374
3374
  * @param {string} [path]
3375
3375
  * @return {(string|null|Command)}
3376
3376
  */
3377
- executableDir(path14) {
3378
- if (path14 === void 0) return this._executableDir;
3379
- this._executableDir = path14;
3377
+ executableDir(path15) {
3378
+ if (path15 === void 0) return this._executableDir;
3379
+ this._executableDir = path15;
3380
3380
  return this;
3381
3381
  }
3382
3382
  /**
@@ -3655,7 +3655,7 @@ var require_commander = __commonJS({
3655
3655
  });
3656
3656
 
3657
3657
  // src/cli/index.ts
3658
- import path12 from "node:path";
3658
+ import path13 from "node:path";
3659
3659
 
3660
3660
  // src/cli/args.ts
3661
3661
  import path from "node:path";
@@ -6157,9 +6157,9 @@ var App = class {
6157
6157
  return this.show(new MessageScreen(o));
6158
6158
  }
6159
6159
  /** One of a few values (undefined = back). */
6160
- async choose(path13, intro, choices, current2) {
6160
+ async choose(path14, intro, choices, current2) {
6161
6161
  const picked = await this.list({
6162
- path: path13,
6162
+ path: path14,
6163
6163
  intro,
6164
6164
  items: choices.map((c2) => ({
6165
6165
  ...c2,
@@ -6206,9 +6206,9 @@ var ADD = "@add";
6206
6206
 
6207
6207
  // src/cli/menu/settings/collections/collection-editor.ts
6208
6208
  var CollectionEditor = class {
6209
- constructor(app, path13, node, editor, key = []) {
6209
+ constructor(app, path14, node, editor, key = []) {
6210
6210
  this.app = app;
6211
- this.path = path13;
6211
+ this.path = path14;
6212
6212
  this.node = node;
6213
6213
  this.editor = editor;
6214
6214
  this.key = key;
@@ -6268,8 +6268,8 @@ var CollectionEditor = class {
6268
6268
 
6269
6269
  // src/cli/menu/settings/collections/string-list-editor.ts
6270
6270
  var StringListEditor = class extends CollectionEditor {
6271
- constructor(app, path13, node, editor, key, pathKind, keepNote) {
6272
- super(app, path13, node, editor, key);
6271
+ constructor(app, path14, node, editor, key, pathKind, keepNote) {
6272
+ super(app, path14, node, editor, key);
6273
6273
  this.pathKind = pathKind;
6274
6274
  if (pathKind) this.noun = pathKind === "file" ? "file" : "folder";
6275
6275
  if (keepNote) this.keepNote = keepNote;
@@ -6362,9 +6362,9 @@ var MapEditor = class extends CollectionEditor {
6362
6362
  // src/cli/menu/settings/object-editor.ts
6363
6363
  var import_lodash2 = __toESM(require_lodash(), 1);
6364
6364
  var ObjectEditor = class {
6365
- constructor(app, path13, node, editor, key = []) {
6365
+ constructor(app, path14, node, editor, key = []) {
6366
6366
  this.app = app;
6367
- this.path = path13;
6367
+ this.path = path14;
6368
6368
  this.node = node;
6369
6369
  this.editor = editor;
6370
6370
  this.key = key;
@@ -6519,23 +6519,23 @@ var ValueEditor = class {
6519
6519
  }
6520
6520
  app;
6521
6521
  hints;
6522
- async edit(path13, key, node, current2) {
6522
+ async edit(path14, key, node, current2) {
6523
6523
  const field = fieldOf(node, key);
6524
6524
  const suggestions = this.hints.suggestions?.(key);
6525
- if (suggestions?.length && node.type === "string") return this.suggest(path13, key, node, current2, suggestions);
6525
+ if (suggestions?.length && node.type === "string") return this.suggest(path14, key, node, current2, suggestions);
6526
6526
  switch (field.kind) {
6527
6527
  case "boolean":
6528
6528
  return { value: !(current2 ?? false) };
6529
6529
  case "enum":
6530
- return field.open ? this.custom(path13, key, node, current2) : this.pick(path13, node, current2, node.choiceValues);
6530
+ return field.open ? this.custom(path14, key, node, current2) : this.pick(path14, node, current2, node.choiceValues);
6531
6531
  case "number":
6532
- return this.number(path13, key, node, current2);
6532
+ return this.number(path14, key, node, current2);
6533
6533
  case "path":
6534
- return this.folderOrFile(path13, key, node, current2, field.pathKind ?? "dir");
6534
+ return this.folderOrFile(path14, key, node, current2, field.pathKind ?? "dir");
6535
6535
  case "text":
6536
6536
  case "secret": {
6537
6537
  const typed = await this.app.text({
6538
- path: path13,
6538
+ path: path14,
6539
6539
  label: Text.humanize(key[key.length - 1]),
6540
6540
  about: field.help ? [field.help] : [],
6541
6541
  initial: typeof current2 === "string" ? current2 : "",
@@ -6546,27 +6546,27 @@ var ValueEditor = class {
6546
6546
  return typed === void 0 ? void 0 : { value: typed };
6547
6547
  }
6548
6548
  case "list":
6549
- return this.list(path13, key, node, field, current2);
6549
+ return this.list(path14, key, node, field, current2);
6550
6550
  case "map":
6551
- return field.element?.kind === "object" ? new ObjectMapEditor(this.app, path13, node, this, key).run(
6551
+ return field.element?.kind === "object" ? new ObjectMapEditor(this.app, path14, node, this, key).run(
6552
6552
  import_lodash3.default.isPlainObject(current2) ? current2 : {}
6553
- ) : new MapEditor(this.app, path13, node, this, key).run(
6553
+ ) : new MapEditor(this.app, path14, node, this, key).run(
6554
6554
  import_lodash3.default.isPlainObject(current2) ? current2 : {}
6555
6555
  );
6556
6556
  case "object":
6557
- return new ObjectEditor(this.app, path13, node, this, key).run(
6557
+ return new ObjectEditor(this.app, path14, node, this, key).run(
6558
6558
  import_lodash3.default.isPlainObject(current2) ? current2 : node.initial()
6559
6559
  );
6560
6560
  default:
6561
- return this.json(path13, key, node, current2);
6561
+ return this.json(path14, key, node, current2);
6562
6562
  }
6563
6563
  }
6564
6564
  /** A choice with "Custom…" for a value of your own (a number or a text besides the fixed values). */
6565
- async custom(path13, key, node, current2) {
6565
+ async custom(path14, key, node, current2) {
6566
6566
  const open = node.openOption;
6567
6567
  const custom = "@custom";
6568
6568
  const picked = await this.app.choose(
6569
- path13,
6569
+ path14,
6570
6570
  node.description ?? "",
6571
6571
  [
6572
6572
  ...node.choiceValues.map((v) => ({ value: v, label: choiceLabel(v) })),
@@ -6579,15 +6579,15 @@ var ValueEditor = class {
6579
6579
  node.choiceValues.includes(current2) ? current2 : current2 !== void 0 ? custom : void 0
6580
6580
  );
6581
6581
  if (picked === void 0) return void 0;
6582
- return picked === custom ? this.edit(path13, key, open, node.choiceValues.includes(current2) ? void 0 : current2) : { value: picked };
6582
+ return picked === custom ? this.edit(path14, key, open, node.choiceValues.includes(current2) ? void 0 : current2) : { value: picked };
6583
6583
  }
6584
6584
  /** A list: ticks for fixed values, a form per entry for objects, otherwise text (or paths) one per entry. */
6585
- async list(path13, key, node, field, current2) {
6585
+ async list(path14, key, node, field, current2) {
6586
6586
  const kind = field.element?.kind;
6587
6587
  if (kind === "enum") {
6588
6588
  const ticked = Array.isArray(current2) ? current2 : [];
6589
6589
  const picked = await this.app.list({
6590
- path: path13,
6590
+ path: path14,
6591
6591
  intro: node.description,
6592
6592
  multi: true,
6593
6593
  items: node.element.choices.map((v) => ({ value: v, label: String(v), checked: ticked.includes(v) }))
@@ -6595,17 +6595,17 @@ var ValueEditor = class {
6595
6595
  return picked.kind === "multi" ? { value: picked.values } : void 0;
6596
6596
  }
6597
6597
  if (kind === "object")
6598
- return new ObjectListEditor(this.app, path13, node, this, key).run(
6598
+ return new ObjectListEditor(this.app, path14, node, this, key).run(
6599
6599
  Array.isArray(current2) ? current2 : []
6600
6600
  );
6601
- return new StringListEditor(this.app, path13, node, this, key, field.element?.pathKind).run(
6601
+ return new StringListEditor(this.app, path14, node, this, key, field.element?.pathKind).run(
6602
6602
  Array.isArray(current2) ? current2 : []
6603
6603
  );
6604
6604
  }
6605
- async number(path13, key, node, current2) {
6605
+ async number(path14, key, node, current2) {
6606
6606
  const range = node.rangeText();
6607
6607
  const typed = await this.app.text({
6608
- path: path13,
6608
+ path: path14,
6609
6609
  label: Text.humanize(key[key.length - 1]),
6610
6610
  about: node.description ? [node.description] : [],
6611
6611
  hint: "A " + (node.integer ? "whole number" : "number") + (range ? ": " + range : "") + ".",
@@ -6616,9 +6616,9 @@ var ValueEditor = class {
6616
6616
  return typed === void 0 ? void 0 : { value: Number(typed) };
6617
6617
  }
6618
6618
  /** A folder or file on this PC: the path picker (typing a path still works). */
6619
- async folderOrFile(path13, key, node, current2, kind) {
6619
+ async folderOrFile(path14, key, node, current2, kind) {
6620
6620
  const picked = await askPath(this.app, {
6621
- path: path13,
6621
+ path: path14,
6622
6622
  title: "Choose " + (kind === "file" ? "the file" : "the folder") + ": " + Text.humanize(key[key.length - 1]),
6623
6623
  about: node.description ? [node.description] : [],
6624
6624
  kind,
@@ -6628,19 +6628,19 @@ var ValueEditor = class {
6628
6628
  });
6629
6629
  return picked === void 0 ? void 0 : { value: picked };
6630
6630
  }
6631
- async pick(path13, node, current2, values) {
6631
+ async pick(path14, node, current2, values) {
6632
6632
  const picked = await this.app.choose(
6633
- path13,
6633
+ path14,
6634
6634
  node.description ?? "",
6635
6635
  values.map((v) => ({ value: v, label: choiceLabel(v) })),
6636
6636
  current2
6637
6637
  );
6638
6638
  return picked === void 0 ? void 0 : { value: picked };
6639
6639
  }
6640
- async suggest(path13, key, node, current2, suggestions) {
6640
+ async suggest(path14, key, node, current2, suggestions) {
6641
6641
  const other = "@other";
6642
6642
  const picked = await this.app.choose(
6643
- path13,
6643
+ path14,
6644
6644
  node.description ?? "",
6645
6645
  [
6646
6646
  ...suggestions.map((s) => ({ value: s, label: s })),
@@ -6651,16 +6651,16 @@ var ValueEditor = class {
6651
6651
  if (picked === void 0) return void 0;
6652
6652
  if (picked !== other) return { value: picked };
6653
6653
  const typed = await this.app.text({
6654
- path: path13,
6654
+ path: path14,
6655
6655
  label: Text.humanize(key[key.length - 1]),
6656
6656
  initial: typeof current2 === "string" ? current2 : "",
6657
6657
  validate: (v) => node.check(v)
6658
6658
  });
6659
6659
  return typed === void 0 ? void 0 : { value: typed };
6660
6660
  }
6661
- async json(path13, key, node, current2) {
6661
+ async json(path14, key, node, current2) {
6662
6662
  const typed = await this.app.text({
6663
- path: path13,
6663
+ path: path14,
6664
6664
  label: Text.humanize(key[key.length - 1]) + " (JSON)",
6665
6665
  about: node.description ? [node.description] : [],
6666
6666
  initial: current2 === void 0 ? "" : JSON.stringify(current2),
@@ -6679,18 +6679,18 @@ var ValueEditor = class {
6679
6679
  // src/cli/menu/io-menu.ts
6680
6680
  async function ask(app, where, q, said) {
6681
6681
  const lines = [...said, ...q.lines ?? [], ..."problem" in q && q.problem ? [Theme.warn(q.problem)] : []];
6682
- const path13 = [...where];
6682
+ const path14 = [...where];
6683
6683
  switch (q.kind) {
6684
6684
  case "confirm": {
6685
6685
  if (!q.typed) return app.ask(q.title, lines, q.yes ?? "Yes", q.danger ?? false);
6686
- const typed = await app.text({ path: path13, label: 'Type "' + q.typed + '" to confirm', about: [q.title, ...lines] });
6686
+ const typed = await app.text({ path: path14, label: 'Type "' + q.typed + '" to confirm', about: [q.title, ...lines] });
6687
6687
  return typed?.trim().toLowerCase() === q.typed;
6688
6688
  }
6689
6689
  case "choose":
6690
- return app.choose(path13, [q.title, ...lines].join(" "), q.choices, q.initial);
6690
+ return app.choose(path14, [q.title, ...lines].join(" "), q.choices, q.initial);
6691
6691
  case "checklist": {
6692
6692
  const picked = await app.list({
6693
- path: path13,
6693
+ path: path14,
6694
6694
  intro: [q.title, ...lines],
6695
6695
  multi: true,
6696
6696
  items: q.choices.map((ch) => ({ ...ch, checked: q.checked?.includes(ch.value) ?? false }))
@@ -6699,7 +6699,7 @@ async function ask(app, where, q, said) {
6699
6699
  }
6700
6700
  case "path":
6701
6701
  return askPath(app, {
6702
- path: path13,
6702
+ path: path14,
6703
6703
  title: q.title,
6704
6704
  about: lines,
6705
6705
  kind: q.pathKind,
@@ -6709,7 +6709,7 @@ async function ask(app, where, q, said) {
6709
6709
  case "text":
6710
6710
  case "secret":
6711
6711
  return app.text({
6712
- path: path13,
6712
+ path: path14,
6713
6713
  label: q.title,
6714
6714
  about: lines,
6715
6715
  initial: q.kind === "text" ? q.initial : void 0,
@@ -7334,13 +7334,13 @@ var CommandForm = class {
7334
7334
  async run() {
7335
7335
  let focus;
7336
7336
  let notice;
7337
- const path13 = [Text.humanize(this.spec.name)];
7337
+ const path14 = [Text.humanize(this.spec.name)];
7338
7338
  for (; ; ) {
7339
7339
  const fields = this.fields();
7340
7340
  const hidden = this.hiddenCount();
7341
7341
  const line = commandLine(this.argv());
7342
7342
  const picked = await this.app.list({
7343
- path: path13,
7343
+ path: path14,
7344
7344
  intro: plainSummary(this.spec.summary),
7345
7345
  status: Theme.muted("$ ") + Theme.accent(line),
7346
7346
  items: [
@@ -7376,7 +7376,7 @@ var CommandForm = class {
7376
7376
  this.values.delete(this.id(field));
7377
7377
  continue;
7378
7378
  }
7379
- notice = await this.edit(field, path13);
7379
+ notice = await this.edit(field, path14);
7380
7380
  const isSwitch = field.kind === "json" || field.kind === "option" && field.spec.type === "boolean";
7381
7381
  if (field === fields[fields.length - 1] && !isSwitch && !hidden && !this.missing()) return this.argv();
7382
7382
  }
@@ -7412,7 +7412,7 @@ var CommandForm = class {
7412
7412
  return [];
7413
7413
  }
7414
7414
  /** Changes one field with the input that fits it. Returns a notice to show (when there is something to say). */
7415
- async edit(f, path13) {
7415
+ async edit(f, path14) {
7416
7416
  const id = this.id(f);
7417
7417
  const current2 = this.values.get(id);
7418
7418
  if (f.kind === "json" || f.kind === "option" && f.spec.type === "boolean") {
@@ -7421,9 +7421,9 @@ var CommandForm = class {
7421
7421
  }
7422
7422
  const label = f.kind === "extra" ? "Arguments" : f.kind === "arg" ? argLabel(f.spec) : optionLabel(f.spec);
7423
7423
  const about = f.kind === "extra" ? [] : [plainDescription(f.spec.description, this.actions())];
7424
- const here = [...path13, label];
7424
+ const here = [...path14, label];
7425
7425
  if (f.kind === "arg" && this.spec.name === "data" && f.spec.name === "targets") {
7426
- const picked = await this.dataTargets(path13);
7426
+ const picked = await this.dataTargets(path14);
7427
7427
  if (picked) this.values.set(id, picked);
7428
7428
  return void 0;
7429
7429
  }
@@ -7498,11 +7498,11 @@ var CommandForm = class {
7498
7498
  return f.kind === "option" ? optionProblem(f.spec, picked) ?? true : true;
7499
7499
  }
7500
7500
  /** Several folders or files (--script ...): a list to add to, change and remove from. */
7501
- async pathList(id, path13, about, kind) {
7501
+ async pathList(id, path14, about, kind) {
7502
7502
  const node = new SchemaNode(external_exports.array(external_exports.string()).describe(about.join(" ")));
7503
7503
  const edited = await new StringListEditor(
7504
7504
  this.app,
7505
- path13,
7505
+ path14,
7506
7506
  node,
7507
7507
  new ValueEditor(this.app),
7508
7508
  [],
@@ -7516,11 +7516,11 @@ var CommandForm = class {
7516
7516
  projectAction() {
7517
7517
  return ["remove", "include", "exclude"].includes(this.first());
7518
7518
  }
7519
- async projectFolder(id, path13, about) {
7519
+ async projectFolder(id, path14, about) {
7520
7520
  const known = new ProjectsService(this.ctx).list().projects.map((p) => p.folder);
7521
7521
  const current2 = this.values.get(id);
7522
7522
  const picked = await this.app.choose(
7523
- path13,
7523
+ path14,
7524
7524
  about.join(" "),
7525
7525
  [...known.map((v) => ({ value: v, label: v })), { value: OTHER, label: "Another folder\u2026" }],
7526
7526
  Array.isArray(current2) ? current2[0] : void 0
@@ -7530,7 +7530,7 @@ var CommandForm = class {
7530
7530
  this.set(id, [picked]);
7531
7531
  return;
7532
7532
  }
7533
- const folder = await askPath(this.app, { path: path13, title: "Choose the folder", about, kind: "dir" });
7533
+ const folder = await askPath(this.app, { path: path14, title: "Choose the folder", about, kind: "dir" });
7534
7534
  if (folder !== void 0) this.set(id, [folder]);
7535
7535
  }
7536
7536
  /** Nothing to pick from (no saved logins, no running session): say what to do, in the form, without an error. */
@@ -7540,17 +7540,17 @@ var CommandForm = class {
7540
7540
  );
7541
7541
  }
7542
7542
  /** `data clean` targets, ticked from a list with their sizes (never "all": that is typed on purpose). */
7543
- async dataTargets(path13) {
7543
+ async dataTargets(path14) {
7544
7544
  const rows = new DataService(this.ctx).entries().flatMap((e) => {
7545
7545
  const target = cleanTargetOf(e);
7546
7546
  return target ? [{ target, bytes: e.bytes }] : [];
7547
7547
  });
7548
7548
  if (!rows.length) {
7549
- await this.app.message({ path: path13, title: "Nothing is saved yet", lines: ["There is nothing to delete."] });
7549
+ await this.app.message({ path: path14, title: "Nothing is saved yet", lines: ["There is nothing to delete."] });
7550
7550
  return void 0;
7551
7551
  }
7552
7552
  const picked = await this.app.list({
7553
- path: [...path13, "Delete what"],
7553
+ path: [...path14, "Delete what"],
7554
7554
  intro: "Tick what to delete (space), then Enter. You confirm once more before anything is deleted.",
7555
7555
  multi: true,
7556
7556
  items: rows.map((r) => ({ value: r.target, label: r.target, hint: humanBytes(r.bytes) }))
@@ -8830,8 +8830,8 @@ var SettingsPage = class extends ListPage {
8830
8830
  }
8831
8831
  try {
8832
8832
  const now = current(this.file, this.draft, setting.key, this.file.userConfig());
8833
- const path13 = ["Settings", ...setting.key.slice(0, -1).map(nameOf), labelOf(setting.key)];
8834
- const edited = await this.editor.edit(path13, setting.key, setting.node, now);
8833
+ const path14 = ["Settings", ...setting.key.slice(0, -1).map(nameOf), labelOf(setting.key)];
8834
+ const edited = await this.editor.edit(path14, setting.key, setting.node, now);
8835
8835
  if (edited) this.stage(setting.key, edited.value);
8836
8836
  } catch (e) {
8837
8837
  return { notice: Theme.error(Theme.glyph.cross + " " + errMsg(e)) };
@@ -10306,6 +10306,23 @@ function withoutConfig(argv) {
10306
10306
  }
10307
10307
 
10308
10308
  // src/cli/report.ts
10309
+ import fs8 from "node:fs";
10310
+ import os from "node:os";
10311
+ import path12 from "node:path";
10312
+ var UNEXPECTED_LOG = path12.join(os.tmpdir(), "windows-development-sandbox-errors.log");
10313
+ var UNEXPECTED_LOG_MAX = 1024 * 1024;
10314
+ function recordUnexpected(e, kind) {
10315
+ const text2 = (/* @__PURE__ */ new Date()).toISOString() + " " + kind + " (pid " + process.pid + ", " + process.argv.slice(2).join(" ") + ")\n" + (e instanceof Error && e.stack ? e.stack : errMsg(e)) + "\n\n";
10316
+ try {
10317
+ if (fs8.existsSync(UNEXPECTED_LOG) && fs8.statSync(UNEXPECTED_LOG).size > UNEXPECTED_LOG_MAX)
10318
+ fs8.rmSync(UNEXPECTED_LOG, { force: true });
10319
+ fs8.appendFileSync(UNEXPECTED_LOG, text2);
10320
+ } catch {
10321
+ }
10322
+ console.error(
10323
+ c.red("Unexpected error (kept running): ") + plainText(errMsg(e)) + c.dim(" Details: " + UNEXPECTED_LOG)
10324
+ );
10325
+ }
10309
10326
  function report(e) {
10310
10327
  if (e instanceof CommanderError)
10311
10328
  return ["commander.helpDisplayed", "commander.help", "commander.version"].includes(e.code) ? 0 : e.exitCode || 1;
@@ -10332,7 +10349,7 @@ function versionText(argv, packageRoot) {
10332
10349
  }
10333
10350
 
10334
10351
  // src/cli/index.ts
10335
- var entry = path12.join(PACKAGE_ROOT, "dist", "bin", "agent-sandbox.js");
10352
+ var entry = path13.join(PACKAGE_ROOT, "dist", "bin", "agent-sandbox.js");
10336
10353
  function failOnTypo(word, agents) {
10337
10354
  const names = [...COMMANDS.filter((c2) => !c2.hidden).map((c2) => c2.name), ...agents];
10338
10355
  const hint = closest(word, names);
@@ -10417,6 +10434,8 @@ async function main(rawArgv, preset = {}) {
10417
10434
  }
10418
10435
  function run(argv, preset) {
10419
10436
  dropInheritedModulePath();
10437
+ process.on("unhandledRejection", (e) => recordUnexpected(e, "unhandled rejection"));
10438
+ process.on("uncaughtException", (e) => recordUnexpected(e, "uncaught exception"));
10420
10439
  main(argv, preset).then(
10421
10440
  (code) => {
10422
10441
  process.exitCode = code;