@alfe.ai/openclaw-chat 0.1.1 → 0.1.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/plugin2.cjs +7 -1
- package/dist/plugin2.js +7 -1
- package/package.json +1 -1
package/dist/plugin2.cjs
CHANGED
|
@@ -716,7 +716,7 @@ async function handleAgentRequest(request, log) {
|
|
|
716
716
|
chatClient?.sendResponse(request.id, false, { message: "OpenClaw SDK not available — cannot dispatch" });
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const { message, sessionKey: legacySessionKey, userId, conversationId, conversationType, tenantId, clientType, displayName, identityId, attachments: rawAttachments, a2a } = request.params;
|
|
719
|
+
const { message, sessionKey: legacySessionKey, userId, conversationId, conversationType, tenantId, clientType, displayName, identityId, senderPermissions, attachments: rawAttachments, a2a } = request.params;
|
|
720
720
|
const isA2A = !!a2a;
|
|
721
721
|
if (!message && !rawAttachments?.length) {
|
|
722
722
|
chatClient?.sendResponse(request.id, false, { message: "Missing message" });
|
|
@@ -744,6 +744,11 @@ async function handleAgentRequest(request, log) {
|
|
|
744
744
|
try {
|
|
745
745
|
const downloadedFiles = rawAttachments?.length ? await downloadAttachments(rawAttachments, log) : [];
|
|
746
746
|
const bodyForAgent = downloadedFiles.length ? `${message || ""}\n\n[Attached files:\n${downloadedFiles.map((f) => `- ${f.filename}: ${f.localPath}`).join("\n")}]` : void 0;
|
|
747
|
+
if (identityId) fetch("http://127.0.0.1:18193/__alfe/set-identity", {
|
|
748
|
+
method: "POST",
|
|
749
|
+
headers: { "Content-Type": "application/json" },
|
|
750
|
+
body: JSON.stringify({ identityId })
|
|
751
|
+
}).catch(() => {});
|
|
747
752
|
const channelMode = isA2A ? "a2a" : extractChannelMode(conversationId ?? "", clientType ?? "chat");
|
|
748
753
|
const channelLabel = channelMode === "sms" ? "SMS" : channelMode === "whatsapp" ? "WhatsApp" : channelMode === "a2a" ? "Agent" : "Alfe";
|
|
749
754
|
const shortConvId = conversationId?.slice(-8) ?? "";
|
|
@@ -779,6 +784,7 @@ async function handleAgentRequest(request, log) {
|
|
|
779
784
|
...displayName ? { SenderName: displayName } : {},
|
|
780
785
|
...identityId ? { IdentityId: identityId } : {},
|
|
781
786
|
...userId ? { UserId: userId } : {},
|
|
787
|
+
...senderPermissions?.length ? { SenderPermissions: senderPermissions } : {},
|
|
782
788
|
ChannelMode: channelMode,
|
|
783
789
|
...isA2A ? {
|
|
784
790
|
CallerType: "agent",
|
package/dist/plugin2.js
CHANGED
|
@@ -716,7 +716,7 @@ async function handleAgentRequest(request, log) {
|
|
|
716
716
|
chatClient?.sendResponse(request.id, false, { message: "OpenClaw SDK not available — cannot dispatch" });
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const { message, sessionKey: legacySessionKey, userId, conversationId, conversationType, tenantId, clientType, displayName, identityId, attachments: rawAttachments, a2a } = request.params;
|
|
719
|
+
const { message, sessionKey: legacySessionKey, userId, conversationId, conversationType, tenantId, clientType, displayName, identityId, senderPermissions, attachments: rawAttachments, a2a } = request.params;
|
|
720
720
|
const isA2A = !!a2a;
|
|
721
721
|
if (!message && !rawAttachments?.length) {
|
|
722
722
|
chatClient?.sendResponse(request.id, false, { message: "Missing message" });
|
|
@@ -744,6 +744,11 @@ async function handleAgentRequest(request, log) {
|
|
|
744
744
|
try {
|
|
745
745
|
const downloadedFiles = rawAttachments?.length ? await downloadAttachments(rawAttachments, log) : [];
|
|
746
746
|
const bodyForAgent = downloadedFiles.length ? `${message || ""}\n\n[Attached files:\n${downloadedFiles.map((f) => `- ${f.filename}: ${f.localPath}`).join("\n")}]` : void 0;
|
|
747
|
+
if (identityId) fetch("http://127.0.0.1:18193/__alfe/set-identity", {
|
|
748
|
+
method: "POST",
|
|
749
|
+
headers: { "Content-Type": "application/json" },
|
|
750
|
+
body: JSON.stringify({ identityId })
|
|
751
|
+
}).catch(() => {});
|
|
747
752
|
const channelMode = isA2A ? "a2a" : extractChannelMode(conversationId ?? "", clientType ?? "chat");
|
|
748
753
|
const channelLabel = channelMode === "sms" ? "SMS" : channelMode === "whatsapp" ? "WhatsApp" : channelMode === "a2a" ? "Agent" : "Alfe";
|
|
749
754
|
const shortConvId = conversationId?.slice(-8) ?? "";
|
|
@@ -779,6 +784,7 @@ async function handleAgentRequest(request, log) {
|
|
|
779
784
|
...displayName ? { SenderName: displayName } : {},
|
|
780
785
|
...identityId ? { IdentityId: identityId } : {},
|
|
781
786
|
...userId ? { UserId: userId } : {},
|
|
787
|
+
...senderPermissions?.length ? { SenderPermissions: senderPermissions } : {},
|
|
782
788
|
ChannelMode: channelMode,
|
|
783
789
|
...isA2A ? {
|
|
784
790
|
CallerType: "agent",
|