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