@burdenoff/fe-libs 2026.912.3 → 2026.912.5
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/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/preview/entity/AssistantEntityPreview.d.ts.map +1 -1
- package/dist/shared/assistant/preview/entity/AssistantEntityPreview.js +1 -1
- package/dist/shared/assistant/streamBudget.d.ts +57 -0
- package/dist/shared/assistant/streamBudget.d.ts.map +1 -0
- package/dist/shared/assistant/streamBudget.js +30 -0
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +95 -100
- package/dist/shared-assistant.js +93 -92
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ export * from './createSandboxAssistantTransport';
|
|
|
34
34
|
export * from './runtime';
|
|
35
35
|
export * from './gatewayClient';
|
|
36
36
|
export * from './progress';
|
|
37
|
+
export * from './streamBudget';
|
|
37
38
|
export * from './api';
|
|
38
39
|
export * from './types';
|
|
39
40
|
export * from './voice/turnVisibility';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAGxB,cAAc,wBAAwB,CAAC;AAKvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B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BAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AAGzC,cAAc,WAAW,CAAC;AAE1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AAErC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAElC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAE1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantEntityPreview.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/preview/entity/AssistantEntityPreview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAQL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,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AAC;QAC7D;;;;;;WAMG;QACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"AssistantEntityPreview.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/preview/entity/AssistantEntityPreview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAQL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IACzC,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAC/B;;;;;;;WAOG;QACH,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC;QAC7D;;;;;;WAMG;QACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAmaD,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAqKlE,CAAC"}
|
|
@@ -22,7 +22,7 @@ var g = {
|
|
|
22
22
|
style: { color: "var(--color-text-primary)" },
|
|
23
23
|
children: e
|
|
24
24
|
}), t == null ? null : /* @__PURE__ */ m("span", {
|
|
25
|
-
className: "
|
|
25
|
+
className: "min-w-0 truncate text-xs",
|
|
26
26
|
style: { color: "var(--color-text-muted)" },
|
|
27
27
|
"data-testid": "assistant-entity-preview-meta",
|
|
28
28
|
children: t
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AssistantMode } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* How long the client streams progress before it stops polling a turn.
|
|
4
|
+
*
|
|
5
|
+
* Chat replies (general / api-calls) finish in seconds; a vibe-plugins build is
|
|
6
|
+
* a multi-step pipeline (read docs → scaffold → bun install → bun build →
|
|
7
|
+
* checklist) that runs for minutes, so it gets a much larger budget. The sandbox
|
|
8
|
+
* TTL is auto-extended every 30s during the poll loop, so a longer budget never
|
|
9
|
+
* outlives the sandbox.
|
|
10
|
+
*
|
|
11
|
+
* ★★ THE BUDGET ELAPSING IS NOT AN ERROR. It used to be, for every mode except
|
|
12
|
+
* vibe-plugins: the poll loop `throw`ew, the catch wrote
|
|
13
|
+
* `Sorry, an error occurred: …` into the assistant message, and that error was
|
|
14
|
+
* PERSISTED — it survived a reload, so the turn was destroyed rather than
|
|
15
|
+
* merely unfinished. Measured in production on 2026-09-12 with a 10.8 KB
|
|
16
|
+
* markdown attachment: the turn produced no content for 206s, the client gave
|
|
17
|
+
* up at ~3 minutes, and re-opening the conversation showed only the error.
|
|
18
|
+
*
|
|
19
|
+
* A client-side deadline is a statement about how long THIS CLIENT will wait.
|
|
20
|
+
* It is not evidence that the turn failed, and it must never be allowed to
|
|
21
|
+
* overwrite the conversation. So the budget elapsing now yields a normal
|
|
22
|
+
* assistant message: whatever content arrived, plus an honest closing note.
|
|
23
|
+
*/
|
|
24
|
+
export declare const STREAM_BUDGET_MS: Record<AssistantMode, number>;
|
|
25
|
+
export declare const DEFAULT_STREAM_BUDGET_MS = 180000;
|
|
26
|
+
/**
|
|
27
|
+
* Budget for `mode`, falling back to the default for a mode added later.
|
|
28
|
+
*
|
|
29
|
+
* Exported as a function rather than leaving callers to index the record, so a
|
|
30
|
+
* new mode cannot silently get `undefined` and a `NaN` deadline.
|
|
31
|
+
*/
|
|
32
|
+
export declare function streamBudgetMs(mode: AssistantMode): number;
|
|
33
|
+
/** i18n key + English fallback for the note closing an unfinished turn. */
|
|
34
|
+
export interface IncompleteTurnNotice {
|
|
35
|
+
key: string;
|
|
36
|
+
fallback: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ★ NO PLACEHOLDERS IN EITHER FALLBACK, deliberately.
|
|
40
|
+
*
|
|
41
|
+
* `t()` did not interpolate single-brace placeholders until fe-libs 2026.910.7,
|
|
42
|
+
* and 37 app shells still pin older builds, so a `{minutes}` here would render
|
|
43
|
+
* raw braces to real users on most of the fleet. The elapsed budget is not worth
|
|
44
|
+
* that risk, and a reader does not need the number to know what to do next.
|
|
45
|
+
*/
|
|
46
|
+
export declare function incompleteTurnNotice(mode: AssistantMode): IncompleteTurnNotice;
|
|
47
|
+
/**
|
|
48
|
+
* Close an unfinished turn: keep every character the turn did produce, then
|
|
49
|
+
* append the note for `mode`.
|
|
50
|
+
*
|
|
51
|
+
* Total function — it never throws, and never returns an empty string for a
|
|
52
|
+
* turn that produced nothing, because an empty assistant bubble reads as a
|
|
53
|
+
* silent failure. `translate` is injected rather than taken from a hook so this
|
|
54
|
+
* is testable without a React tree or an i18n provider.
|
|
55
|
+
*/
|
|
56
|
+
export declare function withIncompleteTurnNotice(content: string, mode: AssistantMode, translate: (key: string, fallback: string) => string): string;
|
|
57
|
+
//# sourceMappingURL=streamBudget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamBudget.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/streamBudget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAK1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAE1D;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAClB,oBAAoB,CAsBtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GACnD,MAAM,CAWR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/shared/assistant/streamBudget.ts
|
|
2
|
+
var e = {
|
|
3
|
+
general: 18e4,
|
|
4
|
+
assistant: 18e4,
|
|
5
|
+
"api-calls": 18e4,
|
|
6
|
+
"vibe-plugins": 6e5
|
|
7
|
+
}, t = 18e4;
|
|
8
|
+
function n(t) {
|
|
9
|
+
return e[t] ?? 18e4;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
return e === "vibe-plugins" ? {
|
|
13
|
+
key: "assistant.turnStillBuilding",
|
|
14
|
+
fallback: "_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._"
|
|
15
|
+
} : {
|
|
16
|
+
key: "assistant.turnIncomplete",
|
|
17
|
+
fallback: "_This turn stopped before an answer arrived. Your message and any attachment are still here — send it again, or try a shorter document or a narrower question._"
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function i(e, t, n) {
|
|
21
|
+
let i = r(t), a;
|
|
22
|
+
try {
|
|
23
|
+
a = n(i.key, i.fallback) || i.fallback;
|
|
24
|
+
} catch {
|
|
25
|
+
a = i.fallback;
|
|
26
|
+
}
|
|
27
|
+
return e.trim() ? `${e}\n\n${a}` : a;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as DEFAULT_STREAM_BUDGET_MS, e as STREAM_BUDGET_MS, r as incompleteTurnNotice, n as streamBudgetMs, i as withIncompleteTurnNotice };
|
|
@@ -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;AAoKvE;;;;;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,CAs9DxD,CAAC"}
|
|
@@ -6,44 +6,40 @@ import { useAssistantTr as r } from "../i18n.js";
|
|
|
6
6
|
import { describeQuotaError as i } from "../quota.js";
|
|
7
7
|
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as c, extendAssistantSandboxTTL as l, findExistingSandbox as u, getAssistantArtifacts as ee, getAssistantMessages as te, getAssistantSession as d, releaseSupersededAssistantSandboxes as f, sendAssistantPromptAsync as ne, waitForAssistantServiceReady as p, waitForSandboxRunning as m } from "../api.js";
|
|
8
8
|
import { getAssistantMedia as h, sanitize as re } from "../progress.js";
|
|
9
|
+
import { streamBudgetMs as ie, withIncompleteTurnNotice as ae } from "../streamBudget.js";
|
|
9
10
|
import { isVoiceTurn as g, voiceMarker as _, voiceSessionIdOf as v } from "../voice/turnVisibility.js";
|
|
10
|
-
import { buildContinuedFromVoiceNote as
|
|
11
|
-
import { pollDelayMs as
|
|
12
|
-
import { toCaptionText as
|
|
13
|
-
import { resolveAssistantLanguage as
|
|
14
|
-
import { resolveLanguagePair as
|
|
11
|
+
import { buildContinuedFromVoiceNote as oe, buildVoiceTranscriptMarkdown as y, voiceTranscriptFilename as se } from "../voice/voiceTranscript.js";
|
|
12
|
+
import { pollDelayMs as ce } from "../voice/assistantPollSchedule.js";
|
|
13
|
+
import { toCaptionText as le } from "../voice/captionText.js";
|
|
14
|
+
import { resolveAssistantLanguage as ue } from "../voice/languages.js";
|
|
15
|
+
import { resolveLanguagePair as de } from "../voice/languagePair.js";
|
|
15
16
|
import { findPendingWrite as b } from "../pendingWrite.js";
|
|
16
|
-
import { buildPromptParts as
|
|
17
|
+
import { buildPromptParts as fe, buildPromptWithAttachments as pe, countInlineImageCandidates as me, countInlinedImageParts as he, getSendableAttachments as ge, toMessageAttachment as _e } from "../attachments.js";
|
|
17
18
|
import { useAssistantStore as x } from "../store.js";
|
|
18
|
-
import { isTurnInFlight as
|
|
19
|
-
import { STAGE_COPY as S, isStageCopy as
|
|
20
|
-
import { parseToolActivity as
|
|
21
|
-
import { useVoiceSession as
|
|
22
|
-
import { getOrganizationId as
|
|
23
|
-
import { createReadinessTracker as
|
|
24
|
-
import { AssistantSpokenTurnsNotice as
|
|
25
|
-
import { VoiceTranscriptDrawer as
|
|
26
|
-
import { downloadFile as
|
|
27
|
-
import { AssistantEmptyState as
|
|
28
|
-
import { AssistantMessageList as
|
|
29
|
-
import { AssistantVoiceSession as
|
|
30
|
-
import { useAssistantApiAccess as
|
|
31
|
-
import { useConversationTurns as
|
|
32
|
-
import { isMultimodalBodyRejection as
|
|
33
|
-
import { dispatchAssistantQuotaExhausted as
|
|
34
|
-
import { useAssistantAttachments as
|
|
35
|
-
import { AssistantComposer as
|
|
36
|
-
import { isProdRuntime as
|
|
37
|
-
import { AssistantApiCallsConsentDialog as
|
|
38
|
-
import { useCallback as w, useEffect as T, useMemo as E, useRef as D, useState as
|
|
39
|
-
import { jsx as O, jsxs as
|
|
19
|
+
import { isTurnInFlight as ve, planAbandonedTurn as ye, planTurnAbort as be } from "../turnState.js";
|
|
20
|
+
import { STAGE_COPY as S, isStageCopy as xe, stageText as C, statusStageCopy as Se, thinkingPhrase as Ce } from "../stageCopy.js";
|
|
21
|
+
import { parseToolActivity as we } from "./AssistantToolActivity.js";
|
|
22
|
+
import { useVoiceSession as Te } from "./useVoiceSession.js";
|
|
23
|
+
import { getOrganizationId as Ee, getWorkspaceId as De } from "../context.js";
|
|
24
|
+
import { createReadinessTracker as Oe } from "../sandboxReadiness.js";
|
|
25
|
+
import { AssistantSpokenTurnsNotice as ke } from "./AssistantSpokenTurnsNotice.js";
|
|
26
|
+
import { VoiceTranscriptDrawer as Ae } from "./voice/VoiceTranscriptDrawer.js";
|
|
27
|
+
import { downloadFile as je } from "../exportConversation.js";
|
|
28
|
+
import { AssistantEmptyState as Me } from "./AssistantEmptyState.js";
|
|
29
|
+
import { AssistantMessageList as Ne } from "./AssistantMessageList.js";
|
|
30
|
+
import { AssistantVoiceSession as Pe } from "./voice/AssistantVoiceSession.js";
|
|
31
|
+
import { useAssistantApiAccess as Fe } from "../useAssistantApiAccess.js";
|
|
32
|
+
import { useConversationTurns as Ie } from "../useConversationTurns.js";
|
|
33
|
+
import { isMultimodalBodyRejection as Le, isRecoverableAssistantError as Re } from "../transportErrors.js";
|
|
34
|
+
import { dispatchAssistantQuotaExhausted as ze, notifyAiCreditsUpdated as Be } from "../aiCredits.js";
|
|
35
|
+
import { useAssistantAttachments as Ve } from "../useAssistantAttachments.js";
|
|
36
|
+
import { AssistantComposer as He } from "./composer/AssistantComposer.js";
|
|
37
|
+
import { isProdRuntime as Ue } from "../env.js";
|
|
38
|
+
import { AssistantApiCallsConsentDialog as We } from "./AssistantApiCallsConsentDialog.js";
|
|
39
|
+
import { useCallback as w, useEffect as T, useMemo as E, useRef as D, useState as Ge } from "react";
|
|
40
|
+
import { jsx as O, jsxs as Ke } from "react/jsx-runtime";
|
|
40
41
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
41
|
-
var
|
|
42
|
-
general: 18e4,
|
|
43
|
-
assistant: 18e4,
|
|
44
|
-
"api-calls": 18e4,
|
|
45
|
-
"vibe-plugins": 6e5
|
|
46
|
-
}, Ke = 18e4, qe = 600, Je = 2e4;
|
|
42
|
+
var qe = 600, Je = 2e4;
|
|
47
43
|
function Ye() {
|
|
48
44
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
49
45
|
}
|
|
@@ -80,11 +76,11 @@ function Ze(e, t) {
|
|
|
80
76
|
};
|
|
81
77
|
}
|
|
82
78
|
var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
83
|
-
let k = r(), { product: A, modes: j, gatherPageContext: Qe, buildPrompt: $e, reportTokenUsage: et } = n(), { getAccessToken: M, getWorkspaceToken: N, userId: P } = t(), { locale: tt } = e(), nt = x((e) => e.assistantLanguage), rt = x((e) => e.replyLanguage), it = E(() =>
|
|
79
|
+
let k = r(), { product: A, modes: j, gatherPageContext: Qe, buildPrompt: $e, reportTokenUsage: et } = n(), { getAccessToken: M, getWorkspaceToken: N, userId: P } = t(), { locale: tt } = e(), nt = x((e) => e.assistantLanguage), rt = x((e) => e.replyLanguage), it = E(() => de(nt, rt, tt), [
|
|
84
80
|
nt,
|
|
85
81
|
rt,
|
|
86
82
|
tt
|
|
87
|
-
]), at = it.reply.english, ot = it.replyIsExplicit, st = it.reply.code, { conversations: ct, activeConversationId: F, mode: I, processingByConversationId: lt, setMode: ut, setConversationMode: dt, setActiveConversation: ft, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, mergeMessageMetadata: pt, setConversationProcessing: V, clearConversationProcessing: mt, setBackendSessionId: ht, clearBackendSessionId: gt, setSandbox: H, clearSandbox: _t, acknowledgeApiCalls: vt } = x(), yt = ct.find((e) => e.id === F), U =
|
|
83
|
+
]), at = it.reply.english, ot = it.replyIsExplicit, st = it.reply.code, { conversations: ct, activeConversationId: F, mode: I, processingByConversationId: lt, setMode: ut, setConversationMode: dt, setActiveConversation: ft, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, mergeMessageMetadata: pt, setConversationProcessing: V, clearConversationProcessing: mt, setBackendSessionId: ht, clearBackendSessionId: gt, setSandbox: H, clearSandbox: _t, acknowledgeApiCalls: vt } = x(), yt = ct.find((e) => e.id === F), U = Ie(yt), bt = U.all, xt = F ? lt[F] : void 0, St = ve(xt?.status), Ct = St ? xt?.messageId ?? null : null, wt = xt?.status === "error" ? xt.messageId : null, { canUseApiCalls: Tt, loading: Et } = Fe(Ee()), Dt = E(() => j.filter((e) => !e.requiresAdmin || Tt), [j, Tt]), [Ot, kt] = Ge(null), [At, jt] = Ge(!1), Mt = D({}), W = D(Oe()), Nt = D(/* @__PURE__ */ new Set()), Pt = E(() => j.find((e) => e.id === I), [j, I]);
|
|
88
84
|
T(() => {
|
|
89
85
|
Et || (!Pt || Pt.requiresAdmin && !Tt) && I !== "assistant" && ut("assistant");
|
|
90
86
|
}, [
|
|
@@ -95,28 +91,28 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
95
91
|
ut
|
|
96
92
|
]);
|
|
97
93
|
let G = w((e, t, n, r) => {
|
|
98
|
-
V(e, n, t, null), r ? z(e, t, r) : z(e, t,
|
|
94
|
+
V(e, n, t, null), r ? z(e, t, r) : z(e, t, Se(k, n));
|
|
99
95
|
}, [
|
|
100
96
|
V,
|
|
101
97
|
z,
|
|
102
98
|
k
|
|
103
99
|
]), Ft = w(async (e, t, n, r, i) => {
|
|
104
100
|
let a = x.getState().sandboxesByMode[n]?.sandboxId ?? null, o = async (e) => {
|
|
105
|
-
if (
|
|
101
|
+
if (W.current.isFresh(e)) return !0;
|
|
106
102
|
try {
|
|
107
|
-
return await m(e, r, i, 3e5), await p(e, r, i, 9e4),
|
|
103
|
+
return await m(e, r, i, 3e5), await p(e, r, i, 9e4), W.current.markVerified(e), !0;
|
|
108
104
|
} catch {
|
|
109
|
-
return
|
|
105
|
+
return W.current.invalidate(e), !1;
|
|
110
106
|
}
|
|
111
107
|
};
|
|
112
108
|
if (a && (H(n, a, "provisioning"), G(e, t, "provisioning", C(k, S.reusingEnvironment)), await o(a) || (H(n, null, "provisioning"), a = null)), !a) {
|
|
113
109
|
G(e, t, "provisioning", C(k, S.lookingForEnvironment));
|
|
114
|
-
let s = await u(r, A, n,
|
|
110
|
+
let s = await u(r, A, n, Ue(), i);
|
|
115
111
|
s && (H(n, s, "provisioning"), G(e, t, "provisioning", C(k, S.reusingEnvironment)), await o(s) ? a = s : H(n, null, "provisioning"));
|
|
116
112
|
}
|
|
117
113
|
if (!a) {
|
|
118
114
|
if (n === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
119
|
-
G(e, t, "provisioning", C(k, S.startingEnvironment)), H(n, null, "provisioning"), await f(r, A, n,
|
|
115
|
+
G(e, t, "provisioning", C(k, S.startingEnvironment)), H(n, null, "provisioning"), await f(r, A, n, Ue(), i), a = await s(A, n, r, Ue(), qe, i), H(n, a, "provisioning"), await m(a, r, i, 3e5), await p(a, r, i, 9e4);
|
|
120
116
|
}
|
|
121
117
|
H(n, a, "running");
|
|
122
118
|
let l = x.getState().conversations.find((t) => t.id === e)?.backendSessionId ?? null;
|
|
@@ -138,29 +134,29 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
138
134
|
H,
|
|
139
135
|
k,
|
|
140
136
|
G
|
|
141
|
-
]), [It, Lt] =
|
|
137
|
+
]), [It, Lt] = Ge(null), K = D(/* @__PURE__ */ new Set()), Rt = D(null), zt = w(() => {
|
|
142
138
|
let e = x.getState(), t = e.activeConversationId;
|
|
143
139
|
if (!t) return;
|
|
144
|
-
let n = e.processingByConversationId[t], r =
|
|
145
|
-
if (!
|
|
140
|
+
let n = e.processingByConversationId[t], r = ve(n?.status) ? n?.messageId ?? null : null;
|
|
141
|
+
if (!be({
|
|
146
142
|
interruptedTurnId: r,
|
|
147
143
|
activeTurnId: r,
|
|
148
144
|
alreadyRequested: r ? K.current.has(r) : !1
|
|
149
145
|
}).send || !r) return;
|
|
150
146
|
K.current.add(r);
|
|
151
|
-
let i = e.sandboxesByMode[e.mode]?.sandboxId, o =
|
|
147
|
+
let i = e.sandboxesByMode[e.mode]?.sandboxId, o = De(), s = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
152
148
|
!i || !o || !s || a(i, o, s, {
|
|
153
149
|
accessToken: M(),
|
|
154
150
|
workspaceToken: N(),
|
|
155
151
|
userId: P,
|
|
156
|
-
organizationId:
|
|
152
|
+
organizationId: Ee()
|
|
157
153
|
});
|
|
158
154
|
}, [
|
|
159
155
|
P,
|
|
160
156
|
M,
|
|
161
157
|
N
|
|
162
158
|
]), Bt = w(async (e) => {
|
|
163
|
-
let t = x.getState(), n = t.sandboxesByMode[t.mode]?.sandboxId, r =
|
|
159
|
+
let t = x.getState(), n = t.sandboxesByMode[t.mode]?.sandboxId, r = De(), i = t.activeConversationId;
|
|
164
160
|
if (!(!n || !r || !i)) {
|
|
165
161
|
Lt(e);
|
|
166
162
|
try {
|
|
@@ -168,7 +164,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
168
164
|
accessToken: M(),
|
|
169
165
|
workspaceToken: N(),
|
|
170
166
|
userId: P,
|
|
171
|
-
organizationId:
|
|
167
|
+
organizationId: Ee()
|
|
172
168
|
});
|
|
173
169
|
} catch (e) {
|
|
174
170
|
Lt(null), R(i, {
|
|
@@ -188,7 +184,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
188
184
|
]), q = w(async (e, t = [], n = {}) => {
|
|
189
185
|
let r = n.voiceSessionId !== void 0, a = x.getState(), o = a.activeConversationId ?? F;
|
|
190
186
|
if (o) {
|
|
191
|
-
if (
|
|
187
|
+
if (ve(a.processingByConversationId[o]?.status)) {
|
|
192
188
|
let r = a.processingByConversationId[o]?.messageId ?? null;
|
|
193
189
|
r && K.current.has(r) && (Rt.current = {
|
|
194
190
|
conversationId: o,
|
|
@@ -202,19 +198,19 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
202
198
|
}
|
|
203
199
|
let s = a.mode, c = F, u = c ? x.getState().conversations.find((e) => e.id === c) : void 0;
|
|
204
200
|
if (c ? u && u.mode !== s && (u.messages.length > 0 || u.backendSessionId) ? c = L(void 0, s) : u && u.mode !== s && dt(c, s) : c = L(void 0, s), !c) return;
|
|
205
|
-
|
|
206
|
-
let d =
|
|
201
|
+
Mt.current[c] = t;
|
|
202
|
+
let d = De(), f = {
|
|
207
203
|
accessToken: M(),
|
|
208
204
|
workspaceToken: N(),
|
|
209
205
|
userId: P,
|
|
210
|
-
organizationId:
|
|
206
|
+
organizationId: Ee()
|
|
211
207
|
}, p = {
|
|
212
208
|
id: Ye(),
|
|
213
209
|
role: "user",
|
|
214
210
|
content: e,
|
|
215
211
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
216
212
|
metadata: {
|
|
217
|
-
...t.length ? { attachments: t.map(
|
|
213
|
+
...t.length ? { attachments: t.map(_e) } : {},
|
|
218
214
|
..._(n.voiceSessionId)
|
|
219
215
|
}
|
|
220
216
|
};
|
|
@@ -244,24 +240,24 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
244
240
|
try {
|
|
245
241
|
let { sandboxId: n, sessionId: a } = await Ft(c, m, s, d, f), o = (await te(n, d, a, f, { limit: 50 }).catch(() => [])).reduce((e, t) => Math.max(e, Xe(t)), 0);
|
|
246
242
|
G(c, m, "streaming", C(k, S.thinking));
|
|
247
|
-
let u =
|
|
248
|
-
i =
|
|
243
|
+
let u = pe(e, t), p = $e?.(s, u, at, ot, r) ?? u, g = fe(p, t), _ = he(g), v = _ > 0, oe = Qe?.();
|
|
244
|
+
i = me(t) > _;
|
|
249
245
|
try {
|
|
250
|
-
await ne(n, d, a, p, s,
|
|
246
|
+
await ne(n, d, a, p, s, oe, f, g?.length ? { parts: g } : void 0);
|
|
251
247
|
} catch (e) {
|
|
252
|
-
if (!g || !
|
|
253
|
-
await ne(n, d, a, p, s,
|
|
248
|
+
if (!g || !Le(e)) throw e;
|
|
249
|
+
await ne(n, d, a, p, s, oe, f, void 0), i ||= v;
|
|
254
250
|
}
|
|
255
|
-
let y = Ze([], o),
|
|
251
|
+
let y = Ze([], o), se = Date.now() + ie(s), le = Date.now(), ue = Date.now(), de = () => ye({
|
|
256
252
|
turnId: m,
|
|
257
253
|
abortRequested: K.current.has(m),
|
|
258
254
|
activeTurnId: x.getState().processingByConversationId[c]?.messageId ?? null
|
|
259
255
|
}), b = () => {
|
|
260
256
|
let e = x.getState().conversations.find((e) => e.id === c)?.messages.find((e) => e.id === m)?.content;
|
|
261
|
-
|
|
257
|
+
xe(k, e) && z(c, m, C(k, S.stopped));
|
|
262
258
|
};
|
|
263
|
-
for (; Date.now() <
|
|
264
|
-
let e =
|
|
259
|
+
for (; Date.now() < se;) {
|
|
260
|
+
let e = de();
|
|
265
261
|
if (e.abandon) {
|
|
266
262
|
b(), e.clearProcessing && mt(c);
|
|
267
263
|
return;
|
|
@@ -269,18 +265,17 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
269
265
|
if (y = Ze(await te(n, d, a, f, {
|
|
270
266
|
limit: 50,
|
|
271
267
|
sinceMs: o
|
|
272
|
-
}), o), B(c, m, { content:
|
|
273
|
-
Date.now() -
|
|
268
|
+
}), o), B(c, m, { content: xe(k, y.content) ? Ce(k, Date.now() - ue) : re(y.content) }), y.pendingWrite && pt(c, m, { pendingWrite: y.pendingWrite }), y.done) break;
|
|
269
|
+
Date.now() - le > 3e4 && (await l(n, d, 600, f).catch(() => void 0), le = Date.now()), await new Promise((e) => setTimeout(e, ce(Date.now() - ue)));
|
|
274
270
|
}
|
|
275
|
-
|
|
276
|
-
let me = s === "vibe-plugins" ? await ee(n, d, a, f).then((e) => e).catch(() => []) : void 0;
|
|
271
|
+
let ge = s === "vibe-plugins" ? await ee(n, d, a, f).then((e) => e).catch(() => []) : void 0;
|
|
277
272
|
if (y.done || (y = {
|
|
278
273
|
...y,
|
|
279
|
-
content:
|
|
274
|
+
content: ae(y.content, s, k)
|
|
280
275
|
}), i && (y = {
|
|
281
276
|
...y,
|
|
282
277
|
content: `${y.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._")}`
|
|
283
|
-
}), h(y.content,
|
|
278
|
+
}), h(y.content, ge, a, n), y.tokens) {
|
|
284
279
|
B(c, m, { tokens: y.tokens });
|
|
285
280
|
try {
|
|
286
281
|
await et?.({
|
|
@@ -289,17 +284,17 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
289
284
|
messageId: y.messageId,
|
|
290
285
|
model: y.model,
|
|
291
286
|
tokens: y.tokens
|
|
292
|
-
}),
|
|
287
|
+
}), Be(A);
|
|
293
288
|
} catch {}
|
|
294
289
|
}
|
|
295
|
-
let
|
|
296
|
-
if (
|
|
297
|
-
b(),
|
|
290
|
+
let _e = de();
|
|
291
|
+
if (_e.abandon) {
|
|
292
|
+
b(), _e.clearProcessing && mt(c);
|
|
298
293
|
return;
|
|
299
294
|
}
|
|
300
295
|
V(c, "complete", m, null);
|
|
301
296
|
} catch (e) {
|
|
302
|
-
if (n === 1 &&
|
|
297
|
+
if (n === 1 && Re(e)) return gt(c), _t(s), g(2);
|
|
303
298
|
throw e;
|
|
304
299
|
}
|
|
305
300
|
}, v = c;
|
|
@@ -308,10 +303,10 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
308
303
|
if (!d) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
309
304
|
await g();
|
|
310
305
|
} catch (e) {
|
|
311
|
-
|
|
306
|
+
W.current.invalidate(x.getState().sandboxesByMode[s]?.sandboxId ?? null);
|
|
312
307
|
let t = i(e);
|
|
313
308
|
if (t) {
|
|
314
|
-
t.refusal === "exhausted" &&
|
|
309
|
+
t.refusal === "exhausted" && ze(A, "sandbox");
|
|
315
310
|
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.";
|
|
316
311
|
h(e ? `${n}\n\n${e}` : n, void 0, void 0, void 0, "en"), V(c, "error", m, null);
|
|
317
312
|
return;
|
|
@@ -355,7 +350,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
355
350
|
]), Vt = w((e) => {
|
|
356
351
|
q(e);
|
|
357
352
|
}, [q]), Ht = w(() => {
|
|
358
|
-
let e = [...U.chat].reverse().find((e) => e.role === "user"), t = F ?
|
|
353
|
+
let e = [...U.chat].reverse().find((e) => e.role === "user"), t = F ? Mt.current[F] ?? [] : [];
|
|
359
354
|
e && q(e.content, t);
|
|
360
355
|
}, [
|
|
361
356
|
bt,
|
|
@@ -370,40 +365,40 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
370
365
|
for (let e = bt.length - 1; e >= 0; --e) {
|
|
371
366
|
let t = bt[e];
|
|
372
367
|
if (t?.role !== "assistant" || !g(t) || K.current.has(t.id)) continue;
|
|
373
|
-
let n =
|
|
368
|
+
let n = we(t.content).text.trim();
|
|
374
369
|
return n ? {
|
|
375
370
|
id: t.id,
|
|
376
371
|
text: n
|
|
377
372
|
} : null;
|
|
378
373
|
}
|
|
379
374
|
return null;
|
|
380
|
-
}, [bt, St]), Ut = E(() => Y ?
|
|
375
|
+
}, [bt, St]), Ut = E(() => Y ? le(Y.text) : null, [Y]), Wt = U.chat, X = E(() => U.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
381
376
|
id: e.id,
|
|
382
377
|
role: e.role,
|
|
383
|
-
text:
|
|
378
|
+
text: we(e.content).text.trim(),
|
|
384
379
|
sessionId: v(e),
|
|
385
380
|
timestamp: e.timestamp
|
|
386
381
|
})).filter((e) => e.text.length > 0), [U.voice]), Gt = w(() => {
|
|
387
382
|
if (X.length === 0) return;
|
|
388
383
|
let e = /* @__PURE__ */ new Date();
|
|
389
|
-
|
|
384
|
+
je(y(X, {
|
|
390
385
|
title: k("voiceSession.transcript", "Voice conversation"),
|
|
391
386
|
savedAt: k("voiceSession.savedAt", "Saved"),
|
|
392
387
|
session: k("voiceSession.sessionLabel", "Session"),
|
|
393
388
|
earlier: k("voiceSession.earlierLabel", "Earlier"),
|
|
394
389
|
you: k("voiceSession.speakerYou", "You"),
|
|
395
390
|
assistant: k("voiceSession.speakerAssistant", "Assistant")
|
|
396
|
-
}, e),
|
|
391
|
+
}, e), se(A, e), "text/markdown");
|
|
397
392
|
}, [
|
|
398
393
|
A,
|
|
399
394
|
X,
|
|
400
395
|
k
|
|
401
|
-
]), Z =
|
|
396
|
+
]), Z = Ve(), Q = D(Z);
|
|
402
397
|
Q.current = Z;
|
|
403
|
-
let $ =
|
|
398
|
+
let $ = Te({
|
|
404
399
|
onSubmit: w((e, t) => {
|
|
405
400
|
let n = () => {
|
|
406
|
-
let n = Q.current, r =
|
|
401
|
+
let n = Q.current, r = ge(n.attachments);
|
|
407
402
|
J.current(e, r, { voiceSessionId: t }), n.clear();
|
|
408
403
|
};
|
|
409
404
|
if (!Q.current.isBusy) {
|
|
@@ -415,20 +410,20 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
415
410
|
}, 200);
|
|
416
411
|
}, []),
|
|
417
412
|
latestReply: Y,
|
|
418
|
-
language:
|
|
413
|
+
language: ue(nt, tt).tag
|
|
419
414
|
}), Kt = E(() => (yt?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [yt?.messages]), qt = X.length > Kt, Jt = w(() => {
|
|
420
415
|
let e = x.getState().activeConversationId;
|
|
421
416
|
!e || X.length === 0 || (R(e, {
|
|
422
417
|
id: Ye(),
|
|
423
418
|
role: "system",
|
|
424
|
-
content:
|
|
419
|
+
content: oe(X.slice(Kt), {
|
|
425
420
|
intro: k("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
426
421
|
nothing: k("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
427
422
|
more: (e) => k("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
428
423
|
}),
|
|
429
424
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
430
425
|
metadata: { continuedVoiceTurns: X.length }
|
|
431
|
-
}),
|
|
426
|
+
}), jt(!1), $.end());
|
|
432
427
|
}, [
|
|
433
428
|
X,
|
|
434
429
|
Kt,
|
|
@@ -441,7 +436,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
441
436
|
}, [$.active]);
|
|
442
437
|
let Xt = w(() => {
|
|
443
438
|
let e = X.length > Yt.current;
|
|
444
|
-
$.end(), e &&
|
|
439
|
+
$.end(), e && jt(!0);
|
|
445
440
|
}, [X, $]);
|
|
446
441
|
T(() => {
|
|
447
442
|
!h && $.active && $.end();
|
|
@@ -487,23 +482,23 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
487
482
|
]), en = w(() => {
|
|
488
483
|
kt(null);
|
|
489
484
|
}, []);
|
|
490
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ Ke("div", {
|
|
491
486
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
492
487
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ Ke("div", {
|
|
494
489
|
className: "contents",
|
|
495
490
|
inert: $.active || void 0,
|
|
496
491
|
children: [
|
|
497
|
-
X.length > 0 && !$.active ? /* @__PURE__ */ O(
|
|
492
|
+
X.length > 0 && !$.active ? /* @__PURE__ */ O(ke, {
|
|
498
493
|
count: X.length,
|
|
499
|
-
onOpenTranscript: () =>
|
|
494
|
+
onOpenTranscript: () => jt(!0)
|
|
500
495
|
}) : null,
|
|
501
|
-
Wt.length === 0 ? /* @__PURE__ */ O(
|
|
496
|
+
Wt.length === 0 ? /* @__PURE__ */ O(Me, {
|
|
502
497
|
mode: I,
|
|
503
498
|
onSuggestionClick: Vt
|
|
504
499
|
}) : /* @__PURE__ */ O("div", {
|
|
505
500
|
className: "flex min-h-0 flex-1 flex-col",
|
|
506
|
-
children: /* @__PURE__ */ O(
|
|
501
|
+
children: /* @__PURE__ */ O(Ne, {
|
|
507
502
|
onApprovePendingWrite: Bt,
|
|
508
503
|
approvingWriteRef: It,
|
|
509
504
|
messages: Wt,
|
|
@@ -512,7 +507,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
512
507
|
onRetry: Ht
|
|
513
508
|
})
|
|
514
509
|
}),
|
|
515
|
-
/* @__PURE__ */ O(
|
|
510
|
+
/* @__PURE__ */ O(He, {
|
|
516
511
|
onStartVoiceSession: $.available && I !== "api-calls" ? $.start : void 0,
|
|
517
512
|
onSend: (e, t) => void q(e, t),
|
|
518
513
|
disabled: St,
|
|
@@ -524,14 +519,14 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
524
519
|
})
|
|
525
520
|
]
|
|
526
521
|
}),
|
|
527
|
-
At && !$.active ? /* @__PURE__ */ O(
|
|
522
|
+
At && !$.active ? /* @__PURE__ */ O(Ae, {
|
|
528
523
|
turns: X,
|
|
529
|
-
onClose: () =>
|
|
524
|
+
onClose: () => jt(!1),
|
|
530
525
|
onSave: Gt,
|
|
531
526
|
onContinueInChat: qt ? Jt : void 0,
|
|
532
527
|
closeOnEscape: !0
|
|
533
528
|
}) : null,
|
|
534
|
-
$.active && /* @__PURE__ */ O(
|
|
529
|
+
$.active && /* @__PURE__ */ O(Pe, {
|
|
535
530
|
session: $.session,
|
|
536
531
|
notice: $.notice,
|
|
537
532
|
capturing: $.capturing,
|
|
@@ -554,7 +549,7 @@ var j = ({ visible: h = !0, writeAccess: b = "unknown" }) => {
|
|
|
554
549
|
onToggleMute: $.toggleMute,
|
|
555
550
|
onEnd: Xt
|
|
556
551
|
}),
|
|
557
|
-
/* @__PURE__ */ O(
|
|
552
|
+
/* @__PURE__ */ O(We, {
|
|
558
553
|
open: Ot !== null,
|
|
559
554
|
onConfirm: $t,
|
|
560
555
|
onCancel: en
|
package/dist/shared-assistant.js
CHANGED
|
@@ -14,95 +14,96 @@ import { AssistantRuntimeManager as _e } from "./shared/assistant/runtime.js";
|
|
|
14
14
|
import { buildProgress as ve, getAssistantMedia as ye, getAssistantText as be, getRawMessageCreatedAt as xe, getToolProgress as Se, isReapedSandboxConnectionError as Ce, isRecoverable as we, mapSessionToHistory as Te, mergeMessagesById as Ee, sanitize as De } from "./shared/assistant/progress.js";
|
|
15
15
|
import { createSandboxAssistantTransport as Oe } from "./shared/assistant/createSandboxAssistantTransport.js";
|
|
16
16
|
import { useSandboxAssistantTransport as ke } from "./shared/assistant/useSandboxAssistantTransport.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
|
|
17
|
+
import { DEFAULT_STREAM_BUDGET_MS as Ae, STREAM_BUDGET_MS as je, incompleteTurnNotice as Me, streamBudgetMs as Ne, withIncompleteTurnNotice as Pe } from "./shared/assistant/streamBudget.js";
|
|
18
|
+
import { chatTurns as Fe, groupBySession as Ie, groupConsecutiveBySession as Le, isVoiceTurn as Re, voiceMarker as ze, voiceSessionIdOf as Be, voiceTurnsOnly as Ve } from "./shared/assistant/voice/turnVisibility.js";
|
|
19
|
+
import { browserSpeechEngine as He } from "./shared/assistant/speech/browserSpeechEngine.js";
|
|
20
|
+
import { HOSTED_TTS_TIER as Ue, HOSTED_VOICES as We, hostedLocaleFor as Ge, hostedSupportsLanguage as Ke } from "./shared/assistant/speech/hostedVoiceCatalogue.js";
|
|
21
|
+
import { HOSTED_TTS_MAX_CHARS as qe, SPEAKING_RATE_MAX as Je, SPEAKING_RATE_MAX_STREAMING as Ye, SPEAKING_RATE_MAX_SYNC as Xe, SPEAKING_RATE_MIN as Ze, base64ToBytes as Qe, buildRequest as $e, classifyHttpFailure as et, decodeAudioResponse as tt, shouldDisableEngine as nt, splitForVendor as rt } from "./shared/assistant/speech/hostedTtsProtocol.js";
|
|
22
|
+
import { createHostedTtsEngine as it } from "./shared/assistant/speech/hostedTtsSpeechEngine.js";
|
|
23
|
+
import { createRoutingSpeechEngine as at } from "./shared/assistant/speech/routingSpeechEngine.js";
|
|
24
|
+
import { configureSpeechEngine as ot, createSpeechEngines as st, getSpeechEngine as ct, readSpeechEngineConfig as lt, resetSpeechEngine as ut } from "./shared/assistant/speech/createSpeechEngine.js";
|
|
25
|
+
import { micIsInterrupt as dt, showsAssistantCaption as ft, showsUserCaption as pt, voiceStageState as mt, waveformIsActive as ht, waveformIsSettled as gt } from "./shared/assistant/voice/voiceStageState.js";
|
|
26
|
+
import { ENDPOINT_GRACE_MS as _t, INITIAL_SESSION as vt, INTERRUPT_MAX_MS as yt, INTERRUPT_MIN_MS as bt, SILENCE_SUBMIT_MS as xt, isCapturing as St, isEcho as Ct, isSubmittable as wt, orbMode as Tt, planReplyConsumption as Et, spokenSoFar as Dt, voiceSessionReducer as Ot } from "./shared/assistant/voice/voiceSession.js";
|
|
27
|
+
import { SPEECH_LANG as kt, VOICE_LIST_TIMEOUT_MS as At, isSpeechBlocked as jt, languageDisplayName as Mt, normalizeLangTag as Nt, primaryLanguageSubtag as Pt, selectVoiceForLocale as Ft, speechGate as It, speechLangForLocale as Lt, voiceAvailability as Rt, voiceQualityRank as zt, voicesForLocale as Bt } from "./shared/assistant/voice/speechVoices.js";
|
|
28
|
+
import { buildContinuedFromVoiceNote as Vt, buildVoiceTranscriptMarkdown as Ht, voiceTranscriptFilename as Ut } from "./shared/assistant/voice/voiceTranscript.js";
|
|
29
|
+
import { DEFAULT_SPEAKABLE_LABELS as Wt, MAX_SPEAKABLE_CHARS as Gt, MAX_SPOKEN_TABLE_ROWS as Kt, SPEECH_CHUNK_CHARS as qt, SPEECH_CHUNK_CJK_CHARS as Jt, chunkForSpeech as Yt, containsCjk as Xt, speakableEmail as Zt, splitTableRow as Qt, toSpeakableText as $t } from "./shared/assistant/voice/speakableText.js";
|
|
30
|
+
import { PREVIEW_LANGUAGES as en, voicePreviewText as tn } from "./shared/assistant/voice/voicePreview.js";
|
|
31
|
+
import { MINI_CAPTION_BUDGET as nn, showPreviousChunk as rn } from "./shared/assistant/voice/miniCaptionBudget.js";
|
|
32
|
+
import { POLL_FAST_MS as an, POLL_FAST_UNTIL_MS as on, POLL_SLOW_MS as sn, POLL_STEADY_MS as cn, POLL_STEADY_UNTIL_MS as ln, pollDelayMs as un } from "./shared/assistant/voice/assistantPollSchedule.js";
|
|
33
|
+
import { toCaptionText as dn } from "./shared/assistant/voice/captionText.js";
|
|
34
|
+
import { ASSISTANT_LANGUAGES as fn, DEFAULT_SPEECH_RATE as pn, findAssistantLanguage as mn, resolveAssistantLanguage as hn } from "./shared/assistant/voice/languages.js";
|
|
35
|
+
import { replyFollowsInput as gn, resolveLanguagePair as _n } from "./shared/assistant/voice/languagePair.js";
|
|
36
|
+
import { findPendingWrite as vn, parseConfirmationRefusal as yn } from "./shared/assistant/pendingWrite.js";
|
|
37
|
+
import { SPOKEN_LABEL_LANGUAGES as bn, speechLabelsFor as xn } from "./shared/assistant/voice/speechLabels.js";
|
|
38
|
+
import { detectScriptLocale as Sn, resolveSpeechLocale as Cn } from "./shared/assistant/voice/replyLanguage.js";
|
|
39
|
+
import { IDLE_PLAYBACK as wn, isSpeakingMessage as Tn, publishedChunks as En, requiresCancel as Dn, speechPlaybackReducer as On } from "./shared/assistant/voice/speechPlayback.js";
|
|
40
|
+
import { MAX_INLINE_IMAGE_BASE64_BYTES as kn, MAX_REQUEST_BODY_BYTES as An } from "./shared/assistant/gatewayLimits.js";
|
|
41
|
+
import { BOILERPLATE_PAGE_SHARE as jn, MAX_BOILERPLATE_LINE_CHARS as Mn, MAX_EXTRACTED_CHARS as Nn, MAX_PDF_PAGES_SCANNED as Pn, MIN_PAGE_TEXT_CHARS as Fn, MIN_TEXT_PAGE_SHARE as In, columnLetterToIndex as Ln, decodeXmlEntities as Rn, docxXmlToText as zn, fitPdfPages as Bn, formatPageRanges as Vn, isMostlyImagePages as Hn, joinSheets as Un, pageMarker as Wn, parseSharedStrings as Gn, parseWorkbookSheets as Kn, pdfTextItemsToPage as qn, sheetXmlToRows as Jn, summarisePageText as Yn, truncatePagesForInline as Xn } from "./shared/assistant/documentText.js";
|
|
42
|
+
import { ATTACHMENT_ACCEPT as Zn, AttachmentRejectedError as Qn, INLINE_IMAGE_MAX_DIM as $n, INLINE_IMAGE_QUALITY as er, MAX_ATTACHMENTS as tr, MAX_FILE_BYTES as nr, MAX_INLINE_CHARS_PER_FILE as rr, MAX_INLINE_CHARS_TOTAL as ir, MAX_INLINE_IMAGE_BASE64_CHARS as ar, MAX_INLINE_IMAGE_PARTS as or, MAX_INLINE_TURN_BODY_BYTES as sr, MAX_TURN_BODY_BYTES as cr, PROMPT_ENVELOPE_RESERVE_BYTES as lr, TURN_BODY_HEADROOM_BYTES as ur, buildAttachmentPromptBlock as dr, buildPromptParts as fr, buildPromptWithAttachments as pr, classifyAttachment as mr, countInlineImageCandidates as hr, countInlinedImageParts as gr, detectDocumentFormat as _r, estimateTurnBodyBytes as vr, formatBytes as yr, getAttachmentSendBlocker as br, getExtension as xr, getSendableAttachments as Sr, hasAttachmentWorkInFlight as Cr, parseDataUrl as wr, toMessageAttachment as Tr, truncateForInline as Er, validateFile as Dr } from "./shared/assistant/attachments.js";
|
|
43
|
+
import { useAssistantStore as Or } from "./shared/assistant/store.js";
|
|
44
|
+
import { isTurnInFlight as kr, planAbandonedTurn as Ar, planTurnAbort as jr } from "./shared/assistant/turnState.js";
|
|
45
|
+
import { PHRASE_ROTATE_MS as Mr, STAGE_COPY as Nr, THINKING_PHRASES as Pr, isStageCopy as Fr, stageText as Ir, statusStageCopy as Lr, thinkingPhrase as Rr } from "./shared/assistant/stageCopy.js";
|
|
46
|
+
import { AssistantToolActivity as zr, parseToolActivity as Br } from "./shared/assistant/ui/AssistantToolActivity.js";
|
|
47
|
+
import { AssistantSpeechProvider as Vr, useAssistantSpeech as Hr } from "./shared/assistant/ui/AssistantSpeechProvider.js";
|
|
48
|
+
import { useVoiceSession as Ur } from "./shared/assistant/ui/useVoiceSession.js";
|
|
49
|
+
import { getActorId as Wr, getOrganizationId as Gr, getWorkspaceId as Kr } from "./shared/assistant/context.js";
|
|
50
|
+
import { ATTACHMENT_SOURCES as qr, availableAttachmentSources as Jr, deviceHasCamera as Yr } from "./shared/assistant/attachmentSources.js";
|
|
51
|
+
import { SANDBOX_READY_TTL_MS as Xr, createReadinessTracker as Zr, isRecentlyVerified as Qr } from "./shared/assistant/sandboxReadiness.js";
|
|
52
|
+
import { AssistantAutoSpeakToggle as $r } from "./shared/assistant/ui/AssistantAutoSpeakToggle.js";
|
|
53
|
+
import { AssistantMessageAttachments as ei } from "./shared/assistant/ui/AssistantMessageAttachments.js";
|
|
54
|
+
import { AssistantPendingWriteCard as ti } from "./shared/assistant/ui/AssistantPendingWriteCard.js";
|
|
55
|
+
import { AssistantLanguageMenu as ni } from "./shared/assistant/ui/AssistantLanguageMenu.js";
|
|
56
|
+
import { AssistantReplyLanguageSelector as ri } from "./shared/assistant/ui/AssistantReplyLanguageSelector.js";
|
|
57
|
+
import { AssistantSpeakButton as ii } from "./shared/assistant/ui/AssistantSpeakButton.js";
|
|
58
|
+
import { AssistantSpokenTurnsNotice as ai } from "./shared/assistant/ui/AssistantSpokenTurnsNotice.js";
|
|
59
|
+
import { AssistantConnectSourceProvider as oi, useAssistantConnectSource as si } from "./shared/assistant/ui/composer/connectSource.js";
|
|
60
|
+
import { AssistantConnectSourceItem as ci } from "./shared/assistant/ui/composer/AssistantConnectSourceItem.js";
|
|
61
|
+
import { ASSISTANT_OVERLAY_ATTR as li, ASSISTANT_PANEL_ATTR as ui, NO_PANEL_OVERLAY as di, activePanelOverlay as fi, assistantPanelOwnsEscape as pi, escapeDismisses as mi, focusIsInsidePanel as hi, nextPanelOverlays as gi, panelOwnsEscape as _i } from "./shared/assistant/ui/panelOverlays.js";
|
|
62
|
+
import { useDropdownEscape as vi } from "./shared/assistant/ui/useDropdownEscape.js";
|
|
63
|
+
import { AssistantAttachmentButton as yi } from "./shared/assistant/ui/composer/AssistantAttachmentButton.js";
|
|
64
|
+
import { AssistantAttachmentChips as bi } from "./shared/assistant/ui/composer/AssistantAttachmentChips.js";
|
|
65
|
+
import { AssistantPreviewProvider as xi, useAssistantPreview as Si } from "./shared/assistant/preview/context.js";
|
|
66
|
+
import { IDLE_PREVIEW_STATE as Ci, isRunningStatus as wi, nextPreviewEvents as Ti } from "./shared/assistant/preview/previewTransitions.js";
|
|
67
|
+
import { IDLE_PREVIEW as Ei, NO_OWNER as Di, applyPreviewEvent as Oi, createAssistantPreviewSurface as ki, currentPreviewOwner as Ai, runBelongsTo as ji, sameOwner as Mi } from "./shared/assistant/preview/surfaceState.js";
|
|
68
|
+
import { createRunIdentityCache as Ni, runIdentities as Pi } from "./shared/assistant/preview/runIdentity.js";
|
|
69
|
+
import { IDLE_ACTIVE_TAB as Fi, nextActiveTab as Ii, pinActiveTab as Li, shouldPinOnMove as Ri, shouldPinOnSelect as zi, stepsFromToolActivity as Bi, tabForArrowKey as Vi } from "./shared/assistant/preview/entity/entityPreviewState.js";
|
|
70
|
+
import { AssistantStepRail as Hi } from "./shared/assistant/preview/entity/AssistantStepRail.js";
|
|
71
|
+
import { AssistantEntityPreview as Ui } from "./shared/assistant/preview/entity/AssistantEntityPreview.js";
|
|
72
|
+
import { useOverlayFocus as Wi } from "./shared/assistant/ui/useOverlayFocus.js";
|
|
73
|
+
import { useAssistantPreviewBridge as Gi } from "./shared/assistant/preview/useAssistantPreviewBridge.js";
|
|
74
|
+
import { AssistantPreviewOverlay as Ki } from "./shared/assistant/preview/AssistantPreviewOverlay.js";
|
|
75
|
+
import { AssistantLanguageSelector as qi, FOLLOW_APP_LOCALE as Ji } from "./shared/assistant/ui/composer/AssistantLanguageSelector.js";
|
|
76
|
+
import { ASSISTANT_MODE_META as Yi, AssistantModeSelector as Xi, nextModeIndex as Zi } from "./shared/assistant/ui/composer/AssistantModeSelector.js";
|
|
77
|
+
import { AssistantVoiceButton as Qi } from "./shared/assistant/ui/composer/AssistantVoiceButton.js";
|
|
78
|
+
import { AUTO_VOICE as $i, AssistantVoiceSelector as ea } from "./shared/assistant/ui/composer/AssistantVoiceSelector.js";
|
|
79
|
+
import { AssistantVoiceOrb as ta } from "./shared/assistant/ui/voice/AssistantVoiceOrb.js";
|
|
80
|
+
import { AssistantVoiceSessionButton as na } from "./shared/assistant/ui/voice/AssistantVoiceSessionButton.js";
|
|
81
|
+
import { CAPTION_SCROLL_ATTR as ra, VoiceCaption as ia } from "./shared/assistant/ui/voice/VoiceCaption.js";
|
|
82
|
+
import { VoiceConversationView as aa } from "./shared/assistant/ui/voice/VoiceConversationView.js";
|
|
83
|
+
import { VoiceWaveform as oa } from "./shared/assistant/ui/voice/VoiceWaveform.js";
|
|
84
|
+
import { VoiceMiniController as sa } from "./shared/assistant/ui/voice/VoiceMiniController.js";
|
|
85
|
+
import { VoiceStage as ca } from "./shared/assistant/ui/voice/VoiceStage.js";
|
|
86
|
+
import { VoiceTranscriptDrawer as la } from "./shared/assistant/ui/voice/VoiceTranscriptDrawer.js";
|
|
87
|
+
import { downloadFile as ua, exportConversation as da } from "./shared/assistant/exportConversation.js";
|
|
88
|
+
import { AssistantMoreMenu as fa } from "./shared/assistant/ui/AssistantMoreMenu.js";
|
|
89
|
+
import { AssistantHeader as pa } from "./shared/assistant/ui/AssistantHeader.js";
|
|
90
|
+
import { AssistantConversationList as ma } from "./shared/assistant/ui/AssistantConversationList.js";
|
|
91
|
+
import { AssistantEmptyState as ha } from "./shared/assistant/ui/AssistantEmptyState.js";
|
|
92
|
+
import { AssistantMessageItem as ga } from "./shared/assistant/ui/AssistantMessageItem.js";
|
|
93
|
+
import { AssistantMessageList as _a } from "./shared/assistant/ui/AssistantMessageList.js";
|
|
94
|
+
import { AssistantVoiceSession as va } from "./shared/assistant/ui/voice/AssistantVoiceSession.js";
|
|
95
|
+
import { useAssistantApiAccess as ya } from "./shared/assistant/useAssistantApiAccess.js";
|
|
96
|
+
import { useConversationTurns as ba } from "./shared/assistant/useConversationTurns.js";
|
|
97
|
+
import { isMultimodalBodyRejection as xa, isRecoverableAssistantError as Sa } from "./shared/assistant/transportErrors.js";
|
|
98
|
+
import { aiCreditsUpdatedEventName as Ca, dispatchAssistantQuotaExhausted as wa, notifyAiCreditsUpdated as Ta } from "./shared/assistant/aiCredits.js";
|
|
99
|
+
import { useWorkspaceWriteAccess as Ea } from "./shared/assistant/useWorkspaceWriteAccess.js";
|
|
100
|
+
import { extractDocumentText as Da } from "./shared/assistant/documentExtract.js";
|
|
101
|
+
import { useAssistantAttachments as Oa } from "./shared/assistant/useAssistantAttachments.js";
|
|
102
|
+
import { AssistantComposer as ka } from "./shared/assistant/ui/composer/AssistantComposer.js";
|
|
103
|
+
import { isProdRuntime as Aa } from "./shared/assistant/env.js";
|
|
104
|
+
import { useAssistantHeartbeat as ja } from "./shared/assistant/useAssistantHeartbeat.js";
|
|
105
|
+
import { useAssistantKeyboardShortcuts as Ma } from "./shared/assistant/useAssistantKeyboardShortcuts.js";
|
|
106
|
+
import { AssistantApiCallsConsentDialog as Na } from "./shared/assistant/ui/AssistantApiCallsConsentDialog.js";
|
|
107
|
+
import { AssistantChatArea as Pa } from "./shared/assistant/ui/AssistantChatArea.js";
|
|
108
|
+
import { AIAssistantPanel as Fa } from "./shared/assistant/ui/AIAssistantPanel.js";
|
|
109
|
+
export { Fa as AIAssistantPanel, L as ASSISTANT_API_AUTH_STRATEGY, fn as ASSISTANT_LANGUAGES, Yi as ASSISTANT_MODE_META, li as ASSISTANT_OVERLAY_ATTR, ui as ASSISTANT_PANEL_ATTR, Zn as ATTACHMENT_ACCEPT, qr as ATTACHMENT_SOURCES, $i as AUTO_VOICE, Na as AssistantApiCallsConsentDialog, yi as AssistantAttachmentButton, bi as AssistantAttachmentChips, $r as AssistantAutoSpeakToggle, Pa as AssistantChatArea, ka as AssistantComposer, ci as AssistantConnectSourceItem, oi as AssistantConnectSourceProvider, ma as AssistantConversationList, ha as AssistantEmptyState, Ui as AssistantEntityPreview, pa as AssistantHeader, s as AssistantI18nProvider, ni as AssistantLanguageMenu, qi as AssistantLanguageSelector, f as AssistantMarkdownImage, h as AssistantMarkdownRenderer, ei as AssistantMessageAttachments, ga as AssistantMessageItem, _a as AssistantMessageList, Xi as AssistantModeSelector, fa as AssistantMoreMenu, g as AssistantNavigateProvider, ti as AssistantPendingWriteCard, Ki as AssistantPreviewOverlay, xi as AssistantPreviewProvider, t as AssistantProductProvider, ri as AssistantReplyLanguageSelector, _e as AssistantRuntimeManager, ii as AssistantSpeakButton, Vr as AssistantSpeechProvider, ai as AssistantSpokenTurnsNotice, Hi as AssistantStepRail, zr as AssistantToolActivity, Qi as AssistantVoiceButton, ta as AssistantVoiceOrb, ea as AssistantVoiceSelector, va as AssistantVoiceSession, na as AssistantVoiceSessionButton, Qn as AttachmentRejectedError, jn as BOILERPLATE_PAGE_SHARE, ra as CAPTION_SCROLL_ATTR, O as CHECK_AI_CREDITS, k as CREATE_SANDBOX, Wt as DEFAULT_SPEAKABLE_LABELS, pn as DEFAULT_SPEECH_RATE, Ae as DEFAULT_STREAM_BUDGET_MS, _t as ENDPOINT_GRACE_MS, A as EXTEND_SANDBOX_TTL, Ji as FOLLOW_APP_LOCALE, j as GET_ACTIVE_SANDBOXES, M as GET_SANDBOX, qe as HOSTED_TTS_MAX_CHARS, Ue as HOSTED_TTS_TIER, We as HOSTED_VOICES, Fi as IDLE_ACTIVE_TAB, wn as IDLE_PLAYBACK, Ei as IDLE_PREVIEW, Ci as IDLE_PREVIEW_STATE, vt as INITIAL_SESSION, $n as INLINE_IMAGE_MAX_DIM, er as INLINE_IMAGE_QUALITY, yt as INTERRUPT_MAX_MS, bt as INTERRUPT_MIN_MS, tr as MAX_ATTACHMENTS, Mn as MAX_BOILERPLATE_LINE_CHARS, Nn as MAX_EXTRACTED_CHARS, nr as MAX_FILE_BYTES, rr as MAX_INLINE_CHARS_PER_FILE, ir as MAX_INLINE_CHARS_TOTAL, kn as MAX_INLINE_IMAGE_BASE64_BYTES, ar as MAX_INLINE_IMAGE_BASE64_CHARS, or as MAX_INLINE_IMAGE_PARTS, sr as MAX_INLINE_TURN_BODY_BYTES, Pn as MAX_PDF_PAGES_SCANNED, An as MAX_REQUEST_BODY_BYTES, Gt as MAX_SPEAKABLE_CHARS, Kt as MAX_SPOKEN_TABLE_ROWS, cr as MAX_TURN_BODY_BYTES, nn as MINI_CAPTION_BUDGET, Fn as MIN_PAGE_TEXT_CHARS, In as MIN_TEXT_PAGE_SHARE, Di as NO_OWNER, di as NO_PANEL_OVERLAY, Mr as PHRASE_ROTATE_MS, an as POLL_FAST_MS, on as POLL_FAST_UNTIL_MS, sn as POLL_SLOW_MS, cn as POLL_STEADY_MS, ln as POLL_STEADY_UNTIL_MS, en as PREVIEW_LANGUAGES, lr as PROMPT_ENVELOPE_RESERVE_BYTES, N as PROXY_SANDBOX_REQUEST, P as REPORT_AI_TOKEN_USAGE, Xr as SANDBOX_READY_TTL_MS, xt as SILENCE_SUBMIT_MS, Je as SPEAKING_RATE_MAX, Ye as SPEAKING_RATE_MAX_STREAMING, Xe as SPEAKING_RATE_MAX_SYNC, Ze as SPEAKING_RATE_MIN, qt as SPEECH_CHUNK_CHARS, Jt as SPEECH_CHUNK_CJK_CHARS, kt as SPEECH_LANG, bn as SPOKEN_LABEL_LANGUAGES, Nr as STAGE_COPY, F as STOP_ASSISTANT_SANDBOX, je as STREAM_BUDGET_MS, Pr as THINKING_PHRASES, ur as TURN_BODY_HEADROOM_BYTES, At as VOICE_LIST_TIMEOUT_MS, ia as VoiceCaption, aa as VoiceConversationView, sa as VoiceMiniController, ca as VoiceStage, la as VoiceTranscriptDrawer, oa as VoiceWaveform, I as WAIT_FOR_SANDBOX_RUNNING, q as abortAssistantTurn, fi as activePanelOverlay, Ca as aiCreditsUpdatedEventName, Oi as applyPreviewEvent, J as approvePendingWrite, pi as assistantPanelOwnsEscape, _ as assistantRoutePath, c as assistantTranslationKey, v as assistantUrlTransform, Jr as availableAttachmentSources, Qe as base64ToBytes, y as browserShouldHandle, He as browserSpeechEngine, Y as buildAssistantSandboxEnv, dr as buildAttachmentPromptBlock, Vt as buildContinuedFromVoiceNote, ve as buildProgress, fr as buildPromptParts, X as buildPromptRequestBody, pr as buildPromptWithAttachments, $e as buildRequest, E as buildSandboxContextInput, Ht as buildVoiceTranscriptMarkdown, Fe as chatTurns, Z as checkAssistantAiCredits, Yt as chunkForSpeech, b as classifyAssistantHref, mr as classifyAttachment, et as classifyHttpFailure, S as classifyQuotaError, Ln as columnLetterToIndex, ot as configureSpeechEngine, Xt as containsCjk, d as copyToClipboard, hr as countInlineImageCandidates, gr as countInlinedImageParts, ki as createAssistantPreviewSurface, Q as createAssistantSandbox, $ as createAssistantSession, it as createHostedTtsEngine, Zr as createReadinessTracker, at as createRoutingSpeechEngine, Ni as createRunIdentityCache, Oe as createSandboxAssistantTransport, st as createSpeechEngines, Ai as currentPreviewOwner, tt as decodeAudioResponse, Rn as decodeXmlEntities, C as describeQuotaError, _r as detectDocumentFormat, Sn as detectScriptLocale, Yr as deviceHasCamera, wa as dispatchAssistantQuotaExhausted, zn as docxXmlToText, ee as downloadAssistantArtifact, ua as downloadFile, mi as escapeDismisses, vr as estimateTurnBodyBytes, D as executeSandboxGraphQL, da as exportConversation, te as extendAssistantSandboxTTL, Da as extractDocumentText, mn as findAssistantLanguage, ne as findExistingSandbox, vn as findPendingWrite, Bn as fitPdfPages, hi as focusIsInsidePanel, yr as formatBytes, Vn as formatPageRanges, Wr as getActorId, re as getAssistantArtifacts, ye as getAssistantMedia, ie as getAssistantMessages, ae as getAssistantSession, oe as getAssistantStreamAccess, be as getAssistantText, br as getAttachmentSendBlocker, U as getCapability, xr as getExtension, R as getImageForMode, z as getImageTagForMode, Gr as getOrganizationId, xe as getRawMessageCreatedAt, B as getResourcesForMode, V as getSandboxImageRegistry, Sr as getSendableAttachments, ct as getSpeechEngine, Se as getToolProgress, Kr as getWorkspaceId, Ie as groupBySession, Le as groupConsecutiveBySession, Cr as hasAttachmentWorkInFlight, Ge as hostedLocaleFor, Ke as hostedSupportsLanguage, p as imageHostLabel, Me as incompleteTurnNotice, St as isCapturing, Ct as isEcho, Hn as isMostlyImagePages, xa as isMultimodalBodyRejection, Aa as isProdRuntime, w as isQuotaExhaustedError, Ce as isReapedSandboxConnectionError, Qr as isRecentlyVerified, we as isRecoverable, Sa as isRecoverableAssistantError, m as isRemoteImageSrc, wi as isRunningStatus, Tn as isSpeakingMessage, jt as isSpeechBlocked, Fr as isStageCopy, wt as isSubmittable, kr as isTurnInFlight, W as isUnknownFieldError, Re as isVoiceTurn, Un as joinSheets, Mt as languageDisplayName, Te as mapSessionToHistory, G as markSupported, K as markUnsupported, Ee as mergeMessagesById, dt as micIsInterrupt, se as modeRequiresConfirmWrites, Ii as nextActiveTab, Zi as nextModeIndex, gi as nextPanelOverlays, Ti as nextPreviewEvents, Nt as normalizeLangTag, Ta as notifyAiCreditsUpdated, Tt as orbMode, Wn as pageMarker, _i as panelOwnsEscape, yn as parseConfirmationRefusal, wr as parseDataUrl, Gn as parseSharedStrings, Br as parseToolActivity, Kn as parseWorkbookSheets, qn as pdfTextItemsToPage, Li as pinActiveTab, Ar as planAbandonedTurn, Et as planReplyConsumption, jr as planTurnAbort, un as pollDelayMs, Pt as primaryLanguageSubtag, En as publishedChunks, T as quotaExhaustedEventName, lt as readSpeechEngineConfig, ce as releaseSupersededAssistantSandboxes, gn as replyFollowsInput, le as reportAssistantAiTokenUsage, Dn as requiresCancel, ut as resetSpeechEngine, hn as resolveAssistantLanguage, _n as resolveLanguagePair, n as resolveModeConfig, H as resolveSandboxAssistantMode, Cn as resolveSpeechLocale, ji as runBelongsTo, Pi as runIdentities, Mi as sameOwner, De as sanitize, ue as selectExistingAssistantSandbox, de as selectSupersededAssistantSandboxes, Ft as selectVoiceForLocale, fe as sendAssistantPromptAsync, pe as sendHeartbeat, Jn as sheetXmlToRows, nt as shouldDisableEngine, Ri as shouldPinOnMove, zi as shouldPinOnSelect, rn as showPreviousChunk, ft as showsAssistantCaption, pt as showsUserCaption, Zt as speakableEmail, It as speechGate, xn as speechLabelsFor, Lt as speechLangForLocale, On as speechPlaybackReducer, rt as splitForVendor, Qt as splitTableRow, Dt as spokenSoFar, Ir as stageText, Lr as statusStageCopy, Bi as stepsFromToolActivity, me as stopReapedAssistantSandbox, Ne as streamBudgetMs, Yn as summarisePageText, Vi as tabForArrowKey, Rr as thinkingPhrase, dn as toCaptionText, Tr as toMessageAttachment, $t as toSpeakableText, Er as truncateForInline, Xn as truncatePagesForInline, ya as useAssistantApiAccess, Oa as useAssistantAttachments, si as useAssistantConnectSource, ja as useAssistantHeartbeat, l as useAssistantI18nNamespace, Ma as useAssistantKeyboardShortcuts, x as useAssistantNavigate, r as useAssistantPageLabel, Si as useAssistantPreview, Gi as useAssistantPreviewBridge, i as useAssistantProduct, a as useAssistantProductOrNull, Hr as useAssistantSpeech, o as useAssistantStorageFolders, Or as useAssistantStore, u as useAssistantTr, ba as useConversationTurns, vi as useDropdownEscape, Wi as useOverlayFocus, ke as useSandboxAssistantTransport, e as useVoiceInput, Ur as useVoiceSession, Ea as useWorkspaceWriteAccess, Dr as validateFile, Rt as voiceAvailability, ze as voiceMarker, tn as voicePreviewText, zt as voiceQualityRank, Be as voiceSessionIdOf, Ot as voiceSessionReducer, mt as voiceStageState, Ut as voiceTranscriptFilename, Ve as voiceTurnsOnly, Bt as voicesForLocale, he as waitForAssistantServiceReady, ge as waitForSandboxRunning, ht as waveformIsActive, gt as waveformIsSettled, Pe as withIncompleteTurnNotice };
|