@neriros/ralphy 2.22.0 → 2.22.1
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/README.md +18 -20
- package/dist/cli/index.js +31 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,19 +142,19 @@ The cycle repeats every poll. For code-review-iteration in particular, `setDone`
|
|
|
142
142
|
|
|
143
143
|
Linear is the source of truth for which issues Ralph has touched. The `linear.indicators` map declares how Ralph queries and mutates Linear at each lifecycle event. All keys are optional; an unset key means "Ralph doesn't perform that action".
|
|
144
144
|
|
|
145
|
-
| Key | Type
|
|
146
|
-
| ----------------- |
|
|
147
|
-
| `getTodo` | `{filter: Marker[]}`
|
|
148
|
-
| `getInProgress` | `{filter: Marker[]}`
|
|
149
|
-
| `getConflicted` | `{filter: Marker[]}`
|
|
150
|
-
| `getReview` | `{filter: Marker[]}`
|
|
151
|
-
| `getAutoMerge` | `{filter: Marker[]}`
|
|
152
|
-
| `setInProgress` | `Marker` or `
|
|
153
|
-
| `setDone` | `Marker` or `
|
|
154
|
-
| `setError` | `Marker` or `
|
|
155
|
-
| `setConflicted` | `Marker` or `
|
|
156
|
-
| `clearConflicted` | `Marker` or `
|
|
157
|
-
| `clearReview` | `Marker` or `
|
|
145
|
+
| Key | Type | Purpose |
|
|
146
|
+
| ----------------- | ---------------------- | ------------------------------------------------------------------------------- |
|
|
147
|
+
| `getTodo` | `{filter: Marker[]}` | Issues to pick up (fresh) |
|
|
148
|
+
| `getInProgress` | `{filter: Marker[]}` | Issues to resume after restart |
|
|
149
|
+
| `getConflicted` | `{filter: Marker[]}` | Issues whose PR is conflicted (re-fix run) |
|
|
150
|
+
| `getReview` | `{filter: Marker[]}` | Done issues flagged for review follow-up |
|
|
151
|
+
| `getAutoMerge` | `{filter: Marker[]}` | Issues whose PR should be auto-merged once required checks pass |
|
|
152
|
+
| `setInProgress` | `Marker` or `Marker[]` | Applied when a worker spawns (any non-resume mode) |
|
|
153
|
+
| `setDone` | `Marker` or `Marker[]` | Applied on clean exit |
|
|
154
|
+
| `setError` | `Marker` or `Marker[]` | Applied on non-zero exit (quarantine signal — issue is _not_ auto-resumed) |
|
|
155
|
+
| `setConflicted` | `Marker` or `Marker[]` | Applied when a done-PR is detected as conflicted |
|
|
156
|
+
| `clearConflicted` | `Marker` or `Marker[]` | Label(s) removed when a conflict-fix succeeds (status removal is not supported) |
|
|
157
|
+
| `clearReview` | `Marker` or `Marker[]` | Label(s) removed when a review pickup happens (status removal is not supported) |
|
|
158
158
|
|
|
159
159
|
A `Marker` is one of three types:
|
|
160
160
|
|
|
@@ -164,7 +164,7 @@ A `Marker` is one of three types:
|
|
|
164
164
|
| `"status"` | `"In Progress"` | Updates the Linear workflow status of the issue |
|
|
165
165
|
| `"attachment"` | `"In Progress"` | Upserts a single **Ralphy** attachment on the issue; `value` becomes the subtitle. The same entry is reused across every lifecycle transition — Ralph creates it on first apply and edits it on subsequent ones, so the issue stays tidy. |
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
Use an array when one event sets multiple — e.g. `setDone` flipping a status _and_ adding a label _and_ updating the attachment subtitle.
|
|
168
168
|
|
|
169
169
|
Example `ralphy.config.json`:
|
|
170
170
|
|
|
@@ -200,12 +200,10 @@ Example `ralphy.config.json`:
|
|
|
200
200
|
"filter": [{ "type": "label", "value": "ralph:auto-merge" }],
|
|
201
201
|
},
|
|
202
202
|
"setInProgress": { "type": "status", "value": "In Progress" },
|
|
203
|
-
"setDone":
|
|
204
|
-
"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
],
|
|
208
|
-
},
|
|
203
|
+
"setDone": [
|
|
204
|
+
{ "type": "status", "value": "In Review" },
|
|
205
|
+
{ "type": "label", "value": "ralphy-done" },
|
|
206
|
+
],
|
|
209
207
|
"setError": { "type": "label", "value": "ralph:error" },
|
|
210
208
|
"setConflicted": { "type": "label", "value": "ralph:conflicted" },
|
|
211
209
|
"clearConflicted": { "type": "label", "value": "ralph:conflicted" },
|
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.22.
|
|
35033
|
-
return "2.22.
|
|
35032
|
+
if ("2.22.1")
|
|
35033
|
+
return "2.22.1";
|
|
35034
35034
|
} catch {}
|
|
35035
35035
|
const dirsToTry = [];
|
|
35036
35036
|
try {
|
|
@@ -35095,13 +35095,7 @@ function mergeIndicator(bag, key, marker) {
|
|
|
35095
35095
|
bag[key] = { filter: filter2 };
|
|
35096
35096
|
} else {
|
|
35097
35097
|
const existing = bag[key];
|
|
35098
|
-
|
|
35099
|
-
if (!existing)
|
|
35100
|
-
next = marker;
|
|
35101
|
-
else if ("apply" in existing)
|
|
35102
|
-
next = { apply: [...existing.apply, marker] };
|
|
35103
|
-
else
|
|
35104
|
-
next = { apply: [existing, marker] };
|
|
35098
|
+
const next = existing ? [...Array.isArray(existing) ? existing : [existing], marker] : marker;
|
|
35105
35099
|
bag[key] = next;
|
|
35106
35100
|
}
|
|
35107
35101
|
}
|
|
@@ -39410,7 +39404,7 @@ var init_zod = __esm(() => {
|
|
|
39410
39404
|
|
|
39411
39405
|
// packages/types/src/types.ts
|
|
39412
39406
|
function markersOf(set2) {
|
|
39413
|
-
return
|
|
39407
|
+
return Array.isArray(set2) ? set2 : [set2];
|
|
39414
39408
|
}
|
|
39415
39409
|
var IterationUsageSchema, UsageSchema, HistoryEntrySchema, StateSchema, PhaseFrontmatterSchema;
|
|
39416
39410
|
var init_types2 = __esm(() => {
|
|
@@ -59538,8 +59532,26 @@ async function loadRalphyConfig(projectRoot) {
|
|
|
59538
59532
|
return RalphyConfigSchema.parse({});
|
|
59539
59533
|
}
|
|
59540
59534
|
const text = await file.text();
|
|
59541
|
-
|
|
59542
|
-
|
|
59535
|
+
let raw;
|
|
59536
|
+
try {
|
|
59537
|
+
raw = JSON.parse(stripJsonComments(text));
|
|
59538
|
+
} catch (error) {
|
|
59539
|
+
throw new Error(`ralphy.config.json is not valid JSON.
|
|
59540
|
+
` + ` File: ${path}
|
|
59541
|
+
` + ` ${error instanceof Error ? error.message : String(error)}
|
|
59542
|
+
|
|
59543
|
+
` + `Run \`ralph init\` to see the full default config with all available settings.`);
|
|
59544
|
+
}
|
|
59545
|
+
const result2 = RalphyConfigSchema.safeParse(raw);
|
|
59546
|
+
if (!result2.success) {
|
|
59547
|
+
const issues = result2.error.issues.map((issue) => ` \u2022 ${issue.path.join(".") || "(root)"}: ${issue.message}`).join(`
|
|
59548
|
+
`);
|
|
59549
|
+
throw new Error(`ralphy.config.json has invalid settings:
|
|
59550
|
+
${issues}
|
|
59551
|
+
|
|
59552
|
+
` + `Run \`ralph init\` to see the full default config with all available settings.`);
|
|
59553
|
+
}
|
|
59554
|
+
return result2.data;
|
|
59543
59555
|
}
|
|
59544
59556
|
async function ensureRalphyConfig(projectRoot) {
|
|
59545
59557
|
const path = join11(projectRoot, "ralphy.config.json");
|
|
@@ -59669,18 +59681,18 @@ var MarkerSchema, GetIndicatorSchema, SetIndicatorSchema, IndicatorsSchema, Ralp
|
|
|
59669
59681
|
// after opening the PR so the PR merges as soon as required checks pass.
|
|
59670
59682
|
// "getAutoMerge": { "filter": [{ "type": "label", "value": "ralph:auto-merge" }] },
|
|
59671
59683
|
|
|
59672
|
-
// Applied when Ralph picks up an issue.
|
|
59684
|
+
// Applied when Ralph picks up an issue. Single marker or array of markers.
|
|
59673
59685
|
// "setInProgress": { "type": "label", "value": "ralph:in-progress" },
|
|
59674
|
-
// \u2014 or use attachment type to stamp a single "Ralphy" entry on the issue:
|
|
59675
59686
|
// "setInProgress": { "type": "attachment", "value": "In Progress" },
|
|
59687
|
+
// "setInProgress": [{ "type": "status", "value": "In Progress" }, { "type": "attachment", "value": "In Progress" }],
|
|
59676
59688
|
|
|
59677
59689
|
// Applied on clean success.
|
|
59678
59690
|
// "setDone": { "type": "status", "value": "In Review" },
|
|
59679
|
-
// "setDone": { "type": "attachment", "value": "Done" },
|
|
59691
|
+
// "setDone": [{ "type": "status", "value": "In Review" }, { "type": "attachment", "value": "Done" }],
|
|
59680
59692
|
|
|
59681
59693
|
// Applied when the task exits with an error (quarantine signal).
|
|
59682
59694
|
// "setError": { "type": "label", "value": "ralph:error" },
|
|
59683
|
-
// "setError": { "type": "attachment", "value": "Error" },
|
|
59695
|
+
// "setError": [{ "type": "label", "value": "ralph:error" }, { "type": "attachment", "value": "Error" }],
|
|
59684
59696
|
|
|
59685
59697
|
// Applied when a PR merge conflict is detected.
|
|
59686
59698
|
// "setConflicted": { "type": "label", "value": "ralph:conflict" },
|
|
@@ -59703,10 +59715,7 @@ var init_config = __esm(() => {
|
|
|
59703
59715
|
GetIndicatorSchema = exports_external.object({
|
|
59704
59716
|
filter: exports_external.array(MarkerSchema).default([])
|
|
59705
59717
|
});
|
|
59706
|
-
SetIndicatorSchema = exports_external.union([
|
|
59707
|
-
MarkerSchema,
|
|
59708
|
-
exports_external.object({ apply: exports_external.array(MarkerSchema).min(1) })
|
|
59709
|
-
]);
|
|
59718
|
+
SetIndicatorSchema = exports_external.union([exports_external.array(MarkerSchema).min(1), MarkerSchema]);
|
|
59710
59719
|
IndicatorsSchema = exports_external.object({
|
|
59711
59720
|
getTodo: GetIndicatorSchema.optional(),
|
|
59712
59721
|
getInProgress: GetIndicatorSchema.optional(),
|
|
@@ -59724,7 +59733,7 @@ var init_config = __esm(() => {
|
|
|
59724
59733
|
const clear = value[key];
|
|
59725
59734
|
if (!clear)
|
|
59726
59735
|
continue;
|
|
59727
|
-
const markers =
|
|
59736
|
+
const markers = Array.isArray(clear) ? clear : [clear];
|
|
59728
59737
|
for (const m of markers) {
|
|
59729
59738
|
if (m.type !== "label") {
|
|
59730
59739
|
ctx.addIssue({
|
|
@@ -61483,7 +61492,7 @@ function buildAgentCoordinator(input) {
|
|
|
61483
61492
|
async function fetchByGet(inc, excl) {
|
|
61484
61493
|
if (!inc)
|
|
61485
61494
|
return [];
|
|
61486
|
-
const include = "filter" in inc ? inc.filter : [];
|
|
61495
|
+
const include = !Array.isArray(inc) && "filter" in inc ? inc.filter : [];
|
|
61487
61496
|
if (include.length === 0)
|
|
61488
61497
|
return [];
|
|
61489
61498
|
const spec = {
|