import type { WorkbenchApplication, WorkbenchTemporalGateway } from "./contracts.ts";

export function createNativeTestTemporalGateway(application: WorkbenchApplication): WorkbenchTemporalGateway {
  return {
    async submit(input) {
      await application.dispatchTurn(input);
      return { workflowId: `native-workbench-turn-${input.traceId}`, workflowRunId: `native-${input.traceId}`, reused: false };
    },
    async cancel(input) {
      await application.cancelTurn(input);
      return { workflowId: `native-workbench-cancel-${input.traceId}`, workflowRunId: `native-cancel-${input.traceId}`, reused: false };
    },
    async close() {}
  };
}
