@burdenoff/fe-libs 2026.928.3 → 2026.930.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/adminModeSendGate.d.ts +6 -5
- package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
- package/dist/shared/assistant/adminModeSendGate.js +11 -11
- package/dist/shared/assistant/api.d.ts +313 -28
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +351 -135
- package/dist/shared/assistant/autoRouting.d.ts +11 -3
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +7 -7
- package/dist/shared/assistant/capabilities.d.ts +28 -0
- package/dist/shared/assistant/capabilities.d.ts.map +1 -1
- package/dist/shared/assistant/capabilities.js +19 -10
- package/dist/shared/assistant/conversation.d.ts +24 -2
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +67 -54
- package/dist/shared/assistant/history/historyList.js +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +5 -1
- package/dist/shared/assistant/history/historyResume.js +7 -7
- package/dist/shared/assistant/i18nManifest.d.ts +53 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +75 -16
- package/dist/shared/assistant/index.d.ts +15 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +1 -1
- package/dist/shared/assistant/operations.d.ts +22 -0
- package/dist/shared/assistant/operations.d.ts.map +1 -1
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/prewarm.d.ts +7 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.js +1 -1
- package/dist/shared/assistant/product.d.ts +80 -2
- package/dist/shared/assistant/product.d.ts.map +1 -1
- package/dist/shared/assistant/product.js +10 -6
- package/dist/shared/assistant/proposalWriteRules.d.ts +40 -0
- package/dist/shared/assistant/proposalWriteRules.d.ts.map +1 -0
- package/dist/shared/assistant/proposalWriteRules.js +14 -0
- package/dist/shared/assistant/store.d.ts +17 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +50 -43
- package/dist/shared/assistant/turnOutcome.d.ts +34 -2
- package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.js +28 -17
- package/dist/shared/assistant/turnOutcomeCopy.d.ts +29 -7
- package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcomeCopy.js +18 -6
- package/dist/shared/assistant/types.d.ts +5 -1
- package/dist/shared/assistant/types.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +4 -4
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +992 -718
- package/dist/shared/assistant/ui/AssistantConversationList.js +6 -6
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +77 -76
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +13 -1
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +15 -13
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -209
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +62 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +253 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +72 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +439 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts +40 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +35 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +8 -8
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +28 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +159 -110
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +61 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.js +109 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts +128 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposals.js +240 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +17 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +141 -109
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +76 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.js +110 -0
- package/dist/shared/assistant/usageReporting.d.ts +108 -0
- package/dist/shared/assistant/usageReporting.d.ts.map +1 -0
- package/dist/shared/assistant/usageReporting.js +155 -0
- package/dist/shared/assistant/useAssistantApiAccess.d.ts +49 -14
- package/dist/shared/assistant/useAssistantApiAccess.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantApiAccess.js +43 -25
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantHeartbeat.js +5 -5
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +5 -6
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts +46 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +35 -2
- package/dist/shared/assistant/writeConfirmSeam.d.ts +32 -0
- package/dist/shared/assistant/writeConfirmSeam.d.ts.map +1 -0
- package/dist/shared/assistant/writeConfirmSeam.js +23 -0
- package/dist/shared/assistant/writeModeConsent.d.ts +16 -8
- package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
- package/dist/shared/assistant/writeModeConsent.js +2 -2
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +187 -0
- package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalDiscovery.js +246 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts +135 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalErrorCopy.js +135 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts +133 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalVoice.js +66 -0
- package/dist/shared/assistant/writeProposals.d.ts +268 -0
- package/dist/shared/assistant/writeProposals.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposals.js +445 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts +166 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplyBinder.js +233 -0
- package/dist/shared/assistant/writeReplySend.d.ts +110 -0
- package/dist/shared/assistant/writeReplySend.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplySend.js +93 -0
- package/dist/shared-assistant.js +168 -153
- package/dist/ui/modal-shell.d.ts +14 -1
- package/dist/ui/modal-shell.d.ts.map +1 -1
- package/dist/ui/modal-shell.js +8 -6
- package/package.json +1 -1
|
@@ -6,308 +6,353 @@ import { useAssistantProduct as r } from "../product.js";
|
|
|
6
6
|
import { useAssistantTr as i } from "../i18n.js";
|
|
7
7
|
import { useAssistantNavigate as a } from "./AssistantMarkdownRenderer.js";
|
|
8
8
|
import { isAssistantModeId as o } from "../modeIds.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
9
|
+
import { AUTO_READ_MODE as s, autoSuggestions as c, classifyAssistantIntent as l, escalationToUndo as u, isAutoRoutingOffered as d, resolveAutoRoute as f } from "../autoRouting.js";
|
|
10
|
+
import { getHistoryStamp as p, setHistoryBusyProbe as ee } from "../history/stampRegistry.js";
|
|
11
|
+
import { beginApprovalInFlight as m, endApprovalInFlight as h, getApprovalInFlight as g, markLiveTurn as te, newestModelReplyId as _, resolveApprovablePendingWrite as ne, resolveRetryableMessageId as re, subscribeApprovalInFlight as v } from "../liveTurns.js";
|
|
12
|
+
import { isWriteModeAcknowledged as ie, writeModeSendRefusalReason as ae } from "../writeModeConsent.js";
|
|
13
|
+
import { resolveActiveModeSandbox as y, useAssistantStore as b } from "../store.js";
|
|
14
|
+
import { abortAssistantTurn as oe, approvePendingWrite as se, createAssistantSandbox as ce, createAssistantSession as x, extendAssistantSandboxTTL as le, findExistingSandboxWithStatus as S, getAssistantArtifacts as ue, getAssistantMessages as de, getAssistantSession as fe, modeRequiresConfirmWrites as pe, promptGatewayRequestBytes as me, releaseSupersededAssistantSandboxes as he, sendAssistantPromptAsync as ge, waitForAssistantServiceReady as C, waitForSandboxRunning as _e, writeApprovalModeOf as ve } from "../api.js";
|
|
15
|
+
import { sanitize as ye } from "../progress.js";
|
|
16
|
+
import { AssistantSendRefusal as be, classifyTurnFailure as xe, turnConfirmsNoAction as Se, turnOutcomeCopy as Ce } from "../turnOutcome.js";
|
|
17
|
+
import { assistantUsageLedger as we, hasPendingUsageReports as Te, reportUsageWithRetry as Ee, retryPendingUsageReports as De, usageSendRefusal as Oe } from "../usageReporting.js";
|
|
18
|
+
import { withIncompleteTurnNotice as ke } from "../streamBudget.js";
|
|
19
|
+
import { chatTurns as Ae, isVoiceTurn as w, voiceMarker as T, voiceSessionIdOf as E } from "../voice/turnVisibility.js";
|
|
20
|
+
import { buildContinuedFromVoiceNote as je, buildVoiceTranscriptMarkdown as Me, voiceTranscriptFilename as Ne } from "../voice/voiceTranscript.js";
|
|
21
|
+
import { pollDelayMs as Pe } from "../voice/assistantPollSchedule.js";
|
|
22
|
+
import { toCaptionText as Fe } from "../voice/captionText.js";
|
|
23
|
+
import { resolveAssistantLanguage as Ie } from "../voice/languages.js";
|
|
24
|
+
import { resolveLanguagePair as Le } from "../voice/languagePair.js";
|
|
25
|
+
import { INITIAL_TRANSCRIPT_AUTO_OPEN as Re, maySendSpokenTurn as ze, planTranscriptAutoOpen as Be, planVoiceSessionBinding as Ve } from "../voice/voiceReopen.js";
|
|
26
|
+
import { countInlineImageCandidates as He, countInlinedImageParts as Ue, getSendableAttachments as We, largestInlineCharsPerFile as Ge, resolveAssistantInlineLimits as Ke, toMessageAttachment as qe } from "../attachments.js";
|
|
27
|
+
import { WRITE_PROPOSAL_VOICE_COPY as Je, isVoiceProposalBound as Ye, voiceProposalChip as Xe, voiceProposalChipText as Ze, voiceReadbacksDue as Qe, voiceWaitingProposals as $e, writeProposalVoiceLine as et, writeProposalVoiceReadback as tt } from "../writeProposalVoice.js";
|
|
28
|
+
import { createAdminModeAccessGate as nt, resolveAssistantSendModeAfterAccess as rt } from "../adminModeSendGate.js";
|
|
29
|
+
import { buildBoundedAttachmentTurn as it } from "../attachmentTurn.js";
|
|
30
|
+
import { isTurnInFlight as at, planAbandonedTurn as ot, planTurnAbort as st } from "../turnState.js";
|
|
31
|
+
import { getAssistantDisplayContent as ct } from "../displayContent.js";
|
|
32
|
+
import { NO_FIRST_TEXT as lt, buildAssistantProgress as ut, readAheadFor as dt, snapshotReplyFloor as ft, startSessionReadAhead as pt, trackFirstText as mt } from "../turnProgress.js";
|
|
33
|
+
import { parseToolActivity as ht } from "./AssistantToolActivity.js";
|
|
34
|
+
import { countSpokenTurns as gt, spokenMessagesSinceContinueNote as _t, spokenTurnText as vt } from "../spokenTurns.js";
|
|
35
|
+
import { beginTurn as yt, describeTurn as D, detectTurnDevice as bt, markTurn as O, restartAttempt as xt, turnClockMs as St } from "../turnTimeline.js";
|
|
36
|
+
import { useAssistantSpeech as Ct } from "./AssistantSpeechProvider.js";
|
|
37
|
+
import { useVoiceSession as wt } from "./useVoiceSession.js";
|
|
38
|
+
import { getOrganizationId as Tt, getWorkspaceId as k } from "../context.js";
|
|
39
|
+
import { isMultimodalBodyRejection as Et, isRecoverableAssistantError as Dt } from "../transportErrors.js";
|
|
40
|
+
import { createReadinessTracker as Ot, planAfterTransportFailure as kt, planTrustedSandboxFailure as At } from "../sandboxReadiness.js";
|
|
41
|
+
import { writeProposalConfirmState as jt } from "./writeProposalPresentation.js";
|
|
42
|
+
import { writeProposalUsesDialog as Mt } from "./AssistantWriteProposalCard.js";
|
|
43
|
+
import { AssistantWriteConfirmDialog as Nt } from "./AssistantWriteConfirmDialog.js";
|
|
44
|
+
import { useWriteProposalConfirm as Pt } from "./useWriteProposalConfirm.js";
|
|
45
|
+
import { AssistantWriteProposalSlot as Ft } from "./AssistantWriteProposalSlot.js";
|
|
46
|
+
import { readWriteProposalRefs as It, writeProposalsEnabledFor as Lt } from "../writeProposalDiscovery.js";
|
|
47
|
+
import { planWriteReply as Rt, promptWriteApproval as zt } from "../writeReplySend.js";
|
|
48
|
+
import { useWriteProposals as Bt } from "./useWriteProposals.js";
|
|
49
|
+
import { AssistantSpokenTurnsNotice as Vt } from "./AssistantSpokenTurnsNotice.js";
|
|
50
|
+
import { AssistantHistoryDeletedNotice as Ht, AssistantHistoryLoadState as Ut, AssistantHistoryReadOnlyBanner as Wt, AssistantHistoryShowEarlier as Gt } from "./AssistantHistoryNotices.js";
|
|
51
|
+
import { VoiceTranscriptDrawer as Kt } from "./voice/VoiceTranscriptDrawer.js";
|
|
52
|
+
import { downloadFile as qt } from "../exportConversation.js";
|
|
53
|
+
import { conversationHasHistory as Jt, isOtherScopeHistoryConversation as Yt, isReadOnlyHistoryConversation as Xt, isReusableHistoryDraft as Zt } from "../history/historyList.js";
|
|
54
|
+
import { useAssistantHistoryStatus as Qt } from "../history/historyStatus.js";
|
|
55
|
+
import { assistantHistory as $t } from "../history/historyEngine.js";
|
|
56
|
+
import { AssistantEmptyState as en } from "./AssistantEmptyState.js";
|
|
57
|
+
import { resumeContextFor as tn } from "../history/historyResume.js";
|
|
58
|
+
import { AssistantMessageList as nn } from "./AssistantMessageList.js";
|
|
59
|
+
import { AssistantVoiceSession as rn } from "./voice/AssistantVoiceSession.js";
|
|
60
|
+
import { useAssistantApiAccess as an } from "../useAssistantApiAccess.js";
|
|
61
|
+
import { useConversationTurns as on } from "../useConversationTurns.js";
|
|
62
|
+
import { sendAssistantTurnTimings as sn, startTurnTimingReporting as cn } from "../turnTimingReporter.js";
|
|
63
|
+
import { WarmCancelled as ln, consumeWarm as un, prewarmTarget as dn, settleWarmBeforeSend as fn, startWarm as pn, warmState as mn } from "../prewarm.js";
|
|
64
|
+
import { isAlreadyThere as hn, matchLocalUiCommand as gn, navDestinations as _n, planThemeChange as vn } from "../localUiCommands.js";
|
|
65
|
+
import { chooseDestinationCopy as yn, navigationCommandCopy as bn, themeCommandCopy as xn } from "../localUiCommandCopy.js";
|
|
66
|
+
import { dispatchAssistantQuotaExhausted as Sn, notifyAiCreditsUpdated as Cn } from "../aiCredits.js";
|
|
67
|
+
import { useAssistantAttachments as wn } from "../useAssistantAttachments.js";
|
|
68
|
+
import { AssistantComposer as Tn } from "./composer/AssistantComposer.js";
|
|
69
|
+
import { isProdRuntime as En } from "../env.js";
|
|
70
|
+
import { AssistantApiCallsConsentDialog as Dn } from "./AssistantApiCallsConsentDialog.js";
|
|
71
|
+
import { useVisibleNavItems as On } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
72
|
+
import { useCallback as A, useEffect as j, useMemo as kn, useRef as M, useState as An, useSyncExternalStore as jn } from "react";
|
|
73
|
+
import { jsx as N, jsxs as Mn } from "react/jsx-runtime";
|
|
64
74
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
65
|
-
var
|
|
66
|
-
function
|
|
75
|
+
var Nn = 600, Pn = 2e4, Fn = 1e4;
|
|
76
|
+
function In() {
|
|
67
77
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
68
78
|
}
|
|
69
|
-
var
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
var Ln = ({ visible: Ln = !0, writeAccess: Rn = "unknown" }) => {
|
|
80
|
+
let P = i(), { product: F, modes: I, gatherPageContext: zn, buildPrompt: Bn, reportTurnTimings: Vn, reportTokenUsage: Hn, localUiCommands: Un } = r(), L = ve(r().writeApproval), Wn = A((e, t) => {
|
|
81
|
+
let n = b.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
82
|
+
return Ye({
|
|
83
|
+
mode: e,
|
|
84
|
+
productWriteApproval: L,
|
|
85
|
+
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
86
|
+
});
|
|
87
|
+
}, [L]), { getAccessToken: R, getWorkspaceToken: Gn, userId: z } = n(), { locale: B } = t(), Kn = b((e) => e.assistantLanguage), qn = b((e) => e.replyLanguage), Jn = kn(() => Le(Kn, qn, B), [
|
|
88
|
+
Kn,
|
|
89
|
+
qn,
|
|
90
|
+
B
|
|
91
|
+
]), Yn = Jn.reply.english, Xn = Jn.replyIsExplicit, Zn = Jn.reply.code, { conversations: Qn, activeConversationId: V, mode: H, processingByConversationId: $n, setMode: er, setConversationMode: tr, setActiveConversation: nr, createConversation: U, addMessage: W, updateMessage: rr, patchMessage: ir, mergeMessageMetadata: ar, setConversationProcessing: or, clearConversationProcessing: sr, setBackendSessionId: cr, clearBackendSessionId: lr, setSandbox: ur, clearSandbox: dr, acknowledgedWriteModes: fr, acknowledgeWriteMode: pr, autoRouting: mr, setAutoRouting: hr, routeConversation: gr } = b(), _r = Qn.find((e) => e.id === V), vr = on(_r), yr = vr.all, G = V ? $n[V] : void 0, K = at(G?.status), br = K ? G?.messageId ?? null : null, xr = G?.status === "error" ? G.messageId : null, Sr = b((e) => e.sandboxWriteCapabilities), { panel: q, entries: Cr, retiredSandboxes: wr } = Bt({
|
|
92
|
+
tr: P,
|
|
93
|
+
productWriteApproval: L
|
|
94
|
+
}), Tr = Pt({
|
|
95
|
+
approve: (e, t) => q.approve(e, t),
|
|
96
|
+
decline: (e, t, n) => q.decline(e, t, n),
|
|
97
|
+
presented: (e, t) => q.presented(e, t)
|
|
98
|
+
}), Er = Tr.dismiss, Dr = M(null);
|
|
99
|
+
j(() => {
|
|
100
|
+
Er();
|
|
101
|
+
let e = Dr.current;
|
|
102
|
+
Dr.current = V, e && e !== V && q.withdraw(e, "conversation_closed"), V && q.openConversation(V);
|
|
103
|
+
}, [
|
|
104
|
+
V,
|
|
105
|
+
q,
|
|
106
|
+
Er
|
|
107
|
+
]);
|
|
108
|
+
let Or = Xt(_r), kr = Qt((e) => V !== null && V in e.loadingIds), Ar = Qt((e) => V !== null && V in e.loadErrorIds), jr = Qt((e) => e.remoteDelete), [Mr, Nr] = An(() => Qt.getState().remoteDelete?.at ?? null), Pr = jr?.wasActive === !0 && jr.at !== Mr ? jr.at : null;
|
|
109
|
+
j(() => {
|
|
110
|
+
if (Pr === null) return;
|
|
111
|
+
let e = window.setTimeout(() => Nr(Pr), Fn);
|
|
78
112
|
return () => window.clearTimeout(e);
|
|
79
|
-
}, [
|
|
80
|
-
let { canUseApiCalls:
|
|
81
|
-
loading:
|
|
82
|
-
canUseAdminModes:
|
|
83
|
-
})).current,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
let
|
|
88
|
-
let e =
|
|
89
|
-
e &&
|
|
90
|
-
},
|
|
91
|
-
let e =
|
|
92
|
-
e &&
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
}, [Pr]);
|
|
114
|
+
let { canUseApiCalls: Fr, loading: Ir } = an(k(), z), Lr = M(nt({
|
|
115
|
+
loading: Ir,
|
|
116
|
+
canUseAdminModes: Fr
|
|
117
|
+
})).current, Rr = M(I);
|
|
118
|
+
j(() => {
|
|
119
|
+
Rr.current = I;
|
|
120
|
+
}, [I]);
|
|
121
|
+
let zr = () => {
|
|
122
|
+
let e = b.getState().activeConversationId;
|
|
123
|
+
e && $t.openConversation(e, { modes: Rr.current });
|
|
124
|
+
}, Br = () => {
|
|
125
|
+
let e = b.getState().activeConversationId;
|
|
126
|
+
e && $t.loadEarlier(e);
|
|
127
|
+
}, Vr = M(R);
|
|
128
|
+
j(() => {
|
|
129
|
+
Vr.current = R;
|
|
96
130
|
}, [R]);
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
workspaceId:
|
|
131
|
+
let Hr = !!F && Vn !== !1;
|
|
132
|
+
j(() => {
|
|
133
|
+
if (Hr) return cn({ send: (e) => sn(e, {
|
|
134
|
+
workspaceId: k(),
|
|
101
135
|
authContext: {
|
|
102
|
-
accessToken:
|
|
103
|
-
organizationId:
|
|
136
|
+
accessToken: Vr.current(),
|
|
137
|
+
organizationId: Tt()
|
|
104
138
|
}
|
|
105
139
|
}) });
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
loading:
|
|
109
|
-
canUseAdminModes:
|
|
140
|
+
}, [Hr]), j(() => {
|
|
141
|
+
Lr.update({
|
|
142
|
+
loading: Ir,
|
|
143
|
+
canUseAdminModes: Fr
|
|
110
144
|
});
|
|
111
145
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]),
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
let
|
|
123
|
-
|
|
146
|
+
Lr,
|
|
147
|
+
Ir,
|
|
148
|
+
Fr
|
|
149
|
+
]), j(() => () => {
|
|
150
|
+
Lr.abandon();
|
|
151
|
+
}, [Lr]);
|
|
152
|
+
let Ur = kn(() => I.filter((e) => !e.requiresAdmin || Fr), [I, Fr]), Wr = d(Ur), Gr = mr && Wr, Kr = M(Wr);
|
|
153
|
+
j(() => {
|
|
154
|
+
Kr.current = Wr;
|
|
155
|
+
}, [Wr]);
|
|
156
|
+
let qr = M(null), Jr = M(!1), Yr = Ge(I), [Xr, Zr] = An(null), [Qr, $r] = An(null), ei = Qr !== null && Qr === V, ti = A((e) => {
|
|
157
|
+
$r(e ? b.getState().activeConversationId : null);
|
|
124
158
|
}, []);
|
|
125
|
-
|
|
126
|
-
|
|
159
|
+
j(() => {
|
|
160
|
+
$r((e) => e !== null && e !== V ? null : e);
|
|
127
161
|
}, [V]);
|
|
128
|
-
let
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
162
|
+
let ni = M(void 0), ri = M({}), J = M(Ot()), Y = M(/* @__PURE__ */ new Set()), ii = M(/* @__PURE__ */ new Set()), X = kn(() => I.find((e) => e.id === H), [I, H]), ai = b((e) => {
|
|
163
|
+
let t = e.sandboxesByMode[H]?.sandboxId;
|
|
164
|
+
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
165
|
+
}), oi = X !== void 0 && Ye({
|
|
166
|
+
mode: H,
|
|
167
|
+
productWriteApproval: L,
|
|
168
|
+
capabilities: ai
|
|
169
|
+
}), si = H === "assistant" || X !== void 0 && !X.writeCapable && !pe(H) || oi;
|
|
170
|
+
j(() => {
|
|
171
|
+
if (H !== "assistant" && X?.writeCapable && !ie(fr, H)) {
|
|
172
|
+
er("assistant");
|
|
132
173
|
return;
|
|
133
174
|
}
|
|
134
|
-
|
|
175
|
+
Ir || (!X || X.requiresAdmin && !Fr) && H !== "assistant" && er("assistant");
|
|
135
176
|
}, [
|
|
136
177
|
H,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
178
|
+
X,
|
|
179
|
+
Fr,
|
|
180
|
+
Ir,
|
|
181
|
+
er,
|
|
182
|
+
fr
|
|
142
183
|
]);
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
}, [
|
|
184
|
+
let ci = A((e, t, n, r) => {
|
|
185
|
+
or(e, n, t, null, r);
|
|
186
|
+
}, [or]), li = A(async (e, t, n, r, i, a = null) => {
|
|
146
187
|
let s = (e, t) => {
|
|
147
|
-
r &&
|
|
188
|
+
r && ci(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
148
189
|
}, c = (e) => {
|
|
149
|
-
r &&
|
|
150
|
-
},
|
|
190
|
+
r && O(r.assistantMessageId, e);
|
|
191
|
+
}, l = () => {
|
|
151
192
|
c("bootAdopted"), a?.beginBoot();
|
|
152
|
-
},
|
|
153
|
-
if (
|
|
154
|
-
},
|
|
155
|
-
if (i && !Y.current.has(r) && J.current.isFresh(r)) return
|
|
156
|
-
|
|
193
|
+
}, u = () => a !== null && (a.signal.aborted || k() !== t), d = () => {
|
|
194
|
+
if (u()) throw new ln("cancelled");
|
|
195
|
+
}, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, h = !1, g = !1, te = async (r) => {
|
|
196
|
+
if (i && !Y.current.has(r) && J.current.isFresh(r)) return p = !0, !0;
|
|
197
|
+
m = !0;
|
|
157
198
|
let o = !1;
|
|
158
199
|
try {
|
|
159
|
-
await
|
|
160
|
-
o = !0,
|
|
200
|
+
await _e(r, t, n, 3e5), await C(r, t, e, n, 9e4, () => {
|
|
201
|
+
o = !0, l();
|
|
161
202
|
});
|
|
162
203
|
} catch {
|
|
163
|
-
if (
|
|
164
|
-
return J.current.invalidate(r), Y.current.add(r), a?.dead.push(r),
|
|
204
|
+
if (u()) throw new ln("cancelled");
|
|
205
|
+
return J.current.invalidate(r), Y.current.add(r), a?.dead.push(r), g = !0, !1;
|
|
165
206
|
}
|
|
166
|
-
return
|
|
207
|
+
return d(), J.current.markVerified(r), o && (h = !0), !0;
|
|
167
208
|
};
|
|
168
|
-
if (
|
|
209
|
+
if (f && (ur(e, f, "provisioning"), s("provisioning", "reusingEnvironment"), await te(f) || (ur(e, null, "provisioning"), f = null)), !f) {
|
|
169
210
|
s("provisioning", "lookingForEnvironment");
|
|
170
|
-
let r = await
|
|
171
|
-
|
|
211
|
+
let r = await S(t, F, e, En(), n, Y.current, L);
|
|
212
|
+
d();
|
|
172
213
|
let i = r?.id ?? null;
|
|
173
214
|
if (i) {
|
|
174
|
-
|
|
215
|
+
ur(e, i, "provisioning"), s("provisioning", "reusingEnvironment");
|
|
175
216
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
176
|
-
t &&
|
|
217
|
+
t && l(), await te(i) ? (f = i, t && (h = !0)) : ur(e, null, "provisioning");
|
|
177
218
|
}
|
|
178
219
|
}
|
|
179
|
-
if (!
|
|
180
|
-
if (a && !a.mayCreate) throw new
|
|
220
|
+
if (!f) {
|
|
221
|
+
if (a && !a.mayCreate) throw new ln("no-create");
|
|
181
222
|
if (c("provisionStarted"), e === "api-calls" && !R()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
182
|
-
s("provisioning", "startingEnvironment"),
|
|
183
|
-
let r = a ? [] : await
|
|
223
|
+
s("provisioning", "startingEnvironment"), ur(e, null, "provisioning");
|
|
224
|
+
let r = a ? [] : await he(t, F, e, En(), n, Y.current, L);
|
|
184
225
|
if (r.length > 0) {
|
|
185
226
|
let e = new Set(r);
|
|
186
227
|
for (let e of r) J.current.invalidate(e), Y.current.add(e);
|
|
187
|
-
let t =
|
|
188
|
-
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) &&
|
|
228
|
+
let t = b.getState().sandboxesByMode;
|
|
229
|
+
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) && dr(n);
|
|
189
230
|
}
|
|
190
231
|
c("createRequested");
|
|
191
232
|
let i = a?.beginCreate();
|
|
192
233
|
try {
|
|
193
|
-
|
|
234
|
+
f = await ce(F, e, t, En(), Nn, n, { writeApproval: L });
|
|
194
235
|
} finally {
|
|
195
236
|
i?.();
|
|
196
237
|
}
|
|
197
|
-
|
|
238
|
+
ee = !0, d(), ur(e, f, "provisioning"), await _e(f, t, n, 3e5), d(), c("sandboxRunning"), await C(f, t, e, n, 9e4), d(), c("serviceReady"), J.current.markVerified(f);
|
|
198
239
|
}
|
|
199
|
-
return
|
|
200
|
-
sandboxId:
|
|
201
|
-
sandboxIsNew:
|
|
202
|
-
sandboxProbed:
|
|
203
|
-
sandboxAdopted:
|
|
204
|
-
deadSandboxProbe:
|
|
205
|
-
trustedFromCache:
|
|
240
|
+
return ur(e, f, "running"), {
|
|
241
|
+
sandboxId: f,
|
|
242
|
+
sandboxIsNew: ee,
|
|
243
|
+
sandboxProbed: m,
|
|
244
|
+
sandboxAdopted: h,
|
|
245
|
+
deadSandboxProbe: g,
|
|
246
|
+
trustedFromCache: p
|
|
206
247
|
};
|
|
207
248
|
}, [
|
|
208
|
-
|
|
249
|
+
dr,
|
|
209
250
|
R,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
251
|
+
F,
|
|
252
|
+
L,
|
|
253
|
+
ur,
|
|
254
|
+
ci
|
|
255
|
+
]), ui = A(async function e(t, n, r, i, a, o = {}) {
|
|
256
|
+
let s = await fn(i, r, (e) => ci(t, n, "provisioning", e), () => O(n, "prewarmJoined"));
|
|
215
257
|
for (let e of s.dead) J.current.invalidate(e), Y.current.add(e);
|
|
216
|
-
s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined &&
|
|
217
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed:
|
|
258
|
+
s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined && D(n, { prewarm: s.joined });
|
|
259
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await li(r, i, a, {
|
|
218
260
|
conversationId: t,
|
|
219
261
|
assistantMessageId: n
|
|
220
|
-
}, o.trustCache !== !1),
|
|
221
|
-
!s.waited &&
|
|
222
|
-
let
|
|
223
|
-
if (
|
|
224
|
-
let e =
|
|
262
|
+
}, o.trustCache !== !1), ee = un(i, r, c);
|
|
263
|
+
!s.waited && ee && D(n, { prewarm: "hit" });
|
|
264
|
+
let m = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, g = null;
|
|
265
|
+
if (m) {
|
|
266
|
+
let e = pt(c, m, (e, t) => de(e, i, t, r, a, { limit: 50 }));
|
|
225
267
|
try {
|
|
226
|
-
let t = await
|
|
268
|
+
let t = await fe(c, i, m, r, a);
|
|
227
269
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
228
|
-
|
|
270
|
+
g = e;
|
|
229
271
|
} catch {
|
|
230
|
-
|
|
272
|
+
lr(t), m = null;
|
|
231
273
|
}
|
|
232
274
|
}
|
|
233
|
-
if (!
|
|
234
|
-
|
|
275
|
+
if (!m) {
|
|
276
|
+
ci(t, n, "connecting", "preparingSession");
|
|
235
277
|
let s;
|
|
236
278
|
try {
|
|
237
|
-
s = await
|
|
279
|
+
s = await x(c, i, r, a);
|
|
238
280
|
} catch (s) {
|
|
239
|
-
if (
|
|
281
|
+
if (p) {
|
|
240
282
|
J.current.invalidate(c);
|
|
241
|
-
let l =
|
|
242
|
-
if (l === "check-network" && (l = await
|
|
243
|
-
|
|
283
|
+
let l = At(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
|
|
284
|
+
if (l === "check-network" && (l = await kt(() => S(i, F, r, En(), a, Y.current, L))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
285
|
+
p || D(n, { cacheProofFailed: !0 }), l === "replace" && (Y.current.add(c), lr(t), dr(r), q.retireSandbox(c));
|
|
244
286
|
let s = await e(t, n, r, i, a, {
|
|
245
287
|
...o,
|
|
246
288
|
trustCache: !1
|
|
247
289
|
});
|
|
248
|
-
return
|
|
290
|
+
return p && (s.deadSandboxProbe || s.sandboxId !== c) && D(n, { cacheProofFailed: !0 }), {
|
|
249
291
|
...s,
|
|
250
|
-
sandboxProbed: s.sandboxProbed ||
|
|
251
|
-
sandboxAdopted: s.sandboxAdopted ||
|
|
252
|
-
deadSandboxProbe: s.deadSandboxProbe ||
|
|
292
|
+
sandboxProbed: s.sandboxProbed || u,
|
|
293
|
+
sandboxAdopted: s.sandboxAdopted || d,
|
|
294
|
+
deadSandboxProbe: s.deadSandboxProbe || f
|
|
253
295
|
};
|
|
254
296
|
}
|
|
255
297
|
}
|
|
256
298
|
throw s;
|
|
257
299
|
}
|
|
258
|
-
|
|
300
|
+
m = s.sessionId, cr(t, m), h = !0;
|
|
259
301
|
}
|
|
260
302
|
return {
|
|
261
303
|
sandboxId: c,
|
|
262
|
-
sessionId:
|
|
263
|
-
sessionIsNew:
|
|
264
|
-
readAhead:
|
|
304
|
+
sessionId: m,
|
|
305
|
+
sessionIsNew: h,
|
|
306
|
+
readAhead: g,
|
|
265
307
|
sandboxIsNew: l,
|
|
266
|
-
sandboxProbed:
|
|
267
|
-
sandboxAdopted:
|
|
268
|
-
deadSandboxProbe:
|
|
308
|
+
sandboxProbed: u,
|
|
309
|
+
sandboxAdopted: d,
|
|
310
|
+
deadSandboxProbe: f
|
|
269
311
|
};
|
|
270
312
|
}, [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
313
|
+
li,
|
|
314
|
+
lr,
|
|
315
|
+
dr,
|
|
316
|
+
F,
|
|
317
|
+
L,
|
|
318
|
+
cr,
|
|
319
|
+
ci,
|
|
320
|
+
q
|
|
321
|
+
]), di = A((e) => {
|
|
322
|
+
let t = k();
|
|
279
323
|
if (!t) return;
|
|
280
|
-
let n =
|
|
324
|
+
let n = b.getState(), r = Date.now(), i = dn({
|
|
281
325
|
autoRouting: n.autoRouting,
|
|
282
|
-
autoOffered:
|
|
326
|
+
autoOffered: Kr.current,
|
|
283
327
|
active: n.activeConversationId ? n.conversations.find((e) => e.id === n.activeConversationId) : void 0,
|
|
284
328
|
selectedMode: n.mode,
|
|
285
|
-
autoReadMode:
|
|
286
|
-
modes:
|
|
329
|
+
autoReadMode: s,
|
|
330
|
+
modes: Rr.current,
|
|
287
331
|
acknowledgedWriteModes: n.acknowledgedWriteModes,
|
|
288
|
-
adminAccess:
|
|
332
|
+
adminAccess: Lr.read(),
|
|
289
333
|
dictated: e,
|
|
290
|
-
|
|
291
|
-
|
|
334
|
+
voiceProposalBound: (e) => Wn(e),
|
|
335
|
+
turnInFlight: Object.values(n.processingByConversationId).some((e) => at(e?.status)),
|
|
336
|
+
...mn(t),
|
|
292
337
|
now: r
|
|
293
338
|
});
|
|
294
339
|
if (!i) return;
|
|
295
|
-
let a =
|
|
340
|
+
let a = pn(t, i, r), o = {
|
|
296
341
|
accessToken: R(),
|
|
297
|
-
workspaceToken:
|
|
298
|
-
userId:
|
|
299
|
-
organizationId:
|
|
342
|
+
workspaceToken: Gn(),
|
|
343
|
+
userId: z,
|
|
344
|
+
organizationId: Tt()
|
|
300
345
|
};
|
|
301
|
-
|
|
346
|
+
li(i.mode, t, o, null, !0, a).then((e) => a.finish({
|
|
302
347
|
ok: !0,
|
|
303
348
|
sandboxId: e.sandboxId,
|
|
304
349
|
didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
|
|
305
350
|
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
306
351
|
dead: a.dead
|
|
307
352
|
}), (e) => {
|
|
308
|
-
if (!(e instanceof
|
|
309
|
-
let e =
|
|
310
|
-
e && (J.current.invalidate(e), Y.current.add(e), a.dead.push(e),
|
|
353
|
+
if (!(e instanceof ln) && !a.signal.aborted && k() === t) {
|
|
354
|
+
let e = b.getState().sandboxesByMode[i.mode]?.sandboxId ?? null;
|
|
355
|
+
e && (J.current.invalidate(e), Y.current.add(e), a.dead.push(e), dr(i.mode));
|
|
311
356
|
}
|
|
312
357
|
a.finish({
|
|
313
358
|
ok: !1,
|
|
@@ -317,108 +362,141 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
317
362
|
});
|
|
318
363
|
});
|
|
319
364
|
}, [
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
365
|
+
li,
|
|
366
|
+
Lr,
|
|
367
|
+
dr,
|
|
323
368
|
R,
|
|
369
|
+
Gn,
|
|
324
370
|
z,
|
|
325
|
-
|
|
326
|
-
]),
|
|
327
|
-
let e =
|
|
371
|
+
Wn
|
|
372
|
+
]), fi = A(() => di(!1), [di]), pi = jn(v, g, g)?.reference ?? null, [mi, hi] = An(0), gi = M(/* @__PURE__ */ new Set()), _i = M(null), vi = A(() => {
|
|
373
|
+
let e = b.getState(), t = e.activeConversationId;
|
|
328
374
|
if (!t) return;
|
|
329
|
-
let n = e.processingByConversationId[t], r =
|
|
330
|
-
if (!
|
|
375
|
+
let n = e.processingByConversationId[t], r = at(n?.status) ? n?.messageId ?? null : null;
|
|
376
|
+
if (!st({
|
|
331
377
|
interruptedTurnId: r,
|
|
332
378
|
activeTurnId: r,
|
|
333
|
-
alreadyRequested: r ?
|
|
379
|
+
alreadyRequested: r ? gi.current.has(r) : !1
|
|
334
380
|
}).send || !r) return;
|
|
335
|
-
|
|
336
|
-
let i =
|
|
337
|
-
!i || !a || !o ||
|
|
381
|
+
gi.current.add(r);
|
|
382
|
+
let i = y(e), a = k(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
383
|
+
!i || !a || !o || oe(i.sandboxId, a, o, i.mode, {
|
|
338
384
|
accessToken: R(),
|
|
339
|
-
workspaceToken:
|
|
340
|
-
userId:
|
|
341
|
-
organizationId:
|
|
385
|
+
workspaceToken: Gn(),
|
|
386
|
+
userId: z,
|
|
387
|
+
organizationId: Tt()
|
|
342
388
|
});
|
|
343
389
|
}, [
|
|
344
|
-
|
|
390
|
+
z,
|
|
345
391
|
R,
|
|
346
|
-
|
|
347
|
-
]),
|
|
348
|
-
let t =
|
|
349
|
-
if (!n || !r || !i) return;
|
|
350
|
-
let a = t.conversations.find((e) => e.id === i), o = a ?
|
|
392
|
+
Gn
|
|
393
|
+
]), yi = A(async (e) => {
|
|
394
|
+
let t = b.getState(), n = y(t), r = k(), i = t.activeConversationId;
|
|
395
|
+
if (!n || !r || !i || Lt(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
396
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? ne(Ae(a.messages), {
|
|
351
397
|
sessionId: a.backendSessionId,
|
|
352
398
|
sandboxId: n.sandboxId,
|
|
353
399
|
nowMs: Date.now()
|
|
354
400
|
}) : null;
|
|
355
401
|
if (o?.reference !== e) {
|
|
356
|
-
|
|
402
|
+
hi((e) => e + 1);
|
|
357
403
|
return;
|
|
358
404
|
}
|
|
359
405
|
let s = {
|
|
360
406
|
conversationId: i,
|
|
361
407
|
reference: e
|
|
362
408
|
};
|
|
363
|
-
if (!
|
|
409
|
+
if (!m(s)) return;
|
|
364
410
|
try {
|
|
365
|
-
await
|
|
411
|
+
await se(n.sandboxId, r, e, n.mode, {
|
|
366
412
|
accessToken: R(),
|
|
367
|
-
workspaceToken:
|
|
368
|
-
userId:
|
|
369
|
-
organizationId:
|
|
413
|
+
workspaceToken: Gn(),
|
|
414
|
+
userId: z,
|
|
415
|
+
organizationId: Tt()
|
|
370
416
|
});
|
|
371
417
|
} catch (e) {
|
|
372
|
-
|
|
373
|
-
id:
|
|
418
|
+
h(s), W(i, {
|
|
419
|
+
id: In(),
|
|
374
420
|
role: "system",
|
|
375
421
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
376
422
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
377
423
|
});
|
|
378
424
|
return;
|
|
379
425
|
}
|
|
380
|
-
|
|
381
|
-
let
|
|
382
|
-
|
|
426
|
+
h(s), ar(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
427
|
+
let c = b.getState(), l = c.conversations.find((e) => e.id === i);
|
|
428
|
+
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || y(c)?.sandboxId !== n.sandboxId || at(c.processingByConversationId[i]?.status) || _(Ae(l.messages)) !== o.messageId || Ai.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
383
429
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
384
430
|
targetConversationId: i
|
|
385
431
|
});
|
|
386
432
|
}, [
|
|
387
|
-
|
|
433
|
+
z,
|
|
388
434
|
W,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
]),
|
|
392
|
-
theme:
|
|
393
|
-
navigate:
|
|
394
|
-
navItems:
|
|
395
|
-
options:
|
|
435
|
+
ar,
|
|
436
|
+
P
|
|
437
|
+
]), bi = e(), { speakFinishedReply: xi } = Ct(), Si = a(), { items: Ci } = On(), wi = M({
|
|
438
|
+
theme: bi,
|
|
439
|
+
navigate: Si,
|
|
440
|
+
navItems: Ci,
|
|
441
|
+
options: Un ?? {}
|
|
396
442
|
});
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
theme:
|
|
400
|
-
navigate:
|
|
401
|
-
navItems:
|
|
402
|
-
options:
|
|
443
|
+
j(() => {
|
|
444
|
+
wi.current = {
|
|
445
|
+
theme: bi,
|
|
446
|
+
navigate: Si,
|
|
447
|
+
navItems: Ci,
|
|
448
|
+
options: Un ?? {}
|
|
403
449
|
};
|
|
404
450
|
}, [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
451
|
+
bi,
|
|
452
|
+
Si,
|
|
453
|
+
Ci,
|
|
454
|
+
Un
|
|
409
455
|
]);
|
|
410
|
-
let
|
|
411
|
-
let
|
|
456
|
+
let Ti = A((e, t, n, r, i) => {
|
|
457
|
+
let a = P(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
|
|
458
|
+
kind: "write-reply",
|
|
459
|
+
line: n.key
|
|
460
|
+
}, c = (/* @__PURE__ */ new Date()).toISOString(), l = In();
|
|
461
|
+
W(e, {
|
|
462
|
+
id: l,
|
|
463
|
+
role: "user",
|
|
464
|
+
content: t,
|
|
465
|
+
timestamp: c,
|
|
466
|
+
metadata: {
|
|
467
|
+
localAction: s,
|
|
468
|
+
...T(i)
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
let u = In();
|
|
472
|
+
W(e, {
|
|
473
|
+
id: u,
|
|
474
|
+
role: "assistant",
|
|
475
|
+
content: a,
|
|
476
|
+
timestamp: c,
|
|
477
|
+
metadata: {
|
|
478
|
+
lang: a === o ? "en" : B,
|
|
479
|
+
localAction: s,
|
|
480
|
+
...T(i)
|
|
481
|
+
}
|
|
482
|
+
}), $t.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", k()), xi(e, u);
|
|
483
|
+
}, [
|
|
484
|
+
W,
|
|
485
|
+
B,
|
|
486
|
+
xi,
|
|
487
|
+
P
|
|
488
|
+
]), Ei = A((e, t, n) => {
|
|
489
|
+
let { theme: r, navigate: i } = wi.current, a, o;
|
|
412
490
|
if (e.kind === "theme") {
|
|
413
491
|
if (!r) return !1;
|
|
414
|
-
let t =
|
|
492
|
+
let t = vn(e.request, {
|
|
415
493
|
mode: r.mode,
|
|
416
494
|
resolvedTheme: r.resolvedTheme
|
|
417
495
|
});
|
|
418
496
|
if (!t.alreadyApplied) try {
|
|
419
497
|
r.setMode(t.mode);
|
|
420
498
|
} catch {}
|
|
421
|
-
a =
|
|
499
|
+
a = xn(P, t, e.request.kind === "family"), o = {
|
|
422
500
|
kind: "theme",
|
|
423
501
|
mode: t.mode,
|
|
424
502
|
alreadyApplied: t.alreadyApplied
|
|
@@ -426,19 +504,19 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
426
504
|
} else {
|
|
427
505
|
if (!i) return !1;
|
|
428
506
|
if (e.kind === "navigate") {
|
|
429
|
-
let { destination: t } = e, n =
|
|
430
|
-
n || i(t.path), a =
|
|
507
|
+
let { destination: t } = e, n = hn(t, window.location.pathname + window.location.search, _n(wi.current.navItems));
|
|
508
|
+
n || i(t.path), a = bn(P, t.label, n), o = {
|
|
431
509
|
kind: "navigate",
|
|
432
510
|
destinationId: t.id,
|
|
433
511
|
path: t.path,
|
|
434
512
|
alreadyHere: n
|
|
435
513
|
};
|
|
436
|
-
} else a =
|
|
514
|
+
} else a = yn(P, e.candidates[0]?.label ?? e.query, e.candidates), o = {
|
|
437
515
|
kind: "choose-destination",
|
|
438
516
|
candidateIds: e.candidates.map((e) => e.id)
|
|
439
517
|
};
|
|
440
518
|
}
|
|
441
|
-
let s =
|
|
519
|
+
let s = b.getState(), c = s.activeConversationId ?? U(void 0, s.autoRouting && Kr.current ? "assistant" : s.mode, s.autoRouting ? { routedBy: "auto" } : void 0), l = (/* @__PURE__ */ new Date()).toISOString(), u = In();
|
|
442
520
|
W(c, {
|
|
443
521
|
id: u,
|
|
444
522
|
role: "user",
|
|
@@ -446,33 +524,45 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
446
524
|
timestamp: l,
|
|
447
525
|
metadata: {
|
|
448
526
|
localAction: o,
|
|
449
|
-
...
|
|
527
|
+
...T(n)
|
|
450
528
|
}
|
|
451
529
|
});
|
|
452
|
-
let
|
|
530
|
+
let d = In();
|
|
453
531
|
return W(c, {
|
|
454
|
-
id:
|
|
532
|
+
id: d,
|
|
455
533
|
role: "assistant",
|
|
456
534
|
content: a.text,
|
|
457
535
|
timestamp: l,
|
|
458
536
|
metadata: {
|
|
459
|
-
lang: a.translated ?
|
|
537
|
+
lang: a.translated ? B : "en",
|
|
460
538
|
localAction: o,
|
|
461
|
-
...
|
|
539
|
+
...T(n)
|
|
462
540
|
}
|
|
463
|
-
}),
|
|
541
|
+
}), $t.recordCommittedEntries(c, [u, d], "LOCAL_COMMAND", k()), xi(c, d), !0;
|
|
464
542
|
}, [
|
|
465
543
|
W,
|
|
466
544
|
U,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
]),
|
|
471
|
-
|
|
545
|
+
B,
|
|
546
|
+
xi,
|
|
547
|
+
P
|
|
548
|
+
]), Di = A(async (e) => {
|
|
549
|
+
Jr.current = !0;
|
|
550
|
+
try {
|
|
551
|
+
await q.declineForReply(e.conversationId, e.reason, e.origin);
|
|
552
|
+
} finally {
|
|
553
|
+
Jr.current = !1;
|
|
554
|
+
}
|
|
555
|
+
if (e.commandText !== null) {
|
|
556
|
+
let t = gn(e.commandText, _n(wi.current.navItems), wi.current.options);
|
|
557
|
+
if (t && Ei(t, e.content, e.options.voiceSessionId)) return;
|
|
558
|
+
}
|
|
559
|
+
await Ai.current(e.content, e.attachments, e.options);
|
|
560
|
+
}, [Ei, q]), Z = A(async (e, t = [], n = {}) => {
|
|
561
|
+
let r = n.voiceSessionId !== void 0, i = b.getState(), a = i.activeConversationId ?? V;
|
|
472
562
|
if (a) {
|
|
473
|
-
if (
|
|
563
|
+
if (at(i.processingByConversationId[a]?.status)) {
|
|
474
564
|
let r = i.processingByConversationId[a]?.messageId ?? null;
|
|
475
|
-
r &&
|
|
565
|
+
r && gi.current.has(r) && (_i.current = {
|
|
476
566
|
conversationId: a,
|
|
477
567
|
content: e,
|
|
478
568
|
attachments: t,
|
|
@@ -480,319 +570,383 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
480
570
|
});
|
|
481
571
|
return;
|
|
482
572
|
}
|
|
483
|
-
if (
|
|
573
|
+
if (ii.current.has(a)) return;
|
|
484
574
|
}
|
|
485
|
-
if (
|
|
486
|
-
let o = n.targetConversationId,
|
|
575
|
+
if (qr.current || g() !== null || Jr.current) return;
|
|
576
|
+
let o = n.targetConversationId, s = p(), c = (e) => Xt(e) || Yt(e, s);
|
|
487
577
|
if (o !== void 0) {
|
|
488
578
|
let e = i.conversations.find((e) => e.id === o);
|
|
489
|
-
if (i.activeConversationId !== o || !e || e.mode !== i.mode ||
|
|
579
|
+
if (i.activeConversationId !== o || !e || e.mode !== i.mode || c(e)) return;
|
|
580
|
+
}
|
|
581
|
+
if (n.fromPerson && n.writeReplyBound === void 0) {
|
|
582
|
+
let r = o ?? i.activeConversationId ?? null, a = n.voiceSessionId === void 0 ? "typed" : "spoken", s = Rt({
|
|
583
|
+
text: e,
|
|
584
|
+
locale: a === "spoken" ? Jn.input.code : B,
|
|
585
|
+
origin: a,
|
|
586
|
+
hasAttachments: t.length > 0,
|
|
587
|
+
live: q.liveFor(r),
|
|
588
|
+
matchesLocalCommand: (e) => gn(e, _n(wi.current.navItems), wi.current.options) !== null
|
|
589
|
+
});
|
|
590
|
+
if (s.kind === "local_reply") {
|
|
591
|
+
r && Ti(r, e, s.line, s.values, n.voiceSessionId);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
let c = s.kind === "local" ? s.fallback : s.bound, l = s.declineAll;
|
|
595
|
+
if (l !== null && r) return Di({
|
|
596
|
+
conversationId: r,
|
|
597
|
+
reason: l,
|
|
598
|
+
origin: a,
|
|
599
|
+
commandText: s.kind === "local" ? s.commandText : null,
|
|
600
|
+
content: e,
|
|
601
|
+
attachments: t,
|
|
602
|
+
options: {
|
|
603
|
+
...n,
|
|
604
|
+
writeReplyBound: c
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
n = {
|
|
608
|
+
...n,
|
|
609
|
+
writeReplyBound: c
|
|
610
|
+
};
|
|
490
611
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
612
|
+
let d = n.writeReplyBound?.promptText ?? e;
|
|
613
|
+
if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
|
|
614
|
+
let t = gn(e, _n(wi.current.navItems), wi.current.options);
|
|
615
|
+
if (t && Ei(t, e, n.voiceSessionId)) return;
|
|
494
616
|
}
|
|
495
|
-
let
|
|
496
|
-
intent: n.autoIntent ??
|
|
617
|
+
let ee = i.activeConversationId ? i.conversations.find((e) => e.id === i.activeConversationId) : void 0, m = c(ee) ? void 0 : ee, h = i.autoRouting && Kr.current && o === void 0 ? f({
|
|
618
|
+
intent: n.autoIntent ?? l(e),
|
|
497
619
|
dictated: r,
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
620
|
+
voiceProposalBound: r && Wn("api-calls") && ie(i.acknowledgedWriteModes, "api-calls"),
|
|
621
|
+
conversation: m ? {
|
|
622
|
+
mode: m.mode,
|
|
623
|
+
routedBy: m.routedBy,
|
|
624
|
+
hasHistory: Jt(m)
|
|
502
625
|
} : null
|
|
503
626
|
}) : null;
|
|
504
|
-
if (
|
|
505
|
-
|
|
627
|
+
if (h && Rr.current.find((e) => e.id === h.mode)?.writeCapable && !ie(i.acknowledgedWriteModes, h.mode)) {
|
|
628
|
+
qr.current = {
|
|
506
629
|
content: e,
|
|
507
630
|
attachments: t,
|
|
508
631
|
options: n
|
|
509
|
-
},
|
|
632
|
+
}, Zr(h.mode);
|
|
510
633
|
return;
|
|
511
634
|
}
|
|
512
|
-
let
|
|
513
|
-
mode:
|
|
514
|
-
backendSessionId:
|
|
635
|
+
let _ = h ? h.mode : i.mode, ne, re, v = o ?? V, y = v ? b.getState().conversations.find((e) => e.id === v) : void 0, se = h?.action === "escalate" && m ? {
|
|
636
|
+
mode: m.mode,
|
|
637
|
+
backendSessionId: m.backendSessionId ?? null
|
|
515
638
|
} : null;
|
|
516
|
-
if (
|
|
639
|
+
if (h) h.action === "new" || !m ? v = U(void 0, _, { routedBy: "auto" }) : (v = m.id, gr(v, _));
|
|
517
640
|
else {
|
|
518
641
|
let e = i.autoRouting ? { routedBy: "auto" } : void 0;
|
|
519
|
-
!
|
|
642
|
+
!v || c(y) || y && y.mode !== _ && Jt(y) ? v = U(void 0, _, e) : y && y.mode !== _ && (e ? gr(v, _) : tr(v, _));
|
|
520
643
|
}
|
|
521
|
-
if (!
|
|
522
|
-
r &&
|
|
523
|
-
let
|
|
644
|
+
if (!v) return;
|
|
645
|
+
r && ni.current !== void 0 && v !== i.activeConversationId && (ni.current = v), n.approvalFollowUp || (ri.current[v] = t);
|
|
646
|
+
let ce = () => b.getState().conversations.some((e) => e.id === v), x = k(), S = {
|
|
524
647
|
accessToken: R(),
|
|
525
|
-
workspaceToken:
|
|
526
|
-
userId:
|
|
527
|
-
organizationId:
|
|
528
|
-
},
|
|
529
|
-
|
|
648
|
+
workspaceToken: Gn(),
|
|
649
|
+
userId: z,
|
|
650
|
+
organizationId: Tt()
|
|
651
|
+
}, fe = (e, t) => {
|
|
652
|
+
ce() || !x || oe(e, x, t, _, {
|
|
530
653
|
accessToken: R(),
|
|
531
|
-
workspaceToken:
|
|
532
|
-
userId:
|
|
533
|
-
organizationId:
|
|
654
|
+
workspaceToken: Gn(),
|
|
655
|
+
userId: z,
|
|
656
|
+
organizationId: Tt()
|
|
534
657
|
});
|
|
535
|
-
},
|
|
536
|
-
id:
|
|
658
|
+
}, he = {
|
|
659
|
+
id: In(),
|
|
537
660
|
role: "user",
|
|
538
661
|
content: e,
|
|
539
662
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
540
663
|
metadata: {
|
|
541
|
-
...t.length ? { attachments: t.map(
|
|
664
|
+
...t.length ? { attachments: t.map(qe) } : {},
|
|
542
665
|
...n.approvalFollowUp ? {
|
|
543
666
|
approvalFollowUp: !0,
|
|
544
667
|
approvedReplyId: n.approvalFollowUp.approvedReplyId
|
|
545
668
|
} : {},
|
|
546
|
-
...
|
|
669
|
+
...T(n.voiceSessionId)
|
|
547
670
|
}
|
|
548
671
|
};
|
|
549
|
-
W(
|
|
550
|
-
let
|
|
551
|
-
W(
|
|
552
|
-
id:
|
|
672
|
+
W(v, he);
|
|
673
|
+
let C = In();
|
|
674
|
+
W(v, {
|
|
675
|
+
id: C,
|
|
553
676
|
role: "assistant",
|
|
554
677
|
content: "",
|
|
555
678
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
556
679
|
metadata: {
|
|
557
|
-
lang:
|
|
558
|
-
...
|
|
680
|
+
lang: Zn,
|
|
681
|
+
...T(n.voiceSessionId)
|
|
559
682
|
}
|
|
560
|
-
}),
|
|
683
|
+
}), yt(C, {
|
|
561
684
|
channel: r ? "voice" : "chat",
|
|
562
|
-
mode:
|
|
563
|
-
product:
|
|
564
|
-
language:
|
|
565
|
-
device:
|
|
566
|
-
routedByAuto: !!
|
|
567
|
-
}, n.voiceTiming),
|
|
568
|
-
let
|
|
569
|
-
turnId:
|
|
570
|
-
abortRequested:
|
|
571
|
-
activeTurnId:
|
|
572
|
-
conversationExists:
|
|
573
|
-
}),
|
|
574
|
-
|
|
685
|
+
mode: _,
|
|
686
|
+
product: F,
|
|
687
|
+
language: Zn,
|
|
688
|
+
device: bt(),
|
|
689
|
+
routedByAuto: !!h
|
|
690
|
+
}, n.voiceTiming), O(C, "accepted"), or(v, "provisioning", C, null), te(C);
|
|
691
|
+
let _e = () => ot({
|
|
692
|
+
turnId: C,
|
|
693
|
+
abortRequested: gi.current.has(C),
|
|
694
|
+
activeTurnId: b.getState().processingByConversationId[v]?.messageId ?? null,
|
|
695
|
+
conversationExists: ce()
|
|
696
|
+
}), ve = (e, t, r, i, a = !1, o = Zn) => {
|
|
697
|
+
ir(v, C, { content: ye(e) }), ar(v, C, {
|
|
575
698
|
lang: o,
|
|
576
699
|
...t?.length ? { artifacts: t } : {},
|
|
577
|
-
...t?.length || r || i ? { mode:
|
|
700
|
+
...t?.length || r || i ? { mode: _ } : {},
|
|
578
701
|
...r ? { sessionId: r } : {},
|
|
579
702
|
...i ? { sandboxId: i } : {},
|
|
580
703
|
...a ? { incomplete: !0 } : {},
|
|
581
|
-
...
|
|
704
|
+
...T(n.voiceSessionId)
|
|
582
705
|
});
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
let
|
|
706
|
+
}, Ae = { session: null }, w = async (i = 1) => {
|
|
707
|
+
O(C, "attemptStarted");
|
|
708
|
+
let a = null, o = null, s = !1;
|
|
586
709
|
try {
|
|
587
|
-
let { sandboxId:
|
|
588
|
-
turnId:
|
|
589
|
-
abortRequested:
|
|
590
|
-
activeTurnId:
|
|
591
|
-
conversationExists:
|
|
710
|
+
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: f, sandboxProbed: p, sandboxAdopted: ee, deadSandboxProbe: m } = await ui(v, C, _, x, S, { isAbandoned: () => ot({
|
|
711
|
+
turnId: C,
|
|
712
|
+
abortRequested: gi.current.has(C),
|
|
713
|
+
activeTurnId: b.getState().processingByConversationId[v]?.messageId ?? null,
|
|
714
|
+
conversationExists: ce()
|
|
592
715
|
}).abandon });
|
|
593
|
-
|
|
594
|
-
runtime:
|
|
595
|
-
deadSandboxProbe:
|
|
596
|
-
}),
|
|
597
|
-
|
|
598
|
-
|
|
716
|
+
if (a = i, O(C, "runtimeReady"), D(C, {
|
|
717
|
+
runtime: f ? "cold" : ee ? "adopted" : p ? "probed" : l ? "new-session" : "warm",
|
|
718
|
+
deadSandboxProbe: m
|
|
719
|
+
}), o = c, Ae.session = {
|
|
720
|
+
sandboxId: i,
|
|
721
|
+
sessionId: c
|
|
722
|
+
}, ae(_, ne, b.getState().acknowledgedWriteModes, {
|
|
723
|
+
dictated: r,
|
|
724
|
+
confirmsWrites: pe(_),
|
|
725
|
+
proposalBound: Wn(_, i)
|
|
726
|
+
}) === "voice-in-write-mode") throw new be("voice-in-write-mode", "Voice in a write mode");
|
|
727
|
+
let h = tn({
|
|
728
|
+
conversation: b.getState().conversations.find((e) => e.id === v),
|
|
599
729
|
content: e,
|
|
600
|
-
sessionIsNew:
|
|
601
|
-
sendingMode:
|
|
602
|
-
sendingModeConfig:
|
|
603
|
-
modes:
|
|
604
|
-
answerText: (e) =>
|
|
605
|
-
}),
|
|
606
|
-
|
|
607
|
-
let
|
|
608
|
-
|
|
730
|
+
sessionIsNew: l,
|
|
731
|
+
sendingMode: _,
|
|
732
|
+
sendingModeConfig: ne,
|
|
733
|
+
modes: Rr.current,
|
|
734
|
+
answerText: (e) => ht(e).text
|
|
735
|
+
}), g = await ft(() => de(i, x, c, _, S, { limit: 50 }), l, dt(u, i, c));
|
|
736
|
+
ci(v, C, "streaming", "thinking");
|
|
737
|
+
let te = zn?.(), ie = zt(b.getState().sandboxWriteCapabilities[i]), y = {
|
|
738
|
+
conversationId: v,
|
|
739
|
+
writeReply: ie === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null
|
|
740
|
+
}, { prompt: oe, parts: se } = it({
|
|
741
|
+
content: h ? `${h}${d}` : d,
|
|
609
742
|
attachments: t,
|
|
610
|
-
limits:
|
|
611
|
-
wrapPrompt: (e) =>
|
|
612
|
-
requestBytes: (e, t) =>
|
|
613
|
-
sandboxId:
|
|
614
|
-
workspaceId:
|
|
615
|
-
sessionId:
|
|
616
|
-
mode:
|
|
743
|
+
limits: Ke(ne),
|
|
744
|
+
wrapPrompt: (e) => Bn?.(_, e, Yn, Xn, r, { writeApproval: ie }) ?? e,
|
|
745
|
+
requestBytes: (e, t) => me({
|
|
746
|
+
sandboxId: i,
|
|
747
|
+
workspaceId: x,
|
|
748
|
+
sessionId: c,
|
|
749
|
+
mode: _,
|
|
617
750
|
prompt: e,
|
|
618
751
|
parts: t,
|
|
619
|
-
pageContext:
|
|
620
|
-
authContext:
|
|
752
|
+
pageContext: te,
|
|
753
|
+
authContext: S,
|
|
754
|
+
...y
|
|
621
755
|
})
|
|
622
|
-
}),
|
|
623
|
-
|
|
624
|
-
let
|
|
625
|
-
if (
|
|
626
|
-
|
|
756
|
+
}), xe = Ue(se), Se = xe > 0;
|
|
757
|
+
s = He(t) > xe;
|
|
758
|
+
let Ce = _e();
|
|
759
|
+
if (Ce.abandon) {
|
|
760
|
+
Ce.clearProcessing && sr(v);
|
|
627
761
|
return;
|
|
628
762
|
}
|
|
629
763
|
try {
|
|
630
|
-
await
|
|
764
|
+
await ge(i, x, c, oe, _, te, S, se?.length ? {
|
|
765
|
+
parts: se,
|
|
766
|
+
...y
|
|
767
|
+
} : y);
|
|
631
768
|
} catch (e) {
|
|
632
|
-
if (!
|
|
633
|
-
await
|
|
769
|
+
if (!se || !Et(e)) throw e;
|
|
770
|
+
await ge(i, x, c, oe, _, te, S, y), s ||= Se;
|
|
634
771
|
}
|
|
635
|
-
|
|
636
|
-
let
|
|
637
|
-
for (; Date.now() <
|
|
638
|
-
|
|
639
|
-
let e =
|
|
772
|
+
O(C, "promptSent");
|
|
773
|
+
let Te = null, De = !1, Oe = lt, w = ut([], g), T = Date.now() + re.streamBudgetMs, E = Date.now(), je = Date.now();
|
|
774
|
+
for (; Date.now() < T;) {
|
|
775
|
+
fe(i, c);
|
|
776
|
+
let e = _e();
|
|
640
777
|
if (e.abandon) {
|
|
641
|
-
e.clearProcessing &&
|
|
778
|
+
e.clearProcessing && sr(v);
|
|
642
779
|
return;
|
|
643
780
|
}
|
|
644
|
-
if (
|
|
781
|
+
if (w = ut(await de(i, x, c, _, S, {
|
|
645
782
|
limit: 50,
|
|
646
|
-
sinceMs:
|
|
647
|
-
}),
|
|
783
|
+
sinceMs: g
|
|
784
|
+
}), g, { accumulateNarration: re.accumulatesNarration }), ir(v, C, { content: ye(w.content) }), w.hasRenderableOutput ? De || (De = !0, Te !== null && O(C, "lastQuietPoll", Te), O(C, "firstOutput")) : Te = St(), re.accumulatesNarration) w.hasText && O(C, "firstText");
|
|
648
785
|
else {
|
|
649
|
-
let e =
|
|
650
|
-
|
|
786
|
+
let e = mt(Oe, w, St());
|
|
787
|
+
Oe = e.tracker, e.confirmedAt !== null && O(C, "firstText", e.confirmedAt);
|
|
651
788
|
}
|
|
652
|
-
if (
|
|
653
|
-
|
|
789
|
+
if (w.pendingWrite && !Lt(b.getState().sandboxWriteCapabilities[i]) && ar(v, C, { pendingWrite: w.pendingWrite }), w.done) {
|
|
790
|
+
O(C, "answerDone"), J.current.markVerified(i);
|
|
654
791
|
break;
|
|
655
792
|
}
|
|
656
|
-
Date.now() -
|
|
793
|
+
Date.now() - E > 3e4 && (await le(i, x, 600, S).catch(() => void 0), E = Date.now()), await new Promise((e) => setTimeout(e, Pe(Date.now() - je)));
|
|
657
794
|
}
|
|
658
|
-
let
|
|
659
|
-
|
|
660
|
-
...
|
|
661
|
-
content:
|
|
662
|
-
}),
|
|
663
|
-
...
|
|
664
|
-
content: `${
|
|
795
|
+
let Me = re.producesArtifacts ? await ue(i, x, c, _, S).then((e) => e).catch(() => []) : void 0;
|
|
796
|
+
w.usedTools !== void 0 && D(C, { usedTools: w.usedTools }), w.done || (D(C, { outcome: "timedOut" }), w = {
|
|
797
|
+
...w,
|
|
798
|
+
content: ke(w.content, _, P, ne)
|
|
799
|
+
}), s && (w = {
|
|
800
|
+
...w,
|
|
801
|
+
content: `${w.content}\n\n${P("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._")}`
|
|
665
802
|
});
|
|
666
|
-
let
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
} catch {}
|
|
678
|
-
}
|
|
679
|
-
E.done || ce(n, s);
|
|
680
|
-
let De = ue();
|
|
681
|
-
if (De.abandon) {
|
|
682
|
-
De.clearProcessing && Pn(y);
|
|
803
|
+
let Ne = !w.done;
|
|
804
|
+
ve(w.content, Me, c, i, Ne), w.tokens && (ir(v, C, { tokens: w.tokens }), (Hn ? await Ee({
|
|
805
|
+
workspaceId: x,
|
|
806
|
+
sessionId: c,
|
|
807
|
+
messageId: w.messageId,
|
|
808
|
+
model: w.model,
|
|
809
|
+
tokens: w.tokens
|
|
810
|
+
}, Hn, { ledger: we("panel", F) }) : { ok: !0 }).ok && Cn(F)), w.done || fe(i, c);
|
|
811
|
+
let Fe = _e();
|
|
812
|
+
if (Fe.abandon) {
|
|
813
|
+
Fe.clearProcessing && sr(v);
|
|
683
814
|
return;
|
|
684
815
|
}
|
|
685
|
-
|
|
816
|
+
O(C, "complete"), D(C, { outcome: "answered" }), or(v, "complete", C, null), $t.recordCommittedEntries(v, [he.id, C], "TURN", x);
|
|
686
817
|
} catch (e) {
|
|
687
|
-
J.current.invalidate(
|
|
688
|
-
let t =
|
|
689
|
-
turnId:
|
|
690
|
-
abortRequested:
|
|
691
|
-
activeTurnId:
|
|
692
|
-
conversationExists:
|
|
818
|
+
J.current.invalidate(a ?? b.getState().sandboxesByMode[_]?.sandboxId ?? null);
|
|
819
|
+
let t = ot({
|
|
820
|
+
turnId: C,
|
|
821
|
+
abortRequested: gi.current.has(C),
|
|
822
|
+
activeTurnId: b.getState().processingByConversationId[v]?.messageId ?? null,
|
|
823
|
+
conversationExists: ce()
|
|
693
824
|
});
|
|
694
|
-
if (
|
|
695
|
-
t.clearProcessing &&
|
|
825
|
+
if (a && o && fe(a, o), t.abandon) {
|
|
826
|
+
t.clearProcessing && sr(v);
|
|
696
827
|
return;
|
|
697
828
|
}
|
|
698
|
-
if (
|
|
699
|
-
let e =
|
|
700
|
-
return e && (Y.current.add(e), J.current.invalidate(e)),
|
|
829
|
+
if (i === 1 && Dt(e)) {
|
|
830
|
+
let e = a ?? b.getState().sandboxesByMode[_]?.sandboxId ?? null;
|
|
831
|
+
return e && (Y.current.add(e), J.current.invalidate(e)), lr(v), dr(_), rr(v, C, ""), ar(v, C, { pendingWrite: void 0 }), e && q.retireSandbox(e), xt(C), w(2);
|
|
701
832
|
}
|
|
702
833
|
throw e;
|
|
703
834
|
}
|
|
704
|
-
},
|
|
705
|
-
|
|
835
|
+
}, E = v;
|
|
836
|
+
ii.current.add(E);
|
|
706
837
|
try {
|
|
707
|
-
if (!
|
|
838
|
+
if (!x) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
708
839
|
code: "UNAUTHENTICATED",
|
|
709
840
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
710
841
|
} });
|
|
711
|
-
let e = await
|
|
712
|
-
|
|
713
|
-
let t =
|
|
842
|
+
let e = await rt(_, () => Rr.current.find((e) => e.id === _), Lr);
|
|
843
|
+
ne = e.config, re = e.capabilities;
|
|
844
|
+
let t = ne, n = _e();
|
|
714
845
|
if (n.abandon) {
|
|
715
|
-
n.clearProcessing &&
|
|
846
|
+
n.clearProcessing && sr(v);
|
|
716
847
|
return;
|
|
717
848
|
}
|
|
718
|
-
let i =
|
|
849
|
+
let i = ae(_, t, b.getState().acknowledgedWriteModes, {
|
|
719
850
|
dictated: r,
|
|
720
|
-
confirmsWrites:
|
|
851
|
+
confirmsWrites: pe(_),
|
|
852
|
+
proposalBound: Wn(_)
|
|
721
853
|
});
|
|
722
|
-
if (i) throw new
|
|
723
|
-
|
|
854
|
+
if (i) throw new be(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
855
|
+
let a = we("panel", F);
|
|
856
|
+
if (Hn && Te(a, x)) {
|
|
857
|
+
let e = await De(a, x, Hn);
|
|
858
|
+
if (!e.ok) throw Oe(e.kind);
|
|
859
|
+
let t = _e();
|
|
860
|
+
if (t.abandon) {
|
|
861
|
+
t.clearProcessing && sr(v);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
O(C, "cleared"), await w();
|
|
724
866
|
} catch (e) {
|
|
725
|
-
if (J.current.invalidate(
|
|
726
|
-
|
|
867
|
+
if (J.current.invalidate(b.getState().sandboxesByMode[_]?.sandboxId ?? null), !ce()) {
|
|
868
|
+
sr(v);
|
|
727
869
|
return;
|
|
728
870
|
}
|
|
729
|
-
let t =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
871
|
+
let t = Ae.session?.sandboxId ?? null, r = xe(e, { confirmsNoAction: Se({
|
|
872
|
+
mode: _,
|
|
873
|
+
capabilities: t ? b.getState().sandboxWriteCapabilities[t] : null
|
|
874
|
+
}) });
|
|
875
|
+
D(C, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && Sn(F, "sandbox");
|
|
876
|
+
let i = Ce(r, P);
|
|
877
|
+
or(v, "error", C, i.headline), ir(v, C, { content: i.text }), ar(v, C, {
|
|
878
|
+
lang: i.translated ? B : "en",
|
|
879
|
+
...T(n.voiceSessionId)
|
|
735
880
|
});
|
|
736
881
|
} finally {
|
|
737
|
-
|
|
738
|
-
let e =
|
|
739
|
-
t && (
|
|
740
|
-
|
|
741
|
-
|
|
882
|
+
ii.current.delete(E), D(C, { outcome: "stopped" }), O(C, "complete");
|
|
883
|
+
let e = b.getState(), t = u(se, _, e.conversations.find((e) => e.id === E), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
884
|
+
t && (gr(E, t.mode), t.backendSessionId && cr(E, t.backendSessionId)), Ae.session && ce() && q.afterTurn({
|
|
885
|
+
...Ae.session,
|
|
886
|
+
conversationId: E
|
|
887
|
+
}, C);
|
|
888
|
+
let n = _i.current;
|
|
889
|
+
_i.current = null, n && n.conversationId === E && ce() && Ai.current(n.content, n.attachments, n.options);
|
|
742
890
|
}
|
|
743
891
|
}, [
|
|
744
892
|
V,
|
|
745
893
|
W,
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
894
|
+
Bn,
|
|
895
|
+
lr,
|
|
896
|
+
dr,
|
|
897
|
+
Qn,
|
|
750
898
|
U,
|
|
751
|
-
|
|
752
|
-
|
|
899
|
+
ui,
|
|
900
|
+
q,
|
|
901
|
+
Ti,
|
|
902
|
+
Di,
|
|
903
|
+
B,
|
|
904
|
+
Jn,
|
|
905
|
+
Wn,
|
|
906
|
+
zn,
|
|
753
907
|
R,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
I,
|
|
757
|
-
rr,
|
|
758
|
-
gn,
|
|
759
|
-
Cn,
|
|
760
|
-
vn,
|
|
761
|
-
wn,
|
|
762
|
-
Sn,
|
|
763
|
-
Vn,
|
|
764
|
-
Ur,
|
|
765
|
-
Fn,
|
|
766
|
-
On,
|
|
767
|
-
Nn,
|
|
768
|
-
Pn,
|
|
908
|
+
Gn,
|
|
909
|
+
ir,
|
|
769
910
|
F,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
911
|
+
Lr,
|
|
912
|
+
Hn,
|
|
913
|
+
Xn,
|
|
914
|
+
B,
|
|
915
|
+
Zn,
|
|
916
|
+
Yn,
|
|
917
|
+
gr,
|
|
918
|
+
Ei,
|
|
919
|
+
cr,
|
|
920
|
+
tr,
|
|
921
|
+
or,
|
|
922
|
+
sr,
|
|
923
|
+
P,
|
|
924
|
+
ci,
|
|
925
|
+
rr,
|
|
926
|
+
z
|
|
927
|
+
]), Oi = A((e, t) => {
|
|
928
|
+
Z(e, [], t ? { autoIntent: t } : {});
|
|
929
|
+
}, [Z]), ki = A(() => {
|
|
930
|
+
let e = [...vr.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
777
931
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
778
|
-
let t = V ?
|
|
779
|
-
|
|
932
|
+
let t = V ? ri.current[V] ?? [] : [];
|
|
933
|
+
Z(e.content, t);
|
|
780
934
|
}, [
|
|
781
|
-
|
|
782
|
-
|
|
935
|
+
yr,
|
|
936
|
+
Z,
|
|
783
937
|
V
|
|
784
|
-
]),
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
}, [
|
|
788
|
-
let
|
|
789
|
-
if (
|
|
790
|
-
for (let e =
|
|
791
|
-
let t =
|
|
792
|
-
if (t?.role !== "assistant" || !
|
|
793
|
-
let n =
|
|
938
|
+
]), Ai = M(Z);
|
|
939
|
+
j(() => {
|
|
940
|
+
Ai.current = Z;
|
|
941
|
+
}, [Z]);
|
|
942
|
+
let ji = kn(() => {
|
|
943
|
+
if (K) return null;
|
|
944
|
+
for (let e = yr.length - 1; e >= 0; --e) {
|
|
945
|
+
let t = yr[e];
|
|
946
|
+
if (t?.role !== "assistant" || !w(t) || gi.current.has(t.id)) continue;
|
|
947
|
+
let n = ct(t, G, P);
|
|
794
948
|
if (n.kind !== "output") return null;
|
|
795
|
-
let r =
|
|
949
|
+
let r = ht(n.text).text.trim();
|
|
796
950
|
return r ? {
|
|
797
951
|
id: t.id,
|
|
798
952
|
text: r
|
|
@@ -800,53 +954,70 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
800
954
|
}
|
|
801
955
|
return null;
|
|
802
956
|
}, [
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
]),
|
|
808
|
-
sessionId:
|
|
809
|
-
sandboxId:
|
|
957
|
+
yr,
|
|
958
|
+
K,
|
|
959
|
+
G,
|
|
960
|
+
P
|
|
961
|
+
]), Mi = kn(() => ji ? Fe(ji.text) : null, [ji]), Ni = vr.chat, Pi = b((e) => y(e)?.sandboxId ?? null), Fi = ne(Ni, {
|
|
962
|
+
sessionId: _r?.backendSessionId,
|
|
963
|
+
sandboxId: Pi,
|
|
810
964
|
nowMs: Date.now()
|
|
811
|
-
}),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
965
|
+
}), Ii = re(Ni), Li = (e) => {
|
|
966
|
+
if (It(e.metadata).length > 0) return !0;
|
|
967
|
+
let t = e.metadata?.sandboxId;
|
|
968
|
+
return Lt(t ? Sr[t] : null);
|
|
969
|
+
}, Ri = (e) => {
|
|
970
|
+
let t = It(e.metadata);
|
|
971
|
+
return t.length === 0 || !V ? null : /* @__PURE__ */ N(Ft, {
|
|
972
|
+
refs: t,
|
|
973
|
+
conversationId: V,
|
|
974
|
+
panel: q,
|
|
975
|
+
entries: Cr,
|
|
976
|
+
capabilitiesOf: (e) => Sr[e],
|
|
977
|
+
turnInFlight: K,
|
|
978
|
+
tr: P,
|
|
979
|
+
onReview: Tr.review,
|
|
980
|
+
retiredSandboxes: wr
|
|
981
|
+
});
|
|
982
|
+
}, zi = Tr.dialog.view ? Cr[Tr.dialog.view.proposalId] : void 0, Bi = Fi?.expiresAtMs ?? null;
|
|
983
|
+
j(() => {
|
|
984
|
+
if (Bi === null) return;
|
|
985
|
+
let e = window.setTimeout(() => hi((e) => e + 1), Math.max(0, Bi - Date.now()));
|
|
815
986
|
return () => window.clearTimeout(e);
|
|
816
|
-
}, [
|
|
817
|
-
let Q =
|
|
987
|
+
}, [Bi, mi]);
|
|
988
|
+
let Q = kn(() => vr.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
818
989
|
id: e.id,
|
|
819
990
|
role: e.role,
|
|
820
|
-
text:
|
|
821
|
-
sessionId:
|
|
991
|
+
text: vt(e, G, P),
|
|
992
|
+
sessionId: E(e),
|
|
822
993
|
timestamp: e.timestamp
|
|
823
994
|
})).filter((e) => e.text.length > 0), [
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
]),
|
|
995
|
+
vr.voice,
|
|
996
|
+
G,
|
|
997
|
+
P
|
|
998
|
+
]), Vi = A(() => {
|
|
828
999
|
if (Q.length === 0) return;
|
|
829
1000
|
let e = /* @__PURE__ */ new Date();
|
|
830
|
-
|
|
831
|
-
title:
|
|
832
|
-
savedAt:
|
|
833
|
-
session:
|
|
834
|
-
earlier:
|
|
835
|
-
you:
|
|
836
|
-
assistant:
|
|
837
|
-
}, e),
|
|
1001
|
+
qt(Me(Q, {
|
|
1002
|
+
title: P("voiceSession.transcript", "Voice conversation"),
|
|
1003
|
+
savedAt: P("voiceSession.savedAt", "Saved"),
|
|
1004
|
+
session: P("voiceSession.sessionLabel", "Session"),
|
|
1005
|
+
earlier: P("voiceSession.earlierLabel", "Earlier"),
|
|
1006
|
+
you: P("voiceSession.speakerYou", "You"),
|
|
1007
|
+
assistant: P("voiceSession.speakerAssistant", "Assistant")
|
|
1008
|
+
}, e), Ne(F, e), "text/markdown");
|
|
838
1009
|
}, [
|
|
839
|
-
|
|
1010
|
+
F,
|
|
840
1011
|
Q,
|
|
841
|
-
|
|
842
|
-
]),
|
|
843
|
-
|
|
844
|
-
let
|
|
845
|
-
onSubmit:
|
|
846
|
-
let r =
|
|
847
|
-
let i =
|
|
848
|
-
if (!
|
|
849
|
-
sessionLive:
|
|
1012
|
+
P
|
|
1013
|
+
]), Hi = wn({ perFileChars: Yr }), Ui = M(Hi);
|
|
1014
|
+
Ui.current = Hi;
|
|
1015
|
+
let Wi = M(/* @__PURE__ */ new Set()), Gi = M(() => !1), $ = wt({
|
|
1016
|
+
onSubmit: A((e, t, n) => {
|
|
1017
|
+
let r = ni.current, i = () => {
|
|
1018
|
+
let i = Ui.current, a = b.getState();
|
|
1019
|
+
if (!ze({
|
|
1020
|
+
sessionLive: Gi.current(t),
|
|
850
1021
|
boundAtSubmit: r,
|
|
851
1022
|
activeConversationId: a.activeConversationId,
|
|
852
1023
|
boundConversationExists: a.conversations.some((e) => e.id === r)
|
|
@@ -854,277 +1025,367 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
854
1025
|
i.clear();
|
|
855
1026
|
return;
|
|
856
1027
|
}
|
|
857
|
-
let o =
|
|
1028
|
+
let o = We(i.attachments), s = {
|
|
858
1029
|
...n,
|
|
859
|
-
handedOver:
|
|
1030
|
+
handedOver: St()
|
|
860
1031
|
};
|
|
861
|
-
|
|
1032
|
+
Ai.current(e, o, {
|
|
862
1033
|
fromPerson: !0,
|
|
863
1034
|
voiceSessionId: t,
|
|
864
1035
|
voiceTiming: s
|
|
865
1036
|
}), i.clear();
|
|
866
1037
|
};
|
|
867
|
-
if (!
|
|
1038
|
+
if (!Ui.current.isBusy) {
|
|
868
1039
|
i();
|
|
869
1040
|
return;
|
|
870
1041
|
}
|
|
871
|
-
let a = Date.now(), o =
|
|
872
|
-
|
|
1042
|
+
let a = Date.now(), o = Wi.current, s = window.setInterval(() => {
|
|
1043
|
+
Ui.current.isBusy && Date.now() - a < Pn || (window.clearInterval(s), o.delete(s), i());
|
|
873
1044
|
}, 200);
|
|
874
1045
|
o.add(s);
|
|
875
1046
|
}, []),
|
|
876
|
-
latestReply:
|
|
877
|
-
language:
|
|
1047
|
+
latestReply: ji,
|
|
1048
|
+
language: Ie(Kn, B).tag
|
|
878
1049
|
});
|
|
879
|
-
|
|
880
|
-
let
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1050
|
+
Gi.current = $.isCurrentSession;
|
|
1051
|
+
let Ki = $.active, qi = kn(() => $e(Object.values(Cr), V, wr), [
|
|
1052
|
+
Cr,
|
|
1053
|
+
V,
|
|
1054
|
+
wr
|
|
1055
|
+
]), [Ji, Yi] = An(null);
|
|
1056
|
+
j(() => {
|
|
1057
|
+
Ki || Yi(null);
|
|
1058
|
+
}, [Ki]);
|
|
1059
|
+
let Xi = Tr.review, Zi = A(() => {
|
|
1060
|
+
let e = qi[qi.length - 1];
|
|
1061
|
+
if (!e) return;
|
|
1062
|
+
let { view: t } = e;
|
|
1063
|
+
if (Mt(t) && jt(t, Sr[e.session.sandboxId]).offerConfirm) {
|
|
1064
|
+
Xi(t);
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
Yi(t.proposalId);
|
|
1068
|
+
}, [
|
|
1069
|
+
qi,
|
|
1070
|
+
Sr,
|
|
1071
|
+
Xi
|
|
1072
|
+
]), Qi = Ki ? Xe(qi) : null, $i = Ji ? Cr[Ji] : void 0, ea = Ki && $i && $i.session.conversationId === V ? {
|
|
1073
|
+
content: /* @__PURE__ */ N(Ft, {
|
|
1074
|
+
refs: [{
|
|
1075
|
+
proposalId: $i.view.proposalId,
|
|
1076
|
+
sandboxId: $i.session.sandboxId,
|
|
1077
|
+
sessionId: $i.session.sessionId
|
|
1078
|
+
}],
|
|
1079
|
+
conversationId: $i.session.conversationId,
|
|
1080
|
+
panel: q,
|
|
1081
|
+
entries: Cr,
|
|
1082
|
+
capabilitiesOf: (e) => Sr[e],
|
|
1083
|
+
turnInFlight: K,
|
|
1084
|
+
tr: P,
|
|
1085
|
+
onReview: Xi,
|
|
1086
|
+
retiredSandboxes: wr
|
|
1087
|
+
}),
|
|
1088
|
+
closeLabel: et(P, Je.trayClose),
|
|
1089
|
+
onClose: () => Yi(null)
|
|
1090
|
+
} : null, ta = Tr.asking, na = $.holdListening;
|
|
1091
|
+
j(() => {
|
|
1092
|
+
na(Ki && ta);
|
|
1093
|
+
}, [
|
|
1094
|
+
Ki,
|
|
1095
|
+
ta,
|
|
1096
|
+
na
|
|
1097
|
+
]);
|
|
1098
|
+
let ra = M(null), ia = $.announce;
|
|
1099
|
+
j(() => {
|
|
1100
|
+
if (!Ki) {
|
|
1101
|
+
ra.current = null;
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
let e = ra.current;
|
|
1105
|
+
if (e === null) {
|
|
1106
|
+
ra.current = new Set(Object.keys(Cr));
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
for (let { view: t, session: n } of Qe(qi, e)) {
|
|
1110
|
+
e.add(t.proposalId);
|
|
1111
|
+
let r = Sr[n.sandboxId];
|
|
1112
|
+
if (!Ye({
|
|
1113
|
+
mode: "api-calls",
|
|
1114
|
+
productWriteApproval: L,
|
|
1115
|
+
capabilities: r
|
|
1116
|
+
})) continue;
|
|
1117
|
+
let i = tt(t, jt(t, r).offerConfirm, P), a = t.proposalId;
|
|
1118
|
+
ia({
|
|
1119
|
+
id: `write-readback:${a}`,
|
|
1120
|
+
text: i.text,
|
|
1121
|
+
lang: i.translated ? B : "en",
|
|
1122
|
+
stillWanted: () => q.entry(a)?.view.status === "pending"
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
}, [
|
|
1126
|
+
Ki,
|
|
1127
|
+
qi,
|
|
1128
|
+
Cr,
|
|
1129
|
+
Sr,
|
|
1130
|
+
L,
|
|
1131
|
+
P,
|
|
1132
|
+
B,
|
|
1133
|
+
ia,
|
|
1134
|
+
q
|
|
1135
|
+
]);
|
|
1136
|
+
let aa = M(!1);
|
|
1137
|
+
j(() => {
|
|
1138
|
+
aa.current = $.active;
|
|
1139
|
+
}, [$.active]), j(() => ee((e) => {
|
|
1140
|
+
if (!aa.current) return !1;
|
|
1141
|
+
let t = ni.current;
|
|
1142
|
+
return typeof t == "string" ? t === e : b.getState().activeConversationId === e;
|
|
887
1143
|
}), []);
|
|
888
|
-
let
|
|
889
|
-
|
|
890
|
-
}, [
|
|
891
|
-
let e =
|
|
1144
|
+
let oa = $.start, sa = A(() => {
|
|
1145
|
+
di(!0), oa();
|
|
1146
|
+
}, [di, oa]), ca = kn(() => _t(_r?.messages ?? []), [_r?.messages]), la = gt(vr.voice, G, P), ua = gt(ca, G, P) > 0, da = A(() => {
|
|
1147
|
+
let e = b.getState().activeConversationId;
|
|
892
1148
|
if (!e || Q.length === 0) return;
|
|
893
|
-
let t = new Set(
|
|
1149
|
+
let t = new Set(ca.map((e) => e.id)), n = In();
|
|
894
1150
|
W(e, {
|
|
895
1151
|
id: n,
|
|
896
1152
|
role: "system",
|
|
897
|
-
content:
|
|
898
|
-
intro:
|
|
899
|
-
nothing:
|
|
900
|
-
more: (e) =>
|
|
1153
|
+
content: je(Q.filter((e) => t.has(e.id)), {
|
|
1154
|
+
intro: P("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
1155
|
+
nothing: P("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
1156
|
+
more: (e) => P("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
901
1157
|
}),
|
|
902
1158
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
903
|
-
metadata: { continuedVoiceTurns:
|
|
904
|
-
}),
|
|
1159
|
+
metadata: { continuedVoiceTurns: la }
|
|
1160
|
+
}), $t.recordCommittedEntries(e, [n], "NOTE", k()), ti(!1), $.end();
|
|
905
1161
|
}, [
|
|
906
1162
|
Q,
|
|
907
|
-
|
|
908
|
-
|
|
1163
|
+
la,
|
|
1164
|
+
ca,
|
|
909
1165
|
W,
|
|
910
|
-
|
|
1166
|
+
P,
|
|
911
1167
|
$,
|
|
912
|
-
|
|
913
|
-
]),
|
|
914
|
-
|
|
915
|
-
$.active && (
|
|
1168
|
+
ti
|
|
1169
|
+
]), fa = M(0);
|
|
1170
|
+
j(() => {
|
|
1171
|
+
$.active && (fa.current = la);
|
|
916
1172
|
}, [$.active]);
|
|
917
|
-
let
|
|
918
|
-
let e =
|
|
919
|
-
$.end(), e &&
|
|
1173
|
+
let pa = A(() => {
|
|
1174
|
+
let e = la > fa.current;
|
|
1175
|
+
$.end(), e && ti(!0);
|
|
920
1176
|
}, [
|
|
921
|
-
|
|
1177
|
+
la,
|
|
922
1178
|
$,
|
|
923
|
-
|
|
1179
|
+
ti
|
|
924
1180
|
]);
|
|
925
|
-
|
|
926
|
-
(!
|
|
1181
|
+
j(() => {
|
|
1182
|
+
(!Ln || !si) && $.active && $.end();
|
|
927
1183
|
}, [
|
|
928
|
-
|
|
929
|
-
|
|
1184
|
+
Ln,
|
|
1185
|
+
si,
|
|
930
1186
|
$
|
|
931
|
-
]),
|
|
932
|
-
let e =
|
|
1187
|
+
]), j(() => {
|
|
1188
|
+
let e = ni.current, t = b.getState(), n = Ve({
|
|
933
1189
|
sessionLive: $.active,
|
|
934
1190
|
bound: e,
|
|
935
1191
|
activeConversationId: t.activeConversationId,
|
|
936
1192
|
boundConversationExists: t.conversations.some((t) => t.id === e)
|
|
937
1193
|
});
|
|
938
|
-
|
|
1194
|
+
ni.current = n.bound, n.end && $.end();
|
|
939
1195
|
}, [
|
|
940
1196
|
$,
|
|
941
1197
|
V,
|
|
942
|
-
|
|
1198
|
+
Qn
|
|
943
1199
|
]);
|
|
944
|
-
let
|
|
945
|
-
|
|
946
|
-
let e =
|
|
1200
|
+
let ma = M(Re);
|
|
1201
|
+
j(() => {
|
|
1202
|
+
let e = Be(ma.current, {
|
|
947
1203
|
activeConversationId: V,
|
|
948
|
-
chatTurnCount:
|
|
1204
|
+
chatTurnCount: Ni.length,
|
|
949
1205
|
voiceTurnCount: Q.length,
|
|
950
1206
|
sessionLive: $.active,
|
|
951
|
-
sessionBoundTo:
|
|
952
|
-
turnInFlight:
|
|
1207
|
+
sessionBoundTo: ni.current,
|
|
1208
|
+
turnInFlight: K
|
|
953
1209
|
});
|
|
954
|
-
|
|
1210
|
+
ma.current = e.state, e.open && ti(!0);
|
|
955
1211
|
}, [
|
|
956
1212
|
V,
|
|
957
|
-
|
|
1213
|
+
Ni.length,
|
|
958
1214
|
Q.length,
|
|
959
1215
|
$.active,
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
]),
|
|
1216
|
+
K,
|
|
1217
|
+
ti
|
|
1218
|
+
]), j(() => {
|
|
963
1219
|
if (!$.active) {
|
|
964
|
-
|
|
965
|
-
for (let e of
|
|
966
|
-
|
|
1220
|
+
Ui.current.clear(), _i.current = null;
|
|
1221
|
+
for (let e of Wi.current) window.clearInterval(e);
|
|
1222
|
+
Wi.current.clear();
|
|
967
1223
|
}
|
|
968
|
-
}, [$.active]),
|
|
969
|
-
let e =
|
|
1224
|
+
}, [$.active]), j(() => {
|
|
1225
|
+
let e = Wi.current;
|
|
970
1226
|
return () => {
|
|
971
1227
|
for (let t of e) window.clearInterval(t);
|
|
972
1228
|
e.clear();
|
|
973
1229
|
};
|
|
974
|
-
}, []),
|
|
975
|
-
let e =
|
|
976
|
-
return e &&
|
|
1230
|
+
}, []), j(() => {
|
|
1231
|
+
let e = b.getState().consumePendingPrompt();
|
|
1232
|
+
return e && Ai.current(e), b.subscribe((e, t) => {
|
|
977
1233
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
978
|
-
let e =
|
|
979
|
-
e &&
|
|
1234
|
+
let e = b.getState().consumePendingPrompt();
|
|
1235
|
+
e && Ai.current(e);
|
|
980
1236
|
}
|
|
981
1237
|
});
|
|
982
1238
|
}, []);
|
|
983
|
-
let
|
|
984
|
-
let t = V ?
|
|
985
|
-
if (t &&
|
|
1239
|
+
let ha = A((e) => {
|
|
1240
|
+
let t = V ? b.getState().conversations.find((e) => e.id === V) : void 0;
|
|
1241
|
+
if (t && t.mode !== e && q.withdraw(t.id, "mode_switched"), t && Jt(t)) {
|
|
986
1242
|
if (t.mode !== e) {
|
|
987
|
-
let t =
|
|
988
|
-
n ?
|
|
1243
|
+
let t = p(), n = b.getState().conversations.find((n) => n.mode === e && Zt(n, t) && !b.getState().processingByConversationId[n.id]);
|
|
1244
|
+
n ? nr(n.id) : U(void 0, e);
|
|
989
1245
|
}
|
|
990
|
-
} else V &&
|
|
991
|
-
let n =
|
|
992
|
-
n ?
|
|
1246
|
+
} else V && tr(V, e);
|
|
1247
|
+
let n = b.getState().activeConversationId;
|
|
1248
|
+
n ? tr(n, e) : hr(!1), er(e);
|
|
993
1249
|
}, [
|
|
994
1250
|
V,
|
|
995
1251
|
U,
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1252
|
+
nr,
|
|
1253
|
+
hr,
|
|
1254
|
+
tr,
|
|
1255
|
+
er,
|
|
1256
|
+
q
|
|
1257
|
+
]), ga = A(() => {
|
|
1258
|
+
let e = b.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
1002
1259
|
if (!t) {
|
|
1003
|
-
|
|
1260
|
+
hr(!0), er(s);
|
|
1004
1261
|
return;
|
|
1005
1262
|
}
|
|
1006
1263
|
if (t.routedBy === "auto") {
|
|
1007
|
-
|
|
1264
|
+
hr(!0);
|
|
1008
1265
|
return;
|
|
1009
1266
|
}
|
|
1010
|
-
if (!
|
|
1011
|
-
|
|
1267
|
+
if (!Jt(t)) {
|
|
1268
|
+
gr(t.id, s);
|
|
1012
1269
|
return;
|
|
1013
1270
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1271
|
+
q.withdraw(t.id, "mode_switched");
|
|
1272
|
+
let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" && Zt(t, n) && !e.processingByConversationId[t.id]);
|
|
1273
|
+
r ? (nr(r.id), gr(r.id, s)) : U(void 0, s, { routedBy: "auto" });
|
|
1016
1274
|
}, [
|
|
1017
1275
|
U,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1276
|
+
gr,
|
|
1277
|
+
nr,
|
|
1278
|
+
hr,
|
|
1279
|
+
er,
|
|
1280
|
+
q
|
|
1281
|
+
]), _a = A((e) => {
|
|
1282
|
+
if (I.find((t) => t.id === e)?.writeCapable && !ie(b.getState().acknowledgedWriteModes, e)) {
|
|
1283
|
+
Zr(e);
|
|
1025
1284
|
return;
|
|
1026
1285
|
}
|
|
1027
|
-
|
|
1028
|
-
}, [
|
|
1029
|
-
let e =
|
|
1030
|
-
if (
|
|
1031
|
-
let t =
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1286
|
+
ha(e);
|
|
1287
|
+
}, [ha, I]), va = A(() => {
|
|
1288
|
+
let e = Xr;
|
|
1289
|
+
if (Zr(null), !e) return;
|
|
1290
|
+
let t = qr.current;
|
|
1291
|
+
if (qr.current = null, t) {
|
|
1292
|
+
pr(e), Z(t.content, t.attachments, t.options);
|
|
1034
1293
|
return;
|
|
1035
1294
|
}
|
|
1036
|
-
|
|
1295
|
+
pr(e), ha(e);
|
|
1037
1296
|
}, [
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
]),
|
|
1043
|
-
|
|
1044
|
-
let e =
|
|
1045
|
-
|
|
1297
|
+
Xr,
|
|
1298
|
+
pr,
|
|
1299
|
+
ha,
|
|
1300
|
+
Z
|
|
1301
|
+
]), ya = Xr === null ? void 0 : I.find((e) => e.id === Xr) ?? { id: Xr }, ba = A(() => {
|
|
1302
|
+
Zr(null);
|
|
1303
|
+
let e = qr.current;
|
|
1304
|
+
qr.current = null, e && Z(e.content, e.attachments, {
|
|
1046
1305
|
...e.options,
|
|
1047
1306
|
autoIntent: "read"
|
|
1048
1307
|
});
|
|
1049
|
-
}, [
|
|
1050
|
-
return /* @__PURE__ */
|
|
1308
|
+
}, [Z]);
|
|
1309
|
+
return /* @__PURE__ */ Mn("div", {
|
|
1051
1310
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
1052
1311
|
children: [
|
|
1053
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ Mn("div", {
|
|
1054
1313
|
className: "contents",
|
|
1055
1314
|
inert: $.active || void 0,
|
|
1056
1315
|
children: [
|
|
1057
|
-
|
|
1058
|
-
Q.length > 0 && !$.active ? /* @__PURE__ */
|
|
1316
|
+
Pr === null ? null : /* @__PURE__ */ N(Ht, { onDismiss: () => Nr(Pr) }),
|
|
1317
|
+
Q.length > 0 && !$.active ? /* @__PURE__ */ N(Vt, {
|
|
1059
1318
|
count: Q.length,
|
|
1060
|
-
onOpenTranscript: () =>
|
|
1319
|
+
onOpenTranscript: () => ti(!0)
|
|
1061
1320
|
}) : null,
|
|
1062
|
-
|
|
1063
|
-
state:
|
|
1064
|
-
onRetry:
|
|
1065
|
-
}) :
|
|
1321
|
+
Ni.length === 0 && (kr || Ar) ? /* @__PURE__ */ N(Ut, {
|
|
1322
|
+
state: kr ? "loading" : "failed",
|
|
1323
|
+
onRetry: zr
|
|
1324
|
+
}) : Ni.length === 0 && _r?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
|
|
1066
1325
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1068
|
-
onShowEarlier:
|
|
1069
|
-
disabled:
|
|
1326
|
+
children: /* @__PURE__ */ N(Gt, {
|
|
1327
|
+
onShowEarlier: Br,
|
|
1328
|
+
disabled: kr
|
|
1070
1329
|
})
|
|
1071
|
-
}) :
|
|
1330
|
+
}) : Ni.length === 0 ? /* @__PURE__ */ N(en, {
|
|
1072
1331
|
mode: H,
|
|
1073
|
-
onSuggestionClick:
|
|
1074
|
-
explainsAuto:
|
|
1075
|
-
suggestions:
|
|
1076
|
-
}) : /* @__PURE__ */
|
|
1332
|
+
onSuggestionClick: Oi,
|
|
1333
|
+
explainsAuto: Gr,
|
|
1334
|
+
suggestions: Gr && H === "assistant" ? c(I.find((e) => e.id === "assistant")?.suggestions ?? [], I.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
1335
|
+
}) : /* @__PURE__ */ Mn("div", {
|
|
1077
1336
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1078
|
-
children: [
|
|
1079
|
-
onShowEarlier:
|
|
1080
|
-
disabled:
|
|
1081
|
-
}) : null, /* @__PURE__ */
|
|
1082
|
-
onApprovePendingWrite:
|
|
1083
|
-
approvingWriteRef:
|
|
1084
|
-
approvableMessageId:
|
|
1085
|
-
retryableMessageId:
|
|
1086
|
-
messages:
|
|
1087
|
-
processing:
|
|
1088
|
-
streamingMessageId:
|
|
1089
|
-
failedMessageId:
|
|
1090
|
-
onRetry:
|
|
1337
|
+
children: [_r?.sync?.hasOlder ? /* @__PURE__ */ N(Gt, {
|
|
1338
|
+
onShowEarlier: Br,
|
|
1339
|
+
disabled: kr
|
|
1340
|
+
}) : null, /* @__PURE__ */ N(nn, {
|
|
1341
|
+
onApprovePendingWrite: yi,
|
|
1342
|
+
approvingWriteRef: pi,
|
|
1343
|
+
approvableMessageId: Fi?.messageId ?? null,
|
|
1344
|
+
retryableMessageId: Ii,
|
|
1345
|
+
messages: Ni,
|
|
1346
|
+
processing: G ?? null,
|
|
1347
|
+
streamingMessageId: br,
|
|
1348
|
+
failedMessageId: xr,
|
|
1349
|
+
onRetry: pi === null ? ki : void 0,
|
|
1350
|
+
renderWriteProposals: Ri,
|
|
1351
|
+
hidesLegacyWriteCard: Li
|
|
1091
1352
|
})]
|
|
1092
1353
|
}),
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
state:
|
|
1096
|
-
onRetry:
|
|
1354
|
+
Or ? /* @__PURE__ */ N(Wt, { onStartNew: () => U() }) : null,
|
|
1355
|
+
Ni.length > 0 && (kr || Ar) ? /* @__PURE__ */ N(Ut, {
|
|
1356
|
+
state: kr ? "loading" : "failed",
|
|
1357
|
+
onRetry: zr,
|
|
1097
1358
|
compact: !0
|
|
1098
1359
|
}) : null,
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
onStartVoiceSession: $.available &&
|
|
1101
|
-
onSend: (e, t) => void
|
|
1102
|
-
onDraftStart:
|
|
1103
|
-
disabled:
|
|
1104
|
-
readOnly:
|
|
1105
|
-
placeholder: H === "api-calls" ?
|
|
1360
|
+
/* @__PURE__ */ N(Tn, {
|
|
1361
|
+
onStartVoiceSession: $.available && si ? sa : void 0,
|
|
1362
|
+
onSend: (e, t) => void Z(e, t, { fromPerson: !0 }),
|
|
1363
|
+
onDraftStart: fi,
|
|
1364
|
+
disabled: K || pi !== null || kr,
|
|
1365
|
+
readOnly: Or,
|
|
1366
|
+
placeholder: H === "api-calls" ? P("chatArea.placeholderActions", "What would you like me to do?") : P("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
1106
1367
|
mode: H,
|
|
1107
|
-
writeAccessDenied:
|
|
1108
|
-
availableModes:
|
|
1109
|
-
attachmentCharsPerFile:
|
|
1110
|
-
onModeChange:
|
|
1111
|
-
auto:
|
|
1112
|
-
active:
|
|
1113
|
-
onSelect:
|
|
1368
|
+
writeAccessDenied: Rn === "denied" && !!X?.writeCapable,
|
|
1369
|
+
availableModes: Ur,
|
|
1370
|
+
attachmentCharsPerFile: Yr,
|
|
1371
|
+
onModeChange: _a,
|
|
1372
|
+
auto: Wr ? {
|
|
1373
|
+
active: Gr,
|
|
1374
|
+
onSelect: ga
|
|
1114
1375
|
} : void 0
|
|
1115
1376
|
})
|
|
1116
1377
|
]
|
|
1117
1378
|
}),
|
|
1118
|
-
|
|
1379
|
+
ei && !$.active ? /* @__PURE__ */ N(Kt, {
|
|
1119
1380
|
turns: Q,
|
|
1120
|
-
onClose: () =>
|
|
1121
|
-
onSave:
|
|
1122
|
-
onContinueInChat:
|
|
1381
|
+
onClose: () => ti(!1),
|
|
1382
|
+
onSave: Vi,
|
|
1383
|
+
onContinueInChat: ua ? da : void 0,
|
|
1123
1384
|
closeOnEscape: !0,
|
|
1124
|
-
onShowEarlier:
|
|
1125
|
-
showEarlierDisabled:
|
|
1385
|
+
onShowEarlier: _r?.sync?.hasOlder ? Br : void 0,
|
|
1386
|
+
showEarlierDisabled: kr
|
|
1126
1387
|
}) : null,
|
|
1127
|
-
$.active && /* @__PURE__ */
|
|
1388
|
+
$.active && /* @__PURE__ */ N(rn, {
|
|
1128
1389
|
session: $.session,
|
|
1129
1390
|
notice: $.notice,
|
|
1130
1391
|
capturing: $.capturing,
|
|
@@ -1132,30 +1393,43 @@ var dn = ({ visible: dn = !0, writeAccess: fn = "unknown" }) => {
|
|
|
1132
1393
|
awaitingEndpoint: $.awaitingEndpoint,
|
|
1133
1394
|
turns: Q,
|
|
1134
1395
|
spokenChunks: $.spokenChunks,
|
|
1135
|
-
attachments:
|
|
1136
|
-
onAttachFiles:
|
|
1137
|
-
onRemoveAttachment:
|
|
1138
|
-
onRetryAttachment:
|
|
1139
|
-
canAttachMore:
|
|
1140
|
-
preparingAttachments:
|
|
1141
|
-
onSaveTranscript:
|
|
1142
|
-
onContinueInChat:
|
|
1396
|
+
attachments: Hi.attachments,
|
|
1397
|
+
onAttachFiles: Hi.addFiles,
|
|
1398
|
+
onRemoveAttachment: Hi.remove,
|
|
1399
|
+
onRetryAttachment: Hi.retry,
|
|
1400
|
+
canAttachMore: Hi.canAddMore,
|
|
1401
|
+
preparingAttachments: Hi.preparingCount,
|
|
1402
|
+
onSaveTranscript: Vi,
|
|
1403
|
+
onContinueInChat: da,
|
|
1143
1404
|
onInterrupt: () => {
|
|
1144
|
-
$.interrupt(),
|
|
1405
|
+
$.interrupt(), vi();
|
|
1145
1406
|
},
|
|
1146
|
-
spoken:
|
|
1407
|
+
spoken: Mi,
|
|
1147
1408
|
onToggleMute: $.toggleMute,
|
|
1148
|
-
onEnd:
|
|
1409
|
+
onEnd: pa,
|
|
1410
|
+
proposalChip: Qi ? {
|
|
1411
|
+
label: Ze(Qi, P),
|
|
1412
|
+
onOpen: Zi
|
|
1413
|
+
} : null,
|
|
1414
|
+
proposalTray: ea
|
|
1415
|
+
}),
|
|
1416
|
+
/* @__PURE__ */ N(Dn, {
|
|
1417
|
+
open: Xr !== null,
|
|
1418
|
+
mode: ya,
|
|
1419
|
+
currentMode: X ?? { id: H },
|
|
1420
|
+
onConfirm: va,
|
|
1421
|
+
onCancel: ba
|
|
1149
1422
|
}),
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1423
|
+
/* @__PURE__ */ N(Nt, {
|
|
1424
|
+
...Tr.dialog,
|
|
1425
|
+
view: zi?.view ?? Tr.dialog.view,
|
|
1426
|
+
serverNow: zi?.serverNow ?? NaN,
|
|
1427
|
+
capabilities: zi ? Sr[zi.session.sandboxId] : null,
|
|
1428
|
+
turnInFlight: K,
|
|
1429
|
+
tr: P
|
|
1156
1430
|
})
|
|
1157
1431
|
]
|
|
1158
1432
|
});
|
|
1159
1433
|
};
|
|
1160
1434
|
//#endregion
|
|
1161
|
-
export {
|
|
1435
|
+
export { Ln as AssistantChatArea };
|