/** Shared session state + types used by both `get_tool_info` and `execute_tool`. */
import { Type } from '@sinclair/typebox';
export const EXECUTABLE_TOOL_NAMES = [
    'web_search',
    'web_crawl',
    'sandbox_llm',
    'create_website'
];
/** Build a non-empty executable-tool-name literal union for LLM schemas. */
export function executableToolNameLiteralUnion(values, options) {
    const [first, ...rest] = values;
    if (first === undefined) {
        throw new Error(`[${options.errorPrefix}] At least one executable tool must be available.`);
    }
    return rest.length === 0
        ? Type.Literal(first, { description: options.description })
        : Type.Union([Type.Literal(first), ...rest.map((name) => Type.Literal(name))], {
            description: options.description
        });
}
/** Construct an empty session-scoped fetched-set gate. */
export function createSessionToolInfoState() {
    const fetched = new Set();
    return {
        markFetched(tool_name) {
            fetched.add(tool_name);
        },
        hasFetched(tool_name) {
            return fetched.has(tool_name);
        },
        getFetched() {
            return new Set(fetched);
        }
    };
}
//# sourceMappingURL=shared.js.map