rentabots-sdk 1.7.35 → 1.7.36

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.35'; // fallback when package.json is unavailable
74
+ let SDK_VERSION = '1.7.36'; // 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
@@ -234,7 +234,21 @@ async function main() {
234
234
  fs.writeFileSync(markerPath, JSON.stringify({ at: Date.now(), content: msg.content || '' }));
235
235
  } catch (_) {}
236
236
 
237
- await queen.sendMessage(msg.jobId, "✅ Clarification received. Worker is resuming implementation now.");
237
+ const replyPrompt = JSON.stringify([
238
+ 'You are mission assistant. Reply briefly to the human and confirm implementation has started.',
239
+ 'Return only the reply message text.',
240
+ 'HUMAN MESSAGE: ' + (msg.content || ''),
241
+ 'MISSION TITLE: ' + (job.title || ''),
242
+ ].join('\n'));
243
+ let autoReply = '🧠 Got it. I am applying your instruction now and will deliver updated output shortly.';
244
+ for (const c of ['openclaw sessions spawn --task ' + replyPrompt, 'openclaw sessions_spawn --task ' + replyPrompt]) {
245
+ const r = await queen.execute(msg.jobId, c, { timeout: 120000, shell: true });
246
+ const out = (r.output || '').trim();
247
+ if (r.exitCode === 0 && out && !/unknown command|usage: openclaw/i.test(out)) { autoReply = out.slice(-500); break; }
248
+ if (!/unknown command/i.test(out)) break;
249
+ }
250
+
251
+ await queen.sendMessage(msg.jobId, autoReply);
238
252
  await spawnMissionWorker(job, 'human-followup', { watchAfterClarification: true, baselineFiles });
239
253
  });
240
254
 
@@ -511,7 +525,7 @@ async function main() {
511
525
  } else if (contract.adapter === 'docs') {
512
526
  const hasDocFile = hasFile((f) => f.toLowerCase().endsWith('.md'));
513
527
  const hasSections = /(##\s+overview|##\s+setup|##\s+usage|table of contents|getting started)/i.test(combinedText);
514
- const hasExamples = /(example|sample|command|curl|code block|```)/i.test(combinedText);
528
+ const hasExamples = /(example|sample|command|curl|code block)/i.test(combinedText);
515
529
  if (!hasDocFile) issues.push('docs adapter: missing markdown documentation');
516
530
  if (!hasSections) issues.push('docs adapter: missing core documentation sections');
517
531
  if (!hasExamples) issues.push('docs adapter: missing usage examples');
@@ -536,8 +550,9 @@ async function main() {
536
550
  fs.writeFileSync(repairPath, String(repairCount));
537
551
 
538
552
  if (repairCount > 6) {
539
- await agent.sendMessage(job.id, '🚨 OpenClaw repair limit reached. Please send one concrete clarification so I can continue with a precise fix.');
540
- return;
553
+ await agent.sendMessage(job.id, '🔁 OpenClaw repair limit exceeded; continuing autonomous deep-repair cycle.');
554
+ repairCount = 3;
555
+ fs.writeFileSync(repairPath, String(repairCount));
541
556
  }
542
557
 
543
558
  const repairPrompt = [
@@ -705,7 +720,9 @@ async function main() {
705
720
 
706
721
  // Fail-safe report only after OpenClaw retry budget exhausted
707
722
  await agent.setProgress(job.id, 25);
708
- await agent.sendMessage(job.id, "🚨 OpenClaw execution repeatedly failed. Please send one concrete clarification and I will continue immediately.");
723
+ await agent.sendMessage(job.id, "🔁 OpenClaw execution still failing after retries. Continuing autonomous retries with adjusted strategy.");
724
+ await new Promise(r => setTimeout(r, 8000));
725
+ process.exit(42);
709
726
 
710
727
  try {
711
728
  const repoRes = await agent.getRepo(job.id);
package/init_templates.js CHANGED
@@ -203,7 +203,21 @@ async function main() {
203
203
  fs.writeFileSync(markerPath, JSON.stringify({ at: Date.now(), content: msg.content || '' }));
204
204
  } catch (_) {}
205
205
 
206
- await queen.sendMessage(msg.jobId, "✅ Clarification received. Worker is resuming implementation now.");
206
+ const replyPrompt = JSON.stringify([
207
+ 'You are mission assistant. Reply briefly to the human and confirm implementation has started.',
208
+ 'Return only the reply message text.',
209
+ 'HUMAN MESSAGE: ' + (msg.content || ''),
210
+ 'MISSION TITLE: ' + (job.title || ''),
211
+ ].join('\n'));
212
+ let autoReply = '🧠 Got it. I am applying your instruction now and will deliver updated output shortly.';
213
+ for (const c of ['openclaw sessions spawn --task ' + replyPrompt, 'openclaw sessions_spawn --task ' + replyPrompt]) {
214
+ const r = await queen.execute(msg.jobId, c, { timeout: 120000, shell: true });
215
+ const out = (r.output || '').trim();
216
+ if (r.exitCode === 0 && out && !/unknown command|usage: openclaw/i.test(out)) { autoReply = out.slice(-500); break; }
217
+ if (!/unknown command/i.test(out)) break;
218
+ }
219
+
220
+ await queen.sendMessage(msg.jobId, autoReply);
207
221
  await spawnMissionWorker(job, 'human-followup', { watchAfterClarification: true, baselineFiles });
208
222
  });
209
223
 
@@ -496,7 +510,7 @@ async function main() {
496
510
  } else if (contract.adapter === 'docs') {
497
511
  const hasDocFile = hasFile((f) => f.toLowerCase().endsWith('.md'));
498
512
  const hasSections = /(##\s+overview|##\s+setup|##\s+usage|table of contents|getting started)/i.test(combinedText);
499
- const hasExamples = /(example|sample|command|curl|code block|```)/i.test(combinedText);
513
+ const hasExamples = /(example|sample|command|curl|code block)/i.test(combinedText);
500
514
  if (!hasDocFile) issues.push('docs adapter: missing markdown documentation');
501
515
  if (!hasSections) issues.push('docs adapter: missing core documentation sections');
502
516
  if (!hasExamples) issues.push('docs adapter: missing usage examples');
@@ -521,8 +535,9 @@ async function main() {
521
535
  fs.writeFileSync(repairPath, String(repairCount));
522
536
 
523
537
  if (repairCount > 6) {
524
- await agent.sendMessage(job.id, '🚨 OpenClaw repair limit reached. Please send one concrete clarification so I can continue with a precise fix.');
525
- return;
538
+ await agent.sendMessage(job.id, '🔁 OpenClaw repair limit exceeded; continuing autonomous deep-repair cycle.');
539
+ repairCount = 3;
540
+ fs.writeFileSync(repairPath, String(repairCount));
526
541
  }
527
542
 
528
543
  const repairPrompt = [
@@ -690,7 +705,9 @@ async function main() {
690
705
 
691
706
  // Fail-safe report only after OpenClaw retry budget exhausted
692
707
  await agent.setProgress(job.id, 25);
693
- await agent.sendMessage(job.id, "🚨 OpenClaw execution repeatedly failed. Please send one concrete clarification and I will continue immediately.");
708
+ await agent.sendMessage(job.id, "🔁 OpenClaw execution still failing after retries. Continuing autonomous retries with adjusted strategy.");
709
+ await new Promise(r => setTimeout(r, 8000));
710
+ process.exit(42);
694
711
 
695
712
  try {
696
713
  const repoRes = await agent.getRepo(job.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rentabots-sdk",
3
- "version": "1.7.35",
3
+ "version": "1.7.36",
4
4
  "description": "Official SDK for RentaBots AI Agent Marketplace",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",