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

Function awaitClassifierAutoApproval

src/tools/BashTool/bashPermissions.ts:1555–1587  ·  view source on GitHub ↗
(
  pendingCheck: PendingClassifierCheck,
  signal: AbortSignal,
  isNonInteractiveSession: boolean,
)

Source from the content-addressed store, hash-verified

1553 * if the classifier doesn't auto-approve.
1554 */
1555export async function awaitClassifierAutoApproval(
1556 pendingCheck: PendingClassifierCheck,
1557 signal: AbortSignal,
1558 isNonInteractiveSession: boolean,
1559): Promise<PermissionDecisionReason | undefined> {
1560 const { command, cwd, descriptions } = pendingCheck
1561 const speculativeResult = consumeSpeculativeClassifierCheck(command)
1562 const classifierResult = speculativeResult
1563 ? await speculativeResult
1564 : await classifyBashCommand(
1565 command,
1566 cwd,
1567 descriptions,
1568 'allow',
1569 signal,
1570 isNonInteractiveSession,
1571 )
1572
1573 logClassifierResultForAnts(command, 'allow', descriptions, classifierResult)
1574
1575 if (
1576 feature('BASH_CLASSIFIER') &&
1577 classifierResult.matches &&
1578 classifierResult.confidence === 'high'
1579 ) {
1580 return {
1581 type: 'classifier',
1582 classifier: 'bash_allow',
1583 reason: `Allowed by prompt rule: "${classifierResult.matchedDescription}"`,
1584 }
1585 }
1586 return undefined
1587}
1588
1589type AsyncClassifierCheckCallbacks = {
1590 shouldContinue: () => boolean

Callers 2

tryClassifierFunction · 0.85

Calls 4

classifyBashCommandFunction · 0.85
featureFunction · 0.85

Tested by

no test coverage detected