@the-magic-tower/fixhive-opencode-plugin 0.1.15 → 0.1.19

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.
@@ -5,94 +5,42 @@
5
5
  import Database from 'better-sqlite3';
6
6
  import type { LocalErrorRecord, ErrorStatus, LocalStats, CloudKnowledgeEntry } from '../types/index.js';
7
7
  /**
8
- * Local Store Class
9
- * Manages SQLite database for error records and caching
8
+ * LocalStore interface - defines all public methods
10
9
  */
11
- export declare class LocalStore {
12
- private db;
13
- constructor(projectDirectory: string);
14
- /**
15
- * Create a new error record
16
- */
10
+ export interface LocalStore {
17
11
  createErrorRecord(data: Omit<LocalErrorRecord, 'id' | 'errorHash' | 'status' | 'createdAt'>): LocalErrorRecord;
18
- /**
19
- * Get error record by ID
20
- */
21
12
  getErrorById(id: string): LocalErrorRecord | null;
22
- /**
23
- * Get errors by session
24
- */
25
13
  getSessionErrors(sessionId: string, options?: {
26
14
  status?: ErrorStatus;
27
15
  limit?: number;
28
16
  }): LocalErrorRecord[];
29
- /**
30
- * Get unresolved errors for a session
31
- */
32
17
  getUnresolvedErrors(sessionId: string): LocalErrorRecord[];
33
- /**
34
- * Get recent errors across all sessions
35
- */
36
18
  getRecentErrors(limit?: number): LocalErrorRecord[];
37
- /**
38
- * Mark error as resolved
39
- */
40
19
  markResolved(id: string, data: {
41
20
  resolution: string;
42
21
  resolutionCode?: string;
43
22
  }): LocalErrorRecord | null;
44
- /**
45
- * Mark error as uploaded to cloud
46
- */
47
23
  markUploaded(id: string, cloudKnowledgeId: string): void;
48
- /**
49
- * Find similar errors by hash
50
- */
51
24
  findSimilarErrors(errorHash: string): LocalErrorRecord[];
52
- /**
53
- * Get cached query results
54
- */
55
25
  getCachedResults(errorHash: string): CloudKnowledgeEntry[] | null;
56
- /**
57
- * Cache query results
58
- */
59
26
  cacheResults(errorHash: string, results: CloudKnowledgeEntry[], expirationMs?: number): void;
60
- /**
61
- * Clear expired cache entries
62
- */
63
27
  clearExpiredCache(): number;
64
- /**
65
- * Get usage statistics
66
- */
67
28
  getStats(): LocalStats;
68
- /**
69
- * Allowed stat column names for incrementStat (whitelist to prevent SQL injection)
70
- */
71
- private static readonly ALLOWED_STATS;
72
- /**
73
- * Increment a stat counter
74
- * @throws Error if stat name is not in the allowed whitelist
75
- */
76
- private incrementStat;
77
- /**
78
- * Get preference value
79
- */
80
29
  getPreference(key: string): string | null;
81
- /**
82
- * Set preference value
83
- */
84
30
  setPreference(key: string, value: string): void;
85
- /**
86
- * Convert database row to LocalErrorRecord
87
- */
88
- private rowToRecord;
89
- /**
90
- * Close database connection
91
- */
92
31
  close(): void;
93
- /**
94
- * Get database for advanced queries
95
- */
96
32
  getDatabase(): Database.Database;
97
33
  }
34
+ /**
35
+ * Create a LocalStore instance
36
+ * Factory function pattern to avoid ES6 class issues with Bun
37
+ */
38
+ export declare function createLocalStore(projectDirectory: string): LocalStore;
39
+ /**
40
+ * Legacy class wrapper for backwards compatibility
41
+ * @deprecated Use createLocalStore() instead
42
+ */
43
+ export declare const LocalStore: {
44
+ create: typeof createLocalStore;
45
+ };
98
46
  //# 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;AAI3B;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,EAAE,CAAoB;gBAElB,gBAAgB,EAAE,MAAM;IAoBpC;;OAEG;IACH,iBAAiB,CACf,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC,GACxE,gBAAgB;IAiCnB;;OAEG;IACH,YAAY,CAAC,EAAE,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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,QAAQ,CAAC,QAAQ,CAAC;CAClC;AA2BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,UAAU,CA+RrE;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU;;CAEtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-magic-tower/fixhive-opencode-plugin",
3
- "version": "0.1.15",
3
+ "version": "0.1.19",
4
4
  "description": "Community-based error knowledge sharing for OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",