Add one-word Mnemazine entrypoint

This commit is contained in:
Зарубин Филипп
2026-06-23 18:32:56 +03:00
parent 4c5ed5f8f5
commit 419482c6ee
11 changed files with 93 additions and 28 deletions
+21 -8
View File
@@ -78,9 +78,10 @@ After installation, open this folder as an Obsidian vault:
~/Desktop/Mnemazine/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; - `vault/` for finished knowledge;
- `reports/` for HTML weekly briefings; - `reports/` for HTML weekly briefings;
- `.mnemazine/` for caches, binaries, and local state; - `.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: Put files into:
```text ```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 ```bash
npm start npm start
``` ```
Agent shortcut: After `setup.sh`, this also works when `~/.local/bin` is in your `PATH`:
```text ```bash
Mnemazine inbox mnemazine
``` ```
The run performs: The run performs:
@@ -132,7 +145,7 @@ The run performs:
11. action brief at `.mnemazine/state/last-action-brief.md`; 11. action brief at `.mnemazine/state/last-action-brief.md`;
12. visual post-run knowledge report in `reports/`. 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 ## Website Ingestion
+21 -8
View File
@@ -77,9 +77,10 @@ bash setup.sh # пошагово, с вопросами (куда кла
~/Desktop/Mnemazine/vault ~/Desktop/Mnemazine/vault
``` ```
По умолчанию всё лежит под `~/Desktop/Mnemazine`: По умолчанию проект лежит в `~/Desktop/Mnemazine`:
- `inbox/` — сырые входящие; - `~/Desktop/Mnemazine Inbox` — сырые входящие, если в `setup.sh` выбран Desktop inbox;
- `inbox/` — repo-local входящие, если выбран inbox внутри репозитория;
- `vault/` — готовое знание; - `vault/` — готовое знание;
- `reports/` — еженедельные HTML-брифинги; - `reports/` — еженедельные HTML-брифинги;
- `.mnemazine/` — кэши, бинарники и локальное состояние; - `.mnemazine/` — кэши, бинарники и локальное состояние;
@@ -101,19 +102,31 @@ bash setup.sh # пошагово, с вопросами (куда кла
Положите файлы в: Положите файлы в:
```text ```text
~/Desktop/Mnemazine/inbox ~/Desktop/Mnemazine Inbox
``` ```
Затем запустите: Откройте в агенте папку проекта:
```text
~/Desktop/Mnemazine
```
Затем напишите в чате одно слово:
```text
Mnemazine
```
То же самое в терминале:
```bash ```bash
npm start npm start
``` ```
Короткая команда для агента в чате: После `setup.sh` работает и короткая CLI-команда, если `~/.local/bin` есть в `PATH`:
```text ```bash
Мнемозина, inbox mnemazine
``` ```
Прогон делает: Прогон делает:
@@ -131,7 +144,7 @@ npm start
11. action brief в `.mnemazine/state/last-action-brief.md`; 11. action brief в `.mnemazine/state/last-action-brief.md`;
12. визуальный post-run отчёт по знаниям в `reports/`. 12. визуальный post-run отчёт по знаниям в `reports/`.
`npm start` — безопасный дефолт для настоящего inbox. Низкоуровневый `npm run run` оставлен для разработки и демо. `Mnemazine` / `npm start` — безопасный дефолт для настоящего inbox. Низкоуровневый `npm run run` оставлен для разработки и демо.
## Парсинг сайтов ## Парсинг сайтов
Executable
+13
View File
@@ -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 -- "$@"
+3 -1
View File
@@ -12,6 +12,8 @@ Deep mode is **off unless you ask for it**. Nothing in the default pipeline reac
```bash ```bash
# real Desktop Inbox run, strict full protocol: # real Desktop Inbox run, strict full protocol:
npm start npm start
# after setup.sh, if ~/.local/bin is in PATH:
mnemazine
# whole run, deep: # whole run, deep:
node scripts/mnemazine-run.mjs --deep node scripts/mnemazine-run.mjs --deep
@@ -22,7 +24,7 @@ MNEMAZINE_DEEP=1 node scripts/mnemazine-run.mjs
npm run synthesize -- --deep 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. 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.
+3 -1
View File
@@ -12,6 +12,8 @@ Deep-режим **выключен, пока вы его не попросите
```bash ```bash
# рабочий запуск Desktop Inbox, строгий полный протокол: # рабочий запуск Desktop Inbox, строгий полный протокол:
npm start npm start
# после setup.sh, если ~/.local/bin есть в PATH:
mnemazine
# весь прогон, deep: # весь прогон, deep:
node scripts/mnemazine-run.mjs --deep node scripts/mnemazine-run.mjs --deep
@@ -22,7 +24,7 @@ MNEMAZINE_DEEP=1 node scripts/mnemazine-run.mjs
npm run synthesize -- --deep 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`) в такой ситуации падает до архива. Если deep-режим запрошен напрямую, но движок LLM недоступен, обычный `node scripts/mnemazine-run.mjs --deep` откатывается на локальный шаблонный синтез и сообщает `degraded: true` в JSON-выводе. Строгий запуск (`--require-deep` или `npm start`) в такой ситуации падает до архива.
+2 -2
View File
@@ -25,7 +25,7 @@ only a transit buffer, never a second store.
▼ ▼
rsync --remove-source-files (move; host stays thin) 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 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. | | `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. | | `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-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. | | `scripts/com.mnemazine.telegram-sync.plist.template` | your machine | launchd agent (macOS) for the poll tick. |
## Setup ## Setup
+2 -2
View File
@@ -25,7 +25,7 @@ LLM-бинарь). Бот живёт на всегда-онлайн хосте,
▼ ▼
rsync --remove-source-files (move; хост остаётся тонким) rsync --remove-source-files (move; хост остаётся тонким)
▼ ▼
локальный inbox/ ──▶ npm run run (протокол) локальный inbox/ ──▶ npm start (строгий протокол)
▼ ▼
vault/ ──пишет .last-run──▶ статус Mini App 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. Ноль зависимостей. | | `scripts/mnemazine-webapp-server.mjs` | хост | API Mini App (`/api/status`, `/api/send`, `/api/run`). Верифицирует `initData`, держит allowlist. Ноль зависимостей. |
| `webapp/index.html` | хост (статика) | UI Mini App. Тема-aware, один файл. | | `webapp/index.html` | хост (статика) | UI Mini App. Тема-aware, один файл. |
| `scripts/mnemazine-telegram-poll.sh` | твоя машина | Тик ~5 мин: флаг run-now / дневное окно → pull + прогон. | | `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) для тика. | | `scripts/com.mnemazine.telegram-sync.plist.template` | твоя машина | launchd-агент (macOS) для тика. |
## Установка ## Установка
+15 -1
View File
@@ -8,8 +8,9 @@ VAULT="${MNEMAZINE_VAULT:-$ROOT/vault}"
REPORTS="${MNEMAZINE_REPORTS:-$ROOT/reports}" REPORTS="${MNEMAZINE_REPORTS:-$ROOT/reports}"
STATE="${MNEMAZINE_STATE:-$ROOT/.mnemazine/state}" STATE="${MNEMAZINE_STATE:-$ROOT/.mnemazine/state}"
BIN="$ROOT/.mnemazine/bin" 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" 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 command -v python3 >/dev/null 2>&1; then
@@ -63,10 +64,23 @@ cat > "$ROOT/.mnemazine/config.json" <<EOF
} }
EOF EOF
cat > "$ROOT/.mnemazine/config.local.sh" <<EOF
# Non-secret local paths. Safe to edit.
export MNEMAZINE_INBOX="$INBOX"
export MNEMAZINE_VAULT="$VAULT"
EOF
if [ -f "$ROOT/bin/mnemazine" ]; then
chmod +x "$ROOT/bin/mnemazine"
ln -sf "$ROOT/bin/mnemazine" "$USER_BIN/mnemazine"
ln -sf "$ROOT/bin/mnemazine" "$USER_BIN/Mnemazine"
fi
echo "Mnemazine installed." echo "Mnemazine installed."
echo "Root: $ROOT" echo "Root: $ROOT"
echo "Inbox: $INBOX" echo "Inbox: $INBOX"
echo "Vault: $VAULT" echo "Vault: $VAULT"
echo "Command: $USER_BIN/mnemazine"
echo "Open the vault folder in Obsidian." echo "Open the vault folder in Obsidian."
# Greet only when run directly. Under setup.sh this is a mid-flow sub-step; # Greet only when run directly. Under setup.sh this is a mid-flow sub-step;
+4
View File
@@ -4,6 +4,10 @@
"private": false, "private": false,
"type": "module", "type": "module",
"description": "Local-first memory system for turning raw inputs into verified reusable knowledge / Локальная система памяти из сырья в проверяемые знания.", "description": "Local-first memory system for turning raw inputs into verified reusable knowledge / Локальная система памяти из сырья в проверяемые знания.",
"bin": {
"mnemazine": "bin/mnemazine",
"Mnemazine": "bin/mnemazine"
},
"scripts": { "scripts": {
"install:local": "bash install.sh", "install:local": "bash install.sh",
"start": "bash scripts/mnemazine-desktop-protocol.sh", "start": "bash scripts/mnemazine-desktop-protocol.sh",
+8 -4
View File
@@ -81,9 +81,9 @@ note "Это не блокеры. Каркас поставится и без н
# ---- Stage 3: inbox location (required question) --------------------------- # ---- Stage 3: inbox location (required question) ---------------------------
stage 3 "Куда класть inbox?" stage 3 "Куда класть inbox?"
ask_choice "Входящие материалы будут падать сюда:" \ ask_choice "Входящие материалы будут падать сюда:" \
"Внутри репозитория — $ROOT/inbox" \ "На рабочий стол — $HOME/Desktop/Mnemazine Inbox" \
"На рабочий стол — $HOME/Desktop/Mnemazine-inbox" "Внутри репозитория — $ROOT/inbox"
if [ "$REPLY_IDX" = "1" ]; then INBOX="$ROOT/inbox"; else INBOX="$HOME/Desktop/Mnemazine-inbox"; fi if [ "$REPLY_IDX" = "1" ]; then INBOX="$HOME/Desktop/Mnemazine Inbox"; else INBOX="$ROOT/inbox"; fi
ok "Inbox: $INBOX" ok "Inbox: $INBOX"
# ---- Stage 4: LLM provider (deep mode) ------------------------------------- # ---- Stage 4: LLM provider (deep mode) -------------------------------------
@@ -180,7 +180,11 @@ ok "Каркас: $ROOT"
ok "Inbox: $INBOX" ok "Inbox: $INBOX"
[ -n "$LLM" ] && ok "Deep-провайдер: $LLM" || note "Deep выключен — включишь позже через MNEMAZINE_LLM." [ -n "$LLM" ] && ok "Deep-провайдер: $LLM" || note "Deep выключен — включишь позже через MNEMAZINE_LLM."
note "Открой папку vault в Obsidian." note "Открой папку vault в Obsidian."
note "Прогон: cd $ROOT && npm run run (deep: npm run run -- --deep)" note "Открой проект: $ROOT"
note "Клади файлы: $INBOX"
note "В чате агента: Mnemazine"
note "В терминале: npm start"
note "Если ~/.local/bin есть в PATH: mnemazine"
[ "$BOT_MODE" = "vps" ] && note "Mini App + ежедневный pull: см. docs/telegram-intake.md (этапы 2-3)." [ "$BOT_MODE" = "vps" ] && note "Mini App + ежедневный pull: см. docs/telegram-intake.md (этапы 2-3)."
b "Всё. Пользуйся." b "Всё. Пользуйся."
+1 -1
View File
@@ -11,7 +11,7 @@ Use it when the user gives raw material and wants it preserved as durable knowle
## Chat Shortcut ## Chat Shortcut
If the user says `Mnemazine inbox`, `Мнемозина, inbox`, or `запусти Мнемозину`, run: If the user says `Mnemazine`, `Mnemazine inbox`, `Мнемозина`, `Мнемозина, inbox`, or `запусти Мнемозину`, run from the project root:
```bash ```bash
npm start npm start