codeep 1.0.126 → 1.0.128
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/dist/api/index.js +24 -0
- package/dist/app.js +127 -2
- package/dist/components/AgentProgress.d.ts +5 -5
- package/dist/components/AgentProgress.js +110 -54
- package/dist/components/Help.js +1 -1
- package/dist/components/Input.js +3 -0
- package/dist/components/MessageList.d.ts +1 -0
- package/dist/components/MessageList.js +2 -2
- package/dist/components/ProjectPermission.js +17 -4
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.js +53 -0
- package/dist/utils/projectIntelligence.d.ts +67 -0
- package/dist/utils/projectIntelligence.js +601 -0
- package/package.json +1 -1
package/dist/config/index.js
CHANGED
|
@@ -32,8 +32,14 @@ function getLocalConfigPath(projectPath) {
|
|
|
32
32
|
/**
|
|
33
33
|
* Check if directory is a project
|
|
34
34
|
* Looks for common project indicators: package.json, pyproject.toml, Cargo.toml, go.mod, composer.json, etc.
|
|
35
|
+
* Also checks if user has manually initialized this folder as a project (.codeep/project.json)
|
|
35
36
|
*/
|
|
36
37
|
function isProjectDirectory(path) {
|
|
38
|
+
// Check if user has manually initialized this as a project
|
|
39
|
+
const manualProjectMarker = join(path, '.codeep', 'project.json');
|
|
40
|
+
if (existsSync(manualProjectMarker)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
37
43
|
const projectFiles = [
|
|
38
44
|
'package.json', // Node.js
|
|
39
45
|
'pyproject.toml', // Python (Poetry)
|
|
@@ -48,6 +54,53 @@ function isProjectDirectory(path) {
|
|
|
48
54
|
];
|
|
49
55
|
return projectFiles.some(file => existsSync(join(path, file)));
|
|
50
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if directory has standard project markers (not manually initialized)
|
|
59
|
+
*/
|
|
60
|
+
export function hasStandardProjectMarkers(path) {
|
|
61
|
+
const projectFiles = [
|
|
62
|
+
'package.json',
|
|
63
|
+
'pyproject.toml',
|
|
64
|
+
'requirements.txt',
|
|
65
|
+
'setup.py',
|
|
66
|
+
'Cargo.toml',
|
|
67
|
+
'go.mod',
|
|
68
|
+
'composer.json',
|
|
69
|
+
'pom.xml',
|
|
70
|
+
'build.gradle',
|
|
71
|
+
'.git',
|
|
72
|
+
];
|
|
73
|
+
return projectFiles.some(file => existsSync(join(path, file)));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Initialize a folder as a Codeep project
|
|
77
|
+
* Creates .codeep/project.json marker file
|
|
78
|
+
*/
|
|
79
|
+
export function initializeAsProject(path) {
|
|
80
|
+
try {
|
|
81
|
+
const codeepDir = join(path, '.codeep');
|
|
82
|
+
if (!existsSync(codeepDir)) {
|
|
83
|
+
mkdirSync(codeepDir, { recursive: true });
|
|
84
|
+
}
|
|
85
|
+
const projectFile = join(codeepDir, 'project.json');
|
|
86
|
+
const projectData = {
|
|
87
|
+
name: path.split('/').pop() || 'project',
|
|
88
|
+
initializedAt: new Date().toISOString(),
|
|
89
|
+
version: '1.0',
|
|
90
|
+
};
|
|
91
|
+
writeFileSync(projectFile, JSON.stringify(projectData, null, 2));
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if folder was manually initialized as project
|
|
100
|
+
*/
|
|
101
|
+
export function isManuallyInitializedProject(path) {
|
|
102
|
+
return existsSync(join(path, '.codeep', 'project.json'));
|
|
103
|
+
}
|
|
51
104
|
/**
|
|
52
105
|
* Get fallback config directory if standard location is not writable
|
|
53
106
|
* Falls back to .codeep in current working directory
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Intelligence - Deep project analysis and caching
|
|
3
|
+
* Scans project once and caches important information for faster AI context
|
|
4
|
+
*/
|
|
5
|
+
export interface ProjectIntelligence {
|
|
6
|
+
version: string;
|
|
7
|
+
scannedAt: string;
|
|
8
|
+
projectPath: string;
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
structure: {
|
|
13
|
+
totalFiles: number;
|
|
14
|
+
totalDirectories: number;
|
|
15
|
+
languages: Record<string, number>;
|
|
16
|
+
topDirectories: string[];
|
|
17
|
+
};
|
|
18
|
+
dependencies: {
|
|
19
|
+
runtime: string[];
|
|
20
|
+
dev: string[];
|
|
21
|
+
frameworks: string[];
|
|
22
|
+
};
|
|
23
|
+
keyFiles: {
|
|
24
|
+
path: string;
|
|
25
|
+
summary: string;
|
|
26
|
+
}[];
|
|
27
|
+
entryPoints: string[];
|
|
28
|
+
scripts: Record<string, string>;
|
|
29
|
+
architecture: {
|
|
30
|
+
patterns: string[];
|
|
31
|
+
mainModules: string[];
|
|
32
|
+
apiEndpoints?: string[];
|
|
33
|
+
components?: string[];
|
|
34
|
+
};
|
|
35
|
+
conventions: {
|
|
36
|
+
indentation: 'tabs' | 'spaces' | 'mixed';
|
|
37
|
+
quotes: 'single' | 'double' | 'mixed';
|
|
38
|
+
semicolons: boolean;
|
|
39
|
+
namingStyle: 'camelCase' | 'snake_case' | 'PascalCase' | 'mixed';
|
|
40
|
+
};
|
|
41
|
+
testing: {
|
|
42
|
+
framework: string | null;
|
|
43
|
+
testDirectory: string | null;
|
|
44
|
+
hasTests: boolean;
|
|
45
|
+
};
|
|
46
|
+
notes: string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Scan project and generate intelligence
|
|
50
|
+
*/
|
|
51
|
+
export declare function scanProject(projectPath: string): Promise<ProjectIntelligence>;
|
|
52
|
+
/**
|
|
53
|
+
* Save intelligence to .codeep/intelligence.json
|
|
54
|
+
*/
|
|
55
|
+
export declare function saveProjectIntelligence(projectPath: string, intelligence: ProjectIntelligence): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Load intelligence from .codeep/intelligence.json
|
|
58
|
+
*/
|
|
59
|
+
export declare function loadProjectIntelligence(projectPath: string): ProjectIntelligence | null;
|
|
60
|
+
/**
|
|
61
|
+
* Check if intelligence exists and is fresh (less than 24 hours old)
|
|
62
|
+
*/
|
|
63
|
+
export declare function isIntelligenceFresh(projectPath: string, maxAgeHours?: number): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Generate AI-friendly context from intelligence
|
|
66
|
+
*/
|
|
67
|
+
export declare function generateContextFromIntelligence(intelligence: ProjectIntelligence): string;
|