@burdenoff/fe-libs 2026.1003.1 → 2026.1003.3
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/chrome/mobileTabBar/selectTabs.d.ts.map +1 -1
- package/dist/chrome/mobileTabBar/selectTabs.js +9 -8
- package/dist/chrome/sideNavigation/NavItemRenderer.d.ts.map +1 -1
- package/dist/chrome/sideNavigation/NavItemRenderer.js +62 -61
- package/dist/shared/assistant/conversation.d.ts +20 -6
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +43 -24
- package/dist/shared/assistant/i18nManifest.d.ts +9 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +9 -0
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +28 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.js +54 -1
- package/dist/shared/assistant/localUiCommands.d.ts +33 -3
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.js +110 -59
- package/dist/shared/assistant/prewarm.d.ts +71 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.js +49 -2
- package/dist/shared/assistant/speech/speechFeed.d.ts +63 -0
- package/dist/shared/assistant/speech/speechFeed.d.ts.map +1 -0
- package/dist/shared/assistant/speech/speechFeed.js +40 -0
- package/dist/shared/assistant/turnTimeline.d.ts +22 -2
- package/dist/shared/assistant/turnTimeline.d.ts.map +1 -1
- package/dist/shared/assistant/turnTimeline.js +18 -1
- package/dist/shared/assistant/turnTimingReport.d.ts.map +1 -1
- package/dist/shared/assistant/turnTimingReport.js +5 -4
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +1096 -914
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +18 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +198 -169
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +2 -1
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.js +1 -7
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +165 -153
- package/dist/shared/assistant/uiActions/backStack.d.ts +35 -0
- package/dist/shared/assistant/uiActions/backStack.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/backStack.js +28 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts +41 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigateAction.js +40 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts +52 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.js +61 -0
- package/dist/shared/assistant/voice/speakableText.d.ts +16 -1
- package/dist/shared/assistant/voice/speakableText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speakableText.js +116 -102
- package/dist/shared/assistant/voice/voiceSession.d.ts +12 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +6 -0
- package/dist/shared/navigation/navTargetPath.d.ts +23 -0
- package/dist/shared/navigation/navTargetPath.d.ts.map +1 -0
- package/dist/shared/navigation/navTargetPath.js +6 -0
- package/dist/shared-assistant.js +154 -150
- package/package.json +1 -1
|
@@ -8,296 +8,316 @@ import { useAssistantNavigate as a } from "./AssistantMarkdownRenderer.js";
|
|
|
8
8
|
import { isAssistantModeId as o } from "../modeIds.js";
|
|
9
9
|
import { AUTO_READ_MODE as s, autoSuggestions as c, classifyAssistantIntent as l, escalationToUndo as u, isAutoRoutingOffered as d, resolveAutoRoute as f } from "../autoRouting.js";
|
|
10
10
|
import { getHistoryStamp as p, setHistoryBusyProbe as ee } from "../history/stampRegistry.js";
|
|
11
|
-
import { beginApprovalInFlight as m, endApprovalInFlight as
|
|
11
|
+
import { beginApprovalInFlight as m, endApprovalInFlight as h, getApprovalInFlight as te, markLiveTurn as ne, newestModelReplyId as re, resolveApprovablePendingWrite as g, resolveRetryableMessageId as _, subscribeApprovalInFlight as v } from "../liveTurns.js";
|
|
12
12
|
import { isWriteModeAcknowledged as ie, writeModeSendRefusalReason as ae } from "../writeModeConsent.js";
|
|
13
13
|
import { resolveActiveModeSandbox as y, useAssistantStore as b } from "../store.js";
|
|
14
|
-
import { abortAssistantTurn as oe, approvePendingWrite as se, createAssistantSandbox as x, createAssistantSession as
|
|
15
|
-
import { sanitize as
|
|
16
|
-
import { AssistantSendRefusal as
|
|
17
|
-
import { assistantUsageLedger as
|
|
18
|
-
import { withIncompleteTurnNotice as
|
|
19
|
-
import { chatTurns as
|
|
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 {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
14
|
+
import { abortAssistantTurn as oe, approvePendingWrite as se, createAssistantSandbox as x, createAssistantSession as S, extendAssistantSandboxTTL as ce, findExistingSandboxWithStatus as le, getAssistantArtifacts as ue, getAssistantMessages as de, getAssistantSession as C, modeRequiresConfirmWrites as fe, promptGatewayRequestBytes as pe, releaseSupersededAssistantSandboxes as w, sendAssistantPromptAsync as me, waitForAssistantServiceReady as T, waitForSandboxRunning as he, writeApprovalModeOf as ge } from "../api.js";
|
|
15
|
+
import { sanitize as _e } from "../progress.js";
|
|
16
|
+
import { AssistantSendRefusal as ve, classifyTurnFailure as ye, turnConfirmsNoAction as be, turnOutcomeCopy as xe } from "../turnOutcome.js";
|
|
17
|
+
import { assistantUsageLedger as Se, hasPendingUsageReports as Ce, reportUsageWithRetry as we, retryPendingUsageReports as Te, usageSendRefusal as Ee } from "../usageReporting.js";
|
|
18
|
+
import { withIncompleteTurnNotice as De } from "../streamBudget.js";
|
|
19
|
+
import { chatTurns as E, isVoiceTurn as Oe, voiceMarker as D, voiceSessionIdOf as ke } from "../voice/turnVisibility.js";
|
|
20
|
+
import { speechFeed as Ae } from "../speech/speechFeed.js";
|
|
21
|
+
import { buildContinuedFromVoiceNote as je, buildVoiceTranscriptMarkdown as Me, voiceTranscriptFilename as Ne } from "../voice/voiceTranscript.js";
|
|
22
|
+
import { pollDelayMs as Pe } from "../voice/assistantPollSchedule.js";
|
|
23
|
+
import { toCaptionText as Fe } from "../voice/captionText.js";
|
|
24
|
+
import { resolveAssistantLanguage as Ie } from "../voice/languages.js";
|
|
25
|
+
import { resolveLanguagePair as Le } from "../voice/languagePair.js";
|
|
26
|
+
import { INITIAL_TRANSCRIPT_AUTO_OPEN as Re, isAwaitingOwnConversation as ze, maySendSpokenTurn as Be, planTranscriptAutoOpen as Ve, planVoiceSessionBinding as He, planVoiceSessionStart as Ue, planVoiceSpokenEntry as We, voiceBindingAtStart as Ge, voiceBindingConversationId as Ke } from "../voice/voiceReopen.js";
|
|
27
|
+
import { countInlineImageCandidates as qe, countInlinedImageParts as Je, getSendableAttachments as Ye, largestInlineCharsPerFile as Xe, resolveAssistantInlineLimits as Ze, toMessageAttachment as Qe } from "../attachments.js";
|
|
28
|
+
import { WRITE_PROPOSAL_VOICE_COPY as $e, isVoiceProposalBound as et, voiceProposalChip as tt, voiceProposalChipText as nt, voiceReadbacksDue as rt, voiceWaitingProposals as it, writeProposalVoiceLine as at, writeProposalVoiceReadback as ot } from "../writeProposalVoice.js";
|
|
29
|
+
import { createAdminModeAccessGate as st, resolveAssistantSendModeAfterAccess as ct } from "../adminModeSendGate.js";
|
|
30
|
+
import { buildBoundedAttachmentTurn as lt } from "../attachmentTurn.js";
|
|
31
|
+
import { isTurnInFlight as ut, planAbandonedTurn as dt, planTurnAbort as ft } from "../turnState.js";
|
|
32
|
+
import { getAssistantDisplayContent as pt } from "../displayContent.js";
|
|
33
|
+
import { NO_FIRST_TEXT as mt, buildAssistantProgress as ht, readAheadFor as gt, snapshotReplyFloor as _t, startSessionReadAhead as vt, trackFirstText as yt } from "../turnProgress.js";
|
|
34
|
+
import { parseToolActivity as bt } from "./AssistantToolActivity.js";
|
|
35
|
+
import { countSpokenTurns as xt, spokenMessagesSinceContinueNote as St, spokenTurnText as Ct } from "../spokenTurns.js";
|
|
36
|
+
import { beginTurn as wt, describeTurn as O, detectTurnDevice as Tt, markTurn as k, restartAttempt as Et, turnClockMs as Dt } from "../turnTimeline.js";
|
|
37
|
+
import { useAssistantSpeech as Ot } from "./AssistantSpeechProvider.js";
|
|
38
|
+
import { useVoiceSession as kt } from "./useVoiceSession.js";
|
|
39
|
+
import { getOrganizationId as At, getWorkspaceId as A } from "../context.js";
|
|
40
|
+
import { isMultimodalBodyRejection as jt, isRecoverableAssistantError as Mt } from "../transportErrors.js";
|
|
41
|
+
import { createReadinessTracker as Nt, planAfterTransportFailure as Pt, planTrustedSandboxFailure as Ft } from "../sandboxReadiness.js";
|
|
42
|
+
import { writeProposalConfirmState as It } from "./writeProposalPresentation.js";
|
|
43
|
+
import { writeProposalUsesDialog as Lt } from "./AssistantWriteProposalCard.js";
|
|
44
|
+
import { AssistantWriteConfirmDialog as Rt } from "./AssistantWriteConfirmDialog.js";
|
|
45
|
+
import { useWriteProposalConfirm as zt } from "./useWriteProposalConfirm.js";
|
|
46
|
+
import { AssistantWriteProposalSlot as Bt } from "./AssistantWriteProposalSlot.js";
|
|
47
|
+
import { readWriteProposalRefs as Vt, writeProposalsEnabledFor as Ht } from "../writeProposalDiscovery.js";
|
|
48
|
+
import { planWriteReply as Ut, promptWriteApproval as Wt } from "../writeReplySend.js";
|
|
49
|
+
import { useWriteProposals as Gt } from "./useWriteProposals.js";
|
|
50
|
+
import { AssistantSpokenTurnsNotice as Kt } from "./AssistantSpokenTurnsNotice.js";
|
|
51
|
+
import { AssistantHistoryArchivedNotice as qt, AssistantHistoryDeletedNotice as Jt, AssistantHistoryLoadState as Yt, AssistantHistoryReadOnlyBanner as Xt, AssistantHistoryShowEarlier as Zt } from "./AssistantHistoryNotices.js";
|
|
52
|
+
import { VoiceTranscriptDrawer as Qt } from "./voice/VoiceTranscriptDrawer.js";
|
|
53
|
+
import { downloadFile as $t } from "../exportConversation.js";
|
|
54
|
+
import { conversationHasHistory as en, isOtherScopeHistoryConversation as tn, isReadOnlyHistoryConversation as nn, isReusableHistoryDraft as rn } from "../history/historyList.js";
|
|
55
|
+
import { useAssistantHistoryStatus as an } from "../history/historyStatus.js";
|
|
56
|
+
import { assistantHistory as on } from "../history/historyEngine.js";
|
|
57
|
+
import { AssistantEmptyState as sn } from "./AssistantEmptyState.js";
|
|
58
|
+
import { AssistantNothingToDeleteNotice as cn } from "./AssistantDeleteConversationDialog.js";
|
|
59
|
+
import { assistantHistoryIsOn as ln } from "./conversationDelete.js";
|
|
60
|
+
import { useConversationDeleteDialog as un } from "./conversationDeleteDialog.js";
|
|
61
|
+
import { resolveConversationDeleteTarget as dn } from "../conversationDeleteCommand.js";
|
|
62
|
+
import { resumeContextFor as fn } from "../history/historyResume.js";
|
|
63
|
+
import { useHistoryRowControlsFor as pn } from "../history/useHistoryRowControls.js";
|
|
64
|
+
import { AssistantMessageList as mn } from "./AssistantMessageList.js";
|
|
65
|
+
import { AssistantVoiceSession as hn } from "./voice/AssistantVoiceSession.js";
|
|
66
|
+
import { useAssistantApiAccess as gn } from "../useAssistantApiAccess.js";
|
|
67
|
+
import { useConversationTurns as _n } from "../useConversationTurns.js";
|
|
68
|
+
import { sendAssistantTurnTimings as vn, startTurnTimingReporting as yn } from "../turnTimingReporter.js";
|
|
69
|
+
import { QuarantineSet as bn, WarmCancelled as xn, claimPreopenedSession as Sn, consumeWarm as Cn, preopenKey as wn, preopenWanted as Tn, prewarmTarget as En, settleWarmBeforeSend as Dn, startPreopen as On, startWarm as kn, warmState as An } from "../prewarm.js";
|
|
70
|
+
import { isAlreadyThere as jn, matchLocalUiCommand as Mn, navDestinations as Nn, planThemeChange as Pn } from "../localUiCommands.js";
|
|
71
|
+
import { backDoneCopy as Fn, chooseDestinationCopy as In, navigationCommandCopy as Ln, navigationOutcomeCopy as Rn, themeCommandCopy as zn } from "../localUiCommandCopy.js";
|
|
72
|
+
import { runNavigation as Bn } from "../uiActions/navigationOutcome.js";
|
|
73
|
+
import { assistantBackStack as Vn, isBackRunnable as Hn } from "../uiActions/backStack.js";
|
|
74
|
+
import { buildNavigateAction as Un, destinationForPath as Wn, labelForPath as Gn, newestAssistantOnSurface as Kn } from "../uiActions/navigateAction.js";
|
|
75
|
+
import { dispatchAssistantQuotaExhausted as qn, notifyAiCreditsUpdated as Jn } from "../aiCredits.js";
|
|
76
|
+
import { useAssistantAttachments as Yn } from "../useAssistantAttachments.js";
|
|
77
|
+
import { AssistantComposer as Xn } from "./composer/AssistantComposer.js";
|
|
78
|
+
import { isProdRuntime as Zn } from "../env.js";
|
|
79
|
+
import { AssistantApiCallsConsentDialog as Qn } from "./AssistantApiCallsConsentDialog.js";
|
|
80
|
+
import { useVisibleNavItems as $n } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
81
|
+
import { useCallback as j, useEffect as M, useMemo as er, useRef as N, useState as tr, useSyncExternalStore as nr } from "react";
|
|
82
|
+
import { jsx as P, jsxs as rr } from "react/jsx-runtime";
|
|
79
83
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
80
|
-
var
|
|
81
|
-
function
|
|
84
|
+
var ir = 600, ar = 2e4, or = 1e4, sr = 6e3;
|
|
85
|
+
function F() {
|
|
82
86
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
83
87
|
}
|
|
84
|
-
var
|
|
85
|
-
let
|
|
88
|
+
var cr = ({ visible: cr = !0, writeAccess: lr = "unknown" }) => {
|
|
89
|
+
let I = i(), { product: L, modes: R, gatherPageContext: ur, buildPrompt: dr, reportTurnTimings: fr, reportTokenUsage: pr, localUiCommands: mr } = r(), z = ge(r().writeApproval), hr = j((e, t) => {
|
|
86
90
|
let n = b.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
87
|
-
return
|
|
91
|
+
return et({
|
|
88
92
|
mode: e,
|
|
89
|
-
productWriteApproval:
|
|
93
|
+
productWriteApproval: z,
|
|
90
94
|
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
91
95
|
});
|
|
92
|
-
}, [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]),
|
|
97
|
-
tr:
|
|
98
|
-
productWriteApproval:
|
|
99
|
-
}),
|
|
100
|
-
approve: (e, t) =>
|
|
101
|
-
decline: (e, t, n) =>
|
|
102
|
-
presented: (e, t) =>
|
|
103
|
-
}),
|
|
96
|
+
}, [z]), { getAccessToken: B, getWorkspaceToken: gr, userId: V } = n(), { locale: H } = t(), _r = b((e) => e.assistantLanguage), vr = b((e) => e.replyLanguage), yr = er(() => Le(_r, vr, H), [
|
|
97
|
+
_r,
|
|
98
|
+
vr,
|
|
99
|
+
H
|
|
100
|
+
]), br = yr.reply.english, xr = yr.replyIsExplicit, Sr = yr.reply.code, { conversations: Cr, activeConversationId: U, mode: W, processingByConversationId: wr, setMode: Tr, setConversationMode: Er, setActiveConversation: Dr, createConversation: G, addMessage: K, updateMessage: Or, patchMessage: kr, mergeMessageMetadata: Ar, setConversationProcessing: jr, clearConversationProcessing: Mr, setBackendSessionId: Nr, clearBackendSessionId: Pr, setSandbox: Fr, clearSandbox: Ir, acknowledgedWriteModes: Lr, acknowledgeWriteMode: Rr, autoRouting: zr, setAutoRouting: Br, routeConversation: Vr } = b(), Hr = Cr.find((e) => e.id === U), Ur = _n(Hr), Wr = Ur.all, q = U ? wr[U] : void 0, Gr = ut(q?.status), Kr = Gr ? q?.messageId ?? null : null, qr = q?.status === "error" ? q.messageId : null, Jr = b((e) => e.sandboxWriteCapabilities), { panel: J, entries: Yr, retiredSandboxes: Xr } = Gt({
|
|
101
|
+
tr: I,
|
|
102
|
+
productWriteApproval: z
|
|
103
|
+
}), Zr = zt({
|
|
104
|
+
approve: (e, t) => J.approve(e, t),
|
|
105
|
+
decline: (e, t, n) => J.decline(e, t, n),
|
|
106
|
+
presented: (e, t) => J.presented(e, t)
|
|
107
|
+
}), Qr = Zr.dismiss, $r = N(null);
|
|
104
108
|
M(() => {
|
|
105
|
-
|
|
106
|
-
let e =
|
|
107
|
-
|
|
109
|
+
Qr();
|
|
110
|
+
let e = $r.current;
|
|
111
|
+
$r.current = U, e && e !== U && J.withdraw(e, "conversation_closed"), U && J.openConversation(U);
|
|
108
112
|
}, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
U,
|
|
114
|
+
J,
|
|
115
|
+
Qr
|
|
112
116
|
]);
|
|
113
|
-
let
|
|
117
|
+
let ei = nn(Hr), ti = pn(Hr)?.archivedAt != null, ni = an((e) => U !== null && U in e.loadingIds), ri = an((e) => U !== null && U in e.loadErrorIds), ii = an((e) => e.remoteDelete), [ai, oi] = tr(() => an.getState().remoteDelete?.at ?? null), si = ii?.wasActive === !0 && ii.at !== ai ? ii.at : null;
|
|
114
118
|
M(() => {
|
|
115
|
-
if (
|
|
116
|
-
let e = window.setTimeout(() =>
|
|
119
|
+
if (si === null) return;
|
|
120
|
+
let e = window.setTimeout(() => oi(si), or);
|
|
117
121
|
return () => window.clearTimeout(e);
|
|
118
|
-
}, [
|
|
119
|
-
let { canUseApiCalls:
|
|
120
|
-
loading:
|
|
121
|
-
canUseAdminModes:
|
|
122
|
-
})).current,
|
|
122
|
+
}, [si]);
|
|
123
|
+
let { canUseApiCalls: ci, loading: li } = gn(A(), V), ui = N(st({
|
|
124
|
+
loading: li,
|
|
125
|
+
canUseAdminModes: ci
|
|
126
|
+
})).current, di = N(R);
|
|
123
127
|
M(() => {
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
let
|
|
128
|
+
di.current = R;
|
|
129
|
+
}, [R]);
|
|
130
|
+
let fi = () => {
|
|
127
131
|
let e = b.getState().activeConversationId;
|
|
128
|
-
e &&
|
|
129
|
-
},
|
|
132
|
+
e && on.openConversation(e, { modes: di.current });
|
|
133
|
+
}, pi = () => {
|
|
130
134
|
let e = b.getState().activeConversationId;
|
|
131
|
-
e &&
|
|
132
|
-
},
|
|
135
|
+
e && on.loadEarlier(e);
|
|
136
|
+
}, mi = N(B);
|
|
133
137
|
M(() => {
|
|
134
|
-
|
|
135
|
-
}, [
|
|
136
|
-
let
|
|
138
|
+
mi.current = B;
|
|
139
|
+
}, [B]);
|
|
140
|
+
let hi = !!L && fr !== !1;
|
|
137
141
|
M(() => {
|
|
138
|
-
if (
|
|
142
|
+
if (hi) return yn({ send: (e) => vn(e, {
|
|
139
143
|
workspaceId: A(),
|
|
140
144
|
authContext: {
|
|
141
|
-
accessToken:
|
|
142
|
-
organizationId:
|
|
145
|
+
accessToken: mi.current(),
|
|
146
|
+
organizationId: At()
|
|
143
147
|
}
|
|
144
148
|
}) });
|
|
145
|
-
}, [
|
|
146
|
-
|
|
147
|
-
loading:
|
|
148
|
-
canUseAdminModes:
|
|
149
|
+
}, [hi]), M(() => {
|
|
150
|
+
ui.update({
|
|
151
|
+
loading: li,
|
|
152
|
+
canUseAdminModes: ci
|
|
149
153
|
});
|
|
150
154
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
ui,
|
|
156
|
+
li,
|
|
157
|
+
ci
|
|
154
158
|
]), M(() => () => {
|
|
155
|
-
|
|
156
|
-
}, [
|
|
157
|
-
let
|
|
159
|
+
ui.abandon();
|
|
160
|
+
}, [ui]);
|
|
161
|
+
let gi = er(() => R.filter((e) => !e.requiresAdmin || ci), [R, ci]), _i = d(gi), vi = zr && _i, yi = N(_i);
|
|
158
162
|
M(() => {
|
|
159
|
-
|
|
160
|
-
}, [
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
+
yi.current = _i;
|
|
164
|
+
}, [_i]);
|
|
165
|
+
let bi = N(null), xi = N(!1), Si = Xe(R), [Ci, wi] = tr(null), [Ti, Ei] = tr(null), Di = Ti !== null && Ti === U, Oi = j((e) => {
|
|
166
|
+
Ei(e ? b.getState().activeConversationId : null);
|
|
163
167
|
}, []);
|
|
164
168
|
M(() => {
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
}, []),
|
|
169
|
+
Ei((e) => e !== null && e !== U ? null : e);
|
|
170
|
+
}, [U]);
|
|
171
|
+
let ki = N(void 0), [Ai, ji] = tr(!1), Mi = j((e) => {
|
|
172
|
+
ki.current = e, ji(ze(e));
|
|
173
|
+
}, []), Ni = j(() => {
|
|
170
174
|
let e = b.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
|
|
171
175
|
return !t || !n ? null : {
|
|
172
176
|
id: t,
|
|
173
|
-
reusableDraft:
|
|
174
|
-
liveProposals:
|
|
175
|
-
turnInFlight:
|
|
177
|
+
reusableDraft: rn(n, p()),
|
|
178
|
+
liveProposals: J.liveFor(t).count,
|
|
179
|
+
turnInFlight: ut(e.processingByConversationId[t]?.status)
|
|
176
180
|
};
|
|
177
|
-
}, [
|
|
178
|
-
let t = e.sandboxesByMode[
|
|
181
|
+
}, [J]), Pi = N({}), Y = N(Nt()), X = N(new bn()), Fi = N(/* @__PURE__ */ new Set()), Ii = er(() => R.find((e) => e.id === W), [R, W]), Li = b((e) => {
|
|
182
|
+
let t = e.sandboxesByMode[W]?.sandboxId;
|
|
179
183
|
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
180
|
-
}),
|
|
181
|
-
mode:
|
|
182
|
-
productWriteApproval:
|
|
183
|
-
capabilities:
|
|
184
|
-
}),
|
|
184
|
+
}), Ri = Ii !== void 0 && et({
|
|
185
|
+
mode: W,
|
|
186
|
+
productWriteApproval: z,
|
|
187
|
+
capabilities: Li
|
|
188
|
+
}), zi = W === "assistant" || Ii !== void 0 && !Ii.writeCapable && !fe(W) || Ri;
|
|
185
189
|
M(() => {
|
|
186
|
-
if (
|
|
187
|
-
|
|
190
|
+
if (W !== "assistant" && Ii?.writeCapable && !ie(Lr, W)) {
|
|
191
|
+
Tr("assistant");
|
|
188
192
|
return;
|
|
189
193
|
}
|
|
190
|
-
|
|
194
|
+
li || (!Ii || Ii.requiresAdmin && !ci) && W !== "assistant" && Tr("assistant");
|
|
191
195
|
}, [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
W,
|
|
197
|
+
Ii,
|
|
198
|
+
ci,
|
|
199
|
+
li,
|
|
200
|
+
Tr,
|
|
201
|
+
Lr
|
|
198
202
|
]);
|
|
199
|
-
let
|
|
200
|
-
|
|
201
|
-
}, [
|
|
203
|
+
let Bi = j((e, t, n, r) => {
|
|
204
|
+
jr(e, n, t, null, r);
|
|
205
|
+
}, [jr]), Vi = j(async (e, t, n, r, i, a = null) => {
|
|
202
206
|
let s = (e, t) => {
|
|
203
|
-
r &&
|
|
207
|
+
r && Bi(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
204
208
|
}, c = (e) => {
|
|
205
209
|
r && k(r.assistantMessageId, e);
|
|
206
210
|
}, l = () => {
|
|
207
211
|
c("bootAdopted"), a?.beginBoot();
|
|
208
212
|
}, u = () => a !== null && (a.signal.aborted || A() !== t), d = () => {
|
|
209
|
-
if (u()) throw new
|
|
210
|
-
}, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1,
|
|
211
|
-
if (i && !
|
|
213
|
+
if (u()) throw new xn("cancelled");
|
|
214
|
+
}, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, h = !1, te = !1, ne = async (r) => {
|
|
215
|
+
if (i && !X.current.has(r) && Y.current.isFresh(r)) return p = !0, !0;
|
|
212
216
|
m = !0;
|
|
213
217
|
let o = !1;
|
|
214
218
|
try {
|
|
215
|
-
await
|
|
219
|
+
await he(r, t, n, 3e5), await T(r, t, e, n, 9e4, () => {
|
|
216
220
|
o = !0, l();
|
|
217
221
|
});
|
|
218
222
|
} catch {
|
|
219
|
-
if (u()) throw new
|
|
220
|
-
return
|
|
223
|
+
if (u()) throw new xn("cancelled");
|
|
224
|
+
return Y.current.invalidate(r), X.current.add(r), a?.dead.push(r), te = !0, !1;
|
|
221
225
|
}
|
|
222
|
-
return d(),
|
|
226
|
+
return d(), Y.current.markVerified(r), o && (h = !0), !0;
|
|
223
227
|
};
|
|
224
|
-
if (f && (
|
|
228
|
+
if (f && (Fr(e, f, "provisioning"), s("provisioning", "reusingEnvironment"), await ne(f) || (Fr(e, null, "provisioning"), f = null)), !f) {
|
|
225
229
|
s("provisioning", "lookingForEnvironment");
|
|
226
|
-
let r = await
|
|
230
|
+
let r = await le(t, L, e, Zn(), n, X.current, z);
|
|
227
231
|
d();
|
|
228
232
|
let i = r?.id ?? null;
|
|
229
233
|
if (i) {
|
|
230
|
-
|
|
234
|
+
Fr(e, i, "provisioning"), s("provisioning", "reusingEnvironment");
|
|
231
235
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
232
|
-
t && l(), await ne(i) ? (f = i, t && (
|
|
236
|
+
t && l(), await ne(i) ? (f = i, t && (h = !0)) : Fr(e, null, "provisioning");
|
|
233
237
|
}
|
|
234
238
|
}
|
|
235
239
|
if (!f) {
|
|
236
|
-
if (a && !a.mayCreate) throw new
|
|
237
|
-
if (c("provisionStarted"), e === "api-calls" && !
|
|
238
|
-
s("provisioning", "startingEnvironment"),
|
|
239
|
-
let r = a ? [] : await
|
|
240
|
+
if (a && !a.mayCreate) throw new xn("no-create");
|
|
241
|
+
if (c("provisionStarted"), e === "api-calls" && !B()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
242
|
+
s("provisioning", "startingEnvironment"), Fr(e, null, "provisioning");
|
|
243
|
+
let r = a ? [] : await w(t, L, e, Zn(), n, X.current, z);
|
|
240
244
|
if (r.length > 0) {
|
|
241
245
|
let e = new Set(r);
|
|
242
|
-
for (let e of r)
|
|
246
|
+
for (let e of r) Y.current.invalidate(e), X.current.add(e);
|
|
243
247
|
let t = b.getState().sandboxesByMode;
|
|
244
|
-
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) &&
|
|
248
|
+
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) && Ir(n);
|
|
245
249
|
}
|
|
246
250
|
c("createRequested");
|
|
247
251
|
let i = a?.beginCreate();
|
|
248
252
|
try {
|
|
249
|
-
f = await x(
|
|
253
|
+
f = await x(L, e, t, Zn(), ir, n, { writeApproval: z });
|
|
250
254
|
} finally {
|
|
251
255
|
i?.();
|
|
252
256
|
}
|
|
253
|
-
ee = !0, d(),
|
|
257
|
+
ee = !0, d(), Fr(e, f, "provisioning"), await he(f, t, n, 3e5), d(), c("sandboxRunning"), await T(f, t, e, n, 9e4), d(), c("serviceReady"), Y.current.markVerified(f);
|
|
254
258
|
}
|
|
255
|
-
return
|
|
259
|
+
return Fr(e, f, "running"), {
|
|
256
260
|
sandboxId: f,
|
|
257
261
|
sandboxIsNew: ee,
|
|
258
262
|
sandboxProbed: m,
|
|
259
|
-
sandboxAdopted:
|
|
260
|
-
deadSandboxProbe:
|
|
263
|
+
sandboxAdopted: h,
|
|
264
|
+
deadSandboxProbe: te,
|
|
261
265
|
trustedFromCache: p
|
|
262
266
|
};
|
|
263
267
|
}, [
|
|
264
|
-
|
|
268
|
+
Ir,
|
|
269
|
+
B,
|
|
270
|
+
L,
|
|
265
271
|
z,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined && O(n, { prewarm: s.joined });
|
|
274
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Di(r, i, a, {
|
|
272
|
+
Fr,
|
|
273
|
+
Bi
|
|
274
|
+
]), Hi = j(async function e(t, n, r, i, a, o = {}) {
|
|
275
|
+
let s = await Dn(i, r, (e) => Bi(t, n, "provisioning", e), () => k(n, "prewarmJoined"));
|
|
276
|
+
for (let e of s.dead) Y.current.invalidate(e), X.current.add(e);
|
|
277
|
+
s.verified && !X.current.has(s.verified) && Y.current.markVerified(s.verified), s.joined && O(n, { prewarm: s.joined });
|
|
278
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Vi(r, i, a, {
|
|
275
279
|
conversationId: t,
|
|
276
280
|
assistantMessageId: n
|
|
277
|
-
}, o.trustCache !== !1), ee =
|
|
281
|
+
}, o.trustCache !== !1), ee = Cn(i, r, c);
|
|
278
282
|
!s.waited && ee && O(n, { prewarm: "hit" });
|
|
279
|
-
let m = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null,
|
|
283
|
+
let m = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, te = null;
|
|
280
284
|
if (m) {
|
|
281
|
-
let e =
|
|
285
|
+
let e = vt(c, m, (e, t) => de(e, i, t, r, a, { limit: 50 }));
|
|
282
286
|
try {
|
|
283
|
-
let t = await
|
|
287
|
+
let t = await C(c, i, m, r, a);
|
|
284
288
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
285
|
-
|
|
289
|
+
te = e;
|
|
286
290
|
} catch {
|
|
287
|
-
|
|
291
|
+
Pr(t), m = null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
let ne = !1;
|
|
295
|
+
if (!m) {
|
|
296
|
+
let e = Sn(wn({
|
|
297
|
+
workspaceId: i,
|
|
298
|
+
mode: r,
|
|
299
|
+
sandboxId: c,
|
|
300
|
+
userId: V
|
|
301
|
+
}), Date.now());
|
|
302
|
+
if (e) {
|
|
303
|
+
"pending" in e && Bi(t, n, "connecting", "preparingSession");
|
|
304
|
+
let o = "sessionId" in e ? e.sessionId : await e.pending;
|
|
305
|
+
if (o && !X.current.has(c)) try {
|
|
306
|
+
(await C(c, i, o, r, a)).mode === r && (m = o, ne = !0, Nr(t, m), h = !0);
|
|
307
|
+
} catch {}
|
|
288
308
|
}
|
|
289
309
|
}
|
|
290
310
|
if (!m) {
|
|
291
|
-
|
|
311
|
+
Bi(t, n, "connecting", "preparingSession");
|
|
292
312
|
let s;
|
|
293
313
|
try {
|
|
294
|
-
s = await
|
|
314
|
+
s = await S(c, i, r, a);
|
|
295
315
|
} catch (s) {
|
|
296
316
|
if (p) {
|
|
297
|
-
|
|
298
|
-
let l =
|
|
299
|
-
if (l === "check-network" && (l = await
|
|
300
|
-
p || O(n, { cacheProofFailed: !0 }), l === "replace" && (
|
|
317
|
+
Y.current.invalidate(c);
|
|
318
|
+
let l = Ft(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
|
|
319
|
+
if (l === "check-network" && (l = await Pt(() => le(i, L, r, Zn(), a, X.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
320
|
+
p || O(n, { cacheProofFailed: !0 }), l === "replace" && (X.current.add(c), Pr(t), Ir(r), J.retireSandbox(c));
|
|
301
321
|
let s = await e(t, n, r, i, a, {
|
|
302
322
|
...o,
|
|
303
323
|
trustCache: !1
|
|
@@ -312,62 +332,81 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
312
332
|
}
|
|
313
333
|
throw s;
|
|
314
334
|
}
|
|
315
|
-
m = s.sessionId,
|
|
335
|
+
m = s.sessionId, Nr(t, m), h = !0;
|
|
316
336
|
}
|
|
317
337
|
return {
|
|
318
338
|
sandboxId: c,
|
|
319
339
|
sessionId: m,
|
|
320
|
-
sessionIsNew:
|
|
321
|
-
readAhead:
|
|
340
|
+
sessionIsNew: h,
|
|
341
|
+
readAhead: te,
|
|
322
342
|
sandboxIsNew: l,
|
|
323
343
|
sandboxProbed: u,
|
|
324
344
|
sandboxAdopted: d,
|
|
325
|
-
deadSandboxProbe: f
|
|
345
|
+
deadSandboxProbe: f,
|
|
346
|
+
sessionPreopened: ne
|
|
326
347
|
};
|
|
327
348
|
}, [
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
349
|
+
Vi,
|
|
350
|
+
Pr,
|
|
351
|
+
Ir,
|
|
352
|
+
L,
|
|
353
|
+
z,
|
|
354
|
+
Nr,
|
|
355
|
+
Bi,
|
|
356
|
+
V,
|
|
357
|
+
J
|
|
358
|
+
]), Ui = j((e, t = !1) => {
|
|
337
359
|
let n = A();
|
|
338
360
|
if (!n) return;
|
|
339
|
-
let r = b.getState(), i = Date.now(), a =
|
|
361
|
+
let r = b.getState(), i = Date.now(), a = En({
|
|
340
362
|
autoRouting: r.autoRouting,
|
|
341
|
-
autoOffered:
|
|
363
|
+
autoOffered: yi.current,
|
|
342
364
|
active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
|
|
343
365
|
selectedMode: r.mode,
|
|
344
366
|
autoReadMode: s,
|
|
345
|
-
modes:
|
|
367
|
+
modes: di.current,
|
|
346
368
|
acknowledgedWriteModes: r.acknowledgedWriteModes,
|
|
347
|
-
adminAccess:
|
|
369
|
+
adminAccess: ui.read(),
|
|
348
370
|
dictated: e,
|
|
349
|
-
voiceProposalBound: (e) =>
|
|
350
|
-
turnInFlight: Object.values(r.processingByConversationId).some((e) =>
|
|
351
|
-
...
|
|
371
|
+
voiceProposalBound: (e) => hr(e),
|
|
372
|
+
turnInFlight: Object.values(r.processingByConversationId).some((e) => ut(e?.status)),
|
|
373
|
+
...An(n),
|
|
352
374
|
now: i
|
|
353
375
|
});
|
|
354
376
|
if (!a) return;
|
|
355
|
-
let o =
|
|
356
|
-
accessToken:
|
|
357
|
-
workspaceToken:
|
|
358
|
-
userId:
|
|
359
|
-
organizationId:
|
|
377
|
+
let o = kn(n, a, i), c = {
|
|
378
|
+
accessToken: B(),
|
|
379
|
+
workspaceToken: gr(),
|
|
380
|
+
userId: V,
|
|
381
|
+
organizationId: At()
|
|
360
382
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
383
|
+
Vi(a.mode, n, c, null, !0, o).then((e) => {
|
|
384
|
+
if (o.finish({
|
|
385
|
+
ok: !0,
|
|
386
|
+
sandboxId: e.sandboxId,
|
|
387
|
+
didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
|
|
388
|
+
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
389
|
+
dead: o.dead
|
|
390
|
+
}), o.signal.aborted || A() !== n || X.current.has(e.sandboxId)) return;
|
|
391
|
+
let r = b.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, s = p();
|
|
392
|
+
Tn({
|
|
393
|
+
active: i ? {
|
|
394
|
+
mode: i.mode,
|
|
395
|
+
backendSessionId: i.backendSessionId,
|
|
396
|
+
continuable: !nn(i) && !tn(i, s),
|
|
397
|
+
hasHistory: en(i)
|
|
398
|
+
} : void 0,
|
|
399
|
+
mode: a.mode
|
|
400
|
+
}) && On(wn({
|
|
401
|
+
workspaceId: n,
|
|
402
|
+
mode: a.mode,
|
|
403
|
+
sandboxId: e.sandboxId,
|
|
404
|
+
userId: V
|
|
405
|
+
}), () => S(e.sandboxId, n, a.mode, c).then((e) => e.sessionId), Date.now());
|
|
406
|
+
}, (e) => {
|
|
407
|
+
if (!(e instanceof xn) && !o.signal.aborted && A() === n) {
|
|
369
408
|
let e = b.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
|
|
370
|
-
e && (
|
|
409
|
+
e && (Y.current.invalidate(e), X.current.add(e), o.dead.push(e), Ir(a.mode));
|
|
371
410
|
}
|
|
372
411
|
o.finish({
|
|
373
412
|
ok: !1,
|
|
@@ -377,44 +416,44 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
377
416
|
});
|
|
378
417
|
});
|
|
379
418
|
}, [
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
z,
|
|
384
|
-
nr,
|
|
419
|
+
Vi,
|
|
420
|
+
ui,
|
|
421
|
+
Ir,
|
|
385
422
|
B,
|
|
386
|
-
|
|
387
|
-
|
|
423
|
+
gr,
|
|
424
|
+
V,
|
|
425
|
+
hr
|
|
426
|
+
]), Wi = j(() => Ui(!1), [Ui]), Gi = nr(v, te, te)?.reference ?? null, [Ki, qi] = tr(0), Ji = N(/* @__PURE__ */ new Set()), Yi = N(null), Xi = j(() => {
|
|
388
427
|
let e = b.getState(), t = e.activeConversationId;
|
|
389
428
|
if (!t) return;
|
|
390
|
-
let n = e.processingByConversationId[t], r =
|
|
391
|
-
if (!
|
|
429
|
+
let n = e.processingByConversationId[t], r = ut(n?.status) ? n?.messageId ?? null : null;
|
|
430
|
+
if (!ft({
|
|
392
431
|
interruptedTurnId: r,
|
|
393
432
|
activeTurnId: r,
|
|
394
|
-
alreadyRequested: r ?
|
|
433
|
+
alreadyRequested: r ? Ji.current.has(r) : !1
|
|
395
434
|
}).send || !r) return;
|
|
396
|
-
|
|
435
|
+
Ji.current.add(r);
|
|
397
436
|
let i = y(e), a = A(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
398
437
|
!i || !a || !o || oe(i.sandboxId, a, o, i.mode, {
|
|
399
|
-
accessToken:
|
|
400
|
-
workspaceToken:
|
|
401
|
-
userId:
|
|
402
|
-
organizationId:
|
|
438
|
+
accessToken: B(),
|
|
439
|
+
workspaceToken: gr(),
|
|
440
|
+
userId: V,
|
|
441
|
+
organizationId: At()
|
|
403
442
|
});
|
|
404
443
|
}, [
|
|
444
|
+
V,
|
|
405
445
|
B,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
]), Li = j(async (e) => {
|
|
446
|
+
gr
|
|
447
|
+
]), Zi = j(async (e) => {
|
|
409
448
|
let t = b.getState(), n = y(t), r = A(), i = t.activeConversationId;
|
|
410
|
-
if (!n || !r || !i ||
|
|
411
|
-
let a = t.conversations.find((e) => e.id === i), o = a ? g(
|
|
449
|
+
if (!n || !r || !i || Ht(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
450
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? g(E(a.messages), {
|
|
412
451
|
sessionId: a.backendSessionId,
|
|
413
452
|
sandboxId: n.sandboxId,
|
|
414
453
|
nowMs: Date.now()
|
|
415
454
|
}) : null;
|
|
416
455
|
if (o?.reference !== e) {
|
|
417
|
-
|
|
456
|
+
qi((e) => e + 1);
|
|
418
457
|
return;
|
|
419
458
|
}
|
|
420
459
|
let s = {
|
|
@@ -424,206 +463,315 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
424
463
|
if (!m(s)) return;
|
|
425
464
|
try {
|
|
426
465
|
await se(n.sandboxId, r, e, n.mode, {
|
|
427
|
-
accessToken:
|
|
428
|
-
workspaceToken:
|
|
429
|
-
userId:
|
|
430
|
-
organizationId:
|
|
466
|
+
accessToken: B(),
|
|
467
|
+
workspaceToken: gr(),
|
|
468
|
+
userId: V,
|
|
469
|
+
organizationId: At()
|
|
431
470
|
});
|
|
432
471
|
} catch (e) {
|
|
433
|
-
|
|
434
|
-
id:
|
|
472
|
+
h(s), K(i, {
|
|
473
|
+
id: F(),
|
|
435
474
|
role: "system",
|
|
436
475
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
437
476
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
438
477
|
});
|
|
439
478
|
return;
|
|
440
479
|
}
|
|
441
|
-
|
|
480
|
+
h(s), Ar(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
442
481
|
let c = b.getState(), l = c.conversations.find((e) => e.id === i);
|
|
443
|
-
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || y(c)?.sandboxId !== n.sandboxId ||
|
|
482
|
+
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || y(c)?.sandboxId !== n.sandboxId || ut(c.processingByConversationId[i]?.status) || re(E(l.messages)) !== o.messageId || Ca.current(I("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
444
483
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
445
484
|
targetConversationId: i
|
|
446
485
|
});
|
|
447
486
|
}, [
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
]),
|
|
453
|
-
theme:
|
|
454
|
-
navigate:
|
|
455
|
-
navItems:
|
|
456
|
-
options:
|
|
487
|
+
V,
|
|
488
|
+
K,
|
|
489
|
+
Ar,
|
|
490
|
+
I
|
|
491
|
+
]), Qi = e(), { speakFinishedReply: $i } = Ot(), ea = a(), { items: ta } = $n(), na = N({
|
|
492
|
+
theme: Qi,
|
|
493
|
+
navigate: ea,
|
|
494
|
+
navItems: ta,
|
|
495
|
+
options: mr ?? {}
|
|
457
496
|
});
|
|
458
497
|
M(() => {
|
|
459
|
-
|
|
460
|
-
theme:
|
|
461
|
-
navigate:
|
|
462
|
-
navItems:
|
|
463
|
-
options:
|
|
498
|
+
na.current = {
|
|
499
|
+
theme: Qi,
|
|
500
|
+
navigate: ea,
|
|
501
|
+
navItems: ta,
|
|
502
|
+
options: mr ?? {}
|
|
464
503
|
};
|
|
465
504
|
}, [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
505
|
+
Qi,
|
|
506
|
+
ea,
|
|
507
|
+
ta,
|
|
508
|
+
mr
|
|
470
509
|
]);
|
|
471
|
-
let
|
|
472
|
-
|
|
510
|
+
let ra = N(!0);
|
|
511
|
+
M(() => (ra.current = !0, () => {
|
|
512
|
+
ra.current = !1;
|
|
513
|
+
}), []);
|
|
514
|
+
let ia = N(null), [aa, oa] = tr(!1), sa = j((e) => {
|
|
515
|
+
let t = b.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
|
|
516
|
+
return n ? Hn(Vn, window.location.pathname, Kn(n.messages, e)) : !1;
|
|
517
|
+
}, []), ca = j((e, t) => {
|
|
518
|
+
let { navItems: n, options: r } = na.current;
|
|
519
|
+
return Mn(e, Nn(n), {
|
|
520
|
+
...r,
|
|
521
|
+
locale: t === void 0 ? H : yr.input.code
|
|
522
|
+
}, { backRunnable: sa(t) });
|
|
523
|
+
}, [
|
|
524
|
+
sa,
|
|
525
|
+
yr,
|
|
526
|
+
H
|
|
527
|
+
]), la = j((e, t) => {
|
|
528
|
+
let n = ca(e, t);
|
|
529
|
+
if (!n) return !1;
|
|
530
|
+
let { theme: r, navigate: i } = na.current;
|
|
531
|
+
switch (n.kind) {
|
|
532
|
+
case "theme": return r !== null;
|
|
533
|
+
case "navigate":
|
|
534
|
+
case "choose-destination":
|
|
535
|
+
case "back": return i !== null;
|
|
536
|
+
case "conversation-delete": return !1;
|
|
537
|
+
}
|
|
538
|
+
}, [ca]), ua = N(la);
|
|
539
|
+
M(() => {
|
|
540
|
+
ua.current = la;
|
|
541
|
+
}, [la]);
|
|
542
|
+
let da = j((e, t, n, r, i) => {
|
|
543
|
+
let a = I(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
|
|
473
544
|
kind: "write-reply",
|
|
474
545
|
line: n.key
|
|
475
|
-
}, c = (/* @__PURE__ */ new Date()).toISOString(), l =
|
|
476
|
-
|
|
546
|
+
}, c = (/* @__PURE__ */ new Date()).toISOString(), l = F();
|
|
547
|
+
K(e, {
|
|
477
548
|
id: l,
|
|
478
549
|
role: "user",
|
|
479
550
|
content: t,
|
|
480
551
|
timestamp: c,
|
|
481
552
|
metadata: {
|
|
482
553
|
localAction: s,
|
|
483
|
-
...
|
|
554
|
+
...D(i)
|
|
484
555
|
}
|
|
485
556
|
});
|
|
486
|
-
let u =
|
|
487
|
-
|
|
557
|
+
let u = F();
|
|
558
|
+
K(e, {
|
|
488
559
|
id: u,
|
|
489
560
|
role: "assistant",
|
|
490
561
|
content: a,
|
|
491
562
|
timestamp: c,
|
|
492
563
|
metadata: {
|
|
493
|
-
lang: a === o ? "en" :
|
|
564
|
+
lang: a === o ? "en" : H,
|
|
494
565
|
localAction: s,
|
|
495
|
-
...
|
|
566
|
+
...D(i)
|
|
496
567
|
}
|
|
497
|
-
}),
|
|
568
|
+
}), on.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", A()), $i(e, u);
|
|
498
569
|
}, [
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
]),
|
|
570
|
+
K,
|
|
571
|
+
H,
|
|
572
|
+
$i,
|
|
573
|
+
I
|
|
574
|
+
]), fa = un(), pa = fa?.request ?? null, ma = N(() => void 0), [ha, ga] = tr(null);
|
|
504
575
|
M(() => {
|
|
505
|
-
if (
|
|
506
|
-
let e = window.setTimeout(() =>
|
|
576
|
+
if (ha === null) return;
|
|
577
|
+
let e = window.setTimeout(() => ga(null), sr);
|
|
507
578
|
return () => window.clearTimeout(e);
|
|
508
|
-
}, [
|
|
509
|
-
let
|
|
579
|
+
}, [ha]);
|
|
580
|
+
let _a = j(() => {
|
|
510
581
|
let e = b.getState();
|
|
511
|
-
return
|
|
512
|
-
}, [
|
|
513
|
-
if (!
|
|
514
|
-
let t = e !== void 0, n = b.getState(), r =
|
|
582
|
+
return G(void 0, e.autoRouting && yi.current ? s : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
|
|
583
|
+
}, [G]), va = j((e) => {
|
|
584
|
+
if (!pa) return !1;
|
|
585
|
+
let t = e !== void 0, n = b.getState(), r = dn({
|
|
515
586
|
spoken: t,
|
|
516
|
-
bound:
|
|
587
|
+
bound: ki.current,
|
|
517
588
|
activeConversationId: n.activeConversationId,
|
|
518
589
|
conversations: n.conversations,
|
|
519
|
-
historyOn:
|
|
590
|
+
historyOn: ln()
|
|
520
591
|
});
|
|
521
|
-
if (r &&
|
|
522
|
-
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ?
|
|
523
|
-
|
|
524
|
-
id: `conversation-delete:${
|
|
592
|
+
if (r && pa(r), t) {
|
|
593
|
+
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? I("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : I("deleteConversation.nothing", "There is no conversation to delete.");
|
|
594
|
+
ma.current({
|
|
595
|
+
id: `conversation-delete:${F()}`,
|
|
525
596
|
text: t,
|
|
526
|
-
lang: t === e ? "en" :
|
|
597
|
+
lang: t === e ? "en" : H
|
|
527
598
|
});
|
|
528
|
-
} else r ||
|
|
599
|
+
} else r || ga(Date.now());
|
|
529
600
|
return !0;
|
|
530
601
|
}, [
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
]),
|
|
535
|
-
if (e.kind === "conversation-delete") return
|
|
536
|
-
let { theme: i, navigate: a } =
|
|
602
|
+
pa,
|
|
603
|
+
H,
|
|
604
|
+
I
|
|
605
|
+
]), ya = j((e, t, n, r = !1) => {
|
|
606
|
+
if (e.kind === "conversation-delete") return va(n);
|
|
607
|
+
let { theme: i, navigate: a } = na.current, o = () => {
|
|
608
|
+
let e = (r ? null : b.getState().activeConversationId) ?? _a();
|
|
609
|
+
return r && Mi(e), e;
|
|
610
|
+
}, s = (e, r) => {
|
|
611
|
+
let i = F();
|
|
612
|
+
return K(e, {
|
|
613
|
+
id: i,
|
|
614
|
+
role: "user",
|
|
615
|
+
content: t,
|
|
616
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
617
|
+
metadata: {
|
|
618
|
+
localAction: r,
|
|
619
|
+
...D(n)
|
|
620
|
+
}
|
|
621
|
+
}), i;
|
|
622
|
+
}, c = (e, t, r, i, a, o) => {
|
|
623
|
+
let s = F();
|
|
624
|
+
return K(e, {
|
|
625
|
+
id: s,
|
|
626
|
+
role: "assistant",
|
|
627
|
+
content: r.text,
|
|
628
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
629
|
+
metadata: {
|
|
630
|
+
lang: r.translated ? H : "en",
|
|
631
|
+
localAction: i,
|
|
632
|
+
...D(n)
|
|
633
|
+
}
|
|
634
|
+
}), on.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && $i(e, s), s;
|
|
635
|
+
}, l = (e, t) => {
|
|
636
|
+
let n = o();
|
|
637
|
+
return c(n, s(n, t), e, t, A(), !0), !0;
|
|
638
|
+
}, u = (e) => {
|
|
639
|
+
let t = o(), n = A(), r = window.location.pathname, i = s(t, Un({
|
|
640
|
+
destinationId: e.destinationId,
|
|
641
|
+
path: e.registryPath,
|
|
642
|
+
alreadyHere: !1,
|
|
643
|
+
via: e.via
|
|
644
|
+
})), l = F();
|
|
645
|
+
ia.current = l, oa(!0);
|
|
646
|
+
let u = (a) => {
|
|
647
|
+
try {
|
|
648
|
+
if (!b.getState().conversations.some((e) => e.id === t)) return;
|
|
649
|
+
let o = Nn(na.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, l = Un({
|
|
650
|
+
destinationId: e.destinationId,
|
|
651
|
+
path: e.registryPath,
|
|
652
|
+
alreadyHere: !1,
|
|
653
|
+
via: e.via,
|
|
654
|
+
outcome: a
|
|
655
|
+
});
|
|
656
|
+
Ar(t, i, { localAction: l });
|
|
657
|
+
let u = c(t, i, e.via === "back" && a.status === "arrived" ? Fn(I, e.pageLabel()) : Rn(I, a, {
|
|
658
|
+
page: e.pageLabel(),
|
|
659
|
+
landed: s === null ? null : Gn(o, s),
|
|
660
|
+
path: e.target
|
|
661
|
+
}), l, n, ra.current);
|
|
662
|
+
a.status === "arrived" && e.onArrived?.({
|
|
663
|
+
replyId: u,
|
|
664
|
+
fromPath: r,
|
|
665
|
+
landedPath: a.landedPath
|
|
666
|
+
});
|
|
667
|
+
} finally {
|
|
668
|
+
ia.current === l && (ia.current = null, ra.current && oa(!1));
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
return Bn(a, e.target, {
|
|
672
|
+
readPath: () => window.location.pathname + window.location.search,
|
|
673
|
+
now: () => Date.now(),
|
|
674
|
+
schedule: (e, t) => {
|
|
675
|
+
window.setTimeout(e, t);
|
|
676
|
+
},
|
|
677
|
+
isShellLess: () => !ra.current
|
|
678
|
+
}).then(u, () => u({ status: "unconfirmed" })), !0;
|
|
679
|
+
};
|
|
537
680
|
if (e.kind === "theme") {
|
|
538
681
|
if (!i) return !1;
|
|
539
|
-
let t =
|
|
682
|
+
let t = Pn(e.request, {
|
|
540
683
|
mode: i.mode,
|
|
541
684
|
resolvedTheme: i.resolvedTheme
|
|
542
685
|
});
|
|
543
686
|
if (!t.alreadyApplied) try {
|
|
544
687
|
i.setMode(t.mode);
|
|
545
688
|
} catch {}
|
|
546
|
-
|
|
689
|
+
return l(zn(I, t, e.request.kind === "family"), {
|
|
547
690
|
kind: "theme",
|
|
548
691
|
mode: t.mode,
|
|
549
692
|
alreadyApplied: t.alreadyApplied
|
|
550
|
-
};
|
|
551
|
-
} else {
|
|
552
|
-
if (!a) return !1;
|
|
553
|
-
if (e.kind === "navigate") {
|
|
554
|
-
let { destination: t } = e, n = Tn(t, window.location.pathname + window.location.search, Dn(Hi.current.navItems));
|
|
555
|
-
n || a(t.path), o = An(F, t.label, n), s = {
|
|
556
|
-
kind: "navigate",
|
|
557
|
-
destinationId: t.id,
|
|
558
|
-
path: t.path,
|
|
559
|
-
alreadyHere: n
|
|
560
|
-
};
|
|
561
|
-
} else o = kn(F, e.candidates[0]?.label ?? e.query, e.candidates), s = {
|
|
562
|
-
kind: "choose-destination",
|
|
563
|
-
candidateIds: e.candidates.map((e) => e.id)
|
|
564
|
-
};
|
|
693
|
+
});
|
|
565
694
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
695
|
+
if (!a) return !1;
|
|
696
|
+
if (e.kind === "choose-destination") return l(In(I, e.candidates[0]?.label ?? e.query, e.candidates), {
|
|
697
|
+
kind: "choose-destination",
|
|
698
|
+
candidateIds: e.candidates.map((e) => e.id)
|
|
699
|
+
});
|
|
700
|
+
if (e.kind === "back") {
|
|
701
|
+
let e = Vn.top();
|
|
702
|
+
if (!e) return !1;
|
|
703
|
+
let t = Wn(Nn(na.current.navItems), e.fromPath);
|
|
704
|
+
return u({
|
|
705
|
+
target: e.fromPath,
|
|
706
|
+
destinationId: t?.id ?? "",
|
|
707
|
+
registryPath: t?.path ?? e.fromPath,
|
|
708
|
+
via: "back",
|
|
709
|
+
pageLabel: () => t?.label ?? null,
|
|
710
|
+
onArrived: () => {
|
|
711
|
+
Vn.top() === e && Vn.pop();
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
let { destination: d } = e;
|
|
716
|
+
return jn(d, window.location.pathname + window.location.search, Nn(na.current.navItems)) ? l(Ln(I, d.label, !0), Un({
|
|
717
|
+
destinationId: d.id,
|
|
718
|
+
path: d.path,
|
|
719
|
+
alreadyHere: !0,
|
|
720
|
+
via: "named"
|
|
721
|
+
})) : u({
|
|
722
|
+
target: d.path,
|
|
723
|
+
destinationId: d.id,
|
|
724
|
+
registryPath: d.path,
|
|
725
|
+
via: "named",
|
|
726
|
+
pageLabel: () => d.label,
|
|
727
|
+
onArrived: ({ replyId: e, fromPath: t, landedPath: n }) => Vn.push({
|
|
728
|
+
fromPath: t,
|
|
729
|
+
toPath: n,
|
|
730
|
+
replyMessageId: e,
|
|
731
|
+
at: Date.now()
|
|
732
|
+
})
|
|
578
733
|
});
|
|
579
|
-
let d = qn();
|
|
580
|
-
return G(c, {
|
|
581
|
-
id: d,
|
|
582
|
-
role: "assistant",
|
|
583
|
-
content: o.text,
|
|
584
|
-
timestamp: l,
|
|
585
|
-
metadata: {
|
|
586
|
-
lang: o.translated ? V : "en",
|
|
587
|
-
localAction: s,
|
|
588
|
-
...E(n)
|
|
589
|
-
}
|
|
590
|
-
}), an.recordCommittedEntries(c, [u, d], "LOCAL_COMMAND", A()), zi(c, d), !0;
|
|
591
734
|
}, [
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
735
|
+
K,
|
|
736
|
+
Mi,
|
|
737
|
+
_a,
|
|
738
|
+
H,
|
|
739
|
+
Ar,
|
|
740
|
+
va,
|
|
741
|
+
$i,
|
|
742
|
+
I
|
|
743
|
+
]), ba = j(async (e) => {
|
|
744
|
+
xi.current = !0;
|
|
601
745
|
try {
|
|
602
|
-
await
|
|
746
|
+
await J.declineForReply(e.conversationId, e.reason, e.origin);
|
|
603
747
|
} finally {
|
|
604
|
-
|
|
748
|
+
xi.current = !1;
|
|
605
749
|
}
|
|
606
750
|
if (e.commandText !== null) {
|
|
607
|
-
let t =
|
|
608
|
-
if (t &&
|
|
751
|
+
let t = ca(e.commandText, e.options.voiceSessionId);
|
|
752
|
+
if (t && ya(t, e.content, e.options.voiceSessionId)) return;
|
|
609
753
|
}
|
|
610
|
-
await
|
|
611
|
-
}, [
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
754
|
+
await Ca.current(e.content, e.attachments, e.options);
|
|
755
|
+
}, [
|
|
756
|
+
ca,
|
|
757
|
+
ya,
|
|
758
|
+
J
|
|
759
|
+
]), Z = j(async (e, t = [], n = {}) => {
|
|
760
|
+
let r = n.voiceSessionId !== void 0, i = b.getState(), a = !1, o = ki.current;
|
|
761
|
+
if (r && ze(o)) {
|
|
762
|
+
let e = We(o, i.activeConversationId, Ni());
|
|
615
763
|
if (e.kind === "gone") return;
|
|
616
764
|
let t = n.voiceEntry ?? e;
|
|
617
|
-
t.kind === "adopt" &&
|
|
765
|
+
t.kind === "adopt" && Mi(t.conversationId), a = t.kind === "own", n = {
|
|
618
766
|
...n,
|
|
619
767
|
voiceEntry: t
|
|
620
768
|
};
|
|
621
769
|
}
|
|
622
|
-
let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ??
|
|
770
|
+
let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? U;
|
|
623
771
|
if (c) {
|
|
624
|
-
if (
|
|
772
|
+
if (ut(i.processingByConversationId[c]?.status)) {
|
|
625
773
|
let r = i.processingByConversationId[c]?.messageId ?? null;
|
|
626
|
-
r &&
|
|
774
|
+
r && Ji.current.has(r) && (Yi.current = {
|
|
627
775
|
conversationId: c,
|
|
628
776
|
content: e,
|
|
629
777
|
attachments: t,
|
|
@@ -631,29 +779,29 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
631
779
|
});
|
|
632
780
|
return;
|
|
633
781
|
}
|
|
634
|
-
if (
|
|
782
|
+
if (Fi.current.has(c)) return;
|
|
635
783
|
}
|
|
636
|
-
if (
|
|
637
|
-
let d = n.targetConversationId, ee = p(), m = (e) =>
|
|
784
|
+
if (bi.current || te() !== null || xi.current || ia.current !== null) return;
|
|
785
|
+
let d = n.targetConversationId, ee = p(), m = (e) => nn(e) || tn(e, ee);
|
|
638
786
|
if (d !== void 0) {
|
|
639
787
|
let e = i.conversations.find((e) => e.id === d);
|
|
640
788
|
if (i.activeConversationId !== d || !e || e.mode !== i.mode || m(e)) return;
|
|
641
789
|
}
|
|
642
790
|
if (n.fromPerson && n.writeReplyBound === void 0) {
|
|
643
|
-
let r = d ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a =
|
|
791
|
+
let r = d ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = Ut({
|
|
644
792
|
text: e,
|
|
645
|
-
locale: i === "spoken" ?
|
|
793
|
+
locale: i === "spoken" ? yr.input.code : H,
|
|
646
794
|
origin: i,
|
|
647
795
|
hasAttachments: t.length > 0,
|
|
648
|
-
live:
|
|
649
|
-
matchesLocalCommand: (e) =>
|
|
796
|
+
live: J.liveFor(r),
|
|
797
|
+
matchesLocalCommand: (e) => ca(e, n.voiceSessionId) !== null
|
|
650
798
|
});
|
|
651
799
|
if (a.kind === "local_reply") {
|
|
652
|
-
r &&
|
|
800
|
+
r && da(r, e, a.line, a.values, n.voiceSessionId);
|
|
653
801
|
return;
|
|
654
802
|
}
|
|
655
803
|
let o = a.kind === "local" ? a.fallback : a.bound, c = a.declineAll;
|
|
656
|
-
if (c !== null && r) return
|
|
804
|
+
if (c !== null && r) return ba({
|
|
657
805
|
conversationId: r,
|
|
658
806
|
reason: c,
|
|
659
807
|
origin: i,
|
|
@@ -670,347 +818,362 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
670
818
|
writeReplyBound: o
|
|
671
819
|
};
|
|
672
820
|
}
|
|
673
|
-
let
|
|
821
|
+
let h = n.writeReplyBound?.promptText ?? e;
|
|
674
822
|
if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
|
|
675
|
-
let t =
|
|
676
|
-
if (t &&
|
|
823
|
+
let t = ca(e, n.voiceSessionId);
|
|
824
|
+
if (t && ya(t, e, n.voiceSessionId, a)) return;
|
|
677
825
|
}
|
|
678
|
-
let re = s ? i.conversations.find((e) => e.id === s) : void 0, g = m(re) ? void 0 : re, _ = i.autoRouting &&
|
|
826
|
+
let re = s ? i.conversations.find((e) => e.id === s) : void 0, g = m(re) ? void 0 : re, _ = i.autoRouting && yi.current && d === void 0 ? f({
|
|
679
827
|
intent: n.autoIntent ?? l(e),
|
|
680
828
|
dictated: r,
|
|
681
|
-
voiceProposalBound: r &&
|
|
829
|
+
voiceProposalBound: r && hr("api-calls") && ie(i.acknowledgedWriteModes, "api-calls"),
|
|
682
830
|
conversation: g ? {
|
|
683
831
|
mode: g.mode,
|
|
684
832
|
routedBy: g.routedBy,
|
|
685
|
-
hasHistory:
|
|
833
|
+
hasHistory: en(g)
|
|
686
834
|
} : null
|
|
687
835
|
}) : null;
|
|
688
|
-
if (_ &&
|
|
689
|
-
|
|
836
|
+
if (_ && di.current.find((e) => e.id === _.mode)?.writeCapable && !ie(i.acknowledgedWriteModes, _.mode)) {
|
|
837
|
+
bi.current = {
|
|
690
838
|
content: e,
|
|
691
839
|
attachments: t,
|
|
692
840
|
options: n
|
|
693
|
-
},
|
|
841
|
+
}, wi(_.mode);
|
|
694
842
|
return;
|
|
695
843
|
}
|
|
696
|
-
let v = _ ? _.mode : i.mode, y, se, x = d ?? (a ? null :
|
|
844
|
+
let v = _ ? _.mode : i.mode, y, se, x = d ?? (a ? null : U), S = x ? b.getState().conversations.find((e) => e.id === x) : void 0, le = _?.action === "escalate" && g ? {
|
|
697
845
|
mode: g.mode,
|
|
698
846
|
backendSessionId: g.backendSessionId ?? null
|
|
699
847
|
} : null;
|
|
700
|
-
if (_) _.action === "new" || !g ? x =
|
|
848
|
+
if (_) _.action === "new" || !g ? x = G(void 0, v, { routedBy: "auto" }) : (x = g.id, Vr(x, v));
|
|
701
849
|
else {
|
|
702
850
|
let e = i.autoRouting ? { routedBy: "auto" } : void 0;
|
|
703
|
-
!x || m(
|
|
851
|
+
!x || m(S) || S && S.mode !== v && en(S) ? x = G(void 0, v, e) : S && S.mode !== v && (e ? Vr(x, v) : Er(x, v));
|
|
704
852
|
}
|
|
705
853
|
if (!x) return;
|
|
706
|
-
r &&
|
|
707
|
-
let
|
|
708
|
-
accessToken:
|
|
709
|
-
workspaceToken:
|
|
710
|
-
userId:
|
|
711
|
-
organizationId:
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
accessToken:
|
|
715
|
-
workspaceToken:
|
|
716
|
-
userId:
|
|
717
|
-
organizationId:
|
|
854
|
+
r && ki.current !== void 0 && x !== i.activeConversationId && Mi(x), n.approvalFollowUp || (Pi.current[x] = t);
|
|
855
|
+
let C = () => b.getState().conversations.some((e) => e.id === x), w = A(), T = {
|
|
856
|
+
accessToken: B(),
|
|
857
|
+
workspaceToken: gr(),
|
|
858
|
+
userId: V,
|
|
859
|
+
organizationId: At()
|
|
860
|
+
}, he = (e, t) => {
|
|
861
|
+
C() || !w || oe(e, w, t, v, {
|
|
862
|
+
accessToken: B(),
|
|
863
|
+
workspaceToken: gr(),
|
|
864
|
+
userId: V,
|
|
865
|
+
organizationId: At()
|
|
718
866
|
});
|
|
719
|
-
},
|
|
720
|
-
id:
|
|
867
|
+
}, ge = {
|
|
868
|
+
id: F(),
|
|
721
869
|
role: "user",
|
|
722
870
|
content: e,
|
|
723
871
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
724
872
|
metadata: {
|
|
725
|
-
...t.length ? { attachments: t.map(
|
|
873
|
+
...t.length ? { attachments: t.map(Qe) } : {},
|
|
726
874
|
...n.approvalFollowUp ? {
|
|
727
875
|
approvalFollowUp: !0,
|
|
728
876
|
approvedReplyId: n.approvalFollowUp.approvedReplyId
|
|
729
877
|
} : {},
|
|
730
|
-
...
|
|
878
|
+
...D(n.voiceSessionId)
|
|
731
879
|
}
|
|
732
880
|
};
|
|
733
|
-
|
|
734
|
-
let
|
|
735
|
-
|
|
736
|
-
id:
|
|
881
|
+
K(x, ge);
|
|
882
|
+
let E = F();
|
|
883
|
+
K(x, {
|
|
884
|
+
id: E,
|
|
737
885
|
role: "assistant",
|
|
738
886
|
content: "",
|
|
739
887
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
740
888
|
metadata: {
|
|
741
|
-
lang:
|
|
742
|
-
...
|
|
889
|
+
lang: Sr,
|
|
890
|
+
...D(n.voiceSessionId)
|
|
743
891
|
}
|
|
744
|
-
}),
|
|
892
|
+
}), wt(E, {
|
|
745
893
|
channel: r ? "voice" : "chat",
|
|
746
894
|
mode: v,
|
|
747
|
-
product:
|
|
748
|
-
language:
|
|
749
|
-
device:
|
|
895
|
+
product: L,
|
|
896
|
+
language: Sr,
|
|
897
|
+
device: Tt(),
|
|
750
898
|
routedByAuto: !!_
|
|
751
|
-
}, n.voiceTiming), k(
|
|
752
|
-
let
|
|
753
|
-
turnId:
|
|
754
|
-
abortRequested:
|
|
899
|
+
}, n.voiceTiming), k(E, "accepted"), jr(x, "provisioning", E, null), ne(E);
|
|
900
|
+
let Oe = () => dt({
|
|
901
|
+
turnId: E,
|
|
902
|
+
abortRequested: Ji.current.has(E),
|
|
755
903
|
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
756
|
-
conversationExists:
|
|
757
|
-
}),
|
|
758
|
-
|
|
904
|
+
conversationExists: C()
|
|
905
|
+
}), ke = (e, t, r, i, a = !1, o = Sr) => {
|
|
906
|
+
kr(x, E, { content: _e(e) }), Ar(x, E, {
|
|
759
907
|
lang: o,
|
|
760
908
|
...t?.length ? { artifacts: t } : {},
|
|
761
909
|
...t?.length || r || i ? { mode: v } : {},
|
|
762
910
|
...r ? { sessionId: r } : {},
|
|
763
911
|
...i ? { sandboxId: i } : {},
|
|
764
912
|
...a ? { incomplete: !0 } : {},
|
|
765
|
-
...
|
|
913
|
+
...D(n.voiceSessionId)
|
|
766
914
|
});
|
|
767
|
-
}, je = { session: null }, Me =
|
|
768
|
-
|
|
915
|
+
}, je = { session: null }, Me = !1, Ne = () => {
|
|
916
|
+
Me && (Me = !1, Ae.abort(E));
|
|
917
|
+
}, Fe = async (i = 1) => {
|
|
918
|
+
k(E, "attemptStarted");
|
|
769
919
|
let a = null, o = null, s = !1;
|
|
770
920
|
try {
|
|
771
|
-
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee } = await
|
|
772
|
-
turnId:
|
|
773
|
-
abortRequested:
|
|
921
|
+
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await Hi(x, E, v, w, T, { isAbandoned: () => dt({
|
|
922
|
+
turnId: E,
|
|
923
|
+
abortRequested: Ji.current.has(E),
|
|
774
924
|
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
775
|
-
conversationExists:
|
|
925
|
+
conversationExists: C()
|
|
776
926
|
}).abandon });
|
|
777
|
-
if (a = i, k(
|
|
778
|
-
runtime: d ? "cold" : p ? "adopted" : f ? "probed" : l ? "new-session" : "warm",
|
|
927
|
+
if (a = i, k(E, "runtimeReady"), O(E, {
|
|
928
|
+
runtime: d ? "cold" : p ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
|
|
779
929
|
deadSandboxProbe: ee
|
|
780
930
|
}), o = c, je.session = {
|
|
781
931
|
sandboxId: i,
|
|
782
932
|
sessionId: c
|
|
783
933
|
}, ae(v, y, b.getState().acknowledgedWriteModes, {
|
|
784
934
|
dictated: r,
|
|
785
|
-
confirmsWrites:
|
|
786
|
-
proposalBound:
|
|
787
|
-
}) === "voice-in-write-mode") throw new
|
|
788
|
-
let
|
|
935
|
+
confirmsWrites: fe(v),
|
|
936
|
+
proposalBound: hr(v, i)
|
|
937
|
+
}) === "voice-in-write-mode") throw new ve("voice-in-write-mode", "Voice in a write mode");
|
|
938
|
+
let te = fn({
|
|
789
939
|
conversation: b.getState().conversations.find((e) => e.id === x),
|
|
790
940
|
content: e,
|
|
791
941
|
sessionIsNew: l,
|
|
792
942
|
sendingMode: v,
|
|
793
943
|
sendingModeConfig: y,
|
|
794
|
-
modes:
|
|
795
|
-
answerText: (e) =>
|
|
796
|
-
}),
|
|
797
|
-
|
|
798
|
-
let
|
|
944
|
+
modes: di.current,
|
|
945
|
+
answerText: (e) => bt(e).text
|
|
946
|
+
}), ne = await _t(() => de(i, w, c, v, T, { limit: 50 }), l, gt(u, i, c));
|
|
947
|
+
Bi(x, E, "streaming", "thinking");
|
|
948
|
+
let re = ur?.(), g = Wt(b.getState().sandboxWriteCapabilities[i]), _ = {
|
|
799
949
|
conversationId: x,
|
|
800
|
-
writeReply:
|
|
801
|
-
}, { prompt:
|
|
802
|
-
content:
|
|
950
|
+
writeReply: g === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null
|
|
951
|
+
}, { prompt: ie, parts: oe } = lt({
|
|
952
|
+
content: te ? `${te}${h}` : h,
|
|
803
953
|
attachments: t,
|
|
804
|
-
limits:
|
|
805
|
-
wrapPrompt: (e) =>
|
|
806
|
-
requestBytes: (e, t) =>
|
|
954
|
+
limits: Ze(y),
|
|
955
|
+
wrapPrompt: (e) => dr?.(v, e, br, xr, r, { writeApproval: g }) ?? e,
|
|
956
|
+
requestBytes: (e, t) => pe({
|
|
807
957
|
sandboxId: i,
|
|
808
|
-
workspaceId:
|
|
958
|
+
workspaceId: w,
|
|
809
959
|
sessionId: c,
|
|
810
960
|
mode: v,
|
|
811
961
|
prompt: e,
|
|
812
962
|
parts: t,
|
|
813
|
-
pageContext:
|
|
814
|
-
authContext:
|
|
815
|
-
...
|
|
963
|
+
pageContext: re,
|
|
964
|
+
authContext: T,
|
|
965
|
+
..._
|
|
816
966
|
})
|
|
817
|
-
}),
|
|
818
|
-
s =
|
|
819
|
-
let
|
|
820
|
-
if (
|
|
821
|
-
|
|
967
|
+
}), S = Je(oe), le = S > 0;
|
|
968
|
+
s = qe(t) > S;
|
|
969
|
+
let ye = Oe();
|
|
970
|
+
if (ye.abandon) {
|
|
971
|
+
ye.clearProcessing && Mr(x);
|
|
822
972
|
return;
|
|
823
973
|
}
|
|
824
974
|
try {
|
|
825
|
-
await
|
|
826
|
-
parts:
|
|
827
|
-
...
|
|
828
|
-
} :
|
|
975
|
+
await me(i, w, c, ie, v, re, T, oe?.length ? {
|
|
976
|
+
parts: oe,
|
|
977
|
+
..._
|
|
978
|
+
} : _);
|
|
829
979
|
} catch (e) {
|
|
830
|
-
if (!
|
|
831
|
-
await
|
|
980
|
+
if (!oe || !jt(e)) throw e;
|
|
981
|
+
await me(i, w, c, ie, v, re, T, _), s ||= le;
|
|
832
982
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
983
|
+
let be = (e) => kr(x, E, { content: e }), xe = (e) => s ? `${e}\n\n${I("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._")}` : e;
|
|
984
|
+
k(E, "promptSent");
|
|
985
|
+
let Ce = null, Te = !1, Ee = mt, D = ht([], ne), Ne = Date.now() + se.streamBudgetMs, Fe = Date.now(), Ie = Date.now();
|
|
986
|
+
for (; Date.now() < Ne;) {
|
|
987
|
+
he(i, c);
|
|
988
|
+
let e = Oe();
|
|
838
989
|
if (e.abandon) {
|
|
839
|
-
e.clearProcessing &&
|
|
990
|
+
e.clearProcessing && Mr(x);
|
|
840
991
|
return;
|
|
841
992
|
}
|
|
842
|
-
if (
|
|
993
|
+
if (D = ht(await de(i, w, c, v, T, {
|
|
843
994
|
limit: 50,
|
|
844
|
-
sinceMs:
|
|
995
|
+
sinceMs: ne,
|
|
845
996
|
surfaceTurnTerminal: !0
|
|
846
|
-
}),
|
|
997
|
+
}), ne, { accumulateNarration: se.accumulatesNarration }), kr(x, E, { content: _e(D.content) }), D.hasRenderableOutput ? Te || (Te = !0, Ce !== null && k(E, "lastQuietPoll", Ce), k(E, "firstOutput")) : Ce = Dt(), se.accumulatesNarration) D.hasText && k(E, "firstText");
|
|
847
998
|
else {
|
|
848
|
-
let e =
|
|
849
|
-
|
|
999
|
+
let e = yt(Ee, D, Dt());
|
|
1000
|
+
Ee = e.tracker, e.confirmedAt !== null && k(E, "firstText", e.confirmedAt);
|
|
850
1001
|
}
|
|
851
|
-
if (
|
|
852
|
-
k(
|
|
1002
|
+
if (D.pendingWrite && !Ht(b.getState().sandboxWriteCapabilities[i]) && Ar(x, E, { pendingWrite: D.pendingWrite }), D.done) {
|
|
1003
|
+
k(E, "answerDone"), Y.current.markVerified(i);
|
|
853
1004
|
break;
|
|
854
1005
|
}
|
|
855
|
-
Date.now() -
|
|
1006
|
+
Date.now() - Fe > 3e4 && (await ce(i, w, 600, T).catch(() => void 0), Fe = Date.now()), await new Promise((e) => setTimeout(e, Pe(Date.now() - Ie)));
|
|
1007
|
+
}
|
|
1008
|
+
if (D.done && n.voiceSessionId !== void 0 && !Oe().abandon) {
|
|
1009
|
+
let e = _e(xe(D.content));
|
|
1010
|
+
e.trim() && (s && be(e), k(E, "speechQueued"), Me = !0, Ae.publish(E, {
|
|
1011
|
+
conversationId: x,
|
|
1012
|
+
channel: "voice",
|
|
1013
|
+
voiceSessionId: n.voiceSessionId,
|
|
1014
|
+
text: e,
|
|
1015
|
+
lang: Sr,
|
|
1016
|
+
final: !0
|
|
1017
|
+
}));
|
|
856
1018
|
}
|
|
857
|
-
let
|
|
858
|
-
|
|
859
|
-
...
|
|
860
|
-
content:
|
|
861
|
-
}), s && (
|
|
862
|
-
...
|
|
863
|
-
content:
|
|
1019
|
+
let Le = se.producesArtifacts ? await ue(i, w, c, v, T).then((e) => e).catch(() => []) : void 0;
|
|
1020
|
+
D.usedTools !== void 0 && O(E, { usedTools: D.usedTools }), D.done || (O(E, { outcome: "timedOut" }), D = {
|
|
1021
|
+
...D,
|
|
1022
|
+
content: De(D.content, v, I, y)
|
|
1023
|
+
}), s && (D = {
|
|
1024
|
+
...D,
|
|
1025
|
+
content: xe(D.content)
|
|
864
1026
|
});
|
|
865
|
-
let
|
|
866
|
-
|
|
867
|
-
workspaceId:
|
|
1027
|
+
let Re = !D.done;
|
|
1028
|
+
ke(D.content, Le, c, i, Re), D.tokens && (kr(x, E, { tokens: D.tokens }), (pr ? await we({
|
|
1029
|
+
workspaceId: w,
|
|
868
1030
|
sessionId: c,
|
|
869
|
-
messageId:
|
|
870
|
-
model:
|
|
871
|
-
tokens:
|
|
872
|
-
},
|
|
873
|
-
let
|
|
874
|
-
if (
|
|
875
|
-
|
|
1031
|
+
messageId: D.messageId,
|
|
1032
|
+
model: D.model,
|
|
1033
|
+
tokens: D.tokens
|
|
1034
|
+
}, pr, { ledger: Se("panel", L) }) : { ok: !0 }).ok && Jn(L)), D.done || he(i, c);
|
|
1035
|
+
let ze = Oe();
|
|
1036
|
+
if (ze.abandon) {
|
|
1037
|
+
ze.clearProcessing && Mr(x);
|
|
876
1038
|
return;
|
|
877
1039
|
}
|
|
878
|
-
k(
|
|
1040
|
+
k(E, "complete"), O(E, { outcome: "answered" }), jr(x, "complete", E, null), on.recordCommittedEntries(x, [ge.id, E], "TURN", w), Me = !1;
|
|
879
1041
|
} catch (e) {
|
|
880
|
-
|
|
881
|
-
let t =
|
|
882
|
-
turnId:
|
|
883
|
-
abortRequested:
|
|
1042
|
+
Y.current.invalidate(a ?? b.getState().sandboxesByMode[v]?.sandboxId ?? null);
|
|
1043
|
+
let t = dt({
|
|
1044
|
+
turnId: E,
|
|
1045
|
+
abortRequested: Ji.current.has(E),
|
|
884
1046
|
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
885
|
-
conversationExists:
|
|
1047
|
+
conversationExists: C()
|
|
886
1048
|
});
|
|
887
|
-
if (a && o &&
|
|
888
|
-
t.clearProcessing &&
|
|
1049
|
+
if (a && o && he(a, o), t.abandon) {
|
|
1050
|
+
t.clearProcessing && Mr(x);
|
|
889
1051
|
return;
|
|
890
1052
|
}
|
|
891
|
-
if (i === 1 &&
|
|
1053
|
+
if (i === 1 && Mt(e)) {
|
|
892
1054
|
let e = a ?? b.getState().sandboxesByMode[v]?.sandboxId ?? null;
|
|
893
|
-
return e && (
|
|
1055
|
+
return e && (X.current.add(e), Y.current.invalidate(e)), Pr(x), Ir(v), Or(x, E, ""), Ar(x, E, { pendingWrite: void 0 }), e && J.retireSandbox(e), Ne(), Et(E), Fe(2);
|
|
894
1056
|
}
|
|
895
1057
|
throw e;
|
|
896
1058
|
}
|
|
897
|
-
},
|
|
898
|
-
|
|
1059
|
+
}, Ie = x;
|
|
1060
|
+
Fi.current.add(Ie);
|
|
899
1061
|
try {
|
|
900
|
-
if (!
|
|
1062
|
+
if (!w) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
901
1063
|
code: "UNAUTHENTICATED",
|
|
902
1064
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
903
1065
|
} });
|
|
904
|
-
let e = await
|
|
1066
|
+
let e = await ct(v, () => di.current.find((e) => e.id === v), ui);
|
|
905
1067
|
y = e.config, se = e.capabilities;
|
|
906
|
-
let t = y, n =
|
|
1068
|
+
let t = y, n = Oe();
|
|
907
1069
|
if (n.abandon) {
|
|
908
|
-
n.clearProcessing &&
|
|
1070
|
+
n.clearProcessing && Mr(x);
|
|
909
1071
|
return;
|
|
910
1072
|
}
|
|
911
1073
|
let i = ae(v, t, b.getState().acknowledgedWriteModes, {
|
|
912
1074
|
dictated: r,
|
|
913
|
-
confirmsWrites:
|
|
914
|
-
proposalBound:
|
|
1075
|
+
confirmsWrites: fe(v),
|
|
1076
|
+
proposalBound: hr(v)
|
|
915
1077
|
});
|
|
916
|
-
if (i) throw new
|
|
917
|
-
let a =
|
|
918
|
-
if (
|
|
919
|
-
let e = await
|
|
920
|
-
if (!e.ok) throw
|
|
921
|
-
let t =
|
|
1078
|
+
if (i) throw new ve(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
1079
|
+
let a = Se("panel", L);
|
|
1080
|
+
if (pr && Ce(a, w)) {
|
|
1081
|
+
let e = await Te(a, w, pr);
|
|
1082
|
+
if (!e.ok) throw Ee(e.kind);
|
|
1083
|
+
let t = Oe();
|
|
922
1084
|
if (t.abandon) {
|
|
923
|
-
t.clearProcessing &&
|
|
1085
|
+
t.clearProcessing && Mr(x);
|
|
924
1086
|
return;
|
|
925
1087
|
}
|
|
926
1088
|
}
|
|
927
|
-
k(
|
|
1089
|
+
k(E, "cleared"), await Fe();
|
|
928
1090
|
} catch (e) {
|
|
929
|
-
if (
|
|
930
|
-
|
|
1091
|
+
if (Y.current.invalidate(b.getState().sandboxesByMode[v]?.sandboxId ?? null), !C()) {
|
|
1092
|
+
Mr(x);
|
|
931
1093
|
return;
|
|
932
1094
|
}
|
|
933
|
-
let t = je.session?.sandboxId ?? null, r =
|
|
1095
|
+
let t = je.session?.sandboxId ?? null, r = ye(e, { confirmsNoAction: be({
|
|
934
1096
|
mode: v,
|
|
935
1097
|
capabilities: t ? b.getState().sandboxWriteCapabilities[t] : null
|
|
936
1098
|
}) });
|
|
937
|
-
O(
|
|
938
|
-
let i =
|
|
939
|
-
|
|
940
|
-
lang: i.translated ?
|
|
941
|
-
...
|
|
1099
|
+
O(E, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && qn(L, "sandbox");
|
|
1100
|
+
let i = xe(r, I, { locale: H });
|
|
1101
|
+
jr(x, "error", E, i.headline), kr(x, E, { content: i.text }), Ar(x, E, {
|
|
1102
|
+
lang: i.translated ? H : "en",
|
|
1103
|
+
...D(n.voiceSessionId)
|
|
942
1104
|
});
|
|
943
1105
|
} finally {
|
|
944
|
-
|
|
945
|
-
let e = b.getState(), t = u(
|
|
946
|
-
t && (
|
|
1106
|
+
Fi.current.delete(Ie), O(E, { outcome: "stopped" }), k(E, "complete"), Ne();
|
|
1107
|
+
let e = b.getState(), t = u(le, v, e.conversations.find((e) => e.id === Ie), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
1108
|
+
t && (Vr(Ie, t.mode), t.backendSessionId && Nr(Ie, t.backendSessionId)), je.session && C() && J.afterTurn({
|
|
947
1109
|
...je.session,
|
|
948
|
-
conversationId:
|
|
949
|
-
},
|
|
950
|
-
let n =
|
|
951
|
-
|
|
1110
|
+
conversationId: Ie
|
|
1111
|
+
}, E);
|
|
1112
|
+
let n = Yi.current;
|
|
1113
|
+
Yi.current = null, n && n.conversationId === Ie && C() && Ca.current(n.content, n.attachments, n.options);
|
|
952
1114
|
}
|
|
953
1115
|
}, [
|
|
954
|
-
|
|
1116
|
+
U,
|
|
1117
|
+
K,
|
|
1118
|
+
dr,
|
|
1119
|
+
Pr,
|
|
1120
|
+
Ir,
|
|
1121
|
+
Cr,
|
|
955
1122
|
G,
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
q,
|
|
963
|
-
Ui,
|
|
964
|
-
Qi,
|
|
965
|
-
V,
|
|
966
|
-
ar,
|
|
967
|
-
tr,
|
|
968
|
-
Xn,
|
|
969
|
-
z,
|
|
970
|
-
nr,
|
|
1123
|
+
Hi,
|
|
1124
|
+
J,
|
|
1125
|
+
da,
|
|
1126
|
+
ba,
|
|
1127
|
+
H,
|
|
1128
|
+
yr,
|
|
971
1129
|
hr,
|
|
1130
|
+
ur,
|
|
1131
|
+
B,
|
|
1132
|
+
gr,
|
|
1133
|
+
kr,
|
|
1134
|
+
L,
|
|
1135
|
+
ui,
|
|
1136
|
+
pr,
|
|
1137
|
+
xr,
|
|
1138
|
+
H,
|
|
1139
|
+
Sr,
|
|
1140
|
+
br,
|
|
1141
|
+
Vr,
|
|
1142
|
+
ya,
|
|
1143
|
+
ca,
|
|
1144
|
+
Mi,
|
|
1145
|
+
Ni,
|
|
1146
|
+
Nr,
|
|
1147
|
+
Er,
|
|
1148
|
+
jr,
|
|
1149
|
+
Mr,
|
|
972
1150
|
I,
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
Zi,
|
|
981
|
-
vi,
|
|
982
|
-
yi,
|
|
983
|
-
yr,
|
|
984
|
-
fr,
|
|
985
|
-
_r,
|
|
986
|
-
vr,
|
|
987
|
-
F,
|
|
988
|
-
Ei,
|
|
989
|
-
mr,
|
|
990
|
-
B
|
|
991
|
-
]), $i = j((e, t) => {
|
|
992
|
-
X(e, [], t ? { autoIntent: t } : {});
|
|
993
|
-
}, [X]), ea = j(() => {
|
|
994
|
-
let e = [...kr.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
1151
|
+
Bi,
|
|
1152
|
+
Or,
|
|
1153
|
+
V
|
|
1154
|
+
]), xa = j((e, t) => {
|
|
1155
|
+
Z(e, [], t ? { autoIntent: t } : {});
|
|
1156
|
+
}, [Z]), Sa = j(() => {
|
|
1157
|
+
let e = [...Ur.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
995
1158
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
996
|
-
let t =
|
|
997
|
-
|
|
1159
|
+
let t = U ? Pi.current[U] ?? [] : [];
|
|
1160
|
+
Z(e.content, t);
|
|
998
1161
|
}, [
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
]),
|
|
1162
|
+
Wr,
|
|
1163
|
+
Z,
|
|
1164
|
+
U
|
|
1165
|
+
]), Ca = N(Z);
|
|
1003
1166
|
M(() => {
|
|
1004
|
-
|
|
1005
|
-
}, [
|
|
1006
|
-
let
|
|
1007
|
-
if (
|
|
1008
|
-
for (let e =
|
|
1009
|
-
let t =
|
|
1010
|
-
if (t?.role !== "assistant" || !
|
|
1011
|
-
let n =
|
|
1167
|
+
Ca.current = Z;
|
|
1168
|
+
}, [Z]);
|
|
1169
|
+
let wa = er(() => {
|
|
1170
|
+
if (Gr) return null;
|
|
1171
|
+
for (let e = Wr.length - 1; e >= 0; --e) {
|
|
1172
|
+
let t = Wr[e];
|
|
1173
|
+
if (t?.role !== "assistant" || !Oe(t) || Ji.current.has(t.id)) continue;
|
|
1174
|
+
let n = pt(t, q, I);
|
|
1012
1175
|
if (n.kind !== "output") return null;
|
|
1013
|
-
let r =
|
|
1176
|
+
let r = bt(n.text).text.trim();
|
|
1014
1177
|
return r ? {
|
|
1015
1178
|
id: t.id,
|
|
1016
1179
|
text: r
|
|
@@ -1018,70 +1181,70 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
1018
1181
|
}
|
|
1019
1182
|
return null;
|
|
1020
1183
|
}, [
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
]),
|
|
1026
|
-
sessionId:
|
|
1027
|
-
sandboxId:
|
|
1184
|
+
Wr,
|
|
1185
|
+
Gr,
|
|
1186
|
+
q,
|
|
1187
|
+
I
|
|
1188
|
+
]), Ta = er(() => wa ? Fe(wa.text) : null, [wa]), Ea = Ur.chat, Da = b((e) => y(e)?.sandboxId ?? null), Oa = g(Ea, {
|
|
1189
|
+
sessionId: Hr?.backendSessionId,
|
|
1190
|
+
sandboxId: Da,
|
|
1028
1191
|
nowMs: Date.now()
|
|
1029
|
-
}),
|
|
1030
|
-
if (
|
|
1192
|
+
}), ka = _(Ea), Aa = (e) => {
|
|
1193
|
+
if (Vt(e.metadata).length > 0) return !0;
|
|
1031
1194
|
let t = e.metadata?.sandboxId;
|
|
1032
|
-
return
|
|
1033
|
-
},
|
|
1034
|
-
let t =
|
|
1035
|
-
return t.length === 0 || !
|
|
1195
|
+
return Ht(t ? Jr[t] : null);
|
|
1196
|
+
}, ja = (e) => {
|
|
1197
|
+
let t = Vt(e.metadata);
|
|
1198
|
+
return t.length === 0 || !U ? null : /* @__PURE__ */ P(Bt, {
|
|
1036
1199
|
refs: t,
|
|
1037
|
-
conversationId:
|
|
1038
|
-
panel:
|
|
1039
|
-
entries:
|
|
1040
|
-
capabilitiesOf: (e) =>
|
|
1041
|
-
turnInFlight:
|
|
1042
|
-
tr:
|
|
1043
|
-
onReview:
|
|
1044
|
-
retiredSandboxes:
|
|
1200
|
+
conversationId: U,
|
|
1201
|
+
panel: J,
|
|
1202
|
+
entries: Yr,
|
|
1203
|
+
capabilitiesOf: (e) => Jr[e],
|
|
1204
|
+
turnInFlight: Gr,
|
|
1205
|
+
tr: I,
|
|
1206
|
+
onReview: Zr.review,
|
|
1207
|
+
retiredSandboxes: Xr
|
|
1045
1208
|
});
|
|
1046
|
-
},
|
|
1209
|
+
}, Ma = Zr.dialog.view ? Yr[Zr.dialog.view.proposalId] : void 0, Na = Oa?.expiresAtMs ?? null;
|
|
1047
1210
|
M(() => {
|
|
1048
|
-
if (
|
|
1049
|
-
let e = window.setTimeout(() =>
|
|
1211
|
+
if (Na === null) return;
|
|
1212
|
+
let e = window.setTimeout(() => qi((e) => e + 1), Math.max(0, Na - Date.now()));
|
|
1050
1213
|
return () => window.clearTimeout(e);
|
|
1051
|
-
}, [
|
|
1052
|
-
let Q =
|
|
1214
|
+
}, [Na, Ki]);
|
|
1215
|
+
let Q = er(() => Ur.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
1053
1216
|
id: e.id,
|
|
1054
1217
|
role: e.role,
|
|
1055
|
-
text:
|
|
1056
|
-
sessionId:
|
|
1218
|
+
text: Ct(e, q, I),
|
|
1219
|
+
sessionId: ke(e),
|
|
1057
1220
|
timestamp: e.timestamp
|
|
1058
1221
|
})).filter((e) => e.text.length > 0), [
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
]),
|
|
1222
|
+
Ur.voice,
|
|
1223
|
+
q,
|
|
1224
|
+
I
|
|
1225
|
+
]), Pa = j(() => {
|
|
1063
1226
|
if (Q.length === 0) return;
|
|
1064
1227
|
let e = /* @__PURE__ */ new Date();
|
|
1065
|
-
|
|
1066
|
-
title:
|
|
1067
|
-
savedAt:
|
|
1068
|
-
session:
|
|
1069
|
-
earlier:
|
|
1070
|
-
you:
|
|
1071
|
-
assistant:
|
|
1072
|
-
}, e),
|
|
1228
|
+
$t(Me(Q, {
|
|
1229
|
+
title: I("voiceSession.transcript", "Voice conversation"),
|
|
1230
|
+
savedAt: I("voiceSession.savedAt", "Saved"),
|
|
1231
|
+
session: I("voiceSession.sessionLabel", "Session"),
|
|
1232
|
+
earlier: I("voiceSession.earlierLabel", "Earlier"),
|
|
1233
|
+
you: I("voiceSession.speakerYou", "You"),
|
|
1234
|
+
assistant: I("voiceSession.speakerAssistant", "Assistant")
|
|
1235
|
+
}, e), Ne(L, e), "text/markdown");
|
|
1073
1236
|
}, [
|
|
1074
|
-
|
|
1237
|
+
L,
|
|
1075
1238
|
Q,
|
|
1076
|
-
|
|
1077
|
-
]),
|
|
1078
|
-
|
|
1079
|
-
let
|
|
1239
|
+
I
|
|
1240
|
+
]), Fa = Yn({ perFileChars: Si }), Ia = N(Fa);
|
|
1241
|
+
Ia.current = Fa;
|
|
1242
|
+
let La = N(/* @__PURE__ */ new Set()), Ra = N(() => !1), $ = kt({
|
|
1080
1243
|
onSubmit: j((e, t, n) => {
|
|
1081
|
-
let r =
|
|
1082
|
-
let a =
|
|
1083
|
-
if (!
|
|
1084
|
-
sessionLive:
|
|
1244
|
+
let r = ki.current, i = Ke(r), a = () => {
|
|
1245
|
+
let a = Ia.current, o = b.getState();
|
|
1246
|
+
if (!Be({
|
|
1247
|
+
sessionLive: Ra.current(t),
|
|
1085
1248
|
boundAtSubmit: r,
|
|
1086
1249
|
activeConversationId: o.activeConversationId,
|
|
1087
1250
|
boundConversationExists: o.conversations.some((e) => e.id === i)
|
|
@@ -1089,436 +1252,455 @@ var Jn = ({ visible: Jn = !0, writeAccess: Yn = "unknown" }) => {
|
|
|
1089
1252
|
a.clear();
|
|
1090
1253
|
return;
|
|
1091
1254
|
}
|
|
1092
|
-
let s =
|
|
1255
|
+
let s = Ye(a.attachments), c = {
|
|
1093
1256
|
...n,
|
|
1094
|
-
handedOver:
|
|
1257
|
+
handedOver: Dt()
|
|
1095
1258
|
};
|
|
1096
|
-
|
|
1259
|
+
Ca.current(e, s, {
|
|
1097
1260
|
fromPerson: !0,
|
|
1098
1261
|
voiceSessionId: t,
|
|
1099
1262
|
voiceTiming: c
|
|
1100
1263
|
}), a.clear();
|
|
1101
1264
|
};
|
|
1102
|
-
if (
|
|
1265
|
+
if ((() => {
|
|
1266
|
+
let e = b.getState();
|
|
1267
|
+
return Be({
|
|
1268
|
+
sessionLive: Ra.current(t),
|
|
1269
|
+
boundAtSubmit: r,
|
|
1270
|
+
activeConversationId: e.activeConversationId,
|
|
1271
|
+
boundConversationExists: e.conversations.some((e) => e.id === i)
|
|
1272
|
+
});
|
|
1273
|
+
})() && ua.current(e, t)) {
|
|
1274
|
+
Ca.current(e, [], {
|
|
1275
|
+
fromPerson: !0,
|
|
1276
|
+
voiceSessionId: t,
|
|
1277
|
+
voiceTiming: {
|
|
1278
|
+
...n,
|
|
1279
|
+
handedOver: Dt()
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (!Ia.current.isBusy) {
|
|
1103
1285
|
a();
|
|
1104
1286
|
return;
|
|
1105
1287
|
}
|
|
1106
|
-
let o = Date.now(), s =
|
|
1107
|
-
|
|
1288
|
+
let o = Date.now(), s = La.current, c = window.setInterval(() => {
|
|
1289
|
+
Ia.current.isBusy && Date.now() - o < ar || (window.clearInterval(c), s.delete(c), a());
|
|
1108
1290
|
}, 200);
|
|
1109
1291
|
s.add(c);
|
|
1110
1292
|
}, []),
|
|
1111
|
-
latestReply:
|
|
1112
|
-
language:
|
|
1293
|
+
latestReply: wa,
|
|
1294
|
+
language: Ie(_r, H).tag
|
|
1113
1295
|
});
|
|
1114
|
-
|
|
1115
|
-
let
|
|
1296
|
+
Ra.current = $.isCurrentSession;
|
|
1297
|
+
let za = Ai ? Q.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : Q, Ba = $.answerLocally;
|
|
1116
1298
|
M(() => {
|
|
1117
|
-
|
|
1118
|
-
}, [
|
|
1119
|
-
let
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
]), [
|
|
1299
|
+
ma.current = Ba;
|
|
1300
|
+
}, [Ba]);
|
|
1301
|
+
let Va = $.active, Ha = er(() => it(Object.values(Yr), U, Xr), [
|
|
1302
|
+
Yr,
|
|
1303
|
+
U,
|
|
1304
|
+
Xr
|
|
1305
|
+
]), [Ua, Wa] = tr(null);
|
|
1124
1306
|
M(() => {
|
|
1125
|
-
|
|
1126
|
-
}, [
|
|
1127
|
-
let
|
|
1128
|
-
let e =
|
|
1307
|
+
Va || Wa(null);
|
|
1308
|
+
}, [Va]);
|
|
1309
|
+
let Ga = Zr.review, Ka = j(() => {
|
|
1310
|
+
let e = Ha[Ha.length - 1];
|
|
1129
1311
|
if (!e) return;
|
|
1130
1312
|
let { view: t } = e;
|
|
1131
|
-
if (
|
|
1132
|
-
|
|
1313
|
+
if (Lt(t) && It(t, Jr[e.session.sandboxId]).offerConfirm) {
|
|
1314
|
+
Ga(t);
|
|
1133
1315
|
return;
|
|
1134
1316
|
}
|
|
1135
|
-
|
|
1317
|
+
Wa(t.proposalId);
|
|
1136
1318
|
}, [
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
]),
|
|
1141
|
-
content: /* @__PURE__ */ P(
|
|
1319
|
+
Ha,
|
|
1320
|
+
Jr,
|
|
1321
|
+
Ga
|
|
1322
|
+
]), qa = Va ? tt(Ha) : null, Ja = Ua ? Yr[Ua] : void 0, Ya = Va && Ja && Ja.session.conversationId === U ? {
|
|
1323
|
+
content: /* @__PURE__ */ P(Bt, {
|
|
1142
1324
|
refs: [{
|
|
1143
|
-
proposalId:
|
|
1144
|
-
sandboxId:
|
|
1145
|
-
sessionId:
|
|
1325
|
+
proposalId: Ja.view.proposalId,
|
|
1326
|
+
sandboxId: Ja.session.sandboxId,
|
|
1327
|
+
sessionId: Ja.session.sessionId
|
|
1146
1328
|
}],
|
|
1147
|
-
conversationId:
|
|
1148
|
-
panel:
|
|
1149
|
-
entries:
|
|
1150
|
-
capabilitiesOf: (e) =>
|
|
1151
|
-
turnInFlight:
|
|
1152
|
-
tr:
|
|
1153
|
-
onReview:
|
|
1154
|
-
retiredSandboxes:
|
|
1329
|
+
conversationId: Ja.session.conversationId,
|
|
1330
|
+
panel: J,
|
|
1331
|
+
entries: Yr,
|
|
1332
|
+
capabilitiesOf: (e) => Jr[e],
|
|
1333
|
+
turnInFlight: Gr,
|
|
1334
|
+
tr: I,
|
|
1335
|
+
onReview: Ga,
|
|
1336
|
+
retiredSandboxes: Xr
|
|
1155
1337
|
}),
|
|
1156
|
-
closeLabel:
|
|
1157
|
-
onClose: () =>
|
|
1158
|
-
} : null,
|
|
1338
|
+
closeLabel: at(I, $e.trayClose),
|
|
1339
|
+
onClose: () => Wa(null)
|
|
1340
|
+
} : null, Xa = Zr.asking, Za = fa?.asking === !0, Qa = $.holdListening;
|
|
1159
1341
|
M(() => {
|
|
1160
|
-
|
|
1342
|
+
Qa(Va && (Xa || Za));
|
|
1161
1343
|
}, [
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1344
|
+
Va,
|
|
1345
|
+
Xa,
|
|
1346
|
+
Za,
|
|
1347
|
+
Qa
|
|
1166
1348
|
]);
|
|
1167
|
-
let
|
|
1349
|
+
let $a = N(null), eo = $.announce;
|
|
1168
1350
|
M(() => {
|
|
1169
|
-
if (!
|
|
1170
|
-
|
|
1351
|
+
if (!Va) {
|
|
1352
|
+
$a.current = null;
|
|
1171
1353
|
return;
|
|
1172
1354
|
}
|
|
1173
|
-
let e =
|
|
1355
|
+
let e = $a.current;
|
|
1174
1356
|
if (e === null) {
|
|
1175
|
-
|
|
1357
|
+
$a.current = new Set(Object.keys(Yr));
|
|
1176
1358
|
return;
|
|
1177
1359
|
}
|
|
1178
|
-
for (let { view: t, session: n } of
|
|
1360
|
+
for (let { view: t, session: n } of rt(Ha, e)) {
|
|
1179
1361
|
e.add(t.proposalId);
|
|
1180
|
-
let r =
|
|
1181
|
-
if (
|
|
1362
|
+
let r = Jr[n.sandboxId];
|
|
1363
|
+
if (!et({
|
|
1182
1364
|
mode: "api-calls",
|
|
1183
|
-
productWriteApproval:
|
|
1365
|
+
productWriteApproval: z,
|
|
1184
1366
|
capabilities: r
|
|
1185
1367
|
})) continue;
|
|
1186
|
-
let i =
|
|
1187
|
-
|
|
1368
|
+
let i = ot(t, It(t, r).offerConfirm, I), a = t.proposalId;
|
|
1369
|
+
eo({
|
|
1188
1370
|
id: `write-readback:${a}`,
|
|
1189
1371
|
text: i.text,
|
|
1190
|
-
lang: i.translated ?
|
|
1191
|
-
stillWanted: () =>
|
|
1372
|
+
lang: i.translated ? H : "en",
|
|
1373
|
+
stillWanted: () => J.entry(a)?.view.status === "pending"
|
|
1192
1374
|
});
|
|
1193
1375
|
}
|
|
1194
1376
|
}, [
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1377
|
+
Va,
|
|
1378
|
+
Ha,
|
|
1379
|
+
Yr,
|
|
1380
|
+
Jr,
|
|
1381
|
+
z,
|
|
1382
|
+
I,
|
|
1383
|
+
H,
|
|
1384
|
+
eo,
|
|
1385
|
+
J
|
|
1204
1386
|
]);
|
|
1205
|
-
let
|
|
1387
|
+
let to = N(!1);
|
|
1206
1388
|
M(() => {
|
|
1207
|
-
|
|
1389
|
+
to.current = $.active;
|
|
1208
1390
|
}, [$.active]), M(() => ee((e) => {
|
|
1209
|
-
if (!
|
|
1210
|
-
let t =
|
|
1391
|
+
if (!to.current) return !1;
|
|
1392
|
+
let t = ki.current;
|
|
1211
1393
|
return typeof t == "string" ? t === e : b.getState().activeConversationId === e;
|
|
1212
1394
|
}), []);
|
|
1213
|
-
let
|
|
1214
|
-
let e = b.getState().activeConversationId, t =
|
|
1215
|
-
|
|
1395
|
+
let no = $.start, ro = j(() => {
|
|
1396
|
+
let e = b.getState().activeConversationId, t = Ue(Ni());
|
|
1397
|
+
Mi(Ge(t, e)), Ui(!0, t.kind === "own"), no();
|
|
1216
1398
|
}, [
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
]),
|
|
1399
|
+
Mi,
|
|
1400
|
+
Ui,
|
|
1401
|
+
Ni,
|
|
1402
|
+
no
|
|
1403
|
+
]), io = er(() => St(Hr?.messages ?? []), [Hr?.messages]), ao = xt(Ur.voice, q, I), oo = xt(io, q, I) > 0, so = j(() => {
|
|
1222
1404
|
let e = b.getState().activeConversationId;
|
|
1223
1405
|
if (!e || Q.length === 0) return;
|
|
1224
|
-
let t = new Set(
|
|
1225
|
-
|
|
1406
|
+
let t = new Set(io.map((e) => e.id)), n = F();
|
|
1407
|
+
K(e, {
|
|
1226
1408
|
id: n,
|
|
1227
1409
|
role: "system",
|
|
1228
1410
|
content: je(Q.filter((e) => t.has(e.id)), {
|
|
1229
|
-
intro:
|
|
1230
|
-
nothing:
|
|
1231
|
-
more: (e) =>
|
|
1411
|
+
intro: I("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
1412
|
+
nothing: I("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
1413
|
+
more: (e) => I("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
1232
1414
|
}),
|
|
1233
1415
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1234
|
-
metadata: { continuedVoiceTurns:
|
|
1235
|
-
}),
|
|
1416
|
+
metadata: { continuedVoiceTurns: ao }
|
|
1417
|
+
}), on.recordCommittedEntries(e, [n], "NOTE", A()), Oi(!1), $.end();
|
|
1236
1418
|
}, [
|
|
1237
1419
|
Q,
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1420
|
+
ao,
|
|
1421
|
+
io,
|
|
1422
|
+
K,
|
|
1423
|
+
I,
|
|
1242
1424
|
$,
|
|
1243
|
-
|
|
1244
|
-
]),
|
|
1425
|
+
Oi
|
|
1426
|
+
]), co = N({
|
|
1245
1427
|
conversationId: null,
|
|
1246
1428
|
count: 0
|
|
1247
1429
|
});
|
|
1248
1430
|
M(() => {
|
|
1249
|
-
$.active && (
|
|
1250
|
-
conversationId:
|
|
1251
|
-
count:
|
|
1431
|
+
$.active && (co.current = {
|
|
1432
|
+
conversationId: U,
|
|
1433
|
+
count: ao
|
|
1252
1434
|
});
|
|
1253
1435
|
}, [$.active]);
|
|
1254
|
-
let
|
|
1255
|
-
let e =
|
|
1256
|
-
$.end(), t &&
|
|
1436
|
+
let lo = j(() => {
|
|
1437
|
+
let e = co.current, t = ao > (e.conversationId === U ? e.count : 0);
|
|
1438
|
+
$.end(), t && Oi(!0);
|
|
1257
1439
|
}, [
|
|
1258
|
-
|
|
1259
|
-
|
|
1440
|
+
U,
|
|
1441
|
+
ao,
|
|
1260
1442
|
$,
|
|
1261
|
-
|
|
1443
|
+
Oi
|
|
1262
1444
|
]);
|
|
1263
1445
|
M(() => {
|
|
1264
|
-
(!
|
|
1446
|
+
(!cr || !zi) && $.active && $.end();
|
|
1265
1447
|
}, [
|
|
1266
|
-
|
|
1267
|
-
|
|
1448
|
+
cr,
|
|
1449
|
+
zi,
|
|
1268
1450
|
$
|
|
1269
1451
|
]), M(() => {
|
|
1270
|
-
let e =
|
|
1452
|
+
let e = ki.current, t = Ke(e), n = b.getState(), r = He({
|
|
1271
1453
|
sessionLive: $.active,
|
|
1272
1454
|
bound: e,
|
|
1273
1455
|
activeConversationId: n.activeConversationId,
|
|
1274
1456
|
boundConversationExists: n.conversations.some((e) => e.id === t)
|
|
1275
1457
|
});
|
|
1276
|
-
|
|
1458
|
+
Mi(r.bound), r.end && $.end();
|
|
1277
1459
|
}, [
|
|
1278
1460
|
$,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1461
|
+
U,
|
|
1462
|
+
Cr,
|
|
1463
|
+
Mi
|
|
1282
1464
|
]);
|
|
1283
|
-
let
|
|
1465
|
+
let uo = N(Re);
|
|
1284
1466
|
M(() => {
|
|
1285
|
-
let e =
|
|
1286
|
-
activeConversationId:
|
|
1287
|
-
chatTurnCount:
|
|
1467
|
+
let e = Ve(uo.current, {
|
|
1468
|
+
activeConversationId: U,
|
|
1469
|
+
chatTurnCount: Ea.length,
|
|
1288
1470
|
voiceTurnCount: Q.length,
|
|
1289
1471
|
sessionLive: $.active,
|
|
1290
|
-
sessionBoundTo:
|
|
1291
|
-
turnInFlight:
|
|
1472
|
+
sessionBoundTo: ki.current,
|
|
1473
|
+
turnInFlight: Gr
|
|
1292
1474
|
});
|
|
1293
|
-
|
|
1475
|
+
uo.current = e.state, e.open && Oi(!0);
|
|
1294
1476
|
}, [
|
|
1295
|
-
|
|
1296
|
-
|
|
1477
|
+
U,
|
|
1478
|
+
Ea.length,
|
|
1297
1479
|
Q.length,
|
|
1298
1480
|
$.active,
|
|
1299
|
-
|
|
1300
|
-
|
|
1481
|
+
Gr,
|
|
1482
|
+
Oi
|
|
1301
1483
|
]), M(() => {
|
|
1302
1484
|
if (!$.active) {
|
|
1303
|
-
|
|
1304
|
-
for (let e of
|
|
1305
|
-
|
|
1485
|
+
Ia.current.clear(), Yi.current = null;
|
|
1486
|
+
for (let e of La.current) window.clearInterval(e);
|
|
1487
|
+
La.current.clear();
|
|
1306
1488
|
}
|
|
1307
1489
|
}, [$.active]), M(() => {
|
|
1308
|
-
let e =
|
|
1490
|
+
let e = La.current;
|
|
1309
1491
|
return () => {
|
|
1310
1492
|
for (let t of e) window.clearInterval(t);
|
|
1311
1493
|
e.clear();
|
|
1312
1494
|
};
|
|
1313
1495
|
}, []), M(() => {
|
|
1314
1496
|
let e = b.getState().consumePendingPrompt();
|
|
1315
|
-
return e &&
|
|
1497
|
+
return e && Ca.current(e), b.subscribe((e, t) => {
|
|
1316
1498
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
1317
1499
|
let e = b.getState().consumePendingPrompt();
|
|
1318
|
-
e &&
|
|
1500
|
+
e && Ca.current(e);
|
|
1319
1501
|
}
|
|
1320
1502
|
});
|
|
1321
1503
|
}, []);
|
|
1322
|
-
let
|
|
1323
|
-
let t =
|
|
1324
|
-
if (t && t.mode !== e &&
|
|
1504
|
+
let fo = j((e) => {
|
|
1505
|
+
let t = U ? b.getState().conversations.find((e) => e.id === U) : void 0;
|
|
1506
|
+
if (t && t.mode !== e && J.withdraw(t.id, "mode_switched"), t && en(t)) {
|
|
1325
1507
|
if (t.mode !== e) {
|
|
1326
|
-
let t = p(), n = b.getState().conversations.find((n) => n.mode === e &&
|
|
1327
|
-
n ?
|
|
1508
|
+
let t = p(), n = b.getState().conversations.find((n) => n.mode === e && rn(n, t) && !b.getState().processingByConversationId[n.id]);
|
|
1509
|
+
n ? Dr(n.id) : G(void 0, e);
|
|
1328
1510
|
}
|
|
1329
|
-
} else
|
|
1511
|
+
} else U && Er(U, e);
|
|
1330
1512
|
let n = b.getState().activeConversationId;
|
|
1331
|
-
n ?
|
|
1513
|
+
n ? Er(n, e) : Br(!1), Tr(e);
|
|
1332
1514
|
}, [
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1515
|
+
U,
|
|
1516
|
+
G,
|
|
1517
|
+
Dr,
|
|
1518
|
+
Br,
|
|
1336
1519
|
Er,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
]), Ua = j(() => {
|
|
1520
|
+
Tr,
|
|
1521
|
+
J
|
|
1522
|
+
]), po = j(() => {
|
|
1341
1523
|
let e = b.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
1342
1524
|
if (!t) {
|
|
1343
|
-
|
|
1525
|
+
Br(!0), Tr(s);
|
|
1344
1526
|
return;
|
|
1345
1527
|
}
|
|
1346
1528
|
if (t.routedBy === "auto") {
|
|
1347
|
-
|
|
1529
|
+
Br(!0);
|
|
1348
1530
|
return;
|
|
1349
1531
|
}
|
|
1350
|
-
if (
|
|
1351
|
-
|
|
1532
|
+
if (!en(t)) {
|
|
1533
|
+
Vr(t.id, s);
|
|
1352
1534
|
return;
|
|
1353
1535
|
}
|
|
1354
|
-
|
|
1355
|
-
let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" &&
|
|
1356
|
-
r ? (
|
|
1536
|
+
J.withdraw(t.id, "mode_switched");
|
|
1537
|
+
let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" && rn(t, n) && !e.processingByConversationId[t.id]);
|
|
1538
|
+
r ? (Dr(r.id), Vr(r.id, s)) : G(void 0, s, { routedBy: "auto" });
|
|
1357
1539
|
}, [
|
|
1358
|
-
|
|
1540
|
+
G,
|
|
1541
|
+
Vr,
|
|
1359
1542
|
Dr,
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
ui(e);
|
|
1543
|
+
Br,
|
|
1544
|
+
Tr,
|
|
1545
|
+
J
|
|
1546
|
+
]), mo = j((e) => {
|
|
1547
|
+
if (R.find((t) => t.id === e)?.writeCapable && !ie(b.getState().acknowledgedWriteModes, e)) {
|
|
1548
|
+
wi(e);
|
|
1367
1549
|
return;
|
|
1368
1550
|
}
|
|
1369
|
-
|
|
1370
|
-
}, [
|
|
1371
|
-
let e =
|
|
1372
|
-
if (
|
|
1373
|
-
let t =
|
|
1374
|
-
if (
|
|
1375
|
-
|
|
1551
|
+
fo(e);
|
|
1552
|
+
}, [fo, R]), ho = j(() => {
|
|
1553
|
+
let e = Ci;
|
|
1554
|
+
if (wi(null), !e) return;
|
|
1555
|
+
let t = bi.current;
|
|
1556
|
+
if (bi.current = null, t) {
|
|
1557
|
+
Rr(e), Z(t.content, t.attachments, t.options);
|
|
1376
1558
|
return;
|
|
1377
1559
|
}
|
|
1378
|
-
|
|
1560
|
+
Rr(e), fo(e);
|
|
1379
1561
|
}, [
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
]),
|
|
1385
|
-
|
|
1386
|
-
let e =
|
|
1387
|
-
|
|
1562
|
+
Ci,
|
|
1563
|
+
Rr,
|
|
1564
|
+
fo,
|
|
1565
|
+
Z
|
|
1566
|
+
]), go = Ci === null ? void 0 : R.find((e) => e.id === Ci) ?? { id: Ci }, _o = j(() => {
|
|
1567
|
+
wi(null);
|
|
1568
|
+
let e = bi.current;
|
|
1569
|
+
bi.current = null, e && Z(e.content, e.attachments, {
|
|
1388
1570
|
...e.options,
|
|
1389
1571
|
autoIntent: "read"
|
|
1390
1572
|
});
|
|
1391
|
-
}, [
|
|
1392
|
-
return /* @__PURE__ */
|
|
1573
|
+
}, [Z]);
|
|
1574
|
+
return /* @__PURE__ */ rr("div", {
|
|
1393
1575
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
1394
1576
|
children: [
|
|
1395
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ rr("div", {
|
|
1396
1578
|
className: "contents",
|
|
1397
1579
|
inert: $.active || void 0,
|
|
1398
1580
|
children: [
|
|
1399
|
-
|
|
1400
|
-
Q.length > 0 && !$.active ? /* @__PURE__ */ P(
|
|
1581
|
+
si === null ? null : /* @__PURE__ */ P(Jt, { onDismiss: () => oi(si) }),
|
|
1582
|
+
Q.length > 0 && !$.active ? /* @__PURE__ */ P(Kt, {
|
|
1401
1583
|
count: Q.length,
|
|
1402
|
-
onOpenTranscript: () =>
|
|
1584
|
+
onOpenTranscript: () => Oi(!0)
|
|
1403
1585
|
}) : null,
|
|
1404
|
-
|
|
1405
|
-
state:
|
|
1406
|
-
onRetry:
|
|
1407
|
-
}) :
|
|
1586
|
+
Ea.length === 0 && (ni || ri) ? /* @__PURE__ */ P(Yt, {
|
|
1587
|
+
state: ni ? "loading" : "failed",
|
|
1588
|
+
onRetry: fi
|
|
1589
|
+
}) : Ea.length === 0 && Hr?.sync?.hasOlder ? /* @__PURE__ */ P("div", {
|
|
1408
1590
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1409
|
-
children: /* @__PURE__ */ P(
|
|
1410
|
-
onShowEarlier:
|
|
1411
|
-
disabled:
|
|
1591
|
+
children: /* @__PURE__ */ P(Zt, {
|
|
1592
|
+
onShowEarlier: pi,
|
|
1593
|
+
disabled: ni
|
|
1412
1594
|
})
|
|
1413
|
-
}) :
|
|
1414
|
-
mode:
|
|
1415
|
-
onSuggestionClick:
|
|
1416
|
-
explainsAuto:
|
|
1417
|
-
suggestions:
|
|
1418
|
-
}) : /* @__PURE__ */
|
|
1595
|
+
}) : Ea.length === 0 ? /* @__PURE__ */ P(sn, {
|
|
1596
|
+
mode: W,
|
|
1597
|
+
onSuggestionClick: xa,
|
|
1598
|
+
explainsAuto: vi,
|
|
1599
|
+
suggestions: vi && W === "assistant" ? c(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
1600
|
+
}) : /* @__PURE__ */ rr("div", {
|
|
1419
1601
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1420
|
-
children: [
|
|
1421
|
-
onShowEarlier:
|
|
1422
|
-
disabled:
|
|
1423
|
-
}) : null, /* @__PURE__ */ P(
|
|
1424
|
-
onApprovePendingWrite:
|
|
1425
|
-
approvingWriteRef:
|
|
1426
|
-
approvableMessageId:
|
|
1427
|
-
retryableMessageId:
|
|
1428
|
-
messages:
|
|
1429
|
-
processing:
|
|
1430
|
-
streamingMessageId:
|
|
1431
|
-
failedMessageId:
|
|
1432
|
-
onRetry:
|
|
1433
|
-
renderWriteProposals:
|
|
1434
|
-
hidesLegacyWriteCard:
|
|
1602
|
+
children: [Hr?.sync?.hasOlder ? /* @__PURE__ */ P(Zt, {
|
|
1603
|
+
onShowEarlier: pi,
|
|
1604
|
+
disabled: ni
|
|
1605
|
+
}) : null, /* @__PURE__ */ P(mn, {
|
|
1606
|
+
onApprovePendingWrite: Zi,
|
|
1607
|
+
approvingWriteRef: Gi,
|
|
1608
|
+
approvableMessageId: Oa?.messageId ?? null,
|
|
1609
|
+
retryableMessageId: ka,
|
|
1610
|
+
messages: Ea,
|
|
1611
|
+
processing: q ?? null,
|
|
1612
|
+
streamingMessageId: Kr,
|
|
1613
|
+
failedMessageId: qr,
|
|
1614
|
+
onRetry: Gi === null ? Sa : void 0,
|
|
1615
|
+
renderWriteProposals: ja,
|
|
1616
|
+
hidesLegacyWriteCard: Aa
|
|
1435
1617
|
})]
|
|
1436
1618
|
}),
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
tr:
|
|
1441
|
-
onDismiss: () =>
|
|
1619
|
+
ei ? /* @__PURE__ */ P(Xt, { onStartNew: () => G() }) : null,
|
|
1620
|
+
ti && U ? /* @__PURE__ */ P(qt, { onUnarchive: () => on.updateConversation(U, { archived: !1 }) }) : null,
|
|
1621
|
+
ha === null ? null : /* @__PURE__ */ P(cn, {
|
|
1622
|
+
tr: I,
|
|
1623
|
+
onDismiss: () => ga(null)
|
|
1442
1624
|
}),
|
|
1443
|
-
|
|
1444
|
-
state:
|
|
1445
|
-
onRetry:
|
|
1625
|
+
Ea.length > 0 && (ni || ri) ? /* @__PURE__ */ P(Yt, {
|
|
1626
|
+
state: ni ? "loading" : "failed",
|
|
1627
|
+
onRetry: fi,
|
|
1446
1628
|
compact: !0
|
|
1447
1629
|
}) : null,
|
|
1448
|
-
/* @__PURE__ */ P(
|
|
1449
|
-
onStartVoiceSession: $.available &&
|
|
1450
|
-
onSend: (e, t) => void
|
|
1451
|
-
onDraftStart:
|
|
1452
|
-
disabled:
|
|
1453
|
-
readOnly:
|
|
1454
|
-
placeholder:
|
|
1455
|
-
mode:
|
|
1456
|
-
writeAccessDenied:
|
|
1457
|
-
availableModes:
|
|
1458
|
-
attachmentCharsPerFile:
|
|
1459
|
-
onModeChange:
|
|
1460
|
-
auto:
|
|
1461
|
-
active:
|
|
1462
|
-
onSelect:
|
|
1630
|
+
/* @__PURE__ */ P(Xn, {
|
|
1631
|
+
onStartVoiceSession: $.available && zi ? ro : void 0,
|
|
1632
|
+
onSend: (e, t) => void Z(e, t, { fromPerson: !0 }),
|
|
1633
|
+
onDraftStart: Wi,
|
|
1634
|
+
disabled: Gr || Gi !== null || ni || aa,
|
|
1635
|
+
readOnly: ei,
|
|
1636
|
+
placeholder: W === "api-calls" ? I("chatArea.placeholderActions", "What would you like me to do?") : I("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
1637
|
+
mode: W,
|
|
1638
|
+
writeAccessDenied: lr === "denied" && !!Ii?.writeCapable,
|
|
1639
|
+
availableModes: gi,
|
|
1640
|
+
attachmentCharsPerFile: Si,
|
|
1641
|
+
onModeChange: mo,
|
|
1642
|
+
auto: _i ? {
|
|
1643
|
+
active: vi,
|
|
1644
|
+
onSelect: po
|
|
1463
1645
|
} : void 0
|
|
1464
1646
|
})
|
|
1465
1647
|
]
|
|
1466
1648
|
}),
|
|
1467
|
-
|
|
1649
|
+
Di && !$.active ? /* @__PURE__ */ P(Qt, {
|
|
1468
1650
|
turns: Q,
|
|
1469
|
-
onClose: () =>
|
|
1470
|
-
onSave:
|
|
1471
|
-
onContinueInChat:
|
|
1651
|
+
onClose: () => Oi(!1),
|
|
1652
|
+
onSave: Pa,
|
|
1653
|
+
onContinueInChat: oo ? so : void 0,
|
|
1472
1654
|
closeOnEscape: !0,
|
|
1473
|
-
onShowEarlier:
|
|
1474
|
-
showEarlierDisabled:
|
|
1655
|
+
onShowEarlier: Hr?.sync?.hasOlder ? pi : void 0,
|
|
1656
|
+
showEarlierDisabled: ni
|
|
1475
1657
|
}) : null,
|
|
1476
|
-
$.active && /* @__PURE__ */ P(
|
|
1658
|
+
$.active && /* @__PURE__ */ P(hn, {
|
|
1477
1659
|
session: $.session,
|
|
1478
1660
|
notice: $.notice,
|
|
1479
1661
|
capturing: $.capturing,
|
|
1480
1662
|
interrupting: $.interrupting,
|
|
1481
1663
|
awaitingEndpoint: $.awaitingEndpoint,
|
|
1482
|
-
turns:
|
|
1664
|
+
turns: za,
|
|
1483
1665
|
spokenChunks: $.spokenChunks,
|
|
1484
|
-
attachments:
|
|
1485
|
-
onAttachFiles:
|
|
1486
|
-
onRemoveAttachment:
|
|
1487
|
-
onRetryAttachment:
|
|
1488
|
-
canAttachMore:
|
|
1489
|
-
preparingAttachments:
|
|
1490
|
-
onSaveTranscript:
|
|
1491
|
-
onContinueInChat:
|
|
1666
|
+
attachments: Fa.attachments,
|
|
1667
|
+
onAttachFiles: Fa.addFiles,
|
|
1668
|
+
onRemoveAttachment: Fa.remove,
|
|
1669
|
+
onRetryAttachment: Fa.retry,
|
|
1670
|
+
canAttachMore: Fa.canAddMore,
|
|
1671
|
+
preparingAttachments: Fa.preparingCount,
|
|
1672
|
+
onSaveTranscript: Pa,
|
|
1673
|
+
onContinueInChat: so,
|
|
1492
1674
|
onInterrupt: () => {
|
|
1493
|
-
$.interrupt(),
|
|
1675
|
+
$.interrupt(), Xi();
|
|
1494
1676
|
},
|
|
1495
|
-
spoken:
|
|
1677
|
+
spoken: Ta,
|
|
1496
1678
|
onToggleMute: $.toggleMute,
|
|
1497
|
-
onEnd:
|
|
1498
|
-
proposalChip:
|
|
1499
|
-
label:
|
|
1500
|
-
onOpen:
|
|
1679
|
+
onEnd: lo,
|
|
1680
|
+
proposalChip: qa ? {
|
|
1681
|
+
label: nt(qa, I),
|
|
1682
|
+
onOpen: Ka
|
|
1501
1683
|
} : null,
|
|
1502
|
-
proposalTray:
|
|
1684
|
+
proposalTray: Ya
|
|
1503
1685
|
}),
|
|
1504
|
-
/* @__PURE__ */ P(
|
|
1505
|
-
open:
|
|
1506
|
-
mode:
|
|
1507
|
-
currentMode:
|
|
1508
|
-
onConfirm:
|
|
1509
|
-
onCancel:
|
|
1686
|
+
/* @__PURE__ */ P(Qn, {
|
|
1687
|
+
open: Ci !== null,
|
|
1688
|
+
mode: go,
|
|
1689
|
+
currentMode: Ii ?? { id: W },
|
|
1690
|
+
onConfirm: ho,
|
|
1691
|
+
onCancel: _o
|
|
1510
1692
|
}),
|
|
1511
|
-
/* @__PURE__ */ P(
|
|
1512
|
-
...
|
|
1513
|
-
view:
|
|
1514
|
-
serverNow:
|
|
1515
|
-
arrivedAt:
|
|
1516
|
-
capabilities:
|
|
1517
|
-
turnInFlight:
|
|
1518
|
-
tr:
|
|
1693
|
+
/* @__PURE__ */ P(Rt, {
|
|
1694
|
+
...Zr.dialog,
|
|
1695
|
+
view: Ma?.view ?? Zr.dialog.view,
|
|
1696
|
+
serverNow: Ma?.serverNow ?? NaN,
|
|
1697
|
+
arrivedAt: Ma?.arrivedAt ?? NaN,
|
|
1698
|
+
capabilities: Ma ? Jr[Ma.session.sandboxId] : null,
|
|
1699
|
+
turnInFlight: Gr,
|
|
1700
|
+
tr: I
|
|
1519
1701
|
})
|
|
1520
1702
|
]
|
|
1521
1703
|
});
|
|
1522
1704
|
};
|
|
1523
1705
|
//#endregion
|
|
1524
|
-
export {
|
|
1706
|
+
export { cr as AssistantChatArea };
|