@ai-ecoverse/slicc-kernel 1.109.0 → 1.110.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.
- package/README.md +21 -3
- package/dist/kernel-worker.js +100 -15
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +101 -15
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +1 -1
- package/dist/types/commands.d.ts +6 -0
- package/dist/types/cron/command.d.ts +1 -1
- package/dist/types/fs/opfs.d.ts +5 -0
- package/dist/types/launcher.d.ts +2 -1
- package/package.json +1 -6
package/dist/process-worker.js
CHANGED
|
@@ -2515,7 +2515,7 @@ var KERNEL_VERSION, OS_RELEASE;
|
|
|
2515
2515
|
var init_version = __esm({
|
|
2516
2516
|
"src/version.ts"() {
|
|
2517
2517
|
"use strict";
|
|
2518
|
-
KERNEL_VERSION = true ? "1.
|
|
2518
|
+
KERNEL_VERSION = true ? "1.110.1" : "0.0.0-dev";
|
|
2519
2519
|
OS_RELEASE = "6.0.0-slicc";
|
|
2520
2520
|
}
|
|
2521
2521
|
});
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface Command {
|
|
|
17
17
|
imports?: string;
|
|
18
18
|
refused?: string;
|
|
19
19
|
shows?: string;
|
|
20
|
+
variants?: CommandVariant[];
|
|
21
|
+
}
|
|
22
|
+
export interface CommandVariant {
|
|
23
|
+
env: Record<string, string>;
|
|
24
|
+
wasm: string;
|
|
20
25
|
}
|
|
21
26
|
interface Manifest {
|
|
22
27
|
name?: unknown;
|
|
@@ -32,6 +37,7 @@ interface Manifest {
|
|
|
32
37
|
replaces?: unknown;
|
|
33
38
|
};
|
|
34
39
|
}
|
|
40
|
+
export declare function variantFor(variants: readonly CommandVariant[] | undefined, env: Record<string, string>): string | undefined;
|
|
35
41
|
export declare function commandsOf(pkg: string, manifest: Manifest): Command[];
|
|
36
42
|
export declare function pnpmGlobalRoots(fs: KernelFs, home: string): Promise<string[]>;
|
|
37
43
|
export declare function engineRefusal(manifest: Manifest, kernel: string): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Command } from '../commands.js';
|
|
2
2
|
export declare const CRONTAB_PATH = "/usr/bin/crontab";
|
|
3
3
|
export declare const CRONTAB_COMMAND: Command;
|
|
4
|
-
export declare const CRONTAB_SOURCE = "export default async function crontab(ctx) {\n const say = (fd, text) => ctx.write(fd, text).catch(() => undefined);\n const usage = async () => {\n await say(2, \"usage: crontab [-u user] { -l | -r | -e | file | - }\\n\");\n return 1;\n };\n const args = ctx.argv.slice(1);\n let user;\n let action;\n let file;\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === \"-u\") {\n user = args[++i];\n if (user === undefined) return usage();\n } else if (arg === \"-l\" || arg === \"-r\" || arg === \"-e\") {\n if (action !== undefined) return usage();\n action = arg.slice(1);\n } else if (arg === \"-\" || !arg.startsWith(\"-\")) {\n if (file !== undefined) return usage();\n file = arg;\n } else return usage();\n }\n if ((action === undefined) === (file === undefined)) return usage();\n const call = (c) => ctx.crontab(user === undefined ? c : { ...c, user });\n const failed = async (answer) => {\n await say(2, answer.error + \"\\n\");\n return 1;\n };\n const decode = (bytes) => new TextDecoder().decode(bytes);\n if (action === \"l\") {\n const answer = await call({ action: \"list\" });\n if (answer.error !== undefined) return failed(answer);\n await say(1, answer.text);\n return 0;\n }\n if (action === \"r\") {\n const answer = await call({ action: \"remove\" });\n return answer.error !== undefined ? failed(answer) : 0;\n }\n if (action === \"e\") return edit();\n let text;\n try {\n if (file === \"-\") {\n const parts = [];\n for (;;) {\n const chunk = await ctx.read(0);\n if (chunk.length === 0) break;\n parts.push(decode(chunk));\n }\n text = parts.join(\"\");\n } else text = decode(await ctx.fs.readFile(ctx.resolve(file)));\n } catch (err) {\n await say(2, \"crontab: \" + file + \": \" + (err && err.code ? err.code : String(err)) + \"\\n\");\n return 1;\n }\n const answer = await call({ action: \"install\", text });\n return answer.error !== undefined ? failed(answer) : 0;\n\n async function edit() {\n const editor = ctx.env.VISUAL || ctx.env.EDITOR;\n if (!editor) {\n await say(2, \"crontab: set VISUAL or EDITOR to edit, or install a file with crontab <file>\\n\");\n return 1;\n }\n const current = await call({ action: \"list\" });\n const before = current.error === undefined ? current.text : \"\";\n if (current.error !== undefined && !current.error.startsWith(\"no crontab for \")) return failed(current);\n const tmp = \"/tmp/crontab.\" + ctx.pid + \".\" + crypto.randomUUID();\n try {\n const file = await ctx.open(tmp, { write: true, create: true, exclusive: true, mode: 0o600 });\n await file.write(0, new TextEncoder().encode(before));\n await file.close();\n } catch (err) {\n await say(2, \"crontab: \" + tmp + \": \" + (err && err.code ? err.code : String(err)) + \"\\n\");\n return 1;\n }\n const child = await ctx.spawn({ argv: [\"/bin/bash\", \"-c\", editor + ' \"$1\"', \"crontab\", tmp] });\n const ended = await ctx.wait(child.pid);\n if (ended.status !== 0) {\n await say(2, \"crontab: the editor exited with status \" + ended.status + \", crontab not changed\\n\");\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 1;\n }\n const after = decode(await ctx.fs.readFile(tmp));\n if (after === before) {\n await say(2, \"crontab: no changes made to crontab\\n\");\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 0;\n }\n const answer = await call({ action: \"install\", text: after });\n if (answer.error !== undefined) {\n await say(2, answer.error + \"\\ncrontab: your edit is kept in \" + tmp + \"\\n\");\n return 1;\n }\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 0;\n }\n}\n";
|
|
4
|
+
export declare const CRONTAB_SOURCE = "export default async function crontab(ctx) {\n const say = (fd, text) => ctx.write(fd, text).catch(() => undefined);\n const usage = async () => {\n await say(2, \"usage: crontab [-u user] { -l | -r | -e | file | - }\\n\");\n return 1;\n };\n const args = ctx.argv.slice(1);\n let user;\n let action;\n let file;\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === \"-u\") {\n user = args[++i];\n if (user === undefined) return usage();\n } else if (arg === \"-l\" || arg === \"-r\" || arg === \"-e\") {\n if (action !== undefined) return usage();\n action = arg.slice(1);\n } else if (arg === \"-\" || !arg.startsWith(\"-\")) {\n if (file !== undefined) return usage();\n file = arg;\n } else return usage();\n }\n if ((action === undefined) === (file === undefined)) return usage();\n const call = (c) => ctx.crontab(user === undefined ? c : { ...c, user });\n const failed = async (answer) => {\n await say(2, answer.error + \"\\n\");\n return 1;\n };\n const decode = (bytes) => new TextDecoder().decode(bytes);\n if (action === \"l\") {\n const answer = await call({ action: \"list\" });\n if (answer.error !== undefined) return failed(answer);\n await say(1, answer.text);\n return 0;\n }\n if (action === \"r\") {\n const answer = await call({ action: \"remove\" });\n return answer.error !== undefined ? failed(answer) : 0;\n }\n if (action === \"e\") return edit();\n let text;\n try {\n if (file === \"-\") {\n const stream = new TextDecoder();\n const parts = [];\n for (;;) {\n const chunk = await ctx.read(0);\n if (chunk.length === 0) break;\n parts.push(stream.decode(chunk, { stream: true }));\n }\n text = parts.join(\"\") + stream.decode();\n } else text = decode(await ctx.fs.readFile(ctx.resolve(file)));\n } catch (err) {\n await say(2, \"crontab: \" + file + \": \" + (err && err.code ? err.code : String(err)) + \"\\n\");\n return 1;\n }\n const answer = await call({ action: \"install\", text });\n return answer.error !== undefined ? failed(answer) : 0;\n\n async function edit() {\n const editor = ctx.env.VISUAL || ctx.env.EDITOR;\n if (!editor) {\n await say(2, \"crontab: set VISUAL or EDITOR to edit, or install a file with crontab <file>\\n\");\n return 1;\n }\n const current = await call({ action: \"list\" });\n const before = current.error === undefined ? current.text : \"\";\n if (current.error !== undefined && !current.error.startsWith(\"no crontab for \")) return failed(current);\n const tmp = \"/tmp/crontab.\" + ctx.pid + \".\" + crypto.randomUUID();\n try {\n const file = await ctx.open(tmp, { write: true, create: true, exclusive: true, mode: 0o600 });\n await file.write(0, new TextEncoder().encode(before));\n await file.close();\n } catch (err) {\n await say(2, \"crontab: \" + tmp + \": \" + (err && err.code ? err.code : String(err)) + \"\\n\");\n return 1;\n }\n const child = await ctx.spawn({ argv: [\"/bin/bash\", \"-c\", editor + ' \"$1\"', \"crontab\", tmp] });\n const ended = await ctx.wait(child.pid);\n if (ended.status !== 0) {\n await say(2, \"crontab: the editor exited with status \" + ended.status + \", crontab not changed\\n\");\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 1;\n }\n const after = decode(await ctx.fs.readFile(tmp));\n if (after === before) {\n await say(2, \"crontab: no changes made to crontab\\n\");\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 0;\n }\n const answer = await call({ action: \"install\", text: after });\n if (answer.error !== undefined) {\n await say(2, answer.error + \"\\ncrontab: your edit is kept in \" + tmp + \"\\n\");\n return 1;\n }\n await ctx.fs.rm(tmp).catch(() => undefined);\n return 0;\n }\n}\n";
|
package/dist/types/fs/opfs.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export declare class OpfsFs implements KernelFs {
|
|
|
14
14
|
private readonly root;
|
|
15
15
|
private readonly meta;
|
|
16
16
|
private readonly dirs;
|
|
17
|
+
private readonly files;
|
|
18
|
+
private readonly snapshots;
|
|
19
|
+
private readonly found;
|
|
17
20
|
private readonly checked;
|
|
18
21
|
private readonly channel;
|
|
19
22
|
private readonly remote;
|
|
@@ -60,6 +63,7 @@ export declare class OpfsFs implements KernelFs {
|
|
|
60
63
|
private dir;
|
|
61
64
|
private current;
|
|
62
65
|
private forget;
|
|
66
|
+
private remember;
|
|
63
67
|
private inDir;
|
|
64
68
|
private child;
|
|
65
69
|
private parent;
|
|
@@ -82,6 +86,7 @@ export declare class OpfsFs implements KernelFs {
|
|
|
82
86
|
private readonly flushing;
|
|
83
87
|
private touch;
|
|
84
88
|
private flushDirTimes;
|
|
89
|
+
private snapshot;
|
|
85
90
|
private statOf;
|
|
86
91
|
private linkStat;
|
|
87
92
|
private describe;
|
package/dist/types/launcher.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CdpHosts } from './cdp/hosts.js';
|
|
2
2
|
import type { CdpHook } from './cdp/types.js';
|
|
3
|
-
import { type Abi, type Command } from './commands.js';
|
|
3
|
+
import { type Abi, type Command, type CommandVariant } from './commands.js';
|
|
4
4
|
import type { CronClock } from './cron/clock.js';
|
|
5
5
|
import { CronService } from './cron/service.js';
|
|
6
6
|
import { FacadeHosts } from './facade/hosts.js';
|
|
@@ -129,6 +129,7 @@ interface Target {
|
|
|
129
129
|
imports?: string;
|
|
130
130
|
preopenRoot?: boolean;
|
|
131
131
|
asked?: string;
|
|
132
|
+
variants?: readonly CommandVariant[];
|
|
132
133
|
}
|
|
133
134
|
export declare function tagOption(tag: unknown): void;
|
|
134
135
|
export declare function expandDefaults(defaults: Readonly<Record<string, string>> | undefined, env: Readonly<Record<string, string>>): Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-kernel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.110.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",
|
|
@@ -93,10 +93,5 @@
|
|
|
93
93
|
"semantic-release": "25.0.9",
|
|
94
94
|
"typescript": "7.0.2",
|
|
95
95
|
"wabt": "1.0.39"
|
|
96
|
-
},
|
|
97
|
-
"overrides": {
|
|
98
|
-
"@ai-ecoverse/py-numpy": {
|
|
99
|
-
"@ai-ecoverse/wasix-python": "$@ai-ecoverse/wasix-python"
|
|
100
|
-
}
|
|
101
96
|
}
|
|
102
97
|
}
|