fss-link 1.2.17 → 1.2.19

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 +23 -17
  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.17";
22346
+ const version = "1.2.19";
22347
22347
  const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
22348
22348
  const baseHeaders = {
22349
22349
  "User-Agent": userAgent
@@ -86142,21 +86142,33 @@ 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)
86147
86146
  *
86148
- * CRITICAL: Only strip /v1 for OpenAI provider where SDK adds it automatically.
86149
- * For LM Studio and Ollama, /v1 is part of their actual API path.
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
86150
86159
  */
86151
86160
  normalizeEndpointUrl(url2, authType) {
86152
86161
  if (!url2) return void 0;
86153
86162
  let normalized2 = url2.trim();
86154
- if (normalized2.endsWith("/v1") && authType === AuthType.USE_OPENAI) {
86155
- if (DEBUG_MODEL) console.log(`\u{1F527} [URL-NORMALIZE] Stripping /v1 suffix from OpenAI endpoint: ${normalized2}`);
86163
+ normalized2 = normalized2.replace(/\/+$/, "");
86164
+ if (normalized2.endsWith("/v1/v1")) {
86156
86165
  normalized2 = normalized2.slice(0, -3);
86166
+ if (DEBUG_MODEL) console.log(`\u26A0\uFE0F [URL-NORMALIZE] Removed duplicate /v1 from URL: ${url2} \u2192 ${normalized2}`);
86157
86167
  }
86158
- if (!normalized2.endsWith("/v1")) {
86159
- normalized2 = normalized2.replace(/\/+$/, "");
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}`);
86160
86172
  }
86161
86173
  if (!normalized2.startsWith("http://localhost") && !normalized2.startsWith("http://127.0.0.1") && normalized2.startsWith("http://")) {
86162
86174
  if (DEBUG_MODEL) console.log(`\u{1F527} [URL-NORMALIZE] Upgrading HTTP to HTTPS: ${normalized2}`);
@@ -95415,7 +95427,7 @@ async function getPackageJson() {
95415
95427
  // packages/cli/src/utils/version.ts
95416
95428
  async function getCliVersion() {
95417
95429
  const pkgJson = await getPackageJson();
95418
- return "1.2.17";
95430
+ return "1.2.19";
95419
95431
  }
95420
95432
 
95421
95433
  // packages/cli/src/ui/commands/aboutCommand.ts
@@ -95467,7 +95479,7 @@ import open4 from "open";
95467
95479
  import process11 from "node:process";
95468
95480
 
95469
95481
  // packages/cli/src/generated/git-commit.ts
95470
- var GIT_COMMIT_INFO = "6daf471c";
95482
+ var GIT_COMMIT_INFO = "5d20178b";
95471
95483
 
95472
95484
  // packages/cli/src/ui/commands/bugCommand.ts
95473
95485
  init_dist2();
@@ -127921,7 +127933,6 @@ async function runNonInteractive(config, input, prompt_id) {
127921
127933
  abortController.signal,
127922
127934
  prompt_id
127923
127935
  );
127924
- let hasFinishedEvent = false;
127925
127936
  for await (const event of responseStream) {
127926
127937
  if (abortController.signal.aborted) {
127927
127938
  console.error("Operation cancelled.");
@@ -127937,8 +127948,6 @@ async function runNonInteractive(config, input, prompt_id) {
127937
127948
  id: toolCallRequest.callId
127938
127949
  };
127939
127950
  functionCalls.push(fc);
127940
- } else if (event.type === GeminiEventType.Finished) {
127941
- hasFinishedEvent = true;
127942
127951
  }
127943
127952
  }
127944
127953
  if (functionCalls.length > 0) {
@@ -127974,9 +127983,6 @@ async function runNonInteractive(config, input, prompt_id) {
127974
127983
  }
127975
127984
  }
127976
127985
  currentMessages = [{ role: "user", parts: toolResponseParts }];
127977
- } else if (hasFinishedEvent) {
127978
- process.stdout.write("\n");
127979
- return;
127980
127986
  } else {
127981
127987
  process.stdout.write("\n");
127982
127988
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },