Repository navigation
Closed
Description
Overview
Establish the foundational type definitions, trait interfaces, message formats, and Tauri event constants that all agent-related issues code against. This issue produces no runtime behavior — only type definitions, trait declarations, and module scaffolding.
This is the single prerequisite that unblocks all parallel implementation streams.
Acceptance Criteria
- All types compile with
cargo check - All traits have complete async method signatures with
async_trait - Serde derives on all types that cross the Tauri boundary
- Constants for all Tauri event channel names
- Module re-exports everything from
agent_typesfor ergonomic imports - No runtime implementation — traits have no default method bodies
- Doc comments on every public type and trait method explaining the contract
- TypeScript interface equivalents for frontend event payloads
- Code passes
bun run quality:fix
Technical Specifications
New Module
packages/desktop-app/src-tauri/src/agent_types.rs(oragent_types/module)
Chat Inference Contract
ChatInferenceEnginetrait withgenerate(),model_info(),token_count()InferenceRequest— messages, temperature, max_tokens, stop_sequencesChatMessage— role (System/User/Assistant/Tool), content, tool_calls, tool_resultStreamingChunk— Token, ToolCall, Done, Error variantsToolCallRaw— function_name, arguments_json
Model Management Contract
ModelManagertrait — list, download, cancel, delete, load, loaded_modelModelInfo— id, name, filename, size, sha256, quantization, context_length, model_typeModelStatus— NotDownloaded, Downloading, Verifying, Ready, Loaded, ErrorDownloadEvent— Progress, Complete, FailedChatModelSpec— display_name, download_url, family, recommended, descriptionModelFamilyenum — Mistral, Qwen (future), Llama3 (future), DeepSeek (future)
Local Agent Contract
AgentToolExecutortrait — available_tools(), execute()AgentSession— id, started_at, model_id, message_count, statusLocalAgentStatus— Idle, Thinking, ToolExecution, Streaming, ErrorAgentTurnResult— response, tool_calls_made, tokens_usedToolDefinition— name, description, parameters_schemaToolResult— tool_name, success, outputToolExecutionRecord— tool_name, arguments, result, duration_ms, success
ACP Contract
AcpTransporttrait — send(), receive(), close(), is_connected()AgentRegistrytrait — discover_agents(), check_health(), get_agent()ContextAssemblertrait — assemble()AcpMessage— jsonrpc, id, method, params, result, errorAcpAgentInfo— id, name, binary_name, auth_method, availableAcpAuthMethod— AgentManaged, EnvApiKeyAcpSessionState— Idle, Initializing, Active, Completing, Completed, FailedContextPacket— selected_nodes, semantic_neighbors, relationships, system_prompt, token_budget
Tauri Event Constants
pub mod events {
pub const LOCAL_AGENT_CHUNK: &str = "local-agent://chunk";
pub const LOCAL_AGENT_TOOL: &str = "local-agent://tool";
pub const LOCAL_AGENT_STATUS: &str = "local-agent://status";
pub const LOCAL_AGENT_ERROR: &str = "local-agent://error";
pub const MODEL_DOWNLOAD_PROGRESS: &str = "model://download-progress";
pub const ACP_SESSION_STATE: &str = "acp://session-state";
pub const ACP_AGENT_MESSAGE: &str = "acp://agent-message";
}TypeScript Equivalents
- Event payload interfaces matching Rust serde output
- Command return type interfaces
- Located in
src/lib/types/agent-types.ts
Reference Files
packages/desktop-app/src-tauri/src/app_services.rs— existing service patternpackages/core/src/playbook/types.rs— example of well-structured type modulepackages/nlp-engine/src/lib.rs— existing NLP engine public API
Dependencies
- None (this unblocks everything)
Related Issues
- ACP Integration and Local LLM Capability #997 (parent epic)
Activity
malibio commentedon Apr 3, 2026
Baseline: Frontend tests crash in worktree with pre-existing vitest startup error (TypeError: Attempted to assign to readonly property). This is a worktree-specific tsconfig resolution issue, not a code regression. Rust compilation will be the primary validation for this types-only issue.
feat: shared types, traits, and interface contracts for agent subsyst…
feat: shared types, traits, and interface contracts for agent subsyst…
feat: shared types, traits, and interface contracts for agent subsyst…