@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.js CHANGED
@@ -5255,7 +5255,11 @@ function cancelledToolLabel(toolName) {
5255
5255
  // Arbor research-mission tools (the /auto-research coordinator loop).
5256
5256
  idea_tree: "Idea tree",
5257
5257
  dispatch_experiments: "Dispatch experiments",
5258
- merge_experiment: "Merge experiment"
5258
+ merge_experiment: "Merge experiment",
5259
+ kb_search_pages: "Knowledge base search",
5260
+ kb_list_pages: "Knowledge base index",
5261
+ kb_read_page: "Knowledge base page",
5262
+ vision_analyze: "Image analysis"
5259
5263
  };
5260
5264
  if (map[toolName]) return map[toolName];
5261
5265
  if (toolName.startsWith("mcp__")) return formatMcpToolLabel(toolName);
@@ -5318,16 +5322,27 @@ function extractToolDetail(tc) {
5318
5322
  return code3 ? truncate3(code3.split("\n")[0] ?? "", 40) : null;
5319
5323
  }
5320
5324
  case "web_search":
5321
- case "web_crawl":
5325
+ case "session_search":
5322
5326
  return stringArg("query");
5327
+ // web_crawl takes a start ``url``, not a query.
5328
+ case "web_crawl":
5323
5329
  case "web_extract": {
5324
5330
  const url = stringArg("url");
5325
- if (!url) return null;
5326
- try {
5327
- return new URL(url).hostname.replace(/^www\./, "");
5328
- } catch {
5329
- return truncate3(url, 40);
5330
- }
5331
+ return url ? hostOf2(url) : null;
5332
+ }
5333
+ case "kb_search_pages": {
5334
+ const query = stringArg("query");
5335
+ return query ? truncate3(query, 60) : null;
5336
+ }
5337
+ case "kb_read_page": {
5338
+ const path = stringArg("path");
5339
+ if (!path) return null;
5340
+ const pages = stringArg("pages");
5341
+ return pages ? `${kbPageName(path)} \xB7 pages ${pages}` : kbPageName(path);
5342
+ }
5343
+ case "vision_analyze": {
5344
+ const image = stringArg("image");
5345
+ return image && !image.startsWith("data:") ? lastPathSegment(image) : null;
5331
5346
  }
5332
5347
  case "skill_view":
5333
5348
  case "skill_manage":
@@ -5360,14 +5375,7 @@ function extractToolDetail(tc) {
5360
5375
  const title = stringArg("title");
5361
5376
  if (title) return truncate3(title, 60);
5362
5377
  const url = stringArg("url");
5363
- if (url) {
5364
- try {
5365
- return new URL(url).hostname.replace(/^www\./, "");
5366
- } catch {
5367
- return truncate3(url, 40);
5368
- }
5369
- }
5370
- return null;
5378
+ return url ? hostOf2(url) : null;
5371
5379
  }
5372
5380
  if (action === "retrieve") {
5373
5381
  return stringArg("query");
@@ -5400,6 +5408,34 @@ function lastPathSegment(path) {
5400
5408
  function truncate3(s, max) {
5401
5409
  return s.length > max ? `${s.slice(0, max - 1)}\u2026` : s;
5402
5410
  }
5411
+ function hostOf2(url) {
5412
+ try {
5413
+ return new URL(url).hostname.replace(/^www\./, "") || truncate3(url, 40);
5414
+ } catch {
5415
+ return truncate3(url, 40);
5416
+ }
5417
+ }
5418
+ function kbPageName(path) {
5419
+ return lastPathSegment(path).replace(/\.(md|json)$/, "");
5420
+ }
5421
+ var _PLURAL_LABEL = {
5422
+ read_file: (n) => `Read ${n} files`,
5423
+ write_file: (n) => `Wrote ${n} files`,
5424
+ patch: (n) => `Edited ${n} files`,
5425
+ search_files: (n) => `Ran ${n} file searches`,
5426
+ terminal: (n) => `Ran ${n} commands`,
5427
+ web_search: (n) => `Ran ${n} web searches`,
5428
+ web_extract: (n) => `Fetched ${n} pages`,
5429
+ session_search: (n) => `Ran ${n} session searches`,
5430
+ kb_search_pages: (n) => `Ran ${n} knowledge base searches`,
5431
+ kb_read_page: (n) => `Read ${n} knowledge base pages`,
5432
+ vision_analyze: (n) => `Looked at ${n} images`,
5433
+ consult_expert: (n) => `Consulted ${n} experts`,
5434
+ delegate_task: (n) => `Delegated ${n} tasks`
5435
+ };
5436
+ function sameToolGroupLabel(toolName, count) {
5437
+ return _PLURAL_LABEL[toolName]?.(count) ?? `${cancelledToolLabel(toolName)} \xD7 ${count}`;
5438
+ }
5403
5439
  function toolRowLabel(tc) {
5404
5440
  const detail = extractToolDetail(tc);
5405
5441
  switch (tc.toolName) {
@@ -5423,7 +5459,22 @@ function toolRowLabel(tc) {
5423
5459
  case "web_search":
5424
5460
  return detail ? `Searched the web for "${detail}"` : "Searched the web";
5425
5461
  case "web_crawl":
5426
- return detail ? `Crawled "${detail}"` : "Crawled the web";
5462
+ return detail ? `Crawled ${detail}` : "Crawled a site";
5463
+ case "kb_search_pages": {
5464
+ if (!detail) return "Searched the knowledge base";
5465
+ return stringField(parseArgs(tc.args), "mode") === "documents" ? `Looked up document "${detail}"` : `Searched the knowledge base for "${detail}"`;
5466
+ }
5467
+ case "kb_list_pages":
5468
+ return "Browsed the knowledge base index";
5469
+ case "kb_read_page": {
5470
+ const args = parseArgs(tc.args);
5471
+ const path = stringField(args, "path");
5472
+ if (!path) return "Read a knowledge base page";
5473
+ const pages = stringField(args, "pages");
5474
+ return pages ? `Read ${kbPageName(path)}, pages ${pages}` : `Read ${kbPageName(path)}`;
5475
+ }
5476
+ case "vision_analyze":
5477
+ return detail ? `Looked at ${detail}` : "Looked at an image";
5427
5478
  case "web_extract":
5428
5479
  return detail ? `Fetched ${detail}` : "Fetched a page";
5429
5480
  case "session_search":
@@ -12156,8 +12207,7 @@ function deriveIterationLabel(message) {
12156
12207
  const firstName = calls[0].toolName;
12157
12208
  const allSame = calls.every((tc) => tc.toolName === firstName);
12158
12209
  if (allSame) {
12159
- const human = cancelledToolLabel(firstName);
12160
- return `${human} \xD7 ${calls.length}`;
12210
+ return sameToolGroupLabel(firstName, calls.length);
12161
12211
  }
12162
12212
  return `Used ${calls.length} tools`;
12163
12213
  }
@@ -12237,7 +12287,11 @@ var _TOOL_ROW_ICON = {
12237
12287
  research_memory: BookOpenIcon,
12238
12288
  research_outline: ListIcon,
12239
12289
  run_coding_agent: BotIcon,
12240
- code_run: BotIcon
12290
+ code_run: BotIcon,
12291
+ kb_search_pages: LibraryIcon,
12292
+ kb_list_pages: LibraryIcon,
12293
+ kb_read_page: LibraryIcon,
12294
+ vision_analyze: EyeIcon
12241
12295
  };
12242
12296
  function _toolRowIcon(toolName) {
12243
12297
  return _TOOL_ROW_ICON[toolName] ?? WrenchIcon;