@ai-ecoverse/slicc-kernel 1.127.0 → 1.128.0

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,2 @@
1
+ import { type CopyOptions, type KernelFs } from './types.js';
2
+ export declare function copyByBytes(fs: KernelFs, from: string, to: string, options: CopyOptions): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { type MetaStore } from './meta.js';
2
2
  import { type LockManagerLike, type RemoteListener } from './remote.js';
3
- import { type FsStat, type KernelFs, type NewOwner, type OwnerChange, type Peers, type Perm } from './types.js';
3
+ import { type CopyOptions, type FsStat, type KernelFs, type NewOwner, type OwnerChange, type Peers, type Perm } from './types.js';
4
4
  export type OpfsOp = 'lookup' | 'read' | 'write' | 'commit' | 'sidecar';
5
5
  export declare function translate(err: unknown, path: string, op?: OpfsOp, mapped?: boolean): Error;
6
6
  export interface WriteSession {
@@ -76,7 +76,10 @@ export declare class OpfsFs implements KernelFs {
76
76
  private current;
77
77
  private exact;
78
78
  private calls;
79
+ private others;
79
80
  opfsCalls(): number;
81
+ opfsOps(): number;
82
+ private io;
80
83
  private fresh;
81
84
  private exactly;
82
85
  private forget;
@@ -131,6 +134,8 @@ export declare class OpfsFs implements KernelFs {
131
134
  version(path: string, cached?: boolean): Promise<string>;
132
135
  pread(path: string, offset: number, length: number): Promise<Uint8Array>;
133
136
  pwrite(path: string, offset: number, bytes: Uint8Array): Promise<void>;
137
+ private keptFor;
138
+ private writeAt;
134
139
  truncate(path: string, size: number): Promise<void>;
135
140
  writeSession(path: string, truncate: boolean): Promise<WriteSession>;
136
141
  readFile(path: string): Promise<string>;
@@ -163,6 +168,10 @@ export declare class OpfsFs implements KernelFs {
163
168
  private rollBack;
164
169
  private finishRenames;
165
170
  settledRename(path: unknown): Promise<void>;
171
+ private busyAt;
172
+ private readonly copying;
173
+ copyFile(from: string, to: string, options: CopyOptions): Promise<void>;
174
+ private copyInto;
166
175
  private renameAt;
167
176
  private replacingTarget;
168
177
  private modified;
@@ -38,6 +38,10 @@ export interface NewOwner extends Owner {
38
38
  socket?: boolean;
39
39
  fifo?: boolean;
40
40
  }
41
+ export interface CopyOptions {
42
+ exclusive: boolean;
43
+ owner?: NewOwner;
44
+ }
41
45
  export interface OwnerChange {
42
46
  uid?: number;
43
47
  gid?: number;
@@ -82,6 +86,7 @@ export interface KernelFs {
82
86
  readlink(path: string): Promise<string>;
83
87
  realpath?(path: string, follow: boolean): Promise<string>;
84
88
  createExclusive?(path: string, owner?: NewOwner): Promise<void>;
89
+ copyFile?(from: string, to: string, options: CopyOptions): Promise<void>;
85
90
  readonly rootName?: string;
86
91
  chown?(path: string, change: OwnerChange): Promise<void>;
87
92
  trackOwners?(): void;
@@ -111,6 +116,7 @@ export interface KernelFs {
111
116
  }>;
112
117
  version?(path: string, cached?: boolean): Promise<string>;
113
118
  opfsCalls?(): number;
119
+ opfsOps?(): number;
114
120
  }
115
121
  export type RangedOps = Required<Pick<KernelFs, 'pread' | 'pwrite' | 'truncate'>>;
116
122
  export declare function rangedOps(fs: Partial<RangedOps>): RangedOps | undefined;
@@ -49,4 +49,5 @@ export interface ProcessListing {
49
49
  peers?: number;
50
50
  fsCalls?: number;
51
51
  opfsCalls?: number;
52
+ opfsOps?: number;
52
53
  }
@@ -65,6 +65,8 @@ export declare class WasiHost {
65
65
  constructor(o: WasiHostOptions);
66
66
  get cwd(): string;
67
67
  umask(mask?: number): number;
68
+ private copyImport;
69
+ copyFile(from: string, to: string, mode: number, exclusive: boolean): void;
68
70
  private created;
69
71
  sliccTtyImports(): Record<string, WasiFunction>;
70
72
  sliccFsImports(): Record<string, WasiFunction>;
@@ -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', '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'];
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;
@@ -113,6 +113,7 @@ export interface SyncFsPosixBridge {
113
113
  access?(path: string, mode: number, kind?: AccessKind, nofollow?: boolean): void;
114
114
  create?(path: string, mode?: number, opening?: boolean): SyncFsCreated | undefined | void;
115
115
  mkfifo?(path: string, mode: number): void;
116
+ copy?(from: string, to: string, mode: number, exclusive: boolean): void;
116
117
  chown?(path: string, ...rest: ChownArgs): void;
117
118
  owners?: boolean;
118
119
  links?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.127.0",
3
+ "version": "1.128.0",
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",
@@ -71,7 +71,7 @@
71
71
  "@ai-ecoverse/wasi-pnpm": "12.9.1-11",
72
72
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
73
73
  "@ai-ecoverse/wasi-rustc": "1.98.1-5",
74
- "@ai-ecoverse/wasi-zig": "0.16.0-16",
74
+ "@ai-ecoverse/wasi-zig": "0.16.0-17",
75
75
  "@ai-ecoverse/wasix-python": "3.14.2-28",
76
76
  "@ai-ecoverse/wasm-bash": "5.3.0-20",
77
77
  "@ai-ecoverse/wasm-coreutils": "9.12.0-10",