@ai-ecoverse/slicc-kernel 1.178.1 → 1.178.2

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.
@@ -3180,7 +3180,7 @@ var init_version = __esm({
3180
3180
  "src/version.ts"() {
3181
3181
  "use strict";
3182
3182
  init_captured_globals();
3183
- KERNEL_VERSION = true ? "1.178.1" : "0.0.0-dev";
3183
+ KERNEL_VERSION = true ? "1.178.2" : "0.0.0-dev";
3184
3184
  OS_RELEASE = "6.0.0-slicc";
3185
3185
  }
3186
3186
  });
@@ -45,7 +45,7 @@ export type { JsCred, JsSyncContext, JsSyncFile } from './process/js/js-sync.js'
45
45
  export type { JsThread, JsThreadContext, JsThreadSpawnOptions } from './process/js/js-thread.js';
46
46
  export type { JsTermios, JsTty, JsTtySize } from './process/js/js-tty.js';
47
47
  export type { JsWebSocket, JsWebSocketClose, JsWebSocketMessage, JsWebSocketOptions, } from './process/js/js-websocket.js';
48
- export type { ApproveHook, SudoAnswer, SudoApproval, SudoDenial, SudoReply, SudoRequest, SudoStdin, } from './sudo.js';
48
+ export type { ApproveHook, SudoAnswer, SudoApproval, SudoDenial, SudoFile, SudoReply, SudoRequest, SudoStdin, } from './sudo.js';
49
49
  export { type FetchTransportOptions, fetchTransport, type HeaderList, type NetworkExit, type NetworkRedirectPolicy, type NetworkRequest, type NetworkResponse, type NetworkTraits, type NetworkTransport, type NetworkWebSocket, type NetworkWebSocketRequest, } from './transport.js';
50
50
  export type { Account, AddGroup, AddUser, Group, RemoveUser } from './users.js';
51
51
  export interface NetworkOptions {
@@ -65,9 +65,14 @@ export declare class SpawnError extends Error {
65
65
  readonly code: KernelErrno;
66
66
  constructor(code: KernelErrno);
67
67
  }
68
+ export declare class ChangedError extends SpawnError {
69
+ readonly notice: string;
70
+ constructor(notice: string);
71
+ }
68
72
  export interface SpawnGrant {
69
73
  cred: Cred;
70
74
  caller: Cred;
75
+ files?: Readonly<Record<string, string>>;
71
76
  }
72
77
  export type ChildSpawner = (req: ChildSpawnRequest, fds: FdTable, grant?: SpawnGrant) => Promise<ChildHandle>;
73
78
  export type ChildForker = (state: ForkState, fds: FdTable) => Promise<ChildHandle>;
@@ -335,6 +335,9 @@ export declare class Launcher {
335
335
  private interpreterChain;
336
336
  private commandFile;
337
337
  private trustedFiles;
338
+ private unchanged;
339
+ private pinOf;
340
+ private pinnedBytes;
338
341
  private grantedCwd;
339
342
  private binfmtManifests;
340
343
  private backing;
@@ -34,7 +34,7 @@ export type { ConnectorStamp } from './kernel/socket.js';
34
34
  export type { HostfsEvent, HostfsGrant, HostfsGrantHook, HostfsPortGrant, HostfsTransport, } from './mount/hostfs.js';
35
35
  export { serveHostfsPort } from './mount/hostfs.js';
36
36
  export type { MountEntry, MountSpec } from './mount/mount-fs.js';
37
- export type { ApproveHook, SudoAnswer, SudoApproval, SudoDenial, SudoReply, SudoRequest, SudoStdin, } from './sudo.js';
37
+ export type { ApproveHook, SudoAnswer, SudoApproval, SudoDenial, SudoFile, SudoReply, SudoRequest, SudoStdin, } from './sudo.js';
38
38
  export type { NetworkRedirectPolicy } from './transport.js';
39
39
  export { fetchTransport, type NetworkTransport } from './transport.js';
40
40
  export { memoryRoot };
@@ -6,6 +6,8 @@ export { SUDOERS, SUDOERS_D } from './sudoers.js';
6
6
  export declare const SECURE_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
7
7
  export declare const DEFAULT_SUDOERS = "%sudo Cmnd *\n";
8
8
  export declare const SUDO_TIMEOUT_MS = 300000;
9
+ export declare function changedText(file: string): string;
10
+ export declare function changedFile(approved: Readonly<Record<string, string>>, now: Readonly<Record<string, string>>): string | undefined;
9
11
  export interface SudoRequest {
10
12
  id: string;
11
13
  kind: 'sudo';
@@ -24,9 +26,14 @@ export interface SudoRequest {
24
26
  always: boolean;
25
27
  stdin?: SudoStdin;
26
28
  rootOnly?: Record<string, boolean>;
29
+ userWritable?: SudoFile[];
27
30
  validate?: true;
28
31
  timestamp?: true;
29
32
  }
33
+ export interface SudoFile {
34
+ path: string;
35
+ sha256: string;
36
+ }
30
37
  export type SudoStdin = 'tty' | 'none' | 'pipe' | 'file';
31
38
  export type SudoAnswer = 'once' | 'always' | 'deny';
32
39
  export interface SudoDenial {
@@ -54,6 +61,7 @@ export interface SudoGrant {
54
61
  cwd: string;
55
62
  cred: Cred;
56
63
  caller: Cred;
64
+ files: Record<string, string>;
57
65
  }
58
66
  export type SudoResult = {
59
67
  error: string;
@@ -125,7 +133,10 @@ export declare class Sudo {
125
133
  private lookup;
126
134
  private canonical;
127
135
  reachable(cred: Cred, cwd: string): Promise<boolean>;
128
- private untrusted;
136
+ real(file: string): Promise<string>;
137
+ digests(files: readonly string[]): Promise<Record<string, string>>;
138
+ private bound;
139
+ private writable;
129
140
  private locate;
130
141
  request(caller: SudoCaller, call: SudoCall, signal: AbortSignal): Promise<SudoResult>;
131
142
  private command;
@@ -1,7 +1,7 @@
1
1
  export declare const SUDOERS = "/etc/sudoers";
2
2
  export declare const SUDOERS_D = "/etc/sudoers.d";
3
3
  export declare const NAME: RegExp;
4
- export declare const KERNEL_SYNTAX = "[NOPASSWD] <user|%group|ALL> [(<target>)] [Cwd <dir>] [Stdin none] Cmnd <command\u2026|*>";
4
+ export declare const KERNEL_SYNTAX = "[NOPASSWD] <user|%group|ALL> [(<target>)] [Cwd <dir>] [Stdin none] [Sha256 <file>=<sha256>\u2026] Cmnd <command\u2026|*>";
5
5
  export declare const SUDOERS_SYNTAX = "<user|%group|ALL> ALL=[(<target>[,<target>\u2026])] [NOPASSWD:] <command\u2026|ALL>";
6
6
  export type Pattern = (string | null)[];
7
7
  export interface Command {
@@ -14,6 +14,7 @@ export interface Rule {
14
14
  target: string;
15
15
  cwd?: string;
16
16
  stdin?: 'none';
17
+ sha256?: Record<string, string>;
17
18
  cmnd: Command | '*';
18
19
  }
19
20
  export type TimestampType = 'tty' | 'ppid' | 'global';
@@ -45,6 +46,7 @@ export declare function splitWords(text: string): string[] | undefined;
45
46
  export declare function quoteWord(word: string): string;
46
47
  export declare function commandMatches(cmnd: Command | '*', argv: readonly string[]): boolean;
47
48
  export declare function commandText(cmnd: Command): string;
49
+ export declare function sha256Text(files: Readonly<Record<string, string>>): string;
48
50
  export declare function resolveDefaults(entries: readonly DefaultsEntry[], applies: (who: string) => boolean): Resolved;
49
51
  export declare function defaultsText(entries: readonly DefaultsEntry[]): string[];
50
52
  export declare function parseLine(line: string, file?: string): PolicyLine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.178.1",
3
+ "version": "1.178.2",
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",
@@ -70,9 +70,9 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@ai-ecoverse/py-numpy": "2.5.4-4",
73
- "@ai-ecoverse/slicc-cdp": "1.47.4",
73
+ "@ai-ecoverse/slicc-cdp": "1.47.5",
74
74
  "@ai-ecoverse/slicc-scrub": "1.1.0",
75
- "@ai-ecoverse/slicc-shared-web": "2.13.10",
75
+ "@ai-ecoverse/slicc-shared-web": "2.14.0",
76
76
  "@ai-ecoverse/wasi-cargo": "0.99.0-6",
77
77
  "@ai-ecoverse/wasi-pnpm": "12.9.1-21",
78
78
  "@ai-ecoverse/wasi-ripgrep": "15.2.0-5",