|
| 1 | +// §7.1.6 — the API's self-description. One place defines "what state is v1 in", consumed by |
| 2 | +// /api/v1/status.json AND stamped into every envelope (schema_revision) so a bot can detect a |
| 3 | +// change from any response. This is how a bot already polling us learns the API evolved |
| 4 | +// (e.g. pagination arrived) WITHOUT breaking. |
| 5 | + |
| 6 | +export const API_VERSION = 'v1'; |
| 7 | + |
| 8 | +// Bump the DATE whenever the response shape changes in any way (always additively — see |
| 9 | +// STABILITY). A bot keeps the last value it saw; a newer one means "re-read status.json". |
| 10 | +export const SCHEMA_REVISION = '2026-08-22'; |
| 11 | + |
| 12 | +// Feature flags a bot can branch on instead of hard-coding assumptions. When pagination |
| 13 | +// ships, `pagination` flips to true and the feed starts returning a `next` cursor — a bot |
| 14 | +// that already follows `next` when present (see the routine prompt) adapts with no change. |
| 15 | +export const CAPABILITIES = { |
| 16 | + feed: true, // /api/v1/feed.json — complete lean list |
| 17 | + detail_endpoints: true, // /api/v1/{use-cases,plugins,collections}/<slug>.json |
| 18 | + cursor_field: 'added_at', // sort + incremental cursor across list endpoints |
| 19 | + pagination: false, // when true, list endpoints return a `next` cursor to follow |
| 20 | + rss: true, |
| 21 | + mcp: true, |
| 22 | +}; |
| 23 | + |
| 24 | +// The promise a consumer can rely on. Kept short and machine-readable-ish on purpose. |
| 25 | +export const STABILITY = |
| 26 | + 'v1 is additive-only: new fields and endpoints may appear, but existing fields are never ' + |
| 27 | + 'removed, renamed, or repurposed within v1. Consumers MUST ignore fields they do not ' + |
| 28 | + 'recognize, and SHOULD follow a `next` cursor if a response includes one (that is how ' + |
| 29 | + 'pagination will arrive). Any breaking change ships at /api/v2/ and is announced here as a ' + |
| 30 | + 'deprecation with a sunset date at least 90 days out before v1 changes behavior.'; |
| 31 | + |
| 32 | +// Active announcements a bot should surface to its human (empty = nothing going on). Shape: |
| 33 | +// { id, level: 'info' | 'warn', date, message, action_url? }. |
| 34 | +export const NOTICES: Array<{ |
| 35 | + id: string; |
| 36 | + level: 'info' | 'warn'; |
| 37 | + date: string; |
| 38 | + message: string; |
| 39 | + action_url?: string; |
| 40 | +}> = []; |
| 41 | + |
| 42 | +// Endpoints on a sunset path (empty now). Shape: |
| 43 | +// { endpoint, since, sunset, replacement }. |
| 44 | +export const DEPRECATIONS: Array<{ |
| 45 | + endpoint: string; |
| 46 | + since: string; |
| 47 | + sunset: string; |
| 48 | + replacement: string; |
| 49 | +}> = []; |
| 50 | + |
| 51 | +// Human + machine readable history, newest first. A bot can diff this against what it saw. |
| 52 | +export const CHANGELOG = [ |
| 53 | + { |
| 54 | + date: '2026-08-22', |
| 55 | + change: |
| 56 | + 'Added feed.json (complete lean list) and per-entry detail endpoints ' + |
| 57 | + '(/api/v1/{use-cases,plugins,collections}/<slug>.json, linked as each item’s detail_url). ' + |
| 58 | + 'feed.json is now the recommended entry point.', |
| 59 | + }, |
| 60 | + { |
| 61 | + date: '2026-07-01', |
| 62 | + change: |
| 63 | + 'v1 launched: index, latest, plugins, use-cases, collections, categories, integrations, ' + |
| 64 | + 'plus RSS and the MCP host.', |
| 65 | + }, |
| 66 | +]; |
0 commit comments