@securityreviewai/securityreview-kit 0.1.28 → 0.1.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@securityreviewai/securityreview-kit",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Bootstrap security-review-mcp for AI IDEs and CLI tools",
5
5
  "author": "Debarshi Das <debarshi.das@we45.com>",
6
6
  "license": "UNLICENSED",
package/src/cli.js CHANGED
@@ -35,7 +35,7 @@ export function run() {
35
35
  )
36
36
  .option(
37
37
  '--profiler-cursor-login',
38
- 'Before Cursor profiling, run cursor-agent login in this terminal (then profiling runs in the same init)',
38
+ 'Before Cursor profiling, run `agent login` (or `cursor-agent login`) in this terminal (then profiling runs in the same init)',
39
39
  )
40
40
  .option(
41
41
  '--profiler-quiet',
@@ -479,7 +479,12 @@ export async function initCommand(options) {
479
479
  console.log(chalk.dim(' Typical fixes:'));
480
480
  console.log(
481
481
  chalk.dim(
482
- ' • Not signed in: re-run `securityreview-kit init` and choose Yes for “Run Cursor Agent login”, or pass `--profiler-cursor-login` with `--profile-repo`.',
482
+ ' • Not signed in: re-run `securityreview-kit init` and choose Yes for “Run Cursor Agent login”, or pass `--profiler-cursor-login` with `--profile-repo`. Use `agent login` (or `cursor-agent login`) if prompted manually.',
483
+ ),
484
+ );
485
+ console.log(
486
+ chalk.dim(
487
+ ' • CLI missing: install from https://cursor.com/docs/cli/installation and verify `agent --version` (new installs use the `agent` command; `cursor-agent` is legacy).',
483
488
  ),
484
489
  );
485
490
  console.log(
@@ -52,7 +52,9 @@ function mergeCursorCliMcpAllowlist(cwd) {
52
52
  if (!existing.permissions.allow.includes(token)) {
53
53
  existing.permissions.allow.push(token);
54
54
  }
55
- if (existing.permissions.deny !== undefined && !Array.isArray(existing.permissions.deny)) {
55
+ // Cursor CLI schema requires permissions.deny to be a string[] (may be empty).
56
+ // @see https://cursor.com/docs/cli/reference/configuration
57
+ if (!Array.isArray(existing.permissions.deny)) {
56
58
  existing.permissions.deny = [];
57
59
  }
58
60
  writeJson(cliPath, existing);
@@ -23,10 +23,10 @@ Do **not** ask the user to verbally approve MCP for `security-review-mcp`. The r
23
23
 
24
24
  From the repo root, non-interactive runs should include workspace trust, MCP approval, and **streaming progress** (matches default `securityreview-kit init`):
25
25
 
26
- `cursor-agent -p "<your profiling instructions>" --output-format stream-json --stream-partial-output --trust --approve-mcps`
26
+ `agent -p "<your profiling instructions>" --output-format stream-json --stream-partial-output --trust --approve-mcps` (or `cursor-agent` if that is what your install provides)
27
27
 
28
28
  Omit `--output-format` / `--stream-partial-output` if you want less verbose terminal output (or use `securityreview-kit init` with `--profiler-quiet`).
29
29
 
30
30
  During `securityreview-kit init`, choose **Yes** when asked to run Cursor login in-terminal, or pass **`--profiler-cursor-login`** with **`--profile-repo`** so login and profiling stay in one run.
31
31
 
32
- You can still sign in manually with `cursor-agent login`. To handle trust/login interactively in the terminal, omit `--trust` and `--approve-mcps`.
32
+ You can still sign in manually with `agent login` (or `cursor-agent login`). To handle trust/login interactively in the terminal, omit `--trust` and `--approve-mcps`.
@@ -70,7 +70,7 @@ Build the object for `.guardrails/profile.json`:
70
70
  "schema_version": "1.0",
71
71
  "project_name": "<directory name>",
72
72
  "profiled_at": "<ISO 8601 timestamp>",
73
- "profiled_by": "<ide or cli id, e.g. cursor-agent, claude, codex>",
73
+ "profiled_by": "<ide or cli id, e.g. agent, cursor-agent, claude, codex>",
74
74
  "detection_summary": {
75
75
  "languages": [],
76
76
  "frameworks": [],
@@ -149,4 +149,4 @@ If there are no signals:
149
149
 
150
150
  ## IDE-Specific Notes
151
151
 
152
- When run from Cursor Agent CLI, Claude Code, or Codex CLI, set `profiled_by` to a stable id (`cursor-agent`, `claude`, `codex`).
152
+ When run from Cursor Agent CLI, Claude Code, or Codex CLI, set `profiled_by` to a stable id (`agent` or `cursor-agent`, `claude`, `codex`).
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { spawnSync } from 'node:child_process';
3
3
  import { homedir } from 'node:os';
4
- import { delimiter, join } from 'node:path';
4
+ import { delimiter, isAbsolute, join } from 'node:path';
5
5
 
6
6
  /**
7
7
  * Extra PATH segments where Cursor / other CLIs are often installed.
@@ -25,17 +25,37 @@ export function augmentPathEnv(baseEnv = process.env) {
25
25
  }
26
26
 
27
27
  /**
28
- * Executable that responds to `cursor-agent --version`, or null.
28
+ * Cursor Agent CLI binary (`agent` or legacy `cursor-agent`) that responds to `--version`, or null.
29
+ * New installs often only ship `agent` in ~/.local/bin (see https://cursor.com/docs/cli/installation).
29
30
  */
30
31
  export function resolveCursorAgentExecutable() {
31
32
  const env = augmentPathEnv();
33
+ const home = homedir();
32
34
  const candidates = [
35
+ join(home, '.local', 'bin', 'agent'),
36
+ join(home, '.local', 'bin', 'cursor-agent'),
37
+ ...(process.platform === 'win32'
38
+ ? [
39
+ join(home, '.local', 'bin', 'agent.cmd'),
40
+ join(home, '.local', 'bin', 'cursor-agent.cmd'),
41
+ ]
42
+ : []),
43
+ join(home, '.cursor', 'bin', 'agent'),
44
+ join(home, '.cursor', 'bin', 'cursor-agent'),
45
+ 'agent',
33
46
  'cursor-agent',
34
- join(homedir(), '.local', 'bin', 'cursor-agent'),
35
- join(homedir(), '.cursor', 'bin', 'cursor-agent'),
36
47
  ];
48
+ if (process.platform === 'win32') {
49
+ const base = join(home, 'AppData', 'Local', 'Programs', 'cursor');
50
+ candidates.splice(
51
+ candidates.length - 2,
52
+ 0,
53
+ join(base, 'agent.exe'),
54
+ join(base, 'cursor-agent.exe'),
55
+ );
56
+ }
37
57
  for (const cmd of candidates) {
38
- if (cmd !== 'cursor-agent' && !existsSync(cmd)) {
58
+ if (isAbsolute(cmd) && !existsSync(cmd)) {
39
59
  continue;
40
60
  }
41
61
  const r = spawnSync(cmd, ['--version'], { stdio: 'ignore', env });
@@ -32,7 +32,7 @@ export function ensureIdeCliForTarget(target, options = {}) {
32
32
  target,
33
33
  ok: false,
34
34
  message:
35
- 'cursor-agent not found (install from https://cursor.com/cli; Node may need ~/.local/bin — kit augments PATH when running the profiler)',
35
+ 'Cursor Agent CLI not found (`agent` or `cursor-agent`). Install from https://cursor.com/docs/cli/installation.',
36
36
  };
37
37
  }
38
38
  if (process.platform === 'win32') {
@@ -51,7 +51,7 @@ export function ensureIdeCliForTarget(target, options = {}) {
51
51
  target,
52
52
  ok: false,
53
53
  message:
54
- 'cursor-agent not found after install; open a new shell or ensure ~/.local/bin exists and re-run init',
54
+ 'Cursor Agent CLI (`agent` / `cursor-agent`) not found after install; open a new shell or ensure ~/.local/bin exists and re-run init',
55
55
  };
56
56
  }
57
57
  return { target, ok: true };
@@ -36,7 +36,7 @@ export function runCursorAgentLogin(cwd) {
36
36
  ok: false,
37
37
  status: null,
38
38
  message:
39
- 'cursor-agent not found (install from https://cursor.com/cli and ensure ~/.local/bin is on PATH, or re-run init without --skip-ide-cli-install)',
39
+ 'Cursor Agent CLI not found (`agent` or `cursor-agent`). Install from https://cursor.com/docs/cli/installation (add ~/.local/bin to PATH), or re-run init without --skip-ide-cli-install.',
40
40
  };
41
41
  }
42
42
  const env = augmentPathEnv(process.env);
@@ -85,7 +85,7 @@ export function runProfilerAgent(cwd, { target, projectName, cursorTrust = true,
85
85
  return {
86
86
  ok: false,
87
87
  message:
88
- 'cursor-agent not found. Install via Cursor CLI (https://cursor.com/cli) or run init Step 1b without --skip-ide-cli-install; ensure your shell PATH includes ~/.local/bin (Node may not inherit it).',
88
+ 'Cursor Agent CLI not found (`agent` or `cursor-agent`). Install from https://cursor.com/docs/cli/installation and ensure ~/.local/bin exists; run init Step 1b without --skip-ide-cli-install (Node subprocesses get an augmented PATH, but the binary must be installed).',
89
89
  };
90
90
  }
91
91
  const args = ['-p', prompt];