@ai-ecoverse/slicc-kernel 1.167.4 → 1.168.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.
@@ -104,6 +104,7 @@ export declare class OpfsFs implements KernelFs {
104
104
  private io;
105
105
  private fresh;
106
106
  private exactly;
107
+ refresh(trees: readonly string[]): void;
107
108
  private forget;
108
109
  private missed;
109
110
  private remember;
@@ -6,6 +6,7 @@ export interface RemoteChange {
6
6
  to: string;
7
7
  };
8
8
  content?: true;
9
+ outside?: true;
9
10
  }
10
11
  export interface PeerRename {
11
12
  from: string;
@@ -104,7 +104,9 @@ export interface KernelFs {
104
104
  to: string;
105
105
  };
106
106
  content?: true;
107
+ outside?: true;
107
108
  }) => void): () => void;
109
+ refresh?(trees: readonly string[]): void;
108
110
  peers?(): Peers | undefined;
109
111
  crossings?(mounted: (path: string) => boolean): void;
110
112
  ancestry?(path: string): Promise<Array<Perm | undefined>>;
@@ -0,0 +1,25 @@
1
+ import type { KernelFs } from '../fs/types.js';
2
+ export declare const SWAP_GAP_MS = 2000;
3
+ export interface SwapCounts {
4
+ swaps: number;
5
+ longestMs: number;
6
+ waits: number;
7
+ waitedMs: number;
8
+ }
9
+ export declare class PackageSwaps {
10
+ private readonly gaps;
11
+ private readonly isRoot;
12
+ private readonly hold;
13
+ private readonly closed;
14
+ private readonly gapMs;
15
+ private readonly tally;
16
+ constructor(isRoot: (path: string) => boolean, hold: (root: string) => Promise<() => void>, closed: () => void, gapMs?: number);
17
+ counts(): SwapCounts;
18
+ settled(): Promise<void>;
19
+ wrap(fs: KernelFs): KernelFs;
20
+ private rename;
21
+ private open;
22
+ private arm;
23
+ private close;
24
+ private land;
25
+ }
@@ -62,6 +62,12 @@ export interface ProcessListing {
62
62
  sent: number;
63
63
  held?: readonly string[];
64
64
  };
65
+ swaps?: {
66
+ swaps: number;
67
+ longestMs: number;
68
+ waits: number;
69
+ waitedMs: number;
70
+ };
65
71
  renameAcks?: {
66
72
  acks: number;
67
73
  busy: number;
@@ -0,0 +1,18 @@
1
+ export declare const REPLACING_LOCK = "slicc-kernel-replacing:v1:";
2
+ export declare const REPLACED_WAIT_MS = 150;
3
+ export interface ReplacingLocks {
4
+ request(name: string, options: {
5
+ mode: 'shared' | 'exclusive';
6
+ ifAvailable?: boolean;
7
+ }, callback: (lock: unknown) => unknown): Promise<unknown>;
8
+ }
9
+ export declare function replacingLocks(scope?: object): ReplacingLocks | undefined;
10
+ export declare function replacingLock(metadata: string, root: string): string;
11
+ export declare function exclusively<T>(locks: ReplacingLocks, names: readonly string[], run: () => Promise<T>): Promise<T>;
12
+ export declare class PackageLocks {
13
+ private readonly locks;
14
+ private readonly metadata;
15
+ constructor(metadata: string, locks?: ReplacingLocks | undefined);
16
+ loading<T>(roots: readonly string[], run: (waited: boolean) => Promise<T>): Promise<T>;
17
+ holding(root: string): Promise<() => void>;
18
+ }
@@ -76,6 +76,7 @@ export interface LauncherOptions {
76
76
  protect?: Protection;
77
77
  cron?: CronOptions;
78
78
  moduleUrl?: ModuleUrlMaker;
79
+ packageLocks?: string;
79
80
  }
80
81
  export interface ModuleUrl {
81
82
  url: string;
@@ -204,6 +205,8 @@ export declare class Launcher {
204
205
  private readonly sudoer;
205
206
  private readonly jobs;
206
207
  private readonly locks;
208
+ private readonly packageLocks;
209
+ private readonly swaps;
207
210
  private readonly fifos;
208
211
  private readonly memories;
209
212
  private readonly sems;
@@ -280,6 +283,8 @@ export declare class Launcher {
280
283
  private roots;
281
284
  private rootOnlyPath;
282
285
  private trustedAppended;
286
+ private remoteChanged;
287
+ private catalogChanged;
283
288
  private resetCatalogs;
284
289
  private userScopes;
285
290
  private userCommandDir;
@@ -338,6 +343,10 @@ export declare class Launcher {
338
343
  private exeId;
339
344
  private program;
340
345
  private launch;
346
+ private loadPlanned;
347
+ private packageRootIs;
348
+ private packageRoots;
349
+ private loadedUnder;
341
350
  groupSession(pgid: number): number | undefined;
342
351
  private loopbackFor;
343
352
  private sourceCheck;
@@ -15,3 +15,7 @@ export interface PostFsNoticeOptions {
15
15
  metadata?: string;
16
16
  }
17
17
  export declare function postFsNotice(notice: FsNotice, options?: PostFsNoticeOptions): void;
18
+ export interface ReplacingOptions {
19
+ metadata?: string;
20
+ }
21
+ export declare function replacing<T>(paths: readonly string[], task: () => T | Promise<T>, options?: ReplacingOptions): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.167.4",
3
+ "version": "1.168.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",
@@ -70,10 +70,10 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@ai-ecoverse/py-numpy": "2.5.4-4",
73
- "@ai-ecoverse/slicc-cdp": "1.42.0",
73
+ "@ai-ecoverse/slicc-cdp": "1.42.2",
74
74
  "@ai-ecoverse/slicc-node": "2.5.2",
75
75
  "@ai-ecoverse/slicc-scrub": "1.1.0",
76
- "@ai-ecoverse/slicc-shared-web": "2.13.0",
76
+ "@ai-ecoverse/slicc-shared-web": "2.13.3",
77
77
  "@ai-ecoverse/wasi-cargo": "0.99.0-6",
78
78
  "@ai-ecoverse/wasi-pnpm": "12.9.1-21",
79
79
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",