@nomad-e/bluma-cli 0.1.13 → 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 +36 -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,9 @@ 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: [
|
|
7061
7081
|
"!",
|
|
7062
7082
|
command
|
|
7063
7083
|
] })
|
|
@@ -7079,7 +7099,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7079
7099
|
...prev,
|
|
7080
7100
|
{
|
|
7081
7101
|
id: prev.length,
|
|
7082
|
-
component: /* @__PURE__ */
|
|
7102
|
+
component: /* @__PURE__ */ jsxs16(Text16, { color: "red", children: [
|
|
7083
7103
|
"Failed to execute: ",
|
|
7084
7104
|
result.error || result.message
|
|
7085
7105
|
] })
|
|
@@ -7092,7 +7112,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7092
7112
|
...prev,
|
|
7093
7113
|
{
|
|
7094
7114
|
id: prev.length,
|
|
7095
|
-
component: /* @__PURE__ */
|
|
7115
|
+
component: /* @__PURE__ */ jsxs16(Text16, { color: "red", children: [
|
|
7096
7116
|
"Error: ",
|
|
7097
7117
|
err.message
|
|
7098
7118
|
] })
|
|
@@ -7111,8 +7131,8 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7111
7131
|
id: prev.length,
|
|
7112
7132
|
component: (
|
|
7113
7133
|
// Uma única Box para o espaçamento
|
|
7114
|
-
/* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */
|
|
7115
|
-
/* @__PURE__ */
|
|
7134
|
+
/* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text16, { color: "white", dimColor: true, children: [
|
|
7135
|
+
/* @__PURE__ */ jsxs16(Text16, { color: "white", children: [
|
|
7116
7136
|
">",
|
|
7117
7137
|
" "
|
|
7118
7138
|
] }),
|
|
@@ -7229,7 +7249,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7229
7249
|
if (parsed.type === "debug") {
|
|
7230
7250
|
newComponent = /* @__PURE__ */ jsx17(Text16, { color: "gray", children: parsed.message });
|
|
7231
7251
|
} else if (parsed.type === "protocol_violation") {
|
|
7232
|
-
newComponent = /* @__PURE__ */
|
|
7252
|
+
newComponent = /* @__PURE__ */ jsxs16(
|
|
7233
7253
|
Box17,
|
|
7234
7254
|
{
|
|
7235
7255
|
borderStyle: "round",
|
|
@@ -7272,8 +7292,8 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7272
7292
|
}
|
|
7273
7293
|
);
|
|
7274
7294
|
} else if (parsed.type === "user_overlay") {
|
|
7275
|
-
newComponent = /* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */
|
|
7276
|
-
/* @__PURE__ */
|
|
7295
|
+
newComponent = /* @__PURE__ */ jsx17(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text16, { color: "gray", children: [
|
|
7296
|
+
/* @__PURE__ */ jsxs16(Text16, { color: "magenta", children: [
|
|
7277
7297
|
">",
|
|
7278
7298
|
" "
|
|
7279
7299
|
] }),
|
|
@@ -7282,7 +7302,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7282
7302
|
} else if (parsed.type === "reasoning") {
|
|
7283
7303
|
newComponent = /* @__PURE__ */ jsx17(ReasoningDisplay, { reasoning: parsed.content });
|
|
7284
7304
|
} else if (parsed.type === "log") {
|
|
7285
|
-
newComponent = /* @__PURE__ */
|
|
7305
|
+
newComponent = /* @__PURE__ */ jsxs16(Text16, { color: "gray", children: [
|
|
7286
7306
|
"\u2139\uFE0F ",
|
|
7287
7307
|
parsed.message,
|
|
7288
7308
|
parsed.payload ? `: ${parsed.payload}` : ""
|
|
@@ -7327,7 +7347,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7327
7347
|
}
|
|
7328
7348
|
);
|
|
7329
7349
|
}
|
|
7330
|
-
return /* @__PURE__ */
|
|
7350
|
+
return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
7331
7351
|
isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx17(WorkingTimer, { eventBus: eventBus2 }),
|
|
7332
7352
|
/* @__PURE__ */ jsx17(
|
|
7333
7353
|
InputPrompt,
|
|
@@ -7340,7 +7360,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
7340
7360
|
)
|
|
7341
7361
|
] });
|
|
7342
7362
|
};
|
|
7343
|
-
return /* @__PURE__ */
|
|
7363
|
+
return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
7344
7364
|
/* @__PURE__ */ jsx17(Static, { items: history, children: (item) => /* @__PURE__ */ jsx17(Box17, { children: item.component }, item.id) }),
|
|
7345
7365
|
/* @__PURE__ */ jsx17(
|
|
7346
7366
|
StreamingText,
|