style: apply oxfmt

This commit is contained in:
Peter Steinberger
2026-04-12 11:28:10 -07:00
parent 67af6f0baf
commit e76c2812b7
8 changed files with 44 additions and 25 deletions

View File

@@ -53,9 +53,18 @@ function cmdFetchAlert(alertNumber) {
const alert = gh(["api", `repos/${REPO}/secret-scanning/alerts/${alertNumber}?hide_secret=true`]);
const locations = gh(["api", `repos/${REPO}/secret-scanning/alerts/${alertNumber}/locations`, "--paginate", "--slurp"]);
const locations = gh([
"api",
`repos/${REPO}/secret-scanning/alerts/${alertNumber}/locations`,
"--paginate",
"--slurp",
]);
// --paginate + --slurp 确保多页结果合并为一个 JSON 数组
const flatLocations = Array.isArray(locations?.[0]) ? locations.flat() : Array.isArray(locations) ? locations : [];
const flatLocations = Array.isArray(locations?.[0])
? locations.flat()
: Array.isArray(locations)
? locations
: [];
const result = {
number: alert.number,
@@ -452,9 +461,7 @@ function cmdSummary(jsonFile) {
: r.location_label;
const history = r.history_cleared ? "Cleared" : "⚠️ History remains";
lines.push(
`| ${alertLink} | ${r.secret_type} | ${locationLink} | ${r.actions} | ${history} |`,
);
lines.push(`| ${alertLink} | ${r.secret_type} | ${locationLink} | ${r.actions} | ${history} |`);
if (!r.history_cleared && r.location_url) {
needsPurge.push(r);

View File

@@ -407,7 +407,9 @@ describe("DiscordVoiceManager", () => {
await manager.join({ guildId: "g1", channelId: "1001" });
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get("g1") as
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get(
"g1",
) as
| {
guildId: string;
channelId: string;

View File

@@ -1,5 +1,5 @@
import type { Dirent } from "node:fs";
import { createHash } from "node:crypto";
import type { Dirent } from "node:fs";
import fs from "node:fs/promises";
import path from "node:path";
import {

View File

@@ -1,4 +1,7 @@
export function resolveMemorySearchPreflight(params: { query: string; hasIndexedContent: boolean }):
export function resolveMemorySearchPreflight(params: {
query: string;
hasIndexedContent: boolean;
}):
| {
normalizedQuery: string;
shouldInitializeProvider: boolean;

View File

@@ -795,17 +795,17 @@ describe("buildStatusMessage", () => {
{
attachmentIndex: 0,
attempts: [
{
type: "provider",
outcome: "skipped",
reason: "empty output",
},
{
type: "provider",
outcome: "failed",
reason: "Error: Audio transcription response missing text",
},
],
{
type: "provider",
outcome: "skipped",
reason: "empty output",
},
{
type: "provider",
outcome: "failed",
reason: "Error: Audio transcription response missing text",
},
],
},
],
},

View File

@@ -27,7 +27,10 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
import { readLatestSessionUsageFromTranscript } from "../gateway/session-utils.fs.js";
import { formatTimeAgo } from "../infra/format-time/format-relative.ts";
import { resolveCommitHash } from "../infra/git-commit.js";
import { findDecisionReason, summarizeDecisionReason } from "../media-understanding/runner.entries.js";
import {
findDecisionReason,
summarizeDecisionReason,
} from "../media-understanding/runner.entries.js";
import type { MediaUnderstandingDecision } from "../media-understanding/types.js";
import { resolveAgentIdFromSessionKey } from "../routing/session-key.js";
import {

View File

@@ -1377,9 +1377,9 @@ export function createNestedChannelParsedAllowFromPrompt(params: {
getExistingAllowFrom: ({ cfg }: { cfg: OpenClawConfig }) =>
params.getExistingAllowFrom?.(cfg) ??
(
(cfg.channels?.[params.channel] as Record<string, unknown> | undefined)?.[params.section] as
| { allowFrom?: Array<string | number> }
| undefined
(cfg.channels?.[params.channel] as Record<string, unknown> | undefined)?.[
params.section
] as { allowFrom?: Array<string | number> } | undefined
)?.allowFrom ??
[],
...(params.mergeEntries ? { mergeEntries: params.mergeEntries } : {}),

View File

@@ -2534,7 +2534,9 @@ describe("gateway server sessions", () => {
expect(deleted.ok).toBe(true);
expect(deleted.payload?.deleted).toBe(true);
expect(subagentLifecycleHookMocks.runSubagentEnded).toHaveBeenCalledTimes(1);
const event = (subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][])[0]?.[0] as
const event = (
subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][]
)[0]?.[0] as
| { targetKind?: string; targetSessionKey?: string; reason?: string; outcome?: string }
| undefined;
expect(event).toMatchObject({
@@ -2850,7 +2852,9 @@ describe("gateway server sessions", () => {
expect(reset.payload?.key).toBe("agent:main:subagent:worker");
expect(reset.payload?.entry.sessionId).not.toBe("sess-subagent");
expect(subagentLifecycleHookMocks.runSubagentEnded).toHaveBeenCalledTimes(1);
const event = (subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][])[0]?.[0] as
const event = (
subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][]
)[0]?.[0] as
| { targetKind?: string; targetSessionKey?: string; reason?: string; outcome?: string }
| undefined;
expect(event).toMatchObject({