@marktoflow/gui 2.0.0-alpha.12 → 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.
Files changed (141) hide show
  1. package/README.md +380 -14
  2. package/client.log +0 -0
  3. package/dist/client/assets/{index-CM44OayM.js → index-CIvjE2Ts.js} +144 -145
  4. package/dist/client/assets/index-CIvjE2Ts.js.map +1 -0
  5. package/dist/client/assets/index-Cu3CHOQw.css +1 -0
  6. package/dist/client/index.html +2 -2
  7. package/dist/server/index.js +10 -2
  8. package/dist/server/index.js.map +1 -1
  9. package/dist/server/routes/ai.js +2 -2
  10. package/dist/server/routes/ai.js.map +1 -1
  11. package/dist/server/routes/execute.js +181 -14
  12. package/dist/server/routes/execute.js.map +1 -1
  13. package/dist/server/services/AIService.js +39 -2
  14. package/dist/server/services/AIService.js.map +1 -1
  15. package/dist/server/services/ExecutionManager.js +428 -0
  16. package/dist/server/services/ExecutionManager.js.map +1 -0
  17. package/package.json +2 -4
  18. package/server.log +0 -0
  19. package/tests/integration/fixtures/test-workflow.md +6 -0
  20. package/.marktoflow/state/workflow-state.db +0 -0
  21. package/.marktoflow/state/workflow-state.db-shm +0 -0
  22. package/.marktoflow/state/workflow-state.db-wal +0 -0
  23. package/.turbo/turbo-build.log +0 -42
  24. package/.turbo/turbo-test.log +0 -38
  25. package/dist/client/assets/index-CM44OayM.js.map +0 -1
  26. package/dist/client/assets/index-Dru63gi6.css +0 -1
  27. package/marktoflow-gui-2.0.0-alpha.12.tgz +0 -0
  28. package/playwright.config.ts +0 -27
  29. package/postcss.config.js +0 -6
  30. package/src/client/App.tsx +0 -520
  31. package/src/client/components/Canvas/Canvas.tsx +0 -425
  32. package/src/client/components/Canvas/ExecutionOverlay.tsx +0 -935
  33. package/src/client/components/Canvas/ForEachNode.tsx +0 -152
  34. package/src/client/components/Canvas/IfElseNode.tsx +0 -141
  35. package/src/client/components/Canvas/NodeContextMenu.tsx +0 -192
  36. package/src/client/components/Canvas/OutputNode.tsx +0 -111
  37. package/src/client/components/Canvas/ParallelNode.tsx +0 -157
  38. package/src/client/components/Canvas/StepNode.tsx +0 -106
  39. package/src/client/components/Canvas/SubWorkflowNode.tsx +0 -141
  40. package/src/client/components/Canvas/SwitchNode.tsx +0 -185
  41. package/src/client/components/Canvas/Toolbar.tsx +0 -227
  42. package/src/client/components/Canvas/TransformNode.tsx +0 -194
  43. package/src/client/components/Canvas/TriggerNode.tsx +0 -128
  44. package/src/client/components/Canvas/TryCatchNode.tsx +0 -164
  45. package/src/client/components/Canvas/WhileNode.tsx +0 -161
  46. package/src/client/components/Canvas/index.ts +0 -24
  47. package/src/client/components/Debug/VariableInspector.tsx +0 -148
  48. package/src/client/components/Editor/InputsEditor.tsx +0 -458
  49. package/src/client/components/Editor/NewStepWizard.tsx +0 -344
  50. package/src/client/components/Editor/StepEditor.tsx +0 -532
  51. package/src/client/components/Editor/YamlEditor.tsx +0 -160
  52. package/src/client/components/Panels/PropertiesPanel.tsx +0 -589
  53. package/src/client/components/Prompt/ChangePreview.tsx +0 -281
  54. package/src/client/components/Prompt/PromptHistoryPanel.tsx +0 -209
  55. package/src/client/components/Prompt/PromptInput.tsx +0 -110
  56. package/src/client/components/Settings/ProviderSwitcher.tsx +0 -228
  57. package/src/client/components/Sidebar/ImportDialog.tsx +0 -257
  58. package/src/client/components/Sidebar/Sidebar.tsx +0 -362
  59. package/src/client/components/common/Breadcrumb.tsx +0 -40
  60. package/src/client/components/common/Button.tsx +0 -68
  61. package/src/client/components/common/ContextMenu.tsx +0 -202
  62. package/src/client/components/common/KeyboardShortcuts.tsx +0 -149
  63. package/src/client/components/common/Modal.tsx +0 -93
  64. package/src/client/components/common/Tabs.tsx +0 -57
  65. package/src/client/components/common/ThemeToggle.tsx +0 -63
  66. package/src/client/components/index.ts +0 -32
  67. package/src/client/hooks/index.ts +0 -4
  68. package/src/client/hooks/useAIPrompt.ts +0 -108
  69. package/src/client/hooks/useCanvas.ts +0 -247
  70. package/src/client/hooks/useWebSocket.ts +0 -164
  71. package/src/client/hooks/useWorkflow.ts +0 -138
  72. package/src/client/main.tsx +0 -10
  73. package/src/client/stores/agentStore.ts +0 -109
  74. package/src/client/stores/canvasStore.ts +0 -348
  75. package/src/client/stores/editorStore.ts +0 -133
  76. package/src/client/stores/executionStore.ts +0 -502
  77. package/src/client/stores/index.ts +0 -4
  78. package/src/client/stores/layoutStore.ts +0 -103
  79. package/src/client/stores/navigationStore.ts +0 -49
  80. package/src/client/stores/promptStore.ts +0 -113
  81. package/src/client/stores/themeStore.ts +0 -75
  82. package/src/client/stores/workflowStore.ts +0 -185
  83. package/src/client/styles/globals.css +0 -452
  84. package/src/client/utils/cn.ts +0 -9
  85. package/src/client/utils/index.ts +0 -4
  86. package/src/client/utils/platform.ts +0 -46
  87. package/src/client/utils/serviceIcons.tsx +0 -97
  88. package/src/client/utils/stepValidation.ts +0 -155
  89. package/src/client/utils/workflowToGraph.ts +0 -523
  90. package/src/server/index.ts +0 -137
  91. package/src/server/routes/ai.ts +0 -91
  92. package/src/server/routes/execute.ts +0 -71
  93. package/src/server/routes/executions.ts +0 -136
  94. package/src/server/routes/tools.ts +0 -970
  95. package/src/server/routes/workflows.ts +0 -147
  96. package/src/server/services/AIService.ts +0 -105
  97. package/src/server/services/FileWatcher.ts +0 -69
  98. package/src/server/services/WorkflowService.ts +0 -601
  99. package/src/server/services/agents/claude-code-provider.ts +0 -320
  100. package/src/server/services/agents/claude-provider.ts +0 -248
  101. package/src/server/services/agents/codex-provider.ts +0 -398
  102. package/src/server/services/agents/copilot-provider.ts +0 -311
  103. package/src/server/services/agents/demo-provider.ts +0 -184
  104. package/src/server/services/agents/index.ts +0 -31
  105. package/src/server/services/agents/ollama-provider.ts +0 -267
  106. package/src/server/services/agents/prompts.ts +0 -509
  107. package/src/server/services/agents/registry.ts +0 -310
  108. package/src/server/services/agents/types.ts +0 -146
  109. package/src/server/websocket/index.ts +0 -117
  110. package/src/shared/constants.ts +0 -180
  111. package/src/shared/types.ts +0 -179
  112. package/tailwind.config.ts +0 -73
  113. package/tests/e2e/app.spec.ts +0 -90
  114. package/tests/e2e/canvas.spec.ts +0 -128
  115. package/tests/e2e/workflow.spec.ts +0 -185
  116. package/tests/integration/api.test.ts +0 -452
  117. package/tests/integration/testApp.ts +0 -31
  118. package/tests/setup.ts +0 -72
  119. package/tests/unit/ForEachNode.test.tsx +0 -308
  120. package/tests/unit/IfElseNode.test.tsx +0 -235
  121. package/tests/unit/ParallelNode.test.tsx +0 -344
  122. package/tests/unit/SwitchNode.test.tsx +0 -327
  123. package/tests/unit/TransformNode.test.tsx +0 -386
  124. package/tests/unit/TryCatchNode.test.tsx +0 -243
  125. package/tests/unit/WhileNode.test.tsx +0 -230
  126. package/tests/unit/agentStore.test.ts +0 -218
  127. package/tests/unit/canvasStore.test.ts +0 -502
  128. package/tests/unit/codexProvider.test.ts +0 -399
  129. package/tests/unit/components.test.tsx +0 -151
  130. package/tests/unit/executionStore.test.ts +0 -567
  131. package/tests/unit/layoutStore.test.ts +0 -194
  132. package/tests/unit/navigationStore.test.ts +0 -152
  133. package/tests/unit/platform.test.ts +0 -118
  134. package/tests/unit/serviceIcons.test.ts +0 -197
  135. package/tests/unit/stepValidation.test.ts +0 -226
  136. package/tests/unit/themeStore.test.ts +0 -141
  137. package/tests/unit/workflowToGraph.test.ts +0 -311
  138. package/tsconfig.json +0 -29
  139. package/tsconfig.server.json +0 -28
  140. package/vite.config.ts +0 -31
  141. 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
- }