feat(runtime)!: relay SDK AgentEvent + declarative relay persona field (Stage 1, A, B, C-runtime)
The workforce half of "single personas participate in relay." Four stacked commits:
Stage 1 — envelope→AgentEvent mapper (e33023d)
envelopeToAgentEvent(): pure RawGatewayEnvelope → @agent-relay/events AgentEvent, covering every type cloud delivers (cron, startup, provider, relaycast.message, user_reply). Corrects the stale "not yet published" shim comments.
Unit A — declarative relay persona field (dab249d)
PersonaRelay/PersonaRelayConfig + relay? on PersonaSpec; resolvePersonaRelayMcp() bridges the declaration + env into the existing relaycast MCP injection. Forward-compatible with cloud (permissive schema; cloud treats persona as pass-through).
Unit B — relay coords on RawGatewayEnvelope (8bfd374)
Adds channel/messageId/threadId (+ re-syncs the drifted harnessSession) to the contract copy + mapper. Pairs with cloud#2034.
Unit C-runtime — dispatch the SDK AgentEvent (3b17937) — BREAKING (v4)
Handler event is now the relay SDK AgentEvent (not { source, type, payload }). define-agent narrowing rebuilt on event.type — turning the formerly silent event.type suffix mismatches into compile errors. WorkforceCtx unchanged.
Verification
86 runtime + 276 persona-kit tests pass.
Merge order
cloud#2034 → this (publishes v4) → agents codemod + proactive-agents (linked separately). Personas codemod: AgentWorkforce/agents feat/relay-runtime-v4.
Fresh-inbound relay→deployment delivery is tracked in cloud#2031.
🤖 Generated with Claude Code