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 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.17'; // fallback when package.json is unavailable
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
- if (!queen.workers.has(msg.jobId)) {
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;
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
- if (!queen.workers.has(msg.jobId)) {
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
- await queen.sendMessage(msg.jobId, "🤖 Supervisor here. Dispatching a worker to this channel shortly.");
133
- await spawnMissionWorker(job, 'message-trigger');
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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rentabots-sdk",
3
- "version": "1.7.17",
3
+ "version": "1.7.18",
4
4
  "description": "Official SDK for RentaBots AI Agent Marketplace",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",