fss-link 1.2.18 → 1.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bundle/fss-link.js +29 -10
  2. package/package.json +1 -1
@@ -22343,7 +22343,7 @@ async function createContentGeneratorConfig(config, authType) {
22343
22343
  async function createContentGenerator(config, gcConfig, sessionId2) {
22344
22344
  if (DEBUG_CONTENT)
22345
22345
  console.log(`\u{1F41B} DEBUG createContentGenerator: authType=${config.authType}, apiKey=${config.apiKey}, baseUrl=${config.baseUrl}`);
22346
- const version = "1.2.18";
22346
+ const version = "1.2.20";
22347
22347
  const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
22348
22348
  const baseHeaders = {
22349
22349
  "User-Agent": userAgent
@@ -86142,17 +86142,34 @@ var init_modelManager = __esm({
86142
86142
  * 🔒 MIGRATED: Now uses UnifiedDatabase for thread-safe operations
86143
86143
  */
86144
86144
  /**
86145
- * Normalize base URLs for OpenAI-compatible endpoints
86146
- * Inspired by BobAI proxy's excellent URL normalization
86145
+ * Normalize base URLs for OpenAI-compatible endpoints (Ollama, LM Studio)
86146
+ *
86147
+ * CRITICAL FIX: OpenAI SDK appends `/chat/completions` to baseURL, NOT `/v1/chat/completions`!
86148
+ * Therefore baseURL MUST include /v1 for LM Studio and Ollama to work correctly.
86149
+ *
86150
+ * Ensures URL has correct `/v1` suffix and handles edge cases:
86151
+ * - Adds `/v1` if missing for Ollama and LM Studio
86152
+ * - Removes duplicate `/v1/v1` if present
86153
+ * - Handles trailing slashes correctly
86154
+ * - Enforces HTTPS for non-local endpoints
86155
+ *
86156
+ * @param url - The base URL to normalize
86157
+ * @param authType - Auth type to determine if /v1 is needed
86158
+ * @returns Normalized URL
86147
86159
  */
86148
86160
  normalizeEndpointUrl(url2, authType) {
86149
86161
  if (!url2) return void 0;
86150
86162
  let normalized2 = url2.trim();
86151
- if (normalized2.endsWith("/v1")) {
86152
- if (DEBUG_MODEL) console.log(`\u{1F527} [URL-NORMALIZE] Stripping /v1 suffix from: ${normalized2}`);
86163
+ normalized2 = normalized2.replace(/\/+$/, "");
86164
+ if (normalized2.endsWith("/v1/v1")) {
86153
86165
  normalized2 = normalized2.slice(0, -3);
86166
+ if (DEBUG_MODEL) console.log(`\u26A0\uFE0F [URL-NORMALIZE] Removed duplicate /v1 from URL: ${url2} \u2192 ${normalized2}`);
86167
+ }
86168
+ const needsV1 = authType === AuthType.OLLAMA || authType === AuthType.LM_STUDIO;
86169
+ if (needsV1 && !normalized2.endsWith("/v1")) {
86170
+ normalized2 = `${normalized2}/v1`;
86171
+ if (DEBUG_MODEL) console.log(`\u2705 [URL-NORMALIZE] Added /v1 suffix to URL: ${url2} \u2192 ${normalized2}`);
86154
86172
  }
86155
- normalized2 = normalized2.replace(/\/+$/, "");
86156
86173
  if (!normalized2.startsWith("http://localhost") && !normalized2.startsWith("http://127.0.0.1") && normalized2.startsWith("http://")) {
86157
86174
  if (DEBUG_MODEL) console.log(`\u{1F527} [URL-NORMALIZE] Upgrading HTTP to HTTPS: ${normalized2}`);
86158
86175
  normalized2 = normalized2.replace("http://", "https://");
@@ -86442,7 +86459,8 @@ var init_modelManager = __esm({
86442
86459
  case AuthType.OLLAMA:
86443
86460
  case "ollama":
86444
86461
  process.env["OLLAMA_API_KEY"] = model.apiKey || "1";
86445
- process.env["OLLAMA_BASE_URL"] = model.endpointUrl || "http://localhost:11434/v1";
86462
+ const ollamaUrl = this.normalizeEndpointUrl(model.endpointUrl || "http://localhost:11434/v1", AuthType.OLLAMA);
86463
+ process.env["OLLAMA_BASE_URL"] = ollamaUrl || "http://localhost:11434/v1";
86446
86464
  process.env["OLLAMA_MODEL"] = model.modelName || "";
86447
86465
  break;
86448
86466
  case AuthType.LM_STUDIO:
@@ -86450,7 +86468,8 @@ var init_modelManager = __esm({
86450
86468
  // New normalized value
86451
86469
  case "lmstudio":
86452
86470
  process.env["LM_STUDIO_API_KEY"] = model.apiKey || "1";
86453
- process.env["LM_STUDIO_BASE_URL"] = model.endpointUrl || "http://localhost:1234/v1";
86471
+ const lmStudioUrl = this.normalizeEndpointUrl(model.endpointUrl || "http://localhost:1234/v1", AuthType.LM_STUDIO);
86472
+ process.env["LM_STUDIO_BASE_URL"] = lmStudioUrl || "http://localhost:1234/v1";
86454
86473
  process.env["LM_STUDIO_MODEL"] = model.modelName || "";
86455
86474
  break;
86456
86475
  case AuthType.USE_GEMINI:
@@ -95410,7 +95429,7 @@ async function getPackageJson() {
95410
95429
  // packages/cli/src/utils/version.ts
95411
95430
  async function getCliVersion() {
95412
95431
  const pkgJson = await getPackageJson();
95413
- return "1.2.18";
95432
+ return "1.2.20";
95414
95433
  }
95415
95434
 
95416
95435
  // packages/cli/src/ui/commands/aboutCommand.ts
@@ -95462,7 +95481,7 @@ import open4 from "open";
95462
95481
  import process11 from "node:process";
95463
95482
 
95464
95483
  // packages/cli/src/generated/git-commit.ts
95465
- var GIT_COMMIT_INFO = "ac38c742";
95484
+ var GIT_COMMIT_INFO = "fccbeb7a";
95466
95485
 
95467
95486
  // packages/cli/src/ui/commands/bugCommand.ts
95468
95487
  init_dist2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.2.18",
3
+ "version": "1.2.20",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },