Skip to main content

Interface: GuardedFetchOptions

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:70

What the caller allows a guardedFetch.

Properties​

accept?​

optional accept: readonly string[]

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:82

Media types read, without parameters, in lower case. An answer with no Content-Type counts as application/octet-stream.

Default​

['text/html', 'application/xhtml+xml', 'application/pdf', 'text/plain']

allowAddresses?​

optional allowAddresses: readonly string[]

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:92

Addresses reachable though not public, for a test's own server. Never set it in production.


allowPorts?​

optional allowPorts: readonly number[]

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:84

Ports read.

Default​

[80, 443]

deadlineMs​

deadlineMs: number

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:74

How long the whole read may take in milliseconds: the lookups, every redirect and the body.


maxBytes​

maxBytes: number

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:72

The most bytes the body may hold, counted as they arrive and again after a gzip, deflate or br coding is decoded.


maxRedirects?​

optional maxRedirects: number

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:76

The most redirects followed, each checked as the first address is.

Default​

3

resolve()?​

optional resolve: (host) => Promise<object[]>

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:90

Answers a host's addresses; a test passes a stand-in.

Parameters​

host​

string

Returns​

Promise<object[]>

Default​

dns.lookup with every address


signal?​

optional signal: AbortSignal

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:88

Ends the read early; the fetch then rejects with the signal's reason.


userAgent?​

optional userAgent: string

Defined in: packages/agentos/src/cognition/memory/io/ingestion/guardedFetch.ts:86

The User-Agent header; none is sent when absent.