Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* The agents whose SDK the user has agreed to fetch, each recorded on its own
* first explicit Download. `APPLICATION` + `USER` so it follows the person, not
* the machine — see {@link resolveConsentedSdkDownloads} for why it is neither
* re-asked per version nor shared between agents.
*/
const
AGENT_SDK_DOWNLOAD_CONSENT_KEY
=
'agentHost.agentSdkDownloadConsent'
;
/** The Copilot sign-in flow, shared with `AgentHostSignedOutModelsNotification`. */
const
CHAT_SETUP_COMMAND_ID
=
'workbench.action.chat.triggerSetup'
;
export
const
=
createDecorator<IAgentSdkSetupService>
(
'agentSdkSetupService'
)
;
/**
* Where the user stands with one agent's setup: the download is on offer, the
* SDK is on disk and found no account, or the agent has models. Every other
* case — the feature not applying, a fetch in flight — is `undefined`.
*/
export
type
AgentSdkSetupState
=
'downloadOffered'
|
'noAccount'
|
'resolved'
;
/**
* One step of the setup funnel: `downloadOffered` → a download (clicked, or
* taken under standing consent) → `noAccount` → a route out of it →
* `resolved`, the step that decides whether this was worth building. The states
* are reported by the banner that computes them, the routes by this service.
*/
type
AgentSdkSetupFunnelStep
=
|
|
'downloadClicked'
|
'consentedDownload'
|
'docsClicked'
|
'gitHubSignInClicked'
|
'signInClicked'
|
'reloadClicked'
;
interface
IAgentSdkSetupFunnelEvent
{
:
string
;
:
string
;
}
type
AgentSdkSetupFunnelClassification
=
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent whose setup this step belongs to, e.g. claude or codex.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Which step of the agent SDK setup funnel was reached (downloadOffered, downloadClicked, consentedDownload, noAccount, docsClicked, gitHubSignInClicked, signInClicked, reloadClicked, resolved).'
}
;
:
'TylerLeonhardt'
;
:
'Tracks how far a signed-out user gets through setting up their own Claude or Codex account.'
;
}
;
export
interface
IAgentSdkSetupService
{
readonly
:
undefined
;
/** Every agent that has published a setup status, newest state. */
readonly
:
readonly
[
]
;
readonly
:
<
readonly
[
]
>
;
/**
* Ask `agent` to fetch its SDK, and record standing consent to do so again
* for later version bumps.
*/
requestDownload
(
:
string
)
:
void
;
/** Open the setup instructions `agent` published, if it published any. */
openSetupDocs
(
:
string
)
:
void
;
/**
* Ask `agent` to look again at a setup the user completed outside the app —
* the only signal there is that a `claude login` in a terminal finished.
*/
requestReload
(
:
string
)
:
void
;
/** Start GitHub sign-in, which reaches every agent's models through our proxy. */
signInToGitHub
(
:
string
)
:
void
;
/** Start `agent`'s own sign-in flow, if it declared one. */
signIn
(
:
string
)
:
void
;
/**
* Whether `agent` has been asked to fetch its SDK and the host has not
* answered yet — already downloading, as far as this window can tell.
*/
isDownloadPending
(
:
string
)
:
boolean
;
/**
* Record that the user reached `state`. Public because the banner is
* where these three are computed and this service cannot see them; every other
* step is reported by the method that takes it.
*/
reportSetupState
(
:
string
,
:
)
:
void
;
}
class
AgentSdkSetupService
extends
Disposable
implements
IAgentSdkSetupService
{
declare
readonly
:
undefined
;
private
readonly
=
this
.
_register
(
new
Emitter<readonly IAgentSdkSetupInfo[]>
(
)
)
;
readonly
=
this
.
.
;
private
:
readonly
[
]
=
[
]
;
/**
* Agents whose SDK we have already re-requested under standing consent, so a
* download that fails (and so reports `notDownloaded` again) is retried on the
* next window rather than immediately, forever.
*/
private
readonly
=
new
Set<string>
(
)
;
/**
* Agents we have asked to fetch and the host has not answered yet. Cleared on
* that answer rather than on success, so a failed download — which republishes
* `notDownloaded` after the `downloading` we cleared on — re-offers the button.
*/
private
readonly
=
new
Set<string>
(
)
;
get
setups
(
)
:
readonly
[
]
{
return
this
.
;
}
constructor
(
@IAgentHostService
private
readonly
:
,
@IStorageService
private
readonly
:
,
@ITelemetryService
private
readonly
:
,
@ILogService
private
readonly
:
,
@IOpenerService
private
readonly
:
,
@ICommandService
private
readonly
:
,
@ICodexAccountService
private
readonly
:
,
)
{
super
(
)
;
// `rootState` is a getter over a protocol client the host replaces on every
// restart and reconnect, so one subscription taken here would go quietly
// stale — re-bind, as the banner and the Copilot notification both do.
const
=
this
.
_register
(
new
DisposableStore
(
)
)
;
const
bindRootState
=
(
)
=>
{
.
clear
(
)
;
.
add
(
this
.
.
.
onDidChange
(
=>
this
.
_updateSetups
(
readAgentSdkSetupInfos
(
)
)
)
)
;
// A request the previous host never answered never will be; dropping it
// re-offers the button rather than suppressing the offer for good.
this
.
.
clear
(
)
;
const
=
this
.
.
.
;
this
.
_updateSetups
(
readAgentSdkSetupInfos
(
instanceof
Error
?
undefined
:
)
)
;
}
;
bindRootState
(
)
;
this
.
_register
(
this
.
.
onAgentHostStart
(
)
)
;
}
requestDownload
(
:
string
)
:
void
{
const
=
new
Set
(
this
.
_readConsentedAgents
(
)
)
;
.
add
(
)
;
this
.
.
store
(
AGENT_SDK_DOWNLOAD_CONSENT_KEY
,
writeConsentedSdkAgents
(
)
,
.
APPLICATION
,
.
USER
)
;
this
.
.
add
(
)
;
this
.
_reportStep
(
,
'downloadClicked'
)
;
this
.
_dispatchDownloadRequest
(
)
;
}
openSetupDocs
(
:
string
)
:
void
{
const
=
this
.
_getSetup
(
)
?.
;
if
(
!
)
{
return
;
}
this
.
_reportStep
(
,
'docsClicked'
)
;
// The URL is declared by the agent, so it is validated like any other
// externally-supplied link rather than trusted.
void
this
.
.
open
(
,
{
:
true
}
)
;
}
requestReload
(
:
string
)
:
void
{
this
.
_reportStep
(
,
'reloadClicked'
)
;
// Deliberately not a pending request: that set gates the download offer, and
// a reload happens in a state where there is nothing to offer.
this
.
_dispatchRequest
(
AGENT_SDK_SETUP_RELOAD_REQUEST_KEY
,
)
;
}
signInToGitHub
(
:
string
)
:
void
{
// A thin wrapper over the ordinary Copilot sign-in, taking the agent id only
// to attribute the click — which is the funnel's most telling drop.
this
.
_reportStep
(
,
'gitHubSignInClicked'
)
;
void
this
.
.
executeCommand
(
CHAT_SETUP_COMMAND_ID
)
;
}
signIn
(
:
string
)
:
void
{
// Codex is the only agent with an in-app sign-in today, and comparing against
// the service's own `agent` rather than a literal keeps `'codex'` out of the
// workbench. A second such agent turns this comparison into a lookup.
// This feature is diagnosed from a user's attached log far more often than
// from a dashboard; the event says how many, this line says why this person.
this
.
.
trace
(
`[AgentSdkSetup] ${agent}: ${step}`
)
;
}
private
_getSetup
(
:
string
)
:
|
undefined
{
return
this
.
.
find
(
=>
.
===
)
;
}
private
_dispatchDownloadRequest
(
:
string
)
:
void
{
this
.
.
add
(
)
;
this
.
_dispatchRequest
(
AGENT_SDK_SETUP_DOWNLOAD_REQUEST_KEY
,
)
;
// The statuses are unchanged but {@link isDownloadPending} is not, and
// without this the offer stays up until the host answers — the flicker the
// pending set exists to prevent.
this
.
.
fire
(
this
.
)
;
}
private
_dispatchRequest
(
:
string
,
:
string
)
:
void
{
// A fresh nonce every time so pressing the same thing twice is two
// requests; the agent clears the key as it consumes it.
this
.
.
dispatch
(
ROOT_STATE_URI
,
{
:
.
,
:
{
[
]
:
{
,
:
generateUuid
(
)
}
}
,
}
)
;
}
private
_updateSetups
(
:
readonly
[
]
)
:
void
{
this
.
=
;
for
(
const
of
)
{
// Any status but `notDownloaded` is the host answering our request.
if
(
.
!==
'notDownloaded'
)
{
this
.
.
delete
(
.
)
;
}
}
this
.
_applyConsent
(
)
;
this
.
.
fire
(
)
;
}
private
_readConsentedAgents
(
)
:
<
string
>
{
return
readConsentedSdkAgents
(
this
.
.
get
(
AGENT_SDK_DOWNLOAD_CONSENT_KEY
,
.
APPLICATION
)
)
;
}
/**
* Honour standing consent without asking again. Runs on every status change
* because a host that starts (or a remote that connects) publishes
* `notDownloaded` only once it is up — there is no earlier moment to catch.
*/