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,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task-o-matic Library Entry Point
|
|
3
|
+
*
|
|
4
|
+
* This module exports the core services, types, and utilities for using
|
|
5
|
+
* task-o-matic as a library in TUI, web applications, or other Node.js projects.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { TaskService, Task, AIConfig } from 'task-o-matic';
|
|
10
|
+
*
|
|
11
|
+
* const taskService = new TaskService();
|
|
12
|
+
* const result = await taskService.createTask({
|
|
13
|
+
* title: 'My Task',
|
|
14
|
+
* content: 'Task description',
|
|
15
|
+
* aiEnhance: true
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* TaskService - Core task management operations
|
|
21
|
+
* Handles creating, updating, listing, enhancing, splitting, and planning tasks
|
|
22
|
+
*/
|
|
23
|
+
export { TaskService } from "../services/tasks";
|
|
24
|
+
/**
|
|
25
|
+
* PRDService - Product Requirements Document parsing and processing
|
|
26
|
+
* Handles PRD parsing, task extraction, and PRD improvement
|
|
27
|
+
*/
|
|
28
|
+
export { PRDService } from "../services/prd";
|
|
29
|
+
/**
|
|
30
|
+
* WorkflowService - Complete workflow orchestration
|
|
31
|
+
* Handles project initialization, PRD management, task generation, and task splitting
|
|
32
|
+
*/
|
|
33
|
+
export { WorkflowService } from "../services/workflow";
|
|
34
|
+
/**
|
|
35
|
+
* BenchmarkService - AI model benchmarking
|
|
36
|
+
* Handles running benchmarks, storing results, and comparing models
|
|
37
|
+
*/
|
|
38
|
+
export { BenchmarkService } from "../services/benchmark";
|
|
39
|
+
/**
|
|
40
|
+
* Result types for workflow service operations
|
|
41
|
+
*/
|
|
42
|
+
export type { InitializeResult, DefinePRDResult, RefinePRDResult, GenerateTasksResult, SplitTasksResult, } from "../types/workflow-results";
|
|
43
|
+
/**
|
|
44
|
+
* Re-export all types from the types module
|
|
45
|
+
* Includes Task, AIConfig, StreamingOptions, and all related interfaces
|
|
46
|
+
*/
|
|
47
|
+
export * from "../types";
|
|
48
|
+
/**
|
|
49
|
+
* Re-export callback types
|
|
50
|
+
*/
|
|
51
|
+
export type { ProgressCallback } from "../types/callbacks";
|
|
52
|
+
/**
|
|
53
|
+
* Re-export option types
|
|
54
|
+
*/
|
|
55
|
+
export type { CreateTaskOptions, SplitTaskOptions, PlanTaskOptions, EnhanceTaskOptions, } from "../types/options";
|
|
56
|
+
/**
|
|
57
|
+
* Factory functions for getting singleton instances of core services
|
|
58
|
+
* These ensure only one instance exists throughout the application
|
|
59
|
+
*/
|
|
60
|
+
export { getAIOperations, getModelProvider, getStorage, getContextBuilder, resetServiceInstances, initializeServices, } from "../utils/ai-service-factory";
|
|
61
|
+
/**
|
|
62
|
+
* AI configuration builder utility
|
|
63
|
+
*/
|
|
64
|
+
export { buildAIConfig } from "../utils/ai-config-builder";
|
|
65
|
+
export type { AIOptions } from "../utils/ai-config-builder";
|
|
66
|
+
/**
|
|
67
|
+
* LocalStorage - File-based storage abstraction for tasks and metadata
|
|
68
|
+
* Note: This is Node.js file-system based and not compatible with browser environments
|
|
69
|
+
*/
|
|
70
|
+
export { FileSystemStorage } from "./storage/file-system";
|
|
71
|
+
export type { TaskRepository } from "./storage/types";
|
|
72
|
+
/**
|
|
73
|
+
* ConfigManager - Configuration management for task-o-matic projects
|
|
74
|
+
*/
|
|
75
|
+
export { ConfigManager, configManager } from "./config";
|
|
76
|
+
/**
|
|
77
|
+
* AIOperations - AI service operations wrapper
|
|
78
|
+
*/
|
|
79
|
+
export { AIOperations } from "./ai-service/ai-operations";
|
|
80
|
+
/**
|
|
81
|
+
* ModelProvider - AI model provider abstraction
|
|
82
|
+
*/
|
|
83
|
+
export { ModelProvider } from "./ai-service/model-provider";
|
|
84
|
+
/**
|
|
85
|
+
* ContextBuilder - Task context assembly for AI operations
|
|
86
|
+
*/
|
|
87
|
+
export { ContextBuilder } from "./context-builder";
|
|
88
|
+
/**
|
|
89
|
+
* PromptBuilder - Prompt template management
|
|
90
|
+
*/
|
|
91
|
+
export { PromptBuilder } from "./prompt-builder";
|
|
92
|
+
/**
|
|
93
|
+
* Stack formatter utility
|
|
94
|
+
*/
|
|
95
|
+
export { formatStackInfo } from "../utils/stack-formatter";
|
|
96
|
+
/**
|
|
97
|
+
* Validation utilities
|
|
98
|
+
*/
|
|
99
|
+
export { isValidAIProvider, runValidations } from "./validation";
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAMnC;;;GAGG;AACH,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAM5D;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAS3D;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* task-o-matic Library Entry Point
|
|
4
|
+
*
|
|
5
|
+
* This module exports the core services, types, and utilities for using
|
|
6
|
+
* task-o-matic as a library in TUI, web applications, or other Node.js projects.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { TaskService, Task, AIConfig } from 'task-o-matic';
|
|
11
|
+
*
|
|
12
|
+
* const taskService = new TaskService();
|
|
13
|
+
* const result = await taskService.createTask({
|
|
14
|
+
* title: 'My Task',
|
|
15
|
+
* content: 'Task description',
|
|
16
|
+
* aiEnhance: true
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.runValidations = exports.isValidAIProvider = exports.formatStackInfo = exports.PromptBuilder = exports.ContextBuilder = exports.ModelProvider = exports.AIOperations = exports.configManager = exports.ConfigManager = exports.FileSystemStorage = exports.buildAIConfig = exports.initializeServices = exports.resetServiceInstances = exports.getContextBuilder = exports.getStorage = exports.getModelProvider = exports.getAIOperations = exports.BenchmarkService = exports.WorkflowService = exports.PRDService = exports.TaskService = void 0;
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Main Services - Business Logic Layer
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* TaskService - Core task management operations
|
|
41
|
+
* Handles creating, updating, listing, enhancing, splitting, and planning tasks
|
|
42
|
+
*/
|
|
43
|
+
var tasks_1 = require("../services/tasks");
|
|
44
|
+
Object.defineProperty(exports, "TaskService", { enumerable: true, get: function () { return tasks_1.TaskService; } });
|
|
45
|
+
/**
|
|
46
|
+
* PRDService - Product Requirements Document parsing and processing
|
|
47
|
+
* Handles PRD parsing, task extraction, and PRD improvement
|
|
48
|
+
*/
|
|
49
|
+
var prd_1 = require("../services/prd");
|
|
50
|
+
Object.defineProperty(exports, "PRDService", { enumerable: true, get: function () { return prd_1.PRDService; } });
|
|
51
|
+
/**
|
|
52
|
+
* WorkflowService - Complete workflow orchestration
|
|
53
|
+
* Handles project initialization, PRD management, task generation, and task splitting
|
|
54
|
+
*/
|
|
55
|
+
var workflow_1 = require("../services/workflow");
|
|
56
|
+
Object.defineProperty(exports, "WorkflowService", { enumerable: true, get: function () { return workflow_1.WorkflowService; } });
|
|
57
|
+
/**
|
|
58
|
+
* BenchmarkService - AI model benchmarking
|
|
59
|
+
* Handles running benchmarks, storing results, and comparing models
|
|
60
|
+
*/
|
|
61
|
+
var benchmark_1 = require("../services/benchmark");
|
|
62
|
+
Object.defineProperty(exports, "BenchmarkService", { enumerable: true, get: function () { return benchmark_1.BenchmarkService; } });
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// Core Types - Type Definitions
|
|
65
|
+
// ============================================================================
|
|
66
|
+
/**
|
|
67
|
+
* Re-export all types from the types module
|
|
68
|
+
* Includes Task, AIConfig, StreamingOptions, and all related interfaces
|
|
69
|
+
*/
|
|
70
|
+
__exportStar(require("../types"), exports);
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// Utility Factories - Singleton Service Instances
|
|
73
|
+
// ============================================================================
|
|
74
|
+
/**
|
|
75
|
+
* Factory functions for getting singleton instances of core services
|
|
76
|
+
* These ensure only one instance exists throughout the application
|
|
77
|
+
*/
|
|
78
|
+
var ai_service_factory_1 = require("../utils/ai-service-factory");
|
|
79
|
+
Object.defineProperty(exports, "getAIOperations", { enumerable: true, get: function () { return ai_service_factory_1.getAIOperations; } });
|
|
80
|
+
Object.defineProperty(exports, "getModelProvider", { enumerable: true, get: function () { return ai_service_factory_1.getModelProvider; } });
|
|
81
|
+
Object.defineProperty(exports, "getStorage", { enumerable: true, get: function () { return ai_service_factory_1.getStorage; } });
|
|
82
|
+
Object.defineProperty(exports, "getContextBuilder", { enumerable: true, get: function () { return ai_service_factory_1.getContextBuilder; } });
|
|
83
|
+
Object.defineProperty(exports, "resetServiceInstances", { enumerable: true, get: function () { return ai_service_factory_1.resetServiceInstances; } });
|
|
84
|
+
Object.defineProperty(exports, "initializeServices", { enumerable: true, get: function () { return ai_service_factory_1.initializeServices; } });
|
|
85
|
+
/**
|
|
86
|
+
* AI configuration builder utility
|
|
87
|
+
*/
|
|
88
|
+
var ai_config_builder_1 = require("../utils/ai-config-builder");
|
|
89
|
+
Object.defineProperty(exports, "buildAIConfig", { enumerable: true, get: function () { return ai_config_builder_1.buildAIConfig; } });
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Core Classes - Direct Class Exports
|
|
92
|
+
// ============================================================================
|
|
93
|
+
/**
|
|
94
|
+
* LocalStorage - File-based storage abstraction for tasks and metadata
|
|
95
|
+
* Note: This is Node.js file-system based and not compatible with browser environments
|
|
96
|
+
*/
|
|
97
|
+
var file_system_1 = require("./storage/file-system");
|
|
98
|
+
Object.defineProperty(exports, "FileSystemStorage", { enumerable: true, get: function () { return file_system_1.FileSystemStorage; } });
|
|
99
|
+
/**
|
|
100
|
+
* ConfigManager - Configuration management for task-o-matic projects
|
|
101
|
+
*/
|
|
102
|
+
var config_1 = require("./config");
|
|
103
|
+
Object.defineProperty(exports, "ConfigManager", { enumerable: true, get: function () { return config_1.ConfigManager; } });
|
|
104
|
+
Object.defineProperty(exports, "configManager", { enumerable: true, get: function () { return config_1.configManager; } });
|
|
105
|
+
/**
|
|
106
|
+
* AIOperations - AI service operations wrapper
|
|
107
|
+
*/
|
|
108
|
+
var ai_operations_1 = require("./ai-service/ai-operations");
|
|
109
|
+
Object.defineProperty(exports, "AIOperations", { enumerable: true, get: function () { return ai_operations_1.AIOperations; } });
|
|
110
|
+
/**
|
|
111
|
+
* ModelProvider - AI model provider abstraction
|
|
112
|
+
*/
|
|
113
|
+
var model_provider_1 = require("./ai-service/model-provider");
|
|
114
|
+
Object.defineProperty(exports, "ModelProvider", { enumerable: true, get: function () { return model_provider_1.ModelProvider; } });
|
|
115
|
+
/**
|
|
116
|
+
* ContextBuilder - Task context assembly for AI operations
|
|
117
|
+
*/
|
|
118
|
+
var context_builder_1 = require("./context-builder");
|
|
119
|
+
Object.defineProperty(exports, "ContextBuilder", { enumerable: true, get: function () { return context_builder_1.ContextBuilder; } });
|
|
120
|
+
/**
|
|
121
|
+
* PromptBuilder - Prompt template management
|
|
122
|
+
*/
|
|
123
|
+
var prompt_builder_1 = require("./prompt-builder");
|
|
124
|
+
Object.defineProperty(exports, "PromptBuilder", { enumerable: true, get: function () { return prompt_builder_1.PromptBuilder; } });
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// Utilities
|
|
127
|
+
// ============================================================================
|
|
128
|
+
/**
|
|
129
|
+
* Stack formatter utility
|
|
130
|
+
*/
|
|
131
|
+
var stack_formatter_1 = require("../utils/stack-formatter");
|
|
132
|
+
Object.defineProperty(exports, "formatStackInfo", { enumerable: true, get: function () { return stack_formatter_1.formatStackInfo; } });
|
|
133
|
+
// Streaming options builders moved to CLI package
|
|
134
|
+
// import from packages/cli/src/utils/streaming-options.ts instead
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// Validation
|
|
137
|
+
// ============================================================================
|
|
138
|
+
/**
|
|
139
|
+
* Validation utilities
|
|
140
|
+
*/
|
|
141
|
+
var validation_1 = require("./validation");
|
|
142
|
+
Object.defineProperty(exports, "isValidAIProvider", { enumerable: true, get: function () { return validation_1.isValidAIProvider; } });
|
|
143
|
+
Object.defineProperty(exports, "runValidations", { enumerable: true, get: function () { return validation_1.runValidations; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger - Thin wrapper that emits log events to the hooks system
|
|
3
|
+
*
|
|
4
|
+
* This decouples logging from direct console output, allowing:
|
|
5
|
+
* - CLI to render styled chalk output by subscribing to events
|
|
6
|
+
* - Web/TUI to handle logs differently
|
|
7
|
+
* - Testing without console pollution
|
|
8
|
+
*/
|
|
9
|
+
export interface Logger {
|
|
10
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
11
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
12
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
13
|
+
success(message: string, context?: Record<string, unknown>): void;
|
|
14
|
+
progress(message: string, context?: Record<string, unknown>): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Event-based logger that emits to the hooks system
|
|
18
|
+
*/
|
|
19
|
+
export declare const logger: Logger;
|
|
20
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,MAoBpB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Logger - Thin wrapper that emits log events to the hooks system
|
|
4
|
+
*
|
|
5
|
+
* This decouples logging from direct console output, allowing:
|
|
6
|
+
* - CLI to render styled chalk output by subscribing to events
|
|
7
|
+
* - Web/TUI to handle logs differently
|
|
8
|
+
* - Testing without console pollution
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.logger = void 0;
|
|
12
|
+
const hooks_1 = require("./hooks");
|
|
13
|
+
/**
|
|
14
|
+
* Event-based logger that emits to the hooks system
|
|
15
|
+
*/
|
|
16
|
+
exports.logger = {
|
|
17
|
+
info(message, context) {
|
|
18
|
+
hooks_1.hooks.emit("log:info", { message, context });
|
|
19
|
+
},
|
|
20
|
+
warn(message, context) {
|
|
21
|
+
hooks_1.hooks.emit("log:warn", { message, context });
|
|
22
|
+
},
|
|
23
|
+
error(message, context) {
|
|
24
|
+
hooks_1.hooks.emit("log:error", { message, context });
|
|
25
|
+
},
|
|
26
|
+
success(message, context) {
|
|
27
|
+
hooks_1.hooks.emit("log:success", { message, context });
|
|
28
|
+
},
|
|
29
|
+
progress(message, context) {
|
|
30
|
+
hooks_1.hooks.emit("log:progress", { message, context });
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecuteLoopResult } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Send notifications after loop completion
|
|
4
|
+
* Supports both URLs (POST request) and commands (execute with env var)
|
|
5
|
+
*/
|
|
6
|
+
export declare function sendNotifications(targets: string[], result: ExecuteLoopResult): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/lib/notifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendNotifications = sendNotifications;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const util_1 = require("util");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
7
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
8
|
+
/**
|
|
9
|
+
* Send notifications after loop completion
|
|
10
|
+
* Supports both URLs (POST request) and commands (execute with env var)
|
|
11
|
+
*/
|
|
12
|
+
async function sendNotifications(targets, result) {
|
|
13
|
+
if (!targets || targets.length === 0)
|
|
14
|
+
return;
|
|
15
|
+
const summary = {
|
|
16
|
+
totalTasks: result.totalTasks,
|
|
17
|
+
completedTasks: result.completedTasks,
|
|
18
|
+
failedTasks: result.failedTasks,
|
|
19
|
+
duration: result.duration,
|
|
20
|
+
success: result.failedTasks === 0,
|
|
21
|
+
};
|
|
22
|
+
for (const target of targets) {
|
|
23
|
+
try {
|
|
24
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
25
|
+
await postToUrl(target, result);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
await executeCommand(target, summary);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
logger_1.logger.warn(`⚠️ Notification failed for ${target}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* POST result to a URL
|
|
38
|
+
*/
|
|
39
|
+
async function postToUrl(url, result) {
|
|
40
|
+
logger_1.logger.info(`📤 Sending notification to ${url}`);
|
|
41
|
+
try {
|
|
42
|
+
const response = await fetch(url, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify(result),
|
|
48
|
+
});
|
|
49
|
+
if (response.ok) {
|
|
50
|
+
logger_1.logger.success(`✅ Notification sent to ${url}`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
logger_1.logger.warn(`⚠️ Notification to ${url} returned ${response.status}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
throw new Error(`Failed to POST to ${url}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Execute a command with result in environment variable
|
|
62
|
+
*/
|
|
63
|
+
async function executeCommand(command, summary) {
|
|
64
|
+
logger_1.logger.info(`🔔 Running notification command: ${command}`);
|
|
65
|
+
try {
|
|
66
|
+
await execAsync(command, {
|
|
67
|
+
env: {
|
|
68
|
+
...process.env,
|
|
69
|
+
TASK_LOOP_RESULT: JSON.stringify(summary),
|
|
70
|
+
TASK_LOOP_TOTAL: String(summary.totalTasks),
|
|
71
|
+
TASK_LOOP_COMPLETED: String(summary.completedTasks),
|
|
72
|
+
TASK_LOOP_FAILED: String(summary.failedTasks),
|
|
73
|
+
TASK_LOOP_SUCCESS: String(summary.success),
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
logger_1.logger.success(`✅ Notification command completed`);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
throw new Error(`Command failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { PromptMetadata } from "./prompt-registry";
|
|
2
|
+
export interface PromptBuilderOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
type?: "system" | "user";
|
|
5
|
+
variables: Record<string, string>;
|
|
6
|
+
prdContent?: string;
|
|
7
|
+
taskTitle?: string;
|
|
8
|
+
taskDescription?: string;
|
|
9
|
+
stackInfo?: string;
|
|
10
|
+
contextInfo?: string;
|
|
11
|
+
userFeedback?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PromptBuilderResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
prompt?: string;
|
|
16
|
+
metadata?: PromptMetadata;
|
|
17
|
+
error?: string;
|
|
18
|
+
missingVariables?: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare class PromptBuilder {
|
|
21
|
+
/**
|
|
22
|
+
* Build a prompt with variable replacement
|
|
23
|
+
*/
|
|
24
|
+
static buildPrompt(options: PromptBuilderOptions): PromptBuilderResult;
|
|
25
|
+
/**
|
|
26
|
+
* List all available prompts
|
|
27
|
+
*/
|
|
28
|
+
static listPrompts(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get metadata for a specific prompt
|
|
31
|
+
*/
|
|
32
|
+
static getPromptMetadata(name: string, type?: "system" | "user"): PromptMetadata | null;
|
|
33
|
+
/**
|
|
34
|
+
* Load PRD content from file
|
|
35
|
+
*/
|
|
36
|
+
static loadPRDContent(filePath: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Auto-detect and load PRD content from project
|
|
39
|
+
*/
|
|
40
|
+
static autoDetectPRDContent(): Promise<string | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Build task context from file or content using ContextBuilder
|
|
43
|
+
*/
|
|
44
|
+
static buildTaskContext(taskTitle: string, content?: string, filePath?: string): Promise<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Detect stack info using ContextBuilder (proper BTS config loading)
|
|
47
|
+
*/
|
|
48
|
+
static detectStackInfo(projectPath?: string): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Build comprehensive project context for external executors
|
|
51
|
+
*/
|
|
52
|
+
static buildFullProjectContext(projectPath: string): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Format prompt for specific executor
|
|
55
|
+
*/
|
|
56
|
+
static formatForExecutor(prompt: string, executor: "opencode" | "claude" | "gemini" | "codex"): string;
|
|
57
|
+
/**
|
|
58
|
+
* Build execution prompt with task context
|
|
59
|
+
*/
|
|
60
|
+
static buildExecutionPrompt(options: {
|
|
61
|
+
taskTitle: string;
|
|
62
|
+
taskDescription?: string;
|
|
63
|
+
taskPlan?: string;
|
|
64
|
+
stack?: any;
|
|
65
|
+
documentation?: any;
|
|
66
|
+
retryContext?: string;
|
|
67
|
+
prdContent?: string;
|
|
68
|
+
}): PromptBuilderResult;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;IAiFtE;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,MAAM;IAI5B;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GACvB,cAAc,GAAG,IAAI;IAKxB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO/C;;OAEG;WACU,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAiBhE;;OAEG;WACU,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;IAkClB;;OAEG;WACU,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwCnE;;OAEG;WACU,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA4G1E;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GACnD,MAAM;IAoBT;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE;QACnC,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,aAAa,CAAC,EAAE,GAAG,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,mBAAmB;CA6ExB"}
|