@nomad-e/bluma-cli 0.0.3 → 0.0.4
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/bluma-mcp.json +3 -3
- package/dist/main.js +49 -77
- package/package.json +1 -1
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
"
|
|
26
|
+
"notionApi": {
|
|
27
27
|
"type": "stdio",
|
|
28
28
|
"command": "cmd",
|
|
29
29
|
"args": [
|
|
30
30
|
"/c",
|
|
31
31
|
"npx",
|
|
32
32
|
"-y",
|
|
33
|
-
"@
|
|
33
|
+
"@notionhq/notion-mcp-server"
|
|
34
34
|
],
|
|
35
35
|
"env": {
|
|
36
|
-
"
|
|
36
|
+
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ${NOTION_API_TOKEN}\", \"Notion-Version\": \"2022-06-28\" }"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"upstash_context7-mcp": {
|
package/dist/main.js
CHANGED
|
@@ -192,7 +192,7 @@ var InputPrompt = ({ onSubmit, isReadOnly, onInterrupt }) => {
|
|
|
192
192
|
);
|
|
193
193
|
const textAfterCursor = visibleText.slice(visibleCursorPosition + 1);
|
|
194
194
|
const borderColor = isReadOnly ? "gray" : "gray";
|
|
195
|
-
const placeholder = isReadOnly ? "
|
|
195
|
+
const placeholder = isReadOnly ? "press esc to cancel" : "";
|
|
196
196
|
const showPlaceholder = text.length === 0 && isReadOnly;
|
|
197
197
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
198
198
|
/* @__PURE__ */ jsx2(Box2, { borderStyle: "round", borderColor, borderDimColor: !isReadOnly, children: /* @__PURE__ */ jsxs2(Box2, { flexDirection: "row", paddingX: 1, flexWrap: "nowrap", children: [
|
|
@@ -306,18 +306,6 @@ var SimpleDiff = ({ text, maxHeight }) => {
|
|
|
306
306
|
|
|
307
307
|
// src/app/ui/components/promptRenderers.tsx
|
|
308
308
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
309
|
-
var formatArguments = (args) => {
|
|
310
|
-
if (!args) return "";
|
|
311
|
-
if (typeof args === "string") {
|
|
312
|
-
try {
|
|
313
|
-
return JSON.stringify(JSON.parse(args), null, 2);
|
|
314
|
-
} catch (e) {
|
|
315
|
-
return args;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
if (Object.keys(args).length === 0) return "";
|
|
319
|
-
return JSON.stringify(args, null, 2);
|
|
320
|
-
};
|
|
321
309
|
var getBasePath = (filePath) => {
|
|
322
310
|
return path.basename(filePath);
|
|
323
311
|
};
|
|
@@ -417,27 +405,34 @@ var renderEditTool = ({ toolCall, preview }) => {
|
|
|
417
405
|
};
|
|
418
406
|
var renderGeneric = ({ toolCall }) => {
|
|
419
407
|
const toolName = toolCall.function.name;
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
408
|
+
const rawArguments = toolCall.function.arguments;
|
|
409
|
+
const MAX_LINES = 5;
|
|
410
|
+
let formattedArgsString;
|
|
411
|
+
if (!rawArguments) {
|
|
412
|
+
formattedArgsString = "";
|
|
413
|
+
} else if (typeof rawArguments === "string") {
|
|
414
|
+
try {
|
|
415
|
+
const parsedJson = JSON.parse(rawArguments);
|
|
416
|
+
formattedArgsString = JSON.stringify(parsedJson, null, 2);
|
|
417
|
+
} catch (e) {
|
|
418
|
+
formattedArgsString = rawArguments;
|
|
419
|
+
}
|
|
420
|
+
} else {
|
|
421
|
+
formattedArgsString = JSON.stringify(rawArguments, null, 2);
|
|
422
|
+
}
|
|
423
|
+
const lines = formattedArgsString.split("\n");
|
|
424
|
+
const isTruncated = lines.length > MAX_LINES;
|
|
425
|
+
const visibleLines = isTruncated ? lines.slice(0, MAX_LINES) : lines;
|
|
426
|
+
const remainingCount = lines.length - MAX_LINES;
|
|
424
427
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginBottom: 1, children: [
|
|
425
428
|
/* @__PURE__ */ jsx5(Box5, { children: /* @__PURE__ */ jsx5(Text5, { bold: true, children: toolName }) }),
|
|
426
|
-
|
|
427
|
-
/* @__PURE__ */ jsx5(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
overflow: "hidden",
|
|
434
|
-
children: /* @__PURE__ */ jsx5(Text5, { color: "gray", children: formattedArgs })
|
|
435
|
-
}
|
|
436
|
-
),
|
|
437
|
-
areArgsTruncated && /* @__PURE__ */ jsx5(Box5, { marginLeft: 2, children: /* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
|
|
438
|
-
"... (",
|
|
439
|
-
totalLines - ARGS_BOX_HEIGHT,
|
|
440
|
-
" more lines hidden) ..."
|
|
429
|
+
formattedArgsString && /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginTop: 1, children: [
|
|
430
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Arguments:" }),
|
|
431
|
+
/* @__PURE__ */ jsx5(Box5, { marginLeft: 2, flexDirection: "column", children: visibleLines.map((line, idx) => /* @__PURE__ */ jsx5(Text5, { color: "gray", children: line }, idx)) }),
|
|
432
|
+
isTruncated && /* @__PURE__ */ jsx5(Box5, { marginLeft: 2, children: /* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
|
|
433
|
+
"...(",
|
|
434
|
+
remainingCount,
|
|
435
|
+
" more lines hidden)"
|
|
441
436
|
] }) })
|
|
442
437
|
] })
|
|
443
438
|
] });
|
|
@@ -2201,17 +2196,14 @@ var renderGenericToolCall = ({ toolName, args }) => {
|
|
|
2201
2196
|
const formattedArgs = formatArgumentsForDisplay(args);
|
|
2202
2197
|
return (
|
|
2203
2198
|
// A "moldura" padrão de sucesso com a borda cinza
|
|
2204
|
-
/* @__PURE__ */ jsxs8(Box8, { flexDirection: "column",
|
|
2199
|
+
/* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
2205
2200
|
/* @__PURE__ */ jsx8(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
|
|
2206
2201
|
/* @__PURE__ */ jsx8(Text8, { color: "green", children: "\u25CF " }),
|
|
2207
2202
|
toolName
|
|
2208
2203
|
] }) }),
|
|
2209
|
-
formattedArgs && formattedArgs !== "{}" && /* @__PURE__ */ jsxs8(Box8, {
|
|
2210
|
-
/* @__PURE__ */ jsx8(Text8, {
|
|
2211
|
-
/* @__PURE__ */ jsx8(Box8, {
|
|
2212
|
-
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "\u21B3 " }),
|
|
2213
|
-
line
|
|
2214
|
-
] }, index)) })
|
|
2204
|
+
formattedArgs && formattedArgs !== "{}" && /* @__PURE__ */ jsxs8(Box8, { paddingX: 3, children: [
|
|
2205
|
+
/* @__PURE__ */ jsx8(Text8, { color: "gray", children: "\u21B3 " }),
|
|
2206
|
+
/* @__PURE__ */ jsx8(Box8, { flexDirection: "column", children: formattedArgs.split("\n").map((line, index) => /* @__PURE__ */ jsx8(Text8, { color: "gray", children: line }, index)) })
|
|
2215
2207
|
] })
|
|
2216
2208
|
] })
|
|
2217
2209
|
);
|
|
@@ -2239,46 +2231,26 @@ var ToolCallDisplay = memo2(ToolCallDisplayComponent);
|
|
|
2239
2231
|
// src/app/ui/components/ToolResultDisplay.tsx
|
|
2240
2232
|
import { memo as memo3 } from "react";
|
|
2241
2233
|
import { Box as Box10, Text as Text9 } from "ink";
|
|
2242
|
-
import { jsx as jsx10
|
|
2234
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2243
2235
|
var ToolResultDisplayComponent = ({ toolName, result }) => {
|
|
2244
|
-
|
|
2245
|
-
if (toolName.includes("agent_end_task") || toolName.includes("bluma_nootebook") || toolName.includes("shell_command") || toolName.includes("ls_tool") || toolName.includes("count_file_lines") || toolName.includes("read_file_lines") || toolName.includes("edit_tool")) {
|
|
2236
|
+
if (!toolName.includes("message_notify_dev")) {
|
|
2246
2237
|
return null;
|
|
2247
2238
|
}
|
|
2248
|
-
if (toolName.includes("message_notify_dev")) {
|
|
2249
|
-
try {
|
|
2250
|
-
const parsed = JSON.parse(result);
|
|
2251
|
-
if (parsed.content && parsed.content.body) {
|
|
2252
|
-
const bodyText = parsed.content.body.trim();
|
|
2253
|
-
return /* @__PURE__ */ jsx10(Box10, { marginBottom: 1, paddingX: 1, children: /* @__PURE__ */ jsx10(Text9, { children: bodyText }) });
|
|
2254
|
-
}
|
|
2255
|
-
} catch (e) {
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
let formattedResult = result;
|
|
2259
2239
|
try {
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2240
|
+
const parsed = JSON.parse(result);
|
|
2241
|
+
if (parsed.content && parsed.content.body) {
|
|
2242
|
+
const bodyText = parsed.content.body.trim();
|
|
2243
|
+
return /* @__PURE__ */ jsx10(Box10, { marginBottom: 1, paddingX: 1, children: /* @__PURE__ */ jsx10(Text9, { children: bodyText }) });
|
|
2244
|
+
}
|
|
2262
2245
|
} catch (e) {
|
|
2263
|
-
|
|
2246
|
+
return null;
|
|
2264
2247
|
}
|
|
2265
|
-
|
|
2266
|
-
const isTruncated = lines.length > MAX_LINES;
|
|
2267
|
-
const visibleLines = isTruncated ? lines.slice(0, MAX_LINES) : lines;
|
|
2268
|
-
const remainingCount = lines.length - MAX_LINES;
|
|
2269
|
-
return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "column", marginBottom: 1, children: [
|
|
2270
|
-
visibleLines.map((line, idx) => /* @__PURE__ */ jsx10(Text9, { color: "gray", children: line }, idx)),
|
|
2271
|
-
isTruncated && /* @__PURE__ */ jsxs9(Text9, { color: "gray", children: [
|
|
2272
|
-
"...(",
|
|
2273
|
-
remainingCount,
|
|
2274
|
-
" more lines)"
|
|
2275
|
-
] })
|
|
2276
|
-
] });
|
|
2248
|
+
return null;
|
|
2277
2249
|
};
|
|
2278
2250
|
var ToolResultDisplay = memo3(ToolResultDisplayComponent);
|
|
2279
2251
|
|
|
2280
2252
|
// src/app/ui/App.tsx
|
|
2281
|
-
import { jsx as jsx11, jsxs as
|
|
2253
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2282
2254
|
var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
2283
2255
|
const agentInstance = useRef(null);
|
|
2284
2256
|
const [history, setHistory] = useState4([]);
|
|
@@ -2319,8 +2291,8 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2319
2291
|
id: prev.length,
|
|
2320
2292
|
component: (
|
|
2321
2293
|
// Uma única Box para o espaçamento
|
|
2322
|
-
/* @__PURE__ */ jsx11(Box11, { marginBottom: 1, children: /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx11(Box11, { marginBottom: 1, children: /* @__PURE__ */ jsxs9(Text10, { color: "white", dimColor: true, children: [
|
|
2295
|
+
/* @__PURE__ */ jsxs9(Text10, { color: "white", children: [
|
|
2324
2296
|
">",
|
|
2325
2297
|
" "
|
|
2326
2298
|
] }),
|
|
@@ -2430,7 +2402,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2430
2402
|
if (parsed.type === "debug") {
|
|
2431
2403
|
newComponent = /* @__PURE__ */ jsx11(Text10, { color: "gray", children: parsed.message });
|
|
2432
2404
|
} else if (parsed.type === "protocol_violation") {
|
|
2433
|
-
newComponent = /* @__PURE__ */
|
|
2405
|
+
newComponent = /* @__PURE__ */ jsxs9(
|
|
2434
2406
|
Box11,
|
|
2435
2407
|
{
|
|
2436
2408
|
borderStyle: "round",
|
|
@@ -2440,7 +2412,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2440
2412
|
paddingX: 1,
|
|
2441
2413
|
children: [
|
|
2442
2414
|
" ",
|
|
2443
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ jsxs9(Text10, { color: "yellow", bold: true, children: [
|
|
2444
2416
|
" ",
|
|
2445
2417
|
"Protocol Violation",
|
|
2446
2418
|
" "
|
|
@@ -2454,7 +2426,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2454
2426
|
}
|
|
2455
2427
|
);
|
|
2456
2428
|
} else if (parsed.type === "error") {
|
|
2457
|
-
newComponent = /* @__PURE__ */
|
|
2429
|
+
newComponent = /* @__PURE__ */ jsxs9(Text10, { color: "red", children: [
|
|
2458
2430
|
"\u274C ",
|
|
2459
2431
|
parsed.message
|
|
2460
2432
|
] });
|
|
@@ -2495,7 +2467,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2495
2467
|
}, [eventBus2, sessionId2, handleConfirmation]);
|
|
2496
2468
|
const renderInteractiveComponent = () => {
|
|
2497
2469
|
if (mcpStatus !== "connected") {
|
|
2498
|
-
return /* @__PURE__ */ jsx11(Box11, { borderStyle: "round", borderColor: "black", children: /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ jsx11(Box11, { borderStyle: "round", borderColor: "black", children: /* @__PURE__ */ jsxs9(Text10, { color: "yellow", children: [
|
|
2499
2471
|
/* @__PURE__ */ jsx11(Spinner, { type: "dots" }),
|
|
2500
2472
|
" ",
|
|
2501
2473
|
statusMessage || "Connecting..."
|
|
@@ -2514,7 +2486,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2514
2486
|
}
|
|
2515
2487
|
);
|
|
2516
2488
|
}
|
|
2517
|
-
return /* @__PURE__ */
|
|
2489
|
+
return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
|
|
2518
2490
|
isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx11(WorkingTimer, {}),
|
|
2519
2491
|
/* @__PURE__ */ jsx11(
|
|
2520
2492
|
InputPrompt,
|
|
@@ -2526,7 +2498,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2526
2498
|
)
|
|
2527
2499
|
] });
|
|
2528
2500
|
};
|
|
2529
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
|
|
2530
2502
|
/* @__PURE__ */ jsx11(Static, { items: history, children: (item) => /* @__PURE__ */ jsx11(Box11, { children: item.component }, item.id) }),
|
|
2531
2503
|
renderInteractiveComponent()
|
|
2532
2504
|
] });
|