import { z } from "zod";
import { typedToolInputSchema } from "../schema.js";
const INSPECT_ENV_INPUT_SCHEMA = typedToolInputSchema(z.strictObject({}));
const INSPECT_ENV_ALLOWLIST = [
    "OPENAI_API_KEY",
    "SERPER_API_KEY",
    "OPENAI_MODEL",
    "TERMINAL_BENCH_MODEL",
    "OPENAI_BASE_URL",
];
const SECRET_ENV_NAMES = new Set(["OPENAI_API_KEY", "SERPER_API_KEY"]);
export function createInspectEnvTool() {
    return {
        description: "Inspect allowlisted environment metadata without reading dotenv or credential files. Secret values are reported only as set/unset.",
        effect: "read",
        executionClass: "read-only",
        idempotent: true,
        inputSchema: INSPECT_ENV_INPUT_SCHEMA,
        name: "inspect-env",
        source: "built-in",
        capabilities() {
            return [];
        },
        execute() {
            return INSPECT_ENV_ALLOWLIST.map((name) => {
                const value = process.env[name];
                if (SECRET_ENV_NAMES.has(name)) {
                    return `${name}=${value ? "[set]" : "[unset]"}`;
                }
                return `${name}=${value ? value : "[unset]"}`;
            }).join("\n");
        },
    };
}
//# sourceMappingURL=inspect-env.js.map