@cjhyy/code-shell 0.1.5 → 0.1.6

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 (48) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/arena/index.cjs +4 -4
  3. package/dist/arena/index.js +3 -3
  4. package/dist/{arena-O2L4TN6A.js → arena-2LTLIXOL.js} +3 -3
  5. package/dist/{arena-KBQOPLFV.cjs → arena-ADB7DRFI.cjs} +17 -17
  6. package/dist/{chunk-XDIQWQJ4.js → chunk-3QO25N6E.js} +2 -2
  7. package/dist/{chunk-5ECBT4YA.js → chunk-3SBSUOWZ.js} +0 -3
  8. package/dist/{chunk-YUI524OE.cjs → chunk-7BI3V74Y.cjs} +0 -3
  9. package/dist/{chunk-2EP3CLEN.js → chunk-7QIM3BKD.js} +1 -1
  10. package/dist/{chunk-YJ77GQK5.js → chunk-ABRRONJ7.js} +1 -1
  11. package/dist/{chunk-C5YQBIRK.js → chunk-BZ5TNE7L.js} +1 -1
  12. package/dist/{chunk-VYL4EFRC.cjs → chunk-DDB6QOKJ.cjs} +7 -7
  13. package/dist/{chunk-SNT563K3.cjs → chunk-ILHE7XLT.cjs} +6 -6
  14. package/dist/{chunk-76W334S4.js → chunk-KAQHULYN.js} +1 -1
  15. package/dist/{chunk-W22P377T.js → chunk-KE4EQOWA.js} +6 -11
  16. package/dist/{chunk-R47ROHGL.cjs → chunk-MV7YI4WO.cjs} +6 -11
  17. package/dist/{chunk-7K6SDRRF.js → chunk-PKGRTCCY.js} +54 -9
  18. package/dist/{chunk-RMYKO74M.js → chunk-QARL3IDQ.js} +1 -1
  19. package/dist/{chunk-A5LCRPDP.cjs → chunk-S754JHLR.cjs} +2 -2
  20. package/dist/{chunk-HS2MFNUC.cjs → chunk-TNLGBJYS.cjs} +3 -3
  21. package/dist/{chunk-BUU5PZK2.cjs → chunk-UXOCVJJ6.cjs} +200 -156
  22. package/dist/{chunk-BWTOS5BH.cjs → chunk-WZJV6DJC.cjs} +4 -4
  23. package/dist/{chunk-QRM7IF2S.cjs → chunk-YKIAELDZ.cjs} +2 -2
  24. package/dist/cli/main.cjs +211 -188
  25. package/dist/cli/main.js +44 -21
  26. package/dist/cli/updater.d.ts +8 -0
  27. package/dist/engine/engine.d.ts +7 -0
  28. package/dist/index.cjs +8 -8
  29. package/dist/index.js +9 -9
  30. package/dist/{manager-C2IUXKRC.js → manager-D65VFAPX.js} +1 -1
  31. package/dist/manager-TTF5VHJC.cjs +7 -0
  32. package/dist/{openrouter-models-TGKDKY52.js → openrouter-models-H56GHBHN.js} +1 -1
  33. package/dist/openrouter-models-TWUFWZ5T.cjs +15 -0
  34. package/dist/openrouter-sync-5VMGN6C2.cjs +11 -0
  35. package/dist/{openrouter-sync-UXUSJCIR.js → openrouter-sync-ALEMF5IU.js} +2 -2
  36. package/dist/product/index.cjs +7 -7
  37. package/dist/product/index.js +6 -6
  38. package/dist/run/index.cjs +7 -7
  39. package/dist/run/index.js +6 -6
  40. package/dist/tool-system/investigation-guard.d.ts +9 -0
  41. package/dist/updater-I7QBW4DP.cjs +17 -0
  42. package/dist/{updater-VFUAHCVY.js → updater-NVME5S3Z.js} +1 -1
  43. package/package.json +2 -1
  44. package/skills-builtin/codeshell-help.md +135 -0
  45. package/dist/manager-YYKWYTRM.cjs +0 -7
  46. package/dist/openrouter-models-OU4GRZQY.cjs +0 -15
  47. package/dist/openrouter-sync-BBHUM3R6.cjs +0 -11
  48. package/dist/updater-QW473OF4.cjs +0 -17
package/dist/cli/main.cjs CHANGED
@@ -8,10 +8,10 @@ var _chunkMY5XHADUcjs = require('../chunk-MY5XHADU.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkR47ROHGLcjs = require('../chunk-R47ROHGL.cjs');
11
+ var _chunkMV7YI4WOcjs = require('../chunk-MV7YI4WO.cjs');
12
12
 
13
13
 
14
- var _chunkA5LCRPDPcjs = require('../chunk-A5LCRPDP.cjs');
14
+ var _chunkS754JHLRcjs = require('../chunk-S754JHLR.cjs');
15
15
 
16
16
 
17
17
 
@@ -26,7 +26,7 @@ var _chunkA5LCRPDPcjs = require('../chunk-A5LCRPDP.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkBUU5PZK2cjs = require('../chunk-BUU5PZK2.cjs');
29
+ var _chunkUXOCVJJ6cjs = require('../chunk-UXOCVJJ6.cjs');
30
30
  require('../chunk-55XGPMAP.cjs');
31
31
 
32
32
 
@@ -37,19 +37,19 @@ require('../chunk-JMR33QVF.cjs');
37
37
  require('../chunk-NUNC3VFB.cjs');
38
38
 
39
39
 
40
- var _chunkYUI524OEcjs = require('../chunk-YUI524OE.cjs');
40
+ var _chunk7BI3V74Ycjs = require('../chunk-7BI3V74Y.cjs');
41
41
  require('../chunk-TUY2T5KP.cjs');
42
- require('../chunk-VYL4EFRC.cjs');
42
+ require('../chunk-DDB6QOKJ.cjs');
43
43
 
44
44
 
45
45
 
46
46
 
47
47
 
48
- var _chunkBWTOS5BHcjs = require('../chunk-BWTOS5BH.cjs');
48
+ var _chunkWZJV6DJCcjs = require('../chunk-WZJV6DJC.cjs');
49
49
 
50
50
 
51
51
 
52
- var _chunkQRM7IF2Scjs = require('../chunk-QRM7IF2S.cjs');
52
+ var _chunkYKIAELDZcjs = require('../chunk-YKIAELDZ.cjs');
53
53
  require('../chunk-2YW4FPFG.cjs');
54
54
 
55
55
 
@@ -146,7 +146,7 @@ var AgentServer = (_class = class _AgentServer {
146
146
  });
147
147
  }
148
148
  });
149
- _chunkBUU5PZK2cjs.setInteractiveApprovalFn.call(void 0, (request) => {
149
+ _chunkUXOCVJJ6cjs.setInteractiveApprovalFn.call(void 0, (request) => {
150
150
  return this.requestApprovalFromClient(request);
151
151
  });
152
152
  this.engine.setAskUser((question, opts) => {
@@ -202,7 +202,7 @@ var AgentServer = (_class = class _AgentServer {
202
202
  const streamToClient = (event) => {
203
203
  this.notify(Methods.StreamEvent, { event });
204
204
  };
205
- _chunkBUU5PZK2cjs.taskManager.setStreamCallback(streamToClient);
205
+ _chunkUXOCVJJ6cjs.taskManager.setStreamCallback(streamToClient);
206
206
  try {
207
207
  const result = await this.engine.run(params.task, {
208
208
  sessionId: params.sessionId,
@@ -222,7 +222,7 @@ var AgentServer = (_class = class _AgentServer {
222
222
  createErrorResponse(req.id, ErrorCodes.InternalError, err.message)
223
223
  );
224
224
  } finally {
225
- _chunkBUU5PZK2cjs.taskManager.setStreamCallback(void 0);
225
+ _chunkUXOCVJJ6cjs.taskManager.setStreamCallback(void 0);
226
226
  this.running = false;
227
227
  this.abortController = null;
228
228
  this.notify(Methods.Status, { status: "ready" });
@@ -267,10 +267,10 @@ var AgentServer = (_class = class _AgentServer {
267
267
  handleConfigure(req) {
268
268
  const params = _nullishCoalesce(req.params, () => ( {}));
269
269
  if (params.planMode !== void 0) {
270
- _chunkBUU5PZK2cjs.setInPlanMode.call(void 0, params.planMode);
270
+ _chunkUXOCVJJ6cjs.setInPlanMode.call(void 0, params.planMode);
271
271
  }
272
272
  if (params.bypassPermissions !== void 0) {
273
- _chunkBUU5PZK2cjs.setRuntimeBypass.call(void 0, params.bypassPermissions);
273
+ _chunkUXOCVJJ6cjs.setRuntimeBypass.call(void 0, params.bypassPermissions);
274
274
  }
275
275
  if (params.reloadModels) {
276
276
  try {
@@ -320,7 +320,7 @@ var AgentServer = (_class = class _AgentServer {
320
320
  type: "config",
321
321
  data: {
322
322
  permissionMode: _nullishCoalesce(config.permissionMode, () => ( "default")),
323
- planMode: _chunkBUU5PZK2cjs.isInPlanMode.call(void 0, ),
323
+ planMode: _chunkUXOCVJJ6cjs.isInPlanMode.call(void 0, ),
324
324
  preset: config.preset,
325
325
  model: config.llm.model,
326
326
  cwd: config.cwd,
@@ -433,7 +433,7 @@ var AgentServer = (_class = class _AgentServer {
433
433
  break;
434
434
  }
435
435
  case "arena_status": {
436
- const status = _chunkBUU5PZK2cjs.getArenaStatus.call(void 0, );
436
+ const status = _chunkUXOCVJJ6cjs.getArenaStatus.call(void 0, );
437
437
  this.transport.send(createResponse(req.id, { type: "arena_status", data: status }));
438
438
  break;
439
439
  }
@@ -955,7 +955,7 @@ var MODEL_PRICING = {
955
955
  var DEFAULT_PRICING = pricing(3, 15);
956
956
  function lookupPricing(model) {
957
957
  if (model.includes("/")) {
958
- const hit2 = _chunkQRM7IF2Scjs.findOpenRouterModel.call(void 0, model);
958
+ const hit2 = _chunkYKIAELDZcjs.findOpenRouterModel.call(void 0, model);
959
959
  if (hit2 && (hit2.inputPricePerMillion > 0 || hit2.outputPricePerMillion > 0)) {
960
960
  const input = hit2.inputPricePerMillion;
961
961
  const output = hit2.outputPricePerMillion;
@@ -1385,11 +1385,33 @@ function compactSummary(toolName, content) {
1385
1385
  }
1386
1386
 
1387
1387
  // src/cli/commands/run.ts
1388
+ function findActiveModelEntry(settings) {
1389
+ const s = settings;
1390
+ if (!_optionalChain([s, 'access', _5 => _5.models, 'optionalAccess', _6 => _6.length])) return void 0;
1391
+ if (s.activeKey) {
1392
+ const hit = s.models.find((m) => m.key === s.activeKey);
1393
+ if (hit) return hit;
1394
+ }
1395
+ const legacyName = _optionalChain([s, 'access', _7 => _7.model, 'optionalAccess', _8 => _8.name]);
1396
+ if (legacyName) {
1397
+ return s.models.find(
1398
+ (m) => m.model === legacyName || _optionalChain([m, 'access', _9 => _9.model, 'optionalAccess', _10 => _10.endsWith, 'call', _11 => _11(`/${legacyName}`)])
1399
+ );
1400
+ }
1401
+ return void 0;
1402
+ }
1403
+ function findProviderApiKey(settings, providerKey) {
1404
+ if (!providerKey) return void 0;
1405
+ const s = settings;
1406
+ return _optionalChain([s, 'access', _12 => _12.providers, 'optionalAccess', _13 => _13.find, 'call', _14 => _14((p) => p.key === providerKey), 'optionalAccess', _15 => _15.apiKey]);
1407
+ }
1388
1408
  async function runCommand(options) {
1389
1409
  const cwd = process.cwd();
1390
- const settingsManager = new (0, _chunkYUI524OEcjs.SettingsManager)(cwd);
1410
+ const settingsManager = new (0, _chunk7BI3V74Ycjs.SettingsManager)(cwd);
1391
1411
  const settings = settingsManager.get();
1392
- const apiKey = _chunkBWTOS5BHcjs.resolveApiKey.call(void 0, options.apiKey, settings.model.apiKey);
1412
+ const activeModelEntry = findActiveModelEntry(settings);
1413
+ const fallbackApiKey = _nullishCoalesce(_nullishCoalesce(_optionalChain([settings, 'access', _16 => _16.model, 'optionalAccess', _17 => _17.apiKey]), () => ( _optionalChain([activeModelEntry, 'optionalAccess', _18 => _18.apiKey]))), () => ( findProviderApiKey(settings, _optionalChain([activeModelEntry, 'optionalAccess', _19 => _19.providerKey]))));
1414
+ const apiKey = _chunkWZJV6DJCcjs.resolveApiKey.call(void 0, options.apiKey, fallbackApiKey);
1393
1415
  if (!apiKey) {
1394
1416
  console.error(
1395
1417
  "Error: No API key provided. Use --api-key, set OPENROUTER_API_KEY env var, or add to settings."
@@ -1397,15 +1419,15 @@ async function runCommand(options) {
1397
1419
  process.exit(1);
1398
1420
  }
1399
1421
  const llmConfig = {
1400
- provider: _nullishCoalesce(_nullishCoalesce(options.provider, () => ( settings.model.provider)), () => ( "openai")),
1401
- model: _nullishCoalesce(_nullishCoalesce(options.model, () => ( settings.model.name)), () => ( "anthropic/claude-opus-4-6")),
1422
+ provider: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(options.provider, () => ( _optionalChain([activeModelEntry, 'optionalAccess', _20 => _20.provider]))), () => ( _optionalChain([settings, 'access', _21 => _21.model, 'optionalAccess', _22 => _22.provider]))), () => ( "openai")),
1423
+ model: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(options.model, () => ( _optionalChain([activeModelEntry, 'optionalAccess', _23 => _23.model]))), () => ( _optionalChain([settings, 'access', _24 => _24.model, 'optionalAccess', _25 => _25.name]))), () => ( "anthropic/claude-opus-4-6")),
1402
1424
  apiKey,
1403
- baseUrl: _nullishCoalesce(_nullishCoalesce(options.baseUrl, () => ( settings.model.baseUrl)), () => ( "https://openrouter.ai/api/v1")),
1404
- temperature: settings.model.temperature,
1405
- maxTokens: _nullishCoalesce(settings.model.maxTokens, () => ( 8192)),
1425
+ baseUrl: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(options.baseUrl, () => ( _optionalChain([activeModelEntry, 'optionalAccess', _26 => _26.baseUrl]))), () => ( _optionalChain([settings, 'access', _27 => _27.model, 'optionalAccess', _28 => _28.baseUrl]))), () => ( "https://openrouter.ai/api/v1")),
1426
+ temperature: _optionalChain([settings, 'access', _29 => _29.model, 'optionalAccess', _30 => _30.temperature]),
1427
+ maxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([activeModelEntry, 'optionalAccess', _31 => _31.maxOutputTokens]), () => ( _optionalChain([settings, 'access', _32 => _32.model, 'optionalAccess', _33 => _33.maxTokens]))), () => ( 8192)),
1406
1428
  enableStreaming: true
1407
1429
  };
1408
- const engine = new (0, _chunkBUU5PZK2cjs.Engine)({
1430
+ const engine = new (0, _chunkUXOCVJJ6cjs.Engine)({
1409
1431
  llm: llmConfig,
1410
1432
  cwd,
1411
1433
  preset: _nullishCoalesce(options.preset, () => ( settings.agent.preset)),
@@ -1418,7 +1440,8 @@ async function runCommand(options) {
1418
1440
  maxContextTokens: settings.context.maxTokens,
1419
1441
  sessionStorageDir: settings.session.storageDir,
1420
1442
  costStore: costTracker,
1421
- mcpServers: settings.mcpServers
1443
+ mcpServers: settings.mcpServers,
1444
+ headless: true
1422
1445
  });
1423
1446
  const [serverTransport, clientTransport] = createInProcessTransport();
1424
1447
  const _server = new AgentServer({ engine, transport: serverTransport });
@@ -1448,7 +1471,7 @@ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
1448
1471
  // src/utils/debug.ts
1449
1472
  _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
1450
1473
  function logForDebugging(message, opts) {
1451
- const requested = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _5 => _5.level]), () => ( "debug"));
1474
+ const requested = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _34 => _34.level]), () => ( "debug"));
1452
1475
  const level = requested === "error" || requested === "warn" || requested === "info" ? requested : "debug";
1453
1476
  const match = message.match(/^\s*\[([^\]]+)\]\s*(.*)$/);
1454
1477
  const cat = match ? match[1].toLowerCase() : void 0;
@@ -3523,14 +3546,14 @@ var _child_process = require('child_process');
3523
3546
  function execFileNoThrow(file, args, options) {
3524
3547
  return new Promise((resolve) => {
3525
3548
  const execOpts = {
3526
- timeout: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _6 => _6.timeout]), () => ( 1e4)),
3549
+ timeout: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.timeout]), () => ( 1e4)),
3527
3550
  maxBuffer: 10 * 1024 * 1024,
3528
3551
  // 10MB
3529
3552
  encoding: "utf-8"
3530
3553
  };
3531
- if (_optionalChain([options, 'optionalAccess', _7 => _7.cwd])) execOpts.cwd = options.cwd;
3532
- if (_optionalChain([options, 'optionalAccess', _8 => _8.env])) execOpts.env = { ...process.env, ...options.env };
3533
- if (_optionalChain([options, 'optionalAccess', _9 => _9.shell])) execOpts.shell = options.shell === true ? void 0 : options.shell;
3554
+ if (_optionalChain([options, 'optionalAccess', _36 => _36.cwd])) execOpts.cwd = options.cwd;
3555
+ if (_optionalChain([options, 'optionalAccess', _37 => _37.env])) execOpts.env = { ...process.env, ...options.env };
3556
+ if (_optionalChain([options, 'optionalAccess', _38 => _38.shell])) execOpts.shell = options.shell === true ? void 0 : options.shell;
3534
3557
  const child = _child_process.execFile.call(void 0, file, args, execOpts, (error, stdout, stderr) => {
3535
3558
  if (error) {
3536
3559
  const errno = error;
@@ -3555,7 +3578,7 @@ function execFileNoThrow(file, args, options) {
3555
3578
  });
3556
3579
  }
3557
3580
  });
3558
- if (_optionalChain([options, 'optionalAccess', _10 => _10.input]) && child.stdin) {
3581
+ if (_optionalChain([options, 'optionalAccess', _39 => _39.input]) && child.stdin) {
3559
3582
  child.stdin.write(options.input);
3560
3583
  child.stdin.end();
3561
3584
  }
@@ -3600,7 +3623,7 @@ var EventEmitter3 = class extends _events.EventEmitter {
3600
3623
  const ccEvent = args[0] instanceof Event ? args[0] : null;
3601
3624
  for (const listener of listeners) {
3602
3625
  listener.apply(this, args);
3603
- if (_optionalChain([ccEvent, 'optionalAccess', _11 => _11.didStopImmediatePropagation, 'call', _12 => _12()])) {
3626
+ if (_optionalChain([ccEvent, 'optionalAccess', _40 => _40.didStopImmediatePropagation, 'call', _41 => _41()])) {
3604
3627
  break;
3605
3628
  }
3606
3629
  }
@@ -3864,7 +3887,7 @@ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
3864
3887
  function createTokenizer(options) {
3865
3888
  let currentState = "ground";
3866
3889
  let currentBuffer = "";
3867
- const x10Mouse = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _13 => _13.x10Mouse]), () => ( false));
3890
+ const x10Mouse = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _42 => _42.x10Mouse]), () => ( false));
3868
3891
  return {
3869
3892
  feed(input) {
3870
3893
  const result = tokenize(
@@ -5380,9 +5403,9 @@ var createNode = (nodeName) => {
5380
5403
  dirty: false
5381
5404
  };
5382
5405
  if (nodeName === "ink-text") {
5383
- _optionalChain([node, 'access', _14 => _14.yogaNode, 'optionalAccess', _15 => _15.setMeasureFunc, 'call', _16 => _16(measureTextNode.bind(null, node))]);
5406
+ _optionalChain([node, 'access', _43 => _43.yogaNode, 'optionalAccess', _44 => _44.setMeasureFunc, 'call', _45 => _45(measureTextNode.bind(null, node))]);
5384
5407
  } else if (nodeName === "ink-raw-ansi") {
5385
- _optionalChain([node, 'access', _17 => _17.yogaNode, 'optionalAccess', _18 => _18.setMeasureFunc, 'call', _19 => _19(measureRawAnsiNode.bind(null, node))]);
5408
+ _optionalChain([node, 'access', _46 => _46.yogaNode, 'optionalAccess', _47 => _47.setMeasureFunc, 'call', _48 => _48(measureRawAnsiNode.bind(null, node))]);
5386
5409
  }
5387
5410
  return node;
5388
5411
  };
@@ -5393,7 +5416,7 @@ var appendChildNode = (node, childNode) => {
5393
5416
  childNode.parentNode = node;
5394
5417
  node.childNodes.push(childNode);
5395
5418
  if (childNode.yogaNode) {
5396
- _optionalChain([node, 'access', _20 => _20.yogaNode, 'optionalAccess', _21 => _21.insertChild, 'call', _22 => _22(
5419
+ _optionalChain([node, 'access', _49 => _49.yogaNode, 'optionalAccess', _50 => _50.insertChild, 'call', _51 => _51(
5397
5420
  childNode.yogaNode,
5398
5421
  node.yogaNode.getChildCount()
5399
5422
  )]);
@@ -5410,7 +5433,7 @@ var insertBeforeNode = (node, newChildNode, beforeChildNode) => {
5410
5433
  let yogaIndex = 0;
5411
5434
  if (newChildNode.yogaNode && node.yogaNode) {
5412
5435
  for (let i = 0; i < index; i++) {
5413
- if (_optionalChain([node, 'access', _23 => _23.childNodes, 'access', _24 => _24[i], 'optionalAccess', _25 => _25.yogaNode])) {
5436
+ if (_optionalChain([node, 'access', _52 => _52.childNodes, 'access', _53 => _53[i], 'optionalAccess', _54 => _54.yogaNode])) {
5414
5437
  yogaIndex++;
5415
5438
  }
5416
5439
  }
@@ -5424,7 +5447,7 @@ var insertBeforeNode = (node, newChildNode, beforeChildNode) => {
5424
5447
  }
5425
5448
  node.childNodes.push(newChildNode);
5426
5449
  if (newChildNode.yogaNode) {
5427
- _optionalChain([node, 'access', _26 => _26.yogaNode, 'optionalAccess', _27 => _27.insertChild, 'call', _28 => _28(
5450
+ _optionalChain([node, 'access', _55 => _55.yogaNode, 'optionalAccess', _56 => _56.insertChild, 'call', _57 => _57(
5428
5451
  newChildNode.yogaNode,
5429
5452
  node.yogaNode.getChildCount()
5430
5453
  )]);
@@ -5433,7 +5456,7 @@ var insertBeforeNode = (node, newChildNode, beforeChildNode) => {
5433
5456
  };
5434
5457
  var removeChildNode = (node, removeNode) => {
5435
5458
  if (removeNode.yogaNode) {
5436
- _optionalChain([removeNode, 'access', _29 => _29.parentNode, 'optionalAccess', _30 => _30.yogaNode, 'optionalAccess', _31 => _31.removeChild, 'call', _32 => _32(removeNode.yogaNode)]);
5459
+ _optionalChain([removeNode, 'access', _58 => _58.parentNode, 'optionalAccess', _59 => _59.yogaNode, 'optionalAccess', _60 => _60.removeChild, 'call', _61 => _61(removeNode.yogaNode)]);
5437
5460
  }
5438
5461
  collectRemovedRects(node, removeNode);
5439
5462
  removeNode.parentNode = void 0;
@@ -5519,7 +5542,7 @@ var measureTextNode = function(node, width, widthMode) {
5519
5542
  const effectiveWidth = Math.max(width, dimensions.width);
5520
5543
  return measure_text_default(text, effectiveWidth);
5521
5544
  }
5522
- const textWrap = _nullishCoalesce(_optionalChain([node, 'access', _33 => _33.style, 'optionalAccess', _34 => _34.textWrap]), () => ( "wrap"));
5545
+ const textWrap = _nullishCoalesce(_optionalChain([node, 'access', _62 => _62.style, 'optionalAccess', _63 => _63.textWrap]), () => ( "wrap"));
5523
5546
  const wrappedText = wrapText(text, width, textWrap);
5524
5547
  return measure_text_default(wrappedText, width);
5525
5548
  };
@@ -5777,8 +5800,8 @@ var TerminalEvent = (_class9 = class extends Event {
5777
5800
  super();_class9.prototype.__init57.call(this);_class9.prototype.__init58.call(this);_class9.prototype.__init59.call(this);_class9.prototype.__init60.call(this);_class9.prototype.__init61.call(this);;
5778
5801
  this.type = type;
5779
5802
  this.timeStamp = performance.now();
5780
- this.bubbles = _nullishCoalesce(_optionalChain([init, 'optionalAccess', _35 => _35.bubbles]), () => ( true));
5781
- this.cancelable = _nullishCoalesce(_optionalChain([init, 'optionalAccess', _36 => _36.cancelable]), () => ( true));
5803
+ this.bubbles = _nullishCoalesce(_optionalChain([init, 'optionalAccess', _64 => _64.bubbles]), () => ( true));
5804
+ this.cancelable = _nullishCoalesce(_optionalChain([init, 'optionalAccess', _65 => _65.cancelable]), () => ( true));
5782
5805
  }
5783
5806
  get target() {
5784
5807
  return this._target;
@@ -6338,7 +6361,7 @@ function getOwnerChain(fiber) {
6338
6361
  if (seen.has(cur)) break;
6339
6362
  seen.add(cur);
6340
6363
  const t = cur.elementType;
6341
- const name = typeof t === "function" ? t.displayName || t.name : typeof t === "string" ? void 0 : _optionalChain([t, 'optionalAccess', _37 => _37.displayName]) || _optionalChain([t, 'optionalAccess', _38 => _38.name]);
6364
+ const name = typeof t === "function" ? t.displayName || t.name : typeof t === "string" ? void 0 : _optionalChain([t, 'optionalAccess', _66 => _66.displayName]) || _optionalChain([t, 'optionalAccess', _67 => _67.name]);
6342
6365
  if (name && name !== chain[chain.length - 1]) chain.push(name);
6343
6366
  cur = _nullishCoalesce(cur._debugOwner, () => ( cur.return));
6344
6367
  }
@@ -6435,11 +6458,11 @@ var reconciler = _reactreconciler2.default.call(void 0, {
6435
6458
  if (rootNode.childNodes.length > 0) {
6436
6459
  rootNode.hasRenderedContent = true;
6437
6460
  }
6438
- _optionalChain([rootNode, 'access', _39 => _39.onImmediateRender, 'optionalCall', _40 => _40()]);
6461
+ _optionalChain([rootNode, 'access', _68 => _68.onImmediateRender, 'optionalCall', _69 => _69()]);
6439
6462
  return;
6440
6463
  }
6441
6464
  const _tr = COMMIT_LOG ? performance.now() : 0;
6442
- _optionalChain([rootNode, 'access', _41 => _41.onRender, 'optionalCall', _42 => _42()]);
6465
+ _optionalChain([rootNode, 'access', _70 => _70.onRender, 'optionalCall', _71 => _71()]);
6443
6466
  if (COMMIT_LOG) {
6444
6467
  const renderMs = performance.now() - _tr;
6445
6468
  if (renderMs > 10) {
@@ -6494,12 +6517,12 @@ var reconciler = _reactreconciler2.default.call(void 0, {
6494
6517
  getPublicInstance: (instance) => instance,
6495
6518
  hideInstance(node) {
6496
6519
  node.isHidden = true;
6497
- _optionalChain([node, 'access', _43 => _43.yogaNode, 'optionalAccess', _44 => _44.setDisplay, 'call', _45 => _45(LayoutDisplay.None)]);
6520
+ _optionalChain([node, 'access', _72 => _72.yogaNode, 'optionalAccess', _73 => _73.setDisplay, 'call', _74 => _74(LayoutDisplay.None)]);
6498
6521
  markDirty(node);
6499
6522
  },
6500
6523
  unhideInstance(node) {
6501
6524
  node.isHidden = false;
6502
- _optionalChain([node, 'access', _46 => _46.yogaNode, 'optionalAccess', _47 => _47.setDisplay, 'call', _48 => _48(LayoutDisplay.Flex)]);
6525
+ _optionalChain([node, 'access', _75 => _75.yogaNode, 'optionalAccess', _76 => _76.setDisplay, 'call', _77 => _77(LayoutDisplay.Flex)]);
6503
6526
  markDirty(node);
6504
6527
  },
6505
6528
  appendInitialChild: appendChildNode,
@@ -6607,10 +6630,10 @@ var reconciler = _reactreconciler2.default.call(void 0, {
6607
6630
  trackSchedulerEvent() {
6608
6631
  },
6609
6632
  resolveEventType() {
6610
- return _nullishCoalesce(_optionalChain([dispatcher, 'access', _49 => _49.currentEvent, 'optionalAccess', _50 => _50.type]), () => ( null));
6633
+ return _nullishCoalesce(_optionalChain([dispatcher, 'access', _78 => _78.currentEvent, 'optionalAccess', _79 => _79.type]), () => ( null));
6611
6634
  },
6612
6635
  resolveEventTimeStamp() {
6613
- return _nullishCoalesce(_optionalChain([dispatcher, 'access', _51 => _51.currentEvent, 'optionalAccess', _52 => _52.timeStamp]), () => ( -1.1));
6636
+ return _nullishCoalesce(_optionalChain([dispatcher, 'access', _80 => _80.currentEvent, 'optionalAccess', _81 => _81.timeStamp]), () => ( -1.1));
6614
6637
  }
6615
6638
  });
6616
6639
  dispatcher.discreteUpdates = reconciler.discreteUpdates.bind(reconciler);
@@ -6827,7 +6850,7 @@ var StylePool = (_class13 = class {
6827
6850
  __init75() {this.selectionBgCode = null}
6828
6851
  __init76() {this.selectionBgCache = /* @__PURE__ */ new Map()}
6829
6852
  setSelectionBg(bg) {
6830
- if (_optionalChain([this, 'access', _53 => _53.selectionBgCode, 'optionalAccess', _54 => _54.code]) === _optionalChain([bg, 'optionalAccess', _55 => _55.code])) return;
6853
+ if (_optionalChain([this, 'access', _82 => _82.selectionBgCode, 'optionalAccess', _83 => _83.code]) === _optionalChain([bg, 'optionalAccess', _84 => _84.code])) return;
6831
6854
  this.selectionBgCode = bg;
6832
6855
  this.selectionBgCache.clear();
6833
6856
  }
@@ -8246,10 +8269,10 @@ function isSynchronizedOutputSupported() {
8246
8269
  if (termProgram === "iTerm.app" || termProgram === "WezTerm" || termProgram === "WarpTerminal" || termProgram === "ghostty" || termProgram === "contour" || termProgram === "vscode" || termProgram === "alacritty") {
8247
8270
  return true;
8248
8271
  }
8249
- if (_optionalChain([term, 'optionalAccess', _56 => _56.includes, 'call', _57 => _57("kitty")]) || process.env.KITTY_WINDOW_ID) return true;
8272
+ if (_optionalChain([term, 'optionalAccess', _85 => _85.includes, 'call', _86 => _86("kitty")]) || process.env.KITTY_WINDOW_ID) return true;
8250
8273
  if (term === "xterm-ghostty") return true;
8251
- if (_optionalChain([term, 'optionalAccess', _58 => _58.startsWith, 'call', _59 => _59("foot")])) return true;
8252
- if (_optionalChain([term, 'optionalAccess', _60 => _60.includes, 'call', _61 => _61("alacritty")])) return true;
8274
+ if (_optionalChain([term, 'optionalAccess', _87 => _87.startsWith, 'call', _88 => _88("foot")])) return true;
8275
+ if (_optionalChain([term, 'optionalAccess', _89 => _89.includes, 'call', _90 => _90("alacritty")])) return true;
8253
8276
  if (process.env.ZED_TERM) return true;
8254
8277
  if (process.env.WT_SESSION) return true;
8255
8278
  const vteVersion = process.env.VTE_VERSION;
@@ -8265,7 +8288,7 @@ function setXtversionName(name) {
8265
8288
  }
8266
8289
  function isXtermJs() {
8267
8290
  if (process.env.TERM_PROGRAM === "vscode") return true;
8268
- return _nullishCoalesce(_optionalChain([xtversionName, 'optionalAccess', _62 => _62.startsWith, 'call', _63 => _63("xterm.js")]), () => ( false));
8291
+ return _nullishCoalesce(_optionalChain([xtversionName, 'optionalAccess', _91 => _91.startsWith, 'call', _92 => _92("xterm.js")]), () => ( false));
8269
8292
  }
8270
8293
  var EXTENDED_KEYS_TERMINALS = [
8271
8294
  "iTerm.app",
@@ -8431,7 +8454,7 @@ var TerminalQuerier = (_class14 = class {
8431
8454
  const idx = this.queue.findIndex((p) => p.kind === "query" && p.match(r));
8432
8455
  if (idx !== -1) {
8433
8456
  const [q] = this.queue.splice(idx, 1);
8434
- if (_optionalChain([q, 'optionalAccess', _64 => _64.kind]) === "query") q.resolve(r);
8457
+ if (_optionalChain([q, 'optionalAccess', _93 => _93.kind]) === "query") q.resolve(r);
8435
8458
  return;
8436
8459
  }
8437
8460
  if (r.type === "da1") {
@@ -8999,7 +9022,7 @@ function Text(t0) {
8999
9022
  // src/render/components/ErrorOverview.tsx
9000
9023
 
9001
9024
  var cleanupPath = (path) => {
9002
- return _optionalChain([path, 'optionalAccess', _65 => _65.replace, 'call', _66 => _66(`file://${process.cwd()}/`, "")]);
9025
+ return _optionalChain([path, 'optionalAccess', _94 => _94.replace, 'call', _95 => _95(`file://${process.cwd()}/`, "")]);
9003
9026
  };
9004
9027
  var stackUtils;
9005
9028
  function getStackUtils() {
@@ -9013,10 +9036,10 @@ function ErrorOverview({
9013
9036
  }) {
9014
9037
  const stack = error.stack ? error.stack.split("\n").slice(1) : void 0;
9015
9038
  const origin = stack ? getStackUtils().parseLine(stack[0]) : void 0;
9016
- const filePath = cleanupPath(_optionalChain([origin, 'optionalAccess', _67 => _67.file]));
9039
+ const filePath = cleanupPath(_optionalChain([origin, 'optionalAccess', _96 => _96.file]));
9017
9040
  let excerpt;
9018
9041
  let lineWidth2 = 0;
9019
- if (filePath && _optionalChain([origin, 'optionalAccess', _68 => _68.line])) {
9042
+ if (filePath && _optionalChain([origin, 'optionalAccess', _97 => _97.line])) {
9020
9043
  try {
9021
9044
  const sourceCode = _fs.readFileSync.call(void 0, filePath, "utf8");
9022
9045
  excerpt = _codeexcerpt2.default.call(void 0, sourceCode, origin.line);
@@ -9276,7 +9299,7 @@ var App = (_class15 = class extends _react.PureComponent {constructor(...args2)
9276
9299
  __init97() {this.handleReadable = () => {
9277
9300
  const now = Date.now();
9278
9301
  if (now - this.lastStdinTime > STDIN_RESUME_GAP_MS) {
9279
- _optionalChain([this, 'access', _72 => _72.props, 'access', _73 => _73.onStdinResume, 'optionalCall', _74 => _74()]);
9302
+ _optionalChain([this, 'access', _101 => _101.props, 'access', _102 => _102.onStdinResume, 'optionalCall', _103 => _103()]);
9280
9303
  }
9281
9304
  this.lastStdinTime = now;
9282
9305
  try {
@@ -9344,7 +9367,7 @@ var App = (_class15 = class extends _react.PureComponent {constructor(...args2)
9344
9367
  }, _class15.__initStatic2(), _class15);
9345
9368
  function processKeysInBatch(app, items, _unused1, _unused2) {
9346
9369
  if (items.some((i) => i.kind === "key" || i.kind === "mouse" && !((i.button & 32) !== 0 && (i.button & 3) === 3))) {
9347
- _chunkBUU5PZK2cjs.updateLastInteractionTime.call(void 0, );
9370
+ _chunkUXOCVJJ6cjs.updateLastInteractionTime.call(void 0, );
9348
9371
  }
9349
9372
  for (const item of items) {
9350
9373
  if (item.kind === "response") {
@@ -9564,7 +9587,7 @@ function dispatchClick(root, col, row, cellIsBlank = false) {
9564
9587
  const event = new ClickEvent(col, row, cellIsBlank);
9565
9588
  let handled = false;
9566
9589
  while (target) {
9567
- const handler = _optionalChain([target, 'access', _75 => _75._eventHandlers, 'optionalAccess', _76 => _76.onClick]);
9590
+ const handler = _optionalChain([target, 'access', _104 => _104._eventHandlers, 'optionalAccess', _105 => _105.onClick]);
9568
9591
  if (handler) {
9569
9592
  handled = true;
9570
9593
  const rect = nodeCache.get(target);
@@ -9584,7 +9607,7 @@ function dispatchHover(root, col, row, hovered) {
9584
9607
  let node = _nullishCoalesce(hitTest(root, col, row), () => ( void 0));
9585
9608
  while (node) {
9586
9609
  const h = node._eventHandlers;
9587
- if (_optionalChain([h, 'optionalAccess', _77 => _77.onMouseEnter]) || _optionalChain([h, 'optionalAccess', _78 => _78.onMouseLeave])) next.add(node);
9610
+ if (_optionalChain([h, 'optionalAccess', _106 => _106.onMouseEnter]) || _optionalChain([h, 'optionalAccess', _107 => _107.onMouseLeave])) next.add(node);
9588
9611
  node = node.parentNode;
9589
9612
  }
9590
9613
  for (const old of hovered) {
@@ -9592,14 +9615,14 @@ function dispatchHover(root, col, row, hovered) {
9592
9615
  hovered.delete(old);
9593
9616
  if (old.parentNode) {
9594
9617
  ;
9595
- _optionalChain([old, 'access', _79 => _79._eventHandlers, 'optionalAccess', _80 => _80.onMouseLeave, 'optionalCall', _81 => _81()]);
9618
+ _optionalChain([old, 'access', _108 => _108._eventHandlers, 'optionalAccess', _109 => _109.onMouseLeave, 'optionalCall', _110 => _110()]);
9596
9619
  }
9597
9620
  }
9598
9621
  }
9599
9622
  for (const n of next) {
9600
9623
  if (!hovered.has(n)) {
9601
9624
  hovered.add(n);
9602
- _optionalChain([n, 'access', _82 => _82._eventHandlers, 'optionalAccess', _83 => _83.onMouseEnter, 'optionalCall', _84 => _84()]);
9625
+ _optionalChain([n, 'access', _111 => _111._eventHandlers, 'optionalAccess', _112 => _112.onMouseEnter, 'optionalCall', _113 => _113()]);
9603
9626
  }
9604
9627
  }
9605
9628
  }
@@ -10346,19 +10369,19 @@ var Output = (_class18 = class {
10346
10369
  height: regionHeight
10347
10370
  } = operation;
10348
10371
  const clip = clips.at(-1);
10349
- const startX = Math.max(regionX, _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _85 => _85.x1]), () => ( 0)));
10350
- const startY = Math.max(regionY, _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _86 => _86.y1]), () => ( 0)));
10372
+ const startX = Math.max(regionX, _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _114 => _114.x1]), () => ( 0)));
10373
+ const startY = Math.max(regionY, _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _115 => _115.y1]), () => ( 0)));
10351
10374
  const maxY = Math.min(
10352
10375
  regionY + regionHeight,
10353
10376
  screenHeight,
10354
10377
  src.height,
10355
- _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _87 => _87.y2]), () => ( Infinity))
10378
+ _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _116 => _116.y2]), () => ( Infinity))
10356
10379
  );
10357
10380
  const maxX = Math.min(
10358
10381
  regionX + regionWidth,
10359
10382
  screenWidth,
10360
10383
  src.width,
10361
- _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _88 => _88.x2]), () => ( Infinity))
10384
+ _nullishCoalesce(_optionalChain([clip, 'optionalAccess', _117 => _117.x2]), () => ( Infinity))
10362
10385
  );
10363
10386
  if (startX >= maxX || startY >= maxY) continue;
10364
10387
  if (absoluteClears.length === 0) {
@@ -10393,8 +10416,8 @@ var Output = (_class18 = class {
10393
10416
  let prevContentEnd = 0;
10394
10417
  const clip = clips.at(-1);
10395
10418
  if (clip) {
10396
- const clipHorizontally = typeof _optionalChain([clip, 'optionalAccess', _89 => _89.x1]) === "number" && typeof _optionalChain([clip, 'optionalAccess', _90 => _90.x2]) === "number";
10397
- const clipVertically = typeof _optionalChain([clip, 'optionalAccess', _91 => _91.y1]) === "number" && typeof _optionalChain([clip, 'optionalAccess', _92 => _92.y2]) === "number";
10419
+ const clipHorizontally = typeof _optionalChain([clip, 'optionalAccess', _118 => _118.x1]) === "number" && typeof _optionalChain([clip, 'optionalAccess', _119 => _119.x2]) === "number";
10420
+ const clipVertically = typeof _optionalChain([clip, 'optionalAccess', _120 => _120.y1]) === "number" && typeof _optionalChain([clip, 'optionalAccess', _121 => _121.y2]) === "number";
10398
10421
  if (clipHorizontally) {
10399
10422
  const width = widestLine(text);
10400
10423
  if (x + width <= clip.x1 || x >= clip.x2) {
@@ -10555,15 +10578,15 @@ function writeLineToScreen(screen, line, x, y, screenWidth, stylePool, charCache
10555
10578
  offsetX++;
10556
10579
  }
10557
10580
  } else if (codePoint === 27) {
10558
- const nextChar = _optionalChain([characters, 'access', _93 => _93[charIdx + 1], 'optionalAccess', _94 => _94.value]);
10559
- const nextCode = _optionalChain([nextChar, 'optionalAccess', _95 => _95.codePointAt, 'call', _96 => _96(0)]);
10581
+ const nextChar = _optionalChain([characters, 'access', _122 => _122[charIdx + 1], 'optionalAccess', _123 => _123.value]);
10582
+ const nextCode = _optionalChain([nextChar, 'optionalAccess', _124 => _124.codePointAt, 'call', _125 => _125(0)]);
10560
10583
  if (nextChar === "(" || nextChar === ")" || nextChar === "*" || nextChar === "+") {
10561
10584
  charIdx += 2;
10562
10585
  } else if (nextChar === "[") {
10563
10586
  charIdx++;
10564
10587
  while (charIdx < characters.length - 1) {
10565
10588
  charIdx++;
10566
- const c = _optionalChain([characters, 'access', _97 => _97[charIdx], 'optionalAccess', _98 => _98.value, 'access', _99 => _99.codePointAt, 'call', _100 => _100(0)]);
10589
+ const c = _optionalChain([characters, 'access', _126 => _126[charIdx], 'optionalAccess', _127 => _127.value, 'access', _128 => _128.codePointAt, 'call', _129 => _129(0)]);
10567
10590
  if (c !== void 0 && c >= 64 && c <= 126) {
10568
10591
  break;
10569
10592
  }
@@ -10572,12 +10595,12 @@ function writeLineToScreen(screen, line, x, y, screenWidth, stylePool, charCache
10572
10595
  charIdx++;
10573
10596
  while (charIdx < characters.length - 1) {
10574
10597
  charIdx++;
10575
- const c = _optionalChain([characters, 'access', _101 => _101[charIdx], 'optionalAccess', _102 => _102.value]);
10598
+ const c = _optionalChain([characters, 'access', _130 => _130[charIdx], 'optionalAccess', _131 => _131.value]);
10576
10599
  if (c === "\x07") {
10577
10600
  break;
10578
10601
  }
10579
10602
  if (c === "\x1B") {
10580
- const nextC = _optionalChain([characters, 'access', _103 => _103[charIdx + 1], 'optionalAccess', _104 => _104.value]);
10603
+ const nextC = _optionalChain([characters, 'access', _132 => _132[charIdx + 1], 'optionalAccess', _133 => _133.value]);
10581
10604
  if (nextC === "\\") {
10582
10605
  charIdx++;
10583
10606
  break;
@@ -10693,7 +10716,7 @@ var renderBorder = (x, y, node, output) => {
10693
10716
  );
10694
10717
  const topBorderLine = showTopBorder ? (showLeftBorder ? box.topLeft : "") + box.top.repeat(contentWidth) + (showRightBorder ? box.topRight : "") : "";
10695
10718
  let topBorder;
10696
- if (showTopBorder && _optionalChain([node, 'access', _105 => _105.style, 'access', _106 => _106.borderText, 'optionalAccess', _107 => _107.position]) === "top") {
10719
+ if (showTopBorder && _optionalChain([node, 'access', _134 => _134.style, 'access', _135 => _135.borderText, 'optionalAccess', _136 => _136.position]) === "top") {
10697
10720
  const [before, text, after] = embedTextInBorder(
10698
10721
  topBorderLine,
10699
10722
  node.style.borderText.content,
@@ -10731,7 +10754,7 @@ var renderBorder = (x, y, node, output) => {
10731
10754
  }
10732
10755
  const bottomBorderLine = showBottomBorder ? (showLeftBorder ? box.bottomLeft : "") + box.bottom.repeat(contentWidth) + (showRightBorder ? box.bottomRight : "") : "";
10733
10756
  let bottomBorder;
10734
- if (showBottomBorder && _optionalChain([node, 'access', _108 => _108.style, 'access', _109 => _109.borderText, 'optionalAccess', _110 => _110.position]) === "bottom") {
10757
+ if (showBottomBorder && _optionalChain([node, 'access', _137 => _137.style, 'access', _138 => _138.borderText, 'optionalAccess', _139 => _139.position]) === "bottom") {
10735
10758
  const [before, text, after] = embedTextInBorder(
10736
10759
  bottomBorderLine,
10737
10760
  node.style.borderText.content,
@@ -10938,7 +10961,7 @@ function wrapWithSoftWrap(plainText, maxWidth, textWrap) {
10938
10961
  return { wrapped: outLines.join("\n"), softWrap };
10939
10962
  }
10940
10963
  function applyPaddingToText(node, text, softWrap) {
10941
- const yogaNode = _optionalChain([node, 'access', _111 => _111.childNodes, 'access', _112 => _112[0], 'optionalAccess', _113 => _113.yogaNode]);
10964
+ const yogaNode = _optionalChain([node, 'access', _140 => _140.childNodes, 'access', _141 => _141[0], 'optionalAccess', _142 => _142.yogaNode]);
10942
10965
  if (yogaNode) {
10943
10966
  const offsetX = yogaNode.getComputedLeft();
10944
10967
  const offsetY = yogaNode.getComputedTop();
@@ -11114,8 +11137,8 @@ function renderNodeToOutput(node, output, {
11114
11137
  (_nullishCoalesce(y2, () => ( y + height))) - (_nullishCoalesce(y1, () => ( y))) - padTop - yogaNode.getComputedPadding(LayoutEdge.Bottom)
11115
11138
  );
11116
11139
  const content = node.childNodes.find((c) => c.yogaNode);
11117
- const contentYoga = _optionalChain([content, 'optionalAccess', _114 => _114.yogaNode]);
11118
- const scrollHeight = _nullishCoalesce(_optionalChain([contentYoga, 'optionalAccess', _115 => _115.getComputedHeight, 'call', _116 => _116()]), () => ( 0));
11140
+ const contentYoga = _optionalChain([content, 'optionalAccess', _143 => _143.yogaNode]);
11141
+ const scrollHeight = _nullishCoalesce(_optionalChain([contentYoga, 'optionalAccess', _144 => _144.getComputedHeight, 'call', _145 => _145()]), () => ( 0));
11119
11142
  const prevScrollHeight = _nullishCoalesce(node.scrollHeight, () => ( scrollHeight));
11120
11143
  const prevInnerHeight = _nullishCoalesce(node.scrollViewportHeight, () => ( innerHeight));
11121
11144
  node.scrollHeight = scrollHeight;
@@ -11123,7 +11146,7 @@ function renderNodeToOutput(node, output, {
11123
11146
  node.scrollViewportTop = (_nullishCoalesce(y1, () => ( y))) + padTop;
11124
11147
  const maxScroll = Math.max(0, scrollHeight - innerHeight);
11125
11148
  if (node.scrollAnchor) {
11126
- const anchorTop = _optionalChain([node, 'access', _117 => _117.scrollAnchor, 'access', _118 => _118.el, 'access', _119 => _119.yogaNode, 'optionalAccess', _120 => _120.getComputedTop, 'call', _121 => _121()]);
11149
+ const anchorTop = _optionalChain([node, 'access', _146 => _146.scrollAnchor, 'access', _147 => _147.el, 'access', _148 => _148.yogaNode, 'optionalAccess', _149 => _149.getComputedTop, 'call', _150 => _150()]);
11127
11150
  if (anchorTop != null) {
11128
11151
  node.scrollTop = anchorTop + node.scrollAnchor.offset;
11129
11152
  node.pendingScrollDelta = void 0;
@@ -11178,7 +11201,7 @@ function renderNodeToOutput(node, output, {
11178
11201
  const delta = contentCached.y - contentY;
11179
11202
  const regionTop = Math.floor(y + contentYoga.getComputedTop());
11180
11203
  const regionBottom = regionTop + innerHeight - 1;
11181
- if (_optionalChain([cached, 'optionalAccess', _122 => _122.y]) === y && cached.height === height && innerHeight > 0 && Math.abs(delta) < innerHeight) {
11204
+ if (_optionalChain([cached, 'optionalAccess', _151 => _151.y]) === y && cached.height === height && innerHeight > 0 && Math.abs(delta) < innerHeight) {
11182
11205
  hint = { top: regionTop, bottom: regionBottom, delta };
11183
11206
  scrollHint = hint;
11184
11207
  } else {
@@ -11186,7 +11209,7 @@ function renderNodeToOutput(node, output, {
11186
11209
  }
11187
11210
  }
11188
11211
  const scrollHeight2 = contentYoga.getComputedHeight();
11189
- const prevHeight = _nullishCoalesce(_optionalChain([contentCached, 'optionalAccess', _123 => _123.height]), () => ( scrollHeight2));
11212
+ const prevHeight = _nullishCoalesce(_optionalChain([contentCached, 'optionalAccess', _152 => _152.height]), () => ( scrollHeight2));
11190
11213
  const heightDelta = scrollHeight2 - prevHeight;
11191
11214
  const safeForFastPath = !hint || heightDelta === 0 || hint.delta > 0 && heightDelta === hint.delta;
11192
11215
  if (!safeForFastPath) scrollHint = null;
@@ -11477,7 +11500,7 @@ function renderScrolledChildren(node, output, offsetX, offsetY, hasRemovedChild,
11477
11500
  const cached = nodeCache.get(childElem);
11478
11501
  let top;
11479
11502
  let height;
11480
- if (_optionalChain([cached, 'optionalAccess', _124 => _124.top]) !== void 0 && !childElem.dirty && cumHeightShift === 0) {
11503
+ if (_optionalChain([cached, 'optionalAccess', _153 => _153.top]) !== void 0 && !childElem.dirty && cumHeightShift === 0) {
11481
11504
  top = cached.top;
11482
11505
  height = cached.height;
11483
11506
  } else {
@@ -11587,8 +11610,8 @@ function createRenderer2(node, stylePool) {
11587
11610
  const backScreen = backFrame.screen;
11588
11611
  const charPool = backScreen.charPool;
11589
11612
  const hyperlinkPool = backScreen.hyperlinkPool;
11590
- const computedHeight = _optionalChain([node, 'access', _125 => _125.yogaNode, 'optionalAccess', _126 => _126.getComputedHeight, 'call', _127 => _127()]);
11591
- const computedWidth = _optionalChain([node, 'access', _128 => _128.yogaNode, 'optionalAccess', _129 => _129.getComputedWidth, 'call', _130 => _130()]);
11613
+ const computedHeight = _optionalChain([node, 'access', _154 => _154.yogaNode, 'optionalAccess', _155 => _155.getComputedHeight, 'call', _156 => _156()]);
11614
+ const computedWidth = _optionalChain([node, 'access', _157 => _157.yogaNode, 'optionalAccess', _158 => _158.getComputedWidth, 'call', _159 => _159()]);
11592
11615
  const hasInvalidHeight = computedHeight === void 0 || !Number.isFinite(computedHeight) || computedHeight < 0;
11593
11616
  const hasInvalidWidth = computedWidth === void 0 || !Number.isFinite(computedWidth) || computedWidth < 0;
11594
11617
  if (!node.yogaNode || hasInvalidHeight || hasInvalidWidth) {
@@ -12013,7 +12036,7 @@ var Ink = (_class19 = class {
12013
12036
  clearTimeout(this.drainTimer);
12014
12037
  this.drainTimer = null;
12015
12038
  }
12016
- _chunkBUU5PZK2cjs.flushInteractionTime.call(void 0, );
12039
+ _chunkUXOCVJJ6cjs.flushInteractionTime.call(void 0, );
12017
12040
  const renderStart = performance.now();
12018
12041
  const terminalWidth = this.options.stdout.columns || 80;
12019
12042
  const terminalRows = this.options.stdout.rows || 24;
@@ -12220,7 +12243,7 @@ var Ink = (_class19 = class {
12220
12243
  cacheHits: 0,
12221
12244
  live: 0
12222
12245
  };
12223
- _optionalChain([this, 'access', _133 => _133.options, 'access', _134 => _134.onFrame, 'optionalCall', _135 => _135({
12246
+ _optionalChain([this, 'access', _162 => _162.options, 'access', _163 => _163.onFrame, 'optionalCall', _164 => _164({
12224
12247
  durationMs: performance.now() - renderStart,
12225
12248
  phases: {
12226
12249
  renderer: rendererMs,
@@ -12358,7 +12381,7 @@ var Ink = (_class19 = class {
12358
12381
  */
12359
12382
  detachForShutdown() {
12360
12383
  this.isUnmounted = true;
12361
- _optionalChain([this, 'access', _136 => _136.scheduleRender, 'access', _137 => _137.cancel, 'optionalCall', _138 => _138()]);
12384
+ _optionalChain([this, 'access', _165 => _165.scheduleRender, 'access', _166 => _166.cancel, 'optionalCall', _167 => _167()]);
12362
12385
  const stdin = this.options.stdin;
12363
12386
  this.drainStdin();
12364
12387
  if (stdin.isTTY && stdin.isRaw && stdin.setRawMode) {
@@ -12668,9 +12691,9 @@ var Ink = (_class19 = class {
12668
12691
  if (!this.altScreenActive) return void 0;
12669
12692
  const screen = this.frontFrame.screen;
12670
12693
  const cell = cellAt(screen, col, row);
12671
- let url = _optionalChain([cell, 'optionalAccess', _139 => _139.hyperlink]);
12672
- if (!url && _optionalChain([cell, 'optionalAccess', _140 => _140.width]) === 2 /* SpacerTail */ && col > 0) {
12673
- url = _optionalChain([cellAt, 'call', _141 => _141(screen, col - 1, row), 'optionalAccess', _142 => _142.hyperlink]);
12694
+ let url = _optionalChain([cell, 'optionalAccess', _168 => _168.hyperlink]);
12695
+ if (!url && _optionalChain([cell, 'optionalAccess', _169 => _169.width]) === 2 /* SpacerTail */ && col > 0) {
12696
+ url = _optionalChain([cellAt, 'call', _170 => _170(screen, col - 1, row), 'optionalAccess', _171 => _171.hyperlink]);
12674
12697
  }
12675
12698
  return _nullishCoalesce(url, () => ( findPlainTextUrlAt(screen, col, row)));
12676
12699
  }
@@ -12685,7 +12708,7 @@ var Ink = (_class19 = class {
12685
12708
  * the mutable field at call time — not the undefined-at-render value.
12686
12709
  */
12687
12710
  openHyperlink(url) {
12688
- _optionalChain([this, 'access', _143 => _143.onHyperlinkClick, 'optionalCall', _144 => _144(url)]);
12711
+ _optionalChain([this, 'access', _172 => _172.onHyperlinkClick, 'optionalCall', _173 => _173(url)]);
12689
12712
  }
12690
12713
  /**
12691
12714
  * Handle a double- or triple-click at (col, row): select the word or
@@ -12777,7 +12800,7 @@ var Ink = (_class19 = class {
12777
12800
  this.options.stdout.write(data);
12778
12801
  }
12779
12802
  __init132() {this.setCursorDeclaration = (decl, clearIfNode) => {
12780
- if (decl === null && clearIfNode !== void 0 && _optionalChain([this, 'access', _145 => _145.cursorDeclaration, 'optionalAccess', _146 => _146.node]) !== clearIfNode) {
12803
+ if (decl === null && clearIfNode !== void 0 && _optionalChain([this, 'access', _174 => _174.cursorDeclaration, 'optionalAccess', _175 => _175.node]) !== clearIfNode) {
12781
12804
  return;
12782
12805
  }
12783
12806
  this.cursorDeclaration = decl;
@@ -12797,8 +12820,8 @@ var Ink = (_class19 = class {
12797
12820
  if (typeof this.restoreConsole === "function") {
12798
12821
  this.restoreConsole();
12799
12822
  }
12800
- _optionalChain([this, 'access', _147 => _147.restoreStderr, 'optionalCall', _148 => _148()]);
12801
- _optionalChain([this, 'access', _149 => _149.unsubscribeTTYHandlers, 'optionalCall', _150 => _150()]);
12823
+ _optionalChain([this, 'access', _176 => _176.restoreStderr, 'optionalCall', _177 => _177()]);
12824
+ _optionalChain([this, 'access', _178 => _178.unsubscribeTTYHandlers, 'optionalCall', _179 => _179()]);
12802
12825
  const diff2 = this.log.renderPreviousOutput_DEPRECATED(this.frontFrame);
12803
12826
  writeDiffToTerminal(this.terminal, optimize(diff2));
12804
12827
  if (this.options.stdout.isTTY) {
@@ -12816,7 +12839,7 @@ var Ink = (_class19 = class {
12816
12839
  if (supportsTabStatus()) _fs.writeSync.call(void 0, 1, wrapForMultiplexer(CLEAR_TAB_STATUS));
12817
12840
  }
12818
12841
  this.isUnmounted = true;
12819
- _optionalChain([this, 'access', _151 => _151.scheduleRender, 'access', _152 => _152.cancel, 'optionalCall', _153 => _153()]);
12842
+ _optionalChain([this, 'access', _180 => _180.scheduleRender, 'access', _181 => _181.cancel, 'optionalCall', _182 => _182()]);
12820
12843
  if (this.drainTimer !== null) {
12821
12844
  clearTimeout(this.drainTimer);
12822
12845
  this.drainTimer = null;
@@ -12824,7 +12847,7 @@ var Ink = (_class19 = class {
12824
12847
  reconciler_default.updateContainerSync(null, this.container, null, _noopjs2.default);
12825
12848
  reconciler_default.flushSyncWork();
12826
12849
  instances_default.delete(this.options.stdout);
12827
- _optionalChain([this, 'access', _154 => _154.rootNode, 'access', _155 => _155.yogaNode, 'optionalAccess', _156 => _156.free, 'call', _157 => _157()]);
12850
+ _optionalChain([this, 'access', _183 => _183.rootNode, 'access', _184 => _184.yogaNode, 'optionalAccess', _185 => _185.free, 'call', _186 => _186()]);
12828
12851
  this.rootNode.yogaNode = void 0;
12829
12852
  if (error instanceof Error) {
12830
12853
  this.rejectExitPromise(error);
@@ -12915,7 +12938,7 @@ var Ink = (_class19 = class {
12915
12938
  }
12916
12939
  } finally {
12917
12940
  reentered = false;
12918
- _optionalChain([callback, 'optionalCall', _158 => _158()]);
12941
+ _optionalChain([callback, 'optionalCall', _187 => _187()]);
12919
12942
  }
12920
12943
  return true;
12921
12944
  };
@@ -12939,7 +12962,7 @@ function drainStdin(stdin = process.stdin) {
12939
12962
  const wasRaw = tty.isRaw === true;
12940
12963
  let fd = -1;
12941
12964
  try {
12942
- if (!wasRaw) _optionalChain([tty, 'access', _159 => _159.setRawMode, 'optionalCall', _160 => _160(true)]);
12965
+ if (!wasRaw) _optionalChain([tty, 'access', _188 => _188.setRawMode, 'optionalCall', _189 => _189(true)]);
12943
12966
  fd = _fs.openSync.call(void 0, "/dev/tty", _fs.constants.O_RDONLY | _fs.constants.O_NONBLOCK);
12944
12967
  const buf = Buffer.alloc(1024);
12945
12968
  for (let i = 0; i < 64; i++) {
@@ -12955,7 +12978,7 @@ function drainStdin(stdin = process.stdin) {
12955
12978
  }
12956
12979
  if (!wasRaw) {
12957
12980
  try {
12958
- _optionalChain([tty, 'access', _161 => _161.setRawMode, 'optionalCall', _162 => _162(false)]);
12981
+ _optionalChain([tty, 'access', _190 => _190.setRawMode, 'optionalCall', _191 => _191(false)]);
12959
12982
  } catch (e6) {
12960
12983
  }
12961
12984
  }
@@ -13072,9 +13095,9 @@ var useInput = (inputHandler, options = {}) => {
13072
13095
  }
13073
13096
  });
13074
13097
  _react.useEffect.call(void 0, () => {
13075
- _optionalChain([internal_eventEmitter, 'optionalAccess', _163 => _163.on, 'call', _164 => _164("input", handleData)]);
13098
+ _optionalChain([internal_eventEmitter, 'optionalAccess', _192 => _192.on, 'call', _193 => _193("input", handleData)]);
13076
13099
  return () => {
13077
- _optionalChain([internal_eventEmitter, 'optionalAccess', _165 => _165.removeListener, 'call', _166 => _166("input", handleData)]);
13100
+ _optionalChain([internal_eventEmitter, 'optionalAccess', _194 => _194.removeListener, 'call', _195 => _195("input", handleData)]);
13078
13101
  };
13079
13102
  }, [internal_eventEmitter, handleData]);
13080
13103
  };
@@ -13608,7 +13631,7 @@ function Banner({ model, effort, cwd }) {
13608
13631
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { flexDirection: "column", children: [
13609
13632
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { children: [
13610
13633
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { bold: true, children: title }),
13611
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { dim: true, children: " v" + _chunkR47ROHGLcjs.getCurrentVersion.call(void 0, ) })
13634
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { dim: true, children: " v" + _chunkMV7YI4WOcjs.getCurrentVersion.call(void 0, ) })
13612
13635
  ] }),
13613
13636
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { children: [
13614
13637
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { children: modelName }),
@@ -13639,16 +13662,16 @@ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
13639
13662
  var POLL_INTERVAL_MS = 30 * 60 * 1e3;
13640
13663
  var PACKAGE_NAME = "@cjhyy/code-shell";
13641
13664
  function UpdateBanner() {
13642
- const [info, setInfo] = _react.useState.call(void 0, _chunkR47ROHGLcjs.getUpdateAvailable.call(void 0, ));
13665
+ const [info, setInfo] = _react.useState.call(void 0, _chunkMV7YI4WOcjs.getUpdateAvailable.call(void 0, ));
13643
13666
  _react.useEffect.call(void 0, () => {
13644
13667
  let cancelled = false;
13645
13668
  const refresh = () => {
13646
- _chunkR47ROHGLcjs.checkForUpdate.call(void 0, );
13669
+ _chunkMV7YI4WOcjs.checkForUpdate.call(void 0, );
13647
13670
  setTimeout(() => {
13648
13671
  if (cancelled) return;
13649
- const next = _chunkR47ROHGLcjs.getUpdateAvailable.call(void 0, );
13672
+ const next = _chunkMV7YI4WOcjs.getUpdateAvailable.call(void 0, );
13650
13673
  setInfo(next);
13651
- if (_optionalChain([next, 'optionalAccess', _167 => _167.canAutoInstall])) _chunkR47ROHGLcjs.scheduleAutoInstallOnExit.call(void 0, );
13674
+ if (_optionalChain([next, 'optionalAccess', _196 => _196.canAutoInstall])) _chunkMV7YI4WOcjs.scheduleAutoInstallOnExit.call(void 0, );
13652
13675
  }, 6e3);
13653
13676
  };
13654
13677
  refresh();
@@ -13659,7 +13682,7 @@ function UpdateBanner() {
13659
13682
  };
13660
13683
  }, []);
13661
13684
  if (!info) return null;
13662
- const current = _chunkR47ROHGLcjs.getCurrentVersion.call(void 0, );
13685
+ const current = _chunkMV7YI4WOcjs.getCurrentVersion.call(void 0, );
13663
13686
  const command = info.canAutoInstall ? null : `sudo npm install -g ${PACKAGE_NAME}@${info.latestVersion}`;
13664
13687
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { marginLeft: 1, marginY: 0, flexDirection: "column", children: [
13665
13688
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { color: "ansi:yellow", children: `\u2726 Update available: v${current} \u2192 v${info.latestVersion}` }),
@@ -13738,11 +13761,11 @@ var ADDITIONAL_HYPERLINK_TERMINALS = [
13738
13761
  "iTerm2"
13739
13762
  ];
13740
13763
  function supportsHyperlinks(options) {
13741
- const stdoutSupported = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _168 => _168.stdoutSupported]), () => ( _supportshyperlinks2.default.stdout));
13764
+ const stdoutSupported = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _197 => _197.stdoutSupported]), () => ( _supportshyperlinks2.default.stdout));
13742
13765
  if (stdoutSupported) {
13743
13766
  return true;
13744
13767
  }
13745
- const env2 = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _169 => _169.env]), () => ( process.env));
13768
+ const env2 = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _198 => _198.env]), () => ( process.env));
13746
13769
  const termProgram = env2["TERM_PROGRAM"];
13747
13770
  if (termProgram && ADDITIONAL_HYPERLINK_TERMINALS.includes(termProgram)) {
13748
13771
  return true;
@@ -13752,7 +13775,7 @@ function supportsHyperlinks(options) {
13752
13775
  return true;
13753
13776
  }
13754
13777
  const term = env2["TERM"];
13755
- if (_optionalChain([term, 'optionalAccess', _170 => _170.includes, 'call', _171 => _171("kitty")])) {
13778
+ if (_optionalChain([term, 'optionalAccess', _199 => _199.includes, 'call', _200 => _200("kitty")])) {
13756
13779
  return true;
13757
13780
  }
13758
13781
  return false;
@@ -13938,13 +13961,13 @@ function parseExtendedColor(params, idx) {
13938
13961
  }
13939
13962
  const next = params[idx + 1];
13940
13963
  if (!next) return null;
13941
- if (next.value === 5 && _optionalChain([params, 'access', _172 => _172[idx + 2], 'optionalAccess', _173 => _173.value]) !== null && _optionalChain([params, 'access', _174 => _174[idx + 2], 'optionalAccess', _175 => _175.value]) !== void 0) {
13964
+ if (next.value === 5 && _optionalChain([params, 'access', _201 => _201[idx + 2], 'optionalAccess', _202 => _202.value]) !== null && _optionalChain([params, 'access', _203 => _203[idx + 2], 'optionalAccess', _204 => _204.value]) !== void 0) {
13942
13965
  return { index: params[idx + 2].value };
13943
13966
  }
13944
13967
  if (next.value === 2) {
13945
- const r = _optionalChain([params, 'access', _176 => _176[idx + 2], 'optionalAccess', _177 => _177.value]);
13946
- const g = _optionalChain([params, 'access', _178 => _178[idx + 3], 'optionalAccess', _179 => _179.value]);
13947
- const b = _optionalChain([params, 'access', _180 => _180[idx + 4], 'optionalAccess', _181 => _181.value]);
13968
+ const r = _optionalChain([params, 'access', _205 => _205[idx + 2], 'optionalAccess', _206 => _206.value]);
13969
+ const g = _optionalChain([params, 'access', _207 => _207[idx + 3], 'optionalAccess', _208 => _208.value]);
13970
+ const b = _optionalChain([params, 'access', _209 => _209[idx + 4], 'optionalAccess', _210 => _210.value]);
13948
13971
  if (r !== null && r !== void 0 && g !== null && g !== void 0 && b !== null && b !== void 0) {
13949
13972
  return { r, g, b };
13950
13973
  }
@@ -14651,7 +14674,7 @@ function TextInput({
14651
14674
  use_input_default((input, key) => {
14652
14675
  if (!focus) return;
14653
14676
  if (key.return) {
14654
- _optionalChain([onSubmit, 'optionalCall', _182 => _182(value)]);
14677
+ _optionalChain([onSubmit, 'optionalCall', _211 => _211(value)]);
14655
14678
  return;
14656
14679
  }
14657
14680
  if (key.backspace || key.delete) {
@@ -15303,7 +15326,7 @@ function renderToolOutput(toolName, content, expanded) {
15303
15326
  };
15304
15327
  }
15305
15328
  case "Bash": {
15306
- if (totalLines <= 1 && _optionalChain([rawLines, 'access', _183 => _183[0], 'optionalAccess', _184 => _184.trim, 'call', _185 => _185()]) === "") {
15329
+ if (totalLines <= 1 && _optionalChain([rawLines, 'access', _212 => _212[0], 'optionalAccess', _213 => _213.trim, 'call', _214 => _214()]) === "") {
15307
15330
  return { summary: "(no output)", lines: [], hiddenCount: 0 };
15308
15331
  }
15309
15332
  if (expanded) {
@@ -16572,7 +16595,7 @@ function ProviderModelFlow({
16572
16595
  const existingModelIdSet = new Set(existingModelIds);
16573
16596
  const kindEntries = KIND_ORDER.map((k) => ({
16574
16597
  type: "kind",
16575
- label: _nullishCoalesce(_nullishCoalesce(KIND_LABEL_OVERRIDES[k], () => ( _optionalChain([_chunkMY5XHADUcjs.PROVIDER_KINDS, 'access', _186 => _186[k], 'optionalAccess', _187 => _187.label]))), () => ( k)),
16598
+ label: _nullishCoalesce(_nullishCoalesce(KIND_LABEL_OVERRIDES[k], () => ( _optionalChain([_chunkMY5XHADUcjs.PROVIDER_KINDS, 'access', _215 => _215[k], 'optionalAccess', _216 => _216.label]))), () => ( k)),
16576
16599
  kind: k
16577
16600
  }));
16578
16601
  const existingProviderKeys = existingProviders.map((p) => p.key);
@@ -16639,7 +16662,7 @@ function ProviderModelFlow({
16639
16662
  function enterAliasStep(pickedModels) {
16640
16663
  const aliasesInit = [];
16641
16664
  const used = [...existingModelKeys];
16642
- const kind = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _188 => _188.kind]), () => ( (selectedKind === "custom" ? "" : selectedKind)));
16665
+ const kind = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _217 => _217.kind]), () => ( (selectedKind === "custom" ? "" : selectedKind)));
16643
16666
  for (const m of pickedModels) {
16644
16667
  const a = deriveModelAlias(m.id, used, kind);
16645
16668
  aliasesInit.push(a);
@@ -16677,10 +16700,10 @@ function ProviderModelFlow({
16677
16700
  apiKey: selectedKind === "ollama" ? void 0 : apiKey,
16678
16701
  label: _chunkMY5XHADUcjs.PROVIDER_KINDS[selectedKind].label
16679
16702
  };
16680
- const providerKey = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _189 => _189.key]), () => ( newProvider.key));
16681
- const effectiveBaseUrl = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _190 => _190.baseUrl]), () => ( newProvider.baseUrl));
16682
- const effectiveApiKey = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _191 => _191.apiKey]), () => ( newProvider.apiKey));
16683
- const effectiveKind = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _192 => _192.kind]), () => ( selectedKind));
16703
+ const providerKey = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _218 => _218.key]), () => ( newProvider.key));
16704
+ const effectiveBaseUrl = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _219 => _219.baseUrl]), () => ( newProvider.baseUrl));
16705
+ const effectiveApiKey = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _220 => _220.apiKey]), () => ( newProvider.apiKey));
16706
+ const effectiveKind = _nullishCoalesce(_optionalChain([useExistingProvider, 'optionalAccess', _221 => _221.kind]), () => ( selectedKind));
16684
16707
  const protocol = effectiveKind === "anthropic" ? "anthropic" : "openai";
16685
16708
  const addedModels = pickedModels.map((m, i) => ({
16686
16709
  key: aliases[i],
@@ -16758,7 +16781,7 @@ function ProviderModelFlow({
16758
16781
  return;
16759
16782
  }
16760
16783
  const rows = keyChoicesFor(kind);
16761
- const onlyPaste = rows.length === 1 && _optionalChain([rows, 'access', _193 => _193[0], 'optionalAccess', _194 => _194.type]) === "paste";
16784
+ const onlyPaste = rows.length === 1 && _optionalChain([rows, 'access', _222 => _222[0], 'optionalAccess', _223 => _223.type]) === "paste";
16762
16785
  setKeyMenuDone(onlyPaste);
16763
16786
  setStep("key");
16764
16787
  }
@@ -16800,11 +16823,11 @@ function ProviderModelFlow({
16800
16823
  maxOutputTokens: 0
16801
16824
  };
16802
16825
  setFetchResult((prev) => ({
16803
- fetchedAt: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _195 => _195.fetchedAt]), () => ( (/* @__PURE__ */ new Date()).toISOString())),
16804
- providerKey: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _196 => _196.providerKey]), () => ( "")),
16805
- models: [..._nullishCoalesce(_optionalChain([prev, 'optionalAccess', _197 => _197.models]), () => ( [])), fake],
16806
- ..._optionalChain([prev, 'optionalAccess', _198 => _198.error]) ? { error: prev.error } : {},
16807
- ..._optionalChain([prev, 'optionalAccess', _199 => _199.fromCache]) ? { fromCache: prev.fromCache } : {}
16826
+ fetchedAt: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _224 => _224.fetchedAt]), () => ( (/* @__PURE__ */ new Date()).toISOString())),
16827
+ providerKey: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _225 => _225.providerKey]), () => ( "")),
16828
+ models: [..._nullishCoalesce(_optionalChain([prev, 'optionalAccess', _226 => _226.models]), () => ( [])), fake],
16829
+ ..._optionalChain([prev, 'optionalAccess', _227 => _227.error]) ? { error: prev.error } : {},
16830
+ ..._optionalChain([prev, 'optionalAccess', _228 => _228.fromCache]) ? { fromCache: prev.fromCache } : {}
16808
16831
  }));
16809
16832
  const newPicked = new Set(picked);
16810
16833
  newPicked.add(manualId);
@@ -16983,7 +17006,7 @@ function ProviderModelFlow({
16983
17006
  ] }) }),
16984
17007
  step === "fetch" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { flexDirection: "column", marginTop: 1, children: [
16985
17008
  fetchLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { dim: true, children: "Loading\u2026" }),
16986
- !fetchLoading && _optionalChain([fetchResult, 'optionalAccess', _200 => _200.error]) && fetchResult.models.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { flexDirection: "column", children: [
17009
+ !fetchLoading && _optionalChain([fetchResult, 'optionalAccess', _229 => _229.error]) && fetchResult.models.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Box_default, { flexDirection: "column", children: [
16987
17010
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Text, { color: "red", children: [
16988
17011
  "Error: ",
16989
17012
  fetchResult.error
@@ -17124,7 +17147,7 @@ function OnboardingPrompt({
17124
17147
  apiKey: _nullishCoalesce(active.apiKey, () => ( "")),
17125
17148
  baseUrl: active.baseUrl
17126
17149
  };
17127
- _chunkBWTOS5BHcjs.appendOnboardingResult.call(void 0, {
17150
+ _chunkWZJV6DJCcjs.appendOnboardingResult.call(void 0, {
17128
17151
  activeKey: active.key,
17129
17152
  activeMirror: {
17130
17153
  provider: onboardingResult.provider,
@@ -17144,7 +17167,7 @@ function OnboardingPrompt({
17144
17167
  addedModels: result.addedModels
17145
17168
  });
17146
17169
  if (picks.size >= 2) {
17147
- _chunkBWTOS5BHcjs.saveArenaSettingsByKeys.call(void 0, [...picks]);
17170
+ _chunkWZJV6DJCcjs.saveArenaSettingsByKeys.call(void 0, [...picks]);
17148
17171
  }
17149
17172
  onComplete(onboardingResult);
17150
17173
  }
@@ -17167,7 +17190,7 @@ function OnboardingPrompt({
17167
17190
  existingProviders,
17168
17191
  existingModelKeys,
17169
17192
  existingModelIds,
17170
- detectedEnvKeys: _chunkBWTOS5BHcjs.detectEnvKeys.call(void 0, ).map((d) => ({
17193
+ detectedEnvKeys: _chunkWZJV6DJCcjs.detectEnvKeys.call(void 0, ).map((d) => ({
17171
17194
  envKey: d.envKey,
17172
17195
  apiKey: d.apiKey,
17173
17196
  // ProviderDef.id matches ProviderKindName values for the known
@@ -17497,7 +17520,7 @@ function ModelManager({
17497
17520
  setArena((prev) => prev.filter((_, i) => i !== arenaCursor));
17498
17521
  setArenaCursor((c) => Math.max(0, Math.min(arena.length - 2, c)));
17499
17522
  setDirty(true);
17500
- const label = _optionalChain([removed, 'optionalAccess', _201 => _201.kind]) === "key" ? removed.value : _nullishCoalesce(_optionalChain([removed, 'optionalAccess', _202 => _202.label]), () => ( ""));
17523
+ const label = _optionalChain([removed, 'optionalAccess', _230 => _230.kind]) === "key" ? removed.value : _nullishCoalesce(_optionalChain([removed, 'optionalAccess', _231 => _231.label]), () => ( ""));
17501
17524
  setBanner({ kind: "info", text: `\u5DF2\u79FB\u9664: ${label} (\u672A\u4FDD\u5B58)` });
17502
17525
  return;
17503
17526
  }
@@ -17873,7 +17896,7 @@ var CommandRegistry = (_class21 = class {constructor() { _class21.prototype.__in
17873
17896
  if (!cmds || cmds.length === 0) continue;
17874
17897
  lines.push(` ${label}:`);
17875
17898
  for (const cmd of cmds.sort((a, b) => a.name.localeCompare(b.name))) {
17876
- const aliases = _optionalChain([cmd, 'access', _203 => _203.aliases, 'optionalAccess', _204 => _204.length]) ? ` (${cmd.aliases.join(", ")})` : "";
17899
+ const aliases = _optionalChain([cmd, 'access', _232 => _232.aliases, 'optionalAccess', _233 => _233.length]) ? ` (${cmd.aliases.join(", ")})` : "";
17877
17900
  lines.push(` ${cmd.name.padEnd(16)} ${cmd.description}${aliases}`);
17878
17901
  }
17879
17902
  lines.push("");
@@ -18296,7 +18319,7 @@ ${lines.join("\n")}`
18296
18319
  }
18297
18320
  try {
18298
18321
  const result = await ctx.client.configure({ model: key });
18299
- if (!_optionalChain([result, 'optionalAccess', _205 => _205.ok]) || !result.model) {
18322
+ if (!_optionalChain([result, 'optionalAccess', _234 => _234.ok]) || !result.model) {
18300
18323
  ctx.addStatus(`Failed to switch model: server did not confirm switch`);
18301
18324
  return;
18302
18325
  }
@@ -18527,7 +18550,7 @@ Open with: ${editor} ${dir}`);
18527
18550
  const detailResult = await ctx.client.query("session_detail", sessionId);
18528
18551
  const session = detailResult.data;
18529
18552
  ctx.setSessionId(sessionId);
18530
- if (ctx.loadChatEntries && _optionalChain([session, 'optionalAccess', _206 => _206.transcript])) {
18553
+ if (ctx.loadChatEntries && _optionalChain([session, 'optionalAccess', _235 => _235.transcript])) {
18531
18554
  const events = session.transcript;
18532
18555
  const entries = [];
18533
18556
  for (const event of events) {
@@ -18536,7 +18559,7 @@ Open with: ${editor} ${dir}`);
18536
18559
  const role = event.data.role;
18537
18560
  const content = event.data.content;
18538
18561
  if (role === "user") {
18539
- const text = typeof content === "string" ? content : Array.isArray(content) ? content.filter((b) => _optionalChain([b, 'optionalAccess', _207 => _207.type]) === "text").map((b) => _nullishCoalesce(b.text, () => ( ""))).join("") : "";
18562
+ const text = typeof content === "string" ? content : Array.isArray(content) ? content.filter((b) => _optionalChain([b, 'optionalAccess', _236 => _236.type]) === "text").map((b) => _nullishCoalesce(b.text, () => ( ""))).join("") : "";
18540
18563
  if (text) entries.push({ type: "user", text });
18541
18564
  } else if (role === "assistant") {
18542
18565
  const parts = [];
@@ -18544,11 +18567,11 @@ Open with: ${editor} ${dir}`);
18544
18567
  if (content) parts.push(content);
18545
18568
  } else if (Array.isArray(content)) {
18546
18569
  for (const b of content) {
18547
- if (_optionalChain([b, 'optionalAccess', _208 => _208.type]) === "reasoning" && b.text) {
18570
+ if (_optionalChain([b, 'optionalAccess', _237 => _237.type]) === "reasoning" && b.text) {
18548
18571
  parts.push(`[thinking]
18549
18572
  ${b.text}
18550
18573
  [/thinking]`);
18551
- } else if (_optionalChain([b, 'optionalAccess', _209 => _209.type]) === "text" && b.text) {
18574
+ } else if (_optionalChain([b, 'optionalAccess', _238 => _238.type]) === "text" && b.text) {
18552
18575
  parts.push(b.text);
18553
18576
  }
18554
18577
  }
@@ -18580,7 +18603,7 @@ ${b.text}
18580
18603
  ctx.loadChatEntries(entries);
18581
18604
  }
18582
18605
  ctx.addStatus(
18583
- `Resumed session ${sessionId.slice(0, 8)}\u2026 (${_nullishCoalesce(_optionalChain([session, 'optionalAccess', _210 => _210.state, 'optionalAccess', _211 => _211.turnCount]), () => ( "?"))} turns)`
18606
+ `Resumed session ${sessionId.slice(0, 8)}\u2026 (${_nullishCoalesce(_optionalChain([session, 'optionalAccess', _239 => _239.state, 'optionalAccess', _240 => _240.turnCount]), () => ( "?"))} turns)`
18584
18607
  );
18585
18608
  } catch (err) {
18586
18609
  ctx.addStatus(`Resume failed: ${err.message}`);
@@ -18660,7 +18683,7 @@ ${diff2.slice(0, 5e3)}${diff2.length > 5e3 ? "\n... (truncated)" : ""}`
18660
18683
  } catch (e24) {
18661
18684
  checks.push(`gh CLI: not found`);
18662
18685
  }
18663
- const apiKey = _chunkBWTOS5BHcjs.resolveApiKey.call(void 0, );
18686
+ const apiKey = _chunkWZJV6DJCcjs.resolveApiKey.call(void 0, );
18664
18687
  checks.push(`API key: ${apiKey ? "configured" : "NOT SET"}`);
18665
18688
  ctx.addStatus("Diagnostics:\n " + checks.join("\n "));
18666
18689
  } catch (err) {
@@ -18728,7 +18751,7 @@ ${diff2.slice(0, 5e3)}${diff2.length > 5e3 ? "\n... (truncated)" : ""}`
18728
18751
  try {
18729
18752
  const detailResult = await ctx.client.query("session_detail", ctx.sessionId);
18730
18753
  const session = detailResult.data;
18731
- const events = _nullishCoalesce(_optionalChain([session, 'optionalAccess', _212 => _212.transcript]), () => ( []));
18754
+ const events = _nullishCoalesce(_optionalChain([session, 'optionalAccess', _241 => _241.transcript]), () => ( []));
18732
18755
  if (format2 === "json") {
18733
18756
  const outPath = _path.join.call(void 0, ctx.cwd, `session-${ctx.sessionId}.json`);
18734
18757
  _fs.writeFileSync.call(void 0, outPath, JSON.stringify(events, null, 2), "utf-8");
@@ -18758,7 +18781,7 @@ ${diff2.slice(0, 5e3)}${diff2.length > 5e3 ? "\n... (truncated)" : ""}`
18758
18781
  description: "View or update settings",
18759
18782
  usage: "/config [show | set <key> <value> | get <key>]",
18760
18783
  execute: async (arg, ctx) => {
18761
- const { SettingsManager: SettingsManager2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("../manager-YYKWYTRM.cjs")));
18784
+ const { SettingsManager: SettingsManager2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("../manager-TTF5VHJC.cjs")));
18762
18785
  const sm = new SettingsManager2(ctx.cwd);
18763
18786
  const parts = arg.trim().split(/\s+/);
18764
18787
  const sub = parts[0] || "show";
@@ -18773,7 +18796,7 @@ ${diff2.slice(0, 5e3)}${diff2.length > 5e3 ? "\n... (truncated)" : ""}`
18773
18796
  return;
18774
18797
  }
18775
18798
  const settings = sm.get();
18776
- const val = key.split(".").reduce((o, k) => _optionalChain([o, 'optionalAccess', _213 => _213[k]]), settings);
18799
+ const val = key.split(".").reduce((o, k) => _optionalChain([o, 'optionalAccess', _242 => _242[k]]), settings);
18777
18800
  ctx.addStatus(`${key} = ${JSON.stringify(val)}`);
18778
18801
  } else if (sub === "set") {
18779
18802
  const key = parts[1];
@@ -18824,14 +18847,14 @@ function getGitStatus(cwd) {
18824
18847
  }
18825
18848
  function getGitDiff(cwd, opts) {
18826
18849
  const args = ["git", "diff", "--no-color"];
18827
- if (_optionalChain([opts, 'optionalAccess', _214 => _214.staged])) args.push("--staged");
18828
- if (_optionalChain([opts, 'optionalAccess', _215 => _215.file])) args.push("--", opts.file);
18850
+ if (_optionalChain([opts, 'optionalAccess', _243 => _243.staged])) args.push("--staged");
18851
+ if (_optionalChain([opts, 'optionalAccess', _244 => _244.file])) args.push("--", opts.file);
18829
18852
  return _child_process.execSync.call(void 0, args.join(" "), { cwd, encoding: "utf-8", timeout: 3e4 }).trim();
18830
18853
  }
18831
18854
  function getGitDiffStat(cwd, opts) {
18832
18855
  const args = ["git", "diff", "--stat", "--no-color"];
18833
- if (_optionalChain([opts, 'optionalAccess', _216 => _216.staged])) args.push("--staged");
18834
- if (_optionalChain([opts, 'optionalAccess', _217 => _217.file])) args.push("--", opts.file);
18856
+ if (_optionalChain([opts, 'optionalAccess', _245 => _245.staged])) args.push("--staged");
18857
+ if (_optionalChain([opts, 'optionalAccess', _246 => _246.file])) args.push("--", opts.file);
18835
18858
  return _child_process.execSync.call(void 0, args.join(" "), { cwd, encoding: "utf-8", timeout: 1e4 }).trim();
18836
18859
  }
18837
18860
  function getGitLog(cwd, n = 10) {
@@ -19134,7 +19157,7 @@ var utilityCommands = [
19134
19157
  description: "Copy last assistant response to clipboard",
19135
19158
  execute: (_arg, ctx) => {
19136
19159
  const lastAssistant = [...ctx.chatLog].reverse().find((e) => e.type === "assistant_text");
19137
- if (!_optionalChain([lastAssistant, 'optionalAccess', _218 => _218.text])) {
19160
+ if (!_optionalChain([lastAssistant, 'optionalAccess', _247 => _247.text])) {
19138
19161
  ctx.addStatus("No assistant response to copy.");
19139
19162
  return;
19140
19163
  }
@@ -19203,7 +19226,7 @@ var utilityCommands = [
19203
19226
  description: "Check for and install updates",
19204
19227
  execute: async (_arg, ctx) => {
19205
19228
  try {
19206
- const { getCurrentVersion: getCurrentVersion2, getUpdateAvailable: getUpdateAvailable2, getAutoUpdateDisabledReason } = await Promise.resolve().then(() => _interopRequireWildcard(require("../updater-QW473OF4.cjs")));
19229
+ const { getCurrentVersion: getCurrentVersion2, getUpdateAvailable: getUpdateAvailable2, getAutoUpdateDisabledReason } = await Promise.resolve().then(() => _interopRequireWildcard(require("../updater-I7QBW4DP.cjs")));
19207
19230
  const current = getCurrentVersion2();
19208
19231
  const info = getUpdateAvailable2();
19209
19232
  const disabledReason = getAutoUpdateDisabledReason();
@@ -19301,7 +19324,7 @@ var extraCommands = [
19301
19324
  try {
19302
19325
  const settings = JSON.parse(_fs.readFileSync.call(void 0, settingsFile, "utf-8"));
19303
19326
  const cleared = [];
19304
- if (_optionalChain([settings, 'access', _219 => _219.model, 'optionalAccess', _220 => _220.apiKey])) {
19327
+ if (_optionalChain([settings, 'access', _248 => _248.model, 'optionalAccess', _249 => _249.apiKey])) {
19305
19328
  delete settings.model.apiKey;
19306
19329
  cleared.push("model.apiKey");
19307
19330
  }
@@ -19387,7 +19410,7 @@ ${lines.join("\n")}`);
19387
19410
  description: "List skills available to the model",
19388
19411
  execute: (_arg, ctx) => {
19389
19412
  try {
19390
- const skills = _chunkBUU5PZK2cjs.scanSkills.call(void 0, ctx.cwd);
19413
+ const skills = _chunkUXOCVJJ6cjs.scanSkills.call(void 0, ctx.cwd);
19391
19414
  if (skills.length === 0) {
19392
19415
  ctx.addStatus(
19393
19416
  "No skills found.\nAdd .md files to one of:\n .code-shell/skills/ .claude/skills/ (project)\n ~/.code-shell/skills/ ~/.claude/skills/ (global)"
@@ -19453,7 +19476,7 @@ ${lines.join("\n")}`);
19453
19476
  const recent = matched.slice(-count);
19454
19477
  const formatted = recent.map(({ raw, e }) => {
19455
19478
  if (!e) return ` ${raw.slice(0, 120)}`;
19456
- const time = _nullishCoalesce(_optionalChain([e, 'access', _221 => _221.t, 'optionalAccess', _222 => _222.split, 'call', _223 => _223("T"), 'access', _224 => _224[1], 'optionalAccess', _225 => _225.slice, 'call', _226 => _226(0, 12)]), () => ( ""));
19479
+ const time = _nullishCoalesce(_optionalChain([e, 'access', _250 => _250.t, 'optionalAccess', _251 => _251.split, 'call', _252 => _252("T"), 'access', _253 => _253[1], 'optionalAccess', _254 => _254.slice, 'call', _255 => _255(0, 12)]), () => ( ""));
19457
19480
  const level = (_nullishCoalesce(e.l, () => ( ""))).toUpperCase().padEnd(5);
19458
19481
  const msg = _nullishCoalesce(e.msg, () => ( ""));
19459
19482
  let head = ` ${time} ${level}`;
@@ -19465,7 +19488,7 @@ ${lines.join("\n")}`);
19465
19488
  if (d.duration_ms !== void 0) detail += ` ${d.duration_ms}ms`;
19466
19489
  else if (d.latencyMs !== void 0) detail += ` ${d.latencyMs}ms`;
19467
19490
  if (d.ttft_ms !== void 0) detail += ` ttft=${d.ttft_ms}ms`;
19468
- if (_optionalChain([d, 'access', _227 => _227.usage, 'optionalAccess', _228 => _228.totalTokens])) detail += ` ${d.usage.totalTokens}tok`;
19491
+ if (_optionalChain([d, 'access', _256 => _256.usage, 'optionalAccess', _257 => _257.totalTokens])) detail += ` ${d.usage.totalTokens}tok`;
19469
19492
  if (d.tool) detail += ` tool=${d.tool}`;
19470
19493
  if (d.decision) detail += ` decision=${d.decision}`;
19471
19494
  if (d.approved !== void 0) detail += ` approved=${d.approved}`;
@@ -19713,8 +19736,8 @@ function formatDuration2(ms, options) {
19713
19736
  hours = 0;
19714
19737
  days++;
19715
19738
  }
19716
- const hide = _optionalChain([options, 'optionalAccess', _229 => _229.hideTrailingZeros]);
19717
- if (_optionalChain([options, 'optionalAccess', _230 => _230.mostSignificantOnly])) {
19739
+ const hide = _optionalChain([options, 'optionalAccess', _258 => _258.hideTrailingZeros]);
19740
+ if (_optionalChain([options, 'optionalAccess', _259 => _259.mostSignificantOnly])) {
19718
19741
  if (days > 0) return `${days}d`;
19719
19742
  if (hours > 0) return `${hours}h`;
19720
19743
  if (minutes > 0) return `${minutes}m`;
@@ -20085,11 +20108,11 @@ function App2({
20085
20108
  client.query("models"),
20086
20109
  client.query("config_get", "arena.participants"),
20087
20110
  client.query("providers"),
20088
- Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-OU4GRZQY.cjs")))
20111
+ Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-TWUFWZ5T.cjs")))
20089
20112
  ]);
20090
20113
  const entries = _nullishCoalesce(modelsRes.data, () => ( []));
20091
20114
  const snap = snapMod.getOpenRouterSnapshot();
20092
- const raw = _optionalChain([arenaRes, 'access', _231 => _231.data, 'optionalAccess', _232 => _232.value]);
20115
+ const raw = _optionalChain([arenaRes, 'access', _260 => _260.data, 'optionalAccess', _261 => _261.value]);
20093
20116
  const arenaParticipants = Array.isArray(raw) ? raw.map((item) => {
20094
20117
  if (typeof item === "string") return { kind: "key", value: item };
20095
20118
  if (item && typeof item === "object") {
@@ -20254,7 +20277,7 @@ function App2({
20254
20277
  async (value) => {
20255
20278
  const trimmed = value.trim();
20256
20279
  if (!trimmed) return;
20257
- const head = _optionalChain([trimmed, 'access', _233 => _233.split, 'call', _234 => _234(/\s+/), 'access', _235 => _235[0], 'optionalAccess', _236 => _236.toLowerCase, 'call', _237 => _237()]);
20280
+ const head = _optionalChain([trimmed, 'access', _262 => _262.split, 'call', _263 => _263(/\s+/), 'access', _264 => _264[0], 'optionalAccess', _265 => _265.toLowerCase, 'call', _266 => _266()]);
20258
20281
  const READ_ONLY_WHILE_RUNNING = /* @__PURE__ */ new Set(["/sid", "/help"]);
20259
20282
  if (isRunning && !READ_ONLY_WHILE_RUNNING.has(_nullishCoalesce(head, () => ( "")))) return;
20260
20283
  if (!isRunning) {
@@ -20271,7 +20294,7 @@ function App2({
20271
20294
  chatStore.update((prev) => [...prev, entry({ type: "user", text: trimmed })]);
20272
20295
  setIsRunning(true);
20273
20296
  streamingCharsRef.current = 0;
20274
- _chunkBUU5PZK2cjs.taskManager.reset();
20297
+ _chunkUXOCVJJ6cjs.taskManager.reset();
20275
20298
  try {
20276
20299
  let engineMessage = trimmed;
20277
20300
  if (pendingContextRef.current) {
@@ -20432,7 +20455,7 @@ ${trimmed}`;
20432
20455
  const selectedEntryId = _react.useMemo.call(void 0, () => {
20433
20456
  if (cursorIdx === null || screen !== "transcript") return null;
20434
20457
  const selectableList = chatLog.filter((e) => selectableIds.has(e.id));
20435
- return _nullishCoalesce(_optionalChain([selectableList, 'access', _238 => _238[cursorIdx], 'optionalAccess', _239 => _239.id]), () => ( null));
20458
+ return _nullishCoalesce(_optionalChain([selectableList, 'access', _267 => _267[cursorIdx], 'optionalAccess', _268 => _268.id]), () => ( null));
20436
20459
  }, [cursorIdx, screen, chatLog, selectableIds]);
20437
20460
  const isTranscript = screen === "transcript";
20438
20461
  const renderEntryWithCursor = _react.useCallback.call(void 0,
@@ -20519,15 +20542,15 @@ ${trimmed}`;
20519
20542
  ) : showOnboarding ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
20520
20543
  OnboardingPrompt,
20521
20544
  {
20522
- existingProviders: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _240 => _240.providers]), () => ( []))).map((p) => ({
20545
+ existingProviders: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _269 => _269.providers]), () => ( []))).map((p) => ({
20523
20546
  key: p.key,
20524
20547
  label: _nullishCoalesce(p.label, () => ( p.key)),
20525
20548
  kind: p.kind,
20526
20549
  baseUrl: _nullishCoalesce(p.baseUrl, () => ( "")),
20527
20550
  apiKey: p.apiKey
20528
20551
  })),
20529
- existingModelKeys: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _241 => _241.entries]), () => ( []))).map((e) => e.key),
20530
- existingModelIds: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _242 => _242.entries]), () => ( []))).map((e) => e.model),
20552
+ existingModelKeys: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _270 => _270.entries]), () => ( []))).map((e) => e.key),
20553
+ existingModelIds: (_nullishCoalesce(_optionalChain([modelManager, 'optionalAccess', _271 => _271.entries]), () => ( []))).map((e) => e.model),
20531
20554
  onComplete: async (result) => {
20532
20555
  setShowOnboarding(false);
20533
20556
  setModelManager(null);
@@ -20536,7 +20559,7 @@ ${trimmed}`;
20536
20559
  reloadModels: true,
20537
20560
  model: result.key
20538
20561
  });
20539
- const activeModel = _nullishCoalesce(_optionalChain([res, 'optionalAccess', _243 => _243.model]), () => ( result.model));
20562
+ const activeModel = _nullishCoalesce(_optionalChain([res, 'optionalAccess', _272 => _272.model]), () => ( result.model));
20540
20563
  setModel(activeModel);
20541
20564
  addStatus(`\u2713 \u914D\u7F6E\u5DF2\u4FDD\u5B58,\u5DF2\u5207\u6362\u5230: ${result.key} (${activeModel})`);
20542
20565
  } catch (err) {
@@ -20560,7 +20583,7 @@ ${trimmed}`;
20560
20583
  try {
20561
20584
  const result = await client.configure({ model: key });
20562
20585
  const data = result;
20563
- const newModel = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _244 => _244.model]), () => ( key));
20586
+ const newModel = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _273 => _273.model]), () => ( key));
20564
20587
  setModel(newModel);
20565
20588
  addStatus(`\u2713 \u5207\u6362\u5230: ${key} (${newModel})`);
20566
20589
  } catch (err) {
@@ -20635,7 +20658,7 @@ ${trimmed}`;
20635
20658
  },
20636
20659
  onSwitch: async (key) => {
20637
20660
  const result = await client.configure({ model: key });
20638
- const newModel = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _245 => _245.model]), () => ( key));
20661
+ const newModel = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _274 => _274.model]), () => ( key));
20639
20662
  setModel(newModel);
20640
20663
  setModelManager(
20641
20664
  (prev) => prev ? {
@@ -20645,9 +20668,9 @@ ${trimmed}`;
20645
20668
  );
20646
20669
  },
20647
20670
  onSync: async () => {
20648
- const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-sync-BBHUM3R6.cjs")));
20671
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-sync-5VMGN6C2.cjs")));
20649
20672
  const r = await mod.syncOpenRouterCatalog();
20650
- const snapMod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-OU4GRZQY.cjs")));
20673
+ const snapMod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-TWUFWZ5T.cjs")));
20651
20674
  const snap = snapMod.getOpenRouterSnapshot();
20652
20675
  setModelManager(
20653
20676
  (prev) => prev ? { ...prev, snapshot: { count: snap.count, fetchedAt: snap.fetchedAt } } : prev
@@ -21585,10 +21608,10 @@ async function startInkRepl(options) {
21585
21608
  initHistory(sessionId, options.cwd);
21586
21609
  _chunkIK4EWJBPcjs.logger.setSid(sessionId);
21587
21610
  if (process.env.CODESHELL_NO_MODEL_SYNC !== "1") {
21588
- const snap = _chunkQRM7IF2Scjs.getOpenRouterSnapshot.call(void 0, );
21611
+ const snap = _chunkYKIAELDZcjs.getOpenRouterSnapshot.call(void 0, );
21589
21612
  const ageMs = snap.fetchedAt ? Date.now() - new Date(snap.fetchedAt).getTime() : Infinity;
21590
21613
  if (ageMs > 24 * 60 * 60 * 1e3) {
21591
- void _chunkA5LCRPDPcjs.syncOpenRouterCatalog.call(void 0, ).catch(() => {
21614
+ void _chunkS754JHLRcjs.syncOpenRouterCatalog.call(void 0, ).catch(() => {
21592
21615
  });
21593
21616
  }
21594
21617
  }
@@ -21682,8 +21705,8 @@ function getEffortConfig(level) {
21682
21705
  }
21683
21706
  async function replCommand(options) {
21684
21707
  const cwd = process.cwd();
21685
- let settings = new (0, _chunkYUI524OEcjs.SettingsManager)(cwd).get();
21686
- let apiKey = _chunkBWTOS5BHcjs.resolveApiKey.call(void 0, options.apiKey, settings.model.apiKey);
21708
+ let settings = new (0, _chunk7BI3V74Ycjs.SettingsManager)(cwd).get();
21709
+ let apiKey = _chunkWZJV6DJCcjs.resolveApiKey.call(void 0, options.apiKey, settings.model.apiKey);
21687
21710
  let model = _nullishCoalesce(options.model, () => ( settings.model.name));
21688
21711
  let provider = _nullishCoalesce(options.provider, () => ( settings.model.provider));
21689
21712
  let baseUrl = _nullishCoalesce(options.baseUrl, () => ( settings.model.baseUrl));
@@ -21705,7 +21728,7 @@ async function replCommand(options) {
21705
21728
  provider = result.provider;
21706
21729
  model = result.model;
21707
21730
  baseUrl = result.baseUrl;
21708
- settings = new (0, _chunkYUI524OEcjs.SettingsManager)(cwd).get();
21731
+ settings = new (0, _chunk7BI3V74Ycjs.SettingsManager)(cwd).get();
21709
21732
  }
21710
21733
  model = _nullishCoalesce(model, () => ( "anthropic/claude-opus-4-6"));
21711
21734
  provider = _nullishCoalesce(provider, () => ( "openai"));
@@ -21728,7 +21751,7 @@ async function replCommand(options) {
21728
21751
  };
21729
21752
  const permissionMode = _nullishCoalesce(options.permissionMode, () => ( "acceptEdits"));
21730
21753
  const maxContextTokens = _nullishCoalesce(settings.context.maxTokens, () => ( 2e5));
21731
- const engine = new (0, _chunkBUU5PZK2cjs.Engine)({
21754
+ const engine = new (0, _chunkUXOCVJJ6cjs.Engine)({
21732
21755
  llm: llmConfig,
21733
21756
  cwd,
21734
21757
  preset: _nullishCoalesce(options.preset, () => ( settings.agent.preset)),
@@ -21742,7 +21765,7 @@ async function replCommand(options) {
21742
21765
  sessionStorageDir: settings.session.storageDir,
21743
21766
  costStore: costTracker,
21744
21767
  mcpServers: settings.mcpServers,
21745
- approvalBackend: _chunkBUU5PZK2cjs.getInteractiveApprovalBackend.call(void 0, )
21768
+ approvalBackend: _chunkUXOCVJJ6cjs.getInteractiveApprovalBackend.call(void 0, )
21746
21769
  });
21747
21770
  const [serverTransport, clientTransport] = createInProcessTransport();
21748
21771
  const _server = new AgentServer({ engine, transport: serverTransport });
@@ -21766,7 +21789,7 @@ async function setup(options) {
21766
21789
  const { cwd, permissionMode } = options;
21767
21790
  _chunkIK4EWJBPcjs.rotateLogs.call(void 0, );
21768
21791
  _chunkIK4EWJBPcjs.logger.info("setup.start", { cwd, permissionMode, level: _chunkIK4EWJBPcjs.logger.getMinLevel() });
21769
- const nodeVersion = _optionalChain([process, 'access', _246 => _246.version, 'access', _247 => _247.match, 'call', _248 => _248(/^v(\d+)\./), 'optionalAccess', _249 => _249[1]]);
21792
+ const nodeVersion = _optionalChain([process, 'access', _275 => _275.version, 'access', _276 => _276.match, 'call', _277 => _277(/^v(\d+)\./), 'optionalAccess', _278 => _278[1]]);
21770
21793
  if (!nodeVersion || parseInt(nodeVersion) < 18) {
21771
21794
  console.error(
21772
21795
  _chalk2.default.bold.red("Error: Code Shell requires Node.js version 18 or higher.")
@@ -21810,8 +21833,8 @@ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
21810
21833
 
21811
21834
  function createRunManager() {
21812
21835
  const cwd = process.cwd();
21813
- const settings = new (0, _chunkYUI524OEcjs.SettingsManager)(cwd).get();
21814
- const apiKey = _chunkBWTOS5BHcjs.resolveApiKey.call(void 0, void 0, settings.model.apiKey);
21836
+ const settings = new (0, _chunk7BI3V74Ycjs.SettingsManager)(cwd).get();
21837
+ const apiKey = _chunkWZJV6DJCcjs.resolveApiKey.call(void 0, void 0, settings.model.apiKey);
21815
21838
  const llm = {
21816
21839
  provider: _nullishCoalesce(settings.model.provider, () => ( "openai")),
21817
21840
  model: _nullishCoalesce(settings.model.name, () => ( "anthropic/claude-opus-4-6")),
@@ -21821,8 +21844,8 @@ function createRunManager() {
21821
21844
  maxTokens: _nullishCoalesce(settings.model.maxTokens, () => ( 8192)),
21822
21845
  enableStreaming: true
21823
21846
  };
21824
- const store = new (0, _chunkBUU5PZK2cjs.FileRunStore)();
21825
- return new (0, _chunkBUU5PZK2cjs.RunManager)({
21847
+ const store = new (0, _chunkUXOCVJJ6cjs.FileRunStore)();
21848
+ return new (0, _chunkUXOCVJJ6cjs.RunManager)({
21826
21849
  store,
21827
21850
  executor: {
21828
21851
  llm,
@@ -21947,7 +21970,7 @@ function createRunsCommand() {
21947
21970
  console.error(`Run not found: ${runId}`);
21948
21971
  process.exit(1);
21949
21972
  }
21950
- const store = new (0, _chunkBUU5PZK2cjs.FileRunStore)();
21973
+ const store = new (0, _chunkUXOCVJJ6cjs.FileRunStore)();
21951
21974
  let approvalDecision;
21952
21975
  if (opts.approve || opts.reject) {
21953
21976
  const pendingApproval = await store.getPendingApproval(runId);
@@ -22010,7 +22033,7 @@ function createRunsCommand() {
22010
22033
  Recovered ${recovered.length} run(s):`);
22011
22034
  for (const id of recovered) {
22012
22035
  const run = await manager.get(id);
22013
- console.log(` ${id} ${formatStatus(_nullishCoalesce(_optionalChain([run, 'optionalAccess', _250 => _250.status]), () => ( "blocked")))}`);
22036
+ console.log(` ${id} ${formatStatus(_nullishCoalesce(_optionalChain([run, 'optionalAccess', _279 => _279.status]), () => ( "blocked")))}`);
22014
22037
  }
22015
22038
  console.log();
22016
22039
  }
@@ -22039,7 +22062,7 @@ function formatSessionStatus(s) {
22039
22062
  }
22040
22063
  }
22041
22064
  var program = new (0, _commander.Command)();
22042
- program.name("code-shell").description("Code Shell \u2014 general orchestration framework with a terminal coding assistant preset").version(_chunkR47ROHGLcjs.getCurrentVersion.call(void 0, ));
22065
+ program.name("code-shell").description("Code Shell \u2014 general orchestration framework with a terminal coding assistant preset").version(_chunkMV7YI4WOcjs.getCurrentVersion.call(void 0, ));
22043
22066
  function addCommonOptions(cmd) {
22044
22067
  return cmd.option("-m, --model <model>", "Model name (e.g. anthropic/claude-opus-4-6)").option("-p, --provider <provider>", "LLM provider (anthropic, openai)", "openai").option("--preset <preset>", "Agent preset (general, terminal-coding)").option("--base-url <url>", "LLM API base URL (e.g. https://openrouter.ai/api/v1)").option("--api-key <key>", "API key (or set OPENROUTER_API_KEY / ANTHROPIC_API_KEY env var)").option("--permission-mode <mode>", "Permission mode (default, acceptEdits, bypassPermissions)").option("-o, --output <format>", "Output format (text, json, jsonl, stream-json)", "text").option("--max-turns <n>", "Maximum turns", "100").option("--effort <level>", "Reasoning effort (low, medium, high, max)", "high");
22045
22068
  }
@@ -22071,10 +22094,10 @@ addCommonOptions(
22071
22094
  program.command("arena").description("Multi-model review arena \u2014 agent gathers context, multiple models discuss").argument("<topic>", "What to review (agent will find relevant code)").option("--models <models>", "Models to use (e.g. claude,gpt4o,deepseek)").option("--mode <mode>", "Arena mode: review, discussion, or planning (auto-detected if omitted)")
22072
22095
  ).action(async (topic, opts) => {
22073
22096
  const resolved = resolveOpts(opts);
22074
- const { runArenaReview } = await Promise.resolve().then(() => _interopRequireWildcard(require("../arena-KBQOPLFV.cjs")));
22075
- const { SettingsManager: SettingsManager2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("../manager-YYKWYTRM.cjs")));
22097
+ const { runArenaReview } = await Promise.resolve().then(() => _interopRequireWildcard(require("../arena-ADB7DRFI.cjs")));
22098
+ const { SettingsManager: SettingsManager2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("../manager-TTF5VHJC.cjs")));
22076
22099
  const settings = new SettingsManager2(process.cwd()).get();
22077
- const apiKey = _chunkBWTOS5BHcjs.resolveApiKey.call(void 0, resolved.apiKey, settings.model.apiKey);
22100
+ const apiKey = _chunkWZJV6DJCcjs.resolveApiKey.call(void 0, resolved.apiKey, settings.model.apiKey);
22078
22101
  if (!apiKey) {
22079
22102
  console.error("Error: No API key provided.");
22080
22103
  process.exit(1);