@burdenoff/fe-libs 2026.1113.10 → 2026.1114.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.
Files changed (57) hide show
  1. package/README.md +55 -8
  2. package/dist/node_modules/pdfjs-dist/build/pdf.js +21 -0
  3. package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +21 -0
  4. package/dist/platform-pages/AcceptShareRoute.js +15 -16
  5. package/dist/platform-pages/AffiliatesPage.js +4 -5
  6. package/dist/shared/assistant/createSandboxAssistantTransport.js +0 -1
  7. package/dist/shared/assistant/index.d.ts +3 -0
  8. package/dist/shared/assistant/ui/AIAssistantPanel.js +267 -241
  9. package/dist/shared/assistant/ui/AssistantChatArea.js +1243 -1241
  10. package/dist/shared/assistant/ui/AssistantConversationList.js +253 -252
  11. package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +4 -23
  12. package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +52 -55
  13. package/dist/shared/assistant/ui/AssistantMessageItem.js +37 -38
  14. package/dist/shared/assistant/ui/AssistantMessageList.js +48 -47
  15. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +24 -25
  16. package/dist/shared/assistant/ui/assistantPageLayout.d.ts +13 -0
  17. package/dist/shared/assistant/ui/assistantPageLayout.js +8 -0
  18. package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.d.ts +6 -0
  19. package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.js +77 -71
  20. package/dist/shared/assistant/ui/compact/AssistantMenuView.js +130 -129
  21. package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +13 -0
  22. package/dist/shared/assistant/ui/compact/AssistantPageBar.js +46 -0
  23. package/dist/shared/assistant/ui/compact/AssistantViewSwitch.d.ts +5 -0
  24. package/dist/shared/assistant/ui/compact/AssistantViewSwitch.js +11 -11
  25. package/dist/shared/assistant/ui/composer/AssistantCompactFooter.js +15 -11
  26. package/dist/shared/assistant/ui/composer/AssistantComposer.js +258 -257
  27. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +3 -3
  28. package/dist/shared/assistant/ui/composer/connectSource.js +1 -2
  29. package/dist/shared/assistant/uiActions/assistantHref.d.ts +2 -30
  30. package/dist/shared/assistant/uiActions/assistantHref.js +7 -43
  31. package/dist/shared/assistant/uiActions/assistantLinkNavigation.d.ts +12 -0
  32. package/dist/shared/assistant/uiActions/assistantLinkNavigation.js +42 -0
  33. package/dist/shared/assistant/uiActions/inAppLinks.js +9 -8
  34. package/dist/shared/components/ContextConversationWidget.js +6 -7
  35. package/dist/shared/components/assistantWidget/MessageContent.js +3 -4
  36. package/dist/shared/components/contextConversationWidget/Composer.js +9 -10
  37. package/dist/shared/components/contextConversationWidget/MessageItem.js +0 -1
  38. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +0 -1
  39. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +0 -1
  40. package/dist/shared/components/contextConversationWidget/ReplyBanner.js +0 -1
  41. package/dist/shared/components/contextConversationWidget/WidgetHeader.js +8 -9
  42. package/dist/shared/hooks/usePushDeviceRegistration.js +9 -10
  43. package/dist/shared/hooks/useRecordProductVisit.js +8 -9
  44. package/dist/shared/tours/ToursContext.js +6 -7
  45. package/dist/shared-assistant.js +224 -221
  46. package/dist/shared-hooks.js +10 -12
  47. package/dist/shared-plugins.js +0 -1
  48. package/dist/shared-providers-shell.js +7 -8
  49. package/dist/shared.js +83 -87
  50. package/dist/third-party/pdfjs-dist/ATTRIBUTION.txt +54 -0
  51. package/dist/third-party/pdfjs-dist/LICENSE +177 -0
  52. package/dist/third-party/pdfjs-dist/manifest.json +19 -0
  53. package/dist/utils/index.js +1 -1
  54. package/package.json +29 -2
  55. package/dist/shared/actors/index.js +0 -3
  56. package/dist/shared/assistant/speech/index.js +0 -6
  57. package/dist/shared/plugins/iframe-mount/index.js +0 -5
@@ -1,10 +1,11 @@
1
- import { FC, MouseEvent, ReactNode } from 'react';
2
- import { assistantRoutePath, assistantUrlTransform, classifyAssistantHref, AssistantLinkKind } from '../uiActions/assistantHref';
1
+ import { FC, ReactNode } from 'react';
2
+ import { assistantRoutePath, browserShouldHandle, classifyAssistantHref, AssistantLinkKind } from '../uiActions/assistantLinkNavigation';
3
+ import { assistantUrlTransform } from '../uiActions/assistantHref';
3
4
  import { NavigationInitiator, UnsavedChange } from '../../navigation/unsavedChanges';
4
5
  interface Props {
5
6
  content: string;
6
7
  }
7
- export { assistantRoutePath, assistantUrlTransform, classifyAssistantHref };
8
+ export { assistantRoutePath, assistantUrlTransform, browserShouldHandle, classifyAssistantHref };
8
9
  export type { AssistantLinkKind };
9
10
  /**
10
11
  * ★ BOFF-8060 (N1a, C7): what a navigator reports about the hand-over, so the
@@ -60,26 +61,6 @@ export interface AssistantNavigateContext {
60
61
  * `initiator`; `createAssistantNavigate` reads it.
61
62
  */
62
63
  export type AssistantNavigate = (path: string, initiator?: AssistantNavigateInitiator, context?: AssistantNavigateContext) => AssistantNavigateResult | void | Promise<AssistantNavigateResult | void>;
63
- /**
64
- * ★★ The cases where the BROWSER must win, not the router. Losing these is how
65
- * "open in new tab", "copy link" and middle-click quietly stop working — the
66
- * reason the anchor also keeps a real `href` rather than becoming a button.
67
- *
68
- * ★★ THE ANCHOR SHOWS THE RESOLVED PATH, NOT THE RAW HREF, and that is a
69
- * correctness fix rather than cosmetics. A document-relative href resolves
70
- * against the CURRENT PAGE in the browser but against the ORIGIN in
71
- * `assistantRoutePath`, so the two click modes disagreed:
72
- *
73
- * on /healthybowl/crops/42, `[x](fields)`
74
- * plain click -> navigate("/fields") (resolved at the root)
75
- * ctrl-click -> browser opens /healthybowl/crops/fields
76
- *
77
- * Same link, two destinations depending on how it was clicked — and "copy link
78
- * address" gave a third answer. Emitting `routePath` as the href makes every
79
- * mode agree, because there is then only one resolved value. A fragment and an
80
- * external URL are left exactly as written: neither is a route.
81
- */
82
- export declare function browserShouldHandle(event: MouseEvent<HTMLAnchorElement>): boolean;
83
64
  /**
84
65
  * ★ Context, not a prop: the renderer is reached by TWO paths — the chat
85
66
  * transcript and the voice transcript drawer — and threading a prop through
@@ -6,44 +6,41 @@ import { defaultSchema as i } from "../../../node_modules/hast-util-sanitize/lib
6
6
  import { useAssistantTr as a } from "../i18n.js";
7
7
  import { copyToClipboard as o } from "../clipboard.js";
8
8
  import { AssistantMarkdownImage as s } from "./AssistantMarkdownImage.js";
9
- import { assistantRoutePath as c, assistantUrlTransform as l, classifyAssistantHref as u } from "../uiActions/assistantHref.js";
10
- import { createContext as d, useContext as f, useState as p } from "react";
11
- import { Check as m, Copy as h } from "lucide-react";
12
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
9
+ import { assistantRoutePath as c, browserShouldHandle as l, classifyAssistantHref as u } from "../uiActions/assistantLinkNavigation.js";
10
+ import { assistantUrlTransform as d } from "../uiActions/assistantHref.js";
11
+ import { createContext as f, useContext as p, useState as m } from "react";
12
+ import { Check as h, Copy as g } from "lucide-react";
13
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
14
  // src/shared/assistant/ui/AssistantMarkdownRenderer.tsx
14
- var y = {
15
+ var b = {
15
16
  ...i,
16
17
  protocols: {
17
18
  ...i.protocols,
18
19
  src: [...i.protocols?.src ?? [], "data"]
19
20
  }
20
- };
21
- function b(e) {
22
- return e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
23
- }
24
- var x = d(null), S = ({ value: e, children: t }) => /* @__PURE__ */ _(x.Provider, {
21
+ }, x = f(null), S = ({ value: e, children: t }) => /* @__PURE__ */ v(x.Provider, {
25
22
  value: e ?? null,
26
23
  children: t
27
24
  });
28
25
  function C() {
29
- return f(x);
26
+ return p(x);
30
27
  }
31
28
  var w = "text-action-primary-bg underline-offset-2 hover:underline", T = ({ href: e, children: t }) => {
32
29
  let n = C(), r = u(e), i = r === "internal" ? c(e) : null;
33
- return r === "blocked" ? /* @__PURE__ */ _(g, { children: t }) : n && i ? /* @__PURE__ */ _("a", {
30
+ return r === "blocked" ? /* @__PURE__ */ v(_, { children: t }) : n && i ? /* @__PURE__ */ v("a", {
34
31
  href: i,
35
32
  className: w,
36
33
  "data-testid": "assistant-markdown-link",
37
34
  onClick: (e) => {
38
- b(e) || (e.preventDefault(), Promise.resolve(n(i, "person", { surface: "reply-link" })).catch(() => void 0));
35
+ l(e) || (e.preventDefault(), Promise.resolve(n(i, "person", { surface: "reply-link" })).catch(() => void 0));
39
36
  },
40
37
  children: t
41
- }) : r === "internal" || r === "fragment" ? /* @__PURE__ */ _("a", {
38
+ }) : r === "internal" || r === "fragment" ? /* @__PURE__ */ v("a", {
42
39
  href: i ?? e,
43
40
  className: w,
44
41
  "data-testid": "assistant-markdown-link",
45
42
  children: t
46
- }) : /* @__PURE__ */ _("a", {
43
+ }) : /* @__PURE__ */ v("a", {
47
44
  href: e,
48
45
  target: "_blank",
49
46
  rel: "noopener noreferrer",
@@ -51,17 +48,17 @@ var w = "text-action-primary-bg underline-offset-2 hover:underline", T = ({ href
51
48
  "data-testid": "assistant-markdown-link",
52
49
  children: t
53
50
  });
54
- }, E = [n], D = [[r, y]];
51
+ }, E = [n], D = [[r, b]];
55
52
  function O({ language: t, code: n }) {
56
- let r = e(), i = a(), [s, c] = p(!1);
57
- return /* @__PURE__ */ v("div", {
53
+ let r = e(), i = a(), [s, c] = m(!1);
54
+ return /* @__PURE__ */ y("div", {
58
55
  className: "group relative my-2 overflow-hidden rounded-md border border-border-default bg-bg-sunken",
59
- children: [/* @__PURE__ */ v("div", {
56
+ children: [/* @__PURE__ */ y("div", {
60
57
  className: "flex items-center justify-between border-b border-border-default bg-bg-elevated px-3 py-1.5",
61
- children: [/* @__PURE__ */ _("span", {
58
+ children: [/* @__PURE__ */ v("span", {
62
59
  className: "font-mono text-[10px] uppercase tracking-wider text-text-muted",
63
60
  children: t || r.code
64
- }), /* @__PURE__ */ _("button", {
61
+ }), /* @__PURE__ */ v("button", {
65
62
  type: "button",
66
63
  onClick: () => {
67
64
  o(n).then((e) => {
@@ -71,11 +68,11 @@ function O({ language: t, code: n }) {
71
68
  className: "flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
72
69
  "aria-label": i("markdown.copyCode", "Copy code"),
73
70
  "data-testid": "assistant-markdown-copy-code",
74
- children: s ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(m, { className: "size-3 text-status-success-text" }), /* @__PURE__ */ _("span", { children: i("markdown.copied", "Copied") })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(h, { className: "size-3" }), /* @__PURE__ */ _("span", { children: i("markdown.copy", "Copy") })] })
71
+ children: s ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "size-3 text-status-success-text" }), /* @__PURE__ */ v("span", { children: i("markdown.copied", "Copied") })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, { className: "size-3" }), /* @__PURE__ */ v("span", { children: i("markdown.copy", "Copy") })] })
75
72
  })]
76
- }), /* @__PURE__ */ _("pre", {
73
+ }), /* @__PURE__ */ v("pre", {
77
74
  className: "overflow-x-auto p-3 text-xs leading-relaxed",
78
- children: /* @__PURE__ */ _("code", {
75
+ children: /* @__PURE__ */ v("code", {
79
76
  className: "font-mono text-text-primary",
80
77
  children: n
81
78
  })
@@ -102,128 +99,128 @@ function j({ level: e, children: t }) {
102
99
  5: "text-[0.95em]",
103
100
  6: "text-[0.9em]"
104
101
  }[e];
105
- return /* @__PURE__ */ _(n, {
102
+ return /* @__PURE__ */ v(n, {
106
103
  className: `mb-1 mt-3 font-semibold text-text-primary ${r}`,
107
104
  children: t
108
105
  });
109
106
  }
110
107
  var M = {
111
- a: ({ href: e, children: t }) => /* @__PURE__ */ _(T, {
108
+ a: ({ href: e, children: t }) => /* @__PURE__ */ v(T, {
112
109
  href: e,
113
110
  children: t
114
111
  }),
115
- blockquote: ({ children: e }) => /* @__PURE__ */ _("blockquote", {
112
+ blockquote: ({ children: e }) => /* @__PURE__ */ v("blockquote", {
116
113
  className: "my-2 border-s-2 border-action-primary-bg ps-3 italic text-text-secondary",
117
114
  children: e
118
115
  }),
119
- code: ({ children: e }) => /* @__PURE__ */ _("code", {
116
+ code: ({ children: e }) => /* @__PURE__ */ v("code", {
120
117
  className: "rounded bg-bg-sunken px-1 py-0.5 font-mono text-[0.85em] text-text-primary",
121
118
  children: e
122
119
  }),
123
- del: ({ children: e }) => /* @__PURE__ */ _("del", {
120
+ del: ({ children: e }) => /* @__PURE__ */ v("del", {
124
121
  className: "text-text-muted line-through",
125
122
  children: e
126
123
  }),
127
- em: ({ children: e }) => /* @__PURE__ */ _("em", {
124
+ em: ({ children: e }) => /* @__PURE__ */ v("em", {
128
125
  className: "italic",
129
126
  children: e
130
127
  }),
131
- h1: ({ children: e }) => /* @__PURE__ */ _(j, {
128
+ h1: ({ children: e }) => /* @__PURE__ */ v(j, {
132
129
  level: 2,
133
130
  children: e
134
131
  }),
135
- h2: ({ children: e }) => /* @__PURE__ */ _(j, {
132
+ h2: ({ children: e }) => /* @__PURE__ */ v(j, {
136
133
  level: 3,
137
134
  children: e
138
135
  }),
139
- h3: ({ children: e }) => /* @__PURE__ */ _(j, {
136
+ h3: ({ children: e }) => /* @__PURE__ */ v(j, {
140
137
  level: 4,
141
138
  children: e
142
139
  }),
143
- h4: ({ children: e }) => /* @__PURE__ */ _(j, {
140
+ h4: ({ children: e }) => /* @__PURE__ */ v(j, {
144
141
  level: 5,
145
142
  children: e
146
143
  }),
147
- h5: ({ children: e }) => /* @__PURE__ */ _(j, {
144
+ h5: ({ children: e }) => /* @__PURE__ */ v(j, {
148
145
  level: 6,
149
146
  children: e
150
147
  }),
151
- h6: ({ children: e }) => /* @__PURE__ */ _(j, {
148
+ h6: ({ children: e }) => /* @__PURE__ */ v(j, {
152
149
  level: 6,
153
150
  children: e
154
151
  }),
155
- hr: () => /* @__PURE__ */ _("hr", { className: "my-3 border-border-default" }),
156
- img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */ _(s, {
152
+ hr: () => /* @__PURE__ */ v("hr", { className: "my-3 border-border-default" }),
153
+ img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */ v(s, {
157
154
  src: typeof e == "string" ? e : void 0,
158
155
  alt: t,
159
156
  title: n
160
157
  }),
161
- input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */ _("input", {
158
+ input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */ v("input", {
162
159
  type: "checkbox",
163
160
  checked: !!e,
164
161
  disabled: !0,
165
162
  className: "me-1.5 size-3 flex-shrink-0 align-[-0.1em] accent-[var(--color-action-primary-bg)]"
166
163
  }) : null,
167
- li: ({ className: e, children: t }) => /* @__PURE__ */ _("li", {
164
+ li: ({ className: e, children: t }) => /* @__PURE__ */ v("li", {
168
165
  className: A(e, "task-list-item") ? "list-none text-text-primary" : "text-text-primary",
169
166
  children: t
170
167
  }),
171
- ol: ({ children: e }) => /* @__PURE__ */ _("ol", {
168
+ ol: ({ children: e }) => /* @__PURE__ */ v("ol", {
172
169
  className: "my-1.5 ms-5 list-decimal space-y-0.5",
173
170
  children: e
174
171
  }),
175
- p: ({ children: e }) => /* @__PURE__ */ _("p", {
172
+ p: ({ children: e }) => /* @__PURE__ */ v("p", {
176
173
  className: "my-1.5 leading-relaxed text-text-primary",
177
174
  children: e
178
175
  }),
179
176
  pre: ({ children: e, node: t }) => {
180
177
  let n = k(t);
181
- return n ? /* @__PURE__ */ _(O, {
178
+ return n ? /* @__PURE__ */ v(O, {
182
179
  language: n.language,
183
180
  code: n.code
184
- }) : /* @__PURE__ */ _("pre", {
181
+ }) : /* @__PURE__ */ v("pre", {
185
182
  className: "my-2 overflow-x-auto rounded-md border border-border-default bg-bg-sunken p-3 text-xs leading-relaxed",
186
183
  children: e
187
184
  });
188
185
  },
189
- strong: ({ children: e }) => /* @__PURE__ */ _("strong", {
186
+ strong: ({ children: e }) => /* @__PURE__ */ v("strong", {
190
187
  className: "font-semibold text-text-primary",
191
188
  children: e
192
189
  }),
193
- table: ({ children: e }) => /* @__PURE__ */ _("div", {
190
+ table: ({ children: e }) => /* @__PURE__ */ v("div", {
194
191
  className: "my-2 overflow-x-auto",
195
192
  "data-testid": "assistant-markdown-table",
196
- children: /* @__PURE__ */ _("table", {
193
+ children: /* @__PURE__ */ v("table", {
197
194
  className: "w-full border-collapse text-[0.9em]",
198
195
  children: e
199
196
  })
200
197
  }),
201
- td: ({ children: e }) => /* @__PURE__ */ _("td", {
198
+ td: ({ children: e }) => /* @__PURE__ */ v("td", {
202
199
  className: "px-2 py-1.5 align-top text-text-primary",
203
200
  children: e
204
201
  }),
205
- th: ({ children: e }) => /* @__PURE__ */ _("th", {
202
+ th: ({ children: e }) => /* @__PURE__ */ v("th", {
206
203
  scope: "col",
207
204
  className: "px-2 py-1.5 text-start font-semibold text-text-primary",
208
205
  children: e
209
206
  }),
210
- tr: ({ children: e }) => /* @__PURE__ */ _("tr", {
207
+ tr: ({ children: e }) => /* @__PURE__ */ v("tr", {
211
208
  className: "border-b border-border-subtle",
212
209
  children: e
213
210
  }),
214
- ul: ({ className: e, children: t }) => /* @__PURE__ */ _("ul", {
211
+ ul: ({ className: e, children: t }) => /* @__PURE__ */ v("ul", {
215
212
  className: A(e, "contains-task-list") ? "my-1.5 ms-0.5 list-none space-y-0.5" : "my-1.5 ms-5 list-disc space-y-0.5",
216
213
  children: t
217
214
  })
218
- }, N = ({ content: e }) => /* @__PURE__ */ _("div", {
215
+ }, N = ({ content: e }) => /* @__PURE__ */ v("div", {
219
216
  className: "break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
220
217
  "data-testid": "assistant-markdown",
221
- children: /* @__PURE__ */ _(t, {
218
+ children: /* @__PURE__ */ v(t, {
222
219
  remarkPlugins: E,
223
220
  rehypePlugins: D,
224
- urlTransform: l,
221
+ urlTransform: d,
225
222
  components: M,
226
223
  children: e
227
224
  })
228
225
  });
229
- export { N as AssistantMarkdownRenderer, S as AssistantNavigateProvider, c as assistantRoutePath, l as assistantUrlTransform, b as browserShouldHandle, u as classifyAssistantHref, C as useAssistantNavigate };
226
+ export { N as AssistantMarkdownRenderer, S as AssistantNavigateProvider, c as assistantRoutePath, d as assistantUrlTransform, l as browserShouldHandle, u as classifyAssistantHref, C as useAssistantNavigate };
@@ -1,26 +1,25 @@
1
1
  import { useAssistantChromeLabels as e } from "../../providers/shell/useAssistantShellLabels.js";
2
2
  import { useAuthToken as t } from "../../providers/shell/AuthTokenProvider.js";
3
3
  import "../../../shared-providers-shell.js";
4
- import "../../../storage/index.js";
5
- import { AssistantAvatar as n } from "./AssistantAvatar.js";
6
- import { AssistantMarkdownRenderer as r } from "./AssistantMarkdownRenderer.js";
7
- import { AssistantRichContent as i } from "../openui/AssistantRichContent.js";
8
- import { useAssistantGenerativeUi as a } from "../openui/generativeUi.js";
9
- import { stripOpenUiBlocks as o } from "../openui/segments.js";
10
- import { AssistantPendingWriteCard as s } from "./AssistantPendingWriteCard.js";
11
- import { AssistantMessageAttachments as ee } from "./AssistantMessageAttachments.js";
12
- import { AssistantFocusBadge as te } from "./composer/AssistantFocusChip.js";
13
- import { readMessageFocus as c } from "../askAbout/focus.js";
14
- import { AssistantSpeakButton as l } from "./AssistantSpeakButton.js";
15
- import { useAssistantStorageFolders as ne } from "../product.js";
16
- import { useAssistantSpeech as re } from "./AssistantSpeechProvider.js";
17
- import { AssistantToolActivity as ie, parseToolActivity as ae } from "./AssistantToolActivity.js";
18
- import { AssistantTurnActivity as oe } from "./AssistantTurnActivity.js";
4
+ import { SaveToFilesButton as n } from "../../../storage/SaveToFilesButton.js";
5
+ import { AssistantAvatar as r } from "./AssistantAvatar.js";
6
+ import { AssistantMarkdownRenderer as i } from "./AssistantMarkdownRenderer.js";
7
+ import { AssistantRichContent as a } from "../openui/AssistantRichContent.js";
8
+ import { useAssistantGenerativeUi as o } from "../openui/generativeUi.js";
9
+ import { stripOpenUiBlocks as s } from "../openui/segments.js";
10
+ import { AssistantPendingWriteCard as ee } from "./AssistantPendingWriteCard.js";
11
+ import { AssistantMessageAttachments as te } from "./AssistantMessageAttachments.js";
12
+ import { AssistantFocusBadge as c } from "./composer/AssistantFocusChip.js";
13
+ import { readMessageFocus as l } from "../askAbout/focus.js";
14
+ import { AssistantSpeakButton as ne } from "./AssistantSpeakButton.js";
15
+ import { useAssistantStorageFolders as re } from "../product.js";
16
+ import { useAssistantSpeech as ie } from "./AssistantSpeechProvider.js";
17
+ import { AssistantToolActivity as ae, parseToolActivity as oe } from "./AssistantToolActivity.js";
18
+ import { AssistantTurnActivity as se } from "./AssistantTurnActivity.js";
19
19
  import { usePrefersReducedMotion as u } from "./usePrefersReducedMotion.js";
20
- import { getAssistantDisplayContent as se, isAssistantMessageLive as ce } from "../displayContent.js";
21
- import { downloadAssistantArtifact as le } from "../api.js";
22
- import { useAssistantTr as ue } from "../i18n.js";
23
- import { SaveToFilesButton as d } from "../../../storage/SaveToFilesButton.js";
20
+ import { getAssistantDisplayContent as ce, isAssistantMessageLive as le } from "../displayContent.js";
21
+ import { downloadAssistantArtifact as ue } from "../api.js";
22
+ import { useAssistantTr as d } from "../i18n.js";
24
23
  import { useI18n as de } from "../../providers/shell/I18nProvider.js";
25
24
  import { languageConfirmationCopy as fe } from "../appControls/languageReply.js";
26
25
  import { copyToClipboard as pe } from "../clipboard.js";
@@ -51,14 +50,14 @@ var S = () => {
51
50
  className: "ms-0.5 inline-block h-4 w-1.5 rounded-sm bg-text-secondary align-middle" + (e ? "" : " motion-safe:animate-pulse")
52
51
  });
53
52
  }, C = ({ onApprovePendingWrite: u, approvingWriteRef: x = null, pendingWriteExpired: C = !1, pendingWriteApproved: ve = !1, pendingWriteGoAheadSent: ye = !1, message: w, processing: T, isStreaming: E, isFailed: D, isLastAssistant: O, isNewestAssistant: k, onRetry: A, legacyWriteCardHidden: j = !1, writeProposals: M, uiOffers: N, onStopTurn: P, stopTurnLabel: F = "Stop" }) => {
54
- let be = e(), I = ue(), { locale: xe } = de(), L = fe(w, I), R = L ? L.translated ? xe : "en" : w.metadata?.lang, z = L ? `${w.id}:language:${R}` : w.id, B = p(z), Se = ne(), { getAccessToken: Ce, getWorkspaceToken: we } = t(), V = re(), [Te, H] = m(null), [Ee, U] = m(!1), W = w.role === "user", G = f(() => he(w), [w]), K = f(() => ge(G), [G]), q = T === void 0 ? E ? {
53
+ let be = e(), I = d(), { locale: xe } = de(), L = fe(w, I), R = L ? L.translated ? xe : "en" : w.metadata?.lang, z = L ? `${w.id}:language:${R}` : w.id, B = p(z), Se = re(), { getAccessToken: Ce, getWorkspaceToken: we } = t(), V = ie(), [Te, H] = m(null), [Ee, U] = m(!1), W = w.role === "user", G = f(() => he(w), [w]), K = f(() => ge(G), [G]), q = T === void 0 ? E ? {
55
54
  status: "streaming",
56
55
  messageId: w.id,
57
56
  updatedAt: w.timestamp
58
- } : null : T, J = se(w, q, I), { steps: Y, text: X } = f(() => W ? {
57
+ } : null : T, J = ce(w, q, I), { steps: Y, text: X } = f(() => W ? {
59
58
  steps: [],
60
59
  text: w.content
61
- } : J.kind === "output" ? ae(J.text) : {
60
+ } : J.kind === "output" ? oe(J.text) : {
62
61
  steps: [],
63
62
  text: ""
64
63
  }, [
@@ -66,7 +65,7 @@ var S = () => {
66
65
  w.content,
67
66
  J.kind,
68
67
  J.text
69
- ]), Z = a(), Q = f(() => Z ? o(X) : X, [Z, X]), De = () => {
68
+ ]), Z = o(), Q = f(() => Z ? s(X) : X, [Z, X]), De = () => {
70
69
  pe(X).then((e) => {
71
70
  e && (U(!0), setTimeout(() => U(!1), 2e3));
72
71
  });
@@ -76,7 +75,7 @@ var S = () => {
76
75
  if (t) {
77
76
  H(e.path);
78
77
  try {
79
- let n = await le(G.sandboxId, t, G.sessionId, e.path, G.mode, {
78
+ let n = await ue(G.sandboxId, t, G.sessionId, e.path, G.mode, {
80
79
  accessToken: Ce(),
81
80
  workspaceToken: we()
82
81
  });
@@ -95,14 +94,14 @@ var S = () => {
95
94
  children: w.metadata?.localAction?.kind === "navigate" ? /* @__PURE__ */ y("div", {
96
95
  className: "max-w-[90%] break-words rounded-lg border border-border-subtle bg-bg-sunken/60 px-3 py-2 text-center text-xs leading-relaxed text-text-muted",
97
96
  "data-testid": "assistant-message-system-navigation",
98
- children: /* @__PURE__ */ y(r, { content: w.content })
97
+ children: /* @__PURE__ */ y(i, { content: w.content })
99
98
  }) : /* @__PURE__ */ y("p", {
100
99
  className: "max-w-[90%] whitespace-pre-wrap break-words rounded-lg border border-border-subtle bg-bg-sunken/60 px-3 py-2 text-center text-xs leading-relaxed text-text-muted",
101
100
  children: w.content
102
101
  })
103
102
  });
104
103
  if (W) {
105
- let e = w.metadata?.attachments ?? [], t = c(w.metadata?.askAbout);
104
+ let e = w.metadata?.attachments ?? [], t = l(w.metadata?.askAbout);
106
105
  return /* @__PURE__ */ y("div", {
107
106
  className: "flex justify-end",
108
107
  "data-testid": "assistant-message-user",
@@ -119,9 +118,9 @@ var S = () => {
119
118
  t ? /* @__PURE__ */ y("div", {
120
119
  className: "mt-1 flex justify-end",
121
120
  "data-testid": "assistant-message-focus",
122
- children: /* @__PURE__ */ y(te, { focus: t })
121
+ children: /* @__PURE__ */ y(c, { focus: t })
123
122
  }) : null,
124
- /* @__PURE__ */ y(ee, { attachments: e }),
123
+ /* @__PURE__ */ y(te, { attachments: e }),
125
124
  /* @__PURE__ */ y("div", {
126
125
  className: "mt-1 pe-1 text-end text-[10px] text-text-muted",
127
126
  children: $
@@ -133,14 +132,14 @@ var S = () => {
133
132
  return /* @__PURE__ */ b("div", {
134
133
  className: "flex gap-2.5",
135
134
  "data-testid": "assistant-message-assistant",
136
- children: [/* @__PURE__ */ y(n, { active: E }), /* @__PURE__ */ b("div", {
135
+ children: [/* @__PURE__ */ y(r, { active: E }), /* @__PURE__ */ b("div", {
137
136
  className: "min-w-0 flex-1",
138
137
  children: [
139
- Y.length > 0 && /* @__PURE__ */ y(ie, {
138
+ Y.length > 0 && /* @__PURE__ */ y(ae, {
140
139
  steps: Y,
141
- live: ce(w, q)
140
+ live: le(w, q)
142
141
  }),
143
- G?.pendingWrite && !j ? /* @__PURE__ */ y(s, {
142
+ G?.pendingWrite && !j ? /* @__PURE__ */ y(ee, {
144
143
  pendingWrite: G.pendingWrite,
145
144
  onApprove: u,
146
145
  approving: x !== null && x === G.pendingWrite.reference,
@@ -152,12 +151,12 @@ var S = () => {
152
151
  M,
153
152
  X && /* @__PURE__ */ y("div", {
154
153
  className: "text-[15px] leading-relaxed text-text-primary",
155
- children: /* @__PURE__ */ y(i, {
154
+ children: /* @__PURE__ */ y(a, {
156
155
  content: X,
157
156
  streaming: !!E
158
157
  })
159
158
  }),
160
- J.kind === "working" && /* @__PURE__ */ y(oe, { processing: q }),
159
+ J.kind === "working" && /* @__PURE__ */ y(se, { processing: q }),
161
160
  J.kind === "stopped" && /* @__PURE__ */ y("p", {
162
161
  className: "text-[15px] leading-relaxed text-text-secondary",
163
162
  "data-testid": "assistant-turn-stopped",
@@ -186,10 +185,10 @@ var S = () => {
186
185
  }), /* @__PURE__ */ y("div", {
187
186
  className: "flex flex-wrap gap-2",
188
187
  children: K.map((e) => {
189
- let t = `${e.name}${e.type === "directory" ? ".tar.gz" : ""}`, n = Te === e.path;
190
- return /* @__PURE__ */ y(d, {
188
+ let t = `${e.name}${e.type === "directory" ? ".tar.gz" : ""}`, r = Te === e.path;
189
+ return /* @__PURE__ */ y(n, {
191
190
  label: t,
192
- disabled: n,
191
+ disabled: r,
193
192
  testId: `assistant-artifact-${e.name}`,
194
193
  source: {
195
194
  kind: "sandbox-artifact",
@@ -218,7 +217,7 @@ var S = () => {
218
217
  Q.trim() && V.isSupported && (() => {
219
218
  let e = V.blockedFor(z) ?? V.disabledReason, t = V.isSpeaking(w.id) || V.isSpeaking(B.current), n = !!e && !!k, r = n ? `speak-reason-${w.id}` : void 0, i = n ? null : V.deviceFallbackFor(z), a = i ? `speak-fallback-${w.id}` : void 0;
220
219
  return /* @__PURE__ */ b(v, { children: [
221
- /* @__PURE__ */ y(l, {
220
+ /* @__PURE__ */ y(ne, {
222
221
  isSpeaking: t,
223
222
  disabled: e !== null,
224
223
  disabledReason: e,
@@ -4,69 +4,70 @@ import { useAssistantTr as n } from "../i18n.js";
4
4
  import { useLiveOverlay as r } from "../liveOverlay.js";
5
5
  import { approvalFollowUpReplyIds as i, approvedPendingWriteIds as a, goAheadSentReplyIds as o } from "../liveTurns.js";
6
6
  import { scrollToEndWithin as s } from "./scrollWithin.js";
7
- import { useEffect as c, useRef as l } from "react";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
+ import { PAGE_SCROLL_GUTTER as c, useAssistantPageLayout as l } from "./assistantPageLayout.js";
8
+ import { useEffect as u, useRef as d } from "react";
9
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
10
  // src/shared/assistant/ui/AssistantMessageList.tsx
10
- var f = 250, p = ({ onApprovePendingWrite: f, approvingWriteRef: p = null, approvableMessageId: m = null, retryableMessageId: h = null, messages: g, processing: _, streamingMessageId: v, failedMessageId: y, onRetry: b, renderWriteProposals: x, hidesLegacyWriteCard: S, renderUiOffers: C, onStopTurn: w, stopTurnLabel: T }) => {
11
- let E = n(), D = (() => {
12
- for (let e = g.length - 1; e >= 0; --e) if (g[e].role === "assistant") return g[e].id;
11
+ var m = 250, h = ({ onApprovePendingWrite: m, approvingWriteRef: h = null, approvableMessageId: g = null, retryableMessageId: _ = null, messages: v, processing: y, streamingMessageId: b, failedMessageId: x, onRetry: S, renderWriteProposals: C, hidesLegacyWriteCard: w, renderUiOffers: T, onStopTurn: E, stopTurnLabel: D }) => {
12
+ let O = n(), k = l(), A = (() => {
13
+ for (let e = v.length - 1; e >= 0; --e) if (v[e].role === "assistant") return v[e].id;
13
14
  return null;
14
- })(), O = a(g), k = o(g), A = i(g), j = l(null);
15
- c(() => {
16
- let e = j.current;
15
+ })(), j = a(v), M = o(v), N = i(v), P = d(null);
16
+ u(() => {
17
+ let e = P.current;
17
18
  if (e && e.scrollHeight - e.scrollTop - e.clientHeight < 100) {
18
19
  let n = t();
19
20
  s(e, { behavior: n ? "auto" : "smooth" });
20
21
  }
21
- }, [g, v]);
22
- let M = r((e) => e.byMessageId), N = v === null ? null : M[v]?.content ?? null, P = l(0), F = l(null);
23
- return c(() => {
24
- if (N === null) return;
22
+ }, [v, b]);
23
+ let F = r((e) => e.byMessageId), I = b === null ? null : F[b]?.content ?? null, L = d(0), R = d(null);
24
+ return u(() => {
25
+ if (I === null) return;
25
26
  let e = () => {
26
- F.current = null, P.current = Date.now();
27
- let e = j.current;
27
+ R.current = null, L.current = Date.now();
28
+ let e = P.current;
28
29
  e && e.scrollHeight - e.scrollTop - e.clientHeight < 100 && s(e, { behavior: "auto" });
29
- }, t = P.current + 250 - Date.now();
30
- t <= 0 ? e() : F.current === null && (F.current = setTimeout(e, t));
31
- }, [N]), c(() => () => {
32
- F.current !== null && clearTimeout(F.current);
33
- }, []), c(() => {
34
- j.current && s(j.current, { behavior: "instant" });
35
- }, []), /* @__PURE__ */ d("div", {
36
- ref: j,
37
- className: "scrollbar-slim flex-1 space-y-4 overflow-y-auto p-3",
30
+ }, t = L.current + 250 - Date.now();
31
+ t <= 0 ? e() : R.current === null && (R.current = setTimeout(e, t));
32
+ }, [I]), u(() => () => {
33
+ R.current !== null && clearTimeout(R.current);
34
+ }, []), u(() => {
35
+ P.current && s(P.current, { behavior: "instant" });
36
+ }, []), /* @__PURE__ */ p("div", {
37
+ ref: P,
38
+ className: k ? `scrollbar-slim flex-1 space-y-4 overflow-y-auto py-3 ${c}` : "scrollbar-slim flex-1 space-y-4 overflow-y-auto p-3",
38
39
  role: "log",
39
40
  "aria-live": "polite",
40
41
  "aria-relevant": "additions",
41
- "aria-busy": v !== null,
42
- "aria-label": E("messageList.ariaLabel", "Conversation messages"),
43
- children: [g.map((t) => {
44
- let n = O.has(t.id), r = !n && (t.id === m || t.id === v);
45
- return /* @__PURE__ */ u(e, {
46
- onApprovePendingWrite: r ? f : void 0,
47
- approvingWriteRef: p,
42
+ "aria-busy": b !== null,
43
+ "aria-label": O("messageList.ariaLabel", "Conversation messages"),
44
+ children: [v.map((t) => {
45
+ let n = j.has(t.id), r = !n && (t.id === g || t.id === b);
46
+ return /* @__PURE__ */ f(e, {
47
+ onApprovePendingWrite: r ? m : void 0,
48
+ approvingWriteRef: h,
48
49
  pendingWriteApproved: n,
49
- pendingWriteGoAheadSent: k.has(t.id),
50
+ pendingWriteGoAheadSent: M.has(t.id),
50
51
  pendingWriteExpired: !n && !r,
51
- message: t.id === v && N !== null ? {
52
+ message: t.id === b && I !== null ? {
52
53
  ...t,
53
- content: N
54
+ content: I
54
55
  } : t,
55
- processing: _,
56
- isStreaming: t.id === v,
57
- isFailed: t.id === y,
58
- isLastAssistant: t.id === h,
59
- isNewestAssistant: t.id === D,
60
- onRetry: A.has(t.id) ? void 0 : b,
61
- legacyWriteCardHidden: S?.(t) ?? !1,
62
- writeProposals: x?.(t),
63
- uiOffers: C?.(t),
64
- ...t.id === v && w !== void 0 ? {
65
- onStopTurn: w,
66
- stopTurnLabel: T
56
+ processing: y,
57
+ isStreaming: t.id === b,
58
+ isFailed: t.id === x,
59
+ isLastAssistant: t.id === _,
60
+ isNewestAssistant: t.id === A,
61
+ onRetry: N.has(t.id) ? void 0 : S,
62
+ legacyWriteCardHidden: w?.(t) ?? !1,
63
+ writeProposals: C?.(t),
64
+ uiOffers: T?.(t),
65
+ ...t.id === b && E !== void 0 ? {
66
+ onStopTurn: E,
67
+ stopTurnLabel: D
67
68
  } : {}
68
69
  }, t.id);
69
- }), /* @__PURE__ */ u("div", {})]
70
+ }), /* @__PURE__ */ f("div", {})]
70
71
  });
71
72
  };
72
- export { p as AssistantMessageList, f as LIVE_SCROLL_GAP_MS };
73
+ export { h as AssistantMessageList, m as LIVE_SCROLL_GAP_MS };