refactor: trim qqbot helper exports · openclaw/openclaw@a607661
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,19 +29,6 @@
|
29 | 29 | |
30 | 30 | import type { FetchMediaOptions, FetchMediaResult, SecretInputRef } from "./types.js"; |
31 | 31 | |
32 | | -// ============ Re-exports (port interfaces) ============ |
33 | | - |
34 | | -export type { HistoryPort, HistoryEntryLike } from "./history.port.js"; |
35 | | -export type { |
36 | | -MentionGatePort, |
37 | | -MentionFacts, |
38 | | -MentionPolicy, |
39 | | -MentionGateDecision, |
40 | | -ImplicitMentionKind, |
41 | | -} from "./mention-gate.port.js"; |
42 | | -export type { AudioConvertPort, OutboundAudioPort } from "./audio.port.js"; |
43 | | -export type { CommandsPort, ApproveRuntimeGetter } from "./commands.port.js"; |
44 | | - |
45 | 32 | // ============ EngineAdapters (aggregated port injection) ============ |
46 | 33 | |
47 | 34 | /** |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,11 +8,7 @@
|
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Implicit mention kind aligned with SDK's `InboundImplicitMentionKind`. */ |
11 | | -export type ImplicitMentionKind = |
12 | | -| "reply_to_bot" |
13 | | -| "quoted_bot" |
14 | | -| "bot_thread_participant" |
15 | | -| "native"; |
| 11 | +type ImplicitMentionKind = "reply_to_bot" | "quoted_bot" | "bot_thread_participant" | "native"; |
16 | 12 | |
17 | 13 | /** Facts about the current message's mention state. */ |
18 | 14 | export interface MentionFacts { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,14 +42,14 @@ export interface PluginApprovalRequest {
|
42 | 42 | }; |
43 | 43 | } |
44 | 44 | |
45 | | -export type ApprovalDecision = "allow-once" | "allow-always" | "deny"; |
| 45 | +type ApprovalDecision = "allow-once" | "allow-always" | "deny"; |
46 | 46 | |
47 | | -export interface ApprovalTarget { |
| 47 | +interface ApprovalTarget { |
48 | 48 | type: ChatScope; |
49 | 49 | id: string; |
50 | 50 | } |
51 | 51 | |
52 | | -export interface ParsedApprovalAction { |
| 52 | +interface ParsedApprovalAction { |
53 | 53 | approvalId: string; |
54 | 54 | decision: ApprovalDecision; |
55 | 55 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -81,7 +81,7 @@ const CLEAR_STORAGE_MAX_DISPLAY = 10;
|
81 | 81 | * under `~/.openclaw/media/qqbot/downloads/` without appId subdivision. |
82 | 82 | * The clear-storage command therefore cleans the entire downloads root. |
83 | 83 | */ |
84 | | -export function resolveQqbotDownloadsDir(): string { |
| 84 | +function resolveQqbotDownloadsDir(): string { |
85 | 85 | return getQQBotMediaPath("downloads"); |
86 | 86 | } |
87 | 87 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,14 +31,6 @@ export function initCommands(port: CommandsPort): void {
|
31 | 31 | initSlashCommandDeps(port); |
32 | 32 | } |
33 | 33 | |
34 | | -export type { |
35 | | -SlashCommandContext, |
36 | | -SlashCommandResult, |
37 | | -SlashCommandFileResult, |
38 | | -QQBotFrameworkCommand, |
39 | | -QueueSnapshot, |
40 | | -} from "./slash-commands.js"; |
41 | | - |
42 | 34 | /** |
43 | 35 | * Return all commands that require authorization, for registration with the |
44 | 36 | * framework via api.registerCommand() in registerFull(). |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,14 +58,14 @@ export interface QueueSnapshot {
|
58 | 58 | export type SlashCommandResult = string | SlashCommandFileResult | null; |
59 | 59 | |
60 | 60 | /** Slash command result that sends text first and then a local file. */ |
61 | | -export interface SlashCommandFileResult { |
| 61 | +interface SlashCommandFileResult { |
62 | 62 | text: string; |
63 | 63 | /** Local file path to send. */ |
64 | 64 | filePath: string; |
65 | 65 | } |
66 | 66 | |
67 | 67 | /** Slash command definition. */ |
68 | | -export interface SlashCommand { |
| 68 | +interface SlashCommand { |
69 | 69 | /** Command name without the leading slash. */ |
70 | 70 | name: string; |
71 | 71 | /** Short description. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ import type {
|
20 | 20 | |
21 | 21 | // ============ Dispatch result ============ |
22 | 22 | |
23 | | -export type DispatchResult = |
| 23 | +type DispatchResult = |
24 | 24 | | { action: "ready"; data: unknown; sessionId: string } |
25 | 25 | | { action: "resumed"; data: unknown } |
26 | 26 | | { action: "message"; msg: QueuedMessage } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,7 @@ import type { GatewayAccount, EngineLogger, GatewayPluginRuntime, WSPayload } fr
|
31 | 31 | |
32 | 32 | // ============ Connection context ============ |
33 | 33 | |
34 | | -export interface GatewayConnectionContext { |
| 34 | +interface GatewayConnectionContext { |
35 | 35 | account: GatewayAccount; |
36 | 36 | abortSignal: AbortSignal; |
37 | 37 | cfg: unknown; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,7 @@ export interface QueuedMention {
|
53 | 53 | * representative turn, the merge information lands here instead of |
54 | 54 | * being scattered across `_` -prefixed fields on {@link QueuedMessage}. |
55 | 55 | */ |
56 | | -export interface QueuedMergeInfo { |
| 56 | +interface QueuedMergeInfo { |
57 | 57 | /** Number of original messages folded in. Always >= 2. */ |
58 | 58 | count: number; |
59 | 59 | /** Original messages in insertion order — `messages.at(-1)` is "current". */ |
@@ -129,7 +129,7 @@ export function isMergedTurn(msg: QueuedMessage): msg is QueuedMessage & {
|
129 | 129 | return (msg.merge?.count ?? 0) > 1; |
130 | 130 | } |
131 | 131 | |
132 | | -export interface MessageQueueContext { |
| 132 | +interface MessageQueueContext { |
133 | 133 | accountId: string; |
134 | 134 | log?: { |
135 | 135 | info: (msg: string, meta?: Record<string, unknown>) => void; |
@@ -149,14 +149,14 @@ export interface MessageQueueContext {
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** Snapshot of the queue state for diagnostics. */ |
152 | | -export interface QueueSnapshot { |
| 152 | +interface QueueSnapshot { |
153 | 153 | totalPending: number; |
154 | 154 | activeUsers: number; |
155 | 155 | maxConcurrentUsers: number; |
156 | 156 | senderPending: number; |
157 | 157 | } |
158 | 158 | |
159 | | -export interface MessageQueue { |
| 159 | +interface MessageQueue { |
160 | 160 | enqueue: (msg: QueuedMessage) => void; |
161 | 161 | startProcessor: (handleMessageFn: (msg: QueuedMessage) => Promise<void>) => void; |
162 | 162 | getSnapshot: (senderPeerId: string) => QueueSnapshot; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -49,7 +49,7 @@ const TOOL_MEDIA_SEND_TIMEOUT = 45_000;
|
49 | 49 | |
50 | 50 | // ============ Dependencies ============ |
51 | 51 | |
52 | | -export interface OutboundDispatchDeps { |
| 52 | +interface OutboundDispatchDeps { |
53 | 53 | runtime: GatewayPluginRuntime; |
54 | 54 | cfg: unknown; |
55 | 55 | account: GatewayAccount; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。