deeplyzer 0.2.0 → 0.6.0
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/README.md +43 -2
- package/analysis/deep/assess/assessAgent.js +24 -0
- package/analysis/deep/env/environmentAgent.js +125 -0
- package/analysis/deep/generate/ganerateAgent.js +30 -0
- package/analysis/deep/orchestratorAgent.js +94 -0
- package/analysis/deep/plan/planAgent.js +26 -0
- package/analysis/static/staticAnalyzer.js +86 -0
- package/engine.js +87 -0
- package/globals.js +9 -0
- package/img/logo.png +0 -0
- package/img/workflow.png +0 -0
- package/index.js +6 -0
- package/llm/llm.js +58 -0
- package/llm/providers/claude.js +65 -0
- package/llm/providers/gemini.js +66 -0
- package/llm/providers/openai.js +91 -0
- package/open-packages.json +11 -0
- package/package.json +8 -3
- package/prompts/deep.assess +85 -0
- package/prompts/deep.env.assess +11 -0
- package/prompts/deep.env.runtime +45 -0
- package/prompts/deep.generate.output +31 -0
- package/prompts/deep.plans +153 -0
- package/prompts/graph.build_nodes +577 -0
- package/prompts/graph.environment +154 -0
- package/prompts/graph.resolve_edges +44 -0
- package/prompts/graph.source_exclusions +47 -0
- package/prompts/static.analyse +58 -0
- package/services/environmentService.js +70 -0
- package/services/graphService.js +292 -0
- package/services/workflowService.js +168 -0
- package/session/sessionManager.js +130 -0
- package/utils/execUtil.js +153 -0
- package/utils/fileUtil.js +239 -0
- package/utils/idUtil.js +17 -0
- package/utils/logger.js +93 -0
- package/utils/promptsUtil.js +29 -0
package/utils/logger.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const globals = require('../globals');
|
|
5
|
+
|
|
6
|
+
class Logger {
|
|
7
|
+
static LEVELS = {
|
|
8
|
+
NONE: 0,
|
|
9
|
+
ERROR: 1,
|
|
10
|
+
ESSENTIAL: 2,
|
|
11
|
+
DETAILED: 3
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
static currentLevel = Logger.LEVELS.DETAILED;
|
|
15
|
+
static logPath = null;
|
|
16
|
+
|
|
17
|
+
static init() {
|
|
18
|
+
this.logPath = globals.config.log_path;
|
|
19
|
+
|
|
20
|
+
if (!this.logPath) return;
|
|
21
|
+
|
|
22
|
+
const envLevel = globals.log_level;
|
|
23
|
+
|
|
24
|
+
this.currentLevel = Logger.LEVELS[envLevel] ?? Logger.LEVELS.DETAILED;
|
|
25
|
+
|
|
26
|
+
fs.mkdirSync(this.logPath, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static error(message) {
|
|
30
|
+
Logger._write('ERROR', message);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static essential(message) {
|
|
34
|
+
Logger._write('ESSENTIAL', message);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static detailed(message) {
|
|
38
|
+
Logger._write('DETAILED', message);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static _write(level, message) {
|
|
42
|
+
if (Logger.LEVELS[level] > this.currentLevel) return;
|
|
43
|
+
|
|
44
|
+
const logLine =
|
|
45
|
+
`[${new Date().toISOString()}] ` +
|
|
46
|
+
`[${level}] ${message}`;
|
|
47
|
+
|
|
48
|
+
// Console logging (DETAILED is suppressed)
|
|
49
|
+
switch (level) {
|
|
50
|
+
case 'ERROR':
|
|
51
|
+
console.error(logLine);
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'ESSENTIAL':
|
|
55
|
+
console.log(logLine);
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 'NONE':
|
|
59
|
+
case 'DETAILED':
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// File logging
|
|
64
|
+
if (this.logPath) {
|
|
65
|
+
this._logToFile(logLine + '\n');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static _logToFile(logLine) {
|
|
70
|
+
try {
|
|
71
|
+
const logFilePath = path.join(this.logPath, Logger._getLogFileName());
|
|
72
|
+
|
|
73
|
+
fs.appendFileSync(logFilePath, logLine, 'utf8');
|
|
74
|
+
|
|
75
|
+
} catch (err) {
|
|
76
|
+
console.error('Failed to write log:', err);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static _getLogFileName() {
|
|
81
|
+
const date = new Date();
|
|
82
|
+
|
|
83
|
+
const formatted = date.toLocaleDateString('en-GB', {
|
|
84
|
+
year: 'numeric',
|
|
85
|
+
month: 'short',
|
|
86
|
+
day: '2-digit'
|
|
87
|
+
}).replace(/ /g, '-');
|
|
88
|
+
|
|
89
|
+
return `logs-${formatted}.log`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = Logger;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
class PromptsUtil {
|
|
5
|
+
static read(name) {
|
|
6
|
+
const promptsDir = path.join(process.cwd(), "prompts");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(promptsDir)) {
|
|
9
|
+
throw new Error(`Prompts directory not found: ${promptsDir}`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const files = fs.readdirSync(promptsDir);
|
|
13
|
+
|
|
14
|
+
const matchedFiles = files.filter(file => {
|
|
15
|
+
const filePath = path.join(promptsDir, file);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
fs.statSync(filePath).isFile() &&
|
|
19
|
+
path.parse(file).base === name
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return matchedFiles
|
|
24
|
+
.map(file => fs.readFileSync(path.join(promptsDir, file), "utf-8"))
|
|
25
|
+
.join("\n");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = PromptsUtil;
|