refactor(tools): decompose skill/tools.ts into focused tool creators

This commit is contained in:
YeonGyu-Kim
2026-04-03 19:17:03 +09:00
parent 3ce1f30310
commit 3689ecd5b0
7 changed files with 336 additions and 266 deletions
+17
View File
@@ -0,0 +1,17 @@
export const SCOPE_PRIORITY: Record<string, number> = {
project: 4,
user: 3,
opencode: 2,
"opencode-project": 2,
plugin: 1,
config: 1,
builtin: 1,
}
export function sortByScopePriority<TItem extends { scope: string }>(items: TItem[]): TItem[] {
return [...items].sort((left, right) => {
const leftPriority = SCOPE_PRIORITY[left.scope] || 0
const rightPriority = SCOPE_PRIORITY[right.scope] || 0
return rightPriority - leftPriority
})
}