mirror of
https://github.com/jnsahaj/lumen.git
synced 2025-12-23 05:36:48 +00:00
- Add prompt configuration support for explain, draft, and operate - Update command execution to pass prompt configs to providers - Add default prompt configs and fallback to built-in prompts Signed-off-by: Huang Rui <vowstar@gmail.com>
30 lines
711 B
Rust
30 lines
711 B
Rust
use async_trait::async_trait;
|
|
|
|
use crate::{
|
|
config::configuration::LumenConfig,
|
|
error::LumenError,
|
|
git_entity::{commit::Commit, GitEntity},
|
|
provider::LumenProvider,
|
|
};
|
|
|
|
use super::{explain::ExplainCommand, Command, LumenCommand};
|
|
|
|
pub struct ListCommand;
|
|
|
|
#[async_trait]
|
|
impl Command for ListCommand {
|
|
async fn execute(
|
|
&self,
|
|
provider: &LumenProvider,
|
|
config: &LumenConfig,
|
|
) -> Result<(), LumenError> {
|
|
let sha = LumenCommand::get_sha_from_fzf()?;
|
|
let git_entity = GitEntity::Commit(Commit::new(sha)?);
|
|
ExplainCommand {
|
|
git_entity,
|
|
query: None,
|
|
}
|
|
.execute(provider, config)
|
|
.await
|
|
}
|
|
}
|