// apps/cli/src/templates/raxd-config.ts

export const raxdConfigTemplate =
  () => `// raxd.config.ts — Reactive Agents Daemon configuration
// Generated by: rax deploy init
// Docs: https://docs.reactiveagents.dev/

export default {
  topology: "single",

  storage: {
    // "sqlite" for dev/small deploys, "postgres" for production
    backend: process.env.DATABASE_URL ? "postgres" : "sqlite",
    postgres: { url: process.env.DATABASE_URL },
    sqlite: { path: "./data/memory.db" },
  },

  coordination: {
    // "none" for single instance, "pg-advisory-lock" for leader election
    backend: process.env.DATABASE_URL ? "pg-advisory-lock" : "none",
  },

  health: {
    enabled: true,
    port: parseInt(process.env.HEALTH_PORT ?? "3000"),
  },

  observability: {
    // "console" for dev, "otlp" for production collectors
    exporter: process.env.OTEL_ENDPOINT ? "otlp" : "console",
    otlp: { endpoint: process.env.OTEL_ENDPOINT },
  },
};
`;
