@marktoflow/gui 2.0.0-alpha.1 → 2.0.0-alpha.3
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/.turbo/turbo-build.log +7 -7
- package/README.md +38 -2
- package/dist/client/assets/index-C90Y_aBX.js +678 -0
- package/dist/client/assets/index-C90Y_aBX.js.map +1 -0
- package/dist/client/assets/index-CRWeQ3NN.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/server/index.js +1 -1
- package/dist/server/server/routes/tools.js +406 -0
- package/dist/server/server/routes/tools.js.map +1 -1
- package/dist/server/server/services/agents/codex-provider.js +270 -0
- package/dist/server/server/services/agents/codex-provider.js.map +1 -0
- package/dist/server/server/services/agents/prompts.js +27 -0
- package/dist/server/server/services/agents/prompts.js.map +1 -1
- package/dist/server/server/services/agents/registry.js +20 -0
- package/dist/server/server/services/agents/registry.js.map +1 -1
- package/package.json +6 -6
- package/src/client/components/Canvas/Canvas.tsx +24 -6
- package/src/client/components/Canvas/ForEachNode.tsx +128 -0
- package/src/client/components/Canvas/IfElseNode.tsx +126 -0
- package/src/client/components/Canvas/ParallelNode.tsx +140 -0
- package/src/client/components/Canvas/SwitchNode.tsx +164 -0
- package/src/client/components/Canvas/TransformNode.tsx +185 -0
- package/src/client/components/Canvas/TryCatchNode.tsx +164 -0
- package/src/client/components/Canvas/WhileNode.tsx +129 -0
- package/src/client/components/Canvas/index.ts +24 -0
- package/src/client/utils/serviceIcons.tsx +33 -0
- package/src/server/index.ts +1 -1
- package/src/server/routes/tools.ts +406 -0
- package/src/server/services/agents/codex-provider.ts +398 -0
- package/src/server/services/agents/prompts.ts +27 -0
- package/src/server/services/agents/registry.ts +21 -0
- package/tailwind.config.ts +1 -1
- package/tests/integration/api.test.ts +203 -1
- package/tests/integration/testApp.ts +1 -1
- package/tests/setup.ts +35 -0
- package/tests/unit/ForEachNode.test.tsx +218 -0
- package/tests/unit/IfElseNode.test.tsx +188 -0
- package/tests/unit/ParallelNode.test.tsx +264 -0
- package/tests/unit/SwitchNode.test.tsx +252 -0
- package/tests/unit/TransformNode.test.tsx +386 -0
- package/tests/unit/TryCatchNode.test.tsx +243 -0
- package/tests/unit/WhileNode.test.tsx +226 -0
- package/tests/unit/codexProvider.test.ts +399 -0
- package/tests/unit/serviceIcons.test.ts +197 -0
- package/.turbo/turbo-test.log +0 -22
- package/dist/client/assets/index-DwTI8opO.js +0 -608
- package/dist/client/assets/index-DwTI8opO.js.map +0 -1
- package/dist/client/assets/index-RoEdL6gO.css +0 -1
- package/dist/server/index.d.ts +0 -3
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -56
- package/dist/server/index.js.map +0 -1
- package/dist/server/routes/ai.js +0 -50
- package/dist/server/routes/ai.js.map +0 -1
- package/dist/server/routes/execute.js +0 -62
- package/dist/server/routes/execute.js.map +0 -1
- package/dist/server/routes/workflows.js +0 -99
- package/dist/server/routes/workflows.js.map +0 -1
- package/dist/server/services/AIService.d.ts +0 -30
- package/dist/server/services/AIService.d.ts.map +0 -1
- package/dist/server/services/AIService.js +0 -216
- package/dist/server/services/AIService.js.map +0 -1
- package/dist/server/services/FileWatcher.d.ts +0 -10
- package/dist/server/services/FileWatcher.d.ts.map +0 -1
- package/dist/server/services/FileWatcher.js +0 -62
- package/dist/server/services/FileWatcher.js.map +0 -1
- package/dist/server/services/WorkflowService.d.ts +0 -54
- package/dist/server/services/WorkflowService.d.ts.map +0 -1
- package/dist/server/services/WorkflowService.js +0 -323
- package/dist/server/services/WorkflowService.js.map +0 -1
- package/dist/server/websocket/index.d.ts +0 -10
- package/dist/server/websocket/index.d.ts.map +0 -1
- package/dist/server/websocket/index.js +0 -85
- package/dist/server/websocket/index.js.map +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { getServiceIcon, getServiceColor } from '../../src/client/utils/serviceIcons.js';
|
|
3
|
+
import { HelpCircle } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
describe('Service Icons', () => {
|
|
6
|
+
describe('getServiceIcon', () => {
|
|
7
|
+
it('should return icons for all standard services', () => {
|
|
8
|
+
const services = [
|
|
9
|
+
'slack',
|
|
10
|
+
'github',
|
|
11
|
+
'jira',
|
|
12
|
+
'gmail',
|
|
13
|
+
'outlook',
|
|
14
|
+
'linear',
|
|
15
|
+
'notion',
|
|
16
|
+
'discord',
|
|
17
|
+
'airtable',
|
|
18
|
+
'confluence',
|
|
19
|
+
'http',
|
|
20
|
+
'claude',
|
|
21
|
+
'opencode',
|
|
22
|
+
'ollama',
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
services.forEach((service) => {
|
|
26
|
+
const icon = getServiceIcon(service);
|
|
27
|
+
expect(icon).toBeDefined();
|
|
28
|
+
expect(icon).not.toBe(HelpCircle);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should return icons for new integrations', () => {
|
|
33
|
+
const newServices = [
|
|
34
|
+
'stripe',
|
|
35
|
+
'teams',
|
|
36
|
+
'twilio',
|
|
37
|
+
'sendgrid',
|
|
38
|
+
'shopify',
|
|
39
|
+
'zendesk',
|
|
40
|
+
'mailchimp',
|
|
41
|
+
'asana',
|
|
42
|
+
'trello',
|
|
43
|
+
'dropbox',
|
|
44
|
+
's3',
|
|
45
|
+
'aws-s3',
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
newServices.forEach((service) => {
|
|
49
|
+
const icon = getServiceIcon(service);
|
|
50
|
+
expect(icon).toBeDefined();
|
|
51
|
+
expect(icon).not.toBe(HelpCircle);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should return HelpCircle for unknown services', () => {
|
|
56
|
+
const icon = getServiceIcon('unknown-service');
|
|
57
|
+
expect(icon).toBe(HelpCircle);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should handle service names with dots (action paths)', () => {
|
|
61
|
+
const icon = getServiceIcon('slack.chat.postMessage');
|
|
62
|
+
expect(icon).toBeDefined();
|
|
63
|
+
expect(icon).not.toBe(HelpCircle);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should handle case insensitive service names', () => {
|
|
67
|
+
const lowerIcon = getServiceIcon('slack');
|
|
68
|
+
const upperIcon = getServiceIcon('SLACK');
|
|
69
|
+
expect(lowerIcon).toBe(upperIcon);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('getServiceColor', () => {
|
|
74
|
+
it('should return brand colors for standard services', () => {
|
|
75
|
+
const serviceColors = {
|
|
76
|
+
slack: '#4A154B',
|
|
77
|
+
github: '#24292e',
|
|
78
|
+
jira: '#0052CC',
|
|
79
|
+
gmail: '#EA4335',
|
|
80
|
+
outlook: '#0078D4',
|
|
81
|
+
discord: '#5865F2',
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
Object.entries(serviceColors).forEach(([service, expectedColor]) => {
|
|
85
|
+
const color = getServiceColor(service);
|
|
86
|
+
expect(color).toBe(expectedColor);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should return brand colors for new integrations', () => {
|
|
91
|
+
const newServiceColors = {
|
|
92
|
+
stripe: '#635BFF',
|
|
93
|
+
teams: '#6264A7',
|
|
94
|
+
twilio: '#F22F46',
|
|
95
|
+
sendgrid: '#1A82E2',
|
|
96
|
+
shopify: '#96BF48',
|
|
97
|
+
zendesk: '#03363D',
|
|
98
|
+
mailchimp: '#FFE01B',
|
|
99
|
+
asana: '#F06A6A',
|
|
100
|
+
trello: '#0079BF',
|
|
101
|
+
dropbox: '#0061FF',
|
|
102
|
+
's3': '#FF9900',
|
|
103
|
+
'aws-s3': '#FF9900',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
Object.entries(newServiceColors).forEach(([service, expectedColor]) => {
|
|
107
|
+
const color = getServiceColor(service);
|
|
108
|
+
expect(color).toBe(expectedColor);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('should return default gray color for unknown services', () => {
|
|
113
|
+
const color = getServiceColor('unknown-service');
|
|
114
|
+
expect(color).toBe('#6B7280');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should handle service names with dots', () => {
|
|
118
|
+
const color = getServiceColor('github.pulls.create');
|
|
119
|
+
expect(color).toBe('#24292e');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should handle case insensitive service names', () => {
|
|
123
|
+
const lowerColor = getServiceColor('stripe');
|
|
124
|
+
const upperColor = getServiceColor('STRIPE');
|
|
125
|
+
expect(lowerColor).toBe(upperColor);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return valid hex colors', () => {
|
|
129
|
+
const services = [
|
|
130
|
+
'slack',
|
|
131
|
+
'stripe',
|
|
132
|
+
'teams',
|
|
133
|
+
'twilio',
|
|
134
|
+
'shopify',
|
|
135
|
+
'zendesk',
|
|
136
|
+
'unknown',
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
services.forEach((service) => {
|
|
140
|
+
const color = getServiceColor(service);
|
|
141
|
+
expect(color).toMatch(/^#[0-9A-F]{6}$/i);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
describe('Integration Coverage', () => {
|
|
147
|
+
it('should have icons for all 30 service integrations', () => {
|
|
148
|
+
const allServices = [
|
|
149
|
+
// Standard services
|
|
150
|
+
'slack',
|
|
151
|
+
'github',
|
|
152
|
+
'jira',
|
|
153
|
+
'gmail',
|
|
154
|
+
'outlook',
|
|
155
|
+
'linear',
|
|
156
|
+
'notion',
|
|
157
|
+
'discord',
|
|
158
|
+
'airtable',
|
|
159
|
+
'confluence',
|
|
160
|
+
'http',
|
|
161
|
+
'ollama',
|
|
162
|
+
'claude',
|
|
163
|
+
'opencode',
|
|
164
|
+
// New integrations
|
|
165
|
+
'stripe',
|
|
166
|
+
'teams',
|
|
167
|
+
'twilio',
|
|
168
|
+
'sendgrid',
|
|
169
|
+
'shopify',
|
|
170
|
+
'zendesk',
|
|
171
|
+
'mailchimp',
|
|
172
|
+
'asana',
|
|
173
|
+
'trello',
|
|
174
|
+
'dropbox',
|
|
175
|
+
'aws-s3',
|
|
176
|
+
// Database services
|
|
177
|
+
'postgres',
|
|
178
|
+
'mysql',
|
|
179
|
+
'supabase',
|
|
180
|
+
// Google services
|
|
181
|
+
'google-sheets',
|
|
182
|
+
'google-calendar',
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
allServices.forEach((service) => {
|
|
186
|
+
const icon = getServiceIcon(service);
|
|
187
|
+
const color = getServiceColor(service);
|
|
188
|
+
|
|
189
|
+
// Icon should not be the fallback HelpCircle
|
|
190
|
+
expect(icon).toBeDefined();
|
|
191
|
+
|
|
192
|
+
// Color should be a valid hex color
|
|
193
|
+
expect(color).toMatch(/^#[0-9A-F]{6}$/i);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @marktoflow/gui@2.0.0-alpha.1 test /Volumes/USBEXT/sandbox/personal/marktoflow/packages/gui
|
|
3
|
-
> vitest run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v2.1.9 /Volumes/USBEXT/sandbox/personal/marktoflow/packages/gui
|
|
7
|
-
|
|
8
|
-
✓ tests/unit/workflowToGraph.test.ts (15 tests) 3ms
|
|
9
|
-
✓ tests/unit/navigationStore.test.ts (10 tests) 6ms
|
|
10
|
-
✓ tests/unit/stepValidation.test.ts (17 tests) 7ms
|
|
11
|
-
✓ tests/unit/themeStore.test.ts (9 tests) 4ms
|
|
12
|
-
✓ tests/unit/layoutStore.test.ts (18 tests) 7ms
|
|
13
|
-
✓ tests/unit/executionStore.test.ts (43 tests) 24ms
|
|
14
|
-
✓ tests/unit/canvasStore.test.ts (24 tests) 5ms
|
|
15
|
-
✓ tests/unit/components.test.tsx (14 tests) 32ms
|
|
16
|
-
✓ tests/integration/api.test.ts (23 tests) 47ms
|
|
17
|
-
|
|
18
|
-
Test Files 9 passed (9)
|
|
19
|
-
Tests 173 passed (173)
|
|
20
|
-
Start at 17:09:24
|
|
21
|
-
Duration 1.39s (transform 485ms, setup 761ms, collect 1.30s, tests 135ms, environment 4.27s, prepare 499ms)
|
|
22
|
-
|