@@ -17,6 +17,7 @@ import {
17
17
InputToolbarRegistry ,
18
18
MessageFooterRegistry ,
19
19
SelectionWatcher ,
20
+ WriterComponent ,
20
21
chatIcon ,
21
22
readIcon ,
22
23
IInputToolbarRegistryFactory ,
@@ -58,6 +59,7 @@ import {
58
59
IChatPanel ,
59
60
ISelectionWatcherToken ,
60
61
IWelcomeMessage ,
62
+ IWriterComponent ,
61
63
LabChatModelFactory ,
62
64
LabChatPanel ,
63
65
WidgetConfig ,
@@ -77,8 +79,10 @@ const pluginIds = {
77
79
chatCommands : 'jupyterlab-chat-extension:commands' ,
78
80
chatPanel : 'jupyterlab-chat-extension:chat-panel' ,
79
81
docFactories : 'jupyterlab-chat-extension:factory' ,
82
+ footerRegistry : 'jupyterlab-chat/footerRegistry' ,
80
83
inputToolbarFactory : 'jupyterlab-chat-extension:inputToolbarFactory' ,
81
- selectionWatcher : 'jupyterlab-chat-extension:selectionWatcher'
84
+ selectionWatcher : 'jupyterlab-chat-extension:selectionWatcher' ,
85
+ writerComponentRegistry : 'jupyterlab-chat-extension:writerComponent'
82
86
} ;
83
87
84
88
/**
@@ -178,7 +182,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
178
182
IThemeManager ,
179
183
IToolbarWidgetRegistry ,
180
184
ITranslator ,
181
- IWelcomeMessage
185
+ IWelcomeMessage ,
186
+ IWriterComponent
182
187
] ,
183
188
provides : IChatFactory ,
184
189
activate : (
@@ -197,7 +202,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
197
202
themeManager : IThemeManager | null ,
198
203
toolbarRegistry : IToolbarWidgetRegistry | null ,
199
204
translator_ : ITranslator | null ,
200
- welcomeMessage : string
205
+ welcomeMessage : string ,
206
+ writerComponent : WriterComponent
201
207
) : IChatFactory => {
202
208
const translator = translator_ ?? nullTranslator ;
203
209
@@ -362,7 +368,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
362
368
attachmentOpenerRegistry,
363
369
inputToolbarFactory,
364
370
messageFooterRegistry,
365
- welcomeMessage
371
+ welcomeMessage,
372
+ writerComponent
366
373
} ) ;
367
374
368
375
// Add the widget to the tracker when it's created
@@ -596,6 +603,7 @@ const chatCommands: JupyterFrontEndPlugin<void> = {
596
603
commands . addCommand ( CommandIDs . openChat , {
597
604
label : 'Open a chat' ,
598
605
execute : async args => {
606
+ console . log ( 'ARG' , args ) ;
599
607
const inSidePanel : boolean = ( args . inSidePanel as boolean ) ?? false ;
600
608
const startup : boolean = ( args . startup as boolean ) ?? false ;
601
609
let filepath : string | null = ( args . filepath as string ) ?? null ;
@@ -788,7 +796,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
788
796
ILayoutRestorer ,
789
797
IMessageFooterRegistry ,
790
798
IThemeManager ,
791
- IWelcomeMessage
799
+ IWelcomeMessage ,
800
+ IWriterComponent
792
801
] ,
793
802
activate : (
794
803
app : JupyterFrontEnd ,
@@ -801,7 +810,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
801
810
restorer : ILayoutRestorer | null ,
802
811
messageFooterRegistry : IMessageFooterRegistry ,
803
812
themeManager : IThemeManager | null ,
804
- welcomeMessage : string
813
+ welcomeMessage : string ,
814
+ writerComponent : WriterComponent
805
815
) : MultiChatPanel => {
806
816
const { commands, serviceManager } = app ;
807
817
@@ -847,7 +857,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
847
857
attachmentOpenerRegistry,
848
858
inputToolbarFactory,
849
859
messageFooterRegistry,
850
- welcomeMessage
860
+ welcomeMessage,
861
+ writerComponent
851
862
} ) ;
852
863
chatPanel . id = 'JupyterlabChat:sidepanel' ;
853
864
@@ -1002,7 +1013,7 @@ const inputToolbarFactory: JupyterFrontEndPlugin<IInputToolbarRegistryFactory> =
1002
1013
* Extension providing the message footer registry.
1003
1014
*/
1004
1015
const footerRegistry : JupyterFrontEndPlugin < IMessageFooterRegistry > = {
1005
- id : 'jupyterlab-chat/ footerRegistry' ,
1016
+ id : pluginIds . footerRegistry ,
1006
1017
description : 'The footer registry plugin.' ,
1007
1018
autoStart : true ,
1008
1019
provides : IMessageFooterRegistry ,
@@ -1011,6 +1022,19 @@ const footerRegistry: JupyterFrontEndPlugin<IMessageFooterRegistry> = {
1011
1022
}
1012
1023
} ;
1013
1024
1025
+ /**
1026
+ * Plugin providing a writer component.
1027
+ */
1028
+ const writerComponent : JupyterFrontEndPlugin < WriterComponent > = {
1029
+ id : pluginIds . writerComponentRegistry ,
1030
+ description : 'The writer component registry plugin.' ,
1031
+ autoStart : true ,
1032
+ provides : IWriterComponent ,
1033
+ activate : ( ) : WriterComponent => {
1034
+ return new WriterComponent ( ) ;
1035
+ }
1036
+ } ;
1037
+
1014
1038
export default [
1015
1039
activeCellManager ,
1016
1040
attachmentOpeners ,
@@ -1022,5 +1046,6 @@ export default [
1022
1046
inputToolbarFactory ,
1023
1047
selectionWatcher ,
1024
1048
emojiCommandsPlugin ,
1025
- mentionCommandsPlugin
1049
+ mentionCommandsPlugin ,
1050
+ writerComponent
1026
1051
] ;
0 commit comments