{"version":3,"sources":["../../src/adapters/adapter-factory.ts"],"names":[],"mappings":";;;;;AAqBO,SAAS,WAAW,gBAAgD,EAAA;AACzE,EAAM,MAAA,QAAA,GAAW,gBAAoB,IAAA,EAAA,CAAG,QAAS,EAAA;AAEjD,EAAA,QAAQ,QAAU;AAAA,IAChB,KAAK,QAAA;AACH,MAAA,OAAO,IAAI,UAAW,EAAA;AAAA,IACxB,KAAK,OAAA;AACH,MAAA,OAAO,IAAI,cAAe,EAAA;AAAA,IAC5B,KAAK,MAAA;AACH,MAAA,OAAO,IAAI,WAAY,EAAA;AAAA,IACzB;AACE,MAAA,MAAM,IAAI,KAAA,CAAM,CAAyB,sBAAA,EAAA,QAAQ,CAAE,CAAA,CAAA;AAAA;AAEzD","file":"adapter-factory.mjs","sourcesContent":["/**\n * Adapter factory\n * Returns the appropriate adapter based on the current platform\n */\n\nimport * as os from 'os';\n\nimport {OSAdapter} from '../adapter';\nimport {MacAdapter} from './mac-adapter';\nimport {MockAdapter} from './mock-adapter';\nimport {WindowsAdapter} from './win-adapter';\n\n// 导入扩展的平台类型\ntype PlatformWithMock = NodeJS.Platform | 'mock';\n\n/**\n * Get the appropriate adapter for the current platform\n * @param platformOverride Override the platform detection (useful for testing)\n * @returns The appropriate adapter for the current platform\n * @throws Error if the platform is not supported\n */\nexport function getAdapter(platformOverride?: PlatformWithMock): OSAdapter {\n  const platform = platformOverride || os.platform();\n\n  switch (platform) {\n    case 'darwin':\n      return new MacAdapter();\n    case 'win32':\n      return new WindowsAdapter();\n    case 'mock':\n      return new MockAdapter();\n    default:\n      throw new Error(`Unsupported platform: ${platform}`);\n  }\n}\n"]}