Это 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{AssistantMessage,BasePromptElementProps,Chunk,PrioritizedList,PromptElement,PromptPiece,PromptSizing,TokenLimit,UserMessage}from'@vscode/prompt-tsx';import{ modelPrefersInstructionsAfterHistory }from'../../../../platform/endpoint/common/chatModelCapabilities';import{URI}from'../../../../util/vs/base/common/uri';import{Location}from'../../../../vscodeTypes';
history
priority
inline
currentTurnVars
omitPromptVariables
props historyPriority
@ promptEndpoint
props
override _state sizing
ep
children props
childrenc c c
after ep
after childrenafter
override _state _sizing
turnHistory turn turn
turnHistory
historyMessage
turnHistory message historyMessage type
history
turnHistoryturn index
turn
promptVariables turn turn turnHistoryindex
history
turntype turn
historyturn
history
historyVars currentTurnVars followingMessages
historyVarsv1
followingMessagesm mv2 v1 v2
currentTurnVarsv2 v1 v2
v1 v2
v1 v2
v1 v2
v1 v2
v1 v2
v1 v2
priority
promptContext
override state sizing
history
contextHistory
i turn contextHistory
metadata turnmetadata
metadatarenderedUserMessage
historymetadata
history
metadatatoolCallRounds metadatalength
toolCallResultInNextTurn metadata
toolCallResults metadata
toolCallResultInNextTurn
nextMetadata contextHistoryi responseChatResultmetadata
mergeFrom i contextHistory nextMetadatatoolCallResults
toolCallResults toolCallResults mergeFrom
history
turn
historyturnmessage
history
/**
* Signal that is used to roll up the history into a single message, only requests
* are considered (and historical responses are assumed to be source code).
*/
?
:
boolean
;
?
:
ChatVariablesCollection
;
?
:
boolean
;
}
/**
* This element should wrap instructions specific to any given model. It should
* include any {@link InstructionMessage}, and depending on the model it
* either includes the history before or after the instruction message.
*
* You should use `passPriority` with this: https://github.com/microsoft/vscode-prompt-tsx?tab=readme-ov-file#passing-priority
*
* @example
*
* <HistoryWithInstructions passPriority priority={700} history={history}>
* <InstructionMessage>Do the thing</InstructionMessage>
* </HistoryWithInstructions>
*/
/**
* @deprecated use `HistoryWithInstructions` instead
*/
export
class
ConversationHistory
extends
PromptElement<ConversationHistoryProps>
{
render
(
:
void
,
:
PromptSizing
)
:
PromptPiece
<
any
,
any
>
|
undefined
{
// exclude turns from the history that errored due to prompt filtration
let
=
this
.
props
.
history
.
filter
(
=>
.
responseStatus
!==
TurnStatus
.
PromptFiltered
)
;
if
(
this
.
props
.
inline
&&
.
length
>
0
)
{
const
=
`The current code is a result of a previous interaction with you. Here are my previous messages: \n- ${turnHistory.map(r => r.request.message).join('\n- ')}`
// TODO this is very simple, maybe we could use getUniqueReferences to merge ranges and be smarter. But it would take some rewriting of history for the model to
// understand what each history message was referring to.
return
.
filter
(
=>
{
if
(
.
some
(
=>
.
promptVariables
?.
find
(
=>
variableEquals
(
,
)
)
)
)
{
return
false
;
}
if
(
?.
find
(
=>
variableEquals
(
,
)
)
)
{
return
false
;
}
return
true
;
}
)
;
}
}
function
variableEquals
(
:
PromptVariable
,
:
PromptVariable
)
{
if
(
.
uniqueName
!==
.
uniqueName
)
{
return
false
;
}
if
(
URI
.
isUri
(
.
value
)
&&
URI
.
isUri
(
.
value
)
)
{
return
.
value
.
toString
(
)
===
.
value
.
toString
(
)
;
}
if
(
.
value
instanceof
Location
&&
.
value
instanceof
Location
)
{
return
JSON
.
stringify
(
.
value
)
===
JSON
.
stringify
(
.
value
)
;
}
return
false
;
}
export
interface
ConversationHistoryWithToolsProps
extends
BasePromptElementProps
{
readonly
:
number
;
readonly
:
IBuildPromptContext
;
}
/**
* This is conversation history including tool calls, but not summaries. New usages should use SummarizedConversationHistory instead.
*/
export
class
ConversationHistoryWithTools
extends
PromptElement<ConversationHistoryWithToolsProps>
{
async
render
(
:
void
,
:
PromptSizing
)
{
const
:
PromptElement
[
]
=
[
]
;
const
=
this
.
props
.
promptContext
.
history
;
for
(
const
[
,
]
of
.
entries
(
)
)
{
const
=
.
responseChatResult
?.
as
IResultMetadata
|
undefined
;
if
(
?.
)
{
.
push
(
<UserMessage>
<Chunk>
{
renderedMessageToTsxChildren
(
.
renderedUserMessage
,
false
)
}
</Chunk>
</UserMessage>
)
;
}
else
{
.
push
(
<AgentUserMessageInHistoryturn={turn}/>
)
;
}
if
(
Array
.
isArray
(
?.
)
&&
.
toolCallRounds
?.
>
0
)
{
// If a tool call limit is exceeded, the tool call from this turn will
// have been aborted and any result should be found in the next turn.
const
=
.
maxToolCallsExceeded
;
let
=
.
toolCallResults
;
if
(
)
{
const
=
.
at
(
+
1
)
?.
?.
as
IResultMetadata
|
undefined
;
const
=
===
.
length
-
1
?
this
.
props
.
promptContext
.
toolCallResults
:
?.
;
=
{
...
,
...
}
;
}
.
push
(
<ChatToolCallspromptContext={this.props.promptContext}toolCallRounds={metadata.toolCallRounds}toolCallResults={toolCallResults}isHistorical={!(toolCallResultInNextTurn && i === contextHistory.length-1)}/>