@skillsmith/cli 0.2.7 → 0.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 +104 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/commands/author/index.d.ts +16 -0
- package/dist/src/commands/author/index.d.ts.map +1 -0
- package/dist/src/commands/author/index.js +18 -0
- package/dist/src/commands/author/index.js.map +1 -0
- package/dist/src/commands/author/init.d.ts +47 -0
- package/dist/src/commands/author/init.d.ts.map +1 -0
- package/dist/src/commands/author/init.js +346 -0
- package/dist/src/commands/author/init.js.map +1 -0
- package/dist/src/commands/author/mcp-init.d.ts +20 -0
- package/dist/src/commands/author/mcp-init.d.ts.map +1 -0
- package/dist/src/commands/author/mcp-init.js +183 -0
- package/dist/src/commands/author/mcp-init.js.map +1 -0
- package/dist/src/commands/author/subagent.d.ts +22 -0
- package/dist/src/commands/author/subagent.d.ts.map +1 -0
- package/dist/src/commands/author/subagent.js +166 -0
- package/dist/src/commands/author/subagent.js.map +1 -0
- package/dist/src/commands/author/transform.d.ts +22 -0
- package/dist/src/commands/author/transform.d.ts.map +1 -0
- package/dist/src/commands/author/transform.js +141 -0
- package/dist/src/commands/author/transform.js.map +1 -0
- package/dist/src/commands/author/utils.d.ts +27 -0
- package/dist/src/commands/author/utils.d.ts.map +1 -0
- package/dist/src/commands/author/utils.js +118 -0
- package/dist/src/commands/author/utils.js.map +1 -0
- package/dist/src/commands/index.d.ts +2 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +6 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/sync.d.ts +21 -0
- package/dist/src/commands/sync.d.ts.map +1 -0
- package/dist/src/commands/sync.js +373 -0
- package/dist/src/commands/sync.js.map +1 -0
- package/dist/src/import.d.ts +1 -0
- package/dist/src/import.d.ts.map +1 -1
- package/dist/src/import.js +20 -5
- package/dist/src/import.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/utils/formatters.d.ts +39 -0
- package/dist/src/utils/formatters.d.ts.map +1 -0
- package/dist/src/utils/formatters.js +69 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/tests/author.test.js +117 -32
- package/dist/tests/author.test.js.map +1 -1
- package/dist/tests/e2e/author.e2e.test.js +341 -21
- package/dist/tests/e2e/author.e2e.test.js.map +1 -1
- package/dist/tests/e2e/utils/index.d.ts +4 -0
- package/dist/tests/e2e/utils/index.d.ts.map +1 -1
- package/dist/tests/e2e/utils/index.js +4 -0
- package/dist/tests/e2e/utils/index.js.map +1 -1
- package/dist/tests/e2e/utils/mock-github.d.ts +23 -0
- package/dist/tests/e2e/utils/mock-github.d.ts.map +1 -0
- package/dist/tests/e2e/utils/mock-github.js +60 -0
- package/dist/tests/e2e/utils/mock-github.js.map +1 -0
- package/dist/tests/e2e/utils/mock-prompts.d.ts +19 -0
- package/dist/tests/e2e/utils/mock-prompts.d.ts.map +1 -0
- package/dist/tests/e2e/utils/mock-prompts.js +48 -0
- package/dist/tests/e2e/utils/mock-prompts.js.map +1 -0
- package/package.json +1 -1
- package/dist/src/commands/author.d.ts +0 -76
- package/dist/src/commands/author.d.ts.map +0 -1
- package/dist/src/commands/author.js +0 -857
- package/dist/src/commands/author.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMI-1473: Mock prompt utilities for E2E tests
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities to mock @inquirer/prompts for non-interactive testing.
|
|
5
|
+
*/
|
|
6
|
+
import { vi } from 'vitest';
|
|
7
|
+
/**
|
|
8
|
+
* Setup mock responses for inquirer prompts
|
|
9
|
+
*/
|
|
10
|
+
export function setupMockPrompts(responses) {
|
|
11
|
+
// Mock the @inquirer/prompts module
|
|
12
|
+
vi.mock('@inquirer/prompts', () => ({
|
|
13
|
+
input: vi.fn().mockImplementation(async (opts) => {
|
|
14
|
+
const key = opts.message.toLowerCase();
|
|
15
|
+
for (const [pattern, value] of Object.entries(responses.input || {})) {
|
|
16
|
+
if (key.includes(pattern.toLowerCase())) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return 'test-value';
|
|
21
|
+
}),
|
|
22
|
+
confirm: vi.fn().mockImplementation(async (opts) => {
|
|
23
|
+
const key = opts.message.toLowerCase();
|
|
24
|
+
for (const [pattern, value] of Object.entries(responses.confirm || {})) {
|
|
25
|
+
if (key.includes(pattern.toLowerCase())) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}),
|
|
31
|
+
select: vi.fn().mockImplementation(async (opts) => {
|
|
32
|
+
const key = opts.message.toLowerCase();
|
|
33
|
+
for (const [pattern, value] of Object.entries(responses.select || {})) {
|
|
34
|
+
if (key.includes(pattern.toLowerCase())) {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return 'development';
|
|
39
|
+
}),
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Clear all mock prompts
|
|
44
|
+
*/
|
|
45
|
+
export function clearMockPrompts() {
|
|
46
|
+
vi.clearAllMocks();
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=mock-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-prompts.js","sourceRoot":"","sources":["../../../../tests/e2e/utils/mock-prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAQ3B;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAA8B;IAC7D,oCAAoC;IACpC,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;QAClC,KAAK,EAAE,EAAE,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,CAAC,EAAE,CAAC;oBACxC,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO,aAAa,CAAA;QACtB,CAAC,CAAC;KACH,CAAC,CAAC,CAAA;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,EAAE,CAAC,aAAa,EAAE,CAAA;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SMI-746: Skill Authoring Commands
|
|
3
|
-
*
|
|
4
|
-
* Provides CLI commands for creating, validating, and publishing skills.
|
|
5
|
-
*/
|
|
6
|
-
import { Command } from 'commander';
|
|
7
|
-
/**
|
|
8
|
-
* Initialize a new skill directory
|
|
9
|
-
*/
|
|
10
|
-
declare function initSkill(name: string | undefined, targetPath: string): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Validate a local SKILL.md file
|
|
13
|
-
*/
|
|
14
|
-
declare function validateSkill(skillPath: string): Promise<boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Prepare skill for publishing
|
|
17
|
-
* @returns true if publishing succeeded, false if validation failed
|
|
18
|
-
*/
|
|
19
|
-
declare function publishSkill(skillPath: string): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Create init command
|
|
22
|
-
*/
|
|
23
|
-
export declare function createInitCommand(): Command;
|
|
24
|
-
/**
|
|
25
|
-
* Create validate command
|
|
26
|
-
*/
|
|
27
|
-
export declare function createValidateCommand(): Command;
|
|
28
|
-
/**
|
|
29
|
-
* Create publish command
|
|
30
|
-
*/
|
|
31
|
-
export declare function createPublishCommand(): Command;
|
|
32
|
-
interface SubagentOptions {
|
|
33
|
-
output?: string | undefined;
|
|
34
|
-
tools?: string | undefined;
|
|
35
|
-
model?: string | undefined;
|
|
36
|
-
skipClaudeMd?: boolean | undefined;
|
|
37
|
-
force?: boolean | undefined;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* SMI-1389: Generate a companion subagent for a skill
|
|
41
|
-
*/
|
|
42
|
-
declare function generateSubagent(skillPath: string, options: SubagentOptions): Promise<void>;
|
|
43
|
-
interface TransformOptions {
|
|
44
|
-
dryRun?: boolean | undefined;
|
|
45
|
-
force?: boolean | undefined;
|
|
46
|
-
batch?: boolean | undefined;
|
|
47
|
-
tools?: string | undefined;
|
|
48
|
-
model?: string | undefined;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* SMI-1390: Transform existing skill by generating subagent (non-destructive)
|
|
52
|
-
*/
|
|
53
|
-
declare function transformSkill(skillPath: string, options: TransformOptions): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Create subagent command
|
|
56
|
-
*/
|
|
57
|
-
export declare function createSubagentCommand(): Command;
|
|
58
|
-
/**
|
|
59
|
-
* Create transform command
|
|
60
|
-
*/
|
|
61
|
-
export declare function createTransformCommand(): Command;
|
|
62
|
-
interface McpInitOptions {
|
|
63
|
-
output?: string | undefined;
|
|
64
|
-
tools?: string | undefined;
|
|
65
|
-
force?: boolean | undefined;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* SMI-1433: Initialize a new MCP server project
|
|
69
|
-
*/
|
|
70
|
-
declare function initMcpServer(name: string | undefined, options: McpInitOptions): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* Create mcp-init command
|
|
73
|
-
*/
|
|
74
|
-
export declare function createMcpInitCommand(): Command;
|
|
75
|
-
export { initSkill, validateSkill, publishSkill, generateSubagent, transformSkill, initMcpServer };
|
|
76
|
-
//# sourceMappingURL=author.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"author.d.ts","sourceRoot":"","sources":["../../../src/commands/author.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA2BnC;;GAEG;AACH,iBAAe,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EA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