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,628 @@
|
|
|
1
|
+
// AI Configuration
|
|
2
|
+
export interface AIConfig {
|
|
3
|
+
provider: AIProvider;
|
|
4
|
+
model: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
maxTokens?: number;
|
|
8
|
+
temperature?: number;
|
|
9
|
+
context7Enabled?: boolean;
|
|
10
|
+
reasoning?: {
|
|
11
|
+
maxTokens?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Environment Variable Configuration
|
|
16
|
+
export interface EnvAIConfig {
|
|
17
|
+
AI_PROVIDER?: string;
|
|
18
|
+
AI_MODEL?: string;
|
|
19
|
+
AI_MAX_TOKENS?: string;
|
|
20
|
+
AI_TEMPERATURE?: string;
|
|
21
|
+
OPENROUTER_API_KEY?: string;
|
|
22
|
+
ANTHROPIC_API_KEY?: string;
|
|
23
|
+
OPENAI_API_KEY?: string;
|
|
24
|
+
CUSTOM_API_KEY?: string;
|
|
25
|
+
CUSTOM_API_URL?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Provider-specific defaults
|
|
29
|
+
export interface ProviderDefaults {
|
|
30
|
+
openrouter: {
|
|
31
|
+
model: string;
|
|
32
|
+
maxTokens: number;
|
|
33
|
+
temperature: number;
|
|
34
|
+
};
|
|
35
|
+
anthropic: {
|
|
36
|
+
model: string;
|
|
37
|
+
maxTokens: number;
|
|
38
|
+
temperature: number;
|
|
39
|
+
};
|
|
40
|
+
openai: {
|
|
41
|
+
model: string;
|
|
42
|
+
maxTokens: number;
|
|
43
|
+
temperature: number;
|
|
44
|
+
};
|
|
45
|
+
custom: {
|
|
46
|
+
model: string;
|
|
47
|
+
maxTokens: number;
|
|
48
|
+
temperature: number;
|
|
49
|
+
};
|
|
50
|
+
gemini: {
|
|
51
|
+
model: string;
|
|
52
|
+
maxTokens: number;
|
|
53
|
+
temperature: number;
|
|
54
|
+
};
|
|
55
|
+
zai: {
|
|
56
|
+
model: string;
|
|
57
|
+
maxTokens: number;
|
|
58
|
+
temperature: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Task Documentation References
|
|
63
|
+
export interface TaskDocumentation {
|
|
64
|
+
lastFetched: number;
|
|
65
|
+
libraries: string[];
|
|
66
|
+
recap: string;
|
|
67
|
+
files: string[];
|
|
68
|
+
research?: Record<
|
|
69
|
+
string,
|
|
70
|
+
Array<{
|
|
71
|
+
query: string;
|
|
72
|
+
doc: string;
|
|
73
|
+
}>
|
|
74
|
+
>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Task
|
|
78
|
+
export interface CreateTaskOptions {
|
|
79
|
+
title: string;
|
|
80
|
+
content?: string;
|
|
81
|
+
effort?: "small" | "medium" | "large";
|
|
82
|
+
parentId?: string;
|
|
83
|
+
aiEnhance?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface Task extends CreateTaskOptions {
|
|
87
|
+
id: string;
|
|
88
|
+
status: "todo" | "in-progress" | "completed";
|
|
89
|
+
createdAt: number;
|
|
90
|
+
updatedAt: number;
|
|
91
|
+
tags?: string[];
|
|
92
|
+
subtasks?: Task[];
|
|
93
|
+
contentFile?: string;
|
|
94
|
+
enhancedContentFile?: string;
|
|
95
|
+
content?: string;
|
|
96
|
+
documentation?: TaskDocumentation;
|
|
97
|
+
dependencies?: string[];
|
|
98
|
+
description?: string;
|
|
99
|
+
estimatedEffort?: "small" | "medium" | "large";
|
|
100
|
+
prdFile?: string; // Reference to the PRD file this task was created from
|
|
101
|
+
plan?: string; // Implementation plan - just fucking text
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// PRD Parsing - moved to results.ts
|
|
105
|
+
// Use PRDParseResult from results.ts instead
|
|
106
|
+
|
|
107
|
+
// Interface for parsed AI task from PRD
|
|
108
|
+
export interface ParsedAITask {
|
|
109
|
+
title: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
content?: string;
|
|
112
|
+
effort?: "small" | "medium" | "large";
|
|
113
|
+
dependencies?: string[];
|
|
114
|
+
[key: string]: unknown; // Allow additional AI-generated properties
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// AI Response Interfaces for proper typing
|
|
118
|
+
export interface PRDResponse {
|
|
119
|
+
tasks: ParsedAITask[];
|
|
120
|
+
summary: string;
|
|
121
|
+
estimatedDuration: string;
|
|
122
|
+
confidence: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// What AI operations returns after parsing PRD (before service layer enrichment)
|
|
126
|
+
export interface AIPRDParseResult {
|
|
127
|
+
tasks: Task[];
|
|
128
|
+
summary: string;
|
|
129
|
+
estimatedDuration: string;
|
|
130
|
+
confidence: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface TaskBreakdownResponse {
|
|
134
|
+
subtasks: ParsedAITask[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface PRDQuestionResponse {
|
|
138
|
+
questions: string[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Better-T-Stack Integration
|
|
142
|
+
|
|
143
|
+
// Frontend types - supports Better-T-Stack frontends + custom (CLI)
|
|
144
|
+
export type BTSFrontend =
|
|
145
|
+
// Better-T-Stack web frontends
|
|
146
|
+
| "tanstack-router"
|
|
147
|
+
| "react-router"
|
|
148
|
+
| "tanstack-start"
|
|
149
|
+
| "next"
|
|
150
|
+
| "nuxt"
|
|
151
|
+
| "svelte"
|
|
152
|
+
| "solid"
|
|
153
|
+
// Better-T-Stack native frontends
|
|
154
|
+
| "native-bare"
|
|
155
|
+
| "native-uniwind"
|
|
156
|
+
| "native-unistyles"
|
|
157
|
+
// Custom frontends (handled separately by task-o-matic)
|
|
158
|
+
| "cli"
|
|
159
|
+
| "medusa"
|
|
160
|
+
| "none";
|
|
161
|
+
|
|
162
|
+
// CLI dependency levels
|
|
163
|
+
export type CliDependencyLevel =
|
|
164
|
+
| "minimal"
|
|
165
|
+
| "standard"
|
|
166
|
+
| "full"
|
|
167
|
+
| "task-o-matic";
|
|
168
|
+
|
|
169
|
+
// Backend types - v3.13.0
|
|
170
|
+
export type BTSBackend =
|
|
171
|
+
| "hono"
|
|
172
|
+
| "express"
|
|
173
|
+
| "fastify"
|
|
174
|
+
| "elysia"
|
|
175
|
+
| "convex"
|
|
176
|
+
| "self"
|
|
177
|
+
| "none";
|
|
178
|
+
|
|
179
|
+
// Database types - v3.13.0
|
|
180
|
+
export type BTSDatabase = "sqlite" | "postgres" | "mysql" | "mongodb" | "none";
|
|
181
|
+
|
|
182
|
+
// ORM types - v3.13.0
|
|
183
|
+
export type BTSORM = "drizzle" | "prisma" | "mongoose" | "none";
|
|
184
|
+
|
|
185
|
+
// API types - v3.13.0
|
|
186
|
+
export type BTSAPI = "trpc" | "orpc" | "none";
|
|
187
|
+
|
|
188
|
+
// Auth types - v3.13.0
|
|
189
|
+
export type BTSAuth = "better-auth" | "clerk" | "none";
|
|
190
|
+
|
|
191
|
+
// Payments types - v3.13.0
|
|
192
|
+
export type BTSPayments = "polar" | "none";
|
|
193
|
+
|
|
194
|
+
// Database setup types - v3.13.0
|
|
195
|
+
export type BTSDbSetup =
|
|
196
|
+
| "turso"
|
|
197
|
+
| "neon"
|
|
198
|
+
| "prisma-postgres"
|
|
199
|
+
| "planetscale"
|
|
200
|
+
| "mongodb-atlas"
|
|
201
|
+
| "supabase"
|
|
202
|
+
| "d1"
|
|
203
|
+
| "docker"
|
|
204
|
+
| "none";
|
|
205
|
+
|
|
206
|
+
// Deploy types - v3.13.0
|
|
207
|
+
export type BTSWebDeploy = "cloudflare" | "alchemy" | "none";
|
|
208
|
+
export type BTSServerDeploy = "cloudflare" | "alchemy" | "none";
|
|
209
|
+
|
|
210
|
+
// Runtime types - v3.13.0
|
|
211
|
+
export type BTSRuntime = "bun" | "node" | "workers" | "none";
|
|
212
|
+
|
|
213
|
+
// Addon types - v3.13.0
|
|
214
|
+
export type BTSAddon =
|
|
215
|
+
| "turborepo"
|
|
216
|
+
| "pwa"
|
|
217
|
+
| "tauri"
|
|
218
|
+
| "biome"
|
|
219
|
+
| "husky"
|
|
220
|
+
| "starlight"
|
|
221
|
+
| "fumadocs"
|
|
222
|
+
| "ultracite"
|
|
223
|
+
| "oxlint"
|
|
224
|
+
| "ruler"
|
|
225
|
+
| "opentui"
|
|
226
|
+
| "wxt"
|
|
227
|
+
| "none";
|
|
228
|
+
|
|
229
|
+
// Template types - v3.13.0
|
|
230
|
+
export type BTSTemplate = "mern" | "pern" | "t3" | "uniwind" | "none";
|
|
231
|
+
|
|
232
|
+
// Example types - v3.13.0
|
|
233
|
+
export type BTSExample = "todo" | "ai" | "none";
|
|
234
|
+
|
|
235
|
+
export interface BTSConfig {
|
|
236
|
+
frontend: BTSFrontend | BTSFrontend[]; // Array to support multiple frontends
|
|
237
|
+
backend: BTSBackend;
|
|
238
|
+
database: BTSDatabase;
|
|
239
|
+
auth: BTSAuth;
|
|
240
|
+
projectName: string;
|
|
241
|
+
runtime: BTSRuntime;
|
|
242
|
+
api: BTSAPI;
|
|
243
|
+
payments: BTSPayments;
|
|
244
|
+
orm: BTSORM;
|
|
245
|
+
dbSetup: BTSDbSetup;
|
|
246
|
+
packageManager: "npm" | "pnpm" | "bun";
|
|
247
|
+
git: boolean;
|
|
248
|
+
webDeploy: BTSWebDeploy;
|
|
249
|
+
serverDeploy: BTSServerDeploy;
|
|
250
|
+
install: boolean;
|
|
251
|
+
includeDocs?: boolean;
|
|
252
|
+
addons: BTSAddon[];
|
|
253
|
+
examples: BTSExample[];
|
|
254
|
+
template?: BTSTemplate;
|
|
255
|
+
// Non-interactive options
|
|
256
|
+
yes?: boolean; // Skip prompts, use defaults
|
|
257
|
+
manualDb?: boolean; // Skip DB setup prompts
|
|
258
|
+
renderTitle?: boolean; // Show/hide ASCII art title
|
|
259
|
+
createdAt?: string;
|
|
260
|
+
_source?: string; // Track if config came from file or fallback
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Init command options (add to support new frontends)
|
|
264
|
+
export interface InitOptions {
|
|
265
|
+
// Project metadata
|
|
266
|
+
projectName?: string;
|
|
267
|
+
name?: string;
|
|
268
|
+
directory?: string;
|
|
269
|
+
|
|
270
|
+
// AI configuration
|
|
271
|
+
aiProvider?: string;
|
|
272
|
+
aiModel?: string;
|
|
273
|
+
aiKey?: string;
|
|
274
|
+
aiProviderUrl?: string;
|
|
275
|
+
maxTokens?: string;
|
|
276
|
+
temperature?: string;
|
|
277
|
+
context7ApiKey?: string;
|
|
278
|
+
|
|
279
|
+
// Frontend configuration - can now be array or comma-separated string
|
|
280
|
+
frontend?: BTSFrontend | BTSFrontend[] | string;
|
|
281
|
+
cliDeps?: CliDependencyLevel;
|
|
282
|
+
|
|
283
|
+
// Backend configuration
|
|
284
|
+
backend?: string;
|
|
285
|
+
database?: string;
|
|
286
|
+
orm?: string;
|
|
287
|
+
dbSetup?: string;
|
|
288
|
+
auth?: string;
|
|
289
|
+
noAuth?: boolean;
|
|
290
|
+
|
|
291
|
+
// Build & deployment
|
|
292
|
+
runtime?: string;
|
|
293
|
+
api?: string;
|
|
294
|
+
payment?: string;
|
|
295
|
+
packageManager?: string;
|
|
296
|
+
webDeploy?: string;
|
|
297
|
+
serverDeploy?: string;
|
|
298
|
+
|
|
299
|
+
// Options
|
|
300
|
+
addons?: string[];
|
|
301
|
+
examples?: string[];
|
|
302
|
+
template?: string; // v3.13.0: mern, pern, t3, uniwind, none
|
|
303
|
+
noGit?: boolean;
|
|
304
|
+
noInstall?: boolean;
|
|
305
|
+
noBootstrap?: boolean;
|
|
306
|
+
includeDocs?: boolean;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface CreateTaskRequest {
|
|
310
|
+
id?: string; // Allow AI-generated IDs
|
|
311
|
+
title: string;
|
|
312
|
+
description?: string;
|
|
313
|
+
content?: string;
|
|
314
|
+
parentId?: string;
|
|
315
|
+
status?: "todo" | "in-progress" | "completed";
|
|
316
|
+
estimatedEffort?: "small" | "medium" | "large";
|
|
317
|
+
dependencies?: string[];
|
|
318
|
+
tags?: string[];
|
|
319
|
+
prdFile?: string; // Reference to the PRD file this task was created from
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// API Response wrapper
|
|
323
|
+
export interface ApiResponse<T = any> {
|
|
324
|
+
success: boolean;
|
|
325
|
+
data?: T;
|
|
326
|
+
error?: string;
|
|
327
|
+
timestamp: number;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// AI Metadata for tasks (stored separately)
|
|
331
|
+
export interface TaskAIMetadata {
|
|
332
|
+
taskId: string;
|
|
333
|
+
aiGenerated: boolean;
|
|
334
|
+
aiPrompt?: string;
|
|
335
|
+
confidence?: number;
|
|
336
|
+
aiProvider?: string;
|
|
337
|
+
aiModel?: string;
|
|
338
|
+
generatedAt?: number;
|
|
339
|
+
enhancedAt?: number;
|
|
340
|
+
analyzedAt?: number;
|
|
341
|
+
splitAt?: number;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Context Builder Types
|
|
345
|
+
export interface TaskContext {
|
|
346
|
+
task: {
|
|
347
|
+
id: string;
|
|
348
|
+
title: string;
|
|
349
|
+
description: string;
|
|
350
|
+
fullContent?: string;
|
|
351
|
+
};
|
|
352
|
+
stack?: BTSConfig;
|
|
353
|
+
documentation?: {
|
|
354
|
+
recap: string;
|
|
355
|
+
files: Array<{
|
|
356
|
+
path: string;
|
|
357
|
+
}>;
|
|
358
|
+
};
|
|
359
|
+
existingContent?: string;
|
|
360
|
+
prdContent?: string;
|
|
361
|
+
existingResearch?: Record<
|
|
362
|
+
string,
|
|
363
|
+
Array<{
|
|
364
|
+
query: string;
|
|
365
|
+
doc: string;
|
|
366
|
+
}>
|
|
367
|
+
>;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Documentation Detection Result
|
|
371
|
+
export interface DocumentationDetection {
|
|
372
|
+
libraries: Array<{
|
|
373
|
+
name: string;
|
|
374
|
+
context7Id: string;
|
|
375
|
+
reason: string;
|
|
376
|
+
searchQuery: string;
|
|
377
|
+
}>;
|
|
378
|
+
confidence: number;
|
|
379
|
+
toolResults?: Array<{
|
|
380
|
+
toolName: string;
|
|
381
|
+
output: any;
|
|
382
|
+
}>;
|
|
383
|
+
files?: string[];
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// AI Provider Types (union types based on AI SDK)
|
|
387
|
+
export const AI_PROVIDERS_LIST = [
|
|
388
|
+
"openai",
|
|
389
|
+
"anthropic",
|
|
390
|
+
"openrouter",
|
|
391
|
+
"custom",
|
|
392
|
+
"gemini",
|
|
393
|
+
"zai",
|
|
394
|
+
] as const;
|
|
395
|
+
|
|
396
|
+
export type AIProvider = (typeof AI_PROVIDERS_LIST)[number];
|
|
397
|
+
|
|
398
|
+
// AI Metadata Types (using AI SDK patterns)
|
|
399
|
+
export type MetadataType = "generated" | "enhanced" | "analyzed";
|
|
400
|
+
|
|
401
|
+
// AI Service Response Types (generic wrapper based on AI SDK patterns)
|
|
402
|
+
export interface AIServiceResponse<T = any> {
|
|
403
|
+
success: boolean;
|
|
404
|
+
data?: T;
|
|
405
|
+
error?: string;
|
|
406
|
+
metadata?: TaskAIMetadata;
|
|
407
|
+
timestamp: number;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// JSON Parse Result Type (for AI JSON parsing based on AI SDK patterns)
|
|
411
|
+
export interface JSONParseResult<T = any> {
|
|
412
|
+
success: boolean;
|
|
413
|
+
data?: T;
|
|
414
|
+
error?: string;
|
|
415
|
+
rawText?: string;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Streaming Callback Types (based on AI SDK patterns)
|
|
419
|
+
export interface StreamingCallbacks {
|
|
420
|
+
onChunk?: (chunk: string) => void | Promise<void>;
|
|
421
|
+
onFinish?: (result: {
|
|
422
|
+
text: string;
|
|
423
|
+
finishReason?: string;
|
|
424
|
+
usage?: any;
|
|
425
|
+
isAborted?: boolean;
|
|
426
|
+
}) => void | Promise<void>;
|
|
427
|
+
onError?: (error: unknown) => void | Promise<void>;
|
|
428
|
+
onAbort?: (reason?: string) => void | Promise<void>;
|
|
429
|
+
onReasoning?: (text: string) => void | Promise<void>;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Streaming Options Interface
|
|
433
|
+
export interface StreamingOptions extends StreamingCallbacks {
|
|
434
|
+
/** Enable streaming responses. When false, callbacks are ignored and final result is returned. */
|
|
435
|
+
enabled?: boolean;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Provider Configuration Types (based on AI SDK provider patterns)
|
|
439
|
+
export type ProviderConfig = {
|
|
440
|
+
[K in AIProvider]: {
|
|
441
|
+
apiKey?: string;
|
|
442
|
+
baseURL?: string;
|
|
443
|
+
model: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
// Retry Configuration Interface
|
|
448
|
+
export interface RetryConfig {
|
|
449
|
+
maxAttempts?: number;
|
|
450
|
+
baseDelay?: number; // Base delay in milliseconds
|
|
451
|
+
maxDelay?: number; // Maximum delay in milliseconds
|
|
452
|
+
backoffFactor?: number; // Multiplier for exponential backoff
|
|
453
|
+
retryableErrors?: string[]; // Error types that should be retried
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Helper types for API responses
|
|
457
|
+
export type TaskListResponse = Task[];
|
|
458
|
+
|
|
459
|
+
// External Executor Types
|
|
460
|
+
export type ExecutorTool = "opencode" | "claude" | "gemini" | "codex" | "kilo";
|
|
461
|
+
|
|
462
|
+
// Executor Configuration
|
|
463
|
+
export interface ExecutorConfig {
|
|
464
|
+
model?: string; // Model to use
|
|
465
|
+
sessionId?: string; // Specific session ID to resume
|
|
466
|
+
continueLastSession?: boolean; // Continue the most recent session
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface ExecuteTaskOptions {
|
|
470
|
+
taskId: string;
|
|
471
|
+
tool?: ExecutorTool;
|
|
472
|
+
message?: string;
|
|
473
|
+
dry?: boolean;
|
|
474
|
+
validate?: string[]; // Alias: verification commands (supports both --validate and --verify)
|
|
475
|
+
model?: string; // Model to use
|
|
476
|
+
continueSession?: boolean; // Continue last session
|
|
477
|
+
// New options (unified with execute-loop)
|
|
478
|
+
maxRetries?: number; // Enable retry logic (opt-in, default: undefined = disabled)
|
|
479
|
+
tryModels?: ModelAttemptConfig[]; // Progressive model escalation
|
|
480
|
+
plan?: boolean; // Generate implementation plan
|
|
481
|
+
planModel?: string; // Model/executor for planning
|
|
482
|
+
reviewPlan?: boolean; // Enable human plan review
|
|
483
|
+
review?: boolean; // Enable AI code review
|
|
484
|
+
reviewModel?: string; // Model/executor for review
|
|
485
|
+
autoCommit?: boolean; // Auto-commit changes
|
|
486
|
+
includePrd?: boolean; // Include PRD content in execution context
|
|
487
|
+
onPlanReview?: (planFile: string) => Promise<string | undefined>; // Callback for human plan review
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export interface ExternalExecutor {
|
|
491
|
+
name: string;
|
|
492
|
+
execute(
|
|
493
|
+
message: string,
|
|
494
|
+
dry?: boolean,
|
|
495
|
+
config?: ExecutorConfig
|
|
496
|
+
): Promise<void>;
|
|
497
|
+
supportsSessionResumption(): boolean; // Indicates if executor supports session resumption
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export interface ExecutionResult {
|
|
501
|
+
success: boolean;
|
|
502
|
+
exitCode?: number;
|
|
503
|
+
error?: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Model/Executor Configuration for Retry Attempts
|
|
507
|
+
export interface ModelAttemptConfig {
|
|
508
|
+
executor?: ExecutorTool; // Executor to use (if not specified, uses default)
|
|
509
|
+
model?: string; // Model name to use with the executor
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Execute Loop Configuration
|
|
513
|
+
export interface ExecuteLoopConfig {
|
|
514
|
+
model?: string; // Default model for the executor
|
|
515
|
+
maxRetries?: number; // Maximum retries per task (default: 3)
|
|
516
|
+
verificationCommands?: string[]; // Commands to run after each task
|
|
517
|
+
autoCommit?: boolean; // Auto-commit after successful task execution
|
|
518
|
+
tryModels?: ModelAttemptConfig[]; // Progressive model/executor configs for each attempt
|
|
519
|
+
plan?: boolean; // Generate a plan before execution
|
|
520
|
+
planModel?: string; // Model/executor to use for planning (e.g. "opencode:gpt-4o")
|
|
521
|
+
reviewPlan?: boolean; // Pause for human review of the plan
|
|
522
|
+
review?: boolean; // Run AI review after execution
|
|
523
|
+
reviewModel?: string; // Model/executor to use for review
|
|
524
|
+
customMessage?: string; // Custom message override (from execute command)
|
|
525
|
+
continueSession?: boolean; // Continue last session (from execute command)
|
|
526
|
+
includeCompleted?: boolean; // Include already-completed tasks (default: false)
|
|
527
|
+
includePrd?: boolean; // Include PRD content in execution context (default: false)
|
|
528
|
+
notifyTargets?: string[]; // Notify on completion (URL or command)
|
|
529
|
+
onPlanReview?: (planFile: string) => Promise<string | undefined>; // Callback for human plan review
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Execute Loop Options
|
|
533
|
+
export interface ExecuteLoopOptions {
|
|
534
|
+
filters?: {
|
|
535
|
+
status?: string;
|
|
536
|
+
tag?: string;
|
|
537
|
+
taskIds?: string[]; // Specific task IDs to execute
|
|
538
|
+
};
|
|
539
|
+
tool?: ExecutorTool;
|
|
540
|
+
config?: ExecuteLoopConfig;
|
|
541
|
+
dry?: boolean;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// Task Execution Attempt
|
|
545
|
+
export interface TaskExecutionAttempt {
|
|
546
|
+
attemptNumber: number;
|
|
547
|
+
success: boolean;
|
|
548
|
+
error?: string;
|
|
549
|
+
executor?: ExecutorTool; // Executor used for this attempt
|
|
550
|
+
model?: string; // Model used for this attempt
|
|
551
|
+
verificationResults?: Array<{
|
|
552
|
+
command: string;
|
|
553
|
+
success: boolean;
|
|
554
|
+
output?: string;
|
|
555
|
+
error?: string;
|
|
556
|
+
}>;
|
|
557
|
+
commitInfo?: {
|
|
558
|
+
message: string;
|
|
559
|
+
files: string[];
|
|
560
|
+
};
|
|
561
|
+
timestamp: number;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// Execute Loop Result
|
|
565
|
+
export interface ExecuteLoopResult {
|
|
566
|
+
totalTasks: number;
|
|
567
|
+
completedTasks: number;
|
|
568
|
+
failedTasks: number;
|
|
569
|
+
taskResults: Array<{
|
|
570
|
+
taskId: string;
|
|
571
|
+
taskTitle: string;
|
|
572
|
+
attempts: TaskExecutionAttempt[];
|
|
573
|
+
finalStatus: "completed" | "failed";
|
|
574
|
+
}>;
|
|
575
|
+
duration: number;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Unified Task Execution Configuration (used by both execute and execute-loop)
|
|
579
|
+
export interface TaskExecutionConfig {
|
|
580
|
+
tool: ExecutorTool;
|
|
581
|
+
executorConfig?: ExecutorConfig;
|
|
582
|
+
customMessage?: string; // Override execution message
|
|
583
|
+
verificationCommands?: string[]; // Validation/verification commands
|
|
584
|
+
enableRetry?: boolean; // Enable retry logic (default: false for execute, true for execute-loop)
|
|
585
|
+
maxRetries?: number; // Maximum retries per task (default: 3)
|
|
586
|
+
tryModels?: ModelAttemptConfig[]; // Progressive model/executor configs
|
|
587
|
+
enablePlanPhase?: boolean; // Generate implementation plan
|
|
588
|
+
planModel?: string; // Model/executor for planning (format: "executor:model" or "model")
|
|
589
|
+
reviewPlan?: boolean; // Enable human plan review
|
|
590
|
+
enableReviewPhase?: boolean; // Enable AI code review
|
|
591
|
+
reviewModel?: string; // Model/executor for review (format: "executor:model" or "model")
|
|
592
|
+
onPlanReview?: (planFile: string) => Promise<string | undefined>; // Callback for human plan review
|
|
593
|
+
autoCommit?: boolean; // Auto-commit changes
|
|
594
|
+
executeSubtasks?: boolean; // Execute subtasks recursively (default: true)
|
|
595
|
+
includeCompleted?: boolean; // Include already-completed tasks (default: false)
|
|
596
|
+
includePrd?: boolean; // Include PRD content in execution context (default: false)
|
|
597
|
+
dry?: boolean; // Dry run mode
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// Unified Task Execution Result (used by both execute and execute-loop)
|
|
601
|
+
export interface TaskExecutionResult {
|
|
602
|
+
success: boolean;
|
|
603
|
+
attempts: TaskExecutionAttempt[];
|
|
604
|
+
commitInfo?: {
|
|
605
|
+
message: string;
|
|
606
|
+
files: string[];
|
|
607
|
+
};
|
|
608
|
+
subtaskResults?: TaskExecutionResult[]; // Results from subtask execution
|
|
609
|
+
planContent?: string; // Generated plan content
|
|
610
|
+
reviewFeedback?: string; // Review feedback if review was enabled
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// Re-export result types from results.ts
|
|
614
|
+
export type {
|
|
615
|
+
OperationResult,
|
|
616
|
+
CreateTaskResult,
|
|
617
|
+
EnhanceTaskResult,
|
|
618
|
+
SplitTaskResult,
|
|
619
|
+
PlanTaskResult,
|
|
620
|
+
DocumentTaskResult,
|
|
621
|
+
DeleteTaskResult,
|
|
622
|
+
PRDParseResult,
|
|
623
|
+
} from "./results";
|
|
624
|
+
|
|
625
|
+
export * from "./workflow-options";
|
|
626
|
+
export * from "./options";
|
|
627
|
+
export * from "./results";
|
|
628
|
+
export * from "./callbacks";
|