Skip to content

Commit 670a10b

Browse files
committed
fix: shell message should reset output on each read
1 parent e20f001 commit 670a10b

File tree

10 files changed

+20
-73
lines changed

10 files changed

+20
-73
lines changed

packages/agent/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Tools - IO
22

3-
export * from './tools/io/fetch.js';
3+
export * from './tools/fetch/fetch.js';
44

55
// Tools - System
66
export * from './tools/shell/shellStart.js';
7-
export * from './tools/system/sleep.js';
8-
export * from './tools/system/respawn.js';
7+
export * from './tools/sleep/sleep.js';
98
export * from './tools/agent/agentDone.js';
109
export * from './tools/shell/shellMessage.js';
1110
export * from './tools/shell/shellExecute.js';

packages/agent/src/tools/agent/agentMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ export const agentMessageTool: Tool<Parameters, ReturnType> = {
110110
);
111111
}
112112

113-
// Get the current output
113+
// Get the current output, reset it to an empty string
114114
const output =
115115
agentState.result?.result || agentState.output || 'No output yet';
116+
agentState.output = '';
116117

117118
return {
118119
output,

packages/agent/src/tools/getTools.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ import { Tool } from '../core/types.js';
33

44
// Import tools
55
import { agentDoneTool } from './agent/agentDone.js';
6-
import { agentExecuteTool } from './agent/agentExecute.js';
6+
import { agentMessageTool } from './agent/agentMessage.js';
7+
import { agentStartTool } from './agent/agentStart.js';
78
import { listAgentsTool } from './agent/listAgents.js';
9+
import { fetchTool } from './fetch/fetch.js';
810
import { userPromptTool } from './interaction/userPrompt.js';
9-
import { fetchTool } from './io/fetch.js';
10-
import { textEditorTool } from './io/textEditor.js';
1111
import { createMcpTool } from './mcp.js';
1212
import { listSessionsTool } from './session/listSessions.js';
1313
import { sessionMessageTool } from './session/sessionMessage.js';
1414
import { sessionStartTool } from './session/sessionStart.js';
1515
import { listShellsTool } from './shell/listShells.js';
1616
import { shellMessageTool } from './shell/shellMessage.js';
1717
import { shellStartTool } from './shell/shellStart.js';
18-
import { sleepTool } from './system/sleep.js';
18+
import { sleepTool } from './sleep/sleep.js';
19+
import { textEditorTool } from './textEditor/textEditor.js';
1920

2021
// Import these separately to avoid circular dependencies
2122

@@ -31,20 +32,24 @@ export function getTools(options?: GetToolsOptions): Tool[] {
3132
// Force cast to Tool type to avoid TypeScript issues
3233
const tools: Tool[] = [
3334
textEditorTool as unknown as Tool,
34-
agentExecuteTool as unknown as Tool,
35-
listSessionsTool as unknown as Tool,
36-
/*agentStartTool as unknown as Tool,
37-
agentMessageTool as unknown as Tool,*/
35+
36+
//agentExecuteTool as unknown as Tool,
37+
agentStartTool as unknown as Tool,
38+
agentMessageTool as unknown as Tool,
39+
listAgentsTool as unknown as Tool,
3840
agentDoneTool as unknown as Tool,
41+
3942
fetchTool as unknown as Tool,
43+
4044
shellStartTool as unknown as Tool,
4145
shellMessageTool as unknown as Tool,
46+
listShellsTool as unknown as Tool,
47+
4248
sessionStartTool as unknown as Tool,
4349
sessionMessageTool as unknown as Tool,
44-
//respawnTool as unknown as Tool, this is a confusing tool for now.
50+
listSessionsTool as unknown as Tool,
51+
4552
sleepTool as unknown as Tool,
46-
listShellsTool as unknown as Tool,
47-
listAgentsTool as unknown as Tool,
4853
];
4954

5055
// Only include userPrompt tool if enabled

packages/agent/src/tools/system/respawn.test.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/agent/src/tools/system/respawn.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)