import { WorkspaceProviderAuthMode } from '@/enums/workspace-provider-auth-mode.enum';
import type { ProviderAppConfigFormValues } from '@/types';

/**
 * Set of provider keys that have a real backend adapter implementation.
 * Those NOT in this set are registered in the Provider Registry (so the
 * UI can show them) but attempting to use them for sync/write raises
 * `ADAPTER_NOT_IMPLEMENTED` (501) from the backend.
 *
 * Keep in sync with `NOT_IMPLEMENTED_PROVIDERS` in
 * `apps/claw-workspace-service/src/modules/workspace/adapters/workspace-adapter.factory.ts`.
 */
export const IMPLEMENTED_WORKSPACE_ADAPTERS: ReadonlySet<string> = new Set([
  'GITHUB',
  'GITLAB',
  'BITBUCKET',
  'SLACK',
  'JIRA',
  'CONFLUENCE',
  'GOOGLE_DRIVE',
  'GMAIL',
  'MICROSOFT_SHAREPOINT',
  'MICROSOFT_ONEDRIVE',
  'FIGMA',
  'CLICKUP',
]);

export const EMPTY_APP_CONFIG_FORM: ProviderAppConfigFormValues = {
  provider: '',
  name: '',
  description: '',
  authMode: WorkspaceProviderAuthMode.OAUTH2,
  publicConfig: {},
  secretConfig: {},
};

export const WORKSPACE_OAUTH_CALLBACK_PATH = '/workspace/oauth/callback';
