From 35ee69527d2cd1cc85797aadfc906b7b1a5f0cec Mon Sep 17 00:00:00 2001 From: utpal singh Date: Sun, 25 Oct 2026 07:29:06 +0530 Subject: [PATCH] fix: offer manual Inbox notes for Cursor --- apps/hook/server/inbox-command.ts | 10 ++++- apps/hook/server/inbox-connect-cli.test.ts | 10 +++-- apps/hook/server/inbox-help.ts | 3 +- .../src/content/docs/reference/inbox.md | 5 ++- packages/core/inbox-types.ts | 6 +-- packages/inbox/agentNoteDialog.test.tsx | 2 +- packages/inbox/agents.ts | 5 ++- packages/inbox/agentsSettings.test.tsx | 7 +++- packages/inbox/api.ts | 2 +- packages/inbox/components/AgentNoteDialog.tsx | 38 +++++++++++++------ packages/inbox/components/AgentsSettings.tsx | 16 ++++---- packages/server/inbox-agent-notes.ts | 13 ++++++- packages/server/inbox.ts | 13 ++++--- tests/e2e/inbox-agents.spec.ts | 29 +++++++++++++- 14 files changed, 114 insertions(+), 45 deletions(-) diff --git a/apps/hook/server/inbox-command.ts b/apps/hook/server/inbox-command.ts index 926f143276..46d7468eb7 100644 --- a/apps/hook/server/inbox-command.ts +++ b/apps/hook/server/inbox-command.ts @@ -33,7 +33,7 @@ import { handleInboxServerReady, startInboxServer } from "@plannotator/server/in import { exposureWarning, type InboxTailscaleState } from "@plannotator/server/inbox-tailscale"; import { openBrowser } from "@plannotator/server/browser"; import { agentSpec, createAgentEnvironment, formatConnectReport, inboxConnectDisabled } from "@plannotator/server/inbox-agents"; -import { addInboxNote, inboxNotesDisabled, markNotesAsked } from "@plannotator/server/inbox-agent-notes"; +import { addInboxNote, INBOX_NOTE_BODY, inboxNotesDisabled, markNotesAsked } from "@plannotator/server/inbox-agent-notes"; import { INBOX_AGENT_LABELS, INBOX_AUTO_SEND_AFTER_MS, INBOX_NOTE_AGENT_IDS, type InboxConnectReport, type InboxNoteAgentId } from "@plannotator/core/inbox-types"; import { writeUrlQr } from "@plannotator/server/qr"; import { getCliVersion } from "./cli"; @@ -314,6 +314,12 @@ async function writeNotes(dataDir: string, list: string): Promise { const added: InboxNoteAgentId[] = []; for (const id of ids as InboxNoteAgentId[]) { const label = INBOX_AGENT_LABELS[id]; + if (id === "cursor") { + process.stdout.write(`${INBOX_NOTE_BODY}\n\n`); + process.stderr.write("Cursor User Rules are managed in Cursor Settings → Rules. Copy the block above there; Plannotator cannot detect, update or remove a copied rule.\n"); + added.push(id); + continue; + } // Never a file for an agent that is not on this computer. if (!agentSpec(id).detect(environment)) { ok = false; @@ -342,7 +348,7 @@ async function writeNotes(dataDir: string, list: string): Promise { } // The window never asks about an agent whose note is there now; the others are still asked, once each. await markNotesAsked(added, { dataDir, selfCommand: selfCommand(), environment }); - if (ok) process.stderr.write("Each agent reads it from its next session. Remove it in the Inbox's Settings or with plannotator uninstall.\n"); + if (ok && added.some((id) => id !== "cursor")) process.stderr.write("Managed notes are read from each agent's next session. Remove them in the Inbox's Settings or with plannotator uninstall.\n"); return ok ? 0 : 1; } diff --git a/apps/hook/server/inbox-connect-cli.test.ts b/apps/hook/server/inbox-connect-cli.test.ts index 9eb87f6587..a7cb6a3272 100644 --- a/apps/hook/server/inbox-connect-cli.test.ts +++ b/apps/hook/server/inbox-connect-cli.test.ts @@ -161,15 +161,19 @@ test("plannotator inbox --notes adds only the notes named, starts nothing, and a mkdirSync(join(w.home, ".codex"), { recursive: true }); writeFileSync(join(w.home, ".codex", "AGENTS.md"), "Mine.\n"); mkdirSync(join(w.home, ".gemini"), { recursive: true }); - const result = await cli(w, ["inbox", "--notes", "codex,gemini"]); + const result = await cli(w, ["inbox", "--notes", "codex,gemini,cursor"]); expect(result.code).toBe(0); - expect(result.stdout).toBe(""); + expect(result.stdout).toContain("## Plannotator Inbox"); + expect(result.stdout).not.toContain("plannotator-inbox:start"); + expect(result.stderr).toContain("Cursor User Rules are managed in Cursor Settings → Rules"); + expect(result.stderr).toContain("Plannotator cannot detect, update or remove a copied rule."); expect(result.stderr).toContain("Codex: Added a marked section to ~/.codex/AGENTS.md."); expect(result.stderr).toContain("Gemini CLI: Created ~/.gemini/GEMINI.md."); expect(readFileSync(join(w.home, ".codex", "AGENTS.md"), "utf8")).toContain("