runtime

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 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     capkit.ScopeChecker
	Approval  capkit.Approver
	Evidence  capkit.EvidenceSink
	HTTP      capkit.HTTPDoer
	Fetcher   capkit.Fetcher
	Limiter   capkit.Limiter
	Audit     capkit.AuditSink
	Settings  capkit.Settings
	Sealer    capkit.Sealer
	Logger    capkit.Logger
	Clock     capkit.Clock
	IDs       capkit.IDGenerator
	Processes capkit.ProcessRunner
	Artifacts capkit.ArtifactStore
	Binaries  capkit.BinaryManager

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

	// RequireApprovalAt defaults to high.
	RequireApprovalAt capkit.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 capkit.Registry, and New builds instances from it.

func New

func New(cfg Config, reg *capkit.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 capkit.CallContext) (res capkit.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() []capkit.Manifest

Manifests returns all capability manifests.

func (*Runtime) Tools

func (r *Runtime) Tools() []capkit.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