@agentchatme/openclaw 0.6.19 → 0.7.1

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.
@@ -9,7 +9,7 @@ import { WebSocket } from 'ws';
9
9
  import { dispatchInboundDirectDmWithRuntime } from 'openclaw/plugin-sdk/direct-dm';
10
10
  import { resolveInboundRouteEnvelopeBuilderWithRuntime } from 'openclaw/plugin-sdk/inbound-envelope';
11
11
  import { recordInboundSessionAndDispatchReply } from 'openclaw/plugin-sdk/inbound-reply-dispatch';
12
- import { AgentChatClient } from '@agentchatme/agentchat';
12
+ import { AgentChatClient } from 'agentchatme';
13
13
  import { Type } from '@sinclair/typebox';
14
14
 
15
15
  // src/channel.setup.ts
@@ -1846,7 +1846,7 @@ var CircuitBreaker = class {
1846
1846
  };
1847
1847
 
1848
1848
  // src/version.ts
1849
- var PACKAGE_VERSION = "0.6.19";
1849
+ var PACKAGE_VERSION = "0.7.1";
1850
1850
 
1851
1851
  // src/outbound.ts
1852
1852
  var DEFAULT_RETRY_POLICY = {
@@ -3225,6 +3225,63 @@ var ACCOUNT_PARAM = Type.Optional(
3225
3225
  );
3226
3226
  var agentchatAgentToolsFactory = ({ cfg }) => {
3227
3227
  const tools = [
3228
+ // ─── Cross-channel send ──────────────────────────────────────────────
3229
+ //
3230
+ // OpenClaw's core `message` tool is the conventional sender — and is
3231
+ // the right pick when the current turn was triggered by an AgentChat
3232
+ // inbound. But when the inbound arrived on a different channel
3233
+ // (Telegram, Slack, Discord, the OpenClaw CLI), the per-turn `message`
3234
+ // tool's `fallbackChannel` is bound to that channel, so an implicit
3235
+ // `message({to, text})` call from the model fall-back-routes to the
3236
+ // wrong outbound and gets rejected by that channel's target
3237
+ // normalization. The model paraphrases the rejection back to the
3238
+ // operator as "Telegram is not letting me…".
3239
+ //
3240
+ // This tool sidesteps the binding entirely. ChannelAgentTools are not
3241
+ // gated by `currentChannelProvider`, so this is visible and invokable
3242
+ // on every turn regardless of inbound source. The execute path runs
3243
+ // through our cached SDK client against the AgentChat REST API — no
3244
+ // OpenClaw channel routing in scope, no implicit fallback, no
3245
+ // requireExplicitMessageTarget gate. Reach for this whenever the
3246
+ // operator says "message X on AgentChat" or the model otherwise needs
3247
+ // a deterministic, channel-agnostic AgentChat send.
3248
+ tool({
3249
+ name: "agentchat_send_message",
3250
+ description: "Send a peer-to-peer message on AgentChat to another agent by handle. Use this whenever the operator asks you to message someone on AgentChat, regardless of which channel the request arrived on (Telegram, Slack, the OpenClaw CLI, AgentChat itself \u2014 anywhere). This is the right tool for cross-channel sends because it is not bound to the inbound channel; the shared `message` tool defaults its destination to the inbound channel and will route incorrectly when the operator asks you to send on AgentChat from a different channel's turn. Returns the new message id once delivered.",
3251
+ parameters: Type.Object({
3252
+ handle: Type.String({
3253
+ minLength: 3,
3254
+ maxLength: 31,
3255
+ description: "The recipient agent's handle, with or without the leading @. Lowercase letters, digits, and hyphens; must start with a letter; 3-30 chars after stripping the @."
3256
+ }),
3257
+ message: Type.String({
3258
+ minLength: 1,
3259
+ maxLength: 8e3,
3260
+ description: "The message text to send. Plain text \u2014 the platform is a transport, not a renderer."
3261
+ }),
3262
+ replyToMessageId: Type.Optional(
3263
+ Type.String({
3264
+ description: "Optional id of an existing message you are replying to. Threads the response so the recipient's client can render it as a reply."
3265
+ })
3266
+ ),
3267
+ account: ACCOUNT_PARAM
3268
+ }),
3269
+ execute: async (_id, p) => {
3270
+ const r = clientFor(cfg, p.account);
3271
+ if ("error" in r) return err2(r.error);
3272
+ const handle = stripAt(p.handle);
3273
+ try {
3274
+ const result = await r.client.sendMessage({
3275
+ to: handle,
3276
+ content: { text: p.message },
3277
+ ...p.replyToMessageId ? { metadata: { reply_to: p.replyToMessageId } } : {}
3278
+ });
3279
+ return ok2(`sent to @${handle} \u2014 message ${result.message.id}`);
3280
+ } catch (e) {
3281
+ return err2(toMsg(e));
3282
+ }
3283
+ }
3284
+ }),
3228
3285
  // ─── Contacts ─────────────────────────────────────────────────────────
3229
3286
  tool({
3230
3287
  name: "agentchat_add_contact",