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.
*--------------------------------------------------------------------------------------------*/
/**
* Integration test for Phase 6 ClaudeAgent.
*
* Wires together:
* - Real {@link ClaudeProxyService} bound to a real loopback HTTP listener.
* - Stubbed {@link ICopilotApiService} that yields a canned Anthropic
* `MessageStreamEvent` sequence.
* - Real {@link ClaudeAgent} driving the materialize lifecycle.
* - Recording {@link IClaudeAgentSdkService} that, on `startup()`,
* performs a real HTTP round-trip against the proxy using the
* `Options.settings.env.ANTHROPIC_BASE_URL` /
* `Options.settings.env.ANTHROPIC_AUTH_TOKEN` it received — exactly
* what the real Claude SDK subprocess would do when forked.
*
* The test does NOT fork the bundled `@anthropic-ai/claude-agent-sdk`
* subprocess. That fork is exercised live by the Phase 6 smoke run
* (`smoke.md`). What this test guarantees in CI is the cross-component
* wiring that connects the two:
* - The agent constructs `Bearer <nonce>.<sessionId>` in a format the
* real proxy's auth parser accepts.
* - The agent passes the proxy's actual `baseUrl` through
* `Options.settings.env`.
* - The proxy's SSE encoding round-trips the canned upstream stream.
* - The agent's strip-env contract on `Options.env`
* (`NODE_OPTIONS===undefined`, `ELECTRON_RUN_AS_NODE==='1'`) is
* captured by what the SDK service receives.
* - Disposing the agent disposes the proxy handle and the WarmQuery
* (no orphan resources).
*/
import type Anthropic from '@anthropic-ai/sdk';
import type { GetSessionMessagesOptions, Options, PermissionResult Query SDKControlInterruptResponse SDKMessage SDKResultSuccess SDKSessionInfo SDKSystemMessage SDKUserMessage SessionMessage WarmQuery
CCAModel
assert
http
DeferredPromise
Event
generateUuid
Schemas
DisposableStore
ensureNoDisposablesAreLeakedInTestSuite
ServiceCollection
InstantiationService
ILogService NullLogService
FileService
IFileService
InMemoryFileSystemProvider
INativeEnvironmentService
AgentSession
ActionType
buildDefaultChatUri ResponsePartKind ToolResultContentType ChatInputResponseKind ChatInputAnswerState ChatInputAnswerValueKind
ISessionDataService
IAgentHostOTelService
AgentConfigurationService IAgentConfigurationService
IAgentHostGitHubEndpointService
createTestGitHubEndpointService
AgentHostStateManager IAgentHostStateManager
AgentHostSessionTitleSignal IAgentHostSessionTitleSignal
IAgentHostGitService
IAgentHostCheckpointService
IAgentHostCustomizationEnablementService
createNoopCustomizationEnablementService
IAgentHostAuthenticationService
ClaudeAgent
IClaudeAgentSdkService
IAgentPluginManager
ClaudeProxyService IClaudeProxyService
ICopilotApiService
createNoopGitService createSessionDataService
makeContentBlockStartText
makeContentBlockStartToolUse
makeContentBlockStop
makeInputJsonDelta
makeMessageStart
makeMessageStop
makeStreamEvent
makeTextDelta
makeUserToolResultMessage
noopOTelService IAgentHostOTelService
_serviceBrand
withTraceContext _context
disposables PickDisposableStore IFileService INativeEnvironmentService IFileService INativeEnvironmentService
fileService disposables
disposablesfileServiceSchemasfile disposables
env PartialINativeEnvironmentService userHome
IFileService fileService
INativeEnvironmentService env INativeEnvironmentService
IAgentHostAuthenticationService
_serviceBrand
onDidChangeAuthToken EventNone
request requestresource resource
CCAModel
id
name
vendor
supported_endpoints
object
version
is_chat_default
is_chat_fallback
model_picker_category
model_picker_enabled
preview
billing is_premium multiplier restricted_to
capabilities
family
limits max_context_window_tokens max_output_tokens max_prompt_tokens
object
supports parallel_tool_calls streaming tool_calls vision
tokenizer
type
policy state terms
model AnthropicMessage
id
type
role
model
content type text citations
stop_reason
stop_sequence
stop_details
container
usage
input_tokens
output_tokens
cache_creation
cache_creation_input_tokens
cache_read_input_tokens
inference_geo
server_tool_use
service_tier
model AnthropicMessageStreamEvent
message model
contentBlockStart AnthropicRawContentBlockStartEvent
type
index
content_block type text citations
contentBlockDelta AnthropicRawContentBlockDeltaEvent
type
index
delta type text
messageDelta AnthropicRawMessageDeltaEvent
type
delta stop_reason stop_sequence stop_details container
usage
input_tokens
output_tokens
cache_creation_input_tokens
cache_read_input_tokens
server_tool_use
type message
contentBlockStart
contentBlockDelta
type index
messageDelta
type
sessionId SDKSystemMessage
type
subtype
apiKeySource
claude_code_version
cwd
tools
mcp_servers
model
permissionMode
slash_commands
output_style
skills
plugins
uuid
session_id sessionId
sessionId SDKResultSuccess
type
subtype
duration_ms
duration_api_ms
is_error
num_turns
result
stop_reason
total_cost_usd
usage
cache_creation ephemeral_1h_input_tokens ephemeral_5m_input_tokens
cache_creation_input_tokens
cache_read_input_tokens
inference_geo
input_tokens
iterations
output_tokens
server_tool_use web_fetch_requests web_search_requests
service_tier
speed
modelUsage
permission_denials
uuid
session_id sessionId
_serviceBrand
streamEvents AnthropicMessageStreamEvent
availableModels CCAModel
messagesCallCount count
restrictedTelemetryEnabled trackingId telemetryEndpoint
token
request AnthropicMessageCreateParamsStreaming
options ICopilotApiServiceRequestOptions
AsyncGeneratorAnthropicMessageStreamEvent
token
request AnthropicMessageCreateParamsNonStreaming
options ICopilotApiServiceRequestOptions
AnthropicMessage
token
request AnthropicMessageCreateParams
options ICopilotApiServiceRequestOptions
AsyncGeneratorAnthropicMessageStreamEvent AnthropicMessage
messagesCallCountcount
requeststream
options
async
options ICopilotApiServiceRequestOptions
AsyncGeneratorAnthropicMessageStreamEvent
ev streamEvents
optionssignalaborted
err
err name name
err
ev
AnthropicMessageTokensCount
CCAModel
availableModels
Response
status
contentType
events type data
kind
toolName
input Record
toolUseID
kind
request ParametersNonNullableOptions
SDKMessage CanUseToolMarker ElicitationMarker
item QueryStreamItem item CanUseToolMarker
item CanUseToolMarkerkind
item QueryStreamItem item ElicitationMarker
item ElicitationMarkerkind
_serviceBrand
capturedStartupOptions Options
proxyRoundTrips IProxyRoundTripResult
queryMessages QueryStreamItem
canUseToolResults PermissionResult
elicitationResults AwaitedReturnTypeNonNullableOptions
warmQueries RoundTripWarmQuery
SDKSessionInfo
_sessionId SDKSessionInfo
_sessionId _options GetSessionMessagesOptions SessionMessage
_sessionId
_sessionId _agentId SessionMessage
sessionId sessionId
sessionId
_params prompt AsyncIterableSDKUserMessage options Options Query
params options Options initializeTimeoutMs WarmQuery
capturedStartupOptionsparamsoptions
settings paramsoptionssettings
settingsEnv settings settings settingsenv settingsenv
baseUrl settingsEnv
bearer settingsEnv
baseUrl bearer
result bearer
model
messages role content
stream
max_tokens
proxyRoundTripsresult
warm
warmQuerieswarm
warm
asyncDisposeCount
closeCount
_sdk ProxyRoundTripSdkService
prompt AsyncIterableSDKUserMessage Query
prompt
prompt _sdk
closeCount
async SymbolasyncDispose
asyncDisposeCount
_index
_drainer
prompt AsyncIterableSDKUserMessage _sdk ProxyRoundTripSdkService
it promptSymbolasyncIterator
_drainer
r it
rdone
SymbolasyncIterator AsyncGeneratorSDKMessage
IteratorResultSDKMessage
_index _sdkqueryMessageslength
item _sdkqueryMessages_index
item
startup _sdkcapturedStartupOptions
startupcanUseTool
result startupitemtoolName iteminput
signal signal
toolUseID itemtoolUseID
requestId itemtoolUseID
_sdkcanUseToolResultsresult
item
startup _sdkcapturedStartupOptions
startuponElicitation
result startupitemrequest signal signal requestId
_sdkelicitationResultsresult
done value item
_drainer
done value
IteratorResultSDKMessage
done value
err IteratorResultSDKMessage
err
SDKControlInterruptResponse
SymbolasyncDispose
_httpModule http
http
_httpModule
_httpModule
_httpModule
url
bearer
payload object
IProxyRoundTripResult
httpMod
resolve reject
u url
body payload
req httpMod
hostname uhostname
port uport
path upathname usearch
method
headers
Bufferbody
res
chunks Buffer
res c chunksBufferc c Bufferc
res
raw Bufferchunks
status resstatusCode
contentType resheaders resheaders
events raw
res reject
req reject
reqbody
req
raw type data
out type data
block raw
block
event
data
line block
line
event linelength
line
data linelength
event data
parsed
parsed data parsed data
out type event data parsed
out
agent ClaudeAgent config IAgentCreateSessionConfig session chat sessionId
session AgentSession
chat session
created agentchatschat chat session
model configmodel
agent configagent
workingDirectories configworkingDirectories
config configconfig
activeClient configactiveClient
deferBacking configimportConversation
importConversation configimportConversation
createdbackingSession
session chat sessionId AgentSessioncreatedbackingSession
chat session IAgentChatContext
configurationResource session resource session
disposables
capi
capistreamEvents
realProxy disposables capi
sdk
logService
stateManager disposables logService
configService disposables stateManager logService
services
ILogService logService
ICopilotApiService capi
IClaudeProxyService realProxy
ISessionDataService
IClaudeAgentSdkService sdk
IAgentPluginManager
_serviceBrand
basePath scheme path
_clientId _customizations ClientPluginCustomization
IAgentConfigurationService configService
IAgentHostOTelService noopOTelService
IAgentHostStateManager stateManager
IAgentHostSessionTitleSignal disposables stateManager
IAgentHostGitHubEndpointService
IAgentHostGitService
IAgentHostCheckpointService
IAgentHostCustomizationEnablementService
IAgentHostAuthenticationService
disposables
instantiationService disposables services
agent disposablesinstantiationServiceClaudeAgent
accepted agentresource
assertaccepted
created agent workingDirectories
assertsdkcapturedStartupOptionslength
sessionId createdsessionId
sdkqueryMessages sessionId sessionId
agentchatscreatedchat createdchat createdsession
startup sdkcapturedStartupOptions
round sdkproxyRoundTrips
startupSettings startupsettings
settingsEnv startupSettings startupSettings startupSettingsenv startupSettingsenv
assert
startupCallCount sdkcapturedStartupOptionslength
roundTripCount sdkproxyRoundTripslength
capiCallCount capimessagesCallCountcount
startupCwd startupcwd
startupSessionId startupsessionId
startupExecutable startupexecutable
subprocessElectronRunAsNode startupenv
subprocessNodeOptions startupenv
subprocessAnthropicApiKey startupenv
settingsBaseUrlIsLoopback settingsEnv
settingsEnv
settingsBearerHasNonceAndSession settingsEnv
settingsEnvlength
settingsEnv
httpStatus roundstatus
httpContentType roundcontentType
eventTypes roundeventse etype
startupCallCount
roundTripCount
capiCallCount
startupCwd fsPath
startupSessionId sessionId
startupExecutable processexecPath
subprocessElectronRunAsNode
subprocessNodeOptions
subprocessAnthropicApiKey
settingsBaseUrlIsLoopback
settingsBearerHasNonceAndSession
httpStatus
httpContentType
eventTypes
agentchatscreatedchat createdchat createdsession
assertsdkwarmQueriesasyncDisposeCount
capi
realProxy disposables capi
handle realProxy
result
model messages stream
assertresultstatus
assertcapimessagesCallCountcount
handle
capi
capistreamEvents
realProxy disposables capi
sdk
logService
stateManager disposables logService
configService disposables stateManager logService
services
ILogService logService
ICopilotApiService capi
IClaudeProxyService realProxy
ISessionDataService
IClaudeAgentSdkService sdk
IAgentPluginManager
_serviceBrand
basePath scheme path
_clientId _customizations ClientPluginCustomization
IAgentConfigurationService configService
IAgentHostOTelService noopOTelService
IAgentHostStateManager stateManager
IAgentHostSessionTitleSignal disposables stateManager
IAgentHostGitHubEndpointService
IAgentHostGitService
IAgentHostCheckpointService
IAgentHostCustomizationEnablementService
IAgentHostAuthenticationService
disposables
instantiationService disposables services
agent disposablesinstantiationServiceClaudeAgent
agentresource
created agent workingDirectories
sessionId createdsessionId
sdkqueryMessages
sessionId
kind
request serverName message mode requestedSchema type properties side type
sessionId
inputRequested
disposablesagents
skind sactiontype ActionTypeChatInputRequested
inputRequestedsactionrequest
sendPromise agentchatscreatedchat createdchat createdsession
inputRequest inputRequestedp
startup sdkcapturedStartupOptions
assert startupcanUseTool
assert startuponElicitation
agentinputRequestid ChatInputResponseKindAccept
side state ChatInputAnswerStateSubmitted value kind ChatInputAnswerValueKindText value
sendPromise
assert
elicitResult sdkelicitationResults
permissionMode startuppermissionMode
elicitResult action content side
permissionMode
capi
capistreamEvents
realProxy disposables capi
sdk
logService
stateManager disposables logService
configService disposables stateManager logService
services
ILogService logService
ICopilotApiService capi
IClaudeProxyService realProxy
ISessionDataService
IClaudeAgentSdkService sdk
IAgentPluginManager
_serviceBrand
basePath scheme path
_clientId _customizations ClientPluginCustomization
IAgentConfigurationService configService
IAgentHostOTelService noopOTelService
IAgentHostStateManager stateManager
IAgentHostSessionTitleSignal disposables stateManager
IAgentHostGitHubEndpointService
IAgentHostGitService
IAgentHostCheckpointService
IAgentHostCustomizationEnablementService
IAgentHostAuthenticationService
disposables
instantiationService disposables services
agent disposablesinstantiationServiceClaudeAgent
agentresource
created agent workingDirectories
sessionId createdsessionId
sdkqueryMessages
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
kind toolName input file_path toolUseID
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
sessionId
signals AgentSignal
disposablesagents
signalss
skind sstatetoolCallId
agent
agentchatscreatedchat createdchat createdsession
summary signalss
skind
kind skind
toolCallId sstatetoolCallId
toolName sstatetoolName
permissionKind spermissionKind
permissionPath spermissionPath
skind
a saction
atype
ActionTypeChatResponsePart
kind type atype partKind apartkind content apartkind ResponsePartKindMarkdown apartcontent
ActionTypeChatDelta
kind type atype content acontent
ActionTypeChatToolCallStart
kind type atype toolCallId atoolCallId toolName atoolName
ActionTypeChatToolCallDelta
kind type atype toolCallId atoolCallId content acontent
ActionTypeChatToolCallComplete
kind type atype toolCallId atoolCallId success aresultsuccess content aresultcontent
ActionTypeChatUsage
kind type atype
ActionTypeChatTurnComplete
kind type atype
kind type atype
kind skind
assert
summary
canUseToolResults sdkcanUseToolResults
summary
kind type ActionTypeChatResponsePart partKind ResponsePartKindMarkdown content
kind type ActionTypeChatDelta content
kind type ActionTypeChatToolCallStart toolCallId toolName
kind type ActionTypeChatToolCallDelta toolCallId content
kind type ActionTypeChatToolCallReady
kind toolCallId toolName permissionKind permissionPath
kind type ActionTypeChatToolCallComplete toolCallId success content type ToolResultContentTypeText text
kind type ActionTypeChatResponsePart partKind ResponsePartKindMarkdown content
kind type ActionTypeChatDelta content
kind type ActionTypeChatUsage
kind type ActionTypeChatTurnComplete
canUseToolResults
behavior updatedInput file_path