@enactprotocol/cli 2.2.2 → 2.3.1
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/README.md +4 -37
- package/dist/commands/cache/index.js +5 -5
- package/dist/commands/cache/index.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/inspect/index.d.ts.map +1 -1
- package/dist/commands/inspect/index.js +3 -2
- package/dist/commands/inspect/index.js.map +1 -1
- package/dist/commands/install/index.d.ts +1 -1
- package/dist/commands/install/index.d.ts.map +1 -1
- package/dist/commands/install/index.js +64 -4
- package/dist/commands/install/index.js.map +1 -1
- package/dist/commands/learn/index.d.ts.map +1 -1
- package/dist/commands/learn/index.js +54 -0
- package/dist/commands/learn/index.js.map +1 -1
- package/dist/commands/list/index.d.ts +1 -1
- package/dist/commands/list/index.d.ts.map +1 -1
- package/dist/commands/list/index.js +7 -3
- package/dist/commands/list/index.js.map +1 -1
- package/dist/commands/run/index.d.ts.map +1 -1
- package/dist/commands/run/index.js +142 -41
- package/dist/commands/run/index.js.map +1 -1
- package/dist/commands/serve/index.d.ts +9 -0
- package/dist/commands/serve/index.d.ts.map +1 -0
- package/dist/commands/serve/index.js +24 -0
- package/dist/commands/serve/index.js.map +1 -0
- package/dist/commands/validate/index.d.ts.map +1 -1
- package/dist/commands/validate/index.js +7 -37
- package/dist/commands/validate/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/errors.js +2 -2
- package/package.json +7 -6
- package/src/commands/cache/index.ts +5 -5
- package/src/commands/env/README.md +1 -1
- package/src/commands/index.ts +3 -0
- package/src/commands/inspect/index.ts +3 -2
- package/src/commands/install/README.md +2 -2
- package/src/commands/install/index.ts +98 -4
- package/src/commands/learn/index.ts +67 -0
- package/src/commands/list/index.ts +12 -3
- package/src/commands/run/README.md +1 -1
- package/src/commands/run/index.ts +195 -48
- package/src/commands/serve/index.ts +26 -0
- package/src/commands/validate/index.ts +7 -42
- package/src/index.ts +5 -1
- package/src/utils/errors.ts +2 -2
- package/tests/commands/cache.test.ts +2 -2
- package/tests/commands/install-integration.test.ts +11 -12
- package/tests/commands/publish.test.ts +12 -2
- package/tests/commands/run.test.ts +3 -1
- package/tests/commands/serve.test.ts +82 -0
- package/tests/commands/sign.test.ts +1 -1
- package/tests/e2e.test.ts +56 -34
- package/tests/fixtures/calculator/skill.yaml +38 -0
- package/tests/fixtures/echo-tool/SKILL.md +3 -10
- package/tests/fixtures/env-tool/{enact.yaml → skill.yaml} +0 -6
- package/tests/fixtures/greeter/skill.yaml +22 -0
- package/tests/utils/ignore.test.ts +3 -1
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/tests/fixtures/calculator/enact.yaml +0 -34
- package/tests/fixtures/greeter/enact.yaml +0 -18
- /package/tests/fixtures/invalid-tool/{enact.yaml → skill.yaml} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* enact serve command
|
|
3
|
+
*
|
|
4
|
+
* Start a self-hosted Enact registry server.
|
|
5
|
+
* Uses SQLite + local file storage — no external dependencies.
|
|
6
|
+
*/
|
|
7
|
+
import { resolve } from "node:path";
|
|
8
|
+
export function configureServeCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("serve")
|
|
11
|
+
.description("Start a self-hosted Enact registry server")
|
|
12
|
+
.option("-p, --port <port>", "Port to listen on", "3000")
|
|
13
|
+
.option("-d, --data <path>", "Data directory for storage", "./registry-data")
|
|
14
|
+
.option("--host <host>", "Host to bind to", "0.0.0.0")
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
const { startServer } = await import("@enactprotocol/registry");
|
|
17
|
+
await startServer({
|
|
18
|
+
port: Number.parseInt(options.port, 10),
|
|
19
|
+
dataDir: resolve(options.data),
|
|
20
|
+
host: options.host,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,CAAC;SACxD,MAAM,CAAC,mBAAmB,EAAE,4BAA4B,EAAE,iBAAiB,CAAC;SAC5E,MAAM,CAAC,eAAe,EAAE,iBAAiB,EAAE,SAAS,CAAC;SACrD,MAAM,CAAC,KAAK,EAAE,OAAqD,EAAE,EAAE;QACtE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;QAChE,MAAM,WAAW,CAAC;YAChB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACvC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;YAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+QzC;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB/D"}
|
|
@@ -85,44 +85,14 @@ function validateManifest(manifest, sourceDir) {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
// Command-based tool -
|
|
88
|
+
// Command-based tool - basic validation
|
|
89
89
|
const commandParams = extractCommandParams(manifest.command);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (!schemaProperties.includes(param)) {
|
|
97
|
-
issues.push({
|
|
98
|
-
level: "error",
|
|
99
|
-
message: `Command uses \${${param}} but it's not defined in inputSchema.properties`,
|
|
100
|
-
suggestion: `Add '${param}' to inputSchema.properties`,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// Check for required params without command usage (potential issue)
|
|
105
|
-
for (const param of requiredParams) {
|
|
106
|
-
if (!commandParams.includes(param)) {
|
|
107
|
-
issues.push({
|
|
108
|
-
level: "info",
|
|
109
|
-
message: `Required parameter '${param}' is not used in command template`,
|
|
110
|
-
suggestion: "This is fine if you access it via environment or files",
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Check for optional params without defaults
|
|
115
|
-
for (const prop of schemaProperties) {
|
|
116
|
-
if (!requiredParams.includes(prop)) {
|
|
117
|
-
const propSchema = manifest.inputSchema?.properties?.[prop];
|
|
118
|
-
if (propSchema?.default === undefined) {
|
|
119
|
-
issues.push({
|
|
120
|
-
level: "warning",
|
|
121
|
-
message: `Optional parameter '${prop}' has no default value`,
|
|
122
|
-
suggestion: "Add a default value or it will be empty string in commands",
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
90
|
+
if (commandParams.length > 0) {
|
|
91
|
+
issues.push({
|
|
92
|
+
level: "info",
|
|
93
|
+
message: `Command uses parameters: ${commandParams.join(", ")}`,
|
|
94
|
+
suggestion: "Consider using scripts with {{param}} templates for better parameter handling",
|
|
95
|
+
});
|
|
126
96
|
}
|
|
127
97
|
// Check for double-quoting in command
|
|
128
98
|
if (manifest.command.includes("'${") ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAqB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG1E,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAY/F;;GAEG;AACH,SAAS,oBAAoB,CAAC,OAAe;IAC3C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,4BAA4B,CAAC;IAC3C,IAAI,KAA6B,CAAC;IAClC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QACtB,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC;QACD,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAsB,EAAE,SAAiB;IACjE,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,oBA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,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACzD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Command-line interface for Enact.
|
|
6
6
|
* User-facing commands for tool execution, discovery, and management.
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "2.
|
|
8
|
+
export declare const version = "2.3.1";
|
|
9
9
|
export type { GlobalOptions, CommandContext } from "./types";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAgCH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ensureGlobalSetup } from "@enactprotocol/shared";
|
|
9
9
|
import { Command } from "commander";
|
|
10
|
-
import { configureAuthCommand, configureCacheCommand, configureConfigCommand, configureEnvCommand, configureExecCommand, configureInfoCommand, configureInitCommand, configureInspectCommand, configureInstallCommand, configureLearnCommand, configureListCommand, configureMcpCommand, configurePublishCommand, configureReportCommand, configureRunCommand, configureSearchCommand, configureSetupCommand, configureSignCommand, configureTrustCommand, configureUnyankCommand, configureValidateCommand, configureVisibilityCommand, configureYankCommand, } from "./commands";
|
|
10
|
+
import { configureAuthCommand, configureCacheCommand, configureConfigCommand, configureEnvCommand, configureExecCommand, configureInfoCommand, configureInitCommand, configureInspectCommand, configureInstallCommand, configureLearnCommand, configureListCommand, configureMcpCommand, configurePublishCommand, configureReportCommand, configureRunCommand, configureSearchCommand, configureServeCommand, configureSetupCommand, configureSignCommand, configureTrustCommand, configureUnyankCommand, configureValidateCommand, configureVisibilityCommand, configureYankCommand, } from "./commands";
|
|
11
11
|
import { error, formatError } from "./utils";
|
|
12
|
-
export const version = "2.
|
|
12
|
+
export const version = "2.3.1";
|
|
13
13
|
// Main CLI entry point
|
|
14
14
|
async function main() {
|
|
15
15
|
// Ensure global setup is complete on first run
|
|
@@ -49,6 +49,8 @@ async function main() {
|
|
|
49
49
|
configureMcpCommand(program);
|
|
50
50
|
// Validation command
|
|
51
51
|
configureValidateCommand(program);
|
|
52
|
+
// Self-hosted registry
|
|
53
|
+
configureServeCommand(program);
|
|
52
54
|
// Global error handler - handle Commander's help/version exits gracefully
|
|
53
55
|
program.exitOverride((err) => {
|
|
54
56
|
// Commander throws errors for help, version, and other "exit" scenarios
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,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AAC,YAAY,CAAC,EACnC,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,iEAAiE;QACjE,MAAM,MAAM,GAAG,GAA0C,CAAC;QAC1D,IAAI,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/utils/errors.js
CHANGED
|
@@ -47,7 +47,7 @@ export class ToolNotFoundError extends CliError {
|
|
|
47
47
|
export class ManifestError extends CliError {
|
|
48
48
|
constructor(message, path) {
|
|
49
49
|
const fullMessage = path ? `${message} in ${path}` : message;
|
|
50
|
-
super(fullMessage, EXIT_MANIFEST_ERROR, "Ensure the directory contains a valid
|
|
50
|
+
super(fullMessage, EXIT_MANIFEST_ERROR, "Ensure the directory contains a valid skill.yaml or SKILL.md file.");
|
|
51
51
|
this.name = "ManifestError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -288,7 +288,7 @@ export const ErrorMessages = {
|
|
|
288
288
|
message: `No manifest found in ${dir}`,
|
|
289
289
|
suggestions: [
|
|
290
290
|
`Create a manifest: ${colors.command("enact init")}`,
|
|
291
|
-
"Ensure the directory contains
|
|
291
|
+
"Ensure the directory contains skill.yaml or SKILL.md",
|
|
292
292
|
],
|
|
293
293
|
}),
|
|
294
294
|
invalidManifest: (errors) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enactprotocol/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Command-line interface for Enact - the npm for AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/EnactProtocol/enact
|
|
22
|
+
"url": "https://github.com/EnactProtocol/enact.git",
|
|
23
23
|
"directory": "packages/cli"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
@@ -34,10 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@clack/prompts": "^0.11.0",
|
|
37
|
-
"@enactprotocol/api": "2.
|
|
38
|
-
"@enactprotocol/execution": "2.
|
|
39
|
-
"@enactprotocol/
|
|
40
|
-
"@enactprotocol/
|
|
37
|
+
"@enactprotocol/api": "2.3.1",
|
|
38
|
+
"@enactprotocol/execution": "2.3.1",
|
|
39
|
+
"@enactprotocol/registry": "2.3.1",
|
|
40
|
+
"@enactprotocol/secrets": "2.3.1",
|
|
41
|
+
"@enactprotocol/shared": "2.3.1",
|
|
41
42
|
"commander": "^12.1.0",
|
|
42
43
|
"picocolors": "^1.1.1"
|
|
43
44
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { existsSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
|
-
import {
|
|
9
|
+
import { getSkillsDir, tryLoadManifestFromDir } from "@enactprotocol/shared";
|
|
10
10
|
import type { Command } from "commander";
|
|
11
11
|
import type { CommandContext, GlobalOptions } from "../../types";
|
|
12
12
|
import {
|
|
@@ -114,7 +114,7 @@ function listCachedTools(cacheDir: string): CachedTool[] {
|
|
|
114
114
|
* Cache list handler
|
|
115
115
|
*/
|
|
116
116
|
async function listHandler(options: CacheOptions, _ctx: CommandContext): Promise<void> {
|
|
117
|
-
const cacheDir =
|
|
117
|
+
const cacheDir = getSkillsDir();
|
|
118
118
|
const tools = listCachedTools(cacheDir);
|
|
119
119
|
|
|
120
120
|
if (options.json) {
|
|
@@ -165,7 +165,7 @@ async function listHandler(options: CacheOptions, _ctx: CommandContext): Promise
|
|
|
165
165
|
* Cache clean handler - remove old/unused tools
|
|
166
166
|
*/
|
|
167
167
|
async function cleanHandler(options: CacheOptions, ctx: CommandContext): Promise<void> {
|
|
168
|
-
const cacheDir =
|
|
168
|
+
const cacheDir = getSkillsDir();
|
|
169
169
|
const tools = listCachedTools(cacheDir);
|
|
170
170
|
|
|
171
171
|
if (tools.length === 0) {
|
|
@@ -207,7 +207,7 @@ async function cleanHandler(options: CacheOptions, ctx: CommandContext): Promise
|
|
|
207
207
|
* Cache clear handler - remove entire cache
|
|
208
208
|
*/
|
|
209
209
|
async function clearHandler(options: CacheOptions, ctx: CommandContext): Promise<void> {
|
|
210
|
-
const cacheDir =
|
|
210
|
+
const cacheDir = getSkillsDir();
|
|
211
211
|
|
|
212
212
|
if (!existsSync(cacheDir)) {
|
|
213
213
|
info("Cache directory does not exist.");
|
|
@@ -243,7 +243,7 @@ async function clearHandler(options: CacheOptions, ctx: CommandContext): Promise
|
|
|
243
243
|
* Cache info handler
|
|
244
244
|
*/
|
|
245
245
|
async function infoHandler(options: CacheOptions, _ctx: CommandContext): Promise<void> {
|
|
246
|
-
const cacheDir =
|
|
246
|
+
const cacheDir = getSkillsDir();
|
|
247
247
|
const exists = existsSync(cacheDir);
|
|
248
248
|
const tools = exists ? listCachedTools(cacheDir) : [];
|
|
249
249
|
const size = exists ? getDirSize(cacheDir) : 0;
|
|
@@ -139,7 +139,7 @@ When a tool runs, environment variables are resolved in this order:
|
|
|
139
139
|
|
|
140
140
|
1. **Local** - `.enact/.env` in the project directory
|
|
141
141
|
2. **Global** - `~/.enact/.env`
|
|
142
|
-
3. **Manifest defaults** - Default values from `
|
|
142
|
+
3. **Manifest defaults** - Default values from `skill.yaml`
|
|
143
143
|
|
|
144
144
|
## Secret Namespaces
|
|
145
145
|
|
package/src/commands/index.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { mkdirSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { dirname, join, resolve } from "node:path";
|
|
11
11
|
import { createApiClient, downloadBundle, getToolInfo } from "@enactprotocol/api";
|
|
12
|
-
import {
|
|
12
|
+
import { loadConfig, pathExists } from "@enactprotocol/shared";
|
|
13
13
|
import type { Command } from "commander";
|
|
14
14
|
import type { CommandContext, GlobalOptions } from "../../types";
|
|
15
15
|
import {
|
|
@@ -65,7 +65,8 @@ function formatBytes(bytes: number): string {
|
|
|
65
65
|
* Extract a tar.gz bundle to a directory
|
|
66
66
|
*/
|
|
67
67
|
async function extractBundle(bundleData: ArrayBuffer, destPath: string): Promise<void> {
|
|
68
|
-
const
|
|
68
|
+
const { tmpdir } = await import("node:os");
|
|
69
|
+
const tempFile = join(tmpdir(), `enact-inspect-${Date.now()}.tar.gz`);
|
|
69
70
|
mkdirSync(dirname(tempFile), { recursive: true });
|
|
70
71
|
writeFileSync(tempFile, Buffer.from(bundleData));
|
|
71
72
|
|
|
@@ -96,7 +96,7 @@ When installing by name, the command searches for the tool in this order:
|
|
|
96
96
|
|
|
97
97
|
1. Project tools (`.enact/tools/`)
|
|
98
98
|
2. User tools (`~/.enact/tools/`)
|
|
99
|
-
3.
|
|
99
|
+
3. Skills directory (`~/.agent/skills/`)
|
|
100
100
|
4. Registry (future)
|
|
101
101
|
|
|
102
102
|
## Directory Structure
|
|
@@ -112,7 +112,7 @@ After installation, tools are organized by their namespaced name:
|
|
|
112
112
|
│ └── ...
|
|
113
113
|
└── EnactProtocol/
|
|
114
114
|
└── pdf-extract/
|
|
115
|
-
├──
|
|
115
|
+
├── skill.yaml
|
|
116
116
|
└── ...
|
|
117
117
|
```
|
|
118
118
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* enact install command
|
|
3
3
|
*
|
|
4
4
|
* Install a tool to the project or globally.
|
|
5
|
-
* All tools are extracted to ~/.
|
|
5
|
+
* All tools are extracted to ~/.agent/skills/{tool}/
|
|
6
6
|
* - Project install: Adds entry to .enact/tools.json
|
|
7
7
|
* - Global install: Adds entry to ~/.enact/tools.json
|
|
8
8
|
*
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
verifyAllAttestations,
|
|
23
23
|
} from "@enactprotocol/api";
|
|
24
24
|
import {
|
|
25
|
+
addAlias,
|
|
25
26
|
addMcpTool,
|
|
26
27
|
addToolToRegistry,
|
|
27
|
-
getCacheDir,
|
|
28
28
|
getInstalledVersion,
|
|
29
29
|
getMinimumAttestations,
|
|
30
30
|
getProjectEnactDir,
|
|
@@ -64,6 +64,7 @@ interface InstallOptions extends GlobalOptions {
|
|
|
64
64
|
global?: boolean;
|
|
65
65
|
force?: boolean;
|
|
66
66
|
allowYanked?: boolean;
|
|
67
|
+
alias?: string;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -108,7 +109,8 @@ function isLocalPath(toolName: string): boolean {
|
|
|
108
109
|
*/
|
|
109
110
|
async function extractBundle(bundleData: ArrayBuffer, destPath: string): Promise<void> {
|
|
110
111
|
// Create a temporary file for the bundle
|
|
111
|
-
const
|
|
112
|
+
const { tmpdir } = await import("node:os");
|
|
113
|
+
const tempFile = join(tmpdir(), `enact-bundle-${Date.now()}.tar.gz`);
|
|
112
114
|
mkdirSync(dirname(tempFile), { recursive: true });
|
|
113
115
|
writeFileSync(tempFile, Buffer.from(bundleData));
|
|
114
116
|
|
|
@@ -147,6 +149,40 @@ function formatBytes(bytes: number): string {
|
|
|
147
149
|
return `${(bytes / k ** i).toFixed(1)} ${sizes[i]}`;
|
|
148
150
|
}
|
|
149
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Run postinstall hook commands in the tool directory.
|
|
154
|
+
* Runs each command sequentially; throws on first failure.
|
|
155
|
+
*/
|
|
156
|
+
async function runPostinstallHook(
|
|
157
|
+
toolDir: string,
|
|
158
|
+
hookCommands: string | string[],
|
|
159
|
+
_toolName: string,
|
|
160
|
+
verbose?: boolean
|
|
161
|
+
): Promise<void> {
|
|
162
|
+
const commands = Array.isArray(hookCommands) ? hookCommands : [hookCommands];
|
|
163
|
+
|
|
164
|
+
for (const cmd of commands) {
|
|
165
|
+
if (verbose) {
|
|
166
|
+
dim(` Running: ${cmd}`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const proc = Bun.spawn(["sh", "-c", cmd], {
|
|
170
|
+
cwd: toolDir,
|
|
171
|
+
stdout: verbose ? "inherit" : "pipe",
|
|
172
|
+
stderr: "pipe",
|
|
173
|
+
env: { ...process.env },
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const exitCode = await proc.exited;
|
|
177
|
+
if (exitCode !== 0) {
|
|
178
|
+
const stderr = await new Response(proc.stderr).text();
|
|
179
|
+
throw new Error(
|
|
180
|
+
`postinstall hook failed (exit ${exitCode}): ${cmd}${stderr ? `\n${stderr.trim()}` : ""}`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
150
186
|
/**
|
|
151
187
|
* Install from the registry
|
|
152
188
|
*/
|
|
@@ -436,6 +472,26 @@ async function installFromRegistry(
|
|
|
436
472
|
throw new RegistryError(`Failed to extract bundle: ${formatError(err)}`);
|
|
437
473
|
}
|
|
438
474
|
|
|
475
|
+
// Run postinstall hook if the manifest defines one
|
|
476
|
+
const extractedManifest = loadManifestFromDir(cachePath);
|
|
477
|
+
if (extractedManifest?.manifest.hooks?.postinstall) {
|
|
478
|
+
try {
|
|
479
|
+
await withSpinner(
|
|
480
|
+
"Running postinstall hook...",
|
|
481
|
+
async () =>
|
|
482
|
+
runPostinstallHook(
|
|
483
|
+
cachePath,
|
|
484
|
+
extractedManifest.manifest.hooks!.postinstall!,
|
|
485
|
+
toolName,
|
|
486
|
+
options.verbose
|
|
487
|
+
),
|
|
488
|
+
`${symbols.success} postinstall complete`
|
|
489
|
+
);
|
|
490
|
+
} catch (err) {
|
|
491
|
+
info(`${symbols.warning} postinstall hook failed: ${formatError(err)}`);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
439
495
|
// Update tools.json for the appropriate scope
|
|
440
496
|
addToolToRegistry(toolName, targetVersion!, scope, isGlobal ? undefined : ctx.cwd);
|
|
441
497
|
|
|
@@ -444,6 +500,11 @@ async function installFromRegistry(
|
|
|
444
500
|
addMcpTool(toolName, targetVersion!);
|
|
445
501
|
}
|
|
446
502
|
|
|
503
|
+
// Add alias if specified
|
|
504
|
+
if (options.alias) {
|
|
505
|
+
addAlias(options.alias, toolName, scope, isGlobal ? undefined : ctx.cwd);
|
|
506
|
+
}
|
|
507
|
+
|
|
447
508
|
// Output result
|
|
448
509
|
if (options.json) {
|
|
449
510
|
json({
|
|
@@ -455,6 +516,7 @@ async function installFromRegistry(
|
|
|
455
516
|
hash: bundleResult.hash,
|
|
456
517
|
size: bundleResult.size,
|
|
457
518
|
verified: true,
|
|
519
|
+
alias: options.alias,
|
|
458
520
|
});
|
|
459
521
|
return;
|
|
460
522
|
}
|
|
@@ -466,6 +528,9 @@ async function installFromRegistry(
|
|
|
466
528
|
keyValue("Scope", isGlobal ? "global (~/.enact/tools.json)" : "project (.enact/tools.json)");
|
|
467
529
|
keyValue("Size", formatBytes(bundleResult.size));
|
|
468
530
|
keyValue("Hash", `${bundleResult.hash.substring(0, 20)}...`);
|
|
531
|
+
if (options.alias) {
|
|
532
|
+
keyValue("Alias", options.alias);
|
|
533
|
+
}
|
|
469
534
|
newline();
|
|
470
535
|
success(`Installed ${colors.bold(toolName)}@${targetVersion}`);
|
|
471
536
|
}
|
|
@@ -474,7 +539,7 @@ async function installFromRegistry(
|
|
|
474
539
|
* Install from a local path
|
|
475
540
|
*
|
|
476
541
|
* Both global and project installs:
|
|
477
|
-
* 1. Copy tool to
|
|
542
|
+
* 1. Copy tool to ~/.agent/skills/{tool}/
|
|
478
543
|
* 2. Update tools.json (global: ~/.enact/tools.json, project: .enact/tools.json)
|
|
479
544
|
*/
|
|
480
545
|
async function installFromPath(
|
|
@@ -536,6 +601,25 @@ async function installFromPath(
|
|
|
536
601
|
`${symbols.success} Installed ${manifest.name}`
|
|
537
602
|
);
|
|
538
603
|
|
|
604
|
+
// Run postinstall hook if the manifest defines one
|
|
605
|
+
if (manifest.hooks?.postinstall) {
|
|
606
|
+
try {
|
|
607
|
+
await withSpinner(
|
|
608
|
+
"Running postinstall hook...",
|
|
609
|
+
async () =>
|
|
610
|
+
runPostinstallHook(
|
|
611
|
+
cachePath,
|
|
612
|
+
manifest.hooks!.postinstall!,
|
|
613
|
+
manifest.name,
|
|
614
|
+
options.verbose
|
|
615
|
+
),
|
|
616
|
+
`${symbols.success} postinstall complete`
|
|
617
|
+
);
|
|
618
|
+
} catch (err) {
|
|
619
|
+
info(`${symbols.warning} postinstall hook failed: ${formatError(err)}`);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
539
623
|
// Update tools.json for the appropriate scope
|
|
540
624
|
addToolToRegistry(manifest.name, version, scope, isGlobal ? undefined : ctx.cwd);
|
|
541
625
|
|
|
@@ -544,6 +628,11 @@ async function installFromPath(
|
|
|
544
628
|
addMcpTool(manifest.name, version);
|
|
545
629
|
}
|
|
546
630
|
|
|
631
|
+
// Add alias if specified
|
|
632
|
+
if (options.alias) {
|
|
633
|
+
addAlias(options.alias, manifest.name, scope, isGlobal ? undefined : ctx.cwd);
|
|
634
|
+
}
|
|
635
|
+
|
|
547
636
|
if (options.json) {
|
|
548
637
|
json({
|
|
549
638
|
installed: true,
|
|
@@ -551,6 +640,7 @@ async function installFromPath(
|
|
|
551
640
|
version: manifest.version,
|
|
552
641
|
location: cachePath,
|
|
553
642
|
scope,
|
|
643
|
+
alias: options.alias,
|
|
554
644
|
});
|
|
555
645
|
return;
|
|
556
646
|
}
|
|
@@ -560,6 +650,9 @@ async function installFromPath(
|
|
|
560
650
|
keyValue("Version", manifest.version ?? "unversioned");
|
|
561
651
|
keyValue("Location", cachePath);
|
|
562
652
|
keyValue("Scope", isGlobal ? "global (~/.enact/tools.json)" : "project (.enact/tools.json)");
|
|
653
|
+
if (options.alias) {
|
|
654
|
+
keyValue("Alias", options.alias);
|
|
655
|
+
}
|
|
563
656
|
newline();
|
|
564
657
|
success(`Installed ${colors.bold(manifest.name)}`);
|
|
565
658
|
}
|
|
@@ -685,6 +778,7 @@ export function configureInstallCommand(program: Command): void {
|
|
|
685
778
|
.argument("[tool]", "Tool to install (name[@version], path, or '.' for current directory)")
|
|
686
779
|
.option("-g, --global", "Install globally (adds to ~/.enact/tools.json)")
|
|
687
780
|
.option("-f, --force", "Overwrite existing installation")
|
|
781
|
+
.option("-a, --alias <name>", "Create a short alias for this tool")
|
|
688
782
|
.option("--allow-yanked", "Allow installing yanked versions")
|
|
689
783
|
.option("-v, --verbose", "Show detailed output")
|
|
690
784
|
.option("--json", "Output result as JSON")
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
verifyAllAttestations,
|
|
19
19
|
} from "@enactprotocol/api";
|
|
20
20
|
import {
|
|
21
|
+
type ActionsManifest,
|
|
21
22
|
getMinimumAttestations,
|
|
22
23
|
getTrustPolicy,
|
|
23
24
|
getTrustedAuditors,
|
|
@@ -45,6 +46,48 @@ interface LearnOptions extends GlobalOptions {
|
|
|
45
46
|
local?: boolean;
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Display available actions from an ActionsManifest
|
|
51
|
+
*/
|
|
52
|
+
function displayActions(actionsManifest: ActionsManifest): void {
|
|
53
|
+
newline();
|
|
54
|
+
header("Available Actions");
|
|
55
|
+
newline();
|
|
56
|
+
|
|
57
|
+
// Iterate over action map (name is the key)
|
|
58
|
+
for (const [actionName, action] of Object.entries(actionsManifest.actions)) {
|
|
59
|
+
info(` ${actionName}`);
|
|
60
|
+
if (action.description) {
|
|
61
|
+
dim(` ${action.description}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Show input parameters
|
|
65
|
+
if (action.inputSchema?.properties) {
|
|
66
|
+
const required = new Set(
|
|
67
|
+
Array.isArray(action.inputSchema.required) ? action.inputSchema.required : []
|
|
68
|
+
);
|
|
69
|
+
const props = action.inputSchema.properties as Record<
|
|
70
|
+
string,
|
|
71
|
+
{ type?: string; description?: string }
|
|
72
|
+
>;
|
|
73
|
+
const paramNames = Object.keys(props);
|
|
74
|
+
|
|
75
|
+
if (paramNames.length > 0) {
|
|
76
|
+
dim(" Parameters:");
|
|
77
|
+
for (const paramName of paramNames) {
|
|
78
|
+
const prop = props[paramName];
|
|
79
|
+
const isRequired = required.has(paramName);
|
|
80
|
+
const reqLabel = isRequired ? " (required)" : "";
|
|
81
|
+
dim(` - ${paramName}: ${prop?.type ?? "any"}${reqLabel}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
newline();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
dim("Run an action with: enact run <skill>:<action> --args '{...}'");
|
|
89
|
+
}
|
|
90
|
+
|
|
48
91
|
/**
|
|
49
92
|
* Learn command handler
|
|
50
93
|
*/
|
|
@@ -69,6 +112,13 @@ async function learnHandler(
|
|
|
69
112
|
version: resolution.manifest.version,
|
|
70
113
|
documentation: content,
|
|
71
114
|
source: "local",
|
|
115
|
+
actions: resolution.actionsManifest
|
|
116
|
+
? Object.entries(resolution.actionsManifest.actions).map(([name, a]) => ({
|
|
117
|
+
name,
|
|
118
|
+
description: a.description,
|
|
119
|
+
inputSchema: a.inputSchema,
|
|
120
|
+
}))
|
|
121
|
+
: null,
|
|
72
122
|
});
|
|
73
123
|
return;
|
|
74
124
|
}
|
|
@@ -77,6 +127,11 @@ async function learnHandler(
|
|
|
77
127
|
dim("(installed locally)");
|
|
78
128
|
newline();
|
|
79
129
|
console.log(content);
|
|
130
|
+
|
|
131
|
+
// Display actions if available
|
|
132
|
+
if (resolution.actionsManifest) {
|
|
133
|
+
displayActions(resolution.actionsManifest);
|
|
134
|
+
}
|
|
80
135
|
return;
|
|
81
136
|
}
|
|
82
137
|
|
|
@@ -87,6 +142,13 @@ async function learnHandler(
|
|
|
87
142
|
version: resolution.manifest.version,
|
|
88
143
|
documentation: resolution.manifest.doc ?? resolution.manifest.description ?? null,
|
|
89
144
|
source: "local",
|
|
145
|
+
actions: resolution.actionsManifest
|
|
146
|
+
? Object.entries(resolution.actionsManifest.actions).map(([name, a]) => ({
|
|
147
|
+
name,
|
|
148
|
+
description: a.description,
|
|
149
|
+
inputSchema: a.inputSchema,
|
|
150
|
+
}))
|
|
151
|
+
: null,
|
|
90
152
|
});
|
|
91
153
|
return;
|
|
92
154
|
}
|
|
@@ -97,6 +159,11 @@ async function learnHandler(
|
|
|
97
159
|
console.log(
|
|
98
160
|
resolution.manifest.doc ?? resolution.manifest.description ?? "No documentation available."
|
|
99
161
|
);
|
|
162
|
+
|
|
163
|
+
// Display actions if available
|
|
164
|
+
if (resolution.actionsManifest) {
|
|
165
|
+
displayActions(resolution.actionsManifest);
|
|
166
|
+
}
|
|
100
167
|
return;
|
|
101
168
|
}
|
|
102
169
|
|