@kody-ade/kody-engine 0.3.17 → 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.
|
|
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
|
|
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)
|
|
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" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "mission-scheduler",
|
|
3
3
|
"role": "watch",
|
|
4
|
-
"describe": "Scheduled: for every open issue labeled kody:
|
|
4
|
+
"describe": "Scheduled: for every open issue labeled kody:mission, invoke mission-tick once. No agent on the scheduler itself.",
|
|
5
5
|
"kind": "scheduled",
|
|
6
6
|
"schedule": "*/5 * * * *",
|
|
7
7
|
"inputs": [],
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"preflight": [
|
|
38
38
|
{
|
|
39
|
-
"script": "
|
|
39
|
+
"script": "dispatchMissionTicks",
|
|
40
40
|
"with": {
|
|
41
|
-
"label": "kody:
|
|
41
|
+
"label": "kody:mission",
|
|
42
42
|
"color": "1d76db",
|
|
43
|
-
"description": "kody: issue is a
|
|
44
|
-
"targetExecutable": "
|
|
43
|
+
"description": "kody: issue is a mission — scheduler ticks it every cron wake",
|
|
44
|
+
"targetExecutable": "mission-tick",
|
|
45
45
|
"issueArg": "issue"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "mission-tick",
|
|
3
3
|
"role": "primitive",
|
|
4
|
-
"describe": "One classifier tick for one
|
|
4
|
+
"describe": "One classifier tick for one mission issue: read intent + state, decide and execute via gh, emit next state.",
|
|
5
5
|
"kind": "oneshot",
|
|
6
6
|
"inputs": [
|
|
7
7
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"flag": "--issue",
|
|
10
10
|
"type": "int",
|
|
11
11
|
"required": true,
|
|
12
|
-
"describe": "GitHub issue number that owns this
|
|
12
|
+
"describe": "GitHub issue number that owns this mission."
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"claudeCode": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
{
|
|
46
46
|
"script": "loadIssueStateComment",
|
|
47
47
|
"with": {
|
|
48
|
-
"marker": "kody-
|
|
48
|
+
"marker": "kody-mission-state",
|
|
49
49
|
"issueArg": "issue"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
{
|
|
58
58
|
"script": "parseIssueStateFromAgentResult",
|
|
59
59
|
"with": {
|
|
60
|
-
"fenceLabel": "kody-
|
|
60
|
+
"fenceLabel": "kody-mission-next-state"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"script": "writeIssueStateComment",
|
|
65
65
|
"with": {
|
|
66
|
-
"marker": "kody-
|
|
66
|
+
"marker": "kody-mission-state",
|
|
67
67
|
"issueArg": "issue"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.3.
|
|
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",
|
package/templates/kody.yml
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Drop this file at .github/workflows/kody.yml in your repo.
|
|
2
2
|
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
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
|