galaxy-code 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +2 -1
- package/dist/node_modules/@workspace/agent-core/connections/claude.d.ts +72 -0
- package/dist/node_modules/@workspace/agent-core/connections/claude.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/claude.js +270 -0
- package/dist/node_modules/@workspace/agent-core/connections/claude.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/gemini.d.ts +41 -0
- package/dist/node_modules/@workspace/agent-core/connections/gemini.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/gemini.js +203 -0
- package/dist/node_modules/@workspace/agent-core/connections/gemini.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/index.d.ts +12 -0
- package/dist/node_modules/@workspace/agent-core/connections/index.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/index.js +12 -0
- package/dist/node_modules/@workspace/agent-core/connections/index.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/ollama.d.ts +38 -0
- package/dist/node_modules/@workspace/agent-core/connections/ollama.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/ollama.js +64 -0
- package/dist/node_modules/@workspace/agent-core/connections/ollama.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/types.d.ts +23 -0
- package/dist/node_modules/@workspace/agent-core/connections/types.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/connections/types.js +8 -0
- package/dist/node_modules/@workspace/agent-core/connections/types.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/index.d.ts +13 -0
- package/dist/node_modules/@workspace/agent-core/index.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/index.js +22 -0
- package/dist/node_modules/@workspace/agent-core/index.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/package.json +53 -0
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.d.ts +2 -0
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.js +144 -0
- package/dist/node_modules/@workspace/agent-core/prompts/ba-it-analyzer.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/index.d.ts +12 -0
- package/dist/node_modules/@workspace/agent-core/prompts/index.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/index.js +12 -0
- package/dist/node_modules/@workspace/agent-core/prompts/index.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.d.ts +9 -0
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.js +89 -0
- package/dist/node_modules/@workspace/agent-core/prompts/orchestrator.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.d.ts +9 -0
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.js +196 -0
- package/dist/node_modules/@workspace/agent-core/prompts/planning-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.d.ts +8 -0
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.js +112 -0
- package/dist/node_modules/@workspace/agent-core/prompts/universal-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.d.ts +30 -0
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.js +76 -0
- package/dist/node_modules/@workspace/agent-core/providers/agent-selector.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.d.ts +30 -0
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.js +107 -0
- package/dist/node_modules/@workspace/agent-core/providers/claude-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.d.ts +37 -0
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.js +144 -0
- package/dist/node_modules/@workspace/agent-core/providers/gemini-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/index.d.ts +13 -0
- package/dist/node_modules/@workspace/agent-core/providers/index.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/index.js +13 -0
- package/dist/node_modules/@workspace/agent-core/providers/index.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.d.ts +54 -0
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.js +247 -0
- package/dist/node_modules/@workspace/agent-core/providers/ollama-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.d.ts +17 -0
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.js +62 -0
- package/dist/node_modules/@workspace/agent-core/providers/orchestrator.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.d.ts +67 -0
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.js +81 -0
- package/dist/node_modules/@workspace/agent-core/tools/ba-it-analyzer.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.d.ts +52 -0
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.js +150 -0
- package/dist/node_modules/@workspace/agent-core/tools/code-generate-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.d.ts +15 -0
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.js +121 -0
- package/dist/node_modules/@workspace/agent-core/tools/command-runner.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.d.ts +12 -0
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.js +84 -0
- package/dist/node_modules/@workspace/agent-core/tools/document-parser.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.d.ts +18 -0
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.js +126 -0
- package/dist/node_modules/@workspace/agent-core/tools/file-operations.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.d.ts +95 -0
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.js +245 -0
- package/dist/node_modules/@workspace/agent-core/tools/galaxy-ui-integration.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.d.ts +12 -0
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.js +115 -0
- package/dist/node_modules/@workspace/agent-core/tools/git-operations.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/index.d.ts +11 -0
- package/dist/node_modules/@workspace/agent-core/tools/index.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/index.js +11 -0
- package/dist/node_modules/@workspace/agent-core/tools/index.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.d.ts +30 -0
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.js +125 -0
- package/dist/node_modules/@workspace/agent-core/tools/planning-agent.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.d.ts +20 -0
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.js +46 -0
- package/dist/node_modules/@workspace/agent-core/tools/progress-reporter.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/registry.d.ts +22 -0
- package/dist/node_modules/@workspace/agent-core/tools/registry.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/registry.js +651 -0
- package/dist/node_modules/@workspace/agent-core/tools/registry.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.d.ts +25 -0
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.js +26 -0
- package/dist/node_modules/@workspace/agent-core/tools/tool-event-emitter.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/types.d.ts +32 -0
- package/dist/node_modules/@workspace/agent-core/tools/types.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/tools/types.js +2 -0
- package/dist/node_modules/@workspace/agent-core/tools/types.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/types.d.ts +40 -0
- package/dist/node_modules/@workspace/agent-core/types.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/types.js +9 -0
- package/dist/node_modules/@workspace/agent-core/types.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.d.ts +103 -0
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.js +307 -0
- package/dist/node_modules/@workspace/agent-core/utils/config-manager.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/devtools.d.ts +22 -0
- package/dist/node_modules/@workspace/agent-core/utils/devtools.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/devtools.js +62 -0
- package/dist/node_modules/@workspace/agent-core/utils/devtools.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.d.ts +33 -0
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.js +591 -0
- package/dist/node_modules/@workspace/agent-core/utils/message-formatters.js.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.d.ts +60 -0
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.d.ts.map +1 -0
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.js +204 -0
- package/dist/node_modules/@workspace/agent-core/utils/progress-tracker.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2024-10-08
|
|
5
|
+
* @modify 2024-10-08
|
|
6
|
+
* @desc Ollama connection helper wrapping chat completion endpoint.
|
|
7
|
+
*/
|
|
8
|
+
import { ChatResponse, GenerateResponse, Message } from 'ollama';
|
|
9
|
+
import type { AgentConfig } from '../utils/config-manager.js';
|
|
10
|
+
export declare const ollamaModels: readonly ["deepseek-v3.1:671b-cloud", "gpt-oss:120b-cloud", "qwen3-coder:480b-cloud"];
|
|
11
|
+
export type OllamaModelId = (typeof ollamaModels)[number];
|
|
12
|
+
export type OllamaGenerateParameters = {
|
|
13
|
+
readonly prompt: string;
|
|
14
|
+
readonly model: OllamaModelId;
|
|
15
|
+
readonly system?: string;
|
|
16
|
+
};
|
|
17
|
+
export type OllamaGenerateResult<T = unknown> = {
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly raw: T;
|
|
20
|
+
};
|
|
21
|
+
export declare class OllamaConnection {
|
|
22
|
+
private ollama;
|
|
23
|
+
private model;
|
|
24
|
+
constructor(config?: AgentConfig | {
|
|
25
|
+
model?: OllamaModelId;
|
|
26
|
+
host?: string;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
});
|
|
29
|
+
generate(parameters: OllamaGenerateParameters): Promise<GenerateResponse>;
|
|
30
|
+
chat(userMessage: string): Promise<string>;
|
|
31
|
+
chatWithTools(options: {
|
|
32
|
+
model: string;
|
|
33
|
+
messages: Message[];
|
|
34
|
+
tools?: any[];
|
|
35
|
+
stream?: false;
|
|
36
|
+
}): Promise<ChatResponse>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ollama.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../src/connections/ollama.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,eAAO,MAAM,YAAY,uFAIf,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AACD,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAA;CAChB,CAAA;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,KAAK,CAA4C;gBAC7C,MAAM,CAAC,EAAE,WAAW,GAAG;QAAE,KAAK,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAwBtF,QAAQ,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWzE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAU1C,aAAa,CAAC,OAAO,EAAE;QAC3B,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,OAAO,EAAE,CAAA;QACnB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;QACb,MAAM,CAAC,EAAE,KAAK,CAAA;KACf,GAAG,OAAO,CAAC,YAAY,CAAC;CAQ1B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2024-10-08
|
|
5
|
+
* @modify 2024-10-08
|
|
6
|
+
* @desc Ollama connection helper wrapping chat completion endpoint.
|
|
7
|
+
*/
|
|
8
|
+
import { Ollama } from 'ollama';
|
|
9
|
+
export const ollamaModels = [
|
|
10
|
+
'deepseek-v3.1:671b-cloud',
|
|
11
|
+
'gpt-oss:120b-cloud',
|
|
12
|
+
'qwen3-coder:480b-cloud',
|
|
13
|
+
];
|
|
14
|
+
export class OllamaConnection {
|
|
15
|
+
ollama;
|
|
16
|
+
model = 'deepseek-v3.1:671b-cloud';
|
|
17
|
+
constructor(config) {
|
|
18
|
+
this.model = config?.model ?? this.model;
|
|
19
|
+
const host = config?.host ?? 'https://ollama.com';
|
|
20
|
+
// If using ollama.com cloud, need API key
|
|
21
|
+
const needsApiKey = host === 'https://ollama.com' || host.includes('ollama.com');
|
|
22
|
+
// Only get apiKey from config - no fallback to env
|
|
23
|
+
const apiKey = config?.apiKey;
|
|
24
|
+
// if (needsApiKey && !apiKey) {
|
|
25
|
+
// console.log('Hiện tại bạn chưa thêm apikey cho model ollama. Vui lòng thêm để dùng phần mềm')
|
|
26
|
+
// }
|
|
27
|
+
this.ollama = new Ollama({
|
|
28
|
+
host: host,
|
|
29
|
+
headers: needsApiKey
|
|
30
|
+
? {
|
|
31
|
+
Authorization: 'Bearer ' + apiKey,
|
|
32
|
+
}
|
|
33
|
+
: {},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async generate(parameters) {
|
|
37
|
+
const response = await this.ollama.generate({
|
|
38
|
+
model: parameters.model || this.model,
|
|
39
|
+
prompt: parameters.prompt,
|
|
40
|
+
system: parameters.system,
|
|
41
|
+
stream: false,
|
|
42
|
+
});
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
// Simple chat method for direct conversation (matches GeminiConnection/ClaudeConnection)
|
|
46
|
+
async chat(userMessage) {
|
|
47
|
+
const response = await this.ollama.chat({
|
|
48
|
+
model: this.model,
|
|
49
|
+
messages: [{ role: 'user', content: userMessage }],
|
|
50
|
+
stream: false,
|
|
51
|
+
});
|
|
52
|
+
return response.message.content;
|
|
53
|
+
}
|
|
54
|
+
// Advanced chat with tools (used by ollama-agent)
|
|
55
|
+
async chatWithTools(options) {
|
|
56
|
+
return await this.ollama.chat({
|
|
57
|
+
model: options.model,
|
|
58
|
+
messages: options.messages,
|
|
59
|
+
tools: options.tools,
|
|
60
|
+
stream: false,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=ollama.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ollama.js","sourceRoot":"","sources":["../../src/connections/ollama.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAA2C,MAAM,EAAE,MAAM,QAAQ,CAAA;AAGxE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,0BAA0B;IAC1B,oBAAoB;IACpB,wBAAwB;CAChB,CAAA;AAcV,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAQ;IACd,KAAK,GAAkB,0BAA0B,CAAA;IACzD,YAAY,MAAgF;QAC1F,IAAI,CAAC,KAAK,GAAI,MAAM,EAAE,KAAuB,IAAI,IAAI,CAAC,KAAK,CAAA;QAC3D,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,oBAAoB,CAAA;QAEjD,0CAA0C;QAC1C,MAAM,WAAW,GAAG,IAAI,KAAK,oBAAoB,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;QAEhF,mDAAmD;QACnD,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,CAAA;QAE7B,gCAAgC;QAChC,kGAAkG;QAClG,IAAI;QAEJ,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC;YACvB,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,WAAW;gBAClB,CAAC,CAAC;oBACE,aAAa,EAAE,SAAS,GAAG,MAAM;iBAClC;gBACH,CAAC,CAAC,EAAE;SACP,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAoC;QACjD,MAAM,QAAQ,GAAqB,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC5D,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;YACrC,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QACF,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,yFAAyF;IACzF,KAAK,CAAC,IAAI,CAAC,WAAmB;QAC5B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACtC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;YAClD,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QACF,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,aAAa,CAAC,OAKnB;QACC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2025-10-22
|
|
5
|
+
* @desc Shared types for connection classes
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Tool execution information for callbacks
|
|
9
|
+
* Supports both Gemini and Claude patterns
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolExecutionInfo {
|
|
12
|
+
success?: boolean;
|
|
13
|
+
output?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
toolName?: string;
|
|
16
|
+
args?: any;
|
|
17
|
+
result?: any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Message callback type for agent notifications
|
|
21
|
+
*/
|
|
22
|
+
export type MessageCallback = (author: 'user' | 'assistant' | 'system' | 'tool', content: string, toolName?: string, toolInfo?: ToolExecutionInfo) => void;
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connections/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;CACb;AAED;;GAEG;AACH,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/connections/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @workspace/agent-core
|
|
3
|
+
* Core AI agent functionality - providers, tools, and prompts
|
|
4
|
+
*/
|
|
5
|
+
export * from './providers/index.js';
|
|
6
|
+
export * from './tools/index.js';
|
|
7
|
+
export * from './prompts/index.js';
|
|
8
|
+
export * from './types.js';
|
|
9
|
+
export * from './connections/index.js';
|
|
10
|
+
export * from './utils/config-manager.js';
|
|
11
|
+
export * from './utils/progress-tracker.js';
|
|
12
|
+
export * from './utils/devtools.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,sBAAsB,CAAC;AAGrC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,YAAY,CAAC;AAG3B,cAAc,wBAAwB,CAAC;AAGvC,cAAc,2BAA2B,CAAC;AAI1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @workspace/agent-core
|
|
3
|
+
* Core AI agent functionality - providers, tools, and prompts
|
|
4
|
+
*/
|
|
5
|
+
// Export providers
|
|
6
|
+
export * from './providers/index.js';
|
|
7
|
+
// Export tools
|
|
8
|
+
export * from './tools/index.js';
|
|
9
|
+
// Export prompts
|
|
10
|
+
export * from './prompts/index.js';
|
|
11
|
+
// Export types
|
|
12
|
+
export * from './types.js';
|
|
13
|
+
// Export connections
|
|
14
|
+
export * from './connections/index.js';
|
|
15
|
+
// Export utils
|
|
16
|
+
export * from './utils/config-manager.js';
|
|
17
|
+
// Note: message-formatters is CLI-only (requires 'ink'), not exported from main entry
|
|
18
|
+
// CLI apps can import directly: import { formatMessage } from '@workspace/agent-core/dist/utils/message-formatters.js'
|
|
19
|
+
// export * from './utils/message-formatters.js';
|
|
20
|
+
export * from './utils/progress-tracker.js';
|
|
21
|
+
export * from './utils/devtools.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mBAAmB;AACnB,cAAc,sBAAsB,CAAC;AAErC,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,iBAAiB;AACjB,cAAc,oBAAoB,CAAC;AAEnC,eAAe;AACf,cAAc,YAAY,CAAC;AAE3B,qBAAqB;AACrB,cAAc,wBAAwB,CAAC;AAEvC,eAAe;AACf,cAAc,2BAA2B,CAAC;AAC1C,sFAAsF;AACtF,uHAAuH;AACvH,iDAAiD;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@workspace/agent-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core AI agent functionality - providers, tools, and prompts",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./providers": {
|
|
15
|
+
"types": "./dist/providers/index.d.ts",
|
|
16
|
+
"import": "./dist/providers/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./tools": {
|
|
19
|
+
"types": "./dist/tools/index.d.ts",
|
|
20
|
+
"import": "./dist/tools/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./prompts": {
|
|
23
|
+
"types": "./dist/prompts/index.d.ts",
|
|
24
|
+
"import": "./dist/prompts/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./utils/message-formatters": {
|
|
27
|
+
"types": "./dist/utils/message-formatters.d.ts",
|
|
28
|
+
"import": "./dist/utils/message-formatters.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "tsc --watch",
|
|
34
|
+
"clean": "rm -rf dist",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@anthropic-ai/sdk": "^0.27.0",
|
|
39
|
+
"@google/genai": "^1.21.0",
|
|
40
|
+
"ollama": "^0.6.0",
|
|
41
|
+
"dotenv": "^17.2.3",
|
|
42
|
+
"execa": "^8.0.1",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"ink": "^4.1.0",
|
|
45
|
+
"ink-spinner": "^5.0.0",
|
|
46
|
+
"figlet": "^1.9.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.0.0",
|
|
50
|
+
"@types/react": "^18.0.32",
|
|
51
|
+
"typescript": "^5.0.3"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const systemBAITAnalyzerPrompt = "You are an EXPERT BUSINESS ANALYST for IT projects.\n\n# Your Role:\nAnalyze user requests and create COMPREHENSIVE project specifications including:\n1. Type: create_project (new) or update_project (add feature to existing)\n2. Core Features (must-have vs nice-to-have)\n3. Technical Stack recommendations\n4. User Stories with acceptance criteria\n5. Data Model (entities, attributes, relationships)\n6. API endpoints for backend systems\n7. Complexity + time estimate\n8. Best practices & recommendations\n9. Clarification questions\n\n# Language Rule:\n**ALWAYS respond in ENGLISH** regardless of user's input language.\n- All field values (descriptions, names, recommendations, etc.) MUST be in English\n- This ensures consistent output format for downstream tools (planning, code generation)\n\n# Output Format (VALID JSON - ALL content in English):\n{\n \"type\": \"create_project | update_project\",\n \"projectName\": \"Project name\",\n \"projectType\": \"web-app | mobile-app | api | full-stack | desktop-app\",\n \"description\": \"Brief summary\",\n \"coreFeatures\": [\n {\n \"name\": \"Feature name\",\n \"description\": \"Description\",\n \"priority\": \"must-have | should-have | nice-to-have\",\n \"userStory\": \"As a [user], I want [feature] so that [benefit]\",\n \"acceptanceCriteria\": [\"Criterion 1\", \"Criterion 2\"]\n }\n ],\n \"technicalStack\": {\n \"frontend\": [\"React\", \"TypeScript\"],\n \"backend\": [\"Node.js\", \"Express\"],\n \"database\": [\"PostgreSQL\"],\n \"thirdParty\": [\"Stripe\"]\n },\n \"userStories\": [\n {\n \"as\": \"role\",\n \"iWant\": \"feature\",\n \"soThat\": \"benefit\",\n \"acceptanceCriteria\": [\"Given [context], when [action], then [result]\"]\n }\n ],\n \"dataModel\": [\n {\n \"name\": \"Entity\",\n \"description\": \"Purpose\",\n \"attributes\": [\"id\", \"name\", \"createdAt\"],\n \"relationships\": [\"User has many Orders\"]\n }\n ],\n \"apiEndpoints\": [\n {\n \"method\": \"GET | POST | PUT | DELETE\",\n \"path\": \"/api/resource\",\n \"description\": \"Purpose\",\n \"response\": \"{ data: [] }\"\n }\n ],\n \"estimatedComplexity\": \"simple | medium | complex\",\n \"estimatedTime\": \"1-2 weeks | 2-4 weeks | 1-3 months\",\n \"recommendations\": [\"Recommendation with reasoning\"],\n \"questionsForUser\": [\"Clarification question\"]\n}\n\n# Example:\n\nUser: \"Create an online phone store\"\n\n{\n \"type\": \"create_project\",\n \"projectName\": \"Phone Store E-Commerce\",\n \"projectType\": \"full-stack\",\n \"description\": \"E-commerce platform for selling phones with product catalog, cart, checkout, and order management\",\n \"coreFeatures\": [\n {\n \"name\": \"Product Catalog\",\n \"description\": \"Display phones with images, prices, specs. Filter by brand, price, features. Search by name.\",\n \"priority\": \"must-have\",\n \"userStory\": \"As a customer, I want to browse phones with filters to find suitable products\",\n \"acceptanceCriteria\": [\"Grid/list view\", \"Filter by brand/price\", \"Real-time search\", \"Pagination\"]\n },\n {\n \"name\": \"Shopping Cart\",\n \"description\": \"Add products, update quantity, remove items, calculate total\",\n \"priority\": \"must-have\",\n \"userStory\": \"As a customer, I want to manage my cart to buy multiple products\",\n \"acceptanceCriteria\": [\"Add to cart\", \"Update quantity\", \"Remove items\", \"Calculate total\"]\n }\n ],\n \"technicalStack\": {\n \"frontend\": [\"Next.js\", \"TypeScript\", \"Tailwind\"],\n \"backend\": [\"Node.js\", \"Express\"],\n \"database\": [\"PostgreSQL\", \"Redis\"],\n \"thirdParty\": [\"Stripe\"]\n },\n \"userStories\": [\n {\n \"as\": \"customer\",\n \"iWant\": \"filter products by brand\",\n \"soThat\": \"find phones quickly\",\n \"acceptanceCriteria\": [\"Given home page, when filter 'Samsung', then show Samsung phones\"]\n }\n ],\n \"dataModel\": [\n {\n \"name\": \"Product\",\n \"description\": \"Phone product\",\n \"attributes\": [\"id\", \"name\", \"brand\", \"price\", \"stock\"],\n \"relationships\": [\"Product has many OrderItems\"]\n }\n ],\n \"apiEndpoints\": [\n {\n \"method\": \"GET\",\n \"path\": \"/api/products\",\n \"description\": \"Get product list\",\n \"response\": \"{ products: Product[] }\"\n }\n ],\n \"estimatedComplexity\": \"complex\",\n \"estimatedTime\": \"2-4 weeks\",\n \"recommendations\": [\n \"Use Next.js App Router for SSR and SEO\",\n \"Implement Redis caching for product listing\"\n ],\n \"questionsForUser\": [\n \"Online payment (Stripe) or COD only?\",\n \"Multi-language support needed?\"\n ]\n}\n\nCRITICAL:\n- VALID JSON ONLY (no markdown)\n- COMPREHENSIVE MVP features\n- Use user's language throughout\n- SPECIFIC technical recommendations\n- Realistic feature prioritization";
|
|
2
|
+
//# sourceMappingURL=ba-it-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ba-it-analyzer.d.ts","sourceRoot":"","sources":["../../src/prompts/ba-it-analyzer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,o8JA8IF,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export const systemBAITAnalyzerPrompt = `You are an EXPERT BUSINESS ANALYST for IT projects.
|
|
2
|
+
|
|
3
|
+
# Your Role:
|
|
4
|
+
Analyze user requests and create COMPREHENSIVE project specifications including:
|
|
5
|
+
1. Type: create_project (new) or update_project (add feature to existing)
|
|
6
|
+
2. Core Features (must-have vs nice-to-have)
|
|
7
|
+
3. Technical Stack recommendations
|
|
8
|
+
4. User Stories with acceptance criteria
|
|
9
|
+
5. Data Model (entities, attributes, relationships)
|
|
10
|
+
6. API endpoints for backend systems
|
|
11
|
+
7. Complexity + time estimate
|
|
12
|
+
8. Best practices & recommendations
|
|
13
|
+
9. Clarification questions
|
|
14
|
+
|
|
15
|
+
# Language Rule:
|
|
16
|
+
**ALWAYS respond in ENGLISH** regardless of user's input language.
|
|
17
|
+
- All field values (descriptions, names, recommendations, etc.) MUST be in English
|
|
18
|
+
- This ensures consistent output format for downstream tools (planning, code generation)
|
|
19
|
+
|
|
20
|
+
# Output Format (VALID JSON - ALL content in English):
|
|
21
|
+
{
|
|
22
|
+
"type": "create_project | update_project",
|
|
23
|
+
"projectName": "Project name",
|
|
24
|
+
"projectType": "web-app | mobile-app | api | full-stack | desktop-app",
|
|
25
|
+
"description": "Brief summary",
|
|
26
|
+
"coreFeatures": [
|
|
27
|
+
{
|
|
28
|
+
"name": "Feature name",
|
|
29
|
+
"description": "Description",
|
|
30
|
+
"priority": "must-have | should-have | nice-to-have",
|
|
31
|
+
"userStory": "As a [user], I want [feature] so that [benefit]",
|
|
32
|
+
"acceptanceCriteria": ["Criterion 1", "Criterion 2"]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"technicalStack": {
|
|
36
|
+
"frontend": ["React", "TypeScript"],
|
|
37
|
+
"backend": ["Node.js", "Express"],
|
|
38
|
+
"database": ["PostgreSQL"],
|
|
39
|
+
"thirdParty": ["Stripe"]
|
|
40
|
+
},
|
|
41
|
+
"userStories": [
|
|
42
|
+
{
|
|
43
|
+
"as": "role",
|
|
44
|
+
"iWant": "feature",
|
|
45
|
+
"soThat": "benefit",
|
|
46
|
+
"acceptanceCriteria": ["Given [context], when [action], then [result]"]
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"dataModel": [
|
|
50
|
+
{
|
|
51
|
+
"name": "Entity",
|
|
52
|
+
"description": "Purpose",
|
|
53
|
+
"attributes": ["id", "name", "createdAt"],
|
|
54
|
+
"relationships": ["User has many Orders"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"apiEndpoints": [
|
|
58
|
+
{
|
|
59
|
+
"method": "GET | POST | PUT | DELETE",
|
|
60
|
+
"path": "/api/resource",
|
|
61
|
+
"description": "Purpose",
|
|
62
|
+
"response": "{ data: [] }"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"estimatedComplexity": "simple | medium | complex",
|
|
66
|
+
"estimatedTime": "1-2 weeks | 2-4 weeks | 1-3 months",
|
|
67
|
+
"recommendations": ["Recommendation with reasoning"],
|
|
68
|
+
"questionsForUser": ["Clarification question"]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# Example:
|
|
72
|
+
|
|
73
|
+
User: "Create an online phone store"
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
"type": "create_project",
|
|
77
|
+
"projectName": "Phone Store E-Commerce",
|
|
78
|
+
"projectType": "full-stack",
|
|
79
|
+
"description": "E-commerce platform for selling phones with product catalog, cart, checkout, and order management",
|
|
80
|
+
"coreFeatures": [
|
|
81
|
+
{
|
|
82
|
+
"name": "Product Catalog",
|
|
83
|
+
"description": "Display phones with images, prices, specs. Filter by brand, price, features. Search by name.",
|
|
84
|
+
"priority": "must-have",
|
|
85
|
+
"userStory": "As a customer, I want to browse phones with filters to find suitable products",
|
|
86
|
+
"acceptanceCriteria": ["Grid/list view", "Filter by brand/price", "Real-time search", "Pagination"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "Shopping Cart",
|
|
90
|
+
"description": "Add products, update quantity, remove items, calculate total",
|
|
91
|
+
"priority": "must-have",
|
|
92
|
+
"userStory": "As a customer, I want to manage my cart to buy multiple products",
|
|
93
|
+
"acceptanceCriteria": ["Add to cart", "Update quantity", "Remove items", "Calculate total"]
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"technicalStack": {
|
|
97
|
+
"frontend": ["Next.js", "TypeScript", "Tailwind"],
|
|
98
|
+
"backend": ["Node.js", "Express"],
|
|
99
|
+
"database": ["PostgreSQL", "Redis"],
|
|
100
|
+
"thirdParty": ["Stripe"]
|
|
101
|
+
},
|
|
102
|
+
"userStories": [
|
|
103
|
+
{
|
|
104
|
+
"as": "customer",
|
|
105
|
+
"iWant": "filter products by brand",
|
|
106
|
+
"soThat": "find phones quickly",
|
|
107
|
+
"acceptanceCriteria": ["Given home page, when filter 'Samsung', then show Samsung phones"]
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"dataModel": [
|
|
111
|
+
{
|
|
112
|
+
"name": "Product",
|
|
113
|
+
"description": "Phone product",
|
|
114
|
+
"attributes": ["id", "name", "brand", "price", "stock"],
|
|
115
|
+
"relationships": ["Product has many OrderItems"]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"apiEndpoints": [
|
|
119
|
+
{
|
|
120
|
+
"method": "GET",
|
|
121
|
+
"path": "/api/products",
|
|
122
|
+
"description": "Get product list",
|
|
123
|
+
"response": "{ products: Product[] }"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"estimatedComplexity": "complex",
|
|
127
|
+
"estimatedTime": "2-4 weeks",
|
|
128
|
+
"recommendations": [
|
|
129
|
+
"Use Next.js App Router for SSR and SEO",
|
|
130
|
+
"Implement Redis caching for product listing"
|
|
131
|
+
],
|
|
132
|
+
"questionsForUser": [
|
|
133
|
+
"Online payment (Stripe) or COD only?",
|
|
134
|
+
"Multi-language support needed?"
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
CRITICAL:
|
|
139
|
+
- VALID JSON ONLY (no markdown)
|
|
140
|
+
- COMPREHENSIVE MVP features
|
|
141
|
+
- Use user's language throughout
|
|
142
|
+
- SPECIFIC technical recommendations
|
|
143
|
+
- Realistic feature prioritization`;
|
|
144
|
+
//# sourceMappingURL=ba-it-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ba-it-analyzer.js","sourceRoot":"","sources":["../../src/prompts/ba-it-analyzer.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA8IL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2024-10-08
|
|
5
|
+
* @modify 2024-10-08
|
|
6
|
+
* @desc Barrel exports for prompt definitions.
|
|
7
|
+
*/
|
|
8
|
+
export * from './orchestrator.js';
|
|
9
|
+
export * from './universal-agent.js';
|
|
10
|
+
export * from './planning-agent.js';
|
|
11
|
+
export * from './ba-it-analyzer.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2024-10-08
|
|
5
|
+
* @modify 2024-10-08
|
|
6
|
+
* @desc Barrel exports for prompt definitions.
|
|
7
|
+
*/
|
|
8
|
+
export * from './orchestrator.js';
|
|
9
|
+
export * from './universal-agent.js';
|
|
10
|
+
export * from './planning-agent.js';
|
|
11
|
+
export * from './ba-it-analyzer.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 System prompt for orchestrator agent with code generation action execution.
|
|
7
|
+
*/
|
|
8
|
+
export declare const orchestratorSystemPrompt: (toolsList: string) => string;
|
|
9
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/prompts/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACpC,WAAW,MAAM,KACf,MAgFqD,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 System prompt for orchestrator agent with code generation action execution.
|
|
7
|
+
*/
|
|
8
|
+
export const orchestratorSystemPrompt = (toolsList) => `You are Galaxy Orchestrator.
|
|
9
|
+
|
|
10
|
+
# Working Directory: ${process.cwd()}
|
|
11
|
+
|
|
12
|
+
# System Context (Automatically Injected):
|
|
13
|
+
User messages may contain: [System Context: Test Planning=ON/OFF, Review Planning=ON/OFF]
|
|
14
|
+
- This context is passed to plan_task automatically
|
|
15
|
+
- Planning agent will conditionally add test/review steps based on these flags
|
|
16
|
+
- You don't need to handle this - just pass the message as-is
|
|
17
|
+
|
|
18
|
+
${toolsList}
|
|
19
|
+
|
|
20
|
+
# CRITICAL WORKFLOWS
|
|
21
|
+
|
|
22
|
+
## Workflow 1: ANALYZE EXISTING PROJECT
|
|
23
|
+
**Trigger**: "Analyze this project", "Explain this codebase"
|
|
24
|
+
**Steps**:
|
|
25
|
+
1. file_tree → Get project structure
|
|
26
|
+
2. file_read → Understand tech stack
|
|
27
|
+
3. Present comprehensive analysis
|
|
28
|
+
|
|
29
|
+
## Workflow 2: CREATE NEW PROJECT
|
|
30
|
+
**Steps**:
|
|
31
|
+
1. ba_it_analyze → Analyze requirements
|
|
32
|
+
2. Present analysis → Wait for approval
|
|
33
|
+
3. plan_task → Generate implementation plan
|
|
34
|
+
4. Execute plan using code_generate
|
|
35
|
+
5. Execute actions from code_generate
|
|
36
|
+
|
|
37
|
+
## Workflow 3: CODE GENERATION ACTION EXECUTION
|
|
38
|
+
|
|
39
|
+
When code_generate returns actions array, execute EACH action sequentially:
|
|
40
|
+
|
|
41
|
+
Action Types:
|
|
42
|
+
- read_file → Call file_read(path)
|
|
43
|
+
- write_file → Call file_write(path, content)
|
|
44
|
+
- run_command → Call command_run(command, cwd)
|
|
45
|
+
- search_files → Call file_search(path, pattern)
|
|
46
|
+
|
|
47
|
+
Execution Rules:
|
|
48
|
+
- Execute sequentially (one by one)
|
|
49
|
+
- Continue even if one fails (log error)
|
|
50
|
+
- After ALL actions complete, report progress
|
|
51
|
+
- Do NOT skip actions
|
|
52
|
+
|
|
53
|
+
Progress Reporting Format:
|
|
54
|
+
Step N: [featureName] - Completed
|
|
55
|
+
Files created: [list]
|
|
56
|
+
Commands run: [list]
|
|
57
|
+
|
|
58
|
+
# DECISION LOGIC
|
|
59
|
+
|
|
60
|
+
**Use ba_it_analyze when:**
|
|
61
|
+
- NEW project creation (always!)
|
|
62
|
+
- Adding MAJOR features
|
|
63
|
+
- User request is BROAD/UNCLEAR
|
|
64
|
+
|
|
65
|
+
**Use plan_task when:**
|
|
66
|
+
- After user confirms BA analysis
|
|
67
|
+
- Multi-step implementation needed
|
|
68
|
+
|
|
69
|
+
**Use code_generate when:**
|
|
70
|
+
- Implementing features from plan
|
|
71
|
+
- Returns actions → Execute each action
|
|
72
|
+
|
|
73
|
+
# CRITICAL RULES
|
|
74
|
+
|
|
75
|
+
1. Match user's language
|
|
76
|
+
2. "This project" = Working Directory
|
|
77
|
+
3. ANALYZE existing: file_tree + file_read
|
|
78
|
+
4. NEW projects: ba_it_analyze first
|
|
79
|
+
5. Execute ALL actions from code_generate
|
|
80
|
+
6. Report progress after each step
|
|
81
|
+
7. NEVER call ba_it_analyze twice
|
|
82
|
+
8. DISPLAY ALL FIELDS after BA analysis
|
|
83
|
+
9. Use code_generate for coding
|
|
84
|
+
|
|
85
|
+
# RESPONSE FORMAT
|
|
86
|
+
|
|
87
|
+
**With tools**: Brief statement → Execute → Summary
|
|
88
|
+
**Without tools**: Clear explanation in user's language`;
|
|
89
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../src/prompts/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,SAAiB,EACR,EAAE,CAAC;;uBAEU,OAAO,CAAC,GAAG,EAAE;;;;;;;;EAQlC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAsE6C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create 2024-10-08
|
|
5
|
+
* @modify 2024-10-09
|
|
6
|
+
* @desc Planning Agent - Simple execution plans
|
|
7
|
+
*/
|
|
8
|
+
export declare const planningSystemPrompt: () => string;
|
|
9
|
+
//# sourceMappingURL=planning-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planning-agent.d.ts","sourceRoot":"","sources":["../../src/prompts/planning-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cA4L0C,CAAC"}
|