@poprobertdaniel/openclaw-memory 0.1.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +410 -0
  3. package/dist/chunk-CRPEAZ44.cjs +1881 -0
  4. package/dist/chunk-CRPEAZ44.cjs.map +1 -0
  5. package/dist/chunk-JNWCMHOB.js +309 -0
  6. package/dist/chunk-JNWCMHOB.js.map +1 -0
  7. package/dist/chunk-JSQBXYDM.js +1881 -0
  8. package/dist/chunk-JSQBXYDM.js.map +1 -0
  9. package/dist/chunk-NHFPLDZK.js +236 -0
  10. package/dist/chunk-NHFPLDZK.js.map +1 -0
  11. package/dist/chunk-NMUPGLJW.cjs +752 -0
  12. package/dist/chunk-NMUPGLJW.cjs.map +1 -0
  13. package/dist/chunk-RFLG2CCR.js +752 -0
  14. package/dist/chunk-RFLG2CCR.js.map +1 -0
  15. package/dist/chunk-VXULEX3A.cjs +236 -0
  16. package/dist/chunk-VXULEX3A.cjs.map +1 -0
  17. package/dist/chunk-ZY2C2CJQ.cjs +309 -0
  18. package/dist/chunk-ZY2C2CJQ.cjs.map +1 -0
  19. package/dist/cli/index.cjs +764 -0
  20. package/dist/cli/index.cjs.map +1 -0
  21. package/dist/cli/index.d.cts +1 -0
  22. package/dist/cli/index.d.ts +1 -0
  23. package/dist/cli/index.js +764 -0
  24. package/dist/cli/index.js.map +1 -0
  25. package/dist/index.cjs +48 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.cts +790 -0
  28. package/dist/index.d.ts +790 -0
  29. package/dist/index.js +48 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/memory-service-6WDMF6KX.cjs +9 -0
  32. package/dist/memory-service-6WDMF6KX.cjs.map +1 -0
  33. package/dist/memory-service-GKEG6J2D.js +9 -0
  34. package/dist/memory-service-GKEG6J2D.js.map +1 -0
  35. package/dist/server-BTbRv-yX.d.cts +1199 -0
  36. package/dist/server-BTbRv-yX.d.ts +1199 -0
  37. package/dist/server.cjs +9 -0
  38. package/dist/server.cjs.map +1 -0
  39. package/dist/server.d.cts +2 -0
  40. package/dist/server.d.ts +2 -0
  41. package/dist/server.js +9 -0
  42. package/dist/server.js.map +1 -0
  43. package/docker/full.yml +45 -0
  44. package/docker/standard.yml +26 -0
  45. package/package.json +109 -0
  46. package/skill/SKILL.md +139 -0
  47. package/templates/.env.example +42 -0
  48. package/templates/docker-compose.full.yml +45 -0
  49. package/templates/docker-compose.standard.yml +26 -0
  50. package/templates/openclaw-memory.config.ts +49 -0
@@ -0,0 +1,790 @@
1
+ import { R as ResolvedConfig, C as Config, S as StoreParams, a as StoreResult, M as Memory, U as UpdateParams, L as ListParams, b as SearchParams, c as SearchResponse, d as ConversationLogEntry, e as SummarizeResponse, H as HealthResponse, T as Tier, f as StorageOrchestrator, g as CreateMemoryResponse, E as ExtractionResult, h as SyncQueueItem } from './server-BTbRv-yX.cjs';
2
+ export { i as CreateMemoryRequest, j as EntityType, k as ExtractedEntity, l as ExtractedRelationship, m as ListMemoriesQuery, n as MemoryScope, o as MemorySource, p as MigrateMarkdownRequest, q as RelationshipType, r as ScoredMemory, s as SearchRequest, t as SummarizeRequest, u as SyncStatus, v as TIER_CAPABILITIES, w as TierCapabilities, x as UpdateMemoryRequest, y as createServer } from './server-BTbRv-yX.cjs';
3
+ import { Elysia } from 'elysia';
4
+
5
+ declare function loadConfig(configPath?: string): Promise<ResolvedConfig>;
6
+ declare function defineConfig(config: Config): Config;
7
+ declare function configSummary(config: ResolvedConfig): string;
8
+
9
+ declare class MemoryService {
10
+ private orchestrator;
11
+ private searchEngine;
12
+ private summarizer;
13
+ private config;
14
+ private initialized;
15
+ private pendingConfig;
16
+ constructor(config?: Config | string);
17
+ init(): Promise<void>;
18
+ close(): Promise<void>;
19
+ store(params: StoreParams): Promise<StoreResult>;
20
+ get(id: string): Promise<Memory | null>;
21
+ update(id: string, params: UpdateParams): Promise<Memory | null>;
22
+ delete(id: string): Promise<boolean>;
23
+ list(params?: ListParams): Promise<Memory[]>;
24
+ search(params: SearchParams): Promise<SearchResponse>;
25
+ searchSemantic(params: SearchParams): Promise<SearchResponse>;
26
+ searchFulltext(params: SearchParams): Promise<SearchResponse>;
27
+ searchGraph(params: SearchParams): Promise<SearchResponse>;
28
+ logConversation(entry: ConversationLogEntry): Promise<void>;
29
+ summarizeConversation(params: {
30
+ agentId: string;
31
+ sessionId: string;
32
+ userId: string;
33
+ channel: string;
34
+ messages: Array<{
35
+ role: "user" | "assistant" | "system";
36
+ content: string;
37
+ timestamp: string;
38
+ }>;
39
+ }): Promise<SummarizeResponse | null>;
40
+ getEntity(type: string, id: string): Promise<Record<string, unknown> | null>;
41
+ listEntities(type?: string): Promise<Array<Record<string, unknown>>>;
42
+ getRelatedEntities(entityId: string, depth?: number): Promise<Array<Record<string, unknown>>>;
43
+ health(): Promise<HealthResponse>;
44
+ retrySyncQueue(): Promise<{
45
+ processed: number;
46
+ succeeded: number;
47
+ failed: number;
48
+ }>;
49
+ migrateMarkdown(paths: string[], agentId: string): Promise<{
50
+ migrated: number;
51
+ errors: string[];
52
+ }>;
53
+ get tier(): Tier;
54
+ get resolvedConfig(): ResolvedConfig;
55
+ getOrchestrator(): StorageOrchestrator;
56
+ private ensureInit;
57
+ }
58
+
59
+ declare function createApp(orchestrator: StorageOrchestrator, config: ResolvedConfig): Elysia<"", {
60
+ decorator: {};
61
+ store: {};
62
+ derive: {};
63
+ resolve: {};
64
+ }, {
65
+ typebox: {};
66
+ error: {};
67
+ } & {
68
+ typebox: {};
69
+ error: {};
70
+ }, {
71
+ schema: {};
72
+ standaloneSchema: {};
73
+ macro: {};
74
+ macroFn: {};
75
+ parser: {};
76
+ response: {};
77
+ } & {
78
+ schema: {};
79
+ standaloneSchema: {};
80
+ macro: {};
81
+ macroFn: {};
82
+ parser: {};
83
+ response: {};
84
+ }, {
85
+ api: {
86
+ memories: {
87
+ post: {
88
+ body: {
89
+ subject_id?: string | null | undefined;
90
+ tags?: string[] | undefined;
91
+ source?: "explicit" | "derived" | "observation" | "conversation_summary" | "entity_extraction" | "daily_digest" | "migration" | undefined;
92
+ created_by?: string | null | undefined;
93
+ expires_at?: string | null | undefined;
94
+ extract_entities?: boolean | undefined;
95
+ agent_id: string;
96
+ scope: "user" | "agent" | "global" | "project" | "session";
97
+ content: string;
98
+ };
99
+ params: {};
100
+ query: unknown;
101
+ headers: unknown;
102
+ response: {
103
+ 200: CreateMemoryResponse | {
104
+ error: string;
105
+ details: string;
106
+ };
107
+ 422: {
108
+ type: "validation";
109
+ on: string;
110
+ summary?: string;
111
+ message?: string;
112
+ found?: unknown;
113
+ property?: string;
114
+ expected?: string;
115
+ };
116
+ };
117
+ };
118
+ };
119
+ };
120
+ } & {
121
+ api: {
122
+ memories: {
123
+ ":id": {
124
+ get: {
125
+ body: unknown;
126
+ params: {
127
+ id: string;
128
+ } & {};
129
+ query: unknown;
130
+ headers: unknown;
131
+ response: {
132
+ 200: Memory | {
133
+ error: string;
134
+ };
135
+ 422: {
136
+ type: "validation";
137
+ on: string;
138
+ summary?: string;
139
+ message?: string;
140
+ found?: unknown;
141
+ property?: string;
142
+ expected?: string;
143
+ };
144
+ };
145
+ };
146
+ };
147
+ };
148
+ };
149
+ } & {
150
+ api: {
151
+ memories: {
152
+ ":id": {
153
+ put: {
154
+ body: {
155
+ scope?: "user" | "agent" | "global" | "project" | "session" | undefined;
156
+ subject_id?: string | null | undefined;
157
+ content?: string | undefined;
158
+ tags?: string[] | undefined;
159
+ expires_at?: string | null | undefined;
160
+ extract_entities?: boolean | undefined;
161
+ };
162
+ params: {
163
+ id: string;
164
+ } & {};
165
+ query: unknown;
166
+ headers: unknown;
167
+ response: {
168
+ 200: CreateMemoryResponse | {
169
+ error: string;
170
+ details?: undefined;
171
+ } | {
172
+ error: string;
173
+ details: string;
174
+ };
175
+ 422: {
176
+ type: "validation";
177
+ on: string;
178
+ summary?: string;
179
+ message?: string;
180
+ found?: unknown;
181
+ property?: string;
182
+ expected?: string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ };
189
+ } & {
190
+ api: {
191
+ memories: {
192
+ ":id": {
193
+ delete: {
194
+ body: unknown;
195
+ params: {
196
+ id: string;
197
+ } & {};
198
+ query: unknown;
199
+ headers: unknown;
200
+ response: {
201
+ 200: {
202
+ error: string;
203
+ deleted?: undefined;
204
+ id?: undefined;
205
+ details?: undefined;
206
+ } | {
207
+ deleted: boolean;
208
+ id: string;
209
+ error?: undefined;
210
+ details?: undefined;
211
+ } | {
212
+ error: string;
213
+ details: string;
214
+ deleted?: undefined;
215
+ id?: undefined;
216
+ };
217
+ 422: {
218
+ type: "validation";
219
+ on: string;
220
+ summary?: string;
221
+ message?: string;
222
+ found?: unknown;
223
+ property?: string;
224
+ expected?: string;
225
+ };
226
+ };
227
+ };
228
+ };
229
+ };
230
+ };
231
+ } & {
232
+ api: {
233
+ memories: {
234
+ get: {
235
+ body: unknown;
236
+ params: {};
237
+ query: unknown;
238
+ headers: unknown;
239
+ response: {
240
+ 200: {
241
+ memories: Memory[];
242
+ count: number;
243
+ };
244
+ };
245
+ };
246
+ };
247
+ };
248
+ } & {
249
+ api: {
250
+ search: {
251
+ post: {
252
+ body: {
253
+ agent_id?: string | undefined;
254
+ subject_id?: string | null | undefined;
255
+ limit?: number | undefined;
256
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
257
+ include_graph?: boolean | undefined;
258
+ cross_agent?: boolean | undefined;
259
+ strategy?: "auto" | "semantic" | "fulltext" | "graph" | "all" | undefined;
260
+ query: string;
261
+ };
262
+ params: {};
263
+ query: unknown;
264
+ headers: unknown;
265
+ response: {
266
+ 200: SearchResponse | {
267
+ error: string;
268
+ details: string;
269
+ };
270
+ 422: {
271
+ type: "validation";
272
+ on: string;
273
+ summary?: string;
274
+ message?: string;
275
+ found?: unknown;
276
+ property?: string;
277
+ expected?: string;
278
+ };
279
+ };
280
+ };
281
+ };
282
+ };
283
+ } & {
284
+ api: {
285
+ search: {
286
+ semantic: {
287
+ post: {
288
+ body: {
289
+ agent_id?: string | undefined;
290
+ subject_id?: string | null | undefined;
291
+ limit?: number | undefined;
292
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
293
+ cross_agent?: boolean | undefined;
294
+ query: string;
295
+ };
296
+ params: {};
297
+ query: unknown;
298
+ headers: unknown;
299
+ response: {
300
+ 200: SearchResponse | {
301
+ error: string;
302
+ details: string;
303
+ };
304
+ 422: {
305
+ type: "validation";
306
+ on: string;
307
+ summary?: string;
308
+ message?: string;
309
+ found?: unknown;
310
+ property?: string;
311
+ expected?: string;
312
+ };
313
+ };
314
+ };
315
+ };
316
+ };
317
+ };
318
+ } & {
319
+ api: {
320
+ search: {
321
+ graph: {
322
+ post: {
323
+ body: {
324
+ agent_id?: string | undefined;
325
+ subject_id?: string | null | undefined;
326
+ limit?: number | undefined;
327
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
328
+ query: string;
329
+ };
330
+ params: {};
331
+ query: unknown;
332
+ headers: unknown;
333
+ response: {
334
+ 200: SearchResponse | {
335
+ error: string;
336
+ details: string;
337
+ };
338
+ 422: {
339
+ type: "validation";
340
+ on: string;
341
+ summary?: string;
342
+ message?: string;
343
+ found?: unknown;
344
+ property?: string;
345
+ expected?: string;
346
+ };
347
+ };
348
+ };
349
+ };
350
+ };
351
+ };
352
+ } & {
353
+ api: {
354
+ search: {
355
+ fulltext: {
356
+ post: {
357
+ body: {
358
+ agent_id?: string | undefined;
359
+ subject_id?: string | null | undefined;
360
+ limit?: number | undefined;
361
+ scopes?: string[] | undefined;
362
+ query: string;
363
+ };
364
+ params: {};
365
+ query: unknown;
366
+ headers: unknown;
367
+ response: {
368
+ 200: SearchResponse | {
369
+ error: string;
370
+ details: string;
371
+ };
372
+ 422: {
373
+ type: "validation";
374
+ on: string;
375
+ summary?: string;
376
+ message?: string;
377
+ found?: unknown;
378
+ property?: string;
379
+ expected?: string;
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ } & {
387
+ api: {
388
+ conversations: {
389
+ log: {
390
+ post: {
391
+ body: {
392
+ agent_id: string;
393
+ content: string;
394
+ session_id: string;
395
+ user_id: string;
396
+ channel: string;
397
+ role: "user" | "assistant" | "system";
398
+ timestamp: string;
399
+ };
400
+ params: {};
401
+ query: unknown;
402
+ headers: unknown;
403
+ response: {
404
+ 200: {
405
+ ok: boolean;
406
+ error?: undefined;
407
+ details?: undefined;
408
+ } | {
409
+ error: string;
410
+ details: string;
411
+ ok?: undefined;
412
+ };
413
+ 422: {
414
+ type: "validation";
415
+ on: string;
416
+ summary?: string;
417
+ message?: string;
418
+ found?: unknown;
419
+ property?: string;
420
+ expected?: string;
421
+ };
422
+ };
423
+ };
424
+ };
425
+ };
426
+ };
427
+ } & {
428
+ api: {
429
+ conversations: {
430
+ summarize: {
431
+ post: {
432
+ body: {
433
+ reason?: string | undefined;
434
+ agent_id: string;
435
+ session_id: string;
436
+ user_id: string;
437
+ channel: string;
438
+ messages: {
439
+ content: string;
440
+ role: "user" | "assistant" | "system";
441
+ timestamp: string;
442
+ }[];
443
+ };
444
+ params: {};
445
+ query: unknown;
446
+ headers: unknown;
447
+ response: {
448
+ 200: SummarizeResponse | {
449
+ error: string;
450
+ details?: undefined;
451
+ } | {
452
+ error: string;
453
+ details: string;
454
+ };
455
+ 422: {
456
+ type: "validation";
457
+ on: string;
458
+ summary?: string;
459
+ message?: string;
460
+ found?: unknown;
461
+ property?: string;
462
+ expected?: string;
463
+ };
464
+ };
465
+ };
466
+ };
467
+ };
468
+ };
469
+ } & {
470
+ api: {
471
+ entities: {
472
+ ":type": {
473
+ get: {
474
+ body: unknown;
475
+ params: {
476
+ type: string;
477
+ } & {};
478
+ query: unknown;
479
+ headers: unknown;
480
+ response: {
481
+ 200: {
482
+ error: string;
483
+ entities?: undefined;
484
+ count?: undefined;
485
+ details?: undefined;
486
+ } | {
487
+ entities: Record<string, unknown>[];
488
+ count: number;
489
+ error?: undefined;
490
+ details?: undefined;
491
+ } | {
492
+ error: string;
493
+ details: string;
494
+ entities?: undefined;
495
+ count?: undefined;
496
+ };
497
+ 422: {
498
+ type: "validation";
499
+ on: string;
500
+ summary?: string;
501
+ message?: string;
502
+ found?: unknown;
503
+ property?: string;
504
+ expected?: string;
505
+ };
506
+ };
507
+ };
508
+ };
509
+ };
510
+ };
511
+ } & {
512
+ api: {
513
+ entities: {
514
+ ":type": {
515
+ ":id": {
516
+ get: {
517
+ body: unknown;
518
+ params: {
519
+ id: string;
520
+ type: string;
521
+ } & {};
522
+ query: unknown;
523
+ headers: unknown;
524
+ response: {
525
+ 200: {
526
+ entity: Record<string, unknown> | null;
527
+ relationships: Array<{
528
+ type: string;
529
+ direction: string;
530
+ target: Record<string, unknown>;
531
+ }>;
532
+ } | {
533
+ error: string;
534
+ details?: undefined;
535
+ } | {
536
+ error: string;
537
+ details: string;
538
+ };
539
+ 422: {
540
+ type: "validation";
541
+ on: string;
542
+ summary?: string;
543
+ message?: string;
544
+ found?: unknown;
545
+ property?: string;
546
+ expected?: string;
547
+ };
548
+ };
549
+ };
550
+ };
551
+ };
552
+ };
553
+ };
554
+ } & {
555
+ api: {
556
+ entities: {
557
+ ":type": {
558
+ ":id": {
559
+ related: {
560
+ get: {
561
+ body: unknown;
562
+ params: {
563
+ id: string;
564
+ type: string;
565
+ } & {};
566
+ query: unknown;
567
+ headers: unknown;
568
+ response: {
569
+ 200: {
570
+ error: string;
571
+ related?: undefined;
572
+ count?: undefined;
573
+ details?: undefined;
574
+ } | {
575
+ related: {
576
+ entity: Record<string, unknown>;
577
+ relationship: string;
578
+ distance: number;
579
+ }[];
580
+ count: number;
581
+ error?: undefined;
582
+ details?: undefined;
583
+ } | {
584
+ error: string;
585
+ details: string;
586
+ related?: undefined;
587
+ count?: undefined;
588
+ };
589
+ 422: {
590
+ type: "validation";
591
+ on: string;
592
+ summary?: string;
593
+ message?: string;
594
+ found?: unknown;
595
+ property?: string;
596
+ expected?: string;
597
+ };
598
+ };
599
+ };
600
+ };
601
+ };
602
+ };
603
+ };
604
+ };
605
+ } & {
606
+ api: {
607
+ entities: {
608
+ extract: {
609
+ post: {
610
+ body: {
611
+ text: string;
612
+ };
613
+ params: {};
614
+ query: unknown;
615
+ headers: unknown;
616
+ response: {
617
+ 200: ExtractionResult | {
618
+ error: string;
619
+ details?: undefined;
620
+ } | {
621
+ error: string;
622
+ details: string;
623
+ };
624
+ 422: {
625
+ type: "validation";
626
+ on: string;
627
+ summary?: string;
628
+ message?: string;
629
+ found?: unknown;
630
+ property?: string;
631
+ expected?: string;
632
+ };
633
+ };
634
+ };
635
+ };
636
+ };
637
+ };
638
+ } & {
639
+ api: {
640
+ health: {
641
+ get: {
642
+ body: unknown;
643
+ params: {};
644
+ query: unknown;
645
+ headers: unknown;
646
+ response: {
647
+ 200: HealthResponse;
648
+ };
649
+ };
650
+ };
651
+ };
652
+ } & {
653
+ api: {
654
+ sync: {
655
+ retry: {
656
+ post: {
657
+ body: unknown;
658
+ params: {};
659
+ query: unknown;
660
+ headers: unknown;
661
+ response: {
662
+ 200: {
663
+ processed: number;
664
+ succeeded: number;
665
+ failed: number;
666
+ } | {
667
+ error: string;
668
+ details: string;
669
+ };
670
+ };
671
+ };
672
+ };
673
+ };
674
+ };
675
+ } & {
676
+ api: {
677
+ sync: {
678
+ queue: {
679
+ get: {
680
+ body: unknown;
681
+ params: {};
682
+ query: unknown;
683
+ headers: unknown;
684
+ response: {
685
+ 200: {
686
+ items: SyncQueueItem[];
687
+ count: number;
688
+ };
689
+ };
690
+ };
691
+ };
692
+ };
693
+ };
694
+ } & {
695
+ api: {
696
+ admin: {
697
+ "migrate-markdown": {
698
+ post: {
699
+ body: {
700
+ dry_run?: boolean | undefined;
701
+ agent_id: string;
702
+ markdown_paths: string[];
703
+ };
704
+ params: {};
705
+ query: unknown;
706
+ headers: unknown;
707
+ response: {
708
+ 200: {
709
+ migrated: number;
710
+ skipped: number;
711
+ errors: string[];
712
+ memories: Array<{
713
+ id: string;
714
+ content_preview: string;
715
+ }>;
716
+ } | {
717
+ error: string;
718
+ details: string;
719
+ };
720
+ 422: {
721
+ type: "validation";
722
+ on: string;
723
+ summary?: string;
724
+ message?: string;
725
+ found?: unknown;
726
+ property?: string;
727
+ expected?: string;
728
+ };
729
+ };
730
+ };
731
+ };
732
+ };
733
+ };
734
+ } & {
735
+ api: {
736
+ admin: {
737
+ "daily-digest": {
738
+ post: {
739
+ body: unknown;
740
+ params: {};
741
+ query: unknown;
742
+ headers: unknown;
743
+ response: {
744
+ 200: {
745
+ error: string;
746
+ };
747
+ };
748
+ };
749
+ };
750
+ };
751
+ };
752
+ }, {
753
+ derive: {};
754
+ resolve: {};
755
+ schema: {};
756
+ standaloneSchema: {};
757
+ response: {};
758
+ }, {
759
+ derive: {};
760
+ resolve: {};
761
+ schema: {};
762
+ standaloneSchema: {};
763
+ response: {
764
+ 200: {
765
+ error: string;
766
+ code: string;
767
+ details?: undefined;
768
+ } | {
769
+ error: string;
770
+ code: string;
771
+ details: unknown;
772
+ } | {
773
+ error: string;
774
+ details: string;
775
+ code?: undefined;
776
+ } | {
777
+ error: string;
778
+ code?: undefined;
779
+ details?: undefined;
780
+ };
781
+ };
782
+ } & {
783
+ derive: {};
784
+ resolve: {};
785
+ schema: {};
786
+ standaloneSchema: {};
787
+ response: {};
788
+ }>;
789
+
790
+ export { Config, ConversationLogEntry, CreateMemoryResponse, ExtractionResult, HealthResponse, ListParams, Memory, MemoryService, ResolvedConfig, SearchParams, SearchResponse, StoreParams, StoreResult, SummarizeResponse, SyncQueueItem, Tier, UpdateParams, configSummary, createApp, defineConfig, loadConfig };