@ai-ecoverse/slicc-kernel 1.127.1 → 1.128.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,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>;
@@ -92,5 +92,6 @@ export declare class IndexedDbMeta implements MetaStore {
92
92
  under(path: string): Promise<MetaEntry[]>;
93
93
  all(): Promise<MetaEntry[]>;
94
94
  }
95
+ export declare function openMetaDb(name: string, factory: IDBFactory): Promise<IDBDatabase>;
95
96
  export declare function openMeta(name: string, factory: IDBFactory): Promise<IndexedDbMeta>;
96
97
  export {};
@@ -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 {
@@ -168,6 +168,10 @@ export declare class OpfsFs implements KernelFs {
168
168
  private rollBack;
169
169
  private finishRenames;
170
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;
171
175
  private renameAt;
172
176
  private replacingTarget;
173
177
  private modified;
@@ -0,0 +1,3 @@
1
+ export declare const nameOf: (id: string) => string;
2
+ export declare function rootId(factory: IDBFactory, root: FileSystemDirectoryHandle, locks?: LockManager | undefined): Promise<string>;
3
+ export declare function metadataName(top: FileSystemDirectoryHandle | undefined, root: FileSystemDirectoryHandle, id: (root: FileSystemDirectoryHandle) => Promise<string>): Promise<string>;
@@ -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;
@@ -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;
@@ -172,6 +172,7 @@ type WithoutId<T> = T extends unknown ? Omit<T, 'id'> : never;
172
172
  export type KernelCall = WithoutId<KernelRequest>;
173
173
  export declare function inOpfs(deps: ServeDeps, root: FileSystemDirectoryHandle): Promise<boolean>;
174
174
  export interface ServeDeps {
175
+ rootId?: (root: FileSystemDirectoryHandle) => Promise<string>;
175
176
  storage: () => Promise<FileSystemDirectoryHandle>;
176
177
  syncAccess?: boolean;
177
178
  createWorker: () => WasmWorkerLike;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.127.1",
3
+ "version": "1.128.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",
@@ -68,9 +68,9 @@
68
68
  "@ai-ecoverse/slicc-scrub": "1.0.0",
69
69
  "@ai-ecoverse/slicc-shared-web": "1.24.2",
70
70
  "@ai-ecoverse/wasi-cargo": "0.99.0-3",
71
- "@ai-ecoverse/wasi-pnpm": "12.9.1-11",
71
+ "@ai-ecoverse/wasi-pnpm": "12.9.1-13",
72
72
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
73
- "@ai-ecoverse/wasi-rustc": "1.98.1-5",
73
+ "@ai-ecoverse/wasi-rustc": "1.98.1-6",
74
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",