diff --git a/toolsrv/remote.go b/toolsrv/remote.go index cf81b7f..1ee3731 100644 --- a/toolsrv/remote.go +++ b/toolsrv/remote.go @@ -421,38 +421,3 @@ func shellEscape(s string) string { return "'" + strings.ReplaceAll(s, "'", "'\\''") + "'" } -// Decl returns a factory function for remote tool servers. -// It dials the remote on first call and returns a Runner. -func RemoteDecl(cfg RemoteConfig) func() Runner { - var ( - once sync.Once - server *RemoteServer - err error - ) - return func() Runner { - once.Do(func() { - server, err = RemoteDial(context.Background(), cfg) - if err != nil { - // Return a stub that errors on every call - server = nil - } - }) - if server == nil { - return &errRunner{err: err} - } - return server - } -} - -// errRunner is a Runner that returns an error for every call. -type errRunner struct { - err error -} - -func (e *errRunner) ListTools() ([]ToolInfo, error) { - return nil, e.err -} - -func (e *errRunner) CallTool(_ context.Context, _ string, _ json.RawMessage) (json.RawMessage, error) { - return nil, e.err -} diff --git a/toolsrv/server.go b/toolsrv/server.go index 923dd02..6caf1e2 100644 --- a/toolsrv/server.go +++ b/toolsrv/server.go @@ -135,16 +135,6 @@ func WithSkillsRegistry(r *skills.Registry) Option { return func(s *Server) { s.skillsRegistry = r } } -// Decl returns a factory for an execute Server with the given working directory. -func Decl(cwd string, opts ...Option) func() Runner { - return func() Runner { - s := New(cwd) - for _, o := range opts { - o(s) - } - return s - } -} // ListTools implements Server, returning shell plus any // tools promoted in the session's tool registry.