🪢 chore: Import ToolPolicyConfig From @librechat/agents

The SDK type now ships in 3.1.77 (already pinned on `dev`), so the
structural mirror in `policy.ts` is redundant. Drop the local interface
and import directly so future SDK changes to `ToolPolicyConfig` propagate
without our `mapToolApprovalPolicy` going stale.
This commit is contained in:
Danny Avila 2026-05-04 09:48:00 -04:00
parent 2335ae2805
commit 9c99ad7682

View file

@ -1,4 +1,5 @@
import { randomUUID } from 'crypto';
import type { ToolPolicyConfig } from '@librechat/agents';
import type { Agents, TToolApprovalPolicy } from 'librechat-data-provider';
/**
@ -10,22 +11,6 @@ import type { Agents, TToolApprovalPolicy } from 'librechat-data-provider';
*/
const DEFAULT_REVIEW_DECISIONS: Agents.ToolApprovalDecisionType[] = ['approve', 'reject', 'edit'];
/**
* Structural mirror of `@librechat/agents`'s `ToolPolicyConfig`.
*
* Defined here (rather than imported) so this module compiles before the SDK
* version that ships `createToolPolicyHook` is published. When the SDK is
* pinned, callers in Slice B can `import type { ToolPolicyConfig }` and
* the structural identity holds.
*/
export interface ToolPolicyConfig {
mode?: 'default' | 'dontAsk' | 'bypass';
allow?: string[];
deny?: string[];
ask?: string[];
reason?: string;
}
/**
* Whether the HITL machinery should run for this policy.
*