import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs"; import { a as ListLogsParameters, c as CompleteTask, d as InProgressTask, f as LuauExecutionTask, h as SubmitAtVersionParameters, i as defaultPollDelay, l as FailedTask, m as SubmitAtHeadParameters, n as LuauExecutionSubmitOptions, o as LogMessage, p as LuauExecutionTaskRef, r as PollUntilDoneOptions, s as LogPage, t as LuauExecutionRunOptions, u as GetParameters } from "./capacity-admission-BvnJjY0S.mjs"; //#region src/domains/cloud-v2/luau-execution-task-binary-inputs/types.d.ts /** * Caller-supplied input for creating a Luau execution task binary input * upload slot. The server returns a presigned `uploadUri` the caller uses * to PUT the binary data. * * @since 0.1.0 */ interface CreateBinaryInputParameters { /** Size in bytes of the binary data to be uploaded. */ readonly size: number; /** Stringified ID of the universe that owns the task. */ readonly universeId: string; } /** * Public representation of a created Luau execution task binary input. * Pass `path` verbatim to `tasks.submit({ binaryInput })`. * * @since 0.1.0 */ interface LuauExecutionTaskBinaryInput { /** * Server-emitted resource path; pass to `tasks.submit` as `binaryInput`. */ readonly path: string; /** Presigned PUT target; perform the binary upload to this URI directly. */ readonly uploadUri: string; } //#endregion //#region src/resources/luau-execution/capacity-error.d.ts /** * A Luau task submission refused because validated tasks occupy the target * place's execution capacity. * * @example * * ```ts * import { LuauExecutionCapacityError } from "@bedrock-rbx/ocale/luau-execution"; * * const error = new LuauExecutionCapacityError([{ * placeId: "456", * sessionId: "11111111-1111-4111-8111-111111111111", * taskId: "22222222-2222-4222-8222-222222222222", * universeId: "123", * versionId: "789", * }]); * expect(error.blockers).toHaveLength(1); * ``` * * @since 0.3.2 */ declare class LuauExecutionCapacityError extends OpenCloudError { /** Validated task references reported as occupying the target place. */ readonly blockers: ReadonlyArray; override readonly name = "LuauExecutionCapacityError"; /** * Creates a capacity failure from validated blocker references. * * @param blockers - Tasks reported as occupying the submitted place. */ constructor(blockers: ReadonlyArray); } //#endregion //#region src/resources/luau-execution/client.d.ts /** * Operation handle for the `binaryInputs` namespace on * {@link LuauExecutionClient}. Provides `create` to allocate a presigned * upload slot for binary script inputs. * * @since 0.1.0 */ interface BinaryInputsHandle { /** * Allocates a presigned binary input upload slot. The returned * `uploadUri` is a presigned `PUT` target; the caller uploads the * binary data directly and passes `path` to `tasks.submit` as * `binaryInput`. * * @param parameters - Universe identifier and the byte size of the * binary to upload. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed * {@link LuauExecutionTaskBinaryInput} or the {@link OpenCloudError} * that caused the request to fail. */ create(parameters: CreateBinaryInputParameters, options?: RequestOptions): Promise>; } /** * Operation handle exposed by {@link LuauExecutionClient} as the * `tasks` namespace. Provides `submit` to queue a Luau script, `get` * to fetch a task's current state, and `listLogs` to retrieve * structured log messages produced by a task. * * @since 0.1.0 */ interface TasksHandle { /** * Fetches the current state of a previously-submitted Luau * execution task. Uses idempotent retry semantics for both 429 and * 5xx. * * @param parameters - The task ref plus an optional `view` selector. * @param options - Optional per-request overrides (e.g. A different * {@link OpenCloudClientOptions.apiKey} for this call only). * @returns A {@link Result} wrapping the parsed * {@link LuauExecutionTask} or the {@link OpenCloudError} that * caused the request to fail. */ get(parameters: GetParameters, options?: RequestOptions): Promise>; /** * Lists one page of structured log messages produced by a * previously-submitted Luau execution task. Messages from multiple * server-side chunks are flattened into a single ordered array. * Uses idempotent retry semantics for both 429 and 5xx. * * @param parameters - The task ref and optional pagination controls * (`pageSize`, `pageToken`). * @param options - Optional per-request overrides (e.g. A different * {@link OpenCloudClientOptions.apiKey} for this call only). * @returns A {@link Result} wrapping the parsed {@link LogPage} or * the {@link OpenCloudError} that caused the request to fail. */ listLogs(parameters: ListLogsParameters, options?: RequestOptions): Promise>; /** * Polls `tasks.get` with `view=BASIC` on a configurable backoff schedule * until the task reaches a terminal state, the wall-clock budget is * exhausted, or the supplied `AbortSignal` fires. Returns the terminal * task on success. * * @param ref - Reference to the task to poll, typically returned by `submit`. * @param options - Polling and per-request overrides. * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask}, * or an error if aborted, timed out, or the transport fails. */ pollUntilDone(ref: LuauExecutionTaskRef, options?: PollUntilDoneOptions): Promise>; /** * Submits a Luau script and polls `tasks.get` with `view=BASIC` until * the task reaches a terminal state, the wall-clock budget is * exhausted, or the supplied `AbortSignal` fires. Combines `submit` * and `pollUntilDone` in one call. * * @param parameters - The same input accepted by `submit`. * @param options - Polling and per-request overrides. * @returns A {@link Result} wrapping the terminal * {@link LuauExecutionTask}, or an error if submit fails, the task * is aborted, timed out, or the transport fails. */ runUntilDone(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionRunOptions): Promise>; /** * Submits a Luau script for execution against a place. Dispatches * to the head-version URL when `versionId` is omitted, or to the * specific-version URL when one is supplied. Both URL shapes share * one rate-limit queue and one required-scope set. * * @param parameters - The universe and place identifiers, the * script to run, an optional `versionId`, and any other writable * submit fields. * @param options - Optional per-request overrides (e.g. A different * {@link OpenCloudClientOptions.apiKey} for this call only). * @returns A {@link Result} wrapping the parsed * {@link LuauExecutionTask} or the {@link OpenCloudError} that * caused the request to fail. */ submit(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionSubmitOptions): Promise>; } /** * Public client for the Roblox Open Cloud `LuauExecutionSessionTask` * resource. Tasks run a Luau script against a place and surface state, * output, or error through the `LuauExecutionTask` discriminated * union. Exposes `tasks.submit` for both the head version and a * specific place version, `tasks.get` for fetching task state, * `tasks.listLogs` for fetching structured log messages, and * `binaryInputs.create` for allocating presigned upload slots. * * @since 0.1.0 * * @example * * ```ts * import { LuauExecutionClient } from "@bedrock-rbx/ocale/luau-execution"; * * const client = new LuauExecutionClient({ apiKey: "your-key" }); * expect(client).toBeInstanceOf(LuauExecutionClient); * ``` */ declare class LuauExecutionClient { #private; readonly binaryInputs: BinaryInputsHandle; readonly tasks: TasksHandle; /** * Creates a new {@link LuauExecutionClient}. Configuration is frozen * on construction; per-request overrides are accepted on each * method. * * @param options - Client-level configuration including the API key. */ constructor(options: OpenCloudClientOptions); } //#endregion export { type BinaryInputsHandle, type CompleteTask, type CreateBinaryInputParameters, type FailedTask, type GetParameters, type InProgressTask, type ListLogsParameters, type LogMessage, type LogPage, LuauExecutionCapacityError, LuauExecutionClient, type LuauExecutionRunOptions, type LuauExecutionSubmitOptions, type LuauExecutionTask, type LuauExecutionTaskBinaryInput, type LuauExecutionTaskRef, type PollUntilDoneOptions, type SubmitAtHeadParameters, type SubmitAtVersionParameters, type TasksHandle, defaultPollDelay }; //# sourceMappingURL=luau-execution.d.mts.map