/** * Command Replay Tools - Action router for sequence recording and playback */ import { z } from 'zod'; import type { CommandRecorder } from '../command-recorder.js'; import type { ExecuteToolCall } from '../types.js'; export interface UnknownStepTool { /** 1-based step number, matching the numbering used in run results */ step: number; tool: string; suggestion?: string; } /** * Find sequence steps whose `tool` is not a registered tool name. * * Only NAMES are validated - step params are deliberately not checked against * the tools' zod schemas, because params legitimately contain interpolation * tokens ({{var:...}}, {{timestamp}}) that are only substituted at run time, * so a number-typed field can validly hold a string token at rest. */ export declare function findUnknownStepTools(commands: Array<{ tool?: unknown; }>, knownToolNames: string[]): UnknownStepTool[]; export declare function createReplayTools(commandRecorder: CommandRecorder, executeToolCall: ExecuteToolCall, getPageForConnection?: (connectionReason: string) => Promise, getConnectionPort?: (connectionReason: string) => Promise, /** * Lazy provider for the set of registered tool names, used to reject sequence * steps naming a nonexistent tool at create/load time (bug-010). Lazy because * the tool map is built after this factory runs. When omitted, tool names are * not validated (previous behaviour). */ getKnownToolNames?: () => string[]): { replay: { description: string; zodSchema: z.ZodObject<{ action: z.ZodEnum<["history", "create", "list", "get", "delete", "export", "load", "listSaved", "deleteSaved", "run", "runAll", "step", "finish", "insert", "addConditional", "declare", "status", "cancel", "repeat", "runFromLog", "recordInteraction"]>; limit: z.ZodOptional; name: z.ZodOptional; description: z.ZodOptional; expectedOutcome: z.ZodOptional; startUrl: z.ZodOptional; baseUrl: z.ZodOptional; indices: z.ZodOptional>; lines: z.ZodOptional>; sequenceId: z.ZodOptional; runId: z.ZodOptional; wait: z.ZodOptional; global: z.ZodOptional; format: z.ZodOptional>; filename: z.ZodOptional; intoHistory: z.ZodOptional; connectionReason: z.ZodOptional; requiredConnections: z.ZodOptional; url: z.ZodOptional; role: z.ZodOptional; forceNewInstance: z.ZodOptional; }, "strict", z.ZodTypeAny, { reference: string; profile?: string | undefined; url?: string | undefined; forceNewInstance?: boolean | undefined; role?: string | undefined; }, { reference: string; profile?: string | undefined; url?: string | undefined; forceNewInstance?: boolean | undefined; role?: string | undefined; }>, "many">>; tags: z.ZodOptional>; requiredSockets: z.ZodOptional>; connections: z.ZodOptional>; record: z.ZodOptional; variables: z.ZodOptional>; stepTimeout: z.ZodOptional; totalTimeout: z.ZodOptional; startFrom: z.ZodOptional; stepTo: z.ZodOptional; stepCount: z.ZodOptional; insertIndices: z.ZodOptional>; insertAfterStep: z.ZodOptional; condition: z.ZodOptional; thenSequence: z.ZodOptional; comment: z.ZodOptional; overwrite: z.ZodOptional; newName: z.ZodOptional; showOverlay: z.ZodOptional; simplifyEvents: z.ZodOptional; includeHovers: z.ZodOptional; outputFormat: z.ZodOptional>; preferCoordinates: z.ZodOptional; preferSelectors: z.ZodOptional; issueId: z.ZodOptional; issueType: z.ZodOptional>; issueTitle: z.ZodOptional; showReplayOverlay: z.ZodOptional; showAll: z.ZodOptional; requireSockets: z.ZodOptional; strict: z.ZodOptional>; folder: z.ZodOptional; continueOnFailure: z.ZodOptional; killChromeOnFinish: z.ZodOptional; }, "strict", z.ZodTypeAny, { action: "status" | "repeat" | "run" | "list" | "get" | "step" | "load" | "create" | "cancel" | "history" | "delete" | "export" | "listSaved" | "deleteSaved" | "runAll" | "finish" | "insert" | "addConditional" | "declare" | "runFromLog" | "recordInteraction"; global?: boolean | undefined; strict?: "errors" | "warnings" | undefined; variables?: Record | undefined; name?: string | undefined; wait?: boolean | undefined; lines?: number[] | undefined; startUrl?: string | undefined; filename?: string | undefined; record?: boolean | undefined; comment?: string | undefined; description?: string | undefined; expectedOutcome?: string | undefined; connectionReason?: string | undefined; condition?: string | undefined; limit?: number | undefined; stepTimeout?: number | undefined; totalTimeout?: number | undefined; stepTo?: number | undefined; baseUrl?: string | undefined; includeHovers?: boolean | undefined; preferCoordinates?: boolean | undefined; preferSelectors?: boolean | undefined; stepCount?: number | undefined; indices?: number[] | undefined; sequenceId?: string | undefined; runId?: string | undefined; format?: "sequence" | "playwright" | "puppeteer" | undefined; intoHistory?: boolean | undefined; requiredConnections?: { reference: string; profile?: string | undefined; url?: string | undefined; forceNewInstance?: boolean | undefined; role?: string | undefined; }[] | undefined; tags?: string[] | undefined; requiredSockets?: string[] | undefined; connections?: Record | undefined; startFrom?: number | undefined; insertIndices?: number[] | undefined; insertAfterStep?: number | undefined; thenSequence?: string | undefined; overwrite?: boolean | undefined; newName?: string | undefined; showOverlay?: boolean | undefined; simplifyEvents?: boolean | undefined; outputFormat?: "playwright" | "puppeteer" | "events" | "commands" | "review" | undefined; issueId?: number | undefined; issueType?: "bug" | "feature" | undefined; issueTitle?: string | undefined; showReplayOverlay?: boolean | undefined; showAll?: boolean | undefined; requireSockets?: boolean | undefined; folder?: string | undefined; continueOnFailure?: boolean | undefined; killChromeOnFinish?: boolean | undefined; }, { action: "status" | "repeat" | "run" | "list" | "get" | "step" | "load" | "create" | "cancel" | "history" | "delete" | "export" | "listSaved" | "deleteSaved" | "runAll" | "finish" | "insert" | "addConditional" | "declare" | "runFromLog" | "recordInteraction"; global?: boolean | undefined; strict?: "errors" | "warnings" | undefined; variables?: Record | undefined; name?: string | undefined; wait?: boolean | undefined; lines?: number[] | undefined; startUrl?: string | undefined; filename?: string | undefined; record?: boolean | undefined; comment?: string | undefined; description?: string | undefined; expectedOutcome?: string | undefined; connectionReason?: string | undefined; condition?: string | undefined; limit?: number | undefined; stepTimeout?: number | undefined; totalTimeout?: number | undefined; stepTo?: number | undefined; baseUrl?: string | undefined; includeHovers?: boolean | undefined; preferCoordinates?: boolean | undefined; preferSelectors?: boolean | undefined; stepCount?: number | undefined; indices?: number[] | undefined; sequenceId?: string | undefined; runId?: string | undefined; format?: "sequence" | "playwright" | "puppeteer" | undefined; intoHistory?: boolean | undefined; requiredConnections?: { reference: string; profile?: string | undefined; url?: string | undefined; forceNewInstance?: boolean | undefined; role?: string | undefined; }[] | undefined; tags?: string[] | undefined; requiredSockets?: string[] | undefined; connections?: Record | undefined; startFrom?: number | undefined; insertIndices?: number[] | undefined; insertAfterStep?: number | undefined; thenSequence?: string | undefined; overwrite?: boolean | undefined; newName?: string | undefined; showOverlay?: boolean | undefined; simplifyEvents?: boolean | undefined; outputFormat?: "playwright" | "puppeteer" | "events" | "commands" | "review" | undefined; issueId?: number | undefined; issueType?: "bug" | "feature" | undefined; issueTitle?: string | undefined; showReplayOverlay?: boolean | undefined; showAll?: boolean | undefined; requireSockets?: boolean | undefined; folder?: string | undefined; continueOnFailure?: boolean | undefined; killChromeOnFinish?: boolean | undefined; }>; inputSchema: import("zod-to-json-schema").JsonSchema7Type & { $schema?: string | undefined; definitions?: { [key: string]: import("zod-to-json-schema").JsonSchema7Type; } | undefined; }; handler: (args: { action: "status" | "repeat" | "run" | "list" | "get" | "step" | "load" | "create" | "cancel" | "history" | "delete" | "export" | "listSaved" | "deleteSaved" | "runAll" | "finish" | "insert" | "addConditional" | "declare" | "runFromLog" | "recordInteraction"; global?: boolean | undefined; strict?: "errors" | "warnings" | undefined; variables?: Record | undefined; name?: string | undefined; wait?: boolean | undefined; lines?: number[] | undefined; startUrl?: string | undefined; filename?: string | undefined; record?: boolean | undefined; comment?: string | undefined; description?: string | undefined; expectedOutcome?: string | undefined; connectionReason?: string | undefined; condition?: string | undefined; limit?: number | undefined; stepTimeout?: number | undefined; totalTimeout?: number | undefined; stepTo?: number | undefined; baseUrl?: string | undefined; includeHovers?: boolean | undefined; preferCoordinates?: boolean | undefined; preferSelectors?: boolean | undefined; stepCount?: number | undefined; indices?: number[] | undefined; sequenceId?: string | undefined; runId?: string | undefined; format?: "sequence" | "playwright" | "puppeteer" | undefined; intoHistory?: boolean | undefined; requiredConnections?: { reference: string; profile?: string | undefined; url?: string | undefined; forceNewInstance?: boolean | undefined; role?: string | undefined; }[] | undefined; tags?: string[] | undefined; requiredSockets?: string[] | undefined; connections?: Record | undefined; startFrom?: number | undefined; insertIndices?: number[] | undefined; insertAfterStep?: number | undefined; thenSequence?: string | undefined; overwrite?: boolean | undefined; newName?: string | undefined; showOverlay?: boolean | undefined; simplifyEvents?: boolean | undefined; outputFormat?: "playwright" | "puppeteer" | "events" | "commands" | "review" | undefined; issueId?: number | undefined; issueType?: "bug" | "feature" | undefined; issueTitle?: string | undefined; showReplayOverlay?: boolean | undefined; showAll?: boolean | undefined; requireSockets?: boolean | undefined; folder?: string | undefined; continueOnFailure?: boolean | undefined; killChromeOnFinish?: boolean | undefined; }, abortSignal?: AbortSignal) => Promise; }; }; //# sourceMappingURL=replay-tools.d.ts.map