mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
feat(policy): add --admin-policy flag for supplemental admin policies (#20360)
This commit is contained in:
@@ -134,6 +134,18 @@ export interface SettingsSchema {
|
||||
export type MemoryImportFormat = 'tree' | 'flat';
|
||||
export type DnsResolutionOrder = 'ipv4first' | 'verbatim';
|
||||
|
||||
const pathArraySetting = (label: string, description: string) => ({
|
||||
type: 'array' as const,
|
||||
label,
|
||||
category: 'Advanced' as const,
|
||||
requiresRestart: true as const,
|
||||
default: [] as string[],
|
||||
description,
|
||||
showInDialog: false as const,
|
||||
items: { type: 'string' as const },
|
||||
mergeStrategy: MergeStrategy.UNION,
|
||||
});
|
||||
|
||||
/**
|
||||
* The canonical schema for all settings.
|
||||
* The structure of this object defines the structure of the `Settings` type.
|
||||
@@ -156,17 +168,15 @@ const SETTINGS_SCHEMA = {
|
||||
},
|
||||
},
|
||||
|
||||
policyPaths: {
|
||||
type: 'array',
|
||||
label: 'Policy Paths',
|
||||
category: 'Advanced',
|
||||
requiresRestart: true,
|
||||
default: [] as string[],
|
||||
description: 'Additional policy files or directories to load.',
|
||||
showInDialog: false,
|
||||
items: { type: 'string' },
|
||||
mergeStrategy: MergeStrategy.UNION,
|
||||
},
|
||||
policyPaths: pathArraySetting(
|
||||
'Policy Paths',
|
||||
'Additional policy files or directories to load.',
|
||||
),
|
||||
|
||||
adminPolicyPaths: pathArraySetting(
|
||||
'Admin Policy Paths',
|
||||
'Additional admin policy files or directories to load.',
|
||||
),
|
||||
|
||||
general: {
|
||||
type: 'object',
|
||||
@@ -2677,7 +2687,9 @@ type InferSettings<T extends SettingsSchema> = {
|
||||
? boolean
|
||||
: T[K]['default'] extends string
|
||||
? string
|
||||
: T[K]['default'];
|
||||
: T[K]['default'] extends ReadonlyArray<infer U>
|
||||
? U[]
|
||||
: T[K]['default'];
|
||||
};
|
||||
|
||||
type InferMergedSettings<T extends SettingsSchema> = {
|
||||
@@ -2691,7 +2703,9 @@ type InferMergedSettings<T extends SettingsSchema> = {
|
||||
? boolean
|
||||
: T[K]['default'] extends string
|
||||
? string
|
||||
: T[K]['default'];
|
||||
: T[K]['default'] extends ReadonlyArray<infer U>
|
||||
? U[]
|
||||
: T[K]['default'];
|
||||
};
|
||||
|
||||
export type Settings = InferSettings<SettingsSchemaType>;
|
||||
|
||||
Reference in New Issue
Block a user