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