export const elements = {
  sessionList: document.querySelector("#session-list"),
  sessionCount: document.querySelector("#session-count"),
  sessionsToggle: document.querySelector("#sessions-toggle"),
  chatTitle: document.querySelector("#chat-title"),
  connectionStatus: document.querySelector("#connection-status"),
  messageList: document.querySelector("#message-list"),
  inspectorPanel: document.querySelector("#inspector-panel"),
  inspectorClose: document.querySelector("#inspector-close"),
  inspectorTitle: document.querySelector("#inspector-title"),
  inspectorSubtitle: document.querySelector("#inspector-subtitle"),
  inspectorBody: document.querySelector("#inspector-body"),
  composerForm: document.querySelector("#composer-form"),
  composerInput: document.querySelector("#composer-input"),
  approvalPanel: document.querySelector("#approval-panel"),
  approvalList: document.querySelector("#approval-list"),
  temporaryFileButton: document.querySelector("#temporary-file-button"),
  temporaryFileUpload: document.querySelector("#temporary-file-upload"),
  sessionFilesStrip: document.querySelector("#session-files-strip"),
  persistentRagToggle: document.querySelector("#persistent-rag-toggle"),
  newChatButton: document.querySelector("#new-chat-button"),
  refreshButton: document.querySelector("#refresh-button"),
  sidebarCollapseButton: document.querySelector("#sidebar-collapse-button"),
  sidebar: document.querySelector(".sidebar"),
  shell: document.querySelector(".shell"),
  clearMessagesButton: document.querySelector("#clear-messages-button"),
  hintText: document.querySelector("#hint-text"),
  errorText: document.querySelector("#error-text"),
  messageTemplate: document.querySelector("#message-template"),
  fileSelect: document.querySelector("#file-select"),
  fileEditor: document.querySelector("#file-editor"),
  saveFileButton: document.querySelector("#save-file-button"),
  reloadFileButton: document.querySelector("#reload-file-button"),
  fileMeta: document.querySelector("#file-meta"),
  fileError: document.querySelector("#file-error"),
  editorTitle: document.querySelector("#editor-title"),
  editorStatus: document.querySelector("#editor-status"),
  statusProvider: document.querySelector("#status-provider"),
  statusModel: document.querySelector("#status-model"),
  statusChannel: document.querySelector("#status-channel"),
  toolsList: document.querySelector("#tools-list"),
  refreshToolsButton: document.querySelector("#refresh-tools-button"),
  skillsList: document.querySelector("#skills-list"),
  newSkillButton: document.querySelector("#new-skill-button"),
  refreshSkillsButton: document.querySelector("#refresh-skills-button"),
  editorSection: document.querySelector("#editor-section"),
  editorToggle: document.querySelector("#editor-toggle"),
  settingsButton: document.querySelector("#settings-button"),
  helpTourButton: document.querySelector("#help-tour-button"),
  languageToggle: document.querySelector("#language-toggle"),
  modal: document.querySelector("#settings-modal"),
  modalOverlay: document.querySelector("#modal-overlay"),
  modalClose: document.querySelector("#modal-close"),
  configWorkspace: document.querySelector("#config-workspace"),
  configModel: document.querySelector("#config-model"),
  configModelSelect: document.querySelector("#config-model-select"),
  configActiveProfile: document.querySelector("#config-active-profile"),
  configModelOptions: document.querySelector("#config-model-options"),
  configProfileOptions: document.querySelector("#config-profile-options"),
  configProvider: document.querySelector("#config-provider"),
  configTemperature: document.querySelector("#config-temperature"),
  configMaxTokens: document.querySelector("#config-max-tokens"),
  configContextWindow: document.querySelector("#config-context-window"),
  configMaxToolIterations: document.querySelector("#config-max-tool-iterations"),
  configReasoningEffort: document.querySelector("#config-reasoning-effort"),
  configTimezone: document.querySelector("#config-timezone"),
  // Knowledge config elements
  configKnowledgeEnabled: document.querySelector("#config-knowledge-enabled"),
  configKnowledgeAutoRetrieve: document.querySelector("#config-knowledge-auto-retrieve"),
  configKnowledgeMaxChunks: document.querySelector("#config-knowledge-max-chunks"),
  configKnowledgeChunkSize: document.querySelector("#config-knowledge-chunk-size"),
  configKnowledgeChunkOverlap: document.querySelector("#config-knowledge-chunk-overlap"),
  configKnowledgeRetrievalMode: document.querySelector("#config-knowledge-retrieval-mode"),
  configKnowledgeRerankEnabled: document.querySelector("#config-knowledge-rerank-enabled"),
  configKnowledgeRerankModel: document.querySelector("#config-knowledge-rerank-model"),
  configKnowledgeRerankApiKey: document.querySelector("#config-knowledge-rerank-api-key"),
  configKnowledgeRerankApiKeyEnvVar: document.querySelector("#config-knowledge-rerank-api-key-env-var"),
  configKnowledgeRerankApiBase: document.querySelector("#config-knowledge-rerank-api-base"),
  configKnowledgeRerankTopN: document.querySelector("#config-knowledge-rerank-top-n"),
  configKnowledgeGenerateSummary: document.querySelector("#config-knowledge-generate-summary"),
  configKnowledgeSemanticExtractionMode: document.querySelector("#config-knowledge-semantic-extraction-mode"),
  configKnowledgeSemanticLlmMaxTokens: document.querySelector("#config-knowledge-semantic-llm-max-tokens"),
  configKnowledgeSemanticLlmTimeout: document.querySelector("#config-knowledge-semantic-llm-timeout"),
  configKnowledgeGraphRagCommunityAlgorithm: document.querySelector("#config-knowledge-graphrag-community-algorithm"),
  configKnowledgeGraphRagCommunityLevel: document.querySelector("#config-knowledge-graphrag-community-level"),
  configKnowledgeGraphRagReportLlmEnabled: document.querySelector("#config-knowledge-graphrag-report-llm-enabled"),
  configKnowledgeGraphRagReportMaxTokens: document.querySelector("#config-knowledge-graphrag-report-max-tokens"),
  configKnowledgeGraphRagEntitySummaryEnabled: document.querySelector("#config-knowledge-graphrag-entity-summary-enabled"),
  // Embedding config elements
  configEmbeddingProvider: document.querySelector("#config-embedding-provider"),
  configEmbeddingModelName: document.querySelector("#config-embedding-model-name"),
  configEmbeddingApiKey: document.querySelector("#config-embedding-api-key"),
  configEmbeddingApiBase: document.querySelector("#config-embedding-api-base"),
  // Provider config elements
  configProfileId: document.querySelector("#config-profile-id"),
  configProviderSelect: document.querySelector("#config-provider-select"),
  configProviderModels: document.querySelector("#config-provider-models"),
  configDiscoverModelsButton: document.querySelector("#config-discover-models"),
  configModelDiscoveryStatus: document.querySelector("#config-model-discovery-status"),
  configSupportsModelDiscovery: document.querySelector("#config-supports-model-discovery"),
  configSearch: document.querySelector("#config-search"),
  configQuickNav: document.querySelector("#config-quick-nav"),
  configExpandAll: document.querySelector("#config-expand-all"),
  configCollapseAll: document.querySelector("#config-collapse-all"),
  configEmptySearch: document.querySelector("#config-empty-search"),
  configDirtySummary: document.querySelector("#config-dirty-summary"),
  resetConfigButton: document.querySelector("#reset-config-button"),
  configApiKey: document.querySelector("#config-api-key"),
  configApiBase: document.querySelector("#config-api-base"),
  configWebEnable: document.querySelector("#config-web-enable"),
  configWebProxy: document.querySelector("#config-web-proxy"),
  configSearchProvider: document.querySelector("#config-search-provider"),
  configExecEnable: document.querySelector("#config-exec-enable"),
  configExecTimeout: document.querySelector("#config-exec-timeout"),
  configMcpServers: document.querySelector("#config-mcp-servers"),
  configRestrictWorkspace: document.querySelector("#config-restrict-workspace"),
  configGatewayHost: document.querySelector("#config-gateway-host"),
  configGatewayPort: document.querySelector("#config-gateway-port"),
  configHeartbeatEnable: document.querySelector("#config-heartbeat-enable"),
  configHeartbeatInterval: document.querySelector("#config-heartbeat-interval"),
  configSendProgress: document.querySelector("#config-send-progress"),
  configSendToolHints: document.querySelector("#config-send-tool-hints"),
  configSendRetries: document.querySelector("#config-send-retries"),
  saveConfigButton: document.querySelector("#save-config-button"),
  configError: document.querySelector("#config-error"),
  configSuccess: document.querySelector("#config-success"),
  // Skill modal elements
  skillModal: document.querySelector("#skill-modal"),
  skillModalOverlay: document.querySelector("#skill-modal-overlay"),
  skillModalClose: document.querySelector("#skill-modal-close"),
  skillModalTitle: document.querySelector("#skill-modal-title"),
  skillNameInput: document.querySelector("#skill-name-input"),
  skillDescInput: document.querySelector("#skill-desc-input"),
  skillAlwaysCheckbox: document.querySelector("#skill-always-checkbox"),
  skillSourceDisplay: document.querySelector("#skill-source-display"),
  skillContentEditor: document.querySelector("#skill-content-editor"),
  skillValidateButton: document.querySelector("#skill-validate-button"),
  skillSaveButton: document.querySelector("#skill-save-button"),
  skillDeleteButton: document.querySelector("#skill-delete-button"),
  skillError: document.querySelector("#skill-error"),
  skillSuccess: document.querySelector("#skill-success"),
  skillValidationResult: document.querySelector("#skill-validation-result"),
  // Theme toggle
  themeToggle: document.querySelector("#theme-toggle"),
  // Knowledge panel elements
  knowledgeSection: document.querySelector("#knowledge-section"),
  knowledgeToggle: document.querySelector("#knowledge-toggle"),
  knowledgeStatus: document.querySelector("#knowledge-status"),
  knowledgeStats: document.querySelector("#knowledge-stats"),
  statsDocs: document.querySelector("#stats-docs"),
  statsChunks: document.querySelector("#stats-chunks"),
  docsList: document.querySelector("#docs-list"),
  refreshDocsButton: document.querySelector("#refresh-docs-button"),
  rebuildIndexButton: document.querySelector("#rebuild-index-button"),
  refreshGraphButton: document.querySelector("#refresh-graph-button"),
  knowledgeGraph: document.querySelector("#knowledge-graph"),
  knowledgeGraphMeta: document.querySelector("#knowledge-graph-meta"),
  addDocButton: document.querySelector("#add-doc-button"),
  uploadDocButton: document.querySelector("#upload-doc-button"),
  docFileUpload: document.querySelector("#doc-file-upload"),
  queryInput: document.querySelector("#query-input"),
  queryMode: document.querySelector("#query-mode"),
  queryTopK: document.querySelector("#query-top-k"),
  queryButton: document.querySelector("#query-button"),
  queryResults: document.querySelector("#query-results"),
  // Doc modal elements
  docModal: document.querySelector("#doc-modal"),
  docModalOverlay: document.querySelector("#doc-modal-overlay"),
  docModalClose: document.querySelector("#doc-modal-close"),
  docNameInput: document.querySelector("#doc-name-input"),
  docCategoryInput: document.querySelector("#doc-category-input"),
  docTagsInput: document.querySelector("#doc-tags-input"),
  docFileTypeSelect: document.querySelector("#doc-file-type-select"),
  docContentEditor: document.querySelector("#doc-content-editor"),
  docSaveButton: document.querySelector("#doc-save-button"),
  docError: document.querySelector("#doc-error"),
  docSuccess: document.querySelector("#doc-success"),
  // Doc view modal elements
  docViewModal: document.querySelector("#doc-view-modal"),
  docViewModalOverlay: document.querySelector("#doc-view-modal-overlay"),
  docViewModalClose: document.querySelector("#doc-view-modal-close"),
  docViewId: document.querySelector("#doc-view-id"),
  docViewName: document.querySelector("#doc-view-name"),
  docViewCategory: document.querySelector("#doc-view-category"),
  docViewTags: document.querySelector("#doc-view-tags"),
  docViewCreated: document.querySelector("#doc-view-created"),
  docViewContent: document.querySelector("#doc-view-content"),
  docViewDeleteButton: document.querySelector("#doc-view-delete-button"),
  docViewCloseButton: document.querySelector("#doc-view-close-button"),
  // Tools modal elements (列表弹窗)
  toolsModal: document.querySelector("#tools-modal"),
  toolsModalOverlay: document.querySelector("#tools-modal-overlay"),
  toolsModalClose: document.querySelector("#tools-modal-close"),
  toolsModalList: document.querySelector("#tools-modal-list"),
  toolsToggle: document.querySelector("#tools-toggle"),
  // Skills modal elements (列表弹窗)
  skillsModal: document.querySelector("#skills-modal"),
  skillsModalOverlay: document.querySelector("#skills-modal-overlay"),
  skillsModalClose: document.querySelector("#skills-modal-close"),
  skillsModalList: document.querySelector("#skills-modal-list"),
  skillsToggle: document.querySelector("#skills-toggle"),
  skillsCount: document.querySelector("#skills-count"),
  skillsEnabledCount: document.querySelector("#skills-enabled-count"),
  // Tool modal elements (详情弹窗)
  toolModal: document.querySelector("#tool-modal"),
  toolModalOverlay: document.querySelector("#tool-modal-overlay"),
  toolModalClose: document.querySelector("#tool-modal-close"),
  toolModalTitle: document.querySelector("#tool-modal-title"),
  toolModalName: document.querySelector("#tool-modal-name"),
  toolModalDesc: document.querySelector("#tool-modal-desc"),
  toolModalSchema: document.querySelector("#tool-modal-schema"),
  toolModalCloseButton: document.querySelector("#tool-modal-close-button"),
  // Knowledge modal elements
  knowledgeModal: document.querySelector("#knowledge-modal"),
  knowledgeModalOverlay: document.querySelector("#knowledge-modal-overlay"),
  knowledgeModalClose: document.querySelector("#knowledge-modal-close"),
  modalStatsDocs: document.querySelector("#modal-stats-docs"),
  modalStatsChunks: document.querySelector("#modal-stats-chunks"),
  modalStatsEntities: document.querySelector("#modal-stats-entities"),
  modalStatsClaims: document.querySelector("#modal-stats-claims"),
  modalStatsRelations: document.querySelector("#modal-stats-relations"),
  modalStatsCommunities: document.querySelector("#modal-stats-communities"),
  modalStatsReports: document.querySelector("#modal-stats-reports"),
  knowledgeIndexingStatus: document.querySelector("#knowledge-indexing-status"),
  knowledgeGraphInspector: null,
  knowledgeGraphScope: null,
  knowledgeGraphLevelSelect: null,
  clearGraphFilterButton: null,
  coworkToggle: document.querySelector("#cowork-toggle"),
  coworkSessionCount: document.querySelector("#cowork-session-count"),
  coworkSidebarSessionList: document.querySelector("#cowork-sidebar-session-list"),
  coworkModal: document.querySelector("#cowork-modal"),
  coworkModalOverlay: document.querySelector("#cowork-modal-overlay"),
  coworkModalClose: document.querySelector("#cowork-modal-close"),
  coworkHomeButton: document.querySelector("#cowork-home-button"),
  coworkComposerKicker: document.querySelector("#cowork-composer-kicker"),
  coworkComposerLabel: document.querySelector("#cowork-composer-label"),
  coworkModeTabs: document.querySelector("#cowork-mode-tabs"),
  coworkModeLabel: document.querySelector("#cowork-mode-label"),
  coworkGoalInput: document.querySelector("#cowork-goal-input"),
  coworkWorkflowMode: document.querySelector("#cowork-workflow-mode"),
  coworkAutoRun: document.querySelector("#cowork-auto-run"),
  coworkStartButton: document.querySelector("#cowork-start-button"),
  coworkRefreshButton: document.querySelector("#cowork-refresh-button"),
  coworkIncludeCompleted: document.querySelector("#cowork-include-completed"),
  coworkError: document.querySelector("#cowork-error"),
  coworkSessionList: document.querySelector("#cowork-session-list"),
  coworkActiveStatus: document.querySelector("#cowork-active-status"),
  coworkActiveTitle: document.querySelector("#cowork-active-title"),
  coworkActiveGoal: document.querySelector("#cowork-active-goal"),
  coworkBranchList: document.querySelector("#cowork-branch-list"),
  coworkFocusStrip: document.querySelector("#cowork-focus-strip"),
  coworkFocusProgress: document.querySelector("#cowork-focus-progress"),
  coworkFocusProgressDetail: document.querySelector("#cowork-focus-progress-detail"),
  coworkFocusRunning: document.querySelector("#cowork-focus-running"),
  coworkFocusRunningDetail: document.querySelector("#cowork-focus-running-detail"),
  coworkFocusNext: document.querySelector("#cowork-focus-next"),
  coworkFocusNextDetail: document.querySelector("#cowork-focus-next-detail"),
  coworkFocusOutput: document.querySelector("#cowork-focus-output"),
  coworkFocusOutputDetail: document.querySelector("#cowork-focus-output-detail"),
  coworkInsightPanel: document.querySelector("#cowork-insight-panel"),
  coworkInsightMode: document.querySelector("#cowork-insight-mode"),
  coworkInsightFocus: document.querySelector("#cowork-insight-focus"),
  coworkInsightAction: document.querySelector("#cowork-insight-action"),
  coworkInsightReason: document.querySelector("#cowork-insight-reason"),
  coworkInsightBlockers: document.querySelector("#cowork-insight-blockers"),
  coworkArtifactPanel: document.querySelector("#cowork-artifact-panel"),
  coworkWorkspaceDir: document.querySelector("#cowork-workspace-dir"),
  coworkArtifactList: document.querySelector("#cowork-artifact-list"),
  coworkFinalDraft: document.querySelector("#cowork-final-draft"),
  coworkSchedulerSummary: document.querySelector("#cowork-scheduler-summary"),
  coworkConsoleFilter: document.querySelector("#cowork-console-filter"),
  coworkRunMetrics: document.querySelector("#cowork-run-metrics"),
  coworkArchitectureProjectionSummary: document.querySelector("#cowork-architecture-projection-summary"),
  coworkArchitectureProjectionList: document.querySelector("#cowork-architecture-projection-list"),
  coworkSwarmPlanSummary: document.querySelector("#cowork-swarm-plan-summary"),
  coworkSwarmPlanPanel: document.querySelector("#cowork-swarm-plan-panel"),
  coworkWorkUnitSummary: document.querySelector("#cowork-work-unit-summary"),
  coworkWorkUnitList: document.querySelector("#cowork-work-unit-list"),
  coworkDagSummary: document.querySelector("#cowork-dag-summary"),
  coworkTaskDagList: document.querySelector("#cowork-task-dag-list"),
  coworkAgentSummary: document.querySelector("#cowork-agent-summary"),
  coworkTraceFilter: document.querySelector("#cowork-trace-filter"),
  coworkTraceModeTabs: document.querySelector("#cowork-trace-mode-tabs"),
  coworkTraceList: document.querySelector("#cowork-trace-list"),
  coworkSecondaryTabs: document.querySelector("#cowork-secondary-tabs"),
  coworkMapButton: document.querySelector("#cowork-map-button"),
  coworkConversationPanel: document.querySelector("#cowork-conversation-panel"),
  coworkArtifactSummary: document.querySelector("#cowork-artifact-summary"),
  coworkObservableArtifactList: document.querySelector("#cowork-observable-artifact-list"),
  coworkBranchResultSummary: document.querySelector("#cowork-branch-result-summary"),
  coworkBranchResultList: document.querySelector("#cowork-branch-result-list"),
  coworkBranchMergeButton: document.querySelector("#cowork-branch-merge-button"),
  coworkInspectorKind: document.querySelector("#cowork-inspector-kind"),
  coworkSelectedInspector: document.querySelector("#cowork-selected-inspector"),
  coworkTaskAssignButton: document.querySelector("#cowork-task-assign-button"),
  coworkTaskRetryButton: document.querySelector("#cowork-task-retry-button"),
  coworkTaskReviewButton: document.querySelector("#cowork-task-review-button"),
  coworkPauseButton: document.querySelector("#cowork-pause-button"),
  coworkResumeButton: document.querySelector("#cowork-resume-button"),
  coworkSummaryButton: document.querySelector("#cowork-summary-button"),
  coworkDeleteButton: document.querySelector("#cowork-delete-button"),
  coworkMessageInput: document.querySelector("#cowork-message-input"),
  coworkMessageButton: document.querySelector("#cowork-message-button"),
  coworkTaskTitle: document.querySelector("#cowork-task-title"),
  coworkTaskAgent: document.querySelector("#cowork-task-agent"),
  coworkTaskButton: document.querySelector("#cowork-task-button"),
  coworkBlueprintInput: document.querySelector("#cowork-blueprint-input"),
  coworkBlueprintValidateButton: document.querySelector("#cowork-blueprint-validate-button"),
  coworkBlueprintPreviewButton: document.querySelector("#cowork-blueprint-preview-button"),
  coworkBlueprintStatus: document.querySelector("#cowork-blueprint-status"),
  coworkBlockerSummary: document.querySelector("#cowork-blocker-summary"),
  coworkBlockerPanel: document.querySelector("#cowork-blocker-panel"),
  coworkEvaluationSummary: document.querySelector("#cowork-evaluation-summary"),
  coworkEvaluationList: document.querySelector("#cowork-evaluation-list"),
  coworkGraphStage: document.querySelector("#cowork-graph-stage"),
  coworkGraphSvg: document.querySelector("#cowork-graph-svg"),
  coworkGraphCaption: document.querySelector("#cowork-graph-caption"),
  coworkGraphInspector: document.querySelector("#cowork-graph-inspector"),
  coworkAgentFieldPopover: document.querySelector("#cowork-agent-field-popover"),
  coworkFieldOverlay: document.querySelector("#cowork-field-overlay"),
  coworkGraphZoomOut: document.querySelector("#cowork-graph-zoom-out"),
  coworkGraphReset: document.querySelector("#cowork-graph-reset"),
  coworkGraphZoomIn: document.querySelector("#cowork-graph-zoom-in"),
  coworkAgentList: document.querySelector("#cowork-agent-list"),
  coworkTaskList: document.querySelector("#cowork-task-list"),
  coworkMailboxList: document.querySelector("#cowork-mailbox-list"),
  coworkThreadList: document.querySelector("#cowork-thread-list"),
  coworkMessageList: document.querySelector("#cowork-message-list"),
  coworkStatusFeed: document.querySelector("#cowork-status-feed"),
  coworkEventList: document.querySelector("#cowork-event-list"),
  globalKnowledgeToast: null,
  globalKnowledgeToastTitle: null,
  globalKnowledgeToastDesc: null,
  globalKnowledgeProgressBar: null,
  knowledgeHealthTitle: null,
  knowledgeHealthScore: null,
  knowledgeHealthBar: null,
  knowledgeHealthDesc: null,
  knowledgeOverviewInsights: null,
  queryModeHint: null,
  // Workspace modal elements
  workspaceModal: document.querySelector("#workspace-modal"),
  workspaceModalOverlay: document.querySelector("#workspace-modal-overlay"),
  workspaceModalClose: document.querySelector("#workspace-modal-close"),
  workspaceModalTitle: document.querySelector("#workspace-modal-title"),
  workspaceToggle: document.querySelector("#workspace-toggle"),
  currentFileName: document.querySelector("#current-file-name"),
  toolsCount: document.querySelector("#tools-count"),
  browserPanel: document.querySelector("#browser-panel"),
  browserPanelToggle: document.querySelector("#browser-panel-toggle"),
  browserFrameImage: document.querySelector("#browser-frame-image"),
  browserFrameEmpty: document.querySelector("#browser-frame-empty"),
  browserFrameStatus: document.querySelector("#browser-frame-status"),
  browserFrameTime: document.querySelector("#browser-frame-time"),
  browserFrameCommand: document.querySelector("#browser-frame-command"),
};
