@runtypelabs/persona 4.10.0 → 4.11.0

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 (61) hide show
  1. package/dist/animations/glyph-cycle.d.cts +1 -1
  2. package/dist/animations/glyph-cycle.d.ts +1 -1
  3. package/dist/animations/{types-4ROVJ1gA.d.cts → types-DveIaNx6.d.cts} +11 -316
  4. package/dist/animations/{types-4ROVJ1gA.d.ts → types-DveIaNx6.d.ts} +11 -316
  5. package/dist/animations/wipe.d.cts +1 -1
  6. package/dist/animations/wipe.d.ts +1 -1
  7. package/dist/chunk-MMUPR2JW.js +1 -0
  8. package/dist/codegen.cjs +1 -1
  9. package/dist/codegen.js +1 -1
  10. package/dist/{context-mentions-7S5KVUTG.js → context-mentions-ONG7A7M6.js} +1 -1
  11. package/dist/context-mentions.d.cts +35 -316
  12. package/dist/context-mentions.d.ts +35 -316
  13. package/dist/index.cjs +67 -67
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +40 -317
  16. package/dist/index.d.ts +40 -317
  17. package/dist/index.global.js +55 -55
  18. package/dist/index.global.js.map +1 -1
  19. package/dist/index.js +78 -78
  20. package/dist/index.js.map +1 -1
  21. package/dist/smart-dom-reader.d.cts +35 -316
  22. package/dist/smart-dom-reader.d.ts +35 -316
  23. package/dist/theme-editor-preview.cjs +66 -66
  24. package/dist/theme-editor-preview.d.cts +35 -316
  25. package/dist/theme-editor-preview.d.ts +35 -316
  26. package/dist/theme-editor-preview.js +55 -55
  27. package/dist/theme-editor.cjs +5 -5
  28. package/dist/theme-editor.d.cts +35 -316
  29. package/dist/theme-editor.d.ts +35 -316
  30. package/dist/theme-editor.js +9 -9
  31. package/dist/widget.css +1 -1
  32. package/package.json +1 -1
  33. package/src/components/approval-bubble.ts +0 -1
  34. package/src/components/composer-parts.ts +19 -19
  35. package/src/components/context-mention-button.test.ts +5 -1
  36. package/src/components/context-mention-button.ts +6 -4
  37. package/src/components/header-builder.test.ts +3 -3
  38. package/src/components/header-parts.ts +14 -108
  39. package/src/components/message-bubble.test.ts +49 -0
  40. package/src/components/message-bubble.ts +8 -7
  41. package/src/components/reasoning-bubble.ts +0 -2
  42. package/src/components/tool-bubble.ts +0 -2
  43. package/src/generated/runtype-openapi-contract.ts +11 -317
  44. package/src/index-core.ts +7 -1
  45. package/src/runtime/host-layout.test.ts +94 -0
  46. package/src/runtime/host-layout.ts +9 -1
  47. package/src/runtime/init.test.ts +33 -0
  48. package/src/runtime/init.ts +4 -0
  49. package/src/styles/widget.css +118 -58
  50. package/src/theme-editor/sections.test.ts +33 -0
  51. package/src/theme-editor/sections.ts +10 -1
  52. package/src/types.ts +25 -0
  53. package/src/ui.attachments-drop.test.ts +2 -1
  54. package/src/ui.message-width.test.ts +407 -0
  55. package/src/ui.mount-fill-min-width.test.ts +81 -0
  56. package/src/ui.ts +158 -238
  57. package/src/utils/table-scroll-fade.test.ts +123 -0
  58. package/src/utils/table-scroll-fade.ts +75 -0
  59. package/src/utils/tooltip.test.ts +226 -0
  60. package/src/utils/tooltip.ts +245 -0
  61. package/dist/chunk-IPVK3KOM.js +0 -1
@@ -1115,6 +1115,10 @@ type RuntypeExecutionStreamEvent = ({
1115
1115
  completedAt?: string;
1116
1116
  durationMs?: number;
1117
1117
  executionId: string;
1118
+ externalAgent?: {
1119
+ contextId?: string;
1120
+ taskId?: string;
1121
+ };
1118
1122
  failedSteps?: number;
1119
1123
  finalOutput?: string;
1120
1124
  iterations?: number;
@@ -1129,6 +1133,7 @@ type RuntypeExecutionStreamEvent = ({
1129
1133
  input: number;
1130
1134
  output: number;
1131
1135
  };
1136
+ totalTokensUsed?: number;
1132
1137
  type: "execution_complete";
1133
1138
  }) | ({
1134
1139
  blockReason?: string;
@@ -1388,12 +1393,17 @@ type RuntypeExecutionStreamEvent = ({
1388
1393
  stepId?: string;
1389
1394
  success: boolean;
1390
1395
  toolCallId: string;
1396
+ toolCost?: number;
1391
1397
  toolName?: string;
1392
1398
  type: "tool_complete";
1393
1399
  } | {
1394
1400
  approvalId: string;
1395
1401
  description?: string;
1396
1402
  executionId: string;
1403
+ externalAgent?: {
1404
+ contextId?: string;
1405
+ taskId?: string;
1406
+ };
1397
1407
  iteration?: number;
1398
1408
  parameters?: Record<string, unknown>;
1399
1409
  reason?: string;
@@ -1461,326 +1471,11 @@ type RuntypeExecutionStreamEvent = ({
1461
1471
  type: "custom";
1462
1472
  value?: unknown;
1463
1473
  };
1464
- type RuntypeFlowSSEEvent = {
1465
- executionContext?: Record<string, unknown>;
1466
- executionId?: string;
1467
- flowId: string;
1468
- flowName?: string;
1469
- input?: unknown;
1470
- seq?: number;
1471
- source?: string;
1472
- startedAt: string;
1473
- toolContext?: {
1474
- executionId: string;
1475
- stepId: string;
1476
- toolId: string;
1477
- };
1478
- totalSteps?: number;
1479
- type: "flow_start";
1480
- } | {
1481
- claudeManagedAgentId?: string;
1482
- completedAt?: string;
1483
- completedSteps?: number;
1484
- duration?: number;
1485
- executionContext?: Record<string, unknown>;
1486
- executionId?: string;
1487
- executionTime?: number;
1488
- failedSteps?: number;
1489
- finalOutput?: string;
1490
- flowId?: string;
1491
- flowName?: string;
1492
- output?: unknown;
1493
- seq?: number;
1494
- source?: string;
1495
- success?: boolean;
1496
- successfulSteps?: number;
1497
- toolContext?: {
1498
- executionId: string;
1499
- stepId: string;
1500
- toolId: string;
1501
- };
1502
- totalSteps?: number;
1503
- totalTokensUsed?: number;
1504
- type: "flow_complete";
1505
- } | ({
1506
- blockReason?: string;
1507
- code?: string;
1508
- error: string | {
1509
- code: string;
1510
- message: string;
1511
- stepId?: string;
1512
- stepType?: string;
1513
- };
1514
- executionId?: string;
1515
- executionTime?: number;
1516
- flowId?: string;
1517
- seq?: number;
1518
- timestamp?: string;
1519
- toolContext?: {
1520
- executionId: string;
1521
- stepId: string;
1522
- toolId: string;
1523
- };
1524
- type: "flow_error";
1525
- upgradeUrl?: string;
1526
- }) | ({
1527
- approvalId?: string;
1528
- awaitReason?: string;
1529
- awaitedAt: string;
1530
- crawlId?: string;
1531
- elicitation?: {
1532
- message: string;
1533
- mode: "form" | "url";
1534
- pauseCount?: number;
1535
- requestedSchema?: Record<string, unknown>;
1536
- serverName?: string;
1537
- url?: string;
1538
- };
1539
- executionId?: string;
1540
- flowId: string;
1541
- origin?: "webmcp" | "sdk";
1542
- pageOrigin?: string;
1543
- parameters?: Record<string, unknown>;
1544
- seq?: number;
1545
- stepId?: string;
1546
- timeout?: number;
1547
- toolCallId?: string;
1548
- toolId?: string;
1549
- toolName?: string;
1550
- type: "flow_await";
1551
- }) | {
1552
- estimatedTokens?: number;
1553
- executionId?: string;
1554
- id?: string;
1555
- index?: number;
1556
- name?: string;
1557
- outputVariable?: string;
1558
- seq?: number;
1559
- startedAt: string;
1560
- stepId?: string;
1561
- stepName?: string;
1562
- stepType?: string;
1563
- toolContext?: {
1564
- executionId: string;
1565
- stepId: string;
1566
- toolId: string;
1567
- };
1568
- totalSteps?: number;
1569
- type: "step_start";
1570
- } | {
1571
- delta?: string;
1572
- executionId?: string;
1573
- id?: string;
1574
- messageId?: string;
1575
- partId?: string;
1576
- seq?: number;
1577
- text?: string;
1578
- toolContext?: {
1579
- executionId: string;
1580
- stepId: string;
1581
- toolId: string;
1582
- };
1583
- toolId?: string;
1584
- type: "step_delta";
1585
- } | ({
1586
- completedAt?: string;
1587
- duration?: number;
1588
- durationMs?: number;
1589
- error?: string | null;
1590
- executionId?: string;
1591
- executionTime?: number;
1592
- id?: string;
1593
- index?: number;
1594
- name?: string;
1595
- output?: unknown;
1596
- result?: unknown;
1597
- seq?: number;
1598
- stepId?: string;
1599
- stepName?: string;
1600
- stepType?: string;
1601
- stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
1602
- success?: boolean;
1603
- tokensUsed?: number;
1604
- toolContext?: {
1605
- executionId: string;
1606
- stepId: string;
1607
- toolId: string;
1608
- };
1609
- type: "step_complete";
1610
- unresolvedVariables?: Array<string>;
1611
- }) | {
1612
- error: string;
1613
- executionId?: string;
1614
- executionTime?: number;
1615
- id?: string;
1616
- index?: number;
1617
- name?: string;
1618
- seq?: number;
1619
- stepType?: string;
1620
- type: "step_error";
1621
- } | {
1622
- error?: string;
1623
- executionId?: string;
1624
- id: string;
1625
- index?: number;
1626
- name?: string;
1627
- seq?: number;
1628
- skippedAt: string;
1629
- stepType: string;
1630
- totalSteps: number;
1631
- type: "step_skip";
1632
- when: string;
1633
- } | ({
1634
- elicitation?: {
1635
- message: string;
1636
- mode: "form" | "url";
1637
- pauseCount?: number;
1638
- requestedSchema?: Record<string, unknown>;
1639
- serverName?: string;
1640
- url?: string;
1641
- };
1642
- executionId?: string;
1643
- reason?: string;
1644
- seq?: number;
1645
- type: "step_await";
1646
- [key: string]: unknown;
1647
- }) | ({
1648
- agentContext?: {
1649
- executionId: string;
1650
- iteration: number;
1651
- seq: number;
1652
- };
1653
- executionId?: string;
1654
- hiddenParameterNames?: Array<string>;
1655
- name?: string;
1656
- parameters?: Record<string, unknown>;
1657
- providerOptions?: Record<string, unknown>;
1658
- seq?: number;
1659
- startedAt?: string;
1660
- stepId?: string;
1661
- toolCallId?: string;
1662
- toolId?: string;
1663
- toolName?: string;
1664
- toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
1665
- type: "tool_start";
1666
- [key: string]: unknown;
1667
- }) | {
1668
- delta?: string;
1669
- executionId?: string;
1670
- seq?: number;
1671
- toolId?: string;
1672
- type: "tool_delta";
1673
- [key: string]: unknown;
1674
- } | {
1675
- delta: string;
1676
- executionId?: string;
1677
- seq?: number;
1678
- stepId?: string;
1679
- toolCallId?: string;
1680
- toolId?: string;
1681
- type: "tool_input_delta";
1682
- } | {
1683
- executionId?: string;
1684
- hiddenParameterNames?: Array<string>;
1685
- parameters: Record<string, unknown>;
1686
- providerOptions?: Record<string, unknown>;
1687
- seq?: number;
1688
- stepId?: string;
1689
- toolCallId?: string;
1690
- toolId?: string;
1691
- toolName?: string;
1692
- type: "tool_input_complete";
1693
- } | {
1694
- agentContext?: {
1695
- executionId: string;
1696
- iteration: number;
1697
- seq: number;
1698
- };
1699
- completedAt?: string;
1700
- error?: string;
1701
- executionId?: string;
1702
- executionTime?: number;
1703
- name?: string;
1704
- result?: unknown;
1705
- seq?: number;
1706
- stepId?: string;
1707
- success: boolean;
1708
- toolCallId?: string;
1709
- toolCost?: number;
1710
- toolId?: string;
1711
- toolName?: string;
1712
- type: "tool_complete";
1713
- } | {
1714
- agentContext?: {
1715
- executionId: string;
1716
- iteration: number;
1717
- seq: number;
1718
- };
1719
- error: string;
1720
- executionId?: string;
1721
- executionTime?: number;
1722
- failedAt?: string;
1723
- name: string;
1724
- seq?: number;
1725
- toolId: string;
1726
- type: "tool_error";
1727
- } | {
1728
- executionId?: string;
1729
- id: string;
1730
- seq?: number;
1731
- text: string;
1732
- type: "chunk";
1733
- } | {
1734
- executionId?: string;
1735
- seq?: number;
1736
- type: "text_start";
1737
- [key: string]: unknown;
1738
- } | {
1739
- executionId?: string;
1740
- seq?: number;
1741
- type: "text_end";
1742
- [key: string]: unknown;
1743
- } | {
1744
- executionId?: string;
1745
- seq?: number;
1746
- type: "reason_start";
1747
- [key: string]: unknown;
1748
- } | {
1749
- executionId?: string;
1750
- seq?: number;
1751
- type: "reason_delta";
1752
- [key: string]: unknown;
1753
- } | {
1754
- executionId?: string;
1755
- seq?: number;
1756
- type: "reason_complete";
1757
- [key: string]: unknown;
1758
- } | {
1759
- executionId?: string;
1760
- seq?: number;
1761
- type: "source";
1762
- [key: string]: unknown;
1763
- } | {
1764
- executionId?: string;
1765
- seq?: number;
1766
- type: "fallback_start";
1767
- [key: string]: unknown;
1768
- } | {
1769
- executionId?: string;
1770
- seq?: number;
1771
- type: "fallback_complete";
1772
- [key: string]: unknown;
1773
- } | {
1774
- executionId?: string;
1775
- seq?: number;
1776
- type: "fallback_exhausted";
1777
- [key: string]: unknown;
1778
- };
1779
1474
  type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
1780
1475
  type: T;
1781
1476
  }>;
1782
1477
  type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "turn_complete">;
1783
- type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeFlowSSEEvent, "step_complete">;
1478
+ type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "step_complete">;
1784
1479
  type RuntypeStopReasonKind = NonNullable<RuntypeTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
1785
1480
 
1786
1481
  /**
@@ -5401,6 +5096,26 @@ type AgentWidgetTimestampConfig = {
5401
5096
  /** Custom formatter for timestamp display */
5402
5097
  format?: (date: Date) => string;
5403
5098
  };
5099
+ /**
5100
+ * Width configuration for one message role.
5101
+ *
5102
+ * `content` shrink-wraps the rendered message up to `maxWidth`; `full` fills
5103
+ * the available transcript track up to `maxWidth`. The track already accounts
5104
+ * for transcript padding and, when present, the avatar and its gap.
5105
+ */
5106
+ type AgentWidgetMessageRoleLayout = {
5107
+ /**
5108
+ * Message width behavior.
5109
+ * - content: size to the rendered content (the backward-compatible default)
5110
+ * - full: fill the available transcript track
5111
+ */
5112
+ width?: "content" | "full";
5113
+ /**
5114
+ * Optional CSS max-width (for example "80%", "42rem", or "72ch").
5115
+ * Defaults to "85%" for content width and "100%" for full width.
5116
+ */
5117
+ maxWidth?: string;
5118
+ };
5404
5119
  /**
5405
5120
  * Message layout configuration
5406
5121
  * Allows customization of how chat messages are displayed
@@ -5419,6 +5134,10 @@ type AgentWidgetMessageLayoutConfig = {
5419
5134
  timestamp?: AgentWidgetTimestampConfig;
5420
5135
  /** Group consecutive messages from the same role */
5421
5136
  groupConsecutive?: boolean;
5137
+ /** Width behavior for user-authored message rows */
5138
+ user?: AgentWidgetMessageRoleLayout;
5139
+ /** Width behavior for assistant-authored message rows and assistant UI variants */
5140
+ assistant?: AgentWidgetMessageRoleLayout;
5422
5141
  /**
5423
5142
  * Custom renderer for user messages
5424
5143
  * When provided, replaces the default user message rendering