@@ -5,10 +5,27 @@ import { EmbeddedKernel } from './kernel';
55import WelcomePanel from './panel' ;
66import { ServiceContainer } from './services/ServiceContainer' ;
77import { DeviceService } from './services/DeviceService' ;
8+ import { JupyterFrontEnd , JupyterFrontEndPlugin } from '@jupyterlite/application' ;
9+ import { INotebookTracker } from '@jupyterlite/notebook' ;
810
911// Variable for saving the DeviceService instance so we can restore it if kernel is restarted
1012var devService : DeviceService | null = null ;
1113
14+ let notebookTracker : INotebookTracker | null = null ;
15+
16+ // Frontend plugin to capture the notebook tracker
17+ const frontendPlugin : JupyterFrontEndPlugin < void > = {
18+ id : 'jupyterlite-embedded-kernel:frontend' ,
19+ autoStart : true ,
20+ requires : [ INotebookTracker ] ,
21+ activate : ( app : JupyterFrontEnd , tracker : INotebookTracker ) => {
22+ notebookTracker = tracker ;
23+ console . log ( 'Embedded Kernel Frontend Plugin Activated' ) ;
24+
25+ console . log ( 'Notebook Tracker:' , notebookTracker ) ;
26+ }
27+ } ;
28+
1229// Kernel plugin for the embedded kernel
1330const kernelPlugin : JupyterLiteServerPlugin < void > = {
1431 id : 'jupyterlite-embedded-kernel:kernel' ,
@@ -77,3 +94,4 @@ const kernelPlugin: JupyterLiteServerPlugin<void> = {
7794} ;
7895
7996export default [ kernelPlugin ] ;
97+ export { frontendPlugin , notebookTracker } ;
0 commit comments