@basthon/kernel-base 0.78.1 → 0.78.3

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/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.78.1";
1
+ export declare const VERSION = "0.78.3";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.78.1";
1
+ export const VERSION = "0.78.3";
@@ -21,6 +21,7 @@ declare class KernelWorkerBase {
21
21
  protected readonly _legacy: boolean;
22
22
  private readonly _basthonRoot;
23
23
  private _ephemeralAPI;
24
+ private _runningData;
24
25
  private _ready;
25
26
  protected __eval_data__: any;
26
27
  protected postMessage?: InstanceType<typeof MessagePort>["postMessage"];
@@ -71,6 +72,14 @@ declare class KernelWorkerBase {
71
72
  protected addEvalPromise(promise: Promise<void>): void;
72
73
  setFallbackKeyAndPass(key: string, pass: string): Promise<void>;
73
74
  setEphemeralAPI(url: string): Promise<void>;
75
+ /**
76
+ * Set running data (introduced to manage user_seed in capytale).
77
+ */
78
+ setRunningData(data: any): Promise<void>;
79
+ /**
80
+ * Get running data.
81
+ */
82
+ getRunningData(): any;
74
83
  protected _init(): Promise<void>;
75
84
  /**
76
85
  * Initialize the kernel. It is called by initWorker in KernelBase.
@@ -6,6 +6,7 @@ import { DOMNodeBus } from "./worker-utils";
6
6
  class KernelWorkerBase {
7
7
  constructor(options) {
8
8
  this._ephemeralAPI = "https://api.basthon.fr/ephemeral";
9
+ this._runningData = {};
9
10
  this._ready = new PromiseDelegate();
10
11
  this._evalPromises = []; // used to wait all promises emitted during computation
11
12
  this._decrypt = (s) => s;
@@ -115,6 +116,18 @@ class KernelWorkerBase {
115
116
  async setEphemeralAPI(url) {
116
117
  this._ephemeralAPI = url;
117
118
  }
119
+ /**
120
+ * Set running data (introduced to manage user_seed in capytale).
121
+ */
122
+ async setRunningData(data) {
123
+ this._runningData = { ...this._runningData, ...data };
124
+ }
125
+ /**
126
+ * Get running data.
127
+ */
128
+ getRunningData() {
129
+ return this._runningData;
130
+ }
118
131
  /*
119
132
  * Initialize the kernel. Should be overloaded.
120
133
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/kernel-base",
3
- "version": "0.78.1",
3
+ "version": "0.78.3",
4
4
  "description": "Basthon - Base Kernel",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {