🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@openclaw-china/shared

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openclaw-china/shared - npm Package Compare versions

Comparing version
2026.3.19
to
2026.3.20
+1
-1
package.json
{
"name": "@openclaw-china/shared",
"version": "2026.3.19",
"version": "2026.3.20",
"type": "module",

@@ -5,0 +5,0 @@ "exports": {

@@ -212,2 +212,3 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

.mockResolvedValueOnce("passive");
confirmMock.mockResolvedValueOnce(true); // renderMarkdown enabled (default)
textMock

@@ -236,3 +237,80 @@ .mockResolvedValueOnce("/wechat-mp")

expect(wechatMpConfig?.welcomeText).toBe("欢迎关注");
expect(wechatMpConfig?.renderMarkdown).toBe(true);
});
it("stores activeDeliveryMode when replyMode is active", async () => {
selectMock
.mockResolvedValueOnce("wechat-mp")
.mockResolvedValueOnce("safe")
.mockResolvedValueOnce("active")
.mockResolvedValueOnce("split");
textMock
.mockResolvedValueOnce("/wechat-mp-active")
.mockResolvedValueOnce("wx-active-appid")
.mockResolvedValueOnce("wx-active-secret")
.mockResolvedValueOnce("active-token")
.mockResolvedValueOnce("active-aes-key")
.mockResolvedValueOnce("welcome");
const { writeConfigFile } = await runSetup({}, ["wechat-mp"]);
expect(writeConfigFile).toHaveBeenCalledTimes(1);
const savedConfig = writeConfigFile.mock.calls[0]?.[0] as ConfigRoot;
const wechatMpConfig = savedConfig.channels?.["wechat-mp"];
expect(wechatMpConfig?.enabled).toBe(true);
expect(wechatMpConfig?.replyMode).toBe("active");
expect(wechatMpConfig?.activeDeliveryMode).toBe("split");
});
it("stores renderMarkdown when explicitly disabled", async () => {
selectMock
.mockResolvedValueOnce("wechat-mp")
.mockResolvedValueOnce("safe")
.mockResolvedValueOnce("active")
.mockResolvedValueOnce("merged");
confirmMock.mockResolvedValueOnce(false); // Disable renderMarkdown
textMock
.mockResolvedValueOnce("/wechat-mp-no-md")
.mockResolvedValueOnce("wx-no-md-appid")
.mockResolvedValueOnce("wx-no-md-secret")
.mockResolvedValueOnce("no-md-token")
.mockResolvedValueOnce("no-md-aes-key")
.mockResolvedValueOnce("welcome");
const { writeConfigFile } = await runSetup({}, ["wechat-mp"]);
expect(writeConfigFile).toHaveBeenCalledTimes(1);
const savedConfig = writeConfigFile.mock.calls[0]?.[0] as ConfigRoot;
const wechatMpConfig = savedConfig.channels?.["wechat-mp"];
expect(wechatMpConfig?.enabled).toBe(true);
expect(wechatMpConfig?.activeDeliveryMode).toBe("merged");
expect(wechatMpConfig?.renderMarkdown).toBe(false);
});
it("defaults renderMarkdown to true when not explicitly disabled", async () => {
selectMock
.mockResolvedValueOnce("wechat-mp")
.mockResolvedValueOnce("safe")
.mockResolvedValueOnce("passive");
confirmMock.mockResolvedValueOnce(true); // Keep renderMarkdown enabled (default)
textMock
.mockResolvedValueOnce("/wechat-mp-default-md")
.mockResolvedValueOnce("wx-default-appid")
.mockResolvedValueOnce("wx-default-secret")
.mockResolvedValueOnce("default-token")
.mockResolvedValueOnce("default-aes-key")
.mockResolvedValueOnce("welcome");
const { writeConfigFile } = await runSetup({}, ["wechat-mp"]);
expect(writeConfigFile).toHaveBeenCalledTimes(1);
const savedConfig = writeConfigFile.mock.calls[0]?.[0] as ConfigRoot;
const wechatMpConfig = savedConfig.channels?.["wechat-mp"];
expect(wechatMpConfig?.enabled).toBe(true);
// setup writes the value explicitly, even when it's the default true
expect(wechatMpConfig?.renderMarkdown).toBe(true);
});
});

@@ -239,0 +317,0 @@

@@ -760,2 +760,20 @@ import {

);
let activeDeliveryMode: "merged" | "split" | undefined;
if (replyMode === "active") {
activeDeliveryMode = await prompter.askSelect<"merged" | "split">(
"主动发送模式(activeDeliveryMode)",
[
{ value: "split", label: "split(逐块发送,推荐)" },
{ value: "merged", label: "merged(合并后单次发送)" },
],
(toTrimmedString(existing.activeDeliveryMode) as "merged" | "split" | undefined) ?? "split"
);
}
const renderMarkdown = await prompter.askConfirm(
"启用 Markdown 渲染(推荐开启)",
toBoolean(existing.renderMarkdown, true)
);
const welcomeText = await prompter.askText({

@@ -775,2 +793,4 @@ label: "欢迎语(可选)",

replyMode,
activeDeliveryMode,
renderMarkdown,
welcomeText: welcomeText || undefined,

@@ -777,0 +797,0 @@ });