@modelprofile.com/authswitch 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,20 +108,32 @@ export interface IHarnessStatusFact {
108
108
  summaryKey?: 'subscription' | 'billing' | 'usageWindows' | 'resets' | 'resetDetails';
109
109
  }
110
110
 
111
+ /** The provider's own reading of a usage window. Adapters set it only when the provider reports one of these. */
112
+ export type TUsageSeverity = 'normal' | 'warning' | 'critical';
113
+
114
+ export interface IHarnessUsageWindow {
115
+ label: string;
116
+ /**
117
+ * Feature-specific quotas (a model, a surface, a product feature) do not determine the general
118
+ * account summary unless the provider picks one as its headline. Omission means account.
119
+ */
120
+ scope?: 'account' | 'feature';
121
+ durationSeconds: number;
122
+ usedPercent: number;
123
+ resetAt: string | null;
124
+ /** Omitted when the provider gives no reading; consumers then apply their own thresholds. */
125
+ severity?: TUsageSeverity;
126
+ /** Set when the provider picks this window as the one a single-value summary shows. */
127
+ headline?: true;
128
+ }
129
+
111
130
  export interface IHarnessStatusSummary {
112
131
  /** A plan name does not imply an active billing status. */
113
132
  subscription?: { plan: string; source: 'live' | 'stored' };
114
133
  /** Live billing information only. Never infer these fields from a plan or entitlement expiry. */
115
134
  billing?: { hasActiveSubscription?: boolean; autoRenew?: boolean; renewsAt?: string; cancelsAt?: string; expiresAt?: string };
116
135
  /** Missing windows are unknown, not unused. Times are ISO 8601 UTC. */
117
- usageWindows?: {
118
- label: string;
119
- /** Feature-specific quotas do not determine the general account summary. Omission means account. */
120
- scope?: 'account' | 'feature';
121
- durationSeconds: number;
122
- usedPercent: number;
123
- resetAt: string | null;
124
- }[];
136
+ usageWindows?: IHarnessUsageWindow[];
125
137
  resets?: {
126
138
  available: number;
127
139
  /** May be a partial list. Omission means the detail lookup was unavailable. */
@@ -1,4 +1,4 @@
1
- import type { IHarnessAccount, IHarnessAccountStatus, IHarnessCredentialDrift } from './interfaces.harness.js';
1
+ import type { IHarnessAccount, IHarnessAccountStatus, IHarnessCredentialDrift, TUsageSeverity } from './interfaces.harness.js';
2
2
 
3
3
  /** Credential-free, versioned output of list --json. Missing status fields stay omitted. */
4
4
  export interface IAccountList {
@@ -48,6 +48,10 @@ export interface IAccountLimitRow {
48
48
  resetAt: string | null;
49
49
  /** Human countdown for the same `resetAt`, relative to `generatedAt`. */
50
50
  resetsIn: string;
51
+ /** The provider's reading of this window; null when it gave none or the row has no window. */
52
+ severity: TUsageSeverity | null;
53
+ /** Whether the provider picks this window as the one a single-value summary shows. */
54
+ headline: boolean;
51
55
  unavailableReason: string | null;
52
56
  }
53
57