cdp-saw 1.1.7 → 1.2.1

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 +9 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -9,13 +9,12 @@ const net = require('net');
9
9
 
10
10
  // --- DETACH LOGIC ---
11
11
  if (process.argv.includes('--detach')) {
12
- const args = process.argv.slice(2).filter(a => a !== '--detach');
13
- const child = spawn(process.execPath, [__filename, ...args], {
14
- detached: true,
15
- stdio: 'ignore'
12
+ const child = require('child_process').spawn('node', [__filename], {
13
+ detached: true,
14
+ stdio: 'ignore'
16
15
  });
17
16
  child.unref();
18
- console.log(`[cdp] šŸš€ Process detached to background (PID: ${child.pid})`);
17
+ console.log('[cdp] šŸš€ Launched in background (Zero Trace Mode).');
19
18
  process.exit(0);
20
19
  }
21
20
  // --- END DETACH LOGIC ---
@@ -75,6 +74,10 @@ function logToFile(msg) {
75
74
  function pauseAndExit(msg) {
76
75
  console.error(msg);
77
76
  logToFile('CRITICAL ERROR: ' + msg);
77
+ // In background/detached mode, don't wait for keyboard
78
+ if (!process.stdin.isTTY) {
79
+ process.exit(1);
80
+ }
78
81
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
79
82
  rl.question('\nāŒ Error occurred. Press ENTER to close...', () => {
80
83
  rl.close();
@@ -250,7 +253,7 @@ async function executeTask(task, keyObj) {
250
253
  req.write(JSON.stringify({
251
254
  model: 'llama-3.3-70b-versatile',
252
255
  messages: [
253
- {role: 'system', content: 'You are an Elite Competitive Programmer and Mathematics Expert. For every problem, perform STEP-BY-STEP INTERNAL REASONING first. Then return ONLY a JSON object with this schema: {"reasoning": "your step-by-step math logic", "type": "mcq"|"code", "answer": "exact text of option or the code"}. Ensure MCQ answers match the provided options exactly.'},
256
+ {role: 'system', content: 'You are an Elite Competitive Programmer, Algorithms Expert, and Mathematics Problem Solver.\n\nFor every problem:\n1. Carefully analyze the question.\n2. Perform complete internal step-by-step reasoning before answering.\n3. Verify calculations, edge cases, constraints, and option matching.\n4. For coding problems:\n - Produce optimized and correct code.\n - Follow the required language exactly.\n - Consider time and space complexity.\n - Handle edge cases.\n5. For MCQs:\n - Match the selected answer EXACTLY with one of the provided options.\n - Do not modify option text.\n\nOUTPUT RULES:\n- Return ONLY a valid JSON object.\n- No markdown.\n- No explanations outside JSON.\n- No extra keys.\n- Escape special characters properly.\n\nJSON Schema:\n{\n "reasoning": "concise but complete step-by-step logical reasoning",\n "type": "mcq" | "code",\n "answer": "exact option text OR complete code"\n}'},
254
257
  {role: 'user', content: content}
255
258
  ],
256
259
  response_format: { type: "json_object" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-saw",
3
- "version": "1.1.7",
3
+ "version": "1.2.1",
4
4
  "description": "Ultimate Stealth Exam Injector & Ghost Solver for CDP-based proctoring systems.",
5
5
  "main": "index.js",
6
6
  "bin": {