feat: prepare agen crates for publication
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
//!
|
||||
//! Disabled by default. Enable via `SessionConfig::record_event_trace`.
|
||||
|
||||
use llm_engine::llm_client::event::Event;
|
||||
use agen::llm_client::event::Event;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ pub mod system_item;
|
||||
pub mod worker_metadata;
|
||||
pub mod worker_session_store;
|
||||
|
||||
pub use agen::UsageRecord;
|
||||
pub use agen::llm_client::types::{ContentPart, Item, Role};
|
||||
pub use event_trace::{TraceEntry, TracePayload};
|
||||
pub use fs_store::FsStore;
|
||||
pub use llm_engine::UsageRecord;
|
||||
pub use llm_engine::llm_client::types::{ContentPart, Item, Role};
|
||||
pub use logged_item::{LoggedContentPart, LoggedItem, LoggedRole, from_logged, to_logged};
|
||||
pub use segment::{
|
||||
SegmentStartState, append_entry, append_system_item, classify_history_item,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Persistence-stable mirror of `llm_engine::Item`.
|
||||
//! Persistence-stable mirror of `agen::Item`.
|
||||
//!
|
||||
//! `LogEntry` does not embed `Item` directly because that couples the on-disk
|
||||
//! schema to the LLM worker's internal type — a field rename or addition there
|
||||
@@ -12,11 +12,11 @@
|
||||
//! `Reasoning::encrypted_content` is preserved because OpenAI Responses ZDR
|
||||
//! requires it on stateless re-send.
|
||||
|
||||
use base64::{Engine as _, engine::general_purpose::STANDARD};
|
||||
use llm_engine::{
|
||||
use agen::{
|
||||
llm_client::types::{ContentPart, Item, Role},
|
||||
tool::{Attachment, ImageAttachment},
|
||||
};
|
||||
use base64::{Engine as _, engine::general_purpose::STANDARD};
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer, de::Error as _};
|
||||
|
||||
fn is_false(value: &bool) -> bool {
|
||||
@@ -437,8 +437,8 @@ mod tests {
|
||||
"attached",
|
||||
None,
|
||||
false,
|
||||
vec![llm_engine::tool::Attachment::Image(
|
||||
llm_engine::tool::ImageAttachment::new(
|
||||
vec![agen::tool::Attachment::Image(
|
||||
agen::tool::ImageAttachment::new(
|
||||
"image/png",
|
||||
std::sync::Arc::<[u8]>::from(&b"secret-image-body"[..]),
|
||||
),
|
||||
|
||||
@@ -9,9 +9,9 @@ use crate::segment_log::{self, LogEntry, SegmentOrigin};
|
||||
use crate::store::{Store, StoreError};
|
||||
use crate::system_item::SystemItem;
|
||||
use crate::{SegmentId, SessionId};
|
||||
use llm_engine::EngineResult;
|
||||
use llm_engine::llm_client::RequestConfig;
|
||||
use llm_engine::llm_client::types::Item;
|
||||
use agen::EngineResult;
|
||||
use agen::llm_client::RequestConfig;
|
||||
use agen::llm_client::types::Item;
|
||||
use protocol::Segment;
|
||||
|
||||
/// State snapshot for creating a SegmentStart entry.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
//! ordered. Fork lineage references between segments use turn-number indices
|
||||
//! (`SegmentOrigin.at_turn_index`) rather than per-entry hashes.
|
||||
|
||||
use llm_engine::llm_client::types::{Item, RequestConfig};
|
||||
use llm_engine::{EngineResult, UsageRecord};
|
||||
use agen::llm_client::types::{Item, RequestConfig};
|
||||
use agen::{EngineResult, UsageRecord};
|
||||
use protocol::{InvokeKind, Segment};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -482,8 +482,8 @@ mod tests {
|
||||
"attached",
|
||||
None,
|
||||
false,
|
||||
vec![llm_engine::tool::Attachment::Image(
|
||||
llm_engine::tool::ImageAttachment::new("image/png", b"durable-image".to_vec()),
|
||||
vec![agen::tool::Attachment::Image(
|
||||
agen::tool::ImageAttachment::new("image/png", b"durable-image".to_vec()),
|
||||
)],
|
||||
)
|
||||
.into(),
|
||||
@@ -497,7 +497,7 @@ mod tests {
|
||||
Item::ToolResult { attachments, .. }
|
||||
if matches!(
|
||||
attachments.as_slice(),
|
||||
[llm_engine::tool::Attachment::Image(image)]
|
||||
[agen::tool::Attachment::Image(image)]
|
||||
if image.data() == b"durable-image"
|
||||
)
|
||||
));
|
||||
@@ -837,10 +837,10 @@ mod tests {
|
||||
assert_eq!(state.history.len(), 1);
|
||||
match &state.history[0] {
|
||||
Item::Message { role, content, .. } => {
|
||||
assert!(matches!(role, llm_engine::Role::User));
|
||||
assert!(matches!(role, agen::Role::User));
|
||||
assert_eq!(content.len(), 1);
|
||||
match &content[0] {
|
||||
llm_engine::ContentPart::Text { text } => {
|
||||
agen::ContentPart::Text { text } => {
|
||||
assert_eq!(text, "see line1\nline2@src/main.rs");
|
||||
}
|
||||
other => panic!("unexpected content: {other:?}"),
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! preserved only on the log/wire side; the LLM still sees plain
|
||||
//! system-message text.
|
||||
|
||||
use llm_engine::llm_client::types::Item;
|
||||
use agen::llm_client::types::Item;
|
||||
use protocol::WorkerEvent;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user