ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это 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 assert from 'assert';
import { URI } from '../../../../base/common/uri.js';
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';
import { readToolCallMeta } from '../../common/meta/agentToolCallMeta.js';
import { AgentSession } from '../../common/agent.js';
import { getErrorResponsePart, getTurnError, MessageAttachmentKind, MessageKind, ResponsePartKind, ToolCallContributorKind, ToolCallStatus, ToolResultContentType, TurnState, buildChatUri, type ResponsePart,
appendSdkToolResultContent mapSessionEvents mapSessionEventsWithRouting
toSessionEvents
session db events Parameters mapSessionEventsWithRouting options IMapSessionEventsOptions
session db events session options
session AgentSession
parts ResponsePart kind ResponsePartKind content StringOrMarkdown
partsp pkind ResponsePartKindMarkdown pkind ResponsePartKindSystemNotification kind pkind content pcontent kind pkind
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments summary
type data toolCallId success result content
turns session events
assertturnslength
assertturnsresponseParts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
autoModeResolved
chosenModel
reasoningBucket
categoryScores reasoning code_gen
predictedLabel
confidence
candidateModels
events ISessionEvent
type id data interactionId content
type data messageId content
type data autoModeResolved
type id data interactionId content
type data messageId content
turns session events
assertturnsturn id turnid usage turnusage
id usage
id
usage
model
_meta autoModeResolved
autoModeResolved chosenModel
events ISessionEvent
type id data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agent_type
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId timestamp data autoModeResolved
type agentId timestamp data interactionId content
type agentId timestamp data messageId content
type data toolCallId success
turns subagentTurnsByToolCallId session events
assert
parentUsage turnsturn turnusage
subagentTurns subagentTurnsByToolCallIdturn text turnmessagetext startedAt turnstartedAt duration turnduration usage turnusage
parentUsage
subagentTurns
text
startedAt
duration
usage model _meta autoModeResolved
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments
type data toolCallId success
turns session events
assertturnslength
assertturnsresponseParts
kind ResponsePartKindMarkdown content
events ISessionEvent
type id data interactionId content
type data turnId
type data messageId content toolRequests toolCallId name
type data turnId
type data toolCallId toolName arguments
type data toolCallId success
turns session events
interruptedTurnError errorType message
assert
state turnsstate
error turns
state TurnStateComplete
error
events ISessionEvent
type id data interactionId content
type data turnId
type data messageId content
interruptedTurnError
errorType
message
turns session events interruptedTurnError
assert
turnCount turnslength
id turnsid
state turnsstate
errorPart turns
turnCount
id
state TurnStateError
errorPart
kind ResponsePartKindError
error interruptedTurnError
events ISessionEvent
type id timestamp data interactionId content
type timestamp data turnId
type timestamp data errorType message
type timestamp data turnId
type timestamp data messageId content
type timestamp data turnId
type timestamp data
turns session events
assertturnsturn
id turnid
state turnstate
duration turnduration
parts turnresponseParts
id
state TurnStateComplete
duration
parts
kind ResponsePartKindError
kind ResponsePartKindMarkdown content
events ISessionEvent
type id timestamp data interactionId content
type timestamp data turnId
type timestamp data messageId content
type timestamp data turnId
type timestamp data messageId content
interruptedTurnError
errorType
message
turns session events interruptedTurnError
assert
duration turnsduration
state turnsstate
parts turnsresponseParts
resumable turnsresumable
duration
state TurnStateError
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
kind ResponsePartKindError
resumable
events ISessionEvent
type id timestamp data interactionId content
type timestamp data turnId
type timestamp data errorType message
type
id
timestamp
data
content
kind type agentId agentType
type timestamp data turnId
type timestamp data messageId content
type timestamp data turnId
turns session events
assertturnsturn
id turnid
message turnmessage
state turnstate
parts turnresponseParts
id
message text origin kind MessageKindUser
state TurnStateError
parts kind ResponsePartKindError
id
message text origin kind MessageKindSystemNotification
state TurnStateComplete
parts kind ResponsePartKindMarkdown content
assertturnsresumable
events ISessionEvent
type id data interactionId content
type data turnId
type data toolCallId toolName arguments command
type data errorType message
type data toolCallId success result content
turns session events
assert
state turnsstate
parts turnsresponseParts
resumable turnsresumable
state TurnStateError
parts kind ResponsePartKindError
resumable
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name arguments summary
type data toolCallId success
turns session events
assertturnsturn
state turnstate
parts turnresponseParts
state TurnStateComplete
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments command
type data toolCallId success result content
turns session events
assertturnslength
assertturnsresponseParts
kind ResponsePartKindToolCall
patch
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments patch
type data toolCallId success
turns session events workingDirectory
part turnsresponsePartspart partkind ResponsePartKindToolCall ToolCallResponsePart
assertpart
assert
invocationMessage parttoolCallstatus ToolCallStatusCompleted parttoolCallinvocationMessage
pastTenseMessage parttoolCallstatus ToolCallStatusCompleted parttoolCallpastTenseMessage
invocationMessage markdown
pastTenseMessage markdown
events ISessionEvent
type data interactionId content
type
data
messageId
content
toolRequests
toolCallId
name
arguments
type
mcpServerName
mcpToolName
type
data
toolCallId
toolName
arguments
mcpServerName
mcpToolName
toolDescription
_meta
ui
resourceUri
type
data
toolCallId
success
result content
chatUri session
sdkConversationUri
turns sdkConversationUri events chatUri
part turnsresponseParts ToolCallResponsePart
assertpartkind ResponsePartKindToolCall
assert
contributor parttoolCallcontributor
meta parttoolCall
contributor
kind ToolCallContributorKind
customizationId
meta
mcpServerName
mcpToolName
ui
resourceUri
channel
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments command description
type data toolCallId success result content
turns session events
part turnsresponseParts ToolCallResponsePart
assertpartkind ResponsePartKindToolCall
assertparttoolCallintention
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments path
type
data
toolCallId
success
result
content
contents type data mimeType
turns session events
part turnsresponseParts ToolCallResponsePart
assertparttoolCallstatus ToolCallStatusCompleted
parttoolCallstatus ToolCallStatusCompleted
assertparttoolCallcontent
type ToolResultContentTypeText text
type ToolResultContentTypeEmbeddedResource data contentType
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments command
type
data
toolCallId
success
result
content
contents type shellId exitCode cwd outputPreview
turns session events
part turnsresponseParts ToolCallResponsePart
assertpartkind ResponsePartKindToolCall
assertparttoolCallstatus ToolCallStatusCompleted
parttoolCallstatus ToolCallStatusCompleted
assertparttoolCallcontent
type ToolResultContentTypeText text
type ToolResultContentTypeTerminal
resource
title
isPty
result exitCode preview
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments shellId delay
type
data
toolCallId
success
result
content
contents type shellId exitCode outputPreview
turns session events
part turnsresponseParts ToolCallResponsePart
assertparttoolCallstatus ToolCallStatusCompleted
parttoolCallstatus ToolCallStatusCompleted
assert
toolKind parttoolCalltoolKind
pastTenseMessage parttoolCallpastTenseMessage
content parttoolCallcontent
toolKind
pastTenseMessage
content type ToolResultContentTypeText text
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments command
type
data
toolCallId
success
result
content
contents type shellId exitCode cwd
turns session events
part turnsresponseParts ToolCallResponsePart
assertpartkind ResponsePartKindToolCall
assertparttoolCallstatus ToolCallStatusCompleted
parttoolCallstatus ToolCallStatusCompleted
assertparttoolCallsuccess
assertparttoolCallcontentcontent contenttype ToolResultContentTypeTerminal
type ToolResultContentTypeTerminal
resource
title
isPty
result exitCode
events ISessionEvent
type data newModel
type data agentName agentDisplayName tools
type
data
interactionId
content
attachments
type
path
displayName
type data messageId content
turns session events
model id
agent uri
assert
model turnsmessagemodel
agent turnsmessageagent
attachments turnsmessageattachmentsa
type atype
uri atype MessageAttachmentKindResource auri
label alabel
model id
agent uri
attachments
type MessageAttachmentKindResource
uri
label
events ISessionEvent
type data selectedModel
type data interactionId content
type data messageId content
type data interactionId content
type data newModel
type data interactionId content
turns session events
assertturnst tmessagemodel
id
id
id
events ISessionEvent
type id data interactionId content
type id data interactionId content toolRequests
type id data interactionId content toolRequests toolCallId name
type data toolCallId toolName arguments command
type data toolCallId success result content
type id data interactionId content toolRequests reasoningOpaque
type id data interactionId content toolRequests
type id data interactionId content
type id data interactionId content toolRequests
turns session events
assertturnsturn
id turnid
message turnmessagetext
state turnstate
parts turnresponseParts
id
message
state TurnStateComplete
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
kind ResponsePartKindToolCall
kind ResponsePartKindMarkdown content
id
message
state TurnStateComplete
parts
kind ResponsePartKindMarkdown content
events ISessionEvent
type id data interactionId content
type data turnId interactionId
type
id
data
content
kind type shellId exitCode description
type data interactionId content toolRequests
type data turnId
turns session events
assertturnsturn
id turnid
message turnmessage
state turnstate
parts turnresponseParts
id
message text origin kind MessageKindUser
state TurnStateComplete
parts
kind ResponsePartKindSystemNotification content
kind ResponsePartKindMarkdown content
events ISessionEvent
type id data interactionId content
type data turnId interactionId
type data interactionId content toolRequests
type data turnId
type
id
data
content
kind type agentId agentType
type data turnId interactionId
type data interactionId content toolRequests
type data turnId
turns session events
assertturnsturn
id turnid
message turnmessage
state turnstate
parts turnresponseParts
id
message text origin kind MessageKindUser
state TurnStateComplete
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindSystemNotification content
kind ResponsePartKindMarkdown content
events ISessionEvent
type id data interactionId content
type data turnId interactionId
type data interactionId content toolRequests
type data turnId
type
id
data
content
kind type sourcePath triggerFile triggerTool description
turns session events
assertturnsturn
id turnid
parts turnresponseParts
id
parts kind ResponsePartKindMarkdown content
events ISessionEvent
type id data interactionId content
type data interactionId content toolRequests
type id data interactionId content source
type data interactionId content toolRequests
type id data interactionId content
type data interactionId content toolRequests
turns session events
assertturnsturn
id turnid
message turnmessagetext
parts turnresponseParts
id
message
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
id
message
parts
kind ResponsePartKindMarkdown content
wrapped
systemReminder
events ISessionEvent
type id data interactionId content wrapped
type data interactionId content toolRequests
type id data interactionId content
type data interactionId content toolRequests
type id data interactionId content
type data interactionId content toolRequests
type id data interactionId content
type data interactionId content toolRequests
type id data interactionId content systemReminder
type data interactionId content toolRequests
turns session events
assertturnsturn turnmessagetext
events ISessionEvent
type id data interactionId content
type data interactionId content toolRequests toolCallId name
type data toolCallId toolName arguments status
type data toolCallId success
type data interactionId content toolRequests
turns session events
assertturnsturn
id turnid
message turnmessagetext
state turnstate
parts turnresponseParts
id
message
state TurnStateComplete
parts
kind ResponsePartKindToolCall
events ISessionEvent
type id data interactionId content
type data interactionId content toolRequests toolCallId name
type data toolCallId toolName arguments command
type data toolCallId success result content
turns session events
assertturnsturn
state turnstate
parts turnresponseParts
state TurnStateCancelled
parts
kind ResponsePartKindToolCall
events ISessionEvent
type data interactionId content
type data interactionId content toolRequests
type data reason
type data interactionId content toolRequests
turns session events
assertturnsturn
state turnstate
parts turnresponseParts
state TurnStateCancelled
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindMarkdown content
events ISessionEvent
type
data errorType message
type
id
timestamp
data interactionId content
type
data turnId interactionId
type
timestamp
data interactionId content toolRequests
type
data turnId interactionId
type
id
timestamp
data
errorType
errorCode
message
stack
statusCode
providerCallId
serviceRequestId
type
data interactionId content toolRequests
turns session events
assertturnsturn
id turnid
state turnstate
duration turnduration
error turn
parts turnresponseParts
id
state TurnStateError
duration
error
errorType
message
stack
_meta
chatError
fetchError
type
reason
requestId
serverRequestId
capiError
code
message
parts
kind ResponsePartKindMarkdown content
kind ResponsePartKindError
events ISessionEvent
type id timestamp data interactionId content
type timestamp data messageId content
type id timestamp data interactionId content
type timestamp data messageId content
turns session events
assertturnsturn id turnid startedAt turnstartedAt duration turnduration
id startedAt duration
id startedAt duration
events ISessionEvent
type id timestamp data interactionId content
type timestamp data turnId
type timestamp data messageId content
type timestamp data turnId
type timestamp
turns session events
assertturnsturn id turnid startedAt turnstartedAt duration turnduration
id startedAt duration
events ISessionEvent
type id data interactionId content
type timestamp data messageId content
turns session events
assertturnsturn id turnid startedAt turnstartedAt duration turnduration
id startedAt duration
session AgentSession
parts ResponsePart kind ResponsePartKind content
partsp pkind ResponsePartKindMarkdown kind pkind content pcontent kind pkind
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agentName
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data interactionId content
type agentId data messageId content toolRequests toolCallId name
type agentId data toolCallId toolName arguments command
type agentId data toolCallId success result content
type agentId data messageId content
type data toolCallId success
type data messageId content
turns subagentTurnsByToolCallId session events
assertturnslength
assertturnsresponseParts
kind ResponsePartKindToolCall
kind ResponsePartKindMarkdown content
subagentTurns subagentTurnsByToolCallId
assertsubagentTurns
assertsubagentTurnslength
assertsubagentTurnsmessagetext
assertsubagentTurnsresponseParts
kind ResponsePartKindToolCall
kind ResponsePartKindMarkdown content
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agent_type
type data toolCallId success result content
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data interactionId content
type agentId data messageId content
turns subagentTurnsByToolCallId session events
toolCall turnsresponsePartspart part ToolCallResponsePart partkind ResponsePartKindToolCalltoolCall
subagentContent toolCallstatus ToolCallStatusCompleted
toolCallcontentcontent contenttype ToolResultContentTypeSubagent
assert
description toolCall toolCallsubagentDescription
subagentContent
childMarkdown subagentTurnsByToolCallIdturn turnresponseParts
part partkind ResponsePartKindMarkdown
part partcontent
description
subagentContent
type ToolResultContentTypeSubagent
resource
title
agentName
description
childMarkdown
events ISessionEvent
type id data interactionId content
type id agentId data interactionId content
type data messageId content
turns subagentTurnsByToolCallId session events
assert
turns turnsturn
id turnid
message turnmessagetext
parts turnresponseParts
subagentTurns subagentTurnsByToolCallId
turns
id
message
parts kind ResponsePartKindMarkdown content
subagentTurns
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agentName
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data name path content
type data toolCallId success
type data messageId content
turns subagentTurnsByToolCallId session events
assert
parentState turnsstate
parentParts turnsresponseParts
subagentParts subagentTurnsByToolCallIdresponseParts
parentState TurnStateComplete
parentParts
kind ResponsePartKindToolCall
kind ResponsePartKindMarkdown content
subagentParts
kind ResponsePartKindToolCall
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agentName
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data messageId content
type agentId data reason
type data toolCallId success
type data messageId content
turns subagentTurnsByToolCallId session events
subagentTurn subagentTurnsByToolCallId
assert
parentState turnsstate
subagentState subagentTurnstate
subagentParts subagentTurnresponseParts
parentState TurnStateComplete
subagentState TurnStateCancelled
subagentParts
kind ResponsePartKindMarkdown content
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agentName
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data reason
type agentId data messageId content
type data toolCallId success
type data messageId content
subagentTurnsByToolCallId session events
subagentTurn subagentTurnsByToolCallId
assert
state subagentTurnstate
parts subagentTurnresponseParts
state TurnStateCancelled
parts
kind ResponsePartKindMarkdown content
events ISessionEvent
type data interactionId content
type data messageId content toolRequests toolCallId name
type data toolCallId toolName arguments description agentName
type agentId data toolCallId agentName agentDisplayName agentDescription
type agentId data messageId content
type agentId data errorType message statusCode
type agentId data reason
type data toolCallId success
type data messageId content
turns subagentTurnsByToolCallId session events
subagentTurn subagentTurnsByToolCallId
assert
parentState turnsstate
parentError turns
subagentState subagentTurnstate
subagentError subagentTurn
subagentParts subagentTurnresponseParts
parentState TurnStateComplete
parentError
subagentState TurnStateError
subagentError
errorType
message
stack
_meta
chatError
fetchError
type
reason
requestId
capiError code message
subagentParts
kind ResponsePartKindMarkdown content
kind ResponsePartKindError
content ToolResultContent
type ToolResultContentTypeTerminal resource title
result content
type shellId exitCode outputPreview outputTruncated
session AgentSession toolCallId title
assertresult shellId result exitCode preview truncated
assertcontent
type ToolResultContentTypeTerminal
resource
title
result exitCode preview truncated
content ToolResultContent
result content
type shellId exitCode outputPreview outputTruncated
session AgentSession toolCallId title
assert result content
result shellId result exitCode truncated
content
type ToolResultContentTypeTerminal
resource
title
isPty
result exitCode truncated