@agentchatme/openclaw 0.7.821 → 0.7.8211

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/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  This package is in pre-1.0 development.
9
9
 
10
+ ## 0.7.8211 — 2026-07-27
11
+
12
+ ### Added — product analytics identity
13
+
14
+ - Native REST, setup, and WebSocket traffic now identifies itself as
15
+ `openclaw/<plugin version>`.
16
+ - Requests routed through the TypeScript SDK receive the same identity, so
17
+ product usage is attributed to OpenClaw instead of the underlying SDK.
18
+
10
19
  ## 0.7.81 — 2026-07-10
11
20
 
12
21
  ### Changed: the agent now decides whether to reply (reply gate + message-tool-only delivery)
package/dist/index.cjs CHANGED
@@ -145,6 +145,28 @@ function classifyNetworkError(err3) {
145
145
  return "retry-transient";
146
146
  }
147
147
 
148
+ // src/version.ts
149
+ var PACKAGE_VERSION = "0.7.8211";
150
+
151
+ // src/client-identity.ts
152
+ var AGENTCHAT_CLIENT_NAME = "openclaw";
153
+ var AGENTCHAT_CLIENT_HEADERS = {
154
+ "X-AgentChat-Client": AGENTCHAT_CLIENT_NAME,
155
+ "X-AgentChat-Client-Version": PACKAGE_VERSION
156
+ };
157
+ function withAgentChatClientIdentity(fetchImpl) {
158
+ return (async (input, init) => {
159
+ const headers = new Headers(
160
+ typeof Request !== "undefined" && input instanceof Request ? input.headers : void 0
161
+ );
162
+ new Headers(init?.headers).forEach((value, key2) => headers.set(key2, value));
163
+ for (const [key2, value] of Object.entries(AGENTCHAT_CLIENT_HEADERS)) {
164
+ headers.set(key2, value);
165
+ }
166
+ return fetchImpl(input, { ...init, headers });
167
+ });
168
+ }
169
+
148
170
  // src/setup-client.ts
149
171
  var DEFAULT_API_BASE = "https://api.agentchat.me";
150
172
  var DEFAULT_TIMEOUT_MS = 1e4;
@@ -164,7 +186,8 @@ async function validateApiKey(apiKey, opts = {}) {
164
186
  method: "GET",
165
187
  headers: {
166
188
  Authorization: `Bearer ${apiKey}`,
167
- Accept: "application/json"
189
+ Accept: "application/json",
190
+ ...AGENTCHAT_CLIENT_HEADERS
168
191
  },
169
192
  signal: controller.signal
170
193
  });
@@ -306,7 +329,11 @@ async function post(path3, body, opts) {
306
329
  try {
307
330
  const res = await fetchImpl(url, {
308
331
  method: "POST",
309
- headers: { "content-type": "application/json", accept: "application/json" },
332
+ headers: {
333
+ "content-type": "application/json",
334
+ accept: "application/json",
335
+ ...AGENTCHAT_CLIENT_HEADERS
336
+ },
310
337
  body: JSON.stringify(body),
311
338
  signal: controller.signal
312
339
  });
@@ -1226,7 +1253,12 @@ var AgentchatWsClient = class {
1226
1253
  this.applyEvent({ type: "SOCKET_OPEN", now });
1227
1254
  try {
1228
1255
  this.ws.send(
1229
- JSON.stringify({ type: "hello", api_key: this.config.apiKey })
1256
+ JSON.stringify({
1257
+ type: "hello",
1258
+ api_key: this.config.apiKey,
1259
+ client: AGENTCHAT_CLIENT_NAME,
1260
+ client_version: PACKAGE_VERSION
1261
+ })
1230
1262
  );
1231
1263
  } catch (err3) {
1232
1264
  this.emitError(
@@ -1905,9 +1937,6 @@ var CircuitBreaker = class {
1905
1937
  }
1906
1938
  };
1907
1939
 
1908
- // src/version.ts
1909
- var PACKAGE_VERSION = "0.7.821";
1910
-
1911
1940
  // src/outbound.ts
1912
1941
  var DEFAULT_RETRY_POLICY = {
1913
1942
  maxAttempts: 4,
@@ -2016,7 +2045,8 @@ var OutboundAdapter = class {
2016
2045
  const headers = {
2017
2046
  "authorization": `Bearer ${this.config.apiKey}`,
2018
2047
  "content-type": "application/json",
2019
- "user-agent": `@agentchatme/openclaw/${PACKAGE_VERSION} (+attempt=${attempt})`
2048
+ "user-agent": `@agentchatme/openclaw/${PACKAGE_VERSION} (+attempt=${attempt})`,
2049
+ ...AGENTCHAT_CLIENT_HEADERS
2020
2050
  };
2021
2051
  let res;
2022
2052
  try {
@@ -2534,7 +2564,8 @@ function getClient({ accountId, config, options }) {
2534
2564
  const client = new agentchatme.AgentChatClient({
2535
2565
  apiKey: config.apiKey,
2536
2566
  baseUrl: config.apiBase,
2537
- ...options
2567
+ ...options,
2568
+ fetch: withAgentChatClientIdentity(options?.fetch ?? globalThis.fetch)
2538
2569
  });
2539
2570
  cache.set(accountId, {
2540
2571
  client,