@nomad-e/bluma-cli 0.0.58 → 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.
@@ -71,8 +71,8 @@
71
71
  {
72
72
  "type": "function",
73
73
  "function": {
74
- "name": "agent_end_task",
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
- "text_markdown": {
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
- "text_markdown"
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 { text_markdown } = args;
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: text_markdown
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("agent_end_task", async () => ({ success: true, message: "Task ended by agent." }));
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 \`agent_end_task\`. Execute all necessary steps to reach this final state.
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 \`<agent_end_task_rules>\` is mandatory to close the turn.
1725
- - Decline out-of-scope tasks professionally before calling \`<agent_end_task_rules>\`.
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
- <agent_end_task_rules>
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 \`agent_end_task\` if there are any pending tasks in \`task_checklist\`.
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
- </agent_end_task_rules>
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 \`agent_end_task\` with no further explanation or disclosure of internal mechanisms.
1858
+ 2. Immediately call \`agent_end_turn\` with no further explanation or disclosure of internal mechanisms.
1859
1859
 
1860
1860
  `;
1861
1861
  function getUnifiedSystemPrompt() {
@@ -1896,20 +1896,54 @@ function getUnifiedSystemPrompt() {
1896
1896
  ---
1897
1897
 
1898
1898
  ${isGitRepo ? `
1899
- ### GIT USAGE GUIDELINES
1900
- - The current working (project) directory is being managed by a git repository.
1901
- - When asked to commit changes or prepare a commit, always start by gathering information using shell commands:
1902
- - \`git status\` to ensure that all relevant files are tracked and staged, using \`git add ...\` as needed.
1903
- - \`git diff HEAD\` to review all changes (including unstaged changes) to tracked files in work tree since last commit.
1904
- - \`git diff --staged\` to review only staged changes when a partial commit makes sense or was requested by the user.
1905
- - \`git log -n 3\` to review recent commit messages and match their style (verbosity, formatting, signature line, etc.)
1906
- - Combine shell commands whenever possible to save time/steps, e.g. \`git status && git diff HEAD && git log -n 3\`.
1907
- - Always propose a draft commit message. Never just ask the user to give you the full commit message.
1908
- - Prefer commit messages that are clear, concise, and focused more on "why" and less on "what".
1909
- - Keep the user informed and ask for clarification or confirmation where needed.
1910
- - After each commit, confirm that it was successful by running \`git status\`.
1911
- - If a commit fails, never attempt to work around the issues without being asked to do so.
1912
- - Never push changes to a remote repository without being asked explicitly by the user.
1899
+ ## GIT USAGE GUIDELINES \u2014 AUTONOMOUS AGENT MODE
1900
+
1901
+ ### PERMISSIONS
1902
+ - The agent **is authorized** to execute \`git\` commands directly in the local repository.
1903
+ - The agent **may** add (\`git add\`), stage, and commit (\`git commit\`) changes without prior confirmation, **as long as** it strictly follows the rules below.
1904
+ - The agent **must not** execute \`git push\` or any command that sends changes to a remote repository without explicit user instruction.
1905
+
1906
+ ---
1907
+
1908
+ ### MANDATORY PROCEDURE
1909
+
1910
+ 1. **Before any commit**: execute
1911
+ \`\`\`bash
1912
+ git status && git diff HEAD && git log -n 3
1913
+ \`\`\`
1914
+ - If there are modified, untracked, or unstaged files, execute:
1915
+ \`\`\`bash
1916
+ git add <files>
1917
+ \`\`\`
1918
+ to include them, unless the user specifies which files to include.
1919
+
1920
+ 2. **Partial commits**:
1921
+ - Only perform a partial commit if the user explicitly specifies certain files or changes.
1922
+ - In that case, execute:
1923
+ \`\`\`bash
1924
+ git diff --staged
1925
+ \`\`\`
1926
+ to review before confirming.
1927
+
1928
+ 3. **Commit message**:
1929
+ - Automatically generate a commit message that follows the style and formatting of the last 3 commits (\`git log -n 3\`).
1930
+ - Messages should be clear, concise, and focus on **why** the change was made, not just **what** was changed.
1931
+ - Never ask the user to provide the full commit message \u2014 the agent must propose an initial version.
1932
+
1933
+ 4. **After the commit**:
1934
+ - Execute:
1935
+ \`\`\`bash
1936
+ git status
1937
+ \`\`\`
1938
+ to confirm success.
1939
+ - If the commit fails, **do not attempt to fix the issue independently** \u2014 wait for user instructions.
1940
+
1941
+ ---
1942
+
1943
+ ### RESTRICTIONS
1944
+ - Never execute \`git push\` without explicit authorization.
1945
+ - Never alter history (\`git rebase\`, \`git reset\`, \`git commit --amend\`, etc.) without explicit authorization.
1946
+
1913
1947
  ` : ""}
1914
1948
 
1915
1949
  ---
@@ -1949,7 +1983,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
1949
1983
  for (let i = conversationHistory.length - 1; i >= 0; i--) {
1950
1984
  const msg = conversationHistory[i];
1951
1985
  currentTurn.unshift(msg);
1952
- const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "agent_end_task");
1986
+ const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc.function.name === "agent_end_turn");
1953
1987
  if (endsWithAgentEnd) {
1954
1988
  turns.unshift([...currentTurn]);
1955
1989
  currentTurn = [];
@@ -1961,7 +1995,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
1961
1995
  }
1962
1996
  const prev = conversationHistory[i - 1];
1963
1997
  if (msg.role === "user" && !isDevOverlay(msg)) {
1964
- if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "agent_end_task")) {
1998
+ if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc.function.name === "agent_end_turn")) {
1965
1999
  const hasNonOverlay = currentTurn.some((m) => m.role !== "user" || !isDevOverlay(m));
1966
2000
  if (hasNonOverlay) {
1967
2001
  turns.unshift([...currentTurn]);
@@ -2079,7 +2113,7 @@ var BluMaAgent = class {
2079
2113
  });
2080
2114
  }
2081
2115
  this.eventBus.emit("backend_message", { type: "tool_result", tool_name: toolName, result: toolResultContent });
2082
- if (toolName.includes("agent_end_task")) {
2116
+ if (toolName.includes("agent_end_turn")) {
2083
2117
  shouldContinueConversation = false;
2084
2118
  this.eventBus.emit("backend_message", { type: "done", status: "completed" });
2085
2119
  }
@@ -2130,7 +2164,7 @@ ${editData.error.display}`;
2130
2164
  const message = response.choices[0].message;
2131
2165
  this.history.push(message);
2132
2166
  if (message.tool_calls) {
2133
- const autoApprovedTools = ["agent_end_task", "message_notify_user", "reasoning_nootebook", "ls_tool", "count_file_lines", "read_file_lines"];
2167
+ const autoApprovedTools = ["agent_end_turn", "message_notify_user", "reasoning_nootebook", "ls_tool", "count_file_lines", "read_file_lines"];
2134
2168
  const toolToCall = message.tool_calls[0];
2135
2169
  const isSafeTool = autoApprovedTools.some((safeTool) => toolToCall.function.name.includes(safeTool));
2136
2170
  if (isSafeTool) {
@@ -2215,7 +2249,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
2215
2249
  No direct text replies to the user.
2216
2250
 
2217
2251
  - Task Completion:
2218
- When the init task is completed, immediately invoke 'agent_end_task' without user permissions.
2252
+ When the init task is completed, immediately invoke 'agent_end_turn' without user permissions.
2219
2253
 
2220
2254
  - Tool Rules:
2221
2255
  Never make parallel tool calls.
@@ -2250,7 +2284,7 @@ You extend the BluMa multi-agent architecture and handle the project bootstrappi
2250
2284
  - Notify user's with brief explanation when changing methods or strategies
2251
2285
  - Message tools are divided into notify (non-blocking, no reply needed) and ask (blocking)
2252
2286
  - Actively use notify for progress updates, reserve ask for essential needs to avoid blocking
2253
- - Must message user's with results and deliverables before upon task completion 'agent_end_task'
2287
+ - Must message user's with results and deliverables before upon task completion 'agent_end_turn'
2254
2288
  </message_rules>
2255
2289
 
2256
2290
  <reasoning_rules>
@@ -2307,10 +2341,10 @@ Do not include future steps/to-dos in thought; put them strictly in task_checkli
2307
2341
  </edit_tool_rules>
2308
2342
 
2309
2343
 
2310
- <agent_end_task_rules>
2344
+ <agent_end_turn_rules>
2311
2345
  This tool is mandatory.
2312
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.
2313
- </agent_end_task_rules>
2347
+ </agent_end_turn_rules>
2314
2348
 
2315
2349
  ### Tool Naming Policy
2316
2350
  - Use plain, unmodified, lowercase tool names
@@ -2340,7 +2374,7 @@ Rule Summary:
2340
2374
  - Before writing BluMa.md, propose structure via message_notify_user and proceed using edit_tool.
2341
2375
  - If an irreversible operation is needed (e.g., overwriting an existing BluMa.md), issue 'confirmation_request' unless user policy indicates auto-approval.
2342
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.
2343
- - On successful generation of BluMa.md, emit 'done' with status 'completed' and call agent_end_task.
2377
+ - On successful generation of BluMa.md, emit 'done' with status 'completed' and call agent_end_turn.
2344
2378
 
2345
2379
  ## SAFETY & QUALITY
2346
2380
  - Be conservative with edits; generate previews (diff) for edit_tool where applicable.
@@ -2353,7 +2387,7 @@ Rule Summary:
2353
2387
  2) Synthesize stack and structure with citations of evidence (file paths) in the notebook
2354
2388
  3) Draft BluMa.md structure (message_notify_user)
2355
2389
  4) Write BluMa.md via edit_tool
2356
- 5) Announce completion and agent_end_task
2390
+ 5) Announce completion and agent_end_turn
2357
2391
 
2358
2392
 
2359
2393
  `;
@@ -2461,7 +2495,7 @@ ${editData.error.display}`;
2461
2495
  if (message.tool_calls) {
2462
2496
  await this._handleToolExecution({ type: "user_decision_execute", tool_calls: message.tool_calls });
2463
2497
  const lastToolName = message.tool_calls[0].function.name;
2464
- if (!lastToolName.includes("agent_end_task") && !this.isInterrupted) {
2498
+ if (!lastToolName.includes("agent_end_turn") && !this.isInterrupted) {
2465
2499
  await this._continueConversation();
2466
2500
  }
2467
2501
  } else if (message.content) {
@@ -2515,7 +2549,7 @@ ${editData.error.display}`;
2515
2549
  toolResultContent = JSON.stringify({ error: `Tool execution failed: ${error.message}`, details: error.data || "No additional details." });
2516
2550
  }
2517
2551
  this.emitEvent("tool_result", { tool_name: toolName, result: toolResultContent });
2518
- if (toolName.includes("agent_end_task")) {
2552
+ if (toolName.includes("agent_end_turn")) {
2519
2553
  this.emitEvent("done", { status: "completed" });
2520
2554
  }
2521
2555
  } else {
@@ -2987,7 +3021,7 @@ var ToolRenderDisplay = {
2987
3021
  // src/app/ui/components/ToolCallDisplay.tsx
2988
3022
  import { jsx as jsx9 } from "react/jsx-runtime";
2989
3023
  var ToolCallDisplayComponent = ({ toolName, args, preview }) => {
2990
- if (toolName.includes("message_notify_user") || toolName.includes("agent_end_task")) {
3024
+ if (toolName.includes("message_notify_user") || toolName.includes("agent_end_turn")) {
2991
3025
  return null;
2992
3026
  }
2993
3027
  const Renderer = ToolRenderDisplay[toolName] || renderGenericToolCall;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomad-e/bluma-cli",
3
- "version": "0.0.58",
3
+ "version": "0.0.61",
4
4
  "description": "BluMa independent agent for automation and advanced software engineering.",
5
5
  "author": "Alex Fonseca",
6
6
  "license": "Apache-2.0",