From 6e09c1142eeca3f01a6b5ab1e390c92ddb841e73 Mon Sep 17 00:00:00 2001 From: cpojer Date: Tue, 3 Feb 2026 22:48:28 +0900 Subject: [PATCH] chore: Switch to `NodeNext` for `module`/`moduleResolution` in `ui`. --- ui/src/ui/app-channels.ts | 10 +-- ui/src/ui/app-chat.ts | 20 ++--- ui/src/ui/app-defaults.ts | 4 +- ui/src/ui/app-gateway.ts | 43 ++++++----- ui/src/ui/app-lifecycle.ts | 10 +-- ui/src/ui/app-polling.ts | 8 +- ui/src/ui/app-render.helpers.ts | 20 ++--- ui/src/ui/app-render.ts | 74 +++++++++---------- ui/src/ui/app-scroll.test.ts | 2 +- ui/src/ui/app-settings.test.ts | 4 +- ui/src/ui/app-settings.ts | 44 +++++------ ui/src/ui/app-tool-stream.ts | 2 +- ui/src/ui/app-view-state.ts | 26 +++---- ui/src/ui/app.ts | 50 ++++++------- ui/src/ui/chat-markdown.browser.test.ts | 2 +- ui/src/ui/chat/copy-as-markdown.ts | 2 +- ui/src/ui/chat/grouped-render.ts | 14 ++-- ui/src/ui/chat/message-extract.test.ts | 2 +- ui/src/ui/chat/message-extract.ts | 2 +- ui/src/ui/chat/message-normalizer.test.ts | 2 +- ui/src/ui/chat/message-normalizer.ts | 2 +- ui/src/ui/chat/tool-cards.ts | 14 ++-- ui/src/ui/chat/tool-helpers.test.ts | 2 +- ui/src/ui/chat/tool-helpers.ts | 2 +- ui/src/ui/config-form.browser.test.ts | 2 +- ui/src/ui/controllers/agent-files.ts | 4 +- ui/src/ui/controllers/agent-identity.ts | 4 +- ui/src/ui/controllers/agent-skills.ts | 4 +- ui/src/ui/controllers/agents.ts | 4 +- ui/src/ui/controllers/assistant-identity.ts | 4 +- ui/src/ui/controllers/channels.ts | 4 +- ui/src/ui/controllers/channels.types.ts | 4 +- ui/src/ui/controllers/chat.test.ts | 2 +- ui/src/ui/controllers/chat.ts | 8 +- ui/src/ui/controllers/config.test.ts | 2 +- ui/src/ui/controllers/config.ts | 6 +- ui/src/ui/controllers/cron.ts | 8 +- ui/src/ui/controllers/debug.ts | 4 +- ui/src/ui/controllers/devices.ts | 6 +- ui/src/ui/controllers/exec-approvals.ts | 4 +- ui/src/ui/controllers/logs.ts | 4 +- ui/src/ui/controllers/nodes.ts | 2 +- ui/src/ui/controllers/presence.ts | 4 +- ui/src/ui/controllers/sessions.ts | 6 +- ui/src/ui/controllers/skills.ts | 4 +- ui/src/ui/focus-mode.browser.test.ts | 2 +- ui/src/ui/format.test.ts | 2 +- ui/src/ui/gateway.ts | 6 +- ui/src/ui/markdown.test.ts | 2 +- ui/src/ui/markdown.ts | 2 +- ui/src/ui/navigation.browser.test.ts | 2 +- ui/src/ui/navigation.test.ts | 2 +- ui/src/ui/presenter.ts | 4 +- ui/src/ui/storage.ts | 2 +- ui/src/ui/theme-transition.ts | 2 +- ui/src/ui/tool-display.ts | 4 +- ui/src/ui/uuid.test.ts | 2 +- ui/src/ui/views/agents.ts | 6 +- ui/src/ui/views/channels.config.ts | 6 +- ui/src/ui/views/channels.discord.ts | 8 +- ui/src/ui/views/channels.googlechat.ts | 8 +- ui/src/ui/views/channels.imessage.ts | 8 +- .../ui/views/channels.nostr-profile-form.ts | 2 +- ui/src/ui/views/channels.nostr.ts | 10 +-- ui/src/ui/views/channels.shared.ts | 4 +- ui/src/ui/views/channels.signal.ts | 8 +- ui/src/ui/views/channels.slack.ts | 8 +- ui/src/ui/views/channels.telegram.ts | 8 +- ui/src/ui/views/channels.ts | 26 +++---- ui/src/ui/views/channels.types.ts | 4 +- ui/src/ui/views/channels.whatsapp.ts | 10 +-- ui/src/ui/views/chat.test.ts | 4 +- ui/src/ui/views/chat.ts | 16 ++-- ui/src/ui/views/config-form.analyze.ts | 2 +- ui/src/ui/views/config-form.node.ts | 4 +- ui/src/ui/views/config-form.render.ts | 8 +- ui/src/ui/views/config-form.shared.ts | 2 +- ui/src/ui/views/config-form.ts | 8 +- ui/src/ui/views/config.browser.test.ts | 2 +- ui/src/ui/views/config.ts | 6 +- ui/src/ui/views/cron.test.ts | 6 +- ui/src/ui/views/cron.ts | 8 +- ui/src/ui/views/debug.ts | 4 +- ui/src/ui/views/exec-approval.ts | 2 +- ui/src/ui/views/gateway-url-confirmation.ts | 2 +- ui/src/ui/views/instances.ts | 4 +- ui/src/ui/views/logs.ts | 2 +- ui/src/ui/views/markdown-sidebar.ts | 4 +- ui/src/ui/views/nodes.ts | 6 +- ui/src/ui/views/overview.ts | 8 +- ui/src/ui/views/sessions.ts | 8 +- ui/src/ui/views/skills.ts | 6 +- ui/tsconfig.json | 6 +- 93 files changed, 362 insertions(+), 355 deletions(-) diff --git a/ui/src/ui/app-channels.ts b/ui/src/ui/app-channels.ts index c1e0c32a3..86d53fe15 100644 --- a/ui/src/ui/app-channels.ts +++ b/ui/src/ui/app-channels.ts @@ -1,13 +1,13 @@ -import type { OpenClawApp } from "./app"; -import type { NostrProfile } from "./types"; +import type { OpenClawApp } from "./app.ts"; +import type { NostrProfile } from "./types.ts"; import { loadChannels, logoutWhatsApp, startWhatsAppLogin, waitWhatsAppLogin, -} from "./controllers/channels"; -import { loadConfig, saveConfig } from "./controllers/config"; -import { createNostrProfileFormState } from "./views/channels.nostr-profile-form"; +} from "./controllers/channels.ts"; +import { loadConfig, saveConfig } from "./controllers/config.ts"; +import { createNostrProfileFormState } from "./views/channels.nostr-profile-form.ts"; export async function handleWhatsAppStart(host: OpenClawApp, force: boolean) { await startWhatsAppLogin(host, force); diff --git a/ui/src/ui/app-chat.ts b/ui/src/ui/app-chat.ts index 7c20820c2..b8e09def1 100644 --- a/ui/src/ui/app-chat.ts +++ b/ui/src/ui/app-chat.ts @@ -1,14 +1,14 @@ -import type { OpenClawApp } from "./app"; -import type { GatewayHelloOk } from "./gateway"; -import type { ChatAttachment, ChatQueueItem } from "./ui-types"; +import type { OpenClawApp } from "./app.ts"; +import type { GatewayHelloOk } from "./gateway.ts"; +import type { ChatAttachment, ChatQueueItem } from "./ui-types.ts"; import { parseAgentSessionKey } from "../../../src/sessions/session-key-utils.js"; -import { scheduleChatScroll } from "./app-scroll"; -import { setLastActiveSessionKey } from "./app-settings"; -import { resetToolStream } from "./app-tool-stream"; -import { abortChatRun, loadChatHistory, sendChatMessage } from "./controllers/chat"; -import { loadSessions } from "./controllers/sessions"; -import { normalizeBasePath } from "./navigation"; -import { generateUUID } from "./uuid"; +import { scheduleChatScroll } from "./app-scroll.ts"; +import { setLastActiveSessionKey } from "./app-settings.ts"; +import { resetToolStream } from "./app-tool-stream.ts"; +import { abortChatRun, loadChatHistory, sendChatMessage } from "./controllers/chat.ts"; +import { loadSessions } from "./controllers/sessions.ts"; +import { normalizeBasePath } from "./navigation.ts"; +import { generateUUID } from "./uuid.ts"; export type ChatHost = { connected: boolean; diff --git a/ui/src/ui/app-defaults.ts b/ui/src/ui/app-defaults.ts index d863fa863..61028bfda 100644 --- a/ui/src/ui/app-defaults.ts +++ b/ui/src/ui/app-defaults.ts @@ -1,5 +1,5 @@ -import type { LogLevel } from "./types"; -import type { CronFormState } from "./ui-types"; +import type { LogLevel } from "./types.ts"; +import type { CronFormState } from "./ui-types.ts"; export const DEFAULT_LOG_LEVEL_FILTERS: Record = { trace: true, diff --git a/ui/src/ui/app-gateway.ts b/ui/src/ui/app-gateway.ts index 4c4b4c3b1..4cfa01134 100644 --- a/ui/src/ui/app-gateway.ts +++ b/ui/src/ui/app-gateway.ts @@ -1,27 +1,32 @@ -import type { OpenClawApp } from "./app"; -import type { EventLogEntry } from "./app-events"; -import type { ExecApprovalRequest } from "./controllers/exec-approval"; -import type { GatewayEventFrame, GatewayHelloOk } from "./gateway"; -import type { Tab } from "./navigation"; -import type { UiSettings } from "./storage"; -import type { AgentsListResult, PresenceEntry, HealthSnapshot, StatusSummary } from "./types"; -import { CHAT_SESSIONS_ACTIVE_MINUTES, flushChatQueueForEvent } from "./app-chat"; -import { applySettings, loadCron, refreshActiveTab, setLastActiveSessionKey } from "./app-settings"; -import { handleAgentEvent, resetToolStream, type AgentEventPayload } from "./app-tool-stream"; -import { loadAgents } from "./controllers/agents"; -import { loadAssistantIdentity } from "./controllers/assistant-identity"; -import { loadChatHistory } from "./controllers/chat"; -import { handleChatEvent, type ChatEventPayload } from "./controllers/chat"; -import { loadDevices } from "./controllers/devices"; +import type { EventLogEntry } from "./app-events.ts"; +import type { OpenClawApp } from "./app.ts"; +import type { ExecApprovalRequest } from "./controllers/exec-approval.ts"; +import type { GatewayEventFrame, GatewayHelloOk } from "./gateway.ts"; +import type { Tab } from "./navigation.ts"; +import type { UiSettings } from "./storage.ts"; +import type { AgentsListResult, PresenceEntry, HealthSnapshot, StatusSummary } from "./types.ts"; +import { CHAT_SESSIONS_ACTIVE_MINUTES, flushChatQueueForEvent } from "./app-chat.ts"; +import { + applySettings, + loadCron, + refreshActiveTab, + setLastActiveSessionKey, +} from "./app-settings.ts"; +import { handleAgentEvent, resetToolStream, type AgentEventPayload } from "./app-tool-stream.ts"; +import { loadAgents } from "./controllers/agents.ts"; +import { loadAssistantIdentity } from "./controllers/assistant-identity.ts"; +import { loadChatHistory } from "./controllers/chat.ts"; +import { handleChatEvent, type ChatEventPayload } from "./controllers/chat.ts"; +import { loadDevices } from "./controllers/devices.ts"; import { addExecApproval, parseExecApprovalRequested, parseExecApprovalResolved, removeExecApproval, -} from "./controllers/exec-approval"; -import { loadNodes } from "./controllers/nodes"; -import { loadSessions } from "./controllers/sessions"; -import { GatewayBrowserClient } from "./gateway"; +} from "./controllers/exec-approval.ts"; +import { loadNodes } from "./controllers/nodes.ts"; +import { loadSessions } from "./controllers/sessions.ts"; +import { GatewayBrowserClient } from "./gateway.ts"; type GatewayHost = { settings: UiSettings; diff --git a/ui/src/ui/app-lifecycle.ts b/ui/src/ui/app-lifecycle.ts index 76e0696c1..32af804fb 100644 --- a/ui/src/ui/app-lifecycle.ts +++ b/ui/src/ui/app-lifecycle.ts @@ -1,5 +1,5 @@ -import type { Tab } from "./navigation"; -import { connectGateway } from "./app-gateway"; +import type { Tab } from "./navigation.ts"; +import { connectGateway } from "./app-gateway.ts"; import { startLogsPolling, startNodesPolling, @@ -7,8 +7,8 @@ import { stopNodesPolling, startDebugPolling, stopDebugPolling, -} from "./app-polling"; -import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll"; +} from "./app-polling.ts"; +import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll.ts"; import { applySettingsFromUrl, attachThemeListener, @@ -16,7 +16,7 @@ import { inferBasePath, syncTabWithLocation, syncThemeWithSettings, -} from "./app-settings"; +} from "./app-settings.ts"; type LifecycleHost = { basePath: string; diff --git a/ui/src/ui/app-polling.ts b/ui/src/ui/app-polling.ts index 8fb79124d..59f22568a 100644 --- a/ui/src/ui/app-polling.ts +++ b/ui/src/ui/app-polling.ts @@ -1,7 +1,7 @@ -import type { OpenClawApp } from "./app"; -import { loadDebug } from "./controllers/debug"; -import { loadLogs } from "./controllers/logs"; -import { loadNodes } from "./controllers/nodes"; +import type { OpenClawApp } from "./app.ts"; +import { loadDebug } from "./controllers/debug.ts"; +import { loadLogs } from "./controllers/logs.ts"; +import { loadNodes } from "./controllers/nodes.ts"; type PollingHost = { nodesPollInterval: number | null; diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index 1993a1b55..997684b37 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -1,15 +1,15 @@ import { html } from "lit"; import { repeat } from "lit/directives/repeat.js"; -import type { AppViewState } from "./app-view-state"; -import type { ThemeMode } from "./theme"; -import type { ThemeTransitionContext } from "./theme-transition"; -import type { SessionsListResult } from "./types"; -import { OpenClawApp } from "./app"; -import { refreshChat } from "./app-chat"; -import { syncUrlWithSessionKey } from "./app-settings"; -import { ChatState, loadChatHistory } from "./controllers/chat"; -import { icons } from "./icons"; -import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation"; +import type { AppViewState } from "./app-view-state.ts"; +import type { ThemeTransitionContext } from "./theme-transition.ts"; +import type { ThemeMode } from "./theme.ts"; +import type { SessionsListResult } from "./types.ts"; +import { refreshChat } from "./app-chat.ts"; +import { syncUrlWithSessionKey } from "./app-settings.ts"; +import { OpenClawApp } from "./app.ts"; +import { ChatState, loadChatHistory } from "./controllers/chat.ts"; +import { icons } from "./icons.ts"; +import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation.ts"; export function renderTab(state: AppViewState, tab: Tab) { const href = pathForTab(tab, state.basePath); diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index b34c67c7e..1ac0c29b8 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -1,15 +1,15 @@ import { html, nothing } from "lit"; -import type { AppViewState } from "./app-view-state"; +import type { AppViewState } from "./app-view-state.ts"; import { parseAgentSessionKey } from "../../../src/routing/session-key.js"; -import { OpenClawApp } from "./app"; -import { ChatHost, refreshChatAvatar } from "./app-chat"; -import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers"; -import { loadAgentFileContent, loadAgentFiles, saveAgentFile } from "./controllers/agent-files"; -import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity"; -import { loadAgentSkills } from "./controllers/agent-skills"; -import { loadAgents } from "./controllers/agents"; -import { loadChannels } from "./controllers/channels"; -import { ChatState, loadChatHistory } from "./controllers/chat"; +import { ChatHost, refreshChatAvatar } from "./app-chat.ts"; +import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers.ts"; +import { OpenClawApp } from "./app.ts"; +import { loadAgentFileContent, loadAgentFiles, saveAgentFile } from "./controllers/agent-files.ts"; +import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity.ts"; +import { loadAgentSkills } from "./controllers/agent-skills.ts"; +import { loadAgents } from "./controllers/agents.ts"; +import { loadChannels } from "./controllers/channels.ts"; +import { ChatState, loadChatHistory } from "./controllers/chat.ts"; import { applyConfig, ConfigState, @@ -18,56 +18,56 @@ import { saveConfig, updateConfigFormValue, removeConfigFormValue, -} from "./controllers/config"; +} from "./controllers/config.ts"; import { loadCronRuns, toggleCronJob, runCronJob, removeCronJob, addCronJob, -} from "./controllers/cron"; -import { loadDebug, callDebugMethod } from "./controllers/debug"; +} from "./controllers/cron.ts"; +import { loadDebug, callDebugMethod } from "./controllers/debug.ts"; import { approveDevicePairing, loadDevices, rejectDevicePairing, revokeDeviceToken, rotateDeviceToken, -} from "./controllers/devices"; +} from "./controllers/devices.ts"; import { loadExecApprovals, removeExecApprovalsFormValue, saveExecApprovals, updateExecApprovalsFormValue, -} from "./controllers/exec-approvals"; -import { loadLogs, LogsState } from "./controllers/logs"; -import { loadNodes } from "./controllers/nodes"; -import { loadPresence } from "./controllers/presence"; -import { deleteSession, loadSessions, patchSession } from "./controllers/sessions"; +} from "./controllers/exec-approvals.ts"; +import { loadLogs, LogsState } from "./controllers/logs.ts"; +import { loadNodes } from "./controllers/nodes.ts"; +import { loadPresence } from "./controllers/presence.ts"; +import { deleteSession, loadSessions, patchSession } from "./controllers/sessions.ts"; import { installSkill, loadSkills, saveSkillApiKey, updateSkillEdit, updateSkillEnabled, -} from "./controllers/skills"; -import { icons } from "./icons"; -import { TAB_GROUPS, subtitleForTab, titleForTab } from "./navigation"; -import { ConfigUiHints } from "./types"; -import { renderAgents } from "./views/agents"; -import { renderChannels } from "./views/channels"; -import { renderChat } from "./views/chat"; -import { renderConfig } from "./views/config"; -import { renderCron } from "./views/cron"; -import { renderDebug } from "./views/debug"; -import { renderExecApprovalPrompt } from "./views/exec-approval"; -import { renderGatewayUrlConfirmation } from "./views/gateway-url-confirmation"; -import { renderInstances } from "./views/instances"; -import { renderLogs } from "./views/logs"; -import { renderNodes } from "./views/nodes"; -import { renderOverview } from "./views/overview"; -import { renderSessions } from "./views/sessions"; -import { renderSkills } from "./views/skills"; +} from "./controllers/skills.ts"; +import { icons } from "./icons.ts"; +import { TAB_GROUPS, subtitleForTab, titleForTab } from "./navigation.ts"; +import { ConfigUiHints } from "./types.ts"; +import { renderAgents } from "./views/agents.ts"; +import { renderChannels } from "./views/channels.ts"; +import { renderChat } from "./views/chat.ts"; +import { renderConfig } from "./views/config.ts"; +import { renderCron } from "./views/cron.ts"; +import { renderDebug } from "./views/debug.ts"; +import { renderExecApprovalPrompt } from "./views/exec-approval.ts"; +import { renderGatewayUrlConfirmation } from "./views/gateway-url-confirmation.ts"; +import { renderInstances } from "./views/instances.ts"; +import { renderLogs } from "./views/logs.ts"; +import { renderNodes } from "./views/nodes.ts"; +import { renderOverview } from "./views/overview.ts"; +import { renderSessions } from "./views/sessions.ts"; +import { renderSkills } from "./views/skills.ts"; const AVATAR_DATA_RE = /^data:/i; const AVATAR_HTTP_RE = /^https?:\/\//i; diff --git a/ui/src/ui/app-scroll.test.ts b/ui/src/ui/app-scroll.test.ts index b199f9c13..111b54de9 100644 --- a/ui/src/ui/app-scroll.test.ts +++ b/ui/src/ui/app-scroll.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { handleChatScroll, scheduleChatScroll, resetChatScroll } from "./app-scroll"; +import { handleChatScroll, scheduleChatScroll, resetChatScroll } from "./app-scroll.ts"; /* ------------------------------------------------------------------ */ /* Helpers */ diff --git a/ui/src/ui/app-settings.test.ts b/ui/src/ui/app-settings.test.ts index 33c87cf37..6978ca6cc 100644 --- a/ui/src/ui/app-settings.test.ts +++ b/ui/src/ui/app-settings.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import type { Tab } from "./navigation"; -import { setTabFromRoute } from "./app-settings"; +import type { Tab } from "./navigation.ts"; +import { setTabFromRoute } from "./app-settings.ts"; type SettingsHost = Parameters[0] & { logsPollInterval: number | null; diff --git a/ui/src/ui/app-settings.ts b/ui/src/ui/app-settings.ts index 843c7c4c9..5423e1241 100644 --- a/ui/src/ui/app-settings.ts +++ b/ui/src/ui/app-settings.ts @@ -1,26 +1,26 @@ -import type { OpenClawApp } from "./app"; -import { refreshChat } from "./app-chat"; +import type { OpenClawApp } from "./app.ts"; +import { refreshChat } from "./app-chat.ts"; import { startLogsPolling, stopLogsPolling, startDebugPolling, stopDebugPolling, -} from "./app-polling"; -import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll"; -import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity"; -import { loadAgentSkills } from "./controllers/agent-skills"; -import { loadAgents } from "./controllers/agents"; -import { loadChannels } from "./controllers/channels"; -import { loadConfig, loadConfigSchema } from "./controllers/config"; -import { loadCronJobs, loadCronStatus } from "./controllers/cron"; -import { loadDebug } from "./controllers/debug"; -import { loadDevices } from "./controllers/devices"; -import { loadExecApprovals } from "./controllers/exec-approvals"; -import { loadLogs } from "./controllers/logs"; -import { loadNodes } from "./controllers/nodes"; -import { loadPresence } from "./controllers/presence"; -import { loadSessions } from "./controllers/sessions"; -import { loadSkills } from "./controllers/skills"; +} from "./app-polling.ts"; +import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll.ts"; +import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity.ts"; +import { loadAgentSkills } from "./controllers/agent-skills.ts"; +import { loadAgents } from "./controllers/agents.ts"; +import { loadChannels } from "./controllers/channels.ts"; +import { loadConfig, loadConfigSchema } from "./controllers/config.ts"; +import { loadCronJobs, loadCronStatus } from "./controllers/cron.ts"; +import { loadDebug } from "./controllers/debug.ts"; +import { loadDevices } from "./controllers/devices.ts"; +import { loadExecApprovals } from "./controllers/exec-approvals.ts"; +import { loadLogs } from "./controllers/logs.ts"; +import { loadNodes } from "./controllers/nodes.ts"; +import { loadPresence } from "./controllers/presence.ts"; +import { loadSessions } from "./controllers/sessions.ts"; +import { loadSkills } from "./controllers/skills.ts"; import { inferBasePathFromPathname, normalizeBasePath, @@ -28,10 +28,10 @@ import { pathForTab, tabFromPath, type Tab, -} from "./navigation"; -import { saveSettings, type UiSettings } from "./storage"; -import { resolveTheme, type ResolvedTheme, type ThemeMode } from "./theme"; -import { startThemeTransition, type ThemeTransitionContext } from "./theme-transition"; +} from "./navigation.ts"; +import { saveSettings, type UiSettings } from "./storage.ts"; +import { startThemeTransition, type ThemeTransitionContext } from "./theme-transition.ts"; +import { resolveTheme, type ResolvedTheme, type ThemeMode } from "./theme.ts"; type SettingsHost = { settings: UiSettings; diff --git a/ui/src/ui/app-tool-stream.ts b/ui/src/ui/app-tool-stream.ts index 9701c836d..3c7c175be 100644 --- a/ui/src/ui/app-tool-stream.ts +++ b/ui/src/ui/app-tool-stream.ts @@ -1,4 +1,4 @@ -import { truncateText } from "./format"; +import { truncateText } from "./format.ts"; const TOOL_STREAM_LIMIT = 50; const TOOL_STREAM_THROTTLE_MS = 80; diff --git a/ui/src/ui/app-view-state.ts b/ui/src/ui/app-view-state.ts index 63368b580..20d9dc44f 100644 --- a/ui/src/ui/app-view-state.ts +++ b/ui/src/ui/app-view-state.ts @@ -1,13 +1,13 @@ -import type { EventLogEntry } from "./app-events"; -import type { DevicePairingList } from "./controllers/devices"; -import type { ExecApprovalRequest } from "./controllers/exec-approval"; -import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals"; -import type { SkillMessage } from "./controllers/skills"; -import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway"; -import type { Tab } from "./navigation"; -import type { UiSettings } from "./storage"; -import type { ThemeMode } from "./theme"; -import type { ThemeTransitionContext } from "./theme-transition"; +import type { EventLogEntry } from "./app-events.ts"; +import type { DevicePairingList } from "./controllers/devices.ts"; +import type { ExecApprovalRequest } from "./controllers/exec-approval.ts"; +import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals.ts"; +import type { SkillMessage } from "./controllers/skills.ts"; +import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway.ts"; +import type { Tab } from "./navigation.ts"; +import type { UiSettings } from "./storage.ts"; +import type { ThemeTransitionContext } from "./theme-transition.ts"; +import type { ThemeMode } from "./theme.ts"; import type { AgentsListResult, AgentsFilesListResult, @@ -25,9 +25,9 @@ import type { SessionsListResult, SkillStatusReport, StatusSummary, -} from "./types"; -import type { ChatAttachment, ChatQueueItem, CronFormState } from "./ui-types"; -import type { NostrProfileFormState } from "./views/channels.nostr-profile-form"; +} from "./types.ts"; +import type { ChatAttachment, ChatQueueItem, CronFormState } from "./ui-types.ts"; +import type { NostrProfileFormState } from "./views/channels.nostr-profile-form.ts"; export type AppViewState = { settings: UiSettings; diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index 03f91cc6c..f918a5bd5 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -1,14 +1,14 @@ import { LitElement } from "lit"; import { customElement, state } from "lit/decorators.js"; -import type { EventLogEntry } from "./app-events"; -import type { AppViewState } from "./app-view-state"; -import type { DevicePairingList } from "./controllers/devices"; -import type { ExecApprovalRequest } from "./controllers/exec-approval"; -import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals"; -import type { SkillMessage } from "./controllers/skills"; -import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway"; -import type { Tab } from "./navigation"; -import type { ResolvedTheme, ThemeMode } from "./theme"; +import type { EventLogEntry } from "./app-events.ts"; +import type { AppViewState } from "./app-view-state.ts"; +import type { DevicePairingList } from "./controllers/devices.ts"; +import type { ExecApprovalRequest } from "./controllers/exec-approval.ts"; +import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals.ts"; +import type { SkillMessage } from "./controllers/skills.ts"; +import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway.ts"; +import type { Tab } from "./navigation.ts"; +import type { ResolvedTheme, ThemeMode } from "./theme.ts"; import type { AgentsListResult, AgentsFilesListResult, @@ -27,8 +27,8 @@ import type { SkillStatusReport, StatusSummary, NostrProfile, -} from "./types"; -import type { NostrProfileFormState } from "./views/channels.nostr-profile-form"; +} from "./types.ts"; +import type { NostrProfileFormState } from "./views/channels.nostr-profile-form.ts"; import { handleChannelConfigReload as handleChannelConfigReloadInternal, handleChannelConfigSave as handleChannelConfigSaveInternal, @@ -41,28 +41,28 @@ import { handleWhatsAppLogout as handleWhatsAppLogoutInternal, handleWhatsAppStart as handleWhatsAppStartInternal, handleWhatsAppWait as handleWhatsAppWaitInternal, -} from "./app-channels"; +} from "./app-channels.ts"; import { handleAbortChat as handleAbortChatInternal, handleSendChat as handleSendChatInternal, removeQueuedMessage as removeQueuedMessageInternal, -} from "./app-chat"; -import { DEFAULT_CRON_FORM, DEFAULT_LOG_LEVEL_FILTERS } from "./app-defaults"; -import { connectGateway as connectGatewayInternal } from "./app-gateway"; +} from "./app-chat.ts"; +import { DEFAULT_CRON_FORM, DEFAULT_LOG_LEVEL_FILTERS } from "./app-defaults.ts"; +import { connectGateway as connectGatewayInternal } from "./app-gateway.ts"; import { handleConnected, handleDisconnected, handleFirstUpdated, handleUpdated, -} from "./app-lifecycle"; -import { renderApp } from "./app-render"; +} from "./app-lifecycle.ts"; +import { renderApp } from "./app-render.ts"; import { exportLogs as exportLogsInternal, handleChatScroll as handleChatScrollInternal, handleLogsScroll as handleLogsScrollInternal, resetChatScroll as resetChatScrollInternal, scheduleChatScroll as scheduleChatScrollInternal, -} from "./app-scroll"; +} from "./app-scroll.ts"; import { applySettings as applySettingsInternal, loadCron as loadCronInternal, @@ -70,15 +70,15 @@ import { setTab as setTabInternal, setTheme as setThemeInternal, onPopState as onPopStateInternal, -} from "./app-settings"; +} from "./app-settings.ts"; import { resetToolStream as resetToolStreamInternal, type ToolStreamEntry, -} from "./app-tool-stream"; -import { resolveInjectedAssistantIdentity } from "./assistant-identity"; -import { loadAssistantIdentity as loadAssistantIdentityInternal } from "./controllers/assistant-identity"; -import { loadSettings, type UiSettings } from "./storage"; -import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types"; +} from "./app-tool-stream.ts"; +import { resolveInjectedAssistantIdentity } from "./assistant-identity.ts"; +import { loadAssistantIdentity as loadAssistantIdentityInternal } from "./controllers/assistant-identity.ts"; +import { loadSettings, type UiSettings } from "./storage.ts"; +import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types.ts"; declare global { interface Window { @@ -130,7 +130,7 @@ export class OpenClawApp extends LitElement { @state() chatStream: string | null = null; @state() chatStreamStartedAt: number | null = null; @state() chatRunId: string | null = null; - @state() compactionStatus: import("./app-tool-stream").CompactionStatus | null = null; + @state() compactionStatus: import("./app-tool-stream.ts").CompactionStatus | null = null; @state() chatAvatarUrl: string | null = null; @state() chatThinkingLevel: string | null = null; @state() chatQueue: ChatQueueItem[] = []; diff --git a/ui/src/ui/chat-markdown.browser.test.ts b/ui/src/ui/chat-markdown.browser.test.ts index 990ce066b..c0e692b07 100644 --- a/ui/src/ui/chat-markdown.browser.test.ts +++ b/ui/src/ui/chat-markdown.browser.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import { OpenClawApp } from "./app"; +import { OpenClawApp } from "./app.ts"; // oxlint-disable-next-line typescript/unbound-method const originalConnect = OpenClawApp.prototype.connect; diff --git a/ui/src/ui/chat/copy-as-markdown.ts b/ui/src/ui/chat/copy-as-markdown.ts index 2cd1dc4c2..12aeb6999 100644 --- a/ui/src/ui/chat/copy-as-markdown.ts +++ b/ui/src/ui/chat/copy-as-markdown.ts @@ -1,5 +1,5 @@ import { html, type TemplateResult } from "lit"; -import { icons } from "../icons"; +import { icons } from "../icons.ts"; const COPIED_FOR_MS = 1500; const ERROR_FOR_MS = 2000; diff --git a/ui/src/ui/chat/grouped-render.ts b/ui/src/ui/chat/grouped-render.ts index 7a13d4baf..545b3df7c 100644 --- a/ui/src/ui/chat/grouped-render.ts +++ b/ui/src/ui/chat/grouped-render.ts @@ -1,16 +1,16 @@ import { html, nothing } from "lit"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; -import type { AssistantIdentity } from "../assistant-identity"; -import type { MessageGroup } from "../types/chat-types"; -import { toSanitizedMarkdownHtml } from "../markdown"; -import { renderCopyAsMarkdownButton } from "./copy-as-markdown"; +import type { AssistantIdentity } from "../assistant-identity.ts"; +import type { MessageGroup } from "../types/chat-types.ts"; +import { toSanitizedMarkdownHtml } from "../markdown.ts"; +import { renderCopyAsMarkdownButton } from "./copy-as-markdown.ts"; import { extractTextCached, extractThinkingCached, formatReasoningMarkdown, -} from "./message-extract"; -import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer"; -import { extractToolCards, renderToolCardSidebar } from "./tool-cards"; +} from "./message-extract.ts"; +import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer.ts"; +import { extractToolCards, renderToolCardSidebar } from "./tool-cards.ts"; type ImageBlock = { url: string; diff --git a/ui/src/ui/chat/message-extract.test.ts b/ui/src/ui/chat/message-extract.test.ts index 6b557daa1..70dd28e00 100644 --- a/ui/src/ui/chat/message-extract.test.ts +++ b/ui/src/ui/chat/message-extract.test.ts @@ -4,7 +4,7 @@ import { extractTextCached, extractThinking, extractThinkingCached, -} from "./message-extract"; +} from "./message-extract.ts"; describe("extractTextCached", () => { it("matches extractText output", () => { diff --git a/ui/src/ui/chat/message-extract.ts b/ui/src/ui/chat/message-extract.ts index 547744bd6..c4895dd6c 100644 --- a/ui/src/ui/chat/message-extract.ts +++ b/ui/src/ui/chat/message-extract.ts @@ -1,4 +1,4 @@ -import { stripThinkingTags } from "../format"; +import { stripThinkingTags } from "../format.ts"; const ENVELOPE_PREFIX = /^\[([^\]]+)\]\s*/; const ENVELOPE_CHANNELS = [ diff --git a/ui/src/ui/chat/message-normalizer.test.ts b/ui/src/ui/chat/message-normalizer.test.ts index c9c241b07..0fafeb755 100644 --- a/ui/src/ui/chat/message-normalizer.test.ts +++ b/ui/src/ui/chat/message-normalizer.test.ts @@ -3,7 +3,7 @@ import { normalizeMessage, normalizeRoleForGrouping, isToolResultMessage, -} from "./message-normalizer"; +} from "./message-normalizer.ts"; describe("message-normalizer", () => { describe("normalizeMessage", () => { diff --git a/ui/src/ui/chat/message-normalizer.ts b/ui/src/ui/chat/message-normalizer.ts index 748e1566d..fbc867f66 100644 --- a/ui/src/ui/chat/message-normalizer.ts +++ b/ui/src/ui/chat/message-normalizer.ts @@ -2,7 +2,7 @@ * Message normalization utilities for chat rendering. */ -import type { NormalizedMessage, MessageContentItem } from "../types/chat-types"; +import type { NormalizedMessage, MessageContentItem } from "../types/chat-types.ts"; /** * Normalize a raw message object into a consistent structure. diff --git a/ui/src/ui/chat/tool-cards.ts b/ui/src/ui/chat/tool-cards.ts index 15a692060..7b89a2450 100644 --- a/ui/src/ui/chat/tool-cards.ts +++ b/ui/src/ui/chat/tool-cards.ts @@ -1,11 +1,11 @@ import { html, nothing } from "lit"; -import type { ToolCard } from "../types/chat-types"; -import { icons } from "../icons"; -import { formatToolDetail, resolveToolDisplay } from "../tool-display"; -import { TOOL_INLINE_THRESHOLD } from "./constants"; -import { extractTextCached } from "./message-extract"; -import { isToolResultMessage } from "./message-normalizer"; -import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers"; +import type { ToolCard } from "../types/chat-types.ts"; +import { icons } from "../icons.ts"; +import { formatToolDetail, resolveToolDisplay } from "../tool-display.ts"; +import { TOOL_INLINE_THRESHOLD } from "./constants.ts"; +import { extractTextCached } from "./message-extract.ts"; +import { isToolResultMessage } from "./message-normalizer.ts"; +import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers.ts"; export function extractToolCards(message: unknown): ToolCard[] { const m = message as Record; diff --git a/ui/src/ui/chat/tool-helpers.test.ts b/ui/src/ui/chat/tool-helpers.test.ts index d1e166233..f18cd738a 100644 --- a/ui/src/ui/chat/tool-helpers.test.ts +++ b/ui/src/ui/chat/tool-helpers.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers"; +import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers.ts"; describe("tool-helpers", () => { describe("formatToolOutputForSidebar", () => { diff --git a/ui/src/ui/chat/tool-helpers.ts b/ui/src/ui/chat/tool-helpers.ts index f541fce90..322b6058f 100644 --- a/ui/src/ui/chat/tool-helpers.ts +++ b/ui/src/ui/chat/tool-helpers.ts @@ -2,7 +2,7 @@ * Helper functions for tool card rendering. */ -import { PREVIEW_MAX_CHARS, PREVIEW_MAX_LINES } from "./constants"; +import { PREVIEW_MAX_CHARS, PREVIEW_MAX_LINES } from "./constants.ts"; /** * Format tool output content for display in the sidebar. diff --git a/ui/src/ui/config-form.browser.test.ts b/ui/src/ui/config-form.browser.test.ts index 745ff07d5..292c5780b 100644 --- a/ui/src/ui/config-form.browser.test.ts +++ b/ui/src/ui/config-form.browser.test.ts @@ -1,6 +1,6 @@ import { render } from "lit"; import { describe, expect, it, vi } from "vitest"; -import { analyzeConfigSchema, renderConfigForm } from "./views/config-form"; +import { analyzeConfigSchema, renderConfigForm } from "./views/config-form.ts"; const rootSchema = { type: "object", diff --git a/ui/src/ui/controllers/agent-files.ts b/ui/src/ui/controllers/agent-files.ts index 77d3fe82f..4e4afd789 100644 --- a/ui/src/ui/controllers/agent-files.ts +++ b/ui/src/ui/controllers/agent-files.ts @@ -1,10 +1,10 @@ -import type { GatewayBrowserClient } from "../gateway"; +import type { GatewayBrowserClient } from "../gateway.ts"; import type { AgentFileEntry, AgentsFilesGetResult, AgentsFilesListResult, AgentsFilesSetResult, -} from "../types"; +} from "../types.ts"; export type AgentFilesState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/agent-identity.ts b/ui/src/ui/controllers/agent-identity.ts index 2f5948a39..060b853fb 100644 --- a/ui/src/ui/controllers/agent-identity.ts +++ b/ui/src/ui/controllers/agent-identity.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { AgentIdentityResult } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { AgentIdentityResult } from "../types.ts"; export type AgentIdentityState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/agent-skills.ts b/ui/src/ui/controllers/agent-skills.ts index 9c5475bba..d9489df3d 100644 --- a/ui/src/ui/controllers/agent-skills.ts +++ b/ui/src/ui/controllers/agent-skills.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { SkillStatusReport } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { SkillStatusReport } from "../types.ts"; export type AgentSkillsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/agents.ts b/ui/src/ui/controllers/agents.ts index b809f9b32..e63cd9b60 100644 --- a/ui/src/ui/controllers/agents.ts +++ b/ui/src/ui/controllers/agents.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { AgentsListResult } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { AgentsListResult } from "../types.ts"; export type AgentsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/assistant-identity.ts b/ui/src/ui/controllers/assistant-identity.ts index a644495bf..ea6afb5e5 100644 --- a/ui/src/ui/controllers/assistant-identity.ts +++ b/ui/src/ui/controllers/assistant-identity.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import { normalizeAssistantIdentity } from "../assistant-identity"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import { normalizeAssistantIdentity } from "../assistant-identity.ts"; export type AssistantIdentityState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/channels.ts b/ui/src/ui/controllers/channels.ts index b7dc018eb..de50dadd3 100644 --- a/ui/src/ui/controllers/channels.ts +++ b/ui/src/ui/controllers/channels.ts @@ -1,5 +1,5 @@ -import type { ChannelsState } from "./channels.types"; -import { ChannelsStatusSnapshot } from "../types"; +import type { ChannelsState } from "./channels.types.ts"; +import { ChannelsStatusSnapshot } from "../types.ts"; export type { ChannelsState }; diff --git a/ui/src/ui/controllers/channels.types.ts b/ui/src/ui/controllers/channels.types.ts index 15d6d08c9..4fb8e6bc5 100644 --- a/ui/src/ui/controllers/channels.types.ts +++ b/ui/src/ui/controllers/channels.types.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { ChannelsStatusSnapshot } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { ChannelsStatusSnapshot } from "../types.ts"; export type ChannelsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/chat.test.ts b/ui/src/ui/controllers/chat.test.ts index a61643c95..b99c38cae 100644 --- a/ui/src/ui/controllers/chat.test.ts +++ b/ui/src/ui/controllers/chat.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { handleChatEvent, type ChatEventPayload, type ChatState } from "./chat"; +import { handleChatEvent, type ChatEventPayload, type ChatState } from "./chat.ts"; function createState(overrides: Partial = {}): ChatState { return { diff --git a/ui/src/ui/controllers/chat.ts b/ui/src/ui/controllers/chat.ts index 2bd59e8d6..127e03dd4 100644 --- a/ui/src/ui/controllers/chat.ts +++ b/ui/src/ui/controllers/chat.ts @@ -1,7 +1,7 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { ChatAttachment } from "../ui-types"; -import { extractText } from "../chat/message-extract"; -import { generateUUID } from "../uuid"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { ChatAttachment } from "../ui-types.ts"; +import { extractText } from "../chat/message-extract.ts"; +import { generateUUID } from "../uuid.ts"; export type ChatState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/config.test.ts b/ui/src/ui/controllers/config.test.ts index 5a92c0b82..342a1e58e 100644 --- a/ui/src/ui/controllers/config.test.ts +++ b/ui/src/ui/controllers/config.test.ts @@ -5,7 +5,7 @@ import { runUpdate, updateConfigFormValue, type ConfigState, -} from "./config"; +} from "./config.ts"; function createState(): ConfigState { return { diff --git a/ui/src/ui/controllers/config.ts b/ui/src/ui/controllers/config.ts index 8e4df347a..93e6746c1 100644 --- a/ui/src/ui/controllers/config.ts +++ b/ui/src/ui/controllers/config.ts @@ -1,11 +1,11 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { ConfigSchemaResponse, ConfigSnapshot, ConfigUiHints } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { ConfigSchemaResponse, ConfigSnapshot, ConfigUiHints } from "../types.ts"; import { cloneConfigObject, removePathValue, serializeConfigForm, setPathValue, -} from "./config/form-utils"; +} from "./config/form-utils.ts"; export type ConfigState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/cron.ts b/ui/src/ui/controllers/cron.ts index cfb7938ca..836415eb6 100644 --- a/ui/src/ui/controllers/cron.ts +++ b/ui/src/ui/controllers/cron.ts @@ -1,7 +1,7 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { CronJob, CronRunLogEntry, CronStatus } from "../types"; -import type { CronFormState } from "../ui-types"; -import { toNumber } from "../format"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { CronJob, CronRunLogEntry, CronStatus } from "../types.ts"; +import type { CronFormState } from "../ui-types.ts"; +import { toNumber } from "../format.ts"; export type CronState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/debug.ts b/ui/src/ui/controllers/debug.ts index 481e2c81b..b4dfa7ade 100644 --- a/ui/src/ui/controllers/debug.ts +++ b/ui/src/ui/controllers/debug.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { HealthSnapshot, StatusSummary } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { HealthSnapshot, StatusSummary } from "../types.ts"; export type DebugState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/devices.ts b/ui/src/ui/controllers/devices.ts index d60a61957..a66fca4cd 100644 --- a/ui/src/ui/controllers/devices.ts +++ b/ui/src/ui/controllers/devices.ts @@ -1,6 +1,6 @@ -import type { GatewayBrowserClient } from "../gateway"; -import { clearDeviceAuthToken, storeDeviceAuthToken } from "../device-auth"; -import { loadOrCreateDeviceIdentity } from "../device-identity"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import { clearDeviceAuthToken, storeDeviceAuthToken } from "../device-auth.ts"; +import { loadOrCreateDeviceIdentity } from "../device-identity.ts"; export type DeviceTokenSummary = { role: string; diff --git a/ui/src/ui/controllers/exec-approvals.ts b/ui/src/ui/controllers/exec-approvals.ts index f1bc04a5c..104035f9c 100644 --- a/ui/src/ui/controllers/exec-approvals.ts +++ b/ui/src/ui/controllers/exec-approvals.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import { cloneConfigObject, removePathValue, setPathValue } from "./config/form-utils"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import { cloneConfigObject, removePathValue, setPathValue } from "./config/form-utils.ts"; export type ExecApprovalsDefaults = { security?: string; diff --git a/ui/src/ui/controllers/logs.ts b/ui/src/ui/controllers/logs.ts index c5d41be9a..d2e919c62 100644 --- a/ui/src/ui/controllers/logs.ts +++ b/ui/src/ui/controllers/logs.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { LogEntry, LogLevel } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { LogEntry, LogLevel } from "../types.ts"; export type LogsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/nodes.ts b/ui/src/ui/controllers/nodes.ts index 1883bd325..20dfdeb3a 100644 --- a/ui/src/ui/controllers/nodes.ts +++ b/ui/src/ui/controllers/nodes.ts @@ -1,4 +1,4 @@ -import type { GatewayBrowserClient } from "../gateway"; +import type { GatewayBrowserClient } from "../gateway.ts"; export type NodesState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/presence.ts b/ui/src/ui/controllers/presence.ts index 676fff827..99bcb233c 100644 --- a/ui/src/ui/controllers/presence.ts +++ b/ui/src/ui/controllers/presence.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { PresenceEntry } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { PresenceEntry } from "../types.ts"; export type PresenceState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/sessions.ts b/ui/src/ui/controllers/sessions.ts index f585d01b2..cb2039041 100644 --- a/ui/src/ui/controllers/sessions.ts +++ b/ui/src/ui/controllers/sessions.ts @@ -1,6 +1,6 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { SessionsListResult } from "../types"; -import { toNumber } from "../format"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { SessionsListResult } from "../types.ts"; +import { toNumber } from "../format.ts"; export type SessionsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/controllers/skills.ts b/ui/src/ui/controllers/skills.ts index d74d68a3e..f243d1687 100644 --- a/ui/src/ui/controllers/skills.ts +++ b/ui/src/ui/controllers/skills.ts @@ -1,5 +1,5 @@ -import type { GatewayBrowserClient } from "../gateway"; -import type { SkillStatusReport } from "../types"; +import type { GatewayBrowserClient } from "../gateway.ts"; +import type { SkillStatusReport } from "../types.ts"; export type SkillsState = { client: GatewayBrowserClient | null; diff --git a/ui/src/ui/focus-mode.browser.test.ts b/ui/src/ui/focus-mode.browser.test.ts index cfa1f0ef9..9576100d1 100644 --- a/ui/src/ui/focus-mode.browser.test.ts +++ b/ui/src/ui/focus-mode.browser.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import { OpenClawApp } from "./app"; +import { OpenClawApp } from "./app.ts"; // oxlint-disable-next-line typescript/unbound-method const originalConnect = OpenClawApp.prototype.connect; diff --git a/ui/src/ui/format.test.ts b/ui/src/ui/format.test.ts index b52dc0e4f..cc992ea09 100644 --- a/ui/src/ui/format.test.ts +++ b/ui/src/ui/format.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { stripThinkingTags } from "./format"; +import { stripThinkingTags } from "./format.ts"; describe("stripThinkingTags", () => { it("strips segments", () => { diff --git a/ui/src/ui/gateway.ts b/ui/src/ui/gateway.ts index caaed975b..975cca4ab 100644 --- a/ui/src/ui/gateway.ts +++ b/ui/src/ui/gateway.ts @@ -5,9 +5,9 @@ import { type GatewayClientMode, type GatewayClientName, } from "../../../src/gateway/protocol/client-info.js"; -import { clearDeviceAuthToken, loadDeviceAuthToken, storeDeviceAuthToken } from "./device-auth"; -import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity"; -import { generateUUID } from "./uuid"; +import { clearDeviceAuthToken, loadDeviceAuthToken, storeDeviceAuthToken } from "./device-auth.ts"; +import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity.ts"; +import { generateUUID } from "./uuid.ts"; export type GatewayEventFrame = { type: "event"; diff --git a/ui/src/ui/markdown.test.ts b/ui/src/ui/markdown.test.ts index 278485fe7..daf628ef8 100644 --- a/ui/src/ui/markdown.test.ts +++ b/ui/src/ui/markdown.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { toSanitizedMarkdownHtml } from "./markdown"; +import { toSanitizedMarkdownHtml } from "./markdown.ts"; describe("toSanitizedMarkdownHtml", () => { it("renders basic markdown", () => { diff --git a/ui/src/ui/markdown.ts b/ui/src/ui/markdown.ts index ef500112a..5245b6f51 100644 --- a/ui/src/ui/markdown.ts +++ b/ui/src/ui/markdown.ts @@ -1,6 +1,6 @@ import DOMPurify from "dompurify"; import { marked } from "marked"; -import { truncateText } from "./format"; +import { truncateText } from "./format.ts"; marked.setOptions({ gfm: true, diff --git a/ui/src/ui/navigation.browser.test.ts b/ui/src/ui/navigation.browser.test.ts index bf020419f..c6bafa9c1 100644 --- a/ui/src/ui/navigation.browser.test.ts +++ b/ui/src/ui/navigation.browser.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import { OpenClawApp } from "./app"; +import { OpenClawApp } from "./app.ts"; import "../styles.css"; // oxlint-disable-next-line typescript/unbound-method diff --git a/ui/src/ui/navigation.test.ts b/ui/src/ui/navigation.test.ts index 3348ad462..c4552f0ca 100644 --- a/ui/src/ui/navigation.test.ts +++ b/ui/src/ui/navigation.test.ts @@ -10,7 +10,7 @@ import { tabFromPath, titleForTab, type Tab, -} from "./navigation"; +} from "./navigation.ts"; /** All valid tab identifiers derived from TAB_GROUPS */ const ALL_TABS: Tab[] = TAB_GROUPS.flatMap((group) => group.tabs) as Tab[]; diff --git a/ui/src/ui/presenter.ts b/ui/src/ui/presenter.ts index 80229269c..a6738b6f8 100644 --- a/ui/src/ui/presenter.ts +++ b/ui/src/ui/presenter.ts @@ -1,5 +1,5 @@ -import type { CronJob, GatewaySessionRow, PresenceEntry } from "./types"; -import { formatAgo, formatDurationMs, formatMs } from "./format"; +import type { CronJob, GatewaySessionRow, PresenceEntry } from "./types.ts"; +import { formatAgo, formatDurationMs, formatMs } from "./format.ts"; export function formatPresenceSummary(entry: PresenceEntry): string { const host = entry.host ?? "unknown"; diff --git a/ui/src/ui/storage.ts b/ui/src/ui/storage.ts index edb5d6a9e..d7d9e4dc7 100644 --- a/ui/src/ui/storage.ts +++ b/ui/src/ui/storage.ts @@ -1,6 +1,6 @@ const KEY = "openclaw.control.settings.v1"; -import type { ThemeMode } from "./theme"; +import type { ThemeMode } from "./theme.ts"; export type UiSettings = { gatewayUrl: string; diff --git a/ui/src/ui/theme-transition.ts b/ui/src/ui/theme-transition.ts index 415c23ac5..fd76706b1 100644 --- a/ui/src/ui/theme-transition.ts +++ b/ui/src/ui/theme-transition.ts @@ -1,4 +1,4 @@ -import type { ThemeMode } from "./theme"; +import type { ThemeMode } from "./theme.ts"; export type ThemeTransitionContext = { element?: HTMLElement | null; diff --git a/ui/src/ui/tool-display.ts b/ui/src/ui/tool-display.ts index 6f43bd2b2..509381723 100644 --- a/ui/src/ui/tool-display.ts +++ b/ui/src/ui/tool-display.ts @@ -1,5 +1,5 @@ -import type { IconName } from "./icons"; -import rawConfig from "./tool-display.json"; +import type { IconName } from "./icons.ts"; +import rawConfig from "./tool-display.json" with { type: "json" }; type ToolDisplayActionSpec = { label?: string; diff --git a/ui/src/ui/uuid.test.ts b/ui/src/ui/uuid.test.ts index 8d0aa4354..59cfcd3e6 100644 --- a/ui/src/ui/uuid.test.ts +++ b/ui/src/ui/uuid.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from "vitest"; -import { generateUUID } from "./uuid"; +import { generateUUID } from "./uuid.ts"; describe("generateUUID", () => { it("uses crypto.randomUUID when available", () => { diff --git a/ui/src/ui/views/agents.ts b/ui/src/ui/views/agents.ts index 5f0aa798d..06b8c4067 100644 --- a/ui/src/ui/views/agents.ts +++ b/ui/src/ui/views/agents.ts @@ -10,19 +10,19 @@ import type { CronStatus, SkillStatusEntry, SkillStatusReport, -} from "../types"; +} from "../types.ts"; import { expandToolGroups, normalizeToolName, resolveToolProfilePolicy, } from "../../../../src/agents/tool-policy.js"; -import { formatAgo } from "../format"; +import { formatAgo } from "../format.ts"; import { formatCronPayload, formatCronSchedule, formatCronState, formatNextRun, -} from "../presenter"; +} from "../presenter.ts"; export type AgentsPanel = "overview" | "files" | "tools" | "skills" | "channels" | "cron"; diff --git a/ui/src/ui/views/channels.config.ts b/ui/src/ui/views/channels.config.ts index a723d3561..b94b75013 100644 --- a/ui/src/ui/views/channels.config.ts +++ b/ui/src/ui/views/channels.config.ts @@ -1,7 +1,7 @@ import { html } from "lit"; -import type { ConfigUiHints } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./config-form"; +import type { ConfigUiHints } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./config-form.ts"; type ChannelConfigFormProps = { channelId: string; diff --git a/ui/src/ui/views/channels.discord.ts b/ui/src/ui/views/channels.discord.ts index 59d2e65b2..69df08288 100644 --- a/ui/src/ui/views/channels.discord.ts +++ b/ui/src/ui/views/channels.discord.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { DiscordStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { DiscordStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderDiscordCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.googlechat.ts b/ui/src/ui/views/channels.googlechat.ts index fcfeffd22..506a90281 100644 --- a/ui/src/ui/views/channels.googlechat.ts +++ b/ui/src/ui/views/channels.googlechat.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { GoogleChatStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { GoogleChatStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderGoogleChatCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.imessage.ts b/ui/src/ui/views/channels.imessage.ts index 6a67b148c..c54cd6c5e 100644 --- a/ui/src/ui/views/channels.imessage.ts +++ b/ui/src/ui/views/channels.imessage.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { IMessageStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { IMessageStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderIMessageCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.nostr-profile-form.ts b/ui/src/ui/views/channels.nostr-profile-form.ts index f9dc855b6..62e4669f3 100644 --- a/ui/src/ui/views/channels.nostr-profile-form.ts +++ b/ui/src/ui/views/channels.nostr-profile-form.ts @@ -5,7 +5,7 @@ */ import { html, nothing, type TemplateResult } from "lit"; -import type { NostrProfile as NostrProfileType } from "../types"; +import type { NostrProfile as NostrProfileType } from "../types.ts"; // ============================================================================ // Types diff --git a/ui/src/ui/views/channels.nostr.ts b/ui/src/ui/views/channels.nostr.ts index fb1faf0bf..8bd8b7c04 100644 --- a/ui/src/ui/views/channels.nostr.ts +++ b/ui/src/ui/views/channels.nostr.ts @@ -1,13 +1,13 @@ import { html, nothing } from "lit"; -import type { ChannelAccountSnapshot, NostrStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { ChannelAccountSnapshot, NostrStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; import { renderNostrProfileForm, type NostrProfileFormState, type NostrProfileFormCallbacks, -} from "./channels.nostr-profile-form"; +} from "./channels.nostr-profile-form.ts"; /** * Truncate a pubkey for display (shows first and last 8 chars) diff --git a/ui/src/ui/views/channels.shared.ts b/ui/src/ui/views/channels.shared.ts index 0ef1baaf8..343c60b11 100644 --- a/ui/src/ui/views/channels.shared.ts +++ b/ui/src/ui/views/channels.shared.ts @@ -1,6 +1,6 @@ import { html, nothing } from "lit"; -import type { ChannelAccountSnapshot } from "../types"; -import type { ChannelKey, ChannelsProps } from "./channels.types"; +import type { ChannelAccountSnapshot } from "../types.ts"; +import type { ChannelKey, ChannelsProps } from "./channels.types.ts"; export function formatDuration(ms?: number | null) { if (!ms && ms !== 0) { diff --git a/ui/src/ui/views/channels.signal.ts b/ui/src/ui/views/channels.signal.ts index 050b14bb8..a2f2327c2 100644 --- a/ui/src/ui/views/channels.signal.ts +++ b/ui/src/ui/views/channels.signal.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { SignalStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { SignalStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderSignalCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.slack.ts b/ui/src/ui/views/channels.slack.ts index d018f40ef..91180de31 100644 --- a/ui/src/ui/views/channels.slack.ts +++ b/ui/src/ui/views/channels.slack.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { SlackStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { SlackStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderSlackCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.telegram.ts b/ui/src/ui/views/channels.telegram.ts index d2347c0f8..270ae0782 100644 --- a/ui/src/ui/views/channels.telegram.ts +++ b/ui/src/ui/views/channels.telegram.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { ChannelAccountSnapshot, TelegramStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; +import type { ChannelAccountSnapshot, TelegramStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; export function renderTelegramCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/channels.ts b/ui/src/ui/views/channels.ts index e4f35c76b..c1983fef0 100644 --- a/ui/src/ui/views/channels.ts +++ b/ui/src/ui/views/channels.ts @@ -12,19 +12,19 @@ import type { SlackStatus, TelegramStatus, WhatsAppStatus, -} from "../types"; -import type { ChannelKey, ChannelsChannelData, ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; -import { renderDiscordCard } from "./channels.discord"; -import { renderGoogleChatCard } from "./channels.googlechat"; -import { renderIMessageCard } from "./channels.imessage"; -import { renderNostrCard } from "./channels.nostr"; -import { channelEnabled, renderChannelAccountCount } from "./channels.shared"; -import { renderSignalCard } from "./channels.signal"; -import { renderSlackCard } from "./channels.slack"; -import { renderTelegramCard } from "./channels.telegram"; -import { renderWhatsAppCard } from "./channels.whatsapp"; +} from "../types.ts"; +import type { ChannelKey, ChannelsChannelData, ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; +import { renderDiscordCard } from "./channels.discord.ts"; +import { renderGoogleChatCard } from "./channels.googlechat.ts"; +import { renderIMessageCard } from "./channels.imessage.ts"; +import { renderNostrCard } from "./channels.nostr.ts"; +import { channelEnabled, renderChannelAccountCount } from "./channels.shared.ts"; +import { renderSignalCard } from "./channels.signal.ts"; +import { renderSlackCard } from "./channels.slack.ts"; +import { renderTelegramCard } from "./channels.telegram.ts"; +import { renderWhatsAppCard } from "./channels.whatsapp.ts"; export function renderChannels(props: ChannelsProps) { const channels = props.snapshot?.channels as Record | null; diff --git a/ui/src/ui/views/channels.types.ts b/ui/src/ui/views/channels.types.ts index 844445390..59d7ee19f 100644 --- a/ui/src/ui/views/channels.types.ts +++ b/ui/src/ui/views/channels.types.ts @@ -11,8 +11,8 @@ import type { SlackStatus, TelegramStatus, WhatsAppStatus, -} from "../types"; -import type { NostrProfileFormState } from "./channels.nostr-profile-form"; +} from "../types.ts"; +import type { NostrProfileFormState } from "./channels.nostr-profile-form.ts"; export type ChannelKey = string; diff --git a/ui/src/ui/views/channels.whatsapp.ts b/ui/src/ui/views/channels.whatsapp.ts index ad1fcf7a9..149861fca 100644 --- a/ui/src/ui/views/channels.whatsapp.ts +++ b/ui/src/ui/views/channels.whatsapp.ts @@ -1,9 +1,9 @@ import { html, nothing } from "lit"; -import type { WhatsAppStatus } from "../types"; -import type { ChannelsProps } from "./channels.types"; -import { formatAgo } from "../format"; -import { renderChannelConfigSection } from "./channels.config"; -import { formatDuration } from "./channels.shared"; +import type { WhatsAppStatus } from "../types.ts"; +import type { ChannelsProps } from "./channels.types.ts"; +import { formatAgo } from "../format.ts"; +import { renderChannelConfigSection } from "./channels.config.ts"; +import { formatDuration } from "./channels.shared.ts"; export function renderWhatsAppCard(params: { props: ChannelsProps; diff --git a/ui/src/ui/views/chat.test.ts b/ui/src/ui/views/chat.test.ts index 7d121e99f..903d588cd 100644 --- a/ui/src/ui/views/chat.test.ts +++ b/ui/src/ui/views/chat.test.ts @@ -1,7 +1,7 @@ import { render } from "lit"; import { describe, expect, it, vi } from "vitest"; -import type { SessionsListResult } from "../types"; -import { renderChat, type ChatProps } from "./chat"; +import type { SessionsListResult } from "../types.ts"; +import { renderChat, type ChatProps } from "./chat.ts"; function createSessions(): SessionsListResult { return { diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 13fb74012..0291a41e6 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -1,18 +1,18 @@ import { html, nothing } from "lit"; import { ref } from "lit/directives/ref.js"; import { repeat } from "lit/directives/repeat.js"; -import type { SessionsListResult } from "../types"; -import type { ChatItem, MessageGroup } from "../types/chat-types"; -import type { ChatAttachment, ChatQueueItem } from "../ui-types"; +import type { SessionsListResult } from "../types.ts"; +import type { ChatItem, MessageGroup } from "../types/chat-types.ts"; +import type { ChatAttachment, ChatQueueItem } from "../ui-types.ts"; import { renderMessageGroup, renderReadingIndicatorGroup, renderStreamingGroup, -} from "../chat/grouped-render"; -import { normalizeMessage, normalizeRoleForGrouping } from "../chat/message-normalizer"; -import { icons } from "../icons"; -import { renderMarkdownSidebar } from "./markdown-sidebar"; -import "../components/resizable-divider"; +} from "../chat/grouped-render.ts"; +import { normalizeMessage, normalizeRoleForGrouping } from "../chat/message-normalizer.ts"; +import { icons } from "../icons.ts"; +import { renderMarkdownSidebar } from "./markdown-sidebar.ts"; +import "../components/resizable-divider.ts"; export type CompactionIndicatorStatus = { active: boolean; diff --git a/ui/src/ui/views/config-form.analyze.ts b/ui/src/ui/views/config-form.analyze.ts index c8f6b7ab6..9bf17dcde 100644 --- a/ui/src/ui/views/config-form.analyze.ts +++ b/ui/src/ui/views/config-form.analyze.ts @@ -1,4 +1,4 @@ -import { pathKey, schemaType, type JsonSchema } from "./config-form.shared"; +import { pathKey, schemaType, type JsonSchema } from "./config-form.shared.ts"; export type ConfigSchemaAnalysis = { schema: JsonSchema | null; diff --git a/ui/src/ui/views/config-form.node.ts b/ui/src/ui/views/config-form.node.ts index ee4336ff6..c37ae6d12 100644 --- a/ui/src/ui/views/config-form.node.ts +++ b/ui/src/ui/views/config-form.node.ts @@ -1,5 +1,5 @@ import { html, nothing, type TemplateResult } from "lit"; -import type { ConfigUiHints } from "../types"; +import type { ConfigUiHints } from "../types.ts"; import { defaultValue, hintForPath, @@ -8,7 +8,7 @@ import { pathKey, schemaType, type JsonSchema, -} from "./config-form.shared"; +} from "./config-form.shared.ts"; const META_KEYS = new Set(["title", "description", "default", "nullable"]); diff --git a/ui/src/ui/views/config-form.render.ts b/ui/src/ui/views/config-form.render.ts index 11698baad..7c541d97f 100644 --- a/ui/src/ui/views/config-form.render.ts +++ b/ui/src/ui/views/config-form.render.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { ConfigUiHints } from "../types"; -import { icons } from "../icons"; -import { renderNode } from "./config-form.node"; -import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared"; +import type { ConfigUiHints } from "../types.ts"; +import { icons } from "../icons.ts"; +import { renderNode } from "./config-form.node.ts"; +import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared.ts"; export type ConfigFormProps = { schema: JsonSchema | null; diff --git a/ui/src/ui/views/config-form.shared.ts b/ui/src/ui/views/config-form.shared.ts index 57de50832..9a7f9fce5 100644 --- a/ui/src/ui/views/config-form.shared.ts +++ b/ui/src/ui/views/config-form.shared.ts @@ -1,4 +1,4 @@ -import type { ConfigUiHints } from "../types"; +import type { ConfigUiHints } from "../types.ts"; export type JsonSchema = { type?: string | string[]; diff --git a/ui/src/ui/views/config-form.ts b/ui/src/ui/views/config-form.ts index c762f8331..bb355ea53 100644 --- a/ui/src/ui/views/config-form.ts +++ b/ui/src/ui/views/config-form.ts @@ -1,4 +1,4 @@ -export { renderConfigForm, type ConfigFormProps, SECTION_META } from "./config-form.render"; -export { analyzeConfigSchema, type ConfigSchemaAnalysis } from "./config-form.analyze"; -export { renderNode } from "./config-form.node"; -export { schemaType, type JsonSchema } from "./config-form.shared"; +export { renderConfigForm, type ConfigFormProps, SECTION_META } from "./config-form.render.ts"; +export { analyzeConfigSchema, type ConfigSchemaAnalysis } from "./config-form.analyze.ts"; +export { renderNode } from "./config-form.node.ts"; +export { schemaType, type JsonSchema } from "./config-form.shared.ts"; diff --git a/ui/src/ui/views/config.browser.test.ts b/ui/src/ui/views/config.browser.test.ts index fd87612b3..cdb7fc195 100644 --- a/ui/src/ui/views/config.browser.test.ts +++ b/ui/src/ui/views/config.browser.test.ts @@ -1,6 +1,6 @@ import { render } from "lit"; import { describe, expect, it, vi } from "vitest"; -import { renderConfig } from "./config"; +import { renderConfig } from "./config.ts"; describe("config view", () => { const baseProps = () => ({ diff --git a/ui/src/ui/views/config.ts b/ui/src/ui/views/config.ts index 07aebfd77..221f31e00 100644 --- a/ui/src/ui/views/config.ts +++ b/ui/src/ui/views/config.ts @@ -1,7 +1,7 @@ import { html, nothing } from "lit"; -import type { ConfigUiHints } from "../types"; -import { analyzeConfigSchema, renderConfigForm, SECTION_META } from "./config-form"; -import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared"; +import type { ConfigUiHints } from "../types.ts"; +import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared.ts"; +import { analyzeConfigSchema, renderConfigForm, SECTION_META } from "./config-form.ts"; export type ConfigProps = { raw: string; diff --git a/ui/src/ui/views/cron.test.ts b/ui/src/ui/views/cron.test.ts index 21d70f11d..6d1e2c7a4 100644 --- a/ui/src/ui/views/cron.test.ts +++ b/ui/src/ui/views/cron.test.ts @@ -1,8 +1,8 @@ import { render } from "lit"; import { describe, expect, it, vi } from "vitest"; -import type { CronJob } from "../types"; -import { DEFAULT_CRON_FORM } from "../app-defaults"; -import { renderCron, type CronProps } from "./cron"; +import type { CronJob } from "../types.ts"; +import { DEFAULT_CRON_FORM } from "../app-defaults.ts"; +import { renderCron, type CronProps } from "./cron.ts"; function createJob(id: string): CronJob { return { diff --git a/ui/src/ui/views/cron.ts b/ui/src/ui/views/cron.ts index e144b3f41..216d8f01c 100644 --- a/ui/src/ui/views/cron.ts +++ b/ui/src/ui/views/cron.ts @@ -1,13 +1,13 @@ import { html, nothing } from "lit"; -import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types"; -import type { CronFormState } from "../ui-types"; -import { formatMs } from "../format"; +import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types.ts"; +import type { CronFormState } from "../ui-types.ts"; +import { formatMs } from "../format.ts"; import { formatCronPayload, formatCronSchedule, formatCronState, formatNextRun, -} from "../presenter"; +} from "../presenter.ts"; export type CronProps = { loading: boolean; diff --git a/ui/src/ui/views/debug.ts b/ui/src/ui/views/debug.ts index e37bb48d6..22ee3bce2 100644 --- a/ui/src/ui/views/debug.ts +++ b/ui/src/ui/views/debug.ts @@ -1,6 +1,6 @@ import { html, nothing } from "lit"; -import type { EventLogEntry } from "../app-events"; -import { formatEventPayload } from "../presenter"; +import type { EventLogEntry } from "../app-events.ts"; +import { formatEventPayload } from "../presenter.ts"; export type DebugProps = { loading: boolean; diff --git a/ui/src/ui/views/exec-approval.ts b/ui/src/ui/views/exec-approval.ts index 299335385..f1f549fc3 100644 --- a/ui/src/ui/views/exec-approval.ts +++ b/ui/src/ui/views/exec-approval.ts @@ -1,5 +1,5 @@ import { html, nothing } from "lit"; -import type { AppViewState } from "../app-view-state"; +import type { AppViewState } from "../app-view-state.ts"; function formatRemaining(ms: number): string { const remaining = Math.max(0, ms); diff --git a/ui/src/ui/views/gateway-url-confirmation.ts b/ui/src/ui/views/gateway-url-confirmation.ts index bc588e69d..fb954f974 100644 --- a/ui/src/ui/views/gateway-url-confirmation.ts +++ b/ui/src/ui/views/gateway-url-confirmation.ts @@ -1,5 +1,5 @@ import { html, nothing } from "lit"; -import type { AppViewState } from "../app-view-state"; +import type { AppViewState } from "../app-view-state.ts"; export function renderGatewayUrlConfirmation(state: AppViewState) { const { pendingGatewayUrl } = state; diff --git a/ui/src/ui/views/instances.ts b/ui/src/ui/views/instances.ts index 384251343..897304cef 100644 --- a/ui/src/ui/views/instances.ts +++ b/ui/src/ui/views/instances.ts @@ -1,6 +1,6 @@ import { html, nothing } from "lit"; -import type { PresenceEntry } from "../types"; -import { formatPresenceAge, formatPresenceSummary } from "../presenter"; +import type { PresenceEntry } from "../types.ts"; +import { formatPresenceAge, formatPresenceSummary } from "../presenter.ts"; export type InstancesProps = { loading: boolean; diff --git a/ui/src/ui/views/logs.ts b/ui/src/ui/views/logs.ts index 1f2e8cb27..c119c413c 100644 --- a/ui/src/ui/views/logs.ts +++ b/ui/src/ui/views/logs.ts @@ -1,5 +1,5 @@ import { html, nothing } from "lit"; -import type { LogEntry, LogLevel } from "../types"; +import type { LogEntry, LogLevel } from "../types.ts"; const LEVELS: LogLevel[] = ["trace", "debug", "info", "warn", "error", "fatal"]; diff --git a/ui/src/ui/views/markdown-sidebar.ts b/ui/src/ui/views/markdown-sidebar.ts index dee813d9e..006bd6ac4 100644 --- a/ui/src/ui/views/markdown-sidebar.ts +++ b/ui/src/ui/views/markdown-sidebar.ts @@ -1,7 +1,7 @@ import { html } from "lit"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; -import { icons } from "../icons"; -import { toSanitizedMarkdownHtml } from "../markdown"; +import { icons } from "../icons.ts"; +import { toSanitizedMarkdownHtml } from "../markdown.ts"; export type MarkdownSidebarProps = { content: string | null; diff --git a/ui/src/ui/views/nodes.ts b/ui/src/ui/views/nodes.ts index 0c49c69ea..f48c925c9 100644 --- a/ui/src/ui/views/nodes.ts +++ b/ui/src/ui/views/nodes.ts @@ -4,13 +4,13 @@ import type { DeviceTokenSummary, PairedDevice, PendingDevice, -} from "../controllers/devices"; +} from "../controllers/devices.ts"; import type { ExecApprovalsAllowlistEntry, ExecApprovalsFile, ExecApprovalsSnapshot, -} from "../controllers/exec-approvals"; -import { clampText, formatAgo, formatList } from "../format"; +} from "../controllers/exec-approvals.ts"; +import { clampText, formatAgo, formatList } from "../format.ts"; export type NodesProps = { loading: boolean; diff --git a/ui/src/ui/views/overview.ts b/ui/src/ui/views/overview.ts index 03f3b8ebd..142dbe20e 100644 --- a/ui/src/ui/views/overview.ts +++ b/ui/src/ui/views/overview.ts @@ -1,8 +1,8 @@ import { html } from "lit"; -import type { GatewayHelloOk } from "../gateway"; -import type { UiSettings } from "../storage"; -import { formatAgo, formatDurationMs } from "../format"; -import { formatNextRun } from "../presenter"; +import type { GatewayHelloOk } from "../gateway.ts"; +import type { UiSettings } from "../storage.ts"; +import { formatAgo, formatDurationMs } from "../format.ts"; +import { formatNextRun } from "../presenter.ts"; export type OverviewProps = { connected: boolean; diff --git a/ui/src/ui/views/sessions.ts b/ui/src/ui/views/sessions.ts index 47ac92c84..e1d69b337 100644 --- a/ui/src/ui/views/sessions.ts +++ b/ui/src/ui/views/sessions.ts @@ -1,8 +1,8 @@ import { html, nothing } from "lit"; -import type { GatewaySessionRow, SessionsListResult } from "../types"; -import { formatAgo } from "../format"; -import { pathForTab } from "../navigation"; -import { formatSessionTokens } from "../presenter"; +import type { GatewaySessionRow, SessionsListResult } from "../types.ts"; +import { formatAgo } from "../format.ts"; +import { pathForTab } from "../navigation.ts"; +import { formatSessionTokens } from "../presenter.ts"; export type SessionsProps = { loading: boolean; diff --git a/ui/src/ui/views/skills.ts b/ui/src/ui/views/skills.ts index a0f0d7d06..530800bef 100644 --- a/ui/src/ui/views/skills.ts +++ b/ui/src/ui/views/skills.ts @@ -1,7 +1,7 @@ import { html, nothing } from "lit"; -import type { SkillMessageMap } from "../controllers/skills"; -import type { SkillStatusEntry, SkillStatusReport } from "../types"; -import { clampText } from "../format"; +import type { SkillMessageMap } from "../controllers/skills.ts"; +import type { SkillStatusEntry, SkillStatusReport } from "../types.ts"; +import { clampText } from "../format.ts"; type SkillGroup = { id: string; diff --git a/ui/tsconfig.json b/ui/tsconfig.json index ce6c525cd..57d441152 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -1,11 +1,13 @@ { "compilerOptions": { "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", + "module": "NodeNext", + "allowImportingTsExtensions": true, + "moduleResolution": "NodeNext", "lib": ["ES2023", "DOM", "DOM.Iterable"], "strict": true, "noEmit": true, + "resolveJsonModule": true, "experimentalDecorators": true, "skipLibCheck": true, "types": ["vite/client"],