@openclaw/moonshot-provider 2026.9.5 → 2026.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.png +0 -0
- package/dist/.setup/{kimi-web-search-provider-J_Huglrw.mjs → kimi-web-search-provider-c6i-_MVz.mjs} +1 -1
- package/dist/.setup/{kimi-web-search-provider.runtime-MPKxSV7f.mjs → kimi-web-search-provider.runtime-DRzTngzG.mjs} +9 -7
- package/dist/.setup/{openclaw.plugin-CZNy9Kfm.mjs → openclaw.plugin-DX_vVKdi.mjs} +1 -1
- package/dist/index.js +2 -2
- package/dist/media-understanding-provider.js +1 -1
- package/dist/provider-catalog.js +1 -1
- package/dist/provider-contract-api.js +1 -1
- package/dist/provider-policy-api.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -4
package/assets/icon.png
CHANGED
|
Binary file
|
package/dist/.setup/{kimi-web-search-provider-J_Huglrw.mjs → kimi-web-search-provider-c6i-_MVz.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
2
2
|
import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-config-contract";
|
|
3
3
|
//#region extensions/moonshot/src/kimi-web-search-provider.ts
|
|
4
4
|
const KIMI_CREDENTIAL_PATH = "plugins.entries.moonshot.config.webSearch.apiKey";
|
|
5
|
-
const loadKimiWebSearchProviderRuntime = createLazyRuntimeModule(() => import("./kimi-web-search-provider.runtime-
|
|
5
|
+
const loadKimiWebSearchProviderRuntime = createLazyRuntimeModule(() => import("./kimi-web-search-provider.runtime-DRzTngzG.mjs"));
|
|
6
6
|
const KimiSearchSchema = {
|
|
7
7
|
type: "object",
|
|
8
8
|
properties: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MOONSHOT_BASE_URL, MOONSHOT_CN_BASE_URL, isNativeMoonshotBaseUrl } from "../provider-policy-api.js";
|
|
2
2
|
import "../provider-catalog.js";
|
|
3
|
-
import { isRecord, normalizeOptionalString
|
|
3
|
+
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createProviderHttpError, readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-http";
|
|
5
5
|
import { MAX_SEARCH_COUNT, buildSearchCacheKey, buildUnsupportedSearchFilterResponse, mergeScopedSearchConfig, readCachedSearchPayload, readConfiguredSecretString, readPositiveIntegerParam, readProviderEnvValue, readStringParam, resolveProviderWebSearchPluginConfig, resolveSearchCacheTtlMs, resolveSearchTimeoutSeconds, setProviderWebSearchPluginConfigValue, withTrustedWebSearchEndpoint, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
|
|
6
6
|
//#region extensions/moonshot/src/kimi-web-search-provider.runtime.ts
|
|
@@ -43,10 +43,13 @@ function extractKimiMessageText(message) {
|
|
|
43
43
|
if (content) return content;
|
|
44
44
|
return message?.reasoning_content?.trim() || void 0;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function collectKimiCitations(data, citations) {
|
|
47
47
|
const searchResults = data.search_results ?? [];
|
|
48
48
|
if (!Array.isArray(searchResults)) throwMalformedKimiResponse();
|
|
49
|
-
|
|
49
|
+
for (const entry of searchResults) {
|
|
50
|
+
const url = isRecord(entry) && typeof entry.url === "string" ? entry.url.trim() : "";
|
|
51
|
+
if (url) citations.add(url);
|
|
52
|
+
}
|
|
50
53
|
const choices = data.choices ?? [];
|
|
51
54
|
if (!Array.isArray(choices)) throwMalformedKimiResponse();
|
|
52
55
|
const firstChoice = choices[0];
|
|
@@ -59,14 +62,13 @@ function extractKimiCitations(data) {
|
|
|
59
62
|
try {
|
|
60
63
|
const parsed = JSON.parse(rawArguments);
|
|
61
64
|
const parsedUrl = normalizeOptionalString(parsed.url);
|
|
62
|
-
if (parsedUrl) citations.
|
|
65
|
+
if (parsedUrl) citations.add(parsedUrl);
|
|
63
66
|
for (const result of parsed.search_results ?? []) {
|
|
64
67
|
const resultUrl = normalizeOptionalString(result.url);
|
|
65
|
-
if (resultUrl) citations.
|
|
68
|
+
if (resultUrl) citations.add(resultUrl);
|
|
66
69
|
}
|
|
67
70
|
} catch {}
|
|
68
71
|
}
|
|
69
|
-
return uniqueStrings(citations);
|
|
70
72
|
}
|
|
71
73
|
function hasKimiSearchResults(data) {
|
|
72
74
|
const searchResults = data.search_results ?? [];
|
|
@@ -109,7 +111,7 @@ async function runKimiSearch(params) {
|
|
|
109
111
|
const data = await readProviderJsonObjectResponse(res, "Kimi API error");
|
|
110
112
|
if (!Array.isArray(data.choices)) throwMalformedKimiResponse();
|
|
111
113
|
if (hasKimiSearchResults(data)) hasGroundingEvidence = true;
|
|
112
|
-
|
|
114
|
+
collectKimiCitations(data, collectedCitations);
|
|
113
115
|
if (collectedCitations.size > 0) hasGroundingEvidence = true;
|
|
114
116
|
const choice = data.choices?.[0];
|
|
115
117
|
if (!isRecord(choice) || !isRecord(choice.message)) throwMalformedKimiResponse();
|
|
@@ -19,7 +19,7 @@ var openclaw_plugin_default = {
|
|
|
19
19
|
"compatibilityFamily": "moonshot"
|
|
20
20
|
} } },
|
|
21
21
|
modelPricing: { "providers": { "moonshot": {
|
|
22
|
-
"
|
|
22
|
+
"modelsDev": { "provider": "moonshotai" },
|
|
23
23
|
"liteLLM": { "provider": "moonshot" }
|
|
24
24
|
} } },
|
|
25
25
|
modelCatalog: {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DX_vVKdi.mjs";
|
|
2
2
|
import { isMoonshotAlwaysThinkingModelId, isMoonshotK3NativeVideoRoute, resolveThinkingProfile } from "./provider-policy-api.js";
|
|
3
3
|
import { MOONSHOT_DEFAULT_MODEL_REF, buildMoonshotProvider } from "./provider-catalog.js";
|
|
4
4
|
import { moonshotMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
5
5
|
import { wrapMoonshotStream } from "./native-video.js";
|
|
6
6
|
import { applyMoonshotConfig, applyMoonshotConfigCn } from "./onboard.js";
|
|
7
|
-
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-
|
|
7
|
+
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-c6i-_MVz.mjs";
|
|
8
8
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
9
9
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
10
10
|
import { buildOpenAICompatibleReplayPolicy } from "openclaw/plugin-sdk/provider-model-shared";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DX_vVKdi.mjs";
|
|
2
2
|
import { MOONSHOT_BASE_URL } from "./provider-policy-api.js";
|
|
3
3
|
import "./provider-catalog.js";
|
|
4
4
|
import { describeOpenAiCompatibleVideo } from "openclaw/plugin-sdk/media-understanding";
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DX_vVKdi.mjs";
|
|
2
2
|
import { MOONSHOT_BASE_URL, MOONSHOT_CN_BASE_URL, isNativeMoonshotBaseUrl } from "./provider-policy-api.js";
|
|
3
3
|
import { applyProviderNativeStreamingUsageCompat, buildManifestModelProviderConfig, readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
4
4
|
//#region extensions/moonshot/provider-catalog.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DX_vVKdi.mjs";
|
|
2
2
|
//#region extensions/moonshot/provider-contract-api.ts
|
|
3
3
|
const noopAuth = async () => ({ profiles: [] });
|
|
4
4
|
function createMoonshotProvider() {
|
|
@@ -25,11 +25,11 @@ function isMoonshotK3NativeVideoRoute(route) {
|
|
|
25
25
|
return route.provider === "moonshot" && route.modelId === "kimi-k3" && route.api === "openai-completions" && isNativeMoonshotBaseUrl(route.baseUrl);
|
|
26
26
|
}
|
|
27
27
|
function isMoonshotAlwaysThinkingModelId(modelId) {
|
|
28
|
-
return modelId.trim().toLowerCase()
|
|
28
|
+
return Object.hasOwn(ALWAYS_THINKING_PROFILES, modelId.trim().toLowerCase());
|
|
29
29
|
}
|
|
30
30
|
function resolveThinkingProfile(context) {
|
|
31
31
|
const modelId = context.modelId.trim().toLowerCase();
|
|
32
|
-
const profile = ALWAYS_THINKING_PROFILES[modelId];
|
|
32
|
+
const profile = Object.hasOwn(ALWAYS_THINKING_PROFILES, modelId) ? ALWAYS_THINKING_PROFILES[modelId] : void 0;
|
|
33
33
|
if (profile) return {
|
|
34
34
|
levels: [profile],
|
|
35
35
|
defaultLevel: profile.id,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-
|
|
1
|
+
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-c6i-_MVz.mjs";
|
|
2
2
|
import "./web-search-provider.js";
|
|
3
3
|
export { createKimiWebSearchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-
|
|
1
|
+
import { t as createKimiWebSearchProvider } from "./.setup/kimi-web-search-provider-c6i-_MVz.mjs";
|
|
2
2
|
export { createKimiWebSearchProvider };
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/moonshot-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.7",
|
|
4
4
|
"description": "OpenClaw Moonshot provider plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"minHostVersion": ">=2026.6.9"
|
|
15
15
|
},
|
|
16
16
|
"compat": {
|
|
17
|
-
"pluginApi": ">=2026.9.
|
|
17
|
+
"pluginApi": ">=2026.9.7"
|
|
18
18
|
},
|
|
19
19
|
"build": {
|
|
20
|
-
"openclawVersion": "2026.9.
|
|
20
|
+
"openclawVersion": "2026.9.7",
|
|
21
21
|
"bundledDist": false
|
|
22
22
|
},
|
|
23
23
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.9.
|
|
43
|
+
"openclaw": ">=2026.9.7"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|