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