@kody-ade/kody-engine 0.3.18 → 0.3.19

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/kody.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@kody-ade/kody-engine",
6
- version: "0.3.18",
6
+ version: "0.3.19",
7
7
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -680,8 +680,26 @@ function autoDispatch(opts) {
680
680
  if (eventName === "schedule") {
681
681
  return { executable: "mission-scheduler", cliArgs: {}, target: 0 };
682
682
  }
683
+ if (eventName === "pull_request") {
684
+ const merged = event.pull_request?.merged === true;
685
+ const headRef = String(event.pull_request?.head?.ref ?? "");
686
+ const prNumber = Number(event.pull_request?.number ?? 0);
687
+ if (merged && /^release\/v\d+\.\d+\.\d+/.test(headRef) && prNumber > 0) {
688
+ return {
689
+ executable: "release",
690
+ cliArgs: { mode: "finalize", issue: prNumber },
691
+ target: prNumber
692
+ };
693
+ }
694
+ return null;
695
+ }
683
696
  if (eventName !== "issue_comment") return null;
684
- const body = String(event.comment?.body ?? "").toLowerCase();
697
+ const rawBody = String(event.comment?.body ?? "");
698
+ const authorLogin = String(event.comment?.user?.login ?? "");
699
+ const authorType = String(event.comment?.user?.type ?? "");
700
+ if (!rawBody.toLowerCase().includes("@kody")) return null;
701
+ if (authorLogin === "kody-bot" || authorType === "Bot") return null;
702
+ const body = rawBody.toLowerCase();
685
703
  const targetNum = Number(event.issue?.number ?? 0);
686
704
  const isPr = !!event.issue?.pull_request;
687
705
  if (!targetNum) return null;
@@ -6105,6 +6123,11 @@ async function runCi(argv) {
6105
6123
  } catch {
6106
6124
  }
6107
6125
  const autoFallback = !args.issueNumber ? autoDispatch({ config: earlyConfig }) : null;
6126
+ if (!args.issueNumber && !autoFallback && process.env.GITHUB_EVENT_NAME) {
6127
+ process.stdout.write(`\u2192 kody: no action for event ${process.env.GITHUB_EVENT_NAME} \u2014 exiting cleanly
6128
+ `);
6129
+ return 0;
6130
+ }
6108
6131
  if (!args.issueNumber && !autoFallback) {
6109
6132
  } else {
6110
6133
  args.errors = args.errors.filter((e) => !e.includes("--issue"));
@@ -6367,7 +6390,11 @@ Exit codes:
6367
6390
  `;
6368
6391
  function parseArgs(argv) {
6369
6392
  const result = { command: "help", errors: [] };
6370
- if (argv.length === 0) return result;
6393
+ if (argv.length === 0) {
6394
+ if (process.env.SESSION_ID) return { ...result, command: "chat", chatArgv: [] };
6395
+ if (process.env.GITHUB_EVENT_NAME) return { ...result, command: "ci", ciArgv: [] };
6396
+ return result;
6397
+ }
6371
6398
  const cmd = argv[0];
6372
6399
  if (cmd === "help" || cmd === "--help" || cmd === "-h") return { ...result, command: "help" };
6373
6400
  if (cmd === "version" || cmd === "--version" || cmd === "-v") return { ...result, command: "version" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,13 +1,9 @@
1
1
  # Drop this file at .github/workflows/kody.yml in your repo.
2
2
  #
3
- # Two triggers, two modes:
4
- # - issue_comment / workflow_dispatch with issue_number `kody ci`
5
- # (the @kody issue/PR automation flow)
6
- # - workflow_dispatch with sessionId → `kody chat`
7
- # (dashboard-driven Gemini chat session)
8
- #
9
- # All orchestration lives in the kody npm package; future capabilities ship
10
- # via `npm publish`, not by editing this file.
3
+ # Triggers forward every relevant event to `kody`; the engine decides what
4
+ # (if anything) to do. The job runs `npx kody` — no shell branching, no
5
+ # routing logic in YAML. All orchestration lives in the kody npm package;
6
+ # future capabilities ship via `npm publish`, not by editing this file.
11
7
  #
12
8
  # Required repo secrets: at least one model provider key (e.g. MINIMAX_API_KEY,
13
9
  # ANTHROPIC_API_KEY). kody reads any *_API_KEY secret automatically via
@@ -49,15 +45,12 @@ on:
49
45
  default: ""
50
46
  issue_comment:
51
47
  types: [created]
48
+ pull_request:
49
+ types: [closed]
52
50
 
53
51
  jobs:
54
52
  run:
55
- if: >-
56
- ${{ github.event_name == 'workflow_dispatch' ||
57
- (github.event_name == 'issue_comment' &&
58
- contains(github.event.comment.body, '@kody') &&
59
- github.event.comment.user.login != 'kody-bot' &&
60
- github.event.comment.user.type != 'Bot') }}
53
+ if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged == true }}
61
54
  runs-on: ubuntu-latest
62
55
  timeout-minutes: 360
63
56
  concurrency:
@@ -71,6 +64,7 @@ jobs:
71
64
  - uses: actions/checkout@v4
72
65
  with:
73
66
  fetch-depth: 0
67
+ ref: ${{ github.event.pull_request.base.ref || github.ref }}
74
68
  token: ${{ secrets.KODY_TOKEN || github.token }}
75
69
 
76
70
  - uses: actions/setup-node@v4
@@ -92,9 +86,4 @@ jobs:
92
86
  INIT_MESSAGE: ${{ inputs.message }}
93
87
  MODEL: ${{ inputs.model }}
94
88
  DASHBOARD_URL: ${{ inputs.dashboardUrl }}
95
- run: |
96
- if [ -n "$SESSION_ID" ]; then
97
- npx -y -p @kody-ade/kody-engine@latest kody chat
98
- else
99
- npx -y -p @kody-ade/kody-engine@latest kody ci
100
- fi
89
+ run: npx -y -p @kody-ade/kody-engine@latest kody