@enactprotocol/cli 2.1.7 → 2.1.10
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/commands/auth/index.js +1 -1
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/info/index.d.ts +11 -0
- package/dist/commands/info/index.d.ts.map +1 -0
- package/dist/commands/info/index.js +232 -0
- package/dist/commands/info/index.js.map +1 -0
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +17 -14
- package/dist/commands/init/index.js.map +1 -1
- package/dist/commands/learn/index.d.ts +4 -0
- package/dist/commands/learn/index.d.ts.map +1 -1
- package/dist/commands/learn/index.js +159 -5
- package/dist/commands/learn/index.js.map +1 -1
- package/dist/commands/mcp/index.d.ts +20 -0
- package/dist/commands/mcp/index.d.ts.map +1 -0
- package/dist/commands/mcp/index.js +460 -0
- package/dist/commands/mcp/index.js.map +1 -0
- package/dist/commands/publish/index.d.ts.map +1 -1
- package/dist/commands/publish/index.js +14 -7
- package/dist/commands/publish/index.js.map +1 -1
- package/dist/commands/sign/index.d.ts +2 -1
- package/dist/commands/sign/index.d.ts.map +1 -1
- package/dist/commands/sign/index.js +75 -17
- package/dist/commands/sign/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/commands/auth/index.ts +1 -1
- package/src/commands/index.ts +1 -1
- package/src/commands/{get → info}/index.ts +103 -16
- package/src/commands/init/index.ts +17 -14
- package/src/commands/learn/index.ts +228 -5
- package/src/commands/publish/index.ts +14 -7
- package/src/commands/sign/index.ts +93 -18
- package/src/index.ts +3 -3
- package/tests/commands/{get.test.ts → info.test.ts} +35 -33
- package/tests/commands/init.test.ts +6 -6
- package/tests/commands/learn.test.ts +2 -2
- package/tests/e2e.test.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- /package/tests/fixtures/echo-tool/{enact.md → SKILL.md} +0 -0
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for the
|
|
2
|
+
* Tests for the info command
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from "bun:test";
|
|
6
6
|
import type { ToolVersionInfo } from "@enactprotocol/api";
|
|
7
7
|
import { Command } from "commander";
|
|
8
|
-
import {
|
|
8
|
+
import { configureInfoCommand } from "../../src/commands/info";
|
|
9
9
|
|
|
10
|
-
describe("
|
|
10
|
+
describe("info command", () => {
|
|
11
11
|
describe("command configuration", () => {
|
|
12
|
-
test("configures
|
|
12
|
+
test("configures info command on program", () => {
|
|
13
13
|
const program = new Command();
|
|
14
|
-
|
|
14
|
+
configureInfoCommand(program);
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
expect(
|
|
16
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
17
|
+
expect(infoCmd).toBeDefined();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
test("has correct description", () => {
|
|
21
21
|
const program = new Command();
|
|
22
|
-
|
|
22
|
+
configureInfoCommand(program);
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
expect(
|
|
24
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
25
|
+
expect(infoCmd?.description()).toBe(
|
|
26
|
+
"Show detailed information about a tool (local path or registry)"
|
|
27
|
+
);
|
|
26
28
|
});
|
|
27
29
|
|
|
28
|
-
test("has
|
|
30
|
+
test("has get as alias", () => {
|
|
29
31
|
const program = new Command();
|
|
30
|
-
|
|
32
|
+
configureInfoCommand(program);
|
|
31
33
|
|
|
32
|
-
const
|
|
33
|
-
expect(
|
|
34
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
35
|
+
expect(infoCmd?.aliases()).toContain("get");
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
test("accepts tool argument", () => {
|
|
37
39
|
const program = new Command();
|
|
38
|
-
|
|
40
|
+
configureInfoCommand(program);
|
|
39
41
|
|
|
40
|
-
const
|
|
41
|
-
const args =
|
|
42
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
43
|
+
const args = infoCmd?.registeredArguments ?? [];
|
|
42
44
|
expect(args.length).toBeGreaterThan(0);
|
|
43
45
|
expect(args[0]?.name()).toBe("tool");
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
test("has --ver option for specifying version", () => {
|
|
47
49
|
const program = new Command();
|
|
48
|
-
|
|
50
|
+
configureInfoCommand(program);
|
|
49
51
|
|
|
50
|
-
const
|
|
51
|
-
const opts =
|
|
52
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
53
|
+
const opts = infoCmd?.options ?? [];
|
|
52
54
|
const verOpt = opts.find((o) => o.long === "--ver");
|
|
53
55
|
expect(verOpt).toBeDefined();
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
test("has -v short option for verbose (not version)", () => {
|
|
57
59
|
const program = new Command();
|
|
58
|
-
|
|
60
|
+
configureInfoCommand(program);
|
|
59
61
|
|
|
60
|
-
const
|
|
61
|
-
const opts =
|
|
62
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
63
|
+
const opts = infoCmd?.options ?? [];
|
|
62
64
|
// -v is for verbose, not version (--ver is for version)
|
|
63
65
|
const verboseOpt = opts.find((o) => o.short === "-v");
|
|
64
66
|
expect(verboseOpt).toBeDefined();
|
|
@@ -67,20 +69,20 @@ describe("get command", () => {
|
|
|
67
69
|
|
|
68
70
|
test("has --json option", () => {
|
|
69
71
|
const program = new Command();
|
|
70
|
-
|
|
72
|
+
configureInfoCommand(program);
|
|
71
73
|
|
|
72
|
-
const
|
|
73
|
-
const opts =
|
|
74
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
75
|
+
const opts = infoCmd?.options ?? [];
|
|
74
76
|
const jsonOpt = opts.find((o) => o.long === "--json");
|
|
75
77
|
expect(jsonOpt).toBeDefined();
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
test("has --verbose option", () => {
|
|
79
81
|
const program = new Command();
|
|
80
|
-
|
|
82
|
+
configureInfoCommand(program);
|
|
81
83
|
|
|
82
|
-
const
|
|
83
|
-
const opts =
|
|
84
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
85
|
+
const opts = infoCmd?.options ?? [];
|
|
84
86
|
const verboseOpt = opts.find((o) => o.long === "--verbose");
|
|
85
87
|
expect(verboseOpt).toBeDefined();
|
|
86
88
|
});
|
|
@@ -249,12 +251,12 @@ Documentation here.`;
|
|
|
249
251
|
expect(enactMdContent).toContain("Documentation here.");
|
|
250
252
|
});
|
|
251
253
|
|
|
252
|
-
test("verbose option is available on
|
|
254
|
+
test("verbose option is available on info command", () => {
|
|
253
255
|
const program = new Command();
|
|
254
|
-
|
|
256
|
+
configureInfoCommand(program);
|
|
255
257
|
|
|
256
|
-
const
|
|
257
|
-
const opts =
|
|
258
|
+
const infoCmd = program.commands.find((cmd) => cmd.name() === "info");
|
|
259
|
+
const opts = infoCmd?.options ?? [];
|
|
258
260
|
|
|
259
261
|
// Check both short and long form exist
|
|
260
262
|
const verboseOpt = opts.find((o) => o.long === "--verbose");
|
|
@@ -159,7 +159,7 @@ describe("init command", () => {
|
|
|
159
159
|
expect(content).toEqual({ tools: {} });
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
test("--tool mode creates
|
|
162
|
+
test("--tool mode creates SKILL.md", async () => {
|
|
163
163
|
const program = new Command();
|
|
164
164
|
program.exitOverride(); // Prevent process.exit
|
|
165
165
|
configureInitCommand(program);
|
|
@@ -176,7 +176,7 @@ describe("init command", () => {
|
|
|
176
176
|
process.chdir(originalCwd);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
const manifestPath = join(testDir, "
|
|
179
|
+
const manifestPath = join(testDir, "SKILL.md");
|
|
180
180
|
expect(existsSync(manifestPath)).toBe(true);
|
|
181
181
|
|
|
182
182
|
const content = readFileSync(manifestPath, "utf-8");
|
|
@@ -206,7 +206,7 @@ describe("init command", () => {
|
|
|
206
206
|
|
|
207
207
|
const content = readFileSync(agentsPath, "utf-8");
|
|
208
208
|
expect(content).toContain("enact run");
|
|
209
|
-
expect(content).toContain("
|
|
209
|
+
expect(content).toContain("SKILL.md");
|
|
210
210
|
expect(content).toContain("Parameter Substitution");
|
|
211
211
|
});
|
|
212
212
|
|
|
@@ -395,7 +395,7 @@ describe("init command", () => {
|
|
|
395
395
|
expect(existsSync(toolsJsonPath)).toBe(false);
|
|
396
396
|
});
|
|
397
397
|
|
|
398
|
-
test("
|
|
398
|
+
test("SKILL.md contains valid YAML frontmatter", async () => {
|
|
399
399
|
const program = new Command();
|
|
400
400
|
program.exitOverride();
|
|
401
401
|
configureInitCommand(program);
|
|
@@ -418,7 +418,7 @@ describe("init command", () => {
|
|
|
418
418
|
process.chdir(originalCwd);
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
const content = readFileSync(join(testDir, "
|
|
421
|
+
const content = readFileSync(join(testDir, "SKILL.md"), "utf-8");
|
|
422
422
|
|
|
423
423
|
// Check frontmatter structure
|
|
424
424
|
expect(content.startsWith("---")).toBe(true);
|
|
@@ -522,7 +522,7 @@ describe("init command", () => {
|
|
|
522
522
|
process.chdir(originalCwd);
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
const content = readFileSync(join(testDir, "
|
|
525
|
+
const content = readFileSync(join(testDir, "SKILL.md"), "utf-8");
|
|
526
526
|
|
|
527
527
|
// Required fields per spec
|
|
528
528
|
expect(content).toContain("name:");
|
|
@@ -55,14 +55,14 @@ describe("learn command", () => {
|
|
|
55
55
|
expect(jsonOpt).toBeDefined();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
test("
|
|
58
|
+
test("has --verbose option for showing attestation details", () => {
|
|
59
59
|
const program = new Command();
|
|
60
60
|
configureLearnCommand(program);
|
|
61
61
|
|
|
62
62
|
const learnCmd = program.commands.find((cmd) => cmd.name() === "learn");
|
|
63
63
|
const opts = learnCmd?.options ?? [];
|
|
64
64
|
const verboseOpt = opts.find((o) => o.long === "--verbose");
|
|
65
|
-
expect(verboseOpt).
|
|
65
|
+
expect(verboseOpt).toBeDefined();
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
|
package/tests/e2e.test.ts
CHANGED
|
@@ -139,7 +139,7 @@ describe("E2E: Tool Installation Flow", () => {
|
|
|
139
139
|
const { manifest, destPath } = installTool(ECHO_TOOL, destBase);
|
|
140
140
|
|
|
141
141
|
expect(manifest.name).toBe("test/echo-tool");
|
|
142
|
-
expect(existsSync(join(destPath, "
|
|
142
|
+
expect(existsSync(join(destPath, "SKILL.md"))).toBe(true);
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
test("installs multiple tools without conflict", () => {
|