metame-cli 1.1.2 → 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 +14 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -183,24 +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.warn("\n⚠️ WARNING: Possible Nested Session Detected");
193
- console.warn(" You appear to be running inside an existing Claude session (or an IDE that inherits its env).");
194
- console.warn(" - If you meant to refresh config, run: !metame refresh");
195
- console.warn(" - If this is a new session, you can ignore this warning.\n");
196
- // process.exit(1); // DISABLED: Too many false positives in VSCode terminals
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");
195
+ process.exit(1);
197
196
  }
198
197
 
199
198
  // ---------------------------------------------------------
200
199
  // 7. LAUNCH CLAUDE
201
200
  // ---------------------------------------------------------
202
- // Spawn the official claude tool
203
- 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
+ });
204
206
 
205
207
  child.on('error', (err) => {
206
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.2",
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": {