agent-afk 5.82.12 → 5.83.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.
@@ -1,10 +1,12 @@
1
1
  import type { ToolHandler } from '../types.js';
2
+ import type { EgressGuardOptions as GuardOpts } from '../../../web/egress-guard.js';
2
3
  import type { RenderFn } from '../../../web/types.js';
3
4
  type FetchFn = typeof fetch;
4
5
  interface WebScrapeOptions {
5
6
  fetchFn?: FetchFn;
6
7
  env?: Record<string, string | undefined>;
7
8
  renderFn?: RenderFn;
9
+ lookupFn?: GuardOpts['lookupFn'];
8
10
  }
9
11
  export declare function createWebScrapeHandler(opts?: WebScrapeOptions): ToolHandler;
10
12
  export declare const webScrapeHandler: ToolHandler;
@@ -0,0 +1,5 @@
1
+ import type { SubagentResult } from '../../subagent/result.js';
2
+ import type { ToolResult } from '../types.js';
3
+ export declare const CANCELLED_PARTIAL_MARKER = "[skill cancelled mid-flight \u2014 partial output preserved below]";
4
+ export declare function failedPartialMarker(errorMessage: string): string;
5
+ export declare function renderForkOutcome(result: SubagentResult, noOutputError: string): ToolResult;
@@ -19,6 +19,7 @@ export declare class BrowserLauncher {
19
19
  timeoutMs: number;
20
20
  waitUntil: 'load' | 'domcontentloaded' | 'networkidle';
21
21
  signal?: AbortSignal;
22
+ requestGuard?: (url: string) => Promise<void>;
22
23
  }): Promise<{
23
24
  html: string;
24
25
  finalUrl: string;
@@ -90,6 +90,7 @@ export interface RenderInput {
90
90
  timeoutMs?: number;
91
91
  waitFor?: WaitForOption;
92
92
  signal?: AbortSignal;
93
+ requestGuard?: (url: string) => Promise<void>;
93
94
  }
94
95
  export interface RenderResult {
95
96
  html: string;
@@ -111,7 +111,7 @@ export declare const REPL_SPINNER_OPTIONS: {
111
111
  };
112
112
  export declare function contextRatio(stats: SessionStats, sampler?: ContextSampler): number;
113
113
  export declare function formatStatusFields(stats: SessionStats, sampler?: ContextSampler, gitSampler?: GitStatusSampler): {
114
- quota?: string | undefined;
114
+ quotaWindows?: import("../../quota-indicator.js").QuotaWindows | undefined;
115
115
  pr?: number | undefined;
116
116
  branch?: string | undefined;
117
117
  cwd?: string | undefined;
@@ -0,0 +1,6 @@
1
+ import { type QuotaWindows } from './quota-indicator.js';
2
+ export type QuotaUsageTier = 'quiet' | 'caution' | 'near' | 'over';
3
+ export declare function formatQuotaUsage(windows: QuotaWindows | undefined, now?: Date): {
4
+ tier: QuotaUsageTier;
5
+ text: string | null;
6
+ };
@@ -0,0 +1,20 @@
1
+ import type { QuotaSnapshot } from '../agent/quota-cache.js';
2
+ export interface QuotaWindowState {
3
+ readonly utilization: number;
4
+ readonly resetsAt?: Date;
5
+ }
6
+ export interface QuotaWindows {
7
+ readonly fiveHour?: QuotaWindowState;
8
+ readonly sevenDay?: QuotaWindowState;
9
+ readonly observedAt?: Date;
10
+ }
11
+ export declare function quotaWindowsFromSnapshot(snapshot: QuotaSnapshot | undefined): QuotaWindows | undefined;
12
+ export type QuotaSeverity = 'calm' | 'caution' | 'critical';
13
+ export interface QuotaIndicator {
14
+ readonly text: string;
15
+ readonly severity: QuotaSeverity;
16
+ readonly stale: boolean;
17
+ }
18
+ export declare const STALE_AFTER_MS: number;
19
+ export declare function formatResetCountdown(msRemaining: number): string;
20
+ export declare function formatQuotaIndicator(windows: QuotaWindows, now?: Date): QuotaIndicator | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { PermissionMode } from '../agent/types/sdk-types.js';
2
+ import { type QuotaWindows } from './quota-indicator.js';
2
3
  export interface StatusLineFields {
3
4
  model: string;
4
5
  cost?: number;
@@ -11,7 +12,7 @@ export interface StatusLineFields {
11
12
  cwd?: string;
12
13
  branch?: string;
13
14
  pr?: number;
14
- quota?: string;
15
+ quotaWindows?: QuotaWindows;
15
16
  }
16
17
  interface StatusLineOpts {
17
18
  stream?: NodeJS.WriteStream;