/** * Download a TeamShare document's bytes with a RUN's identity (2026-10). * * A document id is the stable reference; the storage URL behind it is private * and answers 403 to anyone outside the server. Node tools that receive a * document id (a builder upload stores the id in its file param, a render * chain passes `documentId`) resolve it through `GET /documents/:id/download` * authenticated with the run's own agent key — resolved by id from the * command's addressed agent, exactly like a task session. * * Used by: process-image (uploaded image), and any future node tool that needs * an input document's bytes. */ import { type SourceApi } from './source'; import type { ToolRunContext } from '../tools/runner'; /** A TeamShare document id (the uuid shape the API mints). */ export declare const DOCUMENT_ID_RE: RegExp; /** The API client for a run's context, or null when the context has no key. */ export declare function apiFromRunContext(ctx?: ToolRunContext): SourceApi | null; /** * Bytes of one document, authenticated as the run's agent. Throws with the * API's own error code (HTTP status + code) when the document cannot be read — * callers surface it instead of guessing why the bytes never arrived. */ export declare function fetchRunDocumentBytes(ctx: ToolRunContext | undefined, documentId: string): Promise;