@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,9 @@
|
|
|
1
|
+
import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class GeminiSlashCommandConfigurator extends TomlSlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "gemini";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getDescription(id: SlashCommandId): string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: '.gemini/commands/zhuanspec/proposal.toml',
|
|
4
|
+
apply: '.gemini/commands/zhuanspec/apply.toml',
|
|
5
|
+
archive: '.gemini/commands/zhuanspec/archive.toml'
|
|
6
|
+
};
|
|
7
|
+
const DESCRIPTIONS = {
|
|
8
|
+
proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
|
|
9
|
+
apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
|
|
10
|
+
archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
|
|
11
|
+
};
|
|
12
|
+
export class GeminiSlashCommandConfigurator extends TomlSlashCommandConfigurator {
|
|
13
|
+
toolId = 'gemini';
|
|
14
|
+
isAvailable = true;
|
|
15
|
+
getRelativePath(id) {
|
|
16
|
+
return FILE_PATHS[id];
|
|
17
|
+
}
|
|
18
|
+
getDescription(id) {
|
|
19
|
+
return DESCRIPTIONS[id];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=gemini.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class GitHubCopilotSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "github-copilot";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=github-copilot.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: '.github/prompts/zhuanspec-proposal.prompt.md',
|
|
4
|
+
apply: '.github/prompts/zhuanspec-apply.prompt.md',
|
|
5
|
+
archive: '.github/prompts/zhuanspec-archive.prompt.md'
|
|
6
|
+
};
|
|
7
|
+
const FRONTMATTER = {
|
|
8
|
+
proposal: `---
|
|
9
|
+
description: 搭建新的 ZhuanSpec 变更并严格验证。
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS`,
|
|
13
|
+
apply: `---
|
|
14
|
+
description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
$ARGUMENTS`,
|
|
18
|
+
archive: `---
|
|
19
|
+
description: 归档已部署的 ZhuanSpec 变更并更新规范。
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS`
|
|
23
|
+
};
|
|
24
|
+
export class GitHubCopilotSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
25
|
+
toolId = 'github-copilot';
|
|
26
|
+
isAvailable = true;
|
|
27
|
+
getRelativePath(id) {
|
|
28
|
+
return FILE_PATHS[id];
|
|
29
|
+
}
|
|
30
|
+
getFrontmatter(id) {
|
|
31
|
+
return FRONTMATTER[id];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=github-copilot.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "iflow";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=iflow.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: '.iflow/commands/zhuanspec-proposal.md',
|
|
4
|
+
apply: '.iflow/commands/zhuanspec-apply.md',
|
|
5
|
+
archive: '.iflow/commands/zhuanspec-archive.md'
|
|
6
|
+
};
|
|
7
|
+
const FRONTMATTER = {
|
|
8
|
+
proposal: `---
|
|
9
|
+
name: /zhuanspec-proposal
|
|
10
|
+
id: zhuanspec-proposal
|
|
11
|
+
category: ZhuanSpec
|
|
12
|
+
description: 搭建新的 ZhuanSpec 变更并严格验证。
|
|
13
|
+
---`,
|
|
14
|
+
apply: `---
|
|
15
|
+
name: /zhuanspec-apply
|
|
16
|
+
id: zhuanspec-apply
|
|
17
|
+
category: ZhuanSpec
|
|
18
|
+
description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
|
|
19
|
+
---`,
|
|
20
|
+
archive: `---
|
|
21
|
+
name: /zhuanspec-archive
|
|
22
|
+
id: zhuanspec-archive
|
|
23
|
+
category: ZhuanSpec
|
|
24
|
+
description: 归档已部署的 ZhuanSpec 变更并更新规范。
|
|
25
|
+
---`
|
|
26
|
+
};
|
|
27
|
+
export class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
28
|
+
toolId = 'iflow';
|
|
29
|
+
isAvailable = true;
|
|
30
|
+
getRelativePath(id) {
|
|
31
|
+
return FILE_PATHS[id];
|
|
32
|
+
}
|
|
33
|
+
getFrontmatter(id) {
|
|
34
|
+
return FRONTMATTER[id];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=iflow.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from "./base.js";
|
|
2
|
+
import { SlashCommandId } from "../../templates/index.js";
|
|
3
|
+
export declare class KiloCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "kilocode";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(_id: SlashCommandId): string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=kilocode.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from "./base.js";
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: ".kilocode/workflows/zhuanspec-proposal.md",
|
|
4
|
+
apply: ".kilocode/workflows/zhuanspec-apply.md",
|
|
5
|
+
archive: ".kilocode/workflows/zhuanspec-archive.md"
|
|
6
|
+
};
|
|
7
|
+
export class KiloCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
|
+
toolId = "kilocode";
|
|
9
|
+
isAvailable = true;
|
|
10
|
+
getRelativePath(id) {
|
|
11
|
+
return FILE_PATHS[id];
|
|
12
|
+
}
|
|
13
|
+
getFrontmatter(_id) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=kilocode.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from "./base.js";
|
|
2
|
+
import { SlashCommandId } from "../../templates/index.js";
|
|
3
|
+
export declare class OpenCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "opencode";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
+
generateAll(projectPath: string, _zhuanspecDir: string): Promise<string[]>;
|
|
9
|
+
updateExisting(projectPath: string, _zhuanspecDir: string): Promise<string[]>;
|
|
10
|
+
private rewriteArchiveFile;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from "./base.js";
|
|
2
|
+
import { FileSystemUtils } from "../../../utils/file-system.js";
|
|
3
|
+
import { ZHUANSPEC_MARKERS } from "../../config.js";
|
|
4
|
+
const FILE_PATHS = {
|
|
5
|
+
proposal: ".opencode/command/zhuanspec-proposal.md",
|
|
6
|
+
apply: ".opencode/command/zhuanspec-apply.md",
|
|
7
|
+
archive: ".opencode/command/zhuanspec-archive.md",
|
|
8
|
+
};
|
|
9
|
+
const FRONTMATTER = {
|
|
10
|
+
proposal: `---
|
|
11
|
+
description: 搭建新的 ZhuanSpec 变更并严格验证。
|
|
12
|
+
---
|
|
13
|
+
用户已请求以下变更提案。使用 zhuanspec 说明创建他们的变更提案。
|
|
14
|
+
<UserRequest>
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
</UserRequest>
|
|
17
|
+
`,
|
|
18
|
+
apply: `---
|
|
19
|
+
description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
|
|
20
|
+
---
|
|
21
|
+
用户已请求实施以下变更提案。找到变更提案并按照下面的说明操作。如果不确定或存在歧义,请向用户询问澄清。
|
|
22
|
+
<UserRequest>
|
|
23
|
+
$ARGUMENTS
|
|
24
|
+
</UserRequest>
|
|
25
|
+
`,
|
|
26
|
+
archive: `---
|
|
27
|
+
description: 归档已部署的 ZhuanSpec 变更并更新规范。
|
|
28
|
+
---
|
|
29
|
+
<ChangeId>
|
|
30
|
+
$ARGUMENTS
|
|
31
|
+
</ChangeId>
|
|
32
|
+
`,
|
|
33
|
+
};
|
|
34
|
+
export class OpenCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
35
|
+
toolId = "opencode";
|
|
36
|
+
isAvailable = true;
|
|
37
|
+
getRelativePath(id) {
|
|
38
|
+
return FILE_PATHS[id];
|
|
39
|
+
}
|
|
40
|
+
getFrontmatter(id) {
|
|
41
|
+
return FRONTMATTER[id];
|
|
42
|
+
}
|
|
43
|
+
async generateAll(projectPath, _zhuanspecDir) {
|
|
44
|
+
const createdOrUpdated = await super.generateAll(projectPath, _zhuanspecDir);
|
|
45
|
+
await this.rewriteArchiveFile(projectPath);
|
|
46
|
+
return createdOrUpdated;
|
|
47
|
+
}
|
|
48
|
+
async updateExisting(projectPath, _zhuanspecDir) {
|
|
49
|
+
const updated = await super.updateExisting(projectPath, _zhuanspecDir);
|
|
50
|
+
const rewroteArchive = await this.rewriteArchiveFile(projectPath);
|
|
51
|
+
if (rewroteArchive && !updated.includes(FILE_PATHS.archive)) {
|
|
52
|
+
updated.push(FILE_PATHS.archive);
|
|
53
|
+
}
|
|
54
|
+
return updated;
|
|
55
|
+
}
|
|
56
|
+
async rewriteArchiveFile(projectPath) {
|
|
57
|
+
const archivePath = FileSystemUtils.joinPath(projectPath, FILE_PATHS.archive);
|
|
58
|
+
if (!await FileSystemUtils.fileExists(archivePath)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const body = this.getBody("archive");
|
|
62
|
+
const frontmatter = this.getFrontmatter("archive");
|
|
63
|
+
const sections = [];
|
|
64
|
+
if (frontmatter) {
|
|
65
|
+
sections.push(frontmatter.trim());
|
|
66
|
+
}
|
|
67
|
+
sections.push(`${ZHUANSPEC_MARKERS.start}\n${body}\n${ZHUANSPEC_MARKERS.end}`);
|
|
68
|
+
await FileSystemUtils.writeFile(archivePath, sections.join("\n") + "\n");
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Qoder Slash Command Configurator
|
|
5
|
+
*
|
|
6
|
+
* Manages ZhuanSpec slash commands for Qoder AI assistant.
|
|
7
|
+
* Creates three workflow commands: proposal, apply, and archive.
|
|
8
|
+
* Uses colon-separated command format (/zhuanspec:proposal).
|
|
9
|
+
*
|
|
10
|
+
* @extends {SlashCommandConfigurator}
|
|
11
|
+
*/
|
|
12
|
+
export declare class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
13
|
+
/** Unique identifier for Qoder tool */
|
|
14
|
+
readonly toolId = "qoder";
|
|
15
|
+
/** Indicates slash commands are available for this tool */
|
|
16
|
+
readonly isAvailable = true;
|
|
17
|
+
/**
|
|
18
|
+
* Get relative file path for a slash command
|
|
19
|
+
*
|
|
20
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
21
|
+
* @returns {string} Relative path from project root to command file
|
|
22
|
+
*/
|
|
23
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get YAML frontmatter for a slash command
|
|
26
|
+
*
|
|
27
|
+
* Frontmatter defines how the command appears in Qoder's UI,
|
|
28
|
+
* including display name, description, and categorization.
|
|
29
|
+
*
|
|
30
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
31
|
+
* @returns {string} YAML frontmatter block with command metadata
|
|
32
|
+
*/
|
|
33
|
+
protected getFrontmatter(id: SlashCommandId): string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=qoder.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* File paths for Qoder slash commands
|
|
4
|
+
* Maps each ZhuanSpec workflow stage to its command file location
|
|
5
|
+
* Commands are stored in .qoder/commands/zhuanspec/ directory
|
|
6
|
+
*/
|
|
7
|
+
const FILE_PATHS = {
|
|
8
|
+
// Create and validate new change proposals
|
|
9
|
+
proposal: '.qoder/commands/zhuanspec/proposal.md',
|
|
10
|
+
// Implement approved changes with task tracking
|
|
11
|
+
apply: '.qoder/commands/zhuanspec/apply.md',
|
|
12
|
+
// Archive completed changes and update specs
|
|
13
|
+
archive: '.qoder/commands/zhuanspec/archive.md'
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* YAML frontmatter for Qoder slash commands
|
|
17
|
+
* Defines metadata displayed in Qoder's command palette
|
|
18
|
+
* Each command is categorized and tagged for easy discovery
|
|
19
|
+
*/
|
|
20
|
+
const FRONTMATTER = {
|
|
21
|
+
proposal: `---
|
|
22
|
+
name: ZhuanSpec: Proposal
|
|
23
|
+
description: 搭建新的 ZhuanSpec 变更并严格验证。
|
|
24
|
+
category: ZhuanSpec
|
|
25
|
+
tags: [zhuanspec, change]
|
|
26
|
+
---`,
|
|
27
|
+
apply: `---
|
|
28
|
+
name: ZhuanSpec: Apply
|
|
29
|
+
description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
|
|
30
|
+
category: ZhuanSpec
|
|
31
|
+
tags: [zhuanspec, apply]
|
|
32
|
+
---`,
|
|
33
|
+
archive: `---
|
|
34
|
+
name: ZhuanSpec: Archive
|
|
35
|
+
description: 归档已部署的 ZhuanSpec 变更并更新规范。
|
|
36
|
+
category: ZhuanSpec
|
|
37
|
+
tags: [zhuanspec, archive]
|
|
38
|
+
---`
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Qoder Slash Command Configurator
|
|
42
|
+
*
|
|
43
|
+
* Manages ZhuanSpec slash commands for Qoder AI assistant.
|
|
44
|
+
* Creates three workflow commands: proposal, apply, and archive.
|
|
45
|
+
* Uses colon-separated command format (/zhuanspec:proposal).
|
|
46
|
+
*
|
|
47
|
+
* @extends {SlashCommandConfigurator}
|
|
48
|
+
*/
|
|
49
|
+
export class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
50
|
+
/** Unique identifier for Qoder tool */
|
|
51
|
+
toolId = 'qoder';
|
|
52
|
+
/** Indicates slash commands are available for this tool */
|
|
53
|
+
isAvailable = true;
|
|
54
|
+
/**
|
|
55
|
+
* Get relative file path for a slash command
|
|
56
|
+
*
|
|
57
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
58
|
+
* @returns {string} Relative path from project root to command file
|
|
59
|
+
*/
|
|
60
|
+
getRelativePath(id) {
|
|
61
|
+
return FILE_PATHS[id];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get YAML frontmatter for a slash command
|
|
65
|
+
*
|
|
66
|
+
* Frontmatter defines how the command appears in Qoder's UI,
|
|
67
|
+
* including display name, description, and categorization.
|
|
68
|
+
*
|
|
69
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
70
|
+
* @returns {string} YAML frontmatter block with command metadata
|
|
71
|
+
*/
|
|
72
|
+
getFrontmatter(id) {
|
|
73
|
+
return FRONTMATTER[id];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=qoder.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen slash command configurator for ZhuanSpec integration.
|
|
3
|
+
* This class handles the generation of Qwen-specific slash command files
|
|
4
|
+
* in the .qwen/commands directory structure.
|
|
5
|
+
*
|
|
6
|
+
* @implements {SlashCommandConfigurator}
|
|
7
|
+
*/
|
|
8
|
+
import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
9
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* QwenSlashCommandConfigurator class provides integration with Qwen Code
|
|
12
|
+
* by creating the necessary slash command files in the .qwen/commands directory.
|
|
13
|
+
*
|
|
14
|
+
* The slash commands include:
|
|
15
|
+
* - /zhuanspec-proposal: Create a ZhuanSpec change proposal
|
|
16
|
+
* - /zhuanspec-apply: Apply an approved ZhuanSpec change
|
|
17
|
+
* - /zhuanspec-archive: 归档已部署的 ZhuanSpec 变更
|
|
18
|
+
*/
|
|
19
|
+
export declare class QwenSlashCommandConfigurator extends TomlSlashCommandConfigurator {
|
|
20
|
+
/** Unique identifier for the Qwen tool */
|
|
21
|
+
readonly toolId = "qwen";
|
|
22
|
+
/** Availability status for the Qwen tool */
|
|
23
|
+
readonly isAvailable = true;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the relative file path for a given slash command ID.
|
|
26
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
27
|
+
* @returns {string} The relative path to the command file
|
|
28
|
+
*/
|
|
29
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
30
|
+
protected getDescription(id: SlashCommandId): string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=qwen.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen slash command configurator for ZhuanSpec integration.
|
|
3
|
+
* This class handles the generation of Qwen-specific slash command files
|
|
4
|
+
* in the .qwen/commands directory structure.
|
|
5
|
+
*
|
|
6
|
+
* @implements {SlashCommandConfigurator}
|
|
7
|
+
*/
|
|
8
|
+
import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
9
|
+
/**
|
|
10
|
+
* Mapping of slash command IDs to their corresponding file paths in .qwen/commands directory.
|
|
11
|
+
* @type {Record<SlashCommandId, string>}
|
|
12
|
+
*/
|
|
13
|
+
const FILE_PATHS = {
|
|
14
|
+
proposal: '.qwen/commands/zhuanspec-proposal.toml',
|
|
15
|
+
apply: '.qwen/commands/zhuanspec-apply.toml',
|
|
16
|
+
archive: '.qwen/commands/zhuanspec-archive.toml'
|
|
17
|
+
};
|
|
18
|
+
const DESCRIPTIONS = {
|
|
19
|
+
proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
|
|
20
|
+
apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
|
|
21
|
+
archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* QwenSlashCommandConfigurator class provides integration with Qwen Code
|
|
25
|
+
* by creating the necessary slash command files in the .qwen/commands directory.
|
|
26
|
+
*
|
|
27
|
+
* The slash commands include:
|
|
28
|
+
* - /zhuanspec-proposal: Create a ZhuanSpec change proposal
|
|
29
|
+
* - /zhuanspec-apply: Apply an approved ZhuanSpec change
|
|
30
|
+
* - /zhuanspec-archive: 归档已部署的 ZhuanSpec 变更
|
|
31
|
+
*/
|
|
32
|
+
export class QwenSlashCommandConfigurator extends TomlSlashCommandConfigurator {
|
|
33
|
+
/** Unique identifier for the Qwen tool */
|
|
34
|
+
toolId = 'qwen';
|
|
35
|
+
/** Availability status for the Qwen tool */
|
|
36
|
+
isAvailable = true;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the relative file path for a given slash command ID.
|
|
39
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
40
|
+
* @returns {string} The relative path to the command file
|
|
41
|
+
*/
|
|
42
|
+
getRelativePath(id) {
|
|
43
|
+
return FILE_PATHS[id];
|
|
44
|
+
}
|
|
45
|
+
getDescription(id) {
|
|
46
|
+
return DESCRIPTIONS[id];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=qwen.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
export declare class SlashCommandRegistry {
|
|
3
|
+
private static configurators;
|
|
4
|
+
static register(configurator: SlashCommandConfigurator): void;
|
|
5
|
+
static get(toolId: string): SlashCommandConfigurator | undefined;
|
|
6
|
+
static getAll(): SlashCommandConfigurator[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ClaudeSlashCommandConfigurator } from './claude.js';
|
|
2
|
+
import { CodeBuddySlashCommandConfigurator } from './codebuddy.js';
|
|
3
|
+
import { QoderSlashCommandConfigurator } from './qoder.js';
|
|
4
|
+
import { CursorSlashCommandConfigurator } from './cursor.js';
|
|
5
|
+
import { WindsurfSlashCommandConfigurator } from './windsurf.js';
|
|
6
|
+
import { KiloCodeSlashCommandConfigurator } from './kilocode.js';
|
|
7
|
+
import { OpenCodeSlashCommandConfigurator } from './opencode.js';
|
|
8
|
+
import { CodexSlashCommandConfigurator } from './codex.js';
|
|
9
|
+
import { GitHubCopilotSlashCommandConfigurator } from './github-copilot.js';
|
|
10
|
+
import { AmazonQSlashCommandConfigurator } from './amazon-q.js';
|
|
11
|
+
import { FactorySlashCommandConfigurator } from './factory.js';
|
|
12
|
+
import { GeminiSlashCommandConfigurator } from './gemini.js';
|
|
13
|
+
import { AuggieSlashCommandConfigurator } from './auggie.js';
|
|
14
|
+
import { ClineSlashCommandConfigurator } from './cline.js';
|
|
15
|
+
import { CrushSlashCommandConfigurator } from './crush.js';
|
|
16
|
+
import { CostrictSlashCommandConfigurator } from './costrict.js';
|
|
17
|
+
import { QwenSlashCommandConfigurator } from './qwen.js';
|
|
18
|
+
import { RooCodeSlashCommandConfigurator } from './roocode.js';
|
|
19
|
+
import { AntigravitySlashCommandConfigurator } from './antigravity.js';
|
|
20
|
+
import { IflowSlashCommandConfigurator } from './iflow.js';
|
|
21
|
+
export class SlashCommandRegistry {
|
|
22
|
+
static configurators = new Map();
|
|
23
|
+
static {
|
|
24
|
+
const claude = new ClaudeSlashCommandConfigurator();
|
|
25
|
+
const codeBuddy = new CodeBuddySlashCommandConfigurator();
|
|
26
|
+
const qoder = new QoderSlashCommandConfigurator();
|
|
27
|
+
const cursor = new CursorSlashCommandConfigurator();
|
|
28
|
+
const windsurf = new WindsurfSlashCommandConfigurator();
|
|
29
|
+
const kilocode = new KiloCodeSlashCommandConfigurator();
|
|
30
|
+
const opencode = new OpenCodeSlashCommandConfigurator();
|
|
31
|
+
const codex = new CodexSlashCommandConfigurator();
|
|
32
|
+
const githubCopilot = new GitHubCopilotSlashCommandConfigurator();
|
|
33
|
+
const amazonQ = new AmazonQSlashCommandConfigurator();
|
|
34
|
+
const factory = new FactorySlashCommandConfigurator();
|
|
35
|
+
const gemini = new GeminiSlashCommandConfigurator();
|
|
36
|
+
const auggie = new AuggieSlashCommandConfigurator();
|
|
37
|
+
const cline = new ClineSlashCommandConfigurator();
|
|
38
|
+
const crush = new CrushSlashCommandConfigurator();
|
|
39
|
+
const costrict = new CostrictSlashCommandConfigurator();
|
|
40
|
+
const qwen = new QwenSlashCommandConfigurator();
|
|
41
|
+
const roocode = new RooCodeSlashCommandConfigurator();
|
|
42
|
+
const antigravity = new AntigravitySlashCommandConfigurator();
|
|
43
|
+
const iflow = new IflowSlashCommandConfigurator();
|
|
44
|
+
this.configurators.set(claude.toolId, claude);
|
|
45
|
+
this.configurators.set(codeBuddy.toolId, codeBuddy);
|
|
46
|
+
this.configurators.set(qoder.toolId, qoder);
|
|
47
|
+
this.configurators.set(cursor.toolId, cursor);
|
|
48
|
+
this.configurators.set(windsurf.toolId, windsurf);
|
|
49
|
+
this.configurators.set(kilocode.toolId, kilocode);
|
|
50
|
+
this.configurators.set(opencode.toolId, opencode);
|
|
51
|
+
this.configurators.set(codex.toolId, codex);
|
|
52
|
+
this.configurators.set(githubCopilot.toolId, githubCopilot);
|
|
53
|
+
this.configurators.set(amazonQ.toolId, amazonQ);
|
|
54
|
+
this.configurators.set(factory.toolId, factory);
|
|
55
|
+
this.configurators.set(gemini.toolId, gemini);
|
|
56
|
+
this.configurators.set(auggie.toolId, auggie);
|
|
57
|
+
this.configurators.set(cline.toolId, cline);
|
|
58
|
+
this.configurators.set(crush.toolId, crush);
|
|
59
|
+
this.configurators.set(costrict.toolId, costrict);
|
|
60
|
+
this.configurators.set(qwen.toolId, qwen);
|
|
61
|
+
this.configurators.set(roocode.toolId, roocode);
|
|
62
|
+
this.configurators.set(antigravity.toolId, antigravity);
|
|
63
|
+
this.configurators.set(iflow.toolId, iflow);
|
|
64
|
+
}
|
|
65
|
+
static register(configurator) {
|
|
66
|
+
this.configurators.set(configurator.toolId, configurator);
|
|
67
|
+
}
|
|
68
|
+
static get(toolId) {
|
|
69
|
+
return this.configurators.get(toolId);
|
|
70
|
+
}
|
|
71
|
+
static getAll() {
|
|
72
|
+
return Array.from(this.configurators.values());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "roocode";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=roocode.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const NEW_FILE_PATHS = {
|
|
3
|
+
proposal: '.roo/commands/zhuanspec-proposal.md',
|
|
4
|
+
apply: '.roo/commands/zhuanspec-apply.md',
|
|
5
|
+
archive: '.roo/commands/zhuanspec-archive.md'
|
|
6
|
+
};
|
|
7
|
+
export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
|
+
toolId = 'roocode';
|
|
9
|
+
isAvailable = true;
|
|
10
|
+
getRelativePath(id) {
|
|
11
|
+
return NEW_FILE_PATHS[id];
|
|
12
|
+
}
|
|
13
|
+
getFrontmatter(id) {
|
|
14
|
+
const descriptions = {
|
|
15
|
+
proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
|
|
16
|
+
apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
|
|
17
|
+
archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
|
|
18
|
+
};
|
|
19
|
+
const description = descriptions[id];
|
|
20
|
+
return `# ZhuanSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=roocode.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare abstract class TomlSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
protected getFrontmatter(_id: SlashCommandId): string | undefined;
|
|
5
|
+
protected abstract getDescription(id: SlashCommandId): string;
|
|
6
|
+
generateAll(projectPath: string, _zhuanspecDir: string): Promise<string[]>;
|
|
7
|
+
private generateTOML;
|
|
8
|
+
protected updateBody(filePath: string, body: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=toml-base.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FileSystemUtils } from '../../../utils/file-system.js';
|
|
2
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
3
|
+
import { ZHUANSPEC_MARKERS } from '../../config.js';
|
|
4
|
+
export class TomlSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
5
|
+
getFrontmatter(_id) {
|
|
6
|
+
// TOML doesn't use separate frontmatter - it's all in one structure
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
// Override to generate TOML format with markers inside the prompt field
|
|
10
|
+
async generateAll(projectPath, _zhuanspecDir) {
|
|
11
|
+
const createdOrUpdated = [];
|
|
12
|
+
for (const target of this.getTargets()) {
|
|
13
|
+
const body = this.getBody(target.id);
|
|
14
|
+
const filePath = FileSystemUtils.joinPath(projectPath, target.path);
|
|
15
|
+
if (await FileSystemUtils.fileExists(filePath)) {
|
|
16
|
+
await this.updateBody(filePath, body);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const tomlContent = this.generateTOML(target.id, body);
|
|
20
|
+
await FileSystemUtils.writeFile(filePath, tomlContent);
|
|
21
|
+
}
|
|
22
|
+
createdOrUpdated.push(target.path);
|
|
23
|
+
}
|
|
24
|
+
return createdOrUpdated;
|
|
25
|
+
}
|
|
26
|
+
generateTOML(id, body) {
|
|
27
|
+
const description = this.getDescription(id);
|
|
28
|
+
// TOML format with triple-quoted string for multi-line prompt
|
|
29
|
+
// Markers are inside the prompt value
|
|
30
|
+
return `description = "${description}"
|
|
31
|
+
|
|
32
|
+
prompt = """
|
|
33
|
+
${ZHUANSPEC_MARKERS.start}
|
|
34
|
+
${body}
|
|
35
|
+
${ZHUANSPEC_MARKERS.end}
|
|
36
|
+
"""
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
// Override updateBody to handle TOML format
|
|
40
|
+
async updateBody(filePath, body) {
|
|
41
|
+
const content = await FileSystemUtils.readFile(filePath);
|
|
42
|
+
const startIndex = content.indexOf(ZHUANSPEC_MARKERS.start);
|
|
43
|
+
const endIndex = content.indexOf(ZHUANSPEC_MARKERS.end);
|
|
44
|
+
if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
|
|
45
|
+
throw new Error(`Missing ZhuanSpec markers in ${filePath}`);
|
|
46
|
+
}
|
|
47
|
+
const before = content.slice(0, startIndex + ZHUANSPEC_MARKERS.start.length);
|
|
48
|
+
const after = content.slice(endIndex);
|
|
49
|
+
const updatedContent = `${before}\n${body}\n${after}`;
|
|
50
|
+
await FileSystemUtils.writeFile(filePath, updatedContent);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=toml-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class WindsurfSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "windsurf";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=windsurf.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: '.windsurf/workflows/zhuanspec-proposal.md',
|
|
4
|
+
apply: '.windsurf/workflows/zhuanspec-apply.md',
|
|
5
|
+
archive: '.windsurf/workflows/zhuanspec-archive.md'
|
|
6
|
+
};
|
|
7
|
+
export class WindsurfSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
|
+
toolId = 'windsurf';
|
|
9
|
+
isAvailable = true;
|
|
10
|
+
getRelativePath(id) {
|
|
11
|
+
return FILE_PATHS[id];
|
|
12
|
+
}
|
|
13
|
+
getFrontmatter(id) {
|
|
14
|
+
const descriptions = {
|
|
15
|
+
proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
|
|
16
|
+
apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
|
|
17
|
+
archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
|
|
18
|
+
};
|
|
19
|
+
const description = descriptions[id];
|
|
20
|
+
return `---\ndescription: ${description}\nauto_execution_mode: 3\n---`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=windsurf.js.map
|