fss-link 1.0.81 → 1.0.82

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 +47 -5
  2. package/package.json +1 -1
@@ -22381,7 +22381,7 @@ async function createContentGeneratorConfig(config, authType) {
22381
22381
  }
22382
22382
  async function createContentGenerator(config, gcConfig, sessionId2) {
22383
22383
  console.log(`\u{1F41B} DEBUG createContentGenerator: authType=${config.authType}, apiKey=${config.apiKey}, baseUrl=${config.baseUrl}`);
22384
- const version = "1.0.81";
22384
+ const version = "1.0.82";
22385
22385
  const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
22386
22386
  const baseHeaders = {
22387
22387
  "User-Agent": userAgent
@@ -369241,7 +369241,7 @@ function saveSettings(settingsFile) {
369241
369241
  // packages/cli/src/config/databasePool.ts
369242
369242
  import initSqlJs from "sql.js";
369243
369243
  import * as fs48 from "fs";
369244
- var DatabaseConnectionPool = class {
369244
+ var DatabaseConnectionPool2 = class {
369245
369245
  connections = [];
369246
369246
  availableConnections = [];
369247
369247
  maxConnections;
@@ -369394,7 +369394,7 @@ var DatabaseConnectionPool = class {
369394
369394
  var globalPool = null;
369395
369395
  function getDatabasePool(dbPath) {
369396
369396
  if (!globalPool && dbPath) {
369397
- globalPool = new DatabaseConnectionPool(dbPath);
369397
+ globalPool = new DatabaseConnectionPool2(dbPath);
369398
369398
  }
369399
369399
  if (!globalPool) {
369400
369400
  throw new Error("Database pool not initialized. Call with dbPath first.");
@@ -371488,6 +371488,17 @@ var FSSLinkDatabase = class {
371488
371488
  throw new Error("Database schema validation failed");
371489
371489
  }
371490
371490
  debugLog("Database schema validation passed");
371491
+ debugLog("Testing database runtime integrity...");
371492
+ try {
371493
+ db.exec("SELECT 1;");
371494
+ const testStmt = db.prepare("SELECT COUNT(*) as count FROM model_configs;");
371495
+ testStmt.step();
371496
+ testStmt.free();
371497
+ debugLog("Database runtime integrity test passed");
371498
+ } catch (error) {
371499
+ console.warn("Database runtime integrity test failed:", error);
371500
+ throw new Error("Database corruption detected - runtime test failed");
371501
+ }
371491
371502
  debugLog("Running legacy schema initialization...");
371492
371503
  await this.initializeSchema(db);
371493
371504
  debugLog("Legacy schema initialization completed");
@@ -371505,7 +371516,38 @@ var FSSLinkDatabase = class {
371505
371516
  debugLog("FSS Link database initialization completed successfully");
371506
371517
  } catch (error) {
371507
371518
  console.error("Database initialization failed:", error);
371519
+ if (error instanceof Error && error.message.includes("corruption detected")) {
371520
+ console.warn("\u{1F527} Database corruption detected, attempting automatic recovery...");
371521
+ try {
371522
+ await this.recoverFromCorruption();
371523
+ console.log("\u2705 Database recovery successful, retrying initialization...");
371524
+ await this.initialize();
371525
+ return;
371526
+ } catch (recoveryError) {
371527
+ console.error("\u274C Database recovery failed:", recoveryError);
371528
+ }
371529
+ }
371530
+ this.initialized = false;
371531
+ throw error;
371532
+ }
371533
+ }
371534
+ /**
371535
+ * Recover from database corruption by resetting to fresh state
371536
+ */
371537
+ async recoverFromCorruption() {
371538
+ const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
371539
+ const backupPath = `${this.dbPath}.corrupted.${timestamp2}`;
371540
+ try {
371541
+ await this.pool.close();
371542
+ if (fs50.existsSync(this.dbPath)) {
371543
+ fs50.renameSync(this.dbPath, backupPath);
371544
+ console.log(`\u{1F4C1} Corrupted database backed up to: ${backupPath}`);
371545
+ }
371508
371546
  this.initialized = false;
371547
+ this.pool = new DatabaseConnectionPool(this.dbPath);
371548
+ console.log("\u{1F504} Database reset complete, will reinitialize with fresh state");
371549
+ } catch (error) {
371550
+ console.error("Failed to recover from database corruption:", error);
371509
371551
  throw error;
371510
371552
  }
371511
371553
  }
@@ -373680,7 +373722,7 @@ async function getPackageJson() {
373680
373722
  // packages/cli/src/utils/version.ts
373681
373723
  async function getCliVersion() {
373682
373724
  const pkgJson = await getPackageJson();
373683
- return "1.0.81";
373725
+ return "1.0.82";
373684
373726
  }
373685
373727
 
373686
373728
  // packages/cli/src/ui/commands/aboutCommand.ts
@@ -373732,7 +373774,7 @@ import open4 from "open";
373732
373774
  import process11 from "node:process";
373733
373775
 
373734
373776
  // packages/cli/src/generated/git-commit.ts
373735
- var GIT_COMMIT_INFO = "58300e66";
373777
+ var GIT_COMMIT_INFO = "a8ffbfc3";
373736
373778
 
373737
373779
  // packages/cli/src/ui/commands/bugCommand.ts
373738
373780
  init_dist2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.0.81",
3
+ "version": "1.0.82",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },