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 @@
|
|
|
1
|
+
{"version":3,"file":"task-splitter.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tasks/task-splitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAEV,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,wBAAwB,GAAG,6BAA6B,CA+DrG;AAMD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,MAAM,CAmCR;AAiDD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA0BlD;AAMD;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAoD9F;AAkKD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CA+F/E"}
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Splitter — LLM-driven splitting logic for task decomposition.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from smart-decomposer.ts (Phase 3e).
|
|
5
|
+
* Contains: prompt building, response parsing, JSON repair,
|
|
6
|
+
* natural language extraction, and decomposition validation.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* F5: Validate a decomposition result for structural correctness, feasibility, and granularity.
|
|
10
|
+
*
|
|
11
|
+
* Checks:
|
|
12
|
+
* 1. Structural: no cycles, valid dependency refs, each subtask has description
|
|
13
|
+
* 2. Feasibility: referenced files exist (warning only)
|
|
14
|
+
* 3. Granularity: no subtask complexity > 7 (should split further)
|
|
15
|
+
*/
|
|
16
|
+
export function validateDecomposition(result) {
|
|
17
|
+
const issues = [];
|
|
18
|
+
const warnings = [];
|
|
19
|
+
const taskIds = new Set(result.subtasks.map(s => s.id));
|
|
20
|
+
// 1. Structural checks
|
|
21
|
+
// Cycle detection
|
|
22
|
+
if (result.dependencyGraph.cycles.length > 0) {
|
|
23
|
+
for (const cycle of result.dependencyGraph.cycles) {
|
|
24
|
+
issues.push(`Dependency cycle detected: ${cycle.join(' \u2192 ')}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Valid dependency references
|
|
28
|
+
for (const subtask of result.subtasks) {
|
|
29
|
+
for (const dep of subtask.dependencies) {
|
|
30
|
+
if (!taskIds.has(dep)) {
|
|
31
|
+
issues.push(`Task ${subtask.id} references non-existent dependency: ${dep}`);
|
|
32
|
+
}
|
|
33
|
+
if (dep === subtask.id) {
|
|
34
|
+
issues.push(`Task ${subtask.id} depends on itself`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Each subtask must have a meaningful description
|
|
38
|
+
if (!subtask.description || subtask.description.trim().length < 5) {
|
|
39
|
+
issues.push(`Task ${subtask.id} has empty or trivial description`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// 2. Feasibility: check if referenced files exist (warnings only — files may be created by earlier tasks)
|
|
43
|
+
for (const subtask of result.subtasks) {
|
|
44
|
+
if (subtask.relevantFiles) {
|
|
45
|
+
for (const file of subtask.relevantFiles) {
|
|
46
|
+
try {
|
|
47
|
+
const fs = require('node:fs');
|
|
48
|
+
const path = require('node:path');
|
|
49
|
+
if (!fs.existsSync(path.resolve(file))) {
|
|
50
|
+
warnings.push(`Task ${subtask.id} references non-existent file: ${file}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Can't check — skip
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// 3. Granularity: flag overly complex subtasks
|
|
60
|
+
for (const subtask of result.subtasks) {
|
|
61
|
+
if (subtask.complexity > 7) {
|
|
62
|
+
warnings.push(`Task ${subtask.id} has complexity ${subtask.complexity} (>7) — consider splitting further`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Additional structural check: at least 2 subtasks
|
|
66
|
+
if (result.subtasks.length < 2) {
|
|
67
|
+
issues.push(`Decomposition produced only ${result.subtasks.length} subtask(s) — too few for swarm mode`);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
valid: issues.length === 0,
|
|
71
|
+
issues,
|
|
72
|
+
warnings,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// =============================================================================
|
|
76
|
+
// PROMPT BUILDING
|
|
77
|
+
// =============================================================================
|
|
78
|
+
/**
|
|
79
|
+
* Create an LLM prompt for task decomposition.
|
|
80
|
+
*/
|
|
81
|
+
export function createDecompositionPrompt(task, context) {
|
|
82
|
+
const parts = [
|
|
83
|
+
'You are a task decomposition expert. Break down the following task into subtasks.',
|
|
84
|
+
'',
|
|
85
|
+
`Task: ${task}`,
|
|
86
|
+
'',
|
|
87
|
+
];
|
|
88
|
+
if (context.repoMap) {
|
|
89
|
+
parts.push('Codebase context:');
|
|
90
|
+
parts.push(`- ${context.repoMap.chunks.size} files`);
|
|
91
|
+
parts.push(`- Entry points: ${context.repoMap.entryPoints.slice(0, 3).join(', ')}`);
|
|
92
|
+
parts.push('');
|
|
93
|
+
}
|
|
94
|
+
if (context.hints && context.hints.length > 0) {
|
|
95
|
+
parts.push('Hints:');
|
|
96
|
+
for (const hint of context.hints) {
|
|
97
|
+
parts.push(`- ${hint}`);
|
|
98
|
+
}
|
|
99
|
+
parts.push('');
|
|
100
|
+
}
|
|
101
|
+
parts.push('For each subtask, provide:');
|
|
102
|
+
parts.push('1. Description');
|
|
103
|
+
parts.push('2. Type (research, analysis, design, implement, test, refactor, review, document, integrate, deploy, merge)');
|
|
104
|
+
parts.push('3. Complexity (1-10)');
|
|
105
|
+
parts.push('4. Dependencies (which other subtasks must complete first)');
|
|
106
|
+
parts.push('5. Whether it can run in parallel with other tasks');
|
|
107
|
+
parts.push('');
|
|
108
|
+
parts.push('Also suggest an overall strategy: sequential, parallel, hierarchical, adaptive, or pipeline.');
|
|
109
|
+
parts.push('');
|
|
110
|
+
parts.push('Respond in JSON format.');
|
|
111
|
+
return parts.join('\n');
|
|
112
|
+
}
|
|
113
|
+
// =============================================================================
|
|
114
|
+
// JSON REPAIR
|
|
115
|
+
// =============================================================================
|
|
116
|
+
/**
|
|
117
|
+
* Normalize a raw subtask object from JSON into a consistent shape.
|
|
118
|
+
*/
|
|
119
|
+
function normalizeSubtask(s) {
|
|
120
|
+
return {
|
|
121
|
+
description: s.description || s.desc || s.title || s.name || '',
|
|
122
|
+
type: s.type || s.task_type || s.category || 'implement',
|
|
123
|
+
complexity: s.complexity || s.difficulty || 3,
|
|
124
|
+
dependencies: s.dependencies || s.deps || s.depends_on || [],
|
|
125
|
+
parallelizable: s.parallelizable ?? s.parallel ?? true,
|
|
126
|
+
relevantFiles: s.relevantFiles || s.relevant_files || s.files,
|
|
127
|
+
suggestedRole: s.suggestedRole || s.suggested_role || s.role,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Try to extract subtasks from a parsed JSON object/array.
|
|
132
|
+
* Returns null if the structure doesn't contain usable subtask data.
|
|
133
|
+
*/
|
|
134
|
+
function extractSubtasksFromParsed(parsed) {
|
|
135
|
+
// Handle array-at-root: some models return [{...}, {...}] instead of {"subtasks": [...]}
|
|
136
|
+
if (Array.isArray(parsed)) {
|
|
137
|
+
parsed = { subtasks: parsed, strategy: 'adaptive', reasoning: '(array-at-root)' };
|
|
138
|
+
}
|
|
139
|
+
// Normalize alternative key names: tasks, steps, task_list -> subtasks
|
|
140
|
+
const subtasksArray = parsed.subtasks
|
|
141
|
+
?? parsed.tasks
|
|
142
|
+
?? parsed.steps
|
|
143
|
+
?? parsed.task_list
|
|
144
|
+
?? parsed.decomposition;
|
|
145
|
+
if (!subtasksArray || !Array.isArray(subtasksArray) || subtasksArray.length === 0) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
subtasks: subtasksArray.map(normalizeSubtask),
|
|
150
|
+
strategy: parsed.strategy || 'adaptive',
|
|
151
|
+
reasoning: parsed.reasoning || '',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Layer 1: Lenient JSON repair.
|
|
156
|
+
* Fixes common LLM JSON mistakes before parsing:
|
|
157
|
+
* - Trailing commas before ] and }
|
|
158
|
+
* - JS-style comments (// and block comments)
|
|
159
|
+
* - Single-quoted strings -> double-quoted
|
|
160
|
+
* - Unquoted object keys
|
|
161
|
+
*/
|
|
162
|
+
export function repairJSON(jsonStr) {
|
|
163
|
+
let s = jsonStr;
|
|
164
|
+
// Strip JS-style line comments (// ...) outside strings
|
|
165
|
+
s = s.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g, (_match, str) => str ?? '');
|
|
166
|
+
// Strip JS-style block comments outside strings
|
|
167
|
+
s = s.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g, (_match, str) => str ?? '');
|
|
168
|
+
// Replace single-quoted strings with double-quoted (outside existing double-quoted strings)
|
|
169
|
+
s = s.replace(/("(?:[^"\\]|\\.)*")|'((?:[^'\\]|\\.)*)'/g, (_match, dq, sq) => {
|
|
170
|
+
if (dq)
|
|
171
|
+
return dq; // Already double-quoted, keep as-is
|
|
172
|
+
const escaped = sq.replace(/(?<!\\)"/g, '\\"');
|
|
173
|
+
return `"${escaped}"`;
|
|
174
|
+
});
|
|
175
|
+
// Fix unquoted object keys: { key: "value" } -> { "key": "value" }
|
|
176
|
+
s = s.replace(/("(?:[^"\\]|\\.)*")|\b([a-zA-Z_][a-zA-Z0-9_]*)\s*:/g, (match, str, key) => {
|
|
177
|
+
if (str)
|
|
178
|
+
return match; // Inside a string, keep as-is
|
|
179
|
+
return `"${key}":`;
|
|
180
|
+
});
|
|
181
|
+
// Strip trailing commas before ] and }
|
|
182
|
+
s = s.replace(/,\s*([}\]])/g, '$1');
|
|
183
|
+
return s;
|
|
184
|
+
}
|
|
185
|
+
// =============================================================================
|
|
186
|
+
// NATURAL LANGUAGE EXTRACTION
|
|
187
|
+
// =============================================================================
|
|
188
|
+
/**
|
|
189
|
+
* Layer 2: Extract subtasks from natural language (numbered/bulleted lists).
|
|
190
|
+
* Handles formats like:
|
|
191
|
+
* - "1. Description" / "1) Description"
|
|
192
|
+
* - "- Description" / "* Description"
|
|
193
|
+
* - "Task 1: Description" / "Step 1: Description"
|
|
194
|
+
* - "- [ ] Description" / "- [x] Description" (markdown task lists)
|
|
195
|
+
*/
|
|
196
|
+
export function extractSubtasksFromNaturalLanguage(response) {
|
|
197
|
+
const items = [];
|
|
198
|
+
// Try markdown task lists first: - [ ] Task / - [x] Task
|
|
199
|
+
const taskListPattern = /^[ \t]*[-*]\s*\[[ x]\]\s+(.+)$/gm;
|
|
200
|
+
let match;
|
|
201
|
+
while ((match = taskListPattern.exec(response)) !== null) {
|
|
202
|
+
const desc = match[1].trim();
|
|
203
|
+
if (desc.length > 5)
|
|
204
|
+
items.push(desc);
|
|
205
|
+
}
|
|
206
|
+
if (items.length >= 2)
|
|
207
|
+
return buildSubtasksFromList(items);
|
|
208
|
+
// Try numbered lists: 1. Desc / 1) Desc / 1: Desc
|
|
209
|
+
items.length = 0;
|
|
210
|
+
const numberedPattern = /^[ \t]*\d+[.):\-]\s+(.+)$/gm;
|
|
211
|
+
while ((match = numberedPattern.exec(response)) !== null) {
|
|
212
|
+
const desc = match[1].trim();
|
|
213
|
+
if (desc.length > 5)
|
|
214
|
+
items.push(desc);
|
|
215
|
+
}
|
|
216
|
+
if (items.length >= 2)
|
|
217
|
+
return buildSubtasksFromList(items);
|
|
218
|
+
// Try bulleted lists: - Desc / * Desc (but not markdown task lists already tried)
|
|
219
|
+
items.length = 0;
|
|
220
|
+
const bulletPattern = /^[ \t]*[-*]\s+(?!\[[ x]\])(.+)$/gm;
|
|
221
|
+
while ((match = bulletPattern.exec(response)) !== null) {
|
|
222
|
+
const desc = match[1].trim();
|
|
223
|
+
if (desc.length > 5)
|
|
224
|
+
items.push(desc);
|
|
225
|
+
}
|
|
226
|
+
if (items.length >= 2)
|
|
227
|
+
return buildSubtasksFromList(items);
|
|
228
|
+
// Try "Task N:" / "Step N:" / "Subtask N:" style headers
|
|
229
|
+
items.length = 0;
|
|
230
|
+
const headerPattern = /^[ \t]*(?:task|step|subtask|phase)\s*\d+[:.]\s*(.+)$/gim;
|
|
231
|
+
while ((match = headerPattern.exec(response)) !== null) {
|
|
232
|
+
const desc = match[1].trim();
|
|
233
|
+
if (desc.length > 5)
|
|
234
|
+
items.push(desc);
|
|
235
|
+
}
|
|
236
|
+
if (items.length >= 2)
|
|
237
|
+
return buildSubtasksFromList(items);
|
|
238
|
+
// Try markdown headers: ## Subtask 1 / ### Step: Description
|
|
239
|
+
items.length = 0;
|
|
240
|
+
const mdHeaderPattern = /^#{2,4}\s+(?:(?:subtask|step|task|phase)\s*\d*[:.]*\s*)?(.+)$/gim;
|
|
241
|
+
while ((match = mdHeaderPattern.exec(response)) !== null) {
|
|
242
|
+
const desc = match[1].trim();
|
|
243
|
+
// Skip generic headers like "Summary", "Strategy", "Overview"
|
|
244
|
+
if (desc.length > 5 && !/^(summary|strategy|overview|reasoning|conclusion|notes?)$/i.test(desc)) {
|
|
245
|
+
items.push(desc);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (items.length >= 2)
|
|
249
|
+
return buildSubtasksFromList(items);
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Build an LLMDecomposeResult from a flat list of description strings.
|
|
254
|
+
* Assigns sequential dependencies and infers task type from keywords.
|
|
255
|
+
*/
|
|
256
|
+
function buildSubtasksFromList(items) {
|
|
257
|
+
const TYPE_KEYWORDS = {
|
|
258
|
+
research: ['research', 'investigate', 'explore', 'analyze', 'understand', 'study', 'review existing'],
|
|
259
|
+
design: ['design', 'plan', 'architect', 'schema', 'structure'],
|
|
260
|
+
test: ['test', 'verify', 'validate', 'assert', 'check'],
|
|
261
|
+
refactor: ['refactor', 'clean up', 'reorganize', 'simplify'],
|
|
262
|
+
document: ['document', 'readme', 'docs', 'comment'],
|
|
263
|
+
integrate: ['integrate', 'wire', 'connect', 'combine', 'merge'],
|
|
264
|
+
deploy: ['deploy', 'release', 'publish', 'ship'],
|
|
265
|
+
};
|
|
266
|
+
return {
|
|
267
|
+
subtasks: items.map((desc, i) => {
|
|
268
|
+
const lower = desc.toLowerCase();
|
|
269
|
+
let type = 'implement';
|
|
270
|
+
for (const [t, keywords] of Object.entries(TYPE_KEYWORDS)) {
|
|
271
|
+
if (keywords.some(k => lower.includes(k))) {
|
|
272
|
+
type = t;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
description: desc,
|
|
278
|
+
type,
|
|
279
|
+
complexity: 3,
|
|
280
|
+
dependencies: i > 0 ? [String(i - 1)] : [],
|
|
281
|
+
parallelizable: i === 0 || type === 'research' || type === 'test',
|
|
282
|
+
};
|
|
283
|
+
}),
|
|
284
|
+
strategy: 'sequential',
|
|
285
|
+
reasoning: '(extracted from natural language list)',
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
// =============================================================================
|
|
289
|
+
// TRUNCATED JSON RECOVERY
|
|
290
|
+
// =============================================================================
|
|
291
|
+
/**
|
|
292
|
+
* Layer 3: Last-ditch single mega-task extraction.
|
|
293
|
+
* If there's meaningful text but no structure could be found,
|
|
294
|
+
* wrap the response as a single "implement" subtask so the swarm
|
|
295
|
+
* has something to work with rather than aborting entirely.
|
|
296
|
+
*/
|
|
297
|
+
function extractMegaTask(response) {
|
|
298
|
+
// Strip code blocks, JSON fragments, and whitespace to get prose content
|
|
299
|
+
const prose = response
|
|
300
|
+
.replace(/```[\s\S]*?```/g, '')
|
|
301
|
+
.replace(/\{[\s\S]*?\}/g, '')
|
|
302
|
+
.replace(/\[[\s\S]*?\]/g, '')
|
|
303
|
+
.trim();
|
|
304
|
+
// Only create mega-task if there's substantial text (not just JSON garbage)
|
|
305
|
+
if (prose.length < 20)
|
|
306
|
+
return null;
|
|
307
|
+
const desc = prose.length > 200
|
|
308
|
+
? prose.slice(0, 200).replace(/\s+\S*$/, '') + '...'
|
|
309
|
+
: prose;
|
|
310
|
+
return {
|
|
311
|
+
subtasks: [{
|
|
312
|
+
description: desc,
|
|
313
|
+
type: 'implement',
|
|
314
|
+
complexity: 5,
|
|
315
|
+
dependencies: [],
|
|
316
|
+
parallelizable: false,
|
|
317
|
+
}],
|
|
318
|
+
strategy: 'adaptive',
|
|
319
|
+
reasoning: '(single mega-task — parser could not extract structured subtasks)',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Attempt to recover a truncated JSON response by trimming incomplete trailing
|
|
324
|
+
* content and adding missing closing brackets/braces.
|
|
325
|
+
*
|
|
326
|
+
* Works for the common case where the LLM output was cut off mid-JSON-array,
|
|
327
|
+
* e.g.: `{"subtasks": [ {...}, {...}, {"desc` -> trim last incomplete object -> close array & object.
|
|
328
|
+
*/
|
|
329
|
+
function tryRecoverTruncatedJSON(response) {
|
|
330
|
+
// Extract JSON portion (from code block or raw)
|
|
331
|
+
let jsonStr;
|
|
332
|
+
const codeBlockMatch = response.match(/```(?:json)?\s*\n?([\s\S]*)/);
|
|
333
|
+
if (codeBlockMatch) {
|
|
334
|
+
// No closing ``` required — that's the truncation
|
|
335
|
+
jsonStr = codeBlockMatch[1].replace(/```\s*$/, '').trim();
|
|
336
|
+
}
|
|
337
|
+
if (!jsonStr) {
|
|
338
|
+
const jsonMatch = response.match(/\{[\s\S]*/);
|
|
339
|
+
if (jsonMatch)
|
|
340
|
+
jsonStr = jsonMatch[0].trim();
|
|
341
|
+
}
|
|
342
|
+
if (!jsonStr)
|
|
343
|
+
return null;
|
|
344
|
+
// Find the last complete JSON object in the subtasks array.
|
|
345
|
+
// Strategy: find last `}` that closes a complete array element, trim there, close brackets.
|
|
346
|
+
// We search backwards for `},` or `}\n` patterns that likely end a complete subtask object.
|
|
347
|
+
let lastGoodPos = -1;
|
|
348
|
+
let braceDepth = 0;
|
|
349
|
+
let bracketDepth = 0;
|
|
350
|
+
let inString = false;
|
|
351
|
+
let escape = false;
|
|
352
|
+
for (let i = 0; i < jsonStr.length; i++) {
|
|
353
|
+
const ch = jsonStr[i];
|
|
354
|
+
if (escape) {
|
|
355
|
+
escape = false;
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (ch === '\\' && inString) {
|
|
359
|
+
escape = true;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (ch === '"') {
|
|
363
|
+
inString = !inString;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (inString)
|
|
367
|
+
continue;
|
|
368
|
+
if (ch === '{')
|
|
369
|
+
braceDepth++;
|
|
370
|
+
else if (ch === '}') {
|
|
371
|
+
braceDepth--;
|
|
372
|
+
// When we close an object at brace depth 1 (inside the top-level object),
|
|
373
|
+
// this is likely a complete subtask object inside the array
|
|
374
|
+
if (braceDepth === 1 && bracketDepth === 1) {
|
|
375
|
+
lastGoodPos = i;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else if (ch === '[')
|
|
379
|
+
bracketDepth++;
|
|
380
|
+
else if (ch === ']')
|
|
381
|
+
bracketDepth--;
|
|
382
|
+
}
|
|
383
|
+
if (lastGoodPos === -1)
|
|
384
|
+
return null;
|
|
385
|
+
// Trim to last complete subtask object, then close the JSON structure
|
|
386
|
+
let trimmed = jsonStr.slice(0, lastGoodPos + 1);
|
|
387
|
+
// Remove trailing comma if present
|
|
388
|
+
trimmed = trimmed.replace(/,\s*$/, '');
|
|
389
|
+
// Close open brackets: we need to close the subtasks array and the root object
|
|
390
|
+
// Count what's still open
|
|
391
|
+
let openBraces = 0;
|
|
392
|
+
let openBrackets = 0;
|
|
393
|
+
inString = false;
|
|
394
|
+
escape = false;
|
|
395
|
+
for (let i = 0; i < trimmed.length; i++) {
|
|
396
|
+
const ch = trimmed[i];
|
|
397
|
+
if (escape) {
|
|
398
|
+
escape = false;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
if (ch === '\\' && inString) {
|
|
402
|
+
escape = true;
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (ch === '"') {
|
|
406
|
+
inString = !inString;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (inString)
|
|
410
|
+
continue;
|
|
411
|
+
if (ch === '{')
|
|
412
|
+
openBraces++;
|
|
413
|
+
else if (ch === '}')
|
|
414
|
+
openBraces--;
|
|
415
|
+
else if (ch === '[')
|
|
416
|
+
openBrackets++;
|
|
417
|
+
else if (ch === ']')
|
|
418
|
+
openBrackets--;
|
|
419
|
+
}
|
|
420
|
+
// Close remaining open structures
|
|
421
|
+
for (let i = 0; i < openBrackets; i++)
|
|
422
|
+
trimmed += ']';
|
|
423
|
+
for (let i = 0; i < openBraces; i++)
|
|
424
|
+
trimmed += '}';
|
|
425
|
+
return trimmed;
|
|
426
|
+
}
|
|
427
|
+
// =============================================================================
|
|
428
|
+
// MAIN PARSE FUNCTION
|
|
429
|
+
// =============================================================================
|
|
430
|
+
/**
|
|
431
|
+
* Parse LLM response into decomposition result.
|
|
432
|
+
*
|
|
433
|
+
* Uses progressive fallback layers to handle messy LLM output:
|
|
434
|
+
* 1. Standard JSON extraction (code blocks, raw JSON)
|
|
435
|
+
* 2. Lenient JSON repair (trailing commas, comments, single quotes, unquoted keys)
|
|
436
|
+
* 3. Truncated JSON recovery (missing closing brackets)
|
|
437
|
+
* 4. Natural language extraction (numbered/bulleted lists, markdown task lists)
|
|
438
|
+
* 5. Single mega-task fallback (wrap prose as one subtask)
|
|
439
|
+
*/
|
|
440
|
+
export function parseDecompositionResponse(response) {
|
|
441
|
+
if (!response || response.trim().length === 0) {
|
|
442
|
+
return {
|
|
443
|
+
subtasks: [],
|
|
444
|
+
strategy: 'adaptive',
|
|
445
|
+
reasoning: '',
|
|
446
|
+
parseError: 'Empty response from LLM',
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
// -- Step 1: Extract JSON string (code block or raw) --
|
|
450
|
+
let jsonStr;
|
|
451
|
+
const codeBlockMatch = response.match(/```(?:json)?\s*\n?([\s\S]*?)```/);
|
|
452
|
+
if (codeBlockMatch) {
|
|
453
|
+
jsonStr = codeBlockMatch[1].trim();
|
|
454
|
+
}
|
|
455
|
+
if (!jsonStr) {
|
|
456
|
+
// If the response starts with `[`, try array regex first to avoid
|
|
457
|
+
// \{[\s\S]*\} greedily matching across multiple objects in the array
|
|
458
|
+
const trimmed = response.trim();
|
|
459
|
+
const jsonMatch = trimmed.startsWith('[')
|
|
460
|
+
? (response.match(/\[[\s\S]*\]/) || response.match(/\{[\s\S]*\}/))
|
|
461
|
+
: (response.match(/\{[\s\S]*\}/) || response.match(/\[[\s\S]*\]/));
|
|
462
|
+
if (jsonMatch)
|
|
463
|
+
jsonStr = jsonMatch[0];
|
|
464
|
+
}
|
|
465
|
+
// -- Step 2: Try strict JSON parse --
|
|
466
|
+
if (jsonStr) {
|
|
467
|
+
try {
|
|
468
|
+
const parsed = JSON.parse(jsonStr);
|
|
469
|
+
const result = extractSubtasksFromParsed(parsed);
|
|
470
|
+
if (result)
|
|
471
|
+
return result;
|
|
472
|
+
}
|
|
473
|
+
catch {
|
|
474
|
+
// Strict parse failed — continue to lenient repair
|
|
475
|
+
}
|
|
476
|
+
// -- Step 3: Lenient JSON repair + parse --
|
|
477
|
+
try {
|
|
478
|
+
const repaired = repairJSON(jsonStr);
|
|
479
|
+
const parsed = JSON.parse(repaired);
|
|
480
|
+
const result = extractSubtasksFromParsed(parsed);
|
|
481
|
+
if (result) {
|
|
482
|
+
result.reasoning = result.reasoning
|
|
483
|
+
? result.reasoning + ' (repaired JSON)'
|
|
484
|
+
: '(repaired JSON)';
|
|
485
|
+
return result;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
catch {
|
|
489
|
+
// Repaired parse also failed — continue to truncation recovery
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// -- Step 4: Truncated JSON recovery --
|
|
493
|
+
const recovered = tryRecoverTruncatedJSON(response);
|
|
494
|
+
if (recovered) {
|
|
495
|
+
try {
|
|
496
|
+
const parsed = JSON.parse(recovered);
|
|
497
|
+
const result = extractSubtasksFromParsed(parsed);
|
|
498
|
+
if (result) {
|
|
499
|
+
result.reasoning = result.reasoning
|
|
500
|
+
? result.reasoning + ' (recovered from truncated response)'
|
|
501
|
+
: '(recovered from truncated response)';
|
|
502
|
+
return result;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
// Truncation recovery also failed — try repaired version
|
|
507
|
+
try {
|
|
508
|
+
const repairedRecovered = repairJSON(recovered);
|
|
509
|
+
const parsed = JSON.parse(repairedRecovered);
|
|
510
|
+
const result = extractSubtasksFromParsed(parsed);
|
|
511
|
+
if (result) {
|
|
512
|
+
result.reasoning = '(recovered from truncated + repaired JSON)';
|
|
513
|
+
return result;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
catch {
|
|
517
|
+
// All JSON approaches exhausted
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
// -- Step 5: Natural language extraction --
|
|
522
|
+
const nlResult = extractSubtasksFromNaturalLanguage(response);
|
|
523
|
+
if (nlResult)
|
|
524
|
+
return nlResult;
|
|
525
|
+
// -- Step 6: Single mega-task fallback --
|
|
526
|
+
const megaResult = extractMegaTask(response);
|
|
527
|
+
if (megaResult)
|
|
528
|
+
return megaResult;
|
|
529
|
+
// -- Truly nothing worked --
|
|
530
|
+
return {
|
|
531
|
+
subtasks: [],
|
|
532
|
+
strategy: 'adaptive',
|
|
533
|
+
reasoning: '',
|
|
534
|
+
parseError: `All parse strategies failed. First 200 chars: ${response.slice(0, 200)}`,
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
//# sourceMappingURL=task-splitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-splitter.js","sourceRoot":"","sources":["../../../../src/integrations/tasks/task-splitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAgC;IACpE,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAExD,uBAAuB;IACvB,kBAAkB;IAClB,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,8BAA8B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACvC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,EAAE,wCAAwC,GAAG,EA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iBAAiB,CAAC,CAAC;gBAC7C,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;gBACjD,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,CAAC,SAAS,GAAG,4CAA4C,CAAC;oBAChE,OAAO,MAAM,CAAC;gBAChB,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gCAAgC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,kCAAkC,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,0CAA0C;IAC1C,MAAM,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,6BAA6B;IAC7B,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,iDAAiD,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;KACtF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verification Gate - Opt-in Completion Verification
|
|
3
|
+
*
|
|
4
|
+
* Prevents premature completion by checking if required verification
|
|
5
|
+
* steps (like running tests) have been performed before allowing
|
|
6
|
+
* the agent to stop.
|
|
7
|
+
*
|
|
8
|
+
* Configuration:
|
|
9
|
+
* - TUI mode: off by default
|
|
10
|
+
* - Eval mode: auto-configured from FAIL_TO_PASS tests
|
|
11
|
+
* - Swarm mode: set by orchestrator per worker
|
|
12
|
+
*/
|
|
13
|
+
export interface VerificationCriteria {
|
|
14
|
+
/** Tests that must be run (e.g., pytest test paths) */
|
|
15
|
+
requiredTests?: string[];
|
|
16
|
+
/** Must have edited at least one file */
|
|
17
|
+
requireFileChanges?: boolean;
|
|
18
|
+
/** Max nudges before giving up and allowing completion */
|
|
19
|
+
maxAttempts?: number;
|
|
20
|
+
/** Require TypeScript compilation to pass before completion */
|
|
21
|
+
requireCompilation?: boolean;
|
|
22
|
+
/** Max compilation-specific nudges before giving up (default: 8) */
|
|
23
|
+
compilationMaxAttempts?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface VerificationState {
|
|
26
|
+
/** Tests that have been detected as run */
|
|
27
|
+
testsRun: Set<string>;
|
|
28
|
+
/** Whether any test passed */
|
|
29
|
+
anyTestPassed: boolean;
|
|
30
|
+
/** Whether file changes were made */
|
|
31
|
+
hasFileChanges: boolean;
|
|
32
|
+
/** Number of verification nudges already sent */
|
|
33
|
+
nudgeCount: number;
|
|
34
|
+
/** Whether TypeScript compilation passed */
|
|
35
|
+
compilationPassed: boolean;
|
|
36
|
+
/** Number of TypeScript compilation errors */
|
|
37
|
+
compilationErrorCount: number;
|
|
38
|
+
/** Number of compilation-specific nudges sent */
|
|
39
|
+
compilationNudgeCount: number;
|
|
40
|
+
}
|
|
41
|
+
export interface VerificationCheckResult {
|
|
42
|
+
/** Whether verification criteria are satisfied */
|
|
43
|
+
satisfied: boolean;
|
|
44
|
+
/** If not satisfied, a nudge message to inject */
|
|
45
|
+
nudge?: string;
|
|
46
|
+
/** If max attempts exceeded, allow anyway */
|
|
47
|
+
forceAllow: boolean;
|
|
48
|
+
/** What's still missing */
|
|
49
|
+
missing: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare class VerificationGate {
|
|
52
|
+
private criteria;
|
|
53
|
+
private state;
|
|
54
|
+
constructor(criteria: VerificationCriteria);
|
|
55
|
+
/**
|
|
56
|
+
* Record that a bash command was executed.
|
|
57
|
+
* Detects test execution from command patterns and output.
|
|
58
|
+
*/
|
|
59
|
+
recordBashExecution(command: string, output: string, exitCode: number | null): void;
|
|
60
|
+
/**
|
|
61
|
+
* Record that a file was modified.
|
|
62
|
+
*/
|
|
63
|
+
recordFileChange(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Record the result of a TypeScript compilation check.
|
|
66
|
+
*/
|
|
67
|
+
recordCompilationResult(passed: boolean, errorCount: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Increment the compilation nudge counter.
|
|
70
|
+
* Called from the TSC gate in the execution loop (which uses `continue`
|
|
71
|
+
* and therefore never reaches verificationGate.check()).
|
|
72
|
+
*/
|
|
73
|
+
incrementCompilationNudge(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Check if the agent can complete.
|
|
76
|
+
* Returns satisfied=true if criteria are met, or a nudge message if not.
|
|
77
|
+
*/
|
|
78
|
+
check(): VerificationCheckResult;
|
|
79
|
+
/**
|
|
80
|
+
* Get the current verification state.
|
|
81
|
+
*/
|
|
82
|
+
getState(): {
|
|
83
|
+
testsRun: number;
|
|
84
|
+
anyTestPassed: boolean;
|
|
85
|
+
hasFileChanges: boolean;
|
|
86
|
+
nudgeCount: number;
|
|
87
|
+
maxAttempts: number;
|
|
88
|
+
compilationPassed: boolean;
|
|
89
|
+
compilationErrorCount: number;
|
|
90
|
+
compilationNudgeCount: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Reset the gate state (for reuse).
|
|
94
|
+
*/
|
|
95
|
+
reset(): void;
|
|
96
|
+
private buildNudge;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Create a verification gate from criteria.
|
|
100
|
+
* Returns null if no criteria provided (gate disabled).
|
|
101
|
+
*/
|
|
102
|
+
export declare function createVerificationGate(criteria?: VerificationCriteria | null): VerificationGate | null;
|
|
103
|
+
//# sourceMappingURL=verification-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-gate.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tasks/verification-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,yCAAyC;IACzC,kBAAkB,CAA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