From 5b79fa13e285bd7ab2b42d7e6551f042b15ca92b Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 22 Jun 2026 00:45:29 +0800 Subject: [PATCH] chore(deadcode): trim doctor alias wrappers --- src/commands/doctor-gateway-auth-token.test.ts | 6 ++---- src/commands/doctor-gateway-auth-token.ts | 1 - src/commands/doctor/channel-capabilities.ts | 4 ++-- src/commands/doctor/shared/allow-from-mode.ts | 4 ++-- src/commands/doctor/shared/allow-from-mode.types.ts | 2 -- 5 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 src/commands/doctor/shared/allow-from-mode.types.ts diff --git a/src/commands/doctor-gateway-auth-token.test.ts b/src/commands/doctor-gateway-auth-token.test.ts index 7bafd30a8542..a0621f5b3447 100644 --- a/src/commands/doctor-gateway-auth-token.test.ts +++ b/src/commands/doctor-gateway-auth-token.test.ts @@ -5,11 +5,9 @@ import { join } from "node:path"; import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import { withTempHome, writeStateDirDotEnv } from "../config/test-helpers.js"; +import { shouldRequireGatewayTokenForInstall } from "../gateway/auth-install-policy.js"; import { withEnvAsync } from "../test-utils/env.js"; -import { - resolveGatewayAuthTokenForService, - shouldRequireGatewayTokenForInstall, -} from "./doctor-gateway-auth-token.js"; +import { resolveGatewayAuthTokenForService } from "./doctor-gateway-auth-token.js"; import { resolveGatewayInstallToken } from "./gateway-install-token.js"; const envVar = (...parts: string[]) => parts.join("_"); diff --git a/src/commands/doctor-gateway-auth-token.ts b/src/commands/doctor-gateway-auth-token.ts index 9e09504d15fb..bcf5c21a0148 100644 --- a/src/commands/doctor-gateway-auth-token.ts +++ b/src/commands/doctor-gateway-auth-token.ts @@ -1,7 +1,6 @@ /** Resolves gateway service auth tokens without leaking exec-backed secrets during install. */ import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveSecretInputRef } from "../config/types.secrets.js"; -export { shouldRequireGatewayTokenForInstall } from "../gateway/auth-install-policy.js"; import { resolveGatewayAuthToken } from "../gateway/auth-token-resolution.js"; import { trimToUndefined } from "../gateway/credentials.js"; diff --git a/src/commands/doctor/channel-capabilities.ts b/src/commands/doctor/channel-capabilities.ts index 734b33fb8a17..ffe5f05b2343 100644 --- a/src/commands/doctor/channel-capabilities.ts +++ b/src/commands/doctor/channel-capabilities.ts @@ -1,16 +1,16 @@ // Doctor capability lookup for channel-specific policy and migration behavior. import { getBundledChannelPlugin } from "../../channels/plugins/bundled.js"; +import type { ChannelDmAllowFromMode } from "../../channels/plugins/dm-access.js"; import { getChannelPlugin } from "../../channels/plugins/index.js"; import { normalizeAnyChannelId } from "../../channels/registry.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { findBundledPackageChannelMetadata } from "../../plugins/bundled-package-channel-metadata.js"; import type { PluginPackageChannelDoctorCapabilities } from "../../plugins/manifest.js"; -import type { AllowFromMode } from "./shared/allow-from-mode.types.js"; type DoctorGroupModel = "sender" | "route" | "hybrid"; type DoctorChannelCapabilities = { - dmAllowFromMode: AllowFromMode; + dmAllowFromMode: ChannelDmAllowFromMode; groupModel: DoctorGroupModel; groupAllowFromFallbackToAllowFrom: boolean; warnOnEmptyGroupSenderAllowlist: boolean; diff --git a/src/commands/doctor/shared/allow-from-mode.ts b/src/commands/doctor/shared/allow-from-mode.ts index 0c4a5c9ddc26..016a1d1e4522 100644 --- a/src/commands/doctor/shared/allow-from-mode.ts +++ b/src/commands/doctor/shared/allow-from-mode.ts @@ -1,8 +1,8 @@ // Doctor helper for resolving channel-specific direct-message allowlist semantics. +import type { ChannelDmAllowFromMode } from "../../../channels/plugins/dm-access.js"; import { getDoctorChannelCapabilities } from "../channel-capabilities.js"; -import type { AllowFromMode } from "./allow-from-mode.types.js"; -export type { AllowFromMode } from "./allow-from-mode.types.js"; +export type AllowFromMode = ChannelDmAllowFromMode; /** Return the allowFrom interpretation mode advertised by a channel's doctor metadata. */ export function resolveAllowFromMode(channelName: string): AllowFromMode { diff --git a/src/commands/doctor/shared/allow-from-mode.types.ts b/src/commands/doctor/shared/allow-from-mode.types.ts deleted file mode 100644 index 9fa28f6d10a5..000000000000 --- a/src/commands/doctor/shared/allow-from-mode.types.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Shared doctor type alias for channel DM allowFrom interpretation modes. -export type { ChannelDmAllowFromMode as AllowFromMode } from "../../../channels/plugins/dm-access.js";