export * from './hooks';
export * from './channels';
// For the shell: a screen naming itself better than its route can — see usePageTitle's precedence.
export { usePageTitleOverride, usePublishPageTitle } from './page-title';
export type { PageTitleOverride } from './page-title';
export * from './AppRegistry';
export * from './WidgetRegistry';
export * from './MusicPlayer';

// Re-export app modules (excluding appRegistryMetas to avoid name collisions)
export {
  MessageList,
  MessageBubble,
  StreamingBubble,
  ToolActivity,
  QuestionActivity,
  ModelSelector,
  InputArea,
  ChatLauncher,
  ChatPanelWrapper,
  AttachmentList,
  AttachButton,
  WebpageDialog,
  EmbeddableChat,
  useChat,
  useSlashCommands,
  useAttachments,
  useAudioRecording,
} from './apps/Chat';
export type { UseEmbeddableChatType, UseChatType, UseAttachmentsType, UseAudioRecordingType } from './apps/Chat';
export * from './apps/Chat/types';
export { SessionList, ChatDetailPanel } from './apps/ChatHistory';
export type { SelectedSession } from './apps/ChatHistory';
// The chat URL vocabulary, so the /chat screen, the panels and the server all spell a group the same way.
export { chatListPath, chatNewPath, chatSessionPath, cwdFromSplat, GROUP_SEGMENT } from './apps/ChatHistory';
export { CodeEditorView } from './apps/CodeEditor';
// Same for /photos.
export { DEFAULT_PHOTOS_SECTION, photosSectionPath, isPhotosSection } from './apps/Photos/shared';
export type { PhotosSectionId } from './apps/Photos/shared';

// Same for /jellyfin.
export { DEFAULT_JELLYFIN_SECTION, jellyfinSectionPath, isJellyfinSection } from './apps/Jellyfin/shared';
export type { JellyfinSectionId } from './apps/Jellyfin/shared';

// Same for /soulseek, which also puts the open peer in `?user=`.
export {
  DEFAULT_SOULSEEK_SECTION,
  soulseekSectionPath,
  soulseekUserPath,
  isSoulseekSection,
} from './apps/Soulseek/shared';
export type { SoulseekSectionId } from './apps/Soulseek/shared';

// Same for /system-monitor, where the param is the scope rather than a section.
export { DEFAULT_MONITOR_SCOPE, monitorScopePath, isMonitorScope } from './apps/SystemMonitor/shared';
export type { MonitorScope } from './apps/SystemMonitor/shared';

// Same for /transmission.
export {
  DEFAULT_TRANSMISSION_SECTION,
  transmissionSectionPath,
  isTransmissionSection,
} from './apps/Transmission/shared';
export type { TransmissionSectionId } from './apps/Transmission/shared';

// Same for /gitea.
export {
  DEFAULT_GITEA_REPO_TAB,
  DEFAULT_GITEA_SECTION,
  giteaRepoPath,
  giteaSectionPath,
  isGiteaRepoTab,
  isGiteaSection,
} from './apps/Gitea/shared';
export type { GiteaRepoTab, GiteaSectionId } from './apps/Gitea/shared';

// /calendar and /contacts select with a query param rather than a path segment, so what the screens need
// from the app is the param name and the link builder.
export { COLLECTION_PARAM, davCollectionPath } from './apps/Dav/shared';
export type { DavCollection, CalendarEvent, DavContact } from './apps/Dav/shared';

// Same for /invoices.
export { DEFAULT_INVOICES_SECTION, invoicesSectionPath, isInvoicesSection } from './apps/Invoices/shared';
export type { InvoicesSectionId } from './apps/Invoices/shared';

// Same for /wallet. WALLET_PARAM is exported too so anything linking into the screen from outside spells
// the wallet query param the same way the panels read it.
export { DEFAULT_WALLET_SECTION, walletSectionPath, isWalletSection, WALLET_PARAM } from './apps/Wallet/shared';
export type { WalletSectionId } from './apps/Wallet/shared';
export {
  useFilesAPI,
  useTasks,
  useRecentFiles,
  usePinnedFiles,
  FileBrowserApp,
  FileBrowserPanelWrapper,
  FileBrowserWidget,
  TaskRunnerModal,
} from './apps/FileBrowser';
export type { DirEntry, TaskSummary } from './apps/FileBrowser';
export {
  FileViewerView,
  FileViewerProvider,
  FileViewerHeader,
  FileViewerBody,
  useFileViewer,
  getFileType,
  getLang,
  getExt,
  getArchiveBaseName,
  ARCHIVE_EXTS,
} from './apps/FileViewer';
export type { FileType } from './apps/FileViewer';
// The scrubber, shared by the FileViewer's audio/video renderers, the global player bar and the /music
// panels in `plugins/music/`. On the barrel rather than reached for by subpath because the package's
// `"./*"` export maps to `.ts` only, and this is a `.tsx`.
export { SeekBar, useSeekBar } from './apps/FileViewer/renderers/SeekBar';
export { TerminalView } from './apps/Terminal';
export type { TerminalViewProps } from './apps/Terminal';
export { DesktopView } from './apps/Desktop';
export type { DesktopViewProps } from './apps/Desktop';
export {
  DashboardListApp,
  DashboardPreview,
  CREATING_DASHBOARD_KEY,
  EDITING_DASHBOARD_KEY,
  NEW_DASH_NAME_KEY,
  NEW_DASH_DESC_KEY,
  NEW_DASH_TEMPLATE_KEY,
} from './apps/Dashboards';
export { resolveIcon, availableIconNames } from './utils/resolve-icon';

// Workspace
export { WorkspaceView, WorkspaceLayout, WorkspaceProvider, useWorkspace } from './components/Workspace';
// For the app shell: a fullscreen panel takes the window, so the nav header has to get out of its way.
export { usePanelFullscreen } from './components/Workspace';
export {
  createDefaultLayout,
  splitPanel,
  removePanel,
  setApp,
  updateSizes,
  swapPanels,
  movePanel,
  pruneEmptyPanels,
  countPanels,
  hasAnyApp,
} from './components/Workspace';
export type {
  LayoutNode,
  LayoutGroup,
  LayoutPanel,
  DashboardDefinition,
  DashboardState,
  AppRegistryMap,
  AppRegistryEntry,
  PanelComponents,
  PanelComponentEntry,
  EphemeralPanels,
  DropPosition,
  HomeRoot,
} from './components/Workspace';

// App store — install, enable and remove the sidecars this server runs.
export { AppStoreList, AppStoreDetail, useAppStore } from './apps/AppStore';
export type { StoreItem as AppStoreItem } from './apps/AppStore';
