@hasna/oldpal 0.3.3 → 0.3.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.
package/dist/index.js CHANGED
@@ -31462,21 +31462,48 @@ function MessageBubble({ message }) {
31462
31462
  function getToolSummary(toolCalls) {
31463
31463
  if (toolCalls.length === 0)
31464
31464
  return "";
31465
+ if (toolCalls.length === 1) {
31466
+ return `[${formatToolCall(toolCalls[0])}]`;
31467
+ }
31465
31468
  const toolGroups = {};
31466
31469
  for (const tc of toolCalls) {
31467
31470
  const name = getToolDisplayName(tc);
31468
- toolGroups[name] = (toolGroups[name] || 0) + 1;
31471
+ if (!toolGroups[name]) {
31472
+ toolGroups[name] = { count: 1, firstCall: tc };
31473
+ } else {
31474
+ toolGroups[name].count++;
31475
+ }
31469
31476
  }
31470
31477
  const parts = [];
31471
- for (const [name, count] of Object.entries(toolGroups)) {
31478
+ for (const [name, { count, firstCall }] of Object.entries(toolGroups)) {
31472
31479
  if (count > 1) {
31473
- parts.push(`${name} \xD7${count}`);
31480
+ const context = getToolContext(firstCall);
31481
+ parts.push(context ? `${name} \xD7${count} (${context}, ...)` : `${name} \xD7${count}`);
31474
31482
  } else {
31475
- parts.push(name);
31483
+ parts.push(formatToolCall(firstCall));
31476
31484
  }
31477
31485
  }
31478
31486
  return `[${parts.join(", ")}]`;
31479
31487
  }
31488
+ function getToolContext(toolCall) {
31489
+ const { name, input } = toolCall;
31490
+ switch (name) {
31491
+ case "bash":
31492
+ return truncate(String(input.command || ""), 20);
31493
+ case "read":
31494
+ const path = String(input.path || input.file_path || "");
31495
+ return path.split("/").pop() || "";
31496
+ case "write":
31497
+ const writePath = String(input.path || input.file_path || "");
31498
+ return writePath.split("/").pop() || "";
31499
+ case "glob":
31500
+ return truncate(String(input.pattern || ""), 20);
31501
+ case "grep":
31502
+ return truncate(String(input.pattern || ""), 20);
31503
+ default:
31504
+ return "";
31505
+ }
31506
+ }
31480
31507
  function getToolDisplayName(toolCall) {
31481
31508
  const { name, input } = toolCall;
31482
31509
  switch (name) {
@@ -31508,6 +31535,46 @@ function getToolDisplayName(toolCall) {
31508
31535
  return name;
31509
31536
  }
31510
31537
  }
31538
+ function formatToolCall(toolCall) {
31539
+ const { name, input } = toolCall;
31540
+ switch (name) {
31541
+ case "bash":
31542
+ return `Running: ${truncate(String(input.command || ""), 60)}`;
31543
+ case "curl":
31544
+ return `Fetching: ${truncate(String(input.url || ""), 60)}`;
31545
+ case "web_fetch":
31546
+ return `Fetching: ${truncate(String(input.url || ""), 60)}`;
31547
+ case "web_search":
31548
+ return `Searching: ${truncate(String(input.query || ""), 60)}`;
31549
+ case "read":
31550
+ return `Reading: ${truncate(String(input.path || input.file_path || ""), 60)}`;
31551
+ case "write":
31552
+ return `Writing: ${truncate(String(input.path || input.file_path || ""), 60)}`;
31553
+ case "glob":
31554
+ return `Finding: ${truncate(String(input.pattern || ""), 60)}`;
31555
+ case "grep":
31556
+ return `Searching: ${truncate(String(input.pattern || ""), 60)}`;
31557
+ case "notion":
31558
+ return `Notion: ${truncate(String(input.command || input.action || ""), 60)}`;
31559
+ case "gmail":
31560
+ return `Gmail: ${truncate(String(input.command || input.action || ""), 60)}`;
31561
+ case "googledrive":
31562
+ return `Drive: ${truncate(String(input.command || input.action || ""), 60)}`;
31563
+ case "googlecalendar":
31564
+ return `Calendar: ${truncate(String(input.command || input.action || ""), 60)}`;
31565
+ case "linear":
31566
+ return `Linear: ${truncate(String(input.command || input.action || ""), 60)}`;
31567
+ case "slack":
31568
+ return `Slack: ${truncate(String(input.command || input.action || ""), 60)}`;
31569
+ default:
31570
+ return `${name}: ${truncate(JSON.stringify(input), 50)}`;
31571
+ }
31572
+ }
31573
+ function truncate(text, maxLength) {
31574
+ if (text.length <= maxLength)
31575
+ return text;
31576
+ return text.slice(0, maxLength - 3) + "...";
31577
+ }
31511
31578
 
31512
31579
  // packages/terminal/src/components/Status.tsx
31513
31580
  var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
@@ -31524,41 +31591,17 @@ function Status({ isProcessing, cwd: cwd2, queueLength = 0, tokenUsage }) {
31524
31591
  }
31525
31592
  return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
31526
31593
  marginTop: 1,
31527
- borderStyle: "single",
31528
- borderColor: "gray",
31529
- paddingX: 1,
31530
- justifyContent: "space-between",
31531
- children: [
31532
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31533
- dimColor: true,
31534
- children: displayCwd
31535
- }, undefined, false, undefined, this),
31536
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
31537
- children: [
31538
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31539
- dimColor: !isProcessing,
31540
- children: isProcessing ? "\u25CF processing" : "\u25CF ready"
31541
- }, undefined, false, undefined, this),
31542
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31543
- dimColor: true,
31544
- children: tokenInfo
31545
- }, undefined, false, undefined, this),
31546
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31547
- dimColor: true,
31548
- children: queueInfo
31549
- }, undefined, false, undefined, this),
31550
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31551
- dimColor: true,
31552
- children: [
31553
- " | ",
31554
- isProcessing ? "Esc to stop" : "Ctrl+C to exit",
31555
- " | /help"
31556
- ]
31557
- }, undefined, true, undefined, this)
31558
- ]
31559
- }, undefined, true, undefined, this)
31560
- ]
31561
- }, undefined, true, undefined, this);
31594
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
31595
+ dimColor: true,
31596
+ children: [
31597
+ displayCwd,
31598
+ tokenInfo,
31599
+ queueInfo,
31600
+ isProcessing && " | Esc to stop",
31601
+ " | Ctrl+C to exit | /help"
31602
+ ]
31603
+ }, undefined, true, undefined, this)
31604
+ }, undefined, false, undefined, this);
31562
31605
  }
31563
31606
 
31564
31607
  // node_modules/.pnpm/ink-spinner@5.0.0_ink@5.2.1_@types+react@18.3.27_react-devtools-core@4.28.5_react@18.3.1__react@18.3.1/node_modules/ink-spinner/build/index.js
@@ -31751,46 +31794,46 @@ function ToolCallRow({ entry }) {
31751
31794
  }, undefined, true, undefined, this),
31752
31795
  /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
31753
31796
  dimColor: true,
31754
- children: formatToolCall(toolCall)
31797
+ children: formatToolCall2(toolCall)
31755
31798
  }, undefined, false, undefined, this)
31756
31799
  ]
31757
31800
  }, undefined, true, undefined, this);
31758
31801
  }
31759
- function formatToolCall(toolCall) {
31802
+ function formatToolCall2(toolCall) {
31760
31803
  const { name, input } = toolCall;
31761
31804
  switch (name) {
31762
31805
  case "bash":
31763
- return `bash: ${truncate(String(input.command || ""), 50)}`;
31806
+ return `bash: ${truncate2(String(input.command || ""), 50)}`;
31764
31807
  case "curl":
31765
31808
  case "web_fetch":
31766
- return `fetch: ${truncate(String(input.url || ""), 50)}`;
31809
+ return `fetch: ${truncate2(String(input.url || ""), 50)}`;
31767
31810
  case "web_search":
31768
- return `search: ${truncate(String(input.query || ""), 50)}`;
31811
+ return `search: ${truncate2(String(input.query || ""), 50)}`;
31769
31812
  case "read":
31770
- return `read: ${truncate(String(input.path || input.file_path || ""), 50)}`;
31813
+ return `read: ${truncate2(String(input.path || input.file_path || ""), 50)}`;
31771
31814
  case "write":
31772
- return `write: ${truncate(String(input.path || input.file_path || ""), 50)}`;
31815
+ return `write: ${truncate2(String(input.path || input.file_path || ""), 50)}`;
31773
31816
  case "glob":
31774
- return `glob: ${truncate(String(input.pattern || ""), 50)}`;
31817
+ return `glob: ${truncate2(String(input.pattern || ""), 50)}`;
31775
31818
  case "grep":
31776
- return `grep: ${truncate(String(input.pattern || ""), 50)}`;
31819
+ return `grep: ${truncate2(String(input.pattern || ""), 50)}`;
31777
31820
  case "notion":
31778
- return `notion: ${truncate(String(input.command || input.action || ""), 50)}`;
31821
+ return `notion: ${truncate2(String(input.command || input.action || ""), 50)}`;
31779
31822
  case "gmail":
31780
- return `gmail: ${truncate(String(input.command || input.action || ""), 50)}`;
31823
+ return `gmail: ${truncate2(String(input.command || input.action || ""), 50)}`;
31781
31824
  case "googledrive":
31782
- return `drive: ${truncate(String(input.command || input.action || ""), 50)}`;
31825
+ return `drive: ${truncate2(String(input.command || input.action || ""), 50)}`;
31783
31826
  case "googlecalendar":
31784
- return `calendar: ${truncate(String(input.command || input.action || ""), 50)}`;
31827
+ return `calendar: ${truncate2(String(input.command || input.action || ""), 50)}`;
31785
31828
  case "linear":
31786
- return `linear: ${truncate(String(input.command || input.action || ""), 50)}`;
31829
+ return `linear: ${truncate2(String(input.command || input.action || ""), 50)}`;
31787
31830
  case "slack":
31788
- return `slack: ${truncate(String(input.command || input.action || ""), 50)}`;
31831
+ return `slack: ${truncate2(String(input.command || input.action || ""), 50)}`;
31789
31832
  default:
31790
- return `${name}: ${truncate(JSON.stringify(input), 40)}`;
31833
+ return `${name}: ${truncate2(JSON.stringify(input), 40)}`;
31791
31834
  }
31792
31835
  }
31793
- function truncate(text, maxLength) {
31836
+ function truncate2(text, maxLength) {
31794
31837
  if (text.length <= maxLength)
31795
31838
  return text;
31796
31839
  return text.slice(0, maxLength - 3) + "...";
@@ -32185,7 +32228,7 @@ var options = {
32185
32228
  help: args.includes("--help") || args.includes("-h")
32186
32229
  };
32187
32230
  if (options.version) {
32188
- console.log("oldpal v0.3.3");
32231
+ console.log("oldpal v0.3.5");
32189
32232
  process.exit(0);
32190
32233
  }
32191
32234
  if (options.help) {
@@ -32216,4 +32259,4 @@ waitUntilExit().then(() => {
32216
32259
  process.exit(0);
32217
32260
  });
32218
32261
 
32219
- //# debugId=2F63C3B99CA7C1AF64756E2164756E21
32262
+ //# debugId=0403F5F696FDA15E64756E2164756E21