You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This file provides guidance for Claude Code when working with this repository.
6
6
7
7
WaveSpeed Desktop is an Electron-based cross-platform desktop application that provides a playground interface for [WaveSpeedAI](https://wavespeed.ai) models. It allows users to browse models, run predictions, view their history, and manage saved assets.
8
8
9
-
**Workflow** is a node-based visual editor (under `src/workflow/`) for chaining WaveSpeed AI Task nodes, free-tool nodes, and I/O nodes. Workflows are persisted via the Electron main process (sql.js DB), with execution, cost estimation, and per-node history.
9
+
**Workflow** is a node-based visual editor (under `src/workflow/`) for chaining WaveSpeed AI Task nodes, free-tool nodes, and I/O nodes. Workflows are persisted via the Electron main process (sql.js DB), with executionand per-node history. Workflows can run in Electron (main process) or in the browser (in-process executor using apiClient + free-tool runners when workflow IPC is unavailable). Cost is informational only (no estimate UI or budget blocking).
10
10
11
11
**Z-Image** is the local image generation flow backed by stable-diffusion.cpp with model and auxiliary downloads, progress reporting, and log streaming.
-**`src/workflow/stores/execution.store.ts`**: Execution state (running, results, history, progress)
72
73
-**`src/workflow/stores/ui.store.ts`**: Workflow UI state (selected node, panels, add-node palette)
73
74
-**`src/workflow/components/panels/NodeConfigPanel.tsx`**: Model selector for AI Task nodes; categories sorted by popularity (model count), recent models, search
74
-
-**`src/workflow/components/panels/ResultsPanel.tsx`**: Execution results and per-node history
75
-
-**`src/workflow/components/panels/CostPanel.tsx`**: Cost estimate and budget config
75
+
-**`src/workflow/components/panels/ResultsPanel.tsx`**: Execution results and per-node history; shows lastResults when history is empty (e.g. browser run)
76
+
-**`src/workflow/components/panels/CostPanel.tsx`**: Cost display (informational; no estimate UI or budget blocking)
-**`src/workflow/components/canvas/AnnotationNode.tsx`**: Annotation node for notes
83
+
-**`src/workflow/components/canvas/RunMonitor.tsx`**: Execution Monitor (bottom, collapsible); session cards and node rows with output preview (image/video/audio/text via outputDisplay); Lucide ChevronUp/ChevronDown for expand/collapse
84
+
-**`src/workflow/lib/outputDisplay.ts`**: Shared output type classification (image/video/audio/text/3d/file) and data: URL handling for Results panel and RunMonitor
85
+
-**`src/workflow/lib/topological.ts`**: Shared topological sort for workflow execution order (browser and main)
86
+
-**`src/workflow/browser/run-in-browser.ts`**: In-process workflow executor for browser mode (AI task via apiClient, free-tool nodes, I/O nodes)
- Layout.tsx handles unified API key login screen - pages don't need individual ApiKeyRequired checks
256
-
- Workflow page is at `/workflow`; rendered persistently in Layout (like free-tools). Sidebar has "Workflow" (nav.workflow) with GitBranch icon. Layout auto-collapses sidebar when entering workflow.
257
-
- Workflow uses IPC from main: `workflow:create|save|load|list|rename|delete`, `execution:run-all|run-node|continue-from|retry|cancel`, `models:list|search|refresh|get-schema`, `cost:estimate|get-budget|set-budget|get-daily-spend`, `history:list|set-current|star|score`, `registry:get-all`, `settings:get-api-keys|set-api-keys`. Electron main initializes workflow module (sql.js DB, node registry, IPC handlers) on app load.
261
+
- Sidebar navigation sections are ordered: **Create** (Home, Featured Models, Models, Playground), **Manage** (Templates, History, Assets), **Tools** (Workflow, Free Tools, Z-Image). Settings is at the bottom.
262
+
- Workflow page is at `/workflow`; rendered persistently in Layout (like free-tools). Sidebar has "Workflow" (nav.workflow) with GitBranch icon under Tools. Layout auto-collapses sidebar when entering workflow.
263
+
- Workflow uses IPC from main: `workflow:create|save|load|list|rename|delete`, `execution:run-all|run-node|continue-from|retry|cancel`, `models:list|search|refresh|get-schema`, `cost:get-budget|set-budget|get-daily-spend`, `history:list|set-current|star|score`, `registry:get-all`, `settings:get-api-keys|set-api-keys`. Electron main initializes workflow module (sql.js DB, node registry, IPC handlers) on app load. Approximate cost estimate UI has been removed; cost is informational only.
264
+
- Execution Monitor is a bottom bar (collapsible via header chevron). When expanded it shows run sessions with node rows; expanding a node shows output preview (image/video/audio/text) from persisted history or lastResults. Uses `src/workflow/lib/outputDisplay.ts` for output type classification.
265
+
- Workflow can run in browser: `runAllInBrowser` in execution store uses `src/workflow/browser/run-in-browser.ts` and topological sort; no execution history persisted in browser, but lastResults and RunMonitor show latest run output.
266
+
- Playground tab switching preserves form values: URL→model sync only runs when the active tab has no model (so switching tabs never overwrites the tab's model or wipes form).
258
267
- Workflow model selector (NodeConfigPanel): categories are sorted by popularity (model count per category, descending), then alphabetically for ties; "全部" / "All" stays first.
268
+
- AI Task node (electron/workflow/nodes/ai-task/run.ts) normalizes API outputs: if the API returns `outputs: [{ url: "..." }]` (e.g. z-image/turbo), resultUrls are extracted from object.url so Results and Execution Monitor show correct previews.
259
269
- useFreeToolListener is mounted in Layout so workflow execution can trigger free-tool runs and receive results via IPC.
260
270
- Settings page (`/settings`) is a public path accessible without API key
261
271
- Free Tools pages are public paths accessible without API key: `/free-tools`, `/free-tools/image-enhancer`, `/free-tools/video-enhancer`, `/free-tools/background-remover`, `/free-tools/face-enhancer`, `/free-tools/face-swapper`, `/free-tools/image-eraser`, `/free-tools/segment-anything`, `/free-tools/video-converter`, `/free-tools/audio-converter`, `/free-tools/image-converter`, `/free-tools/media-trimmer`, `/free-tools/media-merger`
0 commit comments