{"record":{"id":"40070051dc099086","repo":"diegosouzapw/OmniRoute","slug":"access-token-is-required","errorCode":null,"errorMessage":"Access token is required","messagePattern":"Access token is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/services/cursor.ts","lineNumber":103,"sourceCode":"      const arch = process.arch;\n      if (arch === \"x64\") return \"x86_64\";\n      if (arch === \"arm64\") return \"aarch64\";\n      return arch;\n    }\n    return \"x86_64\";\n  }\n\n  /**\n   * Validate and import token from Cursor IDE or cursor-agent CLI.\n   * Note: We skip API validation because Cursor API uses complex protobuf format.\n   * Token will be validated when actually used for requests.\n   * @param {string} accessToken - Access token from state.vscdb or auth.json\n   * @param {string} [machineId] - Machine ID from state.vscdb (optional for cursor-agent imports)\n   */\n  async validateImportToken(accessToken: string, machineId?: string) {\n    // Basic validation\n    if (!accessToken || typeof accessToken !== \"string\") {\n      throw new Error(\"Access token is required\");\n    }\n\n    // Token format validation (Cursor tokens are typically long strings)\n    if (accessToken.length < 50) {\n      throw new Error(\"Invalid token format. Token appears too short.\");\n    }\n\n    // Machine ID format validation (only if provided — cursor-agent imports don't have one)\n    if (machineId) {\n      const uuidRegex = /^[a-f0-9-]{32,}$/i;\n      if (!uuidRegex.test(machineId.replace(/-/g, \"\"))) {\n        throw new Error(\"Invalid machine ID format. Expected UUID format.\");\n      }\n    }\n\n    // Note: We don't validate against API because Cursor uses complex protobuf.\n    // Token will be validated when used for actual requests.\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/services/cursor.ts#L85-L121","documentation":"Error \"Access token is required\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/services/cursor.ts:103 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":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}