refactor(slashcommand): split tools.ts into discovery and formatting modules
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
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user