@nomad-e/bluma-cli 0.0.2 → 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: [
@@ -204,7 +204,7 @@ var InputPrompt = ({ onSubmit, isReadOnly, onInterrupt }) => {
204
204
  /* @__PURE__ */ jsx2(Text2, { inverse: !isReadOnly, children: charAtCursor || " " }),
205
205
  showPlaceholder ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: placeholder }) : /* @__PURE__ */ jsx2(Text2, { children: textAfterCursor })
206
206
  ] }) }),
207
- /* @__PURE__ */ jsx2(Box2, { paddingX: 1, children: /* @__PURE__ */ jsxs2(Text2, { color: "gray", dimColor: true, children: [
207
+ /* @__PURE__ */ jsx2(Box2, { paddingX: 1, justifyContent: "center", children: /* @__PURE__ */ jsxs2(Text2, { color: "gray", dimColor: true, children: [
208
208
  "ctrl+c to exit | esc to interrupt | ",
209
209
  isReadOnly ? "Read-only mode" : "Editable mode"
210
210
  ] }) })
@@ -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,31 +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 = 5;
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
- /* @__PURE__ */ jsx5(Box5, { children: /* @__PURE__ */ jsxs5(Text5, { bold: true, children: [
426
- /* @__PURE__ */ jsx5(Text5, { color: "magenta", children: "? " }),
427
- toolName
428
- ] }) }),
429
- formattedArgs && /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginTop: 1, children: [
428
+ /* @__PURE__ */ jsx5(Box5, { children: /* @__PURE__ */ jsx5(Text5, { bold: true, children: toolName }) }),
429
+ formattedArgsString && /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginTop: 1, children: [
430
430
  /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Arguments:" }),
431
- /* @__PURE__ */ jsx5(
432
- Box5,
433
- {
434
- marginLeft: 2,
435
- height: ARGS_BOX_HEIGHT,
436
- flexDirection: "column",
437
- overflow: "hidden",
438
- children: /* @__PURE__ */ jsx5(Text5, { color: "gray", children: formattedArgs })
439
- }
440
- ),
441
- areArgsTruncated && /* @__PURE__ */ jsx5(Box5, { marginLeft: 2, children: /* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
442
- "... (",
443
- totalLines - ARGS_BOX_HEIGHT,
444
- " more lines hidden) ..."
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)"
445
436
  ] }) })
446
437
  ] })
447
438
  ] });
@@ -2205,17 +2196,14 @@ var renderGenericToolCall = ({ toolName, args }) => {
2205
2196
  const formattedArgs = formatArgumentsForDisplay(args);
2206
2197
  return (
2207
2198
  // A "moldura" padrão de sucesso com a borda cinza
2208
- /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [
2199
+ /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
2209
2200
  /* @__PURE__ */ jsx8(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
2210
2201
  /* @__PURE__ */ jsx8(Text8, { color: "green", children: "\u25CF " }),
2211
2202
  toolName
2212
2203
  ] }) }),
2213
- formattedArgs && formattedArgs !== "{}" && /* @__PURE__ */ jsxs8(Box8, { marginTop: 1, flexDirection: "column", children: [
2214
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Arguments passed:" }),
2215
- /* @__PURE__ */ jsx8(Box8, { marginLeft: 2, flexDirection: "column", children: formattedArgs.split("\n").map((line, index) => /* @__PURE__ */ jsxs8(Text8, { color: "gray", children: [
2216
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "\u21B3 " }),
2217
- line
2218
- ] }, 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)) })
2219
2207
  ] })
2220
2208
  ] })
2221
2209
  );
@@ -2243,46 +2231,26 @@ var ToolCallDisplay = memo2(ToolCallDisplayComponent);
2243
2231
  // src/app/ui/components/ToolResultDisplay.tsx
2244
2232
  import { memo as memo3 } from "react";
2245
2233
  import { Box as Box10, Text as Text9 } from "ink";
2246
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
2234
+ import { jsx as jsx10 } from "react/jsx-runtime";
2247
2235
  var ToolResultDisplayComponent = ({ toolName, result }) => {
2248
- const MAX_LINES = 3;
2249
- 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")) {
2250
2237
  return null;
2251
2238
  }
2252
- if (toolName.includes("message_notify_dev")) {
2253
- try {
2254
- const parsed = JSON.parse(result);
2255
- if (parsed.content && parsed.content.body) {
2256
- const bodyText = parsed.content.body.trim();
2257
- return /* @__PURE__ */ jsx10(Box10, { marginBottom: 1, paddingX: 1, children: /* @__PURE__ */ jsx10(Text9, { children: bodyText }) });
2258
- }
2259
- } catch (e) {
2260
- }
2261
- }
2262
- let formattedResult = result;
2263
2239
  try {
2264
- const parsedJson = JSON.parse(result);
2265
- 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
+ }
2266
2245
  } catch (e) {
2267
- formattedResult = result;
2246
+ return null;
2268
2247
  }
2269
- const lines = formattedResult.split("\n");
2270
- const isTruncated = lines.length > MAX_LINES;
2271
- const visibleLines = isTruncated ? lines.slice(0, MAX_LINES) : lines;
2272
- const remainingCount = lines.length - MAX_LINES;
2273
- return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "column", marginBottom: 1, children: [
2274
- visibleLines.map((line, idx) => /* @__PURE__ */ jsx10(Text9, { color: "gray", children: line }, idx)),
2275
- isTruncated && /* @__PURE__ */ jsxs9(Text9, { color: "gray", children: [
2276
- "...(",
2277
- remainingCount,
2278
- " more lines)"
2279
- ] })
2280
- ] });
2248
+ return null;
2281
2249
  };
2282
2250
  var ToolResultDisplay = memo3(ToolResultDisplayComponent);
2283
2251
 
2284
2252
  // src/app/ui/App.tsx
2285
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2253
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2286
2254
  var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2287
2255
  const agentInstance = useRef(null);
2288
2256
  const [history, setHistory] = useState4([]);
@@ -2323,8 +2291,8 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2323
2291
  id: prev.length,
2324
2292
  component: (
2325
2293
  // Uma única Box para o espaçamento
2326
- /* @__PURE__ */ jsx11(Box11, { marginBottom: 1, children: /* @__PURE__ */ jsxs10(Text10, { color: "white", dimColor: true, children: [
2327
- /* @__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: [
2328
2296
  ">",
2329
2297
  " "
2330
2298
  ] }),
@@ -2434,7 +2402,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2434
2402
  if (parsed.type === "debug") {
2435
2403
  newComponent = /* @__PURE__ */ jsx11(Text10, { color: "gray", children: parsed.message });
2436
2404
  } else if (parsed.type === "protocol_violation") {
2437
- newComponent = /* @__PURE__ */ jsxs10(
2405
+ newComponent = /* @__PURE__ */ jsxs9(
2438
2406
  Box11,
2439
2407
  {
2440
2408
  borderStyle: "round",
@@ -2444,7 +2412,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2444
2412
  paddingX: 1,
2445
2413
  children: [
2446
2414
  " ",
2447
- /* @__PURE__ */ jsxs10(Text10, { color: "yellow", bold: true, children: [
2415
+ /* @__PURE__ */ jsxs9(Text10, { color: "yellow", bold: true, children: [
2448
2416
  " ",
2449
2417
  "Protocol Violation",
2450
2418
  " "
@@ -2458,7 +2426,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2458
2426
  }
2459
2427
  );
2460
2428
  } else if (parsed.type === "error") {
2461
- newComponent = /* @__PURE__ */ jsxs10(Text10, { color: "red", children: [
2429
+ newComponent = /* @__PURE__ */ jsxs9(Text10, { color: "red", children: [
2462
2430
  "\u274C ",
2463
2431
  parsed.message
2464
2432
  ] });
@@ -2499,7 +2467,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2499
2467
  }, [eventBus2, sessionId2, handleConfirmation]);
2500
2468
  const renderInteractiveComponent = () => {
2501
2469
  if (mcpStatus !== "connected") {
2502
- 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: [
2503
2471
  /* @__PURE__ */ jsx11(Spinner, { type: "dots" }),
2504
2472
  " ",
2505
2473
  statusMessage || "Connecting..."
@@ -2518,7 +2486,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2518
2486
  }
2519
2487
  );
2520
2488
  }
2521
- return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", children: [
2489
+ return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
2522
2490
  isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx11(WorkingTimer, {}),
2523
2491
  /* @__PURE__ */ jsx11(
2524
2492
  InputPrompt,
@@ -2530,7 +2498,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2530
2498
  )
2531
2499
  ] });
2532
2500
  };
2533
- return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", children: [
2501
+ return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
2534
2502
  /* @__PURE__ */ jsx11(Static, { items: history, children: (item) => /* @__PURE__ */ jsx11(Box11, { children: item.component }, item.id) }),
2535
2503
  renderInteractiveComponent()
2536
2504
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomad-e/bluma-cli",
3
- "version": "0.0.2",
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",