@tangle-network/agent-app 0.42.3 → 0.42.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.
Files changed (47) hide show
  1. package/dist/InvitationsPanel-ZKAUYZYU.js +8 -0
  2. package/dist/InviteAcceptPage-P3QJC3C6.js +7 -0
  3. package/dist/{MembersPanel-4CGUQRPF.js → MembersPanel-FOVHWUQ3.js} +2 -2
  4. package/dist/MembersPanel-FOVHWUQ3.js.map +1 -0
  5. package/dist/{access-ChAHG4Tp.d.ts → access-BZ81Btt5.d.ts} +1 -1
  6. package/dist/chunk-F7D7YCUL.js +206 -0
  7. package/dist/chunk-F7D7YCUL.js.map +1 -0
  8. package/dist/{chunk-WOVCWPFF.js → chunk-FJUOBNIY.js} +1 -1
  9. package/dist/{chunk-3G334FVA.js → chunk-GNL3MG5J.js} +4 -3
  10. package/dist/chunk-GNL3MG5J.js.map +1 -0
  11. package/dist/chunk-SWUVTGMR.js +262 -0
  12. package/dist/chunk-SWUVTGMR.js.map +1 -0
  13. package/dist/{chunk-535V6BH6.js → chunk-VCPZ3HTN.js} +44 -4
  14. package/dist/chunk-VCPZ3HTN.js.map +1 -0
  15. package/dist/chunk-WEBBJBDH.js +58 -0
  16. package/dist/chunk-WEBBJBDH.js.map +1 -0
  17. package/dist/design-canvas-react/index.js +1 -1
  18. package/dist/design-canvas-react/lazy.js +1 -1
  19. package/dist/invitations-CZ5G2tIn.d.ts +56 -0
  20. package/dist/invitations-schema-DaMO4hZE.d.ts +280 -0
  21. package/dist/{roles-CLtYKHHl.d.ts → roles-BC1n4t37.d.ts} +1 -1
  22. package/dist/teams/drizzle.d.ts +4 -3
  23. package/dist/teams/drizzle.js +31 -1
  24. package/dist/teams/drizzle.js.map +1 -1
  25. package/dist/teams/index.d.ts +2 -1
  26. package/dist/teams/index.js +16 -0
  27. package/dist/teams/invitations-api.d.ts +169 -0
  28. package/dist/teams/invitations-api.js +338 -0
  29. package/dist/teams/invitations-api.js.map +1 -0
  30. package/dist/teams/members-api.d.ts +2 -2
  31. package/dist/teams/members-api.js +5 -255
  32. package/dist/teams/members-api.js.map +1 -1
  33. package/dist/teams-react/index.d.ts +66 -7
  34. package/dist/teams-react/index.js +6 -2
  35. package/dist/teams-react/lazy.d.ts +6 -4
  36. package/dist/teams-react/lazy.js +6 -2
  37. package/dist/teams-react/lazy.js.map +1 -1
  38. package/dist/web-react/index.d.ts +17 -1
  39. package/dist/web-react/index.js +101 -19
  40. package/dist/web-react/index.js.map +1 -1
  41. package/package.json +6 -1
  42. package/dist/InviteAcceptPage-EUOGZO2X.js +0 -7
  43. package/dist/chunk-3G334FVA.js.map +0 -1
  44. package/dist/chunk-535V6BH6.js.map +0 -1
  45. /package/dist/{InviteAcceptPage-EUOGZO2X.js.map → InvitationsPanel-ZKAUYZYU.js.map} +0 -0
  46. /package/dist/{MembersPanel-4CGUQRPF.js.map → InviteAcceptPage-P3QJC3C6.js.map} +0 -0
  47. /package/dist/{chunk-WOVCWPFF.js.map → chunk-FJUOBNIY.js.map} +0 -0
@@ -1444,6 +1444,73 @@ function ToolCallCard({
1444
1444
  }
1445
1445
  );
1446
1446
  }
1447
+ function StreamingCaret() {
1448
+ return /* @__PURE__ */ jsx7(
1449
+ "span",
1450
+ {
1451
+ className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-pulse rounded-sm bg-foreground/70",
1452
+ "aria-hidden": true
1453
+ }
1454
+ );
1455
+ }
1456
+ function SegmentText({
1457
+ content,
1458
+ streaming,
1459
+ showCaret,
1460
+ renderBody
1461
+ }) {
1462
+ const text = useSmoothText(content, streaming);
1463
+ const body = useMemo3(() => renderBody(text), [renderBody, text]);
1464
+ if (!content.trim() && !showCaret) return null;
1465
+ return /* @__PURE__ */ jsxs7("div", { className: "text-base leading-[1.75]", children: [
1466
+ body,
1467
+ showCaret && /* @__PURE__ */ jsx7(StreamingCaret, {})
1468
+ ] });
1469
+ }
1470
+ function SegmentedBody({
1471
+ segments,
1472
+ msg,
1473
+ streaming,
1474
+ renderBody,
1475
+ approval,
1476
+ onToolCallClick,
1477
+ toolRenderers
1478
+ }) {
1479
+ const lastIndex = segments.length - 1;
1480
+ const segmentToolIds = new Set(
1481
+ segments.flatMap((s) => s.kind === "tool" ? [s.call.id] : [])
1482
+ );
1483
+ const leftoverToolCalls = (msg.toolCalls ?? []).filter(
1484
+ (tc) => !segmentToolIds.has(tc.id)
1485
+ );
1486
+ const renderToolCard = (call) => /* @__PURE__ */ jsx7(
1487
+ ToolCallCard,
1488
+ {
1489
+ call,
1490
+ message: msg,
1491
+ approval,
1492
+ onOpenRun: onToolCallClick,
1493
+ renderers: toolRenderers
1494
+ },
1495
+ `tool-${call.id}`
1496
+ );
1497
+ return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
1498
+ segments.map(
1499
+ (seg, i) => seg.kind === "text" ? /* @__PURE__ */ jsx7(
1500
+ SegmentText,
1501
+ {
1502
+ content: seg.content,
1503
+ streaming: streaming && i === lastIndex,
1504
+ showCaret: streaming && i === lastIndex,
1505
+ renderBody
1506
+ },
1507
+ `text-${i}`
1508
+ ) : renderToolCard(seg.call)
1509
+ ),
1510
+ leftoverToolCalls.map(renderToolCard),
1511
+ streaming && segments[lastIndex]?.kind === "tool" && /* @__PURE__ */ jsx7(StreamingCaret, {})
1512
+ ] });
1513
+ }
1447
1514
  function AssistantMessageImpl({
1448
1515
  msg,
1449
1516
  streaming,
@@ -1458,19 +1525,21 @@ function AssistantMessageImpl({
1458
1525
  const content = useSmoothText(msg.content, streaming);
1459
1526
  const reasoning = useSmoothText(msg.reasoning ?? "", streaming);
1460
1527
  const body = useMemo3(() => renderBody(content), [renderBody, content]);
1528
+ const segments = msg.segments;
1529
+ const hasAnswerText = content !== "" || (segments?.some((s) => s.kind === "text" && s.content.trim() !== "") ?? false);
1461
1530
  const reasoningScrollRef = useRef4(null);
1462
1531
  const thinkStartRef = useRef4(null);
1463
1532
  const thinkMsRef = useRef4(null);
1464
- if (streaming && reasoning && !content && thinkStartRef.current === null) {
1533
+ if (streaming && reasoning && !hasAnswerText && thinkStartRef.current === null) {
1465
1534
  thinkStartRef.current = performance.now();
1466
1535
  }
1467
- if (content && thinkStartRef.current !== null && thinkMsRef.current === null) {
1536
+ if (hasAnswerText && thinkStartRef.current !== null && thinkMsRef.current === null) {
1468
1537
  thinkMsRef.current = performance.now() - thinkStartRef.current;
1469
1538
  }
1470
1539
  useEffect5(() => {
1471
1540
  const el = reasoningScrollRef.current;
1472
- if (el && streaming && !content) el.scrollTop = el.scrollHeight;
1473
- }, [reasoning, streaming, content]);
1541
+ if (el && streaming && !hasAnswerText) el.scrollTop = el.scrollHeight;
1542
+ }, [reasoning, streaming, hasAnswerText]);
1474
1543
  return /* @__PURE__ */ jsxs7("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
1475
1544
  /* @__PURE__ */ jsxs7("div", { className: "mb-1 flex items-baseline gap-2 text-[11px] tracking-wide text-muted-foreground", children: [
1476
1545
  /* @__PURE__ */ jsx7("span", { className: "font-semibold uppercase", children: agentLabel }),
@@ -1478,25 +1547,38 @@ function AssistantMessageImpl({
1478
1547
  formatTokensPerSecond(msg) && /* @__PURE__ */ jsx7("span", { children: formatTokensPerSecond(msg) }),
1479
1548
  formatModelCost(msg, models) && /* @__PURE__ */ jsx7("span", { children: formatModelCost(msg, models) })
1480
1549
  ] }),
1481
- reasoning && /* @__PURE__ */ jsxs7("details", { className: "mb-2 rounded-lg border-l-2 border-border/70 bg-muted/20 px-3 py-2", open: !content, children: [
1482
- /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer select-none text-xs font-medium text-muted-foreground", children: !content ? /* @__PURE__ */ jsx7("span", { className: "animate-pulse", children: "Thinking\u2026" }) : thinkMsRef.current != null ? `Thought for ${Math.max(1, Math.round(thinkMsRef.current / 1e3))}s` : "Thought process" }),
1550
+ reasoning && /* @__PURE__ */ jsxs7("details", { className: "mb-2 rounded-lg border-l-2 border-border/70 bg-muted/20 px-3 py-2", open: !hasAnswerText, children: [
1551
+ /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer select-none text-xs font-medium text-muted-foreground", children: !hasAnswerText ? /* @__PURE__ */ jsx7("span", { className: "animate-pulse", children: "Thinking\u2026" }) : thinkMsRef.current != null ? `Thought for ${Math.max(1, Math.round(thinkMsRef.current / 1e3))}s` : "Thought process" }),
1483
1552
  /* @__PURE__ */ jsx7("div", { ref: reasoningScrollRef, className: "mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground", children: reasoning })
1484
1553
  ] }),
1485
- /* @__PURE__ */ jsxs7("div", { className: "text-base leading-[1.75]", children: [
1486
- body,
1487
- streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx7("span", { className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-pulse rounded-sm bg-foreground/70", "aria-hidden": true })
1488
- ] }),
1489
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx7("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc) => /* @__PURE__ */ jsx7(
1490
- ToolCallCard,
1554
+ segments && segments.length > 0 ? /* @__PURE__ */ jsx7(
1555
+ SegmentedBody,
1491
1556
  {
1492
- call: tc,
1493
- message: msg,
1557
+ segments,
1558
+ msg,
1559
+ streaming,
1560
+ renderBody,
1494
1561
  approval,
1495
- onOpenRun: onToolCallClick,
1496
- renderers: toolRenderers
1497
- },
1498
- tc.id
1499
- )) }),
1562
+ onToolCallClick,
1563
+ toolRenderers
1564
+ }
1565
+ ) : /* @__PURE__ */ jsxs7(Fragment4, { children: [
1566
+ /* @__PURE__ */ jsxs7("div", { className: "text-base leading-[1.75]", children: [
1567
+ body,
1568
+ streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx7(StreamingCaret, {})
1569
+ ] }),
1570
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx7("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc) => /* @__PURE__ */ jsx7(
1571
+ ToolCallCard,
1572
+ {
1573
+ call: tc,
1574
+ message: msg,
1575
+ approval,
1576
+ onOpenRun: onToolCallClick,
1577
+ renderers: toolRenderers
1578
+ },
1579
+ tc.id
1580
+ )) })
1581
+ ] }),
1500
1582
  renderExtras?.(msg)
1501
1583
  ] });
1502
1584
  }