@openclaw/moonshot-provider 2026.9.5 → 2026.9.6
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/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/index.js +1 -1
- package/dist/web-search-contract-api.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/package.json +4 -4
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();
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { MOONSHOT_DEFAULT_MODEL_REF, buildMoonshotProvider } from "./provider-ca
|
|
|
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,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/moonshot-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.6",
|
|
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.6"
|
|
18
18
|
},
|
|
19
19
|
"build": {
|
|
20
|
-
"openclawVersion": "2026.9.
|
|
20
|
+
"openclawVersion": "2026.9.6",
|
|
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.6"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|