-
-
Notifications
You must be signed in to change notification settings - Fork 1
docs: Add schema browser and why page #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,4 +24,7 @@ yarn-error.log* | |
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
| next-env.d.ts | ||
|
|
||
| # local demo backups | ||
| .demo-backups/ | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| "use client" | ||
|
|
||
| import { useMemo, useState } from "react" | ||
| import { Icons } from "./icons" | ||
| import { publishedSchemas } from "../_data/generated/schemas" | ||
|
|
||
| const latestVersionOption = "latest" | ||
|
|
||
| export function SchemaExplorer() { | ||
| const [query, setQuery] = useState("") | ||
| const [selectedVersion, setSelectedVersion] = useState(latestVersionOption) | ||
|
|
||
| const versionOptions = useMemo(() => { | ||
| const versions = new Set<string>() | ||
|
|
||
| for (const schema of publishedSchemas) { | ||
| for (const version of schema.versions) { | ||
| versions.add(version) | ||
| } | ||
| } | ||
|
|
||
| return Array.from(versions).sort((left, right) => Number(right) - Number(left)) | ||
| }, []) | ||
|
|
||
| const filteredSchemas = useMemo(() => { | ||
| const normalizedQuery = query.trim().toLowerCase() | ||
|
|
||
| return publishedSchemas.filter((schema) => { | ||
| const matchesQuery = normalizedQuery | ||
| ? schema.name.toLowerCase().includes(normalizedQuery) | ||
| : true | ||
| const hasSelectedVersion = | ||
| selectedVersion === latestVersionOption || schema.versions.includes(selectedVersion) | ||
|
|
||
| return matchesQuery && hasSelectedVersion | ||
| }) | ||
| }, [query, selectedVersion]) | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="tools-controls"> | ||
| <div className="search-wrap"> | ||
| <div className="si"> | ||
| <Icons.Search size={14} /> | ||
| </div> | ||
| <input | ||
| value={query} | ||
| onChange={(event) => setQuery(event.target.value)} | ||
| placeholder={`Filter ${publishedSchemas.length} schemas…`} | ||
| /> | ||
| </div> | ||
| <label className="schema-version"> | ||
| <span>Version</span> | ||
| <select | ||
| value={selectedVersion} | ||
| onChange={(event) => setSelectedVersion(event.target.value)} | ||
| > | ||
| <option value={latestVersionOption}>Latest</option> | ||
| {versionOptions.map((version) => ( | ||
| <option key={version} value={version}> | ||
| v{version} | ||
| </option> | ||
| ))} | ||
| </select> | ||
| </label> | ||
| </div> | ||
|
|
||
| <div className="tool-grid"> | ||
| {filteredSchemas.map((schema) => { | ||
| const resolvedVersion = | ||
| selectedVersion === latestVersionOption ? schema.latest : selectedVersion | ||
| const href = `/schemas/structured-output/${encodeURIComponent( | ||
| schema.name, | ||
| )}/${encodeURIComponent(resolvedVersion)}.schema.json` | ||
| const versionLabel = | ||
| selectedVersion === latestVersionOption | ||
| ? `latest · v${schema.latest}` | ||
| : `v${resolvedVersion}` | ||
|
|
||
| return ( | ||
| <a key={schema.name} className="tool-card schema-card" href={href}> | ||
| <div> | ||
| <div className="tc-name">{schema.name}</div> | ||
| <div className="tc-sub">{versionLabel}</div> | ||
| </div> | ||
| <span className="tc-badge">JSON schema</span> | ||
| </a> | ||
| ) | ||
| })} | ||
| {filteredSchemas.length === 0 ? ( | ||
| <div | ||
| style={{ | ||
| padding: "24px 14px", | ||
| color: "var(--fg-muted)", | ||
| textAlign: "center", | ||
| border: "1px dashed var(--border-primary)", | ||
| borderRadius: 6, | ||
| }} | ||
| > | ||
| No schemas match the current filter and version. | ||
| </div> | ||
| ) : null} | ||
| </div> | ||
| </> | ||
| ) | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { PageHeader } from "../_components/page-header" | ||
| import { SchemaExplorer } from "../_components/schema-explorer" | ||
|
|
||
| <PageHeader | ||
| breadcrumbs={["Docs", "Reference", "Schemas"]} | ||
| title="Published Schemas" | ||
| lede="Browse the structured-output JSON Schemas published with the website. Each schema family keeps old versions available at stable URLs." | ||
| /> | ||
|
|
||
| XcodeBuildMCP tool results include a `schema` identifier and a `schemaVersion` string. Use those fields together to choose the published schema that validates the `data` payload returned by CLI JSON output or MCP `structuredContent`. | ||
|
|
||
| Each link below points at the raw JSON Schema served from `/schemas/structured-output/...`. | ||
|
|
||
| <SchemaExplorer /> | ||
|
|
||
| ## URL format | ||
|
|
||
| ```text | ||
| https://xcodebuildmcp.com/schemas/structured-output/<schema>/<version>.schema.json | ||
| ``` | ||
|
|
||
| For example: | ||
|
|
||
| ```text | ||
| https://xcodebuildmcp.com/schemas/structured-output/xcodebuildmcp.output.build-result/2.schema.json | ||
| ``` | ||
|
|
||
| ## Related | ||
|
|
||
| - [Output Formats](/docs/output-formats), where structured output appears in CLI and MCP responses | ||
| - [Schema Versioning](/docs/schema-versioning), how schema changes are versioned and published | ||
| - [Tool Authoring](/docs/tool-authoring), how schemas fit into tool changes |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| export type PublishedSchema = { | ||
| name: string | ||
| versions: string[] | ||
| latest: string | ||
| } | ||
|
|
||
| export const publishedSchemas: PublishedSchema[] = [ | ||
| { name: "xcodebuildmcp.output.app-path", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.build-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.build-run-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.build-settings", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.bundle-id", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.capture-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.coverage-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.debug-breakpoint-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.debug-command-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.debug-session-action", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.debug-stack-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.debug-variables-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.device-list", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.doctor-report", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.error", versions: ["1"], latest: "1" }, | ||
| { name: "xcodebuildmcp.output.install-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.launch-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.process-list", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.project-list", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.scaffold-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.scheme-list", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.session-defaults", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.session-profile", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.simulator-action-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.simulator-list", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.stop-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.test-result", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.ui-action-result", versions: ["1", "2", "3"], latest: "3" }, | ||
| { name: "xcodebuildmcp.output.workflow-selection", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.xcode-bridge-call-result", versions: ["1", "2", "3"], latest: "3" }, | ||
| { name: "xcodebuildmcp.output.xcode-bridge-status", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.xcode-bridge-sync", versions: ["1", "2"], latest: "2" }, | ||
| { name: "xcodebuildmcp.output.xcode-bridge-tool-list", versions: ["1", "2", "3"], latest: "3" }, | ||
| ] |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.