1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! [`ModelAccess`] — command handler access to the active LLM provider and model
//! selection, thinking-token budget, reasoning effort, and caveman mode.
use std::future::Future;
use std::pin::Pin;
/// Access to model/provider selection and per-provider generation parameters.
///
/// Implemented by `zeph-core::Agent<C>`. Part of the [`crate::AgentAccess`] supertrait.
pub trait ModelAccess {
// ----- /caveman -----
/// Handle `/caveman [on|off|status]` and return a user-visible result.
///
/// - `""` — toggle current state.
/// - `"on"` / `"enable"` — activate ultra-compressed output.
/// - `"off"` / `"disable"` — deactivate ultra-compressed output.
/// - `"status"` — report current state without changing it.
///
/// Returns a one-line confirmation string (e.g. `"caveman: on"`).
fn handle_caveman<'a>(
&'a mut self,
arg: &'a str,
) -> Pin<Box<dyn Future<Output = String> + Send + 'a>>;
// ----- /model, /provider -----
/// Handle `/model [arg]` and return a user-visible result.
fn handle_model<'a>(
&'a mut self,
arg: &'a str,
) -> Pin<Box<dyn Future<Output = String> + Send + 'a>>;
/// Handle `/provider [arg]` and return a user-visible result.
fn handle_provider<'a>(
&'a mut self,
arg: &'a str,
) -> Pin<Box<dyn Future<Output = String> + Send + 'a>>;
// ----- /think-tokens, /reasoning-effort -----
/// Handle `/think-tokens [N|Nk|NM|off]` and return a user-visible result.
///
/// Empty `arg` displays the active provider's current thinking-token budget. A non-empty
/// `arg` parses and applies a new budget (or disables thinking on `0`/`off`). Session-only:
/// never persisted. Returns a "not supported by provider X" message for providers that
/// do not support a thinking-token budget.
fn handle_think_tokens<'a>(
&'a mut self,
arg: &'a str,
) -> Pin<Box<dyn Future<Output = String> + Send + 'a>>;
/// Handle `/reasoning-effort [low|medium|high]` and return a user-visible result.
///
/// Empty `arg` displays the active provider's current reasoning-effort level. A non-empty
/// `arg` parses and applies a new level. Session-only: never persisted. Returns a "not
/// supported by provider X" message for providers that do not support a reasoning-effort
/// level.
fn handle_reasoning_effort<'a>(
&'a mut self,
arg: &'a str,
) -> Pin<Box<dyn Future<Output = String> + Send + 'a>>;
}