chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { NostrProfile } from "./types";
|
||||
import {
|
||||
loadChannels,
|
||||
logoutWhatsApp,
|
||||
@@ -5,8 +7,6 @@ import {
|
||||
waitWhatsAppLogin,
|
||||
} from "./controllers/channels";
|
||||
import { loadConfig, saveConfig } from "./controllers/config";
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { NostrProfile } from "./types";
|
||||
import { createNostrProfileFormState } from "./views/channels.nostr-profile-form";
|
||||
|
||||
export async function handleWhatsAppStart(host: OpenClawApp, force: boolean) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { abortChatRun, loadChatHistory, sendChatMessage } from "./controllers/chat";
|
||||
import { loadSessions } from "./controllers/sessions";
|
||||
import { generateUUID } from "./uuid";
|
||||
import { resetToolStream } from "./app-tool-stream";
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { GatewayHelloOk } from "./gateway";
|
||||
import type { ChatAttachment, ChatQueueItem } from "./ui-types";
|
||||
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 type { GatewayHelloOk } from "./gateway";
|
||||
import { parseAgentSessionKey } from "../../../src/sessions/session-key-utils.js";
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { ChatAttachment, ChatQueueItem } from "./ui-types";
|
||||
import { generateUUID } from "./uuid";
|
||||
|
||||
type ChatHost = {
|
||||
connected: boolean;
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import { loadChatHistory } from "./controllers/chat";
|
||||
import { loadDevices } from "./controllers/devices";
|
||||
import { loadNodes } from "./controllers/nodes";
|
||||
import { loadAgents } from "./controllers/agents";
|
||||
import type { GatewayEventFrame, GatewayHelloOk } from "./gateway";
|
||||
import { GatewayBrowserClient } from "./gateway";
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { EventLogEntry } from "./app-events";
|
||||
import type { AgentsListResult, PresenceEntry, HealthSnapshot, StatusSummary } from "./types";
|
||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
||||
import type { GatewayEventFrame, GatewayHelloOk } from "./gateway";
|
||||
import type { Tab } from "./navigation";
|
||||
import type { UiSettings } from "./storage";
|
||||
import { handleAgentEvent, resetToolStream, type AgentEventPayload } from "./app-tool-stream";
|
||||
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 {
|
||||
addExecApproval,
|
||||
parseExecApprovalRequested,
|
||||
parseExecApprovalResolved,
|
||||
removeExecApproval,
|
||||
} from "./controllers/exec-approval";
|
||||
import type { OpenClawApp } from "./app";
|
||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
||||
import { loadAssistantIdentity } from "./controllers/assistant-identity";
|
||||
import { loadNodes } from "./controllers/nodes";
|
||||
import { loadSessions } from "./controllers/sessions";
|
||||
import { GatewayBrowserClient } from "./gateway";
|
||||
|
||||
type GatewayHost = {
|
||||
settings: UiSettings;
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
import type { Tab } from "./navigation";
|
||||
import { connectGateway } from "./app-gateway";
|
||||
import {
|
||||
applySettingsFromUrl,
|
||||
attachThemeListener,
|
||||
detachThemeListener,
|
||||
inferBasePath,
|
||||
syncTabWithLocation,
|
||||
syncThemeWithSettings,
|
||||
} from "./app-settings";
|
||||
import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
||||
import {
|
||||
startLogsPolling,
|
||||
startNodesPolling,
|
||||
@@ -17,6 +8,15 @@ import {
|
||||
startDebugPolling,
|
||||
stopDebugPolling,
|
||||
} from "./app-polling";
|
||||
import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
||||
import {
|
||||
applySettingsFromUrl,
|
||||
attachThemeListener,
|
||||
detachThemeListener,
|
||||
inferBasePath,
|
||||
syncTabWithLocation,
|
||||
syncThemeWithSettings,
|
||||
} from "./app-settings";
|
||||
|
||||
type LifecycleHost = {
|
||||
basePath: string;
|
||||
|
||||
@@ -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 { loadDebug } from "./controllers/debug";
|
||||
import type { OpenClawApp } from "./app";
|
||||
|
||||
type PollingHost = {
|
||||
nodesPollInterval: number | null;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { html } from "lit";
|
||||
import { repeat } from "lit/directives/repeat.js";
|
||||
|
||||
import type { AppViewState } from "./app-view-state";
|
||||
import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation";
|
||||
import { icons } from "./icons";
|
||||
import { loadChatHistory } from "./controllers/chat";
|
||||
import { refreshChat } from "./app-chat";
|
||||
import { syncUrlWithSessionKey } from "./app-settings";
|
||||
import type { SessionsListResult } from "./types";
|
||||
import type { ThemeMode } from "./theme";
|
||||
import type { ThemeTransitionContext } from "./theme-transition";
|
||||
import type { SessionsListResult } from "./types";
|
||||
import { refreshChat } from "./app-chat";
|
||||
import { syncUrlWithSessionKey } from "./app-settings";
|
||||
import { loadChatHistory } from "./controllers/chat";
|
||||
import { icons } from "./icons";
|
||||
import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation";
|
||||
|
||||
export function renderTab(state: AppViewState, tab: Tab) {
|
||||
const href = pathForTab(tab, state.basePath);
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway";
|
||||
import type { AppViewState } from "./app-view-state";
|
||||
import { parseAgentSessionKey } from "../../../src/routing/session-key.js";
|
||||
import {
|
||||
TAB_GROUPS,
|
||||
iconForTab,
|
||||
pathForTab,
|
||||
subtitleForTab,
|
||||
titleForTab,
|
||||
type Tab,
|
||||
} from "./navigation";
|
||||
import { icons } from "./icons";
|
||||
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway";
|
||||
import type { UiSettings } from "./storage";
|
||||
import type { ThemeMode } from "./theme";
|
||||
import type { ThemeTransitionContext } from "./theme-transition";
|
||||
@@ -30,40 +19,10 @@ import type {
|
||||
StatusSummary,
|
||||
} from "./types";
|
||||
import type { ChatQueueItem, CronFormState } from "./ui-types";
|
||||
import { parseAgentSessionKey } from "../../../src/routing/session-key.js";
|
||||
import { refreshChatAvatar } from "./app-chat";
|
||||
import { renderChat } from "./views/chat";
|
||||
import { renderConfig } from "./views/config";
|
||||
import { renderChannels } from "./views/channels";
|
||||
import { renderCron } from "./views/cron";
|
||||
import { renderDebug } from "./views/debug";
|
||||
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 { renderExecApprovalPrompt } from "./views/exec-approval";
|
||||
import { renderGatewayUrlConfirmation } from "./views/gateway-url-confirmation";
|
||||
import {
|
||||
approveDevicePairing,
|
||||
loadDevices,
|
||||
rejectDevicePairing,
|
||||
revokeDeviceToken,
|
||||
rotateDeviceToken,
|
||||
} from "./controllers/devices";
|
||||
import { renderSkills } from "./views/skills";
|
||||
import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers";
|
||||
import { loadChannels } from "./controllers/channels";
|
||||
import { loadPresence } from "./controllers/presence";
|
||||
import { deleteSession, loadSessions, patchSession } from "./controllers/sessions";
|
||||
import {
|
||||
installSkill,
|
||||
loadSkills,
|
||||
saveSkillApiKey,
|
||||
updateSkillEdit,
|
||||
updateSkillEnabled,
|
||||
type SkillMessage,
|
||||
} from "./controllers/skills";
|
||||
import { loadNodes } from "./controllers/nodes";
|
||||
import { loadChatHistory } from "./controllers/chat";
|
||||
import {
|
||||
applyConfig,
|
||||
@@ -73,12 +32,6 @@ import {
|
||||
updateConfigFormValue,
|
||||
removeConfigFormValue,
|
||||
} from "./controllers/config";
|
||||
import {
|
||||
loadExecApprovals,
|
||||
removeExecApprovalsFormValue,
|
||||
saveExecApprovals,
|
||||
updateExecApprovalsFormValue,
|
||||
} from "./controllers/exec-approvals";
|
||||
import {
|
||||
loadCronRuns,
|
||||
toggleCronJob,
|
||||
@@ -87,7 +40,53 @@ import {
|
||||
addCronJob,
|
||||
} from "./controllers/cron";
|
||||
import { loadDebug, callDebugMethod } from "./controllers/debug";
|
||||
import {
|
||||
approveDevicePairing,
|
||||
loadDevices,
|
||||
rejectDevicePairing,
|
||||
revokeDeviceToken,
|
||||
rotateDeviceToken,
|
||||
} from "./controllers/devices";
|
||||
import {
|
||||
loadExecApprovals,
|
||||
removeExecApprovalsFormValue,
|
||||
saveExecApprovals,
|
||||
updateExecApprovalsFormValue,
|
||||
} from "./controllers/exec-approvals";
|
||||
import { loadLogs } from "./controllers/logs";
|
||||
import { loadNodes } from "./controllers/nodes";
|
||||
import { loadPresence } from "./controllers/presence";
|
||||
import { deleteSession, loadSessions, patchSession } from "./controllers/sessions";
|
||||
import {
|
||||
installSkill,
|
||||
loadSkills,
|
||||
saveSkillApiKey,
|
||||
updateSkillEdit,
|
||||
updateSkillEnabled,
|
||||
type SkillMessage,
|
||||
} from "./controllers/skills";
|
||||
import { icons } from "./icons";
|
||||
import {
|
||||
TAB_GROUPS,
|
||||
iconForTab,
|
||||
pathForTab,
|
||||
subtitleForTab,
|
||||
titleForTab,
|
||||
type Tab,
|
||||
} from "./navigation";
|
||||
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";
|
||||
|
||||
const AVATAR_DATA_RE = /^data:/i;
|
||||
const AVATAR_HTTP_RE = /^https?:\/\//i;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { Tab } from "./navigation";
|
||||
import { setTabFromRoute } from "./app-settings";
|
||||
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import type { OpenClawApp } from "./app";
|
||||
import { refreshChat } from "./app-chat";
|
||||
import {
|
||||
startLogsPolling,
|
||||
stopLogsPolling,
|
||||
startDebugPolling,
|
||||
stopDebugPolling,
|
||||
} from "./app-polling";
|
||||
import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
||||
import { loadChannels } from "./controllers/channels";
|
||||
import { loadConfig, loadConfigSchema } from "./controllers/config";
|
||||
import { loadCronJobs, loadCronStatus } from "./controllers/cron";
|
||||
import { loadChannels } from "./controllers/channels";
|
||||
import { loadDebug } from "./controllers/debug";
|
||||
import { loadLogs } from "./controllers/logs";
|
||||
import { loadDevices } from "./controllers/devices";
|
||||
import { loadNodes } from "./controllers/nodes";
|
||||
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";
|
||||
@@ -20,15 +29,6 @@ import {
|
||||
import { saveSettings, type UiSettings } from "./storage";
|
||||
import { resolveTheme, type ResolvedTheme, type ThemeMode } from "./theme";
|
||||
import { startThemeTransition, type ThemeTransitionContext } from "./theme-transition";
|
||||
import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
||||
import {
|
||||
startLogsPolling,
|
||||
stopLogsPolling,
|
||||
startDebugPolling,
|
||||
stopDebugPolling,
|
||||
} from "./app-polling";
|
||||
import { refreshChat } from "./app-chat";
|
||||
import type { OpenClawApp } from "./app";
|
||||
|
||||
type SettingsHost = {
|
||||
settings: UiSettings;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
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";
|
||||
@@ -20,11 +25,6 @@ import type {
|
||||
StatusSummary,
|
||||
} from "./types";
|
||||
import type { ChatAttachment, ChatQueueItem, CronFormState } from "./ui-types";
|
||||
import type { EventLogEntry } from "./app-events";
|
||||
import type { SkillMessage } from "./controllers/skills";
|
||||
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals";
|
||||
import type { DevicePairingList } from "./controllers/devices";
|
||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form";
|
||||
|
||||
export type AppViewState = {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { LitElement, html, nothing } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
|
||||
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 { GatewayBrowserClient, GatewayHelloOk } from "./gateway";
|
||||
import { resolveInjectedAssistantIdentity } from "./assistant-identity";
|
||||
import { loadSettings, type UiSettings } from "./storage";
|
||||
import { renderApp } from "./app-render";
|
||||
import type { Tab } from "./navigation";
|
||||
import type { ResolvedTheme, ThemeMode } from "./theme";
|
||||
import type {
|
||||
@@ -24,42 +24,7 @@ import type {
|
||||
StatusSummary,
|
||||
NostrProfile,
|
||||
} from "./types";
|
||||
import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types";
|
||||
import type { EventLogEntry } from "./app-events";
|
||||
import { DEFAULT_CRON_FORM, DEFAULT_LOG_LEVEL_FILTERS } from "./app-defaults";
|
||||
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals";
|
||||
import type { DevicePairingList } from "./controllers/devices";
|
||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
||||
import {
|
||||
resetToolStream as resetToolStreamInternal,
|
||||
type ToolStreamEntry,
|
||||
} from "./app-tool-stream";
|
||||
import {
|
||||
exportLogs as exportLogsInternal,
|
||||
handleChatScroll as handleChatScrollInternal,
|
||||
handleLogsScroll as handleLogsScrollInternal,
|
||||
resetChatScroll as resetChatScrollInternal,
|
||||
} from "./app-scroll";
|
||||
import { connectGateway as connectGatewayInternal } from "./app-gateway";
|
||||
import {
|
||||
handleConnected,
|
||||
handleDisconnected,
|
||||
handleFirstUpdated,
|
||||
handleUpdated,
|
||||
} from "./app-lifecycle";
|
||||
import {
|
||||
applySettings as applySettingsInternal,
|
||||
loadCron as loadCronInternal,
|
||||
loadOverview as loadOverviewInternal,
|
||||
setTab as setTabInternal,
|
||||
setTheme as setThemeInternal,
|
||||
onPopState as onPopStateInternal,
|
||||
} from "./app-settings";
|
||||
import {
|
||||
handleAbortChat as handleAbortChatInternal,
|
||||
handleSendChat as handleSendChatInternal,
|
||||
removeQueuedMessage as removeQueuedMessageInternal,
|
||||
} from "./app-chat";
|
||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form";
|
||||
import {
|
||||
handleChannelConfigReload as handleChannelConfigReloadInternal,
|
||||
handleChannelConfigSave as handleChannelConfigSaveInternal,
|
||||
@@ -73,8 +38,42 @@ import {
|
||||
handleWhatsAppStart as handleWhatsAppStartInternal,
|
||||
handleWhatsAppWait as handleWhatsAppWaitInternal,
|
||||
} from "./app-channels";
|
||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form";
|
||||
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";
|
||||
import {
|
||||
handleConnected,
|
||||
handleDisconnected,
|
||||
handleFirstUpdated,
|
||||
handleUpdated,
|
||||
} from "./app-lifecycle";
|
||||
import { renderApp } from "./app-render";
|
||||
import {
|
||||
exportLogs as exportLogsInternal,
|
||||
handleChatScroll as handleChatScrollInternal,
|
||||
handleLogsScroll as handleLogsScrollInternal,
|
||||
resetChatScroll as resetChatScrollInternal,
|
||||
} from "./app-scroll";
|
||||
import {
|
||||
applySettings as applySettingsInternal,
|
||||
loadCron as loadCronInternal,
|
||||
loadOverview as loadOverviewInternal,
|
||||
setTab as setTabInternal,
|
||||
setTheme as setThemeInternal,
|
||||
onPopState as onPopStateInternal,
|
||||
} from "./app-settings";
|
||||
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";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { OpenClawApp } from "./app";
|
||||
|
||||
const originalConnect = OpenClawApp.prototype.connect;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { html, nothing } from "lit";
|
||||
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
||||
|
||||
import type { AssistantIdentity } from "../assistant-identity";
|
||||
import { toSanitizedMarkdownHtml } from "../markdown";
|
||||
import type { MessageGroup } from "../types/chat-types";
|
||||
import { toSanitizedMarkdownHtml } from "../markdown";
|
||||
import { renderCopyAsMarkdownButton } from "./copy-as-markdown";
|
||||
import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer";
|
||||
import {
|
||||
extractTextCached,
|
||||
extractThinkingCached,
|
||||
formatReasoningMarkdown,
|
||||
} from "./message-extract";
|
||||
import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer";
|
||||
import { extractToolCards, renderToolCardSidebar } from "./tool-cards";
|
||||
|
||||
type ImageBlock = {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
extractText,
|
||||
extractTextCached,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatToolDetail, resolveToolDisplay } from "../tool-display";
|
||||
import { icons } from "../icons";
|
||||
import type { ToolCard } from "../types/chat-types";
|
||||
import { icons } from "../icons";
|
||||
import { formatToolDetail, resolveToolDisplay } from "../tool-display";
|
||||
import { TOOL_INLINE_THRESHOLD } from "./constants";
|
||||
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers";
|
||||
import { isToolResultMessage } from "./message-normalizer";
|
||||
import { extractTextCached } from "./message-extract";
|
||||
import { isToolResultMessage } from "./message-normalizer";
|
||||
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers";
|
||||
|
||||
export function extractToolCards(message: unknown): ToolCard[] {
|
||||
const m = message as Record<string, unknown>;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { render } from "lit";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { analyzeConfigSchema, renderConfigForm } from "./views/config-form";
|
||||
|
||||
const rootSchema = {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { handleChatEvent, type ChatEventPayload, type ChatState } from "./chat";
|
||||
|
||||
function createState(overrides: Partial<ChatState> = {}): ChatState {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { extractText } from "../chat/message-extract";
|
||||
import type { GatewayBrowserClient } from "../gateway";
|
||||
import { generateUUID } from "../uuid";
|
||||
import type { ChatAttachment } from "../ui-types";
|
||||
import { extractText } from "../chat/message-extract";
|
||||
import { generateUUID } from "../uuid";
|
||||
|
||||
export type ChatState = {
|
||||
client: GatewayBrowserClient | null;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
applyConfigSnapshot,
|
||||
applyConfig,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toNumber } from "../format";
|
||||
import type { GatewayBrowserClient } from "../gateway";
|
||||
import type { CronJob, CronRunLogEntry, CronStatus } from "../types";
|
||||
import type { CronFormState } from "../ui-types";
|
||||
import { toNumber } from "../format";
|
||||
|
||||
export type CronState = {
|
||||
client: GatewayBrowserClient | null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GatewayBrowserClient } from "../gateway";
|
||||
import { loadOrCreateDeviceIdentity } from "../device-identity";
|
||||
import { clearDeviceAuthToken, storeDeviceAuthToken } from "../device-auth";
|
||||
import { loadOrCreateDeviceIdentity } from "../device-identity";
|
||||
|
||||
export type DeviceTokenSummary = {
|
||||
role: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GatewayBrowserClient } from "../gateway";
|
||||
import { toNumber } from "../format";
|
||||
import type { SessionsListResult } from "../types";
|
||||
import { toNumber } from "../format";
|
||||
|
||||
export type SessionsState = {
|
||||
client: GatewayBrowserClient | null;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { OpenClawApp } from "./app";
|
||||
|
||||
const originalConnect = OpenClawApp.prototype.connect;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { stripThinkingTags } from "./format";
|
||||
|
||||
describe("stripThinkingTags", () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { generateUUID } from "./uuid";
|
||||
import { buildDeviceAuthPayload } from "../../../src/gateway/device-auth.js";
|
||||
import {
|
||||
GATEWAY_CLIENT_MODES,
|
||||
GATEWAY_CLIENT_NAMES,
|
||||
type GatewayClientMode,
|
||||
type GatewayClientName,
|
||||
} from "../../../src/gateway/protocol/client-info.js";
|
||||
import { buildDeviceAuthPayload } from "../../../src/gateway/device-auth.js";
|
||||
import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity";
|
||||
import { clearDeviceAuthToken, loadDeviceAuthToken, storeDeviceAuthToken } from "./device-auth";
|
||||
import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity";
|
||||
import { generateUUID } from "./uuid";
|
||||
|
||||
export type GatewayEventFrame = {
|
||||
type: "event";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { toSanitizedMarkdownHtml } from "./markdown";
|
||||
|
||||
describe("toSanitizedMarkdownHtml", () => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { OpenClawApp } from "./app";
|
||||
import "../styles.css";
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
TAB_GROUPS,
|
||||
iconForTab,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { formatAgo, formatDurationMs, formatMs } from "./format";
|
||||
import type { CronJob, GatewaySessionRow, PresenceEntry } from "./types";
|
||||
import { formatAgo, formatDurationMs, formatMs } from "./format";
|
||||
|
||||
export function formatPresenceSummary(entry: PresenceEntry): string {
|
||||
const host = entry.host ?? "unknown";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rawConfig from "./tool-display.json";
|
||||
import type { IconName } from "./icons";
|
||||
import rawConfig from "./tool-display.json";
|
||||
|
||||
type ToolDisplayActionSpec = {
|
||||
label?: string;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { generateUUID } from "./uuid";
|
||||
|
||||
describe("generateUUID", () => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html } from "lit";
|
||||
|
||||
import type { ConfigUiHints } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./config-form";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { DiscordStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderDiscordCard(params: {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { GoogleChatStatus } from "../types";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderGoogleChatCard(params: {
|
||||
props: ChannelsProps;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { IMessageStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderIMessageCard(params: {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
|
||||
import { html, nothing, type TemplateResult } from "lit";
|
||||
|
||||
import type { NostrProfile as NostrProfileType } from "../types";
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { ChannelAccountSnapshot, NostrStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
import {
|
||||
renderNostrProfileForm,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { ChannelAccountSnapshot } from "../types";
|
||||
import type { ChannelKey, ChannelsProps } from "./channels.types";
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { SignalStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderSignalCard(params: {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { SlackStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderSlackCard(params: {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type { ChannelAccountSnapshot, TelegramStatus } from "../types";
|
||||
import type { ChannelsProps } from "./channels.types";
|
||||
import { formatAgo } from "../format";
|
||||
import { renderChannelConfigSection } from "./channels.config";
|
||||
|
||||
export function renderTelegramCard(params: {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelUiMetaEntry,
|
||||
@@ -16,12 +14,13 @@ import type {
|
||||
WhatsAppStatus,
|
||||
} from "../types";
|
||||
import type { ChannelKey, ChannelsChannelData, ChannelsProps } from "./channels.types";
|
||||
import { channelEnabled, renderChannelAccountCount } from "./channels.shared";
|
||||
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";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
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";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { render } from "lit";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { SessionsListResult } from "../types";
|
||||
import { renderChat, type ChatProps } from "./chat";
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@ 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 { ChatAttachment, ChatQueueItem } from "../ui-types";
|
||||
import type { ChatItem, MessageGroup } from "../types/chat-types";
|
||||
import { icons } from "../icons";
|
||||
import { normalizeMessage, normalizeRoleForGrouping } from "../chat/message-normalizer";
|
||||
import type { ChatAttachment, ChatQueueItem } from "../ui-types";
|
||||
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";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { html, nothing } from "lit";
|
||||
import type { ConfigUiHints } from "../types";
|
||||
import { icons } from "../icons";
|
||||
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared";
|
||||
import { renderNode } from "./config-form.node";
|
||||
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared";
|
||||
|
||||
export type ConfigFormProps = {
|
||||
schema: JsonSchema | null;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { render } from "lit";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { renderConfig } from "./config";
|
||||
|
||||
describe("config view", () => {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { render } from "lit";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { DEFAULT_CRON_FORM } from "../app-defaults";
|
||||
import type { CronJob } from "../types";
|
||||
import { DEFAULT_CRON_FORM } from "../app-defaults";
|
||||
import { renderCron, type CronProps } from "./cron";
|
||||
|
||||
function createJob(id: string): CronJob {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types";
|
||||
import type { CronFormState } from "../ui-types";
|
||||
import { formatMs } from "../format";
|
||||
import {
|
||||
formatCronPayload,
|
||||
@@ -7,8 +8,6 @@ import {
|
||||
formatCronState,
|
||||
formatNextRun,
|
||||
} from "../presenter";
|
||||
import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types";
|
||||
import type { CronFormState } from "../ui-types";
|
||||
|
||||
export type CronProps = {
|
||||
loading: boolean;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatEventPayload } from "../presenter";
|
||||
import type { EventLogEntry } from "../app-events";
|
||||
import { formatEventPayload } from "../presenter";
|
||||
|
||||
export type DebugProps = {
|
||||
loading: boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { AppViewState } from "../app-view-state";
|
||||
|
||||
function formatRemaining(ms: number): string {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { AppViewState } from "../app-view-state";
|
||||
|
||||
export function renderGatewayUrlConfirmation(state: AppViewState) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatPresenceAge, formatPresenceSummary } from "../presenter";
|
||||
import type { PresenceEntry } from "../types";
|
||||
import { formatPresenceAge, formatPresenceSummary } from "../presenter";
|
||||
|
||||
export type InstancesProps = {
|
||||
loading: boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import type { LogEntry, LogLevel } from "../types";
|
||||
|
||||
const LEVELS: LogLevel[] = ["trace", "debug", "info", "warn", "error", "fatal"];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { html, nothing } from "lit";
|
||||
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
||||
|
||||
import { icons } from "../icons";
|
||||
import { toSanitizedMarkdownHtml } from "../markdown";
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { clampText, formatAgo, formatList } from "../format";
|
||||
import type {
|
||||
ExecApprovalsAllowlistEntry,
|
||||
ExecApprovalsFile,
|
||||
ExecApprovalsSnapshot,
|
||||
} from "../controllers/exec-approvals";
|
||||
import type {
|
||||
DevicePairingList,
|
||||
DeviceTokenSummary,
|
||||
PairedDevice,
|
||||
PendingDevice,
|
||||
} from "../controllers/devices";
|
||||
import type {
|
||||
ExecApprovalsAllowlistEntry,
|
||||
ExecApprovalsFile,
|
||||
ExecApprovalsSnapshot,
|
||||
} from "../controllers/exec-approvals";
|
||||
import { clampText, formatAgo, formatList } from "../format";
|
||||
|
||||
export type NodesProps = {
|
||||
loading: boolean;
|
||||
|
||||
@@ -1,9 +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 { UiSettings } from "../storage";
|
||||
|
||||
export type OverviewProps = {
|
||||
connected: boolean;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { formatAgo } from "../format";
|
||||
import { formatSessionTokens } from "../presenter";
|
||||
import { pathForTab } from "../navigation";
|
||||
import type { GatewaySessionRow, SessionsListResult } from "../types";
|
||||
import { formatAgo } from "../format";
|
||||
import { pathForTab } from "../navigation";
|
||||
import { formatSessionTokens } from "../presenter";
|
||||
|
||||
export type SessionsProps = {
|
||||
loading: boolean;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { html, nothing } from "lit";
|
||||
|
||||
import { clampText } from "../format";
|
||||
import type { SkillStatusEntry, SkillStatusReport } from "../types";
|
||||
import type { SkillMessageMap } from "../controllers/skills";
|
||||
import type { SkillStatusEntry, SkillStatusReport } from "../types";
|
||||
import { clampText } from "../format";
|
||||
|
||||
export type SkillsProps = {
|
||||
loading: boolean;
|
||||
|
||||
Reference in New Issue
Block a user