Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.9 KiB
1.9 KiB
@suaveplan/events-schema - Runtime schema-validation companion for @suaveplan/events: validates event payloads at dispatch boundaries via Zod schemas with strict/warn/sample modes and sensitive field redaction.
Summary
Runtime schema-validation companion for @suaveplan/events. Validates event payloads at dispatch boundaries via Zod schemas with strict/warn/sample modes and sensitive field redaction.
Documentation tree
- attach-event-schemas — (no submodules)
- attach-event-schemas — (no submodules)
Quick Start
import { EventBus } from "@suaveplan/events";
import { attachEventSchemas } from "@suaveplan/events-schema";
import z from "zod";
const bus = new EventBus();
const handle = attachEventSchemas(bus, { mode: "strict" });
handle.registerSchema("user.created", z.object({ id: z.string() }));
await bus.emitAsync("user.created", { id: "u-1" }); // passes
await bus.emitAsync("user.created", { id: 123 }); // throws EventsSchemaError
handle.detach();
Modules
src/core/attach-event-schemas/attach-event-schemas—attachEventSchemas,registerEventSchema,EventSchemasHandle