workspace

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeGlobal = "global"
	ScopeLocal  = "local"
)

Variables

This section is empty.

Functions

func ParseScoped

func ParseScoped(rel string) (scope, path string, ok bool)

ParseScoped splits scoped paths such as "global:skills" or "local:.". Bare paths and absolute paths (~/foo, /abs) are not scoped.

func Resolve

func Resolve(path string) (string, error)

Resolve expands ~/ and returns an absolute path. Use at build time for workspace.root config.

func ResolveRel

func ResolveRel(base, rel string) (string, error)

ResolveRel maps rel against base. Absolute paths and ~/ bypass base. Resolving one level above base is allowed: when the local root is <project>/.agentkit, tools reach the project itself through "..".

func ResolveRelStrict

func ResolveRelStrict(base, rel string) (string, error)

ResolveRelStrict is ResolveRel with the parent-directory exemption removed: nothing outside base resolves, not even one level up. Use it for roots that are an isolation boundary rather than a convenience default — a per-tenant root sits next to its siblings, so allowing ".." there would let one tenant read and write another's workdir.

Types

type Service

type Service interface {
	Resolve(ctx context.Context, rel string) (string, error)
}

Service resolves config-relative paths for the current request context. Implementations may scope roots by session, agent, or other ctx values; swap the workspace plugin to change isolation policy.

func Static

func Static(root string) Service

Static returns a fixed-root Service for tests.

Jump to

Keyboard shortcuts

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