MCPcopy
hub / github.com/claude-code-best/claude-code / notifyAutomationStateChanged

Function notifyAutomationStateChanged

src/utils/sessionState.ts:233–246  ·  view source on GitHub ↗
(
  state: AutomationStateMetadata | null | undefined,
)

Source from the content-addressed store, hash-verified

231}
232
233export function notifyAutomationStateChanged(
234 state: AutomationStateMetadata | null | undefined,
235): void {
236 const nextState = normalizeAutomationState(state)
237 if (
238 automationStateKey(nextState) === automationStateKey(currentAutomationState)
239 ) {
240 return
241 }
242
243 currentAutomationState = nextState
244 applyMetadataUpdate({ automation_state: nextState })
245 metadataListener?.({ automation_state: nextState })
246}
247
248/**
249 * Fired by onChangeAppState when toolPermissionContext.mode changes.

Callers 4

callFunction · 0.85
REPLFunction · 0.85

Calls 3

automationStateKeyFunction · 0.85
applyMetadataUpdateFunction · 0.85
normalizeAutomationStateFunction · 0.70

Tested by

no test coverage detected