import type { DriverTarget } from "@skaile/workspaces/plugin-registry"; import { type AgentConfig, AgentDriver, type BridgeCapabilityTool, type DriverInfo } from "../types.js"; /** * Echo/mock driver for E2E testing in docker mode. * * Runs inside a real Docker container with real WebSocket transport and * session lifecycle, but generates deterministic keyword-triggered responses * instead of calling the Anthropic API. This lets E2E tests exercise the * full infrastructure (containers, WebSocket, session management, message * persistence) without needing real AI credentials. * * Keyword triggers match the MockAgentClient in * `platform/backend/libs/agent-gateway/src/mock-agent-client.ts` — the * same test messages ("test toolcall", "test question", etc.) produce * the same events. * * Enable by setting `SKAILE_AGENT_DRIVER=echo` in the container env, * or by passing `{ driver: 'echo' }` in the runner config. * * @docLink packages/bridge/drivers#echo-driver */ export declare class EchoDriver extends AgentDriver { readonly driverInfo: DriverInfo; private readonly log; private running; private readonly config; /** * Scripted-flow mode state (workspaces#396). Enabled by a `[test-flow]` * sentinel chat message; once on, orchestrator-prompt turns are driven * deterministically against `config.flowTestDriver`. `null` script ⇒ mode * off (default echo behaviour, unchanged). */ private flowScript; constructor(config: AgentConfig); /** * Test surface: returns the tool list the LLM would see for this turn. * Composition: the registry hooks (Protocol v2) take precedence; legacy * `mcpServers` is not enumerated here (the echo driver never exposed MCP * tools to the LLM by name). */ listCapabilityTools(): BridgeCapabilityTool[]; /** * Test surface: invoke a registered capability through the dispatch * helper. Mirrors what a real driver would do when the LLM produced a * tool_use for the given name — applies fire-and-forget, render emission, * and fallback text. Returns the structured dispatch result so tests can * assert immediate-vs-background resolution. */ invokeCapabilityForTest(name: string, input: unknown): Promise<{ result: unknown; background: boolean; }>; start(): Promise; prompt(message: string): Promise; /** * Phase 7B helper — drive a single capability through the dispatcher and * surface the structured outcome as a result event the LLM-side test code * can assert against. Used exclusively by the `[test-cap:]` prompt * keyword above; never wired into normal chat flow. */ private runCapabilityKeyword; /** * Scripted-flow turn (workspaces#396). Reads the live flow state via the * runner-injected `flowTestDriver` hook and executes the scripted next * action(s) until the policy yields or emits a turn-ending action. Each * mutation fires the adapter's `onChange` (→ host `state_changed`) and, when * the runner wires the stimulus bus, queues the follow-up turn — so the * driver advances one step at a time exactly like a real LLM orchestrator. */ private runScriptedFlowTurn; abort(): Promise; kill(): void; resetSession(): Promise; get isRunning(): boolean; } /** * `DriverTarget` wrapper for the echo driver. Registered into the plugin * registry by `registerBuiltinDrivers()`. */ export declare const echoDriverTarget: DriverTarget; //# sourceMappingURL=echo.d.ts.map