specweave 0.11.0 → 0.12.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/.claude-plugin/marketplace.json +1 -1
- package/CLAUDE.md +131 -144
- package/README.md +48 -21
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +21 -70
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/hooks/lib/git-diff-analyzer.d.ts +89 -0
- package/dist/hooks/lib/git-diff-analyzer.d.ts.map +1 -0
- package/dist/hooks/lib/git-diff-analyzer.js +226 -0
- package/dist/hooks/lib/git-diff-analyzer.js.map +1 -0
- package/dist/hooks/lib/prepare-reflection-context.d.ts +42 -0
- package/dist/hooks/lib/prepare-reflection-context.d.ts.map +1 -0
- package/dist/hooks/lib/prepare-reflection-context.js +123 -0
- package/dist/hooks/lib/prepare-reflection-context.js.map +1 -0
- package/dist/hooks/lib/reflection-config-loader.d.ts +45 -0
- package/dist/hooks/lib/reflection-config-loader.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-config-loader.js +132 -0
- package/dist/hooks/lib/reflection-config-loader.js.map +1 -0
- package/dist/hooks/lib/reflection-parser.d.ts +33 -0
- package/dist/hooks/lib/reflection-parser.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-parser.js +419 -0
- package/dist/hooks/lib/reflection-parser.js.map +1 -0
- package/dist/hooks/lib/reflection-prompt-builder.d.ts +56 -0
- package/dist/hooks/lib/reflection-prompt-builder.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-prompt-builder.js +239 -0
- package/dist/hooks/lib/reflection-prompt-builder.js.map +1 -0
- package/dist/hooks/lib/reflection-storage.d.ts +64 -0
- package/dist/hooks/lib/reflection-storage.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-storage.js +305 -0
- package/dist/hooks/lib/reflection-storage.js.map +1 -0
- package/dist/hooks/lib/run-self-reflection.d.ts +43 -0
- package/dist/hooks/lib/run-self-reflection.d.ts.map +1 -0
- package/dist/hooks/lib/run-self-reflection.js +203 -0
- package/dist/hooks/lib/run-self-reflection.js.map +1 -0
- package/dist/hooks/lib/types/reflection-types.d.ts +164 -0
- package/dist/hooks/lib/types/reflection-types.d.ts.map +1 -0
- package/dist/hooks/lib/types/reflection-types.js +73 -0
- package/dist/hooks/lib/types/reflection-types.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +89 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +226 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +60 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +201 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +42 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +123 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +45 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +132 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +33 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js +419 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +56 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +239 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +64 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js +305 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +43 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +203 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +27 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +116 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +59 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.js +350 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +13 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +175 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +164 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +73 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +29 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +203 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts +94 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js +219 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts +124 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.js +382 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client.d.ts +112 -0
- package/dist/plugins/specweave-ado/lib/ado-client.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client.js +257 -0
- package/dist/plugins/specweave-ado/lib/ado-client.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts +40 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js +370 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/project-selector.d.ts +42 -0
- package/dist/plugins/specweave-ado/lib/project-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/project-selector.js +211 -0
- package/dist/plugins/specweave-ado/lib/project-selector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts +54 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.js +122 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +104 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js +408 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +10 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +24 -0
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts +29 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js +268 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/index.js.map +1 -1
- package/dist/plugins/specweave-github/lib/repo-selector.d.ts +49 -0
- package/dist/plugins/specweave-github/lib/repo-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/repo-selector.js +216 -0
- package/dist/plugins/specweave-github/lib/repo-selector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/subtask-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-parser.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/types.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts +50 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js +84 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts +33 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js +206 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/project-selector.d.ts +42 -0
- package/dist/plugins/specweave-jira/lib/project-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/project-selector.js +216 -0
- package/dist/plugins/specweave-jira/lib/project-selector.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts +67 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.js +252 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts +29 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.js +219 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -0
- package/dist/src/adapters/adapter-base.d.ts +71 -0
- package/dist/src/adapters/adapter-base.d.ts.map +1 -0
- package/dist/src/adapters/adapter-base.js +139 -0
- package/dist/src/adapters/adapter-base.js.map +1 -0
- package/dist/src/adapters/adapter-interface.d.ts +149 -0
- package/dist/src/adapters/adapter-interface.d.ts.map +1 -0
- package/dist/src/adapters/adapter-interface.js +8 -0
- package/dist/src/adapters/adapter-interface.js.map +1 -0
- package/dist/src/adapters/adapter-loader.d.ts +91 -0
- package/dist/src/adapters/adapter-loader.d.ts.map +1 -0
- package/dist/src/adapters/adapter-loader.js +238 -0
- package/dist/src/adapters/adapter-loader.js.map +1 -0
- package/dist/src/adapters/agents-md-generator.d.ts +48 -0
- package/dist/src/adapters/agents-md-generator.d.ts.map +1 -0
- package/dist/src/adapters/agents-md-generator.js +193 -0
- package/dist/src/adapters/agents-md-generator.js.map +1 -0
- package/dist/src/adapters/claude/adapter.d.ts +128 -0
- package/dist/src/adapters/claude/adapter.d.ts.map +1 -0
- package/dist/src/adapters/claude/adapter.js +415 -0
- package/dist/src/adapters/claude/adapter.js.map +1 -0
- package/dist/src/adapters/claude-md-generator.d.ts +78 -0
- package/dist/src/adapters/claude-md-generator.d.ts.map +1 -0
- package/dist/src/adapters/claude-md-generator.js +307 -0
- package/dist/src/adapters/claude-md-generator.js.map +1 -0
- package/dist/src/adapters/codex/adapter.d.ts +50 -0
- package/dist/src/adapters/codex/adapter.d.ts.map +1 -0
- package/dist/src/adapters/codex/adapter.js +316 -0
- package/dist/src/adapters/codex/adapter.js.map +1 -0
- package/dist/src/adapters/cursor/adapter.d.ts +98 -0
- package/dist/src/adapters/cursor/adapter.d.ts.map +1 -0
- package/dist/src/adapters/cursor/adapter.js +406 -0
- package/dist/src/adapters/cursor/adapter.js.map +1 -0
- package/dist/src/adapters/doc-generator.d.ts +69 -0
- package/dist/src/adapters/doc-generator.d.ts.map +1 -0
- package/dist/src/adapters/doc-generator.js +247 -0
- package/dist/src/adapters/doc-generator.js.map +1 -0
- package/dist/src/adapters/gemini/adapter.d.ts +50 -0
- package/dist/src/adapters/gemini/adapter.d.ts.map +1 -0
- package/dist/src/adapters/gemini/adapter.js +281 -0
- package/dist/src/adapters/gemini/adapter.js.map +1 -0
- package/dist/src/adapters/generic/adapter.d.ts +86 -0
- package/dist/src/adapters/generic/adapter.d.ts.map +1 -0
- package/dist/src/adapters/generic/adapter.js +338 -0
- package/dist/src/adapters/generic/adapter.js.map +1 -0
- package/dist/src/cli/commands/abandon.d.ts +13 -0
- package/dist/src/cli/commands/abandon.d.ts.map +1 -0
- package/dist/src/cli/commands/abandon.js +15 -0
- package/dist/src/cli/commands/abandon.js.map +1 -0
- package/dist/src/cli/commands/import-docs.d.ts +21 -0
- package/dist/src/cli/commands/import-docs.d.ts.map +1 -0
- package/dist/src/cli/commands/import-docs.js +146 -0
- package/dist/src/cli/commands/import-docs.js.map +1 -0
- package/dist/src/cli/commands/init-multiproject.d.ts +11 -0
- package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -0
- package/dist/src/cli/commands/init-multiproject.js +202 -0
- package/dist/src/cli/commands/init-multiproject.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +9 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -0
- package/dist/src/cli/commands/init.js +1205 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/install.d.ts +9 -0
- package/dist/src/cli/commands/install.d.ts.map +1 -0
- package/dist/src/cli/commands/install.js +127 -0
- package/dist/src/cli/commands/install.js.map +1 -0
- package/dist/src/cli/commands/list.d.ts +8 -0
- package/dist/src/cli/commands/list.d.ts.map +1 -0
- package/dist/src/cli/commands/list.js +119 -0
- package/dist/src/cli/commands/list.js.map +1 -0
- package/dist/src/cli/commands/migrate-to-multiproject.d.ts +37 -0
- package/dist/src/cli/commands/migrate-to-multiproject.d.ts.map +1 -0
- package/dist/src/cli/commands/migrate-to-multiproject.js +189 -0
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts +25 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.js +350 -0
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -0
- package/dist/src/cli/commands/pause.d.ts +13 -0
- package/dist/src/cli/commands/pause.d.ts.map +1 -0
- package/dist/src/cli/commands/pause.js +15 -0
- package/dist/src/cli/commands/pause.js.map +1 -0
- package/dist/src/cli/commands/qa.d.ts +54 -0
- package/dist/src/cli/commands/qa.d.ts.map +1 -0
- package/dist/src/cli/commands/qa.js +98 -0
- package/dist/src/cli/commands/qa.js.map +1 -0
- package/dist/src/cli/commands/resume.d.ts +12 -0
- package/dist/src/cli/commands/resume.d.ts.map +1 -0
- package/dist/src/cli/commands/resume.js +14 -0
- package/dist/src/cli/commands/resume.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +12 -0
- package/dist/src/cli/commands/status.d.ts.map +1 -0
- package/dist/src/cli/commands/status.js +23 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/switch-project.d.ts +13 -0
- package/dist/src/cli/commands/switch-project.d.ts.map +1 -0
- package/dist/src/cli/commands/switch-project.js +91 -0
- package/dist/src/cli/commands/switch-project.js.map +1 -0
- package/dist/src/cli/commands/validate-jira.d.ts +35 -0
- package/dist/src/cli/commands/validate-jira.d.ts.map +1 -0
- package/dist/src/cli/commands/validate-jira.js +112 -0
- package/dist/src/cli/commands/validate-jira.js.map +1 -0
- package/dist/src/cli/commands/validate-plugins.d.ts +41 -0
- package/dist/src/cli/commands/validate-plugins.d.ts.map +1 -0
- package/dist/src/cli/commands/validate-plugins.js +171 -0
- package/dist/src/cli/commands/validate-plugins.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +57 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js +243 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/github.d.ts +65 -0
- package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/github.js +426 -0
- package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts +22 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.js +314 -0
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts +61 -0
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira.js +404 -0
- package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/types.d.ts +107 -0
- package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/types.js +16 -0
- package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/utils.d.ts +112 -0
- package/dist/src/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/utils.js +247 -0
- package/dist/src/cli/helpers/issue-tracker/utils.js.map +1 -0
- package/dist/src/core/agent-model-manager.d.ts +52 -0
- package/dist/src/core/agent-model-manager.d.ts.map +1 -0
- package/dist/src/core/agent-model-manager.js +120 -0
- package/dist/src/core/agent-model-manager.js.map +1 -0
- package/dist/src/core/brownfield/analyzer.d.ts +86 -0
- package/dist/src/core/brownfield/analyzer.d.ts.map +1 -0
- package/dist/src/core/brownfield/analyzer.js +365 -0
- package/dist/src/core/brownfield/analyzer.js.map +1 -0
- package/dist/src/core/brownfield/importer.d.ts +76 -0
- package/dist/src/core/brownfield/importer.d.ts.map +1 -0
- package/dist/src/core/brownfield/importer.js +287 -0
- package/dist/src/core/brownfield/importer.js.map +1 -0
- package/dist/src/core/config-manager.d.ts +47 -0
- package/dist/src/core/config-manager.d.ts.map +1 -0
- package/dist/src/core/config-manager.js +136 -0
- package/dist/src/core/config-manager.js.map +1 -0
- package/dist/src/core/cost-tracker.d.ts +108 -0
- package/dist/src/core/cost-tracker.d.ts.map +1 -0
- package/dist/src/core/cost-tracker.js +281 -0
- package/dist/src/core/cost-tracker.js.map +1 -0
- package/dist/src/core/credentials-manager.d.ts +107 -0
- package/dist/src/core/credentials-manager.d.ts.map +1 -0
- package/dist/src/core/credentials-manager.js +457 -0
- package/dist/src/core/credentials-manager.js.map +1 -0
- package/dist/src/core/i18n/language-detector.d.ts +29 -0
- package/dist/src/core/i18n/language-detector.d.ts.map +1 -0
- package/dist/src/core/i18n/language-detector.js +143 -0
- package/dist/src/core/i18n/language-detector.js.map +1 -0
- package/dist/src/core/i18n/language-manager.d.ts +101 -0
- package/dist/src/core/i18n/language-manager.d.ts.map +1 -0
- package/dist/src/core/i18n/language-manager.js +232 -0
- package/dist/src/core/i18n/language-manager.js.map +1 -0
- package/dist/src/core/i18n/language-registry.d.ts +44 -0
- package/dist/src/core/i18n/language-registry.d.ts.map +1 -0
- package/dist/src/core/i18n/language-registry.js +234 -0
- package/dist/src/core/i18n/language-registry.js.map +1 -0
- package/dist/src/core/i18n/locale-manager.d.ts +62 -0
- package/dist/src/core/i18n/locale-manager.d.ts.map +1 -0
- package/dist/src/core/i18n/locale-manager.js +137 -0
- package/dist/src/core/i18n/locale-manager.js.map +1 -0
- package/dist/src/core/i18n/system-prompt-injector.d.ts +33 -0
- package/dist/src/core/i18n/system-prompt-injector.d.ts.map +1 -0
- package/dist/src/core/i18n/system-prompt-injector.js +131 -0
- package/dist/src/core/i18n/system-prompt-injector.js.map +1 -0
- package/dist/src/core/i18n/types.d.ts +151 -0
- package/dist/src/core/i18n/types.d.ts.map +1 -0
- package/dist/src/core/i18n/types.js +11 -0
- package/dist/src/core/i18n/types.js.map +1 -0
- package/dist/src/core/increment/limits.d.ts +68 -0
- package/dist/src/core/increment/limits.d.ts.map +1 -0
- package/dist/src/core/increment/limits.js +224 -0
- package/dist/src/core/increment/limits.js.map +1 -0
- package/dist/src/core/increment/metadata-manager.d.ts +114 -0
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -0
- package/dist/src/core/increment/metadata-manager.js +320 -0
- package/dist/src/core/increment/metadata-manager.js.map +1 -0
- package/dist/src/core/increment/status-commands.d.ts +43 -0
- package/dist/src/core/increment/status-commands.d.ts.map +1 -0
- package/dist/src/core/increment/status-commands.js +277 -0
- package/dist/src/core/increment/status-commands.js.map +1 -0
- package/dist/src/core/increment-status.d.ts +72 -0
- package/dist/src/core/increment-status.d.ts.map +1 -0
- package/dist/src/core/increment-status.js +227 -0
- package/dist/src/core/increment-status.js.map +1 -0
- package/dist/src/core/model-selector.d.ts +57 -0
- package/dist/src/core/model-selector.d.ts.map +1 -0
- package/dist/src/core/model-selector.js +115 -0
- package/dist/src/core/model-selector.js.map +1 -0
- package/dist/src/core/phase-detector.d.ts +62 -0
- package/dist/src/core/phase-detector.d.ts.map +1 -0
- package/dist/src/core/phase-detector.js +229 -0
- package/dist/src/core/phase-detector.js.map +1 -0
- package/dist/src/core/plugin-loader.d.ts +131 -0
- package/dist/src/core/plugin-loader.d.ts.map +1 -0
- package/dist/src/core/plugin-loader.js +421 -0
- package/dist/src/core/plugin-loader.js.map +1 -0
- package/dist/src/core/project-manager.d.ts +127 -0
- package/dist/src/core/project-manager.d.ts.map +1 -0
- package/dist/src/core/project-manager.js +524 -0
- package/dist/src/core/project-manager.js.map +1 -0
- package/dist/src/core/project-structure-detector.d.ts +92 -0
- package/dist/src/core/project-structure-detector.d.ts.map +1 -0
- package/dist/src/core/project-structure-detector.js +289 -0
- package/dist/src/core/project-structure-detector.js.map +1 -0
- package/dist/src/core/qa/qa-runner.d.ts +16 -0
- package/dist/src/core/qa/qa-runner.d.ts.map +1 -0
- package/dist/src/core/qa/qa-runner.js +404 -0
- package/dist/src/core/qa/qa-runner.js.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts +53 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.js +268 -0
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -0
- package/dist/src/core/qa/risk-calculator.d.ts +126 -0
- package/dist/src/core/qa/risk-calculator.d.ts.map +1 -0
- package/dist/src/core/qa/risk-calculator.js +247 -0
- package/dist/src/core/qa/risk-calculator.js.map +1 -0
- package/dist/src/core/qa/types.d.ts +315 -0
- package/dist/src/core/qa/types.d.ts.map +1 -0
- package/dist/src/core/qa/types.js +8 -0
- package/dist/src/core/qa/types.js.map +1 -0
- package/dist/src/core/rfc-generator-v2.d.ts +149 -0
- package/dist/src/core/rfc-generator-v2.d.ts.map +1 -0
- package/dist/src/core/rfc-generator-v2.js +399 -0
- package/dist/src/core/rfc-generator-v2.js.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts +110 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.js +356 -0
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -0
- package/dist/src/core/sync/folder-mapper.d.ts +71 -0
- package/dist/src/core/sync/folder-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/folder-mapper.js +168 -0
- package/dist/src/core/sync/folder-mapper.js.map +1 -0
- package/dist/src/core/sync/profile-manager.d.ts +72 -0
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -0
- package/dist/src/core/sync/profile-manager.js +338 -0
- package/dist/src/core/sync/profile-manager.js.map +1 -0
- package/dist/src/core/sync/profile-selector.d.ts +52 -0
- package/dist/src/core/sync/profile-selector.d.ts.map +1 -0
- package/dist/src/core/sync/profile-selector.js +179 -0
- package/dist/src/core/sync/profile-selector.js.map +1 -0
- package/dist/src/core/sync/profile-validator.d.ts +52 -0
- package/dist/src/core/sync/profile-validator.d.ts.map +1 -0
- package/dist/src/core/sync/profile-validator.js +225 -0
- package/dist/src/core/sync/profile-validator.js.map +1 -0
- package/dist/src/core/sync/project-context.d.ts +81 -0
- package/dist/src/core/sync/project-context.d.ts.map +1 -0
- package/dist/src/core/sync/project-context.js +354 -0
- package/dist/src/core/sync/project-context.js.map +1 -0
- package/dist/src/core/sync/rate-limiter.d.ts +116 -0
- package/dist/src/core/sync/rate-limiter.d.ts.map +1 -0
- package/dist/src/core/sync/rate-limiter.js +308 -0
- package/dist/src/core/sync/rate-limiter.js.map +1 -0
- package/dist/src/core/sync/time-range-selector.d.ts +48 -0
- package/dist/src/core/sync/time-range-selector.d.ts.map +1 -0
- package/dist/src/core/sync/time-range-selector.js +224 -0
- package/dist/src/core/sync/time-range-selector.js.map +1 -0
- package/dist/src/core/types/config.d.ts +90 -0
- package/dist/src/core/types/config.d.ts.map +1 -0
- package/dist/src/core/types/config.js +37 -0
- package/dist/src/core/types/config.js.map +1 -0
- package/dist/src/core/types/increment-metadata.d.ts +120 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -0
- package/dist/src/core/types/increment-metadata.js +138 -0
- package/dist/src/core/types/increment-metadata.js.map +1 -0
- package/dist/src/core/types/plugin.d.ts +283 -0
- package/dist/src/core/types/plugin.d.ts.map +1 -0
- package/dist/src/core/types/plugin.js +49 -0
- package/dist/src/core/types/plugin.js.map +1 -0
- package/dist/src/core/types/sync-profile.d.ts +403 -0
- package/dist/src/core/types/sync-profile.d.ts.map +1 -0
- package/dist/src/core/types/sync-profile.js +55 -0
- package/dist/src/core/types/sync-profile.js.map +1 -0
- package/dist/src/hooks/lib/types/reflection-types.d.ts +125 -0
- package/dist/src/hooks/lib/types/reflection-types.d.ts.map +1 -0
- package/dist/src/hooks/lib/types/reflection-types.js +54 -0
- package/dist/src/hooks/lib/types/reflection-types.js.map +1 -0
- package/dist/src/integrations/ado/ado-client.d.ts +127 -0
- package/dist/src/integrations/ado/ado-client.d.ts.map +1 -0
- package/dist/src/integrations/ado/ado-client.js +416 -0
- package/dist/src/integrations/ado/ado-client.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +139 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-client.js +386 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +75 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.js +474 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts +105 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.js +494 -0
- package/dist/src/integrations/jira/jira-mapper.js.map +1 -0
- package/dist/src/metrics/calculators/change-failure-rate.d.ts +22 -0
- package/dist/src/metrics/calculators/change-failure-rate.d.ts.map +1 -0
- package/dist/src/metrics/calculators/change-failure-rate.js +70 -0
- package/dist/src/metrics/calculators/change-failure-rate.js.map +1 -0
- package/dist/src/metrics/calculators/deployment-frequency.d.ts +20 -0
- package/dist/src/metrics/calculators/deployment-frequency.d.ts.map +1 -0
- package/dist/src/metrics/calculators/deployment-frequency.js +61 -0
- package/dist/src/metrics/calculators/deployment-frequency.js.map +1 -0
- package/dist/src/metrics/calculators/lead-time.d.ts +22 -0
- package/dist/src/metrics/calculators/lead-time.d.ts.map +1 -0
- package/dist/src/metrics/calculators/lead-time.js +82 -0
- package/dist/src/metrics/calculators/lead-time.js.map +1 -0
- package/dist/src/metrics/calculators/mttr.d.ts +21 -0
- package/dist/src/metrics/calculators/mttr.d.ts.map +1 -0
- package/dist/src/metrics/calculators/mttr.js +60 -0
- package/dist/src/metrics/calculators/mttr.js.map +1 -0
- package/dist/src/metrics/dora-calculator.d.ts +28 -0
- package/dist/src/metrics/dora-calculator.d.ts.map +1 -0
- package/dist/src/metrics/dora-calculator.js +117 -0
- package/dist/src/metrics/dora-calculator.js.map +1 -0
- package/dist/src/metrics/github-client.d.ts +51 -0
- package/dist/src/metrics/github-client.d.ts.map +1 -0
- package/dist/src/metrics/github-client.js +133 -0
- package/dist/src/metrics/github-client.js.map +1 -0
- package/dist/src/metrics/report-generator.d.ts +17 -0
- package/dist/src/metrics/report-generator.d.ts.map +1 -0
- package/dist/src/metrics/report-generator.js +403 -0
- package/dist/src/metrics/report-generator.js.map +1 -0
- package/dist/src/metrics/types.d.ts +112 -0
- package/dist/src/metrics/types.d.ts.map +1 -0
- package/dist/src/metrics/types.js +10 -0
- package/dist/src/metrics/types.js.map +1 -0
- package/dist/src/metrics/utils/percentile.d.ts +25 -0
- package/dist/src/metrics/utils/percentile.d.ts.map +1 -0
- package/dist/src/metrics/utils/percentile.js +46 -0
- package/dist/src/metrics/utils/percentile.js.map +1 -0
- package/dist/src/metrics/utils/tier-classifier.d.ts +61 -0
- package/dist/src/metrics/utils/tier-classifier.d.ts.map +1 -0
- package/dist/src/metrics/utils/tier-classifier.js +100 -0
- package/dist/src/metrics/utils/tier-classifier.js.map +1 -0
- package/dist/src/testing/test-generator.d.ts +117 -0
- package/dist/src/testing/test-generator.d.ts.map +1 -0
- package/dist/src/testing/test-generator.js +370 -0
- package/dist/src/testing/test-generator.js.map +1 -0
- package/dist/src/types/cost-tracking.d.ts +43 -0
- package/dist/src/types/cost-tracking.d.ts.map +1 -0
- package/dist/src/types/cost-tracking.js +8 -0
- package/dist/src/types/cost-tracking.js.map +1 -0
- package/dist/src/types/model-selection.d.ts +53 -0
- package/dist/src/types/model-selection.d.ts.map +1 -0
- package/dist/src/types/model-selection.js +12 -0
- package/dist/src/types/model-selection.js.map +1 -0
- package/dist/src/utils/agents-md-compiler.d.ts +68 -0
- package/dist/src/utils/agents-md-compiler.d.ts.map +1 -0
- package/dist/src/utils/agents-md-compiler.js +420 -0
- package/dist/src/utils/agents-md-compiler.js.map +1 -0
- package/dist/src/utils/auth-helpers.d.ts +58 -0
- package/dist/src/utils/auth-helpers.d.ts.map +1 -0
- package/dist/src/utils/auth-helpers.js +108 -0
- package/dist/src/utils/auth-helpers.js.map +1 -0
- package/dist/src/utils/auto-install.d.ts +47 -0
- package/dist/src/utils/auto-install.d.ts.map +1 -0
- package/dist/src/utils/auto-install.js +211 -0
- package/dist/src/utils/auto-install.js.map +1 -0
- package/dist/src/utils/claude-cli-detector.d.ts +75 -0
- package/dist/src/utils/claude-cli-detector.d.ts.map +1 -0
- package/dist/src/utils/claude-cli-detector.js +285 -0
- package/dist/src/utils/claude-cli-detector.js.map +1 -0
- package/dist/src/utils/cost-reporter.d.ts +58 -0
- package/dist/src/utils/cost-reporter.d.ts.map +1 -0
- package/dist/src/utils/cost-reporter.js +224 -0
- package/dist/src/utils/cost-reporter.js.map +1 -0
- package/dist/src/utils/docs-preview/config-generator.d.ts +46 -0
- package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/config-generator.js +377 -0
- package/dist/src/utils/docs-preview/config-generator.js.map +1 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +38 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.js +177 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -0
- package/dist/src/utils/docs-preview/index.d.ts +7 -0
- package/dist/src/utils/docs-preview/index.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/index.js +7 -0
- package/dist/src/utils/docs-preview/index.js.map +1 -0
- package/dist/src/utils/docs-preview/package-installer.d.ts +42 -0
- package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/package-installer.js +182 -0
- package/dist/src/utils/docs-preview/package-installer.js.map +1 -0
- package/dist/src/utils/docs-preview/server-manager.d.ts +30 -0
- package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/server-manager.js +212 -0
- package/dist/src/utils/docs-preview/server-manager.js.map +1 -0
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts +32 -0
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/sidebar-builder.js +202 -0
- package/dist/src/utils/docs-preview/sidebar-builder.js.map +1 -0
- package/dist/src/utils/docs-preview/types.d.ts +57 -0
- package/dist/src/utils/docs-preview/types.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/types.js +2 -0
- package/dist/src/utils/docs-preview/types.js.map +1 -0
- package/dist/src/utils/env-file.d.ts +88 -0
- package/dist/src/utils/env-file.d.ts.map +1 -0
- package/dist/src/utils/env-file.js +180 -0
- package/dist/src/utils/env-file.js.map +1 -0
- package/dist/src/utils/env-multi-project-parser.d.ts +220 -0
- package/dist/src/utils/env-multi-project-parser.d.ts.map +1 -0
- package/dist/src/utils/env-multi-project-parser.js +403 -0
- package/dist/src/utils/env-multi-project-parser.js.map +1 -0
- package/dist/src/utils/esm-helpers.d.ts +50 -0
- package/dist/src/utils/esm-helpers.d.ts.map +1 -0
- package/dist/src/utils/esm-helpers.js +57 -0
- package/dist/src/utils/esm-helpers.js.map +1 -0
- package/dist/src/utils/execFileNoThrow.d.ts +99 -0
- package/dist/src/utils/execFileNoThrow.d.ts.map +1 -0
- package/dist/src/utils/execFileNoThrow.js +137 -0
- package/dist/src/utils/execFileNoThrow.js.map +1 -0
- package/dist/src/utils/external-resource-validator.d.ts +102 -0
- package/dist/src/utils/external-resource-validator.d.ts.map +1 -0
- package/dist/src/utils/external-resource-validator.js +400 -0
- package/dist/src/utils/external-resource-validator.js.map +1 -0
- package/dist/src/utils/generate-skills-index.d.ts +24 -0
- package/dist/src/utils/generate-skills-index.d.ts.map +1 -0
- package/dist/src/utils/generate-skills-index.js +410 -0
- package/dist/src/utils/generate-skills-index.js.map +1 -0
- package/dist/src/utils/model-selection.d.ts +75 -0
- package/dist/src/utils/model-selection.d.ts.map +1 -0
- package/dist/src/utils/model-selection.js +204 -0
- package/dist/src/utils/model-selection.js.map +1 -0
- package/dist/src/utils/plugin-validator.d.ts +161 -0
- package/dist/src/utils/plugin-validator.d.ts.map +1 -0
- package/dist/src/utils/plugin-validator.js +558 -0
- package/dist/src/utils/plugin-validator.js.map +1 -0
- package/dist/src/utils/pricing-constants.d.ts +70 -0
- package/dist/src/utils/pricing-constants.d.ts.map +1 -0
- package/dist/src/utils/pricing-constants.js +71 -0
- package/dist/src/utils/pricing-constants.js.map +1 -0
- package/dist/src/utils/project-detection.d.ts +141 -0
- package/dist/src/utils/project-detection.d.ts.map +1 -0
- package/dist/src/utils/project-detection.js +321 -0
- package/dist/src/utils/project-detection.js.map +1 -0
- package/dist/src/utils/string-utils.d.ts +40 -0
- package/dist/src/utils/string-utils.d.ts.map +1 -0
- package/dist/src/utils/string-utils.js +58 -0
- package/dist/src/utils/string-utils.js.map +1 -0
- package/dist/src/utils/translation.d.ts +187 -0
- package/dist/src/utils/translation.d.ts.map +1 -0
- package/dist/src/utils/translation.js +414 -0
- package/dist/src/utils/translation.js.map +1 -0
- package/dist/utils/plugin-validator.d.ts.map +1 -1
- package/dist/utils/plugin-validator.js +0 -7
- package/dist/utils/plugin-validator.js.map +1 -1
- package/package.json +3 -2
- package/plugins/specweave/agents/reflective-reviewer/AGENT.md +535 -0
- package/plugins/specweave/hooks/post-first-increment.sh +10 -28
- package/plugins/specweave/hooks/post-increment-planning.sh +261 -1
- package/plugins/specweave/hooks/post-task-completion.sh +26 -0
- package/plugins/specweave/lib/hooks/git-diff-analyzer.ts +269 -0
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +264 -0
- package/plugins/specweave/lib/hooks/prepare-reflection-context.ts +178 -0
- package/plugins/specweave/lib/hooks/reflection-config-loader.ts +156 -0
- package/plugins/specweave/lib/hooks/reflection-parser.ts +484 -0
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts +306 -0
- package/plugins/specweave/lib/hooks/reflection-storage.ts +369 -0
- package/plugins/specweave/lib/hooks/run-self-reflection.ts +258 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +147 -0
- package/plugins/specweave/lib/hooks/translate-file.ts +428 -0
- package/plugins/specweave/lib/hooks/translate-living-docs.ts +224 -0
- package/plugins/specweave/lib/hooks/types/reflection-types.ts +193 -0
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +256 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +2 -2
- package/plugins/specweave/skills/increment-planner/SKILL.md +8 -0
- package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -4
- package/plugins/specweave/skills/plugin-installer/SKILL.md +19 -21
- package/plugins/specweave/skills/plugin-validator/SKILL.md +0 -1
- package/plugins/specweave/skills/project-kickstarter/SKILL.md +3 -3
- package/plugins/specweave/skills/spec-generator/SKILL.md +3 -3
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-docs-preview/commands/build.md +489 -0
- package/plugins/specweave-docs-preview/commands/preview.md +330 -0
- package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +386 -0
- package/plugins/specweave/skills/translator/SKILL.md.bak +0 -172
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Reflection Engine
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates the self-reflection process:
|
|
5
|
+
* 1. Load configuration
|
|
6
|
+
* 2. Get modified files
|
|
7
|
+
* 3. Build prompt
|
|
8
|
+
* 4. Invoke reflective-reviewer agent
|
|
9
|
+
* 5. Parse response
|
|
10
|
+
* 6. Store reflection
|
|
11
|
+
*
|
|
12
|
+
* @module run-self-reflection
|
|
13
|
+
*/
|
|
14
|
+
import { ReflectionContext, ReflectionExecutionResult } from './types/reflection-types';
|
|
15
|
+
/**
|
|
16
|
+
* Run self-reflection analysis
|
|
17
|
+
* Main entry point for the reflection system
|
|
18
|
+
*
|
|
19
|
+
* @param context Reflection context with increment, task, and files
|
|
20
|
+
* @returns Reflection execution result (success or error)
|
|
21
|
+
*/
|
|
22
|
+
export declare function runSelfReflection(context: ReflectionContext): Promise<ReflectionExecutionResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Create reflection context from hook environment
|
|
25
|
+
* Helper function for hook integration
|
|
26
|
+
*
|
|
27
|
+
* @param incrementId Increment identifier
|
|
28
|
+
* @param taskId Task identifier
|
|
29
|
+
* @param projectRoot Project root directory (optional, auto-detected)
|
|
30
|
+
* @returns Reflection context ready for runSelfReflection
|
|
31
|
+
*/
|
|
32
|
+
export declare function createReflectionContext(incrementId: string, taskId: string, projectRoot?: string): ReflectionContext;
|
|
33
|
+
/**
|
|
34
|
+
* Run reflection with automatic context creation
|
|
35
|
+
* Convenience function for hook integration
|
|
36
|
+
*
|
|
37
|
+
* @param incrementId Increment identifier
|
|
38
|
+
* @param taskId Task identifier
|
|
39
|
+
* @param projectRoot Project root directory (optional)
|
|
40
|
+
* @returns Reflection execution result
|
|
41
|
+
*/
|
|
42
|
+
export declare function runReflectionAuto(incrementId: string, taskId: string, projectRoot?: string): Promise<ReflectionExecutionResult>;
|
|
43
|
+
//# sourceMappingURL=run-self-reflection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-self-reflection.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/hooks/run-self-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EAG1B,MAAM,0BAA0B,CAAC;AAuFlC;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,yBAAyB,CAAC,CA2FpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,iBAAiB,CAanB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC,CAGpC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Reflection Engine
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates the self-reflection process:
|
|
5
|
+
* 1. Load configuration
|
|
6
|
+
* 2. Get modified files
|
|
7
|
+
* 3. Build prompt
|
|
8
|
+
* 4. Invoke reflective-reviewer agent
|
|
9
|
+
* 5. Parse response
|
|
10
|
+
* 6. Store reflection
|
|
11
|
+
*
|
|
12
|
+
* @module run-self-reflection
|
|
13
|
+
*/
|
|
14
|
+
import { loadAndValidateReflectionConfig } from './reflection-config-loader';
|
|
15
|
+
import { getModifiedFiles, getModifiedFilesSummary } from './git-diff-analyzer';
|
|
16
|
+
import { buildReflectionPrompt, estimatePromptTokens } from './reflection-prompt-builder';
|
|
17
|
+
import { parseReflectionMarkdown, validateReflectionResult } from './reflection-parser';
|
|
18
|
+
import { saveReflection } from './reflection-storage';
|
|
19
|
+
import { ReflectionMode, ReflectionModel } from './types/reflection-types';
|
|
20
|
+
/**
|
|
21
|
+
* Check if reflection should run for the current context
|
|
22
|
+
*
|
|
23
|
+
* @param context Reflection context with config and modified files
|
|
24
|
+
* @returns True if reflection should run
|
|
25
|
+
*/
|
|
26
|
+
function shouldRunReflection(context) {
|
|
27
|
+
const { config, modifiedFiles } = context;
|
|
28
|
+
// Check if reflection is enabled
|
|
29
|
+
if (!config.enabled) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// Check mode
|
|
33
|
+
if (config.mode === ReflectionMode.DISABLED) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (config.mode === ReflectionMode.MANUAL) {
|
|
37
|
+
// Manual mode requires explicit invocation
|
|
38
|
+
// This function is only called in auto mode, so skip
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// Check if there are modified files to analyze
|
|
42
|
+
if (modifiedFiles.length === 0) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Estimate reflection cost based on model and prompt size
|
|
49
|
+
*
|
|
50
|
+
* @param model Reflection model (haiku, sonnet, opus)
|
|
51
|
+
* @param promptTokens Estimated prompt token count
|
|
52
|
+
* @param responseTokens Estimated response token count (default: 2000)
|
|
53
|
+
* @returns Estimated cost in USD
|
|
54
|
+
*/
|
|
55
|
+
function estimateReflectionCost(model, promptTokens, responseTokens = 2000) {
|
|
56
|
+
// Pricing per 1M tokens (as of Nov 2025)
|
|
57
|
+
const pricing = {
|
|
58
|
+
[ReflectionModel.HAIKU]: { input: 0.80, output: 4.00 },
|
|
59
|
+
[ReflectionModel.SONNET]: { input: 3.00, output: 15.00 },
|
|
60
|
+
[ReflectionModel.OPUS]: { input: 15.00, output: 75.00 }
|
|
61
|
+
};
|
|
62
|
+
const modelPricing = pricing[model];
|
|
63
|
+
const inputCost = (promptTokens / 1000000) * modelPricing.input;
|
|
64
|
+
const outputCost = (responseTokens / 1000000) * modelPricing.output;
|
|
65
|
+
return inputCost + outputCost;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Invoke reflective-reviewer agent to analyze code
|
|
69
|
+
*
|
|
70
|
+
* @param prompt Reflection prompt
|
|
71
|
+
* @param model Model to use (haiku, sonnet, opus)
|
|
72
|
+
* @returns Agent response (markdown reflection)
|
|
73
|
+
*/
|
|
74
|
+
async function invokeReflectiveReviewerAgent(prompt, model) {
|
|
75
|
+
// NOTE: This is a placeholder for agent invocation
|
|
76
|
+
// In the real implementation, this would use Claude Code's Task tool
|
|
77
|
+
// to invoke the specweave:reflective-reviewer:reflective-reviewer agent
|
|
78
|
+
//
|
|
79
|
+
// For now, we'll return a mock response to enable testing
|
|
80
|
+
// The actual implementation will be in the hook integration (T-008)
|
|
81
|
+
throw new Error('Agent invocation not implemented yet. ' +
|
|
82
|
+
'This function will be implemented in hook integration (T-008). ' +
|
|
83
|
+
'Call this from the post-task-completion hook using the Task tool.');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Run self-reflection analysis
|
|
87
|
+
* Main entry point for the reflection system
|
|
88
|
+
*
|
|
89
|
+
* @param context Reflection context with increment, task, and files
|
|
90
|
+
* @returns Reflection execution result (success or error)
|
|
91
|
+
*/
|
|
92
|
+
export async function runSelfReflection(context) {
|
|
93
|
+
const { incrementId, taskId, modifiedFiles, config } = context;
|
|
94
|
+
const startTime = Date.now();
|
|
95
|
+
try {
|
|
96
|
+
// Step 1: Check if reflection should run
|
|
97
|
+
if (!shouldRunReflection(context)) {
|
|
98
|
+
return {
|
|
99
|
+
success: true,
|
|
100
|
+
result: undefined,
|
|
101
|
+
error: undefined
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// Step 2: Build reflection prompt
|
|
105
|
+
const prompt = buildReflectionPrompt({
|
|
106
|
+
taskId,
|
|
107
|
+
taskName: `Task ${taskId}`, // Will be enhanced with actual task name in hook
|
|
108
|
+
modifiedFiles,
|
|
109
|
+
config,
|
|
110
|
+
incrementId,
|
|
111
|
+
includeFullDiff: false // Use simplified prompt for token efficiency
|
|
112
|
+
});
|
|
113
|
+
// Step 3: Estimate cost
|
|
114
|
+
const promptTokens = estimatePromptTokens(prompt);
|
|
115
|
+
const estimatedCost = estimateReflectionCost(config.model, promptTokens);
|
|
116
|
+
// Step 4: Invoke reflective-reviewer agent
|
|
117
|
+
const agentResponse = await invokeReflectiveReviewerAgent(prompt, config.model);
|
|
118
|
+
// Step 5: Parse response
|
|
119
|
+
const endTime = Date.now();
|
|
120
|
+
const reflectionTime = Math.round((endTime - startTime) / 1000); // seconds
|
|
121
|
+
const reflectionResult = parseReflectionMarkdown(agentResponse, `Task ${taskId}`, config.model, reflectionTime, estimatedCost);
|
|
122
|
+
// Step 6: Add file modification stats
|
|
123
|
+
const fileStats = getModifiedFilesSummary(modifiedFiles);
|
|
124
|
+
reflectionResult.filesModified = {
|
|
125
|
+
count: fileStats.count,
|
|
126
|
+
linesAdded: fileStats.linesAdded,
|
|
127
|
+
linesRemoved: fileStats.linesRemoved
|
|
128
|
+
};
|
|
129
|
+
// Step 7: Validate reflection result
|
|
130
|
+
const validation = validateReflectionResult(reflectionResult);
|
|
131
|
+
if (!validation.valid) {
|
|
132
|
+
return {
|
|
133
|
+
success: false,
|
|
134
|
+
error: {
|
|
135
|
+
message: 'Reflection validation failed',
|
|
136
|
+
code: 'VALIDATION_ERROR',
|
|
137
|
+
details: validation.errors
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Step 8: Store reflection (if enabled)
|
|
142
|
+
if (config.storeReflections) {
|
|
143
|
+
try {
|
|
144
|
+
saveReflection(reflectionResult, incrementId, taskId);
|
|
145
|
+
}
|
|
146
|
+
catch (storageError) {
|
|
147
|
+
// Storage failure shouldn't fail the entire reflection
|
|
148
|
+
console.warn(`Failed to store reflection: ${storageError.message}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Step 9: Return success
|
|
152
|
+
return {
|
|
153
|
+
success: true,
|
|
154
|
+
result: reflectionResult
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
// Graceful degradation: Return error but don't throw
|
|
159
|
+
return {
|
|
160
|
+
success: false,
|
|
161
|
+
error: {
|
|
162
|
+
message: error.message || 'Unknown error during reflection',
|
|
163
|
+
code: 'REFLECTION_ERROR',
|
|
164
|
+
details: error.stack
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create reflection context from hook environment
|
|
171
|
+
* Helper function for hook integration
|
|
172
|
+
*
|
|
173
|
+
* @param incrementId Increment identifier
|
|
174
|
+
* @param taskId Task identifier
|
|
175
|
+
* @param projectRoot Project root directory (optional, auto-detected)
|
|
176
|
+
* @returns Reflection context ready for runSelfReflection
|
|
177
|
+
*/
|
|
178
|
+
export function createReflectionContext(incrementId, taskId, projectRoot) {
|
|
179
|
+
// Load and validate configuration
|
|
180
|
+
const config = loadAndValidateReflectionConfig(projectRoot);
|
|
181
|
+
// Get modified files from git
|
|
182
|
+
const modifiedFiles = getModifiedFiles(projectRoot);
|
|
183
|
+
return {
|
|
184
|
+
incrementId,
|
|
185
|
+
taskId,
|
|
186
|
+
modifiedFiles,
|
|
187
|
+
config
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Run reflection with automatic context creation
|
|
192
|
+
* Convenience function for hook integration
|
|
193
|
+
*
|
|
194
|
+
* @param incrementId Increment identifier
|
|
195
|
+
* @param taskId Task identifier
|
|
196
|
+
* @param projectRoot Project root directory (optional)
|
|
197
|
+
* @returns Reflection execution result
|
|
198
|
+
*/
|
|
199
|
+
export async function runReflectionAuto(incrementId, taskId, projectRoot) {
|
|
200
|
+
const context = createReflectionContext(incrementId, taskId, projectRoot);
|
|
201
|
+
return runSelfReflection(context);
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=run-self-reflection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-self-reflection.js","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/hooks/run-self-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAGL,cAAc,EACd,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,OAA0B;IACrD,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAE1C,iCAAiC;IACjC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,aAAa;IACb,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,QAAQ,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,MAAM,EAAE,CAAC;QAC1C,2CAA2C;QAC3C,qDAAqD;QACrD,OAAO,KAAK,CAAC;IACf,C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X,MAAM;QACN,aAAa;QACb,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,WAAmB,EACnB,MAAc,EACd,WAAoB;IAEpB,MAAM,OAAO,GAAG,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1E,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SpecWeave Living Docs Auto-Sync
|
|
4
|
+
*
|
|
5
|
+
* Automatically syncs living documentation after task completion.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node dist/hooks/lib/sync-living-docs.js <incrementId>
|
|
9
|
+
*
|
|
10
|
+
* Example:
|
|
11
|
+
* node dist/hooks/lib/sync-living-docs.js 0006-llm-native-i18n
|
|
12
|
+
*
|
|
13
|
+
* What it does:
|
|
14
|
+
* 1. Checks if sync_living_docs enabled in config
|
|
15
|
+
* 2. Detects changed docs via git diff
|
|
16
|
+
* 3. Invokes /sync-docs update command (future implementation)
|
|
17
|
+
* 4. Logs sync actions
|
|
18
|
+
*
|
|
19
|
+
* @author SpecWeave Team
|
|
20
|
+
* @version 1.0.0
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Main function - sync living docs for given increment
|
|
24
|
+
*/
|
|
25
|
+
declare function syncLivingDocs(incrementId: string): Promise<void>;
|
|
26
|
+
export { syncLivingDocs };
|
|
27
|
+
//# sourceMappingURL=sync-living-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-living-docs.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/hooks/sync-living-docs.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH;;GAEG;AACH,iBAAe,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDhE;AAyDD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SpecWeave Living Docs Auto-Sync
|
|
4
|
+
*
|
|
5
|
+
* Automatically syncs living documentation after task completion.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node dist/hooks/lib/sync-living-docs.js <incrementId>
|
|
9
|
+
*
|
|
10
|
+
* Example:
|
|
11
|
+
* node dist/hooks/lib/sync-living-docs.js 0006-llm-native-i18n
|
|
12
|
+
*
|
|
13
|
+
* What it does:
|
|
14
|
+
* 1. Checks if sync_living_docs enabled in config
|
|
15
|
+
* 2. Detects changed docs via git diff
|
|
16
|
+
* 3. Invokes /sync-docs update command (future implementation)
|
|
17
|
+
* 4. Logs sync actions
|
|
18
|
+
*
|
|
19
|
+
* @author SpecWeave Team
|
|
20
|
+
* @version 1.0.0
|
|
21
|
+
*/
|
|
22
|
+
import fs from 'fs-extra';
|
|
23
|
+
import path from 'path';
|
|
24
|
+
import { execSync } from 'child_process';
|
|
25
|
+
/**
|
|
26
|
+
* Main function - sync living docs for given increment
|
|
27
|
+
*/
|
|
28
|
+
async function syncLivingDocs(incrementId) {
|
|
29
|
+
try {
|
|
30
|
+
console.log(`\n📚 Checking living docs sync for increment: ${incrementId}`);
|
|
31
|
+
// 1. Load config
|
|
32
|
+
const configPath = path.join(process.cwd(), '.specweave', 'config.json');
|
|
33
|
+
let config = {};
|
|
34
|
+
if (fs.existsSync(configPath)) {
|
|
35
|
+
config = JSON.parse(await fs.readFile(configPath, 'utf-8'));
|
|
36
|
+
}
|
|
37
|
+
// 2. Check if sync enabled
|
|
38
|
+
const syncEnabled = config.hooks?.post_task_completion?.sync_living_docs ?? false;
|
|
39
|
+
if (!syncEnabled) {
|
|
40
|
+
console.log('ℹ️ Living docs sync disabled in config');
|
|
41
|
+
console.log(' To enable: Set hooks.post_task_completion.sync_living_docs = true');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
console.log('✅ Living docs sync enabled');
|
|
45
|
+
// 3. Detect changed docs via git diff
|
|
46
|
+
const changedDocs = detectChangedDocs();
|
|
47
|
+
if (changedDocs.length === 0) {
|
|
48
|
+
console.log('ℹ️ No living docs changed (no git diff in .specweave/docs/)');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
console.log(`📄 Detected ${changedDocs.length} changed doc(s):`);
|
|
52
|
+
changedDocs.forEach((doc) => console.log(` - ${doc}`));
|
|
53
|
+
// 4. Invoke /sync-docs update command
|
|
54
|
+
// TODO: Implement actual sync command invocation
|
|
55
|
+
// For now, just log what would happen
|
|
56
|
+
console.log('\n🔄 Syncing living docs...');
|
|
57
|
+
console.log(' (Actual sync command invocation to be implemented in future version)');
|
|
58
|
+
console.log(' Would invoke: /sync-docs update');
|
|
59
|
+
// Future implementation:
|
|
60
|
+
// await invokeSyncDocsCommand(incrementId);
|
|
61
|
+
console.log('✅ Living docs sync check complete\n');
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error('❌ Error syncing living docs:', error);
|
|
65
|
+
// Don't exit with error - this is best-effort
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Detect changed documentation files via git diff
|
|
70
|
+
*/
|
|
71
|
+
function detectChangedDocs() {
|
|
72
|
+
try {
|
|
73
|
+
// Get changed files in .specweave/docs/
|
|
74
|
+
const output = execSync('git diff --name-only .specweave/docs/ 2>/dev/null || true', {
|
|
75
|
+
encoding: 'utf-8',
|
|
76
|
+
cwd: process.cwd(),
|
|
77
|
+
}).trim();
|
|
78
|
+
if (!output) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
// Filter to only .md files
|
|
82
|
+
const files = output
|
|
83
|
+
.split('\n')
|
|
84
|
+
.filter((f) => f.endsWith('.md'))
|
|
85
|
+
.filter((f) => f.length > 0);
|
|
86
|
+
return files;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.warn('⚠️ Could not detect git changes:', error);
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Invoke /sync-docs update command
|
|
95
|
+
* TODO: Implement actual command invocation
|
|
96
|
+
*/
|
|
97
|
+
async function invokeSyncDocsCommand(incrementId) {
|
|
98
|
+
// This will be implemented in future version when /sync-docs command is ready
|
|
99
|
+
console.log(` Invoking /sync-docs update for ${incrementId}`);
|
|
100
|
+
}
|
|
101
|
+
// CLI entry point
|
|
102
|
+
const isMainModule = import.meta.url === `file://${process.argv[1]}`;
|
|
103
|
+
if (isMainModule) {
|
|
104
|
+
const incrementId = process.argv[2];
|
|
105
|
+
if (!incrementId) {
|
|
106
|
+
console.error('❌ Usage: sync-living-docs <incrementId>');
|
|
107
|
+
console.error(' Example: sync-living-docs 0006-llm-native-i18n');
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
syncLivingDocs(incrementId).catch((error) => {
|
|
111
|
+
console.error('❌ Fatal error:', error);
|
|
112
|
+
// Don't exit with error code - best-effort sync
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export { syncLivingDocs };
|
|
116
|
+
//# sourceMappingURL=sync-living-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-living-docs.js","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/hooks/sync-living-docs.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAUzC;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,WAAmB;IAC/C,IAAI,CAAC;QACH,OAAO,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,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAErE,IAAI,YAAY,EAAE,CAAC;IACjB,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzD,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1C,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QACvC,gDAAgD;IAClD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Translation CLI Utility
|
|
3
|
+
*
|
|
4
|
+
* Translates a single file from detected source language to target language
|
|
5
|
+
* using the translation utilities and LLM invocation.
|
|
6
|
+
*
|
|
7
|
+
* This script is called from:
|
|
8
|
+
* - Post-increment-planning hook (auto-translate spec.md, plan.md, tasks.md)
|
|
9
|
+
* - Post-task-completion hook (auto-translate living docs)
|
|
10
|
+
* - Manual /specweave:translate command
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node translate-file.js <file-path> [--target-lang en] [--preview]
|
|
14
|
+
*
|
|
15
|
+
* @see src/utils/translation.ts
|
|
16
|
+
* @see .specweave/increments/0006-llm-native-i18n/reports/DESIGN-POST-GENERATION-TRANSLATION.md
|
|
17
|
+
*/
|
|
18
|
+
import { type SupportedLanguage } from '../../../../src/utils/translation.js';
|
|
19
|
+
/**
|
|
20
|
+
* CLI options
|
|
21
|
+
*/
|
|
22
|
+
interface CLIOptions {
|
|
23
|
+
filePath: string;
|
|
24
|
+
targetLang: SupportedLanguage;
|
|
25
|
+
preview: boolean;
|
|
26
|
+
verbose: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Translation result
|
|
30
|
+
*/
|
|
31
|
+
interface FileTranslationResult {
|
|
32
|
+
success: boolean;
|
|
33
|
+
filePath: string;
|
|
34
|
+
sourceLanguage: SupportedLanguage;
|
|
35
|
+
targetLanguage: SupportedLanguage;
|
|
36
|
+
warnings: string[];
|
|
37
|
+
cost: number;
|
|
38
|
+
tokensUsed: number;
|
|
39
|
+
preview?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Main translation function
|
|
43
|
+
*
|
|
44
|
+
* @param options - CLI options
|
|
45
|
+
* @returns Translation result
|
|
46
|
+
*/
|
|
47
|
+
export declare function translateFile(options: CLIOptions): Promise<FileTranslationResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Batch translate multiple files
|
|
50
|
+
*
|
|
51
|
+
* @param filePaths - Array of file paths to translate
|
|
52
|
+
* @param targetLang - Target language
|
|
53
|
+
* @param preview - Preview mode
|
|
54
|
+
* @param verbose - Verbose output
|
|
55
|
+
* @returns Array of translation results
|
|
56
|
+
*/
|
|
57
|
+
export declare function batchTranslateFiles(filePaths: string[], targetLang?: SupportedLanguage, preview?: boolean, verbose?: boolean): Promise<FileTranslationResult[]>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=translate-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate-file.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/hooks/translate-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,iBAAiB,CAAC;IAClC,cAAc,EAAE,iBAAiB,CAAC;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAqHvF;AAyGD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,GAAE,iBAAwB,EACpC,OAAO,GAAE,OAAe,EACxB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA6ClC"}
|