Commit Graph

19 Commits

Author SHA1 Message Date
AskaEth 452581c3b5 feat: add GET /profiles route 2026-08-12 21:29:47 +08:00
AskaEth e79590a6d8 feat(daemon): add WebSocket relay with console/network monitoring
- Add ws-relay.ts: WebSocket server at /ws with broadcast function
- Add network event types (request/response/failed) to core ws.ts types
- Add ConsoleEntry and NetworkEntry types
- Add consoleLog and networkLog buffers to PageRegistry (100/200 max)
- Add console listener in createPage: broadcasts page:console events
- Add network listeners (request/response/requestfailed) in createPage
- Add page crash handler broadcasting page:crashed events
- Add history endpoints: GET /pages/:id/console and GET /pages/:id/network
- Integrate createWsRelay in server.ts startup
- Bump ws from devDependency to full dependency
2026-08-12 21:28:02 +08:00
AskaEth 4f387b5ae7 feat(daemon): add stealth injection orchestrator (Task 17)
- Create stealth/index.ts: applyStealth() calls all 6 injection modules
  in correct order (initScript before nav, page.route after page)
- Update browser-manager.ts: call applyStealth in createPage before goto
- Constructor now accepts profileId (default 'desktop-chrome') or profile object
- Update daemon src/index.ts: re-export stealth orchestrator, getProfile,
  humanClick, humanType, humanScroll, injectHeaderStealth
2026-08-12 21:19:35 +08:00
AskaEth a34e3c72f0 feat(daemon): add built-in fingerprint profiles for desktop Chrome (Task 16) 2026-08-12 21:18:19 +08:00
AskaEth 78a35bafc4 feat(daemon): add HTTP header stealth injection (Task 14)
Inject Sec-CH-UA family headers on outgoing page requests:
- sec-ch-ua, sec-ch-ua-platform, sec-ch-ua-mobile
- sec-ch-ua-arch (from process.arch)
- sec-ch-ua-bitness ('64')
- sec-ch-ua-full-version (extracted from profile.userAgent)

Skips localhost/127.0.0.1 traffic (daemon internal) and WebSocket upgrades.
2026-08-12 21:17:06 +08:00
AskaEth 6085c9e65a feat(daemon): implement stealth human input simulation (Task 15)
Add humanClick, humanType, humanScroll with mouse path interpolation,
random key delays, and step-based scrolling for bot-like behavior.
Includes integration tests for event sequence verification.
2026-08-12 21:16:37 +08:00
AskaEth dff7afced9 fix: wrap stealth navigator overrides in try-catch, add pixelRatio to screen override 2026-08-12 21:14:16 +08:00
AskaEth 1b2ff5491a feat(daemon): add canvas/WebGL/AudioContext noise injection for stealth (Task 13)
- Implement injectCanvasNoise() using context.addInitScript()
- Add deterministic hash-based pixel/byte noise for Canvas 2D:
  - Patch toDataURL, toBlob with save-modify-restore pattern
  - Patch getImageData to add +/-1 to random pixel RGB channels
- Add WebGL readPixels noise for both WebGL and WebGL2 contexts
- Add AudioContext noise: detune oscillator, patch AnalyserNode methods
- Session-based seed ensures consistent noise within same context
- Write integration tests covering canvas, WebGL, audio, toBlob, and edge cases
2026-08-12 21:13:30 +08:00
AskaEth f0fa14f898 feat: add stealth modules for chrome runtime, screen, and permissions (Task 12)
- chrome-runtime.ts: injects window.chrome object with runtime, loadTimes, csi, app
- screen.ts: overrides screen.width/height/avail/colorDepth, window.outerWidth/Height
- permissions.ts: hooks navigator.permissions.query() for 4 permission types
- tests: 15 integration tests (6 chrome, 6 screen, 5 permissions), skip when VISIONL_INTEGRATION != '1'
- typecheck: passed (0 errors)
2026-08-12 21:08:13 +08:00
AskaEth 5cef8cdbc4 feat(daemon): add stealth navigator property injection (Task 11) 2026-08-12 21:04:49 +08:00
AskaEth 2ee59182bb feat(daemon): implement action routes and cookie management (Task 10)
- Add action endpoints: click/type/scroll/eval/wait/navigate
- Add cookie endpoints: GET/POST/DELETE /pages/:id/cookies
- Register actionRoutes in server.ts
- 23 integration tests with mock BrowserManager
2026-08-12 21:02:46 +08:00
AskaEth 55fc75eb54 feat(daemon): implement content routes for screenshot/text/html retrieval (Task 9)
- Add contentRoutes handler factory in routes/content.ts
- GET /pages/:id/screenshot returns PNG as base64
- GET /pages/:id/text returns document.body.innerText
- GET /pages/:id/html returns document.documentElement.outerHTML
- All use safeStringify, 404 on PAGE_NOT_FOUND
- Register contentRoutes in server.ts
- Add 8 integration tests with mock BrowserManager
2026-08-12 20:58:37 +08:00
AskaEth dd79194179 fix: add PageRegistry.clear() and getAll(), fix BrowserManager.cleanup() to clear registry 2026-08-12 20:56:16 +08:00
AskaEth ac503a5ca3 feat(daemon): implement page CRUD routes (Task 8)
- Add routes/pages.ts with pageRoutes handler for POST/GET/DELETE /pages
- Handle POST /pages (create), GET /pages (list), GET /pages/:id, DELETE /pages/:id
- Use safeStringify for all JSON output, proper error codes for 400/404/409/500
- Update server.ts to accept optional BrowserManager and register pageRoutes
- Add 13 unit tests with mock BrowserManager covering all endpoints
2026-08-12 20:55:36 +08:00
AskaEth a8fb781a7c feat: add browser manager with page registry and Playwright stealth integration
- PageRegistry: thread-safe in-memory registry for tracking active pages by ID and alias
- BrowserManager: Playwright browser lifecycle with stealth plugin, context creation, and page navigation
- 8 unit tests for PageRegistry (add, get, findByIdOrAlias, hasAlias, remove, list)
- 8 integration tests for BrowserManager (skipped by default, guard: VISIONL_INTEGRATION=1)
- Fix: PageInfo import in core/client.ts (was incorrectly imported from api.js instead of page.js)
2026-08-12 20:51:08 +08:00
AskaEth 513da621c6 feat: add pidfile management for daemon process tracking 2026-08-12 20:47:34 +08:00
AskaEth 19d67cfda9 feat: add daemon server skeleton with health check endpoint 2026-08-12 20:45:25 +08:00
AskaEth 01701e461a fix: align daemon package.json main field with source placeholder 2026-08-12 20:37:26 +08:00
AskaEth 1392357dc1 chore: initialize monorepo scaffold with npm workspaces 2026-08-12 20:36:12 +08:00