(
pendingClassifierCheck: PendingClassifierCheck | undefined,
updatedInput: Record<string, unknown> | undefined,
)
| 174 | ...(feature('BASH_CLASSIFIER') |
| 175 | ? { |
| 176 | async tryClassifier( |
| 177 | pendingClassifierCheck: PendingClassifierCheck | undefined, |
| 178 | updatedInput: Record<string, unknown> | undefined, |
| 179 | ): Promise<PermissionDecision | null> { |
| 180 | if (tool.name !== BASH_TOOL_NAME || !pendingClassifierCheck) { |
| 181 | return null |
| 182 | } |
| 183 | const classifierDecision = await awaitClassifierAutoApproval( |
| 184 | pendingClassifierCheck, |
| 185 | toolUseContext.abortController.signal, |
| 186 | toolUseContext.options.isNonInteractiveSession, |
| 187 | ) |
| 188 | if (!classifierDecision) { |
| 189 | return null |
| 190 | } |
| 191 | if ( |
| 192 | feature('TRANSCRIPT_CLASSIFIER') && |
| 193 | classifierDecision.type === 'classifier' |
| 194 | ) { |
| 195 | const matchedRule = classifierDecision.reason.match( |
| 196 | /^Allowed by prompt rule: "(.+)"$/, |
| 197 | )?.[1] |
| 198 | if (matchedRule) { |
| 199 | setClassifierApproval(toolUseID, matchedRule) |
| 200 | } |
| 201 | } |
| 202 | logPermissionDecision( |
| 203 | { tool, input, toolUseContext, messageId, toolUseID }, |
| 204 | { decision: 'accept', source: { type: 'classifier' } }, |
| 205 | undefined, |
| 206 | ) |
| 207 | return { |
| 208 | behavior: 'allow' as const, |
| 209 | updatedInput: updatedInput ?? input, |
| 210 | userModified: false, |
| 211 | decisionReason: classifierDecision, |
| 212 | } |
| 213 | }, |
| 214 | } |
| 215 | : {}), |
| 216 | async runHooks( |
nothing calls this directly
no test coverage detected