@@ -12,10 +12,10 @@ The `subAgent` tool creates a sub-agent that runs synchronously until completion
1212``` typescript
1313subAgent ({
1414 description: " A brief description of the sub-agent's purpose" ,
15- goal: " The main objective that the sub-agent needs to achieve" ,
16- projectContext: " Context about the problem or environment" ,
17- workingDirectory: " /path/to/working/directory" , // optional
18- relevantFilesDirectories: " src/**/*.ts" , // optional
15+ goal: ' The main objective that the sub-agent needs to achieve' ,
16+ projectContext: ' Context about the problem or environment' ,
17+ workingDirectory: ' /path/to/working/directory' , // optional
18+ relevantFilesDirectories: ' src/**/*.ts' , // optional
1919});
2020```
2121
@@ -35,10 +35,10 @@ The `agentStart` tool creates a sub-agent and immediately returns an instance ID
3535``` typescript
3636const { instanceId } = agentStart ({
3737 description: " A brief description of the sub-agent's purpose" ,
38- goal: " The main objective that the sub-agent needs to achieve" ,
39- projectContext: " Context about the problem or environment" ,
40- workingDirectory: " /path/to/working/directory" , // optional
41- relevantFilesDirectories: " src/**/*.ts" , // optional
38+ goal: ' The main objective that the sub-agent needs to achieve' ,
39+ projectContext: ' Context about the problem or environment' ,
40+ workingDirectory: ' /path/to/working/directory' , // optional
41+ relevantFilesDirectories: ' src/**/*.ts' , // optional
4242 enableUserPrompt: false , // optional, default: false
4343});
4444```
@@ -50,22 +50,22 @@ The `agentMessage` tool allows interaction with a running sub-agent. It can be u
5050``` typescript
5151// Check agent progress
5252const { output, completed } = agentMessage ({
53- instanceId: " agent-instance-id" ,
54- description: " Checking agent progress" ,
53+ instanceId: ' agent-instance-id' ,
54+ description: ' Checking agent progress' ,
5555});
5656
5757// Provide guidance (note: guidance implementation is limited in the current version)
5858agentMessage ({
59- instanceId: " agent-instance-id" ,
60- guidance: " Focus on the task at hand and avoid unnecessary exploration" ,
61- description: " Providing guidance to the agent" ,
59+ instanceId: ' agent-instance-id' ,
60+ guidance: ' Focus on the task at hand and avoid unnecessary exploration' ,
61+ description: ' Providing guidance to the agent' ,
6262});
6363
6464// Terminate the agent
6565agentMessage ({
66- instanceId: " agent-instance-id" ,
66+ instanceId: ' agent-instance-id' ,
6767 terminate: true ,
68- description: " Terminating the agent" ,
68+ description: ' Terminating the agent' ,
6969});
7070```
7171
@@ -74,15 +74,15 @@ agentMessage({
7474``` typescript
7575// Start multiple sub-agents
7676const agent1 = agentStart ({
77- description: " Agent 1" ,
78- goal: " Implement feature A" ,
79- projectContext: " Project X" ,
77+ description: ' Agent 1' ,
78+ goal: ' Implement feature A' ,
79+ projectContext: ' Project X' ,
8080});
8181
8282const agent2 = agentStart ({
83- description: " Agent 2" ,
84- goal: " Implement feature B" ,
85- projectContext: " Project X" ,
83+ description: ' Agent 2' ,
84+ goal: ' Implement feature B' ,
85+ projectContext: ' Project X' ,
8686});
8787
8888// Check progress of both agents
@@ -93,27 +93,27 @@ while (!agent1Completed || !agent2Completed) {
9393 if (! agent1Completed ) {
9494 const result1 = agentMessage ({
9595 instanceId: agent1 .instanceId ,
96- description: " Checking Agent 1 progress" ,
96+ description: ' Checking Agent 1 progress' ,
9797 });
9898 agent1Completed = result1 .completed ;
99-
99+
100100 if (agent1Completed ) {
101- console .log (" Agent 1 completed with result:" , result1 .output );
101+ console .log (' Agent 1 completed with result:' , result1 .output );
102102 }
103103 }
104-
104+
105105 if (! agent2Completed ) {
106106 const result2 = agentMessage ({
107107 instanceId: agent2 .instanceId ,
108- description: " Checking Agent 2 progress" ,
108+ description: ' Checking Agent 2 progress' ,
109109 });
110110 agent2Completed = result2 .completed ;
111-
111+
112112 if (agent2Completed ) {
113- console .log (" Agent 2 completed with result:" , result2 .output );
113+ console .log (' Agent 2 completed with result:' , result2 .output );
114114 }
115115 }
116-
116+
117117 // Wait before checking again
118118 if (! agent1Completed || ! agent2Completed ) {
119119 sleep ({ seconds: 5 });
@@ -127,4 +127,4 @@ while (!agent1Completed || !agent2Completed) {
127127- Use ` agentStart ` and ` agentMessage ` for:
128128 - Parallel execution of multiple sub-agents
129129 - Tasks where you need to monitor progress
130- - Situations where you may need to provide guidance or terminate early
130+ - Situations where you may need to provide guidance or terminate early
0 commit comments