rentabots-sdk 1.7.31 → 1.7.33

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.31'; // fallback when package.json is unavailable
74
+ let SDK_VERSION = '1.7.33'; // 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
@@ -209,9 +209,13 @@ async function main() {
209
209
  queen.on('message', async (msg) => {
210
210
  if (msg.sender.type === 'agent') return;
211
211
 
212
- const job = queen.activeMissions.get(msg.jobId);
212
+ let job = queen.activeMissions.get(msg.jobId);
213
213
  if (!job) {
214
- await queen.sendMessage(msg.jobId, "🤖 Supervisor online. Mission sync in progress.");
214
+ try { if (typeof queen.syncFromCloud === 'function') await queen.syncFromCloud(); } catch (_) {}
215
+ job = queen.activeMissions.get(msg.jobId);
216
+ }
217
+ if (!job) {
218
+ await queen.sendMessage(msg.jobId, "🤖 Got your message. I am re-syncing mission state now and will resume as soon as assignment is visible.");
215
219
  await pushLog('WARN', 'Message received for unknown mission ' + msg.jobId);
216
220
  return;
217
221
  }
@@ -321,7 +325,7 @@ async function main() {
321
325
  fs.writeFileSync(path.join(workDir, 'ACCEPTANCE.json'), JSON.stringify(contract, null, 2));
322
326
  await agent.sendMessage(job.id, '📋 Contract parsed: ' + contract.taskType + ' / ' + contract.language + '. Deliverables: ' + contract.deliverables.join(', '));
323
327
 
324
- const task = 'PROJECT: ' + job.title + '. BRIEF: ' + job.description + '. CONTRACT: ' + JSON.stringify(contract) + '. INSTRUCTION: Execute this task in the current directory. Do not leave the workspace. You MUST produce tangible deliverables (code + README + run/test notes) in local files.';
328
+ const task = 'PROJECT: ' + job.title + '. BRIEF: ' + job.description + '. CONTRACT: ' + JSON.stringify(contract) + '. WORKDIR: ' + workDir + '. MANDATORY OUTPUT FILES: ' + contract.deliverables.join(', ') + '. INSTRUCTION: Work ONLY in WORKDIR. Create/modify the mandatory files there with real implementation (not placeholders), then include run/test notes in README.';
325
329
 
326
330
  // Use shell command string (not array args)
327
331
  const taskArg = JSON.stringify(task);
@@ -513,7 +517,8 @@ async function main() {
513
517
 
514
518
  if (issues.length > 0) {
515
519
  await agent.setProgress(job.id, 70);
516
- if (RELAXED_MODE) {
520
+ const blockingIssues = issues.filter(i => i.includes('expected at least one .py') || i.includes('missing contract deliverable'));
521
+ if (RELAXED_MODE && blockingIssues.length === 0) {
517
522
  await agent.sendMessage(job.id, '⚠️ Soft QA warnings: ' + issues.slice(0, 3).join('; ') + '. Continuing with OpenClaw output in relaxed mode.');
518
523
  } else {
519
524
  await agent.sendMessage(job.id, '⚠️ Contract QA failed: ' + issues.slice(0, 4).join('; ') + '. Running targeted OpenClaw repair pass now.');
@@ -532,6 +537,8 @@ async function main() {
532
537
  const repairPrompt = [
533
538
  'Repair the existing workspace to satisfy missing deterministic gates.',
534
539
  'Do not explain. Edit files now and finish.',
540
+ 'WORKDIR: ' + workDir,
541
+ 'MANDATORY OUTPUT FILES: ' + contract.deliverables.join(', '),
535
542
  'MISSING GATES:',
536
543
  ...issues.map(i => '- ' + i),
537
544
  '',
package/init_templates.js CHANGED
@@ -178,9 +178,13 @@ async function main() {
178
178
  queen.on('message', async (msg) => {
179
179
  if (msg.sender.type === 'agent') return;
180
180
 
181
- const job = queen.activeMissions.get(msg.jobId);
181
+ let job = queen.activeMissions.get(msg.jobId);
182
182
  if (!job) {
183
- await queen.sendMessage(msg.jobId, "🤖 Supervisor online. Mission sync in progress.");
183
+ try { if (typeof queen.syncFromCloud === 'function') await queen.syncFromCloud(); } catch (_) {}
184
+ job = queen.activeMissions.get(msg.jobId);
185
+ }
186
+ if (!job) {
187
+ await queen.sendMessage(msg.jobId, "🤖 Got your message. I am re-syncing mission state now and will resume as soon as assignment is visible.");
184
188
  await pushLog('WARN', 'Message received for unknown mission ' + msg.jobId);
185
189
  return;
186
190
  }
@@ -305,7 +309,7 @@ async function main() {
305
309
  await agent.sendMessage(job.id, '📋 Contract parsed: ' + contract.taskType + ' / ' + contract.language + '. Deliverables: ' + contract.deliverables.join(', '));
306
310
 
307
311
  // Construct the prompt for the autonomous brain
308
- const task = \`PROJECT: \${job.title}. BRIEF: \${job.description}. CONTRACT: \${JSON.stringify(contract)}. INSTRUCTION: Execute this task in the current directory. Do not leave the workspace. You MUST produce tangible deliverables (code + README + run/test notes) in local files.\`;
312
+ const task = \`PROJECT: \${job.title}. BRIEF: \${job.description}. CONTRACT: \${JSON.stringify(contract)}. WORKDIR: \${workDir}. MANDATORY OUTPUT FILES: \${contract.deliverables.join(', ')}. INSTRUCTION: Work ONLY in WORKDIR. Create/modify the mandatory files there with real implementation (not placeholders), then include run/test notes in README.\`;
309
313
 
310
314
  // --- 🦞 EXECUTE VIA OPENCLAW BRAIN ---
311
315
  const taskArg = JSON.stringify(task);
@@ -498,7 +502,8 @@ async function main() {
498
502
 
499
503
  if (issues.length > 0) {
500
504
  await agent.setProgress(job.id, 70);
501
- if (RELAXED_MODE) {
505
+ const blockingIssues = issues.filter(i => i.includes('expected at least one .py') || i.includes('missing contract deliverable'));
506
+ if (RELAXED_MODE && blockingIssues.length === 0) {
502
507
  await agent.sendMessage(job.id, '⚠️ Soft QA warnings: ' + issues.slice(0, 3).join('; ') + '. Continuing with OpenClaw output in relaxed mode.');
503
508
  } else {
504
509
  await agent.sendMessage(job.id, '⚠️ Contract QA failed: ' + issues.slice(0, 4).join('; ') + '. Running targeted OpenClaw repair pass now.');
@@ -517,6 +522,8 @@ async function main() {
517
522
  const repairPrompt = [
518
523
  'Repair the existing workspace to satisfy missing deterministic gates.',
519
524
  'Do not explain. Edit files now and finish.',
525
+ 'WORKDIR: ' + workDir,
526
+ 'MANDATORY OUTPUT FILES: ' + contract.deliverables.join(', '),
520
527
  'MISSING GATES:',
521
528
  ...issues.map(i => '- ' + i),
522
529
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rentabots-sdk",
3
- "version": "1.7.31",
3
+ "version": "1.7.33",
4
4
  "description": "Official SDK for RentaBots AI Agent Marketplace",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",