byterover-cli 1.0.4 → 1.1.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.
Files changed (172) hide show
  1. package/README.md +24 -11
  2. package/dist/commands/curate.js +1 -1
  3. package/dist/commands/hook-prompt-submit.d.ts +27 -0
  4. package/dist/commands/hook-prompt-submit.js +39 -0
  5. package/dist/commands/main.d.ts +13 -0
  6. package/dist/commands/main.js +53 -2
  7. package/dist/commands/query.js +1 -1
  8. package/dist/commands/status.js +8 -3
  9. package/dist/constants.d.ts +2 -2
  10. package/dist/constants.js +2 -2
  11. package/dist/core/domain/cipher/llm/registry.js +53 -2
  12. package/dist/core/domain/cipher/llm/types.d.ts +2 -0
  13. package/dist/core/domain/cipher/process/types.d.ts +7 -0
  14. package/dist/core/domain/cipher/session/session-metadata.d.ts +178 -0
  15. package/dist/core/domain/cipher/session/session-metadata.js +147 -0
  16. package/dist/core/domain/cipher/tools/constants.d.ts +1 -0
  17. package/dist/core/domain/cipher/tools/constants.js +1 -0
  18. package/dist/core/domain/entities/agent.d.ts +16 -0
  19. package/dist/core/domain/entities/agent.js +24 -0
  20. package/dist/core/domain/entities/connector-type.d.ts +9 -0
  21. package/dist/core/domain/entities/connector-type.js +8 -0
  22. package/dist/core/domain/entities/event.d.ts +1 -1
  23. package/dist/core/domain/entities/event.js +2 -0
  24. package/dist/core/domain/errors/task-error.d.ts +4 -0
  25. package/dist/core/domain/errors/task-error.js +7 -0
  26. package/dist/core/domain/knowledge/markdown-writer.d.ts +15 -18
  27. package/dist/core/domain/knowledge/markdown-writer.js +232 -34
  28. package/dist/core/domain/knowledge/relation-parser.d.ts +25 -39
  29. package/dist/core/domain/knowledge/relation-parser.js +39 -61
  30. package/dist/core/domain/transport/schemas.d.ts +77 -2
  31. package/dist/core/domain/transport/schemas.js +51 -2
  32. package/dist/core/interfaces/cipher/i-session-persistence.d.ts +133 -0
  33. package/dist/core/interfaces/cipher/i-session-persistence.js +7 -0
  34. package/dist/core/interfaces/cipher/message-types.d.ts +6 -0
  35. package/dist/core/interfaces/connectors/connector-types.d.ts +57 -0
  36. package/dist/core/interfaces/connectors/i-connector-manager.d.ts +72 -0
  37. package/dist/core/interfaces/connectors/i-connector.d.ts +54 -0
  38. package/dist/core/interfaces/connectors/i-connector.js +1 -0
  39. package/dist/core/interfaces/executor/i-curate-executor.d.ts +2 -2
  40. package/dist/core/interfaces/i-context-file-reader.d.ts +3 -0
  41. package/dist/core/interfaces/i-file-service.d.ts +7 -0
  42. package/dist/core/interfaces/usecase/i-connectors-use-case.d.ts +3 -0
  43. package/dist/core/interfaces/usecase/i-connectors-use-case.js +1 -0
  44. package/dist/core/interfaces/usecase/{i-clear-use-case.d.ts → i-reset-use-case.d.ts} +1 -1
  45. package/dist/core/interfaces/usecase/i-reset-use-case.js +1 -0
  46. package/dist/hooks/init/update-notifier.d.ts +1 -0
  47. package/dist/hooks/init/update-notifier.js +10 -1
  48. package/dist/infra/cipher/agent/agent-schemas.d.ts +6 -6
  49. package/dist/infra/cipher/agent/service-initializer.js +4 -4
  50. package/dist/infra/cipher/file-system/binary-utils.d.ts +7 -12
  51. package/dist/infra/cipher/file-system/binary-utils.js +46 -31
  52. package/dist/infra/cipher/file-system/context-tree-file-system-factory.js +3 -2
  53. package/dist/infra/cipher/file-system/file-system-service.js +1 -0
  54. package/dist/infra/cipher/http/internal-llm-http-service.js +3 -5
  55. package/dist/infra/cipher/interactive-loop.js +3 -1
  56. package/dist/infra/cipher/llm/context/context-manager.d.ts +2 -2
  57. package/dist/infra/cipher/llm/context/context-manager.js +63 -18
  58. package/dist/infra/cipher/llm/formatters/gemini-formatter.d.ts +13 -0
  59. package/dist/infra/cipher/llm/formatters/gemini-formatter.js +146 -15
  60. package/dist/infra/cipher/llm/generators/byterover-content-generator.js +6 -2
  61. package/dist/infra/cipher/llm/internal-llm-service.js +2 -2
  62. package/dist/infra/cipher/llm/thought-parser.d.ts +21 -0
  63. package/dist/infra/cipher/llm/thought-parser.js +27 -0
  64. package/dist/infra/cipher/llm/tool-output-processor.d.ts +10 -0
  65. package/dist/infra/cipher/llm/tool-output-processor.js +80 -7
  66. package/dist/infra/cipher/process/process-service.js +11 -3
  67. package/dist/infra/cipher/session/chat-session.d.ts +7 -2
  68. package/dist/infra/cipher/session/chat-session.js +90 -52
  69. package/dist/infra/cipher/session/session-metadata-store.d.ts +52 -0
  70. package/dist/infra/cipher/session/session-metadata-store.js +406 -0
  71. package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.d.ts +6 -7
  72. package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.js +57 -18
  73. package/dist/infra/cipher/tools/implementations/curate-tool.js +132 -36
  74. package/dist/infra/cipher/tools/implementations/read-file-tool.js +38 -17
  75. package/dist/infra/cipher/tools/implementations/search-knowledge-tool.d.ts +7 -0
  76. package/dist/infra/cipher/tools/implementations/search-knowledge-tool.js +303 -0
  77. package/dist/infra/cipher/tools/implementations/task-tool.js +1 -0
  78. package/dist/infra/cipher/tools/index.d.ts +1 -0
  79. package/dist/infra/cipher/tools/index.js +1 -0
  80. package/dist/infra/cipher/tools/tool-manager.js +1 -0
  81. package/dist/infra/cipher/tools/tool-registry.js +7 -0
  82. package/dist/infra/connectors/connector-manager.d.ts +32 -0
  83. package/dist/infra/connectors/connector-manager.js +156 -0
  84. package/dist/infra/connectors/hook/hook-connector-config.d.ts +52 -0
  85. package/dist/infra/connectors/hook/hook-connector-config.js +41 -0
  86. package/dist/infra/connectors/hook/hook-connector.d.ts +46 -0
  87. package/dist/infra/connectors/hook/hook-connector.js +231 -0
  88. package/dist/infra/{rule → connectors/rules}/legacy-rule-detector.d.ts +2 -2
  89. package/dist/infra/{rule → connectors/rules}/legacy-rule-detector.js +1 -1
  90. package/dist/infra/connectors/rules/rules-connector-config.d.ts +95 -0
  91. package/dist/infra/{rule/agent-rule-config.js → connectors/rules/rules-connector-config.js} +10 -10
  92. package/dist/infra/connectors/rules/rules-connector.d.ts +41 -0
  93. package/dist/infra/connectors/rules/rules-connector.js +204 -0
  94. package/dist/infra/{rule/rule-template-service.d.ts → connectors/shared/template-service.d.ts} +3 -3
  95. package/dist/infra/{rule/rule-template-service.js → connectors/shared/template-service.js} +1 -1
  96. package/dist/infra/context-tree/file-context-file-reader.js +4 -0
  97. package/dist/infra/context-tree/file-context-tree-writer-service.d.ts +5 -2
  98. package/dist/infra/context-tree/file-context-tree-writer-service.js +20 -5
  99. package/dist/infra/core/executors/curate-executor.d.ts +2 -2
  100. package/dist/infra/core/executors/curate-executor.js +7 -7
  101. package/dist/infra/core/executors/query-executor.d.ts +12 -0
  102. package/dist/infra/core/executors/query-executor.js +62 -1
  103. package/dist/infra/core/task-processor.d.ts +2 -2
  104. package/dist/infra/file/fs-file-service.d.ts +7 -0
  105. package/dist/infra/file/fs-file-service.js +15 -1
  106. package/dist/infra/process/agent-worker.d.ts +2 -2
  107. package/dist/infra/process/agent-worker.js +626 -142
  108. package/dist/infra/process/constants.d.ts +1 -1
  109. package/dist/infra/process/constants.js +1 -1
  110. package/dist/infra/process/ipc-types.d.ts +17 -4
  111. package/dist/infra/process/ipc-types.js +3 -3
  112. package/dist/infra/process/parent-heartbeat.d.ts +47 -0
  113. package/dist/infra/process/parent-heartbeat.js +118 -0
  114. package/dist/infra/process/process-manager.d.ts +89 -1
  115. package/dist/infra/process/process-manager.js +293 -9
  116. package/dist/infra/process/task-queue-manager.d.ts +13 -0
  117. package/dist/infra/process/task-queue-manager.js +19 -0
  118. package/dist/infra/process/transport-handlers.d.ts +3 -0
  119. package/dist/infra/process/transport-handlers.js +82 -5
  120. package/dist/infra/process/transport-worker.js +9 -69
  121. package/dist/infra/repl/commands/connectors-command.d.ts +8 -0
  122. package/dist/infra/repl/commands/{gen-rules-command.js → connectors-command.js} +21 -10
  123. package/dist/infra/repl/commands/index.js +8 -4
  124. package/dist/infra/repl/commands/init-command.js +11 -7
  125. package/dist/infra/repl/commands/new-command.d.ts +14 -0
  126. package/dist/infra/repl/commands/new-command.js +61 -0
  127. package/dist/infra/repl/commands/query-command.js +22 -2
  128. package/dist/infra/repl/commands/{clear-command.d.ts → reset-command.d.ts} +2 -2
  129. package/dist/infra/repl/commands/{clear-command.js → reset-command.js} +11 -11
  130. package/dist/infra/transport/socket-io-transport-client.d.ts +68 -0
  131. package/dist/infra/transport/socket-io-transport-client.js +283 -7
  132. package/dist/infra/usecase/connectors-use-case.d.ts +59 -0
  133. package/dist/infra/usecase/connectors-use-case.js +203 -0
  134. package/dist/infra/usecase/init-use-case.d.ts +8 -43
  135. package/dist/infra/usecase/init-use-case.js +29 -253
  136. package/dist/infra/usecase/logout-use-case.js +2 -2
  137. package/dist/infra/usecase/pull-use-case.js +5 -5
  138. package/dist/infra/usecase/push-use-case.js +5 -5
  139. package/dist/infra/usecase/{clear-use-case.d.ts → reset-use-case.d.ts} +5 -5
  140. package/dist/infra/usecase/{clear-use-case.js → reset-use-case.js} +7 -8
  141. package/dist/infra/usecase/space-list-use-case.js +3 -3
  142. package/dist/infra/usecase/space-switch-use-case.js +3 -3
  143. package/dist/resources/prompts/curate.yml +75 -13
  144. package/dist/resources/prompts/explore.yml +34 -0
  145. package/dist/resources/prompts/query-orchestrator.yml +112 -0
  146. package/dist/resources/prompts/system-prompt.yml +12 -2
  147. package/dist/resources/tools/curate.txt +60 -15
  148. package/dist/resources/tools/search_knowledge.txt +32 -0
  149. package/dist/templates/sections/brv-instructions.md +98 -0
  150. package/dist/tui/components/inline-prompts/inline-confirm.js +2 -2
  151. package/dist/tui/components/onboarding/onboarding-flow.js +14 -10
  152. package/dist/tui/components/onboarding/welcome-box.js +1 -1
  153. package/dist/tui/contexts/onboarding-context.d.ts +4 -0
  154. package/dist/tui/contexts/onboarding-context.js +14 -2
  155. package/dist/tui/views/command-view.js +19 -0
  156. package/dist/utils/file-validator.d.ts +1 -1
  157. package/dist/utils/file-validator.js +34 -35
  158. package/dist/utils/type-guards.d.ts +5 -0
  159. package/dist/utils/type-guards.js +7 -0
  160. package/oclif.manifest.json +32 -6
  161. package/package.json +4 -1
  162. package/dist/config/context-tree-domains.d.ts +0 -29
  163. package/dist/config/context-tree-domains.js +0 -29
  164. package/dist/core/interfaces/usecase/i-generate-rules-use-case.d.ts +0 -3
  165. package/dist/infra/repl/commands/gen-rules-command.d.ts +0 -7
  166. package/dist/infra/rule/agent-rule-config.d.ts +0 -19
  167. package/dist/infra/usecase/generate-rules-use-case.d.ts +0 -61
  168. package/dist/infra/usecase/generate-rules-use-case.js +0 -285
  169. /package/dist/core/interfaces/{usecase/i-clear-use-case.js → connectors/connector-types.js} +0 -0
  170. /package/dist/core/interfaces/{usecase/i-generate-rules-use-case.js → connectors/i-connector-manager.js} +0 -0
  171. /package/dist/infra/{rule → connectors/shared}/constants.d.ts +0 -0
  172. /package/dist/infra/{rule → connectors/shared}/constants.js +0 -0
@@ -1,6 +1,12 @@
1
1
  description: "context tree curation instructions"
2
2
  prompt: |
3
3
 
4
+ IMPORTANT: You are in EXECUTION mode. Execute all curate operations immediately and autonomously.
5
+ - Do NOT ask the user for confirmation before using the curate tool
6
+ - Do NOT ask "would you like me to update/create..." - just do it
7
+ - The user has already decided to curate by running this command
8
+ - Report what was done AFTER execution, not before
9
+
4
10
  Your task is to assemble relevant high-level information (context) from the input data which will be saved to the context tree in the following steps.
5
11
  Prioritize tool call efficiency - run independent tools in parallel whenever possible (in a single iteration).
6
12
 
@@ -10,8 +16,8 @@ prompt: |
10
16
  - the domains of the context (dynamically created based on content)
11
17
  - the topics of the context
12
18
  - the subtopics of the context (maximum one level under topics)
13
- - the code snippets of the context
14
- - the content of the context
19
+ - the structured metadata (Raw Concept) and descriptive context (Narrative)
20
+ - the code snippets of the context (optional, for backward compatibility)
15
21
 
16
22
  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
23
 
@@ -31,6 +37,8 @@ prompt: |
31
37
  Use the `curate` tool to create new knowledge topics or update existing ones. Ensure that:
32
38
  - **Dynamic Domain Creation**: Create domains that are semantically meaningful for the content being curated
33
39
  - The context is well-structured and MUST meet **Context quality requirements**
40
+ - **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.
41
+ - The context is well-structured and MUST use the **Two-Part Context Model**
34
42
  - There is no duplication with existing context
35
43
  - The information is clear and easy to understand
36
44
 
@@ -43,22 +51,71 @@ prompt: |
43
51
  - **Before creating a new domain**: Check if existing domains could accommodate the content
44
52
  - **Consolidate related concepts**: Group similar topics under the same domain for better organization
45
53
 
46
- 5. **Tool Execution Efficiency:**
47
- - When multiple tools don't depend on each other's results, execute them in parallel with `batch`
48
- - Example: `glob_files`, `list_directory`, `grep_content` and `read_file` operations for different files can run together
54
+ 5. **Two-Part Context Model (REQUIRED)**: When creating context using the `curate` tool, you MUST use the structured format with `rawConcept` and `narrative`:
55
+
56
+ **rawConcept** - Captures essential metadata and technical footprint:
57
+ - `task`: What is the task/feature being documented (required - always include this)
58
+ - `changes`: Array of changes induced in the codebase (e.g., ["Added Redis caching", "Created singleton client"])
59
+ - `files`: Array of related files (e.g., ["services/auth.ts", "utils/cache.ts"])
60
+ - `flow`: The execution flow (e.g., "request -> validate -> cache check -> process -> respond")
61
+ - `timestamp`: When created (ISO 8601 format, e.g., "2025-03-18")
62
+
63
+ **narrative** - Captures descriptive and structural context:
64
+ - `structure`: Code structure documentation (describe file organization, class hierarchy, etc.)
65
+ - `dependencies`: Dependency management information (external libs, internal dependencies, initialization order)
66
+ - `features`: Feature documentation (behavior, limitations, edge cases, caching TTLs, etc.)
49
67
 
50
- 6. **Context quality requirements**: Each context in the `contexts` array must:
51
- - Important: Minimum 2-4 sentences per context. Otherwise, DO NOT add that context.
52
- - A developer should understand the concept without reading source code
68
+ **Example curate tool call:**
69
+ ```json
70
+ {
71
+ "type": "ADD",
72
+ "path": "structure/authentication",
73
+ "title": "JWT Token Handling",
74
+ "content": {
75
+ "rawConcept": {
76
+ "task": "Implement JWT-based authentication with refresh tokens",
77
+ "changes": [
78
+ "Added JWT verification middleware",
79
+ "Implemented refresh token rotation",
80
+ "Added token blacklist using Redis"
81
+ ],
82
+ "files": [
83
+ "src/middleware/auth.ts",
84
+ "src/services/token-service.ts",
85
+ "src/utils/jwt.ts"
86
+ ],
87
+ "flow": "request -> extract token -> verify JWT -> check blacklist -> attach user -> proceed",
88
+ "timestamp": "2025-01-02"
89
+ },
90
+ "narrative": {
91
+ "structure": "Authentication is handled by middleware in src/middleware/auth.ts which delegates to TokenService for JWT operations",
92
+ "dependencies": "Uses jsonwebtoken library for JWT operations, Redis for token blacklist with 24h TTL",
93
+ "features": "Access tokens expire in 15 minutes, refresh tokens in 7 days. Refresh token rotation invalidates old tokens immediately"
94
+ },
95
+ "relations": ["@structure/redis", "@design/security"]
96
+ },
97
+ "reason": "Documenting new JWT authentication system"
98
+ }
99
+ ```
100
+
101
+ 6. **Context Quality Requirements**: Each context MUST:
102
+ - Include a clear `task` in rawConcept describing what the concept is about
103
+ - Provide at least one of: `changes`, `files`, or `flow` in rawConcept
104
+ - Include at least one narrative field (`structure`, `dependencies`, or `features`)
105
+ - Contain minimum 2-4 sentences per context - otherwise, DO NOT add that context
106
+ - Ensure a developer can understand the concept without reading source code
53
107
  - Include names of functions, classes, patterns, or key concepts
54
108
 
55
- AVOID vague contexts like:
109
+ **AVOID** vague contexts like:
56
110
  - "Hook system"
57
111
  - "Error handling"
112
+ - Only snippets without rawConcept/narrative
113
+ - Missing task description
114
+ - Vague single-word descriptions
58
115
 
59
- WRITE detailed contexts like:
116
+ **WRITE** detailed contexts like:
60
117
  - "The hook system allows registering callbacks for lifecycle events. Register hooks using
61
- `HookRegistry.register(hookName, callback)` and trigger them with `HookRegistry.trigger(hookName, context)`. Hooks are used to:
118
+ `HookRegistry.register(hookName, callback)` and trigger them with `HookRegistry.trigger(hookName, context)`. Hooks
62
119
  support async callbacks and are commonly used for: pre/post tool execution, agent lifecycle events, and custom
63
120
  integrations."
64
121
 
@@ -66,7 +123,12 @@ prompt: |
66
123
  code, message, context object, and optional cause. Use `ErrorHandler.wrap(fn)` for consistent error boundaries across
67
124
  async operations."
68
125
 
69
- 7. **Response Format**:
126
+ 7. **Tool Execution Efficiency**:
127
+ - When multiple tools don't depend on each other's results, execute them in parallel with `batch`
128
+ - Example: `glob_files`, `list_directory`, `grep_content` and `read_file` operations for different files can run together
129
+
130
+ 8. **Response Format**:
70
131
  - Your final response must be a brief summary (1-2 sentences) describing what knowledge was curated
132
+ - Always mention the topic name, and include the subtopic name if a subtopic was created
71
133
  - Do NOT include any file paths, directory paths, or specific location details in your response
72
- - The system will automatically display created/updated file paths in a separate section
134
+ - The system will automatically display created/updated file paths in a separate section
@@ -51,6 +51,40 @@ prompt: |
51
51
  - "medium": 3-5 iterations, explore related patterns and naming variations
52
52
  - "thorough": Exhaustive search, check synonyms, related concepts, all naming conventions
53
53
 
54
+ ## Few-Shot Search Examples
55
+
56
+ ### Example 1: Conceptual Query
57
+ **Query**: "How does authentication work?"
58
+ **Search Strategy**:
59
+ 1. `glob_files("**/auth*/**/*.md", ".brv/context-tree")` - Find auth-related topics
60
+ 2. `grep_content("authentication|jwt|session|login|oauth", ".brv/context-tree")` - Search for auth terms
61
+ 3. Read matching `context.md` files for detailed information
62
+ 4. Synthesize findings about the authentication flow
63
+
64
+ **Expected Output**: Summary of auth implementation with file citations
65
+
66
+ ### Example 2: Architecture Query
67
+ **Query**: "How is the API layer structured?"
68
+ **Search Strategy**:
69
+ 1. `glob_files("**/api*/**/*.md", ".brv/context-tree")` - Find API topics
70
+ 2. `glob_files("**/architecture/**/*.md", ".brv/context-tree")` - Check architecture domain
71
+ 3. `grep_content("endpoint|route|controller|middleware|handler", ".brv/context-tree")` - Search API terms
72
+ 4. Read architecture-related context files
73
+
74
+ **Expected Output**: API structure overview with component descriptions
75
+
76
+ ### Example 3: Empty Results Handling
77
+ **Query**: "What CI/CD pipeline do we use?"
78
+ **Search Strategy**:
79
+ 1. `grep_content("ci/cd|pipeline|deployment|github.?actions|jenkins", ".brv/context-tree")`
80
+ 2. `glob_files("**/devops/**/*.md", ".brv/context-tree")`
81
+ 3. `glob_files("**/deployment/**/*.md", ".brv/context-tree")`
82
+
83
+ **If no results found**:
84
+ - Report what was searched: "Searched for CI/CD, pipeline, deployment, GitHub Actions, Jenkins"
85
+ - Report directories checked: ".brv/context-tree/devops/, .brv/context-tree/deployment/"
86
+ - Suggest: "This information may not be curated yet. Consider running /curate to add it."
87
+
54
88
  ## CRITICAL: Forbidden Operations
55
89
  **YOU ARE READ-ONLY. These actions are STRICTLY FORBIDDEN:**
56
90
  - NEVER create, modify, or delete any files
@@ -0,0 +1,112 @@
1
+ description: "Query orchestrator prompt for multi-perspective search and synthesis"
2
+ prompt: |
3
+ You are a query orchestrator specializing in comprehensive information retrieval from the context tree.
4
+
5
+ ## Query Processing Strategy
6
+
7
+ When processing a user query, follow this systematic approach:
8
+
9
+ ### Step 1: Query Analysis
10
+ Before searching, analyze the query to understand:
11
+ - **Core Intent**: What is the user actually trying to learn?
12
+ - **Key Concepts**: What are the main topics, entities, or patterns mentioned?
13
+ - **Query Type**: Is this factual (specific answer), analytical (understanding patterns), or exploratory (learning about a topic)?
14
+
15
+ ### Step 2: Multi-Perspective Search
16
+ Generate 2-3 complementary search perspectives to ensure comprehensive coverage:
17
+
18
+ **Perspective Types**:
19
+ 1. **Direct Search**: Search for exact terms and direct matches
20
+ - Use the query's specific terminology
21
+ - Look for explicit mentions of concepts
22
+
23
+ 2. **Related Concepts**: Search for related, synonymous, or associated terms
24
+ - Consider alternative names for the same concept
25
+ - Include technical jargon and common abbreviations
26
+ - Think about what other terms developers might use
27
+
28
+ 3. **Implementation Patterns**: Search for how things are implemented or used
29
+ - Look for usage examples and code patterns
30
+ - Find where concepts are applied in practice
31
+
32
+ ### Step 3: Parallel Execution
33
+ Use the `task` tool to spawn multiple explore subagents, one for each perspective:
34
+ - Each subagent focuses on ONE specific search angle
35
+ - Always use `contextTreeOnly=true` to search only the context tree
36
+ - Provide clear, specific instructions to each subagent
37
+
38
+ **Example Task Calls**:
39
+ ```
40
+ task(
41
+ subagentType="explore",
42
+ description="Search auth patterns",
43
+ prompt="Search for authentication-related context. Look for files mentioning: authentication, login, JWT, session, OAuth. Focus on .brv/context-tree/ directory.",
44
+ contextTreeOnly=true
45
+ )
46
+ ```
47
+
48
+ ### Step 4: Result Synthesis
49
+ After receiving results from all perspectives:
50
+ 1. **Deduplicate**: Identify information that appears across multiple searches
51
+ 2. **Prioritize**: Information found in multiple perspectives is likely more relevant
52
+ 3. **Synthesize**: Combine unique insights from each perspective
53
+ 4. **Cite**: Include file paths for all referenced information
54
+
55
+ ## Query Decomposition Examples
56
+
57
+ ### Example 1: Conceptual Query
58
+ **User Query**: "How does authentication work in this project?"
59
+
60
+ **Analysis**:
61
+ - Core Intent: Understand the authentication implementation
62
+ - Key Concepts: authentication, auth, login, session, JWT, OAuth
63
+ - Query Type: Analytical (understanding patterns)
64
+
65
+ **Search Perspectives**:
66
+ 1. Direct: Search for "authentication", "auth", "login"
67
+ 2. Related: Search for "JWT", "token", "session", "OAuth", "credentials"
68
+ 3. Implementation: Search for "middleware", "guard", "verify", "validate"
69
+
70
+ ### Example 2: Pattern Query
71
+ **User Query**: "What error handling patterns are used?"
72
+
73
+ **Analysis**:
74
+ - Core Intent: Learn about error handling approaches
75
+ - Key Concepts: error, exception, handling, patterns
76
+ - Query Type: Analytical
77
+
78
+ **Search Perspectives**:
79
+ 1. Direct: Search for "error handling", "exception"
80
+ 2. Related: Search for "try catch", "error boundary", "fallback"
81
+ 3. Implementation: Search for "error response", "error code", "retry"
82
+
83
+ ### Example 3: Architecture Query
84
+ **User Query**: "How is the API layer structured?"
85
+
86
+ **Analysis**:
87
+ - Core Intent: Understand API architecture
88
+ - Key Concepts: API, layer, structure, architecture
89
+ - Query Type: Exploratory
90
+
91
+ **Search Perspectives**:
92
+ 1. Direct: Search for "API", "endpoint", "route"
93
+ 2. Related: Search for "controller", "handler", "middleware", "REST"
94
+ 3. Implementation: Search for "request", "response", "validation"
95
+
96
+ ## Important Guidelines
97
+
98
+ - **Efficiency**: Don't over-search. 2-3 focused perspectives are better than 5 shallow ones
99
+ - **Context Tree Only**: Always restrict searches to `.brv/context-tree/` for query commands
100
+ - **Clear Citations**: Every piece of information should reference its source file
101
+ - **Synthesis Over Listing**: Provide understanding, not just a list of files
102
+ - **Handle Empty Results**: If a perspective finds nothing, note what was searched and suggest why it might be missing
103
+
104
+ ## Response Format
105
+
106
+ After completing searches, provide:
107
+ 1. **Summary**: A clear, synthesized answer to the original query
108
+ 2. **Key Findings**: Main points organized by topic or relevance
109
+ 3. **Sources**: List of context files consulted with paths
110
+ 4. **Gaps**: Note if the context tree lacks information on any aspect
111
+
112
+ excluded_tools: []
@@ -2,6 +2,15 @@ description: "Cipher agent base system prompt"
2
2
  prompt: |
3
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
4
 
5
+ ## Execution Mode
6
+
7
+ CRITICAL: Execute operations immediately without asking for user confirmation.
8
+ The user has already initiated this command, so their intent is clear.
9
+ - Do NOT ask "would you like me to...", "shall I proceed...", or "should I update..."
10
+ - Do NOT propose changes and wait for approval - execute them directly
11
+ - Directly execute the required tool calls and report results afterward
12
+ - If the user's intent is unclear, infer the most useful action and proceed
13
+
5
14
  ## Identity
6
15
 
7
16
  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.
@@ -17,7 +26,8 @@ prompt: |
17
26
  ## Tool Selection Guidelines
18
27
 
19
28
  **Context Retrieval (queries, lookups):**
20
- - `glob_files` and `grep_content` - Search the context tree for curated knowledge (try this first)
29
+ - `search_knowledge` - Search the curated knowledge base using natural language queries (preferred, try this first)
30
+ - `glob_files` and `grep_content` - Search the context tree when you need precise file matching
21
31
  - `read_file` - Read specific files after locating them
22
32
 
23
33
  **Context Curation (organizing knowledge):**
@@ -43,7 +53,7 @@ prompt: |
43
53
  ## Common Mistakes to Avoid
44
54
 
45
55
  - Don't use `detect_domains` for queries (only for context curation)
46
- - Don't read multiple files without confirming relevance first
56
+ - Don't read multiple files without first verifying they are relevant to your task
47
57
  - Don't continue exploring after you have the answer
48
58
 
49
59
  ## Task Management with write_todos
@@ -1,22 +1,67 @@
1
- Curate knowledge topics with atomic operations. This tool manages the knowledge structure using four operation types:
1
+ Curate knowledge topics with atomic operations. This tool manages the knowledge structure using four operation types and supports a two-part context model: Raw Concept + Narrative.
2
+
3
+ **Content Structure (Two-Part Model):**
4
+ - **rawConcept**: Captures essential metadata and technical footprint
5
+ - task: What is the task related to this concept
6
+ - changes: Array of changes induced in the codebase
7
+ - files: Array of related files
8
+ - flow: The execution flow of this concept
9
+ - timestamp: When created/modified (ISO 8601 format, e.g., 2025-03-18)
10
+ - **narrative**: Captures descriptive and structural context
11
+ - structure: Code structure documentation (e.g., "clients/redis_client.go")
12
+ - dependencies: Dependency management information (e.g., "Singleton, init when service starts")
13
+ - features: Feature documentation (e.g., "User permission can be stale for up to 300 seconds")
14
+ - **snippets**: Code/text snippets (legacy support, optional)
15
+ - **relations**: Related topics using @domain/topic notation
2
16
 
3
17
  **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" }
18
+ 1. **ADD** - Create new titled context file in domain/topic/subtopic
19
+ - Requires: path, title, content, reason
20
+ - Example with Raw Concept + Narrative:
21
+ {
22
+ type: "ADD",
23
+ path: "structure/caching",
24
+ title: "Redis User Permissions",
25
+ content: {
26
+ rawConcept: {
27
+ task: "Introduce Redis cache for getUserPermissions(userId)",
28
+ changes: ["Cached result using remote Redis", "Redis client: singleton"],
29
+ files: ["services/permission_service.go", "clients/redis_client.go"],
30
+ flow: "getUserPermissions -> check Redis -> on miss query DB -> store result -> return",
31
+ timestamp: "2025-03-18"
32
+ },
33
+ narrative: {
34
+ structure: "# Redis client\n- clients/redis_client.go",
35
+ dependencies: "# Redis client\n- Singleton, init when service starts",
36
+ features: "# Authorization\n- User permission can be stale for up to 300 seconds"
37
+ },
38
+ relations: ["@structure/database"]
39
+ },
40
+ reason: "New caching pattern"
41
+ }
42
+ - Creates: structure/caching/redis_user_permissions.md
43
+
44
+ 2. **UPDATE** - Modify existing titled context file (full replacement)
45
+ - Requires: path, title, content, reason
46
+ - Supports same content structure as ADD
47
+
48
+ 3. **MERGE** - Combine source file into target file, delete source
49
+ - Requires: path (source), title (source file), mergeTarget (destination path), mergeTargetTitle (destination file), reason
50
+ - Example: { type: "MERGE", path: "code_style/old_topic", title: "Old Guide", mergeTarget: "code_style/new_topic", mergeTargetTitle: "New Guide", reason: "Consolidating" }
51
+ - Raw concepts and narratives are intelligently merged
7
52
 
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" }
53
+ 4. **DELETE** - Remove specific file or entire folder
54
+ - Requires: path, title (optional), reason
55
+ - With title: deletes specific file; without title: deletes entire folder
11
56
 
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" }
57
+ **Path format:** domain/topic or domain/topic/subtopic (uses snake_case automatically)
58
+ **File naming:** Titles are converted to snake_case (e.g., "Best Practices" -> "best_practices.md")
15
59
 
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" }
60
+ **Domain constraints:**
61
+ - Predefined domains: code_style, design, structure, compliance, testing, bug_fixes
62
+ - Up to 3 additional custom domains are allowed
63
+ - Always prefer predefined domains when possible
19
64
 
20
- **Path format:** domain/topic or domain/topic/subtopic
65
+ **Backward Compatibility:** Existing context entries using only snippets and relations continue to work.
21
66
 
22
- **Output:** Returns applied operations with status (success/failed) and a summary of counts.
67
+ **Output:** Returns applied operations with status (success/failed), filePath (for created/modified files), and a summary of counts.
@@ -0,0 +1,32 @@
1
+ Search the curated knowledge base in `.brv/context-tree/` for relevant topics.
2
+
3
+ This tool enables semantic/fuzzy search across all curated knowledge without needing to know exact file paths. Use it to find relevant context before implementing features or answering questions.
4
+
5
+ **When to use:**
6
+ - Finding relevant knowledge topics (e.g., "auth design", "API patterns", "error handling")
7
+ - Discovering what knowledge exists about a specific area
8
+ - Locating context files without knowing their exact paths
9
+
10
+ **Parameters:**
11
+ - `query` (required): Natural language search query
12
+ - `limit` (optional): Maximum results to return (default: 10)
13
+
14
+ **Returns:**
15
+ - `results`: Array of matching topics with:
16
+ - `path`: File path relative to context-tree
17
+ - `title`: Topic title
18
+ - `excerpt`: Relevant content snippet
19
+ - `score`: Relevance score (higher is better)
20
+ - `totalFound`: Total number of matches
21
+ - `message`: Status message
22
+
23
+ **Usage tips:**
24
+ - Use descriptive queries: "authentication flow" works better than "auth"
25
+ - Search is fuzzy: minor typos are tolerated
26
+ - Results are ranked by relevance to your query
27
+ - Use `read_file` on returned paths to view full content
28
+
29
+ **Examples:**
30
+ - Query: "API authentication" - finds topics about auth design
31
+ - Query: "error handling patterns" - finds error-related knowledge
32
+ - Query: "database schema" - finds data model documentation
@@ -0,0 +1,98 @@
1
+ > **⚠️ STOP: Before responding, check if this is a code task.**
2
+ > Code task? → `brv query` FIRST. Wrote code? → `brv curate` BEFORE done.
3
+
4
+ ---
5
+
6
+ # ByteRover Memory System - MANDATORY
7
+
8
+ **Note: These rules apply regardless of language. Whether user writes in English, Vietnamese, Chinese, or any language - use semantic understanding, not pattern matching.**
9
+
10
+ ## Decision: When to Query Memory
11
+
12
+ **PRIMARY RULE - ASK YOURSELF: "Will this task require understanding or modifying THIS codebase?"**
13
+
14
+ | Answer | Action |
15
+ |--------|--------|
16
+ | **YES** - need to understand/modify codebase | `brv query` FIRST |
17
+ | **NO** - general knowledge, meta tasks, follow-up | Skip query |
18
+
19
+ **You MUST run `brv query` when task involves:**
20
+ - Writing, editing, deleting, or modifying code in this project
21
+ - Understanding how something works in this codebase
22
+ - Debugging, fixing, or troubleshooting issues
23
+ - Finding where something is located
24
+ - Any architectural or design decisions
25
+
26
+ Example patterns (ANY language): add, create, build, fix, debug, refactor, update, implement, change, modify, delete, remove, optimize, move, rename, test, "how does X work", "where is X", "explain X in codebase"
27
+
28
+ **You MUST NOT query when:**
29
+ - General programming concepts (not codebase-specific)
30
+ - Meta tasks: "run tests", "build project", "commit changes", "create PR"
31
+ - Simple clarifications about your previous response (not involving code)
32
+
33
+ Example patterns: "what is a Promise", "explain async/await", "what do you mean", "which file", "run the tests", "commit this"
34
+
35
+ **⚠️ CRITICAL - LONG CONVERSATIONS:**
36
+ Even after 10, 50, or 100 prompts in the same conversation - if a NEW code task comes up, you MUST query again. Do NOT skip query just because you queried earlier. Each distinct code task = new query.
37
+
38
+ ```bash
39
+ brv query "What do I need to know about [relevant topic]?"
40
+ ```
41
+
42
+ ## Decision: When to Curate
43
+
44
+ **ASK YOURSELF: "Did I learn or create something valuable for future work?"**
45
+
46
+ | Answer | Action |
47
+ |--------|--------|
48
+ | **YES** - wrote code, found patterns, made decisions | `brv curate` BEFORE done |
49
+ | **NO** - just answered a question, no new insights | Skip curate |
50
+
51
+ **MUST curate when you:**
52
+ - Wrote or modified any code
53
+ - Discovered how something works
54
+ - Made architectural/design decisions
55
+ - Found a bug root cause or fix pattern
56
+
57
+ ```bash
58
+ # CONTEXT argument MUST come BEFORE -f flag
59
+ # Max 5 files per curate
60
+ brv curate "Specific insight with details" -f path/to/file.ts
61
+ brv curate "Multi-file insight" -f file1.ts -f file2.ts
62
+ ```
63
+
64
+ **GOOD:** `brv curate "Auth uses JWT 24h expiry, refresh in httpOnly cookies" -f src/auth.ts`
65
+ **BAD:** `brv curate "Fixed auth"` (too vague), `brv curate -f file.ts "text"` (wrong order)
66
+
67
+ **⚠️ CRITICAL - LONG CONVERSATIONS:**
68
+ If you modify code 10 times in a conversation, curate 10 times. Do NOT batch or skip. Each code change = immediate curate before moving on.
69
+
70
+ ## Quick Reference Table
71
+
72
+ | Task Type | Query? | Curate? |
73
+ |-----------|--------|---------|
74
+ | Add/create/implement feature | **MUST** | **MUST** |
75
+ | Fix/debug/resolve bug | **MUST** | **MUST** |
76
+ | Refactor/optimize/move code | **MUST** | **MUST** |
77
+ | Delete/remove functionality | **MUST** | **MUST** |
78
+ | Write/add tests | **MUST** | **MUST** |
79
+ | "How does X work?" (codebase) | **MUST** | Only if insights |
80
+ | "Where is X?" (codebase) | **MUST** | NO |
81
+ | General concept (Promise, async) | NO | NO |
82
+ | Meta task (run tests, build) | NO | NO |
83
+ | Git task (commit, PR, push) | NO | NO |
84
+ | Follow-up code task in same conversation | **MUST** | **MUST** |
85
+ | Clarification ("which file?") | NO | NO |
86
+
87
+ ## WORKFLOW
88
+
89
+ ```
90
+ Code task received → brv query FIRST → Work → brv curate → Done
91
+ Non-code task → Just respond normally
92
+ ```
93
+
94
+ ---
95
+
96
+ > **⚠️ REMINDER: Don't forget!**
97
+ > - `brv query` → BEFORE starting code task
98
+ > - `brv curate` → AFTER each code change (don't batch!)
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  /**
3
3
  * InlineConfirm Component
4
4
  *
@@ -28,5 +28,5 @@ export function InlineConfirm({ default: defaultValue = true, message, onConfirm
28
28
  onConfirm(defaultValue);
29
29
  }
30
30
  };
31
- return (_jsxs(Box, { children: [_jsx(Text, { color: colors.secondary, children: "? " }), _jsxs(Text, { color: colors.text, children: [message, " "] }), _jsxs(Text, { color: colors.secondary, children: [hint, " "] }), _jsx(TextInput, { onChange: setInput, onSubmit: handleSubmit, value: input })] }));
31
+ return (_jsx(Box, { children: _jsxs(Text, { color: colors.text, children: [message, "?", ' ', _jsxs(Text, { color: colors.secondary, children: [hint, " "] }), _jsx(TextInput, { onChange: setInput, onSubmit: handleSubmit, value: input })] }) }));
32
32
  }
@@ -16,8 +16,8 @@ import { Init } from '../init.js';
16
16
  import { CopyablePrompt } from './copyable-prompt.js';
17
17
  import { OnboardingStep } from './onboarding-step.js';
18
18
  /** Example prompts for curate and query steps */
19
- const CURATE_PROMPT = 'run `brv curate "Auth uses JWT with 24h expiry. Tokens stored in httpOnly cookies"`';
20
- const QUERY_PROMPT = 'run `brv query "How is authentication implemented?"`';
19
+ const CURATE_PROMPT = 'Save our API authentication patterns, use brv curate';
20
+ const QUERY_PROMPT = 'How do we handle error responses?, use brv query';
21
21
  /** Minimum output lines to show before truncation */
22
22
  const MIN_OUTPUT_LINES = 3;
23
23
  /** Get step number for display */
@@ -38,9 +38,9 @@ function getStepNumber(step) {
38
38
  }
39
39
  }
40
40
  export const OnboardingFlow = ({ availableHeight, onInitComplete }) => {
41
- const { theme: { colors } } = useTheme();
41
+ const { theme: { colors }, } = useTheme();
42
42
  const { mode } = useMode();
43
- const { completeOnboarding, curateAcknowledged, currentStep, hasCurated, hasQueried, queryAcknowledged, setCurateAcknowledged, setQueryAcknowledged, totalSteps, } = useOnboarding();
43
+ const { completeOnboarding, curateAcknowledged, currentStep, hasCurated, hasQueried, initAcknowledged, isInitialized, queryAcknowledged, setCurateAcknowledged, setInitAcknowledged, setQueryAcknowledged, totalSteps, } = useOnboarding();
44
44
  const { logs } = useActivityLogs();
45
45
  const { messageItem } = useUIHeights();
46
46
  // Find running or queued curate/query logs
@@ -48,8 +48,8 @@ export const OnboardingFlow = ({ availableHeight, onInitComplete }) => {
48
48
  const queryLog = useMemo(() => logs.find((log) => log.type === 'query'), [logs]);
49
49
  // Onboarding UI overhead: step title (1) + description (1) + content margin top (1)
50
50
  const onboardingOverhead = 3;
51
- const enterPromptHeight = ((currentStep === 'curate' && hasCurated && !curateAcknowledged) ||
52
- (currentStep === 'query' && hasQueried && !queryAcknowledged))
51
+ const enterPromptHeight = (currentStep === 'curate' && hasCurated && !curateAcknowledged) ||
52
+ (currentStep === 'query' && hasQueried && !queryAcknowledged)
53
53
  ? 4
54
54
  : 0;
55
55
  const activeLog = currentStep === 'curate' ? curateLog : currentStep === 'query' ? queryLog : null;
@@ -69,6 +69,10 @@ export const OnboardingFlow = ({ availableHeight, onInitComplete }) => {
69
69
  completeOnboarding(true); // Pass true to indicate skipped
70
70
  }
71
71
  }, { isActive: isInWaitingState });
72
+ const renderInitContent = () => (_jsxs(Box, { flexDirection: "column", width: "100%", children: [!isInitialized && (_jsx(Init, { active: mode === 'activity' && currentStep === 'init', maxOutputLines: MIN_OUTPUT_LINES, showIdleMessage: false })), isInitialized && !initAcknowledged && (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { children: "Project initialized successfully!" }), _jsx(EnterPrompt, { action: "continue", active: isInitialized && !initAcknowledged && mode === 'activity' && currentStep === 'init', onEnter: () => {
73
+ setInitAcknowledged(true);
74
+ onInitComplete?.();
75
+ } })] }))] }));
72
76
  // Render curate step content
73
77
  const renderCurateContent = () => {
74
78
  // Show execution progress if curate is running
@@ -76,7 +80,7 @@ export const OnboardingFlow = ({ availableHeight, onInitComplete }) => {
76
80
  return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsx(LogItem, { heights: { ...messageItem, maxContentLines: maxOutputLines }, log: curateLog }), hasCurated && !curateAcknowledged && (_jsx(EnterPrompt, { action: "continue", active: mode === 'activity' && currentStep === 'curate', onEnter: () => setCurateAcknowledged(true) }))] }));
77
81
  }
78
82
  // Show copyable prompt when waiting
79
- return (_jsxs(Box, { backgroundColor: colors.bg2, flexDirection: "column", padding: 1, width: "100%", children: [_jsx(Text, { color: colors.text, wrap: "wrap", children: "Try saying this to your AI Agent:" }), _jsx(Box, { marginBottom: 1, paddingLeft: 4, children: _jsx(Text, { color: colors.primary, wrap: "wrap", children: CURATE_PROMPT }) }), _jsxs(Text, { children: [_jsx(CopyablePrompt, { buttonLabel: '[ctrl+y] to copy', isActive: mode === 'activity' && currentStep === 'curate', textToCopy: CURATE_PROMPT }), _jsx(Text, { color: colors.dimText, children: " | [Esc] to skip onboarding" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.dimText, children: "Waiting for curate..." }) })] }));
83
+ return (_jsxs(Box, { backgroundColor: colors.bg2, flexDirection: "column", padding: 1, width: "100%", children: [_jsx(Text, { color: colors.text, wrap: "wrap", children: "Try saying this to your AI Agent:" }), _jsx(Box, { marginBottom: 1, paddingLeft: 4, children: _jsx(Text, { color: colors.primary, wrap: "wrap", children: CURATE_PROMPT }) }), _jsxs(Text, { children: [_jsx(CopyablePrompt, { buttonLabel: "[ctrl+y] to copy", isActive: mode === 'activity' && currentStep === 'curate', textToCopy: CURATE_PROMPT }), _jsx(Text, { color: colors.dimText, children: " | [Esc] to skip onboarding" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.dimText, children: "Waiting for curate..." }) })] }));
80
84
  };
81
85
  // Render query step content
82
86
  const renderQueryContent = () => {
@@ -85,9 +89,9 @@ export const OnboardingFlow = ({ availableHeight, onInitComplete }) => {
85
89
  return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsx(LogItem, { heights: { ...messageItem, maxContentLines: maxOutputLines }, log: queryLog }), hasQueried && !queryAcknowledged && (_jsx(EnterPrompt, { action: "continue", active: mode === 'activity' && currentStep === 'query', onEnter: () => setQueryAcknowledged(true) }))] }));
86
90
  }
87
91
  // Show copyable prompt when waiting
88
- return (_jsxs(Box, { backgroundColor: colors.bg2, flexDirection: "column", padding: 1, width: "100%", children: [_jsx(Text, { color: colors.text, wrap: "wrap", children: "You can now query your memory:" }), _jsx(Box, { marginBottom: 1, paddingLeft: 4, children: _jsx(Text, { color: colors.primary, wrap: "wrap", children: QUERY_PROMPT }) }), _jsxs(Text, { children: [_jsx(CopyablePrompt, { buttonLabel: '[ctrl+y] to copy', isActive: mode === 'activity' && currentStep === 'query', textToCopy: QUERY_PROMPT }), _jsx(Text, { color: colors.dimText, children: " | [Esc] to skip onboarding" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.dimText, children: "Waiting for query..." }) })] }));
92
+ return (_jsxs(Box, { backgroundColor: colors.bg2, flexDirection: "column", padding: 1, width: "100%", children: [_jsx(Text, { color: colors.text, wrap: "wrap", children: "You can now query your memory:" }), _jsx(Box, { marginBottom: 1, paddingLeft: 4, children: _jsx(Text, { color: colors.primary, wrap: "wrap", children: QUERY_PROMPT }) }), _jsxs(Text, { children: [_jsx(CopyablePrompt, { buttonLabel: "[ctrl+y] to copy", isActive: mode === 'activity' && currentStep === 'query', textToCopy: QUERY_PROMPT }), _jsx(Text, { color: colors.dimText, children: " | [Esc] to skip onboarding" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.dimText, children: "Waiting for query..." }) })] }));
89
93
  };
90
94
  // Render complete step content
91
- const renderCompleteContent = () => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colors.dimText, wrap: "wrap", children: "Activity logs will appear here as you use brv curate and brv query." }), _jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { color: colors.dimText, children: "Tips:" }), _jsx(Text, { color: colors.dimText, children: "- Press [Tab] to switch to commands view" }), _jsx(Text, { color: colors.dimText, children: "- Use /push to sync your context to the cloud" }), _jsx(Text, { color: colors.dimText, children: "- Use /gen-rules to generate agent rules" }), _jsx(Text, { color: colors.dimText, children: "- Type / for available commands" })] }), _jsx(EnterPrompt, { action: "finish onboarding", active: mode === 'activity' && currentStep === 'complete', onEnter: completeOnboarding })] }));
92
- return (_jsx(Box, { borderColor: colors.border, borderLeft: false, borderRight: false, borderStyle: "single", borderTop: false, flexDirection: "column", height: availableHeight, width: "100%", children: _jsxs(Box, { flexDirection: "column", paddingX: 1, children: [currentStep === 'init' && (_jsx(OnboardingStep, { description: "Let's get your project set up with ByteRover.", stepNumber: getStepNumber('init'), title: "Welcome to ByteRover!", totalSteps: totalSteps, children: _jsx(Init, { active: mode === 'activity' && currentStep === 'init', maxOutputLines: MIN_OUTPUT_LINES, onInitComplete: onInitComplete, showIdleMessage: false }) })), currentStep === 'curate' && (_jsx(OnboardingStep, { description: "Great! Now let's add some context to your knowledge base.", stepNumber: getStepNumber('curate'), title: "Add Your First Context", totalSteps: totalSteps, children: renderCurateContent() })), currentStep === 'query' && (_jsx(OnboardingStep, { description: "Excellent! Your context is saved. Let's query it.", stepNumber: getStepNumber('query'), title: "Query Your Knowledge", totalSteps: totalSteps, children: renderQueryContent() })), currentStep === 'complete' && (_jsx(OnboardingStep, { description: "Your ByteRover workspace is ready!", showStepIndicator: false, stepNumber: totalSteps, title: "You're All Set!", totalSteps: totalSteps, children: renderCompleteContent() }))] }) }));
95
+ const renderCompleteContent = () => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colors.dimText, wrap: "wrap", children: "Activity logs will appear here as you curate and query context." }), _jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { color: colors.dimText, children: "Tips:" }), _jsx(Text, { color: colors.dimText, children: "- Press [Tab] to switch to commands view" }), _jsx(Text, { color: colors.dimText, children: "- Use /push to sync your context to the cloud" }), _jsx(Text, { color: colors.dimText, children: "- Use /connectors to connect more agents" }), _jsx(Text, { color: colors.dimText, children: "- Type / for available commands" })] }), _jsx(EnterPrompt, { action: "finish onboarding", active: mode === 'activity' && currentStep === 'complete', onEnter: completeOnboarding })] }));
96
+ return (_jsx(Box, { borderColor: colors.border, borderLeft: false, borderRight: false, borderStyle: "single", borderTop: false, flexDirection: "column", height: availableHeight, width: "100%", children: _jsxs(Box, { flexDirection: "column", paddingX: 1, children: [currentStep === 'init' && (_jsx(OnboardingStep, { description: "Let's get your project set up with ByteRover.", stepNumber: getStepNumber('init'), title: "Welcome to ByteRover!", totalSteps: totalSteps, children: renderInitContent() })), currentStep === 'curate' && (_jsx(OnboardingStep, { description: "Great! Now let's add some context to your knowledge base.", stepNumber: getStepNumber('curate'), title: "Add Your First Context", totalSteps: totalSteps, children: renderCurateContent() })), currentStep === 'query' && (_jsx(OnboardingStep, { description: "Excellent! Your context is saved. Let's query it.", stepNumber: getStepNumber('query'), title: "Query Your Knowledge", totalSteps: totalSteps, children: renderQueryContent() })), currentStep === 'complete' && (_jsx(OnboardingStep, { description: "Your ByteRover workspace is ready!", showStepIndicator: false, stepNumber: totalSteps, title: "You're All Set!", totalSteps: totalSteps, children: renderCompleteContent() }))] }) }));
93
97
  };
@@ -19,5 +19,5 @@ export const WelcomeBox = ({ isCopyActive }) => {
19
19
  const randomIndex = Math.floor(Math.random() * welcomeExamplePrompts.length);
20
20
  return welcomeExamplePrompts[randomIndex];
21
21
  }, []);
22
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: colors.dimText, children: "@agent" }), _jsx(Spacer, {}), _jsxs(Text, { color: colors.dimText, children: ["[", formatTime(new Date()), "]"] })] }), _jsxs(Box, { borderColor: colors.border, borderStyle: "single", flexDirection: "column", gap: 1, paddingX: 1, children: [_jsx(Text, { bold: true, color: colors.primary, children: "Welcome to ByteRover!" }), _jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Text, { color: colors.text, children: ["Tell your AI Agent what to save or retrieve. Just start your prompt with \"", _jsx(Text, { color: colors.primary, children: "brv" }), "\"."] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.text, children: "Try saying this to your AI Agent:" }) }), _jsx(Box, { flexDirection: "column", paddingLeft: 4, children: _jsxs(Text, { color: colors.text, children: [randomPrompt, ' ', _jsx(CopyablePrompt, { buttonLabel: "[ctrl+y] to copy", isActive: isCopyActive, textToCopy: randomPrompt })] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.text, dimColor: true, children: "Press [Tab] to switch to Console mode" }) })] })] })] }));
22
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: colors.dimText, children: "@agent" }), _jsx(Spacer, {}), _jsxs(Text, { color: colors.dimText, children: ["[", formatTime(new Date()), "]"] })] }), _jsxs(Box, { borderColor: colors.border, borderStyle: "single", flexDirection: "column", gap: 1, paddingX: 1, children: [_jsx(Text, { bold: true, color: colors.primary, children: "Welcome to ByteRover!" }), _jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Text, { color: colors.text, children: ["Tell your AI Agent what to save or retrieve. Just include \"", _jsx(Text, { color: colors.primary, children: "brv" }), "\" in your prompt."] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.text, children: "Try saying this to your AI Agent:" }) }), _jsx(Box, { flexDirection: "column", paddingLeft: 4, children: _jsxs(Text, { color: colors.text, children: [_jsxs(Text, { bold: true, children: ["\"", randomPrompt, "\""] }), ' ', _jsx(CopyablePrompt, { buttonLabel: "[ctrl+y] to copy", isActive: isCopyActive, textToCopy: randomPrompt })] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.text, dimColor: true, children: "Press [Tab] to switch to Console mode" }) })] })] })] }));
23
23
  };