MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / LiveRemoteKernelConnectionMetadata

Class LiveRemoteKernelConnectionMetadata

src/kernels/types.ts:95–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 * With this we are able connect to an existing kernel (instead of starting a new session).
94 */
95export class LiveRemoteKernelConnectionMetadata {
96 public readonly kind = 'connectToLiveRemoteKernel';
97 public readonly kernelModel: LiveKernelModel;
98 public readonly baseUrl: string;
99 public readonly serverProviderHandle: JupyterServerProviderHandle;
100 public readonly id: string;
101 /**
102 * Python interpreter will be used for intellisense & the like.
103 */
104 public readonly interpreter?: PythonEnvironment;
105
106 private constructor(options: {
107 kernelModel: LiveKernelModel;
108 /**
109 * Python interpreter will be used for intellisense & the like.
110 */
111 interpreter?: PythonEnvironment;
112 baseUrl: string;
113 id: string;
114 serverProviderHandle: JupyterServerProviderHandle;
115 }) {
116 this.kernelModel = options.kernelModel;
117 this.interpreter = options.interpreter;
118 this.baseUrl = options.baseUrl;
119 this.id = options.id;
120 this.serverProviderHandle = options.serverProviderHandle;
121 sendKernelTelemetry(this);
122 }
123 public static create(options: {
124 kernelModel: LiveKernelModel;
125 /**
126 * Python interpreter will be used for intellisense & the like.
127 */
128 interpreter?: PythonEnvironment;
129 baseUrl: string;
130 id: string;
131 serverProviderHandle: JupyterServerProviderHandle;
132 }) {
133 return new LiveRemoteKernelConnectionMetadata(options);
134 }
135 public updateModel(model: LiveKernelModel) {
136 Object.assign(this.kernelModel, model);
137 }
138 public getHashId() {
139 return getConnectionIdHash(this);
140 }
141 public toJSON() {
142 return {
143 id: this.id,
144 kind: this.kind,
145 baseUrl: this.baseUrl,
146 interpreter: serializePythonEnvironment(this.interpreter),
147 kernelModel: this.kernelModel,
148 serverProviderHandle: this.serverProviderHandle
149 };
150 }
151 public static fromJSON(json: Record<string, unknown> | LiveRemoteKernelConnectionMetadata) {
152 return BaseKernelConnectionMetadata.fromJSON(json) as LiveRemoteKernelConnectionMetadata;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected