@kody-ade/kody-engine-lite 0.1.10 → 0.1.11
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/bin/cli.js +26 -5
- package/package.json +1 -1
- package/templates/kody.yml +9 -7
package/dist/bin/cli.js
CHANGED
|
@@ -1154,12 +1154,33 @@ function executeShipStage(ctx, _def) {
|
|
|
1154
1154
|
} catch {
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
|
-
const taskMdPath = path4.join(ctx.taskDir, "task.md");
|
|
1158
1157
|
let title = "Update";
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1158
|
+
const TYPE_PREFIX = {
|
|
1159
|
+
feature: "feat",
|
|
1160
|
+
bugfix: "fix",
|
|
1161
|
+
refactor: "refactor",
|
|
1162
|
+
docs: "docs",
|
|
1163
|
+
chore: "chore"
|
|
1164
|
+
};
|
|
1165
|
+
const taskJsonPath = path4.join(ctx.taskDir, "task.json");
|
|
1166
|
+
if (fs4.existsSync(taskJsonPath)) {
|
|
1167
|
+
try {
|
|
1168
|
+
const raw = fs4.readFileSync(taskJsonPath, "utf-8");
|
|
1169
|
+
const cleaned = raw.replace(/^```json\s*\n?/m, "").replace(/\n?```\s*$/m, "");
|
|
1170
|
+
const task = JSON.parse(cleaned);
|
|
1171
|
+
const prefix = TYPE_PREFIX[task.task_type] ?? "chore";
|
|
1172
|
+
const taskTitle = task.title ?? "Update";
|
|
1173
|
+
title = `${prefix}: ${taskTitle}`.slice(0, 72);
|
|
1174
|
+
} catch {
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
if (title === "Update") {
|
|
1178
|
+
const taskMdPath = path4.join(ctx.taskDir, "task.md");
|
|
1179
|
+
if (fs4.existsSync(taskMdPath)) {
|
|
1180
|
+
const content = fs4.readFileSync(taskMdPath, "utf-8");
|
|
1181
|
+
const firstLine = content.split("\n").find((l) => l.trim() && !l.startsWith("#") && !l.startsWith("*"));
|
|
1182
|
+
if (firstLine) title = `chore: ${firstLine.trim()}`.slice(0, 72);
|
|
1183
|
+
}
|
|
1163
1184
|
}
|
|
1164
1185
|
const body = buildPrBody(ctx);
|
|
1165
1186
|
const pr = createPR(head, base, title, body);
|
package/package.json
CHANGED
package/templates/kody.yml
CHANGED
|
@@ -113,19 +113,20 @@ jobs:
|
|
|
113
113
|
;;
|
|
114
114
|
esac
|
|
115
115
|
|
|
116
|
-
# Auto-generate task-id if not provided
|
|
117
116
|
ISSUE_NUM="${{ github.event.issue.number }}"
|
|
118
|
-
if [ -z "$TASK_ID" ]; then
|
|
119
|
-
TASK_ID="${ISSUE_NUM}-$(date +%y%m%d-%H%M%S)"
|
|
120
|
-
fi
|
|
121
117
|
|
|
122
118
|
# For approve mode: extract answer body and convert to rerun
|
|
119
|
+
# Must run BEFORE task-id generation so we don't create a new task
|
|
123
120
|
if [ "$MODE" = "approve" ]; then
|
|
124
|
-
# Everything after @kody approve [task-id] is the feedback
|
|
125
121
|
APPROVE_BODY=$(echo "$BODY" | sed -n '/\(@kody\|\/kody\)\s*approve/,$p' | tail -n +2)
|
|
126
122
|
FEEDBACK="$APPROVE_BODY"
|
|
127
123
|
MODE="rerun"
|
|
128
|
-
#
|
|
124
|
+
# Leave TASK_ID empty — entry.ts findLatestTaskForIssue will find the paused task
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
# Auto-generate task-id if not provided (only for non-rerun modes)
|
|
128
|
+
if [ -z "$TASK_ID" ] && [ "$MODE" != "rerun" ]; then
|
|
129
|
+
TASK_ID="${ISSUE_NUM}-$(date +%y%m%d-%H%M%S)"
|
|
129
130
|
fi
|
|
130
131
|
|
|
131
132
|
echo "task_id=$TASK_ID" >> $GITHUB_OUTPUT
|
|
@@ -200,7 +201,8 @@ jobs:
|
|
|
200
201
|
CMD="run"
|
|
201
202
|
[ "$MODE" = "rerun" ] && CMD="rerun"
|
|
202
203
|
[ "$MODE" = "fix" ] && CMD="fix"
|
|
203
|
-
ARGS="--
|
|
204
|
+
ARGS="--issue-number $ISSUE_NUMBER"
|
|
205
|
+
[ -n "$TASK_ID" ] && ARGS="$ARGS --task-id $TASK_ID"
|
|
204
206
|
[ -n "$FROM_STAGE" ] && ARGS="$ARGS --from $FROM_STAGE"
|
|
205
207
|
[ -n "$FEEDBACK" ] && ARGS="$ARGS --feedback \"$FEEDBACK\""
|
|
206
208
|
[ "$DRY_RUN" = "true" ] && ARGS="$ARGS --dry-run"
|