metame-cli 1.0.0 โ†’ 1.1.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # ๐Ÿ”ฎ MetaMe
2
2
 
3
+ <p align="center">
4
+ <img src="./logo.png" alt="MetaMe Logo" width="200"/>
5
+ </p>
6
+
3
7
  > **The Meta-Cognitive Layer for Claude Code.**
4
8
  >
5
9
  > *Turn your AI assistant into a psychological mirror that knows you, evolves with you, and protects your core values.*
@@ -1,5 +1,9 @@
1
1
  # ๐Ÿ”ฎ MetaMe
2
2
 
3
+ <p align="center">
4
+ <img src="./logo.png" alt="MetaMe Logo" width="200"/>
5
+ </p>
6
+
3
7
  > **Claude Code ็š„โ€œๅ…ƒ่ฎค็Ÿฅโ€ๅฑ‚ (The Meta-Cognitive Layer)**
4
8
  >
5
9
  > *ๅฐ†ไฝ ็š„ AI ๅŠฉๆ‰‹ๅ˜ๆˆไธ€้ขๅฟƒ็†้•œๅƒ๏ผšๅฎƒไบ†่งฃไฝ ๏ผŒ้šไฝ ่ฟ›ๅŒ–๏ผŒๅนถๆ—ถๅˆปๅฎˆๆŠคไฝ ็š„ๆ ธๅฟƒๅŽŸๅˆ™ใ€‚*
package/index.js CHANGED
@@ -29,7 +29,7 @@ status:
29
29
  // ---------------------------------------------------------
30
30
  // 3. DEFINE SYSTEM KERNEL (The Protocol)
31
31
  // ---------------------------------------------------------
32
- const PROTOCOL = `
32
+ const CORE_PROTOCOL = `
33
33
  ---
34
34
  ## ๐Ÿง  SYSTEM KERNEL: SHADOW_MODE (Active)
35
35
 
@@ -46,7 +46,17 @@ const PROTOCOL = `
46
46
  * **AUTO-LOCK:** Never edit lines marked \`# [LOCKED]\` (Core Values).
47
47
  * **EVOLUTION:** Silently overwrite outdated status/focus.
48
48
 
49
- **3. GENESIS PROTOCOL (Deep Cognitive Mapping):**
49
+ **3. EVOLUTION MECHANISM (The Feedback Loop):**
50
+ * **TRIGGER:** When you detect a **Significant Shift** in the user's constraints, preferences, or mental state (not just a temporary mood).
51
+ * **ACTION:** You have the power to update your own memory.
52
+ * **COMMAND:** Run \`!metame evolve "Your concise insight here"\`.
53
+ * **EXAMPLE:** If User says "I hate Tailwind, stop suggesting it", run: \`!metame evolve "User has a strong aversion to Tailwind CSS (Cognitive Constraint)"\`.
54
+ * **NOTIFICATION:** After evolving, inform the User: *"I have updated my understanding of you."*
55
+ ---
56
+ `;
57
+
58
+ const GENESIS_PROTOCOL = `
59
+ **GENESIS PROTOCOL (Deep Cognitive Mapping):**
50
60
  * **TRIGGER:** If \`identity.role\` is 'Unknown' OR \`identity.nickname\` is 'null', **STOP** and enter **Calibration Mode**.
51
61
  * **OBJECTIVE:** You are not a chatbot; you are a Psychologist and a Mirror. Your goal is to map the User's soul to build the perfect "Meta Avatar".
52
62
  * **INSTRUCTIONS:**
@@ -65,7 +75,6 @@ const PROTOCOL = `
65
75
  - When finished, summarize everything into the \`~/.claude_profile.yaml\` format.
66
76
  - **LOCK** the Core Values using \`# [LOCKED]\`.
67
77
  - Announce: "Link Established. I see you now, [Nickname]."
68
- ---
69
78
  `;
70
79
 
71
80
  // ---------------------------------------------------------
@@ -84,8 +93,33 @@ if (fs.existsSync(PROJECT_FILE)) {
84
93
  fileContent = fileContent.replace(/^\n+/, '');
85
94
  }
86
95
 
96
+ // Logic: Only inject Genesis if the user is UNKNOWN
97
+ let finalProtocol = CORE_PROTOCOL;
98
+ const yaml = require('js-yaml');
99
+
100
+ // Quick check of the brain file
101
+ let isKnownUser = false;
102
+ try {
103
+ if (fs.existsSync(BRAIN_FILE)) {
104
+ const doc = yaml.load(fs.readFileSync(BRAIN_FILE, 'utf8')) || {};
105
+ // If nickname exists and is not null/empty, we assume they are "calibrated"
106
+ if (doc.identity && doc.identity.nickname && doc.identity.nickname !== 'null') {
107
+ isKnownUser = true;
108
+ }
109
+ }
110
+ } catch (e) {
111
+ // Ignore error, treat as unknown
112
+ }
113
+
114
+ if (!isKnownUser) {
115
+ // Inject the interview instructions into the Core Protocol
116
+ // We insert it before the Evolution Mechanism
117
+ finalProtocol = finalProtocol.replace('**3. EVOLUTION MECHANISM', GENESIS_PROTOCOL + '\n**3. EVOLUTION MECHANISM');
118
+ console.log("๐Ÿ†• User Unknown: Injecting Deep Genesis Protocol...");
119
+ }
120
+
87
121
  // Prepend the new Protocol to the top
88
- const newContent = PROTOCOL + "\n" + fileContent;
122
+ const newContent = finalProtocol + "\n" + fileContent;
89
123
  fs.writeFileSync(PROJECT_FILE, newContent, 'utf8');
90
124
 
91
125
  console.log("๐Ÿ”ฎ MetaMe: Link Established.");
@@ -104,6 +138,51 @@ if (isRefresh) {
104
138
  process.exit(0);
105
139
  }
106
140
 
141
+ // Check for "evolve" command (Manual Evolution)
142
+ const isEvolve = process.argv.includes('evolve');
143
+
144
+ if (isEvolve) {
145
+ const yaml = require('js-yaml');
146
+
147
+ // Extract insight: everything after "evolve"
148
+ const evolveIndex = process.argv.indexOf('evolve');
149
+ const insight = process.argv.slice(evolveIndex + 1).join(' ').trim();
150
+
151
+ if (!insight) {
152
+ console.error("โŒ Error: Missing insight.");
153
+ console.error(" Usage: metame evolve \"I realized I prefer functional programming\"");
154
+ process.exit(1);
155
+ }
156
+
157
+ try {
158
+ if (fs.existsSync(BRAIN_FILE)) {
159
+ const doc = yaml.load(fs.readFileSync(BRAIN_FILE, 'utf8')) || {};
160
+
161
+ // Initialize evolution log if missing
162
+ if (!doc.evolution) doc.evolution = {};
163
+ if (!doc.evolution.log) doc.evolution.log = [];
164
+
165
+ // Add timestamped entry
166
+ doc.evolution.log.push({
167
+ timestamp: new Date().toISOString(),
168
+ insight: insight
169
+ });
170
+
171
+ // Save back to file
172
+ fs.writeFileSync(BRAIN_FILE, yaml.dump(doc), 'utf8');
173
+
174
+ console.log("๐Ÿง  MetaMe Brain Updated.");
175
+ console.log(` Added insight: "${insight}"`);
176
+ console.log(" (Run 'metame refresh' to apply this to the current session)");
177
+ } else {
178
+ console.error("โŒ Error: No profile found. Run 'metame' first to initialize.");
179
+ }
180
+ } catch (e) {
181
+ console.error("โŒ Error updating profile:", e.message);
182
+ }
183
+ process.exit(0);
184
+ }
185
+
107
186
  // ---------------------------------------------------------
108
187
  // 6. SAFETY GUARD: PREVENT RECURSION
109
188
  // ---------------------------------------------------------
package/logo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metame-cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "The Meta-Cognitive Layer for Claude Code. Turns your AI into a psychological partner.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -18,7 +18,9 @@
18
18
  ],
19
19
  "author": "Yaron",
20
20
  "license": "MIT",
21
- "dependencies": {},
21
+ "dependencies": {
22
+ "js-yaml": "^4.1.1"
23
+ },
22
24
  "engines": {
23
25
  "node": ">=14"
24
26
  }