backgroundjobs

package
v1.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package backgroundjobs exposes the built-in background_jobs toolset.

Index

Constants

View Source
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.

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), mirroring the shell tool's command parameter.

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), mirroring the shell tool's command parameter.

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

func (t *ToolSet) Instructions() string

func (*ToolSet) Start

func (t *ToolSet) Start(context.Context) error

func (*ToolSet) Stop

func (t *ToolSet) Stop(context.Context) error

func (*ToolSet) Tools

func (t *ToolSet) Tools(context.Context) ([]tools.Tool, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL