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