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