{"_id":"@10up/relay-schemas","_rev":"4-352559747f07084e81be0a04fe0de09a","name":"@10up/relay-schemas","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@10up/relay-schemas","version":"0.1.0","license":"MIT","_id":"@10up/relay-schemas@0.1.0","maintainers":[{"name":"fabiankaegy","email":"mail@fabian-kaegy.de"},{"name":"eugene-manuilov","email":"eugene.manuilov@gmail.com"},{"name":"christianc1","email":"christian.m.chung@gmail.com"},{"name":"nicholasio","email":"nicholasio.oliveira@gmail.com"},{"name":"joesnellpdx","email":"joesnellpdx@gmail.com"},{"name":"devinle","email":"devin.leggett@gmail.com"},{"name":"darylldoyle","email":"daryll.doyle@10up.com"}],"homepage":"https://github.com/10up/relay-utilities#readme","bugs":{"url":"https://github.com/10up/relay-utilities/issues"},"dist":{"shasum":"50caa5cd85cf1235f7d24debcad6cc45f47938d6","tarball":"https://registry.npmjs.org/@10up/relay-schemas/-/relay-schemas-0.1.0.tgz","fileCount":8,"integrity":"sha512-CGNnZnxYbrA/nER6zwE6NXqIqbVWWDifM6KTK1n0RwhUMlQpUmqOGjA6pzW8scceXRj6U6JpLxhDY+HrPzG3aA==","signatures":[{"sig":"MEQCIAg83Dnn4pwc2RBxg8xjrGr19CJt+4ZH0zcnI8QZaV5TAiAUN20lC4xUfjtWawQzClNIqONkJZ43r6nWsUhhIShuBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15385},"main":"index.mjs","type":"module","types":"index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs"},"./schemas/*.json":"./schemas/*.json"},"gitHead":"bc66a6866f3f90d787370c03ee6028eb1e0811aa","_npmUser":{"name":"christianc1","email":"christian.m.chung@gmail.com"},"repository":{"url":"git+https://github.com/10up/relay-utilities.git","type":"git","directory":"packages/relay-schemas"},"_npmVersion":"11.9.0","description":"Shared JSON Schemas for Relay content (PRD, notebook, path allowlist) consumed by the Relay Cloud MCP server and Relay utilities","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/relay-schemas_0.1.0_1778001587253_0.31952051955418836","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@10up/relay-schemas","version":"0.1.1","license":"MIT","_id":"@10up/relay-schemas@0.1.1","maintainers":[{"name":"fabiankaegy","email":"mail@fabian-kaegy.de"},{"name":"eugene-manuilov","email":"eugene.manuilov@gmail.com"},{"name":"christianc1","email":"christian.m.chung@gmail.com"},{"name":"nicholasio","email":"nicholasio.oliveira@gmail.com"},{"name":"joesnellpdx","email":"joesnellpdx@gmail.com"},{"name":"devinle","email":"devin.leggett@gmail.com"},{"name":"darylldoyle","email":"daryll.doyle@10up.com"}],"homepage":"https://github.com/10up/relay-utilities#readme","bugs":{"url":"https://github.com/10up/relay-utilities/issues"},"dist":{"shasum":"656323b448d69a879760cdc379415014f9e9c2de","tarball":"https://registry.npmjs.org/@10up/relay-schemas/-/relay-schemas-0.1.1.tgz","fileCount":8,"integrity":"sha512-VNFmPS3FVV2so0d5L0Tg0l+pyqljT7iHe9CxAjEmpnaKUX4tOguEYB2XxxO50OhatNqcca4S66hulvoYjIOu/w==","signatures":[{"sig":"MEQCIFV9HtU1DobfkjmFnEzH2WRjbijKPCOVx0GeFSTsWli0AiAnM893wu54rfhCql721lhLp4kTJg+BOHhDPnGPoww0Cg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15761},"main":"index.mjs","type":"module","types":"index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs"},"./schemas/*.json":"./schemas/*.json"},"gitHead":"2d34c423bfd9690c91980cce358a37e406538a81","_npmUser":{"name":"christianc1","email":"christian.m.chung@gmail.com"},"repository":{"url":"git+https://github.com/10up/relay-utilities.git","type":"git","directory":"packages/relay-schemas"},"_npmVersion":"11.9.0","description":"Shared JSON Schemas for Relay content (PRD, notebook, path allowlist) consumed by the Relay Cloud MCP server and Relay utilities","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/relay-schemas_0.1.1_1778004320357_0.4203103584159469","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@10up/relay-schemas","version":"0.4.0","license":"MIT","_id":"@10up/relay-schemas@0.4.0","maintainers":[{"name":"fabiankaegy","email":"mail@fabian-kaegy.de"},{"name":"eugene-manuilov","email":"eugene.manuilov@gmail.com"},{"name":"christianc1","email":"christian.m.chung@gmail.com"},{"name":"nicholasio","email":"nicholasio.oliveira@gmail.com"},{"name":"joesnellpdx","email":"joesnellpdx@gmail.com"},{"name":"devinle","email":"devin.leggett@gmail.com"},{"name":"darylldoyle","email":"daryll.doyle@10up.com"}],"homepage":"https://github.com/10up/relay-utilities#readme","bugs":{"url":"https://github.com/10up/relay-utilities/issues"},"dist":{"shasum":"3a37ae7d54395752b56dffad967bb635c361c4e5","tarball":"https://registry.npmjs.org/@10up/relay-schemas/-/relay-schemas-0.4.0.tgz","fileCount":10,"integrity":"sha512-XCT2dVs3GKOr27g4U6N9lcQnMqlG+TKYKpL4tfKv8nShhM8f+Y7KF/cJVUZwmbT5sI0fztnP9eGSF+w9KqOa2A==","signatures":[{"sig":"MEQCIC2v04EIsaB4IVk/ywp5dLhLpZIP/11VvMCRVixITOPmAiA+DCILf/KyuO33f9WgFG7zlClDyU7cGFk1ulkB06NQzQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24843},"main":"index.mjs","type":"module","types":"index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs"},"./schemas/*.json":"./schemas/*.json"},"gitHead":"a1d1e75aa03b9be3e934844affc5c1511be1dfd5","_npmUser":{"name":"christianc1","email":"christian.m.chung@gmail.com"},"repository":{"url":"git+https://github.com/10up/relay-utilities.git","type":"git","directory":"packages/relay-schemas"},"_npmVersion":"11.9.0","description":"Shared JSON Schemas for Relay content (PRD, notebook, document, asset, path allowlist) consumed by the Relay Cloud MCP server and Relay utilities","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.20.0","ajv-formats":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/relay-schemas_0.4.0_1782418302680_0.7117524598577138","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-05T17:19:47.190Z","modified":"2026-08-21T19:39:00.697Z","0.1.0":"2026-05-05T17:19:47.419Z","0.1.1":"2026-05-05T18:05:20.495Z","0.4.0":"2026-06-25T20:11:42.833Z"},"bugs":{"url":"https://github.com/10up/relay-utilities/issues"},"license":"MIT","homepage":"https://github.com/10up/relay-utilities#readme","repository":{"url":"git+https://github.com/10up/relay-utilities.git","type":"git","directory":"packages/relay-schemas"},"description":"Shared JSON Schemas for Relay content (PRD, notebook, document, asset, path allowlist) consumed by the Relay Cloud MCP server and Relay utilities","maintainers":[{"email":"mail@fabian-kaegy.de","name":"fabiankaegy"},{"email":"eugene.manuilov@gmail.com","name":"eugene-manuilov"},{"email":"christian.m.chung@gmail.com","name":"christianc1"},{"email":"nicholasio.oliveira@gmail.com","name":"nicholasio"},{"email":"joesnellpdx@gmail.com","name":"joesnellpdx"},{"email":"devin.leggett@gmail.com","name":"devinle"},{"email":"daryll.doyle@10up.com","name":"darylldoyle"},{"email":"jeffpaul@hotmail.com","name":"jeffpaul"}],"readme":"# @10up/relay-schemas\n\nShared JSON Schemas for content stored in [Relay](https://github.com/10up). This package is the single source of truth for the frontmatter shapes and path-allowlist policy validated by the Relay Cloud MCP server and the Relay client utilities.\n\nZero runtime dependencies. Pure ESM.\n\n## Install\n\n```bash\nnpm install @10up/relay-schemas\n```\n\n## What's in the box\n\n| Export                                | Description                                                                      |\n| ------------------------------------- | -------------------------------------------------------------------------------- |\n| `notebookSchema`                      | JSON Schema for notebook frontmatter (agenda, status report, retro, etc.)        |\n| `prdSchema`                           | JSON Schema for PRD frontmatter (status, domain, epic, version)                  |\n| `documentWriteSchema`                 | JSON Schema for the Relay Document write-input contract (Claude-authored HTML)   |\n| `pathAllowlistSchema`                 | JSON Schema describing the shape of a path-allowlist policy                      |\n| `defaultPathPolicy`                   | Sensible default policy values (allow/deny globs, size limits, secret patterns)  |\n| `DOCUMENT_KINDS`                      | Frozen array of document kinds (`status-report`, `dashboard`, `allocation`, …)   |\n| `DOCUMENT_VISIBILITIES`               | Frozen array of document visibilities (`private`, `shared`)                      |\n| `DOCUMENT_STATUSES`                   | Frozen array of document statuses (`draft`, `published`)                         |\n| `documentSlugPattern`                 | `RegExp` for the document slug rule (lowercase alphanumeric + hyphens)           |\n| `isValidDocumentSlug(slug)`           | Returns `true` if `slug` is 3+ chars and matches the document slug rule          |\n| `resolveSchemaForPath(path, policy?)` | Returns the schema id (`prd.json` / `notebook.json`) for a given path, or `null` |\n| `isAllowedPath(path, policy?)`        | Returns `true` if `path` is allowed and not denied                               |\n| `matchGlob(pattern, value)`           | Minimal glob matcher supporting `?`, `*`, `**`                                   |\n\nYou can also import individual schema documents:\n\n```js\nimport notebookSchema from \"@10up/relay-schemas/schemas/notebook.json\" with { type: \"json\" }\n```\n\n## Quick example\n\n```js\nimport { notebookSchema, defaultPathPolicy, isAllowedPath } from \"@10up/relay-schemas\"\n\n// Path policy\nisAllowedPath(\"notebooks/agendas/2026-05-05.md\") // → true\nisAllowedPath(\"scripts/ci.sh\") // → false (not in allow)\nisAllowedPath(\"anything/.env\") // → false (deny wins)\n\n// Validate frontmatter against the notebook schema with your validator of choice.\n// AJV example:\nimport Ajv from \"ajv\"\nimport addFormats from \"ajv-formats\"\n\nconst ajv = addFormats(new Ajv({ strict: false }))\nconst validate = ajv.compile(notebookSchema)\n\nconst ok = validate({\n  title: \"Standup 2026-05-05\",\n  kind: \"agenda\",\n  created: \"2026-05-05T09:30:00Z\",\n})\nconsole.log(ok, validate.errors)\n```\n\nThe schemas use the JSON Schema draft 2020-12 vocabulary. Any compliant validator works (AJV, hyperjump, jsonschema, etc.). This package does not bundle a validator.\n\n## Default path policy\n\n`defaultPathPolicy` ships:\n\n- **allow**: `requirements/**/*.md`, `requirements/**/*.prd.md`, `notebooks/**/*.md`, `research/**/*.md`\n- **deny**: `**/.git/**`, `**/node_modules/**`, `**/.env*`, `**/secrets/**`, `**/*.key`, `**/*.pem`\n- **schema mapping**: `**/*.prd.md` → `prd.json`, `notebooks/**/*.md` → `notebook.json`\n- **limits**: `maxFileBytes` 200 KB, `maxBatchBytes` 1 MB, `maxBatchFiles` 20\n- **secretPatterns**: AWS access keys, Google API keys, OpenAI keys, GitHub tokens, Slack tokens, PEM-format private keys\n\nYou can pass your own policy as the second argument to `resolveSchemaForPath` / `isAllowedPath` — it must conform to `pathAllowlistSchema`.\n\n## Relay Documents\n\n`documentWriteSchema` is the canonical input contract for Claude-authored, Fueled-branded **HTML documents** (status reports, dashboards, allocation reports, QBRs) that Relay Cloud serves directly. These are deliberately separate from the markdown content store and the VitePress build pipeline — the `content` field carries only the HTML body, and the serving route supplies the brand shell. Documents are upserted by `(project, slug)`.\n\n```js\nimport { documentWriteSchema, DOCUMENT_KINDS, isValidDocumentSlug } from \"@10up/relay-schemas\"\n\nDOCUMENT_KINDS // [\"status-report\", \"dashboard\", \"allocation\", \"qbr\", \"generic\"]\nisValidDocumentSlug(\"client-status-2026-06-03\") // → true\nisValidDocumentSlug(\"Bad Slug\") // → false\n```\n\nBecause these schemas use the draft 2020-12 vocabulary, compile them with AJV's 2020 entry point: `import Ajv from \"ajv/dist/2020\"`.\n\n## Versioning\n\nPre-1.0. Expect breaking changes between minor versions until 1.0.0. Schemas evolve as Relay's content model evolves; consumers should pin a known-good version.\n\n## License\n\n[MIT](./LICENSE) © 10up Inc.\n","readmeFilename":"README.md"}