mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:14:30 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { MoltbotConfig, SkillConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig, SkillConfig } from "../../config/config.js";
|
||||
import { resolveSkillKey } from "./frontmatter.js";
|
||||
import type { SkillEligibilityContext, SkillEntry } from "./types.js";
|
||||
|
||||
@@ -17,7 +17,7 @@ function isTruthy(value: unknown): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function resolveConfigPath(config: MoltbotConfig | undefined, pathStr: string) {
|
||||
export function resolveConfigPath(config: OpenClawConfig | undefined, pathStr: string) {
|
||||
const parts = pathStr.split(".").filter(Boolean);
|
||||
let current: unknown = config;
|
||||
for (const part of parts) {
|
||||
@@ -27,7 +27,7 @@ export function resolveConfigPath(config: MoltbotConfig | undefined, pathStr: st
|
||||
return current;
|
||||
}
|
||||
|
||||
export function isConfigPathTruthy(config: MoltbotConfig | undefined, pathStr: string): boolean {
|
||||
export function isConfigPathTruthy(config: OpenClawConfig | undefined, pathStr: string): boolean {
|
||||
const value = resolveConfigPath(config, pathStr);
|
||||
if (value === undefined && pathStr in DEFAULT_CONFIG_VALUES) {
|
||||
return DEFAULT_CONFIG_VALUES[pathStr] === true;
|
||||
@@ -36,7 +36,7 @@ export function isConfigPathTruthy(config: MoltbotConfig | undefined, pathStr: s
|
||||
}
|
||||
|
||||
export function resolveSkillConfig(
|
||||
config: MoltbotConfig | undefined,
|
||||
config: OpenClawConfig | undefined,
|
||||
skillKey: string,
|
||||
): SkillConfig | undefined {
|
||||
const skills = config?.skills?.entries;
|
||||
@@ -57,11 +57,13 @@ function normalizeAllowlist(input: unknown): string[] | undefined {
|
||||
return normalized.length > 0 ? normalized : undefined;
|
||||
}
|
||||
|
||||
const BUNDLED_SOURCES = new Set(["openclaw-bundled"]);
|
||||
|
||||
function isBundledSkill(entry: SkillEntry): boolean {
|
||||
return entry.skill.source === "moltbot-bundled";
|
||||
return BUNDLED_SOURCES.has(entry.skill.source);
|
||||
}
|
||||
|
||||
export function resolveBundledAllowlist(config?: MoltbotConfig): string[] | undefined {
|
||||
export function resolveBundledAllowlist(config?: OpenClawConfig): string[] | undefined {
|
||||
return normalizeAllowlist(config?.skills?.allowBundled);
|
||||
}
|
||||
|
||||
@@ -89,7 +91,7 @@ export function hasBinary(bin: string): boolean {
|
||||
|
||||
export function shouldIncludeSkill(params: {
|
||||
entry: SkillEntry;
|
||||
config?: MoltbotConfig;
|
||||
config?: OpenClawConfig;
|
||||
eligibility?: SkillEligibilityContext;
|
||||
}): boolean {
|
||||
const { entry, config, eligibility } = params;
|
||||
|
||||
Reference in New Issue
Block a user