mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 09:57:27 +00:00
refactor(status): reuse Requirements types
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import path from "node:path";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { RequirementConfigCheck, Requirements } from "../shared/requirements.js";
|
||||
import { evaluateEntryMetadataRequirements } from "../shared/entry-status.js";
|
||||
import { CONFIG_DIR } from "../utils.js";
|
||||
import {
|
||||
@@ -17,10 +18,7 @@ import {
|
||||
} from "./skills.js";
|
||||
import { resolveBundledSkillsContext } from "./skills/bundled-context.js";
|
||||
|
||||
export type SkillStatusConfigCheck = {
|
||||
path: string;
|
||||
satisfied: boolean;
|
||||
};
|
||||
export type SkillStatusConfigCheck = RequirementConfigCheck;
|
||||
|
||||
export type SkillInstallOption = {
|
||||
id: string;
|
||||
@@ -44,20 +42,8 @@ export type SkillStatusEntry = {
|
||||
disabled: boolean;
|
||||
blockedByAllowlist: boolean;
|
||||
eligible: boolean;
|
||||
requirements: {
|
||||
bins: string[];
|
||||
anyBins: string[];
|
||||
env: string[];
|
||||
config: string[];
|
||||
os: string[];
|
||||
};
|
||||
missing: {
|
||||
bins: string[];
|
||||
anyBins: string[];
|
||||
env: string[];
|
||||
config: string[];
|
||||
os: string[];
|
||||
};
|
||||
requirements: Requirements;
|
||||
missing: Requirements;
|
||||
configChecks: SkillStatusConfigCheck[];
|
||||
install: SkillInstallOption[];
|
||||
};
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import path from "node:path";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { RequirementConfigCheck, Requirements } from "../shared/requirements.js";
|
||||
import type { HookEligibilityContext, HookEntry, HookInstallSpec } from "./types.js";
|
||||
import { evaluateEntryMetadataRequirements } from "../shared/entry-status.js";
|
||||
import { CONFIG_DIR } from "../utils.js";
|
||||
import { hasBinary, isConfigPathTruthy, resolveHookConfig } from "./config.js";
|
||||
import { loadWorkspaceHookEntries } from "./workspace.js";
|
||||
|
||||
export type HookStatusConfigCheck = {
|
||||
path: string;
|
||||
satisfied: boolean;
|
||||
};
|
||||
export type HookStatusConfigCheck = RequirementConfigCheck;
|
||||
|
||||
export type HookInstallOption = {
|
||||
id: string;
|
||||
@@ -34,20 +32,8 @@ export type HookStatusEntry = {
|
||||
disabled: boolean;
|
||||
eligible: boolean;
|
||||
managedByPlugin: boolean;
|
||||
requirements: {
|
||||
bins: string[];
|
||||
anyBins: string[];
|
||||
env: string[];
|
||||
config: string[];
|
||||
os: string[];
|
||||
};
|
||||
missing: {
|
||||
bins: string[];
|
||||
anyBins: string[];
|
||||
env: string[];
|
||||
config: string[];
|
||||
os: string[];
|
||||
};
|
||||
requirements: Requirements;
|
||||
missing: Requirements;
|
||||
configChecks: HookStatusConfigCheck[];
|
||||
install: HookInstallOption[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user