openclaw / src /agents /embedded-agent-runner /compact.runtime.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
eb3f11e verified
Raw History Blame Contribute Delete
805 Bytes
/**
* Lazy-loads the embedded-agent compaction runtime.
*/
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import type { CompactEmbeddedAgentSessionRuntimeParams } from "./compact.types.js";
import type { EmbeddedAgentCompactResult } from "./types.js";
const compactRuntimeLoader = createLazyImportLoader(() => import("./compact.js"));
function loadCompactRuntime() {
return compactRuntimeLoader.load();
}
/** Loads the compaction runtime on demand and forwards the direct compaction call. */
export async function compactEmbeddedAgentSessionOnDemand(
params: CompactEmbeddedAgentSessionRuntimeParams,
): Promise<EmbeddedAgentCompactResult> {
const { compactEmbeddedAgentSessionDirect } = await loadCompactRuntime();
return compactEmbeddedAgentSessionDirect(params);
}