rentabots-sdk 1.7.32 → 1.7.34

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.32'; // fallback when package.json is unavailable
74
+ let SDK_VERSION = '1.7.34'; // 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
@@ -325,7 +325,12 @@ async function main() {
325
325
  fs.writeFileSync(path.join(workDir, 'ACCEPTANCE.json'), JSON.stringify(contract, null, 2));
326
326
  await agent.sendMessage(job.id, '📋 Contract parsed: ' + contract.taskType + ' / ' + contract.language + '. Deliverables: ' + contract.deliverables.join(', '));
327
327
 
328
- 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
+ // Remove stale adapter artifacts from older retries/runs
329
+ try { if (contract.adapter !== 'api') fs.unlinkSync(path.join(workDir, 'openapi-or-endpoint-docs.md')); } catch (_) {}
330
+ try { if (contract.adapter !== 'data') fs.unlinkSync(path.join(workDir, 'data_dictionary.md')); } catch (_) {}
331
+ try { if (contract.adapter !== 'docs') fs.unlinkSync(path.join(workDir, 'DOCUMENTATION.md')); } catch (_) {}
332
+
333
+ 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.';
329
334
 
330
335
  // Use shell command string (not array args)
331
336
  const taskArg = JSON.stringify(task);
@@ -405,7 +410,8 @@ async function main() {
405
410
  const walk = (dir, rel = '') => {
406
411
  if (!fs.existsSync(dir)) return;
407
412
  for (const item of fs.readdirSync(dir)) {
408
- if (item === 'node_modules' || item === '.git') continue;
413
+ if (item === 'node_modules' || item === '.git' || item.startsWith('.')) continue;
414
+ if (['ACCEPTANCE.json', 'DELIVERY_SUMMARY.md', 'FAILSAFE_REPORT.md'].includes(item)) continue;
409
415
  const full = path.join(dir, item);
410
416
  const relPath = rel ? path.join(rel, item) : item;
411
417
  if (fs.statSync(full).isDirectory()) walk(full, relPath);
@@ -537,6 +543,8 @@ async function main() {
537
543
  const repairPrompt = [
538
544
  'Repair the existing workspace to satisfy missing deterministic gates.',
539
545
  'Do not explain. Edit files now and finish.',
546
+ 'WORKDIR: ' + workDir,
547
+ 'MANDATORY OUTPUT FILES: ' + contract.deliverables.join(', '),
540
548
  'MISSING GATES:',
541
549
  ...issues.map(i => '- ' + i),
542
550
  '',
package/init_templates.js CHANGED
@@ -308,8 +308,13 @@ async function main() {
308
308
  fs.writeFileSync(path.join(workDir, 'ACCEPTANCE.json'), JSON.stringify(contract, null, 2));
309
309
  await agent.sendMessage(job.id, '📋 Contract parsed: ' + contract.taskType + ' / ' + contract.language + '. Deliverables: ' + contract.deliverables.join(', '));
310
310
 
311
+ // Remove stale adapter artifacts from older retries/runs
312
+ try { if (contract.adapter !== 'api') fs.unlinkSync(path.join(workDir, 'openapi-or-endpoint-docs.md')); } catch (_) {}
313
+ try { if (contract.adapter !== 'data') fs.unlinkSync(path.join(workDir, 'data_dictionary.md')); } catch (_) {}
314
+ try { if (contract.adapter !== 'docs') fs.unlinkSync(path.join(workDir, 'DOCUMENTATION.md')); } catch (_) {}
315
+
311
316
  // Construct the prompt for the autonomous brain
312
- 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.\`;
317
+ 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.\`;
313
318
 
314
319
  // --- 🦞 EXECUTE VIA OPENCLAW BRAIN ---
315
320
  const taskArg = JSON.stringify(task);
@@ -390,7 +395,8 @@ async function main() {
390
395
  const walk = (dir, rel = '') => {
391
396
  if (!fs.existsSync(dir)) return;
392
397
  for (const item of fs.readdirSync(dir)) {
393
- if (item === 'node_modules' || item === '.git') continue;
398
+ if (item === 'node_modules' || item === '.git' || item.startsWith('.')) continue;
399
+ if (['ACCEPTANCE.json', 'DELIVERY_SUMMARY.md', 'FAILSAFE_REPORT.md'].includes(item)) continue;
394
400
  const full = path.join(dir, item);
395
401
  const relPath = rel ? path.join(rel, item) : item;
396
402
  if (fs.statSync(full).isDirectory()) walk(full, relPath);
@@ -522,6 +528,8 @@ async function main() {
522
528
  const repairPrompt = [
523
529
  'Repair the existing workspace to satisfy missing deterministic gates.',
524
530
  'Do not explain. Edit files now and finish.',
531
+ 'WORKDIR: ' + workDir,
532
+ 'MANDATORY OUTPUT FILES: ' + contract.deliverables.join(', '),
525
533
  'MISSING GATES:',
526
534
  ...issues.map(i => '- ' + i),
527
535
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rentabots-sdk",
3
- "version": "1.7.32",
3
+ "version": "1.7.34",
4
4
  "description": "Official SDK for RentaBots AI Agent Marketplace",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",