@jupyterlite/kernel 0.7.0-beta.1 → 0.7.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +19 -5
- package/lib/index.js +21 -5
- package/lib/index.js.map +1 -1
- package/package.json +4 -12
- package/src/index.ts +32 -5
- package/lib/base.d.ts +0 -245
- package/lib/base.js +0 -457
- package/lib/base.js.map +0 -1
- package/lib/client.d.ts +0 -114
- package/lib/client.js +0 -375
- package/lib/client.js.map +0 -1
- package/lib/kernelspecclient.d.ts +0 -39
- package/lib/kernelspecclient.js +0 -37
- package/lib/kernelspecclient.js.map +0 -1
- package/lib/kernelspecs.d.ts +0 -59
- package/lib/kernelspecs.js +0 -62
- package/lib/kernelspecs.js.map +0 -1
- package/lib/tokens.d.ts +0 -163
- package/lib/tokens.js +0 -20
- package/lib/tokens.js.map +0 -1
- package/src/base.ts +0 -637
- package/src/client.ts +0 -483
- package/src/kernelspecclient.ts +0 -64
- package/src/kernelspecs.ts +0 -103
- package/src/tokens.ts +0 -220
package/src/tokens.ts
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Jupyter Development Team.
|
|
2
|
-
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
|
|
4
|
-
import type { Remote } from 'comlink';
|
|
5
|
-
|
|
6
|
-
import { IObservableMap } from '@jupyterlab/observables';
|
|
7
|
-
|
|
8
|
-
import { Kernel, KernelMessage, KernelSpec } from '@jupyterlab/services';
|
|
9
|
-
|
|
10
|
-
import { Token } from '@lumino/coreutils';
|
|
11
|
-
|
|
12
|
-
import { IObservableDisposable } from '@lumino/disposable';
|
|
13
|
-
|
|
14
|
-
import { ISignal } from '@lumino/signaling';
|
|
15
|
-
|
|
16
|
-
import { KernelSpecs } from './kernelspecs';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The kernel name of last resort.
|
|
20
|
-
*/
|
|
21
|
-
export const FALLBACK_KERNEL = 'javascript';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The token for the kernel client.
|
|
25
|
-
*/
|
|
26
|
-
export const IKernelClient = new Token<IKernelClient>(
|
|
27
|
-
'@jupyterlite/kernel:IKernelClient',
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* An interface for the Kernels service.
|
|
32
|
-
*/
|
|
33
|
-
export interface IKernelClient extends Kernel.IKernelAPIClient {
|
|
34
|
-
/**
|
|
35
|
-
* Signal emitted when the kernels map changes
|
|
36
|
-
*/
|
|
37
|
-
readonly changed: ISignal<IKernelClient, IObservableMap.IChangedArgs<IKernel>>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Handle stdin request received from Service Worker.
|
|
41
|
-
*/
|
|
42
|
-
handleStdin(
|
|
43
|
-
inputRequest: KernelMessage.IInputRequestMsg,
|
|
44
|
-
): Promise<KernelMessage.IInputReplyMsg>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Shut down all kernels.
|
|
48
|
-
*/
|
|
49
|
-
shutdownAll: () => Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The token for the kernel spec client.
|
|
54
|
-
*/
|
|
55
|
-
export const IKernelSpecClient = new Token<IKernelSpecClient>(
|
|
56
|
-
'@jupyterlite/kernel:IKernelSpecClient',
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* An interface for the kernel spec client.
|
|
61
|
-
*/
|
|
62
|
-
export interface IKernelSpecClient extends KernelSpec.IKernelSpecAPIClient {}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* An interface for a kernel running in the browser.
|
|
66
|
-
*/
|
|
67
|
-
export interface IKernel extends IObservableDisposable {
|
|
68
|
-
/**
|
|
69
|
-
* The id of the server-side kernel.
|
|
70
|
-
*/
|
|
71
|
-
readonly id: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The name of the server-side kernel.
|
|
75
|
-
*/
|
|
76
|
-
readonly name: string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The location in the virtual filesystem from which the kernel was started.
|
|
80
|
-
*/
|
|
81
|
-
readonly location: string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* A promise that is fulfilled when the kernel is ready.
|
|
85
|
-
*/
|
|
86
|
-
readonly ready: Promise<void>;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Handle an incoming message from the client.
|
|
90
|
-
*
|
|
91
|
-
* @param msg The message to handle
|
|
92
|
-
*/
|
|
93
|
-
handleMessage(msg: KernelMessage.IMessage): Promise<void>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* A namespace for IKernel statics.
|
|
98
|
-
*/
|
|
99
|
-
export namespace IKernel {
|
|
100
|
-
/**
|
|
101
|
-
* The type for the send message function.
|
|
102
|
-
*/
|
|
103
|
-
export type SendMessage = (msg: KernelMessage.IMessage) => void;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The instantiation options for an IKernel.
|
|
107
|
-
*/
|
|
108
|
-
export interface IOptions {
|
|
109
|
-
/**
|
|
110
|
-
* The kernel id.
|
|
111
|
-
*/
|
|
112
|
-
id: string;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The name of the kernel.
|
|
116
|
-
*/
|
|
117
|
-
name: string;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The location in the virtual filesystem from which the kernel was started.
|
|
121
|
-
*/
|
|
122
|
-
location: string;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The method to send messages back to the server.
|
|
126
|
-
*/
|
|
127
|
-
sendMessage: SendMessage;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* The token for the kernel spec service.
|
|
133
|
-
*/
|
|
134
|
-
export const IKernelSpecs = new Token<IKernelSpecs>('@jupyterlite/kernel:IKernelSpecs');
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The interface for the kernel specs service.
|
|
138
|
-
*/
|
|
139
|
-
export interface IKernelSpecs {
|
|
140
|
-
/**
|
|
141
|
-
* Get the kernel specs.
|
|
142
|
-
*/
|
|
143
|
-
readonly specs: KernelSpec.ISpecModels | null;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Get the default kernel name.
|
|
147
|
-
*/
|
|
148
|
-
readonly defaultKernelName: string;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Get the kernel factories for the current kernels.
|
|
152
|
-
*/
|
|
153
|
-
readonly factories: KernelSpecs.KernelFactories;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Signal emitted when the specs change.
|
|
157
|
-
*/
|
|
158
|
-
readonly changed: ISignal<IKernelSpecs, KernelSpec.ISpecModels | null>;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Register a new kernel spec
|
|
162
|
-
*
|
|
163
|
-
* @param options The kernel spec options.
|
|
164
|
-
*/
|
|
165
|
-
register: (options: KernelSpecs.IKernelOptions) => void;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* An interface for a comlink-based worker kernel
|
|
170
|
-
*/
|
|
171
|
-
export interface IWorkerKernel {
|
|
172
|
-
/**
|
|
173
|
-
* Handle any lazy setup activities.
|
|
174
|
-
*/
|
|
175
|
-
initialize(options: IWorkerKernel.IOptions): Promise<void>;
|
|
176
|
-
execute(
|
|
177
|
-
content: KernelMessage.IExecuteRequestMsg['content'],
|
|
178
|
-
parent: any,
|
|
179
|
-
): Promise<KernelMessage.IExecuteReplyMsg['content']>;
|
|
180
|
-
complete(
|
|
181
|
-
content: KernelMessage.ICompleteRequestMsg['content'],
|
|
182
|
-
parent: any,
|
|
183
|
-
): Promise<KernelMessage.ICompleteReplyMsg['content']>;
|
|
184
|
-
inspect(
|
|
185
|
-
content: KernelMessage.IInspectRequestMsg['content'],
|
|
186
|
-
parent: any,
|
|
187
|
-
): Promise<KernelMessage.IInspectReplyMsg['content']>;
|
|
188
|
-
isComplete(
|
|
189
|
-
content: KernelMessage.IIsCompleteRequestMsg['content'],
|
|
190
|
-
parent: any,
|
|
191
|
-
): Promise<KernelMessage.IIsCompleteReplyMsg['content']>;
|
|
192
|
-
commInfo(
|
|
193
|
-
content: KernelMessage.ICommInfoRequestMsg['content'],
|
|
194
|
-
parent: any,
|
|
195
|
-
): Promise<KernelMessage.ICommInfoReplyMsg['content']>;
|
|
196
|
-
commOpen(content: KernelMessage.ICommOpenMsg, parent: any): Promise<void>;
|
|
197
|
-
commMsg(content: KernelMessage.ICommMsgMsg, parent: any): Promise<void>;
|
|
198
|
-
commClose(content: KernelMessage.ICommCloseMsg, parent: any): Promise<void>;
|
|
199
|
-
inputReply(
|
|
200
|
-
content: KernelMessage.IInputReplyMsg['content'],
|
|
201
|
-
parent: any,
|
|
202
|
-
): Promise<void>;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* A namespace for worker kernels.
|
|
207
|
-
**/
|
|
208
|
-
export namespace IWorkerKernel {
|
|
209
|
-
/**
|
|
210
|
-
* Common values likely to be required by all kernels.
|
|
211
|
-
*/
|
|
212
|
-
export interface IOptions {
|
|
213
|
-
/**
|
|
214
|
-
* The base URL of the kernel server.
|
|
215
|
-
*/
|
|
216
|
-
baseUrl: string;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export interface IRemoteKernel extends Remote<IWorkerKernel> {}
|