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 Anthropic from '@anthropic-ai/sdk';
import * as vscode from 'vscode';
import { CancellationToken, LanguageModelChatInformation, LanguageModelChatMessage, LanguageModelChatMessage2, LanguageModelDataPart, LanguageModelResponsePart2, LanguageModelTextPart, LanguageModelThinkingPart, LanguageModelToolCallPart, LanguageModelToolResultPart, Progress, ProvideLanguageModelChatResponseOptions } from 'vscode';
import { ChatFetchResponseType, ChatLocation } from '../../../platform/chat/common/commonTypes';
import { ConfigKey, IConfigurationService } from '../../../platform/configuration/common/configurationService';
import CustomDataPartMimeTypes
modelSupportsToolSearch
buildToolInputSchema
ILogService
ContextManagementResponse getContextManagementFromConfig isAnthropicContextEditingEnabled modelSupportsMemory
IToolDeferralService
IResponseDelta OpenAiFunctionTool
APIUsage
CopilotChatAttr emitInferenceDetailsEvent GenAiAttr GenAiMetrics GenAiOperationName GenAiProviderName StdAttr stringifyToolDefinitionsForOTel toSystemInstructions truncateForOTel
IOTelService SpanKind SpanStatusCode
IRequestLogger
retrieveCapturingTokenByCorrelation runWithCapturingToken
buildOTelInputFromChatMessages
IExperimentationService
ITelemetryService
toErrorMessage
RecordedProgress
generateUuid
anthropicMessagesToRawMessagesForLogging apiMessageToAnthropicMessage
BYOKKnownModels BYOKModelCapabilities LMResponsePart
AbstractLanguageModelChatProvider ExtendedLanguageModelChatInformation LanguageModelChatConfiguration
byokKnownModelsToAPIInfoWithEffort
IBYOKStorageService
providerName
providerId providerName
knownModels BYOKKnownModels
byokStorageService IBYOKStorageService
logService ILogService
_requestLogger IRequestLogger
_configurationService IConfigurationService
_experimentationService IExperimentationService
_telemetryService ITelemetryService
_otelService IOTelService
_toolDeferralService IToolDeferralService
AnthropicLMProviderproviderId AnthropicLMProviderproviderName knownModels byokStorageService logService
modelId maxOutputTokens
modelCapabilities _knownModelsmodelId
modelSupportsThinking modelCapabilitiesthinking
modelSupportsThinking
Math maxOutputTokens
silent apiKey ExtendedLanguageModelChatInformationLanguageModelChatConfiguration
apiKey silent
response apiKey models
modelList Record BYOKModelCapabilities
model responsedata
_knownModels _knownModelsmodelid
modelListmodelid _knownModelsmodelid
modelListmodelid
maxInputTokens
maxOutputTokens
name modeldisplay_name
toolCalling
vision
thinking
_name modelList
error
_logServiceerror
errormessage errormessage error
model ExtendedLanguageModelChatInformationLanguageModelChatConfiguration messages LanguageModelChatMessage LanguageModelChatMessage2 options ProvideLanguageModelChatResponseOptions progress ProgressLanguageModelResponsePart2 token CancellationToken
correlationId options modelOptions OTelModelOptions modelOptions_capturingTokenCorrelationId
capturingToken correlationId correlationId
telemetryTurn options modelOptions OTelModelOptions modelOptions_telemetryTurn
parentTraceContext options modelOptions OTelModelOptions modelOptions_otelTraceContext
otelSpan ReturnType _otelServicestartSpan
issuedTime Date
apiKey modelconfigurationapiKey
apiKey
anthropicClient apiKey
system messages convertedMessages messages LanguageModelChatMessage
requestId
pendingLoggedChatRequest _requestLogger
model modelid
modelMaxPromptTokens modelmaxInputTokens
urlOrRequestMetadata anthropicClientbaseURL
model modelid
messages convertedMessages system
ourRequestId requestId
location ChatLocationOther
body
tools optionstoolstool OpenAiFunctionTool
type
name toolname
description tooldescription
parameters toolinputSchema
memoryToolEnabled modelid
toolSearchEnabled modelid
optionstoolst tname
tools AnthropicBetaBetaToolUnion
hasMemoryTool
tool optionstools
toolname memoryToolEnabled
hasMemoryTool
tools
name
type
AnthropicBetaBetaMemoryTool20250818
shouldDefer toolSearchEnabled _toolDeferralServicetoolname
toolinputSchema
tools
name toolname
description tooldescription
input_schema
type
properties
required
shouldDefer defer_loading shouldDefer
tools
name toolname
description tooldescription
input_schema toolinputSchema Record
shouldDefer defer_loading shouldDefer
webSearchEnabled _configurationServiceConfigKeyAnthropicWebSearchToolEnabled _experimentationService
webSearchDomainConflictError
webSearchEnabled toolstool tool toolname
maxUses _configurationServiceConfigKeyAnthropicWebSearchMaxUses
allowedDomains _configurationServiceConfigKeyAnthropicWebSearchAllowedDomains
blockedDomains _configurationServiceConfigKeyAnthropicWebSearchBlockedDomains
userLocation _configurationServiceConfigKeyAnthropicWebSearchUserLocation
shouldDeferWebSearch toolSearchEnabled _toolDeferralService
webSearchTool AnthropicBetaBetaWebSearchTool20250305
name
type
max_uses maxUses
shouldDeferWebSearch defer_loading shouldDeferWebSearch
hasAllowed allowedDomains allowedDomainslength
hasBlocked blockedDomains blockedDomainslength
hasAllowed hasBlocked
webSearchDomainConflictError vscodel10n
hasAllowed
webSearchToolallowed_domains allowedDomains
hasBlocked
webSearchToolblocked_domains blockedDomains
userLocation userLocationcity userLocationregion userLocationcountry userLocationtimezone
webSearchTooluser_location
type
userLocation
toolswebSearchTool
thinkingBudget modelid modelmaxOutputTokens
modelCapabilities _knownModelsmodelid
supportsAdaptiveThinking modelCapabilitiesadaptiveThinking
thinkingEnabled supportsAdaptiveThinking thinkingBudget
contextManagement modelid _configurationService _experimentationService
_configurationService
_experimentationService
thinkingEnabled
betas
thinkingBudget supportsAdaptiveThinking
betas
hasMemoryTool contextManagement
betas
toolSearchEnabled
betas
rawEffort optionsmodelConfigurationreasoningEffort
supportsEffort modelCapabilitiessupportsReasoningEffort
effort supportsEffort rawEffort supportsEffortrawEffort
rawEffort
params AnthropicBetaMessagesMessageCreateParamsStreaming
model modelid
messages convertedMessages
max_tokens modelmaxOutputTokens
stream
system system
tools toolslength tools
thinking supportsAdaptiveThinking
type
thinkingBudget type budget_tokens thinkingBudget
effort output_config effort
context_management contextManagement AnthropicBetaMessagesBetaContextManagementConfig
wrappedProgress progress
webSearchDomainConflictError
webSearchDomainConflictError
result anthropicClient wrappedProgress params betas token issuedTime
resultttft
pendingLoggedChatRequestresultttft
responseDeltas IResponseDelta wrappedProgressitemsi IResponseDelta
i
text ivalue
i
text
copilotToolCalls
name iname
arguments iinput
id icallId
i
resultText icontentc c cvalue
text
text
resultcontextManagement
responseDeltas
text
contextManagement resultcontextManagement
resultusage
wrappedProgress resultusage CustomDataPartMimeTypesUsage
pendingLoggedChatRequest
type ChatFetchResponseTypeSuccess
requestId
serverRequestId requestId
usage resultusage
value
resolvedModel modelid
responseDeltas
otelSpan resultusage
otelSpan
GenAiAttr resultusageprompt_tokens
GenAiAttr resultusagecompletion_tokens
resultusageprompt_tokens_detailscached_tokens
GenAiAttr resultusageprompt_tokens_detailscached_tokens
GenAiAttr modelid
GenAiAttr requestId
GenAiAttr
GenAiAttr
resultttft CopilotChatAttr resultttft
resultttft GenAiAttr resultttft
GenAiAttr modelmaxOutputTokens
_otelServiceconfigcaptureContent
responseText wrappedProgressitems
p p LanguageModelTextPart p
p pvalue
toolCalls wrappedProgressitems
p p LanguageModelToolCallPart p
tc type id tccallId name tcname arguments tcinput
parts type content id name arguments
responseText parts type content responseText
partstoolCalls
partslength
otelSpanGenAiAttr role parts _otelServiceconfigmaxAttributeSizeChars
resultusage
durationSec Date issuedTime
metricAttrs operationName GenAiOperationName providerName AnthropicLMProviderproviderId requestModel modelid responseModel modelid
GenAiMetrics_otelService durationSec metricAttrs
resultusageprompt_tokens GenAiMetrics_otelService resultusageprompt_tokens metricAttrs
resultusagecompletion_tokens GenAiMetrics_otelService resultusagecompletion_tokens metricAttrs
resultttft GenAiMetrics_otelService modelid resultttft
resultttft GenAiMetrics_otelService resultttft metricAttrs
_otelService
model modelid maxTokens modelmaxOutputTokens
resultusage
id requestId
model modelid
finishReasons
inputTokens resultusageprompt_tokens
outputTokens resultusagecompletion_tokens
_telemetryService github microsoft
source
model modelid
requestId
totalTokenMax modelmaxInputTokens
telemetryTurn turn telemetryTurn
tokenCountMax modelmaxOutputTokens
promptTokenCount resultusageprompt_tokens
promptCacheTokenCount resultusageprompt_tokens_detailscached_tokens
tokenCount resultusagetotal_tokens
completionTokens resultusagecompletion_tokens
timeToFirstToken resultttft
timeToFirstTokenEmitted resultttfte
timeToComplete Date issuedTime
issuedTime
isBYOK
err
_logService
pendingLoggedChatRequest
type ChatFetchResponseTypeUnknown
requestId
serverRequestId requestId
reason errmessage
wrappedProgressitemsi IResponseDelta
i
text ivalue
i
text
copilotToolCalls
name iname
arguments iinput
id icallId
i
resultText icontentc c cvalue
text
text
err
chatSessionId capturingTokenchatSessionId
parentChatSessionId capturingTokenparentChatSessionId
debugLogLabel capturingTokendebugLogLabel
otelSpan _otelService
kind SpanKind
attributes
GenAiAttr GenAiOperationName
GenAiAttr GenAiProviderName
GenAiAttr modelid
chatSessionId GenAiAttr chatSessionId
GenAiAttr
CopilotChatAttr modelmaxInputTokens
chatSessionId CopilotChatAttr chatSessionId
chatSessionId CopilotChatAttr chatSessionId
parentChatSessionId CopilotChatAttr parentChatSessionId
debugLogLabel CopilotChatAttr debugLogLabel
StdAttr
_otelServiceconfigcaptureContent
toolDefsJson optionstools
toolDefsJson
otelSpanGenAiAttr toolDefsJson _otelServiceconfigmaxAttributeSizeChars
systemTexts inputMsgs messages
systemInstructions systemTexts
systemInstructions
otelSpanGenAiAttr systemInstructions _otelServiceconfigmaxAttributeSizeChars
otelSpanGenAiAttr inputMsgs _otelServiceconfigmaxAttributeSizeChars
result capturingToken
capturingToken doRequest
otelSpanSpanStatusCode
result
err
otelSpanSpanStatusCode err errmessage err
err
otelSpan
parentTraceContext
_otelServiceparentTraceContext executeRequest
model LanguageModelChatInformation text LanguageModelChatMessage LanguageModelChatMessage2 token CancellationToken
Mathtextlength
anthropicClient Anthropic progress RecordedProgressLMResponsePart params AnthropicBetaMessagesMessageCreateParamsStreaming betas token CancellationToken issuedTime ttft ttfte usage APIUsage contextManagement ContextManagementResponse
start Date
ttft
ttfte
stream anthropicClientbetamessages
params
betaslength betas
pendingToolCall
toolId
name
jsonInput
pendingThinking
thinking
signature
pendingRedactedThinking
data
pendingServerToolCall
toolId
name
jsonInput
type
usage APIUsage
contextManagementResponse ContextManagementResponse
hasText
chunk stream
tokenisCancellationRequested
ttft
ttft Date start
_logService
chunktype
chunk chunkcontent_blocktype
pendingToolCall
toolId chunkcontent_blockid
name chunkcontent_blockname
jsonInput
chunk chunkcontent_blocktype
pendingServerToolCall
toolId chunkcontent_blockid
name chunkcontent_blockname
jsonInput
type chunkcontent_blockname
progress
chunk chunkcontent_blocktype
pendingThinking
thinking
signature
chunk chunkcontent_blocktype
redactedBlock chunkcontent_block AnthropicMessagesRedactedThinkingBlock
pendingRedactedThinking
data redactedBlockdata
chunk chunkcontent_blocktype
pendingServerToolCall pendingServerToolCalltoolId
resultBlock chunkcontent_block AnthropicMessagesWebSearchToolResultBlock
resultBlockcontent
_logService
results resultBlockcontentresult AnthropicMessagesWebSearchResultBlock
type
url resulturl
title resulttitle
page_age resultpage_age
encrypted_content resultencrypted_content
toolResult
type
tool_use_id pendingServerToolCalltoolId
content results
searchResults toolResult
progress
pendingServerToolCalltoolId
searchResults
pendingServerToolCall
chunktype
chunkdeltatype
progress chunkdeltatext
hasText chunkdeltatextlength
ttfte Date issuedTime
hasText chunkdeltatextlength
chunkdeltatype
chunkdelta
citation chunkdeltacitation AnthropicMessagesCitationsWebSearchResultLocation
citationtype
citationData
type
url citationurl
title citationtitle
encrypted_index citationencrypted_index
cited_text citationcited_text
referenceText
progress referenceText
progress
citationData
chunkdeltatype
pendingThinking
pendingThinkingthinking pendingThinkingthinking chunkdeltathinking
progress chunkdeltathinking
chunkdeltatype
pendingThinking
pendingThinkingsignature pendingThinkingsignature chunkdeltasignature
chunkdeltatype pendingToolCall
pendingToolCalljsonInput pendingToolCalljsonInput chunkdeltapartial_json
parsedJson pendingToolCalljsonInput
progress
pendingToolCalltoolId
pendingToolCallname
parsedJson
pendingToolCall
chunkdeltatype pendingServerToolCall
pendingServerToolCalljsonInput pendingServerToolCalljsonInput chunkdeltapartial_json
chunktype
pendingToolCall
parsedJson pendingToolCalljsonInput
progress
pendingToolCalltoolId
pendingToolCallname
parsedJson
e
e
pendingToolCall
pendingThinking
pendingThinkingsignature
finalThinkingPart
finalThinkingPartmetadata
signature pendingThinkingsignature
_completeThinking pendingThinkingthinking
progressfinalThinkingPart
pendingThinking
pendingRedactedThinking
pendingRedactedThinking
chunktype
usage
completion_tokens
prompt_tokens chunkmessageusageinput_tokens chunkmessageusagecache_creation_input_tokens chunkmessageusagecache_read_input_tokens
total_tokens
prompt_tokens_details
cached_tokens chunkmessageusagecache_read_input_tokens
cache_creation_input_tokens chunkmessageusagecache_creation_input_tokens
usage chunktype
chunkusageoutput_tokens
usagecompletion_tokens chunkusageoutput_tokens
usagetotal_tokens usageprompt_tokens chunkusageoutput_tokens
chunk chunkcontext_management
contextManagementResponse chunkcontext_management ContextManagementResponse
totalClearedTokens contextManagementResponseapplied_edits
sum edit sum editcleared_input_tokens
_logService
progress
contextManagementResponse
CustomDataPartMimeTypesContextManagement
ttft ttfte usage contextManagement contextManagementResponse