@difizen/libro-kernel 0.0.2-alpha.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/LICENSE +21 -0
- package/README.md +1 -0
- package/es/basemanager.d.ts +94 -0
- package/es/basemanager.d.ts.map +1 -0
- package/es/basemanager.js +110 -0
- package/es/contents/contents-drive.d.ts +189 -0
- package/es/contents/contents-drive.d.ts.map +1 -0
- package/es/contents/contents-drive.js +792 -0
- package/es/contents/contents-manager.d.ts +229 -0
- package/es/contents/contents-manager.d.ts.map +1 -0
- package/es/contents/contents-manager.js +551 -0
- package/es/contents/contents-module.d.ts +3 -0
- package/es/contents/contents-module.d.ts.map +1 -0
- package/es/contents/contents-module.js +4 -0
- package/es/contents/contents-protocol.d.ts +487 -0
- package/es/contents/contents-protocol.d.ts.map +1 -0
- package/es/contents/contents-protocol.js +1 -0
- package/es/contents/index.d.ts +6 -0
- package/es/contents/index.d.ts.map +1 -0
- package/es/contents/index.js +5 -0
- package/es/contents/validate.d.ts +10 -0
- package/es/contents/validate.d.ts.map +1 -0
- package/es/contents/validate.js +22 -0
- package/es/index.d.ts +10 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +9 -0
- package/es/index.less +0 -0
- package/es/kernel/comm.d.ts +92 -0
- package/es/kernel/comm.d.ts.map +1 -0
- package/es/kernel/comm.js +216 -0
- package/es/kernel/future.d.ts +178 -0
- package/es/kernel/future.d.ts.map +1 -0
- package/es/kernel/future.js +587 -0
- package/es/kernel/index.d.ts +8 -0
- package/es/kernel/index.d.ts.map +1 -0
- package/es/kernel/index.js +8 -0
- package/es/kernel/kernel-connection.d.ts +550 -0
- package/es/kernel/kernel-connection.d.ts.map +1 -0
- package/es/kernel/kernel-connection.js +1957 -0
- package/es/kernel/kernel-module.d.ts +3 -0
- package/es/kernel/kernel-module.d.ts.map +1 -0
- package/es/kernel/kernel-module.js +32 -0
- package/es/kernel/libro-kernel-manager.d.ts +69 -0
- package/es/kernel/libro-kernel-manager.d.ts.map +1 -0
- package/es/kernel/libro-kernel-manager.js +349 -0
- package/es/kernel/libro-kernel-protocol.d.ts +675 -0
- package/es/kernel/libro-kernel-protocol.d.ts.map +1 -0
- package/es/kernel/libro-kernel-protocol.js +60 -0
- package/es/kernel/libro-kernel-utils.d.ts +95 -0
- package/es/kernel/libro-kernel-utils.d.ts.map +1 -0
- package/es/kernel/libro-kernel-utils.js +130 -0
- package/es/kernel/libro-kernel.d.ts +14 -0
- package/es/kernel/libro-kernel.d.ts.map +1 -0
- package/es/kernel/libro-kernel.js +54 -0
- package/es/kernel/messages.d.ts +845 -0
- package/es/kernel/messages.d.ts.map +1 -0
- package/es/kernel/messages.js +457 -0
- package/es/kernel/restapi.d.ts +78 -0
- package/es/kernel/restapi.d.ts.map +1 -0
- package/es/kernel/restapi.js +367 -0
- package/es/kernel/serialize.d.ts +10 -0
- package/es/kernel/serialize.d.ts.map +1 -0
- package/es/kernel/serialize.js +214 -0
- package/es/kernel/validate.d.ts +15 -0
- package/es/kernel/validate.d.ts.map +1 -0
- package/es/kernel/validate.js +125 -0
- package/es/kernelspec/index.d.ts +5 -0
- package/es/kernelspec/index.d.ts.map +1 -0
- package/es/kernelspec/index.js +4 -0
- package/es/kernelspec/kernelspec-module.d.ts +3 -0
- package/es/kernelspec/kernelspec-module.d.ts.map +1 -0
- package/es/kernelspec/kernelspec-module.js +4 -0
- package/es/kernelspec/kernelspec.d.ts +33 -0
- package/es/kernelspec/kernelspec.d.ts.map +1 -0
- package/es/kernelspec/kernelspec.js +1 -0
- package/es/kernelspec/manager.d.ts +81 -0
- package/es/kernelspec/manager.d.ts.map +1 -0
- package/es/kernelspec/manager.js +248 -0
- package/es/kernelspec/restapi.d.ts +71 -0
- package/es/kernelspec/restapi.d.ts.map +1 -0
- package/es/kernelspec/restapi.js +107 -0
- package/es/kernelspec/validate.d.ts +10 -0
- package/es/kernelspec/validate.d.ts.map +1 -0
- package/es/kernelspec/validate.js +69 -0
- package/es/libro-kernel-connection-manager.d.ts +19 -0
- package/es/libro-kernel-connection-manager.d.ts.map +1 -0
- package/es/libro-kernel-connection-manager.js +142 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +9 -0
- package/es/page-config.d.ts +36 -0
- package/es/page-config.d.ts.map +1 -0
- package/es/page-config.js +129 -0
- package/es/protocol.d.ts +13 -0
- package/es/protocol.d.ts.map +1 -0
- package/es/protocol.js +8 -0
- package/es/server/connection-error.d.ts +36 -0
- package/es/server/connection-error.d.ts.map +1 -0
- package/es/server/connection-error.js +109 -0
- package/es/server/index.d.ts +6 -0
- package/es/server/index.d.ts.map +1 -0
- package/es/server/index.js +5 -0
- package/es/server/server-connection-protocol.d.ts +49 -0
- package/es/server/server-connection-protocol.d.ts.map +1 -0
- package/es/server/server-connection-protocol.js +0 -0
- package/es/server/server-connection.d.ts +25 -0
- package/es/server/server-connection.d.ts.map +1 -0
- package/es/server/server-connection.js +159 -0
- package/es/server/server-manager.d.ts +22 -0
- package/es/server/server-manager.d.ts.map +1 -0
- package/es/server/server-manager.js +163 -0
- package/es/server/server-module.d.ts +3 -0
- package/es/server/server-module.d.ts.map +1 -0
- package/es/server/server-module.js +4 -0
- package/es/session/index.d.ts +5 -0
- package/es/session/index.d.ts.map +1 -0
- package/es/session/index.js +4 -0
- package/es/session/libro-session-manager.d.ts +71 -0
- package/es/session/libro-session-manager.d.ts.map +1 -0
- package/es/session/libro-session-manager.js +539 -0
- package/es/session/libro-session-protocol.d.ts +50 -0
- package/es/session/libro-session-protocol.d.ts.map +1 -0
- package/es/session/libro-session-protocol.js +21 -0
- package/es/session/libro-session.d.ts +12 -0
- package/es/session/libro-session.d.ts.map +1 -0
- package/es/session/libro-session.js +19 -0
- package/es/session/restapi.d.ts +28 -0
- package/es/session/restapi.d.ts.map +1 -0
- package/es/session/restapi.js +214 -0
- package/es/session/session-module.d.ts +3 -0
- package/es/session/session-module.d.ts.map +1 -0
- package/es/session/session-module.js +18 -0
- package/es/session/validate.d.ts +14 -0
- package/es/session/validate.d.ts.map +1 -0
- package/es/session/validate.js +37 -0
- package/es/utils.d.ts +4 -0
- package/es/utils.d.ts.map +1 -0
- package/es/utils.js +29 -0
- package/es/validate-property.d.ts +2 -0
- package/es/validate-property.d.ts.map +1 -0
- package/es/validate-property.js +35 -0
- package/package.json +62 -0
- package/src/basemanager.ts +133 -0
- package/src/contents/contents-drive.ts +495 -0
- package/src/contents/contents-manager.ts +465 -0
- package/src/contents/contents-module.ts +6 -0
- package/src/contents/contents-protocol.ts +604 -0
- package/src/contents/index.ts +5 -0
- package/src/contents/validate.ts +29 -0
- package/src/index.tsx +9 -0
- package/src/kernel/comm.ts +220 -0
- package/src/kernel/future.ts +474 -0
- package/src/kernel/index.ts +7 -0
- package/src/kernel/kernel-connection.ts +1770 -0
- package/src/kernel/kernel-module.ts +50 -0
- package/src/kernel/libro-kernel-manager.ts +199 -0
- package/src/kernel/libro-kernel-protocol.ts +858 -0
- package/src/kernel/libro-kernel-utils.ts +152 -0
- package/src/kernel/libro-kernel.ts +39 -0
- package/src/kernel/messages.ts +1104 -0
- package/src/kernel/restapi.ts +183 -0
- package/src/kernel/serialize.ts +262 -0
- package/src/kernel/validate.ts +101 -0
- package/src/kernelspec/index.ts +5 -0
- package/src/kernelspec/kernelspec-module.ts +9 -0
- package/src/kernelspec/kernelspec.ts +37 -0
- package/src/kernelspec/manager.ts +173 -0
- package/src/kernelspec/restapi.ts +104 -0
- package/src/kernelspec/validate.ts +80 -0
- package/src/libro-kernel-connection-manager.ts +73 -0
- package/src/module.ts +19 -0
- package/src/page-config.ts +106 -0
- package/src/protocol.ts +24 -0
- package/src/server/connection-error.ts +60 -0
- package/src/server/index.ts +5 -0
- package/src/server/server-connection-protocol.ts +57 -0
- package/src/server/server-connection.ts +144 -0
- package/src/server/server-manager.ts +76 -0
- package/src/server/server-module.ts +9 -0
- package/src/session/index.ts +4 -0
- package/src/session/libro-session-manager.ts +377 -0
- package/src/session/libro-session-protocol.ts +61 -0
- package/src/session/libro-session.ts +33 -0
- package/src/session/restapi.ts +126 -0
- package/src/session/session-module.ts +26 -0
- package/src/session/validate.ts +39 -0
- package/src/utils.ts +28 -0
- package/src/validate-property.ts +38 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
+
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
12
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
13
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
+
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A disposable object with an observable `disposed` signal.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export var KernelMetaOption = Symbol('KernelMetaOption');
|
|
24
|
+
export var KernelId = Symbol('LibroKernelId');
|
|
25
|
+
export var LibroKernelFactory = Symbol('LibroKernelFactory');
|
|
26
|
+
export var LibroKernelConnectionFactory = Symbol('LibroKernelConnectionFactory');
|
|
27
|
+
export var KernelError = /*#__PURE__*/function (_Error) {
|
|
28
|
+
_inherits(KernelError, _Error);
|
|
29
|
+
var _super = _createSuper(KernelError);
|
|
30
|
+
/**
|
|
31
|
+
* Exception name
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Exception value
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Traceback
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Construct the kernel error.
|
|
44
|
+
*/
|
|
45
|
+
function KernelError(content) {
|
|
46
|
+
var _this;
|
|
47
|
+
_classCallCheck(this, KernelError);
|
|
48
|
+
var errorContent = content;
|
|
49
|
+
var errorName = errorContent.ename;
|
|
50
|
+
var errorValue = errorContent.evalue;
|
|
51
|
+
_this = _super.call(this, "KernelReplyNotOK: ".concat(errorName, " ").concat(errorValue));
|
|
52
|
+
_this.errorName = errorName;
|
|
53
|
+
_this.errorValue = errorValue;
|
|
54
|
+
_this.traceback = errorContent.traceback;
|
|
55
|
+
Object.setPrototypeOf(_assertThisInitialized(_this), KernelError.prototype);
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
return _createClass(KernelError);
|
|
59
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
60
|
+
export var KernelConnectionOptions = Symbol('IOptions');
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { IClearOutputMsg, ICommCloseMsg, ICommMsgMsg, ICommOpenMsg, IDebugEventMsg, IDebugReplyMsg, IDebugRequestMsg, IDisplayDataMsg, IErrorMsg, IExecuteInputMsg, IExecuteReplyMsg, IExecuteResultMsg, IInfoRequestMsg, IInputReplyMsg, IInputRequestMsg, IMessage, IStatusMsg, IStreamMsg, IUpdateDisplayDataMsg } from './messages.js';
|
|
2
|
+
/**
|
|
3
|
+
* Test whether a kernel message is a `'stream'` message.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isStreamMsg(msg: IMessage): msg is IStreamMsg;
|
|
6
|
+
/**
|
|
7
|
+
* Test whether a kernel message is an `'display_data'` message.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isDisplayDataMsg(msg: IMessage): msg is IDisplayDataMsg;
|
|
10
|
+
/**
|
|
11
|
+
* Test whether a kernel message is an `'update_display_data'` message.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isUpdateDisplayDataMsg(msg: IMessage): msg is IUpdateDisplayDataMsg;
|
|
14
|
+
/**
|
|
15
|
+
* Test whether a kernel message is an `'execute_input'` message.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isExecuteInputMsg(msg: IMessage): msg is IExecuteInputMsg;
|
|
18
|
+
/**
|
|
19
|
+
* Test whether a kernel message is an `'execute_result'` message.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isExecuteResultMsg(msg: IMessage): msg is IExecuteResultMsg;
|
|
22
|
+
/**
|
|
23
|
+
* Test whether a kernel message is an `'error'` message.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isErrorMsg(msg: IMessage): msg is IErrorMsg;
|
|
26
|
+
/**
|
|
27
|
+
* Test whether a kernel message is a `'status'` message.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isStatusMsg(msg: IMessage): msg is IStatusMsg;
|
|
30
|
+
/**
|
|
31
|
+
* Test whether a kernel message is a `'clear_output'` message.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isClearOutputMsg(msg: IMessage): msg is IClearOutputMsg;
|
|
34
|
+
/**
|
|
35
|
+
* Test whether a kernel message is an experimental `'debug_event'` message.
|
|
36
|
+
*
|
|
37
|
+
* @hidden
|
|
38
|
+
*
|
|
39
|
+
* #### Notes
|
|
40
|
+
* Debug messages are experimental messages that are not in the official
|
|
41
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
42
|
+
* part of the public API, and may change without notice.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isDebugEventMsg(msg: IMessage): msg is IDebugEventMsg;
|
|
45
|
+
/**
|
|
46
|
+
* Test whether a kernel message is a `'comm_open'` message.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isCommOpenMsg(msg: IMessage): msg is ICommOpenMsg;
|
|
49
|
+
/**
|
|
50
|
+
* Test whether a kernel message is a `'comm_close'` message.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isCommCloseMsg(msg: IMessage): msg is ICommCloseMsg<'iopub' | 'shell'>;
|
|
53
|
+
/**
|
|
54
|
+
* Test whether a kernel message is a `'comm_msg'` message.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isCommMsgMsg(msg: IMessage): msg is ICommMsgMsg;
|
|
57
|
+
/**
|
|
58
|
+
* Test whether a kernel message is a `'kernel_info_request'` message.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isInfoRequestMsg(msg: IMessage): msg is IInfoRequestMsg;
|
|
61
|
+
/**
|
|
62
|
+
* Test whether a kernel message is an `'execute_reply'` message.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isExecuteReplyMsg(msg: IMessage): msg is IExecuteReplyMsg;
|
|
65
|
+
/**
|
|
66
|
+
* Test whether a kernel message is an experimental `'debug_request'` message.
|
|
67
|
+
*
|
|
68
|
+
* @hidden
|
|
69
|
+
*
|
|
70
|
+
* #### Notes
|
|
71
|
+
* Debug messages are experimental messages that are not in the official
|
|
72
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
73
|
+
* part of the public API, and may change without notice.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isDebugRequestMsg(msg: IMessage): msg is IDebugRequestMsg;
|
|
76
|
+
/**
|
|
77
|
+
* Test whether a kernel message is an experimental `'debug_reply'` message.
|
|
78
|
+
*
|
|
79
|
+
* @hidden
|
|
80
|
+
*
|
|
81
|
+
* #### Notes
|
|
82
|
+
* Debug messages are experimental messages that are not in the official
|
|
83
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
84
|
+
* part of the public API, and may change without notice.
|
|
85
|
+
*/
|
|
86
|
+
export declare function isDebugReplyMsg(msg: IMessage): msg is IDebugReplyMsg;
|
|
87
|
+
/**
|
|
88
|
+
* Test whether a kernel message is an `'input_request'` message.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isInputRequestMsg(msg: IMessage): msg is IInputRequestMsg;
|
|
91
|
+
/**
|
|
92
|
+
* Test whether a kernel message is an `'input_reply'` message.
|
|
93
|
+
*/
|
|
94
|
+
export declare function isInputReplyMsg(msg: IMessage): msg is IInputReplyMsg;
|
|
95
|
+
//# sourceMappingURL=libro-kernel-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-kernel-utils.d.ts","sourceRoot":"","sources":["../../src/kernel/libro-kernel-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,UAAU,CAE5D;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,eAAe,CAEtE;AACD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,qBAAqB,CAElF;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,gBAAgB,CAExE;AACD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,iBAAiB,CAE1E;AACD;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,SAAS,CAE1D;AACD;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,UAAU,CAE5D;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,eAAe,CAEtE;AACD;;;;;;;;;GASG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,cAAc,CAEpE;AACD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,YAAY,CAEhE;AACD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC,CAErF;AACD;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,WAAW,CAE9D;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,eAAe,CAEtE;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,gBAAgB,CAExE;AACD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,gBAAgB,CAExE;AACD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,cAAc,CAEpE;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,gBAAgB,CAExE;AACD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,cAAc,CAEpE"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test whether a kernel message is a `'stream'` message.
|
|
3
|
+
*/
|
|
4
|
+
export function isStreamMsg(msg) {
|
|
5
|
+
return msg.header.msg_type === 'stream';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Test whether a kernel message is an `'display_data'` message.
|
|
9
|
+
*/
|
|
10
|
+
export function isDisplayDataMsg(msg) {
|
|
11
|
+
return msg.header.msg_type === 'display_data';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Test whether a kernel message is an `'update_display_data'` message.
|
|
15
|
+
*/
|
|
16
|
+
export function isUpdateDisplayDataMsg(msg) {
|
|
17
|
+
return msg.header.msg_type === 'update_display_data';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Test whether a kernel message is an `'execute_input'` message.
|
|
21
|
+
*/
|
|
22
|
+
export function isExecuteInputMsg(msg) {
|
|
23
|
+
return msg.header.msg_type === 'execute_input';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Test whether a kernel message is an `'execute_result'` message.
|
|
27
|
+
*/
|
|
28
|
+
export function isExecuteResultMsg(msg) {
|
|
29
|
+
return msg.header.msg_type === 'execute_result';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Test whether a kernel message is an `'error'` message.
|
|
33
|
+
*/
|
|
34
|
+
export function isErrorMsg(msg) {
|
|
35
|
+
return msg.header.msg_type === 'error';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Test whether a kernel message is a `'status'` message.
|
|
39
|
+
*/
|
|
40
|
+
export function isStatusMsg(msg) {
|
|
41
|
+
return msg.header.msg_type === 'status';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Test whether a kernel message is a `'clear_output'` message.
|
|
45
|
+
*/
|
|
46
|
+
export function isClearOutputMsg(msg) {
|
|
47
|
+
return msg.header.msg_type === 'clear_output';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Test whether a kernel message is an experimental `'debug_event'` message.
|
|
51
|
+
*
|
|
52
|
+
* @hidden
|
|
53
|
+
*
|
|
54
|
+
* #### Notes
|
|
55
|
+
* Debug messages are experimental messages that are not in the official
|
|
56
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
57
|
+
* part of the public API, and may change without notice.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
export function isDebugEventMsg(msg) {
|
|
61
|
+
return msg.header.msg_type === 'debug_event';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Test whether a kernel message is a `'comm_open'` message.
|
|
65
|
+
*/
|
|
66
|
+
export function isCommOpenMsg(msg) {
|
|
67
|
+
return msg.header.msg_type === 'comm_open';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Test whether a kernel message is a `'comm_close'` message.
|
|
71
|
+
*/
|
|
72
|
+
export function isCommCloseMsg(msg) {
|
|
73
|
+
return msg.header.msg_type === 'comm_close';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Test whether a kernel message is a `'comm_msg'` message.
|
|
77
|
+
*/
|
|
78
|
+
export function isCommMsgMsg(msg) {
|
|
79
|
+
return msg.header.msg_type === 'comm_msg';
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Test whether a kernel message is a `'kernel_info_request'` message.
|
|
83
|
+
*/
|
|
84
|
+
export function isInfoRequestMsg(msg) {
|
|
85
|
+
return msg.header.msg_type === 'kernel_info_request';
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Test whether a kernel message is an `'execute_reply'` message.
|
|
89
|
+
*/
|
|
90
|
+
export function isExecuteReplyMsg(msg) {
|
|
91
|
+
return msg.header.msg_type === 'execute_reply';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Test whether a kernel message is an experimental `'debug_request'` message.
|
|
95
|
+
*
|
|
96
|
+
* @hidden
|
|
97
|
+
*
|
|
98
|
+
* #### Notes
|
|
99
|
+
* Debug messages are experimental messages that are not in the official
|
|
100
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
101
|
+
* part of the public API, and may change without notice.
|
|
102
|
+
*/
|
|
103
|
+
export function isDebugRequestMsg(msg) {
|
|
104
|
+
return msg.header.msg_type === 'debug_request';
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Test whether a kernel message is an experimental `'debug_reply'` message.
|
|
108
|
+
*
|
|
109
|
+
* @hidden
|
|
110
|
+
*
|
|
111
|
+
* #### Notes
|
|
112
|
+
* Debug messages are experimental messages that are not in the official
|
|
113
|
+
* kernel message specification. As such, this is *NOT* considered
|
|
114
|
+
* part of the public API, and may change without notice.
|
|
115
|
+
*/
|
|
116
|
+
export function isDebugReplyMsg(msg) {
|
|
117
|
+
return msg.header.msg_type === 'debug_reply';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Test whether a kernel message is an `'input_request'` message.
|
|
121
|
+
*/
|
|
122
|
+
export function isInputRequestMsg(msg) {
|
|
123
|
+
return msg.header.msg_type === 'input_request';
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Test whether a kernel message is an `'input_reply'` message.
|
|
127
|
+
*/
|
|
128
|
+
export function isInputReplyMsg(msg) {
|
|
129
|
+
return msg.header.msg_type === 'input_reply';
|
|
130
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KernelConnection } from '../kernel/kernel-connection.js';
|
|
2
|
+
import type { SessionId } from '../session/libro-session-protocol.js';
|
|
3
|
+
import type { KernelId, KernelStatus, KernelMeta } from './libro-kernel-protocol.js';
|
|
4
|
+
export declare class LibroKernel {
|
|
5
|
+
id: KernelId;
|
|
6
|
+
name: string;
|
|
7
|
+
last_activity: string;
|
|
8
|
+
execution_state: KernelStatus;
|
|
9
|
+
connections: number;
|
|
10
|
+
sessionIds: Set<SessionId>;
|
|
11
|
+
kernelConnection?: KernelConnection;
|
|
12
|
+
constructor(meta: KernelMeta);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=libro-kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-kernel.d.ts","sourceRoot":"","sources":["../../src/kernel/libro-kernel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAErF,qBACa,WAAW;IACtB,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAGb,aAAa,EAAE,MAAM,CAAC;IAGtB,eAAe,EAAE,YAAY,CAAC;IAG9B,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAG3B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;gBAEE,IAAI,EAAE,UAAU;CASvD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
3
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
10
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
11
|
+
import { prop } from '@difizen/mana-app';
|
|
12
|
+
import { transient, inject } from '@difizen/mana-app';
|
|
13
|
+
import { KernelMetaOption } from "./libro-kernel-protocol.js";
|
|
14
|
+
export var LibroKernel = (_dec = transient(), _dec2 = prop(), _dec3 = prop(), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec(_class = (_class2 = /*#__PURE__*/_createClass(function LibroKernel(meta) {
|
|
15
|
+
_classCallCheck(this, LibroKernel);
|
|
16
|
+
_initializerDefineProperty(this, "last_activity", _descriptor, this);
|
|
17
|
+
_initializerDefineProperty(this, "execution_state", _descriptor2, this);
|
|
18
|
+
_initializerDefineProperty(this, "connections", _descriptor3, this);
|
|
19
|
+
_initializerDefineProperty(this, "sessionIds", _descriptor4, this);
|
|
20
|
+
_initializerDefineProperty(this, "kernelConnection", _descriptor5, this);
|
|
21
|
+
this.id = meta.id;
|
|
22
|
+
this.name = meta.name;
|
|
23
|
+
this.last_activity = meta.last_activity;
|
|
24
|
+
this.execution_state = meta.execution_state;
|
|
25
|
+
this.connections = meta.connections;
|
|
26
|
+
this.sessionIds = new Set();
|
|
27
|
+
this.kernelConnection = undefined;
|
|
28
|
+
}), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "last_activity", [_dec2], {
|
|
29
|
+
configurable: true,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
writable: true,
|
|
32
|
+
initializer: null
|
|
33
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "execution_state", [_dec3], {
|
|
34
|
+
configurable: true,
|
|
35
|
+
enumerable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
initializer: null
|
|
38
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "connections", [_dec4], {
|
|
39
|
+
configurable: true,
|
|
40
|
+
enumerable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
initializer: null
|
|
43
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "sessionIds", [_dec5], {
|
|
44
|
+
configurable: true,
|
|
45
|
+
enumerable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
initializer: null
|
|
48
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "kernelConnection", [_dec6], {
|
|
49
|
+
configurable: true,
|
|
50
|
+
enumerable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
initializer: null
|
|
53
|
+
})), _class2)) || _class);
|
|
54
|
+
LibroKernel = inject(KernelMetaOption)(LibroKernel, undefined, 0) || LibroKernel;
|