Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[target.x86_64-unknown-linux-musl]
linker = "musl-gcc"
rustflags = ["-C", "relocation-model=static"]
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
profile = "minimal"
targets = ["x86_64-unknown-linux-musl"]
14 changes: 12 additions & 2 deletions src/apps/cli/src/agent/core_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! receive dequeued envelopes.

use anyhow::Result;
use serde_json::Value;
use std::path::PathBuf;
use std::sync::Arc;
use tokio::sync::Mutex;
Expand Down Expand Up @@ -219,6 +220,15 @@ impl Agent for CoreAgentAdapter {
}

async fn send_message(&self, message: String, agent_type: &str) -> Result<String> {
self.send_message_with_metadata(message, agent_type, None).await
}

async fn send_message_with_metadata(
&self,
message: String,
agent_type: &str,
metadata: Option<Value>,
) -> Result<String> {
let session_id = self.ensure_session(agent_type).await?;
tracing::info!("Sending message to session {}: {}", session_id, message);

Expand All @@ -242,7 +252,7 @@ impl Agent for CoreAgentAdapter {
agent_type.to_string(),
Some(self.workspace_path_string()),
DialogSubmissionPolicy::for_source(DialogTriggerSource::Cli),
None,
metadata.clone(),
)
.await;

Expand All @@ -264,7 +274,7 @@ impl Agent for CoreAgentAdapter {
agent_type.to_string(),
Some(self.workspace_path_string()),
DialogSubmissionPolicy::for_source(DialogTriggerSource::Cli),
None,
metadata,
)
.await?;
} else {
Expand Down
11 changes: 11 additions & 0 deletions src/apps/cli/src/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ pub trait Agent: Send + Sync {
/// Returns the turn_id. Events are consumed externally via EventQueue.
async fn send_message(&self, message: String, agent_type: &str) -> Result<String>;

/// Send a message with additional user-message metadata.
async fn send_message_with_metadata(
&self,
message: String,
agent_type: &str,
metadata: Option<serde_json::Value>,
) -> Result<String> {
let _ = metadata;
self.send_message(message, agent_type).await
}

/// Cancel the current dialog turn (if any)
async fn cancel_current_turn(&self) -> Result<()>;

Expand Down
Loading