MCPcopy
hub / github.com/coder/mux / isWorktreeRuntime

Function isWorktreeRuntime

src/common/types/runtime.ts:279–289  ·  view source on GitHub ↗
(
  config: RuntimeConfig | undefined
)

Source from the content-addressed store, hash-verified

277 * This includes both explicit "worktree" type AND legacy "local" with srcBaseDir.
278 */
279export function isWorktreeRuntime(
280 config: RuntimeConfig | undefined
281): config is
282 | Extract<RuntimeConfig, { type: "worktree" }>
283 | Extract<RuntimeConfig, { type: "local"; srcBaseDir: string }> {
284 if (!config) return false;
285 if (config.type === "worktree") return true;
286 // Legacy: "local" with srcBaseDir is treated as worktree
287 if (config.type === "local" && "srcBaseDir" in config && config.srcBaseDir) return true;
288 return false;
289}
290
291/**
292 * Type guard to check if a runtime config is project-dir local (no isolation)

Callers 15

canDeleteManagedWorktreeFunction · 0.90
getRuntimeInfoFunction · 0.90
addPathsToMetadataMethod · 0.90
getRuntimeTypeFunction · 0.90
runtimeModeFromConfigFunction · 0.90
resolveRuntimeModeFunction · 0.90
resolveRuntimeModeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected