import type { ResourceClientContext } from '../client/toruk-client'; import type { TorukApiResponse } from '../types/api-response'; import type { TorukArtifact, TorukArtifactList, TorukArtifactDownload, ListArtifactsInput, GetArtifactInput, DownloadArtifactInput } from './artifacts.types'; /** * Parse the filename out of a `Content-Disposition` header. * * Core sanitizes the name before sending it (word characters, dots and dashes * only), so the quoted form is what actually arrives; `filename*` is handled * too because a proxy may rewrite the header. Falls back to the artifact id so * a saved file always has a name — never to a fabricated title. */ export declare function parseContentDispositionFilename(header: string | null, fallback: string): string; /** * The external (public deployment) artifact plane. * * Every method is addressed by deployment + session + artifact, because that is * how Core scopes them: an external artifact has no owner, so the conversation * the visitor already holds is the only thing that vouches for them. There is * no `get(artifactId)` overload and no client-level "current artifact" — a * caller that does not know which session an artifact belongs to has no claim * to it. * * Read-only, matching the Core contract. Artifacts are created by the flow * during a conversation, never by the client, so there is no `create()`, * `update()` or `delete()` here to leave unimplemented. * * Identity is the same `x-toruk-visitor` token the session plane uses; it is * attached by the shared transport, so nothing about artifacts needs org * credentials or a JWT. */ export declare class ArtifactsClient { private readonly ctx; /** Client-level default; each call may override it. */ private readonly defaultDeploymentId?; constructor(ctx: ResourceClientContext, /** Client-level default; each call may override it. */ defaultDeploymentId?: string | undefined); private basePath; private resolve; private require; /** * The artifacts generated in one of the visitor's conversations, newest first. * GET /api/v1/deployments/:deploymentId/sessions/:sessionId/artifacts */ list(input: ListArtifactsInput): Promise>; /** * One artifact, with its inline content when it has any. * GET /api/v1/deployments/:deploymentId/sessions/:sessionId/artifacts/:artifactId */ get(input: GetArtifactInput): Promise>; /** * The artifact's bytes. * GET /api/v1/deployments/:deploymentId/sessions/:sessionId/artifacts/:artifactId/download * * Uses the raw transport because the body is a file rather than the JSON * envelope every other call returns — but the same authenticated transport, * so the visitor token still travels with it. A failure comes back as a * rejected promise rather than an envelope, since there is no partial file. */ download(input: DownloadArtifactInput): Promise; }