Documentation
¶
Index ¶
- Constants
- Variables
- func Bind(environment, workspace, capabilityDirectory string) error
- func InitializationDirectory() (string, error)
- func MCPStdioCommand(server proto.EnvironmentMCP) (string, []string)
- func PackageDirectory() (string, error)
- func ReadOptionalToolEnvironment() (map[string]string, error)
- func ReadToolEnvironment() (map[string]string, error)
- func ResolvePackageManagerCommand(command string, args []string) (string, []string, error)
- func SkillPath(skill proto.InstalledSkill) string
- func Unbind()
- type Binding
- func (b *Binding) AcceptsFileWrite(environment string) bool
- func (b *Binding) ApplyRuntimePreparation(ctx context.Context, input proto.RuntimePreparePayload, data []byte) error
- func (b *Binding) CanExport() bool
- func (b *Binding) Configure(r proto.PromptRequestPayload) (proto.PromptRequestPayload, error)
- func (b *Binding) Environment() string
- func (b *Binding) ExportOutputs(ctx context.Context, output io.Writer) error
- func (b *Binding) ListWorkspaceDirectory(ctx context.Context, path string, limit int) (*proto.WorkspaceDirectoryResult, error)
- func (b *Binding) Matches(environment string) bool
- func (b *Binding) Prepare(ctx context.Context, r proto.PromptRequestPayload) (proto.PromptRequestPayload, error)
- func (b *Binding) ReadToolEnvironment() (map[string]string, error)
- func (b *Binding) ReadWorkspaceFile(ctx context.Context, path string, limit int) (WorkspaceReadResult, error)
- func (b *Binding) RemoveOtherSessionState(keepKey string) error
- func (b *Binding) Workspace() string
- func (b *Binding) WriteWorkspaceFile(ctx context.Context, path string, data []byte) (result WorkspaceWriteResult, err error)
- type InitializationFailure
- type WorkspaceReadResult
- type WorkspaceWriteResult
Constants ¶
const CapabilityDirectory = agentcapabilities.Directory
const WriteMaxBytes = proto.WorkspaceWriteMaxBytes
This private transfer bound is distinct from the public inline-file limit.
Variables ¶
var ( 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") )
var ( ErrWorkspaceWriteUnsupported = fmt.Errorf("%w: workspace write", agent.ErrUnsupportedOperation) 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") )
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.
var ErrInitializationUnconfirmed = errors.New("Runtime initialization unconfirmed")
Functions ¶
func Bind ¶ added in v0.0.13
Bind freezes the Runtime's Environment binding for this process. It runs once, before any Harness discovery.
func InitializationDirectory ¶
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 ReadOptionalToolEnvironment ¶
ReadOptionalToolEnvironment permits a Runtime without explicit user variables.
func ReadToolEnvironment ¶
ReadToolEnvironment reads bounded explicit configuration, never ambient secrets.
func ResolvePackageManagerCommand ¶
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
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 ¶
NewWithCapabilityDirectory freezes paths selected by the Runtime operator.
func (*Binding) AcceptsFileWrite ¶
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) Configure ¶
func (b *Binding) Configure(r proto.PromptRequestPayload) (proto.PromptRequestPayload, error)
Configure validates the reference before supplying the immutable local cwd.
func (*Binding) Environment ¶ added in v0.0.13
Environment is the bound Environment ID.
func (*Binding) ExportOutputs ¶
func (*Binding) ListWorkspaceDirectory ¶
func (*Binding) Prepare ¶
func (b *Binding) Prepare(ctx context.Context, r proto.PromptRequestPayload) (proto.PromptRequestPayload, error)
Prepare runs under the admitted executor's lifetime, before native startup. Reconnection validates installed contents without reopening mutable sources.
func (*Binding) ReadToolEnvironment ¶
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
RemoveOtherSessionState deletes every Session's native state but keepKey's.
func (*Binding) Workspace ¶ added in v0.0.13
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 WorkspaceWriteResult ¶ added in v0.0.13
type WorkspaceWriteResult struct {
SizeBytes int64
}