@proxysoul/soulforge 2.8.0 → 2.9.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.
@@ -408,7 +408,16 @@ class WorkerClient {
408
408
  p.reject(new Error("Worker disposed"));
409
409
  }
410
410
  this.pending.clear();
411
- this.worker.terminate();
411
+ try {
412
+ this.worker.postMessage({
413
+ type: "dispose"
414
+ });
415
+ } catch {}
416
+ setTimeout(() => {
417
+ try {
418
+ this.worker.terminate();
419
+ } catch {}
420
+ }, 2000);
412
421
  }
413
422
  }
414
423
 
@@ -30952,8 +30961,18 @@ class LspBackend {
30952
30961
  const projectRoot = findProjectRootForLanguage(file, language) ?? this.cwd;
30953
30962
  const langKey = `${language}:${projectRoot}`;
30954
30963
  const existing = this.languageClients.get(langKey);
30955
- if (existing && existing.length > 0 && existing.every((c) => c.isReady)) {
30956
- return existing;
30964
+ if (existing && existing.length > 0) {
30965
+ const ready = existing.filter((c) => c.isReady);
30966
+ if (ready.length > 0) {
30967
+ if (ready.length !== existing.length) {
30968
+ for (const c of existing) {
30969
+ if (!c.isReady)
30970
+ c.stop().catch(() => {});
30971
+ }
30972
+ this.languageClients.set(langKey, ready);
30973
+ }
30974
+ return ready;
30975
+ }
30957
30976
  }
30958
30977
  const pending = this.pendingInits.get(langKey);
30959
30978
  if (pending)
@@ -30983,6 +31002,10 @@ class LspBackend {
30983
31002
  this.failedServers.delete(serverKey);
30984
31003
  continue;
30985
31004
  }
31005
+ if (existingClient) {
31006
+ existingClient.stop().catch(() => {});
31007
+ this.standaloneClients.delete(serverKey);
31008
+ }
30986
31009
  const client = new StandaloneLspClient(config, projectRoot);
30987
31010
  try {
30988
31011
  await client.start();
@@ -408,7 +408,16 @@ class WorkerClient {
408
408
  p.reject(new Error("Worker disposed"));
409
409
  }
410
410
  this.pending.clear();
411
- this.worker.terminate();
411
+ try {
412
+ this.worker.postMessage({
413
+ type: "dispose"
414
+ });
415
+ } catch {}
416
+ setTimeout(() => {
417
+ try {
418
+ this.worker.terminate();
419
+ } catch {}
420
+ }, 2000);
412
421
  }
413
422
  }
414
423
 
@@ -1635,6 +1644,12 @@ var init_io_client = __esm(() => {
1635
1644
  async loadSession(sessionDir) {
1636
1645
  return this.call("loadSession", sessionDir);
1637
1646
  }
1647
+ async listSessions(sessionsDir) {
1648
+ return this.call("listSessions", sessionsDir);
1649
+ }
1650
+ async fetchModelsFromUrl(url, headers, providerId, grouped) {
1651
+ return this.call("fetchModelsFromUrl", url, headers, providerId, grouped);
1652
+ }
1638
1653
  };
1639
1654
  });
1640
1655
 
@@ -21969,7 +21984,7 @@ var btoa2, atob2, name14 = "AI_DownloadError", marker15, symbol17, _a17, _b15, D
21969
21984
  });
21970
21985
  }
21971
21986
  return () => `${prefix}${separator}${generator()}`;
21972
- }, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION = "4.0.22", getOriginalFetch = () => globalThis.fetch, getFromApi = async ({
21987
+ }, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION = "4.0.23", getOriginalFetch = () => globalThis.fetch, getFromApi = async ({
21973
21988
  url: url2,
21974
21989
  headers = {},
21975
21990
  successfulResponseHandler,
@@ -23456,6 +23471,17 @@ function createGatewayProvider(options = {}) {
23456
23471
  o11yHeaders: createO11yHeaders()
23457
23472
  });
23458
23473
  };
23474
+ const createRerankingModel = (modelId) => {
23475
+ return new GatewayRerankingModel(modelId, {
23476
+ provider: "gateway",
23477
+ baseURL,
23478
+ headers: getHeaders,
23479
+ fetch: options.fetch,
23480
+ o11yHeaders: createO11yHeaders()
23481
+ });
23482
+ };
23483
+ provider.rerankingModel = createRerankingModel;
23484
+ provider.reranking = createRerankingModel;
23459
23485
  provider.chat = provider.languageModel;
23460
23486
  provider.embedding = provider.embeddingModel;
23461
23487
  provider.image = provider.imageModel;
@@ -23984,7 +24010,66 @@ var import_oidc, import_oidc2, marker17 = "vercel.ai.gateway.error", symbol18, _
23984
24010
  "ai-model-id": this.modelId
23985
24011
  };
23986
24012
  }
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;
24013
+ }, providerMetadataEntrySchema2, gatewayVideoDataSchema, gatewayVideoWarningSchema, gatewayVideoEventSchema, GatewayRerankingModel = class {
24014
+ constructor(modelId, config2) {
24015
+ this.modelId = modelId;
24016
+ this.config = config2;
24017
+ this.specificationVersion = "v3";
24018
+ }
24019
+ get provider() {
24020
+ return this.config.provider;
24021
+ }
24022
+ async doRerank({
24023
+ documents,
24024
+ query,
24025
+ topN,
24026
+ headers,
24027
+ abortSignal,
24028
+ providerOptions
24029
+ }) {
24030
+ const resolvedHeaders = await resolve(this.config.headers());
24031
+ try {
24032
+ const {
24033
+ responseHeaders,
24034
+ value: responseBody,
24035
+ rawValue
24036
+ } = await postJsonToApi({
24037
+ url: this.getUrl(),
24038
+ headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)),
24039
+ body: {
24040
+ documents,
24041
+ query,
24042
+ ...topN != null ? { topN } : {},
24043
+ ...providerOptions ? { providerOptions } : {}
24044
+ },
24045
+ successfulResponseHandler: createJsonResponseHandler(gatewayRerankingResponseSchema),
24046
+ failedResponseHandler: createJsonErrorResponseHandler({
24047
+ errorSchema: exports_external.any(),
24048
+ errorToMessage: (data) => data
24049
+ }),
24050
+ ...abortSignal && { abortSignal },
24051
+ fetch: this.config.fetch
24052
+ });
24053
+ return {
24054
+ ranking: responseBody.ranking,
24055
+ providerMetadata: responseBody.providerMetadata,
24056
+ response: { headers: responseHeaders, body: rawValue },
24057
+ warnings: []
24058
+ };
24059
+ } catch (error48) {
24060
+ throw await asGatewayError(error48, await parseAuthMethod(resolvedHeaders));
24061
+ }
24062
+ }
24063
+ getUrl() {
24064
+ return `${this.config.baseURL}/reranking-model`;
24065
+ }
24066
+ getModelConfigHeaders() {
24067
+ return {
24068
+ "ai-reranking-model-specification-version": "3",
24069
+ "ai-model-id": this.modelId
24070
+ };
24071
+ }
24072
+ }, 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
24073
  var init_dist4 = __esm(() => {
23989
24074
  init_dist3();
23990
24075
  init_dist();
@@ -24010,6 +24095,8 @@ var init_dist4 = __esm(() => {
24010
24095
  init_dist3();
24011
24096
  init_v4();
24012
24097
  init_dist3();
24098
+ init_v4();
24099
+ init_dist3();
24013
24100
  init_zod();
24014
24101
  init_dist3();
24015
24102
  init_zod();
@@ -24441,6 +24528,13 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24441
24528
  param: exports_external.unknown().nullable()
24442
24529
  })
24443
24530
  ]);
24531
+ gatewayRerankingResponseSchema = lazySchema(() => zodSchema(exports_external.object({
24532
+ ranking: exports_external.array(exports_external.object({
24533
+ index: exports_external.number(),
24534
+ relevanceScore: exports_external.number()
24535
+ })),
24536
+ providerMetadata: exports_external.record(exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())).optional()
24537
+ })));
24444
24538
  parallelSearchInputSchema = lazySchema(() => zodSchema(exports_external.object({
24445
24539
  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
24540
  search_queries: exports_external.array(exports_external.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),
@@ -28680,7 +28774,7 @@ var import_api, import_api2, __defProp2, __export2 = (target, all) => {
28680
28774
  const bytes = typeof data === "string" ? convertBase64ToUint8Array(data) : data;
28681
28775
  const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
28682
28776
  return bytes.slice(id3Size + 10);
28683
- }, VERSION3 = "6.0.146", download = async ({
28777
+ }, VERSION3 = "6.0.152", download = async ({
28684
28778
  url: url2,
28685
28779
  maxBytes,
28686
28780
  abortSignal
@@ -30444,7 +30538,7 @@ var init_summarize = __esm(() => {
30444
30538
  });
30445
30539
 
30446
30540
  // src/core/workers/io.worker.ts
30447
- import { existsSync, mkdirSync, readFileSync, statSync } from "fs";
30541
+ import { existsSync, mkdirSync, readdirSync as readdirSync2, readFileSync, statSync } from "fs";
30448
30542
  import { readFile, rename, writeFile } from "fs/promises";
30449
30543
  import { extname, join as join3 } from "path";
30450
30544
 
@@ -30900,6 +30994,148 @@ var handlers = {
30900
30994
  meta: meta3,
30901
30995
  tabEntries
30902
30996
  };
30997
+ },
30998
+ listSessions: (sessionsDir) => {
30999
+ const dir = sessionsDir;
31000
+ if (!existsSync(dir))
31001
+ return [];
31002
+ try {
31003
+ const entries = readdirSync2(dir);
31004
+ const metas = [];
31005
+ for (const entry of entries) {
31006
+ try {
31007
+ const fullPath = join3(dir, entry);
31008
+ const s = statSync(fullPath);
31009
+ if (!s.isDirectory())
31010
+ continue;
31011
+ const metaPath = join3(fullPath, "meta.json");
31012
+ if (!existsSync(metaPath))
31013
+ continue;
31014
+ const raw = readFileSync(metaPath, "utf-8");
31015
+ const meta3 = JSON.parse(raw);
31016
+ const totalMessages = (meta3.tabs ?? []).reduce((sum, t) => sum + (t.messageRange.endLine - t.messageRange.startLine), 0);
31017
+ let sizeBytes = 0;
31018
+ for (const file2 of ["meta.json", "messages.jsonl"]) {
31019
+ try {
31020
+ sizeBytes += statSync(join3(fullPath, file2)).size;
31021
+ } catch {}
31022
+ }
31023
+ metas.push({
31024
+ id: meta3.id,
31025
+ title: meta3.title,
31026
+ messageCount: totalMessages,
31027
+ startedAt: meta3.startedAt,
31028
+ updatedAt: meta3.updatedAt,
31029
+ sizeBytes
31030
+ });
31031
+ } catch {}
31032
+ }
31033
+ return metas.sort((a, b) => b.updatedAt - a.updatedAt);
31034
+ } catch {
31035
+ return [];
31036
+ }
31037
+ },
31038
+ fetchModelsFromUrl: async (url2, headers, providerId, grouped) => {
31039
+ const GROUP_NAMES = {
31040
+ anthropic: "Claude",
31041
+ openai: "OpenAI",
31042
+ google: "Google",
31043
+ xai: "xAI",
31044
+ meta: "Meta",
31045
+ mistral: "Mistral",
31046
+ deepseek: "DeepSeek",
31047
+ other: "Other"
31048
+ };
31049
+ function tc(s) {
31050
+ return s.charAt(0).toUpperCase() + s.slice(1);
31051
+ }
31052
+ function inferGroup(modelId) {
31053
+ const id = modelId.toLowerCase();
31054
+ if (id.startsWith("claude"))
31055
+ return "anthropic";
31056
+ if (id.startsWith("gpt") || id.startsWith("o1-") || id.startsWith("o3-") || id.startsWith("o4-") || id.startsWith("chatgpt"))
31057
+ return "openai";
31058
+ if (id.startsWith("gemini"))
31059
+ return "google";
31060
+ if (id.startsWith("grok"))
31061
+ return "xai";
31062
+ if (id.startsWith("llama") || id.startsWith("meta-"))
31063
+ return "meta";
31064
+ if (id.startsWith("mistral") || id.startsWith("codestral") || id.startsWith("pixtral"))
31065
+ return "mistral";
31066
+ if (id.startsWith("deepseek"))
31067
+ return "deepseek";
31068
+ return "other";
31069
+ }
31070
+ try {
31071
+ const res = await fetch(url2, {
31072
+ headers
31073
+ });
31074
+ if (!res.ok) {
31075
+ return {
31076
+ models: [],
31077
+ error: `HTTP ${String(res.status)}`
31078
+ };
31079
+ }
31080
+ const data = await res.json();
31081
+ const pid = providerId;
31082
+ const isGrp = grouped;
31083
+ if (!isGrp) {
31084
+ const models = data.data.map((m) => ({
31085
+ id: m.id,
31086
+ name: m.name ?? m.id,
31087
+ contextWindow: m.context_length
31088
+ }));
31089
+ return {
31090
+ models
31091
+ };
31092
+ }
31093
+ const gMap = {};
31094
+ const isOR = pid === "openrouter";
31095
+ const isLG = pid === "llmgateway";
31096
+ for (const m of data.data) {
31097
+ let group;
31098
+ if (isOR) {
31099
+ const si = m.id.indexOf("/");
31100
+ group = si >= 0 ? m.id.slice(0, si).toLowerCase() : "other";
31101
+ } else if (isLG) {
31102
+ group = m.family?.toLowerCase() || inferGroup(m.id);
31103
+ } else {
31104
+ if (m.type && m.type !== "language")
31105
+ continue;
31106
+ group = m.owned_by ?? inferGroup(m.id);
31107
+ }
31108
+ const arr = gMap[group] || [];
31109
+ gMap[group] = arr;
31110
+ arr.push({
31111
+ id: m.id,
31112
+ name: isOR ? (m.name ?? m.id).replace(/^[^:]+:\s*/, "") : m.name || m.id,
31113
+ contextWindow: m.context_length
31114
+ });
31115
+ }
31116
+ const subProviders = Object.keys(gMap).sort().map((id) => ({
31117
+ id,
31118
+ name: GROUP_NAMES[id] ?? tc(id)
31119
+ }));
31120
+ const allModels = [];
31121
+ for (const sp of subProviders) {
31122
+ for (const m of gMap[sp.id] ?? [])
31123
+ allModels.push(m);
31124
+ }
31125
+ return {
31126
+ models: allModels,
31127
+ grouped: {
31128
+ subProviders,
31129
+ modelsByProvider: gMap
31130
+ }
31131
+ };
31132
+ } catch (err) {
31133
+ const msg = err instanceof Error ? err.message : String(err);
31134
+ return {
31135
+ models: [],
31136
+ error: msg
31137
+ };
31138
+ }
30903
31139
  }
30904
31140
  };
30905
31141
  createWorkerHandler(handlers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "2.8.0",
3
+ "version": "2.9.1",
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
  }