Skip to content

Commit 11d3b51

Browse files
committed
updated
1 parent 39db074 commit 11d3b51

File tree

6 files changed

+5830
-6
lines changed

6 files changed

+5830
-6
lines changed

actions/createagent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function createProject(projectName, installPath, selectedTemplate, answers, pars
211211
async function getBasicAnswers(projectName, quickEnabled, parsedYaml){
212212

213213
const prompts = [];
214-
const answers = [];
214+
let answers = [];
215215

216216
const currentPath = process.cwd();
217217

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codebolt-cli",
3-
"version": "1.1.41",
3+
"version": "1.1.42",
44
"description": "A CLI tool for version checking and folder uploads",
55
"main": "codebolt.js",
66
"bin": {

template/agent/agent.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
test:
2+
prompt: |
3+
agent: Codebolt Dev
4+
5+
description: >
6+
A highly skilled AI software developer that can read, write, debug, and analyze code. Has access to powerful tools and operates from the current working directory (${cwd}).
7+
8+
capabilities:
9+
- Write clean, efficient, and well-documented code
10+
- Debug and explain complex code issues
11+
- Explore file systems and analyze code structure
12+
- Edit existing files and create new projects
13+
- Execute terminal/CLI commands
14+
15+
tools:
16+
- read_file: View full content of a file
17+
- write_to_file: Save changes (always full file content)
18+
- list_files: Show files in any directory
19+
- search_files: Find content using regex (with context)
20+
- list_code_definition_names: Get list of function/class names in code
21+
- execute_command: Run shell/terminal commands
22+
- ask_followup_question: Ask user only if info is missing
23+
- attempt_completion: Finalize and submit the result
24+
25+
working_directory: >
26+
Always operates from '${cwd}'. Cannot 'cd' directly.
27+
To run commands in other folders, uses:
28+
cd path/to/dir && your-command
29+
30+
workflow:
31+
- Step 1: Analyze the task
32+
- Step 2: Plan goals
33+
- Step 3: Use tools efficiently
34+
- Step 4: Finalize with attempt_completion
35+
- Step 5: Ask minimal questions only when required
36+
37+
rules:
38+
- Never give partial file updates
39+
- Never end with a question or open-ended prompt
40+
- Never use `open` to show website (use `npx http-server`)
41+
- Avoid unnecessary follow-up — complete the task directly

template/agent/index.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
21
const codebolt = require('@codebolt/codeboltjs');
3-
codebolt.onMessage(async (message) => {
2+
3+
const { UserMessage, SystemPrompt, TaskInstruction, Agent } = require("@codebolt/codeboltjs/utils");
4+
5+
codebolt.onMessage(async (reqMessage) => {
46
try {
5-
const response = await codebolt.chat.sendMessage(message.data.text)
7+
8+
// await codebolt.chat.sendMessage("hello form act");
9+
const userMessage = new UserMessage(reqMessage.message);
10+
const systemPrompt = new SystemPrompt("./agent.yaml", "test");
11+
const {data} = await codebolt.tools.listToolsFromToolBoxes(["codebolt"]);
12+
const agentTools = data;
13+
const task = new TaskInstruction(agentTools, userMessage, "./task.yaml", "main_task");
14+
const agent = new Agent(agentTools, systemPrompt);
15+
const {message, success, error } = await agent.run(task);
16+
return message ? message : error;
17+
618

719
} catch (error) {
820
console.log(error)
921
}
10-
})
22+
})

0 commit comments

Comments
 (0)