resource

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package resource loads declarative Coding Agent resources from user and trusted project scopes.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid reports invalid loader options or resource metadata.
	ErrInvalid = errors.New("coding resource: invalid")
	// ErrLimitExceeded reports bounded discovery or content limits.
	ErrLimitExceeded = errors.New("coding resource: limit exceeded")
	// ErrDuplicate reports an identity collision without defined precedence.
	ErrDuplicate = errors.New("coding resource: duplicate")
	// ErrInsecure reports a writable or otherwise unsafe user resource root.
	ErrInsecure = errors.New("coding resource: insecure root")
)

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	Code       string
	Resource   string
	Winner     string
	Suppressed string
	Message    string
}

Diagnostic describes a non-fatal resource decision using safe provenance.

type Limits

type Limits struct {
	MaxEntries            int
	MaxSkillManifests     int
	MaxBundleManifests    int
	MaxDepth              int
	MaxPathBytes          int
	MaxSkillBytes         int64
	MaxTotalSkillBytes    int64
	MaxResourcesPerSkill  int
	MaxResourceBytes      int64
	MaxSkillResourceBytes int64
	MaxTotalResourceBytes int64
	Bundle                bundle.Limits
}

Limits bound discovery and reads across direct Skills and Bundle manifests.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns conservative local resource bounds.

type Options

type Options struct {
	Paths          paths.Layout
	Tree           *workspace.Tree
	ProjectTrusted bool
	Limits         Limits
}

Options select user and optional trusted-project resource boundaries.

type Result

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

Result owns fully decoded resources and no open filesystem handles.

func Load

func Load(ctx context.Context, options Options) (Result, error)

Load discovers and fully decodes scoped Skills and Bundles. Project paths are not inspected unless ProjectTrusted is true.

func (Result) Bundles

func (r Result) Bundles() []*bundle.Bundle

Bundles returns loaded Bundles in deterministic discovery order.

func (Result) Diagnostics

func (r Result) Diagnostics() []Diagnostic

Diagnostics returns load-time diagnostics.

func (Result) ResolveSkills

func (r Result) ResolveSkills(entries ...extension.SkillEntry) ([]harness.Skill, []Diagnostic, error)

ResolveSkills combines direct Skills with an activated Extension snapshot. Project direct wins over user direct, which wins over Bundle/Extension.

Jump to

Keyboard shortcuts

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