metame-cli 1.4.33 → 1.5.0
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 +187 -48
- package/index.js +148 -9
- package/package.json +6 -3
- package/scripts/daemon-admin-commands.js +254 -9
- package/scripts/daemon-agent-commands.js +64 -6
- package/scripts/daemon-agent-tools.js +26 -5
- package/scripts/daemon-bridges.js +110 -20
- package/scripts/daemon-claude-engine.js +704 -268
- package/scripts/daemon-command-router.js +24 -8
- package/scripts/daemon-default.yaml +28 -4
- package/scripts/daemon-engine-runtime.js +275 -0
- package/scripts/daemon-exec-commands.js +10 -4
- package/scripts/daemon-notify.js +37 -1
- package/scripts/daemon-runtime-lifecycle.js +2 -1
- package/scripts/daemon-session-commands.js +52 -4
- package/scripts/daemon-session-store.js +2 -1
- package/scripts/daemon-task-scheduler.js +87 -28
- package/scripts/daemon-user-acl.js +26 -9
- package/scripts/daemon.js +81 -17
- package/scripts/distill.js +323 -18
- package/scripts/docs/agent-guide.md +12 -0
- package/scripts/docs/maintenance-manual.md +119 -0
- package/scripts/docs/pointer-map.md +88 -0
- package/scripts/feishu-adapter.js +6 -1
- package/scripts/hooks/stop-session-capture.js +243 -0
- package/scripts/memory-extract.js +100 -5
- package/scripts/memory-nightly-reflect.js +196 -11
- package/scripts/memory.js +134 -3
- package/scripts/mentor-engine.js +405 -0
- package/scripts/platform.js +2 -0
- package/scripts/providers.js +169 -21
- package/scripts/schema.js +12 -0
- package/scripts/session-analytics.js +245 -12
- package/scripts/skill-changelog.js +245 -0
- package/scripts/skill-evolution.js +288 -5
- package/scripts/usage-classifier.js +1 -1
- package/scripts/daemon-admin-commands.test.js +0 -333
- package/scripts/daemon-task-envelope.test.js +0 -59
- package/scripts/daemon-task-scheduler.test.js +0 -106
- package/scripts/reliability-core.test.js +0 -280
- package/scripts/skill-evolution.test.js +0 -113
- package/scripts/task-board.test.js +0 -83
- package/scripts/test_daemon.js +0 -1407
- package/scripts/utils.test.js +0 -192
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ 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 ≥
|
|
27
|
+
**Already have Node.js ≥ 22.5:**
|
|
28
28
|
```bash
|
|
29
29
|
npm install -g metame-cli
|
|
30
30
|
metame
|
|
@@ -38,13 +38,22 @@ metame
|
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
> ### 🚀 v1.4.
|
|
41
|
+
> ### 🚀 v1.4.34 — Mentor Mode Step 4 + Distiller/Memory Closed Loop
|
|
42
42
|
>
|
|
43
|
-
> - **Multi-
|
|
44
|
-
> - **
|
|
45
|
-
> - **
|
|
46
|
-
> - **
|
|
47
|
-
> - **
|
|
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.
|
|
55
|
+
> - **Multi-user ACL**: role-based permissions (admin / member / stranger) with binding protection.
|
|
56
|
+
> - **Windows native support**: cross-platform path handling, Named Pipes IPC, GBK-safe encoding.
|
|
48
57
|
>
|
|
49
58
|
> Zero configuration. It just works.
|
|
50
59
|
|
|
@@ -56,7 +65,9 @@ metame
|
|
|
56
65
|
|
|
57
66
|
Claude Code forgets you every time you switch folders. MetaMe doesn't.
|
|
58
67
|
|
|
59
|
-
A cognitive profile (`~/.claude_profile.yaml`) follows you everywhere — not just facts like "user prefers TypeScript", but *how you think
|
|
68
|
+
A cognitive profile (`~/.claude_profile.yaml`) follows you everywhere — not just facts like "user prefers TypeScript", but *how you think*. The profile is built on a **6-dimension soul schema**: Values, Drive, Cognition Style, Stress & Shadow, Relational, and Identity Narrative — 67 fields organized into 4 tiers (T1 locked identity → T5 system-managed evolution). First-time users go through a **Genesis Interview**: a structured deep conversation that builds your cognitive fingerprint from scratch.
|
|
69
|
+
|
|
70
|
+
Once established, the profile updates silently from your conversations via background distillation — no effort required.
|
|
60
71
|
|
|
61
72
|
```
|
|
62
73
|
$ metame
|
|
@@ -65,9 +76,10 @@ $ metame
|
|
|
65
76
|
Link Established. What are we building?
|
|
66
77
|
```
|
|
67
78
|
|
|
68
|
-
### 2. Full Claude
|
|
79
|
+
### 2. Full Claude/Codex Sessions From Your Phone
|
|
69
80
|
|
|
70
|
-
Your Mac runs a daemon. Your phone sends messages via Telegram or Feishu.
|
|
81
|
+
Your Mac runs a daemon. Your phone sends messages via Telegram or Feishu.
|
|
82
|
+
Engine is selected per project (`project.engine: claude|codex`) — same tools, same files, same session continuity.
|
|
71
83
|
|
|
72
84
|
```
|
|
73
85
|
You (phone): Fix the auth bug in api/login.ts
|
|
@@ -80,10 +92,10 @@ Start on your laptop, continue on the train. `/stop` to interrupt, `/undo` to ro
|
|
|
80
92
|
|
|
81
93
|
### 3. Layered Memory That Works While You Sleep
|
|
82
94
|
|
|
83
|
-
MetaMe's memory system runs automatically in the background — no prompts, no manual saves.
|
|
95
|
+
MetaMe's memory system runs automatically in the background — no prompts, no manual saves. Five layers, fully autonomous.
|
|
84
96
|
|
|
85
97
|
**Layer 1 — Long-term Facts**
|
|
86
|
-
When you go idle, MetaMe runs memory consolidation: extracts key decisions, patterns, and knowledge from your sessions into a persistent facts store.
|
|
98
|
+
When you go idle, MetaMe runs memory consolidation: extracts key decisions, patterns, and knowledge from your sessions into a persistent facts store. Facts can also carry concept labels (`fact_labels`) for faster cross-domain retrieval.
|
|
87
99
|
|
|
88
100
|
**Layer 2 — Session Continuity**
|
|
89
101
|
Resuming a conversation after 2+ hours? MetaMe injects a brief summary of what you were working on last time — so you pick up where you left off without re-explaining context.
|
|
@@ -91,12 +103,20 @@ Resuming a conversation after 2+ hours? MetaMe injects a brief summary of what y
|
|
|
91
103
|
**Layer 3 — Session Index**
|
|
92
104
|
Every session gets tagged with topics and intent. This powers future session routing: when you reference "that thing we worked on last week", MetaMe knows where to look.
|
|
93
105
|
|
|
106
|
+
**Layer 4 — Nightly Reflection**
|
|
107
|
+
Every night at 01:00, MetaMe reviews your most-accessed facts from the past week and distills them into high-level decision logs and operational lessons. Distilled outputs are also written back to `memory.db` as `synthesized_insight`, enabling retrieval in future sessions.
|
|
108
|
+
|
|
109
|
+
**Layer 5 — Memory Index**
|
|
110
|
+
At 01:30, an auto-generated global index (`INDEX.md`) maps every memory document across all categories (including capsules and postmortems). This serves as a fast lookup table so MetaMe always knows where to find relevant context.
|
|
111
|
+
|
|
94
112
|
```
|
|
95
113
|
[Background, while you sleep]
|
|
96
114
|
idle 30min → memory consolidation triggered
|
|
97
115
|
→ session_tags.json updated (topics indexed)
|
|
98
116
|
→ facts extracted → ~/.metame/memory.db
|
|
99
117
|
→ session summary cached → daemon_state.json
|
|
118
|
+
01:00 → nightly reflection: hot facts → decisions + lessons
|
|
119
|
+
01:30 → memory index regenerated
|
|
100
120
|
|
|
101
121
|
[Next morning, when you resume]
|
|
102
122
|
"continue from yesterday" →
|
|
@@ -117,12 +137,14 @@ Built into the daemon. Runs every 60 seconds regardless of what's in your config
|
|
|
117
137
|
- Detects when you go idle → generates session continuity summaries
|
|
118
138
|
|
|
119
139
|
**Layer 1 — System Evolution (built-in defaults)**
|
|
120
|
-
|
|
140
|
+
Five tasks shipped out of the box. They are precondition-gated and run only when useful:
|
|
121
141
|
|
|
122
142
|
```yaml
|
|
123
143
|
- cognitive-distill # 4h · has signals? → distill preferences into profile
|
|
124
|
-
- memory-extract # 4h · scan sessions → extract long-term facts +
|
|
144
|
+
- memory-extract # 4h · scan sessions → extract long-term facts + concept labels
|
|
125
145
|
- skill-evolve # 6h · has signals? → evolve skills from task outcomes
|
|
146
|
+
- nightly-reflect # 01:00 daily · hot facts → decisions/lessons + synthesized facts + capsules
|
|
147
|
+
- memory-index # 01:30 daily · regenerate global memory index
|
|
126
148
|
```
|
|
127
149
|
|
|
128
150
|
`precondition` guards mean zero tokens burned when there's nothing to process.
|
|
@@ -181,18 +203,19 @@ Chain skills into multi-step workflows — research → write → publish — fu
|
|
|
181
203
|
|
|
182
204
|
### 5. Skills That Evolve Themselves
|
|
183
205
|
|
|
184
|
-
MetaMe
|
|
206
|
+
MetaMe's current skill loop is queue-driven and reviewable (not magic black-box automation).
|
|
185
207
|
|
|
186
|
-
- **
|
|
187
|
-
- **
|
|
188
|
-
- **
|
|
189
|
-
- **
|
|
208
|
+
- **Signal capture**: task outcomes and failures are captured into evolution signals.
|
|
209
|
+
- **Hot/cold evolution**: `skill-evolution` runs on task hot path and heartbeat cold path.
|
|
210
|
+
- **Workflow proposals**: repeated multi-tool patterns are merged into workflow sketches and queued as proposals.
|
|
211
|
+
- **Human approval gate**: review and operate with `/skill-evo list`, `/skill-evo approve <id>`, `/skill-evo done <id>`, `/skill-evo dismiss <id>`.
|
|
212
|
+
- **Skill manager fallback**: when capability is missing, runtime routes to `skill-manager` skill guidance instead of blind guessing.
|
|
190
213
|
|
|
191
214
|
```
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
215
|
+
task outcome/failure → skill signal buffer
|
|
216
|
+
→ hot/cold evolution
|
|
217
|
+
→ proposal queue
|
|
218
|
+
→ /skill-evo approve|done|dismiss
|
|
196
219
|
```
|
|
197
220
|
|
|
198
221
|
---
|
|
@@ -203,19 +226,21 @@ Task fails → skill-scout finds a skill → installs → retries → succeeds
|
|
|
203
226
|
curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash
|
|
204
227
|
```
|
|
205
228
|
|
|
206
|
-
**Already have Node.js ≥
|
|
229
|
+
**Already have Node.js ≥ 22.5:**
|
|
207
230
|
```bash
|
|
208
231
|
npm install -g metame-cli
|
|
209
232
|
metame
|
|
210
233
|
```
|
|
211
234
|
|
|
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.
|
|
236
|
+
|
|
212
237
|
**Setup guide (3 minutes):**
|
|
213
238
|
|
|
214
239
|
| Step | What to do | What happens |
|
|
215
240
|
|------|-----------|-------------|
|
|
216
|
-
| 1. Log in to
|
|
217
|
-
| 2. Launch MetaMe | Run `metame` | Opens a
|
|
218
|
-
| 3.
|
|
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) |
|
|
219
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` |
|
|
220
245
|
| 5. Start daemon | `metame start` | Background daemon launches, bot goes online |
|
|
221
246
|
| 6. Register with system | macOS: `metame daemon install-launchd` · Windows: `metame daemon install-task-scheduler` · Linux: see below | Always-on, crash recovery |
|
|
@@ -227,6 +252,68 @@ metame
|
|
|
227
252
|
npm install -g metame-cli
|
|
228
253
|
```
|
|
229
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
|
+
```
|
|
266
|
+
|
|
267
|
+
**Codex only (CLI path, one-liner):**
|
|
268
|
+
```bash
|
|
269
|
+
npm install -g @openai/codex metame-cli && codex login && metame codex
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Claude + Codex (one-liner):**
|
|
273
|
+
```bash
|
|
274
|
+
npm install -g @anthropic-ai/claude-code @openai/codex metame-cli
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Then run `claude` once (Claude login), `codex login` once (Codex login), and use:
|
|
278
|
+
- `metame` for Claude
|
|
279
|
+
- `metame codex` for Codex
|
|
280
|
+
|
|
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.
|
|
283
|
+
|
|
284
|
+
### Install FAQ
|
|
285
|
+
|
|
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.
|
|
289
|
+
|
|
290
|
+
### Uninstall (CLI Path)
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
metame stop
|
|
294
|
+
npm uninstall -g metame-cli
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Codex-only cleanup:
|
|
298
|
+
```bash
|
|
299
|
+
npm uninstall -g metame-cli @openai/codex
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Claude-only cleanup:
|
|
303
|
+
```bash
|
|
304
|
+
npm uninstall -g metame-cli @anthropic-ai/claude-code
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Optional data cleanup:
|
|
308
|
+
```bash
|
|
309
|
+
rm -rf ~/.metame ~/.claude_profile.yaml
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Optional service cleanup:
|
|
313
|
+
- macOS: `launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.metame.daemon.plist && rm -f ~/Library/LaunchAgents/com.metame.daemon.plist`
|
|
314
|
+
- Windows: `schtasks /delete /tn "MetaMe-Daemon" /f`
|
|
315
|
+
- Linux/WSL(systemd): `systemctl --user disable --now metame && rm -f ~/.config/systemd/user/metame.service`
|
|
316
|
+
|
|
230
317
|
> **What does system registration mean?**
|
|
231
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.
|
|
232
319
|
|
|
@@ -281,16 +368,19 @@ systemctl --user start metame
|
|
|
281
368
|
|
|
282
369
|
| Capability | What It Does |
|
|
283
370
|
|-----------|-------------|
|
|
284
|
-
| **Cognitive Profile** |
|
|
285
|
-
| **Layered Memory** |
|
|
286
|
-
| **Mobile Bridge** | Full Claude
|
|
287
|
-
| **Skill Evolution** |
|
|
288
|
-
| **
|
|
371
|
+
| **Cognitive Profile** | 6-dimension soul schema (Values, Drive, Cognition Style, Stress & Shadow, Relational, Identity Narrative). 67 fields, tier-locked, 800-token budget. First-time Genesis Interview builds your profile from scratch. |
|
|
372
|
+
| **Layered Memory** | Five-tier memory: long-term facts (+ concept labels), session summaries (continuity bridge), session index (topic tags), nightly reflection (distill + write-back), memory index (global lookup). All automatic. |
|
|
373
|
+
| **Mobile Bridge** | Full Claude/Codex via Telegram/Feishu. Stateful sessions, file transfer both ways, real-time streaming status. |
|
|
374
|
+
| **Skill Evolution** | Queue-driven skill evolution: captures task signals, generates workflow proposals, and supports explicit approval/resolve via `/skill-evo` commands. |
|
|
375
|
+
| **Token Budget** | Daily token usage tracking with per-category breakdown. Configurable daily limit, automatic 80% warning threshold, usage history with rollover. |
|
|
376
|
+
| **Auto-Provisioning** | First run deploys default CLAUDE.md, documentation, and `dispatch_to` to `~/.metame/`. Subsequent runs sync scripts without overwriting user config. |
|
|
377
|
+
| **Heartbeat System** | Three-layer programmable nervous system. Layer 0 kernel always-on (zero config). Layer 1 system evolution built-in (5 tasks: distill + memory + skills + nightly reflection + memory index). Layer 2 your custom scheduled tasks with `require_idle`, `precondition`, `notify`, workflows. |
|
|
289
378
|
| **Multi-Agent** | Multiple projects with dedicated chat groups. `/agent bind` for one-tap setup. True parallel execution. |
|
|
290
379
|
| **Browser Automation** | Built-in Playwright MCP. Browser control out of the box for every user. |
|
|
291
380
|
| **Cross-Platform** | Native support for macOS and Windows. Platform abstraction layer handles spawn, IPC, process management, and terminal encoding automatically. |
|
|
292
381
|
| **Provider Relay** | Route through any Anthropic-compatible API. Use GPT-4, DeepSeek, Gemini — zero config file mutation. |
|
|
293
382
|
| **Metacognition** | Detects behavioral patterns (decision style, comfort zones, goal drift) and injects mirror observations. Zero extra API cost. |
|
|
383
|
+
| **Mentor Mode** | `/mentor on|off|level|status` controls friction mode. Emotion breaker, zone-adaptive mentor prompts, and reflection debt run as optional hooks. |
|
|
294
384
|
| **Multi-User ACL** | Role-based permission system (admin / member / stranger). Share bots with teammates safely. Dynamic user management via `/user` commands with hot-reload config. |
|
|
295
385
|
| **Team Task** | Multi-agent task board for cross-agent collaboration. Agents can create, assign, and track tasks across workspaces. N-agent session scoping for parallel team workflows. |
|
|
296
386
|
| **Emergency Tools** | `/doctor` diagnostics, `/mac` macOS control helpers, `/sh` raw shell, `/fix` config restore, `/undo` git-based rollback. |
|
|
@@ -399,6 +489,9 @@ All agents share your cognitive profile (`~/.claude_profile.yaml`) — they all
|
|
|
399
489
|
| `/undo <hash>` | Roll back to a specific git checkpoint |
|
|
400
490
|
| `/list` | Browse & download project files |
|
|
401
491
|
| `/model` | Switch model (sonnet/opus/haiku) |
|
|
492
|
+
| `/engine` | Show/switch default engine (`claude`/`codex`) |
|
|
493
|
+
| `/distill-model` | Show/update background distill model (default: `haiku`) |
|
|
494
|
+
| `/mentor` | Mentor mode control: on/off/level/status |
|
|
402
495
|
| `/activate` | Activate and bind the most recently created pending agent in a new group |
|
|
403
496
|
| `/agent bind <name> [dir]` | Manually register group as dedicated agent |
|
|
404
497
|
| `/mac` | macOS control helper: permissions check/open + AppleScript/JXA execution |
|
|
@@ -416,6 +509,34 @@ All agents share your cognitive profile (`~/.claude_profile.yaml`) — they all
|
|
|
416
509
|
| `/teamtask <task_id>` | View task detail |
|
|
417
510
|
| `/teamtask resume <task_id>` | Resume a task |
|
|
418
511
|
|
|
512
|
+
## Mentor Mode (Why + How)
|
|
513
|
+
|
|
514
|
+
Mentor Mode is designed for users who want MetaMe to actively improve decision quality, not just execute commands.
|
|
515
|
+
|
|
516
|
+
- `/mentor on` — enable mentor hooks
|
|
517
|
+
- `/mentor off` — disable mentor hooks
|
|
518
|
+
- `/mentor level <0-10>` — set friction level
|
|
519
|
+
- `/mentor status` — show current mode/level
|
|
520
|
+
|
|
521
|
+
Runtime behavior:
|
|
522
|
+
- Pre-flight emotion breaker (cooldown-aware)
|
|
523
|
+
- Context-time mentor prompts (zone-aware: comfort/stretch/panic)
|
|
524
|
+
- Reflection debt registration on heavy code outputs (intense mode)
|
|
525
|
+
|
|
526
|
+
Level mapping:
|
|
527
|
+
- `0-3` → `gentle`
|
|
528
|
+
- `4-7` → `active`
|
|
529
|
+
- `8-10` → `intense`
|
|
530
|
+
|
|
531
|
+
## Hook Optimizations (Default On)
|
|
532
|
+
|
|
533
|
+
MetaMe installs and maintains two core Claude hooks automatically on launch:
|
|
534
|
+
|
|
535
|
+
- `UserPromptSubmit` hook (`scripts/signal-capture.js`): captures high-signal preference/task traces with layered filtering.
|
|
536
|
+
- `Stop` hook (`scripts/hooks/stop-session-capture.js`): records session-end/tool-failure signals with watermark protection.
|
|
537
|
+
|
|
538
|
+
If hook installation fails, MetaMe logs and continues the session (non-blocking fallback).
|
|
539
|
+
|
|
419
540
|
## How It Works
|
|
420
541
|
|
|
421
542
|
```
|
|
@@ -424,32 +545,46 @@ All agents share your cognitive profile (`~/.claude_profile.yaml`) — they all
|
|
|
424
545
|
└─────────────┘ │ (your machine, 24/7) │
|
|
425
546
|
│ │
|
|
426
547
|
│ ┌──────────────┐ │
|
|
427
|
-
│ │ Claude
|
|
428
|
-
│ │ (same
|
|
548
|
+
│ │ Claude/Codex │ │
|
|
549
|
+
│ │ (same runtime)│ │
|
|
429
550
|
│ └──────────────┘ │
|
|
430
551
|
│ │
|
|
431
552
|
│ ~/.claude_profile │
|
|
432
|
-
│ (
|
|
553
|
+
│ (6-dim soul schema) │
|
|
433
554
|
│ │
|
|
434
555
|
│ ~/.metame/memory.db │
|
|
435
556
|
│ session_tags.json │
|
|
436
|
-
│ (memory
|
|
557
|
+
│ (5-layer memory) │
|
|
558
|
+
│ │
|
|
559
|
+
│ dispatch_to (auto-deployed)│
|
|
437
560
|
└──────────────────────────────┘
|
|
438
561
|
↑
|
|
439
|
-
idle
|
|
440
|
-
|
|
562
|
+
idle → summaries + memory tasks
|
|
563
|
+
01:00 → nightly reflection
|
|
564
|
+
01:30 → memory index rebuild
|
|
441
565
|
```
|
|
442
566
|
|
|
443
|
-
- **Profile** (`~/.claude_profile.yaml`):
|
|
444
|
-
- **Daemon
|
|
445
|
-
- **
|
|
446
|
-
- **
|
|
447
|
-
- **
|
|
567
|
+
- **Profile** (`~/.claude_profile.yaml`): 6-dimension soul schema. Injected into every Claude session via `CLAUDE.md`.
|
|
568
|
+
- **Daemon**: Background process handling Telegram/Feishu messages, heartbeat tasks, Unix socket dispatch, and idle/sleep transitions.
|
|
569
|
+
- **Runtime Adapter** (`scripts/daemon-engine-runtime.js`): normalizes engine args/env/event parsing across Claude/Codex.
|
|
570
|
+
- **Distillation**: Heartbeat task (4h, signal-gated) that updates your cognitive profile, merges competence signals, and emits postmortems for significant sessions.
|
|
571
|
+
- **Memory Extract**: Heartbeat task (4h, idle-gated) that extracts long-term facts, then writes concept labels (`fact_labels`) linked by fact id.
|
|
572
|
+
- **Nightly Reflection**: Daily at 01:00. Distills hot-zone facts into decision logs/lessons, writes back `synthesized_insight`, and generates knowledge capsules.
|
|
573
|
+
- **Memory Index**: Daily at 01:30. Regenerates the global memory index for fast retrieval.
|
|
574
|
+
- **Session Summarize**: Generates a brief summary for idle sessions. Injected as context when resuming after a 2h+ gap.
|
|
575
|
+
|
|
576
|
+
## Scripts Docs Pointer Map
|
|
577
|
+
|
|
578
|
+
Use `scripts/docs/pointer-map.md` as the source-of-truth map for script entry points and Step 1-4 landing zones (`session-analytics` / `mentor-engine` / `daemon-claude-engine` / `distill` / `memory-extract` / `memory-nightly-reflect`).
|
|
579
|
+
|
|
580
|
+
For day-2 operations and troubleshooting (engine routing, codex login/rate-limit, compact boundary), use `scripts/docs/maintenance-manual.md`.
|
|
448
581
|
|
|
449
582
|
## Security
|
|
450
583
|
|
|
451
584
|
- All data stays on your machine. No cloud, no telemetry.
|
|
452
585
|
- `allowed_chat_ids` whitelist — new groups get a smart prompt: if a pending agent activation exists, they're guided to send `/activate`; otherwise they receive setup instructions.
|
|
586
|
+
- **Multi-user ACL**: role-based permissions (admin / member / stranger). Admins manage access via `/user` commands with hot-reload config.
|
|
587
|
+
- **Binding protection**: each group can only be bound to one agent. Existing bindings cannot be overwritten without explicit `force:true`.
|
|
453
588
|
- `operator_ids` for shared groups — non-operators get read-only mode.
|
|
454
589
|
- `~/.metame/` directory is mode 700.
|
|
455
590
|
- Bot tokens stored locally, never transmitted.
|
|
@@ -460,13 +595,13 @@ All agents share your cognitive profile (`~/.claude_profile.yaml`) — they all
|
|
|
460
595
|
|--------|-------|
|
|
461
596
|
| Daemon memory (idle) | ~100 MB RSS — standard Node.js process baseline |
|
|
462
597
|
| Daemon CPU (idle, between heartbeats) | ~0% — event-loop sleeping |
|
|
463
|
-
| Cognitive profile injection | ~
|
|
598
|
+
| Cognitive profile injection | ~800 tokens/session (0.4% of 200k context) |
|
|
464
599
|
| Dispatch latency (Unix socket) | <100ms |
|
|
465
600
|
| Memory consolidation (per session) | ~1,500–2,000 tokens input + ~50–300 tokens output (Haiku) |
|
|
466
|
-
| Session summary (per session) | ~400–900 tokens input + ≤250 tokens output (
|
|
601
|
+
| Session summary (per session) | ~400–900 tokens input + ≤250 tokens output (distill model configurable) |
|
|
467
602
|
| Mobile commands (`/stop`, `/list`, `/undo`) | 0 tokens |
|
|
468
603
|
|
|
469
|
-
>
|
|
604
|
+
> Memory consolidation and session summarization run in the background via the configured distill model (`/distill-model`, default `haiku`). Input is capped by code: skeleton text ≤ 3,000 chars, summary output ≤ 500 chars. Neither runs per-message — memory consolidation follows heartbeat schedule with idle/precondition guards, and summaries trigger once per idle session on sleep-mode transitions.
|
|
470
605
|
|
|
471
606
|
## Plugin
|
|
472
607
|
|
|
@@ -478,9 +613,13 @@ claude plugin install github:Yaron9/MetaMe/plugin
|
|
|
478
613
|
|
|
479
614
|
Includes: cognitive profile injection, daemon (Telegram/Feishu), heartbeat tasks, layered memory, all mobile commands, slash commands (`/metame:evolve`, `/metame:daemon`, `/metame:refresh`, etc.).
|
|
480
615
|
|
|
481
|
-
**
|
|
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.
|
|
482
620
|
|
|
483
|
-
Use the plugin if you
|
|
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.
|
|
484
623
|
|
|
485
624
|
## Contributing
|
|
486
625
|
|