/**
 * sources.ts — Documentation source definitions for AILF evaluations.
 *
 * Default sources (production, branch, local) are provided by the
 * sanity-literacy preset registered in the composition root. This file
 * exists as an override point — any sources defined here are merged with
 * (and take precedence over) preset-provided sources.
 *
 * To add a custom source, define it here:
 *
 *   export default defineSources([
 *     { name: "my-docs", baseUrl: "https://docs.example.com", ... },
 *   ])
 *
 * @see packages/eval/src/pipeline/compiler/presets/sanity-literacy.ts
 * @see docs/archive/exec-plans/dynamic-doc-sources.md
 */

import { defineSources } from "@sanity/ailf-core"
import { defineGoogleDriveSource } from "@sanity/ailf/adapters/google-drive"

export default defineSources([
  // Google Drive source: workbench-docs.
  //
  // Run it on demand with `--source workbench-docs` (CLI or workflow_dispatch).
  // The `weekly-workbench` cron that runs it automatically lands with W0221.
  //
  // The folder lives in a Shared Drive, so the service account
  // `ailf-drive-reader@sanity-it.iam.gserviceaccount.com` has to be a *member* of
  // that Shared Drive (Drive UI → Manage Members) — per-folder sharing won't work,
  // because the sanity.io Workspace blocks external sharing to non-`@sanity.io`
  // identities.
  // Folder: https://drive.google.com/drive/folders/1ec0egGR308B8ukMMdlDgdTB7I91gty5L
  //
  // The adapter reads credentials in this order:
  //   1. AILF_GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON — raw JSON (default: 1Password locally, repo secret in CI)
  //   2. AILF_GOOGLE_DRIVE_SERVICE_ACCOUNT_PATH — file path (ad-hoc dev without 1Password)
  //   3. GOOGLE_APPLICATION_CREDENTIALS — Google ADC fallback
  defineGoogleDriveSource({
    name: "workbench-docs",
    rootFolderId: "1ec0egGR308B8ukMMdlDgdTB7I91gty5L",
  }),
])
