mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-26 09:09:34 +00:00
docs: document plugin metadata utilities
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/** Caches plugin module loaders and native-load stats for runtime/source module imports. */
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
@@ -13,6 +14,7 @@ import {
|
||||
type PluginSdkResolutionPreference,
|
||||
} from "./sdk-alias.js";
|
||||
|
||||
/** Jiti-based module loader used for plugin source/runtime imports. */
|
||||
export type PluginModuleLoader = ReturnType<typeof createJiti>;
|
||||
export type PluginModuleLoaderFactory = typeof createJiti;
|
||||
export type PluginModuleLoaderCache = Pick<
|
||||
@@ -80,6 +82,7 @@ function recordSourceTransformTarget(target: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns process-local plugin module loader stats for diagnostics and tests. */
|
||||
export function getPluginModuleLoaderStats(): PluginModuleLoaderStatsSnapshot {
|
||||
return {
|
||||
calls: pluginModuleLoaderStats.calls,
|
||||
|
||||
Reference in New Issue
Block a user