@@ -16,8 +16,9 @@ import { CodeIndexManager } from "../services/code-index/manager"
1616import { importSettingsWithFeedback } from "../core/config/importExport"
1717import { MdmService } from "../services/mdm/MdmService"
1818import { t } from "../i18n"
19- import { getAppUrl } from "@roo-code/types" // kilocode_change
19+ import { getAppUrl , AGENT_MANAGER_ENABLED } from "@roo-code/types" // kilocode_change
2020import { generateTerminalCommand } from "../utils/terminalCommandGenerator" // kilocode_change
21+ import { AgentManagerProvider } from "../core/kilocode/agent-manager/AgentManagerProvider" // kilocode_change
2122
2223/**
2324 * Helper to get the visible ClineProvider instance or log if not found.
@@ -65,8 +66,27 @@ export type RegisterCommandOptions = {
6566 provider : ClineProvider
6667}
6768
69+ // kilocode_change start - Agent Manager provider
70+ let agentManagerProvider : AgentManagerProvider | undefined
71+
72+ const registerAgentManager = ( options : RegisterCommandOptions ) => {
73+ const { context, outputChannel } = options
74+
75+ vscode . commands . executeCommand ( "setContext" , "kilo-code.agentManagerEnabled" , AGENT_MANAGER_ENABLED )
76+
77+ if ( AGENT_MANAGER_ENABLED ) {
78+ agentManagerProvider = new AgentManagerProvider ( context , outputChannel )
79+ context . subscriptions . push ( agentManagerProvider )
80+ }
81+ }
82+ // kilocode_change end
83+
6884export const registerCommands = ( options : RegisterCommandOptions ) => {
69- const { context } = options
85+ const { context, outputChannel } = options
86+
87+ // kilocode_change start
88+ registerAgentManager ( options )
89+ // kilocode_change end
7090
7191 for ( const [ id , callback ] of Object . entries ( getCommandsMap ( options ) ) ) {
7292 const command = getCommand ( id as CommandId )
@@ -76,6 +96,11 @@ export const registerCommands = (options: RegisterCommandOptions) => {
7696
7797const getCommandsMap = ( { context, outputChannel } : RegisterCommandOptions ) : Record < CommandId , any > => ( {
7898 activationCompleted : ( ) => { } ,
99+ // kilocode_change start
100+ agentManagerOpen : ( ) => {
101+ agentManagerProvider ?. openPanel ( )
102+ } ,
103+ // kilocode_change end
79104 cloudButtonClicked : ( ) => {
80105 const visibleProvider = getVisibleProviderOrLog ( outputChannel )
81106
0 commit comments