Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Shows the Voice Mode introduction the first time a session starts. This
* watches the connection state rather than any one entry point, because Voice
* Mode can be started from the input-mode pill, a command, a keybinding or the
* Agents window - all of which land here.
*/
class
AgentsVoiceOnboardingContribution
extends
Disposable
implements
IWorkbenchContribution
{
static
readonly
ID
=
'workbench.contrib.agentsVoiceOnboarding'
;
constructor
(
@IVoiceSessionController
:
,
@IVoiceModeOnboardingService
:
,
)
{
super
(
)
;
this
.
_register
(
autorun
(
=>
{
if
(
.
.
read
(
)
||
.
.
read
(
)
)
{
.
showIfNeeded
(
)
;
}
}
)
)
;
}
}
// Registered at the same late phase as the connected-key contribution so it
// does not force `IVoiceSessionController` to instantiate early.
registerWorkbenchContribution2
(
.
ID
,
,
.
)
;
// --- Voice mode button in Chat toolbar ---
// Shows the voice mode icon in both idle and active states.
// Click to connect if disconnected, or toggle PTT if connected.
// The disconnect button (shown when connected) indicates active voice mode.
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
'agentsVoice.connecting'
,
:
.
localize2
(
'agentsVoice.connecting'
,
"Connecting..."
)
,
:
.
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
.
or
(
AGENTS_VOICE_CONNECTING
.
isEqualTo
(
true
)
,
AGENTS_VOICE_RECONNECTING
.
isEqualTo
(
true
)
,
)
,
)
,
:
{
:
.
,
:
.
and
(
,
AGENTS_VOICE_ENABLED
,
.
notEquals
(
`config.${AgentsVoiceSettingId.ShowButton}`
,
false
)
,
.
.
isEqualTo
(
.
)
,
.
or
(
AGENTS_VOICE_CONNECTING
.
isEqualTo
(
true
)
,
AGENTS_VOICE_RECONNECTING
.
isEqualTo
(
true
)
,
)
,
VOICE_ACTIVE_ON_SURFACE
,
)
,
:
'navigation'
,
:
-
10
}
}
)
;
}
async
run
(
)
:
Promise
<
void
>
{
// No-op — just a visual indicator
}
}
)
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
'agentsVoice.startVoiceInChat'
,
:
.
localize2
(
'agentsVoice.startVoiceInChat'
,
"Voice Mode"
)
,
:
.
,
:
AGENTS_VOICE_ENABLED
,
:
{
:
.
,
:
.
and
(
,
AGENTS_VOICE_ENABLED
,
.
notEquals
(
`config.${AgentsVoiceSettingId.ShowButton}`
,
false
)
,
.
.
isEqualTo
(
.
)
,
.
.
negate
(
)
,
AGENTS_VOICE_LISTENING
.
negate
(
)
,
AGENTS_VOICE_CONNECTING
.
negate
(
)
,
AGENTS_VOICE_RECONNECTING
.
negate
(
)
,
// Hide Voice Mode while dictation is active (recording or the
// model is loading) so the two mic affordances never compete.
.
.
negate
(
)
,
.
.
negate
(
)
,
)
,
:
'navigation'
,
:
-
10
}
,
:
{
:
.
,
:
.
|
.
|
.
,
:
.
and
(
,
AGENTS_VOICE_ENABLED
,
.
,
)
,
}
,
}
)
;
}
async
run
(
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
get
(
)
.
getValue<boolean>
(
'agents.voice.handsFree'
)
===
true
;
const
=
getActiveWindow
(
)
;
.
setActiveWindow
(
)
;
// Capture hold-mode FIRST, synchronously, before any `await`. The
// keybinding service only reports a held chord while it is still
// dispatching this command; the moment `run()` first suspends on an
// await it clears `_currentlyDispatchingCommandId`, after which
// `enableKeybindingHoldMode` returns `undefined`. Calling it up-front is
// what makes press-and-hold work even on the very first (cold) press
// where we still have to connect. `undefined` here means the action was
// invoked without a held key (toolbar mic button / command palette).
const
=
.
enableKeybindingHoldMode
(
'agentsVoice.startVoiceInChat'
)
;
// An explicit press in another composer transfers Voice Mode ownership to
// that composer. The draft sentinel deliberately clears the concrete target.
const
=
await
.
get
(
)
.
executeCommand<string|undefined>
(
'_chat.voice.getCurrentSession'
)
;
if
(
)
{
try
{
const
=
URI
.
parse
(
)
;
if
(
.
===
'sessions-voice'
)
{
.
setDraftTarget
(
)
;
}
else
{
.
setTargetSession
(
)
;
.
activateSession
(
)
;
}
}
catch
{
// The routing command owns validation; leave the current target unchanged.
}
}
// Ensure the session is connected before we start recording. The mic
// button's first press connects; a held keybinding also connects here so
// that press-and-hold works on the very first invocation. If the user
// releases the key while we're still connecting, `holdMode` resolves
// early and the awaited release below fires right after pttDown() — the
// controller then treats it as a quick tap (toggle on).
const
=
.
.
get
(
)
;
if
(
!
)
{
await
.
connect
(
)
;
}
if
(
!
&&
!
&&
!
)
{
return
;
}
// Map the physical key/button gesture directly onto the controller's
// push-to-talk model: press => pttDown(), release => pttUp(). The
// controller itself decides tap-vs-hold based on how long the key was
// held (a quick tap enters toggle mode and keeps recording; a real hold
// records only while held). `enableKeybindingHoldMode` also swallows OS
// key-repeat while held, so holding the shortcut no longer rapidly
// toggles.
.
pttDown
(
)
;
if
(
!
)
{
// Not invoked via a held keybinding (toolbar mic button or command
// palette): emulate a tap so the controller enters toggle mode and
// keeps listening. Pressing the button/shortcut again stops.
.
pttUp
(
)
;
return
;
}
await
;
.
pttUp
(
)
;
}
}
)
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
'agentsVoice.pttStopInChat'
,
:
.
localize2
(
'agentsVoice.pttStopInChat'
,
"Voice Mode: Stop Recording"
)
,
:
.
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
AGENTS_VOICE_LISTENING
.
isEqualTo
(
true
)
,
)
,
:
{
:
.
,
:
.
and
(
,
AGENTS_VOICE_ENABLED
,
.
notEquals
(
`config.${AgentsVoiceSettingId.ShowButton}`
,
false
)
,
.
.
isEqualTo
(
.
)
,
.
.
negate
(
)
,
AGENTS_VOICE_LISTENING
.
isEqualTo
(
true
)
,
VOICE_ACTIVE_ON_SURFACE
,
)
,
:
'navigation'
,
:
-
10
}
,
// NOTE: intentionally no keybinding. The Cmd+Shift+Space chord is
// owned solely by `agentsVoice.startVoiceInChat`, which handles both
// starting and stopping (via the controller's push-to-talk model).
// Binding the same chord here as well caused the two actions to
// fight on every OS key-repeat, producing rapid start/stop toggling.
}
)
;
}
async
run
(
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
// Stop recording and the auto-listen loop but keep the WebSocket
// connected so the user can resume without reconnecting. Use the
// separate "Disconnect Voice Mode" button to fully end the session.
.
stopListening
(
)
;
}
}
)
;
// --- Disconnect Voice (command palette + separate toolbar button when connected) ---
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
'agentsVoice.disconnect'
,
:
.
localize2
(
'agentsVoice.disconnect'
,
"Disconnect Voice Mode"
)
,
:
.
,
:
true
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
AGENTS_VOICE_CONNECTED
.
isEqualTo
(
true
)
,
)
,
:
{
:
.
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
.
notEquals
(
`config.${AgentsVoiceSettingId.ShowButton}`
,
false
)
,
.
.
isEqualTo
(
.
)
,
.
.
negate
(
)
,
AGENTS_VOICE_CONNECTED
.
isEqualTo
(
true
)
,
VOICE_ACTIVE_ON_SURFACE
,
// The segmented voice pill's voice cell is itself the on/off toggle,
// so a separate disconnect button would be redundant there.
,
)
,
:
'navigation'
,
:
-
9
}
,
:
{
// Keep this below the editor widgets and negate their contexts so
// Escape still dismisses IntelliSense/hover and clears selections
// while the user is typing in the chat input.
:
.
-
5
,
:
.
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
.
,
AGENTS_VOICE_CONNECTED
.
isEqualTo
(
true
)
,
VOICE_ACTIVE_ON_SURFACE
,
// Don't disconnect voice while a request is running — pressing
// Escape there is meant to interrupt/cancel that request, not
// tear down the voice session (which is especially disruptive
// in hands-free mode where there is no reconnect button).
.
.
negate
(
)
,
.
.
toNegated
(
)
,
.
.
toNegated
(
)
,
.
.
toNegated
(
)
,
)
,
}
,
}
)
;
}
async
run
(
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
.
disconnect
(
'explicit'
)
;
}
}
)
;
// --- Cancel Active Request via Escape (while voice-connected in the chat input) ---
//
// The Disconnect-on-Escape action above deliberately does NOTHING while a
// request is running (its `when` negates hasActiveRequest) so it doesn't tear
// down the voice session mid-turn. But the built-in Cancel action is bound to
// Cmd/Ctrl+Escape (Alt+Backspace on Windows), so plain Escape would otherwise
// be a no-op there. Restore the expected behavior: plain Escape cancels the
// in-flight request while leaving the idle-only disconnect intact.
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
'agentsVoice.cancelActiveRequest'
,
:
.
localize2
(
'agentsVoice.cancelActiveRequest'
,
"Voice Mode: Cancel Request"
)
,
:
false
,
:
{
:
.
-
5
,
:
.
,
:
.
and
(
AGENTS_VOICE_ENABLED
,
.
,
AGENTS_VOICE_CONNECTED
.
isEqualTo
(
true
)
,
// Mirror the disconnect binding's editor negations so Escape
// still dismisses IntelliSense/hover and clears selections first.
// Capture hold mode before awaiting so the dispatching command is still available.
const
=
.
enableKeybindingHoldMode
(
'agentsVoice.pushToTalk'
)
;
// Auto-connect on first PTT press
if
(
!
.
.
get
(
)
&&
!
.
.
get
(
)
)
{
await
.
connect
(
getActiveWindow
(
)
)
;
}
if
(
!
.
.
get
(
)
)
{
return
;
}
.
pttDown
(
)
;
if
(
!
)
{
// Not invoked via a held keybinding: emulate a tap so the controller
// enters toggle mode and keeps listening. Pressing again stops.
.
pttUp
(
)
;
return
;
}
// The shortcut is being held: wait for release, then finish the turn.
// The controller decides tap-vs-hold based on how long it was held.
await
;
.
pttUp
(
)
;
}
}
)
;
// Microphone selection is shared with dictation via the single
// `workbench.action.chat.selectSpeechToTextMicrophone` command (see
// chatSpeechToTextActions.ts), so Voice Mode no longer registers its own.
// --- Settings ---
const
=
.
as<IConfigurationRegistry>
(
.
)
;
.
registerConfiguration
(
{
:
'agentsVoice'
,
:
.
localize
(
'agentsVoiceConfigurationTitle'
,
"Voice Mode"
)
,
:
'object'
,
:
{
'agents.voice.enabled'
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.enabled'
,
"Enable the Voice Mode panel in the chat view for voice-driven coding conversations."
)
,
default
:
false
,
:
{
:
'auto'
,
}
,
:
[
'experimental'
]
,
:
.
APPLICATION
,
:
true
,
}
,
[
.
]
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.showButton'
,
"Controls whether the Voice Mode button is shown in the chat input. When hidden, Voice Mode can still be started with its keyboard shortcut."
)
,
default
:
true
,
:
[
'experimental'
]
,
:
.
APPLICATION
,
}
,
'agents.voice.backendUrl'
:
{
:
'string'
,
:
.
localize
(
'agents.voice.backendUrl'
,
"Voice backend WebSocket URL. Leave empty to use the default hosted backend. Set to e.g. `ws://localhost:8000/api/v1/realtime/voice` to point at a backend running on your machine."
)
,
default
:
''
,
:
.
APPLICATION
,
:
false
,
}
,
'agents.voice.speakResponses'
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.speakResponses'
,
"When enabled, the assistant reads responses aloud. When disabled, responses are not spoken; enable `#agents.voice.showTranscript#` to read them as a text transcript instead."
)
,
default
:
true
,
:
.
APPLICATION
,
}
,
[
VOICE_AGENT_PROGRESS_SETTING
]
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.agentProgress'
,
"Allow Agent mode to speak brief semantic progress updates while it investigates, plans, edits, validates, or recovers from a problem."
)
,
default
:
true
,
:
[
'experimental'
]
,
:
.
APPLICATION
,
}
,
'agents.voice.voice'
:
{
:
'string'
,
enum
:
[
'harper_neutral'
,
'birch_neutral'
,
'junho_neutral'
,
'oak_neutral'
]
,
:
[
'Harper'
,
'Birch'
,
'Junho'
,
'Oak'
]
,
:
[
.
localize
(
'agents.voice.voice.harper'
,
"Harper."
)
,
.
localize
(
'agents.voice.voice.birch'
,
"Birch."
)
,
.
localize
(
'agents.voice.voice.junho'
,
"Junho."
)
,
.
localize
(
'agents.voice.voice.oak'
,
"Oak."
)
,
]
,
:
.
localize
(
'agents.voice.voice'
,
"The voice used when the assistant reads responses aloud. Changing this while voice mode is connected takes effect immediately. Use [Voice Mode instructions](command:{0}) to customize Voice Mode behavior and terminology."
,
CONFIGURE_VOICE_INSTRUCTIONS_ACTION_ID
)
,
default
:
'birch_neutral'
,
:
.
APPLICATION
,
}
,
'agents.voice.language'
:
{
:
'string'
,
enum
:
[
'auto'
,
'en'
,
'de'
,
'es'
,
'fr'
,
'it'
,
'pt'
,
'ja'
,
'ko'
,
'zh'
]
,
:
[
.
localize
(
'agents.voice.language.auto'
,
"Automatic"
)
,
.
localize
(
'agents.voice.language.en'
,
"English"
)
,
.
localize
(
'agents.voice.language.de'
,
"German"
)
,
.
localize
(
'agents.voice.language.es'
,
"Spanish"
)
,
.
localize
(
'agents.voice.language.fr'
,
"French"
)
,
.
localize
(
'agents.voice.language.it'
,
"Italian"
)
,
.
localize
(
'agents.voice.language.pt'
,
"Portuguese"
)
,
.
localize
(
'agents.voice.language.ja'
,
"Japanese"
)
,
.
localize
(
'agents.voice.language.ko'
,
"Korean"
)
,
.
localize
(
'agents.voice.language.zh'
,
"Chinese"
)
,
]
,
:
.
localize
(
'agents.voice.language'
,
"The language used for speech recognition, dictation, and spoken responses. The selectable languages support native voice output. Automatic uses the configured display language for speech recognition and dictation when supported; otherwise, it follows the system or browser locale. English voice output is used when the detected language does not support native voice output. Changing this while voice mode is connected takes effect immediately."
)
,
default
:
'auto'
,
:
.
APPLICATION
,
}
,
'agents.voice.showTranscript'
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.showTranscript'
,
"Show the voice transcript overlay in the chat input area while voice mode is active. Enable this to read responses as text when `#agents.voice.speakResponses#` is disabled."
)
,
default
:
false
,
:
.
APPLICATION
,
}
,
'agents.voice.liveTranscript'
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.liveTranscript'
,
"Show your speech as a live, word-by-word transcript while you are speaking. When disabled, your transcript appears only once you finish speaking. Requires `#agents.voice.showTranscript#` to be enabled to be visible."
)
,
default
:
false
,
:
.
APPLICATION
,
}
,
'agents.voice.handsFree'
:
{
:
'boolean'
,
:
.
localize
(
'agents.voice.handsFree'
,
"When enabled, voice mode automatically re-enters listening after the assistant finishes speaking, so you can hold a hands-free back-and-forth conversation. When disabled, you start and end each turn manually, and ending the turn sends it. Turns are not ended automatically on trailing silence or a stop phrase unless {0} or {1} is explicitly configured."
,
'`#agents.voice.turn.silenceMs#`'
,
'`#agents.voice.turn.stopPhrases#`'
)
,
default
:
true
,
:
.
APPLICATION
,
}
,
'agents.voice.turn.silenceMs'
:
{
:
'number'
,
:
.
localize
(
'agents.voice.turn.silenceMs'
,
"Trailing silence in milliseconds before the backend ends the turn automatically. Set to `-1` to disable ending the turn on silence, in which case the turn ends only via a stop phrase ({0}) or manually. When enabled, the backend clamps this to its supported range (currently 200-5000 ms) and is the source of truth. When hands-free mode ({1}) is disabled, the turn is not ended on silence by default unless this setting is explicitly configured, so you keep manual control over when a turn is sent."
,
'`#agents.voice.turn.stopPhrases#`'
,
'`#agents.voice.handsFree#`'
)
,
default
:
800
,
:
[
{
const
:
-
1
,
:
.
localize
(
'agents.voice.turn.silenceMs.disabled'
,
"Do not end the turn on trailing silence."
)
,
}
,
{
:
'number'
,
:
200
,
:
5000
,
}
,
]
,
:
.
APPLICATION
,
}
,
'agents.voice.turn.stopPhrases'
:
{
:
'array'
,
:
{
:
'string'
}
,
:
.
localize
(
'agents.voice.turn.stopPhrases'
,
"Phrases that end the turn when spoken at the end of an utterance. Leave empty to disable ending the turn on a stop phrase, in which case the turn ends only on trailing silence ({0}) or manually. The backend strips the matched phrase from the transcript before it reaches the agent. When hands-free mode ({1}) is disabled, stop phrases do not end the turn by default unless this setting is explicitly configured, so you keep manual control over when a turn is sent."
,
'`#agents.voice.turn.silenceMs#`'
,
'`#agents.voice.handsFree#`'
)
,
default
:
[
'send it'
]
,
:
.
APPLICATION
,
}
,
}
}
)
;
// Migrate the removed `agents.voice.turn.autoEndMode` setting onto the two
// settings that now govern turn-ending, preserving the previous behavior:
// silence ending is disabled (`silenceMs: -1`) unless the old mode was `vad`
// or `both`, and stop-phrase ending is disabled (`stopPhrases: []`) unless the