rentabots-sdk 1.7.17 → 1.7.18
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/index.js +1 -1
- package/init.js +16 -9
- package/init_templates.js +16 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ exports.MessageSchema = zod_1.z.object({
|
|
|
71
71
|
})
|
|
72
72
|
});
|
|
73
73
|
// --- CORE SDK ENGINE ---
|
|
74
|
-
let SDK_VERSION = '1.7.
|
|
74
|
+
let SDK_VERSION = '1.7.18'; // fallback when package.json is unavailable
|
|
75
75
|
try {
|
|
76
76
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
77
77
|
SDK_VERSION = pkg.version;
|
package/init.js
CHANGED
|
@@ -152,16 +152,23 @@ async function main() {
|
|
|
152
152
|
|
|
153
153
|
queen.on('message', async (msg) => {
|
|
154
154
|
if (msg.sender.type === 'agent') return;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
await queen.sendMessage(msg.jobId, "🤖 Supervisor here. Dispatching a worker shortly.");
|
|
163
|
-
await spawnMissionWorker(job, 'message-trigger');
|
|
155
|
+
|
|
156
|
+
const job = queen.activeMissions.get(msg.jobId);
|
|
157
|
+
if (!job) {
|
|
158
|
+
await queen.sendMessage(msg.jobId, "🤖 Supervisor online. Mission sync in progress.");
|
|
159
|
+
await pushLog('WARN', 'Message received for unknown mission ' + msg.jobId);
|
|
160
|
+
return;
|
|
164
161
|
}
|
|
162
|
+
|
|
163
|
+
// Human clarification should immediately re-trigger implementation.
|
|
164
|
+
if (queen.workers.has(msg.jobId)) {
|
|
165
|
+
await pushLog('INFO', 'Human update received for ' + msg.jobId + '; restarting worker for immediate implementation.');
|
|
166
|
+
try { queen.workers.get(msg.jobId)?.kill(); } catch (_) {}
|
|
167
|
+
queen.workers.delete(msg.jobId);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
await queen.sendMessage(msg.jobId, "✅ Clarification received. Worker is resuming implementation now.");
|
|
171
|
+
await spawnMissionWorker(job, 'human-followup');
|
|
165
172
|
});
|
|
166
173
|
|
|
167
174
|
queen.startAutopilot({ scoutingInterval: 60000, minBudget: 5 });
|
package/init_templates.js
CHANGED
|
@@ -121,17 +121,23 @@ async function main() {
|
|
|
121
121
|
|
|
122
122
|
queen.on('message', async (msg) => {
|
|
123
123
|
if (msg.sender.type === 'agent') return;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
|
|
125
|
+
const job = queen.activeMissions.get(msg.jobId);
|
|
126
|
+
if (!job) {
|
|
127
|
+
await queen.sendMessage(msg.jobId, "🤖 Supervisor online. Mission sync in progress.");
|
|
128
|
+
await pushLog('WARN', 'Message received for unknown mission ' + msg.jobId);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Human clarification should immediately re-trigger implementation.
|
|
133
|
+
if (queen.workers.has(msg.jobId)) {
|
|
134
|
+
await pushLog('INFO', 'Human update received for ' + msg.jobId + '; restarting worker for immediate implementation.');
|
|
135
|
+
try { queen.workers.get(msg.jobId)?.kill(); } catch (_) {}
|
|
136
|
+
queen.workers.delete(msg.jobId);
|
|
134
137
|
}
|
|
138
|
+
|
|
139
|
+
await queen.sendMessage(msg.jobId, "✅ Clarification received. Worker is resuming implementation now.");
|
|
140
|
+
await spawnMissionWorker(job, 'human-followup');
|
|
135
141
|
});
|
|
136
142
|
|
|
137
143
|
queen.startAutopilot({
|