@oxis-dev/tessra 2.19.5 → 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 +1 -1
- package/scripts/postinstall.js +53 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxis-dev/tessra",
|
|
3
|
-
"version": "2.19.
|
|
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": {
|
package/scripts/postinstall.js
CHANGED
|
@@ -327,6 +327,54 @@ function repairLinuxShellPath(binDir) {
|
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
// En Linux con nvm/fnm, el bin de node solo está en PATH en shells interactivos.
|
|
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
|
+
const home = process.env.HOME;
|
|
335
|
+
if (!home) return;
|
|
336
|
+
|
|
337
|
+
const localBin = path.join(home, '.local', 'bin');
|
|
338
|
+
const destPath = path.join(localBin, 'tessra');
|
|
339
|
+
|
|
340
|
+
// ── 1. Copiar el binario (no symlink — así no depende de la ruta de npm/nvm) ─
|
|
341
|
+
try {
|
|
342
|
+
if (!fs.existsSync(localBin)) {
|
|
343
|
+
fs.mkdirSync(localBin, { recursive: true });
|
|
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) {
|
|
366
|
+
try {
|
|
367
|
+
const result = upsertLinuxProfilePath(profilePath, localBin);
|
|
368
|
+
if (result.changed) patched.push(path.basename(profilePath));
|
|
369
|
+
} catch (_) { /* no fatal */ }
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (patched.length > 0) {
|
|
373
|
+
console.log(`tessra: ~/.local/bin agregado al PATH en: ${patched.join(', ')}.`);
|
|
374
|
+
}
|
|
375
|
+
console.log('tessra: abre una terminal nueva — ya deberia reconocer: tessra --version');
|
|
376
|
+
}
|
|
377
|
+
|
|
330
378
|
function ensureGlobalBinOnPath() {
|
|
331
379
|
const binDir = getGlobalBinDir();
|
|
332
380
|
if (!binDir) {
|
|
@@ -422,6 +470,11 @@ async function main() {
|
|
|
422
470
|
// --version puede fallar si el binario requiere inicialización — no es fatal
|
|
423
471
|
}
|
|
424
472
|
|
|
473
|
+
// En Linux: copiar binario en ~/.local/bin y parchear PATH en perfiles de shell
|
|
474
|
+
if (process.platform === 'linux') {
|
|
475
|
+
installLinuxLocalBin(dest);
|
|
476
|
+
}
|
|
477
|
+
|
|
425
478
|
ensureGlobalBinOnPath();
|
|
426
479
|
|
|
427
480
|
console.log(`tessra: binario instalado correctamente en ${dest}`);
|