From 1baf71385ff6f5bf88a84189b52899658f7c7c67 Mon Sep 17 00:00:00 2001 From: agentiknet Date: Fri, 11 Sep 2026 15:47:16 +0200 Subject: [PATCH] =?UTF-8?q?fix(docs/cli):=20unbreak=20cli.agentproto.sh=20?= =?UTF-8?q?=E2=80=94=20MDX=20comment=20markers=20in=20sandbox-rendezvous?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cli.agentproto.sh mirrors docs/cli/ into content/docs/ and compiles it with fumadocs-mdx. MDX has no HTML comments — it reads `<` as a JSX tag open — so the `sync-templates` markers in this guide are a hard parse error downstream: 29:2 Unexpected character `!` (U+0021) before name That has failed every production build of agentproto/cli-site since 2026-07-12 — two months, including copy-only PRs, because the break lives here and the red X lives there. (sync-content.mjs already rewrites `` autolinks for the same reason; HTML comments were the gap.) Switch the two markers to the MDX comment form and teach sync-templates that flavor. It already spoke two — `` for markdown, `/* … */` for .ts — so this is a third alternative in the same vocabulary, not a new mechanism; every marked file keeps the flavor its own parser wants. The fixture now uses `{/* … */}` for the docs file, so the three flavors are covered by the existing round-trip tests. --- docs/cli/guides/sandbox-rendezvous.md | 4 ++-- scripts/sync-templates.mjs | 13 +++++++++++-- scripts/sync-templates.test.mjs | 4 +++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/cli/guides/sandbox-rendezvous.md b/docs/cli/guides/sandbox-rendezvous.md index 0e0c11aee8..f8002ead9e 100644 --- a/docs/cli/guides/sandbox-rendezvous.md +++ b/docs/cli/guides/sandbox-rendezvous.md @@ -22,11 +22,11 @@ Providers are resolved from a small built-in catalog by slug: | `box` | An ascii.dev [Box](https://ascii.dev) cloud computer, behind an always-on systemd unit. | `@agentproto/sandbox-box` | | `e2b` | An e2b Firecracker microVM (`agentproto-workstation` template). | `@agentproto/sandbox-e2b` | - +{/* sync-templates:start */} The `e2b` provider's default template is declared in `templates/workstation/versions.json`: `@agentproto/cli@0.17.0`, `@agentproto/adapter-hermes@0.4.10`, `@agentproto/adapter-mastra-agent@0.6.0`, `@agentproto/adapter-opencode@1.1.10`, `opencode-ai@1.18.28`. The on-boot CLI install is skipped only once the template's recorded `baked` block proves the image carries the requested pin. - +{/* sync-templates:end */} (`modal` and `daytona` are catalog placeholders — AIP-36 day-1 provider ids with no published package yet.) diff --git a/scripts/sync-templates.mjs b/scripts/sync-templates.mjs index 50fe760c2d..c784e9b2b9 100644 --- a/scripts/sync-templates.mjs +++ b/scripts/sync-templates.mjs @@ -377,8 +377,17 @@ const PACKAGE_DESCRIPTION = // --- Compute the plan --- -const MARKER_START_RE = /^[ \t]*(?:|\*\/)[ \t]*\n/m -const MARKER_END_RE = /\n[ \t]*(?:|\*\/)/ +// Three comment flavors, one marker vocabulary: +// HTML, for plain markdown (sandbox-e2b README) +// /* … */ JS block, for .ts sources +// {/* … */} MDX expression, for markdown that gets compiled as MDX +// docs/cli/ is mirrored into cli.agentproto.sh and compiled by +// fumadocs-mdx, and MDX rejects HTML comments outright — so files under +// docs/cli/ must use the `{/* … */}` flavor. +const MARKER_START_RE = + /^[ \t]*(?:|\*\/\}|\*\/)[ \t]*\n/m +const MARKER_END_RE = + /\n[ \t]*(?:|\*\/\}|\*\/)/ const plans = [] function planFile(filePath, nextContent) { diff --git a/scripts/sync-templates.test.mjs b/scripts/sync-templates.test.mjs index 030d9d9f34..0d2731efdb 100644 --- a/scripts/sync-templates.test.mjs +++ b/scripts/sync-templates.test.mjs @@ -41,9 +41,11 @@ function makeFixture() { path.join(root, "packages/sandbox-e2b/README.md"), "# pkg\n\n\nstale\n\n", ) + // MDX comment flavor on purpose — docs/cli/ is mirrored into + // cli.agentproto.sh and compiled by fumadocs-mdx, which rejects ``. writeFileSync( path.join(root, "docs/cli/guides/sandbox-rendezvous.md"), - "# guide\n\n\nstale\n\n", + "# guide\n\n{/* sync-templates:start */}\nstale\n{/* sync-templates:end */}\n", ) writeFileSync( path.join(root, "packages/runtime/src/sandbox-providers/registry.ts"),