@burdenoff/fe-libs 2026.1113.11 → 2026.1114.2

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 (52) hide show
  1. package/README.md +55 -8
  2. package/dist/admin-overview/AdminOverviewList.d.ts +8 -0
  3. package/dist/admin-overview/AdminOverviewList.js +217 -0
  4. package/dist/admin-overview/AdminOverviewPage.d.ts +7 -0
  5. package/dist/admin-overview/AdminOverviewPage.js +286 -199
  6. package/dist/admin-overview/adminOverviewModel.d.ts +44 -0
  7. package/dist/admin-overview/adminOverviewModel.js +48 -0
  8. package/dist/admin-overview/nodes/ProjectNode.js +30 -29
  9. package/dist/admin-overview/nodes/TenantNode.js +33 -32
  10. package/dist/admin-overview/operations.d.ts +10 -0
  11. package/dist/admin-overview/operations.js +41 -2
  12. package/dist/node_modules/pdfjs-dist/build/pdf.js +21 -0
  13. package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +21 -0
  14. package/dist/platform-pages/AcceptShareRoute.js +15 -16
  15. package/dist/platform-pages/AffiliatesPage.js +4 -5
  16. package/dist/shared/assistant/createSandboxAssistantTransport.js +0 -1
  17. package/dist/shared/assistant/index.d.ts +1 -0
  18. package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +4 -23
  19. package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +52 -55
  20. package/dist/shared/assistant/ui/AssistantMessageItem.js +37 -38
  21. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +24 -25
  22. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +3 -3
  23. package/dist/shared/assistant/ui/composer/connectSource.js +1 -2
  24. package/dist/shared/assistant/uiActions/assistantHref.d.ts +2 -30
  25. package/dist/shared/assistant/uiActions/assistantHref.js +7 -43
  26. package/dist/shared/assistant/uiActions/assistantLinkNavigation.d.ts +12 -0
  27. package/dist/shared/assistant/uiActions/assistantLinkNavigation.js +42 -0
  28. package/dist/shared/assistant/uiActions/inAppLinks.js +9 -8
  29. package/dist/shared/components/ContextConversationWidget.js +6 -7
  30. package/dist/shared/components/assistantWidget/MessageContent.js +3 -4
  31. package/dist/shared/components/contextConversationWidget/Composer.js +9 -10
  32. package/dist/shared/components/contextConversationWidget/MessageItem.js +0 -1
  33. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +0 -1
  34. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +0 -1
  35. package/dist/shared/components/contextConversationWidget/ReplyBanner.js +0 -1
  36. package/dist/shared/components/contextConversationWidget/WidgetHeader.js +8 -9
  37. package/dist/shared/hooks/usePushDeviceRegistration.js +9 -10
  38. package/dist/shared/hooks/useRecordProductVisit.js +8 -9
  39. package/dist/shared/tours/ToursContext.js +6 -7
  40. package/dist/shared-assistant.js +160 -159
  41. package/dist/shared-hooks.js +10 -12
  42. package/dist/shared-plugins.js +0 -1
  43. package/dist/shared-providers-shell.js +7 -8
  44. package/dist/shared.js +83 -87
  45. package/dist/third-party/pdfjs-dist/ATTRIBUTION.txt +54 -0
  46. package/dist/third-party/pdfjs-dist/LICENSE +177 -0
  47. package/dist/third-party/pdfjs-dist/manifest.json +19 -0
  48. package/dist/utils/index.js +1 -1
  49. package/package.json +29 -2
  50. package/dist/shared/actors/index.js +0 -3
  51. package/dist/shared/assistant/speech/index.js +0 -6
  52. package/dist/shared/plugins/iframe-mount/index.js +0 -5
@@ -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,
@@ -1,10 +1,9 @@
1
1
  import { useI18n as e } from "../../providers/shell/I18nProvider.js";
2
2
  import { useAssistantStore as t } from "../store.js";
3
3
  import { voicePreviewText as n } from "../voice/voicePreview.js";
4
- import "../speech/index.js";
5
- import { HOSTED_VOICES as r } from "../speech/hostedVoiceCatalogue.js";
6
- import { speechFeed as i } from "../speech/speechFeed.js";
7
- import { getSpeechEngine as a, subscribeSpeechEngine as o } from "../speech/createSpeechEngine.js";
4
+ import { getSpeechEngine as r, subscribeSpeechEngine as i } from "../speech/createSpeechEngine.js";
5
+ import { HOSTED_VOICES as a } from "../speech/hostedVoiceCatalogue.js";
6
+ import { speechFeed as o } from "../speech/speechFeed.js";
8
7
  import { hasPendingReplyRequests as s, releaseReplyRequestsOutside as c, replyWantsAvatar as ee, settleReplyRequest as l, subscribeReplyRequests as u } from "../speech/replySpeechRequests.js";
9
8
  import { chunkForSpeech as te, toSpeakableText as d } from "../voice/speakableText.js";
10
9
  import { createPhrasePlayback as ne } from "../voice/phrasePlayback.js";
@@ -86,7 +85,7 @@ function D() {
86
85
  return xe(je);
87
86
  }
88
87
  var O = ({ children: s, visible: u = !0, engine: be }) => {
89
- let xe = Ce(o, a, a), E = be ?? xe, D = ye(), { locale: O } = e(), [k, A] = Se(y, _), [j, M] = T(() => E.listVoices()), [N, Me] = T(!1), [Ne, P] = T(() => /* @__PURE__ */ new Map()), [Pe, Fe] = T(() => /* @__PURE__ */ new Set()), [Ie, Le] = T(null), F = w(0), Re = w(null), ze = w(null), I = w(void 0), L = w(null), R = w(null), z = w(/* @__PURE__ */ new Set()), B = w(null);
88
+ let xe = Ce(i, r, r), E = be ?? xe, D = ye(), { locale: O } = e(), [k, A] = Se(y, _), [j, M] = T(() => E.listVoices()), [N, Me] = T(!1), [Ne, P] = T(() => /* @__PURE__ */ new Map()), [Pe, Fe] = T(() => /* @__PURE__ */ new Set()), [Ie, Le] = T(null), F = w(0), Re = w(null), ze = w(null), I = w(void 0), L = w(null), R = w(null), z = w(/* @__PURE__ */ new Set()), B = w(null);
90
89
  S(() => () => {
91
90
  B.current !== null && clearTimeout(B.current);
92
91
  }, []);
@@ -161,13 +160,13 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
161
160
  o = E.subscribeVoices(() => s(E.listVoices())), V.current = () => {
162
161
  a || (a = !0, clearTimeout(c), o(), V.current = null, l(e, "stopped"));
163
162
  };
164
- }, [H, E]), ct = x((e, t, n, a, o = !1, s, c = !1) => {
163
+ }, [H, E]), ct = x((e, t, n, r, i = !1, s, c = !1) => {
165
164
  let u = n;
166
165
  if (u.length === 0) {
167
166
  let e = E.listVoices();
168
167
  e.length > 0 && (u = e, M(e));
169
168
  }
170
- let d = $e(a), f = oe(ce(!0, u, a, N));
169
+ let d = $e(r), f = oe(ce(!0, u, r, N));
171
170
  if (f === "block") {
172
171
  let t = D("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: ie(d, O) });
173
172
  P((n) => new Map(n).set(e, t)), l(e, "declined");
@@ -175,15 +174,15 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
175
174
  }
176
175
  if (c && (f !== "speak" || !E.open)) return;
177
176
  if (f === "wait-for-voices") {
178
- st(e, t, a, o, s);
177
+ st(e, t, r, i, s);
179
178
  return;
180
179
  }
181
180
  let p = {
182
- voice: ae(u, d, K[a]),
181
+ voice: ae(u, d, K[r]),
183
182
  lang: d,
184
- rate: et(a)
183
+ rate: et(r)
185
184
  }, re = ut.current;
186
- if (o && !re.autoSpeakEnabled && !re.sessionSpeaking && ee(e)) {
185
+ if (i && !re.autoSpeakEnabled && !re.sessionSpeaking && ee(e)) {
187
186
  if (E.wouldSpeakOnAvatar?.(p) !== !0) {
188
187
  l(e, "declined");
189
188
  return;
@@ -195,7 +194,7 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
195
194
  let n = new Map(t);
196
195
  return n.delete(e), n;
197
196
  });
198
- let se = K[a], le = typeof se == "string" && r.some((e) => e.name === se) && !u.some((e) => e.name === se);
197
+ let se = K[r], le = typeof se == "string" && a.some((e) => e.name === se) && !u.some((e) => e.name === se);
199
198
  Fe((t) => {
200
199
  if (t.has(e) === le) return t;
201
200
  let n = new Set(t);
@@ -206,8 +205,8 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
206
205
  type: "start",
207
206
  messageId: e,
208
207
  requestId: m
209
- }), ze.current = o ? m : null, o && ge(e, "ttsStarted"), b(I.current, "stopped");
210
- let h = o ? void 0 : me(e);
208
+ }), ze.current = i ? m : null, i && ge(e, "ttsStarted"), b(I.current, "stopped");
209
+ let h = i ? void 0 : me(e);
211
210
  I.current = h;
212
211
  let g = s === void 0 ? te(t) : te(t, void 0, void 0, { firstChunkMaxChars: s });
213
212
  Ve({
@@ -218,7 +217,7 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
218
217
  c || Ve((e) => e?.requestId === m && e.index < 0 ? null : e);
219
218
  }, Ee);
220
219
  let _ = !1, v = (t = "ended") => {
221
- _ || (_ = !0, c && F.current === m && (R.current = null, i.audio(e, t)));
220
+ _ || (_ = !0, c && F.current === m && (R.current = null, o.audio(e, t)));
222
221
  }, ue = () => {
223
222
  b(h, "failed"), v(), F.current === m && B.current !== null && (clearTimeout(B.current), B.current = null), l(e, "failed"), A({
224
223
  type: "failed",
@@ -231,7 +230,7 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
231
230
  F.current === m && b(h, "answered"), F.current === m && ze.current === m && ge(e, "firstAudio");
232
231
  },
233
232
  onChunkStart: (t) => {
234
- y = !0, c && F.current === m && (i.peek(e)?.final === !1 && he(e, { spokeNarration: !0 }), i.audio(e, "started")), F.current === m && B.current !== null && (clearTimeout(B.current), B.current = null), Ve((e) => e?.requestId === m ? {
233
+ y = !0, c && F.current === m && (o.peek(e)?.final === !1 && he(e, { spokeNarration: !0 }), o.audio(e, "started")), F.current === m && B.current !== null && (clearTimeout(B.current), B.current = null), Ve((e) => e?.requestId === m ? {
235
234
  ...e,
236
235
  index: t
237
236
  } : F.current === m ? {
@@ -241,7 +240,7 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
241
240
  } : e);
242
241
  },
243
242
  onPause: () => {
244
- c && F.current === m && i.audio(e, "paused");
243
+ c && F.current === m && o.audio(e, "paused");
245
244
  },
246
245
  onDeviceFallback: () => {
247
246
  F.current === m && Fe((t) => t.has(e) ? t : new Set(t).add(e));
@@ -264,21 +263,21 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
264
263
  }
265
264
  };
266
265
  if (c && E.open) {
267
- let r = E.open.bind(E);
268
- i.audio(e, "queued");
269
- let o = ne((e) => r(p, e), n, (e) => {
266
+ let i = E.open.bind(E);
267
+ o.audio(e, "queued");
268
+ let a = ne((e) => i(p, e), n, (e) => {
270
269
  g = [...e], Ve((e) => e?.requestId === m ? {
271
270
  ...e,
272
271
  chunks: g
273
272
  } : e);
274
273
  }, () => he(e, { speechDivergence: !0 }));
275
- _ ? o.cancel() : (R.current = {
274
+ _ ? a.cancel() : (R.current = {
276
275
  messageId: e,
277
276
  requestId: m,
278
- locale: a,
279
- playback: o,
277
+ locale: r,
278
+ playback: a,
280
279
  notifyEnded: v
281
- }, o.append(t));
280
+ }, a.append(t));
282
281
  } else E.speak(g, p, n);
283
282
  } catch {
284
283
  ue();
@@ -474,7 +473,7 @@ var O = ({ children: s, visible: u = !0, engine: be }) => {
474
473
  E,
475
474
  nt
476
475
  ]);
477
- S(() => i.subscribe(ht), [ht]);
476
+ S(() => o.subscribe(ht), [ht]);
478
477
  let gt = C(() => le(j, q.tag), [j, q]), _t = C(() => ae(j, q.tag, K[J]), [
479
478
  j,
480
479
  q,
@@ -1,5 +1,5 @@
1
- import { useAssistantTr as e } from "../../i18n.js";
2
- import { assistantRoutePath as t, classifyAssistantHref as n } from "../../uiActions/assistantHref.js";
1
+ import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/assistantLinkNavigation.js";
2
+ import { useAssistantTr as n } from "../../i18n.js";
3
3
  import { useAssistantNavigate as r } from "../AssistantMarkdownRenderer.js";
4
4
  import { connectSourceHrefRenders as i, useAssistantConnectSource as a } from "./connectSource.js";
5
5
  import { useCallback as o } from "react";
@@ -15,7 +15,7 @@ var d = "flex w-full items-center gap-2.5 border-t border-border-subtle px-3 py-
15
15
  menuitem: "assistant-connect-source",
16
16
  action: "assistant-connect-source-action"
17
17
  }, m = ({ onActivate: m, presentation: h = "menuitem" }) => {
18
- let g = e(), { href: _, open: v } = a(), y = r(), b = n(_), x = b === "internal" ? t(_) : null, S = o((e) => {
18
+ let g = n(), { href: _, open: v } = a(), y = r(), b = t(_), x = b === "internal" ? e(_) : null, S = o((e) => {
19
19
  e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (m?.(), y && x && (e.preventDefault(), Promise.resolve(y(x, "person", { surface: "connect-source" })).catch(() => void 0)));
20
20
  }, [
21
21
  y,
@@ -1,5 +1,4 @@
1
- import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/assistantHref.js";
2
- import "../AssistantMarkdownRenderer.js";
1
+ import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/assistantLinkNavigation.js";
3
2
  import { createContext as n, useContext as r, useMemo as i } from "react";
4
3
  import { jsx as a } from "react/jsx-runtime";
5
4
  // src/shared/assistant/ui/composer/connectSource.tsx
@@ -1,35 +1,7 @@
1
1
  import { Options } from 'react-markdown';
2
+ export { assistantRoutePath, classifyAssistantHref } from './assistantLinkNavigation';
3
+ export type { AssistantLinkKind } from './assistantLinkNavigation';
2
4
  /** @internal Exported for unit tests; not part of the module's public surface. */
3
5
  export declare function transformAssistantUrl(url: string, key: string, tagName: string): string;
4
6
  /** @internal The react-markdown option form of `transformAssistantUrl`. */
5
7
  export declare const assistantUrlTransform: Options['urlTransform'];
6
- /**
7
- * How a link in an assistant reply should be treated.
8
- *
9
- * ★★ `href.startsWith("/")` IS NOT AN INTERNAL TEST. A protocol-relative URL —
10
- * `//evil.example/path` — has no colon, so react-markdown's `defaultUrlTransform`
11
- * returns it verbatim and the sanitizer passes it through; the browser then
12
- * resolves it against the page's SCHEME and lands on another origin. Treating
13
- * that as internal would hand an attacker-authored destination to the router.
14
- * So the decision is made by RESOLVING the href and comparing origins.
15
- *
16
- * ★ This runs AFTER the sanitizer, so anything with an unsafe scheme has already
17
- * been reduced to an empty string upstream — `blocked` here is the empty case,
18
- * not a second scheme allow-list. The scheme policy stays in one place.
19
- */
20
- export type AssistantLinkKind = 'internal' | 'external' | 'fragment' | 'blocked';
21
- export declare function classifyAssistantHref(href: string | null | undefined, baseOrigin?: string): AssistantLinkKind;
22
- /**
23
- * The router-ready path for an href already classified as `internal`, or null if
24
- * it cannot be resolved.
25
- *
26
- * ★★ WHY THIS IS NOT THE HREF. An internal link may be written absolutely —
27
- * `https://app.example.com/fields?q=1#top` is same-origin, so it classifies as
28
- * internal — and every SPA router reads a `to`/`navigate()` string as a PATH.
29
- * Handing it the absolute form routes to a literal `/https://app.example.com/...`
30
- * segment. Resolving here means each product wires one line and cannot get this
31
- * wrong; the alternative is the same five lines re-derived in every product,
32
- * with only the ones whose assistant happened to emit an absolute URL finding
33
- * out they got it wrong.
34
- */
35
- export declare function assistantRoutePath(href: string | null | undefined, baseOrigin?: string): string | null;