@cjhyy/code-shell 0.1.0-alpha.3 → 0.1.5

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 (156) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/anthropic-IBTI4WL2.cjs +10 -0
  3. package/dist/anthropic-PRZZKHEZ.js +10 -0
  4. package/dist/arena/index.cjs +7 -6
  5. package/dist/arena/index.js +6 -5
  6. package/dist/arena/model-presets.d.ts +10 -1
  7. package/dist/{arena-HHDYYVHJ.cjs → arena-KBQOPLFV.cjs} +25 -23
  8. package/dist/{arena-ENHBHB2W.js → arena-O2L4TN6A.js} +9 -7
  9. package/dist/{chunk-SW3L7HIM.js → chunk-2EP3CLEN.js} +2 -2
  10. package/dist/{chunk-EL2RL5DG.cjs → chunk-2YW4FPFG.cjs} +2 -2
  11. package/dist/chunk-3OA5G4TM.js +47 -0
  12. package/dist/chunk-52LGZKT3.cjs +47 -0
  13. package/dist/{chunk-KOGV6PDQ.cjs → chunk-55XGPMAP.cjs} +44 -9
  14. package/dist/chunk-5ECBT4YA.js +450 -0
  15. package/dist/{chunk-YD7XTI7T.cjs → chunk-6QVAYW7C.cjs} +116 -28
  16. package/dist/{chunk-SCDKLTN3.js → chunk-6S4BJ65N.js} +5 -4
  17. package/dist/{chunk-ZLPJJZUW.js → chunk-76HYEPDM.js} +2 -2
  18. package/dist/{chunk-TDXBHD24.js → chunk-76W334S4.js} +2 -2
  19. package/dist/{chunk-GZBD6QRS.cjs → chunk-7EG3V4JY.cjs} +13 -12
  20. package/dist/{chunk-LMEKCQX4.js → chunk-7JVTYEEC.js} +6 -6
  21. package/dist/{chunk-ID6EJUHP.js → chunk-7K6SDRRF.js} +1262 -212
  22. package/dist/{chunk-5C5HIOML.js → chunk-7Y6S3OCX.js} +109 -21
  23. package/dist/{chunk-VIPLU4RY.cjs → chunk-A5LCRPDP.cjs} +4 -4
  24. package/dist/{chunk-F5BS3GUC.js → chunk-BSW22MPA.js} +39 -4
  25. package/dist/{chunk-VWFET3MG.cjs → chunk-BUU5PZK2.cjs} +1474 -423
  26. package/dist/{chunk-HOXQLX5R.cjs → chunk-BWTOS5BH.cjs} +444 -103
  27. package/dist/{chunk-ZRVPCXI7.js → chunk-BXCY2FSE.js} +2 -1
  28. package/dist/{chunk-Y7TSCDF6.js → chunk-C5YQBIRK.js} +347 -6
  29. package/dist/{chunk-C7C7ZZY4.cjs → chunk-HEKQCI7B.cjs} +10 -10
  30. package/dist/{chunk-JHXNOB5G.cjs → chunk-HS2MFNUC.cjs} +6 -6
  31. package/dist/{chunk-JHNCK7JP.cjs → chunk-IK4EWJBP.cjs} +4 -3
  32. package/dist/{chunk-M2QI5X3X.cjs → chunk-JMR33QVF.cjs} +2 -2
  33. package/dist/{chunk-YAFCN7ZW.cjs → chunk-KOVYSDHZ.cjs} +15 -15
  34. package/dist/{chunk-IJSHQGMP.cjs → chunk-KS3RYAYL.cjs} +4 -4
  35. package/dist/{chunk-DI7RDLOS.js → chunk-MD32R22I.js} +7 -4
  36. package/dist/chunk-MY5XHADU.cjs +216 -0
  37. package/dist/{chunk-OP57WUWQ.cjs → chunk-NUNC3VFB.cjs} +6 -6
  38. package/dist/{chunk-BF4LXLQV.cjs → chunk-QRM7IF2S.cjs} +133 -175
  39. package/dist/chunk-R47ROHGL.cjs +298 -0
  40. package/dist/{chunk-OUC2DFA7.js → chunk-RMYKO74M.js} +3 -3
  41. package/dist/{chunk-FUOKLKR2.js → chunk-SFXHZSRF.js} +1 -1
  42. package/dist/{chunk-2EUAE7AY.js → chunk-SIHHIQLO.js} +2 -2
  43. package/dist/{chunk-3CAZIWUA.cjs → chunk-SNT563K3.cjs} +9 -9
  44. package/dist/{chunk-SK62UVS6.js → chunk-T6VYG46N.js} +1 -1
  45. package/dist/{chunk-3QR52LL5.cjs → chunk-TUY2T5KP.cjs} +2 -2
  46. package/dist/{chunk-I57ZD5IQ.js → chunk-VIAGTYYW.js} +1 -1
  47. package/dist/{chunk-X2DNIMPC.cjs → chunk-VYL4EFRC.cjs} +32 -32
  48. package/dist/chunk-W22P377T.js +299 -0
  49. package/dist/chunk-WASS5YWB.js +215 -0
  50. package/dist/{chunk-FPFTIKEJ.js → chunk-XDIQWQJ4.js} +132 -174
  51. package/dist/{chunk-BUJ5KYCI.cjs → chunk-YIQBXAYU.cjs} +13 -13
  52. package/dist/{chunk-REFCCVDM.js → chunk-YJ77GQK5.js} +2 -2
  53. package/dist/chunk-YUI524OE.cjs +450 -0
  54. package/dist/{chunk-M2SVOKC6.js → chunk-ZBPSQCPU.js} +6 -6
  55. package/dist/cli/commands/builtin/export-md.d.ts +19 -0
  56. package/dist/cli/commands/builtin/init/detect.d.ts +25 -0
  57. package/dist/cli/commands/builtin/init/index.d.ts +19 -0
  58. package/dist/cli/main.cjs +2343 -1447
  59. package/dist/cli/main.js +2476 -1580
  60. package/dist/cli/migrate-models.d.ts +45 -0
  61. package/dist/cli/onboarding.d.ts +110 -5
  62. package/dist/cli/updater.d.ts +51 -4
  63. package/dist/client-base-HTF236ZD.cjs +9 -0
  64. package/dist/client-base-QKRKCOWB.js +9 -0
  65. package/dist/{compaction-YNWCEF7B.js → compaction-6VU2T643.js} +4 -2
  66. package/dist/compaction-OKUNTCA7.cjs +33 -0
  67. package/dist/context/compaction.d.ts +35 -3
  68. package/dist/context/manager.d.ts +40 -3
  69. package/dist/context/tool-result-storage.d.ts +96 -0
  70. package/dist/devtools-T2NIZBJK.cjs +6 -0
  71. package/dist/{devtools-IRQQPIRY.js → devtools-YXWHOVKR.js} +1 -1
  72. package/dist/engine/engine.d.ts +40 -0
  73. package/dist/engine/turn-loop.d.ts +6 -0
  74. package/dist/export-md-RXDW6F5W.cjs +135 -0
  75. package/dist/export-md-XXKZANW5.js +135 -0
  76. package/dist/file-history-KYPE3ECT.cjs +7 -0
  77. package/dist/file-history-LF4F7X26.js +7 -0
  78. package/dist/index.cjs +42 -22
  79. package/dist/index.d.ts +5 -2
  80. package/dist/index.js +40 -20
  81. package/dist/llm/client-base.d.ts +1 -1
  82. package/dist/llm/model-cache.d.ts +21 -0
  83. package/dist/llm/model-fetcher.d.ts +29 -0
  84. package/dist/llm/model-pool.d.ts +13 -0
  85. package/dist/llm/provider-catalog.d.ts +30 -0
  86. package/dist/llm/provider-kinds.d.ts +21 -0
  87. package/dist/llm/types.d.ts +8 -0
  88. package/dist/logging/session-recorder.d.ts +77 -0
  89. package/dist/manager-C2IUXKRC.js +7 -0
  90. package/dist/manager-YYKWYTRM.cjs +7 -0
  91. package/dist/mcp-manager-QMKWPBZ4.js +8 -0
  92. package/dist/mcp-manager-Z3OKI74O.cjs +8 -0
  93. package/dist/memory-5LWZ6FI2.cjs +9 -0
  94. package/dist/{memory-EPFDBPII.js → memory-VIJLBAMQ.js} +2 -2
  95. package/dist/model-cache-5KIYL5SL.js +13 -0
  96. package/dist/model-cache-OED3IM4R.cjs +13 -0
  97. package/dist/model-fetcher-HKGICACL.js +8 -0
  98. package/dist/model-fetcher-UR6WJOQP.cjs +8 -0
  99. package/dist/openai-JR2WEKOF.js +10 -0
  100. package/dist/openai-YBTOET4O.cjs +10 -0
  101. package/dist/openrouter-models-OU4GRZQY.cjs +15 -0
  102. package/dist/{openrouter-models-2FM3H4SQ.js → openrouter-models-TGKDKY52.js} +2 -2
  103. package/dist/openrouter-sync-BBHUM3R6.cjs +11 -0
  104. package/dist/{openrouter-sync-SO3AWEAM.js → openrouter-sync-UXUSJCIR.js} +3 -3
  105. package/dist/product/index.cjs +17 -15
  106. package/dist/product/index.js +16 -14
  107. package/dist/protocol/server.d.ts +3 -1
  108. package/dist/protocol/types.d.ts +36 -2
  109. package/dist/run/index.cjs +17 -15
  110. package/dist/run/index.js +16 -14
  111. package/dist/services/index.d.ts +0 -1
  112. package/dist/session-manager-Q22BBMD3.js +8 -0
  113. package/dist/session-manager-XODQVL3C.cjs +8 -0
  114. package/dist/settings/schema.d.ts +267 -42
  115. package/dist/{tool-summary-RYNR4DDB.cjs → tool-summary-63DPIS7G.cjs} +4 -4
  116. package/dist/{tool-summary-2RUFL5QK.js → tool-summary-NP5CDBKG.js} +2 -2
  117. package/dist/tool-system/builtin/ask-user.d.ts +9 -1
  118. package/dist/tool-system/context.d.ts +31 -2
  119. package/dist/tool-system/executor.d.ts +4 -0
  120. package/dist/tool-system/investigation-guard.d.ts +37 -0
  121. package/dist/types.d.ts +13 -2
  122. package/dist/ui/components/AskUserPrompt.d.ts +8 -1
  123. package/dist/ui/components/DiffLine.d.ts +33 -0
  124. package/dist/ui/components/ModelManager.d.ts +34 -1
  125. package/dist/ui/components/OnboardingPrompt.d.ts +10 -1
  126. package/dist/ui/components/ProviderModelFlow.d.ts +58 -0
  127. package/dist/ui/components/UpdateBanner.d.ts +1 -0
  128. package/dist/updater-QW473OF4.cjs +17 -0
  129. package/dist/updater-VFUAHCVY.js +17 -0
  130. package/dist/utils/semver.d.ts +1 -0
  131. package/dist/utils/task-sanitizer.d.ts +6 -0
  132. package/package.json +1 -1
  133. package/dist/anthropic-P5VETAFI.cjs +0 -10
  134. package/dist/anthropic-W2GU3D76.js +0 -10
  135. package/dist/chunk-75E4BBFC.js +0 -224
  136. package/dist/chunk-FV2ARONZ.cjs +0 -224
  137. package/dist/client-base-TOVE25FA.js +0 -9
  138. package/dist/client-base-VDDIADAC.cjs +0 -9
  139. package/dist/compaction-D3KV2NWY.cjs +0 -31
  140. package/dist/devtools-WTC3NFNE.cjs +0 -6
  141. package/dist/file-history-HZWO2WQ5.js +0 -7
  142. package/dist/file-history-UQQILIY7.cjs +0 -7
  143. package/dist/manager-FWLOVEEK.cjs +0 -7
  144. package/dist/manager-GEXJLOIS.js +0 -7
  145. package/dist/mcp-manager-37GQLFGX.js +0 -8
  146. package/dist/mcp-manager-U77NEXBY.cjs +0 -8
  147. package/dist/memory-ADGOWADP.cjs +0 -9
  148. package/dist/openai-RXU5URYI.js +0 -10
  149. package/dist/openai-SQW4H2K4.cjs +0 -10
  150. package/dist/openrouter-models-PLCWZZYE.cjs +0 -15
  151. package/dist/openrouter-sync-K2WK3A2A.cjs +0 -11
  152. package/dist/services/compact.d.ts +0 -56
  153. package/dist/session-manager-HRSKENKB.cjs +0 -8
  154. package/dist/session-manager-NEKFEHF3.js +0 -8
  155. package/dist/updater-J7L7R6BY.cjs +0 -185
  156. package/dist/updater-LDBNYCAO.js +0 -185
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-DI7RDLOS.js";
3
+ } from "./chunk-MD32R22I.js";
4
4
 
5
5
  // src/logging/logger.ts
6
6
  init_esm_shims();
@@ -197,6 +197,7 @@ function rotateLogs() {
197
197
  }
198
198
 
199
199
  export {
200
+ getCurrentSid,
200
201
  logger,
201
202
  rotateLogs
202
203
  };
@@ -1,12 +1,15 @@
1
+ import {
2
+ getOpenRouterModels
3
+ } from "./chunk-XDIQWQJ4.js";
1
4
  import {
2
5
  LLMError
3
- } from "./chunk-FUOKLKR2.js";
6
+ } from "./chunk-SFXHZSRF.js";
4
7
  import {
5
8
  logger
6
- } from "./chunk-ZRVPCXI7.js";
9
+ } from "./chunk-BXCY2FSE.js";
7
10
  import {
8
11
  init_esm_shims
9
- } from "./chunk-DI7RDLOS.js";
12
+ } from "./chunk-MD32R22I.js";
10
13
 
11
14
  // src/llm/client-factory.ts
12
15
  init_esm_shims();
@@ -18,11 +21,11 @@ async function createLLMClient(config) {
18
21
  let Cls = PROVIDER_REGISTRY.get(config.provider);
19
22
  if (!Cls) {
20
23
  if (config.provider === "anthropic") {
21
- const { AnthropicClient } = await import("./anthropic-W2GU3D76.js");
24
+ const { AnthropicClient } = await import("./anthropic-PRZZKHEZ.js");
22
25
  registerProvider("anthropic", AnthropicClient);
23
26
  Cls = AnthropicClient;
24
27
  } else if (config.provider === "openai") {
25
- const { OpenAIClient } = await import("./openai-RXU5URYI.js");
28
+ const { OpenAIClient } = await import("./openai-JR2WEKOF.js");
26
29
  registerProvider("openai", OpenAIClient);
27
30
  Cls = OpenAIClient;
28
31
  }
@@ -4308,6 +4311,337 @@ var Arena = class {
4308
4311
  }
4309
4312
  };
4310
4313
 
4314
+ // src/cli/onboarding.ts
4315
+ init_esm_shims();
4316
+ import { mkdirSync, writeFileSync, readFileSync as readFileSync4, existsSync as existsSync4, renameSync } from "fs";
4317
+ import { join as join4 } from "path";
4318
+ import { homedir } from "os";
4319
+ var PROVIDERS = [
4320
+ {
4321
+ id: "openrouter",
4322
+ name: "OpenRouter (\u63A8\u8350 \u2014 \u652F\u6301\u6240\u6709\u6A21\u578B)",
4323
+ envKey: "OPENROUTER_API_KEY",
4324
+ provider: "openai",
4325
+ baseUrl: "https://openrouter.ai/api/v1",
4326
+ defaultModel: "anthropic/claude-sonnet-4.6",
4327
+ keyUrl: "https://openrouter.ai/keys",
4328
+ keyPrefix: "sk-or-",
4329
+ models: [
4330
+ "anthropic/claude-opus-4.7",
4331
+ "anthropic/claude-sonnet-4.6",
4332
+ "anthropic/claude-haiku-4.5",
4333
+ "openai/gpt-5",
4334
+ "openai/gpt-5-mini",
4335
+ "openai/gpt-4o",
4336
+ "openai/o4-mini",
4337
+ "openai/o3",
4338
+ "google/gemini-2.5-pro",
4339
+ "google/gemini-2.5-flash",
4340
+ "deepseek/deepseek-chat",
4341
+ "deepseek/deepseek-reasoner",
4342
+ "qwen/qwen3-coder",
4343
+ "meta-llama/llama-4-maverick"
4344
+ ]
4345
+ },
4346
+ {
4347
+ id: "anthropic",
4348
+ name: "Anthropic (\u76F4\u8FDE Claude API)",
4349
+ envKey: "ANTHROPIC_API_KEY",
4350
+ provider: "anthropic",
4351
+ baseUrl: "https://api.anthropic.com",
4352
+ defaultModel: "claude-sonnet-4-6",
4353
+ keyUrl: "https://console.anthropic.com/settings/keys",
4354
+ keyPrefix: "sk-ant-",
4355
+ models: [
4356
+ "claude-opus-4-7",
4357
+ "claude-sonnet-4-6",
4358
+ "claude-haiku-4-5"
4359
+ ]
4360
+ },
4361
+ {
4362
+ id: "openai",
4363
+ name: "OpenAI",
4364
+ envKey: "OPENAI_API_KEY",
4365
+ provider: "openai",
4366
+ baseUrl: "https://api.openai.com/v1",
4367
+ defaultModel: "gpt-5",
4368
+ keyUrl: "https://platform.openai.com/api-keys",
4369
+ keyPrefix: "sk-",
4370
+ models: ["gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-4o", "o4-mini", "o3"]
4371
+ },
4372
+ {
4373
+ id: "deepseek",
4374
+ name: "DeepSeek (\u5B98\u65B9\u76F4\u8FDE)",
4375
+ envKey: "DEEPSEEK_API_KEY",
4376
+ provider: "openai",
4377
+ baseUrl: "https://api.deepseek.com/v1",
4378
+ defaultModel: "deepseek-v4-pro",
4379
+ keyUrl: "https://platform.deepseek.com/api_keys",
4380
+ keyPrefix: "sk-",
4381
+ models: ["deepseek-v4-pro", "deepseek-v4-flash", "deepseek-chat"]
4382
+ },
4383
+ {
4384
+ id: "gemini",
4385
+ name: "Google Gemini (\u5B98\u65B9\u76F4\u8FDE)",
4386
+ envKey: "GEMINI_API_KEY",
4387
+ provider: "openai",
4388
+ baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
4389
+ defaultModel: "gemini-2.5-pro",
4390
+ keyUrl: "https://aistudio.google.com/apikey",
4391
+ keyPrefix: "",
4392
+ models: [
4393
+ "gemini-2.5-pro",
4394
+ "gemini-2.5-flash",
4395
+ "gemini-2.0-flash"
4396
+ ]
4397
+ },
4398
+ {
4399
+ id: "ollama",
4400
+ name: "Ollama (\u672C\u5730\uFF0C\u65E0\u9700 Key)",
4401
+ envKey: "",
4402
+ provider: "openai",
4403
+ baseUrl: "http://localhost:11434/v1",
4404
+ defaultModel: "llama3.1",
4405
+ keyUrl: "https://ollama.com/library",
4406
+ keyPrefix: "",
4407
+ models: ["llama3.1", "qwen2.5-coder", "deepseek-r1", "mistral", "gemma3"],
4408
+ noKey: true
4409
+ },
4410
+ {
4411
+ id: "custom",
4412
+ name: "\u81EA\u5B9A\u4E49 (\u4EFB\u4F55 OpenAI \u517C\u5BB9 API)",
4413
+ envKey: "",
4414
+ provider: "openai",
4415
+ baseUrl: "",
4416
+ defaultModel: "",
4417
+ keyUrl: "",
4418
+ keyPrefix: "",
4419
+ models: []
4420
+ }
4421
+ ];
4422
+ var OPENROUTER_VENDORS = [
4423
+ { prefix: "anthropic/", take: 4 },
4424
+ { prefix: "openai/", take: 5 },
4425
+ { prefix: "google/", take: 3 },
4426
+ { prefix: "deepseek/", take: 3 },
4427
+ { prefix: "x-ai/", take: 2 },
4428
+ { prefix: "qwen/", take: 2 },
4429
+ { prefix: "meta-llama/", take: 2 },
4430
+ { prefix: "mistralai/", take: 1 }
4431
+ ];
4432
+ function buildOpenRouterModelList(fallback) {
4433
+ const all = getOpenRouterModels();
4434
+ if (all.length === 0) return fallback;
4435
+ const skip = /(?:-guard|-embedding|-rerank|-vision-only|:free)/i;
4436
+ const out = [];
4437
+ for (const { prefix, take } of OPENROUTER_VENDORS) {
4438
+ const candidates = all.filter((m) => m.id.startsWith(prefix)).filter((m) => !skip.test(m.id) && !m.id.includes("-preview")).slice(0, take);
4439
+ out.push(...candidates.map((m) => m.id));
4440
+ }
4441
+ return out.length > 0 ? out : fallback;
4442
+ }
4443
+ function resolveProviderModels(provider) {
4444
+ if (provider.id === "openrouter") {
4445
+ return buildOpenRouterModelList(provider.models);
4446
+ }
4447
+ return provider.models;
4448
+ }
4449
+ function detectEnvKeys() {
4450
+ const found = [];
4451
+ for (const p of PROVIDERS) {
4452
+ if (!p.envKey) continue;
4453
+ const v = process.env[p.envKey];
4454
+ if (v && v.trim()) {
4455
+ found.push({ provider: p, envKey: p.envKey, apiKey: v.trim() });
4456
+ }
4457
+ }
4458
+ return found;
4459
+ }
4460
+ function detectProviderFromApiKey(apiKey, baseUrl) {
4461
+ for (const p of PROVIDERS) {
4462
+ if (p.keyPrefix && apiKey.startsWith(p.keyPrefix)) return p;
4463
+ }
4464
+ if (baseUrl) {
4465
+ for (const p of PROVIDERS) {
4466
+ if (p.baseUrl && baseUrl.startsWith(p.baseUrl)) return p;
4467
+ }
4468
+ }
4469
+ for (const p of PROVIDERS) {
4470
+ if (!p.envKey) continue;
4471
+ const v = process.env[p.envKey];
4472
+ if (v && v.trim() === apiKey) return p;
4473
+ }
4474
+ return void 0;
4475
+ }
4476
+ function resolveApiKey(optionsApiKey, settingsApiKey) {
4477
+ if (optionsApiKey) return optionsApiKey;
4478
+ if (settingsApiKey) return settingsApiKey;
4479
+ for (const p of PROVIDERS) {
4480
+ if (!p.envKey) continue;
4481
+ const v = process.env[p.envKey];
4482
+ if (v && v.trim()) return v.trim();
4483
+ }
4484
+ return void 0;
4485
+ }
4486
+ var KNOWN_MAX_OUTPUT = {
4487
+ "anthropic/claude-opus-4.7": 32e3,
4488
+ "anthropic/claude-opus-4-7": 32e3,
4489
+ "claude-opus-4-7": 32e3,
4490
+ "anthropic/claude-sonnet-4.6": 16e3,
4491
+ "anthropic/claude-sonnet-4-6": 16e3,
4492
+ "claude-sonnet-4-6": 16e3,
4493
+ "anthropic/claude-haiku-4.5": 8192,
4494
+ "anthropic/claude-haiku-4-5": 8192,
4495
+ "claude-haiku-4-5": 8192,
4496
+ "openai/gpt-5": 32e3,
4497
+ "openai/gpt-5-mini": 32e3,
4498
+ "openai/gpt-5-nano": 16e3,
4499
+ "gpt-5": 32e3,
4500
+ "gpt-5-mini": 32e3,
4501
+ "gpt-5-nano": 16e3,
4502
+ "openai/gpt-4o": 16384,
4503
+ "gpt-4o": 16384,
4504
+ "openai/o4-mini": 1e5,
4505
+ "o4-mini": 1e5,
4506
+ "openai/o3": 1e5,
4507
+ "o3": 1e5,
4508
+ "google/gemini-2.5-pro": 65536,
4509
+ "google/gemini-2.5-flash": 65536,
4510
+ "gemini-2.5-pro": 65536,
4511
+ "gemini-2.5-flash": 65536,
4512
+ "gemini-2.0-flash": 8192,
4513
+ "deepseek/deepseek-v3.2": 8192,
4514
+ "deepseek/deepseek-r1": 8192,
4515
+ "deepseek-v4-flash": 8192,
4516
+ "deepseek-v4-pro": 65536,
4517
+ "deepseek-chat": 8192,
4518
+ "qwen/qwen3-coder": 16384,
4519
+ "meta-llama/llama-4-maverick": 32e3
4520
+ };
4521
+ var KNOWN_CONTEXT_WINDOWS = {
4522
+ "deepseek-v4-pro": 1e6,
4523
+ "deepseek-v4-flash": 1e6,
4524
+ "deepseek-chat": 1e6,
4525
+ "deepseek/deepseek-chat": 1e6,
4526
+ "deepseek/deepseek-v4-pro": 1e6,
4527
+ "deepseek/deepseek-v4-flash": 1e6
4528
+ };
4529
+ function resolveMaxOutput(model) {
4530
+ if (KNOWN_MAX_OUTPUT[model]) return KNOWN_MAX_OUTPUT[model];
4531
+ if (model.includes("/")) {
4532
+ const hit = getOpenRouterModels().find((m) => m.id === model);
4533
+ if (hit && hit.maxOutputTokens > 0) return hit.maxOutputTokens;
4534
+ }
4535
+ return void 0;
4536
+ }
4537
+ function resolveContextWindow(model) {
4538
+ if (KNOWN_CONTEXT_WINDOWS[model]) return KNOWN_CONTEXT_WINDOWS[model];
4539
+ if (model.includes("/")) {
4540
+ const hit = getOpenRouterModels().find((m) => m.id === model);
4541
+ if (hit && hit.contextLength > 0) return hit.contextLength;
4542
+ }
4543
+ return void 0;
4544
+ }
4545
+ function deriveModelPoolKey(providerKind, modelId, used = []) {
4546
+ const slash = modelId.lastIndexOf("/");
4547
+ const base = slash >= 0 ? modelId.slice(slash + 1) : modelId;
4548
+ const prefix = providerKind.toLowerCase();
4549
+ const candidate = base.toLowerCase().startsWith(`${prefix}-`) ? base : `${prefix}-${base}`;
4550
+ const set = new Set(used);
4551
+ if (!set.has(candidate)) return candidate;
4552
+ for (let i = 2; ; i++) {
4553
+ const k = `${candidate}-${i}`;
4554
+ if (!set.has(k)) return k;
4555
+ }
4556
+ }
4557
+ function buildModelPool(provider, apiKey) {
4558
+ const models = resolveProviderModels(provider);
4559
+ const used = [];
4560
+ return models.map((m) => {
4561
+ const key = deriveModelPoolKey(provider.id, m, used);
4562
+ used.push(key);
4563
+ return {
4564
+ key,
4565
+ label: modelDisplayName(m),
4566
+ provider: provider.provider,
4567
+ model: m,
4568
+ baseUrl: provider.baseUrl,
4569
+ apiKey,
4570
+ maxOutputTokens: resolveMaxOutput(m),
4571
+ maxContextTokens: resolveContextWindow(m)
4572
+ };
4573
+ });
4574
+ }
4575
+ function modelDisplayName(model) {
4576
+ const slash = model.lastIndexOf("/");
4577
+ const base = slash >= 0 ? model.slice(slash + 1) : model;
4578
+ const parts = base.split("-");
4579
+ if (parts[0] === "claude") {
4580
+ const variant = parts[1] ?? "";
4581
+ return `Claude ${variant.charAt(0).toUpperCase() + variant.slice(1)}`;
4582
+ }
4583
+ if (base.startsWith("gpt-")) return `GPT-${parts.slice(1).join("-")}`;
4584
+ if (base.startsWith("gemini-")) return `Gemini ${parts.slice(1).join("-")}`;
4585
+ return base.charAt(0).toUpperCase() + base.slice(1);
4586
+ }
4587
+ function appendOnboardingResult(opts) {
4588
+ const dir = join4(homedir(), ".code-shell");
4589
+ const file = join4(dir, "settings.json");
4590
+ mkdirSync(dir, { recursive: true });
4591
+ let existing = {};
4592
+ if (existsSync4(file)) {
4593
+ try {
4594
+ existing = JSON.parse(readFileSync4(file, "utf-8"));
4595
+ } catch {
4596
+ }
4597
+ }
4598
+ const existingProviders = Array.isArray(existing.providers) ? existing.providers : [];
4599
+ let providersOut = existingProviders;
4600
+ if (opts.addedProvider) {
4601
+ const has = existingProviders.some((p) => p?.key === opts.addedProvider.key);
4602
+ if (!has) providersOut = [...existingProviders, opts.addedProvider];
4603
+ }
4604
+ const existingModels = Array.isArray(existing.models) ? existing.models : [];
4605
+ const existingKeys = new Set(existingModels.map((m) => m?.key));
4606
+ const modelsToAppend = opts.addedModels.filter((m) => !existingKeys.has(m.key));
4607
+ const updated = {
4608
+ ...existing,
4609
+ activeKey: opts.activeKey,
4610
+ model: {
4611
+ ...typeof existing.model === "object" && existing.model ? existing.model : {},
4612
+ provider: opts.activeMirror.provider,
4613
+ name: opts.activeMirror.model,
4614
+ apiKey: opts.activeMirror.apiKey,
4615
+ baseUrl: opts.activeMirror.baseUrl
4616
+ },
4617
+ providers: providersOut,
4618
+ models: [...existingModels, ...modelsToAppend]
4619
+ };
4620
+ const tmp = `${file}.${process.pid}.tmp`;
4621
+ writeFileSync(tmp, JSON.stringify(updated, null, 2) + "\n", "utf-8");
4622
+ try {
4623
+ renameSync(tmp, file);
4624
+ } catch {
4625
+ writeFileSync(file, JSON.stringify(updated, null, 2) + "\n", "utf-8");
4626
+ }
4627
+ }
4628
+ function saveArenaSettingsByKeys(keys) {
4629
+ const dir = join4(homedir(), ".code-shell");
4630
+ const file = join4(dir, "settings.json");
4631
+ let existing = {};
4632
+ if (existsSync4(file)) {
4633
+ try {
4634
+ existing = JSON.parse(readFileSync4(file, "utf-8"));
4635
+ } catch {
4636
+ }
4637
+ }
4638
+ const updated = {
4639
+ ...existing,
4640
+ arena: { participants: keys }
4641
+ };
4642
+ writeFileSync(file, JSON.stringify(updated, null, 2) + "\n", "utf-8");
4643
+ }
4644
+
4311
4645
  // src/arena/model-presets.ts
4312
4646
  init_esm_shims();
4313
4647
  var MODEL_PRESETS = {
@@ -4332,7 +4666,8 @@ function getMaxOutputTokens(model) {
4332
4666
  const byKey = MODEL_PRESETS[model];
4333
4667
  if (byKey) return byKey.maxOutputTokens;
4334
4668
  const byModel = Object.values(MODEL_PRESETS).find((p) => p.model === model);
4335
- return byModel?.maxOutputTokens ?? 8192;
4669
+ if (byModel) return byModel.maxOutputTokens;
4670
+ return resolveMaxOutput(model) ?? 8192;
4336
4671
  }
4337
4672
 
4338
4673
  // src/arena/render/terminal.ts
@@ -4777,6 +5112,12 @@ export {
4777
5112
  buildConsensus,
4778
5113
  ArenaLedger,
4779
5114
  Arena,
5115
+ detectEnvKeys,
5116
+ detectProviderFromApiKey,
5117
+ resolveApiKey,
5118
+ buildModelPool,
5119
+ appendOnboardingResult,
5120
+ saveArenaSettingsByKeys,
4780
5121
  MODEL_PRESETS,
4781
5122
  getMaxOutputTokens,
4782
5123
  formatArenaResult,
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunkJHNCK7JPcjs = require('./chunk-JHNCK7JP.cjs');
3
+ var _chunkIK4EWJBPcjs = require('./chunk-IK4EWJBP.cjs');
4
4
 
5
5
 
6
- var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
6
+ var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
7
7
 
8
8
  // src/tool-system/mcp-manager.ts
9
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
9
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
10
10
  var _indexjs = require('@modelcontextprotocol/sdk/client/index.js');
11
11
  var _stdiojs = require('@modelcontextprotocol/sdk/client/stdio.js');
12
12
  var _streamableHttpjs = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
@@ -35,7 +35,7 @@ var MCPManager = (_class = class _MCPManager {
35
35
  for (let i = 0; i < results.length; i++) {
36
36
  const result = results[i];
37
37
  if (result.status === "rejected") {
38
- _chunkJHNCK7JPcjs.logger.warn("mcp.connect_failed", {
38
+ _chunkIK4EWJBPcjs.logger.warn("mcp.connect_failed", {
39
39
  server: entries[i][0],
40
40
  error: result.reason.message
41
41
  });
@@ -47,10 +47,10 @@ var MCPManager = (_class = class _MCPManager {
47
47
  */
48
48
  async connect(name, config) {
49
49
  if (this.connections.has(name)) {
50
- _chunkJHNCK7JPcjs.logger.info("mcp.already_connected", { server: name });
50
+ _chunkIK4EWJBPcjs.logger.info("mcp.already_connected", { server: name });
51
51
  return;
52
52
  }
53
- _chunkJHNCK7JPcjs.logger.info("mcp.connecting", { server: name, transport: _nullishCoalesce(config.transport, () => ( "stdio")) });
53
+ _chunkIK4EWJBPcjs.logger.info("mcp.connecting", { server: name, transport: _nullishCoalesce(config.transport, () => ( "stdio")) });
54
54
  const client = new (0, _indexjs.Client)(
55
55
  { name: "code-shell", version: "0.1.0" },
56
56
  { capabilities: {} }
@@ -99,7 +99,7 @@ var MCPManager = (_class = class _MCPManager {
99
99
  }
100
100
  this.connections.set(name, { client, serverName: name, transport });
101
101
  await this.discoverTools(name, client);
102
- _chunkJHNCK7JPcjs.logger.info("mcp.connected", { server: name });
102
+ _chunkIK4EWJBPcjs.logger.info("mcp.connected", { server: name });
103
103
  }
104
104
  /**
105
105
  * Discover tools from an MCP server and register them.
@@ -131,7 +131,7 @@ var MCPManager = (_class = class _MCPManager {
131
131
  }
132
132
  return parts.join("\n") || "(no output)";
133
133
  });
134
- _chunkJHNCK7JPcjs.logger.info("mcp.tool_registered", { server: serverName, tool: registered.name });
134
+ _chunkIK4EWJBPcjs.logger.info("mcp.tool_registered", { server: serverName, tool: registered.name });
135
135
  }
136
136
  }
137
137
  /**
@@ -141,9 +141,9 @@ var MCPManager = (_class = class _MCPManager {
141
141
  for (const [name, conn] of this.connections) {
142
142
  try {
143
143
  await conn.client.close();
144
- _chunkJHNCK7JPcjs.logger.info("mcp.disconnected", { server: name });
144
+ _chunkIK4EWJBPcjs.logger.info("mcp.disconnected", { server: name });
145
145
  } catch (err) {
146
- _chunkJHNCK7JPcjs.logger.warn("mcp.disconnect_error", { server: name, error: err.message });
146
+ _chunkIK4EWJBPcjs.logger.warn("mcp.disconnect_error", { server: name, error: err.message });
147
147
  }
148
148
  }
149
149
  this.connections.clear();
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkVWFET3MGcjs = require('./chunk-VWFET3MG.cjs');
4
+ var _chunkBUU5PZK2cjs = require('./chunk-BUU5PZK2.cjs');
5
5
 
6
6
 
7
- var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
7
+ var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
8
8
 
9
9
  // src/run/index.ts
10
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
10
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
11
11
 
12
12
  // src/run/factory.ts
13
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
13
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
14
14
  var _path = require('path');
15
15
  var _os = require('os');
16
16
  function createRunManager(options) {
17
17
  const runsDir = _nullishCoalesce(options.runsDir, () => ( _path.join.call(void 0, _os.homedir.call(void 0, ), ".code-shell", "runs")));
18
- const store = new (0, _chunkVWFET3MGcjs.FileRunStore)(runsDir);
19
- return new (0, _chunkVWFET3MGcjs.RunManager)({
18
+ const store = new (0, _chunkBUU5PZK2cjs.FileRunStore)(runsDir);
19
+ return new (0, _chunkBUU5PZK2cjs.RunManager)({
20
20
  store,
21
21
  executor: {
22
22
  llm: options.llm,
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
3
+ var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
4
4
 
5
5
  // src/logging/logger.ts
6
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
6
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
7
7
 
8
8
 
9
9
 
@@ -199,4 +199,5 @@ function rotateLogs() {
199
199
 
200
200
 
201
201
 
202
- exports.logger = logger; exports.rotateLogs = rotateLogs;
202
+
203
+ exports.getCurrentSid = getCurrentSid; exports.logger = logger; exports.rotateLogs = rotateLogs;
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
3
+ var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
4
4
 
5
5
  // src/session/memory.ts
6
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
6
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
7
7
  var _fs = require('fs');
8
8
  var _path = require('path');
9
9
  var _os = require('os');
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunkGZBD6QRScjs = require('./chunk-GZBD6QRS.cjs');
3
+ var _chunk7EG3V4JYcjs = require('./chunk-7EG3V4JY.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkEL2RL5DGcjs = require('./chunk-EL2RL5DG.cjs');
8
+ var _chunk2YW4FPFGcjs = require('./chunk-2YW4FPFG.cjs');
9
9
 
10
10
 
11
- var _chunkJHNCK7JPcjs = require('./chunk-JHNCK7JP.cjs');
11
+ var _chunkIK4EWJBPcjs = require('./chunk-IK4EWJBP.cjs');
12
12
 
13
13
 
14
- var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
14
+ var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
15
15
 
16
16
  // src/llm/providers/openai.ts
17
- _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
17
+ _chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
18
18
  var _openai = require('openai'); var _openai2 = _interopRequireDefault(_openai);
19
- var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
19
+ var OpenAIClient = (_class = class extends _chunk7EG3V4JYcjs.LLMClientBase {
20
20
  __init() {this._client = null}
21
21
  constructor(config) {
22
22
  super(config);_class.prototype.__init.call(this);;
@@ -37,7 +37,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
37
37
  return this.withRetry(async () => {
38
38
  const messages = this.buildMessages(options.systemPrompt, options.messages);
39
39
  const tools = _optionalChain([options, 'access', _ => _.tools, 'optionalAccess', _2 => _2.length]) ? this.convertTools(options.tools) : void 0;
40
- const span = _chunkJHNCK7JPcjs.logger.span("llm.request", {
40
+ const span = _chunkIK4EWJBPcjs.logger.span("llm.request", {
41
41
  cat: "llm",
42
42
  provider: this.provider,
43
43
  model: this.model,
@@ -74,13 +74,13 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
74
74
  { signal: options.signal }
75
75
  );
76
76
  const choice = response.choices[0];
77
- if (!choice) throw new (0, _chunkEL2RL5DGcjs.LLMError)("No response from OpenAI", "openai");
77
+ if (!choice) throw new (0, _chunk2YW4FPFGcjs.LLMError)("No response from OpenAI", "openai");
78
78
  const usage = {
79
79
  promptTokens: _nullishCoalesce(_optionalChain([response, 'access', _12 => _12.usage, 'optionalAccess', _13 => _13.prompt_tokens]), () => ( 0)),
80
80
  completionTokens: _nullishCoalesce(_optionalChain([response, 'access', _14 => _14.usage, 'optionalAccess', _15 => _15.completion_tokens]), () => ( 0)),
81
81
  totalTokens: _nullishCoalesce(_optionalChain([response, 'access', _16 => _16.usage, 'optionalAccess', _17 => _17.total_tokens]), () => ( 0))
82
82
  };
83
- this.recordUsage(usage);
83
+ this.recordUsage(usage, options);
84
84
  return this.processChoice(choice, usage);
85
85
  } catch (err) {
86
86
  this.handleApiError(err);
@@ -120,7 +120,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
120
120
  if (delta.content) {
121
121
  if (!firstByteLogged) {
122
122
  firstByteLogged = true;
123
- _chunkJHNCK7JPcjs.logger.debug("llm.first_byte", {
123
+ _chunkIK4EWJBPcjs.logger.debug("llm.first_byte", {
124
124
  cat: "llm",
125
125
  provider: this.provider,
126
126
  model: this.model,
@@ -176,7 +176,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
176
176
  completionTokens: _nullishCoalesce(_optionalChain([streamUsage, 'optionalAccess', _41 => _41.completion_tokens]), () => ( 0)),
177
177
  totalTokens: _nullishCoalesce(_optionalChain([streamUsage, 'optionalAccess', _42 => _42.total_tokens]), () => ( 0))
178
178
  };
179
- this.recordUsage(usage);
179
+ this.recordUsage(usage, options);
180
180
  return {
181
181
  text,
182
182
  toolCalls,
@@ -309,20 +309,20 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
309
309
  handleApiError(err) {
310
310
  if (err instanceof _openai2.default.APIError) {
311
311
  if (err.status === 429) {
312
- throw new (0, _chunkEL2RL5DGcjs.LLMRateLimitError)("openai");
312
+ throw new (0, _chunk2YW4FPFGcjs.LLMRateLimitError)("openai");
313
313
  }
314
314
  const msg = (_nullishCoalesce(err.message, () => ( ""))).toLowerCase();
315
315
  if (msg.includes("context_length_exceeded") || msg.includes("maximum context length") || msg.includes("too many tokens") || msg.includes("prompt is too long")) {
316
- throw new (0, _chunkEL2RL5DGcjs.ContextLimitError)("openai");
316
+ throw new (0, _chunk2YW4FPFGcjs.ContextLimitError)("openai");
317
317
  }
318
318
  if (err.status === 401 && msg.includes("provider returned error")) {
319
- throw new (0, _chunkEL2RL5DGcjs.LLMError)(
319
+ throw new (0, _chunk2YW4FPFGcjs.LLMError)(
320
320
  `OpenAI-compatible endpoint returned 401 "Provider returned error". Two likely causes: (1) the API key is invalid/revoked, or (2) the upstream provider rejects tool calls for this model (common on OpenRouter's gpt-4o-mini route). Verify the key, then try a tool-capable model such as openai/gpt-4.1-mini or anthropic/claude-3.5-haiku.`,
321
321
  "openai",
322
322
  { status: err.status }
323
323
  );
324
324
  }
325
- throw new (0, _chunkEL2RL5DGcjs.LLMError)(`OpenAI API error: ${err.message}`, "openai", { status: err.status });
325
+ throw new (0, _chunk2YW4FPFGcjs.LLMError)(`OpenAI API error: ${err.message}`, "openai", { status: err.status });
326
326
  }
327
327
  throw err;
328
328
  }
@@ -11,9 +11,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
11
11
  var __esm = (fn, res) => function __init() {
12
12
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
13
  };
14
- var __commonJS = (cb, mod) => function __require2() {
15
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
- };
17
14
  var __export = (target, all) => {
18
15
  for (var name in all)
19
16
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -29,9 +26,12 @@ var __copyProps = (to, from, except, desc) => {
29
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
27
 
31
28
  // node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js
29
+ var getImportMetaUrl, importMetaUrl;
32
30
  var init_cjs_shims = __esm({
33
31
  "node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js"() {
34
32
  "use strict";
33
+ getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
34
+ importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
35
35
  }
36
36
  });
37
37
 
@@ -42,4 +42,4 @@ var init_cjs_shims = __esm({
42
42
 
43
43
 
44
44
 
45
- exports.__require = __require; exports.__esm = __esm; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toCommonJS = __toCommonJS; exports.init_cjs_shims = init_cjs_shims;
45
+ exports.__require = __require; exports.__esm = __esm; exports.__export = __export; exports.__toCommonJS = __toCommonJS; exports.importMetaUrl = importMetaUrl; exports.init_cjs_shims = init_cjs_shims;