88} from '../commands/command-surface.ts' ;
99import type { JsonSchema } from '../commands/command-contract.ts' ;
1010
11- export type ToolResult = {
11+ type ToolResult = {
1212 isError : boolean ;
1313 structuredContent ?: unknown ;
1414 content : Array < { type : 'text' ; text : string } > ;
@@ -19,7 +19,7 @@ type CommandToolExecutorDeps = {
1919 runCommand : ( client : AgentDeviceClient , name : CommandName , input : unknown ) => Promise < unknown > ;
2020} ;
2121
22- export type CommandToolExecutor = {
22+ type CommandToolExecutor = {
2323 execute : ( name : string , input : unknown ) => Promise < ToolResult > ;
2424} ;
2525
@@ -31,7 +31,7 @@ export function listCommandTools(): Array<{
3131 return listMcpToolDefinitions ( ) . map ( ( definition ) => ( {
3232 name : definition . name ,
3333 description : definition . description ,
34- inputSchema : definition . inputSchema ,
34+ inputSchema : withMcpConfigSchema ( definition . inputSchema ) ,
3535 } ) ) ;
3636}
3737
@@ -75,6 +75,16 @@ function stripClientConfigFields(input: unknown): unknown {
7575 return commandInput ;
7676}
7777
78+ function withMcpConfigSchema ( schema : JsonSchema ) : JsonSchema {
79+ return {
80+ ...schema ,
81+ properties : {
82+ ...schema . properties ,
83+ stateDir : { type : 'string' , description : 'Agent-device state directory.' } ,
84+ } ,
85+ } ;
86+ }
87+
7888function renderToolText ( value : unknown ) : string {
7989 return typeof value === 'string' ? value : JSON . stringify ( value , null , 2 ) ;
8090}
0 commit comments