Skip to content

Commit f626121

Browse files
committed
formatting
1 parent 98478c7 commit f626121

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"build:electron": "electron-builder",
2121
"preview": "vite preview",
2222
"typecheck": "tsc -p tsconfig.node.json --noEmit && tsc -p tsconfig.web.json --noEmit",
23-
"lint:write": "biome check --write --unsafe",
24-
"format:write": "biome format --write",
25-
"check:write": "pnpm run lint:write && pnpm run typecheck",
23+
"lint": "biome check --write --unsafe",
24+
"format": "biome format --write",
25+
"check:write": "pnpm run lint && pnpm run typecheck",
2626
"generate-client": "tsx scripts/update-openapi-client.ts"
2727
},
2828
"keywords": [

src/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import path from "node:path";
1+
import dns from "node:dns";
22
import { mkdirSync } from "node:fs";
3+
import path from "node:path";
34
import { fileURLToPath } from "node:url";
45
import {
56
app,
67
BrowserWindow,
78
Menu,
89
type MenuItemConstructorOptions,
910
} from "electron";
10-
import dns from "node:dns";
1111
import { registerAgentIpc, type TaskController } from "./services/agent.js";
1212
import { registerOsIpc } from "./services/os.js";
1313
import { registerPosthogIpc } from "./services/posthog.js";

src/main/services/agent.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { randomUUID } from "node:crypto";
12
import { Agent, PermissionMode } from "@posthog/agent";
23
import { type BrowserWindow, type IpcMainInvokeEvent, ipcMain } from "electron";
3-
import { randomUUID } from "node:crypto";
44

55
interface AgentStartParams {
66
taskId: string;
@@ -175,8 +175,7 @@ export function registerAgentIpc(
175175
emitToRenderer({ type: "done", success: true, ts: Date.now() });
176176
} catch (err) {
177177
console.error("[agent] workflow execution failed", err);
178-
let errorMessage =
179-
err instanceof Error ? err.message : String(err);
178+
let errorMessage = err instanceof Error ? err.message : String(err);
180179
const cause =
181180
err instanceof Error && "cause" in err && err.cause
182181
? ` (cause: ${String(err.cause)})`

src/renderer/stores/taskExecutionStore.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@ const createProgressSignature = (progress: AgentTaskProgress): string =>
2929
].join("|");
3030

3131
const formatProgressLog = (progress: AgentTaskProgress): string => {
32-
const statusLabel =
33-
progress.status?.replace(/_/g, " ") ?? "in progress";
32+
const statusLabel = progress.status?.replace(/_/g, " ") ?? "in progress";
3433
const completed =
35-
typeof progress.completed_steps === "number"
36-
? progress.completed_steps
37-
: 0;
34+
typeof progress.completed_steps === "number" ? progress.completed_steps : 0;
3835
const total =
3936
typeof progress.total_steps === "number" && progress.total_steps >= 0
4037
? progress.total_steps
4138
: "?";
4239
const step =
43-
typeof progress.current_step === "string" && progress.current_step.length > 0
40+
typeof progress.current_step === "string" &&
41+
progress.current_step.length > 0
4442
? progress.current_step
4543
: "-";
4644
const percentage =
@@ -162,7 +160,9 @@ export const useTaskExecutionStore = create<TaskExecutionStore>()(
162160
setProgress: (taskId: string, progress: AgentTaskProgress | null) => {
163161
get().updateTaskState(taskId, {
164162
progress,
165-
progressSignature: progress ? createProgressSignature(progress) : null,
163+
progressSignature: progress
164+
? createProgressSignature(progress)
165+
: null,
166166
});
167167
},
168168

@@ -209,7 +209,9 @@ export const useTaskExecutionStore = create<TaskExecutionStore>()(
209209
}
210210
break;
211211
case "progress": {
212-
const rawProgress = ev.progress as AgentTaskProgress | undefined;
212+
const rawProgress = ev.progress as
213+
| AgentTaskProgress
214+
| undefined;
213215
if (
214216
rawProgress &&
215217
typeof rawProgress === "object" &&
@@ -393,8 +395,7 @@ export const useTaskExecutionStore = create<TaskExecutionStore>()(
393395
const currentTask =
394396
useTaskStore
395397
.getState()
396-
.tasks.find((candidate) => candidate.id === taskId) ??
397-
fallbackTask;
398+
.tasks.find((candidate) => candidate.id === taskId) ?? fallbackTask;
398399

399400
if (!currentTask.workflow) {
400401
store.addLog(

0 commit comments

Comments
 (0)