mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:00:44 +00:00
fix(slack): isolate doctor contract API (#63192)
* Slack: isolate doctor contract API * chore: changelog * fix(slack): move doctor changelog entry to Unreleased * Plugins: lock Slack doctor sidecar metadata * Slack: fix changelog entry placement --------- Co-authored-by: @zimeg <zim@o526.net> Co-authored-by: George Pickett <gpickett00@gmail.com>
This commit is contained in:
@@ -157,6 +157,13 @@ describe("bundled plugin metadata", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps Slack's doctor contract sidecar on the bundled public surface", () => {
|
||||
const slack = listRepoBundledPluginMetadata().find((entry) => entry.dirName === "slack");
|
||||
expectArtifactPresence(slack?.publicSurfaceArtifacts, {
|
||||
contains: ["doctor-contract-api.js"],
|
||||
});
|
||||
});
|
||||
|
||||
it("loads tlon channel config metadata from the lightweight schema surface", () => {
|
||||
expect(collectRepoBundledChannelConfigsForTest("tlon")?.tlon).toEqual(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -61,6 +61,30 @@ describe("doctor-contract-registry getJiti", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("prefers doctor-contract-api over the broader contract-api surface", () => {
|
||||
const pluginRoot = makeTempDir();
|
||||
fs.writeFileSync(
|
||||
path.join(pluginRoot, "doctor-contract-api.js"),
|
||||
"export default {};\n",
|
||||
"utf-8",
|
||||
);
|
||||
fs.writeFileSync(path.join(pluginRoot, "contract-api.js"), "export default {};\n", "utf-8");
|
||||
mocks.loadPluginManifestRegistry.mockReturnValue({
|
||||
plugins: [{ id: "test-plugin", rootDir: pluginRoot }],
|
||||
diagnostics: [],
|
||||
});
|
||||
|
||||
listPluginDoctorLegacyConfigRules({
|
||||
workspaceDir: pluginRoot,
|
||||
env: {},
|
||||
});
|
||||
|
||||
expect(mocks.createJiti).toHaveBeenCalledTimes(1);
|
||||
expect(mocks.createJiti.mock.calls[0]?.[0]).toBe(
|
||||
path.join(pluginRoot, "doctor-contract-api.js"),
|
||||
);
|
||||
});
|
||||
|
||||
it("narrows touched-path doctor ids for scoped dry-run validation", () => {
|
||||
expect(
|
||||
collectRelevantDoctorPluginIdsForTouchedPaths({
|
||||
|
||||
Reference in New Issue
Block a user