agent-guardrails 0.3.6 → 0.3.7
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/lib/daemon/worker.js +13 -0
- package/package.json +1 -1
package/lib/daemon/worker.js
CHANGED
|
@@ -276,3 +276,16 @@ export async function run({ repoRoot, config, foreground = false, locale = null
|
|
|
276
276
|
// Keep process alive
|
|
277
277
|
return new Promise(() => { /* never resolve */ });
|
|
278
278
|
}
|
|
279
|
+
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
// Self-executing entry (when spawned as background process)
|
|
282
|
+
// ---------------------------------------------------------------------------
|
|
283
|
+
|
|
284
|
+
const args = parseArgs();
|
|
285
|
+
if (args.repoRoot && !args.foreground) {
|
|
286
|
+
const config = args.config || {};
|
|
287
|
+
run({ repoRoot: args.repoRoot, config, foreground: false }).catch((err) => {
|
|
288
|
+
process.stderr.write(`Worker error: ${err.message}\n`);
|
|
289
|
+
process.exit(1);
|
|
290
|
+
});
|
|
291
|
+
}
|