@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.
Files changed (60) hide show
  1. package/README.md +28 -9
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +4 -0
  4. package/dist/src/collaboration.d.ts +49 -0
  5. package/dist/src/collaboration.js +69 -0
  6. package/dist/src/config.d.ts +21 -0
  7. package/dist/src/config.js +119 -0
  8. package/dist/src/conversation.d.ts +30 -0
  9. package/dist/src/conversation.js +323 -0
  10. package/dist/src/github-client.d.ts +269 -0
  11. package/dist/src/github-client.js +350 -0
  12. package/dist/src/keyed-async-queue.d.ts +12 -0
  13. package/dist/src/keyed-async-queue.js +23 -0
  14. package/dist/src/memory.d.ts +29 -0
  15. package/dist/src/memory.js +451 -0
  16. package/dist/src/recall-sanitize.d.ts +1 -0
  17. package/dist/src/recall-sanitize.js +149 -0
  18. package/dist/src/runtime-env.d.ts +2 -0
  19. package/dist/src/runtime-env.js +12 -0
  20. package/dist/src/service.d.ts +18 -0
  21. package/dist/src/service.js +3645 -0
  22. package/dist/src/state.d.ts +4 -0
  23. package/dist/src/state.js +182 -0
  24. package/dist/src/transcript.d.ts +3 -0
  25. package/dist/src/transcript.js +164 -0
  26. package/dist/src/types.d.ts +130 -0
  27. package/dist/src/types.js +1 -0
  28. package/dist/src/utils.d.ts +26 -0
  29. package/dist/src/utils.js +62 -0
  30. package/dist/src/yaml.d.ts +2 -0
  31. package/dist/src/yaml.js +81 -0
  32. package/openclaw.plugin.json +14 -1
  33. package/package.json +21 -7
  34. package/skills/clawmem/SKILL.md +26 -5
  35. package/skills/clawmem/references/collaboration.md +13 -5
  36. package/skills/clawmem/references/review.md +77 -0
  37. package/skills/clawmem/references/schema.md +44 -1
  38. package/index.ts +0 -6
  39. package/src/collaboration.test.ts +0 -71
  40. package/src/collaboration.ts +0 -109
  41. package/src/config.test.ts +0 -83
  42. package/src/config.ts +0 -117
  43. package/src/conversation.test.ts +0 -120
  44. package/src/conversation.ts +0 -304
  45. package/src/github-client.test.ts +0 -101
  46. package/src/github-client.ts +0 -363
  47. package/src/keyed-async-queue.ts +0 -26
  48. package/src/memory.test.ts +0 -588
  49. package/src/memory.ts +0 -444
  50. package/src/recall-sanitize.ts +0 -143
  51. package/src/runtime-env.ts +0 -12
  52. package/src/service.test.ts +0 -337
  53. package/src/service.ts +0 -2786
  54. package/src/state.test.ts +0 -119
  55. package/src/state.ts +0 -206
  56. package/src/transcript.ts +0 -186
  57. package/src/types.ts +0 -86
  58. package/src/utils.ts +0 -74
  59. package/src/yaml.ts +0 -88
  60. 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
- }