Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
`Usage: node ${process.argv[1]} [options] [file...]
Bare .ts/.js file paths passed as positional arguments are treated as
--run arguments.
Options:
--grep, -g, -f <pattern> only run tests matching <pattern>
--run <file> only run tests from <file>
--runGlob, --glob, --runGrep <file_pattern> only run tests matching <file_pattern>
--excludeRunGlob <file_pattern> exclude tests matching <file_pattern> from --runGlob
--testSplit <i>/<n> split tests into <n> parts and run the <i>th part
--build run with build output (out-build)
--coverage generate coverage report
--per-test-coverage generate a per-test V8 coverage report, only valid with the full-json-stream reporter
--dev, --dev-tools, --devTools <window> open dev tools, keep window open, reuse app data
--reporter <reporter> the mocha reporter (default: "spec")
--reporter-options <options> the mocha reporter options (default: "")
--waitServer <port> port to connect to and wait before running tests
--timeout <ms> timeout for tests
--crash-reporter-directory <path> crash reporter directory
--tfs <url> TFS server URL
--help, -h show the help`
)
;
.
exit
(
0
)
;
}
// Treat bare .ts/.js positional arguments as --run values
const
=
(
.
_
||
[
]
)
.
filter
(
a
=>
typeof
===
'string'
&&
(
.
endsWith
(
'.ts'
)
||
.
endsWith
(
'.js'
)
)
)
;
if
(
.
length
>
0
)
{
const
=
!
.
run
?
[
]
:
Array
.
isArray
(
.
run
)
?
.
run
:
[
.
run
]
;
.
run
=
[
...
,
...
]
;
.
_
=
(
.
_
||
[
]
)
.
filter
(
a
=>
!
.
includes
(
)
)
;
}
let
=
[
'crash-reporter-directory'
]
;
if
(
)
{
=
.
normalize
(
)
;
if
(
!
.
isAbsolute
(
)
)
{
console
.
error
(
`The path '${crashReporterDirectory}' specified for --crash-reporter-directory must be absolute.`
)
;
.
exit
(
1
)
;
}
if
(
!
existsSync
(
)
)
{
try
{
mkdirSync
(
)
;
}
catch
(
)
{
console
.
error
(
`The path '${crashReporterDirectory}' specified for --crash-reporter-directory does not seem to exist or cannot be created.`
)
;
.
exit
(
1
)
;
}
}
// Crashes are stored in the crashDumps directory by default, so we
// need to change that directory to the provided one
console
.
log
(
`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${crashReporterDirectory}'`
)
;
.
setPath
(
'crashDumps'
,
)
;
.
start
(
{
companyName
:
'Microsoft'
,
productName
:
.
env
[
'VSCODE_DEV'
]
?
`${product.nameShort} Dev`
:
.
nameShort
,
uploadToServer
:
false
,
compress
:
true
}
)
;
}
if
(
!
.
dev
)
{
.
setPath
(
'userData'
,
.
join
(
tmpdir
(
)
,
`vscode-tests-${Date.now()}-${process.pid}`
)
)
;
}
function
deserializeSuite
(
suite
)
{
return
{
root
:
.
root
,
suites
:
.
suites
,
tests
:
.
tests
,
title
:
.
title
,
titlePath
:
(
)
=>
.
titlePath
,
fullTitle
:
(
)
=>
.
fullTitle
,
timeout
:
(
)
=>
.
timeout
,
retries
:
(
)
=>
.
retries
,
slow
:
(
)
=>
.
slow
,
bail
:
(
)
=>
.
bail
}
;
}
function
deserializeRunnable
(
runnable
)
{
return
{
title
:
.
title
,
titlePath
:
(
)
=>
.
titlePath
,
fullTitle
:
(
)
=>
.
fullTitle
,
async
:
.
async
,
slow
:
(
)
=>
.
slow
,
speed
:
.
speed
,
duration
:
.
duration
,
currentRetry
:
(
)
=>
.
currentRetry
}
;
}
function
deserializeError
(
err
)
{
const
=
.
inspect
;
.
inspect
=
(
)
=>
;
// Unfortunately, mocha rewrites and formats err.actual/err.expected.
// This formatting is hard to reverse, so err.*JSON includes the unformatted value.
if
(
.
actual
)
{
.
actual
=
JSON
.
parse
(
.
actual
)
.
value
;
.
actualJSON
=
.
actual
;
}
if
(
.
expected
)
{
.
expected
=
JSON
.
parse
(
.
expected
)
.
value
;
.
expectedJSON
=
.
expected
;
}
return
;
}
class
IPCRunner
extends
events.EventEmitter
{
constructor
(
win
)
{
super
(
)
;
this
.
didFail
=
false
;
this
.
didEnd
=
false
;
.
on
(
'start'
,
(
)
=>
this
.
emit
(
'start'
)
)
;
.
on
(
'end'
,
(
)
=>
{
this
.
didEnd
=
true
;
this
.
emit
(
'end'
)
;
}
)
;
.
on
(
'suite'
,
(
e, suite
)
=>
this
.
emit
(
'suite'
,
deserializeSuite
(
)
)
)
;
.
on
(
'suite end'
,
(
e, suite
)
=>
this
.
emit
(
'suite end'
,
deserializeSuite
(
)
)
)
;
.
on
(
'test'
,
(
e, test
)
=>
this
.
emit
(
'test'
,
deserializeRunnable
(
)
)
)
;
.
on
(
'test end'
,
(
e, test
)
=>
this
.
emit
(
'test end'
,
deserializeRunnable
(
)
)
)
;
.
on
(
'hook'
,
(
e, hook
)
=>
this
.
emit
(
'hook'
,
deserializeRunnable
(
)
)
)
;
.
on
(
'hook end'
,
(
e, hook
)
=>
this
.
emit
(
'hook end'
,
deserializeRunnable
(
)
)
)
;
.
on
(
'pass'
,
(
e, test
)
=>
this
.
emit
(
'pass'
,
deserializeRunnable
(
)
)
)
;
.
on
(
'fail'
,
(
e, test, err
)
=>
{
this
.
didFail
=
true
;
this
.
emit
(
'fail'
,
deserializeRunnable
(
)
,
deserializeError
(
)
)
;
}
)
;
.
on
(
'pending'
,
(
e, test
)
=>
this
.
emit
(
'pending'
,
deserializeRunnable
(
)
)
)
;
.
handle
(
'startCoverage'
,
async
(
)
=>
{
.
webContents
.
debugger
.
attach
(
)
;
await
.
webContents
.
debugger
.
sendCommand
(
'Debugger.enable'
)
;
await
.
webContents
.
debugger
.
sendCommand
(
'Profiler.enable'
)
;
await
.
webContents
.
debugger
.
sendCommand
(
'Profiler.startPreciseCoverage'
,
{
detailed
:
true
,
allowTriggeredUpdates
:
false
,
}
)
;
}
)
;
const
=
new
Set
(
)
;
.
handle
(
'snapshotCoverage'
,
async
(
_, test
)
=>
{
const
=
await
.
webContents
.
debugger
.
sendCommand
(
'Profiler.takePreciseCoverage'
)
;
await
Promise
.
all
(
.
result
.
map
(
async
(
r
)
=>
{
if
(
!
.
has
(
.
scriptId
)
)
{
.
add
(
.
scriptId
)
;
const
=
await
.
webContents
.
debugger
.
sendCommand
(
'Debugger.getScriptSource'
,
{
scriptId
:
.
scriptId
}
)
;
.
source
=
.
scriptSource
;
}
}
)
)
;
if
(
!
)
{
this
.
emit
(
'coverage init'
,
)
;
}
else
{
this
.
emit
(
'coverage increment'
,
,
)
;
}
}
)
;
}
}
.
on
(
'ready'
,
(
)
=>
{
// needed when loading resources from the renderer, e.g xterm.js or the encoding lib
.
defaultSession
.
protocol
.
registerFileProtocol
(
'vscode-file'
,
(
request, callback
)
=>
{
const
=
new
URL
(
.
url
)
.
pathname
;
callback
(
{
}
)
;
}
)
;
.
on
(
'error'
,
(
_, err
)
=>
{
if
(
!
.
dev
)
{
console
.
error
(
)
;
.
exit
(
1
)
;
}
}
)
;
// We need to provide a basic `ISandboxConfiguration`
// for our preload script to function properly because
// some of our types depend on it (e.g. product.ts).
.
handle
(
'vscode:test-vscode-window-config'
,
async
(
)
=>
{
return
{
product
:
{
version
:
'1.x.y'
,
nameShort
:
'Code - OSS Dev'
,
nameLong
:
'Code - OSS Dev'
,
applicationName
:
'code-oss'
,
dataFolderName
:
'.vscode-oss'
,
urlProtocol
:
'code-oss'
,
}
}
;
}
)
;
// No-op since invoke the IPC as part of IIFE in the preload.
.
handle
(
'vscode:fetchShellEnv'
,
event
=>
{
}
)
;
/**
* Validates that a file path is within the project root for security purposes.
* @param{string}filePath - The file path to validate
* @throws{Error} If the path is outside the project root
*/
function
validatePathWithinProject
(
filePath
)
{
const
=
.
join
(
,
'../../..'
)
;
const
=
.
resolve
(
)
;
const
=
.
resolve
(
)
;
// On Windows, paths are case-insensitive
const
=
.
platform
===
'win32'
;
const
=
.
relative
(
?
.
toLowerCase
(
)
:
,
?
.
toLowerCase
(
)
:
)
;
if
(
.
startsWith
(
'..'
)
||
.
isAbsolute
(
)
)
{
const
=
new
Error
(
`Access denied: Path '${filePath}' is outside the project root`
)
;
console
.
error
(
.
message
)
;
throw
;
}
}
// Handle file reading for tests
.
handle
(
'vscode:readFile'
,
async
(
event, filePath
)
=>
{
validatePathWithinProject
(
)
;
try
{
return
await
.
readFile
(
.
resolve
(
)
)
;
}
catch
(
)
{
console
.
error
(
`Error reading file ${filePath}:`
,
)
;
throw
;
}
}
)
;
// Handle file stat for tests
.
handle
(
'vscode:statFile'
,
async
(
event, filePath
)
=>
{
validatePathWithinProject
(
)
;
try
{
const
=
await
.
stat
(
.
resolve
(
)
)
;
return
{
isFile
:
.
isFile
(
)
,
isDirectory
:
.
isDirectory
(
)
,
isSymbolicLink
:
.
isSymbolicLink
(
)
,
ctimeMs
:
.
ctimeMs
,
mtimeMs
:
.
mtimeMs
,
size
:
.
size
,
isReadonly
:
(
.
mode
&
0o200
)
===
0
// Check if owner write bit is not set
}
;
}
catch
(
)
{
console
.
error
(
`Error stating file ${filePath}:`
,
)
;
throw
;
}
}
)
;
const
=
new
BrowserWindow
(
{
height
:
600
,
width
:
800
,
show
:
false
,
webPreferences
:
{
preload
:
.
join
(
,
'preload.js'
)
,
// ensure similar environment as VSCode as tests may depend on this