fss-link 1.5.2 → 1.5.3

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 +32 -22
  2. package/package.json +1 -1
@@ -22379,7 +22379,7 @@ async function createContentGeneratorConfig(config, authType) {
22379
22379
  async function createContentGenerator(config, gcConfig, sessionId2) {
22380
22380
  if (DEBUG_CONTENT)
22381
22381
  console.log(`\u{1F41B} DEBUG createContentGenerator: authType=${config.authType}, apiKey=${config.apiKey}, baseUrl=${config.baseUrl}`);
22382
- const version = "1.5.2";
22382
+ const version = "1.5.3";
22383
22383
  const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
22384
22384
  const baseHeaders = {
22385
22385
  "User-Agent": userAgent
@@ -96362,7 +96362,7 @@ async function getPackageJson() {
96362
96362
  // packages/cli/src/utils/version.ts
96363
96363
  async function getCliVersion() {
96364
96364
  const pkgJson = await getPackageJson();
96365
- return "1.5.2";
96365
+ return "1.5.3";
96366
96366
  }
96367
96367
 
96368
96368
  // packages/cli/src/ui/commands/aboutCommand.ts
@@ -96414,7 +96414,7 @@ import open4 from "open";
96414
96414
  import process11 from "node:process";
96415
96415
 
96416
96416
  // packages/cli/src/generated/git-commit.ts
96417
- var GIT_COMMIT_INFO = "9c5ce749";
96417
+ var GIT_COMMIT_INFO = "45c933a2";
96418
96418
 
96419
96419
  // packages/cli/src/ui/commands/bugCommand.ts
96420
96420
  init_dist2();
@@ -120712,6 +120712,7 @@ import { Box as Box19, Text as Text26, useInput as useInput4 } from "ink";
120712
120712
 
120713
120713
  // packages/cli/src/utils/modelFetcher.ts
120714
120714
  init_dist2();
120715
+ var DEBUG_FETCH = process.env["FSS_DEBUG"] === "true" || process.env["NODE_ENV"] === "development";
120715
120716
  var modelCache = /* @__PURE__ */ new Map();
120716
120717
  var MODEL_CACHE_TTL = 5 * 60 * 1e3;
120717
120718
  async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
@@ -120723,8 +120724,10 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120723
120724
  if (apiKey && apiKey.trim() !== "") {
120724
120725
  headers["Authorization"] = `Bearer ${apiKey}`;
120725
120726
  }
120726
- console.error(`[DEBUG] fetchModelsFromCustomEndpoint: ${url2}`);
120727
- console.error(`[DEBUG] Provider: ${providerType}, Has API key: ${!!apiKey}`);
120727
+ if (DEBUG_FETCH) {
120728
+ console.error(`[DEBUG] fetchModelsFromCustomEndpoint: ${url2}`);
120729
+ console.error(`[DEBUG] Provider: ${providerType}, Has API key: ${!!apiKey}`);
120730
+ }
120728
120731
  try {
120729
120732
  const controller = new AbortController();
120730
120733
  const timeoutId = setTimeout(() => controller.abort(), 1e4);
@@ -120755,13 +120758,17 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120755
120758
  object: m.object
120756
120759
  }));
120757
120760
  } catch (error) {
120758
- console.error("[DEBUG] Fetch error caught:");
120759
- console.error("[DEBUG] Error type:", error instanceof Error ? "Error" : typeof error);
120761
+ if (DEBUG_FETCH) {
120762
+ console.error("[DEBUG] Fetch error caught:");
120763
+ console.error("[DEBUG] Error type:", error instanceof Error ? "Error" : typeof error);
120764
+ if (error instanceof Error) {
120765
+ console.error("[DEBUG] Error name:", error.name);
120766
+ console.error("[DEBUG] Error message:", error.message);
120767
+ console.error("[DEBUG] Error stack:", error.stack);
120768
+ console.error("[DEBUG] Error cause:", error.cause);
120769
+ }
120770
+ }
120760
120771
  if (error instanceof Error) {
120761
- console.error("[DEBUG] Error name:", error.name);
120762
- console.error("[DEBUG] Error message:", error.message);
120763
- console.error("[DEBUG] Error stack:", error.stack);
120764
- console.error("[DEBUG] Error cause:", error.cause);
120765
120772
  if (error.name === "AbortError") {
120766
120773
  throw new Error("Connection timeout (10s) - endpoint did not respond");
120767
120774
  }
@@ -120781,7 +120788,7 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120781
120788
  }
120782
120789
  throw error;
120783
120790
  }
120784
- console.error("[DEBUG] Non-Error object:", error);
120791
+ if (DEBUG_FETCH) console.error("[DEBUG] Non-Error object:", error);
120785
120792
  throw new Error(`Connection failed: ${String(error)}`);
120786
120793
  }
120787
120794
  }
@@ -120790,7 +120797,7 @@ async function fetchModelsFromProvider(provider, endpoint, apiKey, forceRefresh
120790
120797
  if (!forceRefresh) {
120791
120798
  const cached = modelCache.get(cacheKey);
120792
120799
  if (cached && Date.now() - cached.timestamp < MODEL_CACHE_TTL) {
120793
- console.error(`[DEBUG] Using cached models for ${cacheKey}`);
120800
+ if (DEBUG_FETCH) console.error(`[DEBUG] Using cached models for ${cacheKey}`);
120794
120801
  return cached.models;
120795
120802
  }
120796
120803
  }
@@ -120809,13 +120816,13 @@ async function fetchModelsFromProvider(provider, endpoint, apiKey, forceRefresh
120809
120816
  throw new Error(`No default endpoint for provider: ${provider}`);
120810
120817
  }
120811
120818
  }
120812
- console.error(`[DEBUG] Fetching models from ${provider} at ${fetchUrl}`);
120819
+ if (DEBUG_FETCH) console.error(`[DEBUG] Fetching models from ${provider} at ${fetchUrl}`);
120813
120820
  const models = await fetchModelsFromCustomEndpoint(fetchUrl, provider, apiKey);
120814
120821
  modelCache.set(cacheKey, {
120815
120822
  models,
120816
120823
  timestamp: Date.now()
120817
120824
  });
120818
- console.error(`[DEBUG] Cached ${models.length} models for ${cacheKey}`);
120825
+ if (DEBUG_FETCH) console.error(`[DEBUG] Cached ${models.length} models for ${cacheKey}`);
120819
120826
  return models;
120820
120827
  }
120821
120828
 
@@ -121903,7 +121910,6 @@ function EnhancedModelSelectionDialog({
121903
121910
  (async () => {
121904
121911
  try {
121905
121912
  if (selectedModel.isNew) {
121906
- console.error(`[DEBUG] Auto-adding new model: ${selectedModel.id}`);
121907
121913
  await modelManager.configureModel(
121908
121914
  providerType,
121909
121915
  selectedModel.id,
@@ -121913,14 +121919,18 @@ function EnhancedModelSelectionDialog({
121913
121919
  selectedModel.id
121914
121920
  // Use model ID as display name
121915
121921
  );
121916
- }
121917
- const allDbModels = await modelManager.getAllModels();
121918
- const dbModel = allDbModels.find((m) => m.modelName === selectedModel.id);
121919
- if (dbModel?.id) {
121920
- await modelManager.switchToModel(dbModel.id);
121921
121922
  onComplete();
121922
121923
  } else {
121923
- throw new Error("Failed to find model after adding");
121924
+ const allDbModels = await modelManager.getAllModels();
121925
+ const dbModel = allDbModels.find((m) => m.modelName === selectedModel.id);
121926
+ if (!dbModel?.id) {
121927
+ throw new Error(`Model not found in database: ${selectedModel.id}`);
121928
+ }
121929
+ const success = await modelManager.switchToModel(dbModel.id);
121930
+ if (!success) {
121931
+ throw new Error(`Failed to switch to model: ${selectedModel.id}`);
121932
+ }
121933
+ onComplete();
121924
121934
  }
121925
121935
  } catch (err) {
121926
121936
  setError(err instanceof Error ? err.message : "Failed to switch model");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },