@ai-ecoverse/slicc-kernel 1.172.2 → 1.173.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.
@@ -0,0 +1,41 @@
1
+ import type { MetaEntry } from './meta.js';
2
+ export interface Invalidated {
3
+ paths?: readonly string[];
4
+ trees?: readonly string[];
5
+ }
6
+ export declare class Invalidations {
7
+ private seq;
8
+ private readonly log;
9
+ private readonly open;
10
+ start(): number;
11
+ end(at: number): void;
12
+ note({ paths, trees }: Invalidated): void;
13
+ private since;
14
+ entryStale(at: number, path: string): boolean;
15
+ listingStale(at: number, dir: string): boolean;
16
+ }
17
+ export type MetaReadKind = 'entry' | 'links';
18
+ export interface ReadBatch {
19
+ entries: readonly string[];
20
+ links: readonly string[];
21
+ }
22
+ export interface ReadResult {
23
+ entries: Map<string, MetaEntry | null>;
24
+ links: Map<string, MetaEntry[]>;
25
+ }
26
+ export declare const META_READS_IN_FLIGHT = 4;
27
+ export declare class BatchedReads {
28
+ private readonly run;
29
+ private readonly invalidations;
30
+ private readonly keep;
31
+ private readonly queued;
32
+ private readonly reading;
33
+ private inFlight;
34
+ constructor(invalidations: Invalidations, run: (batch: ReadBatch) => Promise<ReadResult>, keep: (kind: MetaReadKind, key: string, value: unknown) => void);
35
+ entries(paths: readonly string[]): Promise<Map<string, MetaEntry | null>>;
36
+ links(dir: string): Promise<MetaEntry[]>;
37
+ private stale;
38
+ private want;
39
+ private pump;
40
+ private flush;
41
+ }
@@ -51,6 +51,11 @@ export interface MetaStore {
51
51
  absent?(path: string): boolean;
52
52
  removeFile?(path: string): Promise<void>;
53
53
  forgetTrees?(trees: readonly string[]): void;
54
+ transactions?(): MetaTransactions;
55
+ }
56
+ export interface MetaTransactions {
57
+ reads: number;
58
+ writes: number;
54
59
  }
55
60
  export declare const META_DB = "slicc-kernel";
56
61
  export declare const META_VERSION = 1;
@@ -79,14 +84,20 @@ interface Invalidation {
79
84
  export declare class IndexedDbMeta implements MetaStore {
80
85
  private readonly db;
81
86
  private readonly cache;
87
+ private readonly listings;
82
88
  private readonly channel;
83
- private generation;
89
+ private readonly invalidations;
90
+ private readonly reads;
84
91
  private readonly listeners;
85
92
  listen(listener: (change: Invalidation) => void): void;
86
93
  constructor(db: IDBDatabase);
87
94
  forgetTrees(trees: readonly string[]): void;
88
95
  private drop;
96
+ private keepListing;
97
+ private read;
89
98
  private changed;
99
+ private readonly counted;
100
+ transactions(): MetaTransactions;
90
101
  private transaction;
91
102
  get(paths: readonly string[]): Promise<Array<MetaEntry | undefined>>;
92
103
  fresh(paths: readonly string[]): Promise<Array<MetaEntry | undefined>>;
@@ -1,4 +1,4 @@
1
- import { type MetaStore } from './meta.js';
1
+ import { type MetaStore, type MetaTransactions } from './meta.js';
2
2
  import { type KeepHandlers, type LockManagerLike, type RemoteListener } from './remote.js';
3
3
  import { type CopyOptions, type FsStat, type KernelFs, type NewOwner, type OwnerChange, type PeerKeeps, type Peers, type Perm, type PwriteOptions } from './types.js';
4
4
  export type OpfsOp = 'lookup' | 'read' | 'write' | 'commit' | 'sidecar';
@@ -101,6 +101,7 @@ export declare class OpfsFs implements KernelFs {
101
101
  private idWrites;
102
102
  fileIdWrites(): number;
103
103
  opfsOps(): number;
104
+ metaTransactions(): MetaTransactions | undefined;
104
105
  private io;
105
106
  private fresh;
106
107
  private exactly;
@@ -137,6 +137,10 @@ export interface KernelFs {
137
137
  ackMs: readonly number[];
138
138
  };
139
139
  opfsOps?(): number;
140
+ metaTransactions?(): {
141
+ reads: number;
142
+ writes: number;
143
+ } | undefined;
140
144
  fileIdWrites?(): number;
141
145
  announceHolds?(add: ReadonlyArray<[string, string | undefined]>, drop: readonly string[], wait: boolean): Promise<void>;
142
146
  holdCounts?(): {
@@ -35,6 +35,7 @@ interface Typed {
35
35
  export declare const WATCH_NOTES_LIMIT = 1000;
36
36
  export interface WatchOptions {
37
37
  recursive?: boolean;
38
+ peers?: boolean;
38
39
  }
39
40
  export declare const WATCH_BATCH_LIMIT = 1000;
40
41
  export declare class FsWatchers {
@@ -55,7 +56,9 @@ export declare class FsWatchers {
55
56
  private renamed;
56
57
  heard(type: WatchEventType, paths: readonly string[]): void;
57
58
  changed(...paths: string[]): void;
59
+ peerChanged(paths: readonly string[]): void;
58
60
  private report;
61
+ private notify;
59
62
  private flush;
60
63
  wrap(fs: KernelFs): KernelFs;
61
64
  }
@@ -53,6 +53,10 @@ export interface ProcessListing {
53
53
  fsCalls?: number;
54
54
  opfsCalls?: number;
55
55
  opfsOps?: number;
56
+ meta?: {
57
+ reads: number;
58
+ writes: number;
59
+ } | undefined;
56
60
  cwdChecks?: number;
57
61
  staleFds?: number;
58
62
  fileIds?: number;
@@ -57,12 +57,17 @@ export interface SudoCaller {
57
57
  tags?: readonly string[] | undefined;
58
58
  tty?: string | null | undefined;
59
59
  }
60
+ type Pattern = (string | null)[];
61
+ interface Command {
62
+ path: string;
63
+ args?: Pattern[];
64
+ }
60
65
  interface Rule {
61
66
  nopasswd: boolean;
62
67
  who: string;
63
68
  target: string;
64
69
  cwd?: string;
65
- cmnd: string[] | '*';
70
+ cmnd: Command | '*';
66
71
  }
67
72
  export interface SudoOptions {
68
73
  fs: KernelFs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.172.2",
3
+ "version": "1.173.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,9 +70,9 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@ai-ecoverse/py-numpy": "2.5.4-4",
73
- "@ai-ecoverse/slicc-cdp": "1.43.1",
73
+ "@ai-ecoverse/slicc-cdp": "1.44.3",
74
74
  "@ai-ecoverse/slicc-scrub": "1.1.0",
75
- "@ai-ecoverse/slicc-shared-web": "2.13.7",
75
+ "@ai-ecoverse/slicc-shared-web": "2.13.10",
76
76
  "@ai-ecoverse/wasi-cargo": "0.99.0-6",
77
77
  "@ai-ecoverse/wasi-pnpm": "12.9.1-21",
78
78
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
@@ -95,7 +95,7 @@
95
95
  "esbuild": "0.28.2",
96
96
  "fake-indexeddb": "6.2.6",
97
97
  "lefthook": "2.2.2",
98
- "monocart-coverage-reports": "2.13.2",
98
+ "monocart-coverage-reports": "3.1.0",
99
99
  "pg-gateway": "0.3.0-beta.4",
100
100
  "semantic-release": "25.0.9",
101
101
  "typescript": "7.0.2",