refactor(tui): tighten /browser connect plumbing

Split browser.manage into a small dispatcher with named connect/disconnect
helpers, fold _http_ok / _probe_urls / _normalize_cdp_url out of the nested
probe loop, collapse the failure-message scaffolding, and DRY the chrome
candidate path tables. Behaviour and event shape unchanged.
This commit is contained in:
Brooklyn Nicholson 2026-04-28 22:36:29 -05:00 committed by Teknium
parent e750829015
commit 26816d1f77
4 changed files with 205 additions and 258 deletions

View file

@ -192,11 +192,7 @@ describe('createSlashHandler', () => {
it.each([
['/browser status', 'browser.manage', { action: 'status', session_id: null }],
[
'/browser connect',
'browser.manage',
{ action: 'connect', session_id: null, url: 'http://127.0.0.1:9222' }
],
['/browser connect', 'browser.manage', { action: 'connect', session_id: null, url: 'http://127.0.0.1:9222' }],
['/reload-mcp', 'reload.mcp', { session_id: null }],
['/stop', 'process.stop', {}],
['/fast status', 'config.get', { key: 'fast', session_id: null }],