Versions in this module Expand all Collapse all v0 v0.5.0 Oct 22, 2026 v0.4.12 Oct 19, 2026 v0.3.0 Oct 19, 2026 v0.2.0 Oct 19, 2026 Changes in this version + const CodeApprovalRequired + const CodeConflict + const CodeEvidenceWriteFailed + const CodeInternal + const CodeInvalidInput + const CodeNeedHuman + const CodeNotFound + const CodeRateLimited + const CodeScopeDenied + const CodeTargetUnreachable + const CodeTimeout + const CodeToolMissing + const CodeUnavailable + const CodeUpstreamError + const MaxDataBytes + const MaxListItems + const MaxSummaryRunes + func ClampSummary(s string) string + func CursorFor(offset int) string + func FirstNonEmpty(vals ...string) string + func FirstPositive(v, fallback int) int + func PreviewRunes(s string, n int) string + func ProjectIDFrom(ctx context.Context) int64 + func ShellQuote(s string) string + func TimeoutFromMS(ms int, def, max time.Duration) time.Duration + func Truncate(s string, n int) string + func WithCallContext(ctx context.Context, cc CallContext) context.Context + type ApprovalRequest struct + Actor string + Capability string + ProjectID int64 + Risk Risk + Targets []Target + Tool string + type Approver interface + Require func(ctx context.Context, req ApprovalRequest) error + type ArtifactStore interface + Delete func(ctx context.Context, path string) error + Get func(ctx context.Context, path string) ([]byte, error) + Put func(ctx context.Context, name string, data []byte) (path string, err error) + type AuditEvent struct + Actor string + Capability string + DurationMS int64 + Error string + EvidenceIDs []string + FinishedAt time.Time + InputHash string + Phase string + ProjectID int64 + Risk Risk + StartedAt time.Time + Status string + Targets []Target + TaskID string + Tool string + TraceID string + type AuditSink interface + Record func(ctx context.Context, ev AuditEvent) + type AuthFlow interface + Kind func() string + Login func(ctx context.Context, creds Credentials) (Identity, error) + type AuthFlowFunc struct + Fn func(ctx context.Context, creds Credentials) (Identity, error) + KindName string + func (f AuthFlowFunc) Kind() string + func (f AuthFlowFunc) Login(ctx context.Context, creds Credentials) (Identity, error) + type BinaryManager interface + Ensure func(ctx context.Context, name, version string) (path string, status BinaryStatus, err error) + Status func(ctx context.Context, name string) (BinaryStatus, error) + Update func(ctx context.Context, name, version string) (BinaryStatus, error) + type BinaryStatus struct + Installed bool + Path string + UpdatedAt time.Time + Version string + type Call struct + Context CallContext + Input json.RawMessage + Tool string + type CallContext struct + Actor string + DryRun bool + ProjectID int64 + TaskID string + TraceID string + func CallContextFrom(ctx context.Context) (CallContext, bool) + type Capability interface + Call func(ctx context.Context, call Call) (Result, error) + Manifest func() Manifest + type ChainPlanner struct + Planners []Planner + func (c *ChainPlanner) Add(p Planner) + func (c *ChainPlanner) Suggest(ctx context.Context, f Finding) ([]NextStep, error) + type Clock interface + Now func() time.Time + type Credentials struct + Actor string + Cookies map[string]string + Fields map[string]string + Password string + Token string + Username string + type Deps struct + Approval Approver + Artifacts ArtifactStore + Audit AuditSink + Binaries BinaryManager + Clock Clock + Evidence EvidenceSink + Fetcher Fetcher + Fingerprints FingerprintProvider + HTTP HTTPDoer + IDs IDGenerator + Limiter Limiter + Logger Logger + Processes ProcessRunner + Scope ScopeChecker + Sealer Sealer + Sessions SessionManager + Settings Settings + TemplateEngines map[string]TemplateEngine + Templates TemplateCatalog + type Downloader interface + Download func(ctx context.Context, remote string) (io.ReadCloser, error) + type Error struct + Code string + Detail string + Hint string + Message string + RetryAfterMS int + Retryable bool + func AsError(err error) *Error + func Conflict(msg string) *Error + func EvidenceWriteFailed(msg string) *Error + func InvalidInput(msg string) *Error + func NeedHuman(msg string) *Error + func NewError(code, message string) *Error + func NotFound(msg string) *Error + func ScopeDenied(msg string) *Error + func TargetUnreachable(msg string) *Error + func Timeout(msg string) *Error + func ToolMissing(msg string) *Error + func Unavailable(msg string) *Error + func UpstreamError(msg string) *Error + func (e *Error) Error() string + type EventSpec struct + Description string + Name string + type Evidence struct + CreatedAt time.Time + Data json.RawMessage + Kind string + Metadata map[string]string + Request []byte + Response []byte + Target Target + Title string + type EvidenceRef struct + ID string + Kind string + Preview string + SHA256 string + Size int + func EvidenceRefs(outs ...Output) []EvidenceRef + type EvidenceSink interface + Record func(ctx context.Context, ev Evidence) (id string, err error) + type ExecOpts struct + Background bool + Dir string + Env map[string]string + MaxOutput int + Shell string + Stdin []byte + TTY bool + Timeout time.Duration + type Fetcher interface + Fetch func(ctx context.Context, req Request) (*Response, error) + type Finding struct + Confirmed bool + Evidence []string + Fingerprint string + Kind string + Payload string + Source string + Target Target + type Fingerprint struct + Category string + Confidence int + Product string + Source string + Version string + type FingerprintProvider interface + Fingerprint func(ctx context.Context, target Target) ([]Fingerprint, error) + type HTTPDoer interface + Do func(ctx context.Context, req Request) (*Response, error) + type IDGenerator interface + New func(prefix string) string + type Identity interface + Headers func(ctx context.Context) (http.Header, error) + Refresh func(ctx context.Context) error + Scope func() IdentityScope + type IdentityScope struct + Hosts []string + Label string + ProjectID int64 + User string + type JobRef struct + JobID string + PollAfterMS int + type Limiter interface + Acquire func(ctx context.Context, key string, spec RateLimitSpec) (release func(), err error) + type Logger interface + Error func(msg string, kv ...any) + Info func(msg string, kv ...any) + Warn func(msg string, kv ...any) + type Manifest struct + APIVersion string + Events []EventSpec + Name string + Requires []string + Settings []SettingSpec + Tools []ToolSpec + Version string + func (m *Manifest) Validate() error + type Meta struct + Cached bool + DurationMS int64 + GateTrace []string + Requests int + Target string + Tool string + Version string + type NextStep struct + Params json.RawMessage + Preconditions []string + Reason string + Risk Risk + Tool string + func DedupeNext(groups ...[]NextStep) []NextStep + func SortByRisk(steps []NextStep) []NextStep + type Output struct + Command string + DurationMS int64 + EvidenceID string + ExitCode int + Stderr string + Stdout string + Truncated bool + func OutputFor(cmd, stdout, stderr string, exit int, dur time.Duration, max int) Output + type Page struct + Cursor string + HasMore bool + Total int + func PageWindow(total int, cursor string, pageSize int) (start, end int, page *Page, err error) + type Planner interface + Suggest func(ctx context.Context, f Finding) ([]NextStep, error) + func DefaultPlanner() Planner + type PlannerFunc func(ctx context.Context, f Finding) ([]NextStep, error) + func (f PlannerFunc) Suggest(ctx context.Context, finding Finding) ([]NextStep, error) + type ProcessResult struct + ExitCode int + Stderr []byte + Stdout []byte + type ProcessRunner interface + Run func(ctx context.Context, spec ProcessSpec) (*ProcessResult, error) + type ProcessSpec struct + Args []string + Dir string + Env []string + Path string + RateLimit RateLimitSpec + Stdin []byte + Targets []Target + Timeout time.Duration + type RateLimitSpec struct + Burst int + Concurrency int + PerSecond float64 + func (s RateLimitSpec) Normalized() RateLimitSpec + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Add(spec Spec) error + func (r *Registry) Specs() []Spec + func (r *Registry) Validate(deps Deps) error + type Request struct + Body []byte + Headers map[string]string + Method string + Proxy string + Timeout time.Duration + URL string + type Response struct + Body []byte + Duration time.Duration + FinalURL string + Headers map[string][]string + RequestText string + RespText string + Status int + type Result struct + Data json.RawMessage + Error *Error + Evidence []EvidenceRef + EvidenceIDs []string + Findings []Finding + Meta Meta + Next []NextStep + OK bool + Page *Page + Status Status + Summary string + Text string + Truncated bool + func BlockedResult(err *Error) Result + func DataResult(v any) (Result, error) + func FailResult(err error) Result + func NewResult(status Status, summary string) Result + func PartialResult(summary string, data any) (Result, error) + func SuccessResult(summary string, data any) (Result, error) + func TextResult(text string) Result + func (r *Result) ClampData() + func (r Result) Normalize(tool, version string) Result + type Risk string + const RiskHigh + const RiskLow + const RiskMedium + func (r Risk) AtLeast(other Risk) bool + func (r Risk) Valid() bool + type ScopeChecker interface + Check func(ctx context.Context, target Target) error + type Sealer interface + Open func(sealed string) (string, error) + Seal func(plain string) (string, error) + type Session interface + Close func() error + Exec func(ctx context.Context, cmd string, opts ExecOpts) (Output, error) + Info func() SessionInfo + type SessionInfo struct + Arch string + Elevated bool + Host string + ID string + Kind string + Labels []string + Meta map[string]string + OS string + Port int + User string + type SessionManager interface + Close func(id string) error + Get func(id string) (Session, bool) + List func() []SessionInfo + Open func(ctx context.Context, spec SessionSpec) (SessionInfo, error) + type SessionOpener interface + Open func(ctx context.Context, spec SessionSpec) (Session, error) + type SessionSpec struct + Domain string + Host string + KeyPass string + Kind string + Labels []string + Options map[string]string + Port int + Protocol string + ProxyURL string + Secret string + Timeout time.Duration + User string + type SettingSpec struct + Default any + Description string + Key string + Secret bool + Type string + type Settings interface + GetBool func(ctx context.Context, key string) (bool, bool) + GetInt func(ctx context.Context, key string) (int64, bool) + GetString func(ctx context.Context, key string) (string, bool) + type Spec struct + Manifest Manifest + New func(Deps) (Capability, error) + type Status string + const StatusBlocked + const StatusFailed + const StatusNeedHuman + const StatusPartial + const StatusSuccess + const StatusUnavailable + func StatusForError(e *Error) Status + func (s Status) Terminal() bool + func (s Status) Valid() bool + type Target struct + CIDR string + Host string + IP string + Kind TargetKind + Port int + ProjectID int64 + URL string + func TargetFromString(projectID int64, raw string) (Target, error) + func TargetFromURL(projectID int64, raw string) (Target, error) + func TargetsFromStrings(projectID int64, raws []string) ([]Target, error) + func (t Target) Key() string + type TargetKind string + const TargetCIDR + const TargetDomain + const TargetHost + const TargetIP + const TargetURL + type TemplateCatalog interface + Get func(ctx context.Context, id string) (TemplateRef, bool, error) + Search func(ctx context.Context, q TemplateQuery) ([]TemplateRef, error) + type TemplateEngine interface + Execute func(ctx context.Context, refs []TemplateRef, target Target, opts map[string]any) (Result, error) + Kind func() string + type TemplateQuery struct + CVE string + Fingerprint string + Kind string + Limit int + Products []string + Severity []string + Tags []string + Text string + type TemplateRef struct + Artifact []byte + Engine string + ID string + Kind string + Meta map[string]string + Name string + type TokenSnapshot struct + AccessToken string + ExpiresAt time.Time + IssuedAt time.Time + func (t TokenSnapshot) NeedsRefresh(now time.Time, skew time.Duration) bool + type ToolSpec struct + Description string + ExtractTargets func(json.RawMessage) ([]Target, error) + InputSchema json.RawMessage + Name string + OutputSchema json.RawMessage + RateLimit RateLimitSpec + Risk Risk + func (t *ToolSpec) Validate() error + type Tunnel interface + Close func() error + LocalAddr func() string + type TunnelSpec struct + Kind string + LocalAddr string + Network string + RemoteAddr string + type Tunneler interface + Tunnel func(ctx context.Context, spec TunnelSpec) (Tunnel, error) + type Uploader interface + Upload func(ctx context.Context, src io.Reader, remote string) error