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 { Event } from '../../../../base/common/event.js';
import { DisposableStore } from '../../../../base/common/lifecycle.js';
import { URI } from '../../../../base/common/uri.js';
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';
import { buildAnnotationsUri } from '../../common/annotationsUri.js';
import { ActionType, type ActionEnvelope, type ClientChangesetAction } from '../../common/state/sessionActions.js'
AutomationOperation AutomationRunOriginKind AutomationRunStatus ChangesetStatus MessageKind ResponsePartKind SessionLifecycle SessionStatus TerminalClaimKind TerminalLifecycleStatus TurnState
buildDefaultChatUri createChatState createDefaultChatSummary getTurnError StateComponents
AgentSubscriptionManager AutomationCatalogSubscription AutomationRunSubscription ChangesetStateSubscription ChatStateSubscription isActionEnvelopeRelevantToSubscriptionUris RootStateSubscription SessionStateSubscription TerminalStateSubscription
normalizeLegacyActionEnvelope readLegacyTurnError
overrides PartialRootState RootState
agents
activeSessions
terminals
overrides
sessionUri SessionSummary
resource sessionUri
provider
title
status SessionStatusIdle
createdAt
modifiedAt
project uri displayName
sessionUri overrides PartialSessionState SessionState
provider
title
status SessionStatusIdle
project uri displayName
lifecycle SessionLifecycleReady
activeClients
chats
overrides
chatUri sessionSummary SessionSummary sessionUri overrides PartialChatState ChatState
sessionSummary chatUri
overrides
overrides PartialTerminalState TerminalState
title
content
claim kind TerminalClaimKindClient clientId
lifecycle status TerminalLifecycleStatusRunning
overrides
action ActionEnvelope serverSeq origin ActionEnvelope rejectionReason channel ActionEnvelope
resolvedChannel channel
actiontype
actiontype chatUri
actiontype terminalUri
actiontype changesetUri
sessionUri
channel resolvedChannel action serverSeq origin rejectionReason
sessionUri scheme path
terminalUri scheme path
chatUri sessionUri
changesetUri
automationUri
automationRunUri
AutomationState
entries
AutomationRunState
resource automationRunUri
automation automationUri
origin kind AutomationRunOriginKindManual
lifecycle status AutomationRunStatusPending createdAt
sessions
disposables
subscription disposables noop
subscription
definition
title
message text origin kind MessageKindAutomation
session
enabled
triggers
subscription
type ActionTypeAutomationCreateRequested
resource automationUri
definition
clientId clientSeq
requested subscriptionvalue AutomationState
subscription
type ActionTypeAutomationSet
automation
resource automationUri
definition
runs
operations AutomationOperationUpdate AutomationOperationRemove AutomationOperationRun
createdAt
modifiedAt
assert
requested requestedentries
authoritative subscriptionvalue AutomationStateentriesautomation automationresource
requested
authoritative automationUri
subscription disposables automationRunUri noop
subscription
subscription
type ActionTypeAutomationRunCancelRequested
clientId clientSeq automationRunUri
requested subscriptionvalue AutomationRunStatelifecyclestatus
subscription
type ActionTypeAutomationRunLifecycleChanged
lifecycle
status AutomationRunStatusCancelled
createdAt
completedAt
automationRunUri
assert
requested
authoritative subscriptionvalue AutomationRunStatelifecyclestatus
requested AutomationRunStatusPending
authoritative AutomationRunStatusCancelled
subscription disposables noop
definition
title
message text origin kind MessageKindAutomation
session
enabled
triggers
subscription
entries
resource automationUri
definition
runs
operations AutomationOperationUpdate AutomationOperationRemove AutomationOperationRun
createdAt
modifiedAt
subscription
type ActionTypeAutomationRemoved
resource automationUri
clientId clientSeq
assert
subscriptionvalue AutomationStateentriesautomation automationresource
automationUri
disposables
state ChangesetState
status ChangesetStatusReady
files
id
edit
before uri content uri
after uri content uri
subscription disposables changesetUri noop
subscriptionstate
action ClientChangesetAction
type ActionTypeChangesetFilesReviewChanged
files
reviewed
clientSeq subscriptionaction
optimisticState subscriptionvalue ChangesetState
subscriptionaction clientId clientSeq
assert
optimisticReviewed optimisticStatefilesreviewed
verifiedBeforeEcho statefilesreviewed
verifiedAfterEcho subscriptionverifiedValuefilesreviewed
pendingCleared subscriptionvalue subscriptionverifiedValue
optimisticReviewed
verifiedBeforeEcho
verifiedAfterEcho
pendingCleared
disposables DisposableStore
disposables
disposables
sub disposables noop
assertsubvalue
assertsubverifiedValue
sub disposables noop
state activeSessions
substate
assertsubvalue state
assertsubverifiedValue state
sub disposables noop
fired RootState
disposablessubs fireds
sub
assertfiredlength
sub disposables noop
sub
sub
type ActionTypeRootActiveSessionsChanged activeSessions
assertsubvalue RootStateactiveSessions
sub disposables noop
state
substate
sub
type ActionTypeSessionReady
assertsubvalue state
sub disposables noop
sub
events
disposablessub events
disposablessub events
sub
type ActionTypeRootActiveSessionsChanged activeSessions
assertevents
sub disposables noop
sub
type ActionTypeRootActiveSessionsChanged activeSessions
assertsubvalue
sub
assertsubvalue RootStateactiveSessions
sub disposables noop
sub
type ActionTypeRootActiveSessionsChanged activeSessions
sub activeSessions
assertsubvalue RootStateactiveSessions
sub disposables noop
sub
err
errors Error
disposablessuberror errorserror
suberr
assert
value subvalue
verifiedValueExists subverifiedValue
errors
value err
verifiedValueExists
errors err
disposables DisposableStore
seq
disposables
seq
disposables
uri sessionUri clientId SessionStateSubscription
disposables uri clientId seq noop
sub
assertsubvalue
sub
state sessionUri
substate
assertsubvalue state
assertsubverifiedValue state
sub
state sessionUri
substate
clientSeq sub
type ActionTypeSessionTitleChanged
title
assertclientSeq
assertsubvalue SessionStatetitle
assertsubverifiedValuetitle
sub
subsessionUri
clientSeq sub
type ActionTypeSessionTitleChanged
title
sub
type ActionTypeSessionTitleChanged title
clientId clientSeq
assertsubverifiedValuetitle
assertsubvalue SessionStatetitle
sub
subsessionUri
clientSeq sub
type ActionTypeSessionTitleChanged
title
sub
type ActionTypeSessionTitleChanged title
clientId clientSeq
assertsubverifiedValuetitle
assertsubvalue SessionStatetitle
sub
subsessionUri
sub
type ActionTypeSessionTitleChanged
title
sub
type ActionTypeSessionReady
clientId clientSeq
assertsubverifiedValuelifecycle SessionLifecycleReady
assertsubvalue SessionStatetitle
sub
state sessionUri
substate
sub
type ActionTypeChatTurnComplete turnId duration
assertsubvalue state
sub
subsessionUri
clientSeq sub
type ActionTypeSessionTitleChanged
title
sub
type ActionTypeSessionTitleChanged title
clientId clientSeq
assertsubvalue subverifiedValue
sub
subsessionUri
sub
type ActionTypeSessionTitleChanged
title
assertsubvalue SessionStatetitle
sub
assertsubvalue SessionStatetitle
sub
subsessionUri
sub
type ActionTypeSessionTitleChanged title
assertsubvalue SessionStatetitle
sub
sub
type ActionTypeSessionTitleChanged title
assertsubvalue
subsessionUri
assertsubvalue SessionStatetitle
sub
subsessionUri
fired SessionState
disposablessubs fireds
sub
type ActionTypeSessionTitleChanged
title
assertfiredlength
assertfiredtitle
sub
subsessionUri
action type ActionTypeSessionWorkingDirectorySet directory
clientSeq subaction
assertsubvalue SessionStateworkingDirectories
assertsubverifiedValueworkingDirectories
subaction clientId clientSeq
assertsubverifiedValueworkingDirectories
assertsubvalue subverifiedValue
sub
subsessionUri
action type ActionTypeSessionWorkingDirectorySet directory
clientSeq subaction
subaction clientId clientSeq
assertsubverifiedValueworkingDirectories
assertsubvalue SessionStateworkingDirectories
disposables DisposableStore
seq
disposables
seq
disposables
uri chatUri clientId ChatStateSubscription
disposables uri clientId seq noop
error ErrorInfo Turn error ErrorInfo
id
message text origin kind MessageKindUser
responseParts
usage
state TurnStateError
error
error ErrorInfo errorType message
envelope
channel chatUri
serverSeq
origin
action
type ActionTypeChatError
turnId
duration
error
assertenvelopeaction
type ActionTypeChatError
turnId
duration
part kind ResponsePartKindError error
error ErrorInfo errorType message
envelope
channel chatUri
serverSeq
origin
action
type ActionTypeChatTurnsLoaded
turns error
assertenvelopeaction
type ActionTypeChatTurnsLoaded
turns
id
message text origin kind MessageKindUser
responseParts kind ResponsePartKindError error
usage
state TurnStateError
error ErrorInfo errorType message
legacyTurn error
sub
subchatUri turns legacyTurn
assert
legacyError legacyTurn
error subverifiedValueturns
responseParts subverifiedValueturnsresponseParts
legacyField subverifiedValueturns subverifiedValueturns
legacyError error
error
responseParts kind ResponsePartKindError error
legacyField
sub
subchatUri
sub
type ActionTypeChatTurnStarted
turnId
startedAt
message text origin kind MessageKindUser
assertsubvalue ChatState activeTurnid
sub
type ActionTypeChatTurnComplete turnId duration
assert
activeTurn subvalue ChatState activeTurn
turns subvalue ChatState turnsturn id turnid state turnstate
activeTurn
turns id state TurnStateComplete
disposables DisposableStore
disposables
disposables
sub disposables terminalUri noop
sub
sub
type ActionTypeTerminalData data
assertsubvalue TerminalStatecontent
type value
sub disposables terminalUri noop
sub
sub
type ActionTypeTerminalCommandExecuted commandId commandLine timestamp
sub
type ActionTypeTerminalData data
sub
type ActionTypeTerminalCommandFinished commandId exitCode durationMs
assertsubvalue TerminalStatecontent
type
commandId
commandLine
output
timestamp
isComplete
exitCode
durationMs
sub disposables terminalUri noop
sub
sub
type ActionTypeTerminalData data
assertsubvalue TerminalStatecontent
sub disposables terminalUri noop
sub
sub
type ActionTypeRootActiveSessionsChanged activeSessions
assertsubvalue TerminalStatecontent
sub disposables terminalUri noop
state title
substate
assertsubvalue state
disposables DisposableStore
seq
subscribedResources
unsubscribedResources
disposables
seq
subscribedResources
unsubscribedResources
disposables
resource resource state SessionState TerminalState ChangesetState AnnotationsState AutomationState fromSeq resource
key resource
subscribedResourceskey
key
resource key state annotations fromSeq
key
resource key state key fromSeq
resource key state fromSeq
AgentSubscriptionManager
disposables
seq
noop
subscribe
resource
unsubscribedResourcesresource
mgr
assertmgrrootState
assertmgrrootStatevalue
mgr
state activeSessions
mgrstate
assertmgrrootStatevalue state
mgr
uri sessionUri
ref mgrStateComponentsSession uri
assertrefobject
assertrefobjectvalue
r r
assertrefobjectvalue
ref
mgr
uri sessionUri
ref1 mgrStateComponentsSession uri
ref2 mgrStateComponentsSession uri
r r
assertref1object ref2object
ref1
assertunsubscribedResourceslength
ref2
assertunsubscribedResourceslength
mgr
uri sessionUri
ref mgrStateComponentsSession uri
r r
ref
assertunsubscribedResourcessessionUri
mgr
mgr
uri sessionUri
ref mgrStateComponentsSession uri
r r
mgr
type ActionTypeRootActiveSessionsChanged activeSessions
assertmgrrootStatevalue RootStateactiveSessions
mgr
type ActionTypeSessionTitleChanged title
assertrefobjectvalue SessionStatetitle
ref
assert
rootVariant
type ActionTypeRootActiveSessionsChanged activeSessions
rootOnlyGetsSession
type ActionTypeSessionTitleChanged title
exactSession
type ActionTypeSessionTitleChanged title
sessionUri
automationVariant
type ActionTypeAutomationRemoved resource automationUri
rootVariant
rootOnlyGetsSession
exactSession
automationVariant
mgr
mySessionUri scheme path
ref mgrStateComponentsSession mySessionUri
r r
assertrefobjectvalue
assertsubscribedResourcesmySessionUri
ref
mgr
uri terminalUri
ref mgrStateComponentsTerminal uri
r r
assertrefobjectvalue
assertsubscribedResourcesterminalUri
ref
normalizedCatalogUri
mgr resource
subscribedResourcesresource
resource resource state entries fromSeq
ref mgrStateComponentsAutomationCatalog
EventrefobjectonDidChange
assert
subscribedResources
resources mgrresource resource
activeResource mgrresource
subscribedResources normalizedCatalogUri
resources normalizedCatalogUri
activeResource normalizedCatalogUri
ref
assertunsubscribedResources normalizedCatalogUri
mgr
uri sessionUri
ref mgrStateComponentsSession uri
r r
clientSeq mgruri
type ActionTypeSessionTitleChanged
title
assertclientSeq
assertrefobjectvalue SessionStatetitle
assertrefobjectverifiedValuetitle
ref
state ChangesetState
status ChangesetStatusReady
files
id
edit
after uri content uri
mgr resource resource resource state fromSeq
uri changesetUri
ref mgrStateComponentsChangeset uri
r r
clientSeq mgruri
type ActionTypeChangesetFilesReviewChanged
files
reviewed
assert
clientSeq
optimisticReviewed refobjectvalue ChangesetStatefilesreviewed
verifiedReviewed refobjectverifiedValuefilesreviewed
clientSeq
optimisticReviewed
verifiedReviewed
ref
mgr
ref1 mgrStateComponentsSession sessionUri
ref2 mgrStateComponentsTerminal terminalUri
r r
disposablesmgr
mgr
assertunsubscribedResourcessessionUri
assertunsubscribedResourcesterminalUri
ref1
ref2
mgr
result mgr
assertresult
mgr
uri sessionUri
ref mgrStateComponentsSession uri
r r
unmanaged mgruri
assertunmanaged
assertunmanaged refobject
ref
after mgruri
assertafter
subscribeAttempts
mgr resource
subscribedResourcesresource
subscribeAttempts
subscribeAttempts
resource resource state resource title fromSeq
uri sessionUri
failedRef mgrStateComponentsSession uri
r r
assertfailedRefobjectvalue
retryRef mgrStateComponentsSession uri
r r
assert
subscribeAttempts
retriedTitle retryRefobjectvalue SessionStatetitle
unmanagedIsRetry mgruri retryRefobject
subscribeAttempts
retriedTitle
unmanagedIsRetry
failedRef
assertmgruri retryRefobject
retryRef
assertmgruri
mgr
sUri sessionUri
tUri terminalUri
sessionRef mgrStateComponentsSession sUri
sessionRef2 mgrStateComponentsSession sUri
terminalRef mgrStateComponentsTerminal tUri
mgrs resource sresource kind skind refCount srefCount holders sholders status sstatus
pending
r r
active
assert pending active
pending
resource sessionUri kind StateComponentsSession refCount holders owner count status
resource terminalUri kind StateComponentsTerminal refCount holders owner count status
active
resource sessionUri kind StateComponentsSession refCount holders owner count status
resource terminalUri kind StateComponentsTerminal refCount holders owner count status
sessionRef
sessionRef2
terminalRef
assertmgrlength
mgr
sUri sessionUri
refA mgrStateComponentsSession sUri
refB mgrStateComponentsSession sUri
refB2 mgrStateComponentsSession sUri
r r
withAll mgrholders
refB
afterOneB mgrholders
refB
afterDoubleDispose mgrholders
refA
refB2
assert withAll afterOneB afterDoubleDispose remaining mgrlength
withAll owner count owner count
afterOneB owner count owner count
afterDoubleDispose owner count owner count
remaining
mgr
ref mgrStateComponentsSession sessionUri
r r
assert
mgrs kind skind status sstatus
kind StateComponentsSession status
ref
mgr
ref mgrStateComponentsSession sessionUri
r r
mgrsessionUri type ActionTypeSessionWorkingDirectorySet directory
assertrefobjectvalue SessionStateworkingDirectories
mgrsessionUri sessionUri workingDirectories
assertrefobjectvalue SessionStateworkingDirectories
assertmgr
ref
mgr
ref mgrStateComponentsSession sessionUri
r r
mgrsessionUri type ActionTypeSessionWorkingDirectorySet directory
mgrsessionUri
assertrefobjectvalue
assertmgr
ref
mgr resource
resource resource
state entries
fromSeq
ref mgrStateComponentsAutomationCatalog
EventrefobjectonDidChange
mgr
assert
valueIsError refobjectvalue
resource mgrresource
valueIsError
resource
ref
mgr
annotationsUri sessionUri
ref mgrStateComponentsAnnotations annotationsUri
r r
annotation
id
origin session sessionUri chat chatUri turnId
resource
resolved
entries id text
mgrannotationsUri type ActionTypeAnnotationsSet annotation
mgrannotationsUri annotations
assert
state refobjectvalue
pending mgrentry entryaction
state annotations annotation
pending type ActionTypeAnnotationsSet annotation
ref