@openclaw/anthropic-vertex-provider 2026.7.2-beta.7 → 2026.8.1-beta.3
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/provider-catalog.js +1 -1
- package/dist/region.js +8 -12
- package/dist/stream-runtime.js +4 -2
- package/package.json +4 -4
package/dist/provider-catalog.js
CHANGED
|
@@ -253,7 +253,7 @@ function normalizeAnthropicVertexResolvedModel(modelId, model) {
|
|
|
253
253
|
function buildAnthropicVertexProvider(params) {
|
|
254
254
|
const region = resolveAnthropicVertexRegion(params?.env);
|
|
255
255
|
return {
|
|
256
|
-
baseUrl: normalizeLowercaseStringOrEmpty(region) === "global" ? "https://aiplatform.googleapis.com" : `https://${region}-aiplatform.googleapis.com`,
|
|
256
|
+
baseUrl: normalizeLowercaseStringOrEmpty(region) === "global" ? "https://aiplatform.googleapis.com" : region === "us" || region === "eu" ? `https://aiplatform.${region}.rep.googleapis.com` : `https://${region}-aiplatform.googleapis.com`,
|
|
257
257
|
api: "anthropic-messages",
|
|
258
258
|
apiKey: GCP_VERTEX_CREDENTIALS_MARKER,
|
|
259
259
|
models: buildAnthropicVertexCatalog(region, params?.nowMs ?? Date.now())
|
package/dist/region.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { homedir, platform } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { resolveProviderEndpoint } from "openclaw/plugin-sdk/provider-http";
|
|
@@ -12,18 +12,14 @@ const ANTHROPIC_VERTEX_DEFAULT_REGION = "global";
|
|
|
12
12
|
const ANTHROPIC_VERTEX_REGION_RE = /^[a-z0-9-]+$/;
|
|
13
13
|
const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
14
14
|
const ANTHROPIC_VERTEX_ADC_FILE_MAX_BYTES = 1024 * 1024;
|
|
15
|
-
function normalizeOptionalSecretInput(value) {
|
|
16
|
-
if (typeof value !== "string") return;
|
|
17
|
-
return value.trim() || void 0;
|
|
18
|
-
}
|
|
19
15
|
/** Resolve the configured Vertex region, defaulting to global. */
|
|
20
16
|
function resolveAnthropicVertexRegion(env = process.env) {
|
|
21
|
-
const region =
|
|
17
|
+
const region = normalizeOptionalString(env.GOOGLE_CLOUD_LOCATION) || normalizeOptionalString(env.CLOUD_ML_REGION);
|
|
22
18
|
return region && ANTHROPIC_VERTEX_REGION_RE.test(region) ? region : ANTHROPIC_VERTEX_DEFAULT_REGION;
|
|
23
19
|
}
|
|
24
20
|
/** Resolve the Vertex project id from explicit env or ADC files. */
|
|
25
21
|
function resolveAnthropicVertexProjectId(env = process.env) {
|
|
26
|
-
return
|
|
22
|
+
return normalizeOptionalString(env.ANTHROPIC_VERTEX_PROJECT_ID) || normalizeOptionalString(env.GOOGLE_CLOUD_PROJECT) || normalizeOptionalString(env.GOOGLE_CLOUD_PROJECT_ID) || resolveAnthropicVertexProjectIdFromAdc(env);
|
|
27
23
|
}
|
|
28
24
|
/** Extract a Vertex region from a provider base URL when possible. */
|
|
29
25
|
function resolveAnthropicVertexRegionFromBaseUrl(baseUrl) {
|
|
@@ -35,17 +31,17 @@ function resolveAnthropicVertexClientRegion(params) {
|
|
|
35
31
|
return resolveAnthropicVertexRegionFromBaseUrl(params?.baseUrl) || resolveAnthropicVertexRegion(params?.env);
|
|
36
32
|
}
|
|
37
33
|
function hasAnthropicVertexMetadataServerAdc(env = process.env) {
|
|
38
|
-
const explicitMetadataOptIn =
|
|
34
|
+
const explicitMetadataOptIn = normalizeOptionalString(env.ANTHROPIC_VERTEX_USE_GCP_METADATA);
|
|
39
35
|
return explicitMetadataOptIn === "1" || normalizeLowercaseStringOrEmpty(explicitMetadataOptIn) === "true";
|
|
40
36
|
}
|
|
41
37
|
function resolveAnthropicVertexHomeDir(env = process.env) {
|
|
42
|
-
return
|
|
38
|
+
return normalizeOptionalString(env.HOME) || normalizeOptionalString(env.USERPROFILE) || homedir();
|
|
43
39
|
}
|
|
44
40
|
function resolveAnthropicVertexDefaultAdcPath(env = process.env) {
|
|
45
|
-
return platform() === "win32" ? join(
|
|
41
|
+
return platform() === "win32" ? join(normalizeOptionalString(env.APPDATA) ?? join(resolveAnthropicVertexHomeDir(env), "AppData", "Roaming"), "gcloud", "application_default_credentials.json") : join(resolveAnthropicVertexHomeDir(env), ".config", "gcloud", "application_default_credentials.json");
|
|
46
42
|
}
|
|
47
43
|
function resolveAnthropicVertexAdcCredentialsPathCandidate(env = process.env) {
|
|
48
|
-
const explicit =
|
|
44
|
+
const explicit = normalizeOptionalString(env.GOOGLE_APPLICATION_CREDENTIALS);
|
|
49
45
|
if (explicit) return explicit;
|
|
50
46
|
return resolveAnthropicVertexDefaultAdcPath(env);
|
|
51
47
|
}
|
|
@@ -71,7 +67,7 @@ function resolveAnthropicVertexProjectIdFromAdc(env = process.env) {
|
|
|
71
67
|
try {
|
|
72
68
|
const parsed = resolveAnthropicVertexAdcCredentials(env);
|
|
73
69
|
if (!parsed) return;
|
|
74
|
-
return
|
|
70
|
+
return normalizeOptionalString(parsed.project_id) || normalizeOptionalString(parsed.quota_project_id);
|
|
75
71
|
} catch {
|
|
76
72
|
return;
|
|
77
73
|
}
|
package/dist/stream-runtime.js
CHANGED
|
@@ -3,6 +3,7 @@ import { requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdenti
|
|
|
3
3
|
import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
|
|
4
4
|
import { GoogleAuth } from "google-auth-library";
|
|
5
5
|
import { clampThinkingLevel, stream } from "openclaw/plugin-sdk/llm";
|
|
6
|
+
import { copyProviderAcceptanceObserver } from "openclaw/plugin-sdk/provider-transport-runtime";
|
|
6
7
|
import { EnvHttpProxyAgent, fetch } from "undici";
|
|
7
8
|
//#region extensions/anthropic-vertex/stream-runtime.ts
|
|
8
9
|
/**
|
|
@@ -98,7 +99,7 @@ function createAnthropicVertexStreamFn(projectId, region, baseURL, deps = defaul
|
|
|
98
99
|
const requestedReasoning = options?.reasoning;
|
|
99
100
|
const reasoning = requestedReasoning === "off" && mandatoryAdaptiveThinking ? "low" : requestedReasoning ?? (mandatoryAdaptiveThinking || adaptiveDefaultClaude5 ? "high" : void 0);
|
|
100
101
|
const temperature = mandatoryAdaptiveThinking || Boolean(reasoning && reasoning !== "off" && supportsAdaptiveThinking(contractModelId)) || isClaudeOpus47OrNewerModel(contractModelId) || isClaudeMythos5Model(contractModelId) ? void 0 : options?.temperature;
|
|
101
|
-
const opts = {
|
|
102
|
+
const opts = copyProviderAcceptanceObserver(options, {
|
|
102
103
|
client,
|
|
103
104
|
...temperature !== void 0 ? { temperature } : {},
|
|
104
105
|
...maxTokens !== void 0 ? { maxTokens } : {},
|
|
@@ -107,9 +108,10 @@ function createAnthropicVertexStreamFn(projectId, region, baseURL, deps = defaul
|
|
|
107
108
|
sessionId: options?.sessionId,
|
|
108
109
|
headers: options?.headers,
|
|
109
110
|
onPayload: options?.onPayload,
|
|
111
|
+
onResponse: options?.onResponse,
|
|
110
112
|
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
111
113
|
metadata: options?.metadata
|
|
112
|
-
};
|
|
114
|
+
});
|
|
113
115
|
if (reasoning === "off") opts.thinkingEnabled = false;
|
|
114
116
|
else if (reasoning) if (supportsAdaptiveThinking(contractModelId)) {
|
|
115
117
|
opts.thinkingEnabled = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/anthropic-vertex-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.3",
|
|
4
4
|
"description": "OpenClaw Anthropic Vertex provider plugin for Claude models on Google Vertex AI.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"minHostVersion": ">=2026.5.12-beta.1"
|
|
23
23
|
},
|
|
24
24
|
"compat": {
|
|
25
|
-
"pluginApi": ">=2026.
|
|
25
|
+
"pluginApi": ">=2026.8.1-beta.3"
|
|
26
26
|
},
|
|
27
27
|
"build": {
|
|
28
|
-
"openclawVersion": "2026.
|
|
28
|
+
"openclawVersion": "2026.8.1-beta.3",
|
|
29
29
|
"bundledDist": false
|
|
30
30
|
},
|
|
31
31
|
"release": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"openclaw": ">=2026.
|
|
45
|
+
"openclaw": ">=2026.8.1-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"openclaw": {
|