@@ -17,6 +17,7 @@ import {
1717 InputToolbarRegistry ,
1818 MessageFooterRegistry ,
1919 SelectionWatcher ,
20+ WriterComponent ,
2021 chatIcon ,
2122 readIcon
2223} from '@jupyter/chat' ;
@@ -58,6 +59,7 @@ import {
5859 IInputToolbarRegistryFactory ,
5960 ISelectionWatcherToken ,
6061 IWelcomeMessage ,
62+ IWriterComponent ,
6163 LabChatModel ,
6264 LabChatModelFactory ,
6365 LabChatPanel ,
@@ -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/**
@@ -126,7 +130,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
126130 IThemeManager ,
127131 IToolbarWidgetRegistry ,
128132 ITranslator ,
129- IWelcomeMessage
133+ IWelcomeMessage ,
134+ IWriterComponent
130135 ] ,
131136 provides : IChatFactory ,
132137 activate : (
@@ -145,7 +150,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
145150 themeManager : IThemeManager | null ,
146151 toolbarRegistry : IToolbarWidgetRegistry | null ,
147152 translator_ : ITranslator | null ,
148- welcomeMessage : string
153+ welcomeMessage : string ,
154+ writerComponent : WriterComponent
149155 ) : IChatFactory => {
150156 const translator = translator_ ?? nullTranslator ;
151157
@@ -310,7 +316,8 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
310316 attachmentOpenerRegistry,
311317 inputToolbarFactory,
312318 messageFooterRegistry,
313- welcomeMessage
319+ welcomeMessage,
320+ writerComponent
314321 } ) ;
315322
316323 // Add the widget to the tracker when it's created
@@ -558,6 +565,7 @@ const chatCommands: JupyterFrontEndPlugin<void> = {
558565 commands . addCommand ( CommandIDs . openChat , {
559566 label : 'Open a chat' ,
560567 execute : async args => {
568+ console . log ( 'ARG' , args ) ;
561569 const inSidePanel : boolean = ( args . inSidePanel as boolean ) ?? false ;
562570 const startup : boolean = ( args . startup as boolean ) ?? false ;
563571 let filepath : string | null = ( args . filepath as string ) ?? null ;
@@ -708,7 +716,8 @@ const chatPanel: JupyterFrontEndPlugin<ChatPanel> = {
708716 ILayoutRestorer ,
709717 IMessageFooterRegistry ,
710718 IThemeManager ,
711- IWelcomeMessage
719+ IWelcomeMessage ,
720+ IWriterComponent
712721 ] ,
713722 activate : (
714723 app : JupyterFrontEnd ,
@@ -721,7 +730,8 @@ const chatPanel: JupyterFrontEndPlugin<ChatPanel> = {
721730 restorer : ILayoutRestorer | null ,
722731 messageFooterRegistry : IMessageFooterRegistry ,
723732 themeManager : IThemeManager | null ,
724- welcomeMessage : string
733+ welcomeMessage : string ,
734+ writerComponent : WriterComponent
725735 ) : ChatPanel => {
726736 const { commands } = app ;
727737
@@ -740,7 +750,8 @@ const chatPanel: JupyterFrontEndPlugin<ChatPanel> = {
740750 attachmentOpenerRegistry,
741751 inputToolbarFactory,
742752 messageFooterRegistry,
743- welcomeMessage
753+ welcomeMessage,
754+ writerComponent
744755 } ) ;
745756 chatPanel . id = 'JupyterlabChat:sidepanel' ;
746757 chatPanel . title . icon = chatIcon ;
@@ -857,7 +868,7 @@ const inputToolbarFactory: JupyterFrontEndPlugin<IInputToolbarRegistryFactory> =
857868 * Extension providing the message footer registry.
858869 */
859870const footerRegistry : JupyterFrontEndPlugin < IMessageFooterRegistry > = {
860- id : 'jupyterlab-chat/ footerRegistry' ,
871+ id : pluginIds . footerRegistry ,
861872 description : 'The footer registry plugin.' ,
862873 autoStart : true ,
863874 provides : IMessageFooterRegistry ,
@@ -866,6 +877,19 @@ const footerRegistry: JupyterFrontEndPlugin<IMessageFooterRegistry> = {
866877 }
867878} ;
868879
880+ /**
881+ * Plugin providing a writer component.
882+ */
883+ const writerComponent : JupyterFrontEndPlugin < WriterComponent > = {
884+ id : pluginIds . writerComponentRegistry ,
885+ description : 'The writer component registry plugin.' ,
886+ autoStart : true ,
887+ provides : IWriterComponent ,
888+ activate : ( ) : WriterComponent => {
889+ return new WriterComponent ( ) ;
890+ }
891+ } ;
892+
869893export default [
870894 activeCellManager ,
871895 attachmentOpeners ,
@@ -877,5 +901,6 @@ export default [
877901 inputToolbarFactory ,
878902 selectionWatcher ,
879903 emojiCommandsPlugin ,
880- mentionCommandsPlugin
904+ mentionCommandsPlugin ,
905+ writerComponent
881906] ;
0 commit comments