@the-magic-tower/fixhive-opencode-plugin 0.1.0
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 +134 -0
- package/dist/index.js +1782 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
> Community-based Error Knowledge Sharing for OpenCode
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Auto Error Detection**: Automatically detects errors from tool outputs (bash, edit, etc.)
|
|
10
|
+
- **Cloud Knowledge Base**: Search community solutions using semantic similarity (pgvector)
|
|
11
|
+
- **Local Caching**: SQLite-based local storage for offline access
|
|
12
|
+
- **Privacy Filtering**: Automatically redacts sensitive data (API keys, paths, emails)
|
|
13
|
+
- **Real-time Sync**: Immediate cloud communication on error/resolution
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @fixhive/opencode-plugin
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
Set the following environment variables:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Required for cloud features
|
|
27
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
28
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
29
|
+
|
|
30
|
+
# Optional: For embedding-based semantic search
|
|
31
|
+
OPENAI_API_KEY=sk-...
|
|
32
|
+
|
|
33
|
+
# Optional: Custom contributor ID (auto-generated if not set)
|
|
34
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### As OpenCode Plugin
|
|
40
|
+
|
|
41
|
+
Add to your OpenCode configuration:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import FixHivePlugin from '@fixhive/opencode-plugin';
|
|
45
|
+
|
|
46
|
+
export default FixHivePlugin;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Available Commands
|
|
50
|
+
|
|
51
|
+
| Command | Description |
|
|
52
|
+
|---------|-------------|
|
|
53
|
+
| `fixhive_search` | Search knowledge base for error solutions |
|
|
54
|
+
| `fixhive_resolve` | Mark error as resolved and share solution |
|
|
55
|
+
| `fixhive_list` | List errors in current session |
|
|
56
|
+
| `fixhive_vote` | Upvote/downvote a solution |
|
|
57
|
+
| `fixhive_stats` | View usage statistics |
|
|
58
|
+
| `fixhive_helpful` | Report a solution was helpful |
|
|
59
|
+
|
|
60
|
+
### Example Workflow
|
|
61
|
+
|
|
62
|
+
1. **Error occurs** → FixHive automatically detects and records it
|
|
63
|
+
2. **Search solutions** → `fixhive_search "Module not found: react"`
|
|
64
|
+
3. **Apply fix** → Follow community solution
|
|
65
|
+
4. **Share resolution** → `fixhive_resolve <error-id> "Installed missing dependency"`
|
|
66
|
+
|
|
67
|
+
## Cloud Setup (Supabase)
|
|
68
|
+
|
|
69
|
+
1. Create a new Supabase project
|
|
70
|
+
2. Run the setup script in SQL Editor:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
74
|
+
# Paste in Supabase SQL Editor
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
3. Get your project URL and anon key from Settings > API
|
|
78
|
+
|
|
79
|
+
## Architecture
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
FixHive Plugin
|
|
83
|
+
├── Error Detection (tool.execute.after hook)
|
|
84
|
+
├── Privacy Filter (redacts sensitive data)
|
|
85
|
+
├── Local Storage (SQLite)
|
|
86
|
+
│ ├── error_records
|
|
87
|
+
│ └── query_cache
|
|
88
|
+
└── Cloud Client (Supabase + pgvector)
|
|
89
|
+
├── knowledge_entries
|
|
90
|
+
└── usage_logs
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Privacy
|
|
94
|
+
|
|
95
|
+
FixHive automatically filters sensitive information:
|
|
96
|
+
|
|
97
|
+
- API keys (OpenAI, GitHub, AWS, Stripe, etc.)
|
|
98
|
+
- JWT tokens and bearer tokens
|
|
99
|
+
- Email addresses
|
|
100
|
+
- File paths (replaced with `~` or `<PROJECT>`)
|
|
101
|
+
- Environment variables with sensitive names
|
|
102
|
+
- Database connection strings
|
|
103
|
+
- IP addresses (except localhost)
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Install dependencies
|
|
109
|
+
npm install
|
|
110
|
+
|
|
111
|
+
# Build
|
|
112
|
+
npm run build
|
|
113
|
+
|
|
114
|
+
# Watch mode
|
|
115
|
+
npm run dev
|
|
116
|
+
|
|
117
|
+
# Type check
|
|
118
|
+
npm run typecheck
|
|
119
|
+
|
|
120
|
+
# Run tests
|
|
121
|
+
npm test
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
127
|
+
|
|
128
|
+
## Contributing
|
|
129
|
+
|
|
130
|
+
1. Fork the repository
|
|
131
|
+
2. Create your feature branch
|
|
132
|
+
3. Commit your changes
|
|
133
|
+
4. Push to the branch
|
|
134
|
+
5. Create a Pull Request
|