Documentation
¶
Index ¶
- func ClassifyEffect(args map[string]any) tool.Effect
- func Command(ctx context.Context, command, workingDir string) *exec.Cmd
- func ExecTools(manager *ExecManager, workDir string, elicit *tool.Elicitation, ...) []tool.Tool
- func IsDangerousCommand(command string) bool
- func IsReadOnlyCommand(command string) bool
- type Approvals
- type EnvironmentPolicy
- type ExecExit
- type ExecManager
- type ExecSessionInfo
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶ added in v0.9.4
Command builds an *exec.Cmd that runs a script with the same interpreter used by exec_command on this platform.
func ExecTools ¶ added in v0.10.0
func ExecTools(manager *ExecManager, workDir string, elicit *tool.Elicitation, appr *Approvals, opts *Options) []tool.Tool
func IsDangerousCommand ¶ added in v0.6.2
func IsReadOnlyCommand ¶ added in v0.6.2
Types ¶
type Approvals ¶ added in v0.10.0
type Approvals struct {
// contains filtered or unexported fields
}
func NewApprovals ¶ added in v0.10.0
func NewApprovals() *Approvals
type EnvironmentPolicy ¶ added in v0.12.19
EnvironmentPolicy filters the environment inherited by model-generated commands. Allow takes precedence over Deny. Replace is applied last and can intentionally reintroduce an otherwise denied variable.
func DefaultEnvironmentPolicy ¶ added in v0.12.19
func DefaultEnvironmentPolicy() EnvironmentPolicy
func (EnvironmentPolicy) Filter ¶ added in v0.12.19
func (p EnvironmentPolicy) Filter(environ []string) []string
Filter applies the policy to KEY=value entries. Matching is case-insensitive on Windows and supports a trailing * prefix pattern.
type ExecExit ¶ added in v0.11.4
type ExecExit struct {
SessionID int
Command string
Description string
Output string
Notice string
Failed bool
Elapsed time.Duration
}
ExecExit reports the exit of a backgrounded exec_command session that no tool call was waiting on, so the host can deliver it as a notification instead of leaving the model to poll.
type ExecManager ¶ added in v0.10.0
type ExecManager struct {
// contains filtered or unexported fields
}
func NewExecManager ¶ added in v0.10.0
func NewExecManager(onExit func(ExecExit)) *ExecManager
func (*ExecManager) BackgroundSession ¶ added in v0.16.4
func (m *ExecManager) BackgroundSession(id int) (ExecSessionInfo, bool)
BackgroundSession returns one live background command without consuming its buffered output.
func (*ExecManager) BackgroundSessions ¶ added in v0.16.4
func (m *ExecManager) BackgroundSessions() []ExecSessionInfo
BackgroundSessions returns the live command sessions that are no longer owned by a waiting tool call. Callers can expose these alongside other background work without draining output needed by exec_session.
func (*ExecManager) Close ¶ added in v0.10.0
func (m *ExecManager) Close()
func (*ExecManager) StopBackgroundSession ¶ added in v0.16.4
func (m *ExecManager) StopBackgroundSession(id int) error
StopBackgroundSession terminates a live command returned by exec_command.
type ExecSessionInfo ¶ added in v0.16.4
type ExecSessionInfo struct {
ID int
Command string
Description string
Output string
Started time.Time
}
ExecSessionInfo is a read-only snapshot of a command that exec_command returned while it continued running in the background.
type Options ¶ added in v0.12.19
type Options struct {
// ScratchDir receives complete shell transcripts when inline capture is
// exceeded. Empty disables transcript persistence while retaining head/tail.
ScratchDir string
// Environment extends DefaultEnvironmentPolicy. Allow can explicitly keep
// a default-denied key; Deny adds patterns; Replace sets final values.
// The WINGMAN_ENV_ALLOW variable ("KEY1,PREFIX_*") also extends Allow, so
// denied keys can be restored without embedding code changes.
Environment *EnvironmentPolicy
}
Options controls the host capabilities exposed to model-generated commands.