Skip to main content

Module caller_context

Module caller_context 

Source
Expand description

Shared “who’s calling, and what’s their project context?” helper consumed by both the cross-project and the in-project facades.

Before this helper the two facades each carried their own walk over list_projects() and disagreed: one required the caller to be the project’s lead session, the other walked both live_workers and the catalog. The stricter walk was the buggy one (#298 Cause 1) - a worker could not resolve its own identity. This helper consolidates the lookup so both facades see the same answer.

Re-exports§

use std::path::PathBuf; 🔒
use crate::SessionSlot; 🔒
use crate::target::ProjectKey; 🔒
use crate::views::ProjectView; 🔒
use crate::workspace::Workspace; 🔒

Structs§

CallerContext 🔒
Resolved context for an incoming MCP caller.

Functions§

caller_context 🔒
Resolve a caller’s project context: the project the caller’s slot names, when list_projects still declares it. A caller whose slot names no declared project resolves to nothing (a project dropped from forge.toml since the session spawned).
caller_context_in_view 🔒
Per-view resolution. File-private so the test mod can exercise it against hand-constructed ProjectViews without going through the catalog-driven Workspace::list_projects path.