chore: apply oxlint autofix (safe level)

Auto-fixed 102 warnings (6040 → 5938) across 57 files. Main categories:
- preserve-caught-error: add { cause: error } to re-thrown errors
- unicorn/no-array-reverse: .reverse() → .toReversed()
- unicorn/no-useless-fallback-in-spread: drop unnecessary ?? {} in spreads
- oxc/no-map-spread: rewrite object spread in .map() to Object.assign
- react-hooks/exhaustive-deps: trim module-level constants from dep arrays

Ran npm run format after to clean up whitespace from lint mutations.
This commit is contained in:
Mohamed Boudra
2026-04-23 21:47:36 +07:00
parent 9c88850de0
commit 177153e5e8
57 changed files with 152 additions and 151 deletions
@@ -267,7 +267,7 @@ function attachPersistenceCwd(
return {
...handle,
metadata: {
...(handle.metadata ?? {}),
...handle.metadata,
cwd,
},
};
@@ -278,11 +278,11 @@ type SubscriptionRecord = {
agentId: string | null;
};
const BUSY_STATUSES: AgentLifecycleStatus[] = ["initializing", "running"];
const BUSY_STATUSES: AgentLifecycleStatus[] = new Set(["initializing", "running"]);
const AgentIdSchema = z.string().uuid();
function isAgentBusy(status: AgentLifecycleStatus): boolean {
return BUSY_STATUSES.includes(status);
return BUSY_STATUSES.has(status);
}
function isTurnTerminalEvent(event: AgentStreamEvent): boolean {
@@ -649,7 +649,7 @@ export class AgentManager {
type: "http" as const,
url: `${this.mcpBaseUrl}?callerAgentId=${resolvedAgentId}`,
},
...(config.mcpServers ?? {}),
...config.mcpServers,
},
};
const normalizedConfig = await this.normalizeConfig(injectedConfig);
@@ -1708,7 +1708,7 @@ export class AgentManager {
}
return {
text: chunks.reverse().join(""),
text: chunks.toReversed().join(""),
startsAtBeginning,
};
}
@@ -2847,12 +2847,12 @@ export class AgentManager {
"code" in error &&
(error as NodeJS.ErrnoException).code === "ENOENT"
) {
throw new Error(`Working directory does not exist: ${normalized.cwd}`);
throw new Error(`Working directory does not exist: ${normalized.cwd}`, { cause: error });
}
if (error instanceof Error) {
throw error;
}
throw new Error(`Failed to access working directory: ${normalized.cwd}`);
throw new Error(`Failed to access working directory: ${normalized.cwd}`, { cause: error });
}
}