@agentchatme/openclaw 0.6.16 → 0.6.18
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 +99 -90
- package/dist/index.cjs +75 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +75 -37
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.cjs +75 -37
- package/dist/setup-entry.cjs.map +1 -1
- package/dist/setup-entry.js +75 -37
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/setup-entry.cjs
CHANGED
|
@@ -11,6 +11,8 @@ var channelLifecycle = require('openclaw/plugin-sdk/channel-lifecycle');
|
|
|
11
11
|
var pino = require('pino');
|
|
12
12
|
var ws = require('ws');
|
|
13
13
|
var directDm = require('openclaw/plugin-sdk/direct-dm');
|
|
14
|
+
var inboundEnvelope = require('openclaw/plugin-sdk/inbound-envelope');
|
|
15
|
+
var inboundReplyDispatch = require('openclaw/plugin-sdk/inbound-reply-dispatch');
|
|
14
16
|
var agentchat = require('@agentchatme/agentchat');
|
|
15
17
|
var typebox = require('@sinclair/typebox');
|
|
16
18
|
|
|
@@ -823,19 +825,16 @@ var agentchatSetupWizard = {
|
|
|
823
825
|
},
|
|
824
826
|
completionNote: {
|
|
825
827
|
title: "AgentChat is ready",
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
" \u2022 DM another agent: @<handle> <message>",
|
|
837
|
-
" \u2022 Docs: https://agentchat.me/docs"
|
|
838
|
-
]
|
|
828
|
+
// After our wizard returns, OpenClaw's setupChannels keeps running
|
|
829
|
+
// its own outer flow (a Select-a-channel loop, then optional
|
|
830
|
+
// follow-up prompts for display names and channel→agent binding).
|
|
831
|
+
// None of that is suppressible from a channel plugin — there's no
|
|
832
|
+
// field on ChannelSetupWizard that hides those prompts. So this
|
|
833
|
+
// note keeps to the only thing the user actually needs to know:
|
|
834
|
+
// pick Finished. The earlier "or pick another channel" copy read
|
|
835
|
+
// as a vague alt-branch and produced the "did this break?"
|
|
836
|
+
// reaction; one direct sentence is the cure.
|
|
837
|
+
lines: ['On the next prompt, choose "Finished" to exit.']
|
|
839
838
|
},
|
|
840
839
|
// `disable` fires on `openclaw channels remove agentchat`. We strip
|
|
841
840
|
// the persistent AGENTS.md anchor here so the agent stops being told
|
|
@@ -1855,7 +1854,7 @@ var CircuitBreaker = class {
|
|
|
1855
1854
|
};
|
|
1856
1855
|
|
|
1857
1856
|
// src/version.ts
|
|
1858
|
-
var PACKAGE_VERSION = "0.6.
|
|
1857
|
+
var PACKAGE_VERSION = "0.6.18";
|
|
1859
1858
|
|
|
1860
1859
|
// src/outbound.ts
|
|
1861
1860
|
var DEFAULT_RETRY_POLICY = {
|
|
@@ -2487,31 +2486,70 @@ async function handleMessage(deps, event) {
|
|
|
2487
2486
|
}
|
|
2488
2487
|
});
|
|
2489
2488
|
} else {
|
|
2490
|
-
const
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2489
|
+
const ts = typeof event.createdAt === "number" ? event.createdAt : Date.parse(event.createdAt);
|
|
2490
|
+
const runtime = channelRuntime;
|
|
2491
|
+
const { route, buildEnvelope } = inboundEnvelope.resolveInboundRouteEnvelopeBuilderWithRuntime({
|
|
2493
2492
|
cfg: deps.gatewayCfg,
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2493
|
+
channel: "agentchat",
|
|
2494
|
+
accountId: deps.accountId,
|
|
2495
|
+
peer: { kind: "group", id: event.conversationId },
|
|
2496
|
+
runtime
|
|
2497
|
+
});
|
|
2498
|
+
const { storePath, body: envelopeBody } = buildEnvelope({
|
|
2499
|
+
channel: "AgentChat",
|
|
2500
|
+
from: conversationLabel,
|
|
2501
|
+
body,
|
|
2502
|
+
timestamp: ts
|
|
2503
|
+
});
|
|
2504
|
+
const finalize = channelRuntime.reply.finalizeInboundContext;
|
|
2505
|
+
const ctxPayload = finalize({
|
|
2506
|
+
Body: envelopeBody,
|
|
2507
|
+
BodyForAgent: body,
|
|
2508
|
+
RawBody: body,
|
|
2509
|
+
CommandBody: body,
|
|
2510
|
+
From: `@${senderHandle}`,
|
|
2511
|
+
To: `@${recipientHandle}`,
|
|
2512
|
+
SessionKey: route.sessionKey,
|
|
2513
|
+
AccountId: deps.accountId,
|
|
2514
|
+
ChatType: "group",
|
|
2515
|
+
ConversationLabel: conversationLabel,
|
|
2516
|
+
SenderId: senderHandle,
|
|
2517
|
+
Provider: "agentchat",
|
|
2518
|
+
Surface: "agentchat",
|
|
2519
|
+
MessageSid: event.messageId,
|
|
2520
|
+
MessageSidFull: event.messageId,
|
|
2521
|
+
Timestamp: ts,
|
|
2522
|
+
OriginatingChannel: "agentchat",
|
|
2523
|
+
OriginatingTo: `@${recipientHandle}`
|
|
2524
|
+
});
|
|
2525
|
+
const session = channelRuntime.session;
|
|
2526
|
+
await inboundReplyDispatch.recordInboundSessionAndDispatchReply({
|
|
2527
|
+
cfg: deps.gatewayCfg,
|
|
2528
|
+
channel: "agentchat",
|
|
2529
|
+
accountId: deps.accountId,
|
|
2530
|
+
agentId: route.agentId,
|
|
2531
|
+
routeSessionKey: route.sessionKey,
|
|
2532
|
+
storePath,
|
|
2533
|
+
ctxPayload,
|
|
2534
|
+
recordInboundSession: session.recordInboundSession,
|
|
2535
|
+
dispatchReplyWithBufferedBlockDispatcher: channelRuntime.reply.dispatchReplyWithBufferedBlockDispatcher,
|
|
2536
|
+
deliver: deliver2,
|
|
2537
|
+
onRecordError: (err3) => {
|
|
2538
|
+
deps.logger.error(
|
|
2539
|
+
{ err: err3 instanceof Error ? err3.message : String(err3), messageId: event.messageId },
|
|
2540
|
+
"recordInboundSession failed (group)"
|
|
2541
|
+
);
|
|
2513
2542
|
},
|
|
2514
|
-
|
|
2543
|
+
onDispatchError: (err3, info) => {
|
|
2544
|
+
deps.logger.error(
|
|
2545
|
+
{
|
|
2546
|
+
err: err3 instanceof Error ? err3.message : String(err3),
|
|
2547
|
+
messageId: event.messageId,
|
|
2548
|
+
kind: info.kind
|
|
2549
|
+
},
|
|
2550
|
+
"inbound dispatch failed (group)"
|
|
2551
|
+
);
|
|
2552
|
+
}
|
|
2515
2553
|
});
|
|
2516
2554
|
}
|
|
2517
2555
|
} catch (err3) {
|