@bluehawks/cli 1.0.18 → 1.0.19
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 +7 -7
- 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 +69 -22
- package/dist/core/agents/orchestrator.js.map +1 -1
- package/package.json +1 -1
- package/src/config/constants.ts +1 -1
- package/src/core/agents/orchestrator.ts +73 -26
package/.bluehawks/history.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
3
|
-
"startTime": "2026-02-09T16:
|
|
2
|
+
"id": "session_1770653822952_gz4f15",
|
|
3
|
+
"startTime": "2026-02-09T16:17:02.952Z",
|
|
4
4
|
"messages": [
|
|
5
5
|
{
|
|
6
6
|
"role": "user",
|
|
7
|
-
"content": "
|
|
7
|
+
"content": "What does the file tsconfig.json contain?"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"role": "assistant",
|
|
11
|
-
"content": "It
|
|
11
|
+
"content": "It appears that `src/tsconfig.json` does not exist in the current project structure. I will verify the presence of a `tsconfig.json` file in the root directory instead.\n\nThe `tsconfig.json` file contains the configuration settings for TypeScript compilation in the project. Here's a breakdown of its key components:\n\n### Compiler Options:\n- **`target: \"ES2022\"`**: Compiles code to ECMAScript 2022 standards.\n- **`module: \"NodeNext\"`**: Uses the Node.js module resolution system with next features.\n- **`moduleResolution: \"NodeNext\"`**: Enables Node.js-style module resolution with advanced features.\n- **`lib: [\"ES2022\", \"DOM\"]`**: Includes the ES2022 and DOM standard libraries.\n- **`types: [\"node\"]`**: Adds Node.js type definitions.\n- **`outDir: \"dist\"`**: Outputs compiled JavaScript files to the `dist` directory.\n- **`rootDir: \"src\"`**: Specifies the root source directory (`src`).\n- **`strict: true`**: Enables strict type-checking.\n- **`esModuleInterop: true`**: Enables interoperability with ES modules.\n- **`skipLibCheck: true`**: Skips type checking of library files.\n- **`forceConsistentCasingInFileNames: true`**: Enforces consistent casing in file names.\n- **`resolveJsonModule: true`**: Enables JSON module resolution.\n- **`declaration: true`**: Generates `.d.ts` declaration files.\n- **`declarationMap: true`**: Creates source map files for declarations.\n- **`sourceMap: true`**: Generates source maps for better debugging.\n- **`jsx: \"react-jsx\"`**: Uses React JSX syntax.\n- **`jsxImportSource: \"react\"`**: Specifies the import source for JSX (React).\n- **`noImplicitAny: true`**: Disallows implicit `any` types.\n- **`noImplicitReturns: true`**: Requires explicit returns in functions.\n- **`noUnusedLocals: true`**: Warns about unused local variables.\n- **`noUnusedParameters: true`**: Warns about unused function parameters.\n- **`exactOptionalPropertyTypes: false`**: Allows optional properties to be treated as any type.\n- **`noFallthroughCasesInSwitch: true`**: Enforces that all cases in a `switch` statement are covered.\n\n### Include & Exclude:\n- **`include: [\"src/**/*\"]`**: Includes all files under the `src` directory.\n- **`exclude: [\"node_modules\", \"dist\", \"**/*.test.ts\"]`**: Excludes `node_modules`, the `dist` folder, and all `.test.ts` files.\n\nThis configuration ensures strict type safety, proper module resolution, and clean output generation for 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": 2,
|
|
22
22
|
"failedToolCalls": 0,
|
|
23
|
-
"apiTime":
|
|
24
|
-
"toolTime":
|
|
23
|
+
"apiTime": 20330,
|
|
24
|
+
"toolTime": 3
|
|
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.19";
|
|
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.19';
|
|
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;AAMvD,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EA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
import { memoryManager } from '../memory/index.js'; // Corrected path
|
|
10
|
-
const
|
|
10
|
+
const getSystemPrompt = () => `You are Bluehawks, a powerful AI coding assistant created by Bluehawks AI.
|
|
11
|
+
The current date is ${new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}.
|
|
12
|
+
You are running on a ${process.platform} system.
|
|
13
|
+
Current working directory: ${process.cwd()}
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- Executing shell commands
|
|
15
|
-
- Searching code with grep and finding files
|
|
16
|
-
- Git operations (status, diff, commit, etc.)
|
|
17
|
-
- Fetching web content
|
|
15
|
+
## High-Level Objective
|
|
16
|
+
You are a highly capable, agentic AI software engineer. Your goal is to help the user achieve their coding tasks efficiently and accurately. You have access to a suite of tools to read files, write code, run commands, and fetch web content.
|
|
18
17
|
|
|
19
|
-
##
|
|
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>
|
|
18
|
+
## Available Tools & Capabilities
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
### File System Operations
|
|
21
|
+
- **read_file(path)**: Read file contents. Always read a file before editing it to ensure you have the latest context.
|
|
22
|
+
- **write_file(path, content)**: Create new files.
|
|
23
|
+
- **edit_file(path, old_content, new_content)**: Edit existing files by replacing unique string blocks.
|
|
24
|
+
- **delete_file(path)**: Delete files or directories.
|
|
25
|
+
- **list_directory(path)**: List files and folders.
|
|
26
|
+
- **create_directory(path)**: Create new directories.
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
### Command Execution
|
|
29
|
+
- **run_command(command)**: Execute shell commands.
|
|
30
|
+
- **Allowed**: \`npm test\`, \`git status\`, \`ls -la\`, build scripts, etc.
|
|
31
|
+
- **Forbidden**: Interactive commands (e.g., \`nano\`, \`vim\`), long-running daemons without background flags.
|
|
32
|
+
- **Best Practice**: Run commands to verify your changes (e.g., \`npm run build\` after a refactor).
|
|
33
|
+
|
|
34
|
+
### Web Access
|
|
35
|
+
- **fetch_url(url)**: Fetch content from external URLs for documentation or research.
|
|
36
|
+
|
|
37
|
+
### Git Integration
|
|
38
|
+
- **git_status()**: Check working tree status.
|
|
39
|
+
- **git_diff()**: View unstaged changes.
|
|
40
|
+
- **git_commit(message)**: Commit changes.
|
|
41
|
+
- **git_log()**: View history.
|
|
42
|
+
|
|
43
|
+
## Critical Rules & Behaviors
|
|
44
|
+
|
|
45
|
+
1. **Autonomic & Proactive**:
|
|
46
|
+
- **Do NOT ask for permission** to run safe tools (reading files, listing dirs).
|
|
47
|
+
- **Do NOT ask for confirmation** before fixing obvious bugs or following the user's explicit plan.
|
|
48
|
+
- **Just do it**. If you need info, call the tool.
|
|
49
|
+
- **Only stop** if you are modifying critical system files or performing destructive actions outside the project scope.
|
|
50
|
+
|
|
51
|
+
2. **No Hallucinations**:
|
|
52
|
+
- **NEVER** pretend to run a command. If you say "I will run...", you MUST output a \`<tool_call>\` block.
|
|
53
|
+
- **NEVER** invent file contents. Always use \`read_file\` to see what exists.
|
|
54
|
+
|
|
55
|
+
3. **Tool Call Format (Strict)**:
|
|
56
|
+
- You **MUST** use the following XML-wrapped JSON format for ALL tool calls:
|
|
57
|
+
\`\`\`xml
|
|
58
|
+
<tool_call>
|
|
59
|
+
{"name": "tool_name", "arguments": {"arg1": "value1", ...}}
|
|
60
|
+
</tool_call>
|
|
61
|
+
\`\`\`
|
|
62
|
+
- **Do NOT** use markdown code blocks for tool calls.
|
|
63
|
+
- **Do NOT** output plain JSON without the tag.
|
|
64
|
+
|
|
65
|
+
4. **Workflow**:
|
|
66
|
+
- **Explore**: Start by understanding the codebase. Use \`list_directory\` and \`read_file\`.
|
|
67
|
+
- **Plan**: For complex changes, propose a plan first.
|
|
68
|
+
- **Execute**: Make changes incrementally.
|
|
69
|
+
- **Verify**: Run tests or build commands to ensure your changes work.
|
|
70
|
+
|
|
71
|
+
5. **Output Style**:
|
|
72
|
+
- Be concise.
|
|
73
|
+
- Use markdown for headers, lists, and code blocks.
|
|
74
|
+
- When showing code edits, use \`diff\` blocks or clearly explicitly state what changed.
|
|
75
|
+
|
|
76
|
+
6. **Coding Standards**:
|
|
77
|
+
- Write clean, maintainable, typed code (TypeScript preferred).
|
|
78
|
+
- Follow existing project patterns.
|
|
79
|
+
- Ensure version bumps are recorded in \`package.json\` when significant features are added.
|
|
80
|
+
|
|
81
|
+
You are now ready to assist.`;
|
|
35
82
|
export class Orchestrator {
|
|
36
83
|
apiClient;
|
|
37
84
|
toolExecutor;
|
|
@@ -117,7 +164,7 @@ export class Orchestrator {
|
|
|
117
164
|
}
|
|
118
165
|
buildSystemPrompt() {
|
|
119
166
|
// Use custom system prompt if provided, otherwise default
|
|
120
|
-
let prompt = this.customSystemPrompt ||
|
|
167
|
+
let prompt = this.customSystemPrompt || getSystemPrompt();
|
|
121
168
|
// Append additional prompt content if provided
|
|
122
169
|
if (this.appendSystemPrompt) {
|
|
123
170
|
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;AAmBrE,MAAM,
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/core/agents/orchestrator.ts"],"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,gBAAgB,CAAC,MAAsB;QACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ"}
|
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.19';
|
|
14
14
|
export const CLI_DESCRIPTION = 'A production-ready multi-agent AI CLI assistant';
|
|
15
15
|
|
|
16
16
|
// Configuration Paths
|
|
@@ -28,31 +28,78 @@ export interface OrchestratorOptions {
|
|
|
28
28
|
appendSystemPrompt?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
You
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
31
|
+
const getSystemPrompt = () => `You are Bluehawks, a powerful AI coding assistant created by Bluehawks AI.
|
|
32
|
+
The current date is ${new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}.
|
|
33
|
+
You are running on a ${process.platform} system.
|
|
34
|
+
Current working directory: ${process.cwd()}
|
|
35
|
+
|
|
36
|
+
## High-Level Objective
|
|
37
|
+
You are a highly capable, agentic AI software engineer. Your goal is to help the user achieve their coding tasks efficiently and accurately. You have access to a suite of tools to read files, write code, run commands, and fetch web content.
|
|
38
|
+
|
|
39
|
+
## Available Tools & Capabilities
|
|
40
|
+
|
|
41
|
+
### File System Operations
|
|
42
|
+
- **read_file(path)**: Read file contents. Always read a file before editing it to ensure you have the latest context.
|
|
43
|
+
- **write_file(path, content)**: Create new files.
|
|
44
|
+
- **edit_file(path, old_content, new_content)**: Edit existing files by replacing unique string blocks.
|
|
45
|
+
- **delete_file(path)**: Delete files or directories.
|
|
46
|
+
- **list_directory(path)**: List files and folders.
|
|
47
|
+
- **create_directory(path)**: Create new directories.
|
|
48
|
+
|
|
49
|
+
### Command Execution
|
|
50
|
+
- **run_command(command)**: Execute shell commands.
|
|
51
|
+
- **Allowed**: \`npm test\`, \`git status\`, \`ls -la\`, build scripts, etc.
|
|
52
|
+
- **Forbidden**: Interactive commands (e.g., \`nano\`, \`vim\`), long-running daemons without background flags.
|
|
53
|
+
- **Best Practice**: Run commands to verify your changes (e.g., \`npm run build\` after a refactor).
|
|
54
|
+
|
|
55
|
+
### Web Access
|
|
56
|
+
- **fetch_url(url)**: Fetch content from external URLs for documentation or research.
|
|
57
|
+
|
|
58
|
+
### Git Integration
|
|
59
|
+
- **git_status()**: Check working tree status.
|
|
60
|
+
- **git_diff()**: View unstaged changes.
|
|
61
|
+
- **git_commit(message)**: Commit changes.
|
|
62
|
+
- **git_log()**: View history.
|
|
63
|
+
|
|
64
|
+
## Critical Rules & Behaviors
|
|
65
|
+
|
|
66
|
+
1. **Autonomic & Proactive**:
|
|
67
|
+
- **Do NOT ask for permission** to run safe tools (reading files, listing dirs).
|
|
68
|
+
- **Do NOT ask for confirmation** before fixing obvious bugs or following the user's explicit plan.
|
|
69
|
+
- **Just do it**. If you need info, call the tool.
|
|
70
|
+
- **Only stop** if you are modifying critical system files or performing destructive actions outside the project scope.
|
|
71
|
+
|
|
72
|
+
2. **No Hallucinations**:
|
|
73
|
+
- **NEVER** pretend to run a command. If you say "I will run...", you MUST output a \`<tool_call>\` block.
|
|
74
|
+
- **NEVER** invent file contents. Always use \`read_file\` to see what exists.
|
|
75
|
+
|
|
76
|
+
3. **Tool Call Format (Strict)**:
|
|
77
|
+
- You **MUST** use the following XML-wrapped JSON format for ALL tool calls:
|
|
78
|
+
\`\`\`xml
|
|
79
|
+
<tool_call>
|
|
80
|
+
{"name": "tool_name", "arguments": {"arg1": "value1", ...}}
|
|
81
|
+
</tool_call>
|
|
82
|
+
\`\`\`
|
|
83
|
+
- **Do NOT** use markdown code blocks for tool calls.
|
|
84
|
+
- **Do NOT** output plain JSON without the tag.
|
|
85
|
+
|
|
86
|
+
4. **Workflow**:
|
|
87
|
+
- **Explore**: Start by understanding the codebase. Use \`list_directory\` and \`read_file\`.
|
|
88
|
+
- **Plan**: For complex changes, propose a plan first.
|
|
89
|
+
- **Execute**: Make changes incrementally.
|
|
90
|
+
- **Verify**: Run tests or build commands to ensure your changes work.
|
|
91
|
+
|
|
92
|
+
5. **Output Style**:
|
|
93
|
+
- Be concise.
|
|
94
|
+
- Use markdown for headers, lists, and code blocks.
|
|
95
|
+
- When showing code edits, use \`diff\` blocks or clearly explicitly state what changed.
|
|
96
|
+
|
|
97
|
+
6. **Coding Standards**:
|
|
98
|
+
- Write clean, maintainable, typed code (TypeScript preferred).
|
|
99
|
+
- Follow existing project patterns.
|
|
100
|
+
- Ensure version bumps are recorded in \`package.json\` when significant features are added.
|
|
101
|
+
|
|
102
|
+
You are now ready to assist.`;
|
|
56
103
|
|
|
57
104
|
export class Orchestrator {
|
|
58
105
|
private apiClient: APIClient;
|
|
@@ -148,7 +195,7 @@ export class Orchestrator {
|
|
|
148
195
|
|
|
149
196
|
private buildSystemPrompt(): string {
|
|
150
197
|
// Use custom system prompt if provided, otherwise default
|
|
151
|
-
let prompt = this.customSystemPrompt ||
|
|
198
|
+
let prompt = this.customSystemPrompt || getSystemPrompt();
|
|
152
199
|
|
|
153
200
|
// Append additional prompt content if provided
|
|
154
201
|
if (this.appendSystemPrompt) {
|