@clawmem-ai/clawmem 0.1.18 → 0.1.19
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/README.md +28 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/src/collaboration.d.ts +49 -0
- package/dist/src/collaboration.js +69 -0
- package/dist/src/config.d.ts +21 -0
- package/dist/src/config.js +119 -0
- package/dist/src/conversation.d.ts +30 -0
- package/dist/src/conversation.js +323 -0
- package/dist/src/github-client.d.ts +269 -0
- package/dist/src/github-client.js +350 -0
- package/dist/src/keyed-async-queue.d.ts +12 -0
- package/dist/src/keyed-async-queue.js +23 -0
- package/dist/src/memory.d.ts +29 -0
- package/dist/src/memory.js +451 -0
- package/dist/src/recall-sanitize.d.ts +1 -0
- package/dist/src/recall-sanitize.js +149 -0
- package/dist/src/runtime-env.d.ts +2 -0
- package/dist/src/runtime-env.js +12 -0
- package/dist/src/service.d.ts +18 -0
- package/dist/src/service.js +3645 -0
- package/dist/src/state.d.ts +4 -0
- package/dist/src/state.js +182 -0
- package/dist/src/transcript.d.ts +3 -0
- package/dist/src/transcript.js +164 -0
- package/dist/src/types.d.ts +130 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +26 -0
- package/dist/src/utils.js +62 -0
- package/dist/src/yaml.d.ts +2 -0
- package/dist/src/yaml.js +81 -0
- package/openclaw.plugin.json +14 -1
- package/package.json +21 -7
- package/skills/clawmem/SKILL.md +26 -5
- package/skills/clawmem/references/collaboration.md +13 -5
- package/skills/clawmem/references/review.md +77 -0
- package/skills/clawmem/references/schema.md +44 -1
- package/index.ts +0 -6
- package/src/collaboration.test.ts +0 -71
- package/src/collaboration.ts +0 -109
- package/src/config.test.ts +0 -83
- package/src/config.ts +0 -117
- package/src/conversation.test.ts +0 -120
- package/src/conversation.ts +0 -304
- package/src/github-client.test.ts +0 -101
- package/src/github-client.ts +0 -363
- package/src/keyed-async-queue.ts +0 -26
- package/src/memory.test.ts +0 -588
- package/src/memory.ts +0 -444
- package/src/recall-sanitize.ts +0 -143
- package/src/runtime-env.ts +0 -12
- package/src/service.test.ts +0 -337
- package/src/service.ts +0 -2786
- package/src/state.test.ts +0 -119
- package/src/state.ts +0 -206
- package/src/transcript.ts +0 -186
- package/src/types.ts +0 -86
- package/src/utils.ts +0 -74
- package/src/yaml.ts +0 -88
- package/tsconfig.json +0 -15
package/src/yaml.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export function stringifyFlatYaml(
|
|
2
|
-
entries: Array<[key: string, value: string | undefined]>,
|
|
3
|
-
): string {
|
|
4
|
-
const out: string[] = [];
|
|
5
|
-
for (const [key, rawValue] of entries) {
|
|
6
|
-
const value = rawValue ?? "";
|
|
7
|
-
if (value.includes("\n")) {
|
|
8
|
-
out.push(`${key}: |-`);
|
|
9
|
-
for (const line of value.split("\n")) {
|
|
10
|
-
out.push(` ${line}`);
|
|
11
|
-
}
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
out.push(`${key}: ${formatScalar(value)}`);
|
|
15
|
-
}
|
|
16
|
-
return out.join("\n");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function parseFlatYaml(input: string): Record<string, string> {
|
|
20
|
-
const result: Record<string, string> = {};
|
|
21
|
-
const lines = input.replace(/\r/g, "").split("\n");
|
|
22
|
-
|
|
23
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
24
|
-
const line = lines[index] ?? "";
|
|
25
|
-
if (!line.trim()) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const match = /^([A-Za-z0-9_]+):(?:\s(.*))?$/.exec(line);
|
|
29
|
-
if (!match) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
const key = match[1];
|
|
33
|
-
const rawValue = match[2] ?? "";
|
|
34
|
-
if (rawValue === "|-" || rawValue === "|") {
|
|
35
|
-
const block: string[] = [];
|
|
36
|
-
let cursor = index + 1;
|
|
37
|
-
while (cursor < lines.length) {
|
|
38
|
-
const blockLine = lines[cursor] ?? "";
|
|
39
|
-
if (blockLine.startsWith(" ")) {
|
|
40
|
-
block.push(blockLine.slice(2));
|
|
41
|
-
cursor += 1;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (!blockLine.trim()) {
|
|
45
|
-
block.push("");
|
|
46
|
-
cursor += 1;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
result[key] = block.join("\n");
|
|
52
|
-
index = cursor - 1;
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
result[key] = parseScalar(rawValue.trim());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function formatScalar(value: string): string {
|
|
62
|
-
if (value.length === 0) {
|
|
63
|
-
return '""';
|
|
64
|
-
}
|
|
65
|
-
if (/^[A-Za-z0-9_./:@ -]+$/.test(value) && !looksLikeYamlKeyword(value)) {
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
return JSON.stringify(value);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function parseScalar(value: string): string {
|
|
72
|
-
if (!value) {
|
|
73
|
-
return "";
|
|
74
|
-
}
|
|
75
|
-
if (value.startsWith('"') && value.endsWith('"')) {
|
|
76
|
-
try {
|
|
77
|
-
return JSON.parse(value) as string;
|
|
78
|
-
} catch {
|
|
79
|
-
return value.slice(1, -1);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return value;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function looksLikeYamlKeyword(value: string): boolean {
|
|
86
|
-
const lowered = value.trim().toLowerCase();
|
|
87
|
-
return lowered === "null" || lowered === "true" || lowered === "false" || lowered === "~";
|
|
88
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../openclaw/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"baseUrl": ".",
|
|
6
|
-
"paths": {
|
|
7
|
-
"openclaw/plugin-sdk": ["../openclaw/src/plugin-sdk/index.ts"],
|
|
8
|
-
"openclaw/plugin-sdk/*": ["../openclaw/src/plugin-sdk/*.ts"],
|
|
9
|
-
"openclaw/plugin-sdk/account-id": ["../openclaw/src/plugin-sdk/account-id.ts"]
|
|
10
|
-
},
|
|
11
|
-
"typeRoots": ["../openclaw/node_modules/@types"],
|
|
12
|
-
"types": ["node"]
|
|
13
|
-
},
|
|
14
|
-
"include": ["./index.ts", "./src/**/*.ts"]
|
|
15
|
-
}
|