mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-16 06:43:07 -07:00
fix(cli): fix toolName type and resolve '*' to 'all tools' in policies dialog
This commit is contained in:
@@ -65,7 +65,7 @@ describe('buildPolicyListItems', () => {
|
||||
const rules = [
|
||||
{ decision: PolicyDecision.ALLOW, toolName: 'run_shell_command' },
|
||||
{ decision: PolicyDecision.ALLOW, toolName: 'unknown_tool' },
|
||||
{ decision: PolicyDecision.ALLOW },
|
||||
{ decision: PolicyDecision.ALLOW, toolName: '*' },
|
||||
];
|
||||
|
||||
const items = buildPolicyListItems(
|
||||
|
||||
@@ -38,9 +38,10 @@ export function buildPolicyListItems(
|
||||
.filter(({ rule }) => rule.decision === decision)
|
||||
.sort((a, b) => (b.rule.priority ?? 0) - (a.rule.priority ?? 0))
|
||||
.map(({ rule, index }) => {
|
||||
const toolDisplayName = rule.toolName
|
||||
? (toolDisplayNames.get(rule.toolName) ?? rule.toolName)
|
||||
: 'all tools';
|
||||
const toolDisplayName =
|
||||
!rule.toolName || rule.toolName === '*'
|
||||
? 'all tools'
|
||||
: (toolDisplayNames.get(rule.toolName) ?? rule.toolName);
|
||||
const constraint = rule.constraintDisplay;
|
||||
const source = rule.source ?? '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user