devintelligence 0.0.0-stage → 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 (57) hide show
  1. package/.env.example +14 -0
  2. package/LICENSE +22 -0
  3. package/README.md +146 -3
  4. package/bin/devintelligence.js +2486 -0
  5. package/bin/devintelligence.ts +416 -0
  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 -0
  37. package/fixtures/django-analytics-service/settings.py +16 -0
  38. package/fixtures/express-api-gateway/package.json +14 -0
  39. package/fixtures/express-api-gateway/src/server.ts +16 -0
  40. package/fixtures/nextjs-saas-portal/package.json +21 -0
  41. package/fixtures/nextjs-saas-portal/src/app/dashboard/page.tsx +26 -0
  42. package/fixtures/rn-bare-fitness/android/build.gradle +19 -0
  43. package/fixtures/rn-bare-fitness/ios/Info.plist +14 -0
  44. package/fixtures/rn-bare-fitness/package.json +23 -0
  45. package/fixtures/rn-bare-fitness/src/WorkoutTracker.tsx +31 -0
  46. package/fixtures/rn-expo-commerce/android/app/build.gradle +20 -0
  47. package/fixtures/rn-expo-commerce/android/app/src/main/AndroidManifest.xml +21 -0
  48. package/fixtures/rn-expo-commerce/android/gradle.properties +6 -0
  49. package/fixtures/rn-expo-commerce/app.json +17 -0
  50. package/fixtures/rn-expo-commerce/babel.config.js +10 -0
  51. package/fixtures/rn-expo-commerce/ios/Podfile +13 -0
  52. package/fixtures/rn-expo-commerce/metro.config.js +7 -0
  53. package/fixtures/rn-expo-commerce/package.json +31 -0
  54. package/fixtures/rn-expo-commerce/src/components/LegacyPromoBanner.tsx +11 -0
  55. package/fixtures/rn-expo-commerce/src/screens/ProductFeedScreen.tsx +48 -0
  56. package/fixtures/rn-expo-commerce/src/services/api.ts +15 -0
  57. package/package.json +89 -6
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ProjectIntelligenceReport } from '../types/devintelligence.ts';
3
+ interface AnalysisViewProps {
4
+ report: ProjectIntelligenceReport;
5
+ onFixIssue: (issueId: string, allowReview?: boolean) => void;
6
+ isBusy: boolean;
7
+ }
8
+ export declare function CodeIntelligenceView({ report, onFixIssue, isBusy }: AnalysisViewProps): React.JSX.Element;
9
+ export declare function DesignIntelligenceView({ report, onFixIssue, isBusy }: AnalysisViewProps): React.JSX.Element;
10
+ export declare function PerformanceLabView({ report, onFixIssue, isBusy }: AnalysisViewProps): React.JSX.Element;
11
+ export declare function SecurityAuditView({ report, onFixIssue, isBusy }: AnalysisViewProps): React.JSX.Element;
12
+ export declare function DependencyIntelligenceView({ report, onFixIssue, isBusy }: AnalysisViewProps): React.JSX.Element;
13
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { CheckStatus, ErrorDiagnosisResult, ProjectIntelligenceReport } from '../types/devintelligence.ts';
3
+ interface MobileViewProps {
4
+ report: ProjectIntelligenceReport;
5
+ onFixIssue: (issueId: string, allowReview?: boolean) => void;
6
+ presetErrorLogs: {
7
+ id: string;
8
+ label: string;
9
+ ecosystem: string;
10
+ rawLog: string;
11
+ }[];
12
+ onDiagnoseLog: (rawLog: string) => Promise<ErrorDiagnosisResult>;
13
+ isBusy: boolean;
14
+ }
15
+ export declare function StatusIndicator({ status }: {
16
+ status: CheckStatus;
17
+ }): React.JSX.Element;
18
+ export declare function ReactNativeDoctorView({ report, onFixIssue, isBusy }: MobileViewProps): React.JSX.Element;
19
+ export declare function AndroidDiagnosticsView({ report, onFixIssue, isBusy }: MobileViewProps): React.JSX.Element;
20
+ export declare function IosDiagnosticsView({ report, onFixIssue, isBusy }: MobileViewProps): React.JSX.Element;
21
+ export declare function ErrorDiagnosticsView({ presetErrorLogs, onDiagnoseLog, }: MobileViewProps): React.JSX.Element;
22
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { DashboardModuleId, DiagnosticIssue, ProjectIntelligenceReport } from '../types/devintelligence.ts';
3
+ interface OverviewProps {
4
+ report: ProjectIntelligenceReport;
5
+ allProjects: ProjectIntelligenceReport[];
6
+ onSelectProject: (id: string) => void;
7
+ onNavigateModule: (module: DashboardModuleId) => void;
8
+ onRunScan: () => void;
9
+ onFixAllSafe: () => void;
10
+ onFixIssue: (issueId: string, allowReview?: boolean) => void;
11
+ onRegisterProject: (name: string, rootPath: string) => Promise<void>;
12
+ isBusy: boolean;
13
+ }
14
+ export declare function SeverityText({ severity }: {
15
+ severity: DiagnosticIssue['severity'];
16
+ }): React.JSX.Element;
17
+ export declare function CommandCenterView({ report, allProjects, onSelectProject, onNavigateModule, onFixAllSafe, onFixIssue, isBusy, }: OverviewProps): React.JSX.Element;
18
+ export declare function ProjectExplorerView({ report, allProjects, onSelectProject, onRegisterProject, onFixIssue, isBusy, }: OverviewProps): React.JSX.Element;
19
+ export declare function ProjectHealthView({ report, onNavigateModule }: OverviewProps): React.JSX.Element;
20
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { EnvironmentCheckItem, ProjectIntelligenceReport, QualityGateConfig } from '../types/devintelligence.ts';
3
+ interface RepairGateProps {
4
+ report: ProjectIntelligenceReport;
5
+ environmentChecks: EnvironmentCheckItem[];
6
+ mcpTools: {
7
+ name: string;
8
+ description: string;
9
+ parameters: string[];
10
+ }[];
11
+ onFixIssue: (issueId: string, allowReview?: boolean) => void;
12
+ onFixAllSafe: () => void;
13
+ onRollbackRepair: (repairId: string) => void;
14
+ onUpdateQualityGate: (cfg: Partial<QualityGateConfig>) => Promise<void>;
15
+ onRefreshEnvironment: () => Promise<void>;
16
+ onCallMcpTool: (toolName: string, args: Record<string, string>) => Promise<unknown>;
17
+ isBusy: boolean;
18
+ }
19
+ export declare function AutoRepairCenterView({ report, onFixIssue, onFixAllSafe, onRollbackRepair, isBusy, }: RepairGateProps): React.JSX.Element;
20
+ export declare function VisualTestingView({ report }: RepairGateProps): React.JSX.Element;
21
+ export declare function QualityGateView({ report, onUpdateQualityGate, isBusy, }: RepairGateProps): React.JSX.Element;
22
+ export declare function ProjectHistoryView({ report, onRollbackRepair, isBusy, }: RepairGateProps): React.JSX.Element;
23
+ export declare function EnvironmentManagerView({ environmentChecks, onRefreshEnvironment, isBusy, }: RepairGateProps): React.JSX.Element;
24
+ export declare function SettingsAndMcpView({ report, mcpTools, onCallMcpTool, }: RepairGateProps): React.JSX.Element;
25
+ export {};
@@ -0,0 +1,62 @@
1
+ /**
2
+ * DEVINTELLIGENCE & NETCONTROL AI Engine (Powered by Groq)
3
+ *
4
+ * Provides ultra-fast LLM inference with resilient fallback architecture.
5
+ * If the Groq API key reaches rate limits (HTTP 429), quota limits, or network timeouts,
6
+ * this engine automatically and seamlessly falls back to built-in heuristic rule-based engines
7
+ * so that the system NEVER crashes and operations continue 100% normally.
8
+ */
9
+ import type { ErrorDiagnosisResult, ProjectIntelligenceReport } from '../types/devintelligence.ts';
10
+ export declare function getGroqApiKey(): string;
11
+ export declare function isAiRateLimited(): boolean;
12
+ export declare function resetAiRateLimit(): void;
13
+ interface GroqMessage {
14
+ role: 'system' | 'user' | 'assistant';
15
+ content: string;
16
+ }
17
+ export interface GroqChatSuccess {
18
+ ok: true;
19
+ content: string;
20
+ model: string;
21
+ }
22
+ export interface GroqChatFailure {
23
+ ok: false;
24
+ error: string;
25
+ isRateLimit: boolean;
26
+ }
27
+ export type GroqChatResult = GroqChatSuccess | GroqChatFailure;
28
+ interface GroqChatOptions {
29
+ model?: string;
30
+ temperature?: number;
31
+ maxTokens?: number;
32
+ jsonMode?: boolean;
33
+ }
34
+ /**
35
+ * Low-level caller for Groq OpenAI-compatible Chat Completions API.
36
+ * Protected by timeout, circuit breaker, and graceful error trapping.
37
+ */
38
+ export declare function callGroqChat(messages: GroqMessage[], options?: GroqChatOptions): Promise<GroqChatResult>;
39
+ /**
40
+ * AI-Powered Error Log Diagnosis with Guaranteed Rule Fallback.
41
+ * If AI fails, exceeds quota, or is offline, the local heuristic rule engine
42
+ * automatically generates a complete diagnosis with 0 downtime.
43
+ */
44
+ export declare function diagnoseRawErrorLogWithAi(rawLog: string): Promise<ErrorDiagnosisResult>;
45
+ /**
46
+ * Generates an AI-driven Executive Engineering Brief for a project.
47
+ * Falls back to deterministic rule summary if quota is exhausted.
48
+ */
49
+ export declare function generateProjectAiAdvice(report: ProjectIntelligenceReport): Promise<{
50
+ advice: string;
51
+ aiPowered: boolean;
52
+ model?: string;
53
+ }>;
54
+ /**
55
+ * General AI Assistant for interactive developer queries or network troubleshooting.
56
+ */
57
+ export declare function askDevIntelligenceAi(query: string, contextData?: unknown): Promise<{
58
+ answer: string;
59
+ aiPowered: boolean;
60
+ model?: string;
61
+ }>;
62
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { AndroidDiagnosticSummary, DiagnosticIssue, EnvironmentCheckItem, ErrorDiagnosisResult, IosDiagnosticSummary, ProjectEcosystem, ProjectIntelligenceReport, QualityGateConfig, RepairRecord, ScanSnapshot } from '../types/devintelligence.ts';
2
+ export declare function contentContainsSnippet(fileContent: string, snippet: string): boolean;
3
+ export declare function inspectHostEnvironment(forceRefresh?: boolean): EnvironmentCheckItem[];
4
+ export declare function listFilesRecursive(dirPath: string, baseDir?: string, acc?: string[]): string[];
5
+ export declare function detectProjectEcosystem(projectPath: string): {
6
+ ecosystem: ProjectEcosystem;
7
+ frameworkName: string;
8
+ description: string;
9
+ };
10
+ export declare function inspectAndroidFolder(projectId: string, projectPath: string, issues: DiagnosticIssue[]): AndroidDiagnosticSummary;
11
+ export declare function inspectIosFolder(projectId: string, projectPath: string, pkgDeps: Record<string, string>, issues: DiagnosticIssue[]): IosDiagnosticSummary;
12
+ export declare function analyzeProjectDirectory(projectId: string, projectName: string, projectPath: string, qualityGateConfig: QualityGateConfig, existingRepairHistory?: RepairRecord[], existingScanHistory?: ScanSnapshot[]): ProjectIntelligenceReport;
13
+ export declare const PRESET_ERROR_LOGS: {
14
+ id: string;
15
+ label: string;
16
+ ecosystem: string;
17
+ rawLog: string;
18
+ }[];
19
+ export declare function diagnoseRawErrorLog(rawLog: string): ErrorDiagnosisResult;
@@ -0,0 +1,42 @@
1
+ import type { ProjectIntelligenceReport, QualityGateConfig, RepairRecord } from '../types/devintelligence.ts';
2
+ export declare function initializeWorkspaceRegistry(baseWorkspaceDir?: string): void;
3
+ export declare function getAllProjectReports(baseWorkspaceDir?: string): ProjectIntelligenceReport[];
4
+ export declare function getProjectReportById(projectId?: string, forceRescan?: boolean, baseWorkspaceDir?: string): ProjectIntelligenceReport;
5
+ export declare function registerLocalProject(params: {
6
+ name: string;
7
+ rootPath: string;
8
+ baseWorkspaceDir?: string;
9
+ }): ProjectIntelligenceReport;
10
+ export declare function updateProjectQualityGate(projectId: string, newConfig: Partial<QualityGateConfig>, baseWorkspaceDir?: string): ProjectIntelligenceReport;
11
+ export declare function applyIssueRepairOnDisk(params: {
12
+ projectId: string;
13
+ issueId: string;
14
+ allowReviewTier?: boolean;
15
+ baseWorkspaceDir?: string;
16
+ }): {
17
+ repairRecord: RepairRecord;
18
+ updatedReport: ProjectIntelligenceReport;
19
+ };
20
+ export declare function applyAllSafeRepairsOnDisk(projectId: string, baseWorkspaceDir?: string): {
21
+ appliedRepairs: RepairRecord[];
22
+ updatedReport: ProjectIntelligenceReport;
23
+ };
24
+ export declare function rollbackRepairOnDisk(params: {
25
+ projectId: string;
26
+ repairId: string;
27
+ baseWorkspaceDir?: string;
28
+ }): {
29
+ restoredRecord: RepairRecord;
30
+ updatedReport: ProjectIntelligenceReport;
31
+ };
32
+ export interface McpToolDefinition {
33
+ name: string;
34
+ description: string;
35
+ parameters: string[];
36
+ }
37
+ export declare const MCP_TOOLS_CATALOG: McpToolDefinition[];
38
+ export declare function executeMcpToolCall(toolName: string, args: {
39
+ projectId?: string;
40
+ issueId?: string;
41
+ rawLog?: string;
42
+ }, baseWorkspaceDir?: string): Record<string, unknown>;