attocode 0.2.3 → 0.2.5
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/CHANGELOG.md +122 -1
- package/README.md +65 -5
- package/dist/src/adapters.d.ts +2 -1
- package/dist/src/adapters.d.ts.map +1 -1
- package/dist/src/adapters.js +74 -12
- package/dist/src/adapters.js.map +1 -1
- package/dist/src/agent/agent-builder.d.ts +117 -0
- package/dist/src/agent/agent-builder.d.ts.map +1 -0
- package/dist/src/agent/agent-builder.js +204 -0
- package/dist/src/agent/agent-builder.js.map +1 -0
- package/dist/src/agent/feature-initializer.d.ts +80 -0
- package/dist/src/agent/feature-initializer.d.ts.map +1 -0
- package/dist/src/agent/feature-initializer.js +677 -0
- package/dist/src/agent/feature-initializer.js.map +1 -0
- package/dist/src/agent/index.d.ts +13 -0
- package/dist/src/agent/index.d.ts.map +1 -0
- package/dist/src/agent/index.js +13 -0
- package/dist/src/agent/index.js.map +1 -0
- package/dist/src/agent/message-builder.d.ts +50 -0
- package/dist/src/agent/message-builder.d.ts.map +1 -0
- package/dist/src/agent/message-builder.js +173 -0
- package/dist/src/agent/message-builder.js.map +1 -0
- package/dist/src/agent/session-api.d.ts +94 -0
- package/dist/src/agent/session-api.d.ts.map +1 -0
- package/dist/src/agent/session-api.js +262 -0
- package/dist/src/agent/session-api.js.map +1 -0
- package/dist/src/agent-tools/lsp-file-tools.d.ts +1 -1
- package/dist/src/agent-tools/lsp-file-tools.d.ts.map +1 -1
- package/dist/src/agent.d.ts +52 -213
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +544 -4072
- package/dist/src/agent.js.map +1 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +2 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/handler.d.ts.map +1 -1
- package/dist/src/commands/handler.js +18 -9
- package/dist/src/commands/handler.js.map +1 -1
- package/dist/src/commands/init-commands.d.ts.map +1 -1
- package/dist/src/commands/init-commands.js +16 -1
- package/dist/src/commands/init-commands.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +31 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/config/base-types.d.ts +45 -0
- package/dist/src/config/base-types.d.ts.map +1 -0
- package/dist/src/config/base-types.js +9 -0
- package/dist/src/config/base-types.js.map +1 -0
- package/dist/src/config/config-manager.d.ts +35 -0
- package/dist/src/config/config-manager.d.ts.map +1 -0
- package/dist/src/config/config-manager.js +108 -0
- package/dist/src/config/config-manager.js.map +1 -0
- package/dist/src/config/index.d.ts +4 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +3 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/schema.d.ts +1546 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +268 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/config.d.ts +4 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -12
- package/dist/src/config.js.map +1 -1
- package/dist/src/core/agent-state-machine.d.ts +131 -0
- package/dist/src/core/agent-state-machine.d.ts.map +1 -0
- package/dist/src/core/agent-state-machine.js +302 -0
- package/dist/src/core/agent-state-machine.js.map +1 -0
- package/dist/src/core/base-manager.d.ts +79 -0
- package/dist/src/core/base-manager.d.ts.map +1 -0
- package/dist/src/core/base-manager.js +170 -0
- package/dist/src/core/base-manager.js.map +1 -0
- package/dist/src/core/completion-analyzer.d.ts +15 -0
- package/dist/src/core/completion-analyzer.d.ts.map +1 -0
- package/dist/src/core/completion-analyzer.js +53 -0
- package/dist/src/core/completion-analyzer.js.map +1 -0
- package/dist/src/core/execution-loop.d.ts +46 -0
- package/dist/src/core/execution-loop.d.ts.map +1 -0
- package/dist/src/core/execution-loop.js +1397 -0
- package/dist/src/core/execution-loop.js.map +1 -0
- package/dist/src/core/index.d.ts +7 -0
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/index.js +9 -0
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/core/process-handlers.d.ts.map +1 -1
- package/dist/src/core/process-handlers.js +14 -0
- package/dist/src/core/process-handlers.js.map +1 -1
- package/dist/src/core/protocol/types.d.ts +12 -12
- package/dist/src/core/response-handler.d.ts +16 -0
- package/dist/src/core/response-handler.d.ts.map +1 -0
- package/dist/src/core/response-handler.js +235 -0
- package/dist/src/core/response-handler.js.map +1 -0
- package/dist/src/core/subagent-spawner.d.ts +43 -0
- package/dist/src/core/subagent-spawner.d.ts.map +1 -0
- package/dist/src/core/subagent-spawner.js +973 -0
- package/dist/src/core/subagent-spawner.js.map +1 -0
- package/dist/src/core/tool-executor.d.ts +59 -0
- package/dist/src/core/tool-executor.d.ts.map +1 -0
- package/dist/src/core/tool-executor.js +682 -0
- package/dist/src/core/tool-executor.js.map +1 -0
- package/dist/src/core/types.d.ts +134 -0
- package/dist/src/core/types.d.ts.map +1 -0
- package/dist/src/core/types.js +12 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/defaults.d.ts +2 -2
- package/dist/src/defaults.d.ts.map +1 -1
- package/dist/src/defaults.js +29 -1
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/integrations/agents/agent-registry.d.ts +262 -0
- package/dist/src/integrations/agents/agent-registry.d.ts.map +1 -0
- package/dist/src/integrations/agents/agent-registry.js +686 -0
- package/dist/src/integrations/agents/agent-registry.js.map +1 -0
- package/dist/src/integrations/agents/async-subagent.d.ts +135 -0
- package/dist/src/integrations/agents/async-subagent.d.ts.map +1 -0
- package/dist/src/integrations/agents/async-subagent.js +213 -0
- package/dist/src/integrations/agents/async-subagent.js.map +1 -0
- package/dist/src/integrations/agents/complexity-classifier.d.ts +86 -0
- package/dist/src/integrations/agents/complexity-classifier.d.ts.map +1 -0
- package/dist/src/integrations/agents/complexity-classifier.js +233 -0
- package/dist/src/integrations/agents/complexity-classifier.js.map +1 -0
- package/dist/src/integrations/agents/delegation-protocol.d.ts +86 -0
- package/dist/src/integrations/agents/delegation-protocol.d.ts.map +1 -0
- package/dist/src/integrations/agents/delegation-protocol.js +127 -0
- package/dist/src/integrations/agents/delegation-protocol.js.map +1 -0
- package/dist/src/integrations/agents/multi-agent.d.ts +150 -0
- package/dist/src/integrations/agents/multi-agent.d.ts.map +1 -0
- package/dist/src/integrations/agents/multi-agent.js +306 -0
- package/dist/src/integrations/agents/multi-agent.js.map +1 -0
- package/dist/src/integrations/agents/result-synthesizer.d.ts +389 -0
- package/dist/src/integrations/agents/result-synthesizer.d.ts.map +1 -0
- package/dist/src/integrations/agents/result-synthesizer.js +951 -0
- package/dist/src/integrations/agents/result-synthesizer.js.map +1 -0
- package/dist/src/integrations/agents/shared-blackboard.d.ts +406 -0
- package/dist/src/integrations/agents/shared-blackboard.d.ts.map +1 -0
- package/dist/src/integrations/agents/shared-blackboard.js +757 -0
- package/dist/src/integrations/agents/shared-blackboard.js.map +1 -0
- package/dist/src/integrations/agents/subagent-output-store.d.ts +91 -0
- package/dist/src/integrations/agents/subagent-output-store.d.ts.map +1 -0
- package/dist/src/integrations/agents/subagent-output-store.js +257 -0
- package/dist/src/integrations/agents/subagent-output-store.js.map +1 -0
- package/dist/src/integrations/auto-compaction.d.ts.map +1 -1
- package/dist/src/integrations/auto-compaction.js +3 -2
- package/dist/src/integrations/auto-compaction.js.map +1 -1
- package/dist/src/integrations/budget/budget-pool.d.ts +115 -0
- package/dist/src/integrations/budget/budget-pool.d.ts.map +1 -0
- package/dist/src/integrations/budget/budget-pool.js +205 -0
- package/dist/src/integrations/budget/budget-pool.js.map +1 -0
- package/dist/src/integrations/budget/cancellation.d.ts +229 -0
- package/dist/src/integrations/budget/cancellation.d.ts.map +1 -0
- package/dist/src/integrations/budget/cancellation.js +520 -0
- package/dist/src/integrations/budget/cancellation.js.map +1 -0
- package/dist/src/integrations/budget/dynamic-budget.d.ts +81 -0
- package/dist/src/integrations/budget/dynamic-budget.d.ts.map +1 -0
- package/dist/src/integrations/budget/dynamic-budget.js +151 -0
- package/dist/src/integrations/budget/dynamic-budget.js.map +1 -0
- package/dist/src/integrations/budget/economics.d.ts +435 -0
- package/dist/src/integrations/budget/economics.d.ts.map +1 -0
- package/dist/src/integrations/budget/economics.js +1007 -0
- package/dist/src/integrations/budget/economics.js.map +1 -0
- package/dist/src/integrations/budget/injection-budget.d.ts +71 -0
- package/dist/src/integrations/budget/injection-budget.d.ts.map +1 -0
- package/dist/src/integrations/budget/injection-budget.js +137 -0
- package/dist/src/integrations/budget/injection-budget.js.map +1 -0
- package/dist/src/integrations/budget/loop-detector.d.ts +105 -0
- package/dist/src/integrations/budget/loop-detector.d.ts.map +1 -0
- package/dist/src/integrations/budget/loop-detector.js +287 -0
- package/dist/src/integrations/budget/loop-detector.js.map +1 -0
- package/dist/src/integrations/budget/phase-tracker.d.ts +114 -0
- package/dist/src/integrations/budget/phase-tracker.d.ts.map +1 -0
- package/dist/src/integrations/budget/phase-tracker.js +262 -0
- package/dist/src/integrations/budget/phase-tracker.js.map +1 -0
- package/dist/src/integrations/budget/resources.d.ts +182 -0
- package/dist/src/integrations/budget/resources.d.ts.map +1 -0
- package/dist/src/integrations/budget/resources.js +318 -0
- package/dist/src/integrations/budget/resources.js.map +1 -0
- package/dist/src/integrations/budget-pool.d.ts +7 -0
- package/dist/src/integrations/budget-pool.d.ts.map +1 -1
- package/dist/src/integrations/budget-pool.js +43 -0
- package/dist/src/integrations/budget-pool.js.map +1 -1
- package/dist/src/integrations/codebase-ast.d.ts +52 -0
- package/dist/src/integrations/codebase-ast.d.ts.map +1 -0
- package/dist/src/integrations/codebase-ast.js +457 -0
- package/dist/src/integrations/codebase-ast.js.map +1 -0
- package/dist/src/integrations/codebase-context.d.ts +18 -0
- package/dist/src/integrations/codebase-context.d.ts.map +1 -1
- package/dist/src/integrations/codebase-context.js +197 -17
- package/dist/src/integrations/codebase-context.js.map +1 -1
- package/dist/src/integrations/compaction.d.ts.map +1 -1
- package/dist/src/integrations/compaction.js +14 -6
- package/dist/src/integrations/compaction.js.map +1 -1
- package/dist/src/integrations/context/auto-compaction.d.ts +210 -0
- package/dist/src/integrations/context/auto-compaction.d.ts.map +1 -0
- package/dist/src/integrations/context/auto-compaction.js +477 -0
- package/dist/src/integrations/context/auto-compaction.js.map +1 -0
- package/dist/src/integrations/context/code-analyzer.d.ts +71 -0
- package/dist/src/integrations/context/code-analyzer.d.ts.map +1 -0
- package/dist/src/integrations/context/code-analyzer.js +448 -0
- package/dist/src/integrations/context/code-analyzer.js.map +1 -0
- package/dist/src/integrations/context/code-selector.d.ts +78 -0
- package/dist/src/integrations/context/code-selector.d.ts.map +1 -0
- package/dist/src/integrations/context/code-selector.js +649 -0
- package/dist/src/integrations/context/code-selector.js.map +1 -0
- package/dist/src/integrations/context/codebase-ast.d.ts +138 -0
- package/dist/src/integrations/context/codebase-ast.d.ts.map +1 -0
- package/dist/src/integrations/context/codebase-ast.js +818 -0
- package/dist/src/integrations/context/codebase-ast.js.map +1 -0
- package/dist/src/integrations/context/codebase-context.d.ts +473 -0
- package/dist/src/integrations/context/codebase-context.d.ts.map +1 -0
- package/dist/src/integrations/context/codebase-context.js +685 -0
- package/dist/src/integrations/context/codebase-context.js.map +1 -0
- package/dist/src/integrations/context/compaction.d.ts +191 -0
- package/dist/src/integrations/context/compaction.d.ts.map +1 -0
- package/dist/src/integrations/context/compaction.js +384 -0
- package/dist/src/integrations/context/compaction.js.map +1 -0
- package/dist/src/integrations/context/context-engineering.d.ts +274 -0
- package/dist/src/integrations/context/context-engineering.d.ts.map +1 -0
- package/dist/src/integrations/context/context-engineering.js +437 -0
- package/dist/src/integrations/context/context-engineering.js.map +1 -0
- package/dist/src/integrations/context/file-cache.d.ts +97 -0
- package/dist/src/integrations/context/file-cache.d.ts.map +1 -0
- package/dist/src/integrations/context/file-cache.js +218 -0
- package/dist/src/integrations/context/file-cache.js.map +1 -0
- package/dist/src/integrations/context/semantic-cache.d.ts +178 -0
- package/dist/src/integrations/context/semantic-cache.d.ts.map +1 -0
- package/dist/src/integrations/context/semantic-cache.js +372 -0
- package/dist/src/integrations/context/semantic-cache.js.map +1 -0
- package/dist/src/integrations/context-engineering.d.ts +8 -0
- package/dist/src/integrations/context-engineering.d.ts.map +1 -1
- package/dist/src/integrations/context-engineering.js +19 -0
- package/dist/src/integrations/context-engineering.js.map +1 -1
- package/dist/src/integrations/economics.d.ts +25 -1
- package/dist/src/integrations/economics.d.ts.map +1 -1
- package/dist/src/integrations/economics.js +217 -38
- package/dist/src/integrations/economics.js.map +1 -1
- package/dist/src/integrations/edit-validator.d.ts +30 -0
- package/dist/src/integrations/edit-validator.d.ts.map +1 -0
- package/dist/src/integrations/edit-validator.js +85 -0
- package/dist/src/integrations/edit-validator.js.map +1 -0
- package/dist/src/integrations/file-cache.d.ts +7 -0
- package/dist/src/integrations/file-cache.d.ts.map +1 -1
- package/dist/src/integrations/file-cache.js +54 -0
- package/dist/src/integrations/file-cache.js.map +1 -1
- package/dist/src/integrations/health-check.d.ts.map +1 -1
- package/dist/src/integrations/health-check.js +3 -2
- package/dist/src/integrations/health-check.js.map +1 -1
- package/dist/src/integrations/hierarchical-config.d.ts +3 -0
- package/dist/src/integrations/hierarchical-config.d.ts.map +1 -1
- package/dist/src/integrations/hierarchical-config.js +3 -0
- package/dist/src/integrations/hierarchical-config.js.map +1 -1
- package/dist/src/integrations/hooks.d.ts +2 -0
- package/dist/src/integrations/hooks.d.ts.map +1 -1
- package/dist/src/integrations/hooks.js +99 -15
- package/dist/src/integrations/hooks.js.map +1 -1
- package/dist/src/integrations/index.d.ts +77 -66
- package/dist/src/integrations/index.d.ts.map +1 -1
- package/dist/src/integrations/index.js +83 -67
- package/dist/src/integrations/index.js.map +1 -1
- package/dist/src/integrations/logger.d.ts +104 -0
- package/dist/src/integrations/logger.d.ts.map +1 -0
- package/dist/src/integrations/logger.js +219 -0
- package/dist/src/integrations/logger.js.map +1 -0
- package/dist/src/integrations/lsp/lsp.d.ts +196 -0
- package/dist/src/integrations/lsp/lsp.d.ts.map +1 -0
- package/dist/src/integrations/lsp/lsp.js +583 -0
- package/dist/src/integrations/lsp/lsp.js.map +1 -0
- package/dist/src/integrations/lsp.d.ts.map +1 -1
- package/dist/src/integrations/lsp.js +5 -4
- package/dist/src/integrations/lsp.js.map +1 -1
- package/dist/src/integrations/mcp/mcp-client.d.ts +279 -0
- package/dist/src/integrations/mcp/mcp-client.d.ts.map +1 -0
- package/dist/src/integrations/mcp/mcp-client.js +755 -0
- package/dist/src/integrations/mcp/mcp-client.js.map +1 -0
- package/dist/src/integrations/mcp/mcp-custom-tools.d.ts +102 -0
- package/dist/src/integrations/mcp/mcp-custom-tools.d.ts.map +1 -0
- package/dist/src/integrations/mcp/mcp-custom-tools.js +232 -0
- package/dist/src/integrations/mcp/mcp-custom-tools.js.map +1 -0
- package/dist/src/integrations/mcp/mcp-tool-search.d.ts +77 -0
- package/dist/src/integrations/mcp/mcp-tool-search.d.ts.map +1 -0
- package/dist/src/integrations/mcp/mcp-tool-search.js +220 -0
- package/dist/src/integrations/mcp/mcp-tool-search.js.map +1 -0
- package/dist/src/integrations/mcp/mcp-tool-validator.d.ts +60 -0
- package/dist/src/integrations/mcp/mcp-tool-validator.d.ts.map +1 -0
- package/dist/src/integrations/mcp/mcp-tool-validator.js +141 -0
- package/dist/src/integrations/mcp/mcp-tool-validator.js.map +1 -0
- package/dist/src/integrations/mcp-client.d.ts.map +1 -1
- package/dist/src/integrations/mcp-client.js +8 -7
- package/dist/src/integrations/mcp-client.js.map +1 -1
- package/dist/src/integrations/observability.d.ts.map +1 -1
- package/dist/src/integrations/observability.js +5 -4
- package/dist/src/integrations/observability.js.map +1 -1
- package/dist/src/integrations/openrouter-pricing.d.ts.map +1 -1
- package/dist/src/integrations/openrouter-pricing.js +4 -3
- package/dist/src/integrations/openrouter-pricing.js.map +1 -1
- package/dist/src/integrations/persistence/codebase-repository.d.ts +45 -0
- package/dist/src/integrations/persistence/codebase-repository.d.ts.map +1 -0
- package/dist/src/integrations/persistence/codebase-repository.js +81 -0
- package/dist/src/integrations/persistence/codebase-repository.js.map +1 -0
- package/dist/src/integrations/persistence/goal-repository.d.ts +71 -0
- package/dist/src/integrations/persistence/goal-repository.d.ts.map +1 -0
- package/dist/src/integrations/persistence/goal-repository.js +184 -0
- package/dist/src/integrations/persistence/goal-repository.js.map +1 -0
- package/dist/src/integrations/persistence/history.d.ts +72 -0
- package/dist/src/integrations/persistence/history.d.ts.map +1 -0
- package/dist/src/integrations/persistence/history.js +165 -0
- package/dist/src/integrations/persistence/history.js.map +1 -0
- package/dist/src/integrations/persistence/persistence.d.ts +49 -0
- package/dist/src/integrations/persistence/persistence.d.ts.map +1 -0
- package/dist/src/integrations/persistence/persistence.js +197 -0
- package/dist/src/integrations/persistence/persistence.js.map +1 -0
- package/dist/src/integrations/persistence/session-repository.d.ts +212 -0
- package/dist/src/integrations/persistence/session-repository.d.ts.map +1 -0
- package/dist/src/integrations/persistence/session-repository.js +770 -0
- package/dist/src/integrations/persistence/session-repository.js.map +1 -0
- package/dist/src/integrations/persistence/session-store.d.ts +184 -0
- package/dist/src/integrations/persistence/session-store.d.ts.map +1 -0
- package/dist/src/integrations/persistence/session-store.js +346 -0
- package/dist/src/integrations/persistence/session-store.js.map +1 -0
- package/dist/src/integrations/persistence/sqlite-store.d.ts +453 -0
- package/dist/src/integrations/persistence/sqlite-store.d.ts.map +1 -0
- package/dist/src/integrations/persistence/sqlite-store.js +676 -0
- package/dist/src/integrations/persistence/sqlite-store.js.map +1 -0
- package/dist/src/integrations/persistence/worker-repository.d.ts +65 -0
- package/dist/src/integrations/persistence/worker-repository.d.ts.map +1 -0
- package/dist/src/integrations/persistence/worker-repository.js +183 -0
- package/dist/src/integrations/persistence/worker-repository.js.map +1 -0
- package/dist/src/integrations/persistence.d.ts.map +1 -1
- package/dist/src/integrations/persistence.js +5 -4
- package/dist/src/integrations/persistence.js.map +1 -1
- package/dist/src/integrations/planning.d.ts.map +1 -1
- package/dist/src/integrations/planning.js +5 -4
- package/dist/src/integrations/planning.js.map +1 -1
- package/dist/src/integrations/quality/auto-checkpoint.d.ts +98 -0
- package/dist/src/integrations/quality/auto-checkpoint.d.ts.map +1 -0
- package/dist/src/integrations/quality/auto-checkpoint.js +252 -0
- package/dist/src/integrations/quality/auto-checkpoint.js.map +1 -0
- package/dist/src/integrations/quality/dead-letter-queue.d.ts +233 -0
- package/dist/src/integrations/quality/dead-letter-queue.d.ts.map +1 -0
- package/dist/src/integrations/quality/dead-letter-queue.js +543 -0
- package/dist/src/integrations/quality/dead-letter-queue.js.map +1 -0
- package/dist/src/integrations/quality/health-check.d.ts +218 -0
- package/dist/src/integrations/quality/health-check.d.ts.map +1 -0
- package/dist/src/integrations/quality/health-check.js +415 -0
- package/dist/src/integrations/quality/health-check.js.map +1 -0
- package/dist/src/integrations/quality/learning-store.d.ts +291 -0
- package/dist/src/integrations/quality/learning-store.d.ts.map +1 -0
- package/dist/src/integrations/quality/learning-store.js +646 -0
- package/dist/src/integrations/quality/learning-store.js.map +1 -0
- package/dist/src/integrations/quality/self-improvement.d.ts +90 -0
- package/dist/src/integrations/quality/self-improvement.d.ts.map +1 -0
- package/dist/src/integrations/quality/self-improvement.js +229 -0
- package/dist/src/integrations/quality/self-improvement.js.map +1 -0
- package/dist/src/integrations/quality/tool-recommendation.d.ts +61 -0
- package/dist/src/integrations/quality/tool-recommendation.d.ts.map +1 -0
- package/dist/src/integrations/quality/tool-recommendation.js +268 -0
- package/dist/src/integrations/quality/tool-recommendation.js.map +1 -0
- package/dist/src/integrations/retry.d.ts +1 -0
- package/dist/src/integrations/retry.d.ts.map +1 -1
- package/dist/src/integrations/retry.js.map +1 -1
- package/dist/src/integrations/routing.d.ts.map +1 -1
- package/dist/src/integrations/routing.js +2 -1
- package/dist/src/integrations/routing.js.map +1 -1
- package/dist/src/integrations/safety/bash-policy.d.ts +33 -0
- package/dist/src/integrations/safety/bash-policy.d.ts.map +1 -0
- package/dist/src/integrations/safety/bash-policy.js +144 -0
- package/dist/src/integrations/safety/bash-policy.js.map +1 -0
- package/dist/src/integrations/safety/edit-validator.d.ts +30 -0
- package/dist/src/integrations/safety/edit-validator.d.ts.map +1 -0
- package/dist/src/integrations/safety/edit-validator.js +87 -0
- package/dist/src/integrations/safety/edit-validator.js.map +1 -0
- package/dist/src/integrations/safety/execution-policy.d.ts +189 -0
- package/dist/src/integrations/safety/execution-policy.d.ts.map +1 -0
- package/dist/src/integrations/safety/execution-policy.js +352 -0
- package/dist/src/integrations/safety/execution-policy.js.map +1 -0
- package/dist/src/integrations/safety/policy-engine.d.ts +55 -0
- package/dist/src/integrations/safety/policy-engine.d.ts.map +1 -0
- package/dist/src/integrations/safety/policy-engine.js +247 -0
- package/dist/src/integrations/safety/policy-engine.js.map +1 -0
- package/dist/src/integrations/safety/safety.d.ts +174 -0
- package/dist/src/integrations/safety/safety.d.ts.map +1 -0
- package/dist/src/integrations/safety/safety.js +470 -0
- package/dist/src/integrations/safety/safety.js.map +1 -0
- package/dist/src/integrations/safety/sandbox/basic.d.ts +81 -0
- package/dist/src/integrations/safety/sandbox/basic.d.ts.map +1 -0
- package/dist/src/integrations/safety/sandbox/basic.js +335 -0
- package/dist/src/integrations/safety/sandbox/basic.js.map +1 -0
- package/dist/src/integrations/safety/sandbox/docker.d.ts +94 -0
- package/dist/src/integrations/safety/sandbox/docker.d.ts.map +1 -0
- package/dist/src/integrations/safety/sandbox/docker.js +294 -0
- package/dist/src/integrations/safety/sandbox/docker.js.map +1 -0
- package/dist/src/integrations/safety/sandbox/index.d.ts +188 -0
- package/dist/src/integrations/safety/sandbox/index.d.ts.map +1 -0
- package/dist/src/integrations/safety/sandbox/index.js +386 -0
- package/dist/src/integrations/safety/sandbox/index.js.map +1 -0
- package/dist/src/integrations/safety/sandbox/landlock.d.ts +59 -0
- package/dist/src/integrations/safety/sandbox/landlock.d.ts.map +1 -0
- package/dist/src/integrations/safety/sandbox/landlock.js +329 -0
- package/dist/src/integrations/safety/sandbox/landlock.js.map +1 -0
- package/dist/src/integrations/safety/sandbox/seatbelt.d.ts +68 -0
- package/dist/src/integrations/safety/sandbox/seatbelt.d.ts.map +1 -0
- package/dist/src/integrations/safety/sandbox/seatbelt.js +298 -0
- package/dist/src/integrations/safety/sandbox/seatbelt.js.map +1 -0
- package/dist/src/integrations/safety/type-checker.d.ts +53 -0
- package/dist/src/integrations/safety/type-checker.d.ts.map +1 -0
- package/dist/src/integrations/safety/type-checker.js +142 -0
- package/dist/src/integrations/safety/type-checker.js.map +1 -0
- package/dist/src/integrations/safety.d.ts.map +1 -1
- package/dist/src/integrations/safety.js +13 -13
- package/dist/src/integrations/safety.js.map +1 -1
- package/dist/src/integrations/sandbox/docker.d.ts.map +1 -1
- package/dist/src/integrations/sandbox/docker.js +2 -1
- package/dist/src/integrations/sandbox/docker.js.map +1 -1
- package/dist/src/integrations/sandbox/index.d.ts.map +1 -1
- package/dist/src/integrations/sandbox/index.js +5 -4
- package/dist/src/integrations/sandbox/index.js.map +1 -1
- package/dist/src/integrations/session-store.d.ts +1 -0
- package/dist/src/integrations/session-store.d.ts.map +1 -1
- package/dist/src/integrations/session-store.js +1 -0
- package/dist/src/integrations/session-store.js.map +1 -1
- package/dist/src/integrations/shared-blackboard.d.ts +3 -0
- package/dist/src/integrations/shared-blackboard.d.ts.map +1 -1
- package/dist/src/integrations/shared-blackboard.js +47 -0
- package/dist/src/integrations/shared-blackboard.js.map +1 -1
- package/dist/src/integrations/skills/skill-executor.d.ts +113 -0
- package/dist/src/integrations/skills/skill-executor.d.ts.map +1 -0
- package/dist/src/integrations/skills/skill-executor.js +270 -0
- package/dist/src/integrations/skills/skill-executor.js.map +1 -0
- package/dist/src/integrations/skills/skills.d.ts +262 -0
- package/dist/src/integrations/skills/skills.d.ts.map +1 -0
- package/dist/src/integrations/skills/skills.js +602 -0
- package/dist/src/integrations/skills/skills.js.map +1 -0
- package/dist/src/integrations/smart-decomposer.d.ts +27 -0
- package/dist/src/integrations/smart-decomposer.d.ts.map +1 -1
- package/dist/src/integrations/smart-decomposer.js +414 -30
- package/dist/src/integrations/smart-decomposer.js.map +1 -1
- package/dist/src/integrations/sqlite-store.d.ts +2 -0
- package/dist/src/integrations/sqlite-store.d.ts.map +1 -1
- package/dist/src/integrations/sqlite-store.js +18 -6
- package/dist/src/integrations/sqlite-store.js.map +1 -1
- package/dist/src/integrations/streaming/pty-shell.d.ts +169 -0
- package/dist/src/integrations/streaming/pty-shell.d.ts.map +1 -0
- package/dist/src/integrations/streaming/pty-shell.js +367 -0
- package/dist/src/integrations/streaming/pty-shell.js.map +1 -0
- package/dist/src/integrations/streaming/streaming.d.ts +102 -0
- package/dist/src/integrations/streaming/streaming.d.ts.map +1 -0
- package/dist/src/integrations/streaming/streaming.js +362 -0
- package/dist/src/integrations/streaming/streaming.js.map +1 -0
- package/dist/src/integrations/swarm/failure-classifier.d.ts +11 -0
- package/dist/src/integrations/swarm/failure-classifier.d.ts.map +1 -0
- package/dist/src/integrations/swarm/failure-classifier.js +95 -0
- package/dist/src/integrations/swarm/failure-classifier.js.map +1 -0
- package/dist/src/integrations/swarm/index.d.ts +2 -1
- package/dist/src/integrations/swarm/index.d.ts.map +1 -1
- package/dist/src/integrations/swarm/index.js +2 -0
- package/dist/src/integrations/swarm/index.js.map +1 -1
- package/dist/src/integrations/swarm/model-selector.d.ts.map +1 -1
- package/dist/src/integrations/swarm/model-selector.js +2 -1
- package/dist/src/integrations/swarm/model-selector.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-budget.d.ts +1 -1
- package/dist/src/integrations/swarm/swarm-budget.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-budget.js +1 -1
- package/dist/src/integrations/swarm/swarm-budget.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-config-loader.d.ts +8 -0
- package/dist/src/integrations/swarm/swarm-config-loader.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-config-loader.js +102 -0
- package/dist/src/integrations/swarm/swarm-config-loader.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-event-bridge.d.ts +74 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-event-bridge.js +37 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-events.d.ts +4 -1
- package/dist/src/integrations/swarm/swarm-events.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-events.js +1 -1
- package/dist/src/integrations/swarm/swarm-events.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-execution.d.ts +27 -0
- package/dist/src/integrations/swarm/swarm-execution.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-execution.js +1021 -0
- package/dist/src/integrations/swarm/swarm-execution.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-helpers.d.ts +26 -0
- package/dist/src/integrations/swarm/swarm-helpers.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-helpers.js +95 -0
- package/dist/src/integrations/swarm/swarm-helpers.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-lifecycle.d.ts +100 -0
- package/dist/src/integrations/swarm/swarm-lifecycle.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-lifecycle.js +922 -0
- package/dist/src/integrations/swarm/swarm-lifecycle.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-orchestrator.d.ts +96 -192
- package/dist/src/integrations/swarm/swarm-orchestrator.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-orchestrator.js +384 -2528
- package/dist/src/integrations/swarm/swarm-orchestrator.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-quality-gate.js +1 -1
- package/dist/src/integrations/swarm/swarm-quality-gate.js.map +1 -1
- package/dist/src/integrations/swarm/swarm-recovery.d.ts +75 -0
- package/dist/src/integrations/swarm/swarm-recovery.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-recovery.js +550 -0
- package/dist/src/integrations/swarm/swarm-recovery.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-state-store.d.ts +4 -1
- package/dist/src/integrations/swarm/swarm-state-store.d.ts.map +1 -1
- package/dist/src/integrations/swarm/swarm-state-store.js +14 -1
- package/dist/src/integrations/swarm/swarm-state-store.js.map +1 -1
- package/dist/src/integrations/swarm/task-queue.d.ts +11 -1
- package/dist/src/integrations/swarm/task-queue.d.ts.map +1 -1
- package/dist/src/integrations/swarm/task-queue.js +64 -2
- package/dist/src/integrations/swarm/task-queue.js.map +1 -1
- package/dist/src/integrations/swarm/types.d.ts +57 -4
- package/dist/src/integrations/swarm/types.d.ts.map +1 -1
- package/dist/src/integrations/swarm/types.js +9 -0
- package/dist/src/integrations/swarm/types.js.map +1 -1
- package/dist/src/integrations/swarm/worker-pool.d.ts +13 -3
- package/dist/src/integrations/swarm/worker-pool.d.ts.map +1 -1
- package/dist/src/integrations/swarm/worker-pool.js +66 -13
- package/dist/src/integrations/swarm/worker-pool.js.map +1 -1
- package/dist/src/integrations/task-manager.d.ts +33 -1
- package/dist/src/integrations/task-manager.d.ts.map +1 -1
- package/dist/src/integrations/task-manager.js +78 -4
- package/dist/src/integrations/task-manager.js.map +1 -1
- package/dist/src/integrations/tasks/dependency-analyzer.d.ts +34 -0
- package/dist/src/integrations/tasks/dependency-analyzer.d.ts.map +1 -0
- package/dist/src/integrations/tasks/dependency-analyzer.js +232 -0
- package/dist/src/integrations/tasks/dependency-analyzer.js.map +1 -0
- package/dist/src/integrations/tasks/interactive-planning.d.ts +322 -0
- package/dist/src/integrations/tasks/interactive-planning.d.ts.map +1 -0
- package/dist/src/integrations/tasks/interactive-planning.js +655 -0
- package/dist/src/integrations/tasks/interactive-planning.js.map +1 -0
- package/dist/src/integrations/tasks/pending-plan.d.ts +196 -0
- package/dist/src/integrations/tasks/pending-plan.d.ts.map +1 -0
- package/dist/src/integrations/tasks/pending-plan.js +431 -0
- package/dist/src/integrations/tasks/pending-plan.js.map +1 -0
- package/dist/src/integrations/tasks/planning.d.ts +115 -0
- package/dist/src/integrations/tasks/planning.d.ts.map +1 -0
- package/dist/src/integrations/tasks/planning.js +413 -0
- package/dist/src/integrations/tasks/planning.js.map +1 -0
- package/dist/src/integrations/tasks/smart-decomposer.d.ts +316 -0
- package/dist/src/integrations/tasks/smart-decomposer.d.ts.map +1 -0
- package/dist/src/integrations/tasks/smart-decomposer.js +661 -0
- package/dist/src/integrations/tasks/smart-decomposer.js.map +1 -0
- package/dist/src/integrations/tasks/task-manager.d.ts +164 -0
- package/dist/src/integrations/tasks/task-manager.d.ts.map +1 -0
- package/dist/src/integrations/tasks/task-manager.js +383 -0
- package/dist/src/integrations/tasks/task-manager.js.map +1 -0
- package/dist/src/integrations/tasks/task-splitter.d.ts +56 -0
- package/dist/src/integrations/tasks/task-splitter.d.ts.map +1 -0
- package/dist/src/integrations/tasks/task-splitter.js +537 -0
- package/dist/src/integrations/tasks/task-splitter.js.map +1 -0
- package/dist/src/integrations/tasks/verification-gate.d.ts +103 -0
- package/dist/src/integrations/tasks/verification-gate.d.ts.map +1 -0
- package/dist/src/integrations/tasks/verification-gate.js +193 -0
- package/dist/src/integrations/tasks/verification-gate.js.map +1 -0
- package/dist/src/integrations/tasks/work-log.d.ts +87 -0
- package/dist/src/integrations/tasks/work-log.d.ts.map +1 -0
- package/dist/src/integrations/tasks/work-log.js +275 -0
- package/dist/src/integrations/tasks/work-log.js.map +1 -0
- package/dist/src/integrations/utilities/capabilities.d.ts +160 -0
- package/dist/src/integrations/utilities/capabilities.d.ts.map +1 -0
- package/dist/src/integrations/utilities/capabilities.js +426 -0
- package/dist/src/integrations/utilities/capabilities.js.map +1 -0
- package/dist/src/integrations/utilities/diff-utils.d.ts +105 -0
- package/dist/src/integrations/utilities/diff-utils.d.ts.map +1 -0
- package/dist/src/integrations/utilities/diff-utils.js +497 -0
- package/dist/src/integrations/utilities/diff-utils.js.map +1 -0
- package/dist/src/integrations/utilities/environment-facts.d.ts +52 -0
- package/dist/src/integrations/utilities/environment-facts.d.ts.map +1 -0
- package/dist/src/integrations/utilities/environment-facts.js +84 -0
- package/dist/src/integrations/utilities/environment-facts.js.map +1 -0
- package/dist/src/integrations/utilities/file-change-tracker.d.ts +162 -0
- package/dist/src/integrations/utilities/file-change-tracker.d.ts.map +1 -0
- package/dist/src/integrations/utilities/file-change-tracker.js +538 -0
- package/dist/src/integrations/utilities/file-change-tracker.js.map +1 -0
- package/dist/src/integrations/utilities/graph-visualization.d.ts +72 -0
- package/dist/src/integrations/utilities/graph-visualization.d.ts.map +1 -0
- package/dist/src/integrations/utilities/graph-visualization.js +383 -0
- package/dist/src/integrations/utilities/graph-visualization.js.map +1 -0
- package/dist/src/integrations/utilities/hierarchical-config.d.ts +215 -0
- package/dist/src/integrations/utilities/hierarchical-config.d.ts.map +1 -0
- package/dist/src/integrations/utilities/hierarchical-config.js +504 -0
- package/dist/src/integrations/utilities/hierarchical-config.js.map +1 -0
- package/dist/src/integrations/utilities/hooks.d.ts +116 -0
- package/dist/src/integrations/utilities/hooks.d.ts.map +1 -0
- package/dist/src/integrations/utilities/hooks.js +410 -0
- package/dist/src/integrations/utilities/hooks.js.map +1 -0
- package/dist/src/integrations/utilities/ignore.d.ts +143 -0
- package/dist/src/integrations/utilities/ignore.d.ts.map +1 -0
- package/dist/src/integrations/utilities/ignore.js +417 -0
- package/dist/src/integrations/utilities/ignore.js.map +1 -0
- package/dist/src/integrations/utilities/image-renderer.d.ts +119 -0
- package/dist/src/integrations/utilities/image-renderer.d.ts.map +1 -0
- package/dist/src/integrations/utilities/image-renderer.js +306 -0
- package/dist/src/integrations/utilities/image-renderer.js.map +1 -0
- package/dist/src/integrations/utilities/logger.d.ts +104 -0
- package/dist/src/integrations/utilities/logger.d.ts.map +1 -0
- package/dist/src/integrations/utilities/logger.js +219 -0
- package/dist/src/integrations/utilities/logger.js.map +1 -0
- package/dist/src/integrations/utilities/memory.d.ts +116 -0
- package/dist/src/integrations/utilities/memory.d.ts.map +1 -0
- package/dist/src/integrations/utilities/memory.js +311 -0
- package/dist/src/integrations/utilities/memory.js.map +1 -0
- package/dist/src/integrations/utilities/observability.d.ts +162 -0
- package/dist/src/integrations/utilities/observability.d.ts.map +1 -0
- package/dist/src/integrations/utilities/observability.js +407 -0
- package/dist/src/integrations/utilities/observability.js.map +1 -0
- package/dist/src/integrations/utilities/openrouter-pricing.d.ts +67 -0
- package/dist/src/integrations/utilities/openrouter-pricing.d.ts.map +1 -0
- package/dist/src/integrations/utilities/openrouter-pricing.js +166 -0
- package/dist/src/integrations/utilities/openrouter-pricing.js.map +1 -0
- package/dist/src/integrations/utilities/react.d.ts +139 -0
- package/dist/src/integrations/utilities/react.d.ts.map +1 -0
- package/dist/src/integrations/utilities/react.js +273 -0
- package/dist/src/integrations/utilities/react.js.map +1 -0
- package/dist/src/integrations/utilities/retry.d.ts +132 -0
- package/dist/src/integrations/utilities/retry.d.ts.map +1 -0
- package/dist/src/integrations/utilities/retry.js +233 -0
- package/dist/src/integrations/utilities/retry.js.map +1 -0
- package/dist/src/integrations/utilities/routing.d.ts +118 -0
- package/dist/src/integrations/utilities/routing.d.ts.map +1 -0
- package/dist/src/integrations/utilities/routing.js +348 -0
- package/dist/src/integrations/utilities/routing.js.map +1 -0
- package/dist/src/integrations/utilities/rules.d.ts +131 -0
- package/dist/src/integrations/utilities/rules.d.ts.map +1 -0
- package/dist/src/integrations/utilities/rules.js +284 -0
- package/dist/src/integrations/utilities/rules.js.map +1 -0
- package/dist/src/integrations/utilities/sourcegraph.d.ts +169 -0
- package/dist/src/integrations/utilities/sourcegraph.d.ts.map +1 -0
- package/dist/src/integrations/utilities/sourcegraph.js +379 -0
- package/dist/src/integrations/utilities/sourcegraph.js.map +1 -0
- package/dist/src/integrations/utilities/thinking-strategy.d.ts +52 -0
- package/dist/src/integrations/utilities/thinking-strategy.d.ts.map +1 -0
- package/dist/src/integrations/utilities/thinking-strategy.js +129 -0
- package/dist/src/integrations/utilities/thinking-strategy.js.map +1 -0
- package/dist/src/integrations/utilities/thread-manager.d.ts +199 -0
- package/dist/src/integrations/utilities/thread-manager.d.ts.map +1 -0
- package/dist/src/integrations/utilities/thread-manager.js +357 -0
- package/dist/src/integrations/utilities/thread-manager.js.map +1 -0
- package/dist/src/integrations/utilities/token-estimate.d.ts +11 -0
- package/dist/src/integrations/utilities/token-estimate.d.ts.map +1 -0
- package/dist/src/integrations/utilities/token-estimate.js +14 -0
- package/dist/src/integrations/utilities/token-estimate.js.map +1 -0
- package/dist/src/main.js +92 -35
- package/dist/src/main.js.map +1 -1
- package/dist/src/modes/repl.d.ts.map +1 -1
- package/dist/src/modes/repl.js +60 -11
- package/dist/src/modes/repl.js.map +1 -1
- package/dist/src/modes/tui.d.ts.map +1 -1
- package/dist/src/modes/tui.js +57 -10
- package/dist/src/modes/tui.js.map +1 -1
- package/dist/src/modes.js +1 -1
- package/dist/src/modes.js.map +1 -1
- package/dist/src/observability/tracer.d.ts.map +1 -1
- package/dist/src/observability/tracer.js +2 -1
- package/dist/src/observability/tracer.js.map +1 -1
- package/dist/src/persistence/schema.d.ts +2 -0
- package/dist/src/persistence/schema.d.ts.map +1 -1
- package/dist/src/persistence/schema.js +42 -0
- package/dist/src/persistence/schema.js.map +1 -1
- package/dist/src/providers/adapters/anthropic.d.ts +6 -0
- package/dist/src/providers/adapters/anthropic.d.ts.map +1 -1
- package/dist/src/providers/adapters/anthropic.js +101 -16
- package/dist/src/providers/adapters/anthropic.js.map +1 -1
- package/dist/src/providers/adapters/azure.d.ts +74 -0
- package/dist/src/providers/adapters/azure.d.ts.map +1 -0
- package/dist/src/providers/adapters/azure.js +354 -0
- package/dist/src/providers/adapters/azure.js.map +1 -0
- package/dist/src/providers/adapters/mock.d.ts +16 -2
- package/dist/src/providers/adapters/mock.d.ts.map +1 -1
- package/dist/src/providers/adapters/mock.js +44 -3
- package/dist/src/providers/adapters/mock.js.map +1 -1
- package/dist/src/providers/adapters/openai.d.ts +6 -1
- package/dist/src/providers/adapters/openai.d.ts.map +1 -1
- package/dist/src/providers/adapters/openai.js +41 -9
- package/dist/src/providers/adapters/openai.js.map +1 -1
- package/dist/src/providers/adapters/openrouter.d.ts +6 -0
- package/dist/src/providers/adapters/openrouter.d.ts.map +1 -1
- package/dist/src/providers/adapters/openrouter.js +83 -13
- package/dist/src/providers/adapters/openrouter.js.map +1 -1
- package/dist/src/providers/circuit-breaker.d.ts +1 -0
- package/dist/src/providers/circuit-breaker.d.ts.map +1 -1
- package/dist/src/providers/circuit-breaker.js.map +1 -1
- package/dist/src/providers/provider.d.ts.map +1 -1
- package/dist/src/providers/provider.js +2 -1
- package/dist/src/providers/provider.js.map +1 -1
- package/dist/src/providers/resilient-provider.d.ts.map +1 -1
- package/dist/src/providers/resilient-provider.js +2 -1
- package/dist/src/providers/resilient-provider.js.map +1 -1
- package/dist/src/providers/types.d.ts +23 -2
- package/dist/src/providers/types.d.ts.map +1 -1
- package/dist/src/session-picker.d.ts +1 -1
- package/dist/src/session-picker.d.ts.map +1 -1
- package/dist/src/session-picker.js +40 -5
- package/dist/src/session-picker.js.map +1 -1
- package/dist/src/shared/budget-tracker.d.ts +65 -0
- package/dist/src/shared/budget-tracker.d.ts.map +1 -0
- package/dist/src/shared/budget-tracker.js +128 -0
- package/dist/src/shared/budget-tracker.js.map +1 -0
- package/dist/src/shared/context-engine.d.ts +64 -0
- package/dist/src/shared/context-engine.d.ts.map +1 -0
- package/dist/src/shared/context-engine.js +117 -0
- package/dist/src/shared/context-engine.js.map +1 -0
- package/dist/src/shared/index.d.ts +12 -0
- package/dist/src/shared/index.d.ts.map +1 -0
- package/dist/src/shared/index.js +12 -0
- package/dist/src/shared/index.js.map +1 -0
- package/dist/src/shared/persistence.d.ts +57 -0
- package/dist/src/shared/persistence.d.ts.map +1 -0
- package/dist/src/shared/persistence.js +168 -0
- package/dist/src/shared/persistence.js.map +1 -0
- package/dist/src/shared/shared-context-state.d.ts +89 -0
- package/dist/src/shared/shared-context-state.d.ts.map +1 -0
- package/dist/src/shared/shared-context-state.js +175 -0
- package/dist/src/shared/shared-context-state.js.map +1 -0
- package/dist/src/shared/shared-economics-state.d.ts +61 -0
- package/dist/src/shared/shared-economics-state.d.ts.map +1 -0
- package/dist/src/shared/shared-economics-state.js +100 -0
- package/dist/src/shared/shared-economics-state.js.map +1 -0
- package/dist/src/tools/agent.d.ts +1 -1
- package/dist/src/tools/agent.d.ts.map +1 -1
- package/dist/src/tools/bash.d.ts +3 -3
- package/dist/src/tools/bash.d.ts.map +1 -1
- package/dist/src/tools/bash.js +2 -1
- package/dist/src/tools/bash.js.map +1 -1
- package/dist/src/tools/file.d.ts +3 -3
- package/dist/src/tools/file.js +1 -1
- package/dist/src/tools/file.js.map +1 -1
- package/dist/src/tools/permission.d.ts.map +1 -1
- package/dist/src/tools/permission.js +7 -6
- package/dist/src/tools/permission.js.map +1 -1
- package/dist/src/tools/registry.d.ts +1 -1
- package/dist/src/tools/registry.d.ts.map +1 -1
- package/dist/src/tools/registry.js +1 -1
- package/dist/src/tools/registry.js.map +1 -1
- package/dist/src/tools/tasks.d.ts +1 -1
- package/dist/src/tools/tasks.d.ts.map +1 -1
- package/dist/src/tools/types.d.ts +1 -0
- package/dist/src/tools/types.d.ts.map +1 -1
- package/dist/src/tools/types.js.map +1 -1
- package/dist/src/tools/undo.d.ts +1 -1
- package/dist/src/tools/undo.d.ts.map +1 -1
- package/dist/src/tracing/cache-boundary-tracker.d.ts.map +1 -1
- package/dist/src/tracing/cache-boundary-tracker.js +2 -2
- package/dist/src/tracing/cache-boundary-tracker.js.map +1 -1
- package/dist/src/tracing/trace-collector.d.ts +147 -0
- package/dist/src/tracing/trace-collector.d.ts.map +1 -1
- package/dist/src/tracing/trace-collector.js +138 -7
- package/dist/src/tracing/trace-collector.js.map +1 -1
- package/dist/src/tracing/types.d.ts +112 -1
- package/dist/src/tracing/types.d.ts.map +1 -1
- package/dist/src/tracing/types.js.map +1 -1
- package/dist/src/tricks/failure-evidence.d.ts.map +1 -1
- package/dist/src/tricks/failure-evidence.js +2 -1
- package/dist/src/tricks/failure-evidence.js.map +1 -1
- package/dist/src/tricks/recitation.d.ts.map +1 -1
- package/dist/src/tricks/recitation.js +2 -1
- package/dist/src/tricks/recitation.js.map +1 -1
- package/dist/src/tricks/recursive-context.d.ts.map +1 -1
- package/dist/src/tricks/recursive-context.js +2 -2
- package/dist/src/tricks/recursive-context.js.map +1 -1
- package/dist/src/tricks/reversible-compaction.d.ts.map +1 -1
- package/dist/src/tricks/reversible-compaction.js +6 -2
- package/dist/src/tricks/reversible-compaction.js.map +1 -1
- package/dist/src/tui/app.d.ts +16 -3
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +211 -25
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/components/CollapsibleDiffView.d.ts +1 -1
- package/dist/src/tui/components/CollapsibleDiffView.d.ts.map +1 -1
- package/dist/src/tui/components/DiagnosticsPanel.d.ts +24 -0
- package/dist/src/tui/components/DiagnosticsPanel.d.ts.map +1 -0
- package/dist/src/tui/components/DiagnosticsPanel.js +47 -0
- package/dist/src/tui/components/DiagnosticsPanel.js.map +1 -0
- package/dist/src/tui/components/DiffView.d.ts +1 -1
- package/dist/src/tui/components/DiffView.d.ts.map +1 -1
- package/dist/src/tui/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/src/tui/components/ErrorBoundary.js +3 -2
- package/dist/src/tui/components/ErrorBoundary.js.map +1 -1
- package/dist/src/tui/components/TasksPanel.d.ts +1 -1
- package/dist/src/tui/components/TasksPanel.d.ts.map +1 -1
- package/dist/src/tui/event-display.d.ts.map +1 -1
- package/dist/src/tui/event-display.js +36 -62
- package/dist/src/tui/event-display.js.map +1 -1
- package/dist/src/tui/index.d.ts +4 -0
- package/dist/src/tui/index.d.ts.map +1 -1
- package/dist/src/tui/index.js +17 -0
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/transparency-aggregator.d.ts +13 -0
- package/dist/src/tui/transparency-aggregator.d.ts.map +1 -1
- package/dist/src/tui/transparency-aggregator.js +21 -0
- package/dist/src/tui/transparency-aggregator.js.map +1 -1
- package/dist/src/types.d.ts +170 -3
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +18 -3
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Task Decomposer Integration
|
|
3
|
+
*
|
|
4
|
+
* Uses LLM-assisted analysis for intelligent task decomposition.
|
|
5
|
+
* Replaces keyword-based decomposition with semantic understanding.
|
|
6
|
+
*
|
|
7
|
+
* Key features:
|
|
8
|
+
* - Semantic task analysis (understands intent, not just keywords)
|
|
9
|
+
* - Implicit dependency detection ("implement auth" needs "design schema")
|
|
10
|
+
* - Codebase-aware decomposition (considers existing structure)
|
|
11
|
+
* - Resource contention detection (identifies potential conflicts)
|
|
12
|
+
* - Dynamic strategy selection based on task characteristics
|
|
13
|
+
*
|
|
14
|
+
* Implementation split (Phase 3e):
|
|
15
|
+
* - task-splitter.ts — LLM-driven splitting logic (prompt + parsing)
|
|
16
|
+
* - dependency-analyzer.ts — Graph building + topological sort
|
|
17
|
+
* - smart-decomposer.ts — Core class, types, heuristics, factory (this file)
|
|
18
|
+
*/
|
|
19
|
+
// Delegate imports
|
|
20
|
+
import { buildDependencyGraph as buildDependencyGraphFn, detectConflicts as detectConflictsFn, } from './dependency-analyzer.js';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// RE-EXPORTS (backward compatibility)
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Re-export everything from extracted modules so existing imports keep working
|
|
25
|
+
export { validateDecomposition, createDecompositionPrompt, parseDecompositionResponse, repairJSON, extractSubtasksFromNaturalLanguage, } from './task-splitter.js';
|
|
26
|
+
export { buildDependencyGraph, detectCycles, topologicalSort, calculateParallelGroups, detectConflicts, } from './dependency-analyzer.js';
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// CONSTANTS
|
|
29
|
+
// =============================================================================
|
|
30
|
+
const DEFAULT_CONFIG = {
|
|
31
|
+
maxSubtasks: 10,
|
|
32
|
+
minComplexityToDecompose: 3,
|
|
33
|
+
useLLM: false,
|
|
34
|
+
llmProvider: undefined,
|
|
35
|
+
codebaseAware: true,
|
|
36
|
+
defaultStrategy: 'adaptive',
|
|
37
|
+
detectConflicts: true,
|
|
38
|
+
};
|
|
39
|
+
// Task type indicators for heuristic analysis
|
|
40
|
+
const TYPE_INDICATORS = {
|
|
41
|
+
research: ['find', 'search', 'discover', 'locate', 'identify', 'explore', 'investigate'],
|
|
42
|
+
analysis: ['analyze', 'understand', 'examine', 'review', 'study', 'evaluate'],
|
|
43
|
+
design: ['design', 'plan', 'architect', 'structure', 'outline', 'sketch'],
|
|
44
|
+
implement: ['implement', 'create', 'build', 'write', 'code', 'develop', 'add'],
|
|
45
|
+
test: ['test', 'verify', 'validate', 'check', 'ensure', 'assert'],
|
|
46
|
+
refactor: ['refactor', 'improve', 'optimize', 'clean', 'simplify', 'restructure'],
|
|
47
|
+
review: ['review', 'inspect', 'audit', 'check', 'examine'],
|
|
48
|
+
document: ['document', 'describe', 'explain', 'annotate', 'comment'],
|
|
49
|
+
integrate: ['integrate', 'connect', 'combine', 'merge', 'link'],
|
|
50
|
+
deploy: ['deploy', 'release', 'publish', 'ship', 'launch'],
|
|
51
|
+
merge: ['merge', 'combine', 'consolidate', 'aggregate', 'synthesize'],
|
|
52
|
+
};
|
|
53
|
+
// =============================================================================
|
|
54
|
+
// SMART DECOMPOSER
|
|
55
|
+
// =============================================================================
|
|
56
|
+
/**
|
|
57
|
+
* Intelligently decomposes tasks using semantic analysis.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const decomposer = createSmartDecomposer({
|
|
62
|
+
* useLLM: true,
|
|
63
|
+
* llmProvider: async (task, context) => {
|
|
64
|
+
* // Call your LLM here
|
|
65
|
+
* return { subtasks: [...], strategy: 'parallel', reasoning: '...' };
|
|
66
|
+
* },
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* const result = await decomposer.decompose(
|
|
70
|
+
* 'Implement user authentication with OAuth2 and session management',
|
|
71
|
+
* { repoMap }
|
|
72
|
+
* );
|
|
73
|
+
*
|
|
74
|
+
* console.log(`Decomposed into ${result.subtasks.length} subtasks`);
|
|
75
|
+
* console.log(`Strategy: ${result.strategy}`);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export class SmartDecomposer {
|
|
79
|
+
config;
|
|
80
|
+
listeners = [];
|
|
81
|
+
taskCounter = 0;
|
|
82
|
+
constructor(config = {}) {
|
|
83
|
+
this.config = {
|
|
84
|
+
...DEFAULT_CONFIG,
|
|
85
|
+
...config,
|
|
86
|
+
llmProvider: config.llmProvider ?? DEFAULT_CONFIG.llmProvider,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// ===========================================================================
|
|
90
|
+
// DECOMPOSITION
|
|
91
|
+
// ===========================================================================
|
|
92
|
+
/**
|
|
93
|
+
* Decompose a task into subtasks.
|
|
94
|
+
*/
|
|
95
|
+
async decompose(task, context = {}) {
|
|
96
|
+
this.emit({ type: 'decomposition.started', task });
|
|
97
|
+
let subtasks = [];
|
|
98
|
+
let strategy = this.config.defaultStrategy;
|
|
99
|
+
let llmAssisted = false;
|
|
100
|
+
// Try LLM-assisted decomposition first (with 1 retry before heuristic fallback)
|
|
101
|
+
if (this.config.useLLM && this.config.llmProvider) {
|
|
102
|
+
const maxLLMAttempts = 2;
|
|
103
|
+
for (let attempt = 0; attempt < maxLLMAttempts; attempt++) {
|
|
104
|
+
try {
|
|
105
|
+
this.emit({ type: 'llm.called', task });
|
|
106
|
+
const llmResult = await this.config.llmProvider(task, context);
|
|
107
|
+
subtasks = this.convertLLMResult(llmResult);
|
|
108
|
+
strategy = llmResult.strategy;
|
|
109
|
+
llmAssisted = true;
|
|
110
|
+
if (subtasks.length > 0)
|
|
111
|
+
break; // Success
|
|
112
|
+
// 0 subtasks on first attempt -> retry
|
|
113
|
+
if (attempt === 0) {
|
|
114
|
+
this.emit({ type: 'llm.fallback', reason: 'LLM returned 0 subtasks, retrying...', task });
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (attempt === 0) {
|
|
120
|
+
this.emit({ type: 'llm.fallback', reason: `${error.message}, retrying...`, task });
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Both attempts failed -> return empty so orchestrator can try lastResortDecompose
|
|
125
|
+
this.emit({ type: 'llm.fallback', reason: 'LLM failed after 2 attempts — skipping heuristic', task });
|
|
126
|
+
subtasks = [];
|
|
127
|
+
strategy = 'adaptive';
|
|
128
|
+
llmAssisted = false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// Use heuristic decomposition
|
|
133
|
+
const heuristicResult = this.decomposeHeuristic(task, context);
|
|
134
|
+
subtasks = heuristicResult.subtasks;
|
|
135
|
+
strategy = heuristicResult.strategy;
|
|
136
|
+
}
|
|
137
|
+
// Limit subtasks
|
|
138
|
+
if (subtasks.length > this.config.maxSubtasks) {
|
|
139
|
+
subtasks = subtasks.slice(0, this.config.maxSubtasks);
|
|
140
|
+
}
|
|
141
|
+
// Enhance with codebase awareness
|
|
142
|
+
if (this.config.codebaseAware && context.repoMap) {
|
|
143
|
+
subtasks = this.enhanceWithCodebaseContext(subtasks, context.repoMap);
|
|
144
|
+
}
|
|
145
|
+
// Build dependency graph (delegates to dependency-analyzer.ts)
|
|
146
|
+
const dependencyGraph = buildDependencyGraphFn(subtasks);
|
|
147
|
+
// Check for cycles
|
|
148
|
+
if (dependencyGraph.cycles.length > 0) {
|
|
149
|
+
for (const cycle of dependencyGraph.cycles) {
|
|
150
|
+
this.emit({ type: 'cycle.detected', cycle });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Detect resource conflicts (delegates to dependency-analyzer.ts)
|
|
154
|
+
let conflicts = [];
|
|
155
|
+
if (this.config.detectConflicts) {
|
|
156
|
+
conflicts = detectConflictsFn(subtasks);
|
|
157
|
+
for (const conflict of conflicts) {
|
|
158
|
+
this.emit({ type: 'conflict.detected', conflict });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Calculate totals
|
|
162
|
+
const totalComplexity = subtasks.reduce((sum, t) => sum + t.complexity, 0);
|
|
163
|
+
const totalEstimatedTokens = subtasks.reduce((sum, t) => sum + (t.estimatedTokens ?? 1000), 0);
|
|
164
|
+
const result = {
|
|
165
|
+
originalTask: task,
|
|
166
|
+
subtasks,
|
|
167
|
+
dependencyGraph,
|
|
168
|
+
conflicts,
|
|
169
|
+
strategy,
|
|
170
|
+
totalComplexity,
|
|
171
|
+
totalEstimatedTokens,
|
|
172
|
+
metadata: {
|
|
173
|
+
decomposedAt: new Date(),
|
|
174
|
+
codebaseAware: this.config.codebaseAware && !!context.repoMap,
|
|
175
|
+
llmAssisted,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
this.emit({ type: 'decomposition.completed', result });
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Convert LLM result to SmartSubtask array.
|
|
183
|
+
*/
|
|
184
|
+
convertLLMResult(llmResult) {
|
|
185
|
+
const idMap = new Map();
|
|
186
|
+
// First pass: create IDs and populate lookup map with common LLM reference patterns
|
|
187
|
+
const subtasks = llmResult.subtasks.map((s, index) => {
|
|
188
|
+
const id = `task-${++this.taskCounter}`;
|
|
189
|
+
idMap.set(s.description, id);
|
|
190
|
+
idMap.set(String(index), id);
|
|
191
|
+
// Common LLM reference patterns
|
|
192
|
+
idMap.set(`task-${index}`, id);
|
|
193
|
+
idMap.set(`subtask-${index}`, id);
|
|
194
|
+
idMap.set(`st-${index}`, id);
|
|
195
|
+
// F14: Populate modifies/reads from relevantFiles so downstream consumers
|
|
196
|
+
// (F12 hollow retry prompts, quality gate) get concrete file targets.
|
|
197
|
+
const isModifyType = ['implement', 'fix', 'refactor', 'integrate', 'test', 'deploy'].includes(s.type);
|
|
198
|
+
return {
|
|
199
|
+
id,
|
|
200
|
+
description: s.description,
|
|
201
|
+
status: 'pending',
|
|
202
|
+
dependencies: [], // Will be resolved in second pass
|
|
203
|
+
complexity: s.complexity,
|
|
204
|
+
type: s.type,
|
|
205
|
+
parallelizable: s.parallelizable,
|
|
206
|
+
relevantFiles: s.relevantFiles,
|
|
207
|
+
modifies: isModifyType ? s.relevantFiles : undefined,
|
|
208
|
+
reads: s.relevantFiles,
|
|
209
|
+
suggestedRole: s.suggestedRole,
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
// Build set of all valid task IDs for strict filtering
|
|
213
|
+
const validTaskIds = new Set(idMap.values());
|
|
214
|
+
// Second pass: resolve dependencies with strict filtering
|
|
215
|
+
return subtasks.map((subtask, index) => {
|
|
216
|
+
const original = llmResult.subtasks[index];
|
|
217
|
+
subtask.dependencies = original.dependencies
|
|
218
|
+
.map((dep) => {
|
|
219
|
+
const key = typeof dep === 'number' ? String(dep) : dep;
|
|
220
|
+
return idMap.get(key) ?? idMap.get(key.trim()) ?? null;
|
|
221
|
+
})
|
|
222
|
+
.filter((dep) => {
|
|
223
|
+
if (dep === null)
|
|
224
|
+
return false;
|
|
225
|
+
if (dep === subtask.id)
|
|
226
|
+
return false;
|
|
227
|
+
if (!validTaskIds.has(dep))
|
|
228
|
+
return false;
|
|
229
|
+
return true;
|
|
230
|
+
});
|
|
231
|
+
// Update status based on dependencies
|
|
232
|
+
subtask.status = subtask.dependencies.length > 0 ? 'blocked' : 'ready';
|
|
233
|
+
return subtask;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
// ===========================================================================
|
|
237
|
+
// HEURISTIC DECOMPOSITION
|
|
238
|
+
// ===========================================================================
|
|
239
|
+
/**
|
|
240
|
+
* Heuristic-based decomposition when LLM is not available.
|
|
241
|
+
*/
|
|
242
|
+
decomposeHeuristic(task, _context) {
|
|
243
|
+
const taskLower = task.toLowerCase();
|
|
244
|
+
// Determine task type
|
|
245
|
+
const primaryType = this.inferTaskType(taskLower);
|
|
246
|
+
// Determine strategy
|
|
247
|
+
const strategy = this.inferStrategy(taskLower, primaryType);
|
|
248
|
+
// Generate subtasks based on strategy
|
|
249
|
+
let subtasks;
|
|
250
|
+
switch (strategy) {
|
|
251
|
+
case 'sequential':
|
|
252
|
+
subtasks = this.generateSequentialSubtasks(task, primaryType);
|
|
253
|
+
break;
|
|
254
|
+
case 'parallel':
|
|
255
|
+
subtasks = this.generateParallelSubtasks(task, primaryType);
|
|
256
|
+
break;
|
|
257
|
+
case 'hierarchical':
|
|
258
|
+
subtasks = this.generateHierarchicalSubtasks(task, primaryType);
|
|
259
|
+
break;
|
|
260
|
+
case 'pipeline':
|
|
261
|
+
subtasks = this.generatePipelineSubtasks(task, primaryType);
|
|
262
|
+
break;
|
|
263
|
+
default:
|
|
264
|
+
subtasks = this.generateAdaptiveSubtasks(task, primaryType);
|
|
265
|
+
}
|
|
266
|
+
return { subtasks, strategy };
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Infer the primary task type from description.
|
|
270
|
+
*/
|
|
271
|
+
inferTaskType(taskLower) {
|
|
272
|
+
for (const [type, indicators] of Object.entries(TYPE_INDICATORS)) {
|
|
273
|
+
for (const indicator of indicators) {
|
|
274
|
+
if (taskLower.includes(indicator)) {
|
|
275
|
+
return type;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return 'implement'; // Default
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Infer decomposition strategy from task description.
|
|
283
|
+
*/
|
|
284
|
+
inferStrategy(taskLower, primaryType) {
|
|
285
|
+
// Sequential indicators
|
|
286
|
+
if (taskLower.includes('then') ||
|
|
287
|
+
taskLower.includes('after') ||
|
|
288
|
+
taskLower.includes('before') ||
|
|
289
|
+
taskLower.includes('first') ||
|
|
290
|
+
taskLower.includes('step by step')) {
|
|
291
|
+
return 'sequential';
|
|
292
|
+
}
|
|
293
|
+
// Parallel indicators
|
|
294
|
+
if (taskLower.includes('in parallel') ||
|
|
295
|
+
taskLower.includes('simultaneously') ||
|
|
296
|
+
taskLower.includes('at the same time') ||
|
|
297
|
+
(taskLower.includes('all') && taskLower.includes('files'))) {
|
|
298
|
+
return 'parallel';
|
|
299
|
+
}
|
|
300
|
+
// Pipeline indicators
|
|
301
|
+
if (taskLower.includes('process') ||
|
|
302
|
+
taskLower.includes('transform') ||
|
|
303
|
+
taskLower.includes('pipeline')) {
|
|
304
|
+
return 'pipeline';
|
|
305
|
+
}
|
|
306
|
+
// Hierarchical for complex tasks
|
|
307
|
+
if (taskLower.includes('complex') ||
|
|
308
|
+
taskLower.includes('comprehensive') ||
|
|
309
|
+
taskLower.includes('full') ||
|
|
310
|
+
taskLower.length > 200) {
|
|
311
|
+
return 'hierarchical';
|
|
312
|
+
}
|
|
313
|
+
// Type-based defaults
|
|
314
|
+
switch (primaryType) {
|
|
315
|
+
case 'research':
|
|
316
|
+
case 'analysis':
|
|
317
|
+
return 'parallel';
|
|
318
|
+
case 'implement':
|
|
319
|
+
case 'refactor':
|
|
320
|
+
return 'adaptive';
|
|
321
|
+
default:
|
|
322
|
+
return 'adaptive';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Generate sequential subtasks.
|
|
327
|
+
*/
|
|
328
|
+
generateSequentialSubtasks(task, type) {
|
|
329
|
+
const subtasks = [];
|
|
330
|
+
let prevId = null;
|
|
331
|
+
// Research phase
|
|
332
|
+
const researchId = `task-${++this.taskCounter}`;
|
|
333
|
+
subtasks.push({
|
|
334
|
+
id: researchId,
|
|
335
|
+
description: `Research and understand: ${task}`,
|
|
336
|
+
status: 'ready',
|
|
337
|
+
dependencies: [],
|
|
338
|
+
complexity: 2,
|
|
339
|
+
type: 'research',
|
|
340
|
+
parallelizable: false,
|
|
341
|
+
});
|
|
342
|
+
prevId = researchId;
|
|
343
|
+
// Main execution phase
|
|
344
|
+
const executeId = `task-${++this.taskCounter}`;
|
|
345
|
+
subtasks.push({
|
|
346
|
+
id: executeId,
|
|
347
|
+
description: `Execute: ${task}`,
|
|
348
|
+
status: 'blocked',
|
|
349
|
+
dependencies: [prevId],
|
|
350
|
+
complexity: 5,
|
|
351
|
+
type,
|
|
352
|
+
parallelizable: false,
|
|
353
|
+
});
|
|
354
|
+
prevId = executeId;
|
|
355
|
+
// Verification phase
|
|
356
|
+
const verifyId = `task-${++this.taskCounter}`;
|
|
357
|
+
subtasks.push({
|
|
358
|
+
id: verifyId,
|
|
359
|
+
description: `Verify and test: ${task}`,
|
|
360
|
+
status: 'blocked',
|
|
361
|
+
dependencies: [prevId],
|
|
362
|
+
complexity: 2,
|
|
363
|
+
type: 'test',
|
|
364
|
+
parallelizable: false,
|
|
365
|
+
});
|
|
366
|
+
return subtasks;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Generate parallel subtasks.
|
|
370
|
+
*/
|
|
371
|
+
generateParallelSubtasks(task, type) {
|
|
372
|
+
const subtasks = [];
|
|
373
|
+
// Split task into parts
|
|
374
|
+
const parts = this.splitIntoParts(task);
|
|
375
|
+
const partIds = [];
|
|
376
|
+
for (const part of parts) {
|
|
377
|
+
const id = `task-${++this.taskCounter}`;
|
|
378
|
+
partIds.push(id);
|
|
379
|
+
subtasks.push({
|
|
380
|
+
id,
|
|
381
|
+
description: part,
|
|
382
|
+
status: 'ready',
|
|
383
|
+
dependencies: [],
|
|
384
|
+
complexity: Math.ceil(5 / parts.length),
|
|
385
|
+
type,
|
|
386
|
+
parallelizable: true,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
// Merge task
|
|
390
|
+
subtasks.push({
|
|
391
|
+
id: `task-${++this.taskCounter}`,
|
|
392
|
+
description: `Combine results: ${task}`,
|
|
393
|
+
status: 'blocked',
|
|
394
|
+
dependencies: partIds,
|
|
395
|
+
complexity: 2,
|
|
396
|
+
type: 'merge',
|
|
397
|
+
parallelizable: false,
|
|
398
|
+
});
|
|
399
|
+
return subtasks;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Generate hierarchical subtasks.
|
|
403
|
+
*/
|
|
404
|
+
generateHierarchicalSubtasks(task, _type) {
|
|
405
|
+
const subtasks = [];
|
|
406
|
+
let prevId = null;
|
|
407
|
+
const phases = [
|
|
408
|
+
{ name: 'Analysis', type: 'analysis', complexity: 2 },
|
|
409
|
+
{ name: 'Design', type: 'design', complexity: 3 },
|
|
410
|
+
{ name: 'Implementation', type: 'implement', complexity: 5 },
|
|
411
|
+
{ name: 'Testing', type: 'test', complexity: 2 },
|
|
412
|
+
{ name: 'Review', type: 'review', complexity: 2 },
|
|
413
|
+
];
|
|
414
|
+
for (const phase of phases) {
|
|
415
|
+
const id = `task-${++this.taskCounter}`;
|
|
416
|
+
subtasks.push({
|
|
417
|
+
id,
|
|
418
|
+
description: `${phase.name}: ${task}`,
|
|
419
|
+
status: prevId ? 'blocked' : 'ready',
|
|
420
|
+
dependencies: prevId ? [prevId] : [],
|
|
421
|
+
complexity: phase.complexity,
|
|
422
|
+
type: phase.type,
|
|
423
|
+
parallelizable: false,
|
|
424
|
+
});
|
|
425
|
+
prevId = id;
|
|
426
|
+
}
|
|
427
|
+
return subtasks;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Generate pipeline subtasks.
|
|
431
|
+
*/
|
|
432
|
+
generatePipelineSubtasks(task, type) {
|
|
433
|
+
const subtasks = [];
|
|
434
|
+
let prevId = null;
|
|
435
|
+
const stages = [
|
|
436
|
+
{ name: 'Input', desc: 'Gather inputs' },
|
|
437
|
+
{ name: 'Transform', desc: 'Process data' },
|
|
438
|
+
{ name: 'Validate', desc: 'Validate results' },
|
|
439
|
+
{ name: 'Output', desc: 'Generate output' },
|
|
440
|
+
];
|
|
441
|
+
for (const stage of stages) {
|
|
442
|
+
const id = `task-${++this.taskCounter}`;
|
|
443
|
+
subtasks.push({
|
|
444
|
+
id,
|
|
445
|
+
description: `${stage.name}: ${stage.desc} for ${task}`,
|
|
446
|
+
status: prevId ? 'blocked' : 'ready',
|
|
447
|
+
dependencies: prevId ? [prevId] : [],
|
|
448
|
+
complexity: 2,
|
|
449
|
+
type,
|
|
450
|
+
parallelizable: false,
|
|
451
|
+
});
|
|
452
|
+
prevId = id;
|
|
453
|
+
}
|
|
454
|
+
return subtasks;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Generate adaptive subtasks (mix of strategies).
|
|
458
|
+
*/
|
|
459
|
+
generateAdaptiveSubtasks(task, type) {
|
|
460
|
+
const subtasks = [];
|
|
461
|
+
// Research (can be parallel)
|
|
462
|
+
const researchId = `task-${++this.taskCounter}`;
|
|
463
|
+
subtasks.push({
|
|
464
|
+
id: researchId,
|
|
465
|
+
description: `Research: ${task}`,
|
|
466
|
+
status: 'ready',
|
|
467
|
+
dependencies: [],
|
|
468
|
+
complexity: 2,
|
|
469
|
+
type: 'research',
|
|
470
|
+
parallelizable: true,
|
|
471
|
+
});
|
|
472
|
+
// Analysis (can be parallel with research)
|
|
473
|
+
const analysisId = `task-${++this.taskCounter}`;
|
|
474
|
+
subtasks.push({
|
|
475
|
+
id: analysisId,
|
|
476
|
+
description: `Analyze requirements: ${task}`,
|
|
477
|
+
status: 'ready',
|
|
478
|
+
dependencies: [],
|
|
479
|
+
complexity: 2,
|
|
480
|
+
type: 'analysis',
|
|
481
|
+
parallelizable: true,
|
|
482
|
+
});
|
|
483
|
+
// Implementation (depends on both)
|
|
484
|
+
const implId = `task-${++this.taskCounter}`;
|
|
485
|
+
subtasks.push({
|
|
486
|
+
id: implId,
|
|
487
|
+
description: `Implement: ${task}`,
|
|
488
|
+
status: 'blocked',
|
|
489
|
+
dependencies: [researchId, analysisId],
|
|
490
|
+
complexity: 5,
|
|
491
|
+
type,
|
|
492
|
+
parallelizable: false,
|
|
493
|
+
});
|
|
494
|
+
// Testing (depends on implementation)
|
|
495
|
+
subtasks.push({
|
|
496
|
+
id: `task-${++this.taskCounter}`,
|
|
497
|
+
description: `Test: ${task}`,
|
|
498
|
+
status: 'blocked',
|
|
499
|
+
dependencies: [implId],
|
|
500
|
+
complexity: 2,
|
|
501
|
+
type: 'test',
|
|
502
|
+
parallelizable: false,
|
|
503
|
+
});
|
|
504
|
+
return subtasks;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Split task description into parts.
|
|
508
|
+
*/
|
|
509
|
+
splitIntoParts(task) {
|
|
510
|
+
// Try to find natural splits
|
|
511
|
+
const connectors = [' and ', ', ', '; ', ' also ', ' additionally '];
|
|
512
|
+
let parts = [task];
|
|
513
|
+
for (const connector of connectors) {
|
|
514
|
+
if (task.toLowerCase().includes(connector.toLowerCase())) {
|
|
515
|
+
parts = task.split(new RegExp(connector, 'i'));
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
// Clean up and filter
|
|
520
|
+
parts = parts
|
|
521
|
+
.map((p) => p.trim())
|
|
522
|
+
.filter((p) => p.length > 10);
|
|
523
|
+
// If no good splits, create generic parts
|
|
524
|
+
if (parts.length < 2) {
|
|
525
|
+
parts = [
|
|
526
|
+
`Part 1: ${task}`,
|
|
527
|
+
`Part 2: ${task}`,
|
|
528
|
+
];
|
|
529
|
+
}
|
|
530
|
+
return parts.slice(0, 5);
|
|
531
|
+
}
|
|
532
|
+
// ===========================================================================
|
|
533
|
+
// CODEBASE CONTEXT ENHANCEMENT
|
|
534
|
+
// ===========================================================================
|
|
535
|
+
/**
|
|
536
|
+
* Enhance subtasks with codebase context.
|
|
537
|
+
*/
|
|
538
|
+
enhanceWithCodebaseContext(subtasks, repoMap) {
|
|
539
|
+
return subtasks.map((subtask) => {
|
|
540
|
+
// Find relevant files based on task description
|
|
541
|
+
const relevantFiles = this.findRelevantFiles(subtask.description, repoMap);
|
|
542
|
+
// Estimate tokens based on relevant files
|
|
543
|
+
const estimatedTokens = relevantFiles.reduce((sum, file) => {
|
|
544
|
+
const chunk = repoMap.chunks.get(file);
|
|
545
|
+
return sum + (chunk?.tokenCount ?? 500);
|
|
546
|
+
}, 1000); // Base tokens for the task itself
|
|
547
|
+
return {
|
|
548
|
+
...subtask,
|
|
549
|
+
relevantFiles: relevantFiles.slice(0, 5),
|
|
550
|
+
estimatedTokens,
|
|
551
|
+
};
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Find files relevant to a task description.
|
|
556
|
+
*/
|
|
557
|
+
findRelevantFiles(description, repoMap) {
|
|
558
|
+
const descLower = description.toLowerCase();
|
|
559
|
+
const words = descLower.split(/\s+/).filter((w) => w.length > 3);
|
|
560
|
+
const scored = [];
|
|
561
|
+
for (const [file, chunk] of repoMap.chunks) {
|
|
562
|
+
let score = 0;
|
|
563
|
+
// Check file path
|
|
564
|
+
const fileLower = file.toLowerCase();
|
|
565
|
+
for (const word of words) {
|
|
566
|
+
if (fileLower.includes(word)) {
|
|
567
|
+
score += 2;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
// Check symbols
|
|
571
|
+
for (const symbol of chunk.symbols) {
|
|
572
|
+
const symbolLower = symbol.toLowerCase();
|
|
573
|
+
for (const word of words) {
|
|
574
|
+
if (symbolLower.includes(word) || word.includes(symbolLower)) {
|
|
575
|
+
score += 1;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (score > 0) {
|
|
580
|
+
scored.push({ file, score });
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
// Sort by score and return top files
|
|
584
|
+
scored.sort((a, b) => b.score - a.score);
|
|
585
|
+
return scored.slice(0, 10).map((s) => s.file);
|
|
586
|
+
}
|
|
587
|
+
// ===========================================================================
|
|
588
|
+
// DEPENDENCY GRAPH (delegate to dependency-analyzer.ts)
|
|
589
|
+
// ===========================================================================
|
|
590
|
+
/**
|
|
591
|
+
* Build a dependency graph from subtasks.
|
|
592
|
+
* Delegates to standalone function in dependency-analyzer.ts.
|
|
593
|
+
*/
|
|
594
|
+
buildDependencyGraph(subtasks) {
|
|
595
|
+
return buildDependencyGraphFn(subtasks);
|
|
596
|
+
}
|
|
597
|
+
// ===========================================================================
|
|
598
|
+
// CONFLICT DETECTION (delegate to dependency-analyzer.ts)
|
|
599
|
+
// ===========================================================================
|
|
600
|
+
/**
|
|
601
|
+
* Detect resource conflicts between subtasks.
|
|
602
|
+
* Delegates to standalone function in dependency-analyzer.ts.
|
|
603
|
+
*/
|
|
604
|
+
detectConflicts(subtasks) {
|
|
605
|
+
return detectConflictsFn(subtasks);
|
|
606
|
+
}
|
|
607
|
+
// ===========================================================================
|
|
608
|
+
// UTILITIES
|
|
609
|
+
// ===========================================================================
|
|
610
|
+
/**
|
|
611
|
+
* Subscribe to events.
|
|
612
|
+
*/
|
|
613
|
+
on(listener) {
|
|
614
|
+
this.listeners.push(listener);
|
|
615
|
+
return () => {
|
|
616
|
+
const idx = this.listeners.indexOf(listener);
|
|
617
|
+
if (idx >= 0)
|
|
618
|
+
this.listeners.splice(idx, 1);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
emit(event) {
|
|
622
|
+
for (const listener of this.listeners) {
|
|
623
|
+
try {
|
|
624
|
+
listener(event);
|
|
625
|
+
}
|
|
626
|
+
catch {
|
|
627
|
+
// Ignore listener errors
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
// =============================================================================
|
|
633
|
+
// FACTORY FUNCTIONS
|
|
634
|
+
// =============================================================================
|
|
635
|
+
/**
|
|
636
|
+
* Create a smart decomposer.
|
|
637
|
+
*
|
|
638
|
+
* @example
|
|
639
|
+
* ```typescript
|
|
640
|
+
* // Simple heuristic decomposition
|
|
641
|
+
* const decomposer = createSmartDecomposer();
|
|
642
|
+
*
|
|
643
|
+
* // LLM-assisted decomposition
|
|
644
|
+
* const decomposer = createSmartDecomposer({
|
|
645
|
+
* useLLM: true,
|
|
646
|
+
* llmProvider: async (task, context) => {
|
|
647
|
+
* const response = await llm.complete({
|
|
648
|
+
* prompt: `Decompose this task: ${task}`,
|
|
649
|
+
* // ...
|
|
650
|
+
* });
|
|
651
|
+
* return parseDecomposition(response);
|
|
652
|
+
* },
|
|
653
|
+
* });
|
|
654
|
+
*
|
|
655
|
+
* const result = await decomposer.decompose('Build a REST API for user management');
|
|
656
|
+
* ```
|
|
657
|
+
*/
|
|
658
|
+
export function createSmartDecomposer(config = {}) {
|
|
659
|
+
return new SmartDecomposer(config);
|
|
660
|
+
}
|
|
661
|
+
//# sourceMappingURL=smart-decomposer.js.map
|