@the-magic-tower/fixhive-opencode-plugin 0.1.34 → 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.md +112 -316
- package/dist/index.d.ts +5 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8027 -14087
- 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.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.34** - Fixed re-uploading already resolved errors to cloud.
|
|
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
|
-
|
|
207
|
+
## Error Signature Normalization
|
|
217
208
|
|
|
218
|
-
|
|
209
|
+
When searching or reporting errors, normalize the message by replacing variable parts with placeholders:
|
|
219
210
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
{
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
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}` |
|
|
226
222
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
Report inappropriate content.
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
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,216 +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
|
|
326
|
-
```
|
|
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
|
-
|
|
337
|
-
## API Reference
|
|
338
|
-
|
|
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
|
-
});
|
|
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
|
|
402
301
|
```
|
|
403
302
|
|
|
404
|
-
##
|
|
303
|
+
## Device Identification
|
|
405
304
|
|
|
406
|
-
|
|
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
|
|
407
310
|
|
|
408
|
-
|
|
311
|
+
## Ranking Algorithm
|
|
409
312
|
|
|
410
|
-
|
|
313
|
+
Solutions are ranked using:
|
|
411
314
|
|
|
412
|
-
Run OpenCode and check the startup logs:
|
|
413
|
-
```bash
|
|
414
|
-
opencode
|
|
415
315
|
```
|
|
316
|
+
final_score = env_match × 0.4 + success_rate × 0.3 + vote_score × 0.2 + report_factor × 0.1
|
|
416
317
|
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
[FixHive] Plugin loaded
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
#### 2. Clear OpenCode Cache
|
|
423
|
-
|
|
424
|
-
Remove the cached plugin files and reinstall:
|
|
425
|
-
|
|
426
|
-
```bash
|
|
427
|
-
# Method 1: Clear FixHive cache only
|
|
428
|
-
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
429
|
-
|
|
430
|
-
# Method 2: Clear entire OpenCode cache (if above doesn't work)
|
|
431
|
-
rm -rf ~/.cache/opencode/node_modules/
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
#### 3. Reinstall Plugin
|
|
435
|
-
|
|
436
|
-
Navigate to your project directory and reinstall:
|
|
437
|
-
|
|
438
|
-
```bash
|
|
439
|
-
cd /your/project/path
|
|
440
|
-
npm install @the-magic-tower/fixhive-opencode-plugin@latest
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
#### 4. Restart OpenCode
|
|
444
|
-
|
|
445
|
-
```bash
|
|
446
|
-
opencode
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
You should see updated logs with the latest version:
|
|
450
|
-
```
|
|
451
|
-
[FixHive] Plugin loaded
|
|
452
|
-
[FixHive] Project: /your/project/path
|
|
453
|
-
[FixHive] Cloud: enabled
|
|
454
|
-
[FixHive] Ready - use fixhive_stats to verify
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
#### 5. Verify Installation
|
|
458
|
-
|
|
459
|
-
Run the stats command to verify:
|
|
460
|
-
```typescript
|
|
461
|
-
fixhive_stats
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
This will show you the current local statistics. If you're using the cloud features, check that the connection is working properly.
|
|
465
|
-
|
|
466
|
-
### Verify Plugin is Working
|
|
467
|
-
|
|
468
|
-
When the plugin loads successfully, you'll see:
|
|
469
|
-
```
|
|
470
|
-
[FixHive] Plugin loaded
|
|
471
|
-
[FixHive] Project: /your/project/path
|
|
472
|
-
[FixHive] Cloud: enabled
|
|
473
|
-
[FixHive] Detected: typescript
|
|
474
|
-
[FixHive] Ready - use fixhive_stats to verify
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
All 7 tools should be available:
|
|
478
|
-
- `fixhive_search`, `fixhive_resolve`, `fixhive_list`, `fixhive_vote`, `fixhive_report`, `fixhive_stats`, `fixhive_helpful`
|
|
479
|
-
|
|
480
|
-
### Plugin not loading
|
|
481
|
-
|
|
482
|
-
Make sure you're using OpenCode v1.1.1 or later:
|
|
483
|
-
```bash
|
|
484
|
-
npm list @opencode-ai/plugin
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
If you have an old cached version, clear the cache and restart:
|
|
488
|
-
```bash
|
|
489
|
-
rm -rf ~/.cache/opencode/node_modules/@the-magic-tower*
|
|
490
|
-
opencode
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
### No solutions found
|
|
494
|
-
|
|
495
|
-
1. Check if you have `OPENAI_API_KEY` set for semantic search
|
|
496
|
-
2. Try broader search terms
|
|
497
|
-
3. The community database may not have solutions for rare errors yet
|
|
498
|
-
|
|
499
|
-
### Privacy concerns
|
|
500
|
-
|
|
501
|
-
FixHive automatically filters sensitive data, but you can disable cloud sync:
|
|
502
|
-
```typescript
|
|
503
|
-
fixhive_resolve <error-id> "My resolution" --upload false
|
|
504
|
-
```
|
|
505
|
-
|
|
506
|
-
### SQLite errors
|
|
507
|
-
|
|
508
|
-
Clear local database:
|
|
509
|
-
```bash
|
|
510
|
-
rm -rf .fixhive/
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
### Connection errors
|
|
514
|
-
|
|
515
|
-
Check your network and Supabase status:
|
|
516
|
-
```bash
|
|
517
|
-
curl https://your-project.supabase.co/rest/v1/
|
|
318
|
+
env_match = language_match × 0.4 + framework_match × 0.4 + packages_overlap × 0.2
|
|
518
319
|
```
|
|
519
320
|
|
|
520
321
|
## Development
|
|
@@ -523,7 +324,7 @@ curl https://your-project.supabase.co/rest/v1/
|
|
|
523
324
|
# Install dependencies
|
|
524
325
|
npm install
|
|
525
326
|
|
|
526
|
-
# Build
|
|
327
|
+
# Build (requires Bun)
|
|
527
328
|
npm run build
|
|
528
329
|
|
|
529
330
|
# Watch mode
|
|
@@ -539,14 +340,6 @@ npm test
|
|
|
539
340
|
npm run test:coverage
|
|
540
341
|
```
|
|
541
342
|
|
|
542
|
-
### Test Coverage
|
|
543
|
-
|
|
544
|
-
| Module | Coverage |
|
|
545
|
-
|--------|----------|
|
|
546
|
-
| Core (error-detector, privacy-filter, hash) | 99% |
|
|
547
|
-
| Storage (local-store) | 98% |
|
|
548
|
-
| Cloud (client, embedding) | 96% |
|
|
549
|
-
|
|
550
343
|
## Contributing
|
|
551
344
|
|
|
552
345
|
1. Fork the repository
|
|
@@ -570,10 +363,13 @@ See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
|
570
363
|
|
|
571
364
|
MIT - see [LICENSE](LICENSE) for details.
|
|
572
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
|
+
|
|
573
371
|
## Acknowledgments
|
|
574
372
|
|
|
575
373
|
- [OpenCode](https://github.com/opencode-ai/opencode) - AI coding assistant
|
|
576
374
|
- [Supabase](https://supabase.com) - Backend as a Service
|
|
577
375
|
- [pgvector](https://github.com/pgvector/pgvector) - Vector similarity search
|
|
578
|
-
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings (Node.js)
|
|
579
|
-
- [Bun](https://bun.sh) - Fast JavaScript runtime with native SQLite support
|
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"}
|