mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-07 00:28:21 +00:00
70 lines
2.3 KiB
TypeScript
70 lines
2.3 KiB
TypeScript
export interface FrvChildStatus extends Record<string, unknown> {
|
|
effectiveRunAttempt: number | null;
|
|
key: string;
|
|
plannedRunAttempt: number | null;
|
|
runId: string;
|
|
status: "active" | "failed" | "missing" | "passed";
|
|
}
|
|
|
|
export interface FrvContinuationStatus {
|
|
active: FrvChildStatus[];
|
|
children: FrvChildStatus[];
|
|
failed: FrvChildStatus[];
|
|
missing: FrvChildStatus[];
|
|
passed: FrvChildStatus[];
|
|
}
|
|
|
|
export interface FrvClient {
|
|
repository?: string;
|
|
getAttemptJobs: (runId: string, runAttempt: number) => Promise<Record<string, unknown>[]>;
|
|
getJobLog: (jobId: number) => Promise<string>;
|
|
getParentJobs: (runId: string) => Promise<Record<string, unknown>[]>;
|
|
getRun: (runId: string) => Promise<Record<string, unknown>>;
|
|
getRunAttempt: (runId: string, runAttempt: number) => Promise<Record<string, unknown>>;
|
|
rerunFailed?: (runId: string) => Promise<unknown>;
|
|
rerunParent?: (runId: string) => Promise<unknown>;
|
|
verify?: (
|
|
runId: string,
|
|
plan: Record<string, unknown>,
|
|
operationDeadline?: number,
|
|
expectedRunAttempts?: Record<string, number>,
|
|
) => Promise<unknown>;
|
|
verifySeal?: (
|
|
runId: string,
|
|
plan: Record<string, unknown>,
|
|
operationDeadline: number,
|
|
expectedRunAttempts: Record<string, number>,
|
|
) => Promise<boolean>;
|
|
}
|
|
|
|
export type FrvConcreteClient = FrvClient &
|
|
Required<Pick<FrvClient, "rerunFailed" | "rerunParent" | "verify" | "verifySeal">>;
|
|
|
|
export function inspectContinuation(
|
|
plan: Record<string, unknown>,
|
|
client: Pick<FrvClient, "getAttemptJobs" | "getRun" | "repository">,
|
|
): Promise<FrvContinuationStatus>;
|
|
export function createClient(
|
|
repository: string,
|
|
dependencies?: Record<string, unknown>,
|
|
): FrvConcreteClient;
|
|
export function preflightContinuation(
|
|
plan: Record<string, unknown>,
|
|
rootRunId: string,
|
|
client: Pick<FrvClient, "getJobLog" | "getParentJobs" | "getRunAttempt">,
|
|
repository?: string,
|
|
): Promise<Record<string, unknown>>;
|
|
export function loadPlan(
|
|
options: Record<string, unknown>,
|
|
loadExecutionPlan?: (...args: unknown[]) => Promise<unknown>,
|
|
): Promise<Record<string, unknown>>;
|
|
export function continueFailed(
|
|
plan: Record<string, unknown>,
|
|
rootRunId: string,
|
|
client: FrvClient,
|
|
options?: Record<string, unknown>,
|
|
): Promise<{
|
|
action: string;
|
|
finalRunId?: string;
|
|
status: FrvContinuationStatus;
|
|
}>;
|