@nomad-e/bluma-cli 0.1.12 → 0.1.14
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 +39 -16
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -5249,7 +5249,13 @@ var LLMService = class {
|
|
|
5249
5249
|
constructor(config2) {
|
|
5250
5250
|
this.client = new OpenAI({
|
|
5251
5251
|
apiKey: config2.apiKey,
|
|
5252
|
-
baseURL: config2.baseUrl || ""
|
|
5252
|
+
baseURL: config2.baseUrl || "",
|
|
5253
|
+
defaultHeaders: {
|
|
5254
|
+
"HTTP-Referer": "https://bluma.ai",
|
|
5255
|
+
// Optional. Site URL for rankings on openrouter.ai.
|
|
5256
|
+
"X-Title": "Bluma"
|
|
5257
|
+
// Optional. Site title for rankings on openrouter.ai.
|
|
5258
|
+
}
|
|
5253
5259
|
});
|
|
5254
5260
|
this.defaultModel = config2.model || "";
|
|
5255
5261
|
}
|
|
@@ -6896,7 +6902,7 @@ var ReasoningDisplay = memo9(ReasoningDisplayComponent);
|
|
|
6896
6902
|
// src/app/ui/components/StreamingText.tsx
|
|
6897
6903
|
import { useState as useState6, useEffect as useEffect5, useRef as useRef4, memo as memo10 } from "react";
|
|
6898
6904
|
import { Box as Box16, Text as Text15 } from "ink";
|
|
6899
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
6905
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6900
6906
|
var StreamingTextComponent = ({ eventBus: eventBus2, onReasoningComplete }) => {
|
|
6901
6907
|
const [reasoning, setReasoning] = useState6("");
|
|
6902
6908
|
const [isStreaming, setIsStreaming] = useState6(false);
|
|
@@ -6952,12 +6958,26 @@ var StreamingTextComponent = ({ eventBus: eventBus2, onReasoningComplete }) => {
|
|
|
6952
6958
|
return null;
|
|
6953
6959
|
}
|
|
6954
6960
|
const lines = reasoning.split("\n");
|
|
6955
|
-
|
|
6961
|
+
const MAX_VISIBLE_LINES = 20;
|
|
6962
|
+
let displayLines = lines;
|
|
6963
|
+
let truncatedCount = 0;
|
|
6964
|
+
if (lines.length > MAX_VISIBLE_LINES) {
|
|
6965
|
+
truncatedCount = lines.length - MAX_VISIBLE_LINES;
|
|
6966
|
+
displayLines = lines.slice(-MAX_VISIBLE_LINES);
|
|
6967
|
+
}
|
|
6968
|
+
return /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", paddingX: 1, marginBottom: 1, marginTop: 1, children: [
|
|
6969
|
+
truncatedCount > 0 && /* @__PURE__ */ jsxs15(Text15, { color: "gray", dimColor: true, children: [
|
|
6970
|
+
"... (ocultando ",
|
|
6971
|
+
truncatedCount,
|
|
6972
|
+
" linhas anteriores para performance) ..."
|
|
6973
|
+
] }),
|
|
6974
|
+
/* @__PURE__ */ jsx16(Box16, { paddingLeft: 2, flexDirection: "column", children: displayLines.map((line, i) => /* @__PURE__ */ jsx16(Text15, { color: "gray", dimColor: true, children: line }, i)) })
|
|
6975
|
+
] });
|
|
6956
6976
|
};
|
|
6957
6977
|
var StreamingText = memo10(StreamingTextComponent);
|
|
6958
6978
|
|
|
6959
6979
|
// src/app/ui/App.tsx
|
|
6960
|
-
import { jsx as jsx17, jsxs as
|
|
6980
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6961
6981
|
var SAFE_AUTO_APPROVE_TOOLS = [
|
|
6962
6982
|
// Comunicação/UI
|
|
6963
6983
|
"message",
|
|
@@ -7055,9 +7075,12 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
7055
7075
|
...prev,
|
|
7056
7076
|
{
|
|
7057
7077
|
id: prev.length,
|
|
7058
|
-
component: /* @__PURE__ */
|
|
7078
|
+
component: /* @__PURE__ */ jsxs16(Box17, { marginBottom: 1, children: [
|
|
7059
7079
|
/* @__PURE__ */ jsx17(Text16, { color: "white", bold: true, children: "$ " }),
|
|
7060
|
-
/* @__PURE__ */
|
|
7080
|
+
/* @__PURE__ */ jsxs16(Text16, { color: "white", children: [
|
|
7081
|
+
"!",
|
|
7082
|
+
command
|
|
7083
|
+
] })
|
|
7061
7084
|
] })
|
|
7062
7085
|
}
|
|
7063
7086
|
]);
|
|
@@ -7076,7 +7099,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7076
7099
|
...prev,
|
|
7077
7100
|
{
|
|
7078
7101
|
id: prev.length,
|
|
7079
|
-
component: /* @__PURE__ */
|
|
7102
|
+
component: /* @__PURE__ */ jsxs16(Text16, { color: "red", children: [
|
|
7080
7103
|
"Failed to execute: ",
|
|
7081
7104
|
result.error || result.message
|
|
7082
7105
|
] })
|
|
@@ -7089,7 +7112,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7089
7112
|
...prev,
|
|
7090
7113
|
{
|
|
7091
7114
|
id: prev.length,
|
|
7092
|
-
component: /* @__PURE__ */
|
|
7115
|
+
component: /* @__PURE__ */ jsxs16(Text16, { color: "red", children: [
|
|
7093
7116
|
"Error: ",
|
|
7094
7117
|
err.message
|
|
7095
7118
|
] })
|
|
@@ -7108,8 +7131,8 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7108
7131
|
id: prev.length,
|
|
7109
7132
|
component: (
|
|
7110
7133
|
// Uma única Box para o espaçamento
|
|
7111
|
-
/* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */
|
|
7112
|
-
/* @__PURE__ */
|
|
7134
|
+
/* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text16, { color: "white", dimColor: true, children: [
|
|
7135
|
+
/* @__PURE__ */ jsxs16(Text16, { color: "white", children: [
|
|
7113
7136
|
">",
|
|
7114
7137
|
" "
|
|
7115
7138
|
] }),
|
|
@@ -7226,7 +7249,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7226
7249
|
if (parsed.type === "debug") {
|
|
7227
7250
|
newComponent = /* @__PURE__ */ jsx17(Text16, { color: "gray", children: parsed.message });
|
|
7228
7251
|
} else if (parsed.type === "protocol_violation") {
|
|
7229
|
-
newComponent = /* @__PURE__ */
|
|
7252
|
+
newComponent = /* @__PURE__ */ jsxs16(
|
|
7230
7253
|
Box17,
|
|
7231
7254
|
{
|
|
7232
7255
|
borderStyle: "round",
|
|
@@ -7269,8 +7292,8 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7269
7292
|
}
|
|
7270
7293
|
);
|
|
7271
7294
|
} else if (parsed.type === "user_overlay") {
|
|
7272
|
-
newComponent = /* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */
|
|
7273
|
-
/* @__PURE__ */
|
|
7295
|
+
newComponent = /* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text16, { color: "gray", children: [
|
|
7296
|
+
/* @__PURE__ */ jsxs16(Text16, { color: "magenta", children: [
|
|
7274
7297
|
">",
|
|
7275
7298
|
" "
|
|
7276
7299
|
] }),
|
|
@@ -7279,7 +7302,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7279
7302
|
} else if (parsed.type === "reasoning") {
|
|
7280
7303
|
newComponent = /* @__PURE__ */ jsx17(ReasoningDisplay, { reasoning: parsed.content });
|
|
7281
7304
|
} else if (parsed.type === "log") {
|
|
7282
|
-
newComponent = /* @__PURE__ */
|
|
7305
|
+
newComponent = /* @__PURE__ */ jsxs16(Text16, { color: "gray", children: [
|
|
7283
7306
|
"\u2139\uFE0F ",
|
|
7284
7307
|
parsed.message,
|
|
7285
7308
|
parsed.payload ? `: ${parsed.payload}` : ""
|
|
@@ -7324,7 +7347,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7324
7347
|
}
|
|
7325
7348
|
);
|
|
7326
7349
|
}
|
|
7327
|
-
return /* @__PURE__ */
|
|
7350
|
+
return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
7328
7351
|
isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx17(WorkingTimer, { eventBus: eventBus2 }),
|
|
7329
7352
|
/* @__PURE__ */ jsx17(
|
|
7330
7353
|
InputPrompt,
|
|
@@ -7337,7 +7360,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7337
7360
|
)
|
|
7338
7361
|
] });
|
|
7339
7362
|
};
|
|
7340
|
-
return /* @__PURE__ */
|
|
7363
|
+
return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
7341
7364
|
/* @__PURE__ */ jsx17(Static, { items: history, children: (item) => /* @__PURE__ */ jsx17(Box17, { children: item.component }, item.id) }),
|
|
7342
7365
|
/* @__PURE__ */ jsx17(
|
|
7343
7366
|
StreamingText,
|