rentabots-sdk 1.7.33 → 1.7.35
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 +8 -2
- package/init_templates.js +8 -2
- 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.35'; // 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
|
@@ -257,7 +257,7 @@ const job = JSON.parse(fs.readFileSync(jobDataPath, 'utf8'));
|
|
|
257
257
|
function inferContract(job) {
|
|
258
258
|
const text = ((job.title || '') + ' ' + (job.description || '')).toLowerCase();
|
|
259
259
|
const hasApiWord = /(^|[^a-z0-9])api([^a-z0-9]|$)/i.test(text) || /endpoint|rest\b|graphql\b/.test(text);
|
|
260
|
-
const adapter = hasApiWord ? 'api' : text.includes('
|
|
260
|
+
const adapter = hasApiWord ? 'api' : text.includes('dataset') || text.includes('etl') || text.includes('data pipeline') || text.includes('data analysis') ? 'data' : text.includes('landing page') || text.includes('frontend') || text.includes('ui') || text.includes('web') ? 'web' : text.includes('docs') || text.includes('documentation') ? 'docs' : 'script';
|
|
261
261
|
const contract = {
|
|
262
262
|
adapter,
|
|
263
263
|
taskType: adapter,
|
|
@@ -325,6 +325,11 @@ 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
|
+
// 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
|
+
|
|
328
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)
|
|
@@ -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);
|
package/init_templates.js
CHANGED
|
@@ -233,7 +233,7 @@ const job = JSON.parse(fs.readFileSync(jobDataPath, 'utf8'));
|
|
|
233
233
|
function inferContract(job) {
|
|
234
234
|
const text = ((job.title || '') + ' ' + (job.description || '')).toLowerCase();
|
|
235
235
|
const hasApiWord = /(^|[^a-z0-9])api([^a-z0-9]|$)/i.test(text) || /endpoint|rest\b|graphql\b/.test(text);
|
|
236
|
-
const adapter = hasApiWord ? 'api' : text.includes('
|
|
236
|
+
const adapter = hasApiWord ? 'api' : text.includes('dataset') || text.includes('etl') || text.includes('data pipeline') || text.includes('data analysis') ? 'data' : text.includes('landing page') || text.includes('frontend') || text.includes('ui') || text.includes('web') ? 'web' : text.includes('docs') || text.includes('documentation') ? 'docs' : 'script';
|
|
237
237
|
const contract = {
|
|
238
238
|
adapter,
|
|
239
239
|
taskType: adapter,
|
|
@@ -308,6 +308,11 @@ 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
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
|
|
|
@@ -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);
|