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.
@@ -0,0 +1,24 @@
1
+ import { type RetryFetchOptions } from './retryFetch.js';
2
+ import type { FetchFn } from './types.js';
3
+ export type EgressVerdict = {
4
+ allowed: true;
5
+ } | {
6
+ allowed: false;
7
+ reason: string;
8
+ };
9
+ export declare class EgressBlockedError extends Error {
10
+ constructor(reason: string);
11
+ }
12
+ export interface EgressGuardOptions {
13
+ lookupFn?: (hostname: string) => Promise<readonly {
14
+ address: string;
15
+ }[]>;
16
+ allowPrivateHosts?: boolean;
17
+ }
18
+ export declare function privateHostsAllowed(): boolean;
19
+ export declare function checkEgressTarget(rawUrl: string, opts?: EgressGuardOptions): Promise<EgressVerdict>;
20
+ export declare function assertEgressAllowed(rawUrl: string, opts?: EgressGuardOptions): Promise<void>;
21
+ export interface GuardedFetchOptions extends EgressGuardOptions {
22
+ retry?: RetryFetchOptions;
23
+ }
24
+ export declare function guardedFetch(fetchFn: FetchFn, url: string, init?: RequestInit, opts?: GuardedFetchOptions): Promise<Response>;
@@ -1,6 +1,8 @@
1
1
  export { extractReadableMarkdown, THIN_CONTENT_CHARS } from './extract.js';
2
2
  export { scrapeToMarkdown } from './scrape.js';
3
3
  export type { ScrapeOptions, ScrapeResult } from './scrape.js';
4
+ export { assertEgressAllowed, checkEgressTarget, guardedFetch, privateHostsAllowed, EgressBlockedError, } from './egress-guard.js';
5
+ export type { EgressGuardOptions, EgressVerdict, GuardedFetchOptions } from './egress-guard.js';
4
6
  export { createExaSearchBackend, resolveSearchBackend, formatSearchResults, } from './search.js';
5
7
  export type { ExaBackendOptions, ResolveSearchOptions } from './search.js';
6
8
  export type { ExtractedContent, FetchFn, RenderFn, RenderedPage, SearchBackend, SearchResult, } from './types.js';
@@ -1,9 +1,11 @@
1
1
  import type { FetchFn, RenderFn } from './types.js';
2
+ import type { EgressGuardOptions } from './egress-guard.js';
2
3
  export interface ScrapeOptions {
3
4
  fetchFn?: FetchFn;
4
5
  renderFn?: RenderFn;
5
6
  timeoutMs: number;
6
7
  signal: AbortSignal;
8
+ lookupFn?: EgressGuardOptions['lookupFn'];
7
9
  }
8
10
  export interface ScrapeResult {
9
11
  title: string;
@@ -2,6 +2,7 @@ export type FetchFn = typeof fetch;
2
2
  export type RenderFn = (url: string, opts: {
3
3
  timeoutMs: number;
4
4
  signal: AbortSignal;
5
+ requestGuard?: (url: string) => Promise<void>;
5
6
  }) => Promise<RenderedPage>;
6
7
  export interface RenderedPage {
7
8
  html: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-afk",
3
- "version": "5.82.12",
3
+ "version": "5.83.0",
4
4
  "description": "Open-source coding-agent harness you can actually change — own the loop (prompts, gates, routing, skills, terminal states), use any model, run long tasks while you're away.",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -81,6 +81,7 @@
81
81
  "string-width": "^8.2.0",
82
82
  "telegraf": "^4.16.3",
83
83
  "turndown": "^7.2.4",
84
+ "undici": "^7.27.0",
84
85
  "wrap-ansi": "^10.0.0",
85
86
  "zod": "^4.3.6"
86
87
  },