Skip to content

Commit 9355bac

Browse files
kylemclarenclaude
andcommitted
Use dynamic category titles and update descriptions to match live site
- Remove hardcoded category title mapping, use simple title-casing from schema - Update category descriptions to match sprites.dev/api documentation Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent d252013 commit 9355bac

File tree

1 file changed

+16
-27
lines changed

1 file changed

+16
-27
lines changed

scripts/generate-api-docs.ts

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -837,22 +837,7 @@ ${streamingEventsDocs}
837837
}
838838

839839
function getCategoryTitle(category: string): string {
840-
const titles: Record<string, string> = {
841-
sprites: 'Sprites',
842-
exec: 'Exec',
843-
checkpoints: 'Checkpoints',
844-
services: 'Services',
845-
proxy: 'HTTP Proxy',
846-
policy: 'Policy',
847-
organization: 'Organization',
848-
tokens: 'Tokens',
849-
files: 'Files',
850-
filesystem: 'Filesystem',
851-
attach: 'Attach',
852-
};
853-
return (
854-
titles[category] || category.charAt(0).toUpperCase() + category.slice(1)
855-
);
840+
return category.charAt(0).toUpperCase() + category.slice(1);
856841
}
857842

858843
// Manual pages that are not generated from schema but should be included
@@ -885,17 +870,21 @@ const MANUAL_PAGES: ManualPage[] = [
885870

886871
function getCategoryDescription(category: string): string {
887872
const descriptions: Record<string, string> = {
888-
sprites: 'Create, list, update, and delete Sprites',
889-
exec: 'Execute commands in Sprites via WebSocket',
890-
checkpoints: 'Create, list, and restore environment snapshots',
891-
services: 'Manage background services running in Sprites',
892-
proxy: 'Forward HTTP requests to services inside Sprites',
893-
policy: 'Manage access control policies',
894-
organization: 'Organization settings and information',
895-
tokens: 'Create and manage API tokens',
896-
files: 'Upload and download files',
897-
filesystem: 'Browse and manage the filesystem',
898-
attach: 'Interactive terminal sessions via WebSocket',
873+
sprites:
874+
'Sprites are persistent environments that hibernate when idle and wake automatically on demand. You only pay for compute while actively using them—storage persists indefinitely.',
875+
exec: 'Run commands inside Sprites over WebSocket connections. The exec API is designed for both one-shot commands and long-running interactive sessions.\n\nSessions persist across disconnections—start a dev server or build, disconnect, and reconnect later to resume streaming output. A binary protocol efficiently multiplexes stdin, stdout, and stderr over a single connection.',
876+
checkpoints:
877+
"Checkpoints capture your Sprite's complete filesystem state for instant rollback. They're live snapshots—creation takes milliseconds with no interruption to running processes.\n\nUse checkpoints before risky operations, to create reproducible environments, or to share known-good states across a team. Copy-on-write storage keeps incremental checkpoints small; you only store what changed.",
878+
services: 'Manage background services running in your Sprite environment.',
879+
proxy:
880+
'Tunnel TCP connections directly to services running inside your Sprite. After a brief WebSocket handshake, the connection becomes a transparent relay to any port.\n\nUse this to access dev servers, databases, or any TCP service as if it were running locally. The proxy handles connection setup; your client speaks directly to the target service.',
881+
policy:
882+
'Control outbound network access using DNS-based filtering. Policies define which domains sprites can reach, with support for exact matches, wildcard subdomains, and preset rule bundles.\n\nChanges apply immediately—existing connections to newly-blocked domains are terminated. Failed DNS lookups return REFUSED for fast failure.',
883+
organization: 'Organization settings and information.',
884+
tokens: 'Create and manage API tokens.',
885+
files: 'Upload and download files.',
886+
filesystem: 'Browse and manage the filesystem.',
887+
attach: 'Interactive terminal sessions via WebSocket.',
899888
};
900889
return (
901890
descriptions[category] || `${getCategoryTitle(category)} API endpoints`

0 commit comments

Comments
 (0)