black.ts 489 B

1234567891011121314151617181920
  1. import { z } from "zod"
  2. import { fn } from "./util/fn"
  3. import { Resource } from "@opencode-ai/console-resource"
  4. export namespace BlackData {
  5. const Schema = z.object({
  6. fixedLimit: z.number().int(),
  7. rollingLimit: z.number().int(),
  8. rollingWindow: z.number().int(),
  9. })
  10. export const validate = fn(Schema, (input) => {
  11. return input
  12. })
  13. export const get = fn(z.void(), () => {
  14. const json = JSON.parse(Resource.ZEN_BLACK.value)
  15. return Schema.parse(json)
  16. })
  17. }