vis-foundation — the agent's environment-awareness layer.
Owns the environment facts: cwd, user, platform, shell, plus:
Model-facing VCS/workspace truth lives in :session/workspace CTX.
Remaining helpers cover coarse project shape (languages,
monorepo, repositories) and cache invalidation (refresh!).
Runtime facts are computed lazily on first access and cached per
working-directory. The cache is invalidated automatically when
cwd changes between calls and explicitly by (refresh!).
vis-foundation — the agent's environment-awareness layer.
Owns the environment facts: cwd, user, platform, shell, plus:
* git repository facts via the git binary (root, branch, dirty status,
submodules, worktree),
* a bounded language scan over the working tree (top languages
by total bytes, primary language),
* monorepo / multi-package shape detection (polylith, workspace,
submodules) by counting per-ecosystem manifests.
Model-facing VCS/workspace truth lives in `:session/workspace` CTX.
Remaining helpers cover coarse project shape (`languages`,
`monorepo`, `repositories`) and cache invalidation (`refresh!`).
Runtime facts are computed lazily on first access and cached per
working-directory. The cache is invalidated automatically when
`cwd` changes between calls and explicitly by `(refresh!)`.(environment-ctx _environment)Foundation-owned structured ctx contribution. Runtime facts, project
guidance, and extension-load warnings live under (:project ctx).
Foundation-owned structured ctx contribution. Runtime facts, project guidance, and extension-load warnings live under `(:project ctx)`.
(git)await git() Returns {"root", "branch", "detached": bool, "submodules": bool, "worktree": bool, "stash_count", "upstream", "ahead", "behind", "stale", "dirty", "clean", "modified", "untracked", "added", "changed", "removed", "missing", "conflicting"}, or None outside a repo.
await git()
Returns {"root", "branch", "detached": bool, "submodules": bool, "worktree": bool, "stash_count", "upstream", "ahead", "behind", "stale", "dirty", "clean", "modified", "untracked", "added", "changed", "removed", "missing", "conflicting"}, or None outside a repo.(languages)await languages() Returns {"total_files": N, "total_bytes": N, "primary": "clojure", "languages": [{"language", "files": N, "bytes": N, "files_pct", "bytes_pct"}, ...], "truncated": bool, "elapsed_ms": N}. List sorted by files desc.
await languages()
Returns {"total_files": N, "total_bytes": N, "primary": "clojure", "languages": [{"language", "files": N, "bytes": N, "files_pct", "bytes_pct"}, ...], "truncated": bool, "elapsed_ms": N}. List sorted by files desc.(main-agent-instructions)await main_agent_instructions() Returns {"found": True, "source", "path", "bytes": N, "content"} from AGENTS.md/CLAUDE.md, else {"found": False}. Check found first.
await main_agent_instructions()
Returns {"found": True, "source", "path", "bytes": N, "content"} from AGENTS.md/CLAUDE.md, else {"found": False}. Check found first.(monorepo)await monorepo() Returns {"shape": "polylith"|"workspace"|"submodules"|None, "totals": {"clojure": N, ...}, "files": {"clojure": ["path/deps.edn", ...], ...}, "truncated": bool}. "shape" is None for single-package repos.
await monorepo()
Returns {"shape": "polylith"|"workspace"|"submodules"|None, "totals": {"clojure": N, ...}, "files": {"clojure": ["path/deps.edn", ...], ...}, "truncated": bool}. "shape" is None for single-package repos.(refresh!)await refresh() Drop the cached env snapshot and recompute. Returns the fresh snapshot. Use after large tree/branch changes.
await refresh() Drop the cached env snapshot and recompute. Returns the fresh snapshot. Use after large tree/branch changes.
(repositories)await repositories() Returns {"count": N, "repositories": [{"path", "branch", "dirty": bool, "changes": bool, "stale": bool, "stash_count": N, ...}], "truncated": bool}.
await repositories()
Returns {"count": N, "repositories": [{"path", "branch", "dirty": bool, "changes": bool, "stale": bool, "stash_count": N, ...}], "truncated": bool}.(snapshot)Full environment snapshot map {:host :git :languages :monorepo :repositories}. Cached per cwd; host helper, not a model tool.
Full environment snapshot map {:host :git :languages :monorepo :repositories}. Cached per cwd; host helper, not a model tool.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |