@meiti/healer 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/mcp/servidor.mjs +14 -1
  2. package/package.json +1 -1
package/mcp/servidor.mjs CHANGED
@@ -14,7 +14,7 @@ import path from 'node:path';
14
14
  import crypto from 'node:crypto';
15
15
  import readline from 'node:readline';
16
16
 
17
- const VERSION = '0.3.5';
17
+ const VERSION = '0.3.6';
18
18
  const API = (process.env.HEALER_API_URL || 'https://healer-api.meiti.dev').replace(/\/$/, '');
19
19
  const leerClave = () => String(process.env.CLAUDE_PLUGIN_OPTION_API_KEY || '').trim();
20
20
  const ESTADO = path.join(os.tmpdir(), 'healer-claude-code');
@@ -254,9 +254,16 @@ async function aplicar({ job_id, archivos }) {
254
254
  }
255
255
  fs.writeFileSync(archivo, JSON.stringify({ ...t, aplicado: new Date().toISOString(), aplicados: elegidos }));
256
256
  const descartados = t.changed_files.filter((c) => !elegidos.includes(c));
257
+ // Le cuenta a Healer qué se aplicó y qué no (solo para medir qué cambios valen la pena; si falla, no importa).
258
+ await api('POST', `/v1/repair/${encodeURIComponent(job_id)}/decision`, { aplicados: elegidos, descartados, via: 'plugin_local' }).catch(() => {});
257
259
  return `Applied: ${elegidos.length} file(s) written (${elegidos.join(', ')}).${descartados.length ? ` Left out as requested: ${descartados.join(', ')}.` : ''} Review the diff with git before committing.`;
258
260
  }
259
261
 
262
+ async function informarDecision({ job_id, aplicados = [], descartados = [] }) {
263
+ const r = await api('POST', `/v1/repair/${encodeURIComponent(job_id)}/decision`, { aplicados, descartados, via: 'agente' });
264
+ return `Thanks: recorded ${r.registrados ?? 0} decision(s) (${aplicados.length} applied, ${descartados.length} left out).`;
265
+ }
266
+
260
267
  const HERRAMIENTAS = [
261
268
  {
262
269
  name: 'healer_revisar',
@@ -282,6 +289,12 @@ const HERRAMIENTAS = [
282
289
  description: 'Write Healer\'s proposed changes into the project. Only call it after the user agreed. Pass "archivos" to write only the files the user approved (the rest are left out). It refuses any file that changed since it was sent.',
283
290
  inputSchema: { type: 'object', properties: { job_id: { type: 'string' }, archivos: { type: 'array', items: { type: 'string' }, description: 'Optional: paths (as listed by healer_resultado) of the only files to write.' } }, required: ['job_id'] },
284
291
  run: aplicar
292
+ },
293
+ {
294
+ name: 'healer_informar_decision',
295
+ description: 'Tell Healer which of its changes the user decided not to apply (or applied by hand). healer_aplicar reports this by itself; use this when the user applies none, or edits by hand. Healer stores only fingerprints of the file paths, never code.',
296
+ inputSchema: { type: 'object', properties: { job_id: { type: 'string' }, aplicados: { type: 'array', items: { type: 'string' } }, descartados: { type: 'array', items: { type: 'string' } } }, required: ['job_id'] },
297
+ run: informarDecision
285
298
  }
286
299
  ];
287
300
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meiti/healer",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Connect Healer to Claude Code (and any MCP agent) in a minute: a short code, one click in the browser, done.",
5
5
  "type": "module",
6
6
  "bin": {