index.ts
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Agent } from 'evoltagent';
import type { ModelConfig } from 'evoltagent';
import { LAUNCH_AGENT_PROMPT } from './prompt';
import { getModelConfig } from '../../utils/config';
import { AGENT_CONTEXT_WINDOW_TOKENS, MAX_OUTPUT_TOKENS } from '../../constants';
import { parseLaunchResult } from './utils';
export { launchAgentInstruction } from './instruction';
export type { LaunchAgentResult } from './types';
export function createLaunchAgent(): Agent {
const modelConfig: ModelConfig = {
...getModelConfig(),
contextWindowTokens: AGENT_CONTEXT_WINDOW_TOKENS,
maxOutputTokens: MAX_OUTPUT_TOKENS,
};
return new Agent({
name: 'LaunchAgent',
profile: 'Expert DevOps and Frontend Engineer specialist in launching projects and troubleshooting build/runtime issues.',
system: LAUNCH_AGENT_PROMPT,
tools: [
'CommandLineTool.execute',
'CommandLineTool.list',
'CommandLineTool.stop',
'LaunchTool.startDevServer',
'LaunchTool.stopDevServer',
'FileEditor.read',
'FileEditor.find',
'FileEditor.findAndReplace',
'FileEditor.write',
],
modelConfig,
verbose: 2,
postProcessor: parseLaunchResult,
});
}