@oxis-dev/tessra 2.19.6 → 2.19.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxis-dev/tessra",
3
- "version": "2.19.6",
3
+ "version": "2.19.7",
4
4
  "description": "MCP server for AI coding tools and agents. Provides semantic codebase context for Cursor, Claude Code, Codex, Copilot, Antigravity, and CLI workflows without requiring full file uploads.",
5
5
  "license": "UNLICENSED",
6
6
  "author": {
@@ -59,4 +59,4 @@
59
59
  "LICENSE",
60
60
  "README.md"
61
61
  ]
62
- }
62
+ }
@@ -328,31 +328,51 @@ function repairLinuxShellPath(binDir) {
328
328
  }
329
329
 
330
330
  // En Linux con nvm/fnm, el bin de node solo está en PATH en shells interactivos.
331
- // Crear un symlink del binario nativo en ~/.local/bin garantiza que tessra sea
332
- // accesible en cualquier contexto: scripts, IDEs lanzando MCP, shells de login.
333
- function installLinuxLocalBinSymlink(binaryPath) {
331
+ // Copia el binario nativo en ~/.local/bin y agrega ese dir al PATH en los perfiles
332
+ // de shell para que tessra funcione en terminales nuevas sin pasos extra del usuario.
333
+ function installLinuxLocalBin(binaryPath) {
334
334
  const home = process.env.HOME;
335
335
  if (!home) return;
336
336
 
337
337
  const localBin = path.join(home, '.local', 'bin');
338
- const symlinkPath = path.join(localBin, 'tessra');
338
+ const destPath = path.join(localBin, 'tessra');
339
339
 
340
+ // ── 1. Copiar el binario (no symlink — así no depende de la ruta de npm/nvm) ─
340
341
  try {
341
342
  if (!fs.existsSync(localBin)) {
342
343
  fs.mkdirSync(localBin, { recursive: true });
343
344
  }
344
345
 
346
+ fs.copyFileSync(binaryPath, destPath);
347
+ fs.chmodSync(destPath, 0o755);
348
+ console.log(`tessra: binario copiado en ${destPath}.`);
349
+ } catch (err) {
350
+ console.warn(`tessra: no se pudo copiar binario en ${destPath}: ${err.message}`);
351
+ return; // si no pudo copiar, no tiene sentido agregar al PATH
352
+ }
353
+
354
+ // ── 2. Agregar ~/.local/bin al PATH en .bashrc y .profile ────────────────────
355
+ const profilesToPatch = [
356
+ path.join(home, '.bashrc'),
357
+ path.join(home, '.profile'),
358
+ ];
359
+ const shellName = path.basename(process.env.SHELL || '');
360
+ if (shellName === 'zsh') {
361
+ profilesToPatch.push(path.join(home, '.zshrc'));
362
+ }
363
+
364
+ const patched = [];
365
+ for (const profilePath of profilesToPatch) {
345
366
  try {
346
- fs.lstatSync(symlinkPath); // lanza si no existe
347
- fs.unlinkSync(symlinkPath);
348
- } catch (_) { /* no existía — bien */ }
367
+ const result = upsertLinuxProfilePath(profilePath, localBin);
368
+ if (result.changed) patched.push(path.basename(profilePath));
369
+ } catch (_) { /* no fatal */ }
370
+ }
349
371
 
350
- fs.symlinkSync(binaryPath, symlinkPath);
351
- console.log(`tessra: symlink creado en ${symlinkPath} (disponible sin nvm activo).`);
352
- } catch (err) {
353
- // No fatal — tessra sigue disponible vía el bin de npm si nvm está activo
354
- console.warn(`tessra: no se pudo crear symlink en ${symlinkPath}: ${err.message}`);
372
+ if (patched.length > 0) {
373
+ console.log(`tessra: ~/.local/bin agregado al PATH en: ${patched.join(', ')}.`);
355
374
  }
375
+ console.log('tessra: abre una terminal nueva — ya deberia reconocer: tessra --version');
356
376
  }
357
377
 
358
378
  function ensureGlobalBinOnPath() {
@@ -450,9 +470,9 @@ async function main() {
450
470
  // --version puede fallar si el binario requiere inicialización — no es fatal
451
471
  }
452
472
 
453
- // En Linux: symlink en ~/.local/bin para que tessra funcione sin nvm activo
473
+ // En Linux: copiar binario en ~/.local/bin y parchear PATH en perfiles de shell
454
474
  if (process.platform === 'linux') {
455
- installLinuxLocalBinSymlink(dest);
475
+ installLinuxLocalBin(dest);
456
476
  }
457
477
 
458
478
  ensureGlobalBinOnPath();