@burdenoff/fe-libs 2026.1024.2 → 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/chrome/FooterBar.d.ts +1 -1
- package/dist/chrome/NativePageTransition.d.ts +1 -1
- package/dist/chrome/ProductPickerSheet.js +42 -42
- package/dist/chrome/ProductSwitcher.d.ts +8 -0
- package/dist/chrome/ProductSwitcher.js +83 -72
- package/dist/chrome/index.d.ts +9 -9
- package/dist/chrome/swipe/swipeMath.d.ts +1 -1
- package/dist/shared/assistant/api.d.ts +3 -3
- package/dist/shared/assistant/appControls/grammar.d.ts +21 -21
- package/dist/shared/assistant/appControls/languageReply.d.ts +1 -1
- package/dist/shared/assistant/appControls/names.d.ts +3 -3
- package/dist/shared/assistant/appControls/pageAdapters.d.ts +5 -5
- package/dist/shared/assistant/appControls/plan.d.ts +38 -38
- package/dist/shared/assistant/appControls/types.d.ts +15 -15
- package/dist/shared/assistant/appControls/useAssistantControl.d.ts +1 -1
- package/dist/shared/assistant/attachmentSources.d.ts +2 -2
- package/dist/shared/assistant/attachments.d.ts +5 -5
- package/dist/shared/assistant/autoRouting.d.ts +6 -6
- 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/conversation.d.ts +20 -20
- package/dist/shared/assistant/displayContent.d.ts +4 -4
- package/dist/shared/assistant/documentText.d.ts +3 -3
- package/dist/shared/assistant/exportConversation.d.ts +1 -1
- package/dist/shared/assistant/history/historyControls.d.ts +4 -4
- package/dist/shared/assistant/history/historyErrors.d.ts +3 -3
- package/dist/shared/assistant/history/historyList.d.ts +5 -5
- package/dist/shared/assistant/history/historyMerge.d.ts +4 -4
- package/dist/shared/assistant/history/historyOperations.d.ts +1 -1
- package/dist/shared/assistant/history/historySearch.d.ts +5 -5
- package/dist/shared/assistant/history/historyStatus.d.ts +1 -1
- package/dist/shared/assistant/history/historyTypes.d.ts +12 -12
- package/dist/shared/assistant/history/profileBoundStorage.d.ts +2 -2
- package/dist/shared/assistant/i18n.d.ts +1 -1
- package/dist/shared/assistant/i18nManifest.d.ts +566 -535
- package/dist/shared/assistant/i18nManifest.js +55 -24
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/liveDeltas.d.ts +1 -1
- package/dist/shared/assistant/liveOverlay.d.ts +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +1 -1
- package/dist/shared/assistant/localUiCommands.d.ts +22 -22
- package/dist/shared/assistant/localeCommands/engine.d.ts +5 -5
- package/dist/shared/assistant/localeCommands/evaluate.d.ts +8 -8
- package/dist/shared/assistant/localeCommands/fold.d.ts +2 -2
- package/dist/shared/assistant/localeCommands/frames.d.ts +3 -3
- package/dist/shared/assistant/localeCommands/gate.d.ts +3 -3
- package/dist/shared/assistant/localeCommands/languageNames.d.ts +1 -1
- package/dist/shared/assistant/localeCommands/normalise.d.ts +1 -1
- package/dist/shared/assistant/localeCommands/types.d.ts +4 -4
- package/dist/shared/assistant/modeCapabilities.d.ts +1 -1
- package/dist/shared/assistant/modeCopy.d.ts +2 -2
- package/dist/shared/assistant/permissionError.d.ts +2 -2
- package/dist/shared/assistant/preview/surfaceState.d.ts +1 -1
- package/dist/shared/assistant/preview/types.d.ts +5 -5
- package/dist/shared/assistant/preview/writeActionResults.d.ts +1 -1
- package/dist/shared/assistant/prewarm.d.ts +5 -5
- package/dist/shared/assistant/quota.d.ts +2 -2
- package/dist/shared/assistant/sandboxReadiness.d.ts +2 -2
- package/dist/shared/assistant/speech/speechFeed.d.ts +3 -3
- package/dist/shared/assistant/turnOutcome.d.ts +2 -2
- package/dist/shared/assistant/turnProgress.d.ts +1 -1
- package/dist/shared/assistant/turnState.d.ts +1 -1
- package/dist/shared/assistant/turnStream.d.ts +3 -3
- package/dist/shared/assistant/turnTimeline.d.ts +13 -13
- package/dist/shared/assistant/turnTimingReport.d.ts +1 -1
- package/dist/shared/assistant/turnTimingReporter.d.ts +3 -3
- package/dist/shared/assistant/ui/AssistantAvatarTabs.d.ts +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +17 -17
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +1 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +5 -2
- package/dist/shared/assistant/ui/AssistantToolActivity.d.ts +1 -1
- package/dist/shared/assistant/ui/AssistantUiOfferLink.d.ts +2 -2
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +3 -3
- 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/assistant/ui/composer/AssistantAttachmentButton.d.ts +1 -1
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +1 -1
- package/dist/shared/assistant/ui/leaveConfirmFocus.d.ts +1 -1
- package/dist/shared/assistant/ui/leaveConfirmNavigate.d.ts +3 -3
- package/dist/shared/assistant/ui/panelOverlays.d.ts +5 -5
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +5 -5
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +4 -4
- package/dist/shared/assistant/ui/useWriteProposals.d.ts +2 -2
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +1 -1
- package/dist/shared/assistant/ui/voice/VoiceCaption.d.ts +1 -1
- package/dist/shared/assistant/ui/voice/VoiceWaveform.d.ts +1 -1
- package/dist/shared/assistant/ui/voice/voiceSessionEscape.d.ts +2 -2
- package/dist/shared/assistant/ui/voice/voiceStartGate.d.ts +6 -6
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +1 -1
- package/dist/shared/assistant/uiActions/actOnResolve.d.ts +5 -5
- package/dist/shared/assistant/uiActions/assistantHref.d.ts +2 -2
- package/dist/shared/assistant/uiActions/backStack.d.ts +1 -1
- package/dist/shared/assistant/uiActions/deixis.d.ts +3 -3
- package/dist/shared/assistant/uiActions/entityRoutes.d.ts +1 -1
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts +8 -8
- package/dist/shared/assistant/uiActions/offerYesOnSurface.d.ts +1 -1
- package/dist/shared/assistant/uiActions/resolveTarget.d.ts +2 -2
- package/dist/shared/assistant/uiActions/uiOffers.d.ts +5 -5
- package/dist/shared/assistant/usageReporting.d.ts +2 -2
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +1 -1
- package/dist/shared/assistant/voice/affirmations.d.ts +1 -1
- package/dist/shared/assistant/voice/handsFree.d.ts +3 -3
- package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts +5 -5
- package/dist/shared/assistant/voice/handsfree/echoGate.d.ts +6 -6
- package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts +7 -7
- package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +2 -2
- package/dist/shared/assistant/voice/handsfree/micCapture.d.ts +1 -1
- package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +1 -1
- package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts +3 -3
- package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts +4 -4
- package/dist/shared/assistant/voice/handsfree/vad.d.ts +1 -1
- package/dist/shared/assistant/voice/speechPlayback.d.ts +7 -7
- package/dist/shared/assistant/voice/useVoiceInput.d.ts +1 -1
- package/dist/shared/assistant/voice/voiceReopen.d.ts +8 -8
- package/dist/shared/assistant/writeConfirmSeam.d.ts +1 -1
- package/dist/shared/assistant/writeModeConsent.d.ts +7 -7
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +3 -3
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts +1 -1
- package/dist/shared/assistant/writeProposals.d.ts +23 -23
- package/dist/shared/assistant/writeReplyBinder.d.ts +11 -11
- package/dist/shared/assistant/writeReplySend.d.ts +7 -7
- package/dist/shared/components/LandingOrDashboardRedirect.d.ts +18 -3
- package/dist/shared/components/LandingOrDashboardRedirect.js +58 -28
- package/dist/shared/components/index.d.ts +2 -1
- package/dist/shared/events/index.d.ts +2 -1
- package/dist/shared/hooks/shell/globalSearchError.d.ts +2 -2
- package/dist/shared/navigation/productSwitchHandoff.d.ts +45 -0
- package/dist/shared/navigation/productSwitchHandoff.js +27 -0
- package/dist/shared/navigation/unsavedChanges.d.ts +1 -1
- package/dist/shared/utils/index.d.ts +3 -3
- package/dist/shared-assistant.js +227 -225
- package/dist/shared-components.js +7 -6
- package/dist/shared.js +71 -70
- package/package.json +3 -2
|
@@ -7,7 +7,7 @@ import { LocalCommandCopy } from '../localUiCommandCopy';
|
|
|
7
7
|
* display parameter also translates it when late words arrive, or when history
|
|
8
8
|
* is reopened in another app language; saved strings are never rewritten.
|
|
9
9
|
*/
|
|
10
|
-
export type LanguageReplyStep =
|
|
10
|
+
export type LanguageReplyStep = 'write' | 'wait' | 'grace';
|
|
11
11
|
/** How long an idle, still-untranslated language is given before displaying English. */
|
|
12
12
|
export declare const LANGUAGE_REPLY_GRACE_MS = 400;
|
|
13
13
|
/** The longest the reply waits for the new language at all. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type NameMatch<T> = {
|
|
2
|
-
kind:
|
|
2
|
+
kind: 'one';
|
|
3
3
|
item: T;
|
|
4
4
|
} | {
|
|
5
|
-
kind:
|
|
5
|
+
kind: 'many';
|
|
6
6
|
items: T[];
|
|
7
7
|
} | {
|
|
8
|
-
kind:
|
|
8
|
+
kind: 'none';
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Which of `items` a person means by `said`, judged on the product's own
|
|
@@ -24,7 +24,7 @@ export interface EnumFilterEntry {
|
|
|
24
24
|
apply: (value: string | null) => ControlResult;
|
|
25
25
|
}
|
|
26
26
|
export declare function enumFilter<V extends string>(spec: EnumFilterSpec<V>): EnumFilterEntry;
|
|
27
|
-
export declare function filtersOf(entries: readonly EnumFilterEntry[]): NonNullable<PageControlsAdapter[
|
|
27
|
+
export declare function filtersOf(entries: readonly EnumFilterEntry[]): NonNullable<PageControlsAdapter['filters']>;
|
|
28
28
|
export interface SortFieldSpec<V extends string> {
|
|
29
29
|
id: string;
|
|
30
30
|
label: string;
|
|
@@ -38,7 +38,7 @@ export interface SortSpec<V extends string> {
|
|
|
38
38
|
value: V;
|
|
39
39
|
set: (value: V) => void;
|
|
40
40
|
}
|
|
41
|
-
export declare function sortOf<V extends string>(spec: SortSpec<V>): NonNullable<PageControlsAdapter[
|
|
41
|
+
export declare function sortOf<V extends string>(spec: SortSpec<V>): NonNullable<PageControlsAdapter['sort']>;
|
|
42
42
|
export interface TabsSpec<T extends string> {
|
|
43
43
|
items: readonly {
|
|
44
44
|
id: T;
|
|
@@ -47,12 +47,12 @@ export interface TabsSpec<T extends string> {
|
|
|
47
47
|
value: T;
|
|
48
48
|
set: (id: T) => void;
|
|
49
49
|
}
|
|
50
|
-
export declare function tabsOf<T extends string>(spec: TabsSpec<T>): NonNullable<PageControlsAdapter[
|
|
51
|
-
export declare function searchOf(set: (query: string) => void): NonNullable<PageControlsAdapter[
|
|
50
|
+
export declare function tabsOf<T extends string>(spec: TabsSpec<T>): NonNullable<PageControlsAdapter['tabs']>;
|
|
51
|
+
export declare function searchOf(set: (query: string) => void): NonNullable<PageControlsAdapter['search']>;
|
|
52
52
|
/** One form or dialog the page can OPEN. `open` must only open it. */
|
|
53
53
|
export interface OpenerSpec {
|
|
54
54
|
id: string;
|
|
55
55
|
label: string;
|
|
56
56
|
open: () => void;
|
|
57
57
|
}
|
|
58
|
-
export declare function openersOf(specs: readonly OpenerSpec[]): NonNullable<PageControlsAdapter[
|
|
58
|
+
export declare function openersOf(specs: readonly OpenerSpec[]): NonNullable<PageControlsAdapter['openers']>;
|
|
@@ -7,124 +7,124 @@ import { ControlBlock, ControlKey, SortDirection } from './types';
|
|
|
7
7
|
*/
|
|
8
8
|
/** What the panel says, as data. `appControlCopy.ts` turns it into words. */
|
|
9
9
|
export type ControlReply = {
|
|
10
|
-
code:
|
|
10
|
+
code: 'opened';
|
|
11
11
|
what: OpenedWhat;
|
|
12
12
|
} | {
|
|
13
|
-
code:
|
|
13
|
+
code: 'closed';
|
|
14
14
|
what: ClosedWhat;
|
|
15
15
|
} | {
|
|
16
|
-
code:
|
|
16
|
+
code: 'search-opened';
|
|
17
17
|
query: string | null;
|
|
18
18
|
} | {
|
|
19
|
-
code:
|
|
19
|
+
code: 'sidebar';
|
|
20
20
|
collapsed: boolean;
|
|
21
21
|
already: boolean;
|
|
22
22
|
} | {
|
|
23
|
-
code:
|
|
23
|
+
code: 'sidebar-entry';
|
|
24
24
|
name: string;
|
|
25
25
|
expanded: boolean;
|
|
26
26
|
already: boolean;
|
|
27
27
|
} | {
|
|
28
|
-
code:
|
|
28
|
+
code: 'language';
|
|
29
29
|
label: string;
|
|
30
30
|
already: boolean;
|
|
31
31
|
} | {
|
|
32
|
-
code:
|
|
32
|
+
code: 'language-not-offered';
|
|
33
33
|
label: string;
|
|
34
34
|
} | {
|
|
35
|
-
code:
|
|
35
|
+
code: 'workspace-confirm';
|
|
36
36
|
name: string;
|
|
37
37
|
} | {
|
|
38
|
-
code:
|
|
38
|
+
code: 'workspace-switched';
|
|
39
39
|
name: string;
|
|
40
40
|
} | {
|
|
41
|
-
code:
|
|
41
|
+
code: 'workspace-already';
|
|
42
42
|
name: string;
|
|
43
43
|
} | {
|
|
44
|
-
code:
|
|
44
|
+
code: 'workspace-none';
|
|
45
45
|
} | {
|
|
46
|
-
code:
|
|
46
|
+
code: 'logout-confirm';
|
|
47
47
|
} | {
|
|
48
|
-
code:
|
|
48
|
+
code: 'logout-done';
|
|
49
49
|
} | {
|
|
50
|
-
code:
|
|
50
|
+
code: 'tab';
|
|
51
51
|
name: string;
|
|
52
52
|
already: boolean;
|
|
53
53
|
} | {
|
|
54
|
-
code:
|
|
54
|
+
code: 'filter-set';
|
|
55
55
|
filter: string;
|
|
56
56
|
option: string;
|
|
57
57
|
already: boolean;
|
|
58
58
|
} | {
|
|
59
|
-
code:
|
|
59
|
+
code: 'filter-cleared';
|
|
60
60
|
filter: string | null;
|
|
61
61
|
} | {
|
|
62
|
-
code:
|
|
62
|
+
code: 'sorted';
|
|
63
63
|
page: string;
|
|
64
64
|
field: string;
|
|
65
65
|
direction: SortDirection;
|
|
66
66
|
already: boolean;
|
|
67
67
|
} | {
|
|
68
|
-
code:
|
|
68
|
+
code: 'sort-needs-field';
|
|
69
69
|
} | {
|
|
70
|
-
code:
|
|
70
|
+
code: 'searched';
|
|
71
71
|
page: string;
|
|
72
72
|
query: string;
|
|
73
73
|
} | {
|
|
74
|
-
code:
|
|
74
|
+
code: 'search-cleared';
|
|
75
75
|
} | {
|
|
76
|
-
code:
|
|
76
|
+
code: 'form-opened';
|
|
77
77
|
name: string;
|
|
78
78
|
} | {
|
|
79
|
-
code:
|
|
79
|
+
code: 'not-found';
|
|
80
80
|
what: NotFoundKind;
|
|
81
81
|
page: string;
|
|
82
82
|
name: string;
|
|
83
83
|
options: string[];
|
|
84
84
|
filter?: string;
|
|
85
85
|
} | {
|
|
86
|
-
code:
|
|
86
|
+
code: 'ambiguous';
|
|
87
87
|
what: AmbiguousKind;
|
|
88
88
|
name: string;
|
|
89
89
|
options: string[];
|
|
90
90
|
} | {
|
|
91
|
-
code:
|
|
91
|
+
code: 'filter-choose';
|
|
92
92
|
filter: string;
|
|
93
93
|
options: string[];
|
|
94
94
|
} | {
|
|
95
|
-
code:
|
|
95
|
+
code: 'failed';
|
|
96
96
|
} | {
|
|
97
|
-
code:
|
|
97
|
+
code: 'blocked';
|
|
98
98
|
reason: ControlBlock;
|
|
99
99
|
};
|
|
100
|
-
export type OpenedWhat =
|
|
101
|
-
export type ClosedWhat =
|
|
102
|
-
export type NotFoundKind =
|
|
103
|
-
export type AmbiguousKind =
|
|
100
|
+
export type OpenedWhat = 'notifications' | 'help' | 'context' | 'history' | 'transcript' | 'preview' | 'conversation';
|
|
101
|
+
export type ClosedWhat = 'preview';
|
|
102
|
+
export type NotFoundKind = 'tab' | 'filter' | 'filter-option' | 'sort' | 'form' | 'workspace';
|
|
103
|
+
export type AmbiguousKind = 'tab' | 'filter' | 'menu' | 'workspace' | 'column' | 'form';
|
|
104
104
|
/** What is recorded on the exchange (`AssistantLocalAction`). */
|
|
105
|
-
export type ControlOutcome =
|
|
105
|
+
export type ControlOutcome = 'done' | 'already' | 'failed' | 'blocked' | 'not-found' | 'ambiguous' | 'confirm';
|
|
106
106
|
export interface ControlRun {
|
|
107
107
|
reply: ControlReply;
|
|
108
108
|
outcome: ControlOutcome;
|
|
109
109
|
}
|
|
110
110
|
/** What the stronger confirmation asks about. */
|
|
111
111
|
export type ConfirmPrompt = {
|
|
112
|
-
kind:
|
|
112
|
+
kind: 'logout';
|
|
113
113
|
} | {
|
|
114
|
-
kind:
|
|
114
|
+
kind: 'workspace';
|
|
115
115
|
name: string;
|
|
116
116
|
};
|
|
117
117
|
export type ControlPlan =
|
|
118
118
|
/** Nothing to run: say it. */
|
|
119
119
|
{
|
|
120
|
-
kind:
|
|
121
|
-
control: ControlKey |
|
|
120
|
+
kind: 'reply';
|
|
121
|
+
control: ControlKey | 'page';
|
|
122
122
|
run: ControlRun;
|
|
123
123
|
}
|
|
124
124
|
/** Run it now and say what happened. `silent`: record nothing (a new conversation). */
|
|
125
125
|
| {
|
|
126
|
-
kind:
|
|
127
|
-
control: ControlKey |
|
|
126
|
+
kind: 'run';
|
|
127
|
+
control: ControlKey | 'page';
|
|
128
128
|
run: () => ControlRun;
|
|
129
129
|
silent?: boolean;
|
|
130
130
|
}
|
|
@@ -133,7 +133,7 @@ export type ControlPlan =
|
|
|
133
133
|
* trusted press on the dialog's button — never from anything typed or said.
|
|
134
134
|
*/
|
|
135
135
|
| {
|
|
136
|
-
kind:
|
|
136
|
+
kind: 'confirm';
|
|
137
137
|
control: ControlKey;
|
|
138
138
|
ask: ControlRun;
|
|
139
139
|
prompt: ConfirmPrompt;
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
* called), not that everything it triggers has finished. The copy says so
|
|
31
31
|
* ("Switching to …", never "Switched to …") where the app's handler is async.
|
|
32
32
|
*/
|
|
33
|
-
export type ControlStatus =
|
|
33
|
+
export type ControlStatus = 'done' | 'already' | 'failed';
|
|
34
34
|
export interface ControlResult {
|
|
35
35
|
status: ControlStatus;
|
|
36
36
|
}
|
|
37
37
|
/** Why a registered control cannot run for this person, right now. */
|
|
38
38
|
export type ControlBlock =
|
|
39
39
|
/** RBAC or a feature gate: the person is not allowed to use it here. */
|
|
40
|
-
|
|
40
|
+
'permission'
|
|
41
41
|
/** Needs the live voice screen out of the way first (History, Preview, new conversation). */
|
|
42
|
-
|
|
|
42
|
+
| 'voice-session';
|
|
43
43
|
export interface ControlBase {
|
|
44
44
|
/**
|
|
45
45
|
* Null: it can run. Otherwise why not. Read at match time AND at run time —
|
|
@@ -111,7 +111,7 @@ export interface PageFilter {
|
|
|
111
111
|
/** The option now applied, or null for none. */
|
|
112
112
|
current?: () => string | null;
|
|
113
113
|
}
|
|
114
|
-
export type SortDirection =
|
|
114
|
+
export type SortDirection = 'asc' | 'desc';
|
|
115
115
|
export interface PageControlsAdapter extends ControlBase {
|
|
116
116
|
/**
|
|
117
117
|
* Which page this is, in the product's words ("Crops"). Said back to the
|
|
@@ -180,22 +180,22 @@ export interface PreviewControl extends OpenControl {
|
|
|
180
180
|
* assistant panel, which the live voice screen covers. "page": drawn on the
|
|
181
181
|
* product's own page beside the assistant, so Voice may open it.
|
|
182
182
|
*/
|
|
183
|
-
surface?:
|
|
183
|
+
surface?: 'panel' | 'page';
|
|
184
184
|
}
|
|
185
185
|
/** Every control key, and the handler shape it takes. */
|
|
186
186
|
export interface ControlMap {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
'header.notifications': OpenControl;
|
|
188
|
+
'header.search': SearchControl;
|
|
189
|
+
'header.help': OpenControl;
|
|
190
|
+
'header.context': OpenControl;
|
|
191
|
+
'header.workspace': WorkspaceControl;
|
|
192
|
+
'account.logout': LogoutControl;
|
|
193
193
|
sidebar: SidebarControl;
|
|
194
194
|
language: LanguageControl;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
'assistant.history': OpenControl;
|
|
196
|
+
'assistant.transcript': OpenControl;
|
|
197
|
+
'assistant.preview': PreviewControl;
|
|
198
|
+
'assistant.conversation.new': OpenControl;
|
|
199
199
|
page: PageControlsAdapter;
|
|
200
200
|
}
|
|
201
201
|
export type ControlKey = keyof ControlMap;
|
|
@@ -20,4 +20,4 @@ export declare function useAssistantControl<K extends ControlKey>(key: K, impl:
|
|
|
20
20
|
* its handlers call the page's own setters. The vocabulary has no submit, save,
|
|
21
21
|
* create or delete — see `types.ts`.
|
|
22
22
|
*/
|
|
23
|
-
export declare function useAssistantPageControls(adapter: ControlMap[
|
|
23
|
+
export declare function useAssistantPageControls(adapter: ControlMap['page'] | null): void;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* through Documents or Files here; anything else is a file it would have to
|
|
20
20
|
* refuse after the user had already chosen it.
|
|
21
21
|
*/
|
|
22
|
-
export type AttachmentSourceId =
|
|
22
|
+
export type AttachmentSourceId = 'camera' | 'gallery' | 'documents' | 'files';
|
|
23
23
|
export interface AttachmentSource {
|
|
24
24
|
id: AttachmentSourceId;
|
|
25
25
|
/** i18n key and the English fallback, resolved by the caller. */
|
|
@@ -33,7 +33,7 @@ export interface AttachmentSource {
|
|
|
33
33
|
* ignored on desktop, which falls back to the file picker rather than
|
|
34
34
|
* breaking.
|
|
35
35
|
*/
|
|
36
|
-
capture?:
|
|
36
|
+
capture?: 'environment' | 'user';
|
|
37
37
|
/** Multi-select. A camera capture is one shot at a time. */
|
|
38
38
|
multiple: boolean;
|
|
39
39
|
/**
|
|
@@ -61,14 +61,14 @@ export interface AssistantInlineLimitsConfig {
|
|
|
61
61
|
readonly maxInlineCharsPerFile?: number;
|
|
62
62
|
readonly maxInlineCharsTotal?: number;
|
|
63
63
|
}
|
|
64
|
-
export type AssistantAttachmentKind =
|
|
65
|
-
export type AssistantAttachmentStatus =
|
|
66
|
-
export type AttachmentRejection =
|
|
64
|
+
export type AssistantAttachmentKind = 'image' | 'text' | 'document';
|
|
65
|
+
export type AssistantAttachmentStatus = 'pending' | 'uploading' | 'ready' | 'error';
|
|
66
|
+
export type AttachmentRejection = 'too-many' | 'too-large' | 'empty' | 'unreadable' | 'unsupported-image'
|
|
67
67
|
/**
|
|
68
68
|
* Over the 5 MiB the browser can upload directly, and with no text to send inline instead: it
|
|
69
69
|
* could be neither saved to Files nor read, so it is refused at attach rather than failing at Send.
|
|
70
70
|
*/
|
|
71
|
-
|
|
|
71
|
+
| 'too-large-to-save';
|
|
72
72
|
/**
|
|
73
73
|
* Thrown while PREPARING a file (after it passed `validateFile`) to reject it
|
|
74
74
|
* with a specific reason rather than the generic 'unreadable'.
|
|
@@ -234,7 +234,7 @@ export declare function hasAttachmentWorkInFlight(preparingCount: number, attach
|
|
|
234
234
|
*/
|
|
235
235
|
export declare function getSendableAttachments(attachments: AssistantAttachment[]): AssistantAttachment[];
|
|
236
236
|
/** Why a draft cannot be sent yet, as far as its attachments are concerned. */
|
|
237
|
-
export type AttachmentSendBlocker =
|
|
237
|
+
export type AttachmentSendBlocker = 'in-flight' | 'failed';
|
|
238
238
|
/**
|
|
239
239
|
* Whether the attachments block sending, and why — `null` when they do not.
|
|
240
240
|
*
|
|
@@ -11,13 +11,13 @@ export declare const AUTO_READ_MODE = "assistant";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const AUTO_WRITE_MODE = "api-calls";
|
|
13
13
|
/** What a message asks for: a change to be made, or anything else. */
|
|
14
|
-
export type AssistantIntent =
|
|
14
|
+
export type AssistantIntent = 'act' | 'read';
|
|
15
15
|
/**
|
|
16
16
|
* Auto is offered only where there is something to route between: the product
|
|
17
17
|
* offers BOTH the read mode and the write mode to this person. `modes` must be
|
|
18
18
|
* the role-filtered list the selector shows, not the product's full list.
|
|
19
19
|
*/
|
|
20
|
-
export declare function isAutoRoutingOffered(modes: readonly Pick<AssistantModeConfig,
|
|
20
|
+
export declare function isAutoRoutingOffered(modes: readonly Pick<AssistantModeConfig, 'id'>[]): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Does this message ask for a change to be made?
|
|
23
23
|
*
|
|
@@ -62,16 +62,16 @@ export interface AutoRouteConversation {
|
|
|
62
62
|
* place, with a fresh backend session.
|
|
63
63
|
*/
|
|
64
64
|
export type AutoRoute = {
|
|
65
|
-
action:
|
|
65
|
+
action: 'new';
|
|
66
66
|
mode: AssistantMode;
|
|
67
67
|
} | {
|
|
68
|
-
action:
|
|
68
|
+
action: 'adopt';
|
|
69
69
|
mode: AssistantMode;
|
|
70
70
|
} | {
|
|
71
|
-
action:
|
|
71
|
+
action: 'continue';
|
|
72
72
|
mode: AssistantMode;
|
|
73
73
|
} | {
|
|
74
|
-
action:
|
|
74
|
+
action: 'escalate';
|
|
75
75
|
mode: AssistantMode;
|
|
76
76
|
};
|
|
77
77
|
export interface AutoRouteInput {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, RefObject } from 'react';
|
|
2
|
+
import { AssistantNavigate } from '../../ui/AssistantMarkdownRenderer';
|
|
3
|
+
import { LiveAvatarController, LiveAvatarSnapshot } from './liveAvatarController';
|
|
4
|
+
import { LiveAvatarMinutesPurchase } from './liveAvatarMinutesView';
|
|
5
|
+
/** How often the session's time left is redrawn while it runs (DESIGN 3.10: every 15 s). */
|
|
6
|
+
export declare const LIVE_AVATAR_MINUTES_REDRAW_MS = 15000;
|
|
7
|
+
export interface LiveAvatarMinutesProps {
|
|
8
|
+
readonly controller: LiveAvatarController;
|
|
9
|
+
/** The snapshot the tab read (one subscription per view). */
|
|
10
|
+
readonly snapshot: LiveAvatarSnapshot;
|
|
11
|
+
/** The host's purchase access (`LiveAvatarSeamOptions.minutesPurchase`). Absent: nobody is offered a purchase here. */
|
|
12
|
+
readonly minutesPurchase?: LiveAvatarMinutesPurchase | undefined;
|
|
13
|
+
/** The panel's navigator. Absent or null: nothing opens billing. */
|
|
14
|
+
readonly navigate?: AssistantNavigate | null | undefined;
|
|
15
|
+
/** Wall-clock milliseconds. */
|
|
16
|
+
readonly now: () => number;
|
|
17
|
+
/** The id of the region's words: a Turn on the minutes hold back is described by them. */
|
|
18
|
+
readonly textId: string;
|
|
19
|
+
/** The tab's view, focusable: it takes the focus when a control here goes while it holds it. A ref the tab keeps (stable). */
|
|
20
|
+
readonly viewRef: RefObject<HTMLElement | null>;
|
|
21
|
+
/** How often the session's time left is redrawn. Tests pass their own. */
|
|
22
|
+
readonly redrawMs?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const LiveAvatarMinutes: FC<LiveAvatarMinutesProps>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useAvatarCopy as e } from "../useAvatarCopy.js";
|
|
2
|
+
import { LIVE_AVATAR_MINUTES_REFRESH_MS as t, LIVE_AVATAR_REQUEST_TIMEOUT_MS as n } from "./liveAvatarController.js";
|
|
3
|
+
import { LIVE_AVATAR_MINUTES_PLANS_PATH as r, liveAvatarMinutesView as i } from "./liveAvatarMinutesView.js";
|
|
4
|
+
import { useCallback as a, useEffect as o, useId as ee, useRef as s, useState as c } from "react";
|
|
5
|
+
import { ChevronDown as l } from "lucide-react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
//#region src/shared/assistant/avatar/live/LiveAvatarMinutes.tsx
|
|
8
|
+
var f = 15e3, p = t + n, m = "text-xs text-text-muted", h = "focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong", g = `inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-xl border border-border-default bg-bg-elevated px-4 text-sm font-medium text-text-primary transition-colors hover:bg-bg-raised aria-disabled:cursor-default aria-disabled:opacity-60 aria-disabled:hover:bg-bg-elevated ${h}`, _ = `inline-flex min-h-11 items-center gap-1 self-start rounded-lg text-xs font-medium text-text-secondary transition-colors hover:text-text-primary ${h}`, te = { status: "absent" }, v = { status: "asking" }, y = { status: "failed" };
|
|
9
|
+
function b(e) {
|
|
10
|
+
if (typeof e != "object" || !e || !("canPurchase" in e)) return y;
|
|
11
|
+
let { canPurchase: t } = e;
|
|
12
|
+
return typeof t == "boolean" ? {
|
|
13
|
+
status: "answered",
|
|
14
|
+
access: { canPurchase: t }
|
|
15
|
+
} : y;
|
|
16
|
+
}
|
|
17
|
+
var x = { status: "idle" }, S = ({ controller: t, snapshot: n, minutesPurchase: h, navigate: S, now: C, textId: w, viewRef: T, redrawMs: E = f }) => {
|
|
18
|
+
let D = e(), O = ee(), [k, A] = c(!1), j = s(!0);
|
|
19
|
+
o(() => (j.current = !0, () => {
|
|
20
|
+
j.current = !1;
|
|
21
|
+
}), []);
|
|
22
|
+
let M = a((e) => {
|
|
23
|
+
if (e !== null) return () => {
|
|
24
|
+
e.contains(e.ownerDocument.activeElement) && T.current?.focus();
|
|
25
|
+
};
|
|
26
|
+
}, [T]), N = h !== void 0 && S != null, [P, F] = c(x), I = s(null), L = n.minutes === null;
|
|
27
|
+
o(() => {
|
|
28
|
+
L && (I.current = null, F(x));
|
|
29
|
+
}, [L]);
|
|
30
|
+
let [R, z] = c(null), B = s(n.minutes?.balance?.availableMinutes ?? 0), V = s(n.purchase);
|
|
31
|
+
o(() => {
|
|
32
|
+
let e = V.current;
|
|
33
|
+
V.current = n.purchase, n.purchase === "checking" && e !== "checking" ? (B.current = n.minutes?.balance?.availableMinutes ?? 0, z(null)) : n.purchase === "idle" && e === "checking" && z({
|
|
34
|
+
kind: (n.minutes?.balance?.availableMinutes ?? 0) > B.current ? "seen" : "not-seen",
|
|
35
|
+
minutes: n.minutes
|
|
36
|
+
});
|
|
37
|
+
}, [n.purchase, n.minutes]);
|
|
38
|
+
let H = R !== null && R.minutes === n.minutes ? R.kind : null, [U, W] = c(null), [G, K] = c(null), q = U !== null && U.minutes === n.minutes, J = G !== null && G.minutes === n.minutes;
|
|
39
|
+
o(() => {
|
|
40
|
+
if (U === null) return;
|
|
41
|
+
if (!q) {
|
|
42
|
+
W(null), K({ minutes: n.minutes });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let e = setTimeout(() => W(null), p);
|
|
46
|
+
return () => clearTimeout(e);
|
|
47
|
+
}, [
|
|
48
|
+
U,
|
|
49
|
+
q,
|
|
50
|
+
n.minutes
|
|
51
|
+
]);
|
|
52
|
+
let Y = n.phase === "ready" && !n.closing && n.sessionEndsAt !== null, [, X] = c(0);
|
|
53
|
+
o(() => {
|
|
54
|
+
if (!Y) return;
|
|
55
|
+
let e = setInterval(() => X((e) => e + 1), E);
|
|
56
|
+
return () => clearInterval(e);
|
|
57
|
+
}, [Y, E]);
|
|
58
|
+
let Z = i({
|
|
59
|
+
snapshot: n,
|
|
60
|
+
access: N ? P.status === "idle" ? v : P : te,
|
|
61
|
+
purchaseOutcome: H,
|
|
62
|
+
rechecked: J,
|
|
63
|
+
now: C()
|
|
64
|
+
}, D), Q = N && Z !== null && Z.wantsAccess, $ = Z?.action ?? null;
|
|
65
|
+
o(() => {
|
|
66
|
+
if (!Q || P.status !== "idle" || I.current !== null || h === void 0) return;
|
|
67
|
+
let e = Symbol("access");
|
|
68
|
+
I.current = e, F(v);
|
|
69
|
+
let t = (t) => {
|
|
70
|
+
!j.current || I.current !== e || (I.current = null, F(t));
|
|
71
|
+
};
|
|
72
|
+
Promise.resolve().then(() => h.access()).then((e) => t(b(e)), () => t(y));
|
|
73
|
+
}, [
|
|
74
|
+
Q,
|
|
75
|
+
P.status,
|
|
76
|
+
h
|
|
77
|
+
]);
|
|
78
|
+
let ne = a((e) => {
|
|
79
|
+
S && (z(null), Promise.resolve(S(e, "person", { surface: "avatar-minutes" })).catch(() => void 0));
|
|
80
|
+
}, [S]);
|
|
81
|
+
if (Z === null) return null;
|
|
82
|
+
let re = (e) => {
|
|
83
|
+
switch (e) {
|
|
84
|
+
case "see-plans":
|
|
85
|
+
ne(r);
|
|
86
|
+
return;
|
|
87
|
+
case "check-again":
|
|
88
|
+
if (q) return;
|
|
89
|
+
W({ minutes: n.minutes }), K(null), t.refreshMinutes();
|
|
90
|
+
return;
|
|
91
|
+
case "check-purchase-again":
|
|
92
|
+
t.checkMinutesPurchase();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}, ie = (e) => {
|
|
96
|
+
switch (e) {
|
|
97
|
+
case "see-plans": return D.minutes.seePlans;
|
|
98
|
+
case "check-again": return q ? D.minutes.checking : D.minutes.checkAgain;
|
|
99
|
+
case "check-purchase-again": return D.minutes.checkAgain;
|
|
100
|
+
}
|
|
101
|
+
}, ae = D.minutes.howCounted(Z.staleSeconds);
|
|
102
|
+
return /* @__PURE__ */ d("div", {
|
|
103
|
+
ref: M,
|
|
104
|
+
className: "flex flex-col gap-1.5",
|
|
105
|
+
"data-testid": "assistant-avatar-tab-minutes",
|
|
106
|
+
"data-state": Z.state,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ d("div", {
|
|
109
|
+
id: w,
|
|
110
|
+
className: "flex flex-col gap-0.5",
|
|
111
|
+
children: [Z.headline === null ? null : /* @__PURE__ */ u("p", {
|
|
112
|
+
className: "text-sm text-text-primary",
|
|
113
|
+
"data-testid": "assistant-avatar-tab-minutes-headline",
|
|
114
|
+
children: Z.headline
|
|
115
|
+
}), Z.details.map((e) => /* @__PURE__ */ u("p", {
|
|
116
|
+
className: m,
|
|
117
|
+
"data-testid": "assistant-avatar-tab-minutes-detail",
|
|
118
|
+
children: e
|
|
119
|
+
}, e))]
|
|
120
|
+
}),
|
|
121
|
+
$ === null ? null : /* @__PURE__ */ u("button", {
|
|
122
|
+
ref: M,
|
|
123
|
+
type: "button",
|
|
124
|
+
onClick: () => re($),
|
|
125
|
+
"aria-disabled": $ === "check-again" && q,
|
|
126
|
+
className: g,
|
|
127
|
+
"data-testid": "assistant-avatar-tab-minutes-action",
|
|
128
|
+
"data-action": $,
|
|
129
|
+
children: ie($)
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ d("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
onClick: () => A((e) => !e),
|
|
134
|
+
"aria-expanded": k,
|
|
135
|
+
"aria-controls": O,
|
|
136
|
+
className: _,
|
|
137
|
+
"data-testid": "assistant-avatar-tab-minutes-how",
|
|
138
|
+
children: [/* @__PURE__ */ u("span", { children: D.minutes.howCountedTitle }), /* @__PURE__ */ u(l, {
|
|
139
|
+
className: `size-4 shrink-0 transition-transform ${k ? "rotate-180" : ""}`,
|
|
140
|
+
"aria-hidden": "true"
|
|
141
|
+
})]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ u("ul", {
|
|
144
|
+
id: O,
|
|
145
|
+
hidden: !k,
|
|
146
|
+
className: "flex list-disc flex-col gap-1 ps-5 text-xs text-text-secondary",
|
|
147
|
+
"data-testid": "assistant-avatar-tab-minutes-how-text",
|
|
148
|
+
children: ae.map((e) => /* @__PURE__ */ u("li", { children: e }, e))
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ u("p", {
|
|
151
|
+
className: "sr-only",
|
|
152
|
+
"aria-live": "polite",
|
|
153
|
+
"aria-atomic": "true",
|
|
154
|
+
"data-testid": "assistant-avatar-tab-minutes-live",
|
|
155
|
+
children: Z.announcement ?? ""
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
export { f as LIVE_AVATAR_MINUTES_REDRAW_MS, S as LiveAvatarMinutes };
|