import { AuthInvokerSchema } from "../../tailor-proto/src/tailor/v1/auth_resource_pb.mjs"; import { FunctionExecution_Status } from "../../tailor-proto/src/tailor/v1/function_resource_pb.mjs"; import { OperatorClient } from "./client.mjs"; import { MessageInitShape } from "@bufbuild/protobuf"; import { Jsonifiable } from "type-fest"; //#region src/cli/shared/script-executor.d.ts /** Authentication context for script execution, provided as a plain object. */ export type ScriptInvoker = MessageInitShape; /** * Options for script execution */ export interface ScriptExecutionOptions { /** Operator client instance */ client: OperatorClient; /** Workspace ID */ workspaceId: string; /** Script name (for identification) */ name: string; /** Bundled script code to execute */ code: string; /** Optional JSON-serializable argument to pass to the script */ arg?: T; /** Auth invoker for script execution */ invoker: ScriptInvoker; /** Polling interval in milliseconds (default: 1000ms) */ pollInterval?: number; } /** * Result of script execution */ export interface ScriptExecutionResult { /** Whether the script executed successfully */ success: boolean; /** Logs output from the script execution */ logs: string; /** Result value from the script execution */ result: string; /** Error message if execution failed */ error?: string; } /** * Result from waiting for execution completion */ export interface ExecutionWaitResult { /** Execution status */ status: FunctionExecution_Status; /** Logs output from the execution */ logs: string; /** Result value from the execution */ result: string; } /** * Wait for a function execution to complete * * Polls the getFunctionExecution API until the execution reaches a terminal state * (SUCCESS, FAILED, or CANCELED). * @param {OperatorClient} client - Operator client instance * @param {string} workspaceId - Workspace ID * @param {string} executionId - Execution ID to wait for * @param {number} [pollInterval] - Polling interval in milliseconds (default: 1000ms) * @returns {Promise} Execution result * @throws {Error} If execution is not found */ export declare function waitForExecution(client: OperatorClient, workspaceId: string, executionId: string, pollInterval?: number): Promise; /** * Execute a script and wait for completion * * This function: * 1. Starts the script execution * 2. Polls getFunctionExecution until completion * 3. Returns structured result with success/failure status * @param {ScriptExecutionOptions} options - Execution options * @returns {Promise} Execution result */ export declare function executeScript(options: ScriptExecutionOptions): Promise; //#endregion