@burdenoff/fe-libs 2026.913.1 → 2026.914.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/conversation.d.ts +29 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/displayContent.d.ts +57 -0
- package/dist/shared/assistant/displayContent.d.ts.map +1 -0
- package/dist/shared/assistant/displayContent.js +26 -0
- package/dist/shared/assistant/exportConversation.d.ts +12 -2
- package/dist/shared/assistant/exportConversation.d.ts.map +1 -1
- package/dist/shared/assistant/exportConversation.js +24 -22
- package/dist/shared/assistant/index.d.ts +9 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/legacyFiller.d.ts +60 -0
- package/dist/shared/assistant/legacyFiller.d.ts.map +1 -0
- package/dist/shared/assistant/legacyFiller.js +35 -0
- package/dist/shared/assistant/preview/previewTransitions.d.ts +15 -1
- package/dist/shared/assistant/preview/previewTransitions.d.ts.map +1 -1
- package/dist/shared/assistant/preview/previewTransitions.js +5 -2
- package/dist/shared/assistant/preview/useAssistantPreviewBridge.d.ts.map +1 -1
- package/dist/shared/assistant/preview/useAssistantPreviewBridge.js +51 -52
- package/dist/shared/assistant/spokenTurns.d.ts +25 -0
- package/dist/shared/assistant/spokenTurns.d.ts.map +1 -0
- package/dist/shared/assistant/spokenTurns.js +12 -0
- package/dist/shared/assistant/stageCopy.d.ts +23 -34
- package/dist/shared/assistant/stageCopy.d.ts.map +1 -1
- package/dist/shared/assistant/stageCopy.js +7 -16
- package/dist/shared/assistant/store.d.ts +10 -2
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +16 -9
- package/dist/shared/assistant/turnActivity.d.ts +66 -0
- package/dist/shared/assistant/turnActivity.d.ts.map +1 -0
- package/dist/shared/assistant/turnActivity.js +41 -0
- package/dist/shared/assistant/turnProgress.d.ts +51 -0
- package/dist/shared/assistant/turnProgress.d.ts.map +1 -0
- package/dist/shared/assistant/turnProgress.js +27 -0
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +362 -379
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +81 -80
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +12 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +103 -83
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +7 -1
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +16 -15
- package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMoreMenu.js +23 -20
- package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +37 -0
- package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantTurnActivity.js +33 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +112 -102
- package/dist/shared/assistant/ui/voice/VoiceMiniController.d.ts +10 -0
- package/dist/shared/assistant/ui/voice/VoiceMiniController.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceMiniController.js +29 -28
- package/dist/shared/assistant/ui/voice/VoiceStage.d.ts +10 -0
- package/dist/shared/assistant/ui/voice/VoiceStage.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceStage.js +35 -34
- package/dist/shared/assistant/ui/voice/VoiceStatusText.d.ts +51 -0
- package/dist/shared/assistant/ui/voice/VoiceStatusText.d.ts.map +1 -0
- package/dist/shared/assistant/ui/voice/VoiceStatusText.js +42 -0
- package/dist/shared/assistant/voice/rotationClock.d.ts +31 -0
- package/dist/shared/assistant/voice/rotationClock.d.ts.map +1 -0
- package/dist/shared/assistant/voice/rotationClock.js +27 -0
- package/dist/shared/assistant/voice/voiceStatus.d.ts +81 -0
- package/dist/shared/assistant/voice/voiceStatus.d.ts.map +1 -0
- package/dist/shared/assistant/voice/voiceStatus.js +33 -0
- package/dist/shared-assistant.js +94 -85
- package/package.json +1 -1
|
@@ -5,188 +5,152 @@ import { useAssistantProduct as n } from "../product.js";
|
|
|
5
5
|
import { useAssistantTr as r } from "../i18n.js";
|
|
6
6
|
import { describeQuotaError as i } from "../quota.js";
|
|
7
7
|
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as c, extendAssistantSandboxTTL as l, findExistingSandbox as u, getAssistantArtifacts as ee, getAssistantMessages as te, getAssistantSession as d, releaseSupersededAssistantSandboxes as f, sendAssistantPromptAsync as ne, waitForAssistantServiceReady as p, waitForSandboxRunning as m } from "../api.js";
|
|
8
|
-
import {
|
|
9
|
-
import { streamBudgetMs as
|
|
10
|
-
import { isVoiceTurn as
|
|
11
|
-
import { buildContinuedFromVoiceNote as
|
|
12
|
-
import { pollDelayMs as
|
|
13
|
-
import { toCaptionText as
|
|
14
|
-
import { resolveAssistantLanguage as
|
|
15
|
-
import { resolveLanguagePair as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { parseToolActivity as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
8
|
+
import { getRawMessageCreatedAt as re, sanitize as ie } from "../progress.js";
|
|
9
|
+
import { streamBudgetMs as ae, withIncompleteTurnNotice as oe } from "../streamBudget.js";
|
|
10
|
+
import { isVoiceTurn as se, voiceMarker as h, voiceSessionIdOf as g } from "../voice/turnVisibility.js";
|
|
11
|
+
import { buildContinuedFromVoiceNote as _, buildVoiceTranscriptMarkdown as ce, voiceTranscriptFilename as v } from "../voice/voiceTranscript.js";
|
|
12
|
+
import { pollDelayMs as le } from "../voice/assistantPollSchedule.js";
|
|
13
|
+
import { toCaptionText as ue } from "../voice/captionText.js";
|
|
14
|
+
import { resolveAssistantLanguage as de } from "../voice/languages.js";
|
|
15
|
+
import { resolveLanguagePair as fe } from "../voice/languagePair.js";
|
|
16
|
+
import { buildPromptParts as pe, buildPromptWithAttachments as me, countInlineImageCandidates as he, countInlinedImageParts as ge, getSendableAttachments as _e, toMessageAttachment as ve } from "../attachments.js";
|
|
17
|
+
import { useAssistantStore as y } from "../store.js";
|
|
18
|
+
import { isTurnInFlight as b, planAbandonedTurn as ye, planTurnAbort as be } from "../turnState.js";
|
|
19
|
+
import { getAssistantDisplayContent as xe } from "../displayContent.js";
|
|
20
|
+
import { buildAssistantProgress as Se } from "../turnProgress.js";
|
|
21
|
+
import { parseToolActivity as Ce } from "./AssistantToolActivity.js";
|
|
22
|
+
import { countSpokenTurns as we, spokenTurnText as Te } from "../spokenTurns.js";
|
|
23
|
+
import { useVoiceSession as Ee } from "./useVoiceSession.js";
|
|
24
|
+
import { getOrganizationId as De, getWorkspaceId as Oe } from "../context.js";
|
|
25
|
+
import { createReadinessTracker as ke } from "../sandboxReadiness.js";
|
|
26
|
+
import { AssistantSpokenTurnsNotice as Ae } from "./AssistantSpokenTurnsNotice.js";
|
|
27
|
+
import { VoiceTranscriptDrawer as je } from "./voice/VoiceTranscriptDrawer.js";
|
|
28
|
+
import { downloadFile as Me } from "../exportConversation.js";
|
|
29
|
+
import { AssistantEmptyState as Ne } from "./AssistantEmptyState.js";
|
|
30
|
+
import { AssistantMessageList as Pe } from "./AssistantMessageList.js";
|
|
31
|
+
import { AssistantVoiceSession as Fe } from "./voice/AssistantVoiceSession.js";
|
|
32
|
+
import { useAssistantApiAccess as Ie } from "../useAssistantApiAccess.js";
|
|
33
|
+
import { useConversationTurns as Le } from "../useConversationTurns.js";
|
|
34
|
+
import { isMultimodalBodyRejection as Re, isRecoverableAssistantError as ze } from "../transportErrors.js";
|
|
35
|
+
import { dispatchAssistantQuotaExhausted as Be, notifyAiCreditsUpdated as Ve } from "../aiCredits.js";
|
|
36
|
+
import { useAssistantAttachments as He } from "../useAssistantAttachments.js";
|
|
37
|
+
import { AssistantComposer as Ue } from "./composer/AssistantComposer.js";
|
|
38
|
+
import { isProdRuntime as We } from "../env.js";
|
|
39
|
+
import { AssistantApiCallsConsentDialog as Ge } from "./AssistantApiCallsConsentDialog.js";
|
|
40
|
+
import { useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as Ke } from "react";
|
|
41
|
+
import { jsx as T, jsxs as qe } from "react/jsx-runtime";
|
|
41
42
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
42
|
-
var
|
|
43
|
-
function
|
|
43
|
+
var Je = 600, Ye = 2e4;
|
|
44
|
+
function Xe() {
|
|
44
45
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
function k(e) {
|
|
50
|
-
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
51
|
-
}
|
|
52
|
-
function A(e) {
|
|
53
|
-
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
54
|
-
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
55
|
-
return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function Ze(e, t) {
|
|
59
|
-
let n = e.filter((e) => e.info?.role === "assistant" && Xe(e) > t).sort((e, t) => Xe(e) - Xe(t));
|
|
60
|
-
if (n.length === 0) return {
|
|
61
|
-
content: S.thinking.fallback,
|
|
62
|
-
done: !1
|
|
63
|
-
};
|
|
64
|
-
let r = n[n.length - 1], i = k(r.parts), a = h(r.parts), o = A(r.parts), s = b(r.parts), c = [
|
|
65
|
-
i,
|
|
66
|
-
...a,
|
|
67
|
-
...o
|
|
68
|
-
].filter(Boolean).join("\n\n") || S.thinking.fallback, l = r.info?.providerID, u = r.info?.modelID;
|
|
69
|
-
return {
|
|
70
|
-
content: c,
|
|
71
|
-
done: !!r.info?.time?.completed && (!!i || a.length > 0 || o.length > 0),
|
|
72
|
-
tokens: r.info?.tokens,
|
|
73
|
-
messageId: r.info?.id,
|
|
74
|
-
...l && u ? { model: `${l}/${u}` } : {},
|
|
75
|
-
...s ? { pendingWrite: s } : {}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
79
|
-
let k = r(), { product: A, modes: j, gatherPageContext: Qe, buildPrompt: $e, reportTokenUsage: et } = n(), { getAccessToken: M, getWorkspaceToken: N, userId: P } = t(), { locale: tt } = e(), nt = x((e) => e.assistantLanguage), rt = x((e) => e.replyLanguage), it = E(() => de(nt, rt, tt), [
|
|
80
|
-
nt,
|
|
47
|
+
var Ze = ({ visible: Ze = !0, writeAccess: Qe = "unknown" }) => {
|
|
48
|
+
let E = r(), { product: D, modes: O, gatherPageContext: $e, buildPrompt: et, reportTokenUsage: tt } = n(), { getAccessToken: k, getWorkspaceToken: A, userId: j } = t(), { locale: nt } = e(), rt = y((e) => e.assistantLanguage), it = y((e) => e.replyLanguage), at = C(() => fe(rt, it, nt), [
|
|
81
49
|
rt,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
50
|
+
it,
|
|
51
|
+
nt
|
|
52
|
+
]), ot = at.reply.english, st = at.replyIsExplicit, ct = at.reply.code, { conversations: lt, activeConversationId: M, mode: N, processingByConversationId: ut, setMode: dt, setConversationMode: ft, setActiveConversation: pt, createConversation: P, addMessage: F, updateMessage: mt, patchMessage: I, mergeMessageMetadata: ht, setConversationProcessing: L, clearConversationProcessing: gt, setBackendSessionId: _t, clearBackendSessionId: vt, setSandbox: R, clearSandbox: yt, acknowledgeApiCalls: bt } = y(), xt = lt.find((e) => e.id === M), z = Le(xt), St = z.all, B = M ? ut[M] : void 0, Ct = b(B?.status), wt = Ct ? B?.messageId ?? null : null, Tt = B?.status === "error" ? B.messageId : null, { canUseApiCalls: Et, loading: Dt } = Ie(De()), Ot = C(() => O.filter((e) => !e.requiresAdmin || Et), [O, Et]), [kt, At] = Ke(null), [jt, V] = Ke(!1), Mt = w({}), H = w(ke()), Nt = w(/* @__PURE__ */ new Set()), U = C(() => O.find((e) => e.id === N), [O, N]);
|
|
53
|
+
S(() => {
|
|
54
|
+
Dt || (!U || U.requiresAdmin && !Et) && N !== "assistant" && dt("assistant");
|
|
86
55
|
}, [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Tt,
|
|
56
|
+
N,
|
|
57
|
+
U,
|
|
90
58
|
Et,
|
|
91
|
-
|
|
59
|
+
Dt,
|
|
60
|
+
dt
|
|
92
61
|
]);
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
k
|
|
99
|
-
]), Ft = w(async (e, t, n, r, i) => {
|
|
100
|
-
let a = x.getState().sandboxesByMode[n]?.sandboxId ?? null, o = async (e) => {
|
|
101
|
-
if (W.current.isFresh(e)) return !0;
|
|
62
|
+
let W = x((e, t, n, r) => {
|
|
63
|
+
L(e, n, t, null, r);
|
|
64
|
+
}, [L]), Pt = x(async (e, t, n, r, i) => {
|
|
65
|
+
let a = y.getState().sandboxesByMode[n]?.sandboxId ?? null, o = async (e) => {
|
|
66
|
+
if (H.current.isFresh(e)) return !0;
|
|
102
67
|
try {
|
|
103
|
-
return await m(e, r, i, 3e5), await p(e, r, i, 9e4),
|
|
68
|
+
return await m(e, r, i, 3e5), await p(e, r, i, 9e4), H.current.markVerified(e), !0;
|
|
104
69
|
} catch {
|
|
105
|
-
return
|
|
70
|
+
return H.current.invalidate(e), !1;
|
|
106
71
|
}
|
|
107
72
|
};
|
|
108
|
-
if (a && (
|
|
109
|
-
|
|
110
|
-
let s = await u(r,
|
|
111
|
-
s && (
|
|
73
|
+
if (a && (R(n, a, "provisioning"), W(e, t, "provisioning", "reusingEnvironment"), await o(a) || (R(n, null, "provisioning"), a = null)), !a) {
|
|
74
|
+
W(e, t, "provisioning", "lookingForEnvironment");
|
|
75
|
+
let s = await u(r, D, n, We(), i);
|
|
76
|
+
s && (R(n, s, "provisioning"), W(e, t, "provisioning", "reusingEnvironment"), await o(s) ? a = s : R(n, null, "provisioning"));
|
|
112
77
|
}
|
|
113
78
|
if (!a) {
|
|
114
|
-
if (n === "api-calls" && !
|
|
115
|
-
|
|
79
|
+
if (n === "api-calls" && !k()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
80
|
+
W(e, t, "provisioning", "startingEnvironment"), R(n, null, "provisioning"), await f(r, D, n, We(), i), a = await s(D, n, r, We(), Je, i), R(n, a, "provisioning"), await m(a, r, i, 3e5), await p(a, r, i, 9e4);
|
|
116
81
|
}
|
|
117
|
-
|
|
118
|
-
let l =
|
|
82
|
+
R(n, a, "running");
|
|
83
|
+
let l = y.getState().conversations.find((t) => t.id === e)?.backendSessionId ?? null;
|
|
119
84
|
if (l) try {
|
|
120
85
|
let e = await d(a, r, l, i);
|
|
121
86
|
if (e.mode !== n) throw Error(`Session mode mismatch: expected ${n}, received ${e.mode}`);
|
|
122
87
|
} catch {
|
|
123
|
-
|
|
88
|
+
vt(e), l = null;
|
|
124
89
|
}
|
|
125
|
-
return l || (
|
|
90
|
+
return l || (W(e, t, "connecting", "preparingSession"), l = (await c(a, r, n, i)).sessionId, _t(e, l)), {
|
|
126
91
|
sandboxId: a,
|
|
127
92
|
sessionId: l
|
|
128
93
|
};
|
|
129
94
|
}, [
|
|
130
|
-
|
|
131
|
-
M,
|
|
132
|
-
A,
|
|
133
|
-
ht,
|
|
134
|
-
H,
|
|
95
|
+
vt,
|
|
135
96
|
k,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
97
|
+
D,
|
|
98
|
+
_t,
|
|
99
|
+
R,
|
|
100
|
+
W
|
|
101
|
+
]), [Ft, It] = Ke(null), G = w(/* @__PURE__ */ new Set()), Lt = w(null), Rt = x(() => {
|
|
102
|
+
let e = y.getState(), t = e.activeConversationId;
|
|
139
103
|
if (!t) return;
|
|
140
|
-
let n = e.processingByConversationId[t], r =
|
|
104
|
+
let n = e.processingByConversationId[t], r = b(n?.status) ? n?.messageId ?? null : null;
|
|
141
105
|
if (!be({
|
|
142
106
|
interruptedTurnId: r,
|
|
143
107
|
activeTurnId: r,
|
|
144
|
-
alreadyRequested: r ?
|
|
108
|
+
alreadyRequested: r ? G.current.has(r) : !1
|
|
145
109
|
}).send || !r) return;
|
|
146
|
-
|
|
147
|
-
let i = e.sandboxesByMode[e.mode]?.sandboxId, o =
|
|
110
|
+
G.current.add(r);
|
|
111
|
+
let i = e.sandboxesByMode[e.mode]?.sandboxId, o = Oe(), s = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
148
112
|
!i || !o || !s || a(i, o, s, {
|
|
149
|
-
accessToken:
|
|
150
|
-
workspaceToken:
|
|
151
|
-
userId:
|
|
152
|
-
organizationId:
|
|
113
|
+
accessToken: k(),
|
|
114
|
+
workspaceToken: A(),
|
|
115
|
+
userId: j,
|
|
116
|
+
organizationId: De()
|
|
153
117
|
});
|
|
154
118
|
}, [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]),
|
|
159
|
-
let t =
|
|
119
|
+
j,
|
|
120
|
+
k,
|
|
121
|
+
A
|
|
122
|
+
]), zt = x(async (e) => {
|
|
123
|
+
let t = y.getState(), n = t.sandboxesByMode[t.mode]?.sandboxId, r = Oe(), i = t.activeConversationId;
|
|
160
124
|
if (!(!n || !r || !i)) {
|
|
161
|
-
|
|
125
|
+
It(e);
|
|
162
126
|
try {
|
|
163
127
|
await o(n, r, e, {
|
|
164
|
-
accessToken:
|
|
165
|
-
workspaceToken:
|
|
166
|
-
userId:
|
|
167
|
-
organizationId:
|
|
128
|
+
accessToken: k(),
|
|
129
|
+
workspaceToken: A(),
|
|
130
|
+
userId: j,
|
|
131
|
+
organizationId: De()
|
|
168
132
|
});
|
|
169
133
|
} catch (e) {
|
|
170
|
-
|
|
171
|
-
id:
|
|
134
|
+
It(null), F(i, {
|
|
135
|
+
id: Xe(),
|
|
172
136
|
role: "system",
|
|
173
137
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
174
138
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
175
139
|
});
|
|
176
140
|
return;
|
|
177
141
|
}
|
|
178
|
-
|
|
142
|
+
It(null), q.current(E("pendingWrite.approvedPrompt", "I approved that change — go ahead."));
|
|
179
143
|
}
|
|
180
144
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
]),
|
|
185
|
-
let r = n.voiceSessionId !== void 0, a =
|
|
145
|
+
j,
|
|
146
|
+
F,
|
|
147
|
+
E
|
|
148
|
+
]), K = x(async (e, t = [], n = {}) => {
|
|
149
|
+
let r = n.voiceSessionId !== void 0, a = y.getState(), o = a.activeConversationId ?? M;
|
|
186
150
|
if (o) {
|
|
187
|
-
if (
|
|
151
|
+
if (b(a.processingByConversationId[o]?.status)) {
|
|
188
152
|
let r = a.processingByConversationId[o]?.messageId ?? null;
|
|
189
|
-
r &&
|
|
153
|
+
r && G.current.has(r) && (Lt.current = {
|
|
190
154
|
conversationId: o,
|
|
191
155
|
content: e,
|
|
192
156
|
attachments: t,
|
|
@@ -196,366 +160,385 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
196
160
|
}
|
|
197
161
|
if (Nt.current.has(o)) return;
|
|
198
162
|
}
|
|
199
|
-
let s = a.mode, c =
|
|
200
|
-
if (c ? u && u.mode !== s && (u.messages.length > 0 || u.backendSessionId) ? c =
|
|
163
|
+
let s = a.mode, c = M, u = c ? y.getState().conversations.find((e) => e.id === c) : void 0;
|
|
164
|
+
if (c ? u && u.mode !== s && (u.messages.length > 0 || u.backendSessionId) ? c = P(void 0, s) : u && u.mode !== s && ft(c, s) : c = P(void 0, s), !c) return;
|
|
201
165
|
Mt.current[c] = t;
|
|
202
|
-
let d =
|
|
203
|
-
accessToken:
|
|
204
|
-
workspaceToken:
|
|
205
|
-
userId:
|
|
206
|
-
organizationId:
|
|
166
|
+
let d = Oe(), f = {
|
|
167
|
+
accessToken: k(),
|
|
168
|
+
workspaceToken: A(),
|
|
169
|
+
userId: j,
|
|
170
|
+
organizationId: De()
|
|
207
171
|
}, p = {
|
|
208
|
-
id:
|
|
172
|
+
id: Xe(),
|
|
209
173
|
role: "user",
|
|
210
174
|
content: e,
|
|
211
175
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
212
176
|
metadata: {
|
|
213
|
-
...t.length ? { attachments: t.map(
|
|
214
|
-
...
|
|
177
|
+
...t.length ? { attachments: t.map(ve) } : {},
|
|
178
|
+
...h(n.voiceSessionId)
|
|
215
179
|
}
|
|
216
180
|
};
|
|
217
|
-
|
|
218
|
-
let m =
|
|
219
|
-
|
|
181
|
+
F(c, p);
|
|
182
|
+
let m = Xe();
|
|
183
|
+
F(c, {
|
|
220
184
|
id: m,
|
|
221
185
|
role: "assistant",
|
|
222
186
|
content: "",
|
|
223
187
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
224
188
|
metadata: {
|
|
225
|
-
lang:
|
|
226
|
-
...
|
|
189
|
+
lang: ct,
|
|
190
|
+
...h(n.voiceSessionId)
|
|
227
191
|
}
|
|
228
|
-
}),
|
|
229
|
-
let
|
|
230
|
-
|
|
192
|
+
}), L(c, "provisioning", m, null);
|
|
193
|
+
let se = (e, t, r, i, a = ct) => {
|
|
194
|
+
I(c, m, { content: ie(e) }), ht(c, m, {
|
|
231
195
|
lang: a,
|
|
232
196
|
...t?.length ? { artifacts: t } : {},
|
|
233
197
|
...t?.length || r || i ? { mode: s } : {},
|
|
234
198
|
...r ? { sessionId: r } : {},
|
|
235
199
|
...i ? { sandboxId: i } : {},
|
|
236
|
-
...
|
|
200
|
+
...h(n.voiceSessionId)
|
|
237
201
|
});
|
|
238
202
|
}, g = async (n = 1) => {
|
|
239
203
|
let i = !1;
|
|
240
204
|
try {
|
|
241
|
-
let { sandboxId: n, sessionId: a } = await
|
|
242
|
-
|
|
243
|
-
let u =
|
|
244
|
-
i =
|
|
205
|
+
let { sandboxId: n, sessionId: a } = await Pt(c, m, s, d, f), o = (await te(n, d, a, f, { limit: 50 }).catch(() => [])).reduce((e, t) => Math.max(e, re(t)), 0);
|
|
206
|
+
W(c, m, "streaming", "thinking");
|
|
207
|
+
let u = me(e, t), p = et?.(s, u, ot, st, r) ?? u, h = pe(p, t), g = ge(h), _ = g > 0, ce = $e?.();
|
|
208
|
+
i = he(t) > g;
|
|
245
209
|
try {
|
|
246
|
-
await ne(n, d, a, p, s,
|
|
210
|
+
await ne(n, d, a, p, s, ce, f, h?.length ? { parts: h } : void 0);
|
|
247
211
|
} catch (e) {
|
|
248
|
-
if (!
|
|
249
|
-
await ne(n, d, a, p, s,
|
|
212
|
+
if (!h || !Re(e)) throw e;
|
|
213
|
+
await ne(n, d, a, p, s, ce, f, void 0), i ||= _;
|
|
250
214
|
}
|
|
251
|
-
let
|
|
215
|
+
let v = Se([], o), ue = Date.now() + ae(s), de = Date.now(), fe = Date.now(), _e = () => ye({
|
|
252
216
|
turnId: m,
|
|
253
|
-
abortRequested:
|
|
254
|
-
activeTurnId:
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
};
|
|
259
|
-
for (; Date.now() < se;) {
|
|
260
|
-
let e = de();
|
|
217
|
+
abortRequested: G.current.has(m),
|
|
218
|
+
activeTurnId: y.getState().processingByConversationId[c]?.messageId ?? null
|
|
219
|
+
});
|
|
220
|
+
for (; Date.now() < ue;) {
|
|
221
|
+
let e = _e();
|
|
261
222
|
if (e.abandon) {
|
|
262
|
-
|
|
223
|
+
e.clearProcessing && gt(c);
|
|
263
224
|
return;
|
|
264
225
|
}
|
|
265
|
-
if (
|
|
226
|
+
if (v = Se(await te(n, d, a, f, {
|
|
266
227
|
limit: 50,
|
|
267
228
|
sinceMs: o
|
|
268
|
-
}), o),
|
|
269
|
-
Date.now() -
|
|
229
|
+
}), o), I(c, m, { content: ie(v.content) }), v.pendingWrite && ht(c, m, { pendingWrite: v.pendingWrite }), v.done) break;
|
|
230
|
+
Date.now() - de > 3e4 && (await l(n, d, 600, f).catch(() => void 0), de = Date.now()), await new Promise((e) => setTimeout(e, le(Date.now() - fe)));
|
|
270
231
|
}
|
|
271
|
-
let
|
|
272
|
-
if (
|
|
273
|
-
...
|
|
274
|
-
content:
|
|
275
|
-
}), i && (
|
|
276
|
-
...
|
|
277
|
-
content: `${
|
|
278
|
-
}),
|
|
279
|
-
|
|
232
|
+
let ve = s === "vibe-plugins" ? await ee(n, d, a, f).then((e) => e).catch(() => []) : void 0;
|
|
233
|
+
if (v.done || (v = {
|
|
234
|
+
...v,
|
|
235
|
+
content: oe(v.content, s, E)
|
|
236
|
+
}), i && (v = {
|
|
237
|
+
...v,
|
|
238
|
+
content: `${v.content}\n\n${E("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}`
|
|
239
|
+
}), se(v.content, ve, a, n), v.tokens) {
|
|
240
|
+
I(c, m, { tokens: v.tokens });
|
|
280
241
|
try {
|
|
281
|
-
await
|
|
242
|
+
await tt?.({
|
|
282
243
|
workspaceId: d,
|
|
283
244
|
sessionId: a,
|
|
284
|
-
messageId:
|
|
285
|
-
model:
|
|
286
|
-
tokens:
|
|
287
|
-
}),
|
|
245
|
+
messageId: v.messageId,
|
|
246
|
+
model: v.model,
|
|
247
|
+
tokens: v.tokens
|
|
248
|
+
}), Ve(D);
|
|
288
249
|
} catch {}
|
|
289
250
|
}
|
|
290
|
-
let
|
|
291
|
-
if (
|
|
292
|
-
b
|
|
251
|
+
let b = _e();
|
|
252
|
+
if (b.abandon) {
|
|
253
|
+
b.clearProcessing && gt(c);
|
|
293
254
|
return;
|
|
294
255
|
}
|
|
295
|
-
|
|
256
|
+
L(c, "complete", m, null);
|
|
296
257
|
} catch (e) {
|
|
297
|
-
|
|
258
|
+
let t = ye({
|
|
259
|
+
turnId: m,
|
|
260
|
+
abortRequested: G.current.has(m),
|
|
261
|
+
activeTurnId: y.getState().processingByConversationId[c]?.messageId ?? null
|
|
262
|
+
});
|
|
263
|
+
if (t.abandon) {
|
|
264
|
+
t.clearProcessing && gt(c);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (n === 1 && ze(e)) return vt(c), yt(s), mt(c, m, ""), ht(c, m, { pendingWrite: void 0 }), g(2);
|
|
298
268
|
throw e;
|
|
299
269
|
}
|
|
300
|
-
},
|
|
301
|
-
Nt.current.add(
|
|
270
|
+
}, _ = c;
|
|
271
|
+
Nt.current.add(_);
|
|
302
272
|
try {
|
|
303
273
|
if (!d) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
304
274
|
await g();
|
|
305
275
|
} catch (e) {
|
|
306
|
-
|
|
276
|
+
H.current.invalidate(y.getState().sandboxesByMode[s]?.sandboxId ?? null);
|
|
307
277
|
let t = i(e);
|
|
308
278
|
if (t) {
|
|
309
|
-
t.refusal === "exhausted" &&
|
|
279
|
+
t.refusal === "exhausted" && Be(D, "sandbox");
|
|
310
280
|
let e = [t.quotaName, t.traceId ? `reference ${t.traceId}` : null].filter(Boolean).join(" · "), n = t.refusal === "exhausted" ? "You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant." : "This workspace has no sandbox allowance provisioned, so the AI assistant cannot start. Upgrading will not help — ask an administrator to provision it.";
|
|
311
|
-
|
|
281
|
+
se(e ? `${n}\n\n${e}` : n, void 0, void 0, void 0, "en"), L(c, "error", m, null);
|
|
312
282
|
return;
|
|
313
283
|
}
|
|
314
284
|
let r = e instanceof Error ? e.message : "Something went wrong";
|
|
315
|
-
|
|
285
|
+
L(c, "error", m, r), I(c, m, { content: `Sorry, an error occurred: ${r}. Please try again.` }), ht(c, m, {
|
|
316
286
|
lang: "en",
|
|
317
|
-
...
|
|
287
|
+
...h(n.voiceSessionId)
|
|
318
288
|
});
|
|
319
289
|
} finally {
|
|
320
|
-
Nt.current.delete(
|
|
321
|
-
let e =
|
|
322
|
-
|
|
290
|
+
Nt.current.delete(_);
|
|
291
|
+
let e = Lt.current;
|
|
292
|
+
Lt.current = null, e && e.conversationId === _ && q.current(e.content, e.attachments, e.options);
|
|
323
293
|
}
|
|
324
294
|
}, [
|
|
295
|
+
M,
|
|
325
296
|
F,
|
|
326
|
-
|
|
297
|
+
et,
|
|
298
|
+
vt,
|
|
299
|
+
yt,
|
|
300
|
+
lt,
|
|
301
|
+
P,
|
|
302
|
+
Pt,
|
|
327
303
|
$e,
|
|
328
|
-
|
|
329
|
-
_t,
|
|
330
|
-
ct,
|
|
331
|
-
L,
|
|
332
|
-
Ft,
|
|
333
|
-
Qe,
|
|
334
|
-
M,
|
|
335
|
-
N,
|
|
336
|
-
B,
|
|
304
|
+
k,
|
|
337
305
|
A,
|
|
338
|
-
|
|
339
|
-
|
|
306
|
+
I,
|
|
307
|
+
D,
|
|
308
|
+
tt,
|
|
340
309
|
st,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
310
|
+
ct,
|
|
311
|
+
ot,
|
|
312
|
+
_t,
|
|
313
|
+
ft,
|
|
314
|
+
L,
|
|
315
|
+
gt,
|
|
316
|
+
E,
|
|
317
|
+
W,
|
|
345
318
|
mt,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}, [q]), Ht = w(() => {
|
|
353
|
-
let e = [...U.chat].reverse().find((e) => e.role === "user"), t = F ? Mt.current[F] ?? [] : [];
|
|
354
|
-
e && q(e.content, t);
|
|
319
|
+
j
|
|
320
|
+
]), Bt = x((e) => {
|
|
321
|
+
K(e);
|
|
322
|
+
}, [K]), Vt = x(() => {
|
|
323
|
+
let e = [...z.chat].reverse().find((e) => e.role === "user"), t = M ? Mt.current[M] ?? [] : [];
|
|
324
|
+
e && K(e.content, t);
|
|
355
325
|
}, [
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
]),
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}, [
|
|
363
|
-
let
|
|
364
|
-
if (
|
|
365
|
-
for (let e =
|
|
366
|
-
let t =
|
|
367
|
-
if (t?.role !== "assistant" || !
|
|
368
|
-
let n =
|
|
369
|
-
|
|
326
|
+
St,
|
|
327
|
+
K,
|
|
328
|
+
M
|
|
329
|
+
]), q = w(K);
|
|
330
|
+
S(() => {
|
|
331
|
+
q.current = K;
|
|
332
|
+
}, [K]);
|
|
333
|
+
let J = C(() => {
|
|
334
|
+
if (Ct) return null;
|
|
335
|
+
for (let e = St.length - 1; e >= 0; --e) {
|
|
336
|
+
let t = St[e];
|
|
337
|
+
if (t?.role !== "assistant" || !se(t) || G.current.has(t.id)) continue;
|
|
338
|
+
let n = xe(t, B, E);
|
|
339
|
+
if (n.kind !== "output") return null;
|
|
340
|
+
let r = Ce(n.text).text.trim();
|
|
341
|
+
return r ? {
|
|
370
342
|
id: t.id,
|
|
371
|
-
text:
|
|
343
|
+
text: r
|
|
372
344
|
} : null;
|
|
373
345
|
}
|
|
374
346
|
return null;
|
|
375
|
-
}, [
|
|
347
|
+
}, [
|
|
348
|
+
St,
|
|
349
|
+
Ct,
|
|
350
|
+
B,
|
|
351
|
+
E
|
|
352
|
+
]), Ht = C(() => J ? ue(J.text) : null, [J]), Ut = z.chat, Y = C(() => z.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
376
353
|
id: e.id,
|
|
377
354
|
role: e.role,
|
|
378
|
-
text:
|
|
379
|
-
sessionId:
|
|
355
|
+
text: Te(e, B, E),
|
|
356
|
+
sessionId: g(e),
|
|
380
357
|
timestamp: e.timestamp
|
|
381
|
-
})).filter((e) => e.text.length > 0), [
|
|
382
|
-
|
|
358
|
+
})).filter((e) => e.text.length > 0), [
|
|
359
|
+
z.voice,
|
|
360
|
+
B,
|
|
361
|
+
E
|
|
362
|
+
]), Wt = x(() => {
|
|
363
|
+
if (Y.length === 0) return;
|
|
383
364
|
let e = /* @__PURE__ */ new Date();
|
|
384
|
-
|
|
385
|
-
title:
|
|
386
|
-
savedAt:
|
|
387
|
-
session:
|
|
388
|
-
earlier:
|
|
389
|
-
you:
|
|
390
|
-
assistant:
|
|
391
|
-
}, e),
|
|
365
|
+
Me(ce(Y, {
|
|
366
|
+
title: E("voiceSession.transcript", "Voice conversation"),
|
|
367
|
+
savedAt: E("voiceSession.savedAt", "Saved"),
|
|
368
|
+
session: E("voiceSession.sessionLabel", "Session"),
|
|
369
|
+
earlier: E("voiceSession.earlierLabel", "Earlier"),
|
|
370
|
+
you: E("voiceSession.speakerYou", "You"),
|
|
371
|
+
assistant: E("voiceSession.speakerAssistant", "Assistant")
|
|
372
|
+
}, e), v(D, e), "text/markdown");
|
|
392
373
|
}, [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
]),
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
onSubmit:
|
|
374
|
+
D,
|
|
375
|
+
Y,
|
|
376
|
+
E
|
|
377
|
+
]), X = He(), Z = w(X);
|
|
378
|
+
Z.current = X;
|
|
379
|
+
let Q = Ee({
|
|
380
|
+
onSubmit: x((e, t) => {
|
|
400
381
|
let n = () => {
|
|
401
|
-
let n =
|
|
402
|
-
|
|
382
|
+
let n = Z.current, r = _e(n.attachments);
|
|
383
|
+
q.current(e, r, { voiceSessionId: t }), n.clear();
|
|
403
384
|
};
|
|
404
|
-
if (!
|
|
385
|
+
if (!Z.current.isBusy) {
|
|
405
386
|
n();
|
|
406
387
|
return;
|
|
407
388
|
}
|
|
408
389
|
let r = Date.now(), i = window.setInterval(() => {
|
|
409
|
-
|
|
390
|
+
Z.current.isBusy && Date.now() - r < Ye || (window.clearInterval(i), n());
|
|
410
391
|
}, 200);
|
|
411
392
|
}, []),
|
|
412
|
-
latestReply:
|
|
413
|
-
language:
|
|
414
|
-
}),
|
|
415
|
-
let e =
|
|
416
|
-
!e ||
|
|
417
|
-
id:
|
|
393
|
+
latestReply: J,
|
|
394
|
+
language: de(rt, nt).tag
|
|
395
|
+
}), Gt = C(() => (xt?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [xt?.messages]), $ = we(z.voice, B, E), Kt = $ > Gt, qt = x(() => {
|
|
396
|
+
let e = y.getState().activeConversationId;
|
|
397
|
+
!e || Y.length === 0 || (F(e, {
|
|
398
|
+
id: Xe(),
|
|
418
399
|
role: "system",
|
|
419
|
-
content:
|
|
420
|
-
intro:
|
|
421
|
-
nothing:
|
|
422
|
-
more: (e) =>
|
|
400
|
+
content: _(Y.slice(Gt), {
|
|
401
|
+
intro: E("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
402
|
+
nothing: E("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
403
|
+
more: (e) => E("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
423
404
|
}),
|
|
424
405
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
425
|
-
metadata: { continuedVoiceTurns:
|
|
426
|
-
}),
|
|
406
|
+
metadata: { continuedVoiceTurns: $ }
|
|
407
|
+
}), V(!1), Q.end());
|
|
427
408
|
}, [
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
409
|
+
Y,
|
|
410
|
+
$,
|
|
411
|
+
Gt,
|
|
412
|
+
F,
|
|
413
|
+
E,
|
|
414
|
+
Q
|
|
415
|
+
]), Jt = w(0);
|
|
416
|
+
S(() => {
|
|
417
|
+
Q.active && (Jt.current = $);
|
|
418
|
+
}, [Q.active]);
|
|
419
|
+
let Yt = x(() => {
|
|
420
|
+
let e = $ > Jt.current;
|
|
421
|
+
Q.end(), e && V(!0);
|
|
422
|
+
}, [$, Q]);
|
|
423
|
+
S(() => {
|
|
424
|
+
!Ze && Q.active && Q.end();
|
|
425
|
+
}, [Ze, Q]), S(() => {
|
|
426
|
+
Q.active || (Z.current.clear(), Lt.current = null);
|
|
427
|
+
}, [Q.active]), S(() => {
|
|
428
|
+
let e = y.getState().consumePendingPrompt();
|
|
429
|
+
return e && q.current(e), y.subscribe((e, t) => {
|
|
448
430
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
449
|
-
let e =
|
|
450
|
-
e &&
|
|
431
|
+
let e = y.getState().consumePendingPrompt();
|
|
432
|
+
e && q.current(e);
|
|
451
433
|
}
|
|
452
434
|
});
|
|
453
435
|
}, []);
|
|
454
|
-
let
|
|
455
|
-
let t =
|
|
436
|
+
let Xt = x((e) => {
|
|
437
|
+
let t = M ? y.getState().conversations.find((e) => e.id === M) : void 0;
|
|
456
438
|
if (t && (t.messages.length > 0 || t.backendSessionId)) {
|
|
457
439
|
if (t.mode !== e) {
|
|
458
|
-
let t =
|
|
459
|
-
t ?
|
|
440
|
+
let t = y.getState().conversations.find((t) => t.mode === e && t.messages.length === 0 && !t.backendSessionId && !y.getState().processingByConversationId[t.id]);
|
|
441
|
+
t ? pt(t.id) : P(void 0, e);
|
|
460
442
|
}
|
|
461
|
-
} else
|
|
462
|
-
|
|
443
|
+
} else M && ft(M, e);
|
|
444
|
+
dt(e);
|
|
463
445
|
}, [
|
|
464
|
-
|
|
465
|
-
|
|
446
|
+
M,
|
|
447
|
+
P,
|
|
448
|
+
pt,
|
|
466
449
|
ft,
|
|
467
|
-
dt
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
kt(e);
|
|
450
|
+
dt
|
|
451
|
+
]), Zt = x((e) => {
|
|
452
|
+
if (O.find((t) => t.id === e)?.writeCapable && !y.getState().apiCallsAcknowledged) {
|
|
453
|
+
At(e);
|
|
472
454
|
return;
|
|
473
455
|
}
|
|
474
|
-
|
|
475
|
-
}, [
|
|
476
|
-
let e =
|
|
477
|
-
|
|
456
|
+
Xt(e);
|
|
457
|
+
}, [Xt, O]), Qt = x(() => {
|
|
458
|
+
let e = kt;
|
|
459
|
+
At(null), bt(), e && Xt(e);
|
|
478
460
|
}, [
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
]),
|
|
483
|
-
|
|
461
|
+
kt,
|
|
462
|
+
bt,
|
|
463
|
+
Xt
|
|
464
|
+
]), $t = x(() => {
|
|
465
|
+
At(null);
|
|
484
466
|
}, []);
|
|
485
|
-
return /* @__PURE__ */
|
|
467
|
+
return /* @__PURE__ */ qe("div", {
|
|
486
468
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
487
469
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ qe("div", {
|
|
489
471
|
className: "contents",
|
|
490
|
-
inert:
|
|
472
|
+
inert: Q.active || void 0,
|
|
491
473
|
children: [
|
|
492
|
-
|
|
493
|
-
count:
|
|
494
|
-
onOpenTranscript: () =>
|
|
474
|
+
Y.length > 0 && !Q.active ? /* @__PURE__ */ T(Ae, {
|
|
475
|
+
count: Y.length,
|
|
476
|
+
onOpenTranscript: () => V(!0)
|
|
495
477
|
}) : null,
|
|
496
|
-
|
|
497
|
-
mode:
|
|
498
|
-
onSuggestionClick:
|
|
499
|
-
}) : /* @__PURE__ */
|
|
478
|
+
Ut.length === 0 ? /* @__PURE__ */ T(Ne, {
|
|
479
|
+
mode: N,
|
|
480
|
+
onSuggestionClick: Bt
|
|
481
|
+
}) : /* @__PURE__ */ T("div", {
|
|
500
482
|
className: "flex min-h-0 flex-1 flex-col",
|
|
501
|
-
children: /* @__PURE__ */
|
|
502
|
-
onApprovePendingWrite:
|
|
503
|
-
approvingWriteRef:
|
|
504
|
-
messages:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
483
|
+
children: /* @__PURE__ */ T(Pe, {
|
|
484
|
+
onApprovePendingWrite: zt,
|
|
485
|
+
approvingWriteRef: Ft,
|
|
486
|
+
messages: Ut,
|
|
487
|
+
processing: B ?? null,
|
|
488
|
+
streamingMessageId: wt,
|
|
489
|
+
failedMessageId: Tt,
|
|
490
|
+
onRetry: Vt
|
|
508
491
|
})
|
|
509
492
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
onStartVoiceSession:
|
|
512
|
-
onSend: (e, t) => void
|
|
513
|
-
disabled:
|
|
514
|
-
placeholder:
|
|
515
|
-
mode:
|
|
516
|
-
writeAccessDenied:
|
|
517
|
-
availableModes:
|
|
518
|
-
onModeChange:
|
|
493
|
+
/* @__PURE__ */ T(Ue, {
|
|
494
|
+
onStartVoiceSession: Q.available && N !== "api-calls" ? Q.start : void 0,
|
|
495
|
+
onSend: (e, t) => void K(e, t),
|
|
496
|
+
disabled: Ct,
|
|
497
|
+
placeholder: N === "api-calls" ? E("chatArea.placeholderActions", "What would you like me to do?") : E("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
498
|
+
mode: N,
|
|
499
|
+
writeAccessDenied: Qe === "denied" && !!U?.writeCapable,
|
|
500
|
+
availableModes: Ot,
|
|
501
|
+
onModeChange: Zt
|
|
519
502
|
})
|
|
520
503
|
]
|
|
521
504
|
}),
|
|
522
|
-
|
|
523
|
-
turns:
|
|
524
|
-
onClose: () =>
|
|
525
|
-
onSave:
|
|
526
|
-
onContinueInChat:
|
|
505
|
+
jt && !Q.active ? /* @__PURE__ */ T(je, {
|
|
506
|
+
turns: Y,
|
|
507
|
+
onClose: () => V(!1),
|
|
508
|
+
onSave: Wt,
|
|
509
|
+
onContinueInChat: Kt ? qt : void 0,
|
|
527
510
|
closeOnEscape: !0
|
|
528
511
|
}) : null,
|
|
529
|
-
|
|
530
|
-
session:
|
|
531
|
-
notice:
|
|
532
|
-
capturing:
|
|
533
|
-
interrupting:
|
|
534
|
-
awaitingEndpoint:
|
|
535
|
-
turns:
|
|
536
|
-
spokenChunks:
|
|
537
|
-
attachments:
|
|
538
|
-
onAttachFiles:
|
|
539
|
-
onRemoveAttachment:
|
|
540
|
-
onRetryAttachment:
|
|
541
|
-
canAttachMore:
|
|
542
|
-
preparingAttachments:
|
|
543
|
-
onSaveTranscript:
|
|
544
|
-
onContinueInChat:
|
|
512
|
+
Q.active && /* @__PURE__ */ T(Fe, {
|
|
513
|
+
session: Q.session,
|
|
514
|
+
notice: Q.notice,
|
|
515
|
+
capturing: Q.capturing,
|
|
516
|
+
interrupting: Q.interrupting,
|
|
517
|
+
awaitingEndpoint: Q.awaitingEndpoint,
|
|
518
|
+
turns: Y,
|
|
519
|
+
spokenChunks: Q.spokenChunks,
|
|
520
|
+
attachments: X.attachments,
|
|
521
|
+
onAttachFiles: X.addFiles,
|
|
522
|
+
onRemoveAttachment: X.remove,
|
|
523
|
+
onRetryAttachment: X.retry,
|
|
524
|
+
canAttachMore: X.canAddMore,
|
|
525
|
+
preparingAttachments: X.preparingCount,
|
|
526
|
+
onSaveTranscript: Wt,
|
|
527
|
+
onContinueInChat: qt,
|
|
545
528
|
onInterrupt: () => {
|
|
546
|
-
|
|
529
|
+
Q.interrupt(), Rt();
|
|
547
530
|
},
|
|
548
|
-
spoken:
|
|
549
|
-
onToggleMute:
|
|
550
|
-
onEnd:
|
|
531
|
+
spoken: Ht,
|
|
532
|
+
onToggleMute: Q.toggleMute,
|
|
533
|
+
onEnd: Yt
|
|
551
534
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
open:
|
|
554
|
-
onConfirm:
|
|
555
|
-
onCancel:
|
|
535
|
+
/* @__PURE__ */ T(Ge, {
|
|
536
|
+
open: kt !== null,
|
|
537
|
+
onConfirm: Qt,
|
|
538
|
+
onCancel: $t
|
|
556
539
|
})
|
|
557
540
|
]
|
|
558
541
|
});
|
|
559
542
|
};
|
|
560
543
|
//#endregion
|
|
561
|
-
export {
|
|
544
|
+
export { Ze as AssistantChatArea };
|