feat: prepare agen crates for publication
This commit is contained in:
@@ -2,13 +2,13 @@ use std::collections::BTreeSet;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use agen::llm_client::client::LlmClient;
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use flow::{
|
||||
ConditionVerdict, FlowTransitionAttempt, FlowTransitionResolution, FlowVerifierOutcome,
|
||||
TransitionConditionResult, TransitionId,
|
||||
};
|
||||
use llm_engine::llm_client::client::LlmClient;
|
||||
use llm_engine::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use manifest::{Scope, WorkerManifest};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
@@ -199,7 +199,7 @@ impl Tool for RequestFlowTransitionTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: RequestFlowTransitionParams =
|
||||
serde_json::from_str(input_json).map_err(|error| {
|
||||
@@ -350,7 +350,7 @@ impl Tool for FinishFlowVerificationTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: FinishFlowVerificationParams =
|
||||
serde_json::from_str(input_json).map_err(|error| {
|
||||
@@ -630,16 +630,16 @@ impl FeatureModule for ReadOnlyFlowWorkdirFeature {
|
||||
mod tests {
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
||||
use flow::{FlowAttemptStatus, FlowTransitionRejection, StateId, TransitionCheckSnapshot};
|
||||
use futures::stream;
|
||||
use llm_engine::llm_client::client::{LlmClient, ResponseStream};
|
||||
use llm_engine::llm_client::error::ClientError;
|
||||
use llm_engine::llm_client::event::{
|
||||
use agen::llm_client::client::{LlmClient, ResponseStream};
|
||||
use agen::llm_client::error::ClientError;
|
||||
use agen::llm_client::event::{
|
||||
BlockDelta, BlockMetadata, BlockStart, BlockStop, BlockType, DeltaContent,
|
||||
Event as LlmEvent, StopReason,
|
||||
};
|
||||
use llm_engine::llm_client::types::Request;
|
||||
use llm_engine::tool::ToolExecutionContext;
|
||||
use agen::llm_client::types::Request;
|
||||
use agen::tool::ToolExecutionContext;
|
||||
use flow::{FlowAttemptStatus, FlowTransitionRejection, StateId, TransitionCheckSnapshot};
|
||||
use futures::stream;
|
||||
use manifest::WorkerManifest;
|
||||
use protocol::Segment;
|
||||
use session_store::{LogEntry, SegmentId, SessionId, Store};
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{
|
||||
Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
use workdir::http::{WorkdirSessionOperation, WorkdirSessionOperationResult};
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{
|
||||
Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput,
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -6,10 +6,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{
|
||||
Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput,
|
||||
};
|
||||
use memory::backend::{
|
||||
MemoryBackendHttpResponse, MemoryBackendOperation, MemoryBackendOperationResult,
|
||||
MemoryConsolidateStagingOperation, MemoryConsolidationOutput, MemoryDocumentReadOperation,
|
||||
@@ -343,7 +341,7 @@ fn query_schema() -> serde_json::Value {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use llm_engine::tool::ToolDefinition;
|
||||
use agen::tool::ToolDefinition;
|
||||
|
||||
fn test_client() -> Arc<dyn WorkspaceClient> {
|
||||
Arc::new(crate::worker::TestWorkspaceHttpClient::new(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use memory::backend::{
|
||||
MemoryBackendOperation, MemoryBackendOperationResult, MemoryStageCandidateOperation,
|
||||
};
|
||||
@@ -163,7 +163,7 @@ impl Tool for StageMemoryCandidateTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: StageMemoryCandidateParams =
|
||||
serde_json::from_str(input_json).map_err(|error| {
|
||||
@@ -249,7 +249,7 @@ impl Tool for FinishMemoryExtractionTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: FinishMemoryExtractionParams =
|
||||
serde_json::from_str(input_json).map_err(|error| {
|
||||
@@ -387,7 +387,7 @@ fn truncate_line(text: &str, max_chars: usize) -> String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use llm_engine::Item;
|
||||
use agen::Item;
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -451,7 +451,7 @@ mod tests {
|
||||
let error = tool
|
||||
.execute(
|
||||
r#"{"kind":"decision","claim":"claim","why_useful":"useful","entry_refs":["E00000009"]}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
|
||||
@@ -4,8 +4,8 @@ use crate::feature::{
|
||||
ToolDeclaration, ToolDefinition,
|
||||
};
|
||||
use crate::worker::{WorkspaceClient, WorkspaceRequest, WorkspaceRequestMethod};
|
||||
use agen::tool::{Tool, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{Tool, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use manifest::MergeRequestFeatureConfig;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{
|
||||
Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
|
||||
@@ -611,7 +609,7 @@ struct ObjectiveDetail {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use llm_engine::tool::ToolDefinition;
|
||||
use agen::tool::ToolDefinition;
|
||||
|
||||
fn tool_names(definitions: Vec<ToolDefinition>) -> Vec<String> {
|
||||
let mut names = definitions
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{
|
||||
Tool, ToolDefinition, ToolError, ToolExecutionContext, ToolMeta, ToolOutput,
|
||||
};
|
||||
use protocol::Segment;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
||||
@@ -181,7 +181,7 @@ impl Tool for ShowOverviewTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: ShowOverviewParams = parse_input("ShowOverview", input_json)?;
|
||||
let limit = bounded_limit(params.limit, DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT);
|
||||
@@ -223,7 +223,7 @@ impl Tool for SearchEntriesTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: SearchEntriesParams = parse_input("SearchEntries", input_json)?;
|
||||
let kind = params.kind.as_deref().map(parse_kind).transpose()?;
|
||||
@@ -286,7 +286,7 @@ impl Tool for ReadEntryTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: ReadEntryParams = parse_input("ReadEntry", input_json)?;
|
||||
let entry_ref = parse_entry_ref(¶ms.entry_ref)?;
|
||||
@@ -390,7 +390,7 @@ fn json_output(summary: String, value: serde_json::Value) -> Result<ToolOutput,
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use llm_engine::Item;
|
||||
use agen::Item;
|
||||
|
||||
use crate::feature::{FeatureRegistryBuilder, HookRegistryBuilder};
|
||||
|
||||
@@ -426,7 +426,7 @@ mod tests {
|
||||
async fn overview_uses_real_entry_refs_and_rejects_unknown_fields() {
|
||||
let tool = show_overview_definition(state())().1;
|
||||
let output = tool
|
||||
.execute("{}", llm_engine::tool::ToolExecutionContext::direct())
|
||||
.execute("{}", agen::tool::ToolExecutionContext::direct())
|
||||
.await
|
||||
.unwrap();
|
||||
let content = output.content.unwrap();
|
||||
@@ -438,7 +438,7 @@ mod tests {
|
||||
let error = tool
|
||||
.execute(
|
||||
r#"{"unexpected":true}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
@@ -451,7 +451,7 @@ mod tests {
|
||||
let output = search
|
||||
.execute(
|
||||
r#"{"from":"E00000003","through":"E00000003"}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -463,7 +463,7 @@ mod tests {
|
||||
let output = read
|
||||
.execute(
|
||||
r#"{"entry_ref":"E00000003"}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
use agen::Item;
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::Item;
|
||||
|
||||
mod store;
|
||||
mod tool_impl;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use llm_engine::Item;
|
||||
use agen::Item;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use serde::Deserialize;
|
||||
|
||||
use super::store::{DEFAULT_TASK_LIST_LIMIT, TaskEntry, TaskStatus, TaskStore, snapshot_overview};
|
||||
@@ -83,7 +83,7 @@ impl Tool for TaskCreateTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_ctx: llm_engine::tool::ToolExecutionContext,
|
||||
_ctx: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: TaskCreateParams = serde_json::from_str(input_json)
|
||||
.map_err(|e| ToolError::InvalidArgument(format!("invalid TaskCreate input: {e}")))?;
|
||||
@@ -106,7 +106,7 @@ impl Tool for TaskListTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_ctx: llm_engine::tool::ToolExecutionContext,
|
||||
_ctx: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: TaskListParams = serde_json::from_str(input_json)
|
||||
.map_err(|e| ToolError::InvalidArgument(format!("invalid TaskList input: {e}")))?;
|
||||
@@ -127,7 +127,7 @@ impl Tool for TaskGetTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_ctx: llm_engine::tool::ToolExecutionContext,
|
||||
_ctx: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: TaskGetParams = serde_json::from_str(input_json)
|
||||
.map_err(|e| ToolError::InvalidArgument(format!("invalid TaskGet input: {e}")))?;
|
||||
@@ -149,7 +149,7 @@ impl Tool for TaskUpdateTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_ctx: llm_engine::tool::ToolExecutionContext,
|
||||
_ctx: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: TaskUpdateParams = serde_json::from_str(input_json)
|
||||
.map_err(|e| ToolError::InvalidArgument(format!("invalid TaskUpdate input: {e}")))?;
|
||||
|
||||
@@ -31,7 +31,7 @@ use crate::feature::{
|
||||
ToolDefinition,
|
||||
};
|
||||
use crate::worker::{WorkspaceClient, WorkspaceRequest, WorkspaceRequestMethod};
|
||||
use llm_engine::tool::{Tool, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
use agen::tool::{Tool, ToolError, ToolExecutionContext, ToolMeta, ToolOutput};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum WorkspaceTicketReadKind {
|
||||
@@ -1230,7 +1230,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn pending_tool_description(
|
||||
pending_tools: &[llm_engine::tool::ToolDefinition],
|
||||
pending_tools: &[agen::tool::ToolDefinition],
|
||||
name: &str,
|
||||
) -> String {
|
||||
pending_tools
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use agen::Item;
|
||||
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use async_trait::async_trait;
|
||||
use llm_engine::Item;
|
||||
use llm_engine::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use session_store::collect_state;
|
||||
@@ -495,7 +495,7 @@ impl Tool for ViewSessionOverviewTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: ViewSessionOverviewParams = parse_input("ViewSessionOverview", input_json)?;
|
||||
let view = latest_view(&*self.provider, ¶ms.subject).await?;
|
||||
@@ -540,7 +540,7 @@ impl Tool for SearchSessionEntriesTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: SearchSessionEntriesParams = parse_input("SearchSessionEntries", input_json)?;
|
||||
let view = latest_view(&*self.provider, ¶ms.subject).await?;
|
||||
@@ -598,7 +598,7 @@ impl Tool for ReadSessionEntryTool {
|
||||
async fn execute(
|
||||
&self,
|
||||
input_json: &str,
|
||||
_context: llm_engine::tool::ToolExecutionContext,
|
||||
_context: agen::tool::ToolExecutionContext,
|
||||
) -> Result<ToolOutput, ToolError> {
|
||||
let params: ReadSessionEntryParams = parse_input("ReadSessionEntry", input_json)?;
|
||||
let entry_ref = parse_entry_ref(¶ms.entry_ref)?;
|
||||
@@ -714,7 +714,7 @@ fn json_output(summary: String, value: serde_json::Value) -> Result<ToolOutput,
|
||||
mod tests {
|
||||
use std::sync::Mutex;
|
||||
|
||||
use llm_engine::Role;
|
||||
use agen::Role;
|
||||
|
||||
use crate::feature::{FeatureRegistryBuilder, HookRegistryBuilder};
|
||||
|
||||
@@ -797,7 +797,7 @@ mod tests {
|
||||
let hidden = read
|
||||
.execute(
|
||||
r#"{"subject":{"kind":"runtime_worker","runtime_id":"runtime-1","worker_id":"unauthorized"},"entry_ref":"E00000000"}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
@@ -811,7 +811,7 @@ mod tests {
|
||||
let output = read
|
||||
.execute(
|
||||
r#"{"subject":{"kind":"runtime_worker","runtime_id":"runtime-1","worker_id":"granted"},"entry_ref":"E00000000"}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -820,7 +820,7 @@ mod tests {
|
||||
let output = read
|
||||
.execute(
|
||||
r#"{"subject":{"kind":"runtime_worker","runtime_id":"runtime-1","worker_id":"granted"},"entry_ref":"E00000001"}"#,
|
||||
llm_engine::tool::ToolExecutionContext::direct(),
|
||||
agen::tool::ToolExecutionContext::direct(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user