openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
63 lines (62 loc) • 3.4 kB
TypeScript
import { type SessionEntry } from "../config/sessions.js";
import { type DeliveryContext } from "../utils/delivery-context.js";
import type { SubagentRunRecord } from "./subagent-registry.types.js";
export type { SubagentRunRecord } from "./subagent-registry.types.js";
export declare function resolveSubagentSessionStatus(entry: Pick<SubagentRunRecord, "endedAt" | "endedReason" | "outcome"> | null | undefined): SessionEntry["status"];
export declare function markSubagentRunForSteerRestart(runId: string): boolean;
export declare function clearSubagentRunSteerRestart(runId: string): boolean;
export declare function getSubagentSessionStartedAt(entry: Pick<SubagentRunRecord, "sessionStartedAt" | "startedAt" | "createdAt"> | null | undefined): number | undefined;
export declare function getSubagentSessionRuntimeMs(entry: Pick<SubagentRunRecord, "startedAt" | "endedAt" | "accumulatedRuntimeMs"> | null | undefined, now?: number): number | undefined;
export declare function replaceSubagentRunAfterSteer(params: {
previousRunId: string;
nextRunId: string;
fallback?: SubagentRunRecord;
runTimeoutSeconds?: number;
preserveFrozenResultFallback?: boolean;
}): boolean;
export declare function registerSubagentRun(params: {
runId: string;
childSessionKey: string;
controllerSessionKey?: string;
requesterSessionKey: string;
requesterOrigin?: DeliveryContext;
requesterDisplayKey: string;
task: string;
cleanup: "delete" | "keep";
label?: string;
model?: string;
workspaceDir?: string;
runTimeoutSeconds?: number;
expectsCompletionMessage?: boolean;
spawnMode?: "run" | "session";
attachmentsDir?: string;
attachmentsRootDir?: string;
retainAttachmentsOnKeep?: boolean;
}): void;
export declare function resetSubagentRegistryForTests(opts?: {
persist?: boolean;
}): void;
export declare function addSubagentRunForTests(entry: SubagentRunRecord): void;
export declare function releaseSubagentRun(runId: string): void;
export declare function resolveRequesterForChildSession(childSessionKey: string): {
requesterSessionKey: string;
requesterOrigin?: DeliveryContext;
} | null;
export declare function isSubagentSessionRunActive(childSessionKey: string): boolean;
export declare function shouldIgnorePostCompletionAnnounceForSession(childSessionKey: string): boolean;
export declare function markSubagentRunTerminated(params: {
runId?: string;
childSessionKey?: string;
reason?: string;
}): number;
export declare function listSubagentRunsForRequester(requesterSessionKey: string, options?: {
requesterRunId?: string;
}): SubagentRunRecord[];
export declare function listSubagentRunsForController(controllerSessionKey: string): SubagentRunRecord[];
export declare function countActiveRunsForSession(requesterSessionKey: string): number;
export declare function countActiveDescendantRuns(rootSessionKey: string): number;
export declare function countPendingDescendantRuns(rootSessionKey: string): number;
export declare function countPendingDescendantRunsExcludingRun(rootSessionKey: string, excludeRunId: string): number;
export declare function listDescendantRunsForRequester(rootSessionKey: string): SubagentRunRecord[];
export declare function getSubagentRunByChildSessionKey(childSessionKey: string): SubagentRunRecord | null;
export declare function initSubagentRegistry(): void;