feat: add plugin update tracking
This commit is contained in:
@@ -68,6 +68,9 @@ describe("ensureOnboardingPluginInstalled", () => {
|
||||
expect(result.installed).toBe(true);
|
||||
expect(result.cfg.plugins?.entries?.zalo?.enabled).toBe(true);
|
||||
expect(result.cfg.plugins?.allow).toContain("zalo");
|
||||
expect(result.cfg.plugins?.installs?.zalo?.source).toBe("npm");
|
||||
expect(result.cfg.plugins?.installs?.zalo?.spec).toBe("@clawdbot/zalo");
|
||||
expect(result.cfg.plugins?.installs?.zalo?.installPath).toBe("/tmp/zalo");
|
||||
expect(installPluginFromNpmSpec).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ spec: "@clawdbot/zalo" }),
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/ag
|
||||
import type { ChannelPluginCatalogEntry } from "../../channels/plugins/catalog.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import { createSubsystemLogger } from "../../logging.js";
|
||||
import { recordPluginInstall } from "../../plugins/installs.js";
|
||||
import { loadClawdbotPlugins } from "../../plugins/loader.js";
|
||||
import { installPluginFromNpmSpec } from "../../plugins/install.js";
|
||||
import type { RuntimeEnv } from "../../runtime.js";
|
||||
@@ -158,6 +159,13 @@ export async function ensureOnboardingPluginInstalled(params: {
|
||||
|
||||
if (result.ok) {
|
||||
next = ensurePluginEnabled(next, result.pluginId);
|
||||
next = recordPluginInstall(next, {
|
||||
pluginId: result.pluginId,
|
||||
source: "npm",
|
||||
spec: entry.install.npmSpec,
|
||||
installPath: result.targetDir,
|
||||
version: result.version,
|
||||
});
|
||||
return { cfg: next, installed: true };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user