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,471 @@
|
|
|
1
|
+
import { PromptRegistry, PromptMetadata } from "./prompt-registry";
|
|
2
|
+
import { readFileSync, existsSync, readdirSync, statSync } from "fs";
|
|
3
|
+
import { configManager } from "./config";
|
|
4
|
+
import { ContextBuilder } from "./context-builder";
|
|
5
|
+
import { getContextBuilder } from "../utils/ai-service-factory";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import { logger } from "./logger";
|
|
8
|
+
|
|
9
|
+
export interface PromptBuilderOptions {
|
|
10
|
+
name: string;
|
|
11
|
+
type?: "system" | "user";
|
|
12
|
+
variables: Record<string, string>;
|
|
13
|
+
prdContent?: string;
|
|
14
|
+
taskTitle?: string;
|
|
15
|
+
taskDescription?: string;
|
|
16
|
+
stackInfo?: string;
|
|
17
|
+
contextInfo?: string;
|
|
18
|
+
userFeedback?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PromptBuilderResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
metadata?: PromptMetadata;
|
|
25
|
+
error?: string;
|
|
26
|
+
missingVariables?: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class PromptBuilder {
|
|
30
|
+
/**
|
|
31
|
+
* Build a prompt with variable replacement
|
|
32
|
+
*/
|
|
33
|
+
static buildPrompt(options: PromptBuilderOptions): PromptBuilderResult {
|
|
34
|
+
const { name, type = "user", variables, ...directVars } = options;
|
|
35
|
+
|
|
36
|
+
// Get the prompt name with type suffix if specified
|
|
37
|
+
const promptName = type === "system" ? `${name}-system` : name;
|
|
38
|
+
|
|
39
|
+
// Get prompt metadata from registry
|
|
40
|
+
const metadata = PromptRegistry.getPrompt(promptName);
|
|
41
|
+
if (!metadata) {
|
|
42
|
+
return {
|
|
43
|
+
success: false,
|
|
44
|
+
error: `Prompt not found: ${promptName}. Available prompts:\n${PromptRegistry.listPrompts()}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Combine all variables (direct variables + variables object)
|
|
49
|
+
const allVariables = { ...variables, ...directVars };
|
|
50
|
+
|
|
51
|
+
// Validate required variables
|
|
52
|
+
const validation = PromptRegistry.validatePrompt(promptName, allVariables);
|
|
53
|
+
if (!validation.valid) {
|
|
54
|
+
return {
|
|
55
|
+
success: false,
|
|
56
|
+
error: `Missing required variables: ${validation.missingRequired.join(
|
|
57
|
+
", "
|
|
58
|
+
)}`,
|
|
59
|
+
missingVariables: validation.missingRequired,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Log missing optional variables for user awareness
|
|
64
|
+
if (validation.missingOptional.length > 0) {
|
|
65
|
+
logger.warn(
|
|
66
|
+
`Note: Missing optional variables: ${validation.missingOptional.join(
|
|
67
|
+
", "
|
|
68
|
+
)}`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
// Replace variables in the prompt text
|
|
74
|
+
let promptText = metadata.promptText;
|
|
75
|
+
|
|
76
|
+
// Replace all {VAR_NAME} patterns with their values
|
|
77
|
+
for (const [key, value] of Object.entries(allVariables)) {
|
|
78
|
+
const pattern = new RegExp(`\\{${key}\\}`, "g");
|
|
79
|
+
promptText = promptText.replace(pattern, value || "");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Check for any unreplaced variables (optional ones that weren't provided)
|
|
83
|
+
const unreplacedVars = promptText.match(/\{[^}]+\}/g);
|
|
84
|
+
if (unreplacedVars && unreplacedVars.length > 0) {
|
|
85
|
+
const varNames = unreplacedVars.map((v) => v.slice(1, -1));
|
|
86
|
+
const optionalUnreplaced = varNames.filter((v) =>
|
|
87
|
+
metadata.optionalVariables.includes(v)
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (optionalUnreplaced.length > 0) {
|
|
91
|
+
logger.warn(
|
|
92
|
+
`Note: Optional variables not replaced: ${optionalUnreplaced.join(
|
|
93
|
+
", "
|
|
94
|
+
)}`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
success: true,
|
|
101
|
+
prompt: promptText,
|
|
102
|
+
metadata,
|
|
103
|
+
};
|
|
104
|
+
} catch (error) {
|
|
105
|
+
return {
|
|
106
|
+
success: false,
|
|
107
|
+
error: `Error building prompt: ${
|
|
108
|
+
error instanceof Error ? error.message : "Unknown error"
|
|
109
|
+
}`,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* List all available prompts
|
|
116
|
+
*/
|
|
117
|
+
static listPrompts(): string {
|
|
118
|
+
return PromptRegistry.listPrompts();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get metadata for a specific prompt
|
|
123
|
+
*/
|
|
124
|
+
static getPromptMetadata(
|
|
125
|
+
name: string,
|
|
126
|
+
type?: "system" | "user"
|
|
127
|
+
): PromptMetadata | null {
|
|
128
|
+
const promptName = type === "system" ? `${name}-system` : name;
|
|
129
|
+
return PromptRegistry.getPrompt(promptName) || null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Load PRD content from file
|
|
134
|
+
*/
|
|
135
|
+
static loadPRDContent(filePath: string): string {
|
|
136
|
+
if (!existsSync(filePath)) {
|
|
137
|
+
throw new Error(`PRD file not found: ${filePath}`);
|
|
138
|
+
}
|
|
139
|
+
return readFileSync(filePath, "utf-8");
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Auto-detect and load PRD content from project
|
|
144
|
+
*/
|
|
145
|
+
static async autoDetectPRDContent(): Promise<string | undefined> {
|
|
146
|
+
try {
|
|
147
|
+
const contextBuilder = getContextBuilder();
|
|
148
|
+
|
|
149
|
+
// Build context for a dummy task to get PRD content
|
|
150
|
+
const context = await contextBuilder.buildContextForNewTask(
|
|
151
|
+
"Dummy Task",
|
|
152
|
+
"For PRD detection"
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
return context.prdContent;
|
|
156
|
+
} catch (error) {
|
|
157
|
+
logger.warn(`Could not auto-detect PRD content: ${error}`);
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Build task context from file or content using ContextBuilder
|
|
164
|
+
*/
|
|
165
|
+
static async buildTaskContext(
|
|
166
|
+
taskTitle: string,
|
|
167
|
+
content?: string,
|
|
168
|
+
filePath?: string
|
|
169
|
+
): Promise<string> {
|
|
170
|
+
let taskDescription = "";
|
|
171
|
+
|
|
172
|
+
if (filePath) {
|
|
173
|
+
if (!existsSync(filePath)) {
|
|
174
|
+
throw new Error(`Task file not found: ${filePath}`);
|
|
175
|
+
}
|
|
176
|
+
taskDescription = readFileSync(filePath, "utf-8");
|
|
177
|
+
} else if (content) {
|
|
178
|
+
taskDescription = content;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Use ContextBuilder to get rich context if we have a title
|
|
182
|
+
if (taskTitle) {
|
|
183
|
+
try {
|
|
184
|
+
const contextBuilder = getContextBuilder();
|
|
185
|
+
const context = await contextBuilder.buildContextForNewTask(
|
|
186
|
+
taskTitle,
|
|
187
|
+
taskDescription
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
// Return formatted context instead of just description
|
|
191
|
+
return contextBuilder.formatContextForAI(context);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
logger.warn(
|
|
194
|
+
`Could not build rich task context, using basic description: ${error}`
|
|
195
|
+
);
|
|
196
|
+
return taskDescription;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return taskDescription;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Detect stack info using ContextBuilder (proper BTS config loading)
|
|
205
|
+
*/
|
|
206
|
+
static async detectStackInfo(projectPath?: string): Promise<string> {
|
|
207
|
+
try {
|
|
208
|
+
// Default to current working directory if not provided
|
|
209
|
+
const workDir = projectPath || process.cwd();
|
|
210
|
+
configManager.setWorkingDirectory(workDir);
|
|
211
|
+
await configManager.load();
|
|
212
|
+
|
|
213
|
+
const contextBuilder = getContextBuilder();
|
|
214
|
+
|
|
215
|
+
// Build context for a dummy task to get stack info
|
|
216
|
+
const context = await contextBuilder.buildContextForNewTask(
|
|
217
|
+
"Dummy Task",
|
|
218
|
+
"For stack detection"
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
if (context.stack && context.stack._source === "file") {
|
|
222
|
+
const parts = [
|
|
223
|
+
`Frontend: ${context.stack.frontend}`,
|
|
224
|
+
`Backend: ${context.stack.backend}`,
|
|
225
|
+
];
|
|
226
|
+
if (context.stack.database !== "none") {
|
|
227
|
+
parts.push(`Database: ${context.stack.database}`);
|
|
228
|
+
}
|
|
229
|
+
if (context.stack.orm !== "none") {
|
|
230
|
+
parts.push(`ORM: ${context.stack.orm}`);
|
|
231
|
+
}
|
|
232
|
+
parts.push(`Auth: ${context.stack.auth}`);
|
|
233
|
+
if (context.stack.addons.length > 0) {
|
|
234
|
+
parts.push(`Addons: ${context.stack.addons.join(", ")}`);
|
|
235
|
+
}
|
|
236
|
+
return parts.join(", ");
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return "Not detected";
|
|
240
|
+
} catch (error) {
|
|
241
|
+
logger.warn(`Could not detect stack info using ContextBuilder: ${error}`);
|
|
242
|
+
return "Not detected";
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Build comprehensive project context for external executors
|
|
248
|
+
*/
|
|
249
|
+
static async buildFullProjectContext(projectPath: string): Promise<string> {
|
|
250
|
+
const contextParts: string[] = [];
|
|
251
|
+
|
|
252
|
+
contextParts.push("**Project Context:**");
|
|
253
|
+
|
|
254
|
+
// Detect package.json and dependencies
|
|
255
|
+
const packageJsonPath = join(projectPath, "package.json");
|
|
256
|
+
if (existsSync(packageJsonPath)) {
|
|
257
|
+
try {
|
|
258
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
259
|
+
const deps = Object.keys(packageJson.dependencies || {});
|
|
260
|
+
const devDeps = Object.keys(packageJson.devDependencies || {});
|
|
261
|
+
|
|
262
|
+
contextParts.push(`\n**Dependencies:**`);
|
|
263
|
+
if (deps.length > 0) {
|
|
264
|
+
contextParts.push(
|
|
265
|
+
`- Production: ${deps.slice(0, 10).join(", ")}${
|
|
266
|
+
deps.length > 10 ? ` (+${deps.length - 10} more)` : ""
|
|
267
|
+
}`
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
if (devDeps.length > 0) {
|
|
271
|
+
contextParts.push(
|
|
272
|
+
`- Development: ${devDeps.slice(0, 10).join(", ")}${
|
|
273
|
+
devDeps.length > 10 ? ` (+${devDeps.length - 10} more)` : ""
|
|
274
|
+
}`
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (packageJson.scripts) {
|
|
279
|
+
const scripts = Object.keys(packageJson.scripts);
|
|
280
|
+
contextParts.push(`\n**Available Scripts:** ${scripts.join(", ")}`);
|
|
281
|
+
}
|
|
282
|
+
} catch (error) {
|
|
283
|
+
logger.warn(`Could not parse package.json: ${error}`);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Detect project structure
|
|
288
|
+
try {
|
|
289
|
+
const files = readdirSync(projectPath);
|
|
290
|
+
const directories = files.filter((f) => {
|
|
291
|
+
try {
|
|
292
|
+
const stat = statSync(join(projectPath, f));
|
|
293
|
+
return stat.isDirectory() && !f.startsWith(".");
|
|
294
|
+
} catch {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
if (directories.length > 0) {
|
|
300
|
+
contextParts.push(`\n**Project Structure:** ${directories.join(", ")}`);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Detect configuration files
|
|
304
|
+
const configFiles = files.filter(
|
|
305
|
+
(f) =>
|
|
306
|
+
f.match(/\.(config|rc)\.(js|ts|json|yaml|yml)$/) ||
|
|
307
|
+
[
|
|
308
|
+
"tsconfig.json",
|
|
309
|
+
"next.config.js",
|
|
310
|
+
"vite.config.ts",
|
|
311
|
+
"tailwind.config.js",
|
|
312
|
+
].includes(f)
|
|
313
|
+
);
|
|
314
|
+
if (configFiles.length > 0) {
|
|
315
|
+
contextParts.push(
|
|
316
|
+
`\n**Configuration Files:** ${configFiles.join(", ")}`
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
} catch (error) {
|
|
320
|
+
logger.warn(`Could not read project structure: ${error}`);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Detect frameworks and tools
|
|
324
|
+
const detectedTools: string[] = [];
|
|
325
|
+
if (
|
|
326
|
+
existsSync(join(projectPath, "next.config.js")) ||
|
|
327
|
+
existsSync(join(projectPath, "next.config.ts"))
|
|
328
|
+
) {
|
|
329
|
+
detectedTools.push("Next.js");
|
|
330
|
+
}
|
|
331
|
+
if (
|
|
332
|
+
existsSync(join(projectPath, "vite.config.ts")) ||
|
|
333
|
+
existsSync(join(projectPath, "vite.config.js"))
|
|
334
|
+
) {
|
|
335
|
+
detectedTools.push("Vite");
|
|
336
|
+
}
|
|
337
|
+
if (
|
|
338
|
+
existsSync(join(projectPath, "tailwind.config.js")) ||
|
|
339
|
+
existsSync(join(projectPath, "tailwind.config.ts"))
|
|
340
|
+
) {
|
|
341
|
+
detectedTools.push("Tailwind CSS");
|
|
342
|
+
}
|
|
343
|
+
if (existsSync(join(projectPath, "convex"))) {
|
|
344
|
+
detectedTools.push("Convex");
|
|
345
|
+
}
|
|
346
|
+
if (existsSync(join(projectPath, "turbo.json"))) {
|
|
347
|
+
detectedTools.push("Turborepo");
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (detectedTools.length > 0) {
|
|
351
|
+
contextParts.push(`\n**Detected Tools:** ${detectedTools.join(", ")}`);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return contextParts.join("\n");
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Format prompt for specific executor
|
|
359
|
+
*/
|
|
360
|
+
static formatForExecutor(
|
|
361
|
+
prompt: string,
|
|
362
|
+
executor: "opencode" | "claude" | "gemini" | "codex"
|
|
363
|
+
): string {
|
|
364
|
+
// Most executors work well with plain text prompts
|
|
365
|
+
// This method exists for future customization if needed
|
|
366
|
+
|
|
367
|
+
switch (executor) {
|
|
368
|
+
case "claude":
|
|
369
|
+
// Claude Code works well with structured markdown
|
|
370
|
+
return prompt;
|
|
371
|
+
case "gemini":
|
|
372
|
+
// Gemini CLI supports file references with @
|
|
373
|
+
return prompt;
|
|
374
|
+
case "codex":
|
|
375
|
+
// Codex CLI supports structured prompts
|
|
376
|
+
return prompt;
|
|
377
|
+
case "opencode":
|
|
378
|
+
default:
|
|
379
|
+
return prompt;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Build execution prompt with task context
|
|
385
|
+
*/
|
|
386
|
+
static buildExecutionPrompt(options: {
|
|
387
|
+
taskTitle: string;
|
|
388
|
+
taskDescription?: string;
|
|
389
|
+
taskPlan?: string;
|
|
390
|
+
stack?: any;
|
|
391
|
+
documentation?: any;
|
|
392
|
+
retryContext?: string;
|
|
393
|
+
prdContent?: string;
|
|
394
|
+
}): PromptBuilderResult {
|
|
395
|
+
const {
|
|
396
|
+
taskTitle,
|
|
397
|
+
taskDescription,
|
|
398
|
+
taskPlan,
|
|
399
|
+
stack,
|
|
400
|
+
documentation,
|
|
401
|
+
retryContext,
|
|
402
|
+
prdContent,
|
|
403
|
+
} = options;
|
|
404
|
+
|
|
405
|
+
// Build TASK_PLAN variable
|
|
406
|
+
let taskPlanText = "";
|
|
407
|
+
if (taskPlan) {
|
|
408
|
+
taskPlanText = `# Task Plan\n\n${taskPlan}\n`;
|
|
409
|
+
} else {
|
|
410
|
+
taskPlanText = `# Task: ${taskTitle}\n\n${
|
|
411
|
+
taskDescription || "No description"
|
|
412
|
+
}\n`;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Build STACK_INFO variable
|
|
416
|
+
let stackInfo = "";
|
|
417
|
+
if (stack) {
|
|
418
|
+
const stackParts: string[] = [];
|
|
419
|
+
stackParts.push(`- **Project**: ${stack.projectName}`);
|
|
420
|
+
stackParts.push(`- **Frontend**: ${stack.frontend}`);
|
|
421
|
+
stackParts.push(`- **Backend**: ${stack.backend}`);
|
|
422
|
+
if (stack.database !== "none") {
|
|
423
|
+
stackParts.push(`- **Database**: ${stack.database}`);
|
|
424
|
+
}
|
|
425
|
+
if (stack.orm !== "none") {
|
|
426
|
+
stackParts.push(`- **ORM**: ${stack.orm}`);
|
|
427
|
+
}
|
|
428
|
+
stackParts.push(`- **Auth**: ${stack.auth}`);
|
|
429
|
+
if (stack.addons && stack.addons.length > 0) {
|
|
430
|
+
stackParts.push(`- **Addons**: ${stack.addons.join(", ")}`);
|
|
431
|
+
}
|
|
432
|
+
stackParts.push(`- **Package Manager**: ${stack.packageManager}`);
|
|
433
|
+
stackInfo = stackParts.join("\n");
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Build DOCUMENTATION_CONTEXT variable
|
|
437
|
+
let docContext = "";
|
|
438
|
+
if (documentation) {
|
|
439
|
+
const docParts: string[] = [];
|
|
440
|
+
docParts.push(`\n# Documentation Context\n`);
|
|
441
|
+
docParts.push(documentation.recap);
|
|
442
|
+
if (documentation.files && documentation.files.length > 0) {
|
|
443
|
+
docParts.push(`\n**Relevant Documentation Files**:`);
|
|
444
|
+
documentation.files.forEach((file: any) => {
|
|
445
|
+
docParts.push(`- ${file.path}`);
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
docContext = docParts.join("\n");
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// Build PRD_CONTENT variable
|
|
452
|
+
let prdCtx = "";
|
|
453
|
+
if (prdContent) {
|
|
454
|
+
prdCtx = `\n# Product Requirements Document\n\n${prdContent}\n`;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Build RETRY_CONTEXT variable
|
|
458
|
+
const retryCtx = retryContext || "";
|
|
459
|
+
|
|
460
|
+
return this.buildPrompt({
|
|
461
|
+
name: "task-execution",
|
|
462
|
+
variables: {
|
|
463
|
+
RETRY_CONTEXT: retryCtx,
|
|
464
|
+
TASK_PLAN: taskPlanText,
|
|
465
|
+
STACK_INFO: stackInfo,
|
|
466
|
+
DOCUMENTATION_CONTEXT: docContext,
|
|
467
|
+
PRD_CONTENT: prdCtx,
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|