@@ -9,6 +9,7 @@ import { fileURLToPath } from "node:url";
99const require = createRequire ( import . meta. url ) ;
1010const { createJiti } = require ( "jiti" ) ;
1111
12+ const OPENCLAW_PLUGIN_SDK_PREFIX = [ "openclaw" , "plugin-sdk" ] . join ( "/" ) ;
1213const PLUGIN_SDK_EXPORT_PREFIX = "./plugin-sdk/" ;
1314const PLUGIN_SDK_SOURCE_EXTENSIONS = [ ".ts" , ".mts" , ".js" , ".mjs" , ".cts" , ".cjs" ] ;
1415const JITI_EXTENSIONS = [
@@ -72,7 +73,7 @@ function buildPluginSdkAliasMap(moduleUrl) {
7273 resolveExistingFile ( path . join ( sourcePluginSdkDir , "root-alias" ) , [ ".cjs" ] ) ??
7374 resolveExistingFile ( path . join ( distPluginSdkDir , "root-alias" ) , [ ".cjs" ] ) ;
7475 if ( rootAlias ) {
75- aliasMap [ "openclaw/plugin-sdk" ] = rootAlias ;
76+ aliasMap [ OPENCLAW_PLUGIN_SDK_PREFIX ] = rootAlias ;
7677 }
7778
7879 for ( const exportKey of Object . keys ( packageJson . exports ?? { } ) ) {
@@ -87,7 +88,7 @@ function buildPluginSdkAliasMap(moduleUrl) {
8788 resolveExistingFile ( path . join ( sourcePluginSdkDir , subpath ) , PLUGIN_SDK_SOURCE_EXTENSIONS ) ??
8889 resolveExistingFile ( path . join ( distPluginSdkDir , subpath ) , [ ".js" ] ) ;
8990 if ( resolvedPath ) {
90- aliasMap [ `openclaw/plugin-sdk /${ subpath } ` ] = resolvedPath ;
91+ aliasMap [ `${ OPENCLAW_PLUGIN_SDK_PREFIX } /${ subpath } ` ] = resolvedPath ;
9192 }
9293 }
9394
0 commit comments