Documentation
¶
Index ¶
- func NewBackgroundTaskRegistry(maxConcurrentShells int, supervisor *jobs.Supervisor) scheddomain.BackgroundTaskRegistry
- type BackgroundShellService
- func (s *BackgroundShellService) CancelShell(shellID string) error
- func (s *BackgroundShellService) DetachToBackground(ctx context.Context, cmd *exec.Cmd, command string, ...) (string, error)
- func (s *BackgroundShellService) GetAllShells() []*scheddomain.BackgroundShell
- func (s *BackgroundShellService) GetShell(shellID string) *scheddomain.BackgroundShell
- func (s *BackgroundShellService) GetShellOutput(shellID string, fromOffset int64) (string, int64, scheddomain.ShellState, error)
- func (s *BackgroundShellService) GetShellOutputWithFilter(shellID string, fromOffset int64, filterPattern string) (string, int64, scheddomain.ShellState, error)
- func (s *BackgroundShellService) GetStats() map[string]int
- func (s *BackgroundShellService) RemoveShell(shellID string) error
- func (s *BackgroundShellService) Stop()
- type Options
- type ScheduleNotifier
- type Service
- type TitleBackfill
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBackgroundTaskRegistry ¶
func NewBackgroundTaskRegistry(maxConcurrentShells int, supervisor *jobs.Supervisor) scheddomain.BackgroundTaskRegistry
NewBackgroundTaskRegistry constructs the unified registry. maxConcurrentShells is the per-session cap enforced by the underlying shell tracker. supervisor is the single fan-in that monitors submitted jobs and backs the unified job surface (Submit/Snapshot/Wind).
Types ¶
type BackgroundShellService ¶
type BackgroundShellService struct {
// contains filtered or unexported fields
}
BackgroundShellService is the thin front end for background bash shells: it detaches a running command so the bash tools can read its output, submits a shellJob to the supervisor, which monitors and reaps it, and brokers output retrieval and cancellation.
func NewBackgroundShellService ¶
func NewBackgroundShellService( tracker scheddomain.ShellTracker, supervisor *jobs.Supervisor, cfg *config.Config, eventChannel chan<- agentdomain.ChatEvent, windowApps scheddomain.WindowApps, ) *BackgroundShellService
NewBackgroundShellService creates a new background shell service. supervisor monitors and reaps each detached shell. windowApps tells which shells are window apps on the computer's display, nil where there is no such display.
func (*BackgroundShellService) CancelShell ¶
func (s *BackgroundShellService) CancelShell(shellID string) error
CancelShell cancels a running background shell. It hands the kill to the supervisor (WindStop -> SIGKILL). The shellJob's Run then records the Cancelled state and the supervisor delivers the completion notification, so the process is waited on in exactly one place.
func (*BackgroundShellService) DetachToBackground ¶
func (s *BackgroundShellService) DetachToBackground( ctx context.Context, cmd *exec.Cmd, command string, outputBuffer *scheddomain.OutputRingBuffer, readersDone <-chan struct{}, ) (string, error)
DetachToBackground moves a running command to background
func (*BackgroundShellService) GetAllShells ¶
func (s *BackgroundShellService) GetAllShells() []*scheddomain.BackgroundShell
GetAllShells returns all tracked shells
func (*BackgroundShellService) GetShell ¶
func (s *BackgroundShellService) GetShell(shellID string) *scheddomain.BackgroundShell
GetShell returns a specific shell by ID
func (*BackgroundShellService) GetShellOutput ¶
func (s *BackgroundShellService) GetShellOutput(shellID string, fromOffset int64) (string, int64, scheddomain.ShellState, error)
GetShellOutput retrieves incremental output from a shell
func (*BackgroundShellService) GetShellOutputWithFilter ¶
func (s *BackgroundShellService) GetShellOutputWithFilter(shellID string, fromOffset int64, filterPattern string) (string, int64, scheddomain.ShellState, error)
GetShellOutputWithFilter retrieves output with optional regex filtering
func (*BackgroundShellService) GetStats ¶
func (s *BackgroundShellService) GetStats() map[string]int
GetStats returns statistics about background shells
func (*BackgroundShellService) RemoveShell ¶
func (s *BackgroundShellService) RemoveShell(shellID string) error
RemoveShell removes a shell from tracking
func (*BackgroundShellService) Stop ¶
func (s *BackgroundShellService) Stop()
Stop is retained for the lifecycle contract. The supervisor owns the monitor goroutines and the cleanup ticker now, so there is nothing to stop here.
type Options ¶
type Options struct {
Store storage.ScheduledJobStorage
Runs storage.ScheduledRunStorage
OnRunEvent func(scheddomain.ScheduledJob, scheddomain.RunEvent)
ExecCommand agentheadless.ExecFunc
BinaryPath string
}
Options bundles dependencies and configuration for NewService.
type ScheduleNotifier ¶
type ScheduleNotifier struct {
// contains filtered or unexported fields
}
ScheduleNotifier delivers scheduled-job run output to the job's delivery channel. It subscribes to the scheduler's run events (Options.OnRunEvent); jobs without a delivery target are record-only, so their events are ignored here and their output lives in storage.
func NewScheduleNotifier ¶
func NewScheduleNotifier(lookup func(name string) channels.Channel, maxToolResult int) *ScheduleNotifier
NewScheduleNotifier constructs a notifier resolving channels through lookup (typically ChannelManagerService.GetChannel) and capping each forwarded tool result at maxToolResult runes.
func (*ScheduleNotifier) Notify ¶
func (n *ScheduleNotifier) Notify(job scheddomain.ScheduledJob, e scheddomain.RunEvent)
Notify implements the scheduler's OnRunEvent hook.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs scheduled jobs inside `infer daemon`, loading them from ScheduledJobStorage and hot-reloading by polling and diffing. Every fire spawns `infer headless` with a fresh session and persists a RunRecord keyed by it. Progress goes to the OnRunEvent hook, and delivery to channels is a subscriber concern.
func NewService ¶
NewService constructs a Service. Returns an error if required deps are missing.
type TitleBackfill ¶ added in v0.207.0
type TitleBackfill struct {
// contains filtered or unexported fields
}
TitleBackfill manages background tasks. cancel and done belong to the current run and are nil while stopped.
func NewTitleBackfill ¶ added in v0.207.0
func NewTitleBackfill(titleGenerator scheddomain.TitleGenerator, config *config.Config) *TitleBackfill
NewTitleBackfill creates a new background job manager
func (*TitleBackfill) IsRunning ¶ added in v0.207.0
func (m *TitleBackfill) IsRunning() bool
IsRunning returns whether the job manager is currently running
func (*TitleBackfill) Start ¶ added in v0.207.0
func (m *TitleBackfill) Start(ctx context.Context)
Start begins running background jobs
func (*TitleBackfill) Stop ¶ added in v0.207.0
func (m *TitleBackfill) Stop()
Stop cancels the worker, including a title pass in flight, and waits for it outside the lock.
func (*TitleBackfill) TriggerTitleGeneration ¶ added in v0.207.0
func (m *TitleBackfill) TriggerTitleGeneration(ctx context.Context) error
TriggerTitleGeneration manually triggers title generation for pending conversations