@kody-ade/kody-engine-lite 0.1.5 → 0.1.6

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
@@ -1534,8 +1534,17 @@ var init_entry = __esm({
1534
1534
  init_github_api();
1535
1535
  init_logger();
1536
1536
  isCI2 = !!process.env.GITHUB_ACTIONS;
1537
- main().catch((err) => {
1538
- console.error(err instanceof Error ? err.message : err);
1537
+ main().catch(async (err) => {
1538
+ const msg = err instanceof Error ? err.message : String(err);
1539
+ console.error(msg);
1540
+ const issueStr = process.argv.find((_, i, a) => a[i - 1] === "--issue-number") ?? process.env.ISSUE_NUMBER;
1541
+ const isLocal = process.argv.includes("--local") || !process.env.GITHUB_ACTIONS;
1542
+ if (issueStr && !isLocal) {
1543
+ try {
1544
+ postComment(parseInt(issueStr, 10), `\u274C Pipeline crashed: ${msg.slice(0, 200)}`);
1545
+ } catch {
1546
+ }
1547
+ }
1539
1548
  process.exit(1);
1540
1549
  });
1541
1550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine-lite",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Autonomous SDLC pipeline: Kody orchestration + Claude Code + LiteLLM",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,6 +28,10 @@ on:
28
28
  pull_request_review:
29
29
  types: [submitted]
30
30
 
31
+ push:
32
+ branches: [main, dev]
33
+ paths: ["src/**", "kody.config.json", "package.json"]
34
+
31
35
  concurrency:
32
36
  group: kody-${{ github.event.inputs.task_id || github.event.issue.number || github.event.pull_request.number || github.sha }}
33
37
  cancel-in-progress: false
@@ -120,10 +124,20 @@ jobs:
120
124
  runs-on: ubuntu-latest
121
125
  timeout-minutes: 120
122
126
  steps:
127
+ - name: Generate App token
128
+ id: app-token
129
+ if: vars.KODY_APP_ID != ''
130
+ uses: actions/create-github-app-token@v1
131
+ with:
132
+ app-id: ${{ vars.KODY_APP_ID }}
133
+ private-key: ${{ secrets.APP_PRIVATE_KEY }}
134
+ repositories: ${{ github.event.repository.name }}
135
+
123
136
  - uses: actions/checkout@v4
124
137
  with:
125
138
  fetch-depth: 0
126
139
  persist-credentials: true
140
+ token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
127
141
 
128
142
  - uses: pnpm/action-setup@v4
129
143
  with:
@@ -149,24 +163,42 @@ jobs:
149
163
  - name: Run Kody pipeline
150
164
  env:
151
165
  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
152
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166
+ GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
153
167
  TASK_ID: ${{ github.event.inputs.task_id || needs.parse.outputs.task_id }}
154
168
  MODE: ${{ github.event.inputs.mode || needs.parse.outputs.mode || 'full' }}
155
169
  FROM_STAGE: ${{ github.event.inputs.from_stage || needs.parse.outputs.from_stage }}
156
170
  ISSUE_NUMBER: ${{ github.event.inputs.issue_number || needs.parse.outputs.issue_number }}
157
171
  FEEDBACK: ${{ github.event.inputs.feedback || needs.parse.outputs.feedback }}
158
172
  DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
173
+ RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
159
174
  run: kody-engine-lite run --task-id "$TASK_ID" --issue-number "$ISSUE_NUMBER"
160
175
 
161
176
  - name: Pipeline summary
162
177
  if: always()
163
178
  run: |
164
179
  TASK_ID="${{ github.event.inputs.task_id || needs.parse.outputs.task_id }}"
165
- if [ -f ".tasks/${TASK_ID}/status.json" ]; then
166
- echo "## Pipeline Status" >> $GITHUB_STEP_SUMMARY
167
- echo '```json' >> $GITHUB_STEP_SUMMARY
168
- cat ".tasks/${TASK_ID}/status.json" >> $GITHUB_STEP_SUMMARY
169
- echo '```' >> $GITHUB_STEP_SUMMARY
180
+ STATUS_FILE=".tasks/${TASK_ID}/status.json"
181
+ if [ -f "$STATUS_FILE" ]; then
182
+ STATE=$(jq -r '.state' "$STATUS_FILE")
183
+ ICON=""
184
+ [ "$STATE" = "completed" ] && ICON="✅"
185
+ echo "## ${ICON} Kody Pipeline: \`${TASK_ID}\`" >> $GITHUB_STEP_SUMMARY
186
+ echo "" >> $GITHUB_STEP_SUMMARY
187
+ echo "**Status:** ${STATE}" >> $GITHUB_STEP_SUMMARY
188
+ echo "" >> $GITHUB_STEP_SUMMARY
189
+ echo "| Stage | State |" >> $GITHUB_STEP_SUMMARY
190
+ echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
191
+ for stage in taskify plan build verify review review-fix ship; do
192
+ SSTATE=$(jq -r ".stages[\"$stage\"].state // \"—\"" "$STATUS_FILE")
193
+ case "$SSTATE" in
194
+ completed) SICON="✅" ;;
195
+ failed) SICON="❌" ;;
196
+ timeout) SICON="⏱" ;;
197
+ running) SICON="▶️" ;;
198
+ *) SICON="○" ;;
199
+ esac
200
+ echo "| ${stage} | ${SICON} ${SSTATE} |" >> $GITHUB_STEP_SUMMARY
201
+ done
170
202
  fi
171
203
 
172
204
  - name: Upload artifacts
@@ -213,3 +245,35 @@ jobs:
213
245
  body: `❌ Pipeline failed. [View logs](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`
214
246
  });
215
247
  }
248
+
249
+ # ─── Smoke Test (push trigger) ──────────────────────────────────────────────
250
+ smoke-test:
251
+ if: github.event_name == 'push'
252
+ runs-on: ubuntu-latest
253
+ timeout-minutes: 10
254
+ steps:
255
+ - uses: actions/checkout@v4
256
+ - uses: pnpm/action-setup@v4
257
+ with:
258
+ version: latest
259
+ - uses: actions/setup-node@v4
260
+ with:
261
+ node-version: 22
262
+ cache: pnpm
263
+ - run: pnpm install --frozen-lockfile
264
+ - name: Install Kody Engine
265
+ run: npm install -g @kody-ade/kody-engine-lite
266
+ - name: Typecheck
267
+ run: pnpm tsc --noEmit
268
+ - name: CLI loads
269
+ run: kody-engine-lite --help
270
+ - name: Dry run
271
+ run: |
272
+ mkdir -p .tasks/smoke-test
273
+ echo "Smoke test task" > .tasks/smoke-test/task.md
274
+ kody-engine-lite run --task-id smoke-test --dry-run || true
275
+ if [ -f ".tasks/smoke-test/status.json" ]; then
276
+ echo "✓ status.json created"
277
+ cat .tasks/smoke-test/status.json
278
+ fi
279
+ rm -rf .tasks/smoke-test