claude-memory-agent 2.2.0 → 2.2.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/bin/lib/installer.js +1 -1
- package/install.py +20 -9
- package/package.json +1 -1
- package/requirements.txt +1 -1
package/bin/lib/installer.js
CHANGED
|
@@ -104,7 +104,7 @@ function buildEnvContent(config, agentDir) {
|
|
|
104
104
|
* @returns {string[]} Arguments for install.py
|
|
105
105
|
*/
|
|
106
106
|
function buildInstallArgs(config) {
|
|
107
|
-
const args = ['--auto', '--skip-env'];
|
|
107
|
+
const args = ['--auto', '--skip-env', '--skip-deps', '--skip-claude-check'];
|
|
108
108
|
|
|
109
109
|
if (config.scope === 'project') {
|
|
110
110
|
args.push('--scope', 'project', '--project-path', config.projectPath);
|
package/install.py
CHANGED
|
@@ -91,10 +91,15 @@ def print_error(text: str):
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def prompt_yes_no(question: str, default: bool = True) -> bool:
|
|
94
|
-
"""Prompt for yes/no answer."""
|
|
94
|
+
"""Prompt for yes/no answer. Returns default if stdin is not a TTY or EOF."""
|
|
95
|
+
if not sys.stdin.isatty():
|
|
96
|
+
return default
|
|
95
97
|
suffix = " [Y/n]: " if default else " [y/N]: "
|
|
96
98
|
while True:
|
|
97
|
-
|
|
99
|
+
try:
|
|
100
|
+
answer = input(question + suffix).strip().lower()
|
|
101
|
+
except EOFError:
|
|
102
|
+
return default
|
|
98
103
|
if not answer:
|
|
99
104
|
return default
|
|
100
105
|
if answer in ("y", "yes"):
|
|
@@ -105,8 +110,13 @@ def prompt_yes_no(question: str, default: bool = True) -> bool:
|
|
|
105
110
|
|
|
106
111
|
|
|
107
112
|
def prompt_value(question: str, default: str) -> str:
|
|
108
|
-
"""Prompt for a value with a default."""
|
|
109
|
-
|
|
113
|
+
"""Prompt for a value with a default. Returns default if stdin is not a TTY or EOF."""
|
|
114
|
+
if not sys.stdin.isatty():
|
|
115
|
+
return default
|
|
116
|
+
try:
|
|
117
|
+
answer = input(f"{question} [{default}]: ").strip()
|
|
118
|
+
except EOFError:
|
|
119
|
+
return default
|
|
110
120
|
return answer if answer else default
|
|
111
121
|
|
|
112
122
|
|
|
@@ -563,7 +573,7 @@ def setup_hooks(config: Dict[str, str]) -> bool:
|
|
|
563
573
|
return True
|
|
564
574
|
|
|
565
575
|
|
|
566
|
-
def configure_hooks_json() -> bool:
|
|
576
|
+
def configure_hooks_json(auto: bool = False) -> bool:
|
|
567
577
|
"""Configure hooks.json to enable the hooks."""
|
|
568
578
|
hooks_file = get_claude_settings_dir() / "hooks.json"
|
|
569
579
|
|
|
@@ -596,8 +606,9 @@ def configure_hooks_json() -> bool:
|
|
|
596
606
|
if hooks_file.exists():
|
|
597
607
|
try:
|
|
598
608
|
existing = json.loads(hooks_file.read_text())
|
|
599
|
-
#
|
|
600
|
-
|
|
609
|
+
# In auto mode, always merge; otherwise ask
|
|
610
|
+
should_update = auto or prompt_yes_no("hooks.json exists. Update with memory agent hooks?", default=True)
|
|
611
|
+
if should_update:
|
|
601
612
|
if "hooks" not in existing:
|
|
602
613
|
existing["hooks"] = {}
|
|
603
614
|
existing["hooks"].update(hooks_config["hooks"])
|
|
@@ -861,7 +872,7 @@ def main():
|
|
|
861
872
|
if not install_claude_code():
|
|
862
873
|
print_error("Could not install Claude Code automatically.")
|
|
863
874
|
print("Please install manually: npm install -g @anthropic-ai/claude-code")
|
|
864
|
-
if not prompt_yes_no("Continue anyway (memory agent only)?", default=False):
|
|
875
|
+
if not args.auto and not prompt_yes_no("Continue anyway (memory agent only)?", default=False):
|
|
865
876
|
return 1
|
|
866
877
|
else:
|
|
867
878
|
claude_ok = True
|
|
@@ -937,7 +948,7 @@ def main():
|
|
|
937
948
|
|
|
938
949
|
if args.auto or prompt_yes_no("Install Claude Code hooks?"):
|
|
939
950
|
setup_hooks(config)
|
|
940
|
-
configure_hooks_json()
|
|
951
|
+
configure_hooks_json(auto=args.auto)
|
|
941
952
|
else:
|
|
942
953
|
print_warning("Skipping Claude Code configuration (Claude Code not installed)")
|
|
943
954
|
print(" Run 'python install.py' again after installing Claude Code")
|
package/package.json
CHANGED
package/requirements.txt
CHANGED