@hasna/oldpal 0.3.1 → 0.3.3

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/index.js CHANGED
@@ -31417,41 +31417,97 @@ function MessageBubble({ message }) {
31417
31417
  ]
31418
31418
  }, undefined, true, undefined, this);
31419
31419
  }
31420
- const toolCount = message.toolCalls?.length || 0;
31420
+ const toolSummary = message.toolCalls ? getToolSummary(message.toolCalls) : "";
31421
+ const hasContent = message.content && message.content.trim();
31422
+ if (!hasContent && toolSummary) {
31423
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
31424
+ marginY: 1,
31425
+ children: [
31426
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31427
+ dimColor: true,
31428
+ children: "\u25CF "
31429
+ }, undefined, false, undefined, this),
31430
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31431
+ dimColor: true,
31432
+ children: toolSummary
31433
+ }, undefined, false, undefined, this)
31434
+ ]
31435
+ }, undefined, true, undefined, this);
31436
+ }
31421
31437
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
31422
31438
  marginY: 1,
31423
- flexDirection: "column",
31424
31439
  children: [
31440
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31441
+ dimColor: true,
31442
+ children: "\u25CF "
31443
+ }, undefined, false, undefined, this),
31425
31444
  /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
31445
+ flexGrow: 1,
31426
31446
  children: [
31427
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31428
- dimColor: true,
31429
- children: "\u25CF "
31447
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Markdown, {
31448
+ content: message.content
31430
31449
  }, undefined, false, undefined, this),
31431
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
31432
- flexGrow: 1,
31433
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Markdown, {
31434
- content: message.content
31435
- }, undefined, false, undefined, this)
31436
- }, undefined, false, undefined, this)
31450
+ toolSummary && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31451
+ dimColor: true,
31452
+ children: [
31453
+ " ",
31454
+ toolSummary
31455
+ ]
31456
+ }, undefined, true, undefined, this)
31437
31457
  ]
31438
- }, undefined, true, undefined, this),
31439
- toolCount > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
31440
- marginLeft: 2,
31441
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
31442
- dimColor: true,
31443
- children: [
31444
- "[",
31445
- toolCount,
31446
- " tool",
31447
- toolCount > 1 ? "s" : "",
31448
- " used]"
31449
- ]
31450
- }, undefined, true, undefined, this)
31451
- }, undefined, false, undefined, this)
31458
+ }, undefined, true, undefined, this)
31452
31459
  ]
31453
31460
  }, undefined, true, undefined, this);
31454
31461
  }
31462
+ function getToolSummary(toolCalls) {
31463
+ if (toolCalls.length === 0)
31464
+ return "";
31465
+ const toolGroups = {};
31466
+ for (const tc of toolCalls) {
31467
+ const name = getToolDisplayName(tc);
31468
+ toolGroups[name] = (toolGroups[name] || 0) + 1;
31469
+ }
31470
+ const parts = [];
31471
+ for (const [name, count] of Object.entries(toolGroups)) {
31472
+ if (count > 1) {
31473
+ parts.push(`${name} \xD7${count}`);
31474
+ } else {
31475
+ parts.push(name);
31476
+ }
31477
+ }
31478
+ return `[${parts.join(", ")}]`;
31479
+ }
31480
+ function getToolDisplayName(toolCall) {
31481
+ const { name, input } = toolCall;
31482
+ switch (name) {
31483
+ case "bash":
31484
+ return "bash";
31485
+ case "curl":
31486
+ case "web_fetch":
31487
+ return "fetch";
31488
+ case "web_search":
31489
+ return "search";
31490
+ case "read":
31491
+ return "read";
31492
+ case "write":
31493
+ return "write";
31494
+ case "glob":
31495
+ return "glob";
31496
+ case "grep":
31497
+ return "grep";
31498
+ case "display_image":
31499
+ return "image";
31500
+ case "notion":
31501
+ case "gmail":
31502
+ case "googledrive":
31503
+ case "googlecalendar":
31504
+ case "linear":
31505
+ case "slack":
31506
+ return name;
31507
+ default:
31508
+ return name;
31509
+ }
31510
+ }
31455
31511
 
31456
31512
  // packages/terminal/src/components/Status.tsx
31457
31513
  var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
@@ -32129,7 +32185,7 @@ var options = {
32129
32185
  help: args.includes("--help") || args.includes("-h")
32130
32186
  };
32131
32187
  if (options.version) {
32132
- console.log("oldpal v0.3.0");
32188
+ console.log("oldpal v0.3.3");
32133
32189
  process.exit(0);
32134
32190
  }
32135
32191
  if (options.help) {
@@ -32160,4 +32216,4 @@ waitUntilExit().then(() => {
32160
32216
  process.exit(0);
32161
32217
  });
32162
32218
 
32163
- //# debugId=439BE8F926EBDCB864756E2164756E21
32219
+ //# debugId=2F63C3B99CA7C1AF64756E2164756E21