MCPcopy Index your code
hub / github.com/codeaashu/claude-code / buildPendingClassifierCheck

Function buildPendingClassifierCheck

src/tools/BashTool/bashPermissions.ts:1459–1481  ·  view source on GitHub ↗

* Builds the pending classifier check metadata if classifier is enabled and has allow descriptions. * Returns undefined if classifier is disabled, in auto mode, or no allow descriptions exist.

(
  command: string,
  toolPermissionContext: ToolPermissionContext,
)

Source from the content-addressed store, hash-verified

1457 * Returns undefined if classifier is disabled, in auto mode, or no allow descriptions exist.
1458 */
1459function buildPendingClassifierCheck(
1460 command: string,
1461 toolPermissionContext: ToolPermissionContext,
1462): { command: string; cwd: string; descriptions: string[] } | undefined {
1463 if (!isClassifierPermissionsEnabled()) {
1464 return undefined
1465 }
1466 // Skip in auto mode - auto mode classifier handles all permission decisions
1467 if (feature('TRANSCRIPT_CLASSIFIER') && toolPermissionContext.mode === 'auto')
1468 return undefined
1469 if (toolPermissionContext.mode === 'bypassPermissions') return undefined
1470
1471 const allowDescriptions = getBashPromptAllowDescriptions(
1472 toolPermissionContext,
1473 )
1474 if (allowDescriptions.length === 0) return undefined
1475
1476 return {
1477 command,
1478 cwd: getCwd(),
1479 descriptions: allowDescriptions,
1480 }
1481}
1482
1483const speculativeChecks = new Map<string, Promise<ClassifierResult>>()
1484

Callers 1

bashToolHasPermissionFunction · 0.85

Calls 4

featureFunction · 0.85
getCwdFunction · 0.85

Tested by

no test coverage detected