galaxy-code 0.1.5 → 0.1.6
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 +149 -600
- package/dist/app.js +1 -1
- package/dist/cli.min.js +589 -0
- package/package.json +12 -10
- package/dist/node_modules/@workspace/agent-core/connections/claude.d.ts +0 -72
- package/dist/node_modules/@workspace/agent-core/connections/claude.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/claude.js +0 -270
- package/dist/node_modules/@workspace/agent-core/connections/claude.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/gemini.d.ts +0 -41
- package/dist/node_modules/@workspace/agent-core/connections/gemini.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/gemini.js +0 -203
- package/dist/node_modules/@workspace/agent-core/connections/gemini.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/index.d.ts +0 -12
- package/dist/node_modules/@workspace/agent-core/connections/index.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/index.js +0 -12
- package/dist/node_modules/@workspace/agent-core/connections/index.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/ollama.d.ts +0 -38
- package/dist/node_modules/@workspace/agent-core/connections/ollama.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/ollama.js +0 -64
- package/dist/node_modules/@workspace/agent-core/connections/ollama.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/types.d.ts +0 -23
- package/dist/node_modules/@workspace/agent-core/connections/types.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/connections/types.js +0 -8
- package/dist/node_modules/@workspace/agent-core/connections/types.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/index.d.ts +0 -13
- package/dist/node_modules/@workspace/agent-core/index.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/index.js +0 -22
- package/dist/node_modules/@workspace/agent-core/index.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/package.json +0 -53
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.d.ts +0 -2
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.js +0 -144
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/index.d.ts +0 -12
- package/dist/node_modules/@workspace/agent-core/prompts/index.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/index.js +0 -12
- package/dist/node_modules/@workspace/agent-core/prompts/index.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.d.ts +0 -9
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.js +0 -89
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.d.ts +0 -9
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.js +0 -196
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.d.ts +0 -8
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.js +0 -112
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.d.ts +0 -30
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.js +0 -76
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.d.ts +0 -30
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.js +0 -107
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.d.ts +0 -37
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.js +0 -144
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/index.d.ts +0 -13
- package/dist/node_modules/@workspace/agent-core/providers/index.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/index.js +0 -13
- package/dist/node_modules/@workspace/agent-core/providers/index.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.d.ts +0 -54
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.js +0 -247
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.d.ts +0 -17
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.js +0 -62
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.d.ts +0 -67
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.js +0 -81
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.d.ts +0 -52
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.js +0 -150
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.d.ts +0 -15
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.js +0 -121
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.d.ts +0 -12
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.js +0 -84
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.d.ts +0 -18
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.js +0 -126
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.d.ts +0 -95
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.js +0 -245
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.d.ts +0 -12
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.js +0 -115
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/index.d.ts +0 -11
- package/dist/node_modules/@workspace/agent-core/tools/index.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/index.js +0 -11
- package/dist/node_modules/@workspace/agent-core/tools/index.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.d.ts +0 -30
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.js +0 -125
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.d.ts +0 -20
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.js +0 -46
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/registry.d.ts +0 -22
- package/dist/node_modules/@workspace/agent-core/tools/registry.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/registry.js +0 -651
- package/dist/node_modules/@workspace/agent-core/tools/registry.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.d.ts +0 -25
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.js +0 -26
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/types.d.ts +0 -32
- package/dist/node_modules/@workspace/agent-core/tools/types.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/tools/types.js +0 -2
- package/dist/node_modules/@workspace/agent-core/tools/types.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/types.d.ts +0 -40
- package/dist/node_modules/@workspace/agent-core/types.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/types.js +0 -9
- package/dist/node_modules/@workspace/agent-core/types.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.d.ts +0 -103
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.js +0 -307
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/devtools.d.ts +0 -22
- package/dist/node_modules/@workspace/agent-core/utils/devtools.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/devtools.js +0 -62
- package/dist/node_modules/@workspace/agent-core/utils/devtools.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.d.ts +0 -33
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.js +0 -591
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.js.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.d.ts +0 -60
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.d.ts.map +0 -1
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.js +0 -204
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BA IT Analyzer - Business Analyst for IT Projects
|
|
3
|
-
* Analyzes user requirements and creates detailed functional specifications
|
|
4
|
-
* NOW WITH DEEP THINK INTEGRATION for complex technical decisions!
|
|
5
|
-
*/
|
|
6
|
-
export interface ProjectRequirement {
|
|
7
|
-
type: 'create_project' | 'update_project';
|
|
8
|
-
projectName: string;
|
|
9
|
-
projectType: string;
|
|
10
|
-
description: string;
|
|
11
|
-
coreFeatures: Feature[];
|
|
12
|
-
technicalStack: TechnicalStack;
|
|
13
|
-
userStories: UserStory[];
|
|
14
|
-
dataModel: DataEntity[];
|
|
15
|
-
apiEndpoints?: APIEndpoint[];
|
|
16
|
-
estimatedComplexity: 'simple' | 'medium' | 'complex';
|
|
17
|
-
estimatedTime: string;
|
|
18
|
-
recommendations: string[];
|
|
19
|
-
questionsForUser: string[];
|
|
20
|
-
deepAnalysis?: {
|
|
21
|
-
question: string;
|
|
22
|
-
insights: string;
|
|
23
|
-
considerations: string[];
|
|
24
|
-
}[];
|
|
25
|
-
}
|
|
26
|
-
export interface Feature {
|
|
27
|
-
name: string;
|
|
28
|
-
description: string;
|
|
29
|
-
priority: 'must-have' | 'should-have' | 'nice-to-have';
|
|
30
|
-
userStory: string;
|
|
31
|
-
acceptanceCriteria: string[];
|
|
32
|
-
}
|
|
33
|
-
export interface TechnicalStack {
|
|
34
|
-
frontend?: string[];
|
|
35
|
-
backend?: string[];
|
|
36
|
-
database?: string[];
|
|
37
|
-
infrastructure?: string[];
|
|
38
|
-
thirdParty?: string[];
|
|
39
|
-
}
|
|
40
|
-
export interface UserStory {
|
|
41
|
-
as: string;
|
|
42
|
-
iWant: string;
|
|
43
|
-
soThat: string;
|
|
44
|
-
acceptanceCriteria: string[];
|
|
45
|
-
}
|
|
46
|
-
export interface DataEntity {
|
|
47
|
-
name: string;
|
|
48
|
-
description: string;
|
|
49
|
-
attributes: string[];
|
|
50
|
-
relationships: string[];
|
|
51
|
-
}
|
|
52
|
-
export interface APIEndpoint {
|
|
53
|
-
method: string;
|
|
54
|
-
path: string;
|
|
55
|
-
description: string;
|
|
56
|
-
requestBody?: string;
|
|
57
|
-
response: string;
|
|
58
|
-
}
|
|
59
|
-
export declare class BAITAnalyzer {
|
|
60
|
-
private ollama;
|
|
61
|
-
private model;
|
|
62
|
-
constructor();
|
|
63
|
-
private getConnection;
|
|
64
|
-
analyze(userRequest: string, context?: string): Promise<ProjectRequirement>;
|
|
65
|
-
private extractJSON;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=ba-it-analyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ba-it-analyzer.d.ts","sourceRoot":"","sources":["../../src/tools/ba-it-analyzer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB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,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,KAAK,CAAuC;;IAMpD,OAAO,CAAC,aAAa;IASf,OAAO,CACZ,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC;IAqB9B,OAAO,CAAC,WAAW;CA8CnB"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BA IT Analyzer - Business Analyst for IT Projects
|
|
3
|
-
* Analyzes user requirements and creates detailed functional specifications
|
|
4
|
-
* NOW WITH DEEP THINK INTEGRATION for complex technical decisions!
|
|
5
|
-
*/
|
|
6
|
-
import { OllamaConnection } from '../connections/ollama.js';
|
|
7
|
-
import { systemBAITAnalyzerPrompt } from '../prompts/ba-it-analyzer.js';
|
|
8
|
-
export class BAITAnalyzer {
|
|
9
|
-
ollama = null;
|
|
10
|
-
model = 'gpt-oss:120b-cloud';
|
|
11
|
-
constructor() {
|
|
12
|
-
// Lazy initialization - only create connection when needed
|
|
13
|
-
}
|
|
14
|
-
getConnection() {
|
|
15
|
-
if (!this.ollama) {
|
|
16
|
-
this.ollama = new OllamaConnection({
|
|
17
|
-
model: this.model,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return this.ollama;
|
|
21
|
-
}
|
|
22
|
-
async analyze(userRequest, context) {
|
|
23
|
-
let userMessage = `User Request: ${userRequest}`;
|
|
24
|
-
if (context) {
|
|
25
|
-
userMessage += `\n\nAdditional Context:\n${context}`;
|
|
26
|
-
}
|
|
27
|
-
const response = await this.getConnection().generate({
|
|
28
|
-
prompt: userMessage,
|
|
29
|
-
system: systemBAITAnalyzerPrompt,
|
|
30
|
-
model: this.model,
|
|
31
|
-
});
|
|
32
|
-
// Extract and clean JSON from response
|
|
33
|
-
const jsonStr = this.extractJSON(response.response);
|
|
34
|
-
if (!jsonStr) {
|
|
35
|
-
throw new Error('Failed to extract JSON from BA analysis response');
|
|
36
|
-
}
|
|
37
|
-
const projectRequirement = JSON.parse(jsonStr);
|
|
38
|
-
return projectRequirement;
|
|
39
|
-
}
|
|
40
|
-
extractJSON(content) {
|
|
41
|
-
// Remove markdown code blocks if present
|
|
42
|
-
let cleanContent = content.trim();
|
|
43
|
-
cleanContent = cleanContent.replace(/```json\s*/g, '');
|
|
44
|
-
cleanContent = cleanContent.replace(/```\s*/g, '');
|
|
45
|
-
// Try to find JSON object with balanced braces
|
|
46
|
-
const startIdx = cleanContent.indexOf('{');
|
|
47
|
-
if (startIdx === -1)
|
|
48
|
-
return null;
|
|
49
|
-
let braceCount = 0;
|
|
50
|
-
let inString = false;
|
|
51
|
-
let escapeNext = false;
|
|
52
|
-
for (let i = startIdx; i < cleanContent.length; i++) {
|
|
53
|
-
const char = cleanContent[i];
|
|
54
|
-
if (escapeNext) {
|
|
55
|
-
escapeNext = false;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (char === '\\') {
|
|
59
|
-
escapeNext = true;
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
if (char === '"' && !escapeNext) {
|
|
63
|
-
inString = !inString;
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (!inString) {
|
|
67
|
-
if (char === '{') {
|
|
68
|
-
braceCount++;
|
|
69
|
-
}
|
|
70
|
-
else if (char === '}') {
|
|
71
|
-
braceCount--;
|
|
72
|
-
if (braceCount === 0) {
|
|
73
|
-
return cleanContent.substring(startIdx, i + 1);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=ba-it-analyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ba-it-analyzer.js","sourceRoot":"","sources":["../../src/tools/ba-it-analyzer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AA6DtE,MAAM,OAAO,YAAY;IAChB,MAAM,GAA4B,IAAI,CAAC;IACvC,KAAK,GAAkB,oBAAoB,CAAC;IAEpD;QACC,2DAA2D;IAC5D,CAAC;IAEO,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAClB,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAgB,CAAC;gBAClC,KAAK,EAAE,IAAI,CAAC,KAAK;aACjB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,OAAO,CACZ,WAAmB,EACnB,OAAgB;QAEhB,IAAI,WAAW,GAAG,iBAAiB,WAAW,EAAE,CAAC;QACjD,IAAI,OAAO,EAAE,CAAC;YACb,WAAW,IAAI,4BAA4B,OAAO,EAAE,CAAC;QACtD,CAAC;QAED,MAAM,QAAQ,GAAqB,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;YACtE,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,wBAAwB;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAC,CAAC;QACH,uCAAuC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;Q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AAC;oBACzB,UAAU,EAAE,CAAC;oBACb,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;wBACtB,OAAO,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;oBAChD,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code Generate Agent - Planning only (no execution)
|
|
3
|
-
* Receives feature spec → Plans actions → Returns action list
|
|
4
|
-
* Orchestrator will execute the actions
|
|
5
|
-
*/
|
|
6
|
-
import type { ProjectRequirement } from './ba-it-analyzer.js';
|
|
7
|
-
export interface CodeGenerateInput {
|
|
8
|
-
step: number;
|
|
9
|
-
featureName: string;
|
|
10
|
-
featureDescription: string;
|
|
11
|
-
priority: string;
|
|
12
|
-
technicalStack: ProjectRequirement['technicalStack'];
|
|
13
|
-
userStories?: Array<{
|
|
14
|
-
as: string;
|
|
15
|
-
want: string;
|
|
16
|
-
so: string;
|
|
17
|
-
}>;
|
|
18
|
-
dataModel?: Array<{
|
|
19
|
-
entity: string;
|
|
20
|
-
attributes: any;
|
|
21
|
-
relationships: any;
|
|
22
|
-
}>;
|
|
23
|
-
apiEndpoints?: Array<{
|
|
24
|
-
path: string;
|
|
25
|
-
method: string;
|
|
26
|
-
description: string;
|
|
27
|
-
}>;
|
|
28
|
-
acceptanceCriteria?: string[];
|
|
29
|
-
}
|
|
30
|
-
export interface CodeGenerateAction {
|
|
31
|
-
action: 'read_file' | 'write_file' | 'run_command' | 'search_files';
|
|
32
|
-
path?: string;
|
|
33
|
-
content?: string;
|
|
34
|
-
command?: string;
|
|
35
|
-
pattern?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface CodeGenerateOutput {
|
|
38
|
-
step: number;
|
|
39
|
-
featureName: string;
|
|
40
|
-
actions: CodeGenerateAction[];
|
|
41
|
-
}
|
|
42
|
-
export declare class CodeGenerateAgent {
|
|
43
|
-
private ollama;
|
|
44
|
-
private model;
|
|
45
|
-
constructor();
|
|
46
|
-
private getConnection;
|
|
47
|
-
execute(input: CodeGenerateInput): Promise<CodeGenerateOutput>;
|
|
48
|
-
private buildSystemPrompt;
|
|
49
|
-
private buildUserPrompt;
|
|
50
|
-
private parseActionPlan;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=code-generate-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-generate-agent.d.ts","sourceRoot":"","sources":["../../src/tools/code-generate-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,GAAG,CAAC;QAAC,aAAa,EAAE,GAAG,CAAA;KAAC,CAAC,CAAC;IACzE,YAAY,CAAC,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC1E,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,CAAC;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,KAAK,CAA2C;;IAMxD,OAAO,CAAC,aAAa;IASf,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA6BpE,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,eAAe;IA+CvB,OAAO,CAAC,eAAe;CAmCvB"}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code Generate Agent - Planning only (no execution)
|
|
3
|
-
* Receives feature spec → Plans actions → Returns action list
|
|
4
|
-
* Orchestrator will execute the actions
|
|
5
|
-
*/
|
|
6
|
-
import { OllamaConnection } from '../connections/ollama.js';
|
|
7
|
-
export class CodeGenerateAgent {
|
|
8
|
-
ollama = null;
|
|
9
|
-
model = 'qwen3-coder:480b-cloud';
|
|
10
|
-
constructor() {
|
|
11
|
-
// Lazy initialization - only create connection when needed
|
|
12
|
-
}
|
|
13
|
-
getConnection() {
|
|
14
|
-
if (!this.ollama) {
|
|
15
|
-
this.ollama = new OllamaConnection({
|
|
16
|
-
model: this.model,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return this.ollama;
|
|
20
|
-
}
|
|
21
|
-
async execute(input) {
|
|
22
|
-
try {
|
|
23
|
-
const systemPrompt = this.buildSystemPrompt();
|
|
24
|
-
const userPrompt = this.buildUserPrompt(input);
|
|
25
|
-
const response = await this.getConnection().generate({
|
|
26
|
-
prompt: userPrompt,
|
|
27
|
-
system: systemPrompt,
|
|
28
|
-
model: this.model,
|
|
29
|
-
});
|
|
30
|
-
// Parse action plan from AI
|
|
31
|
-
const actions = this.parseActionPlan(response.response);
|
|
32
|
-
return {
|
|
33
|
-
step: input.step,
|
|
34
|
-
featureName: input.featureName,
|
|
35
|
-
actions,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
// Return empty actions on error
|
|
40
|
-
return {
|
|
41
|
-
step: input.step,
|
|
42
|
-
featureName: input.featureName,
|
|
43
|
-
actions: [],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
buildSystemPrompt() {
|
|
48
|
-
return `You are an EXPERT CODE GENERATION PLANNER.
|
|
49
|
-
|
|
50
|
-
# Your Mission:
|
|
51
|
-
Generate a detailed action plan for implementing a feature. You do NOT execute - only plan.
|
|
52
|
-
|
|
53
|
-
# Available Actions:
|
|
54
|
-
1. read_file - Read existing file for context
|
|
55
|
-
2. write_file - Create/update a file
|
|
56
|
-
3. run_command - Execute shell command
|
|
57
|
-
4. search_files - Search for pattern in files
|
|
58
|
-
|
|
59
|
-
# Planning Guidelines:
|
|
60
|
-
1. Start by reading relevant existing files
|
|
61
|
-
2. Plan all necessary file writes (components, APIs, types, tests, etc.)
|
|
62
|
-
3. Include dependency installations if needed
|
|
63
|
-
4. Be thorough - include ALL files needed
|
|
64
|
-
|
|
65
|
-
# Code Quality Requirements:
|
|
66
|
-
- Production-ready, no TODOs or placeholders
|
|
67
|
-
- Full file content, not snippets
|
|
68
|
-
- Proper imports and exports
|
|
69
|
-
- Type safety (TypeScript)
|
|
70
|
-
- Error handling
|
|
71
|
-
- Comments for complex logic
|
|
72
|
-
- Follow framework best practices
|
|
73
|
-
|
|
74
|
-
# Output Format (VALID JSON ARRAY):
|
|
75
|
-
[
|
|
76
|
-
{"action": "read_file", "path": "package.json"},
|
|
77
|
-
{"action": "write_file", "path": "components/Feature.tsx", "content": "full content here"},
|
|
78
|
-
{"action": "write_file", "path": "api/feature.ts", "content": "full content here"},
|
|
79
|
-
{"action": "run_command", "command": "npm install new-package"}
|
|
80
|
-
]
|
|
81
|
-
|
|
82
|
-
CRITICAL:
|
|
83
|
-
- Output ONLY the JSON array, nothing else. Start with [ and end with ]
|
|
84
|
-
- Include full file content in "content" field, not placeholders`;
|
|
85
|
-
}
|
|
86
|
-
buildUserPrompt(input) {
|
|
87
|
-
let prompt = `# Feature Implementation Plan Request
|
|
88
|
-
|
|
89
|
-
**Feature**: ${input.featureName}
|
|
90
|
-
**Description**: ${input.featureDescription}
|
|
91
|
-
**Priority**: ${input.priority}
|
|
92
|
-
|
|
93
|
-
## Technical Stack:
|
|
94
|
-
${JSON.stringify(input.technicalStack, null, 2)}
|
|
95
|
-
`;
|
|
96
|
-
if (input.userStories && input.userStories.length > 0) {
|
|
97
|
-
prompt += `\n## User Stories:\n`;
|
|
98
|
-
input.userStories.forEach(story => {
|
|
99
|
-
prompt += `- As ${story.as}, I want ${story.want}, so that ${story.so}\n`;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (input.dataModel && input.dataModel.length > 0) {
|
|
103
|
-
prompt += `\n## Data Model:\n${JSON.stringify(input.dataModel, null, 2)}\n`;
|
|
104
|
-
}
|
|
105
|
-
if (input.apiEndpoints && input.apiEndpoints.length > 0) {
|
|
106
|
-
prompt += `\n## API Endpoints:\n`;
|
|
107
|
-
input.apiEndpoints.forEach(endpoint => {
|
|
108
|
-
prompt += `- ${endpoint.method} ${endpoint.path}: ${endpoint.description}\n`;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (input.acceptanceCriteria && input.acceptanceCriteria.length > 0) {
|
|
112
|
-
prompt += `\n## Acceptance Criteria:\n`;
|
|
113
|
-
input.acceptanceCriteria.forEach((criteria, i) => {
|
|
114
|
-
prompt += `${i + 1}. ${criteria}\n`;
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
prompt += `\n## Working Directory: ${process.cwd()}
|
|
118
|
-
|
|
119
|
-
Generate the action plan as JSON array to implement this feature completely.`;
|
|
120
|
-
return prompt;
|
|
121
|
-
}
|
|
122
|
-
parseActionPlan(content) {
|
|
123
|
-
// Clean response
|
|
124
|
-
let cleanContent = content.trim();
|
|
125
|
-
// Remove markdown code blocks
|
|
126
|
-
cleanContent = cleanContent.replace(/```json\s*/g, '');
|
|
127
|
-
cleanContent = cleanContent.replace(/```\s*/g, '');
|
|
128
|
-
// Find JSON array
|
|
129
|
-
const startIdx = cleanContent.indexOf('[');
|
|
130
|
-
const endIdx = cleanContent.lastIndexOf(']');
|
|
131
|
-
if (startIdx === -1 || endIdx === -1) {
|
|
132
|
-
console.warn('Invalid action plan format - no JSON array found');
|
|
133
|
-
return [];
|
|
134
|
-
}
|
|
135
|
-
const jsonStr = cleanContent.substring(startIdx, endIdx + 1);
|
|
136
|
-
try {
|
|
137
|
-
const actions = JSON.parse(jsonStr);
|
|
138
|
-
// Filter to only valid action types
|
|
139
|
-
return actions.filter((action) => action.action === 'read_file' ||
|
|
140
|
-
action.action === 'write_file' ||
|
|
141
|
-
action.action === 'run_command' ||
|
|
142
|
-
action.action === 'search_files');
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
console.warn(`Failed to parse action plan: ${error}`);
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=code-generate-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-generate-agent.js","sourceRoot":"","sources":["../../src/tools/code-generate-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AA6BzE,MAAM,OAAO,iBAAiB;IACrB,MAAM,GAA4B,IAAI,CAAC;IACvC,KAAK,GAAkB,wBAAwB,CAAC;IAExD;QACC,2DAA2D;IAC5D,CA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,CAAC;QACX,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface CommandResult {
|
|
2
|
-
stdout: string;
|
|
3
|
-
stderr: string;
|
|
4
|
-
exitCode: number;
|
|
5
|
-
command?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class CommandRunner {
|
|
8
|
-
runCommand(command: string, cwd: string, timeout?: number): Promise<CommandResult>;
|
|
9
|
-
detectTestCommand(cwd: string): Promise<string | null>;
|
|
10
|
-
detectDevCommand(cwd: string): Promise<string | null>;
|
|
11
|
-
detectBuildCommand(cwd: string): Promise<string | null>;
|
|
12
|
-
private detectPackageManager;
|
|
13
|
-
installDependencies(cwd: string): Promise<CommandResult>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=command-runner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-runner.d.ts","sourceRoot":"","sources":["../../src/tools/command-runner.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,aAAa;IACnB,UAAU,CACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAe,GACtB,OAAO,CAAC,aAAa,CAAC;IAuBnB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAoBtD,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBrD,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YAoB/C,oBAAoB;IAY5B,mBAAmB,CACxB,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,aAAa,CAAC;CAazB"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { exec } from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import fs from 'fs/promises';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
const execAsync = promisify(exec);
|
|
6
|
-
export class CommandRunner {
|
|
7
|
-
async runCommand(command, cwd, timeout = 180000) {
|
|
8
|
-
try {
|
|
9
|
-
const { stdout, stderr } = await execAsync(command, {
|
|
10
|
-
cwd,
|
|
11
|
-
timeout, // Increased to 3 minutes for project creation
|
|
12
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
stdout,
|
|
16
|
-
stderr,
|
|
17
|
-
exitCode: 0,
|
|
18
|
-
command,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
return {
|
|
23
|
-
stdout: error.stdout || '',
|
|
24
|
-
stderr: error.stderr || error.message,
|
|
25
|
-
exitCode: error.code || 1,
|
|
26
|
-
command,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async detectTestCommand(cwd) {
|
|
31
|
-
try {
|
|
32
|
-
const pkgJsonPath = path.join(cwd, 'package.json');
|
|
33
|
-
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
34
|
-
const pkgJson = JSON.parse(content);
|
|
35
|
-
if (pkgJson.scripts?.test) {
|
|
36
|
-
return pkgJson.scripts.test;
|
|
37
|
-
}
|
|
38
|
-
const packageManager = await this.detectPackageManager(cwd);
|
|
39
|
-
if (packageManager === 'bun')
|
|
40
|
-
return 'bun test';
|
|
41
|
-
if (packageManager === 'pnpm')
|
|
42
|
-
return 'pnpm test';
|
|
43
|
-
if (packageManager === 'yarn')
|
|
44
|
-
return 'yarn test';
|
|
45
|
-
return 'npm test';
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async detectDevCommand(cwd) {
|
|
52
|
-
try {
|
|
53
|
-
const pkgJsonPath = path.join(cwd, 'package.json');
|
|
54
|
-
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
55
|
-
const pkgJson = JSON.parse(content);
|
|
56
|
-
if (pkgJson.scripts?.dev)
|
|
57
|
-
return pkgJson.scripts.dev;
|
|
58
|
-
if (pkgJson.scripts?.start)
|
|
59
|
-
return pkgJson.scripts.start;
|
|
60
|
-
const packageManager = await this.detectPackageManager(cwd);
|
|
61
|
-
if (packageManager === 'bun')
|
|
62
|
-
return 'bun run dev';
|
|
63
|
-
if (packageManager === 'pnpm')
|
|
64
|
-
return 'pnpm dev';
|
|
65
|
-
if (packageManager === 'yarn')
|
|
66
|
-
return 'yarn dev';
|
|
67
|
-
return 'npm run dev';
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async detectBuildCommand(cwd) {
|
|
74
|
-
try {
|
|
75
|
-
const pkgJsonPath = path.join(cwd, 'package.json');
|
|
76
|
-
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
77
|
-
const pkgJson = JSON.parse(content);
|
|
78
|
-
if (pkgJson.scripts?.build) {
|
|
79
|
-
const packageManager = await this.detectPackageManager(cwd);
|
|
80
|
-
if (packageManager === 'bun')
|
|
81
|
-
return 'bun run build';
|
|
82
|
-
if (packageManager === 'pnpm')
|
|
83
|
-
return 'pnpm build';
|
|
84
|
-
if (packageManager === 'yarn')
|
|
85
|
-
return 'yarn build';
|
|
86
|
-
return 'npm run build';
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
catch {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
async detectPackageManager(cwd) {
|
|
95
|
-
try {
|
|
96
|
-
const files = await fs.readdir(cwd);
|
|
97
|
-
if (files.includes('bun.lockb'))
|
|
98
|
-
return 'bun';
|
|
99
|
-
if (files.includes('pnpm-lock.yaml'))
|
|
100
|
-
return 'pnpm';
|
|
101
|
-
if (files.includes('yarn.lock'))
|
|
102
|
-
return 'yarn';
|
|
103
|
-
return 'npm';
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
return 'bun'; // Default to bun instead of npm
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async installDependencies(cwd) {
|
|
110
|
-
const packageManager = await this.detectPackageManager(cwd);
|
|
111
|
-
const installCmd = packageManager === 'npm'
|
|
112
|
-
? 'npm install'
|
|
113
|
-
: packageManager === 'yarn'
|
|
114
|
-
? 'yarn install'
|
|
115
|
-
: packageManager === 'pnpm'
|
|
116
|
-
? 'pnpm install'
|
|
117
|
-
: 'bun install';
|
|
118
|
-
return this.runCommand(installCmd, cwd, 180000); // 3 minutes timeout
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=command-runner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-runner.js","sourceRoot":"","sources":["../../src/tools/command-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AASlC,MAAM,OAAO,aAAa;IACzB,KAAK,CAAC,UAAU,CACf,OAAe,EACf,GAAW,EACX,UAAkB,MAAM;QAExB,IAAI,CAAC;YACJ,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE;gBACjD,GAAG;gBACH,OAAO,EAAE,8CAA8C;gBACvD,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;aAC3B,CAAC,CAAC;YACH,OAAO;gBACN,M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AC;gBACnD,OAAO,eAAe,CAAC;YACxB,CAAC;YAED,OAAO,IAAI,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAAC,GAAW;QAC7C,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC9C,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAAE,OAAO,MAAM,CAAC;YACpD,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAAE,OAAO,MAAM,CAAC;YAC/C,OAAO,KAAK,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,KAAK,CAAC,CAAC,gCAAgC;QAC/C,CAAC;IACF,CAAC;IAED,KAAK,CAAC,mBAAmB,CACxB,GAAW;QAEX,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC5D,MAAM,UAAU,GACf,cAAc,KAAK,KAAK;YACvB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,cAAc,KAAK,MAAM;gBAC3B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,cAAc,KAAK,MAAM;oBAC3B,CAAC,CAAC,cAAc;oBAChB,CAAC,CAAC,aAAa,CAAC;QAElB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,oBAAoB;IACtE,CAAC;CACD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class DocumentParser {
|
|
2
|
-
parseDocument(filePath: string, type: 'docx' | 'xlsx' | 'pdf'): Promise<string>;
|
|
3
|
-
private parsePDF;
|
|
4
|
-
private parseDOCX;
|
|
5
|
-
private parseXLSX;
|
|
6
|
-
checkDependencies(): Promise<{
|
|
7
|
-
pdf: boolean;
|
|
8
|
-
docx: boolean;
|
|
9
|
-
xlsx: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=document-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-parser.d.ts","sourceRoot":"","sources":["../../src/tools/document-parser.ts"],"names":[],"mappings":"AAKA,qBAAa,cAAc;IACpB,aAAa,CAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAC3B,OAAO,CAAC,MAAM,CAAC;YAiBJ,QAAQ;YAeR,SAAS;YAeT,SAAS;IAejB,iBAAiB,IAAI,OAAO,CAAC;QAClC,GAAG,EAAE,OAAO,CAAC;QACb,IAAI,EAAE,OAAO,CAAC;QACd,IAAI,EAAE,OAAO,CAAC;KACd,CAAC;CAgBF"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { exec } from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
const execAsync = promisify(exec);
|
|
4
|
-
export class DocumentParser {
|
|
5
|
-
async parseDocument(filePath, type) {
|
|
6
|
-
try {
|
|
7
|
-
switch (type) {
|
|
8
|
-
case 'pdf':
|
|
9
|
-
return await this.parsePDF(filePath);
|
|
10
|
-
case 'docx':
|
|
11
|
-
return await this.parseDOCX(filePath);
|
|
12
|
-
case 'xlsx':
|
|
13
|
-
return await this.parseXLSX(filePath);
|
|
14
|
-
default:
|
|
15
|
-
throw new Error(`Unsupported document type: ${type}`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
return `Failed to parse document: ${error.message}`;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
async parsePDF(filePath) {
|
|
23
|
-
try {
|
|
24
|
-
const { stdout } = await execAsync(`pdftotext "${filePath}" -`, {
|
|
25
|
-
timeout: 30000,
|
|
26
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
27
|
-
});
|
|
28
|
-
return stdout || 'No text content found in PDF';
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
if (error.message.includes('command not found')) {
|
|
32
|
-
return 'PDF parsing requires pdftotext (install: apt-get install poppler-utils)';
|
|
33
|
-
}
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async parseDOCX(filePath) {
|
|
38
|
-
try {
|
|
39
|
-
const { stdout } = await execAsync(`pandoc "${filePath}" -t plain`, {
|
|
40
|
-
timeout: 30000,
|
|
41
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
42
|
-
});
|
|
43
|
-
return stdout || 'No text content found in DOCX';
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
if (error.message.includes('command not found')) {
|
|
47
|
-
return 'DOCX parsing requires pandoc (install: apt-get install pandoc)';
|
|
48
|
-
}
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async parseXLSX(filePath) {
|
|
53
|
-
try {
|
|
54
|
-
const { stdout } = await execAsync(`ssconvert "${filePath}" fd://1`, {
|
|
55
|
-
timeout: 30000,
|
|
56
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
57
|
-
});
|
|
58
|
-
return stdout || 'No content found in XLSX';
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error.message.includes('command not found')) {
|
|
62
|
-
return 'XLSX parsing requires ssconvert (install: apt-get install gnumeric)';
|
|
63
|
-
}
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async checkDependencies() {
|
|
68
|
-
const checkCommand = async (cmd) => {
|
|
69
|
-
try {
|
|
70
|
-
await execAsync(`which ${cmd}`, { timeout: 1000 });
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
pdf: await checkCommand('pdftotext'),
|
|
79
|
-
docx: await checkCommand('pandoc'),
|
|
80
|
-
xlsx: await checkCommand('ssconvert'),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=document-parser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-parser.js","sourceRoot":"","sources":["../../src/tools/document-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAE/B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,OAAO,cAAc;IAC1B,KAAK,CAAC,aAAa,CAClB,QAAgB,EAChB,IAA6B;QAE7B,IAAI,CAAC;YACJ,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,KAAK;oBACT,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACtC,KAAK,MAAM;oBACV,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBACvC,KAAK,MAAM;oBACV,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBACvC;oBACC,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;QACF,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,OAAO,6BAA6B,KAAK,CAAC,OAAO,EAAE,CAAC;QACrD,CAAC;IACF,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC;YACJ,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,SAAS,CAAC,cAAc,QAAQ,KAAK,EAAE;gBAC7D,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,GAAG,IAAI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;QAKtB,MAAM,YAAY,GAAG,KAAK,EAAE,GAAW,EAAoB,EAAE;YAC5D,IAAI,CAAC;gBACJ,MAAM,SAAS,CAAC,SAAS,GAAG,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;gBACjD,OAAO,IAAI,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACR,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC,CAAC;QAEF,OAAO;YACN,GAAG,EAAE,MAAM,YAAY,CAAC,WAAW,CAAC;YACpC,IAAI,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC;YAClC,IAAI,EAAE,MAAM,YAAY,CAAC,WAAW,CAAC;SACrC,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface FileWriteResult {
|
|
2
|
-
isNewFile: boolean;
|
|
3
|
-
oldContent?: string;
|
|
4
|
-
newContent: string;
|
|
5
|
-
linesAdded: number;
|
|
6
|
-
linesRemoved: number;
|
|
7
|
-
path: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class FileOperations {
|
|
10
|
-
readFile(filePath: string): Promise<string>;
|
|
11
|
-
writeFile(filePath: string, content: string): Promise<FileWriteResult>;
|
|
12
|
-
listFiles(dirPath: string, recursive?: boolean): Promise<string[]>;
|
|
13
|
-
searchFiles(dirPath: string, pattern: string): Promise<string[]>;
|
|
14
|
-
getFileDiff(filePath: string): Promise<string>;
|
|
15
|
-
applyPatch(filePath: string, patch: string): Promise<void>;
|
|
16
|
-
getFileTree(dirPath: string): Promise<string>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=file-operations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.d.ts","sourceRoot":"","sources":["../../src/tools/file-operations.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,cAAc;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ3C,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IA2DtE,SAAS,CACd,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,OAAe,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC;IAmBd,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAYhE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW9C,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa1D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAWnD"}
|