/**
 * Schema helpers shared by the tool definition. `stringEnum` reproduces the shape pi's `StringEnum`
 * helper produces — a plain `enum` schema rather than `anyOf`/`const`, which some providers reject —
 * without importing a harness-specific package.
 */

import { Type } from "typebox";

export function stringEnum<T extends readonly string[]>(values: T, description?: string) {
  return Type.Unsafe<T[number]>({
    type: "string",
    enum: [...values],
    ...(description === undefined ? {} : { description }),
  });
}
