feat(core): allow nlweb rel in page:metadata link contributions#523
Merged
Conversation
Adds "nlweb" to PageMetadataLinkRel and the runtime allowlist so plugins can inject <link rel="nlweb" href="..."> tags pointing at conversational endpoints. Mirrors the existing pattern used for other agent-discovery link types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9191289 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds "nlweb" as an allowed <link rel="..."> value for page:metadata contributions so plugins can emit NLWeb-style discovery links.
Changes:
- Extend
PageMetadataLinkRelto include"nlweb". - Extend the sandbox/runtime allowlist (
VALID_LINK_REL) to accept"nlweb"across the RPC boundary. - Add a unit test asserting
resolvePageMetadatapreserves annlweblink contribution.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/src/plugins/types.ts | Adds "nlweb" to the typed PageMetadataLinkRel union for plugin contributions. |
| packages/core/src/emdash-runtime.ts | Allows "nlweb" through the security-critical sandbox rel allowlist. |
| packages/core/tests/unit/plugins/page-metadata.test.ts | Adds a unit test verifying nlweb link contributions resolve into output links. |
| .changeset/nlweb-link-rel.md | Declares a minor version bump for emdash documenting the new allowed rel value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
jdevalk
added a commit
to jdevalk/emdash-plugin-seo
that referenced
this pull request
Apr 13, 2026
When the new `nlwebEndpoint` setting is populated, metadataHandler contributes `<link rel="nlweb" href="…">` via the page:metadata hook so conversational agents can discover the site's chat surface without scraping HTML. Requires the EmDash release that contains emdash-cms/emdash#523 (merged upstream). The contribution carries a transient @ts-expect-error against the currently-published emdash types — it auto-unblocks once the new emdash version is on npm. Also adds an "Agent discovery" admin section for the setting and a tiny parseSettings round-trip test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fmhall
pushed a commit
to fmhall/emdash
that referenced
this pull request
Apr 13, 2026
…emdash-cms#523) Adds "nlweb" to PageMetadataLinkRel and the runtime allowlist so plugins can inject <link rel="nlweb" href="..."> tags pointing at conversational endpoints. Mirrors the existing pattern used for other agent-discovery link types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
"nlweb"to thePageMetadataLinkRelallowlist so plugins can contribute<link rel="nlweb" href="...">tags via thepage:metadatahook.Motivation: agent/LLM discovery increasingly uses NLWeb-style link tags to advertise a conversational endpoint for a site. Today a plugin that wants to emit this has no path through the typed
page:metadatacontribution — the allowlist rejects therelvalue at the sandbox boundary inemdash-runtime.ts. An SEO plugin currently being built (seo-graph / emdash-plugin-seo) needs this for parity with what the equivalent Astro integration already does.Scope: minimal. One entry each in:
packages/core/src/plugins/types.ts—PageMetadataLinkRelunionpackages/core/src/emdash-runtime.ts—VALID_LINK_RELSet (sandbox-safe allowlist)packages/core/tests/unit/plugins/page-metadata.test.ts— resolve/dedupe testNo behavior change for anything that wasn't rejected before. No new capability, no new hook.
Type of change
Opened as draft so the tiny design decision (the value
"nlweb"vs. e.g."service") can be confirmed before merge. Happy to rename if reviewers prefer a more generic rel.Checklist
pnpm typecheckpasses (core)pnpm testpasses (page-metadata suite: 29/29)pnpm formatrunresolves nlweb link for agent discovery)emdashminor — new public API value)AI-generated code disclosure
Part of a small upstream-API series opened in coordination: this (trivial) PR is the only one submitted directly; the related
page:robots,notfound, andcontent:validatehook proposals will come via Discussions first per CONTRIBUTING.md.