@officexapp/vidfarm-devcli 0.21.55 → 0.21.56

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.
@@ -7,7 +7,7 @@
7
7
  // else prints as ⚠/✗ but does not fail the command, so agents can run doctor
8
8
  // unconditionally at session start.
9
9
  import { spawnSync } from "node:child_process";
10
- import { existsSync, readdirSync } from "node:fs";
10
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
11
11
  import { createRequire } from "node:module";
12
12
  import net from "node:net";
13
13
  import { homedir } from "node:os";
@@ -143,6 +143,28 @@ export async function runDoctorCommand(argv) {
143
143
  const killOrphans = Boolean(parsed.values["kill-orphans"]);
144
144
  const checks = [];
145
145
  const add = (name, level, detail) => checks.push({ name, level, detail });
146
+ // 0. Are the two halves current, and are they the SAME version? The skill and
147
+ // the devcli ship on one semver, and a gap between them is the usual cause of
148
+ // "that command doesn't exist" — so it belongs in the health check, not only
149
+ // in the update runbook. Never fails the doctor: offline is not a defect, and
150
+ // a pending update is information, not breakage.
151
+ try {
152
+ const { installedDevcliVersion, installedSkillPath, readSkillVersion, compareSemver, readUpdateState, hoursSinceLastCheck } = await import("./update-check.js");
153
+ const devcli = installedDevcliVersion();
154
+ const skillPath = installedSkillPath();
155
+ const skill = skillPath ? readSkillVersion(readFileSync(skillPath, "utf8")) : null;
156
+ const since = hoursSinceLastCheck(readUpdateState());
157
+ const staleNote = since === null ? " · never checked for updates" : since >= 24 ? ` · last update check ${Math.round(since / 24)}d ago` : "";
158
+ if (devcli && skill && compareSemver(devcli, skill) !== 0) {
159
+ add("versions", "warn", `devcli ${devcli} vs skill ${skill} — MISMATCHED. They ship together; run: vidfarm update-check`);
160
+ }
161
+ else {
162
+ add("versions", since !== null && since < 24 ? "ok" : "warn", `devcli ${devcli ?? "?"} · skill ${skill ?? "not installed"}${staleNote}${staleNote ? " — vidfarm update-check" : ""}`);
163
+ }
164
+ }
165
+ catch {
166
+ // A version probe must never take the doctor down with it.
167
+ }
146
168
  // 1. Node version.
147
169
  const nodeMajor = Number(process.versions.node.split(".")[0]);
148
170
  add("node", nodeMajor >= 22 ? "ok" : "fail", `v${process.versions.node}${nodeMajor >= 22 ? "" : " — vidfarm-devcli needs Node >= 22"}`);