local

package
v0.2.35 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package local is the dev/self-host workspace provider: a workspace is a directory under --workspace-local-root, and exec runs the command as the chassis's own uid with that directory as HOME and cwd.

There is NO isolation beyond a scrubbed environment and a cwd guard — the command can read anything the chassis uid can. That is why the chassis refuses this provider unless --workspace-allow-local is set explicitly, never implied by --env, and logs a WARN pair at boot.

import _ "github.com/loremlabs/thanks-computer/chassis/workspace/local"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider keeps every workspace under root.

func New

func New(root string) (*Provider, error)

New creates (if needed) and resolves the root directory. Symlinks in the root are resolved once here so the cwd guard compares real paths.

func (*Provider) Capabilities

func (p *Provider) Capabilities() []string

func (*Provider) Create

func (p *Provider) Create(_ context.Context, spec workspace.Spec) (workspace.Handle, error)

Create makes the directory (idempotent).

func (*Provider) Destroy

func (p *Provider) Destroy(_ context.Context, h workspace.Handle) error

Destroy removes the directory. Guarded to the root so a forged handle cannot remove anything else.

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) ReachesGrants added in v0.2.31

func (p *Provider) ReachesGrants() bool

ReachesGrants: a local workspace's commands run on this machine, as this user, so they reach the chassis's grant socket and its mounted files.

func (*Provider) Root

func (p *Provider) Root() string

Root is the resolved root directory.

func (*Provider) Sleep

Sleep is a no-op: nothing to park.

func (*Provider) Status

Status is "running" while the directory exists (LastUsed = its mtime), "destroyed" otherwise.

func (*Provider) Wake

Wake checks the directory still exists and hands back a Computer bound to it. Bookkeeping only — a directory is never asleep.

Jump to

Keyboard shortcuts

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