/** * The `budget` Remote wire vocabulary: the status/setSettings/unblock * payload types, their zod v4 validation schemas (the strict codecs both * Typert faces carry), and the invocation descriptors shared verbatim by the * host `./typert` manifest (`src/typert.host.ts`) and the client Remote * contribution (`src/client/remote.ts`). One canonical source keeps the two * codecs from ever drifting apart. * * @module dsh-budget/wire */ import { z } from 'zod'; /** The scopes a budget cap applies to. */ export declare const BUDGET_SCOPES: readonly ["session", "daily", "monthly"]; export type BudgetScope = (typeof BUDGET_SCOPES)[number]; /** One scope's usage line in the panel snapshot. */ export interface ScopeLine { scope: BudgetScope; /** Cap in USD; null = unlimited. */ capUsd: number | null; usedUsd: number; /** usedUsd / capUsd; 0 when unlimited. */ ratio: number; tokens: number; carbonKg: number; } /** One model's usage line (today), cost-sorted. */ export interface ModelLine { provider: string; model: string; inputTokens: number; outputTokens: number; costUsd: number; carbonKg: number; /** Latency percentiles over the kept window (ms). */ latency: { min: number | null; p50: number | null; p95: number | null; max: number | null; samples: number; }; /** `false` when the model is unpriced: costUsd is 0 and the cost is unknown. */ priced: boolean; } /** One recent threshold alert (newest first). */ export interface AlertLine { scope: BudgetScope; kind: 'warn' | 'over'; at: number; usedUsd: number; capUsd: number; } /** One day's usage in the per-day curve. */ export interface DayLine { /** UTC day key, `YYYY-MM-DD`. */ day: string; costUsd: number; tokens: number; carbonKg: number; } /** The full panel snapshot served by `budget/status`. */ export interface BudgetStatus { scopes: ScopeLine[]; models: ModelLine[]; alerts: AlertLine[]; blockedScopes: BudgetScope[]; currency: { code: string; rate: number; decimals: number; }; alertsEnabled: boolean; desktopNotifications: boolean; /** Degradation target for the current model, when a cap blocked it. */ degradedModel: string | null; /** Per-day usage over the last `historyDays` days, oldest first. */ days: DayLine[]; /** Warn ratio the host governance uses (0..1); the tab's bar tone follows it. */ warnRatio: number; /** Settings tab polling interval in ms (`config.refreshIntervalMs`). */ refreshIntervalMs: number; } /** Strict wire schema for {@link BudgetStatus} (zod v4, both Typert faces). */ export declare const BUDGET_STATUS_SCHEMA: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; /** Strict wire schema for the optional status session id. */ export declare const BUDGET_SESSION_ID_SCHEMA: z.ZodOptional; /** * The `budget/status` invocation descriptor, shared verbatim by the host * `TYPERT` manifest and the client `TypertRemoteContribution`. Hand-written * in the exact shape the Typert generator emits; validated by the typert * loader and the client registry at mount time. The optional `sessionId` * parameter matches `BudgetService.status(sessionId?)` and the client * `remote.budget.status(sessionId?)` — it attributes the snapshot to one * session and may be omitted (missing wire fields decode to `undefined`). */ export declare const BUDGET_STATUS_DESCRIPTOR: Readonly<{ readonly id: "dsh-budget#budget/status"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "status"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodOptional; mode: "strict"; typeSymbol: string; schema: z.ZodOptional; }>; acceptsUndefined: true; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }>; /** Strict wire schema for the runtime settings payload. */ export declare const BUDGET_SETTINGS_SCHEMA: z.ZodObject<{ sessionCapUsd: z.ZodNullable; dailyCapUsd: z.ZodNullable; monthlyCapUsd: z.ZodNullable; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; }, z.core.$strip>; /** * The `budget/setSettings` invocation descriptor: the panel edits the * runtime budget caps and alert switches (session-scoped runtime state, not * a config-file write — a reload restores the cordis.yml values). */ export declare const BUDGET_SET_SETTINGS_DESCRIPTOR: Readonly<{ readonly id: "dsh-budget#budget/setSettings"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "setSettings"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodString; mode: "strict"; typeSymbol: string; schema: z.ZodString; }>; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }>; /** Strict wire schema for the unblock request scope. */ export declare const BUDGET_UNBLOCK_SCOPE_SCHEMA: z.ZodEnum<{ session: "session"; daily: "daily"; monthly: "monthly"; }>; /** * The `budget/unblock` invocation descriptor: lift one blocked scope after * the user confirms (panel or `/budget unblock `). */ export declare const BUDGET_UNBLOCK_DESCRIPTOR: Readonly<{ readonly id: "dsh-budget#budget/unblock"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "unblock"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodEnum<{ session: "session"; daily: "daily"; monthly: "monthly"; }>; mode: "strict"; typeSymbol: string; schema: z.ZodEnum<{ session: "session"; daily: "daily"; monthly: "monthly"; }>; }>; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }>; /** * The canonical invocation list both Typert faces register — the host * manifest and the client contribution share these exact descriptor objects, * so the two wire codecs can never drift apart. */ export declare const BUDGET_INVOCATIONS: readonly (Readonly<{ readonly id: "dsh-budget#budget/status"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "status"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodOptional; mode: "strict"; typeSymbol: string; schema: z.ZodOptional; }>; acceptsUndefined: true; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }> | Readonly<{ readonly id: "dsh-budget#budget/setSettings"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "setSettings"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodString; mode: "strict"; typeSymbol: string; schema: z.ZodString; }>; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }> | Readonly<{ readonly id: "dsh-budget#budget/unblock"; readonly service: "budget"; readonly namespace: "budget"; readonly method: "unblock"; readonly invocation: Readonly<{ kind: "direct"; }>; readonly parameters: readonly Readonly<{ name: string; wire: string; source: "json"; codec: Readonly<{ create: () => z.ZodEnum<{ session: "session"; daily: "daily"; monthly: "monthly"; }>; mode: "strict"; typeSymbol: string; schema: z.ZodEnum<{ session: "session"; daily: "daily"; monthly: "monthly"; }>; }>; }>[]; readonly result: Readonly<{ create: () => z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; mode: "strict"; typeSymbol: string; schema: z.ZodObject<{ scopes: z.ZodArray; capUsd: z.ZodNullable; usedUsd: z.ZodNumber; ratio: z.ZodNumber; tokens: z.ZodNumber; carbonKg: z.ZodNumber; }, z.core.$strip>>; models: z.ZodArray; p50: z.ZodNullable; p95: z.ZodNullable; max: z.ZodNullable; samples: z.ZodNumber; }, z.core.$strip>; priced: z.ZodBoolean; }, z.core.$strip>>; alerts: z.ZodArray; kind: z.ZodUnion, z.ZodLiteral<"over">]>; at: z.ZodNumber; usedUsd: z.ZodNumber; capUsd: z.ZodNumber; }, z.core.$strip>>; blockedScopes: z.ZodArray>; currency: z.ZodObject<{ code: z.ZodString; rate: z.ZodNumber; decimals: z.ZodNumber; }, z.core.$strip>; alertsEnabled: z.ZodBoolean; desktopNotifications: z.ZodBoolean; degradedModel: z.ZodNullable; days: z.ZodArray>; warnRatio: z.ZodNumber; refreshIntervalMs: z.ZodNumber; }, z.core.$strip>; }>; readonly sourceLocation: Readonly<{ file: "src/wire.ts"; line: 1; column: 1; }>; }>)[]; //# sourceMappingURL=wire.d.ts.map