1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! A pack directory read into one checked pack: its layout, its content and every rule that needs the files.
//!
//! A pack is the unit the rest of agentstacks installs, so everything that can be refused about one
//! directory is found here, in one run, before anything reads the pack as valid.
//!
//! # Responsibilities
//!
//! - [`Pack`]: the loaded and checked pack, built by [`Pack::load`] from a [`FileTree`](crate::port::FileTree).
//! - [`PackSkill`]: a skill's checked frontmatter with the files installed from its directory.
//! - [`PackAgent`]: an agent's checked frontmatter with the pack-relative path of its file.
//! - [`NativeDir`]: one `native/<tool>/` directory, its installed files and its parsed hooks.
//! - [`PackError`]: the refusals that depend on a pack's files.
//! - [`ItemKind`]: the kind of item a token or hook points at, a skill or an agent.
//!
//! The loader's building blocks stay inside the crate: `layout` (where each walked file belongs,
//! with the layout refusals), `install` (which files are installed and rendered, and the checks on
//! that), `scan` (a rendered file's text into located tokens), `local` (the token rules that need
//! only the pack), `targets` (what the pack's own hooks point at) and `key` (the key paths
//! refusals are located at).
//!
//! # Non-responsibilities
//!
//! The messages of the files themselves (`pack.toml` fields, frontmatter, token syntax) belong to
//! their own groups. Checks across several packs or against `agentstacks.toml` belong to the checks
//! over the loaded packs, and installing a pack belongs to the executor.
//!
//! This file is an export-only module with no executable logic, so it carries no inline tests.
pub use PackError;
pub use ItemKind;
pub use PackAgent;
pub use PackSkill;
pub use Pack;
pub use NativeDir;
pub use KeyPath;
pub use ;