chore: Update license information and add user settings manager script

This commit is contained in:
Alex Newman
2025-10-21 15:12:34 -04:00
parent 861cd20adf
commit 1ea692e0b0
7 changed files with 119 additions and 5 deletions

3
.claude/settings.json Normal file
View File

@@ -0,0 +1,3 @@
{
"env": {}
}

2
.gitignore vendored
View File

@@ -5,6 +5,6 @@ node_modules/
.env.local
*.tmp
*.temp
.claude/
.claude/settings.local.json
plugin/data/
plugin/data.backup/

View File

@@ -16,7 +16,7 @@
"nodejs"
],
"author": "Alex Newman",
"license": "SEE LICENSE IN LICENSE",
"license": "AGPL-3.0",
"repository": {
"type": "git",
"url": "https://github.com/thedotmack/claude-mem.git"

View File

@@ -6,7 +6,7 @@
"name": "Alex Newman"
},
"repository": "https://github.com/thedotmack/claude-mem",
"license": "SEE LICENSE IN LICENSE",
"license": "AGPL-3.0",
"keywords": [
"memory",
"context",

View File

@@ -0,0 +1,111 @@
#!/bin/bash
# claude-mem-settings.sh - User settings manager for claude-mem plugin
USER_SETTINGS_FILE="$HOME/.claude/settings.json"
# Function to check if jq is available
check_jq() {
if ! command -v jq &> /dev/null; then
echo "Error: jq is required for JSON manipulation"
echo "Install with: brew install jq"
exit 1
fi
}
# Function to create settings file if it doesn't exist
ensure_settings_file() {
if [ ! -f "$USER_SETTINGS_FILE" ]; then
mkdir -p "$(dirname "$USER_SETTINGS_FILE")"
echo '{}' > "$USER_SETTINGS_FILE"
fi
}
# Function to get current model setting
get_model() {
if [ -f "$USER_SETTINGS_FILE" ]; then
jq -r '.env.CLAUDE_MEM_MODEL // "claude-sonnet-4-5"' "$USER_SETTINGS_FILE"
else
echo "claude-sonnet-4-5"
fi
}
# Function to set model setting
set_model() {
local model=$1
ensure_settings_file
# Update or create the env.CLAUDE_MEM_MODEL setting
jq --arg model "$model" '.env.CLAUDE_MEM_MODEL = $model' "$USER_SETTINGS_FILE" > tmp.json && mv tmp.json "$USER_SETTINGS_FILE"
echo "Set CLAUDE_MEM_MODEL to: $model"
}
# Function to remove model setting
remove_model() {
if [ -f "$USER_SETTINGS_FILE" ]; then
jq 'del(.env.CLAUDE_MEM_MODEL)' "$USER_SETTINGS_FILE" > tmp.json && mv tmp.json "$USER_SETTINGS_FILE"
echo "Removed CLAUDE_MEM_MODEL (will use default: claude-sonnet-4-5)"
fi
}
# Function to list available models
list_models() {
echo "Available models:"
echo " claude-haiku-4-5 - Fast and efficient"
echo " claude-sonnet-4-5 - Balanced (default)"
echo " claude-opus-4 - Most capable"
echo " claude-3-7-sonnet - Alternative version"
}
# Interactive menu
show_menu() {
echo "Claude Mem Plugin - Model Configuration"
echo "======================================"
echo "Current model: $(get_model)"
echo "Settings file: $USER_SETTINGS_FILE"
echo ""
echo "1) Set model"
echo "2) Remove model setting (use default)"
echo "3) List available models"
echo "4) Exit"
echo ""
}
# Main interactive loop
main() {
check_jq
while true; do
show_menu
read -p "Choose an option (1-4): " choice
case $choice in
1)
list_models
echo ""
read -p "Enter model name: " model
set_model "$model"
;;
2)
remove_model
;;
3)
list_models
;;
4)
echo "Goodbye!"
exit 0
;;
*)
echo "Invalid option. Please choose 1-4."
;;
esac
echo ""
read -p "Press Enter to continue..."
done
}
# Run main if script is executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ import type { SDKSession } from '../sdk/prompts.js';
import { logger } from '../utils/logger.js';
import { ensureAllDataDirs } from '../shared/paths.js';
const MODEL = 'claude-sonnet-4-5';
const MODEL = process.env.CLAUDE_MEM_MODEL || 'claude-sonnet-4-5';
const DISALLOWED_TOOLS = ['Glob', 'Grep', 'ListMcpResourcesTool', 'WebSearch'];
const FIXED_PORT = parseInt(process.env.CLAUDE_MEM_WORKER_PORT || '37777', 10);