Documentation
¶
Index ¶
- Constants
- type CancelInput
- type CancelOutput
- type Command
- type Input
- type Output
- type Service
- func (s *Service) AsyncConfig(toolName string) *asynccfg.Config
- func (s *Service) AsyncConfigs() []*asynccfg.Config
- func (s *Service) CacheableMethods() map[string]bool
- func (s *Service) Execute(ctx context.Context, input *Input, output *Output) error
- func (s *Service) Method(name string) (svc.Executable, error)
- func (s *Service) Methods() svc.Signatures
- func (s *Service) Name() string
- type StartInput
- type StartOutput
- type StatusInput
- type StatusOutput
Constants ¶
View Source
const Name = "system/exec"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelInput ¶ added in v0.1.7
type CancelOutput ¶ added in v0.1.7
type CancelOutput struct {
Status string `json:"status,omitempty"`
}
type Command ¶
type Command struct {
Input string `json:"input,omitempty"`
Output string `json:"output,omitempty"`
Stderr string `json:"stderr,omitempty"`
Status int `json:"status,omitempty"`
}
Command represents the result of executing a single command
type Input ¶
type Input struct {
SessionID string `json:"sessionId,omitempty" description:"Optional shell session id to reuse across multiple execute calls."`
Host *sys.Host `json:"host,omitempty" internal:"true" description:"Target host. Use bash://localhost/ (default) or ssh://user@host:22."`
Workdir string `json:"workdir,omitempty" description:"Working directory for file operations. Example: /repo/path."`
Env map[string]string `json:"env,omitempty" description:"Environment variables (k=v) set before running. Example: {'GOFLAGS':'-mod=mod'}."`
Commands []string `json:"commands,omitempty" description:"Commands to run in order (no pipes). Example: ['rg --files', 'sed -n 1,20p file.go']."`
TimeoutMs int `json:"timeoutMs,omitempty" yaml:"timeoutMs,omitempty" description:"Per-command timeout in ms (default 180000)."`
AbortOnError *bool `json:"abortOnError,omitempty" description:"Stop on first non-zero status (default true)."`
Stream string `` /* 132-byte string literal not displayed */
ByteRange *textutil.IntRange `json:"byteRange,omitempty" description:"Optional byte range [from,to) over the selected stream content."`
}
Input represents system executor configuration
func (*Input) HasFSCommand ¶
type Output ¶
type Output struct {
SessionID string `json:"sessionId,omitempty"`
Commands []*Command `json:"commands,omitempty"`
Stream string `json:"stream,omitempty"`
Stdout string `json:"stdout,omitempty" description:"Full buffered stdout accumulated so far. Not truncated."`
Stderr string `json:"stderr,omitempty" description:"Full buffered stderr accumulated so far. Not truncated."`
Content string `json:"content,omitempty" description:"Selected stream content slice when stream/byteRange paging is used."`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
Size int `json:"size,omitempty"`
Continuation *extension.Continuation `json:"continuation,omitempty" description:"Native byte-range continuation for the selected stream content."`
Status int `json:"status,omitempty"`
}
Output represents the results of executing commands
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service executes terminal commands
func (*Service) AsyncConfig ¶ added in v0.1.7
func (*Service) AsyncConfigs ¶ added in v0.1.7
func (*Service) CacheableMethods ¶ added in v0.1.7
CacheableMethods declares which methods produce cacheable outputs.
func (*Service) Method ¶
func (s *Service) Method(name string) (svc.Executable, error)
Method resolves an executable by name.
func (*Service) Methods ¶
func (s *Service) Methods() svc.Signatures
Methods returns method signatures for this service.
type StartInput ¶ added in v0.1.7
type StartInput struct {
SessionID string `json:"sessionId,omitempty" description:"Optional async session id. When empty, the runtime generates one."`
Host *sys.Host `json:"host,omitempty" internal:"true" description:"Target host. Detached mode currently supports localhost only."`
Workdir string `json:"workdir,omitempty" description:"Working directory for file operations. Example: /repo/path."`
Env map[string]string `json:"env,omitempty" description:"Environment variables (k=v) set before running."`
Commands []string `json:"commands,omitempty" description:"Commands to run in order (no pipes)."`
TimeoutMs int `` /* 142-byte string literal not displayed */
AbortOnError *bool `json:"abortOnError,omitempty" description:"Stop on first non-zero status (default true)."`
}
type StartOutput ¶ added in v0.1.7
type StatusInput ¶ added in v0.1.7
type StatusInput struct {
SessionID string `json:"sessionId,omitempty"`
ProcessID string `json:"processId,omitempty"`
Stream string `json:"stream,omitempty" description:"Optional stream selector for ranged reads: stdout, stderr, or combined."`
ByteRange *textutil.IntRange `json:"byteRange,omitempty" description:"Optional byte range [from,to) over the selected stream content."`
}
type StatusOutput ¶ added in v0.1.7
type StatusOutput struct {
SessionID string `json:"sessionId,omitempty"`
ProcessID string `json:"processId,omitempty"`
Stream string `json:"stream,omitempty"`
Status string `json:"status,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
Stdout string `json:"stdout,omitempty" description:"Full buffered stdout accumulated so far. Not truncated."`
Stderr string `json:"stderr,omitempty" description:"Full buffered stderr accumulated so far. Not truncated."`
Content string `json:"content,omitempty" description:"Selected stream content slice when stream/byteRange paging is used."`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
Size int `json:"size,omitempty"`
Continuation *extension.Continuation `json:"continuation,omitempty" description:"Native byte-range continuation for the selected stream content."`
}
Click to show internal directories.
Click to hide internal directories.