File tree Expand file tree Collapse file tree
packages/opencode/src/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://opencode.ai/config.json" ,
3+ "mcp" : {
4+ "weather" : {
5+ "type" : " local" ,
6+ "command" : [" opencode" , " x" , " @h1deya/mcp-server-weather" ]
7+ }
8+ },
39 "experimental" : {
410 "hook" : {
511 "file_edited" : {
Original file line number Diff line number Diff line change @@ -496,14 +496,20 @@ export namespace Session {
496496 const execute = item . execute
497497 if ( ! execute ) continue
498498 item . execute = async ( args , opts ) => {
499- try {
500- const result = await execute ( args , opts )
501- return result . content
502- . filter ( ( x : any ) => x . type === "text" )
503- . map ( ( x : any ) => x . text )
504- . join ( "\n\n" )
505- } catch ( e : any ) {
506- return e . toString ( )
499+ const result = await execute ( args , opts )
500+ const output = result . content
501+ . filter ( ( x : any ) => x . type === "text" )
502+ . map ( ( x : any ) => x . text )
503+ . join ( "\n\n" )
504+
505+ return {
506+ output,
507+ }
508+ }
509+ item . toModelOutput = ( result ) => {
510+ return {
511+ type : "text" ,
512+ value : result . output ,
507513 }
508514 }
509515 tools [ key ] = item
You can’t perform that action at this time.
0 commit comments