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.
- package/index.js +9 -8
- 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
|
|
13
|
-
|
|
14
|
-
|
|
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(
|
|
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
|
|
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" },
|