[AI] fix(plugins): recognize document-extractors as a capability kind… · openclaw/openclaw@d17b970
xydt-tanshan
·
2026-06-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -95,6 +95,15 @@ describe("plugin shape compatibility matrix", () => {
|
95 | 95 | }, |
96 | 96 | }); |
97 | 97 | |
| 98 | +registerVirtualTestPlugin({ |
| 99 | + registry, |
| 100 | + config, |
| 101 | +id: "document-extract-test", |
| 102 | +name: "Document Extract Test", |
| 103 | +contracts: { documentExtractors: ["pdf"] }, |
| 104 | +register() {}, |
| 105 | +}); |
| 106 | + |
98 | 107 | const report = { |
99 | 108 | workspaceDir: "/virtual-workspace", |
100 | 109 | ...registry.registry, |
@@ -130,11 +139,22 @@ describe("plugin shape compatibility matrix", () => {
|
130 | 139 | shape: "plain-capability", |
131 | 140 | capabilityMode: "plain", |
132 | 141 | }, |
| 142 | +{ |
| 143 | +id: "document-extract-test", |
| 144 | +shape: "plain-capability", |
| 145 | +capabilityMode: "plain", |
| 146 | +}, |
133 | 147 | ]); |
134 | 148 | |
135 | 149 | expect(inspect[0]?.usesLegacyBeforeAgentStart).toBe(true); |
136 | 150 | expect(inspect.map((entry) => entry.capabilities.map((capability) => capability.kind))).toEqual( |
137 | | -[[], ["text-inference"], ["text-inference", "web-search"], ["channel"]], |
| 151 | +[ |
| 152 | +[], |
| 153 | +["text-inference"], |
| 154 | +["text-inference", "web-search"], |
| 155 | +["channel"], |
| 156 | +["document-extractors"], |
| 157 | +], |
138 | 158 | ); |
139 | 159 | }); |
140 | 160 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,7 @@ export type PluginCapabilityKind =
|
11 | 11 | | "realtime-voice" |
12 | 12 | | "media-understanding" |
13 | 13 | | "transcript-source" |
| 14 | +| "document-extractors" |
14 | 15 | | "image-generation" |
15 | 16 | | "video-generation" |
16 | 17 | | "music-generation" |
@@ -50,6 +51,7 @@ function buildPluginCapabilityEntries(
|
50 | 51 | { kind: "realtime-voice" as const, ids: plugin.realtimeVoiceProviderIds }, |
51 | 52 | { kind: "media-understanding" as const, ids: plugin.mediaUnderstandingProviderIds }, |
52 | 53 | { kind: "transcript-source" as const, ids: plugin.transcriptSourceProviderIds }, |
| 54 | +{ kind: "document-extractors" as const, ids: plugin.contracts?.documentExtractors ?? [] }, |
53 | 55 | { kind: "image-generation" as const, ids: plugin.imageGenerationProviderIds }, |
54 | 56 | { kind: "video-generation" as const, ids: plugin.videoGenerationProviderIds }, |
55 | 57 | { kind: "music-generation" as const, ids: plugin.musicGenerationProviderIds }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。