alegra-data-agent 0.1.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 +21 -0
- package/dist/api.js +185 -0
- package/dist/auth.js +262 -0
- package/dist/colors.js +35 -0
- package/dist/commands/check.js +35 -0
- package/dist/commands/hook.js +122 -0
- package/dist/commands/install.js +274 -0
- package/dist/commands/list.js +44 -0
- package/dist/commands/login.js +31 -0
- package/dist/commands/logout.js +13 -0
- package/dist/commands/status.js +61 -0
- package/dist/commands/uninstall.js +28 -0
- package/dist/commands/update.js +56 -0
- package/dist/commands/whoami.js +16 -0
- package/dist/installer.js +499 -0
- package/dist/lib.js +221 -0
- package/dist/main.js +162 -0
- package/dist/render.js +68 -0
- package/dist/signature.js +61 -0
- package/dist/targets.js +61 -0
- package/dist/ui.js +71 -0
- package/index.mjs +53 -0
- package/package.json +49 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
|
|
7
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
8
|
+
|
|
9
|
+
if (major < 22 || (major === 22 && minor < 6)) {
|
|
10
|
+
console.error(
|
|
11
|
+
`\n ⚠ alegra-data-agent requiere Node.js >= 22.6.0.` +
|
|
12
|
+
`\n Versión actual: ${process.version}` +
|
|
13
|
+
`\n Actualiza desde → https://nodejs.org\n`,
|
|
14
|
+
);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
|
|
20
|
+
// Producción: si existe dist/main.js (compilado), úsalo. Funciona desde node_modules.
|
|
21
|
+
// pathToFileURL es OBLIGATORIO en Windows: import() dinámico rechaza paths
|
|
22
|
+
// estilo "C:\..." en Node ≥20 — solo acepta URLs file:// (ERR_UNSUPPORTED_ESM_URL_SCHEME).
|
|
23
|
+
const distPath = join(__dirname, "dist", "main.js");
|
|
24
|
+
if (existsSync(distPath)) {
|
|
25
|
+
await import(pathToFileURL(distPath).href);
|
|
26
|
+
} else {
|
|
27
|
+
// Desarrollo: ejecuta el .ts directo (requiere --experimental-strip-types).
|
|
28
|
+
const tsPath = join(__dirname, "src", "main.ts");
|
|
29
|
+
if (!existsSync(tsPath)) {
|
|
30
|
+
console.error(`\n ⚠ Instalación incompleta: no se encontró dist/ ni src/.\n`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
await import(pathToFileURL(tsPath).href);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (err?.code !== "ERR_UNKNOWN_FILE_EXTENSION") throw err;
|
|
37
|
+
const { spawn } = await import("node:child_process");
|
|
38
|
+
const child = spawn(
|
|
39
|
+
process.execPath,
|
|
40
|
+
[
|
|
41
|
+
"--experimental-strip-types",
|
|
42
|
+
"--disable-warning=ExperimentalWarning",
|
|
43
|
+
tsPath,
|
|
44
|
+
...process.argv.slice(2),
|
|
45
|
+
],
|
|
46
|
+
{ stdio: "inherit" },
|
|
47
|
+
);
|
|
48
|
+
child.on("exit", (code, signal) => {
|
|
49
|
+
if (signal) process.kill(process.pid, signal);
|
|
50
|
+
else process.exit(code ?? 1);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alegra-data-agent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Agente de Data interno de Alegra. Instala skills + MCPs en tu cliente de IA con un comando.",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.6.0",
|
|
10
|
+
"pnpm": ">=11.1.2"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"alegra-data-agent": "./index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.mjs",
|
|
17
|
+
"dist/",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "25.8.0",
|
|
23
|
+
"typescript": "6.0.3"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/alegradev/alegra-data-agent.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/alegradev/alegra-data-agent#readme",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/alegradev/alegra-data-agent/issues"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
35
|
+
"build": "tsc -p tsconfig.build.json",
|
|
36
|
+
"clean": "rm -rf dist",
|
|
37
|
+
"manifest:generate": "node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/generate-manifest.mjs",
|
|
38
|
+
"manifest:sign": "node scripts/sign-manifest.mjs",
|
|
39
|
+
"manifest:scan": "node scripts/scan-skills.mjs",
|
|
40
|
+
"manifest": "pnpm run manifest:scan && pnpm run manifest:generate && pnpm run manifest:sign",
|
|
41
|
+
"test": "node tests/runner.mjs",
|
|
42
|
+
"test:report": "node tests/runner.mjs --report markdown",
|
|
43
|
+
"test:security": "node tests/security/runner.mjs",
|
|
44
|
+
"test:all": "node tests/runner.mjs && node tests/security/runner.mjs",
|
|
45
|
+
"lint": "pnpm dlx @biomejs/biome@1.9.4 check .",
|
|
46
|
+
"lint:fix": "pnpm dlx @biomejs/biome@1.9.4 check --write .",
|
|
47
|
+
"format": "pnpm dlx @biomejs/biome@1.9.4 format --write ."
|
|
48
|
+
}
|
|
49
|
+
}
|