Skip to content

basalt / ai-mcp/src / resolveWorkspaceRoot

Function: resolveWorkspaceRoot() ​

> resolveWorkspaceRoot(session, arg): string

Defined in: ai-mcp/src/session.ts:68

Resolve the effective workspace root for a read tool call: an explicit per-call workspaceRoot argument, else the session default. The argument is confined to the session root (the configured project, --cwd or the launch directory) — a path outside it, or a symlink that resolves outside it, throws WorkspaceEscapeError. Write tools use resolveWriteRoot.

Parameters ​

session ​

Session

arg ​

unknown

Returns ​

string

Released under the MIT License.