diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 26e6f35..4366b5d 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,16 +1,11 @@ { "name": "buddymon", - "version": "0.1.0", "description": "Collectible creatures discovered through coding — commit streaks, bug fights, and session challenges", + "version": "0.1.0", "author": { "name": "CircuitForge LLC", - "email": "hello@circuitforge.tech", - "url": "https://circuitforge.tech" + "email": "hello@circuitforge.tech" }, "license": "MIT", - "repository": { - "primary": "https://git.opensourcesolarpunk.com/Circuit-Forge/buddymon", - "github": "https://github.com/CircuitForgeLLC/buddymon", - "codeberg": "https://codeberg.org/CircuitForge/buddymon" - } + "repository": "https://git.opensourcesolarpunk.com/Circuit-Forge/buddymon" } diff --git a/hooks/hooks.json b/hooks/hooks.json index efad299..7d4de6c 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh\"", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh", "timeout": 10 } ] @@ -18,7 +18,7 @@ "hooks": [ { "type": "command", - "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/post-tool-use.py\"", + "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/post-tool-use.py", "timeout": 10 } ] @@ -29,7 +29,7 @@ "hooks": [ { "type": "command", - "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-stop.sh\"", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-stop.sh", "timeout": 10 } ] diff --git a/install.sh b/install.sh index fc9947e..f933628 100755 --- a/install.sh +++ b/install.sh @@ -82,6 +82,13 @@ if key in d.get('enabledPlugins', {}): PYEOF fi + # Remove marketplace plugin symlink + MARKETPLACE_PLUGIN_DIR="${PLUGINS_DIR}/marketplaces/${MARKETPLACE}/plugins/${PLUGIN_NAME}" + if [[ -L "${MARKETPLACE_PLUGIN_DIR}/${PLUGIN_NAME}" ]]; then + rm "${MARKETPLACE_PLUGIN_DIR}/${PLUGIN_NAME}" + ok "Removed marketplace symlink" + fi + echo "" echo "✓ ${PLUGIN_KEY} uninstalled. Restart Claude Code to apply." } @@ -100,6 +107,39 @@ install() { [[ -f "${REPO_DIR}/hooks/hooks.json" ]] \ || die "Missing hooks/hooks.json" + # Register 'local' marketplace so CC doesn't GC the cache entry on reload + KNOWN_MARKETPLACES="${PLUGINS_DIR}/known_marketplaces.json" + MARKETPLACE_DIR="${PLUGINS_DIR}/marketplaces/${MARKETPLACE}" + python3 << PYEOF +import json, os +from datetime import datetime, timezone + +f = '${KNOWN_MARKETPLACES}' +try: + d = json.load(open(f)) +except FileNotFoundError: + d = {} + +if 'local' not in d: + d['local'] = { + "source": {"source": "local", "path": '${MARKETPLACE_DIR}'}, + "installLocation": '${MARKETPLACE_DIR}', + "lastUpdated": datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S.000Z'), + } + json.dump(d, open(f, 'w'), indent=2) + print(" Registered 'local' marketplace") +else: + print(" 'local' marketplace already registered") +PYEOF + + # Symlink repo into marketplace plugins dir (so CC can discover it) + MARKETPLACE_PLUGIN_DIR="${MARKETPLACE_DIR}/plugins/${PLUGIN_NAME}" + mkdir -p "${MARKETPLACE_PLUGIN_DIR}" + if [[ ! -L "${MARKETPLACE_PLUGIN_DIR}/${PLUGIN_NAME}" ]]; then + ln -sf "${REPO_DIR}" "${MARKETPLACE_PLUGIN_DIR}/${PLUGIN_NAME}" + ok "Linked into marketplace dir" + fi + # Create cache parent dir mkdir -p "$(dirname "${CACHE_DIR}")"