mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 22:24:32 +00:00
fix(ui): fix web UI after tsdown migration and typing changes
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
type SkillInstallSpec,
|
||||
type SkillsInstallPreferences,
|
||||
} from "./skills.js";
|
||||
import { resolveBundledSkillsContext } from "./skills/bundled-context.js";
|
||||
|
||||
export type SkillStatusConfigCheck = {
|
||||
path: string;
|
||||
@@ -33,6 +34,7 @@ export type SkillStatusEntry = {
|
||||
name: string;
|
||||
description: string;
|
||||
source: string;
|
||||
bundled: boolean;
|
||||
filePath: string;
|
||||
baseDir: string;
|
||||
skillKey: string;
|
||||
@@ -167,6 +169,7 @@ function buildSkillStatus(
|
||||
config?: OpenClawConfig,
|
||||
prefs?: SkillsInstallPreferences,
|
||||
eligibility?: SkillEligibilityContext,
|
||||
bundledNames?: Set<string>,
|
||||
): SkillStatusEntry {
|
||||
const skillKey = resolveSkillKey(entry);
|
||||
const skillConfig = resolveSkillConfig(config, skillKey);
|
||||
@@ -181,6 +184,10 @@ function buildSkillStatus(
|
||||
entry.frontmatter.website ??
|
||||
entry.frontmatter.url;
|
||||
const homepage = homepageRaw?.trim() ? homepageRaw.trim() : undefined;
|
||||
const bundled =
|
||||
bundledNames && bundledNames.size > 0
|
||||
? bundledNames.has(entry.skill.name)
|
||||
: entry.skill.source === "openclaw-bundled";
|
||||
|
||||
const requiredBins = entry.metadata?.requires?.bins ?? [];
|
||||
const requiredAnyBins = entry.metadata?.requires?.anyBins ?? [];
|
||||
@@ -256,6 +263,7 @@ function buildSkillStatus(
|
||||
name: entry.skill.name,
|
||||
description: entry.skill.description,
|
||||
source: entry.skill.source,
|
||||
bundled,
|
||||
filePath: entry.skill.filePath,
|
||||
baseDir: entry.skill.baseDir,
|
||||
skillKey,
|
||||
@@ -289,13 +297,20 @@ export function buildWorkspaceSkillStatus(
|
||||
},
|
||||
): SkillStatusReport {
|
||||
const managedSkillsDir = opts?.managedSkillsDir ?? path.join(CONFIG_DIR, "skills");
|
||||
const skillEntries = opts?.entries ?? loadWorkspaceSkillEntries(workspaceDir, opts);
|
||||
const bundledContext = resolveBundledSkillsContext();
|
||||
const skillEntries =
|
||||
opts?.entries ??
|
||||
loadWorkspaceSkillEntries(workspaceDir, {
|
||||
config: opts?.config,
|
||||
managedSkillsDir,
|
||||
bundledSkillsDir: bundledContext.dir,
|
||||
});
|
||||
const prefs = resolveSkillsInstallPreferences(opts?.config);
|
||||
return {
|
||||
workspaceDir,
|
||||
managedSkillsDir,
|
||||
skills: skillEntries.map((entry) =>
|
||||
buildSkillStatus(entry, opts?.config, prefs, opts?.eligibility),
|
||||
buildSkillStatus(entry, opts?.config, prefs, opts?.eligibility, bundledContext.names),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user