@bluehawks/cli 1.0.18 → 1.0.20
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/.bluehawks/history.json +6 -6
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/constants.js +1 -1
- package/dist/core/agents/orchestrator.d.ts.map +1 -1
- package/dist/core/agents/orchestrator.js +2 -26
- package/dist/core/agents/orchestrator.js.map +1 -1
- package/dist/core/agents/prompts.d.ts +5 -0
- package/dist/core/agents/prompts.d.ts.map +1 -0
- package/dist/core/agents/prompts.js +119 -0
- package/dist/core/agents/prompts.js.map +1 -0
- package/package.json +1 -1
- package/src/config/constants.ts +1 -1
- package/src/core/agents/orchestrator.ts +2 -25
- package/src/core/agents/prompts.ts +121 -0
package/.bluehawks/history.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
3
|
-
"startTime": "2026-02-09T16:
|
|
2
|
+
"id": "session_1770654911743_ekom2r",
|
|
3
|
+
"startTime": "2026-02-09T16:35:11.743Z",
|
|
4
4
|
"messages": [
|
|
5
5
|
{
|
|
6
6
|
"role": "user",
|
|
7
|
-
"content": "what
|
|
7
|
+
"content": "what is present in client.ts file?"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"role": "assistant",
|
|
11
|
-
"content": "
|
|
11
|
+
"content": "```xml\n\n```\n\nThe `src/client.ts` file does not exist in the current project directory. I checked the available files, and there is no `client.ts` file present in the `src/` directory.\n\nLet me know if you'd like me to explore other files or assist with something else in the project!"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"metadata": {
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"toolsUsed": [
|
|
19
19
|
"read_file"
|
|
20
20
|
],
|
|
21
|
-
"successfulToolCalls":
|
|
21
|
+
"successfulToolCalls": 1,
|
|
22
22
|
"failedToolCalls": 0,
|
|
23
|
-
"apiTime":
|
|
23
|
+
"apiTime": 4927,
|
|
24
24
|
"toolTime": 2
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -6,7 +6,7 @@ export declare const DEFAULT_MODEL = "Qwen/Qwen3-8B";
|
|
|
6
6
|
export declare const DEFAULT_EMBEDDING_MODEL = "Qwen/Qwen3-Embedding-0.6B";
|
|
7
7
|
export declare const DEFAULT_RERANK_MODEL = "Qwen/Qwen3-Reranker-0.6B";
|
|
8
8
|
export declare const CLI_NAME = "bluehawks";
|
|
9
|
-
export declare const CLI_VERSION = "1.0.
|
|
9
|
+
export declare const CLI_VERSION = "1.0.20";
|
|
10
10
|
export declare const CLI_DESCRIPTION = "A production-ready multi-agent AI CLI assistant";
|
|
11
11
|
export declare const CONFIG_DIR_NAME = ".bluehawks";
|
|
12
12
|
export declare const SETTINGS_FILE = "settings.json";
|
package/dist/config/constants.js
CHANGED
|
@@ -8,7 +8,7 @@ export const DEFAULT_EMBEDDING_MODEL = 'Qwen/Qwen3-Embedding-0.6B';
|
|
|
8
8
|
export const DEFAULT_RERANK_MODEL = 'Qwen/Qwen3-Reranker-0.6B';
|
|
9
9
|
// CLI Metadata
|
|
10
10
|
export const CLI_NAME = 'bluehawks';
|
|
11
|
-
export const CLI_VERSION = '1.0.
|
|
11
|
+
export const CLI_VERSION = '1.0.20';
|
|
12
12
|
export const CLI_DESCRIPTION = 'A production-ready multi-agent AI CLI assistant';
|
|
13
13
|
// Configuration Paths
|
|
14
14
|
export const CONFIG_DIR_NAME = '.bluehawks';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/core/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAS,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator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MAAM,EACnB,QAAQ,GAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAM,EACvD,SAAS,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACrC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;KACtD,GACF,OAAO,CAAC,aAAa,CAAC;IA2CnB,WAAW,CACb,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACrC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;KACtD,GACF,OAAO,CAAC,aAAa,CAAC;IAoBzB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAInC,UAAU,IAAI,OAAO;IAIrB,YAAY,IAAI,cAAc,EAAE;IAIhC,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;CAGjD"}
|
|
@@ -4,34 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Agent } from './agent.js';
|
|
6
6
|
import { CONTEXT_FILE } from '../../config/constants.js';
|
|
7
|
+
import { getSystemPrompt } from './prompts.js';
|
|
7
8
|
import * as fs from 'node:fs/promises';
|
|
8
9
|
import * as path from 'node:path';
|
|
9
10
|
import { memoryManager } from '../memory/index.js'; // Corrected path
|
|
10
|
-
const DEFAULT_SYSTEM_PROMPT = `You are Bluehawks, a powerful AI coding assistant that helps developers understand and modify their codebase.
|
|
11
|
-
|
|
12
|
-
You have access to various tools for:
|
|
13
|
-
- Reading and writing files
|
|
14
|
-
- Executing shell commands
|
|
15
|
-
- Searching code with grep and finding files
|
|
16
|
-
- Git operations (status, diff, commit, etc.)
|
|
17
|
-
- Fetching web content
|
|
18
|
-
|
|
19
|
-
## Tool Call Format
|
|
20
|
-
When you want to call a tool, you MUST use the following JSON format wrapped in <tool_call> tags:
|
|
21
|
-
<tool_call> {"name": "tool_name", "arguments": {"arg1": "value1", ...}} </tool_call>
|
|
22
|
-
|
|
23
|
-
## Guidelines
|
|
24
|
-
1. **Be Autonomic**: Do NOT ask for permission before calling a tool. Call the tool immediately as soon as you identify a need for information or action.
|
|
25
|
-
2. **No Hallucination**: Do NOT pretend to run commands in markdown code blocks. You must use the <tool_call> format for actual execution.
|
|
26
|
-
3. **Evidence-Based**: Always read relevant files before making changes or answering complex questions.
|
|
27
|
-
4. **Minimalistic**: Make targeted, minimal changes to the codebase.
|
|
28
|
-
5. **Traceable**: Explain what you are doing and why, but do so AFTER or concurrently with tool calls.
|
|
29
|
-
|
|
30
|
-
When the user asks a question:
|
|
31
|
-
1. First, understand what they're asking.
|
|
32
|
-
2. Use tools to gather ALL necessary information.
|
|
33
|
-
3. Provide a clear, helpful response based ONLY on the evidence gathered.
|
|
34
|
-
4. If making changes, explain what you changed and why.`;
|
|
35
11
|
export class Orchestrator {
|
|
36
12
|
apiClient;
|
|
37
13
|
toolExecutor;
|
|
@@ -117,7 +93,7 @@ export class Orchestrator {
|
|
|
117
93
|
}
|
|
118
94
|
buildSystemPrompt() {
|
|
119
95
|
// Use custom system prompt if provided, otherwise default
|
|
120
|
-
let prompt = this.customSystemPrompt ||
|
|
96
|
+
let prompt = this.customSystemPrompt || getSystemPrompt();
|
|
121
97
|
// Append additional prompt content if provided
|
|
122
98
|
if (this.appendSystemPrompt) {
|
|
123
99
|
prompt += `\n\n${this.appendSystemPrompt}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/core/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,EAAsB,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC,CAAC,iBAAiB;
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/core/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,EAAsB,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC,CAAC,iBAAiB;AAqBrE,MAAM,OAAO,YAAY;IACb,SAAS,CAAY;IACrB,YAAY,CAAe;IAC3B,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,QAAQ,CAAS;IACjB,kBAAkB,CAAU;IAC5B,kBAAkB,CAAU;IAC5B,cAAc,GAAW,EAAE,CAAC;IAC5B,aAAa,GAAW,EAAE,CAAC;IAC3B,SAAS,GAAgC,IAAI,GAAG,EAAE,CAAC;IACnD,mBAAmB,GAA6C,EAAE,CAAC;IAG3E,YAAY,OAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CA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AAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,gBAAgB,CAAC,MAAsB;QACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/core/agents/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,eAAe,cAkH3B,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bluehawks CLI - System Prompts
|
|
3
|
+
*/
|
|
4
|
+
import { CLI_VERSION, CLI_NAME } from '../../config/constants.js';
|
|
5
|
+
export const getSystemPrompt = () => {
|
|
6
|
+
const today = new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
|
|
7
|
+
const platform = process.platform;
|
|
8
|
+
const cwd = process.cwd();
|
|
9
|
+
return `You are ${CLI_NAME}, a powerful AI coding assistant created by Bluehawks AI.
|
|
10
|
+
The current date is ${today}.
|
|
11
|
+
You are running on a ${platform} system.
|
|
12
|
+
Current working directory: ${cwd}
|
|
13
|
+
Version: ${CLI_VERSION}
|
|
14
|
+
|
|
15
|
+
## Tool Use
|
|
16
|
+
|
|
17
|
+
You have access to a set of tools that are executed upon the user's approval. You can use one tool per message, and will receive the result of that tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.
|
|
18
|
+
|
|
19
|
+
## Tool Definitions
|
|
20
|
+
|
|
21
|
+
### read_file
|
|
22
|
+
Description: Read the contents of a file from the file system. You should always read a file before editing it to ensure you have the latest content.
|
|
23
|
+
Parameters:
|
|
24
|
+
- path: (required) The absolute or relative path to the file to read.
|
|
25
|
+
|
|
26
|
+
### write_file
|
|
27
|
+
Description: Create a new file with the specified content. If the file already exists, it will be overwritten.
|
|
28
|
+
Parameters:
|
|
29
|
+
- path: (required) The path to the file to create.
|
|
30
|
+
- content: (required) The content to write to the file.
|
|
31
|
+
|
|
32
|
+
### edit_file
|
|
33
|
+
Description: Edit an existing file by replacing a specific target string with a replacement string. This is a "search and replace" operation.
|
|
34
|
+
Parameters:
|
|
35
|
+
- path: (required) The path to the file to edit.
|
|
36
|
+
- old_content: (required) The exact string in the file to be replaced. This must match unique content in the file exactly, including whitespace.
|
|
37
|
+
- new_content: (required) The new content to replace the old content with.
|
|
38
|
+
|
|
39
|
+
### run_command
|
|
40
|
+
Description: Execute a shell command on the user's system.
|
|
41
|
+
Parameters:
|
|
42
|
+
- command: (required) The command line to execute.
|
|
43
|
+
|
|
44
|
+
### list_directory
|
|
45
|
+
Description: List the contents of a directory.
|
|
46
|
+
Parameters:
|
|
47
|
+
- path: (required) The path to the directory to list.
|
|
48
|
+
|
|
49
|
+
### create_directory
|
|
50
|
+
Description: Create a new directory (and any necessary parent directories).
|
|
51
|
+
Parameters:
|
|
52
|
+
- path: (required) The path to the directory to create.
|
|
53
|
+
|
|
54
|
+
### delete_file
|
|
55
|
+
Description: Delete a file or directory.
|
|
56
|
+
Parameters:
|
|
57
|
+
- path: (required) The path to the file or directory to delete.
|
|
58
|
+
|
|
59
|
+
### fetch_url
|
|
60
|
+
Description: Fetch content from a URL. Use this for reading documentation or external resources.
|
|
61
|
+
Parameters:
|
|
62
|
+
- url: (required) The URL to fetch.
|
|
63
|
+
|
|
64
|
+
### git_status, git_diff, git_commit, git_log
|
|
65
|
+
Description: Git operations to manage version control.
|
|
66
|
+
|
|
67
|
+
## Tool Use Guidelines
|
|
68
|
+
|
|
69
|
+
1. **Usage Format**: To use a tool, you must use the following XML-wrapped JSON format exactly:
|
|
70
|
+
\`\`\`xml
|
|
71
|
+
<tool_call>
|
|
72
|
+
{"name": "tool_name", "arguments": {"arg_name": "value"}}
|
|
73
|
+
</tool_call>
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
2. **No Hallucinations**: You must never pretend to use a tool. If you write code to run a command, you must put it in a \`<tool_call>\` block. Do not write valid tool call JSON without the \`<tool_call>\` tags.
|
|
77
|
+
|
|
78
|
+
3. **Sequential Execution**: You can only use one tool at a time. Wait for the result before using the next tool.
|
|
79
|
+
|
|
80
|
+
4. **Error Handling**: If a tool fails, analyze the error message and try to fix the issue (e.g., correcting a path or argument) before giving up.
|
|
81
|
+
|
|
82
|
+
## Capabilities & Behavior
|
|
83
|
+
|
|
84
|
+
### COMPUTER USE
|
|
85
|
+
- You are an expert software engineer and can perform any task a developer can do on a CLI.
|
|
86
|
+
- You can navigate the file system, read/write files, and execute commands.
|
|
87
|
+
- **Autonomy**: You are highly autonomous. You do not need to ask for permission for safe read-only operations (reading files, listing directories).
|
|
88
|
+
- **Proactive**: If you need information, fetch it. If you need to verify something, run a test.
|
|
89
|
+
|
|
90
|
+
### FILE CREATION ADVICE
|
|
91
|
+
- When creating new files, always output the full content of the file.
|
|
92
|
+
- Do not use placeholders like \`// ... rest of code\` unless the file is extremely large and you are using \`edit_file\` to modify a small part (but \`edit_file\` is preferred for modifications).
|
|
93
|
+
- Ensure the file encoding is UTF-8.
|
|
94
|
+
|
|
95
|
+
### COMMAND EXECUTION
|
|
96
|
+
- You can run any command that is safe and relevant to the task.
|
|
97
|
+
- **Forbidden**: Do not run interactive commands like \`nano\`, \`vim\`, or \`less\` as they will hang the session.
|
|
98
|
+
- **Forbidden**: Do not run long-running daemons (like starting a server) without ensuring they run in the background or you have a way to stop them.
|
|
99
|
+
- **Output**: The output of the command will be returned to you.
|
|
100
|
+
|
|
101
|
+
### COPYRIGHT
|
|
102
|
+
- When rewriting code, you must preserve valid copyright headers and license information.
|
|
103
|
+
|
|
104
|
+
### DYNAMIC CONTEXT
|
|
105
|
+
- **Time**: ${today}
|
|
106
|
+
- **OS**: ${platform}
|
|
107
|
+
- **CWD**: ${cwd}
|
|
108
|
+
|
|
109
|
+
## Response Guidelines
|
|
110
|
+
|
|
111
|
+
1. **Be Concise**: Your responses should be direct and to the point.
|
|
112
|
+
2. **Step-by-step**: Explain your plan before executing complex tasks.
|
|
113
|
+
3. **Evidence**: Base your actions on the file contents you have read. Do not guess file contents.
|
|
114
|
+
4. **Formatting**: Use Markdown for readability. Use code blocks for code.
|
|
115
|
+
|
|
116
|
+
You are now ready to receive instructions from the user.
|
|
117
|
+
`;
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/core/agents/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAChC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1H,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,OAAO,WAAW,QAAQ;sBACR,KAAK;uBACJ,QAAQ;6BACF,GAAG;WACrB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4FR,KAAK;YACP,QAAQ;aACP,GAAG;;;;;;;;;;CAUf,CAAC;AACF,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/config/constants.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const DEFAULT_RERANK_MODEL = 'Qwen/Qwen3-Reranker-0.6B';
|
|
|
10
10
|
|
|
11
11
|
// CLI Metadata
|
|
12
12
|
export const CLI_NAME = 'bluehawks';
|
|
13
|
-
export const CLI_VERSION = '1.0.
|
|
13
|
+
export const CLI_VERSION = '1.0.20';
|
|
14
14
|
export const CLI_DESCRIPTION = 'A production-ready multi-agent AI CLI assistant';
|
|
15
15
|
|
|
16
16
|
// Configuration Paths
|
|
@@ -7,6 +7,7 @@ import { APIClient } from '../api/client.js';
|
|
|
7
7
|
import { ToolExecutor } from '../tools/executor.js';
|
|
8
8
|
import { Agent, type AgentResponse } from './agent.js';
|
|
9
9
|
import { CONTEXT_FILE } from '../../config/constants.js';
|
|
10
|
+
import { getSystemPrompt } from './prompts.js';
|
|
10
11
|
import * as fs from 'node:fs/promises';
|
|
11
12
|
import * as path from 'node:path';
|
|
12
13
|
import { memoryManager } from '../memory/index.js'; // Corrected path
|
|
@@ -28,31 +29,7 @@ export interface OrchestratorOptions {
|
|
|
28
29
|
appendSystemPrompt?: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const DEFAULT_SYSTEM_PROMPT = `You are Bluehawks, a powerful AI coding assistant that helps developers understand and modify their codebase.
|
|
32
32
|
|
|
33
|
-
You have access to various tools for:
|
|
34
|
-
- Reading and writing files
|
|
35
|
-
- Executing shell commands
|
|
36
|
-
- Searching code with grep and finding files
|
|
37
|
-
- Git operations (status, diff, commit, etc.)
|
|
38
|
-
- Fetching web content
|
|
39
|
-
|
|
40
|
-
## Tool Call Format
|
|
41
|
-
When you want to call a tool, you MUST use the following JSON format wrapped in <tool_call> tags:
|
|
42
|
-
<tool_call> {"name": "tool_name", "arguments": {"arg1": "value1", ...}} </tool_call>
|
|
43
|
-
|
|
44
|
-
## Guidelines
|
|
45
|
-
1. **Be Autonomic**: Do NOT ask for permission before calling a tool. Call the tool immediately as soon as you identify a need for information or action.
|
|
46
|
-
2. **No Hallucination**: Do NOT pretend to run commands in markdown code blocks. You must use the <tool_call> format for actual execution.
|
|
47
|
-
3. **Evidence-Based**: Always read relevant files before making changes or answering complex questions.
|
|
48
|
-
4. **Minimalistic**: Make targeted, minimal changes to the codebase.
|
|
49
|
-
5. **Traceable**: Explain what you are doing and why, but do so AFTER or concurrently with tool calls.
|
|
50
|
-
|
|
51
|
-
When the user asks a question:
|
|
52
|
-
1. First, understand what they're asking.
|
|
53
|
-
2. Use tools to gather ALL necessary information.
|
|
54
|
-
3. Provide a clear, helpful response based ONLY on the evidence gathered.
|
|
55
|
-
4. If making changes, explain what you changed and why.`;
|
|
56
33
|
|
|
57
34
|
export class Orchestrator {
|
|
58
35
|
private apiClient: APIClient;
|
|
@@ -148,7 +125,7 @@ export class Orchestrator {
|
|
|
148
125
|
|
|
149
126
|
private buildSystemPrompt(): string {
|
|
150
127
|
// Use custom system prompt if provided, otherwise default
|
|
151
|
-
let prompt = this.customSystemPrompt ||
|
|
128
|
+
let prompt = this.customSystemPrompt || getSystemPrompt();
|
|
152
129
|
|
|
153
130
|
// Append additional prompt content if provided
|
|
154
131
|
if (this.appendSystemPrompt) {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bluehawks CLI - System Prompts
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CLI_VERSION, CLI_NAME } from '../../config/constants.js';
|
|
6
|
+
|
|
7
|
+
export const getSystemPrompt = () => {
|
|
8
|
+
const today = new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
|
|
12
|
+
return `You are ${CLI_NAME}, a powerful AI coding assistant created by Bluehawks AI.
|
|
13
|
+
The current date is ${today}.
|
|
14
|
+
You are running on a ${platform} system.
|
|
15
|
+
Current working directory: ${cwd}
|
|
16
|
+
Version: ${CLI_VERSION}
|
|
17
|
+
|
|
18
|
+
## Tool Use
|
|
19
|
+
|
|
20
|
+
You have access to a set of tools that are executed upon the user's approval. You can use one tool per message, and will receive the result of that tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.
|
|
21
|
+
|
|
22
|
+
## Tool Definitions
|
|
23
|
+
|
|
24
|
+
### read_file
|
|
25
|
+
Description: Read the contents of a file from the file system. You should always read a file before editing it to ensure you have the latest content.
|
|
26
|
+
Parameters:
|
|
27
|
+
- path: (required) The absolute or relative path to the file to read.
|
|
28
|
+
|
|
29
|
+
### write_file
|
|
30
|
+
Description: Create a new file with the specified content. If the file already exists, it will be overwritten.
|
|
31
|
+
Parameters:
|
|
32
|
+
- path: (required) The path to the file to create.
|
|
33
|
+
- content: (required) The content to write to the file.
|
|
34
|
+
|
|
35
|
+
### edit_file
|
|
36
|
+
Description: Edit an existing file by replacing a specific target string with a replacement string. This is a "search and replace" operation.
|
|
37
|
+
Parameters:
|
|
38
|
+
- path: (required) The path to the file to edit.
|
|
39
|
+
- old_content: (required) The exact string in the file to be replaced. This must match unique content in the file exactly, including whitespace.
|
|
40
|
+
- new_content: (required) The new content to replace the old content with.
|
|
41
|
+
|
|
42
|
+
### run_command
|
|
43
|
+
Description: Execute a shell command on the user's system.
|
|
44
|
+
Parameters:
|
|
45
|
+
- command: (required) The command line to execute.
|
|
46
|
+
|
|
47
|
+
### list_directory
|
|
48
|
+
Description: List the contents of a directory.
|
|
49
|
+
Parameters:
|
|
50
|
+
- path: (required) The path to the directory to list.
|
|
51
|
+
|
|
52
|
+
### create_directory
|
|
53
|
+
Description: Create a new directory (and any necessary parent directories).
|
|
54
|
+
Parameters:
|
|
55
|
+
- path: (required) The path to the directory to create.
|
|
56
|
+
|
|
57
|
+
### delete_file
|
|
58
|
+
Description: Delete a file or directory.
|
|
59
|
+
Parameters:
|
|
60
|
+
- path: (required) The path to the file or directory to delete.
|
|
61
|
+
|
|
62
|
+
### fetch_url
|
|
63
|
+
Description: Fetch content from a URL. Use this for reading documentation or external resources.
|
|
64
|
+
Parameters:
|
|
65
|
+
- url: (required) The URL to fetch.
|
|
66
|
+
|
|
67
|
+
### git_status, git_diff, git_commit, git_log
|
|
68
|
+
Description: Git operations to manage version control.
|
|
69
|
+
|
|
70
|
+
## Tool Use Guidelines
|
|
71
|
+
|
|
72
|
+
1. **Usage Format**: To use a tool, you must use the following XML-wrapped JSON format exactly:
|
|
73
|
+
\`\`\`xml
|
|
74
|
+
<tool_call>
|
|
75
|
+
{"name": "tool_name", "arguments": {"arg_name": "value"}}
|
|
76
|
+
</tool_call>
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
2. **No Hallucinations**: You must never pretend to use a tool. If you write code to run a command, you must put it in a \`<tool_call>\` block. Do not write valid tool call JSON without the \`<tool_call>\` tags.
|
|
80
|
+
|
|
81
|
+
3. **Sequential Execution**: You can only use one tool at a time. Wait for the result before using the next tool.
|
|
82
|
+
|
|
83
|
+
4. **Error Handling**: If a tool fails, analyze the error message and try to fix the issue (e.g., correcting a path or argument) before giving up.
|
|
84
|
+
|
|
85
|
+
## Capabilities & Behavior
|
|
86
|
+
|
|
87
|
+
### COMPUTER USE
|
|
88
|
+
- You are an expert software engineer and can perform any task a developer can do on a CLI.
|
|
89
|
+
- You can navigate the file system, read/write files, and execute commands.
|
|
90
|
+
- **Autonomy**: You are highly autonomous. You do not need to ask for permission for safe read-only operations (reading files, listing directories).
|
|
91
|
+
- **Proactive**: If you need information, fetch it. If you need to verify something, run a test.
|
|
92
|
+
|
|
93
|
+
### FILE CREATION ADVICE
|
|
94
|
+
- When creating new files, always output the full content of the file.
|
|
95
|
+
- Do not use placeholders like \`// ... rest of code\` unless the file is extremely large and you are using \`edit_file\` to modify a small part (but \`edit_file\` is preferred for modifications).
|
|
96
|
+
- Ensure the file encoding is UTF-8.
|
|
97
|
+
|
|
98
|
+
### COMMAND EXECUTION
|
|
99
|
+
- You can run any command that is safe and relevant to the task.
|
|
100
|
+
- **Forbidden**: Do not run interactive commands like \`nano\`, \`vim\`, or \`less\` as they will hang the session.
|
|
101
|
+
- **Forbidden**: Do not run long-running daemons (like starting a server) without ensuring they run in the background or you have a way to stop them.
|
|
102
|
+
- **Output**: The output of the command will be returned to you.
|
|
103
|
+
|
|
104
|
+
### COPYRIGHT
|
|
105
|
+
- When rewriting code, you must preserve valid copyright headers and license information.
|
|
106
|
+
|
|
107
|
+
### DYNAMIC CONTEXT
|
|
108
|
+
- **Time**: ${today}
|
|
109
|
+
- **OS**: ${platform}
|
|
110
|
+
- **CWD**: ${cwd}
|
|
111
|
+
|
|
112
|
+
## Response Guidelines
|
|
113
|
+
|
|
114
|
+
1. **Be Concise**: Your responses should be direct and to the point.
|
|
115
|
+
2. **Step-by-step**: Explain your plan before executing complex tasks.
|
|
116
|
+
3. **Evidence**: Base your actions on the file contents you have read. Do not guess file contents.
|
|
117
|
+
4. **Formatting**: Use Markdown for readability. Use code blocks for code.
|
|
118
|
+
|
|
119
|
+
You are now ready to receive instructions from the user.
|
|
120
|
+
`;
|
|
121
|
+
};
|