@kody-ade/kody-engine-lite 0.1.97 → 0.1.99

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
@@ -2486,24 +2486,34 @@ function executeShipStage(ctx, _def) {
2486
2486
  docs: "docs",
2487
2487
  chore: "chore"
2488
2488
  };
2489
+ let prefix = "chore";
2489
2490
  const taskJsonPath = path12.join(ctx.taskDir, "task.json");
2490
2491
  if (fs12.existsSync(taskJsonPath)) {
2491
2492
  try {
2492
2493
  const raw = fs12.readFileSync(taskJsonPath, "utf-8");
2493
2494
  const cleaned = raw.replace(/^```json\s*\n?/m, "").replace(/\n?```\s*$/m, "");
2494
2495
  const task = JSON.parse(cleaned);
2495
- const prefix = TYPE_PREFIX[task.task_type] ?? "chore";
2496
- const taskTitle = task.title ?? "Update";
2497
- title = `${prefix}: ${taskTitle}`.slice(0, 72);
2496
+ prefix = TYPE_PREFIX[task.task_type] ?? "chore";
2498
2497
  } catch {
2499
2498
  }
2500
2499
  }
2500
+ const taskMdPath = path12.join(ctx.taskDir, "task.md");
2501
+ if (fs12.existsSync(taskMdPath)) {
2502
+ const content = fs12.readFileSync(taskMdPath, "utf-8");
2503
+ const heading = content.split("\n").find((l) => l.startsWith("# "));
2504
+ if (heading) {
2505
+ title = `${prefix}: ${heading.replace(/^#\s*/, "").trim()}`.slice(0, 72);
2506
+ }
2507
+ }
2501
2508
  if (title === "Update") {
2502
- const taskMdPath = path12.join(ctx.taskDir, "task.md");
2503
- if (fs12.existsSync(taskMdPath)) {
2504
- const content = fs12.readFileSync(taskMdPath, "utf-8");
2505
- const firstLine = content.split("\n").find((l) => l.trim() && !l.startsWith("#") && !l.startsWith("*"));
2506
- if (firstLine) title = `chore: ${firstLine.trim()}`.slice(0, 72);
2509
+ if (fs12.existsSync(taskJsonPath)) {
2510
+ try {
2511
+ const raw = fs12.readFileSync(taskJsonPath, "utf-8");
2512
+ const cleaned = raw.replace(/^```json\s*\n?/m, "").replace(/\n?```\s*$/m, "");
2513
+ const task = JSON.parse(cleaned);
2514
+ if (task.title) title = `${prefix}: ${task.title}`.slice(0, 72);
2515
+ } catch {
2516
+ }
2507
2517
  }
2508
2518
  }
2509
2519
  const body = buildPrBody(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine-lite",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "description": "Autonomous SDLC pipeline: Kody orchestration + Claude Code + LiteLLM",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,6 +25,9 @@ on:
25
25
  issue_comment:
26
26
  types: [created]
27
27
 
28
+ pull_request:
29
+ types: [closed]
30
+
28
31
  pull_request_review:
29
32
  types: [submitted]
30
33
 
@@ -333,6 +336,45 @@ jobs:
333
336
  path: .kody/tasks/
334
337
  retention-days: 3
335
338
 
339
+ # ─── Close Issue on PR Merge ────────────────────────────────────────────────
340
+ close-issue-on-merge:
341
+ if: >-
342
+ github.event_name == 'pull_request' &&
343
+ github.event.pull_request.merged == true
344
+ runs-on: ubuntu-latest
345
+ steps:
346
+ - name: Close linked issue
347
+ uses: actions/github-script@v7
348
+ with:
349
+ script: |
350
+ // Extract issue number from branch name (e.g. "42--feature-name")
351
+ const branch = context.payload.pull_request.head.ref;
352
+ const match = branch.match(/^(\d+)--/);
353
+ if (!match) return;
354
+ const issueNumber = parseInt(match[1], 10);
355
+
356
+ // Verify the issue exists and is open
357
+ try {
358
+ const { data: issue } = await github.rest.issues.get({
359
+ owner: context.repo.owner,
360
+ repo: context.repo.repo,
361
+ issue_number: issueNumber,
362
+ });
363
+ if (issue.state === 'closed') return;
364
+ if (issue.pull_request) return; // Skip if it's a PR, not an issue
365
+
366
+ await github.rest.issues.update({
367
+ owner: context.repo.owner,
368
+ repo: context.repo.repo,
369
+ issue_number: issueNumber,
370
+ state: 'closed',
371
+ state_reason: 'completed',
372
+ });
373
+ core.info(`Closed issue #${issueNumber} after PR #${context.payload.pull_request.number} was merged`);
374
+ } catch (e) {
375
+ core.warning(`Could not close issue #${issueNumber}: ${e.message}`);
376
+ }
377
+
336
378
  # ─── Error Notifications ─────────────────────────────────────────────────────
337
379
  notify-parse-error:
338
380
  if: >-