jishushell 0.4.10 → 0.4.24

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 (248) hide show
  1. package/Dockerfile.hermes-slim +193 -0
  2. package/INSTALL-NOTICE +10 -12
  3. package/apps/hermes-container.yaml +35 -0
  4. package/apps/ollama-binary.yaml +200 -0
  5. package/apps/ollama-cpu-container.yaml +37 -0
  6. package/apps/ollama-with-hollama-binary.yaml +195 -0
  7. package/apps/openclaw-binary.yaml +69 -0
  8. package/apps/openclaw-container.yaml +37 -0
  9. package/apps/openclaw-with-ollama-container.yaml +42 -0
  10. package/apps/openclaw-with-searxng-container.yaml +136 -0
  11. package/apps/openwebui-container.yaml +53 -0
  12. package/apps/playwright-container.yaml +120 -0
  13. package/apps/searxng-container.yaml +115 -0
  14. package/dist/auth.d.ts +1 -0
  15. package/dist/auth.js +15 -14
  16. package/dist/auth.js.map +1 -1
  17. package/dist/cli/app.d.ts +4 -0
  18. package/dist/cli/app.js +814 -0
  19. package/dist/cli/app.js.map +1 -0
  20. package/dist/cli/backup.d.ts +3 -0
  21. package/dist/cli/backup.js +434 -0
  22. package/dist/cli/backup.js.map +1 -0
  23. package/dist/{doctor.d.ts → cli/doctor.d.ts} +7 -1
  24. package/dist/{doctor.js → cli/doctor.js} +377 -22
  25. package/dist/cli/doctor.js.map +1 -0
  26. package/dist/cli/helpers.d.ts +4 -0
  27. package/dist/cli/helpers.js +32 -0
  28. package/dist/cli/helpers.js.map +1 -0
  29. package/dist/cli/job.d.ts +4 -0
  30. package/dist/cli/job.js +198 -0
  31. package/dist/cli/job.js.map +1 -0
  32. package/dist/cli/llm.d.ts +25 -0
  33. package/dist/cli/llm.js +599 -0
  34. package/dist/cli/llm.js.map +1 -0
  35. package/dist/cli/managed-list.d.ts +30 -0
  36. package/dist/cli/managed-list.js +129 -0
  37. package/dist/cli/managed-list.js.map +1 -0
  38. package/dist/cli/panel.d.ts +26 -0
  39. package/dist/cli/panel.js +804 -0
  40. package/dist/cli/panel.js.map +1 -0
  41. package/dist/cli/version.d.ts +1 -0
  42. package/dist/cli/version.js +12 -0
  43. package/dist/cli/version.js.map +1 -0
  44. package/dist/cli.js +48 -776
  45. package/dist/cli.js.map +1 -1
  46. package/dist/config.d.ts +69 -0
  47. package/dist/config.js +268 -7
  48. package/dist/config.js.map +1 -1
  49. package/dist/control.d.ts +17 -41
  50. package/dist/control.js +61 -1323
  51. package/dist/control.js.map +1 -1
  52. package/dist/install.d.ts +16 -0
  53. package/dist/install.js +75 -26
  54. package/dist/install.js.map +1 -1
  55. package/dist/routes/agent-apps.d.ts +15 -0
  56. package/dist/routes/agent-apps.js +78 -0
  57. package/dist/routes/agent-apps.js.map +1 -0
  58. package/dist/routes/apps.d.ts +3 -0
  59. package/dist/routes/apps.js +278 -0
  60. package/dist/routes/apps.js.map +1 -0
  61. package/dist/routes/backup.js +3 -3
  62. package/dist/routes/backup.js.map +1 -1
  63. package/dist/routes/instances.d.ts +6 -0
  64. package/dist/routes/instances.js +863 -874
  65. package/dist/routes/instances.js.map +1 -1
  66. package/dist/routes/llm.d.ts +15 -0
  67. package/dist/routes/llm.js +247 -0
  68. package/dist/routes/llm.js.map +1 -0
  69. package/dist/routes/runtime.d.ts +15 -0
  70. package/dist/routes/runtime.js +69 -0
  71. package/dist/routes/runtime.js.map +1 -0
  72. package/dist/routes/setup.js +131 -9
  73. package/dist/routes/setup.js.map +1 -1
  74. package/dist/routes/system.js +56 -9
  75. package/dist/routes/system.js.map +1 -1
  76. package/dist/server.js +107 -7
  77. package/dist/server.js.map +1 -1
  78. package/dist/services/agent-apps/catalog.d.ts +30 -0
  79. package/dist/services/agent-apps/catalog.js +60 -0
  80. package/dist/services/agent-apps/catalog.js.map +1 -0
  81. package/dist/services/agent-apps/index.d.ts +36 -0
  82. package/dist/services/agent-apps/index.js +171 -0
  83. package/dist/services/agent-apps/index.js.map +1 -0
  84. package/dist/services/agent-apps/installers/adapter-probes.d.ts +49 -0
  85. package/dist/services/agent-apps/installers/adapter-probes.js +223 -0
  86. package/dist/services/agent-apps/installers/adapter-probes.js.map +1 -0
  87. package/dist/services/agent-apps/installers/adapter.d.ts +30 -0
  88. package/dist/services/agent-apps/installers/adapter.js +171 -0
  89. package/dist/services/agent-apps/installers/adapter.js.map +1 -0
  90. package/dist/services/agent-apps/installers/registry-probe.d.ts +38 -0
  91. package/dist/services/agent-apps/installers/registry-probe.js +183 -0
  92. package/dist/services/agent-apps/installers/registry-probe.js.map +1 -0
  93. package/dist/services/agent-apps/installers/shell-script.d.ts +47 -0
  94. package/dist/services/agent-apps/installers/shell-script.js +471 -0
  95. package/dist/services/agent-apps/installers/shell-script.js.map +1 -0
  96. package/dist/services/agent-apps/types.d.ts +125 -0
  97. package/dist/services/agent-apps/types.js +17 -0
  98. package/dist/services/agent-apps/types.js.map +1 -0
  99. package/dist/services/app/app-compiler.d.ts +15 -0
  100. package/dist/services/app/app-compiler.js +172 -0
  101. package/dist/services/app/app-compiler.js.map +1 -0
  102. package/dist/services/app/app-manager.d.ts +142 -0
  103. package/dist/services/app/app-manager.js +1988 -0
  104. package/dist/services/app/app-manager.js.map +1 -0
  105. package/dist/services/app/custom-manager.d.ts +27 -0
  106. package/dist/services/app/custom-manager.js +285 -0
  107. package/dist/services/app/custom-manager.js.map +1 -0
  108. package/dist/services/app/hermes-agent-manager.d.ts +20 -0
  109. package/dist/services/app/hermes-agent-manager.js +289 -0
  110. package/dist/services/app/hermes-agent-manager.js.map +1 -0
  111. package/dist/services/app/id-normalizer.d.ts +27 -0
  112. package/dist/services/app/id-normalizer.js +77 -0
  113. package/dist/services/app/id-normalizer.js.map +1 -0
  114. package/dist/services/app/ollama-manager.d.ts +18 -0
  115. package/dist/services/app/ollama-manager.js +207 -0
  116. package/dist/services/app/ollama-manager.js.map +1 -0
  117. package/dist/services/app/openclaw-manager.d.ts +63 -0
  118. package/dist/services/app/openclaw-manager.js +1178 -0
  119. package/dist/services/app/openclaw-manager.js.map +1 -0
  120. package/dist/services/app/paths.d.ts +47 -0
  121. package/dist/services/app/paths.js +68 -0
  122. package/dist/services/app/paths.js.map +1 -0
  123. package/dist/services/app/registry.d.ts +17 -0
  124. package/dist/services/app/registry.js +31 -0
  125. package/dist/services/app/registry.js.map +1 -0
  126. package/dist/services/app/remote-spec.d.ts +14 -0
  127. package/dist/services/app/remote-spec.js +58 -0
  128. package/dist/services/app/remote-spec.js.map +1 -0
  129. package/dist/services/app/terminal-session-manager.d.ts +27 -0
  130. package/dist/services/app/terminal-session-manager.js +157 -0
  131. package/dist/services/app/terminal-session-manager.js.map +1 -0
  132. package/dist/services/app/types.d.ts +72 -0
  133. package/dist/services/app/types.js +16 -0
  134. package/dist/services/app/types.js.map +1 -0
  135. package/dist/services/backup-manager.js +60 -22
  136. package/dist/services/backup-manager.js.map +1 -1
  137. package/dist/services/instance-manager.d.ts +125 -34
  138. package/dist/services/instance-manager.js +679 -1043
  139. package/dist/services/instance-manager.js.map +1 -1
  140. package/dist/services/llm-proxy/adapters.js +5 -1
  141. package/dist/services/llm-proxy/adapters.js.map +1 -1
  142. package/dist/services/llm-proxy/circuit-breaker.js +10 -2
  143. package/dist/services/llm-proxy/circuit-breaker.js.map +1 -1
  144. package/dist/services/llm-proxy/index.d.ts +43 -0
  145. package/dist/services/llm-proxy/index.js +120 -5
  146. package/dist/services/llm-proxy/index.js.map +1 -1
  147. package/dist/services/llm-proxy/ssrf.js +1 -1
  148. package/dist/services/llm-proxy/ssrf.js.map +1 -1
  149. package/dist/services/nomad-manager.d.ts +260 -3
  150. package/dist/services/nomad-manager.js +2921 -341
  151. package/dist/services/nomad-manager.js.map +1 -1
  152. package/dist/services/panel-manager.d.ts +50 -0
  153. package/dist/services/panel-manager.js +443 -0
  154. package/dist/services/panel-manager.js.map +1 -0
  155. package/dist/services/plugin-installer.js +28 -2
  156. package/dist/services/plugin-installer.js.map +1 -1
  157. package/dist/services/process-manager.js +42 -7
  158. package/dist/services/process-manager.js.map +1 -1
  159. package/dist/services/runtime/adapters/custom.d.ts +20 -0
  160. package/dist/services/runtime/adapters/custom.js +90 -0
  161. package/dist/services/runtime/adapters/custom.js.map +1 -0
  162. package/dist/services/runtime/adapters/hermes.d.ts +174 -0
  163. package/dist/services/runtime/adapters/hermes.js +1316 -0
  164. package/dist/services/runtime/adapters/hermes.js.map +1 -0
  165. package/dist/services/runtime/adapters/openclaw-routes.d.ts +17 -0
  166. package/dist/services/runtime/adapters/openclaw-routes.js +946 -0
  167. package/dist/services/runtime/adapters/openclaw-routes.js.map +1 -0
  168. package/dist/services/runtime/adapters/openclaw.d.ts +188 -0
  169. package/dist/services/runtime/adapters/openclaw.js +2195 -0
  170. package/dist/services/runtime/adapters/openclaw.js.map +1 -0
  171. package/dist/services/runtime/errors.d.ts +28 -0
  172. package/dist/services/runtime/errors.js +31 -0
  173. package/dist/services/runtime/errors.js.map +1 -0
  174. package/dist/services/runtime/index.d.ts +34 -0
  175. package/dist/services/runtime/index.js +51 -0
  176. package/dist/services/runtime/index.js.map +1 -0
  177. package/dist/services/runtime/instance.d.ts +24 -0
  178. package/dist/services/runtime/instance.js +143 -0
  179. package/dist/services/runtime/instance.js.map +1 -0
  180. package/dist/services/runtime/migrations.d.ts +15 -0
  181. package/dist/services/runtime/migrations.js +25 -0
  182. package/dist/services/runtime/migrations.js.map +1 -0
  183. package/dist/services/runtime/registry.d.ts +13 -0
  184. package/dist/services/runtime/registry.js +32 -0
  185. package/dist/services/runtime/registry.js.map +1 -0
  186. package/dist/services/runtime/types.d.ts +545 -0
  187. package/dist/services/runtime/types.js +14 -0
  188. package/dist/services/runtime/types.js.map +1 -0
  189. package/dist/services/setup-manager.d.ts +70 -29
  190. package/dist/services/setup-manager.js +591 -625
  191. package/dist/services/setup-manager.js.map +1 -1
  192. package/dist/services/task-registry.d.ts +44 -0
  193. package/dist/services/task-registry.js +74 -0
  194. package/dist/services/task-registry.js.map +1 -0
  195. package/dist/services/telemetry/heartbeat.d.ts +6 -6
  196. package/dist/services/telemetry/heartbeat.js +29 -30
  197. package/dist/services/telemetry/heartbeat.js.map +1 -1
  198. package/dist/services/update-manager.d.ts +47 -0
  199. package/dist/services/update-manager.js +305 -0
  200. package/dist/services/update-manager.js.map +1 -0
  201. package/dist/types.d.ts +222 -0
  202. package/dist/utils/docker-host.d.ts +15 -0
  203. package/dist/utils/docker-host.js +64 -0
  204. package/dist/utils/docker-host.js.map +1 -0
  205. package/install/jishu-install.sh +303 -37
  206. package/install/post-install.sh +64 -5
  207. package/package.json +19 -5
  208. package/public/assets/Dashboard-B-JoOjBQ.js +1 -0
  209. package/public/assets/HermesChatPanel-mFSureyc.js +1 -0
  210. package/public/assets/HermesConfigForm-DvR05LK1.js +4 -0
  211. package/public/assets/InitPassword-CVA8wQA6.js +1 -0
  212. package/public/assets/InstanceDetail-DcZW2QGO.js +91 -0
  213. package/public/assets/{Login-CUoEZOWR.js → Login-BWsZH2mu.js} +1 -1
  214. package/public/assets/NewInstance-BCIrAd86.js +1 -0
  215. package/public/assets/Settings-xkDcduFz.js +1 -0
  216. package/public/assets/Setup-Cfuwj4gV.js +1 -0
  217. package/public/assets/WeixinLoginPanel-CnjR8xMu.js +9 -0
  218. package/public/assets/index-CPhVFEsx.css +1 -0
  219. package/public/assets/index-DQsM6Joa.js +19 -0
  220. package/public/assets/input-paste-CrNVAyOy.js +1 -0
  221. package/public/assets/{providers-lBSOjUWy.js → providers-V-vwrExZ.js} +1 -1
  222. package/public/assets/registry-B4UFJdpA.js +2 -0
  223. package/public/assets/{usePolling-CK0DfI4h.js → usePolling-Do5Erqm_.js} +1 -1
  224. package/public/assets/vendor-i18n-ucpM0OR0.js +9 -0
  225. package/public/assets/{vendor-react-B1-3Yrt-.js → vendor-react-Bk1hRGiY.js} +1 -1
  226. package/public/favicon.png +0 -0
  227. package/public/index.html +9 -4
  228. package/public/logos/hermes.png +0 -0
  229. package/public/logos/ollama.png +0 -0
  230. package/public/logos/openclaw.svg +60 -0
  231. package/scripts/build-hermes-image.sh +21 -0
  232. package/scripts/build-local.sh +54 -0
  233. package/scripts/check-adapter-isolation.ts +293 -0
  234. package/scripts/fixtures/instances/hermes-sample/instance.json +37 -0
  235. package/scripts/fixtures/instances/legacy-openclaw-sample/instance.json +7 -0
  236. package/scripts/smoke/hermes-bootstrap.sh +195 -0
  237. package/templates/hermes-entrypoint.sh +154 -0
  238. package/dist/doctor.js.map +0 -1
  239. package/install/jishu-install-china.sh +0 -3092
  240. package/public/assets/Dashboard-DhsrzJ4F.js +0 -1
  241. package/public/assets/InitPassword-BjubiVdd.js +0 -1
  242. package/public/assets/InstanceDetail-DMcywsof.js +0 -17
  243. package/public/assets/NewInstance-Bk0G4EiJ.js +0 -1
  244. package/public/assets/Settings-D5tHL_h5.js +0 -1
  245. package/public/assets/Setup-4t6E3Rut.js +0 -1
  246. package/public/assets/index-BJ47MWpF.css +0 -1
  247. package/public/assets/index-DbX85irc.js +0 -16
  248. package/public/assets/vendor-i18n-CfW0RvgE.js +0 -9
@@ -0,0 +1,195 @@
1
+ id: ollama-with-hollama-binary
2
+ name: Ollama
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ description: "通过官方脚本安装并运行 Ollama,同时提供 Hollama Web UI。"
7
+ singleInstance: true
8
+
9
+ tasks:
10
+ - name: gateway
11
+ role: service
12
+ runtime: process
13
+ command: /usr/local/bin/ollama
14
+ args: ["serve"]
15
+ env:
16
+ OLLAMA_HOST: "0.0.0.0:11434"
17
+ resources:
18
+ cpu: "2000m"
19
+ memory: "4096Mi"
20
+ ports:
21
+ - name: gateway
22
+ port: 11434
23
+ visibility: external
24
+ health:
25
+ http:
26
+ path: /api/version
27
+ port: 11434
28
+ interval: "15s"
29
+ timeout: "5s"
30
+ retries: 3
31
+ start_period: "30s"
32
+
33
+ - name: hollama
34
+ role: sidecar
35
+ runtime: container
36
+ image: "ghcr.io/fmaclen/hollama:latest"
37
+ resources:
38
+ cpu: "500m"
39
+ memory: "512Mi"
40
+ ports:
41
+ - name: webui
42
+ port: 4173
43
+ visibility: external
44
+ health:
45
+ http:
46
+ path: /
47
+ port: 4173
48
+ interval: "15s"
49
+ timeout: "5s"
50
+ retries: 6
51
+ start_period: "30s"
52
+
53
+ provides:
54
+ - capability: "hollama-web"
55
+ port: 4173
56
+ protocol: "http"
57
+ description: "Hollama Web 界面"
58
+ - capability: "ollama-api"
59
+ port: 11434
60
+ protocol: "http"
61
+ description: "Ollama HTTP API,兼容 OpenAI /v1/chat/completions 端点"
62
+
63
+ lifecycle:
64
+ pre_install:
65
+ - run: >-
66
+ if ! command -v ollama >/dev/null 2>&1; then
67
+ echo "未检测到 ollama 命令,将通过官方脚本安装 Ollama..." >&2;
68
+ else
69
+ echo "检测到系统中已安装 ollama,跳过安装步骤,直接使用系统版本。" >&2;
70
+ fi;
71
+ install:
72
+ - downloadImage: "ghcr.io/fmaclen/hollama:latest"
73
+ - run: >-
74
+ if ! command -v ollama >/dev/null 2>&1; then
75
+ echo "未检测到 ollama,开始安装..." >&2;
76
+ if [ "$(id -u)" -ne 0 ]; then
77
+ if ! command -v sudo >/dev/null 2>&1; then
78
+ echo "未检测到 sudo,当前环境无法自动安装 Ollama。请以 root 身份重试。" >&2;
79
+ exit 1;
80
+ fi;
81
+ if [ -n "${JISHUSHELL_SUDO_ASKPASS:-}" ]; then
82
+ sudo_probe_output="$(sudo -A true 2>&1)" || {
83
+ if printf '%s\n' "$sudo_probe_output" | grep -qi "no new privileges"; then
84
+ echo "当前运行环境禁止 sudo 提权(no new privileges),无法自动安装 Ollama。请在系统终端手动安装,或调整容器/服务配置后重试。" >&2;
85
+ else
86
+ echo "提供的 sudo 密码无效,无法安装 Ollama。" >&2;
87
+ fi;
88
+ exit 1;
89
+ };
90
+ run_as_root() { sudo -A "$@"; };
91
+ else
92
+ sudo_probe_output="$(sudo -n true 2>&1)" || {
93
+ if printf '%s\n' "$sudo_probe_output" | grep -qi "no new privileges"; then
94
+ echo "当前运行环境禁止 sudo 提权(no new privileges),无法自动安装 Ollama。请在系统终端手动安装,或调整容器/服务配置后重试。" >&2;
95
+ else
96
+ echo "安装 Ollama 需要 sudo 密码;请在页面弹窗中输入后重试。" >&2;
97
+ fi;
98
+ exit 1;
99
+ };
100
+ run_as_root() { sudo -n "$@"; };
101
+ fi;
102
+ else
103
+ run_as_root() { "$@"; };
104
+ fi;
105
+ for BINDIR in /usr/local/bin /usr/bin /bin; do
106
+ echo "$PATH" | grep -q "$BINDIR" && break || continue;
107
+ done;
108
+ OLLAMA_INSTALL_DIR="$(dirname "${BINDIR:-/usr/local/bin}")";
109
+ if [ -d "$OLLAMA_INSTALL_DIR/lib/ollama" ]; then
110
+ old_dir="$OLLAMA_INSTALL_DIR/lib/ollama.jishushell-old-$(date +%s)";
111
+ echo "检测到旧版 Ollama 目录,先移动到 $old_dir 以避免长时间卡在清理步骤..." >&2;
112
+ run_as_root mv "$OLLAMA_INSTALL_DIR/lib/ollama" "$old_dir";
113
+ ( run_as_root rm -rf "$old_dir" >/dev/null 2>&1 || true ) &
114
+ fi;
115
+ curl -fsSL https://ollama.com/install.sh | run_as_root sh;
116
+ else
117
+ echo "检测到系统中已安装 ollama,跳过二进制安装。" >&2;
118
+ fi
119
+ timeout_ms: 900000
120
+ successIfCommandExists: "ollama"
121
+ - run: >-
122
+ case "$(uname -s)" in
123
+ Linux)
124
+ if command -v systemctl >/dev/null 2>&1 && systemctl list-unit-files ollama.service >/dev/null 2>&1; then
125
+ echo "停止并禁用 ollama.service,后续交由 Nomad 管理..." >&2;
126
+ if [ "$(id -u)" -eq 0 ]; then
127
+ run_as_root() { "$@"; };
128
+ elif [ -n "${JISHUSHELL_SUDO_ASKPASS:-}" ]; then
129
+ sudo_probe_output="$(sudo -A true 2>&1)" || {
130
+ if printf '%s\n' "$sudo_probe_output" | grep -qi "no new privileges"; then
131
+ echo "当前运行环境禁止 sudo 提权(no new privileges),无法清理 ollama.service。请在系统终端手动执行后重试。" >&2;
132
+ else
133
+ echo "提供的 sudo 密码无效,无法清理 ollama.service。" >&2;
134
+ fi;
135
+ exit 1;
136
+ };
137
+ run_as_root() { sudo -A "$@"; };
138
+ elif command -v sudo >/dev/null 2>&1; then
139
+ run_as_root() { sudo -n "$@"; };
140
+ else
141
+ run_as_root() { "$@"; };
142
+ fi;
143
+ run_as_root systemctl disable --now ollama;
144
+ else
145
+ echo "Linux 环境未检测到 ollama.service,跳过 systemd 清理。" >&2;
146
+ fi
147
+ ;;
148
+ Darwin)
149
+ echo "macOS 环境尝试关闭 Ollama 自启与正在运行的进程..." >&2;
150
+ if command -v launchctl >/dev/null 2>&1; then
151
+ launchctl bootout "gui/$(id -u)"/com.ollama.ollama 2>/dev/null || true;
152
+ launchctl disable "gui/$(id -u)/com.ollama.ollama" 2>/dev/null || true;
153
+ fi;
154
+ osascript -e 'tell application "Ollama" to quit' >/dev/null 2>&1 || true;
155
+ pkill -TERM -x ollama 2>/dev/null || true;
156
+ pkill -TERM -x Ollama 2>/dev/null || true
157
+ ;;
158
+ *)
159
+ echo "当前平台不支持自动清理 Ollama 自启,跳过。" >&2
160
+ ;;
161
+ esac
162
+
163
+ uninstall:
164
+ - run: >-
165
+ if [ "$(id -u)" -ne 0 ]; then
166
+ if ! command -v sudo >/dev/null 2>&1; then
167
+ echo "当前环境未检测到 sudo,无法卸载 Ollama。请以 root 身份重试。" >&2;
168
+ exit 1;
169
+ fi;
170
+ if [ -n "${JISHUSHELL_SUDO_ASKPASS:-}" ]; then
171
+ sudo_probe_output="$(sudo -A true 2>&1)" || {
172
+ if printf '%s\n' "$sudo_probe_output" | grep -qi "no new privileges"; then
173
+ echo "当前运行环境禁止 sudo 提权(no new privileges),无法卸载 Ollama。请在系统终端手动执行,或调整容器/服务配置后重试。" >&2;
174
+ else
175
+ echo "提供的 sudo 密码无效,无法卸载 Ollama。" >&2;
176
+ fi;
177
+ exit 1;
178
+ };
179
+ run_as_root() { sudo -A "$@"; };
180
+ else
181
+ sudo_probe_output="$(sudo -n true 2>&1)" || {
182
+ if printf '%s\n' "$sudo_probe_output" | grep -qi "no new privileges"; then
183
+ echo "当前运行环境禁止 sudo 提权(no new privileges),无法卸载 Ollama。请在系统终端手动执行,或调整容器/服务配置后重试。" >&2;
184
+ else
185
+ echo "卸载 Ollama 需要 sudo 密码;请在页面弹窗中输入后重试。" >&2;
186
+ fi;
187
+ exit 1;
188
+ };
189
+ run_as_root() { sudo -n "$@"; };
190
+ fi;
191
+ else
192
+ run_as_root() { "$@"; };
193
+ fi;
194
+ run_as_root rm -f /usr/local/bin/ollama /usr/bin/ollama /bin/ollama;
195
+ run_as_root rm -rf /usr/local/lib/ollama /usr/lib/ollama /usr/share/ollama 2>/dev/null || true
@@ -0,0 +1,69 @@
1
+ id: openclaw-binary
2
+ name: OpenClaw Binary
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ agentType: openclaw
7
+ description: "将 OpenClaw 安装到应用目录内的 npm prefix,并以 process runtime 运行网关"
8
+ singleInstance: false
9
+
10
+ tasks:
11
+ - name: gateway
12
+ role: service
13
+ runtime: process
14
+ command: ~/.jishushell/apps/${app_id}/bin/openclaw
15
+ args: ["gateway", "run", "--port", "18789", "--allow-unconfigured"]
16
+ env:
17
+ NODE_ENV: production
18
+ resources:
19
+ cpu: "1000m"
20
+ memory: "2024Mi"
21
+ ports:
22
+ - name: http
23
+ port: 18789
24
+ visibility: external
25
+ health:
26
+ http:
27
+ path: /health
28
+ port: 18789
29
+ interval: "15s"
30
+ timeout: "5s"
31
+ retries: 3
32
+ start_period: "30s"
33
+
34
+ provides:
35
+ - capability: "openclaw-dashboard"
36
+ port: 18789
37
+ description: "OpenClaw Dashboard"
38
+
39
+ lifecycle:
40
+ install:
41
+ - mkdir: "~/.jishushell/apps/${app_id}/runtime"
42
+ - mkdir: "~/.jishushell/apps/${app_id}/bin"
43
+ - mkdir: "~/.jishushell/apps/${app_id}/openclaw-home"
44
+ - run: >-
45
+ runtime_dir="$HOME/.jishushell/apps/${app_id}/runtime";
46
+ pkg_entry="$runtime_dir/lib/node_modules/openclaw/openclaw.mjs";
47
+ if [ -f "$pkg_entry" ]; then
48
+ echo "检测到应用目录中已安装 OpenClaw,跳过 npm 安装。" >&2;
49
+ else
50
+ npm install -g --prefix "$runtime_dir" openclaw@latest;
51
+ fi
52
+ timeout_ms: 900000
53
+ - run: >-
54
+ runtime_dir="$HOME/.jishushell/apps/${app_id}/runtime";
55
+ wrapper_dir="$HOME/.jishushell/apps/${app_id}/bin";
56
+ openclaw_home="$HOME/.jishushell/apps/${app_id}/openclaw-home";
57
+ pkg_entry="$runtime_dir/lib/node_modules/openclaw/openclaw.mjs";
58
+ wrapper="$wrapper_dir/openclaw";
59
+ node_bin="$(command -v node)";
60
+ if [ -z "$node_bin" ]; then
61
+ echo "未检测到 node,可执行 OpenClaw wrapper 创建失败。" >&2;
62
+ exit 1;
63
+ fi;
64
+ if [ ! -f "$pkg_entry" ]; then
65
+ echo "未找到 OpenClaw 入口文件: $pkg_entry" >&2;
66
+ exit 1;
67
+ fi;
68
+ printf '%s\n' '#!/bin/sh' "export OPENCLAW_HOME=\"$openclaw_home\"" "export HOME=\"$openclaw_home\"" "exec \"$node_bin\" \"$pkg_entry\" \"\$@\"" > "$wrapper";
69
+ chmod +x "$wrapper"
@@ -0,0 +1,37 @@
1
+ id: openclaw-container
2
+ name: OpenClaw Container
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ agentType: openclaw
7
+ description: "基于 openclaw-runtime 容器运行的 OpenClaw 网关"
8
+ singleInstance: false
9
+
10
+ tasks:
11
+ - name: gateway
12
+ role: service
13
+ runtime: container
14
+ image: "ghcr.io/x-aijishu/openclaw-runtime:latest"
15
+ args: ["gateway", "run", "--port", "18789", "--allow-unconfigured"]
16
+ env:
17
+ NODE_ENV: production
18
+ resources:
19
+ cpu: "1000m"
20
+ memory: "2024Mi"
21
+ ports:
22
+ - name: http
23
+ port: 18789
24
+ visibility: external
25
+ health:
26
+ http:
27
+ path: /health
28
+ port: 18789
29
+ interval: "15s"
30
+ timeout: "5s"
31
+ retries: 3
32
+ start_period: "30s"
33
+
34
+ provides:
35
+ - capability: "openclaw-dashboard"
36
+ port: 18789
37
+ description: "OpenClaw Dashboard"
@@ -0,0 +1,42 @@
1
+ id: openclaw-with-ollama-container
2
+ name: OpenClaw With Ollama
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ agentType: openclaw
7
+ description: "通过 requires 消费 ollama-api 能力,并将解析地址注入 OpenClaw 运行环境"
8
+ singleInstance: false
9
+
10
+ requires:
11
+ - capability: "ollama-api"
12
+ inject_as: OLLAMA_API_ADDR
13
+
14
+ tasks:
15
+ - name: gateway
16
+ role: service
17
+ runtime: container
18
+ image: "ghcr.io/x-aijishu/openclaw-runtime:latest"
19
+ args: ["gateway", "run", "--port", "18789", "--allow-unconfigured"]
20
+ env:
21
+ NODE_ENV: production
22
+ OLLAMA_BASE_URL: "http://${requires.OLLAMA_API_ADDR}"
23
+ resources:
24
+ cpu: "1000m"
25
+ memory: "1024Mi"
26
+ ports:
27
+ - name: http
28
+ port: 18789
29
+ visibility: external
30
+ health:
31
+ http:
32
+ path: /health
33
+ port: 18789
34
+ interval: "15s"
35
+ timeout: "5s"
36
+ retries: 3
37
+ start_period: "30s"
38
+
39
+ provides:
40
+ - capability: "openclaw-dashboard"
41
+ port: 18789
42
+ description: "OpenClaw Dashboard"
@@ -0,0 +1,136 @@
1
+ id: openclaw-with-searxng-container
2
+ name: OpenClaw With SearXNG Container
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ agentType: openclaw
7
+ description: "将 SearXNG 作为 sidecar 子 task 安装并运行,并注入 OpenClaw 搜索环境"
8
+ singleInstance: false
9
+
10
+ tasks:
11
+ - name: searxng
12
+ role: sidecar
13
+ runtime: container
14
+ image: "searxng/searxng:latest"
15
+ env:
16
+ SEARXNG_PORT: "8080"
17
+ SEARXNG_BASE_URL: "http://localhost:8080/"
18
+ FORCE_OWNERSHIP: "false"
19
+ resources:
20
+ cpu: "500m"
21
+ memory: "512Mi"
22
+ ports:
23
+ - name: http
24
+ port: 8080
25
+ visibility: internal
26
+ volumes:
27
+ - source: "~/.jishushell/apps/${app_id}/settings/settings.yml"
28
+ target: "/etc/searxng/settings.yml"
29
+ readonly: true
30
+ - source: "~/.jishushell/apps/${app_id}/settings/limiter.toml"
31
+ target: "/etc/searxng/limiter.toml"
32
+ readonly: true
33
+ health:
34
+ http:
35
+ path: /healthz
36
+ port: 8080
37
+ interval: "15s"
38
+ timeout: "5s"
39
+ retries: 3
40
+ start_period: "30s"
41
+
42
+ - name: gateway
43
+ role: service
44
+ runtime: container
45
+ image: "ghcr.io/x-aijishu/openclaw-runtime:latest"
46
+ args: ["gateway", "run", "--port", "18789", "--allow-unconfigured"]
47
+ env:
48
+ NODE_ENV: production
49
+ SEARCH_API_BASE_URL: "http://127.0.0.1:8080/search"
50
+ resources:
51
+ cpu: "1000m"
52
+ memory: "1024Mi"
53
+ ports:
54
+ - name: http
55
+ port: 18789
56
+ visibility: external
57
+ health:
58
+ http:
59
+ path: /health
60
+ port: 18789
61
+ interval: "15s"
62
+ timeout: "5s"
63
+ retries: 3
64
+ start_period: "30s"
65
+
66
+ provides:
67
+ - capability: "openclaw-dashboard"
68
+ port: 18789
69
+ description: "OpenClaw Dashboard"
70
+
71
+ lifecycle:
72
+ install:
73
+ - downloadImage: "searxng/searxng:latest"
74
+ - mkdir: "~/.jishushell/apps/${app_id}/settings"
75
+ - run: |
76
+ SETTINGS_DIR="$HOME/.jishushell/apps/${app_id}/settings"
77
+ SECRET_KEY="$(head -c 48 /dev/urandom | base64 | tr -dc 'A-Za-z0-9' | head -c 32)"
78
+
79
+ export SETTINGS_DIR SECRET_KEY
80
+ python3 <<'PY'
81
+ from pathlib import Path
82
+ import os
83
+ from textwrap import dedent
84
+
85
+ settings_dir = Path(os.environ["SETTINGS_DIR"])
86
+ secret = os.environ["SECRET_KEY"]
87
+
88
+ (settings_dir / "settings.yml").write_text(
89
+ dedent(
90
+ f'''
91
+ use_default_settings:
92
+ engines:
93
+ remove:
94
+ - ahmia
95
+ - torch
96
+ - wikidata
97
+ server:
98
+ secret_key: "{secret}"
99
+ port: 8080
100
+ bind_address: "0.0.0.0"
101
+ limiter: false
102
+ search:
103
+ formats:
104
+ - html
105
+ - json
106
+ '''
107
+ ).lstrip(),
108
+ encoding="utf-8",
109
+ )
110
+
111
+ (settings_dir / "limiter.toml").write_text(
112
+ dedent(
113
+ '''
114
+ [botdetection]
115
+ ipv4_prefix = 32
116
+ ipv6_prefix = 48
117
+ trusted_proxies = [
118
+ "127.0.0.0/8",
119
+ "::1",
120
+ ]
121
+
122
+ [botdetection.ip_limit]
123
+ filter_link_local = false
124
+ link_token = false
125
+
126
+ [botdetection.ip_lists]
127
+ block_ip = []
128
+ pass_ip = []
129
+ pass_searxng_org = true
130
+ '''
131
+ ).lstrip(),
132
+ encoding="utf-8",
133
+ )
134
+ PY
135
+
136
+ chmod 644 "$SETTINGS_DIR/settings.yml" "$SETTINGS_DIR/limiter.toml"
@@ -0,0 +1,53 @@
1
+ id: openwebui-container
2
+ name: Open WebUI
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ description: "使用 Open WebUI 提供自托管的大模型 Web 界面,容器模式由 Nomad 管理生命周期"
7
+ singleInstance: false
8
+
9
+ tasks:
10
+ - name: openwebui
11
+ role: service
12
+ runtime: container
13
+ image: "ghcr.io/open-webui/open-webui:main"
14
+ env:
15
+ HOME: "/app/backend/data"
16
+ PORT: "8080"
17
+ TMPDIR: "/app/backend/data/tmp"
18
+ XDG_CACHE_HOME: "/app/backend/data/.cache"
19
+ HF_HOME: "/app/backend/data/.cache/huggingface"
20
+ TRANSFORMERS_CACHE: "/app/backend/data/.cache/huggingface/transformers"
21
+ SENTENCE_TRANSFORMERS_HOME: "/app/backend/data/.cache/sentence-transformers"
22
+ resources:
23
+ cpu: "1000m"
24
+ memory: "1024Mi"
25
+ ports:
26
+ - name: http
27
+ port: 3000
28
+ container_port: 8080
29
+ visibility: external
30
+ volumes:
31
+ - source: "~/.jishushell/apps/${app_id}/data"
32
+ target: "/app/backend/data"
33
+ health:
34
+ http:
35
+ path: /
36
+ port: 8080
37
+ interval: "15s"
38
+ timeout: "5s"
39
+ retries: 6
40
+ start_period: "40s"
41
+
42
+ provides:
43
+ - capability: "openwebui-web"
44
+ port: 3000
45
+ protocol: "http"
46
+ description: "Open WebUI Web 界面"
47
+
48
+ lifecycle:
49
+ install:
50
+ - downloadImage: "ghcr.io/open-webui/open-webui:main"
51
+ - mkdir: "~/.jishushell/apps/${app_id}/data"
52
+ - mkdir: "~/.jishushell/apps/${app_id}/data/tmp"
53
+ - mkdir: "~/.jishushell/apps/${app_id}/data/.cache"
@@ -0,0 +1,120 @@
1
+ id: playwright-container
2
+ name: Playwright
3
+ version: "1.0.0"
4
+ jishushell:
5
+ min_version: "0.4.24"
6
+ description: "在容器中启动 Playwright UI,通过浏览器查看和管理测试运行"
7
+ singleInstance: false
8
+
9
+ tasks:
10
+ - name: playwright-ui
11
+ role: service
12
+ runtime: container
13
+ image: "mcr.microsoft.com/playwright:v1.55.0-noble"
14
+ env:
15
+ HOME: "/tmp/playwright-home"
16
+ NPM_CONFIG_CACHE: "/tmp/playwright-home/.npm"
17
+ command: /bin/sh
18
+ args:
19
+ - -lc
20
+ # 1. Stub xdg-open so playwright UI's auto-browser-open attempt doesn't
21
+ # throw "spawn xdg-open ENOENT" on a headless container (unhandled
22
+ # error kills the Node process before the UI server is reachable).
23
+ # 2. Invoke cli.js via `node` directly: `npx --no-install playwright`
24
+ # resolves to node_modules/.bin/playwright -> ../@playwright/test/cli.js,
25
+ # and a host-side `npm install --prefix` sometimes skips the +x bit
26
+ # on that target. Going through node sidesteps the exec-bit dance.
27
+ # 3. `--ui` makes the intent explicit; `--ui-host`/`--ui-port` alone
28
+ # leave behaviour at the mercy of playwright CLI detection.
29
+ - >-
30
+ ln -sf /bin/true /usr/local/bin/xdg-open 2>/dev/null;
31
+ cd /workspace &&
32
+ exec node ./node_modules/@playwright/test/cli.js test
33
+ --ui --ui-host=0.0.0.0 --ui-port=14567
34
+ resources:
35
+ cpu: "1000m"
36
+ memory: "1024Mi"
37
+ ports:
38
+ - name: http
39
+ port: 14567
40
+ visibility: external
41
+ volumes:
42
+ - source: "~/.jishushell/apps/${app_id}/workspace"
43
+ target: "/workspace"
44
+ health:
45
+ http:
46
+ path: /
47
+ port: 14567
48
+ interval: "15s"
49
+ timeout: "5s"
50
+ retries: 6
51
+ start_period: "30s"
52
+
53
+ provides:
54
+ - capability: "playwright-ui"
55
+ port: 14567
56
+ protocol: "http"
57
+ description: "Playwright UI Web 界面"
58
+
59
+ lifecycle:
60
+ install:
61
+ - downloadImage: "mcr.microsoft.com/playwright:v1.55.0-noble"
62
+ - mkdir: "~/.jishushell/apps/${app_id}/workspace"
63
+ - mkdir: "~/.jishushell/apps/${app_id}/workspace/tests"
64
+ - run: |
65
+ WORKSPACE="$HOME/.jishushell/apps/${app_id}/workspace"
66
+
67
+ if [ ! -f "$WORKSPACE/package.json" ]; then
68
+ cat > "$WORKSPACE/package.json" <<'EOF'
69
+ {
70
+ "name": "playwright-ui-workspace",
71
+ "private": true
72
+ }
73
+ EOF
74
+ fi
75
+
76
+ if [ ! -f "$WORKSPACE/playwright.config.ts" ]; then
77
+ cat > "$WORKSPACE/playwright.config.ts" <<'EOF'
78
+ import { defineConfig } from '@playwright/test';
79
+
80
+ export default defineConfig({
81
+ testDir: './tests',
82
+ use: {
83
+ headless: true,
84
+ },
85
+ });
86
+ EOF
87
+ fi
88
+
89
+ if [ ! -f "$WORKSPACE/tests/example.spec.ts" ]; then
90
+ cat > "$WORKSPACE/tests/example.spec.ts" <<'EOF'
91
+ import { test, expect } from '@playwright/test';
92
+
93
+ test('homepage smoke', async ({ page }) => {
94
+ await page.goto('https://example.com');
95
+ await expect(page).toHaveTitle(/Example Domain/);
96
+ });
97
+ EOF
98
+ fi
99
+ - run: |
100
+ WORKSPACE="$HOME/.jishushell/apps/${app_id}/workspace"
101
+ PLAYWRIGHT_HOME="/tmp/playwright-home"
102
+
103
+ if [ ! -d "$WORKSPACE/node_modules/@playwright/test" ]; then
104
+ mkdir -p "$PLAYWRIGHT_HOME"
105
+ export HOME="$PLAYWRIGHT_HOME"
106
+ export NPM_CONFIG_CACHE="$PLAYWRIGHT_HOME/.npm"
107
+ npm install --prefix "$WORKSPACE" @playwright/test
108
+ fi
109
+
110
+ # npm install --prefix on the host side occasionally leaves the
111
+ # playwright CLI targets without +x (the bin symlink exists, but
112
+ # kernel exec on the target file fails). Re-assert here so both
113
+ # `npx playwright` and the bin-direct path work.
114
+ for cli in \
115
+ "$WORKSPACE/node_modules/@playwright/test/cli.js" \
116
+ "$WORKSPACE/node_modules/playwright-core/cli.js" \
117
+ "$WORKSPACE/node_modules/playwright/cli.js"; do
118
+ [ -f "$cli" ] && chmod +x "$cli"
119
+ done
120
+ timeout_ms: 900000