Files
openclaw/extensions/tokenjuice/manifest.test.ts
Peter Steinberger ed8f50f240 refactor: simplify plugin dependency handling
Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths.

Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
2026-05-01 21:32:22 +01:00

31 lines
934 B
TypeScript

import fs from "node:fs";
import { describe, expect, it } from "vitest";
type TokenjuicePackageManifest = {
dependencies?: Record<string, string>;
};
type TokenjuicePluginManifest = {
contracts?: {
agentToolResultMiddleware?: string[];
};
};
describe("tokenjuice package manifest", () => {
it("keeps runtime dependencies in the package manifest", () => {
const packageJson = JSON.parse(
fs.readFileSync(new URL("./package.json", import.meta.url), "utf8"),
) as TokenjuicePackageManifest;
expect(packageJson.dependencies?.tokenjuice).toBe("0.7.0");
});
it("declares runtime-neutral tool result middleware ownership in the manifest contract", () => {
const manifest = JSON.parse(
fs.readFileSync(new URL("./openclaw.plugin.json", import.meta.url), "utf8"),
) as TokenjuicePluginManifest;
expect(manifest.contracts?.agentToolResultMiddleware).toEqual(["pi", "codex"]);
});
});