@memorilabs/openclaw-memori 0.0.2-beta → 0.0.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/handlers/augmentation.js +1 -2
- package/dist/handlers/recall.js +0 -1
- package/dist/sanitizer.js +8 -12
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +11 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractContext, initializeMemoriClient } from '../utils/index.js';
|
|
2
2
|
import { cleanText, isSystemMessage } from '../sanitizer.js';
|
|
3
|
-
import { SDK_VERSION } from '../version.js';
|
|
4
3
|
import { AUGMENTATION_CONFIG } from '../constants.js';
|
|
4
|
+
import { SDK_VERSION } from '../version.js';
|
|
5
5
|
function extractLLMMetadata(event) {
|
|
6
6
|
const messages = event.messages || [];
|
|
7
7
|
const lastAssistant = messages.findLast((m) => m.role === 'assistant');
|
|
@@ -64,7 +64,6 @@ export async function handleAugmentation(event, ctx, config, logger) {
|
|
|
64
64
|
}
|
|
65
65
|
const context = extractContext(event, ctx, config.entityId);
|
|
66
66
|
const memoriClient = initializeMemoriClient(config.apiKey, context);
|
|
67
|
-
logger.info('Capturing conversation turn...');
|
|
68
67
|
const payload = {
|
|
69
68
|
userMessage: lastUserMsg.content,
|
|
70
69
|
agentResponse: lastAiMsg.content,
|
package/dist/handlers/recall.js
CHANGED
|
@@ -5,7 +5,6 @@ export async function handleRecall(event, ctx, config, logger) {
|
|
|
5
5
|
logger.section('RECALL HOOK START');
|
|
6
6
|
try {
|
|
7
7
|
const context = extractContext(event, ctx, config.entityId);
|
|
8
|
-
logger.info(`EntityID: ${context.entityId} | SessionID: ${context.sessionId} | Provider: ${context.provider}`);
|
|
9
8
|
const promptText = cleanText(event.prompt);
|
|
10
9
|
if (!promptText ||
|
|
11
10
|
promptText.length < RECALL_CONFIG.MIN_PROMPT_LENGTH ||
|
package/dist/sanitizer.js
CHANGED
|
@@ -22,22 +22,18 @@ export function isSystemMessage(text) {
|
|
|
22
22
|
* The message might aslo contain a timestamp prefix like: [Day YYYY-MM-DD HH:MM TZ], that will need to be removed
|
|
23
23
|
*/
|
|
24
24
|
function extractRawUserMessage(content) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
let message = content.substring(lastFenceIndex + 3).trim();
|
|
33
|
-
if (!message) {
|
|
34
|
-
return content;
|
|
25
|
+
let message = content;
|
|
26
|
+
if (message.includes('```')) {
|
|
27
|
+
const lastFenceIndex = message.lastIndexOf('```');
|
|
28
|
+
if (lastFenceIndex !== -1) {
|
|
29
|
+
message = message.substring(lastFenceIndex + 3).trim();
|
|
30
|
+
}
|
|
35
31
|
}
|
|
36
32
|
const timestampMatch = message.match(TIMESTAMP_PREFIX_REGEX);
|
|
37
33
|
if (timestampMatch) {
|
|
38
|
-
message = message.substring(timestampMatch[0].length);
|
|
34
|
+
message = message.substring(timestampMatch[0].length).trim();
|
|
39
35
|
}
|
|
40
|
-
return message
|
|
36
|
+
return message;
|
|
41
37
|
}
|
|
42
38
|
function extractMessageText(content) {
|
|
43
39
|
if (!content)
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.2
|
|
1
|
+
export declare const SDK_VERSION = "0.0.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '0.0.2
|
|
1
|
+
export const SDK_VERSION = '0.0.2';
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-memori",
|
|
3
3
|
"name": "Memori System",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"description": "Hosted memory backend",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"description": "Required. Hardcode a specific Entity ID for memories."
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"required": [
|
|
35
|
+
"required": []
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memorilabs/openclaw-memori",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Official MemoriLabs.ai long-term memory plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"lint:fix": "eslint . --fix",
|
|
18
18
|
"format": "prettier --write .",
|
|
19
19
|
"format:check": "prettier --check .",
|
|
20
|
-
"check": "npm run format:check && npm run lint && npm run typecheck"
|
|
20
|
+
"check": "npm run format:check && npm run lint && npm run typecheck",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test:coverage": "vitest run --coverage"
|
|
21
23
|
},
|
|
22
24
|
"peerDependencies": {
|
|
23
25
|
"openclaw": "^2026.3.2"
|
|
@@ -25,12 +27,14 @@
|
|
|
25
27
|
"devDependencies": {
|
|
26
28
|
"@eslint/js": "^9.0.0",
|
|
27
29
|
"@types/node": "^20.0.0",
|
|
30
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
28
31
|
"eslint": "^9.0.0",
|
|
29
32
|
"eslint-config-prettier": "^10.1.8",
|
|
30
33
|
"eslint-plugin-tsdoc": "^0.5.1",
|
|
31
34
|
"prettier": "^3.0.0",
|
|
32
35
|
"typescript": "^5.0.0",
|
|
33
|
-
"typescript-eslint": "^8.0.0"
|
|
36
|
+
"typescript-eslint": "^8.0.0",
|
|
37
|
+
"vitest": "^4.0.18"
|
|
34
38
|
},
|
|
35
39
|
"keywords": [
|
|
36
40
|
"openclaw",
|
|
@@ -59,6 +63,9 @@
|
|
|
59
63
|
"node": ">=22.0.0"
|
|
60
64
|
},
|
|
61
65
|
"dependencies": {
|
|
62
|
-
"@memorilabs/memori": "^0.0.
|
|
66
|
+
"@memorilabs/memori": "^0.0.5"
|
|
67
|
+
},
|
|
68
|
+
"overrides": {
|
|
69
|
+
"@hono/node-server": "^1.19.10"
|
|
63
70
|
}
|
|
64
71
|
}
|