/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 9fb55ce3d993
 */

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * Not typed since mcp config can changed / not stable
 *
 * @remarks
 * we allow all extra fields and this is a dict
 * TODO: once mcp is stable, we need to type this
 */
export type ExecutionConfig = {
  type: string;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const ExecutionConfig$inboundSchema: z.ZodType<
  ExecutionConfig,
  unknown
> = z.object({
  type: z.string(),
}).catchall(z.any());

export function executionConfigFromJSON(
  jsonString: string,
): SafeParseResult<ExecutionConfig, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ExecutionConfig$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ExecutionConfig' from JSON`,
  );
}
