Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Per-target checksums for a platform-specific extension published to a GitHub release.
* Keyed by marketplace target platform (e.g. `win32-x64`, `linux-armhf`, `alpine-x64`).
* The matching release asset is resolved by convention as `<name>-<osAlias>-<arch>.vsix`.
*/
?
:
{
[
:
string
]
:
string
}
;
:
{
:
string
;
:
{
:
string
;
:
string
;
:
string
;
:
string
;
}
;
:
string
;
}
;
}
const
=
.
dirname
(
.
dirname
(
import
.
.
)
)
;
const
=
JSON
.
parse
(
.
readFileSync
(
.
join
(
import
.
.
,
'../../product.json'
)
,
'utf8'
)
)
;
const
=
.
as
[
]
||
[
]
;
const
=
.
as
[
]
||
[
]
;
const
=
.
join
(
.
homedir
(
)
,
'.vscode-oss-dev'
,
'extensions'
,
'control.json'
)
;
const
ENABLE_LOGGING
=
!
.
[
'VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'
]
;
/**
* Set this to keep working on a machine that has no access to the marketplace: cached built-in
* extensions are used as-is and no download is attempted, which also avoids the connect and
* retry timeouts that an offline download would otherwise burn on every launch.
*/
const
=
'VSCODE_BUILTIN_EXTENSIONS_OFFLINE'
;
function
log
(
...
:
string
[
]
)
:
void
{
if
(
ENABLE_LOGGING
)
{
fancyLog
(
...
)
;
}
}
function
getExtensionPath
(
:
)
:
string
{
return
getExtensionPathForName
(
.
)
;
}
function
getExtensionPathForName
(
:
string
)
:
string
{
return
.
join
(
,
'.build'
,
'builtInExtensions'
,
)
;
}
function
readCachedVersion
(
:
)
:
string
|
undefined
{
const
=
.
join
(
getExtensionPath
(
)
,
'package.json'
)
;
if
(
!
.
existsSync
(
)
)
{
return
undefined
;
}
try
{
const
=
JSON
.
parse
(
.
readFileSync
(
,
{
:
'utf8'
}
)
)
.
;
return
typeof
===
'string'
?
:
undefined
;
}
catch
(
)
{
return
undefined
;
}
}
function
isUpToDate
(
:
)
:
boolean
{
return
readCachedVersion
(
)
===
.
;
}
function
isInsiders
(
)
:
boolean
{
return
.
[
'VSCODE_QUALITY'
]
===
'insider'
;
}
function
getExtensionDownloadStream
(
:
)
{
let
:
;
if
(
.
)
{
=
.
fromVsix
(
.
join
(
,
.
)
,
)
;
}
else
if
(
.
)
{
// A platform-specific extension publishes its VSIX assets on a GitHub release using a
// specific asset naming convention, so it is always downloaded from GitHub and never falls
// back to the Marketplace (which does not serve those assets) even when a gallery is configured.
const
=
resolvePlatformSpecificAsset
(
)
;
if
(
!
)
{
return
.
readArray
(
[
]
)
;
}
=
.
fromGithub
(
,
{
,
:
isInsiders
(
)
}
)
;
}
else
if
(
.
?.
)
{
=
.
fromMarketplace
(
.
.
,
)
;
}
else
{
=
.
fromGithub
(
,
{
:
isInsiders
(
)
}
)
;
}
return
pipeStreams
(
)
.
pipe
(
rename
(
=>
.
=
`${extension.name}/${p.dirname}`
)
)
.
done
(
)
;
}
function
resolvePlatformSpecificAsset
(
:
)
:
{
:
string
;
:
string
}
|
undefined
{
const
=
getCurrentExtensionTarget
(
)
;
if
(
!
)
{
// Unsupported build platform (e.g. FreeBSD): no platform-specific asset can apply, so skip
// this extension gracefully instead of failing the whole build.
log
(
.
yellow
(
'[skip]'
)
,
`${extension.name}: no platform-specific asset for unsupported platform '${process.platform}-${process.env['VSCODE_ARCH']?? process.arch}'`
)
;
return
undefined
;
}
const
=
.
!
[
]
;
if
(
!
)
{
// The extension declares platform-specific assets but is missing one for this known target.
// This is a configuration error, so fail loudly.
throw
new
Error
(
`Built-in extension '${extension.name}' is platform-specific but has no asset for target '${target}'. Available targets: [${Object.keys(extension.platformSpecific!)}]`
)
;
}
return
{
:
getPlatformSpecificAssetName
(
.
,
)
,
}
;
}
export
function
getExtensionStream
(
:
)
{
// if the extension exists on disk, use those files instead of downloading anew
if
(
isUpToDate
(
)
)
{
log
(
'[extensions]'
,
`${extension.name}@${extension.version} up to date`
,
.
green
(
'✔︎'
)
)
;
return
.
src
(
[
'**'
]
,
{
:
getExtensionPath
(
)
,
:
true
}
)
.
pipe
(
rename
(
=>
.
=
`${extension.name}/${p.dirname}`
)
)
;
}
return
getExtensionDownloadStream
(
)
;
}
function
syncMarketplaceExtension
(
:
,
:
boolean
)
:
{
const
=
.
?.
;
const
=
.
blue
(
?
'[marketplace]'
:
'[github]'
)
;
if
(
isUpToDate
(
)
)
{
log
(
,
`${extension.name}@${extension.version}`
,
.
green
(
'✔︎'
)
)
;
return
.
readArray
(
[
]
)
;
}
if
(
)
{
logOfflineSkip
(
,
)
;
return
.
readArray
(
[
]
)
;
}
.
sync
(
getExtensionPath
(
)
)
;
return
pipeStreams
(
getExtensionDownloadStream
(
)
)
.
pipe
(
.
dest
(
'.build/builtInExtensions'
)
)
.
done
(
)
.
on
(
'end'
,
(
)
=>
log
(
,
.
,
.
green
(
'✔︎'
)
)
)
;
}
/** Reports what the cached copy is, or that there is no cached copy to fall back on. */
function
logOfflineSkip
(
:
,
:
string
)
:
void
{
const
=
readCachedVersion
(
)
;
if
(
)
{
log
(
,
.
blue
(
'[offline]'
)
,
`${extension.name}@${cachedVersion}`
,
.
gray
(
`(wanted ${extension.version})`
)
)
;
}
else
{
log
(
.
yellow
(
'[skip]'
)
,
`${extension.name}@${extension.version}: not cached and downloads are disabled`
)
;
}
}
function
syncExtension
(
:
,
:
'disabled'
|
'marketplace'
,
:
boolean
)
:
{
if
(
.
)
{
const
=
new
Set
(
.
)
;
if
(
!
.
has
(
.
)
)
{
log
(
.
gray
(
'[skip]'
)
,
`${extension.name}@${extension.version}: Platform '${process.platform}' not supported: [${extension.platforms}]`
,
.
green
(
'✔︎'
)
)
;
return
.
readArray
(
[
]
)
;
}
}
switch
(
)
{
case
'disabled'
:
log
(
.
blue
(
'[disabled]'
)
,
.
gray
(
.
)
)
;
return
.
readArray
(
[
]
)
;
case
'marketplace'
:
return
syncMarketplaceExtension
(
,
)
;
default
:
if
(
!
.
existsSync
(
)
)
{
log
(
.
red
(
`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`
)
)
;
return
.
readArray
(
[
]
)
;
}
else
if
(
!
.
existsSync
(
.
join
(
,
'package.json'
)
)
)
{
log
(
.
red
(
`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`
`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`
)
;
const
=
isTruthyEnvFlag
(
.
[
]
)
;
if
(
)
{
log
(
.
blue
(
'[offline]'
)
,
`${offlineEnvVar} is set: using cached built-in extensions only`
)
;
}
const
=
readControlFile
(
)
;
const
=
[
...
,
...
]
;
for
(
const
of
)
{
[
.
]
=
[
.
]
||
'marketplace'
;
}
writeControlFile
(
)
;
const
=
await
runSyncJobs
(
.
map
(
=>
(
{
:
.
,
run
:
(
)
=>
drainStream
(
syncExtension
(
,
[
.
]
,
)
)
,
}
)
)
)
;
const
:
string
[
]
=
[
]
;
let
:
unknown
;
for
(
const
of
)
{
if
(
!
.
)
{
// A bad checksum, an unexpected HTTP status or a missing asset is a broken
// configuration, not a missing network: keep failing loudly.
??=
.
;
continue
;
}
log
(
.
yellow
(
'[warn]'
)
,
`${failure.name}: ${describeFailure(failure.error)}, the network looks unreachable`
)
;
removePartialDownload
(
.
)
;
.
push
(
.
)
;
}
if
(
!==
undefined
)
{
throw
;
}
if
(
.
>
0
)
{
log
(
.
yellow
(
'[warn]'
)
,
`Continuing without ${skipped.join(', ')}; they stay unavailable until they can be downloaded.`
)
;
log
(
.
yellow
(
'[warn]'
)
,
`Set ${ansiColors.cyan(`${offlineEnvVar}=1`)} to skip the download attempt, or run ${ansiColors.cyan('npm run download-builtin-extensions')} once the network is back.`
)
;
}
}
/**
* Drops what a failed download left behind. The previous copy was already removed before the
* download started, so whatever is on disk is incomplete and should not be mistaken for it.
*/
function
removePartialDownload
(
:
string
)
:
void
{
try
{
.
sync
(
getExtensionPathForName
(
)
)
;
}
catch
(
)
{
log
(
.
yellow
(
'[warn]'
)
,
`Could not clean up a partial download of ${name}: ${err}`