import { type LocalAppMetadata, type RemoteAppMetadata } from '../metadata';
import { type RawMetadataShape } from '../types';
import { tokenFactory } from './base.tokens';

export const FrontMcpLocalAppTokens: RawMetadataShape<LocalAppMetadata> = {
  type: tokenFactory.type('app'),
  auth: tokenFactory.meta('auth'),
  id: tokenFactory.meta('id'),
  name: tokenFactory.meta('name'),
  description: tokenFactory.meta('description'),
  providers: tokenFactory.meta('providers'),
  authProviders: tokenFactory.meta('authProviders'),
  plugins: tokenFactory.meta('plugins'),
  adapters: tokenFactory.meta('adapters'),
  tools: tokenFactory.meta('tools'),
  resources: tokenFactory.meta('resources'),
  prompts: tokenFactory.meta('prompts'),
  agents: tokenFactory.meta('agents'),
  skills: tokenFactory.meta('skills'),
  jobs: tokenFactory.meta('jobs'),
  workflows: tokenFactory.meta('workflows'),
  channels: tokenFactory.meta('channels'),
  output: tokenFactory.meta('output'),
  standalone: tokenFactory.meta('standalone'),
  // Captured call-site dir (#469) — anchors auth.ui relative paths for splitByApp.
  __sourceDir: tokenFactory.meta('__sourceDir'),
} as const;

export const FrontMcpRemoteAppTokens: RawMetadataShape<RemoteAppMetadata> = {
  type: tokenFactory.type('app'),
  auth: tokenFactory.meta('auth'),
  id: tokenFactory.meta('id'),
  name: tokenFactory.meta('name'),
  description: tokenFactory.meta('description'),
  urlType: tokenFactory.meta('urlType'),
  url: tokenFactory.meta('url'),
  namespace: tokenFactory.meta('namespace'),
  transportOptions: tokenFactory.meta('transportOptions'),
  remoteAuth: tokenFactory.meta('remoteAuth'),
  refreshInterval: tokenFactory.meta('refreshInterval'),
  cacheTTL: tokenFactory.meta('cacheTTL'),
  packageConfig: tokenFactory.meta('packageConfig'),
  filter: tokenFactory.meta('filter'),
  standalone: tokenFactory.meta('standalone'),
} as const;
