From 9c99ad7682481751f9ada4f67183bbbcc5fbc4f3 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 4 May 2026 09:48:00 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=A2=20chore:=20Import=20ToolPolicyConf?= =?UTF-8?q?ig=20From=20`@librechat/agents`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/api/src/agents/hitl/policy.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/api/src/agents/hitl/policy.ts b/packages/api/src/agents/hitl/policy.ts index 34739db31b..e1ad02794a 100644 --- a/packages/api/src/agents/hitl/policy.ts +++ b/packages/api/src/agents/hitl/policy.ts @@ -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. *