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

Function onStateChange

src/cli/print.ts:3958–3973  ·  view source on GitHub ↗
(state, detail)

Source from the content-addressed store, hash-verified

3956 }
3957 },
3958 onStateChange(state, detail) {
3959 if (state === 'failed') {
3960 bridgeFailureDetail = detail
3961 }
3962 logForDebugging(
3963 `[bridge:sdk] State change: ${state}${detail ? ` — ${detail}` : ''}`,
3964 )
3965 output.enqueue({
3966 type: 'system' as StdoutMessage['type'],
3967 subtype: 'bridge_state' as string,
3968 state,
3969 detail,
3970 uuid: randomUUID(),
3971 session_id: getSessionId(),
3972 } as StdoutMessage)
3973 },
3974 initialMessages:
3975 mutableMessages.length > 0 ? mutableMessages : undefined,
3976 })

Callers 9

RecentDenialsTabFunction · 0.85
initEnvLessBridgeCoreFunction · 0.85
wireTransportCallbacksFunction · 0.85
recoverFromAuthFailureFunction · 0.85
initBridgeCoreFunction · 0.85
wireTransportFunction · 0.85
startWorkPollLoopFunction · 0.85
initReplBridgeFunction · 0.85

Calls 3

logForDebuggingFunction · 0.85
getSessionIdFunction · 0.85
enqueueMethod · 0.45

Tested by

no test coverage detected