Это 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{ exec }from'child_process';import fs from'fs';import{ DatabaseSync }from'node:sqlite';import{ EventEmitter }from'node:stream';import path from'path';import{ promisify }from'util';import zlib from'zlib';import{ LockMap }from'../../src/util/common/lock';import{ generateUuid }from'../../src/util/vs/base/common/uuid';
CurrentTestRunInfo
compress zlibbrotliCompress
decompress zlibbrotliDecompress
resolve resolve
DefaultCachePath processenv path__dirname path__dirname
cwd
execAsync exec
stdout cwd
stdout
db DatabaseSync
filePath
db filePath
db
db
key
value
value
valuelength
value
value
value
key
row dbkey value
row
SqliteKeyValueStorerowvaluevalue
key value
dbkey value
key
row dbkey
row
IterableIterator
prefix
rows db key
row rows
rowkeyprefix rowkeyprefixlength rowkey
db
_Instance Cache
_Instance _Instance
cachePath
layersPath
externalLayersPath
base SqliteKeyValueStore
layers Map SqliteKeyValueStore
activeLayer SqliteKeyValueStore
gcBase SqliteKeyValueStore
gcBaseKeys Set
cachePath DefaultCachePath
cachePath cachePath
layersPath pathcachePath
externalLayersPath processenv
fspathcachePath
externalLayersPath fsexternalLayersPath
fslayersPath recursive
base pathcachePath
layers
layerFiles fslayersPath
file file
file pathlayersPath file
externalLayersPath
externalLayerFiles fsexternalLayersPath
file file
file pathexternalLayersPath file
layerFiles layerFilesexternalLayerFiles
layerFile layerFiles
name pathlayerFile pathlayerFile
layersname layerFile
key
data
data basekey
data
layer layers
data layerkey
data
data
gcBase gcBaseKeys
gcBaseKeyskey
gcBasekey data
gcBaseKeyskey
data
key value layer
key
data value
layer
layerDatabase
layerDatabasekey data
basekey data
layerDatabase layerslayer
layerDatabase
layerDatabasekey data
key
basekey
layer layers
layerkey
Map
keys
result
name database SqliteKeyValueStore
key database
resultkey
resultkeyname
keyskey
resultkey keyskey name
keyskey
keyskey name
base
uuid database layers
uuid database
result
gcBase gcBaseKeys
gcBaseKeys
gcBase pathcachePath
gcBase gcBaseKeys
base
gcBase
fspathcachePath
fs
pathcachePath
pathcachePath
uuid layer layers
layer
error
fspathlayersPath
error
activeLayer
layers
gcBase
gcBaseKeys
gcBaseKeys
SqliteKeyValueStore
activeLayer
activeLayer
execAsync exec
activeLayerPath externalLayersPath layersPath
gitStatusPath externalLayersPath
gitRoot activeLayerPath
stdout statusStdout cwd gitRoot
statusStdout
layerDatabaseEntries statusStdoutentry entry
layerDatabaseEntrieslength
regex
match layerDatabaseEntriesregex
match layersmatch
layersmatch
error
uuid
activeLayer pathactiveLayerPath
layersuuid activeLayer
activeLayer
activeLayer
value
buffer value params zlibconstants
buffer
data
buffer Bufferdata
buffer
hash
toJSON
req TRequest TResponse
req TRequest cachedResponse TResponse
namespace
locks
name salt info CurrentTestRunInfo
namespace
hash
CacheInstance
hash TRequest
result CacheInstance
result result
hash value TRequest
CacheInstance value
req TRequest
CacheInstance
req TRequest TResponse
result CacheInstance
result result
req TRequest value TResponse
locksreqhash
reqtoJSON reqhash
reqhash req
CacheInstance value
req TRequest cacheSlot TResponse
req TRequest cacheSlot cachedResponse TResponse
namespace
locks
name salt info CurrentTestRunInfo
namespace
hash
CacheInstance
hash TRequest
result CacheInstance
result result
hash value TRequest
CacheInstance value
req TRequest cacheSlot
CacheInstance
req TRequest cacheSlot TResponse
result CacheInstance
result result
req TRequest cacheSlot value TResponse
locksreqhash
reqhash
reqhash req
CacheInstance value
/**
* Yield to the libuv event loop.
*
* The previous `@keyv/sqlite` store was backed by the asynchronous `sqlite3`
* driver, so every individual store operation resolved on a later loop tick.
* Some consumers rely on that boundary: e.g. the panel multi-file edit flow
* applies one code block's edits while the next code block's code-mapper request
* is awaiting its cached response, so the next request is built against the
* already-edited document. `node:sqlite`'s `DatabaseSync` is synchronous, so we
* reintroduce the async boundary on every store operation to preserve that
* interleaving (and thus compatibility with the recorded cache).
*/
function
yieldEventLoop
(
)
:
Promise
<
void
>
{
return
new
Promise<void>
(
=>
setImmediate
(
)
)
;
}
const
=
.
.
VITEST
?
.
resolve
(
,
'..'
,
'simulation'
,
'cache'
)
:
.
resolve
(
,
'..'
,
'test'
,
'simulation'
,
'cache'
)
;
async
function
getGitRoot
(
:
string
)
:
Promise
<
string
>
{
const
=
promisify
(
)
;
const
{
}
=
await
execAsync
(
'git rev-parse --show-toplevel'
,
{
}
)
;
return
.
trim
(
)
;
}
/**
* Minimal key/value store backed by Node's built-in `node:sqlite` module.
*
* It is wire-compatible with the on-disk format previously produced by
* `keyv` + `@keyv/sqlite` so that the committed simulation cache databases
* keep working: rows live in a `keyv` table, keys are namespaced as
* `keyv:<key>` and values are stored as `{"value":<string>}` JSON.
*/
class
SqliteKeyValueStore
{
private
static
readonly
NAMESPACE
=
'keyv'
;
private
readonly
:
;
constructor
(
:
string
)
{
this
.
=
new
DatabaseSync
(
)
;
this
.
.
exec
(
'PRAGMA busy_timeout = 5000'
)
;
this
.
.
exec
(
'CREATE TABLE IF NOT EXISTS keyv(key VARCHAR(255) PRIMARY KEY, value TEXT )'
)
;
}
private
_namespacedKey
(
:
string
)
:
string
{
return
`${SqliteKeyValueStore.NAMESPACE}:${key}`
;
}
private
static
_decodeJsonBufferValue
(
:
string
)
:
string
{
if
(
.
startsWith
(
':base64:'
)
)
{
return
.
slice
(
':base64:'
.
)
;
}
if
(
.
startsWith
(
':'
)
)
{
return
.
slice
(
1
)
;
}
return
;
}
async
get
(
:
string
)
:
Promise
<
string
|
undefined
>
{
await
yieldEventLoop
(
)
;
const
=
this
.
.
prepare
(
'SELECT value FROM keyv WHERE key = ?'
)
.
get
(
this
.
_namespacedKey
(
)
)
as
{
:
string
}
|
undefined
;
if
(
!
)
{
return
undefined
;
}
return
.
_decodeJsonBufferValue
(
JSON
.
parse
(
.
)
.
as
string
)
;
}
async
set
(
:
string
,
:
string
)
:
Promise
<
void
>
{
await
yieldEventLoop
(
)
;
this
.
.
prepare
(
'INSERT OR REPLACE INTO keyv (key, value) VALUES (?, ?)'
)
.
run
(
this
.
_namespacedKey
(
)
,
JSON
.
stringify
(
{
}
)
)
;
}
async
has
(
:
string
)
:
Promise
<
boolean
>
{
await
yieldEventLoop
(
)
;
const
=
this
.
.
prepare
(
'SELECT 1 FROM keyv WHERE key = ?'
)
.
get
(
this
.
_namespacedKey
(
)
)
;
return
!==
undefined
;
}
*
keys
(
)
:
<
string
>
{
const
=
`${SqliteKeyValueStore.NAMESPACE}:`
;
const
=
this
.
.
prepare
(
'SELECT key FROM keyv'
)
.
all
(
)
as
{
:
string
}
[
]
;
for
(
const
of
)
{
yield
.
.
startsWith
(
)
?
.
.
slice
(
.
)
:
.
;
}
}
async
disconnect
(
)
:
Promise
<
void
>
{
this
.
.
close
(
)
;
}
}
export
class
Cache
extends
EventEmitter
{
private
static
:
|
undefined
;
static
get
Instance
(
)
{
return
this
.
??
(
this
.
=
new
Cache
(
)
)
;
}
private
readonly
:
string
;
private
readonly
:
string
;
private
readonly
?
:
string
;
private
readonly
:
;
private
readonly
:
<
string
,
>
;
private
:
Promise
<
>
|
undefined
;
private
:
|
undefined
;
private
:
<
string
>
|
undefined
;
constructor
(
=
)
{
super
(
)
;
this
.
=
;
this
.
=
.
join
(
this
.
,
'layers'
)
;
this
.
=
.
.
EXTERNAL_CACHE_LAYERS_PATH
;
if
(
!
.
existsSync
(
.
join
(
this
.
,
'base.sqlite'
)
)
)
{
throw
new
Error
(
`Base cache file does not exist as ${path.join(this.cachePath,'base.sqlite')}.`
)
;
}
if
(
this
.
&&
!
.
existsSync
(
this
.
)
)
{
throw
new
Error
(
`External layers cache directory provided but it does not exist at ${this.externalLayersPath}.`