import { isAgentQuery } from "../agents.js";
function queryPredicate(agentName) {
    return (query) => isAgentQuery(query.json, agentName);
}
class AgentImpl {
    #schema;
    #agentName;
    #agent;
    constructor(parent, name, agent) {
        this.#schema = parent;
        this.#agentName = name;
        this.#agent = agent;
    }
    get name() {
        return this.#agentName;
    }
    getMutations() {
        return this.#schema.getLocalMutations().filter(queryPredicate(this.name));
    }
    getQueries() {
        return this.#schema.getLocalQueries().filter(queryPredicate(this.name));
    }
    get json() {
        return this.#agent;
    }
}
export function createAgent(parent, name, agent) {
    return new AgentImpl(parent, name, agent);
}
