Skip to content

Crate Map

The workspace contains 24 crates organized by concern.

Core

CrateDescription
y-coreTrait definitions (LlmProvider, Tool, Middleware, SessionStore, etc.), shared types, error types. All cross-crate contracts live here.

Infrastructure

CrateDescription
y-providerLLM provider pool with tag-based routing, freeze/thaw, priority scheduling, lease management, metrics export. Backends: OpenAI, Anthropic, Gemini, Azure OpenAI, Ollama.
y-sessionSession lifecycle manager: state machine, tree traversal, canonical (cross-channel) session management, chat checkpoint/rollback.
y-contextContext assembly pipeline (8 stages), compaction engine, context window guard, memory recall, working memory, history repair, pruning.
y-storageSQLite persistence: session store, checkpoint storage, transcript (JSONL), chat messages, workflow store, schedule store, provider metrics store.
y-knowledgeKnowledge base: multi-level chunking (L0/L1/L2), BM25 + vector hybrid retrieval, ingestion pipeline, domain classification, metadata tagging, quality filtering.
y-diagnosticsTrace storage (SQLite-backed), cost intelligence, trace search/replay, event-bus subscriber for runtime observation capture.

Middleware

CrateDescription
y-hooksHook system, priority-sorted middleware chains (5 domains: Context, Tool, LLM, Compaction, Memory), async event bus, hook handler executor.
y-guardrailsPermission model (allow/notify/ask/deny), loop guard (4 pattern detectors), taint tracking, risk scoring, HITL escalation, structural validation.
y-promptPrompt sections with priority/budget/conditions, prompt templates with mode overlays, section store, token estimation.
y-mcpModel Context Protocol client: stdio/HTTP transports, tool discovery (tools/list), tool call proxying (tools/call).

Capabilities

CrateDescription
y-toolsTool registry (4 types: builtin/dynamic/MCP/browser), lazy loading with LRU activation, JSON Schema validation, multi-format parser, rate limiter, result formatter.
y-skillsSkill ingestion, transformation, registry, git-like versioning (content-addressable + JSONL reflog), tag/trigger search, feature-gated modules (ingestion, transformation, security screening, evolution).
y-runtimeExecution backends: Native, Docker, SSH. Capability-based security (network/filesystem/container/process), audit trail, resource monitor, venv management (Python/Bun).
y-schedulerScheduled task execution: cron (5-field), interval, one-time, event-driven triggers. Schedule store, executor, dispatcher, recovery.
y-browserBrowser automation via Chrome DevTools Protocol. CDP WebSocket client, session lifecycle, page actions (navigate, click, screenshot), security policy (domain allowlist, SSRF protection), Chrome auto-launcher.
y-journalFile change journal: tool middleware that captures pre/post file state, scope-based rollback, hash-based conflict detection, per-session file history with rewind support.

Orchestration

CrateDescription
y-agentDAG engine (typed channels, checkpointing, interrupt/resume) + agent lifecycle (TOML definitions, registry, pool, delegation protocol, trust tiers).
y-botBot platform adapters: Feishu (webhook), Discord (Gateway WebSocket + REST API + webhook), Telegram (webhook). Unified BotPlatform trait.

Service

CrateDescription
y-serviceBusiness logic layer (DI container): ChatService, AgentService, BotService, WorkflowService, KnowledgeService, SkillService, SchedulerService, CostService, DiagnosticsService, SystemService. Orchestrators for plan execution, task delegation, tool search, user interaction.

Presentation

CrateDescription
y-cliCLI + TUI (clap + ratatui). Subcommands: chat, init, status, config, session, tool, agent, workflow, diag, skill, kb, tui, serve.
y-webREST API server (axum). Route groups: health, chat, sessions, agents, tools, diagnostics, bots, workflows, schedules. CORS enabled.
y-guiDesktop GUI (Tauri v2 + React 19 + TypeScript). Views: Chat, Automation (DAG editor), Skills, Knowledge, Agents, Settings. Components for observation/diagnostics.

Testing

CrateDescription
y-test-utilsMock implementations of y-core traits (provider, runtime, storage), fixture factories, assertion helpers.

Dependency Graph

Released under the MIT License.