@@ -132,11 +132,31 @@ class SetupAgent extends Disposable implements IChatAgentImplementation {
132
132
} ) ;
133
133
}
134
134
135
- static registerAgent ( instantiationService : IInstantiationService , id : string , name : string , isDefault : boolean , description : string , location : ChatAgentLocation , mode : ChatMode | undefined , context : ChatEntitlementContext , controller : Lazy < ChatSetupController > ) : { agent : SetupAgent ; disposable : IDisposable } {
135
+ static registerVSCodeAgent ( instantiationService : IInstantiationService , context : ChatEntitlementContext , controller : Lazy < ChatSetupController > ) : { agent : SetupAgent ; disposable : IDisposable } {
136
136
return instantiationService . invokeFunction ( accessor => {
137
137
const chatAgentService = accessor . get ( IChatAgentService ) ;
138
138
139
- return SetupAgent . doRegisterAgent ( instantiationService , chatAgentService , id , name , isDefault , description , location , mode , context , controller ) ;
139
+ const disposables = new DisposableStore ( ) ;
140
+
141
+ const { agent, disposable } = SetupAgent . doRegisterAgent ( instantiationService , chatAgentService , 'setup.vscode' , 'vscode' , false , localize2 ( 'vscodeAgentDescription' , "Ask questions about VS Code" ) . value , ChatAgentLocation . Panel , undefined , context , controller ) ;
142
+ disposables . add ( disposable ) ;
143
+
144
+ disposables . add ( SetupTool . registerTool ( instantiationService , {
145
+ id : 'setup.tools.createNewWorkspace' ,
146
+ source : {
147
+ type : 'internal' ,
148
+ } ,
149
+ icon : Codicon . newFolder ,
150
+ displayName : localize ( 'setupToolDisplayName' , "New Workspace" ) ,
151
+ modelDescription : localize ( 'setupToolsDescription' , "Scaffold a new workspace in VS Code" ) ,
152
+ userDescription : localize ( 'setupToolsDescription' , "Scaffold a new workspace in VS Code" ) ,
153
+ canBeReferencedInPrompt : true ,
154
+ toolReferenceName : 'new' ,
155
+ when : ContextKeyExpr . true ( ) ,
156
+ supportsToolPicker : true ,
157
+ } ) . disposable ) ;
158
+
159
+ return { agent, disposable : disposables } ;
140
160
} ) ;
141
161
}
142
162
@@ -502,7 +522,7 @@ class SetupAgent extends Disposable implements IChatAgentImplementation {
502
522
503
523
class SetupTool extends Disposable implements IToolImpl {
504
524
505
- static registerTools ( instantiationService : IInstantiationService , toolData : IToolData ) : { tool : SetupTool ; disposable : IDisposable } {
525
+ static registerTool ( instantiationService : IInstantiationService , toolData : IToolData ) : { tool : SetupTool ; disposable : IDisposable } {
506
526
return instantiationService . invokeFunction ( accessor => {
507
527
const toolService = accessor . get ( ILanguageModelToolsService ) ;
508
528
@@ -773,21 +793,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
773
793
if ( ! context . state . installed && ! vscodeAgentDisposables . value ) {
774
794
const disposables = vscodeAgentDisposables . value = new DisposableStore ( ) ;
775
795
776
- disposables . add ( SetupAgent . registerAgent ( this . instantiationService , 'setup.vscode' , 'vscode' , false , localize2 ( 'vscodeAgentDescription' , "Ask questions about VS Code" ) . value , ChatAgentLocation . Panel , undefined , context , controller ) . disposable ) ;
777
- disposables . add ( SetupTool . registerTools ( this . instantiationService , {
778
- id : 'setup.tools.createNewWorkspace' ,
779
- source : {
780
- type : 'internal' ,
781
- } ,
782
- icon : Codicon . newFolder ,
783
- displayName : localize ( 'setupToolDisplayName' , "New Workspace" ) ,
784
- modelDescription : localize ( 'setupToolsDescription' , "Scaffold a new workspace in VS Code" ) ,
785
- userDescription : localize ( 'setupToolsDescription' , "Scaffold a new workspace in VS Code" ) ,
786
- canBeReferencedInPrompt : true ,
787
- toolReferenceName : 'new' ,
788
- when : ContextKeyExpr . true ( ) ,
789
- supportsToolPicker : true ,
790
- } ) . disposable ) ;
796
+ disposables . add ( SetupAgent . registerVSCodeAgent ( this . instantiationService , context , controller ) . disposable ) ;
791
797
}
792
798
} else {
793
799
defaultAgentDisposables . clear ( ) ;
0 commit comments