@cantinasecurity/apex-cli 0.1.11 → 0.1.13

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.
@@ -23,7 +23,7 @@ Recommended workflow:
23
23
  6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
24
24
  7. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
25
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.
26
- 9. When an agent creates a fix PR externally, call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`, then call `apex-finding-fix-review` to start the fix review scan.
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.
27
27
 
28
28
  If the Apex MCP server is not configured, fall back to the local CLI:
29
29
 
@@ -43,7 +43,8 @@ If the Apex MCP server is not configured, fall back to the local CLI:
43
43
  - 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
44
  - 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
45
  - Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
46
- - Fix PR callback feedback requires valid feedback with `labels: ["fixed"]` and `fixPrUrls`; start the fix review scan with `apex-finding-fix-review` after saving that feedback.
46
+ - 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`.
47
+ - Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
47
48
  - 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
49
 
49
50
  ## Examples
@@ -53,4 +54,4 @@ If the Apex MCP server is not configured, fall back to the local CLI:
53
54
  - 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
55
  - Export findings for review: call `apex-export-findings` with `format` set to `markdown`, `json`, or `gitlab-sast`.
55
56
  - Leave review feedback: call `apex-finding-comment` to add a note, or `apex-finding-feedback` with `status` set to `valid` or `invalid`.
56
- - Add a Fix PR and run fix review: call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`, then call `apex-finding-fix-review`.
57
+ - 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.11"
9
+ "version": "0.1.13"
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.11"
17
+ "version": "0.1.13"
18
18
  },
19
19
  "description": "Run Apex security scans and review findings from Claude Code.",
20
- "version": "0.1.11",
20
+ "version": "0.1.13",
21
21
  "author": {
22
22
  "name": "Cantina",
23
23
  "email": "support@cantina.xyz"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apex-cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Run Apex security scans and review findings from Claude Code.",
5
5
  "author": {
6
6
  "name": "Cantina",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apex-cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Run Apex security scans and review findings from Codex.",
5
5
  "author": {
6
6
  "name": "Cantina",
package/.mcp.claude.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "args": [
6
6
  "-y",
7
7
  "-p",
8
- "@cantinasecurity/apex-cli@0.1.11",
8
+ "@cantinasecurity/apex-cli@0.1.13",
9
9
  "apex-mcp"
10
10
  ],
11
11
  "env": {
package/.mcp.codex.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "args": [
5
5
  "-y",
6
6
  "-p",
7
- "@cantinasecurity/apex-cli@0.1.11",
7
+ "@cantinasecurity/apex-cli@0.1.13",
8
8
  "apex-mcp"
9
9
  ],
10
10
  "env": {
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.11 apex-mcp
16
+ npx -y -p @cantinasecurity/apex-cli@0.1.13 apex-mcp
17
17
  ```
18
18
 
19
19
  That keeps marketplace installs independent of a user's global `apex` install.
package/README.md CHANGED
@@ -138,7 +138,7 @@ Supported shell commands:
138
138
  - `apex findings [--scan <scan-id>]`
139
139
  - `apex findings comment <finding-id|finding-identifier> --content <markdown> [--parent-comment <comment-id>] [--scan <scan-id>]`
140
140
  - `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>]`
141
+ - `apex findings fix-review <finding-id|finding-identifier> [--scan <scan-id>] [--review-target pull-request|repository-current] [--fix-pr-url <github-pr-url>]`
142
142
  - `apex export findings [--scan <scan-id>] [--format markdown|json|gitlab-sast] [--output <path>]`
143
143
  - `apex workspaces`
144
144
  - `apex workspace`
@@ -181,12 +181,12 @@ Finding comments, valid/invalid feedback, and fix review scan starts use the sam
181
181
 
182
182
  Invalid feedback requires a dismissal reason. Valid feedback can include `--suggested-severity extreme|critical|high|medium|low|informational`.
183
183
 
184
- Fix review scans use a two-step callback flow for agents that create a PR outside Apex:
184
+ Fix review scans can review either a Fix PR or the current repository state:
185
185
 
186
- 1. Save fixed feedback on the finding with `--label fixed` and one or more `--fix-pr-url` values.
187
- 2. Start the scan with `apex findings fix-review <finding-id|finding-identifier>`.
186
+ 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`.
187
+ 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
188
 
189
- The matching MCP flow is `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`, followed by `apex-finding-fix-review`.
189
+ 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
190
 
191
191
  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
192
 
@@ -239,7 +239,7 @@ For Claude Code:
239
239
  claude mcp add --scope user \
240
240
  -e APEX_MCP_CLIENT=claude \
241
241
  -e APEX_CLIENT_INTEGRATION=claude \
242
- apex -- apex-mcp
242
+ -- apex apex-mcp
243
243
  ```
244
244
 
245
245
  For GitHub Copilot CLI:
@@ -308,7 +308,7 @@ The MCP server exposes Apex-specific tools for:
308
308
  - scan start, status, cancellation, findings, and findings export
309
309
  - PR scan start by calling `apex-scan` with `mode: "pr"` and `pullRequests`
310
310
  - finding comments and valid/invalid feedback with `apex-finding-comment` and `apex-finding-feedback`
311
- - Fix PR callback and fix review scans with `apex-finding-feedback` plus `apex-finding-fix-review`
311
+ - Fix PR and current-repository fix review scans with `apex-finding-fix-review`, optionally after `apex-finding-feedback`
312
312
 
313
313
  For repository-scoped operations, pass `cwd` explicitly so the server can resolve the right `.apex/workspace.json` binding and repository roots.
314
314
 
@@ -347,7 +347,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
347
347
  {
348
348
  "schemaVersion": 1,
349
349
  "event": "apex.invocation.completed",
350
- "cliVersion": "0.1.11",
350
+ "cliVersion": "0.1.13",
351
351
  "invocation": {
352
352
  "surface": "mcp",
353
353
  "command": "apex-scan",
@@ -378,7 +378,7 @@ The npm package also includes marketplace-ready plugin artifacts:
378
378
  - `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
379
379
  - `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
380
380
 
381
- These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.11 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
381
+ These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.13 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
382
382
 
383
383
  The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
384
384
 
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 after fixed feedback has a Fix PR URL
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 fixed feedback
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 require valid feedback with --label fixed and at least one --fix-pr-url, then apex findings fix-review.
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 after fixed feedback has a Fix PR URL
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 require fixed valid feedback with a Fix PR URL. Use scripted CLI or MCP for attaching Fix PR URLs.
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 attach a fix PR and trigger a fix review scan, call apex-finding-feedback with status "valid", label "fixed", and fixPrUrls, then call apex-finding-fix-review.
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 after fixed feedback with one or more Fix PR URLs has been saved.",
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/setup.js CHANGED
@@ -254,6 +254,7 @@ async function configureClaude(cwd, launch) {
254
254
  if (existing) {
255
255
  await execText("claude", ["mcp", "remove", "--scope", "user", MCP_SERVER_NAME]);
256
256
  }
257
+ // Claude's variadic --env option consumes later tokens until `--`.
257
258
  await execText("claude", [
258
259
  "mcp",
259
260
  "add",
@@ -263,8 +264,8 @@ async function configureClaude(cwd, launch) {
263
264
  `${MCP_CLIENT_ENV_NAME}=${env[MCP_CLIENT_ENV_NAME]}`,
264
265
  "-e",
265
266
  `${MCP_CLIENT_INTEGRATION_ENV_NAME}=${env[MCP_CLIENT_INTEGRATION_ENV_NAME]}`,
266
- MCP_SERVER_NAME,
267
267
  "--",
268
+ MCP_SERVER_NAME,
268
269
  launch.command,
269
270
  ...launch.args,
270
271
  ]);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cantinasecurity/apex-cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Standalone CLI and MCP server for Apex.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -21,7 +21,7 @@ Workflow:
21
21
  6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
22
22
  7. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
23
23
  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. When an agent creates a fix PR externally, call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`, then call `apex-finding-fix-review` to start the fix review scan.
24
+ 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
25
 
26
26
  Guidelines:
27
27
 
@@ -40,5 +40,6 @@ Guidelines:
40
40
  - 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
41
  - 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
42
  - Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
43
- - Fix PR callback feedback requires valid feedback with `labels: ["fixed"]` and `fixPrUrls`; start the fix review scan with `apex-finding-fix-review` after saving that feedback.
43
+ - 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`.
44
+ - Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
44
45
  - 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.