@friggframework/devtools 2.0.0-next.3 → 2.0.0-next.30

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 (199) hide show
  1. package/frigg-cli/.eslintrc.js +141 -0
  2. package/frigg-cli/__tests__/jest.config.js +102 -0
  3. package/frigg-cli/__tests__/unit/commands/build.test.js +483 -0
  4. package/frigg-cli/__tests__/unit/commands/install.test.js +418 -0
  5. package/frigg-cli/__tests__/unit/commands/ui.test.js +592 -0
  6. package/frigg-cli/__tests__/utils/command-tester.js +170 -0
  7. package/frigg-cli/__tests__/utils/mock-factory.js +270 -0
  8. package/frigg-cli/__tests__/utils/test-fixtures.js +463 -0
  9. package/frigg-cli/__tests__/utils/test-setup.js +286 -0
  10. package/frigg-cli/build-command/index.js +54 -0
  11. package/frigg-cli/deploy-command/index.js +36 -0
  12. package/frigg-cli/generate-command/__tests__/generate-command.test.js +312 -0
  13. package/frigg-cli/generate-command/azure-generator.js +43 -0
  14. package/frigg-cli/generate-command/gcp-generator.js +47 -0
  15. package/frigg-cli/generate-command/index.js +332 -0
  16. package/frigg-cli/generate-command/terraform-generator.js +555 -0
  17. package/frigg-cli/generate-iam-command.js +115 -0
  18. package/frigg-cli/index.js +47 -1
  19. package/frigg-cli/index.test.js +1 -4
  20. package/frigg-cli/init-command/backend-first-handler.js +756 -0
  21. package/frigg-cli/init-command/index.js +93 -0
  22. package/frigg-cli/init-command/template-handler.js +143 -0
  23. package/frigg-cli/install-command/index.js +1 -4
  24. package/frigg-cli/package.json +51 -0
  25. package/frigg-cli/start-command/index.js +24 -4
  26. package/frigg-cli/test/init-command.test.js +180 -0
  27. package/frigg-cli/test/npm-registry.test.js +319 -0
  28. package/frigg-cli/ui-command/index.js +154 -0
  29. package/frigg-cli/utils/app-resolver.js +319 -0
  30. package/frigg-cli/utils/backend-path.js +16 -17
  31. package/frigg-cli/utils/npm-registry.js +167 -0
  32. package/frigg-cli/utils/process-manager.js +199 -0
  33. package/frigg-cli/utils/repo-detection.js +405 -0
  34. package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
  35. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +596 -0
  36. package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
  37. package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
  38. package/infrastructure/IAM-POLICY-TEMPLATES.md +176 -0
  39. package/infrastructure/README-TESTING.md +332 -0
  40. package/infrastructure/README.md +421 -0
  41. package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
  42. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
  43. package/infrastructure/__tests__/helpers/test-utils.js +277 -0
  44. package/infrastructure/aws-discovery.js +568 -0
  45. package/infrastructure/aws-discovery.test.js +373 -0
  46. package/infrastructure/build-time-discovery.js +206 -0
  47. package/infrastructure/build-time-discovery.test.js +375 -0
  48. package/infrastructure/create-frigg-infrastructure.js +3 -5
  49. package/infrastructure/frigg-deployment-iam-stack.yaml +379 -0
  50. package/infrastructure/iam-generator.js +687 -0
  51. package/infrastructure/iam-generator.test.js +169 -0
  52. package/infrastructure/iam-policy-basic.json +212 -0
  53. package/infrastructure/iam-policy-full.json +282 -0
  54. package/infrastructure/integration.test.js +383 -0
  55. package/infrastructure/run-discovery.js +110 -0
  56. package/infrastructure/serverless-template.js +923 -113
  57. package/infrastructure/serverless-template.test.js +541 -0
  58. package/management-ui/.eslintrc.js +22 -0
  59. package/management-ui/README.md +203 -0
  60. package/management-ui/components.json +21 -0
  61. package/management-ui/docs/phase2-integration-guide.md +320 -0
  62. package/management-ui/index.html +13 -0
  63. package/management-ui/package-lock.json +16517 -0
  64. package/management-ui/package.json +76 -0
  65. package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +302 -0
  66. package/management-ui/postcss.config.js +6 -0
  67. package/management-ui/server/api/backend.js +256 -0
  68. package/management-ui/server/api/cli.js +315 -0
  69. package/management-ui/server/api/codegen.js +663 -0
  70. package/management-ui/server/api/connections.js +857 -0
  71. package/management-ui/server/api/discovery.js +185 -0
  72. package/management-ui/server/api/environment/index.js +1 -0
  73. package/management-ui/server/api/environment/router.js +378 -0
  74. package/management-ui/server/api/environment.js +328 -0
  75. package/management-ui/server/api/integrations.js +876 -0
  76. package/management-ui/server/api/logs.js +248 -0
  77. package/management-ui/server/api/monitoring.js +282 -0
  78. package/management-ui/server/api/open-ide.js +31 -0
  79. package/management-ui/server/api/project.js +1029 -0
  80. package/management-ui/server/api/users/sessions.js +371 -0
  81. package/management-ui/server/api/users/simulation.js +254 -0
  82. package/management-ui/server/api/users.js +362 -0
  83. package/management-ui/server/api-contract.md +275 -0
  84. package/management-ui/server/index.js +873 -0
  85. package/management-ui/server/middleware/errorHandler.js +93 -0
  86. package/management-ui/server/middleware/security.js +32 -0
  87. package/management-ui/server/processManager.js +296 -0
  88. package/management-ui/server/server.js +346 -0
  89. package/management-ui/server/services/aws-monitor.js +413 -0
  90. package/management-ui/server/services/npm-registry.js +347 -0
  91. package/management-ui/server/services/template-engine.js +538 -0
  92. package/management-ui/server/utils/cliIntegration.js +220 -0
  93. package/management-ui/server/utils/environment/auditLogger.js +471 -0
  94. package/management-ui/server/utils/environment/awsParameterStore.js +264 -0
  95. package/management-ui/server/utils/environment/encryption.js +278 -0
  96. package/management-ui/server/utils/environment/envFileManager.js +286 -0
  97. package/management-ui/server/utils/import-commonjs.js +28 -0
  98. package/management-ui/server/utils/response.js +83 -0
  99. package/management-ui/server/websocket/handler.js +325 -0
  100. package/management-ui/src/App.jsx +109 -0
  101. package/management-ui/src/assets/FriggLogo.svg +1 -0
  102. package/management-ui/src/components/AppRouter.jsx +65 -0
  103. package/management-ui/src/components/Button.jsx +70 -0
  104. package/management-ui/src/components/Card.jsx +97 -0
  105. package/management-ui/src/components/EnvironmentCompare.jsx +400 -0
  106. package/management-ui/src/components/EnvironmentEditor.jsx +372 -0
  107. package/management-ui/src/components/EnvironmentImportExport.jsx +469 -0
  108. package/management-ui/src/components/EnvironmentSchema.jsx +491 -0
  109. package/management-ui/src/components/EnvironmentSecurity.jsx +463 -0
  110. package/management-ui/src/components/ErrorBoundary.jsx +73 -0
  111. package/management-ui/src/components/IntegrationCard.jsx +481 -0
  112. package/management-ui/src/components/IntegrationCardEnhanced.jsx +770 -0
  113. package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
  114. package/management-ui/src/components/IntegrationStatus.jsx +336 -0
  115. package/management-ui/src/components/Layout.jsx +716 -0
  116. package/management-ui/src/components/LoadingSpinner.jsx +113 -0
  117. package/management-ui/src/components/RepositoryPicker.jsx +248 -0
  118. package/management-ui/src/components/SessionMonitor.jsx +350 -0
  119. package/management-ui/src/components/StatusBadge.jsx +208 -0
  120. package/management-ui/src/components/UserContextSwitcher.jsx +212 -0
  121. package/management-ui/src/components/UserSimulation.jsx +327 -0
  122. package/management-ui/src/components/Welcome.jsx +434 -0
  123. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +637 -0
  124. package/management-ui/src/components/codegen/APIModuleSelector.jsx +227 -0
  125. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +247 -0
  126. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +316 -0
  127. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +271 -0
  128. package/management-ui/src/components/codegen/FormBuilder.jsx +737 -0
  129. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +855 -0
  130. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +797 -0
  131. package/management-ui/src/components/codegen/SchemaBuilder.jsx +303 -0
  132. package/management-ui/src/components/codegen/TemplateSelector.jsx +586 -0
  133. package/management-ui/src/components/codegen/index.js +10 -0
  134. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +362 -0
  135. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +182 -0
  136. package/management-ui/src/components/connections/ConnectionTester.jsx +200 -0
  137. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +292 -0
  138. package/management-ui/src/components/connections/OAuthFlow.jsx +204 -0
  139. package/management-ui/src/components/connections/index.js +5 -0
  140. package/management-ui/src/components/index.js +21 -0
  141. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +222 -0
  142. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +169 -0
  143. package/management-ui/src/components/monitoring/MetricsChart.jsx +197 -0
  144. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +393 -0
  145. package/management-ui/src/components/monitoring/SQSMetrics.jsx +246 -0
  146. package/management-ui/src/components/monitoring/index.js +6 -0
  147. package/management-ui/src/components/monitoring/monitoring.css +218 -0
  148. package/management-ui/src/components/theme-provider.jsx +52 -0
  149. package/management-ui/src/components/theme-toggle.jsx +39 -0
  150. package/management-ui/src/components/ui/badge.tsx +36 -0
  151. package/management-ui/src/components/ui/button.test.jsx +56 -0
  152. package/management-ui/src/components/ui/button.tsx +57 -0
  153. package/management-ui/src/components/ui/card.tsx +76 -0
  154. package/management-ui/src/components/ui/dropdown-menu.tsx +199 -0
  155. package/management-ui/src/components/ui/select.tsx +157 -0
  156. package/management-ui/src/components/ui/skeleton.jsx +15 -0
  157. package/management-ui/src/hooks/useFrigg.jsx +601 -0
  158. package/management-ui/src/hooks/useSocket.jsx +58 -0
  159. package/management-ui/src/index.css +193 -0
  160. package/management-ui/src/lib/utils.ts +6 -0
  161. package/management-ui/src/main.jsx +10 -0
  162. package/management-ui/src/pages/CodeGeneration.jsx +14 -0
  163. package/management-ui/src/pages/Connections.jsx +252 -0
  164. package/management-ui/src/pages/ConnectionsEnhanced.jsx +633 -0
  165. package/management-ui/src/pages/Dashboard.jsx +311 -0
  166. package/management-ui/src/pages/Environment.jsx +314 -0
  167. package/management-ui/src/pages/IntegrationConfigure.jsx +669 -0
  168. package/management-ui/src/pages/IntegrationDiscovery.jsx +567 -0
  169. package/management-ui/src/pages/IntegrationTest.jsx +742 -0
  170. package/management-ui/src/pages/Integrations.jsx +253 -0
  171. package/management-ui/src/pages/Monitoring.jsx +17 -0
  172. package/management-ui/src/pages/Simulation.jsx +155 -0
  173. package/management-ui/src/pages/Users.jsx +492 -0
  174. package/management-ui/src/services/api.js +41 -0
  175. package/management-ui/src/services/apiModuleService.js +193 -0
  176. package/management-ui/src/services/websocket-handlers.js +120 -0
  177. package/management-ui/src/test/api/project.test.js +273 -0
  178. package/management-ui/src/test/components/Welcome.test.jsx +378 -0
  179. package/management-ui/src/test/mocks/server.js +178 -0
  180. package/management-ui/src/test/setup.js +61 -0
  181. package/management-ui/src/test/utils/test-utils.jsx +134 -0
  182. package/management-ui/src/utils/repository.js +98 -0
  183. package/management-ui/src/utils/repository.test.js +118 -0
  184. package/management-ui/src/workflows/phase2-integration-workflows.js +884 -0
  185. package/management-ui/tailwind.config.js +63 -0
  186. package/management-ui/tsconfig.json +37 -0
  187. package/management-ui/tsconfig.node.json +10 -0
  188. package/management-ui/vite.config.js +26 -0
  189. package/management-ui/vitest.config.js +38 -0
  190. package/package.json +16 -9
  191. package/infrastructure/app-handler-helpers.js +0 -57
  192. package/infrastructure/backend-utils.js +0 -90
  193. package/infrastructure/routers/auth.js +0 -26
  194. package/infrastructure/routers/integration-defined-routers.js +0 -37
  195. package/infrastructure/routers/middleware/loadUser.js +0 -15
  196. package/infrastructure/routers/middleware/requireLoggedInUser.js +0 -12
  197. package/infrastructure/routers/user.js +0 -41
  198. package/infrastructure/routers/websocket.js +0 -55
  199. package/infrastructure/workers/integration-defined-workers.js +0 -24
@@ -0,0 +1,379 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import { motion, AnimatePresence } from 'framer-motion'
3
+ import { Search, Filter, Package, Code, GitBranch, ExternalLink, Download, Eye } from 'lucide-react'
4
+ import { RefreshCw } from 'lucide-react'
5
+ import { Card } from './ui/card'
6
+ import { Button } from './ui/button'
7
+
8
+ /**
9
+ * Visual Integration Explorer using @friggframework/ui-react components
10
+ * Shows available integrations, installed integrations, and code analysis
11
+ */
12
+ export default function IntegrationExplorer({ mode = 'browse' }) {
13
+ const [integrations, setIntegrations] = useState([])
14
+ const [loading, setLoading] = useState(true)
15
+ const [searchTerm, setSearchTerm] = useState('')
16
+ const [selectedCategory, setSelectedCategory] = useState('all')
17
+ const [viewMode, setViewMode] = useState('grid') // 'grid', 'list', 'code'
18
+
19
+ useEffect(() => {
20
+ fetchIntegrations()
21
+ }, [])
22
+
23
+ const fetchIntegrations = async () => {
24
+ try {
25
+ setLoading(true)
26
+ const response = await fetch('/api/integrations')
27
+ const data = await response.json()
28
+
29
+ // Combine installed integrations and available API modules
30
+ const allIntegrations = [
31
+ ...data.integrations.map(int => ({ ...int, source: 'installed' })),
32
+ ...data.availableApiModules.map(mod => ({ ...mod, source: 'available' }))
33
+ ]
34
+
35
+ setIntegrations(allIntegrations)
36
+ } catch (error) {
37
+ console.error('Failed to fetch integrations:', error)
38
+ } finally {
39
+ setLoading(false)
40
+ }
41
+ }
42
+
43
+ const filteredIntegrations = integrations.filter(integration => {
44
+ const matchesSearch = integration.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
45
+ integration.displayName?.toLowerCase().includes(searchTerm.toLowerCase()) ||
46
+ integration.description?.toLowerCase().includes(searchTerm.toLowerCase())
47
+
48
+ const matchesCategory = selectedCategory === 'all' ||
49
+ integration.category?.toLowerCase() === selectedCategory.toLowerCase()
50
+
51
+ return matchesSearch && matchesCategory
52
+ })
53
+
54
+ const categories = ['all', ...new Set(integrations.map(i => i.category).filter(Boolean))]
55
+
56
+ const handleInstall = async (integration) => {
57
+ try {
58
+ const response = await fetch('/api/integrations/install', {
59
+ method: 'POST',
60
+ headers: { 'Content-Type': 'application/json' },
61
+ body: JSON.stringify({ packageName: integration.name })
62
+ })
63
+
64
+ if (response.ok) {
65
+ await fetchIntegrations() // Refresh the list
66
+ }
67
+ } catch (error) {
68
+ console.error('Failed to install integration:', error)
69
+ }
70
+ }
71
+
72
+ const handleViewCode = (integration) => {
73
+ // Open code view for this integration
74
+ setViewMode('code')
75
+ // In a real implementation, you'd fetch and display the integration's source code
76
+ }
77
+
78
+ if (loading) {
79
+ return (
80
+ <div className="flex items-center justify-center py-12">
81
+ <RefreshCw className="w-8 h-8 animate-spin text-primary" />
82
+ <span className="ml-3">Loading integrations...</span>
83
+ </div>
84
+ )
85
+ }
86
+
87
+ return (
88
+ <div className="space-y-6">
89
+ {/* Header with Search and Filters */}
90
+ <div className="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between">
91
+ <div className="flex items-center gap-4">
92
+ <h3 className="text-xl font-semibold">Integration Explorer</h3>
93
+ <div className="flex gap-2">
94
+ <Button
95
+ variant={viewMode === 'grid' ? 'default' : 'outline'}
96
+ size="sm"
97
+ onClick={() => setViewMode('grid')}
98
+ >
99
+ Grid
100
+ </Button>
101
+ <Button
102
+ variant={viewMode === 'list' ? 'default' : 'outline'}
103
+ size="sm"
104
+ onClick={() => setViewMode('list')}
105
+ >
106
+ List
107
+ </Button>
108
+ <Button
109
+ variant={viewMode === 'code' ? 'default' : 'outline'}
110
+ size="sm"
111
+ onClick={() => setViewMode('code')}
112
+ >
113
+ Code
114
+ </Button>
115
+ </div>
116
+ </div>
117
+
118
+ <div className="flex gap-3">
119
+ {/* Search */}
120
+ <div className="relative">
121
+ <Search className="w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground" />
122
+ <input
123
+ type="text"
124
+ placeholder="Search integrations..."
125
+ value={searchTerm}
126
+ onChange={(e) => setSearchTerm(e.target.value)}
127
+ className="pl-10 pr-4 py-2 border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary/50"
128
+ />
129
+ </div>
130
+
131
+ {/* Category Filter */}
132
+ <select
133
+ value={selectedCategory}
134
+ onChange={(e) => setSelectedCategory(e.target.value)}
135
+ className="px-3 py-2 border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary/50"
136
+ >
137
+ {categories.map(category => (
138
+ <option key={category} value={category}>
139
+ {category === 'all' ? 'All Categories' : category}
140
+ </option>
141
+ ))}
142
+ </select>
143
+ </div>
144
+ </div>
145
+
146
+ {/* Results Summary */}
147
+ <div className="text-sm text-muted-foreground">
148
+ Found {filteredIntegrations.length} integrations
149
+ {searchTerm && ` matching "${searchTerm}"`}
150
+ {selectedCategory !== 'all' && ` in ${selectedCategory}`}
151
+ </div>
152
+
153
+ {/* Integration Views */}
154
+ <AnimatePresence mode="wait">
155
+ {viewMode === 'grid' && (
156
+ <motion.div
157
+ key="grid"
158
+ initial={{ opacity: 0, y: 20 }}
159
+ animate={{ opacity: 1, y: 0 }}
160
+ exit={{ opacity: 0, y: -20 }}
161
+ className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
162
+ >
163
+ {filteredIntegrations.map((integration, index) => (
164
+ <motion.div
165
+ key={integration.name}
166
+ initial={{ opacity: 0, y: 20 }}
167
+ animate={{ opacity: 1, y: 0 }}
168
+ transition={{ delay: index * 0.05 }}
169
+ >
170
+ <Card className="p-4 hover:shadow-lg transition-all">
171
+ <div className="flex items-center justify-between">
172
+ <div className="flex items-center gap-3">
173
+ <div className={`w-3 h-3 rounded-full ${
174
+ integration.source === 'installed' ? 'bg-green-500' : 'bg-gray-400'
175
+ }`} />
176
+ <div>
177
+ <h4 className="font-semibold">{integration.displayName || integration.name}</h4>
178
+ <p className="text-sm text-muted-foreground">{integration.description}</p>
179
+ <div className="flex items-center gap-2 mt-1">
180
+ <span className="text-xs bg-primary/10 text-primary px-2 py-1 rounded">
181
+ {integration.category}
182
+ </span>
183
+ <span className="text-xs text-muted-foreground">
184
+ {integration.source === 'installed' ? 'Installed' : 'Available'}
185
+ </span>
186
+ </div>
187
+ </div>
188
+ </div>
189
+
190
+ <div className="flex gap-2">
191
+ <Button size="sm" variant="outline" onClick={() => handleViewCode(integration)}>
192
+ <Code className="w-4 h-4" />
193
+ </Button>
194
+ {integration.source === 'available' && (
195
+ <Button size="sm" onClick={() => handleInstall(integration)}>
196
+ <Download className="w-4 h-4" />
197
+ </Button>
198
+ )}
199
+ </div>
200
+ </div>
201
+ </Card>
202
+ </motion.div>
203
+ ))}
204
+ </motion.div>
205
+ )}
206
+
207
+ {viewMode === 'list' && (
208
+ <motion.div
209
+ key="list"
210
+ initial={{ opacity: 0, y: 20 }}
211
+ animate={{ opacity: 1, y: 0 }}
212
+ exit={{ opacity: 0, y: -20 }}
213
+ className="space-y-3"
214
+ >
215
+ {filteredIntegrations.map((integration, index) => (
216
+ <motion.div
217
+ key={integration.name}
218
+ initial={{ opacity: 0, x: -20 }}
219
+ animate={{ opacity: 1, x: 0 }}
220
+ transition={{ delay: index * 0.03 }}
221
+ >
222
+ <Card className="p-4 hover:shadow-md transition-all">
223
+ <div className="flex items-center justify-between">
224
+ <div className="flex items-center gap-4">
225
+ <div className={`w-3 h-3 rounded-full ${
226
+ integration.source === 'installed' ? 'bg-green-500' : 'bg-gray-400'
227
+ }`} />
228
+ <div>
229
+ <h4 className="font-semibold">{integration.displayName || integration.name}</h4>
230
+ <p className="text-sm text-muted-foreground">{integration.description}</p>
231
+ <div className="flex items-center gap-2 mt-1">
232
+ <span className="text-xs bg-primary/10 text-primary px-2 py-1 rounded">
233
+ {integration.category}
234
+ </span>
235
+ <span className="text-xs text-muted-foreground">
236
+ {integration.source === 'installed' ? 'Installed' : 'Available'}
237
+ </span>
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+ <div className="flex gap-2">
243
+ <Button size="sm" variant="outline" onClick={() => handleViewCode(integration)}>
244
+ <Eye className="w-4 h-4" />
245
+ View
246
+ </Button>
247
+ {integration.source === 'available' && (
248
+ <Button size="sm" onClick={() => handleInstall(integration)}>
249
+ <Download className="w-4 h-4" />
250
+ Install
251
+ </Button>
252
+ )}
253
+ </div>
254
+ </div>
255
+ </Card>
256
+ </motion.div>
257
+ ))}
258
+ </motion.div>
259
+ )}
260
+
261
+ {viewMode === 'code' && (
262
+ <motion.div
263
+ key="code"
264
+ initial={{ opacity: 0, y: 20 }}
265
+ animate={{ opacity: 1, y: 0 }}
266
+ exit={{ opacity: 0, y: -20 }}
267
+ >
268
+ <CodeAnalysisView integrations={filteredIntegrations} />
269
+ </motion.div>
270
+ )}
271
+ </AnimatePresence>
272
+
273
+ {filteredIntegrations.length === 0 && (
274
+ <div className="text-center py-12">
275
+ <Package className="w-16 h-16 mx-auto text-muted-foreground mb-4" />
276
+ <h3 className="text-lg font-semibold mb-2">No integrations found</h3>
277
+ <p className="text-muted-foreground">
278
+ Try adjusting your search terms or category filter
279
+ </p>
280
+ </div>
281
+ )}
282
+ </div>
283
+ )
284
+ }
285
+
286
+ /**
287
+ * Code Analysis View showing integration structure and relationships
288
+ */
289
+ function CodeAnalysisView({ integrations }) {
290
+ const installedIntegrations = integrations.filter(i => i.source === 'installed')
291
+
292
+ return (
293
+ <div className="space-y-6">
294
+ <div className="flex items-center gap-2">
295
+ <GitBranch className="w-5 h-5" />
296
+ <h4 className="text-lg font-semibold">Integration Code Structure</h4>
297
+ </div>
298
+
299
+ {installedIntegrations.length === 0 ? (
300
+ <Card className="p-8 text-center">
301
+ <Code className="w-12 h-12 mx-auto text-muted-foreground mb-4" />
302
+ <h3 className="font-semibold mb-2">No Installed Integrations</h3>
303
+ <p className="text-muted-foreground">Install some integrations to analyze their code structure</p>
304
+ </Card>
305
+ ) : (
306
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
307
+ {installedIntegrations.map(integration => (
308
+ <Card key={integration.name} className="p-6">
309
+ <div className="flex items-center gap-3 mb-4">
310
+ <div className="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
311
+ <Code className="w-4 h-4 text-primary" />
312
+ </div>
313
+ <div>
314
+ <h4 className="font-semibold">{integration.displayName}</h4>
315
+ <p className="text-sm text-muted-foreground">{integration.className}</p>
316
+ </div>
317
+ </div>
318
+
319
+ <div className="space-y-3">
320
+ {integration.constructor && (
321
+ <div>
322
+ <h5 className="font-medium text-sm mb-2">Constructor Properties</h5>
323
+ <div className="space-y-1 text-sm">
324
+ <div className="flex justify-between">
325
+ <span>Has Config:</span>
326
+ <span className={integration.constructor.hasConfig ? 'text-green-600' : 'text-gray-500'}>
327
+ {integration.constructor.hasConfig ? 'Yes' : 'No'}
328
+ </span>
329
+ </div>
330
+ <div className="flex justify-between">
331
+ <span>Has Options:</span>
332
+ <span className={integration.constructor.hasOptions ? 'text-green-600' : 'text-gray-500'}>
333
+ {integration.constructor.hasOptions ? 'Yes' : 'No'}
334
+ </span>
335
+ </div>
336
+ <div className="flex justify-between">
337
+ <span>Has Modules:</span>
338
+ <span className={integration.constructor.hasModules ? 'text-green-600' : 'text-gray-500'}>
339
+ {integration.constructor.hasModules ? 'Yes' : 'No'}
340
+ </span>
341
+ </div>
342
+ </div>
343
+ </div>
344
+ )}
345
+
346
+ {integration.apiModules && integration.apiModules.length > 0 && (
347
+ <div>
348
+ <h5 className="font-medium text-sm mb-2">API Modules</h5>
349
+ <div className="space-y-1">
350
+ {integration.apiModules.map(module => (
351
+ <div key={module.name} className="text-xs bg-gray-50 p-2 rounded">
352
+ <div className="font-medium">{module.name}</div>
353
+ <div className="text-muted-foreground">{module.description}</div>
354
+ </div>
355
+ ))}
356
+ </div>
357
+ </div>
358
+ )}
359
+
360
+ {integration.events && integration.events.length > 0 && (
361
+ <div>
362
+ <h5 className="font-medium text-sm mb-2">Events</h5>
363
+ <div className="flex flex-wrap gap-1">
364
+ {integration.events.map(event => (
365
+ <span key={event} className="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">
366
+ {event}
367
+ </span>
368
+ ))}
369
+ </div>
370
+ </div>
371
+ )}
372
+ </div>
373
+ </Card>
374
+ ))}
375
+ </div>
376
+ )}
377
+ </div>
378
+ )
379
+ }