@kody-ade/kody-engine-lite 0.1.9 → 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 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
- if (fs4.existsSync(taskMdPath)) {
1160
- const content = fs4.readFileSync(taskMdPath, "utf-8");
1161
- const lines = content.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
1162
- title = (lines[0] ?? "Update").slice(0, 72);
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);
@@ -1840,6 +1861,12 @@ Artifacts in ${taskDir}:`);
1840
1861
  console.log(` ${f}`);
1841
1862
  }
1842
1863
  if (state.state === "failed") {
1864
+ const isPaused = Object.values(state.stages).some(
1865
+ (s) => typeof s === "object" && s !== null && "error" in s && typeof s.error === "string" && s.error.includes("paused")
1866
+ );
1867
+ if (isPaused) {
1868
+ process.exit(0);
1869
+ }
1843
1870
  if (ctx.input.issueNumber && !ctx.input.local) {
1844
1871
  const failedStage = Object.entries(state.stages).find(
1845
1872
  ([, s]) => s.state === "failed" || s.state === "timeout"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine-lite",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Autonomous SDLC pipeline: Kody orchestration + Claude Code + LiteLLM",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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
- # FROM_STAGE will be determined by entry.ts from paused state
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="--task-id $TASK_ID --issue-number $ISSUE_NUMBER"
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"