Skip to content

docs(cockpit): bring the Mastra runtime example to content parity - #912

Merged
blove merged 1 commit into
mainfrom
blove/mastra-content-parity
Sep 1, 2026
Merged

docs(cockpit): bring the Mastra runtime example to content parity#912
blove merged 1 commit into
mainfrom
blove/mastra-content-parity

Conversation

@blove

@blove blove commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

Once the cockpit sidebar shows Mastra (#910, merged — this branch is off origin/main), its page renders an empty docs pane and no browsable backend: the descriptor had no docsAssetPaths/backendAssetPaths and one prompt, versus the aws-strands / microsoft-agent-framework siblings (guide.md, two backend files, backend + frontend prompts).

What

  • Guide: cockpit/runtimes/mastra/angular/docs/guide.md — same structure and register as the siblings' guides: the demonstrated surfaces table (streaming, check_conditions, working-memory state via STATE_SNAPSHOT + real JSON-Patch STATE_DELTA, the suspend/approval interrupt with the forwardedProps.command = { resume, interruptEvent: { toolCallId, runId } } resume shape), the honest subagents note (upstream reserves ACTIVITY_* for background tasks), the Node hosting service at deployments/ag-ui-mastra/, model client, and local run steps. It lives in the angular lane because that is mastra's only lane (TOPIC_LANES), and the descriptor references it explicitly.
  • Second prompt: prompts/mastra-backend.md — the backend-build prompt the siblings keep in their python lane (their pages surface that one); mastra's page now lists backend + frontend prompts.
  • Backend assets: the descriptor now exposes deployments/ag-ui-mastra/agents.mjs + server.mjs. These deliberately point outside cockpit/: the Node service IS the topic's backend (no python lane; the registry entry has no pythonDir). The cockpit reads workspace-root-relative paths at request time, so dev works as-is; for the deployed app, next.config.ts now traces deployments/ag-ui-mastra/*.mjs. No source duplication needed.
  • Descriptor: also gains runtimeUrl: 'runtimes/mastra' and devPort: 4332, matching the siblings.
  • Cockpit pipeline: .mjs maps to javascript for shiki, and JSDoc sections are extracted from .mjs backend files (same comment syntax as .ts).
  • Wiring guard (from fix(cockpit): teach the cockpit the runtimes product #910) extended, not weakened: the mastra spec now asserts the prompt/backend/docs paths, runtimeUrl/devPort, and that every declared mastra asset exists on disk (the content bundle silently renders 'File not found' otherwise).

Verification

  • nx test cockpit green (203 tests, incl. the extended guard).
  • Cockpit dev server: /runtimes/core-capabilities/mastra/overview/python renders the guide narrative, both prompts, highlighted agents.mjs/server.mjs, and zero 'File not found'.
  • generate-ag-ui-deployment-config.ts --check byte-clean (mastra is excluded from the python generator by design).
  • cockpit-runtimes-mastra-angular:smoke green.

🤖 Generated with Claude Code

The mastra topic's cockpit page rendered an empty docs pane and no
backend code: its descriptor declared no docsAssetPaths or
backendAssetPaths and only one prompt, versus the aws-strands and
microsoft-agent-framework siblings (guide.md + two backend files + a
backend-build prompt).

- Add cockpit/runtimes/mastra/angular/docs/guide.md matching the
  siblings' structure: what the example demonstrates (camping planner
  over @ag-ui/mastra), the suspend/approval interrupt flow and its
  command.interruptEvent resume shape, working memory as
  STATE_SNAPSHOT/STATE_DELTA, the hand-written Node hosting service at
  deployments/ag-ui-mastra/, and the honest subagents note (upstream
  reserves ACTIVITY for background tasks).
- Add prompts/mastra-backend.md — the backend-build prompt siblings
  keep in their python lane; mastra has no python lane so both prompts
  live beside the Angular app.
- Descriptor: declare docsAssetPaths, backendAssetPaths
  (deployments/ag-ui-mastra/{agents,server}.mjs — the topic's real
  backend lives outside cockpit/ by design), runtimeUrl, devPort.
- apps/cockpit: trace deployments/ag-ui-mastra/*.mjs into the deployed
  bundle, map .mjs to javascript highlighting, and extract JSDoc
  sections from .mjs backend files.
- Extend the #910 wiring-guard spec: assert the new mastra fields and
  that every declared mastra asset exists on disk (the content bundle
  degrades to 'File not found' silently otherwise).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 1, 2026 2:44am UTC

Request Review

@github-actions github-actions Bot 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.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove enabled auto-merge (squash) September 1, 2026 02:42
@blove
blove merged commit 472d97a into main Sep 1, 2026
23 checks passed
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.

1 participant