From 18ee35e0b958986f25bec2259f0619bb9bdd096f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D1=80=D1=83=D0=B1=D0=B8=D0=BD=20=D0=A4=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=D0=BF=D0=BF?= <289370046+zarubinphil@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:40:30 +0300 Subject: [PATCH] Add safe chat update command --- README.md | 6 ++++++ README.ru.md | 6 ++++++ install.sh | 2 +- package.json | 1 + scripts/mnemazine-update.sh | 18 ++++++++++++++++++ skills/mnemazine/SKILL.md | 8 ++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 scripts/mnemazine-update.sh diff --git a/README.md b/README.md index 158340e..82d4a24 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,12 @@ Update an existing clone: cd "$HOME/Desktop/Mnemazine" && git pull --ff-only && bash install.sh ``` +Agent chat update: + +```text +Mnemazine update +``` + After installation, open this folder as an Obsidian vault: ```text diff --git a/README.ru.md b/README.ru.md index 30cbd12..542ac2d 100644 --- a/README.ru.md +++ b/README.ru.md @@ -77,6 +77,12 @@ bash setup.sh # пошагово, с вопросами (куда кла cd "$HOME/Desktop/Mnemazine" && git pull --ff-only && bash install.sh ``` +Обновить через чат агента: + +```text +Mnemazine update +``` + После установки откройте эту папку как Obsidian-vault: ```text diff --git a/install.sh b/install.sh index 07ebdf4..6418043 100755 --- a/install.sh +++ b/install.sh @@ -14,7 +14,7 @@ USER_BIN="$HOME/.local/bin" mkdir -p "$INBOX" "$VAULT" "$REPORTS" "$STATE" "$BIN" "$USER_BIN" "$ROOT/.mnemazine/cache" mkdir -p "$VAULT/00 System" "$VAULT/01 Concepts" "$VAULT/02 Tools" "$VAULT/03 Agents" "$VAULT/04 Projects" "$VAULT/99 Archive" -if command -v python3 >/dev/null 2>&1; then +if [ "${MNEMAZINE_SKIP_DEPS:-0}" != "1" ] && command -v python3 >/dev/null 2>&1; then python3 -m venv "$ROOT/.venv" || true "$ROOT/.venv/bin/python" -m pip install --upgrade pip "$ROOT/.venv/bin/python" -m pip install -r "$ROOT/requirements.txt" || true diff --git a/package.json b/package.json index b911807..1010a35 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "install:local": "bash install.sh", "start": "bash scripts/mnemazine-desktop-protocol.sh", "desktop": "bash scripts/mnemazine-desktop-protocol.sh", + "update": "bash scripts/mnemazine-update.sh", "run": "node scripts/mnemazine-run.mjs", "protocol:desktop": "bash scripts/mnemazine-desktop-protocol.sh", "graph:refresh": "node scripts/mnemazine-refresh-graphify.mjs --json", diff --git a/scripts/mnemazine-update.sh b/scripts/mnemazine-update.sh new file mode 100755 index 0000000..30e1a32 --- /dev/null +++ b/scripts/mnemazine-update.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="${MNEMAZINE_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}" +cd "$ROOT" + +git pull --ff-only +MNEMAZINE_FROM_SETUP=1 MNEMAZINE_SKIP_DEPS=1 bash install.sh + +bash -n bin/mnemazine install.sh setup.sh scripts/mnemazine-desktop-protocol.sh scripts/mnemazine-telegram-sync.sh scripts/mnemazine-update.sh +node --check scripts/mnemazine-run.mjs +node --check scripts/mnemazine-complete-check.mjs +node --check scripts/mnemazine-synthesize.mjs +node --check scripts/mnemazine-verify.mjs + +echo "Mnemazine updated." +echo "Run from chat: Mnemazine" +echo "Run from terminal: mnemazine" diff --git a/skills/mnemazine/SKILL.md b/skills/mnemazine/SKILL.md index 4111cd5..c8dc471 100644 --- a/skills/mnemazine/SKILL.md +++ b/skills/mnemazine/SKILL.md @@ -11,6 +11,14 @@ Use it when the user gives raw material and wants it preserved as durable knowle ## Chat Shortcut +If the user says `Mnemazine update`, `Мнемозина update`, or `обнови Mnemazine`, run from the project root: + +```bash +npm run update +``` + +This updates from GitHub with `git pull --ff-only`, preserves local config, reinstalls local wrappers, and runs syntax checks. It must not process inbox files. + If the user says `Mnemazine`, `Mnemazine inbox`, `Мнемозина`, `Мнемозина, inbox`, or `запусти Мнемозину`, run from the project root: ```bash