import { BaseSubgraph } from "@powerhousedao/reactor-api";
import { schema } from "./schema.js";
import { createResolvers } from "./resolvers.js";
import { up } from "./db/migrations.js";
/**
 * Binds a user's Renown identity to the GitHub App installation they own, and
 * brokers short-lived installation push tokens for the agent. Owns its own
 * relational table in an isolated namespace; every resolver is keyed off the
 * gateway-verified caller DID. App secrets (private key, client secret) are
 * read from the environment by `github-app.ts`, never stored here.
 */
export class VetraGithubAuthSubgraph extends BaseSubgraph {
    name = "vetra-github-auth";
    typeDefs = schema;
    resolvers = {};
    additionalContextFields = {};
    async onSetup() {
        const db = (await this.relationalDb.createNamespace("vetra-github-auth"));
        await up(db);
        this.resolvers = createResolvers(db);
    }
}
