claude-mem-lite 3.1.0 → 3.1.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/tool-schemas.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  // Single source of truth — used by server.mjs (runtime) and contract.test.mjs (validation tests)
3
3
 
4
4
  import { z } from 'zod';
5
+ import { CLI_INVOKE } from './cli-path.mjs';
5
6
 
6
7
  export const OBS_TYPE_ENUM = z.enum(['decision', 'bugfix', 'feature', 'refactor', 'discovery', 'change']);
7
8
 
@@ -92,6 +93,7 @@ export const memSearchSchema = {
92
93
  sort: z.enum(['relevance', 'time', 'importance']).optional().describe('Sort order: relevance (default, BM25), time (newest first), importance (highest first)'),
93
94
  include_noise: z.boolean().optional().describe('Include hook-llm fallback titles ("Modified X", "Worked on X", raw error logs) — hidden by default as they have ~3% access rate'),
94
95
  or: coerceBool.optional().describe('Force OR semantics between query terms from the start (default: AND with automatic OR-fallback when AND returns 0). Aligns with CLI --or.'),
96
+ deep: coerceBool.optional().describe('Opt-in LLM multi-query/HyDE deep search: one Haiku call rewrites the query into keyword/concept/HyDE variants, each runs the hybrid search, results RRF-fused. Observations-only; costs a Haiku call + seconds of latency. Use ONLY when a normal search missed because your wording differs from the stored terms (vocabulary mismatch). Default false; passive recall stays single-query.'),
95
97
  };
96
98
 
97
99
  export const memRecentSchema = {
@@ -348,8 +350,9 @@ export const tools = [
348
350
  ' - Investigating a concrete error keyword with obs_type="bugfix"\n' +
349
351
  ' - Looking for prior art on a module/feature before refactoring\n' +
350
352
  ' - User asks "have we seen this before" or references something not in visible context\n' +
353
+ ' - A normal search missed — set deep=true to LLM-rewrite the query (slower)\n' +
351
354
  '\n' +
352
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs search "<query>" [--type bugfix]',
355
+ 'Equivalent CLI: ' + CLI_INVOKE + ' search "<query>" [--type bugfix] [--deep]',
353
356
  inputSchema: memSearchSchema,
354
357
  },
355
358
  {
@@ -367,7 +370,7 @@ export const tools = [
367
370
  ' - User asks "what did we do yesterday / last" with no topic keyword\n' +
368
371
  ' - Verifying that a just-made change was captured as an observation\n' +
369
372
  '\n' +
370
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs recent [N]',
373
+ 'Equivalent CLI: ' + CLI_INVOKE + ' recent [N]',
371
374
  inputSchema: memRecentSchema,
372
375
  },
373
376
  {
@@ -387,7 +390,7 @@ export const tools = [
387
390
  ' - A search hit is interesting and you want its chronological neighbours\n' +
388
391
  ' - Replaying a session narrative around a known observation ID\n' +
389
392
  '\n' +
390
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs timeline --anchor <ID> [--before N --after N]',
393
+ 'Equivalent CLI: ' + CLI_INVOKE + ' timeline --anchor <ID> [--before N --after N]',
391
394
  inputSchema: memTimelineSchema,
392
395
  },
393
396
  {
@@ -407,7 +410,7 @@ export const tools = [
407
410
  '\n' +
408
411
  'On miss, response includes "Try: …" hint listing other sources the ID lives in.\n' +
409
412
  '\n' +
410
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs get <id>[,<id>,...] — accepts P#/S#/# prefix.',
413
+ 'Equivalent CLI: ' + CLI_INVOKE + ' get <id>[,<id>,...] — accepts P#/S#/# prefix.',
411
414
  inputSchema: memGetSchema,
412
415
  },
413
416
  {
@@ -425,7 +428,7 @@ export const tools = [
425
428
  ' - Cleaning up an observation saved from a test run or incorrect save\n' +
426
429
  ' - Always run once with confirm=false, then again with confirm=true\n' +
427
430
  '\n' +
428
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs delete <id>[,<id>,...] [--confirm]',
431
+ 'Equivalent CLI: ' + CLI_INVOKE + ' delete <id>[,<id>,...] [--confirm]',
429
432
  inputSchema: memDeleteSchema,
430
433
  hidden: true,
431
434
  },
@@ -444,7 +447,7 @@ export const tools = [
444
447
  ' - After a non-obvious architecture/tradeoff decision — set type="decision", lesson_learned="<constraint + why>"\n' +
445
448
  ' - User explicitly asks "remember this" or "save a note that ..."\n' +
446
449
  '\n' +
447
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs save --type bugfix --lesson "..." "<content>"',
450
+ 'Equivalent CLI: ' + CLI_INVOKE + ' save --type bugfix --lesson "..." "<content>"',
448
451
  inputSchema: memSaveSchema,
449
452
  },
450
453
  {
@@ -462,7 +465,7 @@ export const tools = [
462
465
  ' - Diagnosing why search feels sparse or noisy at a macro level\n' +
463
466
  ' - Auditing a project before major compression/maintenance\n' +
464
467
  '\n' +
465
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs stats [--project X] [--days 30]',
468
+ 'Equivalent CLI: ' + CLI_INVOKE + ' stats [--project X] [--days 30]',
466
469
  inputSchema: memStatsSchema,
467
470
  hidden: true,
468
471
  },
@@ -481,7 +484,7 @@ export const tools = [
481
484
  ' - After a major project phase completes and old per-file observations are noise\n' +
482
485
  ' - Stats show thousands of low-importance rows dragging search quality\n' +
483
486
  '\n' +
484
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs compress [--execute] [--age-days 90] (preview is default)',
487
+ 'Equivalent CLI: ' + CLI_INVOKE + ' compress [--execute] [--age-days 90] (preview is default)',
485
488
  inputSchema: memCompressSchema,
486
489
  hidden: true,
487
490
  },
@@ -500,7 +503,7 @@ export const tools = [
500
503
  ' - After bulk imports or a long offline period\n' +
501
504
  ' - User asks for periodic maintenance / cleanup\n' +
502
505
  '\n' +
503
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs maintain scan --ops dedup,decay',
506
+ 'Equivalent CLI: ' + CLI_INVOKE + ' maintain scan --ops dedup,decay',
504
507
  inputSchema: memMaintainSchema,
505
508
  hidden: true,
506
509
  },
@@ -519,7 +522,7 @@ export const tools = [
519
522
  ' - stats show many degraded (title-only, no lesson) observations\n' +
520
523
  ' - Start with action="preview" to see candidates before spending tokens\n' +
521
524
  '\n' +
522
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs optimize [--run|--run-all] [--task re-enrich,normalize,cluster-merge,smart-compress] [--max N] (preview is default)',
525
+ 'Equivalent CLI: ' + CLI_INVOKE + ' optimize [--run|--run-all] [--task re-enrich,normalize,cluster-merge,smart-compress] [--max N] (preview is default)',
523
526
  inputSchema: memOptimizeSchema,
524
527
  hidden: true,
525
528
  },
@@ -538,7 +541,7 @@ export const tools = [
538
541
  ' - Looking for a tool by capability → action="search" with keywords\n' +
539
542
  ' - User explicitly asks to import a GitHub repo → action="import_url"\n' +
540
543
  '\n' +
541
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs registry <list|search|import|...> [args]',
544
+ 'Equivalent CLI: ' + CLI_INVOKE + ' registry <list|search|import|...> [args]',
542
545
  inputSchema: memRegistrySchema,
543
546
  hidden: true,
544
547
  },
@@ -576,7 +579,7 @@ export const tools = [
576
579
  ' - You later discover additional context worth appending to lesson_learned\n' +
577
580
  ' - Reclassifying an observation after its true type becomes clear\n' +
578
581
  '\n' +
579
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs update <id> [--title ...] [--lesson ...]',
582
+ 'Equivalent CLI: ' + CLI_INVOKE + ' update <id> [--title ...] [--lesson ...]',
580
583
  inputSchema: memUpdateSchema,
581
584
  hidden: true,
582
585
  },
@@ -595,7 +598,7 @@ export const tools = [
595
598
  ' - Moving observations between machines or projects\n' +
596
599
  ' - User asks for a JSON snapshot of a project\'s memories\n' +
597
600
  '\n' +
598
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs export [--format jsonl] [--project X] [--limit 500]',
601
+ 'Equivalent CLI: ' + CLI_INVOKE + ' export [--format jsonl] [--project X] [--limit 500]',
599
602
  inputSchema: memExportSchema,
600
603
  hidden: true,
601
604
  },
@@ -614,7 +617,7 @@ export const tools = [
614
617
  ' - User asks "what do we know about <file>"\n' +
615
618
  ' - Investigating a recurring issue in a file you have not touched recently\n' +
616
619
  '\n' +
617
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs recall "<file>" [--limit 10]',
620
+ 'Equivalent CLI: ' + CLI_INVOKE + ' recall "<file>" [--limit 10]',
618
621
  inputSchema: memRecallSchema,
619
622
  },
620
623
  {
@@ -632,7 +635,7 @@ export const tools = [
632
635
  ' - After a crash, power loss, or manual DB edit\n' +
633
636
  ' - doctor / stats flags FTS integrity problems\n' +
634
637
  '\n' +
635
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs fts-check [--rebuild]',
638
+ 'Equivalent CLI: ' + CLI_INVOKE + ' fts-check [--rebuild]',
636
639
  inputSchema: memFtsCheckSchema,
637
640
  hidden: true,
638
641
  },
@@ -651,7 +654,7 @@ export const tools = [
651
654
  ' - Triaging what to compress or clean up before running maintenance\n' +
652
655
  ' - Scanning for interesting anchors to follow up with mem_timeline\n' +
653
656
  '\n' +
654
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs browse [--tier active] [--project X]',
657
+ 'Equivalent CLI: ' + CLI_INVOKE + ' browse [--tier active] [--project X]',
655
658
  inputSchema: memBrowseSchema,
656
659
  hidden: true,
657
660
  },
@@ -670,7 +673,7 @@ export const tools = [
670
673
  ' - Wrap-up phase enumerates follow-up items for the next session\n' +
671
674
  ' - Bug surfaces but root cause is out of this session\'s scope\n' +
672
675
  '\n' +
673
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs defer add "<title>" [--priority 1|2|3] [--detail "..."] [--files a.mjs,b.mjs]',
676
+ 'Equivalent CLI: ' + CLI_INVOKE + ' defer add "<title>" [--priority 1|2|3] [--detail "..."] [--files a.mjs,b.mjs]',
674
677
  inputSchema: memDeferSchema,
675
678
  },
676
679
  {
@@ -687,7 +690,7 @@ export const tools = [
687
690
  ' - About to refer to "item N" and need to confirm what N points to\n' +
688
691
  ' - Auditing carry-forward state across multiple sessions\n' +
689
692
  '\n' +
690
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs defer list [--project X] [--limit 10]',
693
+ 'Equivalent CLI: ' + CLI_INVOKE + ' defer list [--project X] [--limit 10]',
691
694
  inputSchema: memDeferListSchema,
692
695
  },
693
696
  {
@@ -705,7 +708,7 @@ export const tools = [
705
708
  ' - Scope changed and the work is no longer needed\n' +
706
709
  ' - User explicitly says "drop the deferred X, never mind"\n' +
707
710
  '\n' +
708
- 'Equivalent CLI: node ~/.claude-mem-lite/cli.mjs defer drop <D#N|ordinal> --reason "..."',
711
+ 'Equivalent CLI: ' + CLI_INVOKE + ' defer drop <D#N|ordinal> --reason "..."',
709
712
  inputSchema: memDeferDropSchema,
710
713
  },
711
714
  ];