@@ -17,6 +17,7 @@ import {
1717 InputToolbarRegistry ,
1818 MessageFooterRegistry ,
1919 SelectionWatcher ,
20+ WriterComponent ,
2021 chatIcon ,
2122 readIcon ,
2223 IInputToolbarRegistryFactory ,
@@ -58,6 +59,7 @@ import {
5859 IChatPanel ,
5960 ISelectionWatcherToken ,
6061 IWelcomeMessage ,
62+ IWriterComponent ,
6163 LabChatModelFactory ,
6264 LabChatPanel ,
6365 WidgetConfig ,
@@ -77,8 +79,10 @@ const pluginIds = {
7779 chatCommands : 'jupyterlab-chat-extension:commands' ,
7880 chatPanel : 'jupyterlab-chat-extension:chat-panel' ,
7981 docFactories : 'jupyterlab-chat-extension:factory' ,
82+ footerRegistry : 'jupyterlab-chat/footerRegistry' ,
8083 inputToolbarFactory : 'jupyterlab-chat-extension:inputToolbarFactory' ,
81- selectionWatcher : 'jupyterlab-chat-extension:selectionWatcher'
84+ selectionWatcher : 'jupyterlab-chat-extension:selectionWatcher' ,
85+ writerComponentRegistry : 'jupyterlab-chat-extension:writerComponent'
8286} ;
8387
8488/**
@@ -178,7 +182,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
178182 IThemeManager ,
179183 IToolbarWidgetRegistry ,
180184 ITranslator ,
181- IWelcomeMessage
185+ IWelcomeMessage ,
186+ IWriterComponent
182187 ] ,
183188 provides : IChatFactory ,
184189 activate : (
@@ -197,7 +202,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
197202 themeManager : IThemeManager | null ,
198203 toolbarRegistry : IToolbarWidgetRegistry | null ,
199204 translator_ : ITranslator | null ,
200- welcomeMessage : string
205+ welcomeMessage : string ,
206+ writerComponent : WriterComponent
201207 ) : IChatFactory => {
202208 const translator = translator_ ?? nullTranslator ;
203209
@@ -362,7 +368,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
362368 attachmentOpenerRegistry,
363369 inputToolbarFactory,
364370 messageFooterRegistry,
365- welcomeMessage
371+ welcomeMessage,
372+ writerComponent
366373 } ) ;
367374
368375 // Add the widget to the tracker when it's created
@@ -596,6 +603,7 @@ const chatCommands: JupyterFrontEndPlugin<void> = {
596603 commands . addCommand ( CommandIDs . openChat , {
597604 label : 'Open a chat' ,
598605 execute : async args => {
606+ console . log ( 'ARG' , args ) ;
599607 const inSidePanel : boolean = ( args . inSidePanel as boolean ) ?? false ;
600608 const startup : boolean = ( args . startup as boolean ) ?? false ;
601609 let filepath : string | null = ( args . filepath as string ) ?? null ;
@@ -788,7 +796,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
788796 ILayoutRestorer ,
789797 IMessageFooterRegistry ,
790798 IThemeManager ,
791- IWelcomeMessage
799+ IWelcomeMessage ,
800+ IWriterComponent
792801 ] ,
793802 activate : (
794803 app : JupyterFrontEnd ,
@@ -801,7 +810,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
801810 restorer : ILayoutRestorer | null ,
802811 messageFooterRegistry : IMessageFooterRegistry ,
803812 themeManager : IThemeManager | null ,
804- welcomeMessage : string
813+ welcomeMessage : string ,
814+ writerComponent : WriterComponent
805815 ) : MultiChatPanel => {
806816 const { commands, serviceManager } = app ;
807817
@@ -847,7 +857,8 @@ const chatPanel: JupyterFrontEndPlugin<MultiChatPanel> = {
847857 attachmentOpenerRegistry,
848858 inputToolbarFactory,
849859 messageFooterRegistry,
850- welcomeMessage
860+ welcomeMessage,
861+ writerComponent
851862 } ) ;
852863 chatPanel . id = 'JupyterlabChat:sidepanel' ;
853864
@@ -1002,7 +1013,7 @@ const inputToolbarFactory: JupyterFrontEndPlugin<IInputToolbarRegistryFactory> =
10021013 * Extension providing the message footer registry.
10031014 */
10041015const footerRegistry : JupyterFrontEndPlugin < IMessageFooterRegistry > = {
1005- id : 'jupyterlab-chat/ footerRegistry' ,
1016+ id : pluginIds . footerRegistry ,
10061017 description : 'The footer registry plugin.' ,
10071018 autoStart : true ,
10081019 provides : IMessageFooterRegistry ,
@@ -1011,6 +1022,19 @@ const footerRegistry: JupyterFrontEndPlugin<IMessageFooterRegistry> = {
10111022 }
10121023} ;
10131024
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+
10141038export default [
10151039 activeCellManager ,
10161040 attachmentOpeners ,
@@ -1022,5 +1046,6 @@ export default [
10221046 inputToolbarFactory ,
10231047 selectionWatcher ,
10241048 emojiCommandsPlugin ,
1025- mentionCommandsPlugin
1049+ mentionCommandsPlugin ,
1050+ writerComponent
10261051] ;
0 commit comments