prepared

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package prepared holds the small helpers the direct file/context tools share at the preparation boundary: reading a call's typed prepared artifact back from the context and building the direct filesystem requirements (empty grant pair — the tool enforces the approved resolved resource itself).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext[T tool.PreparedArtifact](ctx context.Context) (T, bool)

FromContext returns the typed prepared artifact bound to this call, or (zero, false) when the call runs without one — the fail-closed path for every prepared tool.

func PathReadRequirement

func PathReadRequirement(abs string) tool.Requirement

PathReadRequirement builds the direct filesystem.read requirement for ONE canonical resolved path (Scope and Match are both the canonical path), with the matching reusable exact-path allow candidate.

func TreeReadRequirement

func TreeReadRequirement(rootAbs string) tool.Requirement

TreeReadRequirement builds the direct filesystem.read requirement for a tool that walks the WHOLE canonical root (Glob/Grep): the Scope stays the plain canonical root path — the profile resolves access AT that path, and the walk never leaves the workspace — while the Match uses the canonical tree encoding so durable tree rules cover it. The candidate offers the same tree rule for reuse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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