objectiveai_cli/command/agents/logs/
open.rs1use objectiveai_sdk::cli::command::agents::logs::open::{Request, Response};
6
7use crate::context::Context;
8use crate::error::Error;
9
10pub async fn execute(ctx: &Context, request: Request) -> Result<Response, Error> {
11 crate::db::logs::read_by_id(ctx.db_client().await?, request.id)
12 .await?
13 .ok_or_else(|| {
14 Error::Filesystem(crate::filesystem::Error::NotFound(format!(
15 "objectiveai.messages row at index {}",
16 request.id
17 )))
18 })
19}
20
21pub mod request_schema {
22 use objectiveai_sdk::cli::command::agents::logs::open as sdk;
23 use objectiveai_sdk::cli::command::agents::logs::open::request_schema::{Request, Response};
24
25 use crate::context::Context;
26 use crate::error::Error;
27
28 pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
29 Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Request)))
30 }
31}
32
33pub mod response_schema {
34 use objectiveai_sdk::cli::command::agents::logs::open as sdk;
35 use objectiveai_sdk::cli::command::agents::logs::open::response_schema::{Request, Response};
36
37 use crate::context::Context;
38 use crate::error::Error;
39
40 pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
41 Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Response)))
42 }
43}