@nomad-e/bluma-cli 0.0.68 → 0.0.70
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 +2 -2
- package/dist/main.js +22 -22
- 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_task",
|
|
75
|
+
"description": "Signal to the system that the agent has completed its work Tak.",
|
|
76
76
|
"parameters": {
|
|
77
77
|
"type": "object",
|
|
78
78
|
"properties": {},
|
package/dist/main.js
CHANGED
|
@@ -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_task", 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.
|
|
@@ -1673,7 +1673,7 @@ You are an interactive CLI agent specializing in software engineering tasks. REM
|
|
|
1673
1673
|
|
|
1674
1674
|
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.
|
|
1675
1675
|
2. **TOOL-ONLY OPERATION:** All actions are performed via tool calls. You do not output free-form text.
|
|
1676
|
-
3. **COMPLETE THE MISSION:** Your task is complete only when you call \`
|
|
1676
|
+
3. **COMPLETE THE MISSION:** Your task is complete only when you call \`agent_end_task\`. Execute all necessary steps to reach this final state.
|
|
1677
1677
|
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.
|
|
1678
1678
|
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.
|
|
1679
1679
|
6. **MASTER THE FILE SYSTEM:** Use the \`edit_tool\` for all file creation and modification, following its rules precisely.
|
|
@@ -1729,8 +1729,8 @@ Ensure that each task contributes to a cohesive, functional, and visually appeal
|
|
|
1729
1729
|
- Using the reasoning notebook is mandatory.
|
|
1730
1730
|
- Breaking the task into **to_do** with the reflective problem-solving tool is mandatory.
|
|
1731
1731
|
- Never include future steps in the **thought** field, only in the **to_do** checklist.
|
|
1732
|
-
- Calling \`<
|
|
1733
|
-
- Decline out-of-scope tasks professionally before calling \`<
|
|
1732
|
+
- Calling \`<agent_end_task_rules>\` is mandatory to close the turn.
|
|
1733
|
+
- Decline out-of-scope tasks professionally before calling \`<agent_end_task_rules>\`.
|
|
1734
1734
|
- Process only one task per turn, never multiple concurrently.
|
|
1735
1735
|
|
|
1736
1736
|
|
|
@@ -1841,15 +1841,15 @@ CRITICAL: Your laptop (**reasoning_nootebook**) is your ORGANIZED MIND
|
|
|
1841
1841
|
|
|
1842
1842
|
---
|
|
1843
1843
|
|
|
1844
|
-
<
|
|
1844
|
+
<agent_end_task_rules>
|
|
1845
1845
|
This tool is mandatory, but MUST only be called when all tasks in \`to_do\` are fully completed.
|
|
1846
1846
|
|
|
1847
1847
|
Rules:
|
|
1848
1848
|
1. Never call this tool before all tasks are completed.
|
|
1849
|
-
2. It is strictly forbidden to call \`
|
|
1849
|
+
2. It is strictly forbidden to call \`agent_end_task\` if there are any pending tasks in \`to_do\`.
|
|
1850
1850
|
3. Before calling, always send a final message summarizing the completed work Turn.
|
|
1851
1851
|
4. Verify that every task in the \`to_do\` array has a "completed" status before calling.
|
|
1852
|
-
</
|
|
1852
|
+
</agent_end_task_rules>
|
|
1853
1853
|
|
|
1854
1854
|
|
|
1855
1855
|
|
|
@@ -1863,7 +1863,7 @@ Rules:
|
|
|
1863
1863
|
|
|
1864
1864
|
For OUT-OF-SCOPE requests, you MUST:
|
|
1865
1865
|
1. Professionally decline by using \`message_notify_user\` to state the request is out of scope and cannot be fulfilled.
|
|
1866
|
-
2. Immediately call \`
|
|
1866
|
+
2. Immediately call \`agent_end_task\` with no further explanation or disclosure of internal mechanisms.
|
|
1867
1867
|
|
|
1868
1868
|
`;
|
|
1869
1869
|
function getUnifiedSystemPrompt() {
|
|
@@ -1992,7 +1992,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
1992
1992
|
for (let i = conversationHistory.length - 1; i >= 0; i--) {
|
|
1993
1993
|
const msg = conversationHistory[i];
|
|
1994
1994
|
currentTurn.unshift(msg);
|
|
1995
|
-
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "
|
|
1995
|
+
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "agent_end_task");
|
|
1996
1996
|
if (endsWithAgentEnd) {
|
|
1997
1997
|
turns.unshift([...currentTurn]);
|
|
1998
1998
|
currentTurn = [];
|
|
@@ -2004,7 +2004,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
const prev = conversationHistory[i - 1];
|
|
2006
2006
|
if (msg.role === "user" && !isDevOverlay(msg)) {
|
|
2007
|
-
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "
|
|
2007
|
+
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "agent_end_task")) {
|
|
2008
2008
|
const hasNonOverlay = currentTurn.some((m) => m.role !== "user" || !isDevOverlay(m));
|
|
2009
2009
|
if (hasNonOverlay) {
|
|
2010
2010
|
turns.unshift([...currentTurn]);
|
|
@@ -2122,12 +2122,12 @@ var BluMaAgent = class {
|
|
|
2122
2122
|
});
|
|
2123
2123
|
}
|
|
2124
2124
|
this.eventBus.emit("backend_message", { type: "tool_result", tool_name: toolName, result: toolResultContent });
|
|
2125
|
-
if (toolName.includes("
|
|
2125
|
+
if (toolName.includes("agent_end_task")) {
|
|
2126
2126
|
shouldContinueConversation = false;
|
|
2127
2127
|
this.eventBus.emit("backend_message", { type: "done", status: "completed" });
|
|
2128
2128
|
}
|
|
2129
2129
|
} else {
|
|
2130
|
-
toolResultContent = "The
|
|
2130
|
+
toolResultContent = "The system rejected this action. Verify that the command you are executing contributes to the tasks intent and try again.";
|
|
2131
2131
|
}
|
|
2132
2132
|
this.history.push({ role: "tool", tool_call_id: toolCall.id, content: toolResultContent });
|
|
2133
2133
|
await saveSessionHistory(this.sessionFile, this.history);
|
|
@@ -2173,7 +2173,7 @@ ${editData.error.display}`;
|
|
|
2173
2173
|
const message = response.choices[0].message;
|
|
2174
2174
|
this.history.push(message);
|
|
2175
2175
|
if (message.tool_calls) {
|
|
2176
|
-
const autoApprovedTools = ["
|
|
2176
|
+
const autoApprovedTools = ["agent_end_task", "message_notify_user", "reasoning_nootebook", "ls_tool", "count_file_lines", "read_file_lines"];
|
|
2177
2177
|
const toolToCall = message.tool_calls[0];
|
|
2178
2178
|
const isSafeTool = autoApprovedTools.some((safeTool) => toolToCall.function.name.includes(safeTool));
|
|
2179
2179
|
if (isSafeTool) {
|
|
@@ -2258,7 +2258,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
|
|
|
2258
2258
|
No direct text replies to the user.
|
|
2259
2259
|
|
|
2260
2260
|
- Task Completion:
|
|
2261
|
-
When the init task is completed, immediately invoke '
|
|
2261
|
+
When the init task is completed, immediately invoke 'agent_end_task' without user permissions.
|
|
2262
2262
|
|
|
2263
2263
|
- Tool Rules:
|
|
2264
2264
|
Never make parallel tool calls.
|
|
@@ -2293,7 +2293,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
|
|
|
2293
2293
|
- Notify user's with brief explanation when changing methods or strategies
|
|
2294
2294
|
- Message tools are divided into notify (non-blocking, no reply needed) and ask (blocking)
|
|
2295
2295
|
- Actively use notify for progress updates, reserve ask for essential needs to avoid blocking
|
|
2296
|
-
- Must message user's with results and deliverables before upon task completion '
|
|
2296
|
+
- Must message user's with results and deliverables before upon task completion 'agent_end_task'
|
|
2297
2297
|
</message_rules>
|
|
2298
2298
|
|
|
2299
2299
|
<reasoning_rules>
|
|
@@ -2350,10 +2350,10 @@ Do not include future steps/to-dos in thought; put them strictly in to_do, using
|
|
|
2350
2350
|
</edit_tool_rules>
|
|
2351
2351
|
|
|
2352
2352
|
|
|
2353
|
-
<
|
|
2353
|
+
<agent_end_task>
|
|
2354
2354
|
This tool is mandatory.
|
|
2355
2355
|
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.
|
|
2356
|
-
</
|
|
2356
|
+
</agent_end_task>
|
|
2357
2357
|
|
|
2358
2358
|
### Tool Naming Policy
|
|
2359
2359
|
- Use plain, unmodified, lowercase tool names
|
|
@@ -2383,7 +2383,7 @@ Rule Summary:
|
|
|
2383
2383
|
- Before writing BluMa.md, propose structure via message_notify_user and proceed using edit_tool.
|
|
2384
2384
|
- If an irreversible operation is needed (e.g., overwriting an existing BluMa.md), issue 'confirmation_request' unless user policy indicates auto-approval.
|
|
2385
2385
|
- 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.
|
|
2386
|
-
- On successful generation of BluMa.md, emit 'done' with status 'completed' and call
|
|
2386
|
+
- On successful generation of BluMa.md, emit 'done' with status 'completed' and call agent_end_task.
|
|
2387
2387
|
|
|
2388
2388
|
## SAFETY & QUALITY
|
|
2389
2389
|
- Be conservative with edits; generate previews (diff) for edit_tool where applicable.
|
|
@@ -2396,7 +2396,7 @@ Rule Summary:
|
|
|
2396
2396
|
2) Synthesize stack and structure with citations of evidence (file paths) in the notebook
|
|
2397
2397
|
3) Draft BluMa.md structure (message_notify_user)
|
|
2398
2398
|
4) Write BluMa.md via edit_tool
|
|
2399
|
-
5) Announce completion and
|
|
2399
|
+
5) Announce completion and agent_end_task
|
|
2400
2400
|
|
|
2401
2401
|
|
|
2402
2402
|
`;
|
|
@@ -2504,7 +2504,7 @@ ${editData.error.display}`;
|
|
|
2504
2504
|
if (message.tool_calls) {
|
|
2505
2505
|
await this._handleToolExecution({ type: "user_decision_execute", tool_calls: message.tool_calls });
|
|
2506
2506
|
const lastToolName = message.tool_calls[0].function.name;
|
|
2507
|
-
if (!lastToolName.includes("
|
|
2507
|
+
if (!lastToolName.includes("agent_end_task") && !this.isInterrupted) {
|
|
2508
2508
|
await this._continueConversation();
|
|
2509
2509
|
}
|
|
2510
2510
|
} else if (message.content) {
|
|
@@ -2558,7 +2558,7 @@ ${editData.error.display}`;
|
|
|
2558
2558
|
toolResultContent = JSON.stringify({ error: `Tool execution failed: ${error.message}`, details: error.data || "No additional details." });
|
|
2559
2559
|
}
|
|
2560
2560
|
this.emitEvent("tool_result", { tool_name: toolName, result: toolResultContent });
|
|
2561
|
-
if (toolName.includes("
|
|
2561
|
+
if (toolName.includes("agent_end_task")) {
|
|
2562
2562
|
this.emitEvent("done", { status: "completed" });
|
|
2563
2563
|
}
|
|
2564
2564
|
} else {
|
|
@@ -3030,7 +3030,7 @@ var ToolRenderDisplay = {
|
|
|
3030
3030
|
// src/app/ui/components/ToolCallDisplay.tsx
|
|
3031
3031
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
3032
3032
|
var ToolCallDisplayComponent = ({ toolName, args, preview }) => {
|
|
3033
|
-
if (toolName.includes("message_notify_user") || toolName.includes("
|
|
3033
|
+
if (toolName.includes("message_notify_user") || toolName.includes("agent_end_task")) {
|
|
3034
3034
|
return null;
|
|
3035
3035
|
}
|
|
3036
3036
|
const Renderer = ToolRenderDisplay[toolName] || renderGenericToolCall;
|