Help us shape the future of Go! Take the 2026 Go Developer Survey

inspection

package
v1.153.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package inspection provides side-effect-free views of agents and toolsets.

Index

Constants

View Source
const (
	ExecutionModeNative  = "native"
	ExecutionModeHarness = "harness"

	ToolExecutionDockerAgent     = "docker-agent"
	ToolExecutionHarnessReported = "harness-reported"

	ToolApprovalDockerAgentPolicy = "docker-agent-policy"
	ToolApprovalExternal          = "external"
)

Variables

This section is empty.

Functions

func ToolsetName

func ToolsetName(ts tools.ToolSet, fallback string) string

ToolsetName picks a stable, user-visible name for a toolset. We look for any inner toolset that implements tools.Named (walked via tools.As so wrappers like StartableToolSet are transparent). The registry adds a WithName wrapper for every built-in toolset so this is reachable for almost every toolset; fallback uses the description ("mcp(stdio cmd=...)"), which is still better than the Go type name.

func ToolsetStatus

func ToolsetStatus(ts tools.ToolSet) tools.ToolsetStatus

ToolsetStatus builds a ToolsetStatus for ts. tools.As walks the wrapper chain so Statable/Describer can live anywhere in the stack.

func UniqueNames

func UniqueNames(names []string, sorted bool) []string

UniqueNames drops empty entries and de-duplicates names. By default it keeps the first-seen order (meaningful for declaration/priority order); when sorted is true it orders the result case-insensitively instead.

Types

type AgentConfigInfo

type AgentConfigInfo struct {
	SubAgents []string // sub-agent names, sorted
	Handoffs  []string // handoff target names, sorted
	Fallbacks []string // fallback model ids ("provider/model"), in priority order
	Skills    []string // configured skill names (inline + included + used), sorted

	MaxIterations           int // 0 when unset
	NumHistoryItems         int // 0 when unset
	MaxConsecutiveToolCalls int // 0 when unset

	Options  []string        // enabled option flags (add-date, redact-secrets, ...)
	Toolsets []ToolsetDetail // per-toolset live state + tools, in declaration order

	IsCurrent bool // true when this is the live current agent

	ExecutionCapabilities *ExecutionCapabilities
}

AgentConfigInfo is the static-plus-live dataset behind the read-only agent inspector modal. The static parts (sub-agents, handoffs, fallbacks, skills, limits, option flags, declared toolset allow-lists) are derived from the resolved *agent.Agent and the retained config without starting any toolset; the live parts (per-toolset lifecycle state, started tool names, IsCurrent) reflect the running team. Remote runtimes (which hold no local team) return the zero value, so the modal omits every config-derived section.

type ExecutionCapabilities

type ExecutionCapabilities struct {
	Mode                       string `json:"mode"`
	ToolExecution              string `json:"tool_execution"`
	ToolApproval               string `json:"tool_approval"`
	BudgetSupported            bool   `json:"budget_supported"`
	CompactionSupported        bool   `json:"compaction_supported"`
	MidTurnSteeringSupported   bool   `json:"mid_turn_steering_supported"`
	PromptHookContextSupported bool   `json:"prompt_hook_context_supported"`
}

ExecutionCapabilities describes an agent's execution integration, not enabled settings. Native support does not imply an adapter configured budgets or a policy requires approval.

func Capabilities

func Capabilities(a *agent.Agent) *ExecutionCapabilities

Capabilities describes integration support, not configured policy.

type Service

type Service struct {
	Team         *team.Team
	CurrentAgent string
}

Service reads a team without starting toolsets or execution drivers.

func (Service) AgentConfigInfo

func (r Service) AgentConfigInfo(ctx context.Context, agentName string) AgentConfigInfo

AgentConfigInfo returns the named agent's inspector dataset. It inspects the resolved agent and the retained config, reading live tool names only from already-started toolsets (never starting one), so it is safe to call for any agent whether or not it has run. Unknown agents yield the zero value, so the modal omits the corresponding sections.

type ToolsetDetail

type ToolsetDetail struct {
	Name  string
	Kind  string
	State ToolsetState
	Tools []string
}

ToolsetDetail describes one configured toolset for the agent inspector: its display name, kind, lifecycle bucket and the tools it exposes. Tools holds the live tool names when the toolset is started, otherwise the declared `tools:` allow-list from the retained config, and is empty when neither is available (a not-yet-started toolset with no explicit allow-list).

type ToolsetState

type ToolsetState string

ToolsetState is the coarse lifecycle bucket the agent inspector renders as a status glyph. It collapses the full lifecycle.State machine into the three distinctions a reader cares about: serving (started), not running (stopped), or broken (error).

const (
	ToolsetStarted ToolsetState = "started"
	ToolsetStopped ToolsetState = "stopped"
	ToolsetError   ToolsetState = "error"
)

Jump to

Keyboard shortcuts

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