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