@neriros/ralphy 2.20.2 → 2.20.3

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +68 -27
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -35029,8 +35029,8 @@ import { readFileSync as readFileSync2 } from "fs";
35029
35029
  import { resolve } from "path";
35030
35030
  function getVersion() {
35031
35031
  try {
35032
- if ("2.20.2")
35033
- return "2.20.2";
35032
+ if ("2.20.3")
35033
+ return "2.20.3";
35034
35034
  } catch {}
35035
35035
  const dirsToTry = [];
35036
35036
  try {
@@ -61310,24 +61310,7 @@ function buildAgentCoordinator(input) {
61310
61310
  teamId = fetched;
61311
61311
  teamIdCache.set(t, teamId);
61312
61312
  }
61313
- const colonIdx = name.indexOf(":");
61314
- let parentId;
61315
- let childName = name;
61316
- if (colonIdx > 0) {
61317
- const groupName = name.slice(0, colonIdx);
61318
- childName = name.slice(colonIdx + 1);
61319
- const existingGroup = map2.get(groupName.toLowerCase());
61320
- if (existingGroup) {
61321
- parentId = existingGroup;
61322
- } else {
61323
- const groupId = await createIssueLabel(apiKey, teamId, groupName);
61324
- if (groupId) {
61325
- map2.set(groupName.toLowerCase(), groupId);
61326
- parentId = groupId;
61327
- }
61328
- }
61329
- }
61330
- const newId = await createIssueLabel(apiKey, teamId, childName, parentId);
61313
+ const newId = await createIssueLabel(apiKey, teamId, name);
61331
61314
  if (!newId)
61332
61315
  return null;
61333
61316
  map2.set(name.toLowerCase(), newId);
@@ -62296,13 +62279,46 @@ async function runAgentJson({
62296
62279
  };
62297
62280
  tick();
62298
62281
  await new Promise((resolve2) => {
62282
+ let shuttingDown = false;
62299
62283
  const onSig = () => {
62284
+ if (shuttingDown) {
62285
+ process.exit(130);
62286
+ }
62287
+ shuttingDown = true;
62300
62288
  cancelled = true;
62301
62289
  emit({ type: "stopped" });
62302
62290
  coord.stop();
62303
62291
  if (pollTimer)
62304
62292
  clearTimeout(pollTimer);
62305
- resolve2();
62293
+ const start = Date.now();
62294
+ let warned = false;
62295
+ const wait = setInterval(() => {
62296
+ const active = coord.activeCount;
62297
+ const elapsed = Date.now() - start;
62298
+ if (active === 0) {
62299
+ clearInterval(wait);
62300
+ resolve2();
62301
+ return;
62302
+ }
62303
+ if (!warned && elapsed >= 5000) {
62304
+ warned = true;
62305
+ emit({
62306
+ type: "log",
62307
+ text: `! ${active} worker(s) still running after 5s \u2014 forcing exit at 10s`,
62308
+ level: "warn"
62309
+ });
62310
+ }
62311
+ if (elapsed >= 1e4) {
62312
+ clearInterval(wait);
62313
+ emit({
62314
+ type: "log",
62315
+ text: `! ${active} worker(s) did not exit within 10s \u2014 forcing process exit`,
62316
+ level: "warn"
62317
+ });
62318
+ resolve2();
62319
+ setTimeout(() => process.exit(1), 50);
62320
+ }
62321
+ }, 100);
62306
62322
  };
62307
62323
  process.once("SIGINT", onSig);
62308
62324
  process.once("SIGTERM", onSig);
@@ -73383,13 +73399,38 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73383
73399
  tick();
73384
73400
  }
73385
73401
  init2();
73402
+ let shuttingDown = false;
73386
73403
  const onSig = () => {
73404
+ if (shuttingDown) {
73405
+ process.exit(130);
73406
+ }
73407
+ shuttingDown = true;
73387
73408
  cancelled = true;
73388
73409
  appendLog("stopping agent \u2014 sending SIGTERM to workers", "yellow");
73389
73410
  coordRef.current?.stop();
73390
73411
  if (pollTimer)
73391
73412
  clearTimeout(pollTimer);
73392
- exit();
73413
+ const start = Date.now();
73414
+ let warned = false;
73415
+ const waitForWorkers = setInterval(() => {
73416
+ const active = coordRef.current?.activeCount ?? 0;
73417
+ const elapsed = Date.now() - start;
73418
+ if (active === 0) {
73419
+ clearInterval(waitForWorkers);
73420
+ exit();
73421
+ setTimeout(() => process.exit(0), 200);
73422
+ return;
73423
+ }
73424
+ if (!warned && elapsed >= 5000) {
73425
+ warned = true;
73426
+ appendLog(`! ${active} worker${active === 1 ? "" : "s"} still running after 5s \u2014 forcing exit at 10s (press Ctrl-C again to exit now)`, "red");
73427
+ }
73428
+ if (elapsed >= 1e4) {
73429
+ clearInterval(waitForWorkers);
73430
+ appendLog(`! ${active} worker${active === 1 ? "" : "s"} did not exit within 10s \u2014 forcing process exit`, "red");
73431
+ setTimeout(() => process.exit(1), 50);
73432
+ }
73433
+ }, 100);
73393
73434
  };
73394
73435
  process.on("SIGINT", onSig);
73395
73436
  process.on("SIGTERM", onSig);
@@ -73603,7 +73644,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73603
73644
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73604
73645
  label: "POLL STATUS",
73605
73646
  borderColor: "gray",
73606
- width: termWidth - 30,
73647
+ width: termWidth - 13,
73607
73648
  paddingX: 1,
73608
73649
  flexDirection: "column",
73609
73650
  children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
@@ -73721,18 +73762,18 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73721
73762
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73722
73763
  label: "WORKERS",
73723
73764
  borderColor: "gray",
73724
- width: 29,
73765
+ width: 12,
73725
73766
  paddingX: 1,
73726
73767
  flexDirection: "column",
73727
73768
  children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73728
- gap: 3,
73769
+ gap: 2,
73729
73770
  children: [
73730
73771
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73731
73772
  gap: 1,
73732
73773
  children: [
73733
73774
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73734
73775
  dimColor: true,
73735
- children: "active"
73776
+ children: "A"
73736
73777
  }, undefined, false, undefined, this),
73737
73778
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73738
73779
  color: activeCount > 0 ? "cyan" : "gray",
@@ -73746,7 +73787,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73746
73787
  children: [
73747
73788
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73748
73789
  dimColor: true,
73749
- children: "queued"
73790
+ children: "Q"
73750
73791
  }, undefined, false, undefined, this),
73751
73792
  /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73752
73793
  color: coord?.queuedCount ?? 0 > 0 ? "yellow" : "gray",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neriros/ralphy",
3
- "version": "2.20.2",
3
+ "version": "2.20.3",
4
4
  "description": "An iterative AI task execution framework. Orchestrates multi-phase autonomous work using Claude or Codex engines.",
5
5
  "keywords": [
6
6
  "agent",