UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

18 lines (17 loc) • 1.64 kB
import type { ImageContent } from "../../internal/llm.js"; import { type HostFloor } from "../host-floor.js"; import type { ImageInput } from "../types.js"; import { type ImageDownsampler } from "../image-downsample.js"; /** * The guard of a remote image URL: https only, then the one egress hop judge with the private-network floor (`hopRefusal`, * host-floor.ts) — the deployment's host floor (`RunnerDeps.hostFloor`, `floor`) must admit the host, and a private host is * reachable only when the floor's `only` list names it — so an end-user-supplied `images[].url` can't make the server fetch * `169.254.169.254` or a private box. The host is read literally (no DNS resolution). Throws on a refused URL. */ export declare function defaultImageUrlGuard(raw: string, floor?: HostFloor): void; /** Resolve an {@link ImageInput} (inline base64 or a URL to fetch) into a vendored `ImageContent` block: both arms pass * the one byte admission with the run's processor (inline-image.ts) — a fetched body after the URL's own guard and cap. */ export declare function toImageContent(img: ImageInput, floor: HostFloor | undefined, processor: ImageDownsampler | "none"): Promise<ImageContent>; /** The task's images (`TaskSpec.images`), each through {@link toImageContent} with the run's one processor (`seat` = * `RunnerDeps.imageProcessor`); the first one sent unprocessed over the soft target is told to `unprocessed`. */ export declare function toImageContents(images: readonly ImageInput[], floor: HostFloor | undefined, seat: ImageDownsampler | false | undefined, unprocessed: (bytes: number) => void): Promise<ImageContent[]>;