style: autoformat with biome to fix 195 formatting errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2026-04-10 19:49:33 +00:00
parent be88ddbce1
commit 13de7d197b
195 changed files with 4419 additions and 3943 deletions

View File

@@ -62,45 +62,39 @@ export function createCli(): Command {
.option("--no-color", "disable colored output");
// Primary agent commands (top-level)
addJsonAndDaemonHostOptions(
addLsOptions(program.command("ls")),
).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(addLsOptions(program.command("ls"))).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(
addRunOptions(program.command("run")),
).action(withOutput(runRunCommand));
addJsonAndDaemonHostOptions(addRunOptions(program.command("run"))).action(
withOutput(runRunCommand),
);
addDaemonHostOption(
addAttachOptions(program.command("attach")),
).action(runAttachCommand);
addDaemonHostOption(addAttachOptions(program.command("attach"))).action(runAttachCommand);
addDaemonHostOption(
addLogsOptions(program.command("logs")),
).action(runLogsCommand);
addDaemonHostOption(addLogsOptions(program.command("logs"))).action(runLogsCommand);
addJsonAndDaemonHostOptions(
addStopOptions(program.command("stop")),
).action(withOutput(runStopCommand));
addJsonAndDaemonHostOptions(addStopOptions(program.command("stop"))).action(
withOutput(runStopCommand),
);
addJsonAndDaemonHostOptions(
addDeleteOptions(program.command("delete")),
).action(withOutput(runDeleteCommand));
addJsonAndDaemonHostOptions(addDeleteOptions(program.command("delete"))).action(
withOutput(runDeleteCommand),
);
addJsonAndDaemonHostOptions(
addSendOptions(program.command("send")),
).action(withOutput(runSendCommand));
addJsonAndDaemonHostOptions(addSendOptions(program.command("send"))).action(
withOutput(runSendCommand),
);
addJsonAndDaemonHostOptions(
addInspectOptions(program.command("inspect")),
).action(withOutput(runInspectCommand));
addJsonAndDaemonHostOptions(addInspectOptions(program.command("inspect"))).action(
withOutput(runInspectCommand),
);
addJsonAndDaemonHostOptions(
addWaitOptions(program.command("wait")),
).action(withOutput(runWaitCommand));
addJsonAndDaemonHostOptions(addWaitOptions(program.command("wait"))).action(
withOutput(runWaitCommand),
);
addJsonAndDaemonHostOptions(
addArchiveOptions(program.command("archive")),
).action(withOutput(runArchiveCommand));
addJsonAndDaemonHostOptions(addArchiveOptions(program.command("archive"))).action(
withOutput(runArchiveCommand),
);
// Top-level local daemon shortcuts
program.addCommand(onboardCommand());

View File

@@ -26,7 +26,7 @@ export const archiveSchema: OutputSchema<AgentArchiveResult> = {
export function addArchiveOptions(cmd: Command): Command {
return cmd
.description('Archive an agent (soft-delete)')
.description("Archive an agent (soft-delete)")
.argument("<id>", "Agent ID, prefix, or name")
.option("--force", "Force archive running agent (interrupts active run first)");
}

View File

@@ -22,41 +22,35 @@ export function createAgentCommand(): Command {
const agent = new Command("agent").description("Manage agents (advanced operations)");
// Primary agent commands (same as top-level)
addJsonAndDaemonHostOptions(
addLsOptions(agent.command("ls")),
).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(addLsOptions(agent.command("ls"))).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(
addRunOptions(agent.command("run")),
).action(withOutput(runRunCommand));
addJsonAndDaemonHostOptions(addRunOptions(agent.command("run"))).action(
withOutput(runRunCommand),
);
addDaemonHostOption(
addAttachOptions(agent.command("attach")),
).action(runAttachCommand);
addDaemonHostOption(addAttachOptions(agent.command("attach"))).action(runAttachCommand);
addDaemonHostOption(
addLogsOptions(agent.command("logs")),
).action(runLogsCommand);
addDaemonHostOption(addLogsOptions(agent.command("logs"))).action(runLogsCommand);
addJsonAndDaemonHostOptions(
addStopOptions(agent.command("stop")),
).action(withOutput(runStopCommand));
addJsonAndDaemonHostOptions(addStopOptions(agent.command("stop"))).action(
withOutput(runStopCommand),
);
addJsonAndDaemonHostOptions(
addDeleteOptions(agent.command("delete")),
).action(withOutput(runDeleteCommand));
addJsonAndDaemonHostOptions(addDeleteOptions(agent.command("delete"))).action(
withOutput(runDeleteCommand),
);
addJsonAndDaemonHostOptions(
addSendOptions(agent.command("send")),
).action(withOutput(runSendCommand));
addJsonAndDaemonHostOptions(addSendOptions(agent.command("send"))).action(
withOutput(runSendCommand),
);
addJsonAndDaemonHostOptions(
addInspectOptions(agent.command("inspect")),
).action(withOutput(runInspectCommand));
addJsonAndDaemonHostOptions(addInspectOptions(agent.command("inspect"))).action(
withOutput(runInspectCommand),
);
addJsonAndDaemonHostOptions(
addWaitOptions(agent.command("wait")),
).action(withOutput(runWaitCommand));
addJsonAndDaemonHostOptions(addWaitOptions(agent.command("wait"))).action(
withOutput(runWaitCommand),
);
// Advanced agent commands (less common operations)
addJsonAndDaemonHostOptions(
@@ -68,9 +62,9 @@ export function createAgentCommand(): Command {
.option("--list", "List available modes for this agent"),
).action(withOutput(runModeCommand));
addJsonAndDaemonHostOptions(
addArchiveOptions(agent.command("archive")),
).action(withOutput(runArchiveCommand));
addJsonAndDaemonHostOptions(addArchiveOptions(agent.command("archive"))).action(
withOutput(runArchiveCommand),
);
addJsonAndDaemonHostOptions(
agent

View File

@@ -20,9 +20,9 @@ export function createChatCommand(): Command {
.option("--purpose <text>", "Room purpose/description"),
).action(withOutput(runCreateCommand));
addJsonAndDaemonHostOptions(
chat.command("ls").description("List chat rooms"),
).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(chat.command("ls").description("List chat rooms")).action(
withOutput(runLsCommand),
);
addJsonAndDaemonHostOptions(
chat

View File

@@ -27,7 +27,9 @@ export async function runPostCommand(
authorAgentId: resolveChatAuthorAgentId(),
replyToMessageId: options.replyTo,
});
const [message] = await attachAgentNamesToMessages(client, [toChatMessageRow(payload.message!)]);
const [message] = await attachAgentNamesToMessages(client, [
toChatMessageRow(payload.message!),
]);
return {
type: "single",
data: message!,

View File

@@ -60,7 +60,9 @@ function renderChatMessageBlock(message: ChatMessageRow): string {
const authorLabel = message.authorName
? `${message.authorName} (${message.author})`
: message.author;
const lines = [`┌─ ${authorLabel} ── ${formatTimestamp(message.createdAt)} ── [msg ${message.id}]`];
const lines = [
`┌─ ${authorLabel} ── ${formatTimestamp(message.createdAt)} ── [msg ${message.id}]`,
];
if (message.replyTo !== "-") {
lines.push(`│ reply-to: msg ${message.replyTo}`);

View File

@@ -125,12 +125,7 @@ function resolveDaemonRunnerEntry(): string {
try {
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")) as { name?: string };
if (packageJson.name === "@getpaseo/server") {
const distRunner = path.join(
currentDir,
"dist",
"scripts",
"supervisor-entrypoint.js",
);
const distRunner = path.join(currentDir, "dist", "scripts", "supervisor-entrypoint.js");
if (existsSync(distRunner)) {
return distRunner;
}

View File

@@ -32,10 +32,15 @@ function resolveNodePathFromPidUnix(pid: number): NodePathFromPidResult {
}
const resolved = result.stdout.trim();
return resolved ? { nodePath: resolved } : { nodePath: null, error: "ps returned an empty command path" };
return resolved
? { nodePath: resolved }
: { nodePath: null, error: "ps returned an empty command path" };
}
function runProcessProbe(command: string, args: string[]): {
function runProcessProbe(
command: string,
args: string[],
): {
resolved: string | null;
error?: string;
} {
@@ -52,16 +57,25 @@ function runProcessProbe(command: string, args: string[]): {
const details = result.stderr?.trim();
return {
resolved: null,
error: details ? `${command} failed: ${details}` : `${command} exited with code ${result.status ?? 1}`,
error: details
? `${command} failed: ${details}`
: `${command} exited with code ${result.status ?? 1}`,
};
}
const resolved = result.stdout.trim();
return resolved ? { resolved } : { resolved: null, error: `${command} returned no executable path` };
return resolved
? { resolved }
: { resolved: null, error: `${command} returned no executable path` };
}
function resolveNodePathFromPidWindows(pid: number): NodePathFromPidResult {
const probes: Array<{ label: string; command: string; args: string[]; parseValue?: (stdout: string) => string | null }> = [
const probes: Array<{
label: string;
command: string;
args: string[];
parseValue?: (stdout: string) => string | null;
}> = [
{
label: "powershell-cim",
command: "powershell",
@@ -103,7 +117,10 @@ function resolveNodePathFromPidWindows(pid: number): NodePathFromPidResult {
}
}
return { nodePath: null, error: errors.join("; ") || "could not resolve executable path from PID" };
return {
nodePath: null,
error: errors.join("; ") || "could not resolve executable path from PID",
};
}
export function resolveNodePathFromPid(pid: number): NodePathFromPidResult {

View File

@@ -2,11 +2,7 @@ import type { Command } from "commander";
import { execFile } from "node:child_process";
import { createRequire } from "node:module";
import { promisify } from "node:util";
import {
getOrCreateServerId,
findExecutable,
applyProviderEnv,
} from "@getpaseo/server";
import { getOrCreateServerId, findExecutable, applyProviderEnv } from "@getpaseo/server";
const execFileAsync = promisify(execFile);
import { tryConnectToDaemon } from "../../utils/client.js";
@@ -173,7 +169,9 @@ const PROVIDER_BINARIES: { label: string; binary: string }[] = [
{ label: "OpenCode", binary: "opencode" },
];
async function checkProviderBinary(binary: string): Promise<{ path: string | null; version: string | null }> {
async function checkProviderBinary(
binary: string,
): Promise<{ path: string | null; version: string | null }> {
const binaryPath = await findExecutable(binary);
if (!binaryPath) {
return { path: null, version: null };

View File

@@ -10,25 +10,23 @@ import { addLoopStopOptions, runLoopStopCommand } from "./stop.js";
export function createLoopCommand(): Command {
const loop = new Command("loop").description("Run iterative worker loops");
addJsonAndDaemonHostOptions(
addLoopRunOptions(loop.command("run")),
).action(withOutput(runLoopRunCommand));
addJsonAndDaemonHostOptions(addLoopRunOptions(loop.command("run"))).action(
withOutput(runLoopRunCommand),
);
addJsonAndDaemonHostOptions(
addLoopLsOptions(loop.command("ls")),
).action(withOutput(runLoopLsCommand));
addJsonAndDaemonHostOptions(addLoopLsOptions(loop.command("ls"))).action(
withOutput(runLoopLsCommand),
);
addJsonAndDaemonHostOptions(
addLoopInspectOptions(loop.command("inspect")),
).action(withOutput(runLoopInspectCommand));
addJsonAndDaemonHostOptions(addLoopInspectOptions(loop.command("inspect"))).action(
withOutput(runLoopInspectCommand),
);
addDaemonHostOption(
addLoopLogsOptions(loop.command("logs")),
).action(runLoopLogsCommand);
addDaemonHostOption(addLoopLogsOptions(loop.command("logs"))).action(runLoopLogsCommand);
addJsonAndDaemonHostOptions(
addLoopStopOptions(loop.command("stop")),
).action(withOutput(runLoopStopCommand));
addJsonAndDaemonHostOptions(addLoopStopOptions(loop.command("stop"))).action(
withOutput(runLoopStopCommand),
);
return loop;
}

View File

@@ -1,11 +1,6 @@
import { Command } from "commander";
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
import type {
CommandOptions,
CommandError,
OutputSchema,
ListResult,
} from "../../output/index.js";
import type { CommandOptions, CommandError, OutputSchema, ListResult } from "../../output/index.js";
import type { LoopDaemonClient, LoopRecord } from "./types.js";
interface InspectRow {
@@ -44,10 +39,16 @@ function toRows(loop: LoopRecord): InspectRow[] {
{ key: "VerifierModel", value: loop.verifierModel ?? "null" },
{ key: "Prompt", value: loop.prompt },
{ key: "VerifyPrompt", value: loop.verifyPrompt ?? "null" },
{ key: "VerifyChecks", value: loop.verifyChecks.length > 0 ? loop.verifyChecks.join(" | ") : "[]" },
{
key: "VerifyChecks",
value: loop.verifyChecks.length > 0 ? loop.verifyChecks.join(" | ") : "[]",
},
{ key: "Archive", value: String(loop.archive) },
{ key: "SleepMs", value: String(loop.sleepMs) },
{ key: "MaxIterations", value: loop.maxIterations === null ? "null" : String(loop.maxIterations) },
{
key: "MaxIterations",
value: loop.maxIterations === null ? "null" : String(loop.maxIterations),
},
{ key: "MaxTimeMs", value: loop.maxTimeMs === null ? "null" : String(loop.maxTimeMs) },
{ key: "CreatedAt", value: loop.createdAt },
{ key: "UpdatedAt", value: loop.updatedAt },

View File

@@ -1,11 +1,6 @@
import { Command } from "commander";
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
import type {
CommandOptions,
CommandError,
OutputSchema,
ListResult,
} from "../../output/index.js";
import type { CommandOptions, CommandError, OutputSchema, ListResult } from "../../output/index.js";
import type { LoopDaemonClient, LoopListItem } from "./types.js";
interface LoopListRow {

View File

@@ -1,7 +1,11 @@
import type { Command } from "commander";
import type { SingleResult } from "../../output/index.js";
import type { OutputSchema } from "../../output/index.js";
import { connectScheduleClient, toScheduleCommandError, type ScheduleCommandOptions } from "./shared.js";
import {
connectScheduleClient,
toScheduleCommandError,
type ScheduleCommandOptions,
} from "./shared.js";
interface ScheduleDeleteRow {
id: string;

View File

@@ -25,15 +25,12 @@ export function createScheduleCommand(): Command {
.option("--expires-in <duration>", "Time to live for the schedule"),
).action(withOutput(runCreateCommand));
addJsonAndDaemonHostOptions(
schedule.command("ls").description("List schedules"),
).action(withOutput(runLsCommand));
addJsonAndDaemonHostOptions(schedule.command("ls").description("List schedules")).action(
withOutput(runLsCommand),
);
addJsonAndDaemonHostOptions(
schedule
.command("inspect")
.description("Inspect a schedule")
.argument("<id>", "Schedule ID"),
schedule.command("inspect").description("Inspect a schedule").argument("<id>", "Schedule ID"),
).action(withOutput(runInspectCommand));
addJsonAndDaemonHostOptions(
@@ -44,10 +41,7 @@ export function createScheduleCommand(): Command {
).action(withOutput(runLogsCommand));
addJsonAndDaemonHostOptions(
schedule
.command("pause")
.description("Pause a schedule")
.argument("<id>", "Schedule ID"),
schedule.command("pause").description("Pause a schedule").argument("<id>", "Schedule ID"),
).action(withOutput(runPauseCommand));
addJsonAndDaemonHostOptions(
@@ -58,10 +52,7 @@ export function createScheduleCommand(): Command {
).action(withOutput(runResumeCommand));
addJsonAndDaemonHostOptions(
schedule
.command("delete")
.description("Delete a schedule")
.argument("<id>", "Schedule ID"),
schedule.command("delete").description("Delete a schedule").argument("<id>", "Schedule ID"),
).action(withOutput(runDeleteCommand));
return schedule;

View File

@@ -5,7 +5,11 @@ import {
createScheduleInspectSchema,
type ScheduleInspectRow,
} from "./schema.js";
import { connectScheduleClient, toScheduleCommandError, type ScheduleCommandOptions } from "./shared.js";
import {
connectScheduleClient,
toScheduleCommandError,
type ScheduleCommandOptions,
} from "./shared.js";
export async function runInspectCommand(
id: string,

View File

@@ -1,7 +1,11 @@
import type { Command } from "commander";
import type { ListResult } from "../../output/index.js";
import { scheduleLogSchema, toScheduleLogRow, type ScheduleLogRow } from "./schema.js";
import { connectScheduleClient, toScheduleCommandError, type ScheduleCommandOptions } from "./shared.js";
import {
connectScheduleClient,
toScheduleCommandError,
type ScheduleCommandOptions,
} from "./shared.js";
export async function runLogsCommand(
id: string,

View File

@@ -19,7 +19,9 @@ export interface ScheduleInspectRow {
value: string;
}
export function createScheduleInspectSchema(record: ScheduleRecord): OutputSchema<ScheduleInspectRow> {
export function createScheduleInspectSchema(
record: ScheduleRecord,
): OutputSchema<ScheduleInspectRow> {
return {
idField: "key",
columns: [

View File

@@ -33,11 +33,7 @@ export async function connectScheduleClient(
}
}
export function toScheduleCommandError(
code: string,
action: string,
error: unknown,
): CommandError {
export function toScheduleCommandError(code: string, action: string, error: unknown): CommandError {
if (error && typeof error === "object" && "code" in error) {
return error as CommandError;
}

View File

@@ -20,7 +20,8 @@ export async function runLsCommand(
const cwd = options.all ? undefined : (options.cwd ?? process.cwd());
try {
const payload = cwd === undefined ? await client.listTerminals() : await client.listTerminals(cwd);
const payload =
cwd === undefined ? await client.listTerminals() : await client.listTerminals(cwd);
return {
type: "list",
data: payload.terminals.map((terminal) => toTerminalRow(terminal, payload.cwd ?? cwd)),

View File

@@ -21,7 +21,6 @@ export function isSameOrDescendantPath(basePath: string, candidatePath: string):
}
return (
normalizedCandidate === normalizedBase ||
normalizedCandidate.startsWith(normalizedBase + "/")
normalizedCandidate === normalizedBase || normalizedCandidate.startsWith(normalizedBase + "/")
);
}