devintelligence 1.0.0 → 1.0.1

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 (75) hide show
  1. package/.env.example +14 -14
  2. package/LICENSE +22 -22
  3. package/README.md +146 -146
  4. package/bin/devintelligence.js +2481 -12
  5. package/bin/devintelligence.ts +244 -103
  6. package/dist/App.d.ts +3 -0
  7. package/dist/ai.js +366 -0
  8. package/dist/ai.js.map +7 -0
  9. package/dist/components/DeepAnalysisViews.d.ts +13 -0
  10. package/dist/components/MobileAndPlatformViews.d.ts +22 -0
  11. package/dist/components/OverviewAndExplorerViews.d.ts +20 -0
  12. package/dist/components/RepairAndGateViews.d.ts +25 -0
  13. package/dist/engine/aiEngine.d.ts +62 -0
  14. package/dist/engine/analyzerEngine.d.ts +19 -0
  15. package/dist/engine/repairEngine.d.ts +42 -0
  16. package/dist/engine.js +1541 -0
  17. package/dist/engine.js.map +7 -0
  18. package/dist/index.d.ts +10 -0
  19. package/dist/index.js +2344 -0
  20. package/dist/index.js.map +7 -0
  21. package/dist/main.d.ts +1 -0
  22. package/dist/repair.js +2052 -0
  23. package/dist/repair.js.map +7 -0
  24. package/dist/src/App.d.ts +3 -0
  25. package/dist/src/components/DeepAnalysisViews.d.ts +13 -0
  26. package/dist/src/components/MobileAndPlatformViews.d.ts +22 -0
  27. package/dist/src/components/OverviewAndExplorerViews.d.ts +20 -0
  28. package/dist/src/components/RepairAndGateViews.d.ts +25 -0
  29. package/dist/src/engine/aiEngine.d.ts +62 -0
  30. package/dist/src/engine/analyzerEngine.d.ts +19 -0
  31. package/dist/src/engine/repairEngine.d.ts +42 -0
  32. package/dist/src/index.d.ts +10 -0
  33. package/dist/src/main.d.ts +1 -0
  34. package/dist/src/types/devintelligence.d.ts +250 -0
  35. package/dist/types/devintelligence.d.ts +250 -0
  36. package/fixtures/django-analytics-service/requirements.txt +4 -4
  37. package/fixtures/django-analytics-service/settings.py +16 -16
  38. package/fixtures/express-api-gateway/package.json +14 -14
  39. package/fixtures/express-api-gateway/src/server.ts +16 -16
  40. package/fixtures/nextjs-saas-portal/package.json +21 -21
  41. package/fixtures/nextjs-saas-portal/src/app/dashboard/page.tsx +26 -26
  42. package/fixtures/rn-bare-fitness/android/build.gradle +19 -19
  43. package/fixtures/rn-bare-fitness/ios/Info.plist +14 -14
  44. package/fixtures/rn-bare-fitness/package.json +23 -23
  45. package/fixtures/rn-bare-fitness/src/WorkoutTracker.tsx +31 -31
  46. package/fixtures/rn-expo-commerce/android/app/build.gradle +20 -20
  47. package/fixtures/rn-expo-commerce/android/app/src/main/AndroidManifest.xml +21 -21
  48. package/fixtures/rn-expo-commerce/android/gradle.properties +6 -6
  49. package/fixtures/rn-expo-commerce/app.json +17 -17
  50. package/fixtures/rn-expo-commerce/babel.config.js +10 -10
  51. package/fixtures/rn-expo-commerce/ios/Podfile +13 -13
  52. package/fixtures/rn-expo-commerce/metro.config.js +7 -7
  53. package/fixtures/rn-expo-commerce/package.json +31 -31
  54. package/fixtures/rn-expo-commerce/src/components/LegacyPromoBanner.tsx +11 -11
  55. package/fixtures/rn-expo-commerce/src/screens/ProductFeedScreen.tsx +48 -48
  56. package/fixtures/rn-expo-commerce/src/services/api.ts +15 -15
  57. package/package.json +89 -77
  58. package/index.html +0 -21
  59. package/server.ts +0 -275
  60. package/src/App.tsx +0 -783
  61. package/src/components/DeepAnalysisViews.tsx +0 -526
  62. package/src/components/MobileAndPlatformViews.tsx +0 -625
  63. package/src/components/OverviewAndExplorerViews.tsx +0 -753
  64. package/src/components/RepairAndGateViews.tsx +0 -814
  65. package/src/engine/aiEngine.test.ts +0 -86
  66. package/src/engine/aiEngine.ts +0 -346
  67. package/src/engine/analyzerEngine.test.ts +0 -110
  68. package/src/engine/analyzerEngine.ts +0 -1579
  69. package/src/engine/repairEngine.ts +0 -545
  70. package/src/index.css +0 -44
  71. package/src/index.ts +0 -59
  72. package/src/main.tsx +0 -5
  73. package/src/types/devintelligence.ts +0 -310
  74. package/tsconfig.json +0 -28
  75. package/vite.config.ts +0 -22
package/package.json CHANGED
@@ -1,77 +1,89 @@
1
- {
2
- "name": "devintelligence",
3
- "version": "1.0.0",
4
- "description": "DEVINTELLIGENCE — Personal Software Engineering Intelligence System. Understand. Diagnose. Repair. Optimize.",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "exports": {
9
- ".": "./src/index.ts",
10
- "./engine": "./src/engine/analyzerEngine.ts",
11
- "./repair": "./src/engine/repairEngine.ts",
12
- "./ai": "./src/engine/aiEngine.ts"
13
- },
14
- "bin": {
15
- "devintelligence": "bin/devintelligence.js",
16
- "devintel": "bin/devintelligence.js"
17
- },
18
- "files": [
19
- "bin",
20
- "src",
21
- "fixtures",
22
- "server.ts",
23
- "index.html",
24
- "vite.config.ts",
25
- "tsconfig.json",
26
- "README.md",
27
- "LICENSE",
28
- ".env.example"
29
- ],
30
- "keywords": [
31
- "devintelligence",
32
- "react-native",
33
- "expo",
34
- "android",
35
- "ios",
36
- "code-audit",
37
- "auto-repair",
38
- "groq-ai",
39
- "diagnostics",
40
- "engineering-intelligence",
41
- "static-analysis",
42
- "quality-gate"
43
- ],
44
- "author": "DevIntelligence Engineering Team",
45
- "license": "MIT",
46
- "scripts": {
47
- "dev": "tsx server.ts",
48
- "build": "vite build",
49
- "start": "node server.ts",
50
- "preview": "vite preview",
51
- "lint": "tsc --noEmit",
52
- "test": "tsc --noEmit && node --test src/engine/analyzerEngine.test.ts src/engine/aiEngine.test.ts"
53
- },
54
- "dependencies": {
55
- "@google/genai": "^2.4.0",
56
- "@tailwindcss/vite": "^4.3.3",
57
- "@vitejs/plugin-react": "^6.1.1",
58
- "dotenv": "^17.2.3",
59
- "express": "^4.21.2",
60
- "lucide-react": "^0.546.0",
61
- "motion": "^12.23.24",
62
- "react": "^19.0.1",
63
- "react-dom": "^19.0.1",
64
- "vite": "^8.3.0"
65
- },
66
- "devDependencies": {
67
- "@types/express": "^4.17.21",
68
- "@types/node": "^22.14.0",
69
- "@types/react": "^19.3.0",
70
- "@types/react-dom": "^19.3.0",
71
- "autoprefixer": "^10.4.21",
72
- "esbuild": "^0.28.0",
73
- "tailwindcss": "^4.3.3",
74
- "tsx": "^4.21.0",
75
- "typescript": "^7.0.2"
76
- }
77
- }
1
+ {
2
+ "name": "devintelligence",
3
+ "version": "1.0.1",
4
+ "description": "DEVINTELLIGENCE — Personal Software Engineering Intelligence System. Understand. Diagnose. Repair. Optimize.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./engine": {
14
+ "types": "./dist/engine/analyzerEngine.d.ts",
15
+ "default": "./dist/engine.js"
16
+ },
17
+ "./repair": {
18
+ "types": "./dist/engine/repairEngine.d.ts",
19
+ "default": "./dist/repair.js"
20
+ },
21
+ "./ai": {
22
+ "types": "./dist/engine/aiEngine.d.ts",
23
+ "default": "./dist/ai.js"
24
+ }
25
+ },
26
+ "bin": {
27
+ "devintelligence": "bin/devintelligence.js",
28
+ "devintel": "bin/devintelligence.js"
29
+ },
30
+ "files": [
31
+ "bin",
32
+ "dist",
33
+ "fixtures",
34
+ "README.md",
35
+ "LICENSE",
36
+ ".env.example"
37
+ ],
38
+ "keywords": [
39
+ "devintelligence",
40
+ "react-native",
41
+ "expo",
42
+ "android",
43
+ "ios",
44
+ "code-audit",
45
+ "auto-repair",
46
+ "groq-ai",
47
+ "diagnostics",
48
+ "engineering-intelligence",
49
+ "static-analysis",
50
+ "quality-gate"
51
+ ],
52
+ "author": "DevIntelligence Engineering Team",
53
+ "license": "MIT",
54
+ "scripts": {
55
+ "dev": "tsx server.ts",
56
+ "build:cli": "node scripts/build.js",
57
+ "build:types": "tsc -p tsconfig.build.json",
58
+ "build": "node scripts/build.js && tsc -p tsconfig.build.json",
59
+ "build:ui": "vite build",
60
+ "start": "node server.ts",
61
+ "preview": "vite preview",
62
+ "lint": "tsc --noEmit",
63
+ "test": "node --test src/engine/analyzerEngine.test.ts src/engine/aiEngine.test.ts",
64
+ "prepare": "npm run build"
65
+ },
66
+ "dependencies": {
67
+ "@google/genai": "^2.4.0",
68
+ "@tailwindcss/vite": "^4.3.3",
69
+ "@vitejs/plugin-react": "^6.1.1",
70
+ "dotenv": "^17.2.3",
71
+ "express": "^4.21.2",
72
+ "lucide-react": "^0.546.0",
73
+ "motion": "^12.23.24",
74
+ "react": "^19.0.1",
75
+ "react-dom": "^19.0.1",
76
+ "vite": "^8.3.0"
77
+ },
78
+ "devDependencies": {
79
+ "@types/express": "^4.17.21",
80
+ "@types/node": "^22.14.0",
81
+ "@types/react": "^19.3.0",
82
+ "@types/react-dom": "^19.3.0",
83
+ "autoprefixer": "^10.4.21",
84
+ "esbuild": "^0.28.0",
85
+ "tailwindcss": "^4.3.3",
86
+ "tsx": "^4.21.0",
87
+ "typescript": "^7.0.2"
88
+ }
89
+ }
package/index.html DELETED
@@ -1,21 +0,0 @@
1
- <!doctype html>
2
- <html lang="en" class="dark">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>NetControl — Universal WiFi Network Management SaaS</title>
7
- <meta name="description" content="Enterprise-grade multi-router WiFi network management platform with Local Network Agent architecture, real-time device monitoring, MAC access control, and multi-tenant PostgreSQL persistence." />
8
- <meta property="og:title" content="NetControl — Universal WiFi Network Management SaaS" />
9
- <meta property="og:description" content="Enterprise-grade multi-router WiFi network management platform with Local Network Agent architecture, real-time device monitoring, MAC access control, and multi-tenant PostgreSQL persistence." />
10
- <meta property="og:type" content="website" />
11
- <meta name="twitter:card" content="summary_large_image" />
12
- <link rel="preconnect" href="https://fonts.googleapis.com" />
13
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
14
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
15
- </head>
16
- <body class="bg-[#0B1120] text-[#F8FAFC] antialiased selection:bg-[#3B82F6]/30 selection:text-white">
17
- <div id="root"></div>
18
- <script type="module" src="/src/main.tsx"></script>
19
- </body>
20
- </html>
21
-
package/server.ts DELETED
@@ -1,275 +0,0 @@
1
- import express from 'express';
2
- import http from 'node:http';
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import { createServer as createViteServer } from 'vite';
7
- import * as dotenv from 'dotenv';
8
- import {
9
- inspectHostEnvironment,
10
- diagnoseRawErrorLog,
11
- PRESET_ERROR_LOGS,
12
- } from './src/engine/analyzerEngine.ts';
13
- import {
14
- diagnoseRawErrorLogWithAi,
15
- generateProjectAiAdvice,
16
- askDevIntelligenceAi,
17
- isAiRateLimited,
18
- } from './src/engine/aiEngine.ts';
19
- import {
20
- getAllProjectReports,
21
- getProjectReportById,
22
- registerLocalProject,
23
- applyIssueRepairOnDisk,
24
- applyAllSafeRepairsOnDisk,
25
- rollbackRepairOnDisk,
26
- updateProjectQualityGate,
27
- MCP_TOOLS_CATALOG,
28
- executeMcpToolCall,
29
- } from './src/engine/repairEngine.ts';
30
-
31
- dotenv.config();
32
-
33
- const __filename = fileURLToPath(import.meta.url);
34
- const __dirname = path.dirname(__filename);
35
-
36
- async function startServer() {
37
- const app = express();
38
- const server = http.createServer(app);
39
- const PORT = 3000;
40
-
41
- app.use(express.json({ limit: '5mb' }));
42
-
43
- // 1. Get complete DEVINTELLIGENCE workspace state
44
- app.get('/api/devintel/workspace', (_req, res) => {
45
- try {
46
- const projects = getAllProjectReports(__dirname);
47
- const environmentChecks = inspectHostEnvironment(false);
48
- res.json({
49
- projects,
50
- environmentChecks,
51
- mcpTools: MCP_TOOLS_CATALOG,
52
- presetErrorLogs: PRESET_ERROR_LOGS,
53
- hostPlatform: process.platform,
54
- nodeVersion: process.version,
55
- });
56
- } catch (error: any) {
57
- res.status(500).json({ error: error.message || 'Failed to load DEVINTELLIGENCE workspace.' });
58
- }
59
- });
60
-
61
- // 2. Get or rescan a specific project
62
- app.get('/api/devintel/projects/:id', (req, res) => {
63
- try {
64
- const forceRescan = req.query.rescan === 'true';
65
- const report = getProjectReportById(req.params.id, forceRescan, __dirname);
66
- res.json(report);
67
- } catch (error: any) {
68
- res.status(404).json({ error: error.message || 'Project not found.' });
69
- }
70
- });
71
-
72
- // 3. Trigger explicit deep scan on a project
73
- app.post('/api/devintel/projects/:id/scan', (req, res) => {
74
- try {
75
- const report = getProjectReportById(req.params.id, true, __dirname);
76
- const projects = getAllProjectReports(__dirname);
77
- res.json({ report, projects });
78
- } catch (error: any) {
79
- res.status(400).json({ error: error.message || 'Failed to scan project.' });
80
- }
81
- });
82
-
83
- // 4. Register a new local project path
84
- app.post('/api/devintel/projects/register', (req, res) => {
85
- try {
86
- const { name, rootPath } = req.body || {};
87
- if (!name || !String(name).trim() || !rootPath || !String(rootPath).trim()) {
88
- return res.status(400).json({ error: 'Project name and local directory path are required.' });
89
- }
90
- const report = registerLocalProject({
91
- name: String(name).trim(),
92
- rootPath: String(rootPath).trim(),
93
- baseWorkspaceDir: __dirname,
94
- });
95
- const projects = getAllProjectReports(__dirname);
96
- return res.json({ report, projects });
97
- } catch (error: any) {
98
- return res.status(400).json({ error: error.message || 'Failed to register local project.' });
99
- }
100
- });
101
-
102
- // 5. Read real file content from a registered project for Project Explorer
103
- app.get('/api/devintel/file-content', (req, res) => {
104
- try {
105
- const projectId = String(req.query.projectId || 'rn-expo-commerce');
106
- const relFile = String(req.query.filePath || '');
107
- const report = getProjectReportById(projectId, false, __dirname);
108
- const safeRel = path.normalize(relFile).replace(/^(\.\.(\/|\\|$))+/, '');
109
- const fullPath = path.join(report.rootPath, safeRel);
110
- if (!fullPath.startsWith(report.rootPath) || !fs.existsSync(fullPath)) {
111
- return res.status(404).json({ error: 'File not found inside project root.' });
112
- }
113
- const content = fs.readFileSync(fullPath, 'utf8');
114
- return res.json({
115
- projectId,
116
- filePath: safeRel,
117
- content,
118
- sizeBytes: Buffer.byteLength(content, 'utf8'),
119
- });
120
- } catch (error: any) {
121
- return res.status(400).json({ error: error.message || 'Unable to read file.' });
122
- }
123
- });
124
-
125
- // 6. Apply an individual issue repair on disk with automatic backup & re-scan verification
126
- app.post('/api/devintel/projects/:id/repair', (req, res) => {
127
- try {
128
- const { issueId, allowReviewTier } = req.body || {};
129
- if (!issueId) {
130
- return res.status(400).json({ error: 'issueId is required.' });
131
- }
132
- const result = applyIssueRepairOnDisk({
133
- projectId: req.params.id,
134
- issueId: String(issueId),
135
- allowReviewTier: Boolean(allowReviewTier),
136
- baseWorkspaceDir: __dirname,
137
- });
138
- const projects = getAllProjectReports(__dirname);
139
- return res.json({ ...result, projects });
140
- } catch (error: any) {
141
- return res.status(400).json({ error: error.message || 'Repair execution failed.' });
142
- }
143
- });
144
-
145
- // 7. Apply all SAFE repairs in batch on disk
146
- app.post('/api/devintel/projects/:id/repair-all-safe', (req, res) => {
147
- try {
148
- const result = applyAllSafeRepairsOnDisk(req.params.id, __dirname);
149
- const projects = getAllProjectReports(__dirname);
150
- return res.json({ ...result, projects });
151
- } catch (error: any) {
152
- return res.status(400).json({ error: error.message || 'Batch safe repair failed.' });
153
- }
154
- });
155
-
156
- // 8. Rollback / undo a previously applied repair from backup snapshot
157
- app.post('/api/devintel/projects/:id/rollback', (req, res) => {
158
- try {
159
- const { repairId } = req.body || {};
160
- if (!repairId) {
161
- return res.status(400).json({ error: 'repairId is required to rollback.' });
162
- }
163
- const result = rollbackRepairOnDisk({
164
- projectId: req.params.id,
165
- repairId: String(repairId),
166
- baseWorkspaceDir: __dirname,
167
- });
168
- const projects = getAllProjectReports(__dirname);
169
- return res.json({ ...result, projects });
170
- } catch (error: any) {
171
- return res.status(400).json({ error: error.message || 'Rollback failed.' });
172
- }
173
- });
174
-
175
- // 9. Update configurable Quality Gate thresholds
176
- app.put('/api/devintel/projects/:id/quality-gate', (req, res) => {
177
- try {
178
- const updatedReport = updateProjectQualityGate(req.params.id, req.body || {}, __dirname);
179
- const projects = getAllProjectReports(__dirname);
180
- return res.json({ updatedReport, projects });
181
- } catch (error: any) {
182
- return res.status(400).json({ error: error.message || 'Failed to update Quality Gate.' });
183
- }
184
- });
185
-
186
- // 10. Diagnose raw React Native / Metro / Gradle / CocoaPods / Red Screen log with Groq AI + Rule Fallback
187
- app.post('/api/devintel/diagnose-log', async (req, res) => {
188
- try {
189
- const { rawLog } = req.body || {};
190
- if (!rawLog || !String(rawLog).trim()) {
191
- return res.status(400).json({ error: 'Please provide a build or runtime error log to diagnose.' });
192
- }
193
- // AI-first with guaranteed instant rule-engine fallback
194
- const diagnosis = await diagnoseRawErrorLogWithAi(String(rawLog));
195
- return res.json(diagnosis);
196
- } catch (error: any) {
197
- // Ultimate safety net: even if an unexpected error occurs, fall back to rule engine
198
- try {
199
- const fallback = diagnoseRawErrorLog(String(req.body?.rawLog || ''));
200
- return res.json({ ...fallback, fallbackUsed: true, fallbackReason: error.message });
201
- } catch {
202
- return res.status(400).json({ error: error.message || 'Error log diagnosis failed.' });
203
- }
204
- }
205
- });
206
-
207
- // 10b. Generate AI Engineering Advice / Executive Brief for a project
208
- app.get('/api/devintel/projects/:id/ai-advice', async (req, res) => {
209
- try {
210
- const report = getProjectReportById(req.params.id, false, __dirname);
211
- const advice = await generateProjectAiAdvice(report);
212
- return res.json(advice);
213
- } catch (error: any) {
214
- return res.status(500).json({ error: error.message || 'Failed to generate AI advice.' });
215
- }
216
- });
217
-
218
- // 10c. Interactive DEVINTELLIGENCE AI Assistant
219
- app.post('/api/devintel/ai-assistant', async (req, res) => {
220
- try {
221
- const { query, context } = req.body || {};
222
- const result = await askDevIntelligenceAi(String(query || ''), context);
223
- return res.json(result);
224
- } catch (error: any) {
225
- return res.status(500).json({ error: error.message || 'AI Assistant query failed.' });
226
- }
227
- });
228
-
229
- // 11. Refresh host environment checks
230
- app.post('/api/devintel/environment/refresh', (_req, res) => {
231
- try {
232
- const environmentChecks = inspectHostEnvironment(true);
233
- return res.json({ environmentChecks });
234
- } catch (error: any) {
235
- return res.status(500).json({ error: error.message || 'Environment check failed.' });
236
- }
237
- });
238
-
239
- // 12. Execute local MCP tool call
240
- app.post('/api/devintel/mcp/call', (req, res) => {
241
- try {
242
- const { toolName, args } = req.body || {};
243
- if (!toolName) {
244
- return res.status(400).json({ error: 'toolName is required.' });
245
- }
246
- const output = executeMcpToolCall(String(toolName), args || {}, __dirname);
247
- const projects = getAllProjectReports(__dirname);
248
- return res.json({ output, projects });
249
- } catch (error: any) {
250
- return res.status(400).json({ error: error.message || 'MCP tool invocation failed.' });
251
- }
252
- });
253
-
254
- if (process.env.NODE_ENV !== 'production') {
255
- const vite = await createViteServer({
256
- server: { middlewareMode: true },
257
- appType: 'spa',
258
- });
259
- app.use(vite.middlewares);
260
- } else {
261
- const distPath = path.join(__dirname, 'dist');
262
- app.use(express.static(distPath));
263
- app.get('*', (_req, res) => {
264
- res.sendFile(path.join(distPath, 'index.html'));
265
- });
266
- }
267
-
268
- server.listen(PORT, '0.0.0.0', () => {
269
- console.log(`DEVINTELLIGENCE Engineering Workstation listening on http://0.0.0.0:${PORT}`);
270
- });
271
- }
272
-
273
- startServer().catch((err) => {
274
- console.error('Fatal server startup error:', err);
275
- });