Files
supabase/apps/docs/lib/content-listings.zod.mjs
Saxon Fletcher 36d2982af4 docs: add reusable monitoring agent setup components (#49506)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Stack

Draft stack extracted from `docs/monitoring`. Merge bottom-up.
Troubleshooting / debugging-guide rewrite is out of scope.

1. #49503 move inspect and advisors
2. #49501 split Studio logs from ClickHouse queries
3. #49500 treat reports as signal dashboards
4. #49502 add Observe the data hub
5. **#49506** add agent setup components ← **this PR**
6. #49504 add hire-an-agent templates
7. #49505 restructure observability nav and overview

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Docs app feature (MDX components + markdown export). Fifth layer in the
observability stack.

## What is the current behavior?

There is no shared way to render a monitoring agent prompt, schedule,
and Claude/Codex/Cursor setup instructions in both HTML and generated
markdown.

## What is the new behavior?

- `AgentSetup` and `AgentWatchSchedule` MDX components, registered for
HTML and markdown export
- Shared `monitoring-agents` data (cadence, prompt ids, harness steps)
- Opt-in `AiPrompt` markdown export (`includeInMarkdown`) so quickstarts
stay HTML-only
- Optional content-listing `subtitle` for schedule labels on cards

No agent guide pages yet — those land in #49504 so this PR stays a
reviewable code change.

## Additional context

Markdown schema handlers share the same data module as the React
components.
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-a3cb5ece-925b-4046-b58a-5d69e9a9d794?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-a3cb5ece-925b-4046-b58a-5d69e9a9d794&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Saxon Fletcher <SaxonF@users.noreply.github.com>
2026-09-04 13:38:37 +10:00

56 lines
1.7 KiB
JavaScript

import { z } from 'zod'
const contentListingIconKindSchema = z.enum([
'braces',
'otlp',
'datadog',
'grafana',
'cloud',
'sentry',
'axiom',
'last9',
'server',
])
const contentListingIconChipSchema = z.object({
kind: contentListingIconKindSchema,
color: z.string().min(1),
bg: z.string().min(1),
})
export const contentListingIconSchema = z.union([z.string().min(1), contentListingIconChipSchema])
export const contentListingItemSchema = z.object({
title: z.string().min(1),
href: z.string().min(1),
description: z.string().min(1),
/** Shown under the title on grid cards, before the description. */
subtitle: z.string().min(1).optional(),
icon: contentListingIconSchema.optional(),
hasLightIcon: z.boolean().optional(),
badge: z.string().min(1).optional(),
/** Grid cards only. Defaults to inline (next to the title), matching existing usage. */
badgePosition: z.enum(['inline', 'below']).optional(),
/**
* When set, the item is omitted unless `isFeatureEnabled(feature)` is true.
* Use for SDK- or product-gated links (e.g. `sdk:dart`) inside a shared listing.
*/
feature: z.string().min(1).optional(),
})
export const contentListingGroupTypeSchema = z.enum(['list', 'grid'])
export const contentListingGridColumnsSchema = z.union([z.literal(2), z.literal(3), z.literal(4)])
export const contentListingHeadingLevelSchema = z.enum(['h2', 'h3', 'h4'])
export const contentListingGroupSchema = z.object({
id: z.string().min(1),
heading: z.string().min(1).optional(),
headingLevel: contentListingHeadingLevelSchema.optional(),
description: z.string().optional(),
type: contentListingGroupTypeSchema.optional(),
columns: contentListingGridColumnsSchema.optional(),
items: z.array(contentListingItemSchema).min(1),
})