codex-plugin-doctor 0.19.0 → 0.20.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
|
@@ -330,15 +330,18 @@ jobs:
|
|
|
330
330
|
doctor:
|
|
331
331
|
runs-on: ubuntu-latest
|
|
332
332
|
steps:
|
|
333
|
-
- uses: actions/checkout@v4
|
|
334
|
-
- uses: Esquetta/CodexPluginDoctor@v0.
|
|
333
|
+
- uses: actions/checkout@v4
|
|
334
|
+
- uses: Esquetta/CodexPluginDoctor@v0.20.0
|
|
335
335
|
with:
|
|
336
|
-
version: "0.
|
|
336
|
+
version: "0.20.0"
|
|
337
337
|
path: .
|
|
338
|
-
runtime: "
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
runtime: "true"
|
|
339
|
+
policy: codex-publish
|
|
340
|
+
upload-artifact: "true"
|
|
341
|
+
artifact-name: codex-plugin-doctor-reports
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
The action writes `codex-plugin-doctor-summary.md`, `codex-plugin-doctor-report.json`, and optional `codex-plugin-doctor.sarif` files to `codex-plugin-doctor-reports`, appends the Markdown report to the GitHub Actions step summary, uploads the report directory as an artifact, and then returns the real validation exit code. For runtime probing, SARIF output, installed plugin cache checks, CI policy presets, and pinned release examples, see [GitHub Action Usage](./docs/engineering/github-action-usage.md).
|
|
342
345
|
|
|
343
346
|
To self-test this repository after cloning it:
|
|
344
347
|
|
package/dist/core/init-ci.js
CHANGED
|
@@ -21,6 +21,13 @@ function buildWorkflow() {
|
|
|
21
21
|
` version: \"${packageVersion}\"`,
|
|
22
22
|
" path: .",
|
|
23
23
|
" runtime: \"true\"",
|
|
24
|
+
" policy: codex-publish",
|
|
25
|
+
" json: \"true\"",
|
|
26
|
+
" markdown: \"true\"",
|
|
27
|
+
" sarif: \"true\"",
|
|
28
|
+
" upload-artifact: \"true\"",
|
|
29
|
+
" step-summary: \"true\"",
|
|
30
|
+
" artifact-name: codex-plugin-doctor-reports",
|
|
24
31
|
""
|
|
25
32
|
].join("\n");
|
|
26
33
|
}
|
|
@@ -7,6 +7,12 @@ const publicSchemaDefinitions = [
|
|
|
7
7
|
command: "codex-plugin-doctor check <path> --json",
|
|
8
8
|
required: ["schemaVersion", "generatedAt", "summary", "findings"]
|
|
9
9
|
},
|
|
10
|
+
{
|
|
11
|
+
id: "doctor.installed.check.json",
|
|
12
|
+
command: "codex-plugin-doctor check --installed --json",
|
|
13
|
+
outputKind: "doctor.installed.check",
|
|
14
|
+
required: ["schemaVersion", "kind", "generatedAt", "summary", "plugins"]
|
|
15
|
+
},
|
|
10
16
|
{
|
|
11
17
|
id: "doctor.security.json",
|
|
12
18
|
command: "codex-plugin-doctor security <path> --json",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CompatibilityMatrix } from "../compatibility/compatibility-matrix.js";
|
|
2
|
+
import type { InstalledPlugin } from "../core/discover-installed-plugins.js";
|
|
3
|
+
import type { CheckResult, JsonReport } from "../domain/types.js";
|
|
4
|
+
export interface InstalledCheckItem {
|
|
5
|
+
plugin: InstalledPlugin;
|
|
6
|
+
result: CheckResult;
|
|
7
|
+
compatibilityMatrix?: CompatibilityMatrix;
|
|
8
|
+
}
|
|
9
|
+
export interface InstalledCheckJsonReport {
|
|
10
|
+
schemaVersion: "1.0.0";
|
|
11
|
+
kind: "doctor.installed.check";
|
|
12
|
+
generatedAt: string;
|
|
13
|
+
summary: {
|
|
14
|
+
status: "pass" | "warn" | "fail";
|
|
15
|
+
checked: number;
|
|
16
|
+
pass: number;
|
|
17
|
+
warn: number;
|
|
18
|
+
fail: number;
|
|
19
|
+
};
|
|
20
|
+
plugins: Array<{
|
|
21
|
+
plugin: {
|
|
22
|
+
name: string;
|
|
23
|
+
version?: string;
|
|
24
|
+
rootPath: string;
|
|
25
|
+
relativePath: string;
|
|
26
|
+
};
|
|
27
|
+
report: JsonReport;
|
|
28
|
+
compatibilityMatrix?: CompatibilityMatrix;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export declare function buildInstalledJsonReport(items: InstalledCheckItem[], options: {
|
|
32
|
+
runtimeProbeEnabled: boolean;
|
|
33
|
+
}): InstalledCheckJsonReport;
|
|
34
|
+
export declare function renderInstalledJsonReport(items: InstalledCheckItem[], options: {
|
|
35
|
+
runtimeProbeEnabled: boolean;
|
|
36
|
+
}): string;
|
|
37
|
+
export declare function renderInstalledSarifReport(items: InstalledCheckItem[]): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { buildJsonReport } from "./render-json-report.js";
|
|
2
|
+
import { renderSarifReport } from "./render-sarif-report.js";
|
|
3
|
+
function summarizeStatus(items) {
|
|
4
|
+
const pass = items.filter((item) => item.result.status === "pass").length;
|
|
5
|
+
const warn = items.filter((item) => item.result.status === "warn").length;
|
|
6
|
+
const fail = items.filter((item) => item.result.status === "fail").length;
|
|
7
|
+
return {
|
|
8
|
+
status: fail > 0 ? "fail" : warn > 0 ? "warn" : "pass",
|
|
9
|
+
checked: items.length,
|
|
10
|
+
pass,
|
|
11
|
+
warn,
|
|
12
|
+
fail
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function buildInstalledJsonReport(items, options) {
|
|
16
|
+
return {
|
|
17
|
+
schemaVersion: "1.0.0",
|
|
18
|
+
kind: "doctor.installed.check",
|
|
19
|
+
generatedAt: new Date().toISOString(),
|
|
20
|
+
summary: summarizeStatus(items),
|
|
21
|
+
plugins: items.map((item) => ({
|
|
22
|
+
plugin: {
|
|
23
|
+
name: item.plugin.name,
|
|
24
|
+
...(item.plugin.version ? { version: item.plugin.version } : {}),
|
|
25
|
+
rootPath: item.plugin.rootPath,
|
|
26
|
+
relativePath: item.plugin.relativePath
|
|
27
|
+
},
|
|
28
|
+
report: buildJsonReport(item.result, options),
|
|
29
|
+
...(item.compatibilityMatrix ? { compatibilityMatrix: item.compatibilityMatrix } : {})
|
|
30
|
+
}))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function renderInstalledJsonReport(items, options) {
|
|
34
|
+
return JSON.stringify(buildInstalledJsonReport(items, options), null, 2);
|
|
35
|
+
}
|
|
36
|
+
export function renderInstalledSarifReport(items) {
|
|
37
|
+
const runs = items.flatMap((item) => {
|
|
38
|
+
const sarif = JSON.parse(renderSarifReport(item.result));
|
|
39
|
+
return sarif.runs.map((run) => ({
|
|
40
|
+
...run,
|
|
41
|
+
automationDetails: {
|
|
42
|
+
id: item.plugin.name
|
|
43
|
+
},
|
|
44
|
+
properties: {
|
|
45
|
+
pluginName: item.plugin.name,
|
|
46
|
+
...(item.plugin.version ? { pluginVersion: item.plugin.version } : {}),
|
|
47
|
+
pluginPath: item.plugin.rootPath
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
return JSON.stringify({
|
|
52
|
+
version: "2.1.0",
|
|
53
|
+
$schema: "https://json.schemastore.org/sarif-2.1.0.json",
|
|
54
|
+
runs
|
|
55
|
+
}, null, 2);
|
|
56
|
+
}
|
package/dist/run-cli.js
CHANGED
|
@@ -30,6 +30,7 @@ import { initPluginPackage, initPluginTemplates, isInitPluginTemplate } from "./
|
|
|
30
30
|
import { runCheck } from "./index.js";
|
|
31
31
|
import { buildGenericMcpDoctor, renderGenericMcpDoctor, renderGenericMcpDoctorJson } from "./mcp/generic-mcp-doctor.js";
|
|
32
32
|
import { renderInstalledSummary } from "./reporting/render-installed-summary.js";
|
|
33
|
+
import { renderInstalledJsonReport, renderInstalledSarifReport } from "./reporting/render-installed-machine-report.js";
|
|
33
34
|
import { renderBadgeJson, renderBadgeMarkdown } from "./reporting/render-badge-report.js";
|
|
34
35
|
import { renderCompatibilityScorecard } from "./reporting/render-compatibility-scorecard.js";
|
|
35
36
|
import { renderCompatibilityReport } from "./reporting/render-compatibility-report.js";
|
|
@@ -1016,18 +1017,18 @@ export async function runCli(args, io = defaultIo, options = {}) {
|
|
|
1016
1017
|
}
|
|
1017
1018
|
const report = installedSummary
|
|
1018
1019
|
? renderInstalledSummary(checkedPlugins)
|
|
1019
|
-
:
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
?
|
|
1020
|
+
: sarifOutput
|
|
1021
|
+
? renderInstalledSarifReport(checkedPlugins)
|
|
1022
|
+
: jsonOutput
|
|
1023
|
+
? renderInstalledJsonReport(checkedPlugins, { runtimeProbeEnabled: effectiveRuntimeProbeEnabled })
|
|
1024
|
+
: checkedPlugins
|
|
1025
|
+
.map((item) => markdownOutput
|
|
1026
|
+
? buildMarkdownReport(item.result, { runtimeProbeEnabled: effectiveRuntimeProbeEnabled })
|
|
1026
1027
|
: renderTextReport(item.result, {
|
|
1027
1028
|
ascii: outputPolicy.style === "ascii",
|
|
1028
1029
|
explain: explainFindings
|
|
1029
1030
|
}))
|
|
1030
|
-
|
|
1031
|
+
.join("\n\n");
|
|
1031
1032
|
if (outputPath) {
|
|
1032
1033
|
await writeFile(outputPath, report, "utf8");
|
|
1033
1034
|
}
|
package/package.json
CHANGED