Skip to main content

Crate base

Crate base 

Source
Expand description

Agix foundation — types, traits, and context shared by all crates.

Re-exports§

pub use interface::tool;

Modules§

agent_type
Agent types: the named sub-agent definitions a session can spawn.
clock
Wall-clock readings shared by every crate: epoch milliseconds and RFC 3339.
command
Slash-command names the engine answers itself, the plugin commands ([[command]]) a session runs through RunExt and as /name args, the plugin functions ([[function]]) only the host calls, and the host libraries (uses) a package’s code may need.
context
会话的配置与状态,按读写性质拆开,而不是一个什么都装的上下文对象:
dir_lock
An exclusive hold on a directory, against every other holder: other threads of this process, and on unix other processes, through flock on the directory itself. Settings tiers and memory directories are written by every session of every daemon (and CLI) the user runs over them.
engine_exec
The subprocesses the engine starts on a session’s behalf — its own git and helpers such as pdftotext — and the one way it starts them: through that session’s ExecProviders.
error
通用错误类型 —— 跨 crate 边界的稳定错误。 各 crate 可以再定义自己的局部错误(thiserror)并通过 #[from] 转入这些。
event
AgentEvent — streaming events emitted by the Engine.
frozen
Session-start frozen environment snapshot — the data sources for system prompt segments [4] and [5].
fs
Atomic file replacement shared by every crate that persists state.
id
BASE58(UUID v4) 字符串身份。
interface
Injectable contracts — the traits a host implements to replace part of the engine.
memory
Durable memory data — what one memory is and how storing it can fail. The store, the secret scan, the prompt and the selection call live in the memory crate.
message
Message / ContentBlock —— 直接对应 Anthropic Messages API 的形状, 顺手当作我们的内部 transcript 表示(jsonl 持久化也用同一份 schema)。
path
Path sanitization utilities.
paths
Data directory path abstraction.
permission
权限模式与权限规则。一次调用的判定结果是 interface::permission::PermissionOutcome。
prompt
The prompt block type and the names the kernel’s blocks carry. Assembly itself is runtime::prompt_assembly; this file is only the data it produces.
provider
Model providers as settings.json describes them — the providers list, each entry’s vendor, protocol, models, tiers and quota — the contract a session’s code routes its calls through (TaskRouting), and where quota usage is kept (QuotaLedger).
public_suffix
The Public Suffix List (https://publicsuffix.org/), for telling a domain someone owns (example.com, alice.github.io) from a suffix under which anyone can register one (com, co.uk, github.io). Permission checks use it to decide whether a host wildcard pins a domain (base::url_rule).
recorder
Record/replay configuration: the settings a model wrapper reads to record a session, replay it, or re-issue its requests.
rules
The rule index: its entries and the merge of several rule sources.
session
Session / Agent 上下文身份类型。
skill
Skill data types: what a loaded SKILL.md is (SkillEntry), where it came from, and the $ARGUMENTS-style substitution applied to its body.
text
UTF-8-safe string truncation.
url_rule
URL rules: the one way a pattern like https://*.corp.example/** is matched against a URL, for permission rules on URL-valued tools (WebFetch(...), Ping(...)) and the MCP policy’s url and allowed_authorization_servers rules alike.