@agentchatme/openclaw 0.6.20 → 0.7.2

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/index.js CHANGED
@@ -1854,7 +1854,7 @@ var CircuitBreaker = class {
1854
1854
  };
1855
1855
 
1856
1856
  // src/version.ts
1857
- var PACKAGE_VERSION = "0.6.20";
1857
+ var PACKAGE_VERSION = "0.7.2";
1858
1858
 
1859
1859
  // src/outbound.ts
1860
1860
  var DEFAULT_RETRY_POLICY = {
@@ -3233,6 +3233,71 @@ var ACCOUNT_PARAM = Type.Optional(
3233
3233
  );
3234
3234
  var agentchatAgentToolsFactory = ({ cfg }) => {
3235
3235
  const tools = [
3236
+ // ─── Cross-channel send ──────────────────────────────────────────────
3237
+ //
3238
+ // OpenClaw's core `message` tool is the conventional sender — and is
3239
+ // the right pick when the current turn was triggered by an AgentChat
3240
+ // inbound. But when the inbound arrived on a different channel
3241
+ // (Telegram, Slack, Discord, the OpenClaw CLI), the per-turn `message`
3242
+ // tool's `fallbackChannel` is bound to that channel, so an implicit
3243
+ // `message({to, text})` call from the model fall-back-routes to the
3244
+ // wrong outbound and gets rejected by that channel's target
3245
+ // normalization. The model paraphrases the rejection back to the
3246
+ // operator as "Telegram is not letting me…".
3247
+ //
3248
+ // This tool sidesteps the binding entirely. ChannelAgentTools are not
3249
+ // gated by `currentChannelProvider`, so this is visible and invokable
3250
+ // on every turn regardless of inbound source. The execute path runs
3251
+ // through our cached SDK client against the AgentChat REST API — no
3252
+ // OpenClaw channel routing in scope, no implicit fallback, no
3253
+ // requireExplicitMessageTarget gate. Reach for this whenever the
3254
+ // operator says "message X on AgentChat" or the model otherwise needs
3255
+ // a deterministic, channel-agnostic AgentChat send.
3256
+ tool({
3257
+ name: "agentchat_send_message",
3258
+ 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.",
3259
+ parameters: Type.Object({
3260
+ handle: Type.String({
3261
+ minLength: 3,
3262
+ maxLength: 31,
3263
+ 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 @."
3264
+ }),
3265
+ message: Type.String({
3266
+ minLength: 1,
3267
+ maxLength: 8e3,
3268
+ description: "The message text to send. Plain text \u2014 the platform is a transport, not a renderer."
3269
+ }),
3270
+ replyToMessageId: Type.Optional(
3271
+ Type.String({
3272
+ 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."
3273
+ })
3274
+ ),
3275
+ account: ACCOUNT_PARAM
3276
+ }),
3277
+ execute: async (_id, p) => {
3278
+ const r = clientFor(cfg, p.account);
3279
+ if ("error" in r) return err2(r.error);
3280
+ const handle = stripAt(p.handle);
3281
+ try {
3282
+ const result = await r.client.sendMessage({
3283
+ to: handle,
3284
+ content: { text: p.message },
3285
+ ...p.replyToMessageId ? { metadata: { reply_to: p.replyToMessageId } } : {}
3286
+ });
3287
+ const summaryParts = [
3288
+ `sent to @${handle} \u2014 message ${result.message.id} in ${result.message.conversation_id}`
3289
+ ];
3290
+ if (result.backlogWarning) {
3291
+ summaryParts.push(
3292
+ `\u26A0 recipient backlog at ${result.backlogWarning.undeliveredCount} undelivered \u2014 consider slowing follow-ups`
3293
+ );
3294
+ }
3295
+ return ok2(summaryParts.join("\n"));
3296
+ } catch (e) {
3297
+ return err2(toMsg(e));
3298
+ }
3299
+ }
3300
+ }),
3236
3301
  // ─── Contacts ─────────────────────────────────────────────────────────
3237
3302
  tool({
3238
3303
  name: "agentchat_add_contact",