@cantinasecurity/apex-cli 0.1.12 → 0.1.14
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/.claude/skills/apex-cli/SKILL.md +6 -3
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.claude.json +1 -1
- package/.mcp.codex.json +1 -1
- package/MARKETPLACE.md +1 -1
- package/README.md +13 -10
- package/dist/commands.js +35 -2
- package/dist/findings.js +10 -2
- package/dist/help.js +7 -5
- package/dist/mcp.js +15 -3
- package/dist/telemetry.js +9 -0
- package/package.json +1 -1
- package/skills/apex-cli/SKILL.md +5 -2
|
@@ -13,6 +13,8 @@ This skill is bundled with Apex CLI and can be installed into the current reposi
|
|
|
13
13
|
|
|
14
14
|
Use Apex through the MCP server when the `apex-*` tools are available.
|
|
15
15
|
|
|
16
|
+
For on-prem or other non-default Apex hosts, make sure the CLI or MCP server runs with `APEX_BASE_URL` set to the external HTTPS Bedrock origin before auth or provider connection flows.
|
|
17
|
+
|
|
16
18
|
Recommended workflow:
|
|
17
19
|
|
|
18
20
|
1. Start with `apex-auth-status`.
|
|
@@ -23,7 +25,7 @@ Recommended workflow:
|
|
|
23
25
|
6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
|
|
24
26
|
7. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
25
27
|
8. Use `apex-finding-comment` and `apex-finding-feedback` when the user wants to leave review notes or valid/invalid feedback on a finding.
|
|
26
|
-
9.
|
|
28
|
+
9. For fix reviews, call `apex-finding-fix-review`. Pass `fixPrUrls` for a PR-based review, or omit them to review the current repository state when Bedrock has original scan repository context.
|
|
27
29
|
|
|
28
30
|
If the Apex MCP server is not configured, fall back to the local CLI:
|
|
29
31
|
|
|
@@ -43,7 +45,8 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
43
45
|
- Finding comments, feedback, and fix review scan starts use the same Apex device-login credentials as read tools. If a write tool reports missing auth, re-run `apex-auth-status` and complete `apex-auth-start` / `apex-auth-wait` instead of asking for browser cookies or auth tokens.
|
|
44
46
|
- Anonymous telemetry records only sanitized command/tool metadata such as command names, enum modes, counts, durations, success/failure categories, CLI version, and client integration. It must not include raw repository paths, scan IDs, finding IDs, comments, file paths, PR URLs, or tokens.
|
|
45
47
|
- Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
|
|
46
|
-
-
|
|
48
|
+
- PR-based fix reviews can pass `fixPrUrls` directly to `apex-finding-fix-review`; agents that also need to record fixed feedback can first call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`.
|
|
49
|
+
- Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
|
|
47
50
|
- Finding identifiers such as `KERN2-25` resolve against the selected or latest scan for the current workspace binding. Pass an explicit `scanId` when needed, or use the finding UUID directly.
|
|
48
51
|
|
|
49
52
|
## Examples
|
|
@@ -53,4 +56,4 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
53
56
|
- Check an active scan: call `apex-status`, passing `scanId` when the scan is not the latest binding, then `apex-findings` when the scan completes.
|
|
54
57
|
- Export findings for review: call `apex-export-findings` with `format` set to `markdown`, `json`, or `gitlab-sast`.
|
|
55
58
|
- Leave review feedback: call `apex-finding-comment` to add a note, or `apex-finding-feedback` with `status` set to `valid` or `invalid`.
|
|
56
|
-
-
|
|
59
|
+
- Run a Fix PR review: call `apex-finding-fix-review` with `fixPrUrls`, optionally after recording fixed feedback with `apex-finding-feedback`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Cantina agent plugins for security review workflows.",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.14"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"source": {
|
|
15
15
|
"source": "npm",
|
|
16
16
|
"package": "@cantinasecurity/apex-cli",
|
|
17
|
-
"version": "0.1.
|
|
17
|
+
"version": "0.1.14"
|
|
18
18
|
},
|
|
19
19
|
"description": "Run Apex security scans and review findings from Claude Code.",
|
|
20
|
-
"version": "0.1.
|
|
20
|
+
"version": "0.1.14",
|
|
21
21
|
"author": {
|
|
22
22
|
"name": "Cantina",
|
|
23
23
|
"email": "support@cantina.xyz"
|
package/.mcp.claude.json
CHANGED
package/.mcp.codex.json
CHANGED
package/MARKETPLACE.md
CHANGED
|
@@ -13,7 +13,7 @@ This package is prepared as both a Claude Code plugin and a Codex plugin. The pu
|
|
|
13
13
|
The plugin MCP configs launch the pinned npm CLI package with:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
16
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.14 apex-mcp
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
That keeps marketplace installs independent of a user's global `apex` install.
|
package/README.md
CHANGED
|
@@ -74,10 +74,13 @@ pnpm apex
|
|
|
74
74
|
|
|
75
75
|
By default, the CLI targets `https://ai.cantina.xyz/`.
|
|
76
76
|
|
|
77
|
-
Use `APEX_BASE_URL` only when
|
|
77
|
+
Use `APEX_BASE_URL` only when targeting a non-default Apex host. For on-prem deployments,
|
|
78
|
+
set it to the same external HTTPS Bedrock origin configured as `ONPREM_PUBLIC_BASE_URL`;
|
|
79
|
+
browser handoffs such as `apex connect github` and `apex-connect-provider` need that
|
|
80
|
+
public origin for GitHub callback and success redirects.
|
|
78
81
|
|
|
79
82
|
```bash
|
|
80
|
-
APEX_BASE_URL=https://
|
|
83
|
+
APEX_BASE_URL=https://bedrock.customer.example pnpm apex
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
## Interactive Shell
|
|
@@ -138,7 +141,7 @@ Supported shell commands:
|
|
|
138
141
|
- `apex findings [--scan <scan-id>]`
|
|
139
142
|
- `apex findings comment <finding-id|finding-identifier> --content <markdown> [--parent-comment <comment-id>] [--scan <scan-id>]`
|
|
140
143
|
- `apex findings feedback <finding-id|finding-identifier> <valid|invalid> [comment] [--comment <markdown>] [--scan <scan-id>] [--suggested-severity extreme|critical|high|medium|low|informational] [--dismissal-reason false-positive|by-design|not-relevant] [--label acknowledged|fixed] [--fix-pr-url <github-pr-url>]`
|
|
141
|
-
- `apex findings fix-review <finding-id|finding-identifier> [--scan <scan-id>]`
|
|
144
|
+
- `apex findings fix-review <finding-id|finding-identifier> [--scan <scan-id>] [--review-target pull-request|repository-current] [--fix-pr-url <github-pr-url>]`
|
|
142
145
|
- `apex export findings [--scan <scan-id>] [--format markdown|json|gitlab-sast] [--output <path>]`
|
|
143
146
|
- `apex workspaces`
|
|
144
147
|
- `apex workspace`
|
|
@@ -181,12 +184,12 @@ Finding comments, valid/invalid feedback, and fix review scan starts use the sam
|
|
|
181
184
|
|
|
182
185
|
Invalid feedback requires a dismissal reason. Valid feedback can include `--suggested-severity extreme|critical|high|medium|low|informational`.
|
|
183
186
|
|
|
184
|
-
Fix review scans
|
|
187
|
+
Fix review scans can review either a Fix PR or the current repository state:
|
|
185
188
|
|
|
186
|
-
1.
|
|
187
|
-
2.
|
|
189
|
+
1. For PR-based reviews, either save fixed feedback on the finding with `--label fixed` and one or more `--fix-pr-url` values, or pass `--fix-pr-url` directly to `apex findings fix-review`.
|
|
190
|
+
2. For current-repository reviews, run `apex findings fix-review <finding-id|finding-identifier>` without Fix PR URLs. Bedrock must have original scan repository context for the finding.
|
|
188
191
|
|
|
189
|
-
The matching MCP flow is `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`,
|
|
192
|
+
The matching MCP flow is `apex-finding-fix-review` with optional `fixPrUrls`. Agents that need to record fixed feedback first can still call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`, then call `apex-finding-fix-review`.
|
|
190
193
|
|
|
191
194
|
The matching CLI and MCP flows intentionally use the same device-login session so agents should not ask users to paste browser cookies or auth tokens.
|
|
192
195
|
|
|
@@ -308,7 +311,7 @@ The MCP server exposes Apex-specific tools for:
|
|
|
308
311
|
- scan start, status, cancellation, findings, and findings export
|
|
309
312
|
- PR scan start by calling `apex-scan` with `mode: "pr"` and `pullRequests`
|
|
310
313
|
- finding comments and valid/invalid feedback with `apex-finding-comment` and `apex-finding-feedback`
|
|
311
|
-
- Fix PR
|
|
314
|
+
- Fix PR and current-repository fix review scans with `apex-finding-fix-review`, optionally after `apex-finding-feedback`
|
|
312
315
|
|
|
313
316
|
For repository-scoped operations, pass `cwd` explicitly so the server can resolve the right `.apex/workspace.json` binding and repository roots.
|
|
314
317
|
|
|
@@ -347,7 +350,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
|
|
|
347
350
|
{
|
|
348
351
|
"schemaVersion": 1,
|
|
349
352
|
"event": "apex.invocation.completed",
|
|
350
|
-
"cliVersion": "0.1.
|
|
353
|
+
"cliVersion": "0.1.14",
|
|
351
354
|
"invocation": {
|
|
352
355
|
"surface": "mcp",
|
|
353
356
|
"command": "apex-scan",
|
|
@@ -378,7 +381,7 @@ The npm package also includes marketplace-ready plugin artifacts:
|
|
|
378
381
|
- `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
|
|
379
382
|
- `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
|
|
380
383
|
|
|
381
|
-
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
384
|
+
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.14 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
|
|
382
385
|
|
|
383
386
|
The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
|
|
384
387
|
|
package/dist/commands.js
CHANGED
|
@@ -36,6 +36,10 @@ const FINDING_FEEDBACK_LABELS = [
|
|
|
36
36
|
"acknowledged",
|
|
37
37
|
"fixed",
|
|
38
38
|
];
|
|
39
|
+
const FIX_REVIEW_TARGETS = [
|
|
40
|
+
"pull_request",
|
|
41
|
+
"repository_current",
|
|
42
|
+
];
|
|
39
43
|
async function saveCompanyDefault(companyId) {
|
|
40
44
|
const config = await loadConfig();
|
|
41
45
|
if (config.defaultCompanyId !== companyId) {
|
|
@@ -336,6 +340,19 @@ function normalizeDismissalReason(value) {
|
|
|
336
340
|
}
|
|
337
341
|
throw new Error(`Dismissal reason must be one of: ${FINDING_DISMISSAL_REASONS.join(", ")}.`);
|
|
338
342
|
}
|
|
343
|
+
function normalizeFixReviewTarget(value) {
|
|
344
|
+
const normalized = value?.trim().replace(/-/g, "_") ?? "";
|
|
345
|
+
if (!normalized) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
if (FIX_REVIEW_TARGETS.includes(normalized)) {
|
|
349
|
+
return normalized;
|
|
350
|
+
}
|
|
351
|
+
throw new Error("Fix review target must be one of: pull-request, repository-current.");
|
|
352
|
+
}
|
|
353
|
+
function formatFixReviewTarget(value) {
|
|
354
|
+
return value === "repository_current" ? "current repository" : "pull request";
|
|
355
|
+
}
|
|
339
356
|
async function requireWorkspaceBinding(cwd) {
|
|
340
357
|
const binding = await loadWorkspaceBinding(cwd);
|
|
341
358
|
if (binding) {
|
|
@@ -1130,6 +1147,13 @@ export async function commandFindingFeedback(client, cwd, flags, params) {
|
|
|
1130
1147
|
}
|
|
1131
1148
|
export async function commandFindingFixReview(client, cwd, flags, requestedFindingRef) {
|
|
1132
1149
|
const findingRef = normalizeFindingRefInput(requestedFindingRef);
|
|
1150
|
+
const reviewTarget = normalizeFixReviewTarget(getFlagString(flags, "review-target"));
|
|
1151
|
+
const fixPrUrls = getFlagList(flags, "fix-pr-url")
|
|
1152
|
+
.map((url) => url.trim())
|
|
1153
|
+
.filter((url) => url.length > 0);
|
|
1154
|
+
if (reviewTarget === "repository_current" && fixPrUrls.length > 0) {
|
|
1155
|
+
throw new Error("Fix PR URLs require the pull-request fix review target.");
|
|
1156
|
+
}
|
|
1133
1157
|
const currentBinding = await loadWorkspaceBinding(cwd);
|
|
1134
1158
|
const needsWorkspaceResolution = !isFindingUuid(findingRef);
|
|
1135
1159
|
const binding = needsWorkspaceResolution
|
|
@@ -1144,7 +1168,10 @@ export async function commandFindingFixReview(client, cwd, flags, requestedFindi
|
|
|
1144
1168
|
requestedFindingRef: findingRef,
|
|
1145
1169
|
requestedScanId: getFlagString(flags, "scan"),
|
|
1146
1170
|
}));
|
|
1147
|
-
const response = await withLoadingIndicator("Starting fix review scan...", flags, () => startFindingFixReviewScan(client, selection.findingId
|
|
1171
|
+
const response = await withLoadingIndicator("Starting fix review scan...", flags, () => startFindingFixReviewScan(client, selection.findingId, {
|
|
1172
|
+
reviewTarget,
|
|
1173
|
+
fixPrUrls,
|
|
1174
|
+
}));
|
|
1148
1175
|
const nextBinding = binding && selection.scan
|
|
1149
1176
|
? {
|
|
1150
1177
|
...binding,
|
|
@@ -1174,12 +1201,18 @@ export async function commandFindingFixReview(client, cwd, flags, requestedFindi
|
|
|
1174
1201
|
if (response.fixReview.kernelScanId) {
|
|
1175
1202
|
logLine(`Kernel scan: ${response.fixReview.kernelScanId}`, flags);
|
|
1176
1203
|
}
|
|
1204
|
+
if (response.fixReview.reviewTarget) {
|
|
1205
|
+
logLine(`Review target: ${formatFixReviewTarget(response.fixReview.reviewTarget)}`, flags);
|
|
1206
|
+
}
|
|
1177
1207
|
if (response.fixReview.fixPrUrls?.length) {
|
|
1178
1208
|
logLine(`Fix PRs: ${response.fixReview.fixPrUrls.join(", ")}`, flags);
|
|
1179
1209
|
}
|
|
1180
|
-
else {
|
|
1210
|
+
else if (response.fixReview.fixPrUrl) {
|
|
1181
1211
|
logLine(`Fix PR: ${response.fixReview.fixPrUrl}`, flags);
|
|
1182
1212
|
}
|
|
1213
|
+
if (response.fixReview.repoName) {
|
|
1214
|
+
logLine(`Repository: ${response.fixReview.repoName}`, flags);
|
|
1215
|
+
}
|
|
1183
1216
|
if (response.reused) {
|
|
1184
1217
|
logLine("Reused existing active fix review scan.", flags);
|
|
1185
1218
|
}
|
package/dist/findings.js
CHANGED
|
@@ -232,9 +232,17 @@ export async function submitFindingFeedback(client, findingId, input) {
|
|
|
232
232
|
},
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
export async function startFindingFixReviewScan(client, findingId) {
|
|
235
|
+
export async function startFindingFixReviewScan(client, findingId, input = {}) {
|
|
236
|
+
const fixPrUrls = input.fixPrUrls
|
|
237
|
+
?.map((url) => url.trim())
|
|
238
|
+
.filter((url) => url.length > 0) ?? [];
|
|
236
239
|
return requestFindingAppRoute(client, `/api/findings/${encodeURIComponent(findingId)}/fix-review`, {
|
|
237
240
|
method: "POST",
|
|
238
|
-
json: {
|
|
241
|
+
json: {
|
|
242
|
+
...(input.reviewTarget ? { reviewTarget: input.reviewTarget } : {}),
|
|
243
|
+
...(fixPrUrls.length > 0
|
|
244
|
+
? { fixPrUrl: fixPrUrls[0], fixPrUrls }
|
|
245
|
+
: {}),
|
|
246
|
+
},
|
|
239
247
|
});
|
|
240
248
|
}
|
package/dist/help.js
CHANGED
|
@@ -9,7 +9,7 @@ export const CLI_HELP_TEXT = `Usage:
|
|
|
9
9
|
apex findings feedback <finding-id|finding-identifier> <valid|invalid>
|
|
10
10
|
Leave feedback; invalid requires --dismissal-reason
|
|
11
11
|
apex findings fix-review <finding-id|finding-identifier>
|
|
12
|
-
Start a fix review scan
|
|
12
|
+
Start a fix review scan for a Fix PR or current repository
|
|
13
13
|
apex export findings Export findings for the latest or selected scan
|
|
14
14
|
apex workspaces List accessible workspaces for the active company
|
|
15
15
|
apex workspace Show the workspace currently bound to this directory
|
|
@@ -42,7 +42,9 @@ Flags:
|
|
|
42
42
|
--dismissal-reason false-positive|by-design|not-relevant
|
|
43
43
|
Explain why invalid feedback is being left
|
|
44
44
|
--label acknowledged|fixed Attach a valid-feedback label
|
|
45
|
-
--fix-pr-url <github-pr-url> Attach one or more Fix PR URLs to
|
|
45
|
+
--fix-pr-url <github-pr-url> Attach one or more Fix PR URLs to feedback or fix-review start
|
|
46
|
+
--review-target pull-request|repository-current
|
|
47
|
+
Choose the fix review target when starting a fix review
|
|
46
48
|
--format markdown|json|gitlab-sast
|
|
47
49
|
Choose the export format for findings
|
|
48
50
|
--output <path> Write exported findings to this file path
|
|
@@ -66,7 +68,7 @@ Tips:
|
|
|
66
68
|
apex workspace use accepts a workspace name, prefix, or ID.
|
|
67
69
|
Finding comments, feedback, and fix review scans use the same Apex login credentials as other CLI commands.
|
|
68
70
|
Invalid finding feedback requires --dismissal-reason.
|
|
69
|
-
Fix review scans
|
|
71
|
+
Fix review scans use saved or supplied Fix PR URLs when present; otherwise they review the current repository when Bedrock has original scan repository context.
|
|
70
72
|
Finding identifiers such as KERN2-25 resolve against the selected scan; pass --scan or use the finding UUID directly when needed.
|
|
71
73
|
Anonymous usage telemetry helps Apex understand CLI, MCP, Codex, Claude, and Copilot usage. Disable it with apex telemetry disable or APEX_TELEMETRY_DISABLED=1.
|
|
72
74
|
Quote workspace names that contain spaces:
|
|
@@ -87,7 +89,7 @@ Commands:
|
|
|
87
89
|
/findings feedback <finding-ref> invalid <reason> [comment]
|
|
88
90
|
Leave invalid feedback; reason is false-positive, by-design, or not-relevant
|
|
89
91
|
/findings fix-review <finding-ref>
|
|
90
|
-
Start a fix review scan
|
|
92
|
+
Start a fix review scan for a Fix PR or current repository
|
|
91
93
|
/export [scan-id] Export findings for the latest or selected scan
|
|
92
94
|
/workspaces List accessible workspaces for the active company
|
|
93
95
|
/cancel-scan [scan-id] Cancel a running or most recent scan
|
|
@@ -115,7 +117,7 @@ Tips:
|
|
|
115
117
|
/workspace use accepts a workspace name, prefix, or ID.
|
|
116
118
|
/findings comment, /findings feedback, and /findings fix-review use the current Apex login.
|
|
117
119
|
Invalid finding feedback requires a dismissal reason.
|
|
118
|
-
Fix review scans
|
|
120
|
+
Fix review scans use saved Fix PR URLs when present; otherwise they review the current repository when Bedrock has original scan repository context. Use scripted CLI or MCP to supply Fix PR URLs directly.
|
|
119
121
|
Use scripted CLI flags for advanced feedback options such as suggested severity or dismissal reason.
|
|
120
122
|
Anonymous usage telemetry can be disabled with /telemetry disable or APEX_TELEMETRY_DISABLED=1.
|
|
121
123
|
Quote workspace names that contain spaces: /workspace use "Core Platform"
|
package/dist/mcp.js
CHANGED
|
@@ -18,7 +18,7 @@ Suggested workflow:
|
|
|
18
18
|
5. Start and monitor scans with apex-scan, apex-status, apex-scans, apex-findings, and apex-export-findings.
|
|
19
19
|
6. For PR scans, call apex-scan with mode "pr" and one or more pullRequests.
|
|
20
20
|
7. Leave finding comments or valid/invalid feedback with apex-finding-comment and apex-finding-feedback when review collaboration is needed.
|
|
21
|
-
8. To
|
|
21
|
+
8. To review a fix, call apex-finding-fix-review. Pass fixPrUrls for PR-based fix reviews, or omit them to review the current repository state when Bedrock has original scan repository context.
|
|
22
22
|
|
|
23
23
|
Notes:
|
|
24
24
|
- Pass cwd explicitly for repository-specific operations.
|
|
@@ -67,12 +67,18 @@ function buildFlags(options) {
|
|
|
67
67
|
if (options.sourceMode) {
|
|
68
68
|
flags["source-mode"] = options.sourceMode;
|
|
69
69
|
}
|
|
70
|
+
if (options.reviewTarget) {
|
|
71
|
+
flags["review-target"] = options.reviewTarget;
|
|
72
|
+
}
|
|
70
73
|
if (options.force === true) {
|
|
71
74
|
flags.force = true;
|
|
72
75
|
}
|
|
73
76
|
if (options.repoPaths && options.repoPaths.length > 0) {
|
|
74
77
|
flags.repo = options.repoPaths;
|
|
75
78
|
}
|
|
79
|
+
if (options.fixPrUrls && options.fixPrUrls.length > 0) {
|
|
80
|
+
flags["fix-pr-url"] = options.fixPrUrls;
|
|
81
|
+
}
|
|
76
82
|
if (options.pullRequests && options.pullRequests.length > 0) {
|
|
77
83
|
flags.pr = options.pullRequests.map((pullRequest) => {
|
|
78
84
|
const paths = pullRequest.paths
|
|
@@ -573,17 +579,21 @@ function registerTools(server) {
|
|
|
573
579
|
}));
|
|
574
580
|
server.registerTool("apex-finding-fix-review", {
|
|
575
581
|
title: "Start Apex Finding Fix Review Scan",
|
|
576
|
-
description: "Start a fix review scan for a finding
|
|
582
|
+
description: "Start a fix review scan for a finding. Pass fixPrUrls for a PR-based review, or omit them to review the current repository state when original scan repository context is available.",
|
|
577
583
|
inputSchema: {
|
|
578
584
|
cwd: z.string().optional(),
|
|
579
585
|
findingRef: z.string(),
|
|
580
586
|
scanId: z.string().optional(),
|
|
587
|
+
reviewTarget: z.enum(["pull_request", "repository_current"]).optional(),
|
|
588
|
+
fixPrUrls: z.array(z.string().url()).max(20).optional(),
|
|
581
589
|
},
|
|
582
|
-
}, async ({ cwd, findingRef, scanId }) => runTool("apex-finding-fix-review", async () => {
|
|
590
|
+
}, async ({ cwd, findingRef, scanId, reviewTarget, fixPrUrls }) => runTool("apex-finding-fix-review", async () => {
|
|
583
591
|
const client = new ApexApiClient();
|
|
584
592
|
const targetCwd = resolveCwd(cwd);
|
|
585
593
|
const payload = await commandFindingFixReview(client, targetCwd, buildFlags({
|
|
586
594
|
scanId,
|
|
595
|
+
reviewTarget,
|
|
596
|
+
fixPrUrls,
|
|
587
597
|
}), findingRef);
|
|
588
598
|
return {
|
|
589
599
|
cwd: targetCwd,
|
|
@@ -593,6 +603,8 @@ function registerTools(server) {
|
|
|
593
603
|
cwd,
|
|
594
604
|
findingRef,
|
|
595
605
|
scanId,
|
|
606
|
+
reviewTarget,
|
|
607
|
+
fixPrUrls,
|
|
596
608
|
}));
|
|
597
609
|
server.registerTool("apex-export-findings", {
|
|
598
610
|
title: "Export Apex Findings",
|
package/dist/telemetry.js
CHANGED
|
@@ -28,6 +28,7 @@ const KNOWN_CLI_FLAG_NAMES = [
|
|
|
28
28
|
"pr",
|
|
29
29
|
"pr-path",
|
|
30
30
|
"repo",
|
|
31
|
+
"review-target",
|
|
31
32
|
"scan",
|
|
32
33
|
"source-mode",
|
|
33
34
|
"status",
|
|
@@ -104,6 +105,12 @@ function boolFlag(flags, key) {
|
|
|
104
105
|
function safeEnum(value, allowed) {
|
|
105
106
|
return allowed.includes(value) ? value : null;
|
|
106
107
|
}
|
|
108
|
+
function safeFixReviewTarget(value) {
|
|
109
|
+
return safeEnum(value?.replace(/-/g, "_") ?? null, [
|
|
110
|
+
"pull_request",
|
|
111
|
+
"repository_current",
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
107
114
|
function bucketCount(count) {
|
|
108
115
|
if (count <= 0)
|
|
109
116
|
return "0";
|
|
@@ -175,6 +182,7 @@ function sanitizeCliFlags(flags) {
|
|
|
175
182
|
sourceMode: safeEnum(stringFlag(flags, "source-mode"), ["auto", "remote", "local"]),
|
|
176
183
|
format: safeEnum(stringFlag(flags, "format"), ["markdown", "json", "gitlab-sast"]),
|
|
177
184
|
feedbackStatus: safeEnum(stringFlag(flags, "status"), ["valid", "invalid"]),
|
|
185
|
+
fixReviewTarget: safeFixReviewTarget(stringFlag(flags, "review-target")),
|
|
178
186
|
dismissalReason: safeEnum(stringFlag(flags, "dismissal-reason"), [
|
|
179
187
|
"false-positive",
|
|
180
188
|
"by-design",
|
|
@@ -355,6 +363,7 @@ export function sanitizeMcpInput(input = {}) {
|
|
|
355
363
|
"valid",
|
|
356
364
|
"invalid",
|
|
357
365
|
]),
|
|
366
|
+
fixReviewTarget: safeFixReviewTarget(typeof input.reviewTarget === "string" ? input.reviewTarget : null),
|
|
358
367
|
dismissalReason: safeEnum(typeof input.dismissalReason === "string" ? input.dismissalReason : null, ["false-positive", "by-design", "not-relevant"]),
|
|
359
368
|
suggestedSeverity: safeEnum(typeof input.suggestedSeverity === "string" ? input.suggestedSeverity : null, ["extreme", "critical", "high", "medium", "low", "informational"]),
|
|
360
369
|
repoCount: arrayLength(input.repoPaths),
|
package/package.json
CHANGED
package/skills/apex-cli/SKILL.md
CHANGED
|
@@ -11,6 +11,8 @@ Prefer the Apex MCP tools over running `apex` in the shell when the server is av
|
|
|
11
11
|
|
|
12
12
|
`apex setup codex` configures the MCP server with client attribution so Apex can distinguish Codex MCP usage from direct CLI usage. Users can inspect or disable anonymous local usage telemetry with `apex telemetry status` and `apex telemetry disable`.
|
|
13
13
|
|
|
14
|
+
For on-prem or other non-default Apex hosts, make sure the MCP server runs with `APEX_BASE_URL` set to the external HTTPS Bedrock origin before auth or provider connection flows.
|
|
15
|
+
|
|
14
16
|
Workflow:
|
|
15
17
|
|
|
16
18
|
1. Start with `apex-auth-status`.
|
|
@@ -21,7 +23,7 @@ Workflow:
|
|
|
21
23
|
6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
|
|
22
24
|
7. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
23
25
|
8. Use `apex-finding-comment` and `apex-finding-feedback` when the user wants to leave review notes or valid/invalid feedback on a finding.
|
|
24
|
-
9.
|
|
26
|
+
9. For fix reviews, call `apex-finding-fix-review`. Pass `fixPrUrls` for a PR-based review, or omit them to review the current repository state when Bedrock has original scan repository context.
|
|
25
27
|
|
|
26
28
|
Guidelines:
|
|
27
29
|
|
|
@@ -40,5 +42,6 @@ Guidelines:
|
|
|
40
42
|
- Finding comments, feedback, and fix review scan starts use the same Apex device-login credentials as read tools. If a write tool reports missing auth, re-run `apex-auth-status` and complete `apex-auth-start` / `apex-auth-wait` instead of asking for browser cookies or auth tokens.
|
|
41
43
|
- Anonymous telemetry records only sanitized command/tool metadata such as command names, enum modes, counts, durations, success/failure categories, CLI version, and client integration. It must not include raw repository paths, scan IDs, finding IDs, comments, file paths, PR URLs, or tokens.
|
|
42
44
|
- Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
|
|
43
|
-
-
|
|
45
|
+
- PR-based fix reviews can pass `fixPrUrls` directly to `apex-finding-fix-review`; agents that also need to record fixed feedback can first call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`.
|
|
46
|
+
- Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
|
|
44
47
|
- Finding identifiers such as `KERN2-25` resolve against the selected or latest scan for the current workspace binding. Pass an explicit scan when needed, or use the finding UUID directly.
|