torii_lib/lib.rs
1//! torii-lib — domain library for the torii (Gitorii) ecosystem.
2//!
3//! Everything the CLI, the TUI and the IDE share lives here: VCS
4//! operations over the object database, platform clients
5//! (GitHub / GitLab / Gitea / Sourcehut / Radicle / Bitbucket / Azure),
6//! multi-repo workspaces, mirrors, config, auth and versioning helpers.
7//!
8//! ## API tiers
9//!
10//! - **Domain API** — the documented surface. Returns plain data
11//! (`RepoStatus`, `PullRequest`, `Pipeline`, …) and never exposes
12//! `git2` types. This is the contract the IDE builds on, and the
13//! boundary where the future `VcsEngine` trait (torii-vcs) plugs in.
14//! - **Porcelain helpers** — a handful of `git2`-typed functions
15//! (`commit_inner`, `resolve_signature`, `signature_letter`) still
16//! consumed by the TUI in the twin `gitorii` crate. Internal contract,
17//! slated for migration behind the domain API.
18
19// ── Top-level modules (organised by concern) ─────────────────────────────────
20//
21// Each subdir owns one slice of the codebase:
22// - platforms/ : github/gitlab/gitea/sourcehut/radicle clients
23// - vcs/ : libgit2 wrappers around the object database
24// - workspace/ : remote, mirror, multi-repo orchestration
25// - util/ : config, auth, URL parsing, HTTP/SSH/gpg/radicle helpers
26// - cloud/ : gitorii.com cloud (api key, sync)
27// - transport/ : libgit2 transport plumbing
28// - versioning/: SemVer + conventional commits helpers
29pub mod error;
30pub mod platforms;
31pub mod vcs;
32pub mod workspace;
33pub mod util;
34pub mod cloud;
35pub mod transport;
36pub mod versioning;
37
38// ── Backwards-compatible re-exports ─────────────────────────────────────────
39//
40// Until 0.7.16 every module sat directly under `src/`. Hundreds of
41// `use crate::pr::` / `use crate::core::` / etc. call-sites depend on
42// those paths — both inside this library and in the `gitorii` binary
43// crate, which mirrors this list with `pub use torii_core::…`. New code
44// should prefer the canonical `crate::platforms::pr` etc. paths.
45
46// platforms/
47pub use platforms::pr;
48pub use platforms::issue;
49pub use platforms::pipeline;
50pub use platforms::package;
51pub use platforms::release;
52pub use platforms::runner;
53pub use platforms::registry as platforms_registry;
54
55// vcs/
56pub use vcs::core;
57pub use vcs::core_extensions;
58pub use vcs::core_tag;
59pub use vcs::sign;
60pub use vcs::tag;
61pub use vcs::snapshot;
62pub use vcs::patch;
63pub use vcs::history_reauthor;
64pub use vcs::commit_scan;
65pub use vcs::scanner;
66
67// workspace/
68pub use workspace::mirror;
69pub use workspace::remote;
70// `workspace::workspace` keeps its nested name to avoid colliding with
71// the parent module; the call-sites that need `WorkspaceManager`
72// already reference the long path.
73
74// util/
75pub use util::auth;
76pub use util::config;
77pub use util::duration;
78pub use util::url;
79pub use util::toriignore;
80pub use util::hooks;
81pub use util::updater;
82pub use util::http;
83pub use util::oauth;
84pub use util::ssh;
85pub use util::graph;
86pub use util::gpg;
87pub use util::radicle;