byterover-cli 1.8.0 → 2.0.0
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/README.md +64 -564
- package/bin/kill-daemon.js +78 -0
- package/bin/run.js +2 -2
- package/dist/agent/core/domain/blob/types.d.ts +8 -2
- package/dist/agent/core/domain/llm/index.d.ts +1 -1
- package/dist/agent/core/domain/llm/index.js +1 -1
- package/dist/agent/core/domain/llm/registry.js +353 -14
- package/dist/agent/core/domain/llm/schemas.d.ts +13 -13
- package/dist/agent/core/domain/llm/schemas.js +3 -3
- package/dist/agent/core/domain/llm/types.d.ts +15 -5
- package/dist/agent/core/domain/llm/types.js +8 -2
- package/dist/agent/core/domain/sandbox/types.d.ts +6 -0
- package/dist/agent/core/domain/session/session-metadata.d.ts +7 -2
- package/dist/agent/core/domain/session/session-metadata.js +14 -4
- package/dist/agent/core/domain/streaming/types.d.ts +2 -0
- package/dist/agent/core/domain/tools/types.d.ts +2 -0
- package/dist/agent/core/interfaces/i-chat-session.d.ts +1 -1
- package/dist/agent/core/interfaces/i-cipher-agent.d.ts +62 -0
- package/dist/agent/core/interfaces/i-curate-service.d.ts +23 -8
- package/dist/agent/core/interfaces/i-history-storage.d.ts +8 -0
- package/dist/agent/core/interfaces/i-key-storage.d.ts +11 -0
- package/dist/agent/core/interfaces/i-llm-service.d.ts +1 -1
- package/dist/agent/core/interfaces/i-sandbox-service.d.ts +26 -0
- package/dist/agent/core/interfaces/i-session-persistence.d.ts +3 -36
- package/dist/agent/core/interfaces/i-session-persistence.js +1 -1
- package/dist/agent/infra/agent/agent-schemas.d.ts +26 -5
- package/dist/agent/infra/agent/agent-schemas.js +10 -3
- package/dist/agent/infra/agent/cipher-agent.d.ts +87 -2
- package/dist/agent/infra/agent/cipher-agent.js +191 -16
- package/dist/agent/infra/agent/interactive-loop.js +1 -5
- package/dist/agent/infra/agent/provider-update-config.d.ts +19 -0
- package/dist/agent/infra/agent/service-initializer.d.ts +27 -6
- package/dist/agent/infra/agent/service-initializer.js +46 -60
- package/dist/agent/infra/blob/blob-storage-factory.d.ts +1 -1
- package/dist/agent/infra/blob/blob-storage-factory.js +1 -1
- package/dist/agent/infra/blob/sqlite-blob-storage.js +8 -5
- package/dist/agent/infra/file-system/file-system-service.js +6 -3
- package/dist/agent/infra/http/internal-llm-http-service.d.ts +9 -5
- package/dist/agent/infra/http/internal-llm-http-service.js +12 -7
- package/dist/agent/infra/llm/{internal-llm-service.d.ts → agent-llm-service.d.ts} +52 -7
- package/dist/agent/infra/llm/{internal-llm-service.js → agent-llm-service.js} +302 -90
- package/dist/agent/infra/llm/context/compaction/compaction-service.d.ts +14 -12
- package/dist/agent/infra/llm/context/compaction/compaction-service.js +26 -9
- package/dist/agent/infra/llm/context/compression/reactive-overflow.js +12 -3
- package/dist/agent/infra/llm/context/context-manager.d.ts +44 -3
- package/dist/agent/infra/llm/context/context-manager.js +203 -98
- package/dist/agent/infra/llm/context/deferred-effects.d.ts +30 -0
- package/dist/agent/infra/llm/context/deferred-effects.js +40 -0
- package/dist/agent/infra/llm/formatters/gemini-formatter.d.ts +1 -1
- package/dist/agent/infra/llm/formatters/gemini-formatter.js +14 -10
- package/dist/agent/infra/llm/generators/ai-sdk-content-generator.d.ts +33 -0
- package/dist/agent/infra/llm/generators/ai-sdk-content-generator.js +166 -0
- package/dist/agent/infra/llm/generators/ai-sdk-message-converter.d.ts +20 -0
- package/dist/agent/infra/llm/generators/ai-sdk-message-converter.js +182 -0
- package/dist/agent/infra/llm/generators/index.d.ts +3 -3
- package/dist/agent/infra/llm/generators/index.js +3 -3
- package/dist/agent/infra/llm/generators/retryable-content-generator.d.ts +7 -0
- package/dist/agent/infra/llm/generators/retryable-content-generator.js +29 -5
- package/dist/agent/infra/llm/index.d.ts +1 -2
- package/dist/agent/infra/llm/index.js +2 -3
- package/dist/agent/infra/llm/model-capabilities.d.ts +1 -0
- package/dist/agent/infra/llm/model-capabilities.js +31 -0
- package/dist/agent/infra/llm/providers/anthropic.d.ts +7 -0
- package/dist/agent/infra/llm/providers/anthropic.js +27 -0
- package/dist/agent/infra/llm/providers/byterover.d.ts +9 -0
- package/dist/agent/infra/llm/providers/byterover.js +37 -0
- package/dist/agent/infra/llm/providers/cerebras.d.ts +7 -0
- package/dist/agent/infra/llm/providers/cerebras.js +31 -0
- package/dist/agent/infra/llm/providers/cohere.d.ts +7 -0
- package/dist/agent/infra/llm/providers/cohere.js +26 -0
- package/dist/agent/infra/llm/providers/deepinfra.d.ts +7 -0
- package/dist/agent/infra/llm/providers/deepinfra.js +26 -0
- package/dist/agent/infra/llm/providers/glm.d.ts +7 -0
- package/dist/agent/infra/llm/providers/glm.js +30 -0
- package/dist/agent/infra/llm/providers/google-vertex.d.ts +15 -0
- package/dist/agent/infra/llm/providers/google-vertex.js +36 -0
- package/dist/agent/infra/llm/providers/google.d.ts +7 -0
- package/dist/agent/infra/llm/providers/google.js +25 -0
- package/dist/agent/infra/llm/providers/groq.d.ts +7 -0
- package/dist/agent/infra/llm/providers/groq.js +26 -0
- package/dist/agent/infra/llm/providers/index.d.ts +24 -0
- package/dist/agent/infra/llm/providers/index.js +75 -0
- package/dist/agent/infra/llm/providers/minimax.d.ts +7 -0
- package/dist/agent/infra/llm/providers/minimax.js +30 -0
- package/dist/agent/infra/llm/providers/mistral.d.ts +7 -0
- package/dist/agent/infra/llm/providers/mistral.js +26 -0
- package/dist/agent/infra/llm/providers/moonshot.d.ts +7 -0
- package/dist/agent/infra/llm/providers/moonshot.js +30 -0
- package/dist/agent/infra/llm/providers/openai-compatible.d.ts +9 -0
- package/dist/agent/infra/llm/providers/openai-compatible.js +30 -0
- package/dist/agent/infra/llm/providers/openai.d.ts +7 -0
- package/dist/agent/infra/llm/providers/openai.js +26 -0
- package/dist/agent/infra/llm/providers/openrouter.d.ts +7 -0
- package/dist/agent/infra/llm/providers/openrouter.js +26 -0
- package/dist/agent/infra/llm/providers/perplexity.d.ts +7 -0
- package/dist/agent/infra/llm/providers/perplexity.js +26 -0
- package/dist/agent/infra/llm/providers/togetherai.d.ts +7 -0
- package/dist/agent/infra/llm/providers/togetherai.js +26 -0
- package/dist/agent/infra/llm/providers/types.d.ts +81 -0
- package/dist/agent/infra/llm/providers/types.js +7 -0
- package/dist/agent/infra/llm/providers/vercel.d.ts +7 -0
- package/dist/agent/infra/llm/providers/vercel.js +32 -0
- package/dist/agent/infra/llm/providers/xai.d.ts +7 -0
- package/dist/agent/infra/llm/providers/xai.js +26 -0
- package/dist/agent/infra/llm/retry/retry-policy.d.ts +13 -0
- package/dist/agent/infra/llm/retry/retry-policy.js +207 -0
- package/dist/agent/infra/llm/tokenizers/openrouter-tokenizer.js +1 -1
- package/dist/agent/infra/llm/tool-output-processor.d.ts +16 -4
- package/dist/agent/infra/llm/tool-output-processor.js +61 -16
- package/dist/agent/infra/sandbox/curate-result-collector.d.ts +30 -0
- package/dist/agent/infra/sandbox/curate-result-collector.js +39 -0
- package/dist/agent/infra/sandbox/curate-service.d.ts +4 -1
- package/dist/agent/infra/sandbox/curate-service.js +12 -3
- package/dist/agent/infra/sandbox/local-sandbox.d.ts +13 -0
- package/dist/agent/infra/sandbox/local-sandbox.js +41 -4
- package/dist/agent/infra/sandbox/sandbox-service.d.ts +40 -5
- package/dist/agent/infra/sandbox/sandbox-service.js +97 -14
- package/dist/agent/infra/sandbox/tools-sdk.d.ts +42 -4
- package/dist/agent/infra/sandbox/tools-sdk.js +29 -4
- package/dist/agent/infra/session/chat-session.d.ts +1 -1
- package/dist/agent/infra/session/chat-session.js +2 -2
- package/dist/agent/infra/session/session-event-forwarder.js +6 -3
- package/dist/agent/infra/session/session-manager.d.ts +12 -2
- package/dist/agent/infra/session/session-manager.js +25 -8
- package/dist/agent/infra/session/session-metadata-store.d.ts +17 -10
- package/dist/agent/infra/session/session-metadata-store.js +12 -87
- package/dist/agent/infra/storage/blob-history-storage.d.ts +5 -0
- package/dist/agent/infra/storage/blob-history-storage.js +15 -0
- package/dist/agent/infra/storage/dual-format-history-storage.d.ts +6 -0
- package/dist/agent/infra/storage/dual-format-history-storage.js +16 -0
- package/dist/agent/infra/storage/message-storage-service.js +134 -22
- package/dist/agent/infra/storage/sqlite-key-storage.d.ts +8 -0
- package/dist/agent/infra/storage/sqlite-key-storage.js +47 -13
- package/dist/agent/infra/system-prompt/contributors/context-tree-structure-contributor.js +3 -3
- package/dist/agent/infra/tools/implementations/code-exec-tool.js +43 -2
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +98 -32
- package/dist/agent/infra/tools/implementations/curate-tool.js +86 -23
- package/dist/agent/infra/tools/implementations/memory-path-matcher.d.ts +48 -0
- package/dist/agent/infra/tools/implementations/memory-path-matcher.js +217 -0
- package/dist/agent/infra/tools/implementations/memory-symbol-tree.d.ts +101 -0
- package/dist/agent/infra/tools/implementations/memory-symbol-tree.js +259 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-service.d.ts +48 -6
- package/dist/agent/infra/tools/implementations/search-knowledge-service.js +317 -41
- package/dist/agent/infra/tools/implementations/search-knowledge-tool.d.ts +2 -1
- package/dist/agent/infra/tools/implementations/search-knowledge-tool.js +50 -6
- package/dist/agent/infra/tools/tool-registry.js +2 -2
- package/dist/agent/infra/transport/transport-event-bridge.d.ts +42 -0
- package/dist/agent/infra/transport/transport-event-bridge.js +90 -0
- package/dist/agent/infra/validation/workspace-validator.d.ts +3 -3
- package/dist/agent/infra/validation/workspace-validator.js +3 -8
- package/dist/agent/resources/prompts/curate-detail-preservation.yml +29 -1
- package/dist/agent/resources/prompts/system-prompt.yml +346 -102
- package/dist/agent/resources/tools/code_exec.txt +97 -0
- package/dist/agent/resources/tools/curate.txt +25 -13
- package/dist/agent/resources/tools/detect_domains.txt +4 -3
- package/dist/oclif/commands/connectors/index.d.ts +12 -0
- package/dist/oclif/commands/connectors/index.js +53 -0
- package/dist/oclif/commands/connectors/install.d.ts +31 -0
- package/dist/oclif/commands/connectors/install.js +148 -0
- package/dist/oclif/commands/connectors/list.d.ts +5 -0
- package/dist/oclif/commands/connectors/list.js +8 -0
- package/dist/oclif/commands/{curate.d.ts → curate/index.d.ts} +11 -7
- package/dist/oclif/commands/curate/index.js +256 -0
- package/dist/oclif/commands/curate/view.d.ts +18 -0
- package/dist/oclif/commands/curate/view.js +104 -0
- package/dist/oclif/commands/debug.d.ts +35 -0
- package/dist/oclif/commands/debug.js +436 -0
- package/dist/oclif/commands/hub/index.d.ts +5 -0
- package/dist/oclif/commands/hub/index.js +7 -0
- package/dist/oclif/commands/hub/install.d.ts +23 -0
- package/dist/oclif/commands/hub/install.js +74 -0
- package/dist/oclif/commands/hub/list.d.ts +13 -0
- package/dist/oclif/commands/hub/list.js +65 -0
- package/dist/oclif/commands/hub/registry/add.d.ts +19 -0
- package/dist/oclif/commands/hub/registry/add.js +74 -0
- package/dist/oclif/commands/hub/registry/index.d.ts +5 -0
- package/dist/oclif/commands/hub/registry/index.js +7 -0
- package/dist/oclif/commands/hub/registry/list.d.ts +12 -0
- package/dist/oclif/commands/hub/registry/list.js +49 -0
- package/dist/oclif/commands/hub/registry/remove.d.ts +15 -0
- package/dist/oclif/commands/hub/registry/remove.js +46 -0
- package/dist/oclif/commands/login.d.ts +4 -0
- package/dist/oclif/commands/login.js +51 -31
- package/dist/oclif/commands/main.d.ts +3 -17
- package/dist/oclif/commands/main.js +15 -96
- package/dist/oclif/commands/mcp.js +24 -5
- package/dist/oclif/commands/model/index.d.ts +15 -0
- package/dist/oclif/commands/model/index.js +59 -0
- package/dist/oclif/commands/model/list.d.ts +17 -0
- package/dist/oclif/commands/model/list.js +89 -0
- package/dist/oclif/commands/model/switch.d.ts +21 -0
- package/dist/oclif/commands/model/switch.js +81 -0
- package/dist/oclif/commands/providers/connect.d.ts +28 -0
- package/dist/oclif/commands/providers/connect.js +141 -0
- package/dist/oclif/commands/providers/disconnect.d.ts +14 -0
- package/dist/oclif/commands/providers/disconnect.js +61 -0
- package/dist/oclif/commands/providers/index.d.ts +15 -0
- package/dist/oclif/commands/providers/index.js +59 -0
- package/dist/oclif/commands/providers/list.d.ts +12 -0
- package/dist/oclif/commands/providers/list.js +45 -0
- package/dist/oclif/commands/providers/switch.d.ts +17 -0
- package/dist/oclif/commands/providers/switch.js +61 -0
- package/dist/oclif/commands/pull.d.ts +1 -6
- package/dist/oclif/commands/pull.js +46 -49
- package/dist/oclif/commands/push.d.ts +1 -7
- package/dist/oclif/commands/push.js +66 -59
- package/dist/oclif/commands/query.d.ts +5 -7
- package/dist/oclif/commands/query.js +142 -43
- package/dist/oclif/commands/restart.d.ts +95 -0
- package/dist/oclif/commands/restart.js +333 -0
- package/dist/oclif/commands/space/list.d.ts +12 -0
- package/dist/oclif/commands/space/list.js +66 -0
- package/dist/oclif/commands/space/switch.d.ts +17 -0
- package/dist/oclif/commands/space/switch.js +87 -0
- package/dist/oclif/commands/status.d.ts +4 -9
- package/dist/oclif/commands/status.js +94 -49
- package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +16 -11
- package/dist/oclif/hooks/prerun/validate-brv-config-version.js +67 -24
- package/dist/oclif/lib/daemon-client.d.ts +40 -0
- package/dist/oclif/lib/daemon-client.js +142 -0
- package/dist/oclif/lib/json-response.d.ts +9 -0
- package/dist/oclif/lib/json-response.js +10 -0
- package/dist/oclif/lib/task-client.d.ts +68 -0
- package/dist/oclif/lib/task-client.js +227 -0
- package/dist/server/config/environment.d.ts +1 -1
- package/dist/server/config/environment.js +2 -2
- package/dist/server/constants.d.ts +30 -1
- package/dist/server/constants.js +43 -2
- package/dist/server/core/domain/client/client-info.d.ts +82 -0
- package/dist/server/core/domain/client/client-info.js +87 -0
- package/dist/server/core/domain/entities/agent.d.ts +3 -6
- package/dist/server/core/domain/entities/agent.js +49 -54
- package/dist/server/core/domain/entities/brv-config.d.ts +31 -10
- package/dist/server/core/domain/entities/brv-config.js +68 -39
- package/dist/server/core/domain/entities/connector-type.d.ts +1 -11
- package/dist/server/core/domain/entities/connector-type.js +1 -10
- package/dist/server/core/domain/entities/context-tree-snapshot.d.ts +2 -11
- package/dist/server/core/domain/entities/curate-log-entry.d.ts +41 -0
- package/dist/server/core/domain/entities/curation-status.d.ts +28 -0
- package/dist/server/core/domain/entities/provider-config.d.ts +14 -1
- package/dist/server/core/domain/entities/provider-config.js +17 -6
- package/dist/server/core/domain/entities/provider-registry.d.ts +3 -1
- package/dist/server/core/domain/entities/provider-registry.js +230 -10
- package/dist/server/core/domain/errors/task-error.d.ts +17 -4
- package/dist/server/core/domain/errors/task-error.js +35 -10
- package/dist/server/core/domain/knowledge/markdown-writer.d.ts +58 -1
- package/dist/server/core/domain/knowledge/markdown-writer.js +288 -30
- package/dist/server/core/domain/knowledge/memory-scoring.d.ts +118 -0
- package/dist/server/core/domain/knowledge/memory-scoring.js +217 -0
- package/dist/server/core/domain/knowledge/relation-parser.d.ts +16 -0
- package/dist/server/core/domain/knowledge/relation-parser.js +21 -8
- package/dist/server/core/domain/project/project-info.d.ts +54 -0
- package/dist/server/core/domain/project/project-info.js +62 -0
- package/dist/server/core/domain/transport/schemas.d.ts +97 -19
- package/dist/server/core/domain/transport/schemas.js +40 -1
- package/dist/server/core/domain/transport/task-info.d.ts +21 -0
- package/dist/server/core/interfaces/agent/i-agent-pool.d.ts +88 -0
- package/dist/server/core/interfaces/client/i-client-manager.d.ts +117 -0
- package/dist/server/core/interfaces/context-tree/i-context-file-reader.d.ts +5 -1
- package/dist/server/core/interfaces/context-tree/i-context-tree-merger.d.ts +80 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +5 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-snapshot-service.d.ts +15 -0
- package/dist/server/core/interfaces/daemon/i-agent-idle-timeout-policy.d.ts +39 -0
- package/dist/server/core/interfaces/daemon/i-daemon-resilience.d.ts +24 -0
- package/dist/server/core/interfaces/daemon/i-heartbeat-writer.d.ts +28 -0
- package/dist/server/core/interfaces/daemon/i-idle-timeout-policy.d.ts +34 -0
- package/dist/server/core/interfaces/daemon/i-shutdown-handler.d.ts +20 -0
- package/dist/server/core/interfaces/daemon/index.d.ts +4 -0
- package/dist/server/core/interfaces/daemon/index.js +2 -0
- package/dist/server/core/interfaces/executor/i-curate-executor.d.ts +2 -2
- package/dist/server/core/interfaces/executor/i-query-executor.d.ts +2 -2
- package/dist/server/core/interfaces/hub/i-hub-install-service.d.ts +45 -0
- package/dist/server/core/interfaces/hub/i-hub-keychain-store.d.ts +27 -0
- package/dist/server/core/interfaces/hub/i-hub-registry-config-store.d.ts +27 -0
- package/dist/server/core/interfaces/hub/i-hub-registry-service.d.ts +30 -0
- package/dist/server/core/interfaces/hub/i-hub-registry-service.js +1 -0
- package/dist/server/core/interfaces/i-provider-config-store.d.ts +3 -1
- package/dist/server/core/interfaces/i-provider-model-fetcher.d.ts +59 -0
- package/dist/server/core/interfaces/i-provider-model-fetcher.js +7 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +27 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.js +1 -0
- package/dist/server/core/interfaces/project/i-project-registry.d.ts +46 -0
- package/dist/server/core/interfaces/project/i-project-registry.js +1 -0
- package/dist/server/core/interfaces/routing/i-project-router.d.ts +45 -0
- package/dist/server/core/interfaces/routing/i-project-router.js +1 -0
- package/dist/server/core/interfaces/routing/index.d.ts +1 -0
- package/dist/server/core/interfaces/routing/index.js +1 -0
- package/dist/server/core/interfaces/session/i-session-reader.d.ts +13 -0
- package/dist/server/core/interfaces/session/i-session-reader.js +1 -0
- package/dist/server/core/interfaces/state/i-auth-state-store.d.ts +68 -0
- package/dist/server/core/interfaces/state/i-auth-state-store.js +1 -0
- package/dist/server/core/interfaces/state/i-project-state-loader.d.ts +110 -0
- package/dist/server/core/interfaces/state/i-project-state-loader.js +1 -0
- package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +20 -0
- package/dist/server/core/interfaces/storage/i-curate-log-store.js +1 -0
- package/dist/server/core/interfaces/storage/i-global-config-store.d.ts +1 -15
- package/dist/server/core/interfaces/storage/i-mcp-config-writer.d.ts +5 -1
- package/dist/server/core/interfaces/storage/i-project-config-store.d.ts +6 -1
- package/dist/server/core/interfaces/transport/i-transport-server.d.ts +12 -2
- package/dist/server/core/interfaces/usecase/i-curate-log-use-case.d.ts +12 -0
- package/dist/server/core/interfaces/usecase/i-curate-log-use-case.js +1 -0
- package/dist/server/infra/client/client-manager.d.ts +51 -0
- package/dist/server/infra/client/client-manager.js +144 -0
- package/dist/server/infra/cogit/context-tree-to-push-context-mapper.js +2 -2
- package/dist/server/infra/config/auto-init.d.ts +14 -0
- package/dist/server/infra/config/auto-init.js +18 -0
- package/dist/server/infra/config/file-config-store.d.ts +1 -0
- package/dist/server/infra/config/file-config-store.js +15 -7
- package/dist/server/infra/connectors/mcp/json-mcp-config-writer.d.ts +1 -2
- package/dist/server/infra/connectors/mcp/json-mcp-config-writer.js +9 -8
- package/dist/server/infra/connectors/mcp/mcp-connector-config.d.ts +29 -6
- package/dist/server/infra/connectors/mcp/mcp-connector-config.js +28 -1
- package/dist/server/infra/connectors/mcp/mcp-connector.js +5 -5
- package/dist/server/infra/connectors/mcp/toml-mcp-config-writer.d.ts +1 -2
- package/dist/server/infra/connectors/rules/rules-connector-config.d.ts +8 -0
- package/dist/server/infra/connectors/rules/rules-connector-config.js +8 -0
- package/dist/server/infra/connectors/rules/rules-connector.js +34 -7
- package/dist/server/infra/connectors/shared/constants.d.ts +5 -0
- package/dist/server/infra/connectors/shared/constants.js +12 -0
- package/dist/server/infra/connectors/shared/rule-segment-patcher.d.ts +29 -0
- package/dist/server/infra/connectors/shared/rule-segment-patcher.js +208 -0
- package/dist/server/infra/connectors/skill/skill-connector-config.d.ts +79 -20
- package/dist/server/infra/connectors/skill/skill-connector-config.js +74 -10
- package/dist/server/infra/connectors/skill/skill-connector.d.ts +31 -4
- package/dist/server/infra/connectors/skill/skill-connector.js +136 -39
- package/dist/server/infra/context-tree/file-context-file-reader.js +6 -2
- package/dist/server/infra/context-tree/file-context-tree-merger.d.ts +51 -0
- package/dist/server/infra/context-tree/file-context-tree-merger.js +261 -0
- package/dist/server/infra/context-tree/file-context-tree-service.d.ts +1 -0
- package/dist/server/infra/context-tree/file-context-tree-service.js +6 -1
- package/dist/server/infra/context-tree/file-context-tree-snapshot-service.d.ts +2 -4
- package/dist/server/infra/context-tree/file-context-tree-snapshot-service.js +19 -9
- package/dist/server/infra/context-tree/hash-utils.d.ts +6 -0
- package/dist/server/infra/context-tree/hash-utils.js +9 -0
- package/dist/server/infra/daemon/agent-idle-timeout-policy.d.ts +36 -0
- package/dist/server/infra/daemon/agent-idle-timeout-policy.js +89 -0
- package/dist/server/infra/daemon/agent-logger.d.ts +10 -0
- package/dist/server/infra/daemon/agent-logger.js +22 -0
- package/dist/server/infra/daemon/agent-pool.d.ts +112 -0
- package/dist/server/infra/daemon/agent-pool.js +335 -0
- package/dist/server/infra/daemon/agent-process.d.ts +21 -0
- package/dist/server/infra/daemon/agent-process.js +610 -0
- package/dist/server/infra/daemon/brv-server.d.ts +23 -0
- package/dist/server/infra/daemon/brv-server.js +405 -0
- package/dist/server/infra/daemon/daemon-resilience.d.ts +34 -0
- package/dist/server/infra/daemon/daemon-resilience.js +100 -0
- package/dist/server/infra/daemon/heartbeat.d.ts +28 -0
- package/dist/server/infra/daemon/heartbeat.js +81 -0
- package/dist/server/infra/daemon/idle-timeout-policy.d.ts +38 -0
- package/dist/server/infra/daemon/idle-timeout-policy.js +91 -0
- package/dist/server/infra/daemon/index.d.ts +5 -0
- package/dist/server/infra/daemon/index.js +11 -0
- package/dist/server/infra/daemon/port-selector.d.ts +28 -0
- package/dist/server/infra/daemon/port-selector.js +45 -0
- package/dist/server/infra/daemon/project-task-queue.d.ts +54 -0
- package/dist/server/infra/daemon/project-task-queue.js +103 -0
- package/dist/server/infra/daemon/session-resolver.d.ts +26 -0
- package/dist/server/infra/daemon/session-resolver.js +88 -0
- package/dist/server/infra/daemon/shutdown-handler.d.ts +42 -0
- package/dist/server/infra/daemon/shutdown-handler.js +101 -0
- package/dist/server/infra/executor/curate-executor.d.ts +10 -2
- package/dist/server/infra/executor/curate-executor.js +87 -13
- package/dist/server/infra/executor/direct-search-responder.d.ts +11 -8
- package/dist/server/infra/executor/direct-search-responder.js +16 -14
- package/dist/server/infra/executor/folder-pack-executor.js +58 -17
- package/dist/server/infra/executor/query-executor.d.ts +23 -6
- package/dist/server/infra/executor/query-executor.js +145 -39
- package/dist/server/infra/http/provider-model-fetcher-registry.d.ts +31 -0
- package/dist/server/infra/http/provider-model-fetcher-registry.js +121 -0
- package/dist/server/infra/http/provider-model-fetchers.d.ts +108 -0
- package/dist/server/infra/http/provider-model-fetchers.js +582 -0
- package/dist/server/infra/hub/composite-hub-registry-service.d.ts +17 -0
- package/dist/server/infra/hub/composite-hub-registry-service.js +54 -0
- package/dist/server/infra/hub/hub-auth-headers.d.ts +11 -0
- package/dist/server/infra/hub/hub-auth-headers.js +29 -0
- package/dist/server/infra/hub/hub-install-service.d.ts +22 -0
- package/dist/server/infra/hub/hub-install-service.js +99 -0
- package/dist/server/infra/hub/hub-keychain-store.d.ts +29 -0
- package/dist/server/infra/hub/hub-keychain-store.js +98 -0
- package/dist/server/infra/hub/hub-registry-config-store.d.ts +24 -0
- package/dist/server/infra/hub/hub-registry-config-store.js +92 -0
- package/dist/server/infra/hub/hub-registry-service.d.ts +33 -0
- package/dist/server/infra/hub/hub-registry-service.js +109 -0
- package/dist/server/infra/mcp/mcp-mode-detector.d.ts +21 -0
- package/dist/server/infra/mcp/mcp-mode-detector.js +25 -0
- package/dist/server/infra/mcp/mcp-server.d.ts +15 -9
- package/dist/server/infra/mcp/mcp-server.js +84 -98
- package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +5 -10
- package/dist/server/infra/mcp/tools/brv-curate-tool.js +47 -17
- package/dist/server/infra/mcp/tools/brv-query-tool.d.ts +4 -1
- package/dist/server/infra/mcp/tools/brv-query-tool.js +39 -12
- package/dist/server/infra/mcp/tools/index.d.ts +1 -0
- package/dist/server/infra/mcp/tools/index.js +1 -0
- package/dist/server/infra/mcp/tools/resolve-client-cwd.d.ts +17 -0
- package/dist/server/infra/mcp/tools/resolve-client-cwd.js +27 -0
- package/dist/server/infra/mcp/tools/task-result-waiter.js +6 -5
- package/dist/server/infra/process/broadcast-utils.d.ts +16 -0
- package/dist/server/infra/process/broadcast-utils.js +22 -0
- package/dist/server/infra/process/connection-coordinator.d.ts +85 -0
- package/dist/server/infra/process/connection-coordinator.js +333 -0
- package/dist/server/infra/process/curate-log-handler.d.ts +35 -0
- package/dist/server/infra/process/curate-log-handler.js +179 -0
- package/dist/server/infra/process/feature-handlers.d.ts +25 -0
- package/dist/server/infra/process/feature-handlers.js +165 -0
- package/dist/server/infra/process/index.d.ts +6 -7
- package/dist/server/infra/process/index.js +5 -6
- package/dist/server/infra/process/task-router.d.ts +139 -0
- package/dist/server/infra/process/task-router.js +503 -0
- package/dist/server/infra/process/transport-handlers.d.ts +55 -117
- package/dist/server/infra/process/transport-handlers.js +50 -437
- package/dist/server/infra/process/types.d.ts +5 -0
- package/dist/server/infra/process/types.js +1 -0
- package/dist/server/infra/project/project-registry.d.ts +37 -0
- package/dist/server/infra/project/project-registry.js +147 -0
- package/dist/server/infra/provider/env-provider-detector.d.ts +33 -0
- package/dist/server/infra/provider/env-provider-detector.js +52 -0
- package/dist/server/infra/provider/provider-config-resolver.d.ts +30 -0
- package/dist/server/infra/provider/provider-config-resolver.js +167 -0
- package/dist/server/infra/provider/vertex-ai-utils.d.ts +10 -0
- package/dist/server/infra/provider/vertex-ai-utils.js +28 -0
- package/dist/server/infra/routing/project-router.d.ts +35 -0
- package/dist/server/infra/routing/project-router.js +60 -0
- package/dist/server/infra/session/session-reader.d.ts +18 -0
- package/dist/server/infra/session/session-reader.js +17 -0
- package/dist/server/infra/state/auth-state-store.d.ts +55 -0
- package/dist/server/infra/state/auth-state-store.js +111 -0
- package/dist/server/infra/state/project-state-loader.d.ts +69 -0
- package/dist/server/infra/state/project-state-loader.js +154 -0
- package/dist/server/infra/storage/file-curate-log-store.d.ts +61 -0
- package/dist/server/infra/storage/file-curate-log-store.js +198 -0
- package/dist/server/infra/storage/file-global-config-store.d.ts +0 -2
- package/dist/server/infra/storage/file-global-config-store.js +0 -19
- package/dist/server/infra/storage/file-onboarding-preference-store.d.ts +1 -1
- package/dist/server/infra/storage/file-onboarding-preference-store.js +7 -8
- package/dist/server/infra/storage/file-provider-config-store.d.ts +3 -2
- package/dist/server/infra/storage/file-provider-config-store.js +3 -3
- package/dist/server/infra/storage/file-provider-keychain-store.d.ts +31 -0
- package/dist/server/infra/storage/file-provider-keychain-store.js +110 -0
- package/dist/server/infra/storage/file-token-store.d.ts +2 -5
- package/dist/server/infra/storage/file-token-store.js +2 -5
- package/dist/server/infra/storage/provider-keychain-store.d.ts +2 -33
- package/dist/server/infra/storage/provider-keychain-store.js +4 -71
- package/dist/server/infra/storage/token-store.d.ts +3 -8
- package/dist/server/infra/storage/token-store.js +4 -11
- package/dist/server/infra/transport/agent-instance-discovery.d.ts +20 -0
- package/dist/server/infra/transport/agent-instance-discovery.js +32 -0
- package/dist/server/infra/transport/handlers/agent-dto-mapper.d.ts +6 -0
- package/dist/server/infra/transport/handlers/agent-dto-mapper.js +16 -0
- package/dist/server/infra/transport/handlers/auth-handler.d.ts +60 -0
- package/dist/server/infra/transport/handlers/auth-handler.js +257 -0
- package/dist/server/infra/transport/handlers/config-handler.d.ts +13 -0
- package/dist/server/infra/transport/handlers/config-handler.js +22 -0
- package/dist/server/infra/transport/handlers/connectors-handler.d.ts +23 -0
- package/dist/server/infra/transport/handlers/connectors-handler.js +73 -0
- package/dist/server/infra/transport/handlers/handler-types.d.ts +23 -0
- package/dist/server/infra/transport/handlers/handler-types.js +21 -0
- package/dist/server/infra/transport/handlers/hub-handler.d.ts +34 -0
- package/dist/server/infra/transport/handlers/hub-handler.js +218 -0
- package/dist/server/infra/transport/handlers/index.d.ts +26 -0
- package/dist/server/infra/transport/handlers/index.js +13 -0
- package/dist/server/infra/transport/handlers/init-handler.d.ts +50 -0
- package/dist/server/infra/transport/handlers/init-handler.js +157 -0
- package/dist/server/infra/transport/handlers/model-handler.d.ts +22 -0
- package/dist/server/infra/transport/handlers/model-handler.js +107 -0
- package/dist/server/infra/transport/handlers/provider-handler.d.ts +25 -0
- package/dist/server/infra/transport/handlers/provider-handler.js +101 -0
- package/dist/server/infra/transport/handlers/pull-handler.d.ts +35 -0
- package/dist/server/infra/transport/handlers/pull-handler.js +87 -0
- package/dist/server/infra/transport/handlers/push-handler.d.ts +37 -0
- package/dist/server/infra/transport/handlers/push-handler.js +109 -0
- package/dist/server/infra/transport/handlers/reset-handler.d.ts +23 -0
- package/dist/server/infra/transport/handlers/reset-handler.js +33 -0
- package/dist/server/infra/transport/handlers/space-handler.d.ts +44 -0
- package/dist/server/infra/transport/handlers/space-handler.js +206 -0
- package/dist/server/infra/transport/handlers/status-handler.d.ts +29 -0
- package/dist/server/infra/transport/handlers/status-handler.js +99 -0
- package/dist/server/infra/transport/index.d.ts +1 -1
- package/dist/server/infra/transport/index.js +0 -1
- package/dist/server/infra/transport/port-utils.d.ts +0 -35
- package/dist/server/infra/transport/port-utils.js +0 -62
- package/dist/server/infra/transport/socket-io-transport-server.d.ts +6 -1
- package/dist/server/infra/transport/socket-io-transport-server.js +30 -10
- package/dist/server/infra/transport/transport-connector.d.ts +13 -0
- package/dist/server/infra/transport/transport-connector.js +18 -0
- package/dist/server/infra/usecase/curate-log-use-case.d.ts +32 -0
- package/dist/server/infra/usecase/curate-log-use-case.js +142 -0
- package/dist/server/templates/sections/brv-instructions.md +8 -0
- package/dist/server/templates/sections/command-reference.md +5 -2
- package/dist/server/templates/sections/workflow.md +2 -0
- package/dist/server/templates/skill/SKILL.md +138 -59
- package/dist/server/utils/config-xdg-sync.d.ts +13 -0
- package/dist/server/utils/config-xdg-sync.js +25 -0
- package/dist/server/utils/curate-result-parser.d.ts +121 -0
- package/dist/server/utils/curate-result-parser.js +120 -0
- package/dist/server/utils/global-config-path.d.ts +1 -1
- package/dist/server/utils/global-config-path.js +5 -2
- package/dist/server/utils/global-data-path.d.ts +2 -2
- package/dist/server/utils/global-data-path.js +8 -3
- package/dist/server/utils/path-utils.d.ts +38 -0
- package/dist/server/utils/path-utils.js +92 -0
- package/dist/server/utils/process-logger.js +1 -1
- package/dist/server/utils/server-main-resolver.d.ts +9 -0
- package/dist/server/utils/server-main-resolver.js +17 -0
- package/dist/shared/transport/events/agent-events.d.ts +16 -0
- package/dist/shared/transport/events/agent-events.js +10 -0
- package/dist/shared/transport/events/auth-events.d.ts +45 -0
- package/dist/shared/transport/events/auth-events.js +11 -0
- package/dist/shared/transport/events/config-events.d.ts +18 -0
- package/dist/shared/transport/events/config-events.js +5 -0
- package/dist/shared/transport/events/connector-events.d.ts +35 -0
- package/dist/shared/transport/events/connector-events.js +6 -0
- package/dist/shared/transport/events/hub-events.d.ts +62 -0
- package/dist/shared/transport/events/hub-events.js +10 -0
- package/dist/shared/transport/events/index.d.ts +123 -0
- package/dist/shared/transport/events/index.js +73 -0
- package/dist/shared/transport/events/init-events.d.ts +41 -0
- package/dist/shared/transport/events/init-events.js +8 -0
- package/dist/shared/transport/events/llm-events.d.ts +13 -0
- package/dist/shared/transport/events/llm-events.js +13 -0
- package/dist/shared/transport/events/model-events.d.ts +30 -0
- package/dist/shared/transport/events/model-events.js +5 -0
- package/dist/shared/transport/events/onboarding-events.d.ts +18 -0
- package/dist/shared/transport/events/onboarding-events.js +5 -0
- package/dist/shared/transport/events/provider-events.d.ts +44 -0
- package/dist/shared/transport/events/provider-events.js +8 -0
- package/dist/shared/transport/events/pull-events.d.ts +26 -0
- package/dist/shared/transport/events/pull-events.js +5 -0
- package/dist/shared/transport/events/push-events.d.ts +27 -0
- package/dist/shared/transport/events/push-events.js +5 -0
- package/dist/shared/transport/events/reset-events.d.ts +6 -0
- package/dist/shared/transport/events/reset-events.js +3 -0
- package/dist/shared/transport/events/session-events.d.ts +3 -0
- package/dist/shared/transport/events/session-events.js +3 -0
- package/dist/shared/transport/events/space-events.d.ts +30 -0
- package/dist/shared/transport/events/space-events.js +4 -0
- package/dist/shared/transport/events/status-events.d.ts +7 -0
- package/dist/shared/transport/events/status-events.js +3 -0
- package/dist/shared/transport/events/task-events.d.ts +19 -0
- package/dist/shared/transport/events/task-events.js +9 -0
- package/dist/shared/transport/types/auth-scheme.d.ts +1 -0
- package/dist/shared/transport/types/auth-scheme.js +1 -0
- package/dist/shared/transport/types/dto.d.ts +112 -0
- package/dist/shared/transport/types/dto.js +6 -0
- package/dist/shared/transport/types/index.d.ts +1 -0
- package/dist/shared/transport/types/index.js +1 -0
- package/dist/shared/types/agent.d.ts +5 -0
- package/dist/shared/types/agent.js +27 -0
- package/dist/shared/types/connector-type.d.ts +18 -0
- package/dist/shared/types/connector-type.js +26 -0
- package/dist/shared/types/context-tree-changes.d.ts +11 -0
- package/dist/shared/types/context-tree-changes.js +1 -0
- package/dist/shared/types/index.d.ts +3 -0
- package/dist/shared/types/index.js +2 -0
- package/dist/tui/app/index.d.ts +9 -0
- package/dist/tui/app/index.js +4 -0
- package/dist/tui/app/layouts/main-layout.d.ts +14 -0
- package/dist/tui/app/layouts/main-layout.js +19 -0
- package/dist/tui/app/pages/config-provider-page.d.ts +8 -0
- package/dist/tui/app/pages/config-provider-page.js +19 -0
- package/dist/tui/app/pages/home-page.d.ts +8 -0
- package/dist/tui/app/pages/home-page.js +85 -0
- package/dist/tui/app/pages/login-page.d.ts +12 -0
- package/dist/tui/app/pages/login-page.js +87 -0
- package/dist/tui/app/pages/protected-routes.d.ts +8 -0
- package/dist/tui/app/pages/protected-routes.js +14 -0
- package/dist/tui/app/router.d.ts +11 -0
- package/dist/tui/app/router.js +21 -0
- package/dist/tui/components/command/command-output.d.ts +1 -1
- package/dist/tui/components/command/command-output.js +5 -7
- package/dist/tui/components/command/expanded-command-view.d.ts +1 -1
- package/dist/tui/components/command/expanded-command-view.js +5 -6
- package/dist/tui/components/command/live-streaming-output.d.ts +2 -4
- package/dist/tui/components/command/live-streaming-output.js +5 -19
- package/dist/tui/components/command-details.d.ts +1 -1
- package/dist/tui/components/command-details.js +3 -3
- package/dist/tui/components/command-input.js +84 -171
- package/dist/tui/components/command-item.d.ts +1 -1
- package/dist/tui/components/command-item.js +6 -7
- package/dist/tui/components/execution/execution-status.d.ts +1 -1
- package/dist/tui/components/execution/execution-tool.d.ts +1 -1
- package/dist/tui/components/execution/expanded-log-view.d.ts +1 -1
- package/dist/tui/components/execution/expanded-log-view.js +1 -1
- package/dist/tui/components/execution/log-item.d.ts +1 -1
- package/dist/tui/components/execution/log-item.js +1 -1
- package/dist/tui/components/footer.js +6 -4
- package/dist/tui/components/header.js +2 -2
- package/dist/tui/components/index.d.ts +0 -2
- package/dist/tui/components/index.js +0 -2
- package/dist/tui/components/init.d.ts +1 -1
- package/dist/tui/components/init.js +26 -32
- package/dist/tui/components/inline-prompts/inline-file-selector.d.ts +1 -1
- package/dist/tui/components/inline-prompts/inline-input.d.ts +6 -0
- package/dist/tui/components/inline-prompts/inline-input.js +53 -16
- package/dist/tui/components/inline-prompts/inline-search.d.ts +2 -2
- package/dist/tui/components/inline-prompts/inline-search.js +1 -1
- package/dist/tui/components/inline-prompts/inline-select.d.ts +1 -1
- package/dist/tui/components/inline-prompts/inline-select.js +1 -1
- package/dist/tui/components/message-item.d.ts +1 -1
- package/dist/tui/components/message-item.js +2 -2
- package/dist/tui/components/onboarding/welcome-box.d.ts +1 -8
- package/dist/tui/components/onboarding/welcome-box.js +11 -12
- package/dist/tui/components/onboarding-item.d.ts +1 -1
- package/dist/tui/components/selectable-list.d.ts +3 -1
- package/dist/tui/components/selectable-list.js +7 -15
- package/dist/tui/components/status-badge.js +1 -1
- package/dist/tui/components/suggestions.js +5 -18
- package/dist/tui/features/activity/hooks/index.d.ts +2 -0
- package/dist/tui/features/activity/hooks/index.js +2 -0
- package/dist/tui/{hooks → features/activity/hooks}/use-activity-logs.d.ts +1 -1
- package/dist/tui/{hooks → features/activity/hooks}/use-activity-logs.js +4 -3
- package/dist/tui/features/activity/hooks/use-feed-navigation.d.ts +24 -0
- package/dist/tui/features/activity/hooks/use-feed-navigation.js +43 -0
- package/dist/tui/features/activity/index.d.ts +1 -0
- package/dist/tui/features/activity/index.js +1 -0
- package/dist/tui/features/auth/api/get-auth-state.d.ts +16 -0
- package/dist/tui/features/auth/api/get-auth-state.js +21 -0
- package/dist/tui/features/auth/api/login.d.ts +3 -0
- package/dist/tui/features/auth/api/login.js +14 -0
- package/dist/tui/features/auth/api/logout.d.ts +8 -0
- package/dist/tui/features/auth/api/logout.js +24 -0
- package/dist/tui/features/auth/api/refresh-auth.d.ts +8 -0
- package/dist/tui/features/auth/api/refresh-auth.js +24 -0
- package/dist/tui/features/auth/components/auth-initializer.d.ts +10 -0
- package/dist/tui/features/auth/components/auth-initializer.js +82 -0
- package/dist/tui/features/auth/components/login-flow.d.ts +8 -0
- package/dist/tui/features/auth/components/login-flow.js +62 -0
- package/dist/tui/features/auth/components/logout-flow.d.ts +12 -0
- package/dist/tui/features/auth/components/logout-flow.js +81 -0
- package/dist/tui/features/auth/guards/auth-guard.d.ts +2 -0
- package/dist/tui/features/auth/guards/auth-guard.js +11 -0
- package/dist/tui/features/auth/stores/auth-store.d.ts +27 -0
- package/dist/tui/features/auth/stores/auth-store.js +29 -0
- package/dist/tui/features/commands/components/command-view.d.ts +17 -0
- package/dist/tui/features/commands/components/command-view.js +34 -0
- package/dist/tui/features/commands/definitions/connectors.d.ts +2 -0
- package/dist/tui/features/commands/definitions/connectors.js +9 -0
- package/dist/tui/features/commands/definitions/curate.d.ts +2 -0
- package/dist/tui/features/commands/definitions/curate.js +53 -0
- package/dist/tui/features/commands/definitions/hub-list.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub-list.js +9 -0
- package/dist/tui/features/commands/definitions/hub-registry-add.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub-registry-add.js +36 -0
- package/dist/tui/features/commands/definitions/hub-registry-list.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub-registry-list.js +9 -0
- package/dist/tui/features/commands/definitions/hub-registry-remove.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub-registry-remove.js +25 -0
- package/dist/tui/features/commands/definitions/hub-registry.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub-registry.js +8 -0
- package/dist/tui/features/commands/definitions/hub.d.ts +2 -0
- package/dist/tui/features/commands/definitions/hub.js +7 -0
- package/dist/tui/{commands → features/commands/definitions}/index.d.ts +1 -1
- package/dist/tui/features/commands/definitions/index.js +45 -0
- package/dist/tui/features/commands/definitions/login.d.ts +2 -0
- package/dist/tui/features/commands/definitions/login.js +12 -0
- package/dist/tui/features/commands/definitions/logout.d.ts +2 -0
- package/dist/tui/features/commands/definitions/logout.js +26 -0
- package/dist/tui/features/commands/definitions/model.d.ts +2 -0
- package/dist/tui/features/commands/definitions/model.js +9 -0
- package/dist/tui/features/commands/definitions/new.d.ts +2 -0
- package/dist/tui/features/commands/definitions/new.js +27 -0
- package/dist/tui/features/commands/definitions/providers.d.ts +2 -0
- package/dist/tui/features/commands/definitions/providers.js +9 -0
- package/dist/tui/features/commands/definitions/pull.d.ts +2 -0
- package/dist/tui/features/commands/definitions/pull.js +23 -0
- package/dist/tui/features/commands/definitions/push.d.ts +2 -0
- package/dist/tui/features/commands/definitions/push.js +29 -0
- package/dist/tui/features/commands/definitions/query.d.ts +2 -0
- package/dist/tui/features/commands/definitions/query.js +36 -0
- package/dist/tui/features/commands/definitions/reset.d.ts +2 -0
- package/dist/tui/features/commands/definitions/reset.js +22 -0
- package/dist/tui/features/commands/definitions/space-list.d.ts +2 -0
- package/dist/tui/features/commands/definitions/space-list.js +22 -0
- package/dist/tui/features/commands/definitions/space-switch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/space-switch.js +9 -0
- package/dist/tui/features/commands/definitions/space.d.ts +2 -0
- package/dist/tui/features/commands/definitions/space.js +7 -0
- package/dist/tui/features/commands/definitions/status.d.ts +2 -0
- package/dist/tui/features/commands/definitions/status.js +11 -0
- package/dist/tui/features/commands/hooks/use-commands-controller.d.ts +38 -0
- package/dist/tui/features/commands/hooks/use-commands-controller.js +43 -0
- package/dist/tui/{hooks → features/commands/hooks}/use-slash-command-processor.d.ts +1 -1
- package/dist/tui/{hooks → features/commands/hooks}/use-slash-command-processor.js +33 -31
- package/dist/tui/{hooks → features/commands/hooks}/use-slash-completion.d.ts +1 -1
- package/dist/tui/{hooks → features/commands/hooks}/use-slash-completion.js +30 -25
- package/dist/tui/features/commands/stores/commands-store.d.ts +32 -0
- package/dist/tui/features/commands/stores/commands-store.js +23 -0
- package/dist/tui/{commands → features/commands/utils}/arg-parser.d.ts +1 -1
- package/dist/tui/features/connectors/api/get-agent-config-paths.d.ts +18 -0
- package/dist/tui/features/connectors/api/get-agent-config-paths.js +17 -0
- package/dist/tui/features/connectors/api/get-agents.d.ts +16 -0
- package/dist/tui/features/connectors/api/get-agents.js +19 -0
- package/dist/tui/features/connectors/api/get-connectors.d.ts +16 -0
- package/dist/tui/features/connectors/api/get-connectors.js +17 -0
- package/dist/tui/features/connectors/api/install-connector.d.ts +14 -0
- package/dist/tui/features/connectors/api/install-connector.js +27 -0
- package/dist/tui/features/connectors/components/agent-search-step.d.ts +9 -0
- package/dist/tui/features/connectors/components/agent-search-step.js +18 -0
- package/dist/tui/features/connectors/components/confirm-switch-step.d.ts +10 -0
- package/dist/tui/features/connectors/components/confirm-switch-step.js +13 -0
- package/dist/tui/features/connectors/components/connector-list-step.d.ts +11 -0
- package/dist/tui/features/connectors/components/connector-list-step.js +29 -0
- package/dist/tui/features/connectors/components/connector-type-step.d.ts +13 -0
- package/dist/tui/features/connectors/components/connector-type-step.js +23 -0
- package/dist/tui/features/connectors/components/connectors-flow.d.ts +17 -0
- package/dist/tui/features/connectors/components/connectors-flow.js +179 -0
- package/dist/tui/features/connectors/utils/get-connector-name.d.ts +3 -0
- package/dist/tui/features/connectors/utils/get-connector-name.js +33 -0
- package/dist/tui/features/curate/api/create-curate-task.d.ts +22 -0
- package/dist/tui/features/curate/api/create-curate-task.js +40 -0
- package/dist/tui/features/curate/components/curate-flow.d.ts +20 -0
- package/dist/tui/features/curate/components/curate-flow.js +41 -0
- package/dist/tui/features/hub/api/add-hub-registry.d.ts +15 -0
- package/dist/tui/features/hub/api/add-hub-registry.js +30 -0
- package/dist/tui/features/hub/api/get-hub-entries.d.ts +16 -0
- package/dist/tui/features/hub/api/get-hub-entries.js +17 -0
- package/dist/tui/features/hub/api/install-hub-entry.d.ts +14 -0
- package/dist/tui/features/hub/api/install-hub-entry.js +24 -0
- package/dist/tui/features/hub/api/list-hub-registries.d.ts +16 -0
- package/dist/tui/features/hub/api/list-hub-registries.js +17 -0
- package/dist/tui/features/hub/api/remove-hub-registry.d.ts +11 -0
- package/dist/tui/features/hub/api/remove-hub-registry.js +24 -0
- package/dist/tui/features/hub/components/hub-agent-step.d.ts +8 -0
- package/dist/tui/features/hub/components/hub-agent-step.js +14 -0
- package/dist/tui/features/hub/components/hub-detail-step.d.ts +10 -0
- package/dist/tui/features/hub/components/hub-detail-step.js +25 -0
- package/dist/tui/features/hub/components/hub-flow.d.ts +7 -0
- package/dist/tui/features/hub/components/hub-flow.js +90 -0
- package/dist/tui/features/hub/components/hub-list-step.d.ts +10 -0
- package/dist/tui/features/hub/components/hub-list-step.js +34 -0
- package/dist/tui/features/hub/components/hub-registry-add-view.d.ts +12 -0
- package/dist/tui/features/hub/components/hub-registry-add-view.js +36 -0
- package/dist/tui/features/hub/components/hub-registry-list-view.d.ts +7 -0
- package/dist/tui/features/hub/components/hub-registry-list-view.js +38 -0
- package/dist/tui/features/hub/components/hub-registry-remove-view.d.ts +8 -0
- package/dist/tui/features/hub/components/hub-registry-remove-view.js +17 -0
- package/dist/tui/features/model/api/get-models-by-providers.d.ts +20 -0
- package/dist/tui/features/model/api/get-models-by-providers.js +17 -0
- package/dist/tui/features/model/api/get-models.d.ts +20 -0
- package/dist/tui/features/model/api/get-models.js +17 -0
- package/dist/tui/features/model/api/set-active-model.d.ts +13 -0
- package/dist/tui/features/model/api/set-active-model.js +13 -0
- package/dist/tui/{components → features/model/components}/model-dialog.d.ts +4 -0
- package/dist/tui/{components → features/model/components}/model-dialog.js +10 -3
- package/dist/tui/features/model/components/model-flow.d.ts +17 -0
- package/dist/tui/features/model/components/model-flow.js +108 -0
- package/dist/tui/features/model/stores/model-store.d.ts +35 -0
- package/dist/tui/features/model/stores/model-store.js +26 -0
- package/dist/tui/features/onboarding/api/auto-setup-onboarding.d.ts +8 -0
- package/dist/tui/features/onboarding/api/auto-setup-onboarding.js +24 -0
- package/dist/tui/features/onboarding/api/complete-onboarding.d.ts +11 -0
- package/dist/tui/features/onboarding/api/complete-onboarding.js +24 -0
- package/dist/tui/features/onboarding/api/get-onboarding-state.d.ts +16 -0
- package/dist/tui/features/onboarding/api/get-onboarding-state.js +17 -0
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +27 -0
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +36 -0
- package/dist/tui/features/onboarding/types.d.ts +7 -0
- package/dist/tui/features/onboarding/types.js +4 -0
- package/dist/tui/features/onboarding/utils.d.ts +28 -0
- package/dist/tui/features/onboarding/utils.js +76 -0
- package/dist/tui/features/provider/api/connect-provider.d.ts +13 -0
- package/dist/tui/features/provider/api/connect-provider.js +28 -0
- package/dist/tui/features/provider/api/disconnect-provider.d.ts +11 -0
- package/dist/tui/features/provider/api/disconnect-provider.js +26 -0
- package/dist/tui/features/provider/api/get-active-provider-config.d.ts +16 -0
- package/dist/tui/features/provider/api/get-active-provider-config.js +17 -0
- package/dist/tui/features/provider/api/get-providers.d.ts +16 -0
- package/dist/tui/features/provider/api/get-providers.js +17 -0
- package/dist/tui/features/provider/api/set-active-provider.d.ts +11 -0
- package/dist/tui/features/provider/api/set-active-provider.js +24 -0
- package/dist/tui/features/provider/api/validate-api-key.d.ts +12 -0
- package/dist/tui/features/provider/api/validate-api-key.js +13 -0
- package/dist/tui/{components → features/provider/components}/api-key-dialog.d.ts +5 -3
- package/dist/tui/features/provider/components/api-key-dialog.js +126 -0
- package/dist/tui/features/provider/components/base-url-dialog.d.ts +24 -0
- package/dist/tui/features/provider/components/base-url-dialog.js +77 -0
- package/dist/tui/features/provider/components/credential-path-dialog.d.ts +30 -0
- package/dist/tui/features/provider/components/credential-path-dialog.js +85 -0
- package/dist/tui/features/provider/components/model-select-step.d.ts +20 -0
- package/dist/tui/features/provider/components/model-select-step.js +73 -0
- package/dist/tui/{components → features/provider/components}/provider-dialog.d.ts +8 -6
- package/dist/tui/features/provider/components/provider-dialog.js +20 -0
- package/dist/tui/features/provider/components/provider-flow.d.ts +25 -0
- package/dist/tui/features/provider/components/provider-flow.js +277 -0
- package/dist/tui/features/provider/stores/provider-store.d.ts +28 -0
- package/dist/tui/features/provider/stores/provider-store.js +22 -0
- package/dist/tui/features/pull/api/execute-pull.d.ts +11 -0
- package/dist/tui/features/pull/api/execute-pull.js +13 -0
- package/dist/tui/features/pull/api/prepare-pull.d.ts +20 -0
- package/dist/tui/features/pull/api/prepare-pull.js +17 -0
- package/dist/tui/features/pull/components/pull-flow.d.ts +12 -0
- package/dist/tui/features/pull/components/pull-flow.js +70 -0
- package/dist/tui/features/push/api/execute-push.d.ts +11 -0
- package/dist/tui/features/push/api/execute-push.js +13 -0
- package/dist/tui/features/push/api/prepare-push.d.ts +20 -0
- package/dist/tui/features/push/api/prepare-push.js +17 -0
- package/dist/tui/features/push/components/push-flow.d.ts +13 -0
- package/dist/tui/features/push/components/push-flow.js +86 -0
- package/dist/tui/features/query/api/create-query-task.d.ts +17 -0
- package/dist/tui/features/query/api/create-query-task.js +27 -0
- package/dist/tui/features/query/components/query-flow.d.ts +18 -0
- package/dist/tui/features/query/components/query-flow.js +36 -0
- package/dist/tui/features/reset/api/execute-reset.d.ts +8 -0
- package/dist/tui/features/reset/api/execute-reset.js +13 -0
- package/dist/tui/features/reset/components/reset-flow.d.ts +12 -0
- package/dist/tui/features/reset/components/reset-flow.js +44 -0
- package/dist/tui/features/session/components/new-session-flow.d.ts +12 -0
- package/dist/tui/features/session/components/new-session-flow.js +28 -0
- package/dist/tui/features/space/api/get-spaces.d.ts +16 -0
- package/dist/tui/features/space/api/get-spaces.js +17 -0
- package/dist/tui/features/space/api/switch-space.d.ts +11 -0
- package/dist/tui/features/space/api/switch-space.js +24 -0
- package/dist/tui/features/space/components/space-list-view.d.ts +12 -0
- package/dist/tui/features/space/components/space-list-view.js +56 -0
- package/dist/tui/features/space/components/space-switch-flow.d.ts +13 -0
- package/dist/tui/features/space/components/space-switch-flow.js +97 -0
- package/dist/tui/features/status/api/get-status.d.ts +16 -0
- package/dist/tui/features/status/api/get-status.js +17 -0
- package/dist/tui/features/status/components/status-view.d.ts +12 -0
- package/dist/tui/features/status/components/status-view.js +26 -0
- package/dist/tui/features/status/utils/format-status.d.ts +5 -0
- package/dist/tui/features/status/utils/format-status.js +62 -0
- package/dist/tui/features/tasks/components/task-subscription-initializer.d.ts +5 -0
- package/dist/tui/features/tasks/components/task-subscription-initializer.js +9 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.d.ts +5 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +74 -0
- package/dist/tui/features/tasks/stores/tasks-store.d.ts +92 -0
- package/dist/tui/features/tasks/stores/tasks-store.js +262 -0
- package/dist/tui/features/transport/components/transport-initializer.d.ts +13 -0
- package/dist/tui/features/transport/components/transport-initializer.js +107 -0
- package/dist/tui/features/transport/hooks/use-transport.d.ts +19 -0
- package/dist/tui/features/transport/hooks/use-transport.js +16 -0
- package/dist/tui/hooks/index.d.ts +14 -13
- package/dist/tui/hooks/index.js +15 -9
- package/dist/tui/hooks/use-terminal-breakpoint.js +3 -2
- package/dist/tui/lib/api-client.d.ts +20 -0
- package/dist/tui/lib/api-client.js +29 -0
- package/dist/tui/lib/environment.d.ts +18 -0
- package/dist/tui/lib/environment.js +18 -0
- package/dist/tui/lib/react-query.d.ts +17 -0
- package/dist/tui/lib/react-query.js +17 -0
- package/dist/tui/lib/transport-logger.d.ts +13 -0
- package/dist/tui/lib/transport-logger.js +40 -0
- package/dist/tui/providers/app-providers.d.ts +1 -16
- package/dist/tui/providers/app-providers.js +26 -4
- package/dist/tui/repl-startup.d.ts +1 -12
- package/dist/tui/repl-startup.js +6 -24
- package/dist/tui/stores/mode-store.d.ts +25 -0
- package/dist/tui/stores/mode-store.js +49 -0
- package/dist/tui/stores/theme-store.d.ts +43 -0
- package/dist/tui/stores/theme-store.js +39 -0
- package/dist/tui/stores/transport-store.d.ts +40 -0
- package/dist/tui/stores/transport-store.js +40 -0
- package/dist/tui/types/commands.d.ts +23 -91
- package/dist/tui/types/commands.js +1 -13
- package/dist/tui/types/index.d.ts +3 -4
- package/dist/tui/types/index.js +0 -2
- package/dist/tui/types/messages.d.ts +8 -1
- package/dist/tui/types/ui.d.ts +0 -5
- package/dist/tui/utils/error-messages.d.ts +22 -0
- package/dist/tui/utils/error-messages.js +45 -0
- package/dist/tui/utils/index.d.ts +2 -0
- package/dist/tui/utils/index.js +2 -0
- package/dist/tui/utils/input.d.ts +14 -0
- package/dist/tui/utils/input.js +17 -0
- package/dist/tui/utils/log.d.ts +1 -1
- package/node_modules/@campfirein/brv-transport-client/README.md +79 -338
- package/node_modules/@campfirein/brv-transport-client/dist/constants.d.ts +18 -3
- package/node_modules/@campfirein/brv-transport-client/dist/constants.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/constants.js +25 -4
- package/node_modules/@campfirein/brv-transport-client/dist/constants.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/entities/instance-info.d.ts +4 -9
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/entities/instance-info.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/entities/instance-info.js +9 -24
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/entities/instance-info.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/connection-error.d.ts +20 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/connection-error.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/connection-error.js +30 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/connection-error.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/transport-error.d.ts +3 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/transport-error.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/transport-error.js +4 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/errors/transport-error.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/event-names.d.ts +10 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/event-names.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/event-names.js +10 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/event-names.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/index.d.ts +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/index.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/index.js +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/events/index.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/types.d.ts +9 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/types.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/types.js +8 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/types.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/common.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/common.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/event-name-validator.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/event-name-validator.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/index.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/index.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/room-name-validator.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/room-name-validator.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/url-validator.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/domain/validators/url-validator.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory-config.d.ts +150 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory-config.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory-config.js +8 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory-config.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory.d.ts +9 -4
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-factory.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-logger.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client-logger.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-client.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-connection-state.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-connection-state.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-event-dispatcher.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-event-dispatcher.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-force-reconnect-manager.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-force-reconnect-manager.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-discovery.d.ts +9 -22
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-discovery.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-discovery.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-manager.d.ts +46 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-manager.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-manager.js +2 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-manager.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-reconnection-strategy.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-reconnection-strategy.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-room-manager.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-room-manager.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-socket-provider.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-socket-provider.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-socket.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-socket.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-spawn-lock.d.ts +27 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-spawn-lock.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-spawn-lock.js +2 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-spawn-lock.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-wake-detector.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-wake-detector.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/index.d.ts +26 -16
- package/node_modules/@campfirein/brv-transport-client/dist/index.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/index.js +28 -18
- package/node_modules/@campfirein/brv-transport-client/dist/index.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/client-factory.d.ts +49 -167
- package/node_modules/@campfirein/brv-transport-client/dist/infra/client-factory.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/client-factory.js +161 -260
- package/node_modules/@campfirein/brv-transport-client/dist/infra/client-factory.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/connection-state-manager.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/connection-state-manager.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-connector.d.ts +46 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-connector.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-connector.js +47 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-connector.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-discovery-sync.d.ts +41 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-discovery-sync.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-discovery-sync.js +48 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-discovery-sync.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-health.d.ts +37 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-health.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-health.js +35 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-health.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-instance-discovery.d.ts +22 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-instance-discovery.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-instance-discovery.js +83 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-instance-discovery.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-reconnector.d.ts +60 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-reconnector.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-reconnector.js +101 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-reconnector.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-spawner.d.ts +33 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-spawner.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-spawner.js +161 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/daemon-spawner.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/event-dispatcher.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/event-dispatcher.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/find-project-root.d.ts +11 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/find-project-root.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/find-project-root.js +31 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/find-project-root.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/force-reconnect-manager.d.ts +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/force-reconnect-manager.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/force-reconnect-manager.js +4 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/force-reconnect-manager.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-data-path.d.ts +12 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-data-path.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-data-path.js +38 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-data-path.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-instance-manager.d.ts +37 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-instance-manager.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-instance-manager.js +100 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/global-instance-manager.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/heartbeat-utils.d.ts +12 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/heartbeat-utils.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/heartbeat-utils.js +29 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/heartbeat-utils.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/no-op-client-logger.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/no-op-client-logger.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/process-utils.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/process-utils.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/reconnection-strategy.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/reconnection-strategy.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/resolve-server-path.d.ts +12 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/resolve-server-path.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/resolve-server-path.js +52 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/resolve-server-path.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/room-manager.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/room-manager.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/index.d.ts +2 -2
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/index.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/index.js +4 -2
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/index.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/schemas.d.ts +65 -3
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/schemas.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/schemas.js +44 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/schemas.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/types.d.ts +11 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/types.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/schemas/types.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/socket-io-client.d.ts +32 -61
- package/node_modules/@campfirein/brv-transport-client/dist/infra/socket-io-client.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/socket-io-client.js +133 -37
- package/node_modules/@campfirein/brv-transport-client/dist/infra/socket-io-client.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/spawn-lock.d.ts +27 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/spawn-lock.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/spawn-lock.js +124 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/spawn-lock.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/utils/deep-freeze.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/utils/deep-freeze.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wait-for-connected-client.d.ts +13 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wait-for-connected-client.d.ts.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wait-for-connected-client.js +33 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wait-for-connected-client.js.map +1 -0
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wake-detector.d.ts.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/wake-detector.js.map +1 -1
- package/node_modules/@campfirein/brv-transport-client/package.json +3 -12
- package/oclif.manifest.json +1224 -180
- package/package.json +47 -8
- package/dist/agent/infra/llm/generators/openrouter-content-generator.d.ts +0 -94
- package/dist/agent/infra/llm/generators/openrouter-content-generator.js +0 -280
- package/dist/agent/infra/llm/openrouter-llm-service.d.ts +0 -215
- package/dist/agent/infra/llm/openrouter-llm-service.js +0 -572
- package/dist/agent/infra/llm/stream-processor.d.ts +0 -178
- package/dist/agent/infra/llm/stream-processor.js +0 -350
- package/dist/agent/infra/llm/transformers/openrouter-stream-transformer.d.ts +0 -49
- package/dist/agent/infra/llm/transformers/openrouter-stream-transformer.js +0 -270
- package/dist/oclif/commands/curate.js +0 -96
- package/dist/oclif/commands/init.d.ts +0 -18
- package/dist/oclif/commands/init.js +0 -129
- package/dist/server/core/domain/entities/context-tree-index.d.ts +0 -26
- package/dist/server/core/domain/entities/context-tree-index.js +0 -27
- package/dist/server/core/domain/entities/event.d.ts +0 -8
- package/dist/server/core/domain/entities/event.js +0 -25
- package/dist/server/core/domain/errors/ace-error.d.ts +0 -34
- package/dist/server/core/domain/errors/ace-error.js +0 -53
- package/dist/server/core/domain/errors/brv-config-version-error.d.ts +0 -16
- package/dist/server/core/domain/errors/brv-config-version-error.js +0 -21
- package/dist/server/core/domain/errors/core-process-error.d.ts +0 -27
- package/dist/server/core/domain/errors/core-process-error.js +0 -43
- package/dist/server/core/domain/instance/index.d.ts +0 -1
- package/dist/server/core/domain/instance/index.js +0 -1
- package/dist/server/core/domain/instance/types.d.ts +0 -57
- package/dist/server/core/domain/instance/types.js +0 -72
- package/dist/server/core/interfaces/instance/i-instance-discovery.d.ts +0 -45
- package/dist/server/core/interfaces/instance/i-instance-manager.d.ts +0 -58
- package/dist/server/core/interfaces/instance/index.d.ts +0 -2
- package/dist/server/core/interfaces/instance/index.js +0 -2
- package/dist/server/core/interfaces/noop-implementations.d.ts +0 -53
- package/dist/server/core/interfaces/noop-implementations.js +0 -62
- package/dist/server/core/interfaces/services/i-tracking-service.d.ts +0 -21
- package/dist/server/core/interfaces/usecase/i-connectors-use-case.d.ts +0 -3
- package/dist/server/core/interfaces/usecase/i-curate-use-case.d.ts +0 -14
- package/dist/server/core/interfaces/usecase/i-init-use-case.d.ts +0 -11
- package/dist/server/core/interfaces/usecase/i-login-use-case.d.ts +0 -6
- package/dist/server/core/interfaces/usecase/i-logout-use-case.d.ts +0 -5
- package/dist/server/core/interfaces/usecase/i-pull-use-case.d.ts +0 -7
- package/dist/server/core/interfaces/usecase/i-push-use-case.d.ts +0 -8
- package/dist/server/core/interfaces/usecase/i-query-use-case.d.ts +0 -11
- package/dist/server/core/interfaces/usecase/i-reset-use-case.d.ts +0 -6
- package/dist/server/core/interfaces/usecase/i-space-list-use-case.d.ts +0 -3
- package/dist/server/core/interfaces/usecase/i-space-switch-use-case.d.ts +0 -3
- package/dist/server/core/interfaces/usecase/i-status-use-case.d.ts +0 -6
- package/dist/server/infra/executor/task-processor.d.ts +0 -89
- package/dist/server/infra/executor/task-processor.js +0 -133
- package/dist/server/infra/instance/file-instance-discovery.d.ts +0 -31
- package/dist/server/infra/instance/file-instance-discovery.js +0 -84
- package/dist/server/infra/instance/file-instance-manager.d.ts +0 -46
- package/dist/server/infra/instance/file-instance-manager.js +0 -123
- package/dist/server/infra/instance/index.d.ts +0 -3
- package/dist/server/infra/instance/index.js +0 -3
- package/dist/server/infra/instance/process-utils.d.ts +0 -14
- package/dist/server/infra/instance/process-utils.js +0 -39
- package/dist/server/infra/process/agent-worker.d.ts +0 -20
- package/dist/server/infra/process/agent-worker.js +0 -1399
- package/dist/server/infra/process/inline-agent-executor.d.ts +0 -32
- package/dist/server/infra/process/inline-agent-executor.js +0 -278
- package/dist/server/infra/process/ipc-types.d.ts +0 -68
- package/dist/server/infra/process/ipc-types.js +0 -12
- package/dist/server/infra/process/parent-heartbeat.d.ts +0 -47
- package/dist/server/infra/process/parent-heartbeat.js +0 -118
- package/dist/server/infra/process/process-manager.d.ts +0 -242
- package/dist/server/infra/process/process-manager.js +0 -765
- package/dist/server/infra/process/task-queue-manager.d.ts +0 -125
- package/dist/server/infra/process/task-queue-manager.js +0 -185
- package/dist/server/infra/process/transport-worker.d.ts +0 -20
- package/dist/server/infra/process/transport-worker.js +0 -196
- package/dist/server/infra/storage/keychain-token-store.d.ts +0 -13
- package/dist/server/infra/storage/keychain-token-store.js +0 -42
- package/dist/server/infra/terminal/oclif-terminal.d.ts +0 -19
- package/dist/server/infra/terminal/oclif-terminal.js +0 -60
- package/dist/server/infra/terminal/repl-terminal.d.ts +0 -31
- package/dist/server/infra/terminal/repl-terminal.js +0 -116
- package/dist/server/infra/tracking/mixpanel-tracking-service.d.ts +0 -24
- package/dist/server/infra/tracking/mixpanel-tracking-service.js +0 -49
- package/dist/server/infra/transport/transport-factory.d.ts +0 -17
- package/dist/server/infra/transport/transport-factory.js +0 -31
- package/dist/server/infra/usecase/connectors-use-case.d.ts +0 -63
- package/dist/server/infra/usecase/connectors-use-case.js +0 -234
- package/dist/server/infra/usecase/curate-use-case.d.ts +0 -59
- package/dist/server/infra/usecase/curate-use-case.js +0 -274
- package/dist/server/infra/usecase/init-use-case.d.ts +0 -126
- package/dist/server/infra/usecase/init-use-case.js +0 -538
- package/dist/server/infra/usecase/login-use-case.d.ts +0 -30
- package/dist/server/infra/usecase/login-use-case.js +0 -127
- package/dist/server/infra/usecase/logout-use-case.d.ts +0 -19
- package/dist/server/infra/usecase/logout-use-case.js +0 -48
- package/dist/server/infra/usecase/pull-use-case.d.ts +0 -49
- package/dist/server/infra/usecase/pull-use-case.js +0 -147
- package/dist/server/infra/usecase/push-use-case.d.ts +0 -50
- package/dist/server/infra/usecase/push-use-case.js +0 -191
- package/dist/server/infra/usecase/query-use-case.d.ts +0 -73
- package/dist/server/infra/usecase/query-use-case.js +0 -420
- package/dist/server/infra/usecase/reset-use-case.d.ts +0 -21
- package/dist/server/infra/usecase/reset-use-case.js +0 -60
- package/dist/server/infra/usecase/space-list-use-case.d.ts +0 -27
- package/dist/server/infra/usecase/space-list-use-case.js +0 -64
- package/dist/server/infra/usecase/space-switch-use-case.d.ts +0 -26
- package/dist/server/infra/usecase/space-switch-use-case.js +0 -110
- package/dist/server/infra/usecase/status-use-case.d.ts +0 -75
- package/dist/server/infra/usecase/status-use-case.js +0 -268
- package/dist/server/templates/skill/TROUBLESHOOTING.md +0 -50
- package/dist/server/templates/skill/WORKFLOWS.md +0 -229
- package/dist/server/utils/environment-detector.d.ts +0 -20
- package/dist/server/utils/environment-detector.js +0 -92
- package/dist/tui/app.d.ts +0 -9
- package/dist/tui/app.js +0 -28
- package/dist/tui/commands/connectors-command.d.ts +0 -8
- package/dist/tui/commands/connectors-command.js +0 -49
- package/dist/tui/commands/curate-command.d.ts +0 -9
- package/dist/tui/commands/curate-command.js +0 -80
- package/dist/tui/commands/index.js +0 -45
- package/dist/tui/commands/init-command.d.ts +0 -7
- package/dist/tui/commands/init-command.js +0 -87
- package/dist/tui/commands/login-command.d.ts +0 -7
- package/dist/tui/commands/login-command.js +0 -50
- package/dist/tui/commands/logout-command.d.ts +0 -5
- package/dist/tui/commands/logout-command.js +0 -46
- package/dist/tui/commands/model-command.d.ts +0 -13
- package/dist/tui/commands/model-command.js +0 -212
- package/dist/tui/commands/new-command.d.ts +0 -14
- package/dist/tui/commands/new-command.js +0 -61
- package/dist/tui/commands/provider-command.d.ts +0 -13
- package/dist/tui/commands/provider-command.js +0 -181
- package/dist/tui/commands/pull-command.d.ts +0 -5
- package/dist/tui/commands/pull-command.js +0 -61
- package/dist/tui/commands/push-command.d.ts +0 -5
- package/dist/tui/commands/push-command.js +0 -66
- package/dist/tui/commands/query-command.d.ts +0 -5
- package/dist/tui/commands/query-command.js +0 -63
- package/dist/tui/commands/reset-command.d.ts +0 -5
- package/dist/tui/commands/reset-command.js +0 -61
- package/dist/tui/commands/space/index.d.ts +0 -5
- package/dist/tui/commands/space/index.js +0 -14
- package/dist/tui/commands/space/list-command.d.ts +0 -5
- package/dist/tui/commands/space/list-command.js +0 -70
- package/dist/tui/commands/space/switch-command.d.ts +0 -5
- package/dist/tui/commands/space/switch-command.js +0 -35
- package/dist/tui/commands/status-command.d.ts +0 -5
- package/dist/tui/commands/status-command.js +0 -39
- package/dist/tui/components/api-key-dialog.js +0 -94
- package/dist/tui/components/message-list.d.ts +0 -16
- package/dist/tui/components/message-list.js +0 -120
- package/dist/tui/components/provider-dialog.js +0 -31
- package/dist/tui/components/tab-bar.d.ts +0 -11
- package/dist/tui/components/tab-bar.js +0 -11
- package/dist/tui/constants.d.ts +0 -6
- package/dist/tui/constants.js +0 -8
- package/dist/tui/contexts/auth-context.d.ts +0 -33
- package/dist/tui/contexts/auth-context.js +0 -193
- package/dist/tui/contexts/commands-context.d.ts +0 -37
- package/dist/tui/contexts/commands-context.js +0 -65
- package/dist/tui/contexts/index.d.ts +0 -11
- package/dist/tui/contexts/index.js +0 -11
- package/dist/tui/contexts/mode-context.d.ts +0 -43
- package/dist/tui/contexts/mode-context.js +0 -70
- package/dist/tui/contexts/onboarding-context.d.ts +0 -49
- package/dist/tui/contexts/onboarding-context.js +0 -193
- package/dist/tui/contexts/services-context.d.ts +0 -32
- package/dist/tui/contexts/services-context.js +0 -27
- package/dist/tui/contexts/tasks-context.d.ts +0 -101
- package/dist/tui/contexts/tasks-context.js +0 -422
- package/dist/tui/contexts/theme-context.d.ts +0 -55
- package/dist/tui/contexts/theme-context.js +0 -62
- package/dist/tui/contexts/transport-context.d.ts +0 -29
- package/dist/tui/contexts/transport-context.js +0 -81
- package/dist/tui/hooks/use-auth-polling.d.ts +0 -27
- package/dist/tui/hooks/use-auth-polling.js +0 -118
- package/dist/tui/hooks/use-onboarding-logs.d.ts +0 -17
- package/dist/tui/hooks/use-onboarding-logs.js +0 -26
- package/dist/tui/hooks/use-onboarding.d.ts +0 -7
- package/dist/tui/hooks/use-onboarding.js +0 -6
- package/dist/tui/index.d.ts +0 -1
- package/dist/tui/index.js +0 -1
- package/dist/tui/types.d.ts +0 -1
- package/dist/tui/types.js +0 -1
- package/dist/tui/utils/transport-client-helper.d.ts +0 -9
- package/dist/tui/utils/transport-client-helper.js +0 -99
- package/dist/tui/views/index.d.ts +0 -5
- package/dist/tui/views/index.js +0 -5
- package/dist/tui/views/init-view.d.ts +0 -15
- package/dist/tui/views/init-view.js +0 -41
- package/dist/tui/views/login-view.d.ts +0 -10
- package/dist/tui/views/login-view.js +0 -33
- package/dist/tui/views/main-view.d.ts +0 -12
- package/dist/tui/views/main-view.js +0 -20
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-reader.d.ts +0 -19
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-reader.d.ts.map +0 -1
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-reader.js +0 -2
- package/node_modules/@campfirein/brv-transport-client/dist/core/interfaces/i-instance-reader.js.map +0 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-discovery.d.ts +0 -32
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-discovery.d.ts.map +0 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-discovery.js +0 -85
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-discovery.js.map +0 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-reader.d.ts +0 -16
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-reader.d.ts.map +0 -1
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-reader.js +0 -47
- package/node_modules/@campfirein/brv-transport-client/dist/infra/file-instance-reader.js.map +0 -1
- /package/dist/{server/core/interfaces/instance/i-instance-discovery.js → agent/infra/agent/provider-update-config.js} +0 -0
- /package/dist/server/core/{interfaces/instance/i-instance-manager.js → domain/entities/curate-log-entry.js} +0 -0
- /package/dist/server/core/{interfaces/services/i-tracking-service.js → domain/entities/curation-status.js} +0 -0
- /package/dist/server/core/{interfaces/usecase/i-connectors-use-case.js → domain/transport/task-info.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-curate-use-case.js → agent/i-agent-pool.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-init-use-case.js → client/i-client-manager.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-login-use-case.js → context-tree/i-context-tree-merger.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-logout-use-case.js → daemon/i-agent-idle-timeout-policy.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-pull-use-case.js → daemon/i-daemon-resilience.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-push-use-case.js → daemon/i-heartbeat-writer.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-query-use-case.js → daemon/i-idle-timeout-policy.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-reset-use-case.js → daemon/i-shutdown-handler.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-space-list-use-case.js → hub/i-hub-install-service.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-space-switch-use-case.js → hub/i-hub-keychain-store.js} +0 -0
- /package/dist/server/core/interfaces/{usecase/i-status-use-case.js → hub/i-hub-registry-config-store.js} +0 -0
- /package/dist/tui/{commands → features/commands/utils}/arg-parser.js +0 -0
|
@@ -9,12 +9,15 @@ import { EnvironmentContextBuilder } from '../environment/environment-context-bu
|
|
|
9
9
|
import { ToolMetadataHandler } from '../tools/streaming/metadata-handler.js';
|
|
10
10
|
import { AsyncMutex } from './context/async-mutex.js';
|
|
11
11
|
import { ContextManager } from './context/context-manager.js';
|
|
12
|
+
import { DeferredEffects } from './context/deferred-effects.js';
|
|
12
13
|
import { LoopDetector } from './context/loop-detector.js';
|
|
13
14
|
import { ClaudeMessageFormatter } from './formatters/claude-formatter.js';
|
|
14
15
|
import { GeminiMessageFormatter } from './formatters/gemini-formatter.js';
|
|
16
|
+
import { OpenRouterMessageFormatter } from './formatters/openrouter-formatter.js';
|
|
15
17
|
import { ThoughtParser } from './thought-parser.js';
|
|
16
18
|
import { ClaudeTokenizer } from './tokenizers/claude-tokenizer.js';
|
|
17
19
|
import { GeminiTokenizer } from './tokenizers/gemini-tokenizer.js';
|
|
20
|
+
import { OpenRouterTokenizer } from './tokenizers/openrouter-tokenizer.js';
|
|
18
21
|
import { ToolOutputProcessor } from './tool-output-processor.js';
|
|
19
22
|
/** Target utilization ratio for message tokens (leaves headroom for response) */
|
|
20
23
|
const TARGET_MESSAGE_TOKEN_UTILIZATION = 0.7;
|
|
@@ -35,7 +38,7 @@ const TARGET_MESSAGE_TOKEN_UTILIZATION = 0.7;
|
|
|
35
38
|
* - Format messages for specific providers (handled by generators)
|
|
36
39
|
* - Handle retry logic (handled by RetryableContentGenerator decorator)
|
|
37
40
|
*/
|
|
38
|
-
export class
|
|
41
|
+
export class AgentLLMService {
|
|
39
42
|
/** Cached base system prompt (everything built by SystemPromptManager) for reuse across iterations */
|
|
40
43
|
cachedBasePrompt = null;
|
|
41
44
|
compactionService;
|
|
@@ -52,7 +55,10 @@ export class ByteRoverLLMService {
|
|
|
52
55
|
metadataHandler;
|
|
53
56
|
mutex = new AsyncMutex();
|
|
54
57
|
outputProcessor;
|
|
58
|
+
providerId;
|
|
55
59
|
providerType;
|
|
60
|
+
/** Optional sandbox service for rolling checkpoint variable injection (Pattern 1) */
|
|
61
|
+
sandboxService;
|
|
56
62
|
sessionEventBus;
|
|
57
63
|
sessionId;
|
|
58
64
|
systemPromptManager;
|
|
@@ -82,28 +88,32 @@ export class ByteRoverLLMService {
|
|
|
82
88
|
* @param options.compactionService - Optional compaction service for context overflow management
|
|
83
89
|
* @param options.historyStorage - Optional history storage for persistence
|
|
84
90
|
* @param options.logger - Optional logger for structured logging
|
|
91
|
+
* @param options.sandboxService - Optional sandbox service for rolling checkpoint variable injection
|
|
85
92
|
*/
|
|
86
93
|
constructor(sessionId, generator, config, options) {
|
|
87
94
|
this.sessionId = sessionId;
|
|
88
95
|
this.generator = generator;
|
|
89
96
|
this.compactionService = options.compactionService;
|
|
97
|
+
this.sandboxService = options.sandboxService;
|
|
90
98
|
this.toolManager = options.toolManager;
|
|
91
99
|
this.systemPromptManager = options.systemPromptManager;
|
|
92
100
|
this.memoryManager = options.memoryManager;
|
|
93
101
|
this.sessionEventBus = options.sessionEventBus;
|
|
94
102
|
this.logger = options.logger ?? new NoOpLogger();
|
|
95
|
-
this.outputProcessor = new ToolOutputProcessor(config.truncationConfig);
|
|
96
103
|
this.loopDetector = new LoopDetector();
|
|
97
104
|
this.environmentBuilder = new EnvironmentContextBuilder();
|
|
98
105
|
this.metadataHandler = new ToolMetadataHandler(this.sessionEventBus);
|
|
99
106
|
this.workingDirectory = process.cwd();
|
|
100
|
-
// Detect provider type
|
|
107
|
+
// Detect provider type: explicit provider config takes priority over model name heuristic
|
|
101
108
|
const modelName = config.model ?? 'claude-haiku-4-5@20251001';
|
|
102
|
-
this.
|
|
109
|
+
this.providerId = config.provider ?? 'byterover';
|
|
110
|
+
this.providerType = this.detectProviderType(modelName, config.provider);
|
|
103
111
|
// Validate core LLM config using Zod schema (logs warning if invalid)
|
|
104
112
|
this.validateConfig(modelName, config.maxInputTokens);
|
|
105
113
|
// Get effective max input tokens from registry (respects model limits)
|
|
106
|
-
|
|
114
|
+
// For 'openai' provider type, use 'openai' registry; for others use existing logic
|
|
115
|
+
const registryProvider = this.providerType === 'openai' ? 'openai' : this.providerType;
|
|
116
|
+
const effectiveMaxInputTokens = getEffectiveMaxInputTokens(registryProvider, modelName, config.maxInputTokens);
|
|
107
117
|
this.config = {
|
|
108
118
|
maxInputTokens: effectiveMaxInputTokens,
|
|
109
119
|
maxIterations: config.maxIterations ?? 50,
|
|
@@ -114,8 +124,14 @@ export class ByteRoverLLMService {
|
|
|
114
124
|
timeout: config.timeout,
|
|
115
125
|
verbose: config.verbose ?? false,
|
|
116
126
|
};
|
|
127
|
+
// Initialize output processor after config so maxInputTokens is available
|
|
128
|
+
this.outputProcessor = new ToolOutputProcessor(this.config.maxInputTokens, config.truncationConfig);
|
|
117
129
|
// Initialize formatter and tokenizer based on provider type
|
|
118
|
-
if (this.providerType === '
|
|
130
|
+
if (this.providerType === 'openai') {
|
|
131
|
+
this.formatter = new OpenRouterMessageFormatter();
|
|
132
|
+
this.tokenizer = new OpenRouterTokenizer();
|
|
133
|
+
}
|
|
134
|
+
else if (this.providerType === 'claude') {
|
|
119
135
|
this.formatter = new ClaudeMessageFormatter();
|
|
120
136
|
this.tokenizer = new ClaudeTokenizer(this.config.model);
|
|
121
137
|
}
|
|
@@ -157,6 +173,11 @@ export class ByteRoverLLMService {
|
|
|
157
173
|
this.memoryDirtyFlag = false;
|
|
158
174
|
// Extract options with defaults
|
|
159
175
|
const { executionContext, fileData, imageData, signal, stream, taskId } = options ?? {};
|
|
176
|
+
// RLM mode: Clear conversation history to prevent accumulation across calls.
|
|
177
|
+
// Context and history are offloaded to files, accessed via code_exec instead.
|
|
178
|
+
if (executionContext?.clearHistory) {
|
|
179
|
+
await this.contextManager.clearHistory();
|
|
180
|
+
}
|
|
160
181
|
// Get filtered tools based on command type (e.g., only read-only tools for 'query')
|
|
161
182
|
const toolSet = this.toolManager.getToolsForCommand(options?.executionContext?.commandType);
|
|
162
183
|
// Create state machine with configured limits (per-invocation overrides via ExecutionContext)
|
|
@@ -179,6 +200,7 @@ export class ByteRoverLLMService {
|
|
|
179
200
|
try {
|
|
180
201
|
// eslint-disable-next-line no-await-in-loop -- Sequential iterations required for agentic loop
|
|
181
202
|
const result = await this.executeAgenticIteration({
|
|
203
|
+
effectiveMaxIterations,
|
|
182
204
|
executionContext,
|
|
183
205
|
fileData,
|
|
184
206
|
imageData,
|
|
@@ -221,7 +243,7 @@ export class ByteRoverLLMService {
|
|
|
221
243
|
* Returns metadata about the service including:
|
|
222
244
|
* - Configured and model-specific token limits
|
|
223
245
|
* - Selected LLM model
|
|
224
|
-
* - Provider
|
|
246
|
+
* - Provider identity (e.g. 'byterover', 'anthropic', 'openrouter')
|
|
225
247
|
* - Router type (always 'in-built')
|
|
226
248
|
*
|
|
227
249
|
* This is useful for introspecting service capabilities and limits
|
|
@@ -236,7 +258,7 @@ export class ByteRoverLLMService {
|
|
|
236
258
|
configuredMaxInputTokens: this.config.maxInputTokens,
|
|
237
259
|
model: this.config.model,
|
|
238
260
|
modelMaxInputTokens: modelMaxTokens,
|
|
239
|
-
provider:
|
|
261
|
+
provider: this.providerId,
|
|
240
262
|
router: 'in-built',
|
|
241
263
|
};
|
|
242
264
|
}
|
|
@@ -319,6 +341,28 @@ export class ByteRoverLLMService {
|
|
|
319
341
|
tools: options.tools,
|
|
320
342
|
};
|
|
321
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Build a compact progress summary from current messages.
|
|
346
|
+
* Used by rolling checkpoint to capture agentic state before clearing history.
|
|
347
|
+
*
|
|
348
|
+
* @param messages - Current conversation messages
|
|
349
|
+
* @returns JSON string summarizing progress
|
|
350
|
+
*/
|
|
351
|
+
buildProgressSummary(messages) {
|
|
352
|
+
const toolCalls = messages
|
|
353
|
+
.filter((m) => m.toolCalls && m.toolCalls.length > 0)
|
|
354
|
+
.flatMap((m) => m.toolCalls.map((tc) => tc.function.name));
|
|
355
|
+
const assistantMessages = messages
|
|
356
|
+
.filter((m) => m.role === 'assistant')
|
|
357
|
+
.map((m) => typeof m.content === 'string' ? m.content.slice(0, 300) : '')
|
|
358
|
+
.filter(Boolean);
|
|
359
|
+
return JSON.stringify({
|
|
360
|
+
assistantSummaries: assistantMessages.slice(-3),
|
|
361
|
+
messageCount: messages.length,
|
|
362
|
+
toolsUsed: [...new Set(toolCalls)],
|
|
363
|
+
totalToolCalls: toolCalls.length,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
322
366
|
/**
|
|
323
367
|
* Call LLM via generator and process the response.
|
|
324
368
|
*
|
|
@@ -449,63 +493,98 @@ export class ByteRoverLLMService {
|
|
|
449
493
|
taskId: taskId || undefined,
|
|
450
494
|
utilizationPercent,
|
|
451
495
|
});
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
this.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
496
|
+
// Defer event emissions until after DB operations succeed
|
|
497
|
+
const effects = new DeferredEffects();
|
|
498
|
+
try {
|
|
499
|
+
if (overflowResult.recommendation === 'prune') {
|
|
500
|
+
// Try pruning tool outputs first
|
|
501
|
+
const pruneResult = await this.compactionService.pruneToolOutputs(this.sessionId, this.config.maxInputTokens);
|
|
502
|
+
// Sync in-memory state with storage (replace compacted tool outputs)
|
|
503
|
+
if (pruneResult.compactedCount > 0) {
|
|
504
|
+
this.contextManager.markToolOutputsCompacted();
|
|
505
|
+
effects.defer(() => {
|
|
506
|
+
this.sessionEventBus.emit('llmservice:contextPruned', {
|
|
507
|
+
pruneCount: pruneResult.compactedCount,
|
|
508
|
+
reason: 'overflow',
|
|
509
|
+
taskId: taskId || undefined,
|
|
510
|
+
tokensSaved: pruneResult.tokensSaved,
|
|
511
|
+
});
|
|
512
|
+
this.sessionEventBus.emit('llmservice:warning', {
|
|
513
|
+
message: `Context compaction: pruned ${pruneResult.compactedCount} old tool outputs (~${pruneResult.tokensSaved} tokens)`,
|
|
514
|
+
taskId: taskId || undefined,
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else if (overflowResult.recommendation === 'compact') {
|
|
520
|
+
const originalTokens = currentTokens;
|
|
521
|
+
// Full compaction needed - generate LLM summary
|
|
522
|
+
// Use the same taskId from caller for billing tracking
|
|
523
|
+
const summary = await this.compactionService.generateSummary(this.generator, messages, taskId, this.config.model);
|
|
524
|
+
await this.compactionService.createCompactionBoundary(this.sessionId, summary);
|
|
525
|
+
// Reload in-memory state to only include post-boundary messages
|
|
526
|
+
await this.contextManager.reloadFromStorage();
|
|
527
|
+
const compressedTokens = this.generator.estimateTokensSync(summary);
|
|
528
|
+
effects.defer(() => {
|
|
529
|
+
this.sessionEventBus.emit('llmservice:contextCompressed', {
|
|
530
|
+
compressedTokens,
|
|
531
|
+
originalTokens,
|
|
532
|
+
strategy: 'summary',
|
|
533
|
+
taskId: taskId || undefined,
|
|
534
|
+
});
|
|
535
|
+
this.sessionEventBus.emit('llmservice:warning', {
|
|
536
|
+
message: 'Context compaction: created summary boundary for conversation history',
|
|
537
|
+
taskId: taskId || undefined,
|
|
538
|
+
});
|
|
467
539
|
});
|
|
468
540
|
}
|
|
541
|
+
// All DB ops succeeded — fire events
|
|
542
|
+
effects.flush();
|
|
469
543
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
const summary = await this.compactionService.generateSummary(this.generator, messages, taskId, this.config.model);
|
|
475
|
-
await this.compactionService.createCompactionBoundary(this.sessionId, summary);
|
|
476
|
-
// Emit context compressed event
|
|
477
|
-
// Estimate compressed tokens (summary is much smaller than original)
|
|
478
|
-
const compressedTokens = this.generator.estimateTokensSync(summary);
|
|
479
|
-
this.sessionEventBus.emit('llmservice:contextCompressed', {
|
|
480
|
-
compressedTokens,
|
|
481
|
-
originalTokens,
|
|
482
|
-
strategy: 'summary',
|
|
483
|
-
taskId: taskId || undefined,
|
|
484
|
-
});
|
|
485
|
-
// Also emit warning for backward compatibility
|
|
486
|
-
this.sessionEventBus.emit('llmservice:warning', {
|
|
487
|
-
message: 'Context compaction: created summary boundary for conversation history',
|
|
488
|
-
taskId: taskId || undefined,
|
|
489
|
-
});
|
|
544
|
+
catch (error) {
|
|
545
|
+
// DB ops failed — discard pending events
|
|
546
|
+
effects.discard();
|
|
547
|
+
throw error;
|
|
490
548
|
}
|
|
491
549
|
}
|
|
492
550
|
/**
|
|
493
551
|
* Detect provider type from model name using the LLM registry.
|
|
494
552
|
*
|
|
495
|
-
* Uses
|
|
496
|
-
*
|
|
553
|
+
* Uses explicit provider config first, then the centralized registry,
|
|
554
|
+
* and falls back to string prefix matching if model is not in registry.
|
|
497
555
|
*
|
|
498
556
|
* @param model - Model identifier
|
|
499
|
-
* @
|
|
557
|
+
* @param explicitProvider - Optional explicit provider ID from config
|
|
558
|
+
* @returns Provider type ('claude', 'gemini', or 'openai')
|
|
500
559
|
*/
|
|
501
|
-
detectProviderType(model) {
|
|
502
|
-
//
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
560
|
+
detectProviderType(model, explicitProvider) {
|
|
561
|
+
// 1. Explicit provider mapping takes priority
|
|
562
|
+
if (explicitProvider) {
|
|
563
|
+
if (explicitProvider === 'anthropic')
|
|
564
|
+
return 'claude';
|
|
565
|
+
if (explicitProvider === 'google' || explicitProvider === 'google-vertex')
|
|
566
|
+
return 'gemini';
|
|
567
|
+
if (['groq', 'mistral', 'openai', 'openai-compatible', 'openrouter', 'xai'].includes(explicitProvider))
|
|
568
|
+
return 'openai';
|
|
506
569
|
}
|
|
507
|
-
//
|
|
508
|
-
|
|
570
|
+
// 2. Use registry to detect provider from model name
|
|
571
|
+
const registryProvider = getProviderFromModel(model);
|
|
572
|
+
if (registryProvider === 'claude')
|
|
573
|
+
return 'claude';
|
|
574
|
+
if (registryProvider === 'gemini')
|
|
575
|
+
return 'gemini';
|
|
576
|
+
if (registryProvider === 'openai')
|
|
577
|
+
return 'openai';
|
|
578
|
+
// 3. Fallback to string prefix matching for unknown models
|
|
579
|
+
const lowerModel = model.toLowerCase();
|
|
580
|
+
if (lowerModel.startsWith('claude'))
|
|
581
|
+
return 'claude';
|
|
582
|
+
if (lowerModel.startsWith('gpt') ||
|
|
583
|
+
lowerModel.startsWith('o1') ||
|
|
584
|
+
lowerModel.startsWith('o3') ||
|
|
585
|
+
lowerModel.startsWith('o4'))
|
|
586
|
+
return 'openai';
|
|
587
|
+
return 'gemini';
|
|
509
588
|
}
|
|
510
589
|
/**
|
|
511
590
|
* Determine which reflection prompt to add based on hierarchical priority.
|
|
@@ -521,12 +600,13 @@ export class ByteRoverLLMService {
|
|
|
521
600
|
* @param commandType - Command type ('query' or 'curate')
|
|
522
601
|
* @returns Reflection type to add, or undefined if none eligible
|
|
523
602
|
*/
|
|
524
|
-
determineReflectionType(iterationCount, commandType) {
|
|
603
|
+
determineReflectionType(iterationCount, commandType, maxIterations) {
|
|
604
|
+
const effectiveMax = maxIterations ?? this.config.maxIterations;
|
|
525
605
|
const isQuery = commandType === 'query';
|
|
526
|
-
const isLastIteration = iterationCount ===
|
|
527
|
-
const midPoint = Math.floor(
|
|
606
|
+
const isLastIteration = iterationCount === effectiveMax - 1;
|
|
607
|
+
const midPoint = Math.floor(effectiveMax / 2);
|
|
528
608
|
const isAtMidPoint = iterationCount === midPoint;
|
|
529
|
-
const isNearMax = iterationCount >= Math.floor(
|
|
609
|
+
const isNearMax = iterationCount >= Math.floor(effectiveMax * 0.8);
|
|
530
610
|
const isPeriodicCheck = iterationCount > 0 && iterationCount % 3 === 0;
|
|
531
611
|
// Priority 1: final_iteration (query only, last iteration) - highest priority
|
|
532
612
|
if (isQuery && isLastIteration) {
|
|
@@ -550,6 +630,7 @@ export class ByteRoverLLMService {
|
|
|
550
630
|
* Execute a single iteration of the agentic loop.
|
|
551
631
|
*
|
|
552
632
|
* @param options - Iteration options
|
|
633
|
+
* @param options.effectiveMaxIterations - Effective max iterations (per-invocation override or config default)
|
|
553
634
|
* @param options.executionContext - Optional execution context
|
|
554
635
|
* @param options.fileData - Optional file data (only used on first iteration)
|
|
555
636
|
* @param options.imageData - Optional image data (only used on first iteration)
|
|
@@ -561,7 +642,7 @@ export class ByteRoverLLMService {
|
|
|
561
642
|
* @returns Final response string if complete, null if more iterations needed
|
|
562
643
|
*/
|
|
563
644
|
async executeAgenticIteration(options) {
|
|
564
|
-
const { executionContext, fileData, imageData, iterationCount, stream, taskId, textInput, tools } = options;
|
|
645
|
+
const { effectiveMaxIterations, executionContext, fileData, imageData, iterationCount, stream, taskId, textInput, tools } = options;
|
|
565
646
|
// Build system prompt using SystemPromptManager (before compression for correct token accounting)
|
|
566
647
|
// Use filtered tool names based on command type (e.g., only read-only tools for 'query')
|
|
567
648
|
const availableTools = this.toolManager.getToolNamesForCommand(executionContext?.commandType);
|
|
@@ -601,12 +682,12 @@ export class ByteRoverLLMService {
|
|
|
601
682
|
}
|
|
602
683
|
let systemPrompt = basePrompt;
|
|
603
684
|
// Determine which reflection prompt to add (only highest priority is chosen)
|
|
604
|
-
const reflectionType = this.determineReflectionType(iterationCount, executionContext?.commandType);
|
|
685
|
+
const reflectionType = this.determineReflectionType(iterationCount, executionContext?.commandType, effectiveMaxIterations);
|
|
605
686
|
// Add reflection prompt if eligible (hierarchical: only one reflection per iteration)
|
|
606
687
|
if (reflectionType) {
|
|
607
688
|
const reflectionPrompt = this.systemPromptManager.buildReflectionPrompt({
|
|
608
689
|
currentIteration: iterationCount + 1,
|
|
609
|
-
maxIterations:
|
|
690
|
+
maxIterations: effectiveMaxIterations,
|
|
610
691
|
type: reflectionType,
|
|
611
692
|
});
|
|
612
693
|
systemPrompt = systemPrompt + '\n\n' + reflectionPrompt;
|
|
@@ -624,7 +705,7 @@ export class ByteRoverLLMService {
|
|
|
624
705
|
}
|
|
625
706
|
// Final iteration optimization for query: strip tools (reflection already added above)
|
|
626
707
|
let toolsForThisIteration = tools;
|
|
627
|
-
if (executionContext?.commandType === 'query' && iterationCount ===
|
|
708
|
+
if (executionContext?.commandType === 'query' && iterationCount === effectiveMaxIterations - 1) {
|
|
628
709
|
toolsForThisIteration = {}; // Empty toolset forces text response
|
|
629
710
|
}
|
|
630
711
|
// Get token count for logging (using system prompt for token accounting)
|
|
@@ -635,12 +716,45 @@ export class ByteRoverLLMService {
|
|
|
635
716
|
if (iterationCount === 0) {
|
|
636
717
|
await this.contextManager.addUserMessage(textInput, imageData, fileData);
|
|
637
718
|
}
|
|
638
|
-
|
|
639
|
-
|
|
719
|
+
// Rolling checkpoint: periodically save progress and clear history for RLM commands.
|
|
720
|
+
// This prevents unbounded token accumulation during long curation/query tasks.
|
|
721
|
+
if (iterationCount > 0) {
|
|
722
|
+
const preCheckpointMessages = this.contextManager.getMessages();
|
|
723
|
+
const preCheckpointTokens = preCheckpointMessages.reduce((sum, msg) => sum + this.generator.estimateTokensSync(typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content)), 0);
|
|
724
|
+
if (this.shouldTriggerCheckpoint(iterationCount, executionContext?.commandType, preCheckpointTokens)) {
|
|
725
|
+
await this.performRollingCheckpoint(iterationCount, this.sessionId, textInput);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
640
728
|
const maxMessageTokens = this.config.maxInputTokens - systemPromptTokens;
|
|
641
729
|
// Target utilization to leave headroom for response
|
|
642
730
|
const targetMessageTokens = Math.floor(maxMessageTokens * TARGET_MESSAGE_TOKEN_UTILIZATION);
|
|
643
|
-
|
|
731
|
+
// Smart pruning: try clearing old tool outputs before destructive compression
|
|
732
|
+
this.contextManager.markToolOutputsCompacted(2);
|
|
733
|
+
// Get token counts (recalculate if pruning changed content)
|
|
734
|
+
const currentMessages = this.contextManager.getMessages();
|
|
735
|
+
const effectiveTokenCounts = currentMessages.map((msg) => this.generator.estimateTokensSync(typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content)));
|
|
736
|
+
// Destructive compression as fallback if still over limit
|
|
737
|
+
this.contextManager.compressMessage(targetMessageTokens, effectiveTokenCounts);
|
|
738
|
+
// Emergency guard: if still over 90% after normal compression, force aggressive compaction
|
|
739
|
+
// This is critical for curate/query commands where there's only 1 user turn,
|
|
740
|
+
// making the protectedTurns=2 in markToolOutputsCompacted() ineffective.
|
|
741
|
+
if (executionContext?.commandType === 'curate' || executionContext?.commandType === 'query') {
|
|
742
|
+
const postCompressionMessages = this.contextManager.getMessages();
|
|
743
|
+
const postCompressionTokens = postCompressionMessages.reduce((sum, msg) => sum + this.generator.estimateTokensSync(typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content)), 0);
|
|
744
|
+
const totalWithSystem = postCompressionTokens + systemPromptTokens;
|
|
745
|
+
if (totalWithSystem > this.config.maxInputTokens * 0.9) {
|
|
746
|
+
// Aggressive: compact ALL tool outputs (protect 0 turns instead of 2)
|
|
747
|
+
this.contextManager.markToolOutputsCompacted(0);
|
|
748
|
+
// Recalculate and re-compress
|
|
749
|
+
const aggressiveMessages = this.contextManager.getMessages();
|
|
750
|
+
const aggressiveTokens = aggressiveMessages.map((msg) => this.generator.estimateTokensSync(typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content)));
|
|
751
|
+
this.contextManager.compressMessage(targetMessageTokens, aggressiveTokens);
|
|
752
|
+
this.sessionEventBus.emit('llmservice:warning', {
|
|
753
|
+
message: `Emergency context compression triggered (${Math.round((totalWithSystem / this.config.maxInputTokens) * 100)}% utilization)`,
|
|
754
|
+
taskId,
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
644
758
|
// Build generation request
|
|
645
759
|
const request = this.buildGenerateContentRequest({
|
|
646
760
|
executionContext,
|
|
@@ -660,8 +774,18 @@ export class ByteRoverLLMService {
|
|
|
660
774
|
await this.checkAndTriggerCompaction(taskId ?? '');
|
|
661
775
|
return response;
|
|
662
776
|
}
|
|
663
|
-
// Has tool calls - handle them (pass taskId for
|
|
664
|
-
await this.handleToolCalls(lastMessage, taskId);
|
|
777
|
+
// Has tool calls - handle them (pass taskId and executionContext for context-aware behavior)
|
|
778
|
+
const earlyExitResult = await this.handleToolCalls(lastMessage, taskId, executionContext);
|
|
779
|
+
// Check for early exit from setFinalResult()
|
|
780
|
+
if (earlyExitResult) {
|
|
781
|
+
this.sessionEventBus.emit('llmservice:response', {
|
|
782
|
+
content: earlyExitResult,
|
|
783
|
+
model: this.config.model,
|
|
784
|
+
provider: this.providerId,
|
|
785
|
+
taskId,
|
|
786
|
+
});
|
|
787
|
+
return earlyExitResult;
|
|
788
|
+
}
|
|
665
789
|
// Auto-compaction check after tool execution batch
|
|
666
790
|
await this.checkAndTriggerCompaction(taskId ?? '');
|
|
667
791
|
return null;
|
|
@@ -673,9 +797,10 @@ export class ByteRoverLLMService {
|
|
|
673
797
|
*
|
|
674
798
|
* @param toolCall - Tool call to execute
|
|
675
799
|
* @param taskId - Task ID from usecase for billing tracking (passed to subagents)
|
|
800
|
+
* @param executionContext - Optional execution context for context-aware tool behavior
|
|
676
801
|
* @returns Parallel tool result with all execution data
|
|
677
802
|
*/
|
|
678
|
-
async executeToolCallParallel(toolCall, taskId) {
|
|
803
|
+
async executeToolCallParallel(toolCall, taskId, executionContext) {
|
|
679
804
|
const toolName = toolCall.function.name;
|
|
680
805
|
const toolArgs = JSON.parse(toolCall.function.arguments);
|
|
681
806
|
try {
|
|
@@ -720,13 +845,14 @@ export class ByteRoverLLMService {
|
|
|
720
845
|
// Create metadata callback for streaming tool output
|
|
721
846
|
const metadataCallback = this.metadataHandler.createCallback(toolCall.id, toolName);
|
|
722
847
|
// Execute tool via ToolManager (returns structured result)
|
|
723
|
-
// Pass taskId in context for subagent billing tracking
|
|
848
|
+
// Pass taskId and commandType in context for subagent billing tracking and context-aware behavior
|
|
724
849
|
const result = await this.toolManager.executeTool(toolName, toolArgs, this.sessionId, {
|
|
850
|
+
commandType: executionContext?.commandType,
|
|
725
851
|
metadata: metadataCallback,
|
|
726
852
|
taskId,
|
|
727
853
|
});
|
|
728
|
-
// Process output (truncation and file saving if needed)
|
|
729
|
-
const processedOutput = await this.outputProcessor.processStructuredOutput(toolName, result.content);
|
|
854
|
+
// Process output (truncation and file saving if needed, with per-command overrides)
|
|
855
|
+
const processedOutput = await this.outputProcessor.processStructuredOutput(toolName, result.content, executionContext?.commandType);
|
|
730
856
|
// Emit truncation event if output was truncated
|
|
731
857
|
if (processedOutput.metadata?.truncated) {
|
|
732
858
|
this.sessionEventBus.emit('llmservice:outputTruncated', {
|
|
@@ -750,7 +876,11 @@ export class ByteRoverLLMService {
|
|
|
750
876
|
taskId: taskId || undefined,
|
|
751
877
|
toolName,
|
|
752
878
|
});
|
|
879
|
+
// Check for early exit signal from setFinalResult() in sandbox
|
|
880
|
+
const toolContent = result.content;
|
|
881
|
+
const earlyExitResult = typeof toolContent?.finalResult === 'string' ? toolContent.finalResult : undefined;
|
|
753
882
|
return {
|
|
883
|
+
earlyExitResult,
|
|
754
884
|
toolCall,
|
|
755
885
|
toolResult: {
|
|
756
886
|
errorType: result.errorType,
|
|
@@ -827,7 +957,7 @@ export class ByteRoverLLMService {
|
|
|
827
957
|
this.sessionEventBus.emit('llmservice:response', {
|
|
828
958
|
content,
|
|
829
959
|
model: this.config.model,
|
|
830
|
-
provider:
|
|
960
|
+
provider: this.providerId,
|
|
831
961
|
taskId: taskId || undefined,
|
|
832
962
|
});
|
|
833
963
|
// Add assistant message to context
|
|
@@ -882,26 +1012,34 @@ export class ByteRoverLLMService {
|
|
|
882
1012
|
this.sessionEventBus.emit('llmservice:warning', {
|
|
883
1013
|
message: `Agent terminated: ${reason} after ${context.turnCount} turns`,
|
|
884
1014
|
model: this.config.model,
|
|
885
|
-
provider:
|
|
1015
|
+
provider: this.providerId,
|
|
886
1016
|
taskId: taskId || undefined,
|
|
887
1017
|
});
|
|
888
1018
|
// Get accumulated response from context
|
|
889
1019
|
const partialResponse = await this.getPartialResponse();
|
|
1020
|
+
// Compute final content with fallback BEFORE emitting, so the event
|
|
1021
|
+
// carries the same content that is returned (prevents empty-string mismatch
|
|
1022
|
+
// when the streaming pipeline reads from the emitted event rather than the return value)
|
|
1023
|
+
let finalContent;
|
|
1024
|
+
if (reason === TerminationReason.MAX_TURNS) {
|
|
1025
|
+
finalContent =
|
|
1026
|
+
partialResponse ||
|
|
1027
|
+
'Maximum iterations reached without completing the task. Please try breaking down the task into smaller steps.';
|
|
1028
|
+
}
|
|
1029
|
+
else if (reason === TerminationReason.TIMEOUT) {
|
|
1030
|
+
finalContent = partialResponse || 'Execution timed out. Please try a simpler task or increase the timeout.';
|
|
1031
|
+
}
|
|
1032
|
+
else {
|
|
1033
|
+
finalContent = partialResponse || 'Agent execution terminated unexpectedly.';
|
|
1034
|
+
}
|
|
890
1035
|
this.sessionEventBus.emit('llmservice:response', {
|
|
891
|
-
content:
|
|
1036
|
+
content: finalContent,
|
|
892
1037
|
model: this.config.model,
|
|
893
1038
|
partial: true,
|
|
894
|
-
provider:
|
|
1039
|
+
provider: this.providerId,
|
|
895
1040
|
taskId: taskId || undefined,
|
|
896
1041
|
});
|
|
897
|
-
|
|
898
|
-
return (partialResponse ||
|
|
899
|
-
'Maximum iterations reached without completing the task. Please try breaking down the task into smaller steps.');
|
|
900
|
-
}
|
|
901
|
-
if (reason === TerminationReason.TIMEOUT) {
|
|
902
|
-
return partialResponse || 'Execution timed out. Please try a simpler task or increase the timeout.';
|
|
903
|
-
}
|
|
904
|
-
return partialResponse || 'Agent execution terminated unexpectedly.';
|
|
1042
|
+
return finalContent;
|
|
905
1043
|
}
|
|
906
1044
|
/**
|
|
907
1045
|
* Handle thoughts from LLM response (Gemini only).
|
|
@@ -937,8 +1075,10 @@ export class ByteRoverLLMService {
|
|
|
937
1075
|
*
|
|
938
1076
|
* @param lastMessage - Last message containing tool calls
|
|
939
1077
|
* @param taskId - Task ID from usecase for billing tracking (passed to subagents)
|
|
1078
|
+
* @param executionContext - Optional execution context for context-aware tool behavior
|
|
1079
|
+
* @returns Early exit result if setFinalResult() was called, undefined otherwise
|
|
940
1080
|
*/
|
|
941
|
-
async handleToolCalls(lastMessage, taskId) {
|
|
1081
|
+
async handleToolCalls(lastMessage, taskId, executionContext) {
|
|
942
1082
|
if (!lastMessage.toolCalls || lastMessage.toolCalls.length === 0) {
|
|
943
1083
|
return;
|
|
944
1084
|
}
|
|
@@ -950,7 +1090,8 @@ export class ByteRoverLLMService {
|
|
|
950
1090
|
// Step 1: Create pending tool parts for all tool calls
|
|
951
1091
|
for (const toolCall of lastMessage.toolCalls) {
|
|
952
1092
|
const toolArgs = JSON.parse(toolCall.function.arguments);
|
|
953
|
-
|
|
1093
|
+
// eslint-disable-next-line no-await-in-loop -- Must add pending parts in order
|
|
1094
|
+
await this.contextManager.addToolCallPending(toolCall.id, toolCall.function.name, toolArgs);
|
|
954
1095
|
}
|
|
955
1096
|
// Step 2: Transition all to running state
|
|
956
1097
|
const startTime = Date.now();
|
|
@@ -960,15 +1101,16 @@ export class ByteRoverLLMService {
|
|
|
960
1101
|
startedAt: startTime,
|
|
961
1102
|
status: 'running',
|
|
962
1103
|
};
|
|
963
|
-
|
|
1104
|
+
// eslint-disable-next-line no-await-in-loop -- Must update states in order
|
|
1105
|
+
await this.contextManager.updateToolCallState(toolCall.id, runningState);
|
|
964
1106
|
}
|
|
965
1107
|
// Check if any memory-modifying tools are being called (invalidates cached system prompt)
|
|
966
1108
|
const memoryModifyingTools = new Set(['delete_memory', 'edit_memory', 'write_memory']);
|
|
967
1109
|
if (lastMessage.toolCalls.some((tc) => memoryModifyingTools.has(tc.function.name))) {
|
|
968
1110
|
this.memoryDirtyFlag = true;
|
|
969
1111
|
}
|
|
970
|
-
// Step 3: Execute all tool calls in parallel (pass taskId for
|
|
971
|
-
const parallelResults = await Promise.allSettled(lastMessage.toolCalls.map((toolCall) => this.executeToolCallParallel(toolCall, taskId)));
|
|
1112
|
+
// Step 3: Execute all tool calls in parallel (pass taskId + commandType for context-aware behavior)
|
|
1113
|
+
const parallelResults = await Promise.allSettled(lastMessage.toolCalls.map((toolCall) => this.executeToolCallParallel(toolCall, taskId, executionContext)));
|
|
972
1114
|
// Step 4: Update tool part states with results (in order)
|
|
973
1115
|
const endTime = Date.now();
|
|
974
1116
|
// eslint-disable-next-line unicorn/no-for-loop -- Need index to access both parallelResults and toolCalls in parallel
|
|
@@ -989,7 +1131,8 @@ export class ByteRoverLLMService {
|
|
|
989
1131
|
time: { end: endTime, start: startTime },
|
|
990
1132
|
title: result.toolResult.processedOutput.title,
|
|
991
1133
|
};
|
|
992
|
-
|
|
1134
|
+
// eslint-disable-next-line no-await-in-loop -- Must update states in order
|
|
1135
|
+
await this.contextManager.updateToolCallState(toolCall.id, completedState);
|
|
993
1136
|
}
|
|
994
1137
|
else {
|
|
995
1138
|
// Transition to error state
|
|
@@ -999,7 +1142,8 @@ export class ByteRoverLLMService {
|
|
|
999
1142
|
status: 'error',
|
|
1000
1143
|
time: { end: endTime, start: startTime },
|
|
1001
1144
|
};
|
|
1002
|
-
|
|
1145
|
+
// eslint-disable-next-line no-await-in-loop -- Must update states in order
|
|
1146
|
+
await this.contextManager.updateToolCallState(toolCall.id, errorState);
|
|
1003
1147
|
}
|
|
1004
1148
|
// Also add to context as tool result message (for backward compatibility)
|
|
1005
1149
|
// eslint-disable-next-line no-await-in-loop -- Must add results in order
|
|
@@ -1020,7 +1164,8 @@ export class ByteRoverLLMService {
|
|
|
1020
1164
|
status: 'error',
|
|
1021
1165
|
time: { end: endTime, start: startTime },
|
|
1022
1166
|
};
|
|
1023
|
-
|
|
1167
|
+
// eslint-disable-next-line no-await-in-loop -- Must update states in order
|
|
1168
|
+
await this.contextManager.updateToolCallState(toolCall.id, errorState);
|
|
1024
1169
|
// Also add to context as tool result message (for backward compatibility)
|
|
1025
1170
|
// eslint-disable-next-line no-await-in-loop -- Must add results in order
|
|
1026
1171
|
await this.contextManager.addToolResult(toolCall.id, toolCall.function.name, `Error: ${errorMessage}`, {
|
|
@@ -1029,6 +1174,40 @@ export class ByteRoverLLMService {
|
|
|
1029
1174
|
});
|
|
1030
1175
|
}
|
|
1031
1176
|
}
|
|
1177
|
+
// Check for early exit signal from setFinalResult() in any tool result
|
|
1178
|
+
for (const settledResult of parallelResults) {
|
|
1179
|
+
if (settledResult.status === 'fulfilled' && settledResult.value.earlyExitResult) {
|
|
1180
|
+
return settledResult.value.earlyExitResult;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Perform a rolling checkpoint: save progress to sandbox variable, clear history, re-inject prompt.
|
|
1186
|
+
* This treats each batch of iterations as a mini-task, preventing unbounded token accumulation.
|
|
1187
|
+
*
|
|
1188
|
+
* @param iterationCount - Current iteration number
|
|
1189
|
+
* @param sessionId - Session ID for sandbox variable injection
|
|
1190
|
+
* @param textInput - Original user input text (for continuation prompt)
|
|
1191
|
+
*/
|
|
1192
|
+
async performRollingCheckpoint(iterationCount, sessionId, textInput) {
|
|
1193
|
+
const messages = this.contextManager.getMessages();
|
|
1194
|
+
const progressSummary = this.buildProgressSummary(messages);
|
|
1195
|
+
// Store progress in sandbox variable (persists across history clears)
|
|
1196
|
+
const checkpointVar = `__checkpoint_progress`;
|
|
1197
|
+
this.sandboxService.setSandboxVariable(sessionId, checkpointVar, progressSummary);
|
|
1198
|
+
// Clear conversation history
|
|
1199
|
+
await this.contextManager.clearHistory();
|
|
1200
|
+
// Re-inject continuation prompt with variable reference
|
|
1201
|
+
const continuationPrompt = [
|
|
1202
|
+
`Continue task. Iteration checkpoint at turn ${iterationCount}.`,
|
|
1203
|
+
`Previous progress stored in variable: ${checkpointVar}`,
|
|
1204
|
+
`Original task: ${textInput.slice(0, 200)}${textInput.length > 200 ? '...' : ''}`,
|
|
1205
|
+
`Read ${checkpointVar} via code_exec to understand what was done, then continue.`,
|
|
1206
|
+
].join('\n');
|
|
1207
|
+
await this.contextManager.addUserMessage(continuationPrompt);
|
|
1208
|
+
this.sessionEventBus.emit('llmservice:warning', {
|
|
1209
|
+
message: `Rolling checkpoint at iteration ${iterationCount}: history cleared, progress saved to ${checkpointVar}`,
|
|
1210
|
+
});
|
|
1032
1211
|
}
|
|
1033
1212
|
/**
|
|
1034
1213
|
* Replace the DateTime section in a cached system prompt with a fresh timestamp.
|
|
@@ -1042,6 +1221,39 @@ export class ByteRoverLLMService {
|
|
|
1042
1221
|
const freshDateTime = `<dateTime>Current date and time: ${new Date().toISOString()}</dateTime>`;
|
|
1043
1222
|
return cachedPrompt.replace(/<dateTime>[\S\s]*?<\/dateTime>/, freshDateTime);
|
|
1044
1223
|
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Check if a rolling checkpoint should trigger.
|
|
1226
|
+
* Triggers every N iterations for curate/query commands, or when token utilization is high.
|
|
1227
|
+
*
|
|
1228
|
+
* @param iterationCount - Current iteration number
|
|
1229
|
+
* @param commandType - Command type (only curate/query trigger checkpoints)
|
|
1230
|
+
* @param currentTokens - Current estimated token count for messages
|
|
1231
|
+
* @returns True if checkpoint should trigger
|
|
1232
|
+
*/
|
|
1233
|
+
shouldTriggerCheckpoint(iterationCount, commandType, currentTokens) {
|
|
1234
|
+
// Only for curate/query commands (never disrupt chat)
|
|
1235
|
+
if (commandType !== 'curate' && commandType !== 'query') {
|
|
1236
|
+
return false;
|
|
1237
|
+
}
|
|
1238
|
+
// Never on first iteration
|
|
1239
|
+
if (iterationCount === 0) {
|
|
1240
|
+
return false;
|
|
1241
|
+
}
|
|
1242
|
+
// Need sandbox service for variable injection
|
|
1243
|
+
if (!this.sandboxService) {
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
// Trigger every 5 iterations
|
|
1247
|
+
const CHECKPOINT_INTERVAL = 5;
|
|
1248
|
+
if (iterationCount % CHECKPOINT_INTERVAL === 0) {
|
|
1249
|
+
return true;
|
|
1250
|
+
}
|
|
1251
|
+
// Trigger on high token utilization (> 60%)
|
|
1252
|
+
if (currentTokens && currentTokens > this.config.maxInputTokens * 0.6) {
|
|
1253
|
+
return true;
|
|
1254
|
+
}
|
|
1255
|
+
return false;
|
|
1256
|
+
}
|
|
1045
1257
|
/**
|
|
1046
1258
|
* Validate LLM configuration using Zod schema.
|
|
1047
1259
|
*
|