@kynver-app/runtime 0.1.9 → 0.1.10
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/cli.js +6 -6
- package/dist/cli.js.map +3 -3
- package/dist/index.js +6 -6
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -381,12 +381,12 @@ var DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
|
|
|
381
381
|
var DEFAULT_MAX_USED_PERCENT = 80;
|
|
382
382
|
var DEFAULT_HARD_MAX_USED_PERCENT = 90;
|
|
383
383
|
function observeRunnerDiskGate(input = {}) {
|
|
384
|
-
const
|
|
384
|
+
const path14 = input.diskPath?.trim() || "/";
|
|
385
385
|
const warnBelowBytes = input.diskFreeWarnBytes ?? DEFAULT_WARN_FREE_BYTES;
|
|
386
386
|
const criticalBelowBytes = input.diskFreeCriticalBytes ?? DEFAULT_CRITICAL_FREE_BYTES;
|
|
387
387
|
const maxUsedPercent = input.diskMaxUsedPercent ?? DEFAULT_MAX_USED_PERCENT;
|
|
388
388
|
const hardMaxUsedPercent = input.diskHardMaxUsedPercent ?? DEFAULT_HARD_MAX_USED_PERCENT;
|
|
389
|
-
const stats = statfsSync(
|
|
389
|
+
const stats = statfsSync(path14);
|
|
390
390
|
const freeBytes = Number(stats.bavail) * Number(stats.bsize);
|
|
391
391
|
const totalBytes = Number(stats.blocks) * Number(stats.bsize);
|
|
392
392
|
const usedPercent = totalBytes > 0 ? (totalBytes - freeBytes) / totalBytes * 100 : 100;
|
|
@@ -406,7 +406,7 @@ function observeRunnerDiskGate(input = {}) {
|
|
|
406
406
|
}
|
|
407
407
|
return {
|
|
408
408
|
ok,
|
|
409
|
-
path:
|
|
409
|
+
path: path14,
|
|
410
410
|
freeBytes,
|
|
411
411
|
totalBytes,
|
|
412
412
|
usedPercent,
|
|
@@ -1517,8 +1517,7 @@ function stopWorker(args) {
|
|
|
1517
1517
|
}
|
|
1518
1518
|
|
|
1519
1519
|
// src/cli.ts
|
|
1520
|
-
import { mkdirSync as mkdirSync5 } from "node:fs";
|
|
1521
|
-
import path14 from "node:path";
|
|
1520
|
+
import { mkdirSync as mkdirSync5, realpathSync } from "node:fs";
|
|
1522
1521
|
import { fileURLToPath } from "node:url";
|
|
1523
1522
|
|
|
1524
1523
|
// src/pipeline-tick.ts
|
|
@@ -1861,6 +1860,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
1861
1860
|
} else {
|
|
1862
1861
|
rest = argv;
|
|
1863
1862
|
}
|
|
1863
|
+
if (action && isHelpFlag(action) || rest.some(isHelpFlag)) return usage(0);
|
|
1864
1864
|
const args = parseArgs(rest);
|
|
1865
1865
|
const { runsDir, worktreesDir } = getPaths();
|
|
1866
1866
|
mkdirSync5(runsDir, { recursive: true });
|
|
@@ -1883,7 +1883,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
1883
1883
|
if (scope === "worker" && action === "complete") return void await completeWorker(args);
|
|
1884
1884
|
unknownCommand(scope, action);
|
|
1885
1885
|
}
|
|
1886
|
-
var isCliEntry = process.argv[1] &&
|
|
1886
|
+
var isCliEntry = process.argv[1] && realpathSync.native(process.argv[1]) === realpathSync.native(fileURLToPath(import.meta.url));
|
|
1887
1887
|
if (isCliEntry) {
|
|
1888
1888
|
void main().catch((error) => {
|
|
1889
1889
|
console.error(error);
|