@proxysoul/soulforge 2.18.4 → 2.18.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.
package/dist/index.js CHANGED
@@ -3851,7 +3851,10 @@ function readJsonFile(path) {
3851
3851
  return null;
3852
3852
  }
3853
3853
  return JSON.parse(readFileSync5(path, "utf-8"));
3854
- } catch {
3854
+ } catch (err2) {
3855
+ const msg = err2 instanceof Error ? err2.message : String(err2);
3856
+ process.stderr.write(` Warning: invalid ${path} \u2014 ${msg}. Ignoring.
3857
+ `);
3855
3858
  return null;
3856
3859
  }
3857
3860
  }
@@ -5211,8 +5214,17 @@ function loadConfig() {
5211
5214
  try {
5212
5215
  userConfig = JSON.parse(readFileSync8(configFile, "utf-8"));
5213
5216
  } catch (err2) {
5214
- logBackgroundError("config", `Failed to parse ${configFile}: ${err2 instanceof Error ? err2.message : String(err2)} \u2014 using defaults`);
5215
- userConfig = {};
5217
+ const msg = err2 instanceof Error ? err2.message : String(err2);
5218
+ process.stderr.write(`
5219
+ Error: invalid config.json \u2014 ${msg}
5220
+
5221
+ ` + ` Path: ${configFile}
5222
+
5223
+ ` + ` Fix the JSON syntax error and try again.
5224
+ ` + ` (Your config was NOT overwritten.)
5225
+
5226
+ `);
5227
+ process.exit(1);
5216
5228
  }
5217
5229
  }
5218
5230
  let merged = { ...DEFAULT_CONFIG };
@@ -5260,7 +5272,13 @@ function loadProjectConfig(cwd) {
5260
5272
  const raw = readFileSync8(projectFile, "utf-8");
5261
5273
  return JSON.parse(raw);
5262
5274
  } catch (err2) {
5263
- logBackgroundError("config", `Failed to parse ${projectFile}: ${err2 instanceof Error ? err2.message : String(err2)} \u2014 ignoring project config`);
5275
+ const msg = err2 instanceof Error ? err2.message : String(err2);
5276
+ process.stderr.write(`
5277
+ Warning: invalid project config.json \u2014 ${msg}
5278
+ ` + ` Path: ${projectFile}
5279
+ ` + ` Fix the JSON syntax error. Ignoring project config for now.
5280
+
5281
+ `);
5264
5282
  return null;
5265
5283
  }
5266
5284
  }
@@ -5391,7 +5409,6 @@ var DEFAULT_CONFIG, _presetOverlay = null, NESTED_KEYS;
5391
5409
  var init_config2 = __esm(() => {
5392
5410
  init_platform();
5393
5411
  init_ensure_soulforge_dir();
5394
- init_errors();
5395
5412
  DEFAULT_CONFIG = {
5396
5413
  defaultModel: "none",
5397
5414
  routerRules: [],
@@ -46827,6 +46844,13 @@ function supportsTemperature(modelId) {
46827
46844
  return true;
46828
46845
  return v.major < 5 && (v.major < 4 || v.minor < 7);
46829
46846
  }
46847
+ function isAdaptiveOnly(modelId) {
46848
+ const base = extractBaseModel(modelId);
46849
+ const v = parseOpusVersion(base);
46850
+ if (!v)
46851
+ return false;
46852
+ return v.major >= 5 || v.major === 4 && v.minor >= 7;
46853
+ }
46830
46854
 
46831
46855
  // src/utils/errors.ts
46832
46856
  function toErrorMessage(err2) {
@@ -51853,6 +51877,7 @@ var init_anthropic = __esm(() => {
51853
51877
  return result;
51854
51878
  },
51855
51879
  fallbackModels: [
51880
+ { id: "claude-opus-4-8", name: "Claude Opus 4.8" },
51856
51881
  { id: "claude-opus-4-7", name: "Claude Opus 4.7" },
51857
51882
  { id: "claude-opus-4-6", name: "Claude Opus 4.6" },
51858
51883
  { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
@@ -51863,6 +51888,7 @@ var init_anthropic = __esm(() => {
51863
51888
  { id: "claude-haiku-4", name: "Claude Haiku 4" }
51864
51889
  ],
51865
51890
  contextWindows: [
51891
+ ["claude-opus-4-8", 1e6],
51866
51892
  ["claude-opus-4-7", 1e6],
51867
51893
  ["claude-opus-4-6", 1e6],
51868
51894
  ["claude-sonnet-4-6", 1e6],
@@ -64231,6 +64257,7 @@ var init_bedrock = __esm(() => {
64231
64257
  return null;
64232
64258
  },
64233
64259
  fallbackModels: [
64260
+ { id: "anthropic.claude-opus-4-8", name: "Claude Opus 4.8" },
64234
64261
  { id: "anthropic.claude-sonnet-4-20250514-v1:0", name: "Claude Sonnet 4" },
64235
64262
  { id: "anthropic.claude-haiku-4-5-20251001-v1:0", name: "Claude Haiku 4.5" },
64236
64263
  { id: "us.amazon.nova-pro-v1:0", name: "Amazon Nova Pro" },
@@ -64238,6 +64265,10 @@ var init_bedrock = __esm(() => {
64238
64265
  { id: "meta.llama3-1-70b-instruct-v1:0", name: "Llama 3.1 70B" }
64239
64266
  ],
64240
64267
  contextWindows: [
64268
+ ["claude-opus-4-8", 1e6],
64269
+ ["claude-opus-4-7", 1e6],
64270
+ ["claude-opus-4-6", 1e6],
64271
+ ["claude-sonnet-4-6", 1e6],
64241
64272
  ["claude-sonnet-4", 200000],
64242
64273
  ["claude-opus-4", 200000],
64243
64274
  ["claude-haiku-4", 200000],
@@ -71745,7 +71776,7 @@ var package_default;
71745
71776
  var init_package = __esm(() => {
71746
71777
  package_default = {
71747
71778
  name: "@proxysoul/soulforge",
71748
- version: "2.18.4",
71779
+ version: "2.18.5",
71749
71780
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
71750
71781
  repository: {
71751
71782
  type: "git",
@@ -72261,6 +72292,9 @@ function getCompatReasoningBody(modelId, config2) {
72261
72292
  return {};
72262
72293
  const isClaude = base.startsWith("claude");
72263
72294
  if (isClaude && provider === "opencode-zen") {
72295
+ if (isAdaptiveOnly(base)) {
72296
+ return { thinking: { type: "adaptive" } };
72297
+ }
72264
72298
  const explicitBudget = config2.thinking?.budgetTokens;
72265
72299
  const budget = explicitBudget ?? { low: 2048, medium: 5000, high: 1e4, xhigh: 20000 }[effort] ?? 5000;
72266
72300
  return { thinking: { type: "enabled", budget_tokens: budget } };
@@ -72467,8 +72501,10 @@ var init_copilot = __esm(() => {
72467
72501
  }
72468
72502
  },
72469
72503
  fallbackModels: [
72470
- { id: "claude-opus-4.6", name: "Claude Opus 4.6", contextWindow: 200000 },
72471
- { id: "claude-sonnet-4.6", name: "Claude Sonnet 4.6", contextWindow: 200000 },
72504
+ { id: "claude-opus-4.8", name: "Claude Opus 4.8", contextWindow: 1e6 },
72505
+ { id: "claude-opus-4.7", name: "Claude Opus 4.7", contextWindow: 1e6 },
72506
+ { id: "claude-opus-4.6", name: "Claude Opus 4.6", contextWindow: 1e6 },
72507
+ { id: "claude-sonnet-4.6", name: "Claude Sonnet 4.6", contextWindow: 1e6 },
72472
72508
  { id: "claude-sonnet-4", name: "Claude Sonnet 4", contextWindow: 128000 },
72473
72509
  { id: "claude-opus-4.5", name: "Claude Opus 4.5", contextWindow: 200000 },
72474
72510
  { id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", contextWindow: 200000 },
@@ -72483,8 +72519,10 @@ var init_copilot = __esm(() => {
72483
72519
  { id: "gemini-3.1-pro-preview", name: "Gemini 3.1 Pro", contextWindow: 1e6 }
72484
72520
  ],
72485
72521
  contextWindows: [
72486
- ["claude-opus-4.6", 200000],
72487
- ["claude-sonnet-4.6", 200000],
72522
+ ["claude-opus-4.8", 1e6],
72523
+ ["claude-opus-4.7", 1e6],
72524
+ ["claude-opus-4.6", 1e6],
72525
+ ["claude-sonnet-4.6", 1e6],
72488
72526
  ["claude-opus-4.5", 200000],
72489
72527
  ["claude-sonnet-4.5", 200000],
72490
72528
  ["claude-sonnet-4", 128000],
@@ -84716,6 +84754,7 @@ var init_llmgateway = __esm(() => {
84716
84754
  return null;
84717
84755
  },
84718
84756
  fallbackModels: [
84757
+ { id: "claude-opus-4-8", name: "Claude Opus 4.8" },
84719
84758
  { id: "claude-opus-4-7", name: "Claude Opus 4.7" },
84720
84759
  { id: "claude-opus-4-6", name: "Claude Opus 4.6" },
84721
84760
  { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
@@ -84741,6 +84780,7 @@ var init_llmgateway = __esm(() => {
84741
84780
  ["glm-4", 128000]
84742
84781
  ],
84743
84782
  contextWindows: [
84783
+ ["claude-opus-4-8", 1e6],
84744
84784
  ["claude-opus-4-7", 1e6],
84745
84785
  ["claude-opus-4-6", 1e6],
84746
84786
  ["claude-sonnet-4-6", 200000],
@@ -93981,6 +94021,73 @@ var init_mistral = __esm(() => {
93981
94021
  };
93982
94022
  });
93983
94023
 
94024
+ // src/core/llm/providers/nim.ts
94025
+ var BASE_URL2 = "https://integrate.api.nvidia.com/v1", nim;
94026
+ var init_nim = __esm(() => {
94027
+ init_dist9();
94028
+ init_config2();
94029
+ init_secrets();
94030
+ init_compat_reasoning();
94031
+ nim = {
94032
+ id: "nim",
94033
+ name: "NVIDIA NIM",
94034
+ envVar: "NVIDIA_API_KEY",
94035
+ icon: "\uF0E7",
94036
+ secretKey: "nvidia-api-key",
94037
+ keyUrl: "build.nvidia.com",
94038
+ asciiIcon: "N",
94039
+ description: "NVIDIA-hosted open models",
94040
+ createModel(modelId) {
94041
+ const apiKey = getProviderApiKey("NVIDIA_API_KEY");
94042
+ if (!apiKey) {
94043
+ throw new Error("NVIDIA_API_KEY is not set");
94044
+ }
94045
+ const reasoningBody = getCompatReasoningBody(`nim/${modelId}`, loadConfig());
94046
+ const reasoningFetch = createReasoningFetchWrapper(reasoningBody);
94047
+ return createOpenAICompatible({
94048
+ name: "nim",
94049
+ baseURL: BASE_URL2,
94050
+ apiKey,
94051
+ ...reasoningFetch ? { fetch: reasoningFetch } : {}
94052
+ })(modelId);
94053
+ },
94054
+ async fetchModels() {
94055
+ const apiKey = getProviderApiKey("NVIDIA_API_KEY");
94056
+ if (!apiKey)
94057
+ return null;
94058
+ const res = await fetch(`${BASE_URL2}/models`, {
94059
+ headers: { Authorization: `Bearer ${apiKey}` }
94060
+ });
94061
+ if (!res.ok)
94062
+ throw new Error(`NVIDIA NIM API ${String(res.status)}`);
94063
+ const data = await res.json();
94064
+ return data.data.map((m) => ({ id: m.id, name: m.id }));
94065
+ },
94066
+ fallbackModels: [
94067
+ { id: "moonshotai/kimi-k2.6", name: "Kimi K2.6" },
94068
+ { id: "deepseek-ai/deepseek-v4-flash", name: "DeepSeek V4 Flash" },
94069
+ { id: "deepseek-ai/deepseek-v4-pro", name: "DeepSeek V4 Pro" },
94070
+ { id: "zai/glm-5.1", name: "GLM-5.1" },
94071
+ { id: "mistralai/mistral-medium-3.5", name: "Mistral Medium 3.5" },
94072
+ { id: "mistralai/mistral-small-4", name: "Mistral Small 4" },
94073
+ { id: "google/gemma-4-31b", name: "Gemma 4 31B" },
94074
+ { id: "nvidia/nemotron-3-super-120b", name: "Nemotron 3 Super 120B" },
94075
+ { id: "minimaxai/minimax-m2.7", name: "MiniMax M2.7" }
94076
+ ],
94077
+ contextWindows: [
94078
+ ["kimi-k2.6", 256000],
94079
+ ["deepseek-v4-flash", 1e6],
94080
+ ["deepseek-v4-pro", 1e6],
94081
+ ["glm-5.1", 200000],
94082
+ ["mistral-medium-3.5", 131072],
94083
+ ["mistral-small-4", 256000],
94084
+ ["gemma-4-31b", 131072],
94085
+ ["nemotron-3-super-120b", 1e6],
94086
+ ["minimax-m2.7", 200000]
94087
+ ]
94088
+ };
94089
+ });
94090
+
93984
94091
  // src/core/llm/providers/ollama.ts
93985
94092
  function getOllamaHost() {
93986
94093
  return (process.env.OLLAMA_HOST ?? "http://localhost:11434").replace(/\/+$/, "");
@@ -94150,7 +94257,7 @@ var init_openai = __esm(() => {
94150
94257
  });
94151
94258
 
94152
94259
  // src/core/llm/providers/opencode-go.ts
94153
- var BASE_URL2 = "https://opencode.ai/zen/go/v1", opencodeGo;
94260
+ var BASE_URL3 = "https://opencode.ai/zen/go/v1", opencodeGo;
94154
94261
  var init_opencode_go = __esm(() => {
94155
94262
  init_dist9();
94156
94263
  init_config2();
@@ -94174,7 +94281,7 @@ var init_opencode_go = __esm(() => {
94174
94281
  const reasoningFetch = createReasoningFetchWrapper(reasoningBody);
94175
94282
  const provider = createOpenAICompatible({
94176
94283
  name: "opencode-go",
94177
- baseURL: BASE_URL2,
94284
+ baseURL: BASE_URL3,
94178
94285
  apiKey,
94179
94286
  ...reasoningFetch ? { fetch: reasoningFetch } : {}
94180
94287
  });
@@ -94228,7 +94335,7 @@ var init_opencode_go = __esm(() => {
94228
94335
  });
94229
94336
 
94230
94337
  // src/core/llm/providers/opencode-zen.ts
94231
- var BASE_URL3 = "https://opencode.ai/zen/v1", opencodeZen;
94338
+ var BASE_URL4 = "https://opencode.ai/zen/v1", opencodeZen;
94232
94339
  var init_opencode_zen = __esm(() => {
94233
94340
  init_dist9();
94234
94341
  init_config2();
@@ -94254,7 +94361,7 @@ var init_opencode_zen = __esm(() => {
94254
94361
  const reasoningFetch = createReasoningFetchWrapper(reasoningBody);
94255
94362
  const provider = createOpenAICompatible({
94256
94363
  name: "opencode-zen",
94257
- baseURL: BASE_URL3,
94364
+ baseURL: BASE_URL4,
94258
94365
  apiKey,
94259
94366
  ...reasoningFetch ? { fetch: reasoningFetch } : {}
94260
94367
  });
@@ -94294,6 +94401,7 @@ var init_opencode_zen = __esm(() => {
94294
94401
  { id: "gpt-5", name: "GPT 5" },
94295
94402
  { id: "gpt-5-codex", name: "GPT 5 Codex" },
94296
94403
  { id: "gpt-5-nano", name: "GPT 5 Nano" },
94404
+ { id: "claude-opus-4-8", name: "Claude Opus 4.8" },
94297
94405
  { id: "claude-opus-4-7", name: "Claude Opus 4.7" },
94298
94406
  { id: "claude-opus-4-6", name: "Claude Opus 4.6" },
94299
94407
  { id: "claude-opus-4-5", name: "Claude Opus 4.5" },
@@ -94352,6 +94460,7 @@ var init_opencode_zen = __esm(() => {
94352
94460
  ["gpt-5", 400000],
94353
94461
  ["gpt-5-codex", 400000],
94354
94462
  ["gpt-5-nano", 400000],
94463
+ ["claude-opus-4-8", 1e6],
94355
94464
  ["claude-opus-4-7", 1e6],
94356
94465
  ["claude-opus-4-6", 1e6],
94357
94466
  ["claude-opus-4-5", 200000],
@@ -94360,6 +94469,7 @@ var init_opencode_zen = __esm(() => {
94360
94469
  ["claude-sonnet-4-5", 1e6],
94361
94470
  ["claude-sonnet-4", 200000],
94362
94471
  ["claude-haiku-4-5", 200000],
94472
+ ["claude-opus-4.8", 1e6],
94363
94473
  ["claude-opus-4.6", 1e6],
94364
94474
  ["claude-sonnet-4.6", 1e6],
94365
94475
  ["claude-sonnet-4.5", 1e6],
@@ -99195,6 +99305,7 @@ var init_openrouter = __esm(() => {
99195
99305
  return null;
99196
99306
  },
99197
99307
  fallbackModels: [
99308
+ { id: "anthropic/claude-opus-4.8", name: "Claude Opus 4.8" },
99198
99309
  { id: "anthropic/claude-opus-4.7", name: "Claude Opus 4.7" },
99199
99310
  { id: "anthropic/claude-opus-4.6", name: "Claude Opus 4.6" },
99200
99311
  { id: "anthropic/claude-sonnet-4.6", name: "Claude Sonnet 4.6" },
@@ -99228,6 +99339,8 @@ var init_openrouter = __esm(() => {
99228
99339
  ["glm-4", 128000]
99229
99340
  ],
99230
99341
  contextWindows: [
99342
+ ["claude-opus-4.8", 1e6],
99343
+ ["claude-opus-4.7", 1e6],
99231
99344
  ["claude-opus-4.6", 1e6],
99232
99345
  ["claude-sonnet-4.6", 1e6],
99233
99346
  ["claude-sonnet-4.5", 1e6],
@@ -401650,7 +401763,7 @@ function matchPricing(modelId) {
401650
401763
  return pricing;
401651
401764
  }
401652
401765
  if (id.includes("opus"))
401653
- return MODEL_PRICING["claude-opus-4-6"] ?? DEFAULT_PRICING;
401766
+ return MODEL_PRICING["claude-opus-4-8"] ?? DEFAULT_PRICING;
401654
401767
  if (id.includes("sonnet"))
401655
401768
  return DEFAULT_PRICING;
401656
401769
  if (id.includes("haiku"))
@@ -401851,6 +401964,7 @@ var init_statusbar = __esm(() => {
401851
401964
  init_platform();
401852
401965
  init_lifecycle();
401853
401966
  MODEL_PRICING = {
401967
+ "claude-opus-4-8": { input: 5, cacheWrite: 6.25, cacheRead: 0.5, output: 25 },
401854
401968
  "claude-opus-4-7": { input: 5, cacheWrite: 6.25, cacheRead: 0.5, output: 25 },
401855
401969
  "claude-opus-4-6": { input: 5, cacheWrite: 6.25, cacheRead: 0.5, output: 25 },
401856
401970
  "claude-opus-4-5": { input: 5, cacheWrite: 6.25, cacheRead: 0.5, output: 25 },
@@ -401947,8 +402061,11 @@ var init_statusbar = __esm(() => {
401947
402061
  "claude-opus-4.5": M3,
401948
402062
  "claude-opus-4.6": M3,
401949
402063
  "claude-opus-4.7": M75,
402064
+ "claude-opus-4.8": M75,
401950
402065
  "gpt-5.5": M75,
401951
- "claude-opus-4.6-fast": M30
402066
+ "claude-opus-4.8-fast": { input: 20, cacheWrite: 20, cacheRead: 2, output: 100 },
402067
+ "claude-opus-4.6-fast": M30,
402068
+ "claude-opus-4.7-fast": M30
401952
402069
  };
401953
402070
  LOCAL_PROVIDERS = new Set(["ollama", "lmstudio"]);
401954
402071
  ZERO_USAGE = {
@@ -407221,6 +407338,7 @@ var init_proxy2 = __esm(() => {
407221
407338
  stopProxy();
407222
407339
  },
407223
407340
  fallbackModels: [
407341
+ { id: "claude-opus-4-8", name: "Claude Opus 4.8" },
407224
407342
  { id: "claude-opus-4-7", name: "Claude Opus 4.7" },
407225
407343
  { id: "claude-opus-4-6", name: "Claude Opus 4.6" },
407226
407344
  { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
@@ -407231,6 +407349,8 @@ var init_proxy2 = __esm(() => {
407231
407349
  { id: "claude-haiku-3-5-20241022", name: "Claude Haiku 3.5" }
407232
407350
  ],
407233
407351
  contextWindows: [
407352
+ ["claude-opus-4-8", 1e6],
407353
+ ["claude-opus-4.8", 1e6],
407234
407354
  ["claude-opus-4-7", 1e6],
407235
407355
  ["claude-opus-4.7", 1e6],
407236
407356
  ["claude-opus-4-6", 1e6],
@@ -410360,6 +410480,7 @@ __export(exports_providers, {
410360
410480
  openai: () => openai2,
410361
410481
  onProvidersChanged: () => onProvidersChanged,
410362
410482
  ollama: () => ollama,
410483
+ nim: () => nim,
410363
410484
  mistral: () => mistral2,
410364
410485
  minimax: () => minimax2,
410365
410486
  lmstudio: () => lmstudio,
@@ -410433,6 +410554,7 @@ var init_providers = __esm(() => {
410433
410554
  init_lmstudio();
410434
410555
  init_minimax();
410435
410556
  init_mistral();
410557
+ init_nim();
410436
410558
  init_ollama();
410437
410559
  init_openai();
410438
410560
  init_opencode_go();
@@ -410455,6 +410577,7 @@ var init_providers = __esm(() => {
410455
410577
  init_lmstudio();
410456
410578
  init_minimax();
410457
410579
  init_mistral();
410580
+ init_nim();
410458
410581
  init_ollama();
410459
410582
  init_openai();
410460
410583
  init_opencode_go();
@@ -410477,6 +410600,7 @@ var init_providers = __esm(() => {
410477
410600
  bedrock2,
410478
410601
  fireworks2,
410479
410602
  minimax2,
410603
+ nim,
410480
410604
  codex,
410481
410605
  copilot,
410482
410606
  githubModels,
@@ -411295,7 +411419,8 @@ async function buildAnthropicOptions(modelId, caps, config2) {
411295
411419
  let thinkingEnabled = false;
411296
411420
  if (caps.thinking) {
411297
411421
  const mode = config2.thinking?.mode ?? "off";
411298
- if (mode === "auto" || mode === "adaptive") {
411422
+ const adaptiveOnly = isAdaptiveOnly2(modelId);
411423
+ if (mode === "auto" || mode === "adaptive" || mode === "enabled" && adaptiveOnly) {
411299
411424
  if (caps.adaptiveThinking) {
411300
411425
  opts.thinking = { type: "adaptive" };
411301
411426
  thinkingEnabled = true;
@@ -411332,7 +411457,7 @@ async function buildAnthropicOptions(modelId, caps, config2) {
411332
411457
  opts.contextManagement = { edits };
411333
411458
  }
411334
411459
  }
411335
- if (thinkingEnabled && caps.interleavedThinking) {
411460
+ if (thinkingEnabled && caps.interleavedThinking && opts.thinking?.type !== "adaptive") {
411336
411461
  headers["anthropic-beta"] = "interleaved-thinking-2025-05-14";
411337
411462
  }
411338
411463
  return { opts, headers, thinkingEnabled };
@@ -411452,7 +411577,7 @@ function degradeProviderOptions(modelId, level) {
411452
411577
  const caps = getEffectiveCaps(modelId);
411453
411578
  const providerOptions = {};
411454
411579
  if (caps.anthropicOptions && caps.thinking) {
411455
- const opts = { thinking: { type: "enabled", budgetTokens: 5000 } };
411580
+ const opts = isAdaptiveOnly2(modelId) ? { thinking: { type: "adaptive" }, effort: "low" } : { thinking: { type: "enabled", budgetTokens: 5000 } };
411456
411581
  providerOptions.anthropic = opts;
411457
411582
  }
411458
411583
  if (caps.openaiOptions && caps.openaiReasoning) {
@@ -411471,9 +411596,7 @@ function degradeProviderOptions(modelId, level) {
411471
411596
  providerOptions.openrouter = { reasoning: { effort: "low" } };
411472
411597
  }
411473
411598
  if (caps.bedrockOptions && caps.thinking) {
411474
- providerOptions.bedrock = {
411475
- reasoningConfig: { type: "enabled", budgetTokens: 5000 }
411476
- };
411599
+ providerOptions.bedrock = isAdaptiveOnly2(modelId) ? { reasoningConfig: { type: "adaptive", maxReasoningEffort: "low" } } : { reasoningConfig: { type: "enabled", budgetTokens: 5000 } };
411477
411600
  }
411478
411601
  return {
411479
411602
  providerOptions,
@@ -411628,11 +411751,12 @@ function buildGroqOptions(config2) {
411628
411751
  function isDeepSeekReasoner(base) {
411629
411752
  return base === "deepseek-reasoner" || base.includes("reasoner") || base.endsWith("-think");
411630
411753
  }
411631
- var parseOpusVersion2, extractBaseModel2, getModelId2, supportsTemperature2, NO_SUPPORT, ANTHROPIC_FULL, OPENAI_FULL, GOOGLE_FULL, XAI_FULL, DEEPSEEK_FULL, OPENROUTER_FULL, GATEWAY_FULL, COMPAT_ONLY, PROVIDER_CONSTRAINTS, LEGACY_PREFIXES, CACHE_EPHEMERAL_5M, CACHE_EPHEMERAL_1H, EPHEMERAL_CACHE_5M, EPHEMERAL_CACHE_1H, EPHEMERAL_CACHE;
411754
+ var parseOpusVersion2, isAdaptiveOnly2, extractBaseModel2, getModelId2, supportsTemperature2, NO_SUPPORT, ANTHROPIC_FULL, OPENAI_FULL, GOOGLE_FULL, XAI_FULL, DEEPSEEK_FULL, OPENROUTER_FULL, GATEWAY_FULL, COMPAT_ONLY, PROVIDER_CONSTRAINTS, LEGACY_PREFIXES, CACHE_EPHEMERAL_5M, CACHE_EPHEMERAL_1H, EPHEMERAL_CACHE_5M, EPHEMERAL_CACHE_1H, EPHEMERAL_CACHE;
411632
411755
  var init_provider_options = __esm(() => {
411633
411756
  init_models();
411634
411757
  init_providers();
411635
411758
  parseOpusVersion2 = parseOpusVersion;
411759
+ isAdaptiveOnly2 = isAdaptiveOnly;
411636
411760
  extractBaseModel2 = extractBaseModel;
411637
411761
  getModelId2 = getModelId;
411638
411762
  supportsTemperature2 = supportsTemperature;
@@ -450125,7 +450249,7 @@ __export(exports_nim, {
450125
450249
  default: () => nim_default
450126
450250
  });
450127
450251
  var lang159, nim_default;
450128
- var init_nim = __esm(() => {
450252
+ var init_nim2 = __esm(() => {
450129
450253
  init_c();
450130
450254
  init_html();
450131
450255
  init_xml();
@@ -452221,7 +452345,7 @@ var init_langs_bundle_full_YTHnHqaM = __esm(() => {
452221
452345
  {
452222
452346
  id: "nim",
452223
452347
  name: "Nim",
452224
- import: () => Promise.resolve().then(() => (init_nim(), exports_nim))
452348
+ import: () => Promise.resolve().then(() => (init_nim2(), exports_nim))
452225
452349
  },
452226
452350
  {
452227
452351
  id: "nix",
@@ -485443,14 +485567,23 @@ var init_FinalResponseView = __esm(() => {
485443
485567
 
485444
485568
  `) : null;
485445
485569
  }, [segments, finalResponseCalled]);
485446
- const toolsRef = import_react62.useRef([]);
485447
485570
  const tools = import_react62.useMemo(() => {
485448
- const next = [];
485449
- for (const tc of liveToolCalls) {
485450
- if (!filterQuietTools(tc.toolName))
485571
+ const ids = [];
485572
+ for (const seg of segments) {
485573
+ if (seg?.type === "tools")
485574
+ ids.push(...seg.callIds);
485575
+ }
485576
+ const seen = new Set;
485577
+ const out2 = [];
485578
+ for (const id of ids) {
485579
+ if (seen.has(id))
485580
+ continue;
485581
+ seen.add(id);
485582
+ const tc = liveToolCalls.find((c) => c.id === id);
485583
+ if (!tc || !filterQuietTools(tc.toolName))
485451
485584
  continue;
485452
485585
  const isDispatch = SUBAGENT_NAMES.has(tc.toolName);
485453
- next.push({
485586
+ out2.push({
485454
485587
  id: tc.id,
485455
485588
  name: tc.toolName,
485456
485589
  done: tc.state !== "running",
@@ -485462,17 +485595,12 @@ var init_FinalResponseView = __esm(() => {
485462
485595
  imageArt: tc.imageArt
485463
485596
  });
485464
485597
  }
485465
- const prev = toolsRef.current;
485466
- if (prev.length === next.length && prev.every((p3, i4) => next[i4] !== undefined && p3.id === next[i4]?.id && p3.name === next[i4]?.name && p3.done === next[i4]?.done && p3.error === next[i4]?.error && p3.argStr === next[i4]?.argStr && !!p3.subtree === !!next[i4]?.subtree && p3.imageArt === next[i4]?.imageArt)) {
485467
- return prev;
485468
- }
485469
- toolsRef.current = next;
485470
- return next;
485471
- }, [liveToolCalls]);
485598
+ return out2;
485599
+ }, [segments, liveToolCalls]);
485472
485600
  const hasDispatch = import_react62.useMemo(() => liveToolCalls.some((tc) => SUBAGENT_NAMES.has(tc.toolName)), [liveToolCalls]);
485473
485601
  const hasEdits = import_react62.useMemo(() => liveToolCalls.some((tc) => FINAL_RESPONSE_EDIT_TOOLS.has(tc.toolName)), [liveToolCalls]);
485474
- const allToolsDone = tools.length > 0 && tools.every((t) => t.done);
485475
485602
  const dispatchActive = liveToolCalls.some((tc) => SUBAGENT_NAMES.has(tc.toolName) && tc.state === "running");
485603
+ const allToolsDone = tools.length > 0 && tools.every((t) => t.done);
485476
485604
  const pendingNarration = allToolsDone && !dispatchActive && !trailingText;
485477
485605
  if (chatOnlyText) {
485478
485606
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -28394,66 +28394,452 @@ var init_protocol = __esm(() => {
28394
28394
  FILE_URI_SAFE_RE = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g;
28395
28395
  });
28396
28396
 
28397
- // node_modules/zustand/esm/vanilla.mjs
28398
- var createStoreImpl = (createState) => {
28399
- let state;
28400
- const listeners = /* @__PURE__ */ new Set;
28401
- const setState = (partial, replace) => {
28402
- const nextState = typeof partial === "function" ? partial(state) : partial;
28403
- if (!Object.is(nextState, state)) {
28404
- const previousState = state;
28405
- state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
28406
- listeners.forEach((listener) => listener(state, previousState));
28397
+ // src/config/index.ts
28398
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
28399
+ import { join as join9 } from "path";
28400
+ function getConfigDir() {
28401
+ return configDir();
28402
+ }
28403
+ function getConfigFile() {
28404
+ return join9(getConfigDir(), "config.json");
28405
+ }
28406
+ function loadConfig() {
28407
+ const configDir2 = getConfigDir();
28408
+ const configFile = getConfigFile();
28409
+ if (!existsSync7(configDir2)) {
28410
+ mkdirSync2(configDir2, {
28411
+ recursive: true,
28412
+ mode: 448
28413
+ });
28414
+ }
28415
+ let userConfig = {};
28416
+ let fileExists = existsSync7(configFile);
28417
+ if (!fileExists) {
28418
+ writeFileSync3(configFile, JSON.stringify(DEFAULT_CONFIG, null, 2));
28419
+ fileExists = true;
28420
+ } else {
28421
+ try {
28422
+ userConfig = JSON.parse(readFileSync4(configFile, "utf-8"));
28423
+ } catch (err2) {
28424
+ const msg = err2 instanceof Error ? err2.message : String(err2);
28425
+ process.stderr.write(`
28426
+ Error: invalid config.json \u2014 ${msg}
28427
+
28428
+ ` + ` Path: ${configFile}
28429
+
28430
+ ` + ` Fix the JSON syntax error and try again.
28431
+ ` + ` (Your config was NOT overwritten.)
28432
+
28433
+ `);
28434
+ process.exit(1);
28407
28435
  }
28436
+ }
28437
+ let merged = {
28438
+ ...DEFAULT_CONFIG
28408
28439
  };
28409
- const getState = () => state;
28410
- const getInitialState = () => initialState;
28411
- const subscribe = (listener) => {
28412
- listeners.add(listener);
28413
- return () => listeners.delete(listener);
28414
- };
28415
- const api = { setState, getState, getInitialState, subscribe };
28416
- const initialState = state = createState(setState, getState, api);
28417
- return api;
28418
- }, createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
28419
- var init_vanilla = () => {};
28420
-
28421
- // node_modules/react/cjs/react.development.js
28422
- var require_react_development = __commonJS((exports, module2) => {
28423
- (function() {
28424
- function defineDeprecationWarning(methodName, info2) {
28425
- Object.defineProperty(Component.prototype, methodName, {
28426
- get: function() {
28427
- console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", info2[0], info2[1]);
28440
+ if (_presetOverlay)
28441
+ merged = applyConfigPatch(merged, _presetOverlay);
28442
+ const userPatch = diffAgainstDefaults(userConfig);
28443
+ if (Object.keys(userPatch).length > 0) {
28444
+ merged = applyConfigPatch(merged, userPatch);
28445
+ }
28446
+ return merged;
28447
+ }
28448
+ function diffAgainstDefaults(userConfig) {
28449
+ const out2 = {};
28450
+ const defaults = DEFAULT_CONFIG;
28451
+ const nested = new Set(NESTED_KEYS);
28452
+ for (const [key2, value] of Object.entries(userConfig)) {
28453
+ if (value === undefined)
28454
+ continue;
28455
+ const def = defaults[key2];
28456
+ if (nested.has(key2) && value && typeof value === "object" && !Array.isArray(value) && def && typeof def === "object" && !Array.isArray(def)) {
28457
+ const subPatch = {};
28458
+ const defRec = def;
28459
+ for (const [subKey, subValue] of Object.entries(value)) {
28460
+ if (subValue === undefined)
28461
+ continue;
28462
+ if (JSON.stringify(subValue) !== JSON.stringify(defRec[subKey])) {
28463
+ subPatch[subKey] = subValue;
28428
28464
  }
28429
- });
28465
+ }
28466
+ if (Object.keys(subPatch).length > 0)
28467
+ out2[key2] = subPatch;
28468
+ continue;
28430
28469
  }
28431
- function getIteratorFn(maybeIterable) {
28432
- if (maybeIterable === null || typeof maybeIterable !== "object")
28433
- return null;
28434
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
28435
- return typeof maybeIterable === "function" ? maybeIterable : null;
28470
+ if (JSON.stringify(value) !== JSON.stringify(def)) {
28471
+ out2[key2] = value;
28436
28472
  }
28437
- function warnNoop(publicInstance, callerName) {
28438
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
28439
- var warningKey = publicInstance + "." + callerName;
28440
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, publicInstance), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
28473
+ }
28474
+ return out2;
28475
+ }
28476
+ function loadProjectConfig(cwd) {
28477
+ const projectFile = join9(cwd, ".soulforge", "config.json");
28478
+ if (!existsSync7(projectFile))
28479
+ return null;
28480
+ try {
28481
+ const raw2 = readFileSync4(projectFile, "utf-8");
28482
+ return JSON.parse(raw2);
28483
+ } catch (err2) {
28484
+ const msg = err2 instanceof Error ? err2.message : String(err2);
28485
+ process.stderr.write(`
28486
+ Warning: invalid project config.json \u2014 ${msg}
28487
+ ` + ` Path: ${projectFile}
28488
+ ` + ` Fix the JSON syntax error. Ignoring project config for now.
28489
+
28490
+ `);
28491
+ return null;
28492
+ }
28493
+ }
28494
+ function applyConfigPatch(base, patch) {
28495
+ const result = {
28496
+ ...base,
28497
+ ...patch
28498
+ };
28499
+ for (const key2 of NESTED_KEYS) {
28500
+ const b3 = base[key2];
28501
+ const p2 = patch[key2];
28502
+ if (p2 && b3 && typeof b3 === "object" && typeof p2 === "object") {
28503
+ result[key2] = {
28504
+ ...b3,
28505
+ ...p2
28506
+ };
28441
28507
  }
28442
- function Component(props, context, updater) {
28443
- this.props = props;
28444
- this.context = context;
28445
- this.refs = emptyObject;
28446
- this.updater = updater || ReactNoopUpdateQueue;
28508
+ }
28509
+ return result;
28510
+ }
28511
+ var DEFAULT_CONFIG, _presetOverlay = null, NESTED_KEYS;
28512
+ var init_config = __esm(() => {
28513
+ init_platform();
28514
+ init_ensure_soulforge_dir();
28515
+ DEFAULT_CONFIG = {
28516
+ defaultModel: "none",
28517
+ routerRules: [],
28518
+ editor: {
28519
+ command: "nvim",
28520
+ args: []
28521
+ },
28522
+ theme: {
28523
+ name: "proxysoul-main",
28524
+ transparent: true
28525
+ },
28526
+ nvimConfig: "default",
28527
+ editorIntegration: {
28528
+ diagnostics: true,
28529
+ symbols: true,
28530
+ hover: true,
28531
+ references: true,
28532
+ definition: true,
28533
+ codeActions: true,
28534
+ editorContext: true,
28535
+ rename: true,
28536
+ lspStatus: true,
28537
+ format: true,
28538
+ syncEditorOnEdit: false
28539
+ },
28540
+ codeExecution: true,
28541
+ webSearch: true,
28542
+ compaction: {
28543
+ strategy: "v2",
28544
+ triggerThreshold: 0.7,
28545
+ resetThreshold: 0.4,
28546
+ keepRecent: 4,
28547
+ maxToolResults: 30,
28548
+ llmExtraction: true
28447
28549
  }
28448
- function ComponentDummy() {}
28449
- function PureComponent(props, context, updater) {
28450
- this.props = props;
28451
- this.context = context;
28452
- this.refs = emptyObject;
28453
- this.updater = updater || ReactNoopUpdateQueue;
28550
+ };
28551
+ NESTED_KEYS = ["editor", "theme", "editorIntegration", "codeIntelligence", "thinking", "performance", "contextManagement", "agentFeatures", "compaction", "retry", "addons"];
28552
+ });
28553
+
28554
+ // src/core/intelligence/backends/lsp/server-registry.ts
28555
+ import { existsSync as existsSync8 } from "fs";
28556
+ import { join as join10 } from "path";
28557
+ function firstExisting(dir, cmd) {
28558
+ for (const sfx of BIN_SUFFIXES) {
28559
+ const p2 = join10(dir, cmd + sfx);
28560
+ if (existsSync8(p2))
28561
+ return p2;
28562
+ }
28563
+ return null;
28564
+ }
28565
+ function commandExistsInMason(cmd) {
28566
+ return firstExisting(MASON_BIN_DIR, cmd);
28567
+ }
28568
+ function findInSoulforge(cmd) {
28569
+ const npmBin = firstExisting(join10(SOULFORGE_BIN_DIR, "node_modules", ".bin"), cmd);
28570
+ if (npmBin)
28571
+ return npmBin;
28572
+ const directBin = firstExisting(join10(SOULFORGE_BIN_DIR, "bin"), cmd);
28573
+ if (directBin)
28574
+ return directBin;
28575
+ return null;
28576
+ }
28577
+ function resolveCommand(cmd) {
28578
+ const cached = probeCache.get(cmd);
28579
+ if (cached !== undefined)
28580
+ return cached;
28581
+ if (commandExists(cmd)) {
28582
+ probeCache.set(cmd, cmd);
28583
+ return cmd;
28584
+ }
28585
+ const sfPath = findInSoulforge(cmd);
28586
+ if (sfPath) {
28587
+ probeCache.set(cmd, sfPath);
28588
+ return sfPath;
28589
+ }
28590
+ const masonPath = commandExistsInMason(cmd);
28591
+ if (masonPath) {
28592
+ probeCache.set(cmd, masonPath);
28593
+ return masonPath;
28594
+ }
28595
+ probeCache.set(cmd, null);
28596
+ return null;
28597
+ }
28598
+ function isServerDisabled(cmd) {
28599
+ const cwd = process.cwd();
28600
+ const global2 = loadConfig();
28601
+ const project = loadProjectConfig(cwd);
28602
+ const disabled = project?.disabledLspServers ?? global2.disabledLspServers ?? [];
28603
+ return disabled.includes(cmd);
28604
+ }
28605
+ function findServersForLanguage(language) {
28606
+ const candidates = SERVER_CANDIDATES[language];
28607
+ if (!candidates)
28608
+ return [];
28609
+ const results = [];
28610
+ for (const candidate of candidates) {
28611
+ if (isServerDisabled(candidate.command))
28612
+ continue;
28613
+ const resolved = resolveCommand(candidate.command);
28614
+ if (resolved) {
28615
+ results.push({
28616
+ command: resolved,
28617
+ args: candidate.args,
28618
+ language
28619
+ });
28454
28620
  }
28455
- function noop() {}
28456
- function testStringCoercion(value) {
28621
+ }
28622
+ return results;
28623
+ }
28624
+ var SERVER_CANDIDATES, MASON_BIN_DIR, SOULFORGE_BIN_DIR, BIN_SUFFIXES, probeCache;
28625
+ var init_server_registry = __esm(() => {
28626
+ init_config();
28627
+ init_platform();
28628
+ SERVER_CANDIDATES = {
28629
+ typescript: [{
28630
+ command: "typescript-language-server",
28631
+ args: ["--stdio"]
28632
+ }, {
28633
+ command: "biome",
28634
+ args: ["lsp-proxy"]
28635
+ }, {
28636
+ command: "deno",
28637
+ args: ["lsp"]
28638
+ }, {
28639
+ command: "vscode-eslint-language-server",
28640
+ args: ["--stdio"]
28641
+ }],
28642
+ javascript: [{
28643
+ command: "typescript-language-server",
28644
+ args: ["--stdio"]
28645
+ }, {
28646
+ command: "biome",
28647
+ args: ["lsp-proxy"]
28648
+ }, {
28649
+ command: "deno",
28650
+ args: ["lsp"]
28651
+ }, {
28652
+ command: "vscode-eslint-language-server",
28653
+ args: ["--stdio"]
28654
+ }],
28655
+ python: [{
28656
+ command: "pyright-langserver",
28657
+ args: ["--stdio"]
28658
+ }, {
28659
+ command: "pylsp",
28660
+ args: []
28661
+ }],
28662
+ go: [{
28663
+ command: "gopls",
28664
+ args: ["serve"]
28665
+ }],
28666
+ rust: [{
28667
+ command: "rust-analyzer",
28668
+ args: []
28669
+ }],
28670
+ lua: [{
28671
+ command: "lua-language-server",
28672
+ args: []
28673
+ }],
28674
+ c: [{
28675
+ command: "clangd",
28676
+ args: []
28677
+ }],
28678
+ cpp: [{
28679
+ command: "clangd",
28680
+ args: []
28681
+ }],
28682
+ ruby: [{
28683
+ command: "solargraph",
28684
+ args: ["stdio"]
28685
+ }],
28686
+ php: [{
28687
+ command: "intelephense",
28688
+ args: ["--stdio"]
28689
+ }],
28690
+ zig: [{
28691
+ command: "zls",
28692
+ args: []
28693
+ }],
28694
+ bash: [{
28695
+ command: "bash-language-server",
28696
+ args: ["start"]
28697
+ }],
28698
+ css: [{
28699
+ command: "vscode-css-language-server",
28700
+ args: ["--stdio"]
28701
+ }, {
28702
+ command: "biome",
28703
+ args: ["lsp-proxy"]
28704
+ }, {
28705
+ command: "tailwindcss-language-server",
28706
+ args: ["--stdio"]
28707
+ }],
28708
+ html: [{
28709
+ command: "vscode-html-language-server",
28710
+ args: ["--stdio"]
28711
+ }, {
28712
+ command: "emmet-language-server",
28713
+ args: ["--stdio"]
28714
+ }],
28715
+ json: [{
28716
+ command: "vscode-json-language-server",
28717
+ args: ["--stdio"]
28718
+ }, {
28719
+ command: "biome",
28720
+ args: ["lsp-proxy"]
28721
+ }],
28722
+ yaml: [{
28723
+ command: "yaml-language-server",
28724
+ args: ["--stdio"]
28725
+ }],
28726
+ toml: [{
28727
+ command: "taplo",
28728
+ args: ["lsp", "stdio"]
28729
+ }],
28730
+ dockerfile: [{
28731
+ command: "docker-langserver",
28732
+ args: ["--stdio"]
28733
+ }],
28734
+ java: [{
28735
+ command: "jdtls",
28736
+ args: []
28737
+ }],
28738
+ kotlin: [{
28739
+ command: "kotlin-language-server",
28740
+ args: []
28741
+ }],
28742
+ scala: [{
28743
+ command: "metals",
28744
+ args: []
28745
+ }],
28746
+ csharp: [{
28747
+ command: "csharp-ls",
28748
+ args: []
28749
+ }, {
28750
+ command: "OmniSharp",
28751
+ args: ["--languageserver"]
28752
+ }],
28753
+ swift: [{
28754
+ command: "sourcekit-lsp",
28755
+ args: []
28756
+ }],
28757
+ dart: [{
28758
+ command: "dart",
28759
+ args: ["language-server", "--protocol=lsp"]
28760
+ }],
28761
+ elixir: [{
28762
+ command: "elixir-ls",
28763
+ args: []
28764
+ }, {
28765
+ command: "expert",
28766
+ args: []
28767
+ }],
28768
+ ocaml: [{
28769
+ command: "ocamllsp",
28770
+ args: []
28771
+ }],
28772
+ vue: [{
28773
+ command: "vue-language-server",
28774
+ args: ["--stdio"]
28775
+ }]
28776
+ };
28777
+ MASON_BIN_DIR = join10(userDataDir(), "mason", "bin");
28778
+ SOULFORGE_BIN_DIR = join10(configDir(), "lsp-servers");
28779
+ BIN_SUFFIXES = IS_WIN ? [".exe", ".cmd", ""] : [""];
28780
+ probeCache = new Map;
28781
+ });
28782
+
28783
+ // node_modules/zustand/esm/vanilla.mjs
28784
+ var createStoreImpl = (createState) => {
28785
+ let state;
28786
+ const listeners = /* @__PURE__ */ new Set;
28787
+ const setState = (partial, replace) => {
28788
+ const nextState = typeof partial === "function" ? partial(state) : partial;
28789
+ if (!Object.is(nextState, state)) {
28790
+ const previousState = state;
28791
+ state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
28792
+ listeners.forEach((listener) => listener(state, previousState));
28793
+ }
28794
+ };
28795
+ const getState = () => state;
28796
+ const getInitialState = () => initialState;
28797
+ const subscribe = (listener) => {
28798
+ listeners.add(listener);
28799
+ return () => listeners.delete(listener);
28800
+ };
28801
+ const api = { setState, getState, getInitialState, subscribe };
28802
+ const initialState = state = createState(setState, getState, api);
28803
+ return api;
28804
+ }, createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
28805
+ var init_vanilla = () => {};
28806
+
28807
+ // node_modules/react/cjs/react.development.js
28808
+ var require_react_development = __commonJS((exports, module2) => {
28809
+ (function() {
28810
+ function defineDeprecationWarning(methodName, info2) {
28811
+ Object.defineProperty(Component.prototype, methodName, {
28812
+ get: function() {
28813
+ console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", info2[0], info2[1]);
28814
+ }
28815
+ });
28816
+ }
28817
+ function getIteratorFn(maybeIterable) {
28818
+ if (maybeIterable === null || typeof maybeIterable !== "object")
28819
+ return null;
28820
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
28821
+ return typeof maybeIterable === "function" ? maybeIterable : null;
28822
+ }
28823
+ function warnNoop(publicInstance, callerName) {
28824
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
28825
+ var warningKey = publicInstance + "." + callerName;
28826
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, publicInstance), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
28827
+ }
28828
+ function Component(props, context, updater) {
28829
+ this.props = props;
28830
+ this.context = context;
28831
+ this.refs = emptyObject;
28832
+ this.updater = updater || ReactNoopUpdateQueue;
28833
+ }
28834
+ function ComponentDummy() {}
28835
+ function PureComponent(props, context, updater) {
28836
+ this.props = props;
28837
+ this.context = context;
28838
+ this.refs = emptyObject;
28839
+ this.updater = updater || ReactNoopUpdateQueue;
28840
+ }
28841
+ function noop() {}
28842
+ function testStringCoercion(value) {
28457
28843
  return "" + value;
28458
28844
  }
28459
28845
  function checkKeyStringCoercion(value) {
@@ -29328,378 +29714,6 @@ var init_errors = __esm(() => {
29328
29714
  })));
29329
29715
  });
29330
29716
 
29331
- // src/config/index.ts
29332
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
29333
- import { join as join9 } from "path";
29334
- function getConfigDir() {
29335
- return configDir();
29336
- }
29337
- function getConfigFile() {
29338
- return join9(getConfigDir(), "config.json");
29339
- }
29340
- function loadConfig() {
29341
- const configDir2 = getConfigDir();
29342
- const configFile = getConfigFile();
29343
- if (!existsSync7(configDir2)) {
29344
- mkdirSync2(configDir2, {
29345
- recursive: true,
29346
- mode: 448
29347
- });
29348
- }
29349
- let userConfig = {};
29350
- let fileExists = existsSync7(configFile);
29351
- if (!fileExists) {
29352
- writeFileSync3(configFile, JSON.stringify(DEFAULT_CONFIG, null, 2));
29353
- fileExists = true;
29354
- } else {
29355
- try {
29356
- userConfig = JSON.parse(readFileSync4(configFile, "utf-8"));
29357
- } catch (err2) {
29358
- logBackgroundError("config", `Failed to parse ${configFile}: ${err2 instanceof Error ? err2.message : String(err2)} \u2014 using defaults`);
29359
- userConfig = {};
29360
- }
29361
- }
29362
- let merged = {
29363
- ...DEFAULT_CONFIG
29364
- };
29365
- if (_presetOverlay)
29366
- merged = applyConfigPatch(merged, _presetOverlay);
29367
- const userPatch = diffAgainstDefaults(userConfig);
29368
- if (Object.keys(userPatch).length > 0) {
29369
- merged = applyConfigPatch(merged, userPatch);
29370
- }
29371
- return merged;
29372
- }
29373
- function diffAgainstDefaults(userConfig) {
29374
- const out2 = {};
29375
- const defaults = DEFAULT_CONFIG;
29376
- const nested = new Set(NESTED_KEYS);
29377
- for (const [key2, value] of Object.entries(userConfig)) {
29378
- if (value === undefined)
29379
- continue;
29380
- const def = defaults[key2];
29381
- if (nested.has(key2) && value && typeof value === "object" && !Array.isArray(value) && def && typeof def === "object" && !Array.isArray(def)) {
29382
- const subPatch = {};
29383
- const defRec = def;
29384
- for (const [subKey, subValue] of Object.entries(value)) {
29385
- if (subValue === undefined)
29386
- continue;
29387
- if (JSON.stringify(subValue) !== JSON.stringify(defRec[subKey])) {
29388
- subPatch[subKey] = subValue;
29389
- }
29390
- }
29391
- if (Object.keys(subPatch).length > 0)
29392
- out2[key2] = subPatch;
29393
- continue;
29394
- }
29395
- if (JSON.stringify(value) !== JSON.stringify(def)) {
29396
- out2[key2] = value;
29397
- }
29398
- }
29399
- return out2;
29400
- }
29401
- function loadProjectConfig(cwd) {
29402
- const projectFile = join9(cwd, ".soulforge", "config.json");
29403
- if (!existsSync7(projectFile))
29404
- return null;
29405
- try {
29406
- const raw2 = readFileSync4(projectFile, "utf-8");
29407
- return JSON.parse(raw2);
29408
- } catch (err2) {
29409
- logBackgroundError("config", `Failed to parse ${projectFile}: ${err2 instanceof Error ? err2.message : String(err2)} \u2014 ignoring project config`);
29410
- return null;
29411
- }
29412
- }
29413
- function applyConfigPatch(base, patch) {
29414
- const result = {
29415
- ...base,
29416
- ...patch
29417
- };
29418
- for (const key2 of NESTED_KEYS) {
29419
- const b3 = base[key2];
29420
- const p2 = patch[key2];
29421
- if (p2 && b3 && typeof b3 === "object" && typeof p2 === "object") {
29422
- result[key2] = {
29423
- ...b3,
29424
- ...p2
29425
- };
29426
- }
29427
- }
29428
- return result;
29429
- }
29430
- var DEFAULT_CONFIG, _presetOverlay = null, NESTED_KEYS;
29431
- var init_config = __esm(() => {
29432
- init_platform();
29433
- init_ensure_soulforge_dir();
29434
- init_errors();
29435
- DEFAULT_CONFIG = {
29436
- defaultModel: "none",
29437
- routerRules: [],
29438
- editor: {
29439
- command: "nvim",
29440
- args: []
29441
- },
29442
- theme: {
29443
- name: "proxysoul-main",
29444
- transparent: true
29445
- },
29446
- nvimConfig: "default",
29447
- editorIntegration: {
29448
- diagnostics: true,
29449
- symbols: true,
29450
- hover: true,
29451
- references: true,
29452
- definition: true,
29453
- codeActions: true,
29454
- editorContext: true,
29455
- rename: true,
29456
- lspStatus: true,
29457
- format: true,
29458
- syncEditorOnEdit: false
29459
- },
29460
- codeExecution: true,
29461
- webSearch: true,
29462
- compaction: {
29463
- strategy: "v2",
29464
- triggerThreshold: 0.7,
29465
- resetThreshold: 0.4,
29466
- keepRecent: 4,
29467
- maxToolResults: 30,
29468
- llmExtraction: true
29469
- }
29470
- };
29471
- NESTED_KEYS = ["editor", "theme", "editorIntegration", "codeIntelligence", "thinking", "performance", "contextManagement", "agentFeatures", "compaction", "retry", "addons"];
29472
- });
29473
-
29474
- // src/core/intelligence/backends/lsp/server-registry.ts
29475
- import { existsSync as existsSync8 } from "fs";
29476
- import { join as join10 } from "path";
29477
- function firstExisting(dir, cmd) {
29478
- for (const sfx of BIN_SUFFIXES) {
29479
- const p2 = join10(dir, cmd + sfx);
29480
- if (existsSync8(p2))
29481
- return p2;
29482
- }
29483
- return null;
29484
- }
29485
- function commandExistsInMason(cmd) {
29486
- return firstExisting(MASON_BIN_DIR, cmd);
29487
- }
29488
- function findInSoulforge(cmd) {
29489
- const npmBin = firstExisting(join10(SOULFORGE_BIN_DIR, "node_modules", ".bin"), cmd);
29490
- if (npmBin)
29491
- return npmBin;
29492
- const directBin = firstExisting(join10(SOULFORGE_BIN_DIR, "bin"), cmd);
29493
- if (directBin)
29494
- return directBin;
29495
- return null;
29496
- }
29497
- function resolveCommand(cmd) {
29498
- const cached = probeCache.get(cmd);
29499
- if (cached !== undefined)
29500
- return cached;
29501
- if (commandExists(cmd)) {
29502
- probeCache.set(cmd, cmd);
29503
- return cmd;
29504
- }
29505
- const sfPath = findInSoulforge(cmd);
29506
- if (sfPath) {
29507
- probeCache.set(cmd, sfPath);
29508
- return sfPath;
29509
- }
29510
- const masonPath = commandExistsInMason(cmd);
29511
- if (masonPath) {
29512
- probeCache.set(cmd, masonPath);
29513
- return masonPath;
29514
- }
29515
- probeCache.set(cmd, null);
29516
- return null;
29517
- }
29518
- function isServerDisabled(cmd) {
29519
- const cwd = process.cwd();
29520
- const global2 = loadConfig();
29521
- const project = loadProjectConfig(cwd);
29522
- const disabled = project?.disabledLspServers ?? global2.disabledLspServers ?? [];
29523
- return disabled.includes(cmd);
29524
- }
29525
- function findServersForLanguage(language) {
29526
- const candidates = SERVER_CANDIDATES[language];
29527
- if (!candidates)
29528
- return [];
29529
- const results = [];
29530
- for (const candidate of candidates) {
29531
- if (isServerDisabled(candidate.command))
29532
- continue;
29533
- const resolved = resolveCommand(candidate.command);
29534
- if (resolved) {
29535
- results.push({
29536
- command: resolved,
29537
- args: candidate.args,
29538
- language
29539
- });
29540
- }
29541
- }
29542
- return results;
29543
- }
29544
- var SERVER_CANDIDATES, MASON_BIN_DIR, SOULFORGE_BIN_DIR, BIN_SUFFIXES, probeCache;
29545
- var init_server_registry = __esm(() => {
29546
- init_config();
29547
- init_platform();
29548
- SERVER_CANDIDATES = {
29549
- typescript: [{
29550
- command: "typescript-language-server",
29551
- args: ["--stdio"]
29552
- }, {
29553
- command: "biome",
29554
- args: ["lsp-proxy"]
29555
- }, {
29556
- command: "deno",
29557
- args: ["lsp"]
29558
- }, {
29559
- command: "vscode-eslint-language-server",
29560
- args: ["--stdio"]
29561
- }],
29562
- javascript: [{
29563
- command: "typescript-language-server",
29564
- args: ["--stdio"]
29565
- }, {
29566
- command: "biome",
29567
- args: ["lsp-proxy"]
29568
- }, {
29569
- command: "deno",
29570
- args: ["lsp"]
29571
- }, {
29572
- command: "vscode-eslint-language-server",
29573
- args: ["--stdio"]
29574
- }],
29575
- python: [{
29576
- command: "pyright-langserver",
29577
- args: ["--stdio"]
29578
- }, {
29579
- command: "pylsp",
29580
- args: []
29581
- }],
29582
- go: [{
29583
- command: "gopls",
29584
- args: ["serve"]
29585
- }],
29586
- rust: [{
29587
- command: "rust-analyzer",
29588
- args: []
29589
- }],
29590
- lua: [{
29591
- command: "lua-language-server",
29592
- args: []
29593
- }],
29594
- c: [{
29595
- command: "clangd",
29596
- args: []
29597
- }],
29598
- cpp: [{
29599
- command: "clangd",
29600
- args: []
29601
- }],
29602
- ruby: [{
29603
- command: "solargraph",
29604
- args: ["stdio"]
29605
- }],
29606
- php: [{
29607
- command: "intelephense",
29608
- args: ["--stdio"]
29609
- }],
29610
- zig: [{
29611
- command: "zls",
29612
- args: []
29613
- }],
29614
- bash: [{
29615
- command: "bash-language-server",
29616
- args: ["start"]
29617
- }],
29618
- css: [{
29619
- command: "vscode-css-language-server",
29620
- args: ["--stdio"]
29621
- }, {
29622
- command: "biome",
29623
- args: ["lsp-proxy"]
29624
- }, {
29625
- command: "tailwindcss-language-server",
29626
- args: ["--stdio"]
29627
- }],
29628
- html: [{
29629
- command: "vscode-html-language-server",
29630
- args: ["--stdio"]
29631
- }, {
29632
- command: "emmet-language-server",
29633
- args: ["--stdio"]
29634
- }],
29635
- json: [{
29636
- command: "vscode-json-language-server",
29637
- args: ["--stdio"]
29638
- }, {
29639
- command: "biome",
29640
- args: ["lsp-proxy"]
29641
- }],
29642
- yaml: [{
29643
- command: "yaml-language-server",
29644
- args: ["--stdio"]
29645
- }],
29646
- toml: [{
29647
- command: "taplo",
29648
- args: ["lsp", "stdio"]
29649
- }],
29650
- dockerfile: [{
29651
- command: "docker-langserver",
29652
- args: ["--stdio"]
29653
- }],
29654
- java: [{
29655
- command: "jdtls",
29656
- args: []
29657
- }],
29658
- kotlin: [{
29659
- command: "kotlin-language-server",
29660
- args: []
29661
- }],
29662
- scala: [{
29663
- command: "metals",
29664
- args: []
29665
- }],
29666
- csharp: [{
29667
- command: "csharp-ls",
29668
- args: []
29669
- }, {
29670
- command: "OmniSharp",
29671
- args: ["--languageserver"]
29672
- }],
29673
- swift: [{
29674
- command: "sourcekit-lsp",
29675
- args: []
29676
- }],
29677
- dart: [{
29678
- command: "dart",
29679
- args: ["language-server", "--protocol=lsp"]
29680
- }],
29681
- elixir: [{
29682
- command: "elixir-ls",
29683
- args: []
29684
- }, {
29685
- command: "expert",
29686
- args: []
29687
- }],
29688
- ocaml: [{
29689
- command: "ocamllsp",
29690
- args: []
29691
- }],
29692
- vue: [{
29693
- command: "vue-language-server",
29694
- args: ["--stdio"]
29695
- }]
29696
- };
29697
- MASON_BIN_DIR = join10(userDataDir(), "mason", "bin");
29698
- SOULFORGE_BIN_DIR = join10(configDir(), "lsp-servers");
29699
- BIN_SUFFIXES = IS_WIN ? [".exe", ".cmd", ""] : [""];
29700
- probeCache = new Map;
29701
- });
29702
-
29703
29717
  // src/core/process-tracker.ts
29704
29718
  function trackProcess(proc) {
29705
29719
  tracked.add(proc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "2.18.4",
3
+ "version": "2.18.5",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",