import { TEST_GIVEN_ENDPOINT_COMPREHENSIVELY_COMMAND } from "./testThisEndpointCommand.js";
import { FULLREPO_RECOMMEND_GENERATE_EXECUTE_TOPN_TESTS_COMMAND } from "./recommendTestsAndExecuteCommand.js";
/**
 * To add a new predefined workflow:
 * 1. Add a new id to OneClickCommandId in types/OneClickCommands.ts
 * 2. Create a new file in commands/ (e.g. myWorkflowCommand.ts) with steps and export the command
 * 3. Import the command here and add it to COMMAND_LIBRARY
 * 4. The generic buildWorkflowFromCommand() will render detailed instructions from your steps
 *    (no schema changes needed in oneClickTool.ts — the workflow param description is generated dynamically)
 */
/** All predefined one-click commands */
const COMMAND_LIBRARY = {
    test_given_endpoint_comprehensively: TEST_GIVEN_ENDPOINT_COMPREHENSIVELY_COMMAND,
    full_repo_scan_recommend_generate_and_execute_top_n_tests: FULLREPO_RECOMMEND_GENERATE_EXECUTE_TOPN_TESTS_COMMAND,
};
export function getCommand(id) {
    const cmd = COMMAND_LIBRARY[id];
    if (!cmd) {
        throw new Error(`Unknown one-click command: ${id}`);
    }
    return cmd;
}
export function getAllCommands() {
    return Object.values(COMMAND_LIBRARY);
}
export function getCommandIds() {
    return Object.keys(COMMAND_LIBRARY);
}
/**
 * Look up a command by its string ID. Accepts any string so the tool handler
 * does not need to cast; throws with a helpful message listing valid IDs if
 * the ID is not found.
 */
export function lookupCommand(id) {
    const cmd = COMMAND_LIBRARY[id];
    if (!cmd) {
        const available = getCommandIds().join(", ");
        throw new Error(`Unknown workflow: "${id}". Valid workflow IDs: ${available}.`);
    }
    return cmd;
}
// Re-export commands for consumers that import from commandLibrary
export { TEST_GIVEN_ENDPOINT_COMPREHENSIVELY_COMMAND } from "./testThisEndpointCommand.js";
export { FULLREPO_RECOMMEND_GENERATE_EXECUTE_TOPN_TESTS_COMMAND } from "./recommendTestsAndExecuteCommand.js";
