"use strict";
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2024-2026 Gracker (Chris)
// This file is part of SmartPerfetto. See LICENSE for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.__setQueryImplementation = __setQueryImplementation;
exports.__getQueryCalls = __getQueryCalls;
exports.__resetQueryMock = __resetQueryMock;
exports.query = query;
exports.tool = tool;
exports.createSdkMcpServer = createSdkMcpServer;
const queryCalls = [];
let queryImplementation;
async function* emptyGenerator() {
    // No-op in tests by default.
}
function withClose(iterable) {
    return Object.assign(iterable, { close: () => undefined });
}
/** Test helper for suites that need to inspect SDK query options. */
function __setQueryImplementation(impl) {
    queryImplementation = impl;
}
function __getQueryCalls() {
    return queryCalls;
}
function __resetQueryMock() {
    queryCalls.length = 0;
    queryImplementation = undefined;
}
/** Mock query function — returns an empty async generator unless a test overrides it. */
function query(options) {
    queryCalls.push(options);
    return withClose(queryImplementation ? queryImplementation(options) : emptyGenerator());
}
/** Mock tool() builder — returns the tool definition as-is. */
function tool(name, description, schema, handler) {
    return { name, description, schema, handler };
}
/** Mock createSdkMcpServer — returns a config object. */
function createSdkMcpServer(config) {
    return {
        type: 'sdk',
        name: config.name,
        instance: { name: config.name, version: config.version, tools: config.tools },
    };
}
//# sourceMappingURL=claude-agent-sdk.js.map