@plur-ai/core 0.2.8 → 0.2.9

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 (2) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -812
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plur-ai/core",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/dist/index.d.ts DELETED
@@ -1,812 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const KnowledgeAnchorSchema: z.ZodObject<{
4
- path: z.ZodString;
5
- relevance: z.ZodDefault<z.ZodEnum<["primary", "supporting", "example"]>>;
6
- snippet: z.ZodOptional<z.ZodString>;
7
- snippet_extracted_at: z.ZodOptional<z.ZodString>;
8
- }, "strip", z.ZodTypeAny, {
9
- path: string;
10
- relevance: "primary" | "supporting" | "example";
11
- snippet?: string | undefined;
12
- snippet_extracted_at?: string | undefined;
13
- }, {
14
- path: string;
15
- relevance?: "primary" | "supporting" | "example" | undefined;
16
- snippet?: string | undefined;
17
- snippet_extracted_at?: string | undefined;
18
- }>;
19
- declare const AssociationSchema: z.ZodObject<{
20
- target_type: z.ZodEnum<["engram", "document"]>;
21
- target: z.ZodString;
22
- strength: z.ZodNumber;
23
- type: z.ZodEnum<["semantic", "temporal", "causal", "co_accessed"]>;
24
- updated_at: z.ZodOptional<z.ZodString>;
25
- }, "strip", z.ZodTypeAny, {
26
- type: "semantic" | "temporal" | "causal" | "co_accessed";
27
- target_type: "engram" | "document";
28
- target: string;
29
- strength: number;
30
- updated_at?: string | undefined;
31
- }, {
32
- type: "semantic" | "temporal" | "causal" | "co_accessed";
33
- target_type: "engram" | "document";
34
- target: string;
35
- strength: number;
36
- updated_at?: string | undefined;
37
- }>;
38
- declare const EngramSchema: z.ZodObject<{
39
- id: z.ZodString;
40
- version: z.ZodDefault<z.ZodNumber>;
41
- status: z.ZodEnum<["active", "dormant", "retired", "candidate"]>;
42
- consolidated: z.ZodDefault<z.ZodBoolean>;
43
- type: z.ZodEnum<["behavioral", "terminological", "procedural", "architectural"]>;
44
- scope: z.ZodString;
45
- visibility: z.ZodDefault<z.ZodEnum<["private", "public", "template"]>>;
46
- statement: z.ZodString;
47
- rationale: z.ZodOptional<z.ZodString>;
48
- contraindications: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
49
- source_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
- derivation_count: z.ZodDefault<z.ZodNumber>;
51
- pack: z.ZodDefault<z.ZodNullable<z.ZodString>>;
52
- abstract: z.ZodDefault<z.ZodNullable<z.ZodString>>;
53
- derived_from: z.ZodDefault<z.ZodNullable<z.ZodString>>;
54
- knowledge_type: z.ZodOptional<z.ZodObject<{
55
- memory_class: z.ZodEnum<["semantic", "episodic", "procedural", "metacognitive"]>;
56
- cognitive_level: z.ZodEnum<["remember", "understand", "apply", "analyze", "evaluate", "create"]>;
57
- }, "strip", z.ZodTypeAny, {
58
- memory_class: "procedural" | "semantic" | "episodic" | "metacognitive";
59
- cognitive_level: "remember" | "understand" | "apply" | "analyze" | "evaluate" | "create";
60
- }, {
61
- memory_class: "procedural" | "semantic" | "episodic" | "metacognitive";
62
- cognitive_level: "remember" | "understand" | "apply" | "analyze" | "evaluate" | "create";
63
- }>>;
64
- domain: z.ZodOptional<z.ZodString>;
65
- tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
66
- activation: z.ZodDefault<z.ZodObject<{
67
- retrieval_strength: z.ZodNumber;
68
- storage_strength: z.ZodNumber;
69
- frequency: z.ZodNumber;
70
- last_accessed: z.ZodString;
71
- }, "strip", z.ZodTypeAny, {
72
- retrieval_strength: number;
73
- storage_strength: number;
74
- frequency: number;
75
- last_accessed: string;
76
- }, {
77
- retrieval_strength: number;
78
- storage_strength: number;
79
- frequency: number;
80
- last_accessed: string;
81
- }>>;
82
- relations: z.ZodOptional<z.ZodObject<{
83
- broader: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
84
- narrower: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
85
- related: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
86
- conflicts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
87
- }, "strip", z.ZodTypeAny, {
88
- broader: string[];
89
- narrower: string[];
90
- related: string[];
91
- conflicts: string[];
92
- }, {
93
- broader?: string[] | undefined;
94
- narrower?: string[] | undefined;
95
- related?: string[] | undefined;
96
- conflicts?: string[] | undefined;
97
- }>>;
98
- associations: z.ZodDefault<z.ZodArray<z.ZodObject<{
99
- target_type: z.ZodEnum<["engram", "document"]>;
100
- target: z.ZodString;
101
- strength: z.ZodNumber;
102
- type: z.ZodEnum<["semantic", "temporal", "causal", "co_accessed"]>;
103
- updated_at: z.ZodOptional<z.ZodString>;
104
- }, "strip", z.ZodTypeAny, {
105
- type: "semantic" | "temporal" | "causal" | "co_accessed";
106
- target_type: "engram" | "document";
107
- target: string;
108
- strength: number;
109
- updated_at?: string | undefined;
110
- }, {
111
- type: "semantic" | "temporal" | "causal" | "co_accessed";
112
- target_type: "engram" | "document";
113
- target: string;
114
- strength: number;
115
- updated_at?: string | undefined;
116
- }>, "many">>;
117
- knowledge_anchors: z.ZodDefault<z.ZodArray<z.ZodObject<{
118
- path: z.ZodString;
119
- relevance: z.ZodDefault<z.ZodEnum<["primary", "supporting", "example"]>>;
120
- snippet: z.ZodOptional<z.ZodString>;
121
- snippet_extracted_at: z.ZodOptional<z.ZodString>;
122
- }, "strip", z.ZodTypeAny, {
123
- path: string;
124
- relevance: "primary" | "supporting" | "example";
125
- snippet?: string | undefined;
126
- snippet_extracted_at?: string | undefined;
127
- }, {
128
- path: string;
129
- relevance?: "primary" | "supporting" | "example" | undefined;
130
- snippet?: string | undefined;
131
- snippet_extracted_at?: string | undefined;
132
- }>, "many">>;
133
- dual_coding: z.ZodOptional<z.ZodEffects<z.ZodObject<{
134
- example: z.ZodOptional<z.ZodString>;
135
- analogy: z.ZodOptional<z.ZodString>;
136
- }, "strip", z.ZodTypeAny, {
137
- example?: string | undefined;
138
- analogy?: string | undefined;
139
- }, {
140
- example?: string | undefined;
141
- analogy?: string | undefined;
142
- }>, {
143
- example?: string | undefined;
144
- analogy?: string | undefined;
145
- }, {
146
- example?: string | undefined;
147
- analogy?: string | undefined;
148
- }>>;
149
- provenance: z.ZodOptional<z.ZodObject<{
150
- origin: z.ZodString;
151
- chain: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
152
- signature: z.ZodDefault<z.ZodNullable<z.ZodString>>;
153
- license: z.ZodDefault<z.ZodString>;
154
- }, "strip", z.ZodTypeAny, {
155
- origin: string;
156
- chain: string[];
157
- signature: string | null;
158
- license: string;
159
- }, {
160
- origin: string;
161
- chain?: string[] | undefined;
162
- signature?: string | null | undefined;
163
- license?: string | undefined;
164
- }>>;
165
- feedback_signals: z.ZodDefault<z.ZodObject<{
166
- positive: z.ZodDefault<z.ZodNumber>;
167
- negative: z.ZodDefault<z.ZodNumber>;
168
- neutral: z.ZodDefault<z.ZodNumber>;
169
- }, "strip", z.ZodTypeAny, {
170
- positive: number;
171
- negative: number;
172
- neutral: number;
173
- }, {
174
- positive?: number | undefined;
175
- negative?: number | undefined;
176
- neutral?: number | undefined;
177
- }>>;
178
- /** Typed entity references extracted from statement. Enables graph queries. */
179
- entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
180
- name: z.ZodString;
181
- type: z.ZodEnum<["person", "organization", "technology", "concept", "project", "tool", "place", "event", "standard", "other"]>;
182
- uri: z.ZodOptional<z.ZodString>;
183
- }, "strip", z.ZodTypeAny, {
184
- type: "person" | "organization" | "technology" | "concept" | "project" | "tool" | "place" | "event" | "standard" | "other";
185
- name: string;
186
- uri?: string | undefined;
187
- }, {
188
- type: "person" | "organization" | "technology" | "concept" | "project" | "tool" | "place" | "event" | "standard" | "other";
189
- name: string;
190
- uri?: string | undefined;
191
- }>, "many">>;
192
- /** Temporal validity window. When is this knowledge true? */
193
- temporal: z.ZodOptional<z.ZodObject<{
194
- learned_at: z.ZodString;
195
- valid_from: z.ZodOptional<z.ZodString>;
196
- valid_until: z.ZodOptional<z.ZodString>;
197
- ingested_at: z.ZodOptional<z.ZodString>;
198
- }, "strip", z.ZodTypeAny, {
199
- learned_at: string;
200
- valid_from?: string | undefined;
201
- valid_until?: string | undefined;
202
- ingested_at?: string | undefined;
203
- }, {
204
- learned_at: string;
205
- valid_from?: string | undefined;
206
- valid_until?: string | undefined;
207
- ingested_at?: string | undefined;
208
- }>>;
209
- /** Automatic usage tracking. Injections, hits, misses. */
210
- usage: z.ZodOptional<z.ZodObject<{
211
- injections: z.ZodDefault<z.ZodNumber>;
212
- hits: z.ZodDefault<z.ZodNumber>;
213
- misses: z.ZodDefault<z.ZodNumber>;
214
- last_hit_at: z.ZodOptional<z.ZodString>;
215
- }, "strip", z.ZodTypeAny, {
216
- injections: number;
217
- hits: number;
218
- misses: number;
219
- last_hit_at?: string | undefined;
220
- }, {
221
- injections?: number | undefined;
222
- hits?: number | undefined;
223
- misses?: number | undefined;
224
- last_hit_at?: string | undefined;
225
- }>>;
226
- /** Episodic context: emotional weight, confidence, trigger. */
227
- episodic: z.ZodOptional<z.ZodObject<{
228
- emotional_weight: z.ZodDefault<z.ZodNumber>;
229
- confidence: z.ZodDefault<z.ZodNumber>;
230
- trigger_context: z.ZodOptional<z.ZodString>;
231
- journal_ref: z.ZodOptional<z.ZodString>;
232
- }, "strip", z.ZodTypeAny, {
233
- emotional_weight: number;
234
- confidence: number;
235
- trigger_context?: string | undefined;
236
- journal_ref?: string | undefined;
237
- }, {
238
- emotional_weight?: number | undefined;
239
- confidence?: number | undefined;
240
- trigger_context?: string | undefined;
241
- journal_ref?: string | undefined;
242
- }>>;
243
- /** Exchange marketplace metadata: fitness, adoption, diversity. */
244
- exchange: z.ZodOptional<z.ZodObject<{
245
- fitness_score: z.ZodOptional<z.ZodNumber>;
246
- environmental_diversity: z.ZodDefault<z.ZodNumber>;
247
- adoption_count: z.ZodDefault<z.ZodNumber>;
248
- contradiction_rate: z.ZodDefault<z.ZodNumber>;
249
- }, "strip", z.ZodTypeAny, {
250
- environmental_diversity: number;
251
- adoption_count: number;
252
- contradiction_rate: number;
253
- fitness_score?: number | undefined;
254
- }, {
255
- fitness_score?: number | undefined;
256
- environmental_diversity?: number | undefined;
257
- adoption_count?: number | undefined;
258
- contradiction_rate?: number | undefined;
259
- }>>;
260
- /** Extensible key-value data for domain-specific fields. */
261
- structured_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
262
- }, "strip", z.ZodTypeAny, {
263
- type: "behavioral" | "architectural" | "procedural" | "terminological";
264
- status: "active" | "dormant" | "retired" | "candidate";
265
- id: string;
266
- version: number;
267
- consolidated: boolean;
268
- scope: string;
269
- visibility: "private" | "public" | "template";
270
- statement: string;
271
- derivation_count: number;
272
- pack: string | null;
273
- abstract: string | null;
274
- derived_from: string | null;
275
- tags: string[];
276
- activation: {
277
- retrieval_strength: number;
278
- storage_strength: number;
279
- frequency: number;
280
- last_accessed: string;
281
- };
282
- associations: {
283
- type: "semantic" | "temporal" | "causal" | "co_accessed";
284
- target_type: "engram" | "document";
285
- target: string;
286
- strength: number;
287
- updated_at?: string | undefined;
288
- }[];
289
- knowledge_anchors: {
290
- path: string;
291
- relevance: "primary" | "supporting" | "example";
292
- snippet?: string | undefined;
293
- snippet_extracted_at?: string | undefined;
294
- }[];
295
- feedback_signals: {
296
- positive: number;
297
- negative: number;
298
- neutral: number;
299
- };
300
- rationale?: string | undefined;
301
- contraindications?: string[] | undefined;
302
- source_patterns?: string[] | undefined;
303
- episodic?: {
304
- emotional_weight: number;
305
- confidence: number;
306
- trigger_context?: string | undefined;
307
- journal_ref?: string | undefined;
308
- } | undefined;
309
- knowledge_type?: {
310
- memory_class: "procedural" | "semantic" | "episodic" | "metacognitive";
311
- cognitive_level: "remember" | "understand" | "apply" | "analyze" | "evaluate" | "create";
312
- } | undefined;
313
- domain?: string | undefined;
314
- relations?: {
315
- broader: string[];
316
- narrower: string[];
317
- related: string[];
318
- conflicts: string[];
319
- } | undefined;
320
- temporal?: {
321
- learned_at: string;
322
- valid_from?: string | undefined;
323
- valid_until?: string | undefined;
324
- ingested_at?: string | undefined;
325
- } | undefined;
326
- dual_coding?: {
327
- example?: string | undefined;
328
- analogy?: string | undefined;
329
- } | undefined;
330
- provenance?: {
331
- origin: string;
332
- chain: string[];
333
- signature: string | null;
334
- license: string;
335
- } | undefined;
336
- entities?: {
337
- type: "person" | "organization" | "technology" | "concept" | "project" | "tool" | "place" | "event" | "standard" | "other";
338
- name: string;
339
- uri?: string | undefined;
340
- }[] | undefined;
341
- usage?: {
342
- injections: number;
343
- hits: number;
344
- misses: number;
345
- last_hit_at?: string | undefined;
346
- } | undefined;
347
- exchange?: {
348
- environmental_diversity: number;
349
- adoption_count: number;
350
- contradiction_rate: number;
351
- fitness_score?: number | undefined;
352
- } | undefined;
353
- structured_data?: Record<string, unknown> | undefined;
354
- }, {
355
- type: "behavioral" | "architectural" | "procedural" | "terminological";
356
- status: "active" | "dormant" | "retired" | "candidate";
357
- id: string;
358
- scope: string;
359
- statement: string;
360
- version?: number | undefined;
361
- consolidated?: boolean | undefined;
362
- visibility?: "private" | "public" | "template" | undefined;
363
- rationale?: string | undefined;
364
- contraindications?: string[] | undefined;
365
- source_patterns?: string[] | undefined;
366
- derivation_count?: number | undefined;
367
- pack?: string | null | undefined;
368
- abstract?: string | null | undefined;
369
- derived_from?: string | null | undefined;
370
- episodic?: {
371
- emotional_weight?: number | undefined;
372
- confidence?: number | undefined;
373
- trigger_context?: string | undefined;
374
- journal_ref?: string | undefined;
375
- } | undefined;
376
- knowledge_type?: {
377
- memory_class: "procedural" | "semantic" | "episodic" | "metacognitive";
378
- cognitive_level: "remember" | "understand" | "apply" | "analyze" | "evaluate" | "create";
379
- } | undefined;
380
- domain?: string | undefined;
381
- tags?: string[] | undefined;
382
- activation?: {
383
- retrieval_strength: number;
384
- storage_strength: number;
385
- frequency: number;
386
- last_accessed: string;
387
- } | undefined;
388
- relations?: {
389
- broader?: string[] | undefined;
390
- narrower?: string[] | undefined;
391
- related?: string[] | undefined;
392
- conflicts?: string[] | undefined;
393
- } | undefined;
394
- temporal?: {
395
- learned_at: string;
396
- valid_from?: string | undefined;
397
- valid_until?: string | undefined;
398
- ingested_at?: string | undefined;
399
- } | undefined;
400
- associations?: {
401
- type: "semantic" | "temporal" | "causal" | "co_accessed";
402
- target_type: "engram" | "document";
403
- target: string;
404
- strength: number;
405
- updated_at?: string | undefined;
406
- }[] | undefined;
407
- knowledge_anchors?: {
408
- path: string;
409
- relevance?: "primary" | "supporting" | "example" | undefined;
410
- snippet?: string | undefined;
411
- snippet_extracted_at?: string | undefined;
412
- }[] | undefined;
413
- dual_coding?: {
414
- example?: string | undefined;
415
- analogy?: string | undefined;
416
- } | undefined;
417
- provenance?: {
418
- origin: string;
419
- chain?: string[] | undefined;
420
- signature?: string | null | undefined;
421
- license?: string | undefined;
422
- } | undefined;
423
- feedback_signals?: {
424
- positive?: number | undefined;
425
- negative?: number | undefined;
426
- neutral?: number | undefined;
427
- } | undefined;
428
- entities?: {
429
- type: "person" | "organization" | "technology" | "concept" | "project" | "tool" | "place" | "event" | "standard" | "other";
430
- name: string;
431
- uri?: string | undefined;
432
- }[] | undefined;
433
- usage?: {
434
- injections?: number | undefined;
435
- hits?: number | undefined;
436
- misses?: number | undefined;
437
- last_hit_at?: string | undefined;
438
- } | undefined;
439
- exchange?: {
440
- fitness_score?: number | undefined;
441
- environmental_diversity?: number | undefined;
442
- adoption_count?: number | undefined;
443
- contradiction_rate?: number | undefined;
444
- } | undefined;
445
- structured_data?: Record<string, unknown> | undefined;
446
- }>;
447
- type Engram = z.infer<typeof EngramSchema>;
448
- type KnowledgeAnchor = z.infer<typeof KnowledgeAnchorSchema>;
449
- type Association = z.infer<typeof AssociationSchema>;
450
-
451
- declare const PackManifestSchema: z.ZodObject<{
452
- name: z.ZodString;
453
- version: z.ZodString;
454
- description: z.ZodOptional<z.ZodString>;
455
- creator: z.ZodOptional<z.ZodString>;
456
- license: z.ZodDefault<z.ZodString>;
457
- tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
458
- metadata: z.ZodOptional<z.ZodObject<{
459
- id: z.ZodOptional<z.ZodString>;
460
- injection_policy: z.ZodDefault<z.ZodEnum<["on_match", "on_request", "always"]>>;
461
- match_terms: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
462
- domain: z.ZodOptional<z.ZodString>;
463
- engram_count: z.ZodOptional<z.ZodNumber>;
464
- }, "strip", z.ZodTypeAny, {
465
- injection_policy: "on_match" | "on_request" | "always";
466
- match_terms: string[];
467
- id?: string | undefined;
468
- domain?: string | undefined;
469
- engram_count?: number | undefined;
470
- }, {
471
- id?: string | undefined;
472
- domain?: string | undefined;
473
- injection_policy?: "on_match" | "on_request" | "always" | undefined;
474
- match_terms?: string[] | undefined;
475
- engram_count?: number | undefined;
476
- }>>;
477
- 'x-datacore': z.ZodOptional<z.ZodObject<{
478
- id: z.ZodString;
479
- injection_policy: z.ZodEnum<["on_match", "on_request"]>;
480
- match_terms: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
481
- domain: z.ZodOptional<z.ZodString>;
482
- engram_count: z.ZodNumber;
483
- }, "strip", z.ZodTypeAny, {
484
- id: string;
485
- injection_policy: "on_match" | "on_request";
486
- match_terms: string[];
487
- engram_count: number;
488
- domain?: string | undefined;
489
- }, {
490
- id: string;
491
- injection_policy: "on_match" | "on_request";
492
- engram_count: number;
493
- domain?: string | undefined;
494
- match_terms?: string[] | undefined;
495
- }>>;
496
- }, "strip", z.ZodTypeAny, {
497
- version: string;
498
- tags: string[];
499
- license: string;
500
- name: string;
501
- description?: string | undefined;
502
- creator?: string | undefined;
503
- metadata?: {
504
- injection_policy: "on_match" | "on_request" | "always";
505
- match_terms: string[];
506
- id?: string | undefined;
507
- domain?: string | undefined;
508
- engram_count?: number | undefined;
509
- } | undefined;
510
- 'x-datacore'?: {
511
- id: string;
512
- injection_policy: "on_match" | "on_request";
513
- match_terms: string[];
514
- engram_count: number;
515
- domain?: string | undefined;
516
- } | undefined;
517
- }, {
518
- version: string;
519
- name: string;
520
- tags?: string[] | undefined;
521
- license?: string | undefined;
522
- description?: string | undefined;
523
- creator?: string | undefined;
524
- metadata?: {
525
- id?: string | undefined;
526
- domain?: string | undefined;
527
- injection_policy?: "on_match" | "on_request" | "always" | undefined;
528
- match_terms?: string[] | undefined;
529
- engram_count?: number | undefined;
530
- } | undefined;
531
- 'x-datacore'?: {
532
- id: string;
533
- injection_policy: "on_match" | "on_request";
534
- engram_count: number;
535
- domain?: string | undefined;
536
- match_terms?: string[] | undefined;
537
- } | undefined;
538
- }>;
539
- type PackManifest = z.infer<typeof PackManifestSchema>;
540
-
541
- interface PackInfo {
542
- name: string;
543
- path: string;
544
- engram_count: number;
545
- manifest?: PackManifest;
546
- }
547
- declare function listPacks(packsDir: string): PackInfo[];
548
-
549
- interface SyncStatus {
550
- initialized: boolean;
551
- remote: string | null;
552
- dirty: boolean;
553
- branch: string | null;
554
- ahead: number;
555
- behind: number;
556
- }
557
- interface SyncResult {
558
- action: 'initialized' | 'committed' | 'synced' | 'up-to-date';
559
- message: string;
560
- remote: string | null;
561
- files_changed: number;
562
- }
563
-
564
- declare const EpisodeSchema: z.ZodObject<{
565
- id: z.ZodString;
566
- summary: z.ZodString;
567
- agent: z.ZodOptional<z.ZodString>;
568
- channel: z.ZodOptional<z.ZodString>;
569
- session_id: z.ZodOptional<z.ZodString>;
570
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
571
- timestamp: z.ZodString;
572
- }, "strip", z.ZodTypeAny, {
573
- id: string;
574
- summary: string;
575
- timestamp: string;
576
- tags?: string[] | undefined;
577
- agent?: string | undefined;
578
- channel?: string | undefined;
579
- session_id?: string | undefined;
580
- }, {
581
- id: string;
582
- summary: string;
583
- timestamp: string;
584
- tags?: string[] | undefined;
585
- agent?: string | undefined;
586
- channel?: string | undefined;
587
- session_id?: string | undefined;
588
- }>;
589
- type Episode = z.infer<typeof EpisodeSchema>;
590
-
591
- declare const PlurConfigSchema: z.ZodObject<{
592
- auto_learn: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
593
- auto_capture: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
594
- injection_budget: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
595
- decay_enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
596
- decay_threshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
597
- packs: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
598
- injection: z.ZodOptional<z.ZodDefault<z.ZodObject<{
599
- spread_cap: z.ZodDefault<z.ZodNumber>;
600
- spread_budget: z.ZodDefault<z.ZodNumber>;
601
- co_access: z.ZodDefault<z.ZodBoolean>;
602
- }, "strip", z.ZodTypeAny, {
603
- spread_cap: number;
604
- spread_budget: number;
605
- co_access: boolean;
606
- }, {
607
- spread_cap?: number | undefined;
608
- spread_budget?: number | undefined;
609
- co_access?: boolean | undefined;
610
- }>>>;
611
- }, "strip", z.ZodTypeAny, {
612
- auto_learn?: boolean | undefined;
613
- auto_capture?: boolean | undefined;
614
- injection_budget?: number | undefined;
615
- decay_enabled?: boolean | undefined;
616
- decay_threshold?: number | undefined;
617
- packs?: string[] | undefined;
618
- injection?: {
619
- spread_cap: number;
620
- spread_budget: number;
621
- co_access: boolean;
622
- } | undefined;
623
- }, {
624
- auto_learn?: boolean | undefined;
625
- auto_capture?: boolean | undefined;
626
- injection_budget?: number | undefined;
627
- decay_enabled?: boolean | undefined;
628
- decay_threshold?: number | undefined;
629
- packs?: string[] | undefined;
630
- injection?: {
631
- spread_cap?: number | undefined;
632
- spread_budget?: number | undefined;
633
- co_access?: boolean | undefined;
634
- } | undefined;
635
- }>;
636
- type PlurConfig = z.infer<typeof PlurConfigSchema>;
637
-
638
- interface LearnContext {
639
- type?: 'behavioral' | 'terminological' | 'procedural' | 'architectural';
640
- scope?: string;
641
- domain?: string;
642
- source?: string;
643
- }
644
- /**
645
- * Function that calls an LLM. Model-agnostic — consumer provides this.
646
- * Takes a prompt, returns the LLM's text response.
647
- */
648
- type LlmFunction = (prompt: string) => Promise<string>;
649
- interface RecallOptions {
650
- scope?: string;
651
- domain?: string;
652
- limit?: number;
653
- min_strength?: number;
654
- /** Search mode: 'fast' (BM25, default) or 'agentic' (LLM-assisted semantic search) */
655
- mode?: 'fast' | 'agentic';
656
- /** LLM function for agentic mode. Required when mode='agentic'. */
657
- llm?: LlmFunction;
658
- }
659
- interface InjectOptions {
660
- budget?: number;
661
- scope?: string;
662
- boost_recent?: boolean;
663
- }
664
- interface InjectionResult {
665
- directives: string;
666
- consider: string;
667
- count: number;
668
- tokens_used: number;
669
- }
670
- interface CaptureContext {
671
- agent?: string;
672
- channel?: string;
673
- session_id?: string;
674
- tags?: string[];
675
- }
676
- interface TimelineQuery {
677
- since?: Date;
678
- until?: Date;
679
- agent?: string;
680
- channel?: string;
681
- search?: string;
682
- }
683
-
684
- /** Build searchable text from all engram fields */
685
- declare function engramSearchText(engram: Engram): string;
686
-
687
- interface PlurPaths {
688
- root: string;
689
- engrams: string;
690
- episodes: string;
691
- candidates: string;
692
- packs: string;
693
- exchange: string;
694
- config: string;
695
- }
696
- declare function detectPlurStorage(explicitPath?: string): PlurPaths;
697
-
698
- /**
699
- * Non-blocking version check against npm registry.
700
- * Caches result in memory — one fetch per process lifetime.
701
- * Never throws or blocks startup.
702
- */
703
- interface VersionCheckResult {
704
- current: string;
705
- latest: string | null;
706
- updateAvailable: boolean;
707
- checkedAt: number | null;
708
- }
709
- /**
710
- * Check npm for a newer version. Fetches once, caches forever (process lifetime).
711
- * Fire-and-forget: call at startup, read later via getCachedUpdateCheck().
712
- */
713
- declare function checkForUpdate(packageName: string, currentVersion: string, onResult?: (result: VersionCheckResult) => void): Promise<VersionCheckResult>;
714
- /**
715
- * Read the cached version check result. Returns null if checkForUpdate() hasn't
716
- * completed yet. This is the zero-cost read path for assemblers.
717
- */
718
- declare function getCachedUpdateCheck(packageName: string): VersionCheckResult | null;
719
- /** Clear cache (for testing). */
720
- declare function clearVersionCache(): void;
721
-
722
- interface IngestOptions {
723
- source?: string;
724
- extract_only?: boolean;
725
- scope?: string;
726
- domain?: string;
727
- }
728
- interface IngestCandidate {
729
- statement: string;
730
- type: 'behavioral' | 'architectural' | 'procedural';
731
- source?: string;
732
- }
733
- interface StatusResult {
734
- engram_count: number;
735
- episode_count: number;
736
- pack_count: number;
737
- storage_root: string;
738
- config: PlurConfig;
739
- }
740
- declare class Plur {
741
- private paths;
742
- private config;
743
- constructor(options?: {
744
- path?: string;
745
- });
746
- /** Create engram, detect conflicts, save. Returns the created engram. */
747
- learn(statement: string, context?: LearnContext): Engram;
748
- /**
749
- * Search engrams, filter by scope/domain/strength, reactivate accessed.
750
- * Supports two modes:
751
- * - 'fast' (default): BM25 keyword search, instant, no API calls
752
- * - 'agentic': LLM-assisted semantic search, higher accuracy, requires llm function
753
- */
754
- /** Search engrams using fast BM25 keyword matching. Sync, no API calls. */
755
- recall(query: string, options?: Omit<RecallOptions, 'mode' | 'llm'>): Engram[];
756
- /** Search engrams using LLM-assisted semantic filtering. Async, requires llm function. */
757
- recallAsync(query: string, options: RecallOptions & {
758
- llm: LlmFunction;
759
- }): Promise<Engram[]>;
760
- /** Search engrams using local embeddings (transformers.js). Async, no API calls. */
761
- recallSemantic(query: string, options?: Omit<RecallOptions, 'mode' | 'llm'>): Promise<Engram[]>;
762
- /** Hybrid search: BM25 + embeddings merged via Reciprocal Rank Fusion. Async, no API calls. */
763
- recallHybrid(query: string, options?: Omit<RecallOptions, 'mode' | 'llm'>): Promise<Engram[]>;
764
- /** Expanded search: LLM query expansion + hybrid search + RRF merge. Opt-in, requires LLM function. */
765
- recallExpanded(query: string, options: RecallOptions & {
766
- llm: LlmFunction;
767
- }): Promise<Engram[]>;
768
- /** Filter engrams by scope/domain/strength (shared by both modes) */
769
- private _filterEngrams;
770
- /** Reactivate accessed engrams (bump retrieval strength, frequency, last_accessed) */
771
- private _reactivateResults;
772
- /** Scored injection within token budget (BM25 only). Returns formatted strings. */
773
- inject(task: string, options?: InjectOptions): InjectionResult;
774
- /** Scored injection with embedding boost when available. Falls back to BM25 if embeddings not installed. */
775
- injectHybrid(task: string, options?: InjectOptions): Promise<InjectionResult>;
776
- private _formatInjection;
777
- /** Update feedback_signals and adjust retrieval_strength. */
778
- feedback(id: string, signal: 'positive' | 'negative' | 'neutral'): void;
779
- /** Set engram status to 'retired'. */
780
- forget(id: string, reason?: string): void;
781
- /** Capture an episodic memory. */
782
- capture(summary: string, context?: CaptureContext): Episode;
783
- /** Query the episode timeline. */
784
- timeline(query?: TimelineQuery): Episode[];
785
- /** Rule-based extraction of engram candidates from content. */
786
- ingest(content: string, options?: IngestOptions): IngestCandidate[];
787
- /** Install a pack from a source path. */
788
- installPack(source: string): {
789
- installed: number;
790
- name: string;
791
- };
792
- /** Export engrams as a shareable pack. */
793
- exportPack(engrams: Engram[], outputDir: string, manifest: {
794
- name: string;
795
- version: string;
796
- description?: string;
797
- creator?: string;
798
- }): {
799
- path: string;
800
- engram_count: number;
801
- };
802
- /** List all installed packs. */
803
- listPacks(): ReturnType<typeof listPacks>;
804
- /** Sync engrams to git. Initializes repo on first call, commits + push/pull on subsequent calls. */
805
- sync(remote?: string): SyncResult;
806
- /** Get git sync status without making changes. */
807
- syncStatus(): SyncStatus;
808
- /** Return system health info. */
809
- status(): StatusResult;
810
- }
811
-
812
- export { type Association, type CaptureContext, type Engram, type Episode, type IngestCandidate, type IngestOptions, type InjectOptions, type InjectionResult, type KnowledgeAnchor, type LearnContext, type LlmFunction, type PackManifest, Plur, type PlurConfig, type PlurPaths, type RecallOptions, type StatusResult, type SyncResult, type SyncStatus, type TimelineQuery, type VersionCheckResult, checkForUpdate, clearVersionCache, detectPlurStorage, engramSearchText, getCachedUpdateCheck };