@nomad-e/bluma-cli 0.0.59 → 0.0.61
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/dist/config/native_tools.json +4 -4
- package/dist/main.js +24 -24
- package/package.json +1 -1
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
{
|
|
72
72
|
"type": "function",
|
|
73
73
|
"function": {
|
|
74
|
-
"name": "
|
|
75
|
-
"description": "Signal to the system that the agent has completed its work.",
|
|
74
|
+
"name": "agent_end_turn",
|
|
75
|
+
"description": "Signal to the system that the agent has completed its work Turn.",
|
|
76
76
|
"parameters": {
|
|
77
77
|
"type": "object",
|
|
78
78
|
"properties": {},
|
|
@@ -88,13 +88,13 @@
|
|
|
88
88
|
"parameters": {
|
|
89
89
|
"type": "object",
|
|
90
90
|
"properties": {
|
|
91
|
-
"
|
|
91
|
+
"message": {
|
|
92
92
|
"type": "string",
|
|
93
93
|
"description": "The body of the message in Markdown format."
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"required": [
|
|
97
|
-
"
|
|
97
|
+
"message"
|
|
98
98
|
]
|
|
99
99
|
}
|
|
100
100
|
}
|
package/dist/main.js
CHANGED
|
@@ -1082,14 +1082,14 @@ ${finalDiff}`, is_new_file: false, occurrences: editData.occurrences, relative_p
|
|
|
1082
1082
|
// src/app/agent/tools/natives/message.ts
|
|
1083
1083
|
import { v4 as uuidv4 } from "uuid";
|
|
1084
1084
|
function messageNotifyuser(args) {
|
|
1085
|
-
const {
|
|
1085
|
+
const { message } = args;
|
|
1086
1086
|
const notification = {
|
|
1087
1087
|
type: "message_notify_user",
|
|
1088
1088
|
id: `notify_${uuidv4()}`,
|
|
1089
1089
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1090
1090
|
content: {
|
|
1091
1091
|
format: "markdown",
|
|
1092
|
-
body:
|
|
1092
|
+
body: message
|
|
1093
1093
|
},
|
|
1094
1094
|
success: true,
|
|
1095
1095
|
delivered: true
|
|
@@ -1278,7 +1278,7 @@ var ToolInvoker = class {
|
|
|
1278
1278
|
this.toolImplementations.set("ls_tool", ls);
|
|
1279
1279
|
this.toolImplementations.set("count_file_lines", countLines);
|
|
1280
1280
|
this.toolImplementations.set("read_file_lines", readLines);
|
|
1281
|
-
this.toolImplementations.set("
|
|
1281
|
+
this.toolImplementations.set("agent_end_turn", async () => ({ success: true, message: "Task ended by agent." }));
|
|
1282
1282
|
}
|
|
1283
1283
|
/**
|
|
1284
1284
|
* Retorna a lista de definições de todas as ferramentas nativas carregadas.
|
|
@@ -1664,7 +1664,7 @@ You are an interactive CLI agent specializing in software engineering tasks. REM
|
|
|
1664
1664
|
|
|
1665
1665
|
1. **SEND THE FIRST MESSAGE:** As soon as you receive a task you must send a confirmation message in an informal but technical style. By sending this message your end-to-end shift begins without intervention and without interruption from anyone.
|
|
1666
1666
|
2. **TOOL-ONLY OPERATION:** All actions are performed via tool calls. You do not output free-form text.
|
|
1667
|
-
3. **COMPLETE THE MISSION:** Your task is complete only when you call \`
|
|
1667
|
+
3. **COMPLETE THE MISSION:** Your task is complete only when you call \`agent_end_turn\`. Execute all necessary steps to reach this final state.
|
|
1668
1668
|
4. **REPORT, DON'T ASK:** Use \`message_notify_user\` to report significant progress, status changes, or final results. You do not ask for permission or clarification. You have full authority to proceed.
|
|
1669
1669
|
5. **AUTONOMOUS ERROR RECOVERY:** If a tool fails, analyze the error, formulate a recovery strategy (e.g., retry, use an alternative tool, adjust parameters), and execute it. Notify the user of the failure and your recovery action.
|
|
1670
1670
|
6. **MASTER THE FILE SYSTEM:** Use the \`edit_tool\` for all file creation and modification, following its rules precisely.
|
|
@@ -1721,8 +1721,8 @@ Ensure that each task contributes to a cohesive, functional, and visually appeal
|
|
|
1721
1721
|
- Using the reasoning notebook is mandatory.
|
|
1722
1722
|
- Breaking the task into **task_checklist** with the reflective problem-solving tool is mandatory.
|
|
1723
1723
|
- Never include future steps in the **thought** field, only in the **task_checklist** checklist.
|
|
1724
|
-
- Calling \`<
|
|
1725
|
-
- Decline out-of-scope tasks professionally before calling \`<
|
|
1724
|
+
- Calling \`<agent_end_turn_rules>\` is mandatory to close the turn.
|
|
1725
|
+
- Decline out-of-scope tasks professionally before calling \`<agent_end_turn_rules>\`.
|
|
1726
1726
|
- Process only one task per turn, never multiple concurrently.
|
|
1727
1727
|
|
|
1728
1728
|
|
|
@@ -1833,15 +1833,15 @@ CRITICAL: Your laptop (**reasoning_nootebook**) is your ORGANIZED MIND
|
|
|
1833
1833
|
|
|
1834
1834
|
---
|
|
1835
1835
|
|
|
1836
|
-
<
|
|
1836
|
+
<agent_end_turn_rules>
|
|
1837
1837
|
This tool is mandatory, but MUST only be called when all tasks in \`task_checklist\` are fully completed.
|
|
1838
1838
|
|
|
1839
1839
|
Rules:
|
|
1840
1840
|
1. Never call this tool before all tasks are completed.
|
|
1841
|
-
2. It is strictly forbidden to call \`
|
|
1842
|
-
3. Before calling, always send a final message summarizing the completed work.
|
|
1841
|
+
2. It is strictly forbidden to call \`agent_end_turn\` if there are any pending tasks in \`task_checklist\`.
|
|
1842
|
+
3. Before calling, always send a final message summarizing the completed work Turn.
|
|
1843
1843
|
4. Verify that every task in the \`task_checklist\` array has a "completed" status before calling.
|
|
1844
|
-
</
|
|
1844
|
+
</agent_end_turn_rules>
|
|
1845
1845
|
|
|
1846
1846
|
|
|
1847
1847
|
|
|
@@ -1855,7 +1855,7 @@ Rules:
|
|
|
1855
1855
|
|
|
1856
1856
|
For OUT-OF-SCOPE requests, you MUST:
|
|
1857
1857
|
1. Professionally decline by using \`message_notify_user\` to state the request is out of scope and cannot be fulfilled.
|
|
1858
|
-
2. Immediately call \`
|
|
1858
|
+
2. Immediately call \`agent_end_turn\` with no further explanation or disclosure of internal mechanisms.
|
|
1859
1859
|
|
|
1860
1860
|
`;
|
|
1861
1861
|
function getUnifiedSystemPrompt() {
|
|
@@ -1983,7 +1983,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
1983
1983
|
for (let i = conversationHistory.length - 1; i >= 0; i--) {
|
|
1984
1984
|
const msg = conversationHistory[i];
|
|
1985
1985
|
currentTurn.unshift(msg);
|
|
1986
|
-
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "
|
|
1986
|
+
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "agent_end_turn");
|
|
1987
1987
|
if (endsWithAgentEnd) {
|
|
1988
1988
|
turns.unshift([...currentTurn]);
|
|
1989
1989
|
currentTurn = [];
|
|
@@ -1995,7 +1995,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
const prev = conversationHistory[i - 1];
|
|
1997
1997
|
if (msg.role === "user" && !isDevOverlay(msg)) {
|
|
1998
|
-
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "
|
|
1998
|
+
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "agent_end_turn")) {
|
|
1999
1999
|
const hasNonOverlay = currentTurn.some((m) => m.role !== "user" || !isDevOverlay(m));
|
|
2000
2000
|
if (hasNonOverlay) {
|
|
2001
2001
|
turns.unshift([...currentTurn]);
|
|
@@ -2113,7 +2113,7 @@ var BluMaAgent = class {
|
|
|
2113
2113
|
});
|
|
2114
2114
|
}
|
|
2115
2115
|
this.eventBus.emit("backend_message", { type: "tool_result", tool_name: toolName, result: toolResultContent });
|
|
2116
|
-
if (toolName.includes("
|
|
2116
|
+
if (toolName.includes("agent_end_turn")) {
|
|
2117
2117
|
shouldContinueConversation = false;
|
|
2118
2118
|
this.eventBus.emit("backend_message", { type: "done", status: "completed" });
|
|
2119
2119
|
}
|
|
@@ -2164,7 +2164,7 @@ ${editData.error.display}`;
|
|
|
2164
2164
|
const message = response.choices[0].message;
|
|
2165
2165
|
this.history.push(message);
|
|
2166
2166
|
if (message.tool_calls) {
|
|
2167
|
-
const autoApprovedTools = ["
|
|
2167
|
+
const autoApprovedTools = ["agent_end_turn", "message_notify_user", "reasoning_nootebook", "ls_tool", "count_file_lines", "read_file_lines"];
|
|
2168
2168
|
const toolToCall = message.tool_calls[0];
|
|
2169
2169
|
const isSafeTool = autoApprovedTools.some((safeTool) => toolToCall.function.name.includes(safeTool));
|
|
2170
2170
|
if (isSafeTool) {
|
|
@@ -2249,7 +2249,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
|
|
|
2249
2249
|
No direct text replies to the user.
|
|
2250
2250
|
|
|
2251
2251
|
- Task Completion:
|
|
2252
|
-
When the init task is completed, immediately invoke '
|
|
2252
|
+
When the init task is completed, immediately invoke 'agent_end_turn' without user permissions.
|
|
2253
2253
|
|
|
2254
2254
|
- Tool Rules:
|
|
2255
2255
|
Never make parallel tool calls.
|
|
@@ -2284,7 +2284,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
|
|
|
2284
2284
|
- Notify user's with brief explanation when changing methods or strategies
|
|
2285
2285
|
- Message tools are divided into notify (non-blocking, no reply needed) and ask (blocking)
|
|
2286
2286
|
- Actively use notify for progress updates, reserve ask for essential needs to avoid blocking
|
|
2287
|
-
- Must message user's with results and deliverables before upon task completion '
|
|
2287
|
+
- Must message user's with results and deliverables before upon task completion 'agent_end_turn'
|
|
2288
2288
|
</message_rules>
|
|
2289
2289
|
|
|
2290
2290
|
<reasoning_rules>
|
|
@@ -2341,10 +2341,10 @@ Do not include future steps/to-dos in thought; put them strictly in task_checkli
|
|
|
2341
2341
|
</edit_tool_rules>
|
|
2342
2342
|
|
|
2343
2343
|
|
|
2344
|
-
<
|
|
2344
|
+
<agent_end_turn_rules>
|
|
2345
2345
|
This tool is mandatory.
|
|
2346
2346
|
You must use it to inform usereloper {username} that the task has been completed and that there are no further pending actions, in accordance with the objectives defined for the task.
|
|
2347
|
-
</
|
|
2347
|
+
</agent_end_turn_rules>
|
|
2348
2348
|
|
|
2349
2349
|
### Tool Naming Policy
|
|
2350
2350
|
- Use plain, unmodified, lowercase tool names
|
|
@@ -2374,7 +2374,7 @@ Rule Summary:
|
|
|
2374
2374
|
- Before writing BluMa.md, propose structure via message_notify_user and proceed using edit_tool.
|
|
2375
2375
|
- If an irreversible operation is needed (e.g., overwriting an existing BluMa.md), issue 'confirmation_request' unless user policy indicates auto-approval.
|
|
2376
2376
|
- Never send or present draft versions of BluMa.md. Only produce and deliver the final, validated BluMa.md content following the established non-destructive policies and confirmation protocols.
|
|
2377
|
-
- On successful generation of BluMa.md, emit 'done' with status 'completed' and call
|
|
2377
|
+
- On successful generation of BluMa.md, emit 'done' with status 'completed' and call agent_end_turn.
|
|
2378
2378
|
|
|
2379
2379
|
## SAFETY & QUALITY
|
|
2380
2380
|
- Be conservative with edits; generate previews (diff) for edit_tool where applicable.
|
|
@@ -2387,7 +2387,7 @@ Rule Summary:
|
|
|
2387
2387
|
2) Synthesize stack and structure with citations of evidence (file paths) in the notebook
|
|
2388
2388
|
3) Draft BluMa.md structure (message_notify_user)
|
|
2389
2389
|
4) Write BluMa.md via edit_tool
|
|
2390
|
-
5) Announce completion and
|
|
2390
|
+
5) Announce completion and agent_end_turn
|
|
2391
2391
|
|
|
2392
2392
|
|
|
2393
2393
|
`;
|
|
@@ -2495,7 +2495,7 @@ ${editData.error.display}`;
|
|
|
2495
2495
|
if (message.tool_calls) {
|
|
2496
2496
|
await this._handleToolExecution({ type: "user_decision_execute", tool_calls: message.tool_calls });
|
|
2497
2497
|
const lastToolName = message.tool_calls[0].function.name;
|
|
2498
|
-
if (!lastToolName.includes("
|
|
2498
|
+
if (!lastToolName.includes("agent_end_turn") && !this.isInterrupted) {
|
|
2499
2499
|
await this._continueConversation();
|
|
2500
2500
|
}
|
|
2501
2501
|
} else if (message.content) {
|
|
@@ -2549,7 +2549,7 @@ ${editData.error.display}`;
|
|
|
2549
2549
|
toolResultContent = JSON.stringify({ error: `Tool execution failed: ${error.message}`, details: error.data || "No additional details." });
|
|
2550
2550
|
}
|
|
2551
2551
|
this.emitEvent("tool_result", { tool_name: toolName, result: toolResultContent });
|
|
2552
|
-
if (toolName.includes("
|
|
2552
|
+
if (toolName.includes("agent_end_turn")) {
|
|
2553
2553
|
this.emitEvent("done", { status: "completed" });
|
|
2554
2554
|
}
|
|
2555
2555
|
} else {
|
|
@@ -3021,7 +3021,7 @@ var ToolRenderDisplay = {
|
|
|
3021
3021
|
// src/app/ui/components/ToolCallDisplay.tsx
|
|
3022
3022
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
3023
3023
|
var ToolCallDisplayComponent = ({ toolName, args, preview }) => {
|
|
3024
|
-
if (toolName.includes("message_notify_user") || toolName.includes("
|
|
3024
|
+
if (toolName.includes("message_notify_user") || toolName.includes("agent_end_turn")) {
|
|
3025
3025
|
return null;
|
|
3026
3026
|
}
|
|
3027
3027
|
const Renderer = ToolRenderDisplay[toolName] || renderGenericToolCall;
|