var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import { createFetchSkillTool } from "./fetchSkill.js";
import { createFetchToolSchemaTool } from "./fetchToolSchema.js";
import { createApiTool } from "./apiTool.js";
import { createGetUserLocationTool } from "./getUserLocation.js";
export const ALWAYS_AVAILABLE_API_TOOL_NAMES = ["get_resource"];
export function createAgentTools(customComponentsDir, apiBasedTools) {
    return __awaiter(this, void 0, void 0, function* () {
        return [
            ...ALWAYS_AVAILABLE_API_TOOL_NAMES.map((toolName) => {
                const apiBasedTool = apiBasedTools[toolName];
                if (!apiBasedTool) {
                    throw new Error(`Required base API tool "${toolName}" is missing.`);
                }
                return createApiTool(toolName, apiBasedTool);
            }),
            createGetUserLocationTool(),
            yield createFetchSkillTool(customComponentsDir),
            yield createFetchToolSchemaTool(apiBasedTools),
        ];
    });
}
