{"record":{"id":"ca65b5906e4feb7f","repo":"moeru-ai/airi","slug":"label-does-not-exist-path","errorCode":null,"errorMessage":"${label} does not exist: ${path}","messagePattern":"(.+?) does not exist: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/stage-tamagotchi/src/main/services/airi/plugins/host/directory-import.ts","lineNumber":110,"sourceCode":"      exposure: kit.exposure,\n    })),\n    ...(manifest.kits?.uses ?? []).map(kit => ({\n      direction: 'uses' as const,\n      id: kit.id,\n      version: kit.version,\n      optional: kit.optional ?? false,\n    })),\n  ]\n}\n\nasync function assertRegularFile(path: string, label: string): Promise<Stats> {\n  let stats: Stats\n  try {\n    stats = await lstat(path)\n  }\n  catch (error) {\n    if (isMissingPathError(error)) {\n      throw new Error(`${label} does not exist: ${path}`)\n    }\n    throw error\n  }\n\n  if (stats.isSymbolicLink() || !stats.isFile()) {\n    throw new Error(`${label} must be a regular file: ${path}`)\n  }\n  return stats\n}\n\nasync function readManifestSnapshot(path: string, expectedSize: number): Promise<Buffer> {\n  const handle = await open(path, 'r')\n  try {\n    // One extra byte distinguishes the maximum valid manifest from a file\n    // that grew past the limit after the directory walk.\n    const buffer = Buffer.allocUnsafe(extensionPackageLimits.manifestBytes + 1)\n    let bytesRead = 0\n    while (bytesRead < buffer.byteLength) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/moeru-ai/airi/blob/438a067dde47aa0bdb46c2323d1fe293dc805218/apps/stage-tamagotchi/src/main/services/airi/plugins/host/directory-import.ts#L92-L128","documentation":"assertRegularFile lstats a required path (e.g. an extension manifest) and rethrows missing-file errors as '<label> does not exist: <path>'. It runs during extension directory inspection to verify the package layout before import.","triggerScenarios":"inspectExtensionDirectory is called on a directory whose package.json (or other required file, per label) is absent at the given path.","commonSituations":"User selects the wrong folder (parent or sibling of the actual extension); extension zip extracted without its root folder; manifest renamed or deleted after selection.","solutions":["Point the import at the directory that directly contains the manifest file","Confirm the file named in the error exists at the printed path","Re-extract the extension package if files are missing"],"exampleFix":"// before\nimportFromDirectory('/Downloads/myext') // manifest is in /Downloads/myext/extension\n// after\nimportFromDirectory('/Downloads/myext/extension')","handlingStrategy":"try-catch","validationCode":"import { lstat } from 'node:fs/promises'\nasync function manifestExists(dir: string): Promise<boolean> {\n  try { await lstat(`${dir}/package.json`); return true } catch { return false }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importFromDirectory(dir)\n} catch (e) {\n  if (e instanceof Error && /does not exist:/.test(e.message)) {\n    console.warn(`${e.message} — select the folder that directly contains the manifest`)\n    return promptUserForCorrectFolder()\n  }\n  throw e\n}","preventionTips":["Verify the expected files exist in the chosen directory before importing","Check that archives were extracted and did not add an extra nesting level","Re-prompt the user to select the extension folder on this error"],"tags":["filesystem","missing-file","extension-import"],"backgroundTag":"file-not-found","analyzedSha":"438a067dde47aa0bdb46c2323d1fe293dc805218","analyzedAt":"2026-09-17T01:14:42.644Z","contentChangedAt":"2026-09-17T01:14:42.644Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}