import type { PDRuntimeAdapter, RuntimeKind, RuntimeCapabilities, RuntimeHealth, RunHandle, RunStatus, StartRunInput, StructuredRunOutput, RuntimeArtifactRef, ContextItem } from '../runtime-protocol.js'; import type { RefinerRuleHostGateDeps } from '../internalization/refiner-rulehost-gate.js'; import type { ArtificerValidator } from '../internalization/artificer-output.js'; import type { StoreEventEmitter } from '../store/event-emitter.js'; export interface ArtificerL2AdapterConfig { /** Provider id (e.g. 'openai', 'anthropic'). */ readonly provider: string; /** Model id. */ readonly model: string; /** Env var name holding the API key. */ readonly apiKeyEnv: string; /** Optional custom base URL (OpenAI-compatible endpoints). */ readonly baseUrl?: string; /** Sandbox replay deps (real or test double). */ readonly gateDeps: RefinerRuleHostGateDeps; /** Artificer output validator (used by submit_rulecode). */ readonly validator: ArtificerValidator; /** Max agent-loop turns before forced stop (default 8). */ readonly maxTurns?: number; /** Total wall-clock budget for the whole loop in ms (default 300_000). */ readonly totalBudgetMs?: number; /** Max output tokens per LLM call (default 8192). */ readonly maxTokens?: number; /** * PRI-795: optional pi-ai reasoning/thinking level from the runtime profile. * Forwarded into the loop's stream options so always-thinking models (e.g. * zai glm-5.3-flash) get a bounded thinking level instead of their most * expensive default. `false` explicitly disables reasoning. Mirrors the * PiAiRuntimeAdapter config field (profile contract, pd-config-types.ts). */ readonly reasoning?: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | false; /** Optional event emitter; defaults to the shared singleton. */ readonly eventEmitter?: StoreEventEmitter; /** * PRI-633: optional profile-level system prompt (append layer, DPB-07). * Appended AFTER the run's base-layer systemPrompt and the Artificer L2 * tool protocol in agentContext.systemPrompt. Omitted when unset. */ readonly systemPrompt?: string; } export declare class ArtificerL2Adapter implements PDRuntimeAdapter { private readonly config; private readonly gateDeps; private readonly validator; private readonly eventEmitter; private readonly runs; private readonly abortControllers; /** * PRI-795 (review P1): FIRST-WRITER-WINS abort ownership. Both the budget * timer and cancelRun can abort the same controller, and a cancel may be * followed by a slow stream exit that lets the budget timer fire afterwards * — a fixed budget-first precedence would then record a manual cancel as a * budget timeout. Whoever claims FIRST becomes the authoritative owner; * later aborters never overwrite the claim. */ private readonly abortOwners; constructor(config: ArtificerL2AdapterConfig); kind(): RuntimeKind; getCapabilities(): Promise; refreshCapabilities(): Promise; healthCheck(): Promise; startRun(input: StartRunInput): Promise; pollRun(runId: string): Promise; cancelRun(runId: string): Promise; fetchOutput(runId: string): Promise; fetchArtifacts(_runId: string): Promise; appendContext(_runId: string, _items: ContextItem[]): Promise; private runHandle; private emitComplete; private evictOldRuns; } //# sourceMappingURL=artificer-l2-adapter.d.ts.map