chore: apply extension lint cleanups

This commit is contained in:
Peter Steinberger
2026-04-23 05:28:17 +01:00
parent 596b88986d
commit 0b0662b1c9
51 changed files with 141 additions and 155 deletions

View File

@@ -38,9 +38,7 @@ type FeishuMessageLike = {
export type GroupSessionScope = "group" | "group_sender" | "group_topic" | "group_topic_sender";
type FeishuLogger = {
(...args: unknown[]): void;
};
type FeishuLogger = (...args: unknown[]) => void;
export type ResolvedFeishuGroupSession = {
peerId: string;
@@ -215,7 +213,7 @@ export function parseMergeForwardContent(params: { content: string; log?: Feishu
log?.(`feishu: merge_forward contains ${subMessages.length} sub-messages`);
subMessages.sort(
(a, b) => parseInt(a.create_time || "0", 10) - parseInt(b.create_time || "0", 10),
(a, b) => Number.parseInt(a.create_time || "0", 10) - Number.parseInt(b.create_time || "0", 10),
);
const lines = ["[Merged and Forwarded Messages]"];

View File

@@ -17,9 +17,7 @@ type FeishuContactUserGetResponse = Awaited<
ReturnType<ReturnType<typeof createFeishuClient>["contact"]["user"]["get"]>
>;
type FeishuLogger = {
(...args: unknown[]): void;
};
type FeishuLogger = (...args: unknown[]) => void;
const IGNORED_PERMISSION_SCOPE_TOKENS = ["contact:contact.base:readonly"];
const FEISHU_SCOPE_CORRECTIONS: Record<string, string> = {

View File

@@ -409,7 +409,7 @@ export async function handleFeishuMessage(params: {
// instead of the delivery/processing time. Feishu uses a millisecond
// epoch string; fall back to Date.now() only when the field is absent.
const messageCreateTimeMs = event.message.create_time
? parseInt(event.message.create_time, 10)
? Number.parseInt(event.message.create_time, 10)
: Date.now();
let requireMention = false; // DMs never require mention; groups may override below

View File

@@ -1,6 +1,6 @@
import fs from "fs";
import path from "path";
import { Readable } from "stream";
import fs from "node:fs";
import path from "node:path";
import { Readable } from "node:stream";
import type * as Lark from "@larksuiteoapi/node-sdk";
import { mediaKindFromMime } from "openclaw/plugin-sdk/media-runtime";
import { withTempDownloadPath } from "openclaw/plugin-sdk/temp-path";
@@ -627,22 +627,21 @@ export async function sendMediaFeishu(params: {
if (routing.msgType === "image") {
const { imageKey } = await uploadImageFeishu({ cfg, image: buffer, accountId });
return sendImageFeishu({ cfg, to, imageKey, replyToMessageId, replyInThread, accountId });
} else {
const { fileKey } = await uploadFileFeishu({
cfg,
file: buffer,
fileName: name,
fileType: routing.fileType ?? "stream",
accountId,
});
return sendFileFeishu({
cfg,
to,
fileKey,
msgType: routing.msgType,
replyToMessageId,
replyInThread,
accountId,
});
}
const { fileKey } = await uploadFileFeishu({
cfg,
file: buffer,
fileName: name,
fileType: routing.fileType ?? "stream",
accountId,
});
return sendFileFeishu({
cfg,
to,
fileKey,
msgType: routing.msgType,
replyToMessageId,
replyInThread,
accountId,
});
}

View File

@@ -52,11 +52,10 @@ export function isMentionForwardRequest(event: FeishuMessageEvent, botOpenId?: s
if (isDirectMessage) {
// DM: trigger if any non-bot user is mentioned
return hasOtherMention;
} else {
// Group: need to mention both bot and other users
const hasBotMention = mentions.some((m) => m.id.open_id === botOpenId);
return hasBotMention && hasOtherMention;
}
// Group: need to mention both bot and other users
const hasBotMention = mentions.some((m) => m.id.open_id === botOpenId);
return hasBotMention && hasOtherMention;
}
/**

View File

@@ -1,4 +1,4 @@
import * as crypto from "crypto";
import * as crypto from "node:crypto";
import type * as Lark from "@larksuiteoapi/node-sdk";
import type { ClawdbotConfig, RuntimeEnv, HistoryEntry } from "../runtime-api.js";
import { resolveFeishuAccount } from "./accounts.js";

View File

@@ -1,4 +1,4 @@
import * as http from "http";
import * as http from "node:http";
import type * as Lark from "@larksuiteoapi/node-sdk";
import {
createFixedWindowRateLimiter,

View File

@@ -1,5 +1,5 @@
import * as http from "http";
import crypto from "node:crypto";
import * as http from "node:http";
import * as Lark from "@larksuiteoapi/node-sdk";
import { createFeishuWSClient } from "./client.js";
import {

View File

@@ -1,5 +1,5 @@
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
import { resolveFeishuAccount } from "./accounts.js";

View File

@@ -276,7 +276,7 @@ function parseFeishuMessageItem(
senderType: item.sender?.sender_type,
content: parseFeishuMessageContent(rawContent, msgType),
contentType: msgType,
createTime: item.create_time ? parseInt(item.create_time, 10) : undefined,
createTime: item.create_time ? Number.parseInt(item.create_time, 10) : undefined,
threadId: item.thread_id || undefined,
};
}