@the-magic-tower/fixhive-opencode-plugin 0.1.27 → 0.1.29

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.
package/dist/index.d.ts CHANGED
@@ -23,19 +23,8 @@
23
23
  * OPENAI_API_KEY=sk-... # Optional, for embeddings
24
24
  * ```
25
25
  */
26
- export { FixHivePlugin, default } from './plugin/index.js';
27
- export { createErrorDetector, defaultErrorDetector } from './core/error-detector.js';
28
- export { createPrivacyFilter, defaultPrivacyFilter, createFilterContext } from './core/privacy-filter.js';
29
- export { sha256, shortHash, generateErrorFingerprint, normalizeErrorContent, generateContributorId, generateSessionHash, fingerprintsMatch, calculateStringSimilarity, } from './core/hash.js';
30
- export { createLocalStore } from './storage/local-store.js';
31
- export { runMigrations } from './storage/migrations.js';
32
- export { createCloudClient } from './cloud/client.js';
33
- export { createEmbeddingService, cosineSimilarity } from './cloud/embedding.js';
34
- export { ErrorDetector } from './core/error-detector.js';
35
- export { PrivacyFilter } from './core/privacy-filter.js';
36
- export { LocalStore } from './storage/local-store.js';
37
- export { CloudClient } from './cloud/client.js';
38
- export { EmbeddingService } from './cloud/embedding.js';
26
+ import FixHivePlugin from './plugin/index.js';
27
+ export default FixHivePlugin;
39
28
  export type { ErrorType, ErrorStatus, Language, Severity, LocalErrorRecord, QueryCacheEntry, LocalStats, CloudKnowledgeEntry, DuplicateCheckResult, ContributorStats, DetectedSignal, ErrorDetectionResult, StackFrame, StackTraceInfo, FixHiveContext, ToolOutput, PrivacyFilterRule, SanitizedContent, FilterContext, SearchRequest, SearchResponse, UploadRequest, UploadResponse, QueryKnowledgeArgs, SubmitResolutionArgs, ListErrorsArgs, MarkResolvedArgs, VoteArgs, FixHiveConfig, PartialConfig, FixHiveEvent, } from './types/index.js';
40
29
  export type { ErrorDetector as ErrorDetectorInterface } from './core/error-detector.js';
41
30
  export type { PrivacyFilter as PrivacyFilterInterface } from './core/privacy-filter.js';
@@ -1 +1 @@
1
- {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AU,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,YAAY,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -27002,9 +27002,6 @@ function createPrivacyFilter(customRules) {
27002
27002
  }
27003
27003
  };
27004
27004
  }
27005
- var PrivacyFilter = {
27006
- create: createPrivacyFilter
27007
- };
27008
27005
  function createFilterContext(projectDirectory) {
27009
27006
  const homeDir = process.env.HOME || process.env.USERPROFILE || "~";
27010
27007
  return {
@@ -27278,14 +27275,8 @@ ${toolOutput.stderr || ""}`;
27278
27275
  }
27279
27276
  };
27280
27277
  }
27281
- var ErrorDetector = {
27282
- create: createErrorDetector
27283
- };
27284
27278
  var defaultErrorDetector = createErrorDetector();
27285
27279
 
27286
- // src/storage/local-store.ts
27287
- import Database from "better-sqlite3";
27288
-
27289
27280
  // node_modules/uuid/dist-node/stringify.js
27290
27281
  var byteToHex = [];
27291
27282
  for (let i = 0;i < 256; ++i) {
@@ -27369,21 +27360,6 @@ function generateContributorId() {
27369
27360
  ].join(":");
27370
27361
  return `anon_${shortHash(machineInfo)}`;
27371
27362
  }
27372
- function generateSessionHash(sessionId) {
27373
- return shortHash(`session:${sessionId}:${Date.now()}`);
27374
- }
27375
- function fingerprintsMatch(fp1, fp2) {
27376
- return fp1 === fp2;
27377
- }
27378
- function calculateStringSimilarity(str1, str2) {
27379
- const words1 = new Set(str1.toLowerCase().split(/\s+/));
27380
- const words2 = new Set(str2.toLowerCase().split(/\s+/));
27381
- const intersection2 = new Set([...words1].filter((x) => words2.has(x)));
27382
- const union2 = new Set([...words1, ...words2]);
27383
- if (union2.size === 0)
27384
- return 0;
27385
- return intersection2.size / union2.size;
27386
- }
27387
27363
 
27388
27364
  // src/storage/migrations.ts
27389
27365
  function runMigrations(db) {
@@ -27476,6 +27452,46 @@ var MIGRATIONS = [
27476
27452
  ];
27477
27453
 
27478
27454
  // src/storage/local-store.ts
27455
+ var isBun = typeof Bun !== "undefined";
27456
+ async function createDatabase(dbPath) {
27457
+ if (isBun) {
27458
+ const { Database } = await import("bun:sqlite");
27459
+ const db = new Database(dbPath, { create: true });
27460
+ return {
27461
+ exec: (sql) => db.exec(sql),
27462
+ prepare: (sql) => {
27463
+ const stmt = db.prepare(sql);
27464
+ return {
27465
+ run: (...params) => {
27466
+ stmt.run(...params);
27467
+ return { changes: db.changes };
27468
+ },
27469
+ get: (...params) => stmt.get(...params),
27470
+ all: (...params) => stmt.all(...params)
27471
+ };
27472
+ },
27473
+ close: () => db.close()
27474
+ };
27475
+ } else {
27476
+ const BetterSqlite3 = (await import("better-sqlite3")).default;
27477
+ const db = new BetterSqlite3(dbPath);
27478
+ return {
27479
+ exec: (sql) => db.exec(sql),
27480
+ prepare: (sql) => {
27481
+ const stmt = db.prepare(sql);
27482
+ return {
27483
+ run: (...params) => {
27484
+ const result = stmt.run(...params);
27485
+ return { changes: result.changes };
27486
+ },
27487
+ get: (...params) => stmt.get(...params),
27488
+ all: (...params) => stmt.all(...params)
27489
+ };
27490
+ },
27491
+ close: () => db.close()
27492
+ };
27493
+ }
27494
+ }
27479
27495
  var ALLOWED_STATS = [
27480
27496
  "total_errors",
27481
27497
  "resolved_errors",
@@ -27503,15 +27519,15 @@ function rowToRecord(row) {
27503
27519
  cloudKnowledgeId: row.cloud_knowledge_id || undefined
27504
27520
  };
27505
27521
  }
27506
- function createLocalStore(projectDirectory) {
27522
+ async function createLocalStore(projectDirectory) {
27507
27523
  const dbPath = `${projectDirectory}/.fixhive/fixhive.db`;
27508
27524
  const dir = dirname(dbPath);
27509
27525
  if (!existsSync(dir)) {
27510
27526
  mkdirSync(dir, { recursive: true });
27511
27527
  }
27512
- const db = new Database(dbPath);
27513
- db.pragma("journal_mode = WAL");
27514
- db.pragma("foreign_keys = ON");
27528
+ const db = await createDatabase(dbPath);
27529
+ db.exec("PRAGMA journal_mode = WAL");
27530
+ db.exec("PRAGMA foreign_keys = ON");
27515
27531
  runMigrations(db);
27516
27532
  function incrementStat(stat) {
27517
27533
  if (!ALLOWED_STATS.includes(stat)) {
@@ -27520,6 +27536,26 @@ function createLocalStore(projectDirectory) {
27520
27536
  const stmt = db.prepare(`UPDATE usage_stats SET ${stat} = ${stat} + 1 WHERE id = 1`);
27521
27537
  stmt.run();
27522
27538
  }
27539
+ function getErrorById(id) {
27540
+ const stmt = db.prepare("SELECT * FROM error_records WHERE id = ?");
27541
+ const row = stmt.get(id);
27542
+ return row ? rowToRecord(row) : null;
27543
+ }
27544
+ function getSessionErrors(sessionId, options) {
27545
+ let query = "SELECT * FROM error_records WHERE session_id = ?";
27546
+ const params = [sessionId];
27547
+ if (options?.status) {
27548
+ query += " AND status = ?";
27549
+ params.push(options.status);
27550
+ }
27551
+ query += " ORDER BY created_at DESC";
27552
+ if (options?.limit) {
27553
+ query += " LIMIT ?";
27554
+ params.push(options.limit);
27555
+ }
27556
+ const stmt = db.prepare(query);
27557
+ return stmt.all(...params).map((row) => rowToRecord(row));
27558
+ }
27523
27559
  return {
27524
27560
  createErrorRecord(data) {
27525
27561
  const id = v4_default();
@@ -27528,48 +27564,16 @@ function createLocalStore(projectDirectory) {
27528
27564
  INSERT INTO error_records (
27529
27565
  id, error_hash, error_type, error_message, error_stack,
27530
27566
  language, framework, tool_name, tool_input, session_id, status
27531
- ) VALUES (
27532
- @id, @errorHash, @errorType, @errorMessage, @errorStack,
27533
- @language, @framework, @toolName, @toolInput, @sessionId, 'unresolved'
27534
- )
27567
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'unresolved')
27535
27568
  `);
27536
- stmt.run({
27537
- id,
27538
- errorHash,
27539
- errorType: data.errorType,
27540
- errorMessage: data.errorMessage,
27541
- errorStack: data.errorStack || null,
27542
- language: data.language || null,
27543
- framework: data.framework || null,
27544
- toolName: data.toolName,
27545
- toolInput: JSON.stringify(data.toolInput),
27546
- sessionId: data.sessionId
27547
- });
27569
+ stmt.run(id, errorHash, data.errorType, data.errorMessage, data.errorStack || null, data.language || null, data.framework || null, data.toolName, JSON.stringify(data.toolInput), data.sessionId);
27548
27570
  incrementStat("total_errors");
27549
- return this.getErrorById(id);
27550
- },
27551
- getErrorById(id) {
27552
- const stmt = db.prepare("SELECT * FROM error_records WHERE id = ?");
27553
- const row = stmt.get(id);
27554
- return row ? rowToRecord(row) : null;
27555
- },
27556
- getSessionErrors(sessionId, options) {
27557
- let query = "SELECT * FROM error_records WHERE session_id = ?";
27558
- const params = [sessionId];
27559
- if (options?.status) {
27560
- query += " AND status = ?";
27561
- params.push(options.status);
27562
- }
27563
- query += " ORDER BY created_at DESC";
27564
- if (options?.limit) {
27565
- query += " LIMIT ?";
27566
- params.push(options.limit);
27567
- }
27568
- const stmt = db.prepare(query);
27569
- return stmt.all(...params).map((row) => rowToRecord(row));
27571
+ return getErrorById(id);
27570
27572
  },
27573
+ getErrorById,
27574
+ getSessionErrors,
27571
27575
  getUnresolvedErrors(sessionId) {
27572
- return this.getSessionErrors(sessionId, { status: "unresolved" });
27576
+ return getSessionErrors(sessionId, { status: "unresolved" });
27573
27577
  },
27574
27578
  getRecentErrors(limit = 10) {
27575
27579
  const stmt = db.prepare("SELECT * FROM error_records ORDER BY created_at DESC LIMIT ?");
@@ -27587,7 +27591,7 @@ function createLocalStore(projectDirectory) {
27587
27591
  const result = stmt.run(data.resolution, data.resolutionCode || null, id);
27588
27592
  if (result.changes > 0) {
27589
27593
  incrementStat("resolved_errors");
27590
- return this.getErrorById(id);
27594
+ return getErrorById(id);
27591
27595
  }
27592
27596
  return null;
27593
27597
  },
@@ -27663,9 +27667,6 @@ function createLocalStore(projectDirectory) {
27663
27667
  }
27664
27668
  };
27665
27669
  }
27666
- var LocalStore = {
27667
- create: createLocalStore
27668
- };
27669
27670
 
27670
27671
  // src/cloud/embedding.ts
27671
27672
  var DEFAULT_MODEL = "text-embedding-3-small";
@@ -27675,23 +27676,6 @@ async function getOpenAIClass() {
27675
27676
  const mod = await Promise.resolve().then(() => (init_openai(), exports_openai));
27676
27677
  return mod.OpenAI || mod.default;
27677
27678
  }
27678
- function cosineSimilarity(a, b) {
27679
- if (a.length !== b.length) {
27680
- throw new Error("Embeddings must have same dimensions");
27681
- }
27682
- let dotProduct = 0;
27683
- let normA = 0;
27684
- let normB = 0;
27685
- for (let i = 0;i < a.length; i++) {
27686
- dotProduct += a[i] * b[i];
27687
- normA += a[i] * a[i];
27688
- normB += b[i] * b[i];
27689
- }
27690
- const magnitude = Math.sqrt(normA) * Math.sqrt(normB);
27691
- if (magnitude === 0)
27692
- return 0;
27693
- return dotProduct / magnitude;
27694
- }
27695
27679
  async function createEmbeddingService(config2) {
27696
27680
  const OpenAI2 = await getOpenAIClass();
27697
27681
  const client = new OpenAI2({ apiKey: config2.apiKey });
@@ -27759,10 +27743,6 @@ ${errorStack}`);
27759
27743
  }
27760
27744
  };
27761
27745
  }
27762
- var EmbeddingService = {
27763
- create: createEmbeddingService,
27764
- cosineSimilarity
27765
- };
27766
27746
 
27767
27747
  // src/cloud/client.ts
27768
27748
  async function getSupabaseCreateClient() {
@@ -27994,9 +27974,6 @@ ${errorRecord.errorStack || ""}`;
27994
27974
  }
27995
27975
  };
27996
27976
  }
27997
- var CloudClient = {
27998
- create: createCloudClient
27999
- };
28000
27977
 
28001
27978
  // src/plugin/tools.ts
28002
27979
  function createTools(localStore, cloudClient, privacyFilter, context) {
@@ -28220,7 +28197,7 @@ var FixHivePlugin = async (ctx) => {
28220
28197
  console.log("[FixHive:DEBUG] Step 5: Creating error detector");
28221
28198
  const errorDetector = createErrorDetector(privacyFilter);
28222
28199
  console.log("[FixHive:DEBUG] Step 6: Creating local store");
28223
- const localStore = createLocalStore(ctx.directory);
28200
+ const localStore = await createLocalStore(ctx.directory);
28224
28201
  console.log("[FixHive:DEBUG] Step 7: Local store created");
28225
28202
  let cloudClient = null;
28226
28203
  if (config2.supabaseUrl && config2.supabaseAnonKey) {
@@ -28431,30 +28408,9 @@ function detectFramework(directory) {
28431
28408
  return;
28432
28409
  }
28433
28410
  var plugin_default = FixHivePlugin;
28411
+
28412
+ // src/index.ts
28413
+ var src_default = plugin_default;
28434
28414
  export {
28435
- shortHash,
28436
- sha256,
28437
- runMigrations,
28438
- normalizeErrorContent,
28439
- generateSessionHash,
28440
- generateErrorFingerprint,
28441
- generateContributorId,
28442
- fingerprintsMatch,
28443
- defaultPrivacyFilter,
28444
- defaultErrorDetector,
28445
- plugin_default as default,
28446
- createPrivacyFilter,
28447
- createLocalStore,
28448
- createFilterContext,
28449
- createErrorDetector,
28450
- createEmbeddingService,
28451
- createCloudClient,
28452
- cosineSimilarity,
28453
- calculateStringSimilarity,
28454
- PrivacyFilter,
28455
- LocalStore,
28456
- FixHivePlugin,
28457
- ErrorDetector,
28458
- EmbeddingService,
28459
- CloudClient
28415
+ src_default as default
28460
28416
  };
@@ -1,9 +1,24 @@
1
1
  /**
2
2
  * FixHive Local Store
3
3
  * SQLite-based local storage for error records and caching
4
+ * Automatically uses bun:sqlite for Bun runtime, better-sqlite3 for Node.js
4
5
  */
5
- import Database from 'better-sqlite3';
6
6
  import type { LocalErrorRecord, ErrorStatus, LocalStats, CloudKnowledgeEntry } from '../types/index.js';
7
+ /**
8
+ * Unified database interface for both Bun and Node.js
9
+ */
10
+ interface UnifiedDatabase {
11
+ exec(sql: string): void;
12
+ prepare(sql: string): UnifiedStatement;
13
+ close(): void;
14
+ }
15
+ interface UnifiedStatement {
16
+ run(...params: unknown[]): {
17
+ changes: number;
18
+ };
19
+ get(...params: unknown[]): Record<string, unknown> | undefined;
20
+ all(...params: unknown[]): Record<string, unknown>[];
21
+ }
7
22
  /**
8
23
  * LocalStore interface - defines all public methods
9
24
  */
@@ -29,13 +44,14 @@ export interface LocalStore {
29
44
  getPreference(key: string): string | null;
30
45
  setPreference(key: string, value: string): void;
31
46
  close(): void;
32
- getDatabase(): Database.Database;
47
+ getDatabase(): UnifiedDatabase;
33
48
  }
34
49
  /**
35
50
  * Create a LocalStore instance
36
51
  * Factory function pattern to avoid ES6 class issues with Bun
52
+ * Automatically uses bun:sqlite for Bun runtime, better-sqlite3 for Node.js
37
53
  */
38
- export declare function createLocalStore(projectDirectory: string): LocalStore;
54
+ export declare function createLocalStore(projectDirectory: string): Promise<LocalStore>;
39
55
  /**
40
56
  * Legacy class wrapper for backwards compatibility
41
57
  * @deprecated Use createLocalStore() instead
@@ -43,4 +59,5 @@ export declare function createLocalStore(projectDirectory: string): LocalStore;
43
59
  export declare const LocalStore: {
44
60
  create: typeof createLocalStore;
45
61
  };
62
+ export {};
46
63
  //# sourceMappingURL=local-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../../src/storage/local-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAItC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAc3B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG,gBAAgB,CAAC;IAC/G,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAClD,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,gBAAgB,EAAE,CAAC;IAC5G,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAC3D,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;IACpD,YAAY,CAAC,EAAE,E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S,EAAE,MAAM,GAAG,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAClE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7F,iBAAiB,IAAI,MAAM,CAAC;IAC5B,QAAQ,IAAI,UAAU,CAAC;IACvB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,KAAK,IAAI,IAAI,CAAC;IACd,WAAW,IAAI,eAAe,CAAC;CAChC;AA2BD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA0RpF;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU;;CAEtB,CAAC"}
@@ -2,9 +2,22 @@
2
2
  * FixHive Database Migrations
3
3
  * SQLite schema setup and migrations
4
4
  */
5
- import type Database from 'better-sqlite3';
5
+ /**
6
+ * Unified database interface for migrations
7
+ * Works with both bun:sqlite and better-sqlite3
8
+ */
9
+ interface MigrationDatabase {
10
+ exec(sql: string): void;
11
+ prepare(sql: string): {
12
+ all(...params: unknown[]): Record<string, unknown>[];
13
+ run(...params: unknown[]): {
14
+ changes: number;
15
+ };
16
+ };
17
+ }
6
18
  /**
7
19
  * Run all migrations on the database
8
20
  */
9
- export declare function runMigrations(db: Database.Database): void;
21
+ export declare function runMigrations(db: MigrationDatabase): void;
22
+ export {};
10
23
  //# sourceMappingURL=migrations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/storage/migrations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAsBzD"}
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/storage/migrations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,UAAU,iBAAiB;IACzB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QACpB,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;KAChD,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAsBzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-magic-tower/fixhive-opencode-plugin",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Community-based error knowledge sharing for OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",