@@ -53,6 +53,7 @@ import {
5353 type PluginManifestToolMetadata ,
5454 type PluginPackageChannel ,
5555 type PluginPackageInstall ,
56+ normalizeManifestChannelCommandDefaults ,
5657} from "./manifest.js" ;
5758import { checkMinHostVersion } from "./min-host-version.js" ;
5859import {
@@ -295,29 +296,6 @@ function normalizePreferredPluginIds(raw: unknown): string[] | undefined {
295296 return normalizeOptionalTrimmedStringList ( raw ) ;
296297}
297298
298- function normalizePackageChannelCommands (
299- commands : unknown ,
300- ) : PluginManifestChannelCommandDefaults | undefined {
301- if ( ! commands || typeof commands !== "object" || Array . isArray ( commands ) ) {
302- return undefined ;
303- }
304- const record = commands as Record < string , unknown > ;
305- const nativeCommandsAutoEnabled =
306- typeof record . nativeCommandsAutoEnabled === "boolean"
307- ? record . nativeCommandsAutoEnabled
308- : undefined ;
309- const nativeSkillsAutoEnabled =
310- typeof record . nativeSkillsAutoEnabled === "boolean"
311- ? record . nativeSkillsAutoEnabled
312- : undefined ;
313- return nativeCommandsAutoEnabled !== undefined || nativeSkillsAutoEnabled !== undefined
314- ? {
315- ...( nativeCommandsAutoEnabled !== undefined ? { nativeCommandsAutoEnabled } : { } ) ,
316- ...( nativeSkillsAutoEnabled !== undefined ? { nativeSkillsAutoEnabled } : { } ) ,
317- }
318- : undefined ;
319- }
320-
321299function mergePackageChannelMetaIntoChannelConfigs ( params : {
322300 channelConfigs ?: Record < string , PluginManifestChannelConfig > ;
323301 packageChannel ?: OpenClawPackageManifest [ "channel" ] ;
@@ -342,7 +320,7 @@ function mergePackageChannelMetaIntoChannelConfigs(params: {
342320 const preferOver =
343321 existing . preferOver ?? normalizePreferredPluginIds ( params . packageChannel ?. preferOver ) ;
344322 const commands =
345- existing . commands ?? normalizePackageChannelCommands ( params . packageChannel ?. commands ) ;
323+ existing . commands ?? normalizeManifestChannelCommandDefaults ( params . packageChannel ?. commands ) ;
346324
347325 const merged : Record < string , PluginManifestChannelConfig > = Object . create ( null ) ;
348326 for ( const [ key , value ] of Object . entries ( params . channelConfigs ) ) {
@@ -501,7 +479,7 @@ function buildRecord(params: {
501479 } ) ,
502480 packageChannel : params . candidate . packageManifest ?. channel ,
503481 } ) ;
504- const packageChannelCommands = normalizePackageChannelCommands (
482+ const packageChannelCommands = normalizeManifestChannelCommandDefaults (
505483 params . candidate . packageManifest ?. channel ?. commands ,
506484 ) ;
507485 return {
0 commit comments