Documentation
¶
Overview ¶
Package backgroundjobs exposes the built-in background_jobs toolset.
Index ¶
- Constants
- func CreateToolSet(ctx context.Context, toolset latest.Toolset, runConfig *config.RuntimeConfig) (tools.ToolSet, error)
- func Creator(ctx context.Context, toolset latest.Toolset, _ string, ...) (tools.ToolSet, error)
- type RunBackgroundJobArgs
- type RunBackgroundJobRecallArgs
- type StopBackgroundJobArgs
- type ToolSet
- type ViewBackgroundJobArgs
- type WaitBackgroundJobArgs
Constants ¶
const ( // ToolNameRunBackgroundJob starts a shell command asynchronously. ToolNameRunBackgroundJob = "run_background_job" // ToolNameListBackgroundJobs lists known background jobs. ToolNameListBackgroundJobs = "list_background_jobs" // ToolNameViewBackgroundJob renders one background job's status and output. ToolNameViewBackgroundJob = "view_background_job" // ToolNameStopBackgroundJob stops a running background job. ToolNameStopBackgroundJob = "stop_background_job" // ToolNameWaitBackgroundJob waits for a background job to finish. ToolNameWaitBackgroundJob = "wait_background_job" )
Variables ¶
This section is empty.
Functions ¶
func CreateToolSet ¶
func CreateToolSet(ctx context.Context, toolset latest.Toolset, runConfig *config.RuntimeConfig) (tools.ToolSet, error)
CreateToolSet builds the background_jobs toolset from config.
func Creator ¶ added in v1.132.0
func Creator(ctx context.Context, toolset latest.Toolset, _ string, runConfig *config.RuntimeConfig, _ string) (tools.ToolSet, error)
Creator builds this toolset from its YAML declaration. It matches teamloader.ToolsetCreator so it can be registered directly:
teamloader.NewToolsetRegistry(map[string]teamloader.ToolsetCreator{"background_jobs": backgroundjobs.Creator})
Types ¶
type RunBackgroundJobArgs ¶
type RunBackgroundJobArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command to run in background"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
}
RunBackgroundJobArgs contains the parameters for run_background_job.
func (*RunBackgroundJobArgs) UnmarshalJSON ¶
func (a *RunBackgroundJobArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both "cmd" (canonical) and "command" (common alias), resolved by safety.CommandArg over an exact-key map so the executed command is the one the runtime classified (see shell.RunShellArgs).
type RunBackgroundJobRecallArgs ¶
type RunBackgroundJobRecallArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command to run in background"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
Recall bool `json:"recall,omitempty" jsonschema:"Ask to be recalled with a steering message when the background job finishes"`
}
RunBackgroundJobRecallArgs contains the parameters for run_background_job when recall is enabled.
func (*RunBackgroundJobRecallArgs) UnmarshalJSON ¶
func (a *RunBackgroundJobRecallArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both "cmd" (canonical) and "command" (common alias), resolved like RunBackgroundJobArgs.
type StopBackgroundJobArgs ¶
type StopBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}
StopBackgroundJobArgs contains the parameters for stop_background_job.
type ToolSet ¶
type ToolSet struct {
// contains filtered or unexported fields
}
ToolSet manages long-running shell commands.
func New ¶
func New(env []string, runConfig *config.RuntimeConfig) *ToolSet
New creates a background_jobs toolset with the supplied environment.
func (*ToolSet) Instructions ¶
type ViewBackgroundJobArgs ¶
type ViewBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}
ViewBackgroundJobArgs contains the parameters for view_background_job.
type WaitBackgroundJobArgs ¶
type WaitBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
Timeout int `` /* 175-byte string literal not displayed */
}
WaitBackgroundJobArgs contains the parameters for wait_background_job.