mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 10:55:31 -06:00
refactor: burn export name collision debt (#121767)
* refactor(tasks): disambiguate lifecycle helpers * refactor(channels): clarify account and id helpers * refactor(media): separate SDK facades from cores * refactor(auto-reply): consolidate command helpers * refactor(cli): disambiguate registration helpers * refactor(gateway): clarify runtime and test helpers * chore(scripts): burn resolved collision debt * fix(refactor): update remaining core callers * fix(refactor): update remaining UI callers * chore(plugin-sdk): refresh API baseline
This commit is contained in:
committed by
GitHub
parent
1e1f1b1d54
commit
dd2aedf08f
@@ -30,7 +30,7 @@ import {
|
||||
readConfigFileSnapshot,
|
||||
readConfigFileSnapshotForWrite,
|
||||
parseClawHubPluginSpec,
|
||||
promptYesNo,
|
||||
promptYesNoMock,
|
||||
reportClawHubPluginInstallTelemetry,
|
||||
recordHookInstall,
|
||||
recordPluginInstall,
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
replaceConfigFile,
|
||||
runPluginsCommand,
|
||||
runtimeErrors,
|
||||
runtimeLogs,
|
||||
pluginsCliRuntimeLogs,
|
||||
writeConfigFile,
|
||||
writePersistedInstalledPluginIndexInstallRecordsWithLease,
|
||||
} from "./plugins-cli-test-helpers.js";
|
||||
@@ -456,7 +456,7 @@ function recordHookInstallCall(callIndex = 0): PersistedInstallRecord {
|
||||
}
|
||||
|
||||
function runtimeLogsContain(fragment: string): boolean {
|
||||
return runtimeLogs.some((line) => line.includes(fragment));
|
||||
return pluginsCliRuntimeLogs.some((line) => line.includes(fragment));
|
||||
}
|
||||
|
||||
function setTty(value: boolean): void {
|
||||
@@ -1444,14 +1444,14 @@ describe("plugins cli install", () => {
|
||||
fs.rmSync(localPath, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
expect(promptYesNo).not.toHaveBeenCalled();
|
||||
expect(promptYesNoMock).not.toHaveBeenCalled();
|
||||
expect(runtimeErrors.join("\n")).not.toContain("outside ClawHub review");
|
||||
expect(installPluginFromPath).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("prompts interactive users before non-ClawHub plugin installs and cancels on no", async () => {
|
||||
setTty(true);
|
||||
promptYesNo.mockResolvedValueOnce(false);
|
||||
promptYesNoMock.mockResolvedValueOnce(false);
|
||||
primeSuccessfulPluginPersistence("demo");
|
||||
installPluginFromNpmSpec.mockResolvedValue(createNpmPluginInstallResult("demo"));
|
||||
|
||||
@@ -1459,7 +1459,7 @@ describe("plugins cli install", () => {
|
||||
"__exit__:1",
|
||||
);
|
||||
|
||||
expect(promptYesNo).toHaveBeenCalledWith("Install this non-ClawHub plugin source?");
|
||||
expect(promptYesNoMock).toHaveBeenCalledWith("Install this non-ClawHub plugin source?");
|
||||
expect(runtimeLogsContain("Installing plugin from npm registry")).toBe(true);
|
||||
expect(runtimeLogsContain("outside ClawHub review")).toBe(true);
|
||||
expect(installPluginFromNpmSpec).not.toHaveBeenCalled();
|
||||
@@ -1467,13 +1467,13 @@ describe("plugins cli install", () => {
|
||||
|
||||
it("prompts interactive users before non-ClawHub plugin installs and proceeds on yes", async () => {
|
||||
setTty(true);
|
||||
promptYesNo.mockResolvedValueOnce(true);
|
||||
promptYesNoMock.mockResolvedValueOnce(true);
|
||||
primeSuccessfulPluginPersistence("demo");
|
||||
installPluginFromNpmSpec.mockResolvedValue(createNpmPluginInstallResult("demo"));
|
||||
|
||||
await runPluginsCommand(["plugins", "install", "npm:demo"]);
|
||||
|
||||
expect(promptYesNo).toHaveBeenCalledWith("Install this non-ClawHub plugin source?");
|
||||
expect(promptYesNoMock).toHaveBeenCalledWith("Install this non-ClawHub plugin source?");
|
||||
expect(runtimeLogsContain("Installing plugin from npm registry")).toBe(true);
|
||||
expect(runtimeLogsContain("outside ClawHub review")).toBe(true);
|
||||
expect(installPluginFromNpmSpec).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user