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,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sourcegraph Integration
|
|
3
|
+
*
|
|
4
|
+
* Cross-repository code search using Sourcegraph API.
|
|
5
|
+
* Enables searching across multiple codebases for patterns, references, and definitions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const sg = createSourcegraphClient();
|
|
10
|
+
* const results = await sg.search('context:global repo:^github.com/org func:handleAuth');
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// GRAPHQL QUERIES
|
|
15
|
+
// =============================================================================
|
|
16
|
+
const SEARCH_QUERY = `
|
|
17
|
+
query Search($query: String!, $patternType: SearchPatternType) {
|
|
18
|
+
search(query: $query, patternType: $patternType) {
|
|
19
|
+
results {
|
|
20
|
+
matchCount
|
|
21
|
+
limitHit
|
|
22
|
+
alert {
|
|
23
|
+
title
|
|
24
|
+
description
|
|
25
|
+
}
|
|
26
|
+
results {
|
|
27
|
+
__typename
|
|
28
|
+
... on FileMatch {
|
|
29
|
+
repository {
|
|
30
|
+
name
|
|
31
|
+
}
|
|
32
|
+
file {
|
|
33
|
+
path
|
|
34
|
+
url
|
|
35
|
+
}
|
|
36
|
+
lineMatches {
|
|
37
|
+
lineNumber
|
|
38
|
+
preview
|
|
39
|
+
offsetAndLengths
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
... on CommitSearchResult {
|
|
43
|
+
commit {
|
|
44
|
+
repository {
|
|
45
|
+
name
|
|
46
|
+
}
|
|
47
|
+
oid
|
|
48
|
+
message
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
... on Repository {
|
|
52
|
+
name
|
|
53
|
+
url
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
const SYMBOL_QUERY = `
|
|
61
|
+
query Symbols($query: String!, $first: Int) {
|
|
62
|
+
search(query: $query) {
|
|
63
|
+
results {
|
|
64
|
+
results {
|
|
65
|
+
__typename
|
|
66
|
+
... on FileMatch {
|
|
67
|
+
symbols {
|
|
68
|
+
name
|
|
69
|
+
kind
|
|
70
|
+
containerName
|
|
71
|
+
location {
|
|
72
|
+
resource {
|
|
73
|
+
path
|
|
74
|
+
repository {
|
|
75
|
+
name
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
range {
|
|
79
|
+
start { line character }
|
|
80
|
+
end { line character }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
// =============================================================================
|
|
91
|
+
// SOURCEGRAPH CLIENT
|
|
92
|
+
// =============================================================================
|
|
93
|
+
/**
|
|
94
|
+
* Sourcegraph API client.
|
|
95
|
+
*/
|
|
96
|
+
export class SourcegraphClient {
|
|
97
|
+
config;
|
|
98
|
+
constructor(config = {}) {
|
|
99
|
+
this.config = {
|
|
100
|
+
endpoint: config.endpoint || 'https://sourcegraph.com',
|
|
101
|
+
accessToken: config.accessToken || process.env.SOURCEGRAPH_ACCESS_TOKEN || '',
|
|
102
|
+
defaultContext: config.defaultContext || 'global',
|
|
103
|
+
timeout: config.timeout || 30000,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Check if the client is configured with valid credentials.
|
|
108
|
+
*/
|
|
109
|
+
isConfigured() {
|
|
110
|
+
return !!this.config.accessToken;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Search code across repositories.
|
|
114
|
+
*/
|
|
115
|
+
async search(query, options = {}) {
|
|
116
|
+
if (!this.isConfigured()) {
|
|
117
|
+
throw new Error('Sourcegraph access token not configured. Set SOURCEGRAPH_ACCESS_TOKEN environment variable.');
|
|
118
|
+
}
|
|
119
|
+
// Build full query with options
|
|
120
|
+
const fullQuery = this.buildQuery(query, options);
|
|
121
|
+
const startTime = Date.now();
|
|
122
|
+
const response = await this.graphql(SEARCH_QUERY, {
|
|
123
|
+
query: fullQuery,
|
|
124
|
+
patternType: options.patternType?.toUpperCase() || 'LITERAL',
|
|
125
|
+
});
|
|
126
|
+
const data = response.search?.results;
|
|
127
|
+
if (!data) {
|
|
128
|
+
return {
|
|
129
|
+
results: [],
|
|
130
|
+
matchCount: 0,
|
|
131
|
+
durationMs: Date.now() - startTime,
|
|
132
|
+
limitHit: false,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const results = [];
|
|
136
|
+
for (const result of data.results || []) {
|
|
137
|
+
if (result.__typename === 'FileMatch') {
|
|
138
|
+
const repository = result.repository?.name || '';
|
|
139
|
+
const filePath = result.file?.path || '';
|
|
140
|
+
const fileUrl = `${this.config.endpoint}${result.file?.url || ''}`;
|
|
141
|
+
for (const lineMatch of result.lineMatches || []) {
|
|
142
|
+
results.push({
|
|
143
|
+
repository,
|
|
144
|
+
filePath,
|
|
145
|
+
fileUrl,
|
|
146
|
+
lineNumbers: [lineMatch.lineNumber],
|
|
147
|
+
preview: lineMatch.preview,
|
|
148
|
+
matchType: 'content',
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (result.__typename === 'Repository') {
|
|
153
|
+
results.push({
|
|
154
|
+
repository: result.name,
|
|
155
|
+
filePath: '',
|
|
156
|
+
fileUrl: `${this.config.endpoint}${result.url || ''}`,
|
|
157
|
+
lineNumbers: [],
|
|
158
|
+
preview: result.name,
|
|
159
|
+
matchType: 'path',
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
results: options.maxResults ? results.slice(0, options.maxResults) : results,
|
|
165
|
+
matchCount: data.matchCount || results.length,
|
|
166
|
+
durationMs: Date.now() - startTime,
|
|
167
|
+
limitHit: data.limitHit || false,
|
|
168
|
+
alerts: data.alert ? [data.alert.description || data.alert.title] : undefined,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Search for symbols (functions, classes, etc.).
|
|
173
|
+
*/
|
|
174
|
+
async searchSymbols(query, options = {}) {
|
|
175
|
+
if (!this.isConfigured()) {
|
|
176
|
+
throw new Error('Sourcegraph access token not configured');
|
|
177
|
+
}
|
|
178
|
+
const fullQuery = this.buildQuery(`type:symbol ${query}`, options);
|
|
179
|
+
const response = await this.graphql(SYMBOL_QUERY, {
|
|
180
|
+
query: fullQuery,
|
|
181
|
+
first: options.maxResults || 50,
|
|
182
|
+
});
|
|
183
|
+
const results = response.search?.results?.results || [];
|
|
184
|
+
const symbols = [];
|
|
185
|
+
for (const result of results) {
|
|
186
|
+
if (result.__typename === 'FileMatch' && result.symbols) {
|
|
187
|
+
for (const symbol of result.symbols) {
|
|
188
|
+
symbols.push({
|
|
189
|
+
name: symbol.name,
|
|
190
|
+
kind: symbol.kind,
|
|
191
|
+
containerName: symbol.containerName,
|
|
192
|
+
filePath: symbol.location?.resource?.path || '',
|
|
193
|
+
repository: symbol.location?.resource?.repository?.name || '',
|
|
194
|
+
range: {
|
|
195
|
+
start: {
|
|
196
|
+
line: symbol.location?.range?.start?.line || 0,
|
|
197
|
+
character: symbol.location?.range?.start?.character || 0,
|
|
198
|
+
},
|
|
199
|
+
end: {
|
|
200
|
+
line: symbol.location?.range?.end?.line || 0,
|
|
201
|
+
character: symbol.location?.range?.end?.character || 0,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return symbols;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Find references to a symbol.
|
|
212
|
+
*/
|
|
213
|
+
async findReferences(symbolName, options = {}) {
|
|
214
|
+
const query = `\\b${this.escapeRegex(symbolName)}\\b`;
|
|
215
|
+
return this.search(query, { ...options, patternType: 'regexp' });
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Find definition of a symbol.
|
|
219
|
+
*/
|
|
220
|
+
async findDefinition(symbolName, language) {
|
|
221
|
+
const query = language
|
|
222
|
+
? `${symbolName} lang:${language}`
|
|
223
|
+
: symbolName;
|
|
224
|
+
return this.searchSymbols(query, { maxResults: 10 });
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Search for files by path pattern.
|
|
228
|
+
*/
|
|
229
|
+
async searchFiles(pathPattern, options = {}) {
|
|
230
|
+
const query = `file:${pathPattern}`;
|
|
231
|
+
return this.search(query, options);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get repository information.
|
|
235
|
+
*/
|
|
236
|
+
async getRepository(repoName) {
|
|
237
|
+
const query = `
|
|
238
|
+
query Repository($name: String!) {
|
|
239
|
+
repository(name: $name) {
|
|
240
|
+
name
|
|
241
|
+
description
|
|
242
|
+
url
|
|
243
|
+
defaultBranch {
|
|
244
|
+
name
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
const response = await this.graphql(query, { name: repoName });
|
|
250
|
+
const repo = response.repository;
|
|
251
|
+
if (!repo)
|
|
252
|
+
return null;
|
|
253
|
+
return {
|
|
254
|
+
name: repo.name,
|
|
255
|
+
description: repo.description,
|
|
256
|
+
url: `${this.config.endpoint}${repo.url || ''}`,
|
|
257
|
+
defaultBranch: repo.defaultBranch?.name,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
// ===========================================================================
|
|
261
|
+
// PRIVATE METHODS
|
|
262
|
+
// ===========================================================================
|
|
263
|
+
/**
|
|
264
|
+
* Build a full query string with options.
|
|
265
|
+
*/
|
|
266
|
+
buildQuery(baseQuery, options) {
|
|
267
|
+
const parts = [];
|
|
268
|
+
// Context
|
|
269
|
+
const context = options.context || this.config.defaultContext;
|
|
270
|
+
if (context && context !== 'global') {
|
|
271
|
+
parts.push(`context:${context}`);
|
|
272
|
+
}
|
|
273
|
+
// Repository filter
|
|
274
|
+
if (options.repoFilter) {
|
|
275
|
+
parts.push(`repo:${options.repoFilter}`);
|
|
276
|
+
}
|
|
277
|
+
// File filter
|
|
278
|
+
if (options.fileFilter) {
|
|
279
|
+
parts.push(`file:${options.fileFilter}`);
|
|
280
|
+
}
|
|
281
|
+
// Language filter
|
|
282
|
+
if (options.language) {
|
|
283
|
+
parts.push(`lang:${options.language}`);
|
|
284
|
+
}
|
|
285
|
+
// Case sensitivity
|
|
286
|
+
if (options.caseSensitive) {
|
|
287
|
+
parts.push('case:yes');
|
|
288
|
+
}
|
|
289
|
+
// Add base query
|
|
290
|
+
parts.push(baseQuery);
|
|
291
|
+
return parts.join(' ');
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Execute a GraphQL query.
|
|
295
|
+
*/
|
|
296
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
297
|
+
async graphql(query, variables) {
|
|
298
|
+
const controller = new AbortController();
|
|
299
|
+
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
300
|
+
try {
|
|
301
|
+
const response = await fetch(`${this.config.endpoint}/.api/graphql`, {
|
|
302
|
+
method: 'POST',
|
|
303
|
+
headers: {
|
|
304
|
+
'Content-Type': 'application/json',
|
|
305
|
+
'Authorization': `token ${this.config.accessToken}`,
|
|
306
|
+
},
|
|
307
|
+
body: JSON.stringify({ query, variables }),
|
|
308
|
+
signal: controller.signal,
|
|
309
|
+
});
|
|
310
|
+
if (!response.ok) {
|
|
311
|
+
throw new Error(`Sourcegraph API error: ${response.status} ${response.statusText}`);
|
|
312
|
+
}
|
|
313
|
+
const json = await response.json();
|
|
314
|
+
if (json.errors?.length) {
|
|
315
|
+
throw new Error(`Sourcegraph query error: ${json.errors[0].message}`);
|
|
316
|
+
}
|
|
317
|
+
return json.data || {};
|
|
318
|
+
}
|
|
319
|
+
finally {
|
|
320
|
+
clearTimeout(timeoutId);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Escape special regex characters.
|
|
325
|
+
*/
|
|
326
|
+
escapeRegex(str) {
|
|
327
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// =============================================================================
|
|
331
|
+
// FACTORY
|
|
332
|
+
// =============================================================================
|
|
333
|
+
/**
|
|
334
|
+
* Create a Sourcegraph client.
|
|
335
|
+
*/
|
|
336
|
+
export function createSourcegraphClient(config) {
|
|
337
|
+
return new SourcegraphClient(config);
|
|
338
|
+
}
|
|
339
|
+
// =============================================================================
|
|
340
|
+
// UTILITIES
|
|
341
|
+
// =============================================================================
|
|
342
|
+
/**
|
|
343
|
+
* Format search results for display.
|
|
344
|
+
*/
|
|
345
|
+
export function formatSearchResults(response, maxPreviewLines = 3) {
|
|
346
|
+
const lines = [];
|
|
347
|
+
lines.push(`Found ${response.matchCount} matches in ${response.durationMs}ms`);
|
|
348
|
+
if (response.limitHit) {
|
|
349
|
+
lines.push('(results truncated)');
|
|
350
|
+
}
|
|
351
|
+
lines.push('');
|
|
352
|
+
for (const result of response.results) {
|
|
353
|
+
lines.push(`${result.repository}/${result.filePath}`);
|
|
354
|
+
if (result.lineNumbers.length > 0) {
|
|
355
|
+
lines.push(` Line ${result.lineNumbers.join(', ')}`);
|
|
356
|
+
}
|
|
357
|
+
if (result.preview) {
|
|
358
|
+
const previewLines = result.preview.split('\n').slice(0, maxPreviewLines);
|
|
359
|
+
for (const line of previewLines) {
|
|
360
|
+
lines.push(` ${line}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
lines.push('');
|
|
364
|
+
}
|
|
365
|
+
if (response.alerts?.length) {
|
|
366
|
+
lines.push('Alerts:');
|
|
367
|
+
for (const alert of response.alerts) {
|
|
368
|
+
lines.push(` - ${alert}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return lines.join('\n');
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Check if Sourcegraph is configured.
|
|
375
|
+
*/
|
|
376
|
+
export function isSourcegraphConfigured() {
|
|
377
|
+
return !!process.env.SOURCEGRAPH_ACCESS_TOKEN;
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=sourcegraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourcegraph.js","sourceRoot":"","sources":["../../../../src/integrations/utilities/sourcegraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiGH,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CpB,CAAC;AAEF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB,CAAC;AAEF,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAA8B;IAE5C,YAAY,SAA4B,EAAE;QACxC,IAAI,CAAC,MAAM,GAAG;YACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,yBAAyB;YACtD,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;YAC7E,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,QAAQ;YACjD,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK;SACjC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,UAAyB,EAAE;QACrD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,6F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AAE,CAAC,CAAC;IACjB,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thinking/Reflection Strategy
|
|
3
|
+
*
|
|
4
|
+
* Generates thinking directives that guide LLMs to use their
|
|
5
|
+
* internal reasoning (extended thinking) for better planning,
|
|
6
|
+
* evaluation, and self-assessment.
|
|
7
|
+
*
|
|
8
|
+
* Following Anthropic's multi-agent research pattern:
|
|
9
|
+
* thinking is controlled through prompt engineering, not code mechanics.
|
|
10
|
+
*/
|
|
11
|
+
import type { ComplexityTier } from '../agents/complexity-classifier.js';
|
|
12
|
+
export interface ThinkingDirective {
|
|
13
|
+
/** What the model should think about before acting */
|
|
14
|
+
preActionPrompt?: string;
|
|
15
|
+
/** What the model should evaluate after tool results */
|
|
16
|
+
postToolPrompt?: string;
|
|
17
|
+
/** Quality assessment prompt before returning results */
|
|
18
|
+
qualityCheckPrompt?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ThinkingConfig {
|
|
21
|
+
/** Enable pre-task planning in thinking */
|
|
22
|
+
enablePreTaskPlanning: boolean;
|
|
23
|
+
/** Enable post-tool evaluation in thinking */
|
|
24
|
+
enablePostToolEvaluation: boolean;
|
|
25
|
+
/** Enable quality self-assessment */
|
|
26
|
+
enableQualityAssessment: boolean;
|
|
27
|
+
/** Minimum complexity tier for thinking activation */
|
|
28
|
+
minComplexityTier: ComplexityTier;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate thinking directives based on complexity and config.
|
|
32
|
+
*/
|
|
33
|
+
export declare function generateThinkingDirectives(complexityTier: ComplexityTier, config?: Partial<ThinkingConfig>): ThinkingDirective;
|
|
34
|
+
/**
|
|
35
|
+
* Generate thinking-related system prompt additions.
|
|
36
|
+
* Injected into buildMessages() for complex tasks.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getThinkingSystemPrompt(complexityTier: ComplexityTier, config?: Partial<ThinkingConfig>): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Generate quality self-assessment prompt for subagents.
|
|
41
|
+
* Added to subagent constraints before they return.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getSubagentQualityPrompt(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Create a thinking strategy manager.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createThinkingStrategy(config?: Partial<ThinkingConfig>): {
|
|
48
|
+
generateDirectives: (tier: ComplexityTier) => ThinkingDirective;
|
|
49
|
+
getSystemPrompt: (tier: ComplexityTier) => string | null;
|
|
50
|
+
getSubagentPrompt: () => string;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=thinking-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-strategy.d.ts","sourceRoot":"","sources":["../../../../src/integrations/utilities/thinking-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMzE,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,8CAA8C;IAC9C,wBAAwB,EAAE,OAAO,CAAC;IAClC,qCAAqC;IACrC,uBAAuB,EAAE,OAAO,CAAC;IACjC,sDAAsD;IACtD,iBAAiB,EAAE,cAAc,CAAC;CACnC;AA2BD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,iBAAiB,CAuBnB;AA0CD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,MAAM,GAAG,IAAI,CAkBf;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAQjD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B;IACD,kBAAkB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,iBAAiB,CAAC;IAChE,eAAe,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,MAAM,GAAG,IAAI,CAAC;IACzD,iBAAiB,EAAE,MAAM,MAAM,CAAC;CACjC,CAMA"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thinking/Reflection Strategy
|
|
3
|
+
*
|
|
4
|
+
* Generates thinking directives that guide LLMs to use their
|
|
5
|
+
* internal reasoning (extended thinking) for better planning,
|
|
6
|
+
* evaluation, and self-assessment.
|
|
7
|
+
*
|
|
8
|
+
* Following Anthropic's multi-agent research pattern:
|
|
9
|
+
* thinking is controlled through prompt engineering, not code mechanics.
|
|
10
|
+
*/
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// CONSTANTS
|
|
13
|
+
// =============================================================================
|
|
14
|
+
const DEFAULT_CONFIG = {
|
|
15
|
+
enablePreTaskPlanning: true,
|
|
16
|
+
enablePostToolEvaluation: true,
|
|
17
|
+
enableQualityAssessment: true,
|
|
18
|
+
minComplexityTier: 'medium',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Complexity tier ordering for comparison.
|
|
22
|
+
*/
|
|
23
|
+
const TIER_ORDER = {
|
|
24
|
+
simple: 0,
|
|
25
|
+
medium: 1,
|
|
26
|
+
complex: 2,
|
|
27
|
+
deep_research: 3,
|
|
28
|
+
};
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// DIRECTIVE GENERATORS
|
|
31
|
+
// =============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Generate thinking directives based on complexity and config.
|
|
34
|
+
*/
|
|
35
|
+
export function generateThinkingDirectives(complexityTier, config) {
|
|
36
|
+
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
37
|
+
// Check if thinking should be activated for this complexity level
|
|
38
|
+
if (TIER_ORDER[complexityTier] < TIER_ORDER[cfg.minComplexityTier]) {
|
|
39
|
+
return {}; // No thinking directives for simple tasks
|
|
40
|
+
}
|
|
41
|
+
const directive = {};
|
|
42
|
+
if (cfg.enablePreTaskPlanning) {
|
|
43
|
+
directive.preActionPrompt = getPreActionPrompt(complexityTier);
|
|
44
|
+
}
|
|
45
|
+
if (cfg.enablePostToolEvaluation) {
|
|
46
|
+
directive.postToolPrompt = getPostToolPrompt(complexityTier);
|
|
47
|
+
}
|
|
48
|
+
if (cfg.enableQualityAssessment) {
|
|
49
|
+
directive.qualityCheckPrompt = getQualityCheckPrompt(complexityTier);
|
|
50
|
+
}
|
|
51
|
+
return directive;
|
|
52
|
+
}
|
|
53
|
+
function getPreActionPrompt(tier) {
|
|
54
|
+
if (tier === 'deep_research' || tier === 'complex') {
|
|
55
|
+
return `Before taking any action, use your thinking to:
|
|
56
|
+
1. Assess which tools are most relevant for this task
|
|
57
|
+
2. Determine the optimal sequence of operations
|
|
58
|
+
3. If complex, plan which subagents to spawn and what each should do
|
|
59
|
+
4. Identify potential pitfalls or dependencies between subtasks
|
|
60
|
+
5. Decide whether to explore more or act on what you know
|
|
61
|
+
|
|
62
|
+
Then proceed with your plan.`;
|
|
63
|
+
}
|
|
64
|
+
return `Before acting, briefly assess in your thinking:
|
|
65
|
+
1. What tools are most relevant for this task?
|
|
66
|
+
2. What is the most efficient approach?
|
|
67
|
+
3. Are there dependencies between steps?
|
|
68
|
+
|
|
69
|
+
Then proceed.`;
|
|
70
|
+
}
|
|
71
|
+
function getPostToolPrompt(_tier) {
|
|
72
|
+
return `After receiving tool results, evaluate in your thinking:
|
|
73
|
+
- Did the tool calls return useful information?
|
|
74
|
+
- Is the information sufficient or do I need more?
|
|
75
|
+
- Should I change approach based on what I learned?
|
|
76
|
+
- Are there any errors or unexpected results to address?`;
|
|
77
|
+
}
|
|
78
|
+
function getQualityCheckPrompt(_tier) {
|
|
79
|
+
return `Before returning your final answer, evaluate in your thinking:
|
|
80
|
+
1. Did I address all aspects of the objective?
|
|
81
|
+
2. Is my output complete and in the correct format?
|
|
82
|
+
3. Have I met all success criteria?
|
|
83
|
+
4. Are there any gaps or issues I should flag?`;
|
|
84
|
+
}
|
|
85
|
+
// =============================================================================
|
|
86
|
+
// SYSTEM PROMPT INTEGRATION
|
|
87
|
+
// =============================================================================
|
|
88
|
+
/**
|
|
89
|
+
* Generate thinking-related system prompt additions.
|
|
90
|
+
* Injected into buildMessages() for complex tasks.
|
|
91
|
+
*/
|
|
92
|
+
export function getThinkingSystemPrompt(complexityTier, config) {
|
|
93
|
+
const directive = generateThinkingDirectives(complexityTier, config);
|
|
94
|
+
if (!directive.preActionPrompt && !directive.postToolPrompt) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const parts = ['## Thinking Guidelines'];
|
|
98
|
+
if (directive.preActionPrompt) {
|
|
99
|
+
parts.push(`### Before Acting\n${directive.preActionPrompt}`);
|
|
100
|
+
}
|
|
101
|
+
if (directive.postToolPrompt) {
|
|
102
|
+
parts.push(`### After Tool Results\n${directive.postToolPrompt}`);
|
|
103
|
+
}
|
|
104
|
+
return parts.join('\n\n');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Generate quality self-assessment prompt for subagents.
|
|
108
|
+
* Added to subagent constraints before they return.
|
|
109
|
+
*/
|
|
110
|
+
export function getSubagentQualityPrompt() {
|
|
111
|
+
return `Before returning your final result, evaluate your work:
|
|
112
|
+
1. Did you fully address the objective given to you?
|
|
113
|
+
2. Is your output in the expected format?
|
|
114
|
+
3. Did you stay within scope (not doing more or less than asked)?
|
|
115
|
+
4. Are there any unresolved issues or gaps to flag to the parent?
|
|
116
|
+
|
|
117
|
+
If you find gaps, note them clearly in your response.`;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Create a thinking strategy manager.
|
|
121
|
+
*/
|
|
122
|
+
export function createThinkingStrategy(config) {
|
|
123
|
+
return {
|
|
124
|
+
generateDirectives: (tier) => generateThinkingDirectives(tier, config),
|
|
125
|
+
getSystemPrompt: (tier) => getThinkingSystemPrompt(tier, config),
|
|
126
|
+
getSubagentPrompt: getSubagentQualityPrompt,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=thinking-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-strategy.js","sourceRoot":"","sources":["../../../../src/integrations/utilities/thinking-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4BH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,MAAM,cAAc,GAAmB;IACrC,qBAAqB,EAAE,IAAI;IAC3B,wBAAwB,EAAE,IAAI;IAC9B,uBAAuB,EAAE,IAAI;IAC7B,iBAAiB,EAAE,QAAQ;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAmC;IACjD,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF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