From 419482c6ee5145615b99bf54d5e44fa7ac557e10 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:32:56 +0300 Subject: [PATCH] Add one-word Mnemazine entrypoint --- README.md | 29 +++++++++++++++++++++-------- README.ru.md | 29 +++++++++++++++++++++-------- bin/mnemazine | 13 +++++++++++++ docs/deep-mode.md | 4 +++- docs/deep-mode.ru.md | 4 +++- docs/telegram-intake.md | 4 ++-- docs/telegram-intake.ru.md | 4 ++-- install.sh | 16 +++++++++++++++- package.json | 4 ++++ setup.sh | 12 ++++++++---- skills/mnemazine/SKILL.md | 2 +- 11 files changed, 93 insertions(+), 28 deletions(-) create mode 100755 bin/mnemazine diff --git a/README.md b/README.md index 254d197..9934662 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,10 @@ After installation, open this folder as an Obsidian vault: ~/Desktop/Mnemazine/vault ``` -Everything lives under `~/Desktop/Mnemazine` by default: +The project lives under `~/Desktop/Mnemazine` by default: -- `inbox/` for raw inputs; +- `~/Desktop/Mnemazine Inbox` for raw inputs when you choose the Desktop inbox in `setup.sh`; +- `inbox/` for repo-local raw inputs if you choose the repo inbox; - `vault/` for finished knowledge; - `reports/` for HTML weekly briefings; - `.mnemazine/` for caches, binaries, and local state; @@ -102,19 +103,31 @@ The installer checks what exists and installs what it can safely install locally Put files into: ```text -~/Desktop/Mnemazine/inbox +~/Desktop/Mnemazine Inbox ``` -Then run: +Open the project folder in your agent: + +```text +~/Desktop/Mnemazine +``` + +Then type one word in chat: + +```text +Mnemazine +``` + +Terminal equivalent: ```bash npm start ``` -Agent shortcut: +After `setup.sh`, this also works when `~/.local/bin` is in your `PATH`: -```text -Mnemazine inbox +```bash +mnemazine ``` The run performs: @@ -132,7 +145,7 @@ The run performs: 11. action brief at `.mnemazine/state/last-action-brief.md`; 12. visual post-run knowledge report in `reports/`. -`npm start` is the safe default for real inbox work. The lower-level `npm run run` command is for development and demos. +`Mnemazine` / `npm start` is the safe default for real inbox work. The lower-level `npm run run` command is for development and demos. ## Website Ingestion diff --git a/README.ru.md b/README.ru.md index 1bd7e80..82ff8bd 100644 --- a/README.ru.md +++ b/README.ru.md @@ -77,9 +77,10 @@ bash setup.sh # пошагово, с вопросами (куда кла ~/Desktop/Mnemazine/vault ``` -По умолчанию всё лежит под `~/Desktop/Mnemazine`: +По умолчанию проект лежит в `~/Desktop/Mnemazine`: -- `inbox/` — сырые входящие; +- `~/Desktop/Mnemazine Inbox` — сырые входящие, если в `setup.sh` выбран Desktop inbox; +- `inbox/` — repo-local входящие, если выбран inbox внутри репозитория; - `vault/` — готовое знание; - `reports/` — еженедельные HTML-брифинги; - `.mnemazine/` — кэши, бинарники и локальное состояние; @@ -101,19 +102,31 @@ bash setup.sh # пошагово, с вопросами (куда кла Положите файлы в: ```text -~/Desktop/Mnemazine/inbox +~/Desktop/Mnemazine Inbox ``` -Затем запустите: +Откройте в агенте папку проекта: + +```text +~/Desktop/Mnemazine +``` + +Затем напишите в чате одно слово: + +```text +Mnemazine +``` + +То же самое в терминале: ```bash npm start ``` -Короткая команда для агента в чате: +После `setup.sh` работает и короткая CLI-команда, если `~/.local/bin` есть в `PATH`: -```text -Мнемозина, inbox +```bash +mnemazine ``` Прогон делает: @@ -131,7 +144,7 @@ npm start 11. action brief в `.mnemazine/state/last-action-brief.md`; 12. визуальный post-run отчёт по знаниям в `reports/`. -`npm start` — безопасный дефолт для настоящего inbox. Низкоуровневый `npm run run` оставлен для разработки и демо. +`Mnemazine` / `npm start` — безопасный дефолт для настоящего inbox. Низкоуровневый `npm run run` оставлен для разработки и демо. ## Парсинг сайтов diff --git a/bin/mnemazine b/bin/mnemazine new file mode 100755 index 0000000..c0586a6 --- /dev/null +++ b/bin/mnemazine @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail + +SOURCE="${BASH_SOURCE[0]}" +while [ -L "$SOURCE" ]; do + DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" +done + +ROOT="${MNEMAZINE_ROOT:-$(cd -P "$(dirname "$SOURCE")/.." && pwd)}" +cd "$ROOT" +exec npm start -- "$@" diff --git a/docs/deep-mode.md b/docs/deep-mode.md index 68bcc03..91c2764 100644 --- a/docs/deep-mode.md +++ b/docs/deep-mode.md @@ -12,6 +12,8 @@ Deep mode is **off unless you ask for it**. Nothing in the default pipeline reac ```bash # real Desktop Inbox run, strict full protocol: npm start +# after setup.sh, if ~/.local/bin is in PATH: +mnemazine # whole run, deep: node scripts/mnemazine-run.mjs --deep @@ -22,7 +24,7 @@ MNEMAZINE_DEEP=1 node scripts/mnemazine-run.mjs npm run synthesize -- --deep ``` -For live Desktop Inbox work, use `npm start`. It reads local config, enables deep mode, requires atomization + enrichment, and then runs the completion gate. +For live Desktop Inbox work, use `npm start` or `mnemazine`. It reads local config, enables deep mode, requires atomization + enrichment, and then runs the completion gate. If deep mode is requested directly but no LLM engine is available, plain `node scripts/mnemazine-run.mjs --deep` falls back to local template synthesis and reports `degraded: true` in JSON. Strict runs (`--require-deep` or `npm start`) fail before archive. diff --git a/docs/deep-mode.ru.md b/docs/deep-mode.ru.md index 6a8861b..d442d9b 100644 --- a/docs/deep-mode.ru.md +++ b/docs/deep-mode.ru.md @@ -12,6 +12,8 @@ Deep-режим **выключен, пока вы его не попросите ```bash # рабочий запуск Desktop Inbox, строгий полный протокол: npm start +# после setup.sh, если ~/.local/bin есть в PATH: +mnemazine # весь прогон, deep: node scripts/mnemazine-run.mjs --deep @@ -22,7 +24,7 @@ MNEMAZINE_DEEP=1 node scripts/mnemazine-run.mjs npm run synthesize -- --deep ``` -Для рабочего Desktop Inbox используй `npm start`. Он сам читает `.mnemazine/config.local.sh`, берёт inbox с рабочего стола, пишет в `~/Мозг`, включает `--deep`, требует атомизацию + обогащение и после этого запускает `complete-check`. +Для рабочего Desktop Inbox используй `npm start` или `mnemazine`. Он сам читает `.mnemazine/config.local.sh`, берёт inbox с рабочего стола, пишет в `~/Мозг`, включает `--deep`, требует атомизацию + обогащение и после этого запускает `complete-check`. Если deep-режим запрошен напрямую, но движок LLM недоступен, обычный `node scripts/mnemazine-run.mjs --deep` откатывается на локальный шаблонный синтез и сообщает `degraded: true` в JSON-выводе. Строгий запуск (`--require-deep` или `npm start`) в такой ситуации падает до архива. diff --git a/docs/telegram-intake.md b/docs/telegram-intake.md index d5f38a0..347e56b 100644 --- a/docs/telegram-intake.md +++ b/docs/telegram-intake.md @@ -25,7 +25,7 @@ only a transit buffer, never a second store. ▼ rsync --remove-source-files (move; host stays thin) ▼ - local inbox/ ──▶ npm run run (the protocol) + local inbox/ ──▶ npm start (the strict protocol) ▼ vault/ ──writes .last-run──▶ Mini App status ``` @@ -42,7 +42,7 @@ that flag; the next poll consumes it. | `scripts/mnemazine-webapp-server.mjs` | host | Mini App API (`/api/status`, `/api/send`, `/api/run`). Verifies Telegram `initData`, enforces an allowlist. Zero deps. | | `webapp/index.html` | host (static) | The Mini App UI. Theme-aware, single file. | | `scripts/mnemazine-telegram-poll.sh` | your machine | ~5-min tick: consume run-now flag / daily window → pull + run. | -| `scripts/mnemazine-telegram-sync.sh` | your machine | rsync pull (move) + `npm run run`. | +| `scripts/mnemazine-telegram-sync.sh` | your machine | rsync pull (move) + `npm start`. | | `scripts/com.mnemazine.telegram-sync.plist.template` | your machine | launchd agent (macOS) for the poll tick. | ## Setup diff --git a/docs/telegram-intake.ru.md b/docs/telegram-intake.ru.md index 54314eb..5858181 100644 --- a/docs/telegram-intake.ru.md +++ b/docs/telegram-intake.ru.md @@ -25,7 +25,7 @@ LLM-бинарь). Бот живёт на всегда-онлайн хосте, ▼ rsync --remove-source-files (move; хост остаётся тонким) ▼ - локальный inbox/ ──▶ npm run run (протокол) + локальный inbox/ ──▶ npm start (строгий протокол) ▼ vault/ ──пишет .last-run──▶ статус Mini App ``` @@ -42,7 +42,7 @@ LLM-бинарь). Бот живёт на всегда-онлайн хосте, | `scripts/mnemazine-webapp-server.mjs` | хост | API Mini App (`/api/status`, `/api/send`, `/api/run`). Верифицирует `initData`, держит allowlist. Ноль зависимостей. | | `webapp/index.html` | хост (статика) | UI Mini App. Тема-aware, один файл. | | `scripts/mnemazine-telegram-poll.sh` | твоя машина | Тик ~5 мин: флаг run-now / дневное окно → pull + прогон. | -| `scripts/mnemazine-telegram-sync.sh` | твоя машина | rsync pull (move) + `npm run run`. | +| `scripts/mnemazine-telegram-sync.sh` | твоя машина | rsync pull (move) + `npm start`. | | `scripts/com.mnemazine.telegram-sync.plist.template` | твоя машина | launchd-агент (macOS) для тика. | ## Установка diff --git a/install.sh b/install.sh index 78f0235..c84d353 100755 --- a/install.sh +++ b/install.sh @@ -8,8 +8,9 @@ VAULT="${MNEMAZINE_VAULT:-$ROOT/vault}" REPORTS="${MNEMAZINE_REPORTS:-$ROOT/reports}" STATE="${MNEMAZINE_STATE:-$ROOT/.mnemazine/state}" BIN="$ROOT/.mnemazine/bin" +USER_BIN="$HOME/.local/bin" -mkdir -p "$INBOX" "$VAULT" "$REPORTS" "$STATE" "$BIN" "$ROOT/.mnemazine/cache" +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 @@ -63,10 +64,23 @@ cat > "$ROOT/.mnemazine/config.json" < "$ROOT/.mnemazine/config.local.sh" <