metame-cli 1.5.0 β†’ 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,34 +24,18 @@ No cloud. Your machine, your data.
24
24
  curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash
25
25
  ```
26
26
 
27
- **Already have Node.js β‰₯ 22.5:**
28
- ```bash
29
- npm install -g metame-cli
30
- metame
31
- ```
32
-
33
- **Windows (PowerShell):**
34
- ```powershell
35
- npm install -g metame-cli
36
- metame
37
- ```
38
-
39
27
  ---
40
28
 
41
- > ### πŸš€ v1.4.34 β€” Mentor Mode Step 4 + Distiller/Memory Closed Loop
29
+ > ### πŸš€ v1.5.0 β€” Dynamic Engine Default + Distill Coupling
42
30
  >
43
- > - **Multi-engine runtime adapter (MVP)**: daemon now supports engine routing by project (`project.engine`) with shared execution flow for Claude/Codex.
44
- > - **Codex session continuity**: supports `exec`/`resume`, thread id backfill, one-shot resume fallback (max once per 10 minutes per chat), and auth/rate-limit error mapping.
45
- > - **Agent engine inference**: natural-language agent creation can infer `codex`; default `claude` keeps zero-regression (no `engine` field persisted).
46
- > - **6-dimension soul schema**: cognitive profile upgraded from key-value pairs to a structured 67-field model covering Values, Drive, Cognition Style, Stress & Shadow, Relational, and Identity Narrative β€” with tier-based lock protection.
47
- > - **Mentor mode hooks**: pre-flight emotion breaker, context-time mentor prompt, and post-flight reflection debt registration are wired into daemon flow.
48
- > - **Distiller Step 4**: competence signals now merge into `user_competence_map` (upgrade-by-default, downgrade only with explicit evidence).
49
- > - **Memory extraction labels**: `memory-extract` writes concept labels into `fact_labels` (linked by fact id from `saveFacts().savedFacts`).
50
- > - **Nightly closed loop**: nightly reflection writes back `synthesized_insight` facts and generates `knowledge_capsule` documents + facts.
51
- > - **Postmortem artifacts**: significant sessions now produce `postmortem` markdown and `bug_lesson` facts.
52
- > - **Memory index**: auto-generated global index of all memory documents for instant retrieval.
53
- > - **Auto-provisioning**: first run automatically deploys default CLAUDE.md, docs, and `dispatch_to` β€” zero manual setup.
54
- > - **Token budget tracking**: daily token usage monitoring with per-category breakdown and 80% warning threshold.
31
+ > - **Dynamic default engine**: auto-detects installed CLI (claude/codex) at startup; pure-codex users work out of the box with zero config.
32
+ > - **`/engine` command**: switch global default engine from mobile (`/engine codex`), with three-layer priority: `project.engine > /engine setting > auto-detect`.
33
+ > - **Engine–distill coupling**: switching engine auto-pairs the distill model (claudeβ†’haiku, codexβ†’gpt-5.1-codex-mini) and distill binary.
34
+ > - **Engine-aware distill**: `callDistillModel` now routes through the correct CLI binary and parses codex JSON stream output.
35
+ > - **`/doctor` engine checks**: health check now validates CLI availability against the configured default engine.
36
+ > - **Multi-engine runtime adapter**: daemon supports engine routing by project (`project.engine`) with shared execution flow for Claude/Codex.
37
+ > - **Codex session continuity**: supports `exec`/`resume`, thread id backfill, one-shot resume fallback, and auth/rate-limit error mapping.
38
+ > - **Mentor mode hooks**: pre-flight emotion breaker, context-time mentor prompt, and post-flight reflection debt registration.
55
39
  > - **Multi-user ACL**: role-based permissions (admin / member / stranger) with binding protection.
56
40
  > - **Windows native support**: cross-platform path handling, Named Pipes IPC, GBK-safe encoding.
57
41
  >
@@ -220,116 +204,74 @@ task outcome/failure β†’ skill signal buffer
220
204
 
221
205
  ---
222
206
 
223
- ## Quick Start
207
+ ## Install
224
208
 
225
- ```bash
226
- curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash
227
- ```
228
-
229
- **Already have Node.js β‰₯ 22.5:**
230
- ```bash
231
- npm install -g metame-cli
232
- metame
233
- ```
209
+ MetaMe is the orchestration layer. Claude Code and Codex are the engines. You install them together.
234
210
 
235
- > **First run auto-provisioning:** MetaMe automatically deploys a default `CLAUDE.md`, documentation files, and the `dispatch_to` tool to `~/.metame/`. No manual setup needed.
211
+ ### One-liner by user type
236
212
 
237
- **Setup guide (3 minutes):**
238
-
239
- | Step | What to do | What happens |
240
- |------|-----------|-------------|
241
- | 1. Log in to your engine | Run `claude` (Claude user) or `codex login` (Codex user) | Your local CLI engine is ready |
242
- | 2. Launch MetaMe | Run `metame` (Claude) or `metame codex` (Codex) | Opens a MetaMe-initialized session |
243
- | 3. Genesis Interview | Just chat β€” MetaMe will automatically start a deep soul interview on first run | Builds `~/.claude_profile.yaml` (6-dimension cognitive profile) |
244
- | 4. Connect phone | Say "help me set up mobile access" or "connect my phone" | Interactive wizard for Telegram/Feishu bot setup β†’ `~/.metame/daemon.yaml` |
245
- | 5. Start daemon | `metame start` | Background daemon launches, bot goes online |
246
- | 6. Register with system | macOS: `metame daemon install-launchd` Β· Windows: `metame daemon install-task-scheduler` Β· Linux: see below | Always-on, crash recovery |
247
-
248
- > **First time?** Just run `metame` and talk naturally. The interview and setup are conversational β€” no commands to memorize.
249
-
250
- **Update MetaMe:**
251
- ```bash
252
- npm install -g metame-cli
253
- ```
254
-
255
- ### Install Path By User Type
256
-
257
- **Claude Code only (plugin path, one-liner):**
258
- ```bash
259
- claude plugin install github:Yaron9/MetaMe/plugin
260
- ```
261
-
262
- **Claude Code only (npm CLI path, one-liner):**
263
- ```bash
264
- npm install -g @anthropic-ai/claude-code metame-cli && claude && metame
265
- ```
213
+ | You use | Install command | First login |
214
+ |---------|----------------|-------------|
215
+ | **Claude Code** | `npm install -g @anthropic-ai/claude-code metame-cli` | `claude` |
216
+ | **Codex** | `npm install -g @openai/codex metame-cli` | `codex login` |
217
+ | **Both** | `npm install -g @anthropic-ai/claude-code @openai/codex metame-cli` | `claude` + `codex login` |
218
+ | **Claude plugin** (no npm) | `claude plugin install github:Yaron9/MetaMe/plugin` | `claude` |
266
219
 
267
- **Codex only (CLI path, one-liner):**
268
- ```bash
269
- npm install -g @openai/codex metame-cli && codex login && metame codex
270
- ```
220
+ > **No Node.js?** Run `curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash` β€” it installs Node + MetaMe for you.
221
+ >
222
+ > **Windows?** Use PowerShell/CMD natively. WSL has proxy and path issues.
271
223
 
272
- **Claude + Codex (one-liner):**
273
- ```bash
274
- npm install -g @anthropic-ai/claude-code @openai/codex metame-cli
275
- ```
224
+ ### Setup (3 minutes)
276
225
 
277
- Then run `claude` once (Claude login), `codex login` once (Codex login), and use:
278
- - `metame` for Claude
279
- - `metame codex` for Codex
226
+ | Step | What to do |
227
+ |------|-----------|
228
+ | 1. Launch | `metame` (Claude) or `metame codex` (Codex) |
229
+ | 2. Genesis Interview | Just chat β€” MetaMe auto-starts a deep soul interview on first run β†’ builds `~/.claude_profile.yaml` |
230
+ | 3. Connect phone | Say "help me set up mobile access" β†’ interactive Telegram/Feishu bot wizard |
231
+ | 4. Start daemon | `metame start` β†’ background daemon launches, bot goes online |
232
+ | 5. Register with OS | macOS: `metame daemon install-launchd` Β· Windows: `metame daemon install-task-scheduler` |
280
233
 
281
- > `metame-cli` is engine-agnostic. It does not bundle Claude or Codex.
282
- > You install the engine(s) separately, and MetaMe routes/launches them.
234
+ > **First time?** Just run `metame` and talk naturally. Everything is conversational.
283
235
 
284
- ### Install FAQ
236
+ ### Create your first Agent
285
237
 
286
- - **Does Claude plugin mode support daemon + phone access?** Yes. Plugin mode can start the daemon (via `SessionStart` after `daemon.yaml` exists), and phone access works while the daemon is running.
287
- - **Does `npm install -g metame-cli` install Claude or Codex?** No. It only installs MetaMe. Install `@anthropic-ai/claude-code` and/or `@openai/codex` separately.
288
- - **If I only install one engine, does MetaMe still work?** Yes. MetaMe will run on the installed engine. `/doctor` marks the non-default missing engine as warning, not hard failure.
238
+ 1. In any existing group, say: `Create an agent, directory ~/xxx, responsible for xxx`
239
+ 2. Bot replies: Agent created β€” **send `/activate` in your new group to bind it**
240
+ 3. Create a new group, add the bot, send `/activate` β†’ binding complete
289
241
 
290
- ### Uninstall (CLI Path)
242
+ > Want more Agents? Repeat the flow. Each group = independent AI workspace.
291
243
 
292
- ```bash
293
- metame stop
294
- npm uninstall -g metame-cli
295
- ```
244
+ ### Update / Uninstall
296
245
 
297
- Codex-only cleanup:
298
246
  ```bash
299
- npm uninstall -g metame-cli @openai/codex
300
- ```
247
+ # Update
248
+ npm install -g metame-cli
301
249
 
302
- Claude-only cleanup:
303
- ```bash
304
- npm uninstall -g metame-cli @anthropic-ai/claude-code
305
- ```
250
+ # Uninstall
251
+ metame stop && npm uninstall -g metame-cli
306
252
 
307
- Optional data cleanup:
308
- ```bash
253
+ # Optional: remove data
309
254
  rm -rf ~/.metame ~/.claude_profile.yaml
310
255
  ```
311
256
 
312
257
  Optional service cleanup:
313
258
  - macOS: `launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.metame.daemon.plist && rm -f ~/Library/LaunchAgents/com.metame.daemon.plist`
314
259
  - Windows: `schtasks /delete /tn "MetaMe-Daemon" /f`
315
- - Linux/WSL(systemd): `systemctl --user disable --now metame && rm -f ~/.config/systemd/user/metame.service`
316
-
317
- > **What does system registration mean?**
318
- > Once registered, MetaMe runs in the background automatically β€” screen locked, lid closed, woken from sleep β€” as long as the machine is on. Scheduled tasks fire on time. No terminal window needed.
260
+ - Linux/WSL: `systemctl --user disable --now metame && rm -f ~/.config/systemd/user/metame.service`
319
261
 
320
- **Windows β€” register with Task Scheduler:**
321
-
322
- ```powershell
323
- metame daemon install-task-scheduler
324
- ```
262
+ ### Platform notes
325
263
 
326
- > The daemon auto-starts at login. Remove with: `schtasks /delete /tn "MetaMe-Daemon" /f`
264
+ <details>
265
+ <summary>Windows</summary>
327
266
 
328
- > **Windows notes:** Emoji display uses ASCII fallback (`[OK]`, `[FAIL]`) for GBK terminal compatibility. Named Pipes replace Unix sockets for IPC. `/mac` commands are not available.
267
+ - Emoji auto-degrades to ASCII (`[OK]`, `[FAIL]`) for GBK compatibility
268
+ - IPC uses Named Pipes instead of Unix sockets
269
+ - `/mac` commands are not available
270
+ - **Install natively in PowerShell/CMD, not via WSL**
271
+ </details>
329
272
 
330
- > **Windows users: install natively, not via WSL.** WSL often fails to inherit the host's network proxy (causing npm install and Claude API timeouts), has path mapping issues, and process management doesn't interoperate. `npm install -g metame-cli` directly in PowerShell/CMD is the most reliable approach.
331
-
332
- **WSL2 / Linux β€” register with systemd:**
273
+ <details>
274
+ <summary>WSL2 / Linux β€” systemd registration</summary>
333
275
 
334
276
  ```bash
335
277
  cat > ~/.config/systemd/user/metame.service << 'EOF'
@@ -350,17 +292,15 @@ systemctl --user enable metame
350
292
  systemctl --user start metame
351
293
  ```
352
294
 
353
- > WSL2 requires systemd enabled first: add `[boot]\nsystemd=true` to `/etc/wsl.conf`, then restart WSL.
295
+ > Requires systemd enabled: add `[boot]\nsystemd=true` to `/etc/wsl.conf`, then restart WSL.
354
296
 
355
- > **WSL limitation:** `/mac` commands (macOS AppleScript/JXA automation) are not available.
297
+ </details>
356
298
 
357
- **Create your first Agent:**
299
+ ### FAQ
358
300
 
359
- 1. In any existing group, say: `Create an agent, directory ~/xxx, responsible for xxx`
360
- 2. Bot replies: βœ… Agent created β€” **send `/activate` in your new group to bind it**
361
- 3. Create a new group, add the bot, send `/activate` β†’ binding complete
362
-
363
- > Want more Agents? Repeat: create in any group β†’ new target group β†’ `/activate`. Each group = independent AI workspace.
301
+ - **Does plugin mode support daemon + phone?** Yes. Plugin auto-starts daemon when `daemon.yaml` exists.
302
+ - **Does MetaMe bundle Claude or Codex?** No. `metame-cli` is engine-agnostic β€” you install engine(s) separately.
303
+ - **One engine only?** Works fine. `/doctor` marks the missing engine as warning, not failure.
364
304
 
365
305
  ---
366
306
 
@@ -605,21 +545,9 @@ For day-2 operations and troubleshooting (engine routing, codex login/rate-limit
605
545
 
606
546
  ## Plugin
607
547
 
608
- Install directly into Claude Code without npm:
609
-
610
- ```bash
611
- claude plugin install github:Yaron9/MetaMe/plugin
612
- ```
613
-
614
- Includes: cognitive profile injection, daemon (Telegram/Feishu), heartbeat tasks, layered memory, all mobile commands, slash commands (`/metame:evolve`, `/metame:daemon`, `/metame:refresh`, etc.).
615
-
616
- **Current behavior (code-aligned):**
617
- - Plugin auto-starts daemon on Claude `SessionStart` (if `~/.metame/daemon.yaml` exists).
618
- - Daemon runs detached; phone access works while daemon is running.
619
- - Plugin path does **not** auto-register OS service (launchd/task-scheduler/systemd). After reboot, open Claude once or run daemon start manually.
548
+ Install directly into Claude Code without npm: `claude plugin install github:Yaron9/MetaMe/plugin`
620
549
 
621
- Use the plugin if you want zero npm-global setup and Claude-integrated bootstrap.
622
- Use npm CLI (`metame-cli`) if you want explicit system-service management and CLI-first operations.
550
+ All features included. Plugin auto-starts daemon on `SessionStart` (if `daemon.yaml` exists). Does **not** auto-register OS service β€” after reboot, open Claude once or start daemon manually.
623
551
 
624
552
  ## Contributing
625
553