alegra-data-agent 0.2.3 → 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.
- package/dist/api.js +83 -16
- package/dist/auth.js +23 -8
- package/dist/autoupdate.js +216 -0
- package/dist/commands/hook.js +41 -45
- package/dist/commands/install.js +25 -16
- package/dist/commands/login.js +1 -1
- package/dist/commands/status.js +125 -5
- package/dist/commands/uninstall.js +16 -4
- package/dist/commands/update.js +56 -8
- package/dist/installer.js +247 -72
- package/dist/lib.js +58 -28
- package/dist/main.js +4 -0
- package/dist/render.js +3 -0
- package/dist/signature.js +17 -5
- package/dist/targets.js +10 -7
- package/dist/ui.js +2 -2
- package/package.json +12 -9
package/dist/signature.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { createPublicKey, verify } from "node:crypto";
|
|
2
|
-
export const SIGNING_KEY_ID = "alegra-data-agent-
|
|
3
|
-
export const
|
|
2
|
+
export const SIGNING_KEY_ID = "alegra-data-agent-v2";
|
|
3
|
+
export const TRUSTED_KEYS = [
|
|
4
|
+
{
|
|
5
|
+
keyId: "alegra-data-agent-v2",
|
|
6
|
+
publicKeyB64: "MCowBQYDK2VwAyEA5nrWo7oWlhyad9rJjQHqgL0xaPZ83Yn5dJotGXxCo0c=",
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
keyId: "alegra-data-agent-v1",
|
|
10
|
+
publicKeyB64: "MCowBQYDK2VwAyEApoojQPy6INQXl/xZ0gQumsI3tt9HvMrb0PaVlNn7TkE=",
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
export const PUBLIC_KEY_B64 = TRUSTED_KEYS[0].publicKeyB64;
|
|
4
14
|
export function canonicalize(obj) {
|
|
5
15
|
if (obj === null || typeof obj !== "object")
|
|
6
16
|
return JSON.stringify(obj);
|
|
@@ -25,10 +35,12 @@ export function verifyManifestSignature(manifest, options = {}) {
|
|
|
25
35
|
if (sig.alg !== "Ed25519") {
|
|
26
36
|
return { ok: false, reason: `algoritmo no soportado: ${sig.alg}` };
|
|
27
37
|
}
|
|
28
|
-
|
|
38
|
+
const keys = options.trustedKeys ?? TRUSTED_KEYS;
|
|
39
|
+
const trusted = keys.find((k) => k.keyId === sig.keyId);
|
|
40
|
+
if (!trusted) {
|
|
29
41
|
return {
|
|
30
42
|
ok: false,
|
|
31
|
-
reason: `keyId no reconocido: ${sig.keyId} (CLI
|
|
43
|
+
reason: `keyId no reconocido: ${sig.keyId} (este CLI acepta ${keys.map((k) => k.keyId).join(", ")})`,
|
|
32
44
|
};
|
|
33
45
|
}
|
|
34
46
|
if (typeof manifest.generatedAt === "string") {
|
|
@@ -49,7 +61,7 @@ export function verifyManifestSignature(manifest, options = {}) {
|
|
|
49
61
|
}
|
|
50
62
|
const canonical = canonicalize(manifest);
|
|
51
63
|
const publicKey = createPublicKey({
|
|
52
|
-
key: Buffer.from(
|
|
64
|
+
key: Buffer.from(trusted.publicKeyB64, "base64"),
|
|
53
65
|
format: "der",
|
|
54
66
|
type: "spki",
|
|
55
67
|
});
|
package/dist/targets.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { getAntigravityMcpConfigPath, getAntigravitySkillsDir, getClaudeJsonPath, getClaudeSkillsDir, getCodexConfigPath, getCodexSkillsDir, getCursorMcpPath, getCursorSkillsDir, getOpenCodeConfigPath, getOpenCodeSkillsDir, } from "./lib.js";
|
|
4
|
+
import { getAntigravityGeminiSkillsDir, getAntigravityMcpConfigPath, getAntigravitySkillsDir, getClaudeJsonPath, getClaudeSkillsDir, getCodexConfigPath, getCodexSkillsDir, getCursorMcpPath, getCursorSkillsDir, getOpenCodeConfigPath, getOpenCodeSkillsDir, } from "./lib.js";
|
|
5
5
|
export const TARGETS = {
|
|
6
6
|
"claude-code": {
|
|
7
7
|
id: "claude-code",
|
|
8
8
|
label: "Claude Code",
|
|
9
|
+
mcpHttpTypeValue: "http",
|
|
9
10
|
skillsDir: getClaudeSkillsDir(),
|
|
10
11
|
skillFormat: "folder",
|
|
11
12
|
mcpConfigPath: getClaudeJsonPath(),
|
|
@@ -14,6 +15,7 @@ export const TARGETS = {
|
|
|
14
15
|
},
|
|
15
16
|
cursor: {
|
|
16
17
|
id: "cursor",
|
|
18
|
+
mcpHttpTypeValue: "http",
|
|
17
19
|
label: "Cursor",
|
|
18
20
|
skillsDir: getCursorSkillsDir(),
|
|
19
21
|
skillFormat: "folder",
|
|
@@ -35,6 +37,7 @@ export const TARGETS = {
|
|
|
35
37
|
id: "antigravity",
|
|
36
38
|
label: "Antigravity",
|
|
37
39
|
skillsDir: getAntigravitySkillsDir(),
|
|
40
|
+
mirrorSkillsDirs: [getAntigravityGeminiSkillsDir()],
|
|
38
41
|
skillFormat: "folder",
|
|
39
42
|
mcpConfigPath: getAntigravityMcpConfigPath(),
|
|
40
43
|
mcpRootKey: "mcpServers",
|
|
@@ -60,15 +63,15 @@ export function detectInstalledTargets() {
|
|
|
60
63
|
? process.env.CODEX_HOME
|
|
61
64
|
: join(home, ".codex");
|
|
62
65
|
const sentinels = {
|
|
63
|
-
"claude-code": join(home, ".claude"),
|
|
64
|
-
cursor: join(home, ".cursor"),
|
|
65
|
-
opencode: join(xdgConfig, "opencode"),
|
|
66
|
-
antigravity: join(home, ".gemini", "antigravity"),
|
|
67
|
-
codex: codexHome,
|
|
66
|
+
"claude-code": [join(home, ".claude")],
|
|
67
|
+
cursor: [join(home, ".cursor")],
|
|
68
|
+
opencode: [join(xdgConfig, "opencode")],
|
|
69
|
+
antigravity: [join(home, ".gemini", "antigravity-cli"), join(home, ".gemini", "antigravity")],
|
|
70
|
+
codex: [codexHome],
|
|
68
71
|
};
|
|
69
72
|
const out = [];
|
|
70
73
|
for (const id of Object.keys(sentinels)) {
|
|
71
|
-
if (
|
|
74
|
+
if (sentinels[id].some((p) => existsSync(p)))
|
|
72
75
|
out.push(id);
|
|
73
76
|
}
|
|
74
77
|
return out;
|
package/dist/ui.js
CHANGED
|
@@ -44,7 +44,7 @@ ${bold("Comandos:")}
|
|
|
44
44
|
login Autenticarte con tu cuenta @alegra.com
|
|
45
45
|
logout Cerrar sesión (borra el token local)
|
|
46
46
|
whoami Mostrar la cuenta actualmente autenticada
|
|
47
|
-
install Instala skills + MCPs en tus clientes (Claude Code, Cursor, OpenCode, Antigravity)
|
|
47
|
+
install Instala skills + MCPs en tus clientes (Claude Code, Cursor, OpenCode, Antigravity, Codex)
|
|
48
48
|
update Re-descarga skills/MCPs que cambiaron
|
|
49
49
|
list Lista skills y MCPs disponibles en el gateway
|
|
50
50
|
status Muestra estado: auth, instalado, drift
|
|
@@ -67,6 +67,6 @@ ${bold("Opciones:")}
|
|
|
67
67
|
-v, --version Mostrar versión
|
|
68
68
|
|
|
69
69
|
${bold("Documentación:")}
|
|
70
|
-
https://github.com/
|
|
70
|
+
https://github.com/Alegra-Team/data-agent-selfservice
|
|
71
71
|
`;
|
|
72
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alegra-data-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Agente de Data interno de Alegra. Instala skills + MCPs en tu cliente de IA con un comando.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -19,31 +19,34 @@
|
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/node": "
|
|
23
|
-
"typescript": "
|
|
22
|
+
"@types/node": "26.1.2",
|
|
23
|
+
"typescript": "7.0.2"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/
|
|
27
|
+
"url": "git+https://github.com/Alegra-Team/data-agent-selfservice.git"
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://github.com/
|
|
29
|
+
"homepage": "https://github.com/Alegra-Team/data-agent-selfservice#readme",
|
|
30
30
|
"bugs": {
|
|
31
|
-
"url": "https://github.com/
|
|
31
|
+
"url": "https://github.com/Alegra-Team/data-agent-selfservice/issues"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"typecheck": "tsc -p tsconfig.json",
|
|
35
35
|
"build": "tsc -p tsconfig.build.json",
|
|
36
36
|
"clean": "rm -rf dist",
|
|
37
37
|
"manifest:generate": "node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/generate-manifest.mjs",
|
|
38
|
-
"manifest:sign": "node scripts/sign-manifest.mjs",
|
|
38
|
+
"manifest:sign": "node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/sign-manifest.mjs",
|
|
39
|
+
"signing-key:generate": "node scripts/generate-signing-key.mjs",
|
|
39
40
|
"manifest:scan": "node scripts/scan-skills.mjs",
|
|
40
41
|
"manifest:validate": "node scripts/validate-skills.mjs --legacy-ok",
|
|
41
42
|
"manifest:validate:strict": "node scripts/validate-skills.mjs",
|
|
42
43
|
"manifest": "pnpm run manifest:validate && pnpm run manifest:scan && pnpm run manifest:generate && pnpm run manifest:sign",
|
|
43
44
|
"test": "node tests/runner.mjs",
|
|
44
45
|
"test:report": "node tests/runner.mjs --report markdown",
|
|
45
|
-
"test:security": "node tests/security/runner.mjs",
|
|
46
|
-
"test:all": "
|
|
46
|
+
"test:security": "node --experimental-strip-types --disable-warning=ExperimentalWarning tests/security/runner.mjs",
|
|
47
|
+
"test:all": "pnpm run test && pnpm run test:security",
|
|
48
|
+
"eval:run": "node tests/evals/run-phase2.mjs",
|
|
49
|
+
"verify:clients": "node scripts/verify-clients.mjs",
|
|
47
50
|
"lint": "pnpm dlx @biomejs/biome@1.9.4 check .",
|
|
48
51
|
"lint:fix": "pnpm dlx @biomejs/biome@1.9.4 check --write .",
|
|
49
52
|
"format": "pnpm dlx @biomejs/biome@1.9.4 format --write ."
|