@proxysoul/soulforge 2.14.0 → 2.14.1

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.
@@ -41855,7 +41855,7 @@ var init_ui = __esm(() => {
41855
41855
  reasoningExpanded: {},
41856
41856
  suspended: false,
41857
41857
  editorSplit: 60,
41858
- lockIn: false,
41858
+ lockIn: true,
41859
41859
  openModal: (name21) => set2(() => ({
41860
41860
  modals: {
41861
41861
  ...INITIAL_MODALS,
@@ -49520,7 +49520,7 @@ var package_default;
49520
49520
  var init_package = __esm(() => {
49521
49521
  package_default = {
49522
49522
  name: "@proxysoul/soulforge",
49523
- version: "2.14.0",
49523
+ version: "2.14.1",
49524
49524
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
49525
49525
  repository: {
49526
49526
  type: "git",
@@ -49572,9 +49572,9 @@ var init_package = __esm(() => {
49572
49572
  },
49573
49573
  devDependencies: {
49574
49574
  "@babel/core": "7.29.0",
49575
- "@biomejs/biome": "2.4.12",
49575
+ "@biomejs/biome": "2.4.13",
49576
49576
  "@types/babel__core": "7.20.5",
49577
- "@types/bun": "1.3.12",
49577
+ "@types/bun": "1.3.13",
49578
49578
  "@types/linkify-it": "5.0.0",
49579
49579
  "@types/node": "25.6.0",
49580
49580
  "@types/react": "19.2.14",
@@ -49594,14 +49594,14 @@ var init_package = __esm(() => {
49594
49594
  "@ai-sdk/openai": "3.0.53",
49595
49595
  "@ai-sdk/openai-compatible": "^2.0.41",
49596
49596
  "@ai-sdk/xai": "3.0.83",
49597
- "@anthropic-ai/sdk": "0.90.0",
49598
- "@llmgateway/ai-sdk-provider": "3.6.0",
49597
+ "@anthropic-ai/sdk": "0.91.1",
49598
+ "@llmgateway/ai-sdk-provider": "3.7.0",
49599
49599
  "@modelcontextprotocol/sdk": "^1.29.0",
49600
49600
  "@mozilla/readability": "0.6.0",
49601
- "@openrouter/ai-sdk-provider": "2.8.0",
49602
- "@opentui/react": "0.1.102",
49601
+ "@openrouter/ai-sdk-provider": "2.8.1",
49602
+ "@opentui/react": "0.2.0",
49603
49603
  ai: "6.0.168",
49604
- "ghostty-opentui": "1.4.10",
49604
+ "ghostty-opentui": "1.4.11",
49605
49605
  isbinaryfile: "6.0.0",
49606
49606
  jsonrepair: "^3.14.0",
49607
49607
  linkedom: "0.18.12",
@@ -49641,26 +49641,36 @@ async function exchangeToken(githubToken) {
49641
49641
  if (cachedBearer && Date.now() / 1000 < cachedBearer.expiresAt - 60) {
49642
49642
  return cachedBearer.token;
49643
49643
  }
49644
- const res = await fetch(TOKEN_EXCHANGE, {
49645
- headers: {
49646
- Authorization: `Token ${githubToken}`,
49647
- "User-Agent": `SoulForge/${CURRENT_VERSION}`
49648
- },
49649
- signal: AbortSignal.timeout(1e4)
49650
- });
49651
- if (!res.ok) {
49652
- cachedBearer = null;
49653
- const body = await res.text().catch(() => "");
49654
- throw new Error(`Copilot token exchange failed (${String(res.status)})${body ? `: ${body.slice(0, 200)}` : ""}`);
49655
- }
49656
- const data = await res.json();
49657
- if (!data.token)
49658
- throw new Error("Copilot token exchange returned empty token");
49659
- cachedBearer = {
49660
- token: data.token,
49661
- expiresAt: data.expires_at
49662
- };
49663
- return data.token;
49644
+ if (bearerInflight)
49645
+ return bearerInflight;
49646
+ bearerInflight = (async () => {
49647
+ try {
49648
+ const res = await fetch(TOKEN_EXCHANGE, {
49649
+ headers: {
49650
+ Authorization: `Token ${githubToken}`,
49651
+ "User-Agent": `SoulForge/${CURRENT_VERSION}`
49652
+ },
49653
+ signal: AbortSignal.timeout(1e4)
49654
+ });
49655
+ if (!res.ok) {
49656
+ cachedBearer = null;
49657
+ const body = await res.text().catch(() => "");
49658
+ const hint = res.status === 401 || res.status === 403 ? " \u2014 your GitHub OAuth token is invalid or expired. Re-run the login flow in VS Code/JetBrains and copy the fresh oauth_token from ~/.config/github-copilot/apps.json." : res.status >= 500 ? " \u2014 GitHub is having issues, try again in a moment." : "";
49659
+ throw new Error(`Copilot token exchange failed (${String(res.status)})${body ? `: ${body.slice(0, 200)}` : ""}${hint}`);
49660
+ }
49661
+ const data = await res.json();
49662
+ if (!data.token)
49663
+ throw new Error("Copilot token exchange returned empty token");
49664
+ cachedBearer = {
49665
+ token: data.token,
49666
+ expiresAt: data.expires_at
49667
+ };
49668
+ return data.token;
49669
+ } finally {
49670
+ bearerInflight = null;
49671
+ }
49672
+ })();
49673
+ return bearerInflight;
49664
49674
  }
49665
49675
  function invalidateBearer() {
49666
49676
  cachedBearer = null;
@@ -49671,16 +49681,19 @@ function getGitHubToken() {
49671
49681
  return stored;
49672
49682
  throw new Error("GitHub Copilot requires an OAuth token. Sign in via VS Code or JetBrains, then copy oauth_token from ~/.config/github-copilot/apps.json and save it with /keys or --set-key copilot.");
49673
49683
  }
49674
- function needsResponsesApi(modelId) {
49675
- const id = modelId.toLowerCase();
49676
- if (id.includes("codex"))
49677
- return true;
49678
- if (id.startsWith("gpt-5"))
49679
- return true;
49680
- return false;
49681
- }
49682
- function isAnthropicModel(modelId) {
49683
- return modelId.toLowerCase().startsWith("claude");
49684
+ function detectInitiator(body) {
49685
+ if (typeof body !== "string")
49686
+ return "user";
49687
+ try {
49688
+ const parsed = JSON.parse(body);
49689
+ if (Array.isArray(parsed.messages)) {
49690
+ for (const m of parsed.messages) {
49691
+ if (m?.role === "assistant" || m?.role === "tool")
49692
+ return "agent";
49693
+ }
49694
+ }
49695
+ } catch {}
49696
+ return "user";
49684
49697
  }
49685
49698
  function createCopilotFetch(githubToken) {
49686
49699
  return async (url2, init) => {
@@ -49691,38 +49704,41 @@ function createCopilotFetch(githubToken) {
49691
49704
  invalidateBearer();
49692
49705
  bearer = await exchangeToken(githubToken);
49693
49706
  }
49694
- const headers = new Headers(init?.headers);
49695
- headers.set("Authorization", `Bearer ${bearer}`);
49707
+ const buildHeaders = (token) => {
49708
+ const h = new Headers(init?.headers);
49709
+ h.set("Authorization", `Bearer ${token}`);
49710
+ h.set("X-Request-Id", crypto.randomUUID());
49711
+ h.set("X-Initiator", detectInitiator(init?.body));
49712
+ return h;
49713
+ };
49696
49714
  const res = await fetch(url2, {
49697
49715
  ...init,
49698
- headers
49716
+ headers: buildHeaders(bearer)
49699
49717
  });
49700
49718
  if (res.status === 401) {
49701
49719
  invalidateBearer();
49702
49720
  const retryBearer = await exchangeToken(githubToken);
49703
- const retryHeaders = new Headers(init?.headers);
49704
- retryHeaders.set("Authorization", `Bearer ${retryBearer}`);
49705
49721
  return fetch(url2, {
49706
49722
  ...init,
49707
- headers: retryHeaders
49723
+ headers: buildHeaders(retryBearer)
49708
49724
  });
49709
49725
  }
49710
49726
  return res;
49711
49727
  };
49712
49728
  }
49729
+ function assertChatCompletionsSupported(modelId) {
49730
+ const endpoints = supportedEndpoints.get(modelId);
49731
+ if (!endpoints || endpoints.length === 0)
49732
+ return;
49733
+ const hasChat = endpoints.some((e) => e.includes("chat") || e.includes("completions"));
49734
+ if (hasChat)
49735
+ return;
49736
+ throw new Error(`Copilot model "${modelId}" only supports ${endpoints.join(", ")} \u2014 ` + "SoulForge routes Copilot through /chat/completions. " + "Try claude-sonnet-4.6, gpt-4.1, or another chat-compatible model.");
49737
+ }
49713
49738
  function createCopilotModel(modelId) {
49739
+ assertChatCompletionsSupported(modelId);
49714
49740
  const githubToken = getGitHubToken();
49715
49741
  const copilotFetch = createCopilotFetch(githubToken);
49716
- if (isAnthropicModel(modelId)) {
49717
- return createAnthropic({
49718
- baseURL: COPILOT_API,
49719
- apiKey: "copilot",
49720
- headers: {
49721
- ...COPILOT_HEADERS
49722
- },
49723
- fetch: copilotFetch
49724
- })(modelId);
49725
- }
49726
49742
  const client = createOpenAI({
49727
49743
  baseURL: COPILOT_API,
49728
49744
  apiKey: "copilot",
@@ -49731,22 +49747,23 @@ function createCopilotModel(modelId) {
49731
49747
  },
49732
49748
  fetch: copilotFetch
49733
49749
  });
49734
- if (needsResponsesApi(modelId)) {
49735
- return client.responses(modelId);
49736
- }
49737
49750
  return client.chat(modelId);
49738
49751
  }
49739
- var ENV_VAR = "COPILOT_API_KEY", COPILOT_API = "https://api.githubcopilot.com", TOKEN_EXCHANGE = "https://api.github.com/copilot_internal/v2/token", COPILOT_HEADERS, cachedBearer = null, copilot;
49752
+ var ENV_VAR = "COPILOT_API_KEY", COPILOT_API = "https://api.githubcopilot.com", TOKEN_EXCHANGE = "https://api.github.com/copilot_internal/v2/token", COPILOT_CHAT_VERSION = "0.26.7", COPILOT_API_VERSION = "2025-04-01", COPILOT_HEADERS, cachedBearer = null, bearerInflight = null, supportedEndpoints, copilot;
49740
49753
  var init_copilot = __esm(() => {
49741
- init_dist6();
49742
49754
  init_dist8();
49743
49755
  init_secrets();
49744
49756
  init_version();
49745
49757
  COPILOT_HEADERS = {
49746
- "Editor-Version": `SoulForge/${CURRENT_VERSION}`,
49747
- "Editor-Plugin-Version": `SoulForge/${CURRENT_VERSION}`,
49748
- "Copilot-Integration-Id": "vscode-chat"
49749
- };
49758
+ "Editor-Version": "vscode/1.95.0",
49759
+ "Editor-Plugin-Version": `copilot-chat/${COPILOT_CHAT_VERSION}`,
49760
+ "Copilot-Integration-Id": "vscode-chat",
49761
+ "User-Agent": `GitHubCopilotChat/${COPILOT_CHAT_VERSION}`,
49762
+ "OpenAI-Intent": "conversation-panel",
49763
+ "X-GitHub-Api-Version": COPILOT_API_VERSION,
49764
+ "X-VSCode-User-Agent-Library-Version": "electron-fetch"
49765
+ };
49766
+ supportedEndpoints = new Map;
49750
49767
  copilot = {
49751
49768
  id: "copilot",
49752
49769
  name: "GitHub Copilot",
@@ -49781,6 +49798,9 @@ var init_copilot = __esm(() => {
49781
49798
  continue;
49782
49799
  if (result.some((r) => r.id === m.id))
49783
49800
  continue;
49801
+ if (Array.isArray(m.supported_endpoints)) {
49802
+ supportedEndpoints.set(m.id, m.supported_endpoints);
49803
+ }
49784
49804
  result.push({
49785
49805
  id: m.id,
49786
49806
  name: m.id
@@ -57858,7 +57878,8 @@ function createLLMGateway(options = {}) {
57858
57878
  provider: "llmgateway.image",
57859
57879
  url: ({ path }) => `${baseURL}${path}`,
57860
57880
  headers: getHeaders,
57861
- fetch: options.fetch
57881
+ fetch: options.fetch,
57882
+ extraBody: options.extraBody
57862
57883
  });
57863
57884
  const createLanguageModel = (modelId, settings) => {
57864
57885
  if (new.target) {
@@ -59112,13 +59133,19 @@ var __defProp3, __defProps, __getOwnPropDescs, __getOwnPropSymbols, __hasOwnProp
59112
59133
  if (options.aspectRatio != null) {
59113
59134
  body.aspect_ratio = options.aspectRatio;
59114
59135
  }
59136
+ if (options.quality != null) {
59137
+ body.quality = options.quality;
59138
+ }
59139
+ const providerOptions = options.providerOptions || {};
59140
+ const llmgatewayOptions = providerOptions.llmgateway || {};
59141
+ const requestBody = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, body), this.config.extraBody), this.settings.extraBody), llmgatewayOptions);
59115
59142
  const { value: response, responseHeaders } = await postJsonToApi2({
59116
59143
  url: this.config.url({
59117
59144
  path: hasFiles ? "/images/edits" : "/images/generations",
59118
59145
  modelId: this.modelId
59119
59146
  }),
59120
59147
  headers: combineHeaders2(this.config.headers(), options.headers),
59121
- body,
59148
+ body: requestBody,
59122
59149
  failedResponseHandler: llmgatewayFailedResponseHandler,
59123
59150
  successfulResponseHandler: createJsonResponseHandler2(LLMGatewayImageResponseSchema),
59124
59151
  abortSignal: options.abortSignal,
@@ -71073,9 +71100,9 @@ function convertToOpenRouterChatMessages(prompt) {
71073
71100
  const parsedProviderOptions = OpenRouterProviderOptionsSchema.safeParse(providerOptions);
71074
71101
  const messageReasoningDetails = parsedProviderOptions.success ? (_e = (_d = parsedProviderOptions.data) == null ? undefined : _d.openrouter) == null ? undefined : _e.reasoning_details : undefined;
71075
71102
  const messageAnnotations = parsedProviderOptions.success ? (_g = (_f = parsedProviderOptions.data) == null ? undefined : _f.openrouter) == null ? undefined : _g.annotations : undefined;
71076
- const candidateReasoningDetails = messageReasoningDetails && Array.isArray(messageReasoningDetails) && messageReasoningDetails.length > 0 ? messageReasoningDetails : findFirstReasoningDetails(content);
71103
+ const candidateReasoningDetails = messageReasoningDetails && Array.isArray(messageReasoningDetails) ? messageReasoningDetails : findFirstReasoningDetails(content);
71077
71104
  let finalReasoningDetails;
71078
- if (candidateReasoningDetails && candidateReasoningDetails.length > 0) {
71105
+ if (candidateReasoningDetails) {
71079
71106
  const validDetails = candidateReasoningDetails.filter((detail) => {
71080
71107
  var _a173;
71081
71108
  if (detail.type !== "reasoning.text") {
@@ -71099,9 +71126,9 @@ function convertToOpenRouterChatMessages(prompt) {
71099
71126
  uniqueDetails.push(detail);
71100
71127
  }
71101
71128
  }
71102
- finalReasoningDetails = uniqueDetails.length > 0 ? uniqueDetails : undefined;
71129
+ finalReasoningDetails = uniqueDetails;
71103
71130
  }
71104
- const effectiveReasoning = reasoning && finalReasoningDetails ? reasoning : undefined;
71131
+ const effectiveReasoning = reasoning && finalReasoningDetails && finalReasoningDetails.length > 0 ? reasoning : undefined;
71105
71132
  messages.push({
71106
71133
  role: "assistant",
71107
71134
  content: text2,
@@ -72544,11 +72571,11 @@ var __defProp4, __defProps2, __getOwnPropDescs2, __getOwnPropSymbols2, __hasOwnP
72544
72571
  controller.enqueue({
72545
72572
  type: "reasoning-end",
72546
72573
  id: reasoningId || generateId5(),
72547
- providerMetadata: accumulatedReasoningDetails.length > 0 ? {
72574
+ providerMetadata: {
72548
72575
  openrouter: {
72549
72576
  reasoning_details: accumulatedReasoningDetails
72550
72577
  }
72551
- } : undefined
72578
+ }
72552
72579
  });
72553
72580
  reasoningStarted = false;
72554
72581
  }
@@ -72779,11 +72806,11 @@ var __defProp4, __defProps2, __getOwnPropDescs2, __getOwnPropSymbols2, __hasOwnP
72779
72806
  controller.enqueue({
72780
72807
  type: "reasoning-end",
72781
72808
  id: reasoningId || generateId5(),
72782
- providerMetadata: accumulatedReasoningDetails.length > 0 ? {
72809
+ providerMetadata: {
72783
72810
  openrouter: {
72784
72811
  reasoning_details: accumulatedReasoningDetails
72785
72812
  }
72786
- } : undefined
72813
+ }
72787
72814
  });
72788
72815
  }
72789
72816
  if (textStarted) {
@@ -72798,9 +72825,7 @@ var __defProp4, __defProps2, __getOwnPropDescs2, __getOwnPropSymbols2, __hasOwnP
72798
72825
  if (provider !== undefined) {
72799
72826
  openrouterMetadata.provider = provider;
72800
72827
  }
72801
- if (accumulatedReasoningDetails.length > 0) {
72802
- openrouterMetadata.reasoning_details = accumulatedReasoningDetails;
72803
- }
72828
+ openrouterMetadata.reasoning_details = accumulatedReasoningDetails;
72804
72829
  if (accumulatedFileAnnotations.length > 0) {
72805
72830
  openrouterMetadata.annotations = accumulatedFileAnnotations;
72806
72831
  }
@@ -73252,7 +73277,7 @@ var __defProp4, __defProps2, __getOwnPropDescs2, __getOwnPropSymbols2, __hasOwnP
73252
73277
  usage
73253
73278
  };
73254
73279
  }
73255
- }, DEFAULT_IMAGE_MEDIA_TYPE = "image/png", webSearchInputSchema2, webSearch2, VERSION22 = "2.8.0", VideoGenerationSubmitResponseSchema, VideoGenerationPollResponseSchema, DEFAULT_POLL_INTERVAL_MS = 2000, DEFAULT_MAX_POLL_TIME_MS = 600000, OpenRouterVideoModel = class {
73280
+ }, DEFAULT_IMAGE_MEDIA_TYPE = "image/png", webSearchInputSchema2, webSearch2, VERSION22 = "2.8.1", VideoGenerationSubmitResponseSchema, VideoGenerationPollResponseSchema, DEFAULT_POLL_INTERVAL_MS = 2000, DEFAULT_MAX_POLL_TIME_MS = 600000, OpenRouterVideoModel = class {
73256
73281
  constructor(modelId, settings, config2) {
73257
73282
  this.specificationVersion = "v3";
73258
73283
  this.provider = "openrouter";
@@ -74931,7 +74956,7 @@ var init_lifecycle = __esm(() => {
74931
74956
  });
74932
74957
 
74933
74958
  // src/core/llm/providers/proxy.ts
74934
- function isAnthropicModel2(modelId) {
74959
+ function isAnthropicModel(modelId) {
74935
74960
  return modelId.toLowerCase().startsWith("claude");
74936
74961
  }
74937
74962
  var baseURL, proxy;
@@ -74951,7 +74976,7 @@ var init_proxy = __esm(() => {
74951
74976
  grouped: true,
74952
74977
  createModel(modelId) {
74953
74978
  const apiKey = getActiveProxyApiKey();
74954
- if (isAnthropicModel2(modelId)) {
74979
+ if (isAnthropicModel(modelId)) {
74955
74980
  return createAnthropic({
74956
74981
  baseURL,
74957
74982
  apiKey
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "2.14.0",
3
+ "version": "2.14.1",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,9 +52,9 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@babel/core": "7.29.0",
55
- "@biomejs/biome": "2.4.12",
55
+ "@biomejs/biome": "2.4.13",
56
56
  "@types/babel__core": "7.20.5",
57
- "@types/bun": "1.3.12",
57
+ "@types/bun": "1.3.13",
58
58
  "@types/linkify-it": "5.0.0",
59
59
  "@types/node": "25.6.0",
60
60
  "@types/react": "19.2.14",
@@ -74,14 +74,14 @@
74
74
  "@ai-sdk/openai": "3.0.53",
75
75
  "@ai-sdk/openai-compatible": "^2.0.41",
76
76
  "@ai-sdk/xai": "3.0.83",
77
- "@anthropic-ai/sdk": "0.90.0",
78
- "@llmgateway/ai-sdk-provider": "3.6.0",
77
+ "@anthropic-ai/sdk": "0.91.1",
78
+ "@llmgateway/ai-sdk-provider": "3.7.0",
79
79
  "@modelcontextprotocol/sdk": "^1.29.0",
80
80
  "@mozilla/readability": "0.6.0",
81
- "@openrouter/ai-sdk-provider": "2.8.0",
82
- "@opentui/react": "0.1.102",
81
+ "@openrouter/ai-sdk-provider": "2.8.1",
82
+ "@opentui/react": "0.2.0",
83
83
  "ai": "6.0.168",
84
- "ghostty-opentui": "1.4.10",
84
+ "ghostty-opentui": "1.4.11",
85
85
  "isbinaryfile": "6.0.0",
86
86
  "jsonrepair": "^3.14.0",
87
87
  "linkedom": "0.18.12",