githubnext/chopinPublic

Let's compose rich plans together

Keep MCP updates of stored links working and drop unsafe pasted links

- MCP update_document no longer applies the new-document URL check; only
  create does. Updates go through edit.replace, which judges against the
  stored document.
- The introduced-URL check also refuses surrounding whitespace and a
  scheme hidden by whitespace, and reports the structural path.
- A new local link (paste, import) whose address fails checkUrl is
  unwrapped to its text before it syncs, so a paste cannot send a batch
  the server refuses.
- Tests: MCP update of a stored backslash link, moving and duplicating a
  stored URL, a hidden character through room.apply, Service.initial
  refusals, the paste guard, and a paste e2e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C5MAMaggie Appleton and Claude Opus 5.5 authored
a1a5020Patch
Parent2a7aa2f
12 files changed+274-23
StackedSplit
apps/server/src/mcp/create.ts+8 โˆ’6
apps/server/src/mcp/update-lifecycle.test.ts+20 โˆ’0
apps/server/src/mcp/update.test.ts+12 โˆ’0
apps/server/src/plan/creation.test.ts+12 โˆ’0
apps/server/src/plan/room.test.ts+13 โˆ’0
e2e/toolbar.e2e.ts+28 โˆ’0
packages/dialect/src/dialect.test.ts+24 โˆ’0
packages/dialect/src/dialect.ts+22 โˆ’0
packages/dialect/src/validate.ts+13 โˆ’17
packages/editor/src/toolbar/link.tsx+2 โˆ’0