fss-link 1.0.78 → 1.0.80

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 +58 -8
  2. package/package.json +1 -1
@@ -22379,7 +22379,7 @@ function createContentGeneratorConfig(config, authType) {
22379
22379
  return contentGeneratorConfig;
22380
22380
  }
22381
22381
  async function createContentGenerator(config, gcConfig, sessionId2) {
22382
- const version = "1.0.78";
22382
+ const version = "1.0.80";
22383
22383
  const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
22384
22384
  const baseHeaders = {
22385
22385
  "User-Agent": userAgent
@@ -371813,6 +371813,24 @@ var FSSLinkDatabase = class {
371813
371813
  return result && result.id ? this.mapRowToModelConfig(result) : null;
371814
371814
  });
371815
371815
  }
371816
+ /**
371817
+ * Get the first model configuration for a specific auth type (for provider settings lookup)
371818
+ */
371819
+ async getModelByAuthType(authType) {
371820
+ await this.ensureInitialized();
371821
+ return await this.pool.withConnection(async (db) => {
371822
+ const query = `
371823
+ SELECT id, auth_type, model_name, endpoint_url, api_key, display_name,
371824
+ is_favorite, is_active, last_used, created_at, source
371825
+ FROM model_configs
371826
+ WHERE auth_type = ?
371827
+ ORDER BY id ASC
371828
+ LIMIT 1
371829
+ `;
371830
+ const result = await this.queryOptimizer.executeQuerySingle(db, query, [authType]);
371831
+ return result && result.id ? this.mapRowToModelConfig(result) : null;
371832
+ });
371833
+ }
371816
371834
  /**
371817
371835
  * Set a model as active (and deactivate all others)
371818
371836
  */
@@ -372642,13 +372660,14 @@ var ModelManager = class {
372642
372660
  */
372643
372661
  async updateEnvironmentFromModel(model) {
372644
372662
  let settings = {};
372645
- if (model.id) {
372646
- try {
372647
- const db = await this.getDb();
372648
- settings = await db.getProviderSettings(model.id);
372649
- } catch (error) {
372650
- console.warn("Failed to load provider settings:", error);
372663
+ try {
372664
+ const db = await this.getDb();
372665
+ const providerModel = await db.getModelByAuthType(model.authType);
372666
+ if (providerModel && providerModel.id) {
372667
+ settings = await db.getProviderSettings(providerModel.id);
372651
372668
  }
372669
+ } catch (error) {
372670
+ console.warn("Failed to load provider settings:", error);
372652
372671
  }
372653
372672
  switch (model.authType) {
372654
372673
  // Handle both AuthType enum and string values
@@ -372726,6 +372745,37 @@ var ModelManager = class {
372726
372745
  console.warn("Failed to apply provider settings:", error);
372727
372746
  }
372728
372747
  }
372748
+ /**
372749
+ * Get sampling parameters for the currently active model
372750
+ * @returns Record<string, unknown> containing sampling parameters like num_ctx, temperature, etc.
372751
+ */
372752
+ async getCurrentSamplingParams() {
372753
+ try {
372754
+ const activeModel = await this.getActiveModel();
372755
+ if (!activeModel) {
372756
+ return {};
372757
+ }
372758
+ const db = await this.getDb();
372759
+ const settings = await db.getProviderSettings(activeModel.authType);
372760
+ const samplingParams = {};
372761
+ if (settings["num_ctx"]) {
372762
+ samplingParams["num_ctx"] = parseInt(settings["num_ctx"], 10);
372763
+ }
372764
+ if (settings["temperature"]) {
372765
+ samplingParams["temperature"] = parseFloat(settings["temperature"]);
372766
+ }
372767
+ if (settings["top_p"]) {
372768
+ samplingParams["top_p"] = parseFloat(settings["top_p"]);
372769
+ }
372770
+ if (settings["top_k"]) {
372771
+ samplingParams["top_k"] = parseInt(settings["top_k"], 10);
372772
+ }
372773
+ return samplingParams;
372774
+ } catch (error) {
372775
+ console.warn("Failed to get current sampling params:", error);
372776
+ return {};
372777
+ }
372778
+ }
372729
372779
  };
372730
372780
  var modelManagerInstance = null;
372731
372781
  function getModelManager() {
@@ -373535,7 +373585,7 @@ async function getPackageJson() {
373535
373585
  // packages/cli/src/utils/version.ts
373536
373586
  async function getCliVersion() {
373537
373587
  const pkgJson = await getPackageJson();
373538
- return "1.0.78";
373588
+ return "1.0.80";
373539
373589
  }
373540
373590
 
373541
373591
  // packages/cli/src/ui/commands/aboutCommand.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },