{"record":{"id":"377881fed6b7cba8","repo":"different-ai/openwork","slug":"projectdir-is-required-377881","errorCode":null,"errorMessage":"projectDir is required","messagePattern":"projectDir is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/runtime.mjs","lineNumber":247,"sourceCode":"}\n\nfunction workspaceInaccessibleError(workspacePath, cause) {\n  if (cause && typeof cause === \"object\" && cause.code === \"workspace_inaccessible\") return cause;\n  const error = new Error(`Workspace path is not accessible: ${workspacePath}`, { cause });\n  Object.defineProperties(error, {\n    code: { value: \"workspace_inaccessible\", enumerable: true },\n    workspacePath: { value: workspacePath, enumerable: true },\n  });\n  return error;\n}\n\nexport async function prepareRuntimeWorkspaceRoot(projectDir, options = {}) {\n  const rawProjectDir = String(projectDir ?? \"\").trim();\n  try {\n    const workspaceRoot = normalizeWorkspaceRootPath(rawProjectDir, {\n      platform: options.platform ?? process.platform,\n    });\n    if (!workspaceRoot) throw new Error(\"projectDir is required\");\n    await (options.mkdirImpl ?? mkdir)(workspaceRoot, { recursive: true });\n    if (typeof options.ensureConfig === \"function\") {\n      await options.ensureConfig(workspaceRoot);\n    }\n    return workspaceRoot;\n  } catch (error) {\n    throw workspaceInaccessibleError(rawProjectDir, error);\n  }\n}\n\nexport function resolveOpenworkServerConfigPath(env = process.env) {\n  return openworkServerConfigPath({ env });\n}\n\nexport function seedWorkspacePathsForEmbeddedServer(workspacePaths, serverConfigExists) {\n  return serverConfigExists ? [] : workspacePaths;\n}\n","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/runtime.mjs#L229-L265","documentation":"Error \"projectDir is required\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at apps/desktop/electron/runtime.mjs:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}