@agent-scope/cli 1.7.0 → 1.9.0
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/cli.js +1095 -266
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +837 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +837 -26
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { ComplexityClass } from '@agent-scope/manifest';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @agent-scope/cli — `scope init` command implementation
|
|
6
|
+
*
|
|
7
|
+
* Scaffolds a `reactscope.config.json` (and friends) in the current working
|
|
8
|
+
* directory. Supports two modes:
|
|
9
|
+
*
|
|
10
|
+
* - Interactive (default): prompts the user to confirm / override every
|
|
11
|
+
* auto-detected value via Node's built-in `readline`.
|
|
12
|
+
* - Non-interactive (`--yes`): accepts all auto-detected defaults without
|
|
13
|
+
* prompting and prints a summary of created files.
|
|
14
|
+
*
|
|
15
|
+
* Safety rules (locked decisions):
|
|
16
|
+
* - Config file format is JSON (`reactscope.config.json`).
|
|
17
|
+
* - Output directory is `.reactscope/` — always added to `.gitignore`.
|
|
18
|
+
* - Auto-detection is non-destructive; never overwrite existing config
|
|
19
|
+
* without `--force`.
|
|
20
|
+
*/
|
|
21
|
+
interface ReactScopeConfig {
|
|
22
|
+
components: {
|
|
23
|
+
include: string[];
|
|
24
|
+
exclude: string[];
|
|
25
|
+
wrappers: {
|
|
26
|
+
providers: string[];
|
|
27
|
+
globalCSS: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
render: {
|
|
31
|
+
viewport: {
|
|
32
|
+
default: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
theme: "light" | "dark";
|
|
38
|
+
warmBrowser: boolean;
|
|
39
|
+
};
|
|
40
|
+
tokens: {
|
|
41
|
+
file: string;
|
|
42
|
+
compliance: {
|
|
43
|
+
threshold: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
output: {
|
|
47
|
+
dir: string;
|
|
48
|
+
sprites: {
|
|
49
|
+
format: "png" | "webp";
|
|
50
|
+
cellPadding: number;
|
|
51
|
+
labelAxes: boolean;
|
|
52
|
+
};
|
|
53
|
+
json: {
|
|
54
|
+
pretty: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
ci: {
|
|
58
|
+
complianceThreshold: number;
|
|
59
|
+
failOnA11yViolations: boolean;
|
|
60
|
+
failOnConsoleErrors: boolean;
|
|
61
|
+
baselinePath: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
interface InitOptions {
|
|
65
|
+
/** Accept all defaults without prompting. */
|
|
66
|
+
yes: boolean;
|
|
67
|
+
/** Overwrite existing config without warning. */
|
|
68
|
+
force: boolean;
|
|
69
|
+
/** Root directory (defaults to `process.cwd()`). */
|
|
70
|
+
cwd?: string;
|
|
71
|
+
}
|
|
72
|
+
interface InitResult {
|
|
73
|
+
/** Whether the command succeeded. */
|
|
74
|
+
success: boolean;
|
|
75
|
+
/** Human-readable message summarising the outcome. */
|
|
76
|
+
message: string;
|
|
77
|
+
/** Paths of files that were created. */
|
|
78
|
+
created: string[];
|
|
79
|
+
/** Whether init was skipped (config already existed and --force was not set). */
|
|
80
|
+
skipped: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Execute `scope init` logic.
|
|
84
|
+
*
|
|
85
|
+
* Separated from the Commander action so it can be unit-tested without
|
|
86
|
+
* spawning a real subprocess.
|
|
87
|
+
*/
|
|
88
|
+
declare function runInit(options: InitOptions): Promise<InitResult>;
|
|
89
|
+
|
|
90
|
+
declare function createInitCommand(): Command;
|
|
91
|
+
|
|
4
92
|
/**
|
|
5
93
|
* @agent-scope/cli — manifest sub-commands
|
|
6
94
|
*
|
|
@@ -67,4 +155,4 @@ declare function createProgram(options?: ScopeCLIOptions): Command;
|
|
|
67
155
|
*/
|
|
68
156
|
declare function createTokensCommand(): Command;
|
|
69
157
|
|
|
70
|
-
export { type ListRow, type QueryRow, type ScopeCLIOptions, createManifestCommand, createProgram, createTokensCommand, isTTY, matchGlob };
|
|
158
|
+
export { type InitOptions, type InitResult, type ListRow, type QueryRow, type ReactScopeConfig, type ScopeCLIOptions, createInitCommand, createManifestCommand, createProgram, createTokensCommand, isTTY, matchGlob, runInit };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { ComplexityClass } from '@agent-scope/manifest';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @agent-scope/cli — `scope init` command implementation
|
|
6
|
+
*
|
|
7
|
+
* Scaffolds a `reactscope.config.json` (and friends) in the current working
|
|
8
|
+
* directory. Supports two modes:
|
|
9
|
+
*
|
|
10
|
+
* - Interactive (default): prompts the user to confirm / override every
|
|
11
|
+
* auto-detected value via Node's built-in `readline`.
|
|
12
|
+
* - Non-interactive (`--yes`): accepts all auto-detected defaults without
|
|
13
|
+
* prompting and prints a summary of created files.
|
|
14
|
+
*
|
|
15
|
+
* Safety rules (locked decisions):
|
|
16
|
+
* - Config file format is JSON (`reactscope.config.json`).
|
|
17
|
+
* - Output directory is `.reactscope/` — always added to `.gitignore`.
|
|
18
|
+
* - Auto-detection is non-destructive; never overwrite existing config
|
|
19
|
+
* without `--force`.
|
|
20
|
+
*/
|
|
21
|
+
interface ReactScopeConfig {
|
|
22
|
+
components: {
|
|
23
|
+
include: string[];
|
|
24
|
+
exclude: string[];
|
|
25
|
+
wrappers: {
|
|
26
|
+
providers: string[];
|
|
27
|
+
globalCSS: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
render: {
|
|
31
|
+
viewport: {
|
|
32
|
+
default: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
theme: "light" | "dark";
|
|
38
|
+
warmBrowser: boolean;
|
|
39
|
+
};
|
|
40
|
+
tokens: {
|
|
41
|
+
file: string;
|
|
42
|
+
compliance: {
|
|
43
|
+
threshold: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
output: {
|
|
47
|
+
dir: string;
|
|
48
|
+
sprites: {
|
|
49
|
+
format: "png" | "webp";
|
|
50
|
+
cellPadding: number;
|
|
51
|
+
labelAxes: boolean;
|
|
52
|
+
};
|
|
53
|
+
json: {
|
|
54
|
+
pretty: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
ci: {
|
|
58
|
+
complianceThreshold: number;
|
|
59
|
+
failOnA11yViolations: boolean;
|
|
60
|
+
failOnConsoleErrors: boolean;
|
|
61
|
+
baselinePath: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
interface InitOptions {
|
|
65
|
+
/** Accept all defaults without prompting. */
|
|
66
|
+
yes: boolean;
|
|
67
|
+
/** Overwrite existing config without warning. */
|
|
68
|
+
force: boolean;
|
|
69
|
+
/** Root directory (defaults to `process.cwd()`). */
|
|
70
|
+
cwd?: string;
|
|
71
|
+
}
|
|
72
|
+
interface InitResult {
|
|
73
|
+
/** Whether the command succeeded. */
|
|
74
|
+
success: boolean;
|
|
75
|
+
/** Human-readable message summarising the outcome. */
|
|
76
|
+
message: string;
|
|
77
|
+
/** Paths of files that were created. */
|
|
78
|
+
created: string[];
|
|
79
|
+
/** Whether init was skipped (config already existed and --force was not set). */
|
|
80
|
+
skipped: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Execute `scope init` logic.
|
|
84
|
+
*
|
|
85
|
+
* Separated from the Commander action so it can be unit-tested without
|
|
86
|
+
* spawning a real subprocess.
|
|
87
|
+
*/
|
|
88
|
+
declare function runInit(options: InitOptions): Promise<InitResult>;
|
|
89
|
+
|
|
90
|
+
declare function createInitCommand(): Command;
|
|
91
|
+
|
|
4
92
|
/**
|
|
5
93
|
* @agent-scope/cli — manifest sub-commands
|
|
6
94
|
*
|
|
@@ -67,4 +155,4 @@ declare function createProgram(options?: ScopeCLIOptions): Command;
|
|
|
67
155
|
*/
|
|
68
156
|
declare function createTokensCommand(): Command;
|
|
69
157
|
|
|
70
|
-
export { type ListRow, type QueryRow, type ScopeCLIOptions, createManifestCommand, createProgram, createTokensCommand, isTTY, matchGlob };
|
|
158
|
+
export { type InitOptions, type InitResult, type ListRow, type QueryRow, type ReactScopeConfig, type ScopeCLIOptions, createInitCommand, createManifestCommand, createProgram, createTokensCommand, isTTY, matchGlob, runInit };
|