@invergent/agent-chat-react 2.16.0 → 2.16.1

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.cjs CHANGED
@@ -5516,7 +5516,11 @@ function cancelledToolLabel(toolName) {
5516
5516
  // Arbor research-mission tools (the /auto-research coordinator loop).
5517
5517
  idea_tree: "Idea tree",
5518
5518
  dispatch_experiments: "Dispatch experiments",
5519
- merge_experiment: "Merge experiment"
5519
+ merge_experiment: "Merge experiment",
5520
+ kb_search_pages: "Knowledge base search",
5521
+ kb_list_pages: "Knowledge base index",
5522
+ kb_read_page: "Knowledge base page",
5523
+ vision_analyze: "Image analysis"
5520
5524
  };
5521
5525
  if (map[toolName]) return map[toolName];
5522
5526
  if (toolName.startsWith("mcp__")) return formatMcpToolLabel(toolName);
@@ -5579,16 +5583,27 @@ function extractToolDetail(tc) {
5579
5583
  return code3 ? truncate3(code3.split("\n")[0] ?? "", 40) : null;
5580
5584
  }
5581
5585
  case "web_search":
5582
- case "web_crawl":
5586
+ case "session_search":
5583
5587
  return stringArg("query");
5588
+ // web_crawl takes a start ``url``, not a query.
5589
+ case "web_crawl":
5584
5590
  case "web_extract": {
5585
5591
  const url = stringArg("url");
5586
- if (!url) return null;
5587
- try {
5588
- return new URL(url).hostname.replace(/^www\./, "");
5589
- } catch {
5590
- return truncate3(url, 40);
5591
- }
5592
+ return url ? hostOf2(url) : null;
5593
+ }
5594
+ case "kb_search_pages": {
5595
+ const query = stringArg("query");
5596
+ return query ? truncate3(query, 60) : null;
5597
+ }
5598
+ case "kb_read_page": {
5599
+ const path = stringArg("path");
5600
+ if (!path) return null;
5601
+ const pages = stringArg("pages");
5602
+ return pages ? `${kbPageName(path)} \xB7 pages ${pages}` : kbPageName(path);
5603
+ }
5604
+ case "vision_analyze": {
5605
+ const image = stringArg("image");
5606
+ return image && !image.startsWith("data:") ? lastPathSegment(image) : null;
5592
5607
  }
5593
5608
  case "skill_view":
5594
5609
  case "skill_manage":
@@ -5621,14 +5636,7 @@ function extractToolDetail(tc) {
5621
5636
  const title = stringArg("title");
5622
5637
  if (title) return truncate3(title, 60);
5623
5638
  const url = stringArg("url");
5624
- if (url) {
5625
- try {
5626
- return new URL(url).hostname.replace(/^www\./, "");
5627
- } catch {
5628
- return truncate3(url, 40);
5629
- }
5630
- }
5631
- return null;
5639
+ return url ? hostOf2(url) : null;
5632
5640
  }
5633
5641
  if (action === "retrieve") {
5634
5642
  return stringArg("query");
@@ -5661,6 +5669,34 @@ function lastPathSegment(path) {
5661
5669
  function truncate3(s, max) {
5662
5670
  return s.length > max ? `${s.slice(0, max - 1)}\u2026` : s;
5663
5671
  }
5672
+ function hostOf2(url) {
5673
+ try {
5674
+ return new URL(url).hostname.replace(/^www\./, "") || truncate3(url, 40);
5675
+ } catch {
5676
+ return truncate3(url, 40);
5677
+ }
5678
+ }
5679
+ function kbPageName(path) {
5680
+ return lastPathSegment(path).replace(/\.(md|json)$/, "");
5681
+ }
5682
+ var _PLURAL_LABEL = {
5683
+ read_file: (n) => `Read ${n} files`,
5684
+ write_file: (n) => `Wrote ${n} files`,
5685
+ patch: (n) => `Edited ${n} files`,
5686
+ search_files: (n) => `Ran ${n} file searches`,
5687
+ terminal: (n) => `Ran ${n} commands`,
5688
+ web_search: (n) => `Ran ${n} web searches`,
5689
+ web_extract: (n) => `Fetched ${n} pages`,
5690
+ session_search: (n) => `Ran ${n} session searches`,
5691
+ kb_search_pages: (n) => `Ran ${n} knowledge base searches`,
5692
+ kb_read_page: (n) => `Read ${n} knowledge base pages`,
5693
+ vision_analyze: (n) => `Looked at ${n} images`,
5694
+ consult_expert: (n) => `Consulted ${n} experts`,
5695
+ delegate_task: (n) => `Delegated ${n} tasks`
5696
+ };
5697
+ function sameToolGroupLabel(toolName, count) {
5698
+ return _PLURAL_LABEL[toolName]?.(count) ?? `${cancelledToolLabel(toolName)} \xD7 ${count}`;
5699
+ }
5664
5700
  function toolRowLabel(tc) {
5665
5701
  const detail = extractToolDetail(tc);
5666
5702
  switch (tc.toolName) {
@@ -5684,7 +5720,22 @@ function toolRowLabel(tc) {
5684
5720
  case "web_search":
5685
5721
  return detail ? `Searched the web for "${detail}"` : "Searched the web";
5686
5722
  case "web_crawl":
5687
- return detail ? `Crawled "${detail}"` : "Crawled the web";
5723
+ return detail ? `Crawled ${detail}` : "Crawled a site";
5724
+ case "kb_search_pages": {
5725
+ if (!detail) return "Searched the knowledge base";
5726
+ return stringField(parseArgs(tc.args), "mode") === "documents" ? `Looked up document "${detail}"` : `Searched the knowledge base for "${detail}"`;
5727
+ }
5728
+ case "kb_list_pages":
5729
+ return "Browsed the knowledge base index";
5730
+ case "kb_read_page": {
5731
+ const args = parseArgs(tc.args);
5732
+ const path = stringField(args, "path");
5733
+ if (!path) return "Read a knowledge base page";
5734
+ const pages = stringField(args, "pages");
5735
+ return pages ? `Read ${kbPageName(path)}, pages ${pages}` : `Read ${kbPageName(path)}`;
5736
+ }
5737
+ case "vision_analyze":
5738
+ return detail ? `Looked at ${detail}` : "Looked at an image";
5688
5739
  case "web_extract":
5689
5740
  return detail ? `Fetched ${detail}` : "Fetched a page";
5690
5741
  case "session_search":
@@ -12475,8 +12526,7 @@ function deriveIterationLabel(message) {
12475
12526
  const firstName = calls[0].toolName;
12476
12527
  const allSame = calls.every((tc) => tc.toolName === firstName);
12477
12528
  if (allSame) {
12478
- const human = cancelledToolLabel(firstName);
12479
- return `${human} \xD7 ${calls.length}`;
12529
+ return sameToolGroupLabel(firstName, calls.length);
12480
12530
  }
12481
12531
  return `Used ${calls.length} tools`;
12482
12532
  }
@@ -12556,7 +12606,11 @@ var _TOOL_ROW_ICON = {
12556
12606
  research_memory: lucideReact.BookOpenIcon,
12557
12607
  research_outline: lucideReact.ListIcon,
12558
12608
  run_coding_agent: lucideReact.BotIcon,
12559
- code_run: lucideReact.BotIcon
12609
+ code_run: lucideReact.BotIcon,
12610
+ kb_search_pages: lucideReact.LibraryIcon,
12611
+ kb_list_pages: lucideReact.LibraryIcon,
12612
+ kb_read_page: lucideReact.LibraryIcon,
12613
+ vision_analyze: lucideReact.EyeIcon
12560
12614
  };
12561
12615
  function _toolRowIcon(toolName) {
12562
12616
  return _TOOL_ROW_ICON[toolName] ?? lucideReact.WrenchIcon;