@burdenoff/fe-libs 2026.910.4 → 2026.910.5
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/ui/AIAssistantPanel.js +6 -6
- package/dist/shared/assistant/ui/AssistantChatArea.js +358 -358
- package/dist/shared/assistant/ui/AssistantConversationList.js +16 -16
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +21 -7
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +47 -37
- package/dist/shared/assistant/ui/AssistantMessageItem.js +16 -16
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +151 -151
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +6 -6
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.js +4 -4
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +48 -48
- package/dist/shared/assistant/ui/voice/VoiceConversationView.js +8 -8
- package/dist/shared/components/assistantWidget/MessageContent.d.ts +11 -3
- package/dist/shared/components/assistantWidget/MessageContent.d.ts.map +1 -1
- package/dist/shared/components/assistantWidget/MessageContent.js +26 -27
- package/dist/shared-assistant.js +93 -93
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useAssistantProduct as e } from "../product.js";
|
|
2
|
+
import { useAssistantTr as t } from "../i18n.js";
|
|
3
|
+
import { chatTurns as n } from "../voice/turnVisibility.js";
|
|
4
4
|
import { useAssistantStore as r } from "../store.js";
|
|
5
5
|
import { useState as i } from "react";
|
|
6
6
|
import { Check as a, MessageSquare as o, PanelLeftClose as s, Pencil as c, Plus as l, Trash2 as u } from "lucide-react";
|
|
7
7
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
//#region src/shared/assistant/ui/AssistantConversationList.tsx
|
|
9
9
|
var m = () => {
|
|
10
|
-
let m =
|
|
10
|
+
let m = t(), { modes: h } = e(), { conversations: g, activeConversationId: _, processingByConversationId: v, setActiveConversation: y, setMode: b, createConversation: x, deleteConversation: S, renameConversation: C, setConversationListOpen: w } = r(), [T, E] = i(null), [D, O] = i(""), k = () => {
|
|
11
11
|
x(), w(!1);
|
|
12
12
|
}, A = (e) => {
|
|
13
13
|
let t = g.find((t) => t.id === e);
|
|
@@ -67,16 +67,16 @@ var m = () => {
|
|
|
67
67
|
]
|
|
68
68
|
}) : /* @__PURE__ */ f("div", {
|
|
69
69
|
className: "py-1",
|
|
70
|
-
children: g.map((
|
|
71
|
-
let
|
|
70
|
+
children: g.map((e) => {
|
|
71
|
+
let t = e.id === _, r = e.id === T, i = h.find((t) => t.id === e.mode), o = n(e.messages), s = o[o.length - 1], l = o.length === 0 && e.messages.length > 0, g = v[e.id];
|
|
72
72
|
return /* @__PURE__ */ f("div", {
|
|
73
73
|
role: "button",
|
|
74
74
|
tabIndex: 0,
|
|
75
|
-
onKeyDown: (
|
|
76
|
-
(
|
|
75
|
+
onKeyDown: (t) => {
|
|
76
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), !r && A(e.id));
|
|
77
77
|
},
|
|
78
|
-
onClick: () => !r && A(
|
|
79
|
-
className: `group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${
|
|
78
|
+
onClick: () => !r && A(e.id),
|
|
79
|
+
className: `group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${t ? "bg-bg-elevated border-l-2 border-action-primary-bg" : ""}`,
|
|
80
80
|
children: r ? /* @__PURE__ */ p("div", {
|
|
81
81
|
className: "flex items-center gap-1",
|
|
82
82
|
children: [/* @__PURE__ */ f("input", {
|
|
@@ -102,20 +102,20 @@ var m = () => {
|
|
|
102
102
|
className: "flex items-center justify-between",
|
|
103
103
|
children: [/* @__PURE__ */ f("span", {
|
|
104
104
|
className: "text-xs font-medium text-text-primary truncate flex-1",
|
|
105
|
-
children:
|
|
105
|
+
children: e.title
|
|
106
106
|
}), /* @__PURE__ */ p("div", {
|
|
107
107
|
className: "hidden group-hover:flex group-focus-within:flex items-center gap-0.5 ml-1",
|
|
108
108
|
children: [/* @__PURE__ */ f("button", {
|
|
109
109
|
type: "button",
|
|
110
|
-
onClick: (
|
|
111
|
-
|
|
110
|
+
onClick: (t) => {
|
|
111
|
+
t.stopPropagation(), j(e.id, e.title);
|
|
112
112
|
},
|
|
113
113
|
className: "p-0.5 hover:bg-bg-sunken rounded",
|
|
114
114
|
"aria-label": m("conversations.rename", "Rename conversation"),
|
|
115
115
|
children: /* @__PURE__ */ f(c, { className: "size-3 text-text-muted" })
|
|
116
116
|
}), /* @__PURE__ */ f("button", {
|
|
117
117
|
type: "button",
|
|
118
|
-
onClick: (
|
|
118
|
+
onClick: (t) => N(t, e.id),
|
|
119
119
|
className: "p-0.5 hover:bg-bg-sunken rounded",
|
|
120
120
|
"aria-label": m("conversations.delete", "Delete conversation"),
|
|
121
121
|
"data-testid": "delete-conversation",
|
|
@@ -128,7 +128,7 @@ var m = () => {
|
|
|
128
128
|
children: [
|
|
129
129
|
/* @__PURE__ */ f("span", {
|
|
130
130
|
className: "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded",
|
|
131
|
-
children: i?.label ??
|
|
131
|
+
children: i?.label ?? e.mode
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ p("span", {
|
|
134
134
|
className: "text-[10px] text-text-muted",
|
|
@@ -149,7 +149,7 @@ var m = () => {
|
|
|
149
149
|
children: m("conversationList.voiceOnly", "Spoken conversation")
|
|
150
150
|
})
|
|
151
151
|
] })
|
|
152
|
-
},
|
|
152
|
+
}, e.id);
|
|
153
153
|
})
|
|
154
154
|
})
|
|
155
155
|
})]
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useI18n as e } from "../../providers/shell/I18nProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useAssistantTr as t } from "../i18n.js";
|
|
3
|
+
import { ASSISTANT_LANGUAGES as n } from "../voice/languages.js";
|
|
4
|
+
import { resolveLanguagePair as r } from "../voice/languagePair.js";
|
|
5
5
|
import { useAssistantStore as i } from "../store.js";
|
|
6
6
|
import { useMemo as a } from "react";
|
|
7
7
|
import { Languages as o } from "lucide-react";
|
|
8
8
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
//#region src/shared/assistant/ui/AssistantLanguageMenu.tsx
|
|
10
10
|
var l = "__match__", u = () => {
|
|
11
|
-
let u =
|
|
11
|
+
let u = t(), { locale: d } = e(), f = i((e) => e.assistantLanguage), p = i((e) => e.setAssistantLanguage), m = i((e) => e.replyLanguage), h = i((e) => e.setReplyLanguage), g = a(() => r(f, m, d), [
|
|
12
12
|
f,
|
|
13
13
|
m,
|
|
14
14
|
d
|
|
@@ -43,7 +43,7 @@ var l = "__match__", u = () => {
|
|
|
43
43
|
children: [/* @__PURE__ */ s("option", {
|
|
44
44
|
value: "",
|
|
45
45
|
children: u("voice.languageFollowApp", "Same as interface")
|
|
46
|
-
}),
|
|
46
|
+
}), n.map((e) => /* @__PURE__ */ s("option", {
|
|
47
47
|
value: e.code,
|
|
48
48
|
children: e.label
|
|
49
49
|
}, e.code))]
|
|
@@ -78,7 +78,7 @@ var l = "__match__", u = () => {
|
|
|
78
78
|
g.input.label,
|
|
79
79
|
")"
|
|
80
80
|
]
|
|
81
|
-
}),
|
|
81
|
+
}), n.map((e) => /* @__PURE__ */ s("option", {
|
|
82
82
|
value: e.code,
|
|
83
83
|
children: e.label
|
|
84
84
|
}, e.code))]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
1
|
+
import { FC, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Options } from 'react-markdown';
|
|
3
3
|
interface Props {
|
|
4
4
|
content: string;
|
|
@@ -25,12 +25,6 @@ export type AssistantLinkKind = "internal" | "external" | "fragment" | "blocked"
|
|
|
25
25
|
* the product; absent means "no SPA routing".
|
|
26
26
|
*/
|
|
27
27
|
export type AssistantNavigate = (path: string) => void;
|
|
28
|
-
/**
|
|
29
|
-
* ★ `baseOrigin` is threaded rather than left to `isSafeRedirectTarget`'s own
|
|
30
|
-
* `window.location.origin` default so this stays callable — and testable — with
|
|
31
|
-
* no DOM. With no origin to compare against we cannot prove a link is internal,
|
|
32
|
-
* so it degrades to `external`: a new tab is the safe direction to fail.
|
|
33
|
-
*/
|
|
34
28
|
export declare function classifyAssistantHref(href: string | null | undefined, baseOrigin?: string): AssistantLinkKind;
|
|
35
29
|
/**
|
|
36
30
|
* The router-ready path for an href already classified as `internal`, or null if
|
|
@@ -46,6 +40,26 @@ export declare function classifyAssistantHref(href: string | null | undefined, b
|
|
|
46
40
|
* out they got it wrong.
|
|
47
41
|
*/
|
|
48
42
|
export declare function assistantRoutePath(href: string | null | undefined, baseOrigin?: string): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* ★★ The cases where the BROWSER must win, not the router. Losing these is how
|
|
45
|
+
* "open in new tab", "copy link" and middle-click quietly stop working — the
|
|
46
|
+
* reason the anchor also keeps a real `href` rather than becoming a button.
|
|
47
|
+
*
|
|
48
|
+
* ★★ THE ANCHOR SHOWS THE RESOLVED PATH, NOT THE RAW HREF, and that is a
|
|
49
|
+
* correctness fix rather than cosmetics. A document-relative href resolves
|
|
50
|
+
* against the CURRENT PAGE in the browser but against the ORIGIN in
|
|
51
|
+
* `assistantRoutePath`, so the two click modes disagreed:
|
|
52
|
+
*
|
|
53
|
+
* on /healthybowl/crops/42, `[x](fields)`
|
|
54
|
+
* plain click -> navigate("/fields") (resolved at the root)
|
|
55
|
+
* ctrl-click -> browser opens /healthybowl/crops/fields
|
|
56
|
+
*
|
|
57
|
+
* Same link, two destinations depending on how it was clicked — and "copy link
|
|
58
|
+
* address" gave a third answer. Emitting `routePath` as the href makes every
|
|
59
|
+
* mode agree, because there is then only one resolved value. A fragment and an
|
|
60
|
+
* external URL are left exactly as written: neither is a route.
|
|
61
|
+
*/
|
|
62
|
+
export declare function browserShouldHandle(event: MouseEvent<HTMLAnchorElement>): boolean;
|
|
49
63
|
/**
|
|
50
64
|
* ★ Context, not a prop: the renderer is reached by TWO paths — the chat
|
|
51
65
|
* transcript and the voice transcript drawer — and threading a prop through
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMarkdownRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAIL,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AssistantMarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMarkdownRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAIL,KAAK,EAAE,EACP,KAAK,UAAU,EACf,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;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAkDvD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,iBAAiB,CAWnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CA+Bf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,OAAO,CASjF;AAID;;;;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;AAuTD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,KAAK,CAiB/C,CAAC"}
|
|
@@ -24,14 +24,24 @@ function b() {
|
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function x(
|
|
27
|
+
function x(e, t) {
|
|
28
|
+
try {
|
|
29
|
+
let n = new URL(t);
|
|
30
|
+
if (n.protocol === "https:" || n.protocol === "http:" || !n.host) return !1;
|
|
31
|
+
let r = new URL(e, t);
|
|
32
|
+
return r.protocol === n.protocol && r.host === n.host;
|
|
33
|
+
} catch {
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function S(t, n) {
|
|
28
38
|
let r = (t ?? "").trim();
|
|
29
39
|
if (!r) return "blocked";
|
|
30
40
|
if (r.startsWith("#")) return "fragment";
|
|
31
41
|
let i = n ?? b();
|
|
32
|
-
return i && e(r, i) ? "internal" : "external";
|
|
42
|
+
return i && (e(r, i) || x(r, i)) ? "internal" : "external";
|
|
33
43
|
}
|
|
34
|
-
function
|
|
44
|
+
function C(e, t) {
|
|
35
45
|
let n = (e ?? "").trim();
|
|
36
46
|
if (!n) return null;
|
|
37
47
|
let r = t ?? b();
|
|
@@ -43,41 +53,41 @@ function S(e, t) {
|
|
|
43
53
|
return null;
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
|
-
function
|
|
56
|
+
function w(e) {
|
|
47
57
|
return e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
48
58
|
}
|
|
49
|
-
var
|
|
59
|
+
var T = l(null), E = ({ value: e, children: t }) => /* @__PURE__ */ h(T.Provider, {
|
|
50
60
|
value: e ?? null,
|
|
51
61
|
children: t
|
|
52
62
|
});
|
|
53
|
-
function
|
|
54
|
-
return u(
|
|
63
|
+
function D() {
|
|
64
|
+
return u(T);
|
|
55
65
|
}
|
|
56
|
-
var
|
|
57
|
-
let n =
|
|
66
|
+
var O = "text-action-primary-bg underline-offset-2 hover:underline", k = ({ href: e, children: t }) => {
|
|
67
|
+
let n = D(), r = S(e), i = r === "internal" ? C(e) : null;
|
|
58
68
|
return r === "blocked" ? /* @__PURE__ */ h(m, { children: t }) : n && i ? /* @__PURE__ */ h("a", {
|
|
59
|
-
href:
|
|
60
|
-
className:
|
|
69
|
+
href: i,
|
|
70
|
+
className: O,
|
|
61
71
|
"data-testid": "assistant-markdown-link",
|
|
62
72
|
onClick: (e) => {
|
|
63
|
-
|
|
73
|
+
w(e) || (e.preventDefault(), n(i));
|
|
64
74
|
},
|
|
65
75
|
children: t
|
|
66
76
|
}) : r === "internal" || r === "fragment" ? /* @__PURE__ */ h("a", {
|
|
67
|
-
href: e,
|
|
68
|
-
className:
|
|
77
|
+
href: i ?? e,
|
|
78
|
+
className: O,
|
|
69
79
|
"data-testid": "assistant-markdown-link",
|
|
70
80
|
children: t
|
|
71
81
|
}) : /* @__PURE__ */ h("a", {
|
|
72
82
|
href: e,
|
|
73
83
|
target: "_blank",
|
|
74
84
|
rel: "noopener noreferrer",
|
|
75
|
-
className:
|
|
85
|
+
className: O,
|
|
76
86
|
"data-testid": "assistant-markdown-link",
|
|
77
87
|
children: t
|
|
78
88
|
});
|
|
79
|
-
},
|
|
80
|
-
function
|
|
89
|
+
}, A = [r], j = [[a, _]];
|
|
90
|
+
function M({ language: e, code: t }) {
|
|
81
91
|
let n = o(), [r, i] = d(!1);
|
|
82
92
|
return /* @__PURE__ */ g("div", {
|
|
83
93
|
className: "group relative my-2 overflow-hidden rounded-md border border-border-default bg-bg-sunken",
|
|
@@ -107,7 +117,7 @@ function j({ language: e, code: t }) {
|
|
|
107
117
|
})]
|
|
108
118
|
});
|
|
109
119
|
}
|
|
110
|
-
function
|
|
120
|
+
function N(e) {
|
|
111
121
|
let t = e?.children?.[0];
|
|
112
122
|
if (!t || t.type !== "element" || t.tagName !== "code") return null;
|
|
113
123
|
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-"));
|
|
@@ -116,10 +126,10 @@ function M(e) {
|
|
|
116
126
|
language: i ? i.slice(9) : ""
|
|
117
127
|
};
|
|
118
128
|
}
|
|
119
|
-
function
|
|
129
|
+
function P(e, t) {
|
|
120
130
|
return typeof e == "string" && e.split(" ").includes(t);
|
|
121
131
|
}
|
|
122
|
-
function
|
|
132
|
+
function F({ level: e, children: t }) {
|
|
123
133
|
let n = `h${e}`, r = {
|
|
124
134
|
2: "text-[1.15em]",
|
|
125
135
|
3: "text-[1.08em]",
|
|
@@ -132,8 +142,8 @@ function P({ level: e, children: t }) {
|
|
|
132
142
|
children: t
|
|
133
143
|
});
|
|
134
144
|
}
|
|
135
|
-
var
|
|
136
|
-
a: ({ href: e, children: t }) => /* @__PURE__ */ h(
|
|
145
|
+
var I = {
|
|
146
|
+
a: ({ href: e, children: t }) => /* @__PURE__ */ h(k, {
|
|
137
147
|
href: e,
|
|
138
148
|
children: t
|
|
139
149
|
}),
|
|
@@ -153,27 +163,27 @@ var F = {
|
|
|
153
163
|
className: "italic",
|
|
154
164
|
children: e
|
|
155
165
|
}),
|
|
156
|
-
h1: ({ children: e }) => /* @__PURE__ */ h(
|
|
166
|
+
h1: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
157
167
|
level: 2,
|
|
158
168
|
children: e
|
|
159
169
|
}),
|
|
160
|
-
h2: ({ children: e }) => /* @__PURE__ */ h(
|
|
170
|
+
h2: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
161
171
|
level: 3,
|
|
162
172
|
children: e
|
|
163
173
|
}),
|
|
164
|
-
h3: ({ children: e }) => /* @__PURE__ */ h(
|
|
174
|
+
h3: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
165
175
|
level: 4,
|
|
166
176
|
children: e
|
|
167
177
|
}),
|
|
168
|
-
h4: ({ children: e }) => /* @__PURE__ */ h(
|
|
178
|
+
h4: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
169
179
|
level: 5,
|
|
170
180
|
children: e
|
|
171
181
|
}),
|
|
172
|
-
h5: ({ children: e }) => /* @__PURE__ */ h(
|
|
182
|
+
h5: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
173
183
|
level: 6,
|
|
174
184
|
children: e
|
|
175
185
|
}),
|
|
176
|
-
h6: ({ children: e }) => /* @__PURE__ */ h(
|
|
186
|
+
h6: ({ children: e }) => /* @__PURE__ */ h(F, {
|
|
177
187
|
level: 6,
|
|
178
188
|
children: e
|
|
179
189
|
}),
|
|
@@ -190,7 +200,7 @@ var F = {
|
|
|
190
200
|
className: "mr-1.5 size-3 flex-shrink-0 align-[-0.1em] accent-[var(--color-action-primary-bg)]"
|
|
191
201
|
}) : null,
|
|
192
202
|
li: ({ className: e, children: t }) => /* @__PURE__ */ h("li", {
|
|
193
|
-
className:
|
|
203
|
+
className: P(e, "task-list-item") ? "list-none text-text-primary" : "text-text-primary",
|
|
194
204
|
children: t
|
|
195
205
|
}),
|
|
196
206
|
ol: ({ children: e }) => /* @__PURE__ */ h("ol", {
|
|
@@ -202,8 +212,8 @@ var F = {
|
|
|
202
212
|
children: e
|
|
203
213
|
}),
|
|
204
214
|
pre: ({ children: e, node: t }) => {
|
|
205
|
-
let n =
|
|
206
|
-
return n ? /* @__PURE__ */ h(
|
|
215
|
+
let n = N(t);
|
|
216
|
+
return n ? /* @__PURE__ */ h(M, {
|
|
207
217
|
language: n.language,
|
|
208
218
|
code: n.code
|
|
209
219
|
}) : /* @__PURE__ */ h("pre", {
|
|
@@ -237,19 +247,19 @@ var F = {
|
|
|
237
247
|
children: e
|
|
238
248
|
}),
|
|
239
249
|
ul: ({ className: e, children: t }) => /* @__PURE__ */ h("ul", {
|
|
240
|
-
className:
|
|
250
|
+
className: P(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",
|
|
241
251
|
children: t
|
|
242
252
|
})
|
|
243
|
-
},
|
|
253
|
+
}, L = ({ content: e }) => /* @__PURE__ */ h("div", {
|
|
244
254
|
className: "break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
245
255
|
"data-testid": "assistant-markdown",
|
|
246
256
|
children: /* @__PURE__ */ h(t, {
|
|
247
|
-
remarkPlugins:
|
|
248
|
-
rehypePlugins:
|
|
257
|
+
remarkPlugins: A,
|
|
258
|
+
rehypePlugins: j,
|
|
249
259
|
urlTransform: y,
|
|
250
|
-
components:
|
|
260
|
+
components: I,
|
|
251
261
|
children: e
|
|
252
262
|
})
|
|
253
263
|
});
|
|
254
264
|
//#endregion
|
|
255
|
-
export {
|
|
265
|
+
export { L as AssistantMarkdownRenderer, E as AssistantNavigateProvider, C as assistantRoutePath, y as assistantUrlTransform, w as browserShouldHandle, S as classifyAssistantHref, D as useAssistantNavigate };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useAuthToken as e } from "../../providers/shell/AuthTokenProvider.js";
|
|
2
2
|
import "../../../shared-providers-shell.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { useAssistantStorageFolders as t } from "../product.js";
|
|
4
|
+
import { useAssistantTr as n } from "../i18n.js";
|
|
5
|
+
import { copyToClipboard as r } from "../clipboard.js";
|
|
6
|
+
import { AssistantMarkdownRenderer as i } from "./AssistantMarkdownRenderer.js";
|
|
7
|
+
import { downloadAssistantArtifact as a } from "../api.js";
|
|
8
|
+
import { AssistantToolActivity as o, parseToolActivity as s } from "./AssistantToolActivity.js";
|
|
9
|
+
import { useAssistantSpeech as c } from "./AssistantSpeechProvider.js";
|
|
10
10
|
import { AssistantMessageAttachments as l } from "./AssistantMessageAttachments.js";
|
|
11
11
|
import { AssistantPendingWriteCard as u } from "./AssistantPendingWriteCard.js";
|
|
12
12
|
import { AssistantSpeakButton as d } from "./AssistantSpeakButton.js";
|
|
@@ -32,24 +32,24 @@ function T(e, t, n) {
|
|
|
32
32
|
s.href = o, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
|
|
33
33
|
}
|
|
34
34
|
var E = ({ onApprovePendingWrite: w, approvingWriteRef: E = null, message: D, isStreaming: O, isFailed: k, isLastAssistant: A, onRetry: j }) => {
|
|
35
|
-
let M =
|
|
35
|
+
let M = n(), N = t(), { getAccessToken: P, getWorkspaceToken: F } = e(), I = c(), [L, R] = m(null), [z, B] = m(!1), V = D.role === "user", H = p(() => S(D), [D]), U = p(() => C(H), [H]), { steps: W, text: G } = p(() => V ? {
|
|
36
36
|
steps: [],
|
|
37
37
|
text: D.content
|
|
38
|
-
} :
|
|
39
|
-
|
|
38
|
+
} : s(D.content), [V, D.content]), K = () => {
|
|
39
|
+
r(G || D.content).then((e) => {
|
|
40
40
|
e && (B(!0), setTimeout(() => B(!1), 2e3));
|
|
41
41
|
});
|
|
42
42
|
}, q = async (e) => {
|
|
43
43
|
if (!H?.sandboxId || !H.sessionId) return;
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
44
|
+
let t = new URLSearchParams(window.location.search).get("workspace") ?? "";
|
|
45
|
+
if (t) {
|
|
46
46
|
R(e.path);
|
|
47
47
|
try {
|
|
48
|
-
let
|
|
48
|
+
let n = await a(H.sandboxId, t, H.sessionId, e.path, {
|
|
49
49
|
accessToken: P(),
|
|
50
50
|
workspaceToken: F()
|
|
51
51
|
});
|
|
52
|
-
T(
|
|
52
|
+
T(n.contentBase64, n.filename, n.mimeType);
|
|
53
53
|
} finally {
|
|
54
54
|
R(null);
|
|
55
55
|
}
|
|
@@ -99,7 +99,7 @@ var E = ({ onApprovePendingWrite: w, approvingWriteRef: E = null, message: D, is
|
|
|
99
99
|
}), /* @__PURE__ */ x("div", {
|
|
100
100
|
className: "min-w-0 flex-1",
|
|
101
101
|
children: [
|
|
102
|
-
W.length > 0 && /* @__PURE__ */ b(
|
|
102
|
+
W.length > 0 && /* @__PURE__ */ b(o, { steps: W }),
|
|
103
103
|
H?.pendingWrite ? /* @__PURE__ */ b(u, {
|
|
104
104
|
pendingWrite: H.pendingWrite,
|
|
105
105
|
onApprove: w,
|
|
@@ -107,7 +107,7 @@ var E = ({ onApprovePendingWrite: w, approvingWriteRef: E = null, message: D, is
|
|
|
107
107
|
}) : null,
|
|
108
108
|
G && /* @__PURE__ */ b("div", {
|
|
109
109
|
className: "text-[15px] leading-relaxed text-text-primary",
|
|
110
|
-
children: /* @__PURE__ */ b(
|
|
110
|
+
children: /* @__PURE__ */ b(i, { content: G })
|
|
111
111
|
}),
|
|
112
112
|
O && /* @__PURE__ */ b("span", {
|
|
113
113
|
"aria-hidden": "true",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useI18n as e } from "../../providers/shell/I18nProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useAssistantTr as t } from "../i18n.js";
|
|
3
|
+
import { ASSISTANT_LANGUAGES as n } from "../voice/languages.js";
|
|
4
|
+
import { resolveLanguagePair as r } from "../voice/languagePair.js";
|
|
5
5
|
import { useAssistantStore as i } from "../store.js";
|
|
6
6
|
import { useMemo as a } from "react";
|
|
7
7
|
import { Languages as o } from "lucide-react";
|
|
8
8
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
//#region src/shared/assistant/ui/AssistantReplyLanguageSelector.tsx
|
|
10
10
|
var l = "__match__", u = () => {
|
|
11
|
-
let u =
|
|
11
|
+
let u = t(), { locale: d } = e(), f = i((e) => e.assistantLanguage), p = i((e) => e.replyLanguage), m = i((e) => e.setReplyLanguage), h = a(() => r(f, p, d), [
|
|
12
12
|
f,
|
|
13
13
|
p,
|
|
14
14
|
d
|
|
@@ -46,7 +46,7 @@ var l = "__match__", u = () => {
|
|
|
46
46
|
h.input.label,
|
|
47
47
|
")"
|
|
48
48
|
]
|
|
49
|
-
}),
|
|
49
|
+
}), n.map((e) => /* @__PURE__ */ s("option", {
|
|
50
50
|
value: e.code,
|
|
51
51
|
children: e.label
|
|
52
52
|
}, e.code))]
|