πŸ“„ File detail

utils/classifierApprovalsHook.ts

🧩 .tsπŸ“ 18 linesπŸ’Ύ 531 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œutils/”, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, …). On the API surface it exposes useIsClassifierChecking β€” mainly functions, hooks, or classes. Dependencies touch React UI. It composes internal code from classifierApprovals (relative imports). What the file header says: React hook for classifierApprovals store. Split from classifierApprovals.ts so pure-state importers (permissions.ts, toolExecution.ts, postCompactCleanup.ts) do not pull React into print.ts.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

React hook for classifierApprovals store. Split from classifierApprovals.ts so pure-state importers (permissions.ts, toolExecution.ts, postCompactCleanup.ts) do not pull React into print.ts.

πŸ“€ Exports (heuristic)

  • useIsClassifierChecking

πŸ“š External import roots

Package roots from from "…" (relative paths omitted).

  • react

πŸ–₯️ Source preview

/**
 * React hook for classifierApprovals store.
 * Split from classifierApprovals.ts so pure-state importers (permissions.ts,
 * toolExecution.ts, postCompactCleanup.ts) do not pull React into print.ts.
 */

import { useSyncExternalStore } from 'react'
import {
  isClassifierChecking,
  subscribeClassifierChecking,
} from './classifierApprovals.js'

export function useIsClassifierChecking(toolUseID: string): boolean {
  return useSyncExternalStore(subscribeClassifierChecking, () =>
    isClassifierChecking(toolUseID),
  )
}