{"_id":"@agent-infra/puppeteer-enhance","_rev":"8-1d97a2f260db60af1a9c1ddc89beddca","name":"@agent-infra/puppeteer-enhance","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.3":{"name":"@agent-infra/puppeteer-enhance","version":"0.1.3","_id":"@agent-infra/puppeteer-enhance@0.1.3","maintainers":[{"name":"ulivz","email":"472590061@qq.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"skychx","email":"skychx@hotmail.com"}],"homepage":"https://github.com/agent-infra/browser#readme","bugs":{"url":"https://github.com/agent-infra/browser/issues"},"dist":{"shasum":"29ef4104215896379e67d0e987e041a7b415c4be","tarball":"https://registry.npmjs.org/@agent-infra/puppeteer-enhance/-/puppeteer-enhance-0.1.3.tgz","fileCount":32,"integrity":"sha512-WZvCpjISytlAu9brjYaHSpWjkc1o7UhevtJ28GHeEQTv8LEr/msR5ub0H3nPi5Xpg1LNe2ptuj2rYqWZ/aeHfg==","signatures":[{"sig":"MEYCIQDr8uDKb+ihhrOR+pb7ukBUZCy2Tfs/oO2L2/j53C9ZDQIhAKVPfa4+4Xh+WzlQ5wnM0KgEJjbZ1TD2c1yrVDzEM7DA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87238},"main":"dist/index.js","_from":"file:agent-infra-puppeteer-enhance-0.1.3.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"rslib build --watch","test":"vitest run","build":"rslib build","coverage":"vitest run --coverage","test:e2e":"vitest --config vitest.e2e.config.ts","test:watch":"vitest"},"_npmUser":{"name":"skychx","email":"skychx@hotmail.com"},"_resolved":"/private/var/folders/b1/0fd1b6hs7lz0fm_mh346lybm0000gn/T/ab2e75a59a25732931b87b7e0999ff43/agent-infra-puppeteer-enhance-0.1.3.tgz","_integrity":"sha512-WZvCpjISytlAu9brjYaHSpWjkc1o7UhevtJ28GHeEQTv8LEr/msR5ub0H3nPi5Xpg1LNe2ptuj2rYqWZ/aeHfg==","repository":{"url":"git+ssh://git@github.com/agent-infra/browser.git","type":"git"},"_npmVersion":"10.9.2","description":"puppeteer-enhance","directories":{},"_nodeVersion":"22.14.0","dependencies":{"delay":"6.0.0","puppeteer-core":"24.15.0","@agent-infra/logger":"0.0.2-beta.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"3.2.4","typescript":"5.8.3","@rslib/core":"0.11.0","@types/node":"24.1.0","@vitest/coverage-v8":"3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/puppeteer-enhance_0.1.3_1754565451292_0.27708907724916365","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@agent-infra/puppeteer-enhance","version":"0.1.4","_id":"@agent-infra/puppeteer-enhance@0.1.4","maintainers":[{"name":"ulivz","email":"472590061@qq.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"skychx","email":"skychx@hotmail.com"},{"name":"zhaoheh","email":"zhaoqinghao01@gmail.com"}],"homepage":"https://github.com/agent-infra/browser#readme","bugs":{"url":"https://github.com/agent-infra/browser/issues"},"dist":{"shasum":"0df8592a630e555582af75633ef5ec135865e403","tarball":"https://registry.npmjs.org/@agent-infra/puppeteer-enhance/-/puppeteer-enhance-0.1.4.tgz","fileCount":32,"integrity":"sha512-VqX4oZZ6qqsM6JaVugf7qItSXzkKIDWuJckgjWi7Zm5GrziN+xkKR50wfcmI+sk25NFQUXplf6OvgiIk4Gu+BQ==","signatures":[{"sig":"MEUCIFL6o0Pod5us4vwO0WdA7+HbESIoT6ttiQPLVnWxvNlJAiEA8B0QW2ems6/wKOvQxGSADinD9q+Ewvo6zv1gdh8T3Wg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87238},"main":"dist/index.js","_from":"file:agent-infra-puppeteer-enhance-0.1.4.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"rslib build --watch","test":"vitest run","build":"rslib build","coverage":"vitest run --coverage","test:e2e":"vitest --config vitest.e2e.config.ts","test:watch":"vitest"},"_npmUser":{"name":"skychx","email":"skychx@hotmail.com"},"_resolved":"/private/var/folders/b1/0fd1b6hs7lz0fm_mh346lybm0000gn/T/fa156c9cc0c4a64f8c3355ac356e4ac2/agent-infra-puppeteer-enhance-0.1.4.tgz","_integrity":"sha512-VqX4oZZ6qqsM6JaVugf7qItSXzkKIDWuJckgjWi7Zm5GrziN+xkKR50wfcmI+sk25NFQUXplf6OvgiIk4Gu+BQ==","repository":{"url":"git+ssh://git@github.com/agent-infra/browser.git","type":"git"},"_npmVersion":"10.9.2","description":"puppeteer-enhance","directories":{},"_nodeVersion":"22.14.0","dependencies":{"delay":"6.0.0","puppeteer-core":"24.15.0","@agent-infra/logger":"0.0.2-beta.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"3.2.4","typescript":"5.8.3","@rslib/core":"0.11.0","@types/node":"24.1.0","@vitest/coverage-v8":"3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/puppeteer-enhance_0.1.4_1754904502518_0.566306402504025","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@agent-infra/puppeteer-enhance","version":"0.1.5","_id":"@agent-infra/puppeteer-enhance@0.1.5","maintainers":[{"name":"ulivz","email":"472590061@qq.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"skychx","email":"skychx@hotmail.com"},{"name":"zhaoheh","email":"zhaoqinghao01@gmail.com"}],"homepage":"https://github.com/agent-infra/browser#readme","bugs":{"url":"https://github.com/agent-infra/browser/issues"},"dist":{"shasum":"dbf9d6f979044bc88a3515ae150b15e3c203a005","tarball":"https://registry.npmjs.org/@agent-infra/puppeteer-enhance/-/puppeteer-enhance-0.1.5.tgz","fileCount":32,"integrity":"sha512-mP9YdcJ/Oi/KSb/cKkWu7pPcf+xFPZW31viWwpHdegJdHFALC1LRGmH6WgTwfNBDHwIjdLjHNC0A+WtaK6OwWQ==","signatures":[{"sig":"MEYCIQDcNeK+gKFD/h5fTe5491UDSdL9tXtbo2G8F9CtpV6ipgIhAKsaCd6hyuosZ+e0IBpvsKES+eTnEPLurBhLnuMd7r3E","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87238},"main":"dist/index.js","_from":"file:agent-infra-puppeteer-enhance-0.1.5.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"rslib build --watch","test":"vitest run","build":"rslib build","coverage":"vitest run --coverage","test:e2e":"vitest --config vitest.e2e.config.ts","test:watch":"vitest"},"_npmUser":{"name":"skychx","email":"skychx@hotmail.com"},"_resolved":"/private/var/folders/b1/0fd1b6hs7lz0fm_mh346lybm0000gn/T/b5f264c460712753ebcf984ca6d4586c/agent-infra-puppeteer-enhance-0.1.5.tgz","_integrity":"sha512-mP9YdcJ/Oi/KSb/cKkWu7pPcf+xFPZW31viWwpHdegJdHFALC1LRGmH6WgTwfNBDHwIjdLjHNC0A+WtaK6OwWQ==","repository":{"url":"git+ssh://git@github.com/agent-infra/browser.git","type":"git"},"_npmVersion":"10.9.2","description":"puppeteer-enhance","directories":{},"_nodeVersion":"22.14.0","dependencies":{"delay":"6.0.0","puppeteer-core":"24.15.0","@agent-infra/logger":"0.0.2-beta.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"3.2.4","typescript":"5.8.3","@rslib/core":"0.11.0","@types/node":"24.1.0","@vitest/coverage-v8":"3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/puppeteer-enhance_0.1.5_1754905932671_0.3004298022848515","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@agent-infra/puppeteer-enhance","version":"0.1.6","_id":"@agent-infra/puppeteer-enhance@0.1.6","maintainers":[{"name":"ulivz","email":"472590061@qq.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"skychx","email":"skychx@hotmail.com"},{"name":"zhaoheh","email":"zhaoqinghao01@gmail.com"},{"name":"chenjian-bzh","email":"chenjianpersonal@gmail.com"}],"homepage":"https://github.com/agent-infra/browser#readme","bugs":{"url":"https://github.com/agent-infra/browser/issues"},"dist":{"shasum":"3d348fd5c744a4a0f4580b2c6e55c8e9e36a7812","tarball":"https://registry.npmjs.org/@agent-infra/puppeteer-enhance/-/puppeteer-enhance-0.1.6.tgz","fileCount":33,"integrity":"sha512-LiWZJDNqmPbH9J3ZkCbOfn3/ffmCJPpUdCXLV45ZNB1kawLC7XW6F5Mygu/CDRFs7wxDF2wDFrhMy+65qlAQwg==","signatures":[{"sig":"MEUCIQDpI3wksLYHz4uU+brUIAgVOPP5APjon126NvCOORQ3UQIgdiOgNJF+HTmGu64kUVwVn74M5hDEyD10NeUqD6QGC9I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102995},"main":"dist/index.js","_from":"file:agent-infra-puppeteer-enhance-0.1.6.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"rslib build --watch","test":"vitest run","build":"rslib build","coverage":"vitest run --coverage","test:e2e":"vitest --config vitest.e2e.config.ts","test:watch":"vitest"},"_npmUser":{"name":"skychx","email":"skychx@hotmail.com"},"_resolved":"/private/var/folders/b1/0fd1b6hs7lz0fm_mh346lybm0000gn/T/57cc9953f25ac847ff6951c5cfb62b25/agent-infra-puppeteer-enhance-0.1.6.tgz","_integrity":"sha512-LiWZJDNqmPbH9J3ZkCbOfn3/ffmCJPpUdCXLV45ZNB1kawLC7XW6F5Mygu/CDRFs7wxDF2wDFrhMy+65qlAQwg==","repository":{"url":"git+ssh://git@github.com/agent-infra/browser.git","type":"git"},"_npmVersion":"10.9.2","description":"puppeteer-enhance","directories":{},"_nodeVersion":"22.14.0","dependencies":{"delay":"6.0.0","puppeteer-core":"24.15.0","@agent-infra/logger":"0.0.2-beta.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"3.2.4","typescript":"5.8.3","@rslib/core":"0.11.0","@types/node":"24.1.0","@vitest/coverage-v8":"3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/puppeteer-enhance_0.1.6_1756802500166_0.9188568381665352","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-08-07T11:17:31.184Z","modified":"2026-05-14T05:36:18.919Z","0.1.3":"2025-08-07T11:17:31.490Z","0.1.4":"2025-08-11T09:28:22.684Z","0.1.5":"2025-08-11T09:52:12.840Z","0.1.6":"2025-09-02T08:41:40.352Z"},"bugs":{"url":"https://github.com/agent-infra/browser/issues"},"homepage":"https://github.com/agent-infra/browser#readme","repository":{"url":"git+ssh://git@github.com/agent-infra/browser.git","type":"git"},"description":"puppeteer-enhance","maintainers":[{"email":"songhn233@gmail.com","name":"songhn"},{"email":"oanakiaja@gmail.com","name":"oanakiaja"},{"email":"472590061@qq.com","name":"ulivz"},{"email":"45808948@qq.com","name":"ycjcl868"},{"email":"skychx@hotmail.com","name":"skychx"},{"email":"zhaoqinghao@bytedance.com","name":"zhaoheh"},{"email":"chenjianpersonal@gmail.com","name":"chenjian-bzh"}],"readme":"# puppeteer-enhance\n\nA powerful enhancement library for Puppeteer that provides advanced hotkey simulation capabilities with cross-platform support and browser-specific optimizations.\n\n## Installation\n\n```bash\nnpm install @agent-infra/puppeteer-enhance\n# or\npnpm install @agent-infra/puppeteer-enhance\n```\n\n## Quick Start\n\n```typescript\nimport { Hotkey } from '@agent-infra/puppeteer-enhance';\nimport puppeteer from 'puppeteer-core';\n\nconst browser = await puppeteer.launch();\nconst page = await browser.newPage();\n\n// Initialize hotkey handler\nconst hotkey = new Hotkey({ osName: 'macOS', browserName: 'chrome' });\n\n// Simulate Ctrl+C (Copy)\nawait hotkey.press(page, 'ctrl+c');\n\n// Simulate Cmd+V (Paste on macOS)\nawait hotkey.press(page, 'cmd+v');\n\n// With custom delay\nawait hotkey.press(page, 'ctrl+a', { delay: 200 });\n```\n\n## API Reference\n\n### Env\n\n#### Methods: getEnvInfo\n\nAutomatically detect the operating system and browser type from a Puppeteer browser instance.\n\n```typescript\nimport type { Browser } from 'puppeteer-core';\n\nexport type OSType = 'Windows' | 'macOS' | 'Linux' | 'Unknown';\nexport type BrowserType = 'Chrome' | 'Edge' | 'Firefox' | 'Unknown';\n\nexport interface EnvInfo {\n  osName: OSType;\n  browserName: BrowserType;\n}\n\nexport async function getEnvInfo(browser: Browser): Promise<EnvInfo>\n```\n\n### Hotkey\n\n#### Constructor\n\n```typescript\nexport type OSType = 'Windows' | 'macOS' | 'Linux' | 'Unknown';\nexport type BrowserType = 'Chrome' | 'Edge' | 'Firefox' | 'Unknown';\n\nnew Hotkey(\n  envInfo: { osName: OSType; browserName: BrowserType },\n  logger?: Logger\n)\n```\n\n#### Methods\n\n**press(page, hotkey, options?)**\n\nSimulate a hotkey press on the given page.\n\n```typescript\nimport type { Page } from \"puppeteer-core\";\n\nexport interface HotkeyOptions {\n  delay: number; // default 100ms\n}\n\nawait hotkey.press(\n  page: Page,\n  hotkey: string,\n  options?: HotkeyOptions\n): Promise<void>\n```\n\n#### macOS + Chrome Optimization\n\nWhen running on macOS with Chrome, the library automatically uses Chrome DevTools Protocol (CDP) commands for common system hotkeys:\n\n> See the reasoning behind using CDP for simulation [#560](https://github.com/bytedance/UI-TARS-desktop/pull/560)\n\n| Hotkey | Action |\n|--------|--------|\n| `Cmd+A` | Select All |\n| `Cmd+X` | Cut |\n| `Cmd+C` | Copy |\n| `Cmd+V` | Paste |\n| `Cmd+Z` | Undo |\n| `Cmd+Y` / `Cmd+Shift+Z` | Redo |\n\n#### Error Handling\n\n```typescript\ntry {\n  await hotkey.press(page, 'invalid+key');\n} catch (error) {\n  console.error('Unsupported key combination:', error.message);\n}\n```\n\n## Browser Compatibility\n\nSee [puppeteer FAQ](https://pptr.dev/faq#q-what-is-the-status-of-cross-browser-support).\n\n\n## Related\n\n- [Puppeteer](https://pptr.dev/) - The underlying browser automation library\n- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) - Used for macOS optimizations\n","readmeFilename":"README.md"}