@neriros/ralphy 2.13.10 → 2.13.12
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/cli/index.js +67 -12
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -70515,6 +70515,27 @@ async function fetchIssueLabels(apiKey, teamKey) {
|
|
|
70515
70515
|
});
|
|
70516
70516
|
return data.issueLabels.nodes;
|
|
70517
70517
|
}
|
|
70518
|
+
async function fetchTeamIdByKey(apiKey, teamKey) {
|
|
70519
|
+
const query = `query TeamId($key: String!) {
|
|
70520
|
+
teams(filter: { key: { eq: $key } }, first: 1) {
|
|
70521
|
+
nodes { id }
|
|
70522
|
+
}
|
|
70523
|
+
}`;
|
|
70524
|
+
const data = await linearRequest(apiKey, query, {
|
|
70525
|
+
key: teamKey
|
|
70526
|
+
});
|
|
70527
|
+
return data.teams.nodes[0]?.id ?? null;
|
|
70528
|
+
}
|
|
70529
|
+
async function createIssueLabel(apiKey, teamId, name) {
|
|
70530
|
+
const mutation = `mutation CreateLabel($teamId: String!, $name: String!) {
|
|
70531
|
+
issueLabelCreate(input: { teamId: $teamId, name: $name }) {
|
|
70532
|
+
success
|
|
70533
|
+
issueLabel { id }
|
|
70534
|
+
}
|
|
70535
|
+
}`;
|
|
70536
|
+
const data = await linearRequest(apiKey, mutation, { teamId, name });
|
|
70537
|
+
return data.issueLabelCreate.issueLabel?.id ?? null;
|
|
70538
|
+
}
|
|
70518
70539
|
async function addLabelToIssue(apiKey, issueId, labelId) {
|
|
70519
70540
|
const mutation = `mutation AddLabel($id: String!, $labelId: String!) {
|
|
70520
70541
|
issueAddLabel(id: $id, labelId: $labelId) { success }
|
|
@@ -71404,9 +71425,9 @@ ${reBlob.trim()}`);
|
|
|
71404
71425
|
continue;
|
|
71405
71426
|
}
|
|
71406
71427
|
}
|
|
71407
|
-
if (!
|
|
71428
|
+
if (!pushRejected || hookFixAttempt >= maxHookFixAttempts) {
|
|
71408
71429
|
if (pushRejected) {
|
|
71409
|
-
log2(`! push rejected for ${changeName} after ${hookFixAttempt}
|
|
71430
|
+
log2(`! push rejected for ${changeName} after ${hookFixAttempt} fix attempts (push still failing) \u2014 worktree preserved at ${cwd2}`, "red");
|
|
71410
71431
|
log2(` detail: ${detail}`, "red");
|
|
71411
71432
|
} else {
|
|
71412
71433
|
log2(`! PR create failed for ${changeName}: ${detail}`, "red");
|
|
@@ -71419,7 +71440,7 @@ ${reBlob.trim()}`);
|
|
|
71419
71440
|
emit("push-retry", `${hookFixAttempt}/${maxHookFixAttempts}`);
|
|
71420
71441
|
log2(`! push rejected for ${changeName} \u2014 prepending fix task and re-running loop (attempt ${hookFixAttempt}/${maxHookFixAttempts})`, "yellow");
|
|
71421
71442
|
log2(` detail: ${detail}`, "yellow");
|
|
71422
|
-
const retryCode = await runWorkerWithFixTask("Fix
|
|
71443
|
+
const retryCode = await runWorkerWithFixTask("Fix push rejection", `Push to origin/${branch} was rejected. Fix the underlying problem ` + `(e.g. failing pre-push hook checks), then the push will be retried.
|
|
71423
71444
|
|
|
71424
71445
|
` + combined.trim());
|
|
71425
71446
|
if (retryCode !== 0) {
|
|
@@ -71607,6 +71628,7 @@ function buildAgentCoordinator(input) {
|
|
|
71607
71628
|
const cmdRunner = input.runners?.cmd ?? bunCmdRunner;
|
|
71608
71629
|
const stateCache = new Map;
|
|
71609
71630
|
const labelCache = new Map;
|
|
71631
|
+
const teamIdCache = new Map;
|
|
71610
71632
|
const teamKeyOf = (issue) => issue.identifier.split("-")[0];
|
|
71611
71633
|
async function resolveStateId(issue, name) {
|
|
71612
71634
|
const t = teamKeyOf(issue);
|
|
@@ -71626,7 +71648,27 @@ function buildAgentCoordinator(input) {
|
|
|
71626
71648
|
map2 = new Map(labels.map((l) => [l.name.toLowerCase(), l.id]));
|
|
71627
71649
|
labelCache.set(t, map2);
|
|
71628
71650
|
}
|
|
71629
|
-
|
|
71651
|
+
const existing = map2.get(name.toLowerCase());
|
|
71652
|
+
if (existing)
|
|
71653
|
+
return existing;
|
|
71654
|
+
try {
|
|
71655
|
+
let teamId = teamIdCache.get(t);
|
|
71656
|
+
if (!teamId) {
|
|
71657
|
+
const fetched = await fetchTeamIdByKey(apiKey, t);
|
|
71658
|
+
if (!fetched)
|
|
71659
|
+
return null;
|
|
71660
|
+
teamId = fetched;
|
|
71661
|
+
teamIdCache.set(t, teamId);
|
|
71662
|
+
}
|
|
71663
|
+
const newId = await createIssueLabel(apiKey, teamId, name);
|
|
71664
|
+
if (!newId)
|
|
71665
|
+
return null;
|
|
71666
|
+
map2.set(name.toLowerCase(), newId);
|
|
71667
|
+
onLog(` created Linear label '${name}' for team ${t}`, "gray");
|
|
71668
|
+
return newId;
|
|
71669
|
+
} catch {
|
|
71670
|
+
return null;
|
|
71671
|
+
}
|
|
71630
71672
|
}
|
|
71631
71673
|
async function applyMarker(issue, m) {
|
|
71632
71674
|
if (m.type === "status") {
|
|
@@ -71640,7 +71682,7 @@ function buildAgentCoordinator(input) {
|
|
|
71640
71682
|
} else {
|
|
71641
71683
|
const id = await resolveLabelId(issue, m.value);
|
|
71642
71684
|
if (!id) {
|
|
71643
|
-
onLog(`! Linear label '${m.value}' not
|
|
71685
|
+
onLog(`! Linear label '${m.value}' could not be created for ${issue.identifier}`, "yellow");
|
|
71644
71686
|
return;
|
|
71645
71687
|
}
|
|
71646
71688
|
await addLabelToIssue(apiKey, issue.id, id);
|
|
@@ -72525,13 +72567,26 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
72525
72567
|
}, undefined, true, undefined, this)
|
|
72526
72568
|
]
|
|
72527
72569
|
}, undefined, true, undefined, this),
|
|
72528
|
-
pollStatus.filterDesc &&
|
|
72529
|
-
|
|
72530
|
-
|
|
72531
|
-
|
|
72532
|
-
|
|
72533
|
-
]
|
|
72534
|
-
|
|
72570
|
+
pollStatus.filterDesc && (() => {
|
|
72571
|
+
const prefix = "Linear ";
|
|
72572
|
+
const indent = " ".repeat(prefix.length);
|
|
72573
|
+
const full = pollStatus.filterDesc.replace(/, /g, " \xB7 ");
|
|
72574
|
+
const lineWidth = Math.max(20, termWidth - 4);
|
|
72575
|
+
const lines = [];
|
|
72576
|
+
let remaining = full;
|
|
72577
|
+
while (remaining.length > 0) {
|
|
72578
|
+
const budget = lineWidth - (lines.length === 0 ? prefix.length : indent.length);
|
|
72579
|
+
lines.push(remaining.slice(0, budget));
|
|
72580
|
+
remaining = remaining.slice(budget);
|
|
72581
|
+
}
|
|
72582
|
+
return lines.map((segment, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
72583
|
+
dimColor: true,
|
|
72584
|
+
children: [
|
|
72585
|
+
i === 0 ? prefix : indent,
|
|
72586
|
+
segment
|
|
72587
|
+
]
|
|
72588
|
+
}, i, true, undefined, this));
|
|
72589
|
+
})()
|
|
72535
72590
|
]
|
|
72536
72591
|
}, undefined, true, undefined, this),
|
|
72537
72592
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
package/package.json
CHANGED