Skip to content

Live status header icon + redesigned videos page - #758

Draft
David Pine (IEvangelist) wants to merge 23 commits into
mainfrom
dapine/live-status
Draft

Live status header icon + redesigned videos page#758
David Pine (IEvangelist) wants to merge 23 commits into
mainfrom
dapine/live-status

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Apr 28, 2026

Copy link
Copy Markdown
Member

Live status header icon + redesigned videos page

Adds a real-time live indicator to the aspire.dev site header, immediately left of cookie preferences, and replaces the legacy /community/videos/ curated list with a focused two-tab live page for YouTube and Twitch.

When a stream is live, state is pushed to connected clients over Server-Sent Events from StaticHost. The header icon strobes everywhere except /community/videos/ and while native Picture-in-Picture is already open. Clicking the live header icon opens a native Document Picture-in-Picture window when supported, and falls back to the videos page otherwise. The PiP window is tracked as site-global state so it survives Astro client-side navigations without recreating the embed or interrupting playback; closing native PiP only closes PiP and does not redirect.

What's included

  • Frontend live icon, SSE client, header wiring, and videos page rewrite.
  • Native Document Picture-in-Picture controller for live embeds, with YouTube/Twitch embed selection from the server-provided primarySource and PiP-open state shared across Astro navigations.
  • YouTube/Twitch tab icons and offline channel embeds: YouTube loads the aspiredotdev channel live-stream embed and Twitch loads the aspiredotdev channel player even when no live event is active.
  • ASP.NET Core live-status backend with GET /api/live, GET /api/live/stream, Twitch EventSub webhook, YouTube WebSub webhook, and a dev-only override endpoint.
  • Twitch and YouTube background services with resilient named HttpClients, webhook signature validation, reconciling polls/subscription renewal, and safe idle behavior when provider credentials are missing.
  • AppHost dashboard URLs, Scalar API reference, and local dashboard commands for offline/online fake states and signed fake webhook invocations.
  • Server-side protection for dev/dashboard commands via a per-run secret AppHost parameter sent as X-Aspire-Live-Dev-Command-Key and validated by StaticHost.
  • wwwroot/.gitignore guard so local copies of the built frontend output cannot be accidentally added to source control.
  • Frontend scripts build:statichost and build:statichost:skip-search that build Astro directly into src/statichost/StaticHost/wwwroot while preserving the Scalar assets and ignore guard.

Local testing

Start the AppHost from the worktree root with aspire start --isolated --apphost .\src\apphost\Aspire.Dev.AppHost\Aspire.Dev.AppHost.csproj, open the Aspire dashboard, select the aspiredev resource, and run the live-status commands from the Actions context menu.

To refresh the local StaticHost static files without search indexing, run from src/frontend:

pnpm build:statichost:skip-search

In AppHost run mode, StaticHost gets Live__EnableDevEndpoint=true and per-run secret parameters for the dev command key and fake webhook signing keys. Without real provider API credentials, Twitch and YouTube workers stay idle, so the feature is effectively off until a dashboard command triggers it.

Useful endpoints on the aspiredev resource: /api/live, /api/live/stream, /api/live/twitch/webhook, /api/live/youtube/webhook, /api/live/_dev/set, and /scalar/v1. The Twitch webhook is POST-only for notifications and the YouTube webhook supports GET verification plus POST notifications; plain GETs now return descriptive text instead of an unhelpful 404.

Tests

  • tests/StaticHost.Tests covers webhook HMAC verification, YouTube Atom parsing, JSON shape, live-state aggregation, coalescing, subscribe/unsubscribe, and timing behavior.
  • src/frontend/tests/unit/live-status.vitest.test.ts covers the live-status client public API.
  • src/frontend/tests/e2e/live-status.spec.ts covers mocked /api/live + SSE behavior, header strobing, videos-page no-strobe behavior, PiP-open strobe suppression, native PiP click interception, PiP state surviving Astro client-side navigation, and idle channel embeds.

Configuration

"Live": {
  "EnableDevEndpoint": false,
  "DevCommandSecret": "",
  "Twitch": { "ClientId": "", "ClientSecret": "", "WebhookSecret": "", "ChannelLogin": "aspiredotdev" },
  "YouTube": { "ApiKey": "", "WebhookSecret": "", "ChannelHandle": "@aspiredotdev" }
}

User-secrets in dev, env vars / Key Vault in prod. Missing provider secrets degrade safely: the workers log and remain idle, while the API/SSE endpoints continue serving the non-live state.

@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review May 4, 2026 14:24
Copilot AI review requested due to automatic review settings May 4, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new end-to-end “live status” feature to aspire.dev: StaticHost exposes live state + SSE + Twitch/YouTube webhooks, and the frontend consumes it to drive a header live icon, a redesigned /community/videos/ live page, and a site-global Document Picture-in-Picture experience.

Changes:

  • Implemented StaticHost live-status backend (JSON + SSE, Twitch EventSub + YouTube WebSub, background reconciliation/polling, dev-only override endpoint, Scalar OpenAPI in dev).
  • Added frontend live-status client + header integration + PiP controller, and rewrote /community/videos/ into a two-tab live embeds page.
  • Added comprehensive unit/e2e tests plus a build script to emit Astro output directly into StaticHost wwwroot.

Reviewed changes

Copilot reviewed 50 out of 51 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/StaticHost.Tests/StaticHost.Tests.csproj Adds new StaticHost test project and dependencies.
tests/StaticHost.Tests/Live/YouTubeWebSubServiceTests.cs Unit tests for YouTube worker tick behavior.
tests/StaticHost.Tests/Live/YouTubeWebhookHandlerTests.cs Unit tests for YouTube signature + Atom parsing helpers.
tests/StaticHost.Tests/Live/YouTubeClientTests.cs Unit tests for YouTube Data API + PubSubHubbub client.
tests/StaticHost.Tests/Live/TwitchWebhookHandlerTests.cs Unit tests for Twitch signature verification and webhook handler behavior.
tests/StaticHost.Tests/Live/TwitchEventSubServiceTests.cs Unit tests for Twitch reconcile logic (create/delete subs).
tests/StaticHost.Tests/Live/TwitchClientTests.cs Unit tests for Twitch Helix client behavior.
tests/StaticHost.Tests/Live/TwitchAppTokenProviderTests.cs Unit tests for token acquisition + refresh behavior.
tests/StaticHost.Tests/Live/LiveTestHelpers.cs Shared test helpers (fake options monitor, HTTP handler recording, etc.).
tests/StaticHost.Tests/Live/LiveStatusJsonTests.cs Ensures YouTube property name serialization is correct.
tests/StaticHost.Tests/Live/LiveStatusBroadcasterTests.cs Unit tests for broadcaster aggregation + coalescing + subscriptions.
tests/StaticHost.Tests/GlobalUsings.cs Global usings for the new test project.
src/statichost/StaticHost/wwwroot/scalar/aspire-theme.css Adds Aspire-themed Scalar CSS for dev API reference.
src/statichost/StaticHost/wwwroot/.gitignore Prevents committing locally-built Astro output while preserving Scalar assets.
src/statichost/StaticHost/StaticHost.csproj Adds resilience/OpenAPI/Scalar packages and debug content trimming for wwwroot.
src/statichost/StaticHost/Program.cs Wires live-status + OpenAPI/Scalar in dev and adjusts static assets serving behavior.
src/statichost/StaticHost/Live/YouTube/YouTubeWebSubService.cs Implements YouTube background worker (subscribe + polling).
src/statichost/StaticHost/Live/YouTube/YouTubeWebhookHandler.cs Adds pure helper methods for YouTube webhook signature + payload parsing.
src/statichost/StaticHost/Live/YouTube/YouTubeClient.cs Implements YouTube API + PubSubHubbub client.
src/statichost/StaticHost/Live/YouTube/IYouTubeClient.cs Defines YouTube client abstraction + result types.
src/statichost/StaticHost/Live/Twitch/TwitchWebhookHandler.cs Adds pure helper methods for Twitch EventSub signature + state updates.
src/statichost/StaticHost/Live/Twitch/TwitchEventSubService.cs Implements Twitch background worker reconcile loop + state seeding.
src/statichost/StaticHost/Live/Twitch/TwitchClient.cs Implements Twitch Helix client for user/stream/subscription operations.
src/statichost/StaticHost/Live/Twitch/TwitchAppTokenProvider.cs Implements cached Twitch app token provider for Helix requests.
src/statichost/StaticHost/Live/Twitch/ITwitchClient.cs Defines Twitch client abstraction + record types.
src/statichost/StaticHost/Live/README.md Documents architecture, endpoints, configuration, and testing strategy.
src/statichost/StaticHost/Live/LiveStatusServiceCollectionExtensions.cs Adds DI registration for live-status feature + named resilient HttpClients.
src/statichost/StaticHost/Live/LiveStatusOptions.cs Adds strongly-typed configuration options for live-status feature.
src/statichost/StaticHost/Live/LiveStatusBroadcaster.cs Implements live snapshot aggregation + coalesced broadcasts + subscriptions.
src/statichost/StaticHost/Live/LiveStatus.cs Defines live snapshot schema + source-gen JSON context.
src/statichost/StaticHost/Live/LiveEndpoints.cs Maps /api/live JSON, SSE stream, webhooks, and dev endpoint.
src/statichost/StaticHost/GlobalUsings.cs Updates global usings to include live-status namespace.
src/statichost/StaticHost/appsettings.json Adds Live configuration section defaults.
src/frontend/tests/unit/live-status.vitest.test.ts Adds unit tests for the live-status client public API.
src/frontend/tests/e2e/ui-regressions.spec.ts Updates header action ordering assertions and adds navigation regression coverage.
src/frontend/tests/e2e/live-status.spec.ts Adds extensive e2e coverage for SSE behavior, header state, PiP, and videos page behavior.
src/frontend/src/content/docs/community/videos.mdx Replaces curated videos list with “Aspire Live” page embedding YouTube/Twitch.
src/frontend/src/content/docs/community/index.mdx Renames community CTA to “Watch live streams”.
src/frontend/src/components/YouTubeEmbed.astro Supports channel live-stream embed + adjusts iframe labeling.
src/frontend/src/components/TwitchEmbed.astro Adjusts iframe labeling and props typing.
src/frontend/src/components/starlight/Header.astro Adds header live icon + loads live-status client + adds PiP controller.
src/frontend/src/components/starlight/Head.astro Enables Astro ClientRouter for client-side transitions.
src/frontend/src/components/LiveVideosTabs.astro Adds two-tab live embeds component wired to live-status snapshots.
src/frontend/src/components/LivePip.astro Implements site-global Document Picture-in-Picture controller UI + logic.
src/frontend/src/components/live-status.ts Adds singleton SSE client, DOM wiring, dismissal logic, and snapshot pub/sub.
src/frontend/src/assets/icons/live.svg Adds the “live” header icon SVG.
src/frontend/scripts/build-static-host.mjs Adds script to build Astro directly into StaticHost wwwroot while preserving Scalar assets.
src/frontend/package.json Adds build:statichost and build:statichost:skip-search scripts.
src/frontend/config/sidebar/community.topics.ts Renames “Videos” navigation entry to “Live Streams” (with translations).
src/frontend/astro.config.mjs Supports configurable outDir via ASTRO_OUT_DIR.
src/apphost/Aspire.Dev.AppHost/AppHost.cs Adds local dev dashboard commands + per-run secrets for live-status simulation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/statichost/StaticHost/Live/LiveEndpoints.cs Outdated
Comment thread src/statichost/StaticHost/Live/LiveEndpoints.cs Outdated
Comment thread src/frontend/src/components/LiveVideosTabs.astro
Comment thread src/statichost/StaticHost/Live/YouTube/YouTubeWebSubService.cs
Comment thread src/statichost/StaticHost/Live/Twitch/TwitchEventSubService.cs
Comment thread src/apphost/Aspire.Dev.AppHost/AppHost.cs Outdated
Comment thread src/apphost/Aspire.Dev.AppHost/AppHost.cs Outdated
Comment thread src/apphost/Aspire.Dev.AppHost/AppHost.cs Outdated
Comment thread src/statichost/StaticHost/StaticHost.csproj Outdated
David Pine (IEvangelist) added a commit that referenced this pull request May 11, 2026
Two follow-ups from @eerhardt's review on PR #807:

* Move InternalsVisibleTo into StaticHost.csproj using
  Include="$(AssemblyName).Tests" to match the convention established
  in PR #758 and the existing src/tools/*.csproj files. Delete the
  now-unnecessary Properties/AssemblyInfo.cs.

* Mirror MarkdownNegotiationMiddleware's positive ShouldHandle pattern
  in LinkHeaderMiddleware. The two were inverted: one returned
  "should I handle?" while the other returned "should I skip?".
  Both now use the same shape — guard with !ShouldHandle, then check
  MarkdownPathMapper.IsInfrastructurePath separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
David Pine (IEvangelist) and others added 21 commits May 11, 2026 14:26
- Adds a strobing live-status indicator in the site header (left of the
  cookie-preferences button) wired to a new /api/live SSE endpoint.
- Adds a custom floating PiP player that follows visitors across the
  site while live and returns them to the videos page on close.
- Replaces the legacy curated /community/videos/ page with a focused
  YouTube + Twitch tabbed page whose embed lights up when live.
- Adds an in-StaticHost background-worker stack:
  * Twitch EventSub stream.online/offline subscription + reconcile,
  * YouTube WebSub subscribe/renew + confirming poll fallback,
  * a debounced LiveStatusBroadcaster with sticky primary-source
    mesh logic and Channel<T> SSE fan-out.
- Surfaces the new endpoints + Scalar API reference (with a custom
  Aspire-brand theme) on the Aspire dashboard for local dev.
- Includes a worktree cleanup helper script and PR_BODY.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- StaticHost.Tests xUnit project: TwitchWebhookHandler (HMAC-SHA256
  round-trip + tamper detection), YouTubeWebhookHandler (HMAC-SHA1 +
  Atom video-id extraction), LiveStatusBroadcaster (sticky-primary
  mesh, coalesce window via FakeTimeProvider, subscribe/unsubscribe).
- vitest spec for live-status.ts public API.
- Playwright spec mocking /api/live + a controllable SSE stream to
  drive the header icon strobe and the floating PiP open/close UX.

22 backend xUnit tests + 3 vitest assertions all green locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove hard-wrapped prose from the draft PR description so GitHub renders paragraphs and list items without arbitrary line breaks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not keep the temporary GitHub PR description file in source control.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The cleanup helpers were workflow-only artifacts and should not be source controlled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Enable an explicit AppHost local dev mode for live-status testing.
- Add dashboard HTTP commands on the StaticHost resource to fake Twitch
  and YouTube live events, including signed calls to the real webhook
  endpoints.
- Keep provider workers idle when API credentials are absent so local
  state only changes when commanded.
- Fix the live-status JSON contract to emit youtube, matching the
  frontend client, and add coverage for that shape.
- Document dashboard-command and manual HTTP testing paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable Astro client routing so same-origin site links swap content without unloading the opener document that owns the native Document Picture-in-Picture window. Update the live-status e2e coverage to click a real internal Docs link and assert the PiP iframe remains intact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When both Twitch and YouTube are live, show an explicit live-source menu from the header action before opening native Picture-in-Picture. Keep the selected source sticky while it remains live and allow switching an existing PiP window without recreating it.

Also replace noisy iframe title attributes on the live embeds with aria-labels so the videos tabs keep an accessible frame name without hover title noise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add YouTube and Twitch icons to the live-source chooser and remove the redundant aspiredotdev helper text. Rename the Community sidebar entry and related live destination copy from videos to Live Streams.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the cookie consent root across Astro client-side body swaps so preferences continue to open after navigation. Restyle the live source chooser to align with the existing install modal treatment and cover the cookie regression with Playwright.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Always show the live chooser while live so users can pick native PiP, the aspire.dev embeds, or the provider platform directly. Add a session-scoped dismiss action that silences the strobing live notification for the current live event without hiding the live entry point.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the live action dialog within narrow viewports and add mobile E2E coverage using mocked live status APIs. Also keep generated StaticHost output out of Debug build item discovery so local AppHost starts remain fast.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make repeated live icon clicks toggle the live dialog, render the mobile dialog as a stable full-width sheet, restore a wider desktop menu with one-line labels, and harden mocked live-status E2E coverage for both layouts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Anchor the mobile live action dialog below the top navigation instead of using a bottom sheet, add a top-right dismiss button matching the Install CLI modal affordance, and update E2E coverage for placement and dismiss behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use regular Fluent icon names for local live command actions, reorganize the live action dialog into PiP, embedded-player, and platform groups, add external-link affordances, and introduce a stable liveSessionId so dismissing a live notification covers near-simultaneous provider joins.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Account for the live status header action in the compact header reachability test and map it by tour target so the assertion remains stable when live-state labels change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eric Erhardt (eerhardt) and others added 2 commits May 11, 2026 14:55
* PR feedback

* fixup
The six API reference page templates initialized their search controllers
inside a `DOMContentLoaded` listener. After this branch adds the
`<ClientRouter />` to `Head.astro` (so the live PiP can persist
across navigation), the site swaps bodies via view transitions and
`DOMContentLoaded` does not refire on subsequent navigations. As a
result, clicking the C#/TypeScript API buttons from the global search
dialog landed on the API page with the URL `?q=` parameter in place but
the controller was never instantiated, so `#ts-api-search-input` (and
its C# counterpart) was never populated and search results were never
rendered.

Switch all six API reference page initializers to `astro:page-load`,
which fires on the initial load and after every view-transition swap.
This matches the convention already used by `Sidebar.astro`,
`PageTitle.astro`, `InstallCliModal.astro`, and the rest of the
post-ClientRouter components in this branch.

Resolves:
  tests/e2e/site-search.spec.ts:200 'typed query is forwarded to the
  C# and TypeScript API buttons' (desktop / tablet / mobile chromium).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
David Pine (IEvangelist) added a commit that referenced this pull request May 19, 2026
Two follow-ups from @eerhardt's review on PR #807:

* Move InternalsVisibleTo into StaticHost.csproj using
  Include="$(AssemblyName).Tests" to match the convention established
  in PR #758 and the existing src/tools/*.csproj files. Delete the
  now-unnecessary Properties/AssemblyInfo.cs.

* Mirror MarkdownNegotiationMiddleware's positive ShouldHandle pattern
  in LinkHeaderMiddleware. The two were inverted: one returned
  "should I handle?" while the other returned "should I skip?".
  Both now use the same shape — guard with !ShouldHandle, then check
  MarkdownPathMapper.IsInfrastructurePath separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
David Pine (IEvangelist) added a commit that referenced this pull request May 20, 2026
… Content-Signal, agent-skills, WebMCP) (#807)

* Add agent-readiness improvements (Link headers, markdown negotiation, robots Content-Signal, agent-skills, WebMCP)

Bring aspire.dev up to spec for the checks at https://isitagentready.com:

* RFC 8288 Link headers on HTML responses
  - LinkHeaderMiddleware advertises </llms.txt>; rel="llms",
    </.well-known/agent-skills/index.json>; rel="agent-skills",
    </sitemap-index.xml>; rel="sitemap", and a per-page rel="alternate"
    type="text/markdown" link when a .md companion exists.
  - Header attached via Response.OnStarting on 2xx text/html responses only;
    redirects, JSON, static assets, and well-known JSON are skipped.

* Cloudflare-style "Markdown for Agents" content negotiation
  - MarkdownNegotiationMiddleware handles Accept: text/markdown by streaming
    the .md companion (emitted by starlight-page-actions) directly via
    IFileProvider.SendFileAsync. No path rewrite, so no interaction with
    UseRouting / MapStaticAssets endpoint selection.
  - Cache-Control: private, max-age=0, must-revalidate ensures Front Door
    does NOT cache, avoiding Vary: Accept cache-key explosion.
  - 406 when markdown preferred but no companion AND no HTML acceptable.
  - HEAD parity, Vary: Accept on negotiated responses, infrastructure paths
    (.well-known, _astro, healthz, install., pagefind) bypass negotiation.

* Both new middlewares run BEFORE UseDefaultFiles + UseRouting (UseDefaultFiles
  rewrites /foo/ -> /foo/index.html, breaking companion mapping; MapStaticAssets
  registers endpoints during UseRouting, so post-routing path rewrites do not
  re-trigger endpoint selection).

* robots.txt declares Content-Signal: ai-train=yes, search=yes, ai-input=yes
  inside the User-agent: * group (per draft-romm-aipref-contentsignals).

* /.well-known/agent-skills/index.json (Agent Skills Discovery RFC v0.2.0)
  with a getting-started-with-aspire SKILL.md and a digest field of the form
  sha256:<lowerhex>. compute-skill-digests.mjs recomputes / verifies on every
  build; pnpm lint runs verify-skill-digests in --check mode.
  .gitattributes pins LF for the agent-skills artifacts so digests are
  byte-stable across Windows / Linux checkouts.

* WebMCP integration on the Astro side
  - src/scripts/webmcp.ts feature-detects navigator.modelContext.registerTool
    and registers a single search-aspire-docs tool with a JSON Schema input.
  - Backed by src/scripts/search/* (SearchProvider abstraction with Pagefind
    today and a Typesense stub for the upcoming migration). The WebMCP tool
    surface is engine-agnostic so the Pagefind -> Typesense swap is a one-line
    change in src/scripts/search/index.ts.
  - Hooked into Head.astro via a single import line.

* New host-level tests in tests/StaticHost.Tests/
  - In-process TestServer with a temp wwwroot fixture (no frontend build
    required; PrivateAssets="all" on the frontend.esproj reference prevents
    the dist/ directory from leaking into test compilations).
  - 51 tests covering markdown negotiation (incl. HEAD, 406, fallback, Vary
    behavior, infrastructure-path skip), Link header content + skip rules,
    AcceptHeaderParser q-value handling, and the well-known artifacts.

* New Playwright spec tests/e2e/webmcp.spec.ts asserts that the homepage
  registers exactly one WebMCP tool (search-aspire-docs) when the runtime
  exposes navigator.modelContext, and that the absence of the API is
  non-fatal.

Out of scope (intentionally not advertised, would mislead agents):
* /.well-known/openid-configuration / oauth-authorization-server (no protected APIs).
* /.well-known/oauth-protected-resource (no protected resource).
* /.well-known/mcp/server-card.json (aspire.dev does not host an MCP server).
* /.well-known/api-catalog (RFC 9727 requires real API endpoints; aspire.dev
  exposes documentation, an LLM corpus, a sitemap, and an RSS feed - none of
  which are APIs in the RFC's sense).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite getting-started-with-aspire skill to match official Aspire skill conventions

The first cut was inaccurate — it told agents to `mkdir my-aspire-app && cd
my-aspire-app && aspire new` and then non-interactively pick a template. In
reality `aspire new` is fully interactive and creates its own project folder,
so the mkdir+cd pattern is wrong and the fabricated template flags would
mislead agents.

Rewrite the skill to align with the conventions used by the official skill
at github.com/microsoft/aspire/tree/main/.agents/skills/aspire while keeping
this one short and focused on getting started:

* Frontmatter description is now a long when-to-use / when-not-to-use
  sentence in the same shape as the official skill.
* Body: install, `aspire new` (interactive, no fabricated flags), `aspire
  start` (called out as the agent-friendly path vs. `aspire run` which
  blocks the terminal), and a concise list of authoritative references.
* Explicit pointer to the official `aspire` skill for the operate-an-existing-
  app workflow, so an agent that has both available picks the right one.
* Updated index.json description to match the new framing.
* compute-skill-digests.mjs refreshed the sha256 to reflect the new bytes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Correct Aspire framing in skill: polyglot, not .NET-only

Aspire is a polyglot stack — the AppHost can be authored in C# or TypeScript
today, with additional languages (Java, Go, Python, Rust, …) on the roadmap.
Calling it "the .NET cloud-native stack" was both inaccurate and misleading
to agents who would then assume C#-only tooling and dismiss the TypeScript
AppHost path.

Re-runs compute-skill-digests.mjs to update the index.json digest to match
the corrected SKILL.md bytes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Tighten markdown-companion mapping and centralize agent-readiness DRY

Concerns flagged by the user:
1. LinkHeaderMiddleware.ShouldSkip duplicated the infrastructure path list
   maintained on MarkdownPathMapper.IsInfrastructurePath. Fixed by routing the
   path-skip check through the helper so both middlewares stay in lock-step.
2. Not every page on aspire.dev produces a `.md` companion (DocFX-rendered
   /reference/api/**, the search route, Lunaria stats, redirects, the 404
   page). The previous mapper accepted any `.md` that happened to exist on
   disk, so a stray markdown file with no real HTML page would have been
   advertised via the `Link: rel="alternate"; type="text/markdown"` header
   and served by the negotiation middleware on `Accept: text/markdown`.
   Fixed by requiring BOTH the `.md` AND the corresponding HTML page to
   exist before declaring a companion. Adds new xUnit cases pinning the
   stray-md scenario for both middlewares.

Additional cleanup along the way:
* AcceptHeaderParser.PrefersMarkdown: removed a dead `htmlQ` assignment and
  hoisted `HighestExplicitQuality` to a private static method so markdown
  and html lookups go through the same helper.
* Extracted shared sample HTML/Markdown bodies and seed helpers used by
  LinkHeaderTests + MarkdownNegotiationTests into SamplePages so the
  on-disk Starlight layout is described in one place.

Tests: 57 passing (was 51), 0 warnings, 0 errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR #807 review comments

* MarkdownNegotiationMiddleware: drop the stale reference to the
  `HasMarkdownCompanion` API (which never existed in this PR's final
  form); point readers at `MarkdownPathMapper.TryGetMarkdownCompanion`
  instead so the comment matches the live code.
* compute-skill-digests.mjs: harden `resolvePublicPath` against `..`
  traversal. Switches from `path.join` to `path.resolve` and asserts the
  result stays under `publicRoot` so a malicious or malformed `url` in
  index.json (e.g. `/.well-known/agent-skills/../../../../etc/passwd`)
  cannot read bytes outside the published public/ tree in dev/CI.
* WellKnownArtifactTests: rename `Agent_skills_files_are_LF_only` to
  `AgentSkills_files_are_LF_only` to match the surrounding
  `AgentSkills_*` PascalCase prefix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review nits: InternalsVisibleTo in csproj, symmetrical helper

Two follow-ups from @eerhardt's review on PR #807:

* Move InternalsVisibleTo into StaticHost.csproj using
  Include="$(AssemblyName).Tests" to match the convention established
  in PR #758 and the existing src/tools/*.csproj files. Delete the
  now-unnecessary Properties/AssemblyInfo.cs.

* Mirror MarkdownNegotiationMiddleware's positive ShouldHandle pattern
  in LinkHeaderMiddleware. The two were inverted: one returned
  "should I handle?" while the other returned "should I skip?".
  Both now use the same shape — guard with !ShouldHandle, then check
  MarkdownPathMapper.IsInfrastructurePath separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove Typesense stubs and flatten search abstraction

The original PR shipped a SearchProvider interface plus a Typesense stub
in src/frontend/src/scripts/search/ so the Pagefind -> Typesense swap
would be a one-line change. We're no longer doing that migration, so
the abstraction layer has no remaining justification.

* Delete src/frontend/src/scripts/search/typesense-provider.ts
* Delete src/frontend/src/scripts/search/SearchProvider.ts
* Delete src/frontend/src/scripts/search/index.ts
* Delete src/frontend/src/scripts/search/pagefind-provider.ts
* Inline the Pagefind logic and types into a single
  src/frontend/src/scripts/search.ts that exports
  searchAspireDocs(query, limit).
* webmcp.ts now imports searchAspireDocs directly; drop the stale
  "Pagefind today, Typesense later" comment and the provider-selector
  indirection.

No behavior change for the WebMCP search-aspire-docs tool. Pagefind is
the only backend now, and the unavailable-fallback contract is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com>
@IEvangelist
David Pine (IEvangelist) marked this pull request as draft July 21, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants