refactor: trim qqbot internal types · openclaw/openclaw@0442417
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ const DEFAULT_QUEUE_SNAPSHOT = {
|
27 | 27 | senderPending: 0, |
28 | 28 | } as const; |
29 | 29 | |
30 | | -export interface BuildFrameworkSlashContextInput { |
| 30 | +interface BuildFrameworkSlashContextInput { |
31 | 31 | ctx: PluginCommandContext; |
32 | 32 | account: ResolvedQQBotAccount; |
33 | 33 | from: QQBotFromParseResult; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,11 +19,11 @@ import type { QQBotFromParseResult } from "./from-parser.js";
|
19 | 19 | |
20 | 20 | const UNEXPECTED_RESULT_TEXT = "⚠️ 命令返回了意外结果。"; |
21 | 21 | |
22 | | -export interface FrameworkSlashReply { |
| 22 | +interface FrameworkSlashReply { |
23 | 23 | text: string; |
24 | 24 | } |
25 | 25 | |
26 | | -export interface DispatchFrameworkSlashResultInput { |
| 26 | +interface DispatchFrameworkSlashResultInput { |
27 | 27 | result: SlashCommandResult; |
28 | 28 | account: ResolvedQQBotAccount; |
29 | 29 | from: QQBotFromParseResult; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@
|
5 | 5 | * engine's `debugLog` so that all logs flow through the OpenClaw log system. |
6 | 6 | */ |
7 | 7 | |
8 | | -export interface BridgeLogger { |
| 8 | +interface BridgeLogger { |
9 | 9 | info: (msg: string) => void; |
10 | 10 | error: (msg: string) => void; |
11 | 11 | warn?: (msg: string) => void; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ import {
|
23 | 23 | type QQBotGroupPolicy, |
24 | 24 | } from "./types.js"; |
25 | 25 | |
26 | | -export interface QQBotAccessInput extends EffectivePolicyInput { |
| 26 | +interface QQBotAccessInput extends EffectivePolicyInput { |
27 | 27 | /** Whether the inbound originated in a group (or guild) chat. */ |
28 | 28 | isGroup: boolean; |
29 | 29 | /** The raw inbound sender id as provided by the QQ event. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,7 @@ const DEFAULT_BASE_URL = "https://api.sgroup.qq.com";
|
16 | 16 | const DEFAULT_TIMEOUT_MS = 30_000; |
17 | 17 | const FILE_UPLOAD_TIMEOUT_MS = 120_000; |
18 | 18 | |
19 | | -export interface RequestOptions { |
| 19 | +interface RequestOptions { |
20 | 20 | /** Request timeout override in milliseconds. */ |
21 | 21 | timeoutMs?: number; |
22 | 22 | /** Body keys to redact in debug logs (e.g. `['file_data']`). */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,15 +84,15 @@ export class UploadDailyLimitExceededError extends Error {
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** Chunked-upload progress callback payload. */ |
87 | | -export interface ChunkedUploadProgress { |
| 87 | +interface ChunkedUploadProgress { |
88 | 88 | completedParts: number; |
89 | 89 | totalParts: number; |
90 | 90 | uploadedBytes: number; |
91 | 91 | totalBytes: number; |
92 | 92 | } |
93 | 93 | |
94 | 94 | /** Per-call options for {@link ChunkedMediaApi.uploadChunked}. */ |
95 | | -export interface UploadChunkedOptions { |
| 95 | +interface UploadChunkedOptions { |
96 | 96 | scope: ChatScope; |
97 | 97 | targetId: string; |
98 | 98 | fileType: MediaFileType; |
@@ -110,7 +110,7 @@ export interface UploadChunkedOptions {
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** Configuration for the {@link ChunkedMediaApi} constructor. */ |
113 | | -export interface ChunkedMediaApiConfig { |
| 113 | +interface ChunkedMediaApiConfig { |
114 | 114 | logger?: EngineLogger; |
115 | 115 | /** Upload cache adapter (optional; omit to disable caching). */ |
116 | 116 | uploadCache?: UploadCacheAdapter; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ export interface UploadCacheAdapter {
|
42 | 42 | /** File name sanitizer — injected to avoid importing platform-specific utils. */ |
43 | 43 | export type SanitizeFileNameFn = (name: string) => string; |
44 | 44 | |
45 | | -export interface MediaApiConfig { |
| 45 | +interface MediaApiConfig { |
46 | 46 | logger?: EngineLogger; |
47 | 47 | /** Upload cache adapter (optional, omit to disable caching). */ |
48 | 48 | uploadCache?: UploadCacheAdapter; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -28,7 +28,7 @@ import {
|
28 | 28 | } from "./routes.js"; |
29 | 29 | import { TokenManager } from "./token.js"; |
30 | 30 | |
31 | | -export interface MessageApiConfig { |
| 31 | +interface MessageApiConfig { |
32 | 32 | /** Whether the QQ Bot has markdown permission. */ |
33 | 33 | markdownSupport: boolean; |
34 | 34 | /** Logger for diagnostics. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import type { EngineLogger } from "../types.js";
|
14 | 14 | import { formatErrorMessage } from "../utils/format.js"; |
15 | 15 | |
16 | 16 | /** Standard retry policy with exponential or fixed backoff. */ |
17 | | -export interface RetryPolicy { |
| 17 | +interface RetryPolicy { |
18 | 18 | /** Maximum retry attempts (excluding the initial attempt). */ |
19 | 19 | maxRetries: number; |
20 | 20 | /** Base delay in milliseconds. */ |
@@ -36,7 +36,7 @@ export interface RetryPolicy {
|
36 | 36 | * the standard retry loop into a tight fixed-interval loop bounded |
37 | 37 | * only by the total timeout. |
38 | 38 | */ |
39 | | -export interface PersistentRetryPolicy { |
| 39 | +interface PersistentRetryPolicy { |
40 | 40 | /** Total timeout in milliseconds for the persistent retry loop. */ |
41 | 41 | timeoutMs: number; |
42 | 42 | /** Fixed interval between retries in milliseconds. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,7 @@ interface CachedToken {
|
17 | 17 | appId: string; |
18 | 18 | } |
19 | 19 | |
20 | | -export interface BackgroundRefreshOptions { |
| 20 | +interface BackgroundRefreshOptions { |
21 | 21 | refreshAheadMs?: number; |
22 | 22 | randomOffsetMs?: number; |
23 | 23 | minRefreshIntervalMs?: number; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。