import type { SubagentRunRecord } from "./subagent-registry.types.js" ;
export type ReplaceSubagentRunAfterSteerParams = {
previousRunId: string;
nextRunId: string;
fallback?: SubagentRunRecord;
runTimeoutSeconds?: number;
preserveFrozenResultFallback?: boolean ;
};
type ReplaceSubagentRunAfterSteerFn = (params: ReplaceSubagentRunAfterSteerParams) => boolean ;
type FinalizeInterruptedSubagentRunParams = {
runId?: string;
childSessionKey?: string;
error: string;
endedAt?: number;
};
type FinalizeInterruptedSubagentRunFn = (
params: FinalizeInterruptedSubagentRunParams,
) => Promise<number>;
let replaceSubagentRunAfterSteerImpl: ReplaceSubagentRunAfterSteerFn | null = null ;
let finalizeInterruptedSubagentRunImpl: FinalizeInterruptedSubagentRunFn | null = null ;
export function configureSubagentRegistrySteerRuntime(params: {
replaceSubagentRunAfterSteer: ReplaceSubagentRunAfterSteerFn;
finalizeInterruptedSubagentRun?: FinalizeInterruptedSubagentRunFn;
}) {
replaceSubagentRunAfterSteerImpl = params.replaceSubagentRunAfterSteer;
finalizeInterruptedSubagentRunImpl = params.finalizeInterruptedSubagentRun ?? null ;
}
export function replaceSubagentRunAfterSteer(params: ReplaceSubagentRunAfterSteerParams) {
return replaceSubagentRunAfterSteerImpl?.(params) ?? false ;
}
export async function finalizeInterruptedSubagentRun(params: FinalizeInterruptedSubagentRunParams) {
return (await finalizeInterruptedSubagentRunImpl?.(params)) ?? 0 ;
}
Messung V0.5 in Prozent C=99 H=97 G=97
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-05-26)
¤
*© Formatika GbR, Deutschland