@the-magic-tower/fixhive-opencode-plugin 0.1.28 → 0.1.30
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/README.de.md +44 -1
- package/README.es.md +44 -1
- package/README.fr.md +44 -1
- package/README.ja.md +44 -1
- package/README.ko.md +36 -3
- package/README.md +36 -3
- package/README.nl.md +44 -1
- package/README.zh.md +44 -1
- package/dist/index.js +72 -47
- package/dist/storage/local-store.d.ts +20 -3
- package/dist/storage/local-store.d.ts.map +1 -1
- package/dist/storage/migrations.d.ts +15 -2
- package/dist/storage/migrations.d.ts.map +1 -1
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> Community-basiertes Fehlerwissen-Sharing für OpenCode
|
|
15
15
|
|
|
16
|
+
**Neueste Version: v0.1.29** - Bun-Runtime-Kompatibilitätsprobleme behoben. Das Plugin funktioniert jetzt korrekt mit OpenCode.
|
|
17
|
+
|
|
16
18
|
FixHive ist ein OpenCode-Plugin, das während der Entwicklungssitzungen automatisch Fehler erfasst, eine Community-Wissensdatenbank nach Lösungen abfragt und gelöste Fehler mit anderen Entwicklern teilt.
|
|
17
19
|
|
|
18
20
|
## Funktionen
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection (tool.execute.after Hook)
|
|
115
117
|
├── Privacy Filter (entfernt sensible Daten)
|
|
116
|
-
├── Local Storage (SQLite)
|
|
118
|
+
├── Local Storage (SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client (Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### Runtime-Kompatibilität
|
|
127
|
+
|
|
128
|
+
FixHive erkennt automatisch die Laufzeitumgebung und verwendet die entsprechende SQLite-Implementierung:
|
|
129
|
+
|
|
130
|
+
| Runtime | SQLite-Implementierung |
|
|
131
|
+
|---------|------------------------|
|
|
132
|
+
| Bun | `bun:sqlite` (nativ) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## Datenschutz
|
|
125
136
|
|
|
126
137
|
FixHive filtert automatisch sensible Informationen:
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## Fehlerbehebung
|
|
167
|
+
|
|
168
|
+
### Plugin-Funktion Überprüfen
|
|
169
|
+
|
|
170
|
+
Wenn das Plugin erfolgreich geladen wird, sehen Sie:
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Alle 7 Tools sollten verfügbar sein:
|
|
180
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### Plugin Lädt Nicht
|
|
183
|
+
|
|
184
|
+
Bei einer alten Cache-Version, Cache leeren und neu starten:
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## Lizenz
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## Danksagungen
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - KI-Programmierassistent
|
|
197
|
+
- [Supabase](https://supabase.com) - Backend as a Service
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - Vektor-Ähnlichkeitssuche
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Schnelle SQLite-Bindungen (Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - Schnelle JavaScript-Laufzeit mit nativer SQLite-Unterstützung
|
|
201
|
+
|
|
159
202
|
## Mitwirken
|
|
160
203
|
|
|
161
204
|
1. Repository forken
|
package/README.es.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> Sistema de Compartición de Conocimiento de Errores Basado en la Comunidad para OpenCode
|
|
15
15
|
|
|
16
|
+
**Última versión: v0.1.29** - Corregidos problemas de compatibilidad con Bun runtime. El plugin ahora funciona correctamente con OpenCode.
|
|
17
|
+
|
|
16
18
|
FixHive es un plugin de OpenCode que captura automáticamente errores durante las sesiones de desarrollo, consulta una base de conocimientos comunitaria para encontrar soluciones y comparte errores resueltos con otros desarrolladores.
|
|
17
19
|
|
|
18
20
|
## Características
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection (hook tool.execute.after)
|
|
115
117
|
├── Privacy Filter (redacta datos sensibles)
|
|
116
|
-
├── Local Storage (SQLite)
|
|
118
|
+
├── Local Storage (SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client (Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### Compatibilidad de Runtime
|
|
127
|
+
|
|
128
|
+
FixHive detecta automáticamente el entorno de ejecución y usa la implementación SQLite apropiada:
|
|
129
|
+
|
|
130
|
+
| Runtime | Implementación SQLite |
|
|
131
|
+
|---------|----------------------|
|
|
132
|
+
| Bun | `bun:sqlite` (nativo) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## Privacidad
|
|
125
136
|
|
|
126
137
|
FixHive filtra automáticamente información sensible:
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## Solución de Problemas
|
|
167
|
+
|
|
168
|
+
### Verificar que el Plugin Funciona
|
|
169
|
+
|
|
170
|
+
Cuando el plugin se carga correctamente, verá:
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Las 7 herramientas deberían estar disponibles:
|
|
180
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### El Plugin no se Carga
|
|
183
|
+
|
|
184
|
+
Si tiene una versión anterior en caché, limpie la caché y reinicie:
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## Licencia
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## Agradecimientos
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - Asistente de programación IA
|
|
197
|
+
- [Supabase](https://supabase.com) - Backend como Servicio
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - Búsqueda de similitud vectorial
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Enlaces SQLite rápidos (Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - Runtime JavaScript rápido con soporte SQLite nativo
|
|
201
|
+
|
|
159
202
|
## Contribuir
|
|
160
203
|
|
|
161
204
|
1. Hacer fork del repositorio
|
package/README.fr.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> Partage de Connaissances d'Erreurs Basé sur la Communauté pour OpenCode
|
|
15
15
|
|
|
16
|
+
**Dernière version : v0.1.29** - Correction des problèmes de compatibilité avec le runtime Bun. Le plugin fonctionne maintenant correctement avec OpenCode.
|
|
17
|
+
|
|
16
18
|
FixHive est un plugin OpenCode qui capture automatiquement les erreurs pendant les sessions de développement, interroge une base de connaissances communautaire pour trouver des solutions et partage les erreurs résolues avec d'autres développeurs.
|
|
17
19
|
|
|
18
20
|
## Fonctionnalités
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection (hook tool.execute.after)
|
|
115
117
|
├── Privacy Filter (supprime les données sensibles)
|
|
116
|
-
├── Local Storage (SQLite)
|
|
118
|
+
├── Local Storage (SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client (Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### Compatibilité Runtime
|
|
127
|
+
|
|
128
|
+
FixHive détecte automatiquement l'environnement d'exécution et utilise l'implémentation SQLite appropriée :
|
|
129
|
+
|
|
130
|
+
| Runtime | Implémentation SQLite |
|
|
131
|
+
|---------|----------------------|
|
|
132
|
+
| Bun | `bun:sqlite` (natif) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## Confidentialité
|
|
125
136
|
|
|
126
137
|
FixHive filtre automatiquement les informations sensibles :
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## Dépannage
|
|
167
|
+
|
|
168
|
+
### Vérifier le Fonctionnement du Plugin
|
|
169
|
+
|
|
170
|
+
Lorsque le plugin se charge avec succès, vous verrez :
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Les 7 outils devraient être disponibles :
|
|
180
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### Le Plugin ne se Charge Pas
|
|
183
|
+
|
|
184
|
+
Si vous avez une ancienne version en cache, videz le cache et redémarrez :
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## Licence
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## Remerciements
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - Assistant de programmation IA
|
|
197
|
+
- [Supabase](https://supabase.com) - Backend en tant que Service
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - Recherche de similarité vectorielle
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Liaisons SQLite rapides (Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - Runtime JavaScript rapide avec support SQLite natif
|
|
201
|
+
|
|
159
202
|
## Contribuer
|
|
160
203
|
|
|
161
204
|
1. Forker le dépôt
|
package/README.ja.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> OpenCode向けコミュニティベースのエラー知識共有システム
|
|
15
15
|
|
|
16
|
+
**最新版: v0.1.29** - Bunランタイム互換性の問題を修正。プラグインがOpenCodeで正常に動作するようになりました。
|
|
17
|
+
|
|
16
18
|
FixHiveは、開発セッション中にエラーを自動的にキャプチャし、コミュニティナレッジベースからソリューションを検索し、解決したエラーを他の開発者と共有するOpenCodeプラグインです。
|
|
17
19
|
|
|
18
20
|
## 機能
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection(tool.execute.afterフック)
|
|
115
117
|
├── Privacy Filter(機密データを除去)
|
|
116
|
-
├── Local Storage(SQLite)
|
|
118
|
+
├── Local Storage(SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client(Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### ランタイム互換性
|
|
127
|
+
|
|
128
|
+
FixHiveはランタイム環境を自動検出し、適切なSQLite実装を使用します:
|
|
129
|
+
|
|
130
|
+
| ランタイム | SQLite実装 |
|
|
131
|
+
|-----------|-----------|
|
|
132
|
+
| Bun | `bun:sqlite`(ネイティブ) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## プライバシー
|
|
125
136
|
|
|
126
137
|
FixHiveは機密情報を自動的にフィルタリングします:
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## トラブルシューティング
|
|
167
|
+
|
|
168
|
+
### プラグインの動作確認
|
|
169
|
+
|
|
170
|
+
プラグインが正常にロードされると、以下が表示されます:
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
7つのツールが利用可能になります:
|
|
180
|
+
- `fixhive_search`、`fixhive_resolve`、`fixhive_list`、`fixhive_vote`、`fixhive_report`、`fixhive_stats`、`fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### プラグインがロードされない
|
|
183
|
+
|
|
184
|
+
古いキャッシュバージョンがある場合は、キャッシュをクリアして再起動:
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## ライセンス
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## 謝辞
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - AIコーディングアシスタント
|
|
197
|
+
- [Supabase](https://supabase.com) - Backend as a Service
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - ベクトル類似度検索
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - 高速SQLiteバインディング(Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - ネイティブSQLiteをサポートする高速JavaScriptランタイム
|
|
201
|
+
|
|
159
202
|
## コントリビュート
|
|
160
203
|
|
|
161
204
|
1. リポジトリをフォーク
|
package/README.ko.md
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
> 커뮤니티 기반 오류 지식 공유 시스템 - OpenCode 플러그인
|
|
28
28
|
|
|
29
|
+
**최신: v0.1.29** - Bun 런타임 호환성 문제 해결. 플러그인이 OpenCode에서 정상 동작합니다.
|
|
30
|
+
|
|
29
31
|
FixHive는 개발 세션 중 발생하는 오류를 자동으로 감지하고, 커뮤니티 지식 베이스에서 해결책을 검색하며, 해결된 오류를 다른 개발자들과 공유하는 OpenCode 플러그인입니다.
|
|
30
32
|
|
|
31
33
|
## 주요 기능
|
|
@@ -311,17 +313,27 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
311
313
|
│ │ ├── privacy-filter.ts # 민감 데이터 마스킹
|
|
312
314
|
│ │ └── hash.ts # 핑거프린팅 & 중복 검사
|
|
313
315
|
│ ├── storage/
|
|
314
|
-
│ │ ├── local-store.ts # SQLite 로컬 저장소
|
|
316
|
+
│ │ ├── local-store.ts # SQLite 로컬 저장소 (Bun/Node.js)
|
|
315
317
|
│ │ └── migrations.ts # 데이터베이스 마이그레이션
|
|
316
318
|
│ ├── cloud/
|
|
317
319
|
│ │ ├── client.ts # Supabase 클라이언트
|
|
318
320
|
│ │ └── embedding.ts # OpenAI 임베딩
|
|
319
321
|
│ └── types/
|
|
320
|
-
│
|
|
322
|
+
│ ├── index.ts # TypeScript 정의
|
|
323
|
+
│ └── bun-sqlite.d.ts # Bun SQLite 타입 선언
|
|
321
324
|
└── scripts/
|
|
322
325
|
└── setup-supabase.sql # 클라우드 스키마
|
|
323
326
|
```
|
|
324
327
|
|
|
328
|
+
### 런타임 호환성
|
|
329
|
+
|
|
330
|
+
FixHive는 런타임 환경을 자동 감지하여 적절한 SQLite 구현체를 사용합니다:
|
|
331
|
+
|
|
332
|
+
| 런타임 | SQLite 구현체 |
|
|
333
|
+
|--------|--------------|
|
|
334
|
+
| Bun | `bun:sqlite` (네이티브) |
|
|
335
|
+
| Node.js | `better-sqlite3` |
|
|
336
|
+
|
|
325
337
|
## API 레퍼런스
|
|
326
338
|
|
|
327
339
|
### TypeScript 타입
|
|
@@ -391,6 +403,20 @@ const solutions = await cloud.searchSimilar({
|
|
|
391
403
|
|
|
392
404
|
## 문제 해결
|
|
393
405
|
|
|
406
|
+
### 플러그인 정상 동작 확인
|
|
407
|
+
|
|
408
|
+
플러그인이 정상 로드되면 다음 로그가 출력됩니다:
|
|
409
|
+
```
|
|
410
|
+
[FixHive] Plugin loaded
|
|
411
|
+
[FixHive] Project: /your/project/path
|
|
412
|
+
[FixHive] Cloud: enabled
|
|
413
|
+
[FixHive] Detected: typescript
|
|
414
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
7개의 도구가 사용 가능해야 합니다:
|
|
418
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
419
|
+
|
|
394
420
|
### 플러그인이 로드되지 않음
|
|
395
421
|
|
|
396
422
|
OpenCode v1.1.1 이상인지 확인:
|
|
@@ -398,6 +424,12 @@ OpenCode v1.1.1 이상인지 확인:
|
|
|
398
424
|
npm list @opencode-ai/plugin
|
|
399
425
|
```
|
|
400
426
|
|
|
427
|
+
오래된 캐시 버전이 있다면 캐시를 삭제하고 재시작:
|
|
428
|
+
```bash
|
|
429
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
430
|
+
opencode
|
|
431
|
+
```
|
|
432
|
+
|
|
401
433
|
### 솔루션을 찾을 수 없음
|
|
402
434
|
|
|
403
435
|
1. 시맨틱 검색을 위해 `OPENAI_API_KEY`가 설정되어 있는지 확인
|
|
@@ -483,4 +515,5 @@ MIT - 자세한 내용은 [LICENSE](LICENSE)를 참조하세요.
|
|
|
483
515
|
- [OpenCode](https://github.com/opencode-ai/opencode) - AI 코딩 어시스턴트
|
|
484
516
|
- [Supabase](https://supabase.com) - Backend as a Service
|
|
485
517
|
- [pgvector](https://github.com/pgvector/pgvector) - 벡터 유사도 검색
|
|
486
|
-
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - 빠른 SQLite 바인딩
|
|
518
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - 빠른 SQLite 바인딩 (Node.js)
|
|
519
|
+
- [Bun](https://bun.sh) - 네이티브 SQLite 지원 빠른 JavaScript 런타임
|
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
> Community-based Error Knowledge Sharing for OpenCode
|
|
28
28
|
|
|
29
|
+
**Latest: v0.1.29** - Bun runtime compatibility fixed. Plugin now works correctly with OpenCode.
|
|
30
|
+
|
|
29
31
|
FixHive is an OpenCode plugin that automatically captures errors during development sessions, queries a community knowledge base for solutions, and shares resolved errors with other developers.
|
|
30
32
|
|
|
31
33
|
## Features
|
|
@@ -311,17 +313,27 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
311
313
|
│ │ ├── privacy-filter.ts # Sensitive data redaction
|
|
312
314
|
│ │ └── hash.ts # Fingerprinting & deduplication
|
|
313
315
|
│ ├── storage/
|
|
314
|
-
│ │ ├── local-store.ts # SQLite local storage
|
|
316
|
+
│ │ ├── local-store.ts # SQLite local storage (Bun/Node.js)
|
|
315
317
|
│ │ └── migrations.ts # Database migrations
|
|
316
318
|
│ ├── cloud/
|
|
317
319
|
│ │ ├── client.ts # Supabase client
|
|
318
320
|
│ │ └── embedding.ts # OpenAI embeddings
|
|
319
321
|
│ └── types/
|
|
320
|
-
│
|
|
322
|
+
│ ├── index.ts # TypeScript definitions
|
|
323
|
+
│ └── bun-sqlite.d.ts # Bun SQLite type declarations
|
|
321
324
|
└── scripts/
|
|
322
325
|
└── setup-supabase.sql # Cloud schema
|
|
323
326
|
```
|
|
324
327
|
|
|
328
|
+
### Runtime Compatibility
|
|
329
|
+
|
|
330
|
+
FixHive automatically detects the runtime environment and uses the appropriate SQLite implementation:
|
|
331
|
+
|
|
332
|
+
| Runtime | SQLite Implementation |
|
|
333
|
+
|---------|----------------------|
|
|
334
|
+
| Bun | `bun:sqlite` (native) |
|
|
335
|
+
| Node.js | `better-sqlite3` |
|
|
336
|
+
|
|
325
337
|
## API Reference
|
|
326
338
|
|
|
327
339
|
### TypeScript Types
|
|
@@ -391,6 +403,20 @@ const solutions = await cloud.searchSimilar({
|
|
|
391
403
|
|
|
392
404
|
## Troubleshooting
|
|
393
405
|
|
|
406
|
+
### Verify Plugin is Working
|
|
407
|
+
|
|
408
|
+
When the plugin loads successfully, you'll see:
|
|
409
|
+
```
|
|
410
|
+
[FixHive] Plugin loaded
|
|
411
|
+
[FixHive] Project: /your/project/path
|
|
412
|
+
[FixHive] Cloud: enabled
|
|
413
|
+
[FixHive] Detected: typescript
|
|
414
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
All 7 tools should be available:
|
|
418
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
419
|
+
|
|
394
420
|
### Plugin not loading
|
|
395
421
|
|
|
396
422
|
Make sure you're using OpenCode v1.1.1 or later:
|
|
@@ -398,6 +424,12 @@ Make sure you're using OpenCode v1.1.1 or later:
|
|
|
398
424
|
npm list @opencode-ai/plugin
|
|
399
425
|
```
|
|
400
426
|
|
|
427
|
+
If you have an old cached version, clear the cache and restart:
|
|
428
|
+
```bash
|
|
429
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
430
|
+
opencode
|
|
431
|
+
```
|
|
432
|
+
|
|
401
433
|
### No solutions found
|
|
402
434
|
|
|
403
435
|
1. Check if you have `OPENAI_API_KEY` set for semantic search
|
|
@@ -483,4 +515,5 @@ MIT - see [LICENSE](LICENSE) for details.
|
|
|
483
515
|
- [OpenCode](https://github.com/opencode-ai/opencode) - AI coding assistant
|
|
484
516
|
- [Supabase](https://supabase.com) - Backend as a Service
|
|
485
517
|
- [pgvector](https://github.com/pgvector/pgvector) - Vector similarity search
|
|
486
|
-
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings
|
|
518
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings (Node.js)
|
|
519
|
+
- [Bun](https://bun.sh) - Fast JavaScript runtime with native SQLite support
|
package/README.nl.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> Community-gebaseerd Foutkennis Delen voor OpenCode
|
|
15
15
|
|
|
16
|
+
**Laatste versie: v0.1.29** - Bun runtime compatibiliteitsproblemen opgelost. Plugin werkt nu correct met OpenCode.
|
|
17
|
+
|
|
16
18
|
FixHive is een OpenCode-plugin die automatisch fouten vastlegt tijdens ontwikkelsessies, een community-kennisbank raadpleegt voor oplossingen en opgeloste fouten deelt met andere ontwikkelaars.
|
|
17
19
|
|
|
18
20
|
## Functies
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection (tool.execute.after hook)
|
|
115
117
|
├── Privacy Filter (verwijdert gevoelige gegevens)
|
|
116
|
-
├── Local Storage (SQLite)
|
|
118
|
+
├── Local Storage (SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client (Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### Runtime Compatibiliteit
|
|
127
|
+
|
|
128
|
+
FixHive detecteert automatisch de runtime-omgeving en gebruikt de juiste SQLite-implementatie:
|
|
129
|
+
|
|
130
|
+
| Runtime | SQLite Implementatie |
|
|
131
|
+
|---------|---------------------|
|
|
132
|
+
| Bun | `bun:sqlite` (natief) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## Privacy
|
|
125
136
|
|
|
126
137
|
FixHive filtert automatisch gevoelige informatie:
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## Probleemoplossing
|
|
167
|
+
|
|
168
|
+
### Controleer of Plugin Werkt
|
|
169
|
+
|
|
170
|
+
Wanneer de plugin succesvol laadt, ziet u:
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Alle 7 tools moeten beschikbaar zijn:
|
|
180
|
+
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### Plugin Laadt Niet
|
|
183
|
+
|
|
184
|
+
Als u een oude gecachte versie hebt, wis de cache en herstart:
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## Licentie
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## Dankbetuigingen
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - AI-programmeerassistent
|
|
197
|
+
- [Supabase](https://supabase.com) - Backend as a Service
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - Vector-gelijkenis zoeken
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Snelle SQLite-bindingen (Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - Snelle JavaScript-runtime met native SQLite-ondersteuning
|
|
201
|
+
|
|
159
202
|
## Bijdragen
|
|
160
203
|
|
|
161
204
|
1. Fork de repository
|
package/README.zh.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> OpenCode 社区错误知识共享系统
|
|
15
15
|
|
|
16
|
+
**最新版本: v0.1.29** - 修复 Bun 运行时兼容性问题。插件现已在 OpenCode 中正常运行。
|
|
17
|
+
|
|
16
18
|
FixHive 是一个 OpenCode 插件,可在开发会话期间自动捕获错误,从社区知识库查询解决方案,并与其他开发者共享已解决的错误。
|
|
17
19
|
|
|
18
20
|
## 功能特性
|
|
@@ -113,7 +115,7 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
113
115
|
FixHive Plugin
|
|
114
116
|
├── Error Detection(tool.execute.after 钩子)
|
|
115
117
|
├── Privacy Filter(过滤敏感数据)
|
|
116
|
-
├── Local Storage(SQLite)
|
|
118
|
+
├── Local Storage(SQLite - Bun/Node.js)
|
|
117
119
|
│ ├── error_records
|
|
118
120
|
│ └── query_cache
|
|
119
121
|
└── Cloud Client(Supabase + pgvector)
|
|
@@ -121,6 +123,15 @@ FixHive Plugin
|
|
|
121
123
|
└── usage_logs
|
|
122
124
|
```
|
|
123
125
|
|
|
126
|
+
### 运行时兼容性
|
|
127
|
+
|
|
128
|
+
FixHive 自动检测运行时环境并使用相应的 SQLite 实现:
|
|
129
|
+
|
|
130
|
+
| 运行时 | SQLite 实现 |
|
|
131
|
+
|--------|------------|
|
|
132
|
+
| Bun | `bun:sqlite`(原生) |
|
|
133
|
+
| Node.js | `better-sqlite3` |
|
|
134
|
+
|
|
124
135
|
## 隐私保护
|
|
125
136
|
|
|
126
137
|
FixHive 自动过滤敏感信息:
|
|
@@ -152,10 +163,42 @@ npm run typecheck
|
|
|
152
163
|
npm test
|
|
153
164
|
```
|
|
154
165
|
|
|
166
|
+
## 故障排除
|
|
167
|
+
|
|
168
|
+
### 验证插件正常运行
|
|
169
|
+
|
|
170
|
+
插件成功加载时,您将看到:
|
|
171
|
+
```
|
|
172
|
+
[FixHive] Plugin loaded
|
|
173
|
+
[FixHive] Project: /your/project/path
|
|
174
|
+
[FixHive] Cloud: enabled
|
|
175
|
+
[FixHive] Detected: typescript
|
|
176
|
+
[FixHive] Ready - use fixhive_stats to verify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
所有 7 个工具应该可用:
|
|
180
|
+
- `fixhive_search`、`fixhive_resolve`、`fixhive_list`、`fixhive_vote`、`fixhive_report`、`fixhive_stats`、`fixhive_helpful`
|
|
181
|
+
|
|
182
|
+
### 插件无法加载
|
|
183
|
+
|
|
184
|
+
如果有旧的缓存版本,清除缓存并重启:
|
|
185
|
+
```bash
|
|
186
|
+
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
187
|
+
opencode
|
|
188
|
+
```
|
|
189
|
+
|
|
155
190
|
## 许可证
|
|
156
191
|
|
|
157
192
|
MIT
|
|
158
193
|
|
|
194
|
+
## 致谢
|
|
195
|
+
|
|
196
|
+
- [OpenCode](https://github.com/opencode-ai/opencode) - AI 编程助手
|
|
197
|
+
- [Supabase](https://supabase.com) - 后端即服务
|
|
198
|
+
- [pgvector](https://github.com/pgvector/pgvector) - 向量相似度搜索
|
|
199
|
+
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - 快速 SQLite 绑定(Node.js)
|
|
200
|
+
- [Bun](https://bun.sh) - 支持原生 SQLite 的快速 JavaScript 运行时
|
|
201
|
+
|
|
159
202
|
## 贡献
|
|
160
203
|
|
|
161
204
|
1. Fork 仓库
|
package/dist/index.js
CHANGED
|
@@ -27277,9 +27277,6 @@ ${toolOutput.stderr || ""}`;
|
|
|
27277
27277
|
}
|
|
27278
27278
|
var defaultErrorDetector = createErrorDetector();
|
|
27279
27279
|
|
|
27280
|
-
// src/storage/local-store.ts
|
|
27281
|
-
import Database from "better-sqlite3";
|
|
27282
|
-
|
|
27283
27280
|
// node_modules/uuid/dist-node/stringify.js
|
|
27284
27281
|
var byteToHex = [];
|
|
27285
27282
|
for (let i = 0;i < 256; ++i) {
|
|
@@ -27455,6 +27452,46 @@ var MIGRATIONS = [
|
|
|
27455
27452
|
];
|
|
27456
27453
|
|
|
27457
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
|
+
}
|
|
27458
27495
|
var ALLOWED_STATS = [
|
|
27459
27496
|
"total_errors",
|
|
27460
27497
|
"resolved_errors",
|
|
@@ -27482,15 +27519,15 @@ function rowToRecord(row) {
|
|
|
27482
27519
|
cloudKnowledgeId: row.cloud_knowledge_id || undefined
|
|
27483
27520
|
};
|
|
27484
27521
|
}
|
|
27485
|
-
function createLocalStore(projectDirectory) {
|
|
27522
|
+
async function createLocalStore(projectDirectory) {
|
|
27486
27523
|
const dbPath = `${projectDirectory}/.fixhive/fixhive.db`;
|
|
27487
27524
|
const dir = dirname(dbPath);
|
|
27488
27525
|
if (!existsSync(dir)) {
|
|
27489
27526
|
mkdirSync(dir, { recursive: true });
|
|
27490
27527
|
}
|
|
27491
|
-
const db =
|
|
27492
|
-
db.
|
|
27493
|
-
db.
|
|
27528
|
+
const db = await createDatabase(dbPath);
|
|
27529
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
27530
|
+
db.exec("PRAGMA foreign_keys = ON");
|
|
27494
27531
|
runMigrations(db);
|
|
27495
27532
|
function incrementStat(stat) {
|
|
27496
27533
|
if (!ALLOWED_STATS.includes(stat)) {
|
|
@@ -27499,6 +27536,26 @@ function createLocalStore(projectDirectory) {
|
|
|
27499
27536
|
const stmt = db.prepare(`UPDATE usage_stats SET ${stat} = ${stat} + 1 WHERE id = 1`);
|
|
27500
27537
|
stmt.run();
|
|
27501
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
|
+
}
|
|
27502
27559
|
return {
|
|
27503
27560
|
createErrorRecord(data) {
|
|
27504
27561
|
const id = v4_default();
|
|
@@ -27507,48 +27564,16 @@ function createLocalStore(projectDirectory) {
|
|
|
27507
27564
|
INSERT INTO error_records (
|
|
27508
27565
|
id, error_hash, error_type, error_message, error_stack,
|
|
27509
27566
|
language, framework, tool_name, tool_input, session_id, status
|
|
27510
|
-
) VALUES (
|
|
27511
|
-
@id, @errorHash, @errorType, @errorMessage, @errorStack,
|
|
27512
|
-
@language, @framework, @toolName, @toolInput, @sessionId, 'unresolved'
|
|
27513
|
-
)
|
|
27567
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'unresolved')
|
|
27514
27568
|
`);
|
|
27515
|
-
stmt.run(
|
|
27516
|
-
id,
|
|
27517
|
-
errorHash,
|
|
27518
|
-
errorType: data.errorType,
|
|
27519
|
-
errorMessage: data.errorMessage,
|
|
27520
|
-
errorStack: data.errorStack || null,
|
|
27521
|
-
language: data.language || null,
|
|
27522
|
-
framework: data.framework || null,
|
|
27523
|
-
toolName: data.toolName,
|
|
27524
|
-
toolInput: JSON.stringify(data.toolInput),
|
|
27525
|
-
sessionId: data.sessionId
|
|
27526
|
-
});
|
|
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);
|
|
27527
27570
|
incrementStat("total_errors");
|
|
27528
|
-
return
|
|
27529
|
-
},
|
|
27530
|
-
getErrorById(id) {
|
|
27531
|
-
const stmt = db.prepare("SELECT * FROM error_records WHERE id = ?");
|
|
27532
|
-
const row = stmt.get(id);
|
|
27533
|
-
return row ? rowToRecord(row) : null;
|
|
27534
|
-
},
|
|
27535
|
-
getSessionErrors(sessionId, options) {
|
|
27536
|
-
let query = "SELECT * FROM error_records WHERE session_id = ?";
|
|
27537
|
-
const params = [sessionId];
|
|
27538
|
-
if (options?.status) {
|
|
27539
|
-
query += " AND status = ?";
|
|
27540
|
-
params.push(options.status);
|
|
27541
|
-
}
|
|
27542
|
-
query += " ORDER BY created_at DESC";
|
|
27543
|
-
if (options?.limit) {
|
|
27544
|
-
query += " LIMIT ?";
|
|
27545
|
-
params.push(options.limit);
|
|
27546
|
-
}
|
|
27547
|
-
const stmt = db.prepare(query);
|
|
27548
|
-
return stmt.all(...params).map((row) => rowToRecord(row));
|
|
27571
|
+
return getErrorById(id);
|
|
27549
27572
|
},
|
|
27573
|
+
getErrorById,
|
|
27574
|
+
getSessionErrors,
|
|
27550
27575
|
getUnresolvedErrors(sessionId) {
|
|
27551
|
-
return
|
|
27576
|
+
return getSessionErrors(sessionId, { status: "unresolved" });
|
|
27552
27577
|
},
|
|
27553
27578
|
getRecentErrors(limit = 10) {
|
|
27554
27579
|
const stmt = db.prepare("SELECT * FROM error_records ORDER BY created_at DESC LIMIT ?");
|
|
@@ -27566,7 +27591,7 @@ function createLocalStore(projectDirectory) {
|
|
|
27566
27591
|
const result = stmt.run(data.resolution, data.resolutionCode || null, id);
|
|
27567
27592
|
if (result.changes > 0) {
|
|
27568
27593
|
incrementStat("resolved_errors");
|
|
27569
|
-
return
|
|
27594
|
+
return getErrorById(id);
|
|
27570
27595
|
}
|
|
27571
27596
|
return null;
|
|
27572
27597
|
},
|
|
@@ -28172,7 +28197,7 @@ var FixHivePlugin = async (ctx) => {
|
|
|
28172
28197
|
console.log("[FixHive:DEBUG] Step 5: Creating error detector");
|
|
28173
28198
|
const errorDetector = createErrorDetector(privacyFilter);
|
|
28174
28199
|
console.log("[FixHive:DEBUG] Step 6: Creating local store");
|
|
28175
|
-
const localStore = createLocalStore(ctx.directory);
|
|
28200
|
+
const localStore = await createLocalStore(ctx.directory);
|
|
28176
28201
|
console.log("[FixHive:DEBUG] Step 7: Local store created");
|
|
28177
28202
|
let cloudClient = null;
|
|
28178
28203
|
if (config2.supabaseUrl && config2.supabaseAnonKey) {
|
|
@@ -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():
|
|
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
|
|
1
|
+
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../../src/storage/local-store.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAU3B;;GAEG;AACH,UAAU,eAAe;IACvB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACvC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,UAAU,gBAAgB;IACxB,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC/D,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACtD;AA2DD;;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,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACzG,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;IACzD,gBAAgB,CAAC,SAAS,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
|
-
|
|
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:
|
|
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,
|
|
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"}
|