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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! The project file `agentstacks.toml`, checked field by field into one value, and the source
//! values it is built from.
//!
//! Both the project file and the lock say where a pack or tool comes from, so the source rules
//! live in one place that both read.
//!
//! # Responsibilities
//!
//! - [`ProjectFile`]: parses the whole file and returns the tools and packs it lists, or every
//! refusal at once.
//! - [`PROJECT_FILE`]: the name of the project file, written once.
//! - [`PackEntry`]: one `[packs.<name>]` entry, its source plus the `options` table kept raw.
//! - [`Source`]: where a pack or tool comes from, a git repository with a pin or a directory in the
//! project.
//! - `SourceFields` (crate-internal): the checked source keys (`git`, `path`, `tag`, `rev`,
//! `subdir`) of one entry, read under a pin rule.
//! - [`Pin`]: what a git source is fixed to, a tag or a commit.
//! - `PinRule` (crate-internal): which pin keys a git source must carry, so one reader serves the
//! project file and the lock.
//! - [`GitUrl`]: a repository URL that cannot be taken for a command-line option.
//! - [`GitTag`]: a non-empty git tag name.
//! - [`CommitId`]: a full-length lowercase hex commit id.
//! - [`SubPath`]: a relative path that only descends, inside a repository or the project.
//! - [`LocalPath`]: a relative path inside the project whose `..` segments never climb out of it.
//! - [`InvalidGitUrl`], [`InvalidGitTag`], [`InvalidCommitId`], [`InvalidSubPath`],
//! [`InvalidLocalPath`]: the refusal each of those constructors returns.
//! - [`SourceError`]: the refusals of the source values, wrapping those above.
//! - [`ProjectError`]: the refusals of the project file with a wording of their own.
//! - [`render_project`]: the text of a new project file from its tool and pack entries.
//! - `add_tool`: an existing project file with one more `[tools.<name>]` table, its comments and
//! layout kept.
//! - [`GitFlags`]: the `--tag`, `--rev` and `--subdir` of `ext add`, refused beside a path or an
//! official name and turned into a git [`Source`] beside a git URL, and [`GitOption`], which
//! names one of them in a refusal.
//! - [`retag_project`]: an existing project file with new tags, its comments kept.
//! - [`upgrade_project`]: an existing project file with its `api` moved from `0` to the current
//! one, its comments kept.
//!
//! # Non-responsibilities
//!
//! Rules that need fetched content (an entry's key matching the name inside its source, a pack
//! requiring a pack the file does not list, option typing) belong to the checks over the loaded
//! packs. Whether a URL, tag or path exists is decided when it is fetched or read.
//!
//! This file is an export-only module with no executable logic, so it carries no inline tests.
pub use add_tool;
pub use PackEntry;
pub use ProjectError;
pub use PROJECT_FILE;
pub use ProjectFile;
pub use GitFlags;
pub use GitOption;
pub use CommitId;
pub use GitTag;
pub use GitUrl;
pub use InvalidCommitId;
pub use InvalidGitTag;
pub use InvalidGitUrl;
pub use InvalidLocalPath;
pub use InvalidSubPath;
pub use LocalPath;
pub use SubPath;
pub use Pin;
pub use PinRule;
pub use render_project;
pub use retag_project;
pub use Source;
pub use SourceError;
pub use SourceFields;
pub use upgrade_project;