mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 04:12:44 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { resolveAgentConfig } from "../../agents/agent-scope.js";
|
||||
import { getChannelDock } from "../../channels/dock.js";
|
||||
import { normalizeChannelId } from "../../channels/plugins/index.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
|
||||
function escapeRegExp(text: string): string {
|
||||
@@ -36,7 +36,7 @@ function normalizeMentionPatterns(patterns: string[]): string[] {
|
||||
return patterns.map(normalizeMentionPattern);
|
||||
}
|
||||
|
||||
function resolveMentionPatterns(cfg: MoltbotConfig | undefined, agentId?: string): string[] {
|
||||
function resolveMentionPatterns(cfg: OpenClawConfig | undefined, agentId?: string): string[] {
|
||||
if (!cfg) return [];
|
||||
const agentConfig = agentId ? resolveAgentConfig(cfg, agentId) : undefined;
|
||||
const agentGroupChat = agentConfig?.groupChat;
|
||||
@@ -51,7 +51,7 @@ function resolveMentionPatterns(cfg: MoltbotConfig | undefined, agentId?: string
|
||||
return derived.length > 0 ? derived : [];
|
||||
}
|
||||
|
||||
export function buildMentionRegexes(cfg: MoltbotConfig | undefined, agentId?: string): RegExp[] {
|
||||
export function buildMentionRegexes(cfg: OpenClawConfig | undefined, agentId?: string): RegExp[] {
|
||||
const patterns = normalizeMentionPatterns(resolveMentionPatterns(cfg, agentId));
|
||||
return patterns
|
||||
.map((pattern) => {
|
||||
@@ -115,7 +115,7 @@ export function stripStructuralPrefixes(text: string): string {
|
||||
export function stripMentions(
|
||||
text: string,
|
||||
ctx: MsgContext,
|
||||
cfg: MoltbotConfig | undefined,
|
||||
cfg: OpenClawConfig | undefined,
|
||||
agentId?: string,
|
||||
): string {
|
||||
let result = text;
|
||||
|
||||
Reference in New Issue
Block a user