@nomad-e/bluma-cli 0.0.3 → 0.0.5

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.
@@ -10,7 +10,7 @@
10
10
  "@sousaalex1605/bluma-nootebook"
11
11
  ]
12
12
  },
13
- "github": {
13
+ "githubApi": {
14
14
  "type": "stdio",
15
15
  "command": "cmd",
16
16
  "args": [
@@ -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
  ] });
@@ -1838,6 +1833,8 @@ var Agent = class {
1838
1833
  - Follow the stripes o "Tool Naming Policy"
1839
1834
  - Never modify the names of the tools, use their real names without any modification.
1840
1835
  - Never forget to signal the system when the task is completed 'agent_end_task' tool.
1836
+ ## Important: When writing to Notion, you must strictly follow its content structure, including the correct use of headings (heading_1, heading_2, etc.) and other formatting standards. No deviations are allowed.
1837
+
1841
1838
  `;
1842
1839
  this.history.push({ role: "system", content: systemPrompt });
1843
1840
  await saveSessionHistory(this.sessionFile, this.history);
@@ -2201,17 +2198,14 @@ var renderGenericToolCall = ({ toolName, args }) => {
2201
2198
  const formattedArgs = formatArgumentsForDisplay(args);
2202
2199
  return (
2203
2200
  // A "moldura" padrão de sucesso com a borda cinza
2204
- /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [
2201
+ /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
2205
2202
  /* @__PURE__ */ jsx8(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
2206
2203
  /* @__PURE__ */ jsx8(Text8, { color: "green", children: "\u25CF " }),
2207
2204
  toolName
2208
2205
  ] }) }),
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)) })
2206
+ formattedArgs && formattedArgs !== "{}" && /* @__PURE__ */ jsxs8(Box8, { paddingX: 3, children: [
2207
+ /* @__PURE__ */ jsx8(Text8, { color: "gray", children: "\u21B3 " }),
2208
+ /* @__PURE__ */ jsx8(Box8, { flexDirection: "column", children: formattedArgs.split("\n").map((line, index) => /* @__PURE__ */ jsx8(Text8, { color: "gray", children: line }, index)) })
2215
2209
  ] })
2216
2210
  ] })
2217
2211
  );
@@ -2239,46 +2233,26 @@ var ToolCallDisplay = memo2(ToolCallDisplayComponent);
2239
2233
  // src/app/ui/components/ToolResultDisplay.tsx
2240
2234
  import { memo as memo3 } from "react";
2241
2235
  import { Box as Box10, Text as Text9 } from "ink";
2242
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
2236
+ import { jsx as jsx10 } from "react/jsx-runtime";
2243
2237
  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")) {
2238
+ if (!toolName.includes("message_notify_dev")) {
2246
2239
  return null;
2247
2240
  }
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
2241
  try {
2260
- const parsedJson = JSON.parse(result);
2261
- formattedResult = JSON.stringify(parsedJson, null, 2);
2242
+ const parsed = JSON.parse(result);
2243
+ if (parsed.content && parsed.content.body) {
2244
+ const bodyText = parsed.content.body.trim();
2245
+ return /* @__PURE__ */ jsx10(Box10, { marginBottom: 1, paddingX: 1, children: /* @__PURE__ */ jsx10(Text9, { children: bodyText }) });
2246
+ }
2262
2247
  } catch (e) {
2263
- formattedResult = result;
2248
+ return null;
2264
2249
  }
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
- ] });
2250
+ return null;
2277
2251
  };
2278
2252
  var ToolResultDisplay = memo3(ToolResultDisplayComponent);
2279
2253
 
2280
2254
  // src/app/ui/App.tsx
2281
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2255
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2282
2256
  var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2283
2257
  const agentInstance = useRef(null);
2284
2258
  const [history, setHistory] = useState4([]);
@@ -2319,8 +2293,8 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2319
2293
  id: prev.length,
2320
2294
  component: (
2321
2295
  // 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: [
2296
+ /* @__PURE__ */ jsx11(Box11, { marginBottom: 1, children: /* @__PURE__ */ jsxs9(Text10, { color: "white", dimColor: true, children: [
2297
+ /* @__PURE__ */ jsxs9(Text10, { color: "white", children: [
2324
2298
  ">",
2325
2299
  " "
2326
2300
  ] }),
@@ -2430,7 +2404,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2430
2404
  if (parsed.type === "debug") {
2431
2405
  newComponent = /* @__PURE__ */ jsx11(Text10, { color: "gray", children: parsed.message });
2432
2406
  } else if (parsed.type === "protocol_violation") {
2433
- newComponent = /* @__PURE__ */ jsxs10(
2407
+ newComponent = /* @__PURE__ */ jsxs9(
2434
2408
  Box11,
2435
2409
  {
2436
2410
  borderStyle: "round",
@@ -2440,7 +2414,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2440
2414
  paddingX: 1,
2441
2415
  children: [
2442
2416
  " ",
2443
- /* @__PURE__ */ jsxs10(Text10, { color: "yellow", bold: true, children: [
2417
+ /* @__PURE__ */ jsxs9(Text10, { color: "yellow", bold: true, children: [
2444
2418
  " ",
2445
2419
  "Protocol Violation",
2446
2420
  " "
@@ -2454,7 +2428,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2454
2428
  }
2455
2429
  );
2456
2430
  } else if (parsed.type === "error") {
2457
- newComponent = /* @__PURE__ */ jsxs10(Text10, { color: "red", children: [
2431
+ newComponent = /* @__PURE__ */ jsxs9(Text10, { color: "red", children: [
2458
2432
  "\u274C ",
2459
2433
  parsed.message
2460
2434
  ] });
@@ -2495,7 +2469,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2495
2469
  }, [eventBus2, sessionId2, handleConfirmation]);
2496
2470
  const renderInteractiveComponent = () => {
2497
2471
  if (mcpStatus !== "connected") {
2498
- return /* @__PURE__ */ jsx11(Box11, { borderStyle: "round", borderColor: "black", children: /* @__PURE__ */ jsxs10(Text10, { color: "yellow", children: [
2472
+ return /* @__PURE__ */ jsx11(Box11, { borderStyle: "round", borderColor: "black", children: /* @__PURE__ */ jsxs9(Text10, { color: "yellow", children: [
2499
2473
  /* @__PURE__ */ jsx11(Spinner, { type: "dots" }),
2500
2474
  " ",
2501
2475
  statusMessage || "Connecting..."
@@ -2514,7 +2488,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2514
2488
  }
2515
2489
  );
2516
2490
  }
2517
- return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", children: [
2491
+ return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
2518
2492
  isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx11(WorkingTimer, {}),
2519
2493
  /* @__PURE__ */ jsx11(
2520
2494
  InputPrompt,
@@ -2526,7 +2500,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
2526
2500
  )
2527
2501
  ] });
2528
2502
  };
2529
- return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", children: [
2503
+ return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", children: [
2530
2504
  /* @__PURE__ */ jsx11(Static, { items: history, children: (item) => /* @__PURE__ */ jsx11(Box11, { children: item.component }, item.id) }),
2531
2505
  renderInteractiveComponent()
2532
2506
  ] });
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.5",
4
4
  "description": "BluMa independent agent for automation and advanced software engineering.",
5
5
  "author": "Alex Fonseca",
6
6
  "license": "MIT",