Это 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{BasePromptElementProps,PromptElement,PromptPiece,PromptSizing,TextChunk}from'@vscode/prompt-tsx';import{ChatResponsePart}from'@vscode/prompt-tsx/dist/base/vscodeTypes';import{Embedding,EmbeddingType,EmbeddingVector,IEmbeddingsComputer, rankEmbeddings }from'../../../../platform/embeddings/common/embeddingsComputer';import{EmbeddingCacheType,IEmbeddingsCache,LocalEmbeddingsCache
text embedding type
type lang
type
type lang
_serviceBrand
embeddingsCache
apiChunks
useRemoteCache
@ envService
@ instantiationService
cacheVersion envService
useRemoteCache
instantiationService cacheVersion
instantiationService cacheVersion
queryEmbedding n
queryEmbedding item item type value item satisfies n
x x
context
context
context
context
_serviceBrand
embedding n
query
props
@ apiEmbeddingsIndex
@ embeddingsComputer
props
snippets
token
tokenisCancellationRequested
embeddingResult token
embeddingResult
embeddingResult
override state sizing progress token
snippets token
snippets
snippetss
s
`API Reference Code Snippet from vscode.d.ts:\n${createFencedCodeBlock(context.lang, context.text)}`
;
}
else
if
(
.
type
===
'command'
)
{
return
`${context.text}`
;
}
else
if
(
.
type
===
'documentationCodeBlock'
)
{
return
`Example code from VS Code documentation:\n${createFencedCodeBlock(context.lang, context.text)}`
;
}
return
''
;
}
}
export
interface
IApiEmbeddingsIndex
{
readonly
:
undefined
;
updateIndex
(
)
:
Promise
<
void
>
;
nClosestValues
(
:
Embedding
,
:
number
)
:
string
[
]
;
}
export
const
IApiEmbeddingsIndex
=
createDecorator<IApiEmbeddingsIndex>
(
'IApiEmbeddingsIndex'
)
;
export
interface
VSCodeAPIContextProps
extends
BasePromptElementProps
{
:
string
;
}
export
class
VSCodeAPIContextElement
extends
PromptElement<VSCodeAPIContextProps>
{
constructor
(
:
VSCodeAPIContextProps
,
IApiEmbeddingsIndex
private
readonly
:
IApiEmbeddingsIndex
,
IEmbeddingsComputer
private
readonly
:
IEmbeddingsComputer
,
)
{
super
(
)
;
}
async
renderAsString
(
)
:
Promise
<
string
>
{
const
=
await
this
.
getSnippets
(
undefined
)
;
return
`Below are some potentially relevant code samples related to VS Code extension development. You may use information from these samples to help you answer the question if you believe it is relevant.\n${snippets.join('\n\n')}`
;
}
private
async
getSnippets
(
:
CancellationToken
|
undefined
)
:
Promise
<
string
[
]
>
{
await
this
.
apiEmbeddingsIndex
.
updateIndex
(
)
;
if
(
?.
)
{
return
[
]
;
}
const
=
await
this
.
embeddingsComputer
.
computeEmbeddings
(
EmbeddingType
.
text3small_512
,
[
this
.
props
.
query
]
,
{
}
,
new
TelemetryCorrelationId
(
'VSCodeAPIContextElement::getSnippets'
)
,
)
;
if
(
.
values
.
length
===
0
)
{
return
[
]
;
}
return
this
.
apiEmbeddingsIndex
.
nClosestValues
(
.
values
[
0
]
,
5
)
;
}
async
render
(
:
undefined
,
:
PromptSizing
,
?
:
Progress
<
ChatResponsePart
>
,
?
:
CancellationToken
)
:
Promise
<
PromptPiece
<
any
,
any
>
|
undefined
>
{
const
=
await
this
.
getSnippets
(
)
;
if
(
.
length
)
{
return
<>
Below are some potentially relevant code samples related to VS Code extension development. You may use information from these samples to help you answer the question if you believe it is relevant.