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