import { sdk } from '../sdk'
import { setApiKey } from './setApiKey'
import { setLicense } from './setLicense'
import { setAdminPassword } from './setAdminPassword'
import { setAnthropicApiKey } from './setAnthropicApiKey'
import { setOpenAIApiKey } from './setOpenAIApiKey'
import { setOpenAICompatible } from './setOpenAICompatible'
import { setOllamaUrl } from './setOllamaUrl'
import { setWhisperEndpoint } from './setWhisperEndpoint'
import { setPodcastIndex } from './setPodcastIndex'
import { enableMultiTenantMode } from './enableMultiTenantMode'
import { setRecapPublicUrl } from './setRecapPublicUrl'
import { setTenantDefaultCredits } from './setTenantDefaultCredits'
import { setTrialCreditsPerVisitor } from './setTrialCreditsPerVisitor'
import { setTrialsPerIpPerDay } from './setTrialsPerIpPerDay'
import { setReplenishPeriod } from './setReplenishPeriod'
import { setRelayOperatorKey } from './setRelayOperatorKey'

// NOTE: setRelayUrl was removed in 0.2.34. The relay base URL is now
// hardcoded in server/relay-default.js and updated via Recap version
// releases — end users should never see or configure it.
//
// Multi-tenant cloud-mode actions (added 0.2.77) — these only matter
// when recap_mode === 'multi'. In single mode they're inert: the
// fields they manipulate exist in the config but nothing reads them.
export const actions = sdk.Actions.of()
  .addAction(setApiKey)
  .addAction(setAnthropicApiKey)
  .addAction(setOpenAIApiKey)
  .addAction(setOpenAICompatible)
  .addAction(setOllamaUrl)
  .addAction(setWhisperEndpoint)
  .addAction(setPodcastIndex)
  .addAction(setLicense)
  .addAction(setAdminPassword)
  .addAction(enableMultiTenantMode)
  .addAction(setRecapPublicUrl)
  .addAction(setTenantDefaultCredits)
  .addAction(setTrialCreditsPerVisitor)
  .addAction(setTrialsPerIpPerDay)
  .addAction(setReplenishPeriod)
  .addAction(setRelayOperatorKey)
