gnhf 0.1.14 → 0.1.15
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.mjs +16 -5
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -433,6 +433,17 @@ function getLastIterationNumber(runInfo) {
|
|
|
433
433
|
}
|
|
434
434
|
return max;
|
|
435
435
|
}
|
|
436
|
+
function toStringArray(value) {
|
|
437
|
+
if (Array.isArray(value)) return value.filter((v) => typeof v === "string");
|
|
438
|
+
if (typeof value === "string") {
|
|
439
|
+
try {
|
|
440
|
+
const parsed = JSON.parse(value);
|
|
441
|
+
if (Array.isArray(parsed)) return parsed.filter((v) => typeof v === "string");
|
|
442
|
+
} catch {}
|
|
443
|
+
return [value];
|
|
444
|
+
}
|
|
445
|
+
return [];
|
|
446
|
+
}
|
|
436
447
|
function formatListSection(title, items) {
|
|
437
448
|
if (items.length === 0) return "";
|
|
438
449
|
return `**${title}:**\n${items.map((item) => `- ${item}`).join("\n")}\n`;
|
|
@@ -2884,7 +2895,7 @@ var Orchestrator = class extends EventEmitter {
|
|
|
2884
2895
|
}
|
|
2885
2896
|
}
|
|
2886
2897
|
recordSuccess(output) {
|
|
2887
|
-
appendNotes(this.runInfo.notesPath, this.state.currentIteration, output.summary, output.key_changes_made, output.key_learnings);
|
|
2898
|
+
appendNotes(this.runInfo.notesPath, this.state.currentIteration, output.summary, toStringArray(output.key_changes_made), toStringArray(output.key_learnings));
|
|
2888
2899
|
commitAll(`gnhf #${this.state.currentIteration}: ${output.summary}`, this.cwd);
|
|
2889
2900
|
this.state.commitCount = getBranchCommitCount(this.runInfo.baseCommit, this.cwd);
|
|
2890
2901
|
this.state.successCount++;
|
|
@@ -2893,13 +2904,13 @@ var Orchestrator = class extends EventEmitter {
|
|
|
2893
2904
|
number: this.state.currentIteration,
|
|
2894
2905
|
success: true,
|
|
2895
2906
|
summary: output.summary,
|
|
2896
|
-
keyChanges: output.key_changes_made,
|
|
2897
|
-
keyLearnings: output.key_learnings,
|
|
2907
|
+
keyChanges: toStringArray(output.key_changes_made),
|
|
2908
|
+
keyLearnings: toStringArray(output.key_learnings),
|
|
2898
2909
|
timestamp: /* @__PURE__ */ new Date()
|
|
2899
2910
|
};
|
|
2900
2911
|
}
|
|
2901
2912
|
recordFailure(notesSummary, recordSummary, learnings) {
|
|
2902
|
-
appendNotes(this.runInfo.notesPath, this.state.currentIteration, notesSummary, [], learnings);
|
|
2913
|
+
appendNotes(this.runInfo.notesPath, this.state.currentIteration, notesSummary, [], toStringArray(learnings));
|
|
2903
2914
|
resetHard(this.cwd);
|
|
2904
2915
|
this.state.failCount++;
|
|
2905
2916
|
this.state.consecutiveFailures++;
|
|
@@ -2908,7 +2919,7 @@ var Orchestrator = class extends EventEmitter {
|
|
|
2908
2919
|
success: false,
|
|
2909
2920
|
summary: recordSummary,
|
|
2910
2921
|
keyChanges: [],
|
|
2911
|
-
keyLearnings: learnings,
|
|
2922
|
+
keyLearnings: toStringArray(learnings),
|
|
2912
2923
|
timestamp: /* @__PURE__ */ new Date()
|
|
2913
2924
|
};
|
|
2914
2925
|
}
|