MCPcopy
hub / github.com/codeaashu/claude-code / runChromeNativeHost

Function runChromeNativeHost

src/utils/claudeInChrome/chromeNativeHost.ts:59–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59export async function runChromeNativeHost(): Promise<void> {
60 log('Initializing...')
61
62 const host = new ChromeNativeHost()
63 const messageReader = new ChromeMessageReader()
64
65 // Start the native host server
66 await host.start()
67
68 // Process messages from Chrome until stdin closes
69 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
70 while (true) {
71 const message = await messageReader.read()
72 if (message === null) {
73 // stdin closed, Chrome disconnected
74 break
75 }
76
77 await host.handleMessage(message)
78 }
79
80 // Stop the server
81 await host.stop()
82}
83
84const messageSchema = lazySchema(() =>
85 z

Callers 1

mainFunction · 0.85

Calls 5

startMethod · 0.95
readMethod · 0.95
handleMessageMethod · 0.95
stopMethod · 0.95
logFunction · 0.85

Tested by

no test coverage detected