agent-neckbeard 1.0.5 → 1.0.6
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.
Potentially problematic release.
This version of agent-neckbeard might be problematic. Click here for more details.
- package/dist/index.cjs +23 -4
- package/dist/index.js +23 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -262,7 +262,29 @@ import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
|
262
262
|
mkdirSync('/home/user/input', { recursive: true });
|
|
263
263
|
mkdirSync('/home/user/output', { recursive: true });
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
let input, executionId;
|
|
266
|
+
try {
|
|
267
|
+
const taskData = JSON.parse(readFileSync('/home/user/input/task.json', 'utf-8'));
|
|
268
|
+
input = taskData.input;
|
|
269
|
+
executionId = taskData.executionId;
|
|
270
|
+
} catch (parseError) {
|
|
271
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'Task parse failed: ' + parseError.message, stack: parseError.stack } }));
|
|
272
|
+
process.exit(0);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
let mod;
|
|
276
|
+
try {
|
|
277
|
+
mod = await import('./agent.mjs');
|
|
278
|
+
} catch (importError) {
|
|
279
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'Import failed: ' + importError.message, stack: importError.stack } }));
|
|
280
|
+
process.exit(0);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const agent = mod.default || Object.values(mod).find(v => v instanceof Object && v.id);
|
|
284
|
+
if (!agent) {
|
|
285
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'No agent found in module. Exports: ' + Object.keys(mod).join(', ') } }));
|
|
286
|
+
process.exit(0);
|
|
287
|
+
}
|
|
266
288
|
|
|
267
289
|
const ctx = {
|
|
268
290
|
executionId,
|
|
@@ -276,9 +298,6 @@ const ctx = {
|
|
|
276
298
|
},
|
|
277
299
|
};
|
|
278
300
|
|
|
279
|
-
const mod = await import('./agent.mjs');
|
|
280
|
-
const agent = mod.default || Object.values(mod).find(v => v instanceof Object && v.id);
|
|
281
|
-
|
|
282
301
|
try {
|
|
283
302
|
const validated = agent.inputSchema.parse(input);
|
|
284
303
|
const output = await agent._run(validated, ctx);
|
package/dist/index.js
CHANGED
|
@@ -222,7 +222,29 @@ import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
|
222
222
|
mkdirSync('/home/user/input', { recursive: true });
|
|
223
223
|
mkdirSync('/home/user/output', { recursive: true });
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
let input, executionId;
|
|
226
|
+
try {
|
|
227
|
+
const taskData = JSON.parse(readFileSync('/home/user/input/task.json', 'utf-8'));
|
|
228
|
+
input = taskData.input;
|
|
229
|
+
executionId = taskData.executionId;
|
|
230
|
+
} catch (parseError) {
|
|
231
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'Task parse failed: ' + parseError.message, stack: parseError.stack } }));
|
|
232
|
+
process.exit(0);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
let mod;
|
|
236
|
+
try {
|
|
237
|
+
mod = await import('./agent.mjs');
|
|
238
|
+
} catch (importError) {
|
|
239
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'Import failed: ' + importError.message, stack: importError.stack } }));
|
|
240
|
+
process.exit(0);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const agent = mod.default || Object.values(mod).find(v => v instanceof Object && v.id);
|
|
244
|
+
if (!agent) {
|
|
245
|
+
writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: 'No agent found in module. Exports: ' + Object.keys(mod).join(', ') } }));
|
|
246
|
+
process.exit(0);
|
|
247
|
+
}
|
|
226
248
|
|
|
227
249
|
const ctx = {
|
|
228
250
|
executionId,
|
|
@@ -236,9 +258,6 @@ const ctx = {
|
|
|
236
258
|
},
|
|
237
259
|
};
|
|
238
260
|
|
|
239
|
-
const mod = await import('./agent.mjs');
|
|
240
|
-
const agent = mod.default || Object.values(mod).find(v => v instanceof Object && v.id);
|
|
241
|
-
|
|
242
261
|
try {
|
|
243
262
|
const validated = agent.inputSchema.parse(input);
|
|
244
263
|
const output = await agent._run(validated, ctx);
|