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";
import { createNavigateUserTool } from "./navigateUser.js";
export const ALWAYS_AVAILABLE_API_TOOL_NAMES = ["get_resource"];
export function createAgentTools(customComponentsDir_1, apiBasedTools_1) {
    return __awaiter(this, arguments, void 0, function* (customComponentsDir, apiBasedTools, pluginCustomFolderPaths = []) {
        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(),
            createNavigateUserTool(),
            yield createFetchSkillTool(customComponentsDir, pluginCustomFolderPaths),
            yield createFetchToolSchemaTool(apiBasedTools),
        ];
    });
}
