@ai-ecoverse/slicc-kernel 1.143.5 → 1.143.6

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.
@@ -1,4 +1,5 @@
1
1
  export declare const SHARED_TTL_MS = 100;
2
+ export declare const RENAME_WAIT_MS = 100;
2
3
  export declare const CHANGES_BYTES: number;
3
4
  export declare function changeHash(path: string): number;
4
5
  export declare class FileChanges {
@@ -8,6 +9,7 @@ export declare class FileChanges {
8
9
  dirtied(delta: number): void;
9
10
  foreign(on: boolean): void;
10
11
  flush(): void;
12
+ renamed(): number;
11
13
  publish(...paths: string[]): void;
12
14
  }
13
15
  export declare class ChangeView {
@@ -16,6 +18,8 @@ export declare class ChangeView {
16
18
  now(): number;
17
19
  clean(): boolean;
18
20
  foreign(): boolean;
21
+ renames(): number;
22
+ awaitRename(seen: number, ms: number): number;
19
23
  changedSince(seen: number, path: string): {
20
24
  now: number;
21
25
  changed: boolean;
@@ -70,6 +70,10 @@ export declare class MemoryMeta implements MetaStore {
70
70
  interface Invalidation {
71
71
  paths?: readonly string[];
72
72
  trees?: readonly string[];
73
+ moved?: {
74
+ from: string;
75
+ to: string;
76
+ };
73
77
  }
74
78
  export declare class IndexedDbMeta implements MetaStore {
75
79
  private readonly db;
@@ -138,7 +138,17 @@ export declare class OpfsFs implements KernelFs {
138
138
  pwrite(path: string, offset: number, bytes: Uint8Array): Promise<void>;
139
139
  private keptFor;
140
140
  private writeAt;
141
+ private readonly fileWrites;
142
+ private readonly movingFiles;
143
+ private writesIdle;
144
+ private writeBlocked;
145
+ private renamesInFlight;
146
+ private writeWaits;
147
+ private writeEnded;
148
+ private writesDrained;
149
+ private movingFile;
141
150
  truncate(path: string, size: number): Promise<void>;
151
+ private truncated;
142
152
  writeSession(path: string, truncate: boolean): Promise<WriteSession>;
143
153
  readFile(path: string): Promise<string>;
144
154
  private writeTarget;
@@ -1,6 +1,10 @@
1
1
  export interface RemoteChange {
2
2
  paths: readonly string[];
3
3
  trees: readonly string[];
4
+ moved?: {
5
+ from: string;
6
+ to: string;
7
+ };
4
8
  }
5
9
  export interface PeerRename {
6
10
  from: string;
@@ -94,6 +94,10 @@ export interface KernelFs {
94
94
  remoteChanges?(listener: (change: {
95
95
  paths: readonly string[];
96
96
  trees?: readonly string[];
97
+ moved?: {
98
+ from: string;
99
+ to: string;
100
+ };
97
101
  }) => void): () => void;
98
102
  peers?(): Peers | undefined;
99
103
  crossings?(mounted: (path: string) => boolean): void;
@@ -89,6 +89,11 @@ export interface SpawnWasmOptions {
89
89
  quota: number;
90
90
  usage: number;
91
91
  } | undefined>;
92
+ renames?: (since: number, held: readonly string[]) => {
93
+ now: number;
94
+ renames: Array<[string, string]>;
95
+ };
96
+ renameSeq?: (from: string, to: string) => number | undefined;
92
97
  mounts?: () => MountLine[];
93
98
  mount?: WasmProcessOptions['mount'];
94
99
  umount?: WasmProcessOptions['umount'];
@@ -0,0 +1,14 @@
1
+ import type { FileChanges } from '../fs/changes.js';
2
+ export declare const RENAME_LOG_SIZE = 4096;
3
+ export interface RenamesSince {
4
+ now: number;
5
+ renames: Array<[string, string]>;
6
+ }
7
+ export declare class RenameLog {
8
+ private readonly changes;
9
+ private readonly entries;
10
+ constructor(changes: FileChanges);
11
+ add(from: string, to: string): number;
12
+ seqOf(from: string, to: string): number | undefined;
13
+ since(seen: number, held: readonly string[]): RenamesSince;
14
+ }
@@ -101,6 +101,7 @@ export declare class VfsNodes implements UnlinkHolder {
101
101
  private readonly byId;
102
102
  keepsOnDisk: boolean;
103
103
  changed: ((path: string) => void) | undefined;
104
+ movedAway: ((from: string, to: string) => void) | undefined;
104
105
  dirtied: ((delta: number) => void) | undefined;
105
106
  private readonly fs;
106
107
  readonly entries: Map<string, Promise<unknown>>;
@@ -202,6 +202,7 @@ export declare class Launcher {
202
202
  readonly hostname: string;
203
203
  readonly watchers: FsWatchers;
204
204
  private readonly changes;
205
+ private readonly renameLog;
205
206
  readonly cwds: CwdTable;
206
207
  private readonly cwdSlots;
207
208
  private readonly pnpmHome;
@@ -415,6 +416,7 @@ export declare class Launcher {
415
416
  private readonly named;
416
417
  private commandNames;
417
418
  private entryTarget;
419
+ private moved;
418
420
  private processChain;
419
421
  private starting;
420
422
  openTerminal(argv: string[], options: TerminalOptions): Promise<TerminalSession>;
@@ -37,7 +37,10 @@ export declare class WasiFds {
37
37
  private readonly ids;
38
38
  private readonly kernel;
39
39
  private readonly fs;
40
+ private renamesSeen;
40
41
  constructor(kernel: WasiKernel, fs: SyncFsPosixBridge);
42
+ ownRename(seq: number | undefined): void;
43
+ followRenames(missing?: boolean): boolean;
41
44
  setup(cwd: string, inherited: ReadonlyArray<{
42
45
  fd: number;
43
46
  kind?: KernelFdKind;
@@ -117,7 +120,7 @@ export declare class WasiFds {
117
120
  private inoOf;
118
121
  private survives;
119
122
  private detach;
120
- renamed(from: string, to: string, replacedLinked?: SyncFsBridgeStat): void;
123
+ renamed(from: string, to: string, replacedLinked?: SyncFsBridgeStat, foreign?: boolean): void;
121
124
  held: HeldCwd | undefined;
122
125
  private cwdEntry;
123
126
  goneCwd(dir: Extract<WasiEntry, {
@@ -23,8 +23,10 @@ export declare class FileBuffer {
23
23
  private seen;
24
24
  maxFile: number | undefined;
25
25
  handle: number | undefined;
26
+ moved: ((missing: boolean) => boolean) | undefined;
26
27
  constructor(fs: SyncFsFileIo, path: string, empty: boolean, maxFile?: number, size?: number, version?: string, watch?: RangedWatch);
27
28
  get path(): string;
29
+ private retried;
28
30
  set path(path: string);
29
31
  get isRanged(): boolean;
30
32
  get pin(): string | undefined;
@@ -113,7 +113,15 @@ export interface LiveFsApi {
113
113
  sliccOpenFifo?(stream: LiveFsStream, path: string): void;
114
114
  nameTable?: (LiveFsNode | null)[] | null;
115
115
  hashRemoveNode?(node: LiveFsNode): void;
116
+ hashAddNode?(node: LiveFsNode): void;
117
+ hashName?(parentId: number, name: string): number;
116
118
  lookupNode?(parent: LiveFsNode, name: string): LiveFsNode;
119
+ lookupPath?(path: string, opts?: {
120
+ follow?: boolean;
121
+ parent?: boolean;
122
+ }): {
123
+ node: object;
124
+ };
117
125
  open?(...args: unknown[]): unknown;
118
126
  }
119
127
  export interface LiveVfsPlugin {
@@ -17,6 +17,11 @@ export interface SyncFsTokenEntry {
17
17
  own?: <T>(path: string, op: () => Promise<T>) => Promise<T>;
18
18
  revoked?: (path: string) => boolean;
19
19
  renamed?: (from: string, to: string) => void;
20
+ renames?: (since: number, held: readonly string[]) => {
21
+ now: number;
22
+ renames: Array<[string, string]>;
23
+ };
24
+ renameSeq?: (from: string, to: string) => number | undefined;
20
25
  cred?: () => Readonly<Cred>;
21
26
  umask?: () => number;
22
27
  dac?: Dac;
@@ -1,5 +1,5 @@
1
1
  import type { ChangeView } from '../fs/changes.js';
2
- export declare const SYNC_FS_OPS: readonly ['read', 'write', 'exists', 'stat', 'lstat', 'readdir', 'readdir-stat', 'mkdir', 'rm', 'rename', 'link', 'copy', 'unlink', 'rmdir', 'symlink', 'readlink', 'chmod', 'utimes', 'lutimes', 'statfs', 'hold', 'create', 'mkfifo', 'kept', 'pread', 'pwrite', 'append', 'truncate', 'chown', 'lchown', 'access'];
2
+ export declare const SYNC_FS_OPS: readonly ['read', 'write', 'exists', 'stat', 'lstat', 'readdir', 'readdir-stat', 'mkdir', 'rm', 'rename', 'link', 'copy', 'unlink', 'rmdir', 'symlink', 'readlink', 'chmod', 'utimes', 'lutimes', 'statfs', 'hold', 'create', 'mkfifo', 'kept', 'pread', 'pwrite', 'append', 'truncate', 'chown', 'lchown', 'access', 'renames'];
3
3
  export type AccessKind = 'open' | 'access' | 'eaccess' | 'follow';
4
4
  export declare const HOLD_READ = 4;
5
5
  export declare const HOLD_WRITE = 8;
@@ -99,7 +99,7 @@ export interface SyncFsPosixBridge {
99
99
  exists(path: string): boolean;
100
100
  mkdir(path: string, mode?: number): void;
101
101
  rm(path: string): void;
102
- rename(from: string, to: string): void;
102
+ rename(from: string, to: string): number | undefined | void;
103
103
  link(from: string, to: string, follow?: boolean): void;
104
104
  unlink(path: string): void;
105
105
  rmdir(path: string): void;
@@ -128,6 +128,11 @@ export interface SyncFsPosixBridge {
128
128
  identify?(): void;
129
129
  identifyNext?(): void;
130
130
  identified?(): SyncFsBridgeStat | null;
131
+ renames?(since: number, held: readonly string[]): SyncFsRenames;
132
+ }
133
+ export interface SyncFsRenames {
134
+ now: number;
135
+ renames: Array<[string, string]>;
131
136
  }
132
137
  export declare function syncError(code: string, label: string): Error & {
133
138
  code: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.143.5",
3
+ "version": "1.143.6",
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",
@@ -66,23 +66,23 @@
66
66
  "@ai-ecoverse/py-numpy": "2.5.4-4",
67
67
  "@ai-ecoverse/slicc-node": "2.5.2",
68
68
  "@ai-ecoverse/slicc-scrub": "1.0.0",
69
- "@ai-ecoverse/slicc-shared-web": "1.29.16",
69
+ "@ai-ecoverse/slicc-shared-web": "1.30.2",
70
70
  "@ai-ecoverse/wasi-cargo": "0.99.0-6",
71
71
  "@ai-ecoverse/wasi-pnpm": "12.9.1-20",
72
72
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
73
73
  "@ai-ecoverse/wasi-rustc": "1.98.1-10",
74
74
  "@ai-ecoverse/wasi-zig": "0.16.0-20",
75
75
  "@ai-ecoverse/wasix-python": "3.15.0-5",
76
- "@ai-ecoverse/wasm-bash": "5.3.0-22",
76
+ "@ai-ecoverse/wasm-bash": "5.3.0-23",
77
77
  "@ai-ecoverse/wasm-coreutils": "9.12.0-12",
78
- "@ai-ecoverse/wasm-curl": "8.22.0-8",
78
+ "@ai-ecoverse/wasm-curl": "8.22.0-9",
79
79
  "@ai-ecoverse/wasm-git": "2.55.0-18",
80
- "@ai-ecoverse/wasm-gmake": "4.4.1-8",
80
+ "@ai-ecoverse/wasm-gmake": "4.4.1-9",
81
81
  "@ai-ecoverse/wasm-procps": "4.0.7-4",
82
- "@ai-ecoverse/wasm-sqlite3": "3.54.0-6",
82
+ "@ai-ecoverse/wasm-sqlite3": "3.54.0-7",
83
83
  "@ai-ecoverse/wasm-tar": "1.35.0-8",
84
84
  "@ai-ecoverse/wasm-tls-engine": "4.2.0-7",
85
- "@ai-ecoverse/wasm-tree": "2.3.2-6",
85
+ "@ai-ecoverse/wasm-tree": "2.3.2-7",
86
86
  "@ai-ecoverse/wasm-util-linux": "2.42.4-5",
87
87
  "@biomejs/biome": "2.5.15",
88
88
  "@types/node": "24.19.2",