@agentchatme/openclaw 0.7.82 → 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 +9 -0
- package/dist/index.cjs +108 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +108 -75
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.cjs +108 -75
- package/dist/setup-entry.cjs.map +1 -1
- package/dist/setup-entry.d.cts +1 -1
- package/dist/setup-entry.d.ts +1 -1
- package/dist/setup-entry.js +108 -75
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/{setup-entry-Dtj6vwDY.d.cts → setup-entry-BuDCZ44W.d.cts} +1 -1
- package/dist/{setup-entry-Dtj6vwDY.d.ts → setup-entry-BuDCZ44W.d.ts} +1 -1
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: {
|
|
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({
|
|
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.82";
|
|
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,
|
|
@@ -4885,75 +4916,77 @@ function profileToEntry(agent) {
|
|
|
4885
4916
|
...agent.avatar_url ? { avatarUrl: agent.avatar_url } : {}
|
|
4886
4917
|
};
|
|
4887
4918
|
}
|
|
4888
|
-
var
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
return [];
|
|
4911
|
-
}
|
|
4912
|
-
},
|
|
4913
|
-
async listPeersLive(params) {
|
|
4914
|
-
return this.listPeers(params);
|
|
4915
|
-
},
|
|
4916
|
-
async listGroups({ cfg, accountId, query, limit }) {
|
|
4917
|
-
const config = resolveAccount(cfg, accountId);
|
|
4918
|
-
if (!config) return [];
|
|
4919
|
-
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4920
|
-
try {
|
|
4921
|
-
const convs = await client.listConversations();
|
|
4922
|
-
const q = (query ?? "").trim().toLowerCase();
|
|
4923
|
-
const groupRows = convs.filter((c) => c.type === "group");
|
|
4924
|
-
const filtered = q ? groupRows.filter((c) => (c.group_name ?? "").toLowerCase().includes(q)) : groupRows;
|
|
4925
|
-
const cap = limit ?? 50;
|
|
4926
|
-
return filtered.slice(0, cap).map((c) => ({
|
|
4927
|
-
kind: "group",
|
|
4928
|
-
id: c.id,
|
|
4929
|
-
name: c.group_name ?? "Untitled group",
|
|
4930
|
-
...c.group_avatar_url ? { avatarUrl: c.group_avatar_url } : {}
|
|
4931
|
-
}));
|
|
4932
|
-
} catch {
|
|
4933
|
-
return [];
|
|
4934
|
-
}
|
|
4935
|
-
},
|
|
4936
|
-
async listGroupsLive(params) {
|
|
4937
|
-
return this.listGroups(params);
|
|
4938
|
-
},
|
|
4939
|
-
async listGroupMembers({ cfg, accountId, groupId, limit }) {
|
|
4940
|
-
const config = resolveAccount(cfg, accountId);
|
|
4941
|
-
if (!config) return [];
|
|
4942
|
-
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4943
|
-
try {
|
|
4944
|
-
const group = await client.getGroup(groupId);
|
|
4945
|
-
const cap = limit ?? 256;
|
|
4946
|
-
return group.members.slice(0, cap).map((m) => ({
|
|
4947
|
-
kind: "user",
|
|
4948
|
-
id: m.handle,
|
|
4949
|
-
handle: m.handle,
|
|
4950
|
-
name: m.display_name ?? m.handle
|
|
4951
|
-
}));
|
|
4952
|
-
} catch {
|
|
4953
|
-
return [];
|
|
4954
|
-
}
|
|
4919
|
+
var directorySelf = async ({ cfg, accountId }) => {
|
|
4920
|
+
const config = resolveAccount(cfg, accountId);
|
|
4921
|
+
if (!config) return null;
|
|
4922
|
+
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4923
|
+
try {
|
|
4924
|
+
const me = await client.getMe();
|
|
4925
|
+
return profileToEntry(me);
|
|
4926
|
+
} catch {
|
|
4927
|
+
return null;
|
|
4928
|
+
}
|
|
4929
|
+
};
|
|
4930
|
+
var listPeers = async ({ cfg, accountId, query, limit }) => {
|
|
4931
|
+
const config = resolveAccount(cfg, accountId);
|
|
4932
|
+
if (!config) return [];
|
|
4933
|
+
const q = (query ?? "").trim();
|
|
4934
|
+
if (q.length < 2) return [];
|
|
4935
|
+
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4936
|
+
try {
|
|
4937
|
+
const result = await client.searchAgents(q, { limit: limit ?? 20 });
|
|
4938
|
+
return result.agents.map(profileToEntry);
|
|
4939
|
+
} catch {
|
|
4940
|
+
return [];
|
|
4955
4941
|
}
|
|
4956
4942
|
};
|
|
4943
|
+
var listGroups = async ({ cfg, accountId, query, limit }) => {
|
|
4944
|
+
const config = resolveAccount(cfg, accountId);
|
|
4945
|
+
if (!config) return [];
|
|
4946
|
+
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4947
|
+
try {
|
|
4948
|
+
const convs = await client.listConversations();
|
|
4949
|
+
const q = (query ?? "").trim().toLowerCase();
|
|
4950
|
+
const groupRows = convs.filter((c) => c.type === "group");
|
|
4951
|
+
const filtered = q ? groupRows.filter((c) => (c.group_name ?? "").toLowerCase().includes(q)) : groupRows;
|
|
4952
|
+
const cap = limit ?? 50;
|
|
4953
|
+
return filtered.slice(0, cap).map((c) => ({
|
|
4954
|
+
kind: "group",
|
|
4955
|
+
id: c.id,
|
|
4956
|
+
name: c.group_name ?? "Untitled group",
|
|
4957
|
+
...c.group_avatar_url ? { avatarUrl: c.group_avatar_url } : {}
|
|
4958
|
+
}));
|
|
4959
|
+
} catch {
|
|
4960
|
+
return [];
|
|
4961
|
+
}
|
|
4962
|
+
};
|
|
4963
|
+
var listGroupMembers = async ({ cfg, accountId, groupId, limit }) => {
|
|
4964
|
+
const config = resolveAccount(cfg, accountId);
|
|
4965
|
+
if (!config) return [];
|
|
4966
|
+
const client = getClient({ accountId: accountId ?? "default", config });
|
|
4967
|
+
try {
|
|
4968
|
+
const group = await client.getGroup(groupId);
|
|
4969
|
+
const cap = limit ?? 256;
|
|
4970
|
+
return group.members.slice(0, cap).map((m) => ({
|
|
4971
|
+
kind: "user",
|
|
4972
|
+
id: m.handle,
|
|
4973
|
+
handle: m.handle,
|
|
4974
|
+
name: m.display_name ?? m.handle
|
|
4975
|
+
}));
|
|
4976
|
+
} catch {
|
|
4977
|
+
return [];
|
|
4978
|
+
}
|
|
4979
|
+
};
|
|
4980
|
+
var agentchatDirectoryAdapter = {
|
|
4981
|
+
self: directorySelf,
|
|
4982
|
+
listPeers,
|
|
4983
|
+
// `*Live` are literal aliases of the base impls — never `this.listPeers!`,
|
|
4984
|
+
// which breaks when the runtime forwards the method detached.
|
|
4985
|
+
listPeersLive: listPeers,
|
|
4986
|
+
listGroups,
|
|
4987
|
+
listGroupsLive: listGroups,
|
|
4988
|
+
listGroupMembers
|
|
4989
|
+
};
|
|
4957
4990
|
|
|
4958
4991
|
// src/binding/resolver.ts
|
|
4959
4992
|
function resolveAccount2(cfg, accountId) {
|