@meiti/healer 0.2.4 → 0.2.5

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 +11 -7
  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.8';
17
+ const VERSION = '0.3.9';
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');
@@ -144,7 +144,8 @@ async function revisarPantalla({ ruta, start_command, port, pages }) {
144
144
  const { files, total, omitidos } = archivosDelProyecto(raiz);
145
145
  if (!Object.keys(files).length) throw new Error('No text files to send were found in that folder.');
146
146
  const appId = `claude-code/${path.basename(raiz).replace(/[^\w.-]/g, '-').slice(0, 60) || 'proyecto'}`;
147
- const envio = await api('POST', '/v1/screen', { files, app_id: appId, start_command, port, pages });
147
+ // Sin start_command, port ni pages, Healer los busca (.healer.json "screen", la última corrida que funcionó, package.json).
148
+ const envio = await api('POST', '/v1/screen', { files, app_id: appId, start_command: start_command || undefined, port: port || undefined, pages: Array.isArray(pages) && pages.length ? pages : undefined });
148
149
  return [
149
150
  `Screen review started: job ${envio.job_id}.`,
150
151
  `${Object.keys(files).length} files, ${Math.round(total / 1024)} KB${omitidos ? `, ${omitidos} skipped (binary or too large)` : ''}.`,
@@ -157,12 +158,15 @@ function informePantalla(r) {
157
158
  const lineas = [];
158
159
  const titulo = { checked: 'Screen review finished.', did_not_start: 'The app did not start, so no page could be checked.', unsupported_stack: 'Unsupported stack: no supported language was found to install and start the app.' }[r.status] || r.status;
159
160
  lineas.push(`Result: ${titulo}`, `Summary: ${r.message}`);
161
+ if (r.start) lineas.push(`Started with: "${r.start.command}" on port ${r.start.port} · source: ${r.start.source} (${r.start.detail}) · ${r.start.verified ? 'verified: the app answered' : 'not verified: the app did not answer'}.`);
162
+ if (r.server_log) lineas.push('Server log (last lines):', ...String(r.server_log).split('\n').slice(-25).map((l) => ` ${l}`));
160
163
  if (r.ms) lineas.push(`Time: ${Math.round((r.ms.total || 0) / 1000)} s (install ${Math.round((r.ms.install || 0) / 1000)} s, start ${Math.round((r.ms.start || 0) / 1000)} s, pages ${Math.round((r.ms.pages || 0) / 1000)} s).`);
161
164
  for (const pg of r.pages || []) {
162
165
  lineas.push('', `Page ${pg.path}: ${pg.state}${pg.http ? ` (HTTP ${pg.http})` : ''}${pg.title ? `, title "${pg.title}"` : ''}`);
163
166
  if (pg.reasons?.length) lineas.push(` Why: ${pg.reasons.join('; ')}`);
164
167
  for (const e of pg.expectations || []) lineas.push(` ${e.answer} ${JSON.stringify(e.expectation)} · ${e.proof}`);
165
168
  if (pg.failed_requests?.length) lineas.push(` Requests that failed: ${pg.failed_requests.join(', ')}`);
169
+ if (pg.page_errors?.length) lineas.push(` Page errors: ${pg.page_errors.slice(0, 5).join(' | ')}`);
166
170
  if (pg.visual_issues?.length) lineas.push(` Visual issues: ${pg.visual_issues.slice(0, 8).map((v) => `${v.type}${v.element ? ` at ${v.element}` : ''}: ${v.detail}`).join(' | ')}`);
167
171
  if (pg.map) lineas.push(' Screen map:', ...String(pg.map).split('\n').slice(0, 60).map((l) => ` ${l}`));
168
172
  }
@@ -337,16 +341,16 @@ const HERRAMIENTAS = [
337
341
  },
338
342
  {
339
343
  name: 'healer_revisar_pantalla',
340
- description: 'Start the app in Healer\'s isolated sandbox and check what its pages really show, WITHOUT repairing anything and without AI (much faster than a full review). Per page: the load state (LOADED, DID NOT LOAD with the reason, or NOT THE EXPECTED PAGE), failed requests, measured visual issues, a text map of the screen, and YES / NO / CANNOT PROVE for each expectation. You set the expectations from what you know about the code. Returns a job id; then call healer_resultado.',
344
+ description: 'Start the app in Healer\'s isolated sandbox and check what its pages really show, WITHOUT repairing anything and without AI (much faster than a full review). Per page: the load state (LOADED, DID NOT LOAD with the reason, or NOT THE EXPECTED PAGE), failed requests, measured visual issues, a text map of the screen, and YES / NO / CANNOT PROVE for each expectation. Only the folder is needed: without start_command and port, Healer finds how to start the app (.healer.json "screen", the command that worked last time, or package.json / the Python entry file) and says where it came from; without pages it checks "/". You set the expectations from what you know about the code. Returns a job id; then call healer_resultado.',
341
345
  inputSchema: {
342
346
  type: 'object',
343
347
  properties: {
344
348
  ruta: { type: 'string', description: 'Project folder. Defaults to the current working directory.' },
345
- start_command: { type: 'string', description: 'The command that starts the app, e.g. "npm run dev". It must listen on 0.0.0.0.' },
346
- port: { type: 'number', description: 'The port the app listens on (1024-65535).' },
347
- pages: { type: 'array', items: { type: 'object' }, description: 'Up to 10 pages: [{ "path": "/", "expect_page": { "title_is": "My App" }, "expectations": [{ "exists": "Save" }, { "not_exists": "Delete all" }, { "text": "Total", "contains": "0" }, { "no_issues": true }], "storage": { "session": "test-token" }, "wait_for": "Dashboard", "width": 375 }]. Test accounts only in storage.' }
349
+ start_command: { type: 'string', description: 'Optional: the command that starts the app, e.g. "npm run dev". It must listen on 0.0.0.0. Leave it out and Healer finds it.' },
350
+ port: { type: 'number', description: 'Optional: the port the app listens on (1024-65535). Leave it out and Healer finds it.' },
351
+ pages: { type: 'array', items: { type: 'object' }, description: 'Optional (default: [{ "path": "/" }]). Up to 10 pages: [{ "path": "/", "expect_page": { "title_is": "My App" }, "expectations": [{ "exists": "Save" }, { "not_exists": "Delete all" }, { "text": "Total", "contains": "0" }, { "no_issues": true }], "storage": { "session": "test-token" }, "wait_for": "Dashboard", "width": 375 }]. Test accounts only in storage.' }
348
352
  },
349
- required: ['start_command', 'port', 'pages']
353
+ required: []
350
354
  },
351
355
  run: revisarPantalla
352
356
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meiti/healer",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
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": {