style: normalize import ordering and wrapping

This commit is contained in:
Peter Steinberger
2026-04-05 09:22:50 +01:00
parent fb77c8ce4e
commit bff55b55cb
8 changed files with 23 additions and 15 deletions

View File

@@ -89,7 +89,9 @@ describe("acpx plugin config parsing", () => {
fs.writeFileSync(path.join(workspacePluginRoot, "package.json"), "{}\n", "utf8");
fs.writeFileSync(path.join(workspacePluginRoot, "openclaw.plugin.json"), "{}\n", "utf8");
const moduleUrl = pathToFileURL(path.join(repoRoot, "dist-runtime", "register.runtime.js")).href;
const moduleUrl = pathToFileURL(
path.join(repoRoot, "dist-runtime", "register.runtime.js"),
).href;
expect(resolveAcpxPluginRoot(moduleUrl)).toBe(workspacePluginRoot);
} finally {
fs.rmSync(repoRoot, { recursive: true, force: true });

View File

@@ -1,9 +1,9 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import type { Context, Model } from "@mariozechner/pi-ai";
import type {
ProviderReplaySessionEntry,
ProviderSanitizeReplayHistoryContext,
} from "openclaw/plugin-sdk/plugin-entry";
import type { StreamFn } from "@mariozechner/pi-agent-core";
import type { Context, Model } from "@mariozechner/pi-ai";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,

View File

@@ -1,6 +1,6 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import { buildProviderStreamFamilyHooks } from "openclaw/plugin-sdk/provider-stream";
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
import { buildProviderStreamFamilyHooks } from "openclaw/plugin-sdk/provider-stream";
const OPENROUTER_THINKING_STREAM_HOOKS = buildProviderStreamFamilyHooks("openrouter-thinking");

View File

@@ -84,7 +84,8 @@ describe("xai provider plugin", () => {
expect(capturedModelId).toBe("grok-4-fast");
expect(capturedPayload).toMatchObject({ tool_stream: true });
expect(capturedPayload).not.toHaveProperty("reasoning");
expect((capturedPayload?.tools as Array<{ function?: Record<string, unknown> }>)[0]?.function)
.not.toHaveProperty("strict");
expect(
(capturedPayload?.tools as Array<{ function?: Record<string, unknown> }>)[0]?.function,
).not.toHaveProperty("strict");
});
});

View File

@@ -433,8 +433,12 @@ describe("tool descriptions", () => {
expect(execTool.description).not.toContain("use cron instead");
expect(processTool.description).not.toContain("scheduled follow-ups");
expect(execTool.description).toContain("otherwise use process to confirm completion");
expect(processTool.description).toContain("completion confirmation when automatic completion wake is unavailable");
expect(processTool.description).toContain("Use write/send-keys/submit/paste/kill for input or intervention.");
expect(processTool.description).toContain(
"completion confirmation when automatic completion wake is unavailable",
);
expect(processTool.description).toContain(
"Use write/send-keys/submit/paste/kill for input or intervention.",
);
});
});

View File

@@ -152,10 +152,11 @@ function resolveBundledSessionConversationFallback(params: {
}
let resolveSessionConversation: BundledSessionKeyModule["resolveSessionConversation"];
try {
resolveSessionConversation = tryLoadActivatedBundledPluginPublicSurfaceModuleSync<BundledSessionKeyModule>({
dirName,
artifactBasename: SESSION_KEY_API_ARTIFACT_BASENAME,
})?.resolveSessionConversation;
resolveSessionConversation =
tryLoadActivatedBundledPluginPublicSurfaceModuleSync<BundledSessionKeyModule>({
dirName,
artifactBasename: SESSION_KEY_API_ARTIFACT_BASENAME,
})?.resolveSessionConversation;
} catch {
return null;
}

View File

@@ -33,10 +33,10 @@ vi.mock("./program-context.js", () => ({
describe("buildProgram", () => {
function mockProcessOutput() {
vi.spyOn(process.stdout, "write").mockImplementation(
((() => true) as unknown) as typeof process.stdout.write,
(() => true) as unknown as typeof process.stdout.write,
);
vi.spyOn(process.stderr, "write").mockImplementation(
((() => true) as unknown) as typeof process.stderr.write,
(() => true) as unknown as typeof process.stderr.write,
);
}

View File

@@ -1,6 +1,6 @@
import { isDeepStrictEqual } from "node:util";
import { migrateVoiceCallLegacyConfigInput } from "../../extensions/voice-call/config-api.js";
import { normalizeProviderId } from "../agents/model-selection.js";
import { isDeepStrictEqual } from "node:util";
import { shouldMoveSingleAccountChannelKey } from "../channels/plugins/setup-helpers.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveNormalizedProviderModelMaxTokens } from "../config/defaults.js";