@ai-ecoverse/slicc-kernel 1.124.7 → 1.124.9

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,5 +1,11 @@
1
1
  import { type KernelFs, type NewOwner } from './types.js';
2
2
  export declare const UNLINKED_DIR = ".slicc-unlinked";
3
+ export interface Replacements {
4
+ settled(path: string): Promise<void>;
5
+ missed(path: string): boolean;
6
+ generation(): number;
7
+ changedSince(path: string, gen: number): boolean;
8
+ }
3
9
  export interface KeptFile {
4
10
  readonly hidden: string;
5
11
  release(): void;
@@ -51,6 +57,9 @@ export declare class UnlinkedKeeper {
51
57
  private queue;
52
58
  private count;
53
59
  private readonly replacing;
60
+ private gen;
61
+ private floor;
62
+ private readonly touched;
54
63
  private replaced;
55
64
  private readonly links;
56
65
  private readonly linked;
@@ -63,9 +72,14 @@ export declare class UnlinkedKeeper {
63
72
  });
64
73
  private serial;
65
74
  wrap(fs?: KernelFs): KernelFs;
75
+ settled(path: string): Promise<void>;
76
+ generation(): number;
77
+ changedSince(path: string, gen: number): boolean;
78
+ private touch;
79
+ missed(path: string): boolean;
66
80
  settle(pinned: Pinned, op: () => Promise<void>): Promise<void>;
67
81
  private heldWithin;
68
- pin(target: string, gated?: () => void): Promise<Pinned>;
82
+ pin(target: string, gated?: () => void, sealed?: () => void): Promise<Pinned>;
69
83
  private keptFile;
70
84
  private hide;
71
85
  closed(path: string): void;
@@ -1,5 +1,5 @@
1
1
  import { type Dac } from '../fs/dac.js';
2
- import { type PathGate } from '../fs/unlinked.js';
2
+ import { type PathGate, type Replacements } from '../fs/unlinked.js';
3
3
  import { HeldPaths } from '../mount/mount-fs.js';
4
4
  import { type SourceCheck, type SyncFsTokenEntry } from '../realm/sync-fs-token-registry.js';
5
5
  import { type BlockedMask } from '../realm/sync-sab-wire.js';
@@ -14,8 +14,8 @@ import type { KernelLocks } from './lock-service.js';
14
14
  import type { HttpHandles } from './net/http-syscalls.js';
15
15
  import type { Resolver } from './net/resolver.js';
16
16
  import type { MountLine, ProcessListing } from './proc-info.js';
17
- import { type StateListener, type WasmProcessOptions, type WasmSyscall } from './process.js';
18
- import { type ForkState, type InheritedFd, type Program } from './protocol.js';
17
+ import { type StateListener, WasmProcess, type WasmProcessOptions, type WasmSyscall } from './process.js';
18
+ import { type ForkState, type InheritedFd, type Program, type WasmThread, type WasmThreadInitMsg } from './protocol.js';
19
19
  import type { PtyTable } from './pty.js';
20
20
  import type { SealedBroker } from './sealed.js';
21
21
  import type { SemTable } from './sem.js';
@@ -82,6 +82,7 @@ export interface SpawnWasmOptions {
82
82
  umount?: WasmProcessOptions['umount'];
83
83
  held?: Set<HeldPaths>;
84
84
  unlinkGate?: PathGate;
85
+ replacements?: Replacements;
85
86
  jobs?: JobTable;
86
87
  ptys?: PtyTable;
87
88
  net?: LoopbackNet;
@@ -120,4 +121,5 @@ export interface WasmProcessHandle {
120
121
  export declare const KILL_GRACE_MS = 2000;
121
122
  export declare const KILL_HARD_MS = 5000;
122
123
  export declare function inheritedFds(fds: FdTable): InheritedFd[];
124
+ export declare function threadInit(opts: SpawnWasmOptions, program: WasmThreadInitMsg['program'], sab: SharedArrayBuffer, cred: WasmProcess['cred'], thread: WasmThread, main: SharedArrayBuffer): WasmThreadInitMsg;
123
125
  export declare function spawnWasmProcess(opts: SpawnWasmOptions): WasmProcessHandle;
@@ -1,6 +1,7 @@
1
1
  import { type CrontabCall, type CrontabResult } from '../cron/crontab.js';
2
2
  import { type Created, type Dac } from '../fs/dac.js';
3
3
  import type { KernelFs } from '../fs/types.js';
4
+ import type { Replacements } from '../fs/unlinked.js';
4
5
  import type { MountCall } from '../mount/syscall.js';
5
6
  import type { LinkRecord } from '../process/wasi/wasix-linker.js';
6
7
  import type { SourceCheck } from '../realm/sync-fs-token-registry.js';
@@ -62,6 +63,7 @@ export type WasmSyscall = {
62
63
  existing?: boolean;
63
64
  pin?: VersionPin;
64
65
  handle?: number;
66
+ ino?: number;
65
67
  fifo?: boolean;
66
68
  } | {
67
69
  op: 'fd-pread';
@@ -202,6 +204,7 @@ export type WasmSyscall = {
202
204
  dirty?: boolean;
203
205
  pin?: VersionPin;
204
206
  handle?: number;
207
+ ino?: number;
205
208
  } | {
206
209
  op: 'fd-open-tty';
207
210
  name?: string;
@@ -517,6 +520,10 @@ export declare class WasmProcess {
517
520
  keptPath?: (path: string) => string | undefined;
518
521
  holds(path: string): Promise<boolean>;
519
522
  keptHandle?: (handle: number) => string | undefined;
523
+ holdsHandle?: (handle: number) => boolean;
524
+ replacements?: Replacements;
525
+ private unmissed;
526
+ private stillOpen;
520
527
  private keptOr;
521
528
  private promote;
522
529
  private reserve;
@@ -35,6 +35,7 @@ export interface VfsFileOptions {
35
35
  truncate?: boolean;
36
36
  create?: boolean;
37
37
  id?: string;
38
+ ino?: number;
38
39
  }
39
40
  export interface VersionPin {
40
41
  version: string;
@@ -58,6 +59,7 @@ export declare class VfsNode {
58
59
  path: string;
59
60
  orphaned: boolean;
60
61
  id: string | undefined;
62
+ ino: number | undefined;
61
63
  onDirty: (() => void) | undefined;
62
64
  onDirtyState: ((on: boolean) => void) | undefined;
63
65
  private counted;
@@ -125,7 +127,7 @@ export declare class VfsNodes implements UnlinkHolder {
125
127
  holding(path: string): VfsNode | undefined;
126
128
  private named;
127
129
  private create;
128
- open(path: string, pin?: VersionPin, writable?: boolean, id?: string): VfsNode;
130
+ open(path: string, pin?: VersionPin, writable?: boolean, id?: string, ino?: number): VfsNode;
129
131
  adopt(path: string, contents: Uint8Array, dirty: boolean, writable?: boolean, id?: string): VfsNode;
130
132
  holds(prefix: string): boolean;
131
133
  writes(prefix: string): boolean;
@@ -73,6 +73,7 @@ export declare class HeldPaths extends Map<string, number> implements UnlinkHold
73
73
  isKept(path: string): boolean;
74
74
  private handlesAt;
75
75
  keptFor(handle: number): KeptFile | undefined;
76
+ holdsHandle(handle: number): boolean;
76
77
  keeps(hidden: string): boolean;
77
78
  keep(path: string, file: KeptFile): void;
78
79
  unkeep(path: string, file: KeptFile): void;
@@ -34,6 +34,7 @@ export interface ProcessSys {
34
34
  size: number;
35
35
  };
36
36
  handle?: number;
37
+ ino?: number;
37
38
  fifo?: boolean;
38
39
  }): number;
39
40
  seek(fd: number, offset: number, whence: number): number;
@@ -129,6 +129,7 @@ export declare class WasiFds {
129
129
  private kernelFifo;
130
130
  restartable: (() => boolean) | undefined;
131
131
  restarting<T>(call: () => T): T;
132
+ private madeAtOnce;
132
133
  private createNew;
133
134
  private isLink;
134
135
  private statOrMissing;
@@ -32,5 +32,6 @@ export declare function procAlias(fs: {
32
32
  readlink?(path: string): Promise<string>;
33
33
  lstat?(path: string): Promise<unknown>;
34
34
  }, path: string, follow: boolean): Promise<string | undefined | ProcRefusal>;
35
+ export declare function physicalProc(fs: Pick<SyncFsPosixBridge, 'stat' | 'changes'>): () => boolean;
35
36
  export declare function procfsBridge<T extends SyncFsPosixBridge>(fs: T, tree: ProcTree): T;
36
37
  export {};
@@ -3,6 +3,7 @@ import { type SyncFsTokenEntry } from './sync-fs-token-registry.js';
3
3
  import { type SyncFsRequest, type SyncFsResult } from './sync-fs-wire.js';
4
4
  export declare function toErrno(err: unknown): SyncFsResult;
5
5
  export interface SyncFsStatJson {
6
+ gen?: number;
6
7
  isDirectory: boolean;
7
8
  isFile: boolean;
8
9
  isSymbolicLink: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { Created, Dac } from '../fs/dac.js';
2
2
  import type { KernelFs } from '../fs/types.js';
3
- import type { KeptFile } from '../fs/unlinked.js';
3
+ import type { KeptFile, Replacements } from '../fs/unlinked.js';
4
4
  import type { Cred } from '../kernel/cred.js';
5
5
  export interface SyncFsTokenEntry {
6
6
  fs: KernelFs;
@@ -24,6 +24,7 @@ export interface SyncFsTokenEntry {
24
24
  links?: number;
25
25
  created?: Created;
26
26
  holdsKept?: (path: string) => Promise<boolean>;
27
+ replacements?: Replacements;
27
28
  fresh?: (path: string) => void;
28
29
  source?: SourceCheck;
29
30
  }
@@ -18,6 +18,7 @@ export interface SyncFsRequest {
18
18
  length?: number;
19
19
  version?: string;
20
20
  handle?: number;
21
+ gen?: number;
21
22
  uid?: number;
22
23
  gid?: number;
23
24
  exclusive?: boolean;
@@ -64,6 +65,7 @@ export interface SyncFsBridgeStat {
64
65
  version?: string;
65
66
  uid?: number;
66
67
  gid?: number;
68
+ gen?: number;
67
69
  }
68
70
  export interface SyncFsUsage {
69
71
  quota: number;
@@ -99,7 +101,9 @@ export interface SyncFsPosixBridge {
99
101
  chmod(path: string, mode: number): void;
100
102
  utimes(path: string, atimeMs: number, mtimeMs: number, now?: boolean): void;
101
103
  lutimes(path: string, atimeMs: number, mtimeMs: number, now?: boolean): void;
102
- hold?(path: string, held: boolean, open?: boolean, handle?: number, want?: number): number | undefined;
104
+ hold?(path: string, held: boolean, open?: boolean, handle?: number, want?: number, seen?: {
105
+ gen?: number;
106
+ }): number | undefined;
103
107
  access?(path: string, mode: number, kind?: AccessKind, nofollow?: boolean): void;
104
108
  create?(path: string, mode?: number, opening?: boolean): void;
105
109
  mkfifo?(path: string, mode: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.124.7",
3
+ "version": "1.124.9",
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",
@@ -72,7 +72,7 @@
72
72
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
73
73
  "@ai-ecoverse/wasi-rustc": "1.98.1-5",
74
74
  "@ai-ecoverse/wasi-zig": "0.16.0-16",
75
- "@ai-ecoverse/wasix-python": "3.14.2-27",
75
+ "@ai-ecoverse/wasix-python": "3.14.2-28",
76
76
  "@ai-ecoverse/wasm-bash": "5.3.0-19",
77
77
  "@ai-ecoverse/wasm-coreutils": "9.12.0-9",
78
78
  "@ai-ecoverse/wasm-curl": "8.22.0-6",