myagentmemory 0.4.6 → 0.4.8

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/dist/agent-memory CHANGED
Binary file
package/dist/cli.js CHANGED
@@ -332,7 +332,17 @@ function cmdInstallSkills(flags) {
332
332
  output(report, true);
333
333
  return;
334
334
  }
335
- if (report.detected.length === 0) {
335
+ if (report.checked.length > 0) {
336
+ for (const item of report.checked) {
337
+ if (item.status === "detected") {
338
+ console.log(`Detecting ${item.label}... found`);
339
+ }
340
+ else {
341
+ console.log(`Detecting ${item.label}... not found (${item.reason ?? "unknown"})`);
342
+ }
343
+ }
344
+ }
345
+ else if (report.detected.length === 0) {
336
346
  console.log("No supported agent installations detected.");
337
347
  }
338
348
  else {
package/dist/core.d.ts CHANGED
@@ -112,6 +112,11 @@ export interface InstallSkillsReport {
112
112
  ok: boolean;
113
113
  projectDir?: string;
114
114
  homeDir?: string;
115
+ checked: Array<{
116
+ label: string;
117
+ status: "detected" | "skipped";
118
+ reason?: string;
119
+ }>;
115
120
  detected: Array<{
116
121
  label: string;
117
122
  homeMarker: string;
package/dist/core.js CHANGED
@@ -347,6 +347,24 @@ function resolveHomeDir() {
347
347
  return homeDirOverride;
348
348
  return process.env.HOME ?? process.env.USERPROFILE ?? null;
349
349
  }
350
+ function commandExists(cmd) {
351
+ const envPath = process.env.PATH ?? "";
352
+ if (!envPath)
353
+ return false;
354
+ const dirs = envPath.split(path.delimiter).filter(Boolean);
355
+ const isWin = process.platform === "win32";
356
+ const rawExts = isWin ? process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM" : "";
357
+ const exts = isWin ? rawExts.split(";").filter(Boolean) : [""];
358
+ for (const dir of dirs) {
359
+ for (const ext of exts) {
360
+ const fileName = isWin ? `${cmd}${ext}` : cmd;
361
+ const fullPath = path.join(dir, fileName);
362
+ if (fs.existsSync(fullPath))
363
+ return true;
364
+ }
365
+ }
366
+ return false;
367
+ }
350
368
  function findSkillsRoot() {
351
369
  const envRoot = process.env.AGENT_MEMORY_SKILLS_ROOT;
352
370
  if (envRoot)
@@ -580,6 +598,7 @@ export function installSkills() {
580
598
  detected: [],
581
599
  installed: [],
582
600
  skipped: [],
601
+ checked: [],
583
602
  error: "Home directory not found. Set HOME (or USERPROFILE on Windows) and retry.",
584
603
  };
585
604
  }
@@ -591,6 +610,7 @@ export function installSkills() {
591
610
  detected: [],
592
611
  installed: [],
593
612
  skipped: [],
613
+ checked: [],
594
614
  error: "Could not locate the skills directory. Ensure the package includes skills/ (reinstall if needed).",
595
615
  };
596
616
  }
@@ -603,6 +623,7 @@ export function installSkills() {
603
623
  detected: [],
604
624
  installed: [],
605
625
  skipped: [],
626
+ checked: [],
606
627
  error: `Skills directory not found: ${skillsDir}`,
607
628
  };
608
629
  }
@@ -612,12 +633,19 @@ export function installSkills() {
612
633
  srcDir: path.join(skillsDir, "claude-code"),
613
634
  destDir: path.join(homeDir, ".claude", "skills", "agent-memory"),
614
635
  homeMarker: path.join(homeDir, ".claude"),
636
+ detectFiles: [
637
+ path.join(homeDir, ".claude", "settings.json"),
638
+ path.join(homeDir, ".claude", "settings.local.json"),
639
+ ],
640
+ detectCommand: "claude",
615
641
  },
616
642
  {
617
643
  label: "Codex skill",
618
644
  srcDir: path.join(skillsDir, "codex"),
619
645
  destDir: path.join(homeDir, ".codex", "skills", "agent-memory"),
620
646
  homeMarker: path.join(homeDir, ".codex"),
647
+ detectFiles: [path.join(homeDir, ".codex", "config.toml")],
648
+ detectCommand: "codex",
621
649
  },
622
650
  {
623
651
  label: "Cursor skill",
@@ -635,12 +663,23 @@ export function installSkills() {
635
663
  const detected = [];
636
664
  const installed = [];
637
665
  const skipped = [];
666
+ const checked = [];
638
667
  for (const target of targets) {
639
668
  if (!fs.existsSync(target.homeMarker)) {
640
669
  skipped.push({ label: target.label, reason: `${target.homeMarker} not found` });
670
+ checked.push({ label: target.label, status: "skipped", reason: `${target.homeMarker} not found` });
671
+ continue;
672
+ }
673
+ const detectedByFile = (target.detectFiles ?? []).some((file) => fs.existsSync(file));
674
+ const detectedByCommand = target.detectCommand ? commandExists(target.detectCommand) : false;
675
+ const requiresDetection = (target.detectFiles?.length ?? 0) > 0 || !!target.detectCommand;
676
+ if (requiresDetection && !detectedByFile && !detectedByCommand) {
677
+ skipped.push({ label: target.label, reason: "not detected" });
678
+ checked.push({ label: target.label, status: "skipped", reason: "not detected" });
641
679
  continue;
642
680
  }
643
681
  detected.push({ label: target.label, homeMarker: target.homeMarker });
682
+ checked.push({ label: target.label, status: "detected" });
644
683
  const skillFile = path.join(target.srcDir, "SKILL.md");
645
684
  if (!fs.existsSync(skillFile)) {
646
685
  skipped.push({ label: target.label, reason: `${skillFile} not found` });
@@ -654,6 +693,7 @@ export function installSkills() {
654
693
  ok: true,
655
694
  projectDir,
656
695
  homeDir,
696
+ checked,
657
697
  detected,
658
698
  installed,
659
699
  skipped,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagentmemory",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Persistent memory for coding agents (Claude Code, Codex, Cursor, Agent) with qmd-powered semantic search across daily logs, long-term memory, and scratchpad",
5
5
  "main": "./dist/core.js",
6
6
  "types": "./dist/core.d.ts",
@@ -8,17 +8,26 @@ function Install-Skill {
8
8
  [string]$Label,
9
9
  [string]$SrcDir,
10
10
  [string]$DestDir,
11
- [string]$HomeMarker
11
+ [string]$HomeMarker,
12
+ [ScriptBlock]$Detect
12
13
  )
13
14
 
15
+ Write-Host "Detecting $Label..."
14
16
  if (-not (Test-Path $HomeMarker)) {
15
- Write-Host "Skipping $Label ($HomeMarker not found)"
17
+ Write-Host "Not found ($HomeMarker not found)"
16
18
  return
17
19
  }
18
20
 
21
+ if ($Detect -and -not (& $Detect)) {
22
+ Write-Host "Not found (not detected)"
23
+ return
24
+ }
25
+
26
+ Write-Host "Found"
19
27
  $SkillSrc = Join-Path $SrcDir "SKILL.md"
20
28
  if (Test-Path $SkillSrc) {
21
29
  New-Item -ItemType Directory -Force -Path $DestDir | Out-Null
30
+ Write-Host "Installing to $DestDir\\SKILL.md"
22
31
  Copy-Item -Force $SkillSrc (Join-Path $DestDir "SKILL.md")
23
32
  Write-Host "Installed $Label: $DestDir\\SKILL.md"
24
33
  } else {
@@ -26,8 +35,8 @@ function Install-Skill {
26
35
  }
27
36
  }
28
37
 
29
- Install-Skill -Label "Claude Code skill" -SrcDir (Join-Path $ProjectDir "skills\\claude-code") -DestDir (Join-Path $env:USERPROFILE ".claude\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".claude")
30
- Install-Skill -Label "Codex skill" -SrcDir (Join-Path $ProjectDir "skills\\codex") -DestDir (Join-Path $env:USERPROFILE ".codex\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".codex")
38
+ Install-Skill -Label "Claude Code skill" -SrcDir (Join-Path $ProjectDir "skills\\claude-code") -DestDir (Join-Path $env:USERPROFILE ".claude\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".claude") -Detect { (Test-Path (Join-Path $env:USERPROFILE ".claude\\settings.json")) -or (Test-Path (Join-Path $env:USERPROFILE ".claude\\settings.local.json")) -or (Get-Command claude -ErrorAction SilentlyContinue) }
39
+ Install-Skill -Label "Codex skill" -SrcDir (Join-Path $ProjectDir "skills\\codex") -DestDir (Join-Path $env:USERPROFILE ".codex\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".codex") -Detect { (Test-Path (Join-Path $env:USERPROFILE ".codex\\config.toml")) -or (Get-Command codex -ErrorAction SilentlyContinue) }
31
40
  Install-Skill -Label "Cursor skill" -SrcDir (Join-Path $ProjectDir "skills\\cursor") -DestDir (Join-Path $env:USERPROFILE ".cursor\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".cursor")
32
41
  Install-Skill -Label "Agent CLI skill" -SrcDir (Join-Path $ProjectDir "skills\\agent") -DestDir (Join-Path $env:USERPROFILE ".agents\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".agents")
33
42
 
@@ -7,19 +7,32 @@ set -euo pipefail
7
7
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
8
  PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
9
9
 
10
+ command_exists() {
11
+ command -v "$1" >/dev/null 2>&1
12
+ }
13
+
10
14
  install_skill() {
11
15
  local label="$1"
12
16
  local src_dir="$2"
13
17
  local dest_dir="$3"
14
18
  local home_marker="$4"
19
+ local detect_cmd="$5"
15
20
 
21
+ echo "Detecting $label..."
16
22
  if [ ! -d "$home_marker" ]; then
17
- echo "Skipping $label ($home_marker not found)"
23
+ echo "Not found ($home_marker not found)"
24
+ return
25
+ fi
26
+
27
+ if [ -n "$detect_cmd" ] && ! eval "$detect_cmd"; then
28
+ echo "Not found (not detected)"
18
29
  return
19
30
  fi
20
31
 
32
+ echo "Found"
21
33
  if [ -d "$src_dir" ]; then
22
34
  mkdir -p "$dest_dir"
35
+ echo "Installing to $dest_dir/SKILL.md"
23
36
  cp "$src_dir/SKILL.md" "$dest_dir/SKILL.md"
24
37
  echo "Installed $label: $dest_dir/SKILL.md"
25
38
  else
@@ -27,8 +40,8 @@ install_skill() {
27
40
  fi
28
41
  }
29
42
 
30
- install_skill "Claude Code skill" "$PROJECT_DIR/skills/claude-code" "$HOME/.claude/skills/agent-memory" "$HOME/.claude"
31
- install_skill "Codex skill" "$PROJECT_DIR/skills/codex" "$HOME/.codex/skills/agent-memory" "$HOME/.codex"
43
+ install_skill "Claude Code skill" "$PROJECT_DIR/skills/claude-code" "$HOME/.claude/skills/agent-memory" "$HOME/.claude" '[ -f "$HOME/.claude/settings.json" ] || [ -f "$HOME/.claude/settings.local.json" ] || command_exists claude'
44
+ install_skill "Codex skill" "$PROJECT_DIR/skills/codex" "$HOME/.codex/skills/agent-memory" "$HOME/.codex" '[ -f "$HOME/.codex/config.toml" ] || command_exists codex'
32
45
  install_skill "Cursor skill" "$PROJECT_DIR/skills/cursor" "$HOME/.cursor/skills/agent-memory" "$HOME/.cursor"
33
46
  install_skill "Agent CLI skill" "$PROJECT_DIR/skills/agent" "$HOME/.agents/skills/agent-memory" "$HOME/.agents"
34
47
 
package/src/cli.ts CHANGED
@@ -413,7 +413,15 @@ function cmdInstallSkills(flags: Record<string, string | boolean>) {
413
413
  return;
414
414
  }
415
415
 
416
- if (report.detected.length === 0) {
416
+ if (report.checked.length > 0) {
417
+ for (const item of report.checked) {
418
+ if (item.status === "detected") {
419
+ console.log(`Detecting ${item.label}... found`);
420
+ } else {
421
+ console.log(`Detecting ${item.label}... not found (${item.reason ?? "unknown"})`);
422
+ }
423
+ }
424
+ } else if (report.detected.length === 0) {
417
425
  console.log("No supported agent installations detected.");
418
426
  } else {
419
427
  const detectedLabels = report.detected.map((item) => item.label).join(", ");
package/src/core.ts CHANGED
@@ -476,6 +476,26 @@ function resolveHomeDir(): string | null {
476
476
  return process.env.HOME ?? process.env.USERPROFILE ?? null;
477
477
  }
478
478
 
479
+ function commandExists(cmd: string): boolean {
480
+ const envPath = process.env.PATH ?? "";
481
+ if (!envPath) return false;
482
+
483
+ const dirs = envPath.split(path.delimiter).filter(Boolean);
484
+ const isWin = process.platform === "win32";
485
+ const rawExts = isWin ? process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM" : "";
486
+ const exts = isWin ? rawExts.split(";").filter(Boolean) : [""];
487
+
488
+ for (const dir of dirs) {
489
+ for (const ext of exts) {
490
+ const fileName = isWin ? `${cmd}${ext}` : cmd;
491
+ const fullPath = path.join(dir, fileName);
492
+ if (fs.existsSync(fullPath)) return true;
493
+ }
494
+ }
495
+
496
+ return false;
497
+ }
498
+
479
499
  function findSkillsRoot(): string | null {
480
500
  const envRoot = process.env.AGENT_MEMORY_SKILLS_ROOT;
481
501
  if (envRoot) return envRoot;
@@ -718,6 +738,7 @@ export interface InstallSkillsReport {
718
738
  ok: boolean;
719
739
  projectDir?: string;
720
740
  homeDir?: string;
741
+ checked: Array<{ label: string; status: "detected" | "skipped"; reason?: string }>;
721
742
  detected: Array<{ label: string; homeMarker: string }>;
722
743
  installed: Array<{ label: string; path: string }>;
723
744
  skipped: Array<{ label: string; reason: string }>;
@@ -732,6 +753,7 @@ export function installSkills(): InstallSkillsReport {
732
753
  detected: [],
733
754
  installed: [],
734
755
  skipped: [],
756
+ checked: [],
735
757
  error: "Home directory not found. Set HOME (or USERPROFILE on Windows) and retry.",
736
758
  };
737
759
  }
@@ -744,6 +766,7 @@ export function installSkills(): InstallSkillsReport {
744
766
  detected: [],
745
767
  installed: [],
746
768
  skipped: [],
769
+ checked: [],
747
770
  error: "Could not locate the skills directory. Ensure the package includes skills/ (reinstall if needed).",
748
771
  };
749
772
  }
@@ -757,6 +780,7 @@ export function installSkills(): InstallSkillsReport {
757
780
  detected: [],
758
781
  installed: [],
759
782
  skipped: [],
783
+ checked: [],
760
784
  error: `Skills directory not found: ${skillsDir}`,
761
785
  };
762
786
  }
@@ -766,12 +790,19 @@ export function installSkills(): InstallSkillsReport {
766
790
  srcDir: path.join(skillsDir, "claude-code"),
767
791
  destDir: path.join(homeDir, ".claude", "skills", "agent-memory"),
768
792
  homeMarker: path.join(homeDir, ".claude"),
793
+ detectFiles: [
794
+ path.join(homeDir, ".claude", "settings.json"),
795
+ path.join(homeDir, ".claude", "settings.local.json"),
796
+ ],
797
+ detectCommand: "claude",
769
798
  },
770
799
  {
771
800
  label: "Codex skill",
772
801
  srcDir: path.join(skillsDir, "codex"),
773
802
  destDir: path.join(homeDir, ".codex", "skills", "agent-memory"),
774
803
  homeMarker: path.join(homeDir, ".codex"),
804
+ detectFiles: [path.join(homeDir, ".codex", "config.toml")],
805
+ detectCommand: "codex",
775
806
  },
776
807
  {
777
808
  label: "Cursor skill",
@@ -790,13 +821,25 @@ export function installSkills(): InstallSkillsReport {
790
821
  const detected: Array<{ label: string; homeMarker: string }> = [];
791
822
  const installed: Array<{ label: string; path: string }> = [];
792
823
  const skipped: Array<{ label: string; reason: string }> = [];
824
+ const checked: Array<{ label: string; status: "detected" | "skipped"; reason?: string }> = [];
793
825
 
794
826
  for (const target of targets) {
795
827
  if (!fs.existsSync(target.homeMarker)) {
796
828
  skipped.push({ label: target.label, reason: `${target.homeMarker} not found` });
829
+ checked.push({ label: target.label, status: "skipped", reason: `${target.homeMarker} not found` });
830
+ continue;
831
+ }
832
+ const detectedByFile = (target.detectFiles ?? []).some((file) => fs.existsSync(file));
833
+ const detectedByCommand = target.detectCommand ? commandExists(target.detectCommand) : false;
834
+ const requiresDetection = (target.detectFiles?.length ?? 0) > 0 || !!target.detectCommand;
835
+ if (requiresDetection && !detectedByFile && !detectedByCommand) {
836
+ skipped.push({ label: target.label, reason: "not detected" });
837
+ checked.push({ label: target.label, status: "skipped", reason: "not detected" });
797
838
  continue;
798
839
  }
840
+
799
841
  detected.push({ label: target.label, homeMarker: target.homeMarker });
842
+ checked.push({ label: target.label, status: "detected" });
800
843
 
801
844
  const skillFile = path.join(target.srcDir, "SKILL.md");
802
845
  if (!fs.existsSync(skillFile)) {
@@ -813,6 +856,7 @@ export function installSkills(): InstallSkillsReport {
813
856
  ok: true,
814
857
  projectDir,
815
858
  homeDir,
859
+ checked,
816
860
  detected,
817
861
  installed,
818
862
  skipped,