workspace

package
v0.3.34 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AttachFSRel added in v0.3.33

func AttachFSRel(ws Service, name string) string

AttachFSRel is the agent-facing path for a file under upload (e.g. upload/foo).

func AttachRel added in v0.3.33

func AttachRel(ws Service, filename string) string

AttachRel returns the tenant-root-relative path for a file under the configured upload directory.

func CanonicalWorkPath added in v0.3.33

func CanonicalWorkPath(workDir, rel string) string

CanonicalWorkPath normalizes to tenant-root-relative form under workDir. Scoped paths (global:/local:) and Windows drive paths are returned unchanged.

func FirstScoped added in v0.3.33

func FirstScoped(files []string, scope string) (string, error)

FirstScoped returns the first entry in files whose global:/local: prefix matches scope. For ScopeLocal, a bare path (no colon) is used when no local: entry exists. Other colon-bearing strings (URLs, Windows drives) are not treated as bare paths.

func IsScoped added in v0.3.33

func IsScoped(rel string) bool

IsScoped reports whether rel uses a configuration-only global:/local: prefix.

func JoinWork added in v0.3.33

func JoinWork(workDir, rel string) string

JoinWork builds a tenant-root-relative path under workDir.

func LocalPath added in v0.3.33

func LocalPath(rel string) string

LocalPath adds the local: scope prefix for configuration (e.g. shell cwd, bootstrap workDir). Runtime code should use tenant-root-relative work/… paths and runtime/workspace.ResolveFile.

func NormalizeAgentRel added in v0.3.33

func NormalizeAgentRel(workDir, rel string) string

NormalizeAgentRel maps agent-facing paths to tenant-root-relative form under workDir, stripping redundant work/ prefixes. Scoped and Windows drive paths pass through.

func ParseScoped

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

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

func ScopedPath added in v0.3.33

func ScopedPath(scope, rel string) string

ScopedPath prefixes a tenant-local relative path for workspace.Resolve.

func StripWorkPrefix added in v0.3.33

func StripWorkPrefix(workDir, rel string) string

StripWorkPrefix removes leading workDir/ segments from tenant-root-relative paths.

func UploadWorkRel added in v0.3.33

func UploadWorkRel(ws Service) string

UploadWorkRel is the upload directory relative to the agent work tree (e.g. upload).

func WorkLayout added in v0.3.33

func WorkLayout(ws Service) (workDir, uploadDir string)

WorkLayout reads agent work layout from the workspace service.

Types

type Layout added in v0.3.23

type Layout interface {
	Service
	WorkDirRel() string
	UploadDirRel() string
}

Layout reports tenant-local agent directory layout (inbound uploads, shell cwd). workspace/default and workspace/tenant implement this; keep filesystem/local.config.root and tool/shell-bash.config.workDir aligned with WorkDirRel().

type LocalTenantWalker added in v0.3.13

type LocalTenantWalker interface {
	Service
	WalkLocalTenants(ctx context.Context, fn func(context.Context) error) error
}

LocalTenantWalker enumerates isolated local workspace roots (multi-tenant setups). Implementations call fn with TurnEnvelope.Workspace set for each tenant.

type Service

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

Service maps configuration-relative paths to host absolute paths for the current request context. Resolve always returns a cleaned absolute path when it succeeds.

The global:/local: prefixes (see ParseScoped) are configuration vocabulary only — YAML, preset fields, and plugin constructor config. After resolution (plugin init or per-request via Resolve / runtime/workspace.ResolveFile), runtime code and model-facing surfaces must not carry those prefixes.

Jump to

Keyboard shortcuts

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