Extract slash command tool internals: - command-discovery.ts: command finding and listing - command-output-formatter.ts: output formatting - skill-command-converter.ts: skill-to-command conversion - slashcommand-description.ts: tool description generation - slashcommand-tool.ts: core tool definition
21 lines
621 B
TypeScript
21 lines
621 B
TypeScript
import type { LoadedSkill } from "../../features/opencode-skill-loader"
|
|
import type { CommandInfo } from "./types"
|
|
|
|
export function skillToCommandInfo(skill: LoadedSkill): CommandInfo {
|
|
return {
|
|
name: skill.name,
|
|
path: skill.path,
|
|
metadata: {
|
|
name: skill.name,
|
|
description: skill.definition.description || "",
|
|
argumentHint: skill.definition.argumentHint,
|
|
model: skill.definition.model,
|
|
agent: skill.definition.agent,
|
|
subtask: skill.definition.subtask,
|
|
},
|
|
content: skill.definition.template,
|
|
scope: skill.scope,
|
|
lazyContentLoader: skill.lazyContent,
|
|
}
|
|
}
|