AI Agent Skill & OpenAPI v4
Yearning v4 ships a complete OpenAPI 3 specification (api/openapi/yearning-v4.yaml), a realtime SSE event bus (GET /api/v4/events/stream), and a zero-dependency yearning Agent Skill (skills/yearning/).
AI coding assistants (Claude Code, Codex CLI, Cursor, Antigravity) integrate directly with /api/v4/* under full RBAC, double-submit CSRF, Idempotency-Key, If-Match, and Submission Gate enforcement without deploying a standalone MCP server.
Quick Commands (skills/yearning/scripts/yearning_api.py)
HTTP Protocol Contract
- Envelope:
{"err_code": 0, "message": "ok", "data": ...}. - Double-Submit CSRF: Include
X-CSRF-Token: <yearning_csrf>on everyPOST,PUT,PATCH, andDELETE. - Idempotency: Preserve
Idempotency-Key: <UUIDv4>across retries of mutating requests. - Optimistic Concurrency: Supply
If-Match: "<version>"on order decisions, withdrawals, execution attempts, schedules, and draft edits. - Audited SQL Reveal: Order metadata endpoints never inline plaintext SQL; call
POST /api/v4/change-orders/{id}/sql-revealsexplicitly. - Realtime SSE Stream: Subscribe to
GET /api/v4/events/stream(Accept: text/event-stream) for participant-scopedio.yearning.v4.*events.