MCPcopy Create free account
hub / github.com/tiann/hapi / isGeminiSetupCompleteFrame

Function isGeminiSetupCompleteFrame

hub/src/web/server.ts:60–67  ·  view source on GitHub ↗
(message: string | ArrayBuffer | Uint8Array)

Source from the content-addressed store, hash-verified

58}
59
60function isGeminiSetupCompleteFrame(message: string | ArrayBuffer | Uint8Array): boolean {
61 try {
62 const parsed = JSON.parse(decodeWsText(message)) as unknown
63 return parsed !== null && typeof parsed === 'object' && 'setupComplete' in (parsed as object)
64 } catch {
65 return false
66 }
67}
68
69const MAX_GEMINI_PENDING_BYTES = 1024 * 1024 // 1 MiB — rejects setup-window floods
70function frameByteSize(msg: string | ArrayBuffer | Uint8Array): number {

Callers 1

openFunction · 0.85

Calls 1

decodeWsTextFunction · 0.85

Tested by

no test coverage detected