mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
style: apply formatter output
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { estimateBase64DecodedBytes } from "openclaw/plugin-sdk/media-runtime";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
||||
import type { RefAttachmentSummary } from "../ref-index-store.js";
|
||||
|
||||
const MAX_FACE_EXT_BYTES = 64 * 1024;
|
||||
|
||||
@@ -2,11 +2,11 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolvePiCredentialMapFromStore } from "./pi-auth-credentials.js";
|
||||
import {
|
||||
addEnvBackedPiCredentials,
|
||||
scrubLegacyStaticAuthJsonEntriesForDiscovery,
|
||||
} from "./pi-model-discovery.js";
|
||||
import { resolvePiCredentialMapFromStore } from "./pi-auth-credentials.js";
|
||||
|
||||
async function createAgentDir(): Promise<string> {
|
||||
return await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-pi-auth-storage-"));
|
||||
@@ -139,5 +139,4 @@ describe("discoverAuthStorage", () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { AssistantMessage } from "@mariozechner/pi-ai";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
|
||||
import { estimateBase64DecodedBytes } from "../../media/base64.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
|
||||
import { findNormalizedProviderValue } from "../model-selection.js";
|
||||
import { extractAssistantText } from "../pi-embedded-utils.js";
|
||||
import { coerceToolModelConfig, type ToolModelConfig } from "./model-config.helpers.js";
|
||||
|
||||
@@ -90,9 +90,14 @@ export function resolvePdfModelConfigForTool(params: {
|
||||
continue;
|
||||
}
|
||||
const models = providerCfg?.models ?? [];
|
||||
const modelId = models.find(
|
||||
(model) => Boolean(model?.id?.trim()) && Array.isArray(model?.input) && model.input.includes("image"),
|
||||
)?.id?.trim();
|
||||
const modelId = models
|
||||
.find(
|
||||
(model) =>
|
||||
Boolean(model?.id?.trim()) &&
|
||||
Array.isArray(model?.input) &&
|
||||
model.input.includes("image"),
|
||||
)
|
||||
?.id?.trim();
|
||||
if (!modelId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
withTempHome,
|
||||
} from "./reply.directive.directive-behavior.e2e-harness.js";
|
||||
import { runEmbeddedPiAgentMock } from "./reply.directive.directive-behavior.e2e-mocks.js";
|
||||
import { withFullRuntimeReplyConfig } from "./reply/get-reply-fast-path.js";
|
||||
import { getReplyFromConfig } from "./reply.js";
|
||||
import { withFullRuntimeReplyConfig } from "./reply/get-reply-fast-path.js";
|
||||
|
||||
function makeModelDefinition(id: string, name: string): ModelDefinitionConfig {
|
||||
return {
|
||||
|
||||
@@ -1377,7 +1377,8 @@ describe("runAgentTurnWithFallback", () => {
|
||||
});
|
||||
|
||||
it("keeps same-provider auth profile when fallback only changes model", async () => {
|
||||
const applyFallbackCandidateSelectionToEntry = await getApplyFallbackCandidateSelectionToEntry();
|
||||
const applyFallbackCandidateSelectionToEntry =
|
||||
await getApplyFallbackCandidateSelectionToEntry();
|
||||
const entry = {
|
||||
sessionId: "session",
|
||||
updatedAt: 1,
|
||||
|
||||
@@ -106,11 +106,7 @@ export const AgentParamsSchema = Type.Object(
|
||||
Type.Union([Type.Literal("full"), Type.Literal("lightweight")]),
|
||||
),
|
||||
bootstrapContextRunKind: Type.Optional(
|
||||
Type.Union([
|
||||
Type.Literal("default"),
|
||||
Type.Literal("heartbeat"),
|
||||
Type.Literal("cron"),
|
||||
]),
|
||||
Type.Union([Type.Literal("default"), Type.Literal("heartbeat"), Type.Literal("cron")]),
|
||||
),
|
||||
internalEvents: Type.Optional(Type.Array(AgentInternalEventSchema)),
|
||||
inputProvenance: Type.Optional(InputProvenanceSchema),
|
||||
|
||||
@@ -217,9 +217,7 @@ describe("gateway talk runtime", () => {
|
||||
|
||||
expect(res?.ok, JSON.stringify(res?.error)).toBe(true);
|
||||
expect((res?.payload as TalkSpeakTestPayload | undefined)?.provider).toBe("elevenlabs");
|
||||
expect((res?.payload as TalkSpeakTestPayload | undefined)?.outputFormat).toBe(
|
||||
"pcm_44100",
|
||||
);
|
||||
expect((res?.payload as TalkSpeakTestPayload | undefined)?.outputFormat).toBe("pcm_44100");
|
||||
expect((res?.payload as TalkSpeakTestPayload | undefined)?.audioBase64).toBe(
|
||||
Buffer.from([4, 5, 6]).toString("base64"),
|
||||
);
|
||||
|
||||
@@ -18,14 +18,10 @@ function runNode(args: string[], timeout: number) {
|
||||
}
|
||||
|
||||
describe("opt-in extension package TypeScript boundaries", () => {
|
||||
it(
|
||||
"typechecks each opt-in extension cleanly through @openclaw/plugin-sdk",
|
||||
() => {
|
||||
const result = runNode([CHECK_EXTENSION_PACKAGE_BOUNDARY_BIN, "--mode=compile"], 420_000);
|
||||
expect(result.status, `${result.stdout}\n${result.stderr}`).toBe(0);
|
||||
},
|
||||
300_000,
|
||||
);
|
||||
it("typechecks each opt-in extension cleanly through @openclaw/plugin-sdk", () => {
|
||||
const result = runNode([CHECK_EXTENSION_PACKAGE_BOUNDARY_BIN, "--mode=compile"], 420_000);
|
||||
expect(result.status, `${result.stdout}\n${result.stderr}`).toBe(0);
|
||||
}, 300_000);
|
||||
|
||||
it("fails when opt-in extensions import src/cli through a relative path", () => {
|
||||
const result = runNode([CHECK_EXTENSION_PACKAGE_BOUNDARY_BIN, "--mode=canary"], 180_000);
|
||||
|
||||
@@ -11,9 +11,8 @@ const LIVE_EXTERNAL_AUTH_DIRS = [".claude", ".codex", ".gemini", ".minimax"] as
|
||||
const LIVE_EXTERNAL_AUTH_FILES = [".claude.json"] as const;
|
||||
const requireFromHere = createRequire(import.meta.url);
|
||||
|
||||
type LegacyConfigCompatApi = typeof import(
|
||||
"../src/commands/doctor/shared/legacy-config-migrate.js"
|
||||
);
|
||||
type LegacyConfigCompatApi =
|
||||
typeof import("../src/commands/doctor/shared/legacy-config-migrate.js");
|
||||
type ConfigValidationApi = typeof import("../src/config/validation.js");
|
||||
|
||||
let cachedLegacyConfigCompatApi: LegacyConfigCompatApi | undefined;
|
||||
@@ -53,7 +52,9 @@ function loadLegacyConfigCompatApi(): LegacyConfigCompatApi {
|
||||
}
|
||||
|
||||
function loadConfigValidationApi(): ConfigValidationApi {
|
||||
cachedConfigValidationApi ??= requireFromHere("../src/config/validation.js") as ConfigValidationApi;
|
||||
cachedConfigValidationApi ??= requireFromHere(
|
||||
"../src/config/validation.js",
|
||||
) as ConfigValidationApi;
|
||||
return cachedConfigValidationApi;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find((shard) => shard.config === "vitest.full-core-support-boundary.config.ts")
|
||||
?.projects ?? [],
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "vitest.full-core-support-boundary.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user