mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:00:43 +00:00
refactor: hide plugin helper internals
This commit is contained in:
@@ -12,7 +12,7 @@ function prefixMatchPath(pathname: string, prefix: string): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function doPluginHttpRoutesOverlap(
|
||||
function doPluginHttpRoutesOverlap(
|
||||
a: Pick<PluginHttpRouteLike, "path" | "match">,
|
||||
b: Pick<PluginHttpRouteLike, "path" | "match">,
|
||||
): boolean {
|
||||
|
||||
@@ -33,7 +33,7 @@ export type PluginShapeSummary = {
|
||||
usesLegacyBeforeAgentStart: boolean;
|
||||
};
|
||||
|
||||
export function buildPluginCapabilityEntries(
|
||||
function buildPluginCapabilityEntries(
|
||||
plugin: PluginRegistry["plugins"][number],
|
||||
): PluginCapabilityEntry[] {
|
||||
return [
|
||||
@@ -57,7 +57,7 @@ export function buildPluginCapabilityEntries(
|
||||
].filter((entry) => entry.ids.length > 0);
|
||||
}
|
||||
|
||||
export function derivePluginInspectShape(params: {
|
||||
function derivePluginInspectShape(params: {
|
||||
capabilityCount: number;
|
||||
typedHookCount: number;
|
||||
customHookCount: number;
|
||||
|
||||
@@ -2,7 +2,7 @@ import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import type { PluginDiagnostic } from "./manifest-types.js";
|
||||
|
||||
export function hashString(value: string): string {
|
||||
function hashString(value: string): string {
|
||||
return crypto.createHash("sha256").update(value).digest("hex");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from "node:path";
|
||||
import { resolveStateDir } from "../config/paths.js";
|
||||
|
||||
export const INSTALLED_PLUGIN_INDEX_STORE_PATH = path.join("plugins", "installs.json");
|
||||
const INSTALLED_PLUGIN_INDEX_STORE_PATH = path.join("plugins", "installs.json");
|
||||
|
||||
export type InstalledPluginIndexStoreOptions = {
|
||||
env?: NodeJS.ProcessEnv;
|
||||
|
||||
@@ -71,7 +71,7 @@ export function getPluginInteractiveHandlersState() {
|
||||
return getState().interactiveHandlers;
|
||||
}
|
||||
|
||||
export function getPluginInteractiveCallbackDedupeState() {
|
||||
function getPluginInteractiveCallbackDedupeState() {
|
||||
return getState().callbackDedupe;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
|
||||
export function isTypeScriptPackageEntry(entryPath: string): boolean {
|
||||
function isTypeScriptPackageEntry(entryPath: string): boolean {
|
||||
return [".ts", ".mts", ".cts"].includes(path.extname(entryPath).toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ export function loadBundledWebSearchProviderEntriesFromDir(params: {
|
||||
});
|
||||
}
|
||||
|
||||
export function loadBundledRuntimeWebSearchProviderEntriesFromDir(params: {
|
||||
function loadBundledRuntimeWebSearchProviderEntriesFromDir(params: {
|
||||
dirName: string;
|
||||
pluginId: string;
|
||||
}): PluginWebSearchProviderEntry[] | null {
|
||||
|
||||
Reference in New Issue
Block a user