@nomad-e/bluma-cli 0.1.9 → 0.1.11
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/main.js +18 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -4229,7 +4229,6 @@ Run tests when modifying code. If a testing skill is listed in available_skills,
|
|
|
4229
4229
|
- read_file_lines
|
|
4230
4230
|
- count_file_lines
|
|
4231
4231
|
- todo
|
|
4232
|
-
- agent_end_turn
|
|
4233
4232
|
|
|
4234
4233
|
### Require Confirmation:
|
|
4235
4234
|
- shell_command (except safe commands)
|
|
@@ -4605,6 +4604,20 @@ function isGitRepo(dir) {
|
|
|
4605
4604
|
}
|
|
4606
4605
|
|
|
4607
4606
|
// src/app/agent/core/context-api/context_manager.ts
|
|
4607
|
+
function isEndTurnToolCall(tc) {
|
|
4608
|
+
if (tc.function.name === "agent_end_turn") {
|
|
4609
|
+
return true;
|
|
4610
|
+
}
|
|
4611
|
+
if (tc.function.name === "message") {
|
|
4612
|
+
try {
|
|
4613
|
+
const args = JSON.parse(tc.function.arguments);
|
|
4614
|
+
return args.message_type === "result";
|
|
4615
|
+
} catch {
|
|
4616
|
+
return false;
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
return false;
|
|
4620
|
+
}
|
|
4608
4621
|
function createApiContextWindow(fullHistory, maxTurns) {
|
|
4609
4622
|
if (!fullHistory.length) {
|
|
4610
4623
|
return [];
|
|
@@ -4626,7 +4639,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
4626
4639
|
for (let i = conversationHistory.length - 1; i >= 0; i--) {
|
|
4627
4640
|
const msg = conversationHistory[i];
|
|
4628
4641
|
currentTurn.unshift(msg);
|
|
4629
|
-
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => tc
|
|
4642
|
+
const endsWithAgentEnd = msg.role === "assistant" && msg.tool_calls?.some((tc) => isEndTurnToolCall(tc));
|
|
4630
4643
|
if (endsWithAgentEnd) {
|
|
4631
4644
|
turns.unshift([...currentTurn]);
|
|
4632
4645
|
currentTurn = [];
|
|
@@ -4638,7 +4651,7 @@ function createApiContextWindow(fullHistory, maxTurns) {
|
|
|
4638
4651
|
}
|
|
4639
4652
|
const prev = conversationHistory[i - 1];
|
|
4640
4653
|
if (msg.role === "user" && !isDevOverlay(msg)) {
|
|
4641
|
-
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => tc
|
|
4654
|
+
if (prev && prev.role === "assistant" && !prev.tool_calls?.some((tc) => isEndTurnToolCall(tc))) {
|
|
4642
4655
|
const hasNonOverlay = currentTurn.some((m) => m.role !== "user" || !isDevOverlay(m));
|
|
4643
4656
|
if (hasNonOverlay) {
|
|
4644
4657
|
turns.unshift([...currentTurn]);
|
|
@@ -4813,7 +4826,7 @@ var BluMaAgent = class {
|
|
|
4813
4826
|
mcpClient;
|
|
4814
4827
|
feedbackSystem;
|
|
4815
4828
|
skillLoader;
|
|
4816
|
-
maxContextTurns =
|
|
4829
|
+
maxContextTurns = 5;
|
|
4817
4830
|
isInterrupted = false;
|
|
4818
4831
|
constructor(sessionId2, eventBus2, llm, model, mcpClient, feedbackSystem) {
|
|
4819
4832
|
this.sessionId = sessionId2;
|
|
@@ -6951,7 +6964,6 @@ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
|
6951
6964
|
var SAFE_AUTO_APPROVE_TOOLS = [
|
|
6952
6965
|
// Comunicação/UI
|
|
6953
6966
|
"message",
|
|
6954
|
-
"agent_end_turn",
|
|
6955
6967
|
"todo",
|
|
6956
6968
|
"task_boundary",
|
|
6957
6969
|
// Leitura de ficheiros (read-only)
|
|
@@ -7041,6 +7053,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
7041
7053
|
setIsProcessing(false);
|
|
7042
7054
|
return;
|
|
7043
7055
|
}
|
|
7056
|
+
setIsProcessing(true);
|
|
7044
7057
|
setHistory((prev) => [
|
|
7045
7058
|
...prev,
|
|
7046
7059
|
{
|