@codingame/monaco-vscode-chat-service-override 38.0.7 → 38.1.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/common.js +0 -53
- package/index.js +0 -3
- package/package.json +5 -5
- package/session.js +0 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +1 -1
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.d.ts +0 -135
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.js +0 -510
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +0 -22
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +0 -21
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.d.ts +0 -273
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.js +0 -61
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.d.ts +0 -7
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.js +0 -17
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.d.ts +0 -12
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.js +0 -48
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.d.ts +0 -8
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js +0 -11
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.d.ts +0 -114
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.js +0 -141
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.d.ts +0 -48
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.js +0 -238
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.js +0 -260
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.js +0 -115
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.d.ts +0 -46
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.js +0 -92
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -9
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +0 -14
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +0 -385
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +0 -67
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +0 -695
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +0 -4
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +0 -39
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +0 -59
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +0 -83
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +0 -87
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +0 -176
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +0 -422
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +0 -2444
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +0 -91
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +0 -620
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +0 -5
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +0 -46
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +0 -321
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +0 -104
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +0 -345
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +0 -611
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +0 -85
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +0 -200
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +0 -981
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +0 -206
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +0 -368
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +0 -57
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +0 -98
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +0 -186
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +0 -116
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +0 -226
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +0 -138
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +0 -29
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +0 -108
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +0 -63
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +0 -252
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +0 -178
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +0 -322
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +0 -146
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +0 -890
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +0 -132
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +0 -237
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +0 -120
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +0 -234
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +0 -164
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.js +0 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.js +0 -561
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.d.ts +0 -133
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.js +0 -1176
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.d.ts +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.js +0 -220
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.js +0 -184
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.js +0 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.d.ts +0 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.js +0 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.js +0 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.d.ts +0 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.js +0 -838
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.js +0 -604
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.d.ts +0 -289
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.js +0 -497
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.js +0 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.js +0 -398
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.js +0 -296
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +0 -361
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +0 -198
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +0 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +0 -871
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +0 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +0 -297
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +0 -118
|
@@ -1,981 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { $, addDisposableListener, getWindow, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
3
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
4
|
-
import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { AGENTS_VOICE_WINDOW_DEFAULT_WIDTH, AGENTS_VOICE_WINDOW_DEFAULT_HEIGHT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/agentsVoice/common/agentsVoice';
|
|
7
|
-
import { createHeader } from './components/headerComponent.js';
|
|
8
|
-
import { createStatusRows } from './components/statusRowsComponent.js';
|
|
9
|
-
import { createTranscript } from './components/transcriptComponent.js';
|
|
10
|
-
import { createSessionList } from './components/sessionListComponent.js';
|
|
11
|
-
import { createFeedbackDialog } from './components/feedbackDialog.js';
|
|
12
|
-
import { createOnboarding } from './components/onboardingComponent.js';
|
|
13
|
-
import { createVoiceBar } from './components/voiceBarComponent.js';
|
|
14
|
-
import { FONT_SIZE, addKeyboardActivation, isSecondaryPointerGesture } from './components/tokens.js';
|
|
15
|
-
import { computeVoiceMicGlowBoxShadow, voiceGlowStateColor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/voiceClient/voiceGlow';
|
|
16
|
-
import { createVoiceGlowController } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/voiceClient/voiceGlowController';
|
|
17
|
-
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
18
|
-
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
19
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
20
|
-
|
|
21
|
-
const DEFAULT_OPTIONS = {
|
|
22
|
-
width: AGENTS_VOICE_WINDOW_DEFAULT_WIDTH,
|
|
23
|
-
draggable: true,
|
|
24
|
-
showClose: true,
|
|
25
|
-
showExpandChevron: true,
|
|
26
|
-
showStatusText: false,
|
|
27
|
-
showStatusCounters: true,
|
|
28
|
-
showCopilotIcon: false,
|
|
29
|
-
centerConnectButton: false,
|
|
30
|
-
title: "",
|
|
31
|
-
subtitle: "",
|
|
32
|
-
focusable: false,
|
|
33
|
-
showOnboarding: false,
|
|
34
|
-
reshowOnboardingOnDisconnect: false,
|
|
35
|
-
defaultExpanded: false,
|
|
36
|
-
inputBoxLayout: false
|
|
37
|
-
};
|
|
38
|
-
class AgentsVoiceWidget extends Disposable {
|
|
39
|
-
constructor(container, callbacks, options = {}) {
|
|
40
|
-
super();
|
|
41
|
-
this.container = container;
|
|
42
|
-
this.callbacks = callbacks;
|
|
43
|
-
this._isConnected = observableValue(this, false);
|
|
44
|
-
this._isConnecting = observableValue(this, false);
|
|
45
|
-
this._isReconnecting = observableValue(this, false);
|
|
46
|
-
this._isMuted = observableValue(this, false);
|
|
47
|
-
this._voiceState = observableValue(this, "idle");
|
|
48
|
-
this._expanded = observableValue(this, false);
|
|
49
|
-
this._workingCount = observableValue(this, 0);
|
|
50
|
-
this._needsInputCount = observableValue(this, 0);
|
|
51
|
-
this._doneCount = observableValue(this, 0);
|
|
52
|
-
this._pendingToolConfirmations = observableValue(this, []);
|
|
53
|
-
this._speakingSession = observableValue(this, undefined);
|
|
54
|
-
this._speakingSessionLabel = observableValue(this, undefined);
|
|
55
|
-
this._sessions = observableValue(this, []);
|
|
56
|
-
this._sessionGroups = observableValue(this, undefined);
|
|
57
|
-
this._selectedTargetSession = observableValue(this, undefined);
|
|
58
|
-
this._transcriptTurns = observableValue(this, []);
|
|
59
|
-
this._pttKeyLabel = observableValue(this, undefined);
|
|
60
|
-
this._statusText = observableValue(this, "");
|
|
61
|
-
this._popoutAvailable = observableValue(this, true);
|
|
62
|
-
this._feedbackDialogState = observableValue(this, null);
|
|
63
|
-
this._showOnboarding = observableValue(this, false);
|
|
64
|
-
this._onboardingPendingConnect = observableValue(this, false);
|
|
65
|
-
this._shouldShowExpanded = derived(this, reader => this._expanded.read(reader));
|
|
66
|
-
this._headerComponent = createHeader();
|
|
67
|
-
this._onboardingComponent = createOnboarding();
|
|
68
|
-
this._feedbackDialogComponent = createFeedbackDialog();
|
|
69
|
-
this._voiceBarComponent = createVoiceBar();
|
|
70
|
-
this._transcriptComponent = this._register(createTranscript());
|
|
71
|
-
this._inputBoxTranscriptComponent = this._register(createTranscript());
|
|
72
|
-
this._statusRowsComponent = createStatusRows();
|
|
73
|
-
this._sessionListComponent = createSessionList();
|
|
74
|
-
this._options = {
|
|
75
|
-
...DEFAULT_OPTIONS,
|
|
76
|
-
...options
|
|
77
|
-
};
|
|
78
|
-
this._showOnboarding.set(this._options.showOnboarding, undefined);
|
|
79
|
-
this._expanded.set(this._options.defaultExpanded, undefined);
|
|
80
|
-
const opts = this._options;
|
|
81
|
-
const widthStyle = opts.width === "auto" ? "width:100%;position:relative;" : `position:absolute;top:0;left:0;width:${opts.width}px;${opts.inputBoxLayout ? "" : `min-height:${AGENTS_VOICE_WINDOW_DEFAULT_HEIGHT}px;`}`;
|
|
82
|
-
this._rootDiv = $("div");
|
|
83
|
-
this._rootDiv.style.cssText = `${widthStyle}display:flex;flex-direction:column;user-select:none;font-family:inherit;font-size:${FONT_SIZE.base};color:var(--vscode-foreground);box-sizing:border-box;margin:0;${opts.inputBoxLayout && opts.draggable ? "-webkit-app-region:drag;" : ""}`;
|
|
84
|
-
this._glowDiv = $("div");
|
|
85
|
-
this._glowDiv.style.cssText = "position:absolute;top:0;left:0;right:0;height:50px;pointer-events:none;z-index:0;";
|
|
86
|
-
this._titleRow = $("div");
|
|
87
|
-
this._titleRow.style.cssText = "display:flex;align-items:baseline;gap:6px;padding:8px 14px 0;overflow:hidden;white-space:nowrap;position:relative;z-index:1;";
|
|
88
|
-
if (opts.title) {
|
|
89
|
-
const titleSpan = $("span");
|
|
90
|
-
titleSpan.style.cssText = `font-size:${FONT_SIZE.micro};font-weight:700;color:var(--vscode-sideBarSectionHeader-foreground, var(--vscode-foreground));text-transform:uppercase;letter-spacing:0.5px;flex-shrink:0;user-select:none;`;
|
|
91
|
-
titleSpan.textContent = opts.title;
|
|
92
|
-
this._titleRow.append(titleSpan);
|
|
93
|
-
if (opts.subtitle) {
|
|
94
|
-
const subtitleSpan = $("span");
|
|
95
|
-
subtitleSpan.style.cssText = `font-size:${FONT_SIZE.micro};font-weight:400;color:var(--vscode-descriptionForeground);overflow:hidden;text-overflow:ellipsis;`;
|
|
96
|
-
subtitleSpan.textContent = opts.subtitle;
|
|
97
|
-
this._titleRow.append(subtitleSpan);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
this._contentDiv = $("div");
|
|
101
|
-
this._contentDiv.style.cssText = "display:flex;flex-direction:column;flex:1;padding:8px 14px 2px;position:relative;z-index:1;";
|
|
102
|
-
this._statusTextDiv = $("div");
|
|
103
|
-
this._statusTextDiv.style.cssText = `text-align:center;font-size:${FONT_SIZE.body};font-weight:500;color:var(--vscode-foreground);padding:2px 0;`;
|
|
104
|
-
this._sessionListWrapper = $("div");
|
|
105
|
-
this._sessionListWrapper.style.cssText = "display:flex;flex-direction:column;-webkit-app-region:no-drag;overflow:hidden;";
|
|
106
|
-
this._sessionListWrapper.append(this._sessionListComponent.element);
|
|
107
|
-
this._expandSpacer = $("div");
|
|
108
|
-
this._expandSpacer.style.cssText = "flex:1;";
|
|
109
|
-
this._chevronWrapper = $("div");
|
|
110
|
-
this._chevronWrapper.role = "button";
|
|
111
|
-
this._chevronWrapper.tabIndex = 0;
|
|
112
|
-
this._chevronWrapper.style.cssText = "display:flex;justify-content:center;cursor:pointer;-webkit-app-region:no-drag;";
|
|
113
|
-
this._chevronIcon = $("span.codicon");
|
|
114
|
-
this._chevronIcon.style.cssText = `font-size:${FONT_SIZE.iconSm};color:var(--vscode-descriptionForeground);`;
|
|
115
|
-
this._register(addDisposableListener(this._chevronIcon, "mouseenter", () => {
|
|
116
|
-
this._chevronIcon.style.color = "var(--vscode-foreground)";
|
|
117
|
-
}));
|
|
118
|
-
this._register(addDisposableListener(this._chevronIcon, "mouseleave", () => {
|
|
119
|
-
this._chevronIcon.style.color = "var(--vscode-descriptionForeground)";
|
|
120
|
-
}));
|
|
121
|
-
this._chevronWrapper.append(this._chevronIcon);
|
|
122
|
-
this._register(addDisposableListener(this._chevronWrapper, "click", e => {
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
if (this.callbacks.showSessionsPicker) {
|
|
126
|
-
this.callbacks.showSessionsPicker();
|
|
127
|
-
} else {
|
|
128
|
-
this._expanded.set(!this._expanded.get(), undefined);
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
this._register(addDisposableListener(this._chevronWrapper, "keydown", e => {
|
|
132
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
133
|
-
e.preventDefault();
|
|
134
|
-
this._chevronWrapper.click();
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
if (opts.inputBoxLayout) {
|
|
138
|
-
const styleEl = $("style");
|
|
139
|
-
styleEl.textContent = `
|
|
140
|
-
@property --voice-processing-angle { syntax: '<angle>'; inherits: false; initial-value: 135deg; }
|
|
141
|
-
@keyframes voice-processing-spin { from { --voice-processing-angle: 135deg; } to { --voice-processing-angle: 495deg; } }
|
|
142
|
-
@keyframes agents-voice-input-icon-pulse {
|
|
143
|
-
0%, 100% { box-shadow: 0 0 4px rgba(var(--agents-voice-input-icon-rgb, 88,166,255), 0.45); }
|
|
144
|
-
50% { box-shadow: 0 0 10px rgba(var(--agents-voice-input-icon-rgb, 88,166,255), 0.75); }
|
|
145
|
-
}
|
|
146
|
-
.monaco-workbench.monaco-enable-motion .agents-voice-mode-button.agents-voice-mode-active {
|
|
147
|
-
animation: agents-voice-input-icon-pulse 1.4s ease-in-out infinite;
|
|
148
|
-
}
|
|
149
|
-
.processing { overflow: visible !important; }
|
|
150
|
-
.processing::before {
|
|
151
|
-
content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
|
|
152
|
-
background: conic-gradient(from var(--voice-processing-angle),
|
|
153
|
-
transparent 0deg, rgba(88,166,255,0.9) 20deg, rgba(88,166,255,1) 30deg,
|
|
154
|
-
rgba(88,166,255,0.6) 50deg, transparent 90deg, transparent 360deg);
|
|
155
|
-
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
156
|
-
mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
157
|
-
-webkit-mask-composite: xor; mask-composite: exclude;
|
|
158
|
-
animation: voice-processing-spin 3s linear infinite;
|
|
159
|
-
pointer-events: none; z-index: 2;
|
|
160
|
-
}
|
|
161
|
-
.processing::after {
|
|
162
|
-
content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 2px;
|
|
163
|
-
background: conic-gradient(from var(--voice-processing-angle),
|
|
164
|
-
transparent 0deg, rgba(88,166,255,0.5) 25deg, rgba(88,166,255,0.3) 50deg, transparent 90deg, transparent 360deg);
|
|
165
|
-
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
166
|
-
mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
167
|
-
-webkit-mask-composite: xor; mask-composite: exclude;
|
|
168
|
-
filter: blur(1.5px); animation: voice-processing-spin 3s linear infinite;
|
|
169
|
-
pointer-events: none; z-index: 1;
|
|
170
|
-
}
|
|
171
|
-
`;
|
|
172
|
-
getWindow(this.container).document.head.append(styleEl);
|
|
173
|
-
this._inputBoxContainer = $("div");
|
|
174
|
-
this._inputBoxContainer.style.cssText = "box-sizing:border-box;background-color:var(--vscode-input-background);border:1px solid var(--vscode-input-border, transparent);border-radius:var(--vscode-cornerRadius-large, 8px);padding:10px 12px;width:100%;position:relative;min-height:32px;display:flex;align-items:center;-webkit-app-region:no-drag;";
|
|
175
|
-
this._inputBoxPlaceholder = $("span");
|
|
176
|
-
this._inputBoxPlaceholder.style.cssText = `font-size:${FONT_SIZE.body};color:var(--vscode-input-placeholderForeground, var(--vscode-descriptionForeground));user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;`;
|
|
177
|
-
this._inputBoxTranscriptComponent.element.style.width = "100%";
|
|
178
|
-
this._inputBoxTranscriptComponent.element.style.display = "none";
|
|
179
|
-
this._inputBoxContainer.append(this._inputBoxPlaceholder, this._inputBoxTranscriptComponent.element);
|
|
180
|
-
this._glowController = this._register(createVoiceGlowController(
|
|
181
|
-
this._inputBoxContainer,
|
|
182
|
-
() => this.callbacks.getGlowTheme(),
|
|
183
|
-
() => this.callbacks.getGlowColors()
|
|
184
|
-
));
|
|
185
|
-
this._register(
|
|
186
|
-
this.callbacks.onDidChangeGlowTheme(() => this._glowController?.refreshTheme())
|
|
187
|
-
);
|
|
188
|
-
this._inputBoxToolbar = $("div");
|
|
189
|
-
this._inputBoxToolbar.style.cssText = "display:flex;align-items:center;gap:8px;padding:6px 4px 2px;-webkit-app-region:no-drag;";
|
|
190
|
-
const toolbarBtn = (className, ariaLabel, title) => {
|
|
191
|
-
const el = $(`span.codicon.${className}`);
|
|
192
|
-
el.role = "button";
|
|
193
|
-
el.tabIndex = 0;
|
|
194
|
-
el.ariaLabel = ariaLabel;
|
|
195
|
-
el.title = title;
|
|
196
|
-
el.style.cssText = `font-size:${FONT_SIZE.iconSm};color:var(--vscode-descriptionForeground);cursor:pointer;-webkit-app-region:no-drag;padding:2px;`;
|
|
197
|
-
this._register(addDisposableListener(el, "mouseenter", () => {
|
|
198
|
-
el.style.color = "var(--vscode-foreground)";
|
|
199
|
-
}));
|
|
200
|
-
this._register(addDisposableListener(el, "mouseleave", () => {
|
|
201
|
-
el.style.color = "var(--vscode-descriptionForeground)";
|
|
202
|
-
}));
|
|
203
|
-
addKeyboardActivation(el);
|
|
204
|
-
return el;
|
|
205
|
-
};
|
|
206
|
-
this._inputBoxMicBtn = $("span.codicon.codicon-voice-mode.agents-voice-mode-button");
|
|
207
|
-
this._inputBoxMicBtn.role = "button";
|
|
208
|
-
this._inputBoxMicBtn.tabIndex = 0;
|
|
209
|
-
this._inputBoxMicBtn.ariaLabel = ( localize(8679, "Push to talk (Space)"));
|
|
210
|
-
this._inputBoxMicBtn.title = ( localize(8679, "Push to talk (Space)"));
|
|
211
|
-
this._inputBoxMicBtn.style.cssText = `font-size:${FONT_SIZE.iconMd};cursor:pointer;-webkit-app-region:no-drag;border-radius:4px;padding:2px;`;
|
|
212
|
-
this._register(addDisposableListener(this._inputBoxMicBtn, "contextmenu", e => {
|
|
213
|
-
e.preventDefault();
|
|
214
|
-
e.stopPropagation();
|
|
215
|
-
this.callbacks.showVoiceContextMenu(e);
|
|
216
|
-
}));
|
|
217
|
-
this._inputBoxConnIndicator = toolbarBtn("codicon-debug-connected", ( localize(8680, "Disconnect")), ( localize(8680, "Disconnect")));
|
|
218
|
-
this._inputBoxMuteBtn = $("span.codicon.codicon-mic");
|
|
219
|
-
this._inputBoxMuteBtn.role = "button";
|
|
220
|
-
this._inputBoxMuteBtn.tabIndex = 0;
|
|
221
|
-
this._inputBoxMuteBtn.style.cssText = `font-size:${FONT_SIZE.iconSm};color:var(--vscode-descriptionForeground);cursor:pointer;-webkit-app-region:no-drag;padding:2px;`;
|
|
222
|
-
addKeyboardActivation(this._inputBoxMuteBtn);
|
|
223
|
-
this._inputBoxFeedbackBtn = toolbarBtn("codicon-feedback", ( localize(8681, "Send feedback")), ( localize(8681, "Send feedback")));
|
|
224
|
-
this._inputBoxSessionsBtn = toolbarBtn("codicon-list-tree", ( localize(8682, "Sessions")), ( localize(8682, "Sessions")));
|
|
225
|
-
this._register(addDisposableListener(this._inputBoxSessionsBtn, "click", e => {
|
|
226
|
-
e.preventDefault();
|
|
227
|
-
e.stopPropagation();
|
|
228
|
-
this._expanded.set(!this._expanded.get(), undefined);
|
|
229
|
-
}));
|
|
230
|
-
this._inputBoxCloseBtn = toolbarBtn("codicon-chrome-minimize", ( localize(8683, "Minimize")), ( localize(8683, "Minimize")));
|
|
231
|
-
const toolbarSpacer = $("span");
|
|
232
|
-
toolbarSpacer.style.flex = "1";
|
|
233
|
-
this._inputBoxToolbar.append(
|
|
234
|
-
this._inputBoxMicBtn,
|
|
235
|
-
this._inputBoxConnIndicator,
|
|
236
|
-
this._inputBoxMuteBtn,
|
|
237
|
-
toolbarSpacer,
|
|
238
|
-
this._inputBoxFeedbackBtn,
|
|
239
|
-
this._inputBoxSessionsBtn,
|
|
240
|
-
this._inputBoxCloseBtn
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
if (opts.inputBoxLayout) {
|
|
244
|
-
this._contentDiv.append(
|
|
245
|
-
this._onboardingComponent.element,
|
|
246
|
-
this._feedbackDialogComponent.element,
|
|
247
|
-
this._inputBoxToolbar,
|
|
248
|
-
this._transcriptComponent.element,
|
|
249
|
-
this._sessionListWrapper,
|
|
250
|
-
this._statusRowsComponent.element,
|
|
251
|
-
this._inputBoxContainer
|
|
252
|
-
);
|
|
253
|
-
} else {
|
|
254
|
-
this._contentDiv.append(
|
|
255
|
-
this._onboardingComponent.element,
|
|
256
|
-
this._headerComponent.element,
|
|
257
|
-
this._voiceBarComponent.element,
|
|
258
|
-
this._feedbackDialogComponent.element,
|
|
259
|
-
this._statusTextDiv,
|
|
260
|
-
this._transcriptComponent.element,
|
|
261
|
-
this._statusRowsComponent.element,
|
|
262
|
-
this._sessionListWrapper,
|
|
263
|
-
this._expandSpacer,
|
|
264
|
-
this._chevronWrapper
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
this._rootDiv.append(this._glowDiv, this._titleRow, this._contentDiv);
|
|
268
|
-
this.container.append(this._rootDiv);
|
|
269
|
-
if (this._options.focusable) {
|
|
270
|
-
this.container.tabIndex = 0;
|
|
271
|
-
const win = getWindow(this.container);
|
|
272
|
-
let pttKeyCode;
|
|
273
|
-
let heldKeyCode;
|
|
274
|
-
let releasedBeforeListening = false;
|
|
275
|
-
const onDocKeydown = e => {
|
|
276
|
-
heldKeyCode = e.code;
|
|
277
|
-
releasedBeforeListening = false;
|
|
278
|
-
};
|
|
279
|
-
const onDocKeyup = e => {
|
|
280
|
-
if (e.code === heldKeyCode) {
|
|
281
|
-
heldKeyCode = undefined;
|
|
282
|
-
if (pttKeyCode === undefined) {
|
|
283
|
-
releasedBeforeListening = true;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
win.document.addEventListener("keydown", onDocKeydown, true);
|
|
288
|
-
win.document.addEventListener("keyup", onDocKeyup, true);
|
|
289
|
-
this._register(toDisposable(() => {
|
|
290
|
-
win.document.removeEventListener("keydown", onDocKeydown, true);
|
|
291
|
-
win.document.removeEventListener("keyup", onDocKeyup, true);
|
|
292
|
-
}));
|
|
293
|
-
this._register(addDisposableListener(this.container, "keydown", e => {
|
|
294
|
-
if (!_isTextInput(e.target) && pttKeyCode && e.code === pttKeyCode) {
|
|
295
|
-
e.preventDefault();
|
|
296
|
-
}
|
|
297
|
-
}));
|
|
298
|
-
this._register(addDisposableListener(this.container, "keyup", e => {
|
|
299
|
-
if (!_isTextInput(e.target) && pttKeyCode && e.code === pttKeyCode) {
|
|
300
|
-
e.preventDefault();
|
|
301
|
-
pttKeyCode = undefined;
|
|
302
|
-
this.callbacks.pttUp();
|
|
303
|
-
}
|
|
304
|
-
}));
|
|
305
|
-
let wasListening = false;
|
|
306
|
-
this._register(autorun(reader => {
|
|
307
|
-
const listening = this._voiceState.read(reader) === "listening";
|
|
308
|
-
if (listening && !wasListening && pttKeyCode === undefined) {
|
|
309
|
-
if (heldKeyCode !== undefined) {
|
|
310
|
-
pttKeyCode = heldKeyCode;
|
|
311
|
-
} else if (releasedBeforeListening) {
|
|
312
|
-
releasedBeforeListening = false;
|
|
313
|
-
this.callbacks.pttUp();
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
if (!listening) {
|
|
317
|
-
releasedBeforeListening = false;
|
|
318
|
-
}
|
|
319
|
-
wasListening = listening;
|
|
320
|
-
}));
|
|
321
|
-
const onDocPointerUp = () => this.callbacks.pttUp();
|
|
322
|
-
win.document.addEventListener("pointerup", onDocPointerUp);
|
|
323
|
-
this._register(
|
|
324
|
-
toDisposable(() => win.document.removeEventListener("pointerup", onDocPointerUp))
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
const pttChannel = ( new BroadcastChannel("vscode-ptt"));
|
|
328
|
-
pttChannel.onmessage = e => {
|
|
329
|
-
if (e.data === "down") {
|
|
330
|
-
this.callbacks.pttDown();
|
|
331
|
-
}
|
|
332
|
-
if (e.data === "up") {
|
|
333
|
-
this.callbacks.pttUp();
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
this._register(toDisposable(() => pttChannel.close()));
|
|
337
|
-
const renderDisposable = autorun(reader => {
|
|
338
|
-
this._updateDOM(reader);
|
|
339
|
-
getWindow(this.container).requestAnimationFrame(() => {
|
|
340
|
-
this.callbacks.onResize();
|
|
341
|
-
});
|
|
342
|
-
});
|
|
343
|
-
this._register(renderDisposable);
|
|
344
|
-
this._register(toDisposable(() => clearNode(this.container)));
|
|
345
|
-
let sawConnecting = false;
|
|
346
|
-
let failureCheckPending = false;
|
|
347
|
-
let disposed = false;
|
|
348
|
-
const onboardingConnectDisposable = autorun(reader => {
|
|
349
|
-
if (!this._onboardingPendingConnect.read(reader)) {
|
|
350
|
-
sawConnecting = false;
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
if (this._isConnected.read(reader)) {
|
|
354
|
-
this._onboardingPendingConnect.set(false, undefined);
|
|
355
|
-
sawConnecting = false;
|
|
356
|
-
this._showOnboarding.set(false, undefined);
|
|
357
|
-
this.callbacks.onOnboardingCompleted?.();
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (this._isConnecting.read(reader)) {
|
|
361
|
-
sawConnecting = true;
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
if (sawConnecting && !failureCheckPending) {
|
|
365
|
-
failureCheckPending = true;
|
|
366
|
-
queueMicrotask(() => {
|
|
367
|
-
failureCheckPending = false;
|
|
368
|
-
if (disposed) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
if (this._onboardingPendingConnect.read(undefined) && !this._isConnected.read(undefined) && !this._isConnecting.read(undefined)) {
|
|
372
|
-
this._onboardingPendingConnect.set(false, undefined);
|
|
373
|
-
sawConnecting = false;
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
this._register(toDisposable(() => {
|
|
379
|
-
disposed = true;
|
|
380
|
-
}));
|
|
381
|
-
this._register(onboardingConnectDisposable);
|
|
382
|
-
if (this._options.reshowOnboardingOnDisconnect) {
|
|
383
|
-
const reshowDisposable = autorun(reader => {
|
|
384
|
-
const connected = this._isConnected.read(reader);
|
|
385
|
-
const connecting = this._isConnecting.read(reader);
|
|
386
|
-
const reconnecting = this._isReconnecting.read(reader);
|
|
387
|
-
const pendingConnect = this._onboardingPendingConnect.read(reader);
|
|
388
|
-
if (!connected && !connecting && !reconnecting && !pendingConnect) {
|
|
389
|
-
if (!this._showOnboarding.read(reader)) {
|
|
390
|
-
this._showOnboarding.set(true, undefined);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
this._register(reshowDisposable);
|
|
395
|
-
}
|
|
396
|
-
this._register(autorun(reader => {
|
|
397
|
-
const onboarding = this._showOnboarding.read(reader);
|
|
398
|
-
const voiceState = this._voiceState.read(reader);
|
|
399
|
-
if (onboarding || voiceState === "listening" || voiceState === "speaking") {
|
|
400
|
-
this._startWaveformAnimation();
|
|
401
|
-
} else {
|
|
402
|
-
this._stopWaveformAnimation();
|
|
403
|
-
}
|
|
404
|
-
}));
|
|
405
|
-
this._register(toDisposable(() => this._stopWaveformAnimation()));
|
|
406
|
-
}
|
|
407
|
-
_updateDOM(reader) {
|
|
408
|
-
if (this._options.inputBoxLayout) {
|
|
409
|
-
this._updateDOMInputBoxLayout(reader);
|
|
410
|
-
} else {
|
|
411
|
-
this._updateDOMClassicLayout(reader);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
_updateDOMInputBoxLayout(reader) {
|
|
415
|
-
const voiceState = this._voiceState.read(reader);
|
|
416
|
-
const isConnected = this._isConnected.read(reader);
|
|
417
|
-
const isConnecting = this._isConnecting.read(reader);
|
|
418
|
-
const isReconnecting = this._isReconnecting.read(reader);
|
|
419
|
-
const onboarding = this._showOnboarding.read(reader) && !isReconnecting;
|
|
420
|
-
const showConnected = isConnected || isReconnecting;
|
|
421
|
-
const opts = this._options;
|
|
422
|
-
const showExpanded = this._shouldShowExpanded.read(reader) && opts.showExpandChevron;
|
|
423
|
-
const baseWidth = typeof opts.width === "number" ? opts.width : AGENTS_VOICE_WINDOW_DEFAULT_WIDTH;
|
|
424
|
-
this._rootDiv.style.width = `${baseWidth}px`;
|
|
425
|
-
this._titleRow.style.display = (onboarding || !opts.title) ? "none" : "flex";
|
|
426
|
-
if (onboarding) {
|
|
427
|
-
this._onboardingComponent.element.style.display = "";
|
|
428
|
-
this._feedbackDialogComponent.element.style.display = "none";
|
|
429
|
-
this._inputBoxContainer.style.display = "none";
|
|
430
|
-
this._transcriptComponent.element.style.display = "none";
|
|
431
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
432
|
-
this._sessionListWrapper.style.display = "none";
|
|
433
|
-
this._inputBoxToolbar.style.display = "none";
|
|
434
|
-
this._onboardingComponent.update({
|
|
435
|
-
pttKeyLabel: this._pttKeyLabel.read(reader),
|
|
436
|
-
isConnecting: this._onboardingPendingConnect.read(reader) || isConnecting || isReconnecting,
|
|
437
|
-
onGetStarted: e => {
|
|
438
|
-
e.preventDefault();
|
|
439
|
-
e.stopPropagation();
|
|
440
|
-
this._dismissOnboarding(true);
|
|
441
|
-
},
|
|
442
|
-
onOpenPttKeySettings: e => {
|
|
443
|
-
e.preventDefault();
|
|
444
|
-
e.stopPropagation();
|
|
445
|
-
this.callbacks.openPttKeySettings();
|
|
446
|
-
},
|
|
447
|
-
onOpenPopout: this.callbacks.openPopout ? e => {
|
|
448
|
-
e.preventDefault();
|
|
449
|
-
e.stopPropagation();
|
|
450
|
-
this.callbacks.openPopout?.();
|
|
451
|
-
} : undefined
|
|
452
|
-
});
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
this._onboardingComponent.element.style.display = "none";
|
|
456
|
-
const feedbackState = this._feedbackDialogState.read(reader);
|
|
457
|
-
if (feedbackState) {
|
|
458
|
-
this._feedbackDialogComponent.element.style.display = "";
|
|
459
|
-
this._feedbackDialogComponent.update({
|
|
460
|
-
onSubmit: text => this._submitFeedback(text),
|
|
461
|
-
onCancel: () => {
|
|
462
|
-
this._feedbackDialogState.set(null, undefined);
|
|
463
|
-
}
|
|
464
|
-
}, feedbackState);
|
|
465
|
-
this._inputBoxContainer.style.display = "none";
|
|
466
|
-
this._transcriptComponent.element.style.display = "none";
|
|
467
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
468
|
-
this._sessionListWrapper.style.display = "none";
|
|
469
|
-
this._inputBoxToolbar.style.display = "none";
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
this._feedbackDialogComponent.element.style.display = "none";
|
|
473
|
-
this._inputBoxContainer.style.display = "flex";
|
|
474
|
-
const transcriptTurns = this._transcriptTurns.read(reader);
|
|
475
|
-
const hasTranscript = ( transcriptTurns.some(t => t.text.length > 0 || (t.speaker === "user" && t.isPartial)));
|
|
476
|
-
const shouldShowInputGlow = showConnected && (voiceState === "listening" || voiceState === "speaking");
|
|
477
|
-
if (!shouldShowInputGlow) {
|
|
478
|
-
this._glowController?.clear();
|
|
479
|
-
}
|
|
480
|
-
this._inputBoxContainer.classList.toggle("processing", voiceState === "processing");
|
|
481
|
-
if (hasTranscript) {
|
|
482
|
-
if (showExpanded) {
|
|
483
|
-
this._transcriptComponent.element.style.display = "";
|
|
484
|
-
this._transcriptComponent.element.style.padding = "8px 12px";
|
|
485
|
-
this._transcriptComponent.element.style.borderBottom = "1px solid var(--vscode-widget-border, var(--vscode-input-border, transparent))";
|
|
486
|
-
this._transcriptComponent.update({
|
|
487
|
-
turns: transcriptTurns,
|
|
488
|
-
chatStyle: true
|
|
489
|
-
});
|
|
490
|
-
this._inputBoxPlaceholder.style.display = "none";
|
|
491
|
-
this._inputBoxTranscriptComponent.element.style.display = "none";
|
|
492
|
-
} else {
|
|
493
|
-
this._inputBoxPlaceholder.style.display = "none";
|
|
494
|
-
this._transcriptComponent.element.style.display = "none";
|
|
495
|
-
this._transcriptComponent.element.style.padding = "";
|
|
496
|
-
this._transcriptComponent.element.style.borderBottom = "";
|
|
497
|
-
this._inputBoxTranscriptComponent.element.style.display = "";
|
|
498
|
-
this._inputBoxTranscriptComponent.update({
|
|
499
|
-
turns: transcriptTurns,
|
|
500
|
-
chatStyle: true,
|
|
501
|
-
scrollToTop: true
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
} else {
|
|
505
|
-
this._inputBoxPlaceholder.style.display = "";
|
|
506
|
-
this._inputBoxTranscriptComponent.element.style.display = "none";
|
|
507
|
-
this._transcriptComponent.element.style.display = "none";
|
|
508
|
-
const keyLabel = this._pttKeyLabel.read(reader);
|
|
509
|
-
if (isReconnecting) {
|
|
510
|
-
this._inputBoxPlaceholder.textContent = this._statusText.read(reader) || ( localize(8684, "Reconnecting..."));
|
|
511
|
-
} else if (isConnecting) {
|
|
512
|
-
this._inputBoxPlaceholder.textContent = ( localize(8685, "Connecting..."));
|
|
513
|
-
} else if (isConnected && voiceState === "listening") {
|
|
514
|
-
this._inputBoxPlaceholder.textContent = ( localize(8686, "Listening"));
|
|
515
|
-
} else if (isConnected && voiceState === "speaking") {
|
|
516
|
-
this._inputBoxPlaceholder.textContent = keyLabel ? ( localize(8687, "Speak or use {0}", keyLabel)) : ( localize(8688, "Speak to barge in"));
|
|
517
|
-
} else if (isConnected) {
|
|
518
|
-
this._inputBoxPlaceholder.textContent = keyLabel ? ( localize(8689, "Hold {0} to talk or barge in", keyLabel)) : ( localize(8690, "Hold the mic to talk or barge in"));
|
|
519
|
-
} else if (keyLabel) {
|
|
520
|
-
this._inputBoxPlaceholder.textContent = ( localize(8691, "Hold {0} to talk", keyLabel));
|
|
521
|
-
} else {
|
|
522
|
-
this._inputBoxPlaceholder.textContent = ( localize(8692, "Click voice mode to talk"));
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
if (isReconnecting || isConnecting) {
|
|
526
|
-
this._inputBoxPlaceholder.style.display = "";
|
|
527
|
-
this._inputBoxPlaceholder.textContent = isReconnecting ? (this._statusText.read(reader) || ( localize(8684, "Reconnecting..."))) : ( localize(8685, "Connecting..."));
|
|
528
|
-
}
|
|
529
|
-
if (!showExpanded) {
|
|
530
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
531
|
-
this._sessionListWrapper.style.display = "none";
|
|
532
|
-
} else {
|
|
533
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
534
|
-
this._sessionListWrapper.style.display = "";
|
|
535
|
-
this._sessionListWrapper.style.maxHeight = "200px";
|
|
536
|
-
this._sessionListWrapper.style.overflowY = "auto";
|
|
537
|
-
this._sessionListWrapper.style.scrollbarWidth = "none";
|
|
538
|
-
this._sessionListComponent.update({
|
|
539
|
-
sessions: this._sessions.read(reader),
|
|
540
|
-
groups: this._sessionGroups.read(reader),
|
|
541
|
-
selectedTarget: this._selectedTargetSession.read(reader),
|
|
542
|
-
onOpenSession: r => this.callbacks.openSession(r),
|
|
543
|
-
onStopSession: r => this.callbacks.stopSession(r),
|
|
544
|
-
onCancelSession: r => this.callbacks.cancelSession(r),
|
|
545
|
-
onSelectTarget: r => {
|
|
546
|
-
this._selectedTargetSession.set(r, undefined);
|
|
547
|
-
this.callbacks.selectTargetSession(r);
|
|
548
|
-
},
|
|
549
|
-
onNewSession: () => this.callbacks.newSessionAsTarget()
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
this._inputBoxToolbar.style.display = "flex";
|
|
553
|
-
this._inputBoxMicBtn.style.display = "";
|
|
554
|
-
const keyLabel = this._pttKeyLabel.read(reader);
|
|
555
|
-
const micTooltip = keyLabel ? ( localize(8693, "Push to talk ({0})", keyLabel)) : ( localize(8694, "Push to talk"));
|
|
556
|
-
this._inputBoxMicBtn.title = micTooltip;
|
|
557
|
-
this._inputBoxMicBtn.ariaLabel = micTooltip;
|
|
558
|
-
const micColor = voiceState === "error" ? "var(--vscode-editorError-foreground)" : voiceState === "listening" ? "var(--vscode-editorInfo-foreground)" : voiceState === "speaking" ? "var(--vscode-agentsVoice-speakingForeground)" : "var(--vscode-descriptionForeground)";
|
|
559
|
-
this._inputBoxMicBtn.style.color = micColor;
|
|
560
|
-
const micIsActive = voiceState === "listening" || voiceState === "speaking";
|
|
561
|
-
this._inputBoxMicBtn.classList.toggle("agents-voice-mode-active", micIsActive);
|
|
562
|
-
this._inputBoxMicBtn.style.setProperty(
|
|
563
|
-
"--agents-voice-input-icon-rgb",
|
|
564
|
-
voiceState === "speaking" ? "163,113,247" : "88,166,255"
|
|
565
|
-
);
|
|
566
|
-
this._inputBoxMicBtn.style.borderRadius = "50%";
|
|
567
|
-
if (!micIsActive) {
|
|
568
|
-
this._inputBoxMicBtn.style.boxShadow = "none";
|
|
569
|
-
}
|
|
570
|
-
this._inputBoxMicBtn.onmousedown = e => {
|
|
571
|
-
if (isSecondaryPointerGesture(e)) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
e.preventDefault();
|
|
575
|
-
this.callbacks.pttDown();
|
|
576
|
-
};
|
|
577
|
-
this._inputBoxMicBtn.onmouseup = e => {
|
|
578
|
-
if (isSecondaryPointerGesture(e)) {
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
this.callbacks.pttUp();
|
|
582
|
-
};
|
|
583
|
-
this._inputBoxConnIndicator.style.display = showConnected ? "" : "none";
|
|
584
|
-
this._inputBoxConnIndicator.onclick = e => {
|
|
585
|
-
e.preventDefault();
|
|
586
|
-
e.stopPropagation();
|
|
587
|
-
this.callbacks.disconnect();
|
|
588
|
-
};
|
|
589
|
-
const muted = this._isMuted.read(reader);
|
|
590
|
-
this._inputBoxMuteBtn.style.display = showConnected ? "" : "none";
|
|
591
|
-
this._inputBoxMuteBtn.classList.toggle("codicon-mic-off", muted);
|
|
592
|
-
this._inputBoxMuteBtn.classList.toggle("codicon-mic", !muted);
|
|
593
|
-
const muteColor = "var(--vscode-descriptionForeground)";
|
|
594
|
-
this._inputBoxMuteBtn.style.color = muteColor;
|
|
595
|
-
const muteLabel = muted ? ( localize(8695, "Unmute Microphone")) : ( localize(8696, "Mute Microphone"));
|
|
596
|
-
this._inputBoxMuteBtn.title = muteLabel;
|
|
597
|
-
this._inputBoxMuteBtn.ariaLabel = muteLabel;
|
|
598
|
-
this._inputBoxMuteBtn.setAttribute("aria-pressed", muted ? "true" : "false");
|
|
599
|
-
this._inputBoxMuteBtn.onmouseenter = () => {
|
|
600
|
-
this._inputBoxMuteBtn.style.color = "var(--vscode-foreground)";
|
|
601
|
-
};
|
|
602
|
-
this._inputBoxMuteBtn.onmouseleave = () => {
|
|
603
|
-
this._inputBoxMuteBtn.style.color = muteColor;
|
|
604
|
-
};
|
|
605
|
-
this._inputBoxMuteBtn.onclick = e => {
|
|
606
|
-
e.preventDefault();
|
|
607
|
-
e.stopPropagation();
|
|
608
|
-
this.callbacks.toggleMute();
|
|
609
|
-
};
|
|
610
|
-
this._inputBoxFeedbackBtn.onclick = e => {
|
|
611
|
-
e.preventDefault();
|
|
612
|
-
e.stopPropagation();
|
|
613
|
-
this._toggleFeedbackDialog();
|
|
614
|
-
};
|
|
615
|
-
this._inputBoxSessionsBtn.style.display = "";
|
|
616
|
-
this._inputBoxSessionsBtn.className = `codicon codicon-${showExpanded ? "chevron-up" : "list-tree"}`;
|
|
617
|
-
this._inputBoxSessionsBtn.title = showExpanded ? ( localize(8697, "Collapse sessions")) : ( localize(8682, "Sessions"));
|
|
618
|
-
this._inputBoxCloseBtn.style.display = opts.showClose ? "" : "none";
|
|
619
|
-
this._inputBoxCloseBtn.onclick = e => {
|
|
620
|
-
e.preventDefault();
|
|
621
|
-
e.stopPropagation();
|
|
622
|
-
this.callbacks.closeWindow();
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
_updateDOMClassicLayout(reader) {
|
|
626
|
-
const onboarding = this._showOnboarding.read(reader);
|
|
627
|
-
const voiceState = this._voiceState.read(reader);
|
|
628
|
-
const opts = this._options;
|
|
629
|
-
const showExpanded = this._shouldShowExpanded.read(reader) && opts.showExpandChevron;
|
|
630
|
-
this._titleRow.style.display = (onboarding || !opts.title) ? "none" : "flex";
|
|
631
|
-
if (onboarding && !this._isReconnecting.read(reader)) {
|
|
632
|
-
this._onboardingComponent.element.style.display = "";
|
|
633
|
-
this._headerComponent.element.style.display = "none";
|
|
634
|
-
this._voiceBarComponent.element.style.display = "none";
|
|
635
|
-
this._feedbackDialogComponent.element.style.display = "none";
|
|
636
|
-
this._statusTextDiv.style.display = "none";
|
|
637
|
-
this._transcriptComponent.element.style.display = "none";
|
|
638
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
639
|
-
this._sessionListWrapper.style.display = "none";
|
|
640
|
-
this._expandSpacer.style.display = "none";
|
|
641
|
-
this._chevronWrapper.style.display = "none";
|
|
642
|
-
this._onboardingComponent.update({
|
|
643
|
-
pttKeyLabel: this._pttKeyLabel.read(reader),
|
|
644
|
-
isConnecting: this._onboardingPendingConnect.read(reader) || this._isConnecting.read(reader),
|
|
645
|
-
onGetStarted: e => {
|
|
646
|
-
e.preventDefault();
|
|
647
|
-
e.stopPropagation();
|
|
648
|
-
this._dismissOnboarding(true);
|
|
649
|
-
},
|
|
650
|
-
onOpenPttKeySettings: e => {
|
|
651
|
-
e.preventDefault();
|
|
652
|
-
e.stopPropagation();
|
|
653
|
-
this.callbacks.openPttKeySettings();
|
|
654
|
-
},
|
|
655
|
-
onOpenPopout: this.callbacks.openPopout ? e => {
|
|
656
|
-
e.preventDefault();
|
|
657
|
-
e.stopPropagation();
|
|
658
|
-
this.callbacks.openPopout?.();
|
|
659
|
-
} : undefined
|
|
660
|
-
});
|
|
661
|
-
} else {
|
|
662
|
-
this._onboardingComponent.element.style.display = "none";
|
|
663
|
-
this._headerComponent.element.style.display = "";
|
|
664
|
-
const feedbackState = this._feedbackDialogState.read(reader);
|
|
665
|
-
this._headerComponent.update({
|
|
666
|
-
copilotIconSrc: this.callbacks.copilotIconSrc,
|
|
667
|
-
showCopilotIcon: opts.showCopilotIcon,
|
|
668
|
-
isConnected: this._isConnected.read(reader),
|
|
669
|
-
isConnecting: this._isConnecting.read(reader),
|
|
670
|
-
isReconnecting: this._isReconnecting.read(reader),
|
|
671
|
-
voiceState,
|
|
672
|
-
draggable: opts.draggable,
|
|
673
|
-
showClose: opts.showClose,
|
|
674
|
-
showPopout: !!this.callbacks.openPopout && this._popoutAvailable.read(reader),
|
|
675
|
-
hideDisconnect: this.callbacks.hideDisconnect,
|
|
676
|
-
centerConnectButton: opts.centerConnectButton,
|
|
677
|
-
isMuted: this._isMuted.read(reader),
|
|
678
|
-
onMicDown: e => {
|
|
679
|
-
e.preventDefault();
|
|
680
|
-
this.callbacks.pttDown();
|
|
681
|
-
},
|
|
682
|
-
onMicUp: () => {
|
|
683
|
-
this.callbacks.pttUp();
|
|
684
|
-
},
|
|
685
|
-
onConnectClick: e => {
|
|
686
|
-
e.preventDefault();
|
|
687
|
-
e.stopPropagation();
|
|
688
|
-
if (this._isConnecting.get()) {
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
if (this._isConnected.get()) {
|
|
692
|
-
this.callbacks.disconnect();
|
|
693
|
-
} else {
|
|
694
|
-
this.callbacks.connect();
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
onDisconnectClick: e => {
|
|
698
|
-
e.preventDefault();
|
|
699
|
-
e.stopPropagation();
|
|
700
|
-
this.callbacks.disconnect();
|
|
701
|
-
},
|
|
702
|
-
onCloseClick: e => {
|
|
703
|
-
e.preventDefault();
|
|
704
|
-
e.stopPropagation();
|
|
705
|
-
this.callbacks.closeWindow();
|
|
706
|
-
},
|
|
707
|
-
onToggleClick: e => {
|
|
708
|
-
e.preventDefault();
|
|
709
|
-
e.stopPropagation();
|
|
710
|
-
this._expanded.set(!this._expanded.get(), undefined);
|
|
711
|
-
},
|
|
712
|
-
onMicContextMenu: e => {
|
|
713
|
-
e.preventDefault();
|
|
714
|
-
e.stopPropagation();
|
|
715
|
-
this.callbacks.showVoiceContextMenu(e);
|
|
716
|
-
},
|
|
717
|
-
onMuteClick: e => {
|
|
718
|
-
e.preventDefault();
|
|
719
|
-
e.stopPropagation();
|
|
720
|
-
this.callbacks.toggleMute();
|
|
721
|
-
},
|
|
722
|
-
onPopoutClick: e => {
|
|
723
|
-
e.preventDefault();
|
|
724
|
-
e.stopPropagation();
|
|
725
|
-
this.callbacks.openPopout?.();
|
|
726
|
-
},
|
|
727
|
-
onFeedbackClick: e => {
|
|
728
|
-
e.preventDefault();
|
|
729
|
-
e.stopPropagation();
|
|
730
|
-
this._toggleFeedbackDialog();
|
|
731
|
-
},
|
|
732
|
-
pttKeyLabel: this._pttKeyLabel.read(reader),
|
|
733
|
-
expanded: showExpanded
|
|
734
|
-
});
|
|
735
|
-
if (feedbackState) {
|
|
736
|
-
this._voiceBarComponent.element.style.display = "none";
|
|
737
|
-
this._feedbackDialogComponent.element.style.display = "";
|
|
738
|
-
this._feedbackDialogComponent.update({
|
|
739
|
-
onSubmit: text => this._submitFeedback(text),
|
|
740
|
-
onCancel: () => {
|
|
741
|
-
this._feedbackDialogState.set(null, undefined);
|
|
742
|
-
}
|
|
743
|
-
}, feedbackState);
|
|
744
|
-
this._statusTextDiv.style.display = "none";
|
|
745
|
-
this._transcriptComponent.element.style.display = "none";
|
|
746
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
747
|
-
this._sessionListWrapper.style.display = "none";
|
|
748
|
-
this._expandSpacer.style.display = "none";
|
|
749
|
-
this._chevronWrapper.style.display = "none";
|
|
750
|
-
} else {
|
|
751
|
-
this._feedbackDialogComponent.element.style.display = "none";
|
|
752
|
-
this._voiceBarComponent.update({
|
|
753
|
-
voiceState,
|
|
754
|
-
speakingSessionLabel: this._speakingSessionLabel.read(reader),
|
|
755
|
-
speakingSession: this._speakingSession.read(reader),
|
|
756
|
-
onStopSpeech: () => this.callbacks.stopPlayback()
|
|
757
|
-
});
|
|
758
|
-
const statusText = this._statusText.read(reader);
|
|
759
|
-
const isError = voiceState === "error";
|
|
760
|
-
if ((opts.showStatusText || isError) && statusText) {
|
|
761
|
-
this._statusTextDiv.style.display = "";
|
|
762
|
-
this._statusTextDiv.textContent = statusText;
|
|
763
|
-
this._statusTextDiv.style.color = isError ? "var(--vscode-editorError-foreground)" : "var(--vscode-foreground)";
|
|
764
|
-
} else {
|
|
765
|
-
this._statusTextDiv.style.display = "none";
|
|
766
|
-
}
|
|
767
|
-
this._transcriptComponent.update({
|
|
768
|
-
turns: this._transcriptTurns.read(reader)
|
|
769
|
-
});
|
|
770
|
-
if (!showExpanded) {
|
|
771
|
-
this._statusRowsComponent.element.style.display = "";
|
|
772
|
-
this._statusRowsComponent.update({
|
|
773
|
-
workingCount: this._workingCount.read(reader),
|
|
774
|
-
needsInputCount: this._needsInputCount.read(reader),
|
|
775
|
-
doneCount: this._doneCount.read(reader),
|
|
776
|
-
showCounters: opts.showStatusCounters,
|
|
777
|
-
speakingSessionLabel: this._speakingSessionLabel.read(reader),
|
|
778
|
-
speakingSessionResource: this._speakingSession.read(reader),
|
|
779
|
-
pendingToolConfirmations: this._pendingToolConfirmations.read(reader),
|
|
780
|
-
onOpenSession: r => this.callbacks.openSession(r)
|
|
781
|
-
});
|
|
782
|
-
this._sessionListWrapper.style.display = "none";
|
|
783
|
-
} else {
|
|
784
|
-
this._statusRowsComponent.element.style.display = "none";
|
|
785
|
-
this._sessionListWrapper.style.display = "";
|
|
786
|
-
this._sessionListComponent.update({
|
|
787
|
-
sessions: this._sessions.read(reader),
|
|
788
|
-
groups: this._sessionGroups.read(reader),
|
|
789
|
-
selectedTarget: this._selectedTargetSession.read(reader),
|
|
790
|
-
onOpenSession: r => this.callbacks.openSession(r),
|
|
791
|
-
onStopSession: r => this.callbacks.stopSession(r),
|
|
792
|
-
onCancelSession: r => this.callbacks.cancelSession(r),
|
|
793
|
-
onSelectTarget: r => {
|
|
794
|
-
this._selectedTargetSession.set(r, undefined);
|
|
795
|
-
this.callbacks.selectTargetSession(r);
|
|
796
|
-
},
|
|
797
|
-
onNewSession: () => this.callbacks.newSessionAsTarget()
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
this._expandSpacer.style.display = "";
|
|
801
|
-
this._chevronWrapper.style.display = opts.showExpandChevron ? "flex" : "none";
|
|
802
|
-
this._chevronWrapper.title = showExpanded ? "Collapse sessions" : "Expand sessions";
|
|
803
|
-
this._chevronIcon.className = `codicon codicon-${showExpanded ? "chevron-up" : "chevron-down"}`;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
setConnected(connected) {
|
|
808
|
-
this._isConnected.set(connected, undefined);
|
|
809
|
-
}
|
|
810
|
-
setConnecting(connecting) {
|
|
811
|
-
this._isConnecting.set(connecting, undefined);
|
|
812
|
-
}
|
|
813
|
-
setReconnecting(reconnecting) {
|
|
814
|
-
this._isReconnecting.set(reconnecting, undefined);
|
|
815
|
-
}
|
|
816
|
-
setMuted(muted) {
|
|
817
|
-
this._isMuted.set(muted, undefined);
|
|
818
|
-
}
|
|
819
|
-
setVoiceState(state) {
|
|
820
|
-
this._voiceState.set(state, undefined);
|
|
821
|
-
}
|
|
822
|
-
setStatusCounts(working, needsInput, done) {
|
|
823
|
-
this._workingCount.set(working, undefined);
|
|
824
|
-
this._needsInputCount.set(needsInput, undefined);
|
|
825
|
-
this._doneCount.set(done, undefined);
|
|
826
|
-
}
|
|
827
|
-
setPendingToolConfirmations(confirmations) {
|
|
828
|
-
this._pendingToolConfirmations.set(confirmations, undefined);
|
|
829
|
-
}
|
|
830
|
-
setSpeakingSession(session, label) {
|
|
831
|
-
this._speakingSession.set(session, undefined);
|
|
832
|
-
this._speakingSessionLabel.set(label, undefined);
|
|
833
|
-
}
|
|
834
|
-
setSessions(sessions) {
|
|
835
|
-
this._sessions.set(sessions, undefined);
|
|
836
|
-
}
|
|
837
|
-
setSelectedTargetSession(resource) {
|
|
838
|
-
this._selectedTargetSession.set(resource, undefined);
|
|
839
|
-
}
|
|
840
|
-
setSessionGroups(groups) {
|
|
841
|
-
this._sessionGroups.set(groups, undefined);
|
|
842
|
-
}
|
|
843
|
-
setPttKeyLabel(label) {
|
|
844
|
-
this._pttKeyLabel.set(label, undefined);
|
|
845
|
-
}
|
|
846
|
-
setTranscriptTurns(turns) {
|
|
847
|
-
this._transcriptTurns.set(turns, undefined);
|
|
848
|
-
}
|
|
849
|
-
setStatusText(text) {
|
|
850
|
-
this._statusText.set(text, undefined);
|
|
851
|
-
}
|
|
852
|
-
setPopoutAvailable(available) {
|
|
853
|
-
this._popoutAvailable.set(available, undefined);
|
|
854
|
-
}
|
|
855
|
-
_toggleFeedbackDialog() {
|
|
856
|
-
if (this._feedbackDialogState.get()) {
|
|
857
|
-
this._feedbackDialogState.set(null, undefined);
|
|
858
|
-
} else {
|
|
859
|
-
this._showOnboarding.set(false, undefined);
|
|
860
|
-
this._feedbackDialogState.set({
|
|
861
|
-
isSubmitting: false,
|
|
862
|
-
submitted: false
|
|
863
|
-
}, undefined);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
_dismissOnboarding(connect = false) {
|
|
867
|
-
if (connect) {
|
|
868
|
-
if (this._isConnected.get()) {
|
|
869
|
-
this._showOnboarding.set(false, undefined);
|
|
870
|
-
this.callbacks.onOnboardingCompleted?.();
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
if (!this._isConnecting.get() && !this._onboardingPendingConnect.get()) {
|
|
874
|
-
this._onboardingPendingConnect.set(true, undefined);
|
|
875
|
-
this.callbacks.connect();
|
|
876
|
-
}
|
|
877
|
-
} else {
|
|
878
|
-
this._showOnboarding.set(false, undefined);
|
|
879
|
-
this.callbacks.onOnboardingCompleted?.();
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
dismissOnboarding() {
|
|
883
|
-
this._onboardingPendingConnect.set(false, undefined);
|
|
884
|
-
if (this._showOnboarding.get()) {
|
|
885
|
-
this._showOnboarding.set(false, undefined);
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
_submitFeedback(text) {
|
|
889
|
-
this._feedbackDialogState.set({
|
|
890
|
-
isSubmitting: true,
|
|
891
|
-
submitted: false
|
|
892
|
-
}, undefined);
|
|
893
|
-
this.callbacks.submitFeedback(text).then(result => {
|
|
894
|
-
if (result.ok) {
|
|
895
|
-
this._feedbackDialogState.set({
|
|
896
|
-
isSubmitting: false,
|
|
897
|
-
submitted: true
|
|
898
|
-
}, undefined);
|
|
899
|
-
setTimeout(() => {
|
|
900
|
-
this._feedbackDialogState.set(null, undefined);
|
|
901
|
-
}, 3000);
|
|
902
|
-
} else {
|
|
903
|
-
this._feedbackDialogState.set({
|
|
904
|
-
isSubmitting: false,
|
|
905
|
-
submitted: false,
|
|
906
|
-
error: result.error ?? ( localize(8698, "Failed to submit"))
|
|
907
|
-
}, undefined);
|
|
908
|
-
}
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
_startWaveformAnimation() {
|
|
912
|
-
if (this._animationFrameId !== undefined) {
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
const animate = () => {
|
|
916
|
-
this._animationFrameId = getWindow(this.container).requestAnimationFrame(animate);
|
|
917
|
-
const onboarding = this._showOnboarding.get();
|
|
918
|
-
const voiceState = this._voiceState.get();
|
|
919
|
-
if (!(onboarding || voiceState === "listening" || voiceState === "speaking")) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
const analyser = this.callbacks.getAnalyserNode();
|
|
923
|
-
let intensity;
|
|
924
|
-
if (onboarding) {
|
|
925
|
-
intensity = 0.6;
|
|
926
|
-
} else if (!analyser) {
|
|
927
|
-
intensity = 0.3;
|
|
928
|
-
} else {
|
|
929
|
-
const dataArray = ( new Uint8Array(analyser.frequencyBinCount));
|
|
930
|
-
analyser.getByteFrequencyData(dataArray);
|
|
931
|
-
let sum = 0;
|
|
932
|
-
for (let i = 0; i < dataArray.length; i++) {
|
|
933
|
-
sum += dataArray[i];
|
|
934
|
-
}
|
|
935
|
-
intensity = Math.min(1, (sum / dataArray.length) / 80);
|
|
936
|
-
}
|
|
937
|
-
if (this._glowController && (voiceState === "listening" || voiceState === "speaking")) {
|
|
938
|
-
this._glowController.render(voiceState, intensity, this.callbacks.isMotionReduced());
|
|
939
|
-
}
|
|
940
|
-
const colors = this.callbacks.getGlowColors();
|
|
941
|
-
if (this._inputBoxMicBtn) {
|
|
942
|
-
const iconGlowActive = voiceState === "listening" || voiceState === "speaking";
|
|
943
|
-
this._inputBoxMicBtn.style.boxShadow = iconGlowActive ? computeVoiceMicGlowBoxShadow(voiceState, intensity, colors) : "none";
|
|
944
|
-
}
|
|
945
|
-
this._glowDiv.style.display = "";
|
|
946
|
-
const baseOpacity = 0.15 + intensity * 0.4;
|
|
947
|
-
const {
|
|
948
|
-
r,
|
|
949
|
-
g,
|
|
950
|
-
b
|
|
951
|
-
} = voiceGlowStateColor(onboarding ? "speaking" : voiceState, colors).rgba;
|
|
952
|
-
const rgb = `${r},${g},${b}`;
|
|
953
|
-
this._glowDiv.style.background = `radial-gradient(ellipse 40% 70% at 50% 0%, rgba(${rgb},${baseOpacity}) 0%, transparent 100%), radial-gradient(ellipse 70% 100% at 50% 0%, rgba(${rgb},${baseOpacity * 0.4}) 0%, transparent 100%)`;
|
|
954
|
-
};
|
|
955
|
-
this._animationFrameId = getWindow(this.container).requestAnimationFrame(animate);
|
|
956
|
-
}
|
|
957
|
-
_stopWaveformAnimation() {
|
|
958
|
-
if (this._animationFrameId !== undefined) {
|
|
959
|
-
getWindow(this.container).cancelAnimationFrame(this._animationFrameId);
|
|
960
|
-
this._animationFrameId = undefined;
|
|
961
|
-
}
|
|
962
|
-
this._glowDiv.style.display = "none";
|
|
963
|
-
this._glowController?.clear();
|
|
964
|
-
if (this._inputBoxMicBtn) {
|
|
965
|
-
this._inputBoxMicBtn.style.boxShadow = "none";
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
function _isTextInput(target) {
|
|
970
|
-
if (!target || typeof target.tagName !== "string") {
|
|
971
|
-
return false;
|
|
972
|
-
}
|
|
973
|
-
const el = target;
|
|
974
|
-
const tag = el.tagName;
|
|
975
|
-
if (tag === "TEXTAREA" || tag === "INPUT") {
|
|
976
|
-
return true;
|
|
977
|
-
}
|
|
978
|
-
return el.isContentEditable === true;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
export { AgentsVoiceWidget };
|