Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/import'./bootstrap-server.js';// this MUST come before other imports as it changes global stateimport*as path from'node:path';import*as fs from'node:fs';import*as http from'node:http';importtype{ AddressInfo }from'node:net';import*as os from'node:os';import*as readline from'node:readline';import{ performance }from'node:perf_hooks';import minimist
devInjectNodeModuleLookupPath removeGlobalNodeJsModuleLookupPaths
bootstrapESM
resolveNLSConfiguration
product
perf
INLSConfiguration
IServerAPI
perf
globalThis vscodeServerStartTime vscodeServerStartTime performance
parsedArgs processargv
alias help version
e
parsedArgse
envValue processenv
envValue
parsedArgse envValue
extensionLookupArgs
extensionInstallArgs
shouldSpawnCli parsedArgshelp parsedArgsversion extensionLookupArgsa parsedArgsa extensionInstallArgsa parsedArgsa parsedArgs
nlsConfiguration userLocale osLocale commit productcommit userDataPath nlsMetadataPath metadirname
shouldSpawnCli
nlsConfigurationmod
mod
_remoteExtensionHostAgentServer IServerAPI
_remoteExtensionHostAgentServerPromise IServerAPI
_remoteExtensionHostAgentServerPromise
_remoteExtensionHostAgentServerPromise nlsConfiguration mod
server modaddress
_remoteExtensionHostAgentServer server
server
_remoteExtensionHostAgentServerPromise
productserverLicense productserverLicenselength
productserverLicense
productserverLicensePrompt parsedArgs
process
accept productserverLicensePrompt
accept
process
e
e
process
firstRequest
firstWebSocket
address AddressInfo
server http req res
firstRequest
firstRequest
perf
remoteExtensionHostAgentServer
remoteExtensionHostAgentServerreq res
server req socket
firstWebSocket
firstWebSocket
perf
remoteExtensionHostAgentServer
remoteExtensionHostAgentServerreq socket
server err
remoteExtensionHostAgentServer
remoteExtensionHostAgentServererr
host parsedArgs parsedArgs
nodeListenOptions
parsedArgs
path parsedArgs
host port host parsedArgs
servernodeListenOptions
output productserverGreeting productserverGreetinglength
nodeListenOptionsport parsedArgs
ifaces os
Objectifaces ifname
ifacesifname iface
ifaceinternal ifacefamily
output
address server
address
output
output
output
perf
globalThis vscodeServerListenTime vscodeServerListenTime performance
process
server
_remoteExtensionHostAgentServer
_remoteExtensionHostAgentServer
val
val
val val
val val
processenv
startTime Date
logsPath parsedArgs os
diagnosticsFile pathlogsPath
fslogsPath recursive
mirrorToStderr
processstderr mirrorToStderr
mirrorToStderr
message
line
fsdiagnosticsFile
mirrorToStderr
processstderr
mirrorToStderr
describeState
processWithResources process NodeJSProcess getActiveResourcesInfo
activeResources processWithResourcesgetActiveResourcesInfo
memory process
err
process code
process code
handlingUncaughtException
process err origin
handlingUncaughtException
handlingUncaughtException
handlingUncaughtException
signals NodeJSSignals
signal signals
processsignal
signalNumber osconstantssignals Record signal
process signalNumber signalNumber
host strPort
strPort
range start end
strPort
strPort
range strPort
port host rangestart rangeend
port
port
process
process
strRange start end
match strRange
match
start match end match
start start end end
start end
host start end
port
resolve
server http
serverport host
server
port start port end port
port
port
nlsConfiguration INLSConfiguration
processenv nlsConfiguration
processenv
processenv
processenv processenv pathmetadirname
processenv
processenv
processstdinisTTY
error
question
rl readline
input processstdin
output processstdout
resolve reject
rlquestion data
rl
str data
str str str
str str
processstdout
question
// if an argument is passed multiple times, minimist creates an array
=
.
pop
(
)
;
// take the last item
}
return
typeof
===
'string'
?
:
undefined
;
}
/**
* Records why/when the remote server process exits, to help debug unexpected
* server exits in the remote smoke tests (which surface to the client as
* `Unknown reconnection token` reconnection failures). The handlers tell apart a
* self-exit (`beforeExit`), an external kill (`signal`) and a crash
* (`uncaughtExceptionMonitor`). Gated behind the `VSCODE_SERVER_EXIT_DIAGNOSTICS`
* env var (set by the smoke tests) so it adds no product noise. Lines are
* appended synchronously to a `server-exit-diagnostics.log` file in the server's
* `--logsPath` directory (falling back to `os.tmpdir()` when `--logsPath` is not
* provided) so they survive process teardown (an async stdio write from an
* `exit` handler does not).
*/
function
installServerProcessExitDiagnostics
(
)
:
void
{
if
(
!
.
[
'VSCODE_SERVER_EXIT_DIAGNOSTICS'
]
)
{
return
;
}
const
=
.
now
(
)
;
// Append diagnostics synchronously to a file rather than relying on
// `console.error`: a process `exit` handler cannot flush an async pipe write
// (the server's stdio is piped through the test resolver, and on Windows
// additionally through a `cmd.exe`/batch wrapper) before the process dies,
// so the exit-time lines we care about most were being dropped. A synchronous
// `fs.appendFileSync` survives teardown. We target the server's `--logsPath`
// directory because it is captured as a smoke test artifact.
const
=
sanitizeStringArg
(
[
'logsPath'
]
)
||
.
tmpdir
(
)
;
const
=
.
join
(
,
'server-exit-diagnostics.log'
)
;
try
{
.
mkdirSync
(
,
{
:
true
}
)
;
}
catch
{
// best effort: the directory is normally created by the server already
}
// The file write is authoritative: it is synchronous (so it survives process
// teardown) and goes to a captured smoke artifact. We additionally mirror to
// stderr for live visibility in the test resolver's output channel, but that
// mirror is dangerous precisely because these diagnostics fire when the
// server's stdio pipe is dying: a write to a broken pipe throws `EPIPE`
// synchronously and/or emits an async `error` event, either of which Node
// promotes to an uncaught exception — which re-enters the
// `uncaughtExceptionMonitor` handler below and loops (one CI run produced a
// 386MB log this way). We therefore make the mirror best-effort and latch it
// off after the first failure, and attach an `error` handler so async pipe
// errors are swallowed rather than crashing the process.
`received signal '${signal}' — terminating. ${describeState()}`
)
;
// Preserve default termination semantics after logging.
const
=
(
.
.
as
<
string
,
number
>
)
[
]
;
.
exit
(
typeof
===
'number'
?
128
+
:
1
)
;
}
)
;
}
catch
{
// Not all signals can be listened to on all platforms (e.g. SIGBREAK).
}
}
}
/**
* If `--port` is specified and describes a single port, connect to that port.
*
* If `--port`describes a port range
* then find a free port in that range. Throw error if no
* free port available in range.
*
* In absence of specified ports, connect to port 8000.
*/
async
function
parsePort
(
:
string
|
undefined
,
:
string
|
undefined
)
:
Promise
<
number
>
{
if
(
)
{
let
:
{
:
number
;
:
number
}
|
undefined
;
if
(
.
match
(
/^\d+$/
)
)
{
return
parseInt
(
,
10
)
;
}
else
if
(
=
parseRange
(
)
)
{
const
=
await
findFreePort
(
,
.
,
.
)
;
if
(
!==
undefined
)
{
return
;
}
// Remote-SSH extension relies on this exact port error message, treat as an API
console
.
warn
(
`--port: Could not find free port in range: ${range.start} - ${range.end} (inclusive).`
)
;
.
exit
(
1
)
;
}
else
{
console
.
warn
(
`--port "${strPort}" is not a valid number or range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`
)
;
.
exit
(
1
)
;
}
}
return
8000
;
}
function
parseRange
(
:
string
)
:
{
:
number
;
:
number
}
|
undefined
{
const
=
.
match
(
/^(\d+)-(\d+)$/
)
;
if
(
)
{
const
=
parseInt
(
[
1
]
,
10
)
,
=
parseInt
(
[
2
]
,
10
)
;
if
(
>
0
&&
<=
&&
<=
65535
)
{
return
{
,
}
;
}
}
return
undefined
;
}
/**
* Starting at the `start` port, look for a free port incrementing
* by 1 until `end` inclusive. If no free port is found, undefined is returned.
*/
async
function
findFreePort
(
:
string
|
undefined
,
:
number
,
:
number
)
:
Promise
<
number
|
undefined
>
{
const
testPort
=
(
:
number
)
=>
{
return
new
Promise
(
(
)
=>
{
const
=
.
createServer
(
)
;
.
listen
(
,
,
(
)
=>
{
.
close
(
)
;
resolve
(
true
)
;
}
)
.
on
(
'error'
,
(
)
=>
{
resolve
(
false
)
;
}
)
;
}
)
;
}
;
for
(
let
=
;
<=
;
++
)
{
if
(
await
testPort
(
)
)
{
return
;
}
}
return
undefined
;
}
async
function
loadCode
(
:
)
{
// required for `bootstrap-esm` to pick up NLS messages
.
[
'VSCODE_NLS_CONFIG'
]
=
JSON
.
stringify
(
)
;
// See https://github.com/microsoft/vscode-remote-release/issues/6543
// We would normally install a SIGPIPE listener in bootstrap-node.js
// But in certain situations, the console itself can be in a broken pipe state
// so logging SIGPIPE to the console will cause an infinite async loop
.
[
'VSCODE_HANDLES_SIGPIPE'
]
=
'true'
;
if
(
.
[
'VSCODE_DEV'
]
)
{
// When running out of sources, we need to load node modules from remote/node_modules,
// which are compiled against nodejs, not electron
.
[
'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'
]
=
.
[
'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'
]
||
.
join
(
import
.
.
,
'..'
,
'remote'
,
'node_modules'
)
;
devInjectNodeModuleLookupPath
(
.
[
'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'
]
)
;
}
else
{
delete
.
[
'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'
]
;
}
// Remove global paths from the node module lookup (node.js only)
removeGlobalNodeJsModuleLookupPaths
(
)
;
// Bootstrap ESM
await
bootstrapESM
(
)
;
// Load Server
return
import
(
'./vs/server/node/server.main.js'
)
;
}
function
hasStdinWithoutTty
(
)
:
boolean
{
try
{
return
!
.
.
;
// Via https://twitter.com/MylesBorins/status/782009479382626304
}
catch
(
)
{
// Windows workaround for https://github.com/nodejs/node/issues/11656
}
return
false
;
}
function
prompt
(
:
string
)
:
Promise
<
boolean
>
{
const
=
.
createInterface
(
{
:
.
,
:
.
}
)
;
return
new
Promise
(
(
,
)
=>
{
.
question
(
+
' '
,
async
function
(
)
{
.
close
(
)
;
const
=
.
toString
(
)
.
trim
(
)
.
toLowerCase
(
)
;
if
(
===
''
||
===
'y'
||
===
'yes'
)
{
resolve
(
true
)
;
}
else
if
(
===
'n'
||
===
'no'
)
{
resolve
(
false
)
;
}
else
{
.
.
write
(
'\nInvalid Response. Answer either yes (y, yes) or no (n, no)\n'