runner

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IOAClientCommandFunc func(ctx context.Context, mode cfg.RunMode, option *cfg.Option, args cfg.IOAClientArgs, logger telemetry.Logger) error

IOAClientCommandFunc dispatches IOA client CLI commands (spaces, messages, etc.). Set via init() from cmd/aiscan setup.

View Source
var IOAServeFunc func(ctx context.Context, option *cfg.Option, logger telemetry.Logger) error

IOAServeFunc starts the IOA HTTP server. Set via init() from cmd/aiscan setup.

View Source
var ScannerInitFunc func(ctx context.Context, a *App, rc cfg.RuntimeConfig, logger telemetry.Logger)

ScannerInitFunc initializes scanner engines and registers scanner commands. Set via init() from the package imported by cmd/aiscan.

View Source
var ScannerWithAgentFunc func(ctx context.Context, option *cfg.Option, application *App, scannerArgs []string, logger telemetry.Logger) error

ScannerWithAgentFunc runs a scanner command with AI agent assistance. Set via init() from the package imported by cmd/aiscan.

Functions

func BuildSystemPrompt

func BuildSystemPrompt(cfg *PromptConfig, agentCfg *agent.Config) string

BuildSystemPrompt assembles the system prompt from config.

func CollectDeepBrowserArtifacts

func CollectDeepBrowserArtifacts(ctx context.Context, reg *commands.CommandRegistry, targetURL string, logger telemetry.Logger) (string, error)

func DirectScannerRuntimeFeatures

func DirectScannerRuntimeFeatures(rest []string) (config.RuntimeFeatures, []string, error)

func HasScannerFlag

func HasScannerFlag(args []string, long string) bool

func NewRemoteREPLOpener

func NewRemoteREPLOpener(rt *AgentRuntime, mgr *tmux.Manager) pty.OpenFunc

func ResolveIOANodeName

func ResolveIOANodeName(option *cfg.Option) string

func RunAgentMode

func RunAgentMode(ctx context.Context, option *cfg.Option, logger telemetry.Logger, setInterrupt ...func(func() bool)) error

func RunDirectScannerMode

func RunDirectScannerMode(ctx context.Context, option *cfg.Option, rest []string, logger telemetry.Logger) error

func RunIOAClientCommand

func RunIOAClientCommand(ctx context.Context, mode cfg.RunMode, option *cfg.Option, args cfg.IOAClientArgs, logger telemetry.Logger) error

func RunIOAServe

func RunIOAServe(ctx context.Context, option *cfg.Option, logger telemetry.Logger) error

func ShouldStreamScannerOutput

func ShouldStreamScannerOutput(rest []string) bool

func SystemPromptFunc

func SystemPromptFunc(cfg *PromptConfig) agent.SystemPromptFunc

SystemPromptFunc returns an agent.SystemPromptFunc that builds the system prompt dynamically on each turn.

Types

type AgentRuntime

type AgentRuntime struct {
	App            *App
	NodeName       string
	SystemPrompt   string
	Option         *cfg.Option
	Config         agent.Config
	Bus            *eventbus.Bus[agent.Event]
	Output         *tui.AgentOutput
	ConfigFile     string
	ResumeMessages []agent.ChatMessage
	// contains filtered or unexported fields
}

func NewAgentRuntime

func NewAgentRuntime(ctx context.Context, option *cfg.Option, logger telemetry.Logger, rc *RuntimeConfig) (*AgentRuntime, error)

func (*AgentRuntime) Close

func (rt *AgentRuntime) Close()

func (*AgentRuntime) ReloadProvider added in v0.3.0

func (rt *AgentRuntime) ReloadProvider(option *cfg.Option) (agent.Provider, string, error)

ReloadProvider rebuilds the LLM provider from option and hot-swaps it into the running runtime: rt.App (used by the REPL and scan paths) and rt.Config (the template every new chat agent is cloned from). It returns the live provider and resolved model so callers can propagate the swap to already-running agents. On a build failure the runtime is left untouched and the error is returned, so a bad config push never knocks out a working provider.

func (*AgentRuntime) SetLogger added in v0.3.0

func (rt *AgentRuntime) SetLogger(logger telemetry.Logger)

type App

type App struct {
	Provider          agent.Provider
	ProviderConfig    agent.ProviderConfig
	ProviderFallbacks []agent.ProviderEntry
	Commands          *commands.CommandRegistry
	Engines           any
	Skills            *skills.Store
	SkillDiagnostics  []skills.Diagnostic
	IOAClient         protocols.ClientAPI
	IOAStreamClient   ioaclient.StreamAPI
	DataBus           *eventbus.Bus[output.ToolDataEvent]
	SCOSidecar        *output.SCOSidecar
	// contains filtered or unexported fields
}

func NewApp

func NewApp(ctx context.Context, rc cfg.RuntimeConfig) (*App, error)

func (*App) Close

func (a *App) Close()

func (*App) InitIOA

func (a *App) InitIOA(ctx context.Context, ioa cfg.IOAConfig) error

func (*App) Logger added in v0.3.0

func (a *App) Logger() telemetry.Logger

func (*App) SetLogger added in v0.3.0

func (a *App) SetLogger(logger telemetry.Logger)

func (*App) WaitEngines

func (a *App) WaitEngines(ctx context.Context) error

type LoadedSkill

type LoadedSkill struct {
	Name string
	Body string
}

LoadedSkill is a skill whose full body is embedded directly into the prompt.

type PromptConfig

type PromptConfig struct {
	Tools            *commands.CommandRegistry
	ScannerDocs      string
	CustomPreamble   string
	Skills           []skills.Skill
	LoadedSkills     []LoadedSkill // skill body 直接嵌入 prompt
	ScannerAgentMode bool
	ScannerName      string
	NodeName         string
	Space            string
}

type RuntimeConfig

type RuntimeConfig struct {
	ExistingApp       *App
	IOA               *cfg.IOAConfig
	PromptConfig      *PromptConfig
	NoOutput          bool
	InteractiveOutput bool
	ProviderOptional  bool
}

Jump to

Keyboard shortcuts

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