@burdenoff/fe-libs 2026.1023.16 → 2026.1024.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/avatar/live/LiveAvatarStage.js +5 -1
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +28 -25
- package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +17 -1
- package/dist/shared/assistant/avatar/live/avatarSessionClient.js +81 -64
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +1 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +61 -50
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +25 -5
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +166 -156
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +5 -3
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +4 -3
- package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +9 -3
- package/dist/shared/assistant/avatar/useAvatarCopy.js +7 -1
- package/dist/shared/assistant/i18nManifest.d.ts +4 -0
- package/dist/shared/assistant/i18nManifest.js +4 -0
- package/package.json +1 -1
|
@@ -3,16 +3,18 @@ import { AvatarCopy } from '../useAvatarCopy';
|
|
|
3
3
|
import { LiveAvatarSnapshot } from './liveAvatarController';
|
|
4
4
|
/**
|
|
5
5
|
* ★ BOFF-9360: whether the avatar can take a typed question's answer now, as the Avatar tab's ask box reads it
|
|
6
|
-
* (`LiveAvatarTabSeam.ask`).
|
|
6
|
+
* (`LiveAvatarTabSeam.ask`). From the snapshot and the time (`now`) alone: it never asks `route()`, which has side effects.
|
|
7
7
|
* - `ready`: on, and nothing in the way;
|
|
8
8
|
* - `sound-blocked`: on, but the browser blocks its sound until a tap on the frame lifts it (critic m1);
|
|
9
9
|
* - `ending`: stopping, or near its time limit (`closing`), so no new reply goes to it (critic m1);
|
|
10
10
|
* - `starting`: being started or joined;
|
|
11
|
-
* - `locked`: off after a "not now" refusal that said when (`retryAt`): Turn on waits for
|
|
11
|
+
* - `locked`: off after a "not now" refusal that said when (`retryAt`), until that time (`now`, wall-clock ms): Turn on waits for it
|
|
12
|
+
* (critic m11). From that time on it is `off`, even while the snapshot still carries the time: the timer that clears it runs late
|
|
13
|
+
* after a system sleep (BOFF-9333 UI-11);
|
|
12
14
|
* - `off`: off, or being set up (checking, choosing).
|
|
13
15
|
* A device voice (no hosted voice to animate) is not predicted here: the route says so per reply, and the tab's
|
|
14
16
|
* status line already explains it (`needs-hosted-voice`).
|
|
15
17
|
*/
|
|
16
|
-
export declare function liveAvatarAskState(snapshot: LiveAvatarSnapshot): LiveAvatarAskState;
|
|
18
|
+
export declare function liveAvatarAskState(snapshot: LiveAvatarSnapshot, now?: number): LiveAvatarAskState;
|
|
17
19
|
/** The words for the avatar's state line: what went wrong, what it is doing, or null. `now`: wall-clock ms, for the retry time. */
|
|
18
20
|
export declare function liveAvatarStatusText(snapshot: LiveAvatarSnapshot, copy: AvatarCopy, now?: number): string | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/shared/assistant/avatar/live/liveAvatarStatus.ts
|
|
2
|
-
function e(e) {
|
|
2
|
+
function e(e, t = Date.now()) {
|
|
3
3
|
switch (e.phase) {
|
|
4
4
|
case "ready": return e.closing ? "ending" : e.audioBlocked ? "sound-blocked" : "ready";
|
|
5
5
|
case "starting":
|
|
6
6
|
case "connecting": return "starting";
|
|
7
7
|
case "ending": return "ending";
|
|
8
|
-
default: return e.retryAt
|
|
8
|
+
default: return e.retryAt !== null && e.retryAt > t ? "locked" : "off";
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
function t(e, t, n = Date.now()) {
|
|
@@ -14,7 +14,8 @@ function t(e, t, n = Date.now()) {
|
|
|
14
14
|
if (e.problem !== null) {
|
|
15
15
|
let i = e.retryAt, a = i !== null && i > n, o = t.problem(e.problem, {
|
|
16
16
|
voiceLive: r,
|
|
17
|
-
timed: a
|
|
17
|
+
timed: a,
|
|
18
|
+
budgetScope: e.budgetScope
|
|
18
19
|
});
|
|
19
20
|
return a ? `${o} ${t.availableAgain(t.retryTime(i, n))}` : o;
|
|
20
21
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { AvatarAskBlocker } from '../ui/avatar/avatarAskGate';
|
|
2
2
|
import { VoiceStartBlocker } from '../ui/voice/voiceStartGate';
|
|
3
|
+
import { AvatarBudgetScope } from './live/avatarSessionClient';
|
|
3
4
|
/** What the person can be told went wrong; the adapter maps server codes onto these. */
|
|
4
5
|
export type AvatarProblem = 'unavailable' | 'not-ready' | 'already-running' | 'capacity' | 'rate-limited' | 'paused'
|
|
5
|
-
/** The avatar time allowed for now (
|
|
6
|
-
| 'budget-exhausted' | 'start-timeout' | 'provider'
|
|
6
|
+
/** The avatar time allowed for now (a credit cap) is used up; the server says when it comes back, and whose it is (`budgetScope`). */
|
|
7
|
+
| 'budget-exhausted' | 'start-timeout' | 'provider'
|
|
8
|
+
/** The avatar vendor's balance is at its floor: nobody's fault, it affects everyone, and no time is said for it. */
|
|
9
|
+
| 'provider-out-of-credits' | 'connection' | 'needs-hosted-voice' | 'unsupported-browser' | 'playback-blocked';
|
|
7
10
|
export interface AvatarCopy {
|
|
8
11
|
toggle: string;
|
|
9
12
|
toggleHint: string;
|
|
@@ -108,7 +111,8 @@ export interface AvatarCopy {
|
|
|
108
111
|
handsFreeOff: string;
|
|
109
112
|
/**
|
|
110
113
|
* What went wrong. `voiceLive` false: no voice conversation is live, so nothing is said to "continue" (BOFF-9341). `timed`: the next
|
|
111
|
-
* sentence says when it can start again, so the wording does not also say "in a moment".
|
|
114
|
+
* sentence says when it can start again, so the wording does not also say "in a moment". `budgetScope`: whose time is used up
|
|
115
|
+
* (`budget-exhausted` only; BOFF-9333).
|
|
112
116
|
*/
|
|
113
117
|
problem: (problem: AvatarProblem, options?: AvatarProblemOptions) => string;
|
|
114
118
|
}
|
|
@@ -117,6 +121,8 @@ export interface AvatarProblemOptions {
|
|
|
117
121
|
readonly voiceLive?: boolean;
|
|
118
122
|
/** A "You can start it again at …" sentence follows. */
|
|
119
123
|
readonly timed?: boolean;
|
|
124
|
+
/** With `budget-exhausted`, whose budget is used up. Absent or null: the server named none, and the general line is said. */
|
|
125
|
+
readonly budgetScope?: AvatarBudgetScope | null;
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
128
|
* `at` as the reader's locale writes a time, with the date when `at` is not on `now`'s day (a daily limit comes back tomorrow).
|
|
@@ -122,9 +122,15 @@ function s() {
|
|
|
122
122
|
case "capacity": return r ? i("avatar.problemCapacityTimed", "Avatars are busy right now.") : i("avatar.problemCapacity", "Avatars are busy right now. Try again in a moment.");
|
|
123
123
|
case "rate-limited": return r ? i("avatar.problemRateLimitedTimed", "You started avatars too quickly.") : i("avatar.problemRateLimited", "You started avatars too quickly. Wait a minute and try again.");
|
|
124
124
|
case "paused": return i("avatar.problemPaused", "Avatars are paused for now.");
|
|
125
|
-
case "budget-exhausted":
|
|
125
|
+
case "budget-exhausted": switch (t.budgetScope) {
|
|
126
|
+
case "person": return i("avatar.problemBudgetExhaustedPerson", "Your avatar time is used up for now.");
|
|
127
|
+
case "workspace": return i("avatar.problemBudgetExhaustedWorkspace", "This workspace’s avatar time is used up for now.");
|
|
128
|
+
case "everyone": return i("avatar.problemBudgetExhaustedEveryone", "Avatar time is used up for everyone for now.");
|
|
129
|
+
default: return i("avatar.problemBudgetExhausted", "Avatar time is used up for now.");
|
|
130
|
+
}
|
|
126
131
|
case "start-timeout": return i("avatar.problemStartTimeout", "The avatar took too long to start. Try again in a moment.");
|
|
127
132
|
case "provider": return n ? i("avatar.problemProvider", "The avatar had a problem. Voice continues without it.") : i("avatar.problemProviderNoVoice", "The avatar had a problem.");
|
|
133
|
+
case "provider-out-of-credits": return i("avatar.problemProviderOutOfCredits", "Avatars aren’t available right now. Try again later.");
|
|
128
134
|
case "connection": return i("avatar.problemConnection", "The connection to the avatar was lost.");
|
|
129
135
|
case "needs-hosted-voice": return i("avatar.problemNeedsHostedVoice", "The avatar needs one of the assistant’s own voices. Choose one in the voice settings.");
|
|
130
136
|
case "unsupported-browser": return i("avatar.problemUnsupportedBrowser", "This browser can’t show the avatar.");
|
|
@@ -261,6 +261,9 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
261
261
|
readonly "avatar.handsFreeOff": "Hands-free interrupt is off, so the avatar's voice can't interrupt itself. It stays off after you turn the avatar off; turn it back on in More options. You can still tap to interrupt.";
|
|
262
262
|
readonly "avatar.problemAlreadyRunning": "An avatar is already running for you.";
|
|
263
263
|
readonly "avatar.problemBudgetExhausted": "Avatar time is used up for now.";
|
|
264
|
+
readonly "avatar.problemBudgetExhaustedEveryone": "Avatar time is used up for everyone for now.";
|
|
265
|
+
readonly "avatar.problemBudgetExhaustedPerson": "Your avatar time is used up for now.";
|
|
266
|
+
readonly "avatar.problemBudgetExhaustedWorkspace": "This workspace’s avatar time is used up for now.";
|
|
264
267
|
readonly "avatar.problemCapacity": "Avatars are busy right now. Try again in a moment.";
|
|
265
268
|
readonly "avatar.problemCapacityTimed": "Avatars are busy right now.";
|
|
266
269
|
readonly "avatar.problemConnection": "The connection to the avatar was lost.";
|
|
@@ -270,6 +273,7 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
270
273
|
readonly "avatar.problemPlaybackBlocked": "The browser blocked the avatar’s sound. Tap the avatar to turn it on.";
|
|
271
274
|
readonly "avatar.problemProvider": "The avatar had a problem. Voice continues without it.";
|
|
272
275
|
readonly "avatar.problemProviderNoVoice": "The avatar had a problem.";
|
|
276
|
+
readonly "avatar.problemProviderOutOfCredits": "Avatars aren’t available right now. Try again later.";
|
|
273
277
|
readonly "avatar.problemRateLimited": "You started avatars too quickly. Wait a minute and try again.";
|
|
274
278
|
readonly "avatar.problemRateLimitedTimed": "You started avatars too quickly.";
|
|
275
279
|
readonly "avatar.problemStartTimeout": "The avatar took too long to start. Try again in a moment.";
|
|
@@ -155,6 +155,9 @@ var m = {
|
|
|
155
155
|
"avatar.handsFreeOff": "Hands-free interrupt is off, so the avatar's voice can't interrupt itself. It stays off after you turn the avatar off; turn it back on in More options. You can still tap to interrupt.",
|
|
156
156
|
"avatar.problemAlreadyRunning": "An avatar is already running for you.",
|
|
157
157
|
"avatar.problemBudgetExhausted": "Avatar time is used up for now.",
|
|
158
|
+
"avatar.problemBudgetExhaustedEveryone": "Avatar time is used up for everyone for now.",
|
|
159
|
+
"avatar.problemBudgetExhaustedPerson": "Your avatar time is used up for now.",
|
|
160
|
+
"avatar.problemBudgetExhaustedWorkspace": "This workspace’s avatar time is used up for now.",
|
|
158
161
|
"avatar.problemCapacity": "Avatars are busy right now. Try again in a moment.",
|
|
159
162
|
"avatar.problemCapacityTimed": "Avatars are busy right now.",
|
|
160
163
|
"avatar.problemConnection": "The connection to the avatar was lost.",
|
|
@@ -164,6 +167,7 @@ var m = {
|
|
|
164
167
|
"avatar.problemPlaybackBlocked": "The browser blocked the avatar’s sound. Tap the avatar to turn it on.",
|
|
165
168
|
"avatar.problemProvider": "The avatar had a problem. Voice continues without it.",
|
|
166
169
|
"avatar.problemProviderNoVoice": "The avatar had a problem.",
|
|
170
|
+
"avatar.problemProviderOutOfCredits": "Avatars aren’t available right now. Try again later.",
|
|
167
171
|
"avatar.problemRateLimited": "You started avatars too quickly. Wait a minute and try again.",
|
|
168
172
|
"avatar.problemRateLimitedTimed": "You started avatars too quickly.",
|
|
169
173
|
"avatar.problemStartTimeout": "The avatar took too long to start. Try again in a moment.",
|