byterover-cli 0.4.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -9
- package/dist/commands/curate.d.ts +1 -3
- package/dist/commands/curate.js +14 -51
- package/dist/commands/main.d.ts +8 -0
- package/dist/commands/main.js +29 -8
- package/dist/commands/query.d.ts +1 -3
- package/dist/commands/query.js +8 -35
- package/dist/config/context-tree-domains.d.ts +5 -0
- package/dist/config/context-tree-domains.js +6 -1
- package/dist/config/environment.js +9 -9
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +18 -0
- package/dist/core/domain/cipher/agent/agent-info.d.ts +199 -0
- package/dist/core/domain/cipher/agent/agent-info.js +143 -0
- package/dist/core/domain/cipher/agent/agent-registry.d.ts +96 -0
- package/dist/core/domain/cipher/agent/agent-registry.js +254 -0
- package/dist/core/domain/cipher/agent/index.d.ts +4 -1
- package/dist/core/domain/cipher/agent/index.js +7 -1
- package/dist/core/domain/cipher/agent-events/types.d.ts +355 -2
- package/dist/core/domain/cipher/agent-events/types.js +11 -0
- package/dist/core/domain/cipher/errors/error-normalizer.d.ts +156 -0
- package/dist/core/domain/cipher/errors/error-normalizer.js +379 -0
- package/dist/core/domain/cipher/errors/file-system-error.d.ts +2 -1
- package/dist/core/domain/cipher/errors/file-system-error.js +3 -2
- package/dist/core/domain/cipher/errors/system-prompt-error-codes.d.ts +79 -0
- package/dist/core/domain/cipher/errors/system-prompt-error-codes.js +80 -0
- package/dist/core/domain/cipher/errors/system-prompt-error.d.ts +114 -0
- package/dist/core/domain/cipher/errors/system-prompt-error.js +144 -0
- package/dist/core/domain/cipher/file-system/types.d.ts +57 -0
- package/dist/core/domain/cipher/llm/error-codes.d.ts +51 -0
- package/dist/core/domain/cipher/llm/error-codes.js +51 -0
- package/dist/core/domain/cipher/llm/index.d.ts +9 -0
- package/dist/core/domain/cipher/llm/index.js +13 -0
- package/dist/core/domain/cipher/llm/registry.d.ts +113 -0
- package/dist/core/domain/cipher/llm/registry.js +244 -0
- package/dist/core/domain/cipher/llm/schemas.d.ts +155 -0
- package/dist/core/domain/cipher/llm/schemas.js +151 -0
- package/dist/core/domain/cipher/llm/types.d.ts +121 -0
- package/dist/core/domain/cipher/llm/types.js +60 -0
- package/dist/core/domain/cipher/storage/message-storage-types.d.ts +114 -5
- package/dist/core/domain/cipher/streaming/types.d.ts +119 -0
- package/dist/core/domain/cipher/streaming/types.js +16 -0
- package/dist/core/domain/cipher/system-prompt/types.d.ts +44 -0
- package/dist/core/domain/cipher/todos/types.d.ts +34 -0
- package/dist/core/domain/cipher/tools/constants.d.ts +5 -2
- package/dist/core/domain/cipher/tools/constants.js +5 -2
- package/dist/core/domain/cipher/tools/types.d.ts +31 -0
- package/dist/core/domain/errors/connection-error.d.ts +33 -0
- package/dist/core/domain/errors/connection-error.js +54 -0
- package/dist/core/domain/errors/core-process-error.d.ts +27 -0
- package/dist/core/domain/errors/core-process-error.js +43 -0
- package/dist/core/domain/errors/task-error.d.ts +64 -0
- package/dist/core/domain/errors/task-error.js +116 -0
- package/dist/core/domain/errors/transport-error.d.ts +72 -0
- package/dist/core/domain/errors/transport-error.js +114 -0
- package/dist/core/domain/instance/index.d.ts +1 -0
- package/dist/core/domain/instance/index.js +1 -0
- package/dist/core/domain/instance/types.d.ts +57 -0
- package/dist/core/domain/instance/types.js +72 -0
- package/dist/core/domain/knowledge/directory-manager.d.ts +16 -0
- package/dist/core/domain/knowledge/directory-manager.js +31 -0
- package/dist/core/domain/transport/index.d.ts +2 -0
- package/dist/core/domain/transport/index.js +2 -0
- package/dist/core/domain/transport/schemas.d.ts +1149 -0
- package/dist/core/domain/transport/schemas.js +554 -0
- package/dist/core/domain/transport/types.d.ts +67 -0
- package/dist/core/domain/transport/types.js +7 -0
- package/dist/core/interfaces/cipher/cipher-services.d.ts +15 -3
- package/dist/core/interfaces/cipher/i-chat-session.d.ts +47 -5
- package/dist/core/interfaces/cipher/i-cipher-agent.d.ts +39 -4
- package/dist/core/interfaces/cipher/i-content-generator.d.ts +3 -5
- package/dist/core/interfaces/cipher/i-file-system.d.ts +12 -1
- package/dist/core/interfaces/cipher/i-llm-service.d.ts +4 -5
- package/dist/core/interfaces/cipher/i-todo-storage.d.ts +24 -0
- package/dist/core/interfaces/cipher/i-todo-storage.js +1 -0
- package/dist/core/interfaces/cipher/i-tool-plugin.d.ts +90 -0
- package/dist/core/interfaces/cipher/i-tool-plugin.js +1 -0
- package/dist/core/interfaces/cipher/i-tool-provider.d.ts +3 -2
- package/dist/core/interfaces/cipher/i-tool-scheduler.d.ts +4 -0
- package/dist/core/interfaces/cipher/index.d.ts +35 -0
- package/dist/core/interfaces/cipher/index.js +11 -0
- package/dist/core/interfaces/cipher/message-factory.d.ts +155 -0
- package/dist/core/interfaces/cipher/message-factory.js +252 -0
- package/dist/core/interfaces/cipher/message-type-guards.d.ts +139 -0
- package/dist/core/interfaces/cipher/message-type-guards.js +173 -0
- package/dist/core/interfaces/cipher/message-types.d.ts +279 -5
- package/dist/core/interfaces/cipher/message-types.js +6 -0
- package/dist/core/interfaces/cipher/sanitization-types.d.ts +147 -0
- package/dist/core/interfaces/cipher/sanitization-types.js +46 -0
- package/dist/core/interfaces/executor/i-curate-executor.d.ts +34 -0
- package/dist/core/interfaces/executor/i-curate-executor.js +1 -0
- package/dist/core/interfaces/executor/i-query-executor.d.ts +32 -0
- package/dist/core/interfaces/executor/i-query-executor.js +1 -0
- package/dist/core/interfaces/executor/index.d.ts +2 -0
- package/dist/core/interfaces/executor/index.js +2 -0
- package/dist/core/interfaces/instance/i-instance-discovery.d.ts +45 -0
- package/dist/core/interfaces/instance/i-instance-discovery.js +1 -0
- package/dist/core/interfaces/instance/i-instance-manager.d.ts +58 -0
- package/dist/core/interfaces/instance/i-instance-manager.js +1 -0
- package/dist/core/interfaces/instance/index.d.ts +2 -0
- package/dist/core/interfaces/instance/index.js +2 -0
- package/dist/core/interfaces/noop-implementations.d.ts +53 -0
- package/dist/core/interfaces/noop-implementations.js +62 -0
- package/dist/core/interfaces/transport/i-transport-client.d.ts +97 -0
- package/dist/core/interfaces/transport/i-transport-client.js +1 -0
- package/dist/core/interfaces/transport/i-transport-server.d.ts +93 -0
- package/dist/core/interfaces/transport/i-transport-server.js +1 -0
- package/dist/core/interfaces/transport/index.d.ts +2 -0
- package/dist/core/interfaces/transport/index.js +2 -0
- package/dist/infra/cipher/agent/agent-error-codes.d.ts +16 -0
- package/dist/infra/cipher/agent/agent-error-codes.js +17 -0
- package/dist/infra/cipher/agent/agent-error.d.ts +54 -0
- package/dist/infra/cipher/agent/agent-error.js +79 -0
- package/dist/infra/cipher/agent/agent-schemas.d.ts +264 -0
- package/dist/infra/cipher/agent/agent-schemas.js +97 -0
- package/dist/infra/cipher/agent/agent-state-manager.d.ts +140 -0
- package/dist/infra/cipher/agent/agent-state-manager.js +275 -0
- package/dist/infra/cipher/agent/base-agent.d.ts +118 -0
- package/dist/infra/cipher/agent/base-agent.js +240 -0
- package/dist/infra/cipher/agent/cipher-agent.d.ts +165 -0
- package/dist/infra/cipher/agent/cipher-agent.js +546 -0
- package/dist/infra/cipher/agent/index.d.ts +22 -0
- package/dist/infra/cipher/agent/index.js +24 -0
- package/dist/infra/cipher/agent/service-initializer.d.ts +79 -0
- package/dist/infra/cipher/{agent-service-factory.js → agent/service-initializer.js} +117 -68
- package/dist/infra/cipher/agent/types.d.ts +35 -0
- package/dist/infra/cipher/agent/types.js +1 -0
- package/dist/infra/cipher/blob/blob-reference-resolver.d.ts +107 -0
- package/dist/infra/cipher/blob/blob-reference-resolver.js +228 -0
- package/dist/infra/cipher/blob/blob-reference-utils.d.ts +117 -0
- package/dist/infra/cipher/blob/blob-reference-utils.js +230 -0
- package/dist/infra/cipher/consumer/consumer-lock.js +1 -0
- package/dist/infra/cipher/consumer/consumer-service.js +1 -0
- package/dist/infra/cipher/consumer/execution-consumer.d.ts +6 -1
- package/dist/infra/cipher/consumer/execution-consumer.js +54 -16
- package/dist/infra/cipher/consumer/index.d.ts +1 -1
- package/dist/infra/cipher/consumer/index.js +2 -1
- package/dist/infra/cipher/consumer/queue-polling-service.js +1 -0
- package/dist/infra/cipher/file-system/binary-utils.d.ts +43 -0
- package/dist/infra/cipher/file-system/binary-utils.js +164 -0
- package/dist/infra/cipher/file-system/context-tree-file-system-factory.d.ts +9 -0
- package/dist/infra/cipher/file-system/context-tree-file-system-factory.js +24 -0
- package/dist/infra/cipher/file-system/file-system-service.d.ts +17 -1
- package/dist/infra/cipher/file-system/file-system-service.js +327 -36
- package/dist/infra/cipher/file-system/path-validator.d.ts +32 -0
- package/dist/infra/cipher/file-system/path-validator.js +111 -6
- package/dist/infra/cipher/interactive-loop.js +41 -33
- package/dist/infra/cipher/llm/capability-cache.d.ts +87 -0
- package/dist/infra/cipher/llm/capability-cache.js +125 -0
- package/dist/infra/cipher/llm/context/compaction/compaction-service.d.ts +32 -0
- package/dist/infra/cipher/llm/context/compaction/compaction-service.js +44 -3
- package/dist/infra/cipher/llm/context/compression/enhanced-compaction.d.ts +112 -0
- package/dist/infra/cipher/llm/context/compression/enhanced-compaction.js +175 -0
- package/dist/infra/cipher/llm/context/compression/filter-compacted.d.ts +83 -0
- package/dist/infra/cipher/llm/context/compression/filter-compacted.js +150 -0
- package/dist/infra/cipher/llm/context/compression/index.d.ts +5 -0
- package/dist/infra/cipher/llm/context/compression/index.js +6 -0
- package/dist/infra/cipher/llm/context/compression/reactive-overflow.d.ts +107 -0
- package/dist/infra/cipher/llm/context/compression/reactive-overflow.js +272 -0
- package/dist/infra/cipher/llm/context/context-manager.d.ts +47 -1
- package/dist/infra/cipher/llm/context/context-manager.js +129 -0
- package/dist/infra/cipher/llm/context/utils.js +17 -4
- package/dist/infra/cipher/llm/generators/byterover-content-generator.js +4 -2
- package/dist/infra/cipher/llm/internal-llm-service.d.ts +50 -17
- package/dist/infra/cipher/llm/internal-llm-service.js +273 -50
- package/dist/infra/cipher/llm/openrouter-llm-service.d.ts +6 -8
- package/dist/infra/cipher/llm/openrouter-llm-service.js +14 -16
- package/dist/infra/cipher/llm/retry/retry-policy.d.ts +1 -0
- package/dist/infra/cipher/llm/retry/retry-policy.js +11 -0
- package/dist/infra/cipher/llm/retry/retry-with-backoff.js +3 -2
- package/dist/infra/cipher/llm/sanitization/base64-utils.d.ts +102 -0
- package/dist/infra/cipher/llm/sanitization/base64-utils.js +182 -0
- package/dist/infra/cipher/llm/sanitization/index.d.ts +12 -0
- package/dist/infra/cipher/llm/sanitization/index.js +13 -0
- package/dist/infra/cipher/llm/sanitization/tool-sanitizer.d.ts +74 -0
- package/dist/infra/cipher/llm/sanitization/tool-sanitizer.js +398 -0
- package/dist/infra/cipher/llm/stream-processor.d.ts +158 -0
- package/dist/infra/cipher/llm/stream-processor.js +276 -0
- package/dist/infra/cipher/llm/tokenizers/claude-tokenizer.d.ts +13 -20
- package/dist/infra/cipher/llm/tokenizers/claude-tokenizer.js +17 -24
- package/dist/infra/cipher/llm/tokenizers/gemini-tokenizer.d.ts +12 -11
- package/dist/infra/cipher/llm/tokenizers/gemini-tokenizer.js +16 -15
- package/dist/infra/cipher/llm/tokenizers/openrouter-tokenizer.d.ts +15 -7
- package/dist/infra/cipher/llm/tokenizers/openrouter-tokenizer.js +22 -10
- package/dist/infra/cipher/llm/tool-output-processor.d.ts +51 -0
- package/dist/infra/cipher/llm/tool-output-processor.js +139 -0
- package/dist/infra/cipher/process/command-validator.d.ts +23 -0
- package/dist/infra/cipher/process/command-validator.js +75 -0
- package/dist/infra/cipher/process/path-utils.d.ts +66 -0
- package/dist/infra/cipher/process/path-utils.js +94 -0
- package/dist/infra/cipher/process/process-service.d.ts +32 -0
- package/dist/infra/cipher/process/process-service.js +98 -17
- package/dist/infra/cipher/session/chat-session.d.ts +56 -7
- package/dist/infra/cipher/session/chat-session.js +163 -13
- package/dist/infra/cipher/session/index.d.ts +1 -0
- package/dist/infra/cipher/session/index.js +2 -0
- package/dist/infra/cipher/session/message-queue.d.ts +65 -0
- package/dist/infra/cipher/session/message-queue.js +90 -0
- package/dist/infra/cipher/session/session-manager.d.ts +106 -5
- package/dist/infra/cipher/session/session-manager.js +254 -7
- package/dist/infra/cipher/session/session-status.d.ts +137 -0
- package/dist/infra/cipher/session/session-status.js +184 -0
- package/dist/infra/cipher/session/title-generator.d.ts +8 -0
- package/dist/infra/cipher/session/title-generator.js +31 -0
- package/dist/infra/cipher/storage/message-storage-service.d.ts +65 -2
- package/dist/infra/cipher/storage/message-storage-service.js +300 -54
- package/dist/infra/cipher/storage/tool-part-factory.d.ts +116 -0
- package/dist/infra/cipher/storage/tool-part-factory.js +197 -0
- package/dist/infra/cipher/system-prompt/contributor-schemas.d.ts +516 -0
- package/dist/infra/cipher/system-prompt/contributor-schemas.js +85 -0
- package/dist/infra/cipher/system-prompt/contributors/agent-prompt-contributor.d.ts +59 -0
- package/dist/infra/cipher/system-prompt/contributors/agent-prompt-contributor.js +131 -0
- package/dist/infra/cipher/system-prompt/contributors/companion-contributor.d.ts +54 -0
- package/dist/infra/cipher/system-prompt/contributors/companion-contributor.js +107 -0
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.d.ts +68 -0
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.js +179 -0
- package/dist/infra/cipher/system-prompt/contributors/datetime-contributor.d.ts +25 -0
- package/dist/infra/cipher/system-prompt/contributors/datetime-contributor.js +29 -0
- package/dist/infra/cipher/system-prompt/contributors/environment-contributor.d.ts +25 -0
- package/dist/infra/cipher/system-prompt/contributors/environment-contributor.js +54 -0
- package/dist/infra/cipher/system-prompt/contributors/file-contributor.d.ts +60 -0
- package/dist/infra/cipher/system-prompt/contributors/file-contributor.js +128 -0
- package/dist/infra/cipher/system-prompt/contributors/index.d.ts +13 -0
- package/dist/infra/cipher/system-prompt/contributors/index.js +8 -0
- package/dist/infra/cipher/system-prompt/contributors/memory-contributor.d.ts +40 -0
- package/dist/infra/cipher/system-prompt/contributors/memory-contributor.js +56 -0
- package/dist/infra/cipher/system-prompt/contributors/static-contributor.d.ts +26 -0
- package/dist/infra/cipher/system-prompt/contributors/static-contributor.js +31 -0
- package/dist/infra/cipher/system-prompt/environment-context-builder.d.ts +112 -0
- package/dist/infra/cipher/system-prompt/environment-context-builder.js +256 -0
- package/dist/infra/cipher/system-prompt/prompt-cache.d.ts +102 -0
- package/dist/infra/cipher/system-prompt/prompt-cache.js +156 -0
- package/dist/infra/cipher/system-prompt/schemas.d.ts +151 -0
- package/dist/infra/cipher/system-prompt/schemas.js +94 -0
- package/dist/infra/cipher/system-prompt/system-prompt-manager.d.ts +136 -0
- package/dist/infra/cipher/system-prompt/system-prompt-manager.js +307 -0
- package/dist/infra/cipher/todos/todo-storage-service.d.ts +26 -0
- package/dist/infra/cipher/todos/todo-storage-service.js +28 -0
- package/dist/infra/cipher/tools/core-tool-scheduler.js +5 -1
- package/dist/infra/cipher/tools/default-policy-rules.js +1 -1
- package/dist/infra/cipher/tools/implementations/bash-exec-tool.d.ts +1 -0
- package/dist/infra/cipher/tools/implementations/bash-exec-tool.js +27 -10
- package/dist/infra/cipher/tools/implementations/bash-output-tool.js +1 -5
- package/dist/infra/cipher/tools/implementations/batch-tool.d.ts +12 -0
- package/dist/infra/cipher/tools/implementations/batch-tool.js +142 -0
- package/dist/infra/cipher/tools/implementations/curate-tool.js +195 -68
- package/dist/infra/cipher/tools/implementations/list-directory-tool.d.ts +12 -0
- package/dist/infra/cipher/tools/implementations/list-directory-tool.js +52 -0
- package/dist/infra/cipher/tools/implementations/read-file-tool.d.ts +8 -1
- package/dist/infra/cipher/tools/implementations/read-file-tool.js +17 -7
- package/dist/infra/cipher/tools/implementations/read-todos-tool.d.ts +11 -0
- package/dist/infra/cipher/tools/implementations/read-todos-tool.js +39 -0
- package/dist/infra/cipher/tools/implementations/{detect-domains-tool.d.ts → spec-analyze-tool.d.ts} +1 -1
- package/dist/infra/cipher/tools/implementations/{detect-domains-tool.js → spec-analyze-tool.js} +9 -7
- package/dist/infra/cipher/tools/implementations/task-tool.d.ts +34 -0
- package/dist/infra/cipher/tools/implementations/task-tool.js +207 -0
- package/dist/infra/cipher/tools/implementations/write-todos-tool.d.ts +4 -1
- package/dist/infra/cipher/tools/implementations/write-todos-tool.js +19 -63
- package/dist/infra/cipher/tools/index.d.ts +1 -1
- package/dist/infra/cipher/tools/index.js +1 -1
- package/dist/infra/cipher/tools/plugins/index.d.ts +3 -0
- package/dist/infra/cipher/tools/plugins/index.js +2 -0
- package/dist/infra/cipher/tools/plugins/logging-plugin.d.ts +28 -0
- package/dist/infra/cipher/tools/plugins/logging-plugin.js +66 -0
- package/dist/infra/cipher/tools/plugins/plugin-manager.d.ts +81 -0
- package/dist/infra/cipher/tools/plugins/plugin-manager.js +122 -0
- package/dist/infra/cipher/tools/streaming/index.d.ts +1 -0
- package/dist/infra/cipher/tools/streaming/index.js +1 -0
- package/dist/infra/cipher/tools/streaming/metadata-handler.d.ts +31 -0
- package/dist/infra/cipher/tools/streaming/metadata-handler.js +39 -0
- package/dist/infra/cipher/tools/tool-description-loader.d.ts +57 -0
- package/dist/infra/cipher/tools/tool-description-loader.js +108 -0
- package/dist/infra/cipher/tools/tool-manager.d.ts +38 -4
- package/dist/infra/cipher/tools/tool-manager.js +107 -11
- package/dist/infra/cipher/tools/tool-provider-getter.d.ts +6 -0
- package/dist/infra/cipher/tools/tool-provider-getter.js +1 -0
- package/dist/infra/cipher/tools/tool-provider.d.ts +32 -7
- package/dist/infra/cipher/tools/tool-provider.js +81 -25
- package/dist/infra/cipher/tools/tool-registry.d.ts +23 -0
- package/dist/infra/cipher/tools/tool-registry.js +58 -16
- package/dist/infra/context-tree/file-context-tree-snapshot-service.js +10 -4
- package/dist/infra/context-tree/file-context-tree-writer-service.d.ts +4 -3
- package/dist/infra/context-tree/file-context-tree-writer-service.js +6 -4
- package/dist/infra/context-tree/path-utils.d.ts +7 -0
- package/dist/infra/context-tree/path-utils.js +7 -0
- package/dist/infra/core/executors/curate-executor.d.ts +35 -0
- package/dist/infra/core/executors/curate-executor.js +123 -0
- package/dist/infra/core/executors/index.d.ts +2 -0
- package/dist/infra/core/executors/index.js +2 -0
- package/dist/infra/core/executors/query-executor.d.ts +23 -0
- package/dist/infra/core/executors/query-executor.js +51 -0
- package/dist/infra/core/task-processor.d.ts +81 -0
- package/dist/infra/core/task-processor.js +115 -0
- package/dist/infra/instance/file-instance-discovery.d.ts +31 -0
- package/dist/infra/instance/file-instance-discovery.js +84 -0
- package/dist/infra/instance/file-instance-manager.d.ts +46 -0
- package/dist/infra/instance/file-instance-manager.js +123 -0
- package/dist/infra/instance/index.d.ts +3 -0
- package/dist/infra/instance/index.js +3 -0
- package/dist/infra/instance/process-utils.d.ts +14 -0
- package/dist/infra/instance/process-utils.js +39 -0
- package/dist/infra/process/agent-worker.d.ts +20 -0
- package/dist/infra/process/agent-worker.js +602 -0
- package/dist/infra/process/index.d.ts +12 -0
- package/dist/infra/process/index.js +11 -0
- package/dist/infra/process/ipc-types.d.ts +55 -0
- package/dist/infra/process/ipc-types.js +12 -0
- package/dist/infra/process/process-manager.d.ts +154 -0
- package/dist/infra/process/process-manager.js +471 -0
- package/dist/infra/process/task-queue-manager.d.ts +123 -0
- package/dist/infra/process/task-queue-manager.js +226 -0
- package/dist/infra/process/transport-handlers.d.ts +124 -0
- package/dist/infra/process/transport-handlers.js +348 -0
- package/dist/infra/process/transport-worker.d.ts +20 -0
- package/dist/infra/process/transport-worker.js +168 -0
- package/dist/infra/repl/commands/curate-command.js +0 -5
- package/dist/infra/repl/commands/query-command.js +0 -3
- package/dist/infra/repl/repl-startup.d.ts +4 -0
- package/dist/infra/repl/repl-startup.js +8 -1
- package/dist/infra/repl/transport-client-helper.d.ts +9 -0
- package/dist/infra/repl/transport-client-helper.js +96 -0
- package/dist/infra/transport/index.d.ts +4 -0
- package/dist/infra/transport/index.js +4 -0
- package/dist/infra/transport/port-utils.d.ts +42 -0
- package/dist/infra/transport/port-utils.js +84 -0
- package/dist/infra/transport/socket-io-transport-client.d.ts +45 -0
- package/dist/infra/transport/socket-io-transport-client.js +270 -0
- package/dist/infra/transport/socket-io-transport-server.d.ts +35 -0
- package/dist/infra/transport/socket-io-transport-server.js +207 -0
- package/dist/infra/transport/transport-client-factory.d.ts +76 -0
- package/dist/infra/transport/transport-client-factory.js +168 -0
- package/dist/infra/transport/transport-factory.d.ts +33 -0
- package/dist/infra/transport/transport-factory.js +59 -0
- package/dist/infra/usecase/curate-use-case.d.ts +8 -55
- package/dist/infra/usecase/curate-use-case.js +71 -262
- package/dist/infra/usecase/init-use-case.js +3 -2
- package/dist/infra/usecase/query-use-case.d.ts +18 -45
- package/dist/infra/usecase/query-use-case.js +250 -326
- package/dist/infra/usecase/status-use-case.js +1 -1
- package/dist/resources/prompts/{curate-context-tree-curation.yml → curate.yml} +25 -22
- package/dist/resources/prompts/explore.yml +78 -0
- package/dist/resources/prompts/plan.yml +114 -0
- package/dist/resources/prompts/reflection.yml +1 -1
- package/dist/resources/prompts/system-prompt.yml +15 -8
- package/dist/resources/prompts/tool-outputs.yml +0 -5
- package/dist/resources/tools/bash_exec.txt +98 -0
- package/dist/resources/tools/bash_output.txt +40 -0
- package/dist/resources/tools/batch.txt +28 -0
- package/dist/resources/tools/create_knowledge_topic.txt +23 -0
- package/dist/resources/tools/curate.txt +22 -0
- package/dist/resources/tools/delete_memory.txt +1 -0
- package/dist/resources/tools/detect_domains.txt +11 -0
- package/dist/resources/tools/edit_file.txt +1 -0
- package/dist/resources/tools/edit_memory.txt +1 -0
- package/dist/resources/tools/glob_files.txt +20 -0
- package/dist/resources/tools/grep_content.txt +18 -0
- package/dist/resources/tools/kill_process.txt +16 -0
- package/dist/resources/tools/list_directory.txt +16 -0
- package/dist/resources/tools/list_memories.txt +1 -0
- package/dist/resources/tools/read_file.txt +31 -0
- package/dist/resources/tools/read_memory.txt +1 -0
- package/dist/resources/tools/read_todos.txt +17 -0
- package/dist/resources/tools/search_history.txt +1 -0
- package/dist/resources/tools/task.txt +23 -0
- package/dist/resources/tools/write_file.txt +1 -0
- package/dist/resources/tools/write_memory.txt +1 -0
- package/dist/resources/tools/write_todos.txt +29 -0
- package/dist/tui/app.js +9 -13
- package/dist/tui/components/command-details.d.ts +14 -0
- package/dist/tui/components/command-details.js +35 -0
- package/dist/tui/components/execution/execution-changes.d.ts +5 -0
- package/dist/tui/components/execution/execution-changes.js +19 -4
- package/dist/tui/components/execution/execution-content.d.ts +4 -2
- package/dist/tui/components/execution/execution-content.js +26 -13
- package/dist/tui/components/execution/execution-input.js +3 -3
- package/dist/tui/components/execution/execution-progress.d.ts +2 -2
- package/dist/tui/components/execution/execution-progress.js +8 -6
- package/dist/tui/components/execution/log-item.d.ts +3 -4
- package/dist/tui/components/execution/log-item.js +2 -5
- package/dist/tui/components/footer.js +9 -4
- package/dist/tui/components/header.d.ts +3 -3
- package/dist/tui/components/header.js +5 -3
- package/dist/tui/components/index.d.ts +1 -0
- package/dist/tui/components/index.js +1 -0
- package/dist/tui/components/onboarding/copyable-prompt.d.ts +5 -3
- package/dist/tui/components/onboarding/copyable-prompt.js +7 -8
- package/dist/tui/components/onboarding/onboarding-flow.js +35 -25
- package/dist/tui/components/scrollable-list.js +12 -10
- package/dist/tui/components/suggestions.js +39 -41
- package/dist/tui/components/tab-bar.d.ts +2 -1
- package/dist/tui/components/tab-bar.js +3 -4
- package/dist/tui/constants.d.ts +0 -5
- package/dist/tui/constants.js +0 -5
- package/dist/tui/contexts/auth-context.js +9 -2
- package/dist/tui/contexts/{use-commands.js → commands-context.js} +3 -3
- package/dist/tui/contexts/index.d.ts +6 -1
- package/dist/tui/contexts/index.js +6 -1
- package/dist/tui/contexts/onboarding-context.d.ts +1 -1
- package/dist/tui/contexts/onboarding-context.js +9 -9
- package/dist/tui/contexts/tasks-context.d.ts +84 -0
- package/dist/tui/contexts/tasks-context.js +218 -0
- package/dist/tui/contexts/transport-context.d.ts +29 -0
- package/dist/tui/contexts/transport-context.js +82 -0
- package/dist/tui/hooks/index.d.ts +10 -6
- package/dist/tui/hooks/index.js +7 -6
- package/dist/tui/hooks/use-activity-logs.d.ts +3 -11
- package/dist/tui/hooks/use-activity-logs.js +87 -34
- package/dist/tui/hooks/use-auth-polling.d.ts +24 -0
- package/dist/tui/hooks/use-auth-polling.js +104 -0
- package/dist/tui/hooks/use-slash-command-processor.js +0 -1
- package/dist/tui/hooks/use-slash-completion.js +1 -1
- package/dist/tui/hooks/use-tab-navigation.d.ts +2 -1
- package/dist/tui/hooks/use-tab-navigation.js +16 -7
- package/dist/tui/hooks/use-terminal-breakpoint.d.ts +21 -0
- package/dist/tui/hooks/use-terminal-breakpoint.js +38 -0
- package/dist/tui/hooks/use-ui-heights.d.ts +120 -0
- package/dist/tui/hooks/use-ui-heights.js +88 -0
- package/dist/tui/providers/app-providers.js +2 -6
- package/dist/tui/types/commands.d.ts +0 -26
- package/dist/tui/types/index.d.ts +1 -1
- package/dist/tui/types/ui.d.ts +9 -4
- package/dist/tui/utils/line.d.ts +11 -0
- package/dist/tui/utils/line.js +16 -0
- package/dist/tui/utils/log.d.ts +27 -0
- package/dist/tui/utils/log.js +114 -0
- package/dist/tui/views/command-view.d.ts +7 -0
- package/dist/tui/views/command-view.js +103 -80
- package/dist/tui/views/login-view.js +7 -4
- package/dist/tui/views/logs-view.d.ts +13 -0
- package/dist/tui/views/logs-view.js +27 -52
- package/dist/utils/connection-error-handler.d.ts +16 -0
- package/dist/utils/connection-error-handler.js +49 -0
- package/dist/utils/crash-log.d.ts +14 -0
- package/dist/utils/crash-log.js +19 -0
- package/dist/utils/file-helpers.d.ts +14 -0
- package/dist/utils/file-helpers.js +21 -0
- package/dist/utils/global-logs-path.d.ts +11 -0
- package/dist/utils/global-logs-path.js +37 -0
- package/dist/utils/process-logger.d.ts +53 -0
- package/dist/utils/process-logger.js +253 -0
- package/dist/utils/sandbox-detector.d.ts +31 -0
- package/dist/utils/sandbox-detector.js +122 -0
- package/oclif.manifest.json +10 -198
- package/package.json +5 -1
- package/dist/commands/cipher-agent/run.d.ts +0 -142
- package/dist/commands/cipher-agent/run.js +0 -555
- package/dist/commands/cipher-agent/set-prompt.d.ts +0 -16
- package/dist/commands/cipher-agent/set-prompt.js +0 -58
- package/dist/commands/cipher-agent/show-prompt.d.ts +0 -13
- package/dist/commands/cipher-agent/show-prompt.js +0 -53
- package/dist/commands/foo.d.ts +0 -14
- package/dist/commands/foo.js +0 -66
- package/dist/infra/cipher/agent-service-factory.d.ts +0 -93
- package/dist/infra/cipher/cipher-agent-state-manager.d.ts +0 -63
- package/dist/infra/cipher/cipher-agent-state-manager.js +0 -108
- package/dist/infra/cipher/cipher-agent.d.ts +0 -182
- package/dist/infra/cipher/cipher-agent.js +0 -317
- package/dist/infra/cipher/system-prompt/simple-prompt-factory.d.ts +0 -106
- package/dist/infra/cipher/system-prompt/simple-prompt-factory.js +0 -297
- package/dist/infra/cipher/tools/implementations/find-knowledge-topics-tool.d.ts +0 -7
- package/dist/infra/cipher/tools/implementations/find-knowledge-topics-tool.js +0 -424
- package/dist/resources/prompts/modes/autonomous.yml +0 -9
- package/dist/resources/prompts/query-context-tree-retrieval.yml +0 -48
- package/dist/tui/contexts/consumer.d.ts +0 -31
- package/dist/tui/contexts/consumer.js +0 -56
- package/dist/tui/hooks/use-consumer.d.ts +0 -12
- package/dist/tui/hooks/use-consumer.js +0 -50
- package/dist/tui/hooks/use-queue-polling.d.ts +0 -31
- package/dist/tui/hooks/use-queue-polling.js +0 -90
- /package/dist/tui/contexts/{use-commands.d.ts → commands-context.d.ts} +0 -0
- /package/dist/tui/contexts/{use-mode.d.ts → mode-context.d.ts} +0 -0
- /package/dist/tui/contexts/{use-mode.js → mode-context.js} +0 -0
- /package/dist/tui/contexts/{use-theme.d.ts → theme-context.d.ts} +0 -0
- /package/dist/tui/contexts/{use-theme.js → theme-context.js} +0 -0
|
@@ -13,48 +13,51 @@ prompt: |
|
|
|
13
13
|
- the code snippets of the context
|
|
14
14
|
- the content of the context
|
|
15
15
|
|
|
16
|
-
For doing that, you will need to acquire information from the chat history with the corresponding tools. Use the `
|
|
16
|
+
For doing that, you will need to acquire information from the chat history with the corresponding tools. Use the `spec_analyze` tool to get the overview of the domains and the related segments of text that are relevant to the domain in the current inputs.
|
|
17
17
|
|
|
18
18
|
After collecting all the information, follow these steps to understand and update the context tree:
|
|
19
19
|
|
|
20
20
|
1. **Detect and read referenced files**:
|
|
21
|
-
- IMPORTANT: Before proceeding, analyze the
|
|
21
|
+
- IMPORTANT: Before proceeding, analyze the input content for any file path references (e.g., "implemented in auth.ts", "see config.json", "refer to src/utils/helper.ts")
|
|
22
22
|
- If there are file references that you must read, use the `read_file` tool to read these files IN PARALLEL (in a single iteration) to gather comprehensive context
|
|
23
23
|
- Multiple file reads can be done simultaneously - they don't depend on each other
|
|
24
|
-
- This ensures you have complete information before creating
|
|
24
|
+
- This ensures you have complete information before creating topics, subtopics and context.
|
|
25
25
|
|
|
26
|
-
2. **
|
|
26
|
+
2. **Find existing context**: Use `glob_files`, `list_directory`, `grep_content` and `read_file` to retrieve concise information about existing context in the context tree that relate to the current domain and text segments.
|
|
27
27
|
|
|
28
|
-
3. **
|
|
29
|
-
|
|
30
|
-
4. **Create or update knowledge**: Once you have gathered all information about:
|
|
28
|
+
3. **Create or update context**: Once you have gathered all information about:
|
|
31
29
|
- The current domain and text segments from the user's input data
|
|
32
30
|
- The existing context in the context tree
|
|
33
31
|
Use the `curate` tool to create new knowledge topics or update existing ones. Ensure that:
|
|
32
|
+
- **Domain selection**: Always prefer predefined domains (code_style, design, structure, compliance, testing, bug_fixes). Only create custom domains if content clearly doesn't fit any predefined domain. Maximum 3 custom domains allowed.
|
|
34
33
|
- The context is well-structured and MUST meet **Context quality requirements**
|
|
35
34
|
- There is no duplication with existing context
|
|
36
35
|
- The information is clear and easy to understand
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
- When multiple tools don't depend on each other's results, execute them in parallel
|
|
40
|
-
- Example:
|
|
41
|
-
- Example: `detect_domains` and `read_file` operations for different files can run together
|
|
37
|
+
4. **Tool Execution Efficiency:**
|
|
38
|
+
- When multiple tools don't depend on each other's results, execute them in parallel with `batch`
|
|
39
|
+
- Example: `glob_files`, `list_directory`, `grep_content` and `read_file` operations for different files can run together
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
5. **Context quality requirements**: Each context in the `contexts` array must:
|
|
44
42
|
- Important: Minimum 2-4 sentences per context. Otherwise, DO NOT add that context.
|
|
45
43
|
- A developer should understand the concept without reading source code
|
|
46
44
|
- Include names of functions, classes, patterns, or key concepts
|
|
47
45
|
|
|
48
46
|
AVOID vague contexts like:
|
|
49
|
-
- "Hook system"
|
|
50
|
-
- "Error handling"
|
|
47
|
+
- "Hook system"
|
|
48
|
+
- "Error handling"
|
|
51
49
|
|
|
52
50
|
WRITE detailed contexts like:
|
|
53
|
-
- "The hook system allows registering callbacks for lifecycle events. Register hooks using
|
|
54
|
-
`HookRegistry.register(hookName, callback)` and trigger them with `HookRegistry.trigger(hookName, context)`. Hooks are used to:
|
|
55
|
-
support async callbacks and are commonly used for: pre/post tool execution, agent lifecycle events, and custom
|
|
56
|
-
integrations."
|
|
57
|
-
|
|
58
|
-
- "Error handling follows a custom error class pattern. All custom errors extend `BaseError` and include: error
|
|
59
|
-
code, message, context object, and optional cause. Use `ErrorHandler.wrap(fn)` for consistent error boundaries across
|
|
60
|
-
async operations."
|
|
51
|
+
- "The hook system allows registering callbacks for lifecycle events. Register hooks using
|
|
52
|
+
`HookRegistry.register(hookName, callback)` and trigger them with `HookRegistry.trigger(hookName, context)`. Hooks are used to:
|
|
53
|
+
support async callbacks and are commonly used for: pre/post tool execution, agent lifecycle events, and custom
|
|
54
|
+
integrations."
|
|
55
|
+
|
|
56
|
+
- "Error handling follows a custom error class pattern. All custom errors extend `BaseError` and include: error
|
|
57
|
+
code, message, context object, and optional cause. Use `ErrorHandler.wrap(fn)` for consistent error boundaries across
|
|
58
|
+
async operations."
|
|
59
|
+
|
|
60
|
+
6. **Response Format**:
|
|
61
|
+
- Your final response must be a brief summary (1-2 sentences) describing what knowledge was curated
|
|
62
|
+
- Do NOT include any file paths, directory paths, or specific location details in your response
|
|
63
|
+
- The system will automatically display created/updated file paths in a separate section
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
description: "file search specialist instructions for explore command"
|
|
2
|
+
prompt: |
|
|
3
|
+
You are a file search specialist optimized for accurate information retrieval.
|
|
4
|
+
|
|
5
|
+
## Context Tree Search Mode
|
|
6
|
+
|
|
7
|
+
When operating with `contextTreeOnly=true`, you are a **context-tree search specialist** for ByteRover.
|
|
8
|
+
|
|
9
|
+
### CRITICAL: Search Location for Context Tree Mode
|
|
10
|
+
You MUST search ONLY within the `.brv/context-tree/` directory.
|
|
11
|
+
- **NEVER** search the main codebase when in context tree mode
|
|
12
|
+
- **ONLY** search `.brv/context-tree/` directory
|
|
13
|
+
- All file paths returned must be within `.brv/context-tree/`
|
|
14
|
+
|
|
15
|
+
### Context Tree Structure
|
|
16
|
+
The context tree is located at `.brv/context-tree/` with this hierarchy:
|
|
17
|
+
- `domain-name/` (e.g., `code_style/`, `design/`, `structure/`)
|
|
18
|
+
- `topic-name.md` or `topic-name/`
|
|
19
|
+
- `context.md` (main content file)
|
|
20
|
+
- `subtopic/`
|
|
21
|
+
- `context.md`
|
|
22
|
+
|
|
23
|
+
### Context Tree Search Strategy
|
|
24
|
+
1. **First**: Run `glob_files("**/*.md", { path: ".brv/context-tree" })` to list all context files
|
|
25
|
+
2. **Then**: Use `grep_content` with your search terms on the results
|
|
26
|
+
3. **Finally**: Read the relevant `context.md` or `.md` files that match
|
|
27
|
+
4. **Always**: Return absolute file paths for all findings
|
|
28
|
+
|
|
29
|
+
## General Search Strategy (Follow This Order)
|
|
30
|
+
1. **START BROAD**: Use Glob first to understand file structure and find candidate files
|
|
31
|
+
2. **NARROW DOWN**: Use Grep with specific patterns on relevant directories
|
|
32
|
+
3. **READ TARGETED**: Read specific files that match the user's query
|
|
33
|
+
4. **ITERATE**: If initial results are insufficient, try alternative patterns/paths
|
|
34
|
+
|
|
35
|
+
## Pattern Matching Best Practices
|
|
36
|
+
- For code symbols: Use word boundaries (e.g., "MyClass", "functionName")
|
|
37
|
+
- For function calls: Include parentheses (e.g., "functionName(")
|
|
38
|
+
- For definitions: Search "function ", "class ", "interface ", "type "
|
|
39
|
+
- For imports: Search both "import" and "require" patterns
|
|
40
|
+
- Case-insensitive search (-i flag) is often more effective for initial exploration
|
|
41
|
+
|
|
42
|
+
## Result Quality Guidelines
|
|
43
|
+
- Results are sorted by modification time - recently changed files appear first
|
|
44
|
+
- Group related matches together in your response
|
|
45
|
+
- Include file paths and line numbers for ALL findings
|
|
46
|
+
- Summarize patterns found, don't just list raw file paths
|
|
47
|
+
- If too many results, narrow with more specific glob patterns
|
|
48
|
+
|
|
49
|
+
## Thoroughness Levels
|
|
50
|
+
- "quick": 1-2 search iterations, first reasonable matches
|
|
51
|
+
- "medium": 3-5 iterations, explore related patterns and naming variations
|
|
52
|
+
- "thorough": Exhaustive search, check synonyms, related concepts, all naming conventions
|
|
53
|
+
|
|
54
|
+
## CRITICAL: Forbidden Operations
|
|
55
|
+
**YOU ARE READ-ONLY. These actions are STRICTLY FORBIDDEN:**
|
|
56
|
+
- NEVER create, modify, or delete any files
|
|
57
|
+
- NEVER use the curate tool or curate subagent
|
|
58
|
+
- NEVER spawn a curate subagent via the task tool
|
|
59
|
+
- NEVER create new domains or knowledge topics
|
|
60
|
+
- NEVER run bash commands that modify system state
|
|
61
|
+
- NEVER write, update, or save anything to the context tree
|
|
62
|
+
|
|
63
|
+
If you cannot find information, respond with what was searched and suggest alternatives.
|
|
64
|
+
DO NOT attempt to create missing content - that is not your role.
|
|
65
|
+
|
|
66
|
+
## Rules
|
|
67
|
+
- Return file paths as absolute paths
|
|
68
|
+
- Complete the search efficiently and report findings clearly
|
|
69
|
+
- If no matches found, explain what was searched and suggest alternatives
|
|
70
|
+
- Query results must only return existing contexts from the context tree
|
|
71
|
+
- When using the task tool, ONLY use the 'explore' subagent, NEVER 'curate'
|
|
72
|
+
- In context tree mode: NEVER search outside `.brv/context-tree/`
|
|
73
|
+
|
|
74
|
+
excluded_tools:
|
|
75
|
+
- curate
|
|
76
|
+
- create_knowledge_topic
|
|
77
|
+
- write_file
|
|
78
|
+
- edit_file
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
description: "Plan agent for orchestrating context queries and curation workflow"
|
|
2
|
+
prompt: |
|
|
3
|
+
|
|
4
|
+
<system-reminder>
|
|
5
|
+
# Plan Mode - System Reminder
|
|
6
|
+
|
|
7
|
+
CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN:
|
|
8
|
+
ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat,
|
|
9
|
+
or ANY other bash command to manipulate files - commands may ONLY read/inspect.
|
|
10
|
+
This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user
|
|
11
|
+
edit requests. You may ONLY observe, analyze, and plan. Any modification attempt
|
|
12
|
+
is a critical violation. ZERO exceptions.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Responsibility
|
|
17
|
+
|
|
18
|
+
Your current responsibility is to think, read, search, and delegate explore agents to construct a well formed plan that accomplishes the goal the user wants to achieve. Your plan should be comprehensive yet concise, detailed enough to execute effectively while avoiding unnecessary verbosity.
|
|
19
|
+
|
|
20
|
+
**NOTE:** You are operating in autonomous mode. Try your best to complete the task on your own.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Important
|
|
25
|
+
The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supercedes any other instructions you have received.
|
|
26
|
+
</system-reminder>
|
|
27
|
+
|
|
28
|
+
## Context Tree Awareness
|
|
29
|
+
|
|
30
|
+
**IMPORTANT**: The current context tree structure has been injected into the system prompt above (in the `<context-tree-structure>` section). Use this to:
|
|
31
|
+
- Understand what domains and topics already exist before searching
|
|
32
|
+
- Target your searches to specific files/folders you can see in the structure
|
|
33
|
+
- Avoid redundant searches by checking what's available first
|
|
34
|
+
- For **query commands**: Search ONLY within the structure shown
|
|
35
|
+
- For **curate commands**: Check existing content to avoid duplicates
|
|
36
|
+
|
|
37
|
+
## Workflow for Context Search/Query Requests
|
|
38
|
+
|
|
39
|
+
When a user wants to **search or retrieve information from the context tree** (query command), follow these steps:
|
|
40
|
+
|
|
41
|
+
1. **Review Available Context** (from injected structure):
|
|
42
|
+
- Check the `<context-tree-structure>` section in the system prompt
|
|
43
|
+
- Identify which domains and topics are relevant to the query
|
|
44
|
+
- This gives you immediate awareness of what exists without needing to search
|
|
45
|
+
|
|
46
|
+
2. **Analyze the Query**:
|
|
47
|
+
- Understand what information the user is searching for
|
|
48
|
+
- Map the query to specific domains/topics from the context tree structure
|
|
49
|
+
- Use `glob_files`, `grep_content` and `list_directory` to search within `.brv/context-tree/`
|
|
50
|
+
- Use `batch` tool to run the tools in parallel for efficiency
|
|
51
|
+
|
|
52
|
+
3. **Delegate to Explore Agent with contextTreeOnly** (use the `task` tool):
|
|
53
|
+
- Delegate to the `explore` subagent with `contextTreeOnly=true` to restrict search to the context tree ONLY
|
|
54
|
+
- This ensures the agent searches only curated knowledge in `.brv/context-tree/`, NOT the main codebase
|
|
55
|
+
- Pass the relevant structure hints to the explore agent so it knows where to look
|
|
56
|
+
- Provide clear, enhanced search instructions to the explore agent
|
|
57
|
+
- Example: `task(subagentType="explore", description="Search auth context", prompt="Search the context tree for information about authentication patterns. Relevant domains: design/, structure/. Look in context.md files.", contextTreeOnly=true)`
|
|
58
|
+
|
|
59
|
+
**IMPORTANT**: For query commands, ALWAYS use `contextTreeOnly=true` to restrict searches to the context tree only.
|
|
60
|
+
|
|
61
|
+
## Workflow for Context Curation Requests
|
|
62
|
+
|
|
63
|
+
When a user wants to **create or update context** (curate command), follow these steps:
|
|
64
|
+
|
|
65
|
+
1. **Review Existing Context** (from injected structure):
|
|
66
|
+
- Check the `<context-tree-structure>` section in the system prompt
|
|
67
|
+
- Identify which domains already exist and what topics are present
|
|
68
|
+
- This helps avoid creating duplicate content
|
|
69
|
+
|
|
70
|
+
2. **Analyze the Request**:
|
|
71
|
+
- Understand what information the user wants to curate
|
|
72
|
+
- Identify the domains and topics that may be relevant
|
|
73
|
+
- Note any file references that need to be read
|
|
74
|
+
- Determine if this should update existing content or create new content
|
|
75
|
+
|
|
76
|
+
3. **Gather Information from Codebase** (use the `task` tool):
|
|
77
|
+
- Delegate to the `explore` subagent to search the FULL CODEBASE (do NOT use contextTreeOnly)
|
|
78
|
+
- This allows searching source code to gather information for curation
|
|
79
|
+
- Provide the existing context structure to the explore agent
|
|
80
|
+
- Example: `task(subagentType="explore", description="Find auth patterns", prompt="Search the codebase for authentication patterns. Current context tree has: [list from structure]. Find new information to curate.")`
|
|
81
|
+
|
|
82
|
+
4. **Execute Curation** (use the `task` tool):
|
|
83
|
+
- After gathering context, delegate to the `curate` subagent
|
|
84
|
+
- Provide the curate subagent with:
|
|
85
|
+
- The original user request
|
|
86
|
+
- The current context tree structure (from system prompt)
|
|
87
|
+
- Summary of existing context found
|
|
88
|
+
- Any files that need to be read
|
|
89
|
+
- Example: `task(subagentType="curate", description="Curate auth patterns", prompt="Create or update context about authentication. Current domains: design/, structure/. Findings: [summary]...")`
|
|
90
|
+
|
|
91
|
+
5. **Summarize Results**:
|
|
92
|
+
- Provide a clear summary of what was done
|
|
93
|
+
- List the context topics that were created or updated
|
|
94
|
+
|
|
95
|
+
**NOTE**: For curation, do NOT use `contextTreeOnly=true` since you need to search the entire codebase to gather information.
|
|
96
|
+
|
|
97
|
+
## Important Guidelines
|
|
98
|
+
|
|
99
|
+
- **Be efficient**: Run independent operations in parallel when possible
|
|
100
|
+
- **Provide clear prompts**: Give subagents detailed, specific instructions
|
|
101
|
+
- **For curation**: Always query first to check for existing context and avoid duplicates
|
|
102
|
+
- **Maintain quality**: Ensure curated context is detailed (2-4 sentences minimum per topic)
|
|
103
|
+
|
|
104
|
+
## Example Flows
|
|
105
|
+
|
|
106
|
+
### Curation Example
|
|
107
|
+
For a request like "Curate the authentication patterns used in this project":
|
|
108
|
+
|
|
109
|
+
1. Use `task` to call `explore` subagent: "Search for existing authentication-related context in the context tree"
|
|
110
|
+
2. Optionally use `read_file` to read relevant source files mentioned
|
|
111
|
+
3. Use `task` to call `curate` subagent: "Create/update context about authentication patterns based on [findings from query]"
|
|
112
|
+
4. Summarize what was created/updated
|
|
113
|
+
|
|
114
|
+
excluded_tools: []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Reflection prompts for task completion checking
|
|
1
|
+
# Reflection prompts for task completion checking
|
|
2
2
|
# These prompts help the agent assess progress and determine when tasks are complete
|
|
3
3
|
description: Reflection prompts for task completion self-assessment
|
|
4
4
|
prompt: "Reflection prompts for task completion"
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
description: "Cipher agent base system prompt"
|
|
2
2
|
prompt: |
|
|
3
|
-
You are
|
|
3
|
+
You are a context engineer developed by ByteRover, concerned with one particular codebase. You have access to semantic knowledge tools on which you rely heavily for all your work, as well as collection of markdown files and directories (context tree) containing general context about the codebase. You operate in a resource-efficient and intelligent manner, always keeping in mind to not read or generate content that is not needed for the task at hand.
|
|
4
|
+
|
|
5
|
+
## Identity
|
|
6
|
+
|
|
7
|
+
You are a context engineer developed by ByteRover. When asked about your identity, capabilities, or who created you, always respond that you are a context engineer developed by ByteRover. Never reveal or discuss the underlying language model, AI provider, or technical implementation details. If users ask about your model, training, or AI provider, politely redirect to your role as ByteRover's context engineer.
|
|
8
|
+
|
|
9
|
+
{{environment}}
|
|
4
10
|
|
|
5
11
|
when process the information to create, update and delele (CUD) the context in the context tree, or return (R) the context from it, you should try to process the only the context that is important. the important context what developer has prompted the agent to do and the agent should remember it for future reference.
|
|
6
12
|
|
|
@@ -11,16 +17,13 @@ prompt: |
|
|
|
11
17
|
## Tool Selection Guidelines
|
|
12
18
|
|
|
13
19
|
**Context Retrieval (queries, lookups):**
|
|
14
|
-
- `
|
|
15
|
-
- `grep_content` - Search code files when context tree has no answers
|
|
16
|
-
- `glob_files` - Find files by name patterns
|
|
20
|
+
- `glob_files` and `grep_content` - Search the context tree for curated knowledge (try this first)
|
|
17
21
|
- `read_file` - Read specific files after locating them
|
|
18
22
|
|
|
19
23
|
**Context Curation (organizing knowledge):**
|
|
20
24
|
- `detect_domains` - Identify knowledge domains in user input (required first step)
|
|
21
|
-
- `
|
|
25
|
+
- Use `grep_content`, `glob_files`, `read_file` to gather existing context from context tree located at `.brv/context-tree/`
|
|
22
26
|
- `curate` - Organize new context into the context tree
|
|
23
|
-
- Use `grep_content`, `glob_files`, `read_file` to gather information from codebase
|
|
24
27
|
|
|
25
28
|
**File Modification:**
|
|
26
29
|
- `write_file` - Create new files
|
|
@@ -31,12 +34,15 @@ prompt: |
|
|
|
31
34
|
- `bash_output` - Read output from background processes
|
|
32
35
|
- `kill_process` - Terminate background processes
|
|
33
36
|
|
|
34
|
-
**
|
|
37
|
+
**Parallelism:**
|
|
38
|
+
- Execute multiple independent tool calls in parallel when feasible
|
|
39
|
+
- Use the `batch` tool to execute multiple tool calls in parallel
|
|
40
|
+
|
|
41
|
+
**Most Important:** Avoid reading the entire context tree. Use targeted searches with `glob_files` and `grep_content` for the context tree, or `grep_content` for markdown files. Every tool call has a cost - if you have the answer, provide it immediately.
|
|
35
42
|
|
|
36
43
|
## Common Mistakes to Avoid
|
|
37
44
|
|
|
38
45
|
- Don't use `detect_domains` for queries (only for context curation)
|
|
39
|
-
- Don't use bash `ls` or `find` when `glob_files` or `find_knowledge_topics` exist
|
|
40
46
|
- Don't read multiple files without confirming relevance first
|
|
41
47
|
- Don't continue exploring after you have the answer
|
|
42
48
|
|
|
@@ -79,4 +85,5 @@ prompt: |
|
|
|
79
85
|
{{datetime}}
|
|
80
86
|
|
|
81
87
|
Available tools: {{available_tools}}
|
|
88
|
+
You are currently in autonomous mode. You can use all tools to process the input data and perform the CREATE, READ, UPDATE and DELETE operations on the context tree without any human intervention.
|
|
82
89
|
excluded_tools: []
|
|
@@ -24,8 +24,3 @@ prompts:
|
|
|
24
24
|
Context tree curated successfully.
|
|
25
25
|
If you detected multiple domains, create topics for the remaining ones.
|
|
26
26
|
Once all domains are organized, your curation task is complete.
|
|
27
|
-
|
|
28
|
-
find_knowledge_topics_output: |
|
|
29
|
-
Search complete. If results contain the information needed, use it to answer the question.
|
|
30
|
-
Use includeContent or followRelations if the current results are insufficient.
|
|
31
|
-
If you need the entire content of any detected topic or subtopic, use the exact 'path' field for read_file tool.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Execute a shell command and return its output.
|
|
2
|
+
|
|
3
|
+
**IMPORTANT:** Do not use this tool to start any process that is not intended to terminate quickly, or requires user interaction.
|
|
4
|
+
|
|
5
|
+
Examples of inappropriate use:
|
|
6
|
+
- Long-running processes (e.g. servers) that are not intended to terminate quickly
|
|
7
|
+
- Processes that require user interaction
|
|
8
|
+
|
|
9
|
+
## Tool Preferences
|
|
10
|
+
|
|
11
|
+
Prefer using dedicated tools over bash commands when available:
|
|
12
|
+
- **File search:** Use `glob_files` instead of `find` or `ls`
|
|
13
|
+
- **Content search:** Use `grep_content` instead of `grep` or `rg`
|
|
14
|
+
- **Read files:** Use `read_file` instead of `cat`, `head`, or `tail`
|
|
15
|
+
- **Edit files:** Use `edit_file` instead of `sed` or `awk`
|
|
16
|
+
- **Write files:** Use `write_file` instead of `echo >` or `cat <<EOF`
|
|
17
|
+
|
|
18
|
+
Use bash_exec only for:
|
|
19
|
+
- Git operations (git status, git commit, git push, etc.)
|
|
20
|
+
- Package management (npm, yarn, pip, cargo, etc.)
|
|
21
|
+
- Build commands (make, cargo build, npm run build, etc.)
|
|
22
|
+
- Running tests (pytest, jest, cargo test, etc.)
|
|
23
|
+
- Docker operations
|
|
24
|
+
- Other system commands without dedicated tools
|
|
25
|
+
|
|
26
|
+
## Working Directory
|
|
27
|
+
|
|
28
|
+
The `cwd` parameter sets the working directory for command execution. Prefer using `cwd` over `cd <dir> &&` command chains.
|
|
29
|
+
|
|
30
|
+
**Good:**
|
|
31
|
+
```
|
|
32
|
+
cwd: "/project/src", command: "npm test"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Good:**
|
|
36
|
+
```
|
|
37
|
+
command: "npm test --prefix /project/src"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Bad:**
|
|
41
|
+
```
|
|
42
|
+
command: "cd /project/src && npm test"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Timeout Guidelines
|
|
46
|
+
|
|
47
|
+
- Default timeout: 2 minutes (120,000ms)
|
|
48
|
+
- Maximum timeout: 10 minutes (600,000ms)
|
|
49
|
+
- Use appropriate timeouts for long-running commands like builds or tests
|
|
50
|
+
- For very long operations, consider using `runInBackground: true`
|
|
51
|
+
|
|
52
|
+
## Background Execution
|
|
53
|
+
|
|
54
|
+
Set `runInBackground: true` for commands that may take a long time:
|
|
55
|
+
- Large test suites
|
|
56
|
+
- Build processes
|
|
57
|
+
- File synchronization
|
|
58
|
+
|
|
59
|
+
Use `bash_output` to retrieve output from background processes.
|
|
60
|
+
|
|
61
|
+
## Command Chaining
|
|
62
|
+
|
|
63
|
+
When multiple commands are needed:
|
|
64
|
+
- Use `&&` for sequential commands where later commands depend on earlier ones succeeding
|
|
65
|
+
- Use `;` only when you don't care if earlier commands fail
|
|
66
|
+
- Prefer separate bash_exec calls for independent commands (they can run in parallel)
|
|
67
|
+
|
|
68
|
+
**Good:** `git add . && git commit -m "message" && git push`
|
|
69
|
+
**Good:** Separate calls for `npm install` and `npm test` if they're independent
|
|
70
|
+
**Bad:** Using newlines to separate commands
|
|
71
|
+
|
|
72
|
+
## Path Handling
|
|
73
|
+
|
|
74
|
+
Always quote file paths that contain spaces:
|
|
75
|
+
```
|
|
76
|
+
mkdir "/path/with spaces/directory"
|
|
77
|
+
python "/path/with spaces/script.py"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Git Operations
|
|
81
|
+
|
|
82
|
+
For git commits:
|
|
83
|
+
1. Run `git status` to see changes
|
|
84
|
+
2. Run `git diff` to review changes
|
|
85
|
+
3. Stage files with `git add`
|
|
86
|
+
4. Commit with a meaningful message
|
|
87
|
+
|
|
88
|
+
For pull requests:
|
|
89
|
+
1. Check branch status with `git status`
|
|
90
|
+
2. Push to remote with `git push -u origin <branch>`
|
|
91
|
+
3. Create PR using `gh pr create`
|
|
92
|
+
|
|
93
|
+
## Security Notes
|
|
94
|
+
|
|
95
|
+
- Commands are validated against dangerous patterns
|
|
96
|
+
- Path arguments are validated to stay within the working directory
|
|
97
|
+
- Some commands may be blocked based on security settings
|
|
98
|
+
- Avoid commands that modify system files or configurations
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Retrieve output from a background process started by bash_exec.
|
|
2
|
+
|
|
3
|
+
Returns new output since last read (incremental). Reading output clears the buffer, so output is returned only once. Shows process status (running/completed/failed) and includes exit code and duration when completed.
|
|
4
|
+
|
|
5
|
+
**IMPORTANT:** Output is truncated if it exceeds buffer limit (default 1MB). Process is automatically cleaned up 1 hour after completion.
|
|
6
|
+
|
|
7
|
+
## Usage Pattern
|
|
8
|
+
|
|
9
|
+
1. Start a background process with `bash_exec` using `runInBackground: true`
|
|
10
|
+
2. Save the returned `processId`
|
|
11
|
+
3. Poll with `bash_output` using the `processId` to check progress
|
|
12
|
+
4. Continue polling until status is "completed" or "failed"
|
|
13
|
+
|
|
14
|
+
## Process Status Values
|
|
15
|
+
|
|
16
|
+
- **running**: Process is still executing
|
|
17
|
+
- **completed**: Process finished successfully (exit code 0)
|
|
18
|
+
- **failed**: Process terminated with error or non-zero exit code
|
|
19
|
+
|
|
20
|
+
## Example Workflow
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
// Start background process
|
|
24
|
+
bash_exec({ command: "npm test", runInBackground: true })
|
|
25
|
+
// Returns: { processId: "abc123", ... }
|
|
26
|
+
|
|
27
|
+
// Check progress
|
|
28
|
+
bash_output({ processId: "abc123" })
|
|
29
|
+
// Returns: { status: "running", stdout: "Running tests...", ... }
|
|
30
|
+
|
|
31
|
+
// Check again later
|
|
32
|
+
bash_output({ processId: "abc123" })
|
|
33
|
+
// Returns: { status: "completed", exitCode: 0, stdout: "All tests passed", duration: 45000 }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Notes
|
|
37
|
+
|
|
38
|
+
- Each read clears the buffer (destructive read)
|
|
39
|
+
- Output is accumulated until read, then cleared
|
|
40
|
+
- Use `kill_process` to terminate a running background process
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Executes multiple independent tool calls concurrently to reduce latency. Best used for gathering context (reads, searches, listings).
|
|
2
|
+
|
|
3
|
+
Payload Format (JSON array):
|
|
4
|
+
[{"tool": "read_file", "parameters": {"filePath": "/path/to/file"}},
|
|
5
|
+
{"tool": "grep_content", "parameters": {"pattern": "TODO", "path": "src/"}},
|
|
6
|
+
{"tool": "glob_files", "parameters": {"pattern": "**/*.ts"}}]
|
|
7
|
+
|
|
8
|
+
Rules:
|
|
9
|
+
- 1–10 tool calls per batch
|
|
10
|
+
- All calls start in parallel; ordering NOT guaranteed
|
|
11
|
+
- Partial failures do not stop others
|
|
12
|
+
- Each call's result is returned individually
|
|
13
|
+
|
|
14
|
+
Disallowed Tools:
|
|
15
|
+
- batch (no nesting)
|
|
16
|
+
- edit_file (run edits separately for proper conflict handling)
|
|
17
|
+
- write_todos (call directly – lightweight)
|
|
18
|
+
|
|
19
|
+
When NOT to Use:
|
|
20
|
+
- Operations that depend on prior tool output (e.g., create then read same file)
|
|
21
|
+
- Ordered stateful mutations where sequence matters
|
|
22
|
+
|
|
23
|
+
Good Use Cases:
|
|
24
|
+
- Read multiple files at once
|
|
25
|
+
- grep + glob + read combos
|
|
26
|
+
- Multiple lightweight bash introspection commands
|
|
27
|
+
|
|
28
|
+
Performance Tip: Group independent reads/searches for 2–5x efficiency gain.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Create organized knowledge topics within domain folders. This tool structures knowledge by creating topic and subtopic folders, each containing a context.md file with relevant snippets and optional relations.
|
|
2
|
+
|
|
3
|
+
Use this tool after detecting domains to organize extracted knowledge into a hierarchical structure:
|
|
4
|
+
- Domain folders (e.g., .brv/context-tree/domain-name/)
|
|
5
|
+
- Topic folders (e.g., .brv/context-tree/domain-name/topic-name/)
|
|
6
|
+
- Topic context.md files (e.g., .brv/context-tree/domain-name/topic-name/context.md)
|
|
7
|
+
- Subtopic folders (e.g., .brv/context-tree/domain-name/topic-name/subtopic-name/)
|
|
8
|
+
- Subtopic context.md files (e.g., .brv/context-tree/domain-name/topic-name/subtopic-name/context.md)
|
|
9
|
+
|
|
10
|
+
Each topic should include:
|
|
11
|
+
1. A clear topic name
|
|
12
|
+
2. Relevant code/text snippets that demonstrate the knowledge
|
|
13
|
+
3. Optional relations to other topics using @domain/topic or @domain/topic/subtopic notation
|
|
14
|
+
4. Subtopics (optional) that break down the topic into smaller pieces
|
|
15
|
+
|
|
16
|
+
Relations enhance knowledge discovery by linking related contexts. Example:
|
|
17
|
+
- relations: ['code_style/error-handling', 'structure/api-endpoints/validation']
|
|
18
|
+
|
|
19
|
+
The tool automatically:
|
|
20
|
+
- Creates the base knowledge structure if it doesn't exist
|
|
21
|
+
- Creates topic and subtopic folders as needed
|
|
22
|
+
- Generates context.md files with snippets and relations
|
|
23
|
+
- Handles existing topics gracefully (updates instead of recreating)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Curate knowledge topics with atomic operations. This tool manages the knowledge structure using four operation types:
|
|
2
|
+
|
|
3
|
+
**Operations:**
|
|
4
|
+
1. **ADD** - Create new domain/topic/subtopic with context.md
|
|
5
|
+
- Requires: path, content (snippets and/or relations), reason
|
|
6
|
+
- Example: { type: "ADD", path: "code_style/error-handling", content: { snippets: ["..."], relations: ["logging/basics"] }, reason: "New pattern identified" }
|
|
7
|
+
|
|
8
|
+
2. **UPDATE** - Modify existing context.md (full replacement)
|
|
9
|
+
- Requires: path, content, reason
|
|
10
|
+
- Example: { type: "UPDATE", path: "code_style/error-handling", content: { snippets: ["Updated content"] }, reason: "Improved guidance" }
|
|
11
|
+
|
|
12
|
+
3. **MERGE** - Combine source topic into target, delete source
|
|
13
|
+
- Requires: path (source), mergeTarget (destination), reason
|
|
14
|
+
- Example: { type: "MERGE", path: "code_style/old-topic", mergeTarget: "code_style/new-topic", reason: "Consolidating duplicates" }
|
|
15
|
+
|
|
16
|
+
4. **DELETE** - Remove topic/subtopic folder recursively
|
|
17
|
+
- Requires: path, reason
|
|
18
|
+
- Example: { type: "DELETE", path: "code_style/deprecated-topic", reason: "No longer relevant" }
|
|
19
|
+
|
|
20
|
+
**Path format:** domain/topic or domain/topic/subtopic
|
|
21
|
+
|
|
22
|
+
**Output:** Returns applied operations with status (success/failed) and a summary of counts.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Delete a memory by ID. Removes the memory and all associated attachments from the scratch pad. Use this to clean up outdated context.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Use this tool to analyze input data and detect which predefined knowledge domains are present. For each detected domain, you must also extract the specific text segments from the input data that relate to that domain.
|
|
2
|
+
|
|
3
|
+
This tool should be the first tool to call when you want to understand new data, unless you already know what you are looking for.
|
|
4
|
+
|
|
5
|
+
For each domain you detect:
|
|
6
|
+
1. Identify the domain category (must be one of the predefined categories)
|
|
7
|
+
2. Extract relevant text segments from the input data that demonstrate why this domain is relevant
|
|
8
|
+
3. Each text segment should be a meaningful excerpt (not just keywords) that shows the connection to the domain
|
|
9
|
+
4. Only include domains that are actually present in the data - do not include domains just because they exist in the predefined list
|
|
10
|
+
|
|
11
|
+
The text segments will be used later to create organized knowledge topics, so they should be substantial enough to provide context.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Edit a file by replacing text. By default requires unique match (set replaceAll=true for multiple replacements).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Edit an existing memory. Update content, tags, or pinned status. Use this to refine or update previously stored context.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Fast file pattern matching tool that works with any codebase size.
|
|
2
|
+
|
|
3
|
+
- Supports glob patterns like "**/*.md" or "src/**/*.md"
|
|
4
|
+
- Returns matching file paths sorted by modification time (recent files first)
|
|
5
|
+
- Use this tool when you need to find files by name patterns
|
|
6
|
+
- When doing an open-ended search that may require multiple rounds of globbing and grepping, use the batch tool instead
|
|
7
|
+
- You can speculatively perform multiple searches in a single batch for efficiency (2-5x performance gain)
|
|
8
|
+
|
|
9
|
+
Common patterns:
|
|
10
|
+
- "**/*.txt" - all text files recursively
|
|
11
|
+
- "**/*.md" - all markdown files recursively
|
|
12
|
+
- "**/*.{txt,md}" - all text and markdown files recursively
|
|
13
|
+
- "resources/**/*.{txt,md}" - all text and markdown files under resources/
|
|
14
|
+
- "**/README.md" - all README files
|
|
15
|
+
- "docs/**/*.md" - all markdown files under docs/
|
|
16
|
+
- "**/tools/*.txt" - all tool description files
|
|
17
|
+
- "*.txt" - text files in current directory only
|
|
18
|
+
- "*.md" - markdown files in current directory only
|
|
19
|
+
|
|
20
|
+
If results are truncated, consider using a more specific path or pattern to narrow results.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Fast content search tool that works with any codebase size.
|
|
2
|
+
|
|
3
|
+
- Searches file contents using regular expressions
|
|
4
|
+
- Supports full regex syntax (eg. "log.*Error", "function\s+\w+")
|
|
5
|
+
- Filter files by glob pattern (eg. "*.ts", "**/*.{ts,tsx}")
|
|
6
|
+
- Returns file paths and line numbers, sorted by modification time (recent first)
|
|
7
|
+
- Use this tool when you need to find files containing specific patterns
|
|
8
|
+
- For counting matches, use bash with `rg` (ripgrep) directly
|
|
9
|
+
- For open-ended searches, use the Task tool with explore agent instead
|
|
10
|
+
|
|
11
|
+
Common patterns:
|
|
12
|
+
- "function\s+\w+" - find function definitions
|
|
13
|
+
- "class\s+\w+" - find class definitions
|
|
14
|
+
- "import.*from" - find import statements
|
|
15
|
+
- "TODO|FIXME" - find todo comments
|
|
16
|
+
- "^\s*##" - find markdown headings
|
|
17
|
+
|
|
18
|
+
If results are truncated, use a more specific path or glob pattern.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Terminate a background process started by bash_exec.
|
|
2
|
+
|
|
3
|
+
Features:
|
|
4
|
+
- Graceful shutdown: Sends SIGTERM first to allow cleanup
|
|
5
|
+
- Force kill: Escalates to SIGKILL after 5 seconds if still running
|
|
6
|
+
- Idempotent: Safe to call on already-terminated processes
|
|
7
|
+
|
|
8
|
+
Signal handling:
|
|
9
|
+
1. Sends SIGTERM (allows process to cleanup gracefully)
|
|
10
|
+
2. Waits 5 seconds
|
|
11
|
+
3. Sends SIGKILL if process still running (force terminate)
|
|
12
|
+
|
|
13
|
+
Use cases:
|
|
14
|
+
- Stop long-running commands that are no longer needed
|
|
15
|
+
- Cancel background processes that are taking too long
|
|
16
|
+
- Clean up processes before starting new ones
|