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

runtime

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Scope     core.ScopeChecker
	Approval  core.Approver
	Evidence  core.EvidenceSink
	HTTP      core.HTTPDoer
	Fetcher   core.Fetcher
	Limiter   core.Limiter
	Audit     core.AuditSink
	Settings  core.Settings
	Sealer    core.Sealer
	Logger    core.Logger
	Clock     core.Clock
	IDs       core.IDGenerator
	Processes core.ProcessRunner
	Artifacts core.ArtifactStore
	Binaries  core.BinaryManager

	Fingerprints    core.FingerprintProvider
	Templates       core.TemplateCatalog
	TemplateEngines map[string]core.TemplateEngine
	Sessions        core.SessionManager

	// Intel is the host-owned vulnerability-intel store; Completer is the
	// host-provided model port. Both are optional and only required by the
	// kits that declare them.
	Intel     core.IntelStore
	Completer core.Completer
	// ExtraIntel are host-implemented advisory sources polled alongside the
	// intel kit's own. Optional; see core.IntelSource.
	ExtraIntel []core.IntelSource

	// RequireApprovalAt defaults to high.
	RequireApprovalAt core.Risk
	// IdempotencyWindow bounds how long a result keyed by idempotency_key is
	// reused. Defaults to 5 minutes; <=0 disables caching.
	IdempotencyWindow time.Duration
	// JobWindow bounds how long a finished async job stays pollable through
	// job_status. Defaults to 15 minutes.
	JobWindow time.Duration
	// JobTimeout bounds one async job's total runtime. Defaults to 0 (no extra
	// bound beyond whatever the tool applies).
	JobTimeout time.Duration
}

Config holds host-provided ports. Scope, Limiter and Audit are mandatory.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime is the instance container. It never exposes a Register method: all declarations live in core.Registry, and New builds instances from it.

func New

func New(cfg Config, reg *core.Registry) (*Runtime, error)

New validates the registry against the provided ports and instantiates every capability exactly once.

func (*Runtime) Call

func (r *Runtime) Call(ctx context.Context, tool string, input json.RawMessage, cc core.CallContext) (res core.Result, err error)

Call routes a tool invocation through the mandatory gate chain and completes the result envelope (Status, Summary, Meta, Data clamp) before returning.

func (*Runtime) Manifests

func (r *Runtime) Manifests() []core.Manifest

Manifests returns all capability manifests.

func (*Runtime) Tools

func (r *Runtime) Tools() []core.ToolSpec

Tools returns all registered tool specs.

Directories

Path Synopsis
Package httpapi is the optional generic HTTP surface for a capkit runtime.
Package httpapi is the optional generic HTTP surface for a capkit runtime.

Jump to

Keyboard shortcuts

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