@proxysoul/soulforge 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24160,6 +24160,7 @@ class RepoMap {
24160
24160
  onStaleSymbols = null;
24161
24161
  onError = null;
24162
24162
  indexErrors = 0;
24163
+ lastRenderedPaths = [];
24163
24164
  constructor(cwd) {
24164
24165
  this.cwd = cwd;
24165
24166
  const dbDir = join5(cwd, ".soulforge");
@@ -26418,6 +26419,7 @@ class RepoMap {
26418
26419
  this.onStaleSymbols?.(stale);
26419
26420
  }, 2000);
26420
26421
  }
26422
+ this.lastRenderedPaths = currentPaths;
26421
26423
  return lines.join(`
26422
26424
  `);
26423
26425
  }
@@ -26559,6 +26561,26 @@ class RepoMap {
26559
26561
  endLine: r4.end_line
26560
26562
  }));
26561
26563
  }
26564
+ getFileDiffBlock(relPath) {
26565
+ const fileRow = this.db.query("SELECT id FROM files WHERE path = ?").get(relPath);
26566
+ if (!fileRow)
26567
+ return {
26568
+ blastRadius: 0,
26569
+ symbols: []
26570
+ };
26571
+ const blastRadius = this.db.query("SELECT COUNT(DISTINCT source_file_id) AS c FROM edges WHERE target_file_id = ?").get(fileRow.id)?.c ?? 0;
26572
+ const symbols = this.db.query(`SELECT s.name, s.kind, s.signature, s.line
26573
+ FROM symbols s
26574
+ WHERE s.file_id = ?
26575
+ AND s.is_exported = 1
26576
+ AND s.kind IN ('interface','type','class','function','enum','method')
26577
+ ORDER BY s.line
26578
+ LIMIT 10`).all(fileRow.id);
26579
+ return {
26580
+ blastRadius,
26581
+ symbols
26582
+ };
26583
+ }
26562
26584
  getFileSymbolRanges(relPath) {
26563
26585
  return this.db.query(`SELECT s.name, s.qualified_name, s.kind, s.line, s.end_line
26564
26586
  FROM symbols s JOIN files f ON f.id = s.file_id
@@ -30930,8 +30952,18 @@ class LspBackend {
30930
30952
  const projectRoot = findProjectRootForLanguage(file, language) ?? this.cwd;
30931
30953
  const langKey = `${language}:${projectRoot}`;
30932
30954
  const existing = this.languageClients.get(langKey);
30933
- if (existing && existing.length > 0 && existing.every((c) => c.isReady)) {
30934
- return existing;
30955
+ if (existing && existing.length > 0) {
30956
+ const ready = existing.filter((c) => c.isReady);
30957
+ if (ready.length > 0) {
30958
+ if (ready.length !== existing.length) {
30959
+ for (const c of existing) {
30960
+ if (!c.isReady)
30961
+ c.stop().catch(() => {});
30962
+ }
30963
+ this.languageClients.set(langKey, ready);
30964
+ }
30965
+ return ready;
30966
+ }
30935
30967
  }
30936
30968
  const pending = this.pendingInits.get(langKey);
30937
30969
  if (pending)
@@ -30961,6 +30993,10 @@ class LspBackend {
30961
30993
  this.failedServers.delete(serverKey);
30962
30994
  continue;
30963
30995
  }
30996
+ if (existingClient) {
30997
+ existingClient.stop().catch(() => {});
30998
+ this.standaloneClients.delete(serverKey);
30999
+ }
30964
31000
  const client = new StandaloneLspClient(config, projectRoot);
30965
31001
  try {
30966
31002
  await client.start();
@@ -273054,7 +273090,14 @@ var handlers = {
273054
273090
  },
273055
273091
  onFileChanged: (absPath) => requireRepoMap().onFileChanged(absPath),
273056
273092
  recheckModifiedFiles: () => requireRepoMap().recheckModifiedFiles(),
273057
- render: (opts) => requireRepoMap().render(opts),
273093
+ render: (opts) => {
273094
+ const repoMap2 = requireRepoMap();
273095
+ const content = repoMap2.render(opts);
273096
+ return {
273097
+ content,
273098
+ paths: repoMap2.lastRenderedPaths
273099
+ };
273100
+ },
273058
273101
  findSymbols: (name2) => requireRepoMap().findSymbols(name2),
273059
273102
  findSymbol: (name2) => requireRepoMap().findSymbol(name2),
273060
273103
  searchSymbolsSubstring: (query, limit) => requireRepoMap().searchSymbolsSubstring(query, limit),
@@ -273069,6 +273112,7 @@ var handlers = {
273069
273112
  getFileCoChanges: (relPath) => requireRepoMap().getFileCoChanges(relPath),
273070
273113
  getFileExportCount: (relPath) => requireRepoMap().getFileExportCount(relPath),
273071
273114
  getFileBlastRadius: (relPath) => requireRepoMap().getFileBlastRadius(relPath),
273115
+ getFileDiffBlock: (relPath) => requireRepoMap().getFileDiffBlock(relPath),
273072
273116
  getFilesByPackage: (pkg) => requireRepoMap().getFilesByPackage(pkg),
273073
273117
  listDirectory: (dirPath) => requireRepoMap().listDirectory(dirPath),
273074
273118
  getIdentifierFrequency: (limit) => requireRepoMap().getIdentifierFrequency(limit),
@@ -1635,6 +1635,12 @@ var init_io_client = __esm(() => {
1635
1635
  async loadSession(sessionDir) {
1636
1636
  return this.call("loadSession", sessionDir);
1637
1637
  }
1638
+ async listSessions(sessionsDir) {
1639
+ return this.call("listSessions", sessionsDir);
1640
+ }
1641
+ async fetchModelsFromUrl(url, headers, providerId, grouped) {
1642
+ return this.call("fetchModelsFromUrl", url, headers, providerId, grouped);
1643
+ }
1638
1644
  };
1639
1645
  });
1640
1646
 
@@ -21969,7 +21975,7 @@ var btoa2, atob2, name14 = "AI_DownloadError", marker15, symbol17, _a17, _b15, D
21969
21975
  });
21970
21976
  }
21971
21977
  return () => `${prefix}${separator}${generator()}`;
21972
- }, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION = "4.0.22", getOriginalFetch = () => globalThis.fetch, getFromApi = async ({
21978
+ }, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION = "4.0.23", getOriginalFetch = () => globalThis.fetch, getFromApi = async ({
21973
21979
  url: url2,
21974
21980
  headers = {},
21975
21981
  successfulResponseHandler,
@@ -23456,6 +23462,17 @@ function createGatewayProvider(options = {}) {
23456
23462
  o11yHeaders: createO11yHeaders()
23457
23463
  });
23458
23464
  };
23465
+ const createRerankingModel = (modelId) => {
23466
+ return new GatewayRerankingModel(modelId, {
23467
+ provider: "gateway",
23468
+ baseURL,
23469
+ headers: getHeaders,
23470
+ fetch: options.fetch,
23471
+ o11yHeaders: createO11yHeaders()
23472
+ });
23473
+ };
23474
+ provider.rerankingModel = createRerankingModel;
23475
+ provider.reranking = createRerankingModel;
23459
23476
  provider.chat = provider.languageModel;
23460
23477
  provider.embedding = provider.embeddingModel;
23461
23478
  provider.image = provider.imageModel;
@@ -23984,7 +24001,66 @@ var import_oidc, import_oidc2, marker17 = "vercel.ai.gateway.error", symbol18, _
23984
24001
  "ai-model-id": this.modelId
23985
24002
  };
23986
24003
  }
23987
- }, providerMetadataEntrySchema2, gatewayVideoDataSchema, gatewayVideoWarningSchema, gatewayVideoEventSchema, parallelSearchInputSchema, parallelSearchOutputSchema, parallelSearchToolFactory, parallelSearch = (config2 = {}) => parallelSearchToolFactory(config2), perplexitySearchInputSchema, perplexitySearchOutputSchema, perplexitySearchToolFactory, perplexitySearch = (config2 = {}) => perplexitySearchToolFactory(config2), gatewayTools, VERSION2 = "3.0.88", AI_GATEWAY_PROTOCOL_VERSION = "0.0.1", gateway;
24004
+ }, providerMetadataEntrySchema2, gatewayVideoDataSchema, gatewayVideoWarningSchema, gatewayVideoEventSchema, GatewayRerankingModel = class {
24005
+ constructor(modelId, config2) {
24006
+ this.modelId = modelId;
24007
+ this.config = config2;
24008
+ this.specificationVersion = "v3";
24009
+ }
24010
+ get provider() {
24011
+ return this.config.provider;
24012
+ }
24013
+ async doRerank({
24014
+ documents,
24015
+ query,
24016
+ topN,
24017
+ headers,
24018
+ abortSignal,
24019
+ providerOptions
24020
+ }) {
24021
+ const resolvedHeaders = await resolve(this.config.headers());
24022
+ try {
24023
+ const {
24024
+ responseHeaders,
24025
+ value: responseBody,
24026
+ rawValue
24027
+ } = await postJsonToApi({
24028
+ url: this.getUrl(),
24029
+ headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)),
24030
+ body: {
24031
+ documents,
24032
+ query,
24033
+ ...topN != null ? { topN } : {},
24034
+ ...providerOptions ? { providerOptions } : {}
24035
+ },
24036
+ successfulResponseHandler: createJsonResponseHandler(gatewayRerankingResponseSchema),
24037
+ failedResponseHandler: createJsonErrorResponseHandler({
24038
+ errorSchema: exports_external.any(),
24039
+ errorToMessage: (data) => data
24040
+ }),
24041
+ ...abortSignal && { abortSignal },
24042
+ fetch: this.config.fetch
24043
+ });
24044
+ return {
24045
+ ranking: responseBody.ranking,
24046
+ providerMetadata: responseBody.providerMetadata,
24047
+ response: { headers: responseHeaders, body: rawValue },
24048
+ warnings: []
24049
+ };
24050
+ } catch (error48) {
24051
+ throw await asGatewayError(error48, await parseAuthMethod(resolvedHeaders));
24052
+ }
24053
+ }
24054
+ getUrl() {
24055
+ return `${this.config.baseURL}/reranking-model`;
24056
+ }
24057
+ getModelConfigHeaders() {
24058
+ return {
24059
+ "ai-reranking-model-specification-version": "3",
24060
+ "ai-model-id": this.modelId
24061
+ };
24062
+ }
24063
+ }, gatewayRerankingResponseSchema, parallelSearchInputSchema, parallelSearchOutputSchema, parallelSearchToolFactory, parallelSearch = (config2 = {}) => parallelSearchToolFactory(config2), perplexitySearchInputSchema, perplexitySearchOutputSchema, perplexitySearchToolFactory, perplexitySearch = (config2 = {}) => perplexitySearchToolFactory(config2), gatewayTools, VERSION2 = "3.0.93", AI_GATEWAY_PROTOCOL_VERSION = "0.0.1", gateway;
23988
24064
  var init_dist4 = __esm(() => {
23989
24065
  init_dist3();
23990
24066
  init_dist();
@@ -24010,6 +24086,8 @@ var init_dist4 = __esm(() => {
24010
24086
  init_dist3();
24011
24087
  init_v4();
24012
24088
  init_dist3();
24089
+ init_v4();
24090
+ init_dist3();
24013
24091
  init_zod();
24014
24092
  init_dist3();
24015
24093
  init_zod();
@@ -24441,6 +24519,13 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24441
24519
  param: exports_external.unknown().nullable()
24442
24520
  })
24443
24521
  ]);
24522
+ gatewayRerankingResponseSchema = lazySchema(() => zodSchema(exports_external.object({
24523
+ ranking: exports_external.array(exports_external.object({
24524
+ index: exports_external.number(),
24525
+ relevanceScore: exports_external.number()
24526
+ })),
24527
+ providerMetadata: exports_external.record(exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())).optional()
24528
+ })));
24444
24529
  parallelSearchInputSchema = lazySchema(() => zodSchema(exports_external.object({
24445
24530
  objective: exports_external.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),
24446
24531
  search_queries: exports_external.array(exports_external.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),
@@ -28680,7 +28765,7 @@ var import_api, import_api2, __defProp2, __export2 = (target, all) => {
28680
28765
  const bytes = typeof data === "string" ? convertBase64ToUint8Array(data) : data;
28681
28766
  const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
28682
28767
  return bytes.slice(id3Size + 10);
28683
- }, VERSION3 = "6.0.146", download = async ({
28768
+ }, VERSION3 = "6.0.152", download = async ({
28684
28769
  url: url2,
28685
28770
  maxBytes,
28686
28771
  abortSignal
@@ -30444,7 +30529,7 @@ var init_summarize = __esm(() => {
30444
30529
  });
30445
30530
 
30446
30531
  // src/core/workers/io.worker.ts
30447
- import { existsSync, mkdirSync, readFileSync, statSync } from "fs";
30532
+ import { existsSync, mkdirSync, readdirSync as readdirSync2, readFileSync, statSync } from "fs";
30448
30533
  import { readFile, rename, writeFile } from "fs/promises";
30449
30534
  import { extname, join as join3 } from "path";
30450
30535
 
@@ -30900,6 +30985,148 @@ var handlers = {
30900
30985
  meta: meta3,
30901
30986
  tabEntries
30902
30987
  };
30988
+ },
30989
+ listSessions: (sessionsDir) => {
30990
+ const dir = sessionsDir;
30991
+ if (!existsSync(dir))
30992
+ return [];
30993
+ try {
30994
+ const entries = readdirSync2(dir);
30995
+ const metas = [];
30996
+ for (const entry of entries) {
30997
+ try {
30998
+ const fullPath = join3(dir, entry);
30999
+ const s = statSync(fullPath);
31000
+ if (!s.isDirectory())
31001
+ continue;
31002
+ const metaPath = join3(fullPath, "meta.json");
31003
+ if (!existsSync(metaPath))
31004
+ continue;
31005
+ const raw = readFileSync(metaPath, "utf-8");
31006
+ const meta3 = JSON.parse(raw);
31007
+ const totalMessages = (meta3.tabs ?? []).reduce((sum, t) => sum + (t.messageRange.endLine - t.messageRange.startLine), 0);
31008
+ let sizeBytes = 0;
31009
+ for (const file2 of ["meta.json", "messages.jsonl"]) {
31010
+ try {
31011
+ sizeBytes += statSync(join3(fullPath, file2)).size;
31012
+ } catch {}
31013
+ }
31014
+ metas.push({
31015
+ id: meta3.id,
31016
+ title: meta3.title,
31017
+ messageCount: totalMessages,
31018
+ startedAt: meta3.startedAt,
31019
+ updatedAt: meta3.updatedAt,
31020
+ sizeBytes
31021
+ });
31022
+ } catch {}
31023
+ }
31024
+ return metas.sort((a, b) => b.updatedAt - a.updatedAt);
31025
+ } catch {
31026
+ return [];
31027
+ }
31028
+ },
31029
+ fetchModelsFromUrl: async (url2, headers, providerId, grouped) => {
31030
+ const GROUP_NAMES = {
31031
+ anthropic: "Claude",
31032
+ openai: "OpenAI",
31033
+ google: "Google",
31034
+ xai: "xAI",
31035
+ meta: "Meta",
31036
+ mistral: "Mistral",
31037
+ deepseek: "DeepSeek",
31038
+ other: "Other"
31039
+ };
31040
+ function tc(s) {
31041
+ return s.charAt(0).toUpperCase() + s.slice(1);
31042
+ }
31043
+ function inferGroup(modelId) {
31044
+ const id = modelId.toLowerCase();
31045
+ if (id.startsWith("claude"))
31046
+ return "anthropic";
31047
+ if (id.startsWith("gpt") || id.startsWith("o1-") || id.startsWith("o3-") || id.startsWith("o4-") || id.startsWith("chatgpt"))
31048
+ return "openai";
31049
+ if (id.startsWith("gemini"))
31050
+ return "google";
31051
+ if (id.startsWith("grok"))
31052
+ return "xai";
31053
+ if (id.startsWith("llama") || id.startsWith("meta-"))
31054
+ return "meta";
31055
+ if (id.startsWith("mistral") || id.startsWith("codestral") || id.startsWith("pixtral"))
31056
+ return "mistral";
31057
+ if (id.startsWith("deepseek"))
31058
+ return "deepseek";
31059
+ return "other";
31060
+ }
31061
+ try {
31062
+ const res = await fetch(url2, {
31063
+ headers
31064
+ });
31065
+ if (!res.ok) {
31066
+ return {
31067
+ models: [],
31068
+ error: `HTTP ${String(res.status)}`
31069
+ };
31070
+ }
31071
+ const data = await res.json();
31072
+ const pid = providerId;
31073
+ const isGrp = grouped;
31074
+ if (!isGrp) {
31075
+ const models = data.data.map((m) => ({
31076
+ id: m.id,
31077
+ name: m.name ?? m.id,
31078
+ contextWindow: m.context_length
31079
+ }));
31080
+ return {
31081
+ models
31082
+ };
31083
+ }
31084
+ const gMap = {};
31085
+ const isOR = pid === "openrouter";
31086
+ const isLG = pid === "llmgateway";
31087
+ for (const m of data.data) {
31088
+ let group;
31089
+ if (isOR) {
31090
+ const si = m.id.indexOf("/");
31091
+ group = si >= 0 ? m.id.slice(0, si).toLowerCase() : "other";
31092
+ } else if (isLG) {
31093
+ group = m.family?.toLowerCase() || inferGroup(m.id);
31094
+ } else {
31095
+ if (m.type && m.type !== "language")
31096
+ continue;
31097
+ group = m.owned_by ?? inferGroup(m.id);
31098
+ }
31099
+ const arr = gMap[group] || [];
31100
+ gMap[group] = arr;
31101
+ arr.push({
31102
+ id: m.id,
31103
+ name: isOR ? (m.name ?? m.id).replace(/^[^:]+:\s*/, "") : m.name || m.id,
31104
+ contextWindow: m.context_length
31105
+ });
31106
+ }
31107
+ const subProviders = Object.keys(gMap).sort().map((id) => ({
31108
+ id,
31109
+ name: GROUP_NAMES[id] ?? tc(id)
31110
+ }));
31111
+ const allModels = [];
31112
+ for (const sp of subProviders) {
31113
+ for (const m of gMap[sp.id] ?? [])
31114
+ allModels.push(m);
31115
+ }
31116
+ return {
31117
+ models: allModels,
31118
+ grouped: {
31119
+ subProviders,
31120
+ modelsByProvider: gMap
31121
+ }
31122
+ };
31123
+ } catch (err) {
31124
+ const msg = err instanceof Error ? err.message : String(err);
31125
+ return {
31126
+ models: [],
31127
+ error: msg
31128
+ };
31129
+ }
30903
31130
  }
30904
31131
  };
30905
31132
  createWorkerHandler(handlers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -62,23 +62,23 @@
62
62
  "typescript": "6.0.2"
63
63
  },
64
64
  "dependencies": {
65
- "@ai-sdk/amazon-bedrock": "^4.0.89",
66
- "@ai-sdk/anthropic": "3.0.66",
67
- "@ai-sdk/deepseek": "^2.0.27",
68
- "@ai-sdk/fireworks": "^2.0.43",
69
- "@ai-sdk/google": "3.0.58",
70
- "@ai-sdk/groq": "^3.0.33",
65
+ "@ai-sdk/amazon-bedrock": "^4.0.92",
66
+ "@ai-sdk/anthropic": "3.0.68",
67
+ "@ai-sdk/deepseek": "^2.0.29",
68
+ "@ai-sdk/fireworks": "^2.0.46",
69
+ "@ai-sdk/google": "3.0.60",
70
+ "@ai-sdk/groq": "^3.0.35",
71
71
  "@ai-sdk/mcp": "^1.0.35",
72
- "@ai-sdk/mistral": "^3.0.28",
73
- "@ai-sdk/openai": "3.0.50",
74
- "@ai-sdk/xai": "3.0.77",
75
- "@anthropic-ai/sdk": "0.82.0",
72
+ "@ai-sdk/mistral": "^3.0.30",
73
+ "@ai-sdk/openai": "3.0.52",
74
+ "@ai-sdk/xai": "3.0.80",
75
+ "@anthropic-ai/sdk": "0.85.0",
76
76
  "@llmgateway/ai-sdk-provider": "3.5.0",
77
77
  "@modelcontextprotocol/sdk": "^1.29.0",
78
78
  "@mozilla/readability": "0.6.0",
79
- "@openrouter/ai-sdk-provider": "2.3.3",
80
- "@opentui/react": "0.1.96",
81
- "ai": "6.0.146",
79
+ "@openrouter/ai-sdk-provider": "2.5.0",
80
+ "@opentui/react": "0.1.97",
81
+ "ai": "6.0.152",
82
82
  "ghostty-opentui": "1.4.10",
83
83
  "isbinaryfile": "6.0.0",
84
84
  "linkedom": "0.18.12",
@@ -94,5 +94,8 @@
94
94
  "web-tree-sitter": "0.25.10",
95
95
  "zod": "4.3.6",
96
96
  "zustand": "5.0.12"
97
+ },
98
+ "overrides": {
99
+ "@opentui/core": "0.1.96"
97
100
  }
98
101
  }