openclacky 0.9.14 → 0.9.16

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1deed3c386ab1fc9beebff6dd48d50210ed8a3d6a1f3a79848dbf77030c78d90
4
- data.tar.gz: 188211af7374bd71c3542be5a7252aeef256f7860c47a100e2b5a2e657dfd029
3
+ metadata.gz: 5e4f19a4e5cd22ab1ecc81bfb9c62db1b458a9823699ce853d6094a24b4d3496
4
+ data.tar.gz: b0916deb0e5cce5d68f2454ddf35e267409869c19c26e7c203adfd8215aeabe4
5
5
  SHA512:
6
- metadata.gz: 74d9ee091703bb95838f64a214a4fb233bcb4764e428cd76e17a53add5c6c54ad21129499f4c83956b4692a04261fc5e43e39debd88883ab40eb6c13f46ad2ba
7
- data.tar.gz: c080f4e429ff68cba617cf539de1597be5be0c9014c1dca49d94892d7d469b1ebe190432eaa2f91a7ba78364e8a19baddd79db70b30bd283cb21721400cfbb39
6
+ metadata.gz: fe1aeaeac77dddfbb06bfc702c4d09adbffb338b0815481902b3490ab8610448f38ec0921b8e7a6885154b722a89528f911995bb473025339890554399611094
7
+ data.tar.gz: ca2505ac215e2cf9430b2b5c7e9629f581108daa6798d6a379e61e8446c199def9537813218b835304c3bf412d8df452767e78fff1a39a05b7d125c93ec0a8f3
@@ -91,24 +91,63 @@ To use this skill, simply say:
91
91
  git push origin main --tags
92
92
  ```
93
93
 
94
- 4. **Create GitHub Release**
94
+ 4. **Create GitHub Release and Upload gem**
95
95
 
96
- Extract the release notes for this version from CHANGELOG.md, then create a GitHub Release:
96
+ Extract the release notes for this version from CHANGELOG.md, then create a GitHub Release with the .gem file attached:
97
97
  ```bash
98
98
  gh release create v{version} \
99
99
  --title "v{version}" \
100
100
  --notes-file /tmp/release_notes.md \
101
- --latest
101
+ --latest \
102
+ openclacky-{version}.gem
102
103
  ```
103
104
 
104
105
  Steps:
105
106
  - Parse the CHANGELOG.md section for `[{version}]`
106
107
  - Write it to a temp file (e.g., `/tmp/release_notes_{version}.md`) to avoid shell escaping issues
107
- - Run `gh release create` with `--notes-file`
108
+ - Run `gh release create` with `--notes-file` **and the .gem file as an asset**
108
109
  - Verify the release appears at: `https://github.com/clacky-ai/openclacky/releases`
109
110
 
110
111
  > **Prerequisite**: `gh` CLI must be installed (`brew install gh`) and authenticated (`gh auth login`)
111
112
 
113
+ 5. **Sync to Tencent Cloud OSS (CN mirror)**
114
+
115
+ After GitHub Release is created, upload the .gem file and update `latest.txt` on OSS so Chinese users can install without hitting GitHub directly:
116
+
117
+ ```bash
118
+ # Upload .gem file
119
+ coscli cp openclacky-{version}.gem cos://clackyai-1258723534/openclacky/openclacky-{version}.gem
120
+
121
+ # Update latest.txt
122
+ echo "{version}" > /tmp/latest.txt
123
+ coscli cp /tmp/latest.txt cos://clackyai-1258723534/openclacky/latest.txt
124
+
125
+ # Verify
126
+ curl -fsSL https://oss.1024code.com/openclacky/latest.txt
127
+ ```
128
+
129
+ Expected output of verify: `{version}`
130
+
131
+ > **Prerequisite**: `coscli` installed at `/usr/local/bin/coscli` and configured at `~/.cos.yaml`
132
+
133
+ 6. **Sync scripts/ to OSS**
134
+
135
+ After updating latest.txt, sync all files in `scripts/` to OSS so users always get the latest install scripts:
136
+
137
+ ```bash
138
+ # Upload each script file to OSS
139
+ for script in scripts/*; do
140
+ coscli cp "$script" cos://clackyai-1258723534/clacky-ai/openclacky/main/scripts/$(basename "$script")
141
+ done
142
+
143
+ # Verify one of the key scripts
144
+ curl -fsSL https://oss.1024code.com/clacky-ai/openclacky/main/scripts/install.sh | head -5
145
+ ```
146
+
147
+ This ensures `scripts/install.sh`, `scripts/install_simple.sh`, `scripts/install.ps1`, `scripts/uninstall.sh` and any future scripts are all mirrored on OSS.
148
+
149
+ > **Prerequisite**: Same `coscli` setup as above
150
+
112
151
  5. **Verify Publication**
113
152
  - Check gem appears on RubyGems.org
114
153
  - Verify version information is correct
@@ -283,14 +322,27 @@ git tag vX.Y.Z
283
322
  git push origin main
284
323
  git push origin --tags
285
324
 
286
- # Create GitHub Release (requires gh CLI)
325
+ # Create GitHub Release with .gem asset (requires gh CLI)
287
326
  # 1. Extract release notes from CHANGELOG.md for this version
288
327
  # 2. Write to temp file to avoid shell escaping issues
289
- # 3. Create the release
328
+ # 3. Create the release and attach .gem file
290
329
  gh release create vX.Y.Z \
291
330
  --title "vX.Y.Z" \
292
331
  --notes-file /tmp/release_notes_X.Y.Z.md \
293
- --latest
332
+ --latest \
333
+ openclacky-X.Y.Z.gem
334
+
335
+ # Sync to Tencent Cloud OSS (CN mirror)
336
+ coscli cp openclacky-X.Y.Z.gem cos://clackyai-1258723534/openclacky/openclacky-X.Y.Z.gem
337
+ echo "X.Y.Z" > /tmp/latest.txt
338
+ coscli cp /tmp/latest.txt cos://clackyai-1258723534/openclacky/latest.txt
339
+ curl -fsSL https://oss.1024code.com/openclacky/latest.txt # verify
340
+
341
+ # Sync scripts/ to OSS
342
+ for script in scripts/*; do
343
+ coscli cp "$script" cos://clackyai-1258723534/clacky-ai/openclacky/main/scripts/$(basename "$script")
344
+ done
345
+ curl -fsSL https://oss.1024code.com/clacky-ai/openclacky/main/scripts/install.sh | head -5 # verify
294
346
  ```
295
347
 
296
348
  ## File Locations
@@ -308,7 +360,9 @@ gh release create vX.Y.Z \
308
360
  - New version successfully published to RubyGems
309
361
  - Git repository updated with version tag
310
362
  - CHANGELOG.md updated with release notes
311
- - GitHub Release created and visible at https://github.com/clacky-ai/openclacky/releases
363
+ - GitHub Release created with .gem file attached at https://github.com/clacky-ai/openclacky/releases
364
+ - .gem file uploaded to OSS: https://oss.1024code.com/openclacky/openclacky-{version}.gem
365
+ - latest.txt updated on OSS: https://oss.1024code.com/openclacky/latest.txt returns the new version
312
366
  - No build or deployment errors
313
367
  - User-facing release summary presented at the end
314
368
 
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.16] - 2026-03-27
11
+
12
+ ### Fixed
13
+ - **Skill templates now expand `${ENV_VAR}` placeholders**: skill SKILL.md files can reference environment variables like `${CLACKY_SERVER_HOST}` and `${CLACKY_SERVER_PORT}` — they are now automatically substituted at load time (unknown variables are left as-is)
14
+ - **gemrc restored to default when switching from CN to global network**: the install script now correctly restores the system gemrc when the user switches from China mirror mode to the global network, preventing stale mirror configuration from persisting
15
+
16
+ ## [0.9.15] - 2026-03-27
17
+
18
+ ### Improved
19
+ - **CN install now downloads gem from OSS mirror**: Chinese users no longer hit RubyGems.org or GitHub during installation — the install script fetches the `.gem` file directly from `oss.1024code.com` and installs dependencies via Aliyun mirror, making installs faster and more reliable in mainland China
20
+
10
21
  ## [0.9.14] - 2026-03-27
11
22
 
12
23
  ### Fixed
data/lib/clacky/skill.rb CHANGED
@@ -527,6 +527,11 @@ module Clacky
527
527
  # @param context [Hash]
528
528
  # @return [String]
529
529
  def expand_templates(content, context)
530
+ # Shell-style ${VAR} substitution from ENV — handles variables like
531
+ # ${CLACKY_SERVER_PORT}, ${CLACKY_SERVER_HOST} used in SKILL.md files.
532
+ # Unknown variables are left as-is (no substitution).
533
+ content = content.gsub(/\$\{([A-Z_][A-Z0-9_]*)\}/) { ENV[$1] || $& }
534
+
530
535
  return content if context.nil? || context.empty?
531
536
 
532
537
  # Build a lightweight binding that exposes each context key as a local method
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clacky
4
- VERSION = "0.9.14"
4
+ VERSION = "0.9.16"
5
5
  end
@@ -108,6 +108,8 @@ CN_CDN_BASE_URL="https://oss.1024code.com"
108
108
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
109
109
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
110
110
  CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
111
+ CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
112
+ CN_GEM_LATEST_URL="${CN_GEM_BASE_URL}/latest.txt"
111
113
 
112
114
  # Active values (overridden by detect_network_region)
113
115
  MISE_INSTALL_URL="$DEFAULT_MISE_INSTALL_URL"
@@ -275,18 +277,31 @@ check_ruby() {
275
277
  # Configure gem source (CN mirror if needed)
276
278
  # --------------------------------------------------------------------------
277
279
  configure_gem_source() {
278
- [ "$USE_CN_MIRRORS" = true ] || return 0
279
-
280
280
  local gemrc="$HOME/.gemrc"
281
- if [ -f "$gemrc" ] && grep -q "${CN_RUBYGEMS_URL}" "$gemrc" 2>/dev/null; then
282
- print_success "gem source already ${CN_RUBYGEMS_URL}"
283
- else
284
- [ -f "$gemrc" ] && mv "$gemrc" "$HOME/.gemrc_clackybak"
285
- cat > "$gemrc" <<GEMRC
281
+
282
+ if [ "$USE_CN_MIRRORS" = true ]; then
283
+ # CN: point gem source to Aliyun mirror
284
+ if [ -f "$gemrc" ] && grep -q "${CN_RUBYGEMS_URL}" "$gemrc" 2>/dev/null; then
285
+ print_success "gem source already → ${CN_RUBYGEMS_URL}"
286
+ else
287
+ [ -f "$gemrc" ] && mv "$gemrc" "$HOME/.gemrc_clackybak"
288
+ cat > "$gemrc" <<GEMRC
286
289
  :sources:
287
290
  - ${CN_RUBYGEMS_URL}
288
291
  GEMRC
289
- print_success "gem source → ${CN_RUBYGEMS_URL}"
292
+ print_success "gem source → ${CN_RUBYGEMS_URL}"
293
+ fi
294
+ else
295
+ # Global: restore original gemrc if we were the ones who changed it
296
+ if [ -f "$gemrc" ] && grep -q "${CN_RUBYGEMS_URL}" "$gemrc" 2>/dev/null; then
297
+ if [ -f "$HOME/.gemrc_clackybak" ]; then
298
+ mv "$HOME/.gemrc_clackybak" "$gemrc"
299
+ print_info "gem source restored from backup"
300
+ else
301
+ rm "$gemrc"
302
+ print_info "gem source restored to default"
303
+ fi
304
+ fi
290
305
  fi
291
306
  }
292
307
 
@@ -445,7 +460,23 @@ install_via_gem() {
445
460
  configure_gem_source
446
461
  setup_gem_home
447
462
 
448
- gem install openclacky --no-document
463
+ if [ "$USE_CN_MIRRORS" = true ]; then
464
+ # CN: download .gem from OSS, install dependencies from Aliyun mirror
465
+ print_info "Fetching latest version from OSS..."
466
+ local cn_version
467
+ cn_version=$(curl -fsSL "$CN_GEM_LATEST_URL" | tr -d '[:space:]')
468
+ print_info "Latest version: ${cn_version}"
469
+
470
+ local gem_url="${CN_GEM_BASE_URL}/openclacky-${cn_version}.gem"
471
+ local gem_file="/tmp/openclacky-${cn_version}.gem"
472
+ print_info "Downloading openclacky-${cn_version}.gem from OSS..."
473
+ curl -fsSL "$gem_url" -o "$gem_file"
474
+ print_info "Installing gem and dependencies from Aliyun mirror..."
475
+ gem install "$gem_file" --no-document --source "$CN_RUBYGEMS_URL"
476
+ else
477
+ print_info "Installing gem and dependencies from RubyGems..."
478
+ gem install openclacky --no-document
479
+ fi
449
480
 
450
481
  if [ $? -eq 0 ]; then
451
482
  print_success "${DISPLAY_NAME} installed successfully!"
@@ -556,8 +587,6 @@ main() {
556
587
  print_info "Please install Ruby >= 2.6.0 manually and run: gem install openclacky"
557
588
  exit 1
558
589
  fi
559
- # WSL: auto-trust Windows system32 to suppress mise warnings
560
- export MISE_TRUSTED_CONFIG_PATHS="/mnt/c/Windows/system32"
561
590
  elif [ "$OS" != "macOS" ]; then
562
591
  print_error "Unsupported OS: $OS"
563
592
  print_info "Please install Ruby >= 2.6.0 manually and run: gem install openclacky"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openclacky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.9.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - windy