@nexural/schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # @nexural/schema
2
+
3
+ ## 0.1.0
4
+
5
+ ### Initial release
6
+
7
+ - Primitives: `Iso8601`, `IsoDate`, `Ulid`, `KebabSlug`, `TrustTier`, `WarehouseStatus`, `SchemaVersion`, `SemverString`, `RepoUrl`, `Email`, `DecayDays`, `Federation`, `GitSha`, `Sha256Hex`, `OpUri`, `EnvVarName`, `UsdAmount`, `PositiveUsdAmount`
8
+ - Core schemas: `WarehouseMeta`, `ContentFrontmatter`, `WarehouseIndex`, `McpToolRequest`, `McpToolResponse`, `ScorecardReport`, `Registry`, `CrossRefReport`, `DecayConfig`, `AdrFrontmatter`
9
+ - Telemetry: `BaseEvent`, `ToolCallEvent`, `NxCommandEvent`, `DecayWarnEvent`, `AuditEvent`, `CostEvent`, `TelemetryEvent`
10
+ - Recipe family (per ADRs 0002, 0004, 0006, 0007, 0008, 0009): `RecipeManifest`, `ForgedLockfile`, `CostEnvelope`, `ServiceDeclaration`
11
+ - External MCP (per ADR-0005): `ExternalMcpEndpoint`, `ExternalMcpRegistry`
12
+ - Model router (per ADR-0007): `ModelFamilyResolution`, `ModelFamilyRegistry`
13
+ - Revocation (per ADR-0009): `RevokedRecipeEntry`, `RevokedRecipesList`
14
+ - Errors: `NexuralError`, `NexuralErrorCode`
15
+ - JSON Schema export of all 21 schemas to `dist/json-schema/`
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @nexural/schema
2
+
3
+ **Canonical Zod schemas for the Nexural Federation.**
4
+
5
+ Single source of truth for every shape that crosses a warehouse boundary. Imported by every other `@nexural/*` package, every warehouse MCP server, every recipe, every forged app.
6
+
7
+ ## Modules
8
+
9
+ | Module | Schemas | Source ADR(s) |
10
+ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
11
+ | `primitives` | `Iso8601`, `IsoDate`, `Ulid`, `KebabSlug`, `TrustTier`, `WarehouseStatus`, `SchemaVersion`, `SemverString`, `RepoUrl`, `Email`, `DecayDays`, `Federation` | core |
12
+ | `meta` | `WarehouseMeta` | core + ADR-0003 |
13
+ | `frontmatter` | `ContentFrontmatter` | core |
14
+ | `index-file` | `WarehouseIndex` | core |
15
+ | `mcp` | `McpToolRequest`, `McpToolResponse` | core + ADR-0008 |
16
+ | `telemetry` | `BaseEvent`, `ToolCallEvent`, `NxCommandEvent`, `DecayWarnEvent`, `AuditEvent`, `CostEvent`, `TelemetryEvent` | core + ADR-0007 |
17
+ | `scorecard` | `ScorecardReport` | core |
18
+ | `registry` | `Registry` | core + ADR-0003 |
19
+ | `cross-refs` | `CrossRefReport` | core |
20
+ | `decay` | `DecayConfig` | core |
21
+ | `adr` | `AdrFrontmatter` | core |
22
+ | `recipe` | `RecipeManifest`, `ForgedLockfile`, `CostEnvelope`, `ServiceDeclaration` | ADR-0002, 0004, 0006, 0007, 0008, 0009 |
23
+ | `external-mcp` | `ExternalMcpEndpoint`, `ExternalMcpRegistry` | ADR-0005 |
24
+ | `model-router` | `ModelFamilyResolution`, `ModelFamilyRegistry` | ADR-0007 |
25
+ | `revocation` | `RevokedRecipeEntry`, `RevokedRecipesList` | ADR-0009 |
26
+ | `errors` | typed error shapes | core |
27
+
28
+ See `docs/SCHEMA_CHARTER.md` and `docs/SCHEMA_AMENDMENTS.md` for the canonical reference.
29
+
30
+ ## Usage
31
+
32
+ ```ts
33
+ import { WarehouseMeta, RecipeManifest } from "@nexural/schema";
34
+
35
+ const parsed = WarehouseMeta.parse(yaml.load(metaContent));
36
+ ```
37
+
38
+ ## JSON Schema exports
39
+
40
+ `pnpm build` generates JSON Schema files under `dist/json-schema/` for external tooling (yaml-language-server, IDE intellisense):
41
+
42
+ ```yaml
43
+ # yaml-language-server: $schema=https://unpkg.com/@nexural/schema@1/dist/json-schema/warehouse-meta.json
44
+ ```
45
+
46
+ ## Versioning
47
+
48
+ Strict semver per SCHEMA_CHARTER §5. Breaking changes follow §6 (30-day soak + migration codemod).
49
+
50
+ ## License
51
+
52
+ MIT.