import { WakeQueueService, type WakeQueueEnqueueResult } from '../../inbox/wake-queue.service.js'; import type { InboxItem, InboxItemStatus, MemoryCoherenceInboxItem } from '../../../shared/inbox.js'; import type { AgentRuntime, AgentRuntimeCloseOptions, AgentRuntimeDrainInput, AgentRuntimeInput, AgentRuntimeResult, AgentRuntimeFollowupInput } from '../../providers/contract.js'; import type { RuntimeWorkerConfig, RuntimeItemContext } from '../../runtime/types.js'; type TestInboxDecision = WakeQueueEnqueueResult & { ctx: RuntimeItemContext; }; export declare function enqueueInbox(event: InboxItem, options: RuntimeWorkerConfig): Promise; export declare const queueFor: (agentId: string) => WakeQueueService; export declare function ensureTestAgentConfig(options: RuntimeWorkerConfig): Promise; export declare function memoryCoherenceCoordinator(stateDir: string): RuntimeWorkerConfig; export declare function prepareMemoryCoherenceHome(options: RuntimeWorkerConfig): Promise; export declare class NullReadEnqueueQueue extends WakeQueueService { private readonly shouldInject; private readonly injectedItem; redrainEmptyChecks: number; private injected; constructor(agentId: string, shouldInject: () => boolean, injectedItem: InboxItem); takeNextRunnable(input: Parameters[0]): Promise; } /** * Holds after the store claims a primary item so tests can flip intakePaused * mid-flight (config-reload race). */ export declare class DeferredPrimaryClaimQueue extends WakeQueueService { readonly claimedIds: string[]; private releaseClaim; private claimGate; private holdNextClaim; takeNextRunnable(input: Parameters[0]): Promise; releaseHeldClaim(): void; } /** * Holds after claiming a follow-up batch so tests can flip intakePaused before * the worker returns from takeFollowupBatch. */ export declare class DeferredFollowupClaimQueue extends WakeQueueService { readonly claimedBatches: string[][]; private releaseBatch; private batchGate; private holdNextBatch; takeFollowupBatch(input: Parameters[0]): Promise; releaseHeldBatch(): void; } export declare class ControlledRuntime implements AgentRuntime { readonly env?: Record | undefined; readonly kind = "controlled"; readonly calls: AgentRuntimeInput[]; completed: number; private readonly resolvers; constructor(env?: Record | undefined); run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; close(): Promise; finishNext(): void; } export declare class StaticTextRuntime implements AgentRuntime { private readonly text; readonly kind = "static-text"; constructor(text: string); run(_input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class ToolActivityRuntime implements AgentRuntime { private readonly text; private readonly toolCalls; readonly kind = "tool-activity"; constructor(text: string, toolCalls: Record[]); run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class MemoryWritingRuntime implements AgentRuntime { private readonly text; private readonly writes; private readonly toolCalls; readonly kind = "memory-writing"; constructor(text: string, writes: Array<{ path: string; tempPath?: string; text: string; }>, toolCalls?: Record[]); run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class CloseOptionsRuntime implements AgentRuntime { readonly kind = "close-options"; readonly closeOptions: Array; run(_input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; close(options?: AgentRuntimeCloseOptions): Promise; } export declare class FollowupRuntime extends ControlledRuntime { readonly followups: AgentRuntimeFollowupInput[]; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; text: string; }>; } export declare class FailingFollowupRuntime implements AgentRuntime { readonly kind = "failing-followup"; readonly calls: AgentRuntimeInput[]; readonly followups: AgentRuntimeFollowupInput[]; private readonly rejecters; run(input: AgentRuntimeInput): Promise; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; text: string; }>; close(): Promise; failNext(): void; } export declare class RejectingFollowupRuntime extends ControlledRuntime { readonly followups: AgentRuntimeFollowupInput[]; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class ThrowingFollowupRuntime extends ControlledRuntime { readonly followups: AgentRuntimeFollowupInput[]; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class NotReadyFollowupRuntime extends ControlledRuntime { readonly followups: AgentRuntimeFollowupInput[]; attempts: number; ready: boolean; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; retryable?: boolean; text?: string; }>; } export declare function waitForInboxItemStatus(agentId: string, itemId: string, status: InboxItemStatus, timeoutMs?: number): Promise; export declare function waitForInboxItemRemoved(agentId: string, itemId: string, timeoutMs?: number): Promise; export declare function waitForInboxItemAppendedTo(agentId: string, itemId: string, parentItemId: string, timeoutMs?: number): Promise; export declare function seedReminder(agentId: string, reminderId: string, timestamp: string): Promise; export declare function makeMemoryCoherenceInboxItem(input: { scheduledSlotAt: string; timestamp: string; }): MemoryCoherenceInboxItem; export declare const silentLogger: { error: () => void; log: () => void; }; export declare class AbortableRuntime implements AgentRuntime { readonly kind = "abortable"; readonly calls: AgentRuntimeInput[]; run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class DrainableRuntime extends AbortableRuntime { readonly drainCalls: AgentRuntimeDrainInput[]; requestDrain(input: AgentRuntimeDrainInput): Promise; } export declare class ActivityBeforeFinishRuntime implements AgentRuntime { readonly kind = "activity-runtime"; readonly calls: AgentRuntimeInput[]; run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class CrashThenSuccessRuntime implements AgentRuntime { private readonly failuresBeforeSuccess; readonly kind = "codex-cli"; readonly calls: AgentRuntimeInput[]; constructor(failuresBeforeSuccess: number); run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export declare class FatalProviderRuntime implements AgentRuntime { private readonly message; readonly kind = "claude-code"; readonly calls: AgentRuntimeInput[]; constructor(message?: string); run(input: AgentRuntimeInput): Promise; appendToActiveRun(_input: AgentRuntimeFollowupInput): Promise<{ accepted: boolean; }>; } export {}; //# sourceMappingURL=runtime-worker.d.ts.map