@kody-ade/kody-engine 0.3.25 → 0.3.26
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.26",
|
|
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",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
#
|
|
3
|
-
# release-deploy:
|
|
4
|
-
# branch (main)
|
|
5
|
-
#
|
|
3
|
+
# release-deploy: open a PR from the integration branch (dev) into the
|
|
4
|
+
# default branch (main) — the human gate for production deploy. The
|
|
5
|
+
# orchestrator's chain ENDS with this PR opened; merging it is a manual
|
|
6
|
+
# step. No agent.
|
|
6
7
|
#
|
|
7
8
|
# Behavior:
|
|
8
9
|
# - If release.devBranch is unset OR equals git.defaultBranch:
|
|
9
|
-
# no-op success (single-branch repos have nothing to
|
|
10
|
-
# - Else:
|
|
11
|
-
#
|
|
12
|
-
# have), fall back to `git merge --no-ff` so history is preserved.
|
|
10
|
+
# no-op success (single-branch repos have nothing to deploy).
|
|
11
|
+
# - Else: idempotently open PR `devBranch` → `defaultBranch`. If an
|
|
12
|
+
# open PR already exists for that pair, reuse its URL.
|
|
13
13
|
#
|
|
14
|
-
# After the
|
|
15
|
-
# post-deploy hook.
|
|
14
|
+
# After the PR is opened, runs `release.notifyCommand` (if set) as a
|
|
15
|
+
# best-effort post-deploy hook.
|
|
16
16
|
#
|
|
17
17
|
# Inputs (env):
|
|
18
18
|
# KODY_ARG_DRY_RUN true|false
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
# KODY_CFG_RELEASE_TIMEOUTMS per-command timeout in ms (default 600000)
|
|
26
26
|
#
|
|
27
27
|
# Stdout signals:
|
|
28
|
+
# KODY_PR_URL=<deploy PR url>
|
|
28
29
|
# KODY_REASON=<text>
|
|
29
30
|
# KODY_SKIP_AGENT=true
|
|
30
31
|
|
|
@@ -44,49 +45,50 @@ read_pkg_version() {
|
|
|
44
45
|
version=$(read_pkg_version)
|
|
45
46
|
echo "→ release deploy: v${version}"
|
|
46
47
|
|
|
47
|
-
# Single-branch repos: nothing to
|
|
48
|
+
# Single-branch repos: nothing to deploy.
|
|
48
49
|
if [[ -z "$dev_branch" || "$dev_branch" == "$default_branch" ]]; then
|
|
49
|
-
echo "KODY_REASON=no devBranch configured (or equals defaultBranch) — nothing to
|
|
50
|
+
echo "KODY_REASON=no devBranch configured (or equals defaultBranch) — nothing to deploy"
|
|
50
51
|
echo "KODY_SKIP_AGENT=true"
|
|
51
52
|
exit 0
|
|
52
53
|
fi
|
|
53
54
|
|
|
54
55
|
if [[ "$dry_run" == "true" ]]; then
|
|
55
|
-
echo "KODY_REASON=dry-run — would
|
|
56
|
+
echo "KODY_REASON=dry-run — would open PR ${dev_branch} → ${default_branch}"
|
|
56
57
|
echo "KODY_SKIP_AGENT=true"
|
|
57
58
|
exit 0
|
|
58
59
|
fi
|
|
59
60
|
|
|
60
61
|
export HUSKY=0 SKIP_HOOKS=1 CI="${CI:-1}"
|
|
61
62
|
|
|
62
|
-
#
|
|
63
|
-
|
|
63
|
+
# Idempotency: reuse an open PR for this branch pair if one exists.
|
|
64
|
+
existing=$(gh pr list --head "$dev_branch" --base "$default_branch" --state open --json url --limit 1 2>/dev/null \
|
|
65
|
+
| python3 -c 'import json,sys; data=json.load(sys.stdin); print(data[0]["url"] if data else "")' 2>/dev/null \
|
|
66
|
+
|| echo "")
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
# Try fast-forward first; fall back to a merge commit.
|
|
70
|
-
if git merge --ff-only "origin/$dev_branch" 2>/dev/null; then
|
|
71
|
-
echo " fast-forwarded ${default_branch} to origin/${dev_branch}"
|
|
68
|
+
if [[ -n "$existing" ]]; then
|
|
69
|
+
echo " reusing existing deploy PR: ${existing}"
|
|
70
|
+
pr_url="$existing"
|
|
72
71
|
else
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
body="Automated deploy PR opened by kody — promotes \`${dev_branch}\` to \`${default_branch}\` for release **v${version}**.
|
|
73
|
+
|
|
74
|
+
Merge this PR to deploy v${version} to \`${default_branch}\`."
|
|
75
|
+
if ! pr_url=$(printf '%s' "$body" | gh pr create --head "$dev_branch" --base "$default_branch" --title "deploy: ${dev_branch} → ${default_branch} (v${version})" --body-file -); then
|
|
76
|
+
echo "KODY_REASON=release deploy: gh pr create failed"
|
|
76
77
|
echo "KODY_SKIP_AGENT=true"
|
|
77
78
|
exit 1
|
|
78
79
|
fi
|
|
79
80
|
fi
|
|
80
81
|
|
|
81
|
-
if
|
|
82
|
-
echo "KODY_REASON=release deploy:
|
|
82
|
+
if [[ -z "$pr_url" ]]; then
|
|
83
|
+
echo "KODY_REASON=release deploy: empty PR URL after gh pr create"
|
|
83
84
|
echo "KODY_SKIP_AGENT=true"
|
|
84
85
|
exit 1
|
|
85
86
|
fi
|
|
86
87
|
|
|
87
|
-
echo "
|
|
88
|
+
echo "RELEASE_DEPLOY_PR=${pr_url}"
|
|
89
|
+
echo "KODY_PR_URL=${pr_url}"
|
|
88
90
|
|
|
89
|
-
# Optional post-deploy notification.
|
|
91
|
+
# Optional post-deploy notification (e.g. Slack ping that a deploy PR is up).
|
|
90
92
|
notify_status="skipped"
|
|
91
93
|
if [[ -n "$notify_cmd" ]]; then
|
|
92
94
|
cmd="${notify_cmd//\$VERSION/$version}"
|
|
@@ -99,5 +101,5 @@ if [[ -n "$notify_cmd" ]]; then
|
|
|
99
101
|
fi
|
|
100
102
|
fi
|
|
101
103
|
|
|
102
|
-
echo "KODY_REASON=
|
|
104
|
+
echo "KODY_REASON=opened deploy PR ${dev_branch} → ${default_branch} (notify=${notify_status})"
|
|
103
105
|
echo "KODY_SKIP_AGENT=true"
|
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.26",
|
|
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",
|