import type { AgentSession } from "../session/agent-session"; import { type CreateAgentSessionOptions } from "./session"; import { SdkStartupCapability, type SdkStartupFailure, SdkStartupRollbackTracker } from "./startup-capability"; export type CreateLifecycleAgentSessionResult = { session: AgentSession; capability: SdkStartupCapability; rollback: SdkStartupRollbackTracker; /** * Starts the memory backend that construction deliberately skipped. The * caller MUST run it only after readiness is published. */ startDeferredMemoryBackend: () => Promise; } | { capability: SdkStartupCapability; rollback: SdkStartupRollbackTracker; failure: SdkStartupFailure; }; /** * Options accepted by lifecycle-only session construction. * * `deferMemoryBackendStartup` is not accepted: lifecycle sessions are launched * by the broker under a fixed readiness deadline, and memory startup runs * unbounded LLM work, so deferral is an invariant rather than a caller choice. */ export type CreateLifecycleAgentSessionOptions = Omit & { /** * Explicit model pin (#4707): the coordinator-resolved `provider/model` * selector, forwarded as {@link CreateAgentSessionOptions.modelPattern} so * the session resolves it through the same staged selector resolver the CLI * `--model` flag uses (after extension providers register). * * Resolution is strict: if this child's registry cannot resolve the pin to * exactly this model, construction fails and the partial session is * disposed instead of continuing into startup profile application, which * would otherwise activate `modelProfile.default`/`mpreset` while the * coordinator reports the requested pin. */ modelId?: string; /** * Startup budget for ACP lifecycle MCP launches, in milliseconds. Set only * when the lifecycle request supplies `mcpServers`; ordinary consumers keep * the manager's short default ceiling. */ mcpStartupTimeoutMs?: number; /** * The broker-issued readiness intent from this session's launch request. * `deferred` prepares the session: it holds endpoint authority and publishes * a prepared signal instead of readiness until it is explicitly activated. */ readiness?: "immediate" | "deferred"; }; /** Internal lifecycle-only session construction with an owner-bound SDK startup result. */ export declare function createLifecycleAgentSession(options?: CreateLifecycleAgentSessionOptions): Promise;