@locusgraph/loop 0.1.0 → 0.2.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 (115) hide show
  1. package/README.md +2 -0
  2. package/dist/agent/pulse/gradient-label.js +86 -15
  3. package/dist/agent/pulse/marks/bars-mark.js +46 -10
  4. package/dist/agent/pulse/marks/glyph-mark.js +56 -11
  5. package/dist/agent/pulse/marks/locus-mark.js +63 -28
  6. package/dist/agent/pulse/marks/orb-mark.js +31 -8
  7. package/dist/agent/pulse/marks/spinner-mark.js +29 -1
  8. package/dist/agent/pulse/pulse.js +150 -35
  9. package/dist/agent/pulse/use-loop-animation.js +36 -17
  10. package/dist/agent/steps/step-icon.js +110 -24
  11. package/dist/agent/steps/steps.js +235 -25
  12. package/dist/agent/thinking/thinking.js +203 -23
  13. package/dist/agent/thinking/thought-duration.js +7 -9
  14. package/dist/agent/tool/json-block.js +38 -11
  15. package/dist/agent/tool/tool-status.js +51 -18
  16. package/dist/agent/tool/tool.js +184 -6
  17. package/dist/approval/inbox/inbox-row.d.ts +3 -2
  18. package/dist/approval/inbox/inbox-row.js +321 -7
  19. package/dist/approval/inbox/inbox-selection.js +7 -13
  20. package/dist/approval/inbox/inbox.d.ts +2 -1
  21. package/dist/approval/inbox/inbox.js +250 -18
  22. package/dist/approval/inbox/virtual-inbox-list.d.ts +13 -0
  23. package/dist/approval/inbox/virtual-inbox-list.js +129 -0
  24. package/dist/approval/memory/memory-choices.js +27 -22
  25. package/dist/approval/memory/memory-review.js +242 -17
  26. package/dist/approval/memory/memory-row.js +215 -19
  27. package/dist/approval/plan/plan-review.js +279 -28
  28. package/dist/approval/plan/plan-step-row.js +194 -43
  29. package/dist/approval/plan/plan-steps.js +24 -23
  30. package/dist/approval/plan/question-choices.js +158 -39
  31. package/dist/approval/plan/question.d.ts +1 -1
  32. package/dist/approval/plan/question.js +223 -26
  33. package/dist/approval/run/run-bar.js +178 -22
  34. package/dist/approval/shared/decision-line.js +1 -1
  35. package/dist/approval/shared/risk-badge.js +47 -16
  36. package/dist/approval/shared/time.js +5 -8
  37. package/dist/approval/shared/use-focus-on-mount.js +23 -6
  38. package/dist/approval/spend/raise-cap-form.js +235 -17
  39. package/dist/approval/spend/spend-gate.js +239 -21
  40. package/dist/approval/spend/spend-math.js +7 -8
  41. package/dist/approval/spend/spend-meter.js +362 -34
  42. package/dist/approval/tool/approval.js +272 -27
  43. package/dist/approval/tool/args/args-editor.js +262 -26
  44. package/dist/approval/tool/args/args-field.js +259 -19
  45. package/dist/approval/tool/args/args-validation.js +38 -47
  46. package/dist/approval/tool/deny-form.js +130 -10
  47. package/dist/approval/tool/tool-inputs.js +127 -38
  48. package/dist/chat/chat/chat-item-spacing.d.ts +3 -0
  49. package/dist/chat/chat/chat-item-spacing.js +19 -0
  50. package/dist/chat/chat/chat.d.ts +2 -1
  51. package/dist/chat/chat/chat.js +181 -5
  52. package/dist/chat/chat/use-stick-to-bottom.js +123 -47
  53. package/dist/chat/chat/virtual-chat-items.d.ts +8 -0
  54. package/dist/chat/chat/virtual-chat-items.js +153 -0
  55. package/dist/chat/composer/composer-actions.js +151 -16
  56. package/dist/chat/composer/composer.js +330 -32
  57. package/dist/chat/composer/use-auto-grow.js +24 -9
  58. package/dist/chat/files/file-meta.js +19 -19
  59. package/dist/chat/files/files.js +316 -28
  60. package/dist/chat/reply/fenced-code.js +45 -21
  61. package/dist/chat/reply/markdown-components.js +137 -17
  62. package/dist/chat/reply/reply.js +105 -10
  63. package/dist/chat/turn/group-parts.js +43 -29
  64. package/dist/chat/turn/turn.js +238 -30
  65. package/dist/cost/context.js +321 -23
  66. package/dist/cost/cost-steps.js +220 -14
  67. package/dist/cost/cost.js +521 -27
  68. package/dist/cost/model-picker.js +181 -6
  69. package/dist/cost/shared/context-breakdown.js +299 -10
  70. package/dist/cost/shared/meter-marks.js +107 -9
  71. package/dist/cost/shared/model-option-row.js +178 -21
  72. package/dist/cost/shared/step-cost-row.js +248 -20
  73. package/dist/cost/shared/usage-totals.js +22 -18
  74. package/dist/memory/cite.js +182 -11
  75. package/dist/memory/memorized.js +217 -11
  76. package/dist/memory/recall.js +296 -17
  77. package/dist/memory/shared/host-label.js +19 -22
  78. package/dist/memory/shared/source-mark.js +39 -3
  79. package/dist/memory/sources.js +255 -13
  80. package/dist/shared/decision-summary.js +133 -14
  81. package/dist/shared/panel-empty.js +78 -3
  82. package/dist/shared/panel.js +243 -13
  83. package/dist/shared/status-dot.js +38 -8
  84. package/dist/shared/virtual/use-list-virtualizer.d.ts +24 -0
  85. package/dist/shared/virtual/use-list-virtualizer.js +68 -0
  86. package/dist/thread/actions/action-button.js +65 -3
  87. package/dist/thread/actions/actions.js +184 -13
  88. package/dist/thread/actions/branch-switcher.js +102 -5
  89. package/dist/thread/canvas/canvas.js +205 -5
  90. package/dist/thread/canvas/version-switcher.js +149 -8
  91. package/dist/thread/code/code.js +186 -24
  92. package/dist/thread/code/copy-code-button.js +61 -13
  93. package/dist/thread/code/highlight.js +30 -29
  94. package/dist/thread/history/history-rows.d.ts +16 -0
  95. package/dist/thread/history/history-rows.js +23 -0
  96. package/dist/thread/history/history.d.ts +3 -2
  97. package/dist/thread/history/history.js +174 -5
  98. package/dist/thread/history/{history-row.d.ts → row/history-row.d.ts} +3 -2
  99. package/dist/thread/history/row/history-row.js +137 -0
  100. package/dist/thread/history/row/thread-item-menu.js +84 -0
  101. package/dist/thread/history/row/thread-title-editor.js +81 -0
  102. package/dist/thread/history/thread-groups.d.ts +1 -1
  103. package/dist/thread/history/thread-groups.js +40 -34
  104. package/dist/thread/history/virtual-history-list.d.ts +11 -0
  105. package/dist/thread/history/virtual-history-list.js +107 -0
  106. package/dist/thread/index.d.ts +1 -1
  107. package/dist/thread/starters/starters.js +92 -7
  108. package/dist/thread/use-copied.js +45 -15
  109. package/dist/types.js +1 -1
  110. package/package.json +6 -4
  111. package/dist/thread/history/history-row.js +0 -17
  112. package/dist/thread/history/thread-item-menu.js +0 -6
  113. package/dist/thread/history/thread-title-editor.js +0 -25
  114. /package/dist/thread/history/{thread-item-menu.d.ts → row/thread-item-menu.d.ts} +0 -0
  115. /package/dist/thread/history/{thread-title-editor.d.ts → row/thread-title-editor.d.ts} +0 -0
@@ -1,21 +1,116 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "@locusgraph/components";
3
3
  import { memo } from "react";
4
4
  import ReactMarkdown from "react-markdown";
5
5
  import remarkGfm from "remark-gfm";
6
6
  import { markdownComponents } from "./markdown-components.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
7
8
  const codeFence = /^ {0,3}(```|~~~)/gm;
8
9
  export function closeOpenCodeFence(markdown) {
9
- const fences = markdown.match(codeFence) ?? [];
10
- const lastFence = fences.at(-1)?.trim().slice(0, 3);
11
- return fences.length % 2 === 1 ? `${markdown}\n${lastFence}` : markdown;
10
+ const fences = markdown.match(codeFence) ?? [];
11
+ const lastFence = fences.at(-1)?.trim().slice(0, 3);
12
+ return fences.length % 2 === 1 ? `${markdown}\n${lastFence}` : markdown;
12
13
  }
13
- const Markdown = memo(function Markdown({ markdown }) {
14
- return (_jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components: markdownComponents, children: markdown }));
14
+ const Markdown = memo(function Markdown(t0) {
15
+ const $ = _c(3);
16
+ const {
17
+ markdown
18
+ } = t0;
19
+ let t1;
20
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21
+ t1 = [remarkGfm];
22
+ $[0] = t1;
23
+ } else {
24
+ t1 = $[0];
25
+ }
26
+ let t2;
27
+ if ($[1] !== markdown) {
28
+ t2 = /*#__PURE__*/_jsx(ReactMarkdown, {
29
+ remarkPlugins: t1,
30
+ components: markdownComponents,
31
+ children: markdown
32
+ });
33
+ $[1] = markdown;
34
+ $[2] = t2;
35
+ } else {
36
+ t2 = $[2];
37
+ }
38
+ return t2;
15
39
  });
16
40
  const streamingCaret = "data-[state=streaming]:[&>:last-child]:after:ml-0.5 data-[state=streaming]:[&>:last-child]:after:inline-block data-[state=streaming]:[&>:last-child]:after:h-[1em] data-[state=streaming]:[&>:last-child]:after:w-[0.5ch] data-[state=streaming]:[&>:last-child]:after:translate-y-[0.15em] data-[state=streaming]:[&>:last-child]:after:bg-foreground/70 data-[state=streaming]:[&>:last-child]:after:content-[''] motion-safe:data-[state=streaming]:[&>:last-child]:after:animate-pulse";
17
- export function Reply({ children, state = "done", className, ...props }) {
18
- const isStreaming = state === "streaming";
19
- const markdown = isStreaming ? closeOpenCodeFence(children) : children;
20
- return (_jsx("div", { "data-slot": "reply", "data-state": state, "aria-live": isStreaming ? "polite" : undefined, className: cn("min-w-0 text-sm leading-relaxed wrap-break-word text-foreground", streamingCaret, className), ...props, children: _jsx(Markdown, { markdown: markdown }) }));
41
+ export function Reply(t0) {
42
+ const $ = _c(18);
43
+ let children;
44
+ let className;
45
+ let props;
46
+ let t1;
47
+ if ($[0] !== t0) {
48
+ ({
49
+ children,
50
+ state: t1,
51
+ className,
52
+ ...props
53
+ } = t0);
54
+ $[0] = t0;
55
+ $[1] = children;
56
+ $[2] = className;
57
+ $[3] = props;
58
+ $[4] = t1;
59
+ } else {
60
+ children = $[1];
61
+ className = $[2];
62
+ props = $[3];
63
+ t1 = $[4];
64
+ }
65
+ const state = t1 === undefined ? "done" : t1;
66
+ const isStreaming = state === "streaming";
67
+ let t2;
68
+ if ($[5] !== children || $[6] !== isStreaming) {
69
+ t2 = isStreaming ? closeOpenCodeFence(children) : children;
70
+ $[5] = children;
71
+ $[6] = isStreaming;
72
+ $[7] = t2;
73
+ } else {
74
+ t2 = $[7];
75
+ }
76
+ const markdown = t2;
77
+ const t3 = isStreaming ? "polite" : undefined;
78
+ let t4;
79
+ if ($[8] !== className) {
80
+ t4 = cn("min-w-0 text-sm leading-relaxed wrap-break-word text-foreground", streamingCaret, className);
81
+ $[8] = className;
82
+ $[9] = t4;
83
+ } else {
84
+ t4 = $[9];
85
+ }
86
+ let t5;
87
+ if ($[10] !== markdown) {
88
+ t5 = /*#__PURE__*/_jsx(Markdown, {
89
+ markdown: markdown
90
+ });
91
+ $[10] = markdown;
92
+ $[11] = t5;
93
+ } else {
94
+ t5 = $[11];
95
+ }
96
+ let t6;
97
+ if ($[12] !== props || $[13] !== state || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
98
+ t6 = /*#__PURE__*/_jsx("div", {
99
+ "data-slot": "reply",
100
+ "data-state": state,
101
+ "aria-live": t3,
102
+ className: t4,
103
+ ...props,
104
+ children: t5
105
+ });
106
+ $[12] = props;
107
+ $[13] = state;
108
+ $[14] = t3;
109
+ $[15] = t4;
110
+ $[16] = t5;
111
+ $[17] = t6;
112
+ } else {
113
+ t6 = $[17];
114
+ }
115
+ return t6;
21
116
  }
@@ -1,35 +1,49 @@
1
1
  export function isToolPart(part) {
2
- return part.type === "dynamic-tool" || part.type.startsWith("tool-");
2
+ return part.type === "dynamic-tool" || part.type.startsWith("tool-");
3
3
  }
4
4
  function appendToRun(segments, kind, part, key) {
5
- const previous = segments.at(-1);
6
- if (previous?.kind === kind) {
7
- previous.parts.push(part);
8
- return;
9
- }
10
- segments.push(kind === "files"
11
- ? { kind, key, parts: [part] }
12
- : { kind, key, parts: [part] });
5
+ const previous = segments.at(-1);
6
+ if (previous?.kind === kind) {
7
+ previous.parts.push(part);
8
+ return;
9
+ }
10
+ segments.push(kind === "files" ? {
11
+ kind,
12
+ key,
13
+ parts: [part]
14
+ } : {
15
+ kind,
16
+ key,
17
+ parts: [part]
18
+ });
13
19
  }
14
20
  export function groupParts(parts) {
15
- const segments = [];
16
- parts.forEach((part, index) => {
17
- const key = `${part.type}:${index}`;
18
- if (part.type === "text") {
19
- segments.push({ kind: "text", key, part });
20
- }
21
- else if (part.type === "reasoning") {
22
- segments.push({ kind: "reasoning", key, part });
23
- }
24
- else if (part.type === "file") {
25
- appendToRun(segments, "files", part, key);
26
- }
27
- else if (part.type === "source-url") {
28
- appendToRun(segments, "sources", part, key);
29
- }
30
- else if (isToolPart(part)) {
31
- segments.push({ kind: "tool", key: part.toolCallId, part });
32
- }
33
- });
34
- return segments;
21
+ const segments = [];
22
+ parts.forEach((part, index) => {
23
+ const key = `${part.type}:${index}`;
24
+ if (part.type === "text") {
25
+ segments.push({
26
+ kind: "text",
27
+ key,
28
+ part
29
+ });
30
+ } else if (part.type === "reasoning") {
31
+ segments.push({
32
+ kind: "reasoning",
33
+ key,
34
+ part
35
+ });
36
+ } else if (part.type === "file") {
37
+ appendToRun(segments, "files", part, key);
38
+ } else if (part.type === "source-url") {
39
+ appendToRun(segments, "sources", part, key);
40
+ } else if (isToolPart(part)) {
41
+ segments.push({
42
+ kind: "tool",
43
+ key: part.toolCallId,
44
+ part
45
+ });
46
+ }
47
+ });
48
+ return segments;
35
49
  }
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn, MessageAvatar, MessageContent, MessageFooter, Message as MessageRow, } from "@locusgraph/components";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { cn, MessageAvatar, MessageContent, MessageFooter, Message as MessageRow } from "@locusgraph/components";
3
3
  import { Thinking } from "../../agent/thinking/thinking.js";
4
4
  import { Tool } from "../../agent/tool/tool.js";
5
5
  import { Sources } from "../../memory/sources.js";
@@ -7,39 +7,247 @@ import { fileFromFilePart } from "../files/file-meta.js";
7
7
  import { Files } from "../files/files.js";
8
8
  import { Reply } from "../reply/reply.js";
9
9
  import { groupParts } from "./group-parts.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
11
  const roleLabels = {
11
- user: "You said",
12
- assistant: "Assistant said",
13
- system: "System note",
12
+ user: "You said",
13
+ assistant: "Assistant said",
14
+ system: "System note"
14
15
  };
15
- function UserText({ part }) {
16
- return (_jsx("div", { "data-slot": "message-user-text", className: "max-w-[85%] bg-muted px-3.5 py-2 text-sm leading-relaxed whitespace-pre-wrap wrap-break-word text-foreground", children: part.text }));
16
+ function UserText(t0) {
17
+ const $ = _c(2);
18
+ const {
19
+ part
20
+ } = t0;
21
+ let t1;
22
+ if ($[0] !== part.text) {
23
+ t1 = /*#__PURE__*/_jsx("div", {
24
+ "data-slot": "message-user-text",
25
+ className: "max-w-[85%] bg-muted px-3.5 py-2 text-sm leading-relaxed whitespace-pre-wrap wrap-break-word text-foreground",
26
+ children: part.text
27
+ });
28
+ $[0] = part.text;
29
+ $[1] = t1;
30
+ } else {
31
+ t1 = $[1];
32
+ }
33
+ return t1;
17
34
  }
18
35
  function partClassName(role, kind) {
19
- if (role === "user") {
20
- return "w-full items-end";
21
- }
22
- if (role === "system") {
23
- return "border-l-2 border-border pl-3 *:data-[slot=reply]:text-xs *:data-[slot=reply]:text-muted-foreground";
24
- }
25
- return cn(kind === "text" && "*:data-[slot=reply]:max-w-[68ch]");
36
+ if (role === "user") {
37
+ return "w-full items-end";
38
+ }
39
+ if (role === "system") {
40
+ return "border-l-2 border-border pl-3 *:data-[slot=reply]:text-xs *:data-[slot=reply]:text-muted-foreground";
41
+ }
42
+ return cn(kind === "text" && "*:data-[slot=reply]:max-w-[68ch]");
26
43
  }
27
44
  function renderSegment(segment, isUser, renderers) {
28
- switch (segment.kind) {
29
- case "text":
30
- return isUser ? (_jsx(UserText, { part: segment.part })) : (_jsx(Reply, { state: segment.part.state, children: segment.part.text }));
31
- case "reasoning":
32
- return renderers.renderReasoning ? (renderers.renderReasoning(segment.part)) : (_jsx(Thinking, { text: segment.part.text, state: segment.part.state, durationMs: segment.part.durationMs }));
33
- case "tool":
34
- return renderers.renderTool ? (renderers.renderTool(segment.part)) : (_jsx(Tool, { part: segment.part }));
35
- case "sources":
36
- return renderers.renderSources ? (renderers.renderSources(segment.parts)) : (_jsx(Sources, { sources: segment.parts }));
37
- case "files":
38
- return (_jsx(Files, { items: segment.parts.map(fileFromFilePart), className: cn(isUser && "justify-end") }));
39
- }
45
+ switch (segment.kind) {
46
+ case "text":
47
+ return isUser ? /*#__PURE__*/_jsx(UserText, {
48
+ part: segment.part
49
+ }) : /*#__PURE__*/_jsx(Reply, {
50
+ state: segment.part.state,
51
+ children: segment.part.text
52
+ });
53
+ case "reasoning":
54
+ return renderers.renderReasoning ? renderers.renderReasoning(segment.part) : /*#__PURE__*/_jsx(Thinking, {
55
+ text: segment.part.text,
56
+ state: segment.part.state,
57
+ durationMs: segment.part.durationMs
58
+ });
59
+ case "tool":
60
+ return renderers.renderTool ? renderers.renderTool(segment.part) : /*#__PURE__*/_jsx(Tool, {
61
+ part: segment.part
62
+ });
63
+ case "sources":
64
+ return renderers.renderSources ? renderers.renderSources(segment.parts) : /*#__PURE__*/_jsx(Sources, {
65
+ sources: segment.parts
66
+ });
67
+ case "files":
68
+ return /*#__PURE__*/_jsx(Files, {
69
+ items: segment.parts.map(fileFromFilePart),
70
+ className: cn(isUser && "justify-end")
71
+ });
72
+ }
40
73
  }
41
- export function Turn({ message, avatar, footer, renderReasoning, renderTool, renderSources, className, ...props }) {
42
- const isUser = message.role === "user";
43
- const renderers = { renderReasoning, renderTool, renderSources };
44
- return (_jsxs(MessageRow, { "data-role": message.role, align: isUser ? "end" : "start", "aria-label": roleLabels[message.role], role: "article", className: cn("gap-3 data-[role=system]:text-muted-foreground", className), ...props, children: [avatar && (_jsx(MessageAvatar, { className: "mt-0.5 self-start group-has-data-[slot=message-footer]/message:translate-y-0", children: avatar })), _jsxs(MessageContent, { className: cn("gap-4", isUser && "items-end gap-2"), children: [groupParts(message.parts).map((segment) => (_jsx("div", { "data-slot": "message-part", "data-kind": segment.kind, className: cn("flex min-w-0 flex-col", partClassName(message.role, segment.kind)), children: renderSegment(segment, isUser, renderers) }, segment.key))), footer && _jsx(MessageFooter, { className: "px-0", children: footer })] })] }));
74
+ export function Turn(t0) {
75
+ const $ = _c(52);
76
+ let avatar;
77
+ let className;
78
+ let footer;
79
+ let message;
80
+ let props;
81
+ let renderReasoning;
82
+ let renderSources;
83
+ let renderTool;
84
+ if ($[0] !== t0) {
85
+ ({
86
+ message,
87
+ avatar,
88
+ footer,
89
+ renderReasoning,
90
+ renderTool,
91
+ renderSources,
92
+ className,
93
+ ...props
94
+ } = t0);
95
+ $[0] = t0;
96
+ $[1] = avatar;
97
+ $[2] = className;
98
+ $[3] = footer;
99
+ $[4] = message;
100
+ $[5] = props;
101
+ $[6] = renderReasoning;
102
+ $[7] = renderSources;
103
+ $[8] = renderTool;
104
+ } else {
105
+ avatar = $[1];
106
+ className = $[2];
107
+ footer = $[3];
108
+ message = $[4];
109
+ props = $[5];
110
+ renderReasoning = $[6];
111
+ renderSources = $[7];
112
+ renderTool = $[8];
113
+ }
114
+ const isUser = message.role === "user";
115
+ let T0;
116
+ let T1;
117
+ let t1;
118
+ let t2;
119
+ let t3;
120
+ let t4;
121
+ let t5;
122
+ let t6;
123
+ let t7;
124
+ let t8;
125
+ let t9;
126
+ if ($[9] !== avatar || $[10] !== className || $[11] !== isUser || $[12] !== message.parts || $[13] !== message.role || $[14] !== props || $[15] !== renderReasoning || $[16] !== renderSources || $[17] !== renderTool) {
127
+ const renderers = {
128
+ renderReasoning,
129
+ renderTool,
130
+ renderSources
131
+ };
132
+ T1 = MessageRow;
133
+ t3 = message.role;
134
+ t4 = isUser ? "end" : "start";
135
+ t5 = roleLabels[message.role];
136
+ t6 = "article";
137
+ if ($[29] !== className) {
138
+ t7 = cn("gap-3 data-[role=system]:text-muted-foreground", className);
139
+ $[29] = className;
140
+ $[30] = t7;
141
+ } else {
142
+ t7 = $[30];
143
+ }
144
+ t8 = props;
145
+ if ($[31] !== avatar) {
146
+ t9 = avatar && /*#__PURE__*/_jsx(MessageAvatar, {
147
+ className: "mt-0.5 self-start group-has-data-[slot=message-footer]/message:translate-y-0",
148
+ children: avatar
149
+ });
150
+ $[31] = avatar;
151
+ $[32] = t9;
152
+ } else {
153
+ t9 = $[32];
154
+ }
155
+ T0 = MessageContent;
156
+ const t10 = isUser && "items-end gap-2";
157
+ if ($[33] !== t10) {
158
+ t1 = cn("gap-4", t10);
159
+ $[33] = t10;
160
+ $[34] = t1;
161
+ } else {
162
+ t1 = $[34];
163
+ }
164
+ t2 = groupParts(message.parts).map(segment => /*#__PURE__*/_jsx("div", {
165
+ "data-slot": "message-part",
166
+ "data-kind": segment.kind,
167
+ className: cn("flex min-w-0 flex-col", partClassName(message.role, segment.kind)),
168
+ children: renderSegment(segment, isUser, renderers)
169
+ }, segment.key));
170
+ $[9] = avatar;
171
+ $[10] = className;
172
+ $[11] = isUser;
173
+ $[12] = message.parts;
174
+ $[13] = message.role;
175
+ $[14] = props;
176
+ $[15] = renderReasoning;
177
+ $[16] = renderSources;
178
+ $[17] = renderTool;
179
+ $[18] = T0;
180
+ $[19] = T1;
181
+ $[20] = t1;
182
+ $[21] = t2;
183
+ $[22] = t3;
184
+ $[23] = t4;
185
+ $[24] = t5;
186
+ $[25] = t6;
187
+ $[26] = t7;
188
+ $[27] = t8;
189
+ $[28] = t9;
190
+ } else {
191
+ T0 = $[18];
192
+ T1 = $[19];
193
+ t1 = $[20];
194
+ t2 = $[21];
195
+ t3 = $[22];
196
+ t4 = $[23];
197
+ t5 = $[24];
198
+ t6 = $[25];
199
+ t7 = $[26];
200
+ t8 = $[27];
201
+ t9 = $[28];
202
+ }
203
+ let t10;
204
+ if ($[35] !== footer) {
205
+ t10 = footer && /*#__PURE__*/_jsx(MessageFooter, {
206
+ className: "px-0",
207
+ children: footer
208
+ });
209
+ $[35] = footer;
210
+ $[36] = t10;
211
+ } else {
212
+ t10 = $[36];
213
+ }
214
+ let t11;
215
+ if ($[37] !== T0 || $[38] !== t1 || $[39] !== t10 || $[40] !== t2) {
216
+ t11 = /*#__PURE__*/_jsxs(T0, {
217
+ className: t1,
218
+ children: [t2, t10]
219
+ });
220
+ $[37] = T0;
221
+ $[38] = t1;
222
+ $[39] = t10;
223
+ $[40] = t2;
224
+ $[41] = t11;
225
+ } else {
226
+ t11 = $[41];
227
+ }
228
+ let t12;
229
+ if ($[42] !== T1 || $[43] !== t11 || $[44] !== t3 || $[45] !== t4 || $[46] !== t5 || $[47] !== t6 || $[48] !== t7 || $[49] !== t8 || $[50] !== t9) {
230
+ t12 = /*#__PURE__*/_jsxs(T1, {
231
+ "data-role": t3,
232
+ align: t4,
233
+ "aria-label": t5,
234
+ role: t6,
235
+ className: t7,
236
+ ...t8,
237
+ children: [t9, t11]
238
+ });
239
+ $[42] = T1;
240
+ $[43] = t11;
241
+ $[44] = t3;
242
+ $[45] = t4;
243
+ $[46] = t5;
244
+ $[47] = t6;
245
+ $[48] = t7;
246
+ $[49] = t8;
247
+ $[50] = t9;
248
+ $[51] = t12;
249
+ } else {
250
+ t12 = $[51];
251
+ }
252
+ return t12;
45
253
  }