@burdenoff/fe-libs 2026.1024.3 → 2026.1024.4
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/LiveAvatarMinutes.d.ts +24 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarMinutes.js +161 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarStage.js +95 -73
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.d.ts +6 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +195 -171
- package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +77 -1
- package/dist/shared/assistant/avatar/live/avatarSessionClient.js +193 -72
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +14 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +65 -40
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +64 -2
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +403 -242
- package/dist/shared/assistant/avatar/live/liveAvatarMinutesView.d.ts +127 -0
- package/dist/shared/assistant/avatar/live/liveAvatarMinutesView.js +168 -0
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +3 -0
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +11 -7
- package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +127 -2
- package/dist/shared/assistant/avatar/useAvatarCopy.js +116 -7
- package/dist/shared/assistant/i18nManifest.d.ts +32 -1
- package/dist/shared/assistant/i18nManifest.js +55 -24
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +17 -17
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +5 -2
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +10 -2
- package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.js +78 -76
- package/dist/shared/assistant/ui/avatar/avatarAskGate.d.ts +2 -0
- package/dist/shared/assistant/ui/avatar/avatarAskGate.js +1 -0
- package/dist/shared/events/index.d.ts +2 -1
- package/dist/shared-assistant.js +227 -225
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { AvatarMeterHandle } from './avatarAudioMeter';
|
|
|
4
4
|
import { AvatarRoom, AvatarScheduler } from './avatarPorts';
|
|
5
5
|
import { AvatarTrackerConfig } from './avatarPlaybackTracker';
|
|
6
6
|
import { AvatarDecodedPiece, AvatarNotice, AvatarReplyOutputs } from './avatarReplyOutputs';
|
|
7
|
-
import { AvatarBudgetScope, AvatarClientEndReason, AvatarSessionClient } from './avatarSessionClient';
|
|
7
|
+
import { AvatarBudgetScope, AvatarClientEndReason, AvatarMinutes, AvatarMinutesReason, AvatarSessionClient, AvatarSessionMinutes } from './avatarSessionClient';
|
|
8
8
|
import { AvatarReadinessProbeOptions } from './avatarTransport';
|
|
9
9
|
/** End after this long without a reply on the avatar while it is on (OD8, BACKEND-DESIGN §8.7). */
|
|
10
10
|
export declare const LIVE_AVATAR_IDLE_MS = 120000;
|
|
@@ -14,6 +14,20 @@ export declare const LIVE_AVATAR_END_BEFORE_DEADLINE_MS = 10000;
|
|
|
14
14
|
export declare const LIVE_AVATAR_REQUEST_TIMEOUT_MS = 8000;
|
|
15
15
|
/** The longest a connect may take (the avatar's own wait for its video, 8 s, plus the readiness probe, 6 s, plus slack). */
|
|
16
16
|
export declare const LIVE_AVATAR_CONNECT_TIMEOUT_MS = 20000;
|
|
17
|
+
/**
|
|
18
|
+
* ★ BOFF-9446: quiet minutes questions are at least this far apart, counted from the last availability question of any kind; one asked
|
|
19
|
+
* sooner waits for it. The check after a purchase keeps its own bounded pace (`LIVE_AVATAR_PURCHASE_POLL_MS`).
|
|
20
|
+
*/
|
|
21
|
+
export declare const LIVE_AVATAR_MINUTES_REFRESH_MS = 15000;
|
|
22
|
+
/** ★ BOFF-9446: a quiet minutes question answered 429 is asked again after its Retry-After, at most this many times in a row. */
|
|
23
|
+
export declare const LIVE_AVATAR_MINUTES_BUSY_RETRIES = 2;
|
|
24
|
+
/** ★ BOFF-9446: the check after a plan purchase asks at most this many times… */
|
|
25
|
+
export declare const LIVE_AVATAR_PURCHASE_POLLS = 5;
|
|
26
|
+
/**
|
|
27
|
+
* …this far apart (0, 6, 12, 18 and 24 s from its first question, which itself comes at least this long after the last availability
|
|
28
|
+
* question of any kind), and stops as soon as the credits available rise.
|
|
29
|
+
*/
|
|
30
|
+
export declare const LIVE_AVATAR_PURCHASE_POLL_MS = 6000;
|
|
17
31
|
export type LiveAvatarPhase =
|
|
18
32
|
/** Nothing running. */
|
|
19
33
|
'off'
|
|
@@ -29,7 +43,10 @@ export type LiveAvatarPhase =
|
|
|
29
43
|
| 'ready'
|
|
30
44
|
/** Ending the session. */
|
|
31
45
|
| 'ending';
|
|
32
|
-
|
|
46
|
+
/** `minutes-ended` (★ BOFF-9446): the time limit of a session whose length was its minutes (D' < D): its minutes ran out. */
|
|
47
|
+
export type LiveAvatarNotice = 'interrupted' | 'voice-only' | 'time-limit' | 'minutes-ended';
|
|
48
|
+
/** ★ BOFF-9446: the bounded check after a plan purchase (`checkMinutesPurchase`): `checking` while it runs. */
|
|
49
|
+
export type LiveAvatarPurchaseCheck = 'idle' | 'checking';
|
|
33
50
|
/** A Turn off this soon after the tab's start click is the second click of a double click, not a choice (BOFF-9341, critic #2). */
|
|
34
51
|
export declare const LIVE_AVATAR_TAB_OFF_GUARD_MS = 1000;
|
|
35
52
|
export interface LiveAvatarSnapshot {
|
|
@@ -76,6 +93,25 @@ export interface LiveAvatarSnapshot {
|
|
|
76
93
|
readonly audioBlocked: boolean;
|
|
77
94
|
/** The avatar's video has arrived. */
|
|
78
95
|
readonly videoReady: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* ★ BOFF-9446: the minutes block of the latest availability answer (the server sends one in `enforce` only), or null: no answer with
|
|
98
|
+
* one yet (today's answers never have one), an answer with none since, or cleared by a workspace switch or a "not offered" answer.
|
|
99
|
+
* A quiet question (`refreshMinutes`) replaces it; it never changes the phase, and changes the problem only to settle a minutes
|
|
100
|
+
* problem that has no time of its own (see `refreshMinutes`).
|
|
101
|
+
*/
|
|
102
|
+
readonly minutes: AvatarMinutes | null;
|
|
103
|
+
/** ★ BOFF-9446: with the problem `minutes-exhausted`, the reason the server or the minutes answer gave; null otherwise. Goes with it. */
|
|
104
|
+
readonly minutesReason: AvatarMinutesReason | null;
|
|
105
|
+
/** ★ BOFF-9446: the running session's minutes, from its start answer (enforce only); null otherwise. Set at `ready`. */
|
|
106
|
+
readonly sessionMinutes: AvatarSessionMinutes | null;
|
|
107
|
+
/**
|
|
108
|
+
* ★ BOFF-9446: wall-clock ms at which the server ends the running session (create sent + D' - 5 s). Measured on the local scheduler
|
|
109
|
+
* from the moment the create was sent, and placed on the local clock once, at `ready`: never the server's wall clock. Null unless the
|
|
110
|
+
* start answered D'.
|
|
111
|
+
*/
|
|
112
|
+
readonly sessionEndsAt: number | null;
|
|
113
|
+
/** ★ BOFF-9446: the bounded check after a plan purchase (`checkMinutesPurchase`). */
|
|
114
|
+
readonly purchase: LiveAvatarPurchaseCheck;
|
|
79
115
|
}
|
|
80
116
|
/** The person's stored choices (P4), read and written through this narrow port so tests need no storage. */
|
|
81
117
|
export interface LiveAvatarPreferences {
|
|
@@ -125,6 +161,10 @@ export interface LiveAvatarControllerDeps {
|
|
|
125
161
|
readonly newIdempotencyKey: () => string;
|
|
126
162
|
readonly subscribeWorkspaceChange?: (listener: () => void) => () => void;
|
|
127
163
|
readonly subscribePageHide?: (listener: () => void) => () => void;
|
|
164
|
+
/** ★ BOFF-9446: the page is shown now; no quiet minutes question is asked while it is hidden. Absent: always shown. */
|
|
165
|
+
readonly isPageVisible?: () => boolean;
|
|
166
|
+
/** ★ BOFF-9446: called when the page is shown again (after it was hidden): the minutes are asked again then, quietly. */
|
|
167
|
+
readonly subscribePageVisible?: (listener: () => void) => () => void;
|
|
128
168
|
/**
|
|
129
169
|
* The page is shown again (its document visible again, or shown from the back/forward cache): the listener is `recheckRetry`. The
|
|
130
170
|
* scheduler's monotonic clock does not count a system sleep, so after one a refusal's timer fires late; the wall clock (`now`) does.
|
|
@@ -180,6 +220,28 @@ export interface LiveAvatarController {
|
|
|
180
220
|
setTabOpen(open: boolean): void;
|
|
181
221
|
/** The person declined the disclosure. */
|
|
182
222
|
cancelChoice(): void;
|
|
223
|
+
/**
|
|
224
|
+
* ★ BOFF-9446: ask availability again, QUIETLY, for its minutes only (the host's own reasons, such as the app coming back from its
|
|
225
|
+
* billing pages; the controller asks by itself after an end, when the tab opens and when the page is shown again). The phase and the
|
|
226
|
+
* chooser never change, no problem is raised, and a failure, a 429 included, keeps the last answer. The newer minutes settle a minutes
|
|
227
|
+
* problem that has no time of its own (none left, in use, not set up: Turn on cannot start), as `confirm` would find them: it says
|
|
228
|
+
* what they rule out, or goes when they leave room for a start (AVAILABLE, UNAVAILABLE, no block). A refusal with a time (`retryAt`)
|
|
229
|
+
* waits for it, and the zero-session limit stays (no minutes answer reports it). It asks only once the server has sent minutes (with
|
|
230
|
+
* today's answers it asks nothing), only while the avatar is offered and off or choosing, never while the page is hidden, never before
|
|
231
|
+
* the Retry-After of the last 429 to an availability question, and at most once per `LIVE_AVATAR_MINUTES_REFRESH_MS` (one asked sooner
|
|
232
|
+
* waits for it).
|
|
233
|
+
*/
|
|
234
|
+
refreshMinutes(): void;
|
|
235
|
+
/**
|
|
236
|
+
* ★ BOFF-9446: the person came back from a plan checkout. `purchase` is `checking` while up to `LIVE_AVATAR_PURCHASE_POLLS`
|
|
237
|
+
* quiet questions are asked, `LIVE_AVATAR_PURCHASE_POLL_MS` apart, the first no sooner than that after the last availability question
|
|
238
|
+
* of any kind; it stops as soon as the credits available rise above what they were when it began. Its answers settle the credits
|
|
239
|
+
* problem as a quiet question's do (`refreshMinutes`). Called while a check runs, the check starts again with all its questions, at
|
|
240
|
+
* the same pace. A tick is skipped, and counted, while the page is hidden, while another availability question is out, or before the
|
|
241
|
+
* Retry-After of the last 429 to one. Only once the server has sent minutes (`minutes` not null): a call before then is dropped, not
|
|
242
|
+
* remembered, so the host calls it once the snapshot has minutes.
|
|
243
|
+
*/
|
|
244
|
+
checkMinutesPurchase(): void;
|
|
183
245
|
selectAvatar(avatarId: string): void;
|
|
184
246
|
/**
|
|
185
247
|
* Avatar OFF: the toggle, the compact view's stop, the tab's Turn off, the end of the voice conversation (P2). Idempotent. In the tab,
|