@ai-ecoverse/slicc-kernel 1.160.3 → 1.161.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.
@@ -44,6 +44,14 @@ export declare class OpfsFs implements KernelFs {
44
44
  heldBy(held: (dir: string) => readonly string[]): void;
45
45
  private pinHeld;
46
46
  remoteChanges(listener: RemoteListener): () => void;
47
+ announceHolds(add: ReadonlyArray<[string, string | undefined]>, drop: readonly string[], wait: boolean): Promise<void>;
48
+ holdCounts(): {
49
+ mine: number;
50
+ peers: number;
51
+ sent: number;
52
+ held: string[];
53
+ } | undefined;
54
+ rehold(from: string, to: string): void;
47
55
  announceWatch(paths: readonly string[]): Promise<void>;
48
56
  private committed;
49
57
  private counted;
@@ -39,6 +39,11 @@ export declare class RemoteWatch {
39
39
  private readonly mourned;
40
40
  private readonly others;
41
41
  private readonly union;
42
+ private readonly myHolds;
43
+ private readonly peerHolds;
44
+ private holdsSent;
45
+ private readonly silent;
46
+ private readonly holders;
42
47
  private readonly listeners;
43
48
  private readonly waiting;
44
49
  private readonly locks;
@@ -75,6 +80,20 @@ export declare class RemoteWatch {
75
80
  private greeted;
76
81
  private heard;
77
82
  private announced;
83
+ private heldBy;
84
+ hold(add: ReadonlyArray<[string, string | undefined]>, drop: readonly string[], wait: boolean): Promise<void>;
85
+ rehold(from: string, to: string): void;
86
+ private sendHolds;
87
+ peerHeld(path: string): Array<{
88
+ tab: string;
89
+ fid: string | undefined;
90
+ }>;
91
+ peerHeldPaths(): string[];
92
+ holdCounts(): {
93
+ mine: number;
94
+ peers: number;
95
+ sent: number;
96
+ };
78
97
  private acked;
79
98
  private rebuild;
80
99
  prune(): Promise<void>;
@@ -134,6 +134,14 @@ export interface KernelFs {
134
134
  };
135
135
  opfsOps?(): number;
136
136
  fileIdWrites?(): number;
137
+ announceHolds?(add: ReadonlyArray<[string, string | undefined]>, drop: readonly string[], wait: boolean): Promise<void>;
138
+ holdCounts?(): {
139
+ mine: number;
140
+ peers: number;
141
+ sent: number;
142
+ held: string[];
143
+ } | undefined;
144
+ rehold?(from: string, to: string): void;
137
145
  }
138
146
  export interface PwriteOptions {
139
147
  create?: false;
@@ -102,6 +102,7 @@ export interface SpawnWasmOptions {
102
102
  renames: Array<[string, string]>;
103
103
  };
104
104
  fileId?: (path: string) => Promise<string> | undefined;
105
+ announceHold?: (path: string, fid: string | undefined, created: boolean) => Promise<void> | undefined;
105
106
  renameSeq?: (from: string, to: string) => number | undefined;
106
107
  mounts?: () => MountLine[];
107
108
  mount?: WasmProcessOptions['mount'];
@@ -56,6 +56,12 @@ export interface ProcessListing {
56
56
  cwdChecks?: number;
57
57
  staleFds?: number;
58
58
  fileIds?: number;
59
+ holds?: {
60
+ mine: number;
61
+ peers: number;
62
+ sent: number;
63
+ held?: readonly string[];
64
+ };
59
65
  renameAcks?: {
60
66
  acks: number;
61
67
  busy: number;
@@ -51,7 +51,8 @@ interface Mount extends MountEntry {
51
51
  export declare function parseSize(text: string): number;
52
52
  export declare class HeldSet extends Set<HeldPaths> {
53
53
  private readonly idle;
54
- constructor(idle: (path: string) => void);
54
+ private readonly moved;
55
+ constructor(idle: (path: string) => void, moved?: (from: string, to: string) => void);
55
56
  add(holds: HeldPaths): this;
56
57
  doubt(paths: readonly string[], over?: string): void;
57
58
  bindIds(id: (path: string) => Promise<string> | undefined): Promise<void>;
@@ -72,6 +73,7 @@ export declare class HeldPaths extends Map<string, number> implements UnlinkHold
72
73
  private readonly doubted;
73
74
  private doubts;
74
75
  onIdle?: (path: string) => void;
76
+ onMoved?: (from: string, to: string) => void;
75
77
  keyOf(path: string): string;
76
78
  keptAt(path: string): KeptFile | undefined;
77
79
  holding(path: string): boolean;
@@ -19,6 +19,7 @@ export interface SyncFsTokenEntry {
19
19
  doubt: number;
20
20
  } | undefined;
21
21
  fileId?: (path: string) => Promise<string> | undefined;
22
+ announceHold?: (path: string, fid: string | undefined, created: boolean) => Promise<void> | undefined;
22
23
  trust?: (handle: number, doubt: number) => void;
23
24
  gate?: <T>(path: string, op: () => Promise<T>) => Promise<T>;
24
25
  unlinked?: (path: string) => KeptFile | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.160.3",
3
+ "version": "1.161.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",