@dedesfr/prompter 0.6.15 → 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 +5 -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/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/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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../src/utils/interactive.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,OAAO,CAGlF;AAED,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,OAAO,CAM3E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves whether non-interactive mode is requested.
|
|
3
|
+
* Handles both explicit `noInteractive: true` and Commander.js style `interactive: false`.
|
|
4
|
+
* Use this helper instead of manually checking options.noInteractive to avoid bugs.
|
|
5
|
+
*/
|
|
6
|
+
export function resolveNoInteractive(value) {
|
|
7
|
+
if (typeof value === 'boolean')
|
|
8
|
+
return value;
|
|
9
|
+
return value?.noInteractive === true || value?.interactive === false;
|
|
10
|
+
}
|
|
11
|
+
export function isInteractive(value) {
|
|
12
|
+
if (resolveNoInteractive(value))
|
|
13
|
+
return false;
|
|
14
|
+
if (process.env.OPEN_SPEC_INTERACTIVE === '0')
|
|
15
|
+
return false;
|
|
16
|
+
// Respect the standard CI environment variable (set by GitHub Actions, GitLab CI, Travis, etc.)
|
|
17
|
+
if ('CI' in process.env)
|
|
18
|
+
return false;
|
|
19
|
+
return !!process.stdin.isTTY;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=interactive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../../src/utils/interactive.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAoC;IACvE,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,OAAO,KAAK,EAAE,aAAa,KAAK,IAAI,IAAI,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAoC;IAChE,IAAI,oBAAoB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IAC5D,gGAAgG;IAChG,IAAI,IAAI,IAAI,OAAO,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getActiveChangeIds(root?: string): Promise<string[]>;
|
|
2
|
+
export declare function getSpecIds(root?: string): Promise<string[]>;
|
|
3
|
+
export declare function getArchivedChangeIds(root?: string): Promise<string[]>;
|
|
4
|
+
//# sourceMappingURL=item-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-discovery.d.ts","sourceRoot":"","sources":["../../src/utils/item-discovery.ts"],"names":[],"mappings":"AAGA,wBAAsB,kBAAkB,CAAC,IAAI,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBxF;AAED,wBAAsB,UAAU,CAAC,IAAI,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBhF;AAED,wBAAsB,oBAAoB,CAAC,IAAI,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmB1F"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
export async function getActiveChangeIds(root = process.cwd()) {
|
|
4
|
+
const changesPath = path.join(root, 'prompter', 'changes');
|
|
5
|
+
try {
|
|
6
|
+
const entries = await fs.readdir(changesPath, { withFileTypes: true });
|
|
7
|
+
const result = [];
|
|
8
|
+
for (const entry of entries) {
|
|
9
|
+
if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name === 'archive')
|
|
10
|
+
continue;
|
|
11
|
+
const proposalPath = path.join(changesPath, entry.name, 'proposal.md');
|
|
12
|
+
try {
|
|
13
|
+
await fs.access(proposalPath);
|
|
14
|
+
result.push(entry.name);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// skip directories without proposal.md
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result.sort();
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function getSpecIds(root = process.cwd()) {
|
|
27
|
+
const specsPath = path.join(root, 'prompter', 'specs');
|
|
28
|
+
const result = [];
|
|
29
|
+
try {
|
|
30
|
+
const entries = await fs.readdir(specsPath, { withFileTypes: true });
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
if (!entry.isDirectory() || entry.name.startsWith('.'))
|
|
33
|
+
continue;
|
|
34
|
+
const specFile = path.join(specsPath, entry.name, 'spec.md');
|
|
35
|
+
try {
|
|
36
|
+
await fs.access(specFile);
|
|
37
|
+
result.push(entry.name);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// ignore
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// ignore
|
|
46
|
+
}
|
|
47
|
+
return result.sort();
|
|
48
|
+
}
|
|
49
|
+
export async function getArchivedChangeIds(root = process.cwd()) {
|
|
50
|
+
const archivePath = path.join(root, 'prompter', 'changes', 'archive');
|
|
51
|
+
try {
|
|
52
|
+
const entries = await fs.readdir(archivePath, { withFileTypes: true });
|
|
53
|
+
const result = [];
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
if (!entry.isDirectory() || entry.name.startsWith('.'))
|
|
56
|
+
continue;
|
|
57
|
+
const proposalPath = path.join(archivePath, entry.name, 'proposal.md');
|
|
58
|
+
try {
|
|
59
|
+
await fs.access(proposalPath);
|
|
60
|
+
result.push(entry.name);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// skip directories without proposal.md
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result.sort();
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=item-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-discovery.js","sourceRoot":"","sources":["../../src/utils/item-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IACnE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC3D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC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MAAU,GAAG,MAAM,EAAE,CAI7F;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAiBxD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function nearestMatches(input, candidates, max = 5) {
|
|
2
|
+
const scored = candidates.map(candidate => ({ candidate, distance: levenshtein(input, candidate) }));
|
|
3
|
+
scored.sort((a, b) => a.distance - b.distance);
|
|
4
|
+
return scored.slice(0, max).map(s => s.candidate);
|
|
5
|
+
}
|
|
6
|
+
export function levenshtein(a, b) {
|
|
7
|
+
const m = a.length;
|
|
8
|
+
const n = b.length;
|
|
9
|
+
const dp = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0));
|
|
10
|
+
for (let i = 0; i <= m; i++)
|
|
11
|
+
dp[i][0] = i;
|
|
12
|
+
for (let j = 0; j <= n; j++)
|
|
13
|
+
dp[0][j] = j;
|
|
14
|
+
for (let i = 1; i <= m; i++) {
|
|
15
|
+
for (let j = 1; j <= n; j++) {
|
|
16
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
17
|
+
dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return dp[m][n];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=match.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/utils/match.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,UAAoB,EAAE,MAAc,CAAC;IACjF,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IACrG,MAAM,CAAC,IAAI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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CACjB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAChB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAChB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CACxB,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported shell types for completion generation
|
|
3
|
+
*/
|
|
4
|
+
export type SupportedShell = 'zsh' | 'bash' | 'fish' | 'powershell';
|
|
5
|
+
/**
|
|
6
|
+
* Result of shell detection
|
|
7
|
+
*/
|
|
8
|
+
export interface ShellDetectionResult {
|
|
9
|
+
/** The detected shell if supported, otherwise undefined */
|
|
10
|
+
shell: SupportedShell | undefined;
|
|
11
|
+
/** The raw shell name detected (even if unsupported), or undefined if nothing detected */
|
|
12
|
+
detected: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Detects the current user's shell based on environment variables
|
|
16
|
+
*
|
|
17
|
+
* @returns Detection result with supported shell and raw detected name
|
|
18
|
+
*/
|
|
19
|
+
export declare function detectShell(): ShellDetectionResult;
|
|
20
|
+
//# sourceMappingURL=shell-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-detection.d.ts","sourceRoot":"","sources":["../../src/utils/shell-detection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;IAClC,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,oBAAoB,CAyClD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects the current user's shell based on environment variables
|
|
3
|
+
*
|
|
4
|
+
* @returns Detection result with supported shell and raw detected name
|
|
5
|
+
*/
|
|
6
|
+
export function detectShell() {
|
|
7
|
+
// Try SHELL environment variable first (Unix-like systems)
|
|
8
|
+
const shellPath = process.env.SHELL;
|
|
9
|
+
if (shellPath) {
|
|
10
|
+
const shellName = shellPath.toLowerCase();
|
|
11
|
+
if (shellName.includes('zsh')) {
|
|
12
|
+
return { shell: 'zsh', detected: 'zsh' };
|
|
13
|
+
}
|
|
14
|
+
if (shellName.includes('bash')) {
|
|
15
|
+
return { shell: 'bash', detected: 'bash' };
|
|
16
|
+
}
|
|
17
|
+
if (shellName.includes('fish')) {
|
|
18
|
+
return { shell: 'fish', detected: 'fish' };
|
|
19
|
+
}
|
|
20
|
+
// Shell detected but not supported
|
|
21
|
+
// Extract shell name from path (e.g., /bin/tcsh -> tcsh)
|
|
22
|
+
const match = shellPath.match(/\/([^/]+)$/);
|
|
23
|
+
const detectedName = match ? match[1] : shellPath;
|
|
24
|
+
return { shell: undefined, detected: detectedName };
|
|
25
|
+
}
|
|
26
|
+
// Check for PowerShell on Windows
|
|
27
|
+
// PSModulePath is a reliable PowerShell-specific environment variable
|
|
28
|
+
if (process.env.PSModulePath || process.platform === 'win32') {
|
|
29
|
+
const comspec = process.env.COMSPEC?.toLowerCase();
|
|
30
|
+
// If PSModulePath exists, we're definitely in PowerShell
|
|
31
|
+
if (process.env.PSModulePath) {
|
|
32
|
+
return { shell: 'powershell', detected: 'powershell' };
|
|
33
|
+
}
|
|
34
|
+
// On Windows without PSModulePath, we might be in cmd.exe
|
|
35
|
+
if (comspec?.includes('cmd.exe')) {
|
|
36
|
+
return { shell: undefined, detected: 'cmd.exe' };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { shell: undefined, detected: undefined };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=shell-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-detection.js","sourceRoot":"","sources":["../../src/utils/shell-detection.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,MAAM,UAAU,WAAW;IACzB,2DAA2D;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IAEpC,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QAE1C,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC3C,CAAC;QACD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC7C,CAAC;QAED,mCAAmC;QACnC,yDAAyD;QACzD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACtD,CAAC;IAED,kCAAkC;IAClC,sEAAsE;IACtE,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;QAEnD,yDAAyD;QACzD,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC7B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;QACzD,CAAC;QAED,0DAA0D;QAC1D,IAAI,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACjC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QACnD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TaskProgress {
|
|
2
|
+
total: number;
|
|
3
|
+
completed: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function countTasksFromContent(content: string): TaskProgress;
|
|
6
|
+
export declare function getTaskProgressForChange(changesDir: string, changeName: string): Promise<TaskProgress>;
|
|
7
|
+
export declare function formatTaskStatus(progress: TaskProgress): string;
|
|
8
|
+
//# sourceMappingURL=task-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-progress.d.ts","sourceRoot":"","sources":["../../src/utils/task-progress.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAanE;AAED,wBAAsB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAQ5G;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAI/D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
const TASK_PATTERN = /^[-*]\s+\[[\sx]\]/i;
|
|
4
|
+
const COMPLETED_TASK_PATTERN = /^[-*]\s+\[x\]/i;
|
|
5
|
+
export function countTasksFromContent(content) {
|
|
6
|
+
const lines = content.split('\n');
|
|
7
|
+
let total = 0;
|
|
8
|
+
let completed = 0;
|
|
9
|
+
for (const line of lines) {
|
|
10
|
+
if (line.match(TASK_PATTERN)) {
|
|
11
|
+
total++;
|
|
12
|
+
if (line.match(COMPLETED_TASK_PATTERN)) {
|
|
13
|
+
completed++;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return { total, completed };
|
|
18
|
+
}
|
|
19
|
+
export async function getTaskProgressForChange(changesDir, changeName) {
|
|
20
|
+
const tasksPath = path.join(changesDir, changeName, 'tasks.md');
|
|
21
|
+
try {
|
|
22
|
+
const content = await fs.readFile(tasksPath, 'utf-8');
|
|
23
|
+
return countTasksFromContent(content);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return { total: 0, completed: 0 };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function formatTaskStatus(progress) {
|
|
30
|
+
if (progress.total === 0)
|
|
31
|
+
return 'No tasks';
|
|
32
|
+
if (progress.completed === progress.total)
|
|
33
|
+
return '✓ Complete';
|
|
34
|
+
return `${progress.completed}/${progress.total} tasks`;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=task-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-progress.js","sourceRoot":"","sources":["../../src/utils/task-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAC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AG,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,QAAQ,CAAC;AACzD,CAAC"}
|
package/docs/tasks.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedesfr/prompter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Enhance prompts directly in your AI coding workflow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,11 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"chalk": "^5.3.0",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
|
-
"@inquirer/prompts": "^7.2.3"
|
|
43
|
+
"@inquirer/prompts": "^7.2.3",
|
|
44
|
+
"ora": "^8.2.0",
|
|
45
|
+
"zod": "^4.0.17",
|
|
46
|
+
"yaml": "^2.8.2",
|
|
47
|
+
"fast-glob": "^3.3.3"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@types/node": "^22.10.7",
|
package/prompt/apply.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- PROMPTER:START -->
|
|
2
|
+
**Guardrails**
|
|
3
|
+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
4
|
+
- Keep changes tightly scoped to the requested outcome.
|
|
5
|
+
- Refer to `prompter/AGENTS.md` (located inside the `prompter/` directory—run `ls prompter` if you don't see it) if you need additional Prompter conventions or clarifications.
|
|
6
|
+
|
|
7
|
+
**Steps**
|
|
8
|
+
Track these steps as TODOs and complete them one by one.
|
|
9
|
+
1. Read `changes/<id>/proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
|
|
10
|
+
2. Work through tasks sequentially, keeping edits minimal and focused on the requested change.
|
|
11
|
+
3. Confirm completion before updating statuses—make sure every item in `tasks.md` is finished.
|
|
12
|
+
4. Update the checklist after all work is done so each task is marked `- [x]` and reflects reality.
|
|
13
|
+
5. Reference `prompter list` or `prompter show <item>` when additional context is required.
|
|
14
|
+
|
|
15
|
+
**Reference**
|
|
16
|
+
- Use `prompter show <id> --json --deltas-only` if you need additional context from the proposal while implementing.
|
|
17
|
+
<!-- PROMPTER:END -->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- PROMPTER:START -->
|
|
2
|
+
**Guardrails**
|
|
3
|
+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
4
|
+
- Keep changes tightly scoped to the requested outcome.
|
|
5
|
+
- Refer to `prompter/AGENTS.md` (located inside the `prompter/` directory—run `ls prompter` if you don't see it) if you need additional Prompter conventions or clarifications.
|
|
6
|
+
|
|
7
|
+
**Steps**
|
|
8
|
+
1. Determine the change ID to archive:
|
|
9
|
+
- If this prompt already includes a specific change ID (for example inside a `<ChangeId>` block populated by slash-command arguments), use that value after trimming whitespace.
|
|
10
|
+
- If the conversation references a change loosely (for example by title or summary), run `prompter list` to surface likely IDs, share the relevant candidates, and confirm which one the user intends.
|
|
11
|
+
- Otherwise, review the conversation, run `prompter list`, and ask the user which change to archive; wait for a confirmed change ID before proceeding.
|
|
12
|
+
- If you still cannot identify a single change ID, stop and tell the user you cannot archive anything yet.
|
|
13
|
+
2. Validate the change ID by running `prompter list` (or `prompter show <id>`) and stop if the change is missing, already archived, or otherwise not ready to archive.
|
|
14
|
+
3. Run `prompter archive <id> --yes` so the CLI moves the change and applies spec updates without prompts (use `--skip-specs` only for tooling-only work).
|
|
15
|
+
4. Review the command output to confirm the target specs were updated and the change landed in `changes/archive/`.
|
|
16
|
+
5. Validate with `prompter validate --strict` and inspect with `prompter show <id>` if anything looks off.
|
|
17
|
+
|
|
18
|
+
**Reference**
|
|
19
|
+
- Use `prompter list` to confirm change IDs before archiving.
|
|
20
|
+
- Inspect refreshed specs with `prompter list --specs` and address any validation issues before handing off.
|
|
21
|
+
<!-- PROMPTER:END -->
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- PROMPTER:START -->
|
|
2
|
+
**Guardrails**
|
|
3
|
+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
4
|
+
- Keep changes tightly scoped to the requested outcome.
|
|
5
|
+
- Refer to `prompter/AGENTS.md` (located inside the `prompter/` directory—run `ls prompter` if you don't see it) if you need additional Prompter conventions or clarifications.
|
|
6
|
+
- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.
|
|
7
|
+
- Do not write any code during the proposal stage. Only create design documents (proposal.md, tasks.md, design.md, and spec deltas). Implementation happens in the apply stage after approval.
|
|
8
|
+
|
|
9
|
+
**Steps**
|
|
10
|
+
1. Review `prompter/project.md`, run `prompter list` and `prompter list --specs`, and inspect related code or docs (e.g., via `rg`/`ls`) to ground the proposal in current behaviour; note any gaps that require clarification.
|
|
11
|
+
2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, and `design.md` (when needed) under `prompter/changes/<id>/`.
|
|
12
|
+
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
|
|
13
|
+
4. Capture architectural reasoning in `design.md` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
|
|
14
|
+
5. Draft spec deltas in `changes/<id>/specs/<capability>/spec.md` (one folder per capability) using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement and cross-reference related capabilities when relevant.
|
|
15
|
+
6. Draft `tasks.md` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
|
|
16
|
+
7. Validate with `prompter validate <id> --strict` and resolve every issue before sharing the proposal.
|
|
17
|
+
|
|
18
|
+
**Reference**
|
|
19
|
+
- Use `prompter show <id> --json --deltas-only` or `prompter show <spec> --type spec` to inspect details when validation fails.
|
|
20
|
+
- Search existing requirements with `rg -n "Requirement:|Scenario:" prompter/specs` before writing new ones.
|
|
21
|
+
- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities.
|
|
22
|
+
<!-- PROMPTER:END -->
|
package/src/cli/index.ts
CHANGED
|
@@ -4,20 +4,25 @@ import { UpdateCommand } from '../commands/update.js';
|
|
|
4
4
|
import { ListCommand } from '../commands/list.js';
|
|
5
5
|
import { GuideCommand } from '../commands/guide.js';
|
|
6
6
|
import { UpgradeCommand } from '../commands/upgrade.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ViewCommand } from '../core/view.js';
|
|
8
|
+
import { ChangeCommand } from '../commands/change.js';
|
|
9
|
+
import { registerSpecCommand } from '../commands/spec.js';
|
|
10
|
+
import { registerConfigCommand } from '../commands/config.js';
|
|
11
|
+
import { ValidateCommand } from '../commands/validate.js';
|
|
12
|
+
import { ShowCommand } from '../commands/show.js';
|
|
8
13
|
|
|
9
14
|
const program = new Command();
|
|
10
15
|
|
|
11
16
|
program
|
|
12
17
|
.name('prompter')
|
|
13
18
|
.description('Enhance prompts directly in your AI coding workflow')
|
|
14
|
-
.version('0.
|
|
19
|
+
.version('0.7.0');
|
|
15
20
|
|
|
16
21
|
program
|
|
17
22
|
.command('init')
|
|
18
23
|
.description('Initialize Prompter in your project')
|
|
19
24
|
.option('--tools <tools...>', 'Specify AI tools to configure (antigravity, claude, codex, github-copilot, opencode, kilocode)')
|
|
20
|
-
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, api-contract-generator, design-system, document-explainer, epic-single, epic-generator, erd-generator, fsd-generator, prd-agent-generator, prd-generator, product-brief, qa-test-scenario, skill-creator, story-single, story-generator, tdd-generator, tdd-lite-generator, wireframe-generator)')
|
|
25
|
+
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, api-contract-generator, apply, archive, design-system, document-explainer, epic-single, epic-generator, erd-generator, fsd-generator, prd-agent-generator, prd-generator, product-brief, proposal, qa-test-scenario, skill-creator, story-single, story-generator, tdd-generator, tdd-lite-generator, wireframe-generator)')
|
|
21
26
|
.option('--no-interactive', 'Run without interactive prompts')
|
|
22
27
|
.action(async (options) => {
|
|
23
28
|
const initCommand = new InitCommand();
|
|
@@ -33,13 +38,36 @@ program
|
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
program
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
.command('list')
|
|
42
|
+
.description('List items (changes by default). Use --specs to list specs.')
|
|
43
|
+
.option('--specs', 'List specs instead of changes')
|
|
44
|
+
.option('--changes', 'List changes explicitly (default)')
|
|
45
|
+
.option('--sort <order>', 'Sort order: "recent" (default) or "name"', 'recent')
|
|
46
|
+
.option('--json', 'Output as JSON (for programmatic use)')
|
|
47
|
+
.action(async (options?: { specs?: boolean; changes?: boolean; sort?: string; json?: boolean }) => {
|
|
48
|
+
try {
|
|
49
|
+
const listCommand = new ListCommand();
|
|
50
|
+
const mode: 'changes' | 'specs' = options?.specs ? 'specs' : 'changes';
|
|
51
|
+
const sort = options?.sort === 'name' ? 'name' : 'recent';
|
|
52
|
+
await listCommand.execute('.', mode, { sort, json: options?.json });
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.log(); // Empty line for spacing
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
program
|
|
60
|
+
.command('view')
|
|
61
|
+
.description('Display an interactive dashboard of specs and changes')
|
|
62
|
+
.action(async () => {
|
|
63
|
+
try {
|
|
64
|
+
const viewCommand = new ViewCommand();
|
|
65
|
+
await viewCommand.execute('.');
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log(); // Empty line for spacing
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
43
71
|
|
|
44
72
|
program
|
|
45
73
|
.command('guide')
|
|
@@ -57,12 +85,119 @@ program
|
|
|
57
85
|
await upgradeCommand.execute();
|
|
58
86
|
});
|
|
59
87
|
|
|
88
|
+
// Change command with subcommands
|
|
89
|
+
const changeCmd = program
|
|
90
|
+
.command('change')
|
|
91
|
+
.description('Manage Prompter change proposals');
|
|
92
|
+
|
|
93
|
+
// Deprecation notice for noun-based commands
|
|
94
|
+
changeCmd.hook('preAction', () => {
|
|
95
|
+
console.error('Warning: The "prompter change ..." commands are deprecated. Prefer verb-first commands (e.g., "prompter list", "prompter validate --changes").');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
changeCmd
|
|
99
|
+
.command('show [change-name]')
|
|
100
|
+
.description('Show a change proposal in JSON or markdown format')
|
|
101
|
+
.option('--json', 'Output as JSON')
|
|
102
|
+
.option('--deltas-only', 'Show only deltas (JSON only)')
|
|
103
|
+
.option('--requirements-only', 'Alias for --deltas-only (deprecated)')
|
|
104
|
+
.option('--no-interactive', 'Disable interactive prompts')
|
|
105
|
+
.action(async (changeName?: string, options?: { json?: boolean; requirementsOnly?: boolean; deltasOnly?: boolean; noInteractive?: boolean }) => {
|
|
106
|
+
try {
|
|
107
|
+
const changeCommand = new ChangeCommand();
|
|
108
|
+
await changeCommand.show(changeName, options);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(`Error: ${(error as Error).message}`);
|
|
111
|
+
process.exitCode = 1;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
changeCmd
|
|
116
|
+
.command('list')
|
|
117
|
+
.description('List all active changes (DEPRECATED: use "prompter list" instead)')
|
|
118
|
+
.option('--json', 'Output as JSON')
|
|
119
|
+
.option('--long', 'Show id and title with counts')
|
|
120
|
+
.action(async (options?: { json?: boolean; long?: boolean }) => {
|
|
121
|
+
try {
|
|
122
|
+
console.error('Warning: "prompter change list" is deprecated. Use "prompter list".');
|
|
123
|
+
const changeCommand = new ChangeCommand();
|
|
124
|
+
await changeCommand.list(options);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error(`Error: ${(error as Error).message}`);
|
|
127
|
+
process.exitCode = 1;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
changeCmd
|
|
132
|
+
.command('validate [change-name]')
|
|
133
|
+
.description('Validate a change proposal')
|
|
134
|
+
.option('--strict', 'Enable strict validation mode')
|
|
135
|
+
.option('--json', 'Output validation report as JSON')
|
|
136
|
+
.option('--no-interactive', 'Disable interactive prompts')
|
|
137
|
+
.action(async (changeName?: string, options?: { strict?: boolean; json?: boolean; noInteractive?: boolean }) => {
|
|
138
|
+
try {
|
|
139
|
+
const changeCommand = new ChangeCommand();
|
|
140
|
+
await changeCommand.validate(changeName, options);
|
|
141
|
+
if (typeof process.exitCode === 'number' && process.exitCode !== 0) {
|
|
142
|
+
process.exit(process.exitCode);
|
|
143
|
+
}
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.error(`Error: ${(error as Error).message}`);
|
|
146
|
+
process.exitCode = 1;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
registerSpecCommand(program);
|
|
151
|
+
registerConfigCommand(program);
|
|
152
|
+
|
|
153
|
+
// Top-level validate command
|
|
60
154
|
program
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
155
|
+
.command('validate [item-name]')
|
|
156
|
+
.description('Validate changes and specs')
|
|
157
|
+
.option('--all', 'Validate all changes and specs')
|
|
158
|
+
.option('--changes', 'Validate all changes')
|
|
159
|
+
.option('--specs', 'Validate all specs')
|
|
160
|
+
.option('--type <type>', 'Specify item type when ambiguous: change|spec')
|
|
161
|
+
.option('--strict', 'Enable strict validation mode')
|
|
162
|
+
.option('--json', 'Output validation results as JSON')
|
|
163
|
+
.option('--concurrency <n>', 'Max concurrent validations (defaults to env PROMPTER_CONCURRENCY or 6)')
|
|
164
|
+
.option('--no-interactive', 'Disable interactive prompts')
|
|
165
|
+
.action(async (itemName?: string, options?: { all?: boolean; changes?: boolean; specs?: boolean; type?: string; strict?: boolean; json?: boolean; noInteractive?: boolean; concurrency?: string }) => {
|
|
166
|
+
try {
|
|
167
|
+
const validateCommand = new ValidateCommand();
|
|
168
|
+
await validateCommand.execute(itemName, options);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.log();
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Top-level show command
|
|
176
|
+
program
|
|
177
|
+
.command('show [item-name]')
|
|
178
|
+
.description('Show a change or spec')
|
|
179
|
+
.option('--json', 'Output as JSON')
|
|
180
|
+
.option('--type <type>', 'Specify item type when ambiguous: change|spec')
|
|
181
|
+
.option('--no-interactive', 'Disable interactive prompts')
|
|
182
|
+
// change-only flags
|
|
183
|
+
.option('--deltas-only', 'Show only deltas (JSON only, change)')
|
|
184
|
+
.option('--requirements-only', 'Alias for --deltas-only (deprecated, change)')
|
|
185
|
+
// spec-only flags
|
|
186
|
+
.option('--requirements', 'JSON only: Show only requirements (exclude scenarios)')
|
|
187
|
+
.option('--no-scenarios', 'JSON only: Exclude scenario content')
|
|
188
|
+
.option('-r, --requirement <id>', 'JSON only: Show specific requirement by ID (1-based)')
|
|
189
|
+
// allow unknown options to pass-through to underlying command implementation
|
|
190
|
+
.allowUnknownOption(true)
|
|
191
|
+
.action(async (itemName?: string, options?: { json?: boolean; type?: string; noInteractive?: boolean; [k: string]: any }) => {
|
|
192
|
+
try {
|
|
193
|
+
const showCommand = new ShowCommand();
|
|
194
|
+
await showCommand.execute(itemName, options ?? {});
|
|
195
|
+
} catch (error) {
|
|
196
|
+
console.log();
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
|
|
67
202
|
|
|
68
203
|
program.parse();
|