@kody-ade/kody-engine 0.4.154 → 0.4.155

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
@@ -1061,7 +1061,7 @@ var init_loadPriorArt = __esm({
1061
1061
  // package.json
1062
1062
  var package_default = {
1063
1063
  name: "@kody-ade/kody-engine",
1064
- version: "0.4.154",
1064
+ version: "0.4.155",
1065
1065
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
1066
1066
  license: "MIT",
1067
1067
  type: "module",
@@ -56,44 +56,70 @@ tag="v${version}"
56
56
 
57
57
  echo "→ release publish: ${tag}"
58
58
 
59
- # Refuse if the tag already exists locally (left over from a prior failed run).
60
- if git rev-parse --verify "$tag" >/dev/null 2>&1; then
61
- fail "release publish: tag ${tag} already exists" 1
59
+ # Recovery is resume-not-overwrite: a release is three steps (push tag, run
60
+ # publishCommand, create GH release) and any of them may already be done from
61
+ # a prior partial run. We probe each step's state and perform only the missing
62
+ # parts. An already-fully-released version is therefore a no-op success, and we
63
+ # never re-point or force an existing tag (that would rewrite a shipped version).
64
+ tag_local=false
65
+ tag_remote=false
66
+ release_exists=false
67
+ if git rev-parse --verify "$tag" >/dev/null 2>&1; then tag_local=true; fi
68
+ if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null 2>&1; then tag_remote=true; fi
69
+ if gh release view "$tag" >/dev/null 2>&1; then release_exists=true; fi
70
+
71
+ if [[ "$tag_local" == "true" || "$tag_remote" == "true" || "$release_exists" == "true" ]]; then
72
+ echo " resuming: tag exists (local=${tag_local} remote=${tag_remote}), gh-release=${release_exists}"
62
73
  fi
63
74
 
64
75
  if [[ "$dry_run" == "true" ]]; then
65
- echo "KODY_REASON=dry-run — would tag + publish ${tag}"
76
+ echo "KODY_REASON=dry-run — would tag + publish ${tag} (tag_remote=${tag_remote}, gh-release=${release_exists})"
66
77
  echo "KODY_SKIP_AGENT=true"
67
78
  exit 0
68
79
  fi
69
80
 
70
- # Tag + push.
71
- git tag -a "$tag" -m "Release ${tag}"
72
- git push origin "$tag"
81
+ # Tag + push (skip whichever half already exists).
82
+ if [[ "$tag_local" == "false" && "$tag_remote" == "false" ]]; then
83
+ git tag -a "$tag" -m "Release ${tag}"
84
+ fi
85
+ if [[ "$tag_remote" == "false" ]]; then
86
+ git push origin "$tag"
87
+ fi
73
88
 
74
- # publishCommand (optional). Failure here is recorded but does not abort
75
- # we still want the GH release entry so the tag is discoverable.
89
+ # publishCommand (optional). A version that's already on the registry is the
90
+ # expected recovery case, not an error: treat "already published" as done.
91
+ # Any other non-zero is a real failure (recorded, but we still create the GH
92
+ # release so the tag is discoverable).
76
93
  publish_status="skipped"
77
94
  if [[ -n "$publish_cmd" ]]; then
78
95
  cmd="${publish_cmd//\$VERSION/$version}"
79
96
  echo " publish: ${cmd}"
80
- if timeout "${timeout_s}" bash -c "$cmd"; then
97
+ publish_out=""
98
+ if publish_out=$(timeout "${timeout_s}" bash -c "$cmd" 2>&1); then
81
99
  publish_status="ok"
100
+ elif echo "$publish_out" | grep -qiE "already exists|cannot publish over|previously published|403 Forbidden"; then
101
+ publish_status="already-published"
102
+ echo "[kody release-publish] version ${version} already on registry — treating as published"
82
103
  else
83
104
  publish_status="failed"
84
105
  echo "[kody release-publish] publishCommand failed (continuing to create GH release)" >&2
85
106
  fi
107
+ echo "$publish_out"
86
108
  fi
87
109
 
88
- # GitHub release.
110
+ # GitHub release (create only if missing).
89
111
  release_url=""
90
- draft_flag=""
91
- [[ "$draft" == "true" ]] && draft_flag="--draft"
92
- if release_url=$(gh release create "$tag" --title "$tag" --notes "Release ${tag} — automated by kody." $draft_flag 2>&1); then
93
- :
112
+ if [[ "$release_exists" == "true" ]]; then
113
+ release_url=$(gh release view "$tag" --json url --jq .url 2>/dev/null || echo "")
94
114
  else
95
- echo "[kody release-publish] gh release create failed: $release_url" >&2
96
- release_url=""
115
+ draft_flag=""
116
+ [[ "$draft" == "true" ]] && draft_flag="--draft"
117
+ if release_url=$(gh release create "$tag" --title "$tag" --notes "Release ${tag} — automated by kody." $draft_flag 2>&1); then
118
+ :
119
+ else
120
+ echo "[kody release-publish] gh release create failed: $release_url" >&2
121
+ release_url=""
122
+ fi
97
123
  fi
98
124
 
99
125
  echo "RELEASE_TAG=${tag}"
@@ -108,3 +134,4 @@ fi
108
134
  [[ -n "$release_url" ]] && echo "KODY_PR_URL=${release_url}"
109
135
  echo "KODY_REASON=tagged ${tag}, published${publish_status:+ ($publish_status)}"
110
136
  echo "KODY_SKIP_AGENT=true"
137
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.154",
3
+ "version": "0.4.155",
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",