byterover-cli 1.6.0 → 1.7.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 +10 -10
- package/dist/agent/core/domain/agent/agent-registry.d.ts +90 -0
- package/dist/agent/core/domain/agent/agent-registry.js +152 -0
- package/dist/agent/core/domain/environment/types.d.ts +20 -0
- package/dist/agent/core/domain/folder-pack/index.d.ts +1 -0
- package/dist/agent/core/domain/folder-pack/types.d.ts +101 -0
- package/dist/agent/core/domain/sandbox/constants.d.ts +27 -0
- package/dist/agent/core/domain/sandbox/constants.js +134 -0
- package/dist/agent/core/domain/sandbox/index.d.ts +2 -0
- package/dist/agent/core/domain/sandbox/index.js +2 -0
- package/dist/agent/core/domain/sandbox/types.d.ts +30 -0
- package/dist/agent/core/domain/sandbox/types.js +5 -0
- package/dist/agent/core/domain/storage/history-types.d.ts +38 -0
- package/dist/agent/core/domain/storage/message-storage-types.d.ts +327 -0
- package/dist/agent/core/domain/streaming/types.d.ts +119 -0
- package/dist/agent/core/domain/system-prompt/types.d.ts +175 -0
- package/dist/agent/core/domain/tools/constants.d.ts +33 -0
- package/dist/agent/core/domain/tools/constants.js +29 -0
- package/dist/agent/core/interfaces/cipher-services.d.ts +82 -0
- package/dist/agent/core/interfaces/i-blob-storage.d.ts +84 -0
- package/dist/agent/core/interfaces/i-chat-session.d.ts +107 -0
- package/dist/agent/core/interfaces/i-cipher-agent.d.ts +125 -0
- package/dist/agent/core/interfaces/i-content-generator.d.ts +148 -0
- package/dist/agent/core/interfaces/i-curate-service.d.ts +185 -0
- package/dist/agent/core/interfaces/i-curate-service.js +5 -0
- package/dist/agent/core/interfaces/i-document-parser-service.d.ts +54 -0
- package/dist/agent/core/interfaces/i-file-system.d.ts +79 -0
- package/dist/agent/core/interfaces/i-folder-pack-service.d.ts +34 -0
- package/dist/agent/core/interfaces/i-history-storage.d.ts +53 -0
- package/dist/agent/core/interfaces/i-llm-service.d.ts +61 -0
- package/dist/agent/core/interfaces/i-process-service.d.ts +65 -0
- package/dist/agent/core/interfaces/i-sandbox-service.d.ts +58 -0
- package/dist/agent/core/interfaces/i-session-persistence.d.ts +133 -0
- package/dist/agent/core/interfaces/i-system-prompt-contributor.d.ts +25 -0
- package/dist/agent/core/interfaces/i-todo-storage.d.ts +24 -0
- package/dist/agent/core/interfaces/i-tool-plugin.d.ts +90 -0
- package/dist/agent/core/interfaces/i-tool-provider.d.ts +65 -0
- package/dist/agent/core/interfaces/index.d.ts +32 -0
- package/dist/agent/infra/agent/agent-error.d.ts +54 -0
- package/dist/agent/infra/agent/agent-error.js +79 -0
- package/dist/agent/infra/agent/agent-schemas.d.ts +264 -0
- package/dist/agent/infra/agent/agent-state-manager.d.ts +140 -0
- package/dist/agent/infra/agent/base-agent.d.ts +118 -0
- package/dist/agent/infra/agent/cipher-agent.d.ts +173 -0
- package/dist/agent/infra/agent/cipher-agent.js +564 -0
- package/dist/agent/infra/agent/interactive-commands.d.ts +16 -0
- package/dist/agent/infra/agent/interactive-loop.d.ts +24 -0
- package/dist/agent/infra/agent/service-initializer.d.ts +79 -0
- package/dist/agent/infra/agent/service-initializer.js +298 -0
- package/dist/agent/infra/agent/types.d.ts +35 -0
- package/dist/agent/infra/blob/blob-reference-resolver.d.ts +107 -0
- package/dist/agent/infra/blob/blob-storage-factory.d.ts +13 -0
- package/dist/agent/infra/blob/index.d.ts +10 -0
- package/dist/agent/infra/blob/index.js +12 -0
- package/dist/agent/infra/blob/migrations.d.ts +63 -0
- package/dist/agent/infra/blob/sqlite-blob-storage.d.ts +82 -0
- package/dist/agent/infra/blob/sqlite-blob-storage.js +304 -0
- package/dist/agent/infra/display/todo-display.d.ts +23 -0
- package/dist/agent/infra/document-parser/document-parser-service.d.ts +31 -0
- package/dist/agent/infra/document-parser/document-parser-service.js +68 -0
- package/dist/agent/infra/document-parser/index.d.ts +2 -0
- package/dist/agent/infra/document-parser/index.js +2 -0
- package/dist/agent/infra/document-parser/office-parser.d.ts +45 -0
- package/dist/agent/infra/document-parser/office-parser.js +108 -0
- package/dist/agent/infra/environment/environment-context-builder.d.ts +78 -0
- package/dist/agent/infra/environment/environment-context-builder.js +256 -0
- package/dist/agent/infra/events/event-emitter.d.ts +137 -0
- package/dist/agent/infra/file-system/binary-utils.d.ts +59 -0
- package/dist/agent/infra/file-system/binary-utils.js +225 -0
- package/dist/agent/infra/file-system/file-system-service.d.ts +134 -0
- package/dist/agent/infra/file-system/file-system-service.js +1021 -0
- package/dist/agent/infra/file-system/path-validator.d.ts +101 -0
- package/dist/agent/infra/file-system/path-validator.js +289 -0
- package/dist/agent/infra/file-system/pdf-extractor.d.ts +100 -0
- package/dist/agent/infra/file-system/pdf-extractor.js +226 -0
- package/dist/agent/infra/folder-pack/default-ignore.d.ts +11 -0
- package/dist/agent/infra/folder-pack/default-ignore.js +125 -0
- package/dist/agent/infra/folder-pack/folder-pack-service.d.ts +57 -0
- package/dist/agent/infra/folder-pack/folder-pack-service.js +372 -0
- package/dist/agent/infra/folder-pack/index.d.ts +3 -0
- package/dist/agent/infra/folder-pack/index.js +3 -0
- package/dist/agent/infra/folder-pack/output-generator.d.ts +17 -0
- package/dist/agent/infra/folder-pack/output-generator.js +156 -0
- package/dist/agent/infra/http/internal-llm-http-service.d.ts +133 -0
- package/dist/agent/infra/http/internal-llm-http-service.js +265 -0
- package/dist/agent/infra/llm/capability-cache.d.ts +87 -0
- package/dist/agent/infra/llm/capability-cache.js +125 -0
- package/dist/agent/infra/llm/context/compaction/compaction-service.d.ts +138 -0
- package/dist/agent/infra/llm/context/compression/enhanced-compaction.d.ts +112 -0
- package/dist/agent/infra/llm/context/compression/filter-compacted.d.ts +83 -0
- package/dist/agent/infra/llm/context/compression/middle-removal.d.ts +40 -0
- package/dist/agent/infra/llm/context/compression/middle-removal.js +75 -0
- package/dist/agent/infra/llm/context/compression/oldest-removal.d.ts +38 -0
- package/dist/agent/infra/llm/context/compression/oldest-removal.js +50 -0
- package/dist/agent/infra/llm/context/compression/reactive-overflow.d.ts +107 -0
- package/dist/agent/infra/llm/context/compression/reactive-overflow.js +272 -0
- package/dist/agent/infra/llm/context/compression/types.d.ts +36 -0
- package/dist/agent/infra/llm/context/context-manager.d.ts +332 -0
- package/dist/agent/infra/llm/context/context-manager.js +671 -0
- package/dist/agent/infra/llm/context/utils.d.ts +17 -0
- package/dist/agent/infra/llm/formatters/claude-formatter.d.ts +54 -0
- package/dist/agent/infra/llm/formatters/gemini-formatter.d.ts +82 -0
- package/dist/agent/infra/llm/formatters/openrouter-formatter.d.ts +47 -0
- package/dist/agent/infra/llm/formatters/openrouter-formatter.js +236 -0
- package/dist/agent/infra/llm/generators/byterover-content-generator.d.ts +91 -0
- package/dist/agent/infra/llm/generators/logging-content-generator.d.ts +88 -0
- package/dist/agent/infra/llm/generators/logging-content-generator.js +126 -0
- package/dist/agent/infra/llm/generators/openrouter-content-generator.d.ts +94 -0
- package/dist/agent/infra/llm/generators/retryable-content-generator.d.ts +90 -0
- package/dist/agent/infra/llm/generators/retryable-content-generator.js +154 -0
- package/dist/agent/infra/llm/index.d.ts +9 -0
- package/dist/agent/infra/llm/index.js +13 -0
- package/dist/agent/infra/llm/internal-llm-service.d.ts +362 -0
- package/dist/agent/infra/llm/internal-llm-service.js +1039 -0
- package/dist/agent/infra/llm/openrouter-llm-service.d.ts +215 -0
- package/dist/agent/infra/llm/openrouter-llm-service.js +572 -0
- package/dist/agent/infra/llm/response-validator.d.ts +89 -0
- package/dist/agent/infra/llm/sanitization/tool-sanitizer.d.ts +74 -0
- package/dist/agent/infra/llm/sanitization/tool-sanitizer.js +398 -0
- package/dist/agent/infra/llm/stream-processor.d.ts +178 -0
- package/dist/agent/infra/llm/thought-parser.js +217 -0
- package/dist/agent/infra/llm/tokenizers/claude-tokenizer.d.ts +40 -0
- package/dist/agent/infra/llm/tokenizers/claude-tokenizer.js +48 -0
- package/dist/agent/infra/llm/tokenizers/default-tokenizer.d.ts +31 -0
- package/dist/agent/infra/llm/tokenizers/gemini-tokenizer.d.ts +38 -0
- package/dist/agent/infra/llm/tokenizers/gemini-tokenizer.js +46 -0
- package/dist/agent/infra/llm/tokenizers/openrouter-tokenizer.d.ts +37 -0
- package/dist/agent/infra/llm/tokenizers/openrouter-tokenizer.js +49 -0
- package/dist/agent/infra/llm/tool-output-processor.d.ts +178 -0
- package/dist/agent/infra/llm/transformers/openrouter-stream-transformer.d.ts +49 -0
- package/dist/agent/infra/llm/transformers/openrouter-stream-transformer.js +270 -0
- package/dist/agent/infra/logger/console-logger.d.ts +42 -0
- package/dist/agent/infra/logger/event-based-logger.d.ts +54 -0
- package/dist/agent/infra/memory/index.d.ts +6 -0
- package/dist/agent/infra/memory/index.js +7 -0
- package/dist/agent/infra/memory/memory-manager.d.ts +136 -0
- package/dist/agent/infra/memory/memory-manager.js +523 -0
- package/dist/agent/infra/process/command-validator.d.ts +82 -0
- package/dist/agent/infra/process/process-service.d.ts +127 -0
- package/dist/agent/infra/process/process-service.js +528 -0
- package/dist/agent/infra/sandbox/curate-service.d.ts +33 -0
- package/dist/agent/infra/sandbox/curate-service.js +142 -0
- package/dist/agent/infra/sandbox/index.d.ts +2 -0
- package/dist/agent/infra/sandbox/index.js +2 -0
- package/dist/agent/infra/sandbox/local-sandbox.d.ts +45 -0
- package/dist/agent/infra/sandbox/local-sandbox.js +222 -0
- package/dist/agent/infra/sandbox/sandbox-service.d.ts +76 -0
- package/dist/agent/infra/sandbox/sandbox-service.js +118 -0
- package/dist/agent/infra/sandbox/tools-sdk.d.ts +157 -0
- package/dist/agent/infra/sandbox/tools-sdk.js +88 -0
- package/dist/agent/infra/session/chat-session.d.ts +141 -0
- package/dist/agent/infra/session/chat-session.js +372 -0
- package/dist/agent/infra/session/index.d.ts +7 -0
- package/dist/agent/infra/session/index.js +7 -0
- package/dist/agent/infra/session/session-manager.d.ts +210 -0
- package/dist/agent/infra/session/session-metadata-store.d.ts +52 -0
- package/dist/agent/infra/session/session-metadata-store.js +406 -0
- package/dist/agent/infra/session/session-status.d.ts +137 -0
- package/dist/agent/infra/storage/blob-history-storage.d.ts +76 -0
- package/dist/agent/infra/storage/dual-format-history-storage.d.ts +77 -0
- package/dist/agent/infra/storage/granular-history-storage.d.ts +65 -0
- package/dist/agent/infra/storage/message-storage-service.d.ts +171 -0
- package/dist/agent/infra/storage/message-storage-service.js +782 -0
- package/dist/agent/infra/storage/sqlite-key-storage.d.ts +105 -0
- package/dist/agent/infra/storage/sqlite-key-storage.js +404 -0
- package/dist/agent/infra/storage/tool-part-factory.d.ts +116 -0
- package/dist/agent/infra/system-prompt/contributors/agent-prompt-contributor.d.ts +59 -0
- package/dist/agent/infra/system-prompt/contributors/agent-prompt-contributor.js +131 -0
- package/dist/agent/infra/system-prompt/contributors/companion-contributor.d.ts +54 -0
- package/dist/agent/infra/system-prompt/contributors/companion-contributor.js +107 -0
- package/dist/agent/infra/system-prompt/contributors/context-tree-structure-contributor.d.ts +67 -0
- package/dist/agent/infra/system-prompt/contributors/context-tree-structure-contributor.js +220 -0
- package/dist/agent/infra/system-prompt/contributors/datetime-contributor.d.ts +25 -0
- package/dist/agent/infra/system-prompt/contributors/environment-contributor.d.ts +25 -0
- package/dist/agent/infra/system-prompt/contributors/file-contributor.d.ts +60 -0
- package/dist/agent/infra/system-prompt/contributors/file-contributor.js +128 -0
- package/dist/agent/infra/system-prompt/contributors/memory-contributor.d.ts +40 -0
- package/dist/agent/infra/system-prompt/contributors/static-contributor.d.ts +26 -0
- package/dist/agent/infra/system-prompt/schemas.d.ts +157 -0
- package/dist/agent/infra/system-prompt/system-prompt-manager.d.ts +136 -0
- package/dist/agent/infra/system-prompt/system-prompt-manager.js +307 -0
- package/dist/agent/infra/todos/todo-storage-service.d.ts +26 -0
- package/dist/agent/infra/tools/core-tool-scheduler.d.ts +99 -0
- package/dist/agent/infra/tools/core-tool-scheduler.js +158 -0
- package/dist/agent/infra/tools/default-policy-rules.d.ts +26 -0
- package/dist/agent/infra/tools/implementations/bash-exec-tool.d.ts +13 -0
- package/dist/agent/infra/tools/implementations/bash-exec-tool.js +110 -0
- package/dist/agent/infra/tools/implementations/bash-output-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/bash-output-tool.js +43 -0
- package/dist/agent/infra/tools/implementations/batch-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/batch-tool.js +142 -0
- package/dist/agent/infra/tools/implementations/code-exec-tool.d.ts +16 -0
- package/dist/agent/infra/tools/implementations/code-exec-tool.js +92 -0
- package/dist/agent/infra/tools/implementations/create-knowledge-topic-tool.d.ts +11 -0
- package/dist/agent/infra/tools/implementations/create-knowledge-topic-tool.js +149 -0
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +346 -0
- package/dist/agent/infra/tools/implementations/curate-tool.js +933 -0
- package/dist/agent/infra/tools/implementations/delete-memory-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/delete-memory-tool.js +37 -0
- package/dist/agent/infra/tools/implementations/edit-file-tool.d.ts +13 -0
- package/dist/agent/infra/tools/implementations/edit-file-tool.js +50 -0
- package/dist/agent/infra/tools/implementations/edit-memory-tool.d.ts +13 -0
- package/dist/agent/infra/tools/implementations/edit-memory-tool.js +53 -0
- package/dist/agent/infra/tools/implementations/glob-files-tool.d.ts +18 -0
- package/dist/agent/infra/tools/implementations/glob-files-tool.js +70 -0
- package/dist/agent/infra/tools/implementations/grep-content-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/grep-content-tool.js +77 -0
- package/dist/agent/infra/tools/implementations/kill-process-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/kill-process-tool.js +55 -0
- package/dist/agent/infra/tools/implementations/list-directory-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/list-directory-tool.js +52 -0
- package/dist/agent/infra/tools/implementations/list-memories-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/list-memories-tool.js +63 -0
- package/dist/agent/infra/tools/implementations/read-file-tool.d.ts +19 -0
- package/dist/agent/infra/tools/implementations/read-file-tool.js +96 -0
- package/dist/agent/infra/tools/implementations/read-memory-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/read-memory-tool.js +39 -0
- package/dist/agent/infra/tools/implementations/read-todos-tool.d.ts +11 -0
- package/dist/agent/infra/tools/implementations/read-todos-tool.js +39 -0
- package/dist/agent/infra/tools/implementations/search-history-tool.d.ts +10 -0
- package/dist/agent/infra/tools/implementations/search-history-tool.js +36 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-service.d.ts +40 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-service.js +302 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-tool.d.ts +20 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-tool.js +40 -0
- package/dist/agent/infra/tools/implementations/spec-analyze-tool.d.ts +7 -0
- package/dist/agent/infra/tools/implementations/spec-analyze-tool.js +78 -0
- package/dist/agent/infra/tools/implementations/write-file-tool.d.ts +12 -0
- package/dist/agent/infra/tools/implementations/write-file-tool.js +52 -0
- package/dist/agent/infra/tools/implementations/write-memory-tool.d.ts +13 -0
- package/dist/agent/infra/tools/implementations/write-memory-tool.js +52 -0
- package/dist/agent/infra/tools/implementations/write-todos-tool.d.ts +13 -0
- package/dist/agent/infra/tools/implementations/write-todos-tool.js +121 -0
- package/dist/agent/infra/tools/index.d.ts +19 -0
- package/dist/agent/infra/tools/index.js +20 -0
- package/dist/agent/infra/tools/plugins/logging-plugin.d.ts +28 -0
- package/dist/agent/infra/tools/plugins/plugin-manager.d.ts +81 -0
- package/dist/agent/infra/tools/plugins/plugin-manager.js +122 -0
- package/dist/agent/infra/tools/policy-engine.d.ts +80 -0
- package/dist/agent/infra/tools/streaming/metadata-handler.d.ts +31 -0
- package/dist/agent/infra/tools/tool-description-loader.js +108 -0
- package/dist/agent/infra/tools/tool-invocation.d.ts +216 -0
- package/dist/agent/infra/tools/tool-invocation.js +294 -0
- package/dist/agent/infra/tools/tool-manager.d.ts +178 -0
- package/dist/agent/infra/tools/tool-manager.js +328 -0
- package/dist/agent/infra/tools/tool-provider-getter.d.ts +6 -0
- package/dist/agent/infra/tools/tool-provider.d.ts +102 -0
- package/dist/agent/infra/tools/tool-provider.js +251 -0
- package/dist/agent/infra/tools/tool-registry.d.ts +74 -0
- package/dist/agent/infra/tools/tool-registry.js +221 -0
- package/dist/agent/infra/tools/utils/schema-converter.d.ts +10 -0
- package/dist/agent/infra/tools/utils/schema-converter.js +27 -0
- package/dist/agent/resources/prompts/system-prompt.yml +505 -0
- package/dist/agent/resources/tools/code_exec.txt +126 -0
- package/dist/oclif/commands/curate.d.ts +2 -1
- package/dist/oclif/commands/curate.js +19 -7
- package/dist/oclif/commands/hook-prompt-submit.d.ts +1 -1
- package/dist/oclif/commands/hook-prompt-submit.js +3 -3
- package/dist/oclif/commands/init.d.ts +1 -1
- package/dist/oclif/commands/init.js +18 -18
- package/dist/oclif/commands/login.js +12 -12
- package/dist/oclif/commands/main.js +24 -10
- package/dist/oclif/commands/mcp.js +2 -2
- package/dist/oclif/commands/pull.d.ts +1 -1
- package/dist/oclif/commands/pull.js +12 -12
- package/dist/oclif/commands/push.d.ts +1 -1
- package/dist/oclif/commands/push.js +12 -12
- package/dist/oclif/commands/query.d.ts +1 -1
- package/dist/oclif/commands/query.js +7 -7
- package/dist/oclif/commands/status.d.ts +1 -1
- package/dist/oclif/commands/status.js +9 -9
- package/dist/oclif/hooks/init/update-notifier.d.ts +1 -1
- package/dist/oclif/hooks/init/update-notifier.js +2 -2
- package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +1 -1
- package/dist/oclif/hooks/prerun/validate-brv-config-version.js +2 -2
- package/dist/server/config/auth.config.d.ts +32 -0
- package/dist/server/core/domain/entities/agent.js +106 -0
- package/dist/server/core/domain/entities/brv-config.d.ts +75 -0
- package/dist/server/core/domain/entities/brv-config.js +182 -0
- package/dist/server/core/domain/entities/space.d.ts +36 -0
- package/dist/server/core/domain/entities/space.js +76 -0
- package/dist/server/core/domain/entities/team.d.ts +44 -0
- package/dist/server/core/domain/entities/team.js +96 -0
- package/dist/server/core/domain/entities/user.d.ts +31 -0
- package/dist/server/core/domain/entities/user.js +52 -0
- package/dist/server/core/domain/knowledge/relation-parser.d.ts +94 -0
- package/dist/server/core/domain/knowledge/relation-parser.js +131 -0
- package/dist/server/core/domain/transport/schemas.d.ts +1252 -0
- package/dist/server/core/domain/transport/schemas.js +617 -0
- package/dist/server/core/interfaces/auth/i-auth-service.d.ts +35 -0
- package/dist/server/core/interfaces/auth/i-token-store.d.ts +22 -0
- package/dist/server/core/interfaces/connectors/connector-types.d.ts +83 -0
- package/dist/server/core/interfaces/connectors/i-connector-manager.d.ts +79 -0
- package/dist/server/core/interfaces/connectors/i-connector.d.ts +63 -0
- package/dist/server/core/interfaces/context-tree/i-context-file-reader.d.ts +35 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-snapshot-service.d.ts +36 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-writer-service.d.ts +32 -0
- package/dist/server/core/interfaces/executor/i-curate-executor.d.ts +36 -0
- package/dist/server/core/interfaces/executor/i-folder-pack-executor.d.ts +39 -0
- package/dist/server/core/interfaces/executor/i-query-executor.d.ts +32 -0
- package/dist/server/core/interfaces/executor/index.d.ts +3 -0
- package/dist/server/core/interfaces/executor/index.js +3 -0
- package/dist/server/core/interfaces/noop-implementations.d.ts +53 -0
- package/dist/server/core/interfaces/services/i-cogit-pull-service.d.ts +23 -0
- package/dist/server/core/interfaces/services/i-cogit-push-service.d.ts +27 -0
- package/dist/server/core/interfaces/services/i-http-client.d.ts +41 -0
- package/dist/server/core/interfaces/services/i-legacy-rule-detector.d.ts +56 -0
- package/dist/server/core/interfaces/services/i-memory-retrieval-service.d.ts +39 -0
- package/dist/server/core/interfaces/services/i-memory-storage-service.d.ts +53 -0
- package/dist/server/core/interfaces/services/i-rule-template-service.d.ts +15 -0
- package/dist/server/core/interfaces/services/i-space-service.d.ts +27 -0
- package/dist/server/core/interfaces/services/i-team-service.d.ts +28 -0
- package/dist/server/core/interfaces/services/i-tracking-service.d.ts +21 -0
- package/dist/server/core/interfaces/services/i-user-service.d.ts +26 -0
- package/dist/server/core/interfaces/services/i-workspace-detector-service.d.ts +8 -0
- package/dist/server/core/interfaces/storage/i-global-config-store.d.ts +34 -0
- package/dist/server/core/interfaces/storage/i-mcp-config-writer.d.ts +40 -0
- package/dist/server/core/interfaces/storage/i-project-config-store.d.ts +26 -0
- package/dist/server/core/interfaces/transport/index.d.ts +1 -0
- package/dist/server/core/interfaces/transport/index.js +2 -0
- package/dist/server/core/interfaces/usecase/i-curate-use-case.d.ts +14 -0
- package/dist/server/core/interfaces/usecase/i-push-use-case.js +1 -0
- package/dist/server/core/interfaces/usecase/i-query-use-case.js +1 -0
- package/dist/server/core/interfaces/usecase/i-reset-use-case.js +1 -0
- package/dist/server/core/interfaces/usecase/i-space-list-use-case.js +1 -0
- package/dist/server/core/interfaces/usecase/i-space-switch-use-case.js +1 -0
- package/dist/server/core/interfaces/usecase/i-status-use-case.js +1 -0
- package/dist/server/infra/auth/oauth-service.d.ts +64 -0
- package/dist/server/infra/auth/oidc-discovery-service.d.ts +51 -0
- package/dist/server/infra/browser/system-browser-launcher.d.ts +10 -0
- package/dist/server/infra/cogit/context-tree-to-push-context-mapper.d.ts +21 -0
- package/dist/server/infra/cogit/http-cogit-pull-service.d.ts +15 -0
- package/dist/server/infra/cogit/http-cogit-push-service.d.ts +17 -0
- package/dist/server/infra/config/file-config-store.d.ts +19 -0
- package/dist/server/infra/connectors/connector-manager.d.ts +33 -0
- package/dist/server/infra/connectors/connector-manager.js +206 -0
- package/dist/server/infra/connectors/hook/hook-connector.d.ts +46 -0
- package/dist/server/infra/connectors/hook/hook-connector.js +246 -0
- package/dist/server/infra/connectors/mcp/json-mcp-config-writer.d.ts +26 -0
- package/dist/server/infra/connectors/mcp/mcp-connector.d.ts +80 -0
- package/dist/server/infra/connectors/mcp/mcp-connector.js +339 -0
- package/dist/server/infra/connectors/mcp/toml-mcp-config-writer.d.ts +45 -0
- package/dist/server/infra/connectors/rules/legacy-rule-detector.d.ts +21 -0
- package/dist/server/infra/connectors/rules/rules-connector-config.d.ts +99 -0
- package/dist/server/infra/connectors/rules/rules-connector.d.ts +34 -0
- package/dist/server/infra/connectors/rules/rules-connector.js +155 -0
- package/dist/server/infra/connectors/shared/rule-file-manager.d.ts +72 -0
- package/dist/server/infra/connectors/shared/template-service.d.ts +27 -0
- package/dist/server/infra/connectors/skill/skill-connector.d.ts +39 -0
- package/dist/server/infra/connectors/skill/skill-connector.js +175 -0
- package/dist/server/infra/connectors/skill/skill-content-loader.d.ts +18 -0
- package/dist/server/infra/connectors/skill/skill-content-loader.js +33 -0
- package/dist/server/infra/context-tree/file-context-file-reader.d.ts +14 -0
- package/dist/server/infra/context-tree/file-context-tree-service.d.ts +14 -0
- package/dist/server/infra/context-tree/file-context-tree-snapshot-service.d.ts +34 -0
- package/dist/server/infra/context-tree/file-context-tree-writer-service.d.ts +28 -0
- package/dist/server/infra/context-tree/path-utils.d.ts +7 -0
- package/dist/server/infra/context-tree/path-utils.js +7 -0
- package/dist/server/infra/executor/curate-executor.d.ts +46 -0
- package/dist/server/infra/executor/curate-executor.js +132 -0
- package/dist/server/infra/executor/folder-pack-executor.d.ts +27 -0
- package/dist/server/infra/executor/folder-pack-executor.js +82 -0
- package/dist/server/infra/executor/index.d.ts +3 -0
- package/dist/server/infra/executor/index.js +3 -0
- package/dist/server/infra/executor/query-executor.d.ts +26 -0
- package/dist/server/infra/executor/query-executor.js +49 -0
- package/dist/server/infra/executor/task-processor.d.ts +89 -0
- package/dist/server/infra/executor/task-processor.js +133 -0
- package/dist/server/infra/file/fs-file-service.d.ts +44 -0
- package/dist/server/infra/http/authenticated-http-client.d.ts +74 -0
- package/dist/server/infra/http/authenticated-http-client.js +159 -0
- package/dist/server/infra/http/callback-handler.d.ts +13 -0
- package/dist/server/infra/mcp/mcp-server.js +179 -0
- package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +34 -0
- package/dist/server/infra/mcp/tools/brv-curate-tool.js +93 -0
- package/dist/server/infra/mcp/tools/brv-query-tool.d.ts +17 -0
- package/dist/server/infra/mcp/tools/brv-query-tool.js +62 -0
- package/dist/server/infra/mcp/tools/task-result-waiter.d.ts +30 -0
- package/dist/server/infra/memory/http-memory-retrieval-service.d.ts +18 -0
- package/dist/server/infra/memory/http-memory-storage-service.d.ts +18 -0
- package/dist/server/infra/process/agent-worker.js +1392 -0
- package/dist/server/infra/process/inline-agent-executor.d.ts +32 -0
- package/dist/server/infra/process/inline-agent-executor.js +267 -0
- package/dist/server/infra/process/process-manager.js +765 -0
- package/dist/server/infra/process/transport-handlers.js +472 -0
- package/dist/server/infra/space/http-space-service.d.ts +20 -0
- package/dist/server/infra/space/http-space-service.js +74 -0
- package/dist/server/infra/storage/file-global-config-store.d.ts +22 -0
- package/dist/server/infra/storage/file-onboarding-preference-store.d.ts +10 -0
- package/dist/server/infra/storage/file-token-store.d.ts +31 -0
- package/dist/server/infra/storage/keychain-token-store.d.ts +13 -0
- package/dist/server/infra/storage/token-store.d.ts +11 -0
- package/dist/server/infra/team/http-team-service.d.ts +21 -0
- package/dist/server/infra/template/fs-template-loader.d.ts +33 -0
- package/dist/server/infra/terminal/headless-terminal.d.ts +91 -0
- package/dist/server/infra/terminal/oclif-terminal.d.ts +19 -0
- package/dist/server/infra/terminal/repl-terminal.d.ts +31 -0
- package/dist/server/infra/tracking/mixpanel-tracking-service.d.ts +24 -0
- package/dist/server/infra/transport/index.d.ts +3 -0
- package/dist/server/infra/transport/index.js +6 -0
- package/dist/server/infra/transport/transport-factory.d.ts +17 -0
- package/dist/server/infra/transport/transport-factory.js +31 -0
- package/dist/server/infra/usecase/connectors-use-case.d.ts +63 -0
- package/dist/server/infra/usecase/connectors-use-case.js +234 -0
- package/dist/server/infra/usecase/curate-use-case.d.ts +59 -0
- package/dist/server/infra/usecase/curate-use-case.js +269 -0
- package/dist/server/infra/usecase/init-use-case.d.ts +126 -0
- package/dist/server/infra/usecase/login-use-case.d.ts +30 -0
- package/dist/server/infra/usecase/logout-use-case.d.ts +19 -0
- package/dist/server/infra/usecase/logout-use-case.js +48 -0
- package/dist/server/infra/usecase/pull-use-case.d.ts +49 -0
- package/dist/server/infra/usecase/pull-use-case.js +147 -0
- package/dist/server/infra/usecase/push-use-case.d.ts +50 -0
- package/dist/server/infra/usecase/push-use-case.js +191 -0
- package/dist/server/infra/usecase/query-use-case.d.ts +73 -0
- package/dist/server/infra/usecase/query-use-case.js +410 -0
- package/dist/server/infra/usecase/reset-use-case.d.ts +21 -0
- package/dist/server/infra/usecase/space-list-use-case.d.ts +27 -0
- package/dist/server/infra/usecase/space-switch-use-case.d.ts +26 -0
- package/dist/server/infra/usecase/space-switch-use-case.js +110 -0
- package/dist/server/infra/usecase/status-use-case.d.ts +75 -0
- package/dist/server/infra/usecase/status-use-case.js +268 -0
- package/dist/server/infra/user/http-user-service.d.ts +13 -0
- package/dist/server/infra/user/http-user-service.js +32 -0
- package/dist/server/infra/workspace/workspace-detector-service.d.ts +57 -0
- package/dist/server/templates/sections/brv-instructions.md +104 -0
- package/dist/server/utils/file-content-reader.d.ts +81 -0
- package/dist/server/utils/file-content-reader.js +180 -0
- package/dist/server/utils/file-validator.js +84 -0
- package/dist/server/utils/type-guards.d.ts +16 -0
- package/dist/tui/app.js +16 -13
- package/dist/tui/commands/arg-parser.d.ts +102 -0
- package/dist/tui/commands/arg-parser.js +186 -0
- package/dist/tui/commands/connectors-command.d.ts +8 -0
- package/dist/tui/commands/connectors-command.js +49 -0
- package/dist/tui/commands/curate-command.d.ts +9 -0
- package/dist/tui/commands/curate-command.js +80 -0
- package/dist/tui/commands/index.d.ts +8 -0
- package/dist/tui/commands/index.js +45 -0
- package/dist/tui/commands/init-command.d.ts +7 -0
- package/dist/tui/commands/init-command.js +87 -0
- package/dist/tui/commands/login-command.d.ts +7 -0
- package/dist/tui/commands/login-command.js +50 -0
- package/dist/tui/commands/logout-command.d.ts +5 -0
- package/dist/tui/commands/logout-command.js +46 -0
- package/dist/tui/commands/model-command.d.ts +13 -0
- package/dist/tui/commands/model-command.js +212 -0
- package/dist/tui/commands/new-command.d.ts +14 -0
- package/dist/tui/commands/new-command.js +61 -0
- package/dist/tui/commands/provider-command.d.ts +13 -0
- package/dist/tui/commands/provider-command.js +181 -0
- package/dist/tui/commands/pull-command.d.ts +5 -0
- package/dist/tui/commands/pull-command.js +61 -0
- package/dist/tui/commands/push-command.d.ts +5 -0
- package/dist/tui/commands/push-command.js +66 -0
- package/dist/tui/commands/query-command.d.ts +5 -0
- package/dist/tui/commands/query-command.js +63 -0
- package/dist/tui/commands/reset-command.d.ts +5 -0
- package/dist/tui/commands/reset-command.js +61 -0
- package/dist/tui/commands/space/index.d.ts +5 -0
- package/dist/tui/commands/space/index.js +14 -0
- package/dist/tui/commands/space/list-command.d.ts +5 -0
- package/dist/tui/commands/space/list-command.js +70 -0
- package/dist/tui/commands/space/switch-command.d.ts +5 -0
- package/dist/tui/commands/space/switch-command.js +35 -0
- package/dist/tui/commands/status-command.d.ts +5 -0
- package/dist/tui/commands/status-command.js +39 -0
- package/dist/tui/components/api-key-dialog.d.ts +1 -1
- package/dist/tui/components/command/command-output.d.ts +67 -0
- package/dist/tui/components/command/command-output.js +165 -0
- package/dist/tui/components/command/expanded-command-view.d.ts +21 -0
- package/dist/tui/components/command/expanded-command-view.js +78 -0
- package/dist/tui/components/command/index.d.ts +11 -0
- package/dist/tui/components/command/index.js +8 -0
- package/dist/tui/components/command/live-streaming-output.d.ts +19 -0
- package/dist/tui/components/command/live-streaming-output.js +34 -0
- package/dist/tui/components/command-details.d.ts +1 -0
- package/dist/tui/components/command-details.js +2 -2
- package/dist/tui/components/command-input.d.ts +6 -0
- package/dist/tui/components/command-input.js +282 -0
- package/dist/tui/components/command-item.d.ts +14 -0
- package/dist/tui/components/command-item.js +22 -0
- package/dist/tui/components/enter-prompt.js +3 -1
- package/dist/tui/components/execution/execution-input.d.ts +4 -0
- package/dist/tui/components/execution/execution-input.js +16 -4
- package/dist/tui/components/execution/execution-progress.js +13 -12
- 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/execution-tool.js +72 -0
- package/dist/tui/components/execution/expanded-log-view.js +2 -2
- package/dist/tui/components/execution/index.d.ts +0 -1
- package/dist/tui/components/execution/index.js +0 -1
- package/dist/tui/components/execution/log-item.d.ts +1 -1
- package/dist/tui/components/execution/log-item.js +2 -3
- package/dist/tui/components/footer.js +8 -9
- package/dist/tui/components/header.d.ts +0 -4
- package/dist/tui/components/header.js +5 -30
- package/dist/tui/components/index.d.ts +8 -1
- package/dist/tui/components/index.js +6 -1
- package/dist/tui/components/init.js +0 -6
- package/dist/tui/components/list.d.ts +16 -0
- package/dist/tui/components/list.js +24 -0
- package/dist/tui/components/logo.js +2 -2
- package/dist/tui/components/message-item.d.ts +4 -0
- package/dist/tui/components/message-item.js +14 -4
- package/dist/tui/components/message-list.d.ts +16 -0
- package/dist/tui/components/message-list.js +120 -0
- package/dist/tui/components/onboarding/index.d.ts +0 -1
- package/dist/tui/components/onboarding/index.js +0 -1
- package/dist/tui/components/onboarding/welcome-box.js +3 -2
- package/dist/tui/components/onboarding-item.d.ts +17 -0
- package/dist/tui/components/onboarding-item.js +30 -0
- package/dist/tui/components/provider-dialog.d.ts +1 -1
- package/dist/tui/components/provider-dialog.js +1 -1
- package/dist/tui/components/suggestions.js +21 -10
- package/dist/tui/contexts/auth-context.d.ts +8 -5
- package/dist/tui/contexts/auth-context.js +45 -13
- package/dist/tui/contexts/commands-context.d.ts +9 -1
- package/dist/tui/contexts/commands-context.js +16 -5
- package/dist/tui/contexts/index.d.ts +0 -1
- package/dist/tui/contexts/index.js +0 -1
- package/dist/tui/contexts/mode-context.d.ts +2 -2
- package/dist/tui/contexts/mode-context.js +3 -13
- package/dist/tui/contexts/onboarding-context.d.ts +18 -30
- package/dist/tui/contexts/onboarding-context.js +134 -129
- package/dist/tui/contexts/services-context.d.ts +8 -5
- package/dist/tui/contexts/services-context.js +9 -2
- package/dist/tui/contexts/tasks-context.d.ts +4 -2
- package/dist/tui/contexts/tasks-context.js +31 -11
- package/dist/tui/contexts/theme-context.d.ts +1 -0
- package/dist/tui/contexts/theme-context.js +1 -0
- package/dist/tui/contexts/transport-context.d.ts +1 -1
- package/dist/tui/contexts/transport-context.js +3 -4
- package/dist/tui/hooks/index.d.ts +2 -1
- package/dist/tui/hooks/index.js +1 -1
- package/dist/tui/hooks/use-activity-logs.js +71 -13
- package/dist/tui/hooks/use-auth-polling.d.ts +3 -3
- package/dist/tui/hooks/use-auth-polling.js +6 -6
- package/dist/tui/hooks/use-onboarding-logs.d.ts +17 -0
- package/dist/tui/hooks/use-onboarding-logs.js +26 -0
- package/dist/tui/hooks/use-slash-command-processor.js +4 -3
- package/dist/tui/hooks/use-slash-completion.js +3 -3
- package/dist/tui/providers/app-providers.d.ts +9 -7
- package/dist/tui/providers/app-providers.js +3 -3
- package/dist/tui/repl-startup.d.ts +24 -0
- package/dist/tui/repl-startup.js +33 -0
- package/dist/tui/types/commands.d.ts +4 -2
- package/dist/tui/types/messages.d.ts +6 -2
- package/dist/tui/utils/transport-client-helper.d.ts +9 -0
- package/dist/tui/utils/transport-client-helper.js +99 -0
- package/dist/tui/views/index.d.ts +0 -2
- package/dist/tui/views/index.js +0 -2
- package/dist/tui/views/init-view.js +14 -2
- package/dist/tui/views/login-view.js +1 -1
- package/dist/tui/views/main-view.d.ts +12 -0
- package/dist/tui/views/main-view.js +20 -0
- package/oclif.manifest.json +16 -2
- package/package.json +4 -2
- package/dist/config/auth.config.d.ts +0 -32
- package/dist/core/domain/cipher/agent/agent-registry.d.ts +0 -96
- package/dist/core/domain/cipher/agent/agent-registry.js +0 -254
- package/dist/core/domain/cipher/storage/history-types.d.ts +0 -38
- package/dist/core/domain/cipher/storage/message-storage-types.d.ts +0 -327
- package/dist/core/domain/cipher/streaming/types.d.ts +0 -119
- package/dist/core/domain/cipher/system-prompt/types.d.ts +0 -175
- package/dist/core/domain/cipher/tools/constants.d.ts +0 -33
- package/dist/core/domain/cipher/tools/constants.js +0 -29
- package/dist/core/domain/entities/agent.js +0 -106
- package/dist/core/domain/entities/brv-config.d.ts +0 -61
- package/dist/core/domain/entities/brv-config.js +0 -165
- package/dist/core/domain/entities/space.d.ts +0 -24
- package/dist/core/domain/entities/space.js +0 -52
- package/dist/core/domain/entities/team.d.ts +0 -42
- package/dist/core/domain/entities/team.js +0 -89
- package/dist/core/domain/entities/user.d.ts +0 -20
- package/dist/core/domain/entities/user.js +0 -32
- package/dist/core/domain/errors/connection-error.d.ts +0 -33
- package/dist/core/domain/errors/connection-error.js +0 -54
- package/dist/core/domain/knowledge/relation-parser.d.ts +0 -91
- package/dist/core/domain/knowledge/relation-parser.js +0 -126
- package/dist/core/domain/transport/schemas.d.ts +0 -1240
- package/dist/core/domain/transport/schemas.js +0 -611
- package/dist/core/interfaces/cipher/cipher-services.d.ts +0 -80
- package/dist/core/interfaces/cipher/i-blob-storage.d.ts +0 -84
- package/dist/core/interfaces/cipher/i-chat-session.d.ts +0 -107
- package/dist/core/interfaces/cipher/i-cipher-agent.d.ts +0 -125
- package/dist/core/interfaces/cipher/i-content-generator.d.ts +0 -148
- package/dist/core/interfaces/cipher/i-file-system.d.ts +0 -79
- package/dist/core/interfaces/cipher/i-history-storage.d.ts +0 -53
- package/dist/core/interfaces/cipher/i-llm-service.d.ts +0 -61
- package/dist/core/interfaces/cipher/i-process-service.d.ts +0 -65
- package/dist/core/interfaces/cipher/i-session-persistence.d.ts +0 -133
- package/dist/core/interfaces/cipher/i-system-prompt-contributor.d.ts +0 -25
- package/dist/core/interfaces/cipher/i-todo-storage.d.ts +0 -24
- package/dist/core/interfaces/cipher/i-tool-plugin.d.ts +0 -90
- package/dist/core/interfaces/cipher/i-tool-provider.d.ts +0 -65
- package/dist/core/interfaces/cipher/index.d.ts +0 -32
- package/dist/core/interfaces/connectors/connector-types.d.ts +0 -70
- package/dist/core/interfaces/connectors/i-connector-manager.d.ts +0 -72
- package/dist/core/interfaces/connectors/i-connector.d.ts +0 -54
- package/dist/core/interfaces/executor/i-curate-executor.d.ts +0 -36
- package/dist/core/interfaces/executor/i-query-executor.d.ts +0 -32
- package/dist/core/interfaces/executor/index.d.ts +0 -2
- package/dist/core/interfaces/executor/index.js +0 -2
- package/dist/core/interfaces/i-auth-service.d.ts +0 -35
- package/dist/core/interfaces/i-cogit-pull-service.d.ts +0 -23
- package/dist/core/interfaces/i-cogit-push-service.d.ts +0 -27
- package/dist/core/interfaces/i-context-file-reader.d.ts +0 -35
- package/dist/core/interfaces/i-context-tree-snapshot-service.d.ts +0 -36
- package/dist/core/interfaces/i-context-tree-writer-service.d.ts +0 -32
- package/dist/core/interfaces/i-global-config-store.d.ts +0 -34
- package/dist/core/interfaces/i-http-client.d.ts +0 -33
- package/dist/core/interfaces/i-legacy-rule-detector.d.ts +0 -56
- package/dist/core/interfaces/i-mcp-config-writer.d.ts +0 -40
- package/dist/core/interfaces/i-memory-retrieval-service.d.ts +0 -39
- package/dist/core/interfaces/i-memory-storage-service.d.ts +0 -53
- package/dist/core/interfaces/i-project-config-store.d.ts +0 -26
- package/dist/core/interfaces/i-rule-template-service.d.ts +0 -15
- package/dist/core/interfaces/i-space-service.d.ts +0 -27
- package/dist/core/interfaces/i-team-service.d.ts +0 -28
- package/dist/core/interfaces/i-token-store.d.ts +0 -22
- package/dist/core/interfaces/i-tracking-service.d.ts +0 -21
- package/dist/core/interfaces/i-user-service.d.ts +0 -13
- package/dist/core/interfaces/i-workspace-detector-service.d.ts +0 -8
- package/dist/core/interfaces/noop-implementations.d.ts +0 -53
- package/dist/core/interfaces/transport/i-transport-client.d.ts +0 -104
- package/dist/core/interfaces/transport/index.d.ts +0 -2
- package/dist/core/interfaces/transport/index.js +0 -2
- package/dist/core/interfaces/usecase/i-curate-use-case.d.ts +0 -12
- package/dist/infra/auth/oauth-service.d.ts +0 -64
- package/dist/infra/auth/oidc-discovery-service.d.ts +0 -51
- package/dist/infra/browser/system-browser-launcher.d.ts +0 -10
- package/dist/infra/cipher/agent/agent-error.d.ts +0 -54
- package/dist/infra/cipher/agent/agent-error.js +0 -79
- package/dist/infra/cipher/agent/agent-schemas.d.ts +0 -264
- package/dist/infra/cipher/agent/agent-state-manager.d.ts +0 -140
- package/dist/infra/cipher/agent/base-agent.d.ts +0 -118
- package/dist/infra/cipher/agent/cipher-agent.d.ts +0 -173
- package/dist/infra/cipher/agent/cipher-agent.js +0 -566
- package/dist/infra/cipher/agent/service-initializer.d.ts +0 -79
- package/dist/infra/cipher/agent/service-initializer.js +0 -284
- package/dist/infra/cipher/agent/types.d.ts +0 -35
- package/dist/infra/cipher/blob/blob-reference-resolver.d.ts +0 -107
- package/dist/infra/cipher/blob/blob-storage-factory.d.ts +0 -13
- package/dist/infra/cipher/blob/index.d.ts +0 -10
- package/dist/infra/cipher/blob/index.js +0 -12
- package/dist/infra/cipher/blob/migrations.d.ts +0 -63
- package/dist/infra/cipher/blob/sqlite-blob-storage.d.ts +0 -82
- package/dist/infra/cipher/blob/sqlite-blob-storage.js +0 -307
- package/dist/infra/cipher/display/todo-display.d.ts +0 -23
- package/dist/infra/cipher/events/event-emitter.d.ts +0 -137
- package/dist/infra/cipher/file-system/binary-utils.d.ts +0 -51
- package/dist/infra/cipher/file-system/binary-utils.js +0 -202
- package/dist/infra/cipher/file-system/file-system-service.d.ts +0 -134
- package/dist/infra/cipher/file-system/file-system-service.js +0 -1021
- package/dist/infra/cipher/file-system/path-validator.d.ts +0 -101
- package/dist/infra/cipher/file-system/path-validator.js +0 -289
- package/dist/infra/cipher/file-system/pdf-extractor.d.ts +0 -100
- package/dist/infra/cipher/file-system/pdf-extractor.js +0 -226
- package/dist/infra/cipher/http/internal-llm-http-service.d.ts +0 -133
- package/dist/infra/cipher/http/internal-llm-http-service.js +0 -265
- package/dist/infra/cipher/interactive-commands.d.ts +0 -16
- package/dist/infra/cipher/interactive-loop.d.ts +0 -24
- package/dist/infra/cipher/llm/capability-cache.d.ts +0 -87
- package/dist/infra/cipher/llm/capability-cache.js +0 -125
- package/dist/infra/cipher/llm/context/compaction/compaction-service.d.ts +0 -138
- package/dist/infra/cipher/llm/context/compression/enhanced-compaction.d.ts +0 -112
- package/dist/infra/cipher/llm/context/compression/filter-compacted.d.ts +0 -83
- package/dist/infra/cipher/llm/context/compression/middle-removal.d.ts +0 -40
- package/dist/infra/cipher/llm/context/compression/middle-removal.js +0 -76
- package/dist/infra/cipher/llm/context/compression/oldest-removal.d.ts +0 -38
- package/dist/infra/cipher/llm/context/compression/oldest-removal.js +0 -53
- package/dist/infra/cipher/llm/context/compression/reactive-overflow.d.ts +0 -107
- package/dist/infra/cipher/llm/context/compression/reactive-overflow.js +0 -272
- package/dist/infra/cipher/llm/context/compression/types.d.ts +0 -36
- package/dist/infra/cipher/llm/context/context-manager.d.ts +0 -332
- package/dist/infra/cipher/llm/context/context-manager.js +0 -671
- package/dist/infra/cipher/llm/context/utils.d.ts +0 -17
- package/dist/infra/cipher/llm/formatters/claude-formatter.d.ts +0 -54
- package/dist/infra/cipher/llm/formatters/gemini-formatter.d.ts +0 -82
- package/dist/infra/cipher/llm/formatters/openrouter-formatter.d.ts +0 -47
- package/dist/infra/cipher/llm/formatters/openrouter-formatter.js +0 -238
- package/dist/infra/cipher/llm/generators/byterover-content-generator.d.ts +0 -91
- package/dist/infra/cipher/llm/generators/logging-content-generator.d.ts +0 -104
- package/dist/infra/cipher/llm/generators/logging-content-generator.js +0 -182
- package/dist/infra/cipher/llm/generators/openrouter-content-generator.d.ts +0 -94
- package/dist/infra/cipher/llm/generators/retryable-content-generator.d.ts +0 -90
- package/dist/infra/cipher/llm/generators/retryable-content-generator.js +0 -157
- package/dist/infra/cipher/llm/index.d.ts +0 -9
- package/dist/infra/cipher/llm/index.js +0 -13
- package/dist/infra/cipher/llm/internal-llm-service.d.ts +0 -362
- package/dist/infra/cipher/llm/internal-llm-service.js +0 -1059
- package/dist/infra/cipher/llm/openrouter-llm-service.d.ts +0 -215
- package/dist/infra/cipher/llm/openrouter-llm-service.js +0 -572
- package/dist/infra/cipher/llm/response-validator.d.ts +0 -89
- package/dist/infra/cipher/llm/sanitization/tool-sanitizer.d.ts +0 -74
- package/dist/infra/cipher/llm/sanitization/tool-sanitizer.js +0 -398
- package/dist/infra/cipher/llm/stream-processor.d.ts +0 -178
- package/dist/infra/cipher/llm/thought-parser.js +0 -217
- package/dist/infra/cipher/llm/tokenizers/claude-tokenizer.d.ts +0 -40
- package/dist/infra/cipher/llm/tokenizers/claude-tokenizer.js +0 -48
- package/dist/infra/cipher/llm/tokenizers/default-tokenizer.d.ts +0 -31
- package/dist/infra/cipher/llm/tokenizers/gemini-tokenizer.d.ts +0 -38
- package/dist/infra/cipher/llm/tokenizers/gemini-tokenizer.js +0 -46
- package/dist/infra/cipher/llm/tokenizers/openrouter-tokenizer.d.ts +0 -37
- package/dist/infra/cipher/llm/tokenizers/openrouter-tokenizer.js +0 -49
- package/dist/infra/cipher/llm/tool-output-processor.d.ts +0 -178
- package/dist/infra/cipher/llm/transformers/openrouter-stream-transformer.d.ts +0 -49
- package/dist/infra/cipher/llm/transformers/openrouter-stream-transformer.js +0 -272
- package/dist/infra/cipher/logger/console-logger.d.ts +0 -42
- package/dist/infra/cipher/logger/event-based-logger.d.ts +0 -54
- package/dist/infra/cipher/memory/index.d.ts +0 -6
- package/dist/infra/cipher/memory/index.js +0 -7
- package/dist/infra/cipher/memory/memory-manager.d.ts +0 -136
- package/dist/infra/cipher/memory/memory-manager.js +0 -523
- package/dist/infra/cipher/process/command-validator.d.ts +0 -82
- package/dist/infra/cipher/process/process-service.d.ts +0 -127
- package/dist/infra/cipher/process/process-service.js +0 -528
- package/dist/infra/cipher/session/chat-session.d.ts +0 -141
- package/dist/infra/cipher/session/chat-session.js +0 -372
- package/dist/infra/cipher/session/index.d.ts +0 -7
- package/dist/infra/cipher/session/index.js +0 -7
- package/dist/infra/cipher/session/session-manager.d.ts +0 -210
- package/dist/infra/cipher/session/session-metadata-store.d.ts +0 -52
- package/dist/infra/cipher/session/session-metadata-store.js +0 -406
- package/dist/infra/cipher/session/session-status.d.ts +0 -137
- package/dist/infra/cipher/storage/blob-history-storage.d.ts +0 -76
- package/dist/infra/cipher/storage/dual-format-history-storage.d.ts +0 -77
- package/dist/infra/cipher/storage/granular-history-storage.d.ts +0 -65
- package/dist/infra/cipher/storage/message-storage-service.d.ts +0 -171
- package/dist/infra/cipher/storage/message-storage-service.js +0 -779
- package/dist/infra/cipher/storage/sqlite-key-storage.d.ts +0 -105
- package/dist/infra/cipher/storage/sqlite-key-storage.js +0 -404
- package/dist/infra/cipher/storage/tool-part-factory.d.ts +0 -116
- package/dist/infra/cipher/system-prompt/contributors/agent-prompt-contributor.d.ts +0 -59
- package/dist/infra/cipher/system-prompt/contributors/agent-prompt-contributor.js +0 -131
- package/dist/infra/cipher/system-prompt/contributors/companion-contributor.d.ts +0 -54
- package/dist/infra/cipher/system-prompt/contributors/companion-contributor.js +0 -107
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.d.ts +0 -67
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.js +0 -220
- package/dist/infra/cipher/system-prompt/contributors/datetime-contributor.d.ts +0 -25
- package/dist/infra/cipher/system-prompt/contributors/environment-contributor.d.ts +0 -25
- package/dist/infra/cipher/system-prompt/contributors/file-contributor.d.ts +0 -60
- package/dist/infra/cipher/system-prompt/contributors/file-contributor.js +0 -128
- package/dist/infra/cipher/system-prompt/contributors/memory-contributor.d.ts +0 -40
- package/dist/infra/cipher/system-prompt/contributors/static-contributor.d.ts +0 -26
- package/dist/infra/cipher/system-prompt/environment-context-builder.d.ts +0 -112
- package/dist/infra/cipher/system-prompt/environment-context-builder.js +0 -256
- package/dist/infra/cipher/system-prompt/schemas.d.ts +0 -151
- package/dist/infra/cipher/system-prompt/system-prompt-manager.d.ts +0 -136
- package/dist/infra/cipher/system-prompt/system-prompt-manager.js +0 -307
- package/dist/infra/cipher/todos/todo-storage-service.d.ts +0 -26
- package/dist/infra/cipher/tools/core-tool-scheduler.d.ts +0 -99
- package/dist/infra/cipher/tools/core-tool-scheduler.js +0 -165
- package/dist/infra/cipher/tools/default-policy-rules.d.ts +0 -26
- package/dist/infra/cipher/tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/infra/cipher/tools/implementations/bash-exec-tool.js +0 -110
- package/dist/infra/cipher/tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/bash-output-tool.js +0 -43
- package/dist/infra/cipher/tools/implementations/batch-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/batch-tool.js +0 -142
- package/dist/infra/cipher/tools/implementations/create-knowledge-topic-tool.d.ts +0 -11
- package/dist/infra/cipher/tools/implementations/create-knowledge-topic-tool.js +0 -149
- package/dist/infra/cipher/tools/implementations/curate-tool.d.ts +0 -3
- package/dist/infra/cipher/tools/implementations/curate-tool.js +0 -927
- package/dist/infra/cipher/tools/implementations/delete-memory-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/delete-memory-tool.js +0 -37
- package/dist/infra/cipher/tools/implementations/edit-file-tool.d.ts +0 -13
- package/dist/infra/cipher/tools/implementations/edit-file-tool.js +0 -50
- package/dist/infra/cipher/tools/implementations/edit-memory-tool.d.ts +0 -13
- package/dist/infra/cipher/tools/implementations/edit-memory-tool.js +0 -53
- package/dist/infra/cipher/tools/implementations/glob-files-tool.d.ts +0 -18
- package/dist/infra/cipher/tools/implementations/glob-files-tool.js +0 -70
- package/dist/infra/cipher/tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/grep-content-tool.js +0 -77
- package/dist/infra/cipher/tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/kill-process-tool.js +0 -55
- package/dist/infra/cipher/tools/implementations/list-directory-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/list-directory-tool.js +0 -52
- package/dist/infra/cipher/tools/implementations/list-memories-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/list-memories-tool.js +0 -63
- package/dist/infra/cipher/tools/implementations/read-file-tool.d.ts +0 -19
- package/dist/infra/cipher/tools/implementations/read-file-tool.js +0 -96
- package/dist/infra/cipher/tools/implementations/read-memory-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/read-memory-tool.js +0 -39
- package/dist/infra/cipher/tools/implementations/read-todos-tool.d.ts +0 -11
- package/dist/infra/cipher/tools/implementations/read-todos-tool.js +0 -39
- package/dist/infra/cipher/tools/implementations/search-history-tool.d.ts +0 -10
- package/dist/infra/cipher/tools/implementations/search-history-tool.js +0 -36
- package/dist/infra/cipher/tools/implementations/search-knowledge-tool.d.ts +0 -7
- package/dist/infra/cipher/tools/implementations/search-knowledge-tool.js +0 -303
- package/dist/infra/cipher/tools/implementations/spec-analyze-tool.d.ts +0 -7
- package/dist/infra/cipher/tools/implementations/spec-analyze-tool.js +0 -78
- package/dist/infra/cipher/tools/implementations/task-tool.d.ts +0 -34
- package/dist/infra/cipher/tools/implementations/task-tool.js +0 -254
- package/dist/infra/cipher/tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/infra/cipher/tools/implementations/write-file-tool.js +0 -52
- package/dist/infra/cipher/tools/implementations/write-memory-tool.d.ts +0 -13
- package/dist/infra/cipher/tools/implementations/write-memory-tool.js +0 -52
- package/dist/infra/cipher/tools/implementations/write-todos-tool.d.ts +0 -13
- package/dist/infra/cipher/tools/implementations/write-todos-tool.js +0 -121
- package/dist/infra/cipher/tools/index.d.ts +0 -19
- package/dist/infra/cipher/tools/index.js +0 -20
- package/dist/infra/cipher/tools/plugins/logging-plugin.d.ts +0 -28
- package/dist/infra/cipher/tools/plugins/plugin-manager.d.ts +0 -81
- package/dist/infra/cipher/tools/plugins/plugin-manager.js +0 -122
- package/dist/infra/cipher/tools/policy-engine.d.ts +0 -80
- package/dist/infra/cipher/tools/streaming/metadata-handler.d.ts +0 -31
- package/dist/infra/cipher/tools/tool-description-loader.js +0 -108
- package/dist/infra/cipher/tools/tool-invocation.d.ts +0 -216
- package/dist/infra/cipher/tools/tool-invocation.js +0 -294
- package/dist/infra/cipher/tools/tool-manager.d.ts +0 -175
- package/dist/infra/cipher/tools/tool-manager.js +0 -333
- package/dist/infra/cipher/tools/tool-provider-getter.d.ts +0 -6
- package/dist/infra/cipher/tools/tool-provider.d.ts +0 -102
- package/dist/infra/cipher/tools/tool-provider.js +0 -252
- package/dist/infra/cipher/tools/tool-registry.d.ts +0 -75
- package/dist/infra/cipher/tools/tool-registry.js +0 -200
- package/dist/infra/cipher/tools/utils/schema-converter.d.ts +0 -10
- package/dist/infra/cipher/tools/utils/schema-converter.js +0 -29
- package/dist/infra/cogit/context-tree-to-push-context-mapper.d.ts +0 -21
- package/dist/infra/cogit/http-cogit-pull-service.d.ts +0 -15
- package/dist/infra/cogit/http-cogit-push-service.d.ts +0 -17
- package/dist/infra/config/file-config-store.d.ts +0 -19
- package/dist/infra/connectors/connector-manager.d.ts +0 -32
- package/dist/infra/connectors/connector-manager.js +0 -160
- package/dist/infra/connectors/hook/hook-connector.d.ts +0 -46
- package/dist/infra/connectors/hook/hook-connector.js +0 -231
- package/dist/infra/connectors/mcp/json-mcp-config-writer.d.ts +0 -26
- package/dist/infra/connectors/mcp/mcp-connector.d.ts +0 -80
- package/dist/infra/connectors/mcp/mcp-connector.js +0 -324
- package/dist/infra/connectors/mcp/toml-mcp-config-writer.d.ts +0 -45
- package/dist/infra/connectors/rules/legacy-rule-detector.d.ts +0 -21
- package/dist/infra/connectors/rules/rules-connector-config.d.ts +0 -99
- package/dist/infra/connectors/rules/rules-connector.d.ts +0 -34
- package/dist/infra/connectors/rules/rules-connector.js +0 -139
- package/dist/infra/connectors/shared/rule-file-manager.d.ts +0 -72
- package/dist/infra/connectors/shared/template-service.d.ts +0 -27
- package/dist/infra/connectors/skill/skill-connector.d.ts +0 -39
- package/dist/infra/connectors/skill/skill-connector.js +0 -160
- package/dist/infra/connectors/skill/skill-content-loader.d.ts +0 -18
- package/dist/infra/connectors/skill/skill-content-loader.js +0 -33
- package/dist/infra/context-tree/file-context-file-reader.d.ts +0 -14
- package/dist/infra/context-tree/file-context-tree-service.d.ts +0 -14
- package/dist/infra/context-tree/file-context-tree-snapshot-service.d.ts +0 -34
- package/dist/infra/context-tree/file-context-tree-writer-service.d.ts +0 -28
- package/dist/infra/context-tree/path-utils.d.ts +0 -7
- package/dist/infra/context-tree/path-utils.js +0 -7
- package/dist/infra/core/executors/curate-executor.d.ts +0 -30
- package/dist/infra/core/executors/curate-executor.js +0 -88
- package/dist/infra/core/executors/index.d.ts +0 -2
- package/dist/infra/core/executors/index.js +0 -2
- package/dist/infra/core/executors/query-executor.d.ts +0 -29
- package/dist/infra/core/executors/query-executor.js +0 -87
- package/dist/infra/core/task-processor.d.ts +0 -83
- package/dist/infra/core/task-processor.js +0 -116
- package/dist/infra/file/fs-file-service.d.ts +0 -44
- package/dist/infra/http/authenticated-http-client.d.ts +0 -65
- package/dist/infra/http/authenticated-http-client.js +0 -138
- package/dist/infra/http/callback-handler.d.ts +0 -13
- package/dist/infra/mcp/mcp-server.js +0 -178
- package/dist/infra/mcp/tools/brv-curate-tool.d.ts +0 -29
- package/dist/infra/mcp/tools/brv-curate-tool.js +0 -73
- package/dist/infra/mcp/tools/brv-query-tool.d.ts +0 -17
- package/dist/infra/mcp/tools/brv-query-tool.js +0 -68
- package/dist/infra/mcp/tools/task-result-waiter.d.ts +0 -30
- package/dist/infra/memory/http-memory-retrieval-service.d.ts +0 -18
- package/dist/infra/memory/http-memory-storage-service.d.ts +0 -18
- package/dist/infra/process/agent-worker.js +0 -1354
- package/dist/infra/process/inline-agent-executor.d.ts +0 -32
- package/dist/infra/process/inline-agent-executor.js +0 -259
- package/dist/infra/process/process-manager.js +0 -755
- package/dist/infra/process/transport-handlers.js +0 -470
- package/dist/infra/repl/commands/arg-parser.d.ts +0 -97
- package/dist/infra/repl/commands/arg-parser.js +0 -129
- package/dist/infra/repl/commands/connectors-command.d.ts +0 -8
- package/dist/infra/repl/commands/connectors-command.js +0 -49
- package/dist/infra/repl/commands/curate-command.d.ts +0 -9
- package/dist/infra/repl/commands/curate-command.js +0 -83
- package/dist/infra/repl/commands/index.d.ts +0 -8
- package/dist/infra/repl/commands/index.js +0 -45
- package/dist/infra/repl/commands/init-command.d.ts +0 -7
- package/dist/infra/repl/commands/init-command.js +0 -87
- package/dist/infra/repl/commands/login-command.d.ts +0 -7
- package/dist/infra/repl/commands/login-command.js +0 -50
- package/dist/infra/repl/commands/logout-command.d.ts +0 -5
- package/dist/infra/repl/commands/logout-command.js +0 -48
- package/dist/infra/repl/commands/model-command.d.ts +0 -13
- package/dist/infra/repl/commands/model-command.js +0 -212
- package/dist/infra/repl/commands/new-command.d.ts +0 -14
- package/dist/infra/repl/commands/new-command.js +0 -61
- package/dist/infra/repl/commands/provider-command.d.ts +0 -13
- package/dist/infra/repl/commands/provider-command.js +0 -181
- package/dist/infra/repl/commands/pull-command.d.ts +0 -5
- package/dist/infra/repl/commands/pull-command.js +0 -61
- package/dist/infra/repl/commands/push-command.d.ts +0 -5
- package/dist/infra/repl/commands/push-command.js +0 -66
- package/dist/infra/repl/commands/query-command.d.ts +0 -5
- package/dist/infra/repl/commands/query-command.js +0 -83
- package/dist/infra/repl/commands/reset-command.d.ts +0 -5
- package/dist/infra/repl/commands/reset-command.js +0 -61
- package/dist/infra/repl/commands/space/index.d.ts +0 -5
- package/dist/infra/repl/commands/space/index.js +0 -14
- package/dist/infra/repl/commands/space/list-command.d.ts +0 -5
- package/dist/infra/repl/commands/space/list-command.js +0 -70
- package/dist/infra/repl/commands/space/switch-command.d.ts +0 -5
- package/dist/infra/repl/commands/space/switch-command.js +0 -35
- package/dist/infra/repl/commands/status-command.d.ts +0 -5
- package/dist/infra/repl/commands/status-command.js +0 -39
- package/dist/infra/repl/repl-startup.d.ts +0 -22
- package/dist/infra/repl/repl-startup.js +0 -33
- package/dist/infra/repl/transport-client-helper.d.ts +0 -9
- package/dist/infra/repl/transport-client-helper.js +0 -100
- package/dist/infra/space/http-space-service.d.ts +0 -20
- package/dist/infra/space/http-space-service.js +0 -68
- package/dist/infra/storage/file-global-config-store.d.ts +0 -22
- package/dist/infra/storage/file-onboarding-preference-store.d.ts +0 -10
- package/dist/infra/storage/file-token-store.d.ts +0 -31
- package/dist/infra/storage/keychain-token-store.d.ts +0 -13
- package/dist/infra/storage/token-store.d.ts +0 -11
- package/dist/infra/team/http-team-service.d.ts +0 -21
- package/dist/infra/template/fs-template-loader.d.ts +0 -33
- package/dist/infra/terminal/headless-terminal.d.ts +0 -91
- package/dist/infra/terminal/oclif-terminal.d.ts +0 -19
- package/dist/infra/terminal/repl-terminal.d.ts +0 -31
- package/dist/infra/tracking/mixpanel-tracking-service.d.ts +0 -24
- package/dist/infra/transport/index.d.ts +0 -4
- package/dist/infra/transport/index.js +0 -4
- package/dist/infra/transport/socket-io-transport-client.d.ts +0 -149
- package/dist/infra/transport/socket-io-transport-client.js +0 -677
- package/dist/infra/transport/transport-client-factory.d.ts +0 -76
- package/dist/infra/transport/transport-client-factory.js +0 -168
- package/dist/infra/transport/transport-factory.d.ts +0 -33
- package/dist/infra/transport/transport-factory.js +0 -59
- package/dist/infra/usecase/connectors-use-case.d.ts +0 -63
- package/dist/infra/usecase/connectors-use-case.js +0 -228
- package/dist/infra/usecase/curate-use-case.d.ts +0 -58
- package/dist/infra/usecase/curate-use-case.js +0 -264
- package/dist/infra/usecase/init-use-case.d.ts +0 -126
- package/dist/infra/usecase/login-use-case.d.ts +0 -30
- package/dist/infra/usecase/logout-use-case.d.ts +0 -22
- package/dist/infra/usecase/logout-use-case.js +0 -51
- package/dist/infra/usecase/pull-use-case.d.ts +0 -49
- package/dist/infra/usecase/pull-use-case.js +0 -147
- package/dist/infra/usecase/push-use-case.d.ts +0 -50
- package/dist/infra/usecase/push-use-case.js +0 -191
- package/dist/infra/usecase/query-use-case.d.ts +0 -72
- package/dist/infra/usecase/query-use-case.js +0 -411
- package/dist/infra/usecase/reset-use-case.d.ts +0 -21
- package/dist/infra/usecase/space-list-use-case.d.ts +0 -27
- package/dist/infra/usecase/space-switch-use-case.d.ts +0 -26
- package/dist/infra/usecase/space-switch-use-case.js +0 -110
- package/dist/infra/usecase/status-use-case.d.ts +0 -73
- package/dist/infra/usecase/status-use-case.js +0 -287
- package/dist/infra/user/http-user-service.d.ts +0 -12
- package/dist/infra/user/http-user-service.js +0 -22
- package/dist/infra/workspace/workspace-detector-service.d.ts +0 -57
- package/dist/resources/prompts/curate.yml +0 -238
- package/dist/resources/prompts/explore.yml +0 -112
- package/dist/resources/prompts/plan.yml +0 -120
- package/dist/resources/prompts/query-orchestrator.yml +0 -112
- package/dist/resources/prompts/system-prompt.yml +0 -99
- package/dist/resources/tools/task.txt +0 -23
- package/dist/templates/sections/brv-instructions.md +0 -98
- package/dist/tui/components/execution/expanded-message-view.d.ts +0 -24
- package/dist/tui/components/execution/expanded-message-view.js +0 -68
- package/dist/tui/components/onboarding/onboarding-flow.d.ts +0 -15
- package/dist/tui/components/onboarding/onboarding-flow.js +0 -103
- package/dist/tui/contexts/status-context.d.ts +0 -33
- package/dist/tui/contexts/status-context.js +0 -159
- package/dist/tui/hooks/use-tab-navigation.d.ts +0 -11
- package/dist/tui/hooks/use-tab-navigation.js +0 -42
- package/dist/tui/views/command-view.d.ts +0 -19
- package/dist/tui/views/command-view.js +0 -479
- package/dist/tui/views/logs-view.d.ts +0 -32
- package/dist/tui/views/logs-view.js +0 -90
- package/dist/utils/connection-error-handler.d.ts +0 -16
- package/dist/utils/connection-error-handler.js +0 -49
- package/dist/utils/file-validator.js +0 -84
- package/dist/utils/type-guards.d.ts +0 -16
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-info.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-info.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-state-machine.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-state-machine.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-state.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/agent-state.js +0 -0
- /package/dist/{infra/cipher → agent/core/domain/agent}/exit-codes.d.ts +0 -0
- /package/dist/{infra/cipher → agent/core/domain/agent}/exit-codes.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/index.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent/index.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent-events/index.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent-events/index.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent-events/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/agent-events/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/blob/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/blob/types.js +0 -0
- /package/dist/{core/domain/cipher/file-system → agent/core/domain/environment}/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/blob-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/blob-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/error-normalizer.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/error-normalizer.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/file-system-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/file-system-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/llm-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/llm-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/memory-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/memory-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/process-error-code.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/process-error-code.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/process-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/process-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/session-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/session-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/storage-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/storage-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/system-prompt-error-codes.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/system-prompt-error-codes.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/system-prompt-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/system-prompt-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/tool-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/errors/tool-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/file-system/types.d.ts +0 -0
- /package/dist/{core/domain/cipher/process → agent/core/domain/file-system}/types.js +0 -0
- /package/dist/{core/domain/cipher/session/types.js → agent/core/domain/folder-pack/index.js} +0 -0
- /package/dist/{core/domain/cipher/system-prompt → agent/core/domain/folder-pack}/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/error-codes.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/error-codes.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/index.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/index.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/registry.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/registry.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/schemas.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/schemas.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/llm/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/memory/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/memory/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/parsed-interaction.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/parsed-interaction.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/process/types.d.ts +0 -0
- /package/dist/{core/domain/cipher/tools → agent/core/domain/process}/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/queue/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/queue/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/session/session-metadata.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/session/session-metadata.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/session/types.d.ts +0 -0
- /package/dist/{infra/cipher/agent → agent/core/domain/session}/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/storage/history-types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/storage/message-storage-types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/streaming/types.js +0 -0
- /package/dist/{infra/cipher/llm/context/compression → agent/core/domain/system-prompt}/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/todos/index.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/todos/index.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/todos/types.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/todos/types.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/tools/tool-error.d.ts +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/tools/tool-error.js +0 -0
- /package/dist/{core/domain/cipher → agent/core/domain}/tools/types.d.ts +0 -0
- /package/dist/{core/interfaces/cipher/cipher-services.js → agent/core/domain/tools/types.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-blob-storage.js → agent/core/interfaces/cipher-services.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-chat-session.js → agent/core/interfaces/i-blob-storage.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-cipher-agent.js → agent/core/interfaces/i-chat-session.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-event-emitter.js → agent/core/interfaces/i-cipher-agent.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-content-generator.js +0 -0
- /package/dist/{core/interfaces/cipher/i-file-system.js → agent/core/interfaces/i-document-parser-service.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-event-emitter.d.ts +0 -0
- /package/dist/{core/interfaces/cipher/i-history-storage.js → agent/core/interfaces/i-event-emitter.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-key-storage.js → agent/core/interfaces/i-file-system.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-llm-provider.js → agent/core/interfaces/i-folder-pack-service.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-llm-service.js → agent/core/interfaces/i-history-storage.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-key-storage.d.ts +0 -0
- /package/dist/{core/interfaces/cipher/i-message-formatter.js → agent/core/interfaces/i-key-storage.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-llm-provider.d.ts +0 -0
- /package/dist/{core/interfaces/cipher/i-process-service.js → agent/core/interfaces/i-llm-provider.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-system-prompt-contributor.js → agent/core/interfaces/i-llm-service.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-logger.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-logger.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-message-formatter.d.ts +0 -0
- /package/dist/{core/interfaces/cipher/i-todo-storage.js → agent/core/interfaces/i-message-formatter.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-policy-engine.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-policy-engine.js +0 -0
- /package/dist/{core/interfaces/cipher/i-tokenizer.js → agent/core/interfaces/i-process-service.js} +0 -0
- /package/dist/{core/interfaces/cipher/i-tool-plugin.js → agent/core/interfaces/i-sandbox-service.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-session-persistence.js +0 -0
- /package/dist/{core/interfaces/cipher/i-tool-provider.js → agent/core/interfaces/i-system-prompt-contributor.js} +0 -0
- /package/dist/{core/interfaces/connectors/connector-types.js → agent/core/interfaces/i-todo-storage.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-tokenizer.d.ts +0 -0
- /package/dist/{core/interfaces/connectors/i-connector-manager.js → agent/core/interfaces/i-tokenizer.js} +0 -0
- /package/dist/{core/interfaces/connectors/i-connector.js → agent/core/interfaces/i-tool-plugin.js} +0 -0
- /package/dist/{core/interfaces/executor/i-curate-executor.js → agent/core/interfaces/i-tool-provider.js} +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-tool-scheduler.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/i-tool-scheduler.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/index.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/llm-types.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/llm-types.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-factory.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-factory.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-type-guards.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-type-guards.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-types.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/message-types.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/sanitization-types.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/sanitization-types.js +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/tokenizer-types.d.ts +0 -0
- /package/dist/{core/interfaces/cipher → agent/core/interfaces}/tokenizer-types.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/agent-error-codes.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/agent-error-codes.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/agent-schemas.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/agent-state-manager.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/base-agent.js +0 -0
- /package/dist/{infra/cipher → agent/infra/agent}/command-parser.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra/agent}/command-parser.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/agent/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra/agent}/interactive-commands.js +0 -0
- /package/dist/{infra/cipher → agent/infra/agent}/interactive-loop.js +0 -0
- /package/dist/{core/interfaces/executor/i-query-executor.js → agent/infra/agent/types.js} +0 -0
- /package/dist/{infra/cipher → agent/infra}/blob/blob-reference-resolver.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/blob/blob-reference-utils.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/blob/blob-reference-utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/blob/blob-storage-factory.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/blob/migrations.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/display/todo-display.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/events/event-emitter.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/context-tree-file-system-factory.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/context-tree-file-system-factory.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/gitignore-filter.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/gitignore-filter.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/glob-utils.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/file-system/glob-utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/async-mutex.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/async-mutex.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compaction/compaction-service.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compaction/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compaction/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compression/enhanced-compaction.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compression/filter-compacted.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compression/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/compression/index.js +0 -0
- /package/dist/{core/interfaces/i-auth-service.js → agent/infra/llm/context/compression/types.js} +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/loop-detector.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/loop-detector.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/rw-lock.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/rw-lock.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/context/utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/formatters/claude-formatter.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/formatters/gemini-formatter.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/generators/byterover-content-generator.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/generators/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/generators/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/generators/openrouter-content-generator.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/model-capabilities.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/model-capabilities.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/response-validator.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/retry-policy.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/retry-policy.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/retry-with-backoff.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/retry/retry-with-backoff.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/sanitization/base64-utils.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/sanitization/base64-utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/sanitization/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/sanitization/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/stream-processor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/thought-parser.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/tokenizers/default-tokenizer.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/tool-output-processor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/transformers/reasoning-extractor.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/llm/transformers/reasoning-extractor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/logger/console-logger.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/logger/event-based-logger.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/process/command-validator.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/process/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/process/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/process/path-utils.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/process/path-utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/message-queue.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/message-queue.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/session-event-forwarder.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/session-event-forwarder.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/session-manager.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/session-status.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/title-generator.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/session/title-generator.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/blob-history-storage.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/dual-format-history-storage.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/granular-history-storage.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/process-utils.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/process-utils.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/storage/tool-part-factory.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributor-schemas.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributor-schemas.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/datetime-contributor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/environment-contributor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/memory-contributor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/contributors/static-contributor.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/prompt-cache.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/prompt-cache.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/system-prompt/schemas.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/todos/todo-storage-service.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/default-policy-rules.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/plugins/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/plugins/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/plugins/logging-plugin.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/policy-engine.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/streaming/index.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/streaming/index.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/streaming/metadata-handler.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-description-loader.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-invocation-queue.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-invocation-queue.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-markers.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-markers.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/tools/tool-provider-getter.js +0 -0
- /package/dist/{infra/cipher → agent/infra}/validation/workspace-validator.d.ts +0 -0
- /package/dist/{infra/cipher → agent/infra}/validation/workspace-validator.js +0 -0
- /package/dist/{resources → agent/resources}/prompts/reflection.yml +0 -0
- /package/dist/{resources → agent/resources}/prompts/tool-outputs.yml +0 -0
- /package/dist/{resources → agent/resources}/tools/bash_exec.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/bash_output.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/batch.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/create_knowledge_topic.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/curate.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/delete_memory.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/detect_domains.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/edit_file.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/edit_memory.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/glob_files.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/grep_content.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/kill_process.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/list_directory.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/list_memories.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/read_file.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/read_memory.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/read_todos.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/search_history.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/search_knowledge.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/write_file.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/write_memory.txt +0 -0
- /package/dist/{resources → agent/resources}/tools/write_todos.txt +0 -0
- /package/dist/{config → server/config}/auth.config.js +0 -0
- /package/dist/{config → server/config}/environment.d.ts +0 -0
- /package/dist/{config → server/config}/environment.js +0 -0
- /package/dist/{constants.d.ts → server/constants.d.ts} +0 -0
- /package/dist/{constants.js → server/constants.js} +0 -0
- /package/dist/{core → server/core}/domain/entities/agent.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/auth-token.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/auth-token.js +0 -0
- /package/dist/{core → server/core}/domain/entities/bullet.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/bullet.js +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-push-context.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-push-context.js +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-push-response.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-push-response.js +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot-author.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot-author.js +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot-file.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot-file.js +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/cogit-snapshot.js +0 -0
- /package/dist/{core → server/core}/domain/entities/connector-type.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/connector-type.js +0 -0
- /package/dist/{core → server/core}/domain/entities/context-tree-index.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/context-tree-index.js +0 -0
- /package/dist/{core → server/core}/domain/entities/context-tree-snapshot.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/context-tree-snapshot.js +0 -0
- /package/dist/{core → server/core}/domain/entities/event.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/event.js +0 -0
- /package/dist/{core → server/core}/domain/entities/global-config.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/global-config.js +0 -0
- /package/dist/{core → server/core}/domain/entities/memory.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/memory.js +0 -0
- /package/dist/{core → server/core}/domain/entities/oauth-token-data.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/oauth-token-data.js +0 -0
- /package/dist/{core → server/core}/domain/entities/parser.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/parser.js +0 -0
- /package/dist/{core → server/core}/domain/entities/playbook.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/playbook.js +0 -0
- /package/dist/{core → server/core}/domain/entities/presigned-url.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/presigned-url.js +0 -0
- /package/dist/{core → server/core}/domain/entities/presigned-urls-response.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/presigned-urls-response.js +0 -0
- /package/dist/{core → server/core}/domain/entities/provider-config.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/provider-config.js +0 -0
- /package/dist/{core → server/core}/domain/entities/provider-registry.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/provider-registry.js +0 -0
- /package/dist/{core → server/core}/domain/entities/retrieve-result.d.ts +0 -0
- /package/dist/{core → server/core}/domain/entities/retrieve-result.js +0 -0
- /package/dist/{core → server/core}/domain/errors/ace-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/ace-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/auth-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/auth-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/brv-config-version-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/brv-config-version-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/core-process-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/core-process-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/discovery-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/discovery-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/headless-prompt-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/headless-prompt-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/task-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/task-error.js +0 -0
- /package/dist/{core → server/core}/domain/errors/transport-error.d.ts +0 -0
- /package/dist/{core → server/core}/domain/errors/transport-error.js +0 -0
- /package/dist/{core → server/core}/domain/instance/index.d.ts +0 -0
- /package/dist/{core → server/core}/domain/instance/index.js +0 -0
- /package/dist/{core → server/core}/domain/instance/types.d.ts +0 -0
- /package/dist/{core → server/core}/domain/instance/types.js +0 -0
- /package/dist/{core → server/core}/domain/knowledge/directory-manager.d.ts +0 -0
- /package/dist/{core → server/core}/domain/knowledge/directory-manager.js +0 -0
- /package/dist/{core → server/core}/domain/knowledge/markdown-writer.d.ts +0 -0
- /package/dist/{core → server/core}/domain/knowledge/markdown-writer.js +0 -0
- /package/dist/{core → server/core}/domain/transport/index.d.ts +0 -0
- /package/dist/{core → server/core}/domain/transport/index.js +0 -0
- /package/dist/{core → server/core}/domain/transport/types.d.ts +0 -0
- /package/dist/{core → server/core}/domain/transport/types.js +0 -0
- /package/dist/{core/interfaces/i-browser-launcher.js → server/core/interfaces/auth/i-auth-service.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/auth}/i-callback-handler.d.ts +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/auth}/i-callback-handler.js +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/auth}/i-oidc-discovery-service.d.ts +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/auth}/i-oidc-discovery-service.js +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/auth}/i-token-store.js +0 -0
- /package/dist/{core/interfaces/i-cogit-pull-service.js → server/core/interfaces/connectors/connector-types.js} +0 -0
- /package/dist/{core/interfaces/i-cogit-push-service.js → server/core/interfaces/connectors/i-connector-manager.js} +0 -0
- /package/dist/{core/interfaces/i-context-file-reader.js → server/core/interfaces/connectors/i-connector.js} +0 -0
- /package/dist/{core/interfaces/i-context-tree-service.js → server/core/interfaces/context-tree/i-context-file-reader.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/context-tree}/i-context-tree-service.d.ts +0 -0
- /package/dist/{core/interfaces/i-context-tree-snapshot-service.js → server/core/interfaces/context-tree/i-context-tree-service.js} +0 -0
- /package/dist/{core/interfaces/i-context-tree-writer-service.js → server/core/interfaces/context-tree/i-context-tree-snapshot-service.js} +0 -0
- /package/dist/{core/interfaces/i-file-service.js → server/core/interfaces/context-tree/i-context-tree-writer-service.js} +0 -0
- /package/dist/{core/interfaces/i-global-config-store.js → server/core/interfaces/executor/i-curate-executor.js} +0 -0
- /package/dist/{core/interfaces/i-http-client.js → server/core/interfaces/executor/i-folder-pack-executor.js} +0 -0
- /package/dist/{core/interfaces/i-legacy-rule-detector.js → server/core/interfaces/executor/i-query-executor.js} +0 -0
- /package/dist/{core → server/core}/interfaces/i-provider-config-store.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/i-provider-config-store.js +0 -0
- /package/dist/{core → server/core}/interfaces/i-provider-keychain-store.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/i-provider-keychain-store.js +0 -0
- /package/dist/{core → server/core}/interfaces/instance/i-instance-discovery.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/instance/i-instance-discovery.js +0 -0
- /package/dist/{core → server/core}/interfaces/instance/i-instance-manager.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/instance/i-instance-manager.js +0 -0
- /package/dist/{core → server/core}/interfaces/instance/index.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/instance/index.js +0 -0
- /package/dist/{core → server/core}/interfaces/noop-implementations.js +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/services}/i-browser-launcher.d.ts +0 -0
- /package/dist/{core/interfaces/i-mcp-config-writer.js → server/core/interfaces/services/i-browser-launcher.js} +0 -0
- /package/dist/{core/interfaces/i-memory-retrieval-service.js → server/core/interfaces/services/i-cogit-pull-service.js} +0 -0
- /package/dist/{core/interfaces/i-memory-storage-service.js → server/core/interfaces/services/i-cogit-push-service.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/services}/i-file-service.d.ts +0 -0
- /package/dist/{core/interfaces/i-onboarding-preference-store.js → server/core/interfaces/services/i-file-service.js} +0 -0
- /package/dist/{core/interfaces/i-project-config-store.js → server/core/interfaces/services/i-http-client.js} +0 -0
- /package/dist/{core/interfaces/i-rule-template-service.js → server/core/interfaces/services/i-legacy-rule-detector.js} +0 -0
- /package/dist/{core/interfaces/i-space-service.js → server/core/interfaces/services/i-memory-retrieval-service.js} +0 -0
- /package/dist/{core/interfaces/i-team-service.js → server/core/interfaces/services/i-memory-storage-service.js} +0 -0
- /package/dist/{core/interfaces/i-template-loader.js → server/core/interfaces/services/i-rule-template-service.js} +0 -0
- /package/dist/{core/interfaces/i-terminal.js → server/core/interfaces/services/i-space-service.js} +0 -0
- /package/dist/{core/interfaces/i-tracking-service.js → server/core/interfaces/services/i-team-service.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/services}/i-template-loader.d.ts +0 -0
- /package/dist/{core/interfaces/i-user-service.js → server/core/interfaces/services/i-template-loader.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/services}/i-terminal.d.ts +0 -0
- /package/dist/{core/interfaces/i-workspace-detector-service.js → server/core/interfaces/services/i-terminal.js} +0 -0
- /package/dist/{core/interfaces/transport/i-transport-client.js → server/core/interfaces/services/i-tracking-service.js} +0 -0
- /package/dist/{core/interfaces/transport/i-transport-server.js → server/core/interfaces/services/i-user-service.js} +0 -0
- /package/dist/{core/interfaces/usecase/i-connectors-use-case.js → server/core/interfaces/services/i-workspace-detector-service.js} +0 -0
- /package/dist/{core/interfaces/usecase/i-curate-use-case.js → server/core/interfaces/storage/i-global-config-store.js} +0 -0
- /package/dist/{core/interfaces/usecase/i-init-use-case.js → server/core/interfaces/storage/i-mcp-config-writer.js} +0 -0
- /package/dist/{core/interfaces → server/core/interfaces/storage}/i-onboarding-preference-store.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-login-use-case.js → server/core/interfaces/storage/i-onboarding-preference-store.js} +0 -0
- /package/dist/{core/interfaces/usecase/i-logout-use-case.js → server/core/interfaces/storage/i-project-config-store.js} +0 -0
- /package/dist/{core → server/core}/interfaces/transport/i-transport-server.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-pull-use-case.js → server/core/interfaces/transport/i-transport-server.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-connectors-use-case.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-push-use-case.js → server/core/interfaces/usecase/i-connectors-use-case.js} +0 -0
- /package/dist/{core/interfaces/usecase/i-query-use-case.js → server/core/interfaces/usecase/i-curate-use-case.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-init-use-case.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-reset-use-case.js → server/core/interfaces/usecase/i-init-use-case.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-login-use-case.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-space-list-use-case.js → server/core/interfaces/usecase/i-login-use-case.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-logout-use-case.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-space-switch-use-case.js → server/core/interfaces/usecase/i-logout-use-case.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-pull-use-case.d.ts +0 -0
- /package/dist/{core/interfaces/usecase/i-status-use-case.js → server/core/interfaces/usecase/i-pull-use-case.js} +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-push-use-case.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-query-use-case.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-reset-use-case.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-space-list-use-case.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-space-switch-use-case.d.ts +0 -0
- /package/dist/{core → server/core}/interfaces/usecase/i-status-use-case.d.ts +0 -0
- /package/dist/{infra → server/infra}/auth/oauth-service.js +0 -0
- /package/dist/{infra → server/infra}/auth/oidc-discovery-service.js +0 -0
- /package/dist/{infra → server/infra}/browser/system-browser-launcher.js +0 -0
- /package/dist/{infra → server/infra}/cogit/context-tree-to-push-context-mapper.js +0 -0
- /package/dist/{infra → server/infra}/cogit/http-cogit-pull-service.js +0 -0
- /package/dist/{infra → server/infra}/cogit/http-cogit-push-service.js +0 -0
- /package/dist/{infra → server/infra}/config/file-config-store.js +0 -0
- /package/dist/{infra → server/infra}/connectors/hook/hook-connector-config.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/hook/hook-connector-config.js +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/index.js +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/json-mcp-config-writer.js +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/mcp-connector-config.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/mcp-connector-config.js +0 -0
- /package/dist/{infra → server/infra}/connectors/mcp/toml-mcp-config-writer.js +0 -0
- /package/dist/{infra → server/infra}/connectors/rules/legacy-rule-detector.js +0 -0
- /package/dist/{infra → server/infra}/connectors/rules/rules-connector-config.js +0 -0
- /package/dist/{infra → server/infra}/connectors/shared/constants.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/shared/constants.js +0 -0
- /package/dist/{infra → server/infra}/connectors/shared/rule-file-manager.js +0 -0
- /package/dist/{infra → server/infra}/connectors/shared/template-service.js +0 -0
- /package/dist/{infra → server/infra}/connectors/skill/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/skill/index.js +0 -0
- /package/dist/{infra → server/infra}/connectors/skill/skill-connector-config.d.ts +0 -0
- /package/dist/{infra → server/infra}/connectors/skill/skill-connector-config.js +0 -0
- /package/dist/{infra → server/infra}/context-tree/file-context-file-reader.js +0 -0
- /package/dist/{infra → server/infra}/context-tree/file-context-tree-service.js +0 -0
- /package/dist/{infra → server/infra}/context-tree/file-context-tree-snapshot-service.js +0 -0
- /package/dist/{infra → server/infra}/context-tree/file-context-tree-writer-service.js +0 -0
- /package/dist/{infra → server/infra}/file/fs-file-service.js +0 -0
- /package/dist/{infra → server/infra}/http/callback-handler.js +0 -0
- /package/dist/{infra → server/infra}/http/callback-server.d.ts +0 -0
- /package/dist/{infra → server/infra}/http/callback-server.js +0 -0
- /package/dist/{infra → server/infra}/http/openrouter-api-client.d.ts +0 -0
- /package/dist/{infra → server/infra}/http/openrouter-api-client.js +0 -0
- /package/dist/{infra → server/infra}/instance/file-instance-discovery.d.ts +0 -0
- /package/dist/{infra → server/infra}/instance/file-instance-discovery.js +0 -0
- /package/dist/{infra → server/infra}/instance/file-instance-manager.d.ts +0 -0
- /package/dist/{infra → server/infra}/instance/file-instance-manager.js +0 -0
- /package/dist/{infra → server/infra}/instance/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/instance/index.js +0 -0
- /package/dist/{infra → server/infra}/instance/process-utils.d.ts +0 -0
- /package/dist/{infra → server/infra}/instance/process-utils.js +0 -0
- /package/dist/{infra → server/infra}/mcp/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/mcp/index.js +0 -0
- /package/dist/{infra → server/infra}/mcp/mcp-server.d.ts +0 -0
- /package/dist/{infra → server/infra}/mcp/tools/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/mcp/tools/index.js +0 -0
- /package/dist/{infra → server/infra}/mcp/tools/task-result-waiter.js +0 -0
- /package/dist/{infra → server/infra}/memory/http-memory-retrieval-service.js +0 -0
- /package/dist/{infra → server/infra}/memory/http-memory-storage-service.js +0 -0
- /package/dist/{infra → server/infra}/memory/memory-to-playbook-mapper.d.ts +0 -0
- /package/dist/{infra → server/infra}/memory/memory-to-playbook-mapper.js +0 -0
- /package/dist/{infra → server/infra}/process/agent-worker.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/index.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/index.js +0 -0
- /package/dist/{infra → server/infra}/process/ipc-types.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/ipc-types.js +0 -0
- /package/dist/{infra → server/infra}/process/parent-heartbeat.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/parent-heartbeat.js +0 -0
- /package/dist/{infra → server/infra}/process/process-manager.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/task-queue-manager.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/task-queue-manager.js +0 -0
- /package/dist/{infra → server/infra}/process/transport-handlers.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/transport-worker.d.ts +0 -0
- /package/dist/{infra → server/infra}/process/transport-worker.js +0 -0
- /package/dist/{infra → server/infra}/storage/file-global-config-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/file-onboarding-preference-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/file-provider-config-store.d.ts +0 -0
- /package/dist/{infra → server/infra}/storage/file-provider-config-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/file-token-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/keychain-token-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/provider-keychain-store.d.ts +0 -0
- /package/dist/{infra → server/infra}/storage/provider-keychain-store.js +0 -0
- /package/dist/{infra → server/infra}/storage/token-store.js +0 -0
- /package/dist/{infra → server/infra}/team/http-team-service.js +0 -0
- /package/dist/{infra → server/infra}/template/fs-template-loader.js +0 -0
- /package/dist/{infra → server/infra}/terminal/headless-terminal.js +0 -0
- /package/dist/{infra → server/infra}/terminal/oclif-terminal.js +0 -0
- /package/dist/{infra → server/infra}/terminal/repl-terminal.js +0 -0
- /package/dist/{infra → server/infra}/tracking/mixpanel-tracking-service.js +0 -0
- /package/dist/{infra → server/infra}/transport/port-utils.d.ts +0 -0
- /package/dist/{infra → server/infra}/transport/port-utils.js +0 -0
- /package/dist/{infra → server/infra}/transport/socket-io-transport-server.d.ts +0 -0
- /package/dist/{infra → server/infra}/transport/socket-io-transport-server.js +0 -0
- /package/dist/{infra → server/infra}/usecase/init-use-case.js +0 -0
- /package/dist/{infra → server/infra}/usecase/login-use-case.js +0 -0
- /package/dist/{infra → server/infra}/usecase/reset-use-case.js +0 -0
- /package/dist/{infra → server/infra}/usecase/space-list-use-case.js +0 -0
- /package/dist/{infra → server/infra}/workspace/workspace-detector-service.js +0 -0
- /package/dist/{templates → server/templates}/README.md +0 -0
- /package/dist/{templates → server/templates}/base.md +0 -0
- /package/dist/{templates → server/templates}/mcp-base.md +0 -0
- /package/dist/{templates → server/templates}/sections/command-reference.md +0 -0
- /package/dist/{templates → server/templates}/sections/mcp-workflow.md +0 -0
- /package/dist/{templates → server/templates}/sections/workflow.md +0 -0
- /package/dist/{templates → server/templates}/skill/SKILL.md +0 -0
- /package/dist/{templates → server/templates}/skill/TROUBLESHOOTING.md +0 -0
- /package/dist/{templates → server/templates}/skill/WORKFLOWS.md +0 -0
- /package/dist/{utils → server/utils}/crash-log.d.ts +0 -0
- /package/dist/{utils → server/utils}/crash-log.js +0 -0
- /package/dist/{utils → server/utils}/emoji-helpers.d.ts +0 -0
- /package/dist/{utils → server/utils}/emoji-helpers.js +0 -0
- /package/dist/{utils → server/utils}/environment-detector.d.ts +0 -0
- /package/dist/{utils → server/utils}/environment-detector.js +0 -0
- /package/dist/{utils → server/utils}/error-handler.d.ts +0 -0
- /package/dist/{utils → server/utils}/error-handler.js +0 -0
- /package/dist/{utils → server/utils}/error-helpers.d.ts +0 -0
- /package/dist/{utils → server/utils}/error-helpers.js +0 -0
- /package/dist/{utils → server/utils}/file-helpers.d.ts +0 -0
- /package/dist/{utils → server/utils}/file-helpers.js +0 -0
- /package/dist/{utils → server/utils}/file-validator.d.ts +0 -0
- /package/dist/{utils → server/utils}/global-config-path.d.ts +0 -0
- /package/dist/{utils → server/utils}/global-config-path.js +0 -0
- /package/dist/{utils → server/utils}/global-data-path.d.ts +0 -0
- /package/dist/{utils → server/utils}/global-data-path.js +0 -0
- /package/dist/{utils → server/utils}/global-logs-path.d.ts +0 -0
- /package/dist/{utils → server/utils}/global-logs-path.js +0 -0
- /package/dist/{utils → server/utils}/oclif-error-helpers.d.ts +0 -0
- /package/dist/{utils → server/utils}/oclif-error-helpers.js +0 -0
- /package/dist/{utils → server/utils}/process-logger.d.ts +0 -0
- /package/dist/{utils → server/utils}/process-logger.js +0 -0
- /package/dist/{utils → server/utils}/sandbox-detector.d.ts +0 -0
- /package/dist/{utils → server/utils}/sandbox-detector.js +0 -0
- /package/dist/{utils → server/utils}/tool-display-formatter.d.ts +0 -0
- /package/dist/{utils → server/utils}/tool-display-formatter.js +0 -0
- /package/dist/{utils → server/utils}/type-guards.js +0 -0
|
@@ -0,0 +1,1021 @@
|
|
|
1
|
+
import { glob } from 'glob';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import { EOL } from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { getErrorMessage } from '../../../server/utils/error-helpers.js';
|
|
7
|
+
import { DirectoryNotFoundError, EditOperationError, FileNotFoundError, FileTooLargeError, GlobOperationError, InvalidExtensionError, InvalidPathError, InvalidPatternError, PathBlockedError, PathNotAllowedError, PathTraversalError, PdfExtractionError, ReadOperationError, SearchOperationError, ServiceNotInitializedError, StringNotFoundError, StringNotUniqueError, WriteOperationError, } from '../../core/domain/errors/file-system-error.js';
|
|
8
|
+
import { getMimeType, isBinaryFile, isImageFile, isPdfFile, shouldReturnAsAttachment } from './binary-utils.js';
|
|
9
|
+
import { createGitignoreFilter } from './gitignore-filter.js';
|
|
10
|
+
import { collectFileMetadata, escapeIfExactMatch, extractPaths, sortFilesByRecency } from './glob-utils.js';
|
|
11
|
+
import { PathValidator } from './path-validator.js';
|
|
12
|
+
import { formatPdfContent, PdfExtractor } from './pdf-extractor.js';
|
|
13
|
+
/**
|
|
14
|
+
* Maximum line length for search results.
|
|
15
|
+
* Prevents context overflow from minified files or long lines.
|
|
16
|
+
*/
|
|
17
|
+
const MAX_LINE_LENGTH = 2000;
|
|
18
|
+
/**
|
|
19
|
+
* Default number of lines to read when no limit specified.
|
|
20
|
+
* Prevents context overflow while providing enough content.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_READ_LIMIT = 2000;
|
|
23
|
+
/**
|
|
24
|
+
* Number of lines to include in the preview.
|
|
25
|
+
*/
|
|
26
|
+
const PREVIEW_LINES = 20;
|
|
27
|
+
/**
|
|
28
|
+
* Buffer size for binary file detection (4KB sample).
|
|
29
|
+
*/
|
|
30
|
+
const BINARY_DETECTION_BUFFER_SIZE = 4096;
|
|
31
|
+
/**
|
|
32
|
+
* Whitelist of .env file patterns that are safe to read.
|
|
33
|
+
* These are typically example/template files without real secrets.
|
|
34
|
+
*/
|
|
35
|
+
const ENV_WHITELIST = ['.env.sample', '.env.example', '.env.template', '.env.defaults'];
|
|
36
|
+
/**
|
|
37
|
+
* Truncates a line to MAX_LINE_LENGTH, adding ellipsis if truncated.
|
|
38
|
+
*/
|
|
39
|
+
function truncateLine(line) {
|
|
40
|
+
if (line.length <= MAX_LINE_LENGTH) {
|
|
41
|
+
return line;
|
|
42
|
+
}
|
|
43
|
+
return line.slice(0, MAX_LINE_LENGTH) + '...';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Formats content with line numbers in 00001| format.
|
|
47
|
+
* @param lines - Array of lines to format
|
|
48
|
+
* @param startLine - Starting line number (1-based)
|
|
49
|
+
* @returns Formatted string with line numbers
|
|
50
|
+
*/
|
|
51
|
+
function formatWithLineNumbers(lines, startLine) {
|
|
52
|
+
return lines
|
|
53
|
+
.map((line, index) => {
|
|
54
|
+
const lineNum = (startLine + index).toString().padStart(5, '0');
|
|
55
|
+
return `${lineNum}| ${line}`;
|
|
56
|
+
})
|
|
57
|
+
.join('\n');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Finds similar files in a directory for "Did you mean?" suggestions.
|
|
61
|
+
* @param dirPath - Directory to search in
|
|
62
|
+
* @param fileName - File name to find similar matches for
|
|
63
|
+
* @returns Array of suggested file paths (max 3)
|
|
64
|
+
*/
|
|
65
|
+
async function findSimilarFiles(dirPath, fileName) {
|
|
66
|
+
try {
|
|
67
|
+
const entries = await fs.readdir(dirPath);
|
|
68
|
+
const lowerFileName = fileName.toLowerCase();
|
|
69
|
+
const suggestions = entries
|
|
70
|
+
.filter((entry) => {
|
|
71
|
+
const lowerEntry = entry.toLowerCase();
|
|
72
|
+
return lowerEntry.includes(lowerFileName) || lowerFileName.includes(lowerEntry);
|
|
73
|
+
})
|
|
74
|
+
.slice(0, 3)
|
|
75
|
+
.map((entry) => path.join(dirPath, entry));
|
|
76
|
+
return suggestions;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Default patterns to ignore when listing directories.
|
|
84
|
+
* Common build artifacts, caches, and IDE directories.
|
|
85
|
+
*/
|
|
86
|
+
const DEFAULT_IGNORE_PATTERNS = [
|
|
87
|
+
'node_modules/',
|
|
88
|
+
'__pycache__/',
|
|
89
|
+
'.git/',
|
|
90
|
+
'dist/',
|
|
91
|
+
'build/',
|
|
92
|
+
'target/',
|
|
93
|
+
'vendor/',
|
|
94
|
+
'bin/',
|
|
95
|
+
'obj/',
|
|
96
|
+
'.idea/',
|
|
97
|
+
'.vscode/',
|
|
98
|
+
'.zig-cache/',
|
|
99
|
+
'zig-out/',
|
|
100
|
+
'.coverage/',
|
|
101
|
+
'coverage/',
|
|
102
|
+
'tmp/',
|
|
103
|
+
'temp/',
|
|
104
|
+
'.cache/',
|
|
105
|
+
'cache/',
|
|
106
|
+
'logs/',
|
|
107
|
+
'.venv/',
|
|
108
|
+
'venv/',
|
|
109
|
+
'env/',
|
|
110
|
+
'.byterover/',
|
|
111
|
+
];
|
|
112
|
+
/**
|
|
113
|
+
* Maximum number of files for directory listing.
|
|
114
|
+
*/
|
|
115
|
+
const LIST_DIRECTORY_LIMIT = 100;
|
|
116
|
+
/**
|
|
117
|
+
* File system service implementation.
|
|
118
|
+
* Provides secure, validated file system operations with comprehensive
|
|
119
|
+
* path validation, size limits, and allow/block list enforcement.
|
|
120
|
+
*/
|
|
121
|
+
export class FileSystemService {
|
|
122
|
+
/**
|
|
123
|
+
* Maximum line length before truncation (2000 characters).
|
|
124
|
+
*/
|
|
125
|
+
static MAX_LINE_LENGTH = 2000;
|
|
126
|
+
config;
|
|
127
|
+
initialized = false;
|
|
128
|
+
pathValidator;
|
|
129
|
+
/**
|
|
130
|
+
* Creates a new file system service
|
|
131
|
+
* @param config - File system configuration (optional, uses defaults)
|
|
132
|
+
*/
|
|
133
|
+
constructor(config = {}) {
|
|
134
|
+
// Merge with defaults
|
|
135
|
+
this.config = {
|
|
136
|
+
allowedPaths: config.allowedPaths ?? ['.'],
|
|
137
|
+
blockedExtensions: config.blockedExtensions ?? ['.exe', '.dll', '.so', '.dylib'],
|
|
138
|
+
blockedPaths: config.blockedPaths ?? ['.git', 'node_modules/.bin', '.env', '.byterover'],
|
|
139
|
+
maxFileSize: config.maxFileSize ?? 10 * 1024 * 1024, // 10MB
|
|
140
|
+
workingDirectory: config.workingDirectory ?? process.cwd(),
|
|
141
|
+
};
|
|
142
|
+
this.pathValidator = new PathValidator(this.config);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Edit a file by replacing strings.
|
|
146
|
+
*/
|
|
147
|
+
async editFile(filePath, operation, options = {}) {
|
|
148
|
+
this.ensureInitialized();
|
|
149
|
+
// Validate path
|
|
150
|
+
const validation = this.pathValidator.validate(filePath, 'read');
|
|
151
|
+
if (!validation.valid) {
|
|
152
|
+
this.throwValidationError(filePath, validation.error);
|
|
153
|
+
}
|
|
154
|
+
const { normalizedPath } = validation;
|
|
155
|
+
try {
|
|
156
|
+
// Read current content
|
|
157
|
+
const fileContent = await this.readFile(filePath, options);
|
|
158
|
+
let { content } = fileContent;
|
|
159
|
+
// Escape regex special characters for literal string matching
|
|
160
|
+
const escapedOldString = operation.oldString.replaceAll(/[$()*+.?[\u005C\]^{|}]/g, String.raw `\$&`);
|
|
161
|
+
// Count occurrences
|
|
162
|
+
const occurrences = (content.match(new RegExp(escapedOldString, 'g')) || []).length;
|
|
163
|
+
// Check if string exists
|
|
164
|
+
if (occurrences === 0) {
|
|
165
|
+
throw new StringNotFoundError(normalizedPath, operation.oldString);
|
|
166
|
+
}
|
|
167
|
+
// Check if string is unique (if replaceAll is false)
|
|
168
|
+
if (!operation.replaceAll && occurrences > 1) {
|
|
169
|
+
throw new StringNotUniqueError(normalizedPath, operation.oldString, occurrences);
|
|
170
|
+
}
|
|
171
|
+
// Perform replacement
|
|
172
|
+
content = operation.replaceAll
|
|
173
|
+
? content.replaceAll(operation.oldString, operation.newString)
|
|
174
|
+
: content.replace(operation.oldString, operation.newString);
|
|
175
|
+
// Write back
|
|
176
|
+
const writeResult = await this.writeFile(filePath, content, options);
|
|
177
|
+
return {
|
|
178
|
+
bytesWritten: writeResult.bytesWritten,
|
|
179
|
+
path: normalizedPath,
|
|
180
|
+
replacements: operation.replaceAll ? occurrences : 1,
|
|
181
|
+
success: true,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
// Re-throw known errors
|
|
186
|
+
if (error instanceof FileNotFoundError ||
|
|
187
|
+
error instanceof StringNotFoundError ||
|
|
188
|
+
error instanceof StringNotUniqueError ||
|
|
189
|
+
error instanceof PathNotAllowedError ||
|
|
190
|
+
error instanceof PathTraversalError ||
|
|
191
|
+
error instanceof PathBlockedError) {
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
// Wrap other errors
|
|
195
|
+
throw new EditOperationError(normalizedPath, getErrorMessage(error));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Find files matching a glob pattern.
|
|
200
|
+
*
|
|
201
|
+
* Features:
|
|
202
|
+
* - Case sensitivity control via `caseSensitive` option
|
|
203
|
+
* - Gitignore filtering via `respectGitignore` option
|
|
204
|
+
* - Smart sorting: recent files (within 24h) first, then alphabetical
|
|
205
|
+
* - Special character handling for paths with glob syntax
|
|
206
|
+
*/
|
|
207
|
+
async globFiles(pattern, options = {}) {
|
|
208
|
+
this.ensureInitialized();
|
|
209
|
+
const cwd = options.cwd ?? this.config.workingDirectory;
|
|
210
|
+
const maxResults = options.maxResults ?? 1000;
|
|
211
|
+
const includeMetadata = options.includeMetadata ?? true;
|
|
212
|
+
const caseSensitive = options.caseSensitive ?? true;
|
|
213
|
+
const respectGitignore = options.respectGitignore ?? true;
|
|
214
|
+
try {
|
|
215
|
+
// Handle special characters - escape pattern if it matches an existing file
|
|
216
|
+
const escapedPattern = await escapeIfExactMatch(pattern, cwd);
|
|
217
|
+
// Execute glob with case sensitivity option
|
|
218
|
+
const files = await glob(escapedPattern, {
|
|
219
|
+
absolute: true,
|
|
220
|
+
cwd,
|
|
221
|
+
follow: false, // Don't follow symlinks
|
|
222
|
+
nocase: !caseSensitive, // Case insensitive if caseSensitive is false
|
|
223
|
+
nodir: true, // Only files
|
|
224
|
+
});
|
|
225
|
+
// Initialize gitignore filter if requested
|
|
226
|
+
let gitignoreFilter = null;
|
|
227
|
+
if (respectGitignore) {
|
|
228
|
+
gitignoreFilter = await createGitignoreFilter(cwd);
|
|
229
|
+
}
|
|
230
|
+
// Validate paths and apply gitignore filtering
|
|
231
|
+
const validPaths = [];
|
|
232
|
+
let ignoredCount = 0;
|
|
233
|
+
for (const file of files) {
|
|
234
|
+
// Validate path
|
|
235
|
+
const validation = this.pathValidator.validate(file, 'read');
|
|
236
|
+
if (!validation.valid || !validation.normalizedPath) {
|
|
237
|
+
// Skip invalid paths
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
// Apply gitignore filter if enabled
|
|
241
|
+
if (gitignoreFilter) {
|
|
242
|
+
const relativePath = path.relative(cwd, validation.normalizedPath);
|
|
243
|
+
if (gitignoreFilter.isIgnored(relativePath)) {
|
|
244
|
+
ignoredCount++;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
validPaths.push(validation.normalizedPath);
|
|
249
|
+
}
|
|
250
|
+
const totalFound = validPaths.length;
|
|
251
|
+
// Collect metadata for all valid paths
|
|
252
|
+
const filesWithMetadata = await collectFileMetadata(validPaths, cwd);
|
|
253
|
+
// Sort files: recent files first (within 24h), then alphabetical
|
|
254
|
+
const sortedFiles = sortFilesByRecency(filesWithMetadata);
|
|
255
|
+
// Apply maxResults limit after sorting
|
|
256
|
+
const truncated = sortedFiles.length > maxResults;
|
|
257
|
+
const limitedFiles = sortedFiles.slice(0, maxResults);
|
|
258
|
+
// Convert to FileMetadata format
|
|
259
|
+
const resultFiles = includeMetadata
|
|
260
|
+
? limitedFiles.map((f) => ({
|
|
261
|
+
isDirectory: false,
|
|
262
|
+
modified: f.modifiedTime,
|
|
263
|
+
path: f.path,
|
|
264
|
+
size: f.size,
|
|
265
|
+
}))
|
|
266
|
+
: extractPaths(limitedFiles).map((p) => ({
|
|
267
|
+
isDirectory: false,
|
|
268
|
+
modified: new Date(),
|
|
269
|
+
path: p,
|
|
270
|
+
size: 0,
|
|
271
|
+
}));
|
|
272
|
+
// Build result message
|
|
273
|
+
const message = this.buildGlobMessage(resultFiles.length, totalFound, ignoredCount, truncated);
|
|
274
|
+
return {
|
|
275
|
+
files: resultFiles,
|
|
276
|
+
ignoredCount,
|
|
277
|
+
message,
|
|
278
|
+
totalFound,
|
|
279
|
+
truncated,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
// Check for pattern errors
|
|
284
|
+
if (getErrorMessage(error).includes('Invalid glob pattern')) {
|
|
285
|
+
throw new InvalidPatternError(pattern, getErrorMessage(error));
|
|
286
|
+
}
|
|
287
|
+
throw new GlobOperationError(pattern, getErrorMessage(error));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Initialize the file system service.
|
|
292
|
+
*/
|
|
293
|
+
async initialize() {
|
|
294
|
+
if (this.initialized) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
// Verify working directory exists
|
|
298
|
+
try {
|
|
299
|
+
const stats = await fs.stat(this.config.workingDirectory);
|
|
300
|
+
if (!stats.isDirectory()) {
|
|
301
|
+
throw new DirectoryNotFoundError(this.config.workingDirectory);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
if (error.code === 'ENOENT') {
|
|
306
|
+
throw new DirectoryNotFoundError(this.config.workingDirectory);
|
|
307
|
+
}
|
|
308
|
+
throw error;
|
|
309
|
+
}
|
|
310
|
+
this.initialized = true;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* List files and directories in a path.
|
|
314
|
+
*/
|
|
315
|
+
async listDirectory(dirPath, options = {}) {
|
|
316
|
+
this.ensureInitialized();
|
|
317
|
+
// Validate path - let PathValidator handle resolution to prevent path duplication
|
|
318
|
+
// (e.g., when workingDirectory is .brv/context-tree and dirPath is also .brv/context-tree)
|
|
319
|
+
const pathToValidate = dirPath || '.';
|
|
320
|
+
const validation = this.pathValidator.validate(pathToValidate, 'read');
|
|
321
|
+
if (!validation.valid) {
|
|
322
|
+
this.throwValidationError(pathToValidate, validation.error);
|
|
323
|
+
}
|
|
324
|
+
const { normalizedPath } = validation;
|
|
325
|
+
// Verify directory exists
|
|
326
|
+
try {
|
|
327
|
+
const stats = await fs.stat(normalizedPath);
|
|
328
|
+
if (!stats.isDirectory()) {
|
|
329
|
+
throw new DirectoryNotFoundError(normalizedPath);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
if (error.code === 'ENOENT') {
|
|
334
|
+
throw new DirectoryNotFoundError(normalizedPath);
|
|
335
|
+
}
|
|
336
|
+
throw error;
|
|
337
|
+
}
|
|
338
|
+
const maxResults = options.maxResults ?? LIST_DIRECTORY_LIMIT;
|
|
339
|
+
const ignorePatterns = [...DEFAULT_IGNORE_PATTERNS, ...(options.ignore ?? [])];
|
|
340
|
+
// Use glob with ** pattern to get all files
|
|
341
|
+
const files = await glob('**/*', {
|
|
342
|
+
absolute: false,
|
|
343
|
+
cwd: normalizedPath,
|
|
344
|
+
follow: false,
|
|
345
|
+
ignore: ignorePatterns.map((p) => `**/${p}**`),
|
|
346
|
+
nodir: true,
|
|
347
|
+
});
|
|
348
|
+
// Limit results
|
|
349
|
+
const truncated = files.length > maxResults;
|
|
350
|
+
const limitedFiles = files.slice(0, maxResults);
|
|
351
|
+
// Build directory structure
|
|
352
|
+
const dirs = new Set();
|
|
353
|
+
const filesByDir = new Map();
|
|
354
|
+
for (const file of limitedFiles) {
|
|
355
|
+
const dir = path.dirname(file);
|
|
356
|
+
const parts = dir === '.' ? [] : dir.split('/');
|
|
357
|
+
// Add all parent directories
|
|
358
|
+
for (let i = 0; i <= parts.length; i++) {
|
|
359
|
+
const currentDirPath = i === 0 ? '.' : parts.slice(0, i).join('/');
|
|
360
|
+
dirs.add(currentDirPath);
|
|
361
|
+
}
|
|
362
|
+
// Add file to its directory
|
|
363
|
+
if (!filesByDir.has(dir)) {
|
|
364
|
+
filesByDir.set(dir, []);
|
|
365
|
+
}
|
|
366
|
+
filesByDir.get(dir).push(path.basename(file));
|
|
367
|
+
}
|
|
368
|
+
// Build entries array
|
|
369
|
+
const entries = limitedFiles.map((file) => ({
|
|
370
|
+
isDirectory: false,
|
|
371
|
+
name: path.basename(file),
|
|
372
|
+
path: file,
|
|
373
|
+
}));
|
|
374
|
+
// Render tree
|
|
375
|
+
const tree = this.renderDirectoryTree(normalizedPath, dirs, filesByDir);
|
|
376
|
+
return {
|
|
377
|
+
count: limitedFiles.length,
|
|
378
|
+
entries,
|
|
379
|
+
tree,
|
|
380
|
+
truncated,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Read the contents of a file.
|
|
385
|
+
*
|
|
386
|
+
* Features:
|
|
387
|
+
* - Relative path support (resolved against working directory)
|
|
388
|
+
* - Image/PDF files returned as base64 attachments
|
|
389
|
+
* - Binary file detection and rejection
|
|
390
|
+
* - .env file blocking with whitelist for example files
|
|
391
|
+
* - XML-wrapped output for clearer LLM parsing
|
|
392
|
+
* - Preview metadata (first 20 lines)
|
|
393
|
+
*/
|
|
394
|
+
// eslint-disable-next-line complexity -- Multiple file type handling paths (image/PDF, binary, text) are inherent to the functionality
|
|
395
|
+
async readFile(filePath, options = {}) {
|
|
396
|
+
this.ensureInitialized();
|
|
397
|
+
// Resolve relative paths against working directory
|
|
398
|
+
let resolvedPath = filePath;
|
|
399
|
+
if (!path.isAbsolute(filePath)) {
|
|
400
|
+
resolvedPath = path.resolve(this.config.workingDirectory, filePath);
|
|
401
|
+
}
|
|
402
|
+
// Validate path
|
|
403
|
+
const validation = this.pathValidator.validate(resolvedPath, 'read');
|
|
404
|
+
if (!validation.valid) {
|
|
405
|
+
this.throwValidationError(resolvedPath, validation.error);
|
|
406
|
+
}
|
|
407
|
+
const { normalizedPath } = validation;
|
|
408
|
+
// Check .env file whitelist (allow .env.sample, .env.example, etc.)
|
|
409
|
+
const fileName = path.basename(normalizedPath).toLowerCase();
|
|
410
|
+
const isEnvFile = fileName.includes('.env');
|
|
411
|
+
const isWhitelisted = ENV_WHITELIST.some((w) => fileName.endsWith(w));
|
|
412
|
+
if (isEnvFile && !isWhitelisted) {
|
|
413
|
+
throw new PathBlockedError(normalizedPath, 'Environment files are blocked for security. Only example files (.env.sample, .env.example) are allowed.');
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
// Check if file exists
|
|
417
|
+
let stats;
|
|
418
|
+
try {
|
|
419
|
+
stats = await fs.stat(normalizedPath);
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
if (error.code === 'ENOENT') {
|
|
423
|
+
// Try to find similar files for suggestions
|
|
424
|
+
const dirPath = path.dirname(normalizedPath);
|
|
425
|
+
const baseName = path.basename(normalizedPath);
|
|
426
|
+
const suggestions = await findSimilarFiles(dirPath, baseName);
|
|
427
|
+
if (suggestions.length > 0) {
|
|
428
|
+
throw new FileNotFoundError(normalizedPath, `File not found: ${normalizedPath}\n\nDid you mean one of these?\n${suggestions.join('\n')}`);
|
|
429
|
+
}
|
|
430
|
+
throw new FileNotFoundError(normalizedPath);
|
|
431
|
+
}
|
|
432
|
+
throw error;
|
|
433
|
+
}
|
|
434
|
+
// Check file size
|
|
435
|
+
if (stats.size > this.config.maxFileSize) {
|
|
436
|
+
throw new FileTooLargeError(normalizedPath, stats.size, this.config.maxFileSize);
|
|
437
|
+
}
|
|
438
|
+
// Handle files that should be returned as base64 attachments (images always, PDFs when pdfMode='base64')
|
|
439
|
+
if (shouldReturnAsAttachment(normalizedPath, options.pdfMode)) {
|
|
440
|
+
const buffer = await fs.readFile(normalizedPath);
|
|
441
|
+
const baseName = path.basename(normalizedPath);
|
|
442
|
+
const mimeType = getMimeType(normalizedPath) ?? 'application/octet-stream';
|
|
443
|
+
const fileType = isImageFile(normalizedPath) ? 'Image' : 'PDF';
|
|
444
|
+
return {
|
|
445
|
+
attachment: {
|
|
446
|
+
base64: buffer.toString('base64'),
|
|
447
|
+
fileName: baseName,
|
|
448
|
+
mimeType,
|
|
449
|
+
},
|
|
450
|
+
content: `[${fileType} file: ${baseName}]`,
|
|
451
|
+
encoding: 'base64',
|
|
452
|
+
formattedContent: `<file>\n[${fileType} file: ${baseName} (${stats.size} bytes)]\n</file>`,
|
|
453
|
+
lines: 1,
|
|
454
|
+
message: `${fileType} file read successfully. Content available as base64 attachment.`,
|
|
455
|
+
size: stats.size,
|
|
456
|
+
totalLines: 1,
|
|
457
|
+
truncated: false,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
// Handle PDF files with text extraction (pdfMode='text')
|
|
461
|
+
if (isPdfFile(normalizedPath)) {
|
|
462
|
+
const buffer = await fs.readFile(normalizedPath);
|
|
463
|
+
return this.extractPdfTextContent(buffer, normalizedPath, stats.size, options);
|
|
464
|
+
}
|
|
465
|
+
// Check for binary files (read first 4KB for detection)
|
|
466
|
+
const handle = await fs.open(normalizedPath, 'r');
|
|
467
|
+
const sampleBuffer = Buffer.alloc(BINARY_DETECTION_BUFFER_SIZE);
|
|
468
|
+
const { bytesRead } = await handle.read(sampleBuffer, 0, BINARY_DETECTION_BUFFER_SIZE, 0);
|
|
469
|
+
await handle.close();
|
|
470
|
+
if (isBinaryFile(normalizedPath, sampleBuffer.subarray(0, bytesRead))) {
|
|
471
|
+
throw new ReadOperationError(normalizedPath, 'Cannot read binary file. Use a hex editor or appropriate tool for binary files.');
|
|
472
|
+
}
|
|
473
|
+
// Read text file
|
|
474
|
+
const encoding = (options.encoding ?? 'utf8');
|
|
475
|
+
const rawContent = await fs.readFile(normalizedPath, encoding);
|
|
476
|
+
// Split into lines
|
|
477
|
+
const allLines = rawContent.split('\n');
|
|
478
|
+
const totalLines = allLines.length;
|
|
479
|
+
// Apply offset and limit (with default limit of 2000)
|
|
480
|
+
const offset = options.offset !== undefined && options.offset > 0 ? options.offset - 1 : 0;
|
|
481
|
+
const limit = options.limit ?? DEFAULT_READ_LIMIT;
|
|
482
|
+
const endLine = Math.min(offset + limit, totalLines);
|
|
483
|
+
const selectedLines = allLines.slice(offset, endLine);
|
|
484
|
+
const truncated = endLine < totalLines;
|
|
485
|
+
// Truncate long lines
|
|
486
|
+
const truncatedLines = selectedLines.map((line) => truncateLine(line));
|
|
487
|
+
// Format with line numbers
|
|
488
|
+
const numberedContent = formatWithLineNumbers(truncatedLines, offset + 1);
|
|
489
|
+
// Build informative message
|
|
490
|
+
const lastReadLine = offset + selectedLines.length;
|
|
491
|
+
let message;
|
|
492
|
+
if (truncated) {
|
|
493
|
+
const remainingLines = totalLines - lastReadLine;
|
|
494
|
+
message =
|
|
495
|
+
`Read lines ${offset + 1}-${lastReadLine}. ` +
|
|
496
|
+
`${remainingLines} more lines available. Use offset=${lastReadLine + 1} to continue reading.`;
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
message = `End of file - read ${selectedLines.length} lines (${totalLines} total).`;
|
|
500
|
+
}
|
|
501
|
+
// Generate preview (first N lines of selected content)
|
|
502
|
+
const previewLines = truncatedLines.slice(0, PREVIEW_LINES);
|
|
503
|
+
const preview = previewLines.join('\n');
|
|
504
|
+
// Wrap in XML tags for clearer LLM parsing
|
|
505
|
+
const truncationNote = truncated
|
|
506
|
+
? `\n\n(File has more lines. Use offset=${lastReadLine + 1} to continue)`
|
|
507
|
+
: `\n\n(End of file - ${totalLines} lines)`;
|
|
508
|
+
const formattedContent = `<file>\n${numberedContent}${truncationNote}\n</file>`;
|
|
509
|
+
return {
|
|
510
|
+
content: truncatedLines.join('\n'),
|
|
511
|
+
encoding,
|
|
512
|
+
formattedContent,
|
|
513
|
+
lines: selectedLines.length,
|
|
514
|
+
message,
|
|
515
|
+
preview,
|
|
516
|
+
size: stats.size,
|
|
517
|
+
totalLines,
|
|
518
|
+
truncated,
|
|
519
|
+
truncatedLineCount: truncatedLines.length,
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
catch (error) {
|
|
523
|
+
// Re-throw known errors
|
|
524
|
+
if (error instanceof FileNotFoundError ||
|
|
525
|
+
error instanceof FileTooLargeError ||
|
|
526
|
+
error instanceof PathNotAllowedError ||
|
|
527
|
+
error instanceof PathTraversalError ||
|
|
528
|
+
error instanceof PathBlockedError ||
|
|
529
|
+
error instanceof ReadOperationError ||
|
|
530
|
+
error instanceof PdfExtractionError) {
|
|
531
|
+
throw error;
|
|
532
|
+
}
|
|
533
|
+
// Wrap other errors
|
|
534
|
+
throw new ReadOperationError(normalizedPath, getErrorMessage(error));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Search file contents for a pattern.
|
|
539
|
+
* Uses native grep commands (ripgrep, system grep) when available for better performance,
|
|
540
|
+
* falling back to JavaScript implementation when needed.
|
|
541
|
+
*/
|
|
542
|
+
async searchContent(pattern, options = {}) {
|
|
543
|
+
this.ensureInitialized();
|
|
544
|
+
const cwd = options.cwd ?? this.config.workingDirectory;
|
|
545
|
+
const maxResults = options.maxResults ?? 100;
|
|
546
|
+
const contextLines = options.contextLines ?? 0;
|
|
547
|
+
// If context lines requested, use JS fallback directly (native grep context parsing is complex)
|
|
548
|
+
if (contextLines > 0) {
|
|
549
|
+
return this.searchContentJS(pattern, options);
|
|
550
|
+
}
|
|
551
|
+
try {
|
|
552
|
+
// Try native strategies in order: ripgrep → system grep → JS fallback
|
|
553
|
+
let matches = null;
|
|
554
|
+
matches = await this.executeRipgrep(pattern, cwd, options);
|
|
555
|
+
if (matches === null) {
|
|
556
|
+
matches = await this.executeSystemGrep(pattern, cwd, options);
|
|
557
|
+
}
|
|
558
|
+
if (matches === null) {
|
|
559
|
+
return this.searchContentJS(pattern, options);
|
|
560
|
+
}
|
|
561
|
+
// Collect file modification times for sorting (recent files first)
|
|
562
|
+
const matchesWithMtime = await Promise.all(matches.map(async (match) => {
|
|
563
|
+
try {
|
|
564
|
+
const stats = await fs.stat(match.file);
|
|
565
|
+
return { ...match, mtime: stats.mtime.getTime() };
|
|
566
|
+
}
|
|
567
|
+
catch {
|
|
568
|
+
return { ...match, mtime: 0 };
|
|
569
|
+
}
|
|
570
|
+
}));
|
|
571
|
+
// Sort by modification time (newest first)
|
|
572
|
+
matchesWithMtime.sort((a, b) => (b.mtime ?? 0) - (a.mtime ?? 0));
|
|
573
|
+
// Apply maxResults limit
|
|
574
|
+
const truncated = matchesWithMtime.length > maxResults;
|
|
575
|
+
return {
|
|
576
|
+
filesSearched: new Set(matchesWithMtime.map((m) => m.file)).size,
|
|
577
|
+
matches: matchesWithMtime.slice(0, maxResults),
|
|
578
|
+
totalMatches: matchesWithMtime.length,
|
|
579
|
+
truncated,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
// Re-throw known errors
|
|
584
|
+
if (error instanceof InvalidPatternError || error instanceof GlobOperationError) {
|
|
585
|
+
throw error;
|
|
586
|
+
}
|
|
587
|
+
throw new SearchOperationError(pattern, getErrorMessage(error));
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Write content to a file.
|
|
592
|
+
*/
|
|
593
|
+
async writeFile(filePath, content, options = {}) {
|
|
594
|
+
this.ensureInitialized();
|
|
595
|
+
// Validate path
|
|
596
|
+
const validation = this.pathValidator.validate(filePath, 'write');
|
|
597
|
+
if (!validation.valid) {
|
|
598
|
+
this.throwValidationError(filePath, validation.error);
|
|
599
|
+
}
|
|
600
|
+
const { normalizedPath } = validation;
|
|
601
|
+
try {
|
|
602
|
+
// Create parent directories if requested
|
|
603
|
+
if (options.createDirs) {
|
|
604
|
+
const dirname = path.dirname(normalizedPath);
|
|
605
|
+
await fs.mkdir(dirname, { recursive: true });
|
|
606
|
+
}
|
|
607
|
+
// Write file
|
|
608
|
+
const encoding = (options.encoding ?? 'utf8');
|
|
609
|
+
await fs.writeFile(normalizedPath, content, encoding);
|
|
610
|
+
// Get file size
|
|
611
|
+
const stats = await fs.stat(normalizedPath);
|
|
612
|
+
return {
|
|
613
|
+
bytesWritten: stats.size,
|
|
614
|
+
path: normalizedPath,
|
|
615
|
+
success: true,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
catch (error) {
|
|
619
|
+
// Re-throw known errors
|
|
620
|
+
if (error instanceof InvalidExtensionError ||
|
|
621
|
+
error instanceof PathNotAllowedError ||
|
|
622
|
+
error instanceof PathTraversalError ||
|
|
623
|
+
error instanceof PathBlockedError) {
|
|
624
|
+
throw error;
|
|
625
|
+
}
|
|
626
|
+
// Wrap other errors
|
|
627
|
+
throw new WriteOperationError(normalizedPath, getErrorMessage(error));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Builds a human-readable message for glob results.
|
|
632
|
+
*/
|
|
633
|
+
buildGlobMessage(returned, total, ignored, truncated) {
|
|
634
|
+
const parts = [];
|
|
635
|
+
if (truncated) {
|
|
636
|
+
parts.push(`Found ${total} files, showing first ${returned}`);
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
parts.push(`Found ${returned} file${returned === 1 ? '' : 's'}`);
|
|
640
|
+
}
|
|
641
|
+
if (ignored > 0) {
|
|
642
|
+
parts.push(`(${ignored} ignored by .gitignore)`);
|
|
643
|
+
}
|
|
644
|
+
return parts.join(' ');
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Collects context lines before and after a match.
|
|
648
|
+
*/
|
|
649
|
+
collectContextLines(lines, lineIndex, contextLines) {
|
|
650
|
+
const before = [];
|
|
651
|
+
const after = [];
|
|
652
|
+
if (contextLines > 0) {
|
|
653
|
+
// Lines before
|
|
654
|
+
for (let j = Math.max(0, lineIndex - contextLines); j < lineIndex; j++) {
|
|
655
|
+
before.push(truncateLine(lines[j]));
|
|
656
|
+
}
|
|
657
|
+
// Lines after
|
|
658
|
+
for (let j = lineIndex + 1; j < Math.min(lines.length, lineIndex + 1 + contextLines); j++) {
|
|
659
|
+
after.push(truncateLine(lines[j]));
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
return { after, before };
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Creates a regex from a pattern string.
|
|
666
|
+
*/
|
|
667
|
+
createSearchRegex(pattern, caseInsensitive) {
|
|
668
|
+
const flags = caseInsensitive ? 'i' : '';
|
|
669
|
+
try {
|
|
670
|
+
return new RegExp(pattern, flags);
|
|
671
|
+
}
|
|
672
|
+
catch (error) {
|
|
673
|
+
throw new InvalidPatternError(pattern, getErrorMessage(error));
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Ensures the service is initialized.
|
|
678
|
+
* @throws ServiceNotInitializedError if not initialized
|
|
679
|
+
*/
|
|
680
|
+
ensureInitialized() {
|
|
681
|
+
if (!this.initialized) {
|
|
682
|
+
throw new ServiceNotInitializedError();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Executes ripgrep (rg) for content search.
|
|
687
|
+
* Returns null if rg is not available or fails.
|
|
688
|
+
*/
|
|
689
|
+
async executeRipgrep(pattern, cwd, options) {
|
|
690
|
+
if (!(await this.isCommandAvailable('rg')))
|
|
691
|
+
return null;
|
|
692
|
+
const args = ['-n', '--no-heading', '--with-filename'];
|
|
693
|
+
if (options.caseInsensitive)
|
|
694
|
+
args.push('-i');
|
|
695
|
+
// Add exclusions for blocked paths
|
|
696
|
+
for (const blocked of this.config.blockedPaths) {
|
|
697
|
+
args.push('--glob', `!${blocked}`);
|
|
698
|
+
}
|
|
699
|
+
if (options.globPattern)
|
|
700
|
+
args.push('--glob', options.globPattern);
|
|
701
|
+
args.push(pattern, '.'); // Add search path to prevent reading from stdin
|
|
702
|
+
try {
|
|
703
|
+
const output = await this.spawnCommand('rg', args, cwd, options.abortSignal);
|
|
704
|
+
return this.parseGrepOutput(output, cwd);
|
|
705
|
+
}
|
|
706
|
+
catch {
|
|
707
|
+
return null;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Executes system grep for content search.
|
|
712
|
+
* Returns null if grep is not available or fails.
|
|
713
|
+
*/
|
|
714
|
+
async executeSystemGrep(pattern, cwd, options) {
|
|
715
|
+
if (!(await this.isCommandAvailable('grep')))
|
|
716
|
+
return null;
|
|
717
|
+
const args = ['-r', '-n', '-H', '-E', '-I'];
|
|
718
|
+
if (options.caseInsensitive)
|
|
719
|
+
args.push('-i');
|
|
720
|
+
// Add exclusions for blocked paths
|
|
721
|
+
for (const blocked of this.config.blockedPaths) {
|
|
722
|
+
args.push(`--exclude-dir=${blocked}`);
|
|
723
|
+
}
|
|
724
|
+
if (options.globPattern)
|
|
725
|
+
args.push(`--include=${options.globPattern}`);
|
|
726
|
+
args.push(pattern, '.');
|
|
727
|
+
try {
|
|
728
|
+
const output = await this.spawnCommand('grep', args, cwd, options.abortSignal);
|
|
729
|
+
return this.parseGrepOutput(output, cwd);
|
|
730
|
+
}
|
|
731
|
+
catch {
|
|
732
|
+
return null;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Extracts text content from a PDF file with pagination support.
|
|
737
|
+
* @param buffer - PDF file buffer
|
|
738
|
+
* @param filePath - Path to the PDF file
|
|
739
|
+
* @param fileSize - Size of the file in bytes
|
|
740
|
+
* @param options - Read options including offset and limit
|
|
741
|
+
* @returns FileContent with extracted text
|
|
742
|
+
*/
|
|
743
|
+
async extractPdfTextContent(buffer, filePath, fileSize, options) {
|
|
744
|
+
// Extract text with pagination
|
|
745
|
+
const result = await PdfExtractor.extractText(buffer, filePath, {
|
|
746
|
+
limit: options.limit,
|
|
747
|
+
offset: options.offset,
|
|
748
|
+
});
|
|
749
|
+
const { hasMore, metadata, pages } = result;
|
|
750
|
+
const totalPages = metadata.pageCount;
|
|
751
|
+
// Check if PDF has no extractable text
|
|
752
|
+
const hasText = pages.some((p) => p.text.trim().length > 0);
|
|
753
|
+
if (!hasText && pages.length > 0) {
|
|
754
|
+
// Return helpful message for scanned/image-only PDFs
|
|
755
|
+
const metaInfo = metadata.title ? ` Title: "${metadata.title}".` : '';
|
|
756
|
+
return {
|
|
757
|
+
content: '',
|
|
758
|
+
encoding: 'utf8',
|
|
759
|
+
formattedContent: `<file type="pdf" pages="${totalPages}">\n[PDF has no extractable text - likely scanned or image-only]${metaInfo}\n</file>`,
|
|
760
|
+
lines: 0,
|
|
761
|
+
message: `PDF has no extractable text (${totalPages} pages).${metaInfo} ` +
|
|
762
|
+
"This PDF may be scanned or contain only images. Try reading with pdfMode='base64' for multimodal analysis.",
|
|
763
|
+
pdfMetadata: metadata,
|
|
764
|
+
pdfPages: pages,
|
|
765
|
+
size: fileSize,
|
|
766
|
+
totalLines: totalPages,
|
|
767
|
+
truncated: false,
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
// Calculate next offset for continuation
|
|
771
|
+
const startPage = options.offset ?? 1;
|
|
772
|
+
const pagesRead = pages.length;
|
|
773
|
+
const nextOffset = startPage + pagesRead;
|
|
774
|
+
// Format content with page separators
|
|
775
|
+
const formattedText = formatPdfContent(pages, metadata, hasMore, nextOffset);
|
|
776
|
+
// Build XML-wrapped formatted content
|
|
777
|
+
const formattedContent = `<file type="pdf" pages="${totalPages}">\n${formattedText}\n</file>`;
|
|
778
|
+
// Build message
|
|
779
|
+
let message;
|
|
780
|
+
if (pagesRead === 0) {
|
|
781
|
+
message = `PDF has ${totalPages} pages. Requested offset ${startPage} is beyond the last page.`;
|
|
782
|
+
}
|
|
783
|
+
else if (hasMore) {
|
|
784
|
+
const endPage = startPage + pagesRead - 1;
|
|
785
|
+
const remainingPages = totalPages - endPage;
|
|
786
|
+
message =
|
|
787
|
+
`Read pages ${startPage}-${endPage}. ` +
|
|
788
|
+
`${remainingPages} more pages available. Must set offset=${nextOffset} to continue reading.`;
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
message = `End of PDF - read ${pagesRead} pages (${totalPages} total).`;
|
|
792
|
+
}
|
|
793
|
+
// Generate preview (first page text, truncated)
|
|
794
|
+
const previewText = pages[0]?.text ?? '';
|
|
795
|
+
const previewLines = previewText.split('\n').slice(0, PREVIEW_LINES);
|
|
796
|
+
const preview = previewLines.join('\n');
|
|
797
|
+
return {
|
|
798
|
+
content: pages.map((p) => p.text).join('\n\n'),
|
|
799
|
+
encoding: 'utf8',
|
|
800
|
+
formattedContent,
|
|
801
|
+
lines: pagesRead,
|
|
802
|
+
message,
|
|
803
|
+
pdfMetadata: metadata,
|
|
804
|
+
pdfPages: pages,
|
|
805
|
+
preview,
|
|
806
|
+
size: fileSize,
|
|
807
|
+
totalLines: totalPages,
|
|
808
|
+
truncated: hasMore,
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Checks if a command is available in the system's PATH.
|
|
813
|
+
*/
|
|
814
|
+
isCommandAvailable(command) {
|
|
815
|
+
return new Promise((resolve) => {
|
|
816
|
+
const checkCmd = process.platform === 'win32' ? 'where' : 'command';
|
|
817
|
+
const checkArgs = process.platform === 'win32' ? [command] : ['-v', command];
|
|
818
|
+
try {
|
|
819
|
+
const child = spawn(checkCmd, checkArgs, { shell: true, stdio: 'ignore' });
|
|
820
|
+
child.on('close', (code) => resolve(code === 0));
|
|
821
|
+
child.on('error', () => resolve(false));
|
|
822
|
+
}
|
|
823
|
+
catch {
|
|
824
|
+
resolve(false);
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Parses output from grep-like commands (filepath:lineNumber:content format).
|
|
830
|
+
*/
|
|
831
|
+
parseGrepOutput(output, basePath) {
|
|
832
|
+
const results = [];
|
|
833
|
+
if (!output)
|
|
834
|
+
return results;
|
|
835
|
+
for (const line of output.split(EOL)) {
|
|
836
|
+
if (!line.trim())
|
|
837
|
+
continue;
|
|
838
|
+
// Format: filepath:lineNumber:content
|
|
839
|
+
const firstColon = line.indexOf(':');
|
|
840
|
+
if (firstColon === -1)
|
|
841
|
+
continue;
|
|
842
|
+
const secondColon = line.indexOf(':', firstColon + 1);
|
|
843
|
+
if (secondColon === -1)
|
|
844
|
+
continue;
|
|
845
|
+
const filePath = line.slice(0, firstColon);
|
|
846
|
+
const lineNumber = Number.parseInt(line.slice(firstColon + 1, secondColon), 10);
|
|
847
|
+
const content = line.slice(secondColon + 1);
|
|
848
|
+
if (!Number.isNaN(lineNumber)) {
|
|
849
|
+
results.push({
|
|
850
|
+
file: path.resolve(basePath, filePath),
|
|
851
|
+
line: truncateLine(content),
|
|
852
|
+
lineNumber,
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
return results;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Renders a directory tree as a string.
|
|
860
|
+
*/
|
|
861
|
+
renderDirectoryTree(basePath, dirs, filesByDir) {
|
|
862
|
+
const renderDir = (dirPath, depth) => {
|
|
863
|
+
const indent = ' '.repeat(depth);
|
|
864
|
+
let output = '';
|
|
865
|
+
if (depth > 0) {
|
|
866
|
+
output += `${indent}${path.basename(dirPath)}/\n`;
|
|
867
|
+
}
|
|
868
|
+
const childIndent = ' '.repeat(depth + 1);
|
|
869
|
+
const children = [...dirs].filter((d) => path.dirname(d) === dirPath && d !== dirPath).sort();
|
|
870
|
+
// Render subdirectories first
|
|
871
|
+
for (const child of children) {
|
|
872
|
+
output += renderDir(child, depth + 1);
|
|
873
|
+
}
|
|
874
|
+
// Render files
|
|
875
|
+
const files = filesByDir.get(dirPath) ?? [];
|
|
876
|
+
for (const file of files.sort()) {
|
|
877
|
+
output += `${childIndent}${file}\n`;
|
|
878
|
+
}
|
|
879
|
+
return output;
|
|
880
|
+
};
|
|
881
|
+
return `${basePath}/\n${renderDir('.', 0)}`;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* JavaScript-based content search implementation.
|
|
885
|
+
* Used as fallback when native grep commands are unavailable or when context lines are needed.
|
|
886
|
+
*/
|
|
887
|
+
async searchContentJS(pattern, options = {}) {
|
|
888
|
+
const globPattern = options.globPattern ?? '**/*';
|
|
889
|
+
const cwd = options.cwd ?? this.config.workingDirectory;
|
|
890
|
+
const maxResults = options.maxResults ?? 100;
|
|
891
|
+
const contextLines = options.contextLines ?? 0;
|
|
892
|
+
const caseInsensitive = options.caseInsensitive ?? false;
|
|
893
|
+
try {
|
|
894
|
+
// Create regex
|
|
895
|
+
const regex = this.createSearchRegex(pattern, caseInsensitive);
|
|
896
|
+
// Find files to search
|
|
897
|
+
const globResult = await this.globFiles(globPattern, {
|
|
898
|
+
cwd,
|
|
899
|
+
includeMetadata: false,
|
|
900
|
+
maxResults: 10_000, // Search more files, but limit results
|
|
901
|
+
});
|
|
902
|
+
return await this.searchFiles(globResult.files, regex, maxResults, contextLines);
|
|
903
|
+
}
|
|
904
|
+
catch (error) {
|
|
905
|
+
// Re-throw known errors
|
|
906
|
+
if (error instanceof InvalidPatternError || error instanceof GlobOperationError) {
|
|
907
|
+
throw error;
|
|
908
|
+
}
|
|
909
|
+
throw new SearchOperationError(pattern, getErrorMessage(error));
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Searches a single file for a regex pattern.
|
|
914
|
+
*/
|
|
915
|
+
async searchFile(filePath, regex, maxMatches, contextLines) {
|
|
916
|
+
const fileContent = await this.readFile(filePath);
|
|
917
|
+
const lines = fileContent.content.split('\n');
|
|
918
|
+
const matches = [];
|
|
919
|
+
let totalMatches = 0;
|
|
920
|
+
for (let i = 0; i < lines.length; i++) {
|
|
921
|
+
const line = lines[i];
|
|
922
|
+
if (regex.test(line)) {
|
|
923
|
+
totalMatches++;
|
|
924
|
+
if (matches.length >= maxMatches) {
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
const context = this.collectContextLines(lines, i, contextLines);
|
|
928
|
+
matches.push({
|
|
929
|
+
context: contextLines > 0 ? context : undefined,
|
|
930
|
+
file: filePath,
|
|
931
|
+
line: truncateLine(line),
|
|
932
|
+
lineNumber: i + 1, // 1-based line numbers
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return { matches, totalMatches };
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Searches multiple files for a regex pattern.
|
|
940
|
+
*/
|
|
941
|
+
async searchFiles(files, regex, maxResults, contextLines) {
|
|
942
|
+
const matches = [];
|
|
943
|
+
let totalMatches = 0;
|
|
944
|
+
let filesSearched = 0;
|
|
945
|
+
for (const fileInfo of files) {
|
|
946
|
+
filesSearched++;
|
|
947
|
+
try {
|
|
948
|
+
// eslint-disable-next-line no-await-in-loop
|
|
949
|
+
const fileMatches = await this.searchFile(fileInfo.path, regex, maxResults - matches.length, contextLines);
|
|
950
|
+
totalMatches += fileMatches.totalMatches;
|
|
951
|
+
for (const match of fileMatches.matches) {
|
|
952
|
+
matches.push(match);
|
|
953
|
+
if (matches.length >= maxResults) {
|
|
954
|
+
return {
|
|
955
|
+
filesSearched,
|
|
956
|
+
matches,
|
|
957
|
+
totalMatches,
|
|
958
|
+
truncated: true,
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
catch {
|
|
964
|
+
// Skip files that can't be read
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
return {
|
|
969
|
+
filesSearched,
|
|
970
|
+
matches,
|
|
971
|
+
totalMatches,
|
|
972
|
+
truncated: false,
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Spawns a command and returns its stdout.
|
|
977
|
+
*/
|
|
978
|
+
spawnCommand(cmd, args, cwd, signal) {
|
|
979
|
+
return new Promise((resolve, reject) => {
|
|
980
|
+
const child = spawn(cmd, args, { cwd, windowsHide: true });
|
|
981
|
+
const chunks = [];
|
|
982
|
+
if (signal) {
|
|
983
|
+
signal.addEventListener('abort', () => child.kill(), { once: true });
|
|
984
|
+
}
|
|
985
|
+
child.stdout.on('data', (chunk) => chunks.push(chunk));
|
|
986
|
+
child.on('error', reject);
|
|
987
|
+
child.on('close', (code) => {
|
|
988
|
+
if (code === 0 || code === 1) {
|
|
989
|
+
// 1 = no matches found (not an error)
|
|
990
|
+
resolve(Buffer.concat(chunks).toString('utf8'));
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
reject(new Error(`Command exited with code ${code}`));
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Throws the appropriate error based on validation error message.
|
|
1000
|
+
*/
|
|
1001
|
+
throwValidationError(filePath, error) {
|
|
1002
|
+
if (error.includes('empty')) {
|
|
1003
|
+
throw new InvalidPathError(filePath, error);
|
|
1004
|
+
}
|
|
1005
|
+
if (error.includes('traversal')) {
|
|
1006
|
+
throw new PathTraversalError(filePath);
|
|
1007
|
+
}
|
|
1008
|
+
if (error.includes('not in allowed paths')) {
|
|
1009
|
+
throw new PathNotAllowedError(filePath, this.config.allowedPaths);
|
|
1010
|
+
}
|
|
1011
|
+
if (error.includes('blocked')) {
|
|
1012
|
+
throw new PathBlockedError(filePath, error);
|
|
1013
|
+
}
|
|
1014
|
+
if (error.includes('extension')) {
|
|
1015
|
+
const ext = filePath.split('.').pop() ?? '';
|
|
1016
|
+
throw new InvalidExtensionError(filePath, ext);
|
|
1017
|
+
}
|
|
1018
|
+
// Fallback
|
|
1019
|
+
throw new InvalidPathError(filePath, error);
|
|
1020
|
+
}
|
|
1021
|
+
}
|