11import type { SlackActionMiddlewareArgs , SlackCommandMiddlewareArgs } from "@slack/bolt" ;
22import { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pipeline" ;
3+ import type { ChatCommandDefinition } from "openclaw/plugin-sdk/command-auth" ;
34import {
5+ type CommandArgs ,
46 resolveCommandAuthorizedFromAuthorizers ,
57 resolveNativeCommandSessionTargets ,
6- listProviderPluginCommandSpecs ,
7- } from "openclaw/plugin-sdk/command-auth" ;
8- import { type ChatCommandDefinition , type CommandArgs } from "openclaw/plugin-sdk/command-auth" ;
8+ } from "openclaw/plugin-sdk/command-auth-native" ;
99import {
1010 resolveNativeCommandsEnabled ,
1111 resolveNativeSkillsEnabled ,
@@ -47,6 +47,9 @@ let slashCommandsRuntimePromise: Promise<typeof import("./slash-commands.runtime
4747 null ;
4848let slashDispatchRuntimePromise : Promise < typeof import ( "./slash-dispatch.runtime.js" ) > | null =
4949 null ;
50+ let slackPluginCommandsRuntimePromise : Promise <
51+ typeof import ( "./slash-plugin-commands.runtime.js" )
52+ > | null = null ;
5053let slashSkillCommandsRuntimePromise : Promise <
5154 typeof import ( "./slash-skill-commands.runtime.js" )
5255> | null = null ;
@@ -61,6 +64,11 @@ function loadSlashDispatchRuntime() {
6164 return slashDispatchRuntimePromise ;
6265}
6366
67+ function loadSlackPluginCommandsRuntime ( ) {
68+ slackPluginCommandsRuntimePromise ??= import ( "./slash-plugin-commands.runtime.js" ) ;
69+ return slackPluginCommandsRuntimePromise ;
70+ }
71+
6472function loadSlashSkillCommandsRuntime ( ) {
6573 slashSkillCommandsRuntimePromise ??= import ( "./slash-skill-commands.runtime.js" ) ;
6674 return slashSkillCommandsRuntimePromise ;
@@ -685,6 +693,7 @@ export async function registerSlackMonitorSlashCommands(params: {
685693 const existingNativeNames = new Set (
686694 nativeCommands . map ( ( c ) => normalizeLowercaseStringOrEmpty ( c . name ) ) . filter ( Boolean ) ,
687695 ) ;
696+ const { listProviderPluginCommandSpecs } = await loadSlackPluginCommandsRuntime ( ) ;
688697 for ( const pluginCommand of listProviderPluginCommandSpecs ( "slack" ) ) {
689698 const normalizedName = normalizeLowercaseStringOrEmpty ( pluginCommand . name ) ;
690699 if ( ! normalizedName || existingNativeNames . has ( normalizedName ) ) {
0 commit comments