internal/mcp: rename StdIO->Stdio
In CL 682976, Alan Donovan correctly points out that the term in the MCP spec is 'stdio', and therefore the correct capitalization is Stdio. Change-Id: Ib5bbe04f1a61de886298b4d0adc13aefd6aadd9c Reviewed-on: https://go-review.googlesource.com/c/tools/+/683075 Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
f4ed9b5904
commit
a590cfe063
3 changed files with 16 additions and 16 deletions
|
|
@ -33,7 +33,7 @@ func runServer() {
|
|||
server := mcp.NewServer("greeter", "v0.0.1", nil)
|
||||
server.AddTools(mcp.NewServerTool("greet", "say hi", SayHi))
|
||||
|
||||
if err := server.Run(ctx, mcp.NewStdIOTransport()); err != nil {
|
||||
if err := server.Run(ctx, mcp.NewStdioTransport()); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
//
|
||||
// A [Transport] connects a bidirectional [Connection] of jsonrpc2 messages. In
|
||||
// practice, transports in the MCP spec are are either client transports or
|
||||
// server transports. For example, the [StdIOTransport] is a server transport
|
||||
// server transports. For example, the [StdioTransport] is a server transport
|
||||
// that communicates over stdin/stdout, and its counterpart is a
|
||||
// [CommandTransport] that communicates with a subprocess over its
|
||||
// stdin/stdout.
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ type Connection interface {
|
|||
Close() error // may be called concurrently by both peers
|
||||
}
|
||||
|
||||
// A StdIOTransport is a [Transport] that communicates over stdin/stdout using
|
||||
// A StdioTransport is a [Transport] that communicates over stdin/stdout using
|
||||
// newline-delimited JSON.
|
||||
type StdIOTransport struct {
|
||||
type StdioTransport struct {
|
||||
ioTransport
|
||||
}
|
||||
|
||||
|
|
@ -68,10 +68,10 @@ func (t *ioTransport) Connect(context.Context) (Connection, error) {
|
|||
return newIOConn(t.rwc), nil
|
||||
}
|
||||
|
||||
// NewStdIOTransport constructs a transport that communicates over
|
||||
// NewStdioTransport constructs a transport that communicates over
|
||||
// stdin/stdout.
|
||||
func NewStdIOTransport() *StdIOTransport {
|
||||
return &StdIOTransport{ioTransport{rwc{os.Stdin, os.Stdout}}}
|
||||
func NewStdioTransport() *StdioTransport {
|
||||
return &StdioTransport{ioTransport{rwc{os.Stdin, os.Stdout}}}
|
||||
}
|
||||
|
||||
// An InMemoryTransport is a [Transport] that communicates over an in-memory
|
||||
|
|
|
|||
Loading…
Reference in a new issue