@ai-ecoverse/slicc-kernel 1.8.10 → 1.8.12
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/dist/kernel-worker.js +7 -0
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +83 -13
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +7 -0
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +83 -13
- package/dist/process-worker.js.map +3 -3
- package/package.json +3 -3
package/dist/node.js
CHANGED
|
@@ -1379,6 +1379,11 @@ function statJson(s) {
|
|
|
1379
1379
|
async function readdirStat(fs, dir) {
|
|
1380
1380
|
return (await fs.readdirStat(dir)).map(([name2, stat]) => [name2, stat && statJson(stat)]);
|
|
1381
1381
|
}
|
|
1382
|
+
async function storageUsage() {
|
|
1383
|
+
const estimate = await globalThis.navigator?.storage?.estimate?.();
|
|
1384
|
+
if (typeof estimate?.quota !== "number") return null;
|
|
1385
|
+
return { quota: estimate.quota, usage: estimate.usage ?? 0 };
|
|
1386
|
+
}
|
|
1382
1387
|
var done = { ok: true, kind: "void" };
|
|
1383
1388
|
function json(value) {
|
|
1384
1389
|
return { ok: true, kind: "json", json: value };
|
|
@@ -1429,6 +1434,8 @@ async function run(fs, path, req, cwd) {
|
|
|
1429
1434
|
case "utimes":
|
|
1430
1435
|
await fs.utimes(path, new Date(req.atimeMs ?? 0), new Date(req.mtimeMs ?? 0));
|
|
1431
1436
|
return done;
|
|
1437
|
+
case "statfs":
|
|
1438
|
+
return json(await storageUsage());
|
|
1432
1439
|
default:
|
|
1433
1440
|
return { ok: false, errno: "EINVAL", message: `sync-fs: unknown op '${req.op}'` };
|
|
1434
1441
|
}
|