import { z } from "zod"; /** * Public-API base for the broad-cancel escape hatch. Kept exported so * the bare-side `cancel({ modelId, kind? })` helper can parse the * `modelId` field consistently with the wire envelope. */ export declare const cancelInferenceBaseSchema: z.ZodObject<{ modelId: z.ZodString; }, z.core.$strip>; /** * Coarse kind narrowing for the broad-cancel escape hatch. Matches the * server-side `RequestKind` union in `server/bare/runtime/request-context.ts` * — keep the two lists in sync. The kind is optional; omitting it * cancels every in-flight request on the model regardless of kind * (the "cancel everything on this model" sweep used by model-unload * and app-shutdown paths). */ declare const cancelKindSchema: z.ZodEnum<{ completion: "completion"; embeddings: "embeddings"; transcribe: "transcribe"; translate: "translate"; diffusion: "diffusion"; tts: "tts"; ocr: "ocr"; vla: "vla"; finetune: "finetune"; loadModel: "loadModel"; downloadAsset: "downloadAsset"; rag: "rag"; }>; /** * Targeted cancel by `requestId` — the primary cancel path in * SDK 0.11.0. Pair with the `requestId` field exposed on * `CompletionRun` (and the decorated promises returned by * `loadModel(...)`, `downloadAsset(...)`, `embed(...)`, * `transcribe(...)`, `rag*(...)` etc.) to cancel a specific in-flight * request rather than every request running on a given model. * * `clearCache` is honoured only when the targeted request is a * `downloadAsset` — it propagates onto the underlying download * transfer so the partial file is deleted when the last subscriber * leaves. Ignored for other kinds. */ declare const cancelByRequestIdParamsSchema: z.ZodObject<{ operation: z.ZodLiteral<"request">; requestId: z.ZodString; clearCache: z.ZodOptional; }, z.core.$strip>; /** * Broad cancel escape hatch — abort every in-flight request running on * a model (optionally narrowed by `kind`). Kept indefinitely as the * non-`requestId` cancel surface for model-unload, app-shutdown, and * admin sweeps where the caller doesn't have a `requestId` to hand. * * Replaces the legacy per-kind discriminator arms (`"inference"`, * `"embeddings"`, `"downloadAsset"`, `"rag"`) with a single `"broad"` * arm plus an optional `kind` field. The old arms went away as part * of the 0.11.0 cleanup once every handler was on the registry; the * wire shape collapse is a `[bc]` for any external caller hand-rolling * the old RPC envelope. The public-API `cancel(...)` function in * `client/api/cancel.ts` keeps the old `{ operation: "inference", modelId }` * / `{ operation: "embeddings", modelId }` forms callable and translates * them into this new shape at the client boundary, so consumers using * the official SDK client see no change. */ declare const cancelBroadParamsSchema: z.ZodObject<{ operation: z.ZodLiteral<"broad">; modelId: z.ZodString; kind: z.ZodOptional>; }, z.core.$strip>; declare const cancelParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ operation: z.ZodLiteral<"request">; requestId: z.ZodString; clearCache: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ operation: z.ZodLiteral<"broad">; modelId: z.ZodString; kind: z.ZodOptional>; }, z.core.$strip>], "operation">; export declare const cancelRequestSchema: z.ZodIntersection; }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{ operation: z.ZodLiteral<"request">; requestId: z.ZodString; clearCache: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ operation: z.ZodLiteral<"broad">; modelId: z.ZodString; kind: z.ZodOptional>; }, z.core.$strip>], "operation">>; export declare const cancelResponseSchema: z.ZodObject<{ type: z.ZodLiteral<"cancel">; success: z.ZodBoolean; cancelled: z.ZodOptional; error: z.ZodOptional; }, z.core.$strip>; /** * Sugar for the most common new path — `cancel({ requestId })`. The * client accepts either this shape (no `operation`) or the explicit * `{ operation: "request", requestId }` and normalises before sending. */ export declare const cancelByRequestIdSugarSchema: z.ZodObject<{ requestId: z.ZodString; clearCache: z.ZodOptional; }, z.core.$strict>; /** * Sugar for the broad-cancel escape hatch — `cancel({ modelId, kind? })`. * Translates to `{ operation: "broad", modelId, kind? }` at the client * boundary. */ export declare const cancelBroadSugarSchema: z.ZodObject<{ modelId: z.ZodString; kind: z.ZodOptional>; }, z.core.$strict>; /** * Legacy per-kind broad-cancel sugars retained at the public-API * boundary so existing callers of `cancel({ operation: "inference", * modelId })` / `cancel({ operation: "embeddings", modelId })` keep * working without code changes. The client wrapper translates these * into the new `{ operation: "broad", modelId, kind: ... }` wire * shape. New callers should prefer `cancel({ requestId })` or * `cancel({ modelId, kind? })`. */ export declare const cancelLegacyInferenceSugarSchema: z.ZodObject<{ operation: z.ZodLiteral<"inference">; modelId: z.ZodString; }, z.core.$strip>; export declare const cancelLegacyEmbeddingsSugarSchema: z.ZodObject<{ operation: z.ZodLiteral<"embeddings">; modelId: z.ZodString; }, z.core.$strip>; export type CancelParams = z.infer; export type CancelInferenceBaseParams = z.infer; export type CancelByRequestIdParams = z.infer; export type CancelBroadParams = z.infer; export type CancelByRequestIdSugar = z.infer; export type CancelBroadSugar = z.infer; export type CancelLegacyInferenceSugar = z.infer; export type CancelLegacyEmbeddingsSugar = z.infer; export type CancelKind = z.infer; export type CancelRequest = z.infer; export type CancelResponse = z.infer; /** Public client-API input — accepts the wire union *or* the requestId/broad sugars and the legacy per-kind sugars. */ export type CancelClientInput = CancelParams | CancelByRequestIdSugar | CancelBroadSugar | CancelLegacyInferenceSugar | CancelLegacyEmbeddingsSugar; export {}; //# sourceMappingURL=cancel.d.ts.map