@marktoflow/gui 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
Files changed (121) hide show
  1. package/package.json +1 -3
  2. package/.marktoflow/state/workflow-state.db +0 -0
  3. package/.marktoflow/state/workflow-state.db-shm +0 -0
  4. package/.marktoflow/state/workflow-state.db-wal +0 -0
  5. package/.turbo/turbo-build.log +0 -42
  6. package/.turbo/turbo-test.log +0 -38
  7. package/marktoflow-gui-2.0.0-alpha.12.tgz +0 -0
  8. package/playwright.config.ts +0 -27
  9. package/postcss.config.js +0 -6
  10. package/src/client/App.tsx +0 -520
  11. package/src/client/components/Canvas/Canvas.tsx +0 -425
  12. package/src/client/components/Canvas/ExecutionOverlay.tsx +0 -935
  13. package/src/client/components/Canvas/ForEachNode.tsx +0 -152
  14. package/src/client/components/Canvas/IfElseNode.tsx +0 -141
  15. package/src/client/components/Canvas/NodeContextMenu.tsx +0 -192
  16. package/src/client/components/Canvas/OutputNode.tsx +0 -111
  17. package/src/client/components/Canvas/ParallelNode.tsx +0 -157
  18. package/src/client/components/Canvas/StepNode.tsx +0 -106
  19. package/src/client/components/Canvas/SubWorkflowNode.tsx +0 -141
  20. package/src/client/components/Canvas/SwitchNode.tsx +0 -185
  21. package/src/client/components/Canvas/Toolbar.tsx +0 -227
  22. package/src/client/components/Canvas/TransformNode.tsx +0 -194
  23. package/src/client/components/Canvas/TriggerNode.tsx +0 -128
  24. package/src/client/components/Canvas/TryCatchNode.tsx +0 -164
  25. package/src/client/components/Canvas/WhileNode.tsx +0 -161
  26. package/src/client/components/Canvas/index.ts +0 -24
  27. package/src/client/components/Debug/VariableInspector.tsx +0 -148
  28. package/src/client/components/Editor/InputsEditor.tsx +0 -458
  29. package/src/client/components/Editor/NewStepWizard.tsx +0 -344
  30. package/src/client/components/Editor/StepEditor.tsx +0 -532
  31. package/src/client/components/Editor/YamlEditor.tsx +0 -160
  32. package/src/client/components/Panels/PropertiesPanel.tsx +0 -589
  33. package/src/client/components/Prompt/ChangePreview.tsx +0 -281
  34. package/src/client/components/Prompt/PromptHistoryPanel.tsx +0 -209
  35. package/src/client/components/Prompt/PromptInput.tsx +0 -110
  36. package/src/client/components/Settings/ProviderSwitcher.tsx +0 -228
  37. package/src/client/components/Sidebar/ImportDialog.tsx +0 -257
  38. package/src/client/components/Sidebar/Sidebar.tsx +0 -362
  39. package/src/client/components/common/Breadcrumb.tsx +0 -40
  40. package/src/client/components/common/Button.tsx +0 -68
  41. package/src/client/components/common/ContextMenu.tsx +0 -202
  42. package/src/client/components/common/KeyboardShortcuts.tsx +0 -149
  43. package/src/client/components/common/Modal.tsx +0 -93
  44. package/src/client/components/common/Tabs.tsx +0 -57
  45. package/src/client/components/common/ThemeToggle.tsx +0 -63
  46. package/src/client/components/index.ts +0 -32
  47. package/src/client/hooks/index.ts +0 -4
  48. package/src/client/hooks/useAIPrompt.ts +0 -108
  49. package/src/client/hooks/useCanvas.ts +0 -247
  50. package/src/client/hooks/useWebSocket.ts +0 -164
  51. package/src/client/hooks/useWorkflow.ts +0 -138
  52. package/src/client/main.tsx +0 -10
  53. package/src/client/stores/agentStore.ts +0 -109
  54. package/src/client/stores/canvasStore.ts +0 -348
  55. package/src/client/stores/editorStore.ts +0 -133
  56. package/src/client/stores/executionStore.ts +0 -502
  57. package/src/client/stores/index.ts +0 -4
  58. package/src/client/stores/layoutStore.ts +0 -103
  59. package/src/client/stores/navigationStore.ts +0 -49
  60. package/src/client/stores/promptStore.ts +0 -113
  61. package/src/client/stores/themeStore.ts +0 -75
  62. package/src/client/stores/workflowStore.ts +0 -185
  63. package/src/client/styles/globals.css +0 -452
  64. package/src/client/utils/cn.ts +0 -9
  65. package/src/client/utils/index.ts +0 -4
  66. package/src/client/utils/platform.ts +0 -46
  67. package/src/client/utils/serviceIcons.tsx +0 -97
  68. package/src/client/utils/stepValidation.ts +0 -155
  69. package/src/client/utils/workflowToGraph.ts +0 -523
  70. package/src/server/index.ts +0 -137
  71. package/src/server/routes/ai.ts +0 -91
  72. package/src/server/routes/execute.ts +0 -71
  73. package/src/server/routes/executions.ts +0 -136
  74. package/src/server/routes/tools.ts +0 -970
  75. package/src/server/routes/workflows.ts +0 -147
  76. package/src/server/services/AIService.ts +0 -105
  77. package/src/server/services/FileWatcher.ts +0 -69
  78. package/src/server/services/WorkflowService.ts +0 -601
  79. package/src/server/services/agents/claude-code-provider.ts +0 -320
  80. package/src/server/services/agents/claude-provider.ts +0 -248
  81. package/src/server/services/agents/codex-provider.ts +0 -398
  82. package/src/server/services/agents/copilot-provider.ts +0 -311
  83. package/src/server/services/agents/demo-provider.ts +0 -184
  84. package/src/server/services/agents/index.ts +0 -31
  85. package/src/server/services/agents/ollama-provider.ts +0 -267
  86. package/src/server/services/agents/prompts.ts +0 -509
  87. package/src/server/services/agents/registry.ts +0 -310
  88. package/src/server/services/agents/types.ts +0 -146
  89. package/src/server/websocket/index.ts +0 -117
  90. package/src/shared/constants.ts +0 -180
  91. package/src/shared/types.ts +0 -179
  92. package/tailwind.config.ts +0 -73
  93. package/tests/e2e/app.spec.ts +0 -90
  94. package/tests/e2e/canvas.spec.ts +0 -128
  95. package/tests/e2e/workflow.spec.ts +0 -185
  96. package/tests/integration/api.test.ts +0 -452
  97. package/tests/integration/testApp.ts +0 -31
  98. package/tests/setup.ts +0 -72
  99. package/tests/unit/ForEachNode.test.tsx +0 -308
  100. package/tests/unit/IfElseNode.test.tsx +0 -235
  101. package/tests/unit/ParallelNode.test.tsx +0 -344
  102. package/tests/unit/SwitchNode.test.tsx +0 -327
  103. package/tests/unit/TransformNode.test.tsx +0 -386
  104. package/tests/unit/TryCatchNode.test.tsx +0 -243
  105. package/tests/unit/WhileNode.test.tsx +0 -230
  106. package/tests/unit/agentStore.test.ts +0 -218
  107. package/tests/unit/canvasStore.test.ts +0 -502
  108. package/tests/unit/codexProvider.test.ts +0 -399
  109. package/tests/unit/components.test.tsx +0 -151
  110. package/tests/unit/executionStore.test.ts +0 -567
  111. package/tests/unit/layoutStore.test.ts +0 -194
  112. package/tests/unit/navigationStore.test.ts +0 -152
  113. package/tests/unit/platform.test.ts +0 -118
  114. package/tests/unit/serviceIcons.test.ts +0 -197
  115. package/tests/unit/stepValidation.test.ts +0 -226
  116. package/tests/unit/themeStore.test.ts +0 -141
  117. package/tests/unit/workflowToGraph.test.ts +0 -311
  118. package/tsconfig.json +0 -29
  119. package/tsconfig.server.json +0 -28
  120. package/vite.config.ts +0 -31
  121. package/vitest.config.ts +0 -26
@@ -1,147 +0,0 @@
1
- import { Router, type Router as RouterType } from 'express';
2
- import multer from 'multer';
3
- import { WorkflowService } from '../services/WorkflowService.js';
4
-
5
- const router: RouterType = Router();
6
- const workflowService = new WorkflowService();
7
-
8
- // Configure multer for file uploads (in-memory storage)
9
- const upload = multer({
10
- storage: multer.memoryStorage(),
11
- limits: {
12
- fileSize: 10 * 1024 * 1024, // 10MB max file size
13
- },
14
- fileFilter: (_req, file, cb) => {
15
- const allowedExtensions = ['.md', '.yaml', '.yml', '.zip'];
16
- const ext = file.originalname.toLowerCase().slice(file.originalname.lastIndexOf('.'));
17
- if (allowedExtensions.includes(ext)) {
18
- cb(null, true);
19
- } else {
20
- cb(new Error('Invalid file type. Only .md, .yaml, .yml, and .zip files are allowed.'));
21
- }
22
- },
23
- });
24
-
25
- // List all workflows
26
- router.get('/', async (_req, res) => {
27
- try {
28
- const workflows = await workflowService.listWorkflows();
29
- res.json({ workflows });
30
- } catch (error) {
31
- res.status(500).json({
32
- error: 'Failed to list workflows',
33
- message: error instanceof Error ? error.message : 'Unknown error',
34
- });
35
- }
36
- });
37
-
38
- // Get a specific workflow
39
- router.get('/:path(*)', async (req, res) => {
40
- try {
41
- // Express captures wildcard routes in params[0]
42
- const workflowPath = decodeURIComponent((req.params as any)[0] || '');
43
- const workflow = await workflowService.getWorkflow(workflowPath);
44
-
45
- if (!workflow) {
46
- return res.status(404).json({ error: 'Workflow not found' });
47
- }
48
-
49
- res.json({ workflow });
50
- } catch (error) {
51
- res.status(500).json({
52
- error: 'Failed to get workflow',
53
- message: error instanceof Error ? error.message : 'Unknown error',
54
- });
55
- }
56
- });
57
-
58
- // Create a new workflow
59
- router.post('/', async (req, res) => {
60
- try {
61
- const { name, template } = req.body;
62
-
63
- if (!name) {
64
- return res.status(400).json({ error: 'Name is required' });
65
- }
66
-
67
- const workflow = await workflowService.createWorkflow(name, template);
68
- res.status(201).json({ workflow });
69
- } catch (error) {
70
- res.status(500).json({
71
- error: 'Failed to create workflow',
72
- message: error instanceof Error ? error.message : 'Unknown error',
73
- });
74
- }
75
- });
76
-
77
- // Update a workflow
78
- router.put('/:path(*)', async (req, res) => {
79
- try {
80
- const workflowPath = decodeURIComponent((req.params as Record<string, string>)['path(*)']);
81
- const { workflow } = req.body;
82
-
83
- if (!workflow) {
84
- return res.status(400).json({ error: 'Workflow data is required' });
85
- }
86
-
87
- const updated = await workflowService.updateWorkflow(workflowPath, workflow);
88
- res.json({ workflow: updated });
89
- } catch (error) {
90
- res.status(500).json({
91
- error: 'Failed to update workflow',
92
- message: error instanceof Error ? error.message : 'Unknown error',
93
- });
94
- }
95
- });
96
-
97
- // Delete a workflow
98
- router.delete('/:path(*)', async (req, res) => {
99
- try {
100
- const workflowPath = decodeURIComponent((req.params as Record<string, string>)['path(*)']);
101
- await workflowService.deleteWorkflow(workflowPath);
102
- res.json({ success: true });
103
- } catch (error) {
104
- res.status(500).json({
105
- error: 'Failed to delete workflow',
106
- message: error instanceof Error ? error.message : 'Unknown error',
107
- });
108
- }
109
- });
110
-
111
- // Get workflow execution history
112
- router.get('/:path(*)/runs', async (req, res) => {
113
- try {
114
- const workflowPath = decodeURIComponent((req.params as Record<string, string>)['path(*)']);
115
- const runs = await workflowService.getExecutionHistory(workflowPath);
116
- res.json({ runs });
117
- } catch (error) {
118
- res.status(500).json({
119
- error: 'Failed to get execution history',
120
- message: error instanceof Error ? error.message : 'Unknown error',
121
- });
122
- }
123
- });
124
-
125
- // Import workflow from file upload
126
- router.post('/import', upload.single('file'), async (req, res) => {
127
- try {
128
- if (!req.file) {
129
- return res.status(400).json({ error: 'No file uploaded' });
130
- }
131
-
132
- const result = await workflowService.importWorkflow(
133
- req.file.buffer,
134
- req.file.originalname
135
- );
136
-
137
- res.json(result);
138
- } catch (error) {
139
- console.error('Import error:', error);
140
- res.status(500).json({
141
- error: 'Failed to import workflow',
142
- message: error instanceof Error ? error.message : 'Unknown error',
143
- });
144
- }
145
- });
146
-
147
- export { router as workflowRoutes };
@@ -1,105 +0,0 @@
1
- /**
2
- * AI Service - Backwards-compatible wrapper around the Agent Registry
3
- *
4
- * This service provides the same interface as before but now supports
5
- * multiple AI backends through the agent provider system.
6
- */
7
-
8
- import { getAgentRegistry, type AgentRegistry, type PromptHistoryItem } from './agents/index.js';
9
-
10
- interface Workflow {
11
- metadata: any;
12
- steps: any[];
13
- tools?: Record<string, any>;
14
- inputs?: Record<string, any>;
15
- }
16
-
17
- interface PromptResult {
18
- explanation: string;
19
- workflow?: Workflow;
20
- diff?: string;
21
- }
22
-
23
- export class AIService {
24
- private registry: AgentRegistry;
25
- private initialized: boolean = false;
26
-
27
- constructor() {
28
- this.registry = getAgentRegistry();
29
- }
30
-
31
- /**
32
- * Initialize the service with auto-detection of available providers
33
- */
34
- async initialize(): Promise<void> {
35
- if (!this.initialized) {
36
- await this.registry.autoDetectProvider();
37
- this.initialized = true;
38
- }
39
- }
40
-
41
- /**
42
- * Process a prompt to modify a workflow
43
- */
44
- async processPrompt(prompt: string, workflow: Workflow): Promise<PromptResult> {
45
- await this.initialize();
46
- return this.registry.processPrompt(prompt, workflow);
47
- }
48
-
49
- /**
50
- * Stream a prompt response (if supported by the active provider)
51
- */
52
- async streamPrompt(
53
- prompt: string,
54
- workflow: Workflow,
55
- onChunk: (chunk: string) => void
56
- ): Promise<PromptResult> {
57
- await this.initialize();
58
- return this.registry.streamPrompt(prompt, workflow, onChunk);
59
- }
60
-
61
- /**
62
- * Get prompt history
63
- */
64
- async getHistory(): Promise<PromptHistoryItem[]> {
65
- return this.registry.getHistory(20);
66
- }
67
-
68
- /**
69
- * Get suggestions for the current workflow
70
- */
71
- async getSuggestions(
72
- workflow: Workflow,
73
- selectedStepId?: string
74
- ): Promise<string[]> {
75
- await this.initialize();
76
- return this.registry.getSuggestions(workflow, selectedStepId);
77
- }
78
-
79
- /**
80
- * Get the current provider status
81
- */
82
- getStatus(): {
83
- activeProvider: string;
84
- providers: Array<{ id: string; name: string; ready: boolean; model?: string; error?: string }>;
85
- } {
86
- return this.registry.getStatus();
87
- }
88
-
89
- /**
90
- * Switch to a different provider
91
- */
92
- async setProvider(
93
- providerId: string,
94
- config?: { apiKey?: string; baseUrl?: string; model?: string }
95
- ): Promise<boolean> {
96
- return this.registry.setActiveProvider(providerId, config);
97
- }
98
-
99
- /**
100
- * Get the registry for direct access to providers
101
- */
102
- getRegistry(): AgentRegistry {
103
- return this.registry;
104
- }
105
- }
@@ -1,69 +0,0 @@
1
- import { watch, type FSWatcher } from 'chokidar';
2
- import type { Server as SocketIOServer } from 'socket.io';
3
-
4
- export class FileWatcher {
5
- private watcher: FSWatcher;
6
- private io: SocketIOServer;
7
-
8
- constructor(baseDir: string, io: SocketIOServer) {
9
- this.io = io;
10
-
11
- // Watch for workflow files
12
- this.watcher = watch(['**/*.md', '**/*.yaml', '**/*.yml'], {
13
- cwd: baseDir,
14
- ignored: [
15
- '**/node_modules/**',
16
- '**/dist/**',
17
- '**/.git/**',
18
- '**/.*',
19
- ],
20
- persistent: true,
21
- ignoreInitial: true,
22
- awaitWriteFinish: {
23
- stabilityThreshold: 300,
24
- pollInterval: 100,
25
- },
26
- });
27
-
28
- this.setupListeners();
29
- console.log(`File watcher started for: ${baseDir}`);
30
- }
31
-
32
- private setupListeners() {
33
- this.watcher.on('change', (path) => {
34
- console.log(`File changed: ${path}`);
35
- this.io.emit('workflow:updated', {
36
- path,
37
- event: 'change',
38
- timestamp: new Date().toISOString(),
39
- });
40
- });
41
-
42
- this.watcher.on('add', (path) => {
43
- console.log(`File added: ${path}`);
44
- this.io.emit('workflow:updated', {
45
- path,
46
- event: 'add',
47
- timestamp: new Date().toISOString(),
48
- });
49
- });
50
-
51
- this.watcher.on('unlink', (path) => {
52
- console.log(`File removed: ${path}`);
53
- this.io.emit('workflow:updated', {
54
- path,
55
- event: 'remove',
56
- timestamp: new Date().toISOString(),
57
- });
58
- });
59
-
60
- this.watcher.on('error', (error) => {
61
- console.error('File watcher error:', error);
62
- });
63
- }
64
-
65
- stop() {
66
- this.watcher.close();
67
- console.log('File watcher stopped');
68
- }
69
- }