@burdenoff/fe-libs 2026.1014.5 → 2026.1015.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/avatar/avatarPreferences.d.ts +61 -14
- package/dist/shared/assistant/avatar/avatarPreferences.js +54 -21
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.d.ts +33 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +278 -0
- package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +5 -0
- package/dist/shared/assistant/avatar/live/avatarSessionClient.js +25 -6
- package/dist/shared/assistant/avatar/live/avatarVoice.d.ts +43 -0
- package/dist/shared/assistant/avatar/live/avatarVoice.js +45 -0
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +21 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +74 -24
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +47 -8
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +244 -161
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +2 -2
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +11 -4
- package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +50 -21
- package/dist/shared/assistant/avatar/useAvatarCopy.js +93 -49
- package/dist/shared/assistant/i18nManifest.d.ts +23 -2
- package/dist/shared/assistant/i18nManifest.js +23 -2
- package/dist/shared/assistant/index.d.ts +6 -0
- package/dist/shared/assistant/speech/hostedVoiceCatalogue.d.ts +19 -0
- package/dist/shared/assistant/speech/hostedVoiceCatalogue.js +25 -18
- package/dist/shared/assistant/ui/AIAssistantPanel.js +134 -101
- package/dist/shared/assistant/ui/AssistantAvatarTabs.d.ts +10 -0
- package/dist/shared/assistant/ui/AssistantAvatarTabs.js +48 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1261 -1202
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +137 -5
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +114 -55
- package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.d.ts +13 -0
- package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.js +70 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +18 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +121 -102
- package/dist/shared/assistant/ui/panelOverlays.d.ts +24 -3
- package/dist/shared/assistant/ui/panelOverlays.js +11 -10
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +20 -5
- package/dist/shared/assistant/ui/useVoiceSession.js +11 -4
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +8 -2
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +172 -160
- package/dist/shared/assistant/ui/voice/voiceStartGate.d.ts +57 -0
- package/dist/shared/assistant/ui/voice/voiceStartGate.js +9 -0
- package/dist/shared/assistant/voice/voiceReply.d.ts +23 -0
- package/dist/shared/assistant/voice/voiceReply.js +13 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts +10 -0
- package/dist/shared/assistant/voice/voiceSession.js +7 -0
- package/dist/shared-assistant.js +260 -254
- package/package.json +1 -1
|
@@ -7,348 +7,360 @@ import { useAssistantProduct as i } from "../product.js";
|
|
|
7
7
|
import { useAssistantTr as a } from "../i18n.js";
|
|
8
8
|
import { useAssistantNavigate as o } from "./AssistantMarkdownRenderer.js";
|
|
9
9
|
import { isAssistantModeId as s } from "../modeIds.js";
|
|
10
|
-
import { AUTO_READ_MODE as c, autoSuggestions as l, classifyAssistantIntent as u, escalationToUndo as d, isAutoRoutingOffered as f, resolveAutoRoute as
|
|
11
|
-
import { getHistoryStamp as
|
|
12
|
-
import { beginApprovalInFlight as
|
|
13
|
-
import { isWriteModeAcknowledged as
|
|
14
|
-
import { resolveActiveModeSandbox as
|
|
15
|
-
import { abortAssistantTurn as
|
|
16
|
-
import { sanitize as
|
|
17
|
-
import { UiOfferSession as
|
|
18
|
-
import { AssistantSendRefusal as
|
|
19
|
-
import { assistantUsageLedger as
|
|
20
|
-
import { withIncompleteTurnNotice as
|
|
21
|
-
import { chatTurns as
|
|
22
|
-
import { speechFeed as
|
|
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 {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
10
|
+
import { AUTO_READ_MODE as c, autoSuggestions as l, classifyAssistantIntent as u, escalationToUndo as d, isAutoRoutingOffered as f, resolveAutoRoute as ee } from "../autoRouting.js";
|
|
11
|
+
import { getHistoryStamp as p, setHistoryBusyProbe as m } from "../history/stampRegistry.js";
|
|
12
|
+
import { beginApprovalInFlight as te, endApprovalInFlight as ne, getApprovalInFlight as h, markLiveTurn as re, newestModelReplyId as ie, resolveApprovablePendingWrite as g, resolveRetryableMessageId as _, subscribeApprovalInFlight as ae } from "../liveTurns.js";
|
|
13
|
+
import { isWriteModeAcknowledged as oe, writeModeSendRefusalReason as se } from "../writeModeConsent.js";
|
|
14
|
+
import { resolveActiveModeSandbox as ce, useAssistantStore as v } from "../store.js";
|
|
15
|
+
import { abortAssistantTurn as le, approvePendingWrite as y, createAssistantSandbox as ue, createAssistantSession as de, extendAssistantSandboxTTL as fe, findExistingSandboxWithStatus as pe, getAssistantArtifacts as me, getAssistantMessages as he, getAssistantSession as b, mintAssistantTurnStream as ge, modeRequiresConfirmWrites as _e, promptGatewayRequestBytes as ve, releaseSupersededAssistantSandboxes as ye, sendAssistantPromptAsync as be, waitForAssistantServiceReady as xe, waitForSandboxRunning as Se, writeApprovalModeOf as Ce } from "../api.js";
|
|
16
|
+
import { sanitize as we } from "../progress.js";
|
|
17
|
+
import { UiOfferSession as Te, sandboxServesUiOffers as Ee, uiOfferHintKind as x, uiOfferInTime as De } from "../uiActions/uiOffers.js";
|
|
18
|
+
import { AssistantSendRefusal as Oe, classifyTurnFailure as ke, turnConfirmsNoAction as Ae, turnOutcomeCopy as je } from "../turnOutcome.js";
|
|
19
|
+
import { assistantUsageLedger as Me, hasPendingUsageReports as Ne, reportUsageWithRetry as Pe, retryPendingUsageReports as Fe, usageSendRefusal as Ie } from "../usageReporting.js";
|
|
20
|
+
import { withIncompleteTurnNotice as Le } from "../streamBudget.js";
|
|
21
|
+
import { chatTurns as Re, isVoiceTurn as ze, voiceMarker as S, voiceSessionIdOf as C } from "../voice/turnVisibility.js";
|
|
22
|
+
import { speechFeed as Be } from "../speech/speechFeed.js";
|
|
23
|
+
import { toVoiceReply as Ve } from "../voice/voiceReply.js";
|
|
24
|
+
import { isTurnSuperseded as He, markTurnSuperseded as Ue } from "../voice/supersededTurns.js";
|
|
25
|
+
import { buildContinuedFromVoiceNote as We, buildVoiceTranscriptMarkdown as Ge, voiceTranscriptFilename as Ke } from "../voice/voiceTranscript.js";
|
|
26
|
+
import { pollDelayMs as qe } from "../voice/assistantPollSchedule.js";
|
|
27
|
+
import { toCaptionText as Je } from "../voice/captionText.js";
|
|
28
|
+
import { resolveAssistantLanguage as Ye } from "../voice/languages.js";
|
|
29
|
+
import { resolveLanguagePair as Xe } from "../voice/languagePair.js";
|
|
30
|
+
import { INITIAL_TRANSCRIPT_AUTO_OPEN as w, isAwaitingOwnConversation as Ze, maySendSpokenTurn as Qe, planTranscriptAutoOpen as $e, planVoiceSessionBinding as et, planVoiceSessionStart as tt, planVoiceSpokenEntry as nt, voiceBindingAtStart as rt, voiceBindingConversationId as it } from "../voice/voiceReopen.js";
|
|
31
|
+
import { countInlineImageCandidates as at, countInlinedImageParts as ot, largestInlineCharsPerFile as st, resolveAssistantInlineLimits as ct, toMessageAttachment as lt } from "../attachments.js";
|
|
32
|
+
import { WRITE_PROPOSAL_VOICE_COPY as ut, isVoiceProposalBound as dt, voiceProposalChip as ft, voiceProposalChipText as pt, voiceReadbacksDue as mt, voiceWaitingProposals as ht, writeProposalVoiceLine as gt, writeProposalVoiceReadback as _t } from "../writeProposalVoice.js";
|
|
33
|
+
import { createAdminModeAccessGate as vt, resolveAssistantSendModeAfterAccess as yt } from "../adminModeSendGate.js";
|
|
34
|
+
import { buildBoundedAttachmentTurn as bt } from "../attachmentTurn.js";
|
|
35
|
+
import { useAvatarCopy as xt } from "../avatar/useAvatarCopy.js";
|
|
36
|
+
import { attachmentUrlIsStale as St, refreshStaleAttachmentUrls as Ct } from "../attachmentCommit.js";
|
|
37
|
+
import { VOICE_COMMIT_BUDGET_MS as wt, settleAndCommitSpokenTurn as Tt } from "../voiceCommit.js";
|
|
38
|
+
import { getOrganizationId as Et, getWorkspaceId as T } from "../context.js";
|
|
39
|
+
import { useAttachmentUrlResolver as Dt } from "../useAttachmentCommitter.js";
|
|
40
|
+
import { isTurnInFlight as Ot, planAbandonedTurn as kt, planTurnAbort as At } from "../turnState.js";
|
|
41
|
+
import { backDoneCopy as jt, chooseDestinationCopy as Mt, chooseLinkedCopy as Nt, entityNounText as Pt, linkNotOpenableCopy as Ft, navigationCommandCopy as It, navigationOutcomeCopy as Lt, offerExpiredCopy as Rt, offerKeptForUnsavedCopy as zt, offerNotAvailableCopy as Bt, pickFromListCopy as Vt, recordChoiceCopy as Ht, recordKindsCopy as Ut, themeCommandCopy as Wt } from "../localUiCommandCopy.js";
|
|
42
|
+
import { appControlCopy as Gt } from "../appControls/copy.js";
|
|
43
|
+
import { LANGUAGE_REPLY_DEADLINE_MS as Kt, languageConfirmationCopy as qt, languageReplyStep as Jt } from "../appControls/languageReply.js";
|
|
44
|
+
import { getAssistantDisplayContent as Yt } from "../displayContent.js";
|
|
45
|
+
import { NO_FIRST_TEXT as Xt, buildAssistantProgress as Zt, readAheadFor as Qt, snapshotReplyFloor as $t, startSessionReadAhead as en, trackFirstText as tn } from "../turnProgress.js";
|
|
46
|
+
import { parseToolActivity as nn } from "./AssistantToolActivity.js";
|
|
47
|
+
import { countSpokenTurns as rn, spokenMessagesSinceContinueNote as an, spokenTurnText as on } from "../spokenTurns.js";
|
|
48
|
+
import { beginTurn as sn, describeTurn as E, detectTurnDevice as cn, markTurn as D, restartAttempt as ln, turnClockMs as un } from "../turnTimeline.js";
|
|
49
|
+
import { useAssistantSpeech as dn } from "./AssistantSpeechProvider.js";
|
|
50
|
+
import { useLiveAvatarTab as fn, useLiveAvatarTabSeam as pn } from "./assistantLiveAvatarSeam.js";
|
|
51
|
+
import { useVoiceSession as mn } from "./useVoiceSession.js";
|
|
52
|
+
import { isMultimodalBodyRejection as hn, isRecoverableAssistantError as gn } from "../transportErrors.js";
|
|
53
|
+
import { createReadinessTracker as _n, planAfterTransportFailure as vn, planTrustedSandboxFailure as yn } from "../sandboxReadiness.js";
|
|
54
|
+
import { writeProposalConfirmState as bn } from "./writeProposalPresentation.js";
|
|
55
|
+
import { writeProposalUsesDialog as xn } from "./AssistantWriteProposalCard.js";
|
|
56
|
+
import { AssistantWriteConfirmDialog as Sn } from "./AssistantWriteConfirmDialog.js";
|
|
57
|
+
import { useWriteProposalConfirm as Cn } from "./useWriteProposalConfirm.js";
|
|
58
|
+
import { AssistantWriteProposalSlot as wn } from "./AssistantWriteProposalSlot.js";
|
|
59
|
+
import { readWriteProposalRefs as Tn, writeProposalsEnabledFor as En } from "../writeProposalDiscovery.js";
|
|
60
|
+
import { planWriteReply as Dn, promptWriteApproval as On } from "../writeReplySend.js";
|
|
61
|
+
import { useWriteProposals as kn } from "./useWriteProposals.js";
|
|
62
|
+
import { AssistantSpokenTurnsNotice as An } from "./AssistantSpokenTurnsNotice.js";
|
|
63
|
+
import { AssistantHistoryArchivedNotice as jn, AssistantHistoryDeletedNotice as Mn, AssistantHistoryLoadState as Nn, AssistantHistoryReadOnlyBanner as Pn, AssistantHistoryShowEarlier as Fn } from "./AssistantHistoryNotices.js";
|
|
64
|
+
import { VoiceTranscriptDrawer as In } from "./voice/VoiceTranscriptDrawer.js";
|
|
65
|
+
import { downloadFile as Ln } from "../exportConversation.js";
|
|
66
|
+
import { conversationHasHistory as Rn, isOtherScopeHistoryConversation as zn, isReadOnlyHistoryConversation as Bn, isReusableHistoryDraft as Vn } from "../history/historyList.js";
|
|
67
|
+
import { useAssistantHistoryStatus as Hn } from "../history/historyStatus.js";
|
|
68
|
+
import { assistantHistory as Un } from "../history/historyEngine.js";
|
|
69
|
+
import { AssistantEmptyState as Wn } from "./AssistantEmptyState.js";
|
|
70
|
+
import { AssistantNothingToDeleteNotice as Gn } from "./AssistantDeleteConversationDialog.js";
|
|
71
|
+
import { assistantHistoryIsOn as Kn } from "./conversationDelete.js";
|
|
72
|
+
import { useConversationDeleteDialog as qn } from "./conversationDeleteDialog.js";
|
|
73
|
+
import { useControlConfirmDialog as Jn } from "./controlConfirmDialog.js";
|
|
74
|
+
import { useLeaveConfirmAsking as Yn } from "./leaveConfirm.js";
|
|
75
|
+
import { startFocusReturnAfterKeep as Xn } from "./leaveConfirmFocus.js";
|
|
76
|
+
import { resolveConversationDeleteTarget as Zn } from "../conversationDeleteCommand.js";
|
|
77
|
+
import { resumeContextFor as Qn } from "../history/historyResume.js";
|
|
78
|
+
import { useHistoryRowControlsFor as $n } from "../history/useHistoryRowControls.js";
|
|
79
|
+
import { liveCoverage as er } from "../liveDeltas.js";
|
|
80
|
+
import { createLiveRender as tr } from "../liveOverlay.js";
|
|
81
|
+
import { AssistantMessageList as nr } from "./AssistantMessageList.js";
|
|
82
|
+
import { AssistantUiOfferLinks as rr } from "./AssistantUiOfferLink.js";
|
|
83
|
+
import { AssistantVoiceSession as ir } from "./voice/AssistantVoiceSession.js";
|
|
84
|
+
import { AssistantAvatarTab as ar } from "./avatar/AssistantAvatarTab.js";
|
|
85
|
+
import { voiceStartBlocker as or, voiceStartBlockerLasts as sr } from "./voice/voiceStartGate.js";
|
|
86
|
+
import { useAssistantApiAccess as cr } from "../useAssistantApiAccess.js";
|
|
87
|
+
import { useConversationTurns as lr } from "../useConversationTurns.js";
|
|
88
|
+
import { openTurnStream as ur, turnStreamAvailable as dr } from "../turnStream.js";
|
|
89
|
+
import { createSnapshotPoller as fr } from "../snapshotPoller.js";
|
|
90
|
+
import { sendAssistantTurnTimings as pr, startTurnTimingReporting as mr } from "../turnTimingReporter.js";
|
|
91
|
+
import { QuarantineSet as hr, WarmCancelled as gr, claimPreopenedSession as _r, consumeWarm as vr, preopenKey as yr, preopenWanted as br, prewarmTarget as xr, settleWarmBeforeSend as Sr, startPreopen as Cr, startWarm as wr, warmState as Tr } from "../prewarm.js";
|
|
92
|
+
import { navEntryIds as Er } from "../uiActions/resolveTarget.js";
|
|
93
|
+
import { lookupNamedRecords as Dr } from "../uiActions/recordNames.js";
|
|
94
|
+
import { isAlreadyThere as Or, matchLocalUiCommand as kr, mayBeNavigationFollowUp as Ar, navDestinations as jr, planThemeChange as Mr } from "../localUiCommands.js";
|
|
95
|
+
import { offerAssentFor as Nr } from "../localeCommands/assent.js";
|
|
96
|
+
import { readControlSnapshot as Pr } from "../appControls/snapshot.js";
|
|
97
|
+
import { runNavigation as Fr } from "../uiActions/navigationOutcome.js";
|
|
98
|
+
import { assistantBackStack as Ir, isBackRunnable as Lr } from "../uiActions/backStack.js";
|
|
99
|
+
import { buildNavigateAction as Rr, destinationForPath as zr, labelForPath as Br, newestAssistantOnSurface as Vr } from "../uiActions/navigateAction.js";
|
|
100
|
+
import { buildNavigationContext as Hr, latestReplyOnSurface as Ur, rememberPresentedList as Wr } from "../uiActions/linkContext.js";
|
|
101
|
+
import { buildUiCatalogue as Gr, markUiCatalogueSent as Kr, uiCatalogueSent as qr, uiCatalogueSessionKey as Jr } from "../uiActions/uiCatalogue.js";
|
|
102
|
+
import { offerYesOnSurface as Yr } from "../uiActions/offerYesOnSurface.js";
|
|
103
|
+
import { parseNavIntent as Xr } from "../uiActions/navIntent.js";
|
|
104
|
+
import { decideActOnResolve as Zr, n4LeaveGuard as Qr } from "../uiActions/actOnResolve.js";
|
|
105
|
+
import { planAppControl as $r } from "../appControls/plan.js";
|
|
106
|
+
import { dispatchAssistantQuotaExhausted as ei, notifyAiCreditsUpdated as ti } from "../aiCredits.js";
|
|
107
|
+
import { useAssistantAttachments as ni } from "../useAssistantAttachments.js";
|
|
108
|
+
import { AssistantComposer as ri } from "./composer/AssistantComposer.js";
|
|
109
|
+
import { isProdRuntime as ii } from "../env.js";
|
|
110
|
+
import { AssistantApiCallsConsentDialog as ai } from "./AssistantApiCallsConsentDialog.js";
|
|
111
|
+
import { useVisibleNavItems as oi } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
112
|
+
import { useCallback as O, useEffect as k, useLayoutEffect as si, useMemo as A, useRef as j, useState as M, useSyncExternalStore as ci } from "react";
|
|
113
|
+
import { jsx as N, jsxs as li } from "react/jsx-runtime";
|
|
109
114
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
110
|
-
var
|
|
115
|
+
var ui = 2500, di = 600, fi = 2e4, pi = 1e4, mi = 1e4, hi = {
|
|
116
|
+
committing: !1,
|
|
117
|
+
dictating: !1
|
|
118
|
+
}, gi = 6e3;
|
|
111
119
|
function P() {
|
|
112
120
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
113
121
|
}
|
|
114
|
-
var
|
|
115
|
-
let F = a(), { product: I, modes: L, gatherPageContext:
|
|
116
|
-
let n =
|
|
117
|
-
return
|
|
122
|
+
var _i = ({ visible: _i = !0, writeAccess: vi = "unknown" }) => {
|
|
123
|
+
let F = a(), { product: I, modes: L, gatherPageContext: yi, buildPrompt: bi, reportTurnTimings: xi, reportTokenUsage: Si, localUiCommands: Ci } = i(), R = Ce(i().writeApproval), wi = O((e, t) => {
|
|
124
|
+
let n = v.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
125
|
+
return dt({
|
|
118
126
|
mode: e,
|
|
119
127
|
productWriteApproval: R,
|
|
120
128
|
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
121
129
|
});
|
|
122
|
-
}, [R]), { getAccessToken: z, getWorkspaceToken:
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
}, [R]), { getAccessToken: z, getWorkspaceToken: Ti, userId: B } = n(), { locale: V, isLocaleLoading: Ei } = t(), Di = v((e) => e.voiceGraceMs), Oi = v((e) => e.handsFreeInterrupt), ki = v((e) => e.handsFreeStreamNoticeAccepted), Ai = v((e) => e.acceptHandsFreeStreamNotice), ji = v((e) => e.assistantLanguage), Mi = v((e) => e.replyLanguage), Ni = A(() => Xe(ji, Mi, V), [
|
|
131
|
+
ji,
|
|
132
|
+
Mi,
|
|
125
133
|
V
|
|
126
|
-
]),
|
|
134
|
+
]), Pi = Ni.reply.english, Fi = Ni.replyIsExplicit, Ii = Ni.reply.code, { conversations: Li, activeConversationId: H, mode: U, processingByConversationId: Ri, setMode: zi, setConversationMode: Bi, setActiveConversation: Vi, createConversation: Hi, addMessage: W, updateMessage: Ui, patchMessage: Wi, mergeMessageMetadata: Gi, setConversationProcessing: Ki, clearConversationProcessing: qi, setBackendSessionId: Ji, clearBackendSessionId: Yi, setSandbox: Xi, clearSandbox: Zi, acknowledgedWriteModes: Qi, acknowledgeWriteMode: $i, autoRouting: ea, setAutoRouting: ta, routeConversation: na } = v(), ra = Li.find((e) => e.id === H), ia = lr(ra), aa = ia.all, oa = H ? Ri[H] : void 0, sa = Ot(oa?.status), ca = sa ? oa?.messageId ?? null : null, la = oa?.status === "error" ? oa.messageId : null, ua = v((e) => e.sandboxWriteCapabilities), { panel: G, entries: da, retiredSandboxes: fa } = kn({
|
|
127
135
|
tr: F,
|
|
128
136
|
productWriteApproval: R
|
|
129
|
-
}),
|
|
137
|
+
}), pa = Cn({
|
|
130
138
|
approve: (e, t) => G.approve(e, t),
|
|
131
139
|
decline: (e, t, n) => G.decline(e, t, n),
|
|
132
140
|
presented: (e, t) => G.presented(e, t)
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
let e =
|
|
137
|
-
|
|
141
|
+
}), ma = pa.dismiss, ha = j(null);
|
|
142
|
+
k(() => {
|
|
143
|
+
ma();
|
|
144
|
+
let e = ha.current;
|
|
145
|
+
ha.current = H, e && e !== H && G.withdraw(e, "conversation_closed"), H && G.openConversation(H);
|
|
138
146
|
}, [
|
|
139
147
|
H,
|
|
140
148
|
G,
|
|
141
|
-
|
|
149
|
+
ma
|
|
142
150
|
]);
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
let e = window.setTimeout(() =>
|
|
151
|
+
let ga = Bn(ra), _a = $n(ra)?.archivedAt != null, va = Hn((e) => H !== null && H in e.loadingIds), ya = Hn((e) => H !== null && H in e.loadErrorIds), ba = Hn((e) => e.remoteDelete), [xa, Sa] = M(() => Hn.getState().remoteDelete?.at ?? null), Ca = ba?.wasActive === !0 && ba.at !== xa ? ba.at : null;
|
|
152
|
+
k(() => {
|
|
153
|
+
if (Ca === null) return;
|
|
154
|
+
let e = window.setTimeout(() => Sa(Ca), mi);
|
|
147
155
|
return () => window.clearTimeout(e);
|
|
148
|
-
}, [
|
|
149
|
-
let { canUseApiCalls:
|
|
150
|
-
loading:
|
|
151
|
-
canUseAdminModes:
|
|
152
|
-
})).current,
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
}, [Ca]);
|
|
157
|
+
let { canUseApiCalls: wa, loading: Ta } = cr(T(), B), Ea = j(vt({
|
|
158
|
+
loading: Ta,
|
|
159
|
+
canUseAdminModes: wa
|
|
160
|
+
})).current, Da = j(L);
|
|
161
|
+
k(() => {
|
|
162
|
+
Da.current = L;
|
|
155
163
|
}, [L]);
|
|
156
|
-
let
|
|
157
|
-
let e =
|
|
158
|
-
e &&
|
|
159
|
-
},
|
|
160
|
-
let e =
|
|
161
|
-
e &&
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
let Oa = () => {
|
|
165
|
+
let e = v.getState().activeConversationId;
|
|
166
|
+
e && Un.openConversation(e, { modes: Da.current });
|
|
167
|
+
}, ka = () => {
|
|
168
|
+
let e = v.getState().activeConversationId;
|
|
169
|
+
e && Un.loadEarlier(e);
|
|
170
|
+
}, Aa = j(z);
|
|
171
|
+
k(() => {
|
|
172
|
+
Aa.current = z;
|
|
165
173
|
}, [z]);
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
if (
|
|
169
|
-
workspaceId:
|
|
174
|
+
let ja = !!I && xi !== !1;
|
|
175
|
+
k(() => {
|
|
176
|
+
if (ja) return mr({ send: (e) => pr(e, {
|
|
177
|
+
workspaceId: T(),
|
|
170
178
|
authContext: {
|
|
171
|
-
accessToken:
|
|
172
|
-
organizationId:
|
|
179
|
+
accessToken: Aa.current(),
|
|
180
|
+
organizationId: Et()
|
|
173
181
|
}
|
|
174
182
|
}) });
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
loading:
|
|
178
|
-
canUseAdminModes:
|
|
183
|
+
}, [ja]), k(() => {
|
|
184
|
+
Ea.update({
|
|
185
|
+
loading: Ta,
|
|
186
|
+
canUseAdminModes: wa
|
|
179
187
|
});
|
|
180
188
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
]),
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
-
let
|
|
192
|
-
|
|
189
|
+
Ea,
|
|
190
|
+
Ta,
|
|
191
|
+
wa
|
|
192
|
+
]), k(() => () => {
|
|
193
|
+
Ea.abandon();
|
|
194
|
+
}, [Ea]);
|
|
195
|
+
let Ma = A(() => L.filter((e) => !e.requiresAdmin || wa), [L, wa]), Na = f(Ma), Pa = ea && Na, Fa = j(Na);
|
|
196
|
+
k(() => {
|
|
197
|
+
Fa.current = Na;
|
|
198
|
+
}, [Na]);
|
|
199
|
+
let Ia = j(null), La = j(!1), Ra = st(L), [za, Ba] = M(null), [Va, Ha] = M(null), Ua = Va !== null && Va === H, Wa = fn(), Ga = pn(), Ka = Wa.open && Ga !== null, qa = Wa.close, Ja = j(Ka);
|
|
200
|
+
si(() => {
|
|
201
|
+
Ja.current = Ka;
|
|
202
|
+
}, [Ka]);
|
|
203
|
+
let Ya = O((e) => {
|
|
204
|
+
e && Ja.current || Ha(e ? v.getState().activeConversationId : null);
|
|
193
205
|
}, []);
|
|
194
|
-
|
|
195
|
-
|
|
206
|
+
k(() => {
|
|
207
|
+
Ha((e) => e !== null && e !== H ? null : e);
|
|
196
208
|
}, [H]);
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
}, []),
|
|
200
|
-
let e =
|
|
209
|
+
let Xa = j(void 0), [Za, Qa] = M(!1), $a = O((e) => {
|
|
210
|
+
Xa.current = e, Qa(Ze(e));
|
|
211
|
+
}, []), eo = O(() => {
|
|
212
|
+
let e = v.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
|
|
201
213
|
return !t || !n ? null : {
|
|
202
214
|
id: t,
|
|
203
|
-
reusableDraft:
|
|
215
|
+
reusableDraft: Vn(n, p()),
|
|
204
216
|
liveProposals: G.liveFor(t).count,
|
|
205
|
-
turnInFlight:
|
|
217
|
+
turnInFlight: Ot(e.processingByConversationId[t]?.status)
|
|
206
218
|
};
|
|
207
|
-
}, [G]),
|
|
219
|
+
}, [G]), to = j({}), K = j(_n()), q = j(new hr()), no = j(/* @__PURE__ */ new Set()), ro = A(() => L.find((e) => e.id === U), [L, U]), io = v((e) => {
|
|
208
220
|
let t = e.sandboxesByMode[U]?.sandboxId;
|
|
209
221
|
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
210
|
-
}),
|
|
222
|
+
}), ao = ro !== void 0 && dt({
|
|
211
223
|
mode: U,
|
|
212
224
|
productWriteApproval: R,
|
|
213
|
-
capabilities:
|
|
214
|
-
}),
|
|
215
|
-
|
|
216
|
-
if (U !== "assistant" &&
|
|
217
|
-
|
|
225
|
+
capabilities: io
|
|
226
|
+
}), oo = U === "assistant" || ro !== void 0 && !ro.writeCapable && !_e(U) || ao;
|
|
227
|
+
k(() => {
|
|
228
|
+
if (U !== "assistant" && ro?.writeCapable && !oe(Qi, U)) {
|
|
229
|
+
zi("assistant");
|
|
218
230
|
return;
|
|
219
231
|
}
|
|
220
|
-
|
|
232
|
+
Ta || (!ro || ro.requiresAdmin && !wa) && U !== "assistant" && zi("assistant");
|
|
221
233
|
}, [
|
|
222
234
|
U,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
235
|
+
ro,
|
|
236
|
+
wa,
|
|
237
|
+
Ta,
|
|
238
|
+
zi,
|
|
239
|
+
Qi
|
|
228
240
|
]);
|
|
229
|
-
let
|
|
230
|
-
|
|
231
|
-
}, [
|
|
241
|
+
let so = O((e, t, n, r) => {
|
|
242
|
+
Ki(e, n, t, null, r);
|
|
243
|
+
}, [Ki]), co = O(async (e, t, n, r, i, a = null) => {
|
|
232
244
|
let o = (e, t) => {
|
|
233
|
-
r &&
|
|
245
|
+
r && so(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
234
246
|
}, c = (e) => {
|
|
235
|
-
r &&
|
|
247
|
+
r && D(r.assistantMessageId, e);
|
|
236
248
|
}, l = () => {
|
|
237
249
|
c("bootAdopted"), a?.beginBoot();
|
|
238
|
-
}, u = () => a !== null && (a.signal.aborted ||
|
|
239
|
-
if (u()) throw new
|
|
240
|
-
}, f =
|
|
241
|
-
if (i && !q.current.has(r) && K.current.isFresh(r)) return
|
|
242
|
-
|
|
250
|
+
}, u = () => a !== null && (a.signal.aborted || T() !== t), d = () => {
|
|
251
|
+
if (u()) throw new gr("cancelled");
|
|
252
|
+
}, f = v.getState().sandboxesByMode[e]?.sandboxId ?? null, ee = !1, p = !1, m = !1, te = !1, ne = !1, h = async (r) => {
|
|
253
|
+
if (i && !q.current.has(r) && K.current.isFresh(r)) return ee = !0, !0;
|
|
254
|
+
m = !0;
|
|
243
255
|
let o = !1;
|
|
244
256
|
try {
|
|
245
|
-
await
|
|
257
|
+
await Se(r, t, n, 3e5), await xe(r, t, e, n, 9e4, () => {
|
|
246
258
|
o = !0, l();
|
|
247
259
|
});
|
|
248
260
|
} catch {
|
|
249
|
-
if (u()) throw new
|
|
250
|
-
return K.current.invalidate(r), q.current.add(r), a?.dead.push(r),
|
|
261
|
+
if (u()) throw new gr("cancelled");
|
|
262
|
+
return K.current.invalidate(r), q.current.add(r), a?.dead.push(r), ne = !0, !1;
|
|
251
263
|
}
|
|
252
|
-
return d(), K.current.markVerified(r), o && (
|
|
264
|
+
return d(), K.current.markVerified(r), o && (te = !0), !0;
|
|
253
265
|
};
|
|
254
|
-
if (f && (
|
|
266
|
+
if (f && (Xi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await h(f) || (Xi(e, null, "provisioning"), f = null)), !f) {
|
|
255
267
|
o("provisioning", "lookingForEnvironment");
|
|
256
|
-
let r = await
|
|
268
|
+
let r = await pe(t, I, e, ii(), n, q.current, R);
|
|
257
269
|
d();
|
|
258
270
|
let i = r?.id ?? null;
|
|
259
271
|
if (i) {
|
|
260
|
-
|
|
272
|
+
Xi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
|
|
261
273
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
262
|
-
t && l(), await
|
|
274
|
+
t && l(), await h(i) ? (f = i, t && (te = !0)) : Xi(e, null, "provisioning");
|
|
263
275
|
}
|
|
264
276
|
}
|
|
265
277
|
if (!f) {
|
|
266
|
-
if (a && !a.mayCreate) throw new
|
|
278
|
+
if (a && !a.mayCreate) throw new gr("no-create");
|
|
267
279
|
if (c("provisionStarted"), e === "api-calls" && !z()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
268
|
-
o("provisioning", "startingEnvironment"),
|
|
269
|
-
let r = a ? [] : await
|
|
280
|
+
o("provisioning", "startingEnvironment"), Xi(e, null, "provisioning");
|
|
281
|
+
let r = a ? [] : await ye(t, I, e, ii(), n, q.current, R);
|
|
270
282
|
if (r.length > 0) {
|
|
271
283
|
let e = new Set(r);
|
|
272
284
|
for (let e of r) K.current.invalidate(e), q.current.add(e);
|
|
273
|
-
let t =
|
|
274
|
-
for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) &&
|
|
285
|
+
let t = v.getState().sandboxesByMode;
|
|
286
|
+
for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && Zi(n);
|
|
275
287
|
}
|
|
276
288
|
c("createRequested");
|
|
277
289
|
let i = a?.beginCreate();
|
|
278
290
|
try {
|
|
279
|
-
f = await
|
|
291
|
+
f = await ue(I, e, t, ii(), di, n, { writeApproval: R });
|
|
280
292
|
} finally {
|
|
281
293
|
i?.();
|
|
282
294
|
}
|
|
283
|
-
|
|
295
|
+
p = !0, d(), Xi(e, f, "provisioning"), await Se(f, t, n, 3e5), d(), c("sandboxRunning"), await xe(f, t, e, n, 9e4), d(), c("serviceReady"), K.current.markVerified(f);
|
|
284
296
|
}
|
|
285
|
-
return
|
|
297
|
+
return Xi(e, f, "running"), {
|
|
286
298
|
sandboxId: f,
|
|
287
|
-
sandboxIsNew:
|
|
288
|
-
sandboxProbed:
|
|
289
|
-
sandboxAdopted:
|
|
290
|
-
deadSandboxProbe:
|
|
291
|
-
trustedFromCache:
|
|
299
|
+
sandboxIsNew: p,
|
|
300
|
+
sandboxProbed: m,
|
|
301
|
+
sandboxAdopted: te,
|
|
302
|
+
deadSandboxProbe: ne,
|
|
303
|
+
trustedFromCache: ee
|
|
292
304
|
};
|
|
293
305
|
}, [
|
|
294
|
-
|
|
306
|
+
Zi,
|
|
295
307
|
z,
|
|
296
308
|
I,
|
|
297
309
|
R,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
]),
|
|
301
|
-
let s = await
|
|
310
|
+
Xi,
|
|
311
|
+
so
|
|
312
|
+
]), lo = O(async function e(t, n, r, i, a, o = {}) {
|
|
313
|
+
let s = await Sr(i, r, (e) => so(t, n, "provisioning", e), () => D(n, "prewarmJoined"));
|
|
302
314
|
for (let e of s.dead) K.current.invalidate(e), q.current.add(e);
|
|
303
|
-
s.verified && !q.current.has(s.verified) && K.current.markVerified(s.verified), s.joined &&
|
|
304
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache:
|
|
315
|
+
s.verified && !q.current.has(s.verified) && K.current.markVerified(s.verified), s.joined && E(n, { prewarm: s.joined });
|
|
316
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: ee } = await co(r, i, a, {
|
|
305
317
|
conversationId: t,
|
|
306
318
|
assistantMessageId: n
|
|
307
|
-
}, o.trustCache !== !1),
|
|
308
|
-
!s.waited &&
|
|
309
|
-
let
|
|
310
|
-
if (
|
|
311
|
-
let e =
|
|
319
|
+
}, o.trustCache !== !1), p = vr(i, r, c);
|
|
320
|
+
!s.waited && p && E(n, { prewarm: "hit" });
|
|
321
|
+
let m = v.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, te = !1, ne = null;
|
|
322
|
+
if (m) {
|
|
323
|
+
let e = en(c, m, (e, t) => he(e, i, t, r, a, { limit: 50 }));
|
|
312
324
|
try {
|
|
313
|
-
let t = await
|
|
325
|
+
let t = await b(c, i, m, r, a);
|
|
314
326
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
315
|
-
|
|
327
|
+
ne = e;
|
|
316
328
|
} catch {
|
|
317
|
-
|
|
329
|
+
Yi(t), m = null;
|
|
318
330
|
}
|
|
319
331
|
}
|
|
320
|
-
let
|
|
321
|
-
if (!
|
|
322
|
-
let e =
|
|
332
|
+
let h = !1;
|
|
333
|
+
if (!m) {
|
|
334
|
+
let e = _r(yr({
|
|
323
335
|
workspaceId: i,
|
|
324
336
|
mode: r,
|
|
325
337
|
sandboxId: c,
|
|
326
338
|
userId: B
|
|
327
339
|
}), Date.now());
|
|
328
340
|
if (e) {
|
|
329
|
-
"pending" in e &&
|
|
341
|
+
"pending" in e && so(t, n, "connecting", "preparingSession");
|
|
330
342
|
let o = "sessionId" in e ? e.sessionId : await e.pending;
|
|
331
343
|
if (o && !q.current.has(c)) try {
|
|
332
|
-
(await
|
|
344
|
+
(await b(c, i, o, r, a)).mode === r && (m = o, h = !0, Ji(t, m), te = !0);
|
|
333
345
|
} catch {}
|
|
334
346
|
}
|
|
335
347
|
}
|
|
336
|
-
if (!
|
|
337
|
-
|
|
348
|
+
if (!m) {
|
|
349
|
+
so(t, n, "connecting", "preparingSession");
|
|
338
350
|
let s;
|
|
339
351
|
try {
|
|
340
|
-
s = await
|
|
352
|
+
s = await de(c, i, r, a);
|
|
341
353
|
} catch (s) {
|
|
342
|
-
if (
|
|
354
|
+
if (ee) {
|
|
343
355
|
K.current.invalidate(c);
|
|
344
|
-
let l =
|
|
345
|
-
if (l === "check-network" && (l = await
|
|
346
|
-
|
|
356
|
+
let l = yn(s, o.isAbandoned?.() ?? !1), ee = l === "check-network";
|
|
357
|
+
if (l === "check-network" && (l = await vn(() => pe(i, I, r, ii(), a, q.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
358
|
+
ee || E(n, { cacheProofFailed: !0 }), l === "replace" && (q.current.add(c), Yi(t), Zi(r), G.retireSandbox(c));
|
|
347
359
|
let s = await e(t, n, r, i, a, {
|
|
348
360
|
...o,
|
|
349
361
|
trustCache: !1
|
|
350
362
|
});
|
|
351
|
-
return
|
|
363
|
+
return ee && (s.deadSandboxProbe || s.sandboxId !== c) && E(n, { cacheProofFailed: !0 }), {
|
|
352
364
|
...s,
|
|
353
365
|
sandboxProbed: s.sandboxProbed || u,
|
|
354
366
|
sandboxAdopted: s.sandboxAdopted || d,
|
|
@@ -358,81 +370,81 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
358
370
|
}
|
|
359
371
|
throw s;
|
|
360
372
|
}
|
|
361
|
-
|
|
373
|
+
m = s.sessionId, Ji(t, m), te = !0;
|
|
362
374
|
}
|
|
363
375
|
return {
|
|
364
376
|
sandboxId: c,
|
|
365
|
-
sessionId:
|
|
366
|
-
sessionIsNew:
|
|
367
|
-
readAhead:
|
|
377
|
+
sessionId: m,
|
|
378
|
+
sessionIsNew: te,
|
|
379
|
+
readAhead: ne,
|
|
368
380
|
sandboxIsNew: l,
|
|
369
381
|
sandboxProbed: u,
|
|
370
382
|
sandboxAdopted: d,
|
|
371
383
|
deadSandboxProbe: f,
|
|
372
|
-
sessionPreopened:
|
|
384
|
+
sessionPreopened: h
|
|
373
385
|
};
|
|
374
386
|
}, [
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
387
|
+
co,
|
|
388
|
+
Yi,
|
|
389
|
+
Zi,
|
|
378
390
|
I,
|
|
379
391
|
R,
|
|
380
|
-
|
|
381
|
-
|
|
392
|
+
Ji,
|
|
393
|
+
so,
|
|
382
394
|
B,
|
|
383
395
|
G
|
|
384
|
-
]),
|
|
385
|
-
let n =
|
|
396
|
+
]), uo = O((e, t = !1) => {
|
|
397
|
+
let n = T();
|
|
386
398
|
if (!n) return;
|
|
387
|
-
let r =
|
|
399
|
+
let r = v.getState(), i = Date.now(), a = xr({
|
|
388
400
|
autoRouting: r.autoRouting,
|
|
389
|
-
autoOffered:
|
|
401
|
+
autoOffered: Fa.current,
|
|
390
402
|
active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
|
|
391
403
|
selectedMode: r.mode,
|
|
392
404
|
autoReadMode: c,
|
|
393
|
-
modes:
|
|
405
|
+
modes: Da.current,
|
|
394
406
|
acknowledgedWriteModes: r.acknowledgedWriteModes,
|
|
395
|
-
adminAccess:
|
|
407
|
+
adminAccess: Ea.read(),
|
|
396
408
|
dictated: e,
|
|
397
|
-
voiceProposalBound: (e) =>
|
|
398
|
-
turnInFlight: Object.values(r.processingByConversationId).some((e) =>
|
|
399
|
-
...
|
|
409
|
+
voiceProposalBound: (e) => wi(e),
|
|
410
|
+
turnInFlight: Object.values(r.processingByConversationId).some((e) => Ot(e?.status)),
|
|
411
|
+
...Tr(n),
|
|
400
412
|
now: i
|
|
401
413
|
});
|
|
402
414
|
if (!a) return;
|
|
403
|
-
let o =
|
|
415
|
+
let o = wr(n, a, i), s = {
|
|
404
416
|
accessToken: z(),
|
|
405
|
-
workspaceToken:
|
|
417
|
+
workspaceToken: Ti(),
|
|
406
418
|
userId: B,
|
|
407
|
-
organizationId:
|
|
419
|
+
organizationId: Et()
|
|
408
420
|
};
|
|
409
|
-
|
|
421
|
+
co(a.mode, n, s, null, !0, o).then((e) => {
|
|
410
422
|
if (o.finish({
|
|
411
423
|
ok: !0,
|
|
412
424
|
sandboxId: e.sandboxId,
|
|
413
425
|
didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
|
|
414
426
|
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
415
427
|
dead: o.dead
|
|
416
|
-
}), o.signal.aborted ||
|
|
417
|
-
let r =
|
|
418
|
-
|
|
428
|
+
}), o.signal.aborted || T() !== n || q.current.has(e.sandboxId)) return;
|
|
429
|
+
let r = v.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = p();
|
|
430
|
+
br({
|
|
419
431
|
active: i ? {
|
|
420
432
|
mode: i.mode,
|
|
421
433
|
backendSessionId: i.backendSessionId,
|
|
422
|
-
continuable: !
|
|
423
|
-
hasHistory:
|
|
434
|
+
continuable: !Bn(i) && !zn(i, c),
|
|
435
|
+
hasHistory: Rn(i)
|
|
424
436
|
} : void 0,
|
|
425
437
|
mode: a.mode
|
|
426
|
-
}) &&
|
|
438
|
+
}) && Cr(yr({
|
|
427
439
|
workspaceId: n,
|
|
428
440
|
mode: a.mode,
|
|
429
441
|
sandboxId: e.sandboxId,
|
|
430
442
|
userId: B
|
|
431
|
-
}), () =>
|
|
443
|
+
}), () => de(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
|
|
432
444
|
}, (e) => {
|
|
433
|
-
if (!(e instanceof
|
|
434
|
-
let e =
|
|
435
|
-
e && (K.current.invalidate(e), q.current.add(e), o.dead.push(e),
|
|
445
|
+
if (!(e instanceof gr) && !o.signal.aborted && T() === n) {
|
|
446
|
+
let e = v.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
|
|
447
|
+
e && (K.current.invalidate(e), q.current.add(e), o.dead.push(e), Zi(a.mode));
|
|
436
448
|
}
|
|
437
449
|
o.finish({
|
|
438
450
|
ok: !1,
|
|
@@ -442,66 +454,66 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
442
454
|
});
|
|
443
455
|
});
|
|
444
456
|
}, [
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
457
|
+
co,
|
|
458
|
+
Ea,
|
|
459
|
+
Zi,
|
|
448
460
|
z,
|
|
449
|
-
|
|
461
|
+
Ti,
|
|
450
462
|
B,
|
|
451
|
-
|
|
452
|
-
]),
|
|
453
|
-
let e =
|
|
463
|
+
wi
|
|
464
|
+
]), fo = O(() => uo(!1), [uo]), po = ci(ae, h, h)?.reference ?? null, [mo, ho] = M(0), go = j(/* @__PURE__ */ new Set()), _o = j(null), vo = O(() => {
|
|
465
|
+
let e = v.getState(), t = e.activeConversationId;
|
|
454
466
|
if (!t) return null;
|
|
455
|
-
let n = e.processingByConversationId[t], r =
|
|
456
|
-
if (!
|
|
467
|
+
let n = e.processingByConversationId[t], r = Ot(n?.status) ? n?.messageId ?? null : null;
|
|
468
|
+
if (!At({
|
|
457
469
|
interruptedTurnId: r,
|
|
458
470
|
activeTurnId: r,
|
|
459
|
-
alreadyRequested: r ?
|
|
471
|
+
alreadyRequested: r ? go.current.has(r) : !1
|
|
460
472
|
}).send || !r) return null;
|
|
461
|
-
|
|
462
|
-
let i =
|
|
463
|
-
return !i || !a || !o ||
|
|
473
|
+
go.current.add(r);
|
|
474
|
+
let i = ce(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
475
|
+
return !i || !a || !o || le(i.sandboxId, a, o, i.mode, {
|
|
464
476
|
accessToken: z(),
|
|
465
|
-
workspaceToken:
|
|
477
|
+
workspaceToken: Ti(),
|
|
466
478
|
userId: B,
|
|
467
|
-
organizationId:
|
|
479
|
+
organizationId: Et()
|
|
468
480
|
}), r;
|
|
469
481
|
}, [
|
|
470
482
|
B,
|
|
471
483
|
z,
|
|
472
|
-
|
|
473
|
-
]),
|
|
474
|
-
let e =
|
|
475
|
-
return e && (
|
|
476
|
-
}, [
|
|
477
|
-
let e =
|
|
478
|
-
|
|
479
|
-
}, [
|
|
480
|
-
let t =
|
|
481
|
-
if (!n || !r || !i ||
|
|
482
|
-
let a = t.conversations.find((e) => e.id === i), o = a ?
|
|
484
|
+
Ti
|
|
485
|
+
]), yo = O(() => {
|
|
486
|
+
let e = vo();
|
|
487
|
+
return e && (Ue(e), Be.abort(e)), e;
|
|
488
|
+
}, [vo]), bo = O(() => {
|
|
489
|
+
let e = v.getState().activeConversationId;
|
|
490
|
+
yo(), e && G.declineForReply(e, "corrected", "spoken");
|
|
491
|
+
}, [yo, G]), xo = O(async (e) => {
|
|
492
|
+
let t = v.getState(), n = ce(t), r = T(), i = t.activeConversationId;
|
|
493
|
+
if (!n || !r || !i || En(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
494
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? g(Re(a.messages), {
|
|
483
495
|
sessionId: a.backendSessionId,
|
|
484
496
|
sandboxId: n.sandboxId,
|
|
485
497
|
nowMs: Date.now()
|
|
486
498
|
}) : null;
|
|
487
499
|
if (o?.reference !== e) {
|
|
488
|
-
|
|
500
|
+
ho((e) => e + 1);
|
|
489
501
|
return;
|
|
490
502
|
}
|
|
491
503
|
let s = {
|
|
492
504
|
conversationId: i,
|
|
493
505
|
reference: e
|
|
494
506
|
};
|
|
495
|
-
if (!
|
|
507
|
+
if (!te(s)) return;
|
|
496
508
|
try {
|
|
497
|
-
await
|
|
509
|
+
await y(n.sandboxId, r, e, n.mode, {
|
|
498
510
|
accessToken: z(),
|
|
499
|
-
workspaceToken:
|
|
511
|
+
workspaceToken: Ti(),
|
|
500
512
|
userId: B,
|
|
501
|
-
organizationId:
|
|
513
|
+
organizationId: Et()
|
|
502
514
|
});
|
|
503
515
|
} catch (e) {
|
|
504
|
-
|
|
516
|
+
ne(s), W(i, {
|
|
505
517
|
id: P(),
|
|
506
518
|
role: "system",
|
|
507
519
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
@@ -509,62 +521,62 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
509
521
|
});
|
|
510
522
|
return;
|
|
511
523
|
}
|
|
512
|
-
|
|
513
|
-
let c =
|
|
514
|
-
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId ||
|
|
524
|
+
ne(s), Gi(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
525
|
+
let c = v.getState(), l = c.conversations.find((e) => e.id === i);
|
|
526
|
+
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || ce(c)?.sandboxId !== n.sandboxId || Ot(c.processingByConversationId[i]?.status) || ie(Re(l.messages)) !== o.messageId || gs.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
515
527
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
516
528
|
targetConversationId: i
|
|
517
529
|
});
|
|
518
530
|
}, [
|
|
519
531
|
B,
|
|
520
532
|
W,
|
|
521
|
-
|
|
533
|
+
Gi,
|
|
522
534
|
F
|
|
523
|
-
]),
|
|
524
|
-
theme:
|
|
525
|
-
navigate:
|
|
526
|
-
navItems:
|
|
527
|
-
options:
|
|
528
|
-
navPermissionsSettled:
|
|
529
|
-
navSimulating:
|
|
535
|
+
]), So = e(), { speakFinishedReply: Co } = dn(), wo = o(), { items: To, permissionsSettled: Eo, simulating: Do } = oi(), J = j({
|
|
536
|
+
theme: So,
|
|
537
|
+
navigate: wo,
|
|
538
|
+
navItems: To,
|
|
539
|
+
options: Ci ?? {},
|
|
540
|
+
navPermissionsSettled: Eo,
|
|
541
|
+
navSimulating: Do
|
|
530
542
|
});
|
|
531
|
-
|
|
543
|
+
k(() => {
|
|
532
544
|
J.current = {
|
|
533
|
-
theme:
|
|
534
|
-
navigate:
|
|
535
|
-
navItems:
|
|
536
|
-
options:
|
|
537
|
-
navPermissionsSettled:
|
|
538
|
-
navSimulating:
|
|
545
|
+
theme: So,
|
|
546
|
+
navigate: wo,
|
|
547
|
+
navItems: To,
|
|
548
|
+
options: Ci ?? {},
|
|
549
|
+
navPermissionsSettled: Eo,
|
|
550
|
+
navSimulating: Do
|
|
539
551
|
};
|
|
540
552
|
}, [
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
553
|
+
So,
|
|
554
|
+
wo,
|
|
555
|
+
To,
|
|
556
|
+
Ci,
|
|
557
|
+
Eo,
|
|
558
|
+
Do
|
|
547
559
|
]);
|
|
548
|
-
let Y =
|
|
549
|
-
|
|
560
|
+
let Y = j(!0);
|
|
561
|
+
k(() => (Y.current = !0, () => {
|
|
550
562
|
Y.current = !1;
|
|
551
563
|
}), []);
|
|
552
|
-
let
|
|
564
|
+
let Oo = j({
|
|
553
565
|
tr: F,
|
|
554
566
|
locale: V
|
|
555
|
-
}),
|
|
556
|
-
|
|
557
|
-
let t =
|
|
558
|
-
t && (
|
|
559
|
-
if (
|
|
560
|
-
let e =
|
|
567
|
+
}), ko = j(null), [Ao, jo] = M(null), Mo = j(null), No = O((e) => {
|
|
568
|
+
Mo.current !== null && (window.clearTimeout(Mo.current), Mo.current = null);
|
|
569
|
+
let t = ko.current;
|
|
570
|
+
t && (ko.current = null, window.clearTimeout(t.deadline), Y.current && jo(null), !(!e || !Y.current) && (Mo.current = window.setTimeout(() => {
|
|
571
|
+
if (Mo.current = null, !Y.current) return;
|
|
572
|
+
let e = v.getState();
|
|
561
573
|
if (e.activeConversationId !== t.conversationId) return;
|
|
562
574
|
let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
|
|
563
575
|
if (!n) return;
|
|
564
|
-
let r =
|
|
576
|
+
let r = Oo.current, i = Yt(n, null, r.tr);
|
|
565
577
|
if (i.kind !== "output") return;
|
|
566
|
-
let a =
|
|
567
|
-
|
|
578
|
+
let a = qt(n, r.tr);
|
|
579
|
+
Be.publish(n.id, {
|
|
568
580
|
conversationId: t.conversationId,
|
|
569
581
|
channel: n.metadata?.voice === !0 ? "voice" : "chat",
|
|
570
582
|
voiceSessionId: n.metadata?.voiceSessionId,
|
|
@@ -573,47 +585,47 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
573
585
|
final: !0
|
|
574
586
|
});
|
|
575
587
|
}, 0)));
|
|
576
|
-
}, []),
|
|
577
|
-
|
|
578
|
-
|
|
588
|
+
}, []), Po = O(() => No(!0), [No]);
|
|
589
|
+
k(() => {
|
|
590
|
+
Oo.current = {
|
|
579
591
|
tr: F,
|
|
580
592
|
locale: V
|
|
581
593
|
};
|
|
582
|
-
let e =
|
|
594
|
+
let e = ko.current;
|
|
583
595
|
if (!e) return;
|
|
584
|
-
let t =
|
|
596
|
+
let t = Jt({
|
|
585
597
|
wanted: e.wanted,
|
|
586
598
|
locale: V,
|
|
587
|
-
isLoading:
|
|
588
|
-
translatedNow:
|
|
599
|
+
isLoading: Ei(e.wanted),
|
|
600
|
+
translatedNow: Gt(F, e.reply).translated
|
|
589
601
|
});
|
|
590
602
|
if (t === "write") {
|
|
591
|
-
|
|
603
|
+
Po();
|
|
592
604
|
return;
|
|
593
605
|
}
|
|
594
606
|
if (t === "grace") {
|
|
595
|
-
let e = window.setTimeout(
|
|
607
|
+
let e = window.setTimeout(Po, 400);
|
|
596
608
|
return () => window.clearTimeout(e);
|
|
597
609
|
}
|
|
598
610
|
}, [
|
|
599
611
|
F,
|
|
600
612
|
V,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
]),
|
|
605
|
-
let
|
|
613
|
+
Ei,
|
|
614
|
+
Ao,
|
|
615
|
+
Po
|
|
616
|
+
]), k(() => () => No(!1), [No]);
|
|
617
|
+
let Fo = j(null), [Io, Lo] = M(!1), [X] = M(() => new Te()), [Ro, zo] = M(0), Bo = O(() => zo((e) => e + 1), []), Vo = O(() => {
|
|
606
618
|
let e = J.current;
|
|
607
619
|
return {
|
|
608
|
-
destinations:
|
|
620
|
+
destinations: jr(e.navItems),
|
|
609
621
|
permissionsSettled: e.navPermissionsSettled,
|
|
610
622
|
simulating: e.navSimulating
|
|
611
623
|
};
|
|
612
|
-
}, []),
|
|
613
|
-
|
|
614
|
-
|
|
624
|
+
}, []), Ho = j(B);
|
|
625
|
+
k(() => {
|
|
626
|
+
Ho.current = B;
|
|
615
627
|
}, [B]);
|
|
616
|
-
let
|
|
628
|
+
let Uo = O((e, t) => {
|
|
617
629
|
let n = X.replyIdOf(e), r = n ? X.turnFor(n) : void 0, i = X.offer(e), a = {
|
|
618
630
|
ok: !1,
|
|
619
631
|
reason: "gone",
|
|
@@ -622,25 +634,25 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
622
634
|
voiceSessionId: void 0
|
|
623
635
|
};
|
|
624
636
|
if (!n || !r || !i || i.used) return a;
|
|
625
|
-
let o = r.conversationId, s =
|
|
637
|
+
let o = r.conversationId, s = v.getState().conversations.find((e) => e.id === o);
|
|
626
638
|
if (!s) return a;
|
|
627
639
|
let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = X.liveOffersFor(n, {
|
|
628
|
-
registry:
|
|
629
|
-
actorId:
|
|
640
|
+
registry: Vo(),
|
|
641
|
+
actorId: Ho.current,
|
|
630
642
|
conversationId: o,
|
|
631
643
|
perfNow: performance.now()
|
|
632
644
|
}).find((t) => t.offer.offerId === e);
|
|
633
645
|
if (!u) {
|
|
634
|
-
let e =
|
|
646
|
+
let e = De(i, performance.now());
|
|
635
647
|
return {
|
|
636
648
|
ok: !1,
|
|
637
649
|
reason: e ? "unavailable" : "expired",
|
|
638
|
-
copy: e ?
|
|
650
|
+
copy: e ? Bt(F, t || null) : Rt(F),
|
|
639
651
|
conversationId: o,
|
|
640
652
|
voiceSessionId: l
|
|
641
653
|
};
|
|
642
654
|
}
|
|
643
|
-
return X.markUsed(e) ? (
|
|
655
|
+
return X.markUsed(e) ? (Bo(), {
|
|
644
656
|
ok: !0,
|
|
645
657
|
target: u.target,
|
|
646
658
|
conversationId: o,
|
|
@@ -648,10 +660,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
648
660
|
}) : a;
|
|
649
661
|
}, [
|
|
650
662
|
X,
|
|
651
|
-
|
|
663
|
+
Vo,
|
|
652
664
|
F,
|
|
653
|
-
|
|
654
|
-
]),
|
|
665
|
+
Bo
|
|
666
|
+
]), Wo = O((e, t, n, r, i) => {
|
|
655
667
|
let a = P();
|
|
656
668
|
W(e, {
|
|
657
669
|
id: a,
|
|
@@ -661,20 +673,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
661
673
|
metadata: {
|
|
662
674
|
lang: n.translated ? V : "en",
|
|
663
675
|
...i ? { localAction: i } : {},
|
|
664
|
-
...
|
|
676
|
+
...S(t)
|
|
665
677
|
}
|
|
666
|
-
}), i &&
|
|
667
|
-
}, [W, V]),
|
|
668
|
-
|
|
669
|
-
|
|
678
|
+
}), i && Un.recordCommittedEntries(e, [a], "NOTE", r);
|
|
679
|
+
}, [W, V]), Go = O((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && X.release(e), [X]), Ko = j(null);
|
|
680
|
+
k(() => () => {
|
|
681
|
+
Ko.current?.(), Ko.current = null;
|
|
670
682
|
}, []);
|
|
671
|
-
let
|
|
672
|
-
|
|
673
|
-
}, []),
|
|
674
|
-
if (
|
|
675
|
-
let i =
|
|
683
|
+
let qo = O((e) => {
|
|
684
|
+
Ko.current?.(), Ko.current = Y.current ? Xn(document, e) : null;
|
|
685
|
+
}, []), Jo = O((e, t, n, r = !1) => {
|
|
686
|
+
if (Fo.current !== null) return;
|
|
687
|
+
let i = Uo(e, n), a = T(), o = (e, t, n, r) => Wo(e, t, n, a, r);
|
|
676
688
|
if (!i.ok) {
|
|
677
|
-
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy),
|
|
689
|
+
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), Bo();
|
|
678
690
|
return;
|
|
679
691
|
}
|
|
680
692
|
let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
|
|
@@ -682,7 +694,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
682
694
|
offerId: e
|
|
683
695
|
};
|
|
684
696
|
if (r) {
|
|
685
|
-
o(c, l,
|
|
697
|
+
o(c, l, It(F, s.label, !0), Rr({
|
|
686
698
|
destinationId: s.id,
|
|
687
699
|
path: s.path,
|
|
688
700
|
alreadyHere: !0,
|
|
@@ -692,16 +704,16 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
692
704
|
return;
|
|
693
705
|
}
|
|
694
706
|
let d = P();
|
|
695
|
-
|
|
707
|
+
Fo.current = d, Lo(!0);
|
|
696
708
|
let f = (t) => {
|
|
697
709
|
try {
|
|
698
|
-
if (
|
|
710
|
+
if (Go(e, t) && (Bo(), t.status === "kept" && qo(e)), t.status === "kept" || !v.getState().conversations.some((e) => e.id === c)) return;
|
|
699
711
|
let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
|
|
700
|
-
o(c, l,
|
|
712
|
+
o(c, l, Lt(F, t, {
|
|
701
713
|
page: s.label,
|
|
702
|
-
landed: n === null ? null : jr(
|
|
714
|
+
landed: n === null ? null : Br(jr(J.current.navItems), n),
|
|
703
715
|
path: s.path
|
|
704
|
-
}),
|
|
716
|
+
}), Rr({
|
|
705
717
|
destinationId: s.id,
|
|
706
718
|
path: s.path,
|
|
707
719
|
alreadyHere: !1,
|
|
@@ -710,10 +722,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
710
722
|
offer: u
|
|
711
723
|
}));
|
|
712
724
|
} finally {
|
|
713
|
-
|
|
725
|
+
Fo.current === d && (Fo.current = null, Y.current && Lo(!1));
|
|
714
726
|
}
|
|
715
727
|
};
|
|
716
|
-
|
|
728
|
+
Fr(J.current.navigate, s.path, {
|
|
717
729
|
readPath: () => window.location.pathname + window.location.search,
|
|
718
730
|
now: () => Date.now(),
|
|
719
731
|
schedule: (e, t) => {
|
|
@@ -724,20 +736,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
724
736
|
surface: "offer"
|
|
725
737
|
}).then(f, () => f({ status: "unconfirmed" }));
|
|
726
738
|
}, [
|
|
727
|
-
|
|
728
|
-
|
|
739
|
+
Uo,
|
|
740
|
+
Wo,
|
|
729
741
|
F,
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
]),
|
|
742
|
+
Bo,
|
|
743
|
+
Go,
|
|
744
|
+
qo
|
|
745
|
+
]), Yo = O((e, t) => Jo(e, "tap", t || null), [Jo]), Xo = O((e) => {
|
|
734
746
|
let { replyId: t, conversationId: n } = e, r = X.turnFor(t);
|
|
735
747
|
if (!r) return;
|
|
736
|
-
let i = window.location.pathname + window.location.search, a =
|
|
748
|
+
let i = window.location.pathname + window.location.search, a = jr(J.current.navItems), o = Zr({
|
|
737
749
|
intent: e.intent,
|
|
738
750
|
live: X.liveOffersFor(t, {
|
|
739
|
-
registry:
|
|
740
|
-
actorId:
|
|
751
|
+
registry: Vo(),
|
|
752
|
+
actorId: Ho.current,
|
|
741
753
|
conversationId: n,
|
|
742
754
|
perfNow: performance.now()
|
|
743
755
|
}),
|
|
@@ -747,52 +759,52 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
747
759
|
atSend: e.atSend,
|
|
748
760
|
now: {
|
|
749
761
|
location: i,
|
|
750
|
-
conversationId:
|
|
751
|
-
workspaceId:
|
|
752
|
-
actorId:
|
|
762
|
+
conversationId: v.getState().activeConversationId,
|
|
763
|
+
workspaceId: T(),
|
|
764
|
+
actorId: Ho.current ?? null
|
|
753
765
|
},
|
|
754
766
|
mounted: Y.current,
|
|
755
767
|
visible: document.visibilityState === "visible",
|
|
756
|
-
unsavedChanges:
|
|
768
|
+
unsavedChanges: Qr(J.current.options),
|
|
757
769
|
alreadyThere: ({ target: e }) => {
|
|
758
770
|
let t = a.find((t) => t.id === e.id);
|
|
759
|
-
return t ?
|
|
771
|
+
return t ? Or(t, i, a) : !1;
|
|
760
772
|
}
|
|
761
773
|
});
|
|
762
774
|
if (o.act === "navigate" || o.act === "already-here") {
|
|
763
|
-
|
|
775
|
+
Jo(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
|
|
764
776
|
return;
|
|
765
777
|
}
|
|
766
778
|
let [s] = o.unsaved ?? [], [c] = X.liveOffersFor(t, {
|
|
767
|
-
registry:
|
|
768
|
-
actorId:
|
|
779
|
+
registry: Vo(),
|
|
780
|
+
actorId: Ho.current,
|
|
769
781
|
conversationId: n,
|
|
770
782
|
perfNow: performance.now()
|
|
771
783
|
});
|
|
772
|
-
o.hold === "R5-unsaved" && s && c &&
|
|
784
|
+
o.hold === "R5-unsaved" && s && c && Wo(n, e.voiceSessionId, zt(F, s.label, c.target.label), T());
|
|
773
785
|
}, [
|
|
774
786
|
X,
|
|
775
|
-
|
|
787
|
+
Vo,
|
|
776
788
|
G,
|
|
777
|
-
|
|
778
|
-
|
|
789
|
+
Jo,
|
|
790
|
+
Wo,
|
|
779
791
|
F
|
|
780
|
-
]),
|
|
781
|
-
let t =
|
|
782
|
-
return n ?
|
|
783
|
-
}, []),
|
|
784
|
-
let { navItems: r, options: i } = J.current, a =
|
|
792
|
+
]), Zo = O((e) => {
|
|
793
|
+
let t = v.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
|
|
794
|
+
return n ? Lr(Ir, window.location.pathname, Vr(n.messages, e)) : !1;
|
|
795
|
+
}, []), Qo = O((e, t, n = !1) => {
|
|
796
|
+
let { navItems: r, options: i } = J.current, a = jr(r), o = null, s = {
|
|
785
797
|
...i,
|
|
786
|
-
locale: t === void 0 ? V :
|
|
798
|
+
locale: t === void 0 ? V : Ni.input.code,
|
|
787
799
|
uiLocale: V,
|
|
788
|
-
inputLocale:
|
|
800
|
+
inputLocale: Ni.input.code
|
|
789
801
|
};
|
|
790
|
-
if (
|
|
791
|
-
let e =
|
|
802
|
+
if (Ar(e, s)) {
|
|
803
|
+
let e = v.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? Ur(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => X.offersFor(e.id).some((e) => e.offerId === t) } }) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && Ot(c.status);
|
|
792
804
|
if (n && s && !l) {
|
|
793
805
|
let e = X.liveOffersFor(s.id, {
|
|
794
|
-
registry:
|
|
795
|
-
actorId:
|
|
806
|
+
registry: Vo(),
|
|
807
|
+
actorId: Ho.current,
|
|
796
808
|
conversationId: n.id,
|
|
797
809
|
perfNow: performance.now()
|
|
798
810
|
}).flatMap(({ offer: e, target: t }) => {
|
|
@@ -802,34 +814,34 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
802
814
|
target: n
|
|
803
815
|
}] : [];
|
|
804
816
|
});
|
|
805
|
-
o =
|
|
817
|
+
o = Hr({
|
|
806
818
|
reply: s,
|
|
807
|
-
text:
|
|
819
|
+
text: on(s, c, F),
|
|
808
820
|
resolve: {
|
|
809
821
|
destinations: a,
|
|
810
822
|
entityRoutes: i.entityRoutes,
|
|
811
|
-
visibleNavIds:
|
|
812
|
-
nounLabel: (e) =>
|
|
823
|
+
visibleNavIds: Er(r),
|
|
824
|
+
nounLabel: (e) => Pt(F, e)
|
|
813
825
|
},
|
|
814
826
|
offers: e
|
|
815
827
|
});
|
|
816
828
|
}
|
|
817
829
|
}
|
|
818
|
-
return
|
|
819
|
-
backRunnable:
|
|
830
|
+
return kr(e, a, s, {
|
|
831
|
+
backRunnable: Zo(t),
|
|
820
832
|
navigation: o,
|
|
821
833
|
skipRecords: n,
|
|
822
|
-
controls:
|
|
834
|
+
controls: Pr()
|
|
823
835
|
});
|
|
824
836
|
}, [
|
|
825
|
-
|
|
826
|
-
|
|
837
|
+
Zo,
|
|
838
|
+
Ni,
|
|
827
839
|
V,
|
|
828
840
|
F,
|
|
829
841
|
X,
|
|
830
|
-
|
|
831
|
-
]),
|
|
832
|
-
let n =
|
|
842
|
+
Vo
|
|
843
|
+
]), $o = O((e, t) => {
|
|
844
|
+
let n = Qo(e, t);
|
|
833
845
|
if (!n) return !1;
|
|
834
846
|
let { theme: r, navigate: i } = J.current;
|
|
835
847
|
switch (n.kind) {
|
|
@@ -841,53 +853,53 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
841
853
|
case "link-not-openable":
|
|
842
854
|
case "back": return i !== null;
|
|
843
855
|
case "conversation-delete": return !1;
|
|
844
|
-
case "app-control": return
|
|
856
|
+
case "app-control": return $r(n.request, { voiceLive: t !== void 0 || tc.current }) !== null;
|
|
845
857
|
case "open-record": return !1;
|
|
846
858
|
}
|
|
847
|
-
}, [
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}, [
|
|
851
|
-
let
|
|
859
|
+
}, [Qo]), es = j($o);
|
|
860
|
+
k(() => {
|
|
861
|
+
es.current = $o;
|
|
862
|
+
}, [$o]);
|
|
863
|
+
let ts = O((e, t) => {
|
|
852
864
|
let n = {
|
|
853
865
|
state: "none",
|
|
854
866
|
accept: null
|
|
855
867
|
}, { navigate: r, options: i, navItems: a } = J.current;
|
|
856
868
|
if (!e || r === null || i.uiOffers !== !0) return n;
|
|
857
|
-
let o =
|
|
869
|
+
let o = v.getState(), s = o.conversations.find((t) => t.id === e);
|
|
858
870
|
if (!s) return n;
|
|
859
871
|
let c = o.processingByConversationId[s.id] ?? null, l = {
|
|
860
|
-
registry:
|
|
861
|
-
actorId:
|
|
872
|
+
registry: Vo(),
|
|
873
|
+
actorId: Ho.current,
|
|
862
874
|
conversationId: s.id,
|
|
863
875
|
perfNow: performance.now()
|
|
864
|
-
}, { state: u, reply: d } =
|
|
876
|
+
}, { state: u, reply: d } = Yr(X, {
|
|
865
877
|
...l,
|
|
866
878
|
messages: s.messages,
|
|
867
879
|
voiceSessionId: t,
|
|
868
880
|
processing: c,
|
|
869
|
-
displayedText: (e) =>
|
|
881
|
+
displayedText: (e) => on(e, c, F),
|
|
870
882
|
productWriteApproval: R,
|
|
871
|
-
capabilitiesOf: (e) =>
|
|
883
|
+
capabilitiesOf: (e) => v.getState().sandboxWriteCapabilities[e]
|
|
872
884
|
});
|
|
873
885
|
if (u !== "acceptable" || !d) return {
|
|
874
886
|
state: u,
|
|
875
887
|
accept: null
|
|
876
888
|
};
|
|
877
|
-
let [f] = X.liveOffersFor(d.id, l),
|
|
878
|
-
return !f || !
|
|
889
|
+
let [f] = X.liveOffersFor(d.id, l), ee = f ? jr(a).find((e) => e.id === f.target.id) : void 0;
|
|
890
|
+
return !f || !ee ? n : {
|
|
879
891
|
state: u,
|
|
880
892
|
accept: {
|
|
881
893
|
offerId: f.offer.offerId,
|
|
882
|
-
destination:
|
|
894
|
+
destination: ee
|
|
883
895
|
}
|
|
884
896
|
};
|
|
885
897
|
}, [
|
|
886
898
|
X,
|
|
887
|
-
|
|
899
|
+
Vo,
|
|
888
900
|
R,
|
|
889
901
|
F
|
|
890
|
-
]),
|
|
902
|
+
]), ns = O((e, t, n, r, i) => {
|
|
891
903
|
let a = F(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
|
|
892
904
|
kind: "write-reply",
|
|
893
905
|
line: n.key
|
|
@@ -899,7 +911,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
899
911
|
timestamp: c,
|
|
900
912
|
metadata: {
|
|
901
913
|
localAction: s,
|
|
902
|
-
...
|
|
914
|
+
...S(i)
|
|
903
915
|
}
|
|
904
916
|
});
|
|
905
917
|
let u = P();
|
|
@@ -911,50 +923,50 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
911
923
|
metadata: {
|
|
912
924
|
lang: a === o ? "en" : V,
|
|
913
925
|
localAction: s,
|
|
914
|
-
...
|
|
926
|
+
...S(i)
|
|
915
927
|
}
|
|
916
|
-
}),
|
|
928
|
+
}), Un.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", T()), Co(e, u);
|
|
917
929
|
}, [
|
|
918
930
|
W,
|
|
919
931
|
V,
|
|
920
|
-
|
|
932
|
+
Co,
|
|
921
933
|
F
|
|
922
|
-
]),
|
|
923
|
-
|
|
924
|
-
if (
|
|
925
|
-
let e = window.setTimeout(() =>
|
|
934
|
+
]), rs = qn(), is = Jn(), as = rs?.request ?? null, os = j(() => void 0), [ss, cs] = M(null);
|
|
935
|
+
k(() => {
|
|
936
|
+
if (ss === null) return;
|
|
937
|
+
let e = window.setTimeout(() => cs(null), gi);
|
|
926
938
|
return () => window.clearTimeout(e);
|
|
927
|
-
}, [
|
|
928
|
-
let
|
|
929
|
-
let e =
|
|
930
|
-
return
|
|
931
|
-
}, [
|
|
932
|
-
if (!
|
|
933
|
-
let t = e !== void 0, n =
|
|
939
|
+
}, [ss]);
|
|
940
|
+
let ls = O(() => {
|
|
941
|
+
let e = v.getState();
|
|
942
|
+
return Hi(void 0, e.autoRouting && Fa.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
|
|
943
|
+
}, [Hi]), us = O((e) => {
|
|
944
|
+
if (!as) return !1;
|
|
945
|
+
let t = e !== void 0, n = v.getState(), r = Zn({
|
|
934
946
|
spoken: t,
|
|
935
|
-
bound:
|
|
947
|
+
bound: Xa.current,
|
|
936
948
|
activeConversationId: n.activeConversationId,
|
|
937
949
|
conversations: n.conversations,
|
|
938
|
-
historyOn:
|
|
950
|
+
historyOn: Kn()
|
|
939
951
|
});
|
|
940
|
-
if (r &&
|
|
952
|
+
if (r && as(r), t) {
|
|
941
953
|
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? F("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : F("deleteConversation.nothing", "There is no conversation to delete.");
|
|
942
|
-
|
|
954
|
+
os.current({
|
|
943
955
|
id: `conversation-delete:${P()}`,
|
|
944
956
|
text: t,
|
|
945
957
|
lang: t === e ? "en" : V
|
|
946
958
|
});
|
|
947
|
-
} else r ||
|
|
959
|
+
} else r || cs(Date.now());
|
|
948
960
|
return !0;
|
|
949
961
|
}, [
|
|
950
|
-
|
|
962
|
+
as,
|
|
951
963
|
V,
|
|
952
964
|
F
|
|
953
|
-
]),
|
|
954
|
-
if (e.kind === "conversation-delete") return
|
|
965
|
+
]), ds = O((e, t, n, r = !1) => {
|
|
966
|
+
if (e.kind === "conversation-delete") return us(n);
|
|
955
967
|
let { theme: i, navigate: a } = J.current, o = null, s = () => {
|
|
956
|
-
let e = (r ? null : o ??
|
|
957
|
-
return r &&
|
|
968
|
+
let e = (r ? null : o ?? v.getState().activeConversationId) ?? ls();
|
|
969
|
+
return r && $a(e), e;
|
|
958
970
|
}, c = (e, r) => {
|
|
959
971
|
let i = P();
|
|
960
972
|
return W(e, {
|
|
@@ -964,7 +976,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
964
976
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
965
977
|
metadata: {
|
|
966
978
|
localAction: r,
|
|
967
|
-
...
|
|
979
|
+
...S(n)
|
|
968
980
|
}
|
|
969
981
|
}), i;
|
|
970
982
|
}, l = (e, t, r, i, a, o) => {
|
|
@@ -977,25 +989,25 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
977
989
|
metadata: {
|
|
978
990
|
lang: r.translated ? V : "en",
|
|
979
991
|
localAction: i,
|
|
980
|
-
...
|
|
992
|
+
...S(n)
|
|
981
993
|
}
|
|
982
|
-
}),
|
|
994
|
+
}), Un.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Co(e, s), s;
|
|
983
995
|
}, u = (e, t, n) => {
|
|
984
|
-
let r = s(), i = l(r, c(r, t), e, t,
|
|
996
|
+
let r = s(), i = l(r, c(r, t), e, t, T(), !0);
|
|
985
997
|
return n?.(i), !0;
|
|
986
998
|
}, d = (e) => {
|
|
987
|
-
let t = s(), n =
|
|
999
|
+
let t = s(), n = T(), r = window.location.pathname, i = c(t, Rr({
|
|
988
1000
|
destinationId: e.destinationId,
|
|
989
1001
|
path: e.registryPath,
|
|
990
1002
|
alreadyHere: !1,
|
|
991
1003
|
via: e.via,
|
|
992
1004
|
offer: e.offer
|
|
993
1005
|
})), o = P();
|
|
994
|
-
|
|
1006
|
+
Fo.current = o, Lo(!0);
|
|
995
1007
|
let u = (a) => {
|
|
996
1008
|
try {
|
|
997
|
-
if (e.offer &&
|
|
998
|
-
let o =
|
|
1009
|
+
if (e.offer && Go(e.offer.offerId, a) && Bo(), a.status === "kept" || !v.getState().conversations.some((e) => e.id === t)) return;
|
|
1010
|
+
let o = jr(J.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = Rr({
|
|
999
1011
|
destinationId: e.destinationId,
|
|
1000
1012
|
path: e.registryPath,
|
|
1001
1013
|
alreadyHere: !1,
|
|
@@ -1003,10 +1015,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1003
1015
|
outcome: a,
|
|
1004
1016
|
offer: e.offer
|
|
1005
1017
|
});
|
|
1006
|
-
|
|
1007
|
-
let u = l(t, i, e.via === "back" && a.status === "arrived" ?
|
|
1018
|
+
Gi(t, i, { localAction: c });
|
|
1019
|
+
let u = l(t, i, e.via === "back" && a.status === "arrived" ? jt(F, e.pageLabel()) : Lt(F, a, {
|
|
1008
1020
|
page: e.pageLabel(),
|
|
1009
|
-
landed: s === null ? null :
|
|
1021
|
+
landed: s === null ? null : Br(o, s),
|
|
1010
1022
|
path: e.target
|
|
1011
1023
|
}), c, n, Y.current);
|
|
1012
1024
|
a.status === "arrived" && e.onArrived?.({
|
|
@@ -1015,10 +1027,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1015
1027
|
landedPath: a.landedPath
|
|
1016
1028
|
});
|
|
1017
1029
|
} finally {
|
|
1018
|
-
|
|
1030
|
+
Fo.current === o && (Fo.current = null, Y.current && Lo(!1));
|
|
1019
1031
|
}
|
|
1020
1032
|
};
|
|
1021
|
-
return
|
|
1033
|
+
return Fr(a, e.target, {
|
|
1022
1034
|
readPath: () => window.location.pathname + window.location.search,
|
|
1023
1035
|
now: () => Date.now(),
|
|
1024
1036
|
schedule: (e, t) => {
|
|
@@ -1026,7 +1038,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1026
1038
|
},
|
|
1027
1039
|
isShellLess: () => !Y.current
|
|
1028
1040
|
}).then(u, () => u({ status: "unconfirmed" })), !0;
|
|
1029
|
-
}, f = ({ replyId: e, fromPath: t, landedPath: n }) =>
|
|
1041
|
+
}, f = ({ replyId: e, fromPath: t, landedPath: n }) => Ir.push({
|
|
1030
1042
|
fromPath: t,
|
|
1031
1043
|
toPath: n,
|
|
1032
1044
|
replyMessageId: e,
|
|
@@ -1034,21 +1046,21 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1034
1046
|
});
|
|
1035
1047
|
if (e.kind === "theme") {
|
|
1036
1048
|
if (!i) return !1;
|
|
1037
|
-
let t =
|
|
1049
|
+
let t = Mr(e.request, {
|
|
1038
1050
|
mode: i.mode,
|
|
1039
1051
|
resolvedTheme: i.resolvedTheme
|
|
1040
1052
|
});
|
|
1041
1053
|
if (!t.alreadyApplied) try {
|
|
1042
1054
|
i.setMode(t.mode);
|
|
1043
1055
|
} catch {}
|
|
1044
|
-
return u(
|
|
1056
|
+
return u(Wt(F, t, e.request.kind === "family"), {
|
|
1045
1057
|
kind: "theme",
|
|
1046
1058
|
mode: t.mode,
|
|
1047
1059
|
alreadyApplied: t.alreadyApplied
|
|
1048
1060
|
});
|
|
1049
1061
|
}
|
|
1050
1062
|
if (e.kind === "app-control") {
|
|
1051
|
-
let t =
|
|
1063
|
+
let t = $r(e.request, { voiceLive: n !== void 0 || tc.current });
|
|
1052
1064
|
if (!t) return !1;
|
|
1053
1065
|
let r = (e) => ({
|
|
1054
1066
|
kind: "app-control",
|
|
@@ -1056,34 +1068,34 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1056
1068
|
outcome: e.outcome,
|
|
1057
1069
|
...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
|
|
1058
1070
|
}), i = (t) => {
|
|
1059
|
-
if (e.request.control === "language" &&
|
|
1060
|
-
let n = s(), i = r(t), a = l(n, c(n, i),
|
|
1061
|
-
return
|
|
1071
|
+
if (e.request.control === "language" && No(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
|
|
1072
|
+
let n = s(), i = r(t), a = l(n, c(n, i), Gt((e, t) => t, t.reply), i, T(), !1);
|
|
1073
|
+
return ko.current = {
|
|
1062
1074
|
wanted: e.request.code,
|
|
1063
1075
|
reply: t.reply,
|
|
1064
1076
|
conversationId: n,
|
|
1065
1077
|
messageId: a,
|
|
1066
|
-
deadline: window.setTimeout(
|
|
1067
|
-
},
|
|
1078
|
+
deadline: window.setTimeout(Po, Kt)
|
|
1079
|
+
}, jo(a), !0;
|
|
1068
1080
|
}
|
|
1069
|
-
return u(
|
|
1081
|
+
return u(Gt(F, t.reply), r(t));
|
|
1070
1082
|
};
|
|
1071
1083
|
if (t.kind === "reply") return i(t.run);
|
|
1072
1084
|
if (t.kind === "run") {
|
|
1073
1085
|
let e = t.run();
|
|
1074
1086
|
return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
|
|
1075
1087
|
}
|
|
1076
|
-
let a =
|
|
1088
|
+
let a = is;
|
|
1077
1089
|
if (!a) return !1;
|
|
1078
1090
|
let o = null;
|
|
1079
|
-
return u(
|
|
1080
|
-
o =
|
|
1091
|
+
return u(Gt(F, t.ask.reply), r(t.ask), (e) => {
|
|
1092
|
+
o = v.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
|
|
1081
1093
|
}), a.request({
|
|
1082
1094
|
prompt: t.prompt,
|
|
1083
1095
|
onConfirm: () => {
|
|
1084
|
-
let e = t.confirmed(), i = o, a = i !== null &&
|
|
1096
|
+
let e = t.confirmed(), i = o, a = i !== null && v.getState().conversations.some((e) => e.id === i);
|
|
1085
1097
|
if (!i || !a) return;
|
|
1086
|
-
let s =
|
|
1098
|
+
let s = Gt(F, e.reply);
|
|
1087
1099
|
W(i, {
|
|
1088
1100
|
id: P(),
|
|
1089
1101
|
role: "assistant",
|
|
@@ -1092,30 +1104,30 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1092
1104
|
metadata: {
|
|
1093
1105
|
lang: s.translated ? V : "en",
|
|
1094
1106
|
localAction: r(e),
|
|
1095
|
-
...
|
|
1107
|
+
...S(n)
|
|
1096
1108
|
}
|
|
1097
1109
|
});
|
|
1098
1110
|
}
|
|
1099
1111
|
}), !0;
|
|
1100
1112
|
}
|
|
1101
1113
|
if (!a) return !1;
|
|
1102
|
-
if (e.kind === "choose-destination") return u(
|
|
1114
|
+
if (e.kind === "choose-destination") return u(Mt(F, e.candidates[0]?.label ?? e.query, e.candidates), {
|
|
1103
1115
|
kind: "choose-destination",
|
|
1104
1116
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1105
|
-
}, (t) =>
|
|
1106
|
-
if (e.kind === "choose-linked") return u(
|
|
1117
|
+
}, (t) => Wr(t, e.candidates));
|
|
1118
|
+
if (e.kind === "choose-linked") return u(Nt(F, e.candidates), {
|
|
1107
1119
|
kind: "choose-destination",
|
|
1108
1120
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1109
|
-
}, (t) =>
|
|
1121
|
+
}, (t) => Wr(t, e.candidates));
|
|
1110
1122
|
if (e.kind === "pick-from-list") {
|
|
1111
1123
|
let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
|
|
1112
|
-
return u(
|
|
1124
|
+
return u(Vt(F), t ? {
|
|
1113
1125
|
kind: "choose-destination",
|
|
1114
1126
|
candidateIds: t.map((e) => e.id)
|
|
1115
1127
|
} : e.candidateIds.length > 0 ? {
|
|
1116
1128
|
kind: "choose-destination",
|
|
1117
1129
|
candidateIds: [...e.candidateIds]
|
|
1118
|
-
} :
|
|
1130
|
+
} : Rr({
|
|
1119
1131
|
destinationId: "",
|
|
1120
1132
|
path: "",
|
|
1121
1133
|
alreadyHere: !1,
|
|
@@ -1124,9 +1136,9 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1124
1136
|
status: "refused",
|
|
1125
1137
|
reason: "not-routable"
|
|
1126
1138
|
}
|
|
1127
|
-
}), t ? (e) =>
|
|
1139
|
+
}), t ? (e) => Wr(e, t) : void 0);
|
|
1128
1140
|
}
|
|
1129
|
-
if (e.kind === "link-not-openable") return u(
|
|
1141
|
+
if (e.kind === "link-not-openable") return u(Ft(F), Rr({
|
|
1130
1142
|
destinationId: "",
|
|
1131
1143
|
path: "",
|
|
1132
1144
|
alreadyHere: !1,
|
|
@@ -1139,7 +1151,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1139
1151
|
if (e.kind === "open-record") {
|
|
1140
1152
|
let r;
|
|
1141
1153
|
try {
|
|
1142
|
-
let { options: t, navItems: n } = J.current, i = t.entityRoutes ?? [], a =
|
|
1154
|
+
let { options: t, navItems: n } = J.current, i = t.entityRoutes ?? [], a = Er(n);
|
|
1143
1155
|
r = (t.records ?? []).flatMap((t) => {
|
|
1144
1156
|
let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
|
|
1145
1157
|
return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
|
|
@@ -1151,20 +1163,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1151
1163
|
return !1;
|
|
1152
1164
|
}
|
|
1153
1165
|
if (r.length === 0) return !1;
|
|
1154
|
-
let i =
|
|
1155
|
-
|
|
1166
|
+
let i = v.getState().activeConversationId, a = P();
|
|
1167
|
+
Fo.current = a, Lo(!0);
|
|
1156
1168
|
let s = () => {
|
|
1157
|
-
|
|
1169
|
+
Fo.current === a && (Fo.current = null, Y.current && Lo(!1));
|
|
1158
1170
|
};
|
|
1159
1171
|
return (async () => {
|
|
1160
1172
|
let a = { kind: "none" }, c = !0;
|
|
1161
1173
|
try {
|
|
1162
|
-
a = await
|
|
1174
|
+
a = await Dr({
|
|
1163
1175
|
name: e.request.name,
|
|
1164
1176
|
usable: r,
|
|
1165
|
-
nounOf: (e) =>
|
|
1166
|
-
timeoutMs:
|
|
1167
|
-
}), c =
|
|
1177
|
+
nounOf: (e) => Pt(F, e.noun),
|
|
1178
|
+
timeoutMs: ui
|
|
1179
|
+
}), c = v.getState().conversations.some((e) => e.id === i);
|
|
1168
1180
|
} catch {
|
|
1169
1181
|
a = { kind: "none" };
|
|
1170
1182
|
} finally {
|
|
@@ -1172,7 +1184,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1172
1184
|
}
|
|
1173
1185
|
if (!Y.current) return;
|
|
1174
1186
|
if (a.kind === "none") {
|
|
1175
|
-
|
|
1187
|
+
gs.current(t, [], {
|
|
1176
1188
|
fromPerson: !0,
|
|
1177
1189
|
...n === void 0 ? {} : { voiceSessionId: n },
|
|
1178
1190
|
localRecordsChecked: !0
|
|
@@ -1193,16 +1205,16 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1193
1205
|
return;
|
|
1194
1206
|
}
|
|
1195
1207
|
let l = a.candidates[0];
|
|
1196
|
-
u(a.why === "kinds" ?
|
|
1208
|
+
u(a.why === "kinds" ? Ut(F, a.nouns, a.candidates) : Ht(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
|
|
1197
1209
|
kind: "choose-destination",
|
|
1198
1210
|
candidateIds: a.candidates.map((e) => e.id)
|
|
1199
|
-
}, (e) =>
|
|
1211
|
+
}, (e) => Wr(e, a.candidates));
|
|
1200
1212
|
})().catch(() => void 0), !0;
|
|
1201
1213
|
}
|
|
1202
1214
|
if (e.kind === "back") {
|
|
1203
|
-
let e =
|
|
1215
|
+
let e = Ir.top();
|
|
1204
1216
|
if (!e) return !1;
|
|
1205
|
-
let t =
|
|
1217
|
+
let t = zr(jr(J.current.navItems), e.fromPath);
|
|
1206
1218
|
return d({
|
|
1207
1219
|
target: e.fromPath,
|
|
1208
1220
|
destinationId: t?.id ?? "",
|
|
@@ -1210,88 +1222,88 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1210
1222
|
via: "back",
|
|
1211
1223
|
pageLabel: () => t?.label ?? null,
|
|
1212
1224
|
onArrived: () => {
|
|
1213
|
-
|
|
1225
|
+
Ir.top() === e && Ir.pop();
|
|
1214
1226
|
}
|
|
1215
1227
|
});
|
|
1216
1228
|
}
|
|
1217
|
-
let
|
|
1229
|
+
let ee, p = e.destination;
|
|
1218
1230
|
if (e.via === "offer") {
|
|
1219
|
-
let t =
|
|
1220
|
-
if (!t.ok) return u(t.copy ??
|
|
1231
|
+
let t = Uo(e.offerId, e.destination.label);
|
|
1232
|
+
if (!t.ok) return u(t.copy ?? Rt(F), {
|
|
1221
1233
|
kind: "write-reply",
|
|
1222
1234
|
line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
|
|
1223
1235
|
});
|
|
1224
|
-
|
|
1236
|
+
ee = {
|
|
1225
1237
|
trigger: e.trigger,
|
|
1226
1238
|
offerId: e.offerId
|
|
1227
|
-
},
|
|
1239
|
+
}, p = jr(J.current.navItems).find((e) => e.id === t.target.id) ?? {
|
|
1228
1240
|
id: t.target.id,
|
|
1229
1241
|
label: t.target.label,
|
|
1230
1242
|
path: t.target.path
|
|
1231
1243
|
};
|
|
1232
1244
|
}
|
|
1233
|
-
return
|
|
1234
|
-
destinationId:
|
|
1235
|
-
path:
|
|
1245
|
+
return Or(p, window.location.pathname + window.location.search, jr(J.current.navItems)) ? u(It(F, p.label, !0), Rr({
|
|
1246
|
+
destinationId: p.id,
|
|
1247
|
+
path: p.path,
|
|
1236
1248
|
alreadyHere: !0,
|
|
1237
1249
|
via: e.via ?? "named",
|
|
1238
|
-
offer:
|
|
1250
|
+
offer: ee
|
|
1239
1251
|
})) : d({
|
|
1240
|
-
target:
|
|
1241
|
-
destinationId:
|
|
1242
|
-
registryPath:
|
|
1252
|
+
target: p.path,
|
|
1253
|
+
destinationId: p.id,
|
|
1254
|
+
registryPath: p.path,
|
|
1243
1255
|
via: e.via ?? "named",
|
|
1244
|
-
offer:
|
|
1245
|
-
pageLabel: () =>
|
|
1256
|
+
offer: ee,
|
|
1257
|
+
pageLabel: () => p.label,
|
|
1246
1258
|
onArrived: f
|
|
1247
1259
|
});
|
|
1248
1260
|
}, [
|
|
1249
1261
|
W,
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1262
|
+
$a,
|
|
1263
|
+
is,
|
|
1264
|
+
ls,
|
|
1265
|
+
Po,
|
|
1254
1266
|
V,
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1267
|
+
Gi,
|
|
1268
|
+
us,
|
|
1269
|
+
No,
|
|
1270
|
+
Co,
|
|
1259
1271
|
F,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
]),
|
|
1264
|
-
|
|
1272
|
+
Uo,
|
|
1273
|
+
Go,
|
|
1274
|
+
Bo
|
|
1275
|
+
]), fs = O(async (e) => {
|
|
1276
|
+
La.current = !0;
|
|
1265
1277
|
try {
|
|
1266
1278
|
await G.declineForReply(e.conversationId, e.reason, e.origin);
|
|
1267
1279
|
} finally {
|
|
1268
|
-
|
|
1280
|
+
La.current = !1;
|
|
1269
1281
|
}
|
|
1270
1282
|
if (e.commandText !== null) {
|
|
1271
|
-
let t =
|
|
1272
|
-
if (t &&
|
|
1283
|
+
let t = Qo(e.commandText, e.options.voiceSessionId);
|
|
1284
|
+
if (t && ds(t, e.content, e.options.voiceSessionId)) return;
|
|
1273
1285
|
}
|
|
1274
|
-
await
|
|
1286
|
+
await gs.current(e.content, e.attachments, e.options);
|
|
1275
1287
|
}, [
|
|
1276
|
-
|
|
1277
|
-
|
|
1288
|
+
Qo,
|
|
1289
|
+
ds,
|
|
1278
1290
|
G
|
|
1279
|
-
]), Z =
|
|
1280
|
-
let r = n.voiceSessionId !== void 0, i =
|
|
1281
|
-
if (r &&
|
|
1282
|
-
let e =
|
|
1291
|
+
]), Z = O(async (e, t = [], n = {}) => {
|
|
1292
|
+
let r = n.voiceSessionId !== void 0, i = v.getState(), a = !1, o = Xa.current;
|
|
1293
|
+
if (r && Ze(o)) {
|
|
1294
|
+
let e = nt(o, i.activeConversationId, eo());
|
|
1283
1295
|
if (e.kind === "gone") return;
|
|
1284
1296
|
let t = n.voiceEntry ?? e;
|
|
1285
|
-
t.kind === "adopt" &&
|
|
1297
|
+
t.kind === "adopt" && $a(t.conversationId), a = t.kind === "own", n = {
|
|
1286
1298
|
...n,
|
|
1287
1299
|
voiceEntry: t
|
|
1288
1300
|
};
|
|
1289
1301
|
}
|
|
1290
1302
|
let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? H;
|
|
1291
1303
|
if (c) {
|
|
1292
|
-
if (
|
|
1304
|
+
if (Ot(i.processingByConversationId[c]?.status)) {
|
|
1293
1305
|
let r = i.processingByConversationId[c]?.messageId ?? null;
|
|
1294
|
-
r && n.correctsInFlightTurn === !0 && !
|
|
1306
|
+
r && n.correctsInFlightTurn === !0 && !go.current.has(r) && yo(), r && go.current.has(r) && (_o.current = {
|
|
1295
1307
|
conversationId: c,
|
|
1296
1308
|
content: e,
|
|
1297
1309
|
attachments: t,
|
|
@@ -1299,27 +1311,27 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1299
1311
|
});
|
|
1300
1312
|
return;
|
|
1301
1313
|
}
|
|
1302
|
-
if (
|
|
1314
|
+
if (no.current.has(c)) return;
|
|
1303
1315
|
}
|
|
1304
|
-
if (
|
|
1305
|
-
let l = n.targetConversationId, f =
|
|
1316
|
+
if (Ia.current || h() !== null || La.current || Fo.current !== null) return;
|
|
1317
|
+
let l = n.targetConversationId, f = p(), m = (e) => Bn(e) || zn(e, f);
|
|
1306
1318
|
if (l !== void 0) {
|
|
1307
1319
|
let e = i.conversations.find((e) => e.id === l);
|
|
1308
|
-
if (i.activeConversationId !== l || !e || e.mode !== i.mode ||
|
|
1320
|
+
if (i.activeConversationId !== l || !e || e.mode !== i.mode || m(e)) return;
|
|
1309
1321
|
}
|
|
1310
1322
|
if (n.fromPerson && n.writeReplyBound === void 0) {
|
|
1311
|
-
let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o =
|
|
1323
|
+
let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = ts(r, n.voiceSessionId), c = Dn({
|
|
1312
1324
|
text: e,
|
|
1313
|
-
locale: i === "spoken" ?
|
|
1325
|
+
locale: i === "spoken" ? Ni.input.code : V,
|
|
1314
1326
|
origin: i,
|
|
1315
1327
|
hasAttachments: t.length > 0,
|
|
1316
1328
|
live: G.liveFor(r),
|
|
1317
|
-
matchesLocalCommand: (e) =>
|
|
1329
|
+
matchesLocalCommand: (e) => Qo(e, n.voiceSessionId) !== null,
|
|
1318
1330
|
offer: o.state,
|
|
1319
|
-
offerAssent: o.state !== "none" &&
|
|
1331
|
+
offerAssent: o.state !== "none" && Nr({
|
|
1320
1332
|
text: e,
|
|
1321
1333
|
uiLocale: V,
|
|
1322
|
-
inputLocale:
|
|
1334
|
+
inputLocale: Ni.input.code,
|
|
1323
1335
|
commandLocales: J.current.options.commandLocales,
|
|
1324
1336
|
manifest: J.current.options.commandManifest,
|
|
1325
1337
|
leaveGuard: J.current.options.leaveGuard
|
|
@@ -1327,7 +1339,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1327
1339
|
});
|
|
1328
1340
|
if (c.kind === "accept_offer") {
|
|
1329
1341
|
let t = o.accept;
|
|
1330
|
-
if (t &&
|
|
1342
|
+
if (t && ds({
|
|
1331
1343
|
kind: "navigate",
|
|
1332
1344
|
destination: t.destination,
|
|
1333
1345
|
via: "offer",
|
|
@@ -1348,11 +1360,11 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1348
1360
|
};
|
|
1349
1361
|
}
|
|
1350
1362
|
if (c.kind === "local_reply") {
|
|
1351
|
-
r &&
|
|
1363
|
+
r && ns(r, e, c.line, c.values, n.voiceSessionId);
|
|
1352
1364
|
return;
|
|
1353
1365
|
}
|
|
1354
1366
|
let u = c.kind === "local" ? c.fallback : c.bound, d = c.declineAll;
|
|
1355
|
-
if (d !== null && r) return
|
|
1367
|
+
if (d !== null && r) return fs({
|
|
1356
1368
|
conversationId: r,
|
|
1357
1369
|
reason: d,
|
|
1358
1370
|
origin: i,
|
|
@@ -1369,694 +1381,691 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
1369
1381
|
writeReplyBound: u
|
|
1370
1382
|
};
|
|
1371
1383
|
}
|
|
1372
|
-
let
|
|
1384
|
+
let te = n.writeReplyBound?.promptText ?? e;
|
|
1373
1385
|
if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
|
|
1374
|
-
let t =
|
|
1375
|
-
if (t &&
|
|
1386
|
+
let t = Qo(e, n.voiceSessionId, n.localRecordsChecked === !0);
|
|
1387
|
+
if (t && ds(t, e, n.voiceSessionId, a)) return;
|
|
1376
1388
|
}
|
|
1377
|
-
let
|
|
1389
|
+
let ne = s ? i.conversations.find((e) => e.id === s) : void 0, ie = m(ne) ? void 0 : ne, g = i.autoRouting && Fa.current && l === void 0 ? ee({
|
|
1378
1390
|
intent: n.autoIntent ?? u(e),
|
|
1379
1391
|
dictated: r,
|
|
1380
|
-
voiceProposalBound: r &&
|
|
1381
|
-
conversation:
|
|
1382
|
-
mode:
|
|
1383
|
-
routedBy:
|
|
1384
|
-
hasHistory:
|
|
1392
|
+
voiceProposalBound: r && wi("api-calls") && oe(i.acknowledgedWriteModes, "api-calls"),
|
|
1393
|
+
conversation: ie ? {
|
|
1394
|
+
mode: ie.mode,
|
|
1395
|
+
routedBy: ie.routedBy,
|
|
1396
|
+
hasHistory: Rn(ie)
|
|
1385
1397
|
} : null
|
|
1386
1398
|
}) : null;
|
|
1387
|
-
if (
|
|
1388
|
-
|
|
1399
|
+
if (g && Da.current.find((e) => e.id === g.mode)?.writeCapable && !oe(i.acknowledgedWriteModes, g.mode)) {
|
|
1400
|
+
Ia.current = {
|
|
1389
1401
|
content: e,
|
|
1390
1402
|
attachments: t,
|
|
1391
1403
|
options: n
|
|
1392
|
-
},
|
|
1404
|
+
}, Ba(g.mode);
|
|
1393
1405
|
return;
|
|
1394
1406
|
}
|
|
1395
|
-
let
|
|
1396
|
-
mode:
|
|
1397
|
-
backendSessionId:
|
|
1407
|
+
let _ = g ? g.mode : i.mode, ae, ce, y = l ?? (a ? null : H), ue = y ? v.getState().conversations.find((e) => e.id === y) : void 0, de = g?.action === "escalate" && ie ? {
|
|
1408
|
+
mode: ie.mode,
|
|
1409
|
+
backendSessionId: ie.backendSessionId ?? null
|
|
1398
1410
|
} : null;
|
|
1399
|
-
if (
|
|
1411
|
+
if (g) g.action === "new" || !ie ? y = Hi(void 0, _, { routedBy: "auto" }) : (y = ie.id, na(y, _));
|
|
1400
1412
|
else {
|
|
1401
1413
|
let e = i.autoRouting ? { routedBy: "auto" } : void 0;
|
|
1402
|
-
!
|
|
1414
|
+
!y || m(ue) || ue && ue.mode !== _ && Rn(ue) ? y = Hi(void 0, _, e) : ue && ue.mode !== _ && (e ? na(y, _) : Bi(y, _));
|
|
1403
1415
|
}
|
|
1404
|
-
if (!
|
|
1405
|
-
r &&
|
|
1406
|
-
let
|
|
1416
|
+
if (!y) return;
|
|
1417
|
+
r && Xa.current !== void 0 && y !== i.activeConversationId && $a(y), n.approvalFollowUp || (to.current[y] = t);
|
|
1418
|
+
let pe = () => v.getState().conversations.some((e) => e.id === y), b = T(), ye = {
|
|
1407
1419
|
accessToken: z(),
|
|
1408
|
-
workspaceToken:
|
|
1420
|
+
workspaceToken: Ti(),
|
|
1409
1421
|
userId: B,
|
|
1410
|
-
organizationId:
|
|
1411
|
-
},
|
|
1412
|
-
|
|
1422
|
+
organizationId: Et()
|
|
1423
|
+
}, xe = (e, t) => {
|
|
1424
|
+
pe() || !b || le(e, b, t, _, {
|
|
1413
1425
|
accessToken: z(),
|
|
1414
|
-
workspaceToken:
|
|
1426
|
+
workspaceToken: Ti(),
|
|
1415
1427
|
userId: B,
|
|
1416
|
-
organizationId:
|
|
1428
|
+
organizationId: Et()
|
|
1417
1429
|
});
|
|
1418
|
-
},
|
|
1430
|
+
}, Se = {
|
|
1419
1431
|
id: P(),
|
|
1420
1432
|
role: "user",
|
|
1421
1433
|
content: e,
|
|
1422
1434
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1423
1435
|
metadata: {
|
|
1424
|
-
...t.length ? { attachments: t.map(
|
|
1436
|
+
...t.length ? { attachments: t.map(lt) } : {},
|
|
1425
1437
|
...n.approvalFollowUp ? {
|
|
1426
1438
|
approvalFollowUp: !0,
|
|
1427
1439
|
approvedReplyId: n.approvalFollowUp.approvedReplyId
|
|
1428
1440
|
} : {},
|
|
1429
|
-
...
|
|
1441
|
+
...S(n.voiceSessionId)
|
|
1430
1442
|
}
|
|
1431
1443
|
};
|
|
1432
|
-
W(
|
|
1433
|
-
let
|
|
1444
|
+
W(y, Se);
|
|
1445
|
+
let Ce = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && te === e ? Xr(e, r ? Ni.input.code : V) : null, Te = {
|
|
1434
1446
|
location: window.location.pathname + window.location.search,
|
|
1435
|
-
conversationId:
|
|
1436
|
-
workspaceId:
|
|
1447
|
+
conversationId: v.getState().activeConversationId,
|
|
1448
|
+
workspaceId: T(),
|
|
1437
1449
|
actorId: B ?? null
|
|
1438
|
-
},
|
|
1439
|
-
W(
|
|
1440
|
-
id:
|
|
1450
|
+
}, x = P();
|
|
1451
|
+
W(y, {
|
|
1452
|
+
id: x,
|
|
1441
1453
|
role: "assistant",
|
|
1442
1454
|
content: "",
|
|
1443
1455
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1444
1456
|
metadata: {
|
|
1445
|
-
lang:
|
|
1446
|
-
...
|
|
1457
|
+
lang: Ii,
|
|
1458
|
+
...S(n.voiceSessionId)
|
|
1447
1459
|
}
|
|
1448
|
-
}),
|
|
1460
|
+
}), sn(x, {
|
|
1449
1461
|
channel: r ? "voice" : "chat",
|
|
1450
|
-
mode:
|
|
1462
|
+
mode: _,
|
|
1451
1463
|
product: I,
|
|
1452
|
-
language:
|
|
1453
|
-
device:
|
|
1454
|
-
routedByAuto: !!
|
|
1455
|
-
}, n.voiceTiming),
|
|
1456
|
-
let
|
|
1457
|
-
let e =
|
|
1458
|
-
turnId:
|
|
1459
|
-
abortRequested:
|
|
1460
|
-
activeTurnId:
|
|
1461
|
-
conversationExists:
|
|
1464
|
+
language: Ii,
|
|
1465
|
+
device: cn(),
|
|
1466
|
+
routedByAuto: !!g
|
|
1467
|
+
}, n.voiceTiming), D(x, "accepted"), Ki(y, "provisioning", x, null), re(x);
|
|
1468
|
+
let De = () => {
|
|
1469
|
+
let e = kt({
|
|
1470
|
+
turnId: x,
|
|
1471
|
+
abortRequested: go.current.has(x),
|
|
1472
|
+
activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
|
|
1473
|
+
conversationExists: pe()
|
|
1462
1474
|
});
|
|
1463
|
-
return e.abandon &&
|
|
1464
|
-
},
|
|
1465
|
-
|
|
1475
|
+
return e.abandon && Ve(), e;
|
|
1476
|
+
}, Re = (e, t, r, i, a = !1, o = Ii) => {
|
|
1477
|
+
Wi(y, x, { content: we(e) }), Gi(y, x, {
|
|
1466
1478
|
lang: o,
|
|
1467
1479
|
...t?.length ? { artifacts: t } : {},
|
|
1468
|
-
...t?.length || r || i ? { mode:
|
|
1480
|
+
...t?.length || r || i ? { mode: _ } : {},
|
|
1469
1481
|
...r ? { sessionId: r } : {},
|
|
1470
1482
|
...i ? { sandboxId: i } : {},
|
|
1471
1483
|
...a ? { incomplete: !0 } : {},
|
|
1472
|
-
...
|
|
1484
|
+
...S(n.voiceSessionId)
|
|
1473
1485
|
});
|
|
1474
|
-
},
|
|
1486
|
+
}, ze = { session: null }, C = {
|
|
1475
1487
|
stream: null,
|
|
1476
1488
|
render: null
|
|
1477
|
-
},
|
|
1478
|
-
|
|
1479
|
-
},
|
|
1480
|
-
|
|
1481
|
-
},
|
|
1482
|
-
|
|
1483
|
-
},
|
|
1484
|
-
|
|
1489
|
+
}, Ve = () => {
|
|
1490
|
+
C.render?.end();
|
|
1491
|
+
}, He = () => {
|
|
1492
|
+
Ve(), C.stream?.close(), C.stream = null, C.render = null;
|
|
1493
|
+
}, Ue = !1, We = () => {
|
|
1494
|
+
Ue && (Ue = !1, Be.abort(x));
|
|
1495
|
+
}, Ge = async (i = 1) => {
|
|
1496
|
+
D(x, "attemptStarted");
|
|
1485
1497
|
let a = null, o = null, s = !1;
|
|
1486
1498
|
try {
|
|
1487
|
-
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted:
|
|
1488
|
-
turnId:
|
|
1489
|
-
abortRequested:
|
|
1490
|
-
activeTurnId:
|
|
1491
|
-
conversationExists:
|
|
1499
|
+
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: ee, deadSandboxProbe: p, sessionPreopened: m } = await lo(y, x, _, b, ye, { isAbandoned: () => kt({
|
|
1500
|
+
turnId: x,
|
|
1501
|
+
abortRequested: go.current.has(x),
|
|
1502
|
+
activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
|
|
1503
|
+
conversationExists: pe()
|
|
1492
1504
|
}).abandon });
|
|
1493
|
-
if (a = i,
|
|
1494
|
-
runtime: d ? "cold" :
|
|
1495
|
-
deadSandboxProbe:
|
|
1496
|
-
}),
|
|
1505
|
+
if (a = i, D(x, "runtimeReady"), E(x, {
|
|
1506
|
+
runtime: d ? "cold" : ee ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
|
|
1507
|
+
deadSandboxProbe: p
|
|
1508
|
+
}), E(x, { session: m ? "preopened" : l ? "created" : "reused" }), o = c, ze.session = {
|
|
1497
1509
|
sandboxId: i,
|
|
1498
1510
|
sessionId: c
|
|
1499
|
-
},
|
|
1511
|
+
}, se(_, ae, v.getState().acknowledgedWriteModes, {
|
|
1500
1512
|
dictated: r,
|
|
1501
|
-
confirmsWrites:
|
|
1502
|
-
proposalBound:
|
|
1503
|
-
}) === "voice-in-write-mode") throw new
|
|
1504
|
-
let
|
|
1505
|
-
conversation:
|
|
1513
|
+
confirmsWrites: _e(_),
|
|
1514
|
+
proposalBound: wi(_, i)
|
|
1515
|
+
}) === "voice-in-write-mode") throw new Oe("voice-in-write-mode", "Voice in a write mode");
|
|
1516
|
+
let ne = Qn({
|
|
1517
|
+
conversation: v.getState().conversations.find((e) => e.id === y),
|
|
1506
1518
|
content: e,
|
|
1507
1519
|
sessionIsNew: l,
|
|
1508
|
-
sendingMode:
|
|
1509
|
-
sendingModeConfig:
|
|
1510
|
-
modes:
|
|
1511
|
-
answerText: (e) =>
|
|
1520
|
+
sendingMode: _,
|
|
1521
|
+
sendingModeConfig: ae,
|
|
1522
|
+
modes: Da.current,
|
|
1523
|
+
answerText: (e) => nn(e).text
|
|
1512
1524
|
});
|
|
1513
|
-
if (
|
|
1514
|
-
let e =
|
|
1515
|
-
mint: () =>
|
|
1516
|
-
mark: (e) =>
|
|
1525
|
+
if (He(), dr()) {
|
|
1526
|
+
let e = ur({
|
|
1527
|
+
mint: () => ge(i, b, c, _, ye),
|
|
1528
|
+
mark: (e) => D(x, e)
|
|
1517
1529
|
});
|
|
1518
|
-
|
|
1530
|
+
C.stream = e, C.render = tr({
|
|
1519
1531
|
stream: e,
|
|
1520
|
-
conversationId:
|
|
1521
|
-
messageId:
|
|
1522
|
-
build: (e, t) =>
|
|
1523
|
-
onFirstDelta: () =>
|
|
1524
|
-
onFirstVisible: () =>
|
|
1532
|
+
conversationId: y,
|
|
1533
|
+
messageId: x,
|
|
1534
|
+
build: (e, t) => we(Zt(e, t, { accumulateNarration: ce.accumulatesNarration }).content),
|
|
1535
|
+
onFirstDelta: () => D(x, "firstDelta"),
|
|
1536
|
+
onFirstVisible: () => D(x, "firstOutput")
|
|
1525
1537
|
});
|
|
1526
1538
|
}
|
|
1527
|
-
let
|
|
1528
|
-
|
|
1529
|
-
let
|
|
1530
|
-
permissionsSettled:
|
|
1531
|
-
simulating:
|
|
1532
|
-
sentBefore:
|
|
1533
|
-
}) : null,
|
|
1534
|
-
conversationId:
|
|
1535
|
-
writeReply:
|
|
1536
|
-
...
|
|
1537
|
-
}, { prompt:
|
|
1538
|
-
content:
|
|
1539
|
+
let h = await $t(() => he(i, b, c, _, ye, { limit: 50 }), l, Qt(u, i, c));
|
|
1540
|
+
so(y, x, "streaming", "thinking");
|
|
1541
|
+
let re = yi?.(), ie = On(v.getState().sandboxWriteCapabilities[i]), g = J.current, oe = Jr(i, c), le = g.options.uiCatalogue ? Gr(jr(g.navItems), {
|
|
1542
|
+
permissionsSettled: g.navPermissionsSettled,
|
|
1543
|
+
simulating: g.navSimulating,
|
|
1544
|
+
sentBefore: qr(oe)
|
|
1545
|
+
}) : null, ue = {
|
|
1546
|
+
conversationId: y,
|
|
1547
|
+
writeReply: ie === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
|
|
1548
|
+
...le ? { uiCatalogue: le } : {}
|
|
1549
|
+
}, { prompt: de, parts: ke } = bt({
|
|
1550
|
+
content: ne ? `${ne}${te}` : te,
|
|
1539
1551
|
attachments: t,
|
|
1540
|
-
limits:
|
|
1541
|
-
wrapPrompt: (e) =>
|
|
1542
|
-
requestBytes: (e, t) =>
|
|
1552
|
+
limits: ct(ae),
|
|
1553
|
+
wrapPrompt: (e) => bi?.(_, e, Pi, Fi, r, { writeApproval: ie }) ?? e,
|
|
1554
|
+
requestBytes: (e, t) => ve({
|
|
1543
1555
|
sandboxId: i,
|
|
1544
|
-
workspaceId:
|
|
1556
|
+
workspaceId: b,
|
|
1545
1557
|
sessionId: c,
|
|
1546
|
-
mode:
|
|
1558
|
+
mode: _,
|
|
1547
1559
|
prompt: e,
|
|
1548
1560
|
parts: t,
|
|
1549
|
-
pageContext:
|
|
1550
|
-
authContext:
|
|
1551
|
-
...
|
|
1561
|
+
pageContext: re,
|
|
1562
|
+
authContext: ye,
|
|
1563
|
+
...ue
|
|
1552
1564
|
})
|
|
1553
|
-
}),
|
|
1554
|
-
s =
|
|
1555
|
-
let
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1565
|
+
}), Ae = ot(ke), je = Ae > 0;
|
|
1566
|
+
s = at(t) > Ae;
|
|
1567
|
+
let Ne = De();
|
|
1568
|
+
if (Ne.abandon) {
|
|
1569
|
+
Ne.clearProcessing && qi(y);
|
|
1558
1570
|
return;
|
|
1559
1571
|
}
|
|
1560
1572
|
try {
|
|
1561
|
-
await
|
|
1562
|
-
parts:
|
|
1563
|
-
...
|
|
1564
|
-
} :
|
|
1573
|
+
await be(i, b, c, de, _, re, ye, ke?.length ? {
|
|
1574
|
+
parts: ke,
|
|
1575
|
+
...ue
|
|
1576
|
+
} : ue);
|
|
1565
1577
|
} catch (e) {
|
|
1566
|
-
if (!
|
|
1567
|
-
await
|
|
1578
|
+
if (!ke || !hn(e)) throw e;
|
|
1579
|
+
await be(i, b, c, de, _, re, ye, ue), s ||= je;
|
|
1568
1580
|
}
|
|
1569
|
-
|
|
1570
|
-
let
|
|
1571
|
-
|
|
1572
|
-
replyId:
|
|
1573
|
-
conversationId:
|
|
1581
|
+
le && Kr(oe);
|
|
1582
|
+
let Fe = v.getState().sandboxWriteCapabilities[i], Ie = g.options.uiOffers === !0 && Ee(Fe) ? B : null, S = !!Ie;
|
|
1583
|
+
Ie && X.recordTurn({
|
|
1584
|
+
replyId: x,
|
|
1585
|
+
conversationId: y,
|
|
1574
1586
|
sandboxId: i,
|
|
1575
1587
|
sessionId: c,
|
|
1576
|
-
mode:
|
|
1577
|
-
writeCapable:
|
|
1578
|
-
actorId:
|
|
1579
|
-
floorMs:
|
|
1588
|
+
mode: _,
|
|
1589
|
+
writeCapable: ae?.writeCapable === !0,
|
|
1590
|
+
actorId: Ie,
|
|
1591
|
+
floorMs: h
|
|
1580
1592
|
});
|
|
1581
|
-
let
|
|
1582
|
-
X.receive(
|
|
1583
|
-
} : void 0,
|
|
1584
|
-
|
|
1585
|
-
let
|
|
1586
|
-
|
|
1587
|
-
let
|
|
1593
|
+
let We = S ? (e, t) => {
|
|
1594
|
+
X.receive(x, e, t, performance.now()) && Bo();
|
|
1595
|
+
} : void 0, Ge = (e) => Wi(y, x, { content: e }), Ke = (e) => s ? `${e}\n\n${F("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;
|
|
1596
|
+
D(x, "promptSent");
|
|
1597
|
+
let Je = null, Ye = !1, Xe = Xt, w = Zt([], h);
|
|
1598
|
+
C.render?.arm(h);
|
|
1599
|
+
let Ze = Date.now() + ce.streamBudgetMs, Qe = Date.now(), $e = Date.now(), et = fr(() => he(i, b, c, _, ye, {
|
|
1588
1600
|
limit: 50,
|
|
1589
|
-
sinceMs:
|
|
1601
|
+
sinceMs: h,
|
|
1590
1602
|
surfaceTurnTerminal: !0,
|
|
1591
|
-
surfaceUiOffers:
|
|
1592
|
-
})),
|
|
1593
|
-
for (; Date.now() <
|
|
1594
|
-
|
|
1595
|
-
let e =
|
|
1603
|
+
surfaceUiOffers: We
|
|
1604
|
+
})), tt = C.stream?.onIdle(() => et.startExtra());
|
|
1605
|
+
for (; Date.now() < Ze;) {
|
|
1606
|
+
xe(i, c);
|
|
1607
|
+
let e = De();
|
|
1596
1608
|
if (e.abandon) {
|
|
1597
|
-
e.clearProcessing &&
|
|
1609
|
+
e.clearProcessing && qi(y);
|
|
1598
1610
|
return;
|
|
1599
1611
|
}
|
|
1600
|
-
let t = await
|
|
1601
|
-
if (
|
|
1612
|
+
let t = await et.next();
|
|
1613
|
+
if (S && X.observeMessages(x, t) && Bo(), w = Zt(t, h, { accumulateNarration: ce.accumulatesNarration }), Wi(y, x, { content: we(w.content) }), w.hasRenderableOutput ? Ye || (Ye = !0, Je !== null && D(x, "lastQuietPoll", Je), D(x, "firstOutput")) : Je = un(), ce.accumulatesNarration) w.hasText && D(x, "firstText");
|
|
1602
1614
|
else {
|
|
1603
|
-
let e =
|
|
1604
|
-
|
|
1615
|
+
let e = tn(Xe, w, un());
|
|
1616
|
+
Xe = e.tracker, e.confirmedAt !== null && D(x, "firstText", e.confirmedAt);
|
|
1605
1617
|
}
|
|
1606
|
-
if (
|
|
1607
|
-
transport:
|
|
1608
|
-
live:
|
|
1609
|
-
}) :
|
|
1618
|
+
if (w.pendingWrite && !En(v.getState().sandboxWriteCapabilities[i]) && Gi(y, x, { pendingWrite: w.pendingWrite }), w.done && (C.stream ? E(x, {
|
|
1619
|
+
transport: C.stream.reachedOpen ? "sse" : "poll",
|
|
1620
|
+
live: er(C.stream.live)
|
|
1621
|
+
}) : E(x, {
|
|
1610
1622
|
transport: "poll",
|
|
1611
1623
|
live: "none"
|
|
1612
|
-
}),
|
|
1613
|
-
|
|
1624
|
+
}), Ve()), w.done) {
|
|
1625
|
+
D(x, "answerDone"), K.current.markVerified(i);
|
|
1614
1626
|
break;
|
|
1615
1627
|
}
|
|
1616
|
-
if (
|
|
1617
|
-
let e =
|
|
1618
|
-
|
|
1628
|
+
if (C.render?.refresh(t), Date.now() - Qe > 3e4 && (await fe(i, b, 600, ye).catch(() => void 0), Qe = Date.now()), !et.hasPending()) {
|
|
1629
|
+
let e = qe(Date.now() - $e);
|
|
1630
|
+
C.stream ? await C.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
|
|
1619
1631
|
}
|
|
1620
1632
|
}
|
|
1621
|
-
if (
|
|
1622
|
-
let e =
|
|
1623
|
-
e.trim() && (s &&
|
|
1624
|
-
conversationId:
|
|
1633
|
+
if (tt?.(), He(), w.done && n.voiceSessionId !== void 0 && !De().abandon) {
|
|
1634
|
+
let e = we(Ke(w.content));
|
|
1635
|
+
e.trim() && (s && Ge(e), D(x, "speechQueued"), Ue = !0, Be.publish(x, {
|
|
1636
|
+
conversationId: y,
|
|
1625
1637
|
channel: "voice",
|
|
1626
1638
|
voiceSessionId: n.voiceSessionId,
|
|
1627
1639
|
text: e,
|
|
1628
|
-
lang:
|
|
1640
|
+
lang: Ii,
|
|
1629
1641
|
final: !0
|
|
1630
1642
|
}));
|
|
1631
1643
|
}
|
|
1632
|
-
let
|
|
1633
|
-
|
|
1634
|
-
...
|
|
1635
|
-
content:
|
|
1636
|
-
}), s && (
|
|
1637
|
-
...
|
|
1638
|
-
content:
|
|
1644
|
+
let nt = ce.producesArtifacts ? await me(i, b, c, _, ye).then((e) => e).catch(() => []) : void 0;
|
|
1645
|
+
w.usedTools !== void 0 && E(x, { usedTools: w.usedTools }), w.done || (E(x, { outcome: "timedOut" }), w = {
|
|
1646
|
+
...w,
|
|
1647
|
+
content: Le(w.content, _, F, ae)
|
|
1648
|
+
}), s && (w = {
|
|
1649
|
+
...w,
|
|
1650
|
+
content: Ke(w.content)
|
|
1639
1651
|
});
|
|
1640
|
-
let
|
|
1641
|
-
|
|
1642
|
-
workspaceId:
|
|
1652
|
+
let rt = !w.done;
|
|
1653
|
+
Re(w.content, nt, c, i, rt), w.tokens && (Wi(y, x, { tokens: w.tokens }), (Si ? await Pe({
|
|
1654
|
+
workspaceId: b,
|
|
1643
1655
|
sessionId: c,
|
|
1644
|
-
messageId:
|
|
1645
|
-
model:
|
|
1646
|
-
tokens:
|
|
1647
|
-
},
|
|
1648
|
-
let it =
|
|
1656
|
+
messageId: w.messageId,
|
|
1657
|
+
model: w.model,
|
|
1658
|
+
tokens: w.tokens
|
|
1659
|
+
}, Si, { ledger: Me("panel", I) }) : { ok: !0 }).ok && ti(I)), w.done || xe(i, c);
|
|
1660
|
+
let it = De();
|
|
1649
1661
|
if (it.abandon) {
|
|
1650
|
-
it.clearProcessing &&
|
|
1662
|
+
it.clearProcessing && qi(y);
|
|
1651
1663
|
return;
|
|
1652
1664
|
}
|
|
1653
|
-
|
|
1654
|
-
replyId:
|
|
1655
|
-
conversationId:
|
|
1665
|
+
D(x, "complete"), E(x, { outcome: "answered" }), Ki(y, "complete", x, null), Un.recordCommittedEntries(y, [Se.id, x], "TURN", b), Ue = !1, S && Ce && w.done && Xo({
|
|
1666
|
+
replyId: x,
|
|
1667
|
+
conversationId: y,
|
|
1656
1668
|
voiceSessionId: n.voiceSessionId,
|
|
1657
|
-
intent:
|
|
1658
|
-
atSend:
|
|
1669
|
+
intent: Ce,
|
|
1670
|
+
atSend: Te
|
|
1659
1671
|
});
|
|
1660
1672
|
} catch (e) {
|
|
1661
|
-
K.current.invalidate(a ??
|
|
1662
|
-
let t =
|
|
1663
|
-
turnId:
|
|
1664
|
-
abortRequested:
|
|
1665
|
-
activeTurnId:
|
|
1666
|
-
conversationExists:
|
|
1673
|
+
K.current.invalidate(a ?? v.getState().sandboxesByMode[_]?.sandboxId ?? null);
|
|
1674
|
+
let t = kt({
|
|
1675
|
+
turnId: x,
|
|
1676
|
+
abortRequested: go.current.has(x),
|
|
1677
|
+
activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
|
|
1678
|
+
conversationExists: pe()
|
|
1667
1679
|
});
|
|
1668
|
-
if (
|
|
1669
|
-
t.clearProcessing &&
|
|
1680
|
+
if (Ve(), a && o && xe(a, o), t.abandon) {
|
|
1681
|
+
t.clearProcessing && qi(y);
|
|
1670
1682
|
return;
|
|
1671
1683
|
}
|
|
1672
|
-
if (i === 1 &&
|
|
1673
|
-
let e = a ??
|
|
1674
|
-
return e && (q.current.add(e), K.current.invalidate(e)),
|
|
1684
|
+
if (i === 1 && gn(e)) {
|
|
1685
|
+
let e = a ?? v.getState().sandboxesByMode[_]?.sandboxId ?? null;
|
|
1686
|
+
return e && (q.current.add(e), K.current.invalidate(e)), Yi(y), Zi(_), Ui(y, x, ""), Gi(y, x, { pendingWrite: void 0 }), e && G.retireSandbox(e), He(), We(), ln(x), Ge(2);
|
|
1675
1687
|
}
|
|
1676
1688
|
throw e;
|
|
1677
1689
|
}
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1690
|
+
}, Ke = y;
|
|
1691
|
+
no.current.add(Ke);
|
|
1680
1692
|
try {
|
|
1681
|
-
if (!
|
|
1693
|
+
if (!b) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
1682
1694
|
code: "UNAUTHENTICATED",
|
|
1683
1695
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
1684
1696
|
} });
|
|
1685
|
-
let e = await
|
|
1686
|
-
|
|
1687
|
-
let t =
|
|
1697
|
+
let e = await yt(_, () => Da.current.find((e) => e.id === _), Ea);
|
|
1698
|
+
ae = e.config, ce = e.capabilities;
|
|
1699
|
+
let t = ae, n = De();
|
|
1688
1700
|
if (n.abandon) {
|
|
1689
|
-
n.clearProcessing &&
|
|
1701
|
+
n.clearProcessing && qi(y);
|
|
1690
1702
|
return;
|
|
1691
1703
|
}
|
|
1692
|
-
let i =
|
|
1704
|
+
let i = se(_, t, v.getState().acknowledgedWriteModes, {
|
|
1693
1705
|
dictated: r,
|
|
1694
|
-
confirmsWrites:
|
|
1695
|
-
proposalBound:
|
|
1706
|
+
confirmsWrites: _e(_),
|
|
1707
|
+
proposalBound: wi(_)
|
|
1696
1708
|
});
|
|
1697
|
-
if (i) throw new
|
|
1698
|
-
let a =
|
|
1699
|
-
if (
|
|
1700
|
-
let e = await
|
|
1701
|
-
if (!e.ok) throw
|
|
1702
|
-
let t =
|
|
1709
|
+
if (i) throw new Oe(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
1710
|
+
let a = Me("panel", I);
|
|
1711
|
+
if (Si && Ne(a, b)) {
|
|
1712
|
+
let e = await Fe(a, b, Si);
|
|
1713
|
+
if (!e.ok) throw Ie(e.kind);
|
|
1714
|
+
let t = De();
|
|
1703
1715
|
if (t.abandon) {
|
|
1704
|
-
t.clearProcessing &&
|
|
1716
|
+
t.clearProcessing && qi(y);
|
|
1705
1717
|
return;
|
|
1706
1718
|
}
|
|
1707
1719
|
}
|
|
1708
|
-
|
|
1720
|
+
D(x, "cleared"), await Ge();
|
|
1709
1721
|
} catch (e) {
|
|
1710
|
-
if (K.current.invalidate(
|
|
1711
|
-
|
|
1722
|
+
if (K.current.invalidate(v.getState().sandboxesByMode[_]?.sandboxId ?? null), !pe()) {
|
|
1723
|
+
qi(y);
|
|
1712
1724
|
return;
|
|
1713
1725
|
}
|
|
1714
|
-
let t =
|
|
1715
|
-
mode:
|
|
1716
|
-
capabilities: t ?
|
|
1726
|
+
let t = ze.session?.sandboxId ?? null, r = ke(e, { confirmsNoAction: Ae({
|
|
1727
|
+
mode: _,
|
|
1728
|
+
capabilities: t ? v.getState().sandboxWriteCapabilities[t] : null
|
|
1717
1729
|
}) });
|
|
1718
|
-
|
|
1719
|
-
let i =
|
|
1720
|
-
|
|
1730
|
+
E(x, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && ei(I, "sandbox");
|
|
1731
|
+
let i = je(r, F, { locale: V });
|
|
1732
|
+
Ki(y, "error", x, i.headline), Wi(y, x, { content: i.text }), Gi(y, x, {
|
|
1721
1733
|
lang: i.translated ? V : "en",
|
|
1722
|
-
...
|
|
1734
|
+
...S(n.voiceSessionId)
|
|
1723
1735
|
});
|
|
1724
1736
|
} finally {
|
|
1725
|
-
|
|
1726
|
-
let e =
|
|
1727
|
-
t && (
|
|
1728
|
-
...
|
|
1729
|
-
conversationId:
|
|
1730
|
-
},
|
|
1731
|
-
let n =
|
|
1732
|
-
|
|
1737
|
+
no.current.delete(Ke), E(x, { outcome: "stopped" }), D(x, "complete"), We(), He();
|
|
1738
|
+
let e = v.getState(), t = d(de, _, e.conversations.find((e) => e.id === Ke), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
1739
|
+
t && (na(Ke, t.mode), t.backendSessionId && Ji(Ke, t.backendSessionId)), ze.session && pe() && G.afterTurn({
|
|
1740
|
+
...ze.session,
|
|
1741
|
+
conversationId: Ke
|
|
1742
|
+
}, x);
|
|
1743
|
+
let n = _o.current;
|
|
1744
|
+
_o.current = null, n && n.conversationId === Ke && pe() && gs.current(n.content, n.attachments, n.options);
|
|
1733
1745
|
}
|
|
1734
1746
|
}, [
|
|
1735
1747
|
H,
|
|
1736
1748
|
W,
|
|
1737
|
-
|
|
1738
|
-
|
|
1749
|
+
bi,
|
|
1750
|
+
Yi,
|
|
1751
|
+
Zi,
|
|
1752
|
+
Li,
|
|
1739
1753
|
Hi,
|
|
1740
|
-
|
|
1741
|
-
Ni,
|
|
1742
|
-
Ya,
|
|
1754
|
+
lo,
|
|
1743
1755
|
G,
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1756
|
+
yo,
|
|
1757
|
+
ns,
|
|
1758
|
+
fs,
|
|
1747
1759
|
V,
|
|
1760
|
+
Ni,
|
|
1748
1761
|
wi,
|
|
1749
|
-
|
|
1750
|
-
ui,
|
|
1762
|
+
yi,
|
|
1751
1763
|
z,
|
|
1752
|
-
|
|
1753
|
-
|
|
1764
|
+
Ti,
|
|
1765
|
+
Wi,
|
|
1754
1766
|
I,
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1767
|
+
Ea,
|
|
1768
|
+
Si,
|
|
1769
|
+
Fi,
|
|
1758
1770
|
V,
|
|
1759
|
-
|
|
1760
|
-
|
|
1771
|
+
Ii,
|
|
1772
|
+
Pi,
|
|
1773
|
+
na,
|
|
1774
|
+
ds,
|
|
1775
|
+
Qo,
|
|
1776
|
+
$a,
|
|
1777
|
+
eo,
|
|
1778
|
+
Ji,
|
|
1779
|
+
Bi,
|
|
1780
|
+
Ki,
|
|
1761
1781
|
qi,
|
|
1762
|
-
Zo,
|
|
1763
|
-
Ro,
|
|
1764
|
-
za,
|
|
1765
|
-
Ba,
|
|
1766
|
-
zi,
|
|
1767
|
-
ji,
|
|
1768
|
-
Li,
|
|
1769
|
-
Ri,
|
|
1770
1782
|
F,
|
|
1771
|
-
|
|
1772
|
-
|
|
1783
|
+
so,
|
|
1784
|
+
Ui,
|
|
1773
1785
|
B,
|
|
1774
1786
|
X,
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
]),
|
|
1787
|
+
Bo,
|
|
1788
|
+
ts,
|
|
1789
|
+
Xo
|
|
1790
|
+
]), ps = O((e, t) => {
|
|
1779
1791
|
Z(e, [], t ? { autoIntent: t } : {});
|
|
1780
|
-
}, [Z]),
|
|
1781
|
-
let e = [...
|
|
1792
|
+
}, [Z]), ms = Dt(), hs = O(() => {
|
|
1793
|
+
let e = [...ia.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
1782
1794
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
1783
|
-
let t = H ?
|
|
1784
|
-
if (t.some((e) =>
|
|
1795
|
+
let t = H ? to.current[H] ?? [] : [];
|
|
1796
|
+
if (t.some((e) => St(e, Date.now()))) {
|
|
1785
1797
|
let n = H ?? void 0;
|
|
1786
|
-
|
|
1798
|
+
Ct(t, ms).then((t) => {
|
|
1787
1799
|
Z(e.content, t, n === void 0 ? void 0 : { targetConversationId: n });
|
|
1788
1800
|
});
|
|
1789
1801
|
return;
|
|
1790
1802
|
}
|
|
1791
1803
|
Z(e.content, t);
|
|
1792
1804
|
}, [
|
|
1793
|
-
|
|
1805
|
+
aa,
|
|
1794
1806
|
Z,
|
|
1795
1807
|
H,
|
|
1796
|
-
|
|
1797
|
-
]),
|
|
1798
|
-
|
|
1799
|
-
|
|
1808
|
+
ms
|
|
1809
|
+
]), gs = j(Z);
|
|
1810
|
+
k(() => {
|
|
1811
|
+
gs.current = Z;
|
|
1800
1812
|
}, [Z]);
|
|
1801
|
-
let
|
|
1802
|
-
if (
|
|
1803
|
-
for (let e =
|
|
1804
|
-
let t =
|
|
1813
|
+
let _s = A(() => {
|
|
1814
|
+
if (sa) return null;
|
|
1815
|
+
for (let e = aa.length - 1; e >= 0; --e) {
|
|
1816
|
+
let t = aa[e];
|
|
1805
1817
|
if (t?.role !== "assistant") continue;
|
|
1806
|
-
if (t.id ===
|
|
1807
|
-
if (!
|
|
1808
|
-
let n =
|
|
1818
|
+
if (t.id === Ao) return null;
|
|
1819
|
+
if (!ze(t) || go.current.has(t.id) || He(t.id)) continue;
|
|
1820
|
+
let n = Yt(t, oa, F);
|
|
1809
1821
|
if (n.kind !== "output") return null;
|
|
1810
|
-
let r =
|
|
1811
|
-
return r ?
|
|
1812
|
-
id: t.id,
|
|
1813
|
-
text: r
|
|
1814
|
-
} : null;
|
|
1822
|
+
let r = nn(n.text).text.trim();
|
|
1823
|
+
return r ? Ve(t, r, oa) : null;
|
|
1815
1824
|
}
|
|
1816
1825
|
return null;
|
|
1817
1826
|
}, [
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1827
|
+
aa,
|
|
1828
|
+
sa,
|
|
1829
|
+
oa,
|
|
1830
|
+
Ao,
|
|
1822
1831
|
F
|
|
1823
|
-
]),
|
|
1824
|
-
sessionId:
|
|
1825
|
-
sandboxId:
|
|
1832
|
+
]), vs = A(() => _s ? Je(_s.text) : null, [_s]), ys = A(() => ia.chat.filter((e) => e.id !== Ao), [ia.chat, Ao]), bs = v((e) => ce(e)?.sandboxId ?? null), xs = g(ys, {
|
|
1833
|
+
sessionId: ra?.backendSessionId,
|
|
1834
|
+
sandboxId: bs,
|
|
1826
1835
|
nowMs: Date.now()
|
|
1827
|
-
}),
|
|
1828
|
-
if (
|
|
1836
|
+
}), Ss = _(ys), Cs = (e) => {
|
|
1837
|
+
if (Tn(e.metadata).length > 0) return !0;
|
|
1829
1838
|
let t = e.metadata?.sandboxId;
|
|
1830
|
-
return
|
|
1831
|
-
},
|
|
1832
|
-
let t =
|
|
1833
|
-
return t.length === 0 || !H ? null : /* @__PURE__ */ N(
|
|
1839
|
+
return En(t ? ua[t] : null);
|
|
1840
|
+
}, ws = (e) => {
|
|
1841
|
+
let t = Tn(e.metadata);
|
|
1842
|
+
return t.length === 0 || !H ? null : /* @__PURE__ */ N(wn, {
|
|
1834
1843
|
refs: t,
|
|
1835
1844
|
conversationId: H,
|
|
1836
1845
|
panel: G,
|
|
1837
|
-
entries:
|
|
1838
|
-
capabilitiesOf: (e) =>
|
|
1839
|
-
turnInFlight:
|
|
1846
|
+
entries: da,
|
|
1847
|
+
capabilitiesOf: (e) => ua[e],
|
|
1848
|
+
turnInFlight: sa,
|
|
1840
1849
|
tr: F,
|
|
1841
|
-
onReview:
|
|
1842
|
-
retiredSandboxes:
|
|
1850
|
+
onReview: pa.review,
|
|
1851
|
+
retiredSandboxes: fa
|
|
1843
1852
|
});
|
|
1844
|
-
},
|
|
1853
|
+
}, Ts = (e) => {
|
|
1845
1854
|
if (!H) return null;
|
|
1846
1855
|
let t = X.liveOffersFor(e, {
|
|
1847
1856
|
registry: {
|
|
1848
|
-
destinations:
|
|
1849
|
-
permissionsSettled:
|
|
1850
|
-
simulating:
|
|
1857
|
+
destinations: jr(To),
|
|
1858
|
+
permissionsSettled: Eo,
|
|
1859
|
+
simulating: Do
|
|
1851
1860
|
},
|
|
1852
1861
|
actorId: B,
|
|
1853
1862
|
conversationId: H,
|
|
1854
1863
|
perfNow: performance.now()
|
|
1855
1864
|
}), n = t[0];
|
|
1856
|
-
return n ? /* @__PURE__ */ N(
|
|
1865
|
+
return n ? /* @__PURE__ */ N(rr, {
|
|
1857
1866
|
offers: t.map(({ offer: e, target: t }) => ({
|
|
1858
1867
|
offerId: e.offerId,
|
|
1859
1868
|
label: t.label,
|
|
1860
1869
|
path: t.path
|
|
1861
1870
|
})),
|
|
1862
|
-
hint: t.length === 1 && R === "proposal-v1" ?
|
|
1863
|
-
onOpen:
|
|
1871
|
+
hint: t.length === 1 && R === "proposal-v1" ? x(n.offer, X.turnFor(e)) : "link",
|
|
1872
|
+
onOpen: Yo
|
|
1864
1873
|
}, n.offer.offerId) : null;
|
|
1865
|
-
},
|
|
1866
|
-
|
|
1874
|
+
}, Es = (e) => e.role === "assistant" ? Ts(e.id) : null;
|
|
1875
|
+
k(() => {
|
|
1867
1876
|
let e = X.nextExpiryInMs(performance.now());
|
|
1868
1877
|
if (e === null) return;
|
|
1869
|
-
let t = window.setTimeout(
|
|
1878
|
+
let t = window.setTimeout(Bo, e + 1);
|
|
1870
1879
|
return () => window.clearTimeout(t);
|
|
1871
1880
|
}, [
|
|
1872
1881
|
X,
|
|
1873
|
-
|
|
1874
|
-
|
|
1882
|
+
Ro,
|
|
1883
|
+
Bo
|
|
1875
1884
|
]);
|
|
1876
|
-
let
|
|
1877
|
-
|
|
1878
|
-
if (
|
|
1879
|
-
let e = window.setTimeout(() =>
|
|
1885
|
+
let Ds = pa.dialog.view ? da[pa.dialog.view.proposalId] : void 0, Os = xs?.expiresAtMs ?? null;
|
|
1886
|
+
k(() => {
|
|
1887
|
+
if (Os === null) return;
|
|
1888
|
+
let e = window.setTimeout(() => ho((e) => e + 1), Math.max(0, Os - Date.now()));
|
|
1880
1889
|
return () => window.clearTimeout(e);
|
|
1881
|
-
}, [
|
|
1882
|
-
let Q =
|
|
1890
|
+
}, [Os, mo]);
|
|
1891
|
+
let Q = A(() => ia.voice.filter((e) => e.id !== Ao && (e.role === "user" || e.role === "assistant")).map((e) => ({
|
|
1883
1892
|
id: e.id,
|
|
1884
1893
|
role: e.role,
|
|
1885
|
-
text:
|
|
1886
|
-
sessionId:
|
|
1894
|
+
text: on(e, oa, F),
|
|
1895
|
+
sessionId: C(e),
|
|
1887
1896
|
timestamp: e.timestamp
|
|
1888
1897
|
})).filter((e) => e.text.length > 0), [
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1898
|
+
ia.voice,
|
|
1899
|
+
oa,
|
|
1900
|
+
Ao,
|
|
1892
1901
|
F
|
|
1893
|
-
]),
|
|
1902
|
+
]), ks = O(() => {
|
|
1894
1903
|
if (Q.length === 0) return;
|
|
1895
1904
|
let e = /* @__PURE__ */ new Date();
|
|
1896
|
-
|
|
1905
|
+
Ln(Ge(Q, {
|
|
1897
1906
|
title: F("voiceSession.transcript", "Voice conversation"),
|
|
1898
1907
|
savedAt: F("voiceSession.savedAt", "Saved"),
|
|
1899
1908
|
session: F("voiceSession.sessionLabel", "Session"),
|
|
1900
1909
|
earlier: F("voiceSession.earlierLabel", "Earlier"),
|
|
1901
1910
|
you: F("voiceSession.speakerYou", "You"),
|
|
1902
1911
|
assistant: F("voiceSession.speakerAssistant", "Assistant")
|
|
1903
|
-
}, e),
|
|
1912
|
+
}, e), Ke(I, e), "text/markdown");
|
|
1904
1913
|
}, [
|
|
1905
1914
|
I,
|
|
1906
1915
|
Q,
|
|
1907
1916
|
F
|
|
1908
|
-
]),
|
|
1909
|
-
|
|
1910
|
-
let [
|
|
1911
|
-
|
|
1912
|
-
if (
|
|
1913
|
-
let e = window.setTimeout(() =>
|
|
1917
|
+
]), As = ni({ perFileChars: Ra }), js = j(As);
|
|
1918
|
+
js.current = As;
|
|
1919
|
+
let [Ms, Ns] = M(null), Ps = Ms === null ? null : F("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: Ms });
|
|
1920
|
+
k(() => {
|
|
1921
|
+
if (Ms === null) return;
|
|
1922
|
+
let e = window.setTimeout(() => Ns(null), pi);
|
|
1914
1923
|
return () => window.clearTimeout(e);
|
|
1915
|
-
}, [
|
|
1916
|
-
let
|
|
1917
|
-
onSubmit:
|
|
1918
|
-
let i =
|
|
1919
|
-
let e =
|
|
1920
|
-
return
|
|
1921
|
-
sessionLive:
|
|
1924
|
+
}, [Ms]);
|
|
1925
|
+
let Fs = j(/* @__PURE__ */ new Set()), Is = j(() => !1), $ = mn({
|
|
1926
|
+
onSubmit: O((e, t, n, r) => {
|
|
1927
|
+
let i = Xa.current, a = it(i), o = () => {
|
|
1928
|
+
let e = v.getState();
|
|
1929
|
+
return Qe({
|
|
1930
|
+
sessionLive: Is.current(t),
|
|
1922
1931
|
boundAtSubmit: i,
|
|
1923
1932
|
activeConversationId: e.activeConversationId,
|
|
1924
1933
|
boundConversationExists: e.conversations.some((e) => e.id === a)
|
|
1925
1934
|
});
|
|
1926
1935
|
}, s = () => {
|
|
1927
|
-
let i =
|
|
1928
|
-
|
|
1936
|
+
let i = js.current;
|
|
1937
|
+
Tt({
|
|
1929
1938
|
draft: i,
|
|
1930
1939
|
maySend: o,
|
|
1931
|
-
budgetMs:
|
|
1940
|
+
budgetMs: wt,
|
|
1932
1941
|
sendTurn: (i) => {
|
|
1933
1942
|
let a = {
|
|
1934
1943
|
...n,
|
|
1935
|
-
handedOver:
|
|
1944
|
+
handedOver: un()
|
|
1936
1945
|
};
|
|
1937
|
-
|
|
1946
|
+
gs.current(e, i, {
|
|
1938
1947
|
fromPerson: !0,
|
|
1939
1948
|
voiceSessionId: t,
|
|
1940
1949
|
voiceTiming: a,
|
|
1941
1950
|
...r.correction ? { correctsInFlightTurn: !0 } : {}
|
|
1942
1951
|
});
|
|
1943
1952
|
},
|
|
1944
|
-
announceDropped: (e) =>
|
|
1953
|
+
announceDropped: (e) => Ns(e)
|
|
1945
1954
|
});
|
|
1946
1955
|
};
|
|
1947
|
-
if (o() &&
|
|
1948
|
-
|
|
1956
|
+
if (o() && es.current(e, t)) {
|
|
1957
|
+
gs.current(e, [], {
|
|
1949
1958
|
fromPerson: !0,
|
|
1950
1959
|
voiceSessionId: t,
|
|
1951
1960
|
voiceTiming: {
|
|
1952
1961
|
...n,
|
|
1953
|
-
handedOver:
|
|
1962
|
+
handedOver: un()
|
|
1954
1963
|
}
|
|
1955
1964
|
});
|
|
1956
1965
|
return;
|
|
1957
1966
|
}
|
|
1958
|
-
if (!
|
|
1967
|
+
if (!js.current.isBusy) {
|
|
1959
1968
|
s();
|
|
1960
1969
|
return;
|
|
1961
1970
|
}
|
|
1962
|
-
let c = Date.now(), l =
|
|
1963
|
-
let e =
|
|
1964
|
-
|
|
1971
|
+
let c = Date.now(), l = Fs.current, u = window.setInterval(() => {
|
|
1972
|
+
let e = js.current.isBusy;
|
|
1973
|
+
js.current.isCommitting || e && Date.now() - c < fi || (window.clearInterval(u), l.delete(u), s());
|
|
1965
1974
|
}, 200);
|
|
1966
1975
|
l.add(u);
|
|
1967
1976
|
}, []),
|
|
1968
|
-
latestReply:
|
|
1969
|
-
language:
|
|
1970
|
-
graceMs:
|
|
1971
|
-
onSupersede:
|
|
1972
|
-
handsFreeStreamNoticeAccepted:
|
|
1973
|
-
onAcceptHandsFreeStreamNotice:
|
|
1974
|
-
handsFreeInterrupt:
|
|
1975
|
-
onBargeIn:
|
|
1977
|
+
latestReply: _s,
|
|
1978
|
+
language: Ye(ji, V).tag,
|
|
1979
|
+
graceMs: Di,
|
|
1980
|
+
onSupersede: bo,
|
|
1981
|
+
handsFreeStreamNoticeAccepted: ki,
|
|
1982
|
+
onAcceptHandsFreeStreamNotice: Ai,
|
|
1983
|
+
handsFreeInterrupt: Oi,
|
|
1984
|
+
onBargeIn: yo
|
|
1976
1985
|
});
|
|
1977
|
-
|
|
1978
|
-
let
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
}, [
|
|
1982
|
-
let
|
|
1983
|
-
|
|
1986
|
+
Is.current = $.isCurrentSession;
|
|
1987
|
+
let Ls = Za ? Q.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : Q, Rs = $.answerLocally;
|
|
1988
|
+
k(() => {
|
|
1989
|
+
os.current = Rs;
|
|
1990
|
+
}, [Rs]);
|
|
1991
|
+
let zs = $.active, Bs = A(() => ht(Object.values(da), H, fa), [
|
|
1992
|
+
da,
|
|
1984
1993
|
H,
|
|
1985
|
-
|
|
1986
|
-
]), [
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
}, [
|
|
1990
|
-
let
|
|
1991
|
-
let e =
|
|
1994
|
+
fa
|
|
1995
|
+
]), [Vs, Hs] = M(null);
|
|
1996
|
+
k(() => {
|
|
1997
|
+
zs || Hs(null);
|
|
1998
|
+
}, [zs]);
|
|
1999
|
+
let Us = pa.review, Ws = O(() => {
|
|
2000
|
+
let e = Bs[Bs.length - 1];
|
|
1992
2001
|
if (!e) return;
|
|
1993
2002
|
let { view: t } = e;
|
|
1994
|
-
if (
|
|
1995
|
-
|
|
2003
|
+
if (xn(t) && bn(t, ua[e.session.sandboxId]).offerConfirm) {
|
|
2004
|
+
Us(t);
|
|
1996
2005
|
return;
|
|
1997
2006
|
}
|
|
1998
|
-
|
|
2007
|
+
Hs(t.proposalId);
|
|
1999
2008
|
}, [
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
]),
|
|
2004
|
-
content: /* @__PURE__ */ N(
|
|
2009
|
+
Bs,
|
|
2010
|
+
ua,
|
|
2011
|
+
Us
|
|
2012
|
+
]), Gs = zs ? ft(Bs) : null, Ks = Vs ? da[Vs] : void 0, qs = zs && Ks && Ks.session.conversationId === H ? {
|
|
2013
|
+
content: /* @__PURE__ */ N(wn, {
|
|
2005
2014
|
refs: [{
|
|
2006
|
-
proposalId:
|
|
2007
|
-
sandboxId:
|
|
2008
|
-
sessionId:
|
|
2015
|
+
proposalId: Ks.view.proposalId,
|
|
2016
|
+
sandboxId: Ks.session.sandboxId,
|
|
2017
|
+
sessionId: Ks.session.sessionId
|
|
2009
2018
|
}],
|
|
2010
|
-
conversationId:
|
|
2019
|
+
conversationId: Ks.session.conversationId,
|
|
2011
2020
|
panel: G,
|
|
2012
|
-
entries:
|
|
2013
|
-
capabilitiesOf: (e) =>
|
|
2014
|
-
turnInFlight:
|
|
2021
|
+
entries: da,
|
|
2022
|
+
capabilitiesOf: (e) => ua[e],
|
|
2023
|
+
turnInFlight: sa,
|
|
2015
2024
|
tr: F,
|
|
2016
|
-
onReview:
|
|
2017
|
-
retiredSandboxes:
|
|
2025
|
+
onReview: Us,
|
|
2026
|
+
retiredSandboxes: fa
|
|
2018
2027
|
}),
|
|
2019
|
-
closeLabel:
|
|
2020
|
-
onClose: () =>
|
|
2021
|
-
} : null,
|
|
2022
|
-
r("assistant.transcript",
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
])), r("assistant.conversation.new",
|
|
2027
|
-
let e =
|
|
2028
|
+
closeLabel: gt(F, ut.trayClose),
|
|
2029
|
+
onClose: () => Hs(null)
|
|
2030
|
+
} : null, Js = pa.asking, Ys = rs?.asking === !0, Xs = is?.asking === !0, Zs = Yn(), Qs = $.holdListening;
|
|
2031
|
+
r("assistant.transcript", A(() => zs ? null : { run: () => Ua ? { status: "already" } : (Ya(!0), { status: "done" }) }, [
|
|
2032
|
+
zs,
|
|
2033
|
+
Ua,
|
|
2034
|
+
Ya
|
|
2035
|
+
])), r("assistant.conversation.new", A(() => zs ? null : { run: () => {
|
|
2036
|
+
let e = v.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
|
|
2028
2037
|
return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
|
|
2029
|
-
} }, [
|
|
2030
|
-
|
|
2038
|
+
} }, [zs])), k(() => {
|
|
2039
|
+
Qs(zs && (Js || Ys || Xs || Zs));
|
|
2031
2040
|
}, [
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2041
|
+
zs,
|
|
2042
|
+
Js,
|
|
2043
|
+
Ys,
|
|
2044
|
+
Xs,
|
|
2045
|
+
Zs,
|
|
2046
|
+
Qs
|
|
2038
2047
|
]);
|
|
2039
|
-
let
|
|
2040
|
-
|
|
2041
|
-
if (!
|
|
2042
|
-
|
|
2048
|
+
let $s = j(null), ec = $.announce;
|
|
2049
|
+
k(() => {
|
|
2050
|
+
if (!zs) {
|
|
2051
|
+
$s.current = null;
|
|
2043
2052
|
return;
|
|
2044
2053
|
}
|
|
2045
|
-
let e =
|
|
2054
|
+
let e = $s.current;
|
|
2046
2055
|
if (e === null) {
|
|
2047
|
-
|
|
2056
|
+
$s.current = new Set(Object.keys(da));
|
|
2048
2057
|
return;
|
|
2049
2058
|
}
|
|
2050
|
-
for (let { view: t, session: n } of
|
|
2059
|
+
for (let { view: t, session: n } of mt(Bs, e)) {
|
|
2051
2060
|
e.add(t.proposalId);
|
|
2052
|
-
let r =
|
|
2053
|
-
if (!
|
|
2061
|
+
let r = ua[n.sandboxId];
|
|
2062
|
+
if (!dt({
|
|
2054
2063
|
mode: "api-calls",
|
|
2055
2064
|
productWriteApproval: R,
|
|
2056
2065
|
capabilities: r
|
|
2057
2066
|
})) continue;
|
|
2058
|
-
let i =
|
|
2059
|
-
|
|
2067
|
+
let i = _t(t, bn(t, r).offerConfirm, F), a = t.proposalId;
|
|
2068
|
+
ec({
|
|
2060
2069
|
id: `write-readback:${a}`,
|
|
2061
2070
|
text: i.text,
|
|
2062
2071
|
lang: i.translated ? V : "en",
|
|
@@ -2064,290 +2073,339 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
2064
2073
|
});
|
|
2065
2074
|
}
|
|
2066
2075
|
}, [
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2076
|
+
zs,
|
|
2077
|
+
Bs,
|
|
2078
|
+
da,
|
|
2079
|
+
ua,
|
|
2071
2080
|
R,
|
|
2072
2081
|
F,
|
|
2073
2082
|
V,
|
|
2074
|
-
|
|
2083
|
+
ec,
|
|
2075
2084
|
G
|
|
2076
2085
|
]);
|
|
2077
|
-
let
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
}, [$.active]),
|
|
2081
|
-
if (!
|
|
2082
|
-
let t =
|
|
2083
|
-
return typeof t == "string" ? t === e :
|
|
2086
|
+
let tc = j(!1);
|
|
2087
|
+
k(() => {
|
|
2088
|
+
tc.current = $.active;
|
|
2089
|
+
}, [$.active]), k(() => m((e) => {
|
|
2090
|
+
if (!tc.current) return !1;
|
|
2091
|
+
let t = Xa.current;
|
|
2092
|
+
return typeof t == "string" ? t === e : v.getState().activeConversationId === e;
|
|
2084
2093
|
}), []);
|
|
2085
|
-
let
|
|
2086
|
-
let e =
|
|
2087
|
-
|
|
2094
|
+
let nc = $.start, rc = O(() => {
|
|
2095
|
+
let e = v.getState().activeConversationId, t = tt(eo());
|
|
2096
|
+
$a(rt(t, e)), uo(!0, t.kind === "own"), nc();
|
|
2088
2097
|
}, [
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
]),
|
|
2094
|
-
let e =
|
|
2098
|
+
$a,
|
|
2099
|
+
uo,
|
|
2100
|
+
eo,
|
|
2101
|
+
nc
|
|
2102
|
+
]), ic = A(() => an(ra?.messages ?? []), [ra?.messages]), ac = rn(ia.voice, oa, F), oc = rn(ic, oa, F) > 0, sc = O(() => {
|
|
2103
|
+
let e = v.getState().activeConversationId;
|
|
2095
2104
|
if (!e || Q.length === 0) return;
|
|
2096
|
-
let t = new Set(
|
|
2105
|
+
let t = new Set(ic.map((e) => e.id)), n = P();
|
|
2097
2106
|
W(e, {
|
|
2098
2107
|
id: n,
|
|
2099
2108
|
role: "system",
|
|
2100
|
-
content:
|
|
2109
|
+
content: We(Q.filter((e) => t.has(e.id)), {
|
|
2101
2110
|
intro: F("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
2102
2111
|
nothing: F("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
2103
2112
|
more: (e) => F("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
2104
2113
|
}),
|
|
2105
2114
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2106
|
-
metadata: { continuedVoiceTurns:
|
|
2107
|
-
}),
|
|
2115
|
+
metadata: { continuedVoiceTurns: ac }
|
|
2116
|
+
}), Un.recordCommittedEntries(e, [n], "NOTE", T()), Ya(!1), $.end(), qa();
|
|
2108
2117
|
}, [
|
|
2109
2118
|
Q,
|
|
2110
|
-
|
|
2111
|
-
|
|
2119
|
+
ac,
|
|
2120
|
+
ic,
|
|
2112
2121
|
W,
|
|
2113
2122
|
F,
|
|
2114
2123
|
$,
|
|
2115
|
-
|
|
2116
|
-
|
|
2124
|
+
Ya,
|
|
2125
|
+
qa
|
|
2126
|
+
]), cc = j({
|
|
2117
2127
|
conversationId: null,
|
|
2118
2128
|
count: 0
|
|
2119
2129
|
});
|
|
2120
|
-
|
|
2121
|
-
$.active && (
|
|
2130
|
+
k(() => {
|
|
2131
|
+
$.active && (cc.current = {
|
|
2122
2132
|
conversationId: H,
|
|
2123
|
-
count:
|
|
2133
|
+
count: ac
|
|
2124
2134
|
});
|
|
2125
2135
|
}, [$.active]);
|
|
2126
|
-
let
|
|
2127
|
-
let e =
|
|
2128
|
-
$.end(), t &&
|
|
2136
|
+
let lc = O(() => {
|
|
2137
|
+
let e = cc.current, t = ac > (e.conversationId === H ? e.count : 0);
|
|
2138
|
+
$.end(), t && Ya(!0);
|
|
2129
2139
|
}, [
|
|
2130
2140
|
H,
|
|
2131
|
-
|
|
2141
|
+
ac,
|
|
2132
2142
|
$,
|
|
2133
|
-
|
|
2143
|
+
Ya
|
|
2134
2144
|
]);
|
|
2135
|
-
|
|
2136
|
-
(!
|
|
2145
|
+
k(() => {
|
|
2146
|
+
(!_i || !oo) && $.active && $.end();
|
|
2137
2147
|
}, [
|
|
2138
|
-
|
|
2139
|
-
|
|
2148
|
+
_i,
|
|
2149
|
+
oo,
|
|
2140
2150
|
$
|
|
2141
|
-
])
|
|
2142
|
-
|
|
2151
|
+
]);
|
|
2152
|
+
let [uc, dc] = M(hi), fc = or({
|
|
2153
|
+
available: $.available,
|
|
2154
|
+
allowedInMode: oo,
|
|
2155
|
+
readOnly: ga,
|
|
2156
|
+
busy: sa || po !== null || va || Io,
|
|
2157
|
+
committing: uc.committing,
|
|
2158
|
+
dictating: uc.dictating
|
|
2159
|
+
}), pc = xt(), mc = j(!1), hc = O(() => {
|
|
2160
|
+
mc.current = !0, rc();
|
|
2161
|
+
}, [rc]);
|
|
2162
|
+
k(() => {
|
|
2163
|
+
$.active || (mc.current = !1);
|
|
2164
|
+
}, [$.active]), k(() => {
|
|
2165
|
+
Ka || !mc.current || (mc.current = !1, $.active && lc());
|
|
2166
|
+
}, [
|
|
2167
|
+
Ka,
|
|
2168
|
+
$.active,
|
|
2169
|
+
lc
|
|
2170
|
+
]), k(() => {
|
|
2171
|
+
Ka && Ya(!1);
|
|
2172
|
+
}, [Ka, Ya]);
|
|
2173
|
+
let gc = A(() => ({
|
|
2174
|
+
live: $.active,
|
|
2175
|
+
blocked: fc === null ? null : pc.voiceStartBlocked(fc),
|
|
2176
|
+
impossible: sr(fc),
|
|
2177
|
+
start: hc
|
|
2178
|
+
}), [
|
|
2179
|
+
$.active,
|
|
2180
|
+
fc,
|
|
2181
|
+
pc,
|
|
2182
|
+
hc
|
|
2183
|
+
]), [_c, vc] = M("mini"), yc = _i && Wa.covered !== !0 && !($.active && _c !== "mini") && !(Ua && !$.active);
|
|
2184
|
+
k(() => {
|
|
2185
|
+
let e = Xa.current, t = it(e), n = v.getState(), r = et({
|
|
2143
2186
|
sessionLive: $.active,
|
|
2144
2187
|
bound: e,
|
|
2145
2188
|
activeConversationId: n.activeConversationId,
|
|
2146
2189
|
boundConversationExists: n.conversations.some((e) => e.id === t)
|
|
2147
2190
|
});
|
|
2148
|
-
|
|
2191
|
+
$a(r.bound), r.end && $.end();
|
|
2149
2192
|
}, [
|
|
2150
2193
|
$,
|
|
2151
2194
|
H,
|
|
2152
|
-
|
|
2153
|
-
|
|
2195
|
+
Li,
|
|
2196
|
+
$a
|
|
2154
2197
|
]);
|
|
2155
|
-
let
|
|
2156
|
-
|
|
2157
|
-
let e =
|
|
2198
|
+
let bc = j(w);
|
|
2199
|
+
k(() => {
|
|
2200
|
+
let e = $e(bc.current, {
|
|
2158
2201
|
activeConversationId: H,
|
|
2159
|
-
chatTurnCount:
|
|
2202
|
+
chatTurnCount: ys.length,
|
|
2160
2203
|
voiceTurnCount: Q.length,
|
|
2161
2204
|
sessionLive: $.active,
|
|
2162
|
-
sessionBoundTo:
|
|
2163
|
-
turnInFlight:
|
|
2205
|
+
sessionBoundTo: Xa.current,
|
|
2206
|
+
turnInFlight: sa
|
|
2164
2207
|
});
|
|
2165
|
-
|
|
2208
|
+
bc.current = e.state, e.open && Ya(!0);
|
|
2166
2209
|
}, [
|
|
2167
2210
|
H,
|
|
2168
|
-
|
|
2211
|
+
ys.length,
|
|
2169
2212
|
Q.length,
|
|
2170
2213
|
$.active,
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
]),
|
|
2214
|
+
sa,
|
|
2215
|
+
Ya
|
|
2216
|
+
]), k(() => {
|
|
2174
2217
|
if (!$.active) {
|
|
2175
|
-
|
|
2176
|
-
for (let e of
|
|
2177
|
-
|
|
2218
|
+
js.current.clear(), Ns(null), _o.current = null;
|
|
2219
|
+
for (let e of Fs.current) window.clearInterval(e);
|
|
2220
|
+
Fs.current.clear();
|
|
2178
2221
|
}
|
|
2179
|
-
}, [$.active]),
|
|
2180
|
-
let e =
|
|
2222
|
+
}, [$.active]), k(() => {
|
|
2223
|
+
let e = Fs.current;
|
|
2181
2224
|
return () => {
|
|
2182
2225
|
for (let t of e) window.clearInterval(t);
|
|
2183
2226
|
e.clear();
|
|
2184
2227
|
};
|
|
2185
|
-
}, []),
|
|
2186
|
-
let e =
|
|
2187
|
-
return e &&
|
|
2228
|
+
}, []), k(() => {
|
|
2229
|
+
let e = v.getState().consumePendingPrompt();
|
|
2230
|
+
return e && gs.current(e), v.subscribe((e, t) => {
|
|
2188
2231
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
2189
|
-
let e =
|
|
2190
|
-
e &&
|
|
2232
|
+
let e = v.getState().consumePendingPrompt();
|
|
2233
|
+
e && gs.current(e);
|
|
2191
2234
|
}
|
|
2192
2235
|
});
|
|
2193
2236
|
}, []);
|
|
2194
|
-
let
|
|
2195
|
-
let t = H ?
|
|
2196
|
-
if (t && t.mode !== e && G.withdraw(t.id, "mode_switched"), t &&
|
|
2237
|
+
let xc = O((e) => {
|
|
2238
|
+
let t = H ? v.getState().conversations.find((e) => e.id === H) : void 0;
|
|
2239
|
+
if (t && t.mode !== e && G.withdraw(t.id, "mode_switched"), t && Rn(t)) {
|
|
2197
2240
|
if (t.mode !== e) {
|
|
2198
|
-
let t =
|
|
2199
|
-
n ?
|
|
2241
|
+
let t = p(), n = v.getState().conversations.find((n) => n.mode === e && Vn(n, t) && !v.getState().processingByConversationId[n.id]);
|
|
2242
|
+
n ? Vi(n.id) : Hi(void 0, e);
|
|
2200
2243
|
}
|
|
2201
|
-
} else H &&
|
|
2202
|
-
let n =
|
|
2203
|
-
n ?
|
|
2244
|
+
} else H && Bi(H, e);
|
|
2245
|
+
let n = v.getState().activeConversationId;
|
|
2246
|
+
n ? Bi(n, e) : ta(!1), zi(e);
|
|
2204
2247
|
}, [
|
|
2205
2248
|
H,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2249
|
+
Hi,
|
|
2250
|
+
Vi,
|
|
2251
|
+
ta,
|
|
2252
|
+
Bi,
|
|
2253
|
+
zi,
|
|
2211
2254
|
G
|
|
2212
|
-
]),
|
|
2213
|
-
let e =
|
|
2255
|
+
]), Sc = O(() => {
|
|
2256
|
+
let e = v.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
2214
2257
|
if (!t) {
|
|
2215
|
-
|
|
2258
|
+
ta(!0), zi(c);
|
|
2216
2259
|
return;
|
|
2217
2260
|
}
|
|
2218
2261
|
if (t.routedBy === "auto") {
|
|
2219
|
-
|
|
2262
|
+
ta(!0);
|
|
2220
2263
|
return;
|
|
2221
2264
|
}
|
|
2222
|
-
if (!
|
|
2223
|
-
|
|
2265
|
+
if (!Rn(t)) {
|
|
2266
|
+
na(t.id, c);
|
|
2224
2267
|
return;
|
|
2225
2268
|
}
|
|
2226
2269
|
G.withdraw(t.id, "mode_switched");
|
|
2227
|
-
let n =
|
|
2228
|
-
r ? (
|
|
2270
|
+
let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" && Vn(t, n) && !e.processingByConversationId[t.id]);
|
|
2271
|
+
r ? (Vi(r.id), na(r.id, c)) : Hi(void 0, c, { routedBy: "auto" });
|
|
2229
2272
|
}, [
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2273
|
+
Hi,
|
|
2274
|
+
na,
|
|
2275
|
+
Vi,
|
|
2276
|
+
ta,
|
|
2277
|
+
zi,
|
|
2235
2278
|
G
|
|
2236
|
-
]),
|
|
2237
|
-
if (L.find((t) => t.id === e)?.writeCapable && !
|
|
2238
|
-
|
|
2279
|
+
]), Cc = O((e) => {
|
|
2280
|
+
if (L.find((t) => t.id === e)?.writeCapable && !oe(v.getState().acknowledgedWriteModes, e)) {
|
|
2281
|
+
Ba(e);
|
|
2239
2282
|
return;
|
|
2240
2283
|
}
|
|
2241
|
-
|
|
2242
|
-
}, [
|
|
2243
|
-
let e =
|
|
2244
|
-
if (
|
|
2245
|
-
let t =
|
|
2246
|
-
if (
|
|
2247
|
-
|
|
2284
|
+
xc(e);
|
|
2285
|
+
}, [xc, L]), wc = O(() => {
|
|
2286
|
+
let e = za;
|
|
2287
|
+
if (Ba(null), !e) return;
|
|
2288
|
+
let t = Ia.current;
|
|
2289
|
+
if (Ia.current = null, t) {
|
|
2290
|
+
$i(e), Z(t.content, t.attachments, t.options);
|
|
2248
2291
|
return;
|
|
2249
2292
|
}
|
|
2250
|
-
|
|
2293
|
+
$i(e), xc(e);
|
|
2251
2294
|
}, [
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2295
|
+
za,
|
|
2296
|
+
$i,
|
|
2297
|
+
xc,
|
|
2255
2298
|
Z
|
|
2256
|
-
]),
|
|
2257
|
-
|
|
2258
|
-
let e =
|
|
2259
|
-
|
|
2299
|
+
]), Tc = za === null ? void 0 : L.find((e) => e.id === za) ?? { id: za }, Ec = O(() => {
|
|
2300
|
+
Ba(null);
|
|
2301
|
+
let e = Ia.current;
|
|
2302
|
+
Ia.current = null, e && Z(e.content, e.attachments, {
|
|
2260
2303
|
...e.options,
|
|
2261
2304
|
autoIntent: "read"
|
|
2262
2305
|
});
|
|
2263
2306
|
}, [Z]);
|
|
2264
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ li("div", {
|
|
2265
2308
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
2266
2309
|
children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ li("div", {
|
|
2268
2311
|
className: "contents",
|
|
2269
|
-
inert: $.active || void 0,
|
|
2312
|
+
inert: $.active || Ka || void 0,
|
|
2313
|
+
...Wa.ids ? {
|
|
2314
|
+
role: "tabpanel",
|
|
2315
|
+
id: Wa.ids.chatPanel,
|
|
2316
|
+
"aria-labelledby": Wa.ids.chatTab
|
|
2317
|
+
} : {},
|
|
2270
2318
|
children: [
|
|
2271
|
-
|
|
2272
|
-
Q.length > 0 && !$.active ? /* @__PURE__ */ N(
|
|
2319
|
+
Ca === null ? null : /* @__PURE__ */ N(Mn, { onDismiss: () => Sa(Ca) }),
|
|
2320
|
+
Q.length > 0 && !$.active ? /* @__PURE__ */ N(An, {
|
|
2273
2321
|
count: Q.length,
|
|
2274
|
-
onOpenTranscript: () =>
|
|
2322
|
+
onOpenTranscript: () => Ya(!0)
|
|
2275
2323
|
}) : null,
|
|
2276
|
-
|
|
2277
|
-
state:
|
|
2278
|
-
onRetry:
|
|
2279
|
-
}) :
|
|
2324
|
+
ys.length === 0 && (va || ya) ? /* @__PURE__ */ N(Nn, {
|
|
2325
|
+
state: va ? "loading" : "failed",
|
|
2326
|
+
onRetry: Oa
|
|
2327
|
+
}) : ys.length === 0 && ra?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
|
|
2280
2328
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2281
|
-
children: /* @__PURE__ */ N(
|
|
2282
|
-
onShowEarlier:
|
|
2283
|
-
disabled:
|
|
2329
|
+
children: /* @__PURE__ */ N(Fn, {
|
|
2330
|
+
onShowEarlier: ka,
|
|
2331
|
+
disabled: va
|
|
2284
2332
|
})
|
|
2285
|
-
}) :
|
|
2333
|
+
}) : ys.length === 0 ? /* @__PURE__ */ N(Wn, {
|
|
2286
2334
|
mode: U,
|
|
2287
|
-
onSuggestionClick:
|
|
2288
|
-
explainsAuto:
|
|
2289
|
-
suggestions:
|
|
2290
|
-
}) : /* @__PURE__ */
|
|
2335
|
+
onSuggestionClick: ps,
|
|
2336
|
+
explainsAuto: Pa,
|
|
2337
|
+
suggestions: Pa && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
2338
|
+
}) : /* @__PURE__ */ li("div", {
|
|
2291
2339
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2292
|
-
children: [
|
|
2293
|
-
onShowEarlier:
|
|
2294
|
-
disabled:
|
|
2295
|
-
}) : null, /* @__PURE__ */ N(
|
|
2296
|
-
onApprovePendingWrite:
|
|
2297
|
-
approvingWriteRef:
|
|
2298
|
-
approvableMessageId:
|
|
2299
|
-
retryableMessageId:
|
|
2300
|
-
messages:
|
|
2301
|
-
processing:
|
|
2302
|
-
streamingMessageId:
|
|
2303
|
-
failedMessageId:
|
|
2304
|
-
onRetry:
|
|
2305
|
-
renderWriteProposals:
|
|
2306
|
-
hidesLegacyWriteCard:
|
|
2307
|
-
renderUiOffers:
|
|
2340
|
+
children: [ra?.sync?.hasOlder ? /* @__PURE__ */ N(Fn, {
|
|
2341
|
+
onShowEarlier: ka,
|
|
2342
|
+
disabled: va
|
|
2343
|
+
}) : null, /* @__PURE__ */ N(nr, {
|
|
2344
|
+
onApprovePendingWrite: xo,
|
|
2345
|
+
approvingWriteRef: po,
|
|
2346
|
+
approvableMessageId: xs?.messageId ?? null,
|
|
2347
|
+
retryableMessageId: Ss,
|
|
2348
|
+
messages: ys,
|
|
2349
|
+
processing: oa ?? null,
|
|
2350
|
+
streamingMessageId: ca,
|
|
2351
|
+
failedMessageId: la,
|
|
2352
|
+
onRetry: po === null ? hs : void 0,
|
|
2353
|
+
renderWriteProposals: ws,
|
|
2354
|
+
hidesLegacyWriteCard: Cs,
|
|
2355
|
+
renderUiOffers: Es
|
|
2308
2356
|
})]
|
|
2309
2357
|
}),
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2358
|
+
ga ? /* @__PURE__ */ N(Pn, { onStartNew: () => Hi() }) : null,
|
|
2359
|
+
_a && H ? /* @__PURE__ */ N(jn, { onUnarchive: () => Un.updateConversation(H, { archived: !1 }) }) : null,
|
|
2360
|
+
ss === null ? null : /* @__PURE__ */ N(Gn, {
|
|
2313
2361
|
tr: F,
|
|
2314
|
-
onDismiss: () =>
|
|
2362
|
+
onDismiss: () => cs(null)
|
|
2315
2363
|
}),
|
|
2316
|
-
|
|
2317
|
-
state:
|
|
2318
|
-
onRetry:
|
|
2364
|
+
ys.length > 0 && (va || ya) ? /* @__PURE__ */ N(Nn, {
|
|
2365
|
+
state: va ? "loading" : "failed",
|
|
2366
|
+
onRetry: Oa,
|
|
2319
2367
|
compact: !0
|
|
2320
2368
|
}) : null,
|
|
2321
|
-
/* @__PURE__ */ N(
|
|
2322
|
-
onStartVoiceSession: $.available &&
|
|
2369
|
+
/* @__PURE__ */ N(ri, {
|
|
2370
|
+
onStartVoiceSession: $.available && oo ? rc : void 0,
|
|
2323
2371
|
onSend: (e, t) => void Z(e, t, { fromPerson: !0 }),
|
|
2324
|
-
onDraftStart:
|
|
2325
|
-
disabled:
|
|
2326
|
-
readOnly:
|
|
2372
|
+
onDraftStart: fo,
|
|
2373
|
+
disabled: sa || po !== null || va || Io,
|
|
2374
|
+
readOnly: ga,
|
|
2327
2375
|
placeholder: U === "api-calls" ? F("chatArea.placeholderActions", "What would you like me to do?") : F("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
2328
2376
|
mode: U,
|
|
2329
|
-
writeAccessDenied:
|
|
2330
|
-
availableModes:
|
|
2331
|
-
attachmentCharsPerFile:
|
|
2332
|
-
onModeChange:
|
|
2333
|
-
auto:
|
|
2334
|
-
active:
|
|
2335
|
-
onSelect:
|
|
2336
|
-
} : void 0
|
|
2377
|
+
writeAccessDenied: vi === "denied" && !!ro?.writeCapable,
|
|
2378
|
+
availableModes: Ma,
|
|
2379
|
+
attachmentCharsPerFile: Ra,
|
|
2380
|
+
onModeChange: Cc,
|
|
2381
|
+
auto: Na ? {
|
|
2382
|
+
active: Pa,
|
|
2383
|
+
onSelect: Sc
|
|
2384
|
+
} : void 0,
|
|
2385
|
+
suspendDictation: Ka,
|
|
2386
|
+
onVoiceStateChange: Wa.ids ? dc : void 0
|
|
2337
2387
|
})
|
|
2338
2388
|
]
|
|
2339
2389
|
}),
|
|
2340
|
-
|
|
2390
|
+
Ua && !$.active ? /* @__PURE__ */ N(In, {
|
|
2341
2391
|
turns: Q,
|
|
2342
|
-
onClose: () =>
|
|
2343
|
-
onSave:
|
|
2344
|
-
onContinueInChat:
|
|
2392
|
+
onClose: () => Ya(!1),
|
|
2393
|
+
onSave: ks,
|
|
2394
|
+
onContinueInChat: oc ? sc : void 0,
|
|
2345
2395
|
closeOnEscape: !0,
|
|
2346
|
-
onShowEarlier:
|
|
2347
|
-
showEarlierDisabled:
|
|
2348
|
-
renderAfterTurn:
|
|
2396
|
+
onShowEarlier: ra?.sync?.hasOlder ? ka : void 0,
|
|
2397
|
+
showEarlierDisabled: va,
|
|
2398
|
+
renderAfterTurn: Ts
|
|
2399
|
+
}) : null,
|
|
2400
|
+
Ka && Ga && Wa.ids ? /* @__PURE__ */ N(ar, {
|
|
2401
|
+
tab: Ga,
|
|
2402
|
+
id: Wa.ids.avatarPanel,
|
|
2403
|
+
labelledBy: Wa.ids.avatarTab,
|
|
2404
|
+
leaveHintId: Wa.ids.leaveHint,
|
|
2405
|
+
shown: yc,
|
|
2406
|
+
voice: gc
|
|
2349
2407
|
}) : null,
|
|
2350
|
-
$.active && /* @__PURE__ */ N(
|
|
2408
|
+
$.active && /* @__PURE__ */ N(ir, {
|
|
2351
2409
|
session: $.session,
|
|
2352
2410
|
notice: $.notice,
|
|
2353
2411
|
privacyNotice: $.handsFree.privacyNotice,
|
|
@@ -2358,49 +2416,50 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
|
|
|
2358
2416
|
correcting: $.correcting,
|
|
2359
2417
|
onLetMeFinish: $.letMeFinish,
|
|
2360
2418
|
onImDone: $.imDone,
|
|
2361
|
-
turns:
|
|
2419
|
+
turns: Ls,
|
|
2362
2420
|
spokenChunks: $.spokenChunks,
|
|
2363
|
-
attachments:
|
|
2364
|
-
onAttachFiles:
|
|
2365
|
-
onRemoveAttachment:
|
|
2366
|
-
onRetryAttachment:
|
|
2367
|
-
canAttachMore:
|
|
2368
|
-
preparingAttachments:
|
|
2369
|
-
attachmentsLocked:
|
|
2370
|
-
attachmentNotice:
|
|
2371
|
-
onSaveTranscript:
|
|
2372
|
-
onContinueInChat:
|
|
2421
|
+
attachments: As.attachments,
|
|
2422
|
+
onAttachFiles: As.addFiles,
|
|
2423
|
+
onRemoveAttachment: As.remove,
|
|
2424
|
+
onRetryAttachment: As.retry,
|
|
2425
|
+
canAttachMore: As.canAddMore,
|
|
2426
|
+
preparingAttachments: As.preparingCount,
|
|
2427
|
+
attachmentsLocked: As.isCommitting,
|
|
2428
|
+
attachmentNotice: Ps,
|
|
2429
|
+
onSaveTranscript: ks,
|
|
2430
|
+
onContinueInChat: sc,
|
|
2373
2431
|
onInterrupt: () => {
|
|
2374
|
-
$.interrupt(),
|
|
2432
|
+
$.interrupt(), yo();
|
|
2375
2433
|
},
|
|
2376
|
-
spoken:
|
|
2434
|
+
spoken: vs,
|
|
2377
2435
|
onToggleMute: $.toggleMute,
|
|
2378
|
-
onEnd:
|
|
2379
|
-
proposalChip:
|
|
2380
|
-
label:
|
|
2381
|
-
onOpen:
|
|
2436
|
+
onEnd: lc,
|
|
2437
|
+
proposalChip: Gs ? {
|
|
2438
|
+
label: pt(Gs, F),
|
|
2439
|
+
onOpen: Ws
|
|
2382
2440
|
} : null,
|
|
2383
|
-
proposalTray:
|
|
2384
|
-
renderAfterTurn:
|
|
2441
|
+
proposalTray: qs,
|
|
2442
|
+
renderAfterTurn: Ts,
|
|
2443
|
+
onViewChange: Wa.ids ? vc : void 0
|
|
2385
2444
|
}),
|
|
2386
|
-
/* @__PURE__ */ N(
|
|
2387
|
-
open:
|
|
2388
|
-
mode:
|
|
2389
|
-
currentMode:
|
|
2390
|
-
onConfirm:
|
|
2391
|
-
onCancel:
|
|
2445
|
+
/* @__PURE__ */ N(ai, {
|
|
2446
|
+
open: za !== null,
|
|
2447
|
+
mode: Tc,
|
|
2448
|
+
currentMode: ro ?? { id: U },
|
|
2449
|
+
onConfirm: wc,
|
|
2450
|
+
onCancel: Ec
|
|
2392
2451
|
}),
|
|
2393
|
-
/* @__PURE__ */ N(
|
|
2394
|
-
...
|
|
2395
|
-
view:
|
|
2396
|
-
serverNow:
|
|
2397
|
-
arrivedAt:
|
|
2398
|
-
capabilities:
|
|
2399
|
-
turnInFlight:
|
|
2452
|
+
/* @__PURE__ */ N(Sn, {
|
|
2453
|
+
...pa.dialog,
|
|
2454
|
+
view: Ds?.view ?? pa.dialog.view,
|
|
2455
|
+
serverNow: Ds?.serverNow ?? NaN,
|
|
2456
|
+
arrivedAt: Ds?.arrivedAt ?? NaN,
|
|
2457
|
+
capabilities: Ds ? ua[Ds.session.sandboxId] : null,
|
|
2458
|
+
turnInFlight: sa,
|
|
2400
2459
|
tr: F
|
|
2401
2460
|
})
|
|
2402
2461
|
]
|
|
2403
2462
|
});
|
|
2404
2463
|
};
|
|
2405
2464
|
//#endregion
|
|
2406
|
-
export {
|
|
2465
|
+
export { _i as AssistantChatArea };
|