@vibe-lark/larkpal 0.1.85 → 0.1.86
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/account-id-BM1T6029-DYjVxojW.mjs +46 -0
- package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +172 -0
- package/dist/anthropic-TH8ERTXK.mjs +5962 -0
- package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +596 -0
- package/dist/azure-openai-responses-Bt_Ag9Er.mjs +166 -0
- package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +594 -0
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +60 -0
- package/dist/build-DgTrEpge.mjs +3333 -0
- package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +5216 -0
- package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +258 -0
- package/dist/call-DimWbpgJ-ColD4W-y.mjs +9993 -0
- package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +2 -0
- package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +33 -0
- package/dist/chunk-D6SyT4dJ.mjs +36 -0
- package/dist/cli.mjs +6 -6
- package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +685 -0
- package/dist/config-Bim2pi8a-BQUdfiEi.mjs +9 -0
- package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +72 -0
- package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +140 -0
- package/dist/dist-CEGw8-2W.mjs +429 -0
- package/dist/dist-DD2aJ2UL.mjs +125135 -0
- package/dist/env-api-keys-BVvSg7T2.mjs +68 -0
- package/dist/event-stream-xaQWmyas.mjs +15226 -0
- package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +194 -0
- package/dist/from-DF7cl2wz.mjs +3842 -0
- package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +28 -0
- package/dist/github-copilot-headers-DjqWtUoP.mjs +22 -0
- package/dist/google-C2pVrgBZ.mjs +336 -0
- package/dist/google-gemini-cli-BBxgS5Ho.mjs +623 -0
- package/dist/google-shared-BsWgwEk1.mjs +22791 -0
- package/dist/google-vertex-BsVLJrrC.mjs +358 -0
- package/dist/hash-DAFtW_W7.mjs +16 -0
- package/dist/headers-R3HdCbAE.mjs +8 -0
- package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +93 -0
- package/dist/ids-BPsM98Uu-CwuxvUai.mjs +77 -0
- package/dist/image-2w3cApg7-CxpHvoB5.mjs +207 -0
- package/dist/io-CH2g3vsv-BOGlLlB8.mjs +26218 -0
- package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +5049 -0
- package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +108 -0
- package/dist/json-parse-v_HIJjjI.mjs +381 -0
- package/dist/jws-GFcTvvVT.mjs +2291 -0
- package/dist/{lark-cli-provider-7LvtOIF_.mjs → lark-cli-provider-BARgbbmo.mjs} +1 -1
- package/dist/{live-smoke-nvTUPtrv.mjs → live-smoke-BhkBOcH9.mjs} +3 -3
- package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +29 -0
- package/dist/loader-708jrx4Y-BOswuvpe.mjs +5053 -0
- package/dist/main.mjs +56550 -205
- package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +3512 -0
- package/dist/mcp-server.mjs +1 -1
- package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +50 -0
- package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +29 -0
- package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +2 -0
- package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +2 -0
- package/dist/mistral-CaR4DiLu.mjs +28657 -0
- package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +1306 -0
- package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +1282 -0
- package/dist/models-config.runtime-BsU_22xk.mjs +2 -0
- package/dist/multipart-parser-DedmaB5g.mjs +294 -0
- package/dist/oauth-DOJeGfcE.mjs +6392 -0
- package/dist/openai-BDtIh3Ja.mjs +6693 -0
- package/dist/openai-codex-responses-C5EORu31.mjs +664 -0
- package/dist/openai-completions-CR_cS6gX.mjs +669 -0
- package/dist/openai-responses-oGxwZyuC.mjs +184 -0
- package/dist/openai-responses-shared-BixMSDZE.mjs +398 -0
- package/dist/paths-D6msg0S1-C2lYuisN.mjs +189 -0
- package/dist/paths-D92DjaZ--CTOESW2b.mjs +192 -0
- package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +227 -0
- package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +2 -0
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +399 -0
- package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +1456 -0
- package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +61 -0
- package/dist/provider-discovery.runtime-BPzz1PFj.mjs +58 -0
- package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +118 -0
- package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +2 -0
- package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +573 -0
- package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +35449 -0
- package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +219 -0
- package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +117 -0
- package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +1041 -0
- package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +120 -0
- package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +19 -0
- package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +677 -0
- package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +10 -0
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +39 -0
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +2 -0
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +2 -0
- package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +2 -0
- package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +82 -0
- package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +147 -0
- package/dist/src-BgCX0MLG.mjs +813 -0
- package/dist/src-DYbqlAqf.mjs +1177 -0
- package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +344 -0
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +28 -0
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +211 -0
- package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +3061 -0
- package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +1002 -0
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +2950 -0
- package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +2 -0
- package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +2 -0
- package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +2019 -0
- package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +2 -0
- package/dist/transform-messages-DbhIzTxq.mjs +207 -0
- package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +295 -0
- package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +200 -0
- package/package.json +3 -3
- package/dist/rolldown-runtime-wcPFST8Q.mjs +0 -13
- /package/dist/{interactive-init-B6j8j_Ap.mjs → interactive-init-BXQBalNr.mjs} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/pid-alive-DAkBOO_z.js
|
|
3
|
+
function isValidPid(pid) {
|
|
4
|
+
return Number.isInteger(pid) && pid > 0;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Check if a process is a zombie on Linux by reading /proc/<pid>/status.
|
|
8
|
+
* Returns false on non-Linux platforms or if the proc file can't be read.
|
|
9
|
+
*/
|
|
10
|
+
function isZombieProcess(pid) {
|
|
11
|
+
if (process.platform !== "linux") return false;
|
|
12
|
+
try {
|
|
13
|
+
return fs.readFileSync(`/proc/${pid}/status`, "utf8").match(/^State:\s+(\S)/m)?.[1] === "Z";
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function isPidAlive(pid) {
|
|
19
|
+
if (!isValidPid(pid)) return false;
|
|
20
|
+
try {
|
|
21
|
+
process.kill(pid, 0);
|
|
22
|
+
} catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (isZombieProcess(pid)) return false;
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Read the process start time (field 22 "starttime") from /proc/<pid>/stat.
|
|
30
|
+
* Returns the value in clock ticks since system boot, or null on non-Linux
|
|
31
|
+
* platforms or if the proc file can't be read.
|
|
32
|
+
*
|
|
33
|
+
* This is used to detect PID recycling: if two readings for the same PID
|
|
34
|
+
* return different starttimes, the PID has been reused by a different process.
|
|
35
|
+
*/
|
|
36
|
+
function getProcessStartTime(pid) {
|
|
37
|
+
if (process.platform !== "linux") return null;
|
|
38
|
+
if (!isValidPid(pid)) return null;
|
|
39
|
+
try {
|
|
40
|
+
const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
41
|
+
const commEndIndex = stat.lastIndexOf(")");
|
|
42
|
+
if (commEndIndex < 0) return null;
|
|
43
|
+
const fields = stat.slice(commEndIndex + 1).trimStart().split(/\s+/);
|
|
44
|
+
const starttime = Number(fields[19]);
|
|
45
|
+
return Number.isInteger(starttime) && starttime >= 0 ? starttime : null;
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/process-scoped-map-B2cWkYET.js
|
|
52
|
+
function resolveProcessScopedMap(key) {
|
|
53
|
+
const proc = process;
|
|
54
|
+
const existing = proc[key];
|
|
55
|
+
if (existing) return existing;
|
|
56
|
+
const created = /* @__PURE__ */ new Map();
|
|
57
|
+
proc[key] = created;
|
|
58
|
+
return created;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { getProcessStartTime as n, isPidAlive as r, resolveProcessScopedMap as t };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { o as loadPluginManifestRegistry } from "./manifest-registry-_hxKCS2K-CZdeyN0f.mjs";
|
|
2
|
+
import { t as getCachedPluginJitiLoader } from "./jiti-loader-cache-Bat69wam-D6hCxboy.mjs";
|
|
3
|
+
import { a as withProfile } from "./loader-708jrx4Y-BOswuvpe.mjs";
|
|
4
|
+
import { o as resolveDiscoveredProviderPluginIds } from "./plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs";
|
|
5
|
+
import { n as resolvePluginProviders } from "./providers.runtime-Ba7tOlq7-CXkhkzU9.mjs";
|
|
6
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/plugins/provider-discovery.runtime.js
|
|
7
|
+
function createPluginSourceLoader() {
|
|
8
|
+
const loaders = /* @__PURE__ */ new Map();
|
|
9
|
+
return (modulePath) => {
|
|
10
|
+
const jiti = getCachedPluginJitiLoader({
|
|
11
|
+
cache: loaders,
|
|
12
|
+
modulePath,
|
|
13
|
+
importerUrl: import.meta.url,
|
|
14
|
+
jitiFilename: import.meta.url
|
|
15
|
+
});
|
|
16
|
+
return withProfile({
|
|
17
|
+
pluginId: "(direct)",
|
|
18
|
+
source: modulePath
|
|
19
|
+
}, "source-loader", () => jiti(modulePath));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function normalizeDiscoveryModule(value) {
|
|
23
|
+
const resolved = value && typeof value === "object" && "default" in value && value.default !== void 0 ? value.default : value;
|
|
24
|
+
if (Array.isArray(resolved)) return resolved;
|
|
25
|
+
if (resolved && typeof resolved === "object" && "id" in resolved) return [resolved];
|
|
26
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
27
|
+
const record = value;
|
|
28
|
+
if (Array.isArray(record.providers)) return record.providers;
|
|
29
|
+
if (record.provider) return [record.provider];
|
|
30
|
+
}
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
function resolveProviderDiscoveryEntryPlugins(params) {
|
|
34
|
+
const pluginIds = resolveDiscoveredProviderPluginIds(params);
|
|
35
|
+
const pluginIdSet = new Set(pluginIds);
|
|
36
|
+
const records = loadPluginManifestRegistry(params).plugins.filter((plugin) => plugin.providerDiscoverySource && pluginIdSet.has(plugin.id));
|
|
37
|
+
if (records.length === 0) return [];
|
|
38
|
+
if (params.requireCompleteDiscoveryEntryCoverage && records.length < pluginIdSet.size) return [];
|
|
39
|
+
const loadSource = createPluginSourceLoader();
|
|
40
|
+
const providers = [];
|
|
41
|
+
for (const manifest of records) try {
|
|
42
|
+
const moduleExport = loadSource(manifest.providerDiscoverySource);
|
|
43
|
+
providers.push(...normalizeDiscoveryModule(moduleExport).map((provider) => Object.assign({}, provider, { pluginId: manifest.id })));
|
|
44
|
+
} catch {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return providers;
|
|
48
|
+
}
|
|
49
|
+
function resolvePluginDiscoveryProvidersRuntime(params) {
|
|
50
|
+
const entryProviders = resolveProviderDiscoveryEntryPlugins(params);
|
|
51
|
+
if (entryProviders.length > 0) return entryProviders;
|
|
52
|
+
return resolvePluginProviders({
|
|
53
|
+
...params,
|
|
54
|
+
bundledProviderAllowlistCompat: true
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { resolvePluginDiscoveryProvidersRuntime };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { d as resolveProviderRequestCapabilities } from "./io-CH2g3vsv-BOGlLlB8.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/provider-model-compat-CFqcq0it.js
|
|
3
|
+
function isDefaultRouteProvider(provider, ...ids) {
|
|
4
|
+
return provider !== void 0 && ids.includes(provider);
|
|
5
|
+
}
|
|
6
|
+
const KNOWN_LOCAL_STREAMING_USAGE_PROVIDERS = new Set([
|
|
7
|
+
"jan",
|
|
8
|
+
"llama-cpp",
|
|
9
|
+
"llama.cpp",
|
|
10
|
+
"llamacpp",
|
|
11
|
+
"lm-studio",
|
|
12
|
+
"lmstudio",
|
|
13
|
+
"localai",
|
|
14
|
+
"sglang",
|
|
15
|
+
"tabby",
|
|
16
|
+
"tabbyapi",
|
|
17
|
+
"text-generation-webui",
|
|
18
|
+
"vllm"
|
|
19
|
+
]);
|
|
20
|
+
function isKnownLocalStreamingUsageProvider(...ids) {
|
|
21
|
+
return ids.some((id) => id !== void 0 && KNOWN_LOCAL_STREAMING_USAGE_PROVIDERS.has(id.toLowerCase()));
|
|
22
|
+
}
|
|
23
|
+
function resolveOpenAICompletionsCompatDefaults(input) {
|
|
24
|
+
const { provider, endpointClass, knownProviderFamily, supportsNativeStreamingUsageCompat = false, usesExplicitProxyLikeEndpoint = false } = input;
|
|
25
|
+
const isDefaultRoute = endpointClass === "default";
|
|
26
|
+
const usesConfiguredNonOpenAIEndpoint = endpointClass !== "default" && endpointClass !== "openai-public";
|
|
27
|
+
const isMoonshotLike = knownProviderFamily === "moonshot" || knownProviderFamily === "modelstudio" || endpointClass === "moonshot-native" || endpointClass === "modelstudio-native";
|
|
28
|
+
const isZai = endpointClass === "zai-native" || isDefaultRoute && isDefaultRouteProvider(input.provider, "zai");
|
|
29
|
+
const isNonStandard = endpointClass === "cerebras-native" || endpointClass === "chutes-native" || endpointClass === "deepseek-native" || endpointClass === "mistral-public" || endpointClass === "opencode-native" || endpointClass === "xai-native" || isZai || isDefaultRoute && isDefaultRouteProvider(input.provider, "cerebras", "chutes", "deepseek", "opencode", "xai");
|
|
30
|
+
const isOpenRouterLike = input.provider === "openrouter" || endpointClass === "openrouter";
|
|
31
|
+
const usesMaxTokens = endpointClass === "chutes-native" || endpointClass === "mistral-public" || knownProviderFamily === "mistral" || isDefaultRoute && isDefaultRouteProvider(provider, "chutes");
|
|
32
|
+
const supportsKnownLocalStreamingUsage = isKnownLocalStreamingUsageProvider(provider, knownProviderFamily);
|
|
33
|
+
return {
|
|
34
|
+
supportsStore: !isNonStandard && knownProviderFamily !== "mistral" && !usesExplicitProxyLikeEndpoint,
|
|
35
|
+
supportsDeveloperRole: !isNonStandard && !isMoonshotLike && !usesConfiguredNonOpenAIEndpoint,
|
|
36
|
+
supportsReasoningEffort: !isZai && knownProviderFamily !== "mistral" && endpointClass !== "xai-native" && !usesExplicitProxyLikeEndpoint,
|
|
37
|
+
supportsUsageInStreaming: supportsKnownLocalStreamingUsage || !isNonStandard && (!usesConfiguredNonOpenAIEndpoint || supportsNativeStreamingUsageCompat),
|
|
38
|
+
maxTokensField: usesMaxTokens ? "max_tokens" : "max_completion_tokens",
|
|
39
|
+
thinkingFormat: isZai ? "zai" : isOpenRouterLike ? "openrouter" : "openai",
|
|
40
|
+
visibleReasoningDetailTypes: isOpenRouterLike ? ["response.output_text", "response.text"] : [],
|
|
41
|
+
supportsStrictMode: !isZai && !usesConfiguredNonOpenAIEndpoint
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function resolveOpenAICompletionsCompatDefaultsFromCapabilities(input) {
|
|
45
|
+
return resolveOpenAICompletionsCompatDefaults(input);
|
|
46
|
+
}
|
|
47
|
+
function detectOpenAICompletionsCompat(model) {
|
|
48
|
+
const capabilities = resolveProviderRequestCapabilities({
|
|
49
|
+
provider: model.provider,
|
|
50
|
+
api: "openai-completions",
|
|
51
|
+
baseUrl: model.baseUrl,
|
|
52
|
+
capability: "llm",
|
|
53
|
+
transport: "stream",
|
|
54
|
+
modelId: model.id,
|
|
55
|
+
compat: model.compat && typeof model.compat === "object" ? model.compat : void 0
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
capabilities,
|
|
59
|
+
defaults: resolveOpenAICompletionsCompatDefaultsFromCapabilities({
|
|
60
|
+
provider: model.provider,
|
|
61
|
+
...capabilities
|
|
62
|
+
})
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function extractModelCompat(modelOrCompat) {
|
|
66
|
+
if (!modelOrCompat || typeof modelOrCompat !== "object") return;
|
|
67
|
+
if ("compat" in modelOrCompat) {
|
|
68
|
+
const compat = modelOrCompat.compat;
|
|
69
|
+
return compat && typeof compat === "object" ? compat : void 0;
|
|
70
|
+
}
|
|
71
|
+
return modelOrCompat;
|
|
72
|
+
}
|
|
73
|
+
function resolveUnsupportedToolSchemaKeywords(modelOrCompat) {
|
|
74
|
+
const keywords = extractModelCompat(modelOrCompat)?.unsupportedToolSchemaKeywords ?? [];
|
|
75
|
+
return new Set(keywords.filter((keyword) => typeof keyword === "string").map((keyword) => keyword.trim()).filter(Boolean));
|
|
76
|
+
}
|
|
77
|
+
function isOpenAiCompletionsModel(model) {
|
|
78
|
+
return model.api === "openai-completions";
|
|
79
|
+
}
|
|
80
|
+
function isAnthropicMessagesModel(model) {
|
|
81
|
+
return model.api === "anthropic-messages";
|
|
82
|
+
}
|
|
83
|
+
function normalizeAnthropicBaseUrl(baseUrl) {
|
|
84
|
+
return baseUrl.replace(/\/v1\/?$/, "");
|
|
85
|
+
}
|
|
86
|
+
function normalizeModelCompat(model) {
|
|
87
|
+
const baseUrl = model.baseUrl ?? "";
|
|
88
|
+
if (isAnthropicMessagesModel(model) && baseUrl) {
|
|
89
|
+
const normalized = normalizeAnthropicBaseUrl(baseUrl);
|
|
90
|
+
if (normalized !== baseUrl) return {
|
|
91
|
+
...model,
|
|
92
|
+
baseUrl: normalized
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (!isOpenAiCompletionsModel(model)) return model;
|
|
96
|
+
const compat = model.compat ?? void 0;
|
|
97
|
+
const detectedCompatDefaults = baseUrl ? detectOpenAICompletionsCompat(model).defaults : void 0;
|
|
98
|
+
if (!Boolean(detectedCompatDefaults && (!detectedCompatDefaults.supportsDeveloperRole || !detectedCompatDefaults.supportsUsageInStreaming || !detectedCompatDefaults.supportsStrictMode))) return model;
|
|
99
|
+
const forcedDeveloperRole = compat?.supportsDeveloperRole === true;
|
|
100
|
+
const hasStreamingUsageOverride = compat?.supportsUsageInStreaming !== void 0;
|
|
101
|
+
const targetStrictMode = compat?.supportsStrictMode ?? detectedCompatDefaults?.supportsStrictMode;
|
|
102
|
+
if (compat?.supportsDeveloperRole !== void 0 && hasStreamingUsageOverride && compat?.supportsStrictMode !== void 0) return model;
|
|
103
|
+
return {
|
|
104
|
+
...model,
|
|
105
|
+
compat: compat ? {
|
|
106
|
+
...compat,
|
|
107
|
+
supportsDeveloperRole: forcedDeveloperRole || false,
|
|
108
|
+
...hasStreamingUsageOverride ? {} : { supportsUsageInStreaming: detectedCompatDefaults?.supportsUsageInStreaming ?? false },
|
|
109
|
+
supportsStrictMode: targetStrictMode
|
|
110
|
+
} : {
|
|
111
|
+
supportsDeveloperRole: false,
|
|
112
|
+
supportsUsageInStreaming: detectedCompatDefaults?.supportsUsageInStreaming ?? false,
|
|
113
|
+
supportsStrictMode: detectedCompatDefaults?.supportsStrictMode ?? false
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { normalizeModelCompat as n, resolveUnsupportedToolSchemaKeywords as r, detectOpenAICompletionsCompat as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { $ as wrapProviderStreamFn, A as resolveProviderCacheTtlEligibility, B as resolveProviderTextTransforms, C as prepareProviderRuntimeAuth, D as resolveExternalOAuthProfilesWithPlugins, E as resolveExternalAuthProfilesWithPlugins, F as resolveProviderReplayPolicyWithPlugin, G as resolveProviderWebSocketSessionPolicyWithPlugin, H as resolveProviderTransportTurnStateWithPlugin, I as resolveProviderRuntimePlugin, J as sanitizeProviderReplayHistoryWithPlugin, K as resolveProviderXHighThinking, L as resolveProviderStreamFn, M as resolveProviderDefaultThinkingLevel, N as resolveProviderModernModelRef, O as resolveProviderBinaryThinking, P as resolveProviderReasoningOutputModeWithPlugin, Q as validateProviderReplayTurnsWithPlugin, R as resolveProviderSyntheticAuthWithPlugin, S as prepareProviderExtraParams, T as resetProviderRuntimeHookCacheForTest, U as resolveProviderUsageAuthWithPlugin, V as resolveProviderThinkingProfile, W as resolveProviderUsageSnapshotWithPlugin, X as shouldPreferProviderRuntimeResolvedModel, Y as shouldDeferProviderSyntheticProfileAuthWithPlugin, Z as transformProviderSystemPrompt, _ as normalizeProviderModelIdWithPlugin, a as applyProviderResolvedTransportWithPlugin, b as normalizeProviderTransportWithPlugin, c as buildProviderMissingAuthMessageWithPlugin, d as clearProviderRuntimeHookCache, f as createProviderEmbeddingProvider, g as normalizeProviderConfigWithPlugin, h as matchesProviderContextOverflowWithPlugin, i as applyProviderResolvedModelCompatWithPlugins, j as resolveProviderConfigApiKeyWithPlugin, k as resolveProviderBuiltInModelSuppression, l as buildProviderUnknownModelHintWithPlugin, m as inspectProviderToolSchemasWithPlugin, n as applyProviderConfigDefaultsWithPlugin, o as augmentModelCatalogWithProviderPlugins, p as formatProviderAuthProfileApiKeyWithPlugin, q as runProviderDynamicModel, r as applyProviderNativeStreamingUsageCompatWithPlugin, s as buildProviderAuthDoctorHintWithPlugin, t as __testing, u as classifyProviderFailoverReasonWithPlugin, v as normalizeProviderResolvedModelWithPlugin, w as refreshProviderOAuthCredentialWithPlugin, x as prepareProviderDynamicModel, y as normalizeProviderToolSchemasWithPlugin, z as resolveProviderSystemPromptContribution } from "./provider-runtime-CT50mNIX-BwEV6GyO.mjs";
|
|
2
|
+
export { __testing, applyProviderConfigDefaultsWithPlugin, applyProviderNativeStreamingUsageCompatWithPlugin, applyProviderResolvedModelCompatWithPlugins, applyProviderResolvedTransportWithPlugin, augmentModelCatalogWithProviderPlugins, buildProviderAuthDoctorHintWithPlugin, buildProviderMissingAuthMessageWithPlugin, buildProviderUnknownModelHintWithPlugin, classifyProviderFailoverReasonWithPlugin, clearProviderRuntimeHookCache, createProviderEmbeddingProvider, formatProviderAuthProfileApiKeyWithPlugin, inspectProviderToolSchemasWithPlugin, matchesProviderContextOverflowWithPlugin, normalizeProviderConfigWithPlugin, normalizeProviderModelIdWithPlugin, normalizeProviderResolvedModelWithPlugin, normalizeProviderToolSchemasWithPlugin, normalizeProviderTransportWithPlugin, prepareProviderDynamicModel, prepareProviderExtraParams, prepareProviderRuntimeAuth, refreshProviderOAuthCredentialWithPlugin, resetProviderRuntimeHookCacheForTest, resolveExternalAuthProfilesWithPlugins, resolveExternalOAuthProfilesWithPlugins, resolveProviderBinaryThinking, resolveProviderBuiltInModelSuppression, resolveProviderCacheTtlEligibility, resolveProviderConfigApiKeyWithPlugin, resolveProviderDefaultThinkingLevel, resolveProviderModernModelRef, resolveProviderReasoningOutputModeWithPlugin, resolveProviderReplayPolicyWithPlugin, resolveProviderRuntimePlugin, resolveProviderStreamFn, resolveProviderSyntheticAuthWithPlugin, resolveProviderSystemPromptContribution, resolveProviderTextTransforms, resolveProviderThinkingProfile, resolveProviderTransportTurnStateWithPlugin, resolveProviderUsageAuthWithPlugin, resolveProviderUsageSnapshotWithPlugin, resolveProviderWebSocketSessionPolicyWithPlugin, resolveProviderXHighThinking, runProviderDynamicModel, sanitizeProviderReplayHistoryWithPlugin, shouldDeferProviderSyntheticProfileAuthWithPlugin, shouldPreferProviderRuntimeResolvedModel, transformProviderSystemPrompt, validateProviderReplayTurnsWithPlugin, wrapProviderStreamFn };
|