@the-magic-tower/fixhive-opencode-plugin 0.1.33 → 0.2.0-beta.1
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 +1 -1
- package/README.es.md +1 -1
- package/README.fr.md +1 -1
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +112 -256
- package/README.nl.md +1 -1
- package/README.zh.md +1 -1
- package/dist/index.d.ts +5 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8027 -14072
- package/dist/plugin/index.d.ts +2 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/tools.d.ts +17 -7
- package/dist/plugin/tools.d.ts.map +1 -1
- package/package.json +5 -7
- package/dist/cloud/client.d.ts +0 -44
- package/dist/cloud/client.d.ts.map +0 -1
- package/dist/cloud/embedding.d.ts +0 -43
- package/dist/cloud/embedding.d.ts.map +0 -1
- package/dist/core/error-detector.d.ts +0 -26
- package/dist/core/error-detector.d.ts.map +0 -1
- package/dist/core/hash.d.ts +0 -41
- package/dist/core/hash.d.ts.map +0 -1
- package/dist/core/privacy-filter.d.ts +0 -33
- package/dist/core/privacy-filter.d.ts.map +0 -1
- package/dist/storage/local-store.d.ts +0 -63
- package/dist/storage/local-store.d.ts.map +0 -1
- package/dist/storage/migrations.d.ts +0 -23
- package/dist/storage/migrations.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -218
- package/dist/types/index.d.ts.map +0 -1
package/README.de.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
> Community-basiertes Fehlerwissen-Sharing für OpenCode
|
|
15
15
|
|
|
16
|
-
**Neueste Version: v0.1.
|
|
16
|
+
**Neueste Version: v0.1.34** - Bun-Runtime-Kompatibilitätsprobleme behoben. Das Plugin funktioniert jetzt korrekt mit OpenCode.
|
|
17
17
|
|
|
18
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.
|
|
19
19
|
|
package/README.es.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
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.
|
|
16
|
+
**Última versión: v0.1.34** - Corregidos problemas de compatibilidad con Bun runtime. El plugin ahora funciona correctamente con OpenCode.
|
|
17
17
|
|
|
18
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.
|
|
19
19
|
|
package/README.fr.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
> Partage de Connaissances d'Erreurs Basé sur la Communauté pour OpenCode
|
|
15
15
|
|
|
16
|
-
**Dernière version : v0.1.
|
|
16
|
+
**Dernière version : v0.1.34** - Correction des problèmes de compatibilité avec le runtime Bun. Le plugin fonctionne maintenant correctement avec OpenCode.
|
|
17
17
|
|
|
18
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.
|
|
19
19
|
|
package/README.ja.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
> OpenCode向けコミュニティベースのエラー知識共有システム
|
|
15
15
|
|
|
16
|
-
**最新版: v0.1.
|
|
16
|
+
**最新版: v0.1.34** - Bunランタイム互換性の問題を修正。プラグインがOpenCodeで正常に動作するようになりました。
|
|
17
17
|
|
|
18
18
|
FixHiveは、開発セッション中にエラーを自動的にキャプチャし、コミュニティナレッジベースからソリューションを検索し、解決したエラーを他の開発者と共有するOpenCodeプラグインです。
|
|
19
19
|
|
package/README.ko.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
> 커뮤니티 기반 오류 지식 공유 시스템 - OpenCode 플러그인
|
|
28
28
|
|
|
29
|
-
**최신: v0.1.
|
|
29
|
+
**최신: v0.1.34** - 이미 해결된 에러 재업로드 문제 해결.
|
|
30
30
|
|
|
31
31
|
FixHive는 개발 세션 중 발생하는 오류를 자동으로 감지하고, 커뮤니티 지식 베이스에서 해결책을 검색하며, 해결된 오류를 다른 개발자들과 공유하는 OpenCode 플러그인입니다.
|
|
32
32
|
|
package/README.md
CHANGED
|
@@ -21,12 +21,10 @@
|
|
|
21
21
|
<a href="https://opensource.org/licenses/MIT">
|
|
22
22
|
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
|
|
23
23
|
</a>
|
|
24
|
-
<img src="https://img.shields.io/badge/Node.js-
|
|
24
|
+
<img src="https://img.shields.io/badge/Node.js-20%20%7C%2022-green" alt="Node.js Version">
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
|
-
> Community-based Error Knowledge Sharing for OpenCode
|
|
28
|
-
|
|
29
|
-
**Latest: v0.1.31** - Bun runtime compatibility fixed. Plugin now works correctly with OpenCode.
|
|
27
|
+
> Community-based Error Knowledge Sharing for OpenCode (CodeCaseDB v2.0)
|
|
30
28
|
|
|
31
29
|
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.
|
|
32
30
|
|
|
@@ -34,10 +32,32 @@ FixHive is an OpenCode plugin that automatically captures errors during developm
|
|
|
34
32
|
|
|
35
33
|
- **Auto Error Detection**: Automatically detects errors from tool outputs (bash, edit, etc.)
|
|
36
34
|
- **Cloud Knowledge Base**: Search community solutions using semantic similarity (pgvector)
|
|
37
|
-
- **
|
|
35
|
+
- **AI-Guided Normalization**: Normalize error signatures for better matching
|
|
36
|
+
- **Environment Matching**: Solutions ranked by language, framework, and package compatibility
|
|
38
37
|
- **Privacy Filtering**: Automatically redacts sensitive data (API keys, paths, emails)
|
|
39
|
-
- **
|
|
40
|
-
|
|
38
|
+
- **Community Voting**: Upvote/downvote solutions to help identify the best fixes
|
|
39
|
+
|
|
40
|
+
## Upgrading from v1.x
|
|
41
|
+
|
|
42
|
+
If you're upgrading from v1.x, please read the [Migration Guide](MIGRATION.md) for important changes:
|
|
43
|
+
|
|
44
|
+
- **Tool names changed**: `fixhive_search` → `fixhive_search_cases`, etc.
|
|
45
|
+
- **Local storage removed**: No more `.fixhive/` directory
|
|
46
|
+
- **Automatic device ID**: No need to set `FIXHIVE_CONTRIBUTOR_ID`
|
|
47
|
+
- **Environment matching**: Better solution ranking based on your stack
|
|
48
|
+
|
|
49
|
+
Quick upgrade:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Update package
|
|
53
|
+
npm install @the-magic-tower/fixhive-opencode-plugin@latest
|
|
54
|
+
|
|
55
|
+
# Clean old data (optional)
|
|
56
|
+
rm -rf .fixhive/
|
|
57
|
+
|
|
58
|
+
# Remove old env vars (optional)
|
|
59
|
+
# FIXHIVE_CONTRIBUTOR_ID and OPENAI_API_KEY are no longer needed
|
|
60
|
+
```
|
|
41
61
|
|
|
42
62
|
## Installation
|
|
43
63
|
|
|
@@ -73,32 +93,32 @@ opencode
|
|
|
73
93
|
|
|
74
94
|
You'll see these logs when the plugin loads successfully:
|
|
75
95
|
```
|
|
96
|
+
[FixHive] Starting plugin initialization (CodeCaseDB v2.0)
|
|
76
97
|
[FixHive] Plugin loaded
|
|
77
98
|
[FixHive] Project: /your/project/path
|
|
78
99
|
[FixHive] Cloud: enabled
|
|
79
|
-
[FixHive]
|
|
100
|
+
[FixHive] Device: abc12345...
|
|
101
|
+
[FixHive] Ready - use fixhive_search_cases to find solutions
|
|
80
102
|
```
|
|
81
103
|
|
|
82
104
|
## How It Works
|
|
83
105
|
|
|
84
106
|
```
|
|
85
107
|
┌─────────────────────────────────────────────────────────────────┐
|
|
86
|
-
│
|
|
108
|
+
│ FixHive Flow (v2.0) │
|
|
87
109
|
├─────────────────────────────────────────────────────────────────┤
|
|
88
110
|
│ │
|
|
89
111
|
│ 1. Error Occurs │
|
|
90
112
|
│ ↓ │
|
|
91
|
-
│ 2.
|
|
113
|
+
│ 2. AI Normalizes Error Signature │
|
|
92
114
|
│ ↓ │
|
|
93
|
-
│ 3.
|
|
115
|
+
│ 3. Cloud Search (Supabase + pgvector) │
|
|
94
116
|
│ ↓ │
|
|
95
|
-
│ 4.
|
|
117
|
+
│ 4. Environment Matching (language, framework, packages) │
|
|
96
118
|
│ ↓ │
|
|
97
|
-
│ 5.
|
|
119
|
+
│ 5. Display Ranked Solutions (similarity + votes) │
|
|
98
120
|
│ ↓ │
|
|
99
|
-
│ 6.
|
|
100
|
-
│ ↓ │
|
|
101
|
-
│ 7. Resolution → Upload to Community │
|
|
121
|
+
│ 6. Resolution → Upload to Community │
|
|
102
122
|
│ │
|
|
103
123
|
└─────────────────────────────────────────────────────────────────┘
|
|
104
124
|
```
|
|
@@ -111,130 +131,96 @@ Environment variables to customize behavior:
|
|
|
111
131
|
# Use your own Supabase instance instead of community
|
|
112
132
|
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
113
133
|
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
114
|
-
|
|
115
|
-
# Enable semantic search (recommended)
|
|
116
|
-
OPENAI_API_KEY=sk-...
|
|
117
|
-
|
|
118
|
-
# Custom contributor ID (auto-generated if not set)
|
|
119
|
-
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
120
134
|
```
|
|
121
135
|
|
|
122
136
|
| Variable | Default | Description |
|
|
123
137
|
|----------|---------|-------------|
|
|
124
138
|
| `FIXHIVE_SUPABASE_URL` | Community DB | Your Supabase project URL |
|
|
125
139
|
| `FIXHIVE_SUPABASE_KEY` | Community Key | Your Supabase anon key |
|
|
126
|
-
| `OPENAI_API_KEY` | None | Enables semantic similarity search |
|
|
127
|
-
| `FIXHIVE_CONTRIBUTOR_ID` | Auto-generated | Your unique contributor ID |
|
|
128
140
|
|
|
129
141
|
## Available Tools
|
|
130
142
|
|
|
131
|
-
### `
|
|
143
|
+
### `fixhive_search_cases`
|
|
132
144
|
|
|
133
145
|
Search the knowledge base for error solutions.
|
|
134
146
|
|
|
135
147
|
```typescript
|
|
136
148
|
// Arguments
|
|
137
149
|
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
150
|
+
error_message: string; // Required: The error message to search for
|
|
151
|
+
error_signature?: string; // Optional: Normalized signature with placeholders
|
|
152
|
+
language?: string; // Optional: Programming language (typescript, python, etc.)
|
|
153
|
+
framework?: string; // Optional: Framework (react, nextjs, express, etc.)
|
|
154
|
+
packages?: object; // Optional: Key dependencies with versions
|
|
155
|
+
limit?: number; // Optional: Maximum results (default: 5)
|
|
142
156
|
}
|
|
143
157
|
```
|
|
144
158
|
|
|
145
159
|
**Example:**
|
|
146
160
|
```
|
|
147
|
-
|
|
161
|
+
fixhive_search_cases error_message="Cannot find module 'react'" language="typescript" framework="nextjs"
|
|
148
162
|
```
|
|
149
163
|
|
|
150
|
-
### `
|
|
164
|
+
### `fixhive_report_resolution`
|
|
151
165
|
|
|
152
|
-
|
|
166
|
+
Report an error resolution to the community.
|
|
153
167
|
|
|
154
168
|
```typescript
|
|
155
169
|
// Arguments
|
|
156
170
|
{
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
171
|
+
error_message: string; // Required: Original error message
|
|
172
|
+
error_signature: string; // Required: Normalized signature
|
|
173
|
+
solution?: string; // Optional: How the error was resolved
|
|
174
|
+
cause?: string; // Optional: Root cause of the error
|
|
175
|
+
solution_steps?: string[]; // Optional: Step-by-step resolution
|
|
176
|
+
code_diff?: string; // Optional: Code changes that fixed the issue
|
|
177
|
+
language?: string; // Optional: Programming language
|
|
178
|
+
framework?: string; // Optional: Framework
|
|
179
|
+
packages?: object; // Optional: Key dependencies
|
|
180
|
+
used_variant_id?: string; // Optional: If existing solution helped
|
|
161
181
|
}
|
|
162
182
|
```
|
|
163
183
|
|
|
164
184
|
**Example:**
|
|
165
185
|
```
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### `fixhive_list`
|
|
170
|
-
|
|
171
|
-
List errors detected in the current session.
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
// Arguments
|
|
175
|
-
{
|
|
176
|
-
status?: 'unresolved' | 'resolved' | 'uploaded'; // Optional: Filter by status
|
|
177
|
-
limit?: number; // Optional: Maximum results (default: 10)
|
|
178
|
-
}
|
|
186
|
+
fixhive_report_resolution error_message="Cannot find module 'react'" error_signature="Cannot find module '{module}'" solution="Added dependency to package.json"
|
|
179
187
|
```
|
|
180
188
|
|
|
181
189
|
### `fixhive_vote`
|
|
182
190
|
|
|
183
|
-
|
|
191
|
+
Vote on a solution's quality.
|
|
184
192
|
|
|
185
193
|
```typescript
|
|
186
194
|
// Arguments
|
|
187
195
|
{
|
|
188
|
-
|
|
189
|
-
|
|
196
|
+
variant_id: string; // Required: The variant ID to vote on
|
|
197
|
+
value: 'up' | 'down' | 'report'; // Required: Vote type
|
|
198
|
+
reason?: string; // Required when reporting: Explain why
|
|
190
199
|
}
|
|
191
200
|
```
|
|
192
201
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
View usage statistics.
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
// No arguments required
|
|
202
|
+
**Example:**
|
|
199
203
|
```
|
|
200
|
-
|
|
201
|
-
**Output:**
|
|
202
|
-
```markdown
|
|
203
|
-
## FixHive Statistics
|
|
204
|
-
|
|
205
|
-
### Local
|
|
206
|
-
- Errors recorded: 42
|
|
207
|
-
- Resolved: 38
|
|
208
|
-
- Uploaded: 25
|
|
209
|
-
|
|
210
|
-
### Community Contributions
|
|
211
|
-
- Solutions shared: 25
|
|
212
|
-
- Times your solutions helped: 156
|
|
213
|
-
- Total upvotes received: 89
|
|
204
|
+
fixhive_vote variant_id="abc123" value="up"
|
|
214
205
|
```
|
|
215
206
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
Report that a solution was helpful.
|
|
219
|
-
|
|
220
|
-
```typescript
|
|
221
|
-
// Arguments
|
|
222
|
-
{
|
|
223
|
-
knowledgeId: string; // Required: Knowledge entry ID that helped
|
|
224
|
-
}
|
|
225
|
-
```
|
|
207
|
+
## Error Signature Normalization
|
|
226
208
|
|
|
227
|
-
|
|
209
|
+
When searching or reporting errors, normalize the message by replacing variable parts with placeholders:
|
|
228
210
|
|
|
229
|
-
|
|
211
|
+
| Target | Placeholder | Example |
|
|
212
|
+
|--------|-------------|---------|
|
|
213
|
+
| Class names | `{class}` | `UserController` → `{class}` |
|
|
214
|
+
| File names | `{file}` | `index.ts:42` → `{file}:{id}` |
|
|
215
|
+
| Numeric IDs | `{id}` | `user_id: 12345` → `user_id: {id}` |
|
|
216
|
+
| UUIDs | `{uuid}` | `550e8400-e29b-...` → `{uuid}` |
|
|
217
|
+
| Timestamps | `{timestamp}` | `2024-01-15T10:30:00Z` → `{timestamp}` |
|
|
218
|
+
| File paths | `{path}` | `/home/user/project/` → `{path}` |
|
|
219
|
+
| DB identifiers | `{table}.{column}` | `users.email` → `{table}.{column}` |
|
|
220
|
+
| Routes | `{route}` | `/api/users/123` → `{route}` |
|
|
221
|
+
| Views | `{view}` | `admin.users.index` → `{view}` |
|
|
230
222
|
|
|
231
|
-
|
|
232
|
-
// Arguments
|
|
233
|
-
{
|
|
234
|
-
knowledgeId: string; // Required: Knowledge entry ID to report
|
|
235
|
-
reason?: string; // Optional: Reason for reporting
|
|
236
|
-
}
|
|
237
|
-
```
|
|
223
|
+
**Keep unchanged**: Framework classes, error codes (`SQLSTATE`, `TypeError`), package names
|
|
238
224
|
|
|
239
225
|
## Example Workflow
|
|
240
226
|
|
|
@@ -243,19 +229,16 @@ Report inappropriate content.
|
|
|
243
229
|
$ npm run build
|
|
244
230
|
> error TS2307: Cannot find module '@/components/Button'
|
|
245
231
|
|
|
246
|
-
2.
|
|
247
|
-
|
|
248
|
-
- Records it locally
|
|
249
|
-
- Searches for solutions
|
|
250
|
-
- Displays matching community solutions
|
|
232
|
+
2. Search for solutions
|
|
233
|
+
fixhive_search_cases error_message="error TS2307: Cannot find module '@/components/Button'" error_signature="error TS2307: Cannot find module '{path}'" language="typescript" framework="nextjs"
|
|
251
234
|
|
|
252
|
-
3. Apply the
|
|
253
|
-
$ npm install @/components/Button --save
|
|
235
|
+
3. Apply the top-ranked solution
|
|
254
236
|
|
|
255
|
-
4.
|
|
256
|
-
|
|
237
|
+
4. Report your resolution
|
|
238
|
+
fixhive_report_resolution error_message="..." error_signature="error TS2307: Cannot find module '{path}'" solution="Added path alias in tsconfig.json"
|
|
257
239
|
|
|
258
|
-
5.
|
|
240
|
+
5. Vote on solutions that helped
|
|
241
|
+
fixhive_vote variant_id="abc123" value="up"
|
|
259
242
|
```
|
|
260
243
|
|
|
261
244
|
## Privacy
|
|
@@ -267,7 +250,7 @@ FixHive automatically filters sensitive information before sharing:
|
|
|
267
250
|
| API Keys | `sk-abc123...`, `ghp_xxx...` | `[API_KEY_REDACTED]` |
|
|
268
251
|
| Tokens | `Bearer eyJ...`, `xoxb-...` | `[TOKEN_REDACTED]` |
|
|
269
252
|
| Emails | `user@example.com` | `[EMAIL_REDACTED]` |
|
|
270
|
-
| Paths | `/Users/john/projects/...` |
|
|
253
|
+
| Paths | `/Users/john/projects/...` | `[PATH_REDACTED]` |
|
|
271
254
|
| Env Vars | `DATABASE_URL=postgres://...` | `[ENV_REDACTED]` |
|
|
272
255
|
| Connection Strings | `mongodb://user:pass@...` | `[CONNECTION_STRING_REDACTED]` |
|
|
273
256
|
| IP Addresses | `192.168.1.100` | `[IP_REDACTED]` |
|
|
@@ -290,7 +273,7 @@ CREATE EXTENSION IF NOT EXISTS vector;
|
|
|
290
273
|
|
|
291
274
|
### 3. Run Setup Script
|
|
292
275
|
|
|
293
|
-
Copy and run the contents of `scripts/setup-
|
|
276
|
+
Copy and run the contents of `scripts/setup-codecasedb-v2.sql` in the SQL Editor.
|
|
294
277
|
|
|
295
278
|
### 4. Configure Environment
|
|
296
279
|
|
|
@@ -305,156 +288,34 @@ FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
|
305
288
|
```
|
|
306
289
|
@the-magic-tower/fixhive-opencode-plugin
|
|
307
290
|
├── src/
|
|
308
|
-
│ ├──
|
|
309
|
-
│
|
|
310
|
-
│
|
|
311
|
-
│
|
|
312
|
-
│
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
│ ├── cloud/
|
|
319
|
-
│ │ ├── client.ts # Supabase client
|
|
320
|
-
│ │ └── embedding.ts # OpenAI embeddings
|
|
321
|
-
│ └── types/
|
|
322
|
-
│ ├── index.ts # TypeScript definitions
|
|
323
|
-
│ └── bun-sqlite.d.ts # Bun SQLite type declarations
|
|
324
|
-
└── scripts/
|
|
325
|
-
└── setup-supabase.sql # Cloud schema
|
|
291
|
+
│ ├── index.ts # Main exports
|
|
292
|
+
│ └── plugin/
|
|
293
|
+
│ ├── index.ts # Plugin definition (hooks)
|
|
294
|
+
│ └── tools.ts # Custom tools (3 tools)
|
|
295
|
+
│
|
|
296
|
+
└── Shared Package (@the-magic-tower/fixhive-shared)
|
|
297
|
+
├── types/ # CaseGroup, CaseVariant, Resolution, Vote
|
|
298
|
+
├── device/ # device_id management
|
|
299
|
+
├── cloud/ # Supabase client, ranking algorithm
|
|
300
|
+
└── utils/ # hash, privacy filtering
|
|
326
301
|
```
|
|
327
302
|
|
|
328
|
-
|
|
303
|
+
## Device Identification
|
|
329
304
|
|
|
330
|
-
FixHive
|
|
305
|
+
FixHive uses a persistent device ID stored in `~/.codecasedb/device_id`. This ID:
|
|
306
|
+
- Is automatically generated on first use (UUID v4)
|
|
307
|
+
- Persists across sessions and projects
|
|
308
|
+
- Does not contain any personal information
|
|
309
|
+
- Used for vote deduplication and contribution tracking
|
|
331
310
|
|
|
332
|
-
|
|
333
|
-
|---------|----------------------|
|
|
334
|
-
| Bun | `bun:sqlite` (native) |
|
|
335
|
-
| Node.js | `better-sqlite3` |
|
|
311
|
+
## Ranking Algorithm
|
|
336
312
|
|
|
337
|
-
|
|
313
|
+
Solutions are ranked using:
|
|
338
314
|
|
|
339
|
-
### TypeScript Types
|
|
340
|
-
|
|
341
|
-
```typescript
|
|
342
|
-
import type {
|
|
343
|
-
LocalErrorRecord,
|
|
344
|
-
CloudKnowledgeEntry,
|
|
345
|
-
ErrorType,
|
|
346
|
-
ErrorStatus,
|
|
347
|
-
Language,
|
|
348
|
-
Severity,
|
|
349
|
-
} from '@the-magic-tower/fixhive-opencode-plugin';
|
|
350
|
-
|
|
351
|
-
// Error types
|
|
352
|
-
type ErrorType =
|
|
353
|
-
| 'runtime' | 'build' | 'lint' | 'test'
|
|
354
|
-
| 'network' | 'permission' | 'dependency'
|
|
355
|
-
| 'syntax' | 'type_error' | 'unknown';
|
|
356
|
-
|
|
357
|
-
// Error status
|
|
358
|
-
type ErrorStatus = 'unresolved' | 'resolved' | 'uploaded';
|
|
359
|
-
|
|
360
|
-
// Supported languages
|
|
361
|
-
type Language =
|
|
362
|
-
| 'typescript' | 'javascript' | 'python' | 'rust'
|
|
363
|
-
| 'go' | 'java' | 'ruby' | 'php' | 'csharp' | 'cpp' | 'other';
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### Programmatic Usage
|
|
367
|
-
|
|
368
|
-
```typescript
|
|
369
|
-
import {
|
|
370
|
-
ErrorDetector,
|
|
371
|
-
PrivacyFilter,
|
|
372
|
-
LocalStore,
|
|
373
|
-
CloudClient,
|
|
374
|
-
createEmbeddingService,
|
|
375
|
-
} from '@the-magic-tower/fixhive-opencode-plugin';
|
|
376
|
-
|
|
377
|
-
// Create instances
|
|
378
|
-
const detector = new ErrorDetector();
|
|
379
|
-
const filter = new PrivacyFilter();
|
|
380
|
-
const store = new LocalStore('/path/to/project');
|
|
381
|
-
const cloud = new CloudClient({
|
|
382
|
-
supabaseUrl: 'https://xxx.supabase.co',
|
|
383
|
-
supabaseAnonKey: 'your-key',
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
// Detect errors
|
|
387
|
-
const result = detector.detect({
|
|
388
|
-
tool: 'bash',
|
|
389
|
-
output: 'error TS2307: Cannot find module...',
|
|
390
|
-
exitCode: 1,
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
// Sanitize content
|
|
394
|
-
const sanitized = filter.sanitize('API key: sk-abc123...');
|
|
395
|
-
// { sanitized: 'API key: [API_KEY_REDACTED]', redactedCount: 1, ... }
|
|
396
|
-
|
|
397
|
-
// Search solutions
|
|
398
|
-
const solutions = await cloud.searchSimilar({
|
|
399
|
-
errorMessage: 'Module not found',
|
|
400
|
-
language: 'typescript',
|
|
401
|
-
});
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
## Troubleshooting
|
|
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
|
-
|
|
420
|
-
### Plugin not loading
|
|
421
|
-
|
|
422
|
-
Make sure you're using OpenCode v1.1.1 or later:
|
|
423
|
-
```bash
|
|
424
|
-
npm list @opencode-ai/plugin
|
|
425
|
-
```
|
|
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
|
-
|
|
433
|
-
### No solutions found
|
|
434
|
-
|
|
435
|
-
1. Check if you have `OPENAI_API_KEY` set for semantic search
|
|
436
|
-
2. Try broader search terms
|
|
437
|
-
3. The community database may not have solutions for rare errors yet
|
|
438
|
-
|
|
439
|
-
### Privacy concerns
|
|
440
|
-
|
|
441
|
-
FixHive automatically filters sensitive data, but you can disable cloud sync:
|
|
442
|
-
```typescript
|
|
443
|
-
fixhive_resolve <error-id> "My resolution" --upload false
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
### SQLite errors
|
|
447
|
-
|
|
448
|
-
Clear local database:
|
|
449
|
-
```bash
|
|
450
|
-
rm -rf .fixhive/
|
|
451
315
|
```
|
|
316
|
+
final_score = env_match × 0.4 + success_rate × 0.3 + vote_score × 0.2 + report_factor × 0.1
|
|
452
317
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
Check your network and Supabase status:
|
|
456
|
-
```bash
|
|
457
|
-
curl https://your-project.supabase.co/rest/v1/
|
|
318
|
+
env_match = language_match × 0.4 + framework_match × 0.4 + packages_overlap × 0.2
|
|
458
319
|
```
|
|
459
320
|
|
|
460
321
|
## Development
|
|
@@ -463,7 +324,7 @@ curl https://your-project.supabase.co/rest/v1/
|
|
|
463
324
|
# Install dependencies
|
|
464
325
|
npm install
|
|
465
326
|
|
|
466
|
-
# Build
|
|
327
|
+
# Build (requires Bun)
|
|
467
328
|
npm run build
|
|
468
329
|
|
|
469
330
|
# Watch mode
|
|
@@ -479,14 +340,6 @@ npm test
|
|
|
479
340
|
npm run test:coverage
|
|
480
341
|
```
|
|
481
342
|
|
|
482
|
-
### Test Coverage
|
|
483
|
-
|
|
484
|
-
| Module | Coverage |
|
|
485
|
-
|--------|----------|
|
|
486
|
-
| Core (error-detector, privacy-filter, hash) | 99% |
|
|
487
|
-
| Storage (local-store) | 98% |
|
|
488
|
-
| Cloud (client, embedding) | 96% |
|
|
489
|
-
|
|
490
343
|
## Contributing
|
|
491
344
|
|
|
492
345
|
1. Fork the repository
|
|
@@ -510,10 +363,13 @@ See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
|
510
363
|
|
|
511
364
|
MIT - see [LICENSE](LICENSE) for details.
|
|
512
365
|
|
|
366
|
+
## Related Packages
|
|
367
|
+
|
|
368
|
+
- [@the-magic-tower/fixhive-shared](https://github.com/TheMagicTower/fixhive-shared) - Shared utilities
|
|
369
|
+
- [@the-magic-tower/fixhive-claude-code](https://github.com/TheMagicTower/FixHive-ClaudeCode) - Claude Code MCP server
|
|
370
|
+
|
|
513
371
|
## Acknowledgments
|
|
514
372
|
|
|
515
373
|
- [OpenCode](https://github.com/opencode-ai/opencode) - AI coding assistant
|
|
516
374
|
- [Supabase](https://supabase.com) - Backend as a Service
|
|
517
375
|
- [pgvector](https://github.com/pgvector/pgvector) - Vector similarity search
|
|
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,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
> Community-gebaseerd Foutkennis Delen voor OpenCode
|
|
15
15
|
|
|
16
|
-
**Laatste versie: v0.1.
|
|
16
|
+
**Laatste versie: v0.1.34** - Bun runtime compatibiliteitsproblemen opgelost. Plugin werkt nu correct met OpenCode.
|
|
17
17
|
|
|
18
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.
|
|
19
19
|
|
package/README.zh.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FixHive - Community-based Error Knowledge Sharing for OpenCode
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* CodeCaseDB v2.0
|
|
5
|
+
*
|
|
6
|
+
* @module @the-magic-tower/fixhive-opencode-plugin
|
|
5
7
|
* @description
|
|
6
8
|
* FixHive is an OpenCode plugin that automatically captures errors during
|
|
7
9
|
* development sessions, queries a community knowledge base for solutions,
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
* @example
|
|
11
13
|
* ```typescript
|
|
12
14
|
* // In your OpenCode plugin configuration
|
|
13
|
-
* import FixHivePlugin from '@fixhive
|
|
15
|
+
* import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
14
16
|
*
|
|
15
17
|
* export default FixHivePlugin;
|
|
16
18
|
* ```
|
|
@@ -20,15 +22,9 @@
|
|
|
20
22
|
* # Environment variables
|
|
21
23
|
* FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
22
24
|
* FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
23
|
-
* OPENAI_API_KEY=sk-... # Optional, for embeddings
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
import FixHivePlugin from './plugin/index.js';
|
|
27
28
|
export default FixHivePlugin;
|
|
28
|
-
export type {
|
|
29
|
-
export type { ErrorDetector as ErrorDetectorInterface } from './core/error-detector.js';
|
|
30
|
-
export type { PrivacyFilter as PrivacyFilterInterface } from './core/privacy-filter.js';
|
|
31
|
-
export type { LocalStore as LocalStoreInterface } from './storage/local-store.js';
|
|
32
|
-
export type { CloudClient as CloudClientInterface } from './cloud/client.js';
|
|
33
|
-
export type { EmbeddingService as EmbeddingServiceInterface, EmbeddingServiceConfig } from './cloud/embedding.js';
|
|
29
|
+
export type { CaseGroup, CaseVariant, Resolution, Vote, Device, Environment, SearchCasesInput, SearchCasesOutput, ReportResolutionInput, ReportResolutionOutput, VoteInput, VoteOutput, RankedVariant, FilterResult, CloudClient, } from '@the-magic-tower/fixhive-shared';
|
|
34
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,eAAe,aAAa,CAAC;AAG7B,YAAY,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,IAAI,EACJ,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,iCAAiC,CAAC"}
|