Skip to content

Commit 3d20614

Browse files
authored
refactor: localize internal implementation constants (#101758)
1 parent d633a2d commit 3d20614

54 files changed

Lines changed: 76 additions & 84 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extensions/clickclack/src/activity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { buildChannelProgressDraftLine } from "openclaw/plugin-sdk/channel-outbo
1919
import type { ClickClackMessage, ClickClackMessageProvenance } from "./types.js";
2020

2121
/** Debounce window for PATCHing streaming commentary snapshots. */
22-
export const CLICKCLACK_COMMENTARY_FLUSH_MS = 700;
22+
const CLICKCLACK_COMMENTARY_FLUSH_MS = 700;
2323

2424
/** Item event payload shape delivered by `replyOptions.onItemEvent`. */
2525
export type ClickClackItemEventPayload = {

extensions/discord/src/monitor/reply-typing-feedback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createDiscordRestClient } from "../client.js";
66
import type { RequestClient } from "../internal/discord.js";
77
import { sendTyping } from "./typing.js";
88

9-
export const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 20 * 60_000;
9+
const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 20 * 60_000;
1010

1111
// Discord can keep long tool-heavy replies alive, but not forever.
1212
// The dispatch restart path refreshes this TTL after queue wait time.

extensions/discord/src/monitor/thread-bindings.state.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ const THREAD_BINDINGS_STATE = resolveThreadBindingsGlobalState();
7575

7676
export const MANAGERS_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.managersByAccountId;
7777
export const BINDINGS_BY_THREAD_ID = THREAD_BINDINGS_STATE.bindingsByThreadId;
78-
export const BINDINGS_BY_SESSION_KEY = THREAD_BINDINGS_STATE.bindingsBySessionKey;
79-
export const TOKENS_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.tokensByAccountId;
80-
export const RECENT_UNBOUND_WEBHOOK_ECHOES_BY_BINDING_KEY =
78+
const BINDINGS_BY_SESSION_KEY = THREAD_BINDINGS_STATE.bindingsBySessionKey;
79+
const TOKENS_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.tokensByAccountId;
80+
const RECENT_UNBOUND_WEBHOOK_ECHOES_BY_BINDING_KEY =
8181
THREAD_BINDINGS_STATE.recentUnboundWebhookEchoesByBindingKey;
8282
export const REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL =
8383
THREAD_BINDINGS_STATE.reusableWebhooksByAccountChannel;

extensions/discord/src/voice/ingress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { authorizeDiscordVoiceIngress } from "./access.js";
1111
import type { VoiceSessionEntry } from "./session.js";
1212
import type { DiscordVoiceSpeakerContextResolver } from "./speaker-context.js";
1313

14-
export const DISCORD_VOICE_MESSAGE_PROVIDER = "discord-voice";
14+
const DISCORD_VOICE_MESSAGE_PROVIDER = "discord-voice";
1515

1616
const logger = createSubsystemLogger("discord/voice");
1717

extensions/google-meet/src/realtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export function getGoogleMeetRealtimeTranscriptHealth(
127127
export type GoogleMeetRealtimeEventEntry = RealtimeVoiceBridgeEventLogEntry;
128128

129129
export const GOOGLE_MEET_AGENT_TRANSCRIPT_DEBOUNCE_MS = 900;
130-
export const GOOGLE_MEET_OUTPUT_ECHO_SUPPRESSION_TAIL_MS = 3_000;
131-
export const GOOGLE_MEET_TRANSCRIPT_ECHO_LOOKBACK_MS = 45_000;
130+
const GOOGLE_MEET_OUTPUT_ECHO_SUPPRESSION_TAIL_MS = 3_000;
131+
const GOOGLE_MEET_TRANSCRIPT_ECHO_LOOKBACK_MS = 45_000;
132132

133133
export function recordGoogleMeetRealtimeEvent(
134134
events: GoogleMeetRealtimeEventEntry[],

extensions/imessage/src/monitor/inbound-dedupe.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import { createHash } from "node:crypto";
1414
import { createClaimableDedupe, type ClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
1515
import type { IMessagePayload } from "./types.js";
1616

17-
export const IMESSAGE_INBOUND_DEDUPE_PLUGIN_ID = "imessage";
18-
export const IMESSAGE_INBOUND_DEDUPE_NAMESPACE_PREFIX = "imessage.inbound-dedupe";
17+
const IMESSAGE_INBOUND_DEDUPE_PLUGIN_ID = "imessage";
18+
const IMESSAGE_INBOUND_DEDUPE_NAMESPACE_PREFIX = "imessage.inbound-dedupe";
1919
// 4h recency window: long enough to absorb a reconnect/restart burst that
2020
// re-emits recently dispatched rows, short enough that a genuinely-new message
2121
// reusing a stale composite key after hours is not wrongly suppressed.
2222
export const IMESSAGE_INBOUND_DEDUPE_TTL_MS = 4 * 60 * 60 * 1000;
23-
export const IMESSAGE_INBOUND_DEDUPE_MEMORY_MAX = 5_000;
24-
export const IMESSAGE_INBOUND_DEDUPE_STATE_MAX_ENTRIES = 10_000;
23+
const IMESSAGE_INBOUND_DEDUPE_MEMORY_MAX = 5_000;
24+
const IMESSAGE_INBOUND_DEDUPE_STATE_MAX_ENTRIES = 10_000;
2525

2626
// Drop a LIVE inbound row whose send date is older than this relative to
2727
// arrival. Stale backlog Apple flushes after a Push recovery carries old send

extensions/line/src/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
44

55
export type Action = messagingApi.Action;
66
export const LINE_ACTION_LABEL_LIMIT = 20;
7-
export const LINE_ACTION_DATA_LIMIT = 300;
7+
const LINE_ACTION_DATA_LIMIT = 300;
88

99
export function truncateLineActionLabel(label: string, limit = LINE_ACTION_LABEL_LIMIT): string {
1010
return truncateUtf16Safe(label, limit);

extensions/logbook/src/analyze.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { LogbookCard, LogbookCardDraft, LogbookDistraction } from "./types.
77
/** Cards within this window before a batch are treated as a revisable draft. */
88
export const CARD_LOOKBACK_MS = 45 * 60 * 1000;
99
/** Frame gap that splits one analysis window into separate batches. */
10-
export const BATCH_MAX_GAP_MS = 2 * 60 * 1000;
10+
const BATCH_MAX_GAP_MS = 2 * 60 * 1000;
1111
/** Upper bound of images sent to the vision model per batch. */
1212
export const MAX_FRAMES_PER_CALL = 16;
1313

@@ -243,7 +243,7 @@ export function parseCardsJson(params: {
243243
}
244244

245245
/** Sub-minute slack so minute-rounded model times do not fail coverage checks. */
246-
export const COVERAGE_TOLERANCE_MS = 2 * 60 * 1000;
246+
const COVERAGE_TOLERANCE_MS = 2 * 60 * 1000;
247247

248248
function formatClockForError(ms: number): string {
249249
const date = new Date(ms);

extensions/logbook/src/prompts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// timeline cards) adapted from the approach popularized by Dayflow (MIT).
33
import type { LogbookCard, LogbookObservation } from "./types.js";
44

5-
export const CARD_MIN_MINUTES = 10;
6-
export const CARD_MAX_MINUTES = 60;
5+
const CARD_MIN_MINUTES = 10;
6+
const CARD_MAX_MINUTES = 60;
77
export const CARD_CATEGORIES = [
88
"coding",
99
"review",

extensions/matrix/src/matrix/profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from "openclaw/plugin-sdk/string-coerce-runtime";
66
import type { MatrixClient } from "./sdk.js";
77

8-
export const MATRIX_PROFILE_AVATAR_MAX_BYTES = 10 * 1024 * 1024;
8+
const MATRIX_PROFILE_AVATAR_MAX_BYTES = 10 * 1024 * 1024;
99

1010
type MatrixProfileClient = Pick<
1111
MatrixClient,

0 commit comments

Comments
 (0)