@ai-ecoverse/slicc-kernel 1.174.0 → 1.174.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.
@@ -1,8 +1,7 @@
1
1
  import type { KernelFs, UsersMode } from './fs/types.js';
2
2
  import type { Cred } from './kernel/cred.js';
3
3
  import { type UserDb } from './users.js';
4
- export declare const SUDOERS = "/etc/sudoers";
5
- export declare const SUDOERS_D = "/etc/sudoers.d";
4
+ export { SUDOERS, SUDOERS_D } from './sudoers.js';
6
5
  export declare const SECURE_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
7
6
  export declare const DEFAULT_SUDOERS = "%sudo Cmnd *\n";
8
7
  export declare const SUDO_TIMEOUT_MS = 300000;
@@ -65,20 +64,20 @@ export interface SudoCaller {
65
64
  tags?: readonly string[] | undefined;
66
65
  tty?: string | null | undefined;
67
66
  stdin: SudoStdin;
67
+ report?: ((line: string) => Promise<void>) | undefined;
68
68
  }
69
- type Pattern = (string | null)[];
70
- interface Command {
71
- path: string;
72
- args?: Pattern[];
69
+ export interface VisudoCall {
70
+ op: 'proc-visudo';
71
+ files?: {
72
+ name: string;
73
+ text: string;
74
+ }[];
73
75
  }
74
- interface Rule {
75
- nopasswd: boolean;
76
- who: string;
77
- target: string;
78
- cwd?: string;
79
- stdin?: 'none';
80
- cmnd: Command | '*';
76
+ export interface VisudoResult {
77
+ lines: [1 | 2, string][];
78
+ ok: boolean;
81
79
  }
80
+ export declare function visudoCall(req: Partial<VisudoCall>): VisudoCall | undefined;
82
81
  export interface SudoOptions {
83
82
  fs: KernelFs;
84
83
  users: UserDb;
@@ -91,9 +90,6 @@ export interface SudoOptions {
91
90
  timeoutMs?: number | undefined;
92
91
  warn?: (message: string) => void;
93
92
  }
94
- export declare function splitWords(text: string): string[] | undefined;
95
- export declare function quoteWord(word: string): string;
96
- export declare function parseRule(line: string): Rule | null | undefined;
97
93
  export declare class Sudo {
98
94
  private readonly o;
99
95
  private readonly warned;
@@ -108,6 +104,8 @@ export declare class Sudo {
108
104
  private existing;
109
105
  private policyFile;
110
106
  private policy;
107
+ private policyRules;
108
+ check(cred: Cred, call: VisudoCall): Promise<VisudoResult>;
111
109
  private groupIds;
112
110
  private applies;
113
111
  private lookup;
@@ -122,4 +120,3 @@ export declare class Sudo {
122
120
  private remember;
123
121
  private grant;
124
122
  }
125
- export {};
@@ -0,0 +1,37 @@
1
+ export declare const SUDOERS = "/etc/sudoers";
2
+ export declare const SUDOERS_D = "/etc/sudoers.d";
3
+ export declare const NAME: RegExp;
4
+ export declare const KERNEL_SYNTAX = "[NOPASSWD] <user|%group|ALL> [(<target>)] [Cwd <dir>] [Stdin none] Cmnd <command\u2026|*>";
5
+ export declare const SUDOERS_SYNTAX = "<user|%group|ALL> ALL=[(<target>[,<target>\u2026])] [NOPASSWD:] <command\u2026|ALL>";
6
+ export type Pattern = (string | null)[];
7
+ export interface Command {
8
+ path: string;
9
+ args?: Pattern[];
10
+ }
11
+ export interface Rule {
12
+ nopasswd: boolean;
13
+ who: string;
14
+ target: string;
15
+ cwd?: string;
16
+ stdin?: 'none';
17
+ cmnd: Command | '*';
18
+ }
19
+ export type PolicyLine = {
20
+ rules: Rule[];
21
+ } | {
22
+ error: string;
23
+ } | null;
24
+ export declare function hasControl(text: string): boolean;
25
+ export declare function splitWords(text: string): string[] | undefined;
26
+ export declare function quoteWord(word: string): string;
27
+ export declare function commandMatches(cmnd: Command | '*', argv: readonly string[]): boolean;
28
+ export declare function commandText(cmnd: Command): string;
29
+ export declare function parseLine(line: string, file?: string): PolicyLine;
30
+ export interface PolicyError {
31
+ line: number;
32
+ message: string;
33
+ }
34
+ export declare function parsePolicy(text: string, file?: string): {
35
+ rules: Rule[];
36
+ errors: PolicyError[];
37
+ };
@@ -0,0 +1,11 @@
1
+ export declare const MINUTE_MS = 60000;
2
+ export interface Zone {
3
+ readonly name: string;
4
+ offset(at: number): number;
5
+ }
6
+ export declare function canonicalZone(name: unknown): string | undefined;
7
+ export declare function hostTimeZone(): string;
8
+ export declare function systemTimeZone(given: string | undefined, fallback?: string): string;
9
+ export declare const utcZone: Zone;
10
+ export declare function zoneOf(name: string): Zone;
11
+ export declare const MAX_SHIFT_MS: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.174.0",
3
+ "version": "1.174.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,7 +70,7 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@ai-ecoverse/py-numpy": "2.5.4-4",
73
- "@ai-ecoverse/slicc-cdp": "1.45.0",
73
+ "@ai-ecoverse/slicc-cdp": "1.46.2",
74
74
  "@ai-ecoverse/slicc-scrub": "1.1.0",
75
75
  "@ai-ecoverse/slicc-shared-web": "2.13.10",
76
76
  "@ai-ecoverse/wasi-cargo": "0.99.0-6",
@@ -89,11 +89,11 @@
89
89
  "@ai-ecoverse/wasm-tar": "1.35.0-9",
90
90
  "@ai-ecoverse/wasm-tls-engine": "4.2.0-12",
91
91
  "@ai-ecoverse/wasm-util-linux": "2.42.4-7",
92
- "@biomejs/biome": "2.6.3",
93
- "@types/node": "26.6.5",
92
+ "@biomejs/biome": "2.6.4",
93
+ "@types/node": "26.6.6",
94
94
  "acorn": "8.19.0",
95
95
  "esbuild": "0.28.2",
96
- "fake-indexeddb": "6.2.6",
96
+ "fake-indexeddb": "6.2.7",
97
97
  "lefthook": "2.2.2",
98
98
  "monocart-coverage-reports": "3.2.0",
99
99
  "pg-gateway": "0.3.0-beta.4",