@burdenoff/fe-libs 2026.908.1 → 2026.908.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/api.d.ts +21 -0
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +12 -5
- package/dist/shared/assistant/turnState.d.ts +35 -0
- package/dist/shared/assistant/turnState.d.ts.map +1 -1
- package/dist/shared/assistant/turnState.js +17 -1
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +286 -264
- package/dist/shared-assistant.js +87 -87
- package/package.json +1 -1
|
@@ -135,6 +135,27 @@ export declare function getAssistantMessages(sandboxId: string, workspaceId: str
|
|
|
135
135
|
export declare function getAssistantStreamAccess(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<StreamAccess | null>;
|
|
136
136
|
export declare function extendAssistantSandboxTTL(sandboxId: string, workspaceId: string, additionalSeconds: number, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
137
137
|
export declare function sendHeartbeat(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Cancel the turn currently running in this sandbox session.
|
|
140
|
+
*
|
|
141
|
+
* ★ The sandbox has exposed `POST /sessions/:id/abort` since the original
|
|
142
|
+
* server, and it does more than drop the reply: it calls `abandonSession`
|
|
143
|
+
* before `session.abort`, so the provider-failover chain stops too and a
|
|
144
|
+
* cancelled turn is not quietly re-answered by the next provider. Nothing in
|
|
145
|
+
* this package called it — every other route here (`prompt-async`, `messages`,
|
|
146
|
+
* `stream-url`, `heartbeat`, `artifacts`) was wired and this one was not, which
|
|
147
|
+
* is why "nothing cancels the model" has been written into several comments as
|
|
148
|
+
* though it were a property of the system rather than a gap in the client.
|
|
149
|
+
*
|
|
150
|
+
* ★★ Do NOT call this directly from an interrupt handler. Abort is scoped to
|
|
151
|
+
* the SESSION, which outlives the turn, so a late request cancels whatever is
|
|
152
|
+
* running when it arrives. Gate every call on `planTurnAbort`.
|
|
153
|
+
*
|
|
154
|
+
* Never throws: a failed cancellation must not take the UI down with it. The
|
|
155
|
+
* boolean is the sandbox's own `{ aborted: true }`, so a caller can tell
|
|
156
|
+
* "cancelled" from "asked, and something went wrong".
|
|
157
|
+
*/
|
|
158
|
+
export declare function abortAssistantTurn(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<boolean>;
|
|
138
159
|
export declare function getAssistantArtifacts(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<AssistantArtifact[]>;
|
|
139
160
|
export declare function getAssistantSession(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<AssistantSessionInfo>;
|
|
140
161
|
export declare function downloadAssistantArtifact(sandboxId: string, workspaceId: string, sessionId: string, artifactPath: string, authContext: AssistantSandboxAuthContext): Promise<DownloadedAssistantArtifact>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,YAAY,EACb,MAAM,SAAS,CAAC;AA+CjB,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,2BAA2B,EACxC,kBAAkB,GAAE,WAAW,CAAC,MAAM,CAAa,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,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nB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACzC,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -274,16 +274,23 @@ async function B(e, t, n, r) {
|
|
|
274
274
|
await b(e, t, `/sessions/${n}/heartbeat`, "POST", void 0, r).catch(() => void 0);
|
|
275
275
|
}
|
|
276
276
|
async function V(e, t, n, r) {
|
|
277
|
-
|
|
277
|
+
try {
|
|
278
|
+
return (await b(e, t, `/sessions/${n}/abort`, "POST", void 0, r))?.aborted === !0;
|
|
279
|
+
} catch {
|
|
280
|
+
return !1;
|
|
281
|
+
}
|
|
278
282
|
}
|
|
279
283
|
async function H(e, t, n, r) {
|
|
284
|
+
return ((await b(e, t, `/sessions/${n}/artifacts`, "GET", void 0, r)).artifacts ?? []).filter((e) => !e.name.startsWith("."));
|
|
285
|
+
}
|
|
286
|
+
async function U(e, t, n, r) {
|
|
280
287
|
let i = await b(e, t, `/sessions/${n}`, "GET", void 0, r);
|
|
281
288
|
return {
|
|
282
289
|
id: i.session?.id ?? n,
|
|
283
290
|
mode: i.mode ?? "unknown"
|
|
284
291
|
};
|
|
285
292
|
}
|
|
286
|
-
async function
|
|
293
|
+
async function W(e, t, n, r, i) {
|
|
287
294
|
let a = (await b(e, t, `/sessions/${n}/artifacts/download?path=${encodeURIComponent(r)}`, "GET", void 0, i)).artifact;
|
|
288
295
|
if (!a) throw Error("Artifact download returned an empty response");
|
|
289
296
|
return {
|
|
@@ -292,7 +299,7 @@ async function U(e, t, n, r, i) {
|
|
|
292
299
|
contentBase64: a.contentBase64
|
|
293
300
|
};
|
|
294
301
|
}
|
|
295
|
-
async function
|
|
302
|
+
async function G(e, r) {
|
|
296
303
|
return (await t({
|
|
297
304
|
query: n,
|
|
298
305
|
operationName: "CheckAiCredits",
|
|
@@ -301,7 +308,7 @@ async function W(e, r) {
|
|
|
301
308
|
authContext: r
|
|
302
309
|
})).checkAiCredits;
|
|
303
310
|
}
|
|
304
|
-
async function
|
|
311
|
+
async function K(e, n, r, i, a, o) {
|
|
305
312
|
let s = Math.max(0, Math.round(a.input ?? 0)), l = Math.max(0, Math.round(a.output ?? 0));
|
|
306
313
|
s + l === 0 || !i || await t({
|
|
307
314
|
query: c,
|
|
@@ -318,4 +325,4 @@ async function G(e, n, r, i, a, o) {
|
|
|
318
325
|
});
|
|
319
326
|
}
|
|
320
327
|
//#endregion
|
|
321
|
-
export { j as approvePendingWrite, w as buildAssistantSandboxEnv, F as buildPromptRequestBody,
|
|
328
|
+
export { V as abortAssistantTurn, j as approvePendingWrite, w as buildAssistantSandboxEnv, F as buildPromptRequestBody, G as checkAssistantAiCredits, T as createAssistantSandbox, A as createAssistantSession, W as downloadAssistantArtifact, z as extendAssistantSandboxTTL, x as findExistingSandbox, H as getAssistantArtifacts, L as getAssistantMessages, U as getAssistantSession, R as getAssistantStreamAccess, C as modeRequiresConfirmWrites, N as releaseSupersededAssistantSandboxes, K as reportAssistantAiTokenUsage, S as selectExistingAssistantSandbox, M as selectSupersededAssistantSandboxes, I as sendAssistantPromptAsync, B as sendHeartbeat, P as stopReapedAssistantSandbox, k as waitForAssistantServiceReady, O as waitForSandboxRunning };
|
|
@@ -13,4 +13,39 @@ import { AssistantConversationStatus } from './conversation';
|
|
|
13
13
|
* test suite.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isTurnInFlight(status: AssistantConversationStatus | undefined): boolean;
|
|
16
|
+
/** Why an abort was or was not sent. Carried so callers can log the near-miss. */
|
|
17
|
+
export type TurnAbortReason = "send" | "nothing-running" | "superseded" | "already-requested";
|
|
18
|
+
/**
|
|
19
|
+
* Should this cancellation actually be sent to the sandbox?
|
|
20
|
+
*
|
|
21
|
+
* ★★ THE HAZARD THIS EXISTS FOR. `POST /sessions/:id/abort` is scoped to the
|
|
22
|
+
* SESSION, not to a turn — and the session is reused for the whole
|
|
23
|
+
* conversation. So the endpoint does not cancel "the turn you interrupted", it
|
|
24
|
+
* cancels *whatever is running in that session at the moment it arrives*.
|
|
25
|
+
*
|
|
26
|
+
* That makes a late abort actively dangerous rather than merely useless: the
|
|
27
|
+
* user interrupts turn A, the request is slow, the user asks B, and the abort
|
|
28
|
+
* lands on B — killing the answer they are actually waiting for, with no error
|
|
29
|
+
* anywhere. The failure looks like the assistant randomly giving up.
|
|
30
|
+
*
|
|
31
|
+
* So the abort is addressed to a turn and refused unless that turn is still the
|
|
32
|
+
* one in flight. Pure, and separated from the request itself, because the rule
|
|
33
|
+
* is a safety property and the hook that would otherwise hold it has no test
|
|
34
|
+
* file — which is exactly how `planReplyConsumption`'s original defect shipped.
|
|
35
|
+
*
|
|
36
|
+
* This is a guard, not a guarantee: it closes the window this process can see.
|
|
37
|
+
* A turn that starts on ANOTHER device between the check and the request is not
|
|
38
|
+
* addressed here and would need a server-validated turn id.
|
|
39
|
+
*/
|
|
40
|
+
export declare function planTurnAbort(args: {
|
|
41
|
+
/** The turn the user asked to cancel. */
|
|
42
|
+
interruptedTurnId: string | null | undefined;
|
|
43
|
+
/** The turn actually in flight right now, or null if none is. */
|
|
44
|
+
activeTurnId: string | null | undefined;
|
|
45
|
+
/** An abort for this same turn has already been sent. */
|
|
46
|
+
alreadyRequested?: boolean;
|
|
47
|
+
}): {
|
|
48
|
+
send: boolean;
|
|
49
|
+
reason: TurnAbortReason;
|
|
50
|
+
};
|
|
16
51
|
//# sourceMappingURL=turnState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnState.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,OAAO,CAMT"}
|
|
1
|
+
{"version":3,"file":"turnState.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,OAAO,CAMT;AAED,kFAAkF;AAClF,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,iEAAiE;IACjE,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAkB7C"}
|
|
@@ -2,5 +2,21 @@
|
|
|
2
2
|
function e(e) {
|
|
3
3
|
return e === "provisioning" || e === "connecting" || e === "streaming";
|
|
4
4
|
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
let { interruptedTurnId: t, activeTurnId: n, alreadyRequested: r = !1 } = e;
|
|
7
|
+
return !t || !n ? {
|
|
8
|
+
send: !1,
|
|
9
|
+
reason: "nothing-running"
|
|
10
|
+
} : t === n ? r ? {
|
|
11
|
+
send: !1,
|
|
12
|
+
reason: "already-requested"
|
|
13
|
+
} : {
|
|
14
|
+
send: !0,
|
|
15
|
+
reason: "send"
|
|
16
|
+
} : {
|
|
17
|
+
send: !1,
|
|
18
|
+
reason: "superseded"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
5
21
|
//#endregion
|
|
6
|
-
export { e as isTurnInFlight };
|
|
22
|
+
export { e as isTurnInFlight, t as planTurnAbort };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAqEf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAoLvE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAyxDxD,CAAC"}
|
|
@@ -2,69 +2,69 @@ import { useI18n as e } from "../../providers/shell/I18nProvider.js";
|
|
|
2
2
|
import { useAuthToken as t } from "../../providers/shell/AuthTokenProvider.js";
|
|
3
3
|
import "../../../shared-providers-shell.js";
|
|
4
4
|
import { describeQuotaError as n } from "../quota.js";
|
|
5
|
-
import {
|
|
6
|
-
import { getAssistantMedia as h, sanitize as
|
|
7
|
-
import { isVoiceTurn as g, voiceMarker as _, voiceSessionIdOf as
|
|
8
|
-
import { buildContinuedFromVoiceNote as
|
|
9
|
-
import { pollDelayMs as
|
|
10
|
-
import { toCaptionText as
|
|
11
|
-
import { resolveAssistantLanguage as
|
|
12
|
-
import { resolveLanguagePair as
|
|
13
|
-
import { findPendingWrite as
|
|
14
|
-
import { useAssistantProduct as
|
|
15
|
-
import { useAssistantTr as
|
|
16
|
-
import { buildPromptParts as
|
|
5
|
+
import { abortAssistantTurn as r, approvePendingWrite as i, createAssistantSandbox as a, createAssistantSession as o, extendAssistantSandboxTTL as s, findExistingSandbox as c, getAssistantArtifacts as l, getAssistantMessages as u, getAssistantSession as d, releaseSupersededAssistantSandboxes as f, sendAssistantPromptAsync as ee, waitForAssistantServiceReady as p, waitForSandboxRunning as m } from "../api.js";
|
|
6
|
+
import { getAssistantMedia as h, sanitize as te } from "../progress.js";
|
|
7
|
+
import { isVoiceTurn as g, voiceMarker as _, voiceSessionIdOf as ne } from "../voice/turnVisibility.js";
|
|
8
|
+
import { buildContinuedFromVoiceNote as v, buildVoiceTranscriptMarkdown as y, voiceTranscriptFilename as re } from "../voice/voiceTranscript.js";
|
|
9
|
+
import { pollDelayMs as ie } from "../voice/assistantPollSchedule.js";
|
|
10
|
+
import { toCaptionText as b } from "../voice/captionText.js";
|
|
11
|
+
import { resolveAssistantLanguage as ae } from "../voice/languages.js";
|
|
12
|
+
import { resolveLanguagePair as oe } from "../voice/languagePair.js";
|
|
13
|
+
import { findPendingWrite as se } from "../pendingWrite.js";
|
|
14
|
+
import { useAssistantProduct as ce } from "../product.js";
|
|
15
|
+
import { useAssistantTr as le } from "../i18n.js";
|
|
16
|
+
import { buildPromptParts as ue, buildPromptWithAttachments as de, countInlineImageCandidates as fe, countInlinedImageParts as pe, getSendableAttachments as me, toMessageAttachment as he } from "../attachments.js";
|
|
17
17
|
import { useAssistantStore as x } from "../store.js";
|
|
18
|
-
import { isTurnInFlight as
|
|
19
|
-
import { parseToolActivity as
|
|
20
|
-
import { useVoiceSession as
|
|
21
|
-
import { getOrganizationId as
|
|
22
|
-
import { createReadinessTracker as
|
|
23
|
-
import { AssistantSpokenTurnsNotice as
|
|
24
|
-
import { VoiceTranscriptDrawer as
|
|
25
|
-
import { downloadFile as
|
|
26
|
-
import { AssistantEmptyState as
|
|
27
|
-
import { AssistantMessageList as
|
|
28
|
-
import { AssistantVoiceSession as
|
|
29
|
-
import { useAssistantApiAccess as
|
|
30
|
-
import { useConversationTurns as
|
|
31
|
-
import { isMultimodalBodyRejection as
|
|
32
|
-
import { dispatchAssistantQuotaExhausted as
|
|
33
|
-
import { useAssistantAttachments as
|
|
34
|
-
import { AssistantComposer as
|
|
35
|
-
import { isProdRuntime as
|
|
36
|
-
import { AssistantApiCallsConsentDialog as
|
|
37
|
-
import { useCallback as S, useEffect as C, useMemo as w, useRef as T, useState as
|
|
38
|
-
import { jsx as E, jsxs as
|
|
18
|
+
import { isTurnInFlight as ge, planTurnAbort as _e } from "../turnState.js";
|
|
19
|
+
import { parseToolActivity as ve } from "./AssistantToolActivity.js";
|
|
20
|
+
import { useVoiceSession as ye } from "./useVoiceSession.js";
|
|
21
|
+
import { getOrganizationId as be, getWorkspaceId as xe } from "../context.js";
|
|
22
|
+
import { createReadinessTracker as Se } from "../sandboxReadiness.js";
|
|
23
|
+
import { AssistantSpokenTurnsNotice as Ce } from "./AssistantSpokenTurnsNotice.js";
|
|
24
|
+
import { VoiceTranscriptDrawer as we } from "./voice/VoiceTranscriptDrawer.js";
|
|
25
|
+
import { downloadFile as Te } from "../exportConversation.js";
|
|
26
|
+
import { AssistantEmptyState as Ee } from "./AssistantEmptyState.js";
|
|
27
|
+
import { AssistantMessageList as De } from "./AssistantMessageList.js";
|
|
28
|
+
import { AssistantVoiceSession as Oe } from "./voice/AssistantVoiceSession.js";
|
|
29
|
+
import { useAssistantApiAccess as ke } from "../useAssistantApiAccess.js";
|
|
30
|
+
import { useConversationTurns as Ae } from "../useConversationTurns.js";
|
|
31
|
+
import { isMultimodalBodyRejection as je, isRecoverableAssistantError as Me } from "../transportErrors.js";
|
|
32
|
+
import { dispatchAssistantQuotaExhausted as Ne, notifyAiCreditsUpdated as Pe } from "../aiCredits.js";
|
|
33
|
+
import { useAssistantAttachments as Fe } from "../useAssistantAttachments.js";
|
|
34
|
+
import { AssistantComposer as Ie } from "./composer/AssistantComposer.js";
|
|
35
|
+
import { isProdRuntime as Le } from "../env.js";
|
|
36
|
+
import { AssistantApiCallsConsentDialog as Re } from "./AssistantApiCallsConsentDialog.js";
|
|
37
|
+
import { useCallback as S, useEffect as C, useMemo as w, useRef as T, useState as ze } from "react";
|
|
38
|
+
import { jsx as E, jsxs as Be } from "react/jsx-runtime";
|
|
39
39
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
40
|
-
var
|
|
40
|
+
var Ve = {
|
|
41
41
|
general: 18e4,
|
|
42
42
|
assistant: 18e4,
|
|
43
43
|
"api-calls": 18e4,
|
|
44
44
|
"vibe-plugins": 6e5
|
|
45
|
-
},
|
|
46
|
-
function
|
|
45
|
+
}, He = 18e4, Ue = 600, We = 2e4;
|
|
46
|
+
function D() {
|
|
47
47
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function O(e) {
|
|
50
50
|
return e.info?.time?.created ?? 0;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function k(e) {
|
|
53
53
|
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function A(e) {
|
|
56
56
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
57
57
|
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
58
58
|
return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function Ge(e, t) {
|
|
62
|
-
let n = e.filter((e) => e.info?.role === "assistant" &&
|
|
62
|
+
let n = e.filter((e) => e.info?.role === "assistant" && O(e) > t).sort((e, t) => O(e) - O(t));
|
|
63
63
|
if (n.length === 0) return {
|
|
64
64
|
content: "Thinking...",
|
|
65
65
|
done: !1
|
|
66
66
|
};
|
|
67
|
-
let r = n[n.length - 1], i =
|
|
67
|
+
let r = n[n.length - 1], i = k(r.parts), a = h(r.parts), o = A(r.parts), s = se(r.parts), c = [
|
|
68
68
|
i,
|
|
69
69
|
...a,
|
|
70
70
|
...o
|
|
@@ -86,269 +86,289 @@ function Ke(e) {
|
|
|
86
86
|
default: return "";
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
]),
|
|
89
|
+
var j = ({ visible: h = !0, writeAccess: se = "unknown" }) => {
|
|
90
|
+
let k = le(), { product: A, modes: j, gatherPageContext: qe, buildPrompt: Je, reportTokenUsage: Ye } = ce(), { getAccessToken: M, getWorkspaceToken: N, userId: P } = t(), { locale: Xe } = e(), Ze = x((e) => e.assistantLanguage), Qe = x((e) => e.replyLanguage), $e = w(() => oe(Ze, Qe, Xe), [
|
|
91
|
+
Ze,
|
|
92
|
+
Qe,
|
|
93
|
+
Xe
|
|
94
|
+
]), et = $e.reply.english, tt = $e.replyIsExplicit, nt = $e.reply.code, { conversations: rt, activeConversationId: F, mode: I, processingByConversationId: it, setMode: L, setConversationMode: R, setActiveConversation: at, createConversation: z, addMessage: B, updateMessage: ot, patchMessage: V, mergeMessageMetadata: st, setConversationProcessing: H, setBackendSessionId: ct, clearBackendSessionId: U, setSandbox: W, clearSandbox: lt, acknowledgeApiCalls: ut } = x(), dt = rt.find((e) => e.id === F), G = Ae(dt), K = G.all, ft = F ? it[F] : void 0, pt = ge(ft?.status), mt = pt ? ft?.messageId ?? null : null, ht = ft?.status === "error" ? ft.messageId : null, { canUseApiCalls: gt, loading: _t } = ke(be()), vt = w(() => j.filter((e) => !e.requiresAdmin || gt), [j, gt]), [yt, bt] = ze(null), [xt, St] = ze(!1), Ct = T({}), wt = T(Se()), Tt = T(/* @__PURE__ */ new Set()), Et = w(() => j.find((e) => e.id === I), [j, I]);
|
|
95
95
|
C(() => {
|
|
96
|
-
|
|
96
|
+
_t || (!Et || Et.requiresAdmin && !gt) && I !== "assistant" && L("assistant");
|
|
97
97
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
I,
|
|
99
|
+
Et,
|
|
100
|
+
gt,
|
|
101
|
+
_t,
|
|
102
|
+
L
|
|
103
103
|
]);
|
|
104
104
|
let q = S((e, t, n, r) => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
105
|
+
H(e, n, t, null), r ? ot(e, t, r) : ot(e, t, Ke(n));
|
|
106
|
+
}, [H, ot]), Dt = S(async (e, t, n, r, i) => {
|
|
107
|
+
let s = x.getState().sandboxesByMode[n]?.sandboxId ?? null, l = async (e) => {
|
|
108
|
+
if (wt.current.isFresh(e)) return !0;
|
|
109
109
|
try {
|
|
110
|
-
return await m(e, r,
|
|
110
|
+
return await m(e, r, i, 3e5), await p(e, r, i, 9e4), wt.current.markVerified(e), !0;
|
|
111
111
|
} catch {
|
|
112
|
-
return
|
|
112
|
+
return wt.current.invalidate(e), !1;
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
if (
|
|
115
|
+
if (s && (W(n, s, "provisioning"), q(e, t, "provisioning", "Reusing assistant environment..."), await l(s) || (W(n, null, "provisioning"), s = null)), !s) {
|
|
116
116
|
q(e, t, "provisioning", "Looking for existing environment...");
|
|
117
|
-
let
|
|
118
|
-
|
|
117
|
+
let a = await c(r, A, n, Le(), i);
|
|
118
|
+
a && (W(n, a, "provisioning"), q(e, t, "provisioning", "Reusing assistant environment..."), await l(a) ? s = a : W(n, null, "provisioning"));
|
|
119
119
|
}
|
|
120
|
-
if (!
|
|
121
|
-
if (n === "api-calls" && !
|
|
122
|
-
q(e, t, "provisioning", "Starting assistant environment..."),
|
|
120
|
+
if (!s) {
|
|
121
|
+
if (n === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
122
|
+
q(e, t, "provisioning", "Starting assistant environment..."), W(n, null, "provisioning"), await f(r, A, n, Le(), i), s = await a(A, n, r, Le(), Ue, i), W(n, s, "provisioning"), await m(s, r, i, 3e5), await p(s, r, i, 9e4);
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
127
|
-
let e = await
|
|
124
|
+
W(n, s, "running");
|
|
125
|
+
let u = x.getState().conversations.find((t) => t.id === e)?.backendSessionId ?? null;
|
|
126
|
+
if (u) try {
|
|
127
|
+
let e = await d(s, r, u, i);
|
|
128
128
|
if (e.mode !== n) throw Error(`Session mode mismatch: expected ${n}, received ${e.mode}`);
|
|
129
129
|
} catch {
|
|
130
|
-
|
|
130
|
+
U(e), u = null;
|
|
131
131
|
}
|
|
132
|
-
return
|
|
133
|
-
sandboxId:
|
|
134
|
-
sessionId:
|
|
132
|
+
return u || (q(e, t, "connecting", "Preparing session..."), u = (await o(s, r, n, i)).sessionId, ct(e, u)), {
|
|
133
|
+
sandboxId: s,
|
|
134
|
+
sessionId: u
|
|
135
135
|
};
|
|
136
136
|
}, [
|
|
137
|
-
|
|
137
|
+
U,
|
|
138
|
+
M,
|
|
138
139
|
A,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
R,
|
|
140
|
+
ct,
|
|
141
|
+
W,
|
|
142
142
|
q
|
|
143
|
-
]), [
|
|
144
|
-
let
|
|
145
|
-
if (!
|
|
146
|
-
|
|
143
|
+
]), [Ot, kt] = ze(null), At = T(/* @__PURE__ */ new Set()), jt = S(() => {
|
|
144
|
+
let e = x.getState(), t = e.activeConversationId;
|
|
145
|
+
if (!t) return;
|
|
146
|
+
let n = e.processingByConversationId[t], i = ge(n?.status) ? n?.messageId ?? null : null;
|
|
147
|
+
if (!_e({
|
|
148
|
+
interruptedTurnId: i,
|
|
149
|
+
activeTurnId: i,
|
|
150
|
+
alreadyRequested: i ? At.current.has(i) : !1
|
|
151
|
+
}).send || !i) return;
|
|
152
|
+
let a = e.sandboxesByMode[e.mode]?.sandboxId, o = xe(), s = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
153
|
+
!a || !o || !s || (At.current.add(i), r(a, o, s, {
|
|
154
|
+
accessToken: M(),
|
|
155
|
+
workspaceToken: N(),
|
|
156
|
+
userId: P,
|
|
157
|
+
organizationId: be()
|
|
158
|
+
}));
|
|
159
|
+
}, [
|
|
160
|
+
P,
|
|
161
|
+
M,
|
|
162
|
+
N
|
|
163
|
+
]), Mt = S(async (e) => {
|
|
164
|
+
let t = x.getState(), n = t.sandboxesByMode[t.mode]?.sandboxId, r = xe(), a = t.activeConversationId;
|
|
165
|
+
if (!(!n || !r || !a)) {
|
|
166
|
+
kt(e);
|
|
147
167
|
try {
|
|
148
|
-
await
|
|
149
|
-
accessToken:
|
|
150
|
-
workspaceToken:
|
|
151
|
-
userId:
|
|
152
|
-
organizationId:
|
|
168
|
+
await i(n, r, e, {
|
|
169
|
+
accessToken: M(),
|
|
170
|
+
workspaceToken: N(),
|
|
171
|
+
userId: P,
|
|
172
|
+
organizationId: be()
|
|
153
173
|
});
|
|
154
174
|
} catch (e) {
|
|
155
|
-
|
|
156
|
-
id:
|
|
175
|
+
kt(null), B(a, {
|
|
176
|
+
id: D(),
|
|
157
177
|
role: "system",
|
|
158
178
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
159
179
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
160
180
|
});
|
|
161
181
|
return;
|
|
162
182
|
}
|
|
163
|
-
|
|
183
|
+
kt(null), Y.current(k("pendingWrite.approvedPrompt", "I approved that change — go ahead."));
|
|
164
184
|
}
|
|
165
185
|
}, [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
P,
|
|
187
|
+
B,
|
|
188
|
+
k
|
|
169
189
|
]), J = S(async (e, t = [], r = {}) => {
|
|
170
|
-
let i = r.voiceSessionId !== void 0, a = x.getState(),
|
|
171
|
-
if (
|
|
172
|
-
let
|
|
173
|
-
if (d ?
|
|
190
|
+
let i = r.voiceSessionId !== void 0, a = x.getState(), o = a.activeConversationId ?? F;
|
|
191
|
+
if (o && (ge(a.processingByConversationId[o]?.status) || Tt.current.has(o))) return;
|
|
192
|
+
let c = a.mode, d = F, f = d ? x.getState().conversations.find((e) => e.id === d) : void 0;
|
|
193
|
+
if (d ? f && f.mode !== c && (f.messages.length > 0 || f.backendSessionId) ? d = z(void 0, c) : f && f.mode !== c && R(d, c) : d = z(void 0, c), !d) return;
|
|
174
194
|
Ct.current[d] = t;
|
|
175
|
-
let
|
|
176
|
-
accessToken:
|
|
177
|
-
workspaceToken:
|
|
178
|
-
userId:
|
|
179
|
-
organizationId:
|
|
180
|
-
},
|
|
181
|
-
id:
|
|
195
|
+
let p = xe(), m = {
|
|
196
|
+
accessToken: M(),
|
|
197
|
+
workspaceToken: N(),
|
|
198
|
+
userId: P,
|
|
199
|
+
organizationId: be()
|
|
200
|
+
}, h = {
|
|
201
|
+
id: D(),
|
|
182
202
|
role: "user",
|
|
183
203
|
content: e,
|
|
184
204
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
185
205
|
metadata: {
|
|
186
|
-
...t.length ? { attachments: t.map(
|
|
206
|
+
...t.length ? { attachments: t.map(he) } : {},
|
|
187
207
|
..._(r.voiceSessionId)
|
|
188
208
|
}
|
|
189
209
|
};
|
|
190
|
-
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
id:
|
|
210
|
+
B(d, h);
|
|
211
|
+
let g = D();
|
|
212
|
+
B(d, {
|
|
213
|
+
id: g,
|
|
194
214
|
role: "assistant",
|
|
195
215
|
content: "",
|
|
196
216
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
197
217
|
metadata: {
|
|
198
|
-
lang:
|
|
218
|
+
lang: nt,
|
|
199
219
|
..._(r.voiceSessionId)
|
|
200
220
|
}
|
|
201
|
-
}),
|
|
202
|
-
let
|
|
203
|
-
|
|
221
|
+
}), H(d, "provisioning", g, null);
|
|
222
|
+
let ne = (e, t, n, i, a = nt) => {
|
|
223
|
+
V(d, g, { content: te(e) }), st(d, g, {
|
|
204
224
|
lang: a,
|
|
205
225
|
...t?.length ? { artifacts: t } : {},
|
|
206
|
-
...t?.length || n || i ? { mode:
|
|
226
|
+
...t?.length || n || i ? { mode: c } : {},
|
|
207
227
|
...n ? { sessionId: n } : {},
|
|
208
228
|
...i ? { sandboxId: i } : {},
|
|
209
229
|
..._(r.voiceSessionId)
|
|
210
230
|
});
|
|
211
|
-
},
|
|
231
|
+
}, v = async (n = 1) => {
|
|
212
232
|
let r = !1;
|
|
213
233
|
try {
|
|
214
|
-
let { sandboxId: n, sessionId: a } = await
|
|
215
|
-
q(d,
|
|
216
|
-
let
|
|
217
|
-
r =
|
|
234
|
+
let { sandboxId: n, sessionId: a } = await Dt(d, g, c, p, m), o = (await u(n, p, a, m, { limit: 50 }).catch(() => [])).reduce((e, t) => Math.max(e, O(t)), 0);
|
|
235
|
+
q(d, g, "streaming", "Thinking...");
|
|
236
|
+
let f = de(e, t), h = Je?.(c, f, et, tt, i) ?? f, _ = ue(h, t), v = pe(_), y = v > 0, re = qe?.();
|
|
237
|
+
r = fe(t) > v;
|
|
218
238
|
try {
|
|
219
|
-
await
|
|
239
|
+
await ee(n, p, a, h, c, re, m, _?.length ? { parts: _ } : void 0);
|
|
220
240
|
} catch (e) {
|
|
221
|
-
if (!_ || !
|
|
222
|
-
await
|
|
241
|
+
if (!_ || !je(e)) throw e;
|
|
242
|
+
await ee(n, p, a, h, c, re, m, void 0), r ||= y;
|
|
223
243
|
}
|
|
224
|
-
let b = Ge([],
|
|
225
|
-
for (; Date.now() < ae && (b = Ge(await
|
|
244
|
+
let b = Ge([], o), ae = Date.now() + (Ve[c] ?? He), oe = Date.now(), se = Date.now();
|
|
245
|
+
for (; Date.now() < ae && (b = Ge(await u(n, p, a, m, {
|
|
226
246
|
limit: 50,
|
|
227
|
-
sinceMs:
|
|
228
|
-
}),
|
|
229
|
-
if (!b.done &&
|
|
230
|
-
let ce =
|
|
247
|
+
sinceMs: o
|
|
248
|
+
}), o), V(d, g, { content: te(b.content) }), b.pendingWrite && st(d, g, { pendingWrite: b.pendingWrite }), !b.done);) Date.now() - oe > 3e4 && (await s(n, p, 600, m).catch(() => void 0), oe = Date.now()), await new Promise((e) => setTimeout(e, ie(Date.now() - se)));
|
|
249
|
+
if (!b.done && c !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
250
|
+
let ce = c === "vibe-plugins" ? await l(n, p, a, m).then((e) => e).catch(() => []) : void 0;
|
|
231
251
|
if (b.done || (b = {
|
|
232
252
|
...b,
|
|
233
253
|
content: `${b.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
|
|
234
254
|
}), r && (b = {
|
|
235
255
|
...b,
|
|
236
|
-
content: `${b.content}\n\n${
|
|
237
|
-
}),
|
|
238
|
-
|
|
256
|
+
content: `${b.content}\n\n${k("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._")}`
|
|
257
|
+
}), ne(b.content, ce, a, n), b.tokens) {
|
|
258
|
+
V(d, g, { tokens: b.tokens });
|
|
239
259
|
try {
|
|
240
260
|
await Ye?.({
|
|
241
|
-
workspaceId:
|
|
261
|
+
workspaceId: p,
|
|
242
262
|
sessionId: a,
|
|
243
263
|
messageId: b.messageId,
|
|
244
264
|
model: b.model,
|
|
245
265
|
tokens: b.tokens
|
|
246
|
-
}),
|
|
266
|
+
}), Pe(A);
|
|
247
267
|
} catch {}
|
|
248
268
|
}
|
|
249
|
-
|
|
269
|
+
H(d, "complete", g, null);
|
|
250
270
|
} catch (e) {
|
|
251
|
-
if (n === 1 &&
|
|
271
|
+
if (n === 1 && Me(e)) return U(d), lt(c), v(2);
|
|
252
272
|
throw e;
|
|
253
273
|
}
|
|
254
|
-
},
|
|
255
|
-
|
|
274
|
+
}, y = d;
|
|
275
|
+
Tt.current.add(y);
|
|
256
276
|
try {
|
|
257
|
-
if (!
|
|
258
|
-
await
|
|
277
|
+
if (!p) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
278
|
+
await v();
|
|
259
279
|
} catch (e) {
|
|
260
|
-
|
|
280
|
+
wt.current.invalidate(x.getState().sandboxesByMode[c]?.sandboxId ?? null);
|
|
261
281
|
let t = n(e);
|
|
262
282
|
if (t) {
|
|
263
|
-
t.refusal === "exhausted" &&
|
|
283
|
+
t.refusal === "exhausted" && Ne(A, "sandbox");
|
|
264
284
|
let e = [t.quotaName, t.traceId ? `reference ${t.traceId}` : null].filter(Boolean).join(" · "), n = t.refusal === "exhausted" ? "You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant." : "This workspace has no sandbox allowance provisioned, so the AI assistant cannot start. Upgrading will not help — ask an administrator to provision it.";
|
|
265
|
-
|
|
285
|
+
ne(e ? `${n}\n\n${e}` : n, void 0, void 0, void 0, "en"), H(d, "error", g, null);
|
|
266
286
|
return;
|
|
267
287
|
}
|
|
268
288
|
let i = e instanceof Error ? e.message : "Something went wrong";
|
|
269
|
-
|
|
289
|
+
H(d, "error", g, i), V(d, g, { content: `Sorry, an error occurred: ${i}. Please try again.` }), st(d, g, {
|
|
270
290
|
lang: "en",
|
|
271
291
|
..._(r.voiceSessionId)
|
|
272
292
|
});
|
|
273
293
|
} finally {
|
|
274
|
-
|
|
294
|
+
Tt.current.delete(y);
|
|
275
295
|
}
|
|
276
296
|
}, [
|
|
277
|
-
j,
|
|
278
297
|
F,
|
|
298
|
+
B,
|
|
279
299
|
Je,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
300
|
+
U,
|
|
301
|
+
lt,
|
|
302
|
+
rt,
|
|
303
|
+
z,
|
|
304
|
+
Dt,
|
|
285
305
|
qe,
|
|
306
|
+
M,
|
|
307
|
+
N,
|
|
308
|
+
V,
|
|
286
309
|
A,
|
|
287
|
-
Xe,
|
|
288
|
-
I,
|
|
289
|
-
O,
|
|
290
310
|
Ye,
|
|
291
|
-
|
|
292
|
-
it,
|
|
311
|
+
tt,
|
|
293
312
|
nt,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
313
|
+
et,
|
|
314
|
+
ct,
|
|
315
|
+
R,
|
|
316
|
+
H,
|
|
317
|
+
k,
|
|
298
318
|
q,
|
|
299
|
-
|
|
300
|
-
]),
|
|
319
|
+
P
|
|
320
|
+
]), Nt = S((e) => {
|
|
301
321
|
J(e);
|
|
302
|
-
}, [J]),
|
|
303
|
-
let e = [...
|
|
322
|
+
}, [J]), Pt = S(() => {
|
|
323
|
+
let e = [...G.chat].reverse().find((e) => e.role === "user"), t = F ? Ct.current[F] ?? [] : [];
|
|
304
324
|
e && J(e.content, t);
|
|
305
325
|
}, [
|
|
306
|
-
|
|
326
|
+
K,
|
|
307
327
|
J,
|
|
308
|
-
|
|
328
|
+
F
|
|
309
329
|
]), Y = T(J);
|
|
310
330
|
C(() => {
|
|
311
331
|
Y.current = J;
|
|
312
332
|
}, [J]);
|
|
313
|
-
let
|
|
314
|
-
if (
|
|
315
|
-
for (let e =
|
|
316
|
-
let t =
|
|
333
|
+
let Ft = w(() => {
|
|
334
|
+
if (pt) return null;
|
|
335
|
+
for (let e = K.length - 1; e >= 0; --e) {
|
|
336
|
+
let t = K[e];
|
|
317
337
|
if (t?.role !== "assistant" || !g(t)) continue;
|
|
318
|
-
let n =
|
|
338
|
+
let n = ve(t.content).text.trim();
|
|
319
339
|
return n ? {
|
|
320
340
|
id: t.id,
|
|
321
341
|
text: n
|
|
322
342
|
} : null;
|
|
323
343
|
}
|
|
324
344
|
return null;
|
|
325
|
-
}, [
|
|
345
|
+
}, [K, pt]), It = w(() => Ft ? b(Ft.text) : null, [Ft]), Lt = G.chat, X = w(() => G.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
326
346
|
id: e.id,
|
|
327
347
|
role: e.role,
|
|
328
|
-
text:
|
|
329
|
-
sessionId:
|
|
348
|
+
text: ve(e.content).text.trim(),
|
|
349
|
+
sessionId: ne(e),
|
|
330
350
|
timestamp: e.timestamp
|
|
331
|
-
})).filter((e) => e.text.length > 0), [
|
|
351
|
+
})).filter((e) => e.text.length > 0), [G.voice]), Rt = S(() => {
|
|
332
352
|
if (X.length === 0) return;
|
|
333
353
|
let e = /* @__PURE__ */ new Date();
|
|
334
|
-
|
|
335
|
-
title:
|
|
336
|
-
savedAt:
|
|
337
|
-
session:
|
|
338
|
-
earlier:
|
|
339
|
-
you:
|
|
340
|
-
assistant:
|
|
341
|
-
}, e),
|
|
354
|
+
Te(y(X, {
|
|
355
|
+
title: k("voiceSession.transcript", "Voice conversation"),
|
|
356
|
+
savedAt: k("voiceSession.savedAt", "Saved"),
|
|
357
|
+
session: k("voiceSession.sessionLabel", "Session"),
|
|
358
|
+
earlier: k("voiceSession.earlierLabel", "Earlier"),
|
|
359
|
+
you: k("voiceSession.speakerYou", "You"),
|
|
360
|
+
assistant: k("voiceSession.speakerAssistant", "Assistant")
|
|
361
|
+
}, e), re(A, e), "text/markdown");
|
|
342
362
|
}, [
|
|
343
|
-
|
|
363
|
+
A,
|
|
344
364
|
X,
|
|
345
|
-
|
|
346
|
-
]), Z =
|
|
365
|
+
k
|
|
366
|
+
]), Z = Fe(), Q = T(Z);
|
|
347
367
|
Q.current = Z;
|
|
348
|
-
let $ =
|
|
368
|
+
let $ = ye({
|
|
349
369
|
onSubmit: S((e, t) => {
|
|
350
370
|
let n = () => {
|
|
351
|
-
let n = Q.current, r =
|
|
371
|
+
let n = Q.current, r = me(n.attachments);
|
|
352
372
|
Y.current(e, r, { voiceSessionId: t }), n.clear();
|
|
353
373
|
};
|
|
354
374
|
if (!Q.current.isBusy) {
|
|
@@ -356,37 +376,37 @@ var k = ({ visible: h = !0, writeAccess: oe = "unknown" }) => {
|
|
|
356
376
|
return;
|
|
357
377
|
}
|
|
358
378
|
let r = Date.now(), i = window.setInterval(() => {
|
|
359
|
-
Q.current.isBusy && Date.now() - r <
|
|
379
|
+
Q.current.isBusy && Date.now() - r < We || (window.clearInterval(i), n());
|
|
360
380
|
}, 200);
|
|
361
381
|
}, []),
|
|
362
|
-
latestReply:
|
|
363
|
-
language:
|
|
364
|
-
}),
|
|
382
|
+
latestReply: Ft,
|
|
383
|
+
language: ae(Ze, Xe).tag
|
|
384
|
+
}), zt = w(() => (dt?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [dt?.messages]), Bt = X.length > zt, Vt = S(() => {
|
|
365
385
|
let e = x.getState().activeConversationId;
|
|
366
|
-
!e || X.length === 0 || (
|
|
367
|
-
id:
|
|
386
|
+
!e || X.length === 0 || (B(e, {
|
|
387
|
+
id: D(),
|
|
368
388
|
role: "system",
|
|
369
|
-
content:
|
|
370
|
-
intro:
|
|
371
|
-
nothing:
|
|
372
|
-
more: (e) =>
|
|
389
|
+
content: v(X.slice(zt), {
|
|
390
|
+
intro: k("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
391
|
+
nothing: k("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
392
|
+
more: (e) => k("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
373
393
|
}),
|
|
374
394
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
375
395
|
metadata: { continuedVoiceTurns: X.length }
|
|
376
|
-
}),
|
|
396
|
+
}), St(!1), $.end());
|
|
377
397
|
}, [
|
|
378
398
|
X,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
399
|
+
zt,
|
|
400
|
+
B,
|
|
401
|
+
k,
|
|
382
402
|
$
|
|
383
|
-
]),
|
|
403
|
+
]), Ht = T(0);
|
|
384
404
|
C(() => {
|
|
385
|
-
$.active && (
|
|
405
|
+
$.active && (Ht.current = X.length);
|
|
386
406
|
}, [$.active]);
|
|
387
|
-
let
|
|
388
|
-
let e = X.length >
|
|
389
|
-
$.end(), e &&
|
|
407
|
+
let Ut = S(() => {
|
|
408
|
+
let e = X.length > Ht.current;
|
|
409
|
+
$.end(), e && St(!0);
|
|
390
410
|
}, [X, $]);
|
|
391
411
|
C(() => {
|
|
392
412
|
!h && $.active && $.end();
|
|
@@ -401,82 +421,82 @@ var k = ({ visible: h = !0, writeAccess: oe = "unknown" }) => {
|
|
|
401
421
|
}
|
|
402
422
|
});
|
|
403
423
|
}, []);
|
|
404
|
-
let
|
|
405
|
-
let t =
|
|
424
|
+
let Wt = S((e) => {
|
|
425
|
+
let t = F ? x.getState().conversations.find((e) => e.id === F) : void 0;
|
|
406
426
|
if (t && (t.messages.length > 0 || t.backendSessionId)) {
|
|
407
427
|
if (t.mode !== e) {
|
|
408
428
|
let t = x.getState().conversations.find((t) => t.mode === e && t.messages.length === 0 && !t.backendSessionId && !x.getState().processingByConversationId[t.id]);
|
|
409
|
-
t ?
|
|
429
|
+
t ? at(t.id) : z(void 0, e);
|
|
410
430
|
}
|
|
411
|
-
} else
|
|
412
|
-
|
|
431
|
+
} else F && R(F, e);
|
|
432
|
+
L(e);
|
|
413
433
|
}, [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
]),
|
|
420
|
-
if (
|
|
421
|
-
|
|
434
|
+
F,
|
|
435
|
+
z,
|
|
436
|
+
at,
|
|
437
|
+
R,
|
|
438
|
+
L
|
|
439
|
+
]), Gt = S((e) => {
|
|
440
|
+
if (j.find((t) => t.id === e)?.writeCapable && !x.getState().apiCallsAcknowledged) {
|
|
441
|
+
bt(e);
|
|
422
442
|
return;
|
|
423
443
|
}
|
|
424
|
-
|
|
425
|
-
}, [
|
|
426
|
-
let e =
|
|
427
|
-
|
|
444
|
+
Wt(e);
|
|
445
|
+
}, [Wt, j]), Kt = S(() => {
|
|
446
|
+
let e = yt;
|
|
447
|
+
bt(null), ut(), e && Wt(e);
|
|
428
448
|
}, [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
]),
|
|
433
|
-
|
|
449
|
+
yt,
|
|
450
|
+
ut,
|
|
451
|
+
Wt
|
|
452
|
+
]), qt = S(() => {
|
|
453
|
+
bt(null);
|
|
434
454
|
}, []);
|
|
435
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ Be("div", {
|
|
436
456
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
437
457
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ Be("div", {
|
|
439
459
|
className: "contents",
|
|
440
460
|
inert: $.active || void 0,
|
|
441
461
|
children: [
|
|
442
|
-
X.length > 0 && !$.active ? /* @__PURE__ */ E(
|
|
462
|
+
X.length > 0 && !$.active ? /* @__PURE__ */ E(Ce, {
|
|
443
463
|
count: X.length,
|
|
444
|
-
onOpenTranscript: () =>
|
|
464
|
+
onOpenTranscript: () => St(!0)
|
|
445
465
|
}) : null,
|
|
446
|
-
|
|
447
|
-
mode:
|
|
448
|
-
onSuggestionClick:
|
|
466
|
+
Lt.length === 0 ? /* @__PURE__ */ E(Ee, {
|
|
467
|
+
mode: I,
|
|
468
|
+
onSuggestionClick: Nt
|
|
449
469
|
}) : /* @__PURE__ */ E("div", {
|
|
450
470
|
className: "flex min-h-0 flex-1 flex-col",
|
|
451
|
-
children: /* @__PURE__ */ E(
|
|
452
|
-
onApprovePendingWrite:
|
|
453
|
-
approvingWriteRef:
|
|
454
|
-
messages:
|
|
455
|
-
streamingMessageId:
|
|
456
|
-
failedMessageId:
|
|
457
|
-
onRetry:
|
|
471
|
+
children: /* @__PURE__ */ E(De, {
|
|
472
|
+
onApprovePendingWrite: Mt,
|
|
473
|
+
approvingWriteRef: Ot,
|
|
474
|
+
messages: Lt,
|
|
475
|
+
streamingMessageId: mt,
|
|
476
|
+
failedMessageId: ht,
|
|
477
|
+
onRetry: Pt
|
|
458
478
|
})
|
|
459
479
|
}),
|
|
460
|
-
/* @__PURE__ */ E(
|
|
461
|
-
onStartVoiceSession: $.available &&
|
|
480
|
+
/* @__PURE__ */ E(Ie, {
|
|
481
|
+
onStartVoiceSession: $.available && I !== "api-calls" ? $.start : void 0,
|
|
462
482
|
onSend: (e, t) => void J(e, t),
|
|
463
|
-
disabled:
|
|
464
|
-
placeholder:
|
|
465
|
-
mode:
|
|
466
|
-
writeAccessDenied:
|
|
467
|
-
availableModes:
|
|
468
|
-
onModeChange:
|
|
483
|
+
disabled: pt,
|
|
484
|
+
placeholder: I === "api-calls" ? k("chatArea.placeholderActions", "What would you like me to do?") : k("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
485
|
+
mode: I,
|
|
486
|
+
writeAccessDenied: se === "denied" && !!Et?.writeCapable,
|
|
487
|
+
availableModes: vt,
|
|
488
|
+
onModeChange: Gt
|
|
469
489
|
})
|
|
470
490
|
]
|
|
471
491
|
}),
|
|
472
|
-
|
|
492
|
+
xt && !$.active ? /* @__PURE__ */ E(we, {
|
|
473
493
|
turns: X,
|
|
474
|
-
onClose: () =>
|
|
475
|
-
onSave:
|
|
476
|
-
onContinueInChat:
|
|
494
|
+
onClose: () => St(!1),
|
|
495
|
+
onSave: Rt,
|
|
496
|
+
onContinueInChat: Bt ? Vt : void 0,
|
|
477
497
|
closeOnEscape: !0
|
|
478
498
|
}) : null,
|
|
479
|
-
$.active && /* @__PURE__ */ E(
|
|
499
|
+
$.active && /* @__PURE__ */ E(Oe, {
|
|
480
500
|
session: $.session,
|
|
481
501
|
notice: $.notice,
|
|
482
502
|
capturing: $.capturing,
|
|
@@ -490,20 +510,22 @@ var k = ({ visible: h = !0, writeAccess: oe = "unknown" }) => {
|
|
|
490
510
|
onRetryAttachment: Z.retry,
|
|
491
511
|
canAttachMore: Z.canAddMore,
|
|
492
512
|
preparingAttachments: Z.preparingCount,
|
|
493
|
-
onSaveTranscript:
|
|
494
|
-
onContinueInChat:
|
|
495
|
-
onInterrupt:
|
|
496
|
-
|
|
513
|
+
onSaveTranscript: Rt,
|
|
514
|
+
onContinueInChat: Vt,
|
|
515
|
+
onInterrupt: () => {
|
|
516
|
+
$.interrupt(), jt();
|
|
517
|
+
},
|
|
518
|
+
spoken: It,
|
|
497
519
|
onToggleMute: $.toggleMute,
|
|
498
|
-
onEnd:
|
|
520
|
+
onEnd: Ut
|
|
499
521
|
}),
|
|
500
|
-
/* @__PURE__ */ E(
|
|
501
|
-
open:
|
|
502
|
-
onConfirm:
|
|
503
|
-
onCancel:
|
|
522
|
+
/* @__PURE__ */ E(Re, {
|
|
523
|
+
open: yt !== null,
|
|
524
|
+
onConfirm: Kt,
|
|
525
|
+
onCancel: qt
|
|
504
526
|
})
|
|
505
527
|
]
|
|
506
528
|
});
|
|
507
529
|
};
|
|
508
530
|
//#endregion
|
|
509
|
-
export {
|
|
531
|
+
export { j as AssistantChatArea };
|
package/dist/shared-assistant.js
CHANGED
|
@@ -4,90 +4,90 @@ import { buildSandboxContextInput as a, executeSandboxGraphQL as o } from "./sha
|
|
|
4
4
|
import { CHECK_AI_CREDITS as s, CREATE_SANDBOX as c, EXTEND_SANDBOX_TTL as l, GET_ACTIVE_SANDBOXES as u, GET_SANDBOX as d, PROXY_SANDBOX_REQUEST as f, REPORT_AI_TOKEN_USAGE as p, STOP_ASSISTANT_SANDBOX as m, WAIT_FOR_SANDBOX_RUNNING as h } from "./shared/assistant/operations.js";
|
|
5
5
|
import { ASSISTANT_API_AUTH_STRATEGY as g, getImageForMode as _, getImageTagForMode as v, getResourcesForMode as y, getSandboxImageRegistry as b, resolveSandboxAssistantMode as x } from "./shared/assistant/images.js";
|
|
6
6
|
import { getCapability as S, isUnknownFieldError as C, markSupported as w, markUnsupported as T } from "./shared/assistant/capabilities.js";
|
|
7
|
-
import {
|
|
8
|
-
import { AssistantRuntimeManager as
|
|
9
|
-
import { buildProgress as
|
|
10
|
-
import { createSandboxAssistantTransport as
|
|
11
|
-
import { useSandboxAssistantTransport as
|
|
12
|
-
import { chatTurns as
|
|
13
|
-
import { browserSpeechEngine as
|
|
14
|
-
import { HOSTED_TTS_TIER as
|
|
15
|
-
import { HOSTED_TTS_MAX_CHARS as
|
|
16
|
-
import { createHostedTtsEngine as
|
|
17
|
-
import { createRoutingSpeechEngine as
|
|
18
|
-
import { configureSpeechEngine as
|
|
19
|
-
import { micIsInterrupt as
|
|
20
|
-
import { ENDPOINT_GRACE_MS as
|
|
21
|
-
import { SPEECH_LANG as
|
|
22
|
-
import { buildContinuedFromVoiceNote as
|
|
23
|
-
import { DEFAULT_SPEAKABLE_LABELS as
|
|
24
|
-
import { PREVIEW_LANGUAGES as
|
|
25
|
-
import { MINI_CAPTION_BUDGET as
|
|
26
|
-
import { POLL_FAST_MS as
|
|
27
|
-
import { toCaptionText as
|
|
28
|
-
import { ASSISTANT_LANGUAGES as
|
|
29
|
-
import { replyFollowsInput as
|
|
30
|
-
import { findPendingWrite as
|
|
31
|
-
import { AssistantProductProvider as
|
|
32
|
-
import { AssistantI18nProvider as
|
|
33
|
-
import { SPOKEN_LABEL_LANGUAGES as
|
|
34
|
-
import { detectScriptLocale as
|
|
35
|
-
import { IDLE_PLAYBACK as
|
|
36
|
-
import { MAX_INLINE_IMAGE_BASE64_BYTES as
|
|
37
|
-
import { BOILERPLATE_PAGE_SHARE as
|
|
38
|
-
import { ATTACHMENT_ACCEPT as
|
|
39
|
-
import { useAssistantStore as
|
|
40
|
-
import { isTurnInFlight as
|
|
41
|
-
import { AssistantToolActivity as
|
|
42
|
-
import { AssistantSpeechProvider as
|
|
43
|
-
import { useVoiceSession as
|
|
44
|
-
import { copyToClipboard as
|
|
45
|
-
import { getActorId as
|
|
46
|
-
import { ATTACHMENT_SOURCES as
|
|
47
|
-
import { SANDBOX_READY_TTL_MS as
|
|
48
|
-
import { AssistantAutoSpeakToggle as
|
|
49
|
-
import { AssistantMarkdownImage as
|
|
50
|
-
import { AssistantMarkdownRenderer as
|
|
51
|
-
import { AssistantMessageAttachments as
|
|
52
|
-
import { AssistantPendingWriteCard as
|
|
53
|
-
import { AssistantLanguageMenu as
|
|
54
|
-
import { AssistantReplyLanguageSelector as
|
|
55
|
-
import { AssistantSpeakButton as
|
|
56
|
-
import { AssistantSpokenTurnsNotice as
|
|
57
|
-
import { AssistantAttachmentButton as
|
|
58
|
-
import { AssistantAttachmentChips as
|
|
59
|
-
import { AssistantLanguageSelector as
|
|
60
|
-
import { ASSISTANT_MODE_META as
|
|
61
|
-
import { AssistantVoiceButton as
|
|
62
|
-
import { AUTO_VOICE as
|
|
63
|
-
import { AssistantVoiceOrb as
|
|
64
|
-
import { AssistantVoiceSessionButton as
|
|
65
|
-
import { CAPTION_SCROLL_ATTR as
|
|
66
|
-
import { VoiceConversationView as
|
|
67
|
-
import { VoiceWaveform as
|
|
68
|
-
import { VoiceMiniController as
|
|
69
|
-
import { VoiceStage as
|
|
70
|
-
import { VoiceTranscriptDrawer as
|
|
71
|
-
import { downloadFile as
|
|
72
|
-
import { AssistantMoreMenu as
|
|
73
|
-
import { AssistantHeader as
|
|
74
|
-
import { AssistantConversationList as
|
|
75
|
-
import { AssistantEmptyState as
|
|
76
|
-
import { AssistantMessageItem as
|
|
77
|
-
import { AssistantMessageList as
|
|
78
|
-
import { AssistantVoiceSession as
|
|
79
|
-
import { useAssistantApiAccess as
|
|
80
|
-
import { useConversationTurns as
|
|
81
|
-
import { isMultimodalBodyRejection as
|
|
82
|
-
import { aiCreditsUpdatedEventName as
|
|
83
|
-
import { useWorkspaceWriteAccess as
|
|
84
|
-
import { extractDocumentText as
|
|
85
|
-
import { useAssistantAttachments as
|
|
86
|
-
import { AssistantComposer as
|
|
87
|
-
import { isProdRuntime as
|
|
88
|
-
import { useAssistantHeartbeat as
|
|
89
|
-
import { useAssistantKeyboardShortcuts as
|
|
90
|
-
import { AssistantApiCallsConsentDialog as
|
|
91
|
-
import { AssistantChatArea as
|
|
92
|
-
import { AIAssistantPanel as
|
|
93
|
-
export {
|
|
7
|
+
import { abortAssistantTurn as E, approvePendingWrite as D, buildAssistantSandboxEnv as O, buildPromptRequestBody as k, checkAssistantAiCredits as A, createAssistantSandbox as j, createAssistantSession as M, downloadAssistantArtifact as N, extendAssistantSandboxTTL as P, findExistingSandbox as F, getAssistantArtifacts as I, getAssistantMessages as L, getAssistantSession as R, getAssistantStreamAccess as z, modeRequiresConfirmWrites as B, releaseSupersededAssistantSandboxes as V, reportAssistantAiTokenUsage as H, selectExistingAssistantSandbox as U, selectSupersededAssistantSandboxes as W, sendAssistantPromptAsync as G, sendHeartbeat as K, stopReapedAssistantSandbox as q, waitForAssistantServiceReady as J, waitForSandboxRunning as Y } from "./shared/assistant/api.js";
|
|
8
|
+
import { AssistantRuntimeManager as X } from "./shared/assistant/runtime.js";
|
|
9
|
+
import { buildProgress as Z, getAssistantMedia as Q, getAssistantText as $, getRawMessageCreatedAt as ee, getToolProgress as te, isReapedSandboxConnectionError as ne, isRecoverable as re, mapSessionToHistory as ie, mergeMessagesById as ae, sanitize as oe } from "./shared/assistant/progress.js";
|
|
10
|
+
import { createSandboxAssistantTransport as se } from "./shared/assistant/createSandboxAssistantTransport.js";
|
|
11
|
+
import { useSandboxAssistantTransport as ce } from "./shared/assistant/useSandboxAssistantTransport.js";
|
|
12
|
+
import { chatTurns as le, groupBySession as ue, groupConsecutiveBySession as de, isVoiceTurn as fe, voiceMarker as pe, voiceSessionIdOf as me, voiceTurnsOnly as he } from "./shared/assistant/voice/turnVisibility.js";
|
|
13
|
+
import { browserSpeechEngine as ge } from "./shared/assistant/speech/browserSpeechEngine.js";
|
|
14
|
+
import { HOSTED_TTS_TIER as _e, HOSTED_VOICES as ve, hostedLocaleFor as ye, hostedSupportsLanguage as be } from "./shared/assistant/speech/hostedVoiceCatalogue.js";
|
|
15
|
+
import { HOSTED_TTS_MAX_CHARS as xe, SPEAKING_RATE_MAX as Se, SPEAKING_RATE_MAX_STREAMING as Ce, SPEAKING_RATE_MAX_SYNC as we, SPEAKING_RATE_MIN as Te, base64ToBytes as Ee, buildRequest as De, classifyHttpFailure as Oe, decodeAudioResponse as ke, shouldDisableEngine as Ae, splitForVendor as je } from "./shared/assistant/speech/hostedTtsProtocol.js";
|
|
16
|
+
import { createHostedTtsEngine as Me } from "./shared/assistant/speech/hostedTtsSpeechEngine.js";
|
|
17
|
+
import { createRoutingSpeechEngine as Ne } from "./shared/assistant/speech/routingSpeechEngine.js";
|
|
18
|
+
import { configureSpeechEngine as Pe, createSpeechEngines as Fe, getSpeechEngine as Ie, readSpeechEngineConfig as Le, resetSpeechEngine as Re } from "./shared/assistant/speech/createSpeechEngine.js";
|
|
19
|
+
import { micIsInterrupt as ze, showsAssistantCaption as Be, showsUserCaption as Ve, voiceStageState as He, waveformIsActive as Ue, waveformIsSettled as We } from "./shared/assistant/voice/voiceStageState.js";
|
|
20
|
+
import { ENDPOINT_GRACE_MS as Ge, INITIAL_SESSION as Ke, INTERRUPT_MAX_MS as qe, INTERRUPT_MIN_MS as Je, SILENCE_SUBMIT_MS as Ye, isCapturing as Xe, isEcho as Ze, isSubmittable as Qe, orbMode as $e, planReplyConsumption as et, spokenSoFar as tt, voiceSessionReducer as nt } from "./shared/assistant/voice/voiceSession.js";
|
|
21
|
+
import { SPEECH_LANG as rt, VOICE_LIST_TIMEOUT_MS as it, isSpeechBlocked as at, languageDisplayName as ot, normalizeLangTag as st, primaryLanguageSubtag as ct, selectVoiceForLocale as lt, speechGate as ut, speechLangForLocale as dt, voiceAvailability as ft, voiceQualityRank as pt, voicesForLocale as mt } from "./shared/assistant/voice/speechVoices.js";
|
|
22
|
+
import { buildContinuedFromVoiceNote as ht, buildVoiceTranscriptMarkdown as gt, voiceTranscriptFilename as _t } from "./shared/assistant/voice/voiceTranscript.js";
|
|
23
|
+
import { DEFAULT_SPEAKABLE_LABELS as vt, MAX_SPEAKABLE_CHARS as yt, MAX_SPOKEN_TABLE_ROWS as bt, SPEECH_CHUNK_CHARS as xt, SPEECH_CHUNK_CJK_CHARS as St, chunkForSpeech as Ct, containsCjk as wt, speakableEmail as Tt, splitTableRow as Et, toSpeakableText as Dt } from "./shared/assistant/voice/speakableText.js";
|
|
24
|
+
import { PREVIEW_LANGUAGES as Ot, voicePreviewText as kt } from "./shared/assistant/voice/voicePreview.js";
|
|
25
|
+
import { MINI_CAPTION_BUDGET as At, showPreviousChunk as jt } from "./shared/assistant/voice/miniCaptionBudget.js";
|
|
26
|
+
import { POLL_FAST_MS as Mt, POLL_FAST_UNTIL_MS as Nt, POLL_SLOW_MS as Pt, POLL_STEADY_MS as Ft, POLL_STEADY_UNTIL_MS as It, pollDelayMs as Lt } from "./shared/assistant/voice/assistantPollSchedule.js";
|
|
27
|
+
import { toCaptionText as Rt } from "./shared/assistant/voice/captionText.js";
|
|
28
|
+
import { ASSISTANT_LANGUAGES as zt, DEFAULT_SPEECH_RATE as Bt, findAssistantLanguage as Vt, resolveAssistantLanguage as Ht } from "./shared/assistant/voice/languages.js";
|
|
29
|
+
import { replyFollowsInput as Ut, resolveLanguagePair as Wt } from "./shared/assistant/voice/languagePair.js";
|
|
30
|
+
import { findPendingWrite as Gt, parseConfirmationRefusal as Kt } from "./shared/assistant/pendingWrite.js";
|
|
31
|
+
import { AssistantProductProvider as qt, resolveModeConfig as Jt, useAssistantPageLabel as Yt, useAssistantProduct as Xt, useAssistantProductOrNull as Zt, useAssistantStorageFolders as Qt } from "./shared/assistant/product.js";
|
|
32
|
+
import { AssistantI18nProvider as $t, assistantTranslationKey as en, useAssistantI18nNamespace as tn, useAssistantTr as nn } from "./shared/assistant/i18n.js";
|
|
33
|
+
import { SPOKEN_LABEL_LANGUAGES as rn, speechLabelsFor as an } from "./shared/assistant/voice/speechLabels.js";
|
|
34
|
+
import { detectScriptLocale as on, resolveSpeechLocale as sn } from "./shared/assistant/voice/replyLanguage.js";
|
|
35
|
+
import { IDLE_PLAYBACK as cn, isSpeakingMessage as ln, requiresCancel as un, speechPlaybackReducer as dn } from "./shared/assistant/voice/speechPlayback.js";
|
|
36
|
+
import { MAX_INLINE_IMAGE_BASE64_BYTES as fn, MAX_REQUEST_BODY_BYTES as pn } from "./shared/assistant/gatewayLimits.js";
|
|
37
|
+
import { BOILERPLATE_PAGE_SHARE as mn, MAX_BOILERPLATE_LINE_CHARS as hn, MAX_EXTRACTED_CHARS as gn, MAX_PDF_PAGES_SCANNED as _n, MIN_PAGE_TEXT_CHARS as vn, MIN_TEXT_PAGE_SHARE as yn, columnLetterToIndex as bn, decodeXmlEntities as xn, docxXmlToText as Sn, fitPdfPages as Cn, formatPageRanges as wn, isMostlyImagePages as Tn, joinSheets as En, pageMarker as Dn, parseSharedStrings as On, parseWorkbookSheets as kn, pdfTextItemsToPage as An, sheetXmlToRows as jn, summarisePageText as Mn, truncatePagesForInline as Nn } from "./shared/assistant/documentText.js";
|
|
38
|
+
import { ATTACHMENT_ACCEPT as Pn, AttachmentRejectedError as Fn, INLINE_IMAGE_MAX_DIM as In, INLINE_IMAGE_QUALITY as Ln, MAX_ATTACHMENTS as Rn, MAX_FILE_BYTES as zn, MAX_INLINE_CHARS_PER_FILE as Bn, MAX_INLINE_CHARS_TOTAL as Vn, MAX_INLINE_IMAGE_BASE64_CHARS as Hn, MAX_INLINE_IMAGE_PARTS as Un, MAX_INLINE_TURN_BODY_BYTES as Wn, MAX_TURN_BODY_BYTES as Gn, PROMPT_ENVELOPE_RESERVE_BYTES as Kn, TURN_BODY_HEADROOM_BYTES as qn, buildAttachmentPromptBlock as Jn, buildPromptParts as Yn, buildPromptWithAttachments as Xn, classifyAttachment as Zn, countInlineImageCandidates as Qn, countInlinedImageParts as $n, detectDocumentFormat as er, estimateTurnBodyBytes as tr, formatBytes as nr, getAttachmentSendBlocker as rr, getExtension as ir, getSendableAttachments as ar, hasAttachmentWorkInFlight as or, parseDataUrl as sr, toMessageAttachment as cr, truncateForInline as lr, validateFile as ur } from "./shared/assistant/attachments.js";
|
|
39
|
+
import { useAssistantStore as dr } from "./shared/assistant/store.js";
|
|
40
|
+
import { isTurnInFlight as fr, planTurnAbort as pr } from "./shared/assistant/turnState.js";
|
|
41
|
+
import { AssistantToolActivity as mr, parseToolActivity as hr } from "./shared/assistant/ui/AssistantToolActivity.js";
|
|
42
|
+
import { AssistantSpeechProvider as gr, useAssistantSpeech as _r } from "./shared/assistant/ui/AssistantSpeechProvider.js";
|
|
43
|
+
import { useVoiceSession as vr } from "./shared/assistant/ui/useVoiceSession.js";
|
|
44
|
+
import { copyToClipboard as yr } from "./shared/assistant/clipboard.js";
|
|
45
|
+
import { getActorId as br, getOrganizationId as xr, getWorkspaceId as Sr } from "./shared/assistant/context.js";
|
|
46
|
+
import { ATTACHMENT_SOURCES as Cr, availableAttachmentSources as wr, deviceHasCamera as Tr } from "./shared/assistant/attachmentSources.js";
|
|
47
|
+
import { SANDBOX_READY_TTL_MS as Er, createReadinessTracker as Dr, isRecentlyVerified as Or } from "./shared/assistant/sandboxReadiness.js";
|
|
48
|
+
import { AssistantAutoSpeakToggle as kr } from "./shared/assistant/ui/AssistantAutoSpeakToggle.js";
|
|
49
|
+
import { AssistantMarkdownImage as Ar, imageHostLabel as jr, isRemoteImageSrc as Mr } from "./shared/assistant/ui/AssistantMarkdownImage.js";
|
|
50
|
+
import { AssistantMarkdownRenderer as Nr, assistantUrlTransform as Pr } from "./shared/assistant/ui/AssistantMarkdownRenderer.js";
|
|
51
|
+
import { AssistantMessageAttachments as Fr } from "./shared/assistant/ui/AssistantMessageAttachments.js";
|
|
52
|
+
import { AssistantPendingWriteCard as Ir } from "./shared/assistant/ui/AssistantPendingWriteCard.js";
|
|
53
|
+
import { AssistantLanguageMenu as Lr } from "./shared/assistant/ui/AssistantLanguageMenu.js";
|
|
54
|
+
import { AssistantReplyLanguageSelector as Rr } from "./shared/assistant/ui/AssistantReplyLanguageSelector.js";
|
|
55
|
+
import { AssistantSpeakButton as zr } from "./shared/assistant/ui/AssistantSpeakButton.js";
|
|
56
|
+
import { AssistantSpokenTurnsNotice as Br } from "./shared/assistant/ui/AssistantSpokenTurnsNotice.js";
|
|
57
|
+
import { AssistantAttachmentButton as Vr } from "./shared/assistant/ui/composer/AssistantAttachmentButton.js";
|
|
58
|
+
import { AssistantAttachmentChips as Hr } from "./shared/assistant/ui/composer/AssistantAttachmentChips.js";
|
|
59
|
+
import { AssistantLanguageSelector as Ur, FOLLOW_APP_LOCALE as Wr } from "./shared/assistant/ui/composer/AssistantLanguageSelector.js";
|
|
60
|
+
import { ASSISTANT_MODE_META as Gr, AssistantModeSelector as Kr, nextModeIndex as qr } from "./shared/assistant/ui/composer/AssistantModeSelector.js";
|
|
61
|
+
import { AssistantVoiceButton as Jr } from "./shared/assistant/ui/composer/AssistantVoiceButton.js";
|
|
62
|
+
import { AUTO_VOICE as Yr, AssistantVoiceSelector as Xr } from "./shared/assistant/ui/composer/AssistantVoiceSelector.js";
|
|
63
|
+
import { AssistantVoiceOrb as Zr } from "./shared/assistant/ui/voice/AssistantVoiceOrb.js";
|
|
64
|
+
import { AssistantVoiceSessionButton as Qr } from "./shared/assistant/ui/voice/AssistantVoiceSessionButton.js";
|
|
65
|
+
import { CAPTION_SCROLL_ATTR as $r, VoiceCaption as ei } from "./shared/assistant/ui/voice/VoiceCaption.js";
|
|
66
|
+
import { VoiceConversationView as ti } from "./shared/assistant/ui/voice/VoiceConversationView.js";
|
|
67
|
+
import { VoiceWaveform as ni } from "./shared/assistant/ui/voice/VoiceWaveform.js";
|
|
68
|
+
import { VoiceMiniController as ri } from "./shared/assistant/ui/voice/VoiceMiniController.js";
|
|
69
|
+
import { VoiceStage as ii } from "./shared/assistant/ui/voice/VoiceStage.js";
|
|
70
|
+
import { VoiceTranscriptDrawer as ai } from "./shared/assistant/ui/voice/VoiceTranscriptDrawer.js";
|
|
71
|
+
import { downloadFile as oi, exportConversation as si } from "./shared/assistant/exportConversation.js";
|
|
72
|
+
import { AssistantMoreMenu as ci } from "./shared/assistant/ui/AssistantMoreMenu.js";
|
|
73
|
+
import { AssistantHeader as li } from "./shared/assistant/ui/AssistantHeader.js";
|
|
74
|
+
import { AssistantConversationList as ui } from "./shared/assistant/ui/AssistantConversationList.js";
|
|
75
|
+
import { AssistantEmptyState as di } from "./shared/assistant/ui/AssistantEmptyState.js";
|
|
76
|
+
import { AssistantMessageItem as fi } from "./shared/assistant/ui/AssistantMessageItem.js";
|
|
77
|
+
import { AssistantMessageList as pi } from "./shared/assistant/ui/AssistantMessageList.js";
|
|
78
|
+
import { AssistantVoiceSession as mi } from "./shared/assistant/ui/voice/AssistantVoiceSession.js";
|
|
79
|
+
import { useAssistantApiAccess as hi } from "./shared/assistant/useAssistantApiAccess.js";
|
|
80
|
+
import { useConversationTurns as gi } from "./shared/assistant/useConversationTurns.js";
|
|
81
|
+
import { isMultimodalBodyRejection as _i, isRecoverableAssistantError as vi } from "./shared/assistant/transportErrors.js";
|
|
82
|
+
import { aiCreditsUpdatedEventName as yi, dispatchAssistantQuotaExhausted as bi, notifyAiCreditsUpdated as xi } from "./shared/assistant/aiCredits.js";
|
|
83
|
+
import { useWorkspaceWriteAccess as Si } from "./shared/assistant/useWorkspaceWriteAccess.js";
|
|
84
|
+
import { extractDocumentText as Ci } from "./shared/assistant/documentExtract.js";
|
|
85
|
+
import { useAssistantAttachments as wi } from "./shared/assistant/useAssistantAttachments.js";
|
|
86
|
+
import { AssistantComposer as Ti } from "./shared/assistant/ui/composer/AssistantComposer.js";
|
|
87
|
+
import { isProdRuntime as Ei } from "./shared/assistant/env.js";
|
|
88
|
+
import { useAssistantHeartbeat as Di } from "./shared/assistant/useAssistantHeartbeat.js";
|
|
89
|
+
import { useAssistantKeyboardShortcuts as Oi } from "./shared/assistant/useAssistantKeyboardShortcuts.js";
|
|
90
|
+
import { AssistantApiCallsConsentDialog as ki } from "./shared/assistant/ui/AssistantApiCallsConsentDialog.js";
|
|
91
|
+
import { AssistantChatArea as Ai } from "./shared/assistant/ui/AssistantChatArea.js";
|
|
92
|
+
import { AIAssistantPanel as ji } from "./shared/assistant/ui/AIAssistantPanel.js";
|
|
93
|
+
export { ji as AIAssistantPanel, g as ASSISTANT_API_AUTH_STRATEGY, zt as ASSISTANT_LANGUAGES, Gr as ASSISTANT_MODE_META, Pn as ATTACHMENT_ACCEPT, Cr as ATTACHMENT_SOURCES, Yr as AUTO_VOICE, ki as AssistantApiCallsConsentDialog, Vr as AssistantAttachmentButton, Hr as AssistantAttachmentChips, kr as AssistantAutoSpeakToggle, Ai as AssistantChatArea, Ti as AssistantComposer, ui as AssistantConversationList, di as AssistantEmptyState, li as AssistantHeader, $t as AssistantI18nProvider, Lr as AssistantLanguageMenu, Ur as AssistantLanguageSelector, Ar as AssistantMarkdownImage, Nr as AssistantMarkdownRenderer, Fr as AssistantMessageAttachments, fi as AssistantMessageItem, pi as AssistantMessageList, Kr as AssistantModeSelector, ci as AssistantMoreMenu, Ir as AssistantPendingWriteCard, qt as AssistantProductProvider, Rr as AssistantReplyLanguageSelector, X as AssistantRuntimeManager, zr as AssistantSpeakButton, gr as AssistantSpeechProvider, Br as AssistantSpokenTurnsNotice, mr as AssistantToolActivity, Jr as AssistantVoiceButton, Zr as AssistantVoiceOrb, Xr as AssistantVoiceSelector, mi as AssistantVoiceSession, Qr as AssistantVoiceSessionButton, Fn as AttachmentRejectedError, mn as BOILERPLATE_PAGE_SHARE, $r as CAPTION_SCROLL_ATTR, s as CHECK_AI_CREDITS, c as CREATE_SANDBOX, vt as DEFAULT_SPEAKABLE_LABELS, Bt as DEFAULT_SPEECH_RATE, Ge as ENDPOINT_GRACE_MS, l as EXTEND_SANDBOX_TTL, Wr as FOLLOW_APP_LOCALE, u as GET_ACTIVE_SANDBOXES, d as GET_SANDBOX, xe as HOSTED_TTS_MAX_CHARS, _e as HOSTED_TTS_TIER, ve as HOSTED_VOICES, cn as IDLE_PLAYBACK, Ke as INITIAL_SESSION, In as INLINE_IMAGE_MAX_DIM, Ln as INLINE_IMAGE_QUALITY, qe as INTERRUPT_MAX_MS, Je as INTERRUPT_MIN_MS, Rn as MAX_ATTACHMENTS, hn as MAX_BOILERPLATE_LINE_CHARS, gn as MAX_EXTRACTED_CHARS, zn as MAX_FILE_BYTES, Bn as MAX_INLINE_CHARS_PER_FILE, Vn as MAX_INLINE_CHARS_TOTAL, fn as MAX_INLINE_IMAGE_BASE64_BYTES, Hn as MAX_INLINE_IMAGE_BASE64_CHARS, Un as MAX_INLINE_IMAGE_PARTS, Wn as MAX_INLINE_TURN_BODY_BYTES, _n as MAX_PDF_PAGES_SCANNED, pn as MAX_REQUEST_BODY_BYTES, yt as MAX_SPEAKABLE_CHARS, bt as MAX_SPOKEN_TABLE_ROWS, Gn as MAX_TURN_BODY_BYTES, At as MINI_CAPTION_BUDGET, vn as MIN_PAGE_TEXT_CHARS, yn as MIN_TEXT_PAGE_SHARE, Mt as POLL_FAST_MS, Nt as POLL_FAST_UNTIL_MS, Pt as POLL_SLOW_MS, Ft as POLL_STEADY_MS, It as POLL_STEADY_UNTIL_MS, Ot as PREVIEW_LANGUAGES, Kn as PROMPT_ENVELOPE_RESERVE_BYTES, f as PROXY_SANDBOX_REQUEST, p as REPORT_AI_TOKEN_USAGE, Er as SANDBOX_READY_TTL_MS, Ye as SILENCE_SUBMIT_MS, Se as SPEAKING_RATE_MAX, Ce as SPEAKING_RATE_MAX_STREAMING, we as SPEAKING_RATE_MAX_SYNC, Te as SPEAKING_RATE_MIN, xt as SPEECH_CHUNK_CHARS, St as SPEECH_CHUNK_CJK_CHARS, rt as SPEECH_LANG, rn as SPOKEN_LABEL_LANGUAGES, m as STOP_ASSISTANT_SANDBOX, qn as TURN_BODY_HEADROOM_BYTES, it as VOICE_LIST_TIMEOUT_MS, ei as VoiceCaption, ti as VoiceConversationView, ri as VoiceMiniController, ii as VoiceStage, ai as VoiceTranscriptDrawer, ni as VoiceWaveform, h as WAIT_FOR_SANDBOX_RUNNING, E as abortAssistantTurn, yi as aiCreditsUpdatedEventName, D as approvePendingWrite, en as assistantTranslationKey, Pr as assistantUrlTransform, wr as availableAttachmentSources, Ee as base64ToBytes, ge as browserSpeechEngine, O as buildAssistantSandboxEnv, Jn as buildAttachmentPromptBlock, ht as buildContinuedFromVoiceNote, Z as buildProgress, Yn as buildPromptParts, k as buildPromptRequestBody, Xn as buildPromptWithAttachments, De as buildRequest, a as buildSandboxContextInput, gt as buildVoiceTranscriptMarkdown, le as chatTurns, A as checkAssistantAiCredits, Ct as chunkForSpeech, Zn as classifyAttachment, Oe as classifyHttpFailure, t as classifyQuotaError, bn as columnLetterToIndex, Pe as configureSpeechEngine, wt as containsCjk, yr as copyToClipboard, Qn as countInlineImageCandidates, $n as countInlinedImageParts, j as createAssistantSandbox, M as createAssistantSession, Me as createHostedTtsEngine, Dr as createReadinessTracker, Ne as createRoutingSpeechEngine, se as createSandboxAssistantTransport, Fe as createSpeechEngines, ke as decodeAudioResponse, xn as decodeXmlEntities, n as describeQuotaError, er as detectDocumentFormat, on as detectScriptLocale, Tr as deviceHasCamera, bi as dispatchAssistantQuotaExhausted, Sn as docxXmlToText, N as downloadAssistantArtifact, oi as downloadFile, tr as estimateTurnBodyBytes, o as executeSandboxGraphQL, si as exportConversation, P as extendAssistantSandboxTTL, Ci as extractDocumentText, Vt as findAssistantLanguage, F as findExistingSandbox, Gt as findPendingWrite, Cn as fitPdfPages, nr as formatBytes, wn as formatPageRanges, br as getActorId, I as getAssistantArtifacts, Q as getAssistantMedia, L as getAssistantMessages, R as getAssistantSession, z as getAssistantStreamAccess, $ as getAssistantText, rr as getAttachmentSendBlocker, S as getCapability, ir as getExtension, _ as getImageForMode, v as getImageTagForMode, xr as getOrganizationId, ee as getRawMessageCreatedAt, y as getResourcesForMode, b as getSandboxImageRegistry, ar as getSendableAttachments, Ie as getSpeechEngine, te as getToolProgress, Sr as getWorkspaceId, ue as groupBySession, de as groupConsecutiveBySession, or as hasAttachmentWorkInFlight, ye as hostedLocaleFor, be as hostedSupportsLanguage, jr as imageHostLabel, Xe as isCapturing, Ze as isEcho, Tn as isMostlyImagePages, _i as isMultimodalBodyRejection, Ei as isProdRuntime, r as isQuotaExhaustedError, ne as isReapedSandboxConnectionError, Or as isRecentlyVerified, re as isRecoverable, vi as isRecoverableAssistantError, Mr as isRemoteImageSrc, ln as isSpeakingMessage, at as isSpeechBlocked, Qe as isSubmittable, fr as isTurnInFlight, C as isUnknownFieldError, fe as isVoiceTurn, En as joinSheets, ot as languageDisplayName, ie as mapSessionToHistory, w as markSupported, T as markUnsupported, ae as mergeMessagesById, ze as micIsInterrupt, B as modeRequiresConfirmWrites, qr as nextModeIndex, st as normalizeLangTag, xi as notifyAiCreditsUpdated, $e as orbMode, Dn as pageMarker, Kt as parseConfirmationRefusal, sr as parseDataUrl, On as parseSharedStrings, hr as parseToolActivity, kn as parseWorkbookSheets, An as pdfTextItemsToPage, et as planReplyConsumption, pr as planTurnAbort, Lt as pollDelayMs, ct as primaryLanguageSubtag, i as quotaExhaustedEventName, Le as readSpeechEngineConfig, V as releaseSupersededAssistantSandboxes, Ut as replyFollowsInput, H as reportAssistantAiTokenUsage, un as requiresCancel, Re as resetSpeechEngine, Ht as resolveAssistantLanguage, Wt as resolveLanguagePair, Jt as resolveModeConfig, x as resolveSandboxAssistantMode, sn as resolveSpeechLocale, oe as sanitize, U as selectExistingAssistantSandbox, W as selectSupersededAssistantSandboxes, lt as selectVoiceForLocale, G as sendAssistantPromptAsync, K as sendHeartbeat, jn as sheetXmlToRows, Ae as shouldDisableEngine, jt as showPreviousChunk, Be as showsAssistantCaption, Ve as showsUserCaption, Tt as speakableEmail, ut as speechGate, an as speechLabelsFor, dt as speechLangForLocale, dn as speechPlaybackReducer, je as splitForVendor, Et as splitTableRow, tt as spokenSoFar, q as stopReapedAssistantSandbox, Mn as summarisePageText, Rt as toCaptionText, cr as toMessageAttachment, Dt as toSpeakableText, lr as truncateForInline, Nn as truncatePagesForInline, hi as useAssistantApiAccess, wi as useAssistantAttachments, Di as useAssistantHeartbeat, tn as useAssistantI18nNamespace, Oi as useAssistantKeyboardShortcuts, Yt as useAssistantPageLabel, Xt as useAssistantProduct, Zt as useAssistantProductOrNull, _r as useAssistantSpeech, Qt as useAssistantStorageFolders, dr as useAssistantStore, nn as useAssistantTr, gi as useConversationTurns, ce as useSandboxAssistantTransport, e as useVoiceInput, vr as useVoiceSession, Si as useWorkspaceWriteAccess, ur as validateFile, ft as voiceAvailability, pe as voiceMarker, kt as voicePreviewText, pt as voiceQualityRank, me as voiceSessionIdOf, nt as voiceSessionReducer, He as voiceStageState, _t as voiceTranscriptFilename, he as voiceTurnsOnly, mt as voicesForLocale, J as waitForAssistantServiceReady, Y as waitForSandboxRunning, Ue as waveformIsActive, We as waveformIsSettled };
|