style(repo): normalize imports and formatting

This commit is contained in:
Peter Steinberger
2026-04-05 16:49:32 +01:00
parent 8405d86a8b
commit df38bc2271
6 changed files with 10 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ import {
} from "../agents/agent-scope.js";
import { appendCronStyleCurrentTimeLine } from "../agents/current-time.js";
import { resolveEffectiveMessagesConfig } from "../agents/identity.js";
import { resolveEmbeddedSessionLane } from "../agents/pi-embedded-runner.js";
import { DEFAULT_HEARTBEAT_FILENAME } from "../agents/workspace.js";
import { resolveHeartbeatReplyPayload } from "../auto-reply/heartbeat-reply-payload.js";
import {
@@ -48,7 +49,6 @@ import {
} from "../routing/session-key.js";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import { escapeRegExp } from "../utils.js";
import { resolveEmbeddedSessionLane } from "../agents/pi-embedded-runner.js";
import { formatErrorMessage, hasErrnoCode } from "./errors.js";
import { isWithinActiveHours } from "./heartbeat-active-hours.js";
import {

View File

@@ -26,7 +26,8 @@ vi.mock("./tmp-openclaw-dir.js", () => ({
resolvePreferredOpenClawTmpDir: () => resolvePreferredOpenClawTmpDirMock(),
}));
vi.mock("../daemon/schtasks.js", () => ({
resolveTaskScriptPath: (env: Record<string, string | undefined>) => resolveTaskScriptPathMock(env),
resolveTaskScriptPath: (env: Record<string, string | undefined>) =>
resolveTaskScriptPathMock(env),
}));
type WindowsTaskRestartModule = typeof import("./windows-task-restart.js");

View File

@@ -19,10 +19,7 @@ function resolveWindowsTaskName(env: NodeJS.ProcessEnv): string {
return resolveGatewayWindowsTaskName(env.OPENCLAW_PROFILE);
}
function buildScheduledTaskRestartScript(
taskName: string,
taskScriptPath?: string,
): string {
function buildScheduledTaskRestartScript(taskName: string, taskScriptPath?: string): string {
const quotedTaskName = quoteCmdScriptArg(taskName);
const lines = [
"@echo off",
@@ -41,11 +38,7 @@ function buildScheduledTaskRestartScript(
];
if (taskScriptPath) {
const quotedScript = quoteCmdScriptArg(taskScriptPath);
lines.push(
`if exist ${quotedScript} (`,
` start "" /min cmd.exe /d /c ${quotedScript}`,
")",
);
lines.push(`if exist ${quotedScript} (`, ` start "" /min cmd.exe /d /c ${quotedScript}`, ")");
}
lines.push(":cleanup", 'del "%~f0" >nul 2>&1');
return lines.join("\r\n");

View File

@@ -20,10 +20,9 @@ const BOOTSTRAP_FIX =
function mockBootstrapRegistry() {
vi.doMock("../../channels/plugins/bootstrap-registry.js", async () => {
const actual =
await vi.importActual<typeof import("../../channels/plugins/bootstrap-registry.js")>(
"../../channels/plugins/bootstrap-registry.js",
);
const actual = await vi.importActual<
typeof import("../../channels/plugins/bootstrap-registry.js")
>("../../channels/plugins/bootstrap-registry.js");
return {
...actual,
listBootstrapChannelPlugins,

View File

@@ -7,8 +7,8 @@ import type {
} from "../plugins/types.js";
import { resolvePluginWebFetchProviders } from "../plugins/web-fetch-providers.runtime.js";
import { sortWebFetchProvidersForAutoDetect } from "../plugins/web-fetch-providers.shared.js";
import type { RuntimeWebFetchMetadata } from "../secrets/runtime-web-tools.types.js";
import { getActiveRuntimeWebToolsMetadata } from "../secrets/runtime-web-tools-state.js";
import type { RuntimeWebFetchMetadata } from "../secrets/runtime-web-tools.types.js";
import { normalizeSecretInput } from "../utils/normalize-secret-input.js";
type WebFetchConfig = NonNullable<OpenClawConfig["tools"]>["web"] extends infer Web

View File

@@ -8,8 +8,8 @@ import type {
import { resolvePluginWebSearchProviders } from "../plugins/web-search-providers.runtime.js";
import { resolveRuntimeWebSearchProviders } from "../plugins/web-search-providers.runtime.js";
import { sortWebSearchProvidersForAutoDetect } from "../plugins/web-search-providers.shared.js";
import type { RuntimeWebSearchMetadata } from "../secrets/runtime-web-tools.types.js";
import { getActiveRuntimeWebToolsMetadata } from "../secrets/runtime-web-tools-state.js";
import type { RuntimeWebSearchMetadata } from "../secrets/runtime-web-tools.types.js";
import { normalizeSecretInput } from "../utils/normalize-secret-input.js";
type WebSearchConfig = NonNullable<OpenClawConfig["tools"]>["web"] extends infer Web