import type { Context } from '@deepseek-ai/cordis'; import type { Agent, AgentOptions } from '@deepseek-ai/dsh-agent'; import type { SessionEvent } from '@deepseek-ai/dsh-session'; import { type ObjectJsonSchema } from '@deepseek-ai/dsh-tools'; export type BackgroundResult = { stopReason: string; structured?: unknown; }; export interface BackgroundActivation { childId: string; name: string; result: Promise; dispose(): Promise; } type TextPart = { type: 'text'; text: string; }; export interface BackgroundActivationSpec { childId: string; parent: Agent; signal: AbortSignal; label: string; cwd: string; prompt: TextPart[]; outputSchema: ObjectJsonSchema; agentOptions?: Pick; seed?: readonly SessionEvent[]; authorize(): void; } export interface BackgroundAgentRuntime { startActivation(spec: BackgroundActivationSpec): Promise; resumeActivation?(spec: BackgroundActivationSpec): Promise; prepareResume?(childId: string, parent: Agent, signal: AbortSignal): Promise<{ childId: string; seed?: readonly SessionEvent[]; }>; sendMessage(parent: Agent, child: string, content: TextPart[], options: { signal: AbortSignal; }): Promise; close?(): void; } export declare function backgroundResult(events: readonly SessionEvent[]): BackgroundResult; /** Native subagents own execution and discovery; Partner owns its task manifest and delivery. */ export declare class PartnerBackgroundAgents implements BackgroundAgentRuntime { private readonly ctx; private native; private readonly disposers; private readonly seeds; private readonly admitting; private readonly active; private readonly resuming; private readonly deliveryOwners; constructor(ctx: Context); private runtime; private authorize; /** Preserve legacy raw-agent history through native seeded creation, without rewriting old logs. */ prepareResume(childId: string, parent: Agent, signal: AbortSignal): Promise<{ childId: string; seed?: never; } | { childId: string; seed: any; }>; startActivation(spec: BackgroundActivationSpec): Promise; resumeActivation(spec: BackgroundActivationSpec): Promise; private track; sendMessage(parent: Agent, child: string, content: TextPart[], { signal }: { signal: AbortSignal; }): Promise; private attachResumeManifest; close(): void; } export {}; //# sourceMappingURL=background-agent.d.ts.map