"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const Stagehand = __importStar(require("@browserbasehq/stagehand"));
(0, vitest_1.describe)("LLM and Agents public API types", () => {
    (0, vitest_1.describe)("AISdkClient", () => {
        (0, vitest_1.it)("is exported", () => {
            (0, vitest_1.expect)(Stagehand.AISdkClient).toBeDefined();
        });
        (0, vitest_1.it)("extends LLMClient", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
        (0, vitest_1.it)("constructor accepts model parameter", () => {
            (0, vitest_1.expectTypeOf)().toEqualTypeOf();
        });
    });
    (0, vitest_1.describe)("AVAILABLE_CUA_MODELS", () => {
        const expectedModels = [
            "openai/computer-use-preview",
            "openai/computer-use-preview-2025-03-11",
            "anthropic/claude-3-7-sonnet-latest",
            "anthropic/claude-opus-4-5-20251101",
            "anthropic/claude-opus-4-6",
            "anthropic/claude-sonnet-4-6",
            "anthropic/claude-haiku-4-5-20251001",
            "anthropic/claude-sonnet-4-20250514",
            "anthropic/claude-sonnet-4-5-20250929",
            "google/gemini-2.5-computer-use-preview-10-2025",
            "google/gemini-3-flash-preview",
            "google/gemini-3-pro-preview",
            "microsoft/fara-7b",
        ];
        (0, vitest_1.it)("AvailableCuaModel matches the known literals", () => {
            (0, vitest_1.expectTypeOf)().toEqualTypeOf();
            void expectedModels; // Mark as used to satisfy ESLint
        });
    });
    (0, vitest_1.describe)("AgentProvider", () => {
        (0, vitest_1.it)("is exported", () => {
            (0, vitest_1.expect)(Stagehand.AgentProvider).toBeDefined();
        });
        (0, vitest_1.it)("has getClient method", () => {
            (0, vitest_1.expectTypeOf)().toBeCallableWith("test-model");
        });
        (0, vitest_1.it)("constructor accepts logger parameter", () => {
            (0, vitest_1.expectTypeOf)().toEqualTypeOf();
        });
    });
    (0, vitest_1.describe)("AnnotatedScreenshotText", () => {
        (0, vitest_1.it)("is a string literal", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
    (0, vitest_1.describe)("ConsoleMessage", () => {
        (0, vitest_1.it)("has correct public interface shape", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
    (0, vitest_1.describe)("AgentClient", () => {
        (0, vitest_1.it)("getClient returns object with expected methods", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
    (0, vitest_1.describe)("LLMClient", () => {
        (0, vitest_1.it)("has correct public interface shape", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
        (0, vitest_1.it)("constructor parameters match expected signature", () => {
            (0, vitest_1.expectTypeOf)().toEqualTypeOf();
        });
        (0, vitest_1.it)("createChatCompletion can be called with basic options", () => {
            (0, vitest_1.expectTypeOf)().toBeCallableWith({
                options: {
                    messages: [
                        {
                            role: "user",
                            content: "Hello",
                        },
                    ],
                },
                logger: () => { },
            });
        });
        (0, vitest_1.it)("createChatCompletion can be called with response_model", () => {
            const mockSchema = {};
            (0, vitest_1.expectTypeOf)().toBeCallableWith({
                options: {
                    messages: [
                        {
                            role: "user",
                            content: "Extract data",
                        },
                    ],
                    response_model: {
                        name: "extracted",
                        schema: mockSchema,
                    },
                },
                logger: () => { },
            });
        });
        (0, vitest_1.it)("createChatCompletion supports generic return type", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
        (0, vitest_1.it)("has additional methods", () => {
            // These methods exist on LLMClient but have complex signatures from the 'ai' library
            // We verify they exist by checking they're functions
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
    (0, vitest_1.describe)("modelToAgentProviderMap", () => {
        (0, vitest_1.it)("only stores valid provider types", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
    (0, vitest_1.describe)("Response", () => {
        (0, vitest_1.it)("has correct public interface shape", () => {
            (0, vitest_1.expectTypeOf)().toExtend();
        });
    });
});
//# sourceMappingURL=llm-and-agents.test.js.map