mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-05-08 16:17:54 +08:00
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import type { OpenClawConfig } from "../../config/config.js";
|
|
import { createPluginRegistry, type PluginRecord } from "../registry.js";
|
|
import type { PluginRuntime } from "../runtime/types.js";
|
|
import { createPluginRecord } from "../status.test-helpers.js";
|
|
import type { OpenClawPluginApi } from "../types.js";
|
|
|
|
export {
|
|
registerProviderPlugins as registerProviders,
|
|
requireRegisteredProvider as requireProvider,
|
|
} from "../../test-utils/plugin-registration.js";
|
|
|
|
export function uniqueSortedStrings(values: readonly string[]) {
|
|
return [...new Set(values)].toSorted((left, right) => left.localeCompare(right));
|
|
}
|
|
|
|
export function createPluginRegistryFixture(config = {} as OpenClawConfig) {
|
|
return {
|
|
config,
|
|
registry: createPluginRegistry({
|
|
logger: {
|
|
info() {},
|
|
warn() {},
|
|
error() {},
|
|
debug() {},
|
|
},
|
|
runtime: {} as PluginRuntime,
|
|
}),
|
|
};
|
|
}
|
|
|
|
export function registerTestPlugin(params: {
|
|
registry: ReturnType<typeof createPluginRegistry>;
|
|
config: OpenClawConfig;
|
|
record: PluginRecord;
|
|
register(api: OpenClawPluginApi): void;
|
|
}) {
|
|
params.registry.registry.plugins.push(params.record);
|
|
params.register(
|
|
params.registry.createApi(params.record, {
|
|
config: params.config,
|
|
}),
|
|
);
|
|
}
|
|
|
|
export function registerVirtualTestPlugin(params: {
|
|
registry: ReturnType<typeof createPluginRegistry>;
|
|
config: OpenClawConfig;
|
|
id: string;
|
|
name: string;
|
|
source?: string;
|
|
kind?: PluginRecord["kind"];
|
|
register(this: void, api: OpenClawPluginApi): void;
|
|
}) {
|
|
registerTestPlugin({
|
|
registry: params.registry,
|
|
config: params.config,
|
|
record: createPluginRecord({
|
|
id: params.id,
|
|
name: params.name,
|
|
source: params.source ?? `/virtual/${params.id}/index.ts`,
|
|
...(params.kind ? { kind: params.kind } : {}),
|
|
}),
|
|
register: params.register,
|
|
});
|
|
}
|