Files
stanp-opencode/src/quota-rpc.ts
T
StanPonomarev b4ab44eb3c
CI / verify (pull_request) Successful in 9s
fix: remove cost estim
2026-09-16 20:30:22 +02:00

25 lines
609 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(),
});
export const QuotaRpc = Rpc.define({
id: "stanp-opencode.quota",
methods: {
status: {
input: z.object({}),
output: z
.object({ plan: z.string(), fetchedAt: z.number(), windows: z.array(window) })
.nullable(),
},
},
events: { updated: { schema: z.object({}) } },
});