MCPcopy Index your code
hub / github.com/Waishnav/devspace / assertWorkspaceRootAllowed

Method assertWorkspaceRootAllowed

src/workspaces.ts:230–240  ·  view source on GitHub ↗
(root: string, mode: WorkspaceMode, sourceRoot: string | undefined)

Source from the content-addressed store, hash-verified

228 }
229
230 private assertWorkspaceRootAllowed(root: string, mode: WorkspaceMode, sourceRoot: string | undefined): string {
231 if (mode === "worktree") {
232 if (!sourceRoot) {
233 throw new Error(`Stored worktree workspace is missing sourceRoot: ${root}`);
234 }
235 assertAllowedPath(sourceRoot, this.config.allowedRoots);
236 return assertAllowedPath(root, [this.config.worktreeRoot]);
237 }
238
239 return assertAllowedPath(root, this.config.allowedRoots);
240 }
241
242 private loadInitialAgentsFiles(root: string): LoadedAgentsFile[] {
243 const agentDir = resolve(this.config.agentDir);

Callers 1

getWorkspaceMethod · 0.95

Calls 1

assertAllowedPathFunction · 0.85

Tested by

no test coverage detected