Corrects the Cursor plugin's CLI integration to match cursor-agent's real command contract instead of best-effort heuristics. - Derive authentication from `cursor-agent status --format json` (`isAuthenticated` field), failing closed with an actionable reason on non-zero exit or malformed JSON, instead of treating `--version` success as auth-ready. - Switch model discovery to `cursor-agent models` plain-text output (`id - Label` lines), filtering header/tip/empty-state lines, since `--json`/`model list` are not supported. - Update README to document the corrected CLI usage. - Add regression tests covering probe.ts auth-status parsing and process-manager.ts model discovery. - Add changeset (patch) documenting the fix. Files changed: .changeset/fn-7697-cursor-cli.md | 7 ++ plugins/fusion-plugin-cursor-runtime/README.md | 3 +- .../src/__tests__/probe.test.ts | 94 +++++++++++++++++++--- .../src/__tests__/process-manager.test.ts | 89 +++++++++++++------- plugins/fusion-plugin-cursor-runtime/src/probe.ts | 39 +++++++-- .../src/process-manager.ts | 84 ++++++++++++------- 6 files changed, 239 insertions(+), 77 deletions(-) Fusion-Task-Id: FN-7697 Fusion-Task-Lineage: 6dd56a7f-da8f-4a73-82ff-5e9baab697c5 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
696 B
696 B
fusion-plugin-cursor-runtime
Cursor CLI-backed provider/runtime plugin for Fusion.
Contract summary
- Provider ID:
cursor-cli - Binary probes:
cursor-agent, thencursor - Expected failure states: missing binary, missing Cursor IDE install, locked macOS keychain, unauthenticated runtime
- Model discovery:
cursor-agent models(plain textid - Labeloutput; no--jsonsupport) with header/tip/empty-state filtering, dedupe, and fallback metadata - Auth status:
cursor-agent status --format json(isAuthenticated), probed against the same candidate binary that succeeded--version
Notes
Status/auth and model discovery behavior follows docs/cursor-cli-contract.md.