@marktoflow/gui 2.0.0-alpha.15 → 2.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,590 +1,79 @@
1
1
  # @marktoflow/gui
2
2
 
3
- > **Author:** Scott Glover <scottgl@gmail.com>
3
+ > Visual workflow designer — drag-and-drop editor with AI-powered assistance.
4
4
 
5
- Visual workflow designer for marktoflow - a web-based drag-and-drop editor with AI-powered assistance.
5
+ [![npm](https://img.shields.io/npm/v/@marktoflow/gui)](https://www.npmjs.com/package/@marktoflow/gui)
6
6
 
7
- ## Features
8
-
9
- - **Visual Workflow Editor** - Drag-and-drop interface for creating and editing workflows
10
- - **Enhanced Control Flow Visualization** - Visual execution state indicators for loops, branches, and parallel execution
11
- - **AI-Powered Assistance** - Natural language commands to modify workflows
12
- - **Multiple AI Backends** - Support for Claude Code, GitHub Copilot, and more
13
- - **Real-time Execution** - Run and debug workflows directly from the UI with live status updates
14
- - **Live File Sync** - Changes sync automatically with your workflow files
15
-
16
- ### Control Flow Visual Features
7
+ Part of [marktoflow](../../README.md) — open-source markdown workflow automation.
17
8
 
18
- - **Early Exit Indicators** - See when loops exit before completion (break/error)
19
- - **Skipped Branch Visualization** - Grayed-out branches that weren't executed
20
- - **Progress Tracking** - Real-time iteration counters and progress bars
21
- - **Rate Limiting Warnings** - Visual alerts for parallel execution throttling
22
- - **Failed Branch Tracking** - Red highlighting for failed parallel branches
23
- - **Execution State Badges** - Contextual icons showing loop exit reasons
9
+ <!-- TODO: screenshot of the workflow designer -->
24
10
 
25
- ## Installation
26
-
27
- ```bash
28
- npm install @marktoflow/gui
29
- ```
30
-
31
- Or use via the CLI:
11
+ ## Quick Start
32
12
 
33
13
  ```bash
34
- npx @marktoflow/cli gui
14
+ marktoflow gui
35
15
  ```
36
16
 
37
- ## Quick Start
38
-
39
- ### Via CLI (Recommended)
17
+ Opens the visual editor at `http://localhost:3001`. Create, edit, and run workflows with a drag-and-drop interface.
40
18
 
41
19
  ```bash
42
- # Start the GUI server
43
- marktoflow gui
44
-
45
- # With options
46
20
  marktoflow gui --port 3000 # Custom port
47
21
  marktoflow gui --open # Open browser automatically
48
- marktoflow gui --workflow-dir ./workflows # Custom workflow directory
22
+ marktoflow gui --workflow-dir ./workflows
49
23
  ```
50
24
 
51
- The GUI will start at `http://localhost:3001` (or your specified port) and automatically watch your workflow directory for changes.
52
-
53
25
  ### Programmatic Usage
54
26
 
55
27
  ```typescript
56
28
  import { startServer } from '@marktoflow/gui';
57
29
 
58
- // Start the GUI server
59
30
  const server = await startServer({
60
31
  port: 3001,
61
32
  workflowDir: './workflows',
62
33
  });
63
-
64
- console.log('GUI available at http://localhost:3001');
65
- ```
66
-
67
- ## Using the GUI
68
-
69
- ### Opening Workflows
70
-
71
- 1. **From File System**: The GUI automatically discovers workflows in your configured directory
72
- 2. **Create New**: Click "New Workflow" to start from scratch or use a template
73
- 3. **Import**: Drag and drop `.md` workflow files into the browser
74
-
75
- ### Editing Workflows
76
-
77
- #### Visual Mode
78
- - Drag tools from the sidebar onto the canvas
79
- - Connect steps by dragging from output to input ports
80
- - Edit step properties in the right panel
81
- - Add conditions, loops, and error handling visually
82
-
83
- #### Code Mode
84
- - Switch to the Monaco editor for direct markdown editing
85
- - Syntax highlighting for YAML and markdown
86
- - Auto-completion for tool actions and inputs
87
-
88
- #### AI-Assisted Mode
89
- - Type natural language commands in the AI prompt box
90
- - Examples:
91
- - "Add a step to send a Slack message when the build fails"
92
- - "Create a loop to process all GitHub PRs"
93
- - "Add error handling to retry failed API calls"
94
-
95
- ### Running Workflows
96
-
97
- 1. Click the "Run" button in the toolbar
98
- 2. Provide inputs if required
99
- 3. Watch real-time execution status via WebSocket updates
100
- 4. View execution results in the Properties panel
101
-
102
- ## Interface Overview
103
-
104
- ```
105
- +------------------+------------------------+------------------+
106
- | | | |
107
- | Sidebar | Canvas | Properties |
108
- | (Workflows | (Visual Editor) | Panel |
109
- | & Tools) | | |
110
- | | | |
111
- +------------------+------------------------+------------------+
112
- | AI Prompt Input |
113
- +--------------------------------------------------------------+
114
34
  ```
115
35
 
116
- ### Components
36
+ ## Features
117
37
 
118
- - **Left Sidebar** - Browse workflows and drag tools onto the canvas
119
- - **Canvas** - Visual node-based workflow editor with pan/zoom
120
- - **Properties Panel** - Edit step properties, view variables, execution history
121
- - **AI Prompt** - Natural language input for AI-assisted editing
38
+ - **Drag-and-Drop Editor** Visual node-based workflow canvas with pan/zoom
39
+ - **AI Assistance** Natural language commands to modify workflows (Claude, Copilot, Ollama)
40
+ - **Real-time Execution** Run workflows and watch live status via WebSocket
41
+ - **Validation Panel** — Dry-run checks before execution
42
+ - **Template Library** — Quick-start templates for Slack, GitHub, HTTP, and scheduled workflows
43
+ - **Live File Sync** — Changes sync automatically with your `.md` workflow files
44
+ - **Input Collection** — Validates and collects required inputs before execution
45
+ - **Enterprise Design System** — Professional light/dark theming with design tokens
122
46
 
123
47
  ## AI Providers
124
48
 
125
- The GUI supports multiple AI backends for workflow assistance:
126
-
127
- | Provider | SDK | Authentication |
128
- |----------|-----|----------------|
129
- | Claude Code | `@anthropic-ai/claude-agent-sdk` | Claude CLI (`claude`) |
130
- | GitHub Copilot | `@github/copilot-sdk` | Copilot CLI (`copilot auth`) |
131
- | OpenAI Codex | `openai-codex-sdk` | Codex CLI |
132
- | OpenCode | `@opencode-ai/sdk` | OpenCode CLI (`opencode /connect`) |
133
- | Claude API | `@anthropic-ai/sdk` | `ANTHROPIC_API_KEY` |
134
- | Ollama (beta) | REST API | Local server |
135
- | Demo Mode | - | Always available |
136
-
137
- ### Setting Up AI Providers
138
-
139
- **Claude Code (Recommended)**
140
- ```bash
141
- # Authenticate with Claude CLI first
142
- claude
143
-
144
- # The GUI will automatically detect and use Claude Code
145
- ```
146
-
147
- **GitHub Copilot**
148
- ```bash
149
- # Authenticate with Copilot CLI
150
- copilot auth
151
-
152
- # The GUI will automatically detect and use Copilot
153
- ```
154
-
155
- **OpenAI Codex**
156
- ```bash
157
- # Authenticate with Codex CLI
158
- # Follow Codex CLI documentation for setup
159
-
160
- # The GUI will automatically detect and use Codex
161
- ```
162
-
163
- **OpenCode**
164
- ```bash
165
- # Configure OpenCode
166
- opencode /connect
167
-
168
- # The GUI will automatically detect and use OpenCode
169
- ```
170
-
171
- **Claude API (Direct)**
172
- ```bash
173
- # Set API key
174
- export ANTHROPIC_API_KEY=sk-ant-your-key
175
-
176
- # The GUI will use direct API access
177
- ```
178
-
179
- **Ollama (Local)**
180
- ```bash
181
- # Start Ollama server
182
- ollama serve
183
-
184
- # The GUI will automatically detect Ollama at localhost:11434
185
- ```
186
-
187
- ## API Reference
188
-
189
- The GUI server exposes a comprehensive REST API for programmatic access:
190
-
191
- ### Workflow Operations
192
-
193
- #### List All Workflows
194
- ```bash
195
- GET /api/workflows
196
-
197
- Response:
198
- {
199
- "workflows": [
200
- {
201
- "path": "daily-standup/workflow.md",
202
- "id": "daily-standup",
203
- "name": "Daily Standup Report",
204
- "triggers": [...],
205
- "modified": "2026-01-31T10:00:00Z"
206
- }
207
- ]
208
- }
209
- ```
210
-
211
- #### Get Workflow
212
- ```bash
213
- GET /api/workflows/:path
214
-
215
- Response:
216
- {
217
- "workflow": {
218
- "id": "daily-standup",
219
- "name": "Daily Standup Report",
220
- "tools": {...},
221
- "steps": [...],
222
- "content": "# Markdown content..."
223
- }
224
- }
225
- ```
226
-
227
- #### Create/Update Workflow
228
- ```bash
229
- POST /api/workflows
230
- Content-Type: application/json
231
-
232
- {
233
- "path": "my-workflow/workflow.md",
234
- "content": "---\nworkflow:\n id: my-workflow\n..."
235
- }
236
-
237
- Response:
238
- {
239
- "success": true,
240
- "path": "my-workflow/workflow.md"
241
- }
242
- ```
243
-
244
- ### AI Operations
245
-
246
- #### List AI Providers
247
- ```bash
248
- GET /api/ai/providers
249
-
250
- Response:
251
- {
252
- "activeProvider": "claude-code",
253
- "providers": [
254
- {
255
- "id": "claude-code",
256
- "name": "Claude Code (SDK)",
257
- "status": "ready",
258
- "isActive": true,
259
- "description": "Model: claude-sonnet-4-20250514"
260
- },
261
- {
262
- "id": "copilot",
263
- "name": "GitHub Copilot",
264
- "status": "needs_config",
265
- "isActive": false
266
- },
267
- {
268
- "id": "demo",
269
- "name": "Demo Mode (No API)",
270
- "status": "ready",
271
- "isActive": false
272
- }
273
- ]
274
- }
275
- ```
276
-
277
- **Status values:**
278
- - `ready` - Provider is configured and available
279
- - `needs_config` - Provider requires configuration (API key, etc.)
280
- - `unavailable` - Provider failed to initialize
281
-
282
- #### Set Active Provider
283
- ```bash
284
- POST /api/ai/providers/:id
285
- Content-Type: application/json
286
-
287
- {
288
- "apiKey": "optional-api-key",
289
- "baseUrl": "optional-base-url",
290
- "model": "optional-model-name"
291
- }
292
-
293
- Response:
294
- {
295
- "success": true,
296
- "status": {
297
- "activeProvider": "claude-code",
298
- "providers": [...]
299
- }
300
- }
301
- ```
302
-
303
- #### Send AI Prompt
304
- ```bash
305
- POST /api/ai/prompt
306
- Content-Type: application/json
307
-
308
- {
309
- "prompt": "Add a step to send Slack notification",
310
- "workflowId": "daily-standup",
311
- "context": {...}
312
- }
313
-
314
- Response:
315
- {
316
- "success": true,
317
- "changes": {
318
- "steps": [...],
319
- "description": "Added Slack notification step"
320
- }
321
- }
322
- ```
323
-
324
- ### Workflow Execution
325
-
326
- #### Execute Workflow
327
- ```bash
328
- POST /api/execute/:path
329
- Content-Type: application/json
330
-
331
- {
332
- "inputs": {
333
- "message": "Hello World"
334
- },
335
- "dryRun": false
336
- }
337
-
338
- Response:
339
- {
340
- "success": true,
341
- "runId": "run_abc123",
342
- "status": "running"
343
- }
344
- ```
345
-
346
- #### Get Execution Status
347
- ```bash
348
- GET /api/execute/status/:runId
349
-
350
- Response:
351
- {
352
- "runId": "run_abc123",
353
- "status": "completed",
354
- "startTime": "2026-01-31T10:00:00Z",
355
- "endTime": "2026-01-31T10:00:15Z",
356
- "steps": [
357
- {
358
- "action": "slack.chat.postMessage",
359
- "status": "completed",
360
- "output": {...}
361
- }
362
- ]
363
- }
364
- ```
365
-
366
- ### WebSocket Events
367
-
368
- Connect to `ws://localhost:3001` for real-time updates:
369
-
370
- ```javascript
371
- const ws = new WebSocket('ws://localhost:3001');
372
-
373
- // Listen for execution updates
374
- ws.on('execution:start', (data) => {
375
- console.log('Workflow started:', data.runId);
376
- });
377
-
378
- ws.on('execution:step', (data) => {
379
- console.log('Step completed:', data.step);
380
- });
381
-
382
- ws.on('execution:complete', (data) => {
383
- console.log('Workflow completed:', data.result);
384
- });
385
-
386
- ws.on('execution:error', (data) => {
387
- console.error('Workflow error:', data.error);
388
- });
389
- ```
49
+ | Provider | Authentication |
50
+ |----------|----------------|
51
+ | Claude Code | Claude CLI (`claude`) |
52
+ | GitHub Copilot | `copilot auth login` |
53
+ | OpenAI Codex | Codex CLI |
54
+ | OpenCode | `opencode /connect` |
55
+ | Claude API | `ANTHROPIC_API_KEY` |
56
+ | Ollama | Local server at `localhost:11434` |
57
+ | Demo Mode | Always available |
390
58
 
391
59
  ## Keyboard Shortcuts
392
60
 
393
61
  | Shortcut | Action |
394
62
  |----------|--------|
395
- | `Ctrl/Cmd + S` | Save workflow |
396
- | `Ctrl/Cmd + Z` | Undo |
397
- | `Ctrl/Cmd + Shift + Z` | Redo |
398
- | `Delete/Backspace` | Delete selected |
399
- | `Ctrl/Cmd + A` | Select all |
400
- | `Escape` | Deselect all |
401
- | `Ctrl/Cmd + D` | Duplicate selected |
402
-
403
- ## Configuration
404
-
405
- Environment variables:
406
-
407
- ```bash
408
- # Server configuration
409
- PORT=3001 # Server port (default: 3001)
410
- WORKFLOW_DIR=./workflows # Workflow directory
411
-
412
- # AI provider configuration
413
- ANTHROPIC_API_KEY=... # For Claude API provider
414
- OLLAMA_BASE_URL=... # For Ollama provider
415
- ```
416
-
417
- ## Development
418
-
419
- ### Setting Up Development Environment
420
-
421
- ```bash
422
- # Clone the repository
423
- git clone https://github.com/marktoflow/marktoflow.git
424
- cd marktoflow
425
-
426
- # Install dependencies
427
- pnpm install
428
-
429
- # Build all packages
430
- pnpm build
431
-
432
- # Start GUI in development mode
433
- cd packages/gui
434
- pnpm dev
435
- ```
436
-
437
- The development server will start:
438
- - **Frontend**: `http://localhost:5173` (Vite dev server with HMR)
439
- - **Backend API**: `http://localhost:3001` (Express server)
440
- - **WebSocket**: `ws://localhost:3001` (Real-time updates)
441
-
442
- ### Development Commands
443
-
444
- ```bash
445
- # Start dev server with hot reload
446
- pnpm dev
447
-
448
- # Build for production
449
- pnpm build
450
-
451
- # Preview production build
452
- pnpm preview
453
-
454
- # Run tests
455
- pnpm test
456
-
457
- # Type checking
458
- pnpm type-check
63
+ | `Cmd/Ctrl + S` | Save workflow |
64
+ | `Cmd/Ctrl + Z` | Undo |
65
+ | `Cmd/Ctrl + Shift + Z` | Redo |
66
+ | `Delete` | Delete selected |
67
+ | `Cmd/Ctrl + D` | Duplicate selected |
459
68
 
460
- # Linting
461
- pnpm lint
462
- ```
463
-
464
- ### Project Structure
465
-
466
- ```
467
- packages/gui/
468
- ├── src/
469
- │ ├── components/ # React components
470
- │ │ ├── Canvas/ # Workflow canvas (React Flow)
471
- │ │ ├── Sidebar/ # Workflow and tool browser
472
- │ │ ├── Properties/ # Step properties editor
473
- │ │ └── AIPrompt/ # AI assistance interface
474
- │ ├── server/ # Express + Socket.IO backend
475
- │ │ ├── api/ # REST API routes
476
- │ │ ├── websocket/ # WebSocket handlers
477
- │ │ └── workflow/ # Workflow execution
478
- │ ├── stores/ # Zustand state management
479
- │ ├── hooks/ # React hooks
480
- │ ├── types/ # TypeScript types
481
- │ └── utils/ # Utility functions
482
- ├── public/ # Static assets
483
- └── dist/ # Production build
484
- ```
485
-
486
- ### Adding New Features
487
-
488
- 1. **New Tool Integration**: Add to `src/components/Sidebar/ToolPalette.tsx`
489
- 2. **New API Endpoint**: Add to `src/server/api/routes.ts`
490
- 3. **New AI Provider**: Add to `src/server/ai/providers/`
491
- 4. **New Canvas Node**: Add to `src/components/Canvas/nodes/`
492
-
493
- ### Technology Stack
494
-
495
- - **Frontend**: React 18, TypeScript, Vite
496
- - **UI Framework**: Radix UI, Tailwind CSS
497
- - **State Management**: Zustand
498
- - **Canvas**: React Flow
499
- - **Code Editor**: Monaco Editor
500
- - **Backend**: Express, Socket.IO
501
- - **File Watching**: Chokidar
502
- - **Testing**: Vitest, React Testing Library
503
-
504
- ## Requirements
505
-
506
- - Node.js 18+
507
- - Modern browser (Chrome, Firefox, Safari, Edge)
508
- - Screen resolution: 1280x720 minimum
509
-
510
- ## Troubleshooting
511
-
512
- ### GUI Not Starting
513
-
514
- ```bash
515
- # Check if port is already in use
516
- lsof -i :3001
517
-
518
- # Use a different port
519
- marktoflow gui --port 3002
520
- ```
521
-
522
- ### AI Provider Not Available
523
-
524
- ```bash
525
- # For Claude Code
526
- claude # Verify Claude CLI is authenticated
527
-
528
- # For GitHub Copilot
529
- copilot auth login # Re-authenticate
530
-
531
- # For Ollama
532
- ollama serve # Ensure Ollama is running
533
- ```
534
-
535
- ### Workflows Not Appearing
536
-
537
- ```bash
538
- # Check workflow directory
539
- marktoflow gui --workflow-dir ./workflows
540
-
541
- # Verify workflow files are valid markdown
542
- marktoflow workflow validate workflow.md
543
- ```
544
-
545
- ### WebSocket Connection Issues
546
-
547
- If real-time updates aren't working:
548
- 1. Check browser console for WebSocket errors
549
- 2. Verify firewall isn't blocking WebSocket connections
550
- 3. Try restarting the GUI server
551
-
552
- ### Build Issues
553
-
554
- ```bash
555
- # Clean and rebuild
556
- pnpm clean
557
- pnpm build
558
-
559
- # Clear node_modules
560
- rm -rf node_modules
561
- pnpm install
562
- ```
563
-
564
- ## Examples
565
-
566
- Load any workflow from the [examples/](https://github.com/marktoflow/marktoflow/tree/main/examples) directory:
567
-
568
- ```bash
569
- # Start GUI with examples
570
- marktoflow gui --workflow-dir ./examples
571
-
572
- # Open specific example
573
- marktoflow gui --open examples/daily-standup/workflow.md
574
- ```
69
+ ## Documentation
575
70
 
576
- Try these workflows in the GUI:
577
- - **daily-standup** - See AI-generated summaries in action
578
- - **code-review** - Visualize multi-step PR review flow
579
- - **web-automation** - Watch browser automation steps execute
580
- - **copilot-code-review** - See GitHub Copilot SDK integration
71
+ - [GUI User Guide](../../docs/GUI_USER_GUIDE.md)
72
+ - [GUI Developer Guide](../../docs/GUI_DEVELOPER_GUIDE.md)
581
73
 
582
- ## Documentation
74
+ ## Contributing
583
75
 
584
- - [User Guide](../../docs/GUI_USER_GUIDE.md)
585
- - [API Reference](../../docs/GUI_API_REFERENCE.md)
586
- - [Developer Guide](../../docs/GUI_DEVELOPER_GUIDE.md)
587
- - [Examples](https://github.com/marktoflow/marktoflow/tree/main/examples)
76
+ See the [contributing guide](../../CONTRIBUTING.md).
588
77
 
589
78
  ## License
590
79