Files
openclaw/src/plugin-sdk/api-baseline.test.ts
Peter Steinberger 22bad620fc refactor: remove pi runtime internals
Rename remaining Pi-shaped agent surfaces to OpenClaw agent runtime names, delete obsolete Pi docs and package graph checks, and add the third-party notice for incorporated code.
2026-05-27 18:15:26 +01:00

19 lines
877 B
TypeScript

import path from "node:path";
import { describe, expect, it } from "vitest";
import { normalizePluginSdkApiDeclarationText } from "./api-baseline.js";
describe("Plugin SDK API baseline", () => {
it("normalizes declaration import paths to repo-relative paths", () => {
const repoRoot = process.cwd();
const modelCatalogPath = path.join(repoRoot, "src", "agents", "agent-model-discovery");
const declaration = `export function setModelCatalogImportForTest(loader?: (() => Promise<typeof import("${modelCatalogPath}", { with: { "resolution-mode": "import" } })>) | undefined): void;`;
const normalized = normalizePluginSdkApiDeclarationText(repoRoot, declaration);
expect(normalized).not.toContain(repoRoot);
expect(normalized).toContain(
'import("src/agents/agent-model-discovery", { with: { "resolution-mode": "import" } })',
);
});
});