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.
- package/index.js +13 -12
- 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
|
-
//
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
console.error("
|
|
194
|
-
console.error("
|
|
195
|
-
console.error("
|
|
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), {
|
|
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'.");
|