Skip to main content

Module portable_binary

Module portable_binary 

Source

Functions§

dir_on_path
True when dir is one of path_dirs, directly or through a symlink.
hook_binary_override
Verbatim hook-binary override (#708), or None when unset/blank.
in_cargo_output_dir
Whether path is an artifact in a cargo output directory on this disk: directly in a profile directory (<profile>/lean-ctx) or in its deps/examples (test and example binaries).
is_lean_ctx_hook_binary
Identify our hook executable without treating arbitrary user wrappers as owned.
is_lean_ctx_hook_command
True when command is <our hook binary> hook <operation>: the binary is ours (is_lean_ctx_hook_binary) and carries no shell metacharacters, so a user wrapper is never mistaken for a LeanCTX hook.
is_transient_build_binary
Whether path is an intermediate cargo artifact (#2232): anything under target/{debug,release}/{deps,build,examples,incremental}/ or the same below a target/<triple>/ directory, or below any other cargo profile directory recognised by what cargo wrote into it (a CARGO_TARGET_DIR of another name, a named profile).
launchers_on_path
Every lean-ctx launcher on PATH, in lookup order: the entry a shell runs for lean-ctx, followed by the ones it shadows.
path_dirs
The directories on PATH, in lookup order.
refuses_transient_binary_for_home
True when writing binary into the agent or shell configuration of home would bake a transient cargo artifact into the real account’s configuration (#2232). A test that runs a server or a hook refresh with the real HOME would otherwise point the user’s live hooks at a test binary that the next build deletes.
resolve_agent_binary
The binary path to write into agent configurations — MCP server command fields and agent hooks (#1873).
resolve_portable_binary
stable_shell_binary
The binary path to embed in machine-local shell artifacts — the shell hooks, env.sh and the _lc shims (#1851).