@memtensor/memos-cloud-openclaw-plugin 0.1.16-beta.1 → 0.1.17-beta.0
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/clawdbot.plugin.json +316 -316
- package/index.js +8 -2
- package/moltbot.plugin.json +316 -316
- package/openclaw.plugin.json +316 -316
- package/package.json +1 -1
- package/test/direct-session-user-id.test.mjs +31 -0
|
@@ -92,3 +92,34 @@ test("buildAddMessagePayload keeps configured userId for non-direct chats", () =
|
|
|
92
92
|
const payload = buildAddMessagePayload(cfg, [{ role: "user", content: "hi" }], ctx);
|
|
93
93
|
assert.equal(payload.user_id, "openclaw-user");
|
|
94
94
|
});
|
|
95
|
+
|
|
96
|
+
test("MEMOS_SOURCE is correctly appended with platform suffix", () => {
|
|
97
|
+
const expectedSource = (() => {
|
|
98
|
+
const platform = process.platform;
|
|
99
|
+
if (platform === "win32") return "openclaw_win";
|
|
100
|
+
if (platform === "darwin") return "openclaw_mac";
|
|
101
|
+
if (platform === "linux") return "openclaw_linux";
|
|
102
|
+
return "openclaw";
|
|
103
|
+
})();
|
|
104
|
+
const cfg = {
|
|
105
|
+
userId: "openclaw-user",
|
|
106
|
+
useDirectSessionUserId: false,
|
|
107
|
+
queryPrefix: "",
|
|
108
|
+
maxQueryChars: 0,
|
|
109
|
+
recallGlobal: true,
|
|
110
|
+
knowledgebaseIds: [],
|
|
111
|
+
memoryLimitNumber: 6,
|
|
112
|
+
includePreference: true,
|
|
113
|
+
preferenceLimitNumber: 6,
|
|
114
|
+
includeToolMemory: false,
|
|
115
|
+
toolMemoryLimitNumber: 0,
|
|
116
|
+
relativity: 0.45,
|
|
117
|
+
multiAgentMode: false,
|
|
118
|
+
};
|
|
119
|
+
const ctx = {};
|
|
120
|
+
const searchPayload = buildSearchPayload(cfg, "query", ctx);
|
|
121
|
+
assert.equal(searchPayload.source, expectedSource);
|
|
122
|
+
|
|
123
|
+
const addPayload = buildAddMessagePayload(cfg, [], ctx);
|
|
124
|
+
assert.equal(addPayload.source, expectedSource);
|
|
125
|
+
});
|