mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-01 07:43:37 +00:00
[AI] fix(plugins): recognize document-extractors as a capability kind… (#91597)
* [AI] fix(plugins): recognize document-extractors as a capability kind in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to #91539 * [AI] test(plugins): add document-extractors shape contract coverage Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR #91597. * [AI] chore: rebase on main to refresh CI * test(plugins): fold extractor into shape matrix --------- Co-authored-by: Peter Steinberger <steipete@golden-gate.local>
This commit is contained in:
@@ -95,6 +95,15 @@ describe("plugin shape compatibility matrix", () => {
|
||||
},
|
||||
});
|
||||
|
||||
registerVirtualTestPlugin({
|
||||
registry,
|
||||
config,
|
||||
id: "document-extract-test",
|
||||
name: "Document Extract Test",
|
||||
contracts: { documentExtractors: ["pdf"] },
|
||||
register() {},
|
||||
});
|
||||
|
||||
const report = {
|
||||
workspaceDir: "/virtual-workspace",
|
||||
...registry.registry,
|
||||
@@ -130,11 +139,22 @@ describe("plugin shape compatibility matrix", () => {
|
||||
shape: "plain-capability",
|
||||
capabilityMode: "plain",
|
||||
},
|
||||
{
|
||||
id: "document-extract-test",
|
||||
shape: "plain-capability",
|
||||
capabilityMode: "plain",
|
||||
},
|
||||
]);
|
||||
|
||||
expect(inspect[0]?.usesLegacyBeforeAgentStart).toBe(true);
|
||||
expect(inspect.map((entry) => entry.capabilities.map((capability) => capability.kind))).toEqual(
|
||||
[[], ["text-inference"], ["text-inference", "web-search"], ["channel"]],
|
||||
[
|
||||
[],
|
||||
["text-inference"],
|
||||
["text-inference", "web-search"],
|
||||
["channel"],
|
||||
["document-extractors"],
|
||||
],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ export type PluginCapabilityKind =
|
||||
| "realtime-voice"
|
||||
| "media-understanding"
|
||||
| "transcript-source"
|
||||
| "document-extractors"
|
||||
| "image-generation"
|
||||
| "video-generation"
|
||||
| "music-generation"
|
||||
@@ -50,6 +51,7 @@ function buildPluginCapabilityEntries(
|
||||
{ kind: "realtime-voice" as const, ids: plugin.realtimeVoiceProviderIds },
|
||||
{ kind: "media-understanding" as const, ids: plugin.mediaUnderstandingProviderIds },
|
||||
{ kind: "transcript-source" as const, ids: plugin.transcriptSourceProviderIds },
|
||||
{ kind: "document-extractors" as const, ids: plugin.contracts?.documentExtractors ?? [] },
|
||||
{ kind: "image-generation" as const, ids: plugin.imageGenerationProviderIds },
|
||||
{ kind: "video-generation" as const, ids: plugin.videoGenerationProviderIds },
|
||||
{ kind: "music-generation" as const, ids: plugin.musicGenerationProviderIds },
|
||||
|
||||
Reference in New Issue
Block a user