mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
fix(discord): narrow binding runtime imports
This commit is contained in:
@@ -12,7 +12,7 @@ import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
||||
import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
||||
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/config-runtime";
|
||||
import type { SessionBindingRecord } from "openclaw/plugin-sdk/conversation-runtime";
|
||||
import type { SessionBindingRecord } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
||||
import { enqueueSystemEvent, recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import {
|
||||
recordPendingHistoryEntryIfEnabled,
|
||||
@@ -65,7 +65,7 @@ export type {
|
||||
const DISCORD_BOUND_THREAD_SYSTEM_PREFIXES = ["⚙️", "🤖", "🧰"];
|
||||
|
||||
let conversationRuntimePromise:
|
||||
| Promise<typeof import("openclaw/plugin-sdk/conversation-runtime")>
|
||||
| Promise<typeof import("openclaw/plugin-sdk/conversation-binding-runtime")>
|
||||
| undefined;
|
||||
let pluralkitRuntimePromise: Promise<typeof import("../pluralkit.js")> | undefined;
|
||||
let discordSendRuntimePromise: Promise<typeof import("../send.js")> | undefined;
|
||||
@@ -74,7 +74,7 @@ let systemEventsRuntimePromise: Promise<typeof import("./system-events.js")> | u
|
||||
let discordThreadingRuntimePromise: Promise<typeof import("./threading.js")> | undefined;
|
||||
|
||||
async function loadConversationRuntime() {
|
||||
conversationRuntimePromise ??= import("openclaw/plugin-sdk/conversation-runtime");
|
||||
conversationRuntimePromise ??= import("openclaw/plugin-sdk/conversation-binding-runtime");
|
||||
return await conversationRuntimePromise;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import * as conversationRuntime from "openclaw/plugin-sdk/conversation-runtime";
|
||||
import * as conversationRuntime from "openclaw/plugin-sdk/conversation-binding-runtime";
|
||||
import type { ResolvedAgentRoute } from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
resolveDiscordBoundConversationRoute,
|
||||
|
||||
@@ -231,15 +231,16 @@ function resolveDiscordGuildNativeCommandAuthorized(params: {
|
||||
configured: hasAccessRestrictions,
|
||||
allowed: memberAllowed,
|
||||
};
|
||||
const fallbackAuthorizers = [policyAuthorizer, ownerAuthorizer, memberAuthorizer];
|
||||
return resolveCommandAuthorizedFromAuthorizers({
|
||||
useAccessGroups: params.useAccessGroups,
|
||||
authorizers: params.useAccessGroups
|
||||
? params.commandsAllowFromAccess.configured
|
||||
? [commandAllowlistAuthorizer]
|
||||
: [policyAuthorizer, ownerAuthorizer, memberAuthorizer]
|
||||
: fallbackAuthorizers
|
||||
: params.commandsAllowFromAccess.configured
|
||||
? [commandAllowlistAuthorizer]
|
||||
: [memberAuthorizer],
|
||||
: fallbackAuthorizers,
|
||||
modeWhenAccessGroupsOff: "configured",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -211,6 +211,10 @@
|
||||
"types": "./dist/plugin-sdk/media-generation-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/media-generation-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/conversation-binding-runtime": {
|
||||
"types": "./dist/plugin-sdk/conversation-binding-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/conversation-binding-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/conversation-runtime": {
|
||||
"types": "./dist/plugin-sdk/conversation-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/conversation-runtime.js"
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
"ssrf-runtime",
|
||||
"media-runtime",
|
||||
"media-generation-runtime",
|
||||
"conversation-binding-runtime",
|
||||
"conversation-runtime",
|
||||
"matrix-runtime-heavy",
|
||||
"matrix-runtime-shared",
|
||||
|
||||
11
src/plugin-sdk/conversation-binding-runtime.ts
Normal file
11
src/plugin-sdk/conversation-binding-runtime.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export {
|
||||
ensureConfiguredBindingRouteReady,
|
||||
resolveConfiguredBindingRoute,
|
||||
type ConfiguredBindingRouteResult,
|
||||
} from "../channels/plugins/binding-routing.js";
|
||||
export {
|
||||
type SessionBindingRecord,
|
||||
getSessionBindingService,
|
||||
} from "../infra/outbound/session-binding-service.js";
|
||||
export { isPluginOwnedSessionBindingRecord } from "../plugins/conversation-binding.js";
|
||||
export { buildPairingReply } from "../pairing/pairing-messages.js";
|
||||
Reference in New Issue
Block a user