chore: migrate formatting to Oxfmt (#615)

This commit is contained in:
morluto
2026-10-06 01:59:19 +08:00
committed by GitHub
parent f557207887
commit 5daaa453ff
25 changed files with 514 additions and 139 deletions
+15 -17
View File
@@ -245,23 +245,21 @@ const setupPlan = (input: {
: []),
...input.clients
.filter(({ client }) => client.format !== "unsupported")
.map(
({ client, operation, backupPath }): SetupAction => ({
id: `configure_client:${client.name}`,
kind: "configure_client",
label: client.displayName ?? client.name,
target: client.configPath,
detail: clientConfigurationDetail(
client.displayName ?? client.name,
input.command,
input.providerEnvironment,
input.installHopper,
),
external: false,
operation,
...(backupPath === undefined ? {} : { backupPath }),
}),
),
.map(({ client, operation, backupPath }): SetupAction => ({
id: `configure_client:${client.name}`,
kind: "configure_client",
label: client.displayName ?? client.name,
target: client.configPath,
detail: clientConfigurationDetail(
client.displayName ?? client.name,
input.command,
input.providerEnvironment,
input.installHopper,
),
external: false,
operation,
...(backupPath === undefined ? {} : { backupPath }),
})),
...(input.installSkill
? [
{
+6 -9
View File
@@ -45,21 +45,18 @@ export const createBinarySession = (
new AnalysisProviderRegistry([hopper, ghidra], config.analysisProvider),
[
lazyProvider("rea-artifact-graph", async () => {
const { ArtifactProvider } = await import(
"../artifacts/ArtifactProvider.js"
);
const { ArtifactProvider } =
await import("../artifacts/ArtifactProvider.js");
return new ArtifactProvider();
}),
lazyProvider("native-macos", async () => {
const { NativeMacOSProvider } = await import(
"../native/NativeMacOSProvider.js"
);
const { NativeMacOSProvider } =
await import("../native/NativeMacOSProvider.js");
return new NativeMacOSProvider();
}),
lazyProvider("rea-dotnet-static", async () => {
const { ManagedStaticProvider } = await import(
"../dotnet/ManagedStaticProvider.js"
);
const { ManagedStaticProvider } =
await import("../dotnet/ManagedStaticProvider.js");
return new ManagedStaticProvider();
}),
],
@@ -311,9 +311,7 @@ const runScenario = async (
};
/** Controlled Playwright/CDP scenario driver with exact process ownership. */
export class PlaywrightBrowserScenarioProvider
implements BrowserScenarioCapturePort
{
export class PlaywrightBrowserScenarioProvider implements BrowserScenarioCapturePort {
constructor(
private readonly factory: BrowserScenarioSessionFactory = lazyPlaywrightFactory,
) {}
@@ -305,13 +305,11 @@ export const readApplicationState = async (
}> => {
const pages = application.windows();
const pageSnapshotsPromise: Promise<ElectronPageSnapshot[]> = Promise.all(
pages.map(
async (page: Page, index): Promise<ElectronPageSnapshot> => ({
index,
url: page.url(),
title: await page.title(),
}),
),
pages.map(async (page: Page, index): Promise<ElectronPageSnapshot> => ({
index,
url: page.url(),
title: await page.title(),
})),
);
const windowMetadataPromise: Promise<ElectronWindowMetadata[]> = application
.evaluate(({ BrowserWindow }) =>
@@ -146,9 +146,7 @@ const createCoverage = (hookSnapshot: ElectronHookSnapshot) => {
};
/** Launch an owned Electron application through the official Playwright API. */
export class PlaywrightElectronActiveProvider
implements ElectronActiveObservationPort
{
export class PlaywrightElectronActiveProvider implements ElectronActiveObservationPort {
identity(): ProviderIdentity {
return PLAYWRIGHT_ELECTRON_ACTIVE_PROVIDER_IDENTITY;
}
+1 -3
View File
@@ -274,9 +274,7 @@ export class PlaywrightScenarioSession implements BrowserScenarioSessionPort {
}
/** Production Playwright/CDP session factory. */
export class PlaywrightScenarioSessionFactory
implements BrowserScenarioSessionFactory
{
export class PlaywrightScenarioSessionFactory implements BrowserScenarioSessionFactory {
constructor(
private readonly environment: Readonly<
Record<string, string | undefined>
+16 -18
View File
@@ -102,24 +102,22 @@ export const projectAppleAssetCatalogPage = (input: {
}[];
}) => {
const all = input.catalogs.flatMap((catalog) =>
catalog.records.map(
(metadata, index): AppleAssetCatalogRecord => ({
catalog_path: catalog.path,
catalog_sha256: catalog.sha256,
index,
kind:
typeof metadata.RenditionName === "string" ||
typeof metadata.Name === "string"
? "rendition"
: "catalog",
asset_name: typeof metadata.Name === "string" ? metadata.Name : null,
rendition_name:
typeof metadata.RenditionName === "string"
? metadata.RenditionName
: null,
metadata,
}),
),
catalog.records.map((metadata, index): AppleAssetCatalogRecord => ({
catalog_path: catalog.path,
catalog_sha256: catalog.sha256,
index,
kind:
typeof metadata.RenditionName === "string" ||
typeof metadata.Name === "string"
? "rendition"
: "catalog",
asset_name: typeof metadata.Name === "string" ? metadata.Name : null,
rendition_name:
typeof metadata.RenditionName === "string"
? metadata.RenditionName
: null,
metadata,
})),
);
const records = all.slice(input.offset, input.offset + input.limit);
const next = input.offset + records.length;
+3 -2
View File
@@ -478,8 +478,9 @@ export class BinaryTargetError extends AnalysisError {
}
}
export interface AnalysisErrorProjection
extends Readonly<Record<string, JsonValue>> {
export interface AnalysisErrorProjection extends Readonly<
Record<string, JsonValue>
> {
readonly code:
| "invalid_request"
| "unreadable_output"
@@ -47,8 +47,8 @@ type OneSidedNode =
};
type ComparisonItemSemantic<
Item extends
ApplicationVersionComparisonItem = ApplicationVersionComparisonItem,
Item extends ApplicationVersionComparisonItem =
ApplicationVersionComparisonItem,
> = Item extends ApplicationVersionComparisonItem
? Omit<Item, "item_id">
: never;
+2 -4
View File
@@ -55,8 +55,7 @@ interface GhidraInstallationObservation {
}
/** Bounded observation of a supported BYO Ghidra installation and JDK. */
export interface AvailableGhidraInstallation
extends GhidraInstallationObservation {
export interface AvailableGhidraInstallation extends GhidraInstallationObservation {
readonly status: "available";
readonly installDir: string;
readonly analyzeHeadlessPath: string;
@@ -67,8 +66,7 @@ export interface AvailableGhidraInstallation
}
/** Bounded observation explaining why a BYO Ghidra installation is unusable. */
export interface UnavailableGhidraInstallation
extends GhidraInstallationObservation {
export interface UnavailableGhidraInstallation extends GhidraInstallationObservation {
readonly status: "unavailable";
readonly installDir: string | null;
readonly analyzeHeadlessPath: string | null;