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)
This commit is contained in:
2026-08-12 20:51:08 +08:00
parent 513da621c6
commit a8fb781a7c
6 changed files with 407 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import http from 'node:http';
import { VisionLClient } from '../client.js';
import type { ApiResponse, PageInfo } from '../types/api.js';
import type { ApiResponse } from '../types/api.js';
import type { PageInfo } from '../types/page.js';
function createMockServer() {
const server = http.createServer((req, res) => {
+2 -1
View File
@@ -1,4 +1,5 @@
import type { ApiResponse, PageInfo } from './types/api.js';
import type { ApiResponse } from './types/api.js';
import type { PageInfo } from './types/page.js';
export class VisionLClient {
constructor(private baseUrl: string) {}