refactor: trim extension internal type exports · openclaw/openclaw@3b75898
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { CoreConfig } from "../../types.js"; |
2 | | -import { |
3 | | -MATRIX_ANNOTATION_RELATION_TYPE, |
4 | | -MATRIX_REACTION_EVENT_TYPE, |
5 | | -type MatrixReactionEventContent, |
6 | | -} from "../reaction-common.js"; |
| 2 | +import { MATRIX_REACTION_EVENT_TYPE } from "../reaction-common.js"; |
7 | 3 | import type { MatrixClient, MessageEventContent } from "../sdk.js"; |
8 | 4 | export type { MatrixRawEvent } from "../sdk.js"; |
9 | 5 | export type { MatrixReactionSummary } from "../reaction-common.js"; |
10 | 6 | |
11 | | -export const MsgType = { |
12 | | -Text: "m.text", |
13 | | -} as const; |
14 | | - |
15 | | -export const RelationType = { |
16 | | -Replace: "m.replace", |
17 | | -Annotation: MATRIX_ANNOTATION_RELATION_TYPE, |
18 | | -} as const; |
19 | | - |
20 | 7 | export const EventType = { |
21 | 8 | RoomMessage: "m.room.message", |
22 | 9 | RoomPinnedEvents: "m.room.pinned_events", |
@@ -35,16 +22,10 @@ export type RoomMessageEventContent = MessageEventContent & {
|
35 | 22 | }; |
36 | 23 | }; |
37 | 24 | |
38 | | -export type ReactionEventContent = MatrixReactionEventContent; |
39 | | - |
40 | 25 | export type RoomPinnedEventsEventContent = { |
41 | 26 | pinned: string[]; |
42 | 27 | }; |
43 | 28 | |
44 | | -export type RoomTopicEventContent = { |
45 | | -topic?: string; |
46 | | -}; |
47 | | - |
48 | 29 | export type MatrixActionClientOpts = { |
49 | 30 | client?: MatrixClient; |
50 | 31 | cfg?: CoreConfig; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { CoreConfig } from "../../types.js"; |
2 | | -import { |
3 | | -MATRIX_ANNOTATION_RELATION_TYPE, |
4 | | -MATRIX_REACTION_EVENT_TYPE, |
5 | | -type MatrixReactionEventContent, |
6 | | -} from "../reaction-common.js"; |
| 2 | +import { MATRIX_ANNOTATION_RELATION_TYPE, MATRIX_REACTION_EVENT_TYPE } from "../reaction-common.js"; |
7 | 3 | import type { |
8 | 4 | DimensionalFileInfo, |
9 | 5 | EncryptedFile, |
@@ -79,8 +75,6 @@ export type MatrixMediaContent = MessageEventContent &
|
79 | 75 | |
80 | 76 | export type MatrixOutboundContent = MatrixTextContent | MatrixMediaContent; |
81 | 77 | |
82 | | -export type ReactionEventContent = MatrixReactionEventContent; |
83 | | - |
84 | 78 | export type MatrixSendResult = { |
85 | 79 | messageId: string; |
86 | 80 | roomId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,7 @@ import { buildBlockedInboundContext } from "./stub-contexts.js";
|
15 | 15 | |
16 | 16 | // ─────────────────────────── Types ─────────────────────────── |
17 | 17 | |
18 | | -export interface AccessStageAllow { |
| 18 | +interface AccessStageAllow { |
19 | 19 | kind: "allow"; |
20 | 20 | isGroupChat: boolean; |
21 | 21 | peerId: string; |
@@ -25,12 +25,12 @@ export interface AccessStageAllow {
|
25 | 25 | access: QQBotAccessResult; |
26 | 26 | } |
27 | 27 | |
28 | | -export interface AccessStageBlock { |
| 28 | +interface AccessStageBlock { |
29 | 29 | kind: "block"; |
30 | 30 | context: InboundContext; |
31 | 31 | } |
32 | 32 | |
33 | | -export type AccessStageResult = AccessStageAllow | AccessStageBlock; |
| 33 | +type AccessStageResult = AccessStageAllow | AccessStageBlock; |
34 | 34 | |
35 | 35 | // ─────────────────────────── Stage ─────────────────────────── |
36 | 36 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ import type { QueuedMessage } from "../message-queue.js";
|
26 | 26 | |
27 | 27 | // ─────────────────────────── buildUserMessage ─────────────────────────── |
28 | 28 | |
29 | | -export interface BuildUserMessageInput { |
| 29 | +interface BuildUserMessageInput { |
30 | 30 | event: QueuedMessage; |
31 | 31 | userContent: string; |
32 | 32 | quotePart: string; |
@@ -69,7 +69,7 @@ export function buildUserMessage(input: BuildUserMessageInput): string {
|
69 | 69 | |
70 | 70 | // ─────────────────────────── buildAgentBody ─────────────────────────── |
71 | 71 | |
72 | | -export interface BuildAgentBodyInput { |
| 72 | +interface BuildAgentBodyInput { |
73 | 73 | event: QueuedMessage; |
74 | 74 | userContent: string; |
75 | 75 | userMessage: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ import type { QueuedMention, QueuedMessage } from "../message-queue.js";
|
18 | 18 | // ─────────────────────────── Types ─────────────────────────── |
19 | 19 | |
20 | 20 | /** Input for {@link buildUserContent}. */ |
21 | | -export interface ContentStageInput { |
| 21 | +interface ContentStageInput { |
22 | 22 | event: QueuedMessage; |
23 | 23 | /** `attachmentInfo` from the attachment stage — appended verbatim. */ |
24 | 24 | attachmentInfo: string; |
@@ -27,7 +27,7 @@ export interface ContentStageInput {
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** Output of {@link buildUserContent}. */ |
30 | | -export interface ContentStageOutput { |
| 30 | +interface ContentStageOutput { |
31 | 31 | /** `parseFaceTags(event.content)`. */ |
32 | 32 | parsedContent: string; |
33 | 33 | /** Full user-visible content (parsed + voice + attachments + mention cleanup). */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ import type { QueuedMessage } from "../message-queue.js";
|
13 | 13 | |
14 | 14 | // ─────────────────────────── Envelope body ─────────────────────────── |
15 | 15 | |
16 | | -export interface BuildBodyInput { |
| 16 | +interface BuildBodyInput { |
17 | 17 | event: QueuedMessage; |
18 | 18 | deps: InboundPipelineDeps; |
19 | 19 | userContent: string; |
@@ -49,7 +49,7 @@ export function buildQuotePart(replyTo?: ReplyToInfo): string {
|
49 | 49 | : `[Quoted message begins]\nOriginal content unavailable\n[Quoted message ends]\n`; |
50 | 50 | } |
51 | 51 | |
52 | | -export interface BuildDynamicCtxInput { |
| 52 | +interface BuildDynamicCtxInput { |
53 | 53 | imageUrls: string[]; |
54 | 54 | uniqueVoicePaths: string[]; |
55 | 55 | uniqueVoiceUrls: string[]; |
@@ -94,7 +94,7 @@ export function buildGroupSystemPrompt(
|
94 | 94 | |
95 | 95 | // ─────────────────────────── Media classification ─────────────────────────── |
96 | 96 | |
97 | | -export interface MediaClassification { |
| 97 | +interface MediaClassification { |
98 | 98 | localMediaPaths: string[]; |
99 | 99 | localMediaTypes: string[]; |
100 | 100 | remoteMediaUrls: string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,20 +27,20 @@ import { isMergedTurn, type QueuedMessage } from "../message-queue.js";
|
27 | 27 | |
28 | 28 | // ─────────────────────────── Types ─────────────────────────── |
29 | 29 | |
30 | | -export interface GroupGatePass { |
| 30 | +interface GroupGatePass { |
31 | 31 | kind: "pass"; |
32 | 32 | groupInfo: InboundGroupInfo; |
33 | 33 | } |
34 | 34 | |
35 | | -export interface GroupGateSkip { |
| 35 | +interface GroupGateSkip { |
36 | 36 | kind: "skip"; |
37 | 37 | groupInfo: InboundGroupInfo; |
38 | 38 | skipReason: NonNullable<import("../inbound-context.js").InboundContext["skipReason"]>; |
39 | 39 | } |
40 | 40 | |
41 | | -export type GroupGateStageResult = GroupGatePass | GroupGateSkip; |
| 41 | +type GroupGateStageResult = GroupGatePass | GroupGateSkip; |
42 | 42 | |
43 | | -export interface GroupGateStageInput { |
| 43 | +interface GroupGateStageInput { |
44 | 44 | event: QueuedMessage; |
45 | 45 | deps: InboundPipelineDeps; |
46 | 46 | accountId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,4 +15,4 @@ export * from "./envelope-stage.js";
|
15 | 15 | export * from "./group-gate-stage.js"; |
16 | 16 | export * from "./quote-stage.js"; |
17 | 17 | export * from "./refidx-stage.js"; |
18 | | -export * from "./stub-contexts.js"; |
| 18 | +export { buildSkippedInboundContext } from "./stub-contexts.js"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ interface BaseStubFields {
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** Build an {@link InboundContext} with all non-routing fields cleared. */ |
26 | | -export function emptyInboundContext(fields: BaseStubFields): InboundContext { |
| 26 | +function emptyInboundContext(fields: BaseStubFields): InboundContext { |
27 | 27 | return { |
28 | 28 | event: fields.event, |
29 | 29 | route: fields.route, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -139,13 +139,6 @@ export interface UploadPrepareResponse {
|
139 | 139 | retry_timeout?: number; |
140 | 140 | } |
141 | 141 | |
142 | | -/** Complete upload response. */ |
143 | | -export interface MediaUploadResponse { |
144 | | -file_uuid: string; |
145 | | -file_info: string; |
146 | | -ttl: number; |
147 | | -} |
148 | | - |
149 | 142 | /** File hash information for upload_prepare. */ |
150 | 143 | export interface UploadPrepareHashes { |
151 | 144 | /** Whole-file MD5 (hex). */ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。