@ai-ecoverse/slicc-kernel 1.189.0 → 1.189.1

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.
@@ -3181,7 +3181,7 @@ var init_version = __esm({
3181
3181
  "src/version.ts"() {
3182
3182
  "use strict";
3183
3183
  init_captured_globals();
3184
- KERNEL_VERSION = true ? "1.189.0" : "0.0.0-dev";
3184
+ KERNEL_VERSION = true ? "1.189.1" : "0.0.0-dev";
3185
3185
  OS_RELEASE = "6.0.0-slicc";
3186
3186
  }
3187
3187
  });
@@ -3,12 +3,23 @@ export interface ImageHandle {
3
3
  }
4
4
  export declare function digest(data: string | Uint8Array): Promise<string>;
5
5
  export declare function initialMemory(bytes: Uint8Array): number;
6
+ export interface ImageSource {
7
+ readonly path: string;
8
+ read(): Promise<Uint8Array>;
9
+ stale?(): void;
10
+ }
11
+ export declare class ImageError extends Error {
12
+ readonly code: string;
13
+ readonly exitStatus: number;
14
+ constructor(code: string, message: string);
15
+ }
6
16
  export declare class Images {
7
- private readonly initial;
8
- private readonly bytes;
9
- private readonly handles;
10
- register(source: ArrayBuffer | ArrayBufferView): Promise<ImageHandle>;
11
- compile: (bytes: ArrayBuffer | ArrayBufferView) => Promise<WebAssembly.Module>;
17
+ private readonly images;
18
+ private readonly reading;
19
+ register(source: ArrayBuffer | ArrayBufferView, from?: ImageSource): Promise<ImageHandle>;
20
+ compile: (bytes: ArrayBuffer | ArrayBufferView, _key?: string, from?: ImageSource) => Promise<WebAssembly.Module>;
21
+ load(image: string): Promise<ArrayBuffer>;
22
+ private read;
12
23
  get(image: string): ArrayBuffer;
13
24
  sizeOf(image: string): {
14
25
  initial: number;
@@ -16,5 +27,6 @@ export declare class Images {
16
27
  };
17
28
  has(image: string): boolean;
18
29
  get size(): number;
30
+ get held(): number;
19
31
  }
20
32
  export declare function imageOf(module: unknown): string | undefined;
@@ -1,5 +1,6 @@
1
1
  export interface SqlCursorLike {
2
2
  toArray(): Record<string, unknown>[];
3
+ [Symbol.iterator]?(): Iterator<Record<string, unknown>>;
3
4
  one(): Record<string, unknown>;
4
5
  readonly rowsWritten: number;
5
6
  }
@@ -59,6 +60,7 @@ export declare class SqlStore {
59
60
  flush(extra?: () => void): void;
60
61
  stats(): FlushStats;
61
62
  rows(query: string, ...bindings: unknown[]): Record<string, unknown>[];
63
+ each(query: string, ...bindings: unknown[]): Iterable<Record<string, unknown>>;
62
64
  row(query: string, ...bindings: unknown[]): Record<string, unknown> | undefined;
63
65
  run(query: string, ...bindings: unknown[]): number;
64
66
  atomically<T>(fn: () => T): T;
@@ -94,10 +94,15 @@ export interface LauncherOptions {
94
94
  admit?: (program: Program, from: {
95
95
  ppid?: number;
96
96
  }) => Promise<() => void>;
97
- compile?: (bytes: Uint8Array, key: string) => Promise<WebAssembly.Module>;
97
+ compile?: (bytes: Uint8Array, key: string, source: ProgramSource) => Promise<WebAssembly.Module>;
98
98
  tlsEngine?: () => Promise<TlsEngineModule>;
99
99
  ports?: MakePortPair;
100
100
  }
101
+ export interface ProgramSource {
102
+ readonly path: string;
103
+ read(): Promise<Uint8Array>;
104
+ stale(): void;
105
+ }
101
106
  export interface ModuleUrl {
102
107
  url: string;
103
108
  revoke(): void;
@@ -403,6 +408,8 @@ export declare class Launcher {
403
408
  private names;
404
409
  private loaded;
405
410
  private reread;
411
+ private forgetCompiled;
412
+ private sourceOf;
406
413
  private exeId;
407
414
  private kernelProgram;
408
415
  private program;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.189.0",
3
+ "version": "1.189.1",
4
4
  "description": "SLICC's wasm-realm kernel: run Emscripten programs in the browser against OPFS, with fork, spawn, pipes and waitpid",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",