Expand description
The agentstacks core library.
agentstacks sets up agentic coding tools from one tool-neutral copy of skills, agents, commands, hooks and rules. This crate is the home of the logic behind that. It is a library, separate from the command-line front end, so the same core can be driven by the CLI, by tests, and by other callers.
§Responsibilities
typesis the home of the rules: domain data and the pure decisions over it, from the pack, extension, project and lock formats totypes::op(an operation and its validation),types::json(editing a JSON document’s text at one key path),types::plan(the step for each path),types::resolve(reconciling the lock with the project file and choosing tags) andtypes::protocol(the hook command line and the text of the hook runtime).portis the home of the traits the flows and the rules read the outside through, each with a fake for tests.appis the home of the flows: the use cases, generic over ports, that call ports in order and hand the results to the rules intypes.fsis the home of the adapter that reads the real disk, and the only place that callsstd::fs.processis the home of the adapter that drives thegitCLI and looks up binaries onPATH, and the only place that callsstd::process.hostis the home of the adapter that runs a tool extension’s Lua adapter in the airsl sandbox with zero grants, and the only place Lua runs.
§Dependency direction
types -> port::{FileTree, EntryKind} only
port -> types
app -> port, types
fs, process, host -> port, types
process -> fs::cache only, among the adapterstypes, port and app never name an adapter and never call std::fs, std::process or
std::net; the isolation test in tests/isolation.rs enforces both. An adapter makes no
decision: it translates between a port and the outside.
§Non-responsibilities
Argument parsing and terminal output belong to the command-line front end, not to this crate.
This file is an export-only module with no executable logic, so it carries no inline tests.
Modules§
- app
- The use cases: flows generic over the ports, each calling ports in order and handing the
results to the rules in
types. - fs
- The adapters that reach the real disk for the ports the
portmodule declares. - host
- The adapter that runs a tool extension’s Lua adapter in the airsl sandbox with zero grants, and the only place Lua runs, so that an extension can only propose operations.
- port
- The traits the flows and the rules read the outside through, each with a fake for tests.
- process
- The adapter that drives the
gitCLI and looks up binaries onPATH, and the only place that callsstd::process. - types
- The domain types and the logic over them: names, tokens, frontmatter, manifests, hooks, diagnostics and the tree walk.