metame-cli 1.1.1 → 1.1.3

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.
Files changed (2) hide show
  1. package/index.js +13 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -183,25 +183,26 @@ if (isEvolve) {
183
183
  }
184
184
 
185
185
  // ---------------------------------------------------------
186
- // 6. SAFETY GUARD: PREVENT RECURSION
187
186
  // ---------------------------------------------------------
188
- // If we are already running inside Claude (detected via environment variable),
189
- // and we did NOT trigger a refresh above, it usually means a typo or user error.
190
- // Spawning a nested Claude session here creates confusion.
191
- if (process.env.CLAUDE_CODE_SSE_PORT) {
192
- console.error("\n⚠️ SAFETY GUARD TRIGGERED: Nested Session Detected");
193
- console.error(" You are trying to spawn Claude **inside** an existing Claude session.");
194
- console.error(" This often happens if you made a typo (e.g., !metame regresh).");
195
- console.error("\n 👉 If you wanted to reload config, run: !metame refresh");
196
- console.error(" 👉 If you really want a nested session, unset CLAUDE_CODE_SSE_PORT first.\n");
187
+ // 6. SAFETY GUARD: RECURSION PREVENTION (v2)
188
+ // ---------------------------------------------------------
189
+ // We rely on our own scoped variable to detect nesting,
190
+ // ignoring the leaky CLAUDE_CODE_SSE_PORT from IDEs.
191
+ if (process.env.METAME_ACTIVE_SESSION === 'true') {
192
+ console.error("\n🚫 ACTION BLOCKED: Nested Session Detected");
193
+ console.error(" You are actively running inside a MetaMe session.");
194
+ console.error(" To reload configuration, use: \x1b[36m!metame refresh\x1b[0m\n");
197
195
  process.exit(1);
198
196
  }
199
197
 
200
198
  // ---------------------------------------------------------
201
199
  // 7. LAUNCH CLAUDE
202
200
  // ---------------------------------------------------------
203
- // Spawn the official claude tool
204
- const child = spawn('claude', process.argv.slice(2), { stdio: 'inherit' });
201
+ // Spawn the official claude tool with our marker
202
+ const child = spawn('claude', process.argv.slice(2), {
203
+ stdio: 'inherit',
204
+ env: { ...process.env, METAME_ACTIVE_SESSION: 'true' }
205
+ });
205
206
 
206
207
  child.on('error', (err) => {
207
208
  console.error("\n❌ Error: Could not launch 'claude'.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metame-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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": {