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,686 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lesson 25: Extensible Agent Registry
|
|
3
|
+
*
|
|
4
|
+
* Allows users to define custom agents that can be spawned on demand.
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Built-in agents (researcher, coder, reviewer, architect)
|
|
7
|
+
* - User-defined agents from .agents/ directory (YAML/JSON)
|
|
8
|
+
* - Hot-reload of agent definitions
|
|
9
|
+
* - NL-based agent selection
|
|
10
|
+
*/
|
|
11
|
+
import { readFile, readdir, writeFile, mkdir } from 'node:fs/promises';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { join, extname, dirname } from 'node:path';
|
|
14
|
+
import { homedir } from 'node:os';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
// ES Module __dirname equivalent
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = dirname(__filename);
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// BUILT-IN AGENTS
|
|
21
|
+
// =============================================================================
|
|
22
|
+
const BUILTIN_AGENTS = [
|
|
23
|
+
{
|
|
24
|
+
name: 'researcher',
|
|
25
|
+
description: 'Explores codebases and gathers information. Good for finding files, understanding structure, and summarizing code.',
|
|
26
|
+
systemPrompt: `You are a code researcher. Your job is to:
|
|
27
|
+
- Explore codebases thoroughly
|
|
28
|
+
- Find relevant files and functions
|
|
29
|
+
- Summarize code structure and patterns
|
|
30
|
+
- Answer questions about the codebase
|
|
31
|
+
|
|
32
|
+
IMPORTANT:
|
|
33
|
+
- Return your findings as TEXT OUTPUT in the conversation, not as files
|
|
34
|
+
- Do NOT spawn documenter agents or create documentation files
|
|
35
|
+
- Do NOT write reports or markdown files unless explicitly asked
|
|
36
|
+
- Your analysis should be verbal - the user will see it in the conversation
|
|
37
|
+
|
|
38
|
+
Be thorough but concise. Focus on finding the specific information requested.
|
|
39
|
+
Explain what you found and why it matters.`,
|
|
40
|
+
tools: ['read_file', 'list_files', 'glob', 'grep'],
|
|
41
|
+
model: 'fast',
|
|
42
|
+
maxTokenBudget: 50000,
|
|
43
|
+
maxIterations: 30,
|
|
44
|
+
capabilities: ['explore', 'search', 'find', 'understand', 'analyze'],
|
|
45
|
+
tags: ['research', 'exploration', 'analysis'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'coder',
|
|
49
|
+
description: 'Writes and modifies code. Good for implementing features, fixing bugs, and making changes.',
|
|
50
|
+
systemPrompt: `You are a skilled coder. Your job is to:
|
|
51
|
+
- Write clean, well-documented code
|
|
52
|
+
- Follow existing code patterns and conventions
|
|
53
|
+
- Make focused, minimal changes
|
|
54
|
+
- Test your changes when possible
|
|
55
|
+
|
|
56
|
+
Always explain what you're changing and why.`,
|
|
57
|
+
tools: ['read_file', 'write_file', 'edit_file', 'list_files', 'glob', 'grep', 'bash'],
|
|
58
|
+
model: 'balanced',
|
|
59
|
+
maxTokenBudget: 100000,
|
|
60
|
+
maxIterations: 50,
|
|
61
|
+
capabilities: ['write', 'implement', 'fix', 'code', 'create', 'modify'],
|
|
62
|
+
tags: ['coding', 'implementation', 'development'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'reviewer',
|
|
66
|
+
description: 'Reviews code for quality, bugs, and security issues. Good for code reviews and quality checks.',
|
|
67
|
+
systemPrompt: `You are a code reviewer. Your job is to:
|
|
68
|
+
- Find bugs and potential issues
|
|
69
|
+
- Identify security vulnerabilities
|
|
70
|
+
- Check for code quality and style
|
|
71
|
+
- Suggest improvements
|
|
72
|
+
|
|
73
|
+
Be constructive and specific in your feedback. Prioritize serious issues.`,
|
|
74
|
+
tools: ['read_file', 'list_files', 'glob', 'grep'],
|
|
75
|
+
model: 'quality',
|
|
76
|
+
maxTokenBudget: 80000,
|
|
77
|
+
maxIterations: 30,
|
|
78
|
+
capabilities: ['review', 'check', 'audit', 'verify', 'security'],
|
|
79
|
+
tags: ['review', 'quality', 'security', 'audit'],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'architect',
|
|
83
|
+
description: 'Designs system architecture and structure. Good for planning features and making design decisions.',
|
|
84
|
+
systemPrompt: `You are a software architect. Your job is to:
|
|
85
|
+
- Design scalable, maintainable systems
|
|
86
|
+
- Consider trade-offs and alternatives
|
|
87
|
+
- Document architectural decisions
|
|
88
|
+
- Plan implementation approaches
|
|
89
|
+
|
|
90
|
+
Think holistically about the system and its evolution.`,
|
|
91
|
+
tools: ['read_file', 'list_files', 'glob', 'grep'],
|
|
92
|
+
model: 'quality',
|
|
93
|
+
maxTokenBudget: 100000,
|
|
94
|
+
maxIterations: 20,
|
|
95
|
+
capabilities: ['design', 'plan', 'architect', 'structure', 'organize'],
|
|
96
|
+
tags: ['architecture', 'design', 'planning'],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'debugger',
|
|
100
|
+
description: 'Debugs and troubleshoots issues. Good for finding root causes and fixing bugs.',
|
|
101
|
+
systemPrompt: `You are a debugger. Your job is to:
|
|
102
|
+
- Analyze error messages and stack traces
|
|
103
|
+
- Find the root cause of issues
|
|
104
|
+
- Test hypotheses systematically
|
|
105
|
+
- Propose and verify fixes
|
|
106
|
+
|
|
107
|
+
Be methodical. Test assumptions before making changes.`,
|
|
108
|
+
tools: ['read_file', 'list_files', 'glob', 'grep', 'bash'],
|
|
109
|
+
model: 'balanced',
|
|
110
|
+
maxTokenBudget: 80000,
|
|
111
|
+
maxIterations: 40,
|
|
112
|
+
capabilities: ['debug', 'troubleshoot', 'fix', 'diagnose', 'error'],
|
|
113
|
+
tags: ['debugging', 'troubleshooting', 'errors'],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'documenter',
|
|
117
|
+
description: 'Writes documentation and comments. Good for adding docs, README files, and code comments.',
|
|
118
|
+
systemPrompt: `You are a technical writer. Your job is to:
|
|
119
|
+
- Write clear, helpful documentation
|
|
120
|
+
- Add meaningful code comments
|
|
121
|
+
- Create README files and guides
|
|
122
|
+
- Explain complex concepts simply
|
|
123
|
+
|
|
124
|
+
Focus on clarity and usefulness. Write for your audience.`,
|
|
125
|
+
tools: ['read_file', 'write_file', 'edit_file', 'list_files', 'glob'],
|
|
126
|
+
model: 'balanced',
|
|
127
|
+
maxTokenBudget: 50000,
|
|
128
|
+
maxIterations: 20,
|
|
129
|
+
capabilities: ['document', 'explain', 'comment', 'readme', 'guide'],
|
|
130
|
+
tags: ['documentation', 'writing', 'comments'],
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
// =============================================================================
|
|
134
|
+
// DEFAULT DIRECTORIES
|
|
135
|
+
// =============================================================================
|
|
136
|
+
/**
|
|
137
|
+
* Default agent directories with priority hierarchy:
|
|
138
|
+
* built-in < ~/.attocode/ < .attocode/ (later entries override earlier)
|
|
139
|
+
*
|
|
140
|
+
* Legacy paths (.agents/) are included for backward compatibility.
|
|
141
|
+
*/
|
|
142
|
+
export function getDefaultAgentDirectories() {
|
|
143
|
+
const homeDir = homedir();
|
|
144
|
+
return [
|
|
145
|
+
// User-level agents (medium priority)
|
|
146
|
+
join(homeDir, '.attocode', 'agents'),
|
|
147
|
+
// Project-level agents (highest priority)
|
|
148
|
+
join(process.cwd(), '.attocode', 'agents'),
|
|
149
|
+
// Legacy project path (backward compat)
|
|
150
|
+
join(process.cwd(), '.agents'),
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get the directory where new agents should be created.
|
|
155
|
+
* Prefers .attocode/agents/ in the project root.
|
|
156
|
+
*/
|
|
157
|
+
export function getAgentCreationDirectory() {
|
|
158
|
+
return join(process.cwd(), '.attocode', 'agents');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Get the user-level agent directory.
|
|
162
|
+
*/
|
|
163
|
+
export function getUserAgentDirectory() {
|
|
164
|
+
return join(homedir(), '.attocode', 'agents');
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Determine the source type of an agent based on its path.
|
|
168
|
+
*/
|
|
169
|
+
export function getAgentSourceType(agentPath) {
|
|
170
|
+
const homeDir = homedir();
|
|
171
|
+
const cwd = process.cwd();
|
|
172
|
+
// Check for project-level (.attocode/agents/)
|
|
173
|
+
if (agentPath.startsWith(join(cwd, '.attocode', 'agents'))) {
|
|
174
|
+
return 'project';
|
|
175
|
+
}
|
|
176
|
+
// Check for user-level (~/.attocode/agents/)
|
|
177
|
+
if (agentPath.startsWith(join(homeDir, '.attocode', 'agents'))) {
|
|
178
|
+
return 'user';
|
|
179
|
+
}
|
|
180
|
+
// Legacy paths (.agents/)
|
|
181
|
+
if (agentPath.includes('.agents')) {
|
|
182
|
+
return 'legacy';
|
|
183
|
+
}
|
|
184
|
+
return 'project'; // Default to project
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get a human-readable location string for an agent.
|
|
188
|
+
*/
|
|
189
|
+
export function getAgentLocationDisplay(agent) {
|
|
190
|
+
switch (agent.source) {
|
|
191
|
+
case 'builtin':
|
|
192
|
+
return 'built-in';
|
|
193
|
+
case 'user':
|
|
194
|
+
return '~/.attocode/agents/';
|
|
195
|
+
case 'project':
|
|
196
|
+
return '.attocode/agents/';
|
|
197
|
+
case 'legacy':
|
|
198
|
+
return '.agents/ (legacy)';
|
|
199
|
+
default:
|
|
200
|
+
return agent.filePath || 'unknown';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// =============================================================================
|
|
204
|
+
// AGENT REGISTRY
|
|
205
|
+
// =============================================================================
|
|
206
|
+
/**
|
|
207
|
+
* AgentRegistry manages agent definitions and spawning.
|
|
208
|
+
*/
|
|
209
|
+
export class AgentRegistry {
|
|
210
|
+
agents = new Map();
|
|
211
|
+
listeners = [];
|
|
212
|
+
watchController;
|
|
213
|
+
baseDir;
|
|
214
|
+
constructor(baseDir) {
|
|
215
|
+
this.baseDir = baseDir || process.cwd();
|
|
216
|
+
// Load built-in agents
|
|
217
|
+
for (const agent of BUILTIN_AGENTS) {
|
|
218
|
+
this.agents.set(agent.name, {
|
|
219
|
+
...agent,
|
|
220
|
+
source: 'builtin',
|
|
221
|
+
loadedAt: new Date(),
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Load user-defined agents from all configured directories.
|
|
227
|
+
* Loads in priority order: user-level, project-level, legacy.
|
|
228
|
+
* Later entries with the same name override earlier ones.
|
|
229
|
+
*/
|
|
230
|
+
async loadUserAgents() {
|
|
231
|
+
const directories = getDefaultAgentDirectories();
|
|
232
|
+
for (const agentsDir of directories) {
|
|
233
|
+
if (!existsSync(agentsDir)) {
|
|
234
|
+
continue; // Directory doesn't exist, skip
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
const files = await readdir(agentsDir);
|
|
238
|
+
for (const file of files) {
|
|
239
|
+
const ext = extname(file).toLowerCase();
|
|
240
|
+
if (!['.json', '.yaml', '.yml'].includes(ext))
|
|
241
|
+
continue;
|
|
242
|
+
const filePath = join(agentsDir, file);
|
|
243
|
+
await this.loadAgentFile(filePath);
|
|
244
|
+
}
|
|
245
|
+
// Also check for subdirectories with AGENT.yaml
|
|
246
|
+
for (const file of files) {
|
|
247
|
+
const fullPath = join(agentsDir, file);
|
|
248
|
+
try {
|
|
249
|
+
const stat = await import('node:fs/promises').then(m => m.stat(fullPath));
|
|
250
|
+
if (stat.isDirectory()) {
|
|
251
|
+
const agentFile = await this.findAgentFileInDir(fullPath);
|
|
252
|
+
if (agentFile) {
|
|
253
|
+
await this.loadAgentFile(agentFile);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// Not a directory or can't stat
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
// Directory read failed, continue to next
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Find an agent definition file in a directory.
|
|
269
|
+
*/
|
|
270
|
+
async findAgentFileInDir(dir) {
|
|
271
|
+
const possibleFiles = ['AGENT.yaml', 'AGENT.yml', 'agent.yaml', 'agent.yml', 'agent.json'];
|
|
272
|
+
for (const filename of possibleFiles) {
|
|
273
|
+
const filePath = join(dir, filename);
|
|
274
|
+
if (existsSync(filePath)) {
|
|
275
|
+
return filePath;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Load an agent from a file.
|
|
282
|
+
*/
|
|
283
|
+
async loadAgentFile(filePath) {
|
|
284
|
+
try {
|
|
285
|
+
const content = await readFile(filePath, 'utf-8');
|
|
286
|
+
const ext = extname(filePath).toLowerCase();
|
|
287
|
+
let definition;
|
|
288
|
+
if (ext === '.json') {
|
|
289
|
+
definition = JSON.parse(content);
|
|
290
|
+
}
|
|
291
|
+
else if (ext === '.yaml' || ext === '.yml') {
|
|
292
|
+
// Simple YAML parsing (for basic structures)
|
|
293
|
+
definition = this.parseSimpleYaml(content);
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
// Validate required fields
|
|
299
|
+
if (!definition.name || !definition.description || !definition.systemPrompt) {
|
|
300
|
+
throw new Error('Missing required fields: name, description, systemPrompt');
|
|
301
|
+
}
|
|
302
|
+
// Determine source type from path
|
|
303
|
+
const sourceType = getAgentSourceType(filePath);
|
|
304
|
+
// Store as loaded agent
|
|
305
|
+
const loaded = {
|
|
306
|
+
...definition,
|
|
307
|
+
source: sourceType,
|
|
308
|
+
filePath,
|
|
309
|
+
loadedAt: new Date(),
|
|
310
|
+
};
|
|
311
|
+
this.agents.set(definition.name, loaded);
|
|
312
|
+
this.emit({ type: 'agent.loaded', name: definition.name, source: filePath });
|
|
313
|
+
}
|
|
314
|
+
catch (err) {
|
|
315
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
316
|
+
this.emit({ type: 'agent.error', name: filePath, error });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Simple YAML parser for basic agent definitions.
|
|
321
|
+
*/
|
|
322
|
+
parseSimpleYaml(content) {
|
|
323
|
+
const result = {};
|
|
324
|
+
let currentKey = '';
|
|
325
|
+
let inMultiline = false;
|
|
326
|
+
let multilineContent = [];
|
|
327
|
+
const lines = content.split('\n');
|
|
328
|
+
for (const line of lines) {
|
|
329
|
+
// Skip comments and empty lines
|
|
330
|
+
if (line.trim().startsWith('#') || line.trim() === '') {
|
|
331
|
+
if (inMultiline)
|
|
332
|
+
multilineContent.push('');
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
// Check for multiline continuation
|
|
336
|
+
if (inMultiline) {
|
|
337
|
+
if (line.startsWith(' ') || line.startsWith('\t')) {
|
|
338
|
+
multilineContent.push(line.trim());
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
// End of multiline
|
|
343
|
+
result[currentKey] = multilineContent.join('\n');
|
|
344
|
+
inMultiline = false;
|
|
345
|
+
multilineContent = [];
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// Parse key: value
|
|
349
|
+
const match = line.match(/^(\w+):\s*(.*)$/);
|
|
350
|
+
if (match) {
|
|
351
|
+
const [, key, value] = match;
|
|
352
|
+
currentKey = key;
|
|
353
|
+
if (value === '|' || value === '>') {
|
|
354
|
+
// Start multiline
|
|
355
|
+
inMultiline = true;
|
|
356
|
+
multilineContent = [];
|
|
357
|
+
}
|
|
358
|
+
else if (value.startsWith('[')) {
|
|
359
|
+
// Array
|
|
360
|
+
const arrayMatch = value.match(/\[(.*)\]/);
|
|
361
|
+
if (arrayMatch) {
|
|
362
|
+
result[key] = arrayMatch[1].split(',').map(s => s.trim().replace(/['"]/g, ''));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else if (value === 'true' || value === 'false') {
|
|
366
|
+
result[key] = value === 'true';
|
|
367
|
+
}
|
|
368
|
+
else if (!isNaN(Number(value))) {
|
|
369
|
+
result[key] = Number(value);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
result[key] = value.replace(/^['"]|['"]$/g, '');
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
// Handle final multiline
|
|
377
|
+
if (inMultiline) {
|
|
378
|
+
result[currentKey] = multilineContent.join('\n');
|
|
379
|
+
}
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Watch .agents/ directory for changes.
|
|
384
|
+
*/
|
|
385
|
+
startWatching() {
|
|
386
|
+
const agentsDir = join(this.baseDir, '.agents');
|
|
387
|
+
if (!existsSync(agentsDir))
|
|
388
|
+
return;
|
|
389
|
+
this.watchController = new AbortController();
|
|
390
|
+
// Note: Using a polling approach since fs.watch has platform inconsistencies
|
|
391
|
+
const checkForChanges = async () => {
|
|
392
|
+
await this.loadUserAgents();
|
|
393
|
+
};
|
|
394
|
+
// Check every 5 seconds
|
|
395
|
+
const interval = setInterval(checkForChanges, 5000);
|
|
396
|
+
// Clean up on abort
|
|
397
|
+
this.watchController.signal.addEventListener('abort', () => {
|
|
398
|
+
clearInterval(interval);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Stop watching for changes.
|
|
403
|
+
*/
|
|
404
|
+
stopWatching() {
|
|
405
|
+
this.watchController?.abort();
|
|
406
|
+
this.watchController = undefined;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get an agent by name.
|
|
410
|
+
*/
|
|
411
|
+
getAgent(name) {
|
|
412
|
+
return this.agents.get(name);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Get all agents.
|
|
416
|
+
*/
|
|
417
|
+
getAllAgents() {
|
|
418
|
+
return Array.from(this.agents.values());
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Get agents by source.
|
|
422
|
+
*/
|
|
423
|
+
getAgentsBySource(source) {
|
|
424
|
+
return this.getAllAgents().filter(a => a.source === source);
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Find agents matching a query (for NL routing).
|
|
428
|
+
*/
|
|
429
|
+
findMatchingAgents(query, limit = 3) {
|
|
430
|
+
const queryLower = query.toLowerCase();
|
|
431
|
+
const scored = [];
|
|
432
|
+
for (const agent of this.agents.values()) {
|
|
433
|
+
let score = 0;
|
|
434
|
+
// Check name match
|
|
435
|
+
if (queryLower.includes(agent.name)) {
|
|
436
|
+
score += 10;
|
|
437
|
+
}
|
|
438
|
+
// Check description match
|
|
439
|
+
const descWords = String(agent.description || '').toLowerCase().split(/\s+/);
|
|
440
|
+
for (const word of descWords) {
|
|
441
|
+
if (queryLower.includes(word) && word.length > 3) {
|
|
442
|
+
score += 2;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
// Check capabilities match
|
|
446
|
+
for (const cap of agent.capabilities || []) {
|
|
447
|
+
if (queryLower.includes(cap)) {
|
|
448
|
+
score += 5;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// Check tags match
|
|
452
|
+
for (const tag of agent.tags || []) {
|
|
453
|
+
if (queryLower.includes(tag)) {
|
|
454
|
+
score += 3;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (score > 0) {
|
|
458
|
+
scored.push({ agent, score });
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
// Sort by score descending
|
|
462
|
+
scored.sort((a, b) => b.score - a.score);
|
|
463
|
+
return scored.slice(0, limit).map(s => s.agent);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Register a runtime agent.
|
|
467
|
+
*/
|
|
468
|
+
registerAgent(definition) {
|
|
469
|
+
const loaded = {
|
|
470
|
+
...definition,
|
|
471
|
+
source: 'user',
|
|
472
|
+
loadedAt: new Date(),
|
|
473
|
+
};
|
|
474
|
+
this.agents.set(definition.name, loaded);
|
|
475
|
+
this.emit({ type: 'agent.loaded', name: definition.name, source: 'runtime' });
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Unregister an agent.
|
|
479
|
+
*/
|
|
480
|
+
unregisterAgent(name) {
|
|
481
|
+
const existed = this.agents.delete(name);
|
|
482
|
+
if (existed) {
|
|
483
|
+
this.emit({ type: 'agent.removed', name });
|
|
484
|
+
}
|
|
485
|
+
return existed;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Subscribe to events.
|
|
489
|
+
*/
|
|
490
|
+
on(listener) {
|
|
491
|
+
this.listeners.push(listener);
|
|
492
|
+
return () => {
|
|
493
|
+
const idx = this.listeners.indexOf(listener);
|
|
494
|
+
if (idx >= 0)
|
|
495
|
+
this.listeners.splice(idx, 1);
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Emit an event.
|
|
500
|
+
*/
|
|
501
|
+
emit(event) {
|
|
502
|
+
for (const listener of this.listeners) {
|
|
503
|
+
try {
|
|
504
|
+
listener(event);
|
|
505
|
+
}
|
|
506
|
+
catch {
|
|
507
|
+
// Ignore listener errors
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Cleanup.
|
|
513
|
+
*/
|
|
514
|
+
cleanup() {
|
|
515
|
+
this.stopWatching();
|
|
516
|
+
this.listeners = [];
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
// =============================================================================
|
|
520
|
+
// FACTORY
|
|
521
|
+
// =============================================================================
|
|
522
|
+
/**
|
|
523
|
+
* Create an agent registry and load user agents.
|
|
524
|
+
*/
|
|
525
|
+
export async function createAgentRegistry(baseDir) {
|
|
526
|
+
const registry = new AgentRegistry(baseDir);
|
|
527
|
+
await registry.loadUserAgents();
|
|
528
|
+
return registry;
|
|
529
|
+
}
|
|
530
|
+
// =============================================================================
|
|
531
|
+
// UTILITIES
|
|
532
|
+
// =============================================================================
|
|
533
|
+
/**
|
|
534
|
+
* Filter tools based on agent's tool whitelist and MCP access policy.
|
|
535
|
+
* MCP tool access is controlled by `allowMcpTools`:
|
|
536
|
+
* - true (default): all MCP tools pass through
|
|
537
|
+
* - false: no MCP tools
|
|
538
|
+
* - string[]: only specified MCP tool names
|
|
539
|
+
*/
|
|
540
|
+
export function filterToolsForAgent(agent, allTools) {
|
|
541
|
+
if (!agent.tools || agent.tools.length === 0) {
|
|
542
|
+
// No whitelist — apply MCP filtering only
|
|
543
|
+
if (agent.allowMcpTools === false) {
|
|
544
|
+
return allTools.filter(t => !t.name.startsWith('mcp_'));
|
|
545
|
+
}
|
|
546
|
+
if (Array.isArray(agent.allowMcpTools)) {
|
|
547
|
+
const allowed = agent.allowMcpTools;
|
|
548
|
+
return allTools.filter(t => !t.name.startsWith('mcp_') || allowed.includes(t.name));
|
|
549
|
+
}
|
|
550
|
+
return allTools;
|
|
551
|
+
}
|
|
552
|
+
const mcpPolicy = agent.allowMcpTools;
|
|
553
|
+
return allTools.filter(t => {
|
|
554
|
+
// Check explicit tool whitelist
|
|
555
|
+
if (agent.tools.includes(t.name))
|
|
556
|
+
return true;
|
|
557
|
+
// Check MCP tools based on allowMcpTools policy
|
|
558
|
+
if (t.name.startsWith('mcp_')) {
|
|
559
|
+
if (mcpPolicy === false)
|
|
560
|
+
return false;
|
|
561
|
+
if (Array.isArray(mcpPolicy))
|
|
562
|
+
return mcpPolicy.includes(t.name);
|
|
563
|
+
// Default: allow MCP tools (backward compatible)
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
return false;
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Get a formatted list of agents for display.
|
|
571
|
+
*/
|
|
572
|
+
export function formatAgentList(agents) {
|
|
573
|
+
const lines = [];
|
|
574
|
+
const builtIn = agents.filter(a => a.source === 'builtin');
|
|
575
|
+
const userOrProject = agents.filter(a => a.source === 'user' || a.source === 'project');
|
|
576
|
+
const legacy = agents.filter(a => a.source === 'legacy');
|
|
577
|
+
if (builtIn.length > 0) {
|
|
578
|
+
lines.push('Built-in Agents:');
|
|
579
|
+
for (const agent of builtIn) {
|
|
580
|
+
lines.push(` ${agent.name} - ${String(agent.description || '').split('.')[0]}`);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
if (userOrProject.length > 0) {
|
|
584
|
+
lines.push('\nCustom Agents:');
|
|
585
|
+
for (const agent of userOrProject) {
|
|
586
|
+
const location = getAgentLocationDisplay(agent);
|
|
587
|
+
lines.push(` ${agent.name} - ${String(agent.description || '').split('.')[0]} (${location})`);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (legacy.length > 0) {
|
|
591
|
+
lines.push('\nLegacy Agents (.agents/):');
|
|
592
|
+
for (const agent of legacy) {
|
|
593
|
+
lines.push(` ${agent.name} - ${String(agent.description || '').split('.')[0]}`);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return lines.join('\n');
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Get an agent scaffold template in YAML format.
|
|
600
|
+
*/
|
|
601
|
+
export function getAgentScaffold(name, options = {}) {
|
|
602
|
+
const { description = '[Add description here]', model = 'balanced', capabilities = [], tools = [], } = options;
|
|
603
|
+
return `name: ${name}
|
|
604
|
+
description: ${description}
|
|
605
|
+
model: ${model}
|
|
606
|
+
maxIterations: 30
|
|
607
|
+
maxTokenBudget: 80000
|
|
608
|
+
|
|
609
|
+
capabilities:
|
|
610
|
+
${capabilities.length > 0 ? capabilities.map(c => ` - ${c}`).join('\n') : ' - # Add capabilities for NL matching'}
|
|
611
|
+
|
|
612
|
+
tools:
|
|
613
|
+
${tools.length > 0 ? tools.map(t => ` - ${t}`).join('\n') : ' - read_file\n - list_files\n - glob\n - grep'}
|
|
614
|
+
|
|
615
|
+
systemPrompt: |
|
|
616
|
+
You are ${name}. Your job is to:
|
|
617
|
+
- [Add primary responsibilities]
|
|
618
|
+
- [Add secondary tasks]
|
|
619
|
+
|
|
620
|
+
Guidelines:
|
|
621
|
+
- Be thorough but concise
|
|
622
|
+
- Focus on the user's specific needs
|
|
623
|
+
- Ask clarifying questions when needed
|
|
624
|
+
|
|
625
|
+
tags:
|
|
626
|
+
- ${name}
|
|
627
|
+
`;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Create an agent scaffold in the .attocode/agents/ directory.
|
|
631
|
+
*/
|
|
632
|
+
export async function createAgentScaffold(name, options = {}) {
|
|
633
|
+
try {
|
|
634
|
+
// Validate name
|
|
635
|
+
if (!/^[a-z][a-z0-9-]*$/.test(name)) {
|
|
636
|
+
return {
|
|
637
|
+
success: false,
|
|
638
|
+
error: 'Agent name must start with a letter and contain only lowercase letters, numbers, and hyphens',
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
// Determine target directory
|
|
642
|
+
const baseDir = options.userLevel
|
|
643
|
+
? getUserAgentDirectory()
|
|
644
|
+
: getAgentCreationDirectory();
|
|
645
|
+
const agentDir = join(baseDir, name);
|
|
646
|
+
const agentPath = join(agentDir, 'AGENT.yaml');
|
|
647
|
+
// Check if agent already exists
|
|
648
|
+
if (existsSync(agentPath)) {
|
|
649
|
+
return {
|
|
650
|
+
success: false,
|
|
651
|
+
error: `Agent "${name}" already exists at ${agentPath}`,
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
// Create directory structure
|
|
655
|
+
await mkdir(agentDir, { recursive: true });
|
|
656
|
+
// Write agent file
|
|
657
|
+
const content = getAgentScaffold(name, options);
|
|
658
|
+
await writeFile(agentPath, content, 'utf-8');
|
|
659
|
+
return {
|
|
660
|
+
success: true,
|
|
661
|
+
path: agentPath,
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
catch (error) {
|
|
665
|
+
return {
|
|
666
|
+
success: false,
|
|
667
|
+
error: error instanceof Error ? error.message : String(error),
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Get statistics about loaded agents by source.
|
|
673
|
+
*/
|
|
674
|
+
export function getAgentStats(agents) {
|
|
675
|
+
const stats = {
|
|
676
|
+
builtin: 0,
|
|
677
|
+
user: 0,
|
|
678
|
+
project: 0,
|
|
679
|
+
legacy: 0,
|
|
680
|
+
};
|
|
681
|
+
for (const agent of agents) {
|
|
682
|
+
stats[agent.source]++;
|
|
683
|
+
}
|
|
684
|
+
return stats;
|
|
685
|
+
}
|
|
686
|
+
//# sourceMappingURL=agent-registry.js.map
|