@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.
Files changed (47) hide show
  1. package/dist/commands/auth/index.js +1 -1
  2. package/dist/commands/auth/index.js.map +1 -1
  3. package/dist/commands/index.d.ts +1 -1
  4. package/dist/commands/index.d.ts.map +1 -1
  5. package/dist/commands/index.js +1 -1
  6. package/dist/commands/index.js.map +1 -1
  7. package/dist/commands/info/index.d.ts +11 -0
  8. package/dist/commands/info/index.d.ts.map +1 -0
  9. package/dist/commands/info/index.js +232 -0
  10. package/dist/commands/info/index.js.map +1 -0
  11. package/dist/commands/init/index.d.ts.map +1 -1
  12. package/dist/commands/init/index.js +17 -14
  13. package/dist/commands/init/index.js.map +1 -1
  14. package/dist/commands/learn/index.d.ts +4 -0
  15. package/dist/commands/learn/index.d.ts.map +1 -1
  16. package/dist/commands/learn/index.js +159 -5
  17. package/dist/commands/learn/index.js.map +1 -1
  18. package/dist/commands/mcp/index.d.ts +20 -0
  19. package/dist/commands/mcp/index.d.ts.map +1 -0
  20. package/dist/commands/mcp/index.js +460 -0
  21. package/dist/commands/mcp/index.js.map +1 -0
  22. package/dist/commands/publish/index.d.ts.map +1 -1
  23. package/dist/commands/publish/index.js +14 -7
  24. package/dist/commands/publish/index.js.map +1 -1
  25. package/dist/commands/sign/index.d.ts +2 -1
  26. package/dist/commands/sign/index.d.ts.map +1 -1
  27. package/dist/commands/sign/index.js +75 -17
  28. package/dist/commands/sign/index.js.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +3 -3
  32. package/dist/index.js.map +1 -1
  33. package/package.json +5 -5
  34. package/src/commands/auth/index.ts +1 -1
  35. package/src/commands/index.ts +1 -1
  36. package/src/commands/{get → info}/index.ts +103 -16
  37. package/src/commands/init/index.ts +17 -14
  38. package/src/commands/learn/index.ts +228 -5
  39. package/src/commands/publish/index.ts +14 -7
  40. package/src/commands/sign/index.ts +93 -18
  41. package/src/index.ts +3 -3
  42. package/tests/commands/{get.test.ts → info.test.ts} +35 -33
  43. package/tests/commands/init.test.ts +6 -6
  44. package/tests/commands/learn.test.ts +2 -2
  45. package/tests/e2e.test.ts +1 -1
  46. package/tsconfig.tsbuildinfo +1 -1
  47. /package/tests/fixtures/echo-tool/{enact.md → SKILL.md} +0 -0
@@ -1,64 +1,66 @@
1
1
  /**
2
- * Tests for the get command
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 { configureGetCommand } from "../../src/commands/get";
8
+ import { configureInfoCommand } from "../../src/commands/info";
9
9
 
10
- describe("get command", () => {
10
+ describe("info command", () => {
11
11
  describe("command configuration", () => {
12
- test("configures get command on program", () => {
12
+ test("configures info command on program", () => {
13
13
  const program = new Command();
14
- configureGetCommand(program);
14
+ configureInfoCommand(program);
15
15
 
16
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
17
- expect(getCmd).toBeDefined();
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
- configureGetCommand(program);
22
+ configureInfoCommand(program);
23
23
 
24
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
25
- expect(getCmd?.description()).toBe("Show detailed information about a tool");
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 info as alias", () => {
30
+ test("has get as alias", () => {
29
31
  const program = new Command();
30
- configureGetCommand(program);
32
+ configureInfoCommand(program);
31
33
 
32
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
33
- expect(getCmd?.aliases()).toContain("info");
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
- configureGetCommand(program);
40
+ configureInfoCommand(program);
39
41
 
40
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
41
- const args = getCmd?.registeredArguments ?? [];
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
- configureGetCommand(program);
50
+ configureInfoCommand(program);
49
51
 
50
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
51
- const opts = getCmd?.options ?? [];
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
- configureGetCommand(program);
60
+ configureInfoCommand(program);
59
61
 
60
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
61
- const opts = getCmd?.options ?? [];
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
- configureGetCommand(program);
72
+ configureInfoCommand(program);
71
73
 
72
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
73
- const opts = getCmd?.options ?? [];
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
- configureGetCommand(program);
82
+ configureInfoCommand(program);
81
83
 
82
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
83
- const opts = getCmd?.options ?? [];
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 get command", () => {
254
+ test("verbose option is available on info command", () => {
253
255
  const program = new Command();
254
- configureGetCommand(program);
256
+ configureInfoCommand(program);
255
257
 
256
- const getCmd = program.commands.find((cmd) => cmd.name() === "get");
257
- const opts = getCmd?.options ?? [];
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 enact.md", async () => {
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, "enact.md");
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("enact.md");
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("enact.md contains valid YAML frontmatter", async () => {
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, "enact.md"), "utf-8");
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, "enact.md"), "utf-8");
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("does not have --verbose option (always shows full docs)", () => {
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).toBeUndefined();
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, "enact.md"))).toBe(true);
142
+ expect(existsSync(join(destPath, "SKILL.md"))).toBe(true);
143
143
  });
144
144
 
145
145
  test("installs multiple tools without conflict", () => {