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 { ContentBlockParam, DocumentBlockParam, ImageBlockParam, MessageParam, RedactedThinkingBlockParam, RefusalStopDetails, TextBlockParam, ThinkingBlockParam, ToolReferenceBlockParam, ToolResultBlockParam } from '@anthropic-ai/sdk/resources';
import { Raw } from '@vscode/prompt-tsx';
import { Response } from '../../../platform/networking/common/fetcherService';
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
import { SSEParser } from '../../../util/vs/base/common/sseParser';
import { generateUuid } from '../../../util/vs/base/common/uuid'
IInstantiationService ServicesAccessor
ChatLocation
ConfigKey IConfigurationService
ILogService
AnthropicMessagesTool ContextManagementResponse getContextManagementFromConfig isAnthropicContextEditingEnabled isExtendedCacheTtlEnabled isExtendedCacheTtlMessagesEnabled
FinishedCallback getRequestId IIPCodeCitation IResponseDelta
IChatEndpoint ICreateEndpointBodyOptions IEndpointBody
ChatCompletion FinishedCompletionReason rawMessageToCAPI
IToolDeferralService
sendEngineMessagesTelemetry
IExperimentationService
ITelemetryService
TelemetryData
schema Record Record type
schema
type properties
$schema _ rest schema
type properties rest
id
id
messages RawChatMessage id
validIdPattern
usedIds
message messages
messagerole RawChatRoleAssistant
toolCall messagetoolCalls
validIdPatterntoolCallid
usedIdstoolCallid
messagerole RawChatRoleTool validIdPatternmessagetoolCallId
usedIdsmessagetoolCallId
mappedIds
id
existingId mappedIdsid
existingId
existingId
validIdPatternid
mappedIdsid id
usedIdsid
id
baseId id
mappedId baseId
suffix
usedIdsmappedId
mappedId
mappedIdsid mappedId
usedIdsmappedId
mappedId
id
start_offset
end_offset
details Record
citations
snippet
url
ip_type
license
type
message
id
type
role
content ContentBlockParam
model
stop_reason
stop_sequence
usage
input_tokens
output_tokens
cache_creation_input_tokens
cache_read_input_tokens
cache_creation
ephemeral_1h_input_tokens
ephemeral_5m_input_tokens
output_tokens_details
thinking_tokens
index
content_block ContentBlockParam ThinkingBlockParam RedactedThinkingBlockParam
delta
type
text
partial_json
thinking
signature
stop_reason
stop_sequence
stop_details RefusalStopDetails
copilot_annotations
IPCodeCitations AnthropicIPCodeCitation
usage
output_tokens
input_tokens
cache_creation_input_tokens
cache_read_input_tokens
cache_creation
ephemeral_1h_input_tokens
ephemeral_5m_input_tokens
output_tokens_details
thinking_tokens
copilot_usage
total_nano_aiu
context_management ContextManagementResponse
accessor ServicesAccessor options ICreateEndpointBodyOptions model endpoint IChatEndpoint IEndpointBody
configurationService accessorIConfigurationService
experimentationService accessorIExperimentationService
toolDeferralService accessorIToolDeferralService
logService accessorILogService
toolSearchEnabled endpointsupportsToolSearch
optionsrequestOptionstoolst tfunctionname
nonDeferredTools AnthropicMessagesTool
deferredTools AnthropicMessagesTool
optionsrequestOptionstools
tool optionsrequestOptionstools
toolfunctionname toolfunctionnamelength
isDeferred optionsmodelCapabilitiesenableToolSearch toolSearchEnabled toolDeferralServicetoolfunctionname
anthropicTool AnthropicMessagesTool
name toolfunctionname
description toolfunctiondescription
input_schema toolfunctionparameters Record
isDeferred defer_loading
isDeferred deferredTools nonDeferredToolsanthropicTool
finalTools AnthropicMessagesTool nonDeferredTools deferredTools
reasoningEffort optionsmodelCapabilitiesreasoningEffort
thinkingConfig type budget_tokens display
optionsmodelCapabilitiesenableThinking
hardcodedBudget
endpointsupportsAdaptiveThinking
thinkingConfig type display
endpointmaxThinkingBudget endpointminThinkingBudget
maxTokens optionspostOptionsmax_tokens
minBudget endpointminThinkingBudget
normalizedBudget hardcodedBudget minBudget minBudget hardcodedBudget
maxBudget endpointmaxThinkingBudget
thinkingBudget MathmaxBudget maxTokens normalizedBudget
thinkingBudget
thinkingConfig type budget_tokens thinkingBudget
thinkingEnabled thinkingConfig
effort
thinkingConfig
declaredLevels endpointsupportsReasoningEffortlength endpointsupportsReasoningEffort
explicitlyUnsupported endpointsupportsReasoningEffort endpointsupportsReasoningEffortlength
defaultEffort declaredLevels
declaredLevels declaredLevelsMathdeclaredLevelslength
explicitlyUnsupported endpointsupportsAdaptiveThinking
requestedEffort configurationServiceConfigKeyAdvancedReasoningEffortOverride reasoningEffort
defaultEffort
candidateEffort requestedEffort defaultEffort
candidateEffort candidateEffortlength
declaredLevels declaredLevelscandidateEffort
effort candidateEffort
logService
explicitlyUnsupported requestedEffort requestedEffortlength
logService
contextManagement optionsmodelCapabilitiesenableContextEditing endpoint configurationService experimentationService
configurationService experimentationService thinkingEnabled
telemetryService accessorITelemetryService
validToolNames finalToolslength finalToolst tname
messagesResult optionsmessages toolSearchEnabled validToolNames
isSubagent optionsinteractionTypeOverride
useExtendedCacheTtl endpoint configurationService experimentationService optionslocation isSubagent
cacheTtl useExtendedCacheTtl
useExtendedCacheTtlMessages useExtendedCacheTtl configurationService experimentationService
messageCacheTtl useExtendedCacheTtlMessages
messagesResult
messagesResult messageCacheTtl
finalTools messagesResult cacheTtl
lastMessage messagesResultmessages
lastMessage lastMessagerole
logService
telemetryService
model location ChatLocationoptionslocation
messageCount messagesResultmessageslength
messagesResultmessages
role
content type text
model
messagesResult
stream optionsrequestOptionsstream
tools finalToolslength finalTools
max_tokens optionspostOptionsmax_tokens
thinking thinkingConfig
effort output_config effort
contextManagement context_management contextManagement
messages RawChatMessage validToolNames Set messages MessageParam system TextBlockParam
unmergedMessages MessageParam
systemBlocks TextBlockParam
toolCallIdToName
mapToolCallId messages
message messages
messagerole
RawChatRoleSystem
systemBlocksmessagecontentc c TextBlockParam ctype
RawChatRoleUser
content messagecontent
contentlength
unmergedMessages
role
content
RawChatRoleAssistant
content messagecontent
messagetoolCalls
toolCall messagetoolCalls
parsedInput Record
parsedInput toolCallfunctionarguments
content
type
id toolCallid
name toolCallfunctionname
input parsedInput
toolCallIdToNametoolCallid toolCallfunctionname
contentlength
unmergedMessages
role
content
RawChatRoleTool
messagetoolCallId
toolContent messagecontent
hasCacheControl
block toolContent
block blockcache_control
hasCacheControl
blockcache_control
isCustomToolSearch validToolNames toolCallIdToNamemessagetoolCallId
toolReferenceContent isCustomToolSearch
toolContent validToolNames
validContent toolReferenceContent
toolContentc c TextBlockParam ImageBlockParam DocumentBlockParam
ctype ctype ctype ctype ctext
toolResultBlock ToolResultBlockParam
type
tool_use_id messagetoolCallId
content validContentlength validContent
hasCacheControl
toolResultBlockcache_control type
unmergedMessages
role
content toolResultBlock
mergedMessages MessageParam
message unmergedMessages
lastMessage mergedMessagesmergedMessageslength
lastMessage lastMessagerole messagerole
prevContent lastMessagecontent lastMessagecontent type text lastMessagecontent
newContent messagecontent messagecontent type text messagecontent
lastMessagecontent lastMessagerole
prevContent newContent
prevContent newContent
mergedMessagesmessage
messages mergedMessages
systemBlockslength system systemBlocks
block ContentBlockParam
blocktype blocktype
prevContent ContentBlockParam newContent ContentBlockParam ContentBlockParam
blocks ContentBlockParam blocksblock blocktype
thinkingSource newContent newContent prevContent prevContent
thinkingSourceisThinkingBlock
prevContentblock block
newContentblock block
content ContentBlockParam validToolNames Set ToolReferenceBlockParam
contentlength contenttype
parsed
parsed contenttext
parsed
parsed
name name name validToolNames validToolNamesname
name ToolReferenceBlockParam type tool_name name
content RawChatCompletionContentPart ContentBlockParam
convertedContent ContentBlockParam
pendingCacheControl
part content
parttype
RawChatCompletionContentPartKindText
parttext
convertedContent type text parttext
RawChatCompletionContentPartKindImage
url partimageUrlurl
match url
match
convertedContent
type
source
type
media_type match
data match
url
convertedContent
type
source
type
url
RawChatCompletionContentPartKindCacheBreakpoint
previousBlock convertedContent
previousBlock previousBlock
previousBlockcache_control type
pendingCacheControl
RawChatCompletionContentPartKindDocument
partdocumentDatamediaType
convertedContent
type
source
type
media_type
data partdocumentDatadata
satisfies DocumentBlockParam
RawChatCompletionContentPartKindOpaque
partvalue partvalue partvalue
opaqueValue partvalue type thinking id text encrypted redacted
opaqueValuetype opaqueValuethinking
thinkingText opaqueValuethinkingtext
opaqueValuethinkingtext
opaqueValuethinkingtext
opaqueValuethinkingredacted opaqueValuethinkingencrypted
convertedContent
type
data opaqueValuethinkingencrypted
opaqueValuethinkingencrypted
convertedContent
type
thinking thinkingText
signature opaqueValuethinkingencrypted
pendingCacheControl convertedContentlength
lastBlock convertedContent
lastBlock
lastBlockcache_control type
pendingCacheControl
convertedContent
block ContentBlockParam block ExcludeContentBlockParam ThinkingBlockParam RedactedThinkingBlockParam
blocktype blocktype
messagesResult messages MessageParam system TextBlockParam
messagesResultsystem
block messagesResultsystem
blockcache_control
msg messagesResultmessages
msgcontent
block msgcontent
block block
block cache_control cache_control
tools AnthropicMessagesTool
messagesResult messages MessageParam system TextBlockParam
cacheTtl
cacheControl cacheTtl
type ttl cacheTtl
type
i toolslength i i
toolsidefer_loading
toolsicache_control cacheControl
lastSystemBlock messagesResultsystem
lastSystemBlock lastSystemBlockcache_control
lastSystemBlockcache_control cacheControl
messagesResult messages MessageParam system TextBlockParam
cacheTtl
messages messagesResultmessages
marked
i messageslength i marked i
msg messagesi
msgcontent msgcontentb b b
msg cacheTtl
marked
msg MessageParam cacheTtl
msgcontent
j msgcontentlength j j
block msgcontentj
block block
blockcache_control cacheTtl type ttl cacheTtl type
instantiationService IInstantiationService
telemetryService ITelemetryService
logService ILogService
response Response
finishCallback FinishedCallback
telemetryData TelemetryData
AsyncIterableObjectChatCompletion
contentType responseheaders
contentType
telemetryService logService response finishCallback telemetryData
feed
requestId responseheaders
ghRequestId responseheaders
serverExperiments responseheaders
processor instantiationServiceAnthropicMessagesProcessor telemetryData requestId ghRequestId serverExperiments
parser ev
logService
trimmed evdata
trimmed trimmed
parsed trimmed PartialAnthropicStreamEvent
type parsedtype evtype
type
completion processor parsed type AnthropicStreamEvent finishCallback
completion
logService
dataToSendToTelemetry telemetryData
completionChoiceFinishReason completionfinishReason
headerRequestId completionrequestIdheaderRequestId
telemetryService dataToSendToTelemetryproperties dataToSendToTelemetrymeasurements
telemetryMessage completionmessage
telemetryDataWithUsage telemetryData
completionusage
telemetryDataWithUsage telemetryData
promptTokens completionusageprompt_tokens
completionTokens completionusagecompletion_tokens
totalTokens completionusagetotal_tokens
completionusageprompt_tokens_details cachedTokens completionusageprompt_tokens_detailscached_tokens
completionusagecompletion_tokens_details
reasoningTokens completionusagecompletion_tokens_detailsreasoning_tokens
acceptedPredictionTokens completionusagecompletion_tokens_detailsaccepted_prediction_tokens
rejectedPredictionTokens completionusagecompletion_tokens_detailsrejected_prediction_tokens
telemetryService telemetryMessage telemetryDataWithUsage logService
feedcompletion
e
feede
chunk responsebody
parserchunk
responsebody
model
messageId
stopReason
textContent
toolCalls id name arguments
inputTokens
outputTokens
cacheCreationTokens
cacheCreation1hTokens
cacheCreation5mTokens
cacheReadTokens
thinkingTokens
requestId
ghRequestId
serverExperiments
telemetryData TelemetryData
copilotUsage total_nano_aiu
stopReason FinishedCompletionReason
stopReason
FinishedCompletionReasonRefusal
FinishedCompletionReasonLength
FinishedCompletionReasonStop
state AnthropicCompletionState logService ILogService ChatCompletion
computedPromptTokens stateinputTokens statecacheCreationTokens statecacheReadTokens
id tcid
type
name tcname
arguments tcarguments
type
id
role
content
type text
type id name input
type thinking signature
type data
model
stop_reason
stop_details RefusalStopDetails
usage
input_tokens
output_tokens
cache_creation_input_tokens
cache_read_input_tokens
cache_creation
ephemeral_1h_input_tokens
ephemeral_5m_input_tokens
output_tokens_details
thinking_tokens
type
error type message
telemetryService ITelemetryService
logService ILogService
response Response
finishCallback FinishedCallback
telemetryData TelemetryData
AsyncIterableObjectChatCompletion
feed
headerRequestId serverExperiments responseheaders
requestId headerRequestId
ghRequestId responseheaders
bodyText response
parsed AnthropicNonStreamingResponse
parsed bodyText
e
feed
parsedtype
feed
textContent
toolCalls id name arguments
block parsedcontent
blocktype
textContent blocktext
toolCalls
id blockid
name blockname
arguments blockinput
unknownType block type type
logService
telemetryService
requestId
model parsedmodel
blockType unknownType
parsedstop_reason
category parsedstop_detailscategory
logService
telemetryService
requestId
model parsedmodel
category
delta IResponseDelta
text textContent
toolCallslength
copilotToolCalls toolCallstc
id tcid
name tcname
arguments tcarguments
textContent delta
usage parsedusage
completion
model parsedmodel
messageId parsedid
stopReason parsedstop_reason
textContent
toolCalls
inputTokens usageinput_tokens
outputTokens usageoutput_tokens
cacheCreationTokens usagecache_creation_input_tokens
cacheCreation1hTokens usagecache_creationephemeral_1h_input_tokens
cacheCreation5mTokens usagecache_creationephemeral_5m_input_tokens
cacheReadTokens usagecache_read_input_tokens
thinkingTokens usageoutput_tokens_detailsthinking_tokens
requestId
ghRequestId
serverExperiments
telemetryData
logService
logService
dataToSendToTelemetry telemetryData
completionChoiceFinishReason completionfinishReason
headerRequestId completionrequestIdheaderRequestId
telemetryService dataToSendToTelemetryproperties dataToSendToTelemetrymeasurements
telemetryMessage completionmessage
telemetryDataWithUsage telemetryData
completionusage
telemetryDataWithUsage telemetryData
promptTokens completionusageprompt_tokens
completionTokens completionusagecompletion_tokens
totalTokens completionusagetotal_tokens
completionusageprompt_tokens_details cachedTokens completionusageprompt_tokens_detailscached_tokens
completionusagecompletion_tokens_details
reasoningTokens completionusagecompletion_tokens_detailsreasoning_tokens
acceptedPredictionTokens completionusagecompletion_tokens_detailsaccepted_prediction_tokens
rejectedPredictionTokens completionusagecompletion_tokens_detailsrejected_prediction_tokens
telemetryService telemetryMessage telemetryDataWithUsage logService
feedcompletion
responsebody
textAccumulator
toolCallAccumulator Map id name arguments
thinkingAccumulator Map thinking signature
completedToolCalls id name arguments
messageId
model
inputTokens
outputTokens
cacheCreationTokens
cacheCreation1hTokens
cacheCreation5mTokens
cacheReadTokens
thinkingTokens
copilotUsage total_nano_aiu
contextManagementResponse ContextManagementResponse
stopReason
stopDetails RefusalStopDetails
telemetryData TelemetryData
requestId
ghRequestId
serverExperiments
logService ILogService
telemetryService ITelemetryService
annotations IPCodeCitations AnthropicIPCodeCitation IIPCodeCitation
annotationsIPCodeCitationslength
seenUrls
citations IIPCodeCitation
citation annotationsIPCodeCitations
citationDetails citationcitations
citationDetails
url license snippet citationDetails
url url
license license
snippet snippet
seenUrlsurl
seenUrlsurl
citations
citations
url
license
snippet
citationslength
logService
citations
chunk AnthropicStreamEvent _onProgress FinishedCallback ChatCompletion
onProgress delta IResponseDelta
textAccumulator deltatext
textAccumulator delta
chunktype
chunkmessage
messageId chunkmessageid
model chunkmessagemodel
inputTokens chunkmessageusageinput_tokens
outputTokens chunkmessageusageoutput_tokens
cacheCreationTokens chunkmessageusagecache_creation_input_tokens
cacheCreation1hTokens chunkmessageusagecache_creationephemeral_1h_input_tokens cacheCreation1hTokens
cacheCreation5mTokens chunkmessageusagecache_creationephemeral_5m_input_tokens cacheCreation5mTokens
cacheReadTokens chunkmessageusagecache_read_input_tokens
thinkingTokens chunkmessageusageoutput_tokens_detailsthinking_tokens thinkingTokens
chunkcontent_blocktype chunkindex
toolCallId chunkcontent_blockid
toolCallAccumulatorchunkindex
id toolCallId
name chunkcontent_blockname
arguments
textAccumulatorlength
text
text
beginToolCalls name chunkcontent_blockname id toolCallId
chunkcontent_blocktype chunkindex
thinkingAccumulatorchunkindex
thinking
signature
chunkcontent_blocktype chunkindex
data chunkcontent_block type data data
text
thinking
id
encrypted data
redacted
chunkdelta
chunkdeltatype chunkdeltatext
ipCitations chunkcopilot_annotations
ipCitationslength
text chunkdeltatext ipCitations
text chunkdeltatext
chunkdeltatype chunkdeltathinking chunkindex
thinking thinkingAccumulatorchunkindex
thinking
thinkingthinking chunkdeltathinking
text
thinking
id
text chunkdeltathinking
chunkdeltatype chunkdeltasignature chunkindex
thinking thinkingAccumulatorchunkindex
thinking
thinkingsignature chunkdeltasignature
chunkdeltatype chunkdeltapartial_json chunkindex
toolCall toolCallAccumulatorchunkindex
toolCall
toolCallarguments chunkdeltapartial_json
text
copilotToolCallStreamUpdates
id toolCallid
name toolCallname
arguments toolCallarguments
chunkindex
toolCall toolCallAccumulatorchunkindex
toolCall
completedToolCallstoolCall
text
copilotToolCalls
id toolCallid
name toolCallname
arguments toolCallarguments
toolCallAccumulatorchunkindex
thinking thinkingAccumulatorchunkindex
thinking thinkingsignature
text
thinking
id
encrypted thinkingsignature
thinkingAccumulatorchunkindex
chunkusage
outputTokens chunkusageoutput_tokens
inputTokens chunkusageinput_tokens inputTokens
cacheCreationTokens chunkusagecache_creation_input_tokens cacheCreationTokens
cacheCreation1hTokens chunkusagecache_creationephemeral_1h_input_tokens cacheCreation1hTokens
cacheCreation5mTokens chunkusagecache_creationephemeral_5m_input_tokens cacheCreation5mTokens
cacheReadTokens chunkusagecache_read_input_tokens cacheReadTokens
thinkingTokens chunkusageoutput_tokens_detailsthinking_tokens thinkingTokens
chunkcopilot_usage chunkcopilot_usagetotal_nano_aiu
copilotUsage chunkcopilot_usage
chunkcontext_management
contextManagementResponse chunkcontext_management
text
contextManagement chunkcontext_management
chunkdeltastop_reason
stopReason chunkdeltastop_reason
chunkdeltastop_details
stopDetails chunkdeltastop_details
contextManagementResponse
totalClearedTokens contextManagementResponseapplied_edits
sum edit sum editcleared_input_tokens
totalClearedToolUses contextManagementResponseapplied_edits
sum edit sum editcleared_tool_uses
totalClearedThinkingTurns contextManagementResponseapplied_edits
sum edit sum editcleared_thinking_turns
logService
telemetryService
requestId requestId
interactionId requestId
model model
clearedTokens totalClearedTokens
clearedToolUses totalClearedToolUses
clearedThinkingTurns totalClearedThinkingTurns
stopReason
category stopDetailscategory
logService
telemetryService
requestId requestId
model model
category
model model
messageId messageId
stopReason stopReason
textContent textAccumulator
toolCalls completedToolCalls
inputTokens inputTokens
outputTokens outputTokens
cacheCreationTokens cacheCreationTokens
cacheCreation1hTokens cacheCreation1hTokens
cacheCreation5mTokens cacheCreation5mTokens
cacheReadTokens cacheReadTokens
thinkingTokens thinkingTokens
requestId requestId
ghRequestId ghRequestId
serverExperiments serverExperiments
telemetryData telemetryData
copilotUsage copilotUsage
logService
errorMessage chunk error message errormessage
text
copilotErrors
agent
code
message errorMessage
type
identifier