bitx_home

    Home Repo pattern: one repo that points agents at many repos (extension module for mizchi/bit)

    git
    agents
    home-repo
    Download zip
    Author
    Version
    0.50.0
    License
    Apache-2.0
    Last updated
    20 hours ago
    Downloads
    9

    HomeError

    pub suberror HomeError {
    HomeError(String)
    } derive(
    Debug
    )

    HomeError::message

    fn HomeError::message(self : HomeError) -> String

    The error text, for display.

    HomeManifest

    pub(all) struct HomeManifest {
    repos : Array[HomeRepo]
    } derive(Eq,
    Debug
    )

    HomeManifest::equal

    HomeManifest::find

    fn HomeManifest::find(self : HomeManifest, name : String) -> HomeRepo?

    HomeManifest::not_equal

    fn HomeManifest::not_equal(x : HomeManifest, y : HomeManifest) -> Bool

    HomeRepo

    pub(all) struct HomeRepo {
    name : String
    path : String
    url : String?
    description : String?
    branch : String?
    subdir : String?
    notes : String?
    } derive(Eq,
    Debug
    )

    One repository the Home Repo points at.

    HomeRepo::equal

    fn HomeRepo::equal(HomeRepo, HomeRepo) -> Bool

    HomeRepo::not_equal

    fn HomeRepo::not_equal(x : HomeRepo, y : HomeRepo) -> Bool

    HomeRepo::to_repr

    RepoStatus

    pub(all) struct RepoStatus {
    branch : String?
    upstream : String?
    ahead : Int
    behind : Int
    changes : Int
    } derive(Eq,
    Debug
    )

    Branch / dirty summary of one repository. branch and changes come from status --porcelain --branch; upstream, ahead and behind are filled in separately (see upstream_from_config).

    RepoStatus::equal

    fn RepoStatus::equal(RepoStatus, RepoStatus) -> Bool

    RepoStatus::not_equal

    fn RepoStatus::not_equal(x : RepoStatus, y : RepoStatus) -> Bool

    agents_block_begin

    let agents_block_begin : String

    agents_block_end

    let agents_block_end : String

    agents_md_template

    fn agents_md_template(manifest : HomeManifest) -> String

    Initial AGENTS.md for a new Home Repo.

    claude_md_pointer

    let claude_md_pointer : String

    CLAUDE.md for harnesses that load CLAUDE.md instead of AGENTS.md: Claude Code expands @AGENTS.md into the file's contents.

    describe_status

    fn describe_status(status : RepoStatus) -> String

    One-line human summary used by bit home status.

    is_valid_feature_name

    fn is_valid_feature_name(feature : String) -> Bool

    A feature name doubles as the worktree directory and the branch name: letters, digits, ., _, - and /; no empty, . or .. component; not starting with -; not ending in .lock.

    is_valid_repo_name

    fn is_valid_repo_name(name : String) -> Bool

    Repository names become worktree / display keys: ASCII letters, digits, ., _ and -, not . or ...

    manifest_file_name

    let manifest_file_name : String

    The manifest file name, at the root of the Home Repo.

    manifest_template

    let manifest_template : String

    Initial manifest written by bit home init.

    normalize_subdir

    fn normalize_subdir(subdir : String) -> String raise HomeError

    Normalize a sparse-checkout subdirectory: strip surrounding /, reject empty, ./.. components and backslashes.

    parse_manifest

    fn parse_manifest(content : String) -> HomeManifest raise HomeError

    Parse and validate bit-home.toml. Unknown keys are rejected so a typo (subdirs = ...) is not silently ignored.

    parse_porcelain_status

    fn parse_porcelain_status(output : String) -> RepoStatus

    Parse status --porcelain --branch (v1): the ## header gives the branch (None when detached), every other line is one change.

    path_basename

    fn path_basename(path : String) -> String

    Last path component of path (ignoring trailing slashes), with a trailing .git dropped.

    render_agents_block

    fn render_agents_block(manifest : HomeManifest) -> String

    The managed "Other Repos" section, between agents_block_begin and agents_block_end. Each line is a navigation pointer an agent can act on: where the clone lives, where to clone it from, and what part of it is checked out.

    repo_toml_block

    fn repo_toml_block(repo : HomeRepo) -> String

    The [[repo]] block bit home add appends to the manifest. Appending (rather than re-serializing the file) keeps the user's comments.

    resolve_repo_path

    fn resolve_repo_path(path : String, home~ : String, home_repo_root~ : String) -> String

    Absolute location of a repository: ~/x is under home, a relative path is relative to the Home Repo root, an absolute path is kept.

    sparse_pattern

    fn sparse_pattern(subdir : String) -> String

    Cone-mode sparse-checkout pattern for a normalized subdir.

    toml_quote

    fn toml_quote(value : String) -> String

    Quote a TOML basic string.

    update_agents_md

    fn update_agents_md(existing : String, block : String) -> String

    Replace the managed block in existing (or append it when absent). Text outside the markers is kept byte for byte.

    upstream_from_config

    fn upstream_from_config(remote : String, merge : String) -> (String, String)?

    The upstream of a branch from its branch.<b>.remote / .merge config: (display name, ref to compare against), e.g. ("origin/main", "refs/remotes/origin/main").

    worktree_path

    fn worktree_path(repo_abs : String, feature : String) -> String

    worktrees_dir_name

    let worktrees_dir_name : String

    Per-feature worktrees live inside the repository's clone, under this directory (excluded via .git/info/exclude).