CliSubprocessCore.ProviderCLI (CliSubprocessCore v0.1.0)

Copy Markdown View Source

Shared provider-specific CLI resolution policies for the core runtime.

Built-in provider profiles should resolve their launch program through this module instead of duplicating discovery logic in downstream adapters.

Summary

Functions

Classifies a provider runtime failure after launch selection has already completed.

Maps a classified runtime failure to the stable public error code used across the shared provider/runtime stack.

Types

resolve_opt()

@type resolve_opt() ::
  {:allow_js_entrypoint, boolean()}
  | {:default_command, String.t()}
  | {:display_name, String.t()}
  | {:env_var, String.t() | nil}
  | {:execution_surface,
     ExternalRuntimeTransport.ExecutionSurface.t() | map() | keyword() | nil}
  | {:extra_keys, [atom()]}
  | {:install_hint, String.t() | nil}
  | {:known_locations, [String.t()]}
  | {:known_locations_first?, boolean()}
  | {:node_command, String.t()}
  | {:npm_global_bin, String.t() | nil}
  | {:npx_command, String.t() | nil}
  | {:npx_disable_env, String.t() | nil}
  | {:npx_package, String.t() | nil}
  | {:path_candidates, [String.t()]}
  | {:resolution_cwd, String.t() | nil}

runtime_failure_opt()

@type runtime_failure_opt() ::
  {:command, String.t() | nil}
  | {:cwd, String.t() | nil}
  | {:execution_surface,
     ExternalRuntimeTransport.ExecutionSurface.t() | map() | keyword() | nil}
  | {:stderr, String.t() | nil}

Functions

resolve(provider, provider_opts \\ [], opts \\ [])

resolve!(provider, provider_opts \\ [], opts \\ [])

@spec resolve!(atom(), keyword(), [resolve_opt()]) ::
  CliSubprocessCore.CommandSpec.t()

runtime_failure(provider, reason, opts \\ [])

Classifies a provider runtime failure after launch selection has already completed.

This covers both local transport errors (for example {:command_not_found, "gemini"}) and remote execution failures that only become visible after the provider command is invoked over an execution surface such as SSH.

runtime_failure_code(error_runtime_failure)

Maps a classified runtime failure to the stable public error code used across the shared provider/runtime stack.