@agentchatme/openclaw 0.7.821 → 0.7.82111
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 +17 -0
- package/dist/index.cjs +39 -8
- 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 +39 -8
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.cjs +39 -8
- 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 +39 -8
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +15 -2
- 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/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentchatChannelConfig } from './setup-entry-
|
|
2
|
-
export { a as AgentchatResolvedAccount, b as agentchatChannelEntry, c as agentchatPlugin, d as agentchatSetupEntry, c as agentchatSetupPlugin, b as default, p as parseChannelConfig } from './setup-entry-
|
|
1
|
+
import { A as AgentchatChannelConfig } from './setup-entry-BuDCZ44W.cjs';
|
|
2
|
+
export { a as AgentchatResolvedAccount, b as agentchatChannelEntry, c as agentchatPlugin, d as agentchatSetupEntry, c as agentchatSetupPlugin, b as default, p as parseChannelConfig } from './setup-entry-BuDCZ44W.cjs';
|
|
3
3
|
export { hasAgentChatConfiguredState } from './configured-state.cjs';
|
|
4
4
|
import { WebSocket } from 'ws';
|
|
5
5
|
import 'openclaw/plugin-sdk/channel-core';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentchatChannelConfig } from './setup-entry-
|
|
2
|
-
export { a as AgentchatResolvedAccount, b as agentchatChannelEntry, c as agentchatPlugin, d as agentchatSetupEntry, c as agentchatSetupPlugin, b as default, p as parseChannelConfig } from './setup-entry-
|
|
1
|
+
import { A as AgentchatChannelConfig } from './setup-entry-BuDCZ44W.js';
|
|
2
|
+
export { a as AgentchatResolvedAccount, b as agentchatChannelEntry, c as agentchatPlugin, d as agentchatSetupEntry, c as agentchatSetupPlugin, b as default, p as parseChannelConfig } from './setup-entry-BuDCZ44W.js';
|
|
3
3
|
export { hasAgentChatConfiguredState } from './configured-state.js';
|
|
4
4
|
import { WebSocket } from 'ws';
|
|
5
5
|
import 'openclaw/plugin-sdk/channel-core';
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,28 @@ function classifyNetworkError(err3) {
|
|
|
118
118
|
return "retry-transient";
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
// src/version.ts
|
|
122
|
+
var PACKAGE_VERSION = "0.7.82111";
|
|
123
|
+
|
|
124
|
+
// src/client-identity.ts
|
|
125
|
+
var AGENTCHAT_CLIENT_NAME = "openclaw";
|
|
126
|
+
var AGENTCHAT_CLIENT_HEADERS = {
|
|
127
|
+
"X-AgentChat-Client": AGENTCHAT_CLIENT_NAME,
|
|
128
|
+
"X-AgentChat-Client-Version": PACKAGE_VERSION
|
|
129
|
+
};
|
|
130
|
+
function withAgentChatClientIdentity(fetchImpl) {
|
|
131
|
+
return (async (input, init) => {
|
|
132
|
+
const headers = new Headers(
|
|
133
|
+
typeof Request !== "undefined" && input instanceof Request ? input.headers : void 0
|
|
134
|
+
);
|
|
135
|
+
new Headers(init?.headers).forEach((value, key2) => headers.set(key2, value));
|
|
136
|
+
for (const [key2, value] of Object.entries(AGENTCHAT_CLIENT_HEADERS)) {
|
|
137
|
+
headers.set(key2, value);
|
|
138
|
+
}
|
|
139
|
+
return fetchImpl(input, { ...init, headers });
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
121
143
|
// src/setup-client.ts
|
|
122
144
|
var DEFAULT_API_BASE = "https://api.agentchat.me";
|
|
123
145
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -137,7 +159,8 @@ async function validateApiKey(apiKey, opts = {}) {
|
|
|
137
159
|
method: "GET",
|
|
138
160
|
headers: {
|
|
139
161
|
Authorization: `Bearer ${apiKey}`,
|
|
140
|
-
Accept: "application/json"
|
|
162
|
+
Accept: "application/json",
|
|
163
|
+
...AGENTCHAT_CLIENT_HEADERS
|
|
141
164
|
},
|
|
142
165
|
signal: controller.signal
|
|
143
166
|
});
|
|
@@ -279,7 +302,11 @@ async function post(path3, body, opts) {
|
|
|
279
302
|
try {
|
|
280
303
|
const res = await fetchImpl(url, {
|
|
281
304
|
method: "POST",
|
|
282
|
-
headers: {
|
|
305
|
+
headers: {
|
|
306
|
+
"content-type": "application/json",
|
|
307
|
+
accept: "application/json",
|
|
308
|
+
...AGENTCHAT_CLIENT_HEADERS
|
|
309
|
+
},
|
|
283
310
|
body: JSON.stringify(body),
|
|
284
311
|
signal: controller.signal
|
|
285
312
|
});
|
|
@@ -1199,7 +1226,12 @@ var AgentchatWsClient = class {
|
|
|
1199
1226
|
this.applyEvent({ type: "SOCKET_OPEN", now });
|
|
1200
1227
|
try {
|
|
1201
1228
|
this.ws.send(
|
|
1202
|
-
JSON.stringify({
|
|
1229
|
+
JSON.stringify({
|
|
1230
|
+
type: "hello",
|
|
1231
|
+
api_key: this.config.apiKey,
|
|
1232
|
+
client: AGENTCHAT_CLIENT_NAME,
|
|
1233
|
+
client_version: PACKAGE_VERSION
|
|
1234
|
+
})
|
|
1203
1235
|
);
|
|
1204
1236
|
} catch (err3) {
|
|
1205
1237
|
this.emitError(
|
|
@@ -1878,9 +1910,6 @@ var CircuitBreaker = class {
|
|
|
1878
1910
|
}
|
|
1879
1911
|
};
|
|
1880
1912
|
|
|
1881
|
-
// src/version.ts
|
|
1882
|
-
var PACKAGE_VERSION = "0.7.821";
|
|
1883
|
-
|
|
1884
1913
|
// src/outbound.ts
|
|
1885
1914
|
var DEFAULT_RETRY_POLICY = {
|
|
1886
1915
|
maxAttempts: 4,
|
|
@@ -1989,7 +2018,8 @@ var OutboundAdapter = class {
|
|
|
1989
2018
|
const headers = {
|
|
1990
2019
|
"authorization": `Bearer ${this.config.apiKey}`,
|
|
1991
2020
|
"content-type": "application/json",
|
|
1992
|
-
"user-agent": `@agentchatme/openclaw/${PACKAGE_VERSION} (+attempt=${attempt})
|
|
2021
|
+
"user-agent": `@agentchatme/openclaw/${PACKAGE_VERSION} (+attempt=${attempt})`,
|
|
2022
|
+
...AGENTCHAT_CLIENT_HEADERS
|
|
1993
2023
|
};
|
|
1994
2024
|
let res;
|
|
1995
2025
|
try {
|
|
@@ -2507,7 +2537,8 @@ function getClient({ accountId, config, options }) {
|
|
|
2507
2537
|
const client = new AgentChatClient({
|
|
2508
2538
|
apiKey: config.apiKey,
|
|
2509
2539
|
baseUrl: config.apiBase,
|
|
2510
|
-
...options
|
|
2540
|
+
...options,
|
|
2541
|
+
fetch: withAgentChatClientIdentity(options?.fetch ?? globalThis.fetch)
|
|
2511
2542
|
});
|
|
2512
2543
|
cache.set(accountId, {
|
|
2513
2544
|
client,
|