style: run oxfmt and fix gate failures

This commit is contained in:
Peter Steinberger
2026-02-18 01:29:02 +00:00
parent 638853c6d2
commit 31f9be126c
1119 changed files with 2110 additions and 2102 deletions

View File

@@ -8,6 +8,8 @@ import type {
PostbackEvent,
} from "@line/bot-sdk";
import type { OpenClawConfig } from "../config/config.js";
import type { RuntimeEnv } from "../runtime.js";
import type { LineGroupConfig, ResolvedLineAccount } from "./types.js";
import { danger, logVerbose } from "../globals.js";
import { resolvePairingIdLabel } from "../pairing/pairing-labels.js";
import { buildPairingReply } from "../pairing/pairing-messages.js";
@@ -15,7 +17,6 @@ import {
readChannelAllowFromStore,
upsertChannelPairingRequest,
} from "../pairing/pairing-store.js";
import type { RuntimeEnv } from "../runtime.js";
import { firstDefined, isSenderAllowed, normalizeAllowFromWithStore } from "./bot-access.js";
import {
getLineSourceInfo,
@@ -25,7 +26,6 @@ import {
} from "./bot-message-context.js";
import { downloadLineMedia } from "./download.js";
import { pushMessageLine, replyMessageLine } from "./send.js";
import type { LineGroupConfig, ResolvedLineAccount } from "./types.js";
interface MediaRef {
path: string;

View File

@@ -1,11 +1,11 @@
import type { MessageEvent, PostbackEvent } from "@line/bot-sdk";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import type { MessageEvent, PostbackEvent } from "@line/bot-sdk";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import { buildLineMessageContext, buildLinePostbackContext } from "./bot-message-context.js";
import type { ResolvedLineAccount } from "./types.js";
import { buildLineMessageContext, buildLinePostbackContext } from "./bot-message-context.js";
describe("buildLineMessageContext", () => {
let tmpDir: string;

View File

@@ -1,8 +1,9 @@
import type { MessageEvent, StickerEventMessage, EventSource, PostbackEvent } from "@line/bot-sdk";
import type { OpenClawConfig } from "../config/config.js";
import type { ResolvedLineAccount } from "./types.js";
import { formatInboundEnvelope, resolveEnvelopeFormatOptions } from "../auto-reply/envelope.js";
import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js";
import { formatLocationText, toLocationContext } from "../channels/location.js";
import type { OpenClawConfig } from "../config/config.js";
import {
readSessionUpdatedAt,
recordSessionMetaFromInbound,
@@ -12,7 +13,6 @@ import {
import { logVerbose, shouldLogVerbose } from "../globals.js";
import { recordChannelActivity } from "../infra/channel-activity.js";
import { resolveAgentRoute } from "../routing/resolve-route.js";
import type { ResolvedLineAccount } from "./types.js";
interface MediaRef {
path: string;

View File

@@ -1,13 +1,13 @@
import type { WebhookRequestBody } from "@line/bot-sdk";
import type { Request, Response, NextFunction } from "express";
import type { OpenClawConfig } from "../config/config.js";
import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js";
import type { RuntimeEnv } from "../runtime.js";
import { resolveLineAccount } from "./accounts.js";
import { handleLineWebhookEvents } from "./bot-handlers.js";
import type { LineInboundContext } from "./bot-message-context.js";
import type { ResolvedLineAccount } from "./types.js";
import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js";
import { resolveLineAccount } from "./accounts.js";
import { handleLineWebhookEvents } from "./bot-handlers.js";
import { startLineWebhook } from "./webhook.js";
export interface LineBotOptions {

View File

@@ -1,7 +1,7 @@
import { messagingApi } from "@line/bot-sdk";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { messagingApi } from "@line/bot-sdk";
import { logVerbose } from "../globals.js";
interface DownloadResult {

View File

@@ -1,4 +1,3 @@
import { attachFooterText } from "./common.js";
import type {
Action,
CardAction,
@@ -11,6 +10,7 @@ import type {
FlexText,
ListItem,
} from "./types.js";
import { attachFooterText } from "./common.js";
/**
* Create an info card with title, body, and optional footer

View File

@@ -1,5 +1,5 @@
import { attachFooterText } from "./common.js";
import type { Action, FlexBox, FlexBubble, FlexComponent, FlexText } from "./types.js";
import { attachFooterText } from "./common.js";
function buildTitleSubtitleHeader(params: { title: string; subtitle?: string }): FlexComponent[] {
const { title, subtitle } = params;

View File

@@ -1,12 +1,13 @@
import type { WebhookRequestBody } from "@line/bot-sdk";
import type { OpenClawConfig } from "../config/config.js";
import type { RuntimeEnv } from "../runtime.js";
import type { LineChannelData, ResolvedLineAccount } from "./types.js";
import { chunkMarkdownText } from "../auto-reply/chunk.js";
import { dispatchReplyWithBufferedBlockDispatcher } from "../auto-reply/reply/provider-dispatcher.js";
import { createReplyPrefixOptions } from "../channels/reply-prefix.js";
import type { OpenClawConfig } from "../config/config.js";
import { danger, logVerbose } from "../globals.js";
import { normalizePluginHttpPath } from "../plugins/http-path.js";
import { registerPluginHttpRoute } from "../plugins/http-registry.js";
import type { RuntimeEnv } from "../runtime.js";
import { deliverLineAutoReply } from "./auto-reply-delivery.js";
import { createLineBot } from "./bot.js";
import { processLineMessage } from "./markdown-to-line.js";
@@ -25,7 +26,6 @@ import {
createLocationMessage,
} from "./send.js";
import { buildTemplateMessageFromPayload } from "./template-messages.js";
import type { LineChannelData, ResolvedLineAccount } from "./types.js";
import { createLineNodeWebhookHandler } from "./webhook-node.js";
export interface MonitorLineProviderOptions {

View File

@@ -1,6 +1,6 @@
import { messagingApi } from "@line/bot-sdk";
import { withTimeout } from "../utils/with-timeout.js";
import type { LineProbeResult } from "./types.js";
import { withTimeout } from "../utils/with-timeout.js";
export async function probeLineBot(
channelAccessToken: string,

View File

@@ -1,5 +1,5 @@
import { readFile } from "node:fs/promises";
import { messagingApi } from "@line/bot-sdk";
import { readFile } from "node:fs/promises";
import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js";
import { resolveLineAccount } from "./accounts.js";

View File

@@ -1,10 +1,10 @@
import { messagingApi } from "@line/bot-sdk";
import type { LineSendResult } from "./types.js";
import { loadConfig } from "../config/config.js";
import { logVerbose } from "../globals.js";
import { recordChannelActivity } from "../infra/channel-activity.js";
import { resolveLineAccount } from "./accounts.js";
import { resolveLineChannelAccessToken } from "./channel-access-token.js";
import type { LineSendResult } from "./types.js";
// Use the messaging API types directly
type Message = messagingApi.Message;

View File

@@ -1,5 +1,5 @@
import crypto from "node:crypto";
import type { IncomingMessage, ServerResponse } from "node:http";
import crypto from "node:crypto";
import { describe, expect, it, vi } from "vitest";
import { createLineNodeWebhookHandler } from "./webhook-node.js";

View File

@@ -1,12 +1,12 @@
import type { IncomingMessage, ServerResponse } from "node:http";
import type { WebhookRequestBody } from "@line/bot-sdk";
import type { IncomingMessage, ServerResponse } from "node:http";
import type { RuntimeEnv } from "../runtime.js";
import { danger, logVerbose } from "../globals.js";
import {
isRequestBodyLimitError,
readRequestBodyWithLimit,
requestBodyErrorToText,
} from "../infra/http-body.js";
import type { RuntimeEnv } from "../runtime.js";
import { validateLineSignature } from "./signature.js";
import { isLineWebhookVerificationRequest, parseLineWebhookBody } from "./webhook-utils.js";

View File

@@ -1,7 +1,7 @@
import type { WebhookRequestBody } from "@line/bot-sdk";
import type { Request, Response, NextFunction } from "express";
import { logVerbose, danger } from "../globals.js";
import type { RuntimeEnv } from "../runtime.js";
import { logVerbose, danger } from "../globals.js";
import { validateLineSignature } from "./signature.js";
import { isLineWebhookVerificationRequest, parseLineWebhookBody } from "./webhook-utils.js";