cdp-saw 1.1.8 → 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 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -9,15 +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',
16
- shell: true,
17
- windowsHide: true
12
+ const child = require('child_process').spawn('node', [__filename], {
13
+ detached: true,
14
+ stdio: 'ignore'
18
15
  });
19
16
  child.unref();
20
- console.log(`[cdp] šŸš€ Process detached to background (PID: ${child.pid})`);
17
+ console.log('[cdp] šŸš€ Launched in background (Zero Trace Mode).');
21
18
  process.exit(0);
22
19
  }
23
20
  // --- END DETACH LOGIC ---
@@ -77,6 +74,10 @@ function logToFile(msg) {
77
74
  function pauseAndExit(msg) {
78
75
  console.error(msg);
79
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
+ }
80
81
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
81
82
  rl.question('\nāŒ Error occurred. Press ENTER to close...', () => {
82
83
  rl.close();
@@ -252,7 +253,7 @@ async function executeTask(task, keyObj) {
252
253
  req.write(JSON.stringify({
253
254
  model: 'llama-3.3-70b-versatile',
254
255
  messages: [
255
- {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}'},
256
257
  {role: 'user', content: content}
257
258
  ],
258
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.8",
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": {