mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 16:24:58 +00:00
fix(ui): fix web UI after tsdown migration and typing changes
This commit is contained in:
24
src/agents/skills/bundled-context.ts
Normal file
24
src/agents/skills/bundled-context.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
|
||||
import { resolveBundledSkillsDir, type BundledSkillsResolveOptions } from "./bundled-dir.js";
|
||||
|
||||
export type BundledSkillsContext = {
|
||||
dir?: string;
|
||||
names: Set<string>;
|
||||
};
|
||||
|
||||
export function resolveBundledSkillsContext(
|
||||
opts: BundledSkillsResolveOptions = {},
|
||||
): BundledSkillsContext {
|
||||
const dir = resolveBundledSkillsDir(opts);
|
||||
const names = new Set<string>();
|
||||
if (!dir) {
|
||||
return { dir, names };
|
||||
}
|
||||
const result = loadSkillsFromDir({ dir, source: "openclaw-bundled" });
|
||||
for (const skill of result.skills) {
|
||||
if (skill.name.trim()) {
|
||||
names.add(skill.name);
|
||||
}
|
||||
}
|
||||
return { dir, names };
|
||||
}
|
||||
Reference in New Issue
Block a user