codex-plugin-doctor 1.20.0 → 1.22.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.
package/README.md
CHANGED
|
@@ -298,7 +298,7 @@ codex-plugin-doctor check . --json --runtime --verbose-runtime
|
|
|
298
298
|
|
|
299
299
|
`self-test` runs the bundled runtime-complete sample through static validation, runtime MCP probes, and the compatibility scorecard. It is the fastest post-install check after `npm install -g codex-plugin-doctor`.
|
|
300
300
|
|
|
301
|
-
`doctor` checks the local environment, including package version, platform, Node version, npm global prefix, Codex home, and Codex plugin cache visibility. The text output also includes recommended next commands for self-test, installed plugin discovery, runtime checks, compatibility scoring, and CI setup. `doctor contract` publishes the machine-readable output contract, including public JSON schema surfaces, stable-through-1.0 compatibility metadata, and a frozen rule catalog digest. Add `--json` for automation or `--output output-contract.json` to write the contract to disk. `doctor corpus` runs the bundled validation corpus against healthy runtime, risky security, starter skill, and generic MCP packages, then reports whether each case matched its expected outcome. Add `--json` for automation or `--output validation-corpus.json` to write the corpus report to disk. `doctor npm <package>` runs a preinstall scan by packing the npm package with scripts disabled, extracting the publish tarball, and running validation, security, trust, and recommendation checks against the shipped contents. Use a published Codex plugin package as the target; scanning `codex-plugin-doctor` itself intentionally reports a missing plugin manifest because this CLI package is not a plugin package. Add `--json` for automation or `--output npm-preinstall.json` to write the report to disk. `doctor attest <path>` creates a local attestation with stable package/report digests, validation/security/compatibility/trust summary, and verification metadata. Add `--sign-key-env NAME` to attach a local HMAC-SHA256 signature without printing the secret, or `--json --output attestation.json` to write the artifact to disk. `doctor attest verify <attestation.json> --target <path> --sign-key-env NAME` recomputes the package fingerprint, report digest, and HMAC signature offline; verification intentionally treats `generatedAt`, `targetPath`, `verification`, and `signature.keyHint` as unsigned display metadata. `doctor runtime-plan <path>` creates a non-executing runtime plan that lists MCP server commands, safe probe methods, risk reasons, and a stable approval digest before any local server is started. Add `--markdown --output runtime-plan.md` to preserve a review-ready approval artifact with the execution boundary, checklist, servers, probes, and risk reasons. `doctor runtime-policy <path>` evaluates the same runtime plan and security signals, then recommends `allow`, `review`, `sandbox_recommended`, or `deny` before local MCP execution starts. `doctor review-bundle <path> --output <dir> --sign-key-env NAME` writes a signed review directory with runtime plan, runtime policy, attestation, release evidence, manifest, Markdown summary files, and SHA-256 file integrity digests. `doctor review-bundle verify <bundle-dir> --target <path> --sign-key-env NAME` verifies the bundle manifest, expected files, manifest integrity digests, runtime artifacts, signed attestation, and signed release evidence offline before a reviewer trusts the handoff. `doctor review-bundle diff --before <dir> --after <dir>` compares two review bundles and flags risk-increasing changes in status, runtime policy, release readiness, signatures, release evidence, and runtime plan digest. `check --runtime --require-runtime-approval --runtime-approval-digest <digest>` refuses to run runtime probes unless the current plan digest matches the approved digest. `doctor release-evidence <path> --sign-key-env NAME` creates one redacted release bundle with signed attestation, offline verification, corpus, performance, security, trust, package metadata, git release gates, and runtime approval status. Strict release evidence requires a clean tagged worktree; use `--allow-dirty` or `--allow-untagged` only for local rehearsal. `doctor release-evidence verify <evidence.json> --target <path> --sign-key-env NAME` verifies a shared release evidence artifact offline against an explicit package path; the artifact target path is treated as display metadata, not trusted input. `doctor release-evidence asset <path> --tag <tag> --output <evidence.json> --sign-key-env NAME` writes a signed release evidence file and prints the `gh release upload` command; add `--upload` to run the upload through GitHub CLI with `--clobber`. `doctor inspector <path>` builds a safe MCP Inspector launch command from a packaged `.mcp.json` file without starting the Inspector proxy automatically. Use `--server <name>` when the package contains multiple MCP server entries. `doctor diff --before <path> --after <path>` compares two package roots and reports new findings, resolved findings, trust score delta, and whether risk increased. `doctor recommend <path>` turns validation, security, and compatibility signals into a prioritized action plan with blocker, high, medium, and info actions. Add `--json` for automation or `--output recommendations.json` to write the report to disk. `doctor trust <path>` creates a local trust score from package lifecycle scripts, dependency specs, and MCP security findings. Use it before release when you want supply-chain risks summarized as one score. `doctor perf <path>` profiles the shared package analysis pipeline and reports per-stage durations for validation, config, security, compatibility, trust, recommendations, and total runtime. Add `--max-total-ms <ms>` or repeatable `--max-stage-ms stage=ms` to fail CI when a budget is exceeded. `doctor mcp <path>` exposes the generic MCP static health report under the doctor command family without starting local MCP servers. `doctor export --bundle <path>` creates a redacted operator handoff bundle that includes validation JSON, security scorecard data, compatibility matrix, recommendations, and trust score in one file. `doctor snapshot` creates a redacted diagnostics bundle with environment health, client config readiness, installed plugin metadata, and next commands. Add `--json` for machine-readable output or `--output doctor-snapshot.json` to write the bundle to disk. `doctor clients` reports local Codex, Claude Desktop, Cursor, Cline, and Windsurf config readiness. `doctor --update-check` compares the installed CLI version with the latest npm version and prints the upgrade command when a newer release is available.
|
|
301
|
+
`doctor` checks the local environment, including package version, platform, Node version, npm global prefix, Codex home, and Codex plugin cache visibility. The text output also includes recommended next commands for self-test, installed plugin discovery, runtime checks, compatibility scoring, and CI setup. `doctor contract` publishes the machine-readable output contract, including public JSON schema surfaces, stable-through-1.0 compatibility metadata, and a frozen rule catalog digest. Add `--json` for automation or `--output output-contract.json` to write the contract to disk. `doctor corpus` runs the bundled validation corpus against healthy runtime, risky security, starter skill, and generic MCP packages, then reports whether each case matched its expected outcome. Add `--json` for automation or `--output validation-corpus.json` to write the corpus report to disk. `doctor npm <package>` runs a preinstall scan by packing the npm package with scripts disabled, extracting the publish tarball, and running validation, security, trust, and recommendation checks against the shipped contents. The JSON report includes tarball metadata such as filename, path, integrity, shasum, sizes, file count, and extracted package root so automation can prove which archive was scanned. Use a published Codex plugin package as the target; scanning `codex-plugin-doctor` itself intentionally reports a missing plugin manifest because this CLI package is not a plugin package. Add `--json` for automation or `--output npm-preinstall.json` to write the report to disk. `doctor attest <path>` creates a local attestation with stable package/report digests, validation/security/compatibility/trust summary, and verification metadata. Add `--sign-key-env NAME` to attach a local HMAC-SHA256 signature without printing the secret, or `--json --output attestation.json` to write the artifact to disk. `doctor attest verify <attestation.json> --target <path> --sign-key-env NAME` recomputes the package fingerprint, report digest, and HMAC signature offline; verification intentionally treats `generatedAt`, `targetPath`, `verification`, and `signature.keyHint` as unsigned display metadata. `doctor runtime-plan <path>` creates a non-executing runtime plan that lists MCP server commands, safe probe methods, risk reasons, and a stable approval digest before any local server is started. Add `--markdown --output runtime-plan.md` to preserve a review-ready approval artifact with the execution boundary, checklist, servers, probes, and risk reasons. `doctor runtime-policy <path>` evaluates the same runtime plan and security signals, then recommends `allow`, `review`, `sandbox_recommended`, or `deny` before local MCP execution starts. `doctor review-bundle <path> --output <dir> --sign-key-env NAME` writes a signed review directory with runtime plan, runtime policy, attestation, release evidence, manifest, Markdown summary files, and SHA-256 file integrity digests. `doctor review-bundle verify <bundle-dir> --target <path> --sign-key-env NAME` verifies the bundle manifest, expected files, manifest integrity digests, runtime artifacts, signed attestation, and signed release evidence offline before a reviewer trusts the handoff. `doctor review-bundle diff --before <dir> --after <dir>` compares two review bundles and flags risk-increasing changes in status, runtime policy, release readiness, signatures, release evidence, and runtime plan digest. `check --runtime --require-runtime-approval --runtime-approval-digest <digest>` refuses to run runtime probes unless the current plan digest matches the approved digest. `doctor release-evidence <path> --sign-key-env NAME` creates one redacted release bundle with signed attestation, offline verification, corpus, performance, security, trust, package metadata, git release gates, and runtime approval status. Strict release evidence requires a clean tagged worktree; use `--allow-dirty` or `--allow-untagged` only for local rehearsal. `doctor release-evidence verify <evidence.json> --target <path> --sign-key-env NAME` verifies a shared release evidence artifact offline against an explicit package path; the artifact target path is treated as display metadata, not trusted input. `doctor release-evidence asset <path> --tag <tag> --output <evidence.json> --sign-key-env NAME` writes a signed release evidence file and prints the `gh release upload` command; add `--upload` to run the upload through GitHub CLI with `--clobber`. `doctor inspector <path>` builds a safe MCP Inspector launch command from a packaged `.mcp.json` file without starting the Inspector proxy automatically. Use `--server <name>` when the package contains multiple MCP server entries. `doctor diff --before <path> --after <path>` compares two package roots and reports new findings, resolved findings, trust score delta, and whether risk increased. `doctor recommend <path>` turns validation, security, and compatibility signals into a prioritized action plan with blocker, high, medium, and info actions. Add `--json` for automation or `--output recommendations.json` to write the report to disk. `doctor trust <path>` creates a local trust score from package lifecycle scripts, dependency specs, and MCP security findings. Use it before release when you want supply-chain risks summarized as one score. `doctor perf <path>` profiles the shared package analysis pipeline and reports per-stage durations for validation, config, security, compatibility, trust, recommendations, and total runtime. Add `--max-total-ms <ms>` or repeatable `--max-stage-ms stage=ms` to fail CI when a budget is exceeded. `doctor mcp <path>` exposes the generic MCP static health report under the doctor command family without starting local MCP servers. `doctor export --bundle <path>` creates a redacted operator handoff bundle that includes validation JSON, security scorecard data, compatibility matrix, recommendations, and trust score in one file. `doctor snapshot` creates a redacted diagnostics bundle with environment health, client config readiness, installed plugin metadata, and next commands. Add `--json` for machine-readable output or `--output doctor-snapshot.json` to write the bundle to disk. `doctor clients` reports local Codex, Claude Desktop, Cursor, Cline, and Windsurf config readiness. `doctor --update-check` compares the installed CLI version with the latest npm version and prints the upgrade command when a newer release is available.
|
|
302
302
|
|
|
303
303
|
`audit --installed` runs a local ecosystem audit against every discovered Codex plugin in the installed plugin cache. Add `--security` to include security scorecards, `--compat` to include the all-client compatibility matrix, and `--json --output local-audit.json` when you want a shareable machine-readable report. Add `--cache` to reuse unchanged plugin results between runs; add `--changed` to only report plugins whose fingerprint changed since the last cached audit. Use `--cache-file path/to/audit-cache.json` when CI or scripted runs need an explicit cache location.
|
|
304
304
|
|
|
@@ -370,9 +370,9 @@ jobs:
|
|
|
370
370
|
runs-on: ubuntu-latest
|
|
371
371
|
steps:
|
|
372
372
|
- uses: actions/checkout@v5
|
|
373
|
-
- uses: Esquetta/CodexPluginDoctor@v1.
|
|
373
|
+
- uses: Esquetta/CodexPluginDoctor@v1.22.0
|
|
374
374
|
with:
|
|
375
|
-
version: "1.
|
|
375
|
+
version: "1.22.0"
|
|
376
376
|
path: .
|
|
377
377
|
runtime: "true"
|
|
378
378
|
policy: codex-publish
|
package/dist/core/dep-audit.js
CHANGED
|
@@ -15,7 +15,11 @@ async function fileExists(filePath) {
|
|
|
15
15
|
}
|
|
16
16
|
async function runNpmAudit(cwd) {
|
|
17
17
|
return new Promise((resolve, reject) => {
|
|
18
|
-
|
|
18
|
+
const command = process.platform === "win32" ? process.env.ComSpec ?? "cmd.exe" : "npm";
|
|
19
|
+
const args = process.platform === "win32"
|
|
20
|
+
? ["/d", "/s", "/c", "npm", "audit", "--json"]
|
|
21
|
+
: ["audit", "--json"];
|
|
22
|
+
execFile(command, args, { cwd, timeout: 120_000 }, (error, stdout, stderr) => {
|
|
19
23
|
const parsed = (() => {
|
|
20
24
|
try {
|
|
21
25
|
return JSON.parse(stdout);
|
|
@@ -13,6 +13,18 @@ export interface DoctorNpmPackageReport {
|
|
|
13
13
|
version: string | null;
|
|
14
14
|
fileCount: number | null;
|
|
15
15
|
};
|
|
16
|
+
tarball: {
|
|
17
|
+
filename: string;
|
|
18
|
+
path: string;
|
|
19
|
+
integrity: string | null;
|
|
20
|
+
shasum: string | null;
|
|
21
|
+
size: number | null;
|
|
22
|
+
unpackedSize: number | null;
|
|
23
|
+
fileCount: number | null;
|
|
24
|
+
packageRoot: string;
|
|
25
|
+
packageName: string | null;
|
|
26
|
+
packageVersion: string | null;
|
|
27
|
+
};
|
|
16
28
|
summary: {
|
|
17
29
|
status: "pass" | "warn" | "fail";
|
|
18
30
|
exitCode: 0 | 1;
|
|
@@ -7,8 +7,14 @@ import { gunzip } from "node:zlib";
|
|
|
7
7
|
import { buildDoctorRecommendationsFromAnalysis, buildPackageAnalysis } from "./package-analysis.js";
|
|
8
8
|
const execFileAsync = promisify(execFile);
|
|
9
9
|
const gunzipAsync = promisify(gunzip);
|
|
10
|
-
function npmCommand() {
|
|
11
|
-
|
|
10
|
+
function npmCommand(args) {
|
|
11
|
+
if (process.platform === "win32") {
|
|
12
|
+
return {
|
|
13
|
+
command: process.env.ComSpec ?? "cmd.exe",
|
|
14
|
+
args: ["/d", "/s", "/c", "npm", ...args]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return { command: "npm", args };
|
|
12
18
|
}
|
|
13
19
|
function isPathWithinRoot(rootPath, candidatePath) {
|
|
14
20
|
const relativePath = path.relative(rootPath, candidatePath);
|
|
@@ -80,17 +86,17 @@ async function resolvePackageSpecForPack(packageSpec) {
|
|
|
80
86
|
}
|
|
81
87
|
async function packNpmPackage(packageSpec, destinationPath) {
|
|
82
88
|
const resolvedPackageSpec = await resolvePackageSpecForPack(packageSpec);
|
|
83
|
-
const
|
|
89
|
+
const npmPackCommand = npmCommand([
|
|
84
90
|
"pack",
|
|
85
91
|
resolvedPackageSpec,
|
|
86
92
|
"--json",
|
|
87
93
|
"--ignore-scripts",
|
|
88
94
|
"--pack-destination",
|
|
89
95
|
destinationPath
|
|
90
|
-
]
|
|
96
|
+
]);
|
|
97
|
+
const { stdout } = await execFileAsync(npmPackCommand.command, npmPackCommand.args, {
|
|
91
98
|
cwd: destinationPath,
|
|
92
|
-
maxBuffer: 10 * 1024 * 1024
|
|
93
|
-
shell: process.platform === "win32"
|
|
99
|
+
maxBuffer: 10 * 1024 * 1024
|
|
94
100
|
});
|
|
95
101
|
const packEntries = JSON.parse(stdout);
|
|
96
102
|
const metadata = packEntries[0];
|
|
@@ -113,6 +119,9 @@ export async function buildDoctorNpmPackageReport(packageSpec, options = {}) {
|
|
|
113
119
|
const packageRoot = await directoryExists(path.join(extractPath, "package"))
|
|
114
120
|
? path.join(extractPath, "package")
|
|
115
121
|
: extractPath;
|
|
122
|
+
const packageName = typeof metadata.name === "string" ? metadata.name : null;
|
|
123
|
+
const packageVersion = typeof metadata.version === "string" ? metadata.version : null;
|
|
124
|
+
const fileCount = Array.isArray(metadata.files) ? metadata.files.length : null;
|
|
116
125
|
const analysis = await buildPackageAnalysis(packageRoot, {
|
|
117
126
|
environment: options.environment
|
|
118
127
|
});
|
|
@@ -123,9 +132,21 @@ export async function buildDoctorNpmPackageReport(packageSpec, options = {}) {
|
|
|
123
132
|
kind: "doctor.npm",
|
|
124
133
|
packageSpec,
|
|
125
134
|
package: {
|
|
126
|
-
name:
|
|
127
|
-
version:
|
|
128
|
-
fileCount
|
|
135
|
+
name: packageName,
|
|
136
|
+
version: packageVersion,
|
|
137
|
+
fileCount
|
|
138
|
+
},
|
|
139
|
+
tarball: {
|
|
140
|
+
filename: path.basename(tarballPath),
|
|
141
|
+
path: tarballPath,
|
|
142
|
+
integrity: typeof metadata.integrity === "string" ? metadata.integrity : null,
|
|
143
|
+
shasum: typeof metadata.shasum === "string" ? metadata.shasum : null,
|
|
144
|
+
size: typeof metadata.size === "number" ? metadata.size : null,
|
|
145
|
+
unpackedSize: typeof metadata.unpackedSize === "number" ? metadata.unpackedSize : null,
|
|
146
|
+
fileCount,
|
|
147
|
+
packageRoot,
|
|
148
|
+
packageName,
|
|
149
|
+
packageVersion
|
|
129
150
|
},
|
|
130
151
|
summary: {
|
|
131
152
|
status: recommendations.status,
|
|
@@ -154,6 +175,7 @@ export function renderDoctorNpmPackageReport(report, options = {}) {
|
|
|
154
175
|
"==========================",
|
|
155
176
|
`Package: ${packageLabel}`,
|
|
156
177
|
`Spec: ${report.packageSpec}`,
|
|
178
|
+
`Tarball: ${report.tarball.filename}`,
|
|
157
179
|
`Status: ${report.summary.status.toUpperCase()}`,
|
|
158
180
|
`Safe to install: ${report.summary.safeToInstall ? "yes" : "no"}`,
|
|
159
181
|
`Security: ${report.security.status.toUpperCase()} (${report.security.score}/100)`,
|
|
@@ -157,7 +157,7 @@ const publicSchemaDefinitions = [
|
|
|
157
157
|
id: "doctor.npm.json",
|
|
158
158
|
command: "codex-plugin-doctor doctor npm <package> --json",
|
|
159
159
|
outputKind: "doctor.npm",
|
|
160
|
-
required: ["schemaVersion", "kind", "generatedAt", "package", "summary", "validation", "security", "trust", "recommendations"]
|
|
160
|
+
required: ["schemaVersion", "kind", "generatedAt", "package", "tarball", "summary", "validation", "security", "trust", "recommendations"]
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
id: "doctor.risk.diff.json",
|
package/package.json
CHANGED