Skip to main content
Dotset CLI API Documentation / tollgate / normalizeToolPolicy

Function: normalizeToolPolicy()

function normalizeToolPolicy(policy): ToolPolicy;
Defined in: src/tollgate/policy/parser.ts:144 Normalizes a tool policy to its full object form. Converts shorthand string actions (e.g., ‘allow’) to full policy objects.

Parameters

policy

Policy in shorthand or object form

Returns

Normalized ToolPolicy object

Example

normalizeToolPolicy('allow')
// Returns: { action: 'allow' }

normalizeToolPolicy({ action: 'prompt', message: 'Confirm?' })
// Returns: { action: 'prompt', message: 'Confirm?' }