@jbkjr/relay 0.0.0-stage → 1.2.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/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +201 -0
- package/LICENSES/README.md +19 -0
- package/LICENSES/codex-NOTICE.txt +6 -0
- package/README.md +386 -2
- package/SECURITY.md +145 -0
- package/adapters/briefs/claude.md +43 -0
- package/adapters/briefs/codex.md +56 -0
- package/adapters/briefs/models.json +33 -0
- package/adapters/build.mjs +8 -0
- package/adapters/claude/.claude-plugin/marketplace.json +13 -0
- package/adapters/claude/relay/.claude-plugin/plugin.json +5 -0
- package/adapters/claude/relay/agents/codex.md +21 -0
- package/adapters/claude/relay/agents/operator.md +21 -0
- package/adapters/claude/relay/skills/ask/SKILL.md +20 -0
- package/adapters/claude/relay/skills/chat/SKILL.md +13 -0
- package/adapters/claude/relay/skills/delegate/SKILL.md +21 -0
- package/adapters/claude/relay/skills/discuss/SKILL.md +19 -0
- package/adapters/claude/relay/skills/review/SKILL.md +21 -0
- package/adapters/claude/relay/skills/tree/SKILL.md +10 -0
- package/adapters/claude/relay/skills/write-for-codex/SKILL.md +78 -0
- package/adapters/codex/.agents/plugins/marketplace.json +20 -0
- package/adapters/codex/AGENTS.snippet.md +5 -0
- package/adapters/codex/relay/.codex-plugin/plugin.json +6 -0
- package/adapters/codex/relay/skills/relay-ask/SKILL.md +20 -0
- package/adapters/codex/relay/skills/relay-chat/SKILL.md +13 -0
- package/adapters/codex/relay/skills/relay-delegate/SKILL.md +21 -0
- package/adapters/codex/relay/skills/relay-discuss/SKILL.md +19 -0
- package/adapters/codex/relay/skills/relay-review/SKILL.md +21 -0
- package/adapters/codex/relay/skills/relay-tree/SKILL.md +10 -0
- package/adapters/codex/relay/skills/relay-write-for-claude/SKILL.md +66 -0
- package/adapters/generate.mjs +124 -0
- package/bin/relay +59 -0
- package/codex-pin.json +12 -0
- package/dist/backends/acp.js +1424 -0
- package/dist/backends/claude.js +890 -0
- package/dist/backends/cli-version.js +112 -0
- package/dist/backends/codex-app.js +1525 -0
- package/dist/backends/codex-daybreak.js +75 -0
- package/dist/backends/codex-env.js +656 -0
- package/dist/backends/codex-network.js +304 -0
- package/dist/backends/codex-pin.js +320 -0
- package/dist/backends/codex-shell-policy.js +182 -0
- package/dist/backends/codex-stage2.js +998 -0
- package/dist/backends/codex-subagents.js +47 -0
- package/dist/backends/codex.js +637 -0
- package/dist/backends/copilot.js +246 -0
- package/dist/backends/env.js +147 -0
- package/dist/backends/gemini.js +607 -0
- package/dist/backends/grok.js +337 -0
- package/dist/backends/index.js +8 -0
- package/dist/backends/native-temp.js +187 -0
- package/dist/backends/never-admission.js +90 -0
- package/dist/backends/run.js +67 -0
- package/dist/backends/stream.js +230 -0
- package/dist/backends/tool-discovery.js +15 -0
- package/dist/backends/types.js +264 -0
- package/dist/build-info.json +5 -0
- package/dist/cli.js +344 -0
- package/dist/confine/bridge.js +113 -0
- package/dist/confine/broker-core.js +76 -0
- package/dist/confine/broker-http.js +650 -0
- package/dist/confine/broker-names.js +9 -0
- package/dist/confine/broker.js +258 -0
- package/dist/confine/canary.js +380 -0
- package/dist/confine/diagnostics.js +122 -0
- package/dist/confine/gemini-tools-main.js +8 -0
- package/dist/confine/gemini-tools.js +181 -0
- package/dist/confine/hardlinks.js +58 -0
- package/dist/confine/harness-config.js +16 -0
- package/dist/confine/index.js +117 -0
- package/dist/confine/leases.js +217 -0
- package/dist/confine/paths.js +6 -0
- package/dist/confine/peer.js +115 -0
- package/dist/confine/port-policy.js +8 -0
- package/dist/confine/ports.js +365 -0
- package/dist/confine/private-root.js +208 -0
- package/dist/confine/probe-stage2.js +501 -0
- package/dist/confine/probe.js +1109 -0
- package/dist/confine/proxy.js +783 -0
- package/dist/confine/sbcheck.js +208 -0
- package/dist/confine/seatbelt-never.js +41 -0
- package/dist/confine/seatbelt-stage2.js +139 -0
- package/dist/confine/seatbelt.js +1129 -0
- package/dist/confine/sockets.js +36 -0
- package/dist/confine/turn-probe.js +19 -0
- package/dist/confine/turn.js +86 -0
- package/dist/core/adoption.js +124 -0
- package/dist/core/api-keys.js +423 -0
- package/dist/core/approvals.js +740 -0
- package/dist/core/build-identity.js +248 -0
- package/dist/core/caller.js +749 -0
- package/dist/core/calls.js +102 -0
- package/dist/core/claude-settings.js +1045 -0
- package/dist/core/config.js +453 -0
- package/dist/core/context.js +186 -0
- package/dist/core/db.js +753 -0
- package/dist/core/dispatch.js +110 -0
- package/dist/core/env-broker.js +505 -0
- package/dist/core/env-policy.js +182 -0
- package/dist/core/escalation-authority.js +76 -0
- package/dist/core/escalation-contract.js +13 -0
- package/dist/core/escalation-person-path.js +131 -0
- package/dist/core/escalation-policy.js +79 -0
- package/dist/core/escalation-runtime.js +135 -0
- package/dist/core/escalation-state.js +42 -0
- package/dist/core/escalations.js +191 -0
- package/dist/core/events.js +235 -0
- package/dist/core/executables.js +147 -0
- package/dist/core/extensions.js +645 -0
- package/dist/core/families.js +204 -0
- package/dist/core/git.js +657 -0
- package/dist/core/identity.js +113 -0
- package/dist/core/liveness.js +68 -0
- package/dist/core/mediated-network-provider.js +81 -0
- package/dist/core/never-checkpoint.js +76 -0
- package/dist/core/never-coverage.js +97 -0
- package/dist/core/never-network.js +49 -0
- package/dist/core/never-policy.js +302 -0
- package/dist/core/never-proxy-policy.js +109 -0
- package/dist/core/never-schema.js +61 -0
- package/dist/core/never-tools.js +56 -0
- package/dist/core/notices.js +48 -0
- package/dist/core/ops.js +959 -0
- package/dist/core/outcome.js +224 -0
- package/dist/core/params.js +32 -0
- package/dist/core/presence.js +174 -0
- package/dist/core/procs.js +546 -0
- package/dist/core/prompts.js +363 -0
- package/dist/core/protected-config.js +238 -0
- package/dist/core/raw-network.js +192 -0
- package/dist/core/redact.js +152 -0
- package/dist/core/refusal.js +33 -0
- package/dist/core/relay-command.js +310 -0
- package/dist/core/reported.js +3 -0
- package/dist/core/restart-overlay.js +651 -0
- package/dist/core/retention.js +1135 -0
- package/dist/core/secrets.js +329 -0
- package/dist/core/session-token.js +175 -0
- package/dist/core/session.js +744 -0
- package/dist/core/shell.js +2 -0
- package/dist/core/shipped-pin.js +47 -0
- package/dist/core/shown.js +42 -0
- package/dist/core/slots.js +67 -0
- package/dist/core/stage2-executors.js +453 -0
- package/dist/core/stage2-switch.js +5 -0
- package/dist/core/steering.js +149 -0
- package/dist/core/storage.js +358 -0
- package/dist/core/toml.js +175 -0
- package/dist/core/views.js +324 -0
- package/dist/core/wait.js +114 -0
- package/dist/core/wake.js +207 -0
- package/dist/core/watch.js +247 -0
- package/dist/core/worktree.js +213 -0
- package/dist/hosts/claude-desktop.js +274 -0
- package/dist/hosts/claude.js +249 -0
- package/dist/hosts/codex.js +329 -0
- package/dist/hosts/desktop-shared.js +20 -0
- package/dist/hosts/index.js +11 -0
- package/dist/hosts/types.js +4 -0
- package/dist/install/basics.js +18 -0
- package/dist/install/claude-init.js +133 -0
- package/dist/install/common.js +655 -0
- package/dist/install/doctor.js +629 -0
- package/dist/install/qualify-codex.js +205 -0
- package/dist/install.js +524 -0
- package/dist/mcp/elicit.js +209 -0
- package/dist/mcp/gateway.js +218 -0
- package/dist/mcp/host.js +253 -0
- package/dist/mcp/server.js +1124 -0
- package/dist/mcp/stdio.js +37 -0
- package/dist/modes/discussion.js +393 -0
- package/dist/modes/review.js +722 -0
- package/dist/native/relay-sbcheck +0 -0
- package/dist/targets/briefs.js +86 -0
- package/dist/targets/claude.js +94 -0
- package/dist/targets/codex.js +66 -0
- package/dist/targets/copilot.js +93 -0
- package/dist/targets/gemini.js +119 -0
- package/dist/targets/grok.js +126 -0
- package/dist/targets/index.js +192 -0
- package/dist/targets/types.js +18 -0
- package/dist/targets/verified.js +35 -0
- package/dist/worker.js +113 -0
- package/docs/UPGRADING.md +1502 -0
- package/docs/pinned-codex.md +321 -0
- package/experiments/stage2-redteam/lib/oracles.mjs +214 -0
- package/experiments/stage2-redteam/lib/report.mjs +35 -0
- package/npm-shrinkwrap.json +1632 -0
- package/package.json +82 -4
- package/scripts/codex-qualify/codex-pin-store.mjs +353 -0
- package/scripts/codex-qualify/codex-qualifier-process.mjs +265 -0
- package/scripts/codex-qualify/codex-qualifier.example.json +5 -0
- package/scripts/codex-qualify/codex-qualifier.mjs +281 -0
- package/scripts/codex-qualify/codex-shipped-pin.mjs +158 -0
- package/scripts/codex-qualify/codex-stage2-pin.mjs +48 -0
- package/scripts/codex-qualify/codex-stage2.mjs +2381 -0
- package/scripts/codex-qualify/install-codex-qualifier.mjs +98 -0
- package/scripts/codex-qualify/main-module.mjs +14 -0
- package/scripts/codex-qualify/relay-codex-qualifier.plist +37 -0
- package/scripts/codex-qualify/scratch-env.mjs +31 -0
- package/scripts/codex-qualify/session.mjs +96 -0
- package/scripts/codex-qualify/stage2-escalation-cases.mjs +125 -0
- package/test/codex-permissions.test.ts +875 -0
- package/test/fixtures/boundary-probes.mjs +17 -0
- package/test/fixtures/denial-stream-host.mjs +7 -0
- package/test/fixtures/families.json +246 -0
- package/test/fixtures/install-snapshots/claude-desktop-foreign.txt +158 -0
- package/test/fixtures/install-snapshots/claude-desktop-fresh.txt +101 -0
- package/test/fixtures/install-snapshots/claude-desktop-installed.txt +161 -0
- package/test/fixtures/install-snapshots/claude-foreign.txt +133 -0
- package/test/fixtures/install-snapshots/claude-fresh.txt +77 -0
- package/test/fixtures/install-snapshots/claude-installed.txt +133 -0
- package/test/fixtures/install-snapshots/codex-foreign.txt +159 -0
- package/test/fixtures/install-snapshots/codex-fresh.txt +107 -0
- package/test/fixtures/install-snapshots/codex-installed.txt +161 -0
- package/test/fixtures/link-parent.mjs +6 -0
- package/test/fixtures/mediated-command.cjs +72 -0
- package/test/fixtures/native-skill-isolation.json +280 -0
- package/test/fixtures/pinned-codex-app-server.mjs +25 -0
- package/test/fixtures/qualified-ext-adapters.mjs +36 -0
- package/test/fixtures/refusals/README.md +52 -0
- package/test/fixtures/refusals/claude-source-result.json +7 -0
- package/test/fixtures/refusals/openai-app-capacity.json +24 -0
- package/test/fixtures/refusals/openai-app-cyberPolicy.json +24 -0
- package/test/fixtures/refusals/openai-gpt-6-astra-max.json +12 -0
- package/test/fixtures/refusals/openai-gpt-6.1-sol-xhigh.json +12 -0
- package/test/fixtures/refusals/openai-review-capacity.json +24 -0
- package/test/fixtures/relay-0.2.0.sql +57 -0
- package/test/fixtures/relay-0.9.1.gen.mjs +212 -0
- package/test/fixtures/relay-0.9.1.sql +340 -0
- package/test/fixtures/slow-boundary-probes.mjs +37 -0
- package/test/fixtures/stable-surfaces/config.json +1122 -0
- package/test/fixtures/stable-surfaces/escalation.json +128 -0
- package/test/fixtures/stable-surfaces/events.json +37 -0
- package/test/fixtures/stable-surfaces/gemini-native-resume.json +4 -0
- package/test/fixtures/stable-surfaces/inbox.jsonl +2 -0
- package/test/fixtures/stable-surfaces/notice.txt +1 -0
- package/test/fixtures/stable-surfaces/refusal-item.json +28 -0
- package/test/fixtures/stable-surfaces/refusal-review.json +23 -0
- package/test/fixtures/stable-surfaces/registry.json +49 -0
- package/test/fixtures/stable-surfaces/tools-desktop.json +575 -0
- package/test/fixtures/stable-surfaces/tools.json +716 -0
- package/test/fixtures/stable-surfaces/usage.txt +46 -0
- package/test/fixtures/stage2-acp-native.mjs +138 -0
- package/test/fixtures/stage2-app-server.mjs +23 -0
- package/test/fixtures/stage2-catalog.json +91 -0
- package/test/fixtures/stage2-hostile-web.mjs +35 -0
- package/test/fixtures/stage2-native-network.mjs +62 -0
- package/test/fixtures/stage2-worker.ts +87 -0
- package/test/fixtures/status-views/expected.json +7825 -0
- package/test/fixtures/status-views/registries.json +1 -0
- package/test/fixtures/steering.json +209 -0
- package/test/helpers.ts +740 -0
- package/test/host-env.ts +7 -0
- package/test/keychain-decoy.ts +197 -0
- package/test/live-scope.ts +44 -0
- package/test/mediated-network.test.ts +192 -0
- package/test/mediated-proxy.test.ts +264 -0
- package/test/native-temp-alias.ts +10 -0
- package/test/never-policy.test.ts +629 -0
- package/test/never-tools.test.ts +136 -0
- package/test/process-home.ts +18 -0
- package/test/proxy.test.ts +531 -0
- package/test/restart-overlay-live.test.ts +85 -0
- package/test/restart-overlay-profile.test.ts +66 -0
- package/test/restart-overlay.test.ts +416 -0
- package/test/stable-surfaces.test.ts +249 -0
- package/test/stage2-escalation-live.test.ts +544 -0
- package/test/stage2-escalation-qualification.test.ts +170 -0
- package/test/stage2-escalation.test.ts +747 -0
- package/test/stage2-executor.test.ts +849 -0
- package/test/stage2-grant.test.ts +603 -0
- package/test/stage2-native-live.test.ts +647 -0
- package/test/stage2-network-decisions.test.ts +70 -0
- package/test/stage2-probe.test.ts +845 -0
- package/test/stage2-standing-live.test.ts +203 -0
- package/test/stubs/broker-host.mjs +59 -0
- package/test/stubs/broker-peer.mjs +20 -0
- package/test/stubs/confined-harness.mjs +91 -0
- package/test/stubs/ext-broken-server.mjs +2 -0
- package/test/stubs/ext-odd-server.mjs +21 -0
- package/test/stubs/ext-server.mjs +31 -0
- package/test/stubs/fake-host-cli.mjs +218 -0
- package/test/stubs/procargs.mjs +30 -0
- package/test/stubs/stub-acp +4 -0
- package/test/stubs/stub-agent.mjs +322 -0
- package/test/stubs/stub-claude +4 -0
- package/test/stubs/stub-codex +4 -0
- package/test/stubs/targets/acp.mjs +307 -0
- package/test/stubs/targets/claude.mjs +149 -0
- package/test/stubs/targets/codex.mjs +479 -0
- package/test/stubs/targets/gemini.mjs +604 -0
- package/test/temp-root.ts +11 -0
- package/test/wp4-adapters.test.ts +353 -0
- package/test/wp4-interlock.test.ts +136 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
// doctor: checks this machine against what relay needs (Node, the CLIs at the versions relay's
|
|
2
|
+
// confinement was verified with, their logins, each host's registration), and says what to fix.
|
|
3
|
+
import { codexRulesDoctor } from "../backends/codex-network.js";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { discoveryVerified, fullVersionOf } from "../backends/tool-discovery.js";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import os from "node:os";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { configProtection } from "../core/protected-config.js";
|
|
10
|
+
import { settingsEnvProblem } from "../backends/claude.js";
|
|
11
|
+
import { codexLaunchCheck } from "../backends/codex.js";
|
|
12
|
+
import { codexConfigFile as userCodexConfigFile } from "../hosts/codex.js";
|
|
13
|
+
import { codexVersion, daybreakDoctor } from "../backends/codex-daybreak.js";
|
|
14
|
+
import { stage2SettingsProblems } from "../backends/codex-stage2.js";
|
|
15
|
+
import { stage2Enabled } from "../core/raw-network.js";
|
|
16
|
+
import { sandboxCheckUnavailable } from "../confine/sbcheck.js";
|
|
17
|
+
import { loginStore } from "../backends/acp.js";
|
|
18
|
+
import { grokLoginRefusal, grokSystemRefusal } from "../backends/grok.js";
|
|
19
|
+
import { confinementSummary, tokenStoreProblem } from "../confine/index.js";
|
|
20
|
+
import { inboundSettings, managedSettings, managedSettingsProblem, settingsAnswerForPerson } from "../core/claude-settings.js";
|
|
21
|
+
import { authFor, canonical, configPath, DEFAULT_CONFIG, hasExtensions, loadConfig, relayHome, serverOf } from "../core/config.js";
|
|
22
|
+
import { mcpFile, readMcpFile, resolveSkills } from "../core/extensions.js";
|
|
23
|
+
import { controlDirUsage, storageReport } from "../core/storage.js";
|
|
24
|
+
import { gitExecutable, systemTool } from "../core/executables.js";
|
|
25
|
+
import { turnTempProblems } from "../core/retention.js";
|
|
26
|
+
import { hostDef, HOSTS } from "../hosts/index.js";
|
|
27
|
+
import { relayVersion } from "./basics.js";
|
|
28
|
+
import { ambiguousNote, first, isRelayCommand, LAUNCHER, relayCommandIdentity, linkPath, locate, npmInstallName, onPath, reinstallCommand, relativePathEntryBefore, relayCommandKind, ROOT, say, sh, errText } from "./common.js";
|
|
29
|
+
import { defaultKeyDir, keyFileStatus } from "../core/api-keys.js";
|
|
30
|
+
import { loadBriefs, notesBehind } from "../targets/briefs.js";
|
|
31
|
+
import { doctorRule } from "../core/steering.js";
|
|
32
|
+
import { isTarget, olderVersion, TARGETS, targetDef, targetLabel, versionOf } from "../targets/index.js";
|
|
33
|
+
import { DIALOG_QUALIFICATIONS } from "../mcp/host.js";
|
|
34
|
+
import { capturedRootEnvironment, selectEnvironment } from "../core/env-policy.js";
|
|
35
|
+
import { redact, registerReleasedEnvironment, withTurnSecrets } from "../core/secrets.js";
|
|
36
|
+
import { claudeInitProblem } from "./claude-init.js";
|
|
37
|
+
import { claudeLinkDoctor, linkVersionProblem } from "../backends/native-temp.js";
|
|
38
|
+
import { probeVersion } from "../backends/cli-version.js";
|
|
39
|
+
import { codexHomeStatus, codexPinInfo, describeCodexPin, freezeCodexConfig, RELAY_CODEX_CONFIG, shippedPinPackageRoot } from "../backends/codex-pin.js";
|
|
40
|
+
import { buildIdentity, describeBuild } from "../core/build-identity.js";
|
|
41
|
+
import { readShippedPin } from "../core/shipped-pin.js";
|
|
42
|
+
import { relayCodexHome, relayCodexPinStore } from "../core/config.js";
|
|
43
|
+
import { resolveNeverPolicy } from "../core/never-policy.js";
|
|
44
|
+
import { claudeFloorVariants, neverFloorApplies, neverFloorReport } from "../core/never-coverage.js";
|
|
45
|
+
import { QUALIFIED_NEVER_TOOL_ADAPTERS } from "../core/never-tools.js";
|
|
46
|
+
import { nativeCodexNeverNetworkEntry } from "../backends/never-admission.js";
|
|
47
|
+
/** package.json engines and bin/relay's check: Node 24.15 is the first Node 24 whose node:sqlite, which the registry uses, prints no ExperimentalWarning. */
|
|
48
|
+
const MIN_NODE = [24, 15];
|
|
49
|
+
// Recorded runs: docs/qualification/copilot-1.0.98.md and docs/research/seatbelt-prototype.md (27.0,
|
|
50
|
+
// 27.0.1); 27.2: Codex 0.167.0 qualified 32/32 on two Macs (2026-11-07) and the release checks,
|
|
51
|
+
// items 1-33, passed at f67f622 (2026-11-08); 27.2.1: the full release gate chain
|
|
52
|
+
// (suite, items 1-33, live rounds, red team, claude-floor) passed at b9f1eaa (2026-11-16).
|
|
53
|
+
export const TESTED_MACOS = ["27.0", "27.0.1", "27.2", "27.2.1"];
|
|
54
|
+
export const testedMacOS = (version) => TESTED_MACOS.some((v) => v === version);
|
|
55
|
+
export function doctor() {
|
|
56
|
+
return withTurnSecrets(() => doctorScoped());
|
|
57
|
+
}
|
|
58
|
+
async function doctorScoped() {
|
|
59
|
+
let failed = 0;
|
|
60
|
+
let warned = 0;
|
|
61
|
+
const line = (label, text) => say(redact(`${label.padEnd(Math.max(15, label.length + 1))}${text}`));
|
|
62
|
+
const fail = (label, text) => (failed++, line(label, `FAIL: ${text}`));
|
|
63
|
+
const warn = (label, text) => (warned++, line(label, `WARNING: ${text}`));
|
|
64
|
+
const mine = (command) => typeof command === "string" && canonical(command) === canonical(LAUNCHER);
|
|
65
|
+
line("relay", `${relayVersion()} at ${ROOT}`);
|
|
66
|
+
if (process.platform === "darwin") {
|
|
67
|
+
const mac = spawnSync(systemTool("/usr/bin/sw_vers"), ["-productVersion"], { encoding: "utf8" });
|
|
68
|
+
const version = mac.status === 0 ? mac.stdout.trim() : "unknown";
|
|
69
|
+
line("platform", `macOS ${version} (Darwin ${os.release()}, ${process.arch}); tested on macOS ${TESTED_MACOS.join(", ")}`);
|
|
70
|
+
if (!testedMacOS(version))
|
|
71
|
+
warn("platform", `macOS ${version} has not been tested with relay; confinement on this version is unverified. Run the qualification checks before relying on it.`);
|
|
72
|
+
}
|
|
73
|
+
else
|
|
74
|
+
fail("platform", `${process.platform} is not supported: relay relies on macOS process handling and on each CLI's macOS sandbox`);
|
|
75
|
+
const node = process.versions.node.split(".").map(Number);
|
|
76
|
+
const nodeLine = `${process.version} at ${process.execPath}`;
|
|
77
|
+
if (olderVersion(node.slice(0, 2), MIN_NODE))
|
|
78
|
+
fail("node", `${nodeLine}; relay needs ${MIN_NODE.join(".")} or newer`);
|
|
79
|
+
else
|
|
80
|
+
line("node", `${nodeLine} (needs ${MIN_NODE.join(".")} or newer)`);
|
|
81
|
+
line("", `the launcher bin/relay picks Node: RELAY_NODE (${process.env.RELAY_NODE ? `set to ${process.env.RELAY_NODE}` : "not set"}), then PATH, then the version managers`);
|
|
82
|
+
let cfg = DEFAULT_CONFIG;
|
|
83
|
+
let cfgProblem = "";
|
|
84
|
+
try {
|
|
85
|
+
cfg = loadConfig((message) => warn("config", message));
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
cfgProblem = errText(err);
|
|
89
|
+
}
|
|
90
|
+
line("family", doctorRule(cfg));
|
|
91
|
+
if (!cfgProblem) {
|
|
92
|
+
try {
|
|
93
|
+
const never = resolveNeverPolicy({ never: cfg.never, codexHome: cfg.targets.codex.home });
|
|
94
|
+
line("never policy", `v${never.version} ${never.hash}; ${never.paths.length} protected path entries, ${never.ports.length} port entries, ${never.hosts.length} host entries. Each run retains a durable cumulative floor.`);
|
|
95
|
+
const [heading, ...perTarget] = neverFloorReport(TARGETS.map((t) => ({ id: t.id, label: targetLabel(t, t.id), enabled: cfg.targets[t.id].enabled })), cfg);
|
|
96
|
+
line("never enforced", heading);
|
|
97
|
+
for (const text of perTarget)
|
|
98
|
+
line("", text);
|
|
99
|
+
for (const removed of never.removed)
|
|
100
|
+
warn("never override", `${removed.acknowledge}: ${removed.reason}. New runs only; existing floors cannot shrink.`);
|
|
101
|
+
if (never.hosts.length)
|
|
102
|
+
line("never hosts", 'raw network unavailable; hosted search and web__run require web_search="disabled" effective readback');
|
|
103
|
+
const nativeNetworkEntry = nativeCodexNeverNetworkEntry(never, "strict");
|
|
104
|
+
const openNetworkEntry = nativeCodexNeverNetworkEntry(never, "local");
|
|
105
|
+
if (nativeNetworkEntry)
|
|
106
|
+
line("never Codex", `${nativeNetworkEntry}: native shell-network turns refuse before launch, including resumed/kept grants. With stage 2 on, standing network grants and child_network use the mediated route, which enforces hosts and ports; with stage 2 off these entries require shell network off.`);
|
|
107
|
+
else if (openNetworkEntry)
|
|
108
|
+
line("never Codex", `${openNetworkEntry}: native strict shell network enforces it (it reaches none of this Mac's addresses); native turns with grant.local_network${cfg.allow_dangerous ? " and allow_dangerous write turns" : ""}, which reach this Mac's addresses, refuse before launch, including resumed/kept grants. With stage 2 on, relay's own sandbox and proxy enforce it.`);
|
|
109
|
+
line("extension tools", `${QUALIFIED_NEVER_TOOL_ADAPTERS.length} qualified effects adapters; other tools withheld before launch regardless of person consent`);
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
fail("never policy", err.message);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
for (const { directory, reason } of configProtection().fileOnly)
|
|
116
|
+
warn("config paths", `only relay's config and install files are protected in ${directory}: ${reason}; a process allowed to write that directory could replace them by renaming it.`);
|
|
117
|
+
try {
|
|
118
|
+
const raw = JSON.parse(fs.readFileSync(configPath(), "utf8"));
|
|
119
|
+
if (raw.same_family === "allow")
|
|
120
|
+
line("", 'In 1.0, "allow" also covers sessions of unknown family, Copilot with "auto", no model or an unlisted model, and Grok with no model.');
|
|
121
|
+
}
|
|
122
|
+
catch { /* Invalid config is reported below. */ }
|
|
123
|
+
line("", "A --host registration is believed only while clientInfo agrees. A copied registration in opencode or another multi-model host makes the caller unknown; relay logs that mismatch once per session and names it in families.note. Doctor cannot see another session's clientInfo.");
|
|
124
|
+
line("session", "Configuration only: qualified Claude Code and Codex registrations assume one conversation per process; --desktop and local-agent-mode-* are shared; OpenCode 2 (client opencode, seen on 2.1.4) is shared, and relay scopes each call by the session OpenCode stamps on it; other deployments are unqualified. status.session reports this call's scope, source and topology without host ids or tokens. No last-observed call is persisted, and static configuration is not a verified two-conversation host test.");
|
|
125
|
+
line("", "On a shared relay each conversation carries a session token relay issued it (session_token), which keeps its jobs, approval requests and events apart from the other conversations'. It is a bearer key the model holds in plain text: it separates conversations that use relay honestly, and anyone who sees it can act as that conversation. Relay stores only its hash. Deleting session.key in relay's home revokes every token at once; to move their runs to new tokens, quit and reopen the app, then run relay adopt from a terminal (relay cancel there stops the work instead).");
|
|
126
|
+
for (const q of Object.values(DIALOG_QUALIFICATIONS)) {
|
|
127
|
+
const idle = q.idleSince ? `qualified from ${q.idleSince.join(".")}` : "unqualified";
|
|
128
|
+
const busy = q.busySince ? `qualified from ${q.busySince.join(".")}` : "unqualified";
|
|
129
|
+
const offer = q.idleSince && q.busySince
|
|
130
|
+
? `offered only when both version floors, host markers and consent checks pass${cfg.ask_user === "never" ? '; withheld by ask_user "never"' : ""}`
|
|
131
|
+
: `withheld: ${q.withheld}`;
|
|
132
|
+
line("dialog surface", `${q.label}: idle ${idle}; busy ${busy}; ${offer}`);
|
|
133
|
+
}
|
|
134
|
+
line("", "Dialog qualification is per surface, not vendor; ask_user always does not override it. Doctor describes qualification, not a live connection. status.approval_dialogs reports that session's offer and reason. Withheld requests stay pending and arrive in the next call's events; confirm remains available only where its permission prompt is qualified, or use relay approvals in a terminal.");
|
|
135
|
+
line("", "Foreign MCP items are unavailable. Recover an orphan explicitly with adopt through a qualified permission prompt, or relay adopt <run_id> --to <status-session-fingerprint> in a terminal; review and confirm the whole-run transfer. Owner death, cwd and family never grant access.");
|
|
136
|
+
// The model notes in the prompting briefs go stale as the CLIs move on; doctor says when they have.
|
|
137
|
+
let briefs = {};
|
|
138
|
+
try {
|
|
139
|
+
briefs = loadBriefs();
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
warn("briefs", `relay's prompting briefs do not load (${errText(err)})`);
|
|
143
|
+
}
|
|
144
|
+
const present = {};
|
|
145
|
+
const codexState = codexHomeStatus(cfg);
|
|
146
|
+
line("codex home", `${codexState.home}: ${codexState.present ? "present" : "missing"}; login ${codexState.login} (auth.json metadata only; requires mode 0600)`);
|
|
147
|
+
// A configured home that is not relay's: reported, never repaired (prepareCodexHome refuses it before any write).
|
|
148
|
+
if (codexState.problem)
|
|
149
|
+
(cfg.targets.codex.enabled ? fail : line)("codex home", `${codexState.problem}${cfg.targets.codex.enabled ? "" : " (the codex target is disabled, so no job uses it now)"}`);
|
|
150
|
+
let codexPinProblem = "";
|
|
151
|
+
// The pin matters only to a Codex target relay launches. Before any pin is in place (a fresh
|
|
152
|
+
// install, before `relay install codex --write`), that is the next step, not a broken one.
|
|
153
|
+
const noPinYet = () => { try {
|
|
154
|
+
fs.lstatSync(path.join(relayCodexPinStore(cfg), "current"));
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return true;
|
|
159
|
+
} };
|
|
160
|
+
if (!cfg.targets.codex.enabled)
|
|
161
|
+
line("codex pin", "not checked: the codex target is disabled");
|
|
162
|
+
else
|
|
163
|
+
try {
|
|
164
|
+
cfg = freezeCodexConfig(cfg);
|
|
165
|
+
const pin = codexPinInfo(cfg);
|
|
166
|
+
line("codex pin", cfg.targets.codex.pinned ? `${pin ? describeCodexPin(pin) : "qualified"}; binary ${cfg.targets.codex.bin}` : "off (targets.codex.pinned is explicitly false)");
|
|
167
|
+
// A release's shipped pin that is not the one in force: say so, and how to switch.
|
|
168
|
+
let shipped = null;
|
|
169
|
+
try {
|
|
170
|
+
shipped = readShippedPin(shippedPinPackageRoot());
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
warn("codex shipped pin", `this relay's codex-pin.json is not valid (${errText(err)})`);
|
|
174
|
+
}
|
|
175
|
+
if (shipped && cfg.targets.codex.pinned && pin?.kind === "local") {
|
|
176
|
+
line("codex shipped pin", `this release also ships a pin for Codex ${shipped.codex.version}, qualified by the maintainer with ${describeBuild(shipped.relay)}; \`relay qualify-codex --shipped\` switches to it`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
codexPinProblem = errText(err);
|
|
181
|
+
(cfg.targets.codex.pinned !== false && noPinYet() ? warn : fail)("codex pin", codexPinProblem);
|
|
182
|
+
}
|
|
183
|
+
const codexConfigFile = () => path.join(relayCodexHome(cfg), "config.toml");
|
|
184
|
+
let claudeVersion = null;
|
|
185
|
+
for (const t of TARGETS.filter((t) => cfg.targets[t.id].enabled)) {
|
|
186
|
+
const cli = t.id;
|
|
187
|
+
if (cli === "codex" && codexPinProblem)
|
|
188
|
+
continue;
|
|
189
|
+
const label = targetLabel(t, cli);
|
|
190
|
+
const bin = cfg.targets[cli].bin;
|
|
191
|
+
// `bin` in the config says where each target's CLI is. It has nothing to do with which Node runs relay.
|
|
192
|
+
const onPath = bin === DEFAULT_CONFIG.targets[cli].bin;
|
|
193
|
+
const from = cli === "codex" && cfg.targets.codex.pinned ? "resolved qualified pin" : onPath ? "found on PATH" : `set by targets.${cli}.bin in the config`;
|
|
194
|
+
// An experimental target not switched on is refused whatever is installed: its CLI is no requirement.
|
|
195
|
+
const refused = !t.qualified && !cfg.targets[cli].experimental;
|
|
196
|
+
let selection;
|
|
197
|
+
try {
|
|
198
|
+
selection = selectEnvironment(t.id, cfg, capturedRootEnvironment);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
fail(label, errText(err));
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
registerReleasedEnvironment(selection.env, selection.releasedNames);
|
|
205
|
+
const r = probeVersion(cli, bin, selection.env);
|
|
206
|
+
present[cli] = !r.error && r.status === 0;
|
|
207
|
+
if (cli === "codex")
|
|
208
|
+
line("codex daybreak", daybreakDoctor(cfg.targets.codex.daybreak, present[cli] ? versionOf(r.stdout) : null, selection.env));
|
|
209
|
+
if (!present[cli]) {
|
|
210
|
+
const missing = `not found or not runnable (\`${bin}\`, ${onPath ? "looked up on PATH" : from})`;
|
|
211
|
+
if (refused)
|
|
212
|
+
line(label, `${missing}; relay refuses it anyway until targets.${cli}.experimental is true`);
|
|
213
|
+
else
|
|
214
|
+
fail(label, `${missing}. Install ${t.product}, or set targets.${cli}.bin in ${configPath()} to its full path`);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (cli === "codex" && codexState.login === "unsafe permissions")
|
|
218
|
+
warn("codex login", `${path.join(codexState.home, "auth.json")} is not a private regular file (mode 0600); sign in again with CODEX_HOME=${JSON.stringify(codexState.home)} codex login`);
|
|
219
|
+
const v = versionOf(r.stdout);
|
|
220
|
+
if (cli === "claude")
|
|
221
|
+
claudeVersion = v;
|
|
222
|
+
const tested = t.tested.join(".");
|
|
223
|
+
const where = `${first(r.stdout)} at ${locate(bin) ?? bin} (${from})`;
|
|
224
|
+
// Launching refuses a CLI older than the version its confinement was verified with, or one whose
|
|
225
|
+
// version cannot be read, unless allow_untested is set (backends/run.ts untested). Doctor says the same.
|
|
226
|
+
const why = !v ? `relay could not read the version (its confinement was verified with ${tested})` : olderVersion(v, t.tested) ? `older than the ${tested} relay's confinement was verified with` : null;
|
|
227
|
+
if (!why)
|
|
228
|
+
line(label, `${where}; tested with ${[t.tested, ...(t.checked ?? [])].map((x) => x.join(".")).join(", ")}`);
|
|
229
|
+
else if (cfg.allow_untested)
|
|
230
|
+
warn(label, `${where}; ${why}. allow_untested is set, so relay launches it anyway, unverified`);
|
|
231
|
+
else
|
|
232
|
+
fail(label, `${where}; ${why}, so relay refuses to launch it. Update ${t.product}, or set "allow_untested": true in relay's config to run it unverified`);
|
|
233
|
+
const c = t.capabilities;
|
|
234
|
+
const confined = c.confinement === "verified" ? "verified confinement (its own sandbox, configured and checked by relay)" : c.confinement === "relay-enforced" ? "relay-enforced confinement (relay's own sandbox around the whole harness)" : "no confinement (relay does not launch it)";
|
|
235
|
+
line("", `${label}: ${confined}; network off ${c.networkOff ? "enforced" : "not available (needs a network grant)"}; approval requests ${c.approvals}; login ${c.login}${t.qualified ? "" : refused ? `; experimental, not qualified (needs targets.${cli}.experimental)` : `; experimental, not qualified (switched on by targets.${cli}.experimental)`}`);
|
|
236
|
+
// A target that signs in with an API key only (Gemini): its own opt-in, and its key file, said
|
|
237
|
+
// without reading the key out (core/api-keys.ts). Without the opt-in no turn would read the file,
|
|
238
|
+
// and neither does doctor: it looks only at where the file is and at its status.
|
|
239
|
+
if (c.login === "key-only") {
|
|
240
|
+
const optedIn = cfg.targets[cli].child_auth === "any";
|
|
241
|
+
if (!optedIn)
|
|
242
|
+
(refused ? line : fail)(`${label} key`, `relay hands ${t.name} an API key, and so launches it, only with targets.${cli}.child_auth "any" (the global child_auth does not count)`);
|
|
243
|
+
const k = keyFileStatus(cli, { content: optedIn });
|
|
244
|
+
if (k.problem)
|
|
245
|
+
(refused ? line : fail)(`${label} key`, k.problem);
|
|
246
|
+
else
|
|
247
|
+
line(`${label} key`, `${k.file}: in place and private${optedIn ? "" : " (its content not read, without the opt-in)"}; read before each of its turns and handed to its process alone. ${k.denied === "directory" ? "Relay's sandbox denies its directory to every agent it confines" : `It is outside ${defaultKeyDir()}: relay's sandbox denies the file itself to every agent it confines, its directory staying readable to them`}. Claude's turns may not read it either; Codex's can, as they can read your other files`);
|
|
248
|
+
}
|
|
249
|
+
// A target that takes relay's tools through its own tool discovery (Gemini): offered on every
|
|
250
|
+
// version, checked at each launch; whether this one is among those it was verified on live.
|
|
251
|
+
if (t.toolDiscovery) {
|
|
252
|
+
const full = fullVersionOf(r.stdout);
|
|
253
|
+
const verified = t.toolDiscovery.versions.join(", ");
|
|
254
|
+
line(`${label} tools`, `relay's tools through ${t.product}'s own tool discovery (named ${t.toolDiscovery.prefix}<tool>): ${discoveryVerified(t, full) ? `checked on this version, ${full}` : `not checked on ${full ?? "this version"}`}; checked on ${verified} (docs/install.md says how). Every launch checks that discovery ran, on any version: where it did not, the agent is told it has no relay tools, and the turn says so`);
|
|
255
|
+
}
|
|
256
|
+
const behind = v && briefs[cli] ? notesBehind(t, briefs[cli].models, v) : null;
|
|
257
|
+
if (behind)
|
|
258
|
+
(behind.stale ? warn : line)(`${label} brief`, behind.text);
|
|
259
|
+
}
|
|
260
|
+
if (!cfg.targets.codex.enabled)
|
|
261
|
+
line("codex daybreak", daybreakDoctor(cfg.targets.codex.daybreak, null, { ...process.env, CODEX_HOME: relayCodexHome(cfg) }) + (cfg.targets.codex.daybreak === undefined ? "" : "; target disabled, CLI version not checked"));
|
|
262
|
+
// What makes relay refuse every turn of an enabled target relay confines itself, before it starts,
|
|
263
|
+
// from the same checks the launch makes: Grok's system configuration layers and where its login is
|
|
264
|
+
// (backends/grok.ts refuse), and a target's login store as the sandbox layer checks it (confine
|
|
265
|
+
// tokenStore). An experimental target not opted into is refused anyway, as its line above says.
|
|
266
|
+
for (const t of TARGETS.filter((t) => cfg.targets[t.id].enabled && present[t.id] && (t.qualified || cfg.targets[t.id].experimental))) {
|
|
267
|
+
const name = targetLabel(t);
|
|
268
|
+
const problem = (t.id === "grok" ? grokSystemRefusal(name) ?? grokLoginRefusal(name) : null)
|
|
269
|
+
?? (t.tokenStore ? tokenStoreProblem(loginStore(t.tokenStore, os.homedir())) : null);
|
|
270
|
+
if (problem)
|
|
271
|
+
warn(`${t.id} launch`, `relay refuses every ${name} turn here: ${problem}`);
|
|
272
|
+
}
|
|
273
|
+
// Settings relay does not vet make it refuse every Claude launch (backends/claude.ts prepare).
|
|
274
|
+
if (cfg.targets.claude.enabled && present.claude) {
|
|
275
|
+
// Under a long home, Claude's private temp goes through relay's short link (backends/native-temp.ts).
|
|
276
|
+
const { bin } = cfg.targets.claude;
|
|
277
|
+
const link = claudeLinkDoctor(claudeVersion, bin, cfg.allow_untested);
|
|
278
|
+
if (link)
|
|
279
|
+
(link.level === "warn" ? warn : line)("claude temp", link.text);
|
|
280
|
+
const managed = managedSettings();
|
|
281
|
+
// The never floor's gates (backends/never-admission.ts, claude.ts prepare), from the same predicate.
|
|
282
|
+
const floored = neverFloorApplies("claude", cfg);
|
|
283
|
+
const variants = floored ? claudeFloorVariants({ ...cfg, allow_dangerous: false }) : [];
|
|
284
|
+
// floored is always true for Claude today (NEVER_FLOOR_WHEN), so the "refuse" alternative is
|
|
285
|
+
// reached only if that changes; both texts say what "accept" would and would not launch.
|
|
286
|
+
const problem = managed && (floored || cfg.claude_managed_settings === "refuse")
|
|
287
|
+
? managedSettingsProblem(managed, floored)
|
|
288
|
+
: variants.length ? `${variants.join(", ")} can take a job around the never floor's checked sandbox; use child_settings "isolated", child_hooks false and child_mcp "relay-only"`
|
|
289
|
+
: settingsEnvProblem(cfg, managed);
|
|
290
|
+
if (!problem && floored && cfg.allow_dangerous)
|
|
291
|
+
warn("claude launch", "relay refuses Claude write jobs here: allow_dangerous would run them unsandboxed, around the never floor");
|
|
292
|
+
if (problem)
|
|
293
|
+
warn("claude launch", `relay refuses every Claude launch here: ${problem}`);
|
|
294
|
+
else if (link && !link.usable)
|
|
295
|
+
line("claude init", "not run: Claude's private temp here needs relay's short link usable (see claude temp), and doctor never makes the link");
|
|
296
|
+
else {
|
|
297
|
+
try {
|
|
298
|
+
const selection = selectEnvironment("claude", cfg, capturedRootEnvironment);
|
|
299
|
+
registerReleasedEnvironment(selection.env, selection.releasedNames);
|
|
300
|
+
const initProblem = await claudeInitProblem(bin, selection.env, () => linkVersionProblem(claudeVersion, bin, cfg.allow_untested));
|
|
301
|
+
if (initProblem)
|
|
302
|
+
warn("claude init", initProblem);
|
|
303
|
+
else
|
|
304
|
+
line("claude init", "isolated skills and plugins checked; stopped at init, process ended without a result event (no model turn)");
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
warn("claude init", "could not prepare Claude's init-only probe");
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
// Codex settings relay does not set make it refuse Codex launches (backends/codex-app.ts
|
|
312
|
+
// configProblem), and Codex's own shell_environment_policy may keep names relay releases from its
|
|
313
|
+
// commands. Both are judged by the check a job's turn makes before it runs (codexLaunchCheck): the
|
|
314
|
+
// effective configuration a Codex app server reports for a job started in this directory, every
|
|
315
|
+
// layer merged (system, managed, this directory's project layers, and relay's Codex home, whose
|
|
316
|
+
// config.toml relay writes on every turn), for a read job and a write job without grants.
|
|
317
|
+
if (cfg.targets.codex.enabled && present.codex) {
|
|
318
|
+
const cwd = process.cwd();
|
|
319
|
+
if (codexState.problem)
|
|
320
|
+
line("codex launch", `not checked: relay will not use ${codexState.home} as its Codex home (see the codex home line), and doctor changes nothing there`);
|
|
321
|
+
else if (!codexState.present)
|
|
322
|
+
line("codex launch", `not checked: relay's Codex home ${codexState.home} does not exist yet (\`relay install codex --write\` makes it; see the codex login line)`);
|
|
323
|
+
else {
|
|
324
|
+
let held = null;
|
|
325
|
+
try {
|
|
326
|
+
held = fs.readFileSync(codexConfigFile(), "utf8");
|
|
327
|
+
}
|
|
328
|
+
catch { /* absent: the turn writes it */ }
|
|
329
|
+
if (held !== null && held !== RELAY_CODEX_CONFIG)
|
|
330
|
+
line("codex home", `${codexConfigFile()} held changes of its own; relay replaces that file on every turn, so they never apply to a job, and the check below put relay's back first, as a turn does`);
|
|
331
|
+
const checks = [];
|
|
332
|
+
for (const access of ["read", "write"])
|
|
333
|
+
checks.push({ access, ...(await codexLaunchCheck(cfg, cwd, access)) });
|
|
334
|
+
const unchecked = checks.find((c) => c.unchecked);
|
|
335
|
+
const judged = checks.filter((c) => !c.stage2 && !c.unchecked);
|
|
336
|
+
const refused = judged.filter((c) => c.problem);
|
|
337
|
+
const where = `started in ${cwd}`;
|
|
338
|
+
const which = `the configured default job (default model and speed, relay's tools, no grants)`;
|
|
339
|
+
if (unchecked)
|
|
340
|
+
line("codex launch", `not checked: ${unchecked.unchecked}. This says nothing about a job relay starts; run relay doctor in your own terminal`);
|
|
341
|
+
else if (refused.length) {
|
|
342
|
+
const same = refused.length === 2 && refused[0].problem === refused[1].problem;
|
|
343
|
+
for (const c of same ? [refused[0]] : refused)
|
|
344
|
+
warn("codex launch", `relay refuses Codex ${same ? "read and write" : c.access} jobs ${where}, by the checks each turn makes before it starts (${which}): ${c.problem}`);
|
|
345
|
+
}
|
|
346
|
+
else if (judged.length)
|
|
347
|
+
line("codex launch", `Codex ${judged.map((c) => c.access).join(" and ")} jobs ${where} pass the checks each turn makes before it starts, on Codex's effective configuration with every layer (system, managed, this directory's project layers, relay's Codex home), for ${which}`);
|
|
348
|
+
if (checks.some((c) => c.stage2))
|
|
349
|
+
line("", `Codex ${checks.filter((c) => c.stage2).map((c) => c.access).join(" and ")} jobs run under stage 2 here: see the codex stage 2 line`);
|
|
350
|
+
// What Codex's own shell_environment_policy does with the names relay releases, as the turn says it in a note.
|
|
351
|
+
const env = judged.find((c) => !c.problem);
|
|
352
|
+
if (env?.note)
|
|
353
|
+
warn("codex env", `for a Codex job ${where}: ${env.note}`);
|
|
354
|
+
else if (env?.released.length)
|
|
355
|
+
line("codex env", `for a Codex job ${where}, Codex passes the names relay releases to it (${env.released.join(", ")}) to the commands it runs, going by its effective configuration`);
|
|
356
|
+
}
|
|
357
|
+
// The person's own Codex home: their Codex sessions' (relay's registration there is the codex mcp line), not a layer of relay's jobs.
|
|
358
|
+
line("your codex", `${path.dirname(userCodexConfigFile())}: your own Codex's home, for your Codex sessions. Relay's Codex jobs do not read it: they run with relay's Codex home (${relayCodexHome(cfg)}), so its config.toml, rules, skills, AGENTS.md and login do not apply to them`);
|
|
359
|
+
// Exec-policy rules: what an allow rule does under relay's profile, and the network fallback.
|
|
360
|
+
const codexEnv = { ...process.env, CODEX_HOME: relayCodexHome(cfg) };
|
|
361
|
+
line("codex rules", codexRulesDoctor(codexEnv));
|
|
362
|
+
// Stage 2 (raw network, backends/codex-stage2.ts), only while switched on: the settings its
|
|
363
|
+
// admission needs, read as admission reads them. Codex's sandbox is off on those turns and relay's
|
|
364
|
+
// own confines their commands, so the profile judged above does not apply to them.
|
|
365
|
+
if (stage2Enabled(process.env, cfg)) {
|
|
366
|
+
const wrong = stage2SettingsProblems(cfg, codexEnv, codexVersion(cfg.targets.codex.bin, codexEnv));
|
|
367
|
+
if (wrong.length)
|
|
368
|
+
warn("codex stage 2", `relay refuses Codex stage-2 jobs here: ${wrong.join("; ")}; no native strict or raw fallback`);
|
|
369
|
+
else
|
|
370
|
+
line("codex stage 2", "switched on: standing network grants (including child_network and kept grants on resume) use relay's executor and mediated proxy each turn; raw grants use raw egress. Codex's sandbox is off, relay confines commands and reads settings back. No Go/Swift TLS until Release B; tools ignoring proxy variables fail closed. Hosted search remains at OpenAI, disabled with never.hosts");
|
|
371
|
+
// Each turn's teardown asks the kernel which processes are the turn's (the survivor sweep); without the helper, every turn is refused.
|
|
372
|
+
const noSweep = sandboxCheckUnavailable();
|
|
373
|
+
if (noSweep)
|
|
374
|
+
warn("codex stage 2 sweep", `relay refuses Codex stage-2 jobs here: ${noSweep}. Rebuild relay where Xcode's command line tools are installed (\`npm run build\`), then restart it`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
// Write jobs run in git worktrees. On a Mac without the developer tools /usr/bin/git is a stub
|
|
378
|
+
// that opens an installer window, so it is not run unless the tools are there.
|
|
379
|
+
const git = gitExecutable();
|
|
380
|
+
const stub = git === "/usr/bin/git" && process.platform === "darwin" && spawnSync(systemTool("/usr/bin/xcode-select"), ["-p"], { encoding: "utf8" }).status !== 0;
|
|
381
|
+
const gitVersion = git && !stub ? spawnSync(git, ["--version"], { encoding: "utf8" }) : null;
|
|
382
|
+
if (!gitVersion || gitVersion.error || gitVersion.status !== 0)
|
|
383
|
+
fail("git", `not found on PATH, or it does not run. Relay needs git${stub ? "; install Apple's command line tools with `xcode-select --install`" : ""}`);
|
|
384
|
+
else
|
|
385
|
+
line("git", `${first(gitVersion.stdout)} at ${git}`);
|
|
386
|
+
// Which commit dist/ was built from, against the commit the checkout is at now. A pull or a
|
|
387
|
+
// sync job's fast-forward changes the sources without rebuilding, which leaves the old code running.
|
|
388
|
+
// An npm install has no checkout: its build is named by relay's build identity (the version and the
|
|
389
|
+
// hash a shipped Codex pin names, core/build-identity.ts), with the commit its stamp records.
|
|
390
|
+
const stamp = buildInfo();
|
|
391
|
+
const npmName = npmInstallName();
|
|
392
|
+
const rebuild = `cd ${sh([ROOT])} && npm ci && npm run build, then relay install <host> --write and restart the host's sessions`;
|
|
393
|
+
if (npmName) {
|
|
394
|
+
const from = stamp?.commit ? `; built from ${stamp.commit}${stamp.dirty ? " with uncommitted changes" : ""}${stamp.built_at ? ` on ${stamp.built_at}` : ""}` : "";
|
|
395
|
+
let id = null;
|
|
396
|
+
try {
|
|
397
|
+
id = describeBuild(buildIdentity(ROOT));
|
|
398
|
+
}
|
|
399
|
+
catch (err) {
|
|
400
|
+
warn("build", `an npm install of ${npmName} (no git checkout), but relay could not take its build identity: ${errText(err)}. Reinstall it: npm install -g ${npmName}@${relayVersion()}`);
|
|
401
|
+
}
|
|
402
|
+
if (id)
|
|
403
|
+
line("build", `an npm install of ${npmName} (no git checkout): ${id}${from}`);
|
|
404
|
+
}
|
|
405
|
+
else if (!stamp)
|
|
406
|
+
warn("build", `no build stamp (${path.join("dist", "build-info.json")}), so relay cannot tell which commit dist/ was built from. Rebuild: ${rebuild}`);
|
|
407
|
+
else if (!stamp.commit)
|
|
408
|
+
line("build", "built outside a git checkout, so relay cannot tell which commit it was built from");
|
|
409
|
+
else {
|
|
410
|
+
const top = gitVersion?.status === 0 ? spawnSync(git, ["-C", ROOT, "rev-parse", "--show-toplevel"], { encoding: "utf8" }) : null;
|
|
411
|
+
const head = top?.status === 0 && canonical(top.stdout.trim()) === canonical(ROOT) ? spawnSync(git, ["-C", ROOT, "rev-parse", "--verify", "-q", "HEAD"], { encoding: "utf8" }) : null;
|
|
412
|
+
const at = head?.status === 0 ? head.stdout.trim() : null;
|
|
413
|
+
const built = `built from ${stamp.commit}${stamp.dirty ? " with uncommitted changes" : ""}${stamp.built_at ? ` on ${stamp.built_at}` : ""}`;
|
|
414
|
+
if (!at && !fs.existsSync(path.join(ROOT, ".git")))
|
|
415
|
+
line("build", `${built}; ${ROOT} is not a git checkout or an npm install, so there is no checkout's HEAD to compare it with`);
|
|
416
|
+
else if (!at)
|
|
417
|
+
line("build", `${built}; relay could not read the checkout's HEAD`);
|
|
418
|
+
else if (at === stamp.commit)
|
|
419
|
+
line("build", `${built}, the checkout's HEAD`);
|
|
420
|
+
else
|
|
421
|
+
warn("build", `${built}, but the checkout is now at ${at}, so the code running is not what the checkout holds. Rebuild: ${rebuild}`);
|
|
422
|
+
}
|
|
423
|
+
/** One line on whether a host's registration runs this checkout's launcher, in the current form. */
|
|
424
|
+
const here = npmName ? "npm install" : "checkout";
|
|
425
|
+
const registration = (label, host, command, args, extra = "", name = "relay") => {
|
|
426
|
+
const again = reinstallCommand("install", host);
|
|
427
|
+
if (relayCommandIdentity(command, args) === "ambiguous")
|
|
428
|
+
return warn(label, `a server named ${name} is registered, but ${ambiguousNote(command)}. If it is an old relay of yours: ${again} --force (what is there is saved first)`);
|
|
429
|
+
if (!isRelayCommand(command, args))
|
|
430
|
+
return warn(label, `a server named ${name} is registered, but it is not relay's (command ${String(command)})`);
|
|
431
|
+
if (!mine(command))
|
|
432
|
+
return warn(label, `relay is registered from another checkout or install: ${String(command)}. To use this one: ${again}`);
|
|
433
|
+
const list = args;
|
|
434
|
+
if (!list.includes("--host"))
|
|
435
|
+
return warn(label, `relay is registered from this ${here} in an earlier form (no --host). Update it: ${again}`);
|
|
436
|
+
// --host is the family relay serves the host's sessions as, so it must name a known target and
|
|
437
|
+
// be this host's: relay refuses every call under an unknown one, and under another family's it
|
|
438
|
+
// would judge the cross-family rule for the wrong family.
|
|
439
|
+
const value = list[list.indexOf("--host") + 1];
|
|
440
|
+
const own = hostDef(host).target;
|
|
441
|
+
if (!isTarget(value)) {
|
|
442
|
+
return fail(label, `relay is registered with --host ${value === undefined ? "and no value" : JSON.stringify(value)}, which is not a host relay knows (${TARGETS.map((t) => targetLabel(t, t.id)).join(", ")}), so relay refuses every call there. Fix it: ${again}`);
|
|
443
|
+
}
|
|
444
|
+
if (value !== own) {
|
|
445
|
+
return fail(label, `relay is registered with --host ${value}, but ${hostDef(host).name}'s sessions are ${targetLabel(targetDef(own))} (--host ${own}), so relay would judge their calls as the wrong family. Fix it: ${again}`);
|
|
446
|
+
}
|
|
447
|
+
line(label, `relay registered, from this ${here}${extra}`);
|
|
448
|
+
};
|
|
449
|
+
const report = { line, warn, fail, registration };
|
|
450
|
+
// Each CLI's own login command. Relay runs each CLI under whatever login it reports here.
|
|
451
|
+
for (const h of HOSTS)
|
|
452
|
+
if (h.doctorLogin && present[h.target])
|
|
453
|
+
h.doctorLogin(cfg, report);
|
|
454
|
+
const bin = path.dirname(linkPath());
|
|
455
|
+
const found = locate("relay");
|
|
456
|
+
// Which `relay` a shell runs: this relay's launcher (the link install makes) or npm's global
|
|
457
|
+
// command for this installed package are both this relay; anything else is not (relayCommandKind).
|
|
458
|
+
const kind = found ? relayCommandKind(found) : null;
|
|
459
|
+
if (onPath(bin))
|
|
460
|
+
line("PATH", `${bin} is on PATH`);
|
|
461
|
+
else if (kind === "npm")
|
|
462
|
+
line("PATH", `${bin} is not on PATH; not needed, since npm's command for this relay is`);
|
|
463
|
+
else
|
|
464
|
+
warn("PATH", `${bin} is not on PATH, so the link relay install makes there will not be found`);
|
|
465
|
+
if (!found)
|
|
466
|
+
warn("relay on PATH", `none. Run ${reinstallCommand("install", "<host>")}, or use ${LAUNCHER} directly`);
|
|
467
|
+
else if (!kind)
|
|
468
|
+
warn("relay on PATH", `${found} is not this relay (${ROOT}): it leads to ${canonical(found)}`);
|
|
469
|
+
else {
|
|
470
|
+
const what = `${found} (${kind === "launcher" ? "this relay's launcher" : "npm's global command for this relay"})`;
|
|
471
|
+
// npm's command starts with `#!/usr/bin/env node`: the first node on PATH, where the launcher
|
|
472
|
+
// chooses a Node of its own. Only the Node running this doctor is known to run relay. A relative
|
|
473
|
+
// entry ahead of either directory lets a shell's current directory supply the command or its node.
|
|
474
|
+
const node = kind === "npm" ? locate("node") : null;
|
|
475
|
+
const relative = relativePathEntryBefore(path.dirname(found)) ?? (node ? relativePathEntryBefore(path.dirname(node)) : null);
|
|
476
|
+
if (relative)
|
|
477
|
+
warn("relay on PATH", `${what}, but PATH has the relative entry ${JSON.stringify(relative)} ahead of it${kind === "npm" ? " or of its node" : ""}, so in some directories a shell runs another \`relay\`${kind === "npm" ? " or \`node\`" : ""} instead`);
|
|
478
|
+
else if (kind === "npm" && (!node || canonical(node) !== canonical(process.execPath))) {
|
|
479
|
+
warn("relay on PATH", `${what}, but it runs the first node on PATH, ${node ?? "of which there is none"}, not the Node running this doctor (${process.execPath}), so relay cannot tell that it runs relay (Node ${MIN_NODE.join(".")} or newer). Run relay doctor through it, or use ${LAUNCHER}`);
|
|
480
|
+
}
|
|
481
|
+
else
|
|
482
|
+
line("relay on PATH", what);
|
|
483
|
+
}
|
|
484
|
+
line("state dir", relayHome());
|
|
485
|
+
if (cfgProblem)
|
|
486
|
+
fail("config", cfgProblem);
|
|
487
|
+
else
|
|
488
|
+
line("config", `${configPath()}${fs.existsSync(configPath()) ? "" : " (not present; defaults in use)"}`);
|
|
489
|
+
// What relay keeps (docs/security-model.md, "What is kept"), and whether the disk has room for more.
|
|
490
|
+
const stored = storageReport(controlDirUsage(relayHome()), cfg);
|
|
491
|
+
stored.lines.forEach((l, i) => line(i ? "" : "records", l));
|
|
492
|
+
if (stored.warning)
|
|
493
|
+
warn("disk", stored.warning);
|
|
494
|
+
for (const problem of turnTempProblems())
|
|
495
|
+
warn("temp dirs", problem);
|
|
496
|
+
line("limits", `max_depth=${cfg.max_depth} max_concurrent=${cfg.max_concurrent} block_s=${cfg.block_s}`);
|
|
497
|
+
const dflt = (t) => `${cfg.targets[t].default_model ?? "(CLI default)"} / ${cfg.targets[t].default_effort ?? "(CLI default)"}` +
|
|
498
|
+
(cfg.targets[t].speed && cfg.targets[t].speed !== "standard" ? ` / ${cfg.targets[t].speed} speed` : "");
|
|
499
|
+
line("defaults", TARGETS.filter((t) => cfg.targets[t.id].enabled).map((t) => `${targetLabel(t, t.id)}: ${dflt(t.id)}`).join(" "));
|
|
500
|
+
// Authentication is a ceiling; exact environment selection is separately required.
|
|
501
|
+
const enabled = TARGETS.filter((t) => cfg.targets[t.id].enabled);
|
|
502
|
+
line("credentials", enabled.map((t) => `${targetLabel(t, t.id)}: ${t.capabilities.login === "key-only" ? "every inherited API key removed; only the key from its key file" : authFor(cfg, t.id) === "any" ? "only its own selected authentication inputs eligible; every other vendor's removed" : "every vendor's API keys removed"}`).join("; "));
|
|
503
|
+
for (const t of TARGETS) {
|
|
504
|
+
let preview;
|
|
505
|
+
try {
|
|
506
|
+
preview = selectEnvironment(t.id, cfg, capturedRootEnvironment);
|
|
507
|
+
}
|
|
508
|
+
catch (err) {
|
|
509
|
+
line("environment", `${t.id}: refused: ${errText(err)}`);
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
line("environment", `${t.id}: ${preview.policy.policy}; standing pass names: ${preview.policy.pass.join(", ") || "none"}; request-eligible names: ${preview.policy.request.join(", ") || "none"}`);
|
|
513
|
+
// One line per outcome and reason, naming every variable it covers (included first): a line
|
|
514
|
+
// per variable made this section as long as the environment, for each target.
|
|
515
|
+
const outcomes = new Map();
|
|
516
|
+
for (const d of [...preview.diagnostics].sort((a, b) => Number(b.included) - Number(a.included))) {
|
|
517
|
+
const what = `${d.included ? "included" : "dropped"} (${d.reason})`;
|
|
518
|
+
outcomes.set(what, [...(outcomes.get(what) ?? []), d.name]);
|
|
519
|
+
}
|
|
520
|
+
for (const [what, names] of outcomes)
|
|
521
|
+
line("", `${t.id}: ${what}, ${names.length} name${names.length === 1 ? "" : "s"}: ${names.join(", ")}`);
|
|
522
|
+
line("", `${t.id}: HOME${t.id === "codex" ? ", CODEX_HOME" : ""}, and CLAUDE_CONFIG_DIR only when relay's environment sets it: supplied as trusted backend roots; relay identities, temp and confinement controls supplied by backend`);
|
|
523
|
+
}
|
|
524
|
+
doctorExtensions(cfg, line, warn);
|
|
525
|
+
// Relay-enforced confinement: reported, never a failure here, since only harnesses that need it are refused.
|
|
526
|
+
const confined = confinementSummary();
|
|
527
|
+
line("confinement", confined.status);
|
|
528
|
+
for (const e of confined.enforces)
|
|
529
|
+
line("", `${confined.enabled ? "enforces" : "once enabled, enforces"}: ${e}`);
|
|
530
|
+
for (const d of confined.doesNot)
|
|
531
|
+
line("", `does not: ${d}`);
|
|
532
|
+
for (const h of HOSTS)
|
|
533
|
+
h.doctorRegistration(cfg, present, report);
|
|
534
|
+
// Whether relay may take an answer in a Claude Code session as the person's, from the settings
|
|
535
|
+
// files that apply in this directory (src/core/claude-settings.ts): the approval dialog and
|
|
536
|
+
// confirm are each withheld where the mode or a hook could answer in the person's place.
|
|
537
|
+
let consent;
|
|
538
|
+
try {
|
|
539
|
+
consent = settingsAnswerForPerson(process.env, process.cwd(), []);
|
|
540
|
+
}
|
|
541
|
+
catch (err) {
|
|
542
|
+
const why = `relay could not read Claude Code's settings (${errText(err).slice(0, 80)})`;
|
|
543
|
+
consent = { dialog: why, confirm: why };
|
|
544
|
+
}
|
|
545
|
+
line("claude consent", `Claude Code sessions started in ${process.cwd()} (local settings read there, at its repository root and at its main checkout's root): approval dialog ${consent.dialog ? `withheld (${consent.dialog})` : "can be shown"}; confirm ${consent.confirm ? `withheld (${consent.confirm})` : "can be offered"}`);
|
|
546
|
+
line("", "judged again when each session starts relay, with its settings, installed plugin hooks and manifest declarations, skill/subagent frontmatter, and command line (--dangerously-skip-permissions, --permission-mode, --settings); unreadable or uninspectable hook sources withhold consent routes. Command-line-only agent definitions, changes after startup and settings from the claude.ai console remain outside these checks");
|
|
547
|
+
try {
|
|
548
|
+
const inbound = inboundSettings(process.env, process.cwd());
|
|
549
|
+
for (const setting of inbound)
|
|
550
|
+
line("claude inbox", `crossSessionInbound ${setting.value} in ${setting.source}`);
|
|
551
|
+
if (!inbound.length)
|
|
552
|
+
line("claude inbox", "crossSessionInbound: no value found in readable settings files for this directory (Claude Code's per-message defaults may apply)");
|
|
553
|
+
}
|
|
554
|
+
catch {
|
|
555
|
+
warn("claude inbox", "crossSessionInbound: unable to inspect the settings files for this directory");
|
|
556
|
+
}
|
|
557
|
+
line("", "Inbox values above are observed sources, not verified effective session settings: command-line overrides, settings-source selection, console-managed settings and runtime changes are not visible to doctor. hold withholds messages and refuse drops them, including relay notices; events still arrive with the next tool result. Every inbox pointer must pass status notice verification before action.");
|
|
558
|
+
say(`\n${failed ? `${failed} requirement${failed === 1 ? "" : "s"} not met` : "requirements met"}${warned ? `, ${warned} warning${warned === 1 ? "" : "s"}` : ""}`);
|
|
559
|
+
if (failed)
|
|
560
|
+
process.exitCode = 1;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Extensions (docs/extensions.md): what each target's launched agents may be given, whether the
|
|
564
|
+
* skills and relay's MCP definitions are there, and that the definitions file, which may hold
|
|
565
|
+
* credentials, is private. Then the legacy settings that waive relay's isolation of launched
|
|
566
|
+
* agents (review C17), which no extension can be combined with.
|
|
567
|
+
*/
|
|
568
|
+
function doctorExtensions(cfg, line, warn) {
|
|
569
|
+
const given = TARGETS.filter((t) => cfg.targets[t.id].enabled && hasExtensions(cfg.targets[t.id]));
|
|
570
|
+
if (!given.length)
|
|
571
|
+
line("extensions", "none allowed (targets.<id>.skills, targets.<id>.mcp_servers); launched agents get relay's isolation only");
|
|
572
|
+
let defs = null;
|
|
573
|
+
let defsProblem = null;
|
|
574
|
+
if (given.some((t) => cfg.targets[t.id].mcp_servers?.length)) {
|
|
575
|
+
try {
|
|
576
|
+
defs = readMcpFile();
|
|
577
|
+
const mode = fs.statSync(mcpFile()).mode;
|
|
578
|
+
if (mode & 0o077)
|
|
579
|
+
warn("mcp.json", `${mcpFile()} can be read by other users (mode ${(mode & 0o777).toString(8)}); it may hold credentials. chmod 600 it`);
|
|
580
|
+
}
|
|
581
|
+
catch (err) {
|
|
582
|
+
defsProblem = errText(err);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
for (const t of given) {
|
|
586
|
+
const e = cfg.targets[t.id];
|
|
587
|
+
const label = "extensions";
|
|
588
|
+
const skills = resolveSkills(e.skills, t.id);
|
|
589
|
+
if ("reason" in skills)
|
|
590
|
+
warn(label, `${t.id}: skills: ${skills.reason}; a call asking for extensions is refused until that is fixed`);
|
|
591
|
+
else if (skills.length)
|
|
592
|
+
line(label, `${t.id}: skills ${skills.map((s) => s.name).join(", ")} (copied for each turn: each skill's regular files, without hooks, MCP servers, agent definitions or pre-approved tools)`);
|
|
593
|
+
const servers = e.mcp_servers ?? [];
|
|
594
|
+
if (!servers.length)
|
|
595
|
+
continue;
|
|
596
|
+
const missing = defs ? servers.map(serverOf).filter((n) => !Object.hasOwn(defs, n)) : [];
|
|
597
|
+
if (defsProblem)
|
|
598
|
+
warn(label, `${t.id}: MCP servers ${servers.map(serverOf).join(", ")}: ${defsProblem}; a call asking for extensions is refused until that is fixed`);
|
|
599
|
+
else if (missing.length)
|
|
600
|
+
warn(label, `${t.id}: MCP servers ${missing.join(", ")} are not defined in ${mcpFile()}; a call asking for extensions is refused until they are`);
|
|
601
|
+
else {
|
|
602
|
+
const shown = servers.map((x) => (typeof x === "string" || !x.allow_tools?.length ? serverOf(x) : `${x.name} (${x.allow_tools.join(", ")} without asking)`));
|
|
603
|
+
line(label, `${t.id}: MCP servers ${shown.join(", ")}, defined in ${mcpFile()}`);
|
|
604
|
+
}
|
|
605
|
+
line("", "each runs outside the agent's sandbox as your own process, through relay; every other tool call asks you, and a job given them gets no network and no write paths outside its worktree, and may not start or steer other relay agents");
|
|
606
|
+
}
|
|
607
|
+
// child_settings concerns Claude Code's settings files alone, so only Claude's extensions conflict with it.
|
|
608
|
+
for (const [key, on, what, whose] of [
|
|
609
|
+
["child_mcp", cfg.child_mcp === "inherit", "every MCP server of yours loads in launched agents, ungated", "Extensions"],
|
|
610
|
+
["child_hooks", cfg.child_hooks, "your hooks run in launched agents", "Extensions"],
|
|
611
|
+
["child_settings", cfg.child_settings === "inherit", "launched Claude agents load your settings, plugins and skills among them", "Extensions for Claude agents"],
|
|
612
|
+
]) {
|
|
613
|
+
if (on)
|
|
614
|
+
warn("isolation", `${key} waives relay's isolation of launched agents: ${what}. ${whose} cannot be combined with it; the per-target allowlists (targets.<id>.skills, targets.<id>.mcp_servers) are the gated way`);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/** What `npm run build` recorded about the build (scripts/stamp-build.mjs), or null without a readable stamp. */
|
|
618
|
+
function buildInfo() {
|
|
619
|
+
try {
|
|
620
|
+
const info = JSON.parse(fs.readFileSync(path.join(ROOT, "dist", "build-info.json"), "utf8"));
|
|
621
|
+
if (info === null || typeof info !== "object" || (info.commit !== null && typeof info.commit !== "string"))
|
|
622
|
+
return null;
|
|
623
|
+
return { commit: info.commit, dirty: typeof info.dirty === "boolean" ? info.dirty : null, built_at: typeof info.built_at === "string" ? info.built_at : undefined };
|
|
624
|
+
}
|
|
625
|
+
catch {
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
export { relayVersion };
|