LemonCliRunners.Types (lemon_cli_runners v0.1.0)

View Source

Core type definitions for CLI-based subprocess runners.

This module provides the unified event types used by all CLI runners (Codex, Claude, etc.) to communicate with the rest of the system.

Event Types

  • ResumeToken - Session identifier for resuming interrupted sessions
  • Action - A discrete action performed by the CLI agent
  • StartedEvent - Emitted when a session begins
  • ActionEvent - Emitted for action lifecycle (started/updated/completed)
  • CompletedEvent - Emitted when a session ends

Design Philosophy

These types mirror the Takopi project's event model, enabling:

  • Unified event handling across different CLI tools
  • Session persistence and resumption
  • Progress tracking and UI updates

Summary

Types

Kind of action being performed.

Severity level for action messages.

Phase of an action's lifecycle.

Union of all CLI runner event types.

Types

action_kind()

@type action_kind() ::
  :command
  | :tool
  | :file_change
  | :web_search
  | :subagent
  | :note
  | :turn
  | :warning
  | :telemetry

Kind of action being performed.

  • :command - Shell command execution
  • :tool - Tool/MCP call
  • :file_change - File modification
  • :web_search - Web search
  • :subagent - Subagent invocation
  • :note - Informational note
  • :turn - Conversation turn marker
  • :warning - Warning message
  • :telemetry - Telemetry/metrics

action_level()

@type action_level() :: :debug | :info | :warning | :error

Severity level for action messages.

action_phase()

@type action_phase() :: :started | :updated | :completed

Phase of an action's lifecycle.

  • :started - Action has begun
  • :updated - Action is in progress with new information
  • :completed - Action has finished

cli_event()

Union of all CLI runner event types.