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