@neta-art/cohub-cli 10.29.1 → 10.31.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 (87) hide show
  1. package/dist/board-gpu/page.js +3011 -133
  2. package/dist/bootstrap.js +2 -4
  3. package/dist/build.json +1 -1
  4. package/dist/chunks/FilterPipe.js +145 -269
  5. package/dist/chunks/about.js +2 -3
  6. package/dist/chunks/app-realtime.js +113 -115
  7. package/dist/chunks/app-realtime2.js +1 -2
  8. package/dist/chunks/app-ref.js +4 -5
  9. package/dist/chunks/apps.js +8 -14
  10. package/dist/chunks/auth.js +1 -2
  11. package/dist/chunks/avatar.js +2 -4
  12. package/dist/chunks/binary-pins.js +1 -2
  13. package/dist/chunks/board-export-resources.js +55 -12
  14. package/dist/chunks/board-export.js +26 -21
  15. package/dist/chunks/board-export2.js +1 -2
  16. package/dist/chunks/board-kernel.js +2672 -1623
  17. package/dist/chunks/board-kernel2.js +2 -2
  18. package/dist/chunks/board-model.js +970 -0
  19. package/dist/chunks/board-profile.js +4 -5
  20. package/dist/chunks/board-simulate.js +6 -6
  21. package/dist/chunks/board-time.js +1 -2
  22. package/dist/chunks/boards.js +547 -23
  23. package/dist/chunks/browserAll.js +18 -35
  24. package/dist/chunks/channels.js +1 -2
  25. package/dist/chunks/client.js +637 -713
  26. package/dist/chunks/command-input.js +1 -2
  27. package/dist/chunks/commander.js +16 -22
  28. package/dist/chunks/cron-jobs.js +2 -3
  29. package/dist/chunks/daemon.js +18 -4
  30. package/dist/chunks/daemon2.js +1 -2
  31. package/dist/chunks/desktop.js +2 -3
  32. package/dist/chunks/endpoint-options.js +1 -2
  33. package/dist/chunks/env-proxy.js +4 -5
  34. package/dist/chunks/environment.js +2 -4
  35. package/dist/chunks/feedback.js +3 -4
  36. package/dist/chunks/generations.js +3 -4
  37. package/dist/chunks/host.js +1 -2
  38. package/dist/chunks/http-put.js +1 -2
  39. package/dist/chunks/id.js +77 -928
  40. package/dist/chunks/init.js +7 -12
  41. package/dist/chunks/install.js +142 -138
  42. package/dist/chunks/launch.js +4 -6
  43. package/dist/chunks/lexer.js +226 -66
  44. package/dist/chunks/local-media.js +1 -2
  45. package/dist/chunks/me.js +1 -2
  46. package/dist/chunks/media.js +1 -2
  47. package/dist/chunks/{themes.js → model-clips.js} +395 -43
  48. package/dist/chunks/models.js +3 -5
  49. package/dist/chunks/operands.js +1 -2
  50. package/dist/chunks/package-paths.js +1 -2
  51. package/dist/chunks/policy.js +1 -2
  52. package/dist/chunks/preferences.js +1 -2
  53. package/dist/chunks/profile.js +2 -3
  54. package/dist/chunks/prompts.js +1 -2
  55. package/dist/chunks/public.js +1 -2
  56. package/dist/chunks/public2.js +3 -4
  57. package/dist/chunks/references.js +3 -3
  58. package/dist/chunks/referrals.js +1 -2
  59. package/dist/chunks/rolldown-runtime.js +2 -3
  60. package/dist/chunks/rooms-connect.js +1 -2
  61. package/dist/chunks/rooms-connect2.js +1 -2
  62. package/dist/chunks/rooms-rtc.js +4 -6
  63. package/dist/chunks/rooms.js +2 -3
  64. package/dist/chunks/run.js +2 -3
  65. package/dist/chunks/runtime.js +6 -12
  66. package/dist/chunks/runtime2.js +2 -3
  67. package/dist/chunks/runtimes.js +1 -2
  68. package/dist/chunks/safe-remote-image.js +1 -2
  69. package/dist/chunks/schemas.js +58 -43
  70. package/dist/chunks/search.js +3 -3
  71. package/dist/chunks/self-update.js +4 -5
  72. package/dist/chunks/serve.js +11 -25
  73. package/dist/chunks/session-status.js +1 -2
  74. package/dist/chunks/skills.js +1 -2
  75. package/dist/chunks/spaces.js +26 -45
  76. package/dist/chunks/src.js +5 -9
  77. package/dist/chunks/supervisor.js +16 -28
  78. package/dist/chunks/supervisor2.js +1 -2
  79. package/dist/chunks/tasks.js +1 -2
  80. package/dist/chunks/user-lists.js +1 -2
  81. package/dist/chunks/version.js +1 -2
  82. package/dist/chunks/version2.js +1 -2
  83. package/dist/chunks/version3.js +3 -4
  84. package/dist/chunks/web.js +1 -2
  85. package/dist/runtime/native/pi-extension.js +1 -2
  86. package/dist/runtime/worker.js +2 -3
  87. package/package.json +11 -10
@@ -17,7 +17,7 @@ import { pipeline } from "node:stream/promises";
17
17
  import { promisify, stripVTControlCharacters } from "node:util";
18
18
  import { StringDecoder } from "node:string_decoder";
19
19
  import { createZstdDecompress } from "node:zlib";
20
- //#region ../protocol/src/runtime/projection.ts
20
+ // ../protocol/dist/runtime/projection.js
21
21
  const DEFAULT_TIMESTAMP = "1970-01-01T00:00:00.000Z";
22
22
  const asMeta = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
23
23
  const safeId = (value) => value.replace(/[^A-Za-z0-9_-]/g, "_");
@@ -466,8 +466,7 @@ function serializeProjectionRecords(records) {
466
466
  function fingerprintProjectionTurns(turns) {
467
467
  return `${turns.length}:${fingerprint(turns)}`;
468
468
  }
469
- //#endregion
470
- //#region src/runtime/diagnostics.ts
469
+ // src/runtime/diagnostics.ts
471
470
  const DEFAULT_LOG_FLUSH_INTERVAL_MS = 250;
472
471
  const MAX_PENDING_LOG_BYTES = 4194304;
473
472
  const DEFAULT_MAX_LOG_FILE_BYTES = 8388608;
@@ -824,8 +823,7 @@ var RuntimeDiagnosticReader = class {
824
823
  async function readRuntimeDiagnosticEvents(root, options = {}) {
825
824
  return new RuntimeDiagnosticReader(root).read(options);
826
825
  }
827
- //#endregion
828
- //#region src/runtime/process-group.ts
826
+ // src/runtime/process-group.ts
829
827
  var ProcessCleanupUncertainError = class extends Error {};
830
828
  /** A member that can still execute code. Zombies cannot, so they never block cleanup. */
831
829
  const executable = (member) => member.state !== "Z" && member.state !== "X";
@@ -1016,8 +1014,7 @@ async function stopProcessGroup(pid) {
1016
1014
  throw new ProcessCleanupUncertainError(`Tool process cleanup could not be confirmed; execution remains unresolved (${cause instanceof Error ? cause.message : String(cause)})`, { cause });
1017
1015
  }
1018
1016
  }
1019
- //#endregion
1020
- //#region src/runtime/json-rpc.ts
1017
+ // src/runtime/json-rpc.ts
1021
1018
  const record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
1022
1019
  /** LF framing without rescanning the accumulated record on every pipe chunk. */
1023
1020
  var JsonLineDecoder = class {
@@ -1245,8 +1242,7 @@ var JsonRpcProcess = class {
1245
1242
  await this.closed;
1246
1243
  }
1247
1244
  };
1248
- //#endregion
1249
- //#region src/runtime/harnesses/process.ts
1245
+ // src/runtime/harnesses/process.ts
1250
1246
  const text$2 = (value) => typeof value === "string" ? value : "";
1251
1247
  const array = (value) => Array.isArray(value) ? value : [];
1252
1248
  const missing$4 = (error) => error?.code === "ENOENT";
@@ -1331,8 +1327,7 @@ async function closeHost(host, executionError) {
1331
1327
  };
1332
1328
  });
1333
1329
  }
1334
- //#endregion
1335
- //#region src/runtime/model-catalog.ts
1330
+ // src/runtime/model-catalog.ts
1336
1331
  const thinkingLevel = (value) => isModelThinkingLevel(value) ? value : void 0;
1337
1332
  /**
1338
1333
  * Publish only picker metadata, never provider credentials or request configuration.
@@ -1430,15 +1425,13 @@ function codexModelCatalog(configResponse, entries) {
1430
1425
  });
1431
1426
  return models;
1432
1427
  }
1433
- //#endregion
1434
- //#region src/runtime/native/pi-extension.ts
1428
+ // src/runtime/native/pi-extension.ts
1435
1429
  /** Runtime directory shared with the CLI; one socket per bound directory, hashed to stay short. */
1436
1430
  function controlSocketPath(root) {
1437
1431
  const state = process.env.XDG_STATE_HOME?.trim() || join(homedir(), ".local", "state");
1438
1432
  return join(state, "cohub", "control", `${createHash("sha256").update(root).digest("hex").slice(0, 32)}.sock`);
1439
1433
  }
1440
- //#endregion
1441
- //#region src/runtime/native/pi-link.ts
1434
+ // src/runtime/native/pi-link.ts
1442
1435
  const MAX_LINE_BYTES = 8388608;
1443
1436
  const REQUEST_TIMEOUT_MS$1 = 12e5;
1444
1437
  /**
@@ -1702,8 +1695,7 @@ var PiLink = class {
1702
1695
  return live;
1703
1696
  }
1704
1697
  };
1705
- //#endregion
1706
- //#region src/runtime/native/archive.ts
1698
+ // src/runtime/native/archive.ts
1707
1699
  /** A structurally unrestorable archive (e.g. its history reference is not carried); never retried. */
1708
1700
  var ArchiveNotRestorableError = class extends Error {
1709
1701
  constructor(message) {
@@ -1840,8 +1832,7 @@ async function copyNativeArchive(input) {
1840
1832
  await rm(temporary, { force: true });
1841
1833
  }
1842
1834
  }
1843
- //#endregion
1844
- //#region src/runtime/codex-usage.ts
1835
+ // src/runtime/codex-usage.ts
1845
1836
  const fields = [
1846
1837
  "inputTokens",
1847
1838
  "outputTokens",
@@ -1864,8 +1855,7 @@ function codexUsage(total) {
1864
1855
  totalTokens: total.totalTokens
1865
1856
  };
1866
1857
  }
1867
- //#endregion
1868
- //#region src/runtime/native/translate.ts
1858
+ // src/runtime/native/translate.ts
1869
1859
  const text$1 = (value) => typeof value === "string" ? value : "";
1870
1860
  const list$1 = (value) => Array.isArray(value) ? value : [];
1871
1861
  const hasToolCall = (content, id) => content.some((block) => block.type === "tool_use" && block.id === id);
@@ -2312,8 +2302,7 @@ var LiveProgress = class {
2312
2302
  return this.messages[ordinal];
2313
2303
  }
2314
2304
  };
2315
- //#endregion
2316
- //#region src/runtime/native/transcript.ts
2305
+ // src/runtime/native/transcript.ts
2317
2306
  const text = (value) => typeof value === "string" ? value : "";
2318
2307
  const list = (value) => Array.isArray(value) ? value : [];
2319
2308
  const iso = (value) => {
@@ -3031,8 +3020,7 @@ async function readCodexTranscript(path, options) {
3031
3020
  lineageRolloutIds: files.map((file) => file.segment.rolloutId)
3032
3021
  };
3033
3022
  }
3034
- //#endregion
3035
- //#region src/runtime/harnesses/pi.ts
3023
+ // src/runtime/harnesses/pi.ts
3036
3024
  /** A stop request that the harness does not honour within this long ends its private process. */
3037
3025
  const ABORT_ESCALATION_MS$3 = 5e3;
3038
3026
  /** Pause before asking a busy Pi again, so a Turn that is starting has reported itself. */
@@ -3316,8 +3304,7 @@ const piHarness = {
3316
3304
  marksCohubTurns: true
3317
3305
  }
3318
3306
  };
3319
- //#endregion
3320
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/constants.js
3307
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/constants.js
3321
3308
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3322
3309
  const BINARY_TYPES = [
3323
3310
  "nodebuffer",
@@ -3339,9 +3326,9 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3339
3326
  NOOP: () => {}
3340
3327
  };
3341
3328
  }));
3342
- //#endregion
3343
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/buffer-util.js
3329
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/buffer-util.js
3344
3330
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3331
+ const { websocketMask, websocketUnmask } = __require("http");
3345
3332
  const { EMPTY_BUFFER } = require_constants();
3346
3333
  const FastBuffer = Buffer[Symbol.species];
3347
3334
  /**
@@ -3426,8 +3413,16 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3426
3413
  toBuffer,
3427
3414
  unmask: _unmask
3428
3415
  };
3429
- /* istanbul ignore else */
3430
- if (!process.env.WS_NO_BUFFER_UTIL) try {
3416
+ if (websocketMask) {
3417
+ module.exports.mask = function(source, mask, output, offset, length) {
3418
+ if (length < 24) _mask(source, mask, output, offset, length);
3419
+ else websocketMask(source, mask, output, offset, length);
3420
+ };
3421
+ module.exports.unmask = function(buffer, mask) {
3422
+ if (buffer.length < 24) _unmask(buffer, mask);
3423
+ else websocketUnmask(buffer, mask);
3424
+ };
3425
+ } else if (!process.env.WS_NO_BUFFER_UTIL) try {
3431
3426
  const bufferUtil = __require("bufferutil");
3432
3427
  module.exports.mask = function(source, mask, output, offset, length) {
3433
3428
  if (length < 48) _mask(source, mask, output, offset, length);
@@ -3439,8 +3434,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3439
3434
  };
3440
3435
  } catch (e) {}
3441
3436
  }));
3442
- //#endregion
3443
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/limiter.js
3437
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/limiter.js
3444
3438
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3445
3439
  const kDone = Symbol("kDone");
3446
3440
  const kRun = Symbol("kRun");
@@ -3460,7 +3454,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3460
3454
  this.pending--;
3461
3455
  this[kRun]();
3462
3456
  };
3463
- this.concurrency = concurrency || Infinity;
3457
+ this.concurrency = concurrency || 1e400;
3464
3458
  this.jobs = [];
3465
3459
  this.pending = 0;
3466
3460
  }
@@ -3490,8 +3484,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3490
3484
  };
3491
3485
  module.exports = Limiter;
3492
3486
  }));
3493
- //#endregion
3494
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/permessage-deflate.js
3487
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/permessage-deflate.js
3495
3488
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3496
3489
  const zlib = __require("zlib");
3497
3490
  const bufferUtil = require_buffer_util();
@@ -3826,8 +3819,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
3826
3819
  this[kCallback](err);
3827
3820
  }
3828
3821
  }));
3829
- //#endregion
3830
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/validation.js
3822
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/validation.js
3831
3823
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3832
3824
  const { isUtf8 } = __require("buffer");
3833
3825
  const { hasBlob } = require_constants();
@@ -4022,8 +4014,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4022
4014
  };
4023
4015
  } catch (e) {}
4024
4016
  }));
4025
- //#endregion
4026
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/receiver.js
4017
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/receiver.js
4027
4018
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4028
4019
  const { Writable } = __require("stream");
4029
4020
  const PerMessageDeflate = require_permessage_deflate();
@@ -4323,6 +4314,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4323
4314
  data = this.consume(this._payloadLength);
4324
4315
  if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) unmask(data, this._mask);
4325
4316
  }
4317
+ this._mask = void 0;
4326
4318
  if (this._opcode > 7) {
4327
4319
  this.controlMessage(data, cb);
4328
4320
  return;
@@ -4485,10 +4477,9 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4485
4477
  };
4486
4478
  module.exports = Receiver;
4487
4479
  }));
4488
- //#endregion
4489
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/sender.js
4480
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/sender.js
4490
4481
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4491
- const { Duplex: Duplex$3 } = __require("stream");
4482
+ const { Duplex } = __require("stream");
4492
4483
  const { randomFillSync } = __require("crypto");
4493
4484
  const { types: { isUint8Array } } = __require("util");
4494
4485
  const PerMessageDeflate = require_permessage_deflate();
@@ -4599,12 +4590,13 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4599
4590
  target[2] = target[3] = 0;
4600
4591
  target.writeUIntBE(dataLength, 4, 6);
4601
4592
  }
4602
- if (!options.mask) return [target, data];
4593
+ if (!options.mask) return dataLength ? [target, data] : [target];
4603
4594
  target[1] |= 128;
4604
4595
  target[offset - 4] = mask[0];
4605
4596
  target[offset - 3] = mask[1];
4606
4597
  target[offset - 2] = mask[2];
4607
4598
  target[offset - 1] = mask[3];
4599
+ if (!dataLength) return [target];
4608
4600
  if (skipMasking) return [target, data];
4609
4601
  if (merge) {
4610
4602
  applyMask(data, mask, target, offset, dataLength);
@@ -4983,8 +4975,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4983
4975
  sender.onerror(err);
4984
4976
  }
4985
4977
  }));
4986
- //#endregion
4987
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/event-target.js
4978
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/event-target.js
4988
4979
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4989
4980
  const { kForOnEventAttribute, kListener } = require_constants();
4990
4981
  const kCode = Symbol("kCode");
@@ -5214,8 +5205,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5214
5205
  else listener.call(thisArg, event);
5215
5206
  }
5216
5207
  }));
5217
- //#endregion
5218
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/extension.js
5208
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/extension.js
5219
5209
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5220
5210
  const { tokenChars } = require_validation();
5221
5211
  /**
@@ -5360,17 +5350,17 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5360
5350
  parse
5361
5351
  };
5362
5352
  }));
5363
- //#endregion
5364
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/websocket.js
5353
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket.js
5365
5354
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5366
- const EventEmitter$1 = __require("events");
5355
+ const EventEmitter = __require("events");
5367
5356
  const https = __require("https");
5368
- const http$1 = __require("http");
5357
+ const http = __require("http");
5369
5358
  const net = __require("net");
5359
+ const querystring = __require("querystring");
5370
5360
  const tls = __require("tls");
5371
- const { randomBytes: randomBytes$1, createHash: createHash$2 } = __require("crypto");
5372
- const { Duplex: Duplex$2, Readable: Readable$1 } = __require("stream");
5373
- const { URL: URL$1 } = __require("url");
5361
+ const { randomBytes, createHash } = __require("crypto");
5362
+ const { Duplex, Readable } = __require("stream");
5363
+ const { URL } = __require("url");
5374
5364
  const PerMessageDeflate = require_permessage_deflate();
5375
5365
  const Receiver = require_receiver();
5376
5366
  const Sender = require_sender();
@@ -5393,7 +5383,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5393
5383
  *
5394
5384
  * @extends EventEmitter
5395
5385
  */
5396
- var WebSocket = class WebSocket extends EventEmitter$1 {
5386
+ var WebSocket = class WebSocket extends EventEmitter {
5397
5387
  /**
5398
5388
  * Create a new `WebSocket`.
5399
5389
  *
@@ -5421,19 +5411,27 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5421
5411
  this._bufferedAmount = 0;
5422
5412
  this._isServer = false;
5423
5413
  this._redirects = 0;
5424
- if (protocols === void 0) protocols = [];
5425
- else if (!Array.isArray(protocols)) {
5414
+ if (protocols === void 0) {
5415
+ if (!options || options.protocols === void 0) protocols = [];
5416
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
5417
+ else protocols = [options.protocols];
5418
+ } else if (!Array.isArray(protocols)) {
5426
5419
  if (typeof protocols === "object" && protocols !== null) {
5427
5420
  options = protocols;
5428
- protocols = [];
5421
+ if (options.protocols === void 0) protocols = [];
5422
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
5423
+ else protocols = [options.protocols];
5429
5424
  } else protocols = [protocols];
5430
5425
  }
5431
- initAsClient(this, address, protocols, options);
5432
- } else {
5433
- this._autoPong = options.autoPong;
5434
- this._closeTimeout = options.closeTimeout;
5435
- this._isServer = true;
5426
+ options = initAsClient(this, address, protocols, options);
5427
+ } else this._isServer = true;
5428
+ if (options.autoPong) {
5429
+ this._autoPong = true;
5430
+ this._autoPongComplete = () => autoPongComplete(this);
5431
+ this._pendingAutoPongs = 0;
5432
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
5436
5433
  }
5434
+ this._closeTimeout = options.closeTimeout;
5437
5435
  }
5438
5436
  /**
5439
5437
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -5615,12 +5613,12 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5615
5613
  if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) this._socket.end();
5616
5614
  return;
5617
5615
  }
5618
- this._readyState = WebSocket.CLOSING;
5619
5616
  this._sender.close(code, data, !this._isServer, (err) => {
5620
5617
  if (err) return;
5621
5618
  this._closeFrameSent = true;
5622
5619
  if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) this._socket.end();
5623
5620
  });
5621
+ this._readyState = WebSocket.CLOSING;
5624
5622
  setCloseTimer(this);
5625
5623
  }
5626
5624
  /**
@@ -5874,6 +5872,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5874
5872
  * fragments
5875
5873
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
5876
5874
  * size
5875
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
5876
+ * pending automatic pongs
5877
5877
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
5878
5878
  * allowed
5879
5879
  * @param {String} [options.origin] Value of the `Origin` or
@@ -5884,6 +5884,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5884
5884
  * `Sec-WebSocket-Version` header
5885
5885
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
5886
5886
  * not to skip UTF-8 validation for text and close messages
5887
+ * @return {Object} The resolved options object used for initialization
5887
5888
  * @private
5888
5889
  */
5889
5890
  function initAsClient(websocket, address, protocols, options) {
@@ -5895,6 +5896,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5895
5896
  maxBufferedChunks: 262144,
5896
5897
  maxFragments: 16384,
5897
5898
  maxPayload: 104857600,
5899
+ maxPendingAutoPongs: 60,
5898
5900
  skipUTF8Validation: false,
5899
5901
  perMessageDeflate: true,
5900
5902
  followRedirects: false,
@@ -5903,24 +5905,25 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5903
5905
  socketPath: void 0,
5904
5906
  hostname: void 0,
5905
5907
  protocol: void 0,
5908
+ protocols: void 0,
5906
5909
  timeout: void 0,
5907
5910
  method: "GET",
5908
5911
  host: void 0,
5909
5912
  path: void 0,
5910
5913
  port: void 0
5911
5914
  };
5912
- websocket._autoPong = opts.autoPong;
5913
- websocket._closeTimeout = opts.closeTimeout;
5914
5915
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
5915
5916
  let parsedUrl;
5916
- if (address instanceof URL$1) parsedUrl = address;
5917
+ if (address instanceof URL) parsedUrl = address;
5917
5918
  else try {
5918
- parsedUrl = new URL$1(address);
5919
+ parsedUrl = new URL(address);
5919
5920
  } catch {
5920
5921
  throw new SyntaxError(`Invalid URL: ${address}`);
5921
5922
  }
5922
- if (parsedUrl.protocol === "http:") parsedUrl.protocol = "ws:";
5923
- else if (parsedUrl.protocol === "https:") parsedUrl.protocol = "wss:";
5923
+ if (parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:") {
5924
+ parsedUrl = new URL(parsedUrl);
5925
+ parsedUrl.protocol = parsedUrl.protocol === "http:" ? "ws:" : "wss:";
5926
+ }
5924
5927
  websocket._url = parsedUrl.href;
5925
5928
  const isSecure = parsedUrl.protocol === "wss:";
5926
5929
  const isIpcUrl = parsedUrl.protocol === "ws+unix:";
@@ -5937,8 +5940,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5937
5940
  }
5938
5941
  }
5939
5942
  const defaultPort = isSecure ? 443 : 80;
5940
- const key = randomBytes$1(16).toString("base64");
5941
- const request = isSecure ? https.request : http$1.request;
5943
+ const key = randomBytes(16).toString("base64");
5944
+ const request = isSecure ? https.request : http.request;
5942
5945
  const protocolSet = /* @__PURE__ */ new Set();
5943
5946
  let perMessageDeflate;
5944
5947
  opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
@@ -5973,11 +5976,16 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5973
5976
  if (opts.protocolVersion < 13) opts.headers["Sec-WebSocket-Origin"] = opts.origin;
5974
5977
  else opts.headers.Origin = opts.origin;
5975
5978
  }
5976
- if (parsedUrl.username || parsedUrl.password) opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
5979
+ if (parsedUrl.username || parsedUrl.password) opts.auth = `${querystring.unescape(parsedUrl.username)}:${querystring.unescape(parsedUrl.password)}`;
5977
5980
  if (isIpcUrl) {
5978
- const parts = opts.path.split(":");
5979
- opts.socketPath = parts[0];
5980
- opts.path = parts[1];
5981
+ const i = opts.path.indexOf(":");
5982
+ if (i === -1) {
5983
+ opts.socketPath = opts.path;
5984
+ opts.path = "";
5985
+ } else {
5986
+ opts.socketPath = opts.path.slice(0, i);
5987
+ opts.path = opts.path.slice(i + 1);
5988
+ }
5981
5989
  }
5982
5990
  let req;
5983
5991
  if (opts.followRedirects) {
@@ -6023,7 +6031,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6023
6031
  req.abort();
6024
6032
  let addr;
6025
6033
  try {
6026
- addr = new URL$1(location, address);
6034
+ addr = new URL(location, address);
6027
6035
  } catch (e) {
6028
6036
  emitErrorAndClose(websocket, /* @__PURE__ */ new SyntaxError(`Invalid URL: ${location}`));
6029
6037
  return;
@@ -6040,7 +6048,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6040
6048
  abortHandshake(websocket, socket, "Invalid Upgrade header");
6041
6049
  return;
6042
6050
  }
6043
- const digest = createHash$2("sha1").update(key + GUID).digest("base64");
6051
+ const digest = createHash("sha1").update(key + GUID).digest("base64");
6044
6052
  if (res.headers["sec-websocket-accept"] !== digest) {
6045
6053
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
6046
6054
  return;
@@ -6093,6 +6101,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6093
6101
  });
6094
6102
  if (opts.finishRequest) opts.finishRequest(req, websocket);
6095
6103
  else req.end();
6104
+ return opts;
6096
6105
  }
6097
6106
  /**
6098
6107
  * Emit the `'error'` and `'close'` events.
@@ -6184,8 +6193,12 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6184
6193
  function receiverOnConclude(code, reason) {
6185
6194
  const websocket = this[kWebSocket];
6186
6195
  websocket._closeFrameReceived = true;
6187
- websocket._closeMessage = reason;
6188
6196
  websocket._closeCode = code;
6197
+ if (reason.length === 0) websocket._closeMessage = EMPTY_BUFFER;
6198
+ else {
6199
+ websocket._closeMessage = Buffer.allocUnsafeSlow(reason.length);
6200
+ websocket._closeMessage.set(reason);
6201
+ }
6189
6202
  if (websocket._socket[kWebSocket] === void 0) return;
6190
6203
  websocket._socket.removeListener("data", socketOnData);
6191
6204
  process.nextTick(resume, websocket._socket);
@@ -6245,10 +6258,25 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6245
6258
  */
6246
6259
  function receiverOnPing(data) {
6247
6260
  const websocket = this[kWebSocket];
6248
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
6261
+ if (websocket._autoPong && websocket.readyState === WebSocket.OPEN) {
6262
+ if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) websocket.terminate();
6263
+ else {
6264
+ websocket._pendingAutoPongs++;
6265
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
6266
+ }
6267
+ }
6249
6268
  websocket.emit("ping", data);
6250
6269
  }
6251
6270
  /**
6271
+ * The callback for automatic pong responses.
6272
+ *
6273
+ * @param {WebSocket} websocket The WebSocket instance
6274
+ * @private
6275
+ */
6276
+ function autoPongComplete(websocket) {
6277
+ websocket._pendingAutoPongs--;
6278
+ }
6279
+ /**
6252
6280
  * The listener of the `Receiver` `'pong'` event.
6253
6281
  *
6254
6282
  * @param {Buffer} data The data included in the pong frame
@@ -6353,11 +6381,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6353
6381
  }
6354
6382
  }
6355
6383
  }));
6356
- //#endregion
6357
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/stream.js
6384
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/stream.js
6358
6385
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6359
6386
  require_websocket();
6360
- const { Duplex: Duplex$1 } = __require("stream");
6387
+ const { Duplex } = __require("stream");
6361
6388
  /**
6362
6389
  * Emits the `'close'` event on a stream.
6363
6390
  *
@@ -6396,7 +6423,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6396
6423
  */
6397
6424
  function createWebSocketStream(ws, options) {
6398
6425
  let terminateOnDestroy = true;
6399
- const duplex = new Duplex$1({
6426
+ const duplex = new Duplex({
6400
6427
  ...options,
6401
6428
  autoDestroy: false,
6402
6429
  emitClose: false,
@@ -6469,8 +6496,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6469
6496
  }
6470
6497
  module.exports = createWebSocketStream;
6471
6498
  }));
6472
- //#endregion
6473
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/subprotocol.js
6499
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/subprotocol.js
6474
6500
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6475
6501
  const { tokenChars } = require_validation();
6476
6502
  /**
@@ -6508,13 +6534,12 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6508
6534
  }
6509
6535
  module.exports = { parse };
6510
6536
  }));
6511
- //#endregion
6512
- //#region ../../node_modules/.pnpm/ws@8.21.3/node_modules/ws/lib/websocket-server.js
6537
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket-server.js
6513
6538
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6514
6539
  const EventEmitter = __require("events");
6515
6540
  const http = __require("http");
6516
6541
  const { Duplex } = __require("stream");
6517
- const { createHash: createHash$1 } = __require("crypto");
6542
+ const { createHash } = __require("crypto");
6518
6543
  const extension = require_extension();
6519
6544
  const PerMessageDeflate = require_permessage_deflate();
6520
6545
  const subprotocol = require_subprotocol();
@@ -6554,6 +6579,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
6554
6579
  * fragments
6555
6580
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
6556
6581
  * size
6582
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
6583
+ * pending automatic pongs
6557
6584
  * @param {Boolean} [options.noServer=false] Enable no server mode
6558
6585
  * @param {String} [options.path] Accept only connections matching this path
6559
6586
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -6576,6 +6603,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
6576
6603
  maxBufferedChunks: 262144,
6577
6604
  maxFragments: 16384,
6578
6605
  maxPayload: 104857600,
6606
+ maxPendingAutoPongs: 60,
6579
6607
  skipUTF8Validation: false,
6580
6608
  perMessageDeflate: false,
6581
6609
  handleProtocols: null,
@@ -6784,7 +6812,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
6784
6812
  "HTTP/1.1 101 Switching Protocols",
6785
6813
  "Upgrade: websocket",
6786
6814
  "Connection: Upgrade",
6787
- `Sec-WebSocket-Accept: ${createHash$1("sha1").update(key + GUID).digest("base64")}`
6815
+ `Sec-WebSocket-Accept: ${createHash("sha1").update(key + GUID).digest("base64")}`
6788
6816
  ];
6789
6817
  const ws = new this.options.WebSocket(null, void 0, this.options);
6790
6818
  if (protocols.size) {
@@ -6904,8 +6932,7 @@ require_subprotocol();
6904
6932
  var import_websocket = /* @__PURE__ */ __toESM(require_websocket(), 1);
6905
6933
  require_websocket_server();
6906
6934
  var wrapper_default = import_websocket.default;
6907
- //#endregion
6908
- //#region src/runtime/native/version.ts
6935
+ // src/runtime/native/version.ts
6909
6936
  /** A harness binary's own version, or `null` when it cannot say. */
6910
6937
  async function harnessVersion(binary) {
6911
6938
  const { stdout } = await Promise.resolve().then(() => promisify(execFile)(...harnessCommand(binary, ["--version"], process.cwd()), {
@@ -6926,8 +6953,7 @@ function atLeast(version, minimum) {
6926
6953
  return true;
6927
6954
  }
6928
6955
  const formatVersion = (version) => version?.join(".") ?? "(unknown version)";
6929
- //#endregion
6930
- //#region src/runtime/native/codex-link.ts
6956
+ // src/runtime/native/codex-link.ts
6931
6957
  /** First Codex release whose terminal client attaches to a shared app-server by default. */
6932
6958
  const CODEX_SHARED_MIN_VERSION = [
6933
6959
  0,
@@ -7319,8 +7345,7 @@ async function joinThread(channel, threadId) {
7319
7345
  }
7320
7346
  throw lastError instanceof Error ? lastError : /* @__PURE__ */ new Error("Cannot join the Codex thread");
7321
7347
  }
7322
- //#endregion
7323
- //#region src/runtime/harnesses/codex-approval.ts
7348
+ // src/runtime/harnesses/codex-approval.ts
7324
7349
  /** First app-server whose thread and Turn approval overrides Cohub has verified. */
7325
7350
  const CODEX_APPROVAL_MIN_VERSION = [
7326
7351
  0,
@@ -7444,8 +7469,7 @@ function codexApprovalRequest(method, params, paths) {
7444
7469
  ...reason ? { reason } : {}
7445
7470
  };
7446
7471
  }
7447
- //#endregion
7448
- //#region src/runtime/harnesses/codex.ts
7472
+ // src/runtime/harnesses/codex.ts
7449
7473
  /** A stop request that the harness does not honour within this long ends its private process. */
7450
7474
  const ABORT_ESCALATION_MS$2 = 5e3;
7451
7475
  function codexSessionPath(nativeSessionId) {
@@ -7767,8 +7791,7 @@ const codexHarness = {
7767
7791
  archiveSource: (path, cacheDirectory) => ensurePlainCodexRollout(path, cacheDirectory)
7768
7792
  }
7769
7793
  };
7770
- //#endregion
7771
- //#region src/runtime/harnesses/chained-projection.ts
7794
+ // src/runtime/harnesses/chained-projection.ts
7772
7795
  /** Deterministic, UUID-shaped record ids keep re-projection stable without local state. */
7773
7796
  function projectionUuid(key) {
7774
7797
  const hex = createHash("sha256").update(key).digest("hex");
@@ -7900,8 +7923,7 @@ const rebindSessionId = (records, nativeSessionId) => records.map((entry) => ({
7900
7923
  sessionId: nativeSessionId
7901
7924
  }
7902
7925
  }));
7903
- //#endregion
7904
- //#region src/runtime/harnesses/chained-transcript.ts
7926
+ // src/runtime/harnesses/chained-transcript.ts
7905
7927
  /**
7906
7928
  * `<data root>/projects/<project>/<session id>.jsonl`; sub-agent files live in deeper directories. A
7907
7929
  * subdirectory's project name extends its parent's, so a prefix admits them; the header decides ownership.
@@ -7971,8 +7993,7 @@ function extendTurn(turn, line, content) {
7971
7993
  turn.boundaries[line.endBytes] = line.sha256;
7972
7994
  if (content) turn.contentEndBytes = line.endBytes;
7973
7995
  }
7974
- //#endregion
7975
- //#region src/runtime/harnesses/claude-approval.ts
7996
+ // src/runtime/harnesses/claude-approval.ts
7976
7997
  const PERMISSION_MODES = {
7977
7998
  inherit: null,
7978
7999
  auto: "auto",
@@ -8106,8 +8127,7 @@ async function answerClaudeApproval(request, input, approvals, grants, signal) {
8106
8127
  if (decision === "accept_for_session") grants.add(input.sessionId, asked.grants);
8107
8128
  return allow;
8108
8129
  }
8109
- //#endregion
8110
- //#region src/runtime/harnesses/stream-json.ts
8130
+ // src/runtime/harnesses/stream-json.ts
8111
8131
  /** A stop request that the harness does not honour within this long ends its process. */
8112
8132
  const ABORT_ESCALATION_MS$1 = 5e3;
8113
8133
  /** After input closes, the CLI flushes its transcript; it is reaped when it does not exit by then. */
@@ -8557,8 +8577,7 @@ async function runStreamJson(profile, executor, turn) {
8557
8577
  host
8558
8578
  };
8559
8579
  }
8560
- //#endregion
8561
- //#region src/runtime/harnesses/claude-transcript.ts
8580
+ // src/runtime/harnesses/claude-transcript.ts
8562
8581
  const COMMAND = /^<command-name>\s*([^<]*)<\/command-name>/;
8563
8582
  const COMMAND_ARGS = /<command-args>([\s\S]*?)<\/command-args>/;
8564
8583
  const BASH_INPUT = /^<bash-input>([\s\S]*?)<\/bash-input>/;
@@ -8722,8 +8741,7 @@ async function readClaudeTranscript(path, nativeSessionId, signal) {
8722
8741
  prefixes: read.prefixes
8723
8742
  };
8724
8743
  }
8725
- //#endregion
8726
- //#region src/runtime/harnesses/claude.ts
8744
+ // src/runtime/harnesses/claude.ts
8727
8745
  const MAX_PROJECT_NAME = 200;
8728
8746
  const INITIALIZE_TIMEOUT_MS = 3e4;
8729
8747
  const dataRoot$1 = () => process.env.CLAUDE_CONFIG_DIR?.trim() || join(homedir(), ".claude");
@@ -9009,8 +9027,7 @@ const claudeHarness = {
9009
9027
  marksCohubTurns: true
9010
9028
  }
9011
9029
  };
9012
- //#endregion
9013
- //#region src/runtime/harnesses/workbuddy-transcript.ts
9030
+ // src/runtime/harnesses/workbuddy-transcript.ts
9014
9031
  const WORKBUDDY_REPLY_ENDED = [
9015
9032
  "stop",
9016
9033
  "aborted",
@@ -9164,8 +9181,7 @@ async function readWorkbuddyTranscript(path, nativeSessionId, signal) {
9164
9181
  prefixes: read.prefixes
9165
9182
  };
9166
9183
  }
9167
- //#endregion
9168
- //#region src/runtime/harnesses/workbuddy.ts
9184
+ // src/runtime/harnesses/workbuddy.ts
9169
9185
  /** WorkBuddy's CLI is CodeBuddy Code; both share its data root. */
9170
9186
  const dataRoot = () => process.env.CODEBUDDY_CONFIG_DIR?.trim() || join(homedir(), ".codebuddy");
9171
9187
  const MAX_NAME_BYTES = 255;
@@ -9331,8 +9347,7 @@ const workbuddyHarness = {
9331
9347
  marksCohubTurns: false
9332
9348
  }
9333
9349
  };
9334
- //#endregion
9335
- //#region src/runtime/harnesses/cursor-transcript.ts
9350
+ // src/runtime/harnesses/cursor-transcript.ts
9336
9351
  const TRANSCRIPTS = "agent-transcripts";
9337
9352
  const USER_QUERY = /<user_query>\s*([\s\S]*?)\s*<\/user_query>/;
9338
9353
  const TIMESTAMP = /<timestamp>([^<]*)<\/timestamp>/;
@@ -9548,8 +9563,7 @@ async function readCursorTranscript(path, nativeSessionId, signal) {
9548
9563
  prefixes: read.prefixes
9549
9564
  };
9550
9565
  }
9551
- //#endregion
9552
- //#region src/runtime/harnesses/cursor.ts
9566
+ // src/runtime/harnesses/cursor.ts
9553
9567
  const BINARY = "cursor-agent";
9554
9568
  const PROVIDER = "cursor";
9555
9569
  /** Runs without `--model`, so the model chosen in Cursor applies. */
@@ -10334,8 +10348,7 @@ const cursorHarness = {
10334
10348
  marksCohubTurns: false
10335
10349
  }
10336
10350
  };
10337
- //#endregion
10338
- //#region src/runtime/harnesses/index.ts
10351
+ // src/runtime/harnesses/index.ts
10339
10352
  /** Every local harness is one adapter; the protocol registry lists their identities. Built lazily to tolerate import cycles. */
10340
10353
  let registry = null;
10341
10354
  const adapters = () => registry ??= {
@@ -10408,8 +10421,7 @@ async function refreshHarnesses(current, executables, cwd, onUnavailable) {
10408
10421
  ...await harnessFeatures(current.harnesses, executables, cwd, current)
10409
10422
  };
10410
10423
  }
10411
- //#endregion
10412
- //#region src/runtime/archive-store.ts
10424
+ // src/runtime/archive-store.ts
10413
10425
  const missing$2 = (error) => error?.code === "ENOENT";
10414
10426
  /** Raised when local capture bytes fail integrity checks (checksum, truncation, boundary); retryable via cache rebuild. */
10415
10427
  var ArchiveCaptureIntegrityError = class extends Error {
@@ -10783,8 +10795,7 @@ var RuntimeArchiveStore = class {
10783
10795
  }
10784
10796
  }
10785
10797
  };
10786
- //#endregion
10787
- //#region src/runtime/native/adapters.ts
10798
+ // src/runtime/native/adapters.ts
10788
10799
  /** Directories holding this harness's transcripts; a transcript's header says which project it is. */
10789
10800
  const transcriptRoots = (harness) => transcriptFormat(harness).roots();
10790
10801
  /** Whether a directory found under a root can hold transcripts of `cwd`. */
@@ -10795,8 +10806,7 @@ const acceptsTranscript = (path, harness, cwd) => transcriptFormat(harness).acce
10795
10806
  const readSessionHeader = async (path, harness, signal) => await transcriptFormat(harness).header(path, signal);
10796
10807
  /** Parse a transcript into Turns. */
10797
10808
  const readTranscript = async (path, harness, signal) => await transcriptFormat(harness).read(path, signal);
10798
- //#endregion
10799
- //#region src/runtime/presentation.ts
10809
+ // src/runtime/presentation.ts
10800
10810
  const diagnosticLevels = [
10801
10811
  "debug",
10802
10812
  "info",
@@ -10924,8 +10934,7 @@ function formatNativeSync(config, native, error = null) {
10924
10934
  if (job.failed.length) lines.push(` ${plural(job.failed.length, "conversation")} failed to import · cohub runtime logs`);
10925
10935
  return `${lines.join("\n")}\n`;
10926
10936
  }
10927
- //#endregion
10928
- //#region src/runtime/native/config.ts
10937
+ // src/runtime/native/config.ts
10929
10938
  /** Private state of one Space's Runtime on this machine. */
10930
10939
  const runtimeStateRoot = (spaceId, base = join(homedir(), ".local", "state", "cohub", "runtime")) => join(base, spaceId);
10931
10940
  const nativeConfigPath = (stateRoot) => join(stateRoot, "native", "config.json");
@@ -10942,8 +10951,7 @@ async function readNativeConfig(stateRoot, identity) {
10942
10951
  async function writeNativeConfig(stateRoot, config) {
10943
10952
  await atomicRuntimeJson(nativeConfigPath(stateRoot), config);
10944
10953
  }
10945
- //#endregion
10946
- //#region src/runtime/native/identity.ts
10954
+ // src/runtime/native/identity.ts
10947
10955
  /** Deterministic UUID-shaped id. A native Turn always names the same cloud Turn. */
10948
10956
  function nativeStableId(value) {
10949
10957
  const hex = createHash("sha256").update(value).digest("hex");
@@ -10968,16 +10976,14 @@ function nativeTurnId(spaceId, harness, nativeSessionId, turnKey) {
10968
10976
  turnKey
10969
10977
  ]));
10970
10978
  }
10971
- //#endregion
10972
- //#region src/runtime/native/paths.ts
10979
+ // src/runtime/native/paths.ts
10973
10980
  /** Whether a native path is the root itself or one of its descendants. */
10974
10981
  function containsNativePath(root, path, platform = process.platform) {
10975
10982
  const paths = platform === "win32" ? win32 : posix;
10976
10983
  const relative = paths.relative(root, path);
10977
10984
  return relative === "" || relative !== ".." && !relative.startsWith(`..${paths.sep}`) && !paths.isAbsolute(relative);
10978
10985
  }
10979
- //#endregion
10980
- //#region src/runtime/native/ingest.ts
10986
+ // src/runtime/native/ingest.ts
10981
10987
  const missing$1 = (error) => error?.code === "ENOENT";
10982
10988
  /** Transcripts read in parallel per lane. The live lane never waits behind a backfill. */
10983
10989
  const LIVE_CONCURRENCY = 2;
@@ -11896,8 +11902,7 @@ var NativeIngest = class {
11896
11902
  this.journalLines = entries.length;
11897
11903
  }
11898
11904
  };
11899
- //#endregion
11900
- //#region src/runtime/native/install.ts
11905
+ // src/runtime/native/install.ts
11901
11906
  const missing = (error) => error.code === "ENOENT";
11902
11907
  /** First line of the installed extension; a file without it belongs to someone else. */
11903
11908
  const PI_EXTENSION_HEADER = "// Cohub control extension for Pi. Managed by `cohub runtime`; local edits are replaced on upgrade.\n";
@@ -12003,5 +12008,4 @@ async function writeManaged(path, update, options = { backup: true }) {
12003
12008
  }
12004
12009
  }, { lockPath: `${path}.cohub-lock` });
12005
12010
  }
12006
- //#endregion
12007
12011
  export { formatVersion as A, closeHost as B, installedHarnesses as C, sharedServerAvailable as D, CodexShared as E, piTranslator as F, RuntimeDiagnostics as G, ProcessCleanupUncertainError as H, ArchiveNotRestorableError as I, serializeDiagnosticError as J, readRuntimeDiagnosticEvents as K, PI_MIN_VERSION as L, SizeLimitError as M, LiveProgress as N, supportsSharedServer as O, codexTranslator as P, PiLink as R, harnessAdapter as S, CODEX_SHARED_MIN_VERSION as T, confirmQuiescentProcessGroup as U, record as V, RuntimeDiagnosticReader as W, serializeProjectionRecords as Y, runtimeWebUrl as _, NativeIngest as a, atomicRuntimeJson as b, runtimeStateRoot as c, createDiagnosticConsole as d, diagnosticLevels as f, printRuntimeSummary as g, formatNativeSync as h, removeLegacyCodexHooks as i, harnessVersion as j, atLeast as k, writeNativeConfig as l, formatImportProgress as m, piExtensionSource as n, discoverTranscripts as o, formatDiagnostic as p, runtimeDiagnosticsDirectory as q, piExtensionState as r, readNativeConfig as s, installPiExtension as t, atLeastLevel as u, readTranscript as v, refreshHarnesses as w, discoverHarnesses as x, RuntimeArchiveStore as y, controlSocketPath as z };