chore: Switch to NodeNext for module/moduleResolution in ui.
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import type { OpenClawApp } from "./app";
|
import type { OpenClawApp } from "./app.ts";
|
||||||
import type { NostrProfile } from "./types";
|
import type { NostrProfile } from "./types.ts";
|
||||||
import {
|
import {
|
||||||
loadChannels,
|
loadChannels,
|
||||||
logoutWhatsApp,
|
logoutWhatsApp,
|
||||||
startWhatsAppLogin,
|
startWhatsAppLogin,
|
||||||
waitWhatsAppLogin,
|
waitWhatsAppLogin,
|
||||||
} from "./controllers/channels";
|
} from "./controllers/channels.ts";
|
||||||
import { loadConfig, saveConfig } from "./controllers/config";
|
import { loadConfig, saveConfig } from "./controllers/config.ts";
|
||||||
import { createNostrProfileFormState } from "./views/channels.nostr-profile-form";
|
import { createNostrProfileFormState } from "./views/channels.nostr-profile-form.ts";
|
||||||
|
|
||||||
export async function handleWhatsAppStart(host: OpenClawApp, force: boolean) {
|
export async function handleWhatsAppStart(host: OpenClawApp, force: boolean) {
|
||||||
await startWhatsAppLogin(host, force);
|
await startWhatsAppLogin(host, force);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import type { OpenClawApp } from "./app";
|
import type { OpenClawApp } from "./app.ts";
|
||||||
import type { GatewayHelloOk } from "./gateway";
|
import type { GatewayHelloOk } from "./gateway.ts";
|
||||||
import type { ChatAttachment, ChatQueueItem } from "./ui-types";
|
import type { ChatAttachment, ChatQueueItem } from "./ui-types.ts";
|
||||||
import { parseAgentSessionKey } from "../../../src/sessions/session-key-utils.js";
|
import { parseAgentSessionKey } from "../../../src/sessions/session-key-utils.js";
|
||||||
import { scheduleChatScroll } from "./app-scroll";
|
import { scheduleChatScroll } from "./app-scroll.ts";
|
||||||
import { setLastActiveSessionKey } from "./app-settings";
|
import { setLastActiveSessionKey } from "./app-settings.ts";
|
||||||
import { resetToolStream } from "./app-tool-stream";
|
import { resetToolStream } from "./app-tool-stream.ts";
|
||||||
import { abortChatRun, loadChatHistory, sendChatMessage } from "./controllers/chat";
|
import { abortChatRun, loadChatHistory, sendChatMessage } from "./controllers/chat.ts";
|
||||||
import { loadSessions } from "./controllers/sessions";
|
import { loadSessions } from "./controllers/sessions.ts";
|
||||||
import { normalizeBasePath } from "./navigation";
|
import { normalizeBasePath } from "./navigation.ts";
|
||||||
import { generateUUID } from "./uuid";
|
import { generateUUID } from "./uuid.ts";
|
||||||
|
|
||||||
export type ChatHost = {
|
export type ChatHost = {
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { LogLevel } from "./types";
|
import type { LogLevel } from "./types.ts";
|
||||||
import type { CronFormState } from "./ui-types";
|
import type { CronFormState } from "./ui-types.ts";
|
||||||
|
|
||||||
export const DEFAULT_LOG_LEVEL_FILTERS: Record<LogLevel, boolean> = {
|
export const DEFAULT_LOG_LEVEL_FILTERS: Record<LogLevel, boolean> = {
|
||||||
trace: true,
|
trace: true,
|
||||||
|
|||||||
@@ -1,27 +1,32 @@
|
|||||||
import type { OpenClawApp } from "./app";
|
import type { EventLogEntry } from "./app-events.ts";
|
||||||
import type { EventLogEntry } from "./app-events";
|
import type { OpenClawApp } from "./app.ts";
|
||||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
import type { ExecApprovalRequest } from "./controllers/exec-approval.ts";
|
||||||
import type { GatewayEventFrame, GatewayHelloOk } from "./gateway";
|
import type { GatewayEventFrame, GatewayHelloOk } from "./gateway.ts";
|
||||||
import type { Tab } from "./navigation";
|
import type { Tab } from "./navigation.ts";
|
||||||
import type { UiSettings } from "./storage";
|
import type { UiSettings } from "./storage.ts";
|
||||||
import type { AgentsListResult, PresenceEntry, HealthSnapshot, StatusSummary } from "./types";
|
import type { AgentsListResult, PresenceEntry, HealthSnapshot, StatusSummary } from "./types.ts";
|
||||||
import { CHAT_SESSIONS_ACTIVE_MINUTES, flushChatQueueForEvent } from "./app-chat";
|
import { CHAT_SESSIONS_ACTIVE_MINUTES, flushChatQueueForEvent } from "./app-chat.ts";
|
||||||
import { applySettings, loadCron, refreshActiveTab, setLastActiveSessionKey } from "./app-settings";
|
import {
|
||||||
import { handleAgentEvent, resetToolStream, type AgentEventPayload } from "./app-tool-stream";
|
applySettings,
|
||||||
import { loadAgents } from "./controllers/agents";
|
loadCron,
|
||||||
import { loadAssistantIdentity } from "./controllers/assistant-identity";
|
refreshActiveTab,
|
||||||
import { loadChatHistory } from "./controllers/chat";
|
setLastActiveSessionKey,
|
||||||
import { handleChatEvent, type ChatEventPayload } from "./controllers/chat";
|
} from "./app-settings.ts";
|
||||||
import { loadDevices } from "./controllers/devices";
|
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 {
|
import {
|
||||||
addExecApproval,
|
addExecApproval,
|
||||||
parseExecApprovalRequested,
|
parseExecApprovalRequested,
|
||||||
parseExecApprovalResolved,
|
parseExecApprovalResolved,
|
||||||
removeExecApproval,
|
removeExecApproval,
|
||||||
} from "./controllers/exec-approval";
|
} from "./controllers/exec-approval.ts";
|
||||||
import { loadNodes } from "./controllers/nodes";
|
import { loadNodes } from "./controllers/nodes.ts";
|
||||||
import { loadSessions } from "./controllers/sessions";
|
import { loadSessions } from "./controllers/sessions.ts";
|
||||||
import { GatewayBrowserClient } from "./gateway";
|
import { GatewayBrowserClient } from "./gateway.ts";
|
||||||
|
|
||||||
type GatewayHost = {
|
type GatewayHost = {
|
||||||
settings: UiSettings;
|
settings: UiSettings;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { Tab } from "./navigation";
|
import type { Tab } from "./navigation.ts";
|
||||||
import { connectGateway } from "./app-gateway";
|
import { connectGateway } from "./app-gateway.ts";
|
||||||
import {
|
import {
|
||||||
startLogsPolling,
|
startLogsPolling,
|
||||||
startNodesPolling,
|
startNodesPolling,
|
||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
stopNodesPolling,
|
stopNodesPolling,
|
||||||
startDebugPolling,
|
startDebugPolling,
|
||||||
stopDebugPolling,
|
stopDebugPolling,
|
||||||
} from "./app-polling";
|
} from "./app-polling.ts";
|
||||||
import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
import { observeTopbar, scheduleChatScroll, scheduleLogsScroll } from "./app-scroll.ts";
|
||||||
import {
|
import {
|
||||||
applySettingsFromUrl,
|
applySettingsFromUrl,
|
||||||
attachThemeListener,
|
attachThemeListener,
|
||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
inferBasePath,
|
inferBasePath,
|
||||||
syncTabWithLocation,
|
syncTabWithLocation,
|
||||||
syncThemeWithSettings,
|
syncThemeWithSettings,
|
||||||
} from "./app-settings";
|
} from "./app-settings.ts";
|
||||||
|
|
||||||
type LifecycleHost = {
|
type LifecycleHost = {
|
||||||
basePath: string;
|
basePath: string;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { OpenClawApp } from "./app";
|
import type { OpenClawApp } from "./app.ts";
|
||||||
import { loadDebug } from "./controllers/debug";
|
import { loadDebug } from "./controllers/debug.ts";
|
||||||
import { loadLogs } from "./controllers/logs";
|
import { loadLogs } from "./controllers/logs.ts";
|
||||||
import { loadNodes } from "./controllers/nodes";
|
import { loadNodes } from "./controllers/nodes.ts";
|
||||||
|
|
||||||
type PollingHost = {
|
type PollingHost = {
|
||||||
nodesPollInterval: number | null;
|
nodesPollInterval: number | null;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { html } from "lit";
|
import { html } from "lit";
|
||||||
import { repeat } from "lit/directives/repeat.js";
|
import { repeat } from "lit/directives/repeat.js";
|
||||||
import type { AppViewState } from "./app-view-state";
|
import type { AppViewState } from "./app-view-state.ts";
|
||||||
import type { ThemeMode } from "./theme";
|
import type { ThemeTransitionContext } from "./theme-transition.ts";
|
||||||
import type { ThemeTransitionContext } from "./theme-transition";
|
import type { ThemeMode } from "./theme.ts";
|
||||||
import type { SessionsListResult } from "./types";
|
import type { SessionsListResult } from "./types.ts";
|
||||||
import { OpenClawApp } from "./app";
|
import { refreshChat } from "./app-chat.ts";
|
||||||
import { refreshChat } from "./app-chat";
|
import { syncUrlWithSessionKey } from "./app-settings.ts";
|
||||||
import { syncUrlWithSessionKey } from "./app-settings";
|
import { OpenClawApp } from "./app.ts";
|
||||||
import { ChatState, loadChatHistory } from "./controllers/chat";
|
import { ChatState, loadChatHistory } from "./controllers/chat.ts";
|
||||||
import { icons } from "./icons";
|
import { icons } from "./icons.ts";
|
||||||
import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation";
|
import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation.ts";
|
||||||
|
|
||||||
export function renderTab(state: AppViewState, tab: Tab) {
|
export function renderTab(state: AppViewState, tab: Tab) {
|
||||||
const href = pathForTab(tab, state.basePath);
|
const href = pathForTab(tab, state.basePath);
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { html, nothing } from "lit";
|
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 { parseAgentSessionKey } from "../../../src/routing/session-key.js";
|
||||||
import { OpenClawApp } from "./app";
|
import { ChatHost, refreshChatAvatar } from "./app-chat.ts";
|
||||||
import { ChatHost, refreshChatAvatar } from "./app-chat";
|
import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers.ts";
|
||||||
import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers";
|
import { OpenClawApp } from "./app.ts";
|
||||||
import { loadAgentFileContent, loadAgentFiles, saveAgentFile } from "./controllers/agent-files";
|
import { loadAgentFileContent, loadAgentFiles, saveAgentFile } from "./controllers/agent-files.ts";
|
||||||
import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity";
|
import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity.ts";
|
||||||
import { loadAgentSkills } from "./controllers/agent-skills";
|
import { loadAgentSkills } from "./controllers/agent-skills.ts";
|
||||||
import { loadAgents } from "./controllers/agents";
|
import { loadAgents } from "./controllers/agents.ts";
|
||||||
import { loadChannels } from "./controllers/channels";
|
import { loadChannels } from "./controllers/channels.ts";
|
||||||
import { ChatState, loadChatHistory } from "./controllers/chat";
|
import { ChatState, loadChatHistory } from "./controllers/chat.ts";
|
||||||
import {
|
import {
|
||||||
applyConfig,
|
applyConfig,
|
||||||
ConfigState,
|
ConfigState,
|
||||||
@@ -18,56 +18,56 @@ import {
|
|||||||
saveConfig,
|
saveConfig,
|
||||||
updateConfigFormValue,
|
updateConfigFormValue,
|
||||||
removeConfigFormValue,
|
removeConfigFormValue,
|
||||||
} from "./controllers/config";
|
} from "./controllers/config.ts";
|
||||||
import {
|
import {
|
||||||
loadCronRuns,
|
loadCronRuns,
|
||||||
toggleCronJob,
|
toggleCronJob,
|
||||||
runCronJob,
|
runCronJob,
|
||||||
removeCronJob,
|
removeCronJob,
|
||||||
addCronJob,
|
addCronJob,
|
||||||
} from "./controllers/cron";
|
} from "./controllers/cron.ts";
|
||||||
import { loadDebug, callDebugMethod } from "./controllers/debug";
|
import { loadDebug, callDebugMethod } from "./controllers/debug.ts";
|
||||||
import {
|
import {
|
||||||
approveDevicePairing,
|
approveDevicePairing,
|
||||||
loadDevices,
|
loadDevices,
|
||||||
rejectDevicePairing,
|
rejectDevicePairing,
|
||||||
revokeDeviceToken,
|
revokeDeviceToken,
|
||||||
rotateDeviceToken,
|
rotateDeviceToken,
|
||||||
} from "./controllers/devices";
|
} from "./controllers/devices.ts";
|
||||||
import {
|
import {
|
||||||
loadExecApprovals,
|
loadExecApprovals,
|
||||||
removeExecApprovalsFormValue,
|
removeExecApprovalsFormValue,
|
||||||
saveExecApprovals,
|
saveExecApprovals,
|
||||||
updateExecApprovalsFormValue,
|
updateExecApprovalsFormValue,
|
||||||
} from "./controllers/exec-approvals";
|
} from "./controllers/exec-approvals.ts";
|
||||||
import { loadLogs, LogsState } from "./controllers/logs";
|
import { loadLogs, LogsState } from "./controllers/logs.ts";
|
||||||
import { loadNodes } from "./controllers/nodes";
|
import { loadNodes } from "./controllers/nodes.ts";
|
||||||
import { loadPresence } from "./controllers/presence";
|
import { loadPresence } from "./controllers/presence.ts";
|
||||||
import { deleteSession, loadSessions, patchSession } from "./controllers/sessions";
|
import { deleteSession, loadSessions, patchSession } from "./controllers/sessions.ts";
|
||||||
import {
|
import {
|
||||||
installSkill,
|
installSkill,
|
||||||
loadSkills,
|
loadSkills,
|
||||||
saveSkillApiKey,
|
saveSkillApiKey,
|
||||||
updateSkillEdit,
|
updateSkillEdit,
|
||||||
updateSkillEnabled,
|
updateSkillEnabled,
|
||||||
} from "./controllers/skills";
|
} from "./controllers/skills.ts";
|
||||||
import { icons } from "./icons";
|
import { icons } from "./icons.ts";
|
||||||
import { TAB_GROUPS, subtitleForTab, titleForTab } from "./navigation";
|
import { TAB_GROUPS, subtitleForTab, titleForTab } from "./navigation.ts";
|
||||||
import { ConfigUiHints } from "./types";
|
import { ConfigUiHints } from "./types.ts";
|
||||||
import { renderAgents } from "./views/agents";
|
import { renderAgents } from "./views/agents.ts";
|
||||||
import { renderChannels } from "./views/channels";
|
import { renderChannels } from "./views/channels.ts";
|
||||||
import { renderChat } from "./views/chat";
|
import { renderChat } from "./views/chat.ts";
|
||||||
import { renderConfig } from "./views/config";
|
import { renderConfig } from "./views/config.ts";
|
||||||
import { renderCron } from "./views/cron";
|
import { renderCron } from "./views/cron.ts";
|
||||||
import { renderDebug } from "./views/debug";
|
import { renderDebug } from "./views/debug.ts";
|
||||||
import { renderExecApprovalPrompt } from "./views/exec-approval";
|
import { renderExecApprovalPrompt } from "./views/exec-approval.ts";
|
||||||
import { renderGatewayUrlConfirmation } from "./views/gateway-url-confirmation";
|
import { renderGatewayUrlConfirmation } from "./views/gateway-url-confirmation.ts";
|
||||||
import { renderInstances } from "./views/instances";
|
import { renderInstances } from "./views/instances.ts";
|
||||||
import { renderLogs } from "./views/logs";
|
import { renderLogs } from "./views/logs.ts";
|
||||||
import { renderNodes } from "./views/nodes";
|
import { renderNodes } from "./views/nodes.ts";
|
||||||
import { renderOverview } from "./views/overview";
|
import { renderOverview } from "./views/overview.ts";
|
||||||
import { renderSessions } from "./views/sessions";
|
import { renderSessions } from "./views/sessions.ts";
|
||||||
import { renderSkills } from "./views/skills";
|
import { renderSkills } from "./views/skills.ts";
|
||||||
|
|
||||||
const AVATAR_DATA_RE = /^data:/i;
|
const AVATAR_DATA_RE = /^data:/i;
|
||||||
const AVATAR_HTTP_RE = /^https?:\/\//i;
|
const AVATAR_HTTP_RE = /^https?:\/\//i;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
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 */
|
/* Helpers */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { Tab } from "./navigation";
|
import type { Tab } from "./navigation.ts";
|
||||||
import { setTabFromRoute } from "./app-settings";
|
import { setTabFromRoute } from "./app-settings.ts";
|
||||||
|
|
||||||
type SettingsHost = Parameters<typeof setTabFromRoute>[0] & {
|
type SettingsHost = Parameters<typeof setTabFromRoute>[0] & {
|
||||||
logsPollInterval: number | null;
|
logsPollInterval: number | null;
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
import type { OpenClawApp } from "./app";
|
import type { OpenClawApp } from "./app.ts";
|
||||||
import { refreshChat } from "./app-chat";
|
import { refreshChat } from "./app-chat.ts";
|
||||||
import {
|
import {
|
||||||
startLogsPolling,
|
startLogsPolling,
|
||||||
stopLogsPolling,
|
stopLogsPolling,
|
||||||
startDebugPolling,
|
startDebugPolling,
|
||||||
stopDebugPolling,
|
stopDebugPolling,
|
||||||
} from "./app-polling";
|
} from "./app-polling.ts";
|
||||||
import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll";
|
import { scheduleChatScroll, scheduleLogsScroll } from "./app-scroll.ts";
|
||||||
import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity";
|
import { loadAgentIdentities, loadAgentIdentity } from "./controllers/agent-identity.ts";
|
||||||
import { loadAgentSkills } from "./controllers/agent-skills";
|
import { loadAgentSkills } from "./controllers/agent-skills.ts";
|
||||||
import { loadAgents } from "./controllers/agents";
|
import { loadAgents } from "./controllers/agents.ts";
|
||||||
import { loadChannels } from "./controllers/channels";
|
import { loadChannels } from "./controllers/channels.ts";
|
||||||
import { loadConfig, loadConfigSchema } from "./controllers/config";
|
import { loadConfig, loadConfigSchema } from "./controllers/config.ts";
|
||||||
import { loadCronJobs, loadCronStatus } from "./controllers/cron";
|
import { loadCronJobs, loadCronStatus } from "./controllers/cron.ts";
|
||||||
import { loadDebug } from "./controllers/debug";
|
import { loadDebug } from "./controllers/debug.ts";
|
||||||
import { loadDevices } from "./controllers/devices";
|
import { loadDevices } from "./controllers/devices.ts";
|
||||||
import { loadExecApprovals } from "./controllers/exec-approvals";
|
import { loadExecApprovals } from "./controllers/exec-approvals.ts";
|
||||||
import { loadLogs } from "./controllers/logs";
|
import { loadLogs } from "./controllers/logs.ts";
|
||||||
import { loadNodes } from "./controllers/nodes";
|
import { loadNodes } from "./controllers/nodes.ts";
|
||||||
import { loadPresence } from "./controllers/presence";
|
import { loadPresence } from "./controllers/presence.ts";
|
||||||
import { loadSessions } from "./controllers/sessions";
|
import { loadSessions } from "./controllers/sessions.ts";
|
||||||
import { loadSkills } from "./controllers/skills";
|
import { loadSkills } from "./controllers/skills.ts";
|
||||||
import {
|
import {
|
||||||
inferBasePathFromPathname,
|
inferBasePathFromPathname,
|
||||||
normalizeBasePath,
|
normalizeBasePath,
|
||||||
@@ -28,10 +28,10 @@ import {
|
|||||||
pathForTab,
|
pathForTab,
|
||||||
tabFromPath,
|
tabFromPath,
|
||||||
type Tab,
|
type Tab,
|
||||||
} from "./navigation";
|
} from "./navigation.ts";
|
||||||
import { saveSettings, type UiSettings } from "./storage";
|
import { saveSettings, type UiSettings } from "./storage.ts";
|
||||||
import { resolveTheme, type ResolvedTheme, type ThemeMode } from "./theme";
|
import { startThemeTransition, type ThemeTransitionContext } from "./theme-transition.ts";
|
||||||
import { startThemeTransition, type ThemeTransitionContext } from "./theme-transition";
|
import { resolveTheme, type ResolvedTheme, type ThemeMode } from "./theme.ts";
|
||||||
|
|
||||||
type SettingsHost = {
|
type SettingsHost = {
|
||||||
settings: UiSettings;
|
settings: UiSettings;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { truncateText } from "./format";
|
import { truncateText } from "./format.ts";
|
||||||
|
|
||||||
const TOOL_STREAM_LIMIT = 50;
|
const TOOL_STREAM_LIMIT = 50;
|
||||||
const TOOL_STREAM_THROTTLE_MS = 80;
|
const TOOL_STREAM_THROTTLE_MS = 80;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import type { EventLogEntry } from "./app-events";
|
import type { EventLogEntry } from "./app-events.ts";
|
||||||
import type { DevicePairingList } from "./controllers/devices";
|
import type { DevicePairingList } from "./controllers/devices.ts";
|
||||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
import type { ExecApprovalRequest } from "./controllers/exec-approval.ts";
|
||||||
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals";
|
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals.ts";
|
||||||
import type { SkillMessage } from "./controllers/skills";
|
import type { SkillMessage } from "./controllers/skills.ts";
|
||||||
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway";
|
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway.ts";
|
||||||
import type { Tab } from "./navigation";
|
import type { Tab } from "./navigation.ts";
|
||||||
import type { UiSettings } from "./storage";
|
import type { UiSettings } from "./storage.ts";
|
||||||
import type { ThemeMode } from "./theme";
|
import type { ThemeTransitionContext } from "./theme-transition.ts";
|
||||||
import type { ThemeTransitionContext } from "./theme-transition";
|
import type { ThemeMode } from "./theme.ts";
|
||||||
import type {
|
import type {
|
||||||
AgentsListResult,
|
AgentsListResult,
|
||||||
AgentsFilesListResult,
|
AgentsFilesListResult,
|
||||||
@@ -25,9 +25,9 @@ import type {
|
|||||||
SessionsListResult,
|
SessionsListResult,
|
||||||
SkillStatusReport,
|
SkillStatusReport,
|
||||||
StatusSummary,
|
StatusSummary,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import type { ChatAttachment, ChatQueueItem, CronFormState } from "./ui-types";
|
import type { ChatAttachment, ChatQueueItem, CronFormState } from "./ui-types.ts";
|
||||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form";
|
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form.ts";
|
||||||
|
|
||||||
export type AppViewState = {
|
export type AppViewState = {
|
||||||
settings: UiSettings;
|
settings: UiSettings;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { LitElement } from "lit";
|
import { LitElement } from "lit";
|
||||||
import { customElement, state } from "lit/decorators.js";
|
import { customElement, state } from "lit/decorators.js";
|
||||||
import type { EventLogEntry } from "./app-events";
|
import type { EventLogEntry } from "./app-events.ts";
|
||||||
import type { AppViewState } from "./app-view-state";
|
import type { AppViewState } from "./app-view-state.ts";
|
||||||
import type { DevicePairingList } from "./controllers/devices";
|
import type { DevicePairingList } from "./controllers/devices.ts";
|
||||||
import type { ExecApprovalRequest } from "./controllers/exec-approval";
|
import type { ExecApprovalRequest } from "./controllers/exec-approval.ts";
|
||||||
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals";
|
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "./controllers/exec-approvals.ts";
|
||||||
import type { SkillMessage } from "./controllers/skills";
|
import type { SkillMessage } from "./controllers/skills.ts";
|
||||||
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway";
|
import type { GatewayBrowserClient, GatewayHelloOk } from "./gateway.ts";
|
||||||
import type { Tab } from "./navigation";
|
import type { Tab } from "./navigation.ts";
|
||||||
import type { ResolvedTheme, ThemeMode } from "./theme";
|
import type { ResolvedTheme, ThemeMode } from "./theme.ts";
|
||||||
import type {
|
import type {
|
||||||
AgentsListResult,
|
AgentsListResult,
|
||||||
AgentsFilesListResult,
|
AgentsFilesListResult,
|
||||||
@@ -27,8 +27,8 @@ import type {
|
|||||||
SkillStatusReport,
|
SkillStatusReport,
|
||||||
StatusSummary,
|
StatusSummary,
|
||||||
NostrProfile,
|
NostrProfile,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form";
|
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form.ts";
|
||||||
import {
|
import {
|
||||||
handleChannelConfigReload as handleChannelConfigReloadInternal,
|
handleChannelConfigReload as handleChannelConfigReloadInternal,
|
||||||
handleChannelConfigSave as handleChannelConfigSaveInternal,
|
handleChannelConfigSave as handleChannelConfigSaveInternal,
|
||||||
@@ -41,28 +41,28 @@ import {
|
|||||||
handleWhatsAppLogout as handleWhatsAppLogoutInternal,
|
handleWhatsAppLogout as handleWhatsAppLogoutInternal,
|
||||||
handleWhatsAppStart as handleWhatsAppStartInternal,
|
handleWhatsAppStart as handleWhatsAppStartInternal,
|
||||||
handleWhatsAppWait as handleWhatsAppWaitInternal,
|
handleWhatsAppWait as handleWhatsAppWaitInternal,
|
||||||
} from "./app-channels";
|
} from "./app-channels.ts";
|
||||||
import {
|
import {
|
||||||
handleAbortChat as handleAbortChatInternal,
|
handleAbortChat as handleAbortChatInternal,
|
||||||
handleSendChat as handleSendChatInternal,
|
handleSendChat as handleSendChatInternal,
|
||||||
removeQueuedMessage as removeQueuedMessageInternal,
|
removeQueuedMessage as removeQueuedMessageInternal,
|
||||||
} from "./app-chat";
|
} from "./app-chat.ts";
|
||||||
import { DEFAULT_CRON_FORM, DEFAULT_LOG_LEVEL_FILTERS } from "./app-defaults";
|
import { DEFAULT_CRON_FORM, DEFAULT_LOG_LEVEL_FILTERS } from "./app-defaults.ts";
|
||||||
import { connectGateway as connectGatewayInternal } from "./app-gateway";
|
import { connectGateway as connectGatewayInternal } from "./app-gateway.ts";
|
||||||
import {
|
import {
|
||||||
handleConnected,
|
handleConnected,
|
||||||
handleDisconnected,
|
handleDisconnected,
|
||||||
handleFirstUpdated,
|
handleFirstUpdated,
|
||||||
handleUpdated,
|
handleUpdated,
|
||||||
} from "./app-lifecycle";
|
} from "./app-lifecycle.ts";
|
||||||
import { renderApp } from "./app-render";
|
import { renderApp } from "./app-render.ts";
|
||||||
import {
|
import {
|
||||||
exportLogs as exportLogsInternal,
|
exportLogs as exportLogsInternal,
|
||||||
handleChatScroll as handleChatScrollInternal,
|
handleChatScroll as handleChatScrollInternal,
|
||||||
handleLogsScroll as handleLogsScrollInternal,
|
handleLogsScroll as handleLogsScrollInternal,
|
||||||
resetChatScroll as resetChatScrollInternal,
|
resetChatScroll as resetChatScrollInternal,
|
||||||
scheduleChatScroll as scheduleChatScrollInternal,
|
scheduleChatScroll as scheduleChatScrollInternal,
|
||||||
} from "./app-scroll";
|
} from "./app-scroll.ts";
|
||||||
import {
|
import {
|
||||||
applySettings as applySettingsInternal,
|
applySettings as applySettingsInternal,
|
||||||
loadCron as loadCronInternal,
|
loadCron as loadCronInternal,
|
||||||
@@ -70,15 +70,15 @@ import {
|
|||||||
setTab as setTabInternal,
|
setTab as setTabInternal,
|
||||||
setTheme as setThemeInternal,
|
setTheme as setThemeInternal,
|
||||||
onPopState as onPopStateInternal,
|
onPopState as onPopStateInternal,
|
||||||
} from "./app-settings";
|
} from "./app-settings.ts";
|
||||||
import {
|
import {
|
||||||
resetToolStream as resetToolStreamInternal,
|
resetToolStream as resetToolStreamInternal,
|
||||||
type ToolStreamEntry,
|
type ToolStreamEntry,
|
||||||
} from "./app-tool-stream";
|
} from "./app-tool-stream.ts";
|
||||||
import { resolveInjectedAssistantIdentity } from "./assistant-identity";
|
import { resolveInjectedAssistantIdentity } from "./assistant-identity.ts";
|
||||||
import { loadAssistantIdentity as loadAssistantIdentityInternal } from "./controllers/assistant-identity";
|
import { loadAssistantIdentity as loadAssistantIdentityInternal } from "./controllers/assistant-identity.ts";
|
||||||
import { loadSettings, type UiSettings } from "./storage";
|
import { loadSettings, type UiSettings } from "./storage.ts";
|
||||||
import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types";
|
import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types.ts";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
@@ -130,7 +130,7 @@ export class OpenClawApp extends LitElement {
|
|||||||
@state() chatStream: string | null = null;
|
@state() chatStream: string | null = null;
|
||||||
@state() chatStreamStartedAt: number | null = null;
|
@state() chatStreamStartedAt: number | null = null;
|
||||||
@state() chatRunId: string | 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() chatAvatarUrl: string | null = null;
|
||||||
@state() chatThinkingLevel: string | null = null;
|
@state() chatThinkingLevel: string | null = null;
|
||||||
@state() chatQueue: ChatQueueItem[] = [];
|
@state() chatQueue: ChatQueueItem[] = [];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { OpenClawApp } from "./app";
|
import { OpenClawApp } from "./app.ts";
|
||||||
|
|
||||||
// oxlint-disable-next-line typescript/unbound-method
|
// oxlint-disable-next-line typescript/unbound-method
|
||||||
const originalConnect = OpenClawApp.prototype.connect;
|
const originalConnect = OpenClawApp.prototype.connect;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { html, type TemplateResult } from "lit";
|
import { html, type TemplateResult } from "lit";
|
||||||
import { icons } from "../icons";
|
import { icons } from "../icons.ts";
|
||||||
|
|
||||||
const COPIED_FOR_MS = 1500;
|
const COPIED_FOR_MS = 1500;
|
||||||
const ERROR_FOR_MS = 2000;
|
const ERROR_FOR_MS = 2000;
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
||||||
import type { AssistantIdentity } from "../assistant-identity";
|
import type { AssistantIdentity } from "../assistant-identity.ts";
|
||||||
import type { MessageGroup } from "../types/chat-types";
|
import type { MessageGroup } from "../types/chat-types.ts";
|
||||||
import { toSanitizedMarkdownHtml } from "../markdown";
|
import { toSanitizedMarkdownHtml } from "../markdown.ts";
|
||||||
import { renderCopyAsMarkdownButton } from "./copy-as-markdown";
|
import { renderCopyAsMarkdownButton } from "./copy-as-markdown.ts";
|
||||||
import {
|
import {
|
||||||
extractTextCached,
|
extractTextCached,
|
||||||
extractThinkingCached,
|
extractThinkingCached,
|
||||||
formatReasoningMarkdown,
|
formatReasoningMarkdown,
|
||||||
} from "./message-extract";
|
} from "./message-extract.ts";
|
||||||
import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer";
|
import { isToolResultMessage, normalizeRoleForGrouping } from "./message-normalizer.ts";
|
||||||
import { extractToolCards, renderToolCardSidebar } from "./tool-cards";
|
import { extractToolCards, renderToolCardSidebar } from "./tool-cards.ts";
|
||||||
|
|
||||||
type ImageBlock = {
|
type ImageBlock = {
|
||||||
url: string;
|
url: string;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
extractTextCached,
|
extractTextCached,
|
||||||
extractThinking,
|
extractThinking,
|
||||||
extractThinkingCached,
|
extractThinkingCached,
|
||||||
} from "./message-extract";
|
} from "./message-extract.ts";
|
||||||
|
|
||||||
describe("extractTextCached", () => {
|
describe("extractTextCached", () => {
|
||||||
it("matches extractText output", () => {
|
it("matches extractText output", () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { stripThinkingTags } from "../format";
|
import { stripThinkingTags } from "../format.ts";
|
||||||
|
|
||||||
const ENVELOPE_PREFIX = /^\[([^\]]+)\]\s*/;
|
const ENVELOPE_PREFIX = /^\[([^\]]+)\]\s*/;
|
||||||
const ENVELOPE_CHANNELS = [
|
const ENVELOPE_CHANNELS = [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
normalizeMessage,
|
normalizeMessage,
|
||||||
normalizeRoleForGrouping,
|
normalizeRoleForGrouping,
|
||||||
isToolResultMessage,
|
isToolResultMessage,
|
||||||
} from "./message-normalizer";
|
} from "./message-normalizer.ts";
|
||||||
|
|
||||||
describe("message-normalizer", () => {
|
describe("message-normalizer", () => {
|
||||||
describe("normalizeMessage", () => {
|
describe("normalizeMessage", () => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Message normalization utilities for chat rendering.
|
* 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.
|
* Normalize a raw message object into a consistent structure.
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ToolCard } from "../types/chat-types";
|
import type { ToolCard } from "../types/chat-types.ts";
|
||||||
import { icons } from "../icons";
|
import { icons } from "../icons.ts";
|
||||||
import { formatToolDetail, resolveToolDisplay } from "../tool-display";
|
import { formatToolDetail, resolveToolDisplay } from "../tool-display.ts";
|
||||||
import { TOOL_INLINE_THRESHOLD } from "./constants";
|
import { TOOL_INLINE_THRESHOLD } from "./constants.ts";
|
||||||
import { extractTextCached } from "./message-extract";
|
import { extractTextCached } from "./message-extract.ts";
|
||||||
import { isToolResultMessage } from "./message-normalizer";
|
import { isToolResultMessage } from "./message-normalizer.ts";
|
||||||
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers";
|
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers.ts";
|
||||||
|
|
||||||
export function extractToolCards(message: unknown): ToolCard[] {
|
export function extractToolCards(message: unknown): ToolCard[] {
|
||||||
const m = message as Record<string, unknown>;
|
const m = message as Record<string, unknown>;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers";
|
import { formatToolOutputForSidebar, getTruncatedPreview } from "./tool-helpers.ts";
|
||||||
|
|
||||||
describe("tool-helpers", () => {
|
describe("tool-helpers", () => {
|
||||||
describe("formatToolOutputForSidebar", () => {
|
describe("formatToolOutputForSidebar", () => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Helper functions for tool card rendering.
|
* 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.
|
* Format tool output content for display in the sidebar.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { render } from "lit";
|
import { render } from "lit";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { analyzeConfigSchema, renderConfigForm } from "./views/config-form";
|
import { analyzeConfigSchema, renderConfigForm } from "./views/config-form.ts";
|
||||||
|
|
||||||
const rootSchema = {
|
const rootSchema = {
|
||||||
type: "object",
|
type: "object",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type {
|
import type {
|
||||||
AgentFileEntry,
|
AgentFileEntry,
|
||||||
AgentsFilesGetResult,
|
AgentsFilesGetResult,
|
||||||
AgentsFilesListResult,
|
AgentsFilesListResult,
|
||||||
AgentsFilesSetResult,
|
AgentsFilesSetResult,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
|
|
||||||
export type AgentFilesState = {
|
export type AgentFilesState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { AgentIdentityResult } from "../types";
|
import type { AgentIdentityResult } from "../types.ts";
|
||||||
|
|
||||||
export type AgentIdentityState = {
|
export type AgentIdentityState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { SkillStatusReport } from "../types";
|
import type { SkillStatusReport } from "../types.ts";
|
||||||
|
|
||||||
export type AgentSkillsState = {
|
export type AgentSkillsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { AgentsListResult } from "../types";
|
import type { AgentsListResult } from "../types.ts";
|
||||||
|
|
||||||
export type AgentsState = {
|
export type AgentsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import { normalizeAssistantIdentity } from "../assistant-identity";
|
import { normalizeAssistantIdentity } from "../assistant-identity.ts";
|
||||||
|
|
||||||
export type AssistantIdentityState = {
|
export type AssistantIdentityState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { ChannelsState } from "./channels.types";
|
import type { ChannelsState } from "./channels.types.ts";
|
||||||
import { ChannelsStatusSnapshot } from "../types";
|
import { ChannelsStatusSnapshot } from "../types.ts";
|
||||||
|
|
||||||
export type { ChannelsState };
|
export type { ChannelsState };
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { ChannelsStatusSnapshot } from "../types";
|
import type { ChannelsStatusSnapshot } from "../types.ts";
|
||||||
|
|
||||||
export type ChannelsState = {
|
export type ChannelsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
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> = {}): ChatState {
|
function createState(overrides: Partial<ChatState> = {}): ChatState {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { ChatAttachment } from "../ui-types";
|
import type { ChatAttachment } from "../ui-types.ts";
|
||||||
import { extractText } from "../chat/message-extract";
|
import { extractText } from "../chat/message-extract.ts";
|
||||||
import { generateUUID } from "../uuid";
|
import { generateUUID } from "../uuid.ts";
|
||||||
|
|
||||||
export type ChatState = {
|
export type ChatState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
runUpdate,
|
runUpdate,
|
||||||
updateConfigFormValue,
|
updateConfigFormValue,
|
||||||
type ConfigState,
|
type ConfigState,
|
||||||
} from "./config";
|
} from "./config.ts";
|
||||||
|
|
||||||
function createState(): ConfigState {
|
function createState(): ConfigState {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { ConfigSchemaResponse, ConfigSnapshot, ConfigUiHints } from "../types";
|
import type { ConfigSchemaResponse, ConfigSnapshot, ConfigUiHints } from "../types.ts";
|
||||||
import {
|
import {
|
||||||
cloneConfigObject,
|
cloneConfigObject,
|
||||||
removePathValue,
|
removePathValue,
|
||||||
serializeConfigForm,
|
serializeConfigForm,
|
||||||
setPathValue,
|
setPathValue,
|
||||||
} from "./config/form-utils";
|
} from "./config/form-utils.ts";
|
||||||
|
|
||||||
export type ConfigState = {
|
export type ConfigState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { CronJob, CronRunLogEntry, CronStatus } from "../types";
|
import type { CronJob, CronRunLogEntry, CronStatus } from "../types.ts";
|
||||||
import type { CronFormState } from "../ui-types";
|
import type { CronFormState } from "../ui-types.ts";
|
||||||
import { toNumber } from "../format";
|
import { toNumber } from "../format.ts";
|
||||||
|
|
||||||
export type CronState = {
|
export type CronState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { HealthSnapshot, StatusSummary } from "../types";
|
import type { HealthSnapshot, StatusSummary } from "../types.ts";
|
||||||
|
|
||||||
export type DebugState = {
|
export type DebugState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import { clearDeviceAuthToken, storeDeviceAuthToken } from "../device-auth";
|
import { clearDeviceAuthToken, storeDeviceAuthToken } from "../device-auth.ts";
|
||||||
import { loadOrCreateDeviceIdentity } from "../device-identity";
|
import { loadOrCreateDeviceIdentity } from "../device-identity.ts";
|
||||||
|
|
||||||
export type DeviceTokenSummary = {
|
export type DeviceTokenSummary = {
|
||||||
role: string;
|
role: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import { cloneConfigObject, removePathValue, setPathValue } from "./config/form-utils";
|
import { cloneConfigObject, removePathValue, setPathValue } from "./config/form-utils.ts";
|
||||||
|
|
||||||
export type ExecApprovalsDefaults = {
|
export type ExecApprovalsDefaults = {
|
||||||
security?: string;
|
security?: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { LogEntry, LogLevel } from "../types";
|
import type { LogEntry, LogLevel } from "../types.ts";
|
||||||
|
|
||||||
export type LogsState = {
|
export type LogsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
|
|
||||||
export type NodesState = {
|
export type NodesState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { PresenceEntry } from "../types";
|
import type { PresenceEntry } from "../types.ts";
|
||||||
|
|
||||||
export type PresenceState = {
|
export type PresenceState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { SessionsListResult } from "../types";
|
import type { SessionsListResult } from "../types.ts";
|
||||||
import { toNumber } from "../format";
|
import { toNumber } from "../format.ts";
|
||||||
|
|
||||||
export type SessionsState = {
|
export type SessionsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GatewayBrowserClient } from "../gateway";
|
import type { GatewayBrowserClient } from "../gateway.ts";
|
||||||
import type { SkillStatusReport } from "../types";
|
import type { SkillStatusReport } from "../types.ts";
|
||||||
|
|
||||||
export type SkillsState = {
|
export type SkillsState = {
|
||||||
client: GatewayBrowserClient | null;
|
client: GatewayBrowserClient | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { OpenClawApp } from "./app";
|
import { OpenClawApp } from "./app.ts";
|
||||||
|
|
||||||
// oxlint-disable-next-line typescript/unbound-method
|
// oxlint-disable-next-line typescript/unbound-method
|
||||||
const originalConnect = OpenClawApp.prototype.connect;
|
const originalConnect = OpenClawApp.prototype.connect;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { stripThinkingTags } from "./format";
|
import { stripThinkingTags } from "./format.ts";
|
||||||
|
|
||||||
describe("stripThinkingTags", () => {
|
describe("stripThinkingTags", () => {
|
||||||
it("strips <think>…</think> segments", () => {
|
it("strips <think>…</think> segments", () => {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
type GatewayClientMode,
|
type GatewayClientMode,
|
||||||
type GatewayClientName,
|
type GatewayClientName,
|
||||||
} from "../../../src/gateway/protocol/client-info.js";
|
} from "../../../src/gateway/protocol/client-info.js";
|
||||||
import { clearDeviceAuthToken, loadDeviceAuthToken, storeDeviceAuthToken } from "./device-auth";
|
import { clearDeviceAuthToken, loadDeviceAuthToken, storeDeviceAuthToken } from "./device-auth.ts";
|
||||||
import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity";
|
import { loadOrCreateDeviceIdentity, signDevicePayload } from "./device-identity.ts";
|
||||||
import { generateUUID } from "./uuid";
|
import { generateUUID } from "./uuid.ts";
|
||||||
|
|
||||||
export type GatewayEventFrame = {
|
export type GatewayEventFrame = {
|
||||||
type: "event";
|
type: "event";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { toSanitizedMarkdownHtml } from "./markdown";
|
import { toSanitizedMarkdownHtml } from "./markdown.ts";
|
||||||
|
|
||||||
describe("toSanitizedMarkdownHtml", () => {
|
describe("toSanitizedMarkdownHtml", () => {
|
||||||
it("renders basic markdown", () => {
|
it("renders basic markdown", () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import DOMPurify from "dompurify";
|
import DOMPurify from "dompurify";
|
||||||
import { marked } from "marked";
|
import { marked } from "marked";
|
||||||
import { truncateText } from "./format";
|
import { truncateText } from "./format.ts";
|
||||||
|
|
||||||
marked.setOptions({
|
marked.setOptions({
|
||||||
gfm: true,
|
gfm: true,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { OpenClawApp } from "./app";
|
import { OpenClawApp } from "./app.ts";
|
||||||
import "../styles.css";
|
import "../styles.css";
|
||||||
|
|
||||||
// oxlint-disable-next-line typescript/unbound-method
|
// oxlint-disable-next-line typescript/unbound-method
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
tabFromPath,
|
tabFromPath,
|
||||||
titleForTab,
|
titleForTab,
|
||||||
type Tab,
|
type Tab,
|
||||||
} from "./navigation";
|
} from "./navigation.ts";
|
||||||
|
|
||||||
/** All valid tab identifiers derived from TAB_GROUPS */
|
/** All valid tab identifiers derived from TAB_GROUPS */
|
||||||
const ALL_TABS: Tab[] = TAB_GROUPS.flatMap((group) => group.tabs) as Tab[];
|
const ALL_TABS: Tab[] = TAB_GROUPS.flatMap((group) => group.tabs) as Tab[];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { CronJob, GatewaySessionRow, PresenceEntry } from "./types";
|
import type { CronJob, GatewaySessionRow, PresenceEntry } from "./types.ts";
|
||||||
import { formatAgo, formatDurationMs, formatMs } from "./format";
|
import { formatAgo, formatDurationMs, formatMs } from "./format.ts";
|
||||||
|
|
||||||
export function formatPresenceSummary(entry: PresenceEntry): string {
|
export function formatPresenceSummary(entry: PresenceEntry): string {
|
||||||
const host = entry.host ?? "unknown";
|
const host = entry.host ?? "unknown";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const KEY = "openclaw.control.settings.v1";
|
const KEY = "openclaw.control.settings.v1";
|
||||||
|
|
||||||
import type { ThemeMode } from "./theme";
|
import type { ThemeMode } from "./theme.ts";
|
||||||
|
|
||||||
export type UiSettings = {
|
export type UiSettings = {
|
||||||
gatewayUrl: string;
|
gatewayUrl: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ThemeMode } from "./theme";
|
import type { ThemeMode } from "./theme.ts";
|
||||||
|
|
||||||
export type ThemeTransitionContext = {
|
export type ThemeTransitionContext = {
|
||||||
element?: HTMLElement | null;
|
element?: HTMLElement | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { IconName } from "./icons";
|
import type { IconName } from "./icons.ts";
|
||||||
import rawConfig from "./tool-display.json";
|
import rawConfig from "./tool-display.json" with { type: "json" };
|
||||||
|
|
||||||
type ToolDisplayActionSpec = {
|
type ToolDisplayActionSpec = {
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { generateUUID } from "./uuid";
|
import { generateUUID } from "./uuid.ts";
|
||||||
|
|
||||||
describe("generateUUID", () => {
|
describe("generateUUID", () => {
|
||||||
it("uses crypto.randomUUID when available", () => {
|
it("uses crypto.randomUUID when available", () => {
|
||||||
|
|||||||
@@ -10,19 +10,19 @@ import type {
|
|||||||
CronStatus,
|
CronStatus,
|
||||||
SkillStatusEntry,
|
SkillStatusEntry,
|
||||||
SkillStatusReport,
|
SkillStatusReport,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import {
|
import {
|
||||||
expandToolGroups,
|
expandToolGroups,
|
||||||
normalizeToolName,
|
normalizeToolName,
|
||||||
resolveToolProfilePolicy,
|
resolveToolProfilePolicy,
|
||||||
} from "../../../../src/agents/tool-policy.js";
|
} from "../../../../src/agents/tool-policy.js";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import {
|
import {
|
||||||
formatCronPayload,
|
formatCronPayload,
|
||||||
formatCronSchedule,
|
formatCronSchedule,
|
||||||
formatCronState,
|
formatCronState,
|
||||||
formatNextRun,
|
formatNextRun,
|
||||||
} from "../presenter";
|
} from "../presenter.ts";
|
||||||
|
|
||||||
export type AgentsPanel = "overview" | "files" | "tools" | "skills" | "channels" | "cron";
|
export type AgentsPanel = "overview" | "files" | "tools" | "skills" | "channels" | "cron";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { html } from "lit";
|
import { html } from "lit";
|
||||||
import type { ConfigUiHints } from "../types";
|
import type { ConfigUiHints } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./config-form";
|
import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./config-form.ts";
|
||||||
|
|
||||||
type ChannelConfigFormProps = {
|
type ChannelConfigFormProps = {
|
||||||
channelId: string;
|
channelId: string;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { DiscordStatus } from "../types";
|
import type { DiscordStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderDiscordCard(params: {
|
export function renderDiscordCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { GoogleChatStatus } from "../types";
|
import type { GoogleChatStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderGoogleChatCard(params: {
|
export function renderGoogleChatCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { IMessageStatus } from "../types";
|
import type { IMessageStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderIMessageCard(params: {
|
export function renderIMessageCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { html, nothing, type TemplateResult } from "lit";
|
import { html, nothing, type TemplateResult } from "lit";
|
||||||
import type { NostrProfile as NostrProfileType } from "../types";
|
import type { NostrProfile as NostrProfileType } from "../types.ts";
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Types
|
// Types
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ChannelAccountSnapshot, NostrStatus } from "../types";
|
import type { ChannelAccountSnapshot, NostrStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
import {
|
import {
|
||||||
renderNostrProfileForm,
|
renderNostrProfileForm,
|
||||||
type NostrProfileFormState,
|
type NostrProfileFormState,
|
||||||
type NostrProfileFormCallbacks,
|
type NostrProfileFormCallbacks,
|
||||||
} from "./channels.nostr-profile-form";
|
} from "./channels.nostr-profile-form.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Truncate a pubkey for display (shows first and last 8 chars)
|
* Truncate a pubkey for display (shows first and last 8 chars)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ChannelAccountSnapshot } from "../types";
|
import type { ChannelAccountSnapshot } from "../types.ts";
|
||||||
import type { ChannelKey, ChannelsProps } from "./channels.types";
|
import type { ChannelKey, ChannelsProps } from "./channels.types.ts";
|
||||||
|
|
||||||
export function formatDuration(ms?: number | null) {
|
export function formatDuration(ms?: number | null) {
|
||||||
if (!ms && ms !== 0) {
|
if (!ms && ms !== 0) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { SignalStatus } from "../types";
|
import type { SignalStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderSignalCard(params: {
|
export function renderSignalCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { SlackStatus } from "../types";
|
import type { SlackStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderSlackCard(params: {
|
export function renderSlackCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ChannelAccountSnapshot, TelegramStatus } from "../types";
|
import type { ChannelAccountSnapshot, TelegramStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
|
|
||||||
export function renderTelegramCard(params: {
|
export function renderTelegramCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -12,19 +12,19 @@ import type {
|
|||||||
SlackStatus,
|
SlackStatus,
|
||||||
TelegramStatus,
|
TelegramStatus,
|
||||||
WhatsAppStatus,
|
WhatsAppStatus,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import type { ChannelKey, ChannelsChannelData, ChannelsProps } from "./channels.types";
|
import type { ChannelKey, ChannelsChannelData, ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
import { renderDiscordCard } from "./channels.discord";
|
import { renderDiscordCard } from "./channels.discord.ts";
|
||||||
import { renderGoogleChatCard } from "./channels.googlechat";
|
import { renderGoogleChatCard } from "./channels.googlechat.ts";
|
||||||
import { renderIMessageCard } from "./channels.imessage";
|
import { renderIMessageCard } from "./channels.imessage.ts";
|
||||||
import { renderNostrCard } from "./channels.nostr";
|
import { renderNostrCard } from "./channels.nostr.ts";
|
||||||
import { channelEnabled, renderChannelAccountCount } from "./channels.shared";
|
import { channelEnabled, renderChannelAccountCount } from "./channels.shared.ts";
|
||||||
import { renderSignalCard } from "./channels.signal";
|
import { renderSignalCard } from "./channels.signal.ts";
|
||||||
import { renderSlackCard } from "./channels.slack";
|
import { renderSlackCard } from "./channels.slack.ts";
|
||||||
import { renderTelegramCard } from "./channels.telegram";
|
import { renderTelegramCard } from "./channels.telegram.ts";
|
||||||
import { renderWhatsAppCard } from "./channels.whatsapp";
|
import { renderWhatsAppCard } from "./channels.whatsapp.ts";
|
||||||
|
|
||||||
export function renderChannels(props: ChannelsProps) {
|
export function renderChannels(props: ChannelsProps) {
|
||||||
const channels = props.snapshot?.channels as Record<string, unknown> | null;
|
const channels = props.snapshot?.channels as Record<string, unknown> | null;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import type {
|
|||||||
SlackStatus,
|
SlackStatus,
|
||||||
TelegramStatus,
|
TelegramStatus,
|
||||||
WhatsAppStatus,
|
WhatsAppStatus,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import type { NostrProfileFormState } from "./channels.nostr-profile-form";
|
import type { NostrProfileFormState } from "./channels.nostr-profile-form.ts";
|
||||||
|
|
||||||
export type ChannelKey = string;
|
export type ChannelKey = string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { WhatsAppStatus } from "../types";
|
import type { WhatsAppStatus } from "../types.ts";
|
||||||
import type { ChannelsProps } from "./channels.types";
|
import type { ChannelsProps } from "./channels.types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { renderChannelConfigSection } from "./channels.config";
|
import { renderChannelConfigSection } from "./channels.config.ts";
|
||||||
import { formatDuration } from "./channels.shared";
|
import { formatDuration } from "./channels.shared.ts";
|
||||||
|
|
||||||
export function renderWhatsAppCard(params: {
|
export function renderWhatsAppCard(params: {
|
||||||
props: ChannelsProps;
|
props: ChannelsProps;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { render } from "lit";
|
import { render } from "lit";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import type { SessionsListResult } from "../types";
|
import type { SessionsListResult } from "../types.ts";
|
||||||
import { renderChat, type ChatProps } from "./chat";
|
import { renderChat, type ChatProps } from "./chat.ts";
|
||||||
|
|
||||||
function createSessions(): SessionsListResult {
|
function createSessions(): SessionsListResult {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import { ref } from "lit/directives/ref.js";
|
import { ref } from "lit/directives/ref.js";
|
||||||
import { repeat } from "lit/directives/repeat.js";
|
import { repeat } from "lit/directives/repeat.js";
|
||||||
import type { SessionsListResult } from "../types";
|
import type { SessionsListResult } from "../types.ts";
|
||||||
import type { ChatItem, MessageGroup } from "../types/chat-types";
|
import type { ChatItem, MessageGroup } from "../types/chat-types.ts";
|
||||||
import type { ChatAttachment, ChatQueueItem } from "../ui-types";
|
import type { ChatAttachment, ChatQueueItem } from "../ui-types.ts";
|
||||||
import {
|
import {
|
||||||
renderMessageGroup,
|
renderMessageGroup,
|
||||||
renderReadingIndicatorGroup,
|
renderReadingIndicatorGroup,
|
||||||
renderStreamingGroup,
|
renderStreamingGroup,
|
||||||
} from "../chat/grouped-render";
|
} from "../chat/grouped-render.ts";
|
||||||
import { normalizeMessage, normalizeRoleForGrouping } from "../chat/message-normalizer";
|
import { normalizeMessage, normalizeRoleForGrouping } from "../chat/message-normalizer.ts";
|
||||||
import { icons } from "../icons";
|
import { icons } from "../icons.ts";
|
||||||
import { renderMarkdownSidebar } from "./markdown-sidebar";
|
import { renderMarkdownSidebar } from "./markdown-sidebar.ts";
|
||||||
import "../components/resizable-divider";
|
import "../components/resizable-divider.ts";
|
||||||
|
|
||||||
export type CompactionIndicatorStatus = {
|
export type CompactionIndicatorStatus = {
|
||||||
active: boolean;
|
active: boolean;
|
||||||
|
|||||||
@@ -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 = {
|
export type ConfigSchemaAnalysis = {
|
||||||
schema: JsonSchema | null;
|
schema: JsonSchema | null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { html, nothing, type TemplateResult } from "lit";
|
import { html, nothing, type TemplateResult } from "lit";
|
||||||
import type { ConfigUiHints } from "../types";
|
import type { ConfigUiHints } from "../types.ts";
|
||||||
import {
|
import {
|
||||||
defaultValue,
|
defaultValue,
|
||||||
hintForPath,
|
hintForPath,
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
pathKey,
|
pathKey,
|
||||||
schemaType,
|
schemaType,
|
||||||
type JsonSchema,
|
type JsonSchema,
|
||||||
} from "./config-form.shared";
|
} from "./config-form.shared.ts";
|
||||||
|
|
||||||
const META_KEYS = new Set(["title", "description", "default", "nullable"]);
|
const META_KEYS = new Set(["title", "description", "default", "nullable"]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ConfigUiHints } from "../types";
|
import type { ConfigUiHints } from "../types.ts";
|
||||||
import { icons } from "../icons";
|
import { icons } from "../icons.ts";
|
||||||
import { renderNode } from "./config-form.node";
|
import { renderNode } from "./config-form.node.ts";
|
||||||
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared";
|
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared.ts";
|
||||||
|
|
||||||
export type ConfigFormProps = {
|
export type ConfigFormProps = {
|
||||||
schema: JsonSchema | null;
|
schema: JsonSchema | null;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ConfigUiHints } from "../types";
|
import type { ConfigUiHints } from "../types.ts";
|
||||||
|
|
||||||
export type JsonSchema = {
|
export type JsonSchema = {
|
||||||
type?: string | string[];
|
type?: string | string[];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export { renderConfigForm, type ConfigFormProps, SECTION_META } from "./config-form.render";
|
export { renderConfigForm, type ConfigFormProps, SECTION_META } from "./config-form.render.ts";
|
||||||
export { analyzeConfigSchema, type ConfigSchemaAnalysis } from "./config-form.analyze";
|
export { analyzeConfigSchema, type ConfigSchemaAnalysis } from "./config-form.analyze.ts";
|
||||||
export { renderNode } from "./config-form.node";
|
export { renderNode } from "./config-form.node.ts";
|
||||||
export { schemaType, type JsonSchema } from "./config-form.shared";
|
export { schemaType, type JsonSchema } from "./config-form.shared.ts";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { render } from "lit";
|
import { render } from "lit";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { renderConfig } from "./config";
|
import { renderConfig } from "./config.ts";
|
||||||
|
|
||||||
describe("config view", () => {
|
describe("config view", () => {
|
||||||
const baseProps = () => ({
|
const baseProps = () => ({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ConfigUiHints } from "../types";
|
import type { ConfigUiHints } from "../types.ts";
|
||||||
import { analyzeConfigSchema, renderConfigForm, SECTION_META } from "./config-form";
|
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared.ts";
|
||||||
import { hintForPath, humanize, schemaType, type JsonSchema } from "./config-form.shared";
|
import { analyzeConfigSchema, renderConfigForm, SECTION_META } from "./config-form.ts";
|
||||||
|
|
||||||
export type ConfigProps = {
|
export type ConfigProps = {
|
||||||
raw: string;
|
raw: string;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { render } from "lit";
|
import { render } from "lit";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import type { CronJob } from "../types";
|
import type { CronJob } from "../types.ts";
|
||||||
import { DEFAULT_CRON_FORM } from "../app-defaults";
|
import { DEFAULT_CRON_FORM } from "../app-defaults.ts";
|
||||||
import { renderCron, type CronProps } from "./cron";
|
import { renderCron, type CronProps } from "./cron.ts";
|
||||||
|
|
||||||
function createJob(id: string): CronJob {
|
function createJob(id: string): CronJob {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types";
|
import type { ChannelUiMetaEntry, CronJob, CronRunLogEntry, CronStatus } from "../types.ts";
|
||||||
import type { CronFormState } from "../ui-types";
|
import type { CronFormState } from "../ui-types.ts";
|
||||||
import { formatMs } from "../format";
|
import { formatMs } from "../format.ts";
|
||||||
import {
|
import {
|
||||||
formatCronPayload,
|
formatCronPayload,
|
||||||
formatCronSchedule,
|
formatCronSchedule,
|
||||||
formatCronState,
|
formatCronState,
|
||||||
formatNextRun,
|
formatNextRun,
|
||||||
} from "../presenter";
|
} from "../presenter.ts";
|
||||||
|
|
||||||
export type CronProps = {
|
export type CronProps = {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { EventLogEntry } from "../app-events";
|
import type { EventLogEntry } from "../app-events.ts";
|
||||||
import { formatEventPayload } from "../presenter";
|
import { formatEventPayload } from "../presenter.ts";
|
||||||
|
|
||||||
export type DebugProps = {
|
export type DebugProps = {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { html, nothing } from "lit";
|
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 {
|
function formatRemaining(ms: number): string {
|
||||||
const remaining = Math.max(0, ms);
|
const remaining = Math.max(0, ms);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { html, nothing } from "lit";
|
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) {
|
export function renderGatewayUrlConfirmation(state: AppViewState) {
|
||||||
const { pendingGatewayUrl } = state;
|
const { pendingGatewayUrl } = state;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { PresenceEntry } from "../types";
|
import type { PresenceEntry } from "../types.ts";
|
||||||
import { formatPresenceAge, formatPresenceSummary } from "../presenter";
|
import { formatPresenceAge, formatPresenceSummary } from "../presenter.ts";
|
||||||
|
|
||||||
export type InstancesProps = {
|
export type InstancesProps = {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { html, nothing } from "lit";
|
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"];
|
const LEVELS: LogLevel[] = ["trace", "debug", "info", "warn", "error", "fatal"];
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { html } from "lit";
|
import { html } from "lit";
|
||||||
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
||||||
import { icons } from "../icons";
|
import { icons } from "../icons.ts";
|
||||||
import { toSanitizedMarkdownHtml } from "../markdown";
|
import { toSanitizedMarkdownHtml } from "../markdown.ts";
|
||||||
|
|
||||||
export type MarkdownSidebarProps = {
|
export type MarkdownSidebarProps = {
|
||||||
content: string | null;
|
content: string | null;
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import type {
|
|||||||
DeviceTokenSummary,
|
DeviceTokenSummary,
|
||||||
PairedDevice,
|
PairedDevice,
|
||||||
PendingDevice,
|
PendingDevice,
|
||||||
} from "../controllers/devices";
|
} from "../controllers/devices.ts";
|
||||||
import type {
|
import type {
|
||||||
ExecApprovalsAllowlistEntry,
|
ExecApprovalsAllowlistEntry,
|
||||||
ExecApprovalsFile,
|
ExecApprovalsFile,
|
||||||
ExecApprovalsSnapshot,
|
ExecApprovalsSnapshot,
|
||||||
} from "../controllers/exec-approvals";
|
} from "../controllers/exec-approvals.ts";
|
||||||
import { clampText, formatAgo, formatList } from "../format";
|
import { clampText, formatAgo, formatList } from "../format.ts";
|
||||||
|
|
||||||
export type NodesProps = {
|
export type NodesProps = {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html } from "lit";
|
import { html } from "lit";
|
||||||
import type { GatewayHelloOk } from "../gateway";
|
import type { GatewayHelloOk } from "../gateway.ts";
|
||||||
import type { UiSettings } from "../storage";
|
import type { UiSettings } from "../storage.ts";
|
||||||
import { formatAgo, formatDurationMs } from "../format";
|
import { formatAgo, formatDurationMs } from "../format.ts";
|
||||||
import { formatNextRun } from "../presenter";
|
import { formatNextRun } from "../presenter.ts";
|
||||||
|
|
||||||
export type OverviewProps = {
|
export type OverviewProps = {
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { GatewaySessionRow, SessionsListResult } from "../types";
|
import type { GatewaySessionRow, SessionsListResult } from "../types.ts";
|
||||||
import { formatAgo } from "../format";
|
import { formatAgo } from "../format.ts";
|
||||||
import { pathForTab } from "../navigation";
|
import { pathForTab } from "../navigation.ts";
|
||||||
import { formatSessionTokens } from "../presenter";
|
import { formatSessionTokens } from "../presenter.ts";
|
||||||
|
|
||||||
export type SessionsProps = {
|
export type SessionsProps = {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import type { SkillMessageMap } from "../controllers/skills";
|
import type { SkillMessageMap } from "../controllers/skills.ts";
|
||||||
import type { SkillStatusEntry, SkillStatusReport } from "../types";
|
import type { SkillStatusEntry, SkillStatusReport } from "../types.ts";
|
||||||
import { clampText } from "../format";
|
import { clampText } from "../format.ts";
|
||||||
|
|
||||||
type SkillGroup = {
|
type SkillGroup = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ESNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "Bundler",
|
"allowImportingTsExtensions": true,
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"types": ["vite/client"],
|
"types": ["vite/client"],
|
||||||
|
|||||||
Reference in New Issue
Block a user