Skip to content

chore: auto-fetch Cursor cloud agent transcripts on URL paste#181

Merged
tonyketcham merged 4 commits into
mainfrom
toeknee/cursor-cloud-agent-fetch-script
May 10, 2026
Merged

chore: auto-fetch Cursor cloud agent transcripts on URL paste#181
tonyketcham merged 4 commits into
mainfrom
toeknee/cursor-cloud-agent-fetch-script

Conversation

@tonyketcham
Copy link
Copy Markdown
Collaborator

Add a workspace Cursor rule and a pnpm script that call @cursor/sdk (Agent.listRuns + getRun + conversation) when a cursor.com/agents URL or bc- agent id appears in chat.

Add a workspace Cursor rule and a pnpm script that call @cursor/sdk
(Agent.listRuns + getRun + conversation) when a cursor.com/agents URL
or bc- agent id appears in chat.

Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
@tonyketcham tonyketcham added CI / CD continuous integration / continuous deployment and removed CI / CD continuous integration / continuous deployment labels May 9, 2026
Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one issue that should be fixed before merge.

packages/proof/scripts/fetch-cloud-agent-conversation.mjs currently crashes when the new command is invoked without a positional argument (pnpm run cursor:fetch-cloud-agent from the repo root reproduces this). Instead of printing usage/help, it throws Node's The "path" argument must be of type string ... Received type number (0) because the stdin fallback is using fs/promises.readFile(0, ...). Please fix that path and add a focused regression test for the no-arg / - cases so the new workflow stays reliable.

Open in Web View Automation 

Sent by Cursor Automation: Flatbread PR Review

);
let raw = input;
if (input === '' || input === '-') {
const { readFile } = await import('node:fs/promises');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stdin fallback is currently broken: fs/promises.readFile() does not accept a numeric fd here, so pnpm run cursor:fetch-cloud-agent (or ... -- -) dies with The "path" argument must be of type string ... Received type number (0) before we ever reach the usage/error handling below. Since this PR introduces the command specifically for agent-facing workflows, can we switch this to a real stdin reader (process.stdin or fs.readFileSync(0, 'utf8')) and cover the no-arg / - cases with a regression test?

cursoragent and others added 2 commits May 10, 2026 20:17
Use async stdin consumption instead of fs/promises.readFile(0), which
is invalid for numeric fds in this Node API.

Treat standalone '-' as a positional stdin sentinel so pnpm -- - works.

Add AVA regression tests for piped stdin with no args and with '-'.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
Validate --run and --api-key values; parse URLs without hiding failures while
still falling back to bc-/run- regex when URL() rejects the href. Sort cloud
runs by createdAt with stable id tie-break; log full errors from main().
Publish scripts/ in @flatbread/proof so the packaged npm script resolves.
Align the workspace Cursor rule with stdout JSON (agentId and slim run).

AVA covers missing flag values; Proof DAG review used composer-2 on all ranks.

Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
@tonyketcham tonyketcham merged commit 905861c into main May 10, 2026
20 checks passed
@tonyketcham tonyketcham deleted the toeknee/cursor-cloud-agent-fetch-script branch May 10, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI / CD continuous integration / continuous deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants