agent-afk 5.77.0 → 5.78.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.
@@ -3,4 +3,4 @@ export interface ThrottleInfo {
3
3
  status: number;
4
4
  retryAfterMs?: number;
5
5
  }
6
- export declare function makeTracingFetch(writer: TraceWriter | undefined, baseFetch?: typeof fetch, onThrottle?: (info: ThrottleInfo) => void): typeof fetch;
6
+ export declare function makeTracingFetch(writer: TraceWriter | undefined, baseFetch?: typeof fetch, onThrottle?: (info: ThrottleInfo) => void, onQuota?: (headers: Headers) => void): typeof fetch;
@@ -0,0 +1,12 @@
1
+ export interface QuotaSnapshot {
2
+ readonly fiveHourUtilization?: number;
3
+ readonly fiveHourResetsAt?: Date;
4
+ readonly sevenDayUtilization?: number;
5
+ readonly sevenDayResetsAt?: Date;
6
+ readonly observedAt: Date;
7
+ }
8
+ export declare function parseQuotaHeaders(headers: Headers): QuotaSnapshot | undefined;
9
+ export declare function recordQuotaSnapshot(snapshot: QuotaSnapshot): void;
10
+ export declare function getQuotaSnapshot(): QuotaSnapshot | undefined;
11
+ export declare function onQuotaUpdate(listener: () => void): () => void;
12
+ export declare function resetQuotaCacheForTests(): void;
@@ -110,6 +110,7 @@ export declare const REPL_SPINNER_OPTIONS: {
110
110
  };
111
111
  export declare function contextRatio(stats: SessionStats, sampler?: ContextSampler): number;
112
112
  export declare function formatStatusFields(stats: SessionStats, sampler?: ContextSampler, gitSampler?: GitStatusSampler): {
113
+ quota?: string | undefined;
113
114
  pr?: number | undefined;
114
115
  branch?: string | undefined;
115
116
  cwd?: string | undefined;
@@ -11,6 +11,7 @@ export interface StatusLineFields {
11
11
  cwd?: string;
12
12
  branch?: string;
13
13
  pr?: number;
14
+ quota?: string;
14
15
  }
15
16
  interface StatusLineOpts {
16
17
  stream?: NodeJS.WriteStream;