@the-magic-tower/fixhive-opencode-plugin 0.1.0 → 0.1.2
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 +147 -0
- package/README.es.md +147 -0
- package/README.fr.md +147 -0
- package/README.ja.md +147 -0
- package/README.ko.md +147 -0
- package/README.md +17 -4
- package/README.nl.md +147 -0
- package/README.zh.md +147 -0
- package/dist/index.js +61 -12
- package/package.json +1 -1
package/README.de.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> Community-basiertes Fehlerwissen-Sharing für OpenCode
|
|
15
|
+
|
|
16
|
+
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
|
+
|
|
18
|
+
## Funktionen
|
|
19
|
+
|
|
20
|
+
- **Automatische Fehlererkennung**: Erkennt automatisch Fehler aus Tool-Ausgaben (bash, edit, etc.)
|
|
21
|
+
- **Cloud-Wissensdatenbank**: Suche nach Community-Lösungen mit semantischer Ähnlichkeit (pgvector)
|
|
22
|
+
- **Lokaler Cache**: SQLite-basierter lokaler Speicher für Offline-Zugriff
|
|
23
|
+
- **Datenschutzfilterung**: Entfernt automatisch sensible Daten (API-Schlüssel, Pfade, E-Mails)
|
|
24
|
+
- **Echtzeit-Synchronisierung**: Sofortige Cloud-Kommunikation bei Fehler/Lösung
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Konfiguration
|
|
33
|
+
|
|
34
|
+
Setzen Sie die folgenden Umgebungsvariablen:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Erforderlich für Cloud-Funktionen
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# Optional: Für embedding-basierte semantische Suche
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# Optional: Benutzerdefinierte Mitwirkenden-ID (wird automatisch generiert, wenn nicht gesetzt)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Verwendung
|
|
49
|
+
|
|
50
|
+
### Als OpenCode-Plugin
|
|
51
|
+
|
|
52
|
+
Fügen Sie zu Ihrer OpenCode-Konfiguration hinzu (`opencode.config.ts`):
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Verfügbare Befehle
|
|
63
|
+
|
|
64
|
+
| Befehl | Beschreibung |
|
|
65
|
+
|--------|--------------|
|
|
66
|
+
| `fixhive_search` | Wissensdatenbank nach Fehlerlösungen durchsuchen |
|
|
67
|
+
| `fixhive_resolve` | Fehler als gelöst markieren und Lösung teilen |
|
|
68
|
+
| `fixhive_list` | Fehler in der aktuellen Sitzung auflisten |
|
|
69
|
+
| `fixhive_vote` | Lösung hoch-/runtervoten |
|
|
70
|
+
| `fixhive_stats` | Nutzungsstatistiken anzeigen |
|
|
71
|
+
| `fixhive_helpful` | Melden, dass eine Lösung hilfreich war |
|
|
72
|
+
|
|
73
|
+
### Beispiel-Workflow
|
|
74
|
+
|
|
75
|
+
1. **Fehler tritt auf** → FixHive erkennt und protokolliert ihn automatisch
|
|
76
|
+
2. **Lösungen suchen** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **Fix anwenden** → Community-Lösung befolgen
|
|
78
|
+
4. **Lösung teilen** → `fixhive_resolve <error-id> "Fehlende Abhängigkeit installiert"`
|
|
79
|
+
|
|
80
|
+
## Cloud-Setup (Supabase)
|
|
81
|
+
|
|
82
|
+
1. Neues Supabase-Projekt erstellen
|
|
83
|
+
2. Setup-Skript im SQL-Editor ausführen:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Im Supabase SQL-Editor einfügen
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Projekt-URL und Anon-Key unter Settings > API abrufen
|
|
91
|
+
|
|
92
|
+
## Architektur
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection (tool.execute.after Hook)
|
|
97
|
+
├── Privacy Filter (entfernt sensible Daten)
|
|
98
|
+
├── Local Storage (SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client (Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Datenschutz
|
|
107
|
+
|
|
108
|
+
FixHive filtert automatisch sensible Informationen:
|
|
109
|
+
|
|
110
|
+
- API-Schlüssel (OpenAI, GitHub, AWS, Stripe, etc.)
|
|
111
|
+
- JWT-Token und Bearer-Token
|
|
112
|
+
- E-Mail-Adressen
|
|
113
|
+
- Dateipfade (ersetzt durch `~` oder `<PROJECT>`)
|
|
114
|
+
- Umgebungsvariablen mit sensiblen Namen
|
|
115
|
+
- Datenbankverbindungszeichenfolgen
|
|
116
|
+
- IP-Adressen (außer localhost)
|
|
117
|
+
|
|
118
|
+
## Entwicklung
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Abhängigkeiten installieren
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Bauen
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# Watch-Modus
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# Typ-Prüfung
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# Tests ausführen
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Lizenz
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## Mitwirken
|
|
142
|
+
|
|
143
|
+
1. Repository forken
|
|
144
|
+
2. Feature-Branch erstellen
|
|
145
|
+
3. Änderungen committen
|
|
146
|
+
4. Zum Branch pushen
|
|
147
|
+
5. Pull Request erstellen
|
package/README.es.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> Sistema de Compartición de Conocimiento de Errores Basado en la Comunidad para OpenCode
|
|
15
|
+
|
|
16
|
+
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
|
+
|
|
18
|
+
## Características
|
|
19
|
+
|
|
20
|
+
- **Detección Automática de Errores**: Detecta automáticamente errores de las salidas de herramientas (bash, edit, etc.)
|
|
21
|
+
- **Base de Conocimientos en la Nube**: Búsqueda de soluciones comunitarias usando similitud semántica (pgvector)
|
|
22
|
+
- **Caché Local**: Almacenamiento local basado en SQLite para acceso sin conexión
|
|
23
|
+
- **Filtrado de Privacidad**: Redacta automáticamente datos sensibles (claves API, rutas, correos electrónicos)
|
|
24
|
+
- **Sincronización en Tiempo Real**: Comunicación inmediata con la nube en error/resolución
|
|
25
|
+
|
|
26
|
+
## Instalación
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuración
|
|
33
|
+
|
|
34
|
+
Configure las siguientes variables de entorno:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Requerido para funciones en la nube
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# Opcional: Para búsqueda semántica basada en embeddings
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# Opcional: ID de contribuidor personalizado (se genera automáticamente si no se establece)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Uso
|
|
49
|
+
|
|
50
|
+
### Como Plugin de OpenCode
|
|
51
|
+
|
|
52
|
+
Agregue a su configuración de OpenCode (`opencode.config.ts`):
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Comandos Disponibles
|
|
63
|
+
|
|
64
|
+
| Comando | Descripción |
|
|
65
|
+
|---------|-------------|
|
|
66
|
+
| `fixhive_search` | Buscar soluciones de errores en la base de conocimientos |
|
|
67
|
+
| `fixhive_resolve` | Marcar error como resuelto y compartir solución |
|
|
68
|
+
| `fixhive_list` | Listar errores en la sesión actual |
|
|
69
|
+
| `fixhive_vote` | Votar a favor/en contra de una solución |
|
|
70
|
+
| `fixhive_stats` | Ver estadísticas de uso |
|
|
71
|
+
| `fixhive_helpful` | Reportar que una solución fue útil |
|
|
72
|
+
|
|
73
|
+
### Flujo de Trabajo de Ejemplo
|
|
74
|
+
|
|
75
|
+
1. **Ocurre un error** → FixHive lo detecta y registra automáticamente
|
|
76
|
+
2. **Buscar soluciones** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **Aplicar corrección** → Seguir la solución de la comunidad
|
|
78
|
+
4. **Compartir resolución** → `fixhive_resolve <error-id> "Instalada dependencia faltante"`
|
|
79
|
+
|
|
80
|
+
## Configuración en la Nube (Supabase)
|
|
81
|
+
|
|
82
|
+
1. Crear un nuevo proyecto de Supabase
|
|
83
|
+
2. Ejecutar el script de configuración en el Editor SQL:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Pegar en el Editor SQL de Supabase
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Obtener la URL del proyecto y la clave anon desde Settings > API
|
|
91
|
+
|
|
92
|
+
## Arquitectura
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection (hook tool.execute.after)
|
|
97
|
+
├── Privacy Filter (redacta datos sensibles)
|
|
98
|
+
├── Local Storage (SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client (Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Privacidad
|
|
107
|
+
|
|
108
|
+
FixHive filtra automáticamente información sensible:
|
|
109
|
+
|
|
110
|
+
- Claves API (OpenAI, GitHub, AWS, Stripe, etc.)
|
|
111
|
+
- Tokens JWT y tokens Bearer
|
|
112
|
+
- Direcciones de correo electrónico
|
|
113
|
+
- Rutas de archivos (reemplazadas con `~` o `<PROJECT>`)
|
|
114
|
+
- Variables de entorno con nombres sensibles
|
|
115
|
+
- Cadenas de conexión a bases de datos
|
|
116
|
+
- Direcciones IP (excepto localhost)
|
|
117
|
+
|
|
118
|
+
## Desarrollo
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Instalar dependencias
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Compilar
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# Modo observación
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# Verificación de tipos
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# Ejecutar pruebas
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Licencia
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## Contribuir
|
|
142
|
+
|
|
143
|
+
1. Hacer fork del repositorio
|
|
144
|
+
2. Crear su rama de características
|
|
145
|
+
3. Hacer commit de sus cambios
|
|
146
|
+
4. Hacer push a la rama
|
|
147
|
+
5. Crear un Pull Request
|
package/README.fr.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> Partage de Connaissances d'Erreurs Basé sur la Communauté pour OpenCode
|
|
15
|
+
|
|
16
|
+
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
|
+
|
|
18
|
+
## Fonctionnalités
|
|
19
|
+
|
|
20
|
+
- **Détection Automatique des Erreurs** : Détecte automatiquement les erreurs des sorties d'outils (bash, edit, etc.)
|
|
21
|
+
- **Base de Connaissances Cloud** : Recherche de solutions communautaires par similarité sémantique (pgvector)
|
|
22
|
+
- **Cache Local** : Stockage local basé sur SQLite pour l'accès hors ligne
|
|
23
|
+
- **Filtrage de Confidentialité** : Supprime automatiquement les données sensibles (clés API, chemins, e-mails)
|
|
24
|
+
- **Synchronisation en Temps Réel** : Communication cloud immédiate lors d'erreur/résolution
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Définissez les variables d'environnement suivantes :
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Requis pour les fonctionnalités cloud
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# Optionnel : Pour la recherche sémantique basée sur les embeddings
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# Optionnel : ID de contributeur personnalisé (généré automatiquement si non défini)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Utilisation
|
|
49
|
+
|
|
50
|
+
### En tant que Plugin OpenCode
|
|
51
|
+
|
|
52
|
+
Ajoutez à votre configuration OpenCode (`opencode.config.ts`) :
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Commandes Disponibles
|
|
63
|
+
|
|
64
|
+
| Commande | Description |
|
|
65
|
+
|----------|-------------|
|
|
66
|
+
| `fixhive_search` | Rechercher des solutions d'erreurs dans la base de connaissances |
|
|
67
|
+
| `fixhive_resolve` | Marquer une erreur comme résolue et partager la solution |
|
|
68
|
+
| `fixhive_list` | Lister les erreurs de la session en cours |
|
|
69
|
+
| `fixhive_vote` | Voter pour/contre une solution |
|
|
70
|
+
| `fixhive_stats` | Voir les statistiques d'utilisation |
|
|
71
|
+
| `fixhive_helpful` | Signaler qu'une solution a été utile |
|
|
72
|
+
|
|
73
|
+
### Exemple de Flux de Travail
|
|
74
|
+
|
|
75
|
+
1. **Une erreur survient** → FixHive la détecte et l'enregistre automatiquement
|
|
76
|
+
2. **Rechercher des solutions** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **Appliquer le correctif** → Suivre la solution de la communauté
|
|
78
|
+
4. **Partager la résolution** → `fixhive_resolve <error-id> "Dépendance manquante installée"`
|
|
79
|
+
|
|
80
|
+
## Configuration Cloud (Supabase)
|
|
81
|
+
|
|
82
|
+
1. Créer un nouveau projet Supabase
|
|
83
|
+
2. Exécuter le script de configuration dans l'éditeur SQL :
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Coller dans l'éditeur SQL Supabase
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Obtenir l'URL du projet et la clé anon depuis Settings > API
|
|
91
|
+
|
|
92
|
+
## Architecture
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection (hook tool.execute.after)
|
|
97
|
+
├── Privacy Filter (supprime les données sensibles)
|
|
98
|
+
├── Local Storage (SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client (Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Confidentialité
|
|
107
|
+
|
|
108
|
+
FixHive filtre automatiquement les informations sensibles :
|
|
109
|
+
|
|
110
|
+
- Clés API (OpenAI, GitHub, AWS, Stripe, etc.)
|
|
111
|
+
- Jetons JWT et jetons Bearer
|
|
112
|
+
- Adresses e-mail
|
|
113
|
+
- Chemins de fichiers (remplacés par `~` ou `<PROJECT>`)
|
|
114
|
+
- Variables d'environnement avec des noms sensibles
|
|
115
|
+
- Chaînes de connexion aux bases de données
|
|
116
|
+
- Adresses IP (sauf localhost)
|
|
117
|
+
|
|
118
|
+
## Développement
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Installer les dépendances
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Compiler
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# Mode surveillance
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# Vérification des types
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# Exécuter les tests
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Licence
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## Contribuer
|
|
142
|
+
|
|
143
|
+
1. Forker le dépôt
|
|
144
|
+
2. Créer votre branche de fonctionnalité
|
|
145
|
+
3. Committer vos modifications
|
|
146
|
+
4. Pousser vers la branche
|
|
147
|
+
5. Créer une Pull Request
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> OpenCode向けコミュニティベースのエラー知識共有システム
|
|
15
|
+
|
|
16
|
+
FixHiveは、開発セッション中にエラーを自動的にキャプチャし、コミュニティナレッジベースからソリューションを検索し、解決したエラーを他の開発者と共有するOpenCodeプラグインです。
|
|
17
|
+
|
|
18
|
+
## 機能
|
|
19
|
+
|
|
20
|
+
- **自動エラー検出**:ツール出力(bash、editなど)からエラーを自動検出
|
|
21
|
+
- **クラウドナレッジベース**:セマンティック類似性(pgvector)を使用したコミュニティソリューション検索
|
|
22
|
+
- **ローカルキャッシュ**:オフラインアクセス用のSQLiteベースのローカルストレージ
|
|
23
|
+
- **プライバシーフィルタリング**:機密データ(APIキー、パス、メールアドレス)の自動除去
|
|
24
|
+
- **リアルタイム同期**:エラー/解決時の即時クラウド通信
|
|
25
|
+
|
|
26
|
+
## インストール
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 設定
|
|
33
|
+
|
|
34
|
+
以下の環境変数を設定してください:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# クラウド機能に必須
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# オプション:埋め込みベースのセマンティック検索用
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# オプション:カスタム貢献者ID(未設定の場合は自動生成)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 使用方法
|
|
49
|
+
|
|
50
|
+
### OpenCodeプラグインとして
|
|
51
|
+
|
|
52
|
+
OpenCode設定ファイル(`opencode.config.ts`)に追加:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 利用可能なコマンド
|
|
63
|
+
|
|
64
|
+
| コマンド | 説明 |
|
|
65
|
+
|----------|------|
|
|
66
|
+
| `fixhive_search` | エラーソリューションのナレッジベースを検索 |
|
|
67
|
+
| `fixhive_resolve` | エラーを解決済みとしてマークし、ソリューションを共有 |
|
|
68
|
+
| `fixhive_list` | 現在のセッションのエラー一覧を表示 |
|
|
69
|
+
| `fixhive_vote` | ソリューションに投票(賛成/反対) |
|
|
70
|
+
| `fixhive_stats` | 使用統計を表示 |
|
|
71
|
+
| `fixhive_helpful` | ソリューションが役立ったことを報告 |
|
|
72
|
+
|
|
73
|
+
### ワークフロー例
|
|
74
|
+
|
|
75
|
+
1. **エラー発生** → FixHiveが自動的に検出して記録
|
|
76
|
+
2. **ソリューション検索** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **修正を適用** → コミュニティソリューションに従う
|
|
78
|
+
4. **解決を共有** → `fixhive_resolve <error-id> "不足している依存関係をインストール"`
|
|
79
|
+
|
|
80
|
+
## クラウドセットアップ(Supabase)
|
|
81
|
+
|
|
82
|
+
1. 新しいSupabaseプロジェクトを作成
|
|
83
|
+
2. SQLエディタでセットアップスクリプトを実行:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Supabase SQLエディタに貼り付け
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Settings > APIからプロジェクトURLとanon keyを取得
|
|
91
|
+
|
|
92
|
+
## アーキテクチャ
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection(tool.execute.afterフック)
|
|
97
|
+
├── Privacy Filter(機密データを除去)
|
|
98
|
+
├── Local Storage(SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client(Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## プライバシー
|
|
107
|
+
|
|
108
|
+
FixHiveは機密情報を自動的にフィルタリングします:
|
|
109
|
+
|
|
110
|
+
- APIキー(OpenAI、GitHub、AWS、Stripeなど)
|
|
111
|
+
- JWTトークンとBearerトークン
|
|
112
|
+
- メールアドレス
|
|
113
|
+
- ファイルパス(`~`または`<PROJECT>`に置換)
|
|
114
|
+
- 機密名を含む環境変数
|
|
115
|
+
- データベース接続文字列
|
|
116
|
+
- IPアドレス(localhost除く)
|
|
117
|
+
|
|
118
|
+
## 開発
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# 依存関係をインストール
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# ビルド
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# ウォッチモード
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# 型チェック
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# テスト実行
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## ライセンス
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## コントリビュート
|
|
142
|
+
|
|
143
|
+
1. リポジトリをフォーク
|
|
144
|
+
2. 機能ブランチを作成
|
|
145
|
+
3. 変更をコミット
|
|
146
|
+
4. ブランチにプッシュ
|
|
147
|
+
5. Pull Requestを作成
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> OpenCode를 위한 커뮤니티 기반 오류 지식 공유 시스템
|
|
15
|
+
|
|
16
|
+
FixHive는 개발 세션 중 발생하는 오류를 자동으로 캡처하고, 커뮤니티 지식 베이스에서 솔루션을 검색하며, 해결된 오류를 다른 개발자들과 공유하는 OpenCode 플러그인입니다.
|
|
17
|
+
|
|
18
|
+
## 주요 기능
|
|
19
|
+
|
|
20
|
+
- **자동 오류 감지**: 도구 출력(bash, edit 등)에서 오류를 자동으로 감지
|
|
21
|
+
- **클라우드 지식 베이스**: 시맨틱 유사도(pgvector)를 사용한 커뮤니티 솔루션 검색
|
|
22
|
+
- **로컬 캐싱**: 오프라인 접근을 위한 SQLite 기반 로컬 저장소
|
|
23
|
+
- **개인정보 필터링**: 민감한 데이터(API 키, 경로, 이메일) 자동 삭제
|
|
24
|
+
- **실시간 동기화**: 오류/해결 시 즉각적인 클라우드 통신
|
|
25
|
+
|
|
26
|
+
## 설치
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 설정
|
|
33
|
+
|
|
34
|
+
다음 환경 변수를 설정하세요:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 클라우드 기능 필수
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# 선택: 임베딩 기반 시맨틱 검색용
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# 선택: 사용자 정의 기여자 ID (미설정시 자동 생성)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 사용법
|
|
49
|
+
|
|
50
|
+
### OpenCode 플러그인으로 사용
|
|
51
|
+
|
|
52
|
+
OpenCode 설정 파일(`opencode.config.ts`)에 추가:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 사용 가능한 명령어
|
|
63
|
+
|
|
64
|
+
| 명령어 | 설명 |
|
|
65
|
+
|--------|------|
|
|
66
|
+
| `fixhive_search` | 오류 솔루션 지식 베이스 검색 |
|
|
67
|
+
| `fixhive_resolve` | 오류를 해결됨으로 표시하고 솔루션 공유 |
|
|
68
|
+
| `fixhive_list` | 현재 세션의 오류 목록 조회 |
|
|
69
|
+
| `fixhive_vote` | 솔루션 추천/비추천 |
|
|
70
|
+
| `fixhive_stats` | 사용 통계 조회 |
|
|
71
|
+
| `fixhive_helpful` | 솔루션이 도움됐음을 보고 |
|
|
72
|
+
|
|
73
|
+
### 사용 예시 워크플로우
|
|
74
|
+
|
|
75
|
+
1. **오류 발생** → FixHive가 자동으로 감지하고 기록
|
|
76
|
+
2. **솔루션 검색** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **수정 적용** → 커뮤니티 솔루션 따라하기
|
|
78
|
+
4. **해결 공유** → `fixhive_resolve <error-id> "누락된 의존성 설치"`
|
|
79
|
+
|
|
80
|
+
## 클라우드 설정 (Supabase)
|
|
81
|
+
|
|
82
|
+
1. 새 Supabase 프로젝트 생성
|
|
83
|
+
2. SQL 에디터에서 설정 스크립트 실행:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Supabase SQL 에디터에 붙여넣기
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Settings > API에서 프로젝트 URL과 anon key 획득
|
|
91
|
+
|
|
92
|
+
## 아키텍처
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection (tool.execute.after 훅)
|
|
97
|
+
├── Privacy Filter (민감한 데이터 삭제)
|
|
98
|
+
├── Local Storage (SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client (Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 개인정보 보호
|
|
107
|
+
|
|
108
|
+
FixHive는 민감한 정보를 자동으로 필터링합니다:
|
|
109
|
+
|
|
110
|
+
- API 키 (OpenAI, GitHub, AWS, Stripe 등)
|
|
111
|
+
- JWT 토큰 및 Bearer 토큰
|
|
112
|
+
- 이메일 주소
|
|
113
|
+
- 파일 경로 (`~` 또는 `<PROJECT>`로 대체)
|
|
114
|
+
- 민감한 이름의 환경 변수
|
|
115
|
+
- 데이터베이스 연결 문자열
|
|
116
|
+
- IP 주소 (localhost 제외)
|
|
117
|
+
|
|
118
|
+
## 개발
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# 의존성 설치
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# 빌드
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# 감시 모드
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# 타입 검사
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# 테스트 실행
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 라이선스
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## 기여하기
|
|
142
|
+
|
|
143
|
+
1. 저장소 포크
|
|
144
|
+
2. 기능 브랜치 생성
|
|
145
|
+
3. 변경 사항 커밋
|
|
146
|
+
4. 브랜치에 푸시
|
|
147
|
+
5. Pull Request 생성
|
package/README.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# FixHive
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
3
14
|
> Community-based Error Knowledge Sharing for OpenCode
|
|
4
15
|
|
|
5
16
|
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.
|
|
@@ -15,7 +26,7 @@ FixHive is an OpenCode plugin that automatically captures errors during developm
|
|
|
15
26
|
## Installation
|
|
16
27
|
|
|
17
28
|
```bash
|
|
18
|
-
npm install @fixhive
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
19
30
|
```
|
|
20
31
|
|
|
21
32
|
## Configuration
|
|
@@ -38,12 +49,14 @@ FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
|
38
49
|
|
|
39
50
|
### As OpenCode Plugin
|
|
40
51
|
|
|
41
|
-
Add to your OpenCode configuration:
|
|
52
|
+
Add to your OpenCode configuration (`opencode.config.ts`):
|
|
42
53
|
|
|
43
54
|
```typescript
|
|
44
|
-
import FixHivePlugin from '@fixhive
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
45
56
|
|
|
46
|
-
export default
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
47
60
|
```
|
|
48
61
|
|
|
49
62
|
### Available Commands
|
package/README.nl.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> Community-gebaseerd Foutkennis Delen voor OpenCode
|
|
15
|
+
|
|
16
|
+
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
|
+
|
|
18
|
+
## Functies
|
|
19
|
+
|
|
20
|
+
- **Automatische Foutdetectie**: Detecteert automatisch fouten uit tool-uitvoer (bash, edit, etc.)
|
|
21
|
+
- **Cloud Kennisbank**: Zoek community-oplossingen met semantische gelijkenis (pgvector)
|
|
22
|
+
- **Lokale Cache**: SQLite-gebaseerde lokale opslag voor offline toegang
|
|
23
|
+
- **Privacy Filtering**: Verwijdert automatisch gevoelige gegevens (API-sleutels, paden, e-mails)
|
|
24
|
+
- **Realtime Synchronisatie**: Directe cloudcommunicatie bij fout/oplossing
|
|
25
|
+
|
|
26
|
+
## Installatie
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuratie
|
|
33
|
+
|
|
34
|
+
Stel de volgende omgevingsvariabelen in:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Vereist voor cloudfuncties
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# Optioneel: Voor embedding-gebaseerd semantisch zoeken
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# Optioneel: Aangepaste bijdrager-ID (automatisch gegenereerd indien niet ingesteld)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Gebruik
|
|
49
|
+
|
|
50
|
+
### Als OpenCode Plugin
|
|
51
|
+
|
|
52
|
+
Voeg toe aan uw OpenCode-configuratie (`opencode.config.ts`):
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Beschikbare Commando's
|
|
63
|
+
|
|
64
|
+
| Commando | Beschrijving |
|
|
65
|
+
|----------|--------------|
|
|
66
|
+
| `fixhive_search` | Zoek foutoplossingen in de kennisbank |
|
|
67
|
+
| `fixhive_resolve` | Markeer fout als opgelost en deel oplossing |
|
|
68
|
+
| `fixhive_list` | Lijst fouten in huidige sessie |
|
|
69
|
+
| `fixhive_vote` | Stem voor/tegen een oplossing |
|
|
70
|
+
| `fixhive_stats` | Bekijk gebruiksstatistieken |
|
|
71
|
+
| `fixhive_helpful` | Meld dat een oplossing nuttig was |
|
|
72
|
+
|
|
73
|
+
### Voorbeeld Workflow
|
|
74
|
+
|
|
75
|
+
1. **Fout treedt op** → FixHive detecteert en registreert deze automatisch
|
|
76
|
+
2. **Zoek oplossingen** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **Pas fix toe** → Volg de community-oplossing
|
|
78
|
+
4. **Deel oplossing** → `fixhive_resolve <error-id> "Ontbrekende dependency geïnstalleerd"`
|
|
79
|
+
|
|
80
|
+
## Cloud Setup (Supabase)
|
|
81
|
+
|
|
82
|
+
1. Maak een nieuw Supabase-project aan
|
|
83
|
+
2. Voer het setup-script uit in de SQL-editor:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# Plak in Supabase SQL-editor
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Haal uw project-URL en anon-sleutel op via Settings > API
|
|
91
|
+
|
|
92
|
+
## Architectuur
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection (tool.execute.after hook)
|
|
97
|
+
├── Privacy Filter (verwijdert gevoelige gegevens)
|
|
98
|
+
├── Local Storage (SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client (Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Privacy
|
|
107
|
+
|
|
108
|
+
FixHive filtert automatisch gevoelige informatie:
|
|
109
|
+
|
|
110
|
+
- API-sleutels (OpenAI, GitHub, AWS, Stripe, etc.)
|
|
111
|
+
- JWT-tokens en Bearer-tokens
|
|
112
|
+
- E-mailadressen
|
|
113
|
+
- Bestandspaden (vervangen door `~` of `<PROJECT>`)
|
|
114
|
+
- Omgevingsvariabelen met gevoelige namen
|
|
115
|
+
- Database-verbindingsstrings
|
|
116
|
+
- IP-adressen (behalve localhost)
|
|
117
|
+
|
|
118
|
+
## Ontwikkeling
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Installeer dependencies
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Bouwen
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# Watch-modus
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# Type-controle
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# Tests uitvoeren
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Licentie
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## Bijdragen
|
|
142
|
+
|
|
143
|
+
1. Fork de repository
|
|
144
|
+
2. Maak uw feature-branch aan
|
|
145
|
+
3. Commit uw wijzigingen
|
|
146
|
+
4. Push naar de branch
|
|
147
|
+
5. Maak een Pull Request
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# FixHive
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="README.md">English</a> |
|
|
5
|
+
<a href="README.ko.md">한국어</a> |
|
|
6
|
+
<a href="README.zh.md">中文</a> |
|
|
7
|
+
<a href="README.ja.md">日本語</a> |
|
|
8
|
+
<a href="README.es.md">Español</a> |
|
|
9
|
+
<a href="README.de.md">Deutsch</a> |
|
|
10
|
+
<a href="README.fr.md">Français</a> |
|
|
11
|
+
<a href="README.nl.md">Nederlands</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> OpenCode 社区错误知识共享系统
|
|
15
|
+
|
|
16
|
+
FixHive 是一个 OpenCode 插件,可在开发会话期间自动捕获错误,从社区知识库查询解决方案,并与其他开发者共享已解决的错误。
|
|
17
|
+
|
|
18
|
+
## 功能特性
|
|
19
|
+
|
|
20
|
+
- **自动错误检测**:自动检测工具输出(bash、edit 等)中的错误
|
|
21
|
+
- **云端知识库**:使用语义相似度(pgvector)搜索社区解决方案
|
|
22
|
+
- **本地缓存**:基于 SQLite 的本地存储,支持离线访问
|
|
23
|
+
- **隐私过滤**:自动过滤敏感数据(API 密钥、路径、电子邮件)
|
|
24
|
+
- **实时同步**:错误/解决时立即与云端通信
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @the-magic-tower/fixhive-opencode-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 配置
|
|
33
|
+
|
|
34
|
+
设置以下环境变量:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 云端功能必需
|
|
38
|
+
FIXHIVE_SUPABASE_URL=https://your-project.supabase.co
|
|
39
|
+
FIXHIVE_SUPABASE_KEY=your-anon-key
|
|
40
|
+
|
|
41
|
+
# 可选:用于基于嵌入的语义搜索
|
|
42
|
+
OPENAI_API_KEY=sk-...
|
|
43
|
+
|
|
44
|
+
# 可选:自定义贡献者 ID(未设置时自动生成)
|
|
45
|
+
FIXHIVE_CONTRIBUTOR_ID=your-contributor-id
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 使用方法
|
|
49
|
+
|
|
50
|
+
### 作为 OpenCode 插件
|
|
51
|
+
|
|
52
|
+
添加到 OpenCode 配置文件(`opencode.config.ts`):
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import FixHivePlugin from '@the-magic-tower/fixhive-opencode-plugin';
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
plugins: [FixHivePlugin],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 可用命令
|
|
63
|
+
|
|
64
|
+
| 命令 | 描述 |
|
|
65
|
+
|------|------|
|
|
66
|
+
| `fixhive_search` | 搜索错误解决方案知识库 |
|
|
67
|
+
| `fixhive_resolve` | 将错误标记为已解决并共享解决方案 |
|
|
68
|
+
| `fixhive_list` | 列出当前会话中的错误 |
|
|
69
|
+
| `fixhive_vote` | 对解决方案投票(赞/踩) |
|
|
70
|
+
| `fixhive_stats` | 查看使用统计 |
|
|
71
|
+
| `fixhive_helpful` | 报告解决方案有帮助 |
|
|
72
|
+
|
|
73
|
+
### 示例工作流程
|
|
74
|
+
|
|
75
|
+
1. **发生错误** → FixHive 自动检测并记录
|
|
76
|
+
2. **搜索解决方案** → `fixhive_search "Module not found: react"`
|
|
77
|
+
3. **应用修复** → 按照社区解决方案操作
|
|
78
|
+
4. **共享解决方案** → `fixhive_resolve <error-id> "安装缺失的依赖"`
|
|
79
|
+
|
|
80
|
+
## 云端设置(Supabase)
|
|
81
|
+
|
|
82
|
+
1. 创建新的 Supabase 项目
|
|
83
|
+
2. 在 SQL 编辑器中运行设置脚本:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cat scripts/setup-supabase.sql | pbcopy
|
|
87
|
+
# 粘贴到 Supabase SQL 编辑器
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. 从 Settings > API 获取项目 URL 和 anon key
|
|
91
|
+
|
|
92
|
+
## 架构
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
FixHive Plugin
|
|
96
|
+
├── Error Detection(tool.execute.after 钩子)
|
|
97
|
+
├── Privacy Filter(过滤敏感数据)
|
|
98
|
+
├── Local Storage(SQLite)
|
|
99
|
+
│ ├── error_records
|
|
100
|
+
│ └── query_cache
|
|
101
|
+
└── Cloud Client(Supabase + pgvector)
|
|
102
|
+
├── knowledge_entries
|
|
103
|
+
└── usage_logs
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 隐私保护
|
|
107
|
+
|
|
108
|
+
FixHive 自动过滤敏感信息:
|
|
109
|
+
|
|
110
|
+
- API 密钥(OpenAI、GitHub、AWS、Stripe 等)
|
|
111
|
+
- JWT 令牌和 Bearer 令牌
|
|
112
|
+
- 电子邮件地址
|
|
113
|
+
- 文件路径(替换为 `~` 或 `<PROJECT>`)
|
|
114
|
+
- 包含敏感名称的环境变量
|
|
115
|
+
- 数据库连接字符串
|
|
116
|
+
- IP 地址(localhost 除外)
|
|
117
|
+
|
|
118
|
+
## 开发
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# 安装依赖
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# 构建
|
|
125
|
+
npm run build
|
|
126
|
+
|
|
127
|
+
# 监视模式
|
|
128
|
+
npm run dev
|
|
129
|
+
|
|
130
|
+
# 类型检查
|
|
131
|
+
npm run typecheck
|
|
132
|
+
|
|
133
|
+
# 运行测试
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 许可证
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
## 贡献
|
|
142
|
+
|
|
143
|
+
1. Fork 仓库
|
|
144
|
+
2. 创建功能分支
|
|
145
|
+
3. 提交更改
|
|
146
|
+
4. 推送到分支
|
|
147
|
+
5. 创建 Pull Request
|
package/dist/index.js
CHANGED
|
@@ -1254,19 +1254,41 @@ ${errorRecord.errorStack || ""}`;
|
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
1256
|
/**
|
|
1257
|
-
* Vote on a knowledge entry
|
|
1257
|
+
* Vote on a knowledge entry (with duplicate vote prevention)
|
|
1258
1258
|
*/
|
|
1259
1259
|
async vote(knowledgeId, helpful) {
|
|
1260
|
-
const
|
|
1261
|
-
await this.supabase.rpc("
|
|
1262
|
-
|
|
1263
|
-
|
|
1260
|
+
const voteType = helpful ? "up" : "down";
|
|
1261
|
+
const { data, error } = await this.supabase.rpc("safe_vote", {
|
|
1262
|
+
p_entry_id: knowledgeId,
|
|
1263
|
+
p_user_hash: this.contributorId,
|
|
1264
|
+
p_vote_type: voteType
|
|
1264
1265
|
});
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1266
|
+
if (error) {
|
|
1267
|
+
return { success: false, error: error.message };
|
|
1268
|
+
}
|
|
1269
|
+
const result = data;
|
|
1270
|
+
if (result.success) {
|
|
1271
|
+
await this.supabase.from("usage_logs").insert({
|
|
1272
|
+
knowledge_id: knowledgeId,
|
|
1273
|
+
action: helpful ? "upvote" : "downvote",
|
|
1274
|
+
user_hash: this.contributorId
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
return result;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Report an entry for review
|
|
1281
|
+
*/
|
|
1282
|
+
async reportEntry(knowledgeId, reason) {
|
|
1283
|
+
const { data, error } = await this.supabase.rpc("report_entry", {
|
|
1284
|
+
p_entry_id: knowledgeId,
|
|
1285
|
+
p_user_hash: this.contributorId,
|
|
1286
|
+
p_reason: reason || null
|
|
1269
1287
|
});
|
|
1288
|
+
if (error) {
|
|
1289
|
+
return { success: false };
|
|
1290
|
+
}
|
|
1291
|
+
return data;
|
|
1270
1292
|
}
|
|
1271
1293
|
/**
|
|
1272
1294
|
* Report helpful usage
|
|
@@ -1452,10 +1474,33 @@ function createTools(localStore, cloudClient, privacyFilter, context) {
|
|
|
1452
1474
|
helpful: tool.schema.boolean().describe("True for upvote, false for downvote")
|
|
1453
1475
|
},
|
|
1454
1476
|
async execute(args) {
|
|
1455
|
-
await cloudClient.vote(args.knowledgeId, args.helpful);
|
|
1477
|
+
const result = await cloudClient.vote(args.knowledgeId, args.helpful);
|
|
1478
|
+
if (!result.success) {
|
|
1479
|
+
if (result.error === "Already voted") {
|
|
1480
|
+
return "You have already voted on this solution.";
|
|
1481
|
+
}
|
|
1482
|
+
return `Vote failed: ${result.error}`;
|
|
1483
|
+
}
|
|
1456
1484
|
return args.helpful ? "Thanks for the feedback! Solution upvoted." : "Thanks for the feedback! Solution downvoted.";
|
|
1457
1485
|
}
|
|
1458
1486
|
}),
|
|
1487
|
+
/**
|
|
1488
|
+
* Report inappropriate content
|
|
1489
|
+
*/
|
|
1490
|
+
fixhive_report: tool({
|
|
1491
|
+
description: "Report a FixHive solution for inappropriate content, spam, or incorrect information.",
|
|
1492
|
+
args: {
|
|
1493
|
+
knowledgeId: tool.schema.string().describe("Knowledge entry ID to report"),
|
|
1494
|
+
reason: tool.schema.string().optional().describe("Reason for reporting (spam, incorrect, inappropriate, etc.)")
|
|
1495
|
+
},
|
|
1496
|
+
async execute(args) {
|
|
1497
|
+
const result = await cloudClient.reportEntry(args.knowledgeId, args.reason);
|
|
1498
|
+
if (!result.success) {
|
|
1499
|
+
return "Failed to submit report. Please try again later.";
|
|
1500
|
+
}
|
|
1501
|
+
return "Report submitted. Thank you for helping keep FixHive clean!";
|
|
1502
|
+
}
|
|
1503
|
+
}),
|
|
1459
1504
|
/**
|
|
1460
1505
|
* Get usage statistics
|
|
1461
1506
|
*/
|
|
@@ -1691,10 +1736,14 @@ ${errors.map((e) => `- [${e.id.slice(0, 8)}] ${e.errorType}: ${e.errorMessage.sl
|
|
|
1691
1736
|
})
|
|
1692
1737
|
};
|
|
1693
1738
|
}
|
|
1739
|
+
var COMMUNITY_SUPABASE = {
|
|
1740
|
+
url: "https://flpqzkrpufrgnpxvftip.supabase.co",
|
|
1741
|
+
anonKey: "sb_publishable_w3Y2uo-0vb4bFVamntChVw_Aqi0rv2y"
|
|
1742
|
+
};
|
|
1694
1743
|
function loadConfig() {
|
|
1695
1744
|
return {
|
|
1696
|
-
supabaseUrl: process.env.FIXHIVE_SUPABASE_URL ||
|
|
1697
|
-
supabaseAnonKey: process.env.FIXHIVE_SUPABASE_KEY ||
|
|
1745
|
+
supabaseUrl: process.env.FIXHIVE_SUPABASE_URL || COMMUNITY_SUPABASE.url,
|
|
1746
|
+
supabaseAnonKey: process.env.FIXHIVE_SUPABASE_KEY || COMMUNITY_SUPABASE.anonKey,
|
|
1698
1747
|
openaiApiKey: process.env.OPENAI_API_KEY || process.env.FIXHIVE_OPENAI_KEY || "",
|
|
1699
1748
|
contributorId: process.env.FIXHIVE_CONTRIBUTOR_ID || "",
|
|
1700
1749
|
cacheExpirationMs: DEFAULT_CONFIG.cacheExpirationMs,
|