refactor: hide plugin helper internals

This commit is contained in:
Peter Steinberger
2026-05-02 07:29:13 +01:00
parent eaf1f53d60
commit 31eacdd981
7 changed files with 8 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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");
}

View File

@@ -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;

View File

@@ -71,7 +71,7 @@ export function getPluginInteractiveHandlersState() {
return getState().interactiveHandlers;
}
export function getPluginInteractiveCallbackDedupeState() {
function getPluginInteractiveCallbackDedupeState() {
return getState().callbackDedupe;
}

View File

@@ -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());
}

View File

@@ -145,7 +145,7 @@ export function loadBundledWebSearchProviderEntriesFromDir(params: {
});
}
export function loadBundledRuntimeWebSearchProviderEntriesFromDir(params: {
function loadBundledRuntimeWebSearchProviderEntriesFromDir(params: {
dirName: string;
pluginId: string;
}): PluginWebSearchProviderEntry[] | null {