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.
- package/README.md +24 -11
- package/dist/commands/curate.js +1 -1
- package/dist/commands/hook-prompt-submit.d.ts +27 -0
- package/dist/commands/hook-prompt-submit.js +39 -0
- package/dist/commands/main.d.ts +13 -0
- package/dist/commands/main.js +53 -2
- package/dist/commands/query.js +1 -1
- package/dist/commands/status.js +8 -3
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/core/domain/cipher/llm/registry.js +53 -2
- package/dist/core/domain/cipher/llm/types.d.ts +2 -0
- package/dist/core/domain/cipher/process/types.d.ts +7 -0
- package/dist/core/domain/cipher/session/session-metadata.d.ts +178 -0
- package/dist/core/domain/cipher/session/session-metadata.js +147 -0
- package/dist/core/domain/cipher/tools/constants.d.ts +1 -0
- package/dist/core/domain/cipher/tools/constants.js +1 -0
- package/dist/core/domain/entities/agent.d.ts +16 -0
- package/dist/core/domain/entities/agent.js +24 -0
- package/dist/core/domain/entities/connector-type.d.ts +9 -0
- package/dist/core/domain/entities/connector-type.js +8 -0
- package/dist/core/domain/entities/event.d.ts +1 -1
- package/dist/core/domain/entities/event.js +2 -0
- package/dist/core/domain/errors/task-error.d.ts +4 -0
- package/dist/core/domain/errors/task-error.js +7 -0
- package/dist/core/domain/knowledge/markdown-writer.d.ts +15 -18
- package/dist/core/domain/knowledge/markdown-writer.js +232 -34
- package/dist/core/domain/knowledge/relation-parser.d.ts +25 -39
- package/dist/core/domain/knowledge/relation-parser.js +39 -61
- package/dist/core/domain/transport/schemas.d.ts +77 -2
- package/dist/core/domain/transport/schemas.js +51 -2
- package/dist/core/interfaces/cipher/i-session-persistence.d.ts +133 -0
- package/dist/core/interfaces/cipher/i-session-persistence.js +7 -0
- package/dist/core/interfaces/cipher/message-types.d.ts +6 -0
- package/dist/core/interfaces/connectors/connector-types.d.ts +57 -0
- package/dist/core/interfaces/connectors/i-connector-manager.d.ts +72 -0
- package/dist/core/interfaces/connectors/i-connector.d.ts +54 -0
- package/dist/core/interfaces/connectors/i-connector.js +1 -0
- package/dist/core/interfaces/executor/i-curate-executor.d.ts +2 -2
- package/dist/core/interfaces/i-context-file-reader.d.ts +3 -0
- package/dist/core/interfaces/i-file-service.d.ts +7 -0
- package/dist/core/interfaces/usecase/i-connectors-use-case.d.ts +3 -0
- package/dist/core/interfaces/usecase/i-connectors-use-case.js +1 -0
- package/dist/core/interfaces/usecase/{i-clear-use-case.d.ts → i-reset-use-case.d.ts} +1 -1
- package/dist/core/interfaces/usecase/i-reset-use-case.js +1 -0
- package/dist/hooks/init/update-notifier.d.ts +1 -0
- package/dist/hooks/init/update-notifier.js +10 -1
- package/dist/infra/cipher/agent/agent-schemas.d.ts +6 -6
- package/dist/infra/cipher/agent/service-initializer.js +4 -4
- package/dist/infra/cipher/file-system/binary-utils.d.ts +7 -12
- package/dist/infra/cipher/file-system/binary-utils.js +46 -31
- package/dist/infra/cipher/file-system/context-tree-file-system-factory.js +3 -2
- package/dist/infra/cipher/file-system/file-system-service.js +1 -0
- package/dist/infra/cipher/http/internal-llm-http-service.js +3 -5
- package/dist/infra/cipher/interactive-loop.js +3 -1
- package/dist/infra/cipher/llm/context/context-manager.d.ts +2 -2
- package/dist/infra/cipher/llm/context/context-manager.js +63 -18
- package/dist/infra/cipher/llm/formatters/gemini-formatter.d.ts +13 -0
- package/dist/infra/cipher/llm/formatters/gemini-formatter.js +146 -15
- package/dist/infra/cipher/llm/generators/byterover-content-generator.js +6 -2
- package/dist/infra/cipher/llm/internal-llm-service.js +2 -2
- package/dist/infra/cipher/llm/thought-parser.d.ts +21 -0
- package/dist/infra/cipher/llm/thought-parser.js +27 -0
- package/dist/infra/cipher/llm/tool-output-processor.d.ts +10 -0
- package/dist/infra/cipher/llm/tool-output-processor.js +80 -7
- package/dist/infra/cipher/process/process-service.js +11 -3
- package/dist/infra/cipher/session/chat-session.d.ts +7 -2
- package/dist/infra/cipher/session/chat-session.js +90 -52
- package/dist/infra/cipher/session/session-metadata-store.d.ts +52 -0
- package/dist/infra/cipher/session/session-metadata-store.js +406 -0
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.d.ts +6 -7
- package/dist/infra/cipher/system-prompt/contributors/context-tree-structure-contributor.js +57 -18
- package/dist/infra/cipher/tools/implementations/curate-tool.js +132 -36
- package/dist/infra/cipher/tools/implementations/read-file-tool.js +38 -17
- package/dist/infra/cipher/tools/implementations/search-knowledge-tool.d.ts +7 -0
- package/dist/infra/cipher/tools/implementations/search-knowledge-tool.js +303 -0
- package/dist/infra/cipher/tools/implementations/task-tool.js +1 -0
- package/dist/infra/cipher/tools/index.d.ts +1 -0
- package/dist/infra/cipher/tools/index.js +1 -0
- package/dist/infra/cipher/tools/tool-manager.js +1 -0
- package/dist/infra/cipher/tools/tool-registry.js +7 -0
- package/dist/infra/connectors/connector-manager.d.ts +32 -0
- package/dist/infra/connectors/connector-manager.js +156 -0
- package/dist/infra/connectors/hook/hook-connector-config.d.ts +52 -0
- package/dist/infra/connectors/hook/hook-connector-config.js +41 -0
- package/dist/infra/connectors/hook/hook-connector.d.ts +46 -0
- package/dist/infra/connectors/hook/hook-connector.js +231 -0
- package/dist/infra/{rule → connectors/rules}/legacy-rule-detector.d.ts +2 -2
- package/dist/infra/{rule → connectors/rules}/legacy-rule-detector.js +1 -1
- package/dist/infra/connectors/rules/rules-connector-config.d.ts +95 -0
- package/dist/infra/{rule/agent-rule-config.js → connectors/rules/rules-connector-config.js} +10 -10
- package/dist/infra/connectors/rules/rules-connector.d.ts +41 -0
- package/dist/infra/connectors/rules/rules-connector.js +204 -0
- package/dist/infra/{rule/rule-template-service.d.ts → connectors/shared/template-service.d.ts} +3 -3
- package/dist/infra/{rule/rule-template-service.js → connectors/shared/template-service.js} +1 -1
- package/dist/infra/context-tree/file-context-file-reader.js +4 -0
- package/dist/infra/context-tree/file-context-tree-writer-service.d.ts +5 -2
- package/dist/infra/context-tree/file-context-tree-writer-service.js +20 -5
- package/dist/infra/core/executors/curate-executor.d.ts +2 -2
- package/dist/infra/core/executors/curate-executor.js +7 -7
- package/dist/infra/core/executors/query-executor.d.ts +12 -0
- package/dist/infra/core/executors/query-executor.js +62 -1
- package/dist/infra/core/task-processor.d.ts +2 -2
- package/dist/infra/file/fs-file-service.d.ts +7 -0
- package/dist/infra/file/fs-file-service.js +15 -1
- package/dist/infra/process/agent-worker.d.ts +2 -2
- package/dist/infra/process/agent-worker.js +626 -142
- package/dist/infra/process/constants.d.ts +1 -1
- package/dist/infra/process/constants.js +1 -1
- package/dist/infra/process/ipc-types.d.ts +17 -4
- package/dist/infra/process/ipc-types.js +3 -3
- package/dist/infra/process/parent-heartbeat.d.ts +47 -0
- package/dist/infra/process/parent-heartbeat.js +118 -0
- package/dist/infra/process/process-manager.d.ts +89 -1
- package/dist/infra/process/process-manager.js +293 -9
- package/dist/infra/process/task-queue-manager.d.ts +13 -0
- package/dist/infra/process/task-queue-manager.js +19 -0
- package/dist/infra/process/transport-handlers.d.ts +3 -0
- package/dist/infra/process/transport-handlers.js +82 -5
- package/dist/infra/process/transport-worker.js +9 -69
- package/dist/infra/repl/commands/connectors-command.d.ts +8 -0
- package/dist/infra/repl/commands/{gen-rules-command.js → connectors-command.js} +21 -10
- package/dist/infra/repl/commands/index.js +8 -4
- package/dist/infra/repl/commands/init-command.js +11 -7
- package/dist/infra/repl/commands/new-command.d.ts +14 -0
- package/dist/infra/repl/commands/new-command.js +61 -0
- package/dist/infra/repl/commands/query-command.js +22 -2
- package/dist/infra/repl/commands/{clear-command.d.ts → reset-command.d.ts} +2 -2
- package/dist/infra/repl/commands/{clear-command.js → reset-command.js} +11 -11
- package/dist/infra/transport/socket-io-transport-client.d.ts +68 -0
- package/dist/infra/transport/socket-io-transport-client.js +283 -7
- package/dist/infra/usecase/connectors-use-case.d.ts +59 -0
- package/dist/infra/usecase/connectors-use-case.js +203 -0
- package/dist/infra/usecase/init-use-case.d.ts +8 -43
- package/dist/infra/usecase/init-use-case.js +29 -253
- package/dist/infra/usecase/logout-use-case.js +2 -2
- package/dist/infra/usecase/pull-use-case.js +5 -5
- package/dist/infra/usecase/push-use-case.js +5 -5
- package/dist/infra/usecase/{clear-use-case.d.ts → reset-use-case.d.ts} +5 -5
- package/dist/infra/usecase/{clear-use-case.js → reset-use-case.js} +7 -8
- package/dist/infra/usecase/space-list-use-case.js +3 -3
- package/dist/infra/usecase/space-switch-use-case.js +3 -3
- package/dist/resources/prompts/curate.yml +75 -13
- package/dist/resources/prompts/explore.yml +34 -0
- package/dist/resources/prompts/query-orchestrator.yml +112 -0
- package/dist/resources/prompts/system-prompt.yml +12 -2
- package/dist/resources/tools/curate.txt +60 -15
- package/dist/resources/tools/search_knowledge.txt +32 -0
- package/dist/templates/sections/brv-instructions.md +98 -0
- package/dist/tui/components/inline-prompts/inline-confirm.js +2 -2
- package/dist/tui/components/onboarding/onboarding-flow.js +14 -10
- package/dist/tui/components/onboarding/welcome-box.js +1 -1
- package/dist/tui/contexts/onboarding-context.d.ts +4 -0
- package/dist/tui/contexts/onboarding-context.js +14 -2
- package/dist/tui/views/command-view.js +19 -0
- package/dist/utils/file-validator.d.ts +1 -1
- package/dist/utils/file-validator.js +34 -35
- package/dist/utils/type-guards.d.ts +5 -0
- package/dist/utils/type-guards.js +7 -0
- package/oclif.manifest.json +32 -6
- package/package.json +4 -1
- package/dist/config/context-tree-domains.d.ts +0 -29
- package/dist/config/context-tree-domains.js +0 -29
- package/dist/core/interfaces/usecase/i-generate-rules-use-case.d.ts +0 -3
- package/dist/infra/repl/commands/gen-rules-command.d.ts +0 -7
- package/dist/infra/rule/agent-rule-config.d.ts +0 -19
- package/dist/infra/usecase/generate-rules-use-case.d.ts +0 -61
- package/dist/infra/usecase/generate-rules-use-case.js +0 -285
- /package/dist/core/interfaces/{usecase/i-clear-use-case.js → connectors/connector-types.js} +0 -0
- /package/dist/core/interfaces/{usecase/i-generate-rules-use-case.js → connectors/i-connector-manager.js} +0 -0
- /package/dist/infra/{rule → connectors/shared}/constants.d.ts +0 -0
- /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
|
|
14
|
-
- the
|
|
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. **
|
|
47
|
-
|
|
48
|
-
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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. **
|
|
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
|
-
- `
|
|
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
|
|
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
|
|
5
|
-
- Requires: path, content
|
|
6
|
-
- Example
|
|
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
|
-
|
|
9
|
-
- Requires: path,
|
|
10
|
-
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
**
|
|
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 {
|
|
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 (
|
|
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 = '
|
|
20
|
-
const QUERY_PROMPT = '
|
|
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 = (
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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
|
};
|