@@ -42,7 +42,7 @@ const returnSchema = z.union([
42
42
error : z . string ( ) . optional ( ) ,
43
43
} )
44
44
. describe (
45
- "Synchronous execution results when command completes within timeout" ,
45
+ "Synchronous execution results when command completes within timeout"
46
46
) ,
47
47
z
48
48
. object ( {
@@ -58,6 +58,8 @@ const returnSchema = z.union([
58
58
type Parameters = z . infer < typeof parameterSchema > ;
59
59
type ReturnType = z . infer < typeof returnSchema > ;
60
60
61
+ const DEFAULT_TIMEOUT = 100 ;
62
+
61
63
export const shellStartTool : Tool < Parameters , ReturnType > = {
62
64
name : "shellStart" ,
63
65
description :
@@ -66,8 +68,8 @@ export const shellStartTool: Tool<Parameters, ReturnType> = {
66
68
returns : zodToJsonSchema ( returnSchema ) ,
67
69
68
70
execute : async (
69
- { command, timeout = 100 } ,
70
- { logger } ,
71
+ { command, timeout = DEFAULT_TIMEOUT } ,
72
+ { logger }
71
73
) : Promise < ReturnType > => {
72
74
logger . verbose ( `Starting shell command: ${ command } ` ) ;
73
75
@@ -122,7 +124,7 @@ export const shellStartTool: Tool<Parameters, ReturnType> = {
122
124
123
125
process . on ( "exit" , ( code , signal ) => {
124
126
logger . verbose (
125
- `[${ instanceId } ] Process exited with code ${ code } and signal ${ signal } ` ,
127
+ `[${ instanceId } ] Process exited with code ${ code } and signal ${ signal } `
126
128
) ;
127
129
128
130
processState . state . completed = true ;
@@ -170,9 +172,12 @@ export const shellStartTool: Tool<Parameters, ReturnType> = {
170
172
} ) ;
171
173
} ,
172
174
173
- logParameters : ( input , { logger } ) => {
175
+ logParameters : (
176
+ { command, description, timeout = DEFAULT_TIMEOUT } ,
177
+ { logger }
178
+ ) => {
174
179
logger . info (
175
- `Starting "${ input . command } ", ${ input . description } (timeout: ${ input . timeout } ms)` ,
180
+ `Starting "${ command } ", ${ description } (timeout: ${ timeout } ms)`
176
181
) ;
177
182
} ,
178
183
logReturns : ( output , { logger } ) => {
0 commit comments