Это 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*as sinon from'sinon';import{URI}from'../../../../base/common/uri.js';import{ ensureNoDisposablesAreLeakedInTestSuite }from'../../../../base/test/common/utils.js';import{ NullLogService }from'../../../log/common/log.js';importtype{ AgentSignal }from'../../common/agent.js';import{ ActionType }from'../../common/state/sessionActions.js';import{ ResponsePartKind, ToolResultContentType }
ToolCallConfirmationReason ToolCallContributorKind
ClaudeMapperState mapSDKMessageToAgentSignals
encodeForwardedChatError
SubagentRegistry
makeAssistantMessage
makeContentBlockStartText
makeContentBlockStartThinking
makeContentBlockStartToolUse
makeContentBlockStop
makeInputJsonDelta
makeMessageStart
makeMessageStop
makeResultError
makeResultSuccess
makeStreamEvent
makeTextDelta
makeThinkingDelta
makeUserToolResultMessage
disposables
clock sinonSinonFakeTimers
clock
clock
warns
override message args
warnsmessage argsa a
SubagentRegistry
disposables
signals
assertsignals
signals
assertsignals
kind
resource
turnId
modelCallId
signals
aborted
assertsignals
marker fetchError type capiError code message
signals
errorSignal signalss skind sactiontype ActionTypeChatError
asserterrorSignal errorSignalkind errorSignalactiontype ActionTypeChatError
asserterrorSignalactionduration
error errorSignalactionparterror
meta error_meta chatError fetchError type
assertmetachatErrorfetchErrortype
asserterrormessage
marker fetchError type capiError code
result
signals
result is_error result
errorSignal signalss skind sactiontype ActionTypeChatError
asserterrorSignal errorSignalkind errorSignalactiontype ActionTypeChatError
meta errorSignalactionparterror_meta chatError fetchError type
assertmetachatErrorfetchErrortype
out AgentSignal
log
state
resolver
msgs AgentSignal outmsgs
state log resolver
state log resolver
state log resolver
state log resolver
state log resolver
assertoutlength
start out
assertstartkind startactiontype ActionTypeChatResponsePart
assertstartresource
assertstartactionturnId
assertstartactionpartkind ResponsePartKindMarkdown
partId startactionpartid
assertpartIdlength
assertout
kind
resource
action
type ActionTypeChatDelta
turnId
partId
content
kind
resource
action
type ActionTypeChatDelta
turnId
partId
content
log
state
startSignals
state
log
assertstartSignalslength
start startSignals
assertstartkind startactiontype ActionTypeChatResponsePart
assertstartactionpartkind ResponsePartKindReasoning
partId startactionpartid
deltaSignals
state
log
assertdeltaSignals
kind
resource
action
type ActionTypeChatReasoning
turnId
partId
content
log
state
signals
state
log
assertsignals
kind
resource
action
type ActionTypeChatToolCallStart
turnId
toolCallId
toolName
displayName
_meta toolKind
assertlogwarns
log
state
signals
state
log
assertsignals
kind
resource
action
type ActionTypeChatToolCallStart
turnId
toolCallId
toolName
displayName
contributor kind ToolCallContributorKindClient clientId
assertlogwarns
log
state
resolver
state log resolver
state log resolver
signals
isError
state
log
signal signals
signalkind signalactiontype ActionTypeChatToolCallComplete
assertsignalactionresultsuccess
assertsignalactionresulterror message code
log
state
resolver
state log resolver
signals
state
log
assertsignals
kind
resource
action
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
clock sinon toFake
log
state
resolver
state log resolver
first
state
log
resolver
clock
second
state
log
resolver
assertfirst second
kind
resource
action
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
invocationMessage markdown
kind
resource
action
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
invocationMessage markdown
clock sinon toFake
log
state
resolver
state log resolver
first
state
log
resolver
withinInterval
state
log
resolver
stopped
state
log
resolver
assert
first firstsignal signalkind signalaction
withinInterval
stopped stoppedsignal signalkind signalaction
first
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
invocationMessage markdown
withinInterval
stopped
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
invocationMessage markdown
type ActionTypeChatToolCallReady
turnId
toolCallId
invocationMessage markdown
toolInput
confirmed ToolCallConfirmationReasonNotNeeded
state
resolver
start
state
resolver
delta
state
resolver
ready
state
resolver
complete
state
resolver
assertstart delta ready complete
kind
resource
action
type ActionTypeChatToolCallStart
turnId
toolCallId
toolName
displayName
contributor kind ToolCallContributorKindClient clientId
kind
resource
action
type ActionTypeChatToolCallDelta
turnId
toolCallId
content
kind
resource
action
type ActionTypeChatToolCallReady
turnId
toolCallId
invocationMessage
toolInput
confirmed ToolCallConfirmationReasonNotNeeded
kind
resource
action
type ActionTypeChatToolCallComplete
turnId
toolCallId
result
success
pastTenseMessage
content type ToolResultContentTypeText text
log
state
resolver
state log resolver
state log resolver
signals state log resolver
assertsignals
kind
resource
action
type ActionTypeChatToolCallReady
turnId
toolCallId
invocationMessage markdown
toolInput
confirmed ToolCallConfirmationReasonNotNeeded
_meta toolKind
assertlogwarns
log
state
resolver
state log resolver
state log resolver
signals
state
log
assertsignals
kind
resource
action
type ActionTypeChatToolCallComplete
turnId
toolCallId
result
success
pastTenseMessage
content type ToolResultContentTypeText text
assertlogwarns
log
state
signals
state
log
assertsignals
assertlogwarnslength
assertlogwarns
log
state
resolver
state log resolver
signals
isError
state
log
assertsignalslength
complete signals
assertcompletekind completeactiontype ActionTypeChatToolCallComplete
assertcompleteactionresultsuccess
assertcompleteactionresulterrorcode
log
state
resolver
state log resolver
signals
type text
type text
state
log
complete signals
assertcompletekind completeactiontype ActionTypeChatToolCallComplete
assertcompleteactionresultcontent
type ToolResultContentTypeText text
type ToolResultContentTypeText text
log
state
resolver
state log resolver
fileEdit
type ToolResultContentTypeFileEdit
before uri content uri
after uri content uri
diff added removed
state fileEdit
signals
state
log
complete signals
assertcompletekind completeactiontype ActionTypeChatToolCallComplete
assertcompleteactionresultcontent
type ToolResultContentTypeText text
fileEdit
log
state
resolver
state log resolver
signals
state
log
complete signals
assertcompletekind completeactiontype ActionTypeChatToolCallComplete
assertcompleteactionresultcontent
type ToolResultContentTypeText text
state
assertstate
fileEdit
type ToolResultContentTypeFileEdit
before uri content uri
after uri content uri
diff
state fileEdit
assertstate fileEdit
assertstate
log
state
signals
type text citations
type id name input
state
log
assertsignals
kind
resource
turnId
modelCallId
assertlogwarns
log
state
signals
type text citations
state
log
assertsignals
kind
resource
turnId
modelCallId
assertlogwarns
result
resultusageinput_tokens
resultusageoutput_tokens
resultusagecache_read_input_tokens
resultmodelUsage
inputTokens
outputTokens
cacheReadInputTokens
cacheCreationInputTokens
webSearchRequests
costUSD
contextWindow
maxOutputTokens
signals result
assertsignals
kind
resource
action
type ActionTypeChatUsage
turnId
usage
inputTokens
outputTokens
cacheReadTokens
model
result
resulttotal_cost_usd
signals result
assertsignalslength
usage signals
assertusagekind usageactiontype ActionTypeChatUsage
assertusageactionusage_meta
result
resultmodelUsage
signals result
assertsignalslength
usage signals
assertusagekind usageactiontype ActionTypeChatUsage
assertusageactionusagemodel
log
state
state
log
resultSignals
state
log
assertresultSignalslength
assertlogwarnslength
assertlogwarns
assertlogwarns
lateSignals
state
log
assertlateSignals
assertlogwarnslength
assertlogwarns
log
state
stop
state
log
assertstop
log
state
resolver
text0 state log resolver
think1 state log resolver
text0Start text0
think1Start think1
asserttext0Startkind text0Startactiontype ActionTypeChatResponsePart
assertthink1Startkind think1Startactiontype ActionTypeChatResponsePart
asserttext0Startactionpartkind ResponsePartKindMarkdown
assertthink1Startactionpartkind ResponsePartKindReasoning
textPartId text0Startactionpartid
thinkPartId think1Startactionpartid
asserttextPartId thinkPartId
dText state log resolver
dThink state log resolver
assertdTextkind dTextactiontype ActionTypeChatDelta
assertdTextactionpartId textPartId
assertdThinkkind dThinkactiontype ActionTypeChatReasoning
assertdThinkactionpartId thinkPartId
log
state
resolver
state log resolver
thinkStart state log resolver
thinkDelta state log resolver
state log resolver
textStart state log resolver
textDelta state log resolver
thinkStartSignal thinkStart
textStartSignal textStart
assertthinkStartSignalkind thinkStartSignalactiontype ActionTypeChatResponsePart
asserttextStartSignalkind textStartSignalactiontype ActionTypeChatResponsePart
assertthinkStartSignalactionpartkind ResponsePartKindReasoning
asserttextStartSignalactionpartkind ResponsePartKindMarkdown
thinkPartId thinkStartSignalactionpartid
textPartId textStartSignalactionpartid
assertthinkPartId textPartId
thinkDeltaSignal thinkDelta
textDeltaSignal textDelta
assertthinkDeltaSignalkind thinkDeltaSignalactiontype ActionTypeChatReasoning
assertthinkDeltaSignalactionpartId thinkPartId
asserttextDeltaSignalkind textDeltaSignalactiontype ActionTypeChatDelta
asserttextDeltaSignalactionpartId textPartId
/**
* Direct unit tests for {@link mapSDKMessageToAgentSignals}.
*
* The mapper takes a per-session {@link ClaudeMapperState} and is
* exercised here as a stand-alone function. The integrated
* `claudeAgent.test.ts` suite still drives the mapper end-to-end
* alongside the SDK envelope plumbing.
*/
suite
(
'claudeMapSessionEvents — direct mapper tests'
,
(
)
=>
{
const
=
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
const
SESSION
=
URI
.
parse
(
'agent-session://test/abc'
)
;
const
SESSION_STR
=
SESSION
.
toString
(
)
;
const
SESSION_ID
=
'sid-1'
;
const
TURN_ID
=
'turn-1'
;
let
:
.
|
undefined
;
teardown
(
(
)
=>
{
?.
restore
(
)
;
=
undefined
;
}
)
;
/**
* Captures `warn` calls so defense-in-depth tests can assert the
* mapper logged the dropped diagnostic.
*/
class
CapturingLogService
extends
NullLogService
{
readonly
:
string
[
]
=
[
]
;
warn
(
:
string
,
...
:
unknown
[
]
)
:
void
{
this
.
.
push
(
[
,
...
.
map
(
=>
String
(
)
)
]
.
join
(
' '
)
)
;
}
}
/**
* Fresh real {@link SubagentRegistry} so the per-test registry can
* record subagent state writes the mapper makes (Phase 12: spawning
* entries, inner-tool→parent edges, etc). Tests that don't touch
* subagent paths simply pass `r()` through to satisfy the mapper
* signature.
*/
function
r
(
)
:
{
return
.
add
(
new
SubagentRegistry
(
)
)
;
}
test
(
'message_start emits no signals'
,
(
)
=>
{
const
=
mapSDKMessageToAgentSignals
(
makeStreamEvent
(
SESSION_ID
,
makeMessageStart
(
)
)
,
SESSION
,
TURN_ID
,
new
ClaudeMapperState
(
)
,
new
NullLogService
(
)
,
r
(
)
,
)
;
.
deepStrictEqual
(
,
[
]
)
;
}
)
;
test
(
'canonical assistant message reports one completed model call'
,
(
)
=>
{
const
=
mapSDKMessageToAgentSignals
(
makeAssistantMessage
(
SESSION_ID
,
[
]
)
,
SESSION
,
TURN_ID
,
new
ClaudeMapperState
(
)
,
new
NullLogService
(
)
,
r
(
)
,
)
;
.
deepStrictEqual
(
,
[
{
:
'model_call_completed'
,
:
SESSION
,
:
TURN_ID
,
:
'msg_test'
,
}
]
)
;
}
)
;
test
(
'aborted canonical assistant message does not report a completed model call'
,
(
)
=>
{
const
=
mapSDKMessageToAgentSignals
(
{
...
makeAssistantMessage
(
SESSION_ID
,
[
]
)
,
:
true
as
const
}
,
SESSION
,
TURN_ID
,
new
ClaudeMapperState
(
)
,
new
NullLogService
(
)
,
r
(
)
,
)
;
.
deepStrictEqual
(
,
[
]
)
;
}
)
;
test
(
'error_during_execution result emits a ChatError carrying duration and _meta'