Documentation
¶
Index ¶
- Constants
- func EnsureUserPathContains(dir string) error
- func ExpandHome(path string) (string, error)
- func LoadSecretsFile(path string) (map[string]string, error)
- func LooksLikePath(s string) bool
- func OpagentBinDir() string
- func ProjectSystemToolBins(baseDir string) error
- func RemoveProjectedPaths(paths []string) error
- func ResolveAbsolutePath(workDir, path string) (string, error)
- func ResolveSecretRefs(value string, secrets map[string]string) (string, error)
- func StripJSONComments(raw []byte) ([]byte, error)
- func SyncToolBinProjection(baseDir string, toolRoot string, previousPaths []string) ([]string, error)
- func UnmarshalJSONC(raw []byte, out any) error
- func WithPrependedPath(env []string, dirs ...string) []string
Constants ¶
const ToolManifestName = "TOOL.md"
Variables ¶
This section is empty.
Functions ¶
func EnsureUserPathContains ¶
func ExpandHome ¶
func LoadSecretsFile ¶
LoadSecretsFile reads a simple env-style secrets file. Lines are KEY=VALUE. Empty lines and lines starting with '#' are ignored.
func LooksLikePath ¶
LooksLikePath checks if a string looks like a file or directory path. Cross-platform support for both Unix and Windows paths. Returns true if the string: - Is an absolute path (Unix: /root, Windows: C:\) - Starts with "~", "~/" or "~\" (home directory path) - Starts with "./" or ".\" or "../" or "..\" (relative path) - Contains path separator "/" or "\" Returns false for command-line flags (strings starting with "-")
func OpagentBinDir ¶
func OpagentBinDir() string
func ProjectSystemToolBins ¶
func RemoveProjectedPaths ¶
func ResolveAbsolutePath ¶
ResolveAbsolutePath returns a reliable absolute path based on workDir and path. - Supports ~ and ~/ prefix expansion - If workDir is empty, uses current working directory - If path is absolute, returns the cleaned result - Otherwise, joins workDir with path and returns the cleaned result
func ResolveSecretRefs ¶
ResolveSecretRefs replaces @id tokens using the provided secrets map.
func StripJSONComments ¶
func SyncToolBinProjection ¶
func UnmarshalJSONC ¶
UnmarshalJSONC unmarshals JSON after stripping JavaScript-style comments. It supports // line comments and /* block comments */. Other JSONC features such as trailing commas are intentionally not supported.
func WithPrependedPath ¶
Types ¶
This section is empty.