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