Skip to content

Commit 3e010e2

Browse files
committed
feat(plugins): add media understanding provider registration
1 parent 14907d3 commit 3e010e2

26 files changed

Lines changed: 222 additions & 8 deletions

File tree

‎extensions/anthropic/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import { buildTokenProfileId, validateAnthropicSetupToken } from "../../src/commands/auth-token.js";
2424
import { applyAuthProfileConfig } from "../../src/commands/onboard-auth.js";
2525
import { fetchClaudeUsage } from "../../src/infra/provider-usage.fetch.js";
26+
import { anthropicProvider } from "../../src/media-understanding/providers/anthropic/index.js";
2627
import { createProviderApiKeyAuthMethod } from "../../src/plugins/provider-api-key-auth.js";
2728
import type { ProviderAuthResult } from "../../src/plugins/types.js";
2829
import { normalizeSecretInput } from "../../src/utils/normalize-secret-input.js";
@@ -394,6 +395,7 @@ const anthropicPlugin = {
394395
profileId: ctx.profileId,
395396
}),
396397
});
398+
api.registerMediaUnderstandingProvider(anthropicProvider);
397399
},
398400
};
399401

‎extensions/google/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
GOOGLE_GEMINI_DEFAULT_MODEL,
88
applyGoogleGeminiModelDefault,
99
} from "../../src/commands/google-gemini-model-default.js";
10+
import { googleProvider } from "../../src/media-understanding/providers/google/index.js";
1011
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
1112
import { createProviderApiKeyAuthMethod } from "../../src/plugins/provider-api-key-auth.js";
1213
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
@@ -51,6 +52,7 @@ const googlePlugin = {
5152
isModernModelRef: ({ modelId }) => isModernGoogleModel(modelId),
5253
});
5354
registerGoogleGeminiCliProvider(api);
55+
api.registerMediaUnderstandingProvider(googleProvider);
5456
api.registerWebSearchProvider(
5557
createPluginBackedWebSearchProvider({
5658
id: "gemini",

‎extensions/lobster/src/lobster-tool.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function fakeApi(overrides: Partial<OpenClawPluginApi> = {}): OpenClawPluginApi
4545
registerService() {},
4646
registerProvider() {},
4747
registerSpeechProvider() {},
48+
registerMediaUnderstandingProvider() {},
4849
registerWebSearchProvider() {},
4950
registerInteractiveHandler() {},
5051
registerHook() {},

‎extensions/minimax/index.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import {
99
import { ensureAuthProfileStore, listProfilesForProvider } from "../../src/agents/auth-profiles.js";
1010
import { MINIMAX_OAUTH_MARKER } from "../../src/agents/model-auth-markers.js";
1111
import { fetchMinimaxUsage } from "../../src/infra/provider-usage.fetch.js";
12+
import {
13+
minimaxPortalProvider,
14+
minimaxProvider,
15+
} from "../../src/media-understanding/providers/minimax/index.js";
1216
import { createProviderApiKeyAuthMethod } from "../../src/plugins/provider-api-key-auth.js";
1317
import { loginMiniMaxPortalOAuth, type MiniMaxRegion } from "./oauth.js";
1418
import { applyMinimaxApiConfig, applyMinimaxApiConfigCn } from "./onboard.js";
@@ -270,6 +274,8 @@ const minimaxPlugin = {
270274
],
271275
isModernModelRef: ({ modelId }) => isModernMiniMaxModel(modelId),
272276
});
277+
api.registerMediaUnderstandingProvider(minimaxProvider);
278+
api.registerMediaUnderstandingProvider(minimaxPortalProvider);
273279
},
274280
};
275281

‎extensions/mistral/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
2+
import { mistralProvider } from "../../src/media-understanding/providers/mistral/index.js";
23
import { createProviderApiKeyAuthMethod } from "../../src/plugins/provider-api-key-auth.js";
34
import { applyMistralConfig, MISTRAL_DEFAULT_MODEL_REF } from "./onboard.js";
45

@@ -50,6 +51,7 @@ const mistralPlugin = {
5051
],
5152
},
5253
});
54+
api.registerMediaUnderstandingProvider(mistralProvider);
5355
},
5456
};
5557

‎extensions/moonshot/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getScopedCredentialValue,
88
setScopedCredentialValue,
99
} from "../../src/agents/tools/web-search-plugin-factory.js";
10+
import { moonshotProvider } from "../../src/media-understanding/providers/moonshot/index.js";
1011
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
1112
import { createProviderApiKeyAuthMethod } from "../../src/plugins/provider-api-key-auth.js";
1213
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
@@ -99,6 +100,7 @@ const moonshotPlugin = {
99100
return createMoonshotThinkingWrapper(ctx.streamFn, thinkingType);
100101
},
101102
});
103+
api.registerMediaUnderstandingProvider(moonshotProvider);
102104
api.registerWebSearchProvider(
103105
createPluginBackedWebSearchProvider({
104106
id: "kimi",

‎extensions/openai/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
2+
import { openaiProvider } from "../../src/media-understanding/providers/openai/index.js";
23
import { buildOpenAISpeechProvider } from "../../src/tts/providers/openai.js";
34
import { buildOpenAICodexProviderPlugin } from "./openai-codex-provider.js";
45
import { buildOpenAIProvider } from "./openai-provider.js";
@@ -12,6 +13,7 @@ const openAIPlugin = {
1213
api.registerProvider(buildOpenAIProvider());
1314
api.registerProvider(buildOpenAICodexProviderPlugin());
1415
api.registerSpeechProvider(buildOpenAISpeechProvider());
16+
api.registerMediaUnderstandingProvider(openaiProvider);
1517
},
1618
};
1719

‎extensions/test-utils/plugin-api.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function createTestPluginApi(api: TestPluginApiInput): OpenClawPluginApi
1616
registerService() {},
1717
registerProvider() {},
1818
registerSpeechProvider() {},
19+
registerMediaUnderstandingProvider() {},
1920
registerWebSearchProvider() {},
2021
registerInteractiveHandler() {},
2122
registerCommand() {},

‎extensions/zai/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { applyAuthProfileConfig } from "../../src/commands/onboard-auth.js";
2424
import type { SecretInput } from "../../src/config/types.secrets.js";
2525
import { resolveRequiredHomeDir } from "../../src/infra/home-dir.js";
2626
import { fetchZaiUsage } from "../../src/infra/provider-usage.fetch.js";
27+
import { zaiProvider } from "../../src/media-understanding/providers/zai/index.js";
2728
import { normalizeOptionalSecretInput } from "../../src/utils/normalize-secret-input.js";
2829
import { detectZaiEndpoint, type ZaiEndpointId } from "./detect.js";
2930
import { applyZaiConfig, applyZaiProviderConfig, ZAI_DEFAULT_MODEL_REF } from "./onboard.js";
@@ -334,6 +335,7 @@ const zaiPlugin = {
334335
fetchUsageSnapshot: async (ctx) => await fetchZaiUsage(ctx.token, ctx.timeoutMs, ctx.fetchFn),
335336
isCacheTtlEligible: () => true,
336337
});
338+
api.registerMediaUnderstandingProvider(zaiProvider);
337339
},
338340
};
339341

‎src/auto-reply/reply/route-reply.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry =>
9292
})),
9393
providers: [],
9494
speechProviders: [],
95+
mediaUnderstandingProviders: [],
9596
webSearchProviders: [],
9697
gatewayHandlers: {},
9798
httpRoutes: [],

0 commit comments

Comments
 (0)