localworkspace

package
v0.0.14-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CapabilityDirectory = agentcapabilities.Directory
View Source
const WriteMaxBytes = proto.WorkspaceWriteMaxBytes

This private transfer bound is distinct from the public inline-file limit.

Variables

View Source
var (
	ErrWorkspaceReadUnavailable = errors.New("workspace read unavailable")
	ErrWorkspaceReadBusy        = errors.New("workspace read busy")
	ErrWorkspaceReadInvalid     = errors.New("workspace read invalid")
	ErrWorkspaceReadUncertain   = errors.New("workspace read outcome uncertain")
	// ErrWorkspaceNotDirectory reports that a directory request's own path is
	// missing, a regular file or a symbolic link; the link was not followed.
	ErrWorkspaceNotDirectory = errors.New("workspace path is not a directory")
)
View Source
var (
	ErrWorkspaceWriteUnsupported = fmt.Errorf("%w: workspace write", agent.ErrUnsupportedOperation)
	ErrWorkspaceWriteUnavailable = errors.New("workspace write unavailable")
	ErrWorkspaceWriteBusy        = errors.New("workspace write busy")
	ErrWorkspaceWriteInvalid     = errors.New("workspace write invalid")
	ErrWorkspaceWriteRejected    = errors.New("workspace write rejected")
	ErrWorkspaceWriteUncertain   = errors.New("workspace write outcome uncertain")
)
View Source
var (
	ErrWorkspaceWriteDirectory = fmt.Errorf("%w: destination is a directory", ErrWorkspaceWriteRejected)
	ErrWorkspaceWriteUnsafe    = fmt.Errorf("%w: destination exists or its path is not a plain directory chain", ErrWorkspaceWriteRejected)
)

Known Files.create destination refusals. Both wrap ErrWorkspaceWriteRejected: nothing was installed.

View Source
var ErrInitializationUnconfirmed = errors.New("Runtime initialization unconfirmed")

Functions

func Bind added in v0.0.13

func Bind(environment, workspace, capabilityDirectory string) error

Bind freezes the Runtime's Environment binding for this process. It runs once, before any Harness discovery.

func InitializationDirectory

func InitializationDirectory() (string, error)

InitializationDirectory resolves the operator's local resource layout. The protocol and preparation operations do not distinguish Environment sources.

func MCPStdioCommand

func MCPStdioCommand(server proto.EnvironmentMCP) (string, []string)

MCPStdioCommand resolves the common installed manifest in the daemon.

func PackageDirectory

func PackageDirectory() (string, error)

func ReadOptionalToolEnvironment

func ReadOptionalToolEnvironment() (map[string]string, error)

ReadOptionalToolEnvironment permits a Runtime without explicit user variables.

func ReadToolEnvironment

func ReadToolEnvironment() (map[string]string, error)

ReadToolEnvironment reads bounded explicit configuration, never ambient secrets.

func ResolvePackageManagerCommand

func ResolvePackageManagerCommand(command string, args []string) (string, []string, error)

ResolvePackageManagerCommand runs Windows npm/npx shims through their installed JavaScript entrypoints. It does not pass arguments through an extra shell.

func SkillPath

func SkillPath(skill proto.InstalledSkill) string

func Unbind added in v0.0.13

func Unbind()

Unbind clears the Binding set by Bind.

Types

type Binding

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

Binding freezes operator-owned identity and paths for one Runtime lifetime.

func Current added in v0.0.13

func Current() *Binding

Current returns the Binding set by Bind, or nil when the Runtime serves no dedicated Environment.

func NewWithCapabilityDirectory

func NewWithCapabilityDirectory(environment, workspace, directory string) (*Binding, error)

NewWithCapabilityDirectory freezes paths selected by the Runtime operator.

func (*Binding) AcceptsFileWrite

func (b *Binding) AcceptsFileWrite(environment string) bool

func (*Binding) ApplyRuntimePreparation

func (b *Binding) ApplyRuntimePreparation(ctx context.Context, input proto.RuntimePreparePayload, data []byte) error

ApplyRuntimePreparation settles every filesystem operation before returning. A cancelled caller never leaves an unowned installation goroutine behind.

func (*Binding) CanExport

func (b *Binding) CanExport() bool

func (*Binding) Configure

Configure validates the reference before supplying the immutable local cwd.

func (*Binding) Environment added in v0.0.13

func (b *Binding) Environment() string

Environment is the bound Environment ID.

func (*Binding) ExportOutputs

func (b *Binding) ExportOutputs(ctx context.Context, output io.Writer) error

func (*Binding) ListWorkspaceDirectory

func (b *Binding) ListWorkspaceDirectory(ctx context.Context, path string, limit int) (*proto.WorkspaceDirectoryResult, error)

func (*Binding) Matches

func (b *Binding) Matches(environment string) bool

func (*Binding) Prepare

Prepare runs under the admitted executor's lifetime, before native startup. Reconnection validates installed contents without reopening mutable sources.

func (*Binding) ReadToolEnvironment

func (b *Binding) ReadToolEnvironment() (map[string]string, error)

ReadToolEnvironment reads explicit initialization values for this installation.

func (*Binding) ReadWorkspaceFile

func (b *Binding) ReadWorkspaceFile(ctx context.Context, path string, limit int) (WorkspaceReadResult, error)

ReadWorkspaceFile returns the existing protocol's bounded prefix; the wire has no offset field. Non-regular entries cannot become unbounded streams.

func (*Binding) RemoveOtherSessionState added in v0.0.14

func (b *Binding) RemoveOtherSessionState(keepKey string) error

RemoveOtherSessionState deletes every Session's native state but keepKey's.

func (*Binding) Workspace added in v0.0.13

func (b *Binding) Workspace() string

Workspace is the directory bound as the Environment's workspace.

func (*Binding) WriteWorkspaceFile

func (b *Binding) WriteWorkspaceFile(ctx context.Context, path string, data []byte) (result WorkspaceWriteResult, err error)

WriteWorkspaceFile starts only after the caller supplies the complete bounded body. Core must persist mutation ownership before invoking this operation.

type InitializationFailure

type InitializationFailure struct{ ExitCode *int }

InitializationFailure contains only a confirmed step's safe exit status.

func (*InitializationFailure) Error

func (*InitializationFailure) Error() string

type WorkspaceReadResult added in v0.0.13

type WorkspaceReadResult struct {
	Data      []byte
	Truncated bool
}

type WorkspaceWriteResult added in v0.0.13

type WorkspaceWriteResult struct {
	SizeBytes int64
}

Jump to

Keyboard shortcuts

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