@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.
@@ -23,17 +23,17 @@
23
23
  "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
24
24
  }
25
25
  },
26
- "notion": {
26
+ "notionApi": {
27
27
  "type": "stdio",
28
28
  "command": "cmd",
29
29
  "args": [
30
30
  "/c",
31
31
  "npx",
32
32
  "-y",
33
- "@suekou/mcp-notion-server"
33
+ "@notionhq/notion-mcp-server"
34
34
  ],
35
35
  "env": {
36
- "NOTION_API_TOKEN": "${NOTION_API_TOKEN}"
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 ? " press esc to cancel" : "";
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 formattedArgs = formatArguments(toolCall.function.arguments);
421
- const ARGS_BOX_HEIGHT = 3;
422
- const totalLines = formattedArgs.split("\n").length;
423
- const areArgsTruncated = totalLines > ARGS_BOX_HEIGHT;
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
- formattedArgs && /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginTop: 1, children: [
427
- /* @__PURE__ */ jsx5(
428
- Box5,
429
- {
430
- marginLeft: 2,
431
- height: ARGS_BOX_HEIGHT,
432
- flexDirection: "column",
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", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [
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, { marginTop: 1, flexDirection: "column", children: [
2210
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Arguments passed:" }),
2211
- /* @__PURE__ */ jsx8(Box8, { marginLeft: 2, flexDirection: "column", children: formattedArgs.split("\n").map((line, index) => /* @__PURE__ */ jsxs8(Text8, { color: "gray", children: [
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, jsxs as jsxs9 } from "react/jsx-runtime";
2234
+ import { jsx as jsx10 } from "react/jsx-runtime";
2243
2235
  var ToolResultDisplayComponent = ({ toolName, result }) => {
2244
- const MAX_LINES = 3;
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 parsedJson = JSON.parse(result);
2261
- formattedResult = JSON.stringify(parsedJson, null, 2);
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
- formattedResult = result;
2246
+ return null;
2264
2247
  }
2265
- const lines = formattedResult.split("\n");
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 jsxs10 } from "react/jsx-runtime";
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__ */ jsxs10(Text10, { color: "white", dimColor: true, children: [
2323
- /* @__PURE__ */ jsxs10(Text10, { color: "white", children: [
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__ */ jsxs10(
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__ */ jsxs10(Text10, { color: "yellow", bold: true, children: [
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__ */ jsxs10(Text10, { color: "red", children: [
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__ */ jsxs10(Text10, { color: "yellow", children: [
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__ */ jsxs10(Box11, { flexDirection: "column", children: [
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__ */ jsxs10(Box11, { flexDirection: "column", children: [
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
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomad-e/bluma-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "BluMa independent agent for automation and advanced software engineering.",
5
5
  "author": "Alex Fonseca",
6
6
  "license": "MIT",