@siftd/connect-agent 0.2.4 → 0.2.5
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/dist/heartbeat.js +1 -1
- package/dist/orchestrator.js +10 -6
- package/dist/workers/manager.js +8 -3
- package/package.json +1 -1
package/dist/heartbeat.js
CHANGED
|
@@ -10,7 +10,7 @@ import { hostname } from 'os';
|
|
|
10
10
|
import { createHash } from 'crypto';
|
|
11
11
|
import { getServerUrl, getAgentToken, getUserId, isCloudMode } from './config.js';
|
|
12
12
|
const HEARTBEAT_INTERVAL = 10000; // 10 seconds
|
|
13
|
-
const VERSION = '0.2.
|
|
13
|
+
const VERSION = '0.2.5'; // Should match package.json
|
|
14
14
|
const state = {
|
|
15
15
|
intervalId: null,
|
|
16
16
|
runnerId: null,
|
package/dist/orchestrator.js
CHANGED
|
@@ -695,15 +695,19 @@ Be specific about what you want done.`,
|
|
|
695
695
|
if (context) {
|
|
696
696
|
prompt = `Context: ${context}\n\nTask: ${task}`;
|
|
697
697
|
}
|
|
698
|
-
// Add checkpoint instructions to prevent data loss
|
|
698
|
+
// Add checkpoint and logging instructions to prevent data loss
|
|
699
|
+
const logFile = `/tmp/worker-${id}-log.txt`;
|
|
699
700
|
prompt += `
|
|
700
701
|
|
|
701
|
-
IMPORTANT - Progress
|
|
702
|
-
- Output
|
|
702
|
+
IMPORTANT - Progress & Logging:
|
|
703
|
+
- Output findings as you go, don't wait until the end
|
|
703
704
|
- Print discoveries, file paths, and insights immediately as you find them
|
|
704
|
-
-
|
|
705
|
-
|
|
706
|
-
-
|
|
705
|
+
- Report on each file/step before moving to the next
|
|
706
|
+
|
|
707
|
+
REQUIRED - Log Export:
|
|
708
|
+
At the END of your work, create a final log file at: ${logFile}
|
|
709
|
+
Include: job_id=${id}, timestamp, summary of work done, files modified, key findings.
|
|
710
|
+
This ensures nothing is lost even if your output gets truncated.`;
|
|
707
711
|
console.log(`[ORCHESTRATOR] Delegating to worker ${id}: ${task.slice(0, 80)}...`);
|
|
708
712
|
return new Promise((resolve) => {
|
|
709
713
|
const job = {
|
package/dist/workers/manager.js
CHANGED
|
@@ -70,14 +70,19 @@ export class WorkerManager {
|
|
|
70
70
|
this.saveJob(job);
|
|
71
71
|
// Spawn Claude CLI process
|
|
72
72
|
try {
|
|
73
|
-
// Add checkpoint instructions to prevent data loss
|
|
73
|
+
// Add checkpoint and logging instructions to prevent data loss
|
|
74
|
+
const logFile = `/tmp/worker-${jobId}-log.txt`;
|
|
74
75
|
const enhancedTask = `${task}
|
|
75
76
|
|
|
76
|
-
IMPORTANT - Progress
|
|
77
|
+
IMPORTANT - Progress & Logging:
|
|
77
78
|
- Output findings as you go, don't wait until the end
|
|
78
79
|
- Print discoveries and insights immediately as you find them
|
|
79
80
|
- Report on each file/step before moving to the next
|
|
80
|
-
|
|
81
|
+
|
|
82
|
+
REQUIRED - Log Export:
|
|
83
|
+
At the END of your work, create a final log file at: ${logFile}
|
|
84
|
+
Include: job_id=${jobId}, timestamp, summary of work done, files modified, key findings.
|
|
85
|
+
This ensures nothing is lost even if your output gets truncated.`;
|
|
81
86
|
// Escape single quotes in task for shell safety
|
|
82
87
|
const escapedTask = enhancedTask.replace(/'/g, "'\\''");
|
|
83
88
|
// Spawn using bash -l -c to ensure proper PATH resolution (NVM, etc.)
|