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,757 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Blackboard Integration
|
|
3
|
+
*
|
|
4
|
+
* Implements the Blackboard pattern for subagent coordination.
|
|
5
|
+
* Enables real-time knowledge sharing between parallel agents without
|
|
6
|
+
* tight coupling.
|
|
7
|
+
*
|
|
8
|
+
* Key features:
|
|
9
|
+
* - Finding posting: Agents share discoveries as they work
|
|
10
|
+
* - Topic subscriptions: Agents subscribe to relevant findings
|
|
11
|
+
* - Resource claiming: Prevent file edit conflicts
|
|
12
|
+
* - Deduplication: Avoid researching what another agent already found
|
|
13
|
+
* - Query interface: Search findings by topic, agent, or content
|
|
14
|
+
*/
|
|
15
|
+
// =============================================================================
|
|
16
|
+
// SHARED BLACKBOARD
|
|
17
|
+
// =============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Shared blackboard for subagent coordination.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const blackboard = createSharedBlackboard();
|
|
24
|
+
*
|
|
25
|
+
* // Agent A posts a finding
|
|
26
|
+
* blackboard.post('agent-a', {
|
|
27
|
+
* topic: 'authentication',
|
|
28
|
+
* content: 'Found JWT implementation in src/auth/jwt.ts',
|
|
29
|
+
* type: 'discovery',
|
|
30
|
+
* confidence: 0.9,
|
|
31
|
+
* relatedFiles: ['src/auth/jwt.ts'],
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Agent B subscribes to authentication findings
|
|
35
|
+
* blackboard.subscribe({
|
|
36
|
+
* agentId: 'agent-b',
|
|
37
|
+
* topicPattern: 'auth*',
|
|
38
|
+
* callback: (finding) => {
|
|
39
|
+
* console.log('Got finding:', finding.content);
|
|
40
|
+
* },
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* // Agent A claims a file for editing
|
|
44
|
+
* const claimed = blackboard.claim('src/auth/jwt.ts', 'agent-a', 'write');
|
|
45
|
+
* if (claimed) {
|
|
46
|
+
* // Safe to edit
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export class SharedBlackboard {
|
|
51
|
+
config;
|
|
52
|
+
findings = new Map();
|
|
53
|
+
claims = new Map();
|
|
54
|
+
subscriptions = new Map();
|
|
55
|
+
listeners = [];
|
|
56
|
+
duplicatesAvoided = 0;
|
|
57
|
+
findingCounter = 0;
|
|
58
|
+
subscriptionCounter = 0;
|
|
59
|
+
/** Optional trace collector for emitting blackboard.event trace events. */
|
|
60
|
+
traceCollector;
|
|
61
|
+
constructor(config = {}) {
|
|
62
|
+
this.config = {
|
|
63
|
+
maxFindings: config.maxFindings ?? 1000,
|
|
64
|
+
defaultClaimTTL: config.defaultClaimTTL ?? 60000, // 1 minute
|
|
65
|
+
deduplicateFindings: config.deduplicateFindings ?? true,
|
|
66
|
+
deduplicationThreshold: config.deduplicationThreshold ?? 0.85,
|
|
67
|
+
persistToFile: config.persistToFile ?? false,
|
|
68
|
+
persistencePath: config.persistencePath ?? '.blackboard.json',
|
|
69
|
+
};
|
|
70
|
+
// Start claim expiry checker
|
|
71
|
+
this.startClaimExpiryChecker();
|
|
72
|
+
}
|
|
73
|
+
// ===========================================================================
|
|
74
|
+
// FINDINGS
|
|
75
|
+
// ===========================================================================
|
|
76
|
+
/**
|
|
77
|
+
* Post a finding to the blackboard.
|
|
78
|
+
*/
|
|
79
|
+
post(agentId, input) {
|
|
80
|
+
// Check for duplicates
|
|
81
|
+
if (this.config.deduplicateFindings) {
|
|
82
|
+
const duplicate = this.findDuplicate(input);
|
|
83
|
+
if (duplicate) {
|
|
84
|
+
this.duplicatesAvoided++;
|
|
85
|
+
return duplicate;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const finding = {
|
|
89
|
+
...input,
|
|
90
|
+
id: `finding-${++this.findingCounter}-${Date.now()}`,
|
|
91
|
+
agentId,
|
|
92
|
+
timestamp: new Date(),
|
|
93
|
+
};
|
|
94
|
+
// Handle supersession
|
|
95
|
+
if (finding.supersedesId) {
|
|
96
|
+
this.emit({
|
|
97
|
+
type: 'finding.superseded',
|
|
98
|
+
oldId: finding.supersedesId,
|
|
99
|
+
newId: finding.id,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// Enforce max findings
|
|
103
|
+
if (this.findings.size >= this.config.maxFindings) {
|
|
104
|
+
this.evictOldestFinding();
|
|
105
|
+
}
|
|
106
|
+
this.findings.set(finding.id, finding);
|
|
107
|
+
this.emit({ type: 'finding.posted', finding });
|
|
108
|
+
// Emit trace event for finding posted
|
|
109
|
+
this.traceCollector?.record({
|
|
110
|
+
type: 'blackboard.event',
|
|
111
|
+
data: {
|
|
112
|
+
action: 'finding.posted',
|
|
113
|
+
agentId: finding.agentId,
|
|
114
|
+
topic: finding.topic,
|
|
115
|
+
content: finding.content.slice(0, 200),
|
|
116
|
+
confidence: finding.confidence,
|
|
117
|
+
findingType: finding.type,
|
|
118
|
+
relatedFiles: finding.relatedFiles,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
// Notify subscribers
|
|
122
|
+
this.notifySubscribers(finding);
|
|
123
|
+
return finding;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Update an existing finding.
|
|
127
|
+
*/
|
|
128
|
+
update(findingId, updates) {
|
|
129
|
+
const existing = this.findings.get(findingId);
|
|
130
|
+
if (!existing)
|
|
131
|
+
return null;
|
|
132
|
+
const updated = {
|
|
133
|
+
...existing,
|
|
134
|
+
...updates,
|
|
135
|
+
};
|
|
136
|
+
this.findings.set(findingId, updated);
|
|
137
|
+
this.emit({ type: 'finding.updated', finding: updated });
|
|
138
|
+
// Emit trace event for finding updated
|
|
139
|
+
this.traceCollector?.record({
|
|
140
|
+
type: 'blackboard.event',
|
|
141
|
+
data: {
|
|
142
|
+
action: 'finding.updated',
|
|
143
|
+
agentId: updated.agentId,
|
|
144
|
+
topic: updated.topic,
|
|
145
|
+
content: updated.content.slice(0, 200),
|
|
146
|
+
confidence: updated.confidence,
|
|
147
|
+
findingType: updated.type,
|
|
148
|
+
relatedFiles: updated.relatedFiles,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
return updated;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get a finding by ID.
|
|
155
|
+
*/
|
|
156
|
+
getFinding(id) {
|
|
157
|
+
return this.findings.get(id);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Query findings with filters.
|
|
161
|
+
*/
|
|
162
|
+
query(filter = {}) {
|
|
163
|
+
let results = Array.from(this.findings.values());
|
|
164
|
+
// Apply filters
|
|
165
|
+
if (filter.agentId) {
|
|
166
|
+
results = results.filter((f) => f.agentId === filter.agentId);
|
|
167
|
+
}
|
|
168
|
+
if (filter.topic) {
|
|
169
|
+
const pattern = this.topicToRegex(filter.topic);
|
|
170
|
+
results = results.filter((f) => pattern.test(f.topic));
|
|
171
|
+
}
|
|
172
|
+
if (filter.types && filter.types.length > 0) {
|
|
173
|
+
results = results.filter((f) => filter.types.includes(f.type));
|
|
174
|
+
}
|
|
175
|
+
if (filter.tags && filter.tags.length > 0) {
|
|
176
|
+
results = results.filter((f) => f.tags?.some((tag) => filter.tags.includes(tag)));
|
|
177
|
+
}
|
|
178
|
+
if (filter.minConfidence !== undefined) {
|
|
179
|
+
results = results.filter((f) => f.confidence >= filter.minConfidence);
|
|
180
|
+
}
|
|
181
|
+
if (filter.since) {
|
|
182
|
+
results = results.filter((f) => f.timestamp >= filter.since);
|
|
183
|
+
}
|
|
184
|
+
if (filter.relatedFiles && filter.relatedFiles.length > 0) {
|
|
185
|
+
results = results.filter((f) => f.relatedFiles?.some((file) => filter.relatedFiles.includes(file)));
|
|
186
|
+
}
|
|
187
|
+
if (filter.contentSearch) {
|
|
188
|
+
const searchLower = filter.contentSearch.toLowerCase();
|
|
189
|
+
results = results.filter((f) => f.content.toLowerCase().includes(searchLower));
|
|
190
|
+
}
|
|
191
|
+
// Sort by timestamp (newest first)
|
|
192
|
+
results.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
|
|
193
|
+
// Apply limit
|
|
194
|
+
if (filter.limit) {
|
|
195
|
+
results = results.slice(0, filter.limit);
|
|
196
|
+
}
|
|
197
|
+
return results;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get all findings.
|
|
201
|
+
*/
|
|
202
|
+
getAllFindings() {
|
|
203
|
+
return Array.from(this.findings.values());
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get findings by topic.
|
|
207
|
+
*/
|
|
208
|
+
getByTopic(topic) {
|
|
209
|
+
return this.query({ topic });
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Get findings by agent.
|
|
213
|
+
*/
|
|
214
|
+
getByAgent(agentId) {
|
|
215
|
+
return this.query({ agentId });
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Check if a finding similar to the input already exists.
|
|
219
|
+
*/
|
|
220
|
+
findDuplicate(input) {
|
|
221
|
+
for (const existing of this.findings.values()) {
|
|
222
|
+
if (existing.topic === input.topic && existing.type === input.type) {
|
|
223
|
+
const similarity = this.calculateSimilarity(existing.content, input.content);
|
|
224
|
+
if (similarity >= this.config.deduplicationThreshold) {
|
|
225
|
+
return existing;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Calculate content similarity (simple Jaccard index).
|
|
233
|
+
*/
|
|
234
|
+
calculateSimilarity(a, b) {
|
|
235
|
+
const wordsA = new Set(a.toLowerCase().split(/\s+/));
|
|
236
|
+
const wordsB = new Set(b.toLowerCase().split(/\s+/));
|
|
237
|
+
const intersection = new Set([...wordsA].filter((x) => wordsB.has(x)));
|
|
238
|
+
const union = new Set([...wordsA, ...wordsB]);
|
|
239
|
+
return intersection.size / union.size;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Evict the oldest finding.
|
|
243
|
+
*/
|
|
244
|
+
evictOldestFinding() {
|
|
245
|
+
let oldest = null;
|
|
246
|
+
let oldestTime = Infinity;
|
|
247
|
+
for (const finding of this.findings.values()) {
|
|
248
|
+
const time = finding.timestamp.getTime();
|
|
249
|
+
if (time < oldestTime) {
|
|
250
|
+
oldestTime = time;
|
|
251
|
+
oldest = finding;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (oldest) {
|
|
255
|
+
this.findings.delete(oldest.id);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// ===========================================================================
|
|
259
|
+
// SUBSCRIPTIONS
|
|
260
|
+
// ===========================================================================
|
|
261
|
+
/**
|
|
262
|
+
* Subscribe to findings matching a pattern.
|
|
263
|
+
*/
|
|
264
|
+
subscribe(options) {
|
|
265
|
+
const subscription = {
|
|
266
|
+
...options,
|
|
267
|
+
id: `sub-${++this.subscriptionCounter}-${Date.now()}`,
|
|
268
|
+
createdAt: new Date(),
|
|
269
|
+
};
|
|
270
|
+
this.subscriptions.set(subscription.id, subscription);
|
|
271
|
+
return subscription.id;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Unsubscribe from findings.
|
|
275
|
+
*/
|
|
276
|
+
unsubscribe(subscriptionId) {
|
|
277
|
+
return this.subscriptions.delete(subscriptionId);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Unsubscribe all subscriptions for an agent.
|
|
281
|
+
*/
|
|
282
|
+
unsubscribeAgent(agentId) {
|
|
283
|
+
let count = 0;
|
|
284
|
+
for (const [id, sub] of this.subscriptions) {
|
|
285
|
+
if (sub.agentId === agentId) {
|
|
286
|
+
this.subscriptions.delete(id);
|
|
287
|
+
count++;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return count;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Notify matching subscribers of a new finding.
|
|
294
|
+
*/
|
|
295
|
+
notifySubscribers(finding) {
|
|
296
|
+
for (const [id, sub] of this.subscriptions) {
|
|
297
|
+
if (this.matchesSubscription(finding, sub)) {
|
|
298
|
+
try {
|
|
299
|
+
sub.callback(finding);
|
|
300
|
+
this.emit({
|
|
301
|
+
type: 'subscription.matched',
|
|
302
|
+
subscriptionId: id,
|
|
303
|
+
findingId: finding.id,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
// Ignore callback errors
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Check if a finding matches a subscription.
|
|
314
|
+
*/
|
|
315
|
+
matchesSubscription(finding, sub) {
|
|
316
|
+
// Don't notify the posting agent
|
|
317
|
+
if (finding.agentId === sub.agentId) {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
// Check topic pattern
|
|
321
|
+
if (sub.topicPattern) {
|
|
322
|
+
const pattern = this.topicToRegex(sub.topicPattern);
|
|
323
|
+
if (!pattern.test(finding.topic)) {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// Check types
|
|
328
|
+
if (sub.types && sub.types.length > 0) {
|
|
329
|
+
if (!sub.types.includes(finding.type)) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
// Check tags
|
|
334
|
+
if (sub.tags && sub.tags.length > 0) {
|
|
335
|
+
if (!finding.tags?.some((tag) => sub.tags.includes(tag))) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Convert a topic pattern to a regex.
|
|
343
|
+
*/
|
|
344
|
+
topicToRegex(pattern) {
|
|
345
|
+
const escaped = pattern
|
|
346
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
347
|
+
.replace(/\*/g, '.*')
|
|
348
|
+
.replace(/\?/g, '.');
|
|
349
|
+
return new RegExp(`^${escaped}$`, 'i');
|
|
350
|
+
}
|
|
351
|
+
// ===========================================================================
|
|
352
|
+
// RESOURCE CLAIMS
|
|
353
|
+
// ===========================================================================
|
|
354
|
+
/**
|
|
355
|
+
* Claim a resource for exclusive or shared access.
|
|
356
|
+
*/
|
|
357
|
+
claim(resource, agentId, type, options = {}) {
|
|
358
|
+
const existing = this.claims.get(resource);
|
|
359
|
+
// Check for conflicts
|
|
360
|
+
if (existing) {
|
|
361
|
+
// Same agent can upgrade/extend claim
|
|
362
|
+
if (existing.agentId === agentId) {
|
|
363
|
+
const newClaim = {
|
|
364
|
+
resource,
|
|
365
|
+
agentId,
|
|
366
|
+
type,
|
|
367
|
+
claimedAt: existing.claimedAt,
|
|
368
|
+
expiresAt: new Date(Date.now() + (options.ttl ?? this.config.defaultClaimTTL)),
|
|
369
|
+
intent: options.intent,
|
|
370
|
+
};
|
|
371
|
+
this.claims.set(resource, newClaim);
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
374
|
+
// Check if claims are compatible
|
|
375
|
+
if (existing.type === 'exclusive' || type === 'exclusive' || type === 'write') {
|
|
376
|
+
this.emit({
|
|
377
|
+
type: 'claim.conflict',
|
|
378
|
+
resource,
|
|
379
|
+
existingAgent: existing.agentId,
|
|
380
|
+
requestingAgent: agentId,
|
|
381
|
+
});
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
// Read claims are compatible with other read claims
|
|
385
|
+
if (existing.type === 'read' && type === 'read') {
|
|
386
|
+
// Allow multiple read claims - but track the latest
|
|
387
|
+
// In a full implementation, we'd track multiple claims
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
const claim = {
|
|
391
|
+
resource,
|
|
392
|
+
agentId,
|
|
393
|
+
type,
|
|
394
|
+
claimedAt: new Date(),
|
|
395
|
+
expiresAt: new Date(Date.now() + (options.ttl ?? this.config.defaultClaimTTL)),
|
|
396
|
+
intent: options.intent,
|
|
397
|
+
};
|
|
398
|
+
this.claims.set(resource, claim);
|
|
399
|
+
this.emit({ type: 'claim.acquired', claim });
|
|
400
|
+
// Emit trace event for claim acquired
|
|
401
|
+
this.traceCollector?.record({
|
|
402
|
+
type: 'blackboard.event',
|
|
403
|
+
data: {
|
|
404
|
+
action: 'claim.acquired',
|
|
405
|
+
agentId: claim.agentId,
|
|
406
|
+
resource: claim.resource,
|
|
407
|
+
claimType: claim.type,
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Release a resource claim.
|
|
414
|
+
*/
|
|
415
|
+
release(resource, agentId) {
|
|
416
|
+
const existing = this.claims.get(resource);
|
|
417
|
+
if (!existing || existing.agentId !== agentId) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
this.claims.delete(resource);
|
|
421
|
+
this.emit({ type: 'claim.released', resource, agentId });
|
|
422
|
+
// Emit trace event for claim released
|
|
423
|
+
this.traceCollector?.record({
|
|
424
|
+
type: 'blackboard.event',
|
|
425
|
+
data: {
|
|
426
|
+
action: 'claim.released',
|
|
427
|
+
agentId,
|
|
428
|
+
resource,
|
|
429
|
+
},
|
|
430
|
+
});
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Release all claims for an agent.
|
|
435
|
+
*/
|
|
436
|
+
releaseAll(agentId) {
|
|
437
|
+
let count = 0;
|
|
438
|
+
for (const [resource, claim] of this.claims) {
|
|
439
|
+
if (claim.agentId === agentId) {
|
|
440
|
+
this.claims.delete(resource);
|
|
441
|
+
this.emit({ type: 'claim.released', resource, agentId });
|
|
442
|
+
count++;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return count;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Check if a resource is claimed.
|
|
449
|
+
*/
|
|
450
|
+
isClaimed(resource) {
|
|
451
|
+
const claim = this.claims.get(resource);
|
|
452
|
+
if (!claim)
|
|
453
|
+
return false;
|
|
454
|
+
// Check expiry
|
|
455
|
+
if (claim.expiresAt < new Date()) {
|
|
456
|
+
this.claims.delete(resource);
|
|
457
|
+
this.emit({ type: 'claim.expired', claim });
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Get the claim on a resource.
|
|
464
|
+
*/
|
|
465
|
+
getClaim(resource) {
|
|
466
|
+
const claim = this.claims.get(resource);
|
|
467
|
+
if (!claim)
|
|
468
|
+
return undefined;
|
|
469
|
+
// Check expiry
|
|
470
|
+
if (claim.expiresAt < new Date()) {
|
|
471
|
+
this.claims.delete(resource);
|
|
472
|
+
this.emit({ type: 'claim.expired', claim });
|
|
473
|
+
return undefined;
|
|
474
|
+
}
|
|
475
|
+
return claim;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Get all claims by an agent.
|
|
479
|
+
*/
|
|
480
|
+
getAgentClaims(agentId) {
|
|
481
|
+
const claims = [];
|
|
482
|
+
const now = new Date();
|
|
483
|
+
for (const claim of this.claims.values()) {
|
|
484
|
+
if (claim.agentId === agentId) {
|
|
485
|
+
if (claim.expiresAt < now) {
|
|
486
|
+
this.claims.delete(claim.resource);
|
|
487
|
+
this.emit({ type: 'claim.expired', claim });
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
claims.push(claim);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return claims;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Start periodic claim expiry checking.
|
|
498
|
+
*/
|
|
499
|
+
startClaimExpiryChecker() {
|
|
500
|
+
setInterval(() => {
|
|
501
|
+
const now = new Date();
|
|
502
|
+
for (const [resource, claim] of this.claims) {
|
|
503
|
+
if (claim.expiresAt < now) {
|
|
504
|
+
this.claims.delete(resource);
|
|
505
|
+
this.emit({ type: 'claim.expired', claim });
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}, 10000); // Check every 10 seconds
|
|
509
|
+
}
|
|
510
|
+
// ===========================================================================
|
|
511
|
+
// COORDINATION HELPERS
|
|
512
|
+
// ===========================================================================
|
|
513
|
+
/**
|
|
514
|
+
* Check if an agent has already researched a topic.
|
|
515
|
+
*/
|
|
516
|
+
hasResearched(topic, options = {}) {
|
|
517
|
+
const findings = this.query({
|
|
518
|
+
topic,
|
|
519
|
+
types: ['discovery', 'analysis'],
|
|
520
|
+
minConfidence: options.minConfidence ?? 0.7,
|
|
521
|
+
});
|
|
522
|
+
return findings.length > 0;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Get the best finding for a topic.
|
|
526
|
+
*/
|
|
527
|
+
getBestFinding(topic) {
|
|
528
|
+
const findings = this.query({ topic });
|
|
529
|
+
if (findings.length === 0)
|
|
530
|
+
return undefined;
|
|
531
|
+
// Return highest confidence
|
|
532
|
+
return findings.reduce((best, current) => current.confidence > best.confidence ? current : best);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Ask a question to other agents.
|
|
536
|
+
*/
|
|
537
|
+
askQuestion(agentId, topic, question, tags) {
|
|
538
|
+
return this.post(agentId, {
|
|
539
|
+
topic,
|
|
540
|
+
content: question,
|
|
541
|
+
type: 'question',
|
|
542
|
+
confidence: 1,
|
|
543
|
+
tags,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Answer a question.
|
|
548
|
+
*/
|
|
549
|
+
answerQuestion(agentId, questionId, answer, confidence) {
|
|
550
|
+
const question = this.getFinding(questionId);
|
|
551
|
+
if (!question) {
|
|
552
|
+
throw new Error(`Question ${questionId} not found`);
|
|
553
|
+
}
|
|
554
|
+
return this.post(agentId, {
|
|
555
|
+
topic: question.topic,
|
|
556
|
+
content: answer,
|
|
557
|
+
type: 'answer',
|
|
558
|
+
confidence,
|
|
559
|
+
tags: question.tags,
|
|
560
|
+
metadata: { answersQuestionId: questionId },
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Report a blocker.
|
|
565
|
+
*/
|
|
566
|
+
reportBlocker(agentId, topic, description, relatedFiles) {
|
|
567
|
+
return this.post(agentId, {
|
|
568
|
+
topic,
|
|
569
|
+
content: description,
|
|
570
|
+
type: 'blocker',
|
|
571
|
+
confidence: 1,
|
|
572
|
+
relatedFiles,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Report progress.
|
|
577
|
+
*/
|
|
578
|
+
reportProgress(agentId, topic, description, metadata) {
|
|
579
|
+
return this.post(agentId, {
|
|
580
|
+
topic,
|
|
581
|
+
content: description,
|
|
582
|
+
type: 'progress',
|
|
583
|
+
confidence: 1,
|
|
584
|
+
metadata,
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
// ===========================================================================
|
|
588
|
+
// STATISTICS & UTILITIES
|
|
589
|
+
// ===========================================================================
|
|
590
|
+
/**
|
|
591
|
+
* Get blackboard statistics.
|
|
592
|
+
*/
|
|
593
|
+
getStats() {
|
|
594
|
+
const findingsByType = new Map();
|
|
595
|
+
const findingsByAgent = new Map();
|
|
596
|
+
for (const finding of this.findings.values()) {
|
|
597
|
+
findingsByType.set(finding.type, (findingsByType.get(finding.type) ?? 0) + 1);
|
|
598
|
+
findingsByAgent.set(finding.agentId, (findingsByAgent.get(finding.agentId) ?? 0) + 1);
|
|
599
|
+
}
|
|
600
|
+
return {
|
|
601
|
+
totalFindings: this.findings.size,
|
|
602
|
+
findingsByType,
|
|
603
|
+
findingsByAgent,
|
|
604
|
+
activeClaims: this.claims.size,
|
|
605
|
+
activeSubscriptions: this.subscriptions.size,
|
|
606
|
+
duplicatesAvoided: this.duplicatesAvoided,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Generate a summary of the blackboard state.
|
|
611
|
+
*/
|
|
612
|
+
summarize() {
|
|
613
|
+
const stats = this.getStats();
|
|
614
|
+
const lines = [
|
|
615
|
+
`Blackboard Summary`,
|
|
616
|
+
`==================`,
|
|
617
|
+
`Total findings: ${stats.totalFindings}`,
|
|
618
|
+
`Active claims: ${stats.activeClaims}`,
|
|
619
|
+
`Active subscriptions: ${stats.activeSubscriptions}`,
|
|
620
|
+
`Duplicates avoided: ${stats.duplicatesAvoided}`,
|
|
621
|
+
``,
|
|
622
|
+
`Findings by type:`,
|
|
623
|
+
];
|
|
624
|
+
for (const [type, count] of stats.findingsByType) {
|
|
625
|
+
lines.push(` - ${type}: ${count}`);
|
|
626
|
+
}
|
|
627
|
+
lines.push(``, `Findings by agent:`);
|
|
628
|
+
for (const [agent, count] of stats.findingsByAgent) {
|
|
629
|
+
lines.push(` - ${agent}: ${count}`);
|
|
630
|
+
}
|
|
631
|
+
// Recent findings
|
|
632
|
+
const recent = this.query({ limit: 5 });
|
|
633
|
+
if (recent.length > 0) {
|
|
634
|
+
lines.push(``, `Recent findings:`);
|
|
635
|
+
for (const f of recent) {
|
|
636
|
+
lines.push(` - [${f.type}] ${f.topic}: ${f.content.slice(0, 50)}...`);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return lines.join('\n');
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Clear all data.
|
|
643
|
+
*/
|
|
644
|
+
clear() {
|
|
645
|
+
this.findings.clear();
|
|
646
|
+
this.claims.clear();
|
|
647
|
+
this.subscriptions.clear();
|
|
648
|
+
this.duplicatesAvoided = 0;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Clear findings only (keep claims and subscriptions).
|
|
652
|
+
*/
|
|
653
|
+
clearFindings() {
|
|
654
|
+
this.findings.clear();
|
|
655
|
+
this.duplicatesAvoided = 0;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Subscribe to blackboard events.
|
|
659
|
+
*/
|
|
660
|
+
on(listener) {
|
|
661
|
+
this.listeners.push(listener);
|
|
662
|
+
return () => {
|
|
663
|
+
const idx = this.listeners.indexOf(listener);
|
|
664
|
+
if (idx >= 0)
|
|
665
|
+
this.listeners.splice(idx, 1);
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
emit(event) {
|
|
669
|
+
for (const listener of this.listeners) {
|
|
670
|
+
try {
|
|
671
|
+
listener(event);
|
|
672
|
+
}
|
|
673
|
+
catch {
|
|
674
|
+
// Ignore listener errors
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
// =============================================================================
|
|
680
|
+
// FACTORY FUNCTIONS
|
|
681
|
+
// =============================================================================
|
|
682
|
+
/**
|
|
683
|
+
* Create a shared blackboard.
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* ```typescript
|
|
687
|
+
* // Create blackboard for a multi-agent task
|
|
688
|
+
* const blackboard = createSharedBlackboard({
|
|
689
|
+
* maxFindings: 500,
|
|
690
|
+
* deduplicateFindings: true,
|
|
691
|
+
* });
|
|
692
|
+
*
|
|
693
|
+
* // Agent A posts discovery
|
|
694
|
+
* blackboard.post('agent-a', {
|
|
695
|
+
* topic: 'database.schema',
|
|
696
|
+
* content: 'Found User table with columns: id, email, password_hash',
|
|
697
|
+
* type: 'discovery',
|
|
698
|
+
* confidence: 0.95,
|
|
699
|
+
* relatedFiles: ['migrations/001_users.sql'],
|
|
700
|
+
* });
|
|
701
|
+
*
|
|
702
|
+
* // Agent B subscribes to database findings
|
|
703
|
+
* blackboard.subscribe({
|
|
704
|
+
* agentId: 'agent-b',
|
|
705
|
+
* topicPattern: 'database.*',
|
|
706
|
+
* callback: (finding) => {
|
|
707
|
+
* // Use the finding in context
|
|
708
|
+
* },
|
|
709
|
+
* });
|
|
710
|
+
*
|
|
711
|
+
* // Agent A claims a file for editing
|
|
712
|
+
* if (blackboard.claim('src/models/user.ts', 'agent-a', 'write')) {
|
|
713
|
+
* // Safe to edit
|
|
714
|
+
* // ... make changes ...
|
|
715
|
+
* blackboard.release('src/models/user.ts', 'agent-a');
|
|
716
|
+
* }
|
|
717
|
+
* ```
|
|
718
|
+
*/
|
|
719
|
+
export function createSharedBlackboard(config = {}) {
|
|
720
|
+
return new SharedBlackboard(config);
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Create a context-aware finding from agent output.
|
|
724
|
+
*/
|
|
725
|
+
export function createFindingFromOutput(_agentId, output, options) {
|
|
726
|
+
return {
|
|
727
|
+
topic: options.topic,
|
|
728
|
+
content: output,
|
|
729
|
+
type: options.type ?? 'analysis',
|
|
730
|
+
confidence: options.confidence ?? 0.8,
|
|
731
|
+
relatedFiles: options.relatedFiles,
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Extract key findings from a text summary.
|
|
736
|
+
*/
|
|
737
|
+
export function extractFindings(text, topic) {
|
|
738
|
+
const findings = [];
|
|
739
|
+
// Look for bullet points or numbered items
|
|
740
|
+
const lines = text.split('\n');
|
|
741
|
+
for (const line of lines) {
|
|
742
|
+
const trimmed = line.trim();
|
|
743
|
+
if (trimmed.match(/^[-*•]\s+/) || trimmed.match(/^\d+\.\s+/)) {
|
|
744
|
+
const content = trimmed.replace(/^[-*•\d.]+\s+/, '');
|
|
745
|
+
if (content.length > 10) {
|
|
746
|
+
findings.push({
|
|
747
|
+
topic,
|
|
748
|
+
content,
|
|
749
|
+
type: 'discovery',
|
|
750
|
+
confidence: 0.7,
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return findings;
|
|
756
|
+
}
|
|
757
|
+
//# sourceMappingURL=shared-blackboard.js.map
|