@zhuan-ai/zhuanspec 1.3.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/LICENSE +22 -0
- package/README.md +461 -0
- package/README.zh.md +434 -0
- package/bin/zhuanspec.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +356 -0
- package/dist/commands/artifact-workflow.d.ts +13 -0
- package/dist/commands/artifact-workflow.js +916 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +221 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.js +198 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/core/archive.d.ts +30 -0
- package/dist/core/archive.js +438 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +7 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +134 -0
- package/dist/core/artifact-graph/instruction-loader.js +180 -0
- package/dist/core/artifact-graph/resolver.d.ts +61 -0
- package/dist/core/artifact-graph/resolver.js +187 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +54 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +362 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.js +102 -0
- package/dist/core/completions/factory.d.ts +51 -0
- package/dist/core/completions/factory.js +57 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +58 -0
- package/dist/core/completions/generators/zsh-generator.js +319 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +136 -0
- package/dist/core/completions/installers/zsh-installer.js +449 -0
- package/dist/core/completions/types.d.ts +78 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-schema.d.ts +76 -0
- package/dist/core/config-schema.js +200 -0
- package/dist/core/config.d.ts +16 -0
- package/dist/core/config.js +29 -0
- package/dist/core/configurators/agents.d.ts +8 -0
- package/dist/core/configurators/agents.js +15 -0
- package/dist/core/configurators/base.d.ts +7 -0
- package/dist/core/configurators/base.js +2 -0
- package/dist/core/configurators/claude.d.ts +8 -0
- package/dist/core/configurators/claude.js +15 -0
- package/dist/core/configurators/cline.d.ts +8 -0
- package/dist/core/configurators/cline.js +15 -0
- package/dist/core/configurators/codebuddy.d.ts +8 -0
- package/dist/core/configurators/codebuddy.js +15 -0
- package/dist/core/configurators/costrict.d.ts +8 -0
- package/dist/core/configurators/costrict.js +15 -0
- package/dist/core/configurators/iflow.d.ts +8 -0
- package/dist/core/configurators/iflow.js +15 -0
- package/dist/core/configurators/qoder.d.ts +30 -0
- package/dist/core/configurators/qoder.js +42 -0
- package/dist/core/configurators/qwen.d.ts +24 -0
- package/dist/core/configurators/qwen.js +37 -0
- package/dist/core/configurators/registry.d.ts +9 -0
- package/dist/core/configurators/registry.js +43 -0
- package/dist/core/configurators/slash/amazon-q.d.ts +9 -0
- package/dist/core/configurators/slash/amazon-q.js +46 -0
- package/dist/core/configurators/slash/antigravity.d.ts +9 -0
- package/dist/core/configurators/slash/antigravity.js +23 -0
- package/dist/core/configurators/slash/auggie.d.ts +9 -0
- package/dist/core/configurators/slash/auggie.js +31 -0
- package/dist/core/configurators/slash/base.d.ts +19 -0
- package/dist/core/configurators/slash/base.js +69 -0
- package/dist/core/configurators/slash/claude.d.ts +9 -0
- package/dist/core/configurators/slash/claude.js +37 -0
- package/dist/core/configurators/slash/cline.d.ts +9 -0
- package/dist/core/configurators/slash/cline.js +23 -0
- package/dist/core/configurators/slash/codebuddy.d.ts +9 -0
- package/dist/core/configurators/slash/codebuddy.js +37 -0
- package/dist/core/configurators/slash/codex.d.ts +14 -0
- package/dist/core/configurators/slash/codex.js +109 -0
- package/dist/core/configurators/slash/costrict.d.ts +9 -0
- package/dist/core/configurators/slash/costrict.js +31 -0
- package/dist/core/configurators/slash/crush.d.ts +9 -0
- package/dist/core/configurators/slash/crush.js +37 -0
- package/dist/core/configurators/slash/cursor.d.ts +9 -0
- package/dist/core/configurators/slash/cursor.js +37 -0
- package/dist/core/configurators/slash/factory.d.ts +10 -0
- package/dist/core/configurators/slash/factory.js +35 -0
- package/dist/core/configurators/slash/gemini.d.ts +9 -0
- package/dist/core/configurators/slash/gemini.js +22 -0
- package/dist/core/configurators/slash/github-copilot.d.ts +9 -0
- package/dist/core/configurators/slash/github-copilot.js +34 -0
- package/dist/core/configurators/slash/iflow.d.ts +9 -0
- package/dist/core/configurators/slash/iflow.js +37 -0
- package/dist/core/configurators/slash/kilocode.d.ts +9 -0
- package/dist/core/configurators/slash/kilocode.js +17 -0
- package/dist/core/configurators/slash/opencode.d.ts +12 -0
- package/dist/core/configurators/slash/opencode.js +72 -0
- package/dist/core/configurators/slash/qoder.d.ts +35 -0
- package/dist/core/configurators/slash/qoder.js +76 -0
- package/dist/core/configurators/slash/qwen.d.ts +32 -0
- package/dist/core/configurators/slash/qwen.js +49 -0
- package/dist/core/configurators/slash/registry.d.ts +8 -0
- package/dist/core/configurators/slash/registry.js +75 -0
- package/dist/core/configurators/slash/roocode.d.ts +9 -0
- package/dist/core/configurators/slash/roocode.js +23 -0
- package/dist/core/configurators/slash/toml-base.d.ts +10 -0
- package/dist/core/configurators/slash/toml-base.js +53 -0
- package/dist/core/configurators/slash/windsurf.d.ts +9 -0
- package/dist/core/configurators/slash/windsurf.js +23 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +39 -0
- package/dist/core/global-config.js +115 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/init.d.ts +60 -0
- package/dist/core/init.js +861 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/project-config.d.ts +34 -0
- package/dist/core/project-config.js +79 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/skill-discovery.d.ts +24 -0
- package/dist/core/skill-discovery.js +153 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +384 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/agents-root-stub.d.ts +2 -0
- package/dist/core/templates/agents-root-stub.js +17 -0
- package/dist/core/templates/agents-template.d.ts +2 -0
- package/dist/core/templates/agents-template.js +706 -0
- package/dist/core/templates/claude-template.d.ts +2 -0
- package/dist/core/templates/claude-template.js +2 -0
- package/dist/core/templates/cline-template.d.ts +2 -0
- package/dist/core/templates/cline-template.js +2 -0
- package/dist/core/templates/costrict-template.d.ts +2 -0
- package/dist/core/templates/costrict-template.js +2 -0
- package/dist/core/templates/index.d.ts +17 -0
- package/dist/core/templates/index.js +37 -0
- package/dist/core/templates/project-template.d.ts +8 -0
- package/dist/core/templates/project-template.js +32 -0
- package/dist/core/templates/skill-templates.d.ts +103 -0
- package/dist/core/templates/skill-templates.js +2131 -0
- package/dist/core/templates/slash-command-templates.d.ts +4 -0
- package/dist/core/templates/slash-command-templates.js +81 -0
- package/dist/core/update.d.ts +4 -0
- package/dist/core/update.js +88 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +409 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/utils/change-metadata.d.ts +47 -0
- package/dist/utils/change-metadata.js +130 -0
- package/dist/utils/change-utils.d.ts +51 -0
- package/dist/utils/change-utils.js +100 -0
- package/dist/utils/file-system.d.ts +19 -0
- package/dist/utils/file-system.js +177 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +81 -0
- package/schemas/spec-driven/schema.yaml +205 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +43 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +25 -0
- package/schemas/tdd/schema.yaml +213 -0
- package/schemas/tdd/templates/docs.md +0 -0
- package/schemas/tdd/templates/implementation.md +11 -0
- package/schemas/tdd/templates/spec.md +11 -0
- package/schemas/tdd/templates/test.md +11 -0
- package/scripts/postinstall.js +147 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { MarkdownParser } from '../parsers/markdown-parser.js';
|
|
4
|
+
import { ChangeParser } from '../parsers/change-parser.js';
|
|
5
|
+
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
6
|
+
export class JsonConverter {
|
|
7
|
+
convertSpecToJson(filePath) {
|
|
8
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
9
|
+
const parser = new MarkdownParser(content);
|
|
10
|
+
const specName = this.extractNameFromPath(filePath);
|
|
11
|
+
const spec = parser.parseSpec(specName);
|
|
12
|
+
const jsonSpec = {
|
|
13
|
+
...spec,
|
|
14
|
+
metadata: {
|
|
15
|
+
...spec.metadata,
|
|
16
|
+
sourcePath: filePath,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
return JSON.stringify(jsonSpec, null, 2);
|
|
20
|
+
}
|
|
21
|
+
async convertChangeToJson(filePath) {
|
|
22
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
23
|
+
const changeName = this.extractNameFromPath(filePath);
|
|
24
|
+
const changeDir = path.dirname(filePath);
|
|
25
|
+
const parser = new ChangeParser(content, changeDir);
|
|
26
|
+
const change = await parser.parseChangeWithDeltas(changeName);
|
|
27
|
+
const jsonChange = {
|
|
28
|
+
...change,
|
|
29
|
+
metadata: {
|
|
30
|
+
...change.metadata,
|
|
31
|
+
sourcePath: filePath,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
return JSON.stringify(jsonChange, null, 2);
|
|
35
|
+
}
|
|
36
|
+
extractNameFromPath(filePath) {
|
|
37
|
+
const normalizedPath = FileSystemUtils.toPosixPath(filePath);
|
|
38
|
+
const parts = normalizedPath.split('/');
|
|
39
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
40
|
+
if (parts[i] === 'specs' || parts[i] === 'changes') {
|
|
41
|
+
if (i < parts.length - 1) {
|
|
42
|
+
return parts[i + 1];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const fileName = parts[parts.length - 1] ?? '';
|
|
47
|
+
const dotIndex = fileName.lastIndexOf('.');
|
|
48
|
+
return dotIndex > 0 ? fileName.slice(0, dotIndex) : fileName;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=json-converter.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const GLOBAL_CONFIG_DIR_NAME = "zhuanspec";
|
|
2
|
+
export declare const GLOBAL_CONFIG_FILE_NAME = "config.json";
|
|
3
|
+
export declare const GLOBAL_DATA_DIR_NAME = "zhuanspec";
|
|
4
|
+
export interface GlobalConfig {
|
|
5
|
+
featureFlags?: Record<string, boolean>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Gets the global configuration directory path following XDG Base Directory Specification.
|
|
9
|
+
*
|
|
10
|
+
* - All platforms: $XDG_CONFIG_HOME/zhuanspec/ if XDG_CONFIG_HOME is set
|
|
11
|
+
* - Unix/macOS fallback: ~/.config/zhuanspec/
|
|
12
|
+
* - Windows fallback: %APPDATA%/zhuanspec/
|
|
13
|
+
*/
|
|
14
|
+
export declare function getGlobalConfigDir(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the global data directory path following XDG Base Directory Specification.
|
|
17
|
+
* Used for user data like schema overrides.
|
|
18
|
+
*
|
|
19
|
+
* - All platforms: $XDG_DATA_HOME/zhuanspec/ if XDG_DATA_HOME is set
|
|
20
|
+
* - Unix/macOS fallback: ~/.local/share/zhuanspec/
|
|
21
|
+
* - Windows fallback: %LOCALAPPDATA%/zhuanspec/
|
|
22
|
+
*/
|
|
23
|
+
export declare function getGlobalDataDir(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the path to the global config file.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getGlobalConfigPath(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Loads the global configuration from disk.
|
|
30
|
+
* Returns default configuration if file doesn't exist or is invalid.
|
|
31
|
+
* Merges loaded config with defaults to ensure new fields are available.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getGlobalConfig(): GlobalConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Saves the global configuration to disk.
|
|
36
|
+
* Creates the config directory if it doesn't exist.
|
|
37
|
+
*/
|
|
38
|
+
export declare function saveGlobalConfig(config: GlobalConfig): void;
|
|
39
|
+
//# sourceMappingURL=global-config.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
// Constants
|
|
5
|
+
export const GLOBAL_CONFIG_DIR_NAME = 'zhuanspec';
|
|
6
|
+
export const GLOBAL_CONFIG_FILE_NAME = 'config.json';
|
|
7
|
+
export const GLOBAL_DATA_DIR_NAME = 'zhuanspec';
|
|
8
|
+
const DEFAULT_CONFIG = {
|
|
9
|
+
featureFlags: {}
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Gets the global configuration directory path following XDG Base Directory Specification.
|
|
13
|
+
*
|
|
14
|
+
* - All platforms: $XDG_CONFIG_HOME/zhuanspec/ if XDG_CONFIG_HOME is set
|
|
15
|
+
* - Unix/macOS fallback: ~/.config/zhuanspec/
|
|
16
|
+
* - Windows fallback: %APPDATA%/zhuanspec/
|
|
17
|
+
*/
|
|
18
|
+
export function getGlobalConfigDir() {
|
|
19
|
+
// XDG_CONFIG_HOME takes precedence on all platforms when explicitly set
|
|
20
|
+
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
21
|
+
if (xdgConfigHome) {
|
|
22
|
+
return path.join(xdgConfigHome, GLOBAL_CONFIG_DIR_NAME);
|
|
23
|
+
}
|
|
24
|
+
const platform = os.platform();
|
|
25
|
+
if (platform === 'win32') {
|
|
26
|
+
// Windows: use %APPDATA%
|
|
27
|
+
const appData = process.env.APPDATA;
|
|
28
|
+
if (appData) {
|
|
29
|
+
return path.join(appData, GLOBAL_CONFIG_DIR_NAME);
|
|
30
|
+
}
|
|
31
|
+
// Fallback for Windows if APPDATA is not set
|
|
32
|
+
return path.join(os.homedir(), 'AppData', 'Roaming', GLOBAL_CONFIG_DIR_NAME);
|
|
33
|
+
}
|
|
34
|
+
// Unix/macOS fallback: ~/.config
|
|
35
|
+
return path.join(os.homedir(), '.config', GLOBAL_CONFIG_DIR_NAME);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets the global data directory path following XDG Base Directory Specification.
|
|
39
|
+
* Used for user data like schema overrides.
|
|
40
|
+
*
|
|
41
|
+
* - All platforms: $XDG_DATA_HOME/zhuanspec/ if XDG_DATA_HOME is set
|
|
42
|
+
* - Unix/macOS fallback: ~/.local/share/zhuanspec/
|
|
43
|
+
* - Windows fallback: %LOCALAPPDATA%/zhuanspec/
|
|
44
|
+
*/
|
|
45
|
+
export function getGlobalDataDir() {
|
|
46
|
+
// XDG_DATA_HOME takes precedence on all platforms when explicitly set
|
|
47
|
+
const xdgDataHome = process.env.XDG_DATA_HOME;
|
|
48
|
+
if (xdgDataHome) {
|
|
49
|
+
return path.join(xdgDataHome, GLOBAL_DATA_DIR_NAME);
|
|
50
|
+
}
|
|
51
|
+
const platform = os.platform();
|
|
52
|
+
if (platform === 'win32') {
|
|
53
|
+
// Windows: use %LOCALAPPDATA%
|
|
54
|
+
const localAppData = process.env.LOCALAPPDATA;
|
|
55
|
+
if (localAppData) {
|
|
56
|
+
return path.join(localAppData, GLOBAL_DATA_DIR_NAME);
|
|
57
|
+
}
|
|
58
|
+
// Fallback for Windows if LOCALAPPDATA is not set
|
|
59
|
+
return path.join(os.homedir(), 'AppData', 'Local', GLOBAL_DATA_DIR_NAME);
|
|
60
|
+
}
|
|
61
|
+
// Unix/macOS fallback: ~/.local/share
|
|
62
|
+
return path.join(os.homedir(), '.local', 'share', GLOBAL_DATA_DIR_NAME);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the path to the global config file.
|
|
66
|
+
*/
|
|
67
|
+
export function getGlobalConfigPath() {
|
|
68
|
+
return path.join(getGlobalConfigDir(), GLOBAL_CONFIG_FILE_NAME);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Loads the global configuration from disk.
|
|
72
|
+
* Returns default configuration if file doesn't exist or is invalid.
|
|
73
|
+
* Merges loaded config with defaults to ensure new fields are available.
|
|
74
|
+
*/
|
|
75
|
+
export function getGlobalConfig() {
|
|
76
|
+
const configPath = getGlobalConfigPath();
|
|
77
|
+
try {
|
|
78
|
+
if (!fs.existsSync(configPath)) {
|
|
79
|
+
return { ...DEFAULT_CONFIG };
|
|
80
|
+
}
|
|
81
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
82
|
+
const parsed = JSON.parse(content);
|
|
83
|
+
// Merge with defaults (loaded values take precedence)
|
|
84
|
+
return {
|
|
85
|
+
...DEFAULT_CONFIG,
|
|
86
|
+
...parsed,
|
|
87
|
+
// Deep merge featureFlags
|
|
88
|
+
featureFlags: {
|
|
89
|
+
...DEFAULT_CONFIG.featureFlags,
|
|
90
|
+
...(parsed.featureFlags || {})
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
// Log warning for parse errors, but not for missing files
|
|
96
|
+
if (error instanceof SyntaxError) {
|
|
97
|
+
console.error(`Warning: Invalid JSON in ${configPath}, using defaults`);
|
|
98
|
+
}
|
|
99
|
+
return { ...DEFAULT_CONFIG };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Saves the global configuration to disk.
|
|
104
|
+
* Creates the config directory if it doesn't exist.
|
|
105
|
+
*/
|
|
106
|
+
export function saveGlobalConfig(config) {
|
|
107
|
+
const configDir = getGlobalConfigDir();
|
|
108
|
+
const configPath = getGlobalConfigPath();
|
|
109
|
+
// Create directory if it doesn't exist
|
|
110
|
+
if (!fs.existsSync(configDir)) {
|
|
111
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=global-config.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Core ZhuanSpec logic will be implemented here
|
|
2
|
+
export { GLOBAL_CONFIG_DIR_NAME, GLOBAL_CONFIG_FILE_NAME, GLOBAL_DATA_DIR_NAME, getGlobalConfigDir, getGlobalConfigPath, getGlobalConfig, saveGlobalConfig, getGlobalDataDir } from './global-config.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type ToolLabel = {
|
|
2
|
+
primary: string;
|
|
3
|
+
annotation?: string;
|
|
4
|
+
};
|
|
5
|
+
type ToolWizardChoice = {
|
|
6
|
+
kind: 'heading' | 'info';
|
|
7
|
+
value: string;
|
|
8
|
+
label: ToolLabel;
|
|
9
|
+
selectable: false;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'option';
|
|
12
|
+
value: string;
|
|
13
|
+
label: ToolLabel;
|
|
14
|
+
configured: boolean;
|
|
15
|
+
selectable: true;
|
|
16
|
+
};
|
|
17
|
+
type ToolWizardConfig = {
|
|
18
|
+
extendMode: boolean;
|
|
19
|
+
baseMessage: string;
|
|
20
|
+
choices: ToolWizardChoice[];
|
|
21
|
+
initialSelected?: string[];
|
|
22
|
+
};
|
|
23
|
+
type ToolSelectionPrompt = (config: ToolWizardConfig) => Promise<string[]>;
|
|
24
|
+
type InitCommandOptions = {
|
|
25
|
+
prompt?: ToolSelectionPrompt;
|
|
26
|
+
tools?: string;
|
|
27
|
+
businessDirection?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare class InitCommand {
|
|
30
|
+
private readonly prompt;
|
|
31
|
+
private readonly toolsArg?;
|
|
32
|
+
private businessDirection?;
|
|
33
|
+
constructor(options?: InitCommandOptions);
|
|
34
|
+
execute(targetPath: string): Promise<void>;
|
|
35
|
+
private validate;
|
|
36
|
+
private getConfiguration;
|
|
37
|
+
private getSelectedTools;
|
|
38
|
+
private resolveToolsArg;
|
|
39
|
+
private promptForAITools;
|
|
40
|
+
private getExistingToolStates;
|
|
41
|
+
private isToolConfigured;
|
|
42
|
+
private createDirectoryStructure;
|
|
43
|
+
private generateFiles;
|
|
44
|
+
private ensureTemplateFiles;
|
|
45
|
+
private getRepoCwd;
|
|
46
|
+
private fetchAvailableBusinessDirections;
|
|
47
|
+
private promptForBusinessDirection;
|
|
48
|
+
private fetchArchitectureFile;
|
|
49
|
+
private fetchRemoteArchitectureFiles;
|
|
50
|
+
private fetchRemoteArchitectureContent;
|
|
51
|
+
private writeTemplateFiles;
|
|
52
|
+
private configureAITools;
|
|
53
|
+
private configureRootAgentsStub;
|
|
54
|
+
private displaySuccessMessage;
|
|
55
|
+
private formatToolNames;
|
|
56
|
+
private renderBanner;
|
|
57
|
+
private startSpinner;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=init.d.ts.map
|