Skip to main content

Module workspace

Module workspace 

Source
Expand description

Workspace mode — two variants.

Github mode (Workspace::open, the default when --workspace DIR is set): the agent activates a GitHub repo via repo_management('org/repo'), the binary clones it into the workspace, and the active repo becomes the bound source root for read_source / grep / list_source. Idle repos auto-sweep after --stale-after-days. Layout: workspace/ repos/// — cloned source inventory.json — per-repo access tracking

Local mode (Workspace::open_local, the manifest-driven workspace: { kind: local, root: ... } variant): the active source root is a fixed local directory, not a clone target. repo_management reports the active root and triggers rebuilds; an set_root_dir tool can swap the root at runtime. Closes the code_review_mcp_server use case from the kglite wishlist.

Both modes fire the same PostActivateHook so downstream binaries (kglite-mcp-server) layer their build step on top with one registration point, and both honour the same last_built_sha gating to skip pointless rebuilds.

Re-exports§

pub use crate::server::manifest::WorkspaceKind;

Structs§

Workspace
Workspace runtime state. Shared across MCP request clones via Arc.

Type Aliases§

PostActivateHook
Hook fired after a successful clone or update. Receives the absolute path to the cloned repo and the org/repo name. Errors are logged but don’t abort the activation — the repo is still registered as active.