Documentation
¶
Index ¶
- type Option
- type Server
- func (s *Server) CommandRunner() localtools.CommandRunner
- func (s *Server) CreateTerminal(_ context.Context, req libacp.CreateTerminalRequest) (libacp.CreateTerminalResponse, error)
- func (s *Server) FileIO() localtools.FileIO
- func (s *Server) FileSystemCapabilities() libacp.FileSystemCapabilities
- func (s *Server) KillTerminal(_ context.Context, req libacp.KillTerminalRequest) (libacp.KillTerminalResponse, error)
- func (s *Server) ReadTextFile(_ context.Context, req libacp.ReadTextFileRequest) (libacp.ReadTextFileResponse, error)
- func (s *Server) ReleaseTerminal(_ context.Context, req libacp.ReleaseTerminalRequest) (libacp.ReleaseTerminalResponse, error)
- func (s *Server) Root() string
- func (s *Server) TerminalOutput(_ context.Context, req libacp.TerminalOutputRequest) (libacp.TerminalOutputResponse, error)
- func (s *Server) WaitForTerminalExit(ctx context.Context, req libacp.WaitForTerminalExitRequest) (libacp.WaitForTerminalExitResponse, error)
- func (s *Server) WriteTextFile(_ context.Context, req libacp.WriteTextFileRequest) (libacp.WriteTextFileResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Server)
Option configures a Server.
func WithEnvScrub ¶
WithEnvScrub sets the filter applied to a launched terminal's parent environment (composed by resolvedSandboxEnv: a libsandbox scrub plus operator vars). A nil filter is ignored, leaving the ScrubDenySecrets default.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the one client-side fs+terminal capability server: it answers a downstream agent's fs/* and terminal/* callbacks against a single workspace root. Reads and writes are contained by internal/services/vfs (the same seam local_fs uses); a launched terminal's environment is scrubbed, never the raw os.Environ(). Its method set satisfies agentinstance's FileSystemServer, TerminalServer and InstanceFileSystem without importing that package.
func New ¶
New returns a Server rooted at root, containment resolved through internal/services/vfs. An empty root is refused. Without WithEnvScrub the terminal environment defaults to libsandbox.ScrubDenySecrets, so a child process never inherits the raw parent environment.
func (*Server) CommandRunner ¶
func (s *Server) CommandRunner() localtools.CommandRunner
CommandRunner adapts the contained server to the seam local_shell consumes. The command runs through the same terminal the ACP capability serves, so it inherits the env scrub rather than the raw environment.
func (*Server) CreateTerminal ¶
func (s *Server) CreateTerminal(_ context.Context, req libacp.CreateTerminalRequest) (libacp.CreateTerminalResponse, error)
func (*Server) FileIO ¶
func (s *Server) FileIO() localtools.FileIO
FileIO adapts the contained server to the filesystem seam local_fs consumes, for a shape that owns its machine rather than proxying to a client: the run and mission paths, which have no ACP client to answer them. Containment and the control-plane refusal are the server's, so this cannot reach past the workspace root the caller opened.
func (*Server) FileSystemCapabilities ¶
func (s *Server) FileSystemCapabilities() libacp.FileSystemCapabilities
func (*Server) KillTerminal ¶
func (s *Server) KillTerminal(_ context.Context, req libacp.KillTerminalRequest) (libacp.KillTerminalResponse, error)
func (*Server) ReadTextFile ¶
func (s *Server) ReadTextFile(_ context.Context, req libacp.ReadTextFileRequest) (libacp.ReadTextFileResponse, error)
func (*Server) ReleaseTerminal ¶
func (s *Server) ReleaseTerminal(_ context.Context, req libacp.ReleaseTerminalRequest) (libacp.ReleaseTerminalResponse, error)
func (*Server) TerminalOutput ¶
func (s *Server) TerminalOutput(_ context.Context, req libacp.TerminalOutputRequest) (libacp.TerminalOutputResponse, error)
func (*Server) WaitForTerminalExit ¶
func (s *Server) WaitForTerminalExit(ctx context.Context, req libacp.WaitForTerminalExitRequest) (libacp.WaitForTerminalExitResponse, error)
func (*Server) WriteTextFile ¶
func (s *Server) WriteTextFile(_ context.Context, req libacp.WriteTextFileRequest) (libacp.WriteTextFileResponse, error)