@burdenoff/fe-libs 2026.909.3 → 2026.910.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.
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/stageCopy.d.ts +123 -0
- package/dist/shared/assistant/stageCopy.d.ts.map +1 -0
- package/dist/shared/assistant/stageCopy.js +97 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +9 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +45 -41
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +296 -294
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +35 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +116 -71
- package/dist/shared/graphql/security.js +1 -1
- package/dist/shared-assistant.js +54 -53
- package/package.json +1 -1
|
@@ -1,10 +1,44 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { Options } from 'react-markdown';
|
|
3
3
|
interface Props {
|
|
4
4
|
content: string;
|
|
5
5
|
}
|
|
6
6
|
/** @internal Exported for unit tests; not part of the module's public surface. */
|
|
7
7
|
export declare const assistantUrlTransform: Options["urlTransform"];
|
|
8
|
+
/**
|
|
9
|
+
* How a link in an assistant reply should be treated.
|
|
10
|
+
*
|
|
11
|
+
* ★★ `href.startsWith("/")` IS NOT AN INTERNAL TEST. A protocol-relative URL —
|
|
12
|
+
* `//evil.example/path` — has no colon, so react-markdown's `defaultUrlTransform`
|
|
13
|
+
* returns it verbatim and the sanitizer passes it through; the browser then
|
|
14
|
+
* resolves it against the page's SCHEME and lands on another origin. Treating
|
|
15
|
+
* that as internal would hand an attacker-authored destination to the router.
|
|
16
|
+
* So the decision is made by RESOLVING the href and comparing origins.
|
|
17
|
+
*
|
|
18
|
+
* ★ This runs AFTER the sanitizer, so anything with an unsafe scheme has already
|
|
19
|
+
* been reduced to an empty string upstream — `blocked` here is the empty case,
|
|
20
|
+
* not a second scheme allow-list. The scheme policy stays in one place.
|
|
21
|
+
*/
|
|
22
|
+
export type AssistantLinkKind = "internal" | "external" | "fragment" | "blocked";
|
|
23
|
+
/** Route an in-app href. Supplied by the product; absent means "no SPA routing". */
|
|
24
|
+
export type AssistantNavigate = (href: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ★ `baseOrigin` is threaded rather than left to `isSafeRedirectTarget`'s own
|
|
27
|
+
* `window.location.origin` default so this stays callable — and testable — with
|
|
28
|
+
* no DOM. With no origin to compare against we cannot prove a link is internal,
|
|
29
|
+
* so it degrades to `external`: a new tab is the safe direction to fail.
|
|
30
|
+
*/
|
|
31
|
+
export declare function classifyAssistantHref(href: string | null | undefined, baseOrigin?: string): AssistantLinkKind;
|
|
32
|
+
/**
|
|
33
|
+
* ★ Context, not a prop: the renderer is reached by TWO paths — the chat
|
|
34
|
+
* transcript and the voice transcript drawer — and threading a prop through
|
|
35
|
+
* both spines means the next surface silently ships links that reload the app.
|
|
36
|
+
*/
|
|
37
|
+
export declare const AssistantNavigateProvider: FC<{
|
|
38
|
+
value?: AssistantNavigate;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}>;
|
|
41
|
+
export declare function useAssistantNavigate(): AssistantNavigate | null;
|
|
8
42
|
export declare const AssistantMarkdownRenderer: FC<Props>;
|
|
9
43
|
export {};
|
|
10
44
|
//# sourceMappingURL=AssistantMarkdownRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMarkdownRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AssistantMarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMarkdownRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAIL,KAAK,EAAE,EAEP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAiB,EAIf,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AASxB,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAqDD,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,cAAc,CAWzD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjF,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAUvD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,iBAAiB,CASnB;AAoBD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC;IACzC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAIA,CAAC;AAEF,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAE/D;AAgTD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,KAAK,CAiB/C,CAAC"}
|
|
@@ -1,52 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import n from "../../../node_modules/
|
|
3
|
-
import
|
|
4
|
-
import i from "../../../node_modules/
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { isSafeRedirectTarget as e } from "../../graphql/security.js";
|
|
2
|
+
import { Markdown as t, defaultUrlTransform as n } from "../../../node_modules/react-markdown/lib/index.js";
|
|
3
|
+
import r from "../../../node_modules/remark-gfm/lib/index.js";
|
|
4
|
+
import { defaultSchema as i } from "../../../node_modules/hast-util-sanitize/lib/schema.js";
|
|
5
|
+
import a from "../../../node_modules/rehype-sanitize/lib/index.js";
|
|
6
|
+
import { useAssistantTr as o } from "../i18n.js";
|
|
7
|
+
import { copyToClipboard as s } from "../clipboard.js";
|
|
8
|
+
import { AssistantMarkdownImage as c } from "./AssistantMarkdownImage.js";
|
|
9
|
+
import { createContext as l, useContext as u, useState as d } from "react";
|
|
10
|
+
import { Check as f, Copy as p } from "lucide-react";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
12
|
//#region src/shared/assistant/ui/AssistantMarkdownRenderer.tsx
|
|
12
|
-
var
|
|
13
|
-
...
|
|
13
|
+
var _ = {
|
|
14
|
+
...i,
|
|
14
15
|
protocols: {
|
|
15
|
-
...
|
|
16
|
-
src: [...
|
|
16
|
+
...i.protocols,
|
|
17
|
+
src: [...i.protocols?.src ?? [], "data"]
|
|
17
18
|
}
|
|
18
|
-
},
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
}, v = /^data:image\/(?:png|jpe?g|gif|webp|avif|bmp);base64,[A-Za-z0-9+/=\s]+$/, y = (e, t, r) => t === "src" && r.tagName === "img" && v.test(e) ? e : n(e);
|
|
20
|
+
function b() {
|
|
21
|
+
try {
|
|
22
|
+
return typeof window > "u" ? null : window.location.origin;
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function x(t, n) {
|
|
28
|
+
let r = (t ?? "").trim();
|
|
29
|
+
if (!r) return "blocked";
|
|
30
|
+
if (r.startsWith("#")) return "fragment";
|
|
31
|
+
let i = n ?? b();
|
|
32
|
+
return i && e(r, i) ? "internal" : "external";
|
|
33
|
+
}
|
|
34
|
+
function S(e) {
|
|
35
|
+
return e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
36
|
+
}
|
|
37
|
+
var C = l(null), w = ({ value: e, children: t }) => /* @__PURE__ */ h(C.Provider, {
|
|
38
|
+
value: e ?? null,
|
|
39
|
+
children: t
|
|
40
|
+
});
|
|
41
|
+
function T() {
|
|
42
|
+
return u(C);
|
|
43
|
+
}
|
|
44
|
+
var E = "text-action-primary-bg underline-offset-2 hover:underline", D = ({ href: e, children: t }) => {
|
|
45
|
+
let n = T(), r = x(e);
|
|
46
|
+
return r === "blocked" ? /* @__PURE__ */ h(m, { children: t }) : r === "internal" && n ? /* @__PURE__ */ h("a", {
|
|
47
|
+
href: e,
|
|
48
|
+
className: E,
|
|
49
|
+
"data-testid": "assistant-markdown-link",
|
|
50
|
+
onClick: (t) => {
|
|
51
|
+
S(t) || (t.preventDefault(), n(e));
|
|
52
|
+
},
|
|
53
|
+
children: t
|
|
54
|
+
}) : r === "internal" || r === "fragment" ? /* @__PURE__ */ h("a", {
|
|
55
|
+
href: e,
|
|
56
|
+
className: E,
|
|
57
|
+
"data-testid": "assistant-markdown-link",
|
|
58
|
+
children: t
|
|
59
|
+
}) : /* @__PURE__ */ h("a", {
|
|
60
|
+
href: e,
|
|
61
|
+
target: "_blank",
|
|
62
|
+
rel: "noopener noreferrer",
|
|
63
|
+
className: E,
|
|
64
|
+
"data-testid": "assistant-markdown-link",
|
|
65
|
+
children: t
|
|
66
|
+
});
|
|
67
|
+
}, O = [r], k = [[a, _]];
|
|
68
|
+
function A({ language: e, code: t }) {
|
|
69
|
+
let n = o(), [r, i] = d(!1);
|
|
70
|
+
return /* @__PURE__ */ g("div", {
|
|
22
71
|
className: "group relative my-2 overflow-hidden rounded-md border border-border-default bg-bg-sunken",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ g("div", {
|
|
24
73
|
className: "flex items-center justify-between border-b border-border-default bg-bg-elevated px-3 py-1.5",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ h("span", {
|
|
26
75
|
className: "font-mono text-[10px] uppercase tracking-wider text-text-muted",
|
|
27
76
|
children: e || "code"
|
|
28
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ h("button", {
|
|
29
78
|
type: "button",
|
|
30
79
|
onClick: () => {
|
|
31
|
-
|
|
80
|
+
s(t).then((e) => {
|
|
32
81
|
e && (i(!0), setTimeout(() => i(!1), 2e3));
|
|
33
82
|
});
|
|
34
83
|
},
|
|
35
84
|
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",
|
|
36
85
|
"aria-label": n("markdown.copyCode", "Copy code"),
|
|
37
86
|
"data-testid": "assistant-markdown-copy-code",
|
|
38
|
-
children: r ? /* @__PURE__ */
|
|
87
|
+
children: r ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(f, { className: "size-3 text-status-success-text" }), /* @__PURE__ */ h("span", { children: n("markdown.copied", "Copied") })] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(p, { className: "size-3" }), /* @__PURE__ */ h("span", { children: n("markdown.copy", "Copy") })] })
|
|
39
88
|
})]
|
|
40
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ h("pre", {
|
|
41
90
|
className: "overflow-x-auto p-3 text-xs leading-relaxed",
|
|
42
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ h("code", {
|
|
43
92
|
className: "font-mono text-text-primary",
|
|
44
93
|
children: t
|
|
45
94
|
})
|
|
46
95
|
})]
|
|
47
96
|
});
|
|
48
97
|
}
|
|
49
|
-
function
|
|
98
|
+
function j(e) {
|
|
50
99
|
let t = e?.children?.[0];
|
|
51
100
|
if (!t || t.type !== "element" || t.tagName !== "code") return null;
|
|
52
101
|
let n = t.children.map((e) => e.type === "text" ? e.value : "").join(""), r = t.properties?.className, i = (Array.isArray(r) ? r.map(String) : String(r ?? "").split(" ")).find((e) => e.startsWith("language-"));
|
|
@@ -55,10 +104,10 @@ function b(e) {
|
|
|
55
104
|
language: i ? i.slice(9) : ""
|
|
56
105
|
};
|
|
57
106
|
}
|
|
58
|
-
function
|
|
107
|
+
function M(e, t) {
|
|
59
108
|
return typeof e == "string" && e.split(" ").includes(t);
|
|
60
109
|
}
|
|
61
|
-
function
|
|
110
|
+
function N({ level: e, children: t }) {
|
|
62
111
|
let n = `h${e}`, r = {
|
|
63
112
|
2: "text-[1.15em]",
|
|
64
113
|
3: "text-[1.08em]",
|
|
@@ -66,133 +115,129 @@ function S({ level: e, children: t }) {
|
|
|
66
115
|
5: "text-[0.95em]",
|
|
67
116
|
6: "text-[0.9em]"
|
|
68
117
|
}[e];
|
|
69
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ h(n, {
|
|
70
119
|
className: `mb-1 mt-3 font-semibold text-text-primary ${r}`,
|
|
71
120
|
children: t
|
|
72
121
|
});
|
|
73
122
|
}
|
|
74
|
-
var
|
|
75
|
-
a: ({ href: e, children: t }) => /* @__PURE__ */
|
|
123
|
+
var P = {
|
|
124
|
+
a: ({ href: e, children: t }) => /* @__PURE__ */ h(D, {
|
|
76
125
|
href: e,
|
|
77
|
-
target: "_blank",
|
|
78
|
-
rel: "noopener noreferrer",
|
|
79
|
-
className: "text-action-primary-bg underline-offset-2 hover:underline",
|
|
80
|
-
"data-testid": "assistant-markdown-link",
|
|
81
126
|
children: t
|
|
82
127
|
}),
|
|
83
|
-
blockquote: ({ children: e }) => /* @__PURE__ */
|
|
128
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ h("blockquote", {
|
|
84
129
|
className: "my-2 border-l-2 border-action-primary-bg pl-3 italic text-text-secondary",
|
|
85
130
|
children: e
|
|
86
131
|
}),
|
|
87
|
-
code: ({ children: e }) => /* @__PURE__ */
|
|
132
|
+
code: ({ children: e }) => /* @__PURE__ */ h("code", {
|
|
88
133
|
className: "rounded bg-bg-sunken px-1 py-0.5 font-mono text-[0.85em] text-text-primary",
|
|
89
134
|
children: e
|
|
90
135
|
}),
|
|
91
|
-
del: ({ children: e }) => /* @__PURE__ */
|
|
136
|
+
del: ({ children: e }) => /* @__PURE__ */ h("del", {
|
|
92
137
|
className: "text-text-muted line-through",
|
|
93
138
|
children: e
|
|
94
139
|
}),
|
|
95
|
-
em: ({ children: e }) => /* @__PURE__ */
|
|
140
|
+
em: ({ children: e }) => /* @__PURE__ */ h("em", {
|
|
96
141
|
className: "italic",
|
|
97
142
|
children: e
|
|
98
143
|
}),
|
|
99
|
-
h1: ({ children: e }) => /* @__PURE__ */
|
|
144
|
+
h1: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
100
145
|
level: 2,
|
|
101
146
|
children: e
|
|
102
147
|
}),
|
|
103
|
-
h2: ({ children: e }) => /* @__PURE__ */
|
|
148
|
+
h2: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
104
149
|
level: 3,
|
|
105
150
|
children: e
|
|
106
151
|
}),
|
|
107
|
-
h3: ({ children: e }) => /* @__PURE__ */
|
|
152
|
+
h3: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
108
153
|
level: 4,
|
|
109
154
|
children: e
|
|
110
155
|
}),
|
|
111
|
-
h4: ({ children: e }) => /* @__PURE__ */
|
|
156
|
+
h4: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
112
157
|
level: 5,
|
|
113
158
|
children: e
|
|
114
159
|
}),
|
|
115
|
-
h5: ({ children: e }) => /* @__PURE__ */
|
|
160
|
+
h5: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
116
161
|
level: 6,
|
|
117
162
|
children: e
|
|
118
163
|
}),
|
|
119
|
-
h6: ({ children: e }) => /* @__PURE__ */
|
|
164
|
+
h6: ({ children: e }) => /* @__PURE__ */ h(N, {
|
|
120
165
|
level: 6,
|
|
121
166
|
children: e
|
|
122
167
|
}),
|
|
123
|
-
hr: () => /* @__PURE__ */
|
|
124
|
-
img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */
|
|
168
|
+
hr: () => /* @__PURE__ */ h("hr", { className: "my-3 border-border-default" }),
|
|
169
|
+
img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */ h(c, {
|
|
125
170
|
src: typeof e == "string" ? e : void 0,
|
|
126
171
|
alt: t,
|
|
127
172
|
title: n
|
|
128
173
|
}),
|
|
129
|
-
input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */
|
|
174
|
+
input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */ h("input", {
|
|
130
175
|
type: "checkbox",
|
|
131
176
|
checked: !!e,
|
|
132
177
|
disabled: !0,
|
|
133
178
|
className: "mr-1.5 size-3 flex-shrink-0 align-[-0.1em] accent-[var(--color-action-primary-bg)]"
|
|
134
179
|
}) : null,
|
|
135
|
-
li: ({ className: e, children: t }) => /* @__PURE__ */
|
|
136
|
-
className:
|
|
180
|
+
li: ({ className: e, children: t }) => /* @__PURE__ */ h("li", {
|
|
181
|
+
className: M(e, "task-list-item") ? "list-none text-text-primary" : "text-text-primary",
|
|
137
182
|
children: t
|
|
138
183
|
}),
|
|
139
|
-
ol: ({ children: e }) => /* @__PURE__ */
|
|
184
|
+
ol: ({ children: e }) => /* @__PURE__ */ h("ol", {
|
|
140
185
|
className: "my-1.5 ml-5 list-decimal space-y-0.5",
|
|
141
186
|
children: e
|
|
142
187
|
}),
|
|
143
|
-
p: ({ children: e }) => /* @__PURE__ */
|
|
188
|
+
p: ({ children: e }) => /* @__PURE__ */ h("p", {
|
|
144
189
|
className: "my-1.5 leading-relaxed text-text-primary",
|
|
145
190
|
children: e
|
|
146
191
|
}),
|
|
147
192
|
pre: ({ children: e, node: t }) => {
|
|
148
|
-
let n =
|
|
149
|
-
return n ? /* @__PURE__ */
|
|
193
|
+
let n = j(t);
|
|
194
|
+
return n ? /* @__PURE__ */ h(A, {
|
|
150
195
|
language: n.language,
|
|
151
196
|
code: n.code
|
|
152
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ h("pre", {
|
|
153
198
|
className: "my-2 overflow-x-auto rounded-md border border-border-default bg-bg-sunken p-3 text-xs leading-relaxed",
|
|
154
199
|
children: e
|
|
155
200
|
});
|
|
156
201
|
},
|
|
157
|
-
strong: ({ children: e }) => /* @__PURE__ */
|
|
202
|
+
strong: ({ children: e }) => /* @__PURE__ */ h("strong", {
|
|
158
203
|
className: "font-semibold text-text-primary",
|
|
159
204
|
children: e
|
|
160
205
|
}),
|
|
161
|
-
table: ({ children: e }) => /* @__PURE__ */
|
|
206
|
+
table: ({ children: e }) => /* @__PURE__ */ h("div", {
|
|
162
207
|
className: "my-2 overflow-x-auto",
|
|
163
208
|
"data-testid": "assistant-markdown-table",
|
|
164
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ h("table", {
|
|
165
210
|
className: "w-full border-collapse text-[0.9em]",
|
|
166
211
|
children: e
|
|
167
212
|
})
|
|
168
213
|
}),
|
|
169
|
-
td: ({ children: e }) => /* @__PURE__ */
|
|
214
|
+
td: ({ children: e }) => /* @__PURE__ */ h("td", {
|
|
170
215
|
className: "px-2 py-1.5 align-top text-text-primary",
|
|
171
216
|
children: e
|
|
172
217
|
}),
|
|
173
|
-
th: ({ children: e }) => /* @__PURE__ */
|
|
218
|
+
th: ({ children: e }) => /* @__PURE__ */ h("th", {
|
|
174
219
|
scope: "col",
|
|
175
220
|
className: "px-2 py-1.5 text-left font-semibold text-text-primary",
|
|
176
221
|
children: e
|
|
177
222
|
}),
|
|
178
|
-
tr: ({ children: e }) => /* @__PURE__ */
|
|
223
|
+
tr: ({ children: e }) => /* @__PURE__ */ h("tr", {
|
|
179
224
|
className: "border-b border-border-subtle",
|
|
180
225
|
children: e
|
|
181
226
|
}),
|
|
182
|
-
ul: ({ className: e, children: t }) => /* @__PURE__ */
|
|
183
|
-
className:
|
|
227
|
+
ul: ({ className: e, children: t }) => /* @__PURE__ */ h("ul", {
|
|
228
|
+
className: M(e, "contains-task-list") ? "my-1.5 ml-0.5 list-none space-y-0.5" : "my-1.5 ml-5 list-disc space-y-0.5",
|
|
184
229
|
children: t
|
|
185
230
|
})
|
|
186
|
-
},
|
|
231
|
+
}, F = ({ content: e }) => /* @__PURE__ */ h("div", {
|
|
187
232
|
className: "break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
188
233
|
"data-testid": "assistant-markdown",
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
-
remarkPlugins:
|
|
191
|
-
rehypePlugins:
|
|
192
|
-
urlTransform:
|
|
193
|
-
components:
|
|
194
|
-
children:
|
|
234
|
+
children: /* @__PURE__ */ h(t, {
|
|
235
|
+
remarkPlugins: O,
|
|
236
|
+
rehypePlugins: k,
|
|
237
|
+
urlTransform: y,
|
|
238
|
+
components: P,
|
|
239
|
+
children: e
|
|
195
240
|
})
|
|
196
241
|
});
|
|
197
242
|
//#endregion
|
|
198
|
-
export {
|
|
243
|
+
export { F as AssistantMarkdownRenderer, w as AssistantNavigateProvider, y as assistantUrlTransform, x as classifyAssistantHref, T as useAssistantNavigate };
|
|
@@ -81,4 +81,4 @@ function d(e) {
|
|
|
81
81
|
if (e) return Object.fromEntries(Object.entries(e).filter(([e]) => !t.has(e.toLowerCase())));
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
-
export { o as getValidAccessTokenFromStorage, l as redirectToSafeLocation, d as sanitizeExtraHeaders, s as sanitizeGeography, u as validateGatewayBaseUrl };
|
|
84
|
+
export { o as getValidAccessTokenFromStorage, c as isSafeRedirectTarget, l as redirectToSafeLocation, d as sanitizeExtraHeaders, s as sanitizeGeography, u as validateGatewayBaseUrl };
|
package/dist/shared-assistant.js
CHANGED
|
@@ -38,56 +38,57 @@ import { BOILERPLATE_PAGE_SHARE as hn, MAX_BOILERPLATE_LINE_CHARS as gn, MAX_EXT
|
|
|
38
38
|
import { ATTACHMENT_ACCEPT as Fn, AttachmentRejectedError as In, INLINE_IMAGE_MAX_DIM as Ln, INLINE_IMAGE_QUALITY as Rn, MAX_ATTACHMENTS as zn, MAX_FILE_BYTES as Bn, MAX_INLINE_CHARS_PER_FILE as Vn, MAX_INLINE_CHARS_TOTAL as Hn, MAX_INLINE_IMAGE_BASE64_CHARS as Un, MAX_INLINE_IMAGE_PARTS as Wn, MAX_INLINE_TURN_BODY_BYTES as Gn, MAX_TURN_BODY_BYTES as Kn, PROMPT_ENVELOPE_RESERVE_BYTES as qn, TURN_BODY_HEADROOM_BYTES as Jn, buildAttachmentPromptBlock as Yn, buildPromptParts as Xn, buildPromptWithAttachments as Zn, classifyAttachment as Qn, countInlineImageCandidates as $n, countInlinedImageParts as er, detectDocumentFormat as tr, estimateTurnBodyBytes as nr, formatBytes as rr, getAttachmentSendBlocker as ir, getExtension as ar, getSendableAttachments as or, hasAttachmentWorkInFlight as sr, parseDataUrl as cr, toMessageAttachment as lr, truncateForInline as ur, validateFile as dr } from "./shared/assistant/attachments.js";
|
|
39
39
|
import { useAssistantStore as fr } from "./shared/assistant/store.js";
|
|
40
40
|
import { isTurnInFlight as pr, planAbandonedTurn as mr, planTurnAbort as hr } from "./shared/assistant/turnState.js";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
|
|
41
|
+
import { PHRASE_ROTATE_MS as gr, STAGE_COPY as _r, THINKING_PHRASES as vr, isStageCopy as yr, stageText as br, statusStageCopy as xr, thinkingPhrase as Sr } from "./shared/assistant/stageCopy.js";
|
|
42
|
+
import { AssistantToolActivity as Cr, parseToolActivity as wr } from "./shared/assistant/ui/AssistantToolActivity.js";
|
|
43
|
+
import { AssistantSpeechProvider as Tr, useAssistantSpeech as Er } from "./shared/assistant/ui/AssistantSpeechProvider.js";
|
|
44
|
+
import { useVoiceSession as Dr } from "./shared/assistant/ui/useVoiceSession.js";
|
|
45
|
+
import { copyToClipboard as Or } from "./shared/assistant/clipboard.js";
|
|
46
|
+
import { getActorId as kr, getOrganizationId as Ar, getWorkspaceId as jr } from "./shared/assistant/context.js";
|
|
47
|
+
import { ATTACHMENT_SOURCES as Mr, availableAttachmentSources as Nr, deviceHasCamera as Pr } from "./shared/assistant/attachmentSources.js";
|
|
48
|
+
import { SANDBOX_READY_TTL_MS as Fr, createReadinessTracker as Ir, isRecentlyVerified as Lr } from "./shared/assistant/sandboxReadiness.js";
|
|
49
|
+
import { AssistantAutoSpeakToggle as Rr } from "./shared/assistant/ui/AssistantAutoSpeakToggle.js";
|
|
50
|
+
import { AssistantMarkdownImage as zr, imageHostLabel as Br, isRemoteImageSrc as Vr } from "./shared/assistant/ui/AssistantMarkdownImage.js";
|
|
51
|
+
import { AssistantMarkdownRenderer as Hr, AssistantNavigateProvider as Ur, assistantUrlTransform as Wr, classifyAssistantHref as Gr, useAssistantNavigate as Kr } from "./shared/assistant/ui/AssistantMarkdownRenderer.js";
|
|
52
|
+
import { AssistantMessageAttachments as qr } from "./shared/assistant/ui/AssistantMessageAttachments.js";
|
|
53
|
+
import { AssistantPendingWriteCard as Jr } from "./shared/assistant/ui/AssistantPendingWriteCard.js";
|
|
54
|
+
import { AssistantLanguageMenu as Yr } from "./shared/assistant/ui/AssistantLanguageMenu.js";
|
|
55
|
+
import { AssistantReplyLanguageSelector as Xr } from "./shared/assistant/ui/AssistantReplyLanguageSelector.js";
|
|
56
|
+
import { AssistantSpeakButton as Zr } from "./shared/assistant/ui/AssistantSpeakButton.js";
|
|
57
|
+
import { AssistantSpokenTurnsNotice as Qr } from "./shared/assistant/ui/AssistantSpokenTurnsNotice.js";
|
|
58
|
+
import { AssistantAttachmentButton as $r } from "./shared/assistant/ui/composer/AssistantAttachmentButton.js";
|
|
59
|
+
import { AssistantAttachmentChips as ei } from "./shared/assistant/ui/composer/AssistantAttachmentChips.js";
|
|
60
|
+
import { AssistantLanguageSelector as ti, FOLLOW_APP_LOCALE as ni } from "./shared/assistant/ui/composer/AssistantLanguageSelector.js";
|
|
61
|
+
import { ASSISTANT_MODE_META as ri, AssistantModeSelector as ii, nextModeIndex as ai } from "./shared/assistant/ui/composer/AssistantModeSelector.js";
|
|
62
|
+
import { AssistantVoiceButton as oi } from "./shared/assistant/ui/composer/AssistantVoiceButton.js";
|
|
63
|
+
import { AUTO_VOICE as si, AssistantVoiceSelector as ci } from "./shared/assistant/ui/composer/AssistantVoiceSelector.js";
|
|
64
|
+
import { AssistantVoiceOrb as li } from "./shared/assistant/ui/voice/AssistantVoiceOrb.js";
|
|
65
|
+
import { AssistantVoiceSessionButton as ui } from "./shared/assistant/ui/voice/AssistantVoiceSessionButton.js";
|
|
66
|
+
import { CAPTION_SCROLL_ATTR as di, VoiceCaption as fi } from "./shared/assistant/ui/voice/VoiceCaption.js";
|
|
67
|
+
import { VoiceConversationView as pi } from "./shared/assistant/ui/voice/VoiceConversationView.js";
|
|
68
|
+
import { VoiceWaveform as mi } from "./shared/assistant/ui/voice/VoiceWaveform.js";
|
|
69
|
+
import { VoiceMiniController as hi } from "./shared/assistant/ui/voice/VoiceMiniController.js";
|
|
70
|
+
import { VoiceStage as gi } from "./shared/assistant/ui/voice/VoiceStage.js";
|
|
71
|
+
import { VoiceTranscriptDrawer as _i } from "./shared/assistant/ui/voice/VoiceTranscriptDrawer.js";
|
|
72
|
+
import { downloadFile as vi, exportConversation as yi } from "./shared/assistant/exportConversation.js";
|
|
73
|
+
import { AssistantMoreMenu as bi } from "./shared/assistant/ui/AssistantMoreMenu.js";
|
|
74
|
+
import { AssistantHeader as xi } from "./shared/assistant/ui/AssistantHeader.js";
|
|
75
|
+
import { AssistantConversationList as Si } from "./shared/assistant/ui/AssistantConversationList.js";
|
|
76
|
+
import { AssistantEmptyState as Ci } from "./shared/assistant/ui/AssistantEmptyState.js";
|
|
77
|
+
import { AssistantMessageItem as wi } from "./shared/assistant/ui/AssistantMessageItem.js";
|
|
78
|
+
import { AssistantMessageList as Ti } from "./shared/assistant/ui/AssistantMessageList.js";
|
|
79
|
+
import { AssistantVoiceSession as Ei } from "./shared/assistant/ui/voice/AssistantVoiceSession.js";
|
|
80
|
+
import { useAssistantApiAccess as Di } from "./shared/assistant/useAssistantApiAccess.js";
|
|
81
|
+
import { useConversationTurns as Oi } from "./shared/assistant/useConversationTurns.js";
|
|
82
|
+
import { isMultimodalBodyRejection as ki, isRecoverableAssistantError as Ai } from "./shared/assistant/transportErrors.js";
|
|
83
|
+
import { aiCreditsUpdatedEventName as ji, dispatchAssistantQuotaExhausted as Mi, notifyAiCreditsUpdated as Ni } from "./shared/assistant/aiCredits.js";
|
|
84
|
+
import { useWorkspaceWriteAccess as Pi } from "./shared/assistant/useWorkspaceWriteAccess.js";
|
|
85
|
+
import { extractDocumentText as Fi } from "./shared/assistant/documentExtract.js";
|
|
86
|
+
import { useAssistantAttachments as Ii } from "./shared/assistant/useAssistantAttachments.js";
|
|
87
|
+
import { AssistantComposer as Li } from "./shared/assistant/ui/composer/AssistantComposer.js";
|
|
88
|
+
import { isProdRuntime as Ri } from "./shared/assistant/env.js";
|
|
89
|
+
import { useAssistantHeartbeat as zi } from "./shared/assistant/useAssistantHeartbeat.js";
|
|
90
|
+
import { useAssistantKeyboardShortcuts as Bi } from "./shared/assistant/useAssistantKeyboardShortcuts.js";
|
|
91
|
+
import { AssistantApiCallsConsentDialog as Vi } from "./shared/assistant/ui/AssistantApiCallsConsentDialog.js";
|
|
92
|
+
import { AssistantChatArea as Hi } from "./shared/assistant/ui/AssistantChatArea.js";
|
|
93
|
+
import { AIAssistantPanel as Ui } from "./shared/assistant/ui/AIAssistantPanel.js";
|
|
94
|
+
export { Ui as AIAssistantPanel, g as ASSISTANT_API_AUTH_STRATEGY, zt as ASSISTANT_LANGUAGES, ri as ASSISTANT_MODE_META, Fn as ATTACHMENT_ACCEPT, Mr as ATTACHMENT_SOURCES, si as AUTO_VOICE, Vi as AssistantApiCallsConsentDialog, $r as AssistantAttachmentButton, ei as AssistantAttachmentChips, Rr as AssistantAutoSpeakToggle, Hi as AssistantChatArea, Li as AssistantComposer, Si as AssistantConversationList, Ci as AssistantEmptyState, xi as AssistantHeader, $t as AssistantI18nProvider, Yr as AssistantLanguageMenu, ti as AssistantLanguageSelector, zr as AssistantMarkdownImage, Hr as AssistantMarkdownRenderer, qr as AssistantMessageAttachments, wi as AssistantMessageItem, Ti as AssistantMessageList, ii as AssistantModeSelector, bi as AssistantMoreMenu, Ur as AssistantNavigateProvider, Jr as AssistantPendingWriteCard, qt as AssistantProductProvider, Xr as AssistantReplyLanguageSelector, X as AssistantRuntimeManager, Zr as AssistantSpeakButton, Tr as AssistantSpeechProvider, Qr as AssistantSpokenTurnsNotice, Cr as AssistantToolActivity, oi as AssistantVoiceButton, li as AssistantVoiceOrb, ci as AssistantVoiceSelector, Ei as AssistantVoiceSession, ui as AssistantVoiceSessionButton, In as AttachmentRejectedError, hn as BOILERPLATE_PAGE_SHARE, di as CAPTION_SCROLL_ATTR, s as CHECK_AI_CREDITS, c as CREATE_SANDBOX, vt as DEFAULT_SPEAKABLE_LABELS, Bt as DEFAULT_SPEECH_RATE, Ge as ENDPOINT_GRACE_MS, l as EXTEND_SANDBOX_TTL, ni as FOLLOW_APP_LOCALE, u as GET_ACTIVE_SANDBOXES, d as GET_SANDBOX, xe as HOSTED_TTS_MAX_CHARS, _e as HOSTED_TTS_TIER, ve as HOSTED_VOICES, cn as IDLE_PLAYBACK, Ke as INITIAL_SESSION, Ln as INLINE_IMAGE_MAX_DIM, Rn as INLINE_IMAGE_QUALITY, qe as INTERRUPT_MAX_MS, Je as INTERRUPT_MIN_MS, zn as MAX_ATTACHMENTS, gn as MAX_BOILERPLATE_LINE_CHARS, _n as MAX_EXTRACTED_CHARS, Bn as MAX_FILE_BYTES, Vn as MAX_INLINE_CHARS_PER_FILE, Hn as MAX_INLINE_CHARS_TOTAL, pn as MAX_INLINE_IMAGE_BASE64_BYTES, Un as MAX_INLINE_IMAGE_BASE64_CHARS, Wn as MAX_INLINE_IMAGE_PARTS, Gn as MAX_INLINE_TURN_BODY_BYTES, vn as MAX_PDF_PAGES_SCANNED, mn as MAX_REQUEST_BODY_BYTES, yt as MAX_SPEAKABLE_CHARS, bt as MAX_SPOKEN_TABLE_ROWS, Kn as MAX_TURN_BODY_BYTES, At as MINI_CAPTION_BUDGET, yn as MIN_PAGE_TEXT_CHARS, bn as MIN_TEXT_PAGE_SHARE, gr as PHRASE_ROTATE_MS, Mt as POLL_FAST_MS, Nt as POLL_FAST_UNTIL_MS, Pt as POLL_SLOW_MS, Ft as POLL_STEADY_MS, It as POLL_STEADY_UNTIL_MS, Ot as PREVIEW_LANGUAGES, qn as PROMPT_ENVELOPE_RESERVE_BYTES, f as PROXY_SANDBOX_REQUEST, p as REPORT_AI_TOKEN_USAGE, Fr as SANDBOX_READY_TTL_MS, Ye as SILENCE_SUBMIT_MS, Se as SPEAKING_RATE_MAX, Ce as SPEAKING_RATE_MAX_STREAMING, we as SPEAKING_RATE_MAX_SYNC, Te as SPEAKING_RATE_MIN, xt as SPEECH_CHUNK_CHARS, St as SPEECH_CHUNK_CJK_CHARS, rt as SPEECH_LANG, rn as SPOKEN_LABEL_LANGUAGES, _r as STAGE_COPY, m as STOP_ASSISTANT_SANDBOX, vr as THINKING_PHRASES, Jn as TURN_BODY_HEADROOM_BYTES, it as VOICE_LIST_TIMEOUT_MS, fi as VoiceCaption, pi as VoiceConversationView, hi as VoiceMiniController, gi as VoiceStage, _i as VoiceTranscriptDrawer, mi as VoiceWaveform, h as WAIT_FOR_SANDBOX_RUNNING, E as abortAssistantTurn, ji as aiCreditsUpdatedEventName, D as approvePendingWrite, en as assistantTranslationKey, Wr as assistantUrlTransform, Nr as availableAttachmentSources, Ee as base64ToBytes, ge as browserSpeechEngine, O as buildAssistantSandboxEnv, Yn as buildAttachmentPromptBlock, ht as buildContinuedFromVoiceNote, Z as buildProgress, Xn as buildPromptParts, k as buildPromptRequestBody, Zn as buildPromptWithAttachments, De as buildRequest, a as buildSandboxContextInput, gt as buildVoiceTranscriptMarkdown, le as chatTurns, A as checkAssistantAiCredits, Ct as chunkForSpeech, Gr as classifyAssistantHref, Qn as classifyAttachment, Oe as classifyHttpFailure, t as classifyQuotaError, xn as columnLetterToIndex, Pe as configureSpeechEngine, wt as containsCjk, Or as copyToClipboard, $n as countInlineImageCandidates, er as countInlinedImageParts, j as createAssistantSandbox, M as createAssistantSession, Me as createHostedTtsEngine, Ir as createReadinessTracker, Ne as createRoutingSpeechEngine, se as createSandboxAssistantTransport, Fe as createSpeechEngines, ke as decodeAudioResponse, Sn as decodeXmlEntities, n as describeQuotaError, tr as detectDocumentFormat, on as detectScriptLocale, Pr as deviceHasCamera, Mi as dispatchAssistantQuotaExhausted, Cn as docxXmlToText, N as downloadAssistantArtifact, vi as downloadFile, nr as estimateTurnBodyBytes, o as executeSandboxGraphQL, yi as exportConversation, P as extendAssistantSandboxTTL, Fi as extractDocumentText, Vt as findAssistantLanguage, F as findExistingSandbox, Gt as findPendingWrite, wn as fitPdfPages, rr as formatBytes, Tn as formatPageRanges, kr as getActorId, I as getAssistantArtifacts, Q as getAssistantMedia, L as getAssistantMessages, R as getAssistantSession, z as getAssistantStreamAccess, $ as getAssistantText, ir as getAttachmentSendBlocker, S as getCapability, ar as getExtension, _ as getImageForMode, v as getImageTagForMode, Ar as getOrganizationId, ee as getRawMessageCreatedAt, y as getResourcesForMode, b as getSandboxImageRegistry, or as getSendableAttachments, Ie as getSpeechEngine, te as getToolProgress, jr as getWorkspaceId, ue as groupBySession, de as groupConsecutiveBySession, sr as hasAttachmentWorkInFlight, ye as hostedLocaleFor, be as hostedSupportsLanguage, Br as imageHostLabel, Xe as isCapturing, Ze as isEcho, En as isMostlyImagePages, ki as isMultimodalBodyRejection, Ri as isProdRuntime, r as isQuotaExhaustedError, ne as isReapedSandboxConnectionError, Lr as isRecentlyVerified, re as isRecoverable, Ai as isRecoverableAssistantError, Vr as isRemoteImageSrc, ln as isSpeakingMessage, at as isSpeechBlocked, yr as isStageCopy, Qe as isSubmittable, pr as isTurnInFlight, C as isUnknownFieldError, fe as isVoiceTurn, Dn as joinSheets, ot as languageDisplayName, ie as mapSessionToHistory, w as markSupported, T as markUnsupported, ae as mergeMessagesById, ze as micIsInterrupt, B as modeRequiresConfirmWrites, ai as nextModeIndex, st as normalizeLangTag, Ni as notifyAiCreditsUpdated, $e as orbMode, On as pageMarker, Kt as parseConfirmationRefusal, cr as parseDataUrl, kn as parseSharedStrings, wr as parseToolActivity, An as parseWorkbookSheets, jn as pdfTextItemsToPage, mr as planAbandonedTurn, et as planReplyConsumption, hr as planTurnAbort, Lt as pollDelayMs, ct as primaryLanguageSubtag, un as publishedChunks, i as quotaExhaustedEventName, Le as readSpeechEngineConfig, V as releaseSupersededAssistantSandboxes, Ut as replyFollowsInput, H as reportAssistantAiTokenUsage, dn as requiresCancel, Re as resetSpeechEngine, Ht as resolveAssistantLanguage, Wt as resolveLanguagePair, Jt as resolveModeConfig, x as resolveSandboxAssistantMode, sn as resolveSpeechLocale, oe as sanitize, U as selectExistingAssistantSandbox, W as selectSupersededAssistantSandboxes, lt as selectVoiceForLocale, G as sendAssistantPromptAsync, K as sendHeartbeat, Mn as sheetXmlToRows, Ae as shouldDisableEngine, jt as showPreviousChunk, Be as showsAssistantCaption, Ve as showsUserCaption, Tt as speakableEmail, ut as speechGate, an as speechLabelsFor, dt as speechLangForLocale, fn as speechPlaybackReducer, je as splitForVendor, Et as splitTableRow, tt as spokenSoFar, br as stageText, xr as statusStageCopy, q as stopReapedAssistantSandbox, Nn as summarisePageText, Sr as thinkingPhrase, Rt as toCaptionText, lr as toMessageAttachment, Dt as toSpeakableText, ur as truncateForInline, Pn as truncatePagesForInline, Di as useAssistantApiAccess, Ii as useAssistantAttachments, zi as useAssistantHeartbeat, tn as useAssistantI18nNamespace, Bi as useAssistantKeyboardShortcuts, Kr as useAssistantNavigate, Yt as useAssistantPageLabel, Xt as useAssistantProduct, Zt as useAssistantProductOrNull, Er as useAssistantSpeech, Qt as useAssistantStorageFolders, fr as useAssistantStore, nn as useAssistantTr, Oi as useConversationTurns, ce as useSandboxAssistantTransport, e as useVoiceInput, Dr as useVoiceSession, Pi as useWorkspaceWriteAccess, dr as validateFile, ft as voiceAvailability, pe as voiceMarker, kt as voicePreviewText, pt as voiceQualityRank, me as voiceSessionIdOf, nt as voiceSessionReducer, He as voiceStageState, _t as voiceTranscriptFilename, he as voiceTurnsOnly, mt as voicesForLocale, J as waitForAssistantServiceReady, Y as waitForSandboxRunning, Ue as waveformIsActive, We as waveformIsSettled };
|