Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.foundation.environment.core

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 file count, primary language),
  • monorepo / multi-package shape detection (polylith, workspace, submodules) by counting per-ecosystem manifests.

Model-facing VCS/workspace truth lives in session["workspace"]. Remaining helpers cover coarse project shape (languages, monorepo, repositories).

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 the HOST-ONLY refresh! — which /reload runs and the sandbox cannot call.

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 file count, primary language),
  * monorepo / multi-package shape detection (polylith, workspace,
    submodules) by counting per-ecosystem manifests.

Model-facing VCS/workspace truth lives in `session["workspace"]`.
Remaining helpers cover coarse project shape (`languages`,
`monorepo`, `repositories`).

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 the HOST-ONLY
`refresh!` — which `/reload` runs and the sandbox cannot call.
raw docstring

environment-ctxclj

(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)`.
sourceraw docstring

environment-symbolsclj

source

gitclj

(git)

await git() Returns {"root", "branch", "is_detached": bool, "is_submodules": bool, "is_worktree": bool, "stash_count", "upstream", "ahead", "behind", "is_stale", "is_dirty", "is_clean", "modified", "untracked", "added", "changed", "removed", "missing", "conflicting"}, or None outside a repo.

await git()
Returns {"root", "branch", "is_detached": bool, "is_submodules": bool, "is_worktree": bool, "stash_count", "upstream", "ahead", "behind", "is_stale", "is_dirty", "is_clean", "modified", "untracked", "added", "changed", "removed", "missing", "conflicting"}, or None outside a repo.
sourceraw docstring

languagesclj

(languages)

await languages() Returns {"total_files": N, "total_bytes": N, "primary": "clojure", "languages": [{"language", "files": N, "bytes": N, "files_pct", "bytes_pct"}, ...], "is_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"}, ...], "is_truncated": bool, "elapsed_ms": N}. List sorted by files desc.
sourceraw docstring

languages-symbolclj

source

main-agent-instructionsclj

(main-agent-instructions)

await main_agent_instructions() Returns {"is_found": True, "source", "path", "bytes": N, "content", "files"} from AGENTS.md/CLAUDE.md, else {"is_found": False}. Check is_found first.

await main_agent_instructions()
Returns {"is_found": True, "source", "path", "bytes": N, "content", "files"} from AGENTS.md/CLAUDE.md, else {"is_found": False}. Check is_found first.
sourceraw docstring

main-agent-instructions-symbolclj

source

monorepoclj

(monorepo)

await monorepo() Returns {"shape": "polylith"|"workspace"|"submodules"|None, "totals": {"clojure": N, ...}, "files": {"clojure": ["path/deps.edn", ...], ...}, "is_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", ...], ...}, "is_truncated": bool}. "shape" is None for single-package repos.
sourceraw docstring

monorepo-symbolclj

source

refresh!clj

(refresh!)

Drop the cached env snapshot, forget the repository inventory, rescan project guidance, and return the fresh snapshot.

HOST-ONLY, deliberately NOT a v/ symbol: refreshing the environment is a USER action. It is registered as a /reload hook below, and nothing running inside python_execution can reach it — the sandbox reads the snapshot through repositories() / languages() / monorepo(), it never reloads.

Drop the cached env snapshot, forget the repository inventory, rescan project
guidance, and return the fresh snapshot.

HOST-ONLY, deliberately NOT a `v/` symbol: refreshing the environment is a
USER action. It is registered as a `/reload` hook below, and nothing running
inside `python_execution` can reach it — the sandbox reads the snapshot
through `repositories()` / `languages()` / `monorepo()`, it never reloads.
sourceraw docstring

repositoriesclj

(repositories)

await repositories() Returns {"root", "count": N, "repositories": [{"path", "branch", "is_dirty": bool, "is_changes": bool, "is_stale": bool, "stash_count": N, ...}], "is_truncated": bool}.

await repositories()
Returns {"root", "count": N, "repositories": [{"path", "branch", "is_dirty": bool, "is_changes": bool, "is_stale": bool, "stash_count": N, ...}], "is_truncated": bool}.
sourceraw docstring

repositories-symbolclj

source

snapshotclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close