@meiti/healer 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +35 -2
- package/healer-mcp.mjs +18 -0
- package/instalar.mjs +203 -0
- package/mcp/servidor.mjs +303 -0
- package/package.json +35 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MEITI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @meiti/healer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connect [Healer](https://meiti.dev/healer) to Claude Code, DeepSeek Harness or any MCP agent in about a minute.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx @meiti/healer
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
1. You get a short code, like `HEAL-7K2Q-ABCD`, and the browser opens.
|
|
10
|
+
2. Sign in to Healer if asked, check that the code matches and press Approve.
|
|
11
|
+
3. Done. The key is saved in `~/.healer/config.json` (readable only by you, never printed) and the Healer plugin is installed in Claude Code. Type `/healer` in any project.
|
|
12
|
+
|
|
13
|
+
Prefer to let your agent do it? Tell it: **"Install Healer: meiti.dev/healer/install.txt"**. The agent runs the installer; approving the code is always your step.
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
| Option | What it does |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `--for "<agent>"` | Name shown on the approval page and on the new key (default: Claude Code) |
|
|
20
|
+
| `--no-plugin` | Only connect, do not install the Claude Code plugin |
|
|
21
|
+
| `--no-browser` | Do not open the browser, just print the link |
|
|
22
|
+
| `--reconnect` | Get a new key even if one is already saved |
|
|
23
|
+
|
|
24
|
+
## For other MCP agents
|
|
25
|
+
|
|
26
|
+
This package also ships the Healer MCP server, which reads the saved key:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npx -y -p @meiti/healer healer-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Free level and your code
|
|
33
|
+
|
|
34
|
+
The free level repairs with free AI providers, which may keep and use what they receive, and the repaired code may be used to train Healer's models. On the pro level none of your code is used for training. For private code, use pro.
|
|
35
|
+
|
|
36
|
+
MIT license.
|
package/healer-mcp.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// healer-mcp: el servidor MCP de Healer para agentes que no son Claude Code (DeepSeek Harness, Cursor, cualquier cliente
|
|
3
|
+
// MCP por stdio). El servidor lee la clave de un solo lugar, CLAUDE_PLUGIN_OPTION_API_KEY (en Claude Code es la opción
|
|
4
|
+
// sensible del plugin); acá se le pone desde HEALER_API_KEY o desde ~/.healer/config.json, que escribe el instalador.
|
|
5
|
+
// Este archivo va solo en el paquete npm, nunca dentro del plugin de Claude Code.
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import os from 'node:os';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
|
|
10
|
+
if (!process.env.CLAUDE_PLUGIN_OPTION_API_KEY) {
|
|
11
|
+
let clave = (process.env.HEALER_API_KEY || '').trim();
|
|
12
|
+
if (!clave) {
|
|
13
|
+
try { clave = String(JSON.parse(fs.readFileSync(path.join(os.homedir(), '.healer', 'config.json'), 'utf8')).api_key || '').trim(); } catch { /* sin conectar: el servidor lo dice en la primera llamada */ }
|
|
14
|
+
}
|
|
15
|
+
process.env.CLAUDE_PLUGIN_OPTION_API_KEY = clave;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
await import('./mcp/servidor.mjs');
|
package/instalar.mjs
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// 🩺 npx @meiti/healer (2026-11-09, pedido del usuario: "ideamos una forma más divertida de instalarlo?").
|
|
3
|
+
// Conecta Healer sin copiar ni pegar claves: pide un código corto, la persona lo confirma en el navegador con su
|
|
4
|
+
// sesión, la clave llega sola y se guarda en ~/.healer/config.json (solo lectura para su dueño). Después instala el
|
|
5
|
+
// plugin de Claude Code si está la CLI. Sin dependencias: solo Node 18+.
|
|
6
|
+
//
|
|
7
|
+
// Lo corre una persona o lo corre su agente ("instala Healer"): en los dos casos, el paso de confirmar el código es de
|
|
8
|
+
// la persona. Este script no tiene forma de aprobarse solo, y nunca imprime la clave.
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import os from 'node:os';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import { spawnSync, spawn } from 'node:child_process';
|
|
13
|
+
|
|
14
|
+
const API = (process.env.HEALER_API_URL || 'https://healer-api.meiti.dev').replace(/\/$/, '');
|
|
15
|
+
const CARPETA = path.join(os.homedir(), '.healer');
|
|
16
|
+
const CONFIG = path.join(CARPETA, 'config.json');
|
|
17
|
+
const MARKETPLACE = 'meiti-dev/healer-claude-plugin';
|
|
18
|
+
const PLUGIN = 'healer@meiti';
|
|
19
|
+
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const reconectar = args.includes('--reconnect') || args.includes('--reconectar');
|
|
22
|
+
const sinNavegador = args.includes('--no-browser') || !process.stdout.isTTY;
|
|
23
|
+
const sinPlugin = args.includes('--no-plugin');
|
|
24
|
+
const paraIdx = args.indexOf('--for');
|
|
25
|
+
const cliente = paraIdx >= 0 && args[paraIdx + 1] ? args[paraIdx + 1] : 'Claude Code';
|
|
26
|
+
|
|
27
|
+
const es = /^es/i.test(process.env.HEALER_LANG || Intl.DateTimeFormat().resolvedOptions().locale || '');
|
|
28
|
+
const T = es ? {
|
|
29
|
+
hola: 'Hola. Vamos a conectar Healer en un minuto.',
|
|
30
|
+
yaConectado: 'Healer ya está conectado en esta computadora.',
|
|
31
|
+
claveRota: 'La clave guardada ya no sirve (revocada o vencida). Pidamos una nueva.',
|
|
32
|
+
pidiendo: 'Pidiendo un código...',
|
|
33
|
+
tuCodigo: 'Tu código:',
|
|
34
|
+
abre: 'Confírmalo en tu navegador:',
|
|
35
|
+
abriendo: '(lo abro solo; si no se abre, copia la dirección)',
|
|
36
|
+
esperando: 'Esperando tu confirmación',
|
|
37
|
+
conectado: '¡Conectado!',
|
|
38
|
+
guardada: 'Clave guardada en',
|
|
39
|
+
rechazado: 'Cancelaste la conexión. Cuando quieras, corre esto de nuevo.',
|
|
40
|
+
vencido: 'El código venció (dura 10 minutos). Corre esto de nuevo para pedir otro.',
|
|
41
|
+
plugin: 'Instalando el plugin de Claude Code...',
|
|
42
|
+
pluginOk: 'Plugin instalado.',
|
|
43
|
+
pluginYa: 'El plugin ya estaba instalado.',
|
|
44
|
+
claveEnPlugin: 'Clave guardada en el plugin. Si Claude Code estaba abierto, reinícialo.',
|
|
45
|
+
claveEnPluginFallo: 'No pude guardar la clave en el plugin. Adentro de Claude Code: /plugin > healer > Configure.',
|
|
46
|
+
sinClaude: 'No encontré Claude Code en esta computadora. Cuando lo tengas, adentro escribe:',
|
|
47
|
+
pluginFallo: 'No pude instalar el plugin solo. Adentro de Claude Code escribe:',
|
|
48
|
+
listo: 'Listo. Abre Claude Code en tu proyecto y escribe',
|
|
49
|
+
listoOtros: 'Para otros agentes (DeepSeek Harness, Cursor), agrega este servidor MCP; lee la misma clave:',
|
|
50
|
+
gratis: 'Nivel gratis: repara con proveedores de IA gratuitos, que pueden guardar lo que reciben, y el código reparado puede usarse para entrenar. Para código privado, usa /healer pro.',
|
|
51
|
+
error: 'Algo falló:'
|
|
52
|
+
} : {
|
|
53
|
+
hola: "Hi. Let's connect Healer in about a minute.",
|
|
54
|
+
yaConectado: 'Healer is already connected on this computer.',
|
|
55
|
+
claveRota: 'The saved key no longer works (revoked or expired). Let us get a new one.',
|
|
56
|
+
pidiendo: 'Asking for a code...',
|
|
57
|
+
tuCodigo: 'Your code:',
|
|
58
|
+
abre: 'Confirm it in your browser:',
|
|
59
|
+
abriendo: '(opening it for you; if it does not open, copy the address)',
|
|
60
|
+
esperando: 'Waiting for your confirmation',
|
|
61
|
+
conectado: 'Connected!',
|
|
62
|
+
guardada: 'Key saved in',
|
|
63
|
+
rechazado: 'You cancelled the connection. Run this again whenever you want.',
|
|
64
|
+
vencido: 'The code expired (it lasts 10 minutes). Run this again to get a new one.',
|
|
65
|
+
plugin: 'Installing the Claude Code plugin...',
|
|
66
|
+
pluginOk: 'Plugin installed.',
|
|
67
|
+
pluginYa: 'The plugin was already installed.',
|
|
68
|
+
claveEnPlugin: 'Key saved in the plugin. If Claude Code was open, restart it.',
|
|
69
|
+
claveEnPluginFallo: 'Could not save the key in the plugin. Inside Claude Code: /plugin > healer > Configure.',
|
|
70
|
+
sinClaude: 'Claude Code is not on this computer. Once you have it, type inside it:',
|
|
71
|
+
pluginFallo: 'Could not install the plugin automatically. Inside Claude Code, type:',
|
|
72
|
+
listo: 'All set. Open Claude Code in your project and type',
|
|
73
|
+
listoOtros: 'For other agents (DeepSeek Harness, Cursor), add this MCP server; it reads the same key:',
|
|
74
|
+
gratis: 'Free level: repairs with free AI providers, which may keep what they receive, and the repaired code may be used for training. For private code, use /healer pro.',
|
|
75
|
+
error: 'Something went wrong:'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const color = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
79
|
+
const c = (n, s) => (color ? `\x1b[${n}m${s}\x1b[0m` : s);
|
|
80
|
+
const verde = (s) => c(32, s), gris = (s) => c(90, s), negrita = (s) => c(1, s), cian = (s) => c(36, s);
|
|
81
|
+
|
|
82
|
+
const LOGO = `
|
|
83
|
+
${verde('+')} ${negrita('H E A L E R')}
|
|
84
|
+
${verde('+++')} ${gris('repaired or equal, never worse')}
|
|
85
|
+
${verde('+')}`;
|
|
86
|
+
|
|
87
|
+
async function api(ruta, cuerpo, clave) {
|
|
88
|
+
const headers = { 'content-type': 'application/json', 'user-agent': 'healer-installer/0.1.0' };
|
|
89
|
+
if (clave) headers['x-api-key'] = clave;
|
|
90
|
+
const r = await fetch(API + ruta, { method: cuerpo ? 'POST' : 'GET', headers, body: cuerpo ? JSON.stringify(cuerpo) : undefined });
|
|
91
|
+
const datos = await r.json().catch(() => ({}));
|
|
92
|
+
return { status: r.status, datos };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function leerConfig() {
|
|
96
|
+
try { return JSON.parse(fs.readFileSync(CONFIG, 'utf8')); } catch { return null; }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function guardarConfig(apiKey) {
|
|
100
|
+
fs.mkdirSync(CARPETA, { recursive: true, mode: 0o700 });
|
|
101
|
+
fs.writeFileSync(CONFIG, JSON.stringify({ api_key: apiKey, api_url: API, conectado: new Date().toISOString() }, null, 2) + '\n', { mode: 0o600 });
|
|
102
|
+
try { fs.chmodSync(CONFIG, 0o600); } catch { /* Windows: el archivo ya queda en la carpeta del usuario */ }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Un job que no existe responde 404 con una clave buena y 401 con una mala: sirve para probarla sin gastar nada.
|
|
106
|
+
async function claveSirve(clave) {
|
|
107
|
+
try { return (await api('/v1/repair/00000000-0000-0000-0000-000000000000', null, clave)).status !== 401; } catch { return true; }
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function abrirNavegador(url) {
|
|
111
|
+
const [cmd, a] = process.platform === 'win32' ? ['cmd', ['/c', 'start', '', url]] : process.platform === 'darwin' ? ['open', [url]] : ['xdg-open', [url]];
|
|
112
|
+
try { spawn(cmd, a, { stdio: 'ignore', detached: true }).unref(); } catch { /* sin navegador: queda la dirección impresa */ }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const esperar = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
116
|
+
|
|
117
|
+
async function conectar() {
|
|
118
|
+
console.log('\n' + T.pidiendo);
|
|
119
|
+
const { status, datos } = await api('/conectar/iniciar', { cliente });
|
|
120
|
+
if (status !== 200) throw new Error(datos.error || `HTTP ${status}`);
|
|
121
|
+
console.log(`\n ${T.tuCodigo} ${negrita(cian(datos.codigo_usuario))}\n`);
|
|
122
|
+
console.log(` ${T.abre}\n ${cian(datos.url)}`);
|
|
123
|
+
if (!sinNavegador) { console.log(gris(` ${T.abriendo}`)); abrirNavegador(datos.url); }
|
|
124
|
+
process.stdout.write(`\n ${T.esperando} `);
|
|
125
|
+
const fin = Date.now() + datos.vence_en_segundos * 1000;
|
|
126
|
+
const giro = ['. ', '.. ', '...'];
|
|
127
|
+
let i = 0;
|
|
128
|
+
while (Date.now() < fin) {
|
|
129
|
+
await esperar((datos.intervalo_segundos || 3) * 1000);
|
|
130
|
+
const r = await api('/conectar/consultar', { codigo_dispositivo: datos.codigo_dispositivo }).catch(() => null);
|
|
131
|
+
const estado = r?.datos?.estado;
|
|
132
|
+
if (estado === 'aprobado') { process.stdout.write('\n'); return r.datos.api_key; }
|
|
133
|
+
if (estado === 'rechazado') { console.log('\n\n' + T.rechazado); process.exit(1); }
|
|
134
|
+
if (estado === 'vencido') break;
|
|
135
|
+
if (process.stdout.isTTY) process.stdout.write(`\r ${T.esperando} ${giro[i++ % 3]}`);
|
|
136
|
+
}
|
|
137
|
+
console.log('\n\n' + T.vencido);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function hayClaude() {
|
|
142
|
+
const r = spawnSync(process.platform === 'win32' ? 'where' : 'which', ['claude'], { stdio: 'ignore' });
|
|
143
|
+
return r.status === 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// La CLI se corre desde una carpeta propia y vacía: arrancada desde la carpeta del usuario, Claude Code se niega
|
|
147
|
+
// ("unsafe location") y el marketplace no se agrega.
|
|
148
|
+
// En Windows `claude` es un .cmd y solo arranca con shell; ahí se arma la línea entera (los argumentos son siempre
|
|
149
|
+
// constantes de este archivo, nunca algo que venga de afuera; la clave viaja por stdin).
|
|
150
|
+
function claude(argumentos, entrada) {
|
|
151
|
+
if (process.platform === 'win32') return spawnSync(['claude', ...argumentos].join(' '), { cwd: CARPETA, encoding: 'utf8', shell: true, input: entrada });
|
|
152
|
+
return spawnSync('claude', argumentos, { cwd: CARPETA, encoding: 'utf8', input: entrada });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// El plugin de Claude Code recibe la clave por su opción sensible (userConfig api_key), que Claude Code guarda con sus
|
|
156
|
+
// propios secretos: el directorio oficial de plugins pide eso en vez de que el plugin la lea de la máquina. La clave va
|
|
157
|
+
// por stdin, nunca como argumento (no queda en el historial ni en la lista de procesos).
|
|
158
|
+
function instalarPlugin(clave) {
|
|
159
|
+
const manual = ` /plugin marketplace add ${MARKETPLACE}\n /plugin install ${PLUGIN}`;
|
|
160
|
+
if (!hayClaude()) { console.log(`\n${T.sinClaude}\n${cian(manual)}`); return; }
|
|
161
|
+
if ((claude(['plugin', 'list']).stdout || '').includes(PLUGIN)) {
|
|
162
|
+
// Una versión vieja no tiene la opción de la clave: se actualiza antes de guardarla.
|
|
163
|
+
claude(['plugin', 'marketplace', 'update', 'meiti']);
|
|
164
|
+
claude(['plugin', 'update', PLUGIN]);
|
|
165
|
+
console.log(`\n${verde('✓')} ${T.pluginYa}`);
|
|
166
|
+
} else {
|
|
167
|
+
console.log('\n' + T.plugin);
|
|
168
|
+
claude(['plugin', 'marketplace', 'add', MARKETPLACE]); // si ya estaba agregado falla, y está bien
|
|
169
|
+
const r = claude(['plugin', 'install', PLUGIN]);
|
|
170
|
+
if (r.status !== 0) { console.log(`${T.pluginFallo}\n${cian(manual)}`); return; }
|
|
171
|
+
console.log(`${verde('✓')} ${T.pluginOk}`);
|
|
172
|
+
}
|
|
173
|
+
if (!clave) return;
|
|
174
|
+
const c = claude(['plugin', 'configure', PLUGIN, '--values-stdin'], JSON.stringify({ api_key: clave }));
|
|
175
|
+
if (c.status === 0) console.log(`${verde('✓')} ${T.claveEnPlugin}`);
|
|
176
|
+
else console.log(T.claveEnPluginFallo);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
async function main() {
|
|
180
|
+
console.log(LOGO + '\n');
|
|
181
|
+
console.log(T.hola);
|
|
182
|
+
fs.mkdirSync(CARPETA, { recursive: true, mode: 0o700 });
|
|
183
|
+
|
|
184
|
+
const previa = leerConfig();
|
|
185
|
+
let conectadoAntes = false;
|
|
186
|
+
if (previa?.api_key && !reconectar) {
|
|
187
|
+
if (await claveSirve(previa.api_key)) { console.log(`\n${verde('✓')} ${T.yaConectado}`); conectadoAntes = true; }
|
|
188
|
+
else console.log('\n' + T.claveRota);
|
|
189
|
+
}
|
|
190
|
+
if (!conectadoAntes) {
|
|
191
|
+
const clave = await conectar();
|
|
192
|
+
guardarConfig(clave);
|
|
193
|
+
console.log(`\n${verde('✓')} ${negrita(T.conectado)} ${gris(`${T.guardada} ${CONFIG}`)}`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (!sinPlugin) instalarPlugin(leerConfig()?.api_key || '');
|
|
197
|
+
|
|
198
|
+
console.log(`\n${T.listo} ${negrita(cian('/healer'))}`);
|
|
199
|
+
console.log(gris(`\n${T.gratis}`));
|
|
200
|
+
console.log(gris(`${T.listoOtros} npx -y -p @meiti/healer healer-mcp\n`));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
main().catch((e) => { console.error(`\n${T.error} ${e.message}`); process.exit(1); });
|
package/mcp/servidor.mjs
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// 🩺 Healer para Claude Code (2026-11-09): servidor MCP sin dependencias (solo Node 18+), por stdio, JSON-RPC 2.0.
|
|
3
|
+
// Tres herramientas sobre la API pública de Healer (las mismas de la GitHub Action y del SDK):
|
|
4
|
+
// healer_revisar arma el proyecto (lo que git mandaría según los .gitignore, nunca archivos de secretos) y lo manda a reparar.
|
|
5
|
+
// healer_resultado consulta el trabajo; al terminar guarda la propuesta y devuelve el resumen y el diff.
|
|
6
|
+
// healer_aplicar escribe los archivos corregidos SOLO si cada uno sigue igual a como se mandó (base_hashes).
|
|
7
|
+
// Nunca escribe nada sin que se llame healer_aplicar, y el comando /healer le pide a Claude confirmar antes.
|
|
8
|
+
// La clave llega SOLO por CLAUDE_PLUGIN_OPTION_API_KEY: en Claude Code es la opción sensible del plugin (la guarda el
|
|
9
|
+
// instalador de Healer); para otros agentes la pone healer-mcp.mjs del paquete npm, que vive fuera de este plugin.
|
|
10
|
+
// Nunca se imprime.
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import os from 'node:os';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import crypto from 'node:crypto';
|
|
15
|
+
import readline from 'node:readline';
|
|
16
|
+
|
|
17
|
+
const VERSION = '0.3.3';
|
|
18
|
+
const API = (process.env.HEALER_API_URL || 'https://healer-api.meiti.dev').replace(/\/$/, '');
|
|
19
|
+
const leerClave = () => String(process.env.CLAUDE_PLUGIN_OPTION_API_KEY || '').trim();
|
|
20
|
+
const ESTADO = path.join(os.tmpdir(), 'healer-claude-code');
|
|
21
|
+
const TOPE_ARCHIVO = 1_000_000;
|
|
22
|
+
const TOPE_TOTAL = 18 * 1024 * 1024;
|
|
23
|
+
const IGNORAR = new Set(['.git', 'node_modules', '.venv', 'venv', 'dist', 'build', '.next', 'coverage', '__pycache__', '.healer', '.turbo', '.cache']);
|
|
24
|
+
|
|
25
|
+
// ───────────────────────────── Proyecto ─────────────────────────────
|
|
26
|
+
|
|
27
|
+
// Archivos de secretos: nunca salen de la máquina, aunque el proyecto se haya olvidado de ignorarlos.
|
|
28
|
+
const SECRETO = /^(\.env(\..+)?|.*\.(pem|key|p12|pfx|keystore|jks)|id_(rsa|dsa|ecdsa|ed25519)(\.pub)?|\.npmrc|\.pypirc|\.netrc|credentials(\.json)?)$/i;
|
|
29
|
+
const PLANTILLA_ENV = /^\.env\.(example|sample|template|dist)$/i;
|
|
30
|
+
|
|
31
|
+
// Una línea de .gitignore → expresión regular sobre la ruta relativa a la carpeta del .gitignore. Cubre lo que se usa en
|
|
32
|
+
// la práctica: comentarios, "!" para volver a incluir, "/" final (solo carpetas), "/" inicial o en el medio (anclado),
|
|
33
|
+
// *, ?, ** y [clases]. Antes esto lo hacía `git ls-files`; se hace acá para que el plugin no ejecute ningún programa.
|
|
34
|
+
function reglaGitignore(linea) {
|
|
35
|
+
let l = linea.replace(/\r$/, '');
|
|
36
|
+
if (!l.trim() || l.startsWith('#')) return null;
|
|
37
|
+
l = l.replace(/(?<!\\)\s+$/, '');
|
|
38
|
+
const negada = l.startsWith('!');
|
|
39
|
+
if (negada) l = l.slice(1);
|
|
40
|
+
l = l.replace(/^\\([#!])/, '$1');
|
|
41
|
+
const soloCarpeta = l.endsWith('/');
|
|
42
|
+
if (soloCarpeta) l = l.slice(0, -1);
|
|
43
|
+
const anclada = l.includes('/');
|
|
44
|
+
if (l.startsWith('/')) l = l.slice(1);
|
|
45
|
+
let re = '';
|
|
46
|
+
for (let i = 0; i < l.length; i++) {
|
|
47
|
+
const c = l[i];
|
|
48
|
+
if (c === '*' && l[i + 1] === '*') {
|
|
49
|
+
if (l[i + 2] === '/') { re += '(?:.*/)?'; i += 2; } else { re += '.*'; i += 1; }
|
|
50
|
+
} else if (c === '*') re += '[^/]*';
|
|
51
|
+
else if (c === '?') re += '[^/]';
|
|
52
|
+
else if (c === '[') { const fin = l.indexOf(']', i + 1); if (fin > i) { re += '[' + l.slice(i + 1, fin).replace(/^!/, '^').replace(/\\/g, '\\\\') + ']'; i = fin; } else re += '\\['; }
|
|
53
|
+
else if (c === '\\' && i + 1 < l.length) { re += l[i + 1].replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); i++; }
|
|
54
|
+
else re += c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
55
|
+
}
|
|
56
|
+
return { negada, soloCarpeta, re: new RegExp(anclada ? `^${re}$` : `(?:^|/)${re}$`) };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function leerReglas(archivo, base) {
|
|
60
|
+
try { return fs.readFileSync(archivo, 'utf8').split('\n').map(reglaGitignore).filter(Boolean).map((r) => ({ ...r, base })); } catch { return []; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Gana la última regla que coincide, como en git. `rel` es la ruta relativa a la raíz del proyecto.
|
|
64
|
+
function ignorado(rel, esCarpeta, reglas) {
|
|
65
|
+
let resultado = false;
|
|
66
|
+
for (const r of reglas) {
|
|
67
|
+
if (r.soloCarpeta && !esCarpeta) continue;
|
|
68
|
+
const local = r.base ? (rel.startsWith(r.base + '/') ? rel.slice(r.base.length + 1) : null) : rel;
|
|
69
|
+
if (local !== null && r.re.test(local)) resultado = !r.negada;
|
|
70
|
+
}
|
|
71
|
+
return resultado;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function archivosDelProyecto(raiz) {
|
|
75
|
+
// Lo que git mandaría: respeta los .gitignore del proyecto (en cada carpeta) y .git/info/exclude.
|
|
76
|
+
const rutas = [];
|
|
77
|
+
const recorrer = (dir, rel, reglas) => {
|
|
78
|
+
const propias = [...reglas, ...leerReglas(path.join(dir, '.gitignore'), rel)];
|
|
79
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
80
|
+
if (IGNORAR.has(e.name) || e.isSymbolicLink()) continue;
|
|
81
|
+
const r = rel ? `${rel}/${e.name}` : e.name;
|
|
82
|
+
if (ignorado(r, e.isDirectory(), propias)) continue;
|
|
83
|
+
if (e.isDirectory()) recorrer(path.join(dir, e.name), r, propias);
|
|
84
|
+
else if (e.isFile() && (!SECRETO.test(e.name) || PLANTILLA_ENV.test(e.name))) rutas.push(r);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
recorrer(raiz, '', leerReglas(path.join(raiz, '.git', 'info', 'exclude'), ''));
|
|
88
|
+
const files = {};
|
|
89
|
+
let total = 0;
|
|
90
|
+
let omitidos = 0;
|
|
91
|
+
for (const ruta of rutas) {
|
|
92
|
+
if (ruta.split('/').some((parte) => IGNORAR.has(parte))) continue;
|
|
93
|
+
const p = path.join(raiz, ruta);
|
|
94
|
+
let buf;
|
|
95
|
+
try { const info = fs.statSync(p); if (!info.isFile() || info.size > TOPE_ARCHIVO) { omitidos++; continue; } buf = fs.readFileSync(p); } catch { continue; }
|
|
96
|
+
if (buf.includes(0)) { omitidos++; continue; } // binario
|
|
97
|
+
if (total + buf.length > TOPE_TOTAL) { omitidos++; continue; }
|
|
98
|
+
files[ruta] = buf.toString('utf8');
|
|
99
|
+
total += buf.length;
|
|
100
|
+
}
|
|
101
|
+
return { files, total, omitidos };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const sha256 = (texto) => crypto.createHash('sha256').update(texto, 'utf8').digest('hex');
|
|
105
|
+
|
|
106
|
+
// ───────────────────────────── API de Healer ─────────────────────────────
|
|
107
|
+
|
|
108
|
+
async function api(metodo, ruta, cuerpo) {
|
|
109
|
+
const CLAVE = leerClave();
|
|
110
|
+
if (!CLAVE) {
|
|
111
|
+
throw new Error('Healer is not connected yet. To connect it, see meiti.dev/healer. In Claude Code you can also paste an API key in /plugin > healer > Configure and restart Claude Code.');
|
|
112
|
+
}
|
|
113
|
+
const r = await fetch(API + ruta, { method: metodo, headers: { 'x-api-key': CLAVE, 'content-type': 'application/json', 'user-agent': `healer-claude-code/${VERSION}` }, body: cuerpo ? JSON.stringify(cuerpo) : undefined });
|
|
114
|
+
const datos = await r.json().catch(() => ({}));
|
|
115
|
+
if (!r.ok) throw new Error(`Healer answered ${r.status}: ${datos.error || 'no detail'}`);
|
|
116
|
+
return datos;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const archivoDeTrabajo = (jobId) => path.join(ESTADO, `${String(jobId).replace(/[^\w-]/g, '')}.json`);
|
|
120
|
+
|
|
121
|
+
// ───────────────────────────── Herramientas ─────────────────────────────
|
|
122
|
+
|
|
123
|
+
async function revisar({ ruta, nivel, tests }) {
|
|
124
|
+
const raiz = path.resolve(ruta || process.cwd());
|
|
125
|
+
if (!fs.existsSync(raiz) || !fs.statSync(raiz).isDirectory()) throw new Error(`Folder not found: ${raiz}.`);
|
|
126
|
+
const { files, total, omitidos } = archivosDelProyecto(raiz);
|
|
127
|
+
if (!Object.keys(files).length) throw new Error('No text files to send were found in that folder.');
|
|
128
|
+
if (Array.isArray(tests) && tests.length && !files['.healer.json']) files['.healer.json'] = JSON.stringify({ tests }, null, 2);
|
|
129
|
+
const appId = `claude-code/${path.basename(raiz).replace(/[^\w.-]/g, '-').slice(0, 60) || 'proyecto'}`;
|
|
130
|
+
const envio = await api('POST', '/v1/repair', { files, app_id: appId, ai_level: nivel === 'pro' ? 'pro' : 'free' });
|
|
131
|
+
fs.mkdirSync(ESTADO, { recursive: true });
|
|
132
|
+
fs.writeFileSync(archivoDeTrabajo(envio.job_id), JSON.stringify({ raiz, appId, enviado: new Date().toISOString() }));
|
|
133
|
+
return [
|
|
134
|
+
`Sent to Healer: job ${envio.job_id} (${envio.ai_level || nivel || 'free'} level).`,
|
|
135
|
+
`${Object.keys(files).length} files, ${Math.round(total / 1024)} KB${omitidos ? `, ${omitidos} skipped (binary or too large)` : ''}.`,
|
|
136
|
+
'Healer runs the tests in an isolated sandbox and repairs what fails. It usually takes a few minutes: check with healer_resultado.'
|
|
137
|
+
].join('\n');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async function resultado({ job_id, esperar_segundos }) {
|
|
141
|
+
const limite = Date.now() + Math.min(Math.max(Number(esperar_segundos) || 45, 0), 50) * 1000;
|
|
142
|
+
let r;
|
|
143
|
+
for (;;) {
|
|
144
|
+
r = await api('GET', `/v1/repair/${encodeURIComponent(job_id)}`);
|
|
145
|
+
if (!['queued', 'running'].includes(r.status) || Date.now() >= limite) break;
|
|
146
|
+
await new Promise((ok) => setTimeout(ok, 5000));
|
|
147
|
+
}
|
|
148
|
+
if (r.status === 'queued' || r.status === 'running') return `Still ${r.status === 'queued' ? 'queued' : 'running'}. Call healer_resultado again in a moment.`;
|
|
149
|
+
if (r.status === 'error') return `Healer could not finish: ${r.error || 'unknown error'}.`;
|
|
150
|
+
|
|
151
|
+
const meta = fs.existsSync(archivoDeTrabajo(job_id)) ? JSON.parse(fs.readFileSync(archivoDeTrabajo(job_id), 'utf8')) : null;
|
|
152
|
+
const cambiados = r.changed_files || [];
|
|
153
|
+
// La propuesta queda guardada para healer_aplicar (y para mirarla con calma).
|
|
154
|
+
if (meta) fs.writeFileSync(archivoDeTrabajo(job_id), JSON.stringify({ ...meta, terminado: new Date().toISOString(), status: r.status, changed_files: cambiados, base_hashes: r.base_hashes || {}, files: Object.fromEntries(cambiados.map((c) => [c, r.files?.[c]])) }));
|
|
155
|
+
|
|
156
|
+
const lineas = [];
|
|
157
|
+
const titulo = { production_ready: 'Production ready: every check passes.', unresolved: r.partial_fix ? 'Partial delivery: some failures fixed, some remain.' : 'Unresolved: Healer could not leave every check passing.', unsupported_stack: 'Unsupported stack: no supported language was found to verify.' }[r.status] || r.status;
|
|
158
|
+
lineas.push(`Result: ${titulo}`);
|
|
159
|
+
if (r.failures) lineas.push(`Failures: ${r.failures.found ?? '?'} found, ${r.failures.fixed ?? '?'} fixed.${(r.failures.remaining || []).length ? ` Remaining: ${r.failures.remaining.map((f) => `[${f.origen}] ${String(f.detalle).slice(0, 160)}`).join(' | ')}` : ''}`);
|
|
160
|
+
if (r.audit_report?.vulnerabilities_found) lineas.push(`Security: ${r.audit_report.vulnerabilities_found} findings (${(r.audit_report.findings || []).slice(0, 5).map((f) => `${f.archivo}:${f.linea} ${f.severidad}`).join(', ')}).`);
|
|
161
|
+
if (r.pentagono_report?.puntaje != null) lineas.push(`Quality score (Pentagon): ${r.pentagono_report.puntaje}/100.`);
|
|
162
|
+
if ((r.pending_improvements || []).length) lineas.push(`Non-blocking suggestions: ${r.pending_improvements.length} (not applied).`);
|
|
163
|
+
if (!cambiados.length) {
|
|
164
|
+
lineas.push('No file changes to apply.');
|
|
165
|
+
return lineas.join('\n');
|
|
166
|
+
}
|
|
167
|
+
lineas.push(`Proposed changes in ${cambiados.length} file(s): ${cambiados.join(', ')}.`);
|
|
168
|
+
lineas.push('Nothing has been written. Show this to the user and apply only if they agree, with healer_aplicar.');
|
|
169
|
+
if (meta) {
|
|
170
|
+
for (const ruta of cambiados) {
|
|
171
|
+
const local = path.join(meta.raiz, ruta);
|
|
172
|
+
lineas.push(`\n--- ${ruta}`);
|
|
173
|
+
lineas.push(diffDe(fs.existsSync(local) ? fs.readFileSync(local, 'utf8') : '', r.files?.[ruta] ?? ''));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return lineas.join('\n');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Diff unificado en JavaScript, con 2 líneas de contexto. Antes escribía los dos lados a disco y corría `git diff`:
|
|
180
|
+
// el escáner del directorio de plugins lo marcaba como "bajar y ejecutar", y además no hacía falta.
|
|
181
|
+
function diffDe(antes, despues) {
|
|
182
|
+
if (antes === despues) return '(no differences)';
|
|
183
|
+
const a = antes.split('\n');
|
|
184
|
+
const b = despues.split('\n');
|
|
185
|
+
// Se recortan el principio y el final iguales: la tabla de abajo solo cubre la parte que cambió.
|
|
186
|
+
let ini = 0;
|
|
187
|
+
while (ini < a.length && ini < b.length && a[ini] === b[ini]) ini++;
|
|
188
|
+
let finA = a.length, finB = b.length;
|
|
189
|
+
while (finA > ini && finB > ini && a[finA - 1] === b[finB - 1]) { finA--; finB--; }
|
|
190
|
+
const ma = a.slice(ini, finA), mb = b.slice(ini, finB);
|
|
191
|
+
if (ma.length * mb.length > 4_000_000) {
|
|
192
|
+
// Cambio enorme: sin tabla, el bloque entero quitado y agregado.
|
|
193
|
+
return [`@@ line ${ini + 1} @@`, ...ma.slice(0, 200).map((l) => `-${l}`), ...mb.slice(0, 200).map((l) => `+${l}`)].join('\n').slice(0, 12000);
|
|
194
|
+
}
|
|
195
|
+
const lcs = Array.from({ length: ma.length + 1 }, () => new Uint32Array(mb.length + 1));
|
|
196
|
+
for (let i = ma.length - 1; i >= 0; i--) for (let j = mb.length - 1; j >= 0; j--) lcs[i][j] = ma[i] === mb[j] ? lcs[i + 1][j + 1] + 1 : Math.max(lcs[i + 1][j], lcs[i][j + 1]);
|
|
197
|
+
const ops = [];
|
|
198
|
+
for (let k = Math.max(0, ini - 2); k < ini; k++) ops.push([' ', a[k]]);
|
|
199
|
+
let i = 0, j = 0;
|
|
200
|
+
while (i < ma.length || j < mb.length) {
|
|
201
|
+
if (i < ma.length && j < mb.length && ma[i] === mb[j]) { ops.push([' ', ma[i]]); i++; j++; }
|
|
202
|
+
else if (i < ma.length && (j === mb.length || lcs[i + 1][j] >= lcs[i][j + 1])) { ops.push(['-', ma[i]]); i++; }
|
|
203
|
+
else { ops.push(['+', mb[j]]); j++; }
|
|
204
|
+
}
|
|
205
|
+
for (let k = finA; k < Math.min(a.length, finA + 2); k++) ops.push([' ', a[k]]);
|
|
206
|
+
// Más de 4 líneas iguales seguidas en el medio se resumen con "...", como los trozos de git.
|
|
207
|
+
const salida = [`@@ line ${Math.max(1, ini - 1)} @@`];
|
|
208
|
+
let iguales = [];
|
|
209
|
+
const volcar = (alFinal) => {
|
|
210
|
+
if (iguales.length > 4 && !alFinal) salida.push(...iguales.slice(0, 2), '...', ...iguales.slice(-2));
|
|
211
|
+
else salida.push(...iguales);
|
|
212
|
+
iguales = [];
|
|
213
|
+
};
|
|
214
|
+
for (const [t, l] of ops) {
|
|
215
|
+
if (t === ' ') { iguales.push(` ${l}`); continue; }
|
|
216
|
+
volcar(false);
|
|
217
|
+
salida.push(`${t}${l}`);
|
|
218
|
+
}
|
|
219
|
+
volcar(true);
|
|
220
|
+
return salida.join('\n').slice(0, 12000);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async function aplicar({ job_id }) {
|
|
224
|
+
const archivo = archivoDeTrabajo(job_id);
|
|
225
|
+
if (!fs.existsSync(archivo)) throw new Error('No proposal stored for that job: call healer_resultado first.');
|
|
226
|
+
const t = JSON.parse(fs.readFileSync(archivo, 'utf8'));
|
|
227
|
+
if (!t.changed_files?.length) return 'That job has no changes to apply.';
|
|
228
|
+
// La base tiene que coincidir: si el usuario tocó un archivo después de mandarlo, ese no se pisa.
|
|
229
|
+
const distintos = t.changed_files.filter((ruta) => {
|
|
230
|
+
const local = path.join(t.raiz, ruta);
|
|
231
|
+
const actual = fs.existsSync(local) ? fs.readFileSync(local, 'utf8') : null;
|
|
232
|
+
return t.base_hashes[ruta] && (actual === null || sha256(actual) !== t.base_hashes[ruta]);
|
|
233
|
+
});
|
|
234
|
+
if (distintos.length) return `Not applied: these files changed since they were sent to Healer: ${distintos.join(', ')}. Send the project again with healer_revisar.`;
|
|
235
|
+
for (const ruta of t.changed_files) {
|
|
236
|
+
const destino = path.resolve(t.raiz, ruta);
|
|
237
|
+
if (!destino.startsWith(t.raiz + path.sep)) throw new Error(`Path outside the project: ${ruta}`);
|
|
238
|
+
if (typeof t.files[ruta] !== 'string') continue;
|
|
239
|
+
fs.mkdirSync(path.dirname(destino), { recursive: true });
|
|
240
|
+
fs.writeFileSync(destino, t.files[ruta]);
|
|
241
|
+
}
|
|
242
|
+
fs.writeFileSync(archivo, JSON.stringify({ ...t, aplicado: new Date().toISOString() }));
|
|
243
|
+
return `Applied: ${t.changed_files.length} file(s) written (${t.changed_files.join(', ')}). Review the diff with git before committing.`;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const HERRAMIENTAS = [
|
|
247
|
+
{
|
|
248
|
+
name: 'healer_revisar',
|
|
249
|
+
description: 'Send the project to Healer for independent verification: it runs the tests in an isolated sandbox, repairs what fails and returns only changes that leave the project better, never worse. Returns a job id; then call healer_resultado.',
|
|
250
|
+
inputSchema: {
|
|
251
|
+
type: 'object',
|
|
252
|
+
properties: {
|
|
253
|
+
ruta: { type: 'string', description: 'Project folder. Defaults to the current working directory.' },
|
|
254
|
+
nivel: { type: 'string', enum: ['free', 'pro'], description: 'free (open models, no cost) or pro (paid models, uses your plan). Defaults to free.' },
|
|
255
|
+
tests: { type: 'array', items: { type: 'string' }, description: 'Optional: the tests that define "fixed" (e.g. tests/test_api.py::test_login). Without this Healer runs the full suite.' }
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
run: revisar
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'healer_resultado',
|
|
262
|
+
description: 'Check a Healer job. Waits up to ~45 s; if it is still running, call it again. When finished, returns the summary and the diff of the proposed changes, without writing anything.',
|
|
263
|
+
inputSchema: { type: 'object', properties: { job_id: { type: 'string' }, esperar_segundos: { type: 'number', description: 'How long to wait for it to finish (0 to 50).' } }, required: ['job_id'] },
|
|
264
|
+
run: resultado
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'healer_aplicar',
|
|
268
|
+
description: 'Write Healer\'s proposed changes into the project. Only call it after the user agreed. It refuses any file that changed since it was sent.',
|
|
269
|
+
inputSchema: { type: 'object', properties: { job_id: { type: 'string' } }, required: ['job_id'] },
|
|
270
|
+
run: aplicar
|
|
271
|
+
}
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
// ───────────────────────────── MCP por stdio ─────────────────────────────
|
|
275
|
+
|
|
276
|
+
const responder = (id, result) => process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id, result }) + '\n');
|
|
277
|
+
const fallar = (id, code, message) => process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id, error: { code, message } }) + '\n');
|
|
278
|
+
|
|
279
|
+
readline.createInterface({ input: process.stdin }).on('line', async (linea) => {
|
|
280
|
+
let m;
|
|
281
|
+
try { m = JSON.parse(linea); } catch { return; }
|
|
282
|
+
if (m.id === undefined) return; // notificaciones (initialized, cancelled): nada que responder
|
|
283
|
+
try {
|
|
284
|
+
if (m.method === 'initialize') {
|
|
285
|
+
return responder(m.id, { protocolVersion: m.params?.protocolVersion || '2025-06-18', capabilities: { tools: {} }, serverInfo: { name: 'healer', version: VERSION } });
|
|
286
|
+
}
|
|
287
|
+
if (m.method === 'ping') return responder(m.id, {});
|
|
288
|
+
if (m.method === 'tools/list') return responder(m.id, { tools: HERRAMIENTAS.map(({ run, ...h }) => h) });
|
|
289
|
+
if (m.method === 'tools/call') {
|
|
290
|
+
const h = HERRAMIENTAS.find((x) => x.name === m.params?.name);
|
|
291
|
+
if (!h) return fallar(m.id, -32602, `Unknown tool: ${m.params?.name}`);
|
|
292
|
+
try {
|
|
293
|
+
const texto = await h.run(m.params?.arguments || {});
|
|
294
|
+
return responder(m.id, { content: [{ type: 'text', text: texto }] });
|
|
295
|
+
} catch (e) {
|
|
296
|
+
return responder(m.id, { content: [{ type: 'text', text: String(e?.message || e) }], isError: true });
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return fallar(m.id, -32601, `Method not supported: ${m.method}`);
|
|
300
|
+
} catch (e) {
|
|
301
|
+
return fallar(m.id, -32603, String(e?.message || e));
|
|
302
|
+
}
|
|
303
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meiti/healer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Connect Healer to Claude Code (and any MCP agent) in a minute: a short code, one click in the browser, done.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"healer": "instalar.mjs",
|
|
8
|
+
"healer-mcp": "healer-mcp.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"instalar.mjs",
|
|
12
|
+
"healer-mcp.mjs",
|
|
13
|
+
"mcp/servidor.mjs",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://meiti.dev/healer",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/meiti-dev/healer-claude-plugin.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"healer",
|
|
27
|
+
"claude-code",
|
|
28
|
+
"mcp",
|
|
29
|
+
"testing",
|
|
30
|
+
"repair",
|
|
31
|
+
"ai"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prepack": "node -e \"require('fs').mkdirSync('mcp',{recursive:true});require('fs').copyFileSync('../claude-code/plugins/healer/mcp/servidor.mjs','mcp/servidor.mjs')\""
|
|
36
|
+
}
|
|
37
|
+
}
|