Skip to content

toolmark-monorepo / @toolmark/core / FilesOptions

Interface: FilesOptions ​

Defined in: packages/core/src/files.ts:20

Registry-wide file settings (createToolmark({ files }), spec §8.4). Misconfiguration (an allowOrigins entry that is not exactly an origin, contains *, or is http: on a host other than localhost / 127.0.0.1 / [::1]; a non-positive maxBytes or timeoutMs) is files_misconfigured: thrown in development; in production an error event is emitted and URL fetching stays disabled.

Properties ​

allowOrigins? ​

optional allowOrigins?: string[]

Defined in: packages/core/src/files.ts:33

Exact origins (https://cdn.example.com) { url } references may be fetched from. Empty or absent (the default) disables URL fetching. No wildcards; http: origins only for localhost, 127.0.0.1 and [::1]. Only https: URLs (or http: on those loopback hosts) without userinfo are fetched, with credentials omitted, redirects refused, no referrer and no cache.


maxBytes? ​

optional maxBytes?: number

Defined in: packages/core/src/files.ts:35

Size limit for every resolved file, in bytes (default 10485760, 10 MiB).


resolve? ​

optional resolve?: (ref, ctx) => Promise<File>

Defined in: packages/core/src/files.ts:25

Resolves a { ref } to a File. Receives the call's signal. Without it, every { ref } is refused file_rejected ("File references are not configured").

Parameters ​

ref ​

string

ctx ​
signal ​

AbortSignal

Returns ​

Promise<File>


timeoutMs? ​

optional timeoutMs?: number

Defined in: packages/core/src/files.ts:37

URL fetch timeout in milliseconds (default 30000).