import type { ToolInput } from "../io/input-types";
import type { ToolProgress } from "./plugin-types";
import type { ToolResult } from "../io/output-types";

export interface ToolWorkerRequest<TOptions = unknown> {
  type: "run";
  id: string;
  input: ToolInput;
  options: TOptions;
}

export type ToolWorkerResponse =
  | {
      type: "progress";
      id: string;
      progress: ToolProgress;
    }
  | {
      type: "success";
      id: string;
      result: ToolResult;
    }
  | {
      type: "error";
      id: string;
      error: string;
    };
