Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

837 B
Raw Blame
/**
 * Rotation attribution snapshots — service boundary for the per-account
 * rotation state recorded by rotation executors.
 *
 * Lives in services (not executors/) so loopback-gated read routes can consume
 * snapshots without importing executor implementations (boundary rule: App
 * routes must delegate through handlers or services). The store itself is a
 * synchronous in-memory map — no I/O, reads without side effects.
 */
import {
  type RotationAccountSnapshot,
  readRotationSnapshot as readExecutorSnapshot,
} from "../executors/accountRotation.ts";

export type { RotationAccountSnapshot };

/** Read the last recorded rotation state (no side effects — never clears). */
export function readRotationSnapshot(connectionKey: string): RotationAccountSnapshot[] | null {
  return readExecutorSnapshot(connectionKey);
}