visualproof 0.9.0 → 0.11.0

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.
@@ -5,6 +5,7 @@
5
5
  import { spawnSync } from "node:child_process";
6
6
  import { accessSync, constants, existsSync, readFileSync, statSync } from "node:fs";
7
7
  import { filmPin } from "./film.js";
8
+ import { findClaude } from "./hosted.js";
8
9
  import { freemem, tmpdir, totalmem } from "node:os";
9
10
  import { dirname, join, relative, resolve } from "node:path";
10
11
  import { cacheHome, projectDirs, siteHolder } from "./dirs.js";
@@ -182,6 +183,13 @@ export function doctor(o) {
182
183
  if (exec("git", ["--version"]) === null) {
183
184
  checks.push({ level: "info", what: "git not found: builds are kept without their commit, and past sources only as the builds kept them; a branch cannot be followed (serve <git URL>)" });
184
185
  }
186
+ // the server's own agent (--claude-oauth, AgentSpec decision 10): Claude Code, and how to give it
187
+ // its token
188
+ const claude = findClaude();
189
+ const claudeVersion = exec(o.run ? "claude" : (claude ?? "claude"), ["--version"]);
190
+ checks.push(claudeVersion
191
+ ? { level: "ok", what: `Claude Code ${claudeVersion.trim().split(/\s/)[0]} (for --claude-oauth, the server's own agent: claude setup-token prints its token; put it alone in a file, chmod 600, and give --claude-oauth <file>, or --claude-oauth env with CLAUDE_CODE_OAUTH_TOKEN set)` }
192
+ : { level: "info", what: "Claude Code (claude) not found: needed only for --claude-oauth (the server's own agent)", fix: "npm install -g @anthropic-ai/claude-code, then claude setup-token: its token alone in a file (chmod 600), and serve … --claude-oauth <file>" });
185
193
  const film = filmLine(o.cache ? resolve(o.cache) : cacheHome(), o.updates ?? process.env.VISUALPROOF_UPDATES);
186
194
  const updates = updatesLine(exec, node, o.fromPackage ?? FROM_PACKAGE, o.cache ? resolve(o.cache) : cacheHome(), o.updates ?? process.env.VISUALPROOF_UPDATES, o.path === null ? null : projectDirs(resolve(o.path), o.site, o.cache).site);
187
195
  if (o.path === null)