task-o-matic-core 0.1.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/README.md +646 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/lib/ai-service/ai-operations.d.ts +45 -0
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/ai-operations.js +60 -0
- package/dist/lib/ai-service/base-operations.d.ts +43 -0
- package/dist/lib/ai-service/base-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/base-operations.js +119 -0
- package/dist/lib/ai-service/documentation-operations.d.ts +18 -0
- package/dist/lib/ai-service/documentation-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/documentation-operations.js +308 -0
- package/dist/lib/ai-service/filesystem-tools.d.ts +69 -0
- package/dist/lib/ai-service/filesystem-tools.d.ts.map +1 -0
- package/dist/lib/ai-service/filesystem-tools.js +70 -0
- package/dist/lib/ai-service/json-parser.d.ts +34 -0
- package/dist/lib/ai-service/json-parser.d.ts.map +1 -0
- package/dist/lib/ai-service/json-parser.js +177 -0
- package/dist/lib/ai-service/mcp-client.d.ts +9 -0
- package/dist/lib/ai-service/mcp-client.d.ts.map +1 -0
- package/dist/lib/ai-service/mcp-client.js +48 -0
- package/dist/lib/ai-service/model-provider.d.ts +12 -0
- package/dist/lib/ai-service/model-provider.d.ts.map +1 -0
- package/dist/lib/ai-service/model-provider.js +146 -0
- package/dist/lib/ai-service/prd-operations.d.ts +25 -0
- package/dist/lib/ai-service/prd-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/prd-operations.js +592 -0
- package/dist/lib/ai-service/research-tools.d.ts +4 -0
- package/dist/lib/ai-service/research-tools.d.ts.map +1 -0
- package/dist/lib/ai-service/research-tools.js +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts.map +1 -0
- package/dist/lib/ai-service/retry-handler.js +63 -0
- package/dist/lib/ai-service/task-operations.d.ts +13 -0
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/task-operations.js +220 -0
- package/dist/lib/benchmark/registry.d.ts +11 -0
- package/dist/lib/benchmark/registry.d.ts.map +1 -0
- package/dist/lib/benchmark/registry.js +212 -0
- package/dist/lib/benchmark/runner.d.ts +6 -0
- package/dist/lib/benchmark/runner.d.ts.map +1 -0
- package/dist/lib/benchmark/runner.js +150 -0
- package/dist/lib/benchmark/storage.d.ts +13 -0
- package/dist/lib/benchmark/storage.d.ts.map +1 -0
- package/dist/lib/benchmark/storage.js +100 -0
- package/dist/lib/benchmark/types.d.ts +104 -0
- package/dist/lib/benchmark/types.d.ts.map +1 -0
- package/dist/lib/benchmark/types.js +2 -0
- package/dist/lib/better-t-stack-cli.d.ts +50 -0
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -0
- package/dist/lib/better-t-stack-cli.js +428 -0
- package/dist/lib/bootstrap/cli-bootstrap.d.ts +14 -0
- package/dist/lib/bootstrap/cli-bootstrap.d.ts.map +1 -0
- package/dist/lib/bootstrap/cli-bootstrap.js +322 -0
- package/dist/lib/bootstrap/index.d.ts +3 -0
- package/dist/lib/bootstrap/index.d.ts.map +1 -0
- package/dist/lib/bootstrap/index.js +18 -0
- package/dist/lib/bootstrap/medusa-bootstrap.d.ts +14 -0
- package/dist/lib/bootstrap/medusa-bootstrap.d.ts.map +1 -0
- package/dist/lib/bootstrap/medusa-bootstrap.js +215 -0
- package/dist/lib/config-validation.d.ts +215 -0
- package/dist/lib/config-validation.d.ts.map +1 -0
- package/dist/lib/config-validation.js +254 -0
- package/dist/lib/config.d.ts +55 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +351 -0
- package/dist/lib/context-builder.d.ts +66 -0
- package/dist/lib/context-builder.d.ts.map +1 -0
- package/dist/lib/context-builder.js +322 -0
- package/dist/lib/executors/claude-code-executor.d.ts +9 -0
- package/dist/lib/executors/claude-code-executor.d.ts.map +1 -0
- package/dist/lib/executors/claude-code-executor.js +69 -0
- package/dist/lib/executors/codex-executor.d.ts +9 -0
- package/dist/lib/executors/codex-executor.d.ts.map +1 -0
- package/dist/lib/executors/codex-executor.js +73 -0
- package/dist/lib/executors/executor-factory.d.ts +5 -0
- package/dist/lib/executors/executor-factory.d.ts.map +1 -0
- package/dist/lib/executors/executor-factory.js +27 -0
- package/dist/lib/executors/gemini-executor.d.ts +9 -0
- package/dist/lib/executors/gemini-executor.d.ts.map +1 -0
- package/dist/lib/executors/gemini-executor.js +67 -0
- package/dist/lib/executors/kilo-executor.d.ts +9 -0
- package/dist/lib/executors/kilo-executor.d.ts.map +1 -0
- package/dist/lib/executors/kilo-executor.js +69 -0
- package/dist/lib/executors/opencode-executor.d.ts +9 -0
- package/dist/lib/executors/opencode-executor.d.ts.map +1 -0
- package/dist/lib/executors/opencode-executor.js +67 -0
- package/dist/lib/git-utils.d.ts +88 -0
- package/dist/lib/git-utils.d.ts.map +1 -0
- package/dist/lib/git-utils.js +242 -0
- package/dist/lib/hooks.d.ts +73 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/hooks.js +62 -0
- package/dist/lib/index.d.ts +100 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +143 -0
- package/dist/lib/logger.d.ts +20 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +32 -0
- package/dist/lib/notifications.d.ts +7 -0
- package/dist/lib/notifications.d.ts.map +1 -0
- package/dist/lib/notifications.js +81 -0
- package/dist/lib/prompt-builder.d.ts +70 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -0
- package/dist/lib/prompt-builder.js +344 -0
- package/dist/lib/prompt-registry.d.ts +22 -0
- package/dist/lib/prompt-registry.d.ts.map +1 -0
- package/dist/lib/prompt-registry.js +409 -0
- package/dist/lib/provider-defaults.json +32 -0
- package/dist/lib/storage/file-system.d.ts +57 -0
- package/dist/lib/storage/file-system.d.ts.map +1 -0
- package/dist/lib/storage/file-system.js +638 -0
- package/dist/lib/storage/storage-callbacks.d.ts +17 -0
- package/dist/lib/storage/storage-callbacks.d.ts.map +1 -0
- package/dist/lib/storage/storage-callbacks.js +94 -0
- package/dist/lib/storage/types.d.ts +43 -0
- package/dist/lib/storage/types.d.ts.map +1 -0
- package/dist/lib/storage/types.js +2 -0
- package/dist/lib/task-execution-core.d.ts +7 -0
- package/dist/lib/task-execution-core.d.ts.map +1 -0
- package/dist/lib/task-execution-core.js +381 -0
- package/dist/lib/task-execution.d.ts +7 -0
- package/dist/lib/task-execution.d.ts.map +1 -0
- package/dist/lib/task-execution.js +40 -0
- package/dist/lib/task-loop-execution.d.ts +7 -0
- package/dist/lib/task-loop-execution.d.ts.map +1 -0
- package/dist/lib/task-loop-execution.js +156 -0
- package/dist/lib/task-planning.d.ts +29 -0
- package/dist/lib/task-planning.d.ts.map +1 -0
- package/dist/lib/task-planning.js +103 -0
- package/dist/lib/task-review.d.ts +27 -0
- package/dist/lib/task-review.d.ts.map +1 -0
- package/dist/lib/task-review.js +103 -0
- package/dist/lib/validation.d.ts +26 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +98 -0
- package/dist/prompts/documentation-detection.d.ts +2 -0
- package/dist/prompts/documentation-detection.d.ts.map +1 -0
- package/dist/prompts/documentation-detection.js +24 -0
- package/dist/prompts/documentation-recap.d.ts +3 -0
- package/dist/prompts/documentation-recap.d.ts.map +1 -0
- package/dist/prompts/documentation-recap.js +13 -0
- package/dist/prompts/index.d.ts +15 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +30 -0
- package/dist/prompts/prd-combination.d.ts +2 -0
- package/dist/prompts/prd-combination.d.ts.map +1 -0
- package/dist/prompts/prd-combination.js +35 -0
- package/dist/prompts/prd-generation.d.ts +2 -0
- package/dist/prompts/prd-generation.d.ts.map +1 -0
- package/dist/prompts/prd-generation.js +49 -0
- package/dist/prompts/prd-parsing.d.ts +3 -0
- package/dist/prompts/prd-parsing.d.ts.map +1 -0
- package/dist/prompts/prd-parsing.js +172 -0
- package/dist/prompts/prd-question-answer.d.ts +3 -0
- package/dist/prompts/prd-question-answer.d.ts.map +1 -0
- package/dist/prompts/prd-question-answer.js +27 -0
- package/dist/prompts/prd-question.d.ts +3 -0
- package/dist/prompts/prd-question.d.ts.map +1 -0
- package/dist/prompts/prd-question.js +40 -0
- package/dist/prompts/prd-rework.d.ts +3 -0
- package/dist/prompts/prd-rework.d.ts.map +1 -0
- package/dist/prompts/prd-rework.js +81 -0
- package/dist/prompts/prd-suggest-stack.d.ts +3 -0
- package/dist/prompts/prd-suggest-stack.d.ts.map +1 -0
- package/dist/prompts/prd-suggest-stack.js +99 -0
- package/dist/prompts/task-breakdown.d.ts +3 -0
- package/dist/prompts/task-breakdown.d.ts.map +1 -0
- package/dist/prompts/task-breakdown.js +151 -0
- package/dist/prompts/task-enhancement.d.ts +3 -0
- package/dist/prompts/task-enhancement.d.ts.map +1 -0
- package/dist/prompts/task-enhancement.js +140 -0
- package/dist/prompts/task-execution.d.ts +3 -0
- package/dist/prompts/task-execution.d.ts.map +1 -0
- package/dist/prompts/task-execution.js +24 -0
- package/dist/prompts/task-planning.d.ts +3 -0
- package/dist/prompts/task-planning.d.ts.map +1 -0
- package/dist/prompts/task-planning.js +66 -0
- package/dist/prompts/workflow-assistance.d.ts +32 -0
- package/dist/prompts/workflow-assistance.d.ts.map +1 -0
- package/dist/prompts/workflow-assistance.js +130 -0
- package/dist/prompts/workflow-prompts.d.ts +9 -0
- package/dist/prompts/workflow-prompts.d.ts.map +1 -0
- package/dist/prompts/workflow-prompts.js +93 -0
- package/dist/services/benchmark.d.ts +26 -0
- package/dist/services/benchmark.d.ts.map +1 -0
- package/dist/services/benchmark.js +343 -0
- package/dist/services/prd.d.ts +136 -0
- package/dist/services/prd.d.ts.map +1 -0
- package/dist/services/prd.js +550 -0
- package/dist/services/tasks.d.ts +388 -0
- package/dist/services/tasks.d.ts.map +1 -0
- package/dist/services/tasks.js +1150 -0
- package/dist/services/workflow-ai-assistant.d.ts +74 -0
- package/dist/services/workflow-ai-assistant.d.ts.map +1 -0
- package/dist/services/workflow-ai-assistant.js +175 -0
- package/dist/services/workflow-benchmark.d.ts +34 -0
- package/dist/services/workflow-benchmark.d.ts.map +1 -0
- package/dist/services/workflow-benchmark.js +318 -0
- package/dist/services/workflow.d.ts +107 -0
- package/dist/services/workflow.d.ts.map +1 -0
- package/dist/services/workflow.js +580 -0
- package/dist/test/hooks.test.d.ts +2 -0
- package/dist/test/hooks.test.d.ts.map +1 -0
- package/dist/test/hooks.test.js +67 -0
- package/dist/test/integration/callbacks.test.d.ts +2 -0
- package/dist/test/integration/callbacks.test.d.ts.map +1 -0
- package/dist/test/integration/callbacks.test.js +64 -0
- package/dist/test/lib/ai-service/task-operations.test.d.ts +2 -0
- package/dist/test/lib/ai-service/task-operations.test.d.ts.map +1 -0
- package/dist/test/lib/ai-service/task-operations.test.js +362 -0
- package/dist/test/lib/config.test.d.ts +2 -0
- package/dist/test/lib/config.test.d.ts.map +1 -0
- package/dist/test/lib/config.test.js +128 -0
- package/dist/test/lib/git-utils.test.d.ts +2 -0
- package/dist/test/lib/git-utils.test.d.ts.map +1 -0
- package/dist/test/lib/git-utils.test.js +168 -0
- package/dist/test/mocks/mock-ai-operations.d.ts +15 -0
- package/dist/test/mocks/mock-ai-operations.d.ts.map +1 -0
- package/dist/test/mocks/mock-ai-operations.js +107 -0
- package/dist/test/mocks/mock-context-builder.d.ts +10 -0
- package/dist/test/mocks/mock-context-builder.d.ts.map +1 -0
- package/dist/test/mocks/mock-context-builder.js +81 -0
- package/dist/test/mocks/mock-model-provider.d.ts +7 -0
- package/dist/test/mocks/mock-model-provider.d.ts.map +1 -0
- package/dist/test/mocks/mock-model-provider.js +21 -0
- package/dist/test/mocks/mock-service-factory.d.ts +11 -0
- package/dist/test/mocks/mock-service-factory.d.ts.map +1 -0
- package/dist/test/mocks/mock-service-factory.js +61 -0
- package/dist/test/mocks/mock-storage.d.ts +50 -0
- package/dist/test/mocks/mock-storage.d.ts.map +1 -0
- package/dist/test/mocks/mock-storage.js +145 -0
- package/dist/test/model-parsing.test.d.ts +2 -0
- package/dist/test/model-parsing.test.d.ts.map +1 -0
- package/dist/test/model-parsing.test.js +73 -0
- package/dist/test/services/task-service.test.d.ts +2 -0
- package/dist/test/services/task-service.test.d.ts.map +1 -0
- package/dist/test/services/task-service.test.js +459 -0
- package/dist/test/storage.test.d.ts +2 -0
- package/dist/test/storage.test.d.ts.map +1 -0
- package/dist/test/storage.test.js +207 -0
- package/dist/test/task-loop-git.test.d.ts +2 -0
- package/dist/test/task-loop-git.test.d.ts.map +1 -0
- package/dist/test/task-loop-git.test.js +95 -0
- package/dist/test/test-mock-setup.d.ts +26 -0
- package/dist/test/test-mock-setup.d.ts.map +1 -0
- package/dist/test/test-mock-setup.js +41 -0
- package/dist/test/test-setup.d.ts +9 -0
- package/dist/test/test-setup.d.ts.map +1 -0
- package/dist/test/test-setup.js +44 -0
- package/dist/test/test-utils.d.ts +22 -0
- package/dist/test/test-utils.d.ts.map +1 -0
- package/dist/test/test-utils.js +37 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts +2 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts.map +1 -0
- package/dist/test/utils/ai-operation-utility.test.js +290 -0
- package/dist/test/utils/error-handling.test.d.ts +2 -0
- package/dist/test/utils/error-handling.test.d.ts.map +1 -0
- package/dist/test/utils/error-handling.test.js +231 -0
- package/dist/test/utils/file-utils.test.d.ts +2 -0
- package/dist/test/utils/file-utils.test.d.ts.map +1 -0
- package/dist/test/utils/file-utils.test.js +76 -0
- package/dist/test/utils/id-generator.test.d.ts +2 -0
- package/dist/test/utils/id-generator.test.d.ts.map +1 -0
- package/dist/test/utils/id-generator.test.js +41 -0
- package/dist/test/utils/model-parser.test.d.ts +2 -0
- package/dist/test/utils/model-parser.test.d.ts.map +1 -0
- package/dist/test/utils/model-parser.test.js +65 -0
- package/dist/test/validation.test.d.ts +2 -0
- package/dist/test/validation.test.d.ts.map +1 -0
- package/dist/test/validation.test.js +22 -0
- package/dist/types/callbacks.d.ts +30 -0
- package/dist/types/callbacks.d.ts.map +1 -0
- package/dist/types/callbacks.js +2 -0
- package/dist/types/index.d.ts +435 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +30 -0
- package/dist/types/mcp.d.ts +3 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +3 -0
- package/dist/types/options.d.ts +112 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +2 -0
- package/dist/types/results.d.ts +200 -0
- package/dist/types/results.d.ts.map +1 -0
- package/dist/types/results.js +2 -0
- package/dist/types/workflow-options.d.ts +82 -0
- package/dist/types/workflow-options.d.ts.map +1 -0
- package/dist/types/workflow-options.js +2 -0
- package/dist/types/workflow-results.d.ts +82 -0
- package/dist/types/workflow-results.d.ts.map +1 -0
- package/dist/types/workflow-results.js +2 -0
- package/dist/utils/ai-config-builder.d.ts +14 -0
- package/dist/utils/ai-config-builder.d.ts.map +1 -0
- package/dist/utils/ai-config-builder.js +22 -0
- package/dist/utils/ai-operation-utility.d.ts +142 -0
- package/dist/utils/ai-operation-utility.d.ts.map +1 -0
- package/dist/utils/ai-operation-utility.js +303 -0
- package/dist/utils/ai-service-factory.d.ts +34 -0
- package/dist/utils/ai-service-factory.d.ts.map +1 -0
- package/dist/utils/ai-service-factory.js +99 -0
- package/dist/utils/error-utils.d.ts +70 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/error-utils.js +104 -0
- package/dist/utils/file-utils.d.ts +107 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +171 -0
- package/dist/utils/id-generator.d.ts +92 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +146 -0
- package/dist/utils/metadata-utils.d.ts +40 -0
- package/dist/utils/metadata-utils.d.ts.map +1 -0
- package/dist/utils/metadata-utils.js +43 -0
- package/dist/utils/model-executor-parser.d.ts +38 -0
- package/dist/utils/model-executor-parser.d.ts.map +1 -0
- package/dist/utils/model-executor-parser.js +69 -0
- package/dist/utils/model-parser.d.ts +6 -0
- package/dist/utils/model-parser.d.ts.map +1 -0
- package/dist/utils/model-parser.js +49 -0
- package/dist/utils/stack-formatter.d.ts +12 -0
- package/dist/utils/stack-formatter.d.ts.map +1 -0
- package/dist/utils/stack-formatter.js +36 -0
- package/dist/utils/storage-utils.d.ts +49 -0
- package/dist/utils/storage-utils.d.ts.map +1 -0
- package/dist/utils/storage-utils.js +80 -0
- package/dist/utils/streaming-utils.d.ts +38 -0
- package/dist/utils/streaming-utils.d.ts.map +1 -0
- package/dist/utils/streaming-utils.js +64 -0
- package/dist/utils/task-o-matic-error.d.ts +206 -0
- package/dist/utils/task-o-matic-error.d.ts.map +1 -0
- package/dist/utils/task-o-matic-error.js +304 -0
- package/package.json +40 -0
- package/src/index.ts +36 -0
- package/src/lib/ai-service/ai-operations.ts +310 -0
- package/src/lib/ai-service/base-operations.ts +139 -0
- package/src/lib/ai-service/documentation-operations.ts +438 -0
- package/src/lib/ai-service/filesystem-tools.ts +73 -0
- package/src/lib/ai-service/gemini-proxy.ts.bak +52 -0
- package/src/lib/ai-service/json-parser.ts +203 -0
- package/src/lib/ai-service/mcp-client.ts +54 -0
- package/src/lib/ai-service/model-provider.ts +192 -0
- package/src/lib/ai-service/prd-operations.ts +854 -0
- package/src/lib/ai-service/research-tools.ts +207 -0
- package/src/lib/ai-service/retry-handler.ts +89 -0
- package/src/lib/ai-service/task-operations.ts +342 -0
- package/src/lib/benchmark/registry.ts +307 -0
- package/src/lib/benchmark/runner.ts +190 -0
- package/src/lib/benchmark/storage.ts +140 -0
- package/src/lib/benchmark/types.ts +121 -0
- package/src/lib/better-t-stack-cli.ts +524 -0
- package/src/lib/bootstrap/cli-bootstrap.ts +397 -0
- package/src/lib/bootstrap/index.ts +2 -0
- package/src/lib/bootstrap/medusa-bootstrap.ts +261 -0
- package/src/lib/config-validation.ts +278 -0
- package/src/lib/config.ts +435 -0
- package/src/lib/context-builder.ts +383 -0
- package/src/lib/executors/claude-code-executor.ts +83 -0
- package/src/lib/executors/codex-executor.ts +85 -0
- package/src/lib/executors/executor-factory.ts +28 -0
- package/src/lib/executors/gemini-executor.ts +80 -0
- package/src/lib/executors/kilo-executor.ts +83 -0
- package/src/lib/executors/opencode-executor.ts +81 -0
- package/src/lib/git-utils.ts +334 -0
- package/src/lib/hooks.ts +121 -0
- package/src/lib/index.ts +166 -0
- package/src/lib/logger.ts +43 -0
- package/src/lib/notifications.ts +103 -0
- package/src/lib/prompt-builder.ts +471 -0
- package/src/lib/prompt-registry.ts +491 -0
- package/src/lib/provider-defaults.json +32 -0
- package/src/lib/storage/file-system.ts +864 -0
- package/src/lib/storage/storage-callbacks.ts +120 -0
- package/src/lib/storage/types.ts +58 -0
- package/src/lib/task-execution-core.ts +591 -0
- package/src/lib/task-execution.ts +59 -0
- package/src/lib/task-loop-execution.ts +214 -0
- package/src/lib/task-planning.ts +157 -0
- package/src/lib/task-review.ts +138 -0
- package/src/lib/validation.ts +140 -0
- package/src/prompts/documentation-detection.ts +21 -0
- package/src/prompts/documentation-recap.ts +11 -0
- package/src/prompts/index.ts +14 -0
- package/src/prompts/prd-combination.ts +32 -0
- package/src/prompts/prd-generation.ts +46 -0
- package/src/prompts/prd-parsing.ts +170 -0
- package/src/prompts/prd-question-answer.ts +25 -0
- package/src/prompts/prd-question.ts +38 -0
- package/src/prompts/prd-rework.ts +79 -0
- package/src/prompts/prd-suggest-stack.ts +97 -0
- package/src/prompts/task-breakdown.ts +149 -0
- package/src/prompts/task-enhancement.ts +138 -0
- package/src/prompts/task-execution.ts +22 -0
- package/src/prompts/task-planning.ts +64 -0
- package/src/prompts/workflow-assistance.ts +151 -0
- package/src/prompts/workflow-prompts.ts +97 -0
- package/src/services/benchmark.ts +433 -0
- package/src/services/prd.ts +845 -0
- package/src/services/tasks.ts +1515 -0
- package/src/services/workflow-ai-assistant.ts +298 -0
- package/src/services/workflow-benchmark.ts +339 -0
- package/src/services/workflow.ts +779 -0
- package/src/test/hooks.test.ts +77 -0
- package/src/test/integration/callbacks.test.ts +39 -0
- package/src/test/lib/ai-service/task-operations.test.ts +430 -0
- package/src/test/lib/config.test.ts +150 -0
- package/src/test/lib/git-utils.test.ts +198 -0
- package/src/test/mocks/mock-ai-operations.ts +205 -0
- package/src/test/mocks/mock-context-builder.ts +84 -0
- package/src/test/mocks/mock-model-provider.ts +21 -0
- package/src/test/mocks/mock-service-factory.ts +64 -0
- package/src/test/mocks/mock-storage.ts +204 -0
- package/src/test/model-parsing.test.ts +78 -0
- package/src/test/services/task-service.test.ts +551 -0
- package/src/test/storage.test.ts +206 -0
- package/src/test/task-loop-git.test.ts +142 -0
- package/src/test/test-mock-setup.ts +46 -0
- package/src/test/test-setup.ts +48 -0
- package/src/test/test-utils.ts +45 -0
- package/src/test/utils/ai-operation-utility.test.ts +306 -0
- package/src/test/utils/error-handling.test.ts +241 -0
- package/src/test/utils/file-utils.test.ts +80 -0
- package/src/test/utils/id-generator.test.ts +44 -0
- package/src/test/utils/model-parser.test.ts +67 -0
- package/src/test/validation.test.ts +19 -0
- package/src/types/callbacks.ts +14 -0
- package/src/types/index.ts +628 -0
- package/src/types/mcp.ts +5 -0
- package/src/types/options.ts +165 -0
- package/src/types/results.ts +216 -0
- package/src/types/workflow-options.ts +113 -0
- package/src/types/workflow-results.ts +87 -0
- package/src/utils/ai-config-builder.ts +33 -0
- package/src/utils/ai-operation-utility.ts +380 -0
- package/src/utils/ai-service-factory.ts +125 -0
- package/src/utils/error-utils.ts +124 -0
- package/src/utils/file-utils.ts +197 -0
- package/src/utils/id-generator.ts +168 -0
- package/src/utils/metadata-utils.ts +48 -0
- package/src/utils/model-executor-parser.ts +80 -0
- package/src/utils/model-parser.ts +58 -0
- package/src/utils/stack-formatter.ts +53 -0
- package/src/utils/storage-utils.ts +94 -0
- package/src/utils/streaming-utils.ts +91 -0
- package/src/utils/task-o-matic-error.ts +393 -0
- package/tsconfig.json +20 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { BTSConfig } from "./index";
|
|
2
|
+
|
|
3
|
+
// Base interface for any command that can use AI
|
|
4
|
+
export interface AIProviderOptions {
|
|
5
|
+
aiProvider?: string;
|
|
6
|
+
aiModel?: string;
|
|
7
|
+
aiKey?: string;
|
|
8
|
+
aiProviderUrl?: string;
|
|
9
|
+
aiReasoning?: string; // For OpenRouter
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// For commands that can stream AI output
|
|
13
|
+
export interface StreamingAIOptions extends AIProviderOptions {
|
|
14
|
+
stream?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// tasks list
|
|
18
|
+
export interface ListTasksOptions {
|
|
19
|
+
status?: string;
|
|
20
|
+
tag?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// tasks create
|
|
24
|
+
export interface CreateTaskOptions extends StreamingAIOptions {
|
|
25
|
+
title: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
effort?: string;
|
|
28
|
+
parentId?: string;
|
|
29
|
+
aiEnhance?: boolean;
|
|
30
|
+
taskId?: string; // Internal use for pre-defining an ID
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// tasks show
|
|
34
|
+
export interface ShowTaskOptions {
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// tasks document
|
|
39
|
+
export interface DocumentTaskOptions extends StreamingAIOptions {
|
|
40
|
+
taskId: string;
|
|
41
|
+
force?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// tasks enhance
|
|
45
|
+
export interface EnhanceTaskOptions extends StreamingAIOptions {
|
|
46
|
+
taskId: string;
|
|
47
|
+
all?: boolean; // Not passed to the function, handled in command
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// tasks split
|
|
51
|
+
export interface SplitTaskOptions extends StreamingAIOptions {
|
|
52
|
+
taskId: string;
|
|
53
|
+
all?: boolean; // Not passed to the function, handled in command
|
|
54
|
+
prompt?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// tasks plan
|
|
59
|
+
export interface PlanTaskOptions extends StreamingAIOptions {
|
|
60
|
+
id: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// tasks get-plan
|
|
64
|
+
export interface GetPlanOptions {
|
|
65
|
+
id: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// tasks update
|
|
69
|
+
export interface UpdateTaskOptions {
|
|
70
|
+
id: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
status?: "todo" | "in-progress" | "completed";
|
|
74
|
+
effort?: "small" | "medium" | "large";
|
|
75
|
+
tags?: string; // Comes as a comma-separated string from the CLI
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// tasks delete
|
|
79
|
+
export interface DeleteTaskOptions {
|
|
80
|
+
id: string;
|
|
81
|
+
force?: boolean;
|
|
82
|
+
cascade?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// tasks status
|
|
86
|
+
export interface SetTaskStatusOptions {
|
|
87
|
+
id: string;
|
|
88
|
+
status: "todo" | "in-progress" | "completed";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// tasks add-tags / remove-tags
|
|
92
|
+
export interface ManageTagsOptions {
|
|
93
|
+
id: string;
|
|
94
|
+
tags: string; // Comes as a comma-separated string from the CLI
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// tasks delete-plan
|
|
98
|
+
export interface DeletePlanOptions {
|
|
99
|
+
id: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// tasks subtasks
|
|
103
|
+
export interface ListSubtasksOptions {
|
|
104
|
+
id: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// tasks tree
|
|
108
|
+
export interface TaskTreeOptions {
|
|
109
|
+
id?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// tasks get-next
|
|
113
|
+
export interface GetNextTaskOptions {
|
|
114
|
+
status?: "todo" | "in-progress"; // Filter by status
|
|
115
|
+
tag?: string; // Filter by tag
|
|
116
|
+
effort?: "small" | "medium" | "large"; // Filter by effort
|
|
117
|
+
priority?: "newest" | "oldest" | "effort"; // Sort priority
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// prd parse
|
|
121
|
+
export interface ParsePrdOptions extends StreamingAIOptions {
|
|
122
|
+
file: string;
|
|
123
|
+
prompt?: string;
|
|
124
|
+
message?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// prd rework
|
|
128
|
+
export interface ReworkPrdOptions extends StreamingAIOptions {
|
|
129
|
+
file: string;
|
|
130
|
+
feedback: string;
|
|
131
|
+
output?: string;
|
|
132
|
+
prompt?: string;
|
|
133
|
+
message?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Workflow command types
|
|
137
|
+
export type WorkflowStep =
|
|
138
|
+
| "initialize"
|
|
139
|
+
| "define-prd"
|
|
140
|
+
| "stack-suggestion"
|
|
141
|
+
| "bootstrap"
|
|
142
|
+
| "question-refine-prd"
|
|
143
|
+
| "refine-prd"
|
|
144
|
+
| "generate-tasks"
|
|
145
|
+
| "split-tasks"
|
|
146
|
+
| "complete";
|
|
147
|
+
|
|
148
|
+
export interface AIAssistedChoice<T = any> {
|
|
149
|
+
userInput: string;
|
|
150
|
+
availableOptions: T[];
|
|
151
|
+
context: string;
|
|
152
|
+
recommendation?: T;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface InitConfigChoice {
|
|
156
|
+
projectName: string;
|
|
157
|
+
aiProvider: string;
|
|
158
|
+
aiModel: string;
|
|
159
|
+
aiProviderUrl?: string;
|
|
160
|
+
frontend?: string;
|
|
161
|
+
backend?: string;
|
|
162
|
+
database?: string;
|
|
163
|
+
auth?: boolean;
|
|
164
|
+
reasoning?: string;
|
|
165
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Task,
|
|
3
|
+
TaskAIMetadata,
|
|
4
|
+
DocumentationDetection,
|
|
5
|
+
BTSConfig,
|
|
6
|
+
} from "./index";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generic operation result using discriminated union pattern.
|
|
10
|
+
* Prevents invalid states like { success: true, error: "..." }
|
|
11
|
+
*
|
|
12
|
+
* Note: This type uses discriminated unions for operations that may return
|
|
13
|
+
* either success or failure. Most task operations throw exceptions on error
|
|
14
|
+
* instead of returning error results.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const result: OperationResult<Task> =
|
|
19
|
+
* condition
|
|
20
|
+
* ? { success: true, data: task }
|
|
21
|
+
* : { success: false, error: "Task not found" };
|
|
22
|
+
*
|
|
23
|
+
* if (result.success) {
|
|
24
|
+
* console.log(result.data.title); // ✓ TypeScript knows data exists
|
|
25
|
+
* } else {
|
|
26
|
+
* console.error(result.error); // ✓ TypeScript knows error exists
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export type OperationResult<T = any> =
|
|
31
|
+
| {
|
|
32
|
+
success: true;
|
|
33
|
+
data: T;
|
|
34
|
+
stats?: Record<string, any>;
|
|
35
|
+
metadata?: Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
success: false;
|
|
39
|
+
error: string;
|
|
40
|
+
stats?: Record<string, any>;
|
|
41
|
+
metadata?: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Result of task creation operation.
|
|
46
|
+
* Always returns success; throws exception on error.
|
|
47
|
+
*/
|
|
48
|
+
export interface CreateTaskResult {
|
|
49
|
+
success: true;
|
|
50
|
+
task: Task;
|
|
51
|
+
aiMetadata?: TaskAIMetadata;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Result of task enhancement operation.
|
|
56
|
+
* Always returns success; throws exception on error.
|
|
57
|
+
*/
|
|
58
|
+
export interface EnhanceTaskResult {
|
|
59
|
+
success: true;
|
|
60
|
+
task: Task;
|
|
61
|
+
enhancedContent: string;
|
|
62
|
+
stats: {
|
|
63
|
+
originalLength: number;
|
|
64
|
+
enhancedLength: number;
|
|
65
|
+
duration: number;
|
|
66
|
+
tokenUsage?: {
|
|
67
|
+
prompt: number;
|
|
68
|
+
completion: number;
|
|
69
|
+
total: number;
|
|
70
|
+
};
|
|
71
|
+
timeToFirstToken?: number; // ms
|
|
72
|
+
cost?: number; // USD
|
|
73
|
+
};
|
|
74
|
+
metadata: {
|
|
75
|
+
aiProvider: string;
|
|
76
|
+
aiModel: string;
|
|
77
|
+
confidence: number;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Result of task splitting operation.
|
|
83
|
+
* Always returns success; throws exception on error.
|
|
84
|
+
*/
|
|
85
|
+
export interface SplitTaskResult {
|
|
86
|
+
success: true;
|
|
87
|
+
task: Task;
|
|
88
|
+
subtasks: Task[];
|
|
89
|
+
stats: {
|
|
90
|
+
subtasksCreated: number;
|
|
91
|
+
duration: number;
|
|
92
|
+
tokenUsage?: {
|
|
93
|
+
prompt: number;
|
|
94
|
+
completion: number;
|
|
95
|
+
total: number;
|
|
96
|
+
};
|
|
97
|
+
timeToFirstToken?: number; // ms
|
|
98
|
+
cost?: number; // USD
|
|
99
|
+
};
|
|
100
|
+
metadata: {
|
|
101
|
+
aiProvider: string;
|
|
102
|
+
aiModel: string;
|
|
103
|
+
confidence?: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Result of task planning operation.
|
|
109
|
+
* Always returns success; throws exception on error.
|
|
110
|
+
*/
|
|
111
|
+
export interface PlanTaskResult {
|
|
112
|
+
success: true;
|
|
113
|
+
task: Task;
|
|
114
|
+
plan: string;
|
|
115
|
+
stats: {
|
|
116
|
+
duration: number;
|
|
117
|
+
tokenUsage?: {
|
|
118
|
+
prompt: number;
|
|
119
|
+
completion: number;
|
|
120
|
+
total: number;
|
|
121
|
+
};
|
|
122
|
+
timeToFirstToken?: number; // ms
|
|
123
|
+
cost?: number; // USD
|
|
124
|
+
};
|
|
125
|
+
metadata: {
|
|
126
|
+
aiProvider: string;
|
|
127
|
+
aiModel: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Result of task documentation operation.
|
|
133
|
+
* Always returns success; throws exception on error.
|
|
134
|
+
*/
|
|
135
|
+
export interface DocumentTaskResult {
|
|
136
|
+
success: true;
|
|
137
|
+
task: Task;
|
|
138
|
+
analysis?: DocumentationDetection;
|
|
139
|
+
documentation?: any;
|
|
140
|
+
stats: {
|
|
141
|
+
duration: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Result of task deletion operation.
|
|
147
|
+
* Always returns success; throws exception on error.
|
|
148
|
+
*/
|
|
149
|
+
export interface DeleteTaskResult {
|
|
150
|
+
success: true;
|
|
151
|
+
deleted: Task[];
|
|
152
|
+
orphanedSubtasks: Task[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Result of PRD parsing operation.
|
|
157
|
+
* Always returns success; throws exception on error.
|
|
158
|
+
*/
|
|
159
|
+
export interface PRDParseResult {
|
|
160
|
+
success: true;
|
|
161
|
+
prd: {
|
|
162
|
+
overview: string;
|
|
163
|
+
objectives: string[];
|
|
164
|
+
features: string[];
|
|
165
|
+
};
|
|
166
|
+
tasks: Task[];
|
|
167
|
+
stats: {
|
|
168
|
+
tasksCreated: number;
|
|
169
|
+
duration: number;
|
|
170
|
+
aiProvider: string;
|
|
171
|
+
aiModel: string;
|
|
172
|
+
tokenUsage?: {
|
|
173
|
+
prompt: number;
|
|
174
|
+
completion: number;
|
|
175
|
+
total: number;
|
|
176
|
+
};
|
|
177
|
+
timeToFirstToken?: number; // ms
|
|
178
|
+
cost?: number; // USD
|
|
179
|
+
};
|
|
180
|
+
steps: {
|
|
181
|
+
step: string;
|
|
182
|
+
status: "completed" | "failed";
|
|
183
|
+
duration: number;
|
|
184
|
+
details?: any;
|
|
185
|
+
}[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* AI response wrapper for stack suggestion.
|
|
190
|
+
* Contains the config and reasoning explanation.
|
|
191
|
+
*/
|
|
192
|
+
export interface StackSuggestionResponse {
|
|
193
|
+
config: BTSConfig;
|
|
194
|
+
reasoning: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Result of stack suggestion operation.
|
|
199
|
+
* Always returns success; throws exception on error.
|
|
200
|
+
*/
|
|
201
|
+
export interface SuggestStackResult {
|
|
202
|
+
success: true;
|
|
203
|
+
stack: BTSConfig;
|
|
204
|
+
reasoning: string;
|
|
205
|
+
savedPath?: string;
|
|
206
|
+
stats: {
|
|
207
|
+
duration: number;
|
|
208
|
+
tokenUsage?: {
|
|
209
|
+
prompt: number;
|
|
210
|
+
completion: number;
|
|
211
|
+
total: number;
|
|
212
|
+
};
|
|
213
|
+
timeToFirstToken?: number;
|
|
214
|
+
cost?: number;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { StreamingAIOptions } from "./options";
|
|
2
|
+
import type { BTSConfig } from "./index";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Comprehensive options for workflow command automation.
|
|
6
|
+
* All options are optional - workflow remains fully interactive by default.
|
|
7
|
+
*/
|
|
8
|
+
export interface WorkflowAutomationOptions extends StreamingAIOptions {
|
|
9
|
+
// Global workflow control
|
|
10
|
+
skipAll?: boolean; // Skip all optional steps
|
|
11
|
+
autoAccept?: boolean; // Auto-accept all AI suggestions
|
|
12
|
+
configFile?: string; // Load options from JSON file
|
|
13
|
+
|
|
14
|
+
// Step 1: Initialize
|
|
15
|
+
skipInit?: boolean; // Skip initialization entirely
|
|
16
|
+
projectName?: string; // Pre-set project name
|
|
17
|
+
initMethod?: "quick" | "custom" | "ai"; // Initialization method
|
|
18
|
+
projectDescription?: string; // For AI-assisted init
|
|
19
|
+
useExistingConfig?: boolean; // Use existing config if found
|
|
20
|
+
|
|
21
|
+
// AI Configuration (inherited from StreamingAIOptions)
|
|
22
|
+
// aiProvider, aiModel, aiKey, aiProviderUrl, stream
|
|
23
|
+
|
|
24
|
+
// Stack Configuration
|
|
25
|
+
frontend?: string; // Frontend framework
|
|
26
|
+
backend?: string; // Backend framework
|
|
27
|
+
database?: string; // Database choice
|
|
28
|
+
auth?: boolean; // Include authentication
|
|
29
|
+
bootstrap?: boolean; // Bootstrap with Better-T-Stack
|
|
30
|
+
includeDocs?: boolean; // Include documentation in new project
|
|
31
|
+
|
|
32
|
+
// Step 2: Define PRD
|
|
33
|
+
skipPrd?: boolean; // Skip PRD definition
|
|
34
|
+
prdMethod?: "upload" | "manual" | "ai" | "skip"; // PRD creation method
|
|
35
|
+
prdFile?: string; // Path to existing PRD file
|
|
36
|
+
prdDescription?: string; // For AI-assisted PRD creation
|
|
37
|
+
prdContent?: string; // Direct PRD content (for automation)
|
|
38
|
+
prdMultiGeneration?: boolean; // Use multi-generation for PRD creation
|
|
39
|
+
skipPrdMultiGeneration?: boolean; // Skip PRD multi-generation
|
|
40
|
+
prdMultiGenerationModels?: string; // Comma-separated list of provider:model
|
|
41
|
+
prdCombine?: boolean; // Combine multiple PRDs into master
|
|
42
|
+
skipPrdCombine?: boolean; // Skip PRD combination
|
|
43
|
+
prdCombineModel?: string; // Model to use for combining (provider:model)
|
|
44
|
+
|
|
45
|
+
// Step 2.4: Stack Suggestion
|
|
46
|
+
skipStackSuggestion?: boolean; // Skip stack suggestion step
|
|
47
|
+
suggestStackFromPrd?: string | true; // PRD file path, or true = use current PRD
|
|
48
|
+
|
|
49
|
+
// Step 3: Bootstrap (moved after PRD and stack suggestion)
|
|
50
|
+
skipBootstrap?: boolean; // Skip bootstrap step
|
|
51
|
+
|
|
52
|
+
// Step 4: Refine PRD
|
|
53
|
+
skipRefine?: boolean; // Skip PRD refinement
|
|
54
|
+
refineMethod?: "manual" | "ai" | "skip"; // Refinement method
|
|
55
|
+
refineFeedback?: string; // Feedback for AI refinement
|
|
56
|
+
|
|
57
|
+
// Step 2.5: PRD Question/Refine (NEW)
|
|
58
|
+
skipPrdQuestionRefine?: boolean; // Skip PRD question/refine step
|
|
59
|
+
prdQuestionRefine?: boolean; // Use question-based PRD refinement
|
|
60
|
+
prdAnswerMode?: "user" | "ai"; // Who answers questions: user or AI
|
|
61
|
+
prdAnswerAiProvider?: string; // AI provider for answering (optional override)
|
|
62
|
+
prdAnswerAiModel?: string; // AI model for answering (optional override)
|
|
63
|
+
prdAnswerAiKey?: string; // AI API key for answering (optional override)
|
|
64
|
+
prdAnswerAiProviderUrl?: string; // AI provider URL for answering (optional override)
|
|
65
|
+
prdAnswerAiReasoning?: boolean; // Enable reasoning for AI answering model
|
|
66
|
+
|
|
67
|
+
// Step 4: Generate Tasks
|
|
68
|
+
skipGenerate?: boolean; // Skip task generation
|
|
69
|
+
generateMethod?: "standard" | "ai"; // Generation method
|
|
70
|
+
generateInstructions?: string; // Custom instructions for task generation
|
|
71
|
+
|
|
72
|
+
// Step 5: Split Tasks
|
|
73
|
+
skipSplit?: boolean; // Skip task splitting
|
|
74
|
+
splitTasks?: string; // Comma-separated task IDs to split
|
|
75
|
+
splitAll?: boolean; // Split all tasks
|
|
76
|
+
splitMethod?: "interactive" | "standard" | "custom"; // Split method
|
|
77
|
+
splitInstructions?: string; // Custom instructions for splitting
|
|
78
|
+
|
|
79
|
+
// Step 6: Execute Tasks
|
|
80
|
+
execute?: boolean; // Execute generated tasks immediately
|
|
81
|
+
executeTasks?: boolean; // Alias for execute
|
|
82
|
+
executeConcurrency?: number; // Number of concurrent tasks
|
|
83
|
+
autoCommit?: boolean; // Auto-commit changes during execution
|
|
84
|
+
executeTool?: string; // Executor tool (opencode, claude, etc.)
|
|
85
|
+
executeModel?: string; // Model override for execution
|
|
86
|
+
executeMaxRetries?: number; // Maximum retries per task
|
|
87
|
+
executePlan?: boolean; // Enable planning phase
|
|
88
|
+
executePlanModel?: string; // Model for planning
|
|
89
|
+
executeReview?: boolean; // Enable review phase
|
|
90
|
+
executeReviewModel?: string; // Model for review
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface WorkflowState {
|
|
94
|
+
initialized: boolean;
|
|
95
|
+
currentStep:
|
|
96
|
+
| "initialize"
|
|
97
|
+
| "define-prd"
|
|
98
|
+
| "stack-suggestion"
|
|
99
|
+
| "bootstrap"
|
|
100
|
+
| "question-refine-prd"
|
|
101
|
+
| "refine-prd"
|
|
102
|
+
| "generate-tasks"
|
|
103
|
+
| "split-tasks"
|
|
104
|
+
| "execute-tasks"
|
|
105
|
+
| "complete";
|
|
106
|
+
projectName?: string;
|
|
107
|
+
projectDir?: string;
|
|
108
|
+
aiConfig?: any;
|
|
109
|
+
prdFile?: string;
|
|
110
|
+
prdContent?: string;
|
|
111
|
+
tasks?: Array<{ id: string; title: string; description?: string }>;
|
|
112
|
+
suggestedStack?: BTSConfig; // Accepted stack, used by bootstrap
|
|
113
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Task, AIConfig } from "./index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Result types for workflow service operations
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface InitializeResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
projectDir: string;
|
|
10
|
+
projectName: string;
|
|
11
|
+
aiConfig: {
|
|
12
|
+
provider: string;
|
|
13
|
+
model: string;
|
|
14
|
+
key: string;
|
|
15
|
+
};
|
|
16
|
+
stackConfig?: {
|
|
17
|
+
projectName: string;
|
|
18
|
+
aiProvider: string;
|
|
19
|
+
aiModel: string;
|
|
20
|
+
frontend?: string;
|
|
21
|
+
backend?: string;
|
|
22
|
+
database?: string;
|
|
23
|
+
auth?: boolean;
|
|
24
|
+
reasoning?: string;
|
|
25
|
+
};
|
|
26
|
+
bootstrapped: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DefinePRDResult {
|
|
30
|
+
success: boolean;
|
|
31
|
+
prdFile: string;
|
|
32
|
+
prdContent: string;
|
|
33
|
+
method: "upload" | "manual" | "ai" | "skip";
|
|
34
|
+
stats?: {
|
|
35
|
+
duration: number;
|
|
36
|
+
tokenUsage?: {
|
|
37
|
+
prompt: number;
|
|
38
|
+
completion: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
timeToFirstToken?: number; // ms
|
|
42
|
+
cost?: number; // USD
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface RefinePRDResult {
|
|
47
|
+
success: boolean;
|
|
48
|
+
prdFile: string;
|
|
49
|
+
prdContent: string;
|
|
50
|
+
questions?: string[];
|
|
51
|
+
answers?: Record<string, string>;
|
|
52
|
+
stats?: {
|
|
53
|
+
duration: number;
|
|
54
|
+
tokenUsage?: {
|
|
55
|
+
prompt: number;
|
|
56
|
+
completion: number;
|
|
57
|
+
total: number;
|
|
58
|
+
};
|
|
59
|
+
timeToFirstToken?: number; // ms
|
|
60
|
+
cost?: number; // USD
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface GenerateTasksResult {
|
|
65
|
+
success: boolean;
|
|
66
|
+
tasks: Task[];
|
|
67
|
+
stats: {
|
|
68
|
+
tasksCreated: number;
|
|
69
|
+
duration: number;
|
|
70
|
+
tokenUsage?: {
|
|
71
|
+
prompt: number;
|
|
72
|
+
completion: number;
|
|
73
|
+
total: number;
|
|
74
|
+
};
|
|
75
|
+
timeToFirstToken?: number; // ms
|
|
76
|
+
cost?: number; // USD
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface SplitTasksResult {
|
|
81
|
+
success: boolean;
|
|
82
|
+
results: Array<{
|
|
83
|
+
taskId: string;
|
|
84
|
+
subtasks: Task[];
|
|
85
|
+
error?: string;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AIConfig } from "../types";
|
|
2
|
+
|
|
3
|
+
export interface AIOptions {
|
|
4
|
+
aiProvider?: string;
|
|
5
|
+
aiModel?: string;
|
|
6
|
+
aiKey?: string;
|
|
7
|
+
aiProviderUrl?: string;
|
|
8
|
+
aiReasoning?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Builds an AI configuration object from CLI options
|
|
13
|
+
* This eliminates the duplication of this pattern across 10+ files
|
|
14
|
+
*/
|
|
15
|
+
export function buildAIConfig(options?: AIOptions): Partial<AIConfig> {
|
|
16
|
+
if (!options) return {};
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
...(options.aiProvider && {
|
|
20
|
+
provider: options.aiProvider as
|
|
21
|
+
| "openrouter"
|
|
22
|
+
| "openai"
|
|
23
|
+
| "anthropic"
|
|
24
|
+
| "custom",
|
|
25
|
+
}),
|
|
26
|
+
...(options.aiModel && { model: options.aiModel }),
|
|
27
|
+
...(options.aiKey && { apiKey: options.aiKey }),
|
|
28
|
+
...(options.aiProviderUrl && { baseURL: options.aiProviderUrl }),
|
|
29
|
+
...(options.aiReasoning && {
|
|
30
|
+
reasoning: { maxTokens: parseInt(options.aiReasoning, 10) },
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
}
|