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,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2025-10-22
|
|
5
|
-
* @modify 2025-10-22
|
|
6
|
-
* @desc Gemini Agent - Self-contained AI orchestrator
|
|
7
|
-
*/
|
|
8
|
-
import { GeminiConnection } from '../connections/gemini.js';
|
|
9
|
-
import { ToolRegistry } from '../tools/index.js';
|
|
10
|
-
import { buildUniversalAgentPrompt } from '../prompts/index.js';
|
|
11
|
-
export class GeminiAgent {
|
|
12
|
-
connection;
|
|
13
|
-
toolsRegistry = new ToolRegistry();
|
|
14
|
-
conversationHistory = [];
|
|
15
|
-
systemPrompt;
|
|
16
|
-
// Low-level tools for Gemini to build software
|
|
17
|
-
toolNames = [
|
|
18
|
-
'file_read',
|
|
19
|
-
'file_write',
|
|
20
|
-
'file_tree',
|
|
21
|
-
'file_list',
|
|
22
|
-
'file_search',
|
|
23
|
-
'git_status',
|
|
24
|
-
'git_commit',
|
|
25
|
-
'git_push',
|
|
26
|
-
'git_pull',
|
|
27
|
-
'git_diff',
|
|
28
|
-
'git_log',
|
|
29
|
-
'git_branches',
|
|
30
|
-
'command_run',
|
|
31
|
-
'install_dependencies',
|
|
32
|
-
'test_run',
|
|
33
|
-
'document_parse',
|
|
34
|
-
'plan_task',
|
|
35
|
-
'progress_reporter',
|
|
36
|
-
// Galaxy UI Integration
|
|
37
|
-
'galaxy_ui_list',
|
|
38
|
-
'galaxy_ui_search',
|
|
39
|
-
'galaxy_ui_get_component',
|
|
40
|
-
'galaxy_ui_categories',
|
|
41
|
-
'galaxy_ui_add',
|
|
42
|
-
'galaxy_ui_init',
|
|
43
|
-
'galaxy_ui_docs',
|
|
44
|
-
];
|
|
45
|
-
constructor(config) {
|
|
46
|
-
// Build system prompt using shared universal prompt
|
|
47
|
-
const toolsContext = this.toolsRegistry.getToolsContext(this.toolNames);
|
|
48
|
-
this.systemPrompt = buildUniversalAgentPrompt(toolsContext);
|
|
49
|
-
this.connection = new GeminiConnection(config, this.systemPrompt);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Handle user input and orchestrate tool calls
|
|
53
|
-
*/
|
|
54
|
-
async handleUserInput(input, options, onMessage, retryCount = 0) {
|
|
55
|
-
const MAX_RETRIES = 3;
|
|
56
|
-
try {
|
|
57
|
-
// Add system context to input
|
|
58
|
-
const contextMessage = options
|
|
59
|
-
? `[System Context: Git=${options.gitEnabled ? 'ON' : 'OFF'}, Test Planning=${options.testEnabled ? 'ON' : 'OFF'}]\n\n${input}`
|
|
60
|
-
: input;
|
|
61
|
-
// Add user message to history
|
|
62
|
-
this.conversationHistory.push({
|
|
63
|
-
role: 'user',
|
|
64
|
-
content: contextMessage,
|
|
65
|
-
});
|
|
66
|
-
// Notify user message
|
|
67
|
-
if (onMessage) {
|
|
68
|
-
onMessage('user', contextMessage);
|
|
69
|
-
}
|
|
70
|
-
// Create callback wrapper for tool execution notifications
|
|
71
|
-
const geminiCallback = (author, content, toolName, toolInfo) => {
|
|
72
|
-
if (onMessage && author === 'tool' && toolName) {
|
|
73
|
-
// Special handling for plan_task and progress_reporter
|
|
74
|
-
if (toolName === 'plan_task' || toolName === 'progress_reporter') {
|
|
75
|
-
// Don't notify - event already emitted by tool
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
// Regular tool handling - notify result only
|
|
79
|
-
const success = !content.startsWith('❌');
|
|
80
|
-
onMessage('tool', content, toolName, {
|
|
81
|
-
success,
|
|
82
|
-
output: toolInfo?.result || content,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
// Start conversation with Gemini
|
|
87
|
-
const response = await this.connection.chat(contextMessage, geminiCallback);
|
|
88
|
-
// Add assistant response to history
|
|
89
|
-
this.conversationHistory.push({
|
|
90
|
-
role: 'assistant',
|
|
91
|
-
content: response,
|
|
92
|
-
});
|
|
93
|
-
// Notify final response
|
|
94
|
-
if (onMessage) {
|
|
95
|
-
onMessage('assistant', response);
|
|
96
|
-
}
|
|
97
|
-
return { content: response || '(No response)' };
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
// Silent auto-retry with exponential backoff
|
|
101
|
-
if (retryCount < MAX_RETRIES) {
|
|
102
|
-
// Remove last user message from history to avoid duplication
|
|
103
|
-
if (this.conversationHistory.length > 0 &&
|
|
104
|
-
this.conversationHistory[this.conversationHistory.length - 1]?.role === 'user') {
|
|
105
|
-
this.conversationHistory.pop();
|
|
106
|
-
}
|
|
107
|
-
// Wait before retry (exponential backoff: 1s, 2s, 4s)
|
|
108
|
-
const delayMs = Math.pow(2, retryCount) * 1000;
|
|
109
|
-
await new Promise(resolve => setTimeout(resolve, delayMs));
|
|
110
|
-
// Silent retry - continue with "Continued" message
|
|
111
|
-
return await this.handleUserInput('Continued', options, onMessage, retryCount + 1);
|
|
112
|
-
}
|
|
113
|
-
// Max retries exceeded - throw error to app.tsx
|
|
114
|
-
throw new Error(`Agent failed after ${MAX_RETRIES} retries: ${error instanceof Error ? error.message : String(error)}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Clear conversation history
|
|
119
|
-
*/
|
|
120
|
-
clearHistory() {
|
|
121
|
-
this.conversationHistory = [];
|
|
122
|
-
// Call clearHistory on connection if available
|
|
123
|
-
if ('clearHistory' in this.connection && typeof this.connection.clearHistory === 'function') {
|
|
124
|
-
this.connection.clearHistory();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get conversation history
|
|
129
|
-
*/
|
|
130
|
-
getHistory() {
|
|
131
|
-
return [...this.conversationHistory];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// Singleton instance with lazy initialization
|
|
135
|
-
let _geminiAgent = null;
|
|
136
|
-
export const geminiAgent = {
|
|
137
|
-
get instance() {
|
|
138
|
-
if (!_geminiAgent) {
|
|
139
|
-
_geminiAgent = new GeminiAgent();
|
|
140
|
-
}
|
|
141
|
-
return _geminiAgent;
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
//# sourceMappingURL=gemini-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-agent.js","sourceRoot":"","sources":["../../src/providers/gemini-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,yBAAyB,EAAC,MAAM,qBAAqB,CAAC;AAoB9D,MAAM,OAAO,WAAW;IACf,UAAU,CAAmB;IAC7B,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC;IACnC,mBAAmB,GAA0B,EAAE,CAAC;IAChD,YAAY,CAAS;IAE7B,+CAA+C;IAC9B,SAAS,GAAG;QAC5B,WAAW;QACX,YAAY;QACZ,WAAW;QACX,WAAW;QACX,aAAa;QACb,YAAY;QACZ,YAAY;QACZ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@@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2025-10-21
|
|
5
|
-
* @modify 2025-10-22
|
|
6
|
-
* @desc AI module exports - orchestrator, agents, and selector
|
|
7
|
-
*/
|
|
8
|
-
export { OrchestratorAgent } from './orchestrator.js';
|
|
9
|
-
export { ClaudeAgent } from './claude-agent.js';
|
|
10
|
-
export { OllamaAgent } from './ollama-agent.js';
|
|
11
|
-
export { GeminiAgent } from './gemini-agent.js';
|
|
12
|
-
export { selectAgent, getAgentDescription, agentSupportsTools, type AgentInterface, } from './agent-selector.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACN,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2025-10-21
|
|
5
|
-
* @modify 2025-10-22
|
|
6
|
-
* @desc AI module exports - orchestrator, agents, and selector
|
|
7
|
-
*/
|
|
8
|
-
export { OrchestratorAgent } from './orchestrator.js';
|
|
9
|
-
export { ClaudeAgent } from './claude-agent.js';
|
|
10
|
-
export { OllamaAgent } from './ollama-agent.js';
|
|
11
|
-
export { GeminiAgent } from './gemini-agent.js';
|
|
12
|
-
export { selectAgent, getAgentDescription, agentSupportsTools, } from './agent-selector.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACN,WAAW,EACX,mBAAmB,EACnB,kBAAkB,GAElB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2025-10-22
|
|
5
|
-
* @modify 2025-10-22
|
|
6
|
-
* @desc Ollama Agent - Self-contained AI orchestrator
|
|
7
|
-
*/
|
|
8
|
-
import { type OllamaModelId } from '../connections/ollama.js';
|
|
9
|
-
import type { Message } from 'ollama';
|
|
10
|
-
import type { AgentConfig } from '../utils/config-manager.js';
|
|
11
|
-
export interface OllamaAgentOptions {
|
|
12
|
-
gitEnabled: boolean;
|
|
13
|
-
testEnabled: boolean;
|
|
14
|
-
}
|
|
15
|
-
export type MessageCallback = (author: 'user' | 'assistant' | 'system' | 'tool', content: string, toolName?: string, toolInfo?: any) => void;
|
|
16
|
-
export declare class OllamaAgent {
|
|
17
|
-
private connection;
|
|
18
|
-
private model;
|
|
19
|
-
private toolsRegistry;
|
|
20
|
-
private conversationHistory;
|
|
21
|
-
private systemPrompt;
|
|
22
|
-
private readonly toolNames;
|
|
23
|
-
constructor(config?: AgentConfig);
|
|
24
|
-
/**
|
|
25
|
-
* Convert tool registry format to Ollama tool format
|
|
26
|
-
*/
|
|
27
|
-
private getOllamaTools;
|
|
28
|
-
/**
|
|
29
|
-
* Handle user input and orchestrate tool calls
|
|
30
|
-
*/
|
|
31
|
-
handleUserInput(input: string, options?: OllamaAgentOptions, onMessage?: MessageCallback, retryCount?: number): Promise<{
|
|
32
|
-
content: string;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Clear conversation history
|
|
36
|
-
*/
|
|
37
|
-
clearHistory(): void;
|
|
38
|
-
/**
|
|
39
|
-
* Get conversation history
|
|
40
|
-
*/
|
|
41
|
-
getHistory(): Message[];
|
|
42
|
-
/**
|
|
43
|
-
* Change model
|
|
44
|
-
*/
|
|
45
|
-
setModel(model: OllamaModelId): void;
|
|
46
|
-
/**
|
|
47
|
-
* Get current model
|
|
48
|
-
*/
|
|
49
|
-
getModel(): OllamaModelId;
|
|
50
|
-
}
|
|
51
|
-
export declare const ollamaAgent: {
|
|
52
|
-
readonly instance: OllamaAgent;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=ollama-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-agent.d.ts","sourceRoot":"","sources":["../../src/providers/ollama-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,QAAQ,CAAA;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,EAChD,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,GAAG,KACX,IAAI,CAAA;AAET,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,YAAY,CAAQ;IAG5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CA0BzB;gBAEW,MAAM,CAAC,EAAE,WAAW;IAShC;;OAEG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;IACG,eAAe,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,kBAAkB,EAC5B,SAAS,CAAC,EAAE,eAAe,EAC3B,UAAU,GAAE,MAAU,GACrB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IA0K/B;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,UAAU,IAAI,OAAO,EAAE;IAIvB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAKpC;;OAEG;IACH,QAAQ,IAAI,aAAa;CAG1B;AAKD,eAAO,MAAM,WAAW;uBACN,WAAW;CAM5B,CAAA"}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2025-10-22
|
|
5
|
-
* @modify 2025-10-22
|
|
6
|
-
* @desc Ollama Agent - Self-contained AI orchestrator
|
|
7
|
-
*/
|
|
8
|
-
import { OllamaConnection } from '../connections/ollama.js';
|
|
9
|
-
import { ToolRegistry } from '../tools/index.js';
|
|
10
|
-
import { buildUniversalAgentPrompt } from '../prompts/index.js';
|
|
11
|
-
export class OllamaAgent {
|
|
12
|
-
connection;
|
|
13
|
-
model;
|
|
14
|
-
toolsRegistry = new ToolRegistry();
|
|
15
|
-
conversationHistory = [];
|
|
16
|
-
systemPrompt;
|
|
17
|
-
// Low-level tools for Ollama to build software
|
|
18
|
-
toolNames = [
|
|
19
|
-
'file_read',
|
|
20
|
-
'file_write',
|
|
21
|
-
'file_tree',
|
|
22
|
-
'file_list',
|
|
23
|
-
'file_search',
|
|
24
|
-
'git_status',
|
|
25
|
-
'git_commit',
|
|
26
|
-
'git_push',
|
|
27
|
-
'git_pull',
|
|
28
|
-
'git_diff',
|
|
29
|
-
'git_log',
|
|
30
|
-
'git_branches',
|
|
31
|
-
'command_run',
|
|
32
|
-
'install_dependencies',
|
|
33
|
-
'test_run',
|
|
34
|
-
'plan_task',
|
|
35
|
-
'progress_reporter',
|
|
36
|
-
// Galaxy UI Integration
|
|
37
|
-
'galaxy_ui_list',
|
|
38
|
-
'galaxy_ui_search',
|
|
39
|
-
'galaxy_ui_get_component',
|
|
40
|
-
'galaxy_ui_categories',
|
|
41
|
-
'galaxy_ui_add',
|
|
42
|
-
'galaxy_ui_init',
|
|
43
|
-
'galaxy_ui_docs',
|
|
44
|
-
];
|
|
45
|
-
constructor(config) {
|
|
46
|
-
this.model = config?.model || 'deepseek-v3.1:671b-cloud';
|
|
47
|
-
this.connection = new OllamaConnection(config);
|
|
48
|
-
// Build system prompt using shared universal prompt
|
|
49
|
-
const toolsContext = this.toolsRegistry.getToolsContext(this.toolNames);
|
|
50
|
-
this.systemPrompt = buildUniversalAgentPrompt(toolsContext);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Convert tool registry format to Ollama tool format
|
|
54
|
-
*/
|
|
55
|
-
getOllamaTools() {
|
|
56
|
-
const tools = this.toolsRegistry.getToolsByNames(this.toolNames);
|
|
57
|
-
return tools.map(tool => ({
|
|
58
|
-
type: 'function',
|
|
59
|
-
function: {
|
|
60
|
-
name: tool.name,
|
|
61
|
-
description: tool.description,
|
|
62
|
-
parameters: tool.inputSchema,
|
|
63
|
-
},
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Handle user input and orchestrate tool calls
|
|
68
|
-
*/
|
|
69
|
-
async handleUserInput(input, options, onMessage, retryCount = 0) {
|
|
70
|
-
const MAX_RETRIES = 3;
|
|
71
|
-
try {
|
|
72
|
-
// Add system context to input
|
|
73
|
-
const contextMessage = options
|
|
74
|
-
? `[System Context: Git=${options.gitEnabled ? 'ON' : 'OFF'}, Test Planning=${options.testEnabled ? 'ON' : 'OFF'}]\n\n${input}`
|
|
75
|
-
: input;
|
|
76
|
-
// Add user message to history
|
|
77
|
-
this.conversationHistory.push({
|
|
78
|
-
role: 'user',
|
|
79
|
-
content: contextMessage,
|
|
80
|
-
});
|
|
81
|
-
// Start conversation loop
|
|
82
|
-
let response = await this.connection.chatWithTools({
|
|
83
|
-
model: this.model,
|
|
84
|
-
messages: [{ role: 'system', content: this.systemPrompt }, ...this.conversationHistory],
|
|
85
|
-
tools: this.getOllamaTools(),
|
|
86
|
-
stream: false,
|
|
87
|
-
});
|
|
88
|
-
// Handle tool use loop until completion
|
|
89
|
-
// Using a high safety limit to prevent infinite loops while allowing full plan execution
|
|
90
|
-
const SAFETY_LIMIT = 100;
|
|
91
|
-
let iteration = 0;
|
|
92
|
-
while (response.message.tool_calls && iteration < SAFETY_LIMIT) {
|
|
93
|
-
iteration++;
|
|
94
|
-
const toolCalls = response.message.tool_calls;
|
|
95
|
-
// Add assistant response to history
|
|
96
|
-
this.conversationHistory.push({
|
|
97
|
-
role: 'assistant',
|
|
98
|
-
content: response.message.content || '',
|
|
99
|
-
tool_calls: toolCalls,
|
|
100
|
-
});
|
|
101
|
-
// Execute tools and collect results
|
|
102
|
-
for (const toolCall of toolCalls) {
|
|
103
|
-
const toolName = toolCall.function.name;
|
|
104
|
-
const toolInput = toolCall.function.arguments;
|
|
105
|
-
// Special handling for plan_task and progress_reporter
|
|
106
|
-
if (toolName === 'plan_task' || toolName === 'progress_reporter') {
|
|
107
|
-
try {
|
|
108
|
-
// Execute tool (it will emit event internally)
|
|
109
|
-
const result = await this.toolsRegistry.executeTool(toolName, toolInput);
|
|
110
|
-
// Convert result to string if needed
|
|
111
|
-
const resultStr = typeof result === 'string' ? result : JSON.stringify(result);
|
|
112
|
-
// Add tool result to history (but don't notify - event already emitted)
|
|
113
|
-
this.conversationHistory.push({
|
|
114
|
-
role: 'tool',
|
|
115
|
-
content: resultStr,
|
|
116
|
-
});
|
|
117
|
-
// After plan_task, remind AI to start executing with progress reporting
|
|
118
|
-
if (toolName === 'plan_task') {
|
|
119
|
-
this.conversationHistory.push({
|
|
120
|
-
role: 'user',
|
|
121
|
-
content: '⚠️ CRITICAL: Now execute EACH step in the plan. After completing EACH step, you MUST call progress_reporter({step: N, status: "success"|"error"}). Start with step 1.',
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
127
|
-
// Add error result to history
|
|
128
|
-
this.conversationHistory.push({
|
|
129
|
-
role: 'tool',
|
|
130
|
-
content: `Error: ${errorMsg}`,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
// Regular tool handling
|
|
136
|
-
try {
|
|
137
|
-
// Execute tool
|
|
138
|
-
const result = await this.toolsRegistry.executeTool(toolName, toolInput);
|
|
139
|
-
// Convert result to string if needed
|
|
140
|
-
const resultStr = typeof result === 'string' ? result : JSON.stringify(result);
|
|
141
|
-
// Add tool result to history
|
|
142
|
-
this.conversationHistory.push({
|
|
143
|
-
role: 'tool',
|
|
144
|
-
content: resultStr,
|
|
145
|
-
});
|
|
146
|
-
// CRITICAL: Force reminder for progress reporting after each tool execution
|
|
147
|
-
// This ensures AI calls progress_reporter after completing each step
|
|
148
|
-
this.conversationHistory.push({
|
|
149
|
-
role: 'user',
|
|
150
|
-
content: '⚠️ MANDATORY: If the tool you just executed was part of a plan step, you MUST immediately call progress_reporter with the step number and status (success/error). Do NOT skip this step.',
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
155
|
-
// Add error result to history
|
|
156
|
-
this.conversationHistory.push({
|
|
157
|
-
role: 'tool',
|
|
158
|
-
content: `Error: ${errorMsg}`,
|
|
159
|
-
});
|
|
160
|
-
// Force reminder even on error
|
|
161
|
-
this.conversationHistory.push({
|
|
162
|
-
role: 'user',
|
|
163
|
-
content: '⚠️ MANDATORY: The tool execution failed. You MUST call progress_reporter with status="error" for this step.',
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
// Continue conversation
|
|
169
|
-
response = await this.connection.chatWithTools({
|
|
170
|
-
model: this.model,
|
|
171
|
-
messages: [{ role: 'system', content: this.systemPrompt }, ...this.conversationHistory],
|
|
172
|
-
tools: this.getOllamaTools(),
|
|
173
|
-
stream: false,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
// Check if we hit the safety limit (likely an issue)
|
|
177
|
-
if (iteration >= SAFETY_LIMIT) {
|
|
178
|
-
// Safety limit reached - agent should complete naturally
|
|
179
|
-
}
|
|
180
|
-
// Extract final text response
|
|
181
|
-
const finalResponse = response.message.content || '';
|
|
182
|
-
// Add final response to history
|
|
183
|
-
this.conversationHistory.push({
|
|
184
|
-
role: 'assistant',
|
|
185
|
-
content: finalResponse,
|
|
186
|
-
});
|
|
187
|
-
// Notify final response
|
|
188
|
-
// if (onMessage) {
|
|
189
|
-
// onMessage('assistant', finalResponse);
|
|
190
|
-
// }
|
|
191
|
-
return { content: finalResponse };
|
|
192
|
-
}
|
|
193
|
-
catch (error) {
|
|
194
|
-
// Silent auto-retry with exponential backoff
|
|
195
|
-
if (retryCount < MAX_RETRIES) {
|
|
196
|
-
// Remove last user message from history to avoid duplication
|
|
197
|
-
if (this.conversationHistory.length > 0 &&
|
|
198
|
-
this.conversationHistory[this.conversationHistory.length - 1]?.role === 'user') {
|
|
199
|
-
this.conversationHistory.pop();
|
|
200
|
-
}
|
|
201
|
-
// Wait before retry (exponential backoff: 1s, 2s, 4s)
|
|
202
|
-
// const delayMs = Math.pow(2, retryCount) * 1000;
|
|
203
|
-
await new Promise(resolve => setTimeout(resolve, 100000));
|
|
204
|
-
// Silent retry - continue with "Continued" message
|
|
205
|
-
return await this.handleUserInput('Continued', options, onMessage, retryCount + 1);
|
|
206
|
-
}
|
|
207
|
-
// Max retries exceeded - throw error to app.tsx
|
|
208
|
-
throw new Error(`Đang bị lỗi. Hãy thử lại sau: `);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Clear conversation history
|
|
213
|
-
*/
|
|
214
|
-
clearHistory() {
|
|
215
|
-
this.conversationHistory = [];
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Get conversation history
|
|
219
|
-
*/
|
|
220
|
-
getHistory() {
|
|
221
|
-
return [...this.conversationHistory];
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Change model
|
|
225
|
-
*/
|
|
226
|
-
setModel(model) {
|
|
227
|
-
this.model = model;
|
|
228
|
-
this.connection = new OllamaConnection({ model });
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Get current model
|
|
232
|
-
*/
|
|
233
|
-
getModel() {
|
|
234
|
-
return this.model;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
// Singleton instance with lazy initialization
|
|
238
|
-
let _ollamaAgent = null;
|
|
239
|
-
export const ollamaAgent = {
|
|
240
|
-
get instance() {
|
|
241
|
-
if (!_ollamaAgent) {
|
|
242
|
-
_ollamaAgent = new OllamaAgent();
|
|
243
|
-
}
|
|
244
|
-
return _ollamaAgent;
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
//# sourceMappingURL=ollama-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-agent.js","sourceRoot":"","sources":["../../src/providers/ollama-agent.ts"],"names":[],"mappings":"AAAA;;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AAG,EAAE,CAAA;gBAChC,CAAC;gBAED,sDAAsD;gBACtD,kDAAkD;gBAClD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;gBAEzD,mDAAmD;gBACnD,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,GAAG,CAAC,CAAC,CAAA;YACpF,CAAC;YAED,gDAAgD;YAChD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAA;IAC/B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAAoB;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IACnD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF;AAED,8CAA8C;AAC9C,IAAI,YAAY,GAAuB,IAAI,CAAA;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,QAAQ;QACV,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,YAAY,GAAG,IAAI,WAAW,EAAE,CAAA;QAClC,CAAC;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;CACF,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ToolExecutionInfo } from '../connections/types.js';
|
|
2
|
-
export interface OrchestratorOptions {
|
|
3
|
-
gitEnabled: boolean;
|
|
4
|
-
testEnabled: boolean;
|
|
5
|
-
}
|
|
6
|
-
export type MessageCallback = (author: 'user' | 'assistant' | 'system' | 'tool', content: string, toolName?: string, toolInfo?: ToolExecutionInfo) => void;
|
|
7
|
-
export declare class OrchestratorAgent {
|
|
8
|
-
private toolsRegistry;
|
|
9
|
-
private connection;
|
|
10
|
-
private tools;
|
|
11
|
-
constructor();
|
|
12
|
-
private getConnection;
|
|
13
|
-
handleUserInput(input: string, options?: OrchestratorOptions, onMessage?: MessageCallback): Promise<{
|
|
14
|
-
content: string;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/providers/orchestrator.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAI/D,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,CAC7B,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,EAChD,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,iBAAiB,KACxB,IAAI,CAAC;AAEV,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,KAAK,CAaX;;IAMF,OAAO,CAAC,aAAa;IAwBf,eAAe,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,mBAAmB,EAC7B,SAAS,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC;CAmB7B"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Bùi Trọng Hiếu
|
|
3
|
-
* @email kevinbui210191@gmail.com
|
|
4
|
-
* @create 2024-10-08
|
|
5
|
-
* @modify 2024-10-13
|
|
6
|
-
* @desc Orchestrator agent leveraging Gemini and registered tools.
|
|
7
|
-
*/
|
|
8
|
-
import { GeminiConnection } from '../connections/gemini.js';
|
|
9
|
-
import { ToolRegistry } from '../tools/index.js';
|
|
10
|
-
import { orchestratorSystemPrompt } from '../prompts/orchestrator.js';
|
|
11
|
-
export class OrchestratorAgent {
|
|
12
|
-
toolsRegistry = new ToolRegistry();
|
|
13
|
-
connection = null;
|
|
14
|
-
tools = [
|
|
15
|
-
'ba_it_analyze',
|
|
16
|
-
'code_generate',
|
|
17
|
-
'file_list',
|
|
18
|
-
'file_search',
|
|
19
|
-
'file_tree',
|
|
20
|
-
'command_run',
|
|
21
|
-
'file_read',
|
|
22
|
-
'file_write',
|
|
23
|
-
'plan_task',
|
|
24
|
-
'git_status',
|
|
25
|
-
'git_commit',
|
|
26
|
-
'git_push',
|
|
27
|
-
];
|
|
28
|
-
constructor() {
|
|
29
|
-
// Lazy initialization - only create connection when needed
|
|
30
|
-
}
|
|
31
|
-
getConnection() {
|
|
32
|
-
if (!this.connection) {
|
|
33
|
-
// Special case: OrchestratorAgent gets apiKey directly from process.env
|
|
34
|
-
const apiKey = process.env['GOOGLE_AI_API_KEY'] || process.env['GEMINI_API_KEY'];
|
|
35
|
-
if (!apiKey) {
|
|
36
|
-
throw new Error('OrchestratorAgent requires GOOGLE_AI_API_KEY or GEMINI_API_KEY in environment variables');
|
|
37
|
-
}
|
|
38
|
-
const systemPrompt = orchestratorSystemPrompt(this.toolsRegistry.getToolsContext(this.tools));
|
|
39
|
-
this.connection = new GeminiConnection({
|
|
40
|
-
type: 'gemini',
|
|
41
|
-
model: 'gemini-2.5-flash',
|
|
42
|
-
apiKey: apiKey,
|
|
43
|
-
}, systemPrompt);
|
|
44
|
-
}
|
|
45
|
-
return this.connection;
|
|
46
|
-
}
|
|
47
|
-
async handleUserInput(input, options, onMessage) {
|
|
48
|
-
try {
|
|
49
|
-
// Pass options to plan_task via context
|
|
50
|
-
const contextMessage = options
|
|
51
|
-
? `[System Context: Git=${options.gitEnabled ? 'ON' : 'OFF'}, Test Planning=${options.testEnabled ? 'ON' : 'OFF'}]\n\n${input}`
|
|
52
|
-
: input;
|
|
53
|
-
const result = await this.getConnection().chat(contextMessage, onMessage);
|
|
54
|
-
const content = result?.trim() || '(No response)';
|
|
55
|
-
return { content };
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
}
|
|
59
|
-
return { content: '(Error occurred)' }; // Fallback in case of error
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../src/providers/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAcpE,MAAM,OAAO,iBAAiB;IACrB,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC;IACnC,UAAU,GAA4B,IAAI,CAAC;IAC3C,KAAK,GAAG;QACf,eAAe;QACf,eAAe;QACf,WAAW;QACX,aAAa;QACb,WAAW;QACX,aAAa;QACb,WAAW;QACX,YAAY;QACZ,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,UAAU;KACV,CAAC;IAEF;QACC,2DAA2D;IAC5D,CAAC;IAEO,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACtB,wEAAwE;YACxE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YAEjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb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