# M141-2 step 3 — per-event payload schemas

Stacks on step 1 (#1867 merged). 13 of 19 events now have typed payload schemas emitted from the YAML spec. Click an event to inspect its payload JSON Schema.

## 19 events

13 covered 6 envelope-only

## Payload schema — PreToolUse

## What this PR adds

- Switched codegen YAML parser from inline to `js-yaml` — spec can now nest `payload.required` + `payload.optional` blocks
- Emitted `PayloadMap` interface + `PayloadFor<E>` type alias for typed-payload consumers
- Emitted `PAYLOAD_SCHEMAS` data constant in schemas.ts — keyed by event name, used by envelopeSchema() to nest payload properties + required arrays
- 43 new vitest cases in `tests/payloads.test.ts` — covers properties block presence, envelope-only fallback, field-level structural checks, and the invariant that required ⊆ properties for every event

## What's still deferred (steps 2 + 4)

- Step 2: PyPI sibling `orchestkit-hook-contract` — same spec, Pydantic models, JSON Schema mirrors
- Step 4: Cross-language parity gate CI — fails when npm and PyPI emit diverge on any event's field set
- The 6 uncovered events (SessionEnd, Setup, InstructionsLoaded, WorktreeCreate, WorktreeRemove, ConfigChange) — their CC-level payload shapes aren't documented enough to lock down yet