import type { ActionIdentifier } from "@garden-io/grow-sdk/actions/action"; import type { ActionOutputs, ResolvedActionSpec } from "@garden-io/grow-sdk/actions/types"; import type { ActionType } from "@garden-io/grow-sdk/declarations/action-type"; import type { BaseAction, ExecutedActionImpl, ResolvedActionImpl, StatusOnlyActionImpl } from "../actions/base"; import type { ConfigGraph } from "../graph/config-graph"; import type { GraphResults } from "../graph/results"; import type { ActionLog } from "../logger/log-entry"; import { BaseTask } from "./base"; import type { BaseActionTaskParams, ResolveProcessDependenciesParams, TaskProcessParams, TaskStatusParams } from "./base"; export type ValidResultType = Record & { needsProcessing: boolean; }; export declare abstract class BaseActionTask extends BaseTask { readonly action: BaseAction; readonly graph: ConfigGraph; readonly forceActions: ActionIdentifier[]; readonly skipRuntimeDependencies: boolean; log: ActionLog; constructor(params: BaseActionTaskParams); abstract getStatus(params: TaskProcessParams): null | Promise; abstract process(params: TaskProcessParams): Promise; getDescription(): string; getName(): string; resolveStatusDependencies(): BaseTask[]; resolveProcessDependencies({ status }: ResolveProcessDependenciesParams): BaseTask[]; /** * For this task type, we can use the runtime outputs schema to decide which fields to include in the export * (e.g. for the machine-readable command result). */ export(result: O): import("@garden-io/grow-sdk/util/types").JSONObject; getDependencyParams(): BaseActionTaskParams; /** * Given a set of graph results, return a resolved version of the action. * Throws if the dependency results don't contain the required task results. */ getResolvedAction(dependencyResults: GraphResults): ResolvedActionImpl; } export type ResolveActionResults = { resolvedAction: ResolvedActionImpl; needsProcessing: boolean; }; export declare class ResolveActionTask extends BaseActionTask> { readonly executeConcurrencyLimit = 10; readonly statusConcurrencyLimit = 10; readonly type = "resolve-action"; getDescription(): string; getName(): string; getStatus({}: TaskStatusParams): Promise; resolveStatusDependencies(): never[]; resolveProcessDependencies(): BaseTask[]; process({ dependencyResults }: TaskProcessParams>): Promise>; validateSpec(spec: unknown): ResolvedActionSpec; } export type ExecuteActionOutputs = { action: ExecutedActionImpl | StatusOnlyActionImpl; outputs: Partial>; needsProcessing: boolean; }; export declare class ExecuteActionTask extends BaseActionTask> { get executeConcurrencyLimit(): number; get statusConcurrencyLimit(): number; get concurrencyGroup(): string; readonly type = "execute-action"; getStatus({ dependencyResults }: TaskStatusParams): Promise | null>; process({ dependencyResults }: TaskProcessParams>): Promise>; } /** * Creates an ExecuteActionTask for the given BaseAction. */ export declare function makeExecuteTask(params: BaseActionTaskParams): ExecuteActionTask; /** * Returns the ResolveActionTask for the given BaseAction. */ export declare function makeResolveTask(params: BaseActionTaskParams): ResolveActionTask;