trusty-code 0.4.0

Per-project Claude-Code-compatible MPM orchestration harness (bin: tcode) — an original coding harness, tracked under epic #2052.
Documentation
[package]
name = "trusty-code"
# #6286: `TurnMemorySink` and `RecallSessionTool` take a socket path rather than
# a base URL, and `memory_envelope::call_tool_wrapped` takes a `&Path`. Cargo's
# 0.x rule puts a breaking change in the MINOR position.
version = "0.4.0"
edition = "2024"
rust-version.workspace = true
# license.workspace resolves to "MIT"; LICENSE is kept in-crate for correctness.
license.workspace = true
authors.workspace = true
repository.workspace = true
description = "Per-project Claude-Code-compatible MPM orchestration harness (bin: tcode) — an original coding harness, tracked under epic #2052."
readme = "README.md"
homepage = "https://github.com/bobmatnyc/trusty-tools"
keywords = ["cli", "mcp", "orchestration", "agents", "harness"]
categories = ["command-line-utilities", "development-tools"]

[[bin]]
name = "tcode"
path = "src/main.rs"

[lib]
name = "trusty_code"
path = "src/lib.rs"

[dependencies]
# Core error handling and async runtime
anyhow = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }

# Serialization (events, ipc, perf, build_info, tools, agents)
serde = { workspace = true }
serde_json = { workspace = true }

# Timestamp support (perf, build_info)
chrono = { workspace = true }

# UUID generation (ipc task IDs)
uuid = { workspace = true }

# CLI entry point (tcode binary)
clap = { workspace = true }
tracing-subscriber = { workspace = true }

# Phase 2: async trait dispatch for ToolExecutor, AgentRunner, SearchProvider
async-trait = { workspace = true }

# #2893 (epic #2892): shared `ServiceTier`/`RunContext`/`HistoryMessage` types,
# deduped from tools/traits.rs against the canonical definitions trusty-agents
# already re-exports from here (see crates/trusty-agents/src/tools/traits.rs).
trusty-agents-common = { workspace = true }


# Structured error types for library code (FsError, LlmError, etc.)
thiserror = { workspace = true }

# workstreams::path: deterministic SHA-256 project-root fingerprint for the
# workstream store's filename (DOC-48 §3.1: "workstreams-{slug}-{hash}.json").
sha2 = { workspace = true }

# LLM client: HTTP + TLS for the OpenRouter chat-completions API
reqwest = { workspace = true }

# Bash tool: process-group kill on Unix (setsid / kill syscalls)
libc = { workspace = true }

# `binding::ProjectBinding::agents_dir`: a projectless daemon has no project
# root to resolve `.claude/agents` from, so it falls back to the USER-level
# `~/.claude/agents` (Claude Code's own user-level agents location). Falling
# back to the process CWD instead would silently bind to a directory the
# operator never chose — the exact implicit-binding bug `ProjectBinding` exists
# to prevent.
# fs_browse: `~` expansion + home-collapsed breadcrumbs for the UI's picker
dirs = { workspace = true }

# verify_gate (#2279): matches a `bash` tool call's command against the
# finalized test-invocation patterns (`pytest\s+\S+`, `cargo test`, …).
# Also powers the `grep` exploration tool's content regex matching (#1027).
regex = { workspace = true }

# Native exploration tools (#1027): `ignore` provides gitignore-aware recursive
# walking for the `glob`/`grep` tools; `globset` compiles the glob patterns.
ignore = { workspace = true }
globset = { workspace = true }

# DOC-28 catch-up digest for PM prompt seed context (#1762 PR2), plus the
# shared JSON-RPC 2.0 / MCP wire types + STDIO loop (#2053) so `tcode serve
# --stdio` speaks the exact same JSON-RPC-over-STDIO contract as trusty-memory
# and trusty-search. Those wire types now come from the separate `trusty-mcp`
# crate (ADR-0040, #5803), declared above; `catchup` still brings
# `trusty-common/memory-rpc` transitively for the trusty-memory client.
# `axum-server` enables `trusty_common::server::with_standard_middleware`
# (CORS/trace/gzip) so `tcode serve --http` matches the trusty-memory/
# trusty-search middleware stack exactly.
# `inference-client` (#2406, epic #2400) provides the shared inference adapter
# layer (`trusty_common::inference`) tcode's OpenRouter/Fireworks transport is
# built on: the OpenAI-compatible HTTP core, the two-stage credential resolver
# (env > .env.local > secure store), and the capability registry. It composes
# with `axum-server` to expose `inference::test_support::MockInferenceServer`
# for the offline black-box e2e in `tests/inference_shared_adapter_e2e.rs`.
# `stdio-mcp-client` provides the shared `StdioMcpClient` (spawn an MCP binary,
# run the JSON-RPC-over-stdio handshake, call tools) the trusty-search-backed
# code-discovery tool reuses instead of writing its own MCP transport
# (common-entry-point principle) — mirrors trusty-agents' TrustySearchPlugin.
# `search-index` provides the shared ensure-project-indexed helper for tcode
# task startup.
# `crate-config` (#5203): supplies `workspace_layout::workspace_root`, the one
# resolver the project picker shares with trusty-mpm. serde_yaml + thiserror are
# already in this crate's dependency graph, so it adds no new transitive deps.
trusty-mcp = { workspace = true }  # JSON-RPC / MCP primitives (ADR-0040, #5803)
trusty-common = { workspace = true, features = ["catchup", "stdio-mcp-client", "axum-server", "inference-client", "config-cli", "bedrock-client", "search-index", "crate-config"] }

# `tui_client::CodeEngine` (#3415, DOC-50 §3.3/§3.4, epic #3411 Slice 3): the
# shared engine-adapter trait + event vocabulary (`TuiEngine`/`ReplEvent`)
# both `tcode tui` and tagent's REPL implement against.
trusty-code-tui = { workspace = true }

# `tcode serve --http`: POST /rpc + GET /health over axum (#2053). Per
# CLAUDE.md, axum stays feature-gated in *library* crates
# (`trusty-common`'s `axum-server` flag); trusty-code is a binary crate that
# actually serves HTTP, so it takes the dependency unconditionally, matching
# how `trusty-search`/`trusty-memory` depend on it.
axum = { workspace = true }

# `GET /sessions/{id}/events` SSE route (#2054): wraps the existing
# `tokio::sync::broadcast`-backed event bus (`crate::events`) as a `Stream`
# axum's SSE response type can consume, chained after a ring-buffer replay
# burst built with plain `futures_util::stream::iter`.
tokio-stream = { workspace = true }
futures-util = { workspace = true }

# `run_task::diff`'s git-tree snapshot (#2061, #1475 bug 3): a scratch
# directory for the THROWAWAY `GIT_INDEX_FILE` git stages into, so the run's
# before/after capture never touches the project's real `.git/index`.
# Promoted from dev-dependencies (where it already served every temp-dir
# test in this crate) since this is now a genuine production code path, not
# test-only.
tempfile = { workspace = true }

# AWS Bedrock Converse API transport (#1021, migrated #2407): the Converse wire
# integration now lives in the shared `trusty_common::inference::bedrock` adapter
# (enabled via the `bedrock-client` feature on the `trusty-common` dep below), so
# tcode no longer depends on the AWS SDK directly — `llm::bedrock` is a thin
# bridge onto that adapter. The AWS stack is pulled in transitively by
# `bedrock-client`.

[dev-dependencies]
# Async test runtime (events, build_info, perf async tests, tools tests).
# test-util enables Tokio's paused clock (`tokio::time::pause`) used by
# `events_connect_hang_is_bounded_by_connect_timeout_not_infinite` to wait out
# `CONNECT_TIMEOUT` on the virtual clock instead of 10s of real time.
tokio = { workspace = true, features = ["test-util"] }
# HTTP router test-only helper (`tower::util::ServiceExt::oneshot`) for
# driving the `tcode serve --http` axum router without a real socket (#2053).
tower = { workspace = true }
# `tests/tui_client_engine.rs` (#3415): a hermetic mock HTTP daemon for
# `CodeEngine`, mirroring `trusty-channels/tests/client_http.rs`'s pattern —
# a real bound socket so `reqwest` (SSE included) drives it exactly like a
# real `tcode serve --http` daemon, without spawning the real binary.
wiremock = { workspace = true }
# `llm::client::tests` (#4614): the missing-credential tests clear a provider's
# API-key env var so they assert unconditionally instead of skipping on a
# developer machine that has one. `#[serial]` joins the workspace-wide
# exclusion group so that mutation cannot race a parallel test thread.
serial_test = { workspace = true }