openclacky 1.1.2 → 1.1.4

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.clacky/skills/gem-release/SKILL.md +27 -31
  3. data/CHANGELOG.md +30 -0
  4. data/Dockerfile +28 -0
  5. data/README.md +4 -0
  6. data/README_CN.md +198 -0
  7. data/docs/engineering-article.md +343 -0
  8. data/lib/clacky/agent/llm_caller.rb +2 -5
  9. data/lib/clacky/agent/session_serializer.rb +4 -0
  10. data/lib/clacky/agent.rb +22 -1
  11. data/lib/clacky/brand_config.rb +87 -5
  12. data/lib/clacky/cli.rb +1 -1
  13. data/lib/clacky/client.rb +15 -11
  14. data/lib/clacky/message_format/anthropic.rb +30 -2
  15. data/lib/clacky/message_format/bedrock.rb +13 -1
  16. data/lib/clacky/message_format/open_ai.rb +5 -1
  17. data/lib/clacky/providers.rb +34 -0
  18. data/lib/clacky/server/channel/adapters/dingtalk/adapter.rb +142 -5
  19. data/lib/clacky/server/channel/adapters/dingtalk/api_client.rb +309 -0
  20. data/lib/clacky/server/http_server.rb +130 -15
  21. data/lib/clacky/server/session_registry.rb +9 -6
  22. data/lib/clacky/ui2/ui_controller.rb +14 -0
  23. data/lib/clacky/ui_interface.rb +14 -0
  24. data/lib/clacky/utils/model_pricing.rb +96 -25
  25. data/lib/clacky/version.rb +1 -1
  26. data/lib/clacky/web/app.css +1286 -1116
  27. data/lib/clacky/web/brand.js +20 -5
  28. data/lib/clacky/web/i18n.js +42 -0
  29. data/lib/clacky/web/index.html +26 -7
  30. data/lib/clacky/web/onboard.js +6 -0
  31. data/lib/clacky/web/sessions.js +194 -11
  32. data/lib/clacky/web/settings.js +51 -10
  33. data/lib/clacky/web/skills.js +53 -31
  34. data/lib/clacky/web/vendor/hljs/highlight.min.js +1244 -0
  35. data/lib/clacky/web/vendor/hljs/hljs-theme.css +95 -0
  36. data/scripts/build/lib/apt.sh +30 -10
  37. data/scripts/build/lib/network.sh +3 -2
  38. data/scripts/install.sh +30 -9
  39. data/scripts/install_browser.sh +2 -1
  40. data/scripts/install_full.sh +2 -1
  41. data/scripts/install_rails_deps.sh +30 -9
  42. data/scripts/install_system_deps.sh +30 -9
  43. metadata +7 -17
  44. data/docs/HOW-TO-USE-CN.md +0 -96
  45. data/docs/HOW-TO-USE.md +0 -94
  46. data/docs/browser-cdp-native-design.md +0 -195
  47. data/docs/c-end-user-positioning.md +0 -64
  48. data/docs/config.example.yml +0 -27
  49. data/docs/deploy-architecture.md +0 -619
  50. data/docs/deploy_subagent_design.md +0 -540
  51. data/docs/install-script-simplification.md +0 -89
  52. data/docs/memory-architecture.md +0 -343
  53. data/docs/openclacky_cloud_api_reference.md +0 -584
  54. data/docs/security-design.md +0 -109
  55. data/docs/session-management-redesign.md +0 -202
  56. data/docs/system-skill-authoring-guide.md +0 -47
  57. data/docs/why-developer.md +0 -371
  58. data/docs/why-openclacky.md +0 -266
@@ -0,0 +1,95 @@
1
+ /*
2
+ * highlight.js theme — auto-switches based on [data-theme] attribute.
3
+ * Based on GitHub Light / GitHub Dark themes by @Hirse.
4
+ * highlight.js v11.11.1
5
+ */
6
+
7
+ /* ── Shared base ─────────────────────────────────────────────────────── */
8
+ pre code.hljs { display: block; overflow-x: auto; padding: 0; }
9
+ code.hljs { padding: 0; }
10
+
11
+ /* ── Light theme (default) ───────────────────────────────────────────── */
12
+ [data-theme="light"] .hljs { color: #24292e; background: transparent; }
13
+ [data-theme="light"] .hljs-doctag,
14
+ [data-theme="light"] .hljs-keyword,
15
+ [data-theme="light"] .hljs-meta .hljs-keyword,
16
+ [data-theme="light"] .hljs-template-tag,
17
+ [data-theme="light"] .hljs-template-variable,
18
+ [data-theme="light"] .hljs-type,
19
+ [data-theme="light"] .hljs-variable.language_ { color: #d73a49; }
20
+ [data-theme="light"] .hljs-title,
21
+ [data-theme="light"] .hljs-title.class_,
22
+ [data-theme="light"] .hljs-title.class_.inherited__,
23
+ [data-theme="light"] .hljs-title.function_ { color: #6f42c1; }
24
+ [data-theme="light"] .hljs-attr,
25
+ [data-theme="light"] .hljs-attribute,
26
+ [data-theme="light"] .hljs-literal,
27
+ [data-theme="light"] .hljs-meta,
28
+ [data-theme="light"] .hljs-number,
29
+ [data-theme="light"] .hljs-operator,
30
+ [data-theme="light"] .hljs-selector-attr,
31
+ [data-theme="light"] .hljs-selector-class,
32
+ [data-theme="light"] .hljs-selector-id,
33
+ [data-theme="light"] .hljs-variable { color: #005cc5; }
34
+ [data-theme="light"] .hljs-meta .hljs-string,
35
+ [data-theme="light"] .hljs-regexp,
36
+ [data-theme="light"] .hljs-string { color: #032f62; }
37
+ [data-theme="light"] .hljs-built_in,
38
+ [data-theme="light"] .hljs-symbol { color: #e36209; }
39
+ [data-theme="light"] .hljs-code,
40
+ [data-theme="light"] .hljs-comment,
41
+ [data-theme="light"] .hljs-formula { color: #6a737d; }
42
+ [data-theme="light"] .hljs-name,
43
+ [data-theme="light"] .hljs-quote,
44
+ [data-theme="light"] .hljs-selector-pseudo,
45
+ [data-theme="light"] .hljs-selector-tag { color: #22863a; }
46
+ [data-theme="light"] .hljs-subst { color: #24292e; }
47
+ [data-theme="light"] .hljs-section { color: #005cc5; font-weight: bold; }
48
+ [data-theme="light"] .hljs-bullet { color: #735c0f; }
49
+ [data-theme="light"] .hljs-emphasis { color: #24292e; font-style: italic; }
50
+ [data-theme="light"] .hljs-strong { color: #24292e; font-weight: bold; }
51
+ [data-theme="light"] .hljs-addition { color: #22863a; background-color: #f0fff4; }
52
+ [data-theme="light"] .hljs-deletion { color: #b31d28; background-color: #ffeef0; }
53
+
54
+ /* ── Dark theme ──────────────────────────────────────────────────────── */
55
+ [data-theme="dark"] .hljs { color: #c9d1d9; background: transparent; }
56
+ [data-theme="dark"] .hljs-doctag,
57
+ [data-theme="dark"] .hljs-keyword,
58
+ [data-theme="dark"] .hljs-meta .hljs-keyword,
59
+ [data-theme="dark"] .hljs-template-tag,
60
+ [data-theme="dark"] .hljs-template-variable,
61
+ [data-theme="dark"] .hljs-type,
62
+ [data-theme="dark"] .hljs-variable.language_ { color: #ff7b72; }
63
+ [data-theme="dark"] .hljs-title,
64
+ [data-theme="dark"] .hljs-title.class_,
65
+ [data-theme="dark"] .hljs-title.class_.inherited__,
66
+ [data-theme="dark"] .hljs-title.function_ { color: #d2a8ff; }
67
+ [data-theme="dark"] .hljs-attr,
68
+ [data-theme="dark"] .hljs-attribute,
69
+ [data-theme="dark"] .hljs-literal,
70
+ [data-theme="dark"] .hljs-meta,
71
+ [data-theme="dark"] .hljs-number,
72
+ [data-theme="dark"] .hljs-operator,
73
+ [data-theme="dark"] .hljs-selector-attr,
74
+ [data-theme="dark"] .hljs-selector-class,
75
+ [data-theme="dark"] .hljs-selector-id,
76
+ [data-theme="dark"] .hljs-variable { color: #79c0ff; }
77
+ [data-theme="dark"] .hljs-meta .hljs-string,
78
+ [data-theme="dark"] .hljs-regexp,
79
+ [data-theme="dark"] .hljs-string { color: #a5d6ff; }
80
+ [data-theme="dark"] .hljs-built_in,
81
+ [data-theme="dark"] .hljs-symbol { color: #ffa657; }
82
+ [data-theme="dark"] .hljs-code,
83
+ [data-theme="dark"] .hljs-comment,
84
+ [data-theme="dark"] .hljs-formula { color: #8b949e; }
85
+ [data-theme="dark"] .hljs-name,
86
+ [data-theme="dark"] .hljs-quote,
87
+ [data-theme="dark"] .hljs-selector-pseudo,
88
+ [data-theme="dark"] .hljs-selector-tag { color: #7ee787; }
89
+ [data-theme="dark"] .hljs-subst { color: #c9d1d9; }
90
+ [data-theme="dark"] .hljs-section { color: #1f6feb; font-weight: bold; }
91
+ [data-theme="dark"] .hljs-bullet { color: #f2cc60; }
92
+ [data-theme="dark"] .hljs-emphasis { color: #c9d1d9; font-style: italic; }
93
+ [data-theme="dark"] .hljs-strong { color: #c9d1d9; font-weight: bold; }
94
+ [data-theme="dark"] .hljs-addition { color: #aff5b4; background-color: rgba(46, 160, 67, 0.15); }
95
+ [data-theme="dark"] .hljs-deletion { color: #ffdcd7; background-color: rgba(248, 81, 73, 0.15); }
@@ -1,6 +1,6 @@
1
1
  # apt.sh — apt package manager helpers (Ubuntu/Debian)
2
- # Depends-On: colors.sh
3
- # Requires-Vars: $DISTRO $USE_CN_MIRRORS
2
+ # Depends-On: colors.sh network.sh
3
+ # Requires-Vars: $DISTRO $USE_CN_MIRRORS $CN_ALIYUN_MIRROR
4
4
  # Sets-Vars: (none)
5
5
  # Include via: @include lib/apt.sh
6
6
 
@@ -12,20 +12,40 @@ setup_apt_mirror() {
12
12
 
13
13
  if [ "$USE_CN_MIRRORS" = true ]; then
14
14
  print_info "Region: China — configuring Aliyun apt mirror"
15
- local codename="${VERSION_CODENAME:-jammy}"
16
- local components="main restricted universe multiverse"
17
- local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
18
- if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
19
- local mirror="https://mirrors.aliyun.com/ubuntu-ports/"
20
- else
21
- local mirror="https://mirrors.aliyun.com/ubuntu/"
15
+
16
+ if [ -f /etc/apt/sources.list ]; then
17
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
18
+ print_info "Backed up /etc/apt/sources.list to sources.list.bak"
22
19
  fi
23
- sudo tee /etc/apt/sources.list > /dev/null <<EOF
20
+
21
+ if [ "$DISTRO" = "debian" ]; then
22
+ local codename="${VERSION_CODENAME:-bookworm}"
23
+ local components="main contrib non-free non-free-firmware"
24
+ local mirror="${CN_ALIYUN_MIRROR}/debian/"
25
+ local security_mirror="${CN_ALIYUN_MIRROR}/debian-security/"
26
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
27
+ deb ${mirror} ${codename} ${components}
28
+ deb ${mirror} ${codename}-updates ${components}
29
+ deb ${mirror} ${codename}-backports ${components}
30
+ deb ${security_mirror} ${codename}-security ${components}
31
+ EOF
32
+ else
33
+ local codename="${VERSION_CODENAME:-jammy}"
34
+ local components="main restricted universe multiverse"
35
+ local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
36
+ if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
37
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu-ports/"
38
+ else
39
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu/"
40
+ fi
41
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
24
42
  deb ${mirror} ${codename} ${components}
25
43
  deb ${mirror} ${codename}-updates ${components}
26
44
  deb ${mirror} ${codename}-backports ${components}
27
45
  deb ${mirror} ${codename}-security ${components}
28
46
  EOF
47
+ fi
48
+
29
49
  print_success "apt mirror set to Aliyun"
30
50
  else
31
51
  print_info "Region: global — using default apt sources"
@@ -1,7 +1,7 @@
1
1
  # network.sh — network region detection, mirror variables, URL probing
2
2
  # Depends-On: colors.sh
3
3
  # Requires-Vars: (none)
4
- # Sets-Vars: $USE_CN_MIRRORS $NETWORK_REGION $CN_CDN_BASE_URL $CN_RUBYGEMS_URL $CN_NODE_MIRROR_URL $CN_NPM_REGISTRY $CN_MISE_INSTALL_URL $CN_RUBY_PRECOMPILED_URL $MISE_INSTALL_URL $NODE_MIRROR_URL $NPM_REGISTRY_URL $RUBY_VERSION_SPEC $DEFAULT_RUBYGEMS_URL $DEFAULT_MISE_INSTALL_URL $DEFAULT_NPM_REGISTRY
4
+ # Sets-Vars: $USE_CN_MIRRORS $NETWORK_REGION $CN_CDN_BASE_URL $CN_ALIYUN_MIRROR $CN_RUBYGEMS_URL $CN_NODE_MIRROR_URL $CN_NPM_REGISTRY $CN_MISE_INSTALL_URL $CN_RUBY_PRECOMPILED_URL $MISE_INSTALL_URL $NODE_MIRROR_URL $NPM_REGISTRY_URL $RUBY_VERSION_SPEC $DEFAULT_RUBYGEMS_URL $DEFAULT_MISE_INSTALL_URL $DEFAULT_NPM_REGISTRY
5
5
  # Include via: @include lib/network.sh
6
6
 
7
7
  # --------------------------------------------------------------------------
@@ -17,9 +17,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
17
17
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
18
18
 
19
19
  CN_CDN_BASE_URL="https://oss.1024code.com"
20
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
20
21
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
21
22
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
22
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
23
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
23
24
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
24
25
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
25
26
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
data/scripts/install.sh CHANGED
@@ -129,9 +129,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
129
129
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
130
130
 
131
131
  CN_CDN_BASE_URL="https://oss.1024code.com"
132
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
132
133
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
133
134
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
134
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
135
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
135
136
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
136
137
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
137
138
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
@@ -278,20 +279,40 @@ setup_apt_mirror() {
278
279
 
279
280
  if [ "$USE_CN_MIRRORS" = true ]; then
280
281
  print_info "Region: China — configuring Aliyun apt mirror"
281
- local codename="${VERSION_CODENAME:-jammy}"
282
- local components="main restricted universe multiverse"
283
- local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
284
- if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
285
- local mirror="https://mirrors.aliyun.com/ubuntu-ports/"
286
- else
287
- local mirror="https://mirrors.aliyun.com/ubuntu/"
282
+
283
+ if [ -f /etc/apt/sources.list ]; then
284
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
285
+ print_info "Backed up /etc/apt/sources.list to sources.list.bak"
288
286
  fi
289
- sudo tee /etc/apt/sources.list > /dev/null <<EOF
287
+
288
+ if [ "$DISTRO" = "debian" ]; then
289
+ local codename="${VERSION_CODENAME:-bookworm}"
290
+ local components="main contrib non-free non-free-firmware"
291
+ local mirror="${CN_ALIYUN_MIRROR}/debian/"
292
+ local security_mirror="${CN_ALIYUN_MIRROR}/debian-security/"
293
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
294
+ deb ${mirror} ${codename} ${components}
295
+ deb ${mirror} ${codename}-updates ${components}
296
+ deb ${mirror} ${codename}-backports ${components}
297
+ deb ${security_mirror} ${codename}-security ${components}
298
+ EOF
299
+ else
300
+ local codename="${VERSION_CODENAME:-jammy}"
301
+ local components="main restricted universe multiverse"
302
+ local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
303
+ if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
304
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu-ports/"
305
+ else
306
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu/"
307
+ fi
308
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
290
309
  deb ${mirror} ${codename} ${components}
291
310
  deb ${mirror} ${codename}-updates ${components}
292
311
  deb ${mirror} ${codename}-backports ${components}
293
312
  deb ${mirror} ${codename}-security ${components}
294
313
  EOF
314
+ fi
315
+
295
316
  print_success "apt mirror set to Aliyun"
296
317
  else
297
318
  print_info "Region: global — using default apt sources"
@@ -125,9 +125,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
125
125
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
126
126
 
127
127
  CN_CDN_BASE_URL="https://oss.1024code.com"
128
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
128
129
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
129
130
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
130
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
131
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
131
132
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
132
133
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
133
134
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
@@ -129,9 +129,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
129
129
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
130
130
 
131
131
  CN_CDN_BASE_URL="https://oss.1024code.com"
132
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
132
133
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
133
134
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
134
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
135
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
135
136
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
136
137
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
137
138
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
@@ -133,9 +133,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
133
133
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
134
134
 
135
135
  CN_CDN_BASE_URL="https://oss.1024code.com"
136
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
136
137
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
137
138
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
138
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
139
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
139
140
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
140
141
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
141
142
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
@@ -282,20 +283,40 @@ setup_apt_mirror() {
282
283
 
283
284
  if [ "$USE_CN_MIRRORS" = true ]; then
284
285
  print_info "Region: China — configuring Aliyun apt mirror"
285
- local codename="${VERSION_CODENAME:-jammy}"
286
- local components="main restricted universe multiverse"
287
- local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
288
- if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
289
- local mirror="https://mirrors.aliyun.com/ubuntu-ports/"
290
- else
291
- local mirror="https://mirrors.aliyun.com/ubuntu/"
286
+
287
+ if [ -f /etc/apt/sources.list ]; then
288
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
289
+ print_info "Backed up /etc/apt/sources.list to sources.list.bak"
292
290
  fi
293
- sudo tee /etc/apt/sources.list > /dev/null <<EOF
291
+
292
+ if [ "$DISTRO" = "debian" ]; then
293
+ local codename="${VERSION_CODENAME:-bookworm}"
294
+ local components="main contrib non-free non-free-firmware"
295
+ local mirror="${CN_ALIYUN_MIRROR}/debian/"
296
+ local security_mirror="${CN_ALIYUN_MIRROR}/debian-security/"
297
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
298
+ deb ${mirror} ${codename} ${components}
299
+ deb ${mirror} ${codename}-updates ${components}
300
+ deb ${mirror} ${codename}-backports ${components}
301
+ deb ${security_mirror} ${codename}-security ${components}
302
+ EOF
303
+ else
304
+ local codename="${VERSION_CODENAME:-jammy}"
305
+ local components="main restricted universe multiverse"
306
+ local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
307
+ if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
308
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu-ports/"
309
+ else
310
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu/"
311
+ fi
312
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
294
313
  deb ${mirror} ${codename} ${components}
295
314
  deb ${mirror} ${codename}-updates ${components}
296
315
  deb ${mirror} ${codename}-backports ${components}
297
316
  deb ${mirror} ${codename}-security ${components}
298
317
  EOF
318
+ fi
319
+
299
320
  print_success "apt mirror set to Aliyun"
300
321
  else
301
322
  print_info "Region: global — using default apt sources"
@@ -128,9 +128,10 @@ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
128
128
  DEFAULT_MISE_INSTALL_URL="https://mise.run"
129
129
 
130
130
  CN_CDN_BASE_URL="https://oss.1024code.com"
131
+ CN_ALIYUN_MIRROR="https://mirrors.aliyun.com"
131
132
  CN_MISE_INSTALL_URL="${CN_CDN_BASE_URL}/mise.sh"
132
133
  CN_RUBY_PRECOMPILED_URL="${CN_CDN_BASE_URL}/ruby/ruby-{version}.{platform}.tar.gz"
133
- CN_RUBYGEMS_URL="https://mirrors.aliyun.com/rubygems/"
134
+ CN_RUBYGEMS_URL="${CN_ALIYUN_MIRROR}/rubygems/"
134
135
  CN_NPM_REGISTRY="https://registry.npmmirror.com"
135
136
  CN_NODE_MIRROR_URL="https://cdn.npmmirror.com/binaries/node/"
136
137
  CN_GEM_BASE_URL="${CN_CDN_BASE_URL}/openclacky"
@@ -277,20 +278,40 @@ setup_apt_mirror() {
277
278
 
278
279
  if [ "$USE_CN_MIRRORS" = true ]; then
279
280
  print_info "Region: China — configuring Aliyun apt mirror"
280
- local codename="${VERSION_CODENAME:-jammy}"
281
- local components="main restricted universe multiverse"
282
- local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
283
- if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
284
- local mirror="https://mirrors.aliyun.com/ubuntu-ports/"
285
- else
286
- local mirror="https://mirrors.aliyun.com/ubuntu/"
281
+
282
+ if [ -f /etc/apt/sources.list ]; then
283
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
284
+ print_info "Backed up /etc/apt/sources.list to sources.list.bak"
287
285
  fi
288
- sudo tee /etc/apt/sources.list > /dev/null <<EOF
286
+
287
+ if [ "$DISTRO" = "debian" ]; then
288
+ local codename="${VERSION_CODENAME:-bookworm}"
289
+ local components="main contrib non-free non-free-firmware"
290
+ local mirror="${CN_ALIYUN_MIRROR}/debian/"
291
+ local security_mirror="${CN_ALIYUN_MIRROR}/debian-security/"
292
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
293
+ deb ${mirror} ${codename} ${components}
294
+ deb ${mirror} ${codename}-updates ${components}
295
+ deb ${mirror} ${codename}-backports ${components}
296
+ deb ${security_mirror} ${codename}-security ${components}
297
+ EOF
298
+ else
299
+ local codename="${VERSION_CODENAME:-jammy}"
300
+ local components="main restricted universe multiverse"
301
+ local arch; arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
302
+ if [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
303
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu-ports/"
304
+ else
305
+ local mirror="${CN_ALIYUN_MIRROR}/ubuntu/"
306
+ fi
307
+ sudo tee /etc/apt/sources.list > /dev/null <<EOF
289
308
  deb ${mirror} ${codename} ${components}
290
309
  deb ${mirror} ${codename}-updates ${components}
291
310
  deb ${mirror} ${codename}-backports ${components}
292
311
  deb ${mirror} ${codename}-security ${components}
293
312
  EOF
313
+ fi
314
+
294
315
  print_success "apt mirror set to Aliyun"
295
316
  else
296
317
  print_info "Region: global — using default apt sources"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openclacky
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - windy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-20 00:00:00.000000000 Z
11
+ date: 2026-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -281,8 +281,10 @@ files:
281
281
  - ".rubocop.yml"
282
282
  - CHANGELOG.md
283
283
  - CODE_OF_CONDUCT.md
284
+ - Dockerfile
284
285
  - LICENSE.txt
285
286
  - README.md
287
+ - README_CN.md
286
288
  - Rakefile
287
289
  - benchmark/fixtures/sample_project/Gemfile
288
290
  - benchmark/fixtures/sample_project/lib/api_handler.rb
@@ -300,26 +302,12 @@ files:
300
302
  - bin/openclacky
301
303
  - clacky-legacy/clacky.gemspec
302
304
  - clacky-legacy/clarky.gemspec
303
- - docs/HOW-TO-USE-CN.md
304
- - docs/HOW-TO-USE.md
305
305
  - docs/agent-first-ui-design.md
306
- - docs/browser-cdp-native-design.md
307
- - docs/c-end-user-positioning.md
308
306
  - docs/channel-architecture.md
309
- - docs/config.example.yml
310
- - docs/deploy-architecture.md
311
- - docs/deploy_subagent_design.md
312
- - docs/install-script-simplification.md
313
- - docs/memory-architecture.md
314
- - docs/openclacky_cloud_api_reference.md
315
- - docs/security-design.md
316
- - docs/session-management-redesign.md
307
+ - docs/engineering-article.md
317
308
  - docs/session-skill-invocation.md
318
- - docs/system-skill-authoring-guide.md
319
309
  - docs/time_machine_design.md
320
310
  - docs/ui2-architecture.md
321
- - docs/why-developer.md
322
- - docs/why-openclacky.md
323
311
  - homebrew/README.md
324
312
  - homebrew/openclacky.rb
325
313
  - lib/clacky.rb
@@ -537,6 +525,8 @@ files:
537
525
  - lib/clacky/web/tasks.js
538
526
  - lib/clacky/web/theme.js
539
527
  - lib/clacky/web/trash.js
528
+ - lib/clacky/web/vendor/hljs/highlight.min.js
529
+ - lib/clacky/web/vendor/hljs/hljs-theme.css
540
530
  - lib/clacky/web/vendor/katex/auto-render.min.js
541
531
  - lib/clacky/web/vendor/katex/fonts/KaTeX_AMS-Regular.woff2
542
532
  - lib/clacky/web/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2
@@ -1,96 +0,0 @@
1
- # OpenClacky 使用指南
2
-
3
- ## 安装
4
-
5
- ```bash
6
- gem install openclacky
7
- ```
8
-
9
- **系统要求:** Ruby >= 3.1
10
-
11
- ## 快速开始
12
-
13
- ### 1. 启动 Clacky
14
-
15
- ```bash
16
- clacky
17
- ```
18
-
19
- ### 2. 配置 API Key(首次使用)
20
-
21
- 在聊天界面中输入:
22
-
23
- ```
24
- /config
25
- ```
26
-
27
- 然后按提示设置你的 API key:
28
- - **OpenAI**:从 https://platform.openai.com/api-keys 获取
29
- - **Anthropic**:从 https://console.anthropic.com/ 获取
30
- - **MiniMax**:国内推荐,https://platform.minimaxi.com/
31
- - **OpenRouter**:聚合多个 AI 模型,https://openrouter.ai/
32
-
33
- ### 3. 开始对话
34
-
35
- 直接在聊天框输入你的问题或需求:
36
-
37
- ```
38
- 帮我写一个解析 CSV 文件的 Ruby 脚本
39
- ```
40
-
41
- ```
42
- 创建一个网页爬虫提取文章标题
43
- ```
44
-
45
- ## 核心功能
46
-
47
- ### 🎯 自主代理模式
48
- Clacky 可以自动执行复杂任务,内置多种工具:
49
- - **文件操作**:读取、写入、编辑、搜索文件
50
- - **网页访问**:浏览网页、搜索信息
51
- - **代码执行**:运行 shell 命令、测试代码
52
- - **项目管理**:Git 操作、测试、部署
53
-
54
- ### 🔌 技能系统
55
- 使用简写命令调用强大的技能:
56
-
57
- ```
58
- /commit # 智能 Git 提交助手
59
- /gem-release # 自动化 gem 发布流程
60
- ```
61
-
62
- 你还可以在 `.clacky/skills/` 目录创建自己的技能!
63
-
64
- ### 💬 智能记忆管理
65
- - **自动压缩**长对话内容
66
- - **保留上下文**同时降低 token 成本
67
- - **智能总结**对话历史
68
-
69
- ### ⚙️ 简单配置
70
- - 交互式设置向导
71
- - 支持多个 API 提供商
72
- - 成本追踪和使用限制
73
- - 常用场景的智能默认值
74
-
75
- ## 聊天中的常用命令
76
-
77
- ```
78
- /config # 配置 API 设置
79
- /help # 显示可用命令
80
- /skills # 列出可用技能
81
- ```
82
-
83
- ## 为什么选择 OpenClacky?
84
-
85
- ✅ **安装简单** - 一条命令安装,立即开始对话
86
- ✅ **功能强大** - 自主执行复杂任务
87
- ✅ **可扩展** - 为你的工作流创建自定义技能
88
- ✅ **省钱高效** - 智能记忆压缩节省 token 费用
89
- ✅ **多平台** - 支持 OpenAI、Anthropic、MiniMax、OpenRouter 等
90
- ✅ **质量保证** - 367+ 测试用例确保可靠性
91
-
92
- ## 了解更多
93
-
94
- - GitHub:https://github.com/clacky-ai/openclacky
95
- - 问题反馈:https://github.com/clacky-ai/openclacky/issues
96
- - 当前版本:0.7.0
data/docs/HOW-TO-USE.md DELETED
@@ -1,94 +0,0 @@
1
- # How to Use OpenClacky
2
-
3
- ## Installation
4
-
5
- ```bash
6
- gem install openclacky
7
- ```
8
-
9
- **Requirements:** Ruby >= 3.1
10
-
11
- ## Quick Start
12
-
13
- ### 1. Start Clacky
14
-
15
- ```bash
16
- clacky
17
- ```
18
-
19
- ### 2. Configure API Key (First Time)
20
-
21
- In the chat interface, type:
22
-
23
- ```
24
- /config
25
- ```
26
-
27
- Then follow the prompts to set your API key:
28
- - **OpenAI**: Get key from https://platform.openai.com/api-keys
29
- - **Anthropic**: Get key from https://console.anthropic.com/
30
-
31
- ### 3. Start Chatting
32
-
33
- Just type your questions or requests in the chat:
34
-
35
- ```
36
- Help me write a Ruby script to parse CSV files
37
- ```
38
-
39
- ```
40
- Create a web scraper for extracting article titles
41
- ```
42
-
43
- ## Key Features
44
-
45
- ### 🎯 Autonomous Agent Mode
46
- Clacky can automatically execute complex tasks using built-in tools:
47
- - **File Operations**: Read, write, edit, search files
48
- - **Web Access**: Browse and search the web
49
- - **Code Execution**: Run shell commands and test code
50
- - **Project Management**: Git operations, testing, deployment
51
-
52
- ### 🔌 Skill System
53
- Use powerful skills with simple shorthand commands:
54
-
55
- ```
56
- /commit # Smart git commit helper
57
- /gem-release # Automated gem publishing
58
- ```
59
-
60
- Create your own skills in `.clacky/skills/` directory!
61
-
62
- ### 💬 Smart Memory Management
63
- - **Automatic compression** for long conversations
64
- - **Context preservation** while reducing token costs
65
- - **Intelligent summarization** of conversation history
66
-
67
- ### ⚙️ Easy Configuration
68
- - Interactive setup wizard
69
- - Support for multiple API providers
70
- - Cost tracking and usage limits
71
- - Smart defaults for common use cases
72
-
73
- ## Common Commands in Chat
74
-
75
- ```
76
- /config # Configure API settings
77
- /help # Show available commands
78
- /skills # List available skills
79
- ```
80
-
81
- ## Why Choose OpenClacky?
82
-
83
- ✅ **Simple Setup** - Just `gem install` and start chatting
84
- ✅ **Powerful Agent** - Executes complex tasks autonomously
85
- ✅ **Extensible** - Create custom skills for your workflows
86
- ✅ **Cost-Effective** - Smart memory compression saves tokens
87
- ✅ **Multi-Provider** - Works with OpenAI and Anthropic
88
- ✅ **Well-Tested** - 367+ passing tests ensure reliability
89
-
90
- ## Learn More
91
-
92
- - GitHub: https://github.com/clacky-ai/openclacky
93
- - Report Issues: https://github.com/clacky-ai/openclacky/issues
94
- - Version: 0.7.0