@dedesfr/prompter 0.6.14 ā 0.7.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/CHANGELOG.md +15 -0
- package/dist/cli/index.js +144 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/archive.d.ts +11 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +280 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.d.ts.map +1 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/change.js.map +1 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +198 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/guide.d.ts.map +1 -1
- package/dist/commands/guide.js +4 -0
- package/dist/commands/guide.js.map +1 -1
- package/dist/commands/list.d.ts +2 -2
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +153 -47
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.d.ts.map +1 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/spec.js.map +1 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.d.ts.map +1 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/graph.js.map +1 -0
- package/dist/core/artifact-graph/index.d.ts +7 -0
- package/dist/core/artifact-graph/index.d.ts.map +1 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/index.js.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +130 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.js +173 -0
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -0
- package/dist/core/artifact-graph/resolver.d.ts +61 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -0
- package/dist/core/artifact-graph/resolver.js +187 -0
- package/dist/core/artifact-graph/resolver.js.map +1 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.d.ts.map +1 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/schema.js.map +1 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.d.ts.map +1 -0
- package/dist/core/artifact-graph/state.js +54 -0
- package/dist/core/artifact-graph/state.js.map +1 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/artifact-graph/types.js.map +1 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.d.ts.map +1 -0
- package/dist/core/completions/command-registry.js +380 -0
- package/dist/core/completions/command-registry.js.map +1 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.d.ts.map +1 -0
- package/dist/core/completions/completion-provider.js +102 -0
- package/dist/core/completions/completion-provider.js.map +1 -0
- package/dist/core/completions/generators/bash-generator.d.ts +32 -0
- package/dist/core/completions/generators/bash-generator.d.ts.map +1 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/bash-generator.js.map +1 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.d.ts.map +1 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/fish-generator.js.map +1 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
- package/dist/core/completions/generators/powershell-generator.d.ts.map +1 -0
- package/dist/core/completions/generators/powershell-generator.js +207 -0
- package/dist/core/completions/generators/powershell-generator.js.map +1 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
- package/dist/core/completions/generators/zsh-generator.d.ts.map +1 -0
- package/dist/core/completions/generators/zsh-generator.js +250 -0
- package/dist/core/completions/generators/zsh-generator.js.map +1 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.d.ts.map +1 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/bash-templates.js.map +1 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.d.ts.map +1 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/fish-templates.js.map +1 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.d.ts.map +1 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/powershell-templates.js.map +1 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.d.ts.map +1 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/completions/templates/zsh-templates.js.map +1 -0
- package/dist/core/completions/types.d.ts +78 -0
- package/dist/core/completions/types.d.ts.map +1 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/completions/types.js.map +1 -0
- package/dist/core/config-schema.d.ts +76 -0
- package/dist/core/config-schema.d.ts.map +1 -0
- package/dist/core/config-schema.js +200 -0
- package/dist/core/config-schema.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +18 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
- package/dist/core/configurators/slash/antigravity.js +6 -0
- package/dist/core/configurators/slash/antigravity.js.map +1 -1
- package/dist/core/configurators/slash/base.js +1 -1
- package/dist/core/configurators/slash/base.js.map +1 -1
- package/dist/core/configurators/slash/claude.d.ts.map +1 -1
- package/dist/core/configurators/slash/claude.js +6 -0
- package/dist/core/configurators/slash/claude.js.map +1 -1
- package/dist/core/configurators/slash/codex.d.ts.map +1 -1
- package/dist/core/configurators/slash/codex.js +6 -0
- package/dist/core/configurators/slash/codex.js.map +1 -1
- package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
- package/dist/core/configurators/slash/github-copilot.js +6 -0
- package/dist/core/configurators/slash/github-copilot.js.map +1 -1
- package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
- package/dist/core/configurators/slash/kilocode.js +6 -0
- package/dist/core/configurators/slash/kilocode.js.map +1 -1
- package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
- package/dist/core/configurators/slash/opencode.js +6 -0
- package/dist/core/configurators/slash/opencode.js.map +1 -1
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.d.ts.map +1 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/converters/json-converter.js.map +1 -0
- package/dist/core/global-config.d.ts +39 -0
- package/dist/core/global-config.d.ts.map +1 -0
- package/dist/core/global-config.js +115 -0
- package/dist/core/global-config.js.map +1 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.d.ts.map +1 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/change-parser.js.map +1 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/markdown-parser.js.map +1 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/requirement-blocks.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +3 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +66 -0
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.d.ts.map +1 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/base.schema.js.map +1 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.d.ts.map +1 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/change.schema.js.map +1 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.d.ts.map +1 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/schemas/spec.schema.js.map +1 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.d.ts.map +1 -0
- package/dist/core/specs-apply.js +384 -0
- package/dist/core/specs-apply.js.map +1 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.d.ts.map +1 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/styles/palette.js.map +1 -0
- package/dist/core/templates/slash-command-templates.d.ts +1 -1
- package/dist/core/templates/slash-command-templates.d.ts.map +1 -1
- package/dist/core/templates/slash-command-templates.js +4 -1
- package/dist/core/templates/slash-command-templates.js.map +1 -1
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.d.ts.map +1 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/constants.js.map +1 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.d.ts.map +1 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/types.js.map +1 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.d.ts.map +1 -0
- package/dist/core/validation/validator.js +409 -0
- package/dist/core/validation/validator.js.map +1 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.d.ts.map +1 -0
- package/dist/core/view.js +168 -0
- package/dist/core/view.js.map +1 -0
- package/dist/utils/change-metadata.d.ts +47 -0
- package/dist/utils/change-metadata.d.ts.map +1 -0
- package/dist/utils/change-metadata.js +130 -0
- package/dist/utils/change-metadata.js.map +1 -0
- package/dist/utils/change-utils.d.ts +51 -0
- package/dist/utils/change-utils.d.ts.map +1 -0
- package/dist/utils/change-utils.js +100 -0
- package/dist/utils/change-utils.js.map +1 -0
- package/dist/utils/file-system.d.ts +25 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +218 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/interactive.js.map +1 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.d.ts.map +1 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/item-discovery.js.map +1 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.d.ts.map +1 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/match.js.map +1 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.d.ts.map +1 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/shell-detection.js.map +1 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.d.ts.map +1 -0
- package/dist/utils/task-progress.js +36 -0
- package/dist/utils/task-progress.js.map +1 -0
- package/docs/tasks.md +1 -1
- package/package.json +6 -2
- package/prompt/apply.md +17 -0
- package/prompt/archive.md +21 -0
- package/prompt/proposal.md +22 -0
- package/src/cli/index.ts +151 -16
- package/src/commands/archive.ts +302 -0
- package/src/commands/change.ts +292 -0
- package/src/commands/config.ts +233 -0
- package/src/commands/guide.ts +5 -0
- package/src/commands/list.ts +176 -66
- package/src/commands/show.ts +138 -0
- package/src/commands/spec.ts +251 -0
- package/src/commands/validate.ts +326 -0
- package/src/core/artifact-graph/graph.ts +167 -0
- package/src/core/artifact-graph/index.ts +44 -0
- package/src/core/artifact-graph/instruction-loader.ts +302 -0
- package/src/core/artifact-graph/resolver.ts +226 -0
- package/src/core/artifact-graph/schema.ts +124 -0
- package/src/core/artifact-graph/state.ts +64 -0
- package/src/core/artifact-graph/types.ts +65 -0
- package/src/core/completions/command-registry.ts +382 -0
- package/src/core/completions/completion-provider.ts +128 -0
- package/src/core/completions/generators/bash-generator.ts +191 -0
- package/src/core/completions/generators/fish-generator.ts +188 -0
- package/src/core/completions/generators/powershell-generator.ts +223 -0
- package/src/core/completions/generators/zsh-generator.ts +281 -0
- package/src/core/completions/templates/bash-templates.ts +24 -0
- package/src/core/completions/templates/fish-templates.ts +40 -0
- package/src/core/completions/templates/powershell-templates.ts +25 -0
- package/src/core/completions/templates/zsh-templates.ts +36 -0
- package/src/core/completions/types.ts +90 -0
- package/src/core/config-schema.ts +230 -0
- package/src/core/config.ts +18 -0
- package/src/core/configurators/slash/antigravity.ts +6 -0
- package/src/core/configurators/slash/base.ts +1 -1
- package/src/core/configurators/slash/claude.ts +6 -0
- package/src/core/configurators/slash/codex.ts +6 -0
- package/src/core/configurators/slash/github-copilot.ts +6 -0
- package/src/core/configurators/slash/kilocode.ts +6 -0
- package/src/core/configurators/slash/opencode.ts +6 -0
- package/src/core/converters/json-converter.ts +62 -0
- package/src/core/global-config.ts +136 -0
- package/src/core/parsers/change-parser.ts +234 -0
- package/src/core/parsers/markdown-parser.ts +237 -0
- package/src/core/parsers/requirement-blocks.ts +234 -0
- package/src/core/prompt-templates.ts +69 -0
- package/src/core/schemas/base.schema.ts +20 -0
- package/src/core/schemas/change.schema.ts +42 -0
- package/src/core/schemas/index.ts +20 -0
- package/src/core/schemas/spec.schema.ts +17 -0
- package/src/core/specs-apply.ts +483 -0
- package/src/core/styles/palette.ts +8 -0
- package/src/core/templates/slash-command-templates.ts +7 -1
- package/src/core/validation/constants.ts +48 -0
- package/src/core/validation/types.ts +19 -0
- package/src/core/validation/validator.ts +449 -0
- package/src/core/view.ts +219 -0
- package/src/utils/change-metadata.ts +171 -0
- package/src/utils/change-utils.ts +131 -0
- package/src/utils/file-system.ts +252 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/interactive.ts +29 -0
- package/src/utils/item-discovery.ts +66 -0
- package/src/utils/match.ts +26 -0
- package/src/utils/shell-detection.ts +62 -0
- package/src/utils/task-progress.ts +43 -0
- package/dist/commands/ai-humanizer.d.ts +0 -11
- package/dist/commands/ai-humanizer.d.ts.map +0 -1
- package/dist/commands/ai-humanizer.js +0 -97
- package/dist/commands/ai-humanizer.js.map +0 -1
- package/dist/commands/api-contract-generator.d.ts +0 -11
- package/dist/commands/api-contract-generator.d.ts.map +0 -1
- package/dist/commands/api-contract-generator.js +0 -97
- package/dist/commands/api-contract-generator.js.map +0 -1
- package/dist/commands/design-system.d.ts +0 -11
- package/dist/commands/design-system.d.ts.map +0 -1
- package/dist/commands/design-system.js +0 -97
- package/dist/commands/design-system.js.map +0 -1
- package/dist/commands/document-explainer.d.ts +0 -11
- package/dist/commands/document-explainer.d.ts.map +0 -1
- package/dist/commands/document-explainer.js +0 -97
- package/dist/commands/document-explainer.js.map +0 -1
- package/dist/commands/epic-generator.d.ts +0 -11
- package/dist/commands/epic-generator.d.ts.map +0 -1
- package/dist/commands/epic-generator.js +0 -97
- package/dist/commands/epic-generator.js.map +0 -1
- package/dist/commands/erd-generator.d.ts +0 -11
- package/dist/commands/erd-generator.d.ts.map +0 -1
- package/dist/commands/erd-generator.js +0 -97
- package/dist/commands/erd-generator.js.map +0 -1
- package/dist/commands/fsd-generator.d.ts +0 -11
- package/dist/commands/fsd-generator.d.ts.map +0 -1
- package/dist/commands/fsd-generator.js +0 -97
- package/dist/commands/fsd-generator.js.map +0 -1
- package/dist/commands/prd-agent-generator.d.ts +0 -11
- package/dist/commands/prd-agent-generator.d.ts.map +0 -1
- package/dist/commands/prd-agent-generator.js +0 -95
- package/dist/commands/prd-agent-generator.js.map +0 -1
- package/dist/commands/prd-generator.d.ts +0 -11
- package/dist/commands/prd-generator.d.ts.map +0 -1
- package/dist/commands/prd-generator.js +0 -97
- package/dist/commands/prd-generator.js.map +0 -1
- package/dist/commands/product-brief.d.ts +0 -11
- package/dist/commands/product-brief.d.ts.map +0 -1
- package/dist/commands/product-brief.js +0 -97
- package/dist/commands/product-brief.js.map +0 -1
- package/dist/commands/skill-creator.d.ts +0 -11
- package/dist/commands/skill-creator.d.ts.map +0 -1
- package/dist/commands/skill-creator.js +0 -101
- package/dist/commands/skill-creator.js.map +0 -1
- package/dist/commands/story-generator.d.ts +0 -11
- package/dist/commands/story-generator.d.ts.map +0 -1
- package/dist/commands/story-generator.js +0 -97
- package/dist/commands/story-generator.js.map +0 -1
- package/dist/commands/tdd-generator.d.ts +0 -11
- package/dist/commands/tdd-generator.d.ts.map +0 -1
- package/dist/commands/tdd-generator.js +0 -97
- package/dist/commands/tdd-generator.js.map +0 -1
- package/dist/commands/tdd-lite-generator.d.ts +0 -11
- package/dist/commands/tdd-lite-generator.d.ts.map +0 -1
- package/dist/commands/tdd-lite-generator.js +0 -97
- package/dist/commands/tdd-lite-generator.js.map +0 -1
- package/dist/commands/wireframe-generator.d.ts +0 -11
- package/dist/commands/wireframe-generator.d.ts.map +0 -1
- package/dist/commands/wireframe-generator.js +0 -97
- package/dist/commands/wireframe-generator.js.map +0 -1
- package/src/commands/ai-humanizer.ts +0 -118
- package/src/commands/api-contract-generator.ts +0 -118
- package/src/commands/design-system.ts +0 -118
- package/src/commands/document-explainer.ts +0 -118
- package/src/commands/epic-generator.ts +0 -118
- package/src/commands/erd-generator.ts +0 -118
- package/src/commands/fsd-generator.ts +0 -118
- package/src/commands/prd-agent-generator.ts +0 -115
- package/src/commands/prd-generator.ts +0 -118
- package/src/commands/product-brief.ts +0 -118
- package/src/commands/skill-creator.ts +0 -123
- package/src/commands/story-generator.ts +0 -118
- package/src/commands/tdd-generator.ts +0 -118
- package/src/commands/tdd-lite-generator.ts +0 -118
- package/src/commands/wireframe-generator.ts +0 -118
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { PrompterConfig, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
-
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
-
export class WireframeGeneratorCommand {
|
|
7
|
-
async execute(options = {}) {
|
|
8
|
-
const projectPath = process.cwd();
|
|
9
|
-
// Check if initialized
|
|
10
|
-
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
11
|
-
console.log(chalk.red('\nā Prompter is not initialized in this project.\n'));
|
|
12
|
-
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
13
|
-
process.exitCode = 1;
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
console.log(chalk.blue('\nš Generating Wireframe Generator workflow files...\n'));
|
|
17
|
-
// Detect currently configured tools
|
|
18
|
-
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
19
|
-
if (configuredTools.length === 0) {
|
|
20
|
-
console.log(chalk.yellow('ā ļø No tools configured yet.\n'));
|
|
21
|
-
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
22
|
-
process.exitCode = 1;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
// Generate wireframe-generator workflow files for all configured tools
|
|
26
|
-
let successCount = 0;
|
|
27
|
-
let failCount = 0;
|
|
28
|
-
for (const toolId of configuredTools) {
|
|
29
|
-
const configurator = registry.get(toolId);
|
|
30
|
-
if (configurator) {
|
|
31
|
-
try {
|
|
32
|
-
// Generate only the wireframe-generator workflow file
|
|
33
|
-
const body = configurator['getBody']('wireframe-generator');
|
|
34
|
-
const relativePath = configurator['getRelativePath']('wireframe-generator');
|
|
35
|
-
const filePath = path.join(projectPath, relativePath);
|
|
36
|
-
// Ensure directory exists
|
|
37
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
38
|
-
// Check if file exists
|
|
39
|
-
const fileExists = await this.fileExists(filePath);
|
|
40
|
-
if (fileExists) {
|
|
41
|
-
console.log(chalk.yellow('ā ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
// Get frontmatter if needed
|
|
45
|
-
const frontmatter = configurator['getFrontmatter']('wireframe-generator');
|
|
46
|
-
const sections = [];
|
|
47
|
-
if (frontmatter) {
|
|
48
|
-
sections.push(frontmatter.trim());
|
|
49
|
-
}
|
|
50
|
-
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
51
|
-
const content = sections.join('\n') + '\n';
|
|
52
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
53
|
-
console.log(chalk.green('ā') + ` Created ${chalk.cyan(relativePath)}`);
|
|
54
|
-
successCount++;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
console.log(chalk.red('ā') + ` Failed to create files for ${toolId}: ${error}`);
|
|
58
|
-
failCount++;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Success message
|
|
63
|
-
console.log(chalk.green(`\nā
Wireframe Generator workflow files created successfully!\n`));
|
|
64
|
-
console.log(chalk.blue('Next steps:'));
|
|
65
|
-
console.log(chalk.gray(' 1. Use /wireframe-generator in your AI tool to create wireframes'));
|
|
66
|
-
console.log(chalk.gray(' 2. Wireframes will be saved to prompter/<slug>/wireframe.md\n'));
|
|
67
|
-
}
|
|
68
|
-
async fileExists(filePath) {
|
|
69
|
-
try {
|
|
70
|
-
await fs.access(filePath);
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async detectConfiguredTools(projectPath) {
|
|
78
|
-
const configuredTools = [];
|
|
79
|
-
const allConfigurators = registry.getAll();
|
|
80
|
-
for (const configurator of allConfigurators) {
|
|
81
|
-
const targets = configurator.getTargets();
|
|
82
|
-
let hasFiles = false;
|
|
83
|
-
for (const target of targets) {
|
|
84
|
-
const filePath = path.join(projectPath, target.path);
|
|
85
|
-
if (await this.fileExists(filePath)) {
|
|
86
|
-
hasFiles = true;
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (hasFiles) {
|
|
91
|
-
configuredTools.push(configurator.toolId);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return configuredTools;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=wireframe-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wireframe-generator.js","sourceRoot":"","sources":["../../src/commands/wireframe-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAgB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAOhE,MAAM,OAAO,yBAAyB;IAClC,KAAK,CAAC,OAAO,CAAC,UAAqC,EAAE;QACjD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAElC,uBAAuB;QACvB,IAAI,CAAC,MAAM,cAAc,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;YACvD,OAAO,CAAC,GAAG,CAA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C;YAC9C,CAAC;QACL,CAAC;QAED,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { PrompterConfig, PROMPTER_DIR, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
-
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
-
|
|
7
|
-
interface AiHumanizerOptions {
|
|
8
|
-
tools?: string[];
|
|
9
|
-
noInteractive?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class AiHumanizerCommand {
|
|
13
|
-
async execute(options: AiHumanizerOptions = {}): Promise<void> {
|
|
14
|
-
const projectPath = process.cwd();
|
|
15
|
-
|
|
16
|
-
// Check if initialized
|
|
17
|
-
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
18
|
-
console.log(chalk.red('\nā Prompter is not initialized in this project.\n'));
|
|
19
|
-
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
20
|
-
process.exitCode = 1;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
console.log(chalk.blue('\nāļø Generating AI humanizer workflow files...\n'));
|
|
25
|
-
|
|
26
|
-
// Detect currently configured tools
|
|
27
|
-
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
28
|
-
|
|
29
|
-
if (configuredTools.length === 0) {
|
|
30
|
-
console.log(chalk.yellow('ā ļø No tools configured yet.\n'));
|
|
31
|
-
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
32
|
-
process.exitCode = 1;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Generate ai-humanizer workflow files for all configured tools
|
|
37
|
-
let successCount = 0;
|
|
38
|
-
let failCount = 0;
|
|
39
|
-
|
|
40
|
-
for (const toolId of configuredTools) {
|
|
41
|
-
const configurator = registry.get(toolId);
|
|
42
|
-
if (configurator) {
|
|
43
|
-
try {
|
|
44
|
-
// Generate only the ai-humanizer workflow file
|
|
45
|
-
const body = configurator['getBody']('ai-humanizer');
|
|
46
|
-
const relativePath = configurator['getRelativePath']('ai-humanizer');
|
|
47
|
-
const filePath = path.join(projectPath, relativePath);
|
|
48
|
-
|
|
49
|
-
// Ensure directory exists
|
|
50
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
51
|
-
|
|
52
|
-
// Check if file exists
|
|
53
|
-
const fileExists = await this.fileExists(filePath);
|
|
54
|
-
|
|
55
|
-
if (fileExists) {
|
|
56
|
-
console.log(chalk.yellow('ā ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Get frontmatter if needed
|
|
61
|
-
const frontmatter = configurator['getFrontmatter']('ai-humanizer');
|
|
62
|
-
const sections: string[] = [];
|
|
63
|
-
if (frontmatter) {
|
|
64
|
-
sections.push(frontmatter.trim());
|
|
65
|
-
}
|
|
66
|
-
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
67
|
-
const content = sections.join('\n') + '\n';
|
|
68
|
-
|
|
69
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
70
|
-
console.log(chalk.green('ā') + ` Created ${chalk.cyan(relativePath)}`);
|
|
71
|
-
successCount++;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.log(chalk.red('ā') + ` Failed to create files for ${toolId}: ${error}`);
|
|
74
|
-
failCount++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Success message
|
|
80
|
-
console.log(chalk.green(`\nā
AI humanizer workflow files created successfully!\n`));
|
|
81
|
-
console.log(chalk.blue('Next steps:'));
|
|
82
|
-
console.log(chalk.gray(' 1. Use /ai-humanizer in your AI tool to humanize and proofread content'));
|
|
83
|
-
console.log(chalk.gray(' 2. Provide your draft text to get refined, publication-ready output\n'));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private async fileExists(filePath: string): Promise<boolean> {
|
|
87
|
-
try {
|
|
88
|
-
await fs.access(filePath);
|
|
89
|
-
return true;
|
|
90
|
-
} catch {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private async detectConfiguredTools(projectPath: string): Promise<string[]> {
|
|
96
|
-
const configuredTools: string[] = [];
|
|
97
|
-
const allConfigurators = registry.getAll();
|
|
98
|
-
|
|
99
|
-
for (const configurator of allConfigurators) {
|
|
100
|
-
const targets = configurator.getTargets();
|
|
101
|
-
let hasFiles = false;
|
|
102
|
-
|
|
103
|
-
for (const target of targets) {
|
|
104
|
-
const filePath = path.join(projectPath, target.path);
|
|
105
|
-
if (await this.fileExists(filePath)) {
|
|
106
|
-
hasFiles = true;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (hasFiles) {
|
|
112
|
-
configuredTools.push(configurator.toolId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return configuredTools;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { PrompterConfig, PROMPTER_DIR, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
-
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
-
|
|
7
|
-
interface ApiContractGeneratorOptions {
|
|
8
|
-
tools?: string[];
|
|
9
|
-
noInteractive?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class ApiContractGeneratorCommand {
|
|
13
|
-
async execute(options: ApiContractGeneratorOptions = {}): Promise<void> {
|
|
14
|
-
const projectPath = process.cwd();
|
|
15
|
-
|
|
16
|
-
// Check if initialized
|
|
17
|
-
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
18
|
-
console.log(chalk.red('\nā Prompter is not initialized in this project.\n'));
|
|
19
|
-
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
20
|
-
process.exitCode = 1;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
console.log(chalk.blue('\nš Generating API Contract Generator workflow files...\n'));
|
|
25
|
-
|
|
26
|
-
// Detect currently configured tools
|
|
27
|
-
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
28
|
-
|
|
29
|
-
if (configuredTools.length === 0) {
|
|
30
|
-
console.log(chalk.yellow('ā ļø No tools configured yet.\n'));
|
|
31
|
-
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
32
|
-
process.exitCode = 1;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Generate api-contract-generator workflow files for all configured tools
|
|
37
|
-
let successCount = 0;
|
|
38
|
-
let failCount = 0;
|
|
39
|
-
|
|
40
|
-
for (const toolId of configuredTools) {
|
|
41
|
-
const configurator = registry.get(toolId);
|
|
42
|
-
if (configurator) {
|
|
43
|
-
try {
|
|
44
|
-
// Generate only the api-contract-generator workflow file
|
|
45
|
-
const body = configurator['getBody']('api-contract-generator');
|
|
46
|
-
const relativePath = configurator['getRelativePath']('api-contract-generator');
|
|
47
|
-
const filePath = path.join(projectPath, relativePath);
|
|
48
|
-
|
|
49
|
-
// Ensure directory exists
|
|
50
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
51
|
-
|
|
52
|
-
// Check if file exists
|
|
53
|
-
const fileExists = await this.fileExists(filePath);
|
|
54
|
-
|
|
55
|
-
if (fileExists) {
|
|
56
|
-
console.log(chalk.yellow('ā ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Get frontmatter if needed
|
|
61
|
-
const frontmatter = configurator['getFrontmatter']('api-contract-generator');
|
|
62
|
-
const sections: string[] = [];
|
|
63
|
-
if (frontmatter) {
|
|
64
|
-
sections.push(frontmatter.trim());
|
|
65
|
-
}
|
|
66
|
-
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
67
|
-
const content = sections.join('\n') + '\n';
|
|
68
|
-
|
|
69
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
70
|
-
console.log(chalk.green('ā') + ` Created ${chalk.cyan(relativePath)}`);
|
|
71
|
-
successCount++;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.log(chalk.red('ā') + ` Failed to create files for ${toolId}: ${error}`);
|
|
74
|
-
failCount++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Success message
|
|
80
|
-
console.log(chalk.green(`\nā
API Contract Generator workflow files created successfully!\n`));
|
|
81
|
-
console.log(chalk.blue('Next steps:'));
|
|
82
|
-
console.log(chalk.gray(' 1. Use /api-contract-generator in your AI tool to create API contracts'));
|
|
83
|
-
console.log(chalk.gray(' 2. API contracts will be saved to prompter/<slug>/api-contract.md\n'));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private async fileExists(filePath: string): Promise<boolean> {
|
|
87
|
-
try {
|
|
88
|
-
await fs.access(filePath);
|
|
89
|
-
return true;
|
|
90
|
-
} catch {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private async detectConfiguredTools(projectPath: string): Promise<string[]> {
|
|
96
|
-
const configuredTools: string[] = [];
|
|
97
|
-
const allConfigurators = registry.getAll();
|
|
98
|
-
|
|
99
|
-
for (const configurator of allConfigurators) {
|
|
100
|
-
const targets = configurator.getTargets();
|
|
101
|
-
let hasFiles = false;
|
|
102
|
-
|
|
103
|
-
for (const target of targets) {
|
|
104
|
-
const filePath = path.join(projectPath, target.path);
|
|
105
|
-
if (await this.fileExists(filePath)) {
|
|
106
|
-
hasFiles = true;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (hasFiles) {
|
|
112
|
-
configuredTools.push(configurator.toolId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return configuredTools;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { PrompterConfig, PROMPTER_DIR, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
-
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
-
|
|
7
|
-
interface DesignSystemOptions {
|
|
8
|
-
tools?: string[];
|
|
9
|
-
noInteractive?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class DesignSystemCommand {
|
|
13
|
-
async execute(options: DesignSystemOptions = {}): Promise<void> {
|
|
14
|
-
const projectPath = process.cwd();
|
|
15
|
-
|
|
16
|
-
// Check if initialized
|
|
17
|
-
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
18
|
-
console.log(chalk.red('\nā Prompter is not initialized in this project.\n'));
|
|
19
|
-
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
20
|
-
process.exitCode = 1;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
console.log(chalk.blue('\nš Generating Design System workflow files...\n'));
|
|
25
|
-
|
|
26
|
-
// Detect currently configured tools
|
|
27
|
-
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
28
|
-
|
|
29
|
-
if (configuredTools.length === 0) {
|
|
30
|
-
console.log(chalk.yellow('ā ļø No tools configured yet.\n'));
|
|
31
|
-
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
32
|
-
process.exitCode = 1;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Generate design-system workflow files for all configured tools
|
|
37
|
-
let successCount = 0;
|
|
38
|
-
let failCount = 0;
|
|
39
|
-
|
|
40
|
-
for (const toolId of configuredTools) {
|
|
41
|
-
const configurator = registry.get(toolId);
|
|
42
|
-
if (configurator) {
|
|
43
|
-
try {
|
|
44
|
-
// Generate only the design-system workflow file
|
|
45
|
-
const body = configurator['getBody']('design-system');
|
|
46
|
-
const relativePath = configurator['getRelativePath']('design-system');
|
|
47
|
-
const filePath = path.join(projectPath, relativePath);
|
|
48
|
-
|
|
49
|
-
// Ensure directory exists
|
|
50
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
51
|
-
|
|
52
|
-
// Check if file exists
|
|
53
|
-
const fileExists = await this.fileExists(filePath);
|
|
54
|
-
|
|
55
|
-
if (fileExists) {
|
|
56
|
-
console.log(chalk.yellow('ā ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Get frontmatter if needed
|
|
61
|
-
const frontmatter = configurator['getFrontmatter']('design-system');
|
|
62
|
-
const sections: string[] = [];
|
|
63
|
-
if (frontmatter) {
|
|
64
|
-
sections.push(frontmatter.trim());
|
|
65
|
-
}
|
|
66
|
-
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
67
|
-
const content = sections.join('\n') + '\n';
|
|
68
|
-
|
|
69
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
70
|
-
console.log(chalk.green('ā') + ` Created ${chalk.cyan(relativePath)}`);
|
|
71
|
-
successCount++;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.log(chalk.red('ā') + ` Failed to create files for ${toolId}: ${error}`);
|
|
74
|
-
failCount++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Success message
|
|
80
|
-
console.log(chalk.green(`\nā
Design System workflow files created successfully!\n`));
|
|
81
|
-
console.log(chalk.blue('Next steps:'));
|
|
82
|
-
console.log(chalk.gray(' 1. Use /design-system in your AI tool to generate design documentation'));
|
|
83
|
-
console.log(chalk.gray(' 2. Documentation will be saved to prompter/<slug>/design-system.md\n'));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private async fileExists(filePath: string): Promise<boolean> {
|
|
87
|
-
try {
|
|
88
|
-
await fs.access(filePath);
|
|
89
|
-
return true;
|
|
90
|
-
} catch {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private async detectConfiguredTools(projectPath: string): Promise<string[]> {
|
|
96
|
-
const configuredTools: string[] = [];
|
|
97
|
-
const allConfigurators = registry.getAll();
|
|
98
|
-
|
|
99
|
-
for (const configurator of allConfigurators) {
|
|
100
|
-
const targets = configurator.getTargets();
|
|
101
|
-
let hasFiles = false;
|
|
102
|
-
|
|
103
|
-
for (const target of targets) {
|
|
104
|
-
const filePath = path.join(projectPath, target.path);
|
|
105
|
-
if (await this.fileExists(filePath)) {
|
|
106
|
-
hasFiles = true;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (hasFiles) {
|
|
112
|
-
configuredTools.push(configurator.toolId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return configuredTools;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { PrompterConfig, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
-
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
-
|
|
7
|
-
interface DocumentExplainerOptions {
|
|
8
|
-
tools?: string[];
|
|
9
|
-
noInteractive?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class DocumentExplainerCommand {
|
|
13
|
-
async execute(options: DocumentExplainerOptions = {}): Promise<void> {
|
|
14
|
-
const projectPath = process.cwd();
|
|
15
|
-
|
|
16
|
-
// Check if initialized
|
|
17
|
-
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
18
|
-
console.log(chalk.red('\nā Prompter is not initialized in this project.\n'));
|
|
19
|
-
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
20
|
-
process.exitCode = 1;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
console.log(chalk.blue('\nš Generating document explainer workflow files...\n'));
|
|
25
|
-
|
|
26
|
-
// Detect currently configured tools
|
|
27
|
-
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
28
|
-
|
|
29
|
-
if (configuredTools.length === 0) {
|
|
30
|
-
console.log(chalk.yellow('ā ļø No tools configured yet.\n'));
|
|
31
|
-
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
32
|
-
process.exitCode = 1;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Generate document-explainer workflow files for all configured tools
|
|
37
|
-
let successCount = 0;
|
|
38
|
-
let failCount = 0;
|
|
39
|
-
|
|
40
|
-
for (const toolId of configuredTools) {
|
|
41
|
-
const configurator = registry.get(toolId);
|
|
42
|
-
if (configurator) {
|
|
43
|
-
try {
|
|
44
|
-
// Generate only the document-explainer workflow file
|
|
45
|
-
const body = configurator['getBody']('document-explainer');
|
|
46
|
-
const relativePath = configurator['getRelativePath']('document-explainer');
|
|
47
|
-
const filePath = path.join(projectPath, relativePath);
|
|
48
|
-
|
|
49
|
-
// Ensure directory exists
|
|
50
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
51
|
-
|
|
52
|
-
// Check if file exists
|
|
53
|
-
const fileExists = await this.fileExists(filePath);
|
|
54
|
-
|
|
55
|
-
if (fileExists) {
|
|
56
|
-
console.log(chalk.yellow('ā ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Get frontmatter if needed
|
|
61
|
-
const frontmatter = configurator['getFrontmatter']('document-explainer');
|
|
62
|
-
const sections: string[] = [];
|
|
63
|
-
if (frontmatter) {
|
|
64
|
-
sections.push(frontmatter.trim());
|
|
65
|
-
}
|
|
66
|
-
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
67
|
-
const content = sections.join('\n') + '\n';
|
|
68
|
-
|
|
69
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
70
|
-
console.log(chalk.green('ā') + ` Created ${chalk.cyan(relativePath)}`);
|
|
71
|
-
successCount++;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.log(chalk.red('ā') + ` Failed to create files for ${toolId}: ${error}`);
|
|
74
|
-
failCount++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Success message
|
|
80
|
-
console.log(chalk.green(`\nā
Document explainer workflow files created successfully!\n`));
|
|
81
|
-
console.log(chalk.blue('Next steps:'));
|
|
82
|
-
console.log(chalk.gray(' 1. Use /document-explainer in your AI tool to analyze complex documents'));
|
|
83
|
-
console.log(chalk.gray(' 2. Provide your document content to get a comprehensive breakdown and insights\n'));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private async fileExists(filePath: string): Promise<boolean> {
|
|
87
|
-
try {
|
|
88
|
-
await fs.access(filePath);
|
|
89
|
-
return true;
|
|
90
|
-
} catch {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private async detectConfiguredTools(projectPath: string): Promise<string[]> {
|
|
96
|
-
const configuredTools: string[] = [];
|
|
97
|
-
const allConfigurators = registry.getAll();
|
|
98
|
-
|
|
99
|
-
for (const configurator of allConfigurators) {
|
|
100
|
-
const targets = configurator.getTargets();
|
|
101
|
-
let hasFiles = false;
|
|
102
|
-
|
|
103
|
-
for (const target of targets) {
|
|
104
|
-
const filePath = path.join(projectPath, target.path);
|
|
105
|
-
if (await this.fileExists(filePath)) {
|
|
106
|
-
hasFiles = true;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (hasFiles) {
|
|
112
|
-
configuredTools.push(configurator.toolId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return configuredTools;
|
|
117
|
-
}
|
|
118
|
-
}
|