Resources
dotagents._resources
The package's own data, reachable from a plain install and from a .pyz.
Everything here is library code: the CLI and the helper modules both import
it, and it imports nothing from dotagents.cli.
- :data:
BASE_ROOT-- the bundled base overlay (_overlay/): the block templates, the bundled command modules and the harness hook scripts. - :func:
base_agents_text-- a base overlay'sAGENTS.mdblock rendered for one store. _package_data_dir/_scratch_dir-- a package-data directory as a real filesystem path (extracted once from a zipapp), and the one per-process temp directory such extractions go to.
AGENTS_MD_PLACEHOLDER = '{{AGENTS_MD}}'
module-attribute
BASE_AGENTS_TEMPLATE = 'dotagents/templates/AGENTS.md'
module-attribute
BASE_PROJECT_TEMPLATE = 'dotagents/templates/PROJECT.md'
module-attribute
BASE_ROOT = _package_data_dir('_overlay') or Path(__file__).resolve().parent / '_overlay'
module-attribute
base_agents_text(src, dest, *, project=False)
The base AGENTS.md block for the store at dest: the template
(<src>/dotagents/templates/AGENTS.md, or PROJECT.md for a project
store when the base has one; falling back to <src>/AGENTS.md for a
--from base that keeps it at its root) with {{AGENTS_MD}} rendered
as the ACTUAL path of the file being written, so the block's "annotate that
you read …" line names this store's file. Under the home directory it is
written ~/…, so a store synced between machines whose home directories
differ renders the same block on each.
Source code in src/dotagents/_resources.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
home_relative(path)
path as POSIX text, written ~/<rest> when it is under the home
directory and absolute otherwise.
Source code in src/dotagents/_resources.py
139 140 141 142 143 144 145 146 147 | |
pyz_archive()
The .pyz this dotagents is imported from, or None for a plain
install. Inside a zipapp a module's __file__ is a path INTO the
archive (.../dotagents.pyz/dotagents/_resources.py), so the archive
is the ancestor that is a file. It also holds the vendored runtime
dependencies (duho, pathapi), importable from it by zipimport.
Source code in src/dotagents/_resources.py
40 41 42 43 44 45 46 47 48 49 | |