feat(policy): add --policy flag for user defined policies (#18500)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Allen Hutchison
2026-02-12 16:25:23 -08:00
committed by GitHub
parent 5b4884692b
commit 696198be87
13 changed files with 326 additions and 49 deletions

View File

@@ -14,7 +14,18 @@ import type { ExtensionUpdateAction } from '../state/extensions.js';
*/
export function createNonInteractiveUI(): CommandContext['ui'] {
return {
addItem: (_item, _timestamp) => 0,
addItem: (item, _timestamp) => {
if ('text' in item && item.text) {
if (item.type === 'error') {
process.stderr.write(`Error: ${item.text}\n`);
} else if (item.type === 'warning') {
process.stderr.write(`Warning: ${item.text}\n`);
} else if (item.type === 'info') {
process.stdout.write(`${item.text}\n`);
}
}
return 0;
},
clear: () => {},
setDebugMessage: (_message) => {},
loadHistory: (_newHistory) => {},