refactor(extensions): remove unused utility helpers · openclaw/openclaw@2f8f936
vincentkoc
·
2026-06-18
·
via Recent Commits to openclaw:main
File tree
mattermost/src/mattermost
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,19 +2,8 @@ import crypto from "node:crypto";
|
2 | 2 | import path from "node:path"; |
3 | 3 | |
4 | 4 | export const GOOGLE_GEMINI_CLI_PROVIDER_ID = "google-gemini-cli"; |
5 | | -export const GEMINI_CLI_OAUTH_CREDS_RELATIVE_PATH = ".gemini/oauth_creds.json"; |
6 | 5 | |
7 | 6 | export function resolveGeminiCliProfileHome(agentDir: string, profileId: string): string { |
8 | 7 | const profileHash = crypto.createHash("sha256").update(profileId).digest("hex").slice(0, 24); |
9 | 8 | return path.join(agentDir, `${GOOGLE_GEMINI_CLI_PROVIDER_ID}-home`, "profiles", profileHash); |
10 | 9 | } |
11 | | - |
12 | | -export function resolveGeminiCliProfileCredentialsPath( |
13 | | -agentDir: string, |
14 | | -profileId: string, |
15 | | -): string { |
16 | | -return path.join( |
17 | | -resolveGeminiCliProfileHome(agentDir, profileId), |
18 | | -GEMINI_CLI_OAUTH_CREDS_RELATIVE_PATH, |
19 | | -); |
20 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -63,10 +63,6 @@ export function normalizeIrcAllowEntry(raw: string): string {
|
63 | 63 | return value.trim(); |
64 | 64 | } |
65 | 65 | |
66 | | -export function normalizeIrcAllowlist(entries?: Array<string | number>): string[] { |
67 | | -return (entries ?? []).map((entry) => normalizeIrcAllowEntry(String(entry))).filter(Boolean); |
68 | | -} |
69 | | - |
70 | 66 | export function buildIrcAllowlistCandidates( |
71 | 67 | message: IrcInboundMessage, |
72 | 68 | params?: { allowNameMatching?: boolean }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,6 @@ import {
|
31 | 31 | buildButtonProps, |
32 | 32 | resolveInteractionCallbackUrl, |
33 | 33 | setInteractionSecret, |
34 | | -type MattermostInteractiveButtonInput, |
35 | 34 | } from "./interactions.js"; |
36 | 35 | import { loadOutboundMediaFromUrl, type OpenClawConfig } from "./runtime-api.js"; |
37 | 36 | import { isMattermostId, resolveMattermostOpaqueTarget } from "./target-resolution.js"; |
@@ -63,10 +62,6 @@ export type MattermostSendResult = {
|
63 | 62 | receipt: MessageReceipt; |
64 | 63 | }; |
65 | 64 | |
66 | | -export type MattermostReplyButtons = Array< |
67 | | -MattermostInteractiveButtonInput | MattermostInteractiveButtonInput[] |
68 | | ->; |
69 | | - |
70 | 65 | type MattermostTarget = |
71 | 66 | | { kind: "channel"; id: string } |
72 | 67 | | { kind: "channel-name"; name: string } |
@@ -435,13 +430,6 @@ async function resolveMattermostSendContext(
|
435 | 430 | }; |
436 | 431 | } |
437 | 432 | |
438 | | -export async function resolveMattermostSendChannelId( |
439 | | -to: string, |
440 | | -opts: MattermostSendOpts, |
441 | | -): Promise<string> { |
442 | | -return (await resolveMattermostSendContext(to, opts)).channelId; |
443 | | -} |
444 | | - |
445 | 433 | export async function sendMessageMattermost( |
446 | 434 | to: string, |
447 | 435 | text: string, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -145,31 +145,6 @@ export function findPendingApproval(
|
145 | 145 | return pendingApprovals[pendingApprovals.length - 1]; |
146 | 146 | } |
147 | 147 | |
148 | | -/** |
149 | | - * Check if there's already a pending approval for the same ship/channel/group combo. |
150 | | - * Used to avoid sending duplicate notifications. |
151 | | - */ |
152 | | -export function hasDuplicatePending( |
153 | | -pendingApprovals: PendingApproval[], |
154 | | -type: ApprovalType, |
155 | | -requestingShip: string, |
156 | | -channelNest?: string, |
157 | | -groupFlag?: string, |
158 | | -): boolean { |
159 | | -return pendingApprovals.some((approval) => { |
160 | | -if (approval.type !== type || approval.requestingShip !== requestingShip) { |
161 | | -return false; |
162 | | -} |
163 | | -if (type === "channel" && approval.channelNest !== channelNest) { |
164 | | -return false; |
165 | | -} |
166 | | -if (type === "group" && approval.groupFlag !== groupFlag) { |
167 | | -return false; |
168 | | -} |
169 | | -return true; |
170 | | -}); |
171 | | -} |
172 | | - |
173 | 148 | /** |
174 | 149 | * Remove a pending approval from the list by ID. |
175 | 150 | */ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。