diff --git a/src/features/builtin-commands/commands.ts b/src/features/builtin-commands/commands.ts index d183a2f..c8f5d54 100644 --- a/src/features/builtin-commands/commands.ts +++ b/src/features/builtin-commands/commands.ts @@ -42,10 +42,8 @@ export function loadBuiltinCommands( for (const [name, definition] of Object.entries(BUILTIN_COMMAND_DEFINITIONS)) { if (!disabled.has(name as BuiltinCommandName)) { - commands[name] = { - name, - ...definition, - } + const { argumentHint: _argumentHint, ...openCodeCompatible } = definition + commands[name] = openCodeCompatible as CommandDefinition } } diff --git a/src/features/claude-code-command-loader/loader.ts b/src/features/claude-code-command-loader/loader.ts index 82e0076..32223cb 100644 --- a/src/features/claude-code-command-loader/loader.ts +++ b/src/features/claude-code-command-loader/loader.ts @@ -62,7 +62,8 @@ $ARGUMENTS function commandsToRecord(commands: LoadedCommand[]): Record { const result: Record = {} for (const cmd of commands) { - result[cmd.name] = cmd.definition + const { name: _name, argumentHint: _argumentHint, ...openCodeCompatible } = cmd.definition + result[cmd.name] = openCodeCompatible as CommandDefinition } return result } diff --git a/src/features/claude-code-plugin-loader/loader.ts b/src/features/claude-code-plugin-loader/loader.ts index 9042ac1..7b4aeed 100644 --- a/src/features/claude-code-plugin-loader/loader.ts +++ b/src/features/claude-code-plugin-loader/loader.ts @@ -246,7 +246,7 @@ $ARGUMENTS const formattedDescription = `(plugin: ${plugin.name}) ${data.description || ""}` - commands[namespacedName] = { + const definition = { name: namespacedName, description: formattedDescription, template: wrappedTemplate, @@ -255,6 +255,8 @@ $ARGUMENTS subtask: data.subtask, argumentHint: data["argument-hint"], } + const { name: _name, argumentHint: _argumentHint, ...openCodeCompatible } = definition + commands[namespacedName] = openCodeCompatible as CommandDefinition log(`Loaded plugin command: ${namespacedName}`, { path: commandPath }) } catch (error) { @@ -306,12 +308,14 @@ ${body.trim()} $ARGUMENTS ` - skills[namespacedName] = { + const definition = { name: namespacedName, description: formattedDescription, template: wrappedTemplate, model: sanitizeModelField(data.model), } + const { name: _name, ...openCodeCompatible } = definition + skills[namespacedName] = openCodeCompatible as CommandDefinition log(`Loaded plugin skill: ${namespacedName}`, { path: resolvedPath }) } catch (error) { diff --git a/src/features/opencode-skill-loader/loader.ts b/src/features/opencode-skill-loader/loader.ts index 32ffad4..5f48898 100644 --- a/src/features/opencode-skill-loader/loader.ts +++ b/src/features/opencode-skill-loader/loader.ts @@ -126,7 +126,8 @@ function loadSkillsFromDir(skillsDir: string, scope: SkillScope): LoadedSkill[] function skillsToRecord(skills: LoadedSkill[]): Record { const result: Record = {} for (const skill of skills) { - result[skill.name] = skill.definition + const { name: _name, argumentHint: _argumentHint, ...openCodeCompatible } = skill.definition + result[skill.name] = openCodeCompatible as CommandDefinition } return result }