Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
// `force-disable-user-env: true` short-circuits before spawning a shell —
// without it `shellEnv.ts:140` registers a cancellation listener that
// leaks across tests and trips ensureNoDisposablesAreLeakedInTestSuite.
return
{
,
:
{
'force-disable-user-env'
:
true
}
as
never
}
as
unknown
as
;
}
function
makeProductService
(
:
{
:
string
;
:
string
}
|
undefined
)
:
{
return
{
:
?
{
:
}
:
undefined
,
}
as
unknown
as
;
}
function
makeRequestService
(
:
<
,
'add'
>
)
:
{
// Bare RequestService: no http.proxy setting, no special config.
// Reads system proxy env vars (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) — none set
// in CI so direct connection to the test loopback server works.
return
.
add
(
new
RequestService
(
'local'
,
new
TestConfigurationService
(
)
,
makeEnvService
(
'/unused-for-requestservice'
)
,
new
NullLogService
(
)
,
)
)
;
}
function
makeFileService
(
:
<
,
'add'
>
)
:
{
// Real FileService with DiskFileSystemProvider for `file://` — matches
// the wiring in `agentHostMain.ts`. Each test gets its own clean instance
// so provider registrations don't bleed across tests.
const
=
new
NullLogService
(
)
;
const
=
.
add
(
new
FileService
(
)
)
;
.
add
(
.
registerProvider
(
.
,
.
add
(
new
DiskFileSystemProvider
(
)
)
)
)
;
return
;
}
/**
* Unit tests for the platform/arch/libc → sdkTarget mapping. These cover
* the cross-product the downloader can't easily exercise (Universal x64
* launches from arm64 hosts, musl Linux from a macOS CI runner, …) by
* passing a synthetic host directly to the pure function.
*/
suite
(
'resolveSdkTarget'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
function
fakePkg
(
:
boolean
)
:
{
return
{
:
'test'
,
:
'Test'
,
:
'X'
,
}
;
}
test
(
'returns <platform>-<arch> for supported (platform, arch)'
,
(
)
=>
{
.
deepStrictEqual
(
{
'darwin-x64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'darwin'
,
:
'x64'
,
:
undefined
}
)
,
'darwin-arm64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'darwin'
,
:
'arm64'
,
:
undefined
}
)
,
'linux-x64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'linux'
,
:
'x64'
,
:
'glibc'
}
)
,
'linux-arm64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'linux'
,
:
'arm64'
,
:
'glibc'
}
)
,
'win32-x64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'win32'
,
:
'x64'
,
:
undefined
}
)
,
'win32-arm64'
:
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'win32'
,
:
'arm64'
,
:
undefined
}
)
,
}
,
{
'darwin-x64'
:
'darwin-x64'
,
'darwin-arm64'
:
'darwin-arm64'
,
'linux-x64'
:
'linux-x64'
,
'linux-arm64'
:
'linux-arm64'
,
'win32-x64'
:
'win32-x64'
,
'win32-arm64'
:
'win32-arm64'
,
}
)
;
}
)
;
test
(
'appends -musl on musl Linux iff the package has separate musl SKUs'
,
(
)
=>
{
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
true
)
,
{
:
'linux'
,
:
'x64'
,
:
'musl'
}
)
,
'linux-x64-musl'
,
'claude-style: musl host → -musl suffix'
,
)
;
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'linux'
,
:
'x64'
,
:
'musl'
}
)
,
'linux-x64'
,
'codex-style: musl host → no suffix (statically musl-linked, single SKU)'
,
)
;
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
true
)
,
{
:
'linux'
,
:
'x64'
,
:
'glibc'
}
)
,
'linux-x64'
,
'claude-style: glibc host → no suffix'
,
)
;
}
)
;
test
(
'returns undefined for unsupported (platform, arch)'
,
(
)
=>
{
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
true
)
,
{
:
'linux'
,
:
'armhf'
,
:
'glibc'
}
)
,
undefined
)
;
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
true
)
,
{
:
'freebsd'
as
.
,
:
'x64'
,
:
undefined
}
)
,
undefined
)
;
.
strictEqual
(
resolveSdkTarget
(
fakePkg
(
false
)
,
{
:
'darwin'
,
:
'ia32'
,
:
undefined
}
)
,
undefined
)
;
}
)
;
}
)
;
/**
* Integration tests for the downloader's network → cache → extract flow.
* These run against whatever `process.platform` the test host is — the
* pure `resolveSdkTarget` suite above covers the cross-host matrix.
*/
suite
(
'AgentSdkDownloader'
,
(
)
=>
{
const
=
new
DisposableStore
(
)
;
teardown
(
(
)
=>
.
clear
(
)
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
let
:
string
;
let
:
;
let
:
;
let
:
string
|
undefined
;
/** Whatever the host resolves to — used for cache-dir path assertions. */
let
:
string
;
/** A cancellation token whose source is disposed in teardown. */
function
newToken
(
)
{
const
=
.
add
(
new
CancellationTokenSource
(
)
)
;
return
.
;
}
suiteSetup
(
function
(
)
{
// Skip the integration suite on hosts the downloader can't resolve
// a target for (e.g. linux-armhf). `resolveSdkTarget` is covered
// above and doesn't need a real host.
const
=
resolveSdkTarget
(
)
;
if
(
!
)
{
this
.
skip
(
)
;
}
=
;
}
)
;
setup
(
async
(
)
=>
{
=
.
[
]
;
delete
.
[
]
;
=
await
.
mkdtemp
(
.
join
(
.
tmpdir
(
)
,
'sdk-userdata-'
)
)
;
=
await
buildFixtureTarball
(
)
;
=
await
startServer
(
await
.
readFile
(
.
)
)
;
}
)
;
teardown
(
async
(
)
=>
{
await
.
close
(
)
;
await
.
cleanup
(
)
;
await
.
rm
(
,
{
:
true
,
:
true
}
)
;
if
(
===
undefined
)
{
delete
.
[
]
;
}
else
{
.
[
]
=
;
}
}
)
;
/**
* Default urlTemplate references `{sdkTarget}` so we exercise the
* substitution path; tests that need a custom URL pass urlTemplate
* explicitly. Pass `productConfig: null` to omit the agentSdks block
* entirely (the "no product config" case).
*/