LemonCliRunners. ToolActionHelpers
(lemon_cli_runners v0.1.0)
View Source
Shared helpers for translating tool calls and tool results into action events.
This module provides a small abstraction for managing pending tool actions and normalizing tool output across CLI runners (e.g., Claude, Kimi).
Summary
Types
Kind of action for UI display
Functions
Make an absolute path relative to cwd when possible.
Convert atom keys to string keys in a map (shallow).
Find the first non-empty string value for any of the given keys.
Classify a tool call into a kind and human-readable title.
Types
Functions
@spec complete_action( LemonCliRunners.Types.EventFactory.t(), map(), String.t(), boolean(), map(), atom(), String.t() ) :: {LemonCliRunners.Types.ActionEvent.t(), LemonCliRunners.Types.EventFactory.t(), map()}
Make an absolute path relative to cwd when possible.
@spec start_action( LemonCliRunners.Types.EventFactory.t(), map(), String.t(), atom(), String.t(), map() ) :: {LemonCliRunners.Types.ActionEvent.t(), LemonCliRunners.Types.EventFactory.t(), map()}
Convert atom keys to string keys in a map (shallow).
Find the first non-empty string value for any of the given keys.
@spec tool_kind_and_title(String.t(), map(), keyword()) :: {action_kind(), String.t()}
Classify a tool call into a kind and human-readable title.
Options
:path_keys- list of map keys to search for file paths (required):cwd- working directory for relativizing paths