fss-link 1.5.1 → 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 +36 -23
  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.1";
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
@@ -50437,7 +50437,7 @@ Co-authored-by: ${gitCoAuthorSettings.name} <${gitCoAuthorSettings.email}>`;
50437
50437
  description: "(OPTIONAL) Directory to run the command in, if not the project root directory. Must be relative to the project root directory and must already exist."
50438
50438
  }
50439
50439
  },
50440
- required: ["command", "is_background"]
50440
+ required: ["command"]
50441
50441
  },
50442
50442
  false,
50443
50443
  // output is not markdown
@@ -50456,6 +50456,9 @@ Co-authored-by: ${gitCoAuthorSettings.name} <${gitCoAuthorSettings.email}>`;
50456
50456
  // Override build method to preprocess parameters before validation
50457
50457
  build(params) {
50458
50458
  const processedParams = { ...params };
50459
+ if (processedParams.is_background === void 0 || processedParams.is_background === null) {
50460
+ processedParams.is_background = false;
50461
+ }
50459
50462
  if (typeof processedParams.is_background === "string") {
50460
50463
  const boolStr = processedParams.is_background.toLowerCase();
50461
50464
  if (boolStr === "false") {
@@ -96359,7 +96362,7 @@ async function getPackageJson() {
96359
96362
  // packages/cli/src/utils/version.ts
96360
96363
  async function getCliVersion() {
96361
96364
  const pkgJson = await getPackageJson();
96362
- return "1.5.1";
96365
+ return "1.5.3";
96363
96366
  }
96364
96367
 
96365
96368
  // packages/cli/src/ui/commands/aboutCommand.ts
@@ -96411,7 +96414,7 @@ import open4 from "open";
96411
96414
  import process11 from "node:process";
96412
96415
 
96413
96416
  // packages/cli/src/generated/git-commit.ts
96414
- var GIT_COMMIT_INFO = "7684208c";
96417
+ var GIT_COMMIT_INFO = "45c933a2";
96415
96418
 
96416
96419
  // packages/cli/src/ui/commands/bugCommand.ts
96417
96420
  init_dist2();
@@ -120709,6 +120712,7 @@ import { Box as Box19, Text as Text26, useInput as useInput4 } from "ink";
120709
120712
 
120710
120713
  // packages/cli/src/utils/modelFetcher.ts
120711
120714
  init_dist2();
120715
+ var DEBUG_FETCH = process.env["FSS_DEBUG"] === "true" || process.env["NODE_ENV"] === "development";
120712
120716
  var modelCache = /* @__PURE__ */ new Map();
120713
120717
  var MODEL_CACHE_TTL = 5 * 60 * 1e3;
120714
120718
  async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
@@ -120720,8 +120724,10 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120720
120724
  if (apiKey && apiKey.trim() !== "") {
120721
120725
  headers["Authorization"] = `Bearer ${apiKey}`;
120722
120726
  }
120723
- console.error(`[DEBUG] fetchModelsFromCustomEndpoint: ${url2}`);
120724
- 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
+ }
120725
120731
  try {
120726
120732
  const controller = new AbortController();
120727
120733
  const timeoutId = setTimeout(() => controller.abort(), 1e4);
@@ -120752,13 +120758,17 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120752
120758
  object: m.object
120753
120759
  }));
120754
120760
  } catch (error) {
120755
- console.error("[DEBUG] Fetch error caught:");
120756
- 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
+ }
120757
120771
  if (error instanceof Error) {
120758
- console.error("[DEBUG] Error name:", error.name);
120759
- console.error("[DEBUG] Error message:", error.message);
120760
- console.error("[DEBUG] Error stack:", error.stack);
120761
- console.error("[DEBUG] Error cause:", error.cause);
120762
120772
  if (error.name === "AbortError") {
120763
120773
  throw new Error("Connection timeout (10s) - endpoint did not respond");
120764
120774
  }
@@ -120778,7 +120788,7 @@ async function fetchModelsFromCustomEndpoint(baseUrl, providerType, apiKey) {
120778
120788
  }
120779
120789
  throw error;
120780
120790
  }
120781
- console.error("[DEBUG] Non-Error object:", error);
120791
+ if (DEBUG_FETCH) console.error("[DEBUG] Non-Error object:", error);
120782
120792
  throw new Error(`Connection failed: ${String(error)}`);
120783
120793
  }
120784
120794
  }
@@ -120787,7 +120797,7 @@ async function fetchModelsFromProvider(provider, endpoint, apiKey, forceRefresh
120787
120797
  if (!forceRefresh) {
120788
120798
  const cached = modelCache.get(cacheKey);
120789
120799
  if (cached && Date.now() - cached.timestamp < MODEL_CACHE_TTL) {
120790
- console.error(`[DEBUG] Using cached models for ${cacheKey}`);
120800
+ if (DEBUG_FETCH) console.error(`[DEBUG] Using cached models for ${cacheKey}`);
120791
120801
  return cached.models;
120792
120802
  }
120793
120803
  }
@@ -120806,13 +120816,13 @@ async function fetchModelsFromProvider(provider, endpoint, apiKey, forceRefresh
120806
120816
  throw new Error(`No default endpoint for provider: ${provider}`);
120807
120817
  }
120808
120818
  }
120809
- console.error(`[DEBUG] Fetching models from ${provider} at ${fetchUrl}`);
120819
+ if (DEBUG_FETCH) console.error(`[DEBUG] Fetching models from ${provider} at ${fetchUrl}`);
120810
120820
  const models = await fetchModelsFromCustomEndpoint(fetchUrl, provider, apiKey);
120811
120821
  modelCache.set(cacheKey, {
120812
120822
  models,
120813
120823
  timestamp: Date.now()
120814
120824
  });
120815
- console.error(`[DEBUG] Cached ${models.length} models for ${cacheKey}`);
120825
+ if (DEBUG_FETCH) console.error(`[DEBUG] Cached ${models.length} models for ${cacheKey}`);
120816
120826
  return models;
120817
120827
  }
120818
120828
 
@@ -121900,7 +121910,6 @@ function EnhancedModelSelectionDialog({
121900
121910
  (async () => {
121901
121911
  try {
121902
121912
  if (selectedModel.isNew) {
121903
- console.error(`[DEBUG] Auto-adding new model: ${selectedModel.id}`);
121904
121913
  await modelManager.configureModel(
121905
121914
  providerType,
121906
121915
  selectedModel.id,
@@ -121910,14 +121919,18 @@ function EnhancedModelSelectionDialog({
121910
121919
  selectedModel.id
121911
121920
  // Use model ID as display name
121912
121921
  );
121913
- }
121914
- const allDbModels = await modelManager.getAllModels();
121915
- const dbModel = allDbModels.find((m) => m.modelName === selectedModel.id);
121916
- if (dbModel?.id) {
121917
- await modelManager.switchToModel(dbModel.id);
121918
121922
  onComplete();
121919
121923
  } else {
121920
- 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();
121921
121934
  }
121922
121935
  } catch (err) {
121923
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.1",
3
+ "version": "1.5.3",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },