@marktoflow/gui 2.0.0-alpha.13 → 2.0.0-alpha.14
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 +380 -14
- package/client.log +0 -0
- package/dist/client/assets/{index-CM44OayM.js → index-CIvjE2Ts.js} +144 -145
- package/dist/client/assets/index-CIvjE2Ts.js.map +1 -0
- package/dist/client/assets/index-Cu3CHOQw.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +10 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/ai.js +2 -2
- package/dist/server/routes/ai.js.map +1 -1
- package/dist/server/routes/execute.js +181 -14
- package/dist/server/routes/execute.js.map +1 -1
- package/dist/server/services/AIService.js +39 -2
- package/dist/server/services/AIService.js.map +1 -1
- package/dist/server/services/ExecutionManager.js +428 -0
- package/dist/server/services/ExecutionManager.js.map +1 -0
- package/package.json +2 -2
- package/server.log +0 -0
- package/tests/integration/fixtures/test-workflow.md +6 -0
- package/dist/client/assets/index-CM44OayM.js.map +0 -1
- package/dist/client/assets/index-Dru63gi6.css +0 -1
package/README.md
CHANGED
|
@@ -45,8 +45,11 @@ marktoflow gui
|
|
|
45
45
|
# With options
|
|
46
46
|
marktoflow gui --port 3000 # Custom port
|
|
47
47
|
marktoflow gui --open # Open browser automatically
|
|
48
|
+
marktoflow gui --workflow-dir ./workflows # Custom workflow directory
|
|
48
49
|
```
|
|
49
50
|
|
|
51
|
+
The GUI will start at `http://localhost:3001` (or your specified port) and automatically watch your workflow directory for changes.
|
|
52
|
+
|
|
50
53
|
### Programmatic Usage
|
|
51
54
|
|
|
52
55
|
```typescript
|
|
@@ -61,6 +64,41 @@ const server = await startServer({
|
|
|
61
64
|
console.log('GUI available at http://localhost:3001');
|
|
62
65
|
```
|
|
63
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
|
+
|
|
64
102
|
## Interface Overview
|
|
65
103
|
|
|
66
104
|
```
|
|
@@ -146,24 +184,208 @@ ollama serve
|
|
|
146
184
|
# The GUI will automatically detect Ollama at localhost:11434
|
|
147
185
|
```
|
|
148
186
|
|
|
149
|
-
## API
|
|
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
|
|
150
281
|
|
|
151
|
-
|
|
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
|
+
```
|
|
152
302
|
|
|
303
|
+
#### Send AI Prompt
|
|
153
304
|
```bash
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
+
```
|
|
158
323
|
|
|
159
|
-
|
|
160
|
-
GET /api/ai/providers # List AI providers and status
|
|
161
|
-
POST /api/ai/providers/:id # Set active AI provider
|
|
162
|
-
POST /api/ai/prompt # Send prompt to AI
|
|
324
|
+
### Workflow Execution
|
|
163
325
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
+
});
|
|
167
389
|
```
|
|
168
390
|
|
|
169
391
|
## Keyboard Shortcuts
|
|
@@ -194,31 +416,175 @@ OLLAMA_BASE_URL=... # For Ollama provider
|
|
|
194
416
|
|
|
195
417
|
## Development
|
|
196
418
|
|
|
419
|
+
### Setting Up Development Environment
|
|
420
|
+
|
|
197
421
|
```bash
|
|
422
|
+
# Clone the repository
|
|
423
|
+
git clone https://github.com/marktoflow/marktoflow.git
|
|
424
|
+
cd marktoflow
|
|
425
|
+
|
|
198
426
|
# Install dependencies
|
|
199
427
|
pnpm install
|
|
200
428
|
|
|
201
|
-
#
|
|
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
|
|
202
446
|
pnpm dev
|
|
203
447
|
|
|
204
448
|
# Build for production
|
|
205
449
|
pnpm build
|
|
206
450
|
|
|
451
|
+
# Preview production build
|
|
452
|
+
pnpm preview
|
|
453
|
+
|
|
207
454
|
# Run tests
|
|
208
455
|
pnpm test
|
|
456
|
+
|
|
457
|
+
# Type checking
|
|
458
|
+
pnpm type-check
|
|
459
|
+
|
|
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
|
|
209
484
|
```
|
|
210
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
|
+
|
|
211
504
|
## Requirements
|
|
212
505
|
|
|
213
506
|
- Node.js 18+
|
|
214
507
|
- Modern browser (Chrome, Firefox, Safari, Edge)
|
|
215
508
|
- Screen resolution: 1280x720 minimum
|
|
216
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
|
+
```
|
|
575
|
+
|
|
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
|
|
581
|
+
|
|
217
582
|
## Documentation
|
|
218
583
|
|
|
219
584
|
- [User Guide](../../docs/GUI_USER_GUIDE.md)
|
|
220
585
|
- [API Reference](../../docs/GUI_API_REFERENCE.md)
|
|
221
586
|
- [Developer Guide](../../docs/GUI_DEVELOPER_GUIDE.md)
|
|
587
|
+
- [Examples](https://github.com/marktoflow/marktoflow/tree/main/examples)
|
|
222
588
|
|
|
223
589
|
## License
|
|
224
590
|
|
package/client.log
ADDED
|
File without changes
|