fix(ci): restore plugin runtime boundaries
parent
f9b8499bf6
commit
87dddb818d
@ -1 +1,56 @@
|
||||
export * from "openclaw/plugin-sdk/bluebubbles";
|
||||
export { resolveAckReaction } from "../../../src/agents/identity.js";
|
||||
export {
|
||||
createActionGate,
|
||||
jsonResult,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "../../../src/agents/tools/common.js";
|
||||
export type { HistoryEntry } from "../../../src/auto-reply/reply/history.js";
|
||||
export {
|
||||
evictOldHistoryKeys,
|
||||
recordPendingHistoryEntryIfEnabled,
|
||||
} from "../../../src/auto-reply/reply/history.js";
|
||||
export { resolveControlCommandGate } from "../../../src/channels/command-gating.js";
|
||||
export { logAckFailure, logInboundDrop, logTypingFailure } from "../../../src/channels/logging.js";
|
||||
export {
|
||||
BLUEBUBBLES_ACTION_NAMES,
|
||||
BLUEBUBBLES_ACTIONS,
|
||||
} from "../../../src/channels/plugins/bluebubbles-actions.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../../../src/channels/plugins/media-limits.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../../../src/channels/plugins/pairing-message.js";
|
||||
export { collectBlueBubblesStatusIssues } from "../../../src/channels/plugins/status-issues/bluebubbles.js";
|
||||
export type {
|
||||
BaseProbeResult,
|
||||
ChannelAccountSnapshot,
|
||||
ChannelMessageActionAdapter,
|
||||
ChannelMessageActionName,
|
||||
} from "../../../src/channels/plugins/types.js";
|
||||
export type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
||||
export type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
export { parseFiniteNumber } from "../../../src/infra/parse-finite-number.js";
|
||||
export type { PluginRuntime } from "../../../src/plugins/runtime/types.js";
|
||||
export { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
export {
|
||||
DM_GROUP_ACCESS_REASON,
|
||||
readStoreAllowFromForDmPolicy,
|
||||
resolveDmGroupAccessWithLists,
|
||||
} from "../../../src/security/dm-policy-shared.js";
|
||||
export { readBooleanParam } from "../../../src/plugin-sdk/boolean-param.js";
|
||||
export { mapAllowFromEntries } from "../../../src/plugin-sdk/channel-config-helpers.js";
|
||||
export { createChannelPairingController } from "../../../src/plugin-sdk/channel-pairing.js";
|
||||
export { createChannelReplyPipeline } from "../../../src/plugin-sdk/channel-reply-pipeline.js";
|
||||
export { resolveRequestUrl } from "../../../src/plugin-sdk/request-url.js";
|
||||
export { buildProbeChannelStatusSummary } from "../../../src/plugin-sdk/status-helpers.js";
|
||||
export { stripMarkdown } from "../../../src/plugin-sdk/text-runtime.js";
|
||||
export { extractToolSend } from "../../../src/plugin-sdk/tool-send.js";
|
||||
export {
|
||||
WEBHOOK_RATE_LIMIT_DEFAULTS,
|
||||
createFixedWindowRateLimiter,
|
||||
createWebhookInFlightLimiter,
|
||||
readWebhookBodyOrReject,
|
||||
registerWebhookTargetWithPluginRoute,
|
||||
resolveRequestClientIp,
|
||||
resolveWebhookTargetWithAuthOrRejectSync,
|
||||
withResolvedWebhookRequestPipeline,
|
||||
} from "../../../src/plugin-sdk/webhook-ingress.js";
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export * from "./probe.js";
|
||||
@ -0,0 +1,67 @@
|
||||
export function normalizeSignalMessagingTarget(raw: string): string | undefined {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed) {
|
||||
return undefined;
|
||||
}
|
||||
let normalized = trimmed;
|
||||
if (normalized.toLowerCase().startsWith("signal:")) {
|
||||
normalized = normalized.slice("signal:".length).trim();
|
||||
}
|
||||
if (!normalized) {
|
||||
return undefined;
|
||||
}
|
||||
const lower = normalized.toLowerCase();
|
||||
if (lower.startsWith("group:")) {
|
||||
const id = normalized.slice("group:".length).trim();
|
||||
return id ? `group:${id}` : undefined;
|
||||
}
|
||||
if (lower.startsWith("username:")) {
|
||||
const id = normalized.slice("username:".length).trim();
|
||||
return id ? `username:${id}`.toLowerCase() : undefined;
|
||||
}
|
||||
if (lower.startsWith("u:")) {
|
||||
const id = normalized.slice("u:".length).trim();
|
||||
return id ? `username:${id}`.toLowerCase() : undefined;
|
||||
}
|
||||
if (lower.startsWith("uuid:")) {
|
||||
const id = normalized.slice("uuid:".length).trim();
|
||||
return id ? id.toLowerCase() : undefined;
|
||||
}
|
||||
return normalized.toLowerCase();
|
||||
}
|
||||
|
||||
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
||||
const UUID_COMPACT_PATTERN = /^[0-9a-f]{32}$/i;
|
||||
|
||||
export function looksLikeSignalTargetId(raw: string, normalized?: string): boolean {
|
||||
const candidates = [raw, normalized ?? ""].map((value) => value.trim()).filter(Boolean);
|
||||
|
||||
for (const candidate of candidates) {
|
||||
if (/^(signal:)?(group:|username:|u:)/i.test(candidate)) {
|
||||
return true;
|
||||
}
|
||||
if (/^(signal:)?uuid:/i.test(candidate)) {
|
||||
const stripped = candidate
|
||||
.replace(/^signal:/i, "")
|
||||
.replace(/^uuid:/i, "")
|
||||
.trim();
|
||||
if (!stripped) {
|
||||
continue;
|
||||
}
|
||||
if (UUID_PATTERN.test(stripped) || UUID_COMPACT_PATTERN.test(stripped)) {
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
const withoutSignalPrefix = candidate.replace(/^signal:/i, "").trim();
|
||||
if (UUID_PATTERN.test(withoutSignalPrefix) || UUID_COMPACT_PATTERN.test(withoutSignalPrefix)) {
|
||||
return true;
|
||||
}
|
||||
if (/^\+?\d{3,}$/.test(withoutSignalPrefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Loading…
Reference in New Issue