import betterAuth from "@convex-dev/better-auth/convex.config";
import workflow from "@convex-dev/workflow/convex.config.js";
import { defineApp } from "convex/server";
import { v } from "convex/values";

const app = defineApp({
  env: {
    AGENT_BACKEND_URL: v.optional(v.string()),
    FLUE_DB_TOKEN: v.string(),
    FLUE_URL: v.optional(v.string()),
    GITEA_TOKEN: v.optional(v.string()),
    GITEA_URL: v.optional(v.string()),
    GITHUB_CLIENT_ID: v.optional(v.string()),
    GITHUB_CLIENT_SECRET: v.optional(v.string()),
    GIT_CREDENTIAL_ENCRYPTION_KEY: v.optional(v.string()),
    NATIVE_APP_URL: v.optional(v.string()),
    SITE_URL: v.string(),
  },
});
app.use(betterAuth);
app.use(workflow);

export default app;
