char-slop/berry
multipurpose self-modifiable agentic harness
git clone https://git.t4t.associates/char-slop/berry
aa0b468
main
1import * as j from "@char/justin" ; 2 3export const providers = [ "anthropic" , "openai" , "openai-codex" , "opencode-go" ] as const ; 4export type Provider = ( typeof providers )[ number ]; 5 6export const providerNames :Record < Provider , string > = { 7anthropic :"Claude" , 8openai :"ChatGPT / Codex" , 9"openai-codex" :"ChatGPT / Codex" , 10"opencode-go" :"OpenCode Go" , 11}; 12 13const window = j . obj ({ 14label :j . string , 15usedPercent :j . number , 16resetsAt :j . union ( j . string , j . null ), 17}); 18export type UsageWindow = j . Infer < typeof window >; 19 20export const usageSchema = j . union ( 21j . obj ({ status :j . literal ( "ok" ), fetchedAt :j . string , windows :j . array ( window ) }), 22j . obj ({ status :j . union ( j . literal ( "unavailable" ), j . literal ( "error" )), message :j . string }), 23); 24export type SubscriptionUsage = j . Infer < typeof usageSchema >; 25 26export function isProvider ( value :string ) :value isProvider { 27return ( providers as readonly string []). includes ( value ); 28}