@geravant/sinain 1.15.0 → 1.15.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/cli.js +8 -0
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ import os from "os";
|
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { writeAgentsConfig } from "./config-shared.js";
|
|
8
|
+
import { checkForUpdate } from "./self-update.js";
|
|
8
9
|
|
|
9
10
|
const cmd = process.argv[2];
|
|
10
11
|
const IS_WINDOWS = os.platform() === "win32";
|
|
@@ -12,6 +13,13 @@ const HOME = os.homedir();
|
|
|
12
13
|
const SINAIN_DIR = path.join(HOME, ".sinain");
|
|
13
14
|
const PKG_DIR = path.dirname(new URL(import.meta.url).pathname);
|
|
14
15
|
|
|
16
|
+
// Self-update sentinel — query the npm registry, and if a newer version
|
|
17
|
+
// of @geravant/sinain is available, re-exec via `npx --ignore-existing`
|
|
18
|
+
// before doing anything else. Adds ~500ms startup but kills the
|
|
19
|
+
// "stale npx cache silently serves 1.6.x" class of bugs permanently.
|
|
20
|
+
// See self-update.js for details + opt-out env var.
|
|
21
|
+
await checkForUpdate();
|
|
22
|
+
|
|
15
23
|
switch (cmd) {
|
|
16
24
|
case "start":
|
|
17
25
|
await import("./launcher.js");
|