jishushell 0.6.5 → 0.7.3

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 (1207) hide show
  1. package/apps/anythingllm-container.yaml +16 -170
  2. package/apps/browserless-chromium-container.yaml +16 -10
  3. package/apps/filebrowser-container.yaml +15 -9
  4. package/apps/hermes-container.yaml +20 -5
  5. package/apps/immich-container-lite.yaml +337 -0
  6. package/apps/immich-container.yaml +371 -0
  7. package/apps/jishu-kb-container.yaml +50 -177
  8. package/apps/ollama-binary.yaml +33 -28
  9. package/apps/ollama-cpu-container.yaml +6 -0
  10. package/apps/ollama-with-hollama-binary.yaml +35 -28
  11. package/apps/openclaw-binary.yaml +35 -15
  12. package/apps/openclaw-container.yaml +29 -11
  13. package/apps/openclaw-with-ollama-container.yaml +9 -2
  14. package/apps/openclaw-with-searxng-container.yaml +38 -6
  15. package/apps/searxng-container.yaml +31 -6
  16. package/apps/weknora-container.yaml +26 -21
  17. package/dependencies/jishushell-panel-0.7.3.tgz +0 -0
  18. package/dist/cli/app.js +244 -213
  19. package/dist/cli/app.js.map +1 -1
  20. package/dist/cli/backup.js +15 -12
  21. package/dist/cli/backup.js.map +1 -1
  22. package/dist/cli/core.d.ts +4 -3
  23. package/dist/cli/core.js +392 -227
  24. package/dist/cli/core.js.map +1 -1
  25. package/dist/cli/doctor.d.ts +1 -1
  26. package/dist/cli/doctor.js +113 -10
  27. package/dist/cli/doctor.js.map +1 -1
  28. package/dist/cli/job.js +62 -14
  29. package/dist/cli/job.js.map +1 -1
  30. package/dist/cli/llm.js +80 -11
  31. package/dist/cli/llm.js.map +1 -1
  32. package/dist/cli/managed-list.d.ts +1 -3
  33. package/dist/cli/managed-list.js +18 -16
  34. package/dist/cli/managed-list.js.map +1 -1
  35. package/dist/cli/migrate.d.ts +2 -0
  36. package/dist/cli/migrate.js +160 -0
  37. package/dist/cli/migrate.js.map +1 -0
  38. package/dist/cli.js +1 -0
  39. package/dist/cli.js.map +1 -1
  40. package/dist/config.d.ts +32 -20
  41. package/dist/config.js +132 -51
  42. package/dist/config.js.map +1 -1
  43. package/dist/control.d.ts +6 -6
  44. package/dist/control.js +31 -23
  45. package/dist/control.js.map +1 -1
  46. package/dist/core.d.ts +5 -5
  47. package/dist/core.js +5 -5
  48. package/dist/core.js.map +1 -1
  49. package/dist/install.d.ts +2 -2
  50. package/dist/install.js +78 -37
  51. package/dist/install.js.map +1 -1
  52. package/dist/routes/admin.d.ts +2 -0
  53. package/dist/routes/admin.js +72 -0
  54. package/dist/routes/admin.js.map +1 -0
  55. package/dist/routes/apps.d.ts +1 -1
  56. package/dist/routes/apps.js +101 -193
  57. package/dist/routes/apps.js.map +1 -1
  58. package/dist/routes/auth.js +1 -1
  59. package/dist/routes/auth.js.map +1 -1
  60. package/dist/routes/backup.js +1 -1
  61. package/dist/routes/backup.js.map +1 -1
  62. package/dist/routes/docker.d.ts +2 -0
  63. package/dist/routes/docker.js +58 -0
  64. package/dist/routes/docker.js.map +1 -0
  65. package/dist/routes/external-mounts.d.ts +1 -1
  66. package/dist/routes/external-mounts.js +1 -1
  67. package/dist/routes/external-mounts.js.map +1 -1
  68. package/dist/routes/file-mounts.d.ts +4 -3
  69. package/dist/routes/file-mounts.js +49 -31
  70. package/dist/routes/file-mounts.js.map +1 -1
  71. package/dist/routes/files-organize.d.ts +2 -2
  72. package/dist/routes/files-organize.js +5 -5
  73. package/dist/routes/files-organize.js.map +1 -1
  74. package/dist/routes/files.d.ts +1 -1
  75. package/dist/routes/files.js +1 -1
  76. package/dist/routes/files.js.map +1 -1
  77. package/dist/routes/instances.d.ts +0 -8
  78. package/dist/routes/instances.js +202 -1560
  79. package/dist/routes/instances.js.map +1 -1
  80. package/dist/routes/integration-apps.d.ts +14 -0
  81. package/dist/routes/integration-apps.js +81 -0
  82. package/dist/routes/integration-apps.js.map +1 -0
  83. package/dist/routes/integrations.d.ts +9 -0
  84. package/dist/routes/integrations.js +12 -0
  85. package/dist/routes/integrations.js.map +1 -0
  86. package/dist/routes/llm-proxy.js +26 -3
  87. package/dist/routes/llm-proxy.js.map +1 -1
  88. package/dist/routes/setup.js +53 -38
  89. package/dist/routes/setup.js.map +1 -1
  90. package/dist/routes/system.js +108 -68
  91. package/dist/routes/system.js.map +1 -1
  92. package/dist/routes/webdav.d.ts +1 -1
  93. package/dist/routes/webdav.js +2 -2
  94. package/dist/routes/webdav.js.map +1 -1
  95. package/dist/server.d.ts +6 -0
  96. package/dist/server.js +368 -233
  97. package/dist/server.js.map +1 -1
  98. package/dist/services/app-common/app-compiler.js +186 -0
  99. package/dist/services/app-common/app-compiler.js.map +1 -0
  100. package/dist/services/app-common/app-shared.d.ts +15 -0
  101. package/dist/services/app-common/app-shared.js +64 -0
  102. package/dist/services/app-common/app-shared.js.map +1 -0
  103. package/dist/services/app-common/capability-service.d.ts +45 -0
  104. package/dist/services/app-common/capability-service.js +331 -0
  105. package/dist/services/app-common/capability-service.js.map +1 -0
  106. package/dist/services/app-common/catalog-service.d.ts +59 -0
  107. package/dist/services/app-common/catalog-service.js +318 -0
  108. package/dist/services/app-common/catalog-service.js.map +1 -0
  109. package/dist/services/app-common/create-pipeline.d.ts +26 -0
  110. package/dist/services/app-common/create-pipeline.js +298 -0
  111. package/dist/services/app-common/create-pipeline.js.map +1 -0
  112. package/dist/services/app-common/delete-service.d.ts +5 -0
  113. package/dist/services/app-common/delete-service.js +109 -0
  114. package/dist/services/app-common/delete-service.js.map +1 -0
  115. package/dist/services/app-common/execution-owner.d.ts +23 -0
  116. package/dist/services/app-common/execution-owner.js +124 -0
  117. package/dist/services/app-common/execution-owner.js.map +1 -0
  118. package/dist/services/app-common/execution-service.d.ts +23 -0
  119. package/dist/services/app-common/execution-service.js +105 -0
  120. package/dist/services/app-common/execution-service.js.map +1 -0
  121. package/dist/services/app-common/id-normalizer.d.ts +31 -0
  122. package/dist/services/app-common/id-normalizer.js +83 -0
  123. package/dist/services/app-common/id-normalizer.js.map +1 -0
  124. package/dist/services/app-common/install-store.d.ts +34 -0
  125. package/dist/services/app-common/install-store.js +261 -0
  126. package/dist/services/app-common/install-store.js.map +1 -0
  127. package/dist/services/app-common/instance-store.d.ts +78 -0
  128. package/dist/services/app-common/instance-store.js +498 -0
  129. package/dist/services/app-common/instance-store.js.map +1 -0
  130. package/dist/services/app-common/integration-refs.d.ts +17 -0
  131. package/dist/services/app-common/integration-refs.js +47 -0
  132. package/dist/services/app-common/integration-refs.js.map +1 -0
  133. package/dist/services/app-common/lifecycle-pipeline.d.ts +62 -0
  134. package/dist/services/app-common/lifecycle-pipeline.js +317 -0
  135. package/dist/services/app-common/lifecycle-pipeline.js.map +1 -0
  136. package/dist/services/app-common/lifecycle-scripts.d.ts +38 -0
  137. package/dist/services/app-common/lifecycle-scripts.js +935 -0
  138. package/dist/services/app-common/lifecycle-scripts.js.map +1 -0
  139. package/dist/services/app-common/lifecycle-service.d.ts +68 -0
  140. package/dist/services/app-common/lifecycle-service.js +475 -0
  141. package/dist/services/app-common/lifecycle-service.js.map +1 -0
  142. package/dist/services/app-common/ownership.d.ts +3 -0
  143. package/dist/services/app-common/ownership.js +11 -0
  144. package/dist/services/app-common/ownership.js.map +1 -0
  145. package/dist/services/app-common/paths.d.ts +29 -0
  146. package/dist/services/app-common/paths.js +34 -0
  147. package/dist/services/app-common/paths.js.map +1 -0
  148. package/dist/services/app-common/platform-transform.d.ts +32 -0
  149. package/dist/services/app-common/platform-transform.js +65 -0
  150. package/dist/services/app-common/platform-transform.js.map +1 -0
  151. package/dist/services/app-common/provide-resolver.d.ts +29 -0
  152. package/dist/services/app-common/provide-resolver.js +129 -0
  153. package/dist/services/app-common/provide-resolver.js.map +1 -0
  154. package/dist/services/app-common/remote-spec.d.ts +14 -0
  155. package/dist/services/app-common/remote-spec.js +58 -0
  156. package/dist/services/app-common/remote-spec.js.map +1 -0
  157. package/dist/services/app-common/runtime-builder.d.ts +1 -0
  158. package/dist/services/app-common/runtime-builder.js +2 -0
  159. package/dist/services/app-common/runtime-builder.js.map +1 -0
  160. package/dist/services/app-common/runtime-facts.d.ts +19 -0
  161. package/dist/services/app-common/runtime-facts.js +128 -0
  162. package/dist/services/app-common/runtime-facts.js.map +1 -0
  163. package/dist/services/app-common/service.d.ts +9 -0
  164. package/dist/services/app-common/service.js +10 -0
  165. package/dist/services/app-common/service.js.map +1 -0
  166. package/dist/services/app-common/spec-materializer.d.ts +8 -0
  167. package/dist/services/app-common/spec-materializer.js +295 -0
  168. package/dist/services/app-common/spec-materializer.js.map +1 -0
  169. package/dist/services/app-common/status-refresh.d.ts +33 -0
  170. package/dist/services/app-common/status-refresh.js +771 -0
  171. package/dist/services/app-common/status-refresh.js.map +1 -0
  172. package/dist/services/app-common/task-service.d.ts +29 -0
  173. package/dist/services/app-common/task-service.js +93 -0
  174. package/dist/services/app-common/task-service.js.map +1 -0
  175. package/dist/services/app-common/terminal-session-manager.js +157 -0
  176. package/dist/services/app-common/terminal-session-manager.js.map +1 -0
  177. package/dist/services/app-modules/browserless/routes.d.ts +9 -0
  178. package/dist/services/app-modules/browserless/routes.js +519 -0
  179. package/dist/services/app-modules/browserless/routes.js.map +1 -0
  180. package/dist/services/app-modules/routes.d.ts +2 -0
  181. package/dist/services/app-modules/routes.js +5 -0
  182. package/dist/services/app-modules/routes.js.map +1 -0
  183. package/dist/services/backup/backup-admin.d.ts +95 -0
  184. package/dist/services/backup/backup-admin.js +246 -0
  185. package/dist/services/backup/backup-admin.js.map +1 -0
  186. package/dist/services/backup/backup-manager.d.ts +264 -0
  187. package/dist/services/backup/backup-manager.js +2318 -0
  188. package/dist/services/backup/backup-manager.js.map +1 -0
  189. package/dist/services/backup/backup-verify.js +240 -0
  190. package/dist/services/backup/backup-verify.js.map +1 -0
  191. package/dist/services/capabilities/browser-policy.d.ts +14 -0
  192. package/dist/services/capabilities/browser-policy.js +141 -0
  193. package/dist/services/capabilities/browser-policy.js.map +1 -0
  194. package/dist/services/capabilities/contract.d.ts +49 -0
  195. package/dist/services/capabilities/contract.js +119 -0
  196. package/dist/services/capabilities/contract.js.map +1 -0
  197. package/dist/services/capabilities/endpoint-validator.d.ts +42 -0
  198. package/dist/services/capabilities/endpoint-validator.js +113 -0
  199. package/dist/services/capabilities/endpoint-validator.js.map +1 -0
  200. package/dist/services/capabilities/health.d.ts +16 -0
  201. package/dist/services/capabilities/health.js +121 -0
  202. package/dist/services/capabilities/health.js.map +1 -0
  203. package/dist/services/capabilities/registry.d.ts +56 -0
  204. package/dist/services/capabilities/registry.js +222 -0
  205. package/dist/services/capabilities/registry.js.map +1 -0
  206. package/dist/services/capabilities/sync.d.ts +7 -0
  207. package/dist/services/capabilities/sync.js +223 -0
  208. package/dist/services/capabilities/sync.js.map +1 -0
  209. package/dist/services/capability-proxy/html-rewriters/browserless.d.ts +1 -0
  210. package/dist/services/capability-proxy/html-rewriters/browserless.js +83 -0
  211. package/dist/services/capability-proxy/html-rewriters/browserless.js.map +1 -0
  212. package/dist/services/capability-proxy/html-rewriters/index.d.ts +12 -0
  213. package/dist/services/capability-proxy/html-rewriters/index.js +25 -0
  214. package/dist/services/capability-proxy/html-rewriters/index.js.map +1 -0
  215. package/dist/services/capability-proxy/html-rewriters/jishukb.d.ts +1 -0
  216. package/dist/services/capability-proxy/html-rewriters/jishukb.js +161 -0
  217. package/dist/services/capability-proxy/html-rewriters/jishukb.js.map +1 -0
  218. package/dist/services/capability-proxy/http.d.ts +7 -0
  219. package/dist/services/capability-proxy/http.js +555 -0
  220. package/dist/services/capability-proxy/http.js.map +1 -0
  221. package/dist/services/capability-proxy/terminal.d.ts +4 -0
  222. package/dist/services/capability-proxy/terminal.js +179 -0
  223. package/dist/services/capability-proxy/terminal.js.map +1 -0
  224. package/dist/services/connections/admin.d.ts +80 -0
  225. package/dist/services/connections/admin.js +337 -0
  226. package/dist/services/connections/admin.js.map +1 -0
  227. package/dist/services/connections/apply.d.ts +104 -0
  228. package/dist/services/connections/apply.js +415 -0
  229. package/dist/services/connections/apply.js.map +1 -0
  230. package/dist/services/connections/resolver.d.ts +82 -0
  231. package/dist/services/connections/resolver.js +289 -0
  232. package/dist/services/connections/resolver.js.map +1 -0
  233. package/dist/services/connections/transactor.d.ts +39 -0
  234. package/dist/services/connections/transactor.js +307 -0
  235. package/dist/services/connections/transactor.js.map +1 -0
  236. package/dist/services/files/bootstrap.d.ts +7 -0
  237. package/dist/services/files/bootstrap.js +16 -0
  238. package/dist/services/files/bootstrap.js.map +1 -0
  239. package/dist/services/files/external-mounts.js +187 -0
  240. package/dist/services/files/external-mounts.js.map +1 -0
  241. package/dist/services/files/files-manager.d.ts +265 -0
  242. package/dist/services/files/files-manager.js +1189 -0
  243. package/dist/services/files/files-manager.js.map +1 -0
  244. package/dist/services/files/files-mounts.d.ts +42 -0
  245. package/dist/services/files/files-mounts.js +207 -0
  246. package/dist/services/files/files-mounts.js.map +1 -0
  247. package/dist/services/files/organize/applier.js +218 -0
  248. package/dist/services/files/organize/applier.js.map +1 -0
  249. package/dist/services/files/organize/rules.js +286 -0
  250. package/dist/services/files/organize/rules.js.map +1 -0
  251. package/dist/services/files/organize/scanner.js +366 -0
  252. package/dist/services/files/organize/scanner.js.map +1 -0
  253. package/dist/services/files/organize/store.js +82 -0
  254. package/dist/services/files/organize/store.js.map +1 -0
  255. package/dist/services/files/photos/upload-page.d.ts +2 -0
  256. package/dist/services/files/photos/upload-page.js +248 -0
  257. package/dist/services/files/photos/upload-page.js.map +1 -0
  258. package/dist/services/files/photos/upload-store.d.ts +74 -0
  259. package/dist/services/files/photos/upload-store.js +432 -0
  260. package/dist/services/files/photos/upload-store.js.map +1 -0
  261. package/dist/services/files/webdav/server.d.ts +47 -0
  262. package/dist/services/files/webdav/server.js +329 -0
  263. package/dist/services/files/webdav/server.js.map +1 -0
  264. package/dist/services/files/webdav/xml-builder.js.map +1 -0
  265. package/dist/services/http/proxy-utils.d.ts +7 -0
  266. package/dist/services/http/proxy-utils.js +29 -0
  267. package/dist/services/http/proxy-utils.js.map +1 -0
  268. package/dist/services/http/request-utils.d.ts +3 -0
  269. package/dist/services/http/request-utils.js +23 -0
  270. package/dist/services/http/request-utils.js.map +1 -0
  271. package/dist/services/instances/admin.d.ts +23 -0
  272. package/dist/services/instances/admin.js +218 -0
  273. package/dist/services/instances/admin.js.map +1 -0
  274. package/dist/services/instances/clone.d.ts +26 -0
  275. package/dist/services/instances/clone.js +78 -0
  276. package/dist/services/instances/clone.js.map +1 -0
  277. package/dist/services/instances/config-admin.d.ts +17 -0
  278. package/dist/services/instances/config-admin.js +181 -0
  279. package/dist/services/instances/config-admin.js.map +1 -0
  280. package/dist/services/instances/manager.d.ts +232 -0
  281. package/dist/services/instances/manager.js +1342 -0
  282. package/dist/services/instances/manager.js.map +1 -0
  283. package/dist/services/instances/pairing.d.ts +17 -0
  284. package/dist/services/instances/pairing.js +53 -0
  285. package/dist/services/instances/pairing.js.map +1 -0
  286. package/dist/services/instances/passwords.js +173 -0
  287. package/dist/services/instances/passwords.js.map +1 -0
  288. package/dist/services/instances/status.d.ts +2 -0
  289. package/dist/services/instances/status.js +11 -0
  290. package/dist/services/instances/status.js.map +1 -0
  291. package/dist/services/instances/types.d.ts +21 -0
  292. package/dist/services/instances/types.js +2 -0
  293. package/dist/services/instances/types.js.map +1 -0
  294. package/dist/services/integrations/anythingllm/integration.d.ts +25 -0
  295. package/dist/services/integrations/anythingllm/integration.js +251 -0
  296. package/dist/services/integrations/anythingllm/integration.js.map +1 -0
  297. package/dist/services/integrations/catalog.d.ts +3 -0
  298. package/dist/services/integrations/catalog.js +73 -0
  299. package/dist/services/integrations/catalog.js.map +1 -0
  300. package/dist/services/integrations/custom/integration.d.ts +28 -0
  301. package/dist/services/integrations/custom/integration.js +179 -0
  302. package/dist/services/integrations/custom/integration.js.map +1 -0
  303. package/dist/services/integrations/hermes/integration.d.ts +194 -0
  304. package/dist/services/integrations/hermes/integration.js +1668 -0
  305. package/dist/services/integrations/hermes/integration.js.map +1 -0
  306. package/dist/services/integrations/immich/client.d.ts +93 -0
  307. package/dist/services/integrations/immich/client.js +458 -0
  308. package/dist/services/integrations/immich/client.js.map +1 -0
  309. package/dist/services/integrations/immich/config.d.ts +15 -0
  310. package/dist/services/integrations/immich/config.js +178 -0
  311. package/dist/services/integrations/immich/config.js.map +1 -0
  312. package/dist/services/integrations/immich/discovery.d.ts +9 -0
  313. package/dist/services/integrations/immich/discovery.js +101 -0
  314. package/dist/services/integrations/immich/discovery.js.map +1 -0
  315. package/dist/services/integrations/immich/gallery-renderer.d.ts +5 -0
  316. package/dist/services/integrations/immich/gallery-renderer.js +150 -0
  317. package/dist/services/integrations/immich/gallery-renderer.js.map +1 -0
  318. package/dist/services/integrations/immich/immich-shim.d.ts +11 -0
  319. package/dist/services/integrations/immich/immich-shim.js +439 -0
  320. package/dist/services/integrations/immich/immich-shim.js.map +1 -0
  321. package/dist/services/integrations/immich/integration.d.ts +18 -0
  322. package/dist/services/integrations/immich/integration.js +64 -0
  323. package/dist/services/integrations/immich/integration.js.map +1 -0
  324. package/dist/services/integrations/immich/photo-library.d.ts +4 -0
  325. package/dist/services/integrations/immich/photo-library.js +63 -0
  326. package/dist/services/integrations/immich/photo-library.js.map +1 -0
  327. package/dist/services/integrations/immich/review-executor.d.ts +3 -0
  328. package/dist/services/integrations/immich/review-executor.js +41 -0
  329. package/dist/services/integrations/immich/review-executor.js.map +1 -0
  330. package/dist/services/integrations/immich/review-session-service.d.ts +27 -0
  331. package/dist/services/integrations/immich/review-session-service.js +206 -0
  332. package/dist/services/integrations/immich/review-session-service.js.map +1 -0
  333. package/dist/services/integrations/immich/review-store.d.ts +47 -0
  334. package/dist/services/integrations/immich/review-store.js +347 -0
  335. package/dist/services/integrations/immich/review-store.js.map +1 -0
  336. package/dist/services/integrations/immich/routes.d.ts +7 -0
  337. package/dist/services/integrations/immich/routes.js +363 -0
  338. package/dist/services/integrations/immich/routes.js.map +1 -0
  339. package/dist/services/integrations/immich/types.d.ts +186 -0
  340. package/dist/services/integrations/immich/types.js +2 -0
  341. package/dist/services/integrations/immich/types.js.map +1 -0
  342. package/dist/services/integrations/index.d.ts +41 -0
  343. package/dist/services/integrations/index.js +60 -0
  344. package/dist/services/integrations/index.js.map +1 -0
  345. package/dist/services/integrations/installable/catalog.d.ts +33 -0
  346. package/dist/services/integrations/installable/catalog.js +88 -0
  347. package/dist/services/integrations/installable/catalog.js.map +1 -0
  348. package/dist/services/integrations/installable/index.d.ts +35 -0
  349. package/dist/services/integrations/installable/index.js +170 -0
  350. package/dist/services/integrations/installable/index.js.map +1 -0
  351. package/dist/services/integrations/installable/installers/integration-probes.d.ts +50 -0
  352. package/dist/services/integrations/installable/installers/integration-probes.js +231 -0
  353. package/dist/services/integrations/installable/installers/integration-probes.js.map +1 -0
  354. package/dist/services/integrations/installable/installers/integration.d.ts +30 -0
  355. package/dist/services/integrations/installable/installers/integration.js +283 -0
  356. package/dist/services/integrations/installable/installers/integration.js.map +1 -0
  357. package/dist/services/integrations/installable/installers/registry-probe.js.map +1 -0
  358. package/dist/services/integrations/installable/installers/shell-script.d.ts +46 -0
  359. package/dist/services/integrations/installable/installers/shell-script.js +487 -0
  360. package/dist/services/integrations/installable/installers/shell-script.js.map +1 -0
  361. package/dist/services/integrations/installable/types.d.ts +130 -0
  362. package/dist/services/integrations/installable/types.js +19 -0
  363. package/dist/services/integrations/installable/types.js.map +1 -0
  364. package/dist/services/integrations/jishukb/integration.d.ts +24 -0
  365. package/dist/services/integrations/jishukb/integration.js +300 -0
  366. package/dist/services/integrations/jishukb/integration.js.map +1 -0
  367. package/dist/services/integrations/openclaw/anythingllm-shim.d.ts +46 -0
  368. package/dist/services/integrations/openclaw/anythingllm-shim.js +281 -0
  369. package/dist/services/integrations/openclaw/anythingllm-shim.js.map +1 -0
  370. package/dist/services/integrations/openclaw/drive-shim.js +490 -0
  371. package/dist/services/integrations/openclaw/drive-shim.js.map +1 -0
  372. package/dist/services/integrations/openclaw/integration.d.ts +438 -0
  373. package/dist/services/integrations/openclaw/integration.js +4629 -0
  374. package/dist/services/integrations/openclaw/integration.js.map +1 -0
  375. package/dist/services/integrations/openclaw/jishukb-native-mcp.d.ts +58 -0
  376. package/dist/services/integrations/openclaw/jishukb-native-mcp.js +373 -0
  377. package/dist/services/integrations/openclaw/jishukb-native-mcp.js.map +1 -0
  378. package/dist/services/integrations/openclaw/jishukb-shim.d.ts +52 -0
  379. package/dist/services/integrations/openclaw/jishukb-shim.js +1357 -0
  380. package/dist/services/integrations/openclaw/jishukb-shim.js.map +1 -0
  381. package/dist/services/integrations/openclaw/mcporter-lite.js +276 -0
  382. package/dist/services/integrations/openclaw/mcporter-lite.js.map +1 -0
  383. package/dist/services/integrations/openclaw/mcporter.d.ts +59 -0
  384. package/dist/services/integrations/openclaw/mcporter.js +143 -0
  385. package/dist/services/integrations/openclaw/mcporter.js.map +1 -0
  386. package/dist/services/integrations/openclaw/native-mcp.d.ts +48 -0
  387. package/dist/services/integrations/openclaw/native-mcp.js +125 -0
  388. package/dist/services/integrations/openclaw/native-mcp.js.map +1 -0
  389. package/dist/services/integrations/openclaw/routes.d.ts +21 -0
  390. package/dist/services/integrations/openclaw/routes.js +1194 -0
  391. package/dist/services/integrations/openclaw/routes.js.map +1 -0
  392. package/dist/services/integrations/registry.d.ts +17 -0
  393. package/dist/services/integrations/registry.js +36 -0
  394. package/dist/services/integrations/registry.js.map +1 -0
  395. package/dist/services/integrations/routes.d.ts +2 -0
  396. package/dist/services/integrations/routes.js +9 -0
  397. package/dist/services/integrations/routes.js.map +1 -0
  398. package/dist/services/integrations/types.d.ts +457 -0
  399. package/dist/services/integrations/types.js +2 -0
  400. package/dist/services/integrations/types.js.map +1 -0
  401. package/dist/services/legacy-migrator/classifier.d.ts +44 -0
  402. package/dist/services/legacy-migrator/classifier.js +309 -0
  403. package/dist/services/legacy-migrator/classifier.js.map +1 -0
  404. package/dist/services/legacy-migrator/executor.d.ts +42 -0
  405. package/dist/services/legacy-migrator/executor.js +637 -0
  406. package/dist/services/legacy-migrator/executor.js.map +1 -0
  407. package/dist/services/legacy-migrator/index.d.ts +31 -0
  408. package/dist/services/legacy-migrator/index.js +34 -0
  409. package/dist/services/legacy-migrator/index.js.map +1 -0
  410. package/dist/services/legacy-migrator/planner.d.ts +8 -0
  411. package/dist/services/legacy-migrator/planner.js +154 -0
  412. package/dist/services/legacy-migrator/planner.js.map +1 -0
  413. package/dist/services/legacy-migrator/provider-settings.d.ts +6 -0
  414. package/dist/services/legacy-migrator/provider-settings.js +72 -0
  415. package/dist/services/legacy-migrator/provider-settings.js.map +1 -0
  416. package/dist/services/legacy-migrator/report.d.ts +9 -0
  417. package/dist/services/legacy-migrator/report.js +99 -0
  418. package/dist/services/legacy-migrator/report.js.map +1 -0
  419. package/dist/services/legacy-migrator/scanner.d.ts +13 -0
  420. package/dist/services/legacy-migrator/scanner.js +157 -0
  421. package/dist/services/legacy-migrator/scanner.js.map +1 -0
  422. package/dist/services/legacy-migrator/types.d.ts +97 -0
  423. package/dist/services/legacy-migrator/types.js +23 -0
  424. package/dist/services/legacy-migrator/types.js.map +1 -0
  425. package/dist/services/llm-proxy/instance-proxy.d.ts +17 -1
  426. package/dist/services/llm-proxy/instance-proxy.js +171 -44
  427. package/dist/services/llm-proxy/instance-proxy.js.map +1 -1
  428. package/dist/services/llm-proxy/probe.js +5 -14
  429. package/dist/services/llm-proxy/probe.js.map +1 -1
  430. package/dist/services/llm-proxy/providers.js +23 -31
  431. package/dist/services/llm-proxy/providers.js.map +1 -1
  432. package/dist/services/llm-proxy/ssrf.d.ts +11 -4
  433. package/dist/services/llm-proxy/ssrf.js +45 -7
  434. package/dist/services/llm-proxy/ssrf.js.map +1 -1
  435. package/dist/services/llm-proxy/validate-key.js +16 -37
  436. package/dist/services/llm-proxy/validate-key.js.map +1 -1
  437. package/dist/services/repair/runtime-repair.d.ts +22 -0
  438. package/dist/services/repair/runtime-repair.js +374 -0
  439. package/dist/services/repair/runtime-repair.js.map +1 -0
  440. package/dist/services/runtime/docker-network.d.ts +8 -0
  441. package/dist/services/runtime/docker-network.js +123 -0
  442. package/dist/services/runtime/docker-network.js.map +1 -0
  443. package/dist/services/runtime/driver-registry.d.ts +25 -0
  444. package/dist/services/runtime/driver-registry.js +22 -0
  445. package/dist/services/runtime/driver-registry.js.map +1 -0
  446. package/dist/services/runtime/drivers/nomad.d.ts +261 -0
  447. package/dist/services/runtime/drivers/nomad.js +3122 -0
  448. package/dist/services/runtime/drivers/nomad.js.map +1 -0
  449. package/dist/services/runtime/errors.d.ts +3 -3
  450. package/dist/services/runtime/errors.js +3 -3
  451. package/dist/services/runtime/instance.d.ts +14 -16
  452. package/dist/services/runtime/instance.js +93 -123
  453. package/dist/services/runtime/instance.js.map +1 -1
  454. package/dist/services/runtime/job-id.d.ts +1 -1
  455. package/dist/services/runtime/job-id.js +1 -1
  456. package/dist/services/runtime/mcp-shims/firewall.d.ts +2 -2
  457. package/dist/services/runtime/mcp-shims/firewall.js +2 -2
  458. package/dist/services/runtime/mcp-shims/searxng-shim.d.ts +3 -5
  459. package/dist/services/runtime/mcp-shims/searxng-shim.js +3 -5
  460. package/dist/services/runtime/mcp-shims/searxng-shim.js.map +1 -1
  461. package/dist/services/runtime/mcp-shims/write-mcp-entry.d.ts +20 -20
  462. package/dist/services/runtime/mcp-shims/write-mcp-entry.js +16 -16
  463. package/dist/services/runtime/mcp-shims/write-mcp-entry.js.map +1 -1
  464. package/dist/services/runtime/ownership-marker.d.ts +83 -0
  465. package/dist/services/runtime/ownership-marker.js +109 -0
  466. package/dist/services/runtime/ownership-marker.js.map +1 -0
  467. package/dist/services/runtime/service-manager.d.ts +2 -0
  468. package/dist/services/runtime/service-manager.js +18 -0
  469. package/dist/services/runtime/service-manager.js.map +1 -0
  470. package/dist/services/runtime/types.d.ts +23 -501
  471. package/dist/services/runtime/types.js +0 -12
  472. package/dist/services/runtime/types.js.map +1 -1
  473. package/dist/services/runtime/workload-compiler.d.ts +17 -0
  474. package/dist/services/runtime/workload-compiler.js +550 -0
  475. package/dist/services/runtime/workload-compiler.js.map +1 -0
  476. package/dist/services/runtime/workload-types.d.ts +11 -0
  477. package/dist/services/runtime/workload-types.js +2 -0
  478. package/dist/services/runtime/workload-types.js.map +1 -0
  479. package/dist/services/setup/core-manager.d.ts +50 -0
  480. package/dist/services/setup/core-manager.js +456 -0
  481. package/dist/services/setup/core-manager.js.map +1 -0
  482. package/dist/services/setup/plugin-installer.js +136 -0
  483. package/dist/services/setup/plugin-installer.js.map +1 -0
  484. package/dist/services/setup/setup-manager.d.ts +158 -0
  485. package/dist/services/setup/setup-manager.js +2724 -0
  486. package/dist/services/setup/setup-manager.js.map +1 -0
  487. package/dist/services/system/cli-command.d.ts +5 -0
  488. package/dist/services/system/cli-command.js +18 -0
  489. package/dist/services/system/cli-command.js.map +1 -0
  490. package/dist/services/system/macos-launchd.js +312 -0
  491. package/dist/services/system/macos-launchd.js.map +1 -0
  492. package/dist/services/system/repair-orchestrator.d.ts +71 -0
  493. package/dist/services/system/repair-orchestrator.js +412 -0
  494. package/dist/services/system/repair-orchestrator.js.map +1 -0
  495. package/dist/services/system/runtime-ownership.d.ts +36 -0
  496. package/dist/services/system/runtime-ownership.js +250 -0
  497. package/dist/services/system/runtime-ownership.js.map +1 -0
  498. package/dist/services/system/system-monitor.js +96 -0
  499. package/dist/services/system/system-monitor.js.map +1 -0
  500. package/dist/services/system/system-ollama-provider.d.ts +14 -0
  501. package/dist/services/system/system-ollama-provider.js +129 -0
  502. package/dist/services/system/system-ollama-provider.js.map +1 -0
  503. package/dist/services/system/system-reconciler.d.ts +59 -0
  504. package/dist/services/system/system-reconciler.js +763 -0
  505. package/dist/services/system/system-reconciler.js.map +1 -0
  506. package/dist/services/system/update-manager.d.ts +43 -0
  507. package/dist/services/system/update-manager.js +315 -0
  508. package/dist/services/system/update-manager.js.map +1 -0
  509. package/dist/services/system/upgrade-finalize.d.ts +80 -0
  510. package/dist/services/system/upgrade-finalize.js +507 -0
  511. package/dist/services/system/upgrade-finalize.js.map +1 -0
  512. package/dist/services/tasks/registry.d.ts +44 -0
  513. package/dist/services/tasks/registry.js +90 -0
  514. package/dist/services/tasks/registry.js.map +1 -0
  515. package/dist/services/telemetry/activation.d.ts +6 -2
  516. package/dist/services/telemetry/activation.js +6 -2
  517. package/dist/services/telemetry/activation.js.map +1 -1
  518. package/dist/services/telemetry/heartbeat.d.ts +6 -2
  519. package/dist/services/telemetry/heartbeat.js +6 -2
  520. package/dist/services/telemetry/heartbeat.js.map +1 -1
  521. package/dist/services/workspaces/builder.d.ts +29 -0
  522. package/dist/services/workspaces/builder.js +186 -0
  523. package/dist/services/workspaces/builder.js.map +1 -0
  524. package/dist/types.d.ts +350 -48
  525. package/dist/utils/instance-lock.d.ts +2 -2
  526. package/dist/utils/instance-lock.js +2 -2
  527. package/dist/utils/path-safety.js +1 -1
  528. package/dist/utils/service-user.d.ts +13 -0
  529. package/dist/utils/service-user.js +129 -0
  530. package/dist/utils/service-user.js.map +1 -0
  531. package/install/jishu-install.sh +107 -27
  532. package/install/jishu-uninstall.sh +8 -0
  533. package/install/post-install.sh +162 -185
  534. package/install/post-uninstall.sh +6 -0
  535. package/node_modules/@fastify/static/.github/workflows/ci.yml +1 -1
  536. package/node_modules/@fastify/static/.github/workflows/lock-threads.yml +19 -0
  537. package/node_modules/@fastify/static/LICENSE +1 -3
  538. package/node_modules/@fastify/static/example/server-benchmark.js +39 -0
  539. package/node_modules/@fastify/static/index.js +169 -23
  540. package/node_modules/@fastify/static/lib/dirList.js +20 -6
  541. package/node_modules/@fastify/static/package.json +10 -8
  542. package/node_modules/@fastify/static/test/dir-list.test.js +82 -0
  543. package/node_modules/@fastify/static/test/static.test.js +326 -4
  544. package/node_modules/@fastify/static/types/index.d.ts +0 -4
  545. package/node_modules/@fastify/static/types/index.test-d.ts +1 -1
  546. package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
  547. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  548. package/node_modules/brace-expansion/dist/esm/index.js +24 -14
  549. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  550. package/node_modules/brace-expansion/package.json +2 -2
  551. package/node_modules/content-disposition/README.md +21 -22
  552. package/node_modules/content-disposition/index.js +122 -44
  553. package/node_modules/content-disposition/package.json +16 -20
  554. package/node_modules/fast-uri/index.js +1 -1
  555. package/node_modules/fast-uri/package.json +1 -1
  556. package/node_modules/fast-uri/test/security.test.js +28 -0
  557. package/node_modules/fastify/SECURITY.md +1 -1
  558. package/node_modules/fastify/SPONSORS.md +6 -4
  559. package/node_modules/fastify/docs/Guides/Database.md +0 -28
  560. package/node_modules/fastify/docs/Guides/Ecosystem.md +13 -2
  561. package/node_modules/fastify/docs/Guides/Serverless.md +2 -2
  562. package/node_modules/fastify/docs/Guides/Write-Plugin.md +1 -1
  563. package/node_modules/fastify/docs/Reference/Encapsulation.md +27 -26
  564. package/node_modules/fastify/docs/Reference/Errors.md +10 -4
  565. package/node_modules/fastify/docs/Reference/HTTP2.md +10 -10
  566. package/node_modules/fastify/docs/Reference/Hooks.md +4 -4
  567. package/node_modules/fastify/docs/Reference/Index.md +14 -16
  568. package/node_modules/fastify/docs/Reference/LTS.md +12 -13
  569. package/node_modules/fastify/docs/Reference/Lifecycle.md +9 -8
  570. package/node_modules/fastify/docs/Reference/Logging.md +44 -39
  571. package/node_modules/fastify/docs/Reference/Middleware.md +21 -25
  572. package/node_modules/fastify/docs/Reference/Principles.md +2 -2
  573. package/node_modules/fastify/docs/Reference/Reply.md +6 -1
  574. package/node_modules/fastify/docs/Reference/Request.md +27 -16
  575. package/node_modules/fastify/docs/Reference/Routes.md +5 -2
  576. package/node_modules/fastify/docs/Reference/Server.md +31 -3
  577. package/node_modules/fastify/docs/Reference/Type-Providers.md +29 -5
  578. package/node_modules/fastify/docs/Reference/Validation-and-Serialization.md +15 -2
  579. package/node_modules/fastify/docs/Reference/Warnings.md +7 -6
  580. package/node_modules/fastify/eslint.config.js +7 -2
  581. package/node_modules/fastify/fastify.d.ts +8 -3
  582. package/node_modules/fastify/fastify.js +43 -14
  583. package/node_modules/fastify/lib/content-type-parser.js +13 -1
  584. package/node_modules/fastify/lib/decorate.js +11 -3
  585. package/node_modules/fastify/lib/error-handler.js +4 -3
  586. package/node_modules/fastify/lib/error-serializer.js +59 -59
  587. package/node_modules/fastify/lib/errors.js +16 -1
  588. package/node_modules/fastify/lib/four-oh-four.js +14 -9
  589. package/node_modules/fastify/lib/handle-request.js +11 -5
  590. package/node_modules/fastify/lib/plugin-override.js +2 -1
  591. package/node_modules/fastify/lib/plugin-utils.js +5 -5
  592. package/node_modules/fastify/lib/reply.js +63 -8
  593. package/node_modules/fastify/lib/request.js +14 -4
  594. package/node_modules/fastify/lib/route.js +20 -6
  595. package/node_modules/fastify/lib/schema-controller.js +1 -1
  596. package/node_modules/fastify/lib/schemas.js +37 -30
  597. package/node_modules/fastify/lib/symbols.js +3 -1
  598. package/node_modules/fastify/lib/validation.js +1 -13
  599. package/node_modules/fastify/lib/warnings.js +3 -3
  600. package/node_modules/fastify/package.json +13 -15
  601. package/node_modules/fastify/scripts/validate-ecosystem-links.js +1 -0
  602. package/node_modules/fastify/test/bundler/esbuild/package.json +1 -1
  603. package/node_modules/fastify/test/close-pipelining.test.js +1 -2
  604. package/node_modules/fastify/test/custom-http-server.test.js +38 -0
  605. package/node_modules/fastify/test/decorator-instance-properties.test.js +63 -0
  606. package/node_modules/fastify/test/diagnostics-channel/async-error-handler.test.js +74 -0
  607. package/node_modules/fastify/test/hooks.test.js +23 -0
  608. package/node_modules/fastify/test/http-methods/get.test.js +1 -1
  609. package/node_modules/fastify/test/http2/plain.test.js +135 -0
  610. package/node_modules/fastify/test/http2/secure-with-fallback.test.js +1 -1
  611. package/node_modules/fastify/test/https/https.test.js +1 -2
  612. package/node_modules/fastify/test/internals/errors.test.js +31 -1
  613. package/node_modules/fastify/test/internals/plugin.test.js +3 -1
  614. package/node_modules/fastify/test/internals/request.test.js +27 -3
  615. package/node_modules/fastify/test/internals/schema-controller-perf.test.js +33 -0
  616. package/node_modules/fastify/test/logger/logging.test.js +18 -1
  617. package/node_modules/fastify/test/logger/options.test.js +38 -1
  618. package/node_modules/fastify/test/reply-error.test.js +1 -1
  619. package/node_modules/fastify/test/reply-trailers.test.js +70 -0
  620. package/node_modules/fastify/test/request-media-type.test.js +105 -0
  621. package/node_modules/fastify/test/route-prefix.test.js +34 -0
  622. package/node_modules/fastify/test/router-options.test.js +222 -11
  623. package/node_modules/fastify/test/schema-serialization.test.js +108 -0
  624. package/node_modules/fastify/test/schema-validation.test.js +24 -0
  625. package/node_modules/fastify/test/scripts/validate-ecosystem-links.test.js +40 -57
  626. package/node_modules/fastify/test/throw.test.js +14 -0
  627. package/node_modules/fastify/test/trust-proxy.test.js +21 -0
  628. package/node_modules/fastify/test/types/content-type-parser.tst.ts +70 -0
  629. package/node_modules/fastify/test/types/decorate-request-reply.tst.ts +18 -0
  630. package/node_modules/fastify/test/types/dummy-plugin.mts +9 -0
  631. package/node_modules/fastify/test/types/errors.tst.ts +91 -0
  632. package/node_modules/fastify/test/types/fastify.tst.ts +351 -0
  633. package/node_modules/fastify/test/types/hooks.tst.ts +578 -0
  634. package/node_modules/fastify/test/types/instance.tst.ts +597 -0
  635. package/node_modules/fastify/test/types/logger.tst.ts +276 -0
  636. package/node_modules/fastify/test/types/plugin.tst.ts +96 -0
  637. package/node_modules/fastify/test/types/register.tst.ts +245 -0
  638. package/node_modules/fastify/test/types/reply.tst.ts +297 -0
  639. package/node_modules/fastify/test/types/request.tst.ts +199 -0
  640. package/node_modules/fastify/test/types/route.tst.ts +576 -0
  641. package/node_modules/fastify/test/types/schema.tst.ts +135 -0
  642. package/node_modules/fastify/test/types/serverFactory.tst.ts +37 -0
  643. package/node_modules/fastify/test/types/tsconfig.json +9 -0
  644. package/node_modules/fastify/test/types/type-provider.tst.ts +1219 -0
  645. package/node_modules/fastify/test/types/using.tst.ts +14 -0
  646. package/node_modules/fastify/types/errors.d.ts +3 -0
  647. package/node_modules/fastify/types/request.d.ts +23 -2
  648. package/node_modules/glob/README.md +39 -130
  649. package/node_modules/glob/dist/commonjs/glob.d.ts +8 -0
  650. package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -1
  651. package/node_modules/glob/dist/commonjs/glob.js +2 -1
  652. package/node_modules/glob/dist/commonjs/glob.js.map +1 -1
  653. package/node_modules/glob/dist/commonjs/index.min.js +4 -0
  654. package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
  655. package/node_modules/glob/dist/commonjs/pattern.d.ts +3 -0
  656. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -1
  657. package/node_modules/glob/dist/commonjs/pattern.js +4 -0
  658. package/node_modules/glob/dist/commonjs/pattern.js.map +1 -1
  659. package/node_modules/glob/dist/esm/glob.d.ts +8 -0
  660. package/node_modules/glob/dist/esm/glob.d.ts.map +1 -1
  661. package/node_modules/glob/dist/esm/glob.js +2 -1
  662. package/node_modules/glob/dist/esm/glob.js.map +1 -1
  663. package/node_modules/glob/dist/esm/index.min.js +4 -0
  664. package/node_modules/glob/dist/esm/index.min.js.map +7 -0
  665. package/node_modules/glob/dist/esm/pattern.d.ts +3 -0
  666. package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -1
  667. package/node_modules/glob/dist/esm/pattern.js +4 -0
  668. package/node_modules/glob/dist/esm/pattern.js.map +1 -1
  669. package/node_modules/glob/package.json +38 -37
  670. package/node_modules/jishushell-panel/README.md +4 -4
  671. package/node_modules/jishushell-panel/output/dist/server.js +17 -6
  672. package/node_modules/jishushell-panel/output/dist/server.js.map +1 -1
  673. package/node_modules/jishushell-panel/output/public/assets/ApiKeyField-Ce5d1xna.js +1 -0
  674. package/node_modules/jishushell-panel/output/public/assets/Dashboard-BXame3yg.js +1 -0
  675. package/node_modules/jishushell-panel/output/public/assets/HermesChatPanel-BHZtPCJd.js +1 -0
  676. package/node_modules/jishushell-panel/output/public/assets/HermesConfigForm-CB3GbNX9.js +4 -0
  677. package/node_modules/jishushell-panel/output/public/assets/InitPassword-Boab9F6g.js +1 -0
  678. package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-DrIWCqo-.js +14 -0
  679. package/node_modules/jishushell-panel/output/public/assets/Login-CzpOkNau.js +1 -0
  680. package/node_modules/jishushell-panel/output/public/assets/NewInstance-CANXyCcL.js +1 -0
  681. package/node_modules/jishushell-panel/output/public/assets/ProviderRecommendations-BABo9VOC.js +1 -0
  682. package/node_modules/jishushell-panel/output/public/assets/Settings-CKp5XxFh.js +1 -0
  683. package/node_modules/jishushell-panel/output/public/assets/Setup-C7xVDPow.js +1 -0
  684. package/node_modules/jishushell-panel/output/public/assets/WeixinLoginPanel-B765Xz4C.js +1 -0
  685. package/node_modules/jishushell-panel/output/public/assets/api-C70Gt678.js +4 -0
  686. package/node_modules/jishushell-panel/output/public/assets/index-Bs6DSbiR.js +23 -0
  687. package/node_modules/jishushell-panel/output/public/assets/index-DnnqTf7s.css +1 -0
  688. package/node_modules/jishushell-panel/output/public/assets/registry-sWIZsIEF.js +2 -0
  689. package/node_modules/jishushell-panel/output/public/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  690. package/node_modules/jishushell-panel/output/public/assets/setup-task-q21GnI0E.js +1 -0
  691. package/node_modules/jishushell-panel/output/public/assets/usePolling-D4IDOQd_.js +1 -0
  692. package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-Df8aUdv8.js +1 -0
  693. package/node_modules/jishushell-panel/output/public/assets/vendor-react-0L0rjmYG.js +8 -0
  694. package/node_modules/jishushell-panel/output/public/index.html +6 -4
  695. package/node_modules/jishushell-panel/package.json +2 -2
  696. package/node_modules/semver/classes/range.js +17 -4
  697. package/node_modules/semver/package.json +2 -2
  698. package/package.json +12 -64
  699. package/scripts/check-app-path-boundaries.mjs +121 -0
  700. package/scripts/check-app-spec.mjs +123 -29
  701. package/scripts/check-architecture-boundaries.mjs +178 -0
  702. package/scripts/check-colima-launchd.mjs +10 -8
  703. package/scripts/check-integration-isolation.ts +541 -0
  704. package/scripts/check-new-file-tests.mjs +11 -3
  705. package/scripts/check-open-core-boundaries.mjs +60 -10
  706. package/scripts/check-test-layering.sh +1 -1
  707. package/scripts/fixtures/instances/hermes-sample/instance.json +3 -2
  708. package/scripts/fixtures/instances/legacy-openclaw-sample/instance.json +1 -1
  709. package/scripts/local-web-upgrade-test.README +4 -3
  710. package/scripts/local-web-upgrade-test.example.env +2 -2
  711. package/scripts/local-web-upgrade-test.sh +14 -1
  712. package/scripts/pack-gui-and-send-pi.sh +43 -0
  713. package/scripts/perf/instances.js +1 -1
  714. package/scripts/prune-open-core-dist.mjs +89 -2
  715. package/scripts/smoke/hermes-bootstrap.sh +5 -5
  716. package/templates/hermes-entrypoint.sh +19 -29
  717. package/apps/openwebui-container.yaml +0 -97
  718. package/apps/playwright-container.yaml +0 -126
  719. package/dependencies/jishushell-panel-0.6.5.tgz +0 -0
  720. package/dist/crypto-shim.d.ts +0 -1
  721. package/dist/crypto-shim.js +0 -2
  722. package/dist/crypto-shim.js.map +0 -1
  723. package/dist/routes/agent-apps.d.ts +0 -14
  724. package/dist/routes/agent-apps.js +0 -77
  725. package/dist/routes/agent-apps.js.map +0 -1
  726. package/dist/routes/internal.d.ts +0 -2
  727. package/dist/routes/internal.js +0 -55
  728. package/dist/routes/internal.js.map +0 -1
  729. package/dist/routes/openclaw-routes.d.ts +0 -22
  730. package/dist/routes/openclaw-routes.js +0 -1020
  731. package/dist/routes/openclaw-routes.js.map +0 -1
  732. package/dist/routes/runtime.d.ts +0 -15
  733. package/dist/routes/runtime.js +0 -76
  734. package/dist/routes/runtime.js.map +0 -1
  735. package/dist/services/agent-apps/catalog.d.ts +0 -33
  736. package/dist/services/agent-apps/catalog.js +0 -88
  737. package/dist/services/agent-apps/catalog.js.map +0 -1
  738. package/dist/services/agent-apps/index.d.ts +0 -36
  739. package/dist/services/agent-apps/index.js +0 -171
  740. package/dist/services/agent-apps/index.js.map +0 -1
  741. package/dist/services/agent-apps/installers/adapter-probes.d.ts +0 -49
  742. package/dist/services/agent-apps/installers/adapter-probes.js +0 -230
  743. package/dist/services/agent-apps/installers/adapter-probes.js.map +0 -1
  744. package/dist/services/agent-apps/installers/adapter.d.ts +0 -30
  745. package/dist/services/agent-apps/installers/adapter.js +0 -171
  746. package/dist/services/agent-apps/installers/adapter.js.map +0 -1
  747. package/dist/services/agent-apps/installers/registry-probe.js.map +0 -1
  748. package/dist/services/agent-apps/installers/shell-script.d.ts +0 -47
  749. package/dist/services/agent-apps/installers/shell-script.js +0 -488
  750. package/dist/services/agent-apps/installers/shell-script.js.map +0 -1
  751. package/dist/services/agent-apps/types.d.ts +0 -128
  752. package/dist/services/agent-apps/types.js +0 -17
  753. package/dist/services/agent-apps/types.js.map +0 -1
  754. package/dist/services/app/app-compiler.js +0 -185
  755. package/dist/services/app/app-compiler.js.map +0 -1
  756. package/dist/services/app/app-manager.d.ts +0 -184
  757. package/dist/services/app/app-manager.js +0 -2933
  758. package/dist/services/app/app-manager.js.map +0 -1
  759. package/dist/services/app/custom-manager.d.ts +0 -27
  760. package/dist/services/app/custom-manager.js +0 -382
  761. package/dist/services/app/custom-manager.js.map +0 -1
  762. package/dist/services/app/hermes-agent-manager.d.ts +0 -20
  763. package/dist/services/app/hermes-agent-manager.js +0 -299
  764. package/dist/services/app/hermes-agent-manager.js.map +0 -1
  765. package/dist/services/app/id-normalizer.d.ts +0 -27
  766. package/dist/services/app/id-normalizer.js +0 -77
  767. package/dist/services/app/id-normalizer.js.map +0 -1
  768. package/dist/services/app/ollama-manager.d.ts +0 -18
  769. package/dist/services/app/ollama-manager.js +0 -224
  770. package/dist/services/app/ollama-manager.js.map +0 -1
  771. package/dist/services/app/openclaw-manager.d.ts +0 -63
  772. package/dist/services/app/openclaw-manager.js +0 -1215
  773. package/dist/services/app/openclaw-manager.js.map +0 -1
  774. package/dist/services/app/paths.d.ts +0 -27
  775. package/dist/services/app/paths.js +0 -40
  776. package/dist/services/app/paths.js.map +0 -1
  777. package/dist/services/app/platform-transform.d.ts +0 -32
  778. package/dist/services/app/platform-transform.js +0 -65
  779. package/dist/services/app/platform-transform.js.map +0 -1
  780. package/dist/services/app/provide-resolver.d.ts +0 -29
  781. package/dist/services/app/provide-resolver.js +0 -135
  782. package/dist/services/app/provide-resolver.js.map +0 -1
  783. package/dist/services/app/registry.d.ts +0 -17
  784. package/dist/services/app/registry.js +0 -31
  785. package/dist/services/app/registry.js.map +0 -1
  786. package/dist/services/app/remote-spec.d.ts +0 -14
  787. package/dist/services/app/remote-spec.js +0 -58
  788. package/dist/services/app/remote-spec.js.map +0 -1
  789. package/dist/services/app/terminal-session-manager.js +0 -157
  790. package/dist/services/app/terminal-session-manager.js.map +0 -1
  791. package/dist/services/app/types.d.ts +0 -74
  792. package/dist/services/app/types.js +0 -16
  793. package/dist/services/app/types.js.map +0 -1
  794. package/dist/services/app-config-admin.d.ts +0 -17
  795. package/dist/services/app-config-admin.js +0 -177
  796. package/dist/services/app-config-admin.js.map +0 -1
  797. package/dist/services/app-create-from-installed.d.ts +0 -23
  798. package/dist/services/app-create-from-installed.js +0 -75
  799. package/dist/services/app-create-from-installed.js.map +0 -1
  800. package/dist/services/app-passwords.js +0 -173
  801. package/dist/services/app-passwords.js.map +0 -1
  802. package/dist/services/backup-admin.d.ts +0 -101
  803. package/dist/services/backup-admin.js +0 -259
  804. package/dist/services/backup-admin.js.map +0 -1
  805. package/dist/services/backup-manager.d.ts +0 -264
  806. package/dist/services/backup-manager.js +0 -2263
  807. package/dist/services/backup-manager.js.map +0 -1
  808. package/dist/services/backup-verify.js +0 -240
  809. package/dist/services/backup-verify.js.map +0 -1
  810. package/dist/services/capability-endpoint-validator.d.ts +0 -41
  811. package/dist/services/capability-endpoint-validator.js +0 -114
  812. package/dist/services/capability-endpoint-validator.js.map +0 -1
  813. package/dist/services/capability-health.d.ts +0 -16
  814. package/dist/services/capability-health.js +0 -121
  815. package/dist/services/capability-health.js.map +0 -1
  816. package/dist/services/capability-registry.d.ts +0 -29
  817. package/dist/services/capability-registry.js +0 -176
  818. package/dist/services/capability-registry.js.map +0 -1
  819. package/dist/services/capability-sync.d.ts +0 -4
  820. package/dist/services/capability-sync.js +0 -220
  821. package/dist/services/capability-sync.js.map +0 -1
  822. package/dist/services/connection-admin.d.ts +0 -74
  823. package/dist/services/connection-admin.js +0 -287
  824. package/dist/services/connection-admin.js.map +0 -1
  825. package/dist/services/connection-apply.d.ts +0 -91
  826. package/dist/services/connection-apply.js +0 -471
  827. package/dist/services/connection-apply.js.map +0 -1
  828. package/dist/services/connection-resolver.d.ts +0 -65
  829. package/dist/services/connection-resolver.js +0 -281
  830. package/dist/services/connection-resolver.js.map +0 -1
  831. package/dist/services/connection-transactor.d.ts +0 -39
  832. package/dist/services/connection-transactor.js +0 -354
  833. package/dist/services/connection-transactor.js.map +0 -1
  834. package/dist/services/core-manager.d.ts +0 -50
  835. package/dist/services/core-manager.js +0 -411
  836. package/dist/services/core-manager.js.map +0 -1
  837. package/dist/services/external-mounts.js +0 -187
  838. package/dist/services/external-mounts.js.map +0 -1
  839. package/dist/services/files-manager.d.ts +0 -252
  840. package/dist/services/files-manager.js +0 -1156
  841. package/dist/services/files-manager.js.map +0 -1
  842. package/dist/services/files-mounts.d.ts +0 -42
  843. package/dist/services/files-mounts.js +0 -207
  844. package/dist/services/files-mounts.js.map +0 -1
  845. package/dist/services/instance-admin.d.ts +0 -26
  846. package/dist/services/instance-admin.js +0 -218
  847. package/dist/services/instance-admin.js.map +0 -1
  848. package/dist/services/instance-manager.d.ts +0 -192
  849. package/dist/services/instance-manager.js +0 -1289
  850. package/dist/services/instance-manager.js.map +0 -1
  851. package/dist/services/macos-launchd.js +0 -312
  852. package/dist/services/macos-launchd.js.map +0 -1
  853. package/dist/services/nomad-manager.d.ts +0 -307
  854. package/dist/services/nomad-manager.js +0 -3958
  855. package/dist/services/nomad-manager.js.map +0 -1
  856. package/dist/services/organize/applier.js +0 -218
  857. package/dist/services/organize/applier.js.map +0 -1
  858. package/dist/services/organize/rules.js +0 -286
  859. package/dist/services/organize/rules.js.map +0 -1
  860. package/dist/services/organize/scanner.js +0 -366
  861. package/dist/services/organize/scanner.js.map +0 -1
  862. package/dist/services/organize/store.js +0 -82
  863. package/dist/services/organize/store.js.map +0 -1
  864. package/dist/services/plugin-installer.js +0 -128
  865. package/dist/services/plugin-installer.js.map +0 -1
  866. package/dist/services/process-manager.d.ts +0 -25
  867. package/dist/services/process-manager.js +0 -568
  868. package/dist/services/process-manager.js.map +0 -1
  869. package/dist/services/runtime/adapters/custom.d.ts +0 -20
  870. package/dist/services/runtime/adapters/custom.js +0 -188
  871. package/dist/services/runtime/adapters/custom.js.map +0 -1
  872. package/dist/services/runtime/adapters/hermes.d.ts +0 -204
  873. package/dist/services/runtime/adapters/hermes.js +0 -1684
  874. package/dist/services/runtime/adapters/hermes.js.map +0 -1
  875. package/dist/services/runtime/adapters/openclaw-mcporter.d.ts +0 -45
  876. package/dist/services/runtime/adapters/openclaw-mcporter.js +0 -108
  877. package/dist/services/runtime/adapters/openclaw-mcporter.js.map +0 -1
  878. package/dist/services/runtime/adapters/openclaw.d.ts +0 -426
  879. package/dist/services/runtime/adapters/openclaw.js +0 -3975
  880. package/dist/services/runtime/adapters/openclaw.js.map +0 -1
  881. package/dist/services/runtime/index.d.ts +0 -34
  882. package/dist/services/runtime/index.js +0 -51
  883. package/dist/services/runtime/index.js.map +0 -1
  884. package/dist/services/runtime/mcp-shims/anythingllm-shim.d.ts +0 -46
  885. package/dist/services/runtime/mcp-shims/anythingllm-shim.js +0 -281
  886. package/dist/services/runtime/mcp-shims/anythingllm-shim.js.map +0 -1
  887. package/dist/services/runtime/mcp-shims/drive-shim.js +0 -490
  888. package/dist/services/runtime/mcp-shims/drive-shim.js.map +0 -1
  889. package/dist/services/runtime/mcp-shims/jishukb-shim.d.ts +0 -48
  890. package/dist/services/runtime/mcp-shims/jishukb-shim.js +0 -723
  891. package/dist/services/runtime/mcp-shims/jishukb-shim.js.map +0 -1
  892. package/dist/services/runtime/mcp-shims/mcporter-lite.js +0 -276
  893. package/dist/services/runtime/mcp-shims/mcporter-lite.js.map +0 -1
  894. package/dist/services/runtime/migrations.d.ts +0 -23
  895. package/dist/services/runtime/migrations.js +0 -125
  896. package/dist/services/runtime/migrations.js.map +0 -1
  897. package/dist/services/runtime/registry.d.ts +0 -13
  898. package/dist/services/runtime/registry.js +0 -32
  899. package/dist/services/runtime/registry.js.map +0 -1
  900. package/dist/services/runtime-identity.d.ts +0 -13
  901. package/dist/services/runtime-identity.js +0 -166
  902. package/dist/services/runtime-identity.js.map +0 -1
  903. package/dist/services/runtime-repair.d.ts +0 -52
  904. package/dist/services/runtime-repair.js +0 -352
  905. package/dist/services/runtime-repair.js.map +0 -1
  906. package/dist/services/setup-manager.d.ts +0 -158
  907. package/dist/services/setup-manager.js +0 -2740
  908. package/dist/services/setup-manager.js.map +0 -1
  909. package/dist/services/suggestions.d.ts +0 -27
  910. package/dist/services/suggestions.js +0 -133
  911. package/dist/services/suggestions.js.map +0 -1
  912. package/dist/services/system-monitor.js +0 -79
  913. package/dist/services/system-monitor.js.map +0 -1
  914. package/dist/services/system-ollama-provider.d.ts +0 -14
  915. package/dist/services/system-ollama-provider.js +0 -125
  916. package/dist/services/system-ollama-provider.js.map +0 -1
  917. package/dist/services/system-reconciler.d.ts +0 -72
  918. package/dist/services/system-reconciler.js +0 -600
  919. package/dist/services/system-reconciler.js.map +0 -1
  920. package/dist/services/task-registry.d.ts +0 -44
  921. package/dist/services/task-registry.js +0 -76
  922. package/dist/services/task-registry.js.map +0 -1
  923. package/dist/services/types-shim.d.ts +0 -16
  924. package/dist/services/types-shim.js +0 -2
  925. package/dist/services/types-shim.js.map +0 -1
  926. package/dist/services/update-manager.d.ts +0 -47
  927. package/dist/services/update-manager.js +0 -351
  928. package/dist/services/update-manager.js.map +0 -1
  929. package/dist/services/webdav/server.d.ts +0 -24
  930. package/dist/services/webdav/server.js +0 -420
  931. package/dist/services/webdav/server.js.map +0 -1
  932. package/dist/services/webdav/xml-builder.js.map +0 -1
  933. package/dist/services/workspace-builder.d.ts +0 -29
  934. package/dist/services/workspace-builder.js +0 -188
  935. package/dist/services/workspace-builder.js.map +0 -1
  936. package/node_modules/@fastify/static/.github/stale.yml +0 -21
  937. package/node_modules/@isaacs/cliui/LICENSE.md +0 -63
  938. package/node_modules/@isaacs/cliui/README.md +0 -151
  939. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts +0 -4
  940. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map +0 -1
  941. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +0 -16
  942. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map +0 -1
  943. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts +0 -34
  944. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map +0 -1
  945. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +0 -170
  946. package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map +0 -1
  947. package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts +0 -6
  948. package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map +0 -1
  949. package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +0 -307
  950. package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map +0 -1
  951. package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts +0 -2
  952. package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map +0 -1
  953. package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +0 -7
  954. package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map +0 -1
  955. package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts +0 -41
  956. package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map +0 -1
  957. package/node_modules/@isaacs/cliui/dist/commonjs/index.js +0 -322
  958. package/node_modules/@isaacs/cliui/dist/commonjs/index.js.map +0 -1
  959. package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +0 -12
  960. package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map +0 -7
  961. package/node_modules/@isaacs/cliui/dist/commonjs/package.json +0 -3
  962. package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts +0 -5
  963. package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map +0 -1
  964. package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +0 -49
  965. package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map +0 -1
  966. package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts +0 -2
  967. package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map +0 -1
  968. package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +0 -8
  969. package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map +0 -1
  970. package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts +0 -7
  971. package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map +0 -1
  972. package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +0 -176
  973. package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map +0 -1
  974. package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts +0 -4
  975. package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map +0 -1
  976. package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +0 -12
  977. package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map +0 -1
  978. package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts +0 -34
  979. package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map +0 -1
  980. package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +0 -167
  981. package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map +0 -1
  982. package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts +0 -6
  983. package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map +0 -1
  984. package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +0 -299
  985. package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map +0 -1
  986. package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts +0 -2
  987. package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map +0 -1
  988. package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +0 -3
  989. package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map +0 -1
  990. package/node_modules/@isaacs/cliui/dist/esm/index.d.ts +0 -41
  991. package/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map +0 -1
  992. package/node_modules/@isaacs/cliui/dist/esm/index.js +0 -317
  993. package/node_modules/@isaacs/cliui/dist/esm/index.js.map +0 -1
  994. package/node_modules/@isaacs/cliui/dist/esm/index.min.js +0 -12
  995. package/node_modules/@isaacs/cliui/dist/esm/index.min.js.map +0 -7
  996. package/node_modules/@isaacs/cliui/dist/esm/package.json +0 -3
  997. package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts +0 -5
  998. package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map +0 -1
  999. package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +0 -46
  1000. package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map +0 -1
  1001. package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts +0 -2
  1002. package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map +0 -1
  1003. package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +0 -4
  1004. package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map +0 -1
  1005. package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts +0 -7
  1006. package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map +0 -1
  1007. package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +0 -172
  1008. package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map +0 -1
  1009. package/node_modules/@isaacs/cliui/package.json +0 -163
  1010. package/node_modules/content-disposition/HISTORY.md +0 -60
  1011. package/node_modules/cross-spawn/LICENSE +0 -21
  1012. package/node_modules/cross-spawn/README.md +0 -89
  1013. package/node_modules/cross-spawn/index.js +0 -39
  1014. package/node_modules/cross-spawn/lib/enoent.js +0 -59
  1015. package/node_modules/cross-spawn/lib/parse.js +0 -91
  1016. package/node_modules/cross-spawn/lib/util/escape.js +0 -47
  1017. package/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  1018. package/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  1019. package/node_modules/cross-spawn/package.json +0 -73
  1020. package/node_modules/fastify/test/types/content-type-parser.test-d.ts +0 -72
  1021. package/node_modules/fastify/test/types/decorate-request-reply.test-d.ts +0 -18
  1022. package/node_modules/fastify/test/types/dummy-plugin.ts +0 -9
  1023. package/node_modules/fastify/test/types/errors.test-d.ts +0 -90
  1024. package/node_modules/fastify/test/types/fastify.test-d.ts +0 -352
  1025. package/node_modules/fastify/test/types/hooks.test-d.ts +0 -550
  1026. package/node_modules/fastify/test/types/import.ts +0 -2
  1027. package/node_modules/fastify/test/types/instance.test-d.ts +0 -588
  1028. package/node_modules/fastify/test/types/logger.test-d.ts +0 -277
  1029. package/node_modules/fastify/test/types/plugin.test-d.ts +0 -97
  1030. package/node_modules/fastify/test/types/register.test-d.ts +0 -237
  1031. package/node_modules/fastify/test/types/reply.test-d.ts +0 -254
  1032. package/node_modules/fastify/test/types/request.test-d.ts +0 -188
  1033. package/node_modules/fastify/test/types/route.test-d.ts +0 -553
  1034. package/node_modules/fastify/test/types/schema.test-d.ts +0 -135
  1035. package/node_modules/fastify/test/types/serverFactory.test-d.ts +0 -37
  1036. package/node_modules/fastify/test/types/type-provider.test-d.ts +0 -1213
  1037. package/node_modules/fastify/test/types/using.test-d.ts +0 -17
  1038. package/node_modules/foreground-child/LICENSE +0 -15
  1039. package/node_modules/foreground-child/README.md +0 -128
  1040. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +0 -2
  1041. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +0 -1
  1042. package/node_modules/foreground-child/dist/commonjs/all-signals.js +0 -58
  1043. package/node_modules/foreground-child/dist/commonjs/all-signals.js.map +0 -1
  1044. package/node_modules/foreground-child/dist/commonjs/index.d.ts +0 -58
  1045. package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +0 -1
  1046. package/node_modules/foreground-child/dist/commonjs/index.js +0 -123
  1047. package/node_modules/foreground-child/dist/commonjs/index.js.map +0 -1
  1048. package/node_modules/foreground-child/dist/commonjs/package.json +0 -3
  1049. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +0 -6
  1050. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +0 -1
  1051. package/node_modules/foreground-child/dist/commonjs/proxy-signals.js +0 -38
  1052. package/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map +0 -1
  1053. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +0 -10
  1054. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +0 -1
  1055. package/node_modules/foreground-child/dist/commonjs/watchdog.js +0 -50
  1056. package/node_modules/foreground-child/dist/commonjs/watchdog.js.map +0 -1
  1057. package/node_modules/foreground-child/dist/esm/all-signals.d.ts +0 -2
  1058. package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +0 -1
  1059. package/node_modules/foreground-child/dist/esm/all-signals.js +0 -52
  1060. package/node_modules/foreground-child/dist/esm/all-signals.js.map +0 -1
  1061. package/node_modules/foreground-child/dist/esm/index.d.ts +0 -58
  1062. package/node_modules/foreground-child/dist/esm/index.d.ts.map +0 -1
  1063. package/node_modules/foreground-child/dist/esm/index.js +0 -115
  1064. package/node_modules/foreground-child/dist/esm/index.js.map +0 -1
  1065. package/node_modules/foreground-child/dist/esm/package.json +0 -3
  1066. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +0 -6
  1067. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +0 -1
  1068. package/node_modules/foreground-child/dist/esm/proxy-signals.js +0 -34
  1069. package/node_modules/foreground-child/dist/esm/proxy-signals.js.map +0 -1
  1070. package/node_modules/foreground-child/dist/esm/watchdog.d.ts +0 -10
  1071. package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +0 -1
  1072. package/node_modules/foreground-child/dist/esm/watchdog.js +0 -46
  1073. package/node_modules/foreground-child/dist/esm/watchdog.js.map +0 -1
  1074. package/node_modules/foreground-child/package.json +0 -106
  1075. package/node_modules/glob/dist/esm/bin.d.mts +0 -3
  1076. package/node_modules/glob/dist/esm/bin.d.mts.map +0 -1
  1077. package/node_modules/glob/dist/esm/bin.mjs +0 -346
  1078. package/node_modules/glob/dist/esm/bin.mjs.map +0 -1
  1079. package/node_modules/isexe/.npmignore +0 -2
  1080. package/node_modules/isexe/LICENSE +0 -15
  1081. package/node_modules/isexe/README.md +0 -51
  1082. package/node_modules/isexe/index.js +0 -57
  1083. package/node_modules/isexe/mode.js +0 -41
  1084. package/node_modules/isexe/package.json +0 -31
  1085. package/node_modules/isexe/test/basic.js +0 -221
  1086. package/node_modules/isexe/windows.js +0 -42
  1087. package/node_modules/jackspeak/LICENSE.md +0 -55
  1088. package/node_modules/jackspeak/README.md +0 -394
  1089. package/node_modules/jackspeak/dist/commonjs/index.d.ts +0 -323
  1090. package/node_modules/jackspeak/dist/commonjs/index.d.ts.map +0 -1
  1091. package/node_modules/jackspeak/dist/commonjs/index.js +0 -944
  1092. package/node_modules/jackspeak/dist/commonjs/index.js.map +0 -1
  1093. package/node_modules/jackspeak/dist/commonjs/index.min.js +0 -33
  1094. package/node_modules/jackspeak/dist/commonjs/index.min.js.map +0 -7
  1095. package/node_modules/jackspeak/dist/commonjs/package.json +0 -3
  1096. package/node_modules/jackspeak/dist/esm/index.d.ts +0 -323
  1097. package/node_modules/jackspeak/dist/esm/index.d.ts.map +0 -1
  1098. package/node_modules/jackspeak/dist/esm/index.js +0 -936
  1099. package/node_modules/jackspeak/dist/esm/index.js.map +0 -1
  1100. package/node_modules/jackspeak/dist/esm/index.min.js +0 -33
  1101. package/node_modules/jackspeak/dist/esm/index.min.js.map +0 -7
  1102. package/node_modules/jackspeak/dist/esm/package.json +0 -3
  1103. package/node_modules/jackspeak/package.json +0 -115
  1104. package/node_modules/jishushell-panel/output/public/assets/ApiKeyField-D1i7zWXR.js +0 -1
  1105. package/node_modules/jishushell-panel/output/public/assets/Dashboard-sWIvL43F.js +0 -1
  1106. package/node_modules/jishushell-panel/output/public/assets/HermesChatPanel-DQ8RyvQY.js +0 -1
  1107. package/node_modules/jishushell-panel/output/public/assets/HermesConfigForm-tIbPP1sB.js +0 -4
  1108. package/node_modules/jishushell-panel/output/public/assets/InitPassword-C3Slq3Dd.js +0 -1
  1109. package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-7JqY9tq4.js +0 -92
  1110. package/node_modules/jishushell-panel/output/public/assets/Login-BXLDJlQN.js +0 -1
  1111. package/node_modules/jishushell-panel/output/public/assets/NewInstance-dLc5Xrpx.js +0 -1
  1112. package/node_modules/jishushell-panel/output/public/assets/ProviderRecommendations-DIAXxesl.js +0 -1
  1113. package/node_modules/jishushell-panel/output/public/assets/Settings-Bd5utbBh.js +0 -1
  1114. package/node_modules/jishushell-panel/output/public/assets/Setup-Yn9_20FL.js +0 -1
  1115. package/node_modules/jishushell-panel/output/public/assets/WeixinLoginPanel-C21doQTJ.js +0 -9
  1116. package/node_modules/jishushell-panel/output/public/assets/index-CCkaIEjn.js +0 -20
  1117. package/node_modules/jishushell-panel/output/public/assets/index-D7qxy-Vh.css +0 -1
  1118. package/node_modules/jishushell-panel/output/public/assets/registry-B2ZQZXWL.js +0 -2
  1119. package/node_modules/jishushell-panel/output/public/assets/usePolling-BFZm4do_.js +0 -1
  1120. package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-DqPtOicc.js +0 -9
  1121. package/node_modules/jishushell-panel/output/public/assets/vendor-react-DW5juQin.js +0 -59
  1122. package/node_modules/package-json-from-dist/LICENSE.md +0 -63
  1123. package/node_modules/package-json-from-dist/README.md +0 -110
  1124. package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +0 -89
  1125. package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +0 -1
  1126. package/node_modules/package-json-from-dist/dist/commonjs/index.js +0 -134
  1127. package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +0 -1
  1128. package/node_modules/package-json-from-dist/dist/commonjs/package.json +0 -3
  1129. package/node_modules/package-json-from-dist/dist/esm/index.d.ts +0 -89
  1130. package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +0 -1
  1131. package/node_modules/package-json-from-dist/dist/esm/index.js +0 -129
  1132. package/node_modules/package-json-from-dist/dist/esm/index.js.map +0 -1
  1133. package/node_modules/package-json-from-dist/dist/esm/package.json +0 -3
  1134. package/node_modules/package-json-from-dist/package.json +0 -68
  1135. package/node_modules/path-key/index.d.ts +0 -40
  1136. package/node_modules/path-key/index.js +0 -16
  1137. package/node_modules/path-key/license +0 -9
  1138. package/node_modules/path-key/package.json +0 -39
  1139. package/node_modules/path-key/readme.md +0 -61
  1140. package/node_modules/safe-buffer/LICENSE +0 -21
  1141. package/node_modules/safe-buffer/README.md +0 -584
  1142. package/node_modules/safe-buffer/index.d.ts +0 -187
  1143. package/node_modules/safe-buffer/index.js +0 -65
  1144. package/node_modules/safe-buffer/package.json +0 -51
  1145. package/node_modules/shebang-command/index.js +0 -19
  1146. package/node_modules/shebang-command/license +0 -9
  1147. package/node_modules/shebang-command/package.json +0 -34
  1148. package/node_modules/shebang-command/readme.md +0 -34
  1149. package/node_modules/shebang-regex/index.d.ts +0 -22
  1150. package/node_modules/shebang-regex/index.js +0 -2
  1151. package/node_modules/shebang-regex/license +0 -9
  1152. package/node_modules/shebang-regex/package.json +0 -35
  1153. package/node_modules/shebang-regex/readme.md +0 -33
  1154. package/node_modules/signal-exit/LICENSE.txt +0 -16
  1155. package/node_modules/signal-exit/README.md +0 -74
  1156. package/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
  1157. package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
  1158. package/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  1159. package/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
  1160. package/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
  1161. package/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
  1162. package/node_modules/signal-exit/dist/cjs/index.js +0 -279
  1163. package/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
  1164. package/node_modules/signal-exit/dist/cjs/package.json +0 -3
  1165. package/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
  1166. package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
  1167. package/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  1168. package/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
  1169. package/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
  1170. package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
  1171. package/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  1172. package/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
  1173. package/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
  1174. package/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
  1175. package/node_modules/signal-exit/dist/mjs/index.js +0 -275
  1176. package/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
  1177. package/node_modules/signal-exit/dist/mjs/package.json +0 -3
  1178. package/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
  1179. package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
  1180. package/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  1181. package/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
  1182. package/node_modules/signal-exit/package.json +0 -106
  1183. package/node_modules/which/CHANGELOG.md +0 -166
  1184. package/node_modules/which/LICENSE +0 -15
  1185. package/node_modules/which/README.md +0 -54
  1186. package/node_modules/which/bin/node-which +0 -52
  1187. package/node_modules/which/package.json +0 -43
  1188. package/node_modules/which/which.js +0 -125
  1189. package/scripts/check-adapter-isolation.ts +0 -293
  1190. /package/dist/services/{app → app-common}/app-compiler.d.ts +0 -0
  1191. /package/dist/services/{app → app-common}/terminal-session-manager.d.ts +0 -0
  1192. /package/dist/services/{backup-verify.d.ts → backup/backup-verify.d.ts} +0 -0
  1193. /package/dist/services/{external-mounts.d.ts → files/external-mounts.d.ts} +0 -0
  1194. /package/dist/services/{organize → files/organize}/applier.d.ts +0 -0
  1195. /package/dist/services/{organize → files/organize}/rules.d.ts +0 -0
  1196. /package/dist/services/{organize → files/organize}/scanner.d.ts +0 -0
  1197. /package/dist/services/{organize → files/organize}/store.d.ts +0 -0
  1198. /package/dist/services/{webdav → files/webdav}/xml-builder.d.ts +0 -0
  1199. /package/dist/services/{webdav → files/webdav}/xml-builder.js +0 -0
  1200. /package/dist/services/{app-passwords.d.ts → instances/passwords.d.ts} +0 -0
  1201. /package/dist/services/{agent-apps → integrations/installable}/installers/registry-probe.d.ts +0 -0
  1202. /package/dist/services/{agent-apps → integrations/installable}/installers/registry-probe.js +0 -0
  1203. /package/dist/services/{runtime/mcp-shims → integrations/openclaw}/drive-shim.d.ts +0 -0
  1204. /package/dist/services/{runtime/mcp-shims → integrations/openclaw}/mcporter-lite.d.ts +0 -0
  1205. /package/dist/services/{plugin-installer.d.ts → setup/plugin-installer.d.ts} +0 -0
  1206. /package/dist/services/{macos-launchd.d.ts → system/macos-launchd.d.ts} +0 -0
  1207. /package/dist/services/{system-monitor.d.ts → system/system-monitor.d.ts} +0 -0
@@ -0,0 +1,1668 @@
1
+ /**
2
+ * HermesIntegration — first non-OpenClaw runtime integration.
3
+ *
4
+ * Legacy AppIntegration implementation retained during migration toward the
5
+ * model described in docs/core-app-architecture.md.
6
+ *
7
+ * Current scope:
8
+ * - Only create / buildRuntime / getRuntimeVersion are wired up.
9
+ * - Baseline image mode only. Overlay upgrade CLI is deferred.
10
+ * - Assumes the Hermes integration runtime record has been populated in
11
+ * core.json.runtime_catalog.hermes: defaultImage (+ optional
12
+ * defaultImageDigest), resources, homeDirName.
13
+ */
14
+ import { execFileSync } from "child_process";
15
+ import { createRequire } from "node:module";
16
+ import { fileURLToPath } from "node:url";
17
+ import { chmodSync, chownSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "fs";
18
+ import { randomBytes } from "crypto";
19
+ import { dirname, join } from "path";
20
+ import { getCoreConfig, getIntegrationRuntimeEntry, setIntegrationRuntimeEntry, HERMES_DEFAULT_IMAGE, } from "../../../config.js";
21
+ import { ensureDirContainer, writeConfigFile, writeSecretFile, } from "../../../utils/fs.js";
22
+ import { safeWriteJson } from "../../../utils/safe-json.js";
23
+ import { ensureInstanceProxyToken } from "../../llm-proxy/instance-proxy.js";
24
+ import { getDefaultLlmProvider, normalizeProviderApi } from "../../llm-proxy/providers.js";
25
+ import { getCoreProxyBaseUrl } from "../../llm-proxy/proxy-runtime.js";
26
+ import { getInstance, getInstanceRuntime, resolveServiceUser, updateInstanceMeta, updateEnvFile, } from "../../instances/manager.js";
27
+ import { getInstanceDir as instanceDir, instanceMetaPath } from "../../../config.js";
28
+ import { createTask, emitTask, spawnWithTask, resolveDockerInvocation, captureImageDigest, } from "../../setup/setup-manager.js";
29
+ import { InstanceCreationRejected } from "../../runtime/errors.js";
30
+ import YAML from "yaml";
31
+ import { registerIntegration } from "../registry.js";
32
+ import { writeOwnershipMarker } from "../../runtime/ownership-marker.js";
33
+ import { SEARXNG_MCP_SHIM_SOURCE } from "../../runtime/mcp-shims/searxng-shim.js";
34
+ import { resolveEnvTemplate, writeMcpEntry } from "../../runtime/mcp-shims/write-mcp-entry.js";
35
+ import * as capabilityRegistry from "../../capabilities/registry.js";
36
+ const SEARXNG_SHIM_REL_PATH = "__mcp_shims__/searxng/index.mjs";
37
+ const UPSTREAM_SECRET_ENV_NAME = "UPSTREAM_API_KEY";
38
+ const HERMES_CONTAINER_PORT = 8642;
39
+ const HERMES_CONTAINER_HOME = "/opt/data";
40
+ const HERMES_CONTAINER_SHIM = "/usr/local/bin/jishushell-hermes-entry.sh";
41
+ const HERMES_HOST_SHIM_NAME = "jishushell-hermes-entry.sh";
42
+ // Host peripheral device nodes worth passing into a privileged Hermes
43
+ // container so the agent reaches cameras / GPU / audio like a native install.
44
+ // Directory roots are fully expanded; the prefixes match numbered top-level
45
+ // nodes (e.g. /dev/video0, /dev/media1, /dev/mali0).
46
+ const PERIPHERAL_DEV_ROOTS = ["/dev/dri", "/dev/snd"];
47
+ const PERIPHERAL_DEV_PREFIXES = ["/dev/video", "/dev/media", "/dev/v4l-subdev", "/dev/mali", "/dev/dma_heap"];
48
+ // Raw-disk / kernel-memory / device-mapper nodes that must NEVER be passed
49
+ // into a container, even if a hand-edited `runtime.devices` entry — or a
50
+ // symlink sitting under a peripheral prefix (e.g. /dev/videoX -> /dev/sda) —
51
+ // resolves to one. Peripheral passthrough must not silently become raw host
52
+ // disk or physical-memory access. Prefix match (anchored at /dev/) so
53
+ // partitions like /dev/sda1 and /dev/nvme0n1p2 are covered too.
54
+ const FORBIDDEN_DEVICE_RE = /^\/dev\/(mem|kmem|kmsg|port|sd[a-z]|hd[a-z]|vd[a-z]|nvme\d|mmcblk\d|sr\d|md\d|loop\d|dm-\d|mapper\/|disk\/|block\/)/;
55
+ /**
56
+ * Enumerate the host's media/accelerator device nodes (plus any explicit
57
+ * extras from `runtime.devices`) so a privileged container can open them.
58
+ * Returns docker `devices` entries (real, symlink-resolved paths, deduped)
59
+ * and the set of owning group gids — the (non-root) container user is added
60
+ * to those gids via `group_add` so the 0660 root:video / root:render /
61
+ * root:audio nodes are actually accessible inside the container. Missing
62
+ * nodes are skipped, so this is a no-op on hosts without such hardware.
63
+ */
64
+ function collectPrivilegedDevices(extraPaths = []) {
65
+ const candidates = new Set(extraPaths);
66
+ for (const root of PERIPHERAL_DEV_ROOTS) {
67
+ try {
68
+ for (const name of readdirSync(root))
69
+ candidates.add(`${root}/${name}`);
70
+ }
71
+ catch { /* root absent on this host */ }
72
+ }
73
+ try {
74
+ for (const name of readdirSync("/dev")) {
75
+ const full = `/dev/${name}`;
76
+ if (PERIPHERAL_DEV_PREFIXES.some((p) => full.startsWith(p)))
77
+ candidates.add(full);
78
+ }
79
+ }
80
+ catch { /* /dev unreadable (non-Linux) */ }
81
+ const devices = [];
82
+ const gids = new Set();
83
+ const seen = new Set();
84
+ for (const path of candidates) {
85
+ let real;
86
+ try {
87
+ real = realpathSync(path);
88
+ }
89
+ catch {
90
+ continue;
91
+ }
92
+ if (seen.has(real))
93
+ continue;
94
+ seen.add(real);
95
+ // Defense-in-depth: only ever expose real /dev nodes, and never raw
96
+ // disk / memory / device-mapper targets — applies to auto-discovered
97
+ // nodes (catches a malicious symlink under a peripheral prefix) and to
98
+ // explicit runtime.devices entries alike.
99
+ if (!real.startsWith("/dev/") || FORBIDDEN_DEVICE_RE.test(real)) {
100
+ console.warn(`[hermes] refusing device passthrough "${path}" -> "${real}" (outside /dev or on denylist)`);
101
+ continue;
102
+ }
103
+ let st;
104
+ try {
105
+ st = statSync(real);
106
+ }
107
+ catch {
108
+ continue;
109
+ }
110
+ if (!st.isCharacterDevice() && !st.isBlockDevice())
111
+ continue;
112
+ devices.push({ host_path: real, container_path: real, cgroup_permissions: "rw" });
113
+ if (typeof st.gid === "number" && st.gid > 0)
114
+ gids.add(st.gid);
115
+ }
116
+ return { devices, groupAdd: [...gids].map(String) };
117
+ }
118
+ const HERMES_CONTAINER_WORKDIR = "/opt/hermes";
119
+ export const HERMES_PREFERRED_HOST_PORT = HERMES_CONTAINER_PORT;
120
+ const HERMES_VERSION_LABEL = "org.opencontainers.image.version";
121
+ const HERMES_MUTABLE_TAG_RE = /:(latest|slim)$/;
122
+ const HERMES_CATALOG_DEFAULTS = {
123
+ configFormat: "yaml+env",
124
+ homeDirName: "agent-home",
125
+ resources: { CPU: 1000, MemoryMB: 1024 },
126
+ allowDockerSock: false,
127
+ };
128
+ function readOfficialHermesRepoDigest(image) {
129
+ const repo = imageRepository(HERMES_DEFAULT_IMAGE);
130
+ if (!repo)
131
+ return null;
132
+ try {
133
+ const invocation = resolveDockerInvocation();
134
+ const raw = execFileSync(invocation.cmd, [
135
+ ...invocation.argsPrefix,
136
+ "image",
137
+ "inspect",
138
+ "--format",
139
+ "{{range .RepoDigests}}{{.}}{{println}}{{end}}",
140
+ image,
141
+ ], { timeout: 5_000, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
142
+ const prefix = `${repo}@sha256:`;
143
+ return raw
144
+ .split("\n")
145
+ .map((line) => line.trim())
146
+ .find((line) => line.startsWith(prefix) && /^[a-f0-9]{64}$/i.test(line.slice(prefix.length))) ?? null;
147
+ }
148
+ catch {
149
+ return null;
150
+ }
151
+ }
152
+ function assertOfficialHermesImage(image) {
153
+ const digest = readOfficialHermesRepoDigest(image);
154
+ if (digest)
155
+ return digest;
156
+ const repo = imageRepository(HERMES_DEFAULT_IMAGE) ?? HERMES_DEFAULT_IMAGE;
157
+ throw new Error(`Hermes image ${image} is not a JishuShell-provided runtime image. ` +
158
+ `It must be pulled from ${repo} and retain an official RepoDigest.`);
159
+ }
160
+ function imageRepository(image) {
161
+ const digestIdx = image.indexOf("@");
162
+ const withoutDigest = digestIdx >= 0 ? image.slice(0, digestIdx) : image;
163
+ const colonIdx = withoutDigest.lastIndexOf(":");
164
+ const slashIdx = withoutDigest.lastIndexOf("/");
165
+ if (colonIdx > slashIdx)
166
+ return withoutDigest.slice(0, colonIdx);
167
+ return withoutDigest || null;
168
+ }
169
+ function imageTag(image) {
170
+ const colonIdx = image.lastIndexOf(":");
171
+ const slashIdx = image.lastIndexOf("/");
172
+ if (colonIdx <= slashIdx)
173
+ return null;
174
+ const tag = image.slice(colonIdx + 1);
175
+ return tag && tag !== "<none>" && tag !== "none" ? tag : null;
176
+ }
177
+ function imageTagVersion(image) {
178
+ const tag = imageTag(image);
179
+ return tag && /^\d+\.\d+\.\d+/.test(tag) ? tag : undefined;
180
+ }
181
+ function versionScore(image) {
182
+ const tag = imageTag(image) ?? "";
183
+ const semver = tag.match(/^v?(\d+)\.(\d+)\.(\d+)/);
184
+ if (semver) {
185
+ return [
186
+ 3,
187
+ Number.parseInt(semver[1], 10),
188
+ Number.parseInt(semver[2], 10),
189
+ Number.parseInt(semver[3], 10),
190
+ tag,
191
+ ];
192
+ }
193
+ if (tag === "latest")
194
+ return [2, 0, 0, 0, tag];
195
+ if (tag === "slim")
196
+ return [1, 0, 0, 0, tag];
197
+ return [0, 0, 0, 0, tag];
198
+ }
199
+ function compareLocalHermesImages(left, right) {
200
+ const a = versionScore(left);
201
+ const b = versionScore(right);
202
+ for (let i = 0; i < 4; i++) {
203
+ const diff = b[i] - a[i];
204
+ if (diff !== 0)
205
+ return diff;
206
+ }
207
+ return b[4].localeCompare(a[4]);
208
+ }
209
+ function findLocalHermesImage() {
210
+ const repo = imageRepository(HERMES_DEFAULT_IMAGE);
211
+ if (!repo)
212
+ return null;
213
+ try {
214
+ const invocation = resolveDockerInvocation();
215
+ const out = execFileSync(invocation.cmd, [...invocation.argsPrefix, "image", "ls", "--format", "{{.Repository}}:{{.Tag}}"], { timeout: 5_000, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
216
+ const candidates = out
217
+ .split("\n")
218
+ .map((line) => line.trim())
219
+ .filter((line) => line.startsWith(`${repo}:`) && !!imageTag(line));
220
+ for (const candidate of candidates.sort(compareLocalHermesImages)) {
221
+ const digest = readOfficialHermesRepoDigest(candidate);
222
+ if (digest)
223
+ return { image: candidate, digest };
224
+ }
225
+ return null;
226
+ }
227
+ catch {
228
+ return null;
229
+ }
230
+ }
231
+ function persistHermesCatalogForImage(image, existing, officialDigest) {
232
+ const next = {
233
+ ...HERMES_CATALOG_DEFAULTS,
234
+ ...(existing ?? {}),
235
+ defaultImage: image,
236
+ };
237
+ const digest = officialDigest ?? readOfficialHermesRepoDigest(image);
238
+ if (digest)
239
+ next.defaultImageDigest = digest;
240
+ else
241
+ delete next.defaultImageDigest;
242
+ setIntegrationRuntimeEntry("hermes", next);
243
+ }
244
+ /**
245
+ * Read `org.opencontainers.image.version` LABEL from a local image.
246
+ * Returns the version string if it matches `N.N.N...`, null otherwise.
247
+ */
248
+ function readHermesImageVersion(image) {
249
+ try {
250
+ const out = execFileSync("docker", ["inspect", "--format", `{{ index .Config.Labels "${HERMES_VERSION_LABEL}" }}`, image], { timeout: 5_000, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
251
+ return /^\d+\.\d+\.\d+/.test(out) ? out : null;
252
+ }
253
+ catch {
254
+ return null;
255
+ }
256
+ }
257
+ /**
258
+ * If `stored` has a mutable tag (`:latest` / `:slim`), read the bundled
259
+ * version from the image's LABEL and create a local `:${version}` tag
260
+ * alias, then drop the mutable source tag. Mirrors the OpenClaw pin in
261
+ * config.ts:migrateOpenclawImageTagIfNeeded, but uses the LABEL instead
262
+ * of spawning the container (Hermes images bake the version into the
263
+ * manifest, OpenClaw's used to lie — see that function's docstring).
264
+ *
265
+ * Returns the pinned tag on success, null when nothing was changed.
266
+ */
267
+ function pinHermesImageToLabeledVersion(stored) {
268
+ if (!HERMES_MUTABLE_TAG_RE.test(stored))
269
+ return null;
270
+ const version = readHermesImageVersion(stored);
271
+ if (!version)
272
+ return null;
273
+ const colonIdx = stored.lastIndexOf(":");
274
+ const slashIdx = stored.lastIndexOf("/");
275
+ if (colonIdx <= slashIdx)
276
+ return null;
277
+ const pinnedTag = `${stored.slice(0, colonIdx)}:${version}`;
278
+ if (pinnedTag === stored)
279
+ return null;
280
+ try {
281
+ execFileSync("docker", ["tag", stored, pinnedTag], { timeout: 10_000, stdio: "ignore" });
282
+ }
283
+ catch {
284
+ return null;
285
+ }
286
+ try {
287
+ execFileSync("docker", ["rmi", stored], { timeout: 10_000, stdio: "ignore" });
288
+ }
289
+ catch { /* best-effort cleanup */ }
290
+ return pinnedTag;
291
+ }
292
+ /**
293
+ * One-shot startup migration for Hermes installs whose
294
+ * catalog still stores `:latest` / `:slim`. Silent no-op when the catalog
295
+ * already holds a pinned tag, when docker is unreachable, or when the
296
+ * local image lacks the expected LABEL. Called from server.ts onReady.
297
+ */
298
+ export function migrateHermesImageTagIfNeeded() {
299
+ const entry = getIntegrationRuntimeEntry("hermes");
300
+ if (!entry || typeof entry.defaultImage !== "string")
301
+ return;
302
+ const stored = entry.defaultImage;
303
+ const pinned = pinHermesImageToLabeledVersion(stored);
304
+ if (!pinned)
305
+ return;
306
+ setIntegrationRuntimeEntry("hermes", { ...entry, defaultImage: pinned });
307
+ console.log(`[hermes] migrated runtime_catalog.hermes.defaultImage: ${stored} → ${pinned}`);
308
+ }
309
+ // ── Nomad primitives (mirrored from the Nomad driver so HermesIntegration's
310
+ // buildNomadTask is self-contained) ─────────────────────────────────
311
+ const DOCKER_IMAGE_RE = /^[a-zA-Z0-9][a-zA-Z0-9\-_.:/@]*$/;
312
+ const MAX_DOCKER_IMAGE_NAME_LEN = 256;
313
+ // Matches the shape Feishu issues from `archetype=PersonalAgent` device-flow
314
+ // (cli_ prefix + alphanumerics). Kept narrow on purpose — wider wildcards
315
+ // would accept untrusted strings propagated from the OAuth response body.
316
+ const FEISHU_APP_ID_RE = /^cli_[a-zA-Z0-9]{8,64}$/;
317
+ // iLink Bot IDs are numeric-ish bot handles issued by Tencent. Keep the
318
+ // same 128-char ceiling + charset OpenClaw's integration uses so invalid
319
+ // payloads from a tampered OAuth response don't become filesystem paths.
320
+ const SAFE_WEIXIN_ACCOUNT_ID_RE = /^[a-zA-Z0-9@._-]{1,128}$/;
321
+ const DEFAULT_CAPABILITIES = {
322
+ ui: {
323
+ http: true,
324
+ websocket: false,
325
+ // "inline" = JishuShell-side chat UI that POSTs to
326
+ // /api/instances/:id/agent/chat. Core forwards to the runtime chat
327
+ // endpoint described by inlineChatDescriptor.
328
+ chatPanel: "inline",
329
+ },
330
+ pairing: {
331
+ list: true,
332
+ approve: true,
333
+ // Capability is `false` until the integration, routes, and CLI actually
334
+ // ship revoke / clear-pending surfaces. Declaring them true here
335
+ // with no backing implementation would mislead the UI and any
336
+ // external caller into attempting unreachable operations.
337
+ revoke: false,
338
+ clearPending: false,
339
+ },
340
+ configEditor: "yaml+env",
341
+ configSchema: false,
342
+ customProvider: true,
343
+ pluginInstall: false,
344
+ skills: true,
345
+ mcp: true,
346
+ memory: true,
347
+ backupRestore: false,
348
+ usageStats: false,
349
+ restartlessReload: false,
350
+ messagingPlatforms: [
351
+ "feishu",
352
+ "weixin",
353
+ "telegram",
354
+ "discord",
355
+ "slack",
356
+ "whatsapp",
357
+ "signal",
358
+ "email",
359
+ ],
360
+ };
361
+ const HERMES_AGENT_HOME_SUBDIRS = [
362
+ "cron",
363
+ "sessions",
364
+ "logs",
365
+ "hooks",
366
+ "memories",
367
+ "skills",
368
+ "skins",
369
+ "plans",
370
+ "workspace",
371
+ "home",
372
+ ];
373
+ const HERMES_AGENT_HOME_NESTED_DIRS = [
374
+ ["weixin"],
375
+ ["weixin", "accounts"],
376
+ ["hermes-overlay"],
377
+ ];
378
+ const HERMES_SECRET_ENV_RE = /(KEY|TOKEN|SECRET|PASSWORD)$/i;
379
+ function defaultHermesModelId() {
380
+ const dp = getDefaultLlmProvider();
381
+ const selected = typeof dp?.selectedModelId === "string" ? dp.selectedModelId.trim() : "";
382
+ if (selected)
383
+ return selected;
384
+ const first = Array.isArray(dp?.models) ? dp.models.find((model) => typeof model?.id === "string" && model.id.trim()) : null;
385
+ return first?.id || "default";
386
+ }
387
+ function defaultHermesConfigYaml() {
388
+ // Main agent routes through our `jsproxy` custom provider — honest: we
389
+ // really are an OpenAI-compatible proxy that may sit in front of any
390
+ // upstream (MiniMax/OpenAI/Anthropic/…). Aliasing to any built-in
391
+ // provider name (e.g. `minimax`) would leak upstream-specific request
392
+ // fields to unrelated backends and create surprising breakage.
393
+ //
394
+ // Hermes expects `custom_providers` as a YAML list (each entry an
395
+ // object with a `name` field). See Hermes config schema at
396
+ // https://hermes-agent.nousresearch.com/docs/user-guide/configuration/
397
+ const doc = {
398
+ model: {
399
+ provider: "jsproxy",
400
+ default: defaultHermesModelId(),
401
+ },
402
+ terminal: {
403
+ backend: "local",
404
+ },
405
+ custom_providers: [
406
+ {
407
+ name: "jsproxy",
408
+ base_url: getCoreProxyBaseUrl(),
409
+ api_key: "${JSPROXY_API_KEY}",
410
+ },
411
+ ],
412
+ };
413
+ return YAML.stringify(doc).trimEnd() + "\n";
414
+ }
415
+ function defaultHermesEnvText() {
416
+ // Hermes refuses to bind 0.0.0.0 without an API_SERVER_KEY (safety gate).
417
+ // Generate a random 32-byte hex key per instance so unauthenticated access
418
+ // is impossible even though the host port is published.
419
+ const apiServerKey = randomBytes(32).toString("hex");
420
+ return [
421
+ "API_SERVER_ENABLED=true",
422
+ "API_SERVER_HOST=0.0.0.0",
423
+ `API_SERVER_PORT=${HERMES_CONTAINER_PORT}`,
424
+ `API_SERVER_KEY=${apiServerKey}`,
425
+ // Main agent provider lookup uses JSPROXY_API_KEY (referenced from
426
+ // config.yaml custom_providers). Seeded by ensureInstanceProxyToken.
427
+ "JSPROXY_API_KEY=",
428
+ // OPENAI_BASE_URL + OPENAI_API_KEY are the standard env vars Hermes's
429
+ // `auxiliary_client._try_custom_endpoint` reads to auto-discover a
430
+ // generic OpenAI-compatible endpoint. Pointing them at our jsproxy
431
+ // stops the auxiliary resolution chain from falling through to the
432
+ // Nous Portal (which needs cookie auth and emits a 401 warning at
433
+ // every agent startup). The aux token is a mirror of JSPROXY_API_KEY
434
+ // populated by syncHermesProxyEnv after ensureInstanceProxyToken runs.
435
+ `OPENAI_BASE_URL=${getCoreProxyBaseUrl()}`,
436
+ "OPENAI_API_KEY=",
437
+ // Allow all users for the smoke path; production deployments should
438
+ // configure per-platform allowlists via TELEGRAM_ALLOWED_USERS etc.
439
+ "GATEWAY_ALLOW_ALL_USERS=true",
440
+ "",
441
+ ].join("\n");
442
+ }
443
+ /**
444
+ * After `ensureInstanceProxyToken(instanceId)` writes JSPROXY_API_KEY into
445
+ * the Hermes .env, mirror the same token into OPENAI_API_KEY and make
446
+ * sure OPENAI_BASE_URL points at our jsproxy. This gives the
447
+ * auxiliary_client / vision client / trajectory compressor a valid
448
+ * OpenAI-compatible endpoint to auto-discover, so startup no longer
449
+ * emits the `custom/main requested but no endpoint credentials found`
450
+ * warning + Nous 401. Safe to call repeatedly (idempotent).
451
+ */
452
+ function syncHermesProxyEnv(instanceId) {
453
+ const paths = resolveHermesPaths(instanceId);
454
+ if (!paths.secretEnv || !existsSync(paths.secretEnv))
455
+ return;
456
+ const env = parseEnvFileFromText(readFileSync(paths.secretEnv, "utf-8"));
457
+ const token = env.JSPROXY_API_KEY?.trim();
458
+ if (!token)
459
+ return;
460
+ const updates = {};
461
+ if (env.OPENAI_API_KEY !== token)
462
+ updates.OPENAI_API_KEY = token;
463
+ const expectedBase = getCoreProxyBaseUrl();
464
+ if (env.OPENAI_BASE_URL !== expectedBase)
465
+ updates.OPENAI_BASE_URL = expectedBase;
466
+ if (Object.keys(updates).length === 0)
467
+ return;
468
+ updateEnvFile(paths.secretEnv, updates);
469
+ }
470
+ function syncHermesProviderSecret(instanceId) {
471
+ const paths = resolveHermesPaths(instanceId);
472
+ if (!paths.secretEnv)
473
+ return;
474
+ const providerEnvPath = join(dirname(paths.secretEnv), "provider.env");
475
+ const existing = existsSync(providerEnvPath)
476
+ ? parseEnvFileFromText(readFileSync(providerEnvPath, "utf-8"))
477
+ : {};
478
+ if (existing[UPSTREAM_SECRET_ENV_NAME]?.trim())
479
+ return;
480
+ const dp = getDefaultLlmProvider();
481
+ if (!dp?.id || !dp.apiKey)
482
+ return;
483
+ const meta = getInstance(instanceId);
484
+ if (meta) {
485
+ const providerId = String(meta["x-jishushell"]?.proxy?.upstream?.providerId || "").trim();
486
+ if (providerId && providerId !== dp.id)
487
+ return;
488
+ }
489
+ updateEnvFile(providerEnvPath, { [UPSTREAM_SECRET_ENV_NAME]: dp.apiKey });
490
+ }
491
+ function ensureHermesConfigFiles(paths) {
492
+ if (!paths.primaryConfig || !existsSync(paths.primaryConfig)) {
493
+ writeConfigFile(paths.primaryConfig, defaultHermesConfigYaml());
494
+ }
495
+ if (!paths.secretEnv || !existsSync(paths.secretEnv)) {
496
+ writeSecretFile(paths.secretEnv, defaultHermesEnvText());
497
+ }
498
+ writeHermesEntrypointShim(paths);
499
+ }
500
+ function secretEnvFields(envText) {
501
+ const env = parseEnvFileFromText(envText);
502
+ return Object.keys(env)
503
+ .filter((key) => HERMES_SECRET_ENV_RE.test(key))
504
+ .map((key) => `env.${key}`);
505
+ }
506
+ function parseEnvFileFromText(envText) {
507
+ const env = {};
508
+ for (let line of envText.split("\n")) {
509
+ line = line.trim();
510
+ if (!line || line.startsWith("#"))
511
+ continue;
512
+ if (line.startsWith("export "))
513
+ line = line.slice(7).trimStart();
514
+ if (!line.includes("="))
515
+ continue;
516
+ const eqIdx = line.indexOf("=");
517
+ const key = line.slice(0, eqIdx).trim();
518
+ let value = line.slice(eqIdx + 1).trim();
519
+ if (!key)
520
+ continue;
521
+ if (value.length >= 2 && value[0] === value[value.length - 1] && (value[0] === "'" || value[0] === '"')) {
522
+ value = value.slice(1, -1);
523
+ }
524
+ env[key] = value;
525
+ }
526
+ return env;
527
+ }
528
+ function injectHermesUpstreamKeyStatus(instanceId, config) {
529
+ const merged = structuredClone(config);
530
+ const upstream = merged["x-jishushell"]?.proxy?.upstream;
531
+ if (!upstream || typeof upstream !== "object")
532
+ return merged;
533
+ const paths = resolveHermesPaths(instanceId);
534
+ if (!paths.secretEnv)
535
+ return merged;
536
+ const providerEnvPath = join(dirname(paths.secretEnv), "provider.env");
537
+ if (!existsSync(providerEnvPath))
538
+ return merged;
539
+ const providerEnv = parseEnvFileFromText(readFileSync(providerEnvPath, "utf-8"));
540
+ upstream.hasApiKey = !!String(providerEnv[UPSTREAM_SECRET_ENV_NAME] || "").trim();
541
+ return merged;
542
+ }
543
+ function normalizeEnvText(raw) {
544
+ const trimmed = raw.replace(/\r\n/g, "\n").replace(/\r/g, "\n").trimEnd();
545
+ return trimmed ? `${trimmed}\n` : "";
546
+ }
547
+ function bundledHermesEntrypointPath() {
548
+ return join(dirname(fileURLToPath(import.meta.url)), "../../../../templates/hermes-entrypoint.sh");
549
+ }
550
+ function hermesHostShimPath(paths) {
551
+ return join(paths.integrationHome, "bin", HERMES_HOST_SHIM_NAME);
552
+ }
553
+ function writeHermesEntrypointShim(paths) {
554
+ const target = hermesHostShimPath(paths);
555
+ mkdirSync(dirname(target), { recursive: true });
556
+ const source = readFileSync(bundledHermesEntrypointPath(), "utf-8");
557
+ if (!existsSync(target) || readFileSync(target, "utf-8") !== source) {
558
+ writeFileSync(target, source, { mode: 0o755 });
559
+ }
560
+ chmodSync(target, 0o755);
561
+ return target;
562
+ }
563
+ function ensureHermesRuntimeVolumes(volumes, paths) {
564
+ const next = Array.isArray(volumes) ? [...volumes] : [];
565
+ if (!next.some((volume) => volume.containerPath === HERMES_CONTAINER_HOME)) {
566
+ next.unshift({ hostPath: paths.integrationHome, containerPath: HERMES_CONTAINER_HOME, mode: "rw" });
567
+ }
568
+ const shimPath = writeHermesEntrypointShim(paths);
569
+ if (!next.some((volume) => volume.containerPath === HERMES_CONTAINER_SHIM)) {
570
+ next.push({ hostPath: shimPath, containerPath: HERMES_CONTAINER_SHIM, mode: "ro" });
571
+ }
572
+ return next;
573
+ }
574
+ function resolveHermesRuntimeUser() {
575
+ const serviceUser = resolveServiceUser();
576
+ const uid = serviceUser?.uid ?? process.getuid?.() ?? 1000;
577
+ const gid = serviceUser?.gid ?? process.getgid?.() ?? 1000;
578
+ return `${uid}:${gid}`;
579
+ }
580
+ function sanitizeHermesRuntimeEnv(env) {
581
+ const next = { ...(env ?? {}) };
582
+ delete next.HERMES_UID;
583
+ delete next.HERMES_GID;
584
+ return next;
585
+ }
586
+ /**
587
+ * Resolve the hermes instance filesystem layout. Agent-home lives inside the
588
+ * per-instance directory and is bind-mounted to /opt/data inside the container.
589
+ */
590
+ export function resolveHermesPaths(instanceId) {
591
+ const catalog = getIntegrationRuntimeEntry("hermes");
592
+ const homeDirName = catalog?.homeDirName || "agent-home";
593
+ const resolvedInstanceDir = instanceDir(instanceId);
594
+ const integrationHome = join(resolvedInstanceDir, homeDirName);
595
+ return {
596
+ instanceDir: resolvedInstanceDir,
597
+ integrationHome,
598
+ primaryConfig: join(integrationHome, "config.yaml"),
599
+ secretEnv: join(integrationHome, ".env"),
600
+ };
601
+ }
602
+ function withHermesDefaultUpstream(meta) {
603
+ const dp = getDefaultLlmProvider();
604
+ if (!dp?.id)
605
+ return meta;
606
+ const modelList = Array.isArray(dp.models)
607
+ ? dp.models
608
+ .map((m) => ({
609
+ id: String(m?.id ?? ""),
610
+ name: String(m?.name ?? m?.id ?? ""),
611
+ contextWindow: Number(m?.contextWindow) || 128000,
612
+ }))
613
+ .filter((m) => m.id)
614
+ : [];
615
+ const selectedModelId = String(dp.selectedModelId || modelList[0]?.id || "");
616
+ if (selectedModelId && modelList.every((m) => m.id !== selectedModelId)) {
617
+ modelList.unshift({ id: selectedModelId, name: selectedModelId, contextWindow: 128000 });
618
+ }
619
+ return {
620
+ ...meta,
621
+ "x-jishushell": {
622
+ proxy: {
623
+ upstream: {
624
+ providerId: String(dp.id),
625
+ baseUrl: String(dp.baseUrl || ""),
626
+ api: normalizeProviderApi(dp.api),
627
+ authHeader: dp.authHeader === true,
628
+ headers: {},
629
+ models: modelList,
630
+ selectedModelId,
631
+ apiKey: "",
632
+ hasApiKey: !!dp.apiKey,
633
+ clearApiKey: false,
634
+ },
635
+ },
636
+ },
637
+ };
638
+ }
639
+ async function finalizeHermesCreatedInstance(instanceId) {
640
+ const metaPath = instanceMetaPath(instanceId);
641
+ if (existsSync(metaPath)) {
642
+ const nextMeta = withHermesDefaultUpstream(getInstance(instanceId) ?? {});
643
+ if (nextMeta["x-jishushell"]) {
644
+ updateInstanceMeta(instanceId, { "x-jishushell": nextMeta["x-jishushell"] });
645
+ }
646
+ }
647
+ try {
648
+ ensureInstanceProxyToken(instanceId);
649
+ syncHermesProxyEnv(instanceId);
650
+ syncHermesProviderSecret(instanceId);
651
+ }
652
+ catch (e) {
653
+ console.warn(`[hermes] failed to seed proxy token for ${instanceId}: ${e.message}`);
654
+ }
655
+ const svcUser = resolveServiceUser();
656
+ if (svcUser) {
657
+ try {
658
+ execFileSync("chown", ["-R", `${svcUser.uid}:${svcUser.gid}`, instanceDir(instanceId)], { timeout: 10_000 });
659
+ }
660
+ catch (e) {
661
+ console.warn(`[hermes] chown for ${instanceId} failed:`, e.message);
662
+ }
663
+ }
664
+ }
665
+ /**
666
+ * §17 — find the capability-registry entry that produced a given
667
+ * resolved env URL (e.g. `SEARCH_API_BASE_URL = http://x:8080/search`).
668
+ * Match by host:port (and path when declared). Returns the entry so
669
+ * applyConnectionEnv can read its `toolSchema`. Returns null when no
670
+ * match — caller falls back to the legacy PR 7 path.
671
+ */
672
+ function findSearchProviderForUrl(rawUrl) {
673
+ let parsed;
674
+ try {
675
+ parsed = new URL(rawUrl);
676
+ }
677
+ catch {
678
+ return null;
679
+ }
680
+ const targetHost = parsed.hostname.toLowerCase();
681
+ const targetPort = Number(parsed.port) || (parsed.protocol === "https:" ? 443 : 80);
682
+ const targetPath = parsed.pathname.replace(/\/+$/u, "");
683
+ const snapshot = capabilityRegistry.snapshot().providersByCapability ?? {};
684
+ for (const entries of Object.values(snapshot)) {
685
+ for (const entry of entries) {
686
+ if (entry.kind !== "search" || entry.interface !== "searxng-json")
687
+ continue;
688
+ const entryHost = (entry.host ?? "").toLowerCase();
689
+ const entryPort = entry.hostPort;
690
+ const entryPath = (entry.path ?? "").replace(/\/+$/u, "");
691
+ if (entryPort !== targetPort)
692
+ continue;
693
+ if (entryHost && entryHost !== targetHost) {
694
+ // Tolerate localhost <-> 127.0.0.1 / advertised-host mismatches by
695
+ // accepting any host when the port + path match — env URLs go
696
+ // through the Nomad driver's host rewriting which can disagree with
697
+ // registry's stored host.
698
+ }
699
+ if (entryPath && targetPath && entryPath !== targetPath)
700
+ continue;
701
+ return entry;
702
+ }
703
+ }
704
+ return null;
705
+ }
706
+ class HermesIntegration {
707
+ kind = "hermes";
708
+ displayName = "Hermes Agent";
709
+ defaultCapabilities = DEFAULT_CAPABILITIES;
710
+ preferredHostPort = HERMES_PREFERRED_HOST_PORT;
711
+ manifest = {
712
+ kind: "hermes",
713
+ displayName: "Hermes Agent",
714
+ description: "NousResearch Hermes — Telegram / Discord / Slack / Signal 等 IM 接入",
715
+ defaultCapabilities: DEFAULT_CAPABILITIES,
716
+ requiresNomadDocker: true,
717
+ diskSpaceMB: 5120,
718
+ catalogGroup: "agents",
719
+ catalogIcon: "hermes",
720
+ defaultTab: "chat",
721
+ supportsClone: false,
722
+ connectionRole: "agent",
723
+ defaultConnectionApplyMode: "proxy-upstream",
724
+ requiredForSetupReady: false,
725
+ };
726
+ hooks = {
727
+ onCreatePrepare: async (ctx) => this.prepareInitialLayout(ctx),
728
+ onCreate: async ({ instanceId }) => {
729
+ await finalizeHermesCreatedInstance(instanceId);
730
+ },
731
+ /**
732
+ * Hermes pre-start: verify the docker image retains the official
733
+ * ghcr.io/x-aijishu/hermes-runtime RepoDigest before Nomad receives it.
734
+ * No config patches (the shim bootstraps `.env` / `config.yaml` on first
735
+ * run) and no Nomad Variables template (Hermes reads keys from the
736
+ * bind-mounted `.env`, not from secrets).
737
+ */
738
+ onBeforeStart: async (args) => {
739
+ const catalog = getIntegrationRuntimeEntry("hermes");
740
+ const image = catalog?.defaultImageDigest
741
+ || catalog?.defaultImage;
742
+ if (!image) {
743
+ throw new Error("Hermes runtime is not installed. Run POST /api/setup/install/hermes first.");
744
+ }
745
+ if (!DOCKER_IMAGE_RE.test(image) || image.length > MAX_DOCKER_IMAGE_NAME_LEN) {
746
+ throw new Error(`Invalid Hermes docker image: "${image}"`);
747
+ }
748
+ assertOfficialHermesImage(image);
749
+ // Idempotent migration: pre-alias Hermes instances created before the
750
+ // OPENAI_* env switch still carry only JSPROXY_API_KEY. Every start
751
+ // mirrors that token into OPENAI_API_KEY and pins OPENAI_BASE_URL at
752
+ // the jsproxy so auxiliary_client auto-discovery stops hitting Nous.
753
+ // Safe to re-run on every restart.
754
+ try {
755
+ syncHermesProxyEnv(args.instanceId);
756
+ }
757
+ catch { /* best-effort */ }
758
+ try {
759
+ syncHermesProviderSecret(args.instanceId);
760
+ }
761
+ catch { /* best-effort */ }
762
+ },
763
+ };
764
+ async prepareInitialLayout(ctx) {
765
+ // Prereq validation: Hermes only runs under nomad+docker with a persisted
766
+ // integration runtime record. These checks fire before any FS state is
767
+ // created so a misconfigured host never produces a half-laid-out instance
768
+ // dir.
769
+ // Routes layer detects `InstanceCreationRejected` and returns 409 with
770
+ // `code` / `requestedKind` / `currentServiceManager` / `currentNomadDriver`.
771
+ const coreConfig = getCoreConfig();
772
+ const svcMgr = coreConfig.service_manager || "nomad";
773
+ const driver = coreConfig.nomad_driver || "docker";
774
+ if (svcMgr !== "nomad") {
775
+ throw new InstanceCreationRejected({
776
+ code: "RUNTIME_REQUIRES_NOMAD_DOCKER",
777
+ requestedKind: "hermes",
778
+ currentServiceManager: svcMgr,
779
+ currentNomadDriver: driver,
780
+ hint: `Hermes requires service_manager="nomad" (current: "${svcMgr}"). ` +
781
+ `Switch in core.json or via settings before creating a Hermes instance.`,
782
+ });
783
+ }
784
+ if (driver !== "docker") {
785
+ throw new InstanceCreationRejected({
786
+ code: "RUNTIME_REQUIRES_NOMAD_DOCKER",
787
+ requestedKind: "hermes",
788
+ currentServiceManager: svcMgr,
789
+ currentNomadDriver: driver,
790
+ hint: `Hermes requires nomad_driver="docker" (current: "${driver}").`,
791
+ });
792
+ }
793
+ const catalog = coreConfig.runtime_catalog?.hermes;
794
+ if (!catalog || !catalog.defaultImage) {
795
+ throw new InstanceCreationRejected({
796
+ code: "RUNTIME_PREREQ_MISSING",
797
+ requestedKind: "hermes",
798
+ currentServiceManager: svcMgr,
799
+ currentNomadDriver: driver,
800
+ hint: `Hermes runtime is not installed. Run POST /api/setup/install/hermes first.`,
801
+ });
802
+ }
803
+ const paths = resolveHermesPaths(ctx.instanceId);
804
+ mkdirSync(paths.integrationHome, { recursive: true });
805
+ // Step 5 (bootstrap ownership marker): write the marker immediately
806
+ // after the home directory exists. Hermes's `integrationHome` is
807
+ // always under the per-instance dir (see resolveHermesPaths) so the
808
+ // framework's `deleteInstance` rm already covers cleanup; the marker
809
+ // is written for cross-integration consistency and as defense-in-depth
810
+ // for any future layout that hosts agent-home outside the instance
811
+ // dir. The marker is consulted only at install pre-check / install
812
+ // rollback / uninstall — never by status / start / proxy paths.
813
+ writeOwnershipMarker(paths.integrationHome, {
814
+ instanceId: ctx.instanceId,
815
+ integrationKind: "hermes",
816
+ });
817
+ for (const sub of HERMES_AGENT_HOME_SUBDIRS) {
818
+ mkdirSync(join(paths.integrationHome, sub), { recursive: true });
819
+ }
820
+ for (const segments of HERMES_AGENT_HOME_NESTED_DIRS) {
821
+ mkdirSync(join(paths.integrationHome, ...segments), { recursive: true });
822
+ }
823
+ ensureHermesConfigFiles(paths);
824
+ return paths;
825
+ }
826
+ async buildRuntime(instanceId) {
827
+ const catalog = getIntegrationRuntimeEntry("hermes");
828
+ if (!catalog) {
829
+ throw new Error("Hermes runtime is not installed. Run POST /api/setup/install/hermes first.");
830
+ }
831
+ // Prefer digest over tag for image pinning. When installHermes captured a
832
+ // digest it is stored alongside the tag; integration favors digest.
833
+ const image = catalog.defaultImageDigest
834
+ || catalog.defaultImage;
835
+ if (!image) {
836
+ throw new Error("Hermes integration runtime record missing defaultImage");
837
+ }
838
+ // Only run JishuShell-provided Hermes runtime images. A local tag alone
839
+ // is not enough because anyone can retag an arbitrary image; RepoDigest
840
+ // records that Docker pulled this image from our official repository.
841
+ assertOfficialHermesImage(image);
842
+ const paths = resolveHermesPaths(instanceId);
843
+ ensureHermesConfigFiles(paths);
844
+ // Migrate pre-alias instances (created before the switch to
845
+ // provider:minimax) in-place: mirror JSPROXY_API_KEY into MINIMAX_API_KEY
846
+ // and pin MINIMAX_BASE_URL at the jsproxy. Idempotent — no-op on
847
+ // instances already aligned with the new template.
848
+ try {
849
+ syncHermesProxyEnv(instanceId);
850
+ }
851
+ catch { /* best-effort */ }
852
+ try {
853
+ syncHermesProviderSecret(instanceId);
854
+ }
855
+ catch { /* best-effort */ }
856
+ // Baseline mode is detected by ABSENCE of JISHUSHELL_HERMES_SOURCE_REF.
857
+ // We deliberately do NOT inject this env here. Only the (future) upgrade CLI
858
+ // populates it after a per-instance overlay build.
859
+ const env = {
860
+ API_SERVER_ENABLED: "true",
861
+ API_SERVER_HOST: "0.0.0.0",
862
+ API_SERVER_PORT: String(HERMES_CONTAINER_PORT),
863
+ };
864
+ const resources = catalog.resources && typeof catalog.resources === "object"
865
+ ? {
866
+ CPU: Number(catalog.resources.CPU) || 1000,
867
+ MemoryMB: Number(catalog.resources.MemoryMB) || 1024,
868
+ MemoryMaxMB: catalog.resources.MemoryMaxMB != null
869
+ ? Number(catalog.resources.MemoryMaxMB)
870
+ : undefined,
871
+ }
872
+ : { CPU: 1000, MemoryMB: 1024 };
873
+ return {
874
+ image,
875
+ // Invoke the shim via /bin/bash explicitly instead of execve'ing the
876
+ // script file directly. Debian-based containers always ship /bin/bash,
877
+ // and this bypasses EACCES on execve when bind-mounted script files
878
+ // occasionally lose their exec bit through the container runtime.
879
+ command: "/bin/bash",
880
+ args: [HERMES_CONTAINER_SHIM, "gateway", "run"],
881
+ cwd: HERMES_CONTAINER_WORKDIR,
882
+ user: resolveHermesRuntimeUser(),
883
+ env,
884
+ envFiles: paths.secretEnv ? [paths.secretEnv] : undefined,
885
+ resources,
886
+ volumes: ensureHermesRuntimeVolumes(undefined, paths),
887
+ ports: [
888
+ {
889
+ name: "gateway",
890
+ containerPort: HERMES_CONTAINER_PORT,
891
+ hostPort: 0, // allocated by instance-manager
892
+ visibility: "external",
893
+ },
894
+ ],
895
+ health: {
896
+ type: "http",
897
+ path: "/health",
898
+ port: HERMES_CONTAINER_PORT,
899
+ },
900
+ };
901
+ }
902
+ async getPersistedRuntimeSpec(instanceId) {
903
+ const { getInstanceRuntime } = await import("../../instances/manager.js");
904
+ const persisted = getInstanceRuntime(instanceId);
905
+ if (!persisted || typeof persisted !== "object") {
906
+ throw new Error(`Hermes instance ${instanceId} has no persisted runtime spec`);
907
+ }
908
+ const paths = resolveHermesPaths(instanceId);
909
+ ensureHermesConfigFiles(paths);
910
+ const envFiles = Array.isArray(persisted.envFiles)
911
+ ? [...(persisted.envFiles ?? [])]
912
+ : [];
913
+ if (paths.secretEnv && !envFiles.includes(paths.secretEnv)) {
914
+ envFiles.unshift(paths.secretEnv);
915
+ }
916
+ return {
917
+ ...persisted,
918
+ command: "/bin/bash",
919
+ args: Array.isArray(persisted.args) && persisted.args.length > 0
920
+ ? persisted.args
921
+ : [HERMES_CONTAINER_SHIM, "gateway", "run"],
922
+ cwd: persisted.cwd || HERMES_CONTAINER_WORKDIR,
923
+ user: resolveHermesRuntimeUser(),
924
+ env: sanitizeHermesRuntimeEnv(persisted.env),
925
+ envFiles,
926
+ volumes: ensureHermesRuntimeVolumes(persisted.volumes, paths),
927
+ };
928
+ }
929
+ async buildRuntimeContribution(instanceId) {
930
+ // Opt-in privilege relaxation (per-instance runtime.privileged). Default
931
+ // keeps the hardened container (base cap_drop=ALL / no-new-privileges
932
+ // applied by the workload compiler; Hermes already runs a writable
933
+ // rootfs). When privileged is enabled, the driverConfig deep-merges over
934
+ // that base to drop those hardening flags and passes through host
935
+ // peripheral devices + group_add of their owning gids so the agent reaches
936
+ // cameras / GPU / audio like a native install. Toggle via
937
+ // `jishushell job privileged`.
938
+ const rawRuntime = getInstanceRuntime(instanceId);
939
+ const privileged = rawRuntime.privileged === true;
940
+ const peripherals = privileged
941
+ ? collectPrivilegedDevices(Array.isArray(rawRuntime.devices) ? rawRuntime.devices.map(String) : [])
942
+ : { devices: [], groupAdd: [] };
943
+ if (privileged) {
944
+ console.warn(`[hermes] instance ${instanceId} running with privileged=true — hardening relaxed (default caps, no-new-privileges off); ${peripherals.devices.length} host device(s) passed through, group_add=[${peripherals.groupAdd.join(",")}]`);
945
+ }
946
+ const driverConfig = {
947
+ init: true,
948
+ shm_size: 1073741824,
949
+ mounts: [{ type: "tmpfs", target: "/tmp", tmpfs_options: { size: 536870912 } }],
950
+ ...(privileged
951
+ ? {
952
+ cap_drop: [],
953
+ security_opt: [],
954
+ readonly_rootfs: false,
955
+ ...(peripherals.devices.length > 0 ? { devices: peripherals.devices } : {}),
956
+ ...(peripherals.groupAdd.length > 0 ? { group_add: peripherals.groupAdd } : {}),
957
+ }
958
+ : {}),
959
+ };
960
+ const paths = resolveHermesPaths(instanceId);
961
+ ensureHermesConfigFiles(paths);
962
+ const templates = [];
963
+ if (paths.secretEnv && existsSync(paths.secretEnv)) {
964
+ templates.push({
965
+ DestPath: "secrets/hermes.env",
966
+ Envvars: true,
967
+ EmbeddedTmpl: readFileSync(paths.secretEnv, "utf-8"),
968
+ ChangeMode: "restart",
969
+ });
970
+ }
971
+ return {
972
+ tasks: {
973
+ gateway: {
974
+ driverConfig,
975
+ ...(templates.length > 0 ? { templates } : {}),
976
+ },
977
+ },
978
+ };
979
+ }
980
+ /**
981
+ * Hermes has no `openclaw.json` — it stores upstream metadata directly
982
+ * on instance.json under `x-jishushell`. Return a synthetic stub
983
+ * containing just that block so the LLM proxy's
984
+ * `deriveUpstreamConfig()` finds what it needs.
985
+ */
986
+ getNativeConfig(instanceId) {
987
+ const config = this.getStoredNativeConfig(instanceId);
988
+ if (!config)
989
+ return null;
990
+ return injectHermesUpstreamKeyStatus(instanceId, config);
991
+ }
992
+ getStoredNativeConfig(instanceId) {
993
+ // Lazy import to avoid pulling the full instance-manager into top-level
994
+ // static graph (integrations reach back for framework primitives on demand).
995
+ try {
996
+ const req = createRequire(import.meta.url);
997
+ const im = req("../../instances/manager.js");
998
+ const meta = im.getInstance(instanceId);
999
+ if (!meta)
1000
+ return null;
1001
+ return { "x-jishushell": meta["x-jishushell"] || {} };
1002
+ }
1003
+ catch {
1004
+ return null;
1005
+ }
1006
+ }
1007
+ /**
1008
+ * Persist the `x-jishushell` meta block to instance.json. Hermes's user-
1009
+ * facing config lives in yaml+env (editable via `writeConfig`), so this
1010
+ * hook is scoped to the meta block only — any other keys in the payload
1011
+ * are ignored intentionally.
1012
+ *
1013
+ * Called by `llm-proxy.saveInstanceConfig` when the editor saves a
1014
+ * per-instance provider override. By implementing the same
1015
+ * `saveNativeConfig(instanceId, {x-jishushell})` contract OpenClaw uses,
1016
+ * Hermes piggy-backs on the shared API key encryption + rollback flow.
1017
+ */
1018
+ saveNativeConfig(instanceId, config) {
1019
+ const xJishushell = config?.["x-jishushell"];
1020
+ if (!xJishushell || typeof xJishushell !== "object")
1021
+ return false;
1022
+ try {
1023
+ const req = createRequire(import.meta.url);
1024
+ const im = req("../../instances/manager.js");
1025
+ if (!im.getInstance(instanceId))
1026
+ return false;
1027
+ im.updateInstanceMeta(instanceId, { "x-jishushell": xJishushell });
1028
+ return true;
1029
+ }
1030
+ catch (e) {
1031
+ console.warn(`[hermes] saveNativeConfig failed for ${instanceId}: ${e.message}`);
1032
+ return false;
1033
+ }
1034
+ }
1035
+ /**
1036
+ * Connection-apply hook: translate resolved bindings into Hermes-native
1037
+ * config.yaml updates.
1038
+ *
1039
+ * Hermes' web tool only supports Firecrawl/Tavily/Exa/Parallel as direct
1040
+ * search backends — it does NOT recognize SearXNG natively. We expose
1041
+ * SearXNG (and any other MCP-shaped capability) to the agent via the
1042
+ * jishushell MCP firewall (see `runtime/mcp-shims/firewall.ts`).
1043
+ *
1044
+ * The firewall replaces the upstream package's `tools/list` description
1045
+ * with the canonical wording declared in app yaml's
1046
+ * `provides[].tool_schema` — preventing prompt-injection like the
1047
+ * "news / recent events" + `time_range` slots of upstream `mcp-searxng`,
1048
+ * which was rewriting Chinese queries into English and hallucinating
1049
+ * dates on MiniMax-class models.
1050
+ *
1051
+ * For each `SEARCH_API_BASE_URL` (or future MCP-shaped slot):
1052
+ * 1. Find the producing capability entry in the registry.
1053
+ * 2. If it carries `toolSchema`, drop firewall + config.json into
1054
+ * agent-home and write `mcp_servers.<cap_id>` pointing at it.
1055
+ * 3. If it doesn't (legacy yaml without §17 fields), fall back to
1056
+ * the PR 7 in-tree searxng-shim — kept for one release cycle as
1057
+ * backstop while community apps migrate.
1058
+ *
1059
+ * Other env (OPENAI_API_BASE_URL etc.) is a no-op here; the framework
1060
+ * still injects them through the Nomad driver's runtime env phase
1061
+ * and Hermes picks them up natively.
1062
+ */
1063
+ async applyConnectionEnv(instanceId, env) {
1064
+ const searchUrl = env.SEARCH_API_BASE_URL;
1065
+ if (typeof searchUrl !== "string")
1066
+ return;
1067
+ if (searchUrl === "") {
1068
+ // Empty value = unbind. Strip any connection-managed searxng /
1069
+ // search-* entries from mcp_servers so the next start doesn't keep
1070
+ // routing through a dead provider. We're conservative: only entries
1071
+ // we know we may have written (`searxng` for the legacy shim path,
1072
+ // and any `*_search` shaped key for the §17 firewall path's stable
1073
+ // alias) get removed.
1074
+ try {
1075
+ const paths = resolveHermesPaths(instanceId);
1076
+ if (!paths.primaryConfig || !existsSync(paths.primaryConfig))
1077
+ return;
1078
+ const yamlText = readFileSync(paths.primaryConfig, "utf-8");
1079
+ const parsed = YAML.parse(yamlText) ?? {};
1080
+ if (parsed?.mcp_servers && typeof parsed.mcp_servers === "object") {
1081
+ for (const key of Object.keys(parsed.mcp_servers)) {
1082
+ if (key === "searxng" || /(^|_)search$/.test(key)) {
1083
+ delete parsed.mcp_servers[key];
1084
+ }
1085
+ }
1086
+ }
1087
+ writeConfigFile(paths.primaryConfig, YAML.stringify(parsed).trimEnd() + "\n");
1088
+ }
1089
+ catch (e) {
1090
+ console.warn(`[hermes] applyConnectionEnv unbind failed for ${instanceId}: ${e.message}`);
1091
+ }
1092
+ return;
1093
+ }
1094
+ try {
1095
+ const paths = resolveHermesPaths(instanceId);
1096
+ ensureHermesConfigFiles(paths);
1097
+ const yamlText = readFileSync(paths.primaryConfig, "utf-8");
1098
+ const parsed = YAML.parse(yamlText) ?? {};
1099
+ parsed.mcp_servers = parsed.mcp_servers ?? {};
1100
+ // Try the §17 firewall path first — look up the producer capability
1101
+ // entry to find a tool_schema declared by the provider's yaml.
1102
+ const provider = findSearchProviderForUrl(searchUrl);
1103
+ const svcUser = resolveServiceUser();
1104
+ const serviceUser = svcUser ? { uid: svcUser.uid, gid: svcUser.gid } : undefined;
1105
+ if (provider?.toolSchema) {
1106
+ const upstreamEnv = resolveEnvTemplate(provider.toolSchema.upstream.env_template, env);
1107
+ const entry = writeMcpEntry({
1108
+ integrationHomeDir: paths.integrationHome,
1109
+ containerIntegrationHomeDir: HERMES_CONTAINER_HOME,
1110
+ capabilityId: provider.capability,
1111
+ toolSchema: provider.toolSchema,
1112
+ upstreamEnv,
1113
+ serviceUser,
1114
+ });
1115
+ // mcp_servers map key — use a stable short alias (the bare tool
1116
+ // name) so users editing config.yaml see something readable.
1117
+ const mapKey = provider.toolSchema.name.replace(/_web_search$|_search$/u, "")
1118
+ || provider.capability;
1119
+ parsed.mcp_servers[mapKey] = { ...entry, enabled: true };
1120
+ }
1121
+ else {
1122
+ // Fallback: legacy PR 7 per-capability shim. Strip trailing
1123
+ // /search to get the SearXNG origin for the shim's SEARXNG_URL env.
1124
+ // The URL is re-rendered from the registry on each instance start
1125
+ // (lifecycle connection refresh), so host IP changes are picked
1126
+ // up automatically when the user restarts the consuming agent.
1127
+ let baseUrl = searchUrl;
1128
+ try {
1129
+ const u = new URL(searchUrl);
1130
+ if (u.pathname === "/search" || u.pathname === "/search/") {
1131
+ u.pathname = "";
1132
+ baseUrl = u.toString().replace(/\/$/, "");
1133
+ }
1134
+ }
1135
+ catch {
1136
+ return;
1137
+ }
1138
+ const shimAbsPath = join(paths.integrationHome, SEARXNG_SHIM_REL_PATH);
1139
+ mkdirSync(dirname(shimAbsPath), { recursive: true });
1140
+ writeFileSync(shimAbsPath, SEARXNG_MCP_SHIM_SOURCE, { mode: 0o755 });
1141
+ try {
1142
+ if (serviceUser) {
1143
+ chownSync(dirname(shimAbsPath), serviceUser.uid, serviceUser.gid);
1144
+ chownSync(shimAbsPath, serviceUser.uid, serviceUser.gid);
1145
+ }
1146
+ }
1147
+ catch {
1148
+ /* best-effort */
1149
+ }
1150
+ parsed.mcp_servers.searxng = {
1151
+ command: "node",
1152
+ args: [`${HERMES_CONTAINER_HOME}/${SEARXNG_SHIM_REL_PATH}`],
1153
+ env: { SEARXNG_URL: baseUrl },
1154
+ enabled: true,
1155
+ };
1156
+ }
1157
+ writeConfigFile(paths.primaryConfig, YAML.stringify(parsed).trimEnd() + "\n");
1158
+ }
1159
+ catch (e) {
1160
+ console.warn(`[hermes] applyConnectionEnv failed for ${instanceId}: ${e.message}`);
1161
+ }
1162
+ }
1163
+ listConnectionSideEffectFiles(args) {
1164
+ const paths = resolveHermesPaths(args.instanceId);
1165
+ const integrationHome = paths.integrationHome;
1166
+ const files = new Set([
1167
+ paths.primaryConfig,
1168
+ paths.secretEnv,
1169
+ join(dirname(paths.secretEnv), "provider.env"),
1170
+ join(integrationHome, SEARXNG_SHIM_REL_PATH),
1171
+ ]);
1172
+ for (const binding of args.bindings) {
1173
+ for (const entry of binding.entries) {
1174
+ const shimDir = join(integrationHome, "__mcp_shims__", entry.capability);
1175
+ files.add(join(shimDir, "firewall.mjs"));
1176
+ files.add(join(shimDir, "config.json"));
1177
+ }
1178
+ }
1179
+ return Array.from(files);
1180
+ }
1181
+ async getRuntimeVersion(instanceId) {
1182
+ const catalog = getIntegrationRuntimeEntry("hermes");
1183
+ const digest = catalog?.defaultImageDigest;
1184
+ // Read per-instance SOURCE_REF from instance.json without introducing
1185
+ // a runtime→instance-manager cycle: late require to break the chain.
1186
+ // If the env isn't set, we are in baseline mode.
1187
+ let ref;
1188
+ try {
1189
+ const { getInstance } = await import("../../instances/manager.js");
1190
+ const meta = getInstance(instanceId);
1191
+ const envRef = meta?.runtime?.env?.JISHUSHELL_HERMES_SOURCE_REF;
1192
+ if (typeof envRef === "string" && envRef.trim())
1193
+ ref = envRef.trim();
1194
+ }
1195
+ catch {
1196
+ // best-effort: if instance lookup fails, report baseline
1197
+ }
1198
+ return {
1199
+ integrationKind: "hermes",
1200
+ ref,
1201
+ digest,
1202
+ mode: ref ? "overlay" : "baseline",
1203
+ };
1204
+ }
1205
+ async getConfigMeta(instanceId) {
1206
+ const doc = await this.readConfig(instanceId);
1207
+ return {
1208
+ integrationKind: "hermes",
1209
+ format: "yaml+env",
1210
+ schemaId: "hermes/v1",
1211
+ capabilities: this.defaultCapabilities,
1212
+ secretFields: doc.format === "yaml+env" ? secretEnvFields(doc.env) : [],
1213
+ runtimeVersion: await this.getRuntimeVersion(instanceId),
1214
+ };
1215
+ }
1216
+ async readConfig(instanceId) {
1217
+ const paths = resolveHermesPaths(instanceId);
1218
+ ensureHermesConfigFiles(paths);
1219
+ // Surface the instance.json `x-jishushell` meta block alongside yaml/env
1220
+ // so the Config form can round-trip per-instance upstream provider
1221
+ // overrides through the same ConfigDocument shape OpenClaw uses.
1222
+ const xJishushell = this.getStoredNativeConfig(instanceId)?.["x-jishushell"];
1223
+ const doc = {
1224
+ format: "yaml+env",
1225
+ yaml: readFileSync(paths.primaryConfig, "utf-8"),
1226
+ env: readFileSync(paths.secretEnv, "utf-8"),
1227
+ };
1228
+ if (xJishushell && typeof xJishushell === "object") {
1229
+ doc["x-jishushell"] = xJishushell;
1230
+ }
1231
+ return doc;
1232
+ }
1233
+ async writeConfig(instanceId, doc) {
1234
+ if (doc.format !== "yaml+env") {
1235
+ throw new Error(`Hermes config requires format="yaml+env", got "${doc.format}"`);
1236
+ }
1237
+ YAML.parse(doc.yaml);
1238
+ const envText = normalizeEnvText(doc.env);
1239
+ parseEnvFileFromText(envText);
1240
+ const paths = resolveHermesPaths(instanceId);
1241
+ ensureHermesConfigFiles(paths);
1242
+ // Atomicity: the x-jishushell save path (via llm-proxy.saveInstanceConfig)
1243
+ // can reject for reasons we only learn after some I/O — missing upstream
1244
+ // API key, provider.env write failure, etc. Snapshot the current YAML/ENV
1245
+ // contents BEFORE overwriting them so we can restore on failure and
1246
+ // callers never see a half-applied save (new YAML on disk + rejected
1247
+ // x-jishushell would leave the instance in a dirty state).
1248
+ const priorYaml = readFileSync(paths.primaryConfig, "utf-8");
1249
+ const priorEnv = readFileSync(paths.secretEnv, "utf-8");
1250
+ writeConfigFile(paths.primaryConfig, doc.yaml.trimEnd() + "\n");
1251
+ writeSecretFile(paths.secretEnv, envText);
1252
+ // If the caller included per-instance upstream metadata, route it
1253
+ // through the shared llm-proxy save flow — that path owns API key
1254
+ // encryption, provider.env persistence, rollback on secret failures,
1255
+ // and upstream cache invalidation. We deliberately reuse it instead
1256
+ // of duplicating the logic here so Hermes and OpenClaw agree bit-
1257
+ // for-bit on how per-instance provider config is stored.
1258
+ const xJishushell = doc["x-jishushell"];
1259
+ if (xJishushell && typeof xJishushell === "object") {
1260
+ try {
1261
+ const { saveInstanceConfig } = await import("../../llm-proxy/instance-proxy.js");
1262
+ await saveInstanceConfig(instanceId, { "x-jishushell": xJishushell });
1263
+ }
1264
+ catch (e) {
1265
+ try {
1266
+ writeConfigFile(paths.primaryConfig, priorYaml);
1267
+ writeSecretFile(paths.secretEnv, priorEnv);
1268
+ }
1269
+ catch (rollbackErr) {
1270
+ console.error(`[hermes] CRITICAL: YAML/ENV rollback failed for ${instanceId}:`, rollbackErr?.message || rollbackErr);
1271
+ }
1272
+ throw e;
1273
+ }
1274
+ }
1275
+ return this.readConfig(instanceId);
1276
+ }
1277
+ /**
1278
+ * Persist Feishu/Lark OAuth credentials returned by the device-flow
1279
+ * endpoints. The HTTP route belongs to the OpenClaw integration surface, but
1280
+ * persistence dispatches through the consumer integration here because Hermes
1281
+ * owns its private config/env layout.
1282
+ *
1283
+ * Hermes reads platform config from two places on every gateway start:
1284
+ * - `config.yaml` → `platforms.feishu.enabled` + `platforms.feishu.extra.*`
1285
+ * - `.env` → `FEISHU_APP_ID`, `FEISHU_APP_SECRET`
1286
+ *
1287
+ * We write into BOTH. The YAML holds structural config (enabled flag,
1288
+ * connection mode, domain) and references the secret env vars via
1289
+ * `${...}` interpolation. That way the YAML can be backed up / shared
1290
+ * without leaking credentials, and the real secrets live next to the
1291
+ * .env the user already edits.
1292
+ */
1293
+ saveFeishuCredentials(instanceId, creds) {
1294
+ if (!FEISHU_APP_ID_RE.test(creds.appId)) {
1295
+ throw new Error(`Invalid Feishu appId format: expected cli_<alnum> (got "${creds.appId}")`);
1296
+ }
1297
+ if (!creds.appSecret || typeof creds.appSecret !== "string" || creds.appSecret.length < 4) {
1298
+ throw new Error("Invalid Feishu appSecret: must be a non-empty string");
1299
+ }
1300
+ const domainName = creds.domain === "lark" ? "lark" : "feishu";
1301
+ const paths = resolveHermesPaths(instanceId);
1302
+ ensureHermesConfigFiles(paths);
1303
+ // Merge into existing YAML rather than overwrite — the user may have
1304
+ // customised model/terminal/custom_providers/etc. via the Config tab.
1305
+ const currentYaml = readFileSync(paths.primaryConfig, "utf-8");
1306
+ const parsed = YAML.parse(currentYaml) || {};
1307
+ parsed.platforms = parsed.platforms || {};
1308
+ const prior = parsed.platforms.feishu || {};
1309
+ const priorExtra = prior.extra || {};
1310
+ parsed.platforms.feishu = {
1311
+ ...prior,
1312
+ enabled: true,
1313
+ extra: {
1314
+ ...priorExtra,
1315
+ // Env interpolation: hermes expands ${FOO} at load time against
1316
+ // the process env, which Docker populates from agent-home/.env.
1317
+ app_id: "${FEISHU_APP_ID}",
1318
+ app_secret: "${FEISHU_APP_SECRET}",
1319
+ domain_name: domainName,
1320
+ connection_mode: priorExtra.connection_mode || "websocket",
1321
+ },
1322
+ };
1323
+ writeConfigFile(paths.primaryConfig, YAML.stringify(parsed).trimEnd() + "\n");
1324
+ // Env merge preserves unrelated keys (API_SERVER_KEY, JSPROXY_API_KEY, …).
1325
+ updateEnvFile(paths.secretEnv, {
1326
+ FEISHU_APP_ID: creds.appId,
1327
+ FEISHU_APP_SECRET: creds.appSecret,
1328
+ });
1329
+ console.log(`[hermes] Feishu credentials saved for ${instanceId}, domain=${domainName}`);
1330
+ }
1331
+ /**
1332
+ * Persist WeChat (personal-account) credentials returned by iLink Bot API's QR
1333
+ * login flow. Called from the shared `/api/instances/:id/weixin/login`
1334
+ * handler via `instance-manager.saveWeixinCredentials` → integration dispatch.
1335
+ *
1336
+ * Upstream Hermes's `WeixinAdapter.__init__` scans
1337
+ * `$HERMES_HOME/weixin/accounts/*.json` at startup and auto-connects every
1338
+ * account file it finds, so the handshake we persist here is everything
1339
+ * the runtime needs to come online after an instance restart. The JSON
1340
+ * shape is pinned to upstream's `save_weixin_account` helper:
1341
+ * `{token, base_url, user_id, saved_at}` with mode 0600.
1342
+ *
1343
+ * We also flip `platforms.weixin.enabled: true` in the instance's
1344
+ * config.yaml so the gateway actually tries to connect the integration on
1345
+ * next start (without it, hermes ignores the weixin folder entirely).
1346
+ */
1347
+ saveWeixinCredentials(instanceId, creds) {
1348
+ if (!creds.accountId || !SAFE_WEIXIN_ACCOUNT_ID_RE.test(creds.accountId)) {
1349
+ throw new Error(`Invalid WeChat accountId: must be 1-128 chars of [a-zA-Z0-9@._-], got "${creds.accountId}"`);
1350
+ }
1351
+ if (!creds.token || typeof creds.token !== "string" || creds.token.length < 4) {
1352
+ throw new Error("Invalid WeChat bot token: must be a non-empty string");
1353
+ }
1354
+ const home = resolveHermesPaths(instanceId).integrationHome;
1355
+ const accountsDir = join(home, "weixin", "accounts");
1356
+ ensureDirContainer(accountsDir);
1357
+ // Match upstream `save_weixin_account` exactly — WeixinAdapter reloads
1358
+ // this file at connect time so we can't improvise the field names.
1359
+ const payload = {
1360
+ token: creds.token,
1361
+ base_url: creds.baseUrl,
1362
+ user_id: creds.userId || "",
1363
+ saved_at: new Date().toISOString().replace(/\.\d+Z$/, "Z"),
1364
+ };
1365
+ const accountPath = join(accountsDir, `${creds.accountId}.json`);
1366
+ safeWriteJson(accountPath, payload);
1367
+ try {
1368
+ chmodSync(accountPath, 0o600);
1369
+ }
1370
+ catch { /* best effort */ }
1371
+ // Hermes runs as the `hermes` user inside the container; on the host
1372
+ // the bind-mount is owned by the core service user. `ensureDirContainer`
1373
+ // already handles ownership for the dir — file-level chown is a noop
1374
+ // in the container path and not available as a shared helper here, so
1375
+ // we rely on the directory permissions inheriting to the new file.
1376
+ // Enable platforms.weixin in config.yaml (merge, preserve other keys).
1377
+ // Upstream WeixinAdapter resolves startup credentials in this order at
1378
+ // init time (weixin.py:1066-1067):
1379
+ // token = config.token || extra.token || env WEIXIN_TOKEN
1380
+ // account_id = extra.account_id || env WEIXIN_ACCOUNT_ID
1381
+ // The per-account JSON we wrote above is state storage (refresh
1382
+ // cursor, context token cache), not the startup seed — without the
1383
+ // YAML + env entries below the integration crashes with
1384
+ // "WEIXIN_TOKEN is required".
1385
+ const paths = resolveHermesPaths(instanceId);
1386
+ ensureHermesConfigFiles(paths);
1387
+ const currentYaml = readFileSync(paths.primaryConfig, "utf-8");
1388
+ const parsed = YAML.parse(currentYaml) || {};
1389
+ parsed.platforms = parsed.platforms || {};
1390
+ const prior = parsed.platforms.weixin || {};
1391
+ const priorExtra = prior.extra || {};
1392
+ parsed.platforms.weixin = {
1393
+ ...prior,
1394
+ enabled: true,
1395
+ extra: {
1396
+ ...priorExtra,
1397
+ // Same env-interpolation convention used by the feishu save path:
1398
+ // YAML references ${VAR}, the real value lives in agent-home/.env.
1399
+ account_id: "${WEIXIN_ACCOUNT_ID}",
1400
+ token: "${WEIXIN_TOKEN}",
1401
+ },
1402
+ };
1403
+ writeConfigFile(paths.primaryConfig, YAML.stringify(parsed).trimEnd() + "\n");
1404
+ updateEnvFile(paths.secretEnv, {
1405
+ WEIXIN_ACCOUNT_ID: creds.accountId,
1406
+ WEIXIN_TOKEN: creds.token,
1407
+ });
1408
+ console.log(`[hermes] WeChat credentials saved for ${instanceId}, account=${creds.accountId}`);
1409
+ }
1410
+ /**
1411
+ * List connected WeChat accounts for an instance. Backs the panel UI's
1412
+ * "Connected Accounts" section in WeixinLoginPanel. Tolerates a missing
1413
+ * directory (returns empty) and skips sidecar files the runtime writes
1414
+ * alongside account records (sync buffers + context-token caches).
1415
+ */
1416
+ getWeixinAccounts(instanceId) {
1417
+ const home = resolveHermesPaths(instanceId).integrationHome;
1418
+ if (!home)
1419
+ return [];
1420
+ const accountsDir = join(home, "weixin", "accounts");
1421
+ if (!existsSync(accountsDir))
1422
+ return [];
1423
+ const results = [];
1424
+ for (const f of readdirSync(accountsDir)) {
1425
+ if (!f.endsWith(".json"))
1426
+ continue;
1427
+ // Skip sidecar files written by the runtime (sync cursor + context
1428
+ // token cache). They share the accounts dir but aren't accounts.
1429
+ if (f.endsWith(".sync.json") || f.endsWith(".context-tokens.json"))
1430
+ continue;
1431
+ try {
1432
+ const data = JSON.parse(readFileSync(join(accountsDir, f), "utf-8"));
1433
+ results.push({
1434
+ accountId: f.replace(/\.json$/, ""),
1435
+ userId: typeof data.user_id === "string" ? data.user_id : undefined,
1436
+ savedAt: typeof data.saved_at === "string" ? data.saved_at : undefined,
1437
+ });
1438
+ }
1439
+ catch {
1440
+ /* malformed account file — skip */
1441
+ }
1442
+ }
1443
+ return results;
1444
+ }
1445
+ /**
1446
+ * Rewrite only the host-side published gateway port.
1447
+ *
1448
+ * Hermes keeps listening on a fixed `HERMES_CONTAINER_PORT` inside the
1449
+ * container regardless of how Core publishes it; reallocation only
1450
+ * touches `hostPort`. Missing canonical `runtime.ports[]` is a migration
1451
+ * error for ordinary lifecycle paths.
1452
+ */
1453
+ reallocateRuntimePort(runtime, newPort) {
1454
+ if (Array.isArray(runtime.ports) && runtime.ports.length > 0) {
1455
+ runtime.ports = runtime.ports.map((port, idx) => idx === 0 ? { ...port, hostPort: newPort } : port);
1456
+ return;
1457
+ }
1458
+ throw new Error("[hermes-integration] reallocateRuntimePort: instance is missing canonical "
1459
+ + "runtime.ports[]; run migration or repair before reallocating.");
1460
+ }
1461
+ // Each integration owns its own Nomad job prefix, derived from the agent
1462
+ // type (`hermes-<id>`, `openclaw-<id>`, …). Any new runtime should
1463
+ // declare its own prefix here so job IDs are self-describing and
1464
+ // multiple runtime kinds never collide in the Nomad Raft namespace.
1465
+ nomadJobPrefix = "hermes-";
1466
+ // Startup-only Core configuration normalization. This pins the global
1467
+ // Hermes image reference in core.json; it never reads or writes an instance.
1468
+ normalizeCoreConfigOnStartup() {
1469
+ migrateHermesImageTagIfNeeded();
1470
+ }
1471
+ // Inline chat forwarder dispatch. Declaring this descriptor, rather than
1472
+ // hardcoding the secret env var or endpoint path in the route, lets another
1473
+ // runtime use the same JishuShell-rendered Chat surface without changing
1474
+ // framework code.
1475
+ inlineChatDescriptor = {
1476
+ apiKeyEnvVar: "API_SERVER_KEY",
1477
+ endpointPath: "/v1/chat/completions",
1478
+ };
1479
+ async buildPairingListCommand(_instanceId) {
1480
+ return ["hermes", "pairing", "list"];
1481
+ }
1482
+ async buildPairingApproveCommand(_instanceId, input) {
1483
+ return ["hermes", "pairing", "approve", input.channel, input.code];
1484
+ }
1485
+ // ── Legacy runtime install (aligned with OpenClaw pull flow) ──────────
1486
+ //
1487
+ // Pull-only flow — no local Dockerfile build fallback. Hermes ships as
1488
+ // a ~2.4 GB pre-built image on GHCR; building from upstream source on
1489
+ // a Raspberry Pi would take 20+ minutes and almost always fails on
1490
+ // resource-constrained hardware. If the pull fails we return a clear
1491
+ // error so the user can fix network / registry access rather than
1492
+ // silently burning an hour on a futile source build.
1493
+ //
1494
+ // Steps:
1495
+ // 1. docker image inspect — reuse existing local image if present
1496
+ // 2. docker pull ghcr.io/x-aijishu/hermes-runtime:latest
1497
+ // 3. capture RepoDigest for digest pinning (best-effort)
1498
+ // 4. Copy templates/hermes-entrypoint.sh to ~/.jishushell/runtimes/hermes/
1499
+ // 5. Write integration runtime record into core.json.runtime_catalog
1500
+ async installRuntime(_opts) {
1501
+ const task = createTask("hermes");
1502
+ try {
1503
+ await this.prepareHermesWithTask(task);
1504
+ if (task.status === "error") {
1505
+ return {
1506
+ ok: false,
1507
+ message: "Hermes installation failed",
1508
+ taskId: task.id,
1509
+ };
1510
+ }
1511
+ return {
1512
+ ok: true,
1513
+ message: "Hermes runtime installed",
1514
+ taskId: task.id,
1515
+ };
1516
+ }
1517
+ catch (e) {
1518
+ emitTask(task, { type: "error", message: `Hermes 安装失败: ${e.message}` });
1519
+ task.status = "error";
1520
+ return {
1521
+ ok: false,
1522
+ message: "Hermes installation failed",
1523
+ error: e.message,
1524
+ taskId: task.id,
1525
+ };
1526
+ }
1527
+ }
1528
+ /**
1529
+ * Non-blocking variant — returns a task id immediately and runs the
1530
+ * install in the background. Matches OpenClaw's startBuildRuntimeImage.
1531
+ */
1532
+ startInstallRuntime(_opts) {
1533
+ const task = createTask("hermes");
1534
+ this.prepareHermesWithTask(task).catch((e) => {
1535
+ // Mirror errors to stderr so post-mortem via journalctl works.
1536
+ // Task events live in memory and vanish after TASK_MAX_AGE / core
1537
+ // restart — leaving us blind if the UI stops polling before the
1538
+ // failure arrives.
1539
+ console.error(`[hermes] install failed (task=${task.id}):`, e?.stack || e?.message || e);
1540
+ emitTask(task, { type: "error", message: `Hermes 安装失败: ${e?.message || e}` });
1541
+ task.status = "error";
1542
+ });
1543
+ return { ok: true, message: "Hermes install started", taskId: task.id };
1544
+ }
1545
+ /**
1546
+ * Shared helper that pulls (or builds) the Hermes runtime image and
1547
+ * finalises the integration runtime record. Mirrors OpenClaw's
1548
+ * `pullOrBuildOpenclawImageWithTask` so both runtimes expose the same
1549
+ * install UX (local → pull → fallback build → digest pin).
1550
+ */
1551
+ async prepareHermesWithTask(task) {
1552
+ emitTask(task, { type: "progress", message: "准备 Hermes runtime...", progress: 0 });
1553
+ const invocation = resolveDockerInvocation();
1554
+ // Always pull. When the image is already local and up-to-date with
1555
+ // upstream, docker pull returns in a few seconds after a registry
1556
+ // digest check — the trade is worthwhile because it keeps "reinstall"
1557
+ // from turning into a three-second no-op. Failures are clearly
1558
+ // reported instead of silently retrying with a local fallback: Hermes
1559
+ // cannot be built locally (Python toolchain + wheels OOMs on Pi).
1560
+ emitTask(task, {
1561
+ type: "progress",
1562
+ message: `拉取 Hermes 镜像: ${HERMES_DEFAULT_IMAGE} (已缓存时约 10s)...`,
1563
+ progress: 10,
1564
+ });
1565
+ const pull = await spawnWithTask(task, invocation.cmd, [...invocation.argsPrefix, "pull", HERMES_DEFAULT_IMAGE], { timeout: 1800000 });
1566
+ if (!pull.ok) {
1567
+ console.error(`[hermes] docker pull failed for ${HERMES_DEFAULT_IMAGE} — output follows:\n${pull.output}`);
1568
+ emitTask(task, {
1569
+ type: "error",
1570
+ message: `Hermes 镜像拉取失败。请检查网络/registry 认证,或手动执行: docker pull ${HERMES_DEFAULT_IMAGE}`,
1571
+ });
1572
+ task.status = "error";
1573
+ return;
1574
+ }
1575
+ // 3. capture digest (best-effort)
1576
+ emitTask(task, { type: "progress", message: "捕获镜像 digest...", progress: 75 });
1577
+ const digest = captureImageDigest(HERMES_DEFAULT_IMAGE);
1578
+ if (digest) {
1579
+ emitTask(task, { type: "log", message: `Digest: ${digest}` });
1580
+ }
1581
+ else {
1582
+ emitTask(task, {
1583
+ type: "log",
1584
+ message: "No RepoDigest available (local build); will use :latest tag",
1585
+ });
1586
+ }
1587
+ // 4. pin the mutable tag to the image's LABEL version (e.g.
1588
+ // ghcr.io/…:latest → ghcr.io/…:0.10.0). Parity with OpenClaw's
1589
+ // migrateOpenclawImageTagIfNeeded: keeps core.json referencing an
1590
+ // immutable tag so nothing — Nomad image_pull, doctor, UI — ever
1591
+ // sees a mutable alias after install. No-op when the image was
1592
+ // locally built or lacks the LABEL.
1593
+ emitTask(task, { type: "progress", message: "锁定镜像版本标签...", progress: 85 });
1594
+ const pinnedTag = pinHermesImageToLabeledVersion(HERMES_DEFAULT_IMAGE);
1595
+ const storedImage = pinnedTag ?? HERMES_DEFAULT_IMAGE;
1596
+ if (pinnedTag) {
1597
+ emitTask(task, { type: "log", message: `Pinned tag: ${pinnedTag}` });
1598
+ }
1599
+ // 5. persist integration runtime record
1600
+ // The shim is baked into the image (see Dockerfile.hermes-slim's
1601
+ // COPY / LABEL). No host-side shim install needed anymore — we
1602
+ // verify the official RepoDigest at buildRuntime()/onBeforeStart time.
1603
+ emitTask(task, { type: "progress", message: "写入 integration runtime record...", progress: 95 });
1604
+ setIntegrationRuntimeEntry("hermes", {
1605
+ ...HERMES_CATALOG_DEFAULTS,
1606
+ defaultImage: storedImage,
1607
+ ...(digest ? { defaultImageDigest: digest } : {}),
1608
+ });
1609
+ emitTask(task, {
1610
+ type: "done",
1611
+ message: digest
1612
+ ? `Hermes 安装完成, 镜像已 pin 到 digest (tag=${storedImage})`
1613
+ : `Hermes 安装完成 (tag=${storedImage})`,
1614
+ progress: 100,
1615
+ });
1616
+ task.status = "done";
1617
+ }
1618
+ /**
1619
+ * Hermes readiness: the image must retain an official RepoDigest from
1620
+ * ghcr.io/x-aijishu/hermes-runtime. This accepts images pulled directly
1621
+ * from our registry (and docker save/load copies that preserve RepoDigests)
1622
+ * while rejecting arbitrary local retags that only look like Hermes runtime.
1623
+ */
1624
+ getInstallStatus() {
1625
+ const entry = getIntegrationRuntimeEntry("hermes");
1626
+ const storedImage = typeof entry?.defaultImage === "string" ? entry.defaultImage.trim() : "";
1627
+ if (storedImage) {
1628
+ const digest = readOfficialHermesRepoDigest(storedImage);
1629
+ if (digest) {
1630
+ return {
1631
+ installed: true,
1632
+ imageReady: true,
1633
+ version: imageTagVersion(storedImage),
1634
+ digest: entry?.defaultImageDigest ?? digest,
1635
+ };
1636
+ }
1637
+ const localImage = findLocalHermesImage();
1638
+ if (localImage) {
1639
+ persistHermesCatalogForImage(localImage.image, entry, localImage.digest);
1640
+ return {
1641
+ installed: true,
1642
+ imageReady: true,
1643
+ version: imageTagVersion(localImage.image),
1644
+ digest: localImage.digest,
1645
+ };
1646
+ }
1647
+ return {
1648
+ installed: true,
1649
+ imageReady: false,
1650
+ version: imageTagVersion(storedImage),
1651
+ digest: entry?.defaultImageDigest,
1652
+ };
1653
+ }
1654
+ const localImage = findLocalHermesImage();
1655
+ if (!localImage)
1656
+ return { installed: false, imageReady: false };
1657
+ persistHermesCatalogForImage(localImage.image, entry, localImage.digest);
1658
+ return {
1659
+ installed: true,
1660
+ imageReady: true,
1661
+ version: imageTagVersion(localImage.image),
1662
+ digest: localImage.digest,
1663
+ };
1664
+ }
1665
+ }
1666
+ export const hermesIntegration = new HermesIntegration();
1667
+ registerIntegration(hermesIntegration);
1668
+ //# sourceMappingURL=integration.js.map