From 47141c764d147b378c75dde341bb547cdf452ae6 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 29 Jul 2026 23:23:51 +0200 Subject: [PATCH] =?UTF-8?q?delete=20Decl/RemoteDecl=20=E2=80=94=20callers?= =?UTF-8?q?=20use=20New()=20directly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolsrv/remote.go | 35 ----------------------------------- toolsrv/server.go | 10 ---------- 2 files changed, 45 deletions(-) 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.