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