Files
stanp-opencode/src/quota-rpc.ts
T
StanPonomarev f6c69c7db0
CI / verify (pull_request) Successful in 9s
feat: claude quotas
2026-10-07 14:49:00 +02:00

25 lines
633 B
TypeScript

import { Rpc } from "@opencode/plugin/rpc";
import { z } from "zod";
const window = z.object({
id: z.string(),
label: z.string().nullable(),
seconds: z.number(),
used: z.number(),
resetsAt: z.number(),
remaining: z.number(),
});
const status = z
.object({ plan: z.string(), fetchedAt: z.number(), windows: z.array(window) })
.nullable();
export const QuotaRpc = Rpc.define({
id: "stanp-opencode.quota",
methods: {
status: { input: z.object({}), output: status },
claude: { input: z.object({}), output: status },
},
events: { updated: { schema: z.object({}) } },
});