diff --git a/extensions/feishu/src/async.ts b/extensions/feishu/src/async.ts index 6a175849ca9..9c59be09135 100644 --- a/extensions/feishu/src/async.ts +++ b/extensions/feishu/src/async.ts @@ -1,7 +1,7 @@ const RACE_TIMEOUT = Symbol("race-timeout"); const RACE_ABORT = Symbol("race-abort"); -export type RaceWithTimeoutAndAbortResult = +type RaceWithTimeoutAndAbortResult = | { status: "resolved"; value: T } | { status: "timeout" } | { status: "aborted" }; diff --git a/extensions/feishu/src/bot-content.ts b/extensions/feishu/src/bot-content.ts index d9a2c88fa0e..9d7cea86ec7 100644 --- a/extensions/feishu/src/bot-content.ts +++ b/extensions/feishu/src/bot-content.ts @@ -7,7 +7,7 @@ import { parsePostContent } from "./post.js"; import { getFeishuRuntime } from "./runtime.js"; import type { FeishuChatType, FeishuMediaInfo } from "./types.js"; -export type FeishuMention = { +type FeishuMention = { key: string; id: { open_id?: string; @@ -37,11 +37,11 @@ type FeishuMessageLike = { }; }; -export type GroupSessionScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; +type GroupSessionScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; type FeishuLogger = (...args: unknown[]) => void; -export type ResolvedFeishuGroupSession = { +type ResolvedFeishuGroupSession = { peerId: string; parentPeer: { kind: "group"; id: string } | null; groupSessionScope: GroupSessionScope; @@ -299,7 +299,7 @@ export function normalizeFeishuCommandProbeBody(text: string): string { .trim(); } -export function parseMediaKeys( +function parseMediaKeys( content: string, messageType: string, ): { imageKey?: string; fileKey?: string; fileName?: string } { diff --git a/extensions/feishu/src/card-interaction.ts b/extensions/feishu/src/card-interaction.ts index 0b3f5a1a2b2..7731cd2bae4 100644 --- a/extensions/feishu/src/card-interaction.ts +++ b/extensions/feishu/src/card-interaction.ts @@ -2,17 +2,10 @@ import { isRecord } from "./comment-shared.js"; export const FEISHU_CARD_INTERACTION_VERSION = "ocf1"; -export type FeishuCardInteractionKind = "button" | "quick" | "meta"; -export type FeishuCardInteractionReason = - | "malformed" - | "stale" - | "wrong_user" - | "wrong_conversation"; +type FeishuCardInteractionKind = "button" | "quick" | "meta"; +type FeishuCardInteractionReason = "malformed" | "stale" | "wrong_user" | "wrong_conversation"; -export type FeishuCardInteractionMetadata = Record< - string, - string | number | boolean | null | undefined ->; +type FeishuCardInteractionMetadata = Record; export type FeishuCardInteractionEnvelope = { oc: typeof FEISHU_CARD_INTERACTION_VERSION; @@ -29,7 +22,7 @@ export type FeishuCardInteractionEnvelope = { }; }; -export type FeishuCardActionEventLike = { +type FeishuCardActionEventLike = { operator: { open_id?: string; }; @@ -41,7 +34,7 @@ export type FeishuCardActionEventLike = { }; }; -export type DecodedFeishuCardAction = +type DecodedFeishuCardAction = | { kind: "structured"; envelope: FeishuCardInteractionEnvelope; diff --git a/extensions/feishu/src/card-ux-launcher.ts b/extensions/feishu/src/card-ux-launcher.ts index 015572cd6b6..39a9bf45af9 100644 --- a/extensions/feishu/src/card-ux-launcher.ts +++ b/extensions/feishu/src/card-ux-launcher.ts @@ -5,7 +5,7 @@ import { FEISHU_APPROVAL_REQUEST_ACTION } from "./card-ux-approval.js"; import { buildFeishuCardButton, buildFeishuCardInteractionContext } from "./card-ux-shared.js"; import { sendCardFeishu } from "./send.js"; -export const FEISHU_QUICK_ACTION_CARD_TTL_MS = 10 * 60_000; +const FEISHU_QUICK_ACTION_CARD_TTL_MS = 10 * 60_000; const QUICK_ACTION_MENU_KEYS = new Set(["quick-actions", "quick_actions", "launcher"]); diff --git a/extensions/feishu/src/comment-dispatcher.ts b/extensions/feishu/src/comment-dispatcher.ts index af255f60d84..f4415e3eff8 100644 --- a/extensions/feishu/src/comment-dispatcher.ts +++ b/extensions/feishu/src/comment-dispatcher.ts @@ -12,7 +12,7 @@ import type { CommentFileType } from "./comment-target.js"; import { deliverCommentThreadText } from "./drive.js"; import { getFeishuRuntime } from "./runtime.js"; -export type CreateFeishuCommentReplyDispatcherParams = { +type CreateFeishuCommentReplyDispatcherParams = { cfg: ClawdbotConfig; agentId: string; runtime: RuntimeEnv; diff --git a/extensions/feishu/src/comment-shared.ts b/extensions/feishu/src/comment-shared.ts index 41ce3c178e5..4b9ee90a577 100644 --- a/extensions/feishu/src/comment-shared.ts +++ b/extensions/feishu/src/comment-shared.ts @@ -1,5 +1,4 @@ import { - hasNonEmptyString as sharedHasNonEmptyString, isRecord as sharedIsRecord, normalizeOptionalString, readStringValue, @@ -24,8 +23,6 @@ export const normalizeString = normalizeOptionalString; export const isRecord = sharedIsRecord; -export const hasNonEmptyString = sharedHasNonEmptyString; - export function formatFeishuApiError( error: unknown, options: { @@ -64,18 +61,18 @@ export function formatFeishuApiError( }); } -export type ParsedCommentDocumentRef = { +type ParsedCommentDocumentRef = { fileType?: CommentFileType; fileToken?: string; }; -export type ParsedCommentMention = { +type ParsedCommentMention = { userId: string; displayText: string; isBotMention: boolean; }; -export type ParsedCommentLinkedDocumentKind = +type ParsedCommentLinkedDocumentKind = | CommentFileType | "wiki" | "mindnote" @@ -83,7 +80,7 @@ export type ParsedCommentLinkedDocumentKind = | "base" | "unknown"; -export type ParsedCommentResolvedDocumentType = Exclude< +type ParsedCommentResolvedDocumentType = Exclude< ParsedCommentLinkedDocumentKind, "wiki" | "unknown" >; diff --git a/extensions/feishu/src/comment-target.ts b/extensions/feishu/src/comment-target.ts index d122deba0e8..bde952d8e21 100644 --- a/extensions/feishu/src/comment-target.ts +++ b/extensions/feishu/src/comment-target.ts @@ -9,7 +9,7 @@ export function normalizeCommentFileType(value: unknown): CommentFileType | unde : undefined; } -export type FeishuCommentTarget = { +type FeishuCommentTarget = { fileType: CommentFileType; fileToken: string; commentId: string; diff --git a/extensions/feishu/src/docx-color-text.ts b/extensions/feishu/src/docx-color-text.ts index 0c6d7b503f6..6b463aa1f2f 100644 --- a/extensions/feishu/src/docx-color-text.ts +++ b/extensions/feishu/src/docx-color-text.ts @@ -59,7 +59,7 @@ type DocxTextElement = NonNullable< * [bold]text[/bold] → bold * [green bold]text[/green] → green + bold */ -export function parseColorMarkup(content: string): Segment[] { +function parseColorMarkup(content: string): Segment[] { const segments: Segment[] = []; // Only [known_tag]...[/...] pairs are treated as markup. Using an open // pattern like \[([^\]]+)\] would match any bracket token — e.g. [Q1] — diff --git a/extensions/feishu/src/docx-table-ops.ts b/extensions/feishu/src/docx-table-ops.ts index 5670aaecae2..1acef669fad 100644 --- a/extensions/feishu/src/docx-table-ops.ts +++ b/extensions/feishu/src/docx-table-ops.ts @@ -61,10 +61,7 @@ function createDescendantTable( }; } -export function calculateAdaptiveColumnWidths( - blocks: FeishuDocxBlock[], - tableBlockId: string, -): number[] { +function calculateAdaptiveColumnWidths(blocks: FeishuDocxBlock[], tableBlockId: string): number[] { // Find the table block const tableBlock = blocks.find((b) => b.block_id === tableBlockId && b.block_type === 31); diff --git a/extensions/feishu/src/docx-types.ts b/extensions/feishu/src/docx-types.ts index 7156be9843c..686f48d558c 100644 --- a/extensions/feishu/src/docx-types.ts +++ b/extensions/feishu/src/docx-types.ts @@ -1,4 +1,4 @@ -export type FeishuBlockText = { +type FeishuBlockText = { elements?: Array<{ text_run?: { content?: string; @@ -6,7 +6,7 @@ export type FeishuBlockText = { }>; }; -export type FeishuBlockTableProperty = { +type FeishuBlockTableProperty = { row_size?: number; column_size?: number; column_width?: number[]; diff --git a/extensions/feishu/src/dynamic-agent.ts b/extensions/feishu/src/dynamic-agent.ts index b215749a2a4..1e23079cb7f 100644 --- a/extensions/feishu/src/dynamic-agent.ts +++ b/extensions/feishu/src/dynamic-agent.ts @@ -4,7 +4,7 @@ import path from "node:path"; import type { OpenClawConfig, PluginRuntime } from "../runtime-api.js"; import type { DynamicAgentCreationConfig } from "./types.js"; -export type MaybeCreateDynamicAgentResult = { +type MaybeCreateDynamicAgentResult = { created: boolean; updatedCfg: OpenClawConfig; agentId?: string; diff --git a/extensions/feishu/src/mention.ts b/extensions/feishu/src/mention.ts index 583cca99b50..50ca52c98cc 100644 --- a/extensions/feishu/src/mention.ts +++ b/extensions/feishu/src/mention.ts @@ -1,5 +1,4 @@ import type { FeishuMessageEvent } from "./event-types.js"; -export type { MentionTarget } from "./mention-target.types.js"; import type { MentionTarget } from "./mention-target.types.js"; import { isFeishuGroupChatType } from "./types.js"; @@ -79,14 +78,14 @@ export function isMentionForwardRequest(event: FeishuMessageEvent, botOpenId?: s /** * Format @mention for text message */ -export function formatMentionForText(target: MentionTarget): string { +function formatMentionForText(target: MentionTarget): string { return `${target.name}`; } /** * Format @mention for card message (lark_md) */ -export function formatMentionForCard(target: MentionTarget): string { +function formatMentionForCard(target: MentionTarget): string { return ``; } diff --git a/extensions/feishu/src/monitor.bot-identity.ts b/extensions/feishu/src/monitor.bot-identity.ts index bea67f61caa..b93863639dd 100644 --- a/extensions/feishu/src/monitor.bot-identity.ts +++ b/extensions/feishu/src/monitor.bot-identity.ts @@ -7,7 +7,7 @@ import type { ResolvedFeishuAccount } from "./types.js"; // Delays must be >= PROBE_ERROR_TTL_MS (60s) so each retry makes a real network request // instead of silently hitting the probe error cache. -export const BOT_IDENTITY_RETRY_DELAYS_MS = [60_000, 120_000, 300_000, 600_000, 900_000]; +const BOT_IDENTITY_RETRY_DELAYS_MS = [60_000, 120_000, 300_000, 600_000, 900_000]; export function applyBotIdentityState( accountId: string, diff --git a/extensions/feishu/src/monitor.comment.ts b/extensions/feishu/src/monitor.comment.ts index 3d80972ec34..f9df897689e 100644 --- a/extensions/feishu/src/monitor.comment.ts +++ b/extensions/feishu/src/monitor.comment.ts @@ -60,7 +60,7 @@ type ResolveDriveCommentEventParams = { waitMs?: (ms: number) => Promise; }; -export type ResolvedDriveCommentEventTurn = { +type ResolvedDriveCommentEventTurn = { eventId: string; messageId: string; commentId: string; diff --git a/extensions/feishu/src/monitor.startup.ts b/extensions/feishu/src/monitor.startup.ts index 378cff41dd2..11a6b4855b6 100644 --- a/extensions/feishu/src/monitor.startup.ts +++ b/extensions/feishu/src/monitor.startup.ts @@ -20,7 +20,7 @@ function resolveStartupProbeTimeoutMs(): number { return FEISHU_STARTUP_BOT_INFO_TIMEOUT_DEFAULT_MS; } -export const FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS = resolveStartupProbeTimeoutMs(); +const FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS = resolveStartupProbeTimeoutMs(); type FetchBotOpenIdOptions = { runtime?: RuntimeEnv; diff --git a/extensions/feishu/src/monitor.transport.ts b/extensions/feishu/src/monitor.transport.ts index 1d158d8a0e3..a7a80e8a7d2 100644 --- a/extensions/feishu/src/monitor.transport.ts +++ b/extensions/feishu/src/monitor.transport.ts @@ -22,7 +22,7 @@ import { } from "./monitor.state.js"; import type { ResolvedFeishuAccount } from "./types.js"; -export type MonitorTransportParams = { +type MonitorTransportParams = { account: ResolvedFeishuAccount; accountId: string; runtime?: RuntimeEnv; diff --git a/extensions/feishu/src/pins.ts b/extensions/feishu/src/pins.ts index 3b72adf4c0e..ed465d1b3db 100644 --- a/extensions/feishu/src/pins.ts +++ b/extensions/feishu/src/pins.ts @@ -2,7 +2,7 @@ import type { ClawdbotConfig } from "../runtime-api.js"; import { resolveFeishuRuntimeAccount } from "./accounts.js"; import { createFeishuClient } from "./client.js"; -export type FeishuPin = { +type FeishuPin = { messageId: string; chatId?: string; operatorId?: string; diff --git a/extensions/feishu/src/policy.ts b/extensions/feishu/src/policy.ts index afc932dffea..b92e95c2bb4 100644 --- a/extensions/feishu/src/policy.ts +++ b/extensions/feishu/src/policy.ts @@ -9,7 +9,7 @@ import type { AllowlistMatch, ChannelGroupContext } from "../runtime-api.js"; import { detectIdType } from "./targets.js"; import type { FeishuConfig } from "./types.js"; -export type FeishuAllowlistMatch = AllowlistMatch<"wildcard" | "id">; +type FeishuAllowlistMatch = AllowlistMatch<"wildcard" | "id">; const FEISHU_PROVIDER_PREFIX_RE = /^(feishu|lark):/i; diff --git a/extensions/feishu/src/reactions.ts b/extensions/feishu/src/reactions.ts index 73d2d75ddb1..863471b2439 100644 --- a/extensions/feishu/src/reactions.ts +++ b/extensions/feishu/src/reactions.ts @@ -2,7 +2,7 @@ import type { ClawdbotConfig } from "../runtime-api.js"; import { resolveFeishuRuntimeAccount } from "./accounts.js"; import { createFeishuClient } from "./client.js"; -export type FeishuReaction = { +type FeishuReaction = { reactionId: string; emojiType: string; operatorType: "app" | "user"; diff --git a/extensions/feishu/src/reply-dispatcher.ts b/extensions/feishu/src/reply-dispatcher.ts index efaae0bd465..7fc57bb7061 100644 --- a/extensions/feishu/src/reply-dispatcher.ts +++ b/extensions/feishu/src/reply-dispatcher.ts @@ -101,7 +101,7 @@ function resolveCardNote( return parts.join(" | "); } -export type CreateFeishuReplyDispatcherParams = { +type CreateFeishuReplyDispatcherParams = { cfg: ClawdbotConfig; agentId: string; runtime: RuntimeEnv; diff --git a/extensions/feishu/src/send-result.ts b/extensions/feishu/src/send-result.ts index b9ba39ba0b1..996223d34fe 100644 --- a/extensions/feishu/src/send-result.ts +++ b/extensions/feishu/src/send-result.ts @@ -1,4 +1,4 @@ -export type FeishuMessageApiResponse = { +type FeishuMessageApiResponse = { code?: number; msg?: string; data?: { diff --git a/extensions/feishu/src/session-conversation.ts b/extensions/feishu/src/session-conversation.ts index 4527038e390..e56d6a24991 100644 --- a/extensions/feishu/src/session-conversation.ts +++ b/extensions/feishu/src/session-conversation.ts @@ -1,6 +1,6 @@ import { buildFeishuConversationId, parseFeishuConversationId } from "./conversation-id.js"; -export function resolveFeishuParentConversationCandidates(rawId: string): string[] { +function resolveFeishuParentConversationCandidates(rawId: string): string[] { const parsed = parseFeishuConversationId({ conversationId: rawId }); if (!parsed) { return []; diff --git a/extensions/feishu/src/streaming-card.ts b/extensions/feishu/src/streaming-card.ts index ef1aa1ec7f5..78e12284114 100644 --- a/extensions/feishu/src/streaming-card.ts +++ b/extensions/feishu/src/streaming-card.ts @@ -18,7 +18,7 @@ type CardState = { }; /** Options for customising the initial streaming card appearance. */ -export type StreamingCardOptions = { +type StreamingCardOptions = { /** Optional header with title and color template. */ header?: CardHeaderConfig; /** Optional grey note footer text. */ @@ -26,7 +26,7 @@ export type StreamingCardOptions = { }; /** Optional header for streaming cards (title bar with color template) */ -export type StreamingCardHeader = { +type StreamingCardHeader = { title: string; /** Color template: blue, green, red, orange, purple, indigo, wathet, turquoise, yellow, grey, carmine, violet, lime */ template?: string; diff --git a/extensions/feishu/src/tools-config.ts b/extensions/feishu/src/tools-config.ts index 1890f626583..b09f8d64b5c 100644 --- a/extensions/feishu/src/tools-config.ts +++ b/extensions/feishu/src/tools-config.ts @@ -5,7 +5,7 @@ import type { FeishuToolsConfig } from "./types.js"; * - doc, chat, wiki, drive, scopes: enabled by default * - perm: disabled by default (sensitive operation) */ -export const DEFAULT_TOOLS_CONFIG: Required = { +const DEFAULT_TOOLS_CONFIG: Required = { doc: true, chat: true, wiki: true, diff --git a/extensions/feishu/src/types.ts b/extensions/feishu/src/types.ts index 4075bbede72..e23ad07de84 100644 --- a/extensions/feishu/src/types.ts +++ b/extensions/feishu/src/types.ts @@ -11,7 +11,7 @@ export type FeishuDefaultAccountSelectionSource = | "explicit-default" | "mapped-default" | "fallback"; -export type FeishuAccountSelectionSource = "explicit" | FeishuDefaultAccountSelectionSource; +type FeishuAccountSelectionSource = "explicit" | FeishuDefaultAccountSelectionSource; export type ResolvedFeishuAccount = { accountId: string;